Added built-in noVNC support.

Ylian Saint-Hilaire committed Jun 6, 2020 at 18:55 UTC 3a9b6464cc1845f53d3393b1e343a00f22236dc1
104 files changed +79292 -1809
meshuser.js
+10
@@ -3431,6 +3431,15 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
3431 node.rdpport = command.rdpport; change = 1; changes.push('rdpport'); // Set the RDP port
3432 }
3433 }
3434 +
3435 + if ((typeof command.rfbport == 'number') && (command.rfbport > 0) && (command.rfbport < 65536)) {
3436 + if ((command.rfbport == 5900) && (node.rfbport != null)) {
3437 + delete node.rfbport; change = 1; changes.push('rfbport'); // Delete the RFB port
3438 + } else {
3439 + node.rfbport = command.rfbport; change = 1; changes.push('rfbport'); // Set the RFB port
3440 + }
3441 + }
3442 +
3443 if (domain.geolocation && command.userloc && ((node.userloc == null) || (command.userloc[0] != node.userloc[0]) || (command.userloc[1] != node.userloc[1]))) {
3444 change = 1;
3445 if ((command.userloc.length == 0) && (node.userloc)) {
@@ -3463,6 +3472,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
3472 event.msg = 'Changed device ' + node.name + ' from group ' + mesh.name + ': ' + changes.join(', ');
3473 event.node = parent.CloneSafeNode(node);
3474 if (command.rdpport == 3389) { event.node.rdpport = 3389; }
3475 + if (command.rfbport == 5900) { event.node.rfbport = 5900; }
3476 if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the node. Another event will come.
3477 parent.parent.DispatchEvent(parent.CreateNodeDispatchTargets(node.meshid, node._id, [user._id]), obj, event);
3478 }
public/novnc/LICENSE.txt new
+68
@@ -0,0 +1,68 @@
1 +noVNC is Copyright (C) 2018 The noVNC Authors
2 +(./AUTHORS)
3 +
4 +The noVNC core library files are licensed under the MPL 2.0 (Mozilla
5 +Public License 2.0). The noVNC core library is composed of the
6 +Javascript code necessary for full noVNC operation. This includes (but
7 +is not limited to):
8 +
9 + core/**/*.js
10 + app/*.js
11 + test/playback.js
12 +
13 +The HTML, CSS, font and images files that included with the noVNC
14 +source distibution (or repository) are not considered part of the
15 +noVNC core library and are licensed under more permissive licenses.
16 +The intent is to allow easy integration of noVNC into existing web
17 +sites and web applications.
18 +
19 +The HTML, CSS, font and image files are licensed as follows:
20 +
21 + *.html : 2-Clause BSD license
22 +
23 + app/styles/*.css : 2-Clause BSD license
24 +
25 + app/styles/Orbitron* : SIL Open Font License 1.1
26 + (Copyright 2009 Matt McInerney)
27 +
28 + app/images/ : Creative Commons Attribution-ShareAlike
29 + http://creativecommons.org/licenses/by-sa/3.0/
30 +
31 +Some portions of noVNC are copyright to their individual authors.
32 +Please refer to the individual source files and/or to the noVNC commit
33 +history: https://github.com/novnc/noVNC/commits/master
34 +
35 +The are several files and projects that have been incorporated into
36 +the noVNC core library. Here is a list of those files and the original
37 +licenses (all MPL 2.0 compatible):
38 +
39 + core/base64.js : MPL 2.0
40 +
41 + core/des.js : Various BSD style licenses
42 +
43 + vendor/pako/ : MIT
44 +
45 + vendor/browser-es-module-loader/src/ : MIT
46 +
47 + vendor/browser-es-module-loader/dist/ : Various BSD style licenses
48 +
49 + vendor/promise.js : MIT
50 +
51 +Any other files not mentioned above are typically marked with
52 +a copyright/license header at the top of the file. The default noVNC
53 +license is MPL-2.0.
54 +
55 +The following license texts are included:
56 +
57 + docs/LICENSE.MPL-2.0
58 + docs/LICENSE.OFL-1.1
59 + docs/LICENSE.BSD-3-Clause (New BSD)
60 + docs/LICENSE.BSD-2-Clause (Simplified BSD / FreeBSD)
61 + vendor/pako/LICENSE (MIT)
62 +
63 +Or alternatively the license texts may be found here:
64 +
65 + http://www.mozilla.org/MPL/2.0/
66 + http://scripts.sil.org/OFL
67 + http://en.wikipedia.org/wiki/BSD_licenses
68 + https://opensource.org/licenses/MIT
public/novnc/app/error-handler.js new
+58
@@ -0,0 +1,58 @@
1 +// NB: this should *not* be included as a module until we have
2 +// native support in the browsers, so that our error handler
3 +// can catch script-loading errors.
4 +
5 +// No ES6 can be used in this file since it's used for the translation
6 +/* eslint-disable prefer-arrow-callback */
7 +
8 +(function _scope() {
9 + "use strict";
10 +
11 + // Fallback for all uncought errors
12 + function handleError(event, err) {
13 + try {
14 + const msg = document.getElementById('noVNC_fallback_errormsg');
15 +
16 + // Only show the initial error
17 + if (msg.hasChildNodes()) {
18 + return false;
19 + }
20 +
21 + let div = document.createElement("div");
22 + div.classList.add('noVNC_message');
23 + div.appendChild(document.createTextNode(event.message));
24 + msg.appendChild(div);
25 +
26 + if (event.filename) {
27 + div = document.createElement("div");
28 + div.className = 'noVNC_location';
29 + let text = event.filename;
30 + if (event.lineno !== undefined) {
31 + text += ":" + event.lineno;
32 + if (event.colno !== undefined) {
33 + text += ":" + event.colno;
34 + }
35 + }
36 + div.appendChild(document.createTextNode(text));
37 + msg.appendChild(div);
38 + }
39 +
40 + if (err && err.stack) {
41 + div = document.createElement("div");
42 + div.className = 'noVNC_stack';
43 + div.appendChild(document.createTextNode(err.stack));
44 + msg.appendChild(div);
45 + }
46 +
47 + document.getElementById('noVNC_fallback_error')
48 + .classList.add("noVNC_open");
49 + } catch (exc) {
50 + document.write("noVNC encountered an error.");
51 + }
52 + // Don't return true since this would prevent the error
53 + // from being printed to the browser console.
54 + return false;
55 + }
56 + window.addEventListener('error', function onerror(evt) { handleError(evt, evt.error); });
57 + window.addEventListener('unhandledrejection', function onreject(evt) { handleError(evt.reason, evt.reason); });
58 +})();
public/novnc/app/images/alt.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="alt.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="18.205425"
33 + inkscape:cy="17.531398"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <g
76 + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:48px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'Sans Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
77 + id="text5290">
78 + <path
79 + d="m 9.9560547,1042.3329 -2.9394531,0 -0.4638672,1.3281 -1.8896485,0 2.7001953,-7.29 2.241211,0 2.7001958,7.29 -1.889649,0 -0.4589843,-1.3281 z m -2.4707031,-1.3526 1.9970703,0 -0.9960938,-2.9003 -1.0009765,2.9003 z"
80 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
81 + id="path5340" />
82 + <path
83 + d="m 13.188477,1036.0634 1.748046,0 0,7.5976 -1.748046,0 0,-7.5976 z"
84 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
85 + id="path5342" />
86 + <path
87 + d="m 18.535156,1036.6395 0,1.5528 1.801758,0 0,1.25 -1.801758,0 0,2.3193 q 0,0.3809 0.151367,0.5176 0.151368,0.1318 0.600586,0.1318 l 0.898438,0 0,1.25 -1.499024,0 q -1.035156,0 -1.469726,-0.4297 -0.429688,-0.4345 -0.429688,-1.4697 l 0,-2.3193 -0.86914,0 0,-1.25 0.86914,0 0,-1.5528 1.748047,0 z"
88 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
89 + id="path5344" />
90 + </g>
91 + </g>
92 +</svg>
public/novnc/app/images/clipboard.svg new
+106
@@ -0,0 +1,106 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="clipboard.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="15.366606"
33 + inkscape:cy="16.42981"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + d="M 9,6 6,6 C 5.4459889,6 5,6.4459889 5,7 l 0,13 c 0,0.554011 0.4459889,1 1,1 l 13,0 c 0.554011,0 1,-0.445989 1,-1 L 20,7 C 20,6.4459889 19.554011,6 19,6 l -3,0"
78 + transform="translate(0,1027.3622)"
79 + id="rect6083"
80 + inkscape:connector-curvature="0"
81 + sodipodi:nodetypes="cssssssssc" />
82 + <rect
83 + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
84 + id="rect6085"
85 + width="7"
86 + height="4"
87 + x="9"
88 + y="1031.3622"
89 + ry="1.00002" />
90 + <path
91 + style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.50196081"
92 + d="m 8.5071212,1038.8622 7.9999998,0"
93 + id="path6087"
94 + inkscape:connector-curvature="0" />
95 + <path
96 + style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.50196081"
97 + d="m 8.5071212,1041.8622 3.9999998,0"
98 + id="path6089"
99 + inkscape:connector-curvature="0" />
100 + <path
101 + style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.50196081"
102 + d="m 8.5071212,1044.8622 5.9999998,0"
103 + id="path6091"
104 + inkscape:connector-curvature="0" />
105 + </g>
106 +</svg>
public/novnc/app/images/connect.svg new
+96
@@ -0,0 +1,96 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="connect.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="37.14834"
33 + inkscape:cy="1.9525926"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true">
53 + <inkscape:grid
54 + type="xygrid"
55 + id="grid4136" />
56 + </sodipodi:namedview>
57 + <metadata
58 + id="metadata7">
59 + <rdf:RDF>
60 + <cc:Work
61 + rdf:about="">
62 + <dc:format>image/svg+xml</dc:format>
63 + <dc:type
64 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
65 + <dc:title></dc:title>
66 + </cc:Work>
67 + </rdf:RDF>
68 + </metadata>
69 + <g
70 + inkscape:label="Layer 1"
71 + inkscape:groupmode="layer"
72 + id="layer1"
73 + transform="translate(0,-1027.3622)">
74 + <g
75 + id="g5103"
76 + transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,-729.15757,315.8823)">
77 + <path
78 + sodipodi:nodetypes="cssssc"
79 + inkscape:connector-curvature="0"
80 + id="rect5096"
81 + d="m 11,1040.3622 -5,0 c -1.108,0 -2,-0.892 -2,-2 l 0,-4 c 0,-1.108 0.892,-2 2,-2 l 5,0"
82 + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
83 + <path
84 + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
85 + d="m 14,1032.3622 5,0 c 1.108,0 2,0.892 2,2 l 0,4 c 0,1.108 -0.892,2 -2,2 l -5,0"
86 + id="path5099"
87 + inkscape:connector-curvature="0"
88 + sodipodi:nodetypes="cssssc" />
89 + <path
90 + inkscape:connector-curvature="0"
91 + id="path5101"
92 + d="m 9,1036.3622 7,0"
93 + style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
94 + </g>
95 + </g>
96 +</svg>
public/novnc/app/images/ctrl.svg new
+96
@@ -0,0 +1,96 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="ctrl.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="18.205425"
33 + inkscape:cy="17.531398"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <g
76 + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:48px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'Sans Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
77 + id="text5290">
78 + <path
79 + d="m 9.1210938,1043.1898 q -0.5175782,0.2686 -1.0791016,0.4053 -0.5615235,0.1367 -1.171875,0.1367 -1.8212891,0 -2.8857422,-1.0156 -1.0644531,-1.0205 -1.0644531,-2.7637 0,-1.748 1.0644531,-2.7637 1.0644531,-1.0205 2.8857422,-1.0205 0.6103515,0 1.171875,0.1368 0.5615234,0.1367 1.0791016,0.4052 l 0,1.5088 q -0.522461,-0.3564 -1.0302735,-0.5224 -0.5078125,-0.1661 -1.0693359,-0.1661 -1.0058594,0 -1.5820313,0.6446 -0.5761719,0.6445 -0.5761719,1.7773 0,1.1279 0.5761719,1.7725 0.5761719,0.6445 1.5820313,0.6445 0.5615234,0 1.0693359,-0.166 0.5078125,-0.166 1.0302735,-0.5225 l 0,1.5088 z"
80 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
81 + id="path5370" />
82 + <path
83 + d="m 12.514648,1036.5687 0,1.5528 1.801758,0 0,1.25 -1.801758,0 0,2.3193 q 0,0.3809 0.151368,0.5176 0.151367,0.1318 0.600586,0.1318 l 0.898437,0 0,1.25 -1.499023,0 q -1.035157,0 -1.469727,-0.4297 -0.429687,-0.4345 -0.429687,-1.4697 l 0,-2.3193 -0.8691411,0 0,-1.25 0.8691411,0 0,-1.5528 1.748046,0 z"
84 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
85 + id="path5372" />
86 + <path
87 + d="m 19.453125,1039.6107 q -0.229492,-0.1074 -0.458984,-0.1562 -0.22461,-0.054 -0.454102,-0.054 -0.673828,0 -1.040039,0.4345 -0.361328,0.4297 -0.361328,1.2354 l 0,2.5195 -1.748047,0 0,-5.4687 1.748047,0 0,0.8984 q 0.336914,-0.5371 0.771484,-0.7813 0.439453,-0.249 1.049805,-0.249 0.08789,0 0.19043,0.01 0.102539,0 0.297851,0.029 l 0.0049,1.582 z"
88 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
89 + id="path5374" />
90 + <path
91 + d="m 20.332031,1035.9926 1.748047,0 0,7.5976 -1.748047,0 0,-7.5976 z"
92 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
93 + id="path5376" />
94 + </g>
95 + </g>
96 +</svg>
public/novnc/app/images/ctrlaltdel.svg new
+100
@@ -0,0 +1,100 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="ctrlaltdel.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="8"
32 + inkscape:cx="11.135667"
33 + inkscape:cy="16.407428"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <rect
76 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + id="rect5253"
78 + width="5"
79 + height="5.0000172"
80 + x="16"
81 + y="1031.3622"
82 + ry="1.0000174" />
83 + <rect
84 + y="1043.3622"
85 + x="4"
86 + height="5.0000172"
87 + width="5"
88 + id="rect5255"
89 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
90 + ry="1.0000174" />
91 + <rect
92 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
93 + id="rect5257"
94 + width="5"
95 + height="5.0000172"
96 + x="13"
97 + y="1043.3622"
98 + ry="1.0000174" />
99 + </g>
100 +</svg>
public/novnc/app/images/disconnect.svg new
+94
@@ -0,0 +1,94 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="disconnect.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="25.05707"
33 + inkscape:cy="11.594858"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="false">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <g
76 + id="g5171"
77 + transform="translate(-24.062499,-6.15775e-4)">
78 + <path
79 + id="path5110"
80 + transform="translate(0,1027.3622)"
81 + d="m 39.744141,3.4960938 c -0.769923,0 -1.539607,0.2915468 -2.121094,0.8730468 l -2.566406,2.5664063 1.414062,1.4140625 2.566406,-2.5664063 c 0.403974,-0.404 1.010089,-0.404 1.414063,0 l 2.828125,2.828125 c 0.40398,0.4039 0.403907,1.0101621 0,1.4140629 l -2.566406,2.566406 1.414062,1.414062 2.566406,-2.566406 c 1.163041,-1.1629 1.162968,-3.0791874 0,-4.2421874 L 41.865234,4.3691406 C 41.283747,3.7876406 40.514063,3.4960937 39.744141,3.4960938 Z M 39.017578,9.015625 a 1.0001,1.0001 0 0 0 -0.6875,0.3027344 l -0.445312,0.4453125 1.414062,1.4140621 0.445313,-0.445312 A 1.0001,1.0001 0 0 0 39.017578,9.015625 Z m -6.363281,0.7070312 a 1.0001,1.0001 0 0 0 -0.6875,0.3027348 L 28.431641,13.5625 c -1.163042,1.163 -1.16297,3.079187 0,4.242188 l 2.828125,2.828124 c 1.162974,1.163101 3.079213,1.163101 4.242187,0 l 3.535156,-3.535156 a 1.0001,1.0001 0 1 0 -1.414062,-1.414062 l -3.535156,3.535156 c -0.403974,0.404 -1.010089,0.404 -1.414063,0 l -2.828125,-2.828125 c -0.403981,-0.404 -0.403908,-1.010162 0,-1.414063 l 3.535156,-3.537109 A 1.0001,1.0001 0 0 0 32.654297,9.7226562 Z m 3.109375,2.1621098 -2.382813,2.384765 a 1.0001,1.0001 0 1 0 1.414063,1.414063 l 2.382812,-2.384766 -1.414062,-1.414062 z"
82 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
83 + inkscape:connector-curvature="0" />
84 + <rect
85 + transform="matrix(0.70710678,-0.70710678,0.70710678,0.70710678,0,0)"
86 + y="752.29541"
87 + x="-712.31262"
88 + height="18.000017"
89 + width="3"
90 + id="rect5116"
91 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
92 + </g>
93 + </g>
94 +</svg>
public/novnc/app/images/drag.svg new
+76
@@ -0,0 +1,76 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="drag.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="22.627417"
32 + inkscape:cx="9.8789407"
33 + inkscape:cy="9.5008608"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="true"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1">
49 + <inkscape:grid
50 + type="xygrid"
51 + id="grid4136" />
52 + </sodipodi:namedview>
53 + <metadata
54 + id="metadata7">
55 + <rdf:RDF>
56 + <cc:Work
57 + rdf:about="">
58 + <dc:format>image/svg+xml</dc:format>
59 + <dc:type
60 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
61 + <dc:title></dc:title>
62 + </cc:Work>
63 + </rdf:RDF>
64 + </metadata>
65 + <g
66 + inkscape:label="Layer 1"
67 + inkscape:groupmode="layer"
68 + id="layer1"
69 + transform="translate(0,-1027.3622)">
70 + <path
71 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
72 + d="m 7.039733,1049.3037 c -0.4309106,-0.1233 -0.7932634,-0.4631 -0.9705434,-0.9103 -0.04922,-0.1241 -0.057118,-0.2988 -0.071321,-1.5771 l -0.015972,-1.4375 -0.328125,-0.082 c -0.7668138,-0.1927 -1.1897046,-0.4275 -1.7031253,-0.9457 -0.4586773,-0.4629 -0.6804297,-0.8433 -0.867034,-1.4875 -0.067215,-0.232 -0.068001,-0.2642 -0.078682,-3.2188 -0.012078,-3.341 -0.020337,-3.2012 0.2099452,-3.5555 0.2246623,-0.3458 0.5798271,-0.5892 0.9667343,-0.6626 0.092506,-0.017 0.531898,-0.032 0.9764271,-0.032 l 0.8082347,0 1.157e-4,1.336 c 1.125e-4,1.2779 0.00281,1.3403 0.062214,1.4378 0.091785,0.1505 0.2357707,0.226 0.4314082,0.2261 0.285389,2e-4 0.454884,-0.1352 0.5058962,-0.4042 0.019355,-0.102 0.031616,-0.982 0.031616,-2.269 0,-1.9756 0.00357,-2.1138 0.059205,-2.2926 0.1645475,-0.5287 0.6307616,-0.9246 1.19078,-1.0113 0.8000572,-0.1238 1.5711277,0.4446 1.6860387,1.2429 0.01732,0.1203 0.03177,0.8248 0.03211,1.5657 6.19e-4,1.3449 7.22e-4,1.347 0.07093,1.4499 0.108355,0.1587 0.255268,0.2248 0.46917,0.2108 0.204069,-0.013 0.316116,-0.08 0.413642,-0.2453 0.06028,-0.1024 0.06307,-0.1778 0.07862,-2.1218 0.01462,-1.8283 0.02124,-2.0285 0.07121,-2.1549 0.260673,-0.659 0.934894,-1.0527 1.621129,-0.9465 0.640523,0.099 1.152269,0.6104 1.243187,1.2421 0.01827,0.1269 0.03175,0.9943 0.03211,2.0657 l 6.19e-4,1.8469 0.07031,0.103 c 0.108355,0.1587 0.255267,0.2248 0.46917,0.2108 0.204069,-0.013 0.316115,-0.08 0.413642,-0.2453 0.05951,-0.1011 0.06329,-0.1786 0.07907,-1.6218 0.01469,-1.3438 0.02277,-1.5314 0.07121,-1.6549 0.257975,-0.6576 0.934425,-1.0527 1.620676,-0.9465 0.640522,0.099 1.152269,0.6104 1.243186,1.2421 0.0186,0.1292 0.03179,1.0759 0.03222,2.3125 7.15e-4,2.0335 0.0025,2.0966 0.06283,2.1956 0.09178,0.1505 0.235771,0.226 0.431409,0.2261 0.285388,2e-4 0.454884,-0.1352 0.505897,-0.4042 0.01874,-0.099 0.03161,-0.8192 0.03161,-1.769 0,-1.4848 0.0043,-1.6163 0.0592,-1.7926 0.164548,-0.5287 0.630762,-0.9246 1.19078,-1.0113 0.800057,-0.1238 1.571128,0.4446 1.686039,1.2429 0.04318,0.2999 0.04372,9.1764 5.78e-4,9.4531 -0.04431,0.2841 -0.217814,0.6241 -0.420069,0.8232 -0.320102,0.315 -0.63307,0.4268 -1.194973,0.4268 l -0.35281,0 -2.51e-4,1.2734 c -1.25e-4,0.7046 -0.01439,1.3642 -0.03191,1.4766 -0.06665,0.4274 -0.372966,0.8704 -0.740031,1.0702 -0.349999,0.1905 0.01748,0.18 -6.242199,0.1776 -5.3622439,0 -5.7320152,-0.01 -5.9121592,-0.057 l 1.4e-5,0 z"
73 + id="path4379"
74 + inkscape:connector-curvature="0" />
75 + </g>
76 +</svg>
public/novnc/app/images/error.svg new
+81
@@ -0,0 +1,81 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="error.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="14.00357"
33 + inkscape:cy="12.443398"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title />
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + d="M 7 3 C 4.7839905 3 3 4.7839905 3 7 L 3 18 C 3 20.21601 4.7839905 22 7 22 L 18 22 C 20.21601 22 22 20.21601 22 18 L 22 7 C 22 4.7839905 20.21601 3 18 3 L 7 3 z M 7.6992188 6 A 1.6916875 1.6924297 0 0 1 8.9121094 6.5117188 L 12.5 10.101562 L 16.087891 6.5117188 A 1.6916875 1.6924297 0 0 1 17.251953 6 A 1.6916875 1.6924297 0 0 1 18.480469 8.90625 L 14.892578 12.496094 L 18.480469 16.085938 A 1.6916875 1.6924297 0 1 1 16.087891 18.478516 L 12.5 14.888672 L 8.9121094 18.478516 A 1.6916875 1.6924297 0 1 1 6.5214844 16.085938 L 10.109375 12.496094 L 6.5214844 8.90625 A 1.6916875 1.6924297 0 0 1 7.6992188 6 z "
78 + transform="translate(0,1027.3622)"
79 + id="rect4135" />
80 + </g>
81 +</svg>
public/novnc/app/images/esc.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="esc.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="18.205425"
33 + inkscape:cy="17.531398"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="text5290"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <g
76 + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:48px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'Sans Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
77 + id="text5290">
78 + <path
79 + d="m 3.9331055,1036.1464 5.0732422,0 0,1.4209 -3.1933594,0 0,1.3574 3.0029297,0 0,1.4209 -3.0029297,0 0,1.6699 3.3007812,0 0,1.4209 -5.180664,0 0,-7.29 z"
80 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
81 + id="path5314" />
82 + <path
83 + d="m 14.963379,1038.1385 0,1.3282 q -0.561524,-0.2344 -1.083984,-0.3516 -0.522461,-0.1172 -0.986329,-0.1172 -0.498046,0 -0.742187,0.127 -0.239258,0.122 -0.239258,0.3808 0,0.21 0.180664,0.3223 0.185547,0.1123 0.65918,0.166 l 0.307617,0.044 q 1.342773,0.1709 1.806641,0.5615 0.463867,0.3906 0.463867,1.2256 0,0.874 -0.644531,1.3134 -0.644532,0.4395 -1.923829,0.4395 -0.541992,0 -1.123046,-0.088 -0.576172,-0.083 -1.186524,-0.2539 l 0,-1.3281 q 0.522461,0.2539 1.069336,0.3808 0.551758,0.127 1.118164,0.127 0.512695,0 0.771485,-0.1416 0.258789,-0.1416 0.258789,-0.4199 0,-0.2344 -0.180664,-0.3467 -0.175782,-0.1172 -0.708008,-0.1807 l -0.307617,-0.039 q -1.166993,-0.1465 -1.635743,-0.542 -0.46875,-0.3955 -0.46875,-1.2012 0,-0.8691 0.595703,-1.2891 0.595704,-0.4199 1.826172,-0.4199 0.483399,0 1.015625,0.073 0.532227,0.073 1.157227,0.2294 z"
84 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
85 + id="path5316" />
86 + <path
87 + d="m 21.066895,1038.1385 0,1.4258 q -0.356446,-0.2441 -0.717774,-0.3613 -0.356445,-0.1172 -0.742187,-0.1172 -0.732422,0 -1.142579,0.4297 -0.405273,0.4248 -0.405273,1.1914 0,0.7666 0.405273,1.1963 0.410157,0.4248 1.142579,0.4248 0.410156,0 0.776367,-0.1221 0.371094,-0.122 0.683594,-0.3613 l 0,1.4307 q -0.410157,0.1513 -0.834961,0.2246 -0.419922,0.078 -0.844727,0.078 -1.479492,0 -2.314453,-0.7568 -0.834961,-0.7618 -0.834961,-2.1143 0,-1.3525 0.834961,-2.1094 0.834961,-0.7617 2.314453,-0.7617 0.429688,0 0.844727,0.078 0.419921,0.073 0.834961,0.2246 z"
88 + style="font-size:10px;fill:#ffffff;fill-opacity:1"
89 + id="path5318" />
90 + </g>
91 + </g>
92 +</svg>
public/novnc/app/images/expander.svg new
+69
@@ -0,0 +1,69 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="9"
13 + height="10"
14 + viewBox="0 0 9 10"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="expander.svg">
19 + <defs
20 + id="defs4" />
21 + <sodipodi:namedview
22 + id="base"
23 + pagecolor="#ffffff"
24 + bordercolor="#666666"
25 + borderopacity="1.0"
26 + inkscape:pageopacity="0.0"
27 + inkscape:pageshadow="2"
28 + inkscape:zoom="45.254834"
29 + inkscape:cx="9.8737281"
30 + inkscape:cy="6.4583132"
31 + inkscape:document-units="px"
32 + inkscape:current-layer="layer1"
33 + showgrid="true"
34 + units="px"
35 + inkscape:snap-object-midpoints="false"
36 + inkscape:object-nodes="true"
37 + inkscape:window-width="1920"
38 + inkscape:window-height="1136"
39 + inkscape:window-x="0"
40 + inkscape:window-y="27"
41 + inkscape:window-maximized="1">
42 + <inkscape:grid
43 + type="xygrid"
44 + id="grid4136" />
45 + </sodipodi:namedview>
46 + <metadata
47 + id="metadata7">
48 + <rdf:RDF>
49 + <cc:Work
50 + rdf:about="">
51 + <dc:format>image/svg+xml</dc:format>
52 + <dc:type
53 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
54 + <dc:title></dc:title>
55 + </cc:Work>
56 + </rdf:RDF>
57 + </metadata>
58 + <g
59 + inkscape:label="Layer 1"
60 + inkscape:groupmode="layer"
61 + id="layer1"
62 + transform="translate(0,-1042.3622)">
63 + <path
64 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
65 + d="M 2.0800781,1042.3633 A 2.0002,2.0002 0 0 0 0,1044.3613 l 0,6 a 2.0002,2.0002 0 0 0 3.0292969,1.7168 l 5,-3 a 2.0002,2.0002 0 0 0 0,-3.4316 l -5,-3 a 2.0002,2.0002 0 0 0 -0.9492188,-0.2832 z"
66 + id="path4138"
67 + inkscape:connector-curvature="0" />
68 + </g>
69 +</svg>
public/novnc/app/images/fullscreen.svg new
+93
@@ -0,0 +1,93 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="fullscreen.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="16.400723"
33 + inkscape:cy="15.083758"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="false">
53 + <inkscape:grid
54 + type="xygrid"
55 + id="grid4136" />
56 + </sodipodi:namedview>
57 + <metadata
58 + id="metadata7">
59 + <rdf:RDF>
60 + <cc:Work
61 + rdf:about="">
62 + <dc:format>image/svg+xml</dc:format>
63 + <dc:type
64 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
65 + <dc:title></dc:title>
66 + </cc:Work>
67 + </rdf:RDF>
68 + </metadata>
69 + <g
70 + inkscape:label="Layer 1"
71 + inkscape:groupmode="layer"
72 + id="layer1"
73 + transform="translate(0,-1027.3622)">
74 + <rect
75 + style="opacity:1;fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
76 + id="rect5006"
77 + width="17"
78 + height="17.000017"
79 + x="4"
80 + y="1031.3622"
81 + ry="3.0000174" />
82 + <path
83 + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
84 + d="m 7.5,1044.8622 4,0 -1.5,-1.5 1.5,-1.5 -1,-1 -1.5,1.5 -1.5,-1.5 0,4 z"
85 + id="path5017"
86 + inkscape:connector-curvature="0" />
87 + <path
88 + inkscape:connector-curvature="0"
89 + id="path5025"
90 + d="m 17.5,1034.8622 -4,0 1.5,1.5 -1.5,1.5 1,1 1.5,-1.5 1.5,1.5 0,-4 z"
91 + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
92 + </g>
93 +</svg>
public/novnc/app/images/handle.svg new
+82
@@ -0,0 +1,82 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="5"
13 + height="6"
14 + viewBox="0 0 5 6"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="handle.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="32"
32 + inkscape:cx="1.3551778"
33 + inkscape:cy="8.7800329"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="true"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1046.3622)">
75 + <path
76 + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
77 + d="m 4.0000803,1049.3622 -3,-2 0,4 z"
78 + id="path4247"
79 + inkscape:connector-curvature="0"
80 + sodipodi:nodetypes="cccc" />
81 + </g>
82 +</svg>
public/novnc/app/images/handle_bg.svg new
+172
@@ -0,0 +1,172 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="15"
13 + height="50"
14 + viewBox="0 0 15 50"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="handle_bg.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="-10.001409"
33 + inkscape:cy="24.512566"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="true"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1002.3622)">
75 + <rect
76 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + id="rect4249"
78 + width="1"
79 + height="1.0000174"
80 + x="9.5"
81 + y="1008.8622"
82 + ry="1.7382812e-05" />
83 + <rect
84 + ry="1.7382812e-05"
85 + y="1013.8622"
86 + x="9.5"
87 + height="1.0000174"
88 + width="1"
89 + id="rect4255"
90 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
91 + <rect
92 + ry="1.7382812e-05"
93 + y="1008.8622"
94 + x="4.5"
95 + height="1.0000174"
96 + width="1"
97 + id="rect4261"
98 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
99 + <rect
100 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
101 + id="rect4263"
102 + width="1"
103 + height="1.0000174"
104 + x="4.5"
105 + y="1013.8622"
106 + ry="1.7382812e-05" />
107 + <rect
108 + ry="1.7382812e-05"
109 + y="1039.8622"
110 + x="9.5"
111 + height="1.0000174"
112 + width="1"
113 + id="rect4265"
114 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
115 + <rect
116 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
117 + id="rect4267"
118 + width="1"
119 + height="1.0000174"
120 + x="9.5"
121 + y="1044.8622"
122 + ry="1.7382812e-05" />
123 + <rect
124 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
125 + id="rect4269"
126 + width="1"
127 + height="1.0000174"
128 + x="4.5"
129 + y="1039.8622"
130 + ry="1.7382812e-05" />
131 + <rect
132 + ry="1.7382812e-05"
133 + y="1044.8622"
134 + x="4.5"
135 + height="1.0000174"
136 + width="1"
137 + id="rect4271"
138 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
139 + <rect
140 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
141 + id="rect4273"
142 + width="1"
143 + height="1.0000174"
144 + x="9.5"
145 + y="1018.8622"
146 + ry="1.7382812e-05" />
147 + <rect
148 + ry="1.7382812e-05"
149 + y="1018.8622"
150 + x="4.5"
151 + height="1.0000174"
152 + width="1"
153 + id="rect4275"
154 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
155 + <rect
156 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
157 + id="rect4277"
158 + width="1"
159 + height="1.0000174"
160 + x="9.5"
161 + y="1034.8622"
162 + ry="1.7382812e-05" />
163 + <rect
164 + ry="1.7382812e-05"
165 + y="1034.8622"
166 + x="4.5"
167 + height="1.0000174"
168 + width="1"
169 + id="rect4279"
170 + style="opacity:0.25;fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1" />
171 + </g>
172 +</svg>
public/novnc/app/images/info.svg new
+81
@@ -0,0 +1,81 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="info.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="15.720838"
33 + inkscape:cy="8.9111233"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title />
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + d="M 12.5 3 A 9.5 9.4999914 0 0 0 3 12.5 A 9.5 9.4999914 0 0 0 12.5 22 A 9.5 9.4999914 0 0 0 22 12.5 A 9.5 9.4999914 0 0 0 12.5 3 z M 12.5 5 A 1.5 1.5000087 0 0 1 14 6.5 A 1.5 1.5000087 0 0 1 12.5 8 A 1.5 1.5000087 0 0 1 11 6.5 A 1.5 1.5000087 0 0 1 12.5 5 z M 10.521484 8.9785156 L 12.521484 8.9785156 A 1.50015 1.50015 0 0 1 14.021484 10.478516 L 14.021484 15.972656 A 1.50015 1.50015 0 0 1 14.498047 18.894531 C 14.498047 18.894531 13.74301 19.228309 12.789062 18.912109 C 12.312092 18.754109 11.776235 18.366625 11.458984 17.828125 C 11.141734 17.289525 11.021484 16.668469 11.021484 15.980469 L 11.021484 11.980469 L 10.521484 11.980469 A 1.50015 1.50015 0 1 1 10.521484 8.9804688 L 10.521484 8.9785156 z "
78 + transform="translate(0,1027.3622)"
79 + id="path4136" />
80 + </g>
81 +</svg>
public/novnc/app/images/keyboard.svg new
+88
@@ -0,0 +1,88 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="keyboard.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/keyboard.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#717171"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="31.285341"
33 + inkscape:cy="8.8028469"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:snap-bbox-midpoints="false"
43 + inkscape:window-width="1920"
44 + inkscape:window-height="1136"
45 + inkscape:window-x="1920"
46 + inkscape:window-y="27"
47 + inkscape:window-maximized="1"
48 + inkscape:object-paths="true"
49 + inkscape:snap-intersection-paths="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-midpoints="true"
52 + inkscape:snap-smooth-nodes="true">
53 + <inkscape:grid
54 + type="xygrid"
55 + id="grid4136" />
56 + </sodipodi:namedview>
57 + <metadata
58 + id="metadata7">
59 + <rdf:RDF>
60 + <cc:Work
61 + rdf:about="">
62 + <dc:format>image/svg+xml</dc:format>
63 + <dc:type
64 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
65 + <dc:title />
66 + </cc:Work>
67 + </rdf:RDF>
68 + </metadata>
69 + <g
70 + inkscape:label="Layer 1"
71 + inkscape:groupmode="layer"
72 + id="layer1"
73 + transform="translate(0,-1027.3622)">
74 + <path
75 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
76 + d="M 7,3 C 4.8012876,3 3,4.8013 3,7 3,11.166667 3,15.333333 3,19.5 3,20.8764 4.1236413,22 5.5,22 l 14,0 C 20.876358,22 22,20.8764 22,19.5 22,15.333333 22,11.166667 22,7 22,4.8013 20.198712,3 18,3 Z m 0,2 11,0 c 1.125307,0 2,0.8747 2,2 L 20,12 5,12 5,7 C 5,5.8747 5.8746931,5 7,5 Z M 6.5,14 C 6.777,14 7,14.223 7,14.5 7,14.777 6.777,15 6.5,15 6.223,15 6,14.777 6,14.5 6,14.223 6.223,14 6.5,14 Z m 2,0 C 8.777,14 9,14.223 9,14.5 9,14.777 8.777,15 8.5,15 8.223,15 8,14.777 8,14.5 8,14.223 8.223,14 8.5,14 Z m 2,0 C 10.777,14 11,14.223 11,14.5 11,14.777 10.777,15 10.5,15 10.223,15 10,14.777 10,14.5 10,14.223 10.223,14 10.5,14 Z m 2,0 C 12.777,14 13,14.223 13,14.5 13,14.777 12.777,15 12.5,15 12.223,15 12,14.777 12,14.5 12,14.223 12.223,14 12.5,14 Z m 2,0 C 14.777,14 15,14.223 15,14.5 15,14.777 14.777,15 14.5,15 14.223,15 14,14.777 14,14.5 14,14.223 14.223,14 14.5,14 Z m 2,0 C 16.777,14 17,14.223 17,14.5 17,14.777 16.777,15 16.5,15 16.223,15 16,14.777 16,14.5 16,14.223 16.223,14 16.5,14 Z m 2,0 C 18.777,14 19,14.223 19,14.5 19,14.777 18.777,15 18.5,15 18.223,15 18,14.777 18,14.5 18,14.223 18.223,14 18.5,14 Z m -13,2 C 5.777,16 6,16.223 6,16.5 6,16.777 5.777,17 5.5,17 5.223,17 5,16.777 5,16.5 5,16.223 5.223,16 5.5,16 Z m 2,0 C 7.777,16 8,16.223 8,16.5 8,16.777 7.777,17 7.5,17 7.223,17 7,16.777 7,16.5 7,16.223 7.223,16 7.5,16 Z m 2,0 C 9.777,16 10,16.223 10,16.5 10,16.777 9.777,17 9.5,17 9.223,17 9,16.777 9,16.5 9,16.223 9.223,16 9.5,16 Z m 2,0 C 11.777,16 12,16.223 12,16.5 12,16.777 11.777,17 11.5,17 11.223,17 11,16.777 11,16.5 11,16.223 11.223,16 11.5,16 Z m 2,0 C 13.777,16 14,16.223 14,16.5 14,16.777 13.777,17 13.5,17 13.223,17 13,16.777 13,16.5 13,16.223 13.223,16 13.5,16 Z m 2,0 C 15.777,16 16,16.223 16,16.5 16,16.777 15.777,17 15.5,17 15.223,17 15,16.777 15,16.5 15,16.223 15.223,16 15.5,16 Z m 2,0 C 17.777,16 18,16.223 18,16.5 18,16.777 17.777,17 17.5,17 17.223,17 17,16.777 17,16.5 17,16.223 17.223,16 17.5,16 Z m 2,0 C 19.777,16 20,16.223 20,16.5 20,16.777 19.777,17 19.5,17 19.223,17 19,16.777 19,16.5 19,16.223 19.223,16 19.5,16 Z M 6,18 c 0.554,0 1,0.446 1,1 0,0.554 -0.446,1 -1,1 -0.554,0 -1,-0.446 -1,-1 0,-0.554 0.446,-1 1,-1 z m 2.8261719,0 7.3476561,0 C 16.631643,18 17,18.368372 17,18.826172 l 0,0.347656 C 17,19.631628 16.631643,20 16.173828,20 L 8.8261719,20 C 8.3683573,20 8,19.631628 8,19.173828 L 8,18.826172 C 8,18.368372 8.3683573,18 8.8261719,18 Z m 10.1113281,0 0.125,0 C 19.581551,18 20,18.4184 20,18.9375 l 0,0.125 C 20,19.5816 19.581551,20 19.0625,20 l -0.125,0 C 18.418449,20 18,19.5816 18,19.0625 l 0,-0.125 C 18,18.4184 18.418449,18 18.9375,18 Z"
77 + transform="translate(0,1027.3622)"
78 + id="rect4160"
79 + inkscape:connector-curvature="0"
80 + sodipodi:nodetypes="sccssccsssssccssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss" />
81 + <path
82 + style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1"
83 + d="m 12.499929,1033.8622 -2,2 1.500071,0 0,2 1,0 0,-2 1.499929,0 z"
84 + id="path4150"
85 + inkscape:connector-curvature="0"
86 + sodipodi:nodetypes="cccccccc" />
87 + </g>
88 +</svg>
public/novnc/app/images/mouse_left.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="mouse_left.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="11.313708"
32 + inkscape:cx="15.551515"
33 + inkscape:cy="12.205592"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#0068f6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="m 8,1030.3622 c -2.1987124,0 -4,1.8013 -4,4 l 0,2 5,0 0,-2 c 0,-1.4738 1.090393,-2.7071 2.5,-2.9492 l 0,-1.0508 -3.5,0 z"
78 + id="path6219" />
79 + <path
80 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
81 + d="m 13.5,1030.3622 0,1.0508 c 1.409607,0.2421 2.5,1.4754 2.5,2.9492 l 0,2 5,0 0,-2 c 0,-2.1987 -1.801288,-4 -4,-4 l -3.5,0 z"
82 + id="path6217" />
83 + <path
84 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
85 + d="m 12,1033.3622 c -0.571311,0 -1,0.4287 -1,1 l 0,5 c 0,0.5713 0.428689,1 1,1 l 1,0 c 0.571311,0 1,-0.4287 1,-1 l 0,-5 c 0,-0.5713 -0.428689,-1 -1,-1 l -1,0 z"
86 + id="path6215" />
87 + <path
88 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
89 + d="m 4,1038.3622 0,3.5 c 0,4.1377 3.362302,7.5 7.5,7.5 l 2,0 c 4.137698,0 7.5,-3.3623 7.5,-7.5 l 0,-3.5 -5,0 0,1 c 0,1.6447 -1.355293,3 -3,3 l -1,0 c -1.644707,0 -3,-1.3553 -3,-3 l 0,-1 -5,0 z"
90 + id="rect6178" />
91 + </g>
92 +</svg>
public/novnc/app/images/mouse_middle.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="mouse_middle.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="11.313708"
32 + inkscape:cx="15.551515"
33 + inkscape:cy="12.205592"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="m 8,1030.3622 c -2.1987124,0 -4,1.8013 -4,4 l 0,2 5,0 0,-2 c 0,-1.4738 1.090393,-2.7071 2.5,-2.9492 l 0,-1.0508 -3.5,0 z"
78 + id="path6219" />
79 + <path
80 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
81 + d="m 13.5,1030.3622 0,1.0508 c 1.409607,0.2421 2.5,1.4754 2.5,2.9492 l 0,2 5,0 0,-2 c 0,-2.1987 -1.801288,-4 -4,-4 l -3.5,0 z"
82 + id="path6217" />
83 + <path
84 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#0068f6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
85 + d="m 12,1033.3622 c -0.571311,0 -1,0.4287 -1,1 l 0,5 c 0,0.5713 0.428689,1 1,1 l 1,0 c 0.571311,0 1,-0.4287 1,-1 l 0,-5 c 0,-0.5713 -0.428689,-1 -1,-1 l -1,0 z"
86 + id="path6215" />
87 + <path
88 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
89 + d="m 4,1038.3622 0,3.5 c 0,4.1377 3.362302,7.5 7.5,7.5 l 2,0 c 4.137698,0 7.5,-3.3623 7.5,-7.5 l 0,-3.5 -5,0 0,1 c 0,1.6447 -1.355293,3 -3,3 l -1,0 c -1.644707,0 -3,-1.3553 -3,-3 l 0,-1 -5,0 z"
90 + id="rect6178" />
91 + </g>
92 +</svg>
public/novnc/app/images/mouse_none.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="mouse_none.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="23.160825"
33 + inkscape:cy="13.208262"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="m 8,1030.3622 c -2.1987124,0 -4,1.8013 -4,4 l 0,2 5,0 0,-2 c 0,-1.4738 1.090393,-2.7071 2.5,-2.9492 l 0,-1.0508 -3.5,0 z"
78 + id="path6219" />
79 + <path
80 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
81 + d="m 13.5,1030.3622 0,1.0508 c 1.409607,0.2421 2.5,1.4754 2.5,2.9492 l 0,2 5,0 0,-2 c 0,-2.1987 -1.801288,-4 -4,-4 l -3.5,0 z"
82 + id="path6217" />
83 + <path
84 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
85 + d="m 12,1033.3622 c -0.571311,0 -1,0.4287 -1,1 l 0,5 c 0,0.5713 0.428689,1 1,1 l 1,0 c 0.571311,0 1,-0.4287 1,-1 l 0,-5 c 0,-0.5713 -0.428689,-1 -1,-1 l -1,0 z"
86 + id="path6215" />
87 + <path
88 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
89 + d="m 4,1038.3622 0,3.5 c 0,4.1377 3.362302,7.5 7.5,7.5 l 2,0 c 4.137698,0 7.5,-3.3623 7.5,-7.5 l 0,-3.5 -5,0 0,1 c 0,1.6447 -1.355293,3 -3,3 l -1,0 c -1.644707,0 -3,-1.3553 -3,-3 l 0,-1 -5,0 z"
90 + id="rect6178" />
91 + </g>
92 +</svg>
public/novnc/app/images/mouse_right.svg new
+92
@@ -0,0 +1,92 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="mouse_right.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="11.313708"
32 + inkscape:cx="15.551515"
33 + inkscape:cy="12.205592"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="m 8,1030.3622 c -2.1987124,0 -4,1.8013 -4,4 l 0,2 5,0 0,-2 c 0,-1.4738 1.090393,-2.7071 2.5,-2.9492 l 0,-1.0508 -3.5,0 z"
78 + id="path6219" />
79 + <path
80 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#0068f6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
81 + d="m 13.5,1030.3622 0,1.0508 c 1.409607,0.2421 2.5,1.4754 2.5,2.9492 l 0,2 5,0 0,-2 c 0,-2.1987 -1.801288,-4 -4,-4 l -3.5,0 z"
82 + id="path6217" />
83 + <path
84 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
85 + d="m 12,1033.3622 c -0.571311,0 -1,0.4287 -1,1 l 0,5 c 0,0.5713 0.428689,1 1,1 l 1,0 c 0.571311,0 1,-0.4287 1,-1 l 0,-5 c 0,-0.5713 -0.428689,-1 -1,-1 l -1,0 z"
86 + id="path6215" />
87 + <path
88 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
89 + d="m 4,1038.3622 0,3.5 c 0,4.1377 3.362302,7.5 7.5,7.5 l 2,0 c 4.137698,0 7.5,-3.3623 7.5,-7.5 l 0,-3.5 -5,0 0,1 c 0,1.6447 -1.355293,3 -3,3 l -1,0 c -1.644707,0 -3,-1.3553 -3,-3 l 0,-1 -5,0 z"
90 + id="rect6178" />
91 + </g>
92 +</svg>
public/novnc/app/images/power.svg new
+87
@@ -0,0 +1,87 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="power.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="9.3159849"
33 + inkscape:cy="13.436208"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="M 9 6.8183594 C 6.3418164 8.1213032 4.5 10.849161 4.5 14 C 4.5 18.4065 8.0935666 22 12.5 22 C 16.906433 22 20.5 18.4065 20.5 14 C 20.5 10.849161 18.658184 8.1213032 16 6.8183594 L 16 9.125 C 17.514327 10.211757 18.5 11.984508 18.5 14 C 18.5 17.3256 15.825553 20 12.5 20 C 9.1744469 20 6.5 17.3256 6.5 14 C 6.5 11.984508 7.4856727 10.211757 9 9.125 L 9 6.8183594 z "
78 + transform="translate(0,1027.3622)"
79 + id="path6140" />
80 + <path
81 + style="fill:none;fill-rule:evenodd;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
82 + d="m 12.5,1031.8836 0,6.4786"
83 + id="path6142"
84 + inkscape:connector-curvature="0"
85 + sodipodi:nodetypes="cc" />
86 + </g>
87 +</svg>
public/novnc/app/images/settings.svg new
+76
@@ -0,0 +1,76 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="settings.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="22.627417"
32 + inkscape:cx="14.69683"
33 + inkscape:cy="8.8039511"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="true"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1">
49 + <inkscape:grid
50 + type="xygrid"
51 + id="grid4136" />
52 + </sodipodi:namedview>
53 + <metadata
54 + id="metadata7">
55 + <rdf:RDF>
56 + <cc:Work
57 + rdf:about="">
58 + <dc:format>image/svg+xml</dc:format>
59 + <dc:type
60 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
61 + <dc:title></dc:title>
62 + </cc:Work>
63 + </rdf:RDF>
64 + </metadata>
65 + <g
66 + inkscape:label="Layer 1"
67 + inkscape:groupmode="layer"
68 + id="layer1"
69 + transform="translate(0,-1027.3622)">
70 + <path
71 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
72 + d="M 11 3 L 11 5.1601562 A 7.5 7.5 0 0 0 8.3671875 6.2460938 L 6.84375 4.7226562 L 4.7226562 6.84375 L 6.2480469 8.3691406 A 7.5 7.5 0 0 0 5.1523438 11 L 3 11 L 3 14 L 5.1601562 14 A 7.5 7.5 0 0 0 6.2460938 16.632812 L 4.7226562 18.15625 L 6.84375 20.277344 L 8.3691406 18.751953 A 7.5 7.5 0 0 0 11 19.847656 L 11 22 L 14 22 L 14 19.839844 A 7.5 7.5 0 0 0 16.632812 18.753906 L 18.15625 20.277344 L 20.277344 18.15625 L 18.751953 16.630859 A 7.5 7.5 0 0 0 19.847656 14 L 22 14 L 22 11 L 19.839844 11 A 7.5 7.5 0 0 0 18.753906 8.3671875 L 20.277344 6.84375 L 18.15625 4.7226562 L 16.630859 6.2480469 A 7.5 7.5 0 0 0 14 5.1523438 L 14 3 L 11 3 z M 12.5 10 A 2.5 2.5 0 0 1 15 12.5 A 2.5 2.5 0 0 1 12.5 15 A 2.5 2.5 0 0 1 10 12.5 A 2.5 2.5 0 0 1 12.5 10 z "
73 + transform="translate(0,1027.3622)"
74 + id="rect4967" />
75 + </g>
76 +</svg>
public/novnc/app/images/tab.svg new
+86
@@ -0,0 +1,86 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="tab.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="16"
32 + inkscape:cx="11.67335"
33 + inkscape:cy="17.881696"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="true"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
77 + d="m 3,1031.3622 0,8 2,0 0,-4 0,-4 -2,0 z m 2,4 4,4 0,-3 13,0 0,-2 -13,0 0,-3 -4,4 z"
78 + id="rect5194"
79 + inkscape:connector-curvature="0" />
80 + <path
81 + id="path5211"
82 + d="m 22,1048.3622 0,-8 -2,0 0,4 0,4 2,0 z m -2,-4 -4,-4 0,3 -13,0 0,2 13,0 0,3 4,-4 z"
83 + style="opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
84 + inkscape:connector-curvature="0" />
85 + </g>
86 +</svg>
public/novnc/app/images/toggleextrakeys.svg new
+90
@@ -0,0 +1,90 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="extrakeys.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="15.234555"
33 + inkscape:cy="9.9710826"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="false">
53 + <inkscape:grid
54 + type="xygrid"
55 + id="grid4136" />
56 + </sodipodi:namedview>
57 + <metadata
58 + id="metadata7">
59 + <rdf:RDF>
60 + <cc:Work
61 + rdf:about="">
62 + <dc:format>image/svg+xml</dc:format>
63 + <dc:type
64 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
65 + <dc:title></dc:title>
66 + </cc:Work>
67 + </rdf:RDF>
68 + </metadata>
69 + <g
70 + inkscape:label="Layer 1"
71 + inkscape:groupmode="layer"
72 + id="layer1"
73 + transform="translate(0,-1027.3622)">
74 + <path
75 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
76 + d="m 8,1031.3622 c -2.1987124,0 -4,1.8013 -4,4 l 0,8.9996 c 0,2.1987 1.8012876,4 4,4 l 9,0 c 2.198712,0 4,-1.8013 4,-4 l 0,-8.9996 c 0,-2.1987 -1.801288,-4 -4,-4 z m 0,2 9,0 c 1.125307,0 2,0.8747 2,2 l 0,7.0005 c 0,1.1253 -0.874693,2 -2,2 l -9,0 c -1.1253069,0 -2,-0.8747 -2,-2 l 0,-7.0005 c 0,-1.1253 0.8746931,-2 2,-2 z"
77 + id="rect5006"
78 + inkscape:connector-curvature="0"
79 + sodipodi:nodetypes="ssssssssssssssssss" />
80 + <g
81 + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:10px;line-height:125%;font-family:'DejaVu Sans';-inkscape-font-specification:'Sans Bold';text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
82 + id="text4167"
83 + transform="matrix(0.96021948,0,0,0.96021948,0.18921715,41.80659)">
84 + <path
85 + d="m 14.292969,1040.6791 -2.939453,0 -0.463868,1.3281 -1.889648,0 2.700195,-7.29 2.241211,0 2.700196,7.29 -1.889649,0 -0.458984,-1.3281 z m -2.470703,-1.3526 1.99707,0 -0.996094,-2.9004 -1.000976,2.9004 z"
86 + id="path4172"
87 + inkscape:connector-curvature="0" />
88 + </g>
89 + </g>
90 +</svg>
public/novnc/app/images/warning.svg new
+81
@@ -0,0 +1,81 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Created with Inkscape (http://www.inkscape.org/) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + width="25"
13 + height="25"
14 + viewBox="0 0 25 25"
15 + id="svg2"
16 + version="1.1"
17 + inkscape:version="0.91 r13725"
18 + sodipodi:docname="warning.svg"
19 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
20 + inkscape:export-xdpi="90"
21 + inkscape:export-ydpi="90">
22 + <defs
23 + id="defs4" />
24 + <sodipodi:namedview
25 + id="base"
26 + pagecolor="#959595"
27 + bordercolor="#666666"
28 + borderopacity="1.0"
29 + inkscape:pageopacity="0"
30 + inkscape:pageshadow="2"
31 + inkscape:zoom="1"
32 + inkscape:cx="16.457343"
33 + inkscape:cy="12.179552"
34 + inkscape:document-units="px"
35 + inkscape:current-layer="layer1"
36 + showgrid="false"
37 + units="px"
38 + inkscape:snap-bbox="true"
39 + inkscape:bbox-paths="true"
40 + inkscape:bbox-nodes="true"
41 + inkscape:snap-bbox-edge-midpoints="true"
42 + inkscape:object-paths="true"
43 + showguides="false"
44 + inkscape:window-width="1920"
45 + inkscape:window-height="1136"
46 + inkscape:window-x="1920"
47 + inkscape:window-y="27"
48 + inkscape:window-maximized="1"
49 + inkscape:snap-smooth-nodes="true"
50 + inkscape:object-nodes="true"
51 + inkscape:snap-intersection-paths="true"
52 + inkscape:snap-nodes="true"
53 + inkscape:snap-global="true">
54 + <inkscape:grid
55 + type="xygrid"
56 + id="grid4136" />
57 + </sodipodi:namedview>
58 + <metadata
59 + id="metadata7">
60 + <rdf:RDF>
61 + <cc:Work
62 + rdf:about="">
63 + <dc:format>image/svg+xml</dc:format>
64 + <dc:type
65 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
66 + <dc:title></dc:title>
67 + </cc:Work>
68 + </rdf:RDF>
69 + </metadata>
70 + <g
71 + inkscape:label="Layer 1"
72 + inkscape:groupmode="layer"
73 + id="layer1"
74 + transform="translate(0,-1027.3622)">
75 + <path
76 + style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
77 + d="M 12.513672 3.0019531 C 11.751609 2.9919531 11.052563 3.4242687 10.710938 4.1054688 L 3.2109375 19.105469 C 2.5461937 20.435369 3.5132277 21.9999 5 22 L 20 22 C 21.486772 21.9999 22.453806 20.435369 21.789062 19.105469 L 14.289062 4.1054688 C 13.951849 3.4330688 13.265888 3.0066531 12.513672 3.0019531 z M 12.478516 6.9804688 A 1.50015 1.50015 0 0 1 14 8.5 L 14 14.5 A 1.50015 1.50015 0 1 1 11 14.5 L 11 8.5 A 1.50015 1.50015 0 0 1 12.478516 6.9804688 z M 12.5 17 A 1.5 1.5 0 0 1 14 18.5 A 1.5 1.5 0 0 1 12.5 20 A 1.5 1.5 0 0 1 11 18.5 A 1.5 1.5 0 0 1 12.5 17 z "
78 + transform="translate(0,1027.3622)"
79 + id="path4208" />
80 + </g>
81 +</svg>
public/novnc/app/images/windows.svg new
+85
@@ -0,0 +1,85 @@
1 +<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 +<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3 +
4 +<svg
5 + xmlns:dc="http://purl.org/dc/elements/1.1/"
6 + xmlns:cc="http://creativecommons.org/ns#"
7 + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 + xmlns:svg="http://www.w3.org/2000/svg"
9 + xmlns="http://www.w3.org/2000/svg"
10 + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 + version="1.1"
13 + id="svg2"
14 + inkscape:export-ydpi="90"
15 + inkscape:export-xdpi="90"
16 + sodipodi:docname="windows.svg"
17 + inkscape:export-filename="/home/ossman/devel/noVNC/images/drag.png"
18 + inkscape:version="0.92.3 (2405546, 2018-03-11)"
19 + x="0px"
20 + y="0px"
21 + viewBox="-293 384 25 23"
22 + xml:space="preserve"
23 + width="25"
24 + height="23"><metadata
25 + id="metadata21"><rdf:RDF><cc:Work
26 + rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
27 + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
28 + id="defs19" /><sodipodi:namedview
29 + pagecolor="#ffffff"
30 + bordercolor="#666666"
31 + borderopacity="1"
32 + objecttolerance="10"
33 + gridtolerance="10"
34 + guidetolerance="10"
35 + inkscape:pageopacity="0"
36 + inkscape:pageshadow="2"
37 + inkscape:window-width="1920"
38 + inkscape:window-height="1017"
39 + id="namedview17"
40 + showgrid="false"
41 + inkscape:pagecheckerboard="true"
42 + inkscape:zoom="9.44"
43 + inkscape:cx="-0.84745763"
44 + inkscape:cy="12.5"
45 + inkscape:window-x="2552"
46 + inkscape:window-y="122"
47 + inkscape:window-maximized="1"
48 + inkscape:current-layer="svg2" />
49 +<style
50 + type="text/css"
51 + id="style2">
52 + .st0{fill:#FFFFFF;}
53 +</style>
54 +<g
55 + id="g14"
56 + transform="matrix(1.2624869,0,0,1.3601695,73.614445,-144.84322)">
57 + <g
58 + id="g12">
59 + <path
60 + class="st0"
61 + d="m -277.4,396 c -0.7,0 -1.3,0 -2,0 -0.4,0 -0.5,-0.1 -0.5,-0.5 0,-1 0,-2 0,-3 0,-0.3 0.2,-0.5 0.5,-0.5 1.3,-0.1 2.6,-0.3 3.9,-0.4 0.4,0 0.7,0.1 0.7,0.6 0,1.1 0,2.2 0,3.3 0,0.4 -0.2,0.6 -0.6,0.6 -0.7,-0.1 -1.4,-0.1 -2,-0.1 z"
62 + id="path4"
63 + inkscape:connector-curvature="0"
64 + style="fill:#ffffff" />
65 + <path
66 + class="st0"
67 + d="m -274.9,399.3 c 0,0.6 0,1.1 0,1.7 0,0.4 -0.1,0.6 -0.6,0.6 -1.4,-0.1 -2.8,-0.3 -4.1,-0.4 -0.3,0 -0.4,-0.3 -0.4,-0.5 0,-1 0,-2 0,-3 0,-0.4 0.2,-0.5 0.6,-0.5 1.3,0 2.6,0 3.9,0 0.5,0 0.6,0.2 0.6,0.6 0,0.4 0,0.9 0,1.5 z"
68 + id="path6"
69 + inkscape:connector-curvature="0"
70 + style="fill:#ffffff" />
71 + <path
72 + class="st0"
73 + d="m -283.5,396 c -0.6,0 -1.3,0 -1.9,0 -0.4,0 -0.6,-0.1 -0.6,-0.6 0,-0.8 0,-1.5 0,-2.3 0,-0.4 0.2,-0.6 0.6,-0.7 1.3,-0.1 2.7,-0.3 4,-0.4 0.4,0 0.5,0.1 0.5,0.5 0,1 0,1.9 0,2.9 0,0.4 -0.2,0.5 -0.5,0.5 -0.8,0.1 -1.5,0.1 -2.1,0.1 z"
74 + id="path8"
75 + inkscape:connector-curvature="0"
76 + style="fill:#ffffff" />
77 + <path
78 + class="st0"
79 + d="m -283.5,397 c 0.6,0 1.3,0 1.9,0 0.4,0 0.6,0.1 0.6,0.5 0,1 0,1.9 0,2.9 0,0.4 -0.2,0.5 -0.5,0.5 -1.3,-0.1 -2.7,-0.3 -4,-0.4 -0.4,0 -0.6,-0.2 -0.6,-0.7 0,-0.7 0,-1.5 0,-2.2 0,-0.5 0.2,-0.7 0.7,-0.7 0.6,0.1 1.2,0.1 1.9,0.1 z"
80 + id="path10"
81 + inkscape:connector-curvature="0"
82 + style="fill:#ffffff" />
83 + </g>
84 +</g>
85 +</svg>
\ No newline at end of file
public/novnc/app/locale/cs.json new
+71
@@ -0,0 +1,71 @@
1 +{
2 + "Connecting...": "Připojení...",
3 + "Disconnecting...": "Odpojení...",
4 + "Reconnecting...": "Obnova připojení...",
5 + "Internal error": "Vnitřní chyba",
6 + "Must set host": "Hostitel musí být nastavení",
7 + "Connected (encrypted) to ": "Připojení (šifrované) k ",
8 + "Connected (unencrypted) to ": "Připojení (nešifrované) k ",
9 + "Something went wrong, connection is closed": "Něco se pokazilo, odpojeno",
10 + "Failed to connect to server": "Chyba připojení k serveru",
11 + "Disconnected": "Odpojeno",
12 + "New connection has been rejected with reason: ": "Nové připojení bylo odmítnuto s odůvodněním: ",
13 + "New connection has been rejected": "Nové připojení bylo odmítnuto",
14 + "Password is required": "Je vyžadováno heslo",
15 + "noVNC encountered an error:": "noVNC narazilo na chybu:",
16 + "Hide/Show the control bar": "Skrýt/zobrazit ovládací panel",
17 + "Move/Drag Viewport": "Přesunout/přetáhnout výřez",
18 + "viewport drag": "přesun výřezu",
19 + "Active Mouse Button": "Aktivní tlačítka myši",
20 + "No mousebutton": "Žádné",
21 + "Left mousebutton": "Levé tlačítko myši",
22 + "Middle mousebutton": "Prostřední tlačítko myši",
23 + "Right mousebutton": "Pravé tlačítko myši",
24 + "Keyboard": "Klávesnice",
25 + "Show Keyboard": "Zobrazit klávesnici",
26 + "Extra keys": "Extra klávesy",
27 + "Show Extra Keys": "Zobrazit extra klávesy",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "Přepnout Ctrl",
30 + "Alt": "Alt",
31 + "Toggle Alt": "Přepnout Alt",
32 + "Send Tab": "Odeslat tabulátor",
33 + "Tab": "Tab",
34 + "Esc": "Esc",
35 + "Send Escape": "Odeslat Esc",
36 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
37 + "Send Ctrl-Alt-Del": "Poslat Ctrl-Alt-Del",
38 + "Shutdown/Reboot": "Vypnutí/Restart",
39 + "Shutdown/Reboot...": "Vypnutí/Restart...",
40 + "Power": "Napájení",
41 + "Shutdown": "Vypnout",
42 + "Reboot": "Restart",
43 + "Reset": "Reset",
44 + "Clipboard": "Schránka",
45 + "Clear": "Vymazat",
46 + "Fullscreen": "Celá obrazovka",
47 + "Settings": "Nastavení",
48 + "Shared Mode": "Sdílený režim",
49 + "View Only": "Pouze prohlížení",
50 + "Clip to Window": "Přizpůsobit oknu",
51 + "Scaling Mode:": "Přizpůsobení velikosti",
52 + "None": "Žádné",
53 + "Local Scaling": "Místní",
54 + "Remote Resizing": "Vzdálené",
55 + "Advanced": "Pokročilé",
56 + "Repeater ID:": "ID opakovače",
57 + "WebSocket": "WebSocket",
58 + "Encrypt": "Šifrování:",
59 + "Host:": "Hostitel:",
60 + "Port:": "Port:",
61 + "Path:": "Cesta",
62 + "Automatic Reconnect": "Automatická obnova připojení",
63 + "Reconnect Delay (ms):": "Zpoždění připojení (ms)",
64 + "Show Dot when No Cursor": "Tečka místo chybějícího kurzoru myši",
65 + "Logging:": "Logování:",
66 + "Disconnect": "Odpojit",
67 + "Connect": "Připojit",
68 + "Password:": "Heslo",
69 + "Send Password": "Odeslat heslo",
70 + "Cancel": "Zrušit"
71 +}
\ No newline at end of file
public/novnc/app/locale/de.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "Verbinden...",
3 + "Disconnecting...": "Verbindung trennen...",
4 + "Reconnecting...": "Verbindung wiederherstellen...",
5 + "Internal error": "Interner Fehler",
6 + "Must set host": "Richten Sie den Server ein",
7 + "Connected (encrypted) to ": "Verbunden mit (verschlüsselt) ",
8 + "Connected (unencrypted) to ": "Verbunden mit (unverschlüsselt) ",
9 + "Something went wrong, connection is closed": "Etwas lief schief, Verbindung wurde getrennt",
10 + "Disconnected": "Verbindung zum Server getrennt",
11 + "New connection has been rejected with reason: ": "Verbindung wurde aus folgendem Grund abgelehnt: ",
12 + "New connection has been rejected": "Verbindung wurde abgelehnt",
13 + "Password is required": "Passwort ist erforderlich",
14 + "noVNC encountered an error:": "Ein Fehler ist aufgetreten:",
15 + "Hide/Show the control bar": "Kontrollleiste verstecken/anzeigen",
16 + "Move/Drag Viewport": "Ansichtsfenster verschieben/ziehen",
17 + "viewport drag": "Ansichtsfenster ziehen",
18 + "Active Mouse Button": "Aktive Maustaste",
19 + "No mousebutton": "Keine Maustaste",
20 + "Left mousebutton": "Linke Maustaste",
21 + "Middle mousebutton": "Mittlere Maustaste",
22 + "Right mousebutton": "Rechte Maustaste",
23 + "Keyboard": "Tastatur",
24 + "Show Keyboard": "Tastatur anzeigen",
25 + "Extra keys": "Zusatztasten",
26 + "Show Extra Keys": "Zusatztasten anzeigen",
27 + "Ctrl": "Strg",
28 + "Toggle Ctrl": "Strg umschalten",
29 + "Alt": "Alt",
30 + "Toggle Alt": "Alt umschalten",
31 + "Send Tab": "Tab senden",
32 + "Tab": "Tab",
33 + "Esc": "Esc",
34 + "Send Escape": "Escape senden",
35 + "Ctrl+Alt+Del": "Strg+Alt+Entf",
36 + "Send Ctrl-Alt-Del": "Strg+Alt+Entf senden",
37 + "Shutdown/Reboot": "Herunterfahren/Neustarten",
38 + "Shutdown/Reboot...": "Herunterfahren/Neustarten...",
39 + "Power": "Energie",
40 + "Shutdown": "Herunterfahren",
41 + "Reboot": "Neustarten",
42 + "Reset": "Zurücksetzen",
43 + "Clipboard": "Zwischenablage",
44 + "Clear": "Löschen",
45 + "Fullscreen": "Vollbild",
46 + "Settings": "Einstellungen",
47 + "Shared Mode": "Geteilter Modus",
48 + "View Only": "Nur betrachten",
49 + "Clip to Window": "Auf Fenster begrenzen",
50 + "Scaling Mode:": "Skalierungsmodus:",
51 + "None": "Keiner",
52 + "Local Scaling": "Lokales skalieren",
53 + "Remote Resizing": "Serverseitiges skalieren",
54 + "Advanced": "Erweitert",
55 + "Repeater ID:": "Repeater ID:",
56 + "WebSocket": "WebSocket",
57 + "Encrypt": "Verschlüsselt",
58 + "Host:": "Server:",
59 + "Port:": "Port:",
60 + "Path:": "Pfad:",
61 + "Automatic Reconnect": "Automatisch wiederverbinden",
62 + "Reconnect Delay (ms):": "Wiederverbindungsverzögerung (ms):",
63 + "Logging:": "Protokollierung:",
64 + "Disconnect": "Verbindung trennen",
65 + "Connect": "Verbinden",
66 + "Password:": "Passwort:",
67 + "Cancel": "Abbrechen",
68 + "Canvas not supported.": "Canvas nicht unterstützt."
69 +}
\ No newline at end of file
public/novnc/app/locale/el.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "Συνδέεται...",
3 + "Disconnecting...": "Aποσυνδέεται...",
4 + "Reconnecting...": "Επανασυνδέεται...",
5 + "Internal error": "Εσωτερικό σφάλμα",
6 + "Must set host": "Πρέπει να οριστεί ο διακομιστής",
7 + "Connected (encrypted) to ": "Συνδέθηκε (κρυπτογραφημένα) με το ",
8 + "Connected (unencrypted) to ": "Συνδέθηκε (μη κρυπτογραφημένα) με το ",
9 + "Something went wrong, connection is closed": "Κάτι πήγε στραβά, η σύνδεση διακόπηκε",
10 + "Disconnected": "Αποσυνδέθηκε",
11 + "New connection has been rejected with reason: ": "Η νέα σύνδεση απορρίφθηκε διότι: ",
12 + "New connection has been rejected": "Η νέα σύνδεση απορρίφθηκε ",
13 + "Password is required": "Απαιτείται ο κωδικός πρόσβασης",
14 + "noVNC encountered an error:": "το noVNC αντιμετώπισε ένα σφάλμα:",
15 + "Hide/Show the control bar": "Απόκρυψη/Εμφάνιση γραμμής ελέγχου",
16 + "Move/Drag Viewport": "Μετακίνηση/Σύρσιμο Θεατού πεδίου",
17 + "viewport drag": "σύρσιμο θεατού πεδίου",
18 + "Active Mouse Button": "Ενεργό Πλήκτρο Ποντικιού",
19 + "No mousebutton": "Χωρίς Πλήκτρο Ποντικιού",
20 + "Left mousebutton": "Αριστερό Πλήκτρο Ποντικιού",
21 + "Middle mousebutton": "Μεσαίο Πλήκτρο Ποντικιού",
22 + "Right mousebutton": "Δεξί Πλήκτρο Ποντικιού",
23 + "Keyboard": "Πληκτρολόγιο",
24 + "Show Keyboard": "Εμφάνιση Πληκτρολογίου",
25 + "Extra keys": "Επιπλέον πλήκτρα",
26 + "Show Extra Keys": "Εμφάνιση Επιπλέον Πλήκτρων",
27 + "Ctrl": "Ctrl",
28 + "Toggle Ctrl": "Εναλλαγή Ctrl",
29 + "Alt": "Alt",
30 + "Toggle Alt": "Εναλλαγή Alt",
31 + "Send Tab": "Αποστολή Tab",
32 + "Tab": "Tab",
33 + "Esc": "Esc",
34 + "Send Escape": "Αποστολή Escape",
35 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
36 + "Send Ctrl-Alt-Del": "Αποστολή Ctrl-Alt-Del",
37 + "Shutdown/Reboot": "Κλείσιμο/Επανεκκίνηση",
38 + "Shutdown/Reboot...": "Κλείσιμο/Επανεκκίνηση...",
39 + "Power": "Απενεργοποίηση",
40 + "Shutdown": "Κλείσιμο",
41 + "Reboot": "Επανεκκίνηση",
42 + "Reset": "Επαναφορά",
43 + "Clipboard": "Πρόχειρο",
44 + "Clear": "Καθάρισμα",
45 + "Fullscreen": "Πλήρης Οθόνη",
46 + "Settings": "Ρυθμίσεις",
47 + "Shared Mode": "Κοινόχρηστη Λειτουργία",
48 + "View Only": "Μόνο Θέαση",
49 + "Clip to Window": "Αποκοπή στο όριο του Παράθυρου",
50 + "Scaling Mode:": "Λειτουργία Κλιμάκωσης:",
51 + "None": "Καμία",
52 + "Local Scaling": "Τοπική Κλιμάκωση",
53 + "Remote Resizing": "Απομακρυσμένη Αλλαγή μεγέθους",
54 + "Advanced": "Για προχωρημένους",
55 + "Repeater ID:": "Repeater ID:",
56 + "WebSocket": "WebSocket",
57 + "Encrypt": "Κρυπτογράφηση",
58 + "Host:": "Όνομα διακομιστή:",
59 + "Port:": "Πόρτα διακομιστή:",
60 + "Path:": "Διαδρομή:",
61 + "Automatic Reconnect": "Αυτόματη επανασύνδεση",
62 + "Reconnect Delay (ms):": "Καθυστέρηση επανασύνδεσης (ms):",
63 + "Logging:": "Καταγραφή:",
64 + "Disconnect": "Αποσύνδεση",
65 + "Connect": "Σύνδεση",
66 + "Password:": "Κωδικός Πρόσβασης:",
67 + "Cancel": "Ακύρωση",
68 + "Canvas not supported.": "Δεν υποστηρίζεται το στοιχείο Canvas"
69 +}
\ No newline at end of file
public/novnc/app/locale/es.json new
+68
@@ -0,0 +1,68 @@
1 +{
2 + "Connecting...": "Conectando...",
3 + "Connected (encrypted) to ": "Conectado (con encriptación) a",
4 + "Connected (unencrypted) to ": "Conectado (sin encriptación) a",
5 + "Disconnecting...": "Desconectando...",
6 + "Disconnected": "Desconectado",
7 + "Must set host": "Debes configurar el host",
8 + "Reconnecting...": "Reconectando...",
9 + "Password is required": "Contraseña es obligatoria",
10 + "Disconnect timeout": "Tiempo de desconexión agotado",
11 + "noVNC encountered an error:": "noVNC ha encontrado un error:",
12 + "Hide/Show the control bar": "Ocultar/Mostrar la barra de control",
13 + "Move/Drag Viewport": "Mover/Arrastrar la ventana",
14 + "viewport drag": "Arrastrar la ventana",
15 + "Active Mouse Button": "Botón activo del ratón",
16 + "No mousebutton": "Ningún botón del ratón",
17 + "Left mousebutton": "Botón izquierdo del ratón",
18 + "Middle mousebutton": "Botón central del ratón",
19 + "Right mousebutton": "Botón derecho del ratón",
20 + "Keyboard": "Teclado",
21 + "Show Keyboard": "Mostrar teclado",
22 + "Extra keys": "Teclas adicionales",
23 + "Show Extra Keys": "Mostrar Teclas Adicionales",
24 + "Ctrl": "Ctrl",
25 + "Toggle Ctrl": "Pulsar/Soltar Ctrl",
26 + "Alt": "Alt",
27 + "Toggle Alt": "Pulsar/Soltar Alt",
28 + "Send Tab": "Enviar Tabulación",
29 + "Tab": "Tabulación",
30 + "Esc": "Esc",
31 + "Send Escape": "Enviar Escape",
32 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
33 + "Send Ctrl-Alt-Del": "Enviar Ctrl+Alt+Del",
34 + "Shutdown/Reboot": "Apagar/Reiniciar",
35 + "Shutdown/Reboot...": "Apagar/Reiniciar...",
36 + "Power": "Encender",
37 + "Shutdown": "Apagar",
38 + "Reboot": "Reiniciar",
39 + "Reset": "Restablecer",
40 + "Clipboard": "Portapapeles",
41 + "Clear": "Vaciar",
42 + "Fullscreen": "Pantalla Completa",
43 + "Settings": "Configuraciones",
44 + "Shared Mode": "Modo Compartido",
45 + "View Only": "Solo visualización",
46 + "Clip to Window": "Recortar al tamaño de la ventana",
47 + "Scaling Mode:": "Modo de escalado:",
48 + "None": "Ninguno",
49 + "Local Scaling": "Escalado Local",
50 + "Local Downscaling": "Reducción de escala local",
51 + "Remote Resizing": "Cambio de tamaño remoto",
52 + "Advanced": "Avanzado",
53 + "Local Cursor": "Cursor Local",
54 + "Repeater ID:": "ID del Repetidor",
55 + "WebSocket": "WebSocket",
56 + "Encrypt": "",
57 + "Host:": "Host",
58 + "Port:": "Puesto",
59 + "Path:": "Ruta",
60 + "Automatic Reconnect": "Reconexión automática",
61 + "Reconnect Delay (ms):": "Retraso en la reconexión (ms)",
62 + "Logging:": "Logging",
63 + "Disconnect": "Desconectar",
64 + "Connect": "Conectar",
65 + "Password:": "Contraseña",
66 + "Cancel": "Cancelar",
67 + "Canvas not supported.": "Canvas no está soportado"
68 +}
\ No newline at end of file
public/novnc/app/locale/ko.json new
+70
@@ -0,0 +1,70 @@
1 +{
2 + "Connecting...": "연결중...",
3 + "Disconnecting...": "연결 해제중...",
4 + "Reconnecting...": "재연결중...",
5 + "Internal error": "내부 오류",
6 + "Must set host": "호스트는 설정되어야 합니다.",
7 + "Connected (encrypted) to ": "다음과 (암호화되어) 연결되었습니다:",
8 + "Connected (unencrypted) to ": "다음과 (암호화 없이) 연결되었습니다:",
9 + "Something went wrong, connection is closed": "무언가 잘못되었습니다, 연결이 닫혔습니다.",
10 + "Failed to connect to server": "서버에 연결하지 못했습니다.",
11 + "Disconnected": "연결이 해제되었습니다.",
12 + "New connection has been rejected with reason: ": "새 연결이 다음 이유로 거부되었습니다:",
13 + "New connection has been rejected": "새 연결이 거부되었습니다.",
14 + "Password is required": "비밀번호가 필요합니다.",
15 + "noVNC encountered an error:": "noVNC에 오류가 발생했습니다:",
16 + "Hide/Show the control bar": "컨트롤 바 숨기기/보이기",
17 + "Move/Drag Viewport": "움직이기/드래그 뷰포트",
18 + "viewport drag": "뷰포트 드래그",
19 + "Active Mouse Button": "마우스 버튼 활성화",
20 + "No mousebutton": "마우스 버튼 없음",
21 + "Left mousebutton": "왼쪽 마우스 버튼",
22 + "Middle mousebutton": "중간 마우스 버튼",
23 + "Right mousebutton": "오른쪽 마우스 버튼",
24 + "Keyboard": "키보드",
25 + "Show Keyboard": "키보드 보이기",
26 + "Extra keys": "기타 키들",
27 + "Show Extra Keys": "기타 키들 보이기",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "Ctrl 켜기/끄기",
30 + "Alt": "Alt",
31 + "Toggle Alt": "Alt 켜기/끄기",
32 + "Send Tab": "Tab 보내기",
33 + "Tab": "Tab",
34 + "Esc": "Esc",
35 + "Send Escape": "Esc 보내기",
36 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
37 + "Send Ctrl-Alt-Del": "Ctrl+Alt+Del 보내기",
38 + "Shutdown/Reboot": "셧다운/리붓",
39 + "Shutdown/Reboot...": "셧다운/리붓...",
40 + "Power": "전원",
41 + "Shutdown": "셧다운",
42 + "Reboot": "리붓",
43 + "Reset": "리셋",
44 + "Clipboard": "클립보드",
45 + "Clear": "지우기",
46 + "Fullscreen": "전체화면",
47 + "Settings": "설정",
48 + "Shared Mode": "공유 모드",
49 + "View Only": "보기 전용",
50 + "Clip to Window": "창에 클립",
51 + "Scaling Mode:": "스케일링 모드:",
52 + "None": "없음",
53 + "Local Scaling": "로컬 스케일링",
54 + "Remote Resizing": "원격 크기 조절",
55 + "Advanced": "고급",
56 + "Repeater ID:": "중계 ID",
57 + "WebSocket": "웹소켓",
58 + "Encrypt": "암호화",
59 + "Host:": "호스트:",
60 + "Port:": "포트:",
61 + "Path:": "위치:",
62 + "Automatic Reconnect": "자동 재연결",
63 + "Reconnect Delay (ms):": "재연결 지연 시간 (ms)",
64 + "Logging:": "로깅",
65 + "Disconnect": "연결 해제",
66 + "Connect": "연결",
67 + "Password:": "비밀번호:",
68 + "Send Password": "비밀번호 전송",
69 + "Cancel": "취소"
70 +}
\ No newline at end of file
public/novnc/app/locale/nl.json new
+73
@@ -0,0 +1,73 @@
1 +{
2 + "Connecting...": "Verbinden...",
3 + "Disconnecting...": "Verbinding verbreken...",
4 + "Reconnecting...": "Opnieuw verbinding maken...",
5 + "Internal error": "Interne fout",
6 + "Must set host": "Host moeten worden ingesteld",
7 + "Connected (encrypted) to ": "Verbonden (versleuteld) met ",
8 + "Connected (unencrypted) to ": "Verbonden (onversleuteld) met ",
9 + "Something went wrong, connection is closed": "Er iets fout gelopen, verbinding werd verbroken",
10 + "Failed to connect to server": "Verbinding maken met server is mislukt",
11 + "Disconnected": "Verbinding verbroken",
12 + "New connection has been rejected with reason: ": "Nieuwe verbinding is geweigerd omwille van de volgende reden: ",
13 + "New connection has been rejected": "Nieuwe verbinding is geweigerd",
14 + "Password is required": "Wachtwoord is vereist",
15 + "noVNC encountered an error:": "noVNC heeft een fout bemerkt:",
16 + "Hide/Show the control bar": "Verberg/Toon de bedieningsbalk",
17 + "Move/Drag Viewport": "Verplaats/Versleep Kijkvenster",
18 + "viewport drag": "kijkvenster slepen",
19 + "Active Mouse Button": "Actieve Muisknop",
20 + "No mousebutton": "Geen muisknop",
21 + "Left mousebutton": "Linker muisknop",
22 + "Middle mousebutton": "Middelste muisknop",
23 + "Right mousebutton": "Rechter muisknop",
24 + "Keyboard": "Toetsenbord",
25 + "Show Keyboard": "Toon Toetsenbord",
26 + "Extra keys": "Extra toetsen",
27 + "Show Extra Keys": "Toon Extra Toetsen",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "Ctrl omschakelen",
30 + "Alt": "Alt",
31 + "Toggle Alt": "Alt omschakelen",
32 + "Toggle Windows": "Windows omschakelen",
33 + "Windows": "Windows",
34 + "Send Tab": "Tab Sturen",
35 + "Tab": "Tab",
36 + "Esc": "Esc",
37 + "Send Escape": "Escape Sturen",
38 + "Ctrl+Alt+Del": "Ctrl-Alt-Del",
39 + "Send Ctrl-Alt-Del": "Ctrl-Alt-Del Sturen",
40 + "Shutdown/Reboot": "Uitschakelen/Herstarten",
41 + "Shutdown/Reboot...": "Uitschakelen/Herstarten...",
42 + "Power": "Systeem",
43 + "Shutdown": "Uitschakelen",
44 + "Reboot": "Herstarten",
45 + "Reset": "Resetten",
46 + "Clipboard": "Klembord",
47 + "Clear": "Wissen",
48 + "Fullscreen": "Volledig Scherm",
49 + "Settings": "Instellingen",
50 + "Shared Mode": "Gedeelde Modus",
51 + "View Only": "Alleen Kijken",
52 + "Clip to Window": "Randen buiten venster afsnijden",
53 + "Scaling Mode:": "Schaalmodus:",
54 + "None": "Geen",
55 + "Local Scaling": "Lokaal Schalen",
56 + "Remote Resizing": "Op Afstand Formaat Wijzigen",
57 + "Advanced": "Geavanceerd",
58 + "Repeater ID:": "Repeater ID:",
59 + "WebSocket": "WebSocket",
60 + "Encrypt": "Versleutelen",
61 + "Host:": "Host:",
62 + "Port:": "Poort:",
63 + "Path:": "Pad:",
64 + "Automatic Reconnect": "Automatisch Opnieuw Verbinden",
65 + "Reconnect Delay (ms):": "Vertraging voor Opnieuw Verbinden (ms):",
66 + "Show Dot when No Cursor": "Geef stip weer indien geen cursor",
67 + "Logging:": "Logmeldingen:",
68 + "Disconnect": "Verbinding verbreken",
69 + "Connect": "Verbinden",
70 + "Password:": "Wachtwoord:",
71 + "Send Password": "Verzend Wachtwoord:",
72 + "Cancel": "Annuleren"
73 +}
\ No newline at end of file
public/novnc/app/locale/pl.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "Łączenie...",
3 + "Disconnecting...": "Rozłączanie...",
4 + "Reconnecting...": "Łączenie...",
5 + "Internal error": "Błąd wewnętrzny",
6 + "Must set host": "Host i port są wymagane",
7 + "Connected (encrypted) to ": "Połączenie (szyfrowane) z ",
8 + "Connected (unencrypted) to ": "Połączenie (nieszyfrowane) z ",
9 + "Something went wrong, connection is closed": "Coś poszło źle, połączenie zostało zamknięte",
10 + "Disconnected": "Rozłączony",
11 + "New connection has been rejected with reason: ": "Nowe połączenie zostało odrzucone z powodu: ",
12 + "New connection has been rejected": "Nowe połączenie zostało odrzucone",
13 + "Password is required": "Hasło jest wymagane",
14 + "noVNC encountered an error:": "noVNC napotkało błąd:",
15 + "Hide/Show the control bar": "Pokaż/Ukryj pasek ustawień",
16 + "Move/Drag Viewport": "Ruszaj/Przeciągaj Viewport",
17 + "viewport drag": "przeciągnij viewport",
18 + "Active Mouse Button": "Aktywny Przycisk Myszy",
19 + "No mousebutton": "Brak przycisku myszy",
20 + "Left mousebutton": "Lewy przycisk myszy",
21 + "Middle mousebutton": "Środkowy przycisk myszy",
22 + "Right mousebutton": "Prawy przycisk myszy",
23 + "Keyboard": "Klawiatura",
24 + "Show Keyboard": "Pokaż klawiaturę",
25 + "Extra keys": "Przyciski dodatkowe",
26 + "Show Extra Keys": "Pokaż przyciski dodatkowe",
27 + "Ctrl": "Ctrl",
28 + "Toggle Ctrl": "Przełącz Ctrl",
29 + "Alt": "Alt",
30 + "Toggle Alt": "Przełącz Alt",
31 + "Send Tab": "Wyślij Tab",
32 + "Tab": "Tab",
33 + "Esc": "Esc",
34 + "Send Escape": "Wyślij Escape",
35 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
36 + "Send Ctrl-Alt-Del": "Wyślij Ctrl-Alt-Del",
37 + "Shutdown/Reboot": "Wyłącz/Uruchom ponownie",
38 + "Shutdown/Reboot...": "Wyłącz/Uruchom ponownie...",
39 + "Power": "Włączony",
40 + "Shutdown": "Wyłącz",
41 + "Reboot": "Uruchom ponownie",
42 + "Reset": "Resetuj",
43 + "Clipboard": "Schowek",
44 + "Clear": "Wyczyść",
45 + "Fullscreen": "Pełny ekran",
46 + "Settings": "Ustawienia",
47 + "Shared Mode": "Tryb Współdzielenia",
48 + "View Only": "Tylko Podgląd",
49 + "Clip to Window": "Przytnij do Okna",
50 + "Scaling Mode:": "Tryb Skalowania:",
51 + "None": "Brak",
52 + "Local Scaling": "Skalowanie lokalne",
53 + "Remote Resizing": "Skalowanie zdalne",
54 + "Advanced": "Zaawansowane",
55 + "Repeater ID:": "ID Repeatera:",
56 + "WebSocket": "WebSocket",
57 + "Encrypt": "Szyfrowanie",
58 + "Host:": "Host:",
59 + "Port:": "Port:",
60 + "Path:": "Ścieżka:",
61 + "Automatic Reconnect": "Automatycznie wznawiaj połączenie",
62 + "Reconnect Delay (ms):": "Opóźnienie wznawiania (ms):",
63 + "Logging:": "Poziom logowania:",
64 + "Disconnect": "Rozłącz",
65 + "Connect": "Połącz",
66 + "Password:": "Hasło:",
67 + "Cancel": "Anuluj",
68 + "Canvas not supported.": "Element Canvas nie jest wspierany."
69 +}
\ No newline at end of file
public/novnc/app/locale/ru.json new
+73
@@ -0,0 +1,73 @@
1 +{
2 + "Connecting...": "Подключение...",
3 + "Disconnecting...": "Отключение...",
4 + "Reconnecting...": "Переподключение...",
5 + "Internal error": "Внутренняя ошибка",
6 + "Must set host": "Задайте имя сервера или IP",
7 + "Connected (encrypted) to ": "Подключено (с шифрованием) к ",
8 + "Connected (unencrypted) to ": "Подключено (без шифрования) к ",
9 + "Something went wrong, connection is closed": "Что-то пошло не так, подключение разорвано",
10 + "Failed to connect to server": "Ошибка подключения к серверу",
11 + "Disconnected": "Отключено",
12 + "New connection has been rejected with reason: ": "Подключиться не удалось: ",
13 + "New connection has been rejected": "Подключиться не удалось",
14 + "Password is required": "Требуется пароль",
15 + "noVNC encountered an error:": "Ошибка noVNC: ",
16 + "Hide/Show the control bar": "Скрыть/Показать контрольную панель",
17 + "Move/Drag Viewport": "Переместить окно",
18 + "viewport drag": "Переместить окно",
19 + "Active Mouse Button": "Активировать кнопки мыши",
20 + "No mousebutton": "Отключить кнопки мыши",
21 + "Left mousebutton": "Левая кнопка мыши",
22 + "Middle mousebutton": "Средняя кнопка мыши",
23 + "Right mousebutton": "Правая кнопка мыши",
24 + "Keyboard": "Клавиатура",
25 + "Show Keyboard": "Показать клавиатуру",
26 + "Extra keys": "Доп. кнопки",
27 + "Show Extra Keys": "Показать дополнительные кнопки",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "Передать нажатие Ctrl",
30 + "Alt": "Alt",
31 + "Toggle Alt": "Передать нажатие Alt",
32 + "Toggle Windows": "Переключение вкладок",
33 + "Windows": "Вкладка",
34 + "Send Tab": "Передать нажатие Tab",
35 + "Tab": "Tab",
36 + "Esc": "Esc",
37 + "Send Escape": "Передать нажатие Escape",
38 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
39 + "Send Ctrl-Alt-Del": "Передать нажатие Ctrl-Alt-Del",
40 + "Shutdown/Reboot": "Выключить/Перезагрузить",
41 + "Shutdown/Reboot...": "Выключить/Перезагрузить...",
42 + "Power": "Питание",
43 + "Shutdown": "Выключить",
44 + "Reboot": "Перезагрузить",
45 + "Reset": "Сброс",
46 + "Clipboard": "Буфер обмена",
47 + "Clear": "Очистить",
48 + "Fullscreen": "Во весь экран",
49 + "Settings": "Настройки",
50 + "Shared Mode": "Общий режим",
51 + "View Only": "Просмотр",
52 + "Clip to Window": "В окно",
53 + "Scaling Mode:": "Масштаб:",
54 + "None": "Нет",
55 + "Local Scaling": "Локльный масштаб",
56 + "Remote Resizing": "Удаленный масштаб",
57 + "Advanced": "Дополнительно",
58 + "Repeater ID:": "Идентификатор ID:",
59 + "WebSocket": "WebSocket",
60 + "Encrypt": "Шифрование",
61 + "Host:": "Сервер:",
62 + "Port:": "Порт:",
63 + "Path:": "Путь:",
64 + "Automatic Reconnect": "Автоматическое переподключение",
65 + "Reconnect Delay (ms):": "Задержка переподключения (мс):",
66 + "Show Dot when No Cursor": "Показать точку вместо курсора",
67 + "Logging:": "Лог:",
68 + "Disconnect": "Отключение",
69 + "Connect": "Подключение",
70 + "Password:": "Пароль:",
71 + "Send Password": "Пароль: ",
72 + "Cancel": "Выход"
73 +}
\ No newline at end of file
public/novnc/app/locale/sv.json new
+73
@@ -0,0 +1,73 @@
1 +{
2 + "Connecting...": "Ansluter...",
3 + "Disconnecting...": "Kopplar ner...",
4 + "Reconnecting...": "Återansluter...",
5 + "Internal error": "Internt fel",
6 + "Must set host": "Du måste specifiera en värd",
7 + "Connected (encrypted) to ": "Ansluten (krypterat) till ",
8 + "Connected (unencrypted) to ": "Ansluten (okrypterat) till ",
9 + "Something went wrong, connection is closed": "Något gick fel, anslutningen avslutades",
10 + "Failed to connect to server": "Misslyckades att ansluta till servern",
11 + "Disconnected": "Frånkopplad",
12 + "New connection has been rejected with reason: ": "Ny anslutning har blivit nekad med följande skäl: ",
13 + "New connection has been rejected": "Ny anslutning har blivit nekad",
14 + "Password is required": "Lösenord krävs",
15 + "noVNC encountered an error:": "noVNC stötte på ett problem:",
16 + "Hide/Show the control bar": "Göm/Visa kontrollbaren",
17 + "Move/Drag Viewport": "Flytta/Dra Vyn",
18 + "viewport drag": "dra vy",
19 + "Active Mouse Button": "Aktiv musknapp",
20 + "No mousebutton": "Ingen musknapp",
21 + "Left mousebutton": "Vänster musknapp",
22 + "Middle mousebutton": "Mitten-musknapp",
23 + "Right mousebutton": "Höger musknapp",
24 + "Keyboard": "Tangentbord",
25 + "Show Keyboard": "Visa Tangentbord",
26 + "Extra keys": "Extraknappar",
27 + "Show Extra Keys": "Visa Extraknappar",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "Växla Ctrl",
30 + "Alt": "Alt",
31 + "Toggle Alt": "Växla Alt",
32 + "Toggle Windows": "Växla Windows",
33 + "Windows": "Windows",
34 + "Send Tab": "Skicka Tab",
35 + "Tab": "Tab",
36 + "Esc": "Esc",
37 + "Send Escape": "Skicka Escape",
38 + "Ctrl+Alt+Del": "Ctrl+Alt+Del",
39 + "Send Ctrl-Alt-Del": "Skicka Ctrl-Alt-Del",
40 + "Shutdown/Reboot": "Stäng av/Boota om",
41 + "Shutdown/Reboot...": "Stäng av/Boota om...",
42 + "Power": "Ström",
43 + "Shutdown": "Stäng av",
44 + "Reboot": "Boota om",
45 + "Reset": "Återställ",
46 + "Clipboard": "Urklipp",
47 + "Clear": "Rensa",
48 + "Fullscreen": "Fullskärm",
49 + "Settings": "Inställningar",
50 + "Shared Mode": "Delat Läge",
51 + "View Only": "Endast Visning",
52 + "Clip to Window": "Begränsa till Fönster",
53 + "Scaling Mode:": "Skalningsläge:",
54 + "None": "Ingen",
55 + "Local Scaling": "Lokal Skalning",
56 + "Remote Resizing": "Ändra Storlek",
57 + "Advanced": "Avancerat",
58 + "Repeater ID:": "Repeater-ID:",
59 + "WebSocket": "WebSocket",
60 + "Encrypt": "Kryptera",
61 + "Host:": "Värd:",
62 + "Port:": "Port:",
63 + "Path:": "Sökväg:",
64 + "Automatic Reconnect": "Automatisk Återanslutning",
65 + "Reconnect Delay (ms):": "Fördröjning (ms):",
66 + "Show Dot when No Cursor": "Visa prick när ingen muspekare finns",
67 + "Logging:": "Loggning:",
68 + "Disconnect": "Koppla från",
69 + "Connect": "Anslut",
70 + "Password:": "Lösenord:",
71 + "Send Password": "Skicka lösenord",
72 + "Cancel": "Avbryt"
73 +}
\ No newline at end of file
public/novnc/app/locale/tr.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "Bağlanıyor...",
3 + "Disconnecting...": "Bağlantı kesiliyor...",
4 + "Reconnecting...": "Yeniden bağlantı kuruluyor...",
5 + "Internal error": "İç hata",
6 + "Must set host": "Sunucuyu kur",
7 + "Connected (encrypted) to ": "Bağlı (şifrelenmiş)",
8 + "Connected (unencrypted) to ": "Bağlandı (şifrelenmemiş)",
9 + "Something went wrong, connection is closed": "Bir şeyler ters gitti, bağlantı kesildi",
10 + "Disconnected": "Bağlantı kesildi",
11 + "New connection has been rejected with reason: ": "Bağlantı aşağıdaki nedenlerden dolayı reddedildi: ",
12 + "New connection has been rejected": "Bağlantı reddedildi",
13 + "Password is required": "Şifre gerekli",
14 + "noVNC encountered an error:": "Bir hata oluştu:",
15 + "Hide/Show the control bar": "Denetim masasını Gizle/Göster",
16 + "Move/Drag Viewport": "Görünümü Taşı/Sürükle",
17 + "viewport drag": "Görüntü penceresini sürükle",
18 + "Active Mouse Button": "Aktif Fare Düğmesi",
19 + "No mousebutton": "Fare düğmesi yok",
20 + "Left mousebutton": "Farenin sol düğmesi",
21 + "Middle mousebutton": "Farenin orta düğmesi",
22 + "Right mousebutton": "Farenin sağ düğmesi",
23 + "Keyboard": "Klavye",
24 + "Show Keyboard": "Klavye Düzenini Göster",
25 + "Extra keys": "Ekstra tuşlar",
26 + "Show Extra Keys": "Ekstra tuşları göster",
27 + "Ctrl": "Ctrl",
28 + "Toggle Ctrl": "Ctrl Değiştir ",
29 + "Alt": "Alt",
30 + "Toggle Alt": "Alt Değiştir",
31 + "Send Tab": "Sekme Gönder",
32 + "Tab": "Sekme",
33 + "Esc": "Esc",
34 + "Send Escape": "Boşluk Gönder",
35 + "Ctrl+Alt+Del": "Ctrl + Alt + Del",
36 + "Send Ctrl-Alt-Del": "Ctrl-Alt-Del Gönder",
37 + "Shutdown/Reboot": "Kapat/Yeniden Başlat",
38 + "Shutdown/Reboot...": "Kapat/Yeniden Başlat...",
39 + "Power": "Güç",
40 + "Shutdown": "Kapat",
41 + "Reboot": "Yeniden Başlat",
42 + "Reset": "Sıfırla",
43 + "Clipboard": "Pano",
44 + "Clear": "Temizle",
45 + "Fullscreen": "Tam Ekran",
46 + "Settings": "Ayarlar",
47 + "Shared Mode": "Paylaşım Modu",
48 + "View Only": "Sadece Görüntüle",
49 + "Clip to Window": "Pencereye Tıkla",
50 + "Scaling Mode:": "Ölçekleme Modu:",
51 + "None": "Bilinmeyen",
52 + "Local Scaling": "Yerel Ölçeklendirme",
53 + "Remote Resizing": "Uzaktan Yeniden Boyutlandırma",
54 + "Advanced": "Gelişmiş",
55 + "Repeater ID:": "Tekralayıcı ID:",
56 + "WebSocket": "WebSocket",
57 + "Encrypt": "Şifrele",
58 + "Host:": "Ana makine:",
59 + "Port:": "Port:",
60 + "Path:": "Yol:",
61 + "Automatic Reconnect": "Otomatik Yeniden Bağlan",
62 + "Reconnect Delay (ms):": "Yeniden Bağlanma Süreci (ms):",
63 + "Logging:": "Giriş yapılıyor:",
64 + "Disconnect": "Bağlantıyı Kes",
65 + "Connect": "Bağlan",
66 + "Password:": "Parola:",
67 + "Cancel": "Vazgeç",
68 + "Canvas not supported.": "Tuval desteklenmiyor."
69 +}
\ No newline at end of file
public/novnc/app/locale/zh_CN.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "链接中...",
3 + "Disconnecting...": "正在中断连接...",
4 + "Reconnecting...": "重新链接中...",
5 + "Internal error": "内部错误",
6 + "Must set host": "请提供主机名",
7 + "Connected (encrypted) to ": "已加密链接到",
8 + "Connected (unencrypted) to ": "未加密链接到",
9 + "Something went wrong, connection is closed": "发生错误,链接已关闭",
10 + "Failed to connect to server": "无法链接到服务器",
11 + "Disconnected": "链接已中断",
12 + "New connection has been rejected with reason: ": "链接被拒绝,原因:",
13 + "New connection has been rejected": "链接被拒绝",
14 + "Password is required": "请提供密码",
15 + "noVNC encountered an error:": "noVNC 遇到一个错误:",
16 + "Hide/Show the control bar": "显示/隐藏控制列",
17 + "Move/Drag Viewport": "拖放显示范围",
18 + "viewport drag": "显示范围拖放",
19 + "Active Mouse Button": "启动鼠标按鍵",
20 + "No mousebutton": "禁用鼠标按鍵",
21 + "Left mousebutton": "鼠标左鍵",
22 + "Middle mousebutton": "鼠标中鍵",
23 + "Right mousebutton": "鼠标右鍵",
24 + "Keyboard": "键盘",
25 + "Show Keyboard": "显示键盘",
26 + "Extra keys": "额外按键",
27 + "Show Extra Keys": "显示额外按键",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "切换 Ctrl",
30 + "Alt": "Alt",
31 + "Toggle Alt": "切换 Alt",
32 + "Send Tab": "发送 Tab 键",
33 + "Tab": "Tab",
34 + "Esc": "Esc",
35 + "Send Escape": "发送 Escape 键",
36 + "Ctrl+Alt+Del": "Ctrl-Alt-Del",
37 + "Send Ctrl-Alt-Del": "发送 Ctrl-Alt-Del 键",
38 + "Shutdown/Reboot": "关机/重新启动",
39 + "Shutdown/Reboot...": "关机/重新启动...",
40 + "Power": "电源",
41 + "Shutdown": "关机",
42 + "Reboot": "重新启动",
43 + "Reset": "重置",
44 + "Clipboard": "剪贴板",
45 + "Clear": "清除",
46 + "Fullscreen": "全屏幕",
47 + "Settings": "设置",
48 + "Shared Mode": "分享模式",
49 + "View Only": "仅检视",
50 + "Clip to Window": "限制/裁切窗口大小",
51 + "Scaling Mode:": "缩放模式:",
52 + "None": "无",
53 + "Local Scaling": "本地缩放",
54 + "Remote Resizing": "远程调整大小",
55 + "Advanced": "高级",
56 + "Repeater ID:": "中继站 ID",
57 + "WebSocket": "WebSocket",
58 + "Encrypt": "加密",
59 + "Host:": "主机:",
60 + "Port:": "端口:",
61 + "Path:": "路径:",
62 + "Automatic Reconnect": "自动重新链接",
63 + "Reconnect Delay (ms):": "重新链接间隔 (ms):",
64 + "Logging:": "日志级别:",
65 + "Disconnect": "终端链接",
66 + "Connect": "链接",
67 + "Password:": "密码:",
68 + "Cancel": "取消"
69 +}
\ No newline at end of file
public/novnc/app/locale/zh_TW.json new
+69
@@ -0,0 +1,69 @@
1 +{
2 + "Connecting...": "連線中...",
3 + "Disconnecting...": "正在中斷連線...",
4 + "Reconnecting...": "重新連線中...",
5 + "Internal error": "內部錯誤",
6 + "Must set host": "請提供主機資訊",
7 + "Connected (encrypted) to ": "已加密連線到",
8 + "Connected (unencrypted) to ": "未加密連線到",
9 + "Something went wrong, connection is closed": "發生錯誤,連線已關閉",
10 + "Failed to connect to server": "無法連線到伺服器",
11 + "Disconnected": "連線已中斷",
12 + "New connection has been rejected with reason: ": "連線被拒絕,原因:",
13 + "New connection has been rejected": "連線被拒絕",
14 + "Password is required": "請提供密碼",
15 + "noVNC encountered an error:": "noVNC 遇到一個錯誤:",
16 + "Hide/Show the control bar": "顯示/隱藏控制列",
17 + "Move/Drag Viewport": "拖放顯示範圍",
18 + "viewport drag": "顯示範圍拖放",
19 + "Active Mouse Button": "啟用滑鼠按鍵",
20 + "No mousebutton": "無滑鼠按鍵",
21 + "Left mousebutton": "滑鼠左鍵",
22 + "Middle mousebutton": "滑鼠中鍵",
23 + "Right mousebutton": "滑鼠右鍵",
24 + "Keyboard": "鍵盤",
25 + "Show Keyboard": "顯示鍵盤",
26 + "Extra keys": "額外按鍵",
27 + "Show Extra Keys": "顯示額外按鍵",
28 + "Ctrl": "Ctrl",
29 + "Toggle Ctrl": "切換 Ctrl",
30 + "Alt": "Alt",
31 + "Toggle Alt": "切換 Alt",
32 + "Send Tab": "送出 Tab 鍵",
33 + "Tab": "Tab",
34 + "Esc": "Esc",
35 + "Send Escape": "送出 Escape 鍵",
36 + "Ctrl+Alt+Del": "Ctrl-Alt-Del",
37 + "Send Ctrl-Alt-Del": "送出 Ctrl-Alt-Del 快捷鍵",
38 + "Shutdown/Reboot": "關機/重新啟動",
39 + "Shutdown/Reboot...": "關機/重新啟動...",
40 + "Power": "電源",
41 + "Shutdown": "關機",
42 + "Reboot": "重新啟動",
43 + "Reset": "重設",
44 + "Clipboard": "剪貼簿",
45 + "Clear": "清除",
46 + "Fullscreen": "全螢幕",
47 + "Settings": "設定",
48 + "Shared Mode": "分享模式",
49 + "View Only": "僅檢視",
50 + "Clip to Window": "限制/裁切視窗大小",
51 + "Scaling Mode:": "縮放模式:",
52 + "None": "無",
53 + "Local Scaling": "本機縮放",
54 + "Remote Resizing": "遠端調整大小",
55 + "Advanced": "進階",
56 + "Repeater ID:": "中繼站 ID",
57 + "WebSocket": "WebSocket",
58 + "Encrypt": "加密",
59 + "Host:": "主機:",
60 + "Port:": "連接埠:",
61 + "Path:": "路徑:",
62 + "Automatic Reconnect": "自動重新連線",
63 + "Reconnect Delay (ms):": "重新連線間隔 (ms):",
64 + "Logging:": "日誌級別:",
65 + "Disconnect": "中斷連線",
66 + "Connect": "連線",
67 + "Password:": "密碼:",
68 + "Cancel": "取消"
69 +}
\ No newline at end of file
public/novnc/app/localization.js new
+172
@@ -0,0 +1,172 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +/*
10 + * Localization Utilities
11 + */
12 +
13 +export class Localizer {
14 + constructor() {
15 + // Currently configured language
16 + this.language = 'en';
17 +
18 + // Current dictionary of translations
19 + this.dictionary = undefined;
20 + }
21 +
22 + // Configure suitable language based on user preferences
23 + setup(supportedLanguages) {
24 + this.language = 'en'; // Default: US English
25 +
26 + /*
27 + * Navigator.languages only available in Chrome (32+) and FireFox (32+)
28 + * Fall back to navigator.language for other browsers
29 + */
30 + let userLanguages;
31 + if (typeof window.navigator.languages == 'object') {
32 + userLanguages = window.navigator.languages;
33 + } else {
34 + userLanguages = [navigator.language || navigator.userLanguage];
35 + }
36 +
37 + for (let i = 0;i < userLanguages.length;i++) {
38 + const userLang = userLanguages[i]
39 + .toLowerCase()
40 + .replace("_", "-")
41 + .split("-");
42 +
43 + // Built-in default?
44 + if ((userLang[0] === 'en') &&
45 + ((userLang[1] === undefined) || (userLang[1] === 'us'))) {
46 + return;
47 + }
48 +
49 + // First pass: perfect match
50 + for (let j = 0; j < supportedLanguages.length; j++) {
51 + const supLang = supportedLanguages[j]
52 + .toLowerCase()
53 + .replace("_", "-")
54 + .split("-");
55 +
56 + if (userLang[0] !== supLang[0]) {
57 + continue;
58 + }
59 + if (userLang[1] !== supLang[1]) {
60 + continue;
61 + }
62 +
63 + this.language = supportedLanguages[j];
64 + return;
65 + }
66 +
67 + // Second pass: fallback
68 + for (let j = 0;j < supportedLanguages.length;j++) {
69 + const supLang = supportedLanguages[j]
70 + .toLowerCase()
71 + .replace("_", "-")
72 + .split("-");
73 +
74 + if (userLang[0] !== supLang[0]) {
75 + continue;
76 + }
77 + if (supLang[1] !== undefined) {
78 + continue;
79 + }
80 +
81 + this.language = supportedLanguages[j];
82 + return;
83 + }
84 + }
85 + }
86 +
87 + // Retrieve localised text
88 + get(id) {
89 + if (typeof this.dictionary !== 'undefined' && this.dictionary[id]) {
90 + return this.dictionary[id];
91 + } else {
92 + return id;
93 + }
94 + }
95 +
96 + // Traverses the DOM and translates relevant fields
97 + // See https://html.spec.whatwg.org/multipage/dom.html#attr-translate
98 + translateDOM() {
99 + const self = this;
100 +
101 + function process(elem, enabled) {
102 + function isAnyOf(searchElement, items) {
103 + return items.indexOf(searchElement) !== -1;
104 + }
105 +
106 + function translateAttribute(elem, attr) {
107 + const str = self.get(elem.getAttribute(attr));
108 + elem.setAttribute(attr, str);
109 + }
110 +
111 + function translateTextNode(node) {
112 + const str = self.get(node.data.trim());
113 + node.data = str;
114 + }
115 +
116 + if (elem.hasAttribute("translate")) {
117 + if (isAnyOf(elem.getAttribute("translate"), ["", "yes"])) {
118 + enabled = true;
119 + } else if (isAnyOf(elem.getAttribute("translate"), ["no"])) {
120 + enabled = false;
121 + }
122 + }
123 +
124 + if (enabled) {
125 + if (elem.hasAttribute("abbr") &&
126 + elem.tagName === "TH") {
127 + translateAttribute(elem, "abbr");
128 + }
129 + if (elem.hasAttribute("alt") &&
130 + isAnyOf(elem.tagName, ["AREA", "IMG", "INPUT"])) {
131 + translateAttribute(elem, "alt");
132 + }
133 + if (elem.hasAttribute("download") &&
134 + isAnyOf(elem.tagName, ["A", "AREA"])) {
135 + translateAttribute(elem, "download");
136 + }
137 + if (elem.hasAttribute("label") &&
138 + isAnyOf(elem.tagName, ["MENUITEM", "MENU", "OPTGROUP",
139 + "OPTION", "TRACK"])) {
140 + translateAttribute(elem, "label");
141 + }
142 + // FIXME: Should update "lang"
143 + if (elem.hasAttribute("placeholder") &&
144 + isAnyOf(elem.tagName, ["INPUT", "TEXTAREA"])) {
145 + translateAttribute(elem, "placeholder");
146 + }
147 + if (elem.hasAttribute("title")) {
148 + translateAttribute(elem, "title");
149 + }
150 + if (elem.hasAttribute("value") &&
151 + elem.tagName === "INPUT" &&
152 + isAnyOf(elem.getAttribute("type"), ["reset", "button", "submit"])) {
153 + translateAttribute(elem, "value");
154 + }
155 + }
156 +
157 + for (let i = 0; i < elem.childNodes.length; i++) {
158 + const node = elem.childNodes[i];
159 + if (node.nodeType === node.ELEMENT_NODE) {
160 + process(node, enabled);
161 + } else if (node.nodeType === node.TEXT_NODE && enabled) {
162 + translateTextNode(node);
163 + }
164 + }
165 + }
166 +
167 + process(document.body, true);
168 + }
169 +}
170 +
171 +export const l10n = new Localizer();
172 +export default l10n.get.bind(l10n);
public/novnc/app/sounds/CREDITS new
+4
@@ -0,0 +1,4 @@
1 +bell
2 + Copyright: Dr. Richard Boulanger et al
3 + URL: http://www.archive.org/details/Berklee44v12
4 + License: CC-BY Attribution 3.0 Unported
public/novnc/app/sounds/bell.mp3
Binary files /dev/null and b/public/novnc/app/sounds/bell.mp3 differ
public/novnc/app/sounds/bell.oga
Binary files /dev/null and b/public/novnc/app/sounds/bell.oga differ
public/novnc/app/styles/Orbitron700.ttf
Binary files /dev/null and b/public/novnc/app/styles/Orbitron700.ttf differ
public/novnc/app/styles/Orbitron700.woff
Binary files /dev/null and b/public/novnc/app/styles/Orbitron700.woff differ
public/novnc/app/styles/base.css new
+900
@@ -0,0 +1,900 @@
1 +/*
2 + * noVNC base CSS
3 + * Copyright (C) 2018 The noVNC Authors
4 + * noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
5 + * This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
6 + */
7 +
8 +/*
9 + * Z index layers:
10 + *
11 + * 0: Main screen
12 + * 10: Control bar
13 + * 50: Transition blocker
14 + * 60: Connection popups
15 + * 100: Status bar
16 + * ...
17 + * 1000: Javascript crash
18 + * ...
19 + * 10000: Max (used for polyfills)
20 + */
21 +
22 +body {
23 + margin:0;
24 + padding:0;
25 + font-family: Helvetica;
26 + /*Background image with light grey curve.*/
27 + background-color:#494949;
28 + background-repeat:no-repeat;
29 + background-position:right bottom;
30 + height:100%;
31 + touch-action: none;
32 +}
33 +
34 +html {
35 + height:100%;
36 +}
37 +
38 +.noVNC_only_touch.noVNC_hidden {
39 + display: none;
40 +}
41 +
42 +.noVNC_disabled {
43 + color: rgb(128, 128, 128);
44 +}
45 +
46 +/* ----------------------------------------
47 + * Spinner
48 + * ----------------------------------------
49 + */
50 +
51 +.noVNC_spinner {
52 + position: relative;
53 +}
54 +.noVNC_spinner, .noVNC_spinner::before, .noVNC_spinner::after {
55 + width: 10px;
56 + height: 10px;
57 + border-radius: 2px;
58 + box-shadow: -60px 10px 0 rgba(255, 255, 255, 0);
59 + animation: noVNC_spinner 1.0s linear infinite;
60 +}
61 +.noVNC_spinner::before {
62 + content: "";
63 + position: absolute;
64 + left: 0px;
65 + top: 0px;
66 + animation-delay: -0.1s;
67 +}
68 +.noVNC_spinner::after {
69 + content: "";
70 + position: absolute;
71 + top: 0px;
72 + left: 0px;
73 + animation-delay: 0.1s;
74 +}
75 +@keyframes noVNC_spinner {
76 + 0% { box-shadow: -60px 10px 0 rgba(255, 255, 255, 0); width: 20px; }
77 + 25% { box-shadow: 20px 10px 0 rgba(255, 255, 255, 1); width: 10px; }
78 + 50% { box-shadow: 60px 10px 0 rgba(255, 255, 255, 0); width: 10px; }
79 +}
80 +
81 +/* ----------------------------------------
82 + * Input Elements
83 + * ----------------------------------------
84 + */
85 +
86 +input[type=input], input[type=password], input[type=number],
87 +input:not([type]), textarea {
88 + /* Disable default rendering */
89 + -webkit-appearance: none;
90 + -moz-appearance: none;
91 + background: none;
92 +
93 + margin: 2px;
94 + padding: 2px;
95 + border: 1px solid rgb(192, 192, 192);
96 + border-radius: 5px;
97 + color: black;
98 + background: linear-gradient(to top, rgb(255, 255, 255) 80%, rgb(240, 240, 240));
99 +}
100 +
101 +input[type=button], input[type=submit], select {
102 + /* Disable default rendering */
103 + -webkit-appearance: none;
104 + -moz-appearance: none;
105 + background: none;
106 +
107 + margin: 2px;
108 + padding: 2px;
109 + border: 1px solid rgb(192, 192, 192);
110 + border-bottom-width: 2px;
111 + border-radius: 5px;
112 + color: black;
113 + background: linear-gradient(to top, rgb(255, 255, 255), rgb(240, 240, 240));
114 +
115 + /* This avoids it jumping around when :active */
116 + vertical-align: middle;
117 +}
118 +
119 +input[type=button], input[type=submit] {
120 + padding-left: 20px;
121 + padding-right: 20px;
122 +}
123 +
124 +option {
125 + color: black;
126 + background: white;
127 +}
128 +
129 +input[type=input]:focus, input[type=password]:focus,
130 +input:not([type]):focus, input[type=button]:focus,
131 +input[type=submit]:focus,
132 +textarea:focus, select:focus {
133 + box-shadow: 0px 0px 3px rgba(74, 144, 217, 0.5);
134 + border-color: rgb(74, 144, 217);
135 + outline: none;
136 +}
137 +
138 +input[type=button]::-moz-focus-inner,
139 +input[type=submit]::-moz-focus-inner {
140 + border: none;
141 +}
142 +
143 +input[type=input]:disabled, input[type=password]:disabled,
144 +input:not([type]):disabled, input[type=button]:disabled,
145 +input[type=submit]:disabled, input[type=number]:disabled,
146 +textarea:disabled, select:disabled {
147 + color: rgb(128, 128, 128);
148 + background: rgb(240, 240, 240);
149 +}
150 +
151 +input[type=button]:active, input[type=submit]:active,
152 +select:active {
153 + border-bottom-width: 1px;
154 + margin-top: 3px;
155 +}
156 +
157 +:root:not(.noVNC_touch) input[type=button]:hover:not(:disabled),
158 +:root:not(.noVNC_touch) input[type=submit]:hover:not(:disabled),
159 +:root:not(.noVNC_touch) select:hover:not(:disabled) {
160 + background: linear-gradient(to top, rgb(255, 255, 255), rgb(250, 250, 250));
161 +}
162 +
163 +/* ----------------------------------------
164 + * WebKit centering hacks
165 + * ----------------------------------------
166 + */
167 +
168 +.noVNC_center {
169 + /*
170 + * This is a workaround because webkit misrenders transforms and
171 + * uses non-integer coordinates, resulting in blurry content.
172 + * Ideally we'd use "top: 50%; transform: translateY(-50%);" on
173 + * the objects instead.
174 + */
175 + display: flex;
176 + align-items: center;
177 + justify-content: center;
178 + position: fixed;
179 + top: 0;
180 + left: 0;
181 + width: 100%;
182 + height: 100%;
183 + pointer-events: none;
184 +}
185 +.noVNC_center > * {
186 + pointer-events: auto;
187 +}
188 +.noVNC_vcenter {
189 + display: flex;
190 + flex-direction: column;
191 + justify-content: center;
192 + position: fixed;
193 + top: 0;
194 + left: 0;
195 + height: 100%;
196 + pointer-events: none;
197 +}
198 +.noVNC_vcenter > * {
199 + pointer-events: auto;
200 +}
201 +
202 +/* ----------------------------------------
203 + * Layering
204 + * ----------------------------------------
205 + */
206 +
207 +.noVNC_connect_layer {
208 + z-index: 60;
209 +}
210 +
211 +/* ----------------------------------------
212 + * Fallback error
213 + * ----------------------------------------
214 + */
215 +
216 +#noVNC_fallback_error {
217 + z-index: 1000;
218 + visibility: hidden;
219 +}
220 +#noVNC_fallback_error.noVNC_open {
221 + visibility: visible;
222 +}
223 +
224 +#noVNC_fallback_error > div {
225 + max-width: 90%;
226 + padding: 15px;
227 +
228 + transition: 0.5s ease-in-out;
229 +
230 + transform: translateY(-50px);
231 + opacity: 0;
232 +
233 + text-align: center;
234 + font-weight: bold;
235 + color: #fff;
236 +
237 + border-radius: 10px;
238 + box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
239 + background: rgba(200,55,55,0.8);
240 +}
241 +#noVNC_fallback_error.noVNC_open > div {
242 + transform: translateY(0);
243 + opacity: 1;
244 +}
245 +
246 +#noVNC_fallback_errormsg {
247 + font-weight: normal;
248 +}
249 +
250 +#noVNC_fallback_errormsg .noVNC_message {
251 + display: inline-block;
252 + text-align: left;
253 + font-family: monospace;
254 + white-space: pre-wrap;
255 +}
256 +
257 +#noVNC_fallback_error .noVNC_location {
258 + font-style: italic;
259 + font-size: 0.8em;
260 + color: rgba(255, 255, 255, 0.8);
261 +}
262 +
263 +#noVNC_fallback_error .noVNC_stack {
264 + max-height: 50vh;
265 + padding: 10px;
266 + margin: 10px;
267 + font-size: 0.8em;
268 + text-align: left;
269 + font-family: monospace;
270 + white-space: pre;
271 + border: 1px solid rgba(0, 0, 0, 0.5);
272 + background: rgba(0, 0, 0, 0.2);
273 + overflow: auto;
274 +}
275 +
276 +/* ----------------------------------------
277 + * Control Bar
278 + * ----------------------------------------
279 + */
280 +
281 +#noVNC_control_bar_anchor {
282 + /* The anchor is needed to get z-stacking to work */
283 + position: fixed;
284 + z-index: 10;
285 +
286 + transition: 0.5s ease-in-out;
287 +
288 + /* Edge misrenders animations wihthout this */
289 + transform: translateX(0);
290 +}
291 +:root.noVNC_connected #noVNC_control_bar_anchor.noVNC_idle {
292 + opacity: 0.8;
293 +}
294 +#noVNC_control_bar_anchor.noVNC_right {
295 + left: auto;
296 + right: 0;
297 +}
298 +
299 +#noVNC_control_bar {
300 + position: relative;
301 + left: -100%;
302 +
303 + transition: 0.5s ease-in-out;
304 +
305 + background-color: rgb(110, 132, 163);
306 + border-radius: 0 10px 10px 0;
307 +
308 +}
309 +#noVNC_control_bar.noVNC_open {
310 + box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
311 + left: 0;
312 +}
313 +#noVNC_control_bar::before {
314 + /* This extra element is to get a proper shadow */
315 + content: "";
316 + position: absolute;
317 + z-index: -1;
318 + height: 100%;
319 + width: 30px;
320 + left: -30px;
321 + transition: box-shadow 0.5s ease-in-out;
322 +}
323 +#noVNC_control_bar.noVNC_open::before {
324 + box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
325 +}
326 +.noVNC_right #noVNC_control_bar {
327 + left: 100%;
328 + border-radius: 10px 0 0 10px;
329 +}
330 +.noVNC_right #noVNC_control_bar.noVNC_open {
331 + left: 0;
332 +}
333 +.noVNC_right #noVNC_control_bar::before {
334 + visibility: hidden;
335 +}
336 +
337 +#noVNC_control_bar_handle {
338 + position: absolute;
339 + left: -15px;
340 + top: 0;
341 + transform: translateY(35px);
342 + width: calc(100% + 30px);
343 + height: 50px;
344 + z-index: -1;
345 + cursor: pointer;
346 + border-radius: 5px;
347 + background-color: rgb(83, 99, 122);
348 + background-image: url("../images/handle_bg.svg");
349 + background-repeat: no-repeat;
350 + background-position: right;
351 + box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.5);
352 +}
353 +#noVNC_control_bar_handle:after {
354 + content: "";
355 + transition: transform 0.5s ease-in-out;
356 + background: url("../images/handle.svg");
357 + position: absolute;
358 + top: 22px; /* (50px-6px)/2 */
359 + right: 5px;
360 + width: 5px;
361 + height: 6px;
362 +}
363 +#noVNC_control_bar.noVNC_open #noVNC_control_bar_handle:after {
364 + transform: translateX(1px) rotate(180deg);
365 +}
366 +:root:not(.noVNC_connected) #noVNC_control_bar_handle {
367 + display: none;
368 +}
369 +.noVNC_right #noVNC_control_bar_handle {
370 + background-position: left;
371 +}
372 +.noVNC_right #noVNC_control_bar_handle:after {
373 + left: 5px;
374 + right: 0;
375 + transform: translateX(1px) rotate(180deg);
376 +}
377 +.noVNC_right #noVNC_control_bar.noVNC_open #noVNC_control_bar_handle:after {
378 + transform: none;
379 +}
380 +#noVNC_control_bar_handle div {
381 + position: absolute;
382 + right: -35px;
383 + top: 0;
384 + width: 50px;
385 + height: 50px;
386 +}
387 +:root:not(.noVNC_touch) #noVNC_control_bar_handle div {
388 + display: none;
389 +}
390 +.noVNC_right #noVNC_control_bar_handle div {
391 + left: -35px;
392 + right: auto;
393 +}
394 +
395 +#noVNC_control_bar .noVNC_scroll {
396 + max-height: 100vh; /* Chrome is buggy with 100% */
397 + overflow-x: hidden;
398 + overflow-y: auto;
399 + padding: 0 10px 0 5px;
400 +}
401 +.noVNC_right #noVNC_control_bar .noVNC_scroll {
402 + padding: 0 5px 0 10px;
403 +}
404 +
405 +/* Control bar hint */
406 +#noVNC_control_bar_hint {
407 + position: fixed;
408 + left: calc(100vw - 50px);
409 + right: auto;
410 + top: 50%;
411 + transform: translateY(-50%) scale(0);
412 + width: 100px;
413 + height: 50%;
414 + max-height: 600px;
415 +
416 + visibility: hidden;
417 + opacity: 0;
418 + transition: 0.2s ease-in-out;
419 + background: transparent;
420 + box-shadow: 0 0 10px black, inset 0 0 10px 10px rgba(110, 132, 163, 0.8);
421 + border-radius: 10px;
422 + transition-delay: 0s;
423 +}
424 +#noVNC_control_bar_anchor.noVNC_right #noVNC_control_bar_hint{
425 + left: auto;
426 + right: calc(100vw - 50px);
427 +}
428 +#noVNC_control_bar_hint.noVNC_active {
429 + visibility: visible;
430 + opacity: 1;
431 + transition-delay: 0.2s;
432 + transform: translateY(-50%) scale(1);
433 +}
434 +
435 +/* General button style */
436 +.noVNC_button {
437 + display: block;
438 + padding: 4px 4px;
439 + margin: 10px 0;
440 + vertical-align: middle;
441 + border:1px solid rgba(255, 255, 255, 0.2);
442 + border-radius: 6px;
443 +}
444 +.noVNC_button.noVNC_selected {
445 + border-color: rgba(0, 0, 0, 0.8);
446 + background: rgba(0, 0, 0, 0.5);
447 +}
448 +.noVNC_button:disabled {
449 + opacity: 0.4;
450 +}
451 +.noVNC_button:focus {
452 + outline: none;
453 +}
454 +.noVNC_button:active {
455 + padding-top: 5px;
456 + padding-bottom: 3px;
457 +}
458 +/* Android browsers don't properly update hover state if touch events
459 + * are intercepted, but focus should be safe to display */
460 +:root:not(.noVNC_touch) .noVNC_button.noVNC_selected:hover,
461 +.noVNC_button.noVNC_selected:focus {
462 + border-color: rgba(0, 0, 0, 0.4);
463 + background: rgba(0, 0, 0, 0.2);
464 +}
465 +:root:not(.noVNC_touch) .noVNC_button:hover,
466 +.noVNC_button:focus {
467 + background: rgba(255, 255, 255, 0.2);
468 +}
469 +.noVNC_button.noVNC_hidden {
470 + display: none;
471 +}
472 +
473 +/* Panels */
474 +.noVNC_panel {
475 + transform: translateX(25px);
476 +
477 + transition: 0.5s ease-in-out;
478 +
479 + max-height: 100vh; /* Chrome is buggy with 100% */
480 + overflow-x: hidden;
481 + overflow-y: auto;
482 +
483 + visibility: hidden;
484 + opacity: 0;
485 +
486 + padding: 15px;
487 +
488 + background: #fff;
489 + border-radius: 10px;
490 + color: #000;
491 + border: 2px solid #E0E0E0;
492 + box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
493 +}
494 +.noVNC_panel.noVNC_open {
495 + visibility: visible;
496 + opacity: 1;
497 + transform: translateX(75px);
498 +}
499 +.noVNC_right .noVNC_vcenter {
500 + left: auto;
501 + right: 0;
502 +}
503 +.noVNC_right .noVNC_panel {
504 + transform: translateX(-25px);
505 +}
506 +.noVNC_right .noVNC_panel.noVNC_open {
507 + transform: translateX(-75px);
508 +}
509 +
510 +.noVNC_panel hr {
511 + border: none;
512 + border-top: 1px solid rgb(192, 192, 192);
513 +}
514 +
515 +.noVNC_panel label {
516 + display: block;
517 + white-space: nowrap;
518 +}
519 +
520 +.noVNC_panel .noVNC_heading {
521 + background-color: rgb(110, 132, 163);
522 + border-radius: 5px;
523 + padding: 5px;
524 + /* Compensate for padding in image */
525 + padding-right: 8px;
526 + color: white;
527 + font-size: 20px;
528 + margin-bottom: 10px;
529 + white-space: nowrap;
530 +}
531 +.noVNC_panel .noVNC_heading img {
532 + vertical-align: bottom;
533 +}
534 +
535 +.noVNC_submit {
536 + float: right;
537 +}
538 +
539 +/* Expanders */
540 +.noVNC_expander {
541 + cursor: pointer;
542 +}
543 +.noVNC_expander::before {
544 + content: url("../images/expander.svg");
545 + display: inline-block;
546 + margin-right: 5px;
547 + transition: 0.2s ease-in-out;
548 +}
549 +.noVNC_expander.noVNC_open::before {
550 + transform: rotateZ(90deg);
551 +}
552 +.noVNC_expander ~ * {
553 + margin: 5px;
554 + margin-left: 10px;
555 + padding: 5px;
556 + background: rgba(0, 0, 0, 0.05);
557 + border-radius: 5px;
558 +}
559 +.noVNC_expander:not(.noVNC_open) ~ * {
560 + display: none;
561 +}
562 +
563 +/* Control bar content */
564 +
565 +#noVNC_control_bar .noVNC_logo {
566 + font-size: 13px;
567 +}
568 +
569 +:root:not(.noVNC_connected) #noVNC_view_drag_button {
570 + display: none;
571 +}
572 +
573 +/* noVNC Touch Device only buttons */
574 +:root:not(.noVNC_connected) #noVNC_mobile_buttons {
575 + display: none;
576 +}
577 +:root:not(.noVNC_touch) #noVNC_mobile_buttons {
578 + display: none;
579 +}
580 +
581 +/* Extra manual keys */
582 +:root:not(.noVNC_connected) #noVNC_extra_keys {
583 + display: none;
584 +}
585 +
586 +#noVNC_modifiers {
587 + background-color: rgb(92, 92, 92);
588 + border: none;
589 + padding: 0 10px;
590 +}
591 +
592 +/* Shutdown/Reboot */
593 +:root:not(.noVNC_connected) #noVNC_power_button {
594 + display: none;
595 +}
596 +#noVNC_power {
597 +}
598 +#noVNC_power_buttons {
599 + display: none;
600 +}
601 +
602 +#noVNC_power input[type=button] {
603 + width: 100%;
604 +}
605 +
606 +/* Clipboard */
607 +:root:not(.noVNC_connected) #noVNC_clipboard_button {
608 + display: none;
609 +}
610 +#noVNC_clipboard {
611 + /* Full screen, minus padding and left and right margins */
612 + max-width: calc(100vw - 2*15px - 75px - 25px);
613 +}
614 +#noVNC_clipboard_text {
615 + width: 500px;
616 + max-width: 100%;
617 +}
618 +
619 +/* Settings */
620 +#noVNC_settings {
621 +}
622 +#noVNC_settings ul {
623 + list-style: none;
624 + margin: 0px;
625 + padding: 0px;
626 +}
627 +#noVNC_setting_port {
628 + width: 80px;
629 +}
630 +#noVNC_setting_path {
631 + width: 100px;
632 +}
633 +
634 +/* Connection Controls */
635 +:root:not(.noVNC_connected) #noVNC_disconnect_button {
636 + display: none;
637 +}
638 +
639 +/* ----------------------------------------
640 + * Status Dialog
641 + * ----------------------------------------
642 + */
643 +
644 +#noVNC_status {
645 + position: fixed;
646 + top: 0;
647 + left: 0;
648 + width: 100%;
649 + z-index: 100;
650 + transform: translateY(-100%);
651 +
652 + cursor: pointer;
653 +
654 + transition: 0.5s ease-in-out;
655 +
656 + visibility: hidden;
657 + opacity: 0;
658 +
659 + padding: 5px;
660 +
661 + display: flex;
662 + flex-direction: row;
663 + justify-content: center;
664 + align-content: center;
665 +
666 + line-height: 25px;
667 + word-wrap: break-word;
668 + color: #fff;
669 +
670 + border-bottom: 1px solid rgba(0, 0, 0, 0.9);
671 +}
672 +#noVNC_status.noVNC_open {
673 + transform: translateY(0);
674 + visibility: visible;
675 + opacity: 1;
676 +}
677 +
678 +#noVNC_status::before {
679 + content: "";
680 + display: inline-block;
681 + width: 25px;
682 + height: 25px;
683 + margin-right: 5px;
684 +}
685 +
686 +#noVNC_status.noVNC_status_normal {
687 + background: rgba(128,128,128,0.9);
688 +}
689 +#noVNC_status.noVNC_status_normal::before {
690 + content: url("../images/info.svg") " ";
691 +}
692 +#noVNC_status.noVNC_status_error {
693 + background: rgba(200,55,55,0.9);
694 +}
695 +#noVNC_status.noVNC_status_error::before {
696 + content: url("../images/error.svg") " ";
697 +}
698 +#noVNC_status.noVNC_status_warn {
699 + background: rgba(180,180,30,0.9);
700 +}
701 +#noVNC_status.noVNC_status_warn::before {
702 + content: url("../images/warning.svg") " ";
703 +}
704 +
705 +/* ----------------------------------------
706 + * Connect Dialog
707 + * ----------------------------------------
708 + */
709 +
710 +#noVNC_connect_dlg {
711 + transition: 0.5s ease-in-out;
712 +
713 + transform: scale(0, 0);
714 + visibility: hidden;
715 + opacity: 0;
716 +}
717 +#noVNC_connect_dlg.noVNC_open {
718 + transform: scale(1, 1);
719 + visibility: visible;
720 + opacity: 1;
721 +}
722 +#noVNC_connect_dlg .noVNC_logo {
723 + transition: 0.5s ease-in-out;
724 + padding: 10px;
725 + margin-bottom: 10px;
726 +
727 + font-size: 80px;
728 + text-align: center;
729 +
730 + border-radius: 5px;
731 +}
732 +@media (max-width: 440px) {
733 + #noVNC_connect_dlg {
734 + max-width: calc(100vw - 100px);
735 + }
736 + #noVNC_connect_dlg .noVNC_logo {
737 + font-size: calc(25vw - 30px);
738 + }
739 +}
740 +#noVNC_connect_button {
741 + cursor: pointer;
742 +
743 + padding: 10px;
744 +
745 + color: white;
746 + background-color: rgb(110, 132, 163);
747 + border-radius: 12px;
748 +
749 + text-align: center;
750 + font-size: 20px;
751 +
752 + box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
753 +}
754 +#noVNC_connect_button div {
755 + margin: 2px;
756 + padding: 5px 30px;
757 + border: 1px solid rgb(83, 99, 122);
758 + border-bottom-width: 2px;
759 + border-radius: 5px;
760 + background: linear-gradient(to top, rgb(110, 132, 163), rgb(99, 119, 147));
761 +
762 + /* This avoids it jumping around when :active */
763 + vertical-align: middle;
764 +}
765 +#noVNC_connect_button div:active {
766 + border-bottom-width: 1px;
767 + margin-top: 3px;
768 +}
769 +:root:not(.noVNC_touch) #noVNC_connect_button div:hover {
770 + background: linear-gradient(to top, rgb(110, 132, 163), rgb(105, 125, 155));
771 +}
772 +
773 +#noVNC_connect_button img {
774 + vertical-align: bottom;
775 + height: 1.3em;
776 +}
777 +
778 +/* ----------------------------------------
779 + * Password Dialog
780 + * ----------------------------------------
781 + */
782 +
783 +#noVNC_password_dlg {
784 + position: relative;
785 +
786 + transform: translateY(-50px);
787 +}
788 +#noVNC_password_dlg.noVNC_open {
789 + transform: translateY(0);
790 +}
791 +#noVNC_password_dlg ul {
792 + list-style: none;
793 + margin: 0px;
794 + padding: 0px;
795 +}
796 +
797 +/* ----------------------------------------
798 + * Main Area
799 + * ----------------------------------------
800 + */
801 +
802 +/* Transition screen */
803 +#noVNC_transition {
804 + display: none;
805 +
806 + position: fixed;
807 + top: 0;
808 + left: 0;
809 + bottom: 0;
810 + right: 0;
811 +
812 + color: white;
813 + background: rgba(0, 0, 0, 0.5);
814 + z-index: 50;
815 +
816 + /*display: flex;*/
817 + align-items: center;
818 + justify-content: center;
819 + flex-direction: column;
820 +}
821 +:root.noVNC_loading #noVNC_transition,
822 +:root.noVNC_connecting #noVNC_transition,
823 +:root.noVNC_disconnecting #noVNC_transition,
824 +:root.noVNC_reconnecting #noVNC_transition {
825 + display: flex;
826 +}
827 +:root:not(.noVNC_reconnecting) #noVNC_cancel_reconnect_button {
828 + display: none;
829 +}
830 +#noVNC_transition_text {
831 + font-size: 1.5em;
832 +}
833 +
834 +/* Main container */
835 +#noVNC_container {
836 + width: 100%;
837 + height: 100%;
838 + background-color: #313131;
839 + border-bottom-right-radius: 800px 600px;
840 + /*border-top-left-radius: 800px 600px;*/
841 +}
842 +
843 +#noVNC_keyboardinput {
844 + width: 1px;
845 + height: 1px;
846 + background-color: #fff;
847 + color: #fff;
848 + border: 0;
849 + position: absolute;
850 + left: -40px;
851 + z-index: -1;
852 + ime-mode: disabled;
853 +}
854 +
855 +/*Default noVNC logo.*/
856 +/* From: http://fonts.googleapis.com/css?family=Orbitron:700 */
857 +@font-face {
858 + font-family: 'Orbitron';
859 + font-style: normal;
860 + font-weight: 700;
861 + src: local('?'), url('Orbitron700.woff') format('woff'),
862 + url('Orbitron700.ttf') format('truetype');
863 +}
864 +
865 +.noVNC_logo {
866 + color:yellow;
867 + font-family: 'Orbitron', 'OrbitronTTF', sans-serif;
868 + line-height:90%;
869 + text-shadow: 0.1em 0.1em 0 black;
870 +}
871 +.noVNC_logo span{
872 + color:green;
873 +}
874 +
875 +#noVNC_bell {
876 + display: none;
877 +}
878 +
879 +/* ----------------------------------------
880 + * Media sizing
881 + * ----------------------------------------
882 + */
883 +
884 +@media screen and (max-width: 640px){
885 + #noVNC_logo {
886 + font-size: 150px;
887 + }
888 +}
889 +
890 +@media screen and (min-width: 321px) and (max-width: 480px) {
891 + #noVNC_logo {
892 + font-size: 110px;
893 + }
894 +}
895 +
896 +@media screen and (max-width: 320px) {
897 + #noVNC_logo {
898 + font-size: 90px;
899 + }
900 +}
public/novnc/app/ui.js new
+1649
@@ -0,0 +1,1649 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +import * as Log from '../core/util/logging.js';
10 +import _, { l10n } from './localization.js';
11 +import { isTouchDevice, isSafari, isIOS, isAndroid, dragThreshold }
12 + from '../core/util/browser.js';
13 +import { setCapture, getPointerEvent } from '../core/util/events.js';
14 +import KeyTable from "../core/input/keysym.js";
15 +import keysyms from "../core/input/keysymdef.js";
16 +import Keyboard from "../core/input/keyboard.js";
17 +import RFB from "../core/rfb.js";
18 +import * as WebUtil from "./webutil.js";
19 +
20 +function parseUriArgs() { var href = window.document.location.href; if (href.endsWith('#')) { href = href.substring(0, href.length - 1); } var name, r = {}, parsedUri = href.split(/[\?&|\=]/); parsedUri.splice(0, 1); for (x in parsedUri) { switch (x % 2) { case 0: { name = decodeURIComponent(parsedUri[x]); break; } case 1: { r[name] = decodeURIComponent(parsedUri[x]); var x = parseInt(r[name]); if (x == r[name]) { r[name] = x; } break; } default: { break; } } } return r; }
21 +var urlargs = parseUriArgs();
22 +
23 +const UI = {
24 +
25 + connected: false,
26 + desktopName: "",
27 +
28 + statusTimeout: null,
29 + hideKeyboardTimeout: null,
30 + idleControlbarTimeout: null,
31 + closeControlbarTimeout: null,
32 +
33 + controlbarGrabbed: false,
34 + controlbarDrag: false,
35 + controlbarMouseDownClientY: 0,
36 + controlbarMouseDownOffsetY: 0,
37 +
38 + lastKeyboardinput: null,
39 + defaultKeyboardinputLen: 100,
40 +
41 + inhibit_reconnect: true,
42 + reconnect_callback: null,
43 + reconnect_password: null,
44 +
45 + prime() {
46 + return WebUtil.initSettings().then(() => {
47 + if (document.readyState === "interactive" || document.readyState === "complete") {
48 + return UI.start();
49 + }
50 +
51 + return new Promise((resolve, reject) => {
52 + document.addEventListener('DOMContentLoaded', () => UI.start().then(resolve).catch(reject));
53 + });
54 + });
55 + },
56 +
57 + // Render default UI and initialize settings menu
58 + start() {
59 +
60 + if (urlargs.name) { document.title = urlargs.name + " - noVNC"; }
61 +
62 + UI.initSettings();
63 +
64 + // Translate the DOM
65 + l10n.translateDOM();
66 +
67 + // Adapt the interface for touch screen devices
68 + if (isTouchDevice) {
69 + document.documentElement.classList.add("noVNC_touch");
70 + // Remove the address bar
71 + setTimeout(() => window.scrollTo(0, 1), 100);
72 + }
73 +
74 + // Restore control bar position
75 + if (WebUtil.readSetting('controlbar_pos') === 'right') {
76 + UI.toggleControlbarSide();
77 + }
78 +
79 + UI.initFullscreen();
80 +
81 + // Setup event handlers
82 + UI.addControlbarHandlers();
83 + UI.addTouchSpecificHandlers();
84 + UI.addExtraKeysHandlers();
85 + UI.addMachineHandlers();
86 + UI.addConnectionControlHandlers();
87 + UI.addClipboardHandlers();
88 + UI.addSettingsHandlers();
89 + document.getElementById("noVNC_status")
90 + .addEventListener('click', UI.hideStatus);
91 +
92 + // Bootstrap fallback input handler
93 + UI.keyboardinputReset();
94 +
95 + UI.openControlbar();
96 +
97 + UI.updateVisualState('init');
98 +
99 + document.documentElement.classList.remove("noVNC_loading");
100 +
101 + let autoconnect = WebUtil.getConfigVar('autoconnect', false);
102 + if (autoconnect === 'true' || autoconnect == '1') {
103 + autoconnect = true;
104 + UI.connect();
105 + } else {
106 + autoconnect = false;
107 + // Show the connect panel on first load unless autoconnecting
108 + UI.openConnectPanel();
109 + }
110 +
111 + return Promise.resolve(UI.rfb);
112 + },
113 +
114 + initFullscreen() {
115 + // Only show the button if fullscreen is properly supported
116 + // * Safari doesn't support alphanumerical input while in fullscreen
117 + if (!isSafari() &&
118 + (document.documentElement.requestFullscreen ||
119 + document.documentElement.mozRequestFullScreen ||
120 + document.documentElement.webkitRequestFullscreen ||
121 + document.body.msRequestFullscreen)) {
122 + document.getElementById('noVNC_fullscreen_button')
123 + .classList.remove("noVNC_hidden");
124 + UI.addFullscreenHandlers();
125 + }
126 + },
127 +
128 + initSettings() {
129 + // Logging selection dropdown
130 + const llevels = ['error', 'warn', 'info', 'debug'];
131 + for (let i = 0; i < llevels.length; i += 1) {
132 + UI.addOption(document.getElementById('noVNC_setting_logging'), llevels[i], llevels[i]);
133 + }
134 +
135 + // Settings with immediate effects
136 + UI.initSetting('logging', 'warn');
137 + UI.updateLogging();
138 +
139 + // if port == 80 (or 443) then it won't be present and should be
140 + // set manually
141 + let port = window.location.port;
142 + if (!port) {
143 + if (window.location.protocol.substring(0, 5) == 'https') {
144 + port = 443;
145 + } else if (window.location.protocol.substring(0, 4) == 'http') {
146 + port = 80;
147 + }
148 + }
149 +
150 + /* Populate the controls if defaults are provided in the URL */
151 + UI.initSetting('host', window.location.hostname);
152 + UI.initSetting('port', port);
153 + UI.initSetting('encrypt', (window.location.protocol === "https:"));
154 + UI.initSetting('view_clip', false);
155 + UI.initSetting('resize', 'off');
156 + UI.initSetting('shared', true);
157 + UI.initSetting('view_only', false);
158 + UI.initSetting('show_dot', false);
159 + UI.initSetting('path', 'websockify');
160 + UI.initSetting('repeaterID', '');
161 + UI.initSetting('reconnect', false);
162 + UI.initSetting('reconnect_delay', 5000);
163 +
164 + UI.setupSettingLabels();
165 + },
166 + // Adds a link to the label elements on the corresponding input elements
167 + setupSettingLabels() {
168 + const labels = document.getElementsByTagName('LABEL');
169 + for (let i = 0; i < labels.length; i++) {
170 + const htmlFor = labels[i].htmlFor;
171 + if (htmlFor != '') {
172 + const elem = document.getElementById(htmlFor);
173 + if (elem) elem.label = labels[i];
174 + } else {
175 + // If 'for' isn't set, use the first input element child
176 + const children = labels[i].children;
177 + for (let j = 0; j < children.length; j++) {
178 + if (children[j].form !== undefined) {
179 + children[j].label = labels[i];
180 + break;
181 + }
182 + }
183 + }
184 + }
185 + },
186 +
187 +/* ------^-------
188 +* /INIT
189 +* ==============
190 +* EVENT HANDLERS
191 +* ------v------*/
192 +
193 + addControlbarHandlers() {
194 + document.getElementById("noVNC_control_bar")
195 + .addEventListener('mousemove', UI.activateControlbar);
196 + document.getElementById("noVNC_control_bar")
197 + .addEventListener('mouseup', UI.activateControlbar);
198 + document.getElementById("noVNC_control_bar")
199 + .addEventListener('mousedown', UI.activateControlbar);
200 + document.getElementById("noVNC_control_bar")
201 + .addEventListener('keydown', UI.activateControlbar);
202 +
203 + document.getElementById("noVNC_control_bar")
204 + .addEventListener('mousedown', UI.keepControlbar);
205 + document.getElementById("noVNC_control_bar")
206 + .addEventListener('keydown', UI.keepControlbar);
207 +
208 + document.getElementById("noVNC_view_drag_button")
209 + .addEventListener('click', UI.toggleViewDrag);
210 +
211 + document.getElementById("noVNC_control_bar_handle")
212 + .addEventListener('mousedown', UI.controlbarHandleMouseDown);
213 + document.getElementById("noVNC_control_bar_handle")
214 + .addEventListener('mouseup', UI.controlbarHandleMouseUp);
215 + document.getElementById("noVNC_control_bar_handle")
216 + .addEventListener('mousemove', UI.dragControlbarHandle);
217 + // resize events aren't available for elements
218 + window.addEventListener('resize', UI.updateControlbarHandle);
219 +
220 + const exps = document.getElementsByClassName("noVNC_expander");
221 + for (let i = 0;i < exps.length;i++) {
222 + exps[i].addEventListener('click', UI.toggleExpander);
223 + }
224 + },
225 +
226 + addTouchSpecificHandlers() {
227 + document.getElementById("noVNC_mouse_button0")
228 + .addEventListener('click', () => UI.setMouseButton(1));
229 + document.getElementById("noVNC_mouse_button1")
230 + .addEventListener('click', () => UI.setMouseButton(2));
231 + document.getElementById("noVNC_mouse_button2")
232 + .addEventListener('click', () => UI.setMouseButton(4));
233 + document.getElementById("noVNC_mouse_button4")
234 + .addEventListener('click', () => UI.setMouseButton(0));
235 + document.getElementById("noVNC_keyboard_button")
236 + .addEventListener('click', UI.toggleVirtualKeyboard);
237 +
238 + UI.touchKeyboard = new Keyboard(document.getElementById('noVNC_keyboardinput'));
239 + UI.touchKeyboard.onkeyevent = UI.keyEvent;
240 + UI.touchKeyboard.grab();
241 + document.getElementById("noVNC_keyboardinput")
242 + .addEventListener('input', UI.keyInput);
243 + document.getElementById("noVNC_keyboardinput")
244 + .addEventListener('focus', UI.onfocusVirtualKeyboard);
245 + document.getElementById("noVNC_keyboardinput")
246 + .addEventListener('blur', UI.onblurVirtualKeyboard);
247 + document.getElementById("noVNC_keyboardinput")
248 + .addEventListener('submit', () => false);
249 +
250 + document.documentElement
251 + .addEventListener('mousedown', UI.keepVirtualKeyboard, true);
252 +
253 + document.getElementById("noVNC_control_bar")
254 + .addEventListener('touchstart', UI.activateControlbar);
255 + document.getElementById("noVNC_control_bar")
256 + .addEventListener('touchmove', UI.activateControlbar);
257 + document.getElementById("noVNC_control_bar")
258 + .addEventListener('touchend', UI.activateControlbar);
259 + document.getElementById("noVNC_control_bar")
260 + .addEventListener('input', UI.activateControlbar);
261 +
262 + document.getElementById("noVNC_control_bar")
263 + .addEventListener('touchstart', UI.keepControlbar);
264 + document.getElementById("noVNC_control_bar")
265 + .addEventListener('input', UI.keepControlbar);
266 +
267 + document.getElementById("noVNC_control_bar_handle")
268 + .addEventListener('touchstart', UI.controlbarHandleMouseDown);
269 + document.getElementById("noVNC_control_bar_handle")
270 + .addEventListener('touchend', UI.controlbarHandleMouseUp);
271 + document.getElementById("noVNC_control_bar_handle")
272 + .addEventListener('touchmove', UI.dragControlbarHandle);
273 + },
274 +
275 + addExtraKeysHandlers() {
276 + document.getElementById("noVNC_toggle_extra_keys_button")
277 + .addEventListener('click', UI.toggleExtraKeys);
278 + document.getElementById("noVNC_toggle_ctrl_button")
279 + .addEventListener('click', UI.toggleCtrl);
280 + document.getElementById("noVNC_toggle_windows_button")
281 + .addEventListener('click', UI.toggleWindows);
282 + document.getElementById("noVNC_toggle_alt_button")
283 + .addEventListener('click', UI.toggleAlt);
284 + document.getElementById("noVNC_send_tab_button")
285 + .addEventListener('click', UI.sendTab);
286 + document.getElementById("noVNC_send_esc_button")
287 + .addEventListener('click', UI.sendEsc);
288 + document.getElementById("noVNC_send_ctrl_alt_del_button")
289 + .addEventListener('click', UI.sendCtrlAltDel);
290 + },
291 +
292 + addMachineHandlers() {
293 + document.getElementById("noVNC_shutdown_button")
294 + .addEventListener('click', () => UI.rfb.machineShutdown());
295 + document.getElementById("noVNC_reboot_button")
296 + .addEventListener('click', () => UI.rfb.machineReboot());
297 + document.getElementById("noVNC_reset_button")
298 + .addEventListener('click', () => UI.rfb.machineReset());
299 + document.getElementById("noVNC_power_button")
300 + .addEventListener('click', UI.togglePowerPanel);
301 + },
302 +
303 + addConnectionControlHandlers() {
304 + document.getElementById("noVNC_disconnect_button")
305 + .addEventListener('click', UI.disconnect);
306 + document.getElementById("noVNC_connect_button")
307 + .addEventListener('click', UI.connect);
308 + document.getElementById("noVNC_cancel_reconnect_button")
309 + .addEventListener('click', UI.cancelReconnect);
310 +
311 + document.getElementById("noVNC_password_button")
312 + .addEventListener('click', UI.setPassword);
313 + },
314 +
315 + addClipboardHandlers() {
316 + document.getElementById("noVNC_clipboard_button")
317 + .addEventListener('click', UI.toggleClipboardPanel);
318 + document.getElementById("noVNC_clipboard_text")
319 + .addEventListener('change', UI.clipboardSend);
320 + document.getElementById("noVNC_clipboard_clear_button")
321 + .addEventListener('click', UI.clipboardClear);
322 + },
323 +
324 + // Add a call to save settings when the element changes,
325 + // unless the optional parameter changeFunc is used instead.
326 + addSettingChangeHandler(name, changeFunc) {
327 + const settingElem = document.getElementById("noVNC_setting_" + name);
328 + if (changeFunc === undefined) {
329 + changeFunc = () => UI.saveSetting(name);
330 + }
331 + settingElem.addEventListener('change', changeFunc);
332 + },
333 +
334 + addSettingsHandlers() {
335 + document.getElementById("noVNC_settings_button")
336 + .addEventListener('click', UI.toggleSettingsPanel);
337 +
338 + UI.addSettingChangeHandler('encrypt');
339 + UI.addSettingChangeHandler('resize');
340 + UI.addSettingChangeHandler('resize', UI.applyResizeMode);
341 + UI.addSettingChangeHandler('resize', UI.updateViewClip);
342 + UI.addSettingChangeHandler('view_clip');
343 + UI.addSettingChangeHandler('view_clip', UI.updateViewClip);
344 + UI.addSettingChangeHandler('shared');
345 + UI.addSettingChangeHandler('view_only');
346 + UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
347 + UI.addSettingChangeHandler('show_dot');
348 + UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor);
349 + UI.addSettingChangeHandler('host');
350 + UI.addSettingChangeHandler('port');
351 + UI.addSettingChangeHandler('path');
352 + UI.addSettingChangeHandler('repeaterID');
353 + UI.addSettingChangeHandler('logging');
354 + UI.addSettingChangeHandler('logging', UI.updateLogging);
355 + UI.addSettingChangeHandler('reconnect');
356 + UI.addSettingChangeHandler('reconnect_delay');
357 + },
358 +
359 + addFullscreenHandlers() {
360 + document.getElementById("noVNC_fullscreen_button")
361 + .addEventListener('click', UI.toggleFullscreen);
362 +
363 + window.addEventListener('fullscreenchange', UI.updateFullscreenButton);
364 + window.addEventListener('mozfullscreenchange', UI.updateFullscreenButton);
365 + window.addEventListener('webkitfullscreenchange', UI.updateFullscreenButton);
366 + window.addEventListener('msfullscreenchange', UI.updateFullscreenButton);
367 + },
368 +
369 +/* ------^-------
370 + * /EVENT HANDLERS
371 + * ==============
372 + * VISUAL
373 + * ------v------*/
374 +
375 + // Disable/enable controls depending on connection state
376 + updateVisualState(state) {
377 +
378 + document.documentElement.classList.remove("noVNC_connecting");
379 + document.documentElement.classList.remove("noVNC_connected");
380 + document.documentElement.classList.remove("noVNC_disconnecting");
381 + document.documentElement.classList.remove("noVNC_reconnecting");
382 +
383 + const transition_elem = document.getElementById("noVNC_transition_text");
384 + switch (state) {
385 + case 'init':
386 + break;
387 + case 'connecting':
388 + transition_elem.textContent = _("Connecting...");
389 + document.documentElement.classList.add("noVNC_connecting");
390 + break;
391 + case 'connected':
392 + document.documentElement.classList.add("noVNC_connected");
393 + break;
394 + case 'disconnecting':
395 + transition_elem.textContent = _("Disconnecting...");
396 + document.documentElement.classList.add("noVNC_disconnecting");
397 + break;
398 + case 'disconnected':
399 + break;
400 + case 'reconnecting':
401 + transition_elem.textContent = _("Reconnecting...");
402 + document.documentElement.classList.add("noVNC_reconnecting");
403 + break;
404 + default:
405 + Log.Error("Invalid visual state: " + state);
406 + UI.showStatus(_("Internal error"), 'error');
407 + return;
408 + }
409 +
410 + if (UI.connected) {
411 + UI.updateViewClip();
412 +
413 + UI.disableSetting('encrypt');
414 + UI.disableSetting('shared');
415 + UI.disableSetting('host');
416 + UI.disableSetting('port');
417 + UI.disableSetting('path');
418 + UI.disableSetting('repeaterID');
419 + UI.setMouseButton(1);
420 +
421 + // Hide the controlbar after 2 seconds
422 + UI.closeControlbarTimeout = setTimeout(UI.closeControlbar, 2000);
423 + } else {
424 + UI.enableSetting('encrypt');
425 + UI.enableSetting('shared');
426 + UI.enableSetting('host');
427 + UI.enableSetting('port');
428 + UI.enableSetting('path');
429 + UI.enableSetting('repeaterID');
430 + UI.updatePowerButton();
431 + UI.keepControlbar();
432 + }
433 +
434 + // State change closes the password dialog
435 + document.getElementById('noVNC_password_dlg')
436 + .classList.remove('noVNC_open');
437 + },
438 +
439 + showStatus(text, status_type, time) {
440 + const statusElem = document.getElementById('noVNC_status');
441 +
442 + clearTimeout(UI.statusTimeout);
443 +
444 + if (typeof status_type === 'undefined') {
445 + status_type = 'normal';
446 + }
447 +
448 + // Don't overwrite more severe visible statuses and never
449 + // errors. Only shows the first error.
450 + let visible_status_type = 'none';
451 + if (statusElem.classList.contains("noVNC_open")) {
452 + if (statusElem.classList.contains("noVNC_status_error")) {
453 + visible_status_type = 'error';
454 + } else if (statusElem.classList.contains("noVNC_status_warn")) {
455 + visible_status_type = 'warn';
456 + } else {
457 + visible_status_type = 'normal';
458 + }
459 + }
460 + if (visible_status_type === 'error' ||
461 + (visible_status_type === 'warn' && status_type === 'normal')) {
462 + return;
463 + }
464 +
465 + switch (status_type) {
466 + case 'error':
467 + statusElem.classList.remove("noVNC_status_warn");
468 + statusElem.classList.remove("noVNC_status_normal");
469 + statusElem.classList.add("noVNC_status_error");
470 + break;
471 + case 'warning':
472 + case 'warn':
473 + statusElem.classList.remove("noVNC_status_error");
474 + statusElem.classList.remove("noVNC_status_normal");
475 + statusElem.classList.add("noVNC_status_warn");
476 + break;
477 + case 'normal':
478 + case 'info':
479 + default:
480 + statusElem.classList.remove("noVNC_status_error");
481 + statusElem.classList.remove("noVNC_status_warn");
482 + statusElem.classList.add("noVNC_status_normal");
483 + break;
484 + }
485 +
486 + statusElem.textContent = text;
487 + statusElem.classList.add("noVNC_open");
488 +
489 + // If no time was specified, show the status for 1.5 seconds
490 + if (typeof time === 'undefined') {
491 + time = 1500;
492 + }
493 +
494 + // Error messages do not timeout
495 + if (status_type !== 'error') {
496 + UI.statusTimeout = window.setTimeout(UI.hideStatus, time);
497 + }
498 + },
499 +
500 + hideStatus() {
501 + clearTimeout(UI.statusTimeout);
502 + document.getElementById('noVNC_status').classList.remove("noVNC_open");
503 + },
504 +
505 + activateControlbar(event) {
506 + clearTimeout(UI.idleControlbarTimeout);
507 + // We manipulate the anchor instead of the actual control
508 + // bar in order to avoid creating new a stacking group
509 + document.getElementById('noVNC_control_bar_anchor')
510 + .classList.remove("noVNC_idle");
511 + UI.idleControlbarTimeout = window.setTimeout(UI.idleControlbar, 2000);
512 + },
513 +
514 + idleControlbar() {
515 + document.getElementById('noVNC_control_bar_anchor')
516 + .classList.add("noVNC_idle");
517 + },
518 +
519 + keepControlbar() {
520 + clearTimeout(UI.closeControlbarTimeout);
521 + },
522 +
523 + openControlbar() {
524 + document.getElementById('noVNC_control_bar')
525 + .classList.add("noVNC_open");
526 + },
527 +
528 + closeControlbar() {
529 + UI.closeAllPanels();
530 + document.getElementById('noVNC_control_bar')
531 + .classList.remove("noVNC_open");
532 + },
533 +
534 + toggleControlbar() {
535 + if (document.getElementById('noVNC_control_bar')
536 + .classList.contains("noVNC_open")) {
537 + UI.closeControlbar();
538 + } else {
539 + UI.openControlbar();
540 + }
541 + },
542 +
543 + toggleControlbarSide() {
544 + // Temporarily disable animation, if bar is displayed, to avoid weird
545 + // movement. The transitionend-event will not fire when display=none.
546 + const bar = document.getElementById('noVNC_control_bar');
547 + const barDisplayStyle = window.getComputedStyle(bar).display;
548 + if (barDisplayStyle !== 'none') {
549 + bar.style.transitionDuration = '0s';
550 + bar.addEventListener('transitionend', () => bar.style.transitionDuration = '');
551 + }
552 +
553 + const anchor = document.getElementById('noVNC_control_bar_anchor');
554 + if (anchor.classList.contains("noVNC_right")) {
555 + WebUtil.writeSetting('controlbar_pos', 'left');
556 + anchor.classList.remove("noVNC_right");
557 + } else {
558 + WebUtil.writeSetting('controlbar_pos', 'right');
559 + anchor.classList.add("noVNC_right");
560 + }
561 +
562 + // Consider this a movement of the handle
563 + UI.controlbarDrag = true;
564 + },
565 +
566 + showControlbarHint(show) {
567 + const hint = document.getElementById('noVNC_control_bar_hint');
568 + if (show) {
569 + hint.classList.add("noVNC_active");
570 + } else {
571 + hint.classList.remove("noVNC_active");
572 + }
573 + },
574 +
575 + dragControlbarHandle(e) {
576 + if (!UI.controlbarGrabbed) return;
577 +
578 + const ptr = getPointerEvent(e);
579 +
580 + const anchor = document.getElementById('noVNC_control_bar_anchor');
581 + if (ptr.clientX < (window.innerWidth * 0.1)) {
582 + if (anchor.classList.contains("noVNC_right")) {
583 + UI.toggleControlbarSide();
584 + }
585 + } else if (ptr.clientX > (window.innerWidth * 0.9)) {
586 + if (!anchor.classList.contains("noVNC_right")) {
587 + UI.toggleControlbarSide();
588 + }
589 + }
590 +
591 + if (!UI.controlbarDrag) {
592 + const dragDistance = Math.abs(ptr.clientY - UI.controlbarMouseDownClientY);
593 +
594 + if (dragDistance < dragThreshold) return;
595 +
596 + UI.controlbarDrag = true;
597 + }
598 +
599 + const eventY = ptr.clientY - UI.controlbarMouseDownOffsetY;
600 +
601 + UI.moveControlbarHandle(eventY);
602 +
603 + e.preventDefault();
604 + e.stopPropagation();
605 + UI.keepControlbar();
606 + UI.activateControlbar();
607 + },
608 +
609 + // Move the handle but don't allow any position outside the bounds
610 + moveControlbarHandle(viewportRelativeY) {
611 + const handle = document.getElementById("noVNC_control_bar_handle");
612 + const handleHeight = handle.getBoundingClientRect().height;
613 + const controlbarBounds = document.getElementById("noVNC_control_bar")
614 + .getBoundingClientRect();
615 + const margin = 10;
616 +
617 + // These heights need to be non-zero for the below logic to work
618 + if (handleHeight === 0 || controlbarBounds.height === 0) {
619 + return;
620 + }
621 +
622 + let newY = viewportRelativeY;
623 +
624 + // Check if the coordinates are outside the control bar
625 + if (newY < controlbarBounds.top + margin) {
626 + // Force coordinates to be below the top of the control bar
627 + newY = controlbarBounds.top + margin;
628 +
629 + } else if (newY > controlbarBounds.top +
630 + controlbarBounds.height - handleHeight - margin) {
631 + // Force coordinates to be above the bottom of the control bar
632 + newY = controlbarBounds.top +
633 + controlbarBounds.height - handleHeight - margin;
634 + }
635 +
636 + // Corner case: control bar too small for stable position
637 + if (controlbarBounds.height < (handleHeight + margin * 2)) {
638 + newY = controlbarBounds.top +
639 + (controlbarBounds.height - handleHeight) / 2;
640 + }
641 +
642 + // The transform needs coordinates that are relative to the parent
643 + const parentRelativeY = newY - controlbarBounds.top;
644 + handle.style.transform = "translateY(" + parentRelativeY + "px)";
645 + },
646 +
647 + updateControlbarHandle() {
648 + // Since the control bar is fixed on the viewport and not the page,
649 + // the move function expects coordinates relative the the viewport.
650 + const handle = document.getElementById("noVNC_control_bar_handle");
651 + const handleBounds = handle.getBoundingClientRect();
652 + UI.moveControlbarHandle(handleBounds.top);
653 + },
654 +
655 + controlbarHandleMouseUp(e) {
656 + if ((e.type == "mouseup") && (e.button != 0)) return;
657 +
658 + // mouseup and mousedown on the same place toggles the controlbar
659 + if (UI.controlbarGrabbed && !UI.controlbarDrag) {
660 + UI.toggleControlbar();
661 + e.preventDefault();
662 + e.stopPropagation();
663 + UI.keepControlbar();
664 + UI.activateControlbar();
665 + }
666 + UI.controlbarGrabbed = false;
667 + UI.showControlbarHint(false);
668 + },
669 +
670 + controlbarHandleMouseDown(e) {
671 + if ((e.type == "mousedown") && (e.button != 0)) return;
672 +
673 + const ptr = getPointerEvent(e);
674 +
675 + const handle = document.getElementById("noVNC_control_bar_handle");
676 + const bounds = handle.getBoundingClientRect();
677 +
678 + // Touch events have implicit capture
679 + if (e.type === "mousedown") {
680 + setCapture(handle);
681 + }
682 +
683 + UI.controlbarGrabbed = true;
684 + UI.controlbarDrag = false;
685 +
686 + UI.showControlbarHint(true);
687 +
688 + UI.controlbarMouseDownClientY = ptr.clientY;
689 + UI.controlbarMouseDownOffsetY = ptr.clientY - bounds.top;
690 + e.preventDefault();
691 + e.stopPropagation();
692 + UI.keepControlbar();
693 + UI.activateControlbar();
694 + },
695 +
696 + toggleExpander(e) {
697 + if (this.classList.contains("noVNC_open")) {
698 + this.classList.remove("noVNC_open");
699 + } else {
700 + this.classList.add("noVNC_open");
701 + }
702 + },
703 +
704 +/* ------^-------
705 + * /VISUAL
706 + * ==============
707 + * SETTINGS
708 + * ------v------*/
709 +
710 + // Initial page load read/initialization of settings
711 + initSetting(name, defVal) {
712 + // Check Query string followed by cookie
713 + let val = WebUtil.getConfigVar(name);
714 + if (val === null) {
715 + val = WebUtil.readSetting(name, defVal);
716 + }
717 + WebUtil.setSetting(name, val);
718 + UI.updateSetting(name);
719 + return val;
720 + },
721 +
722 + // Set the new value, update and disable form control setting
723 + forceSetting(name, val) {
724 + WebUtil.setSetting(name, val);
725 + UI.updateSetting(name);
726 + UI.disableSetting(name);
727 + },
728 +
729 + // Update cookie and form control setting. If value is not set, then
730 + // updates from control to current cookie setting.
731 + updateSetting(name) {
732 +
733 + // Update the settings control
734 + let value = UI.getSetting(name);
735 +
736 + const ctrl = document.getElementById('noVNC_setting_' + name);
737 + if (ctrl.type === 'checkbox') {
738 + ctrl.checked = value;
739 +
740 + } else if (typeof ctrl.options !== 'undefined') {
741 + for (let i = 0; i < ctrl.options.length; i += 1) {
742 + if (ctrl.options[i].value === value) {
743 + ctrl.selectedIndex = i;
744 + break;
745 + }
746 + }
747 + } else {
748 + /*Weird IE9 error leads to 'null' appearring
749 + in textboxes instead of ''.*/
750 + if (value === null) {
751 + value = "";
752 + }
753 + ctrl.value = value;
754 + }
755 + },
756 +
757 + // Save control setting to cookie
758 + saveSetting(name) {
759 + const ctrl = document.getElementById('noVNC_setting_' + name);
760 + let val;
761 + if (ctrl.type === 'checkbox') {
762 + val = ctrl.checked;
763 + } else if (typeof ctrl.options !== 'undefined') {
764 + val = ctrl.options[ctrl.selectedIndex].value;
765 + } else {
766 + val = ctrl.value;
767 + }
768 + WebUtil.writeSetting(name, val);
769 + //Log.Debug("Setting saved '" + name + "=" + val + "'");
770 + return val;
771 + },
772 +
773 + // Read form control compatible setting from cookie
774 + getSetting(name) {
775 + const ctrl = document.getElementById('noVNC_setting_' + name);
776 + let val = WebUtil.readSetting(name);
777 + if (typeof val !== 'undefined' && val !== null && ctrl.type === 'checkbox') {
778 + if (val.toString().toLowerCase() in {'0': 1, 'no': 1, 'false': 1}) {
779 + val = false;
780 + } else {
781 + val = true;
782 + }
783 + }
784 + return val;
785 + },
786 +
787 + // These helpers compensate for the lack of parent-selectors and
788 + // previous-sibling-selectors in CSS which are needed when we want to
789 + // disable the labels that belong to disabled input elements.
790 + disableSetting(name) {
791 + const ctrl = document.getElementById('noVNC_setting_' + name);
792 + ctrl.disabled = true;
793 + ctrl.label.classList.add('noVNC_disabled');
794 + },
795 +
796 + enableSetting(name) {
797 + const ctrl = document.getElementById('noVNC_setting_' + name);
798 + ctrl.disabled = false;
799 + ctrl.label.classList.remove('noVNC_disabled');
800 + },
801 +
802 +/* ------^-------
803 + * /SETTINGS
804 + * ==============
805 + * PANELS
806 + * ------v------*/
807 +
808 + closeAllPanels() {
809 + UI.closeSettingsPanel();
810 + UI.closePowerPanel();
811 + UI.closeClipboardPanel();
812 + UI.closeExtraKeys();
813 + },
814 +
815 +/* ------^-------
816 + * /PANELS
817 + * ==============
818 + * SETTINGS (panel)
819 + * ------v------*/
820 +
821 + openSettingsPanel() {
822 + UI.closeAllPanels();
823 + UI.openControlbar();
824 +
825 + // Refresh UI elements from saved cookies
826 + UI.updateSetting('encrypt');
827 + UI.updateSetting('view_clip');
828 + UI.updateSetting('resize');
829 + UI.updateSetting('shared');
830 + UI.updateSetting('view_only');
831 + UI.updateSetting('path');
832 + UI.updateSetting('repeaterID');
833 + UI.updateSetting('logging');
834 + UI.updateSetting('reconnect');
835 + UI.updateSetting('reconnect_delay');
836 +
837 + document.getElementById('noVNC_settings')
838 + .classList.add("noVNC_open");
839 + document.getElementById('noVNC_settings_button')
840 + .classList.add("noVNC_selected");
841 + },
842 +
843 + closeSettingsPanel() {
844 + document.getElementById('noVNC_settings')
845 + .classList.remove("noVNC_open");
846 + document.getElementById('noVNC_settings_button')
847 + .classList.remove("noVNC_selected");
848 + },
849 +
850 + toggleSettingsPanel() {
851 + if (document.getElementById('noVNC_settings')
852 + .classList.contains("noVNC_open")) {
853 + UI.closeSettingsPanel();
854 + } else {
855 + UI.openSettingsPanel();
856 + }
857 + },
858 +
859 +/* ------^-------
860 + * /SETTINGS
861 + * ==============
862 + * POWER
863 + * ------v------*/
864 +
865 + openPowerPanel() {
866 + UI.closeAllPanels();
867 + UI.openControlbar();
868 +
869 + document.getElementById('noVNC_power')
870 + .classList.add("noVNC_open");
871 + document.getElementById('noVNC_power_button')
872 + .classList.add("noVNC_selected");
873 + },
874 +
875 + closePowerPanel() {
876 + document.getElementById('noVNC_power')
877 + .classList.remove("noVNC_open");
878 + document.getElementById('noVNC_power_button')
879 + .classList.remove("noVNC_selected");
880 + },
881 +
882 + togglePowerPanel() {
883 + if (document.getElementById('noVNC_power')
884 + .classList.contains("noVNC_open")) {
885 + UI.closePowerPanel();
886 + } else {
887 + UI.openPowerPanel();
888 + }
889 + },
890 +
891 + // Disable/enable power button
892 + updatePowerButton() {
893 + if (UI.connected &&
894 + UI.rfb.capabilities.power &&
895 + !UI.rfb.viewOnly) {
896 + document.getElementById('noVNC_power_button')
897 + .classList.remove("noVNC_hidden");
898 + } else {
899 + document.getElementById('noVNC_power_button')
900 + .classList.add("noVNC_hidden");
901 + // Close power panel if open
902 + UI.closePowerPanel();
903 + }
904 + },
905 +
906 +/* ------^-------
907 + * /POWER
908 + * ==============
909 + * CLIPBOARD
910 + * ------v------*/
911 +
912 + openClipboardPanel() {
913 + UI.closeAllPanels();
914 + UI.openControlbar();
915 +
916 + document.getElementById('noVNC_clipboard')
917 + .classList.add("noVNC_open");
918 + document.getElementById('noVNC_clipboard_button')
919 + .classList.add("noVNC_selected");
920 + },
921 +
922 + closeClipboardPanel() {
923 + document.getElementById('noVNC_clipboard')
924 + .classList.remove("noVNC_open");
925 + document.getElementById('noVNC_clipboard_button')
926 + .classList.remove("noVNC_selected");
927 + },
928 +
929 + toggleClipboardPanel() {
930 + if (document.getElementById('noVNC_clipboard')
931 + .classList.contains("noVNC_open")) {
932 + UI.closeClipboardPanel();
933 + } else {
934 + UI.openClipboardPanel();
935 + }
936 + },
937 +
938 + clipboardReceive(e) {
939 + Log.Debug(">> UI.clipboardReceive: " + e.detail.text.substr(0, 40) + "...");
940 + document.getElementById('noVNC_clipboard_text').value = e.detail.text;
941 + Log.Debug("<< UI.clipboardReceive");
942 + },
943 +
944 + clipboardClear() {
945 + document.getElementById('noVNC_clipboard_text').value = "";
946 + UI.rfb.clipboardPasteFrom("");
947 + },
948 +
949 + clipboardSend() {
950 + const text = document.getElementById('noVNC_clipboard_text').value;
951 + Log.Debug(">> UI.clipboardSend: " + text.substr(0, 40) + "...");
952 + UI.rfb.clipboardPasteFrom(text);
953 + Log.Debug("<< UI.clipboardSend");
954 + },
955 +
956 +/* ------^-------
957 + * /CLIPBOARD
958 + * ==============
959 + * CONNECTION
960 + * ------v------*/
961 +
962 + openConnectPanel() {
963 + document.getElementById('noVNC_connect_dlg')
964 + .classList.add("noVNC_open");
965 + },
966 +
967 + closeConnectPanel() {
968 + document.getElementById('noVNC_connect_dlg')
969 + .classList.remove("noVNC_open");
970 + },
971 +
972 + connect(event, password) {
973 +
974 + // Ignore when rfb already exists
975 + if (typeof UI.rfb !== 'undefined') {
976 + return;
977 + }
978 +
979 + const host = UI.getSetting('host');
980 + const port = UI.getSetting('port');
981 + const path = UI.getSetting('path');
982 +
983 + if (typeof password === 'undefined') {
984 + password = WebUtil.getConfigVar('password');
985 + UI.reconnect_password = password;
986 + }
987 +
988 + if (password === null) {
989 + password = undefined;
990 + }
991 +
992 + UI.hideStatus();
993 +
994 + if (!host) {
995 + Log.Error("Can't connect when host is: " + host);
996 + UI.showStatus(_("Must set host"), 'error');
997 + return;
998 + }
999 +
1000 + UI.closeAllPanels();
1001 + UI.closeConnectPanel();
1002 +
1003 + UI.updateVisualState('connecting');
1004 +
1005 + UI.rfb = new RFB(document.getElementById('noVNC_container'), urlargs.ws,
1006 + { shared: UI.getSetting('shared'),
1007 + showDotCursor: UI.getSetting('show_dot'),
1008 + repeaterID: UI.getSetting('repeaterID'),
1009 + credentials: { password: password } });
1010 + UI.rfb.addEventListener("connect", UI.connectFinished);
1011 + UI.rfb.addEventListener("disconnect", UI.disconnectFinished);
1012 + UI.rfb.addEventListener("credentialsrequired", UI.credentials);
1013 + UI.rfb.addEventListener("securityfailure", UI.securityFailed);
1014 + UI.rfb.addEventListener("capabilities", UI.updatePowerButton);
1015 + UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
1016 + UI.rfb.addEventListener("bell", UI.bell);
1017 + UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
1018 + UI.rfb.clipViewport = UI.getSetting('view_clip');
1019 + UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
1020 + UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
1021 +
1022 + UI.updateViewOnly(); // requires UI.rfb
1023 + },
1024 +
1025 + disconnect() {
1026 + UI.closeAllPanels();
1027 + UI.rfb.disconnect();
1028 +
1029 + UI.connected = false;
1030 +
1031 + // Disable automatic reconnecting
1032 + UI.inhibit_reconnect = true;
1033 +
1034 + UI.updateVisualState('disconnecting');
1035 +
1036 + // Don't display the connection settings until we're actually disconnected
1037 + },
1038 +
1039 + reconnect() {
1040 + UI.reconnect_callback = null;
1041 +
1042 + // if reconnect has been disabled in the meantime, do nothing.
1043 + if (UI.inhibit_reconnect) {
1044 + return;
1045 + }
1046 +
1047 + UI.connect(null, UI.reconnect_password);
1048 + },
1049 +
1050 + cancelReconnect() {
1051 + if (UI.reconnect_callback !== null) {
1052 + clearTimeout(UI.reconnect_callback);
1053 + UI.reconnect_callback = null;
1054 + }
1055 +
1056 + UI.updateVisualState('disconnected');
1057 +
1058 + UI.openControlbar();
1059 + UI.openConnectPanel();
1060 + },
1061 +
1062 + connectFinished(e) {
1063 + UI.connected = true;
1064 + UI.inhibit_reconnect = false;
1065 +
1066 + let msg;
1067 + if (UI.getSetting('encrypt')) {
1068 + msg = _("Connected (encrypted) to ") + UI.desktopName;
1069 + } else {
1070 + msg = _("Connected (unencrypted) to ") + UI.desktopName;
1071 + }
1072 + UI.showStatus(msg);
1073 + UI.updateVisualState('connected');
1074 +
1075 + // Do this last because it can only be used on rendered elements
1076 + UI.rfb.focus();
1077 + },
1078 +
1079 + disconnectFinished(e) {
1080 + const wasConnected = UI.connected;
1081 +
1082 + // This variable is ideally set when disconnection starts, but
1083 + // when the disconnection isn't clean or if it is initiated by
1084 + // the server, we need to do it here as well since
1085 + // UI.disconnect() won't be used in those cases.
1086 + UI.connected = false;
1087 +
1088 + UI.rfb = undefined;
1089 +
1090 + if (!e.detail.clean) {
1091 + UI.updateVisualState('disconnected');
1092 + if (wasConnected) {
1093 + UI.showStatus(_("Something went wrong, connection is closed"),
1094 + 'error');
1095 + } else {
1096 + UI.showStatus(_("Failed to connect to server"), 'error');
1097 + }
1098 + } else if (UI.getSetting('reconnect', false) === true && !UI.inhibit_reconnect) {
1099 + UI.updateVisualState('reconnecting');
1100 +
1101 + const delay = parseInt(UI.getSetting('reconnect_delay'));
1102 + UI.reconnect_callback = setTimeout(UI.reconnect, delay);
1103 + return;
1104 + } else {
1105 + UI.updateVisualState('disconnected');
1106 + UI.showStatus(_("Disconnected"), 'normal');
1107 + }
1108 +
1109 + UI.openControlbar();
1110 + UI.openConnectPanel();
1111 + },
1112 +
1113 + securityFailed(e) {
1114 + let msg = "";
1115 + // On security failures we might get a string with a reason
1116 + // directly from the server. Note that we can't control if
1117 + // this string is translated or not.
1118 + if ('reason' in e.detail) {
1119 + msg = _("New connection has been rejected with reason: ") +
1120 + e.detail.reason;
1121 + } else {
1122 + msg = _("New connection has been rejected");
1123 + }
1124 + UI.showStatus(msg, 'error');
1125 + },
1126 +
1127 +/* ------^-------
1128 + * /CONNECTION
1129 + * ==============
1130 + * PASSWORD
1131 + * ------v------*/
1132 +
1133 + credentials(e) {
1134 + // FIXME: handle more types
1135 + document.getElementById('noVNC_password_dlg')
1136 + .classList.add('noVNC_open');
1137 +
1138 + setTimeout(() => document
1139 + .getElementById('noVNC_password_input').focus(), 100);
1140 +
1141 + Log.Warn("Server asked for a password");
1142 + UI.showStatus(_("Password is required"), "warning");
1143 + },
1144 +
1145 + setPassword(e) {
1146 + // Prevent actually submitting the form
1147 + e.preventDefault();
1148 +
1149 + const inputElem = document.getElementById('noVNC_password_input');
1150 + const password = inputElem.value;
1151 + // Clear the input after reading the password
1152 + inputElem.value = "";
1153 + UI.rfb.sendCredentials({ password: password });
1154 + UI.reconnect_password = password;
1155 + document.getElementById('noVNC_password_dlg')
1156 + .classList.remove('noVNC_open');
1157 + },
1158 +
1159 +/* ------^-------
1160 + * /PASSWORD
1161 + * ==============
1162 + * FULLSCREEN
1163 + * ------v------*/
1164 +
1165 + toggleFullscreen() {
1166 + if (document.fullscreenElement || // alternative standard method
1167 + document.mozFullScreenElement || // currently working methods
1168 + document.webkitFullscreenElement ||
1169 + document.msFullscreenElement) {
1170 + if (document.exitFullscreen) {
1171 + document.exitFullscreen();
1172 + } else if (document.mozCancelFullScreen) {
1173 + document.mozCancelFullScreen();
1174 + } else if (document.webkitExitFullscreen) {
1175 + document.webkitExitFullscreen();
1176 + } else if (document.msExitFullscreen) {
1177 + document.msExitFullscreen();
1178 + }
1179 + } else {
1180 + if (document.documentElement.requestFullscreen) {
1181 + document.documentElement.requestFullscreen();
1182 + } else if (document.documentElement.mozRequestFullScreen) {
1183 + document.documentElement.mozRequestFullScreen();
1184 + } else if (document.documentElement.webkitRequestFullscreen) {
1185 + document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
1186 + } else if (document.body.msRequestFullscreen) {
1187 + document.body.msRequestFullscreen();
1188 + }
1189 + }
1190 + UI.updateFullscreenButton();
1191 + },
1192 +
1193 + updateFullscreenButton() {
1194 + if (document.fullscreenElement || // alternative standard method
1195 + document.mozFullScreenElement || // currently working methods
1196 + document.webkitFullscreenElement ||
1197 + document.msFullscreenElement ) {
1198 + document.getElementById('noVNC_fullscreen_button')
1199 + .classList.add("noVNC_selected");
1200 + } else {
1201 + document.getElementById('noVNC_fullscreen_button')
1202 + .classList.remove("noVNC_selected");
1203 + }
1204 + },
1205 +
1206 +/* ------^-------
1207 + * /FULLSCREEN
1208 + * ==============
1209 + * RESIZE
1210 + * ------v------*/
1211 +
1212 + // Apply remote resizing or local scaling
1213 + applyResizeMode() {
1214 + if (!UI.rfb) return;
1215 +
1216 + UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
1217 + UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
1218 + },
1219 +
1220 +/* ------^-------
1221 + * /RESIZE
1222 + * ==============
1223 + * VIEW CLIPPING
1224 + * ------v------*/
1225 +
1226 + // Update viewport clipping property for the connection. The normal
1227 + // case is to get the value from the setting. There are special cases
1228 + // for when the viewport is scaled or when a touch device is used.
1229 + updateViewClip() {
1230 + if (!UI.rfb) return;
1231 +
1232 + const scaling = UI.getSetting('resize') === 'scale';
1233 +
1234 + if (scaling) {
1235 + // Can't be clipping if viewport is scaled to fit
1236 + UI.forceSetting('view_clip', false);
1237 + UI.rfb.clipViewport = false;
1238 + } else if (isIOS() || isAndroid()) {
1239 + // iOS and Android usually have shit scrollbars
1240 + UI.forceSetting('view_clip', true);
1241 + UI.rfb.clipViewport = true;
1242 + } else {
1243 + UI.enableSetting('view_clip');
1244 + UI.rfb.clipViewport = UI.getSetting('view_clip');
1245 + }
1246 +
1247 + // Changing the viewport may change the state of
1248 + // the dragging button
1249 + UI.updateViewDrag();
1250 + },
1251 +
1252 +/* ------^-------
1253 + * /VIEW CLIPPING
1254 + * ==============
1255 + * VIEWDRAG
1256 + * ------v------*/
1257 +
1258 + toggleViewDrag() {
1259 + if (!UI.rfb) return;
1260 +
1261 + UI.rfb.dragViewport = !UI.rfb.dragViewport;
1262 + UI.updateViewDrag();
1263 + },
1264 +
1265 + updateViewDrag() {
1266 + if (!UI.connected) return;
1267 +
1268 + const viewDragButton = document.getElementById('noVNC_view_drag_button');
1269 +
1270 + if (!UI.rfb.clipViewport && UI.rfb.dragViewport) {
1271 + // We are no longer clipping the viewport. Make sure
1272 + // viewport drag isn't active when it can't be used.
1273 + UI.rfb.dragViewport = false;
1274 + }
1275 +
1276 + if (UI.rfb.dragViewport) {
1277 + viewDragButton.classList.add("noVNC_selected");
1278 + } else {
1279 + viewDragButton.classList.remove("noVNC_selected");
1280 + }
1281 +
1282 + // Different behaviour for touch vs non-touch
1283 + // The button is disabled instead of hidden on touch devices
1284 + if (isTouchDevice) {
1285 + viewDragButton.classList.remove("noVNC_hidden");
1286 +
1287 + if (UI.rfb.clipViewport) {
1288 + viewDragButton.disabled = false;
1289 + } else {
1290 + viewDragButton.disabled = true;
1291 + }
1292 + } else {
1293 + viewDragButton.disabled = false;
1294 +
1295 + if (UI.rfb.clipViewport) {
1296 + viewDragButton.classList.remove("noVNC_hidden");
1297 + } else {
1298 + viewDragButton.classList.add("noVNC_hidden");
1299 + }
1300 + }
1301 + },
1302 +
1303 +/* ------^-------
1304 + * /VIEWDRAG
1305 + * ==============
1306 + * KEYBOARD
1307 + * ------v------*/
1308 +
1309 + showVirtualKeyboard() {
1310 + if (!isTouchDevice) return;
1311 +
1312 + const input = document.getElementById('noVNC_keyboardinput');
1313 +
1314 + if (document.activeElement == input) return;
1315 +
1316 + input.focus();
1317 +
1318 + try {
1319 + const l = input.value.length;
1320 + // Move the caret to the end
1321 + input.setSelectionRange(l, l);
1322 + } catch (err) {
1323 + // setSelectionRange is undefined in Google Chrome
1324 + }
1325 + },
1326 +
1327 + hideVirtualKeyboard() {
1328 + if (!isTouchDevice) return;
1329 +
1330 + const input = document.getElementById('noVNC_keyboardinput');
1331 +
1332 + if (document.activeElement != input) return;
1333 +
1334 + input.blur();
1335 + },
1336 +
1337 + toggleVirtualKeyboard() {
1338 + if (document.getElementById('noVNC_keyboard_button')
1339 + .classList.contains("noVNC_selected")) {
1340 + UI.hideVirtualKeyboard();
1341 + } else {
1342 + UI.showVirtualKeyboard();
1343 + }
1344 + },
1345 +
1346 + onfocusVirtualKeyboard(event) {
1347 + document.getElementById('noVNC_keyboard_button')
1348 + .classList.add("noVNC_selected");
1349 + if (UI.rfb) {
1350 + UI.rfb.focusOnClick = false;
1351 + }
1352 + },
1353 +
1354 + onblurVirtualKeyboard(event) {
1355 + document.getElementById('noVNC_keyboard_button')
1356 + .classList.remove("noVNC_selected");
1357 + if (UI.rfb) {
1358 + UI.rfb.focusOnClick = true;
1359 + }
1360 + },
1361 +
1362 + keepVirtualKeyboard(event) {
1363 + const input = document.getElementById('noVNC_keyboardinput');
1364 +
1365 + // Only prevent focus change if the virtual keyboard is active
1366 + if (document.activeElement != input) {
1367 + return;
1368 + }
1369 +
1370 + // Only allow focus to move to other elements that need
1371 + // focus to function properly
1372 + if (event.target.form !== undefined) {
1373 + switch (event.target.type) {
1374 + case 'text':
1375 + case 'email':
1376 + case 'search':
1377 + case 'password':
1378 + case 'tel':
1379 + case 'url':
1380 + case 'textarea':
1381 + case 'select-one':
1382 + case 'select-multiple':
1383 + return;
1384 + }
1385 + }
1386 +
1387 + event.preventDefault();
1388 + },
1389 +
1390 + keyboardinputReset() {
1391 + const kbi = document.getElementById('noVNC_keyboardinput');
1392 + kbi.value = new Array(UI.defaultKeyboardinputLen).join("_");
1393 + UI.lastKeyboardinput = kbi.value;
1394 + },
1395 +
1396 + keyEvent(keysym, code, down) {
1397 + if (!UI.rfb) return;
1398 +
1399 + UI.rfb.sendKey(keysym, code, down);
1400 + },
1401 +
1402 + // When normal keyboard events are left uncought, use the input events from
1403 + // the keyboardinput element instead and generate the corresponding key events.
1404 + // This code is required since some browsers on Android are inconsistent in
1405 + // sending keyCodes in the normal keyboard events when using on screen keyboards.
1406 + keyInput(event) {
1407 +
1408 + if (!UI.rfb) return;
1409 +
1410 + const newValue = event.target.value;
1411 +
1412 + if (!UI.lastKeyboardinput) {
1413 + UI.keyboardinputReset();
1414 + }
1415 + const oldValue = UI.lastKeyboardinput;
1416 +
1417 + let newLen;
1418 + try {
1419 + // Try to check caret position since whitespace at the end
1420 + // will not be considered by value.length in some browsers
1421 + newLen = Math.max(event.target.selectionStart, newValue.length);
1422 + } catch (err) {
1423 + // selectionStart is undefined in Google Chrome
1424 + newLen = newValue.length;
1425 + }
1426 + const oldLen = oldValue.length;
1427 +
1428 + let inputs = newLen - oldLen;
1429 + let backspaces = inputs < 0 ? -inputs : 0;
1430 +
1431 + // Compare the old string with the new to account for
1432 + // text-corrections or other input that modify existing text
1433 + for (let i = 0; i < Math.min(oldLen, newLen); i++) {
1434 + if (newValue.charAt(i) != oldValue.charAt(i)) {
1435 + inputs = newLen - i;
1436 + backspaces = oldLen - i;
1437 + break;
1438 + }
1439 + }
1440 +
1441 + // Send the key events
1442 + for (let i = 0; i < backspaces; i++) {
1443 + UI.rfb.sendKey(KeyTable.XK_BackSpace, "Backspace");
1444 + }
1445 + for (let i = newLen - inputs; i < newLen; i++) {
1446 + UI.rfb.sendKey(keysyms.lookup(newValue.charCodeAt(i)));
1447 + }
1448 +
1449 + // Control the text content length in the keyboardinput element
1450 + if (newLen > 2 * UI.defaultKeyboardinputLen) {
1451 + UI.keyboardinputReset();
1452 + } else if (newLen < 1) {
1453 + // There always have to be some text in the keyboardinput
1454 + // element with which backspace can interact.
1455 + UI.keyboardinputReset();
1456 + // This sometimes causes the keyboard to disappear for a second
1457 + // but it is required for the android keyboard to recognize that
1458 + // text has been added to the field
1459 + event.target.blur();
1460 + // This has to be ran outside of the input handler in order to work
1461 + setTimeout(event.target.focus.bind(event.target), 0);
1462 + } else {
1463 + UI.lastKeyboardinput = newValue;
1464 + }
1465 + },
1466 +
1467 +/* ------^-------
1468 + * /KEYBOARD
1469 + * ==============
1470 + * EXTRA KEYS
1471 + * ------v------*/
1472 +
1473 + openExtraKeys() {
1474 + UI.closeAllPanels();
1475 + UI.openControlbar();
1476 +
1477 + document.getElementById('noVNC_modifiers')
1478 + .classList.add("noVNC_open");
1479 + document.getElementById('noVNC_toggle_extra_keys_button')
1480 + .classList.add("noVNC_selected");
1481 + },
1482 +
1483 + closeExtraKeys() {
1484 + document.getElementById('noVNC_modifiers')
1485 + .classList.remove("noVNC_open");
1486 + document.getElementById('noVNC_toggle_extra_keys_button')
1487 + .classList.remove("noVNC_selected");
1488 + },
1489 +
1490 + toggleExtraKeys() {
1491 + if (document.getElementById('noVNC_modifiers')
1492 + .classList.contains("noVNC_open")) {
1493 + UI.closeExtraKeys();
1494 + } else {
1495 + UI.openExtraKeys();
1496 + }
1497 + },
1498 +
1499 + sendEsc() {
1500 + UI.rfb.sendKey(KeyTable.XK_Escape, "Escape");
1501 + },
1502 +
1503 + sendTab() {
1504 + UI.rfb.sendKey(KeyTable.XK_Tab);
1505 + },
1506 +
1507 + toggleCtrl() {
1508 + const btn = document.getElementById('noVNC_toggle_ctrl_button');
1509 + if (btn.classList.contains("noVNC_selected")) {
1510 + UI.rfb.sendKey(KeyTable.XK_Control_L, "ControlLeft", false);
1511 + btn.classList.remove("noVNC_selected");
1512 + } else {
1513 + UI.rfb.sendKey(KeyTable.XK_Control_L, "ControlLeft", true);
1514 + btn.classList.add("noVNC_selected");
1515 + }
1516 + },
1517 +
1518 + toggleWindows() {
1519 + const btn = document.getElementById('noVNC_toggle_windows_button');
1520 + if (btn.classList.contains("noVNC_selected")) {
1521 + UI.rfb.sendKey(KeyTable.XK_Super_L, "MetaLeft", false);
1522 + btn.classList.remove("noVNC_selected");
1523 + } else {
1524 + UI.rfb.sendKey(KeyTable.XK_Super_L, "MetaLeft", true);
1525 + btn.classList.add("noVNC_selected");
1526 + }
1527 + },
1528 +
1529 + toggleAlt() {
1530 + const btn = document.getElementById('noVNC_toggle_alt_button');
1531 + if (btn.classList.contains("noVNC_selected")) {
1532 + UI.rfb.sendKey(KeyTable.XK_Alt_L, "AltLeft", false);
1533 + btn.classList.remove("noVNC_selected");
1534 + } else {
1535 + UI.rfb.sendKey(KeyTable.XK_Alt_L, "AltLeft", true);
1536 + btn.classList.add("noVNC_selected");
1537 + }
1538 + },
1539 +
1540 + sendCtrlAltDel() {
1541 + UI.rfb.sendCtrlAltDel();
1542 + },
1543 +
1544 +/* ------^-------
1545 + * /EXTRA KEYS
1546 + * ==============
1547 + * MISC
1548 + * ------v------*/
1549 +
1550 + setMouseButton(num) {
1551 + const view_only = UI.rfb.viewOnly;
1552 + if (UI.rfb && !view_only) {
1553 + UI.rfb.touchButton = num;
1554 + }
1555 +
1556 + const blist = [0, 1, 2, 4];
1557 + for (let b = 0; b < blist.length; b++) {
1558 + const button = document.getElementById('noVNC_mouse_button' +
1559 + blist[b]);
1560 + if (blist[b] === num && !view_only) {
1561 + button.classList.remove("noVNC_hidden");
1562 + } else {
1563 + button.classList.add("noVNC_hidden");
1564 + }
1565 + }
1566 + },
1567 +
1568 + updateViewOnly() {
1569 + if (!UI.rfb) return;
1570 + UI.rfb.viewOnly = UI.getSetting('view_only');
1571 +
1572 + // Hide input related buttons in view only mode
1573 + if (UI.rfb.viewOnly) {
1574 + document.getElementById('noVNC_keyboard_button')
1575 + .classList.add('noVNC_hidden');
1576 + document.getElementById('noVNC_toggle_extra_keys_button')
1577 + .classList.add('noVNC_hidden');
1578 + document.getElementById('noVNC_mouse_button' + UI.rfb.touchButton)
1579 + .classList.add('noVNC_hidden');
1580 + } else {
1581 + document.getElementById('noVNC_keyboard_button')
1582 + .classList.remove('noVNC_hidden');
1583 + document.getElementById('noVNC_toggle_extra_keys_button')
1584 + .classList.remove('noVNC_hidden');
1585 + document.getElementById('noVNC_mouse_button' + UI.rfb.touchButton)
1586 + .classList.remove('noVNC_hidden');
1587 + }
1588 + },
1589 +
1590 + updateShowDotCursor() {
1591 + if (!UI.rfb) return;
1592 + UI.rfb.showDotCursor = UI.getSetting('show_dot');
1593 + },
1594 +
1595 + updateLogging() {
1596 + WebUtil.init_logging(UI.getSetting('logging'));
1597 + },
1598 +
1599 + updateDesktopName(e) {
1600 + //UI.desktopName = e.detail.name;
1601 + // Display the desktop name in the document title
1602 + //document.title = e.detail.name + " - noVNC";
1603 + },
1604 +
1605 + bell(e) {
1606 + if (WebUtil.getConfigVar('bell', 'on') === 'on') {
1607 + const promise = document.getElementById('noVNC_bell').play();
1608 + // The standards disagree on the return value here
1609 + if (promise) {
1610 + promise.catch((e) => {
1611 + if (e.name === "NotAllowedError") {
1612 + // Ignore when the browser doesn't let us play audio.
1613 + // It is common that the browsers require audio to be
1614 + // initiated from a user action.
1615 + } else {
1616 + Log.Error("Unable to play bell: " + e);
1617 + }
1618 + });
1619 + }
1620 + }
1621 + },
1622 +
1623 + //Helper to add options to dropdown.
1624 + addOption(selectbox, text, value) {
1625 + const optn = document.createElement("OPTION");
1626 + optn.text = text;
1627 + optn.value = value;
1628 + selectbox.options.add(optn);
1629 + },
1630 +
1631 +/* ------^-------
1632 + * /MISC
1633 + * ==============
1634 + */
1635 +};
1636 +
1637 +// Set up translations
1638 +const LINGUAS = ["cs", "de", "el", "es", "ko", "nl", "pl", "ru", "sv", "tr", "zh_CN", "zh_TW"];
1639 +l10n.setup(LINGUAS);
1640 +if (l10n.language === "en" || l10n.dictionary !== undefined) {
1641 + UI.prime();
1642 +} else {
1643 + WebUtil.fetchJSON('app/locale/' + l10n.language + '.json')
1644 + .then((translations) => { l10n.dictionary = translations; })
1645 + .catch(err => Log.Error("Failed to load translations: " + err))
1646 + .then(UI.prime);
1647 +}
1648 +
1649 +export default UI;
public/novnc/app/webutil.js new
+239
@@ -0,0 +1,239 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +import { init_logging as main_init_logging } from '../core/util/logging.js';
10 +
11 +// init log level reading the logging HTTP param
12 +export function init_logging(level) {
13 + "use strict";
14 + if (typeof level !== "undefined") {
15 + main_init_logging(level);
16 + } else {
17 + const param = document.location.href.match(/logging=([A-Za-z0-9._-]*)/);
18 + main_init_logging(param || undefined);
19 + }
20 +}
21 +
22 +// Read a query string variable
23 +export function getQueryVar(name, defVal) {
24 + "use strict";
25 + const re = new RegExp('.*[?&]' + name + '=([^&#]*)'),
26 + match = document.location.href.match(re);
27 + if (typeof defVal === 'undefined') { defVal = null; }
28 +
29 + if (match) {
30 + return decodeURIComponent(match[1]);
31 + }
32 +
33 + return defVal;
34 +}
35 +
36 +// Read a hash fragment variable
37 +export function getHashVar(name, defVal) {
38 + "use strict";
39 + const re = new RegExp('.*[&#]' + name + '=([^&]*)'),
40 + match = document.location.hash.match(re);
41 + if (typeof defVal === 'undefined') { defVal = null; }
42 +
43 + if (match) {
44 + return decodeURIComponent(match[1]);
45 + }
46 +
47 + return defVal;
48 +}
49 +
50 +// Read a variable from the fragment or the query string
51 +// Fragment takes precedence
52 +export function getConfigVar(name, defVal) {
53 + "use strict";
54 + const val = getHashVar(name);
55 +
56 + if (val === null) {
57 + return getQueryVar(name, defVal);
58 + }
59 +
60 + return val;
61 +}
62 +
63 +/*
64 + * Cookie handling. Dervied from: http://www.quirksmode.org/js/cookies.html
65 + */
66 +
67 +// No days means only for this browser session
68 +export function createCookie(name, value, days) {
69 + "use strict";
70 + let date, expires;
71 + if (days) {
72 + date = new Date();
73 + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
74 + expires = "; expires=" + date.toGMTString();
75 + } else {
76 + expires = "";
77 + }
78 +
79 + let secure;
80 + if (document.location.protocol === "https:") {
81 + secure = "; secure";
82 + } else {
83 + secure = "";
84 + }
85 + document.cookie = name + "=" + value + expires + "; path=/" + secure;
86 +}
87 +
88 +export function readCookie(name, defaultValue) {
89 + "use strict";
90 + const nameEQ = name + "=";
91 + const ca = document.cookie.split(';');
92 +
93 + for (let i = 0; i < ca.length; i += 1) {
94 + let c = ca[i];
95 + while (c.charAt(0) === ' ') {
96 + c = c.substring(1, c.length);
97 + }
98 + if (c.indexOf(nameEQ) === 0) {
99 + return c.substring(nameEQ.length, c.length);
100 + }
101 + }
102 +
103 + return (typeof defaultValue !== 'undefined') ? defaultValue : null;
104 +}
105 +
106 +export function eraseCookie(name) {
107 + "use strict";
108 + createCookie(name, "", -1);
109 +}
110 +
111 +/*
112 + * Setting handling.
113 + */
114 +
115 +let settings = {};
116 +
117 +export function initSettings() {
118 + if (!window.chrome || !window.chrome.storage) {
119 + settings = {};
120 + return Promise.resolve();
121 + }
122 +
123 + return new Promise(resolve => window.chrome.storage.sync.get(resolve))
124 + .then((cfg) => { settings = cfg; });
125 +}
126 +
127 +// Update the settings cache, but do not write to permanent storage
128 +export function setSetting(name, value) {
129 + settings[name] = value;
130 +}
131 +
132 +// No days means only for this browser session
133 +export function writeSetting(name, value) {
134 + "use strict";
135 + if (settings[name] === value) return;
136 + settings[name] = value;
137 + if (window.chrome && window.chrome.storage) {
138 + window.chrome.storage.sync.set(settings);
139 + } else {
140 + localStorage.setItem(name, value);
141 + }
142 +}
143 +
144 +export function readSetting(name, defaultValue) {
145 + "use strict";
146 + let value;
147 + if ((name in settings) || (window.chrome && window.chrome.storage)) {
148 + value = settings[name];
149 + } else {
150 + value = localStorage.getItem(name);
151 + settings[name] = value;
152 + }
153 + if (typeof value === "undefined") {
154 + value = null;
155 + }
156 +
157 + if (value === null && typeof defaultValue !== "undefined") {
158 + return defaultValue;
159 + }
160 +
161 + return value;
162 +}
163 +
164 +export function eraseSetting(name) {
165 + "use strict";
166 + // Deleting here means that next time the setting is read when using local
167 + // storage, it will be pulled from local storage again.
168 + // If the setting in local storage is changed (e.g. in another tab)
169 + // between this delete and the next read, it could lead to an unexpected
170 + // value change.
171 + delete settings[name];
172 + if (window.chrome && window.chrome.storage) {
173 + window.chrome.storage.sync.remove(name);
174 + } else {
175 + localStorage.removeItem(name);
176 + }
177 +}
178 +
179 +export function injectParamIfMissing(path, param, value) {
180 + // force pretend that we're dealing with a relative path
181 + // (assume that we wanted an extra if we pass one in)
182 + path = "/" + path;
183 +
184 + const elem = document.createElement('a');
185 + elem.href = path;
186 +
187 + const param_eq = encodeURIComponent(param) + "=";
188 + let query;
189 + if (elem.search) {
190 + query = elem.search.slice(1).split('&');
191 + } else {
192 + query = [];
193 + }
194 +
195 + if (!query.some(v => v.startsWith(param_eq))) {
196 + query.push(param_eq + encodeURIComponent(value));
197 + elem.search = "?" + query.join("&");
198 + }
199 +
200 + // some browsers (e.g. IE11) may occasionally omit the leading slash
201 + // in the elem.pathname string. Handle that case gracefully.
202 + if (elem.pathname.charAt(0) == "/") {
203 + return elem.pathname.slice(1) + elem.search + elem.hash;
204 + }
205 +
206 + return elem.pathname + elem.search + elem.hash;
207 +}
208 +
209 +// sadly, we can't use the Fetch API until we decide to drop
210 +// IE11 support or polyfill promises and fetch in IE11.
211 +// resolve will receive an object on success, while reject
212 +// will receive either an event or an error on failure.
213 +export function fetchJSON(path) {
214 + return new Promise((resolve, reject) => {
215 + // NB: IE11 doesn't support JSON as a responseType
216 + const req = new XMLHttpRequest();
217 + req.open('GET', path);
218 +
219 + req.onload = () => {
220 + if (req.status === 200) {
221 + let resObj;
222 + try {
223 + resObj = JSON.parse(req.responseText);
224 + } catch (err) {
225 + reject(err);
226 + }
227 + resolve(resObj);
228 + } else {
229 + reject(new Error("XHR got non-200 status while trying to load '" + path + "': " + req.status));
230 + }
231 + };
232 +
233 + req.onerror = evt => reject(new Error("XHR encountered an error while trying to load '" + path + "': " + evt.message));
234 +
235 + req.ontimeout = evt => reject(new Error("XHR timed out while trying to load '" + path + "'"));
236 +
237 + req.send();
238 + });
239 +}
public/novnc/core/base64.js new
+104
@@ -0,0 +1,104 @@
1 +/* This Source Code Form is subject to the terms of the Mozilla Public
2 + * License, v. 2.0. If a copy of the MPL was not distributed with this
3 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 +
5 +// From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js
6 +
7 +import * as Log from './util/logging.js';
8 +
9 +export default {
10 + /* Convert data (an array of integers) to a Base64 string. */
11 + toBase64Table: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''),
12 + base64Pad: '=',
13 +
14 + encode(data) {
15 + "use strict";
16 + let result = '';
17 + const length = data.length;
18 + const lengthpad = (length % 3);
19 + // Convert every three bytes to 4 ascii characters.
20 +
21 + for (let i = 0; i < (length - 2); i += 3) {
22 + result += this.toBase64Table[data[i] >> 2];
23 + result += this.toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)];
24 + result += this.toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)];
25 + result += this.toBase64Table[data[i + 2] & 0x3f];
26 + }
27 +
28 + // Convert the remaining 1 or 2 bytes, pad out to 4 characters.
29 + const j = length - lengthpad;
30 + if (lengthpad === 2) {
31 + result += this.toBase64Table[data[j] >> 2];
32 + result += this.toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)];
33 + result += this.toBase64Table[(data[j + 1] & 0x0f) << 2];
34 + result += this.toBase64Table[64];
35 + } else if (lengthpad === 1) {
36 + result += this.toBase64Table[data[j] >> 2];
37 + result += this.toBase64Table[(data[j] & 0x03) << 4];
38 + result += this.toBase64Table[64];
39 + result += this.toBase64Table[64];
40 + }
41 +
42 + return result;
43 + },
44 +
45 + /* Convert Base64 data to a string */
46 + /* eslint-disable comma-spacing */
47 + toBinaryTable: [
48 + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
49 + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
50 + -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
51 + 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
52 + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
53 + 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
54 + -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
55 + 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
56 + ],
57 + /* eslint-enable comma-spacing */
58 +
59 + decode(data, offset = 0) {
60 + let data_length = data.indexOf('=') - offset;
61 + if (data_length < 0) { data_length = data.length - offset; }
62 +
63 + /* Every four characters is 3 resulting numbers */
64 + const result_length = (data_length >> 2) * 3 + Math.floor((data_length % 4) / 1.5);
65 + const result = new Array(result_length);
66 +
67 + // Convert one by one.
68 +
69 + let leftbits = 0; // number of bits decoded, but yet to be appended
70 + let leftdata = 0; // bits decoded, but yet to be appended
71 + for (let idx = 0, i = offset; i < data.length; i++) {
72 + const c = this.toBinaryTable[data.charCodeAt(i) & 0x7f];
73 + const padding = (data.charAt(i) === this.base64Pad);
74 + // Skip illegal characters and whitespace
75 + if (c === -1) {
76 + Log.Error("Illegal character code " + data.charCodeAt(i) + " at position " + i);
77 + continue;
78 + }
79 +
80 + // Collect data into leftdata, update bitcount
81 + leftdata = (leftdata << 6) | c;
82 + leftbits += 6;
83 +
84 + // If we have 8 or more bits, append 8 bits to the result
85 + if (leftbits >= 8) {
86 + leftbits -= 8;
87 + // Append if not padding.
88 + if (!padding) {
89 + result[idx++] = (leftdata >> leftbits) & 0xff;
90 + }
91 + leftdata &= (1 << leftbits) - 1;
92 + }
93 + }
94 +
95 + // If there are any bits left, the base64 string was corrupted
96 + if (leftbits) {
97 + const err = new Error('Corrupted base64 string');
98 + err.name = 'Base64-Error';
99 + throw err;
100 + }
101 +
102 + return result;
103 + }
104 +}; /* End of Base64 namespace */
public/novnc/core/decoders/copyrect.js new
+24
@@ -0,0 +1,24 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
5 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
6 + * Licensed under MPL 2.0 (see LICENSE.txt)
7 + *
8 + * See README.md for usage and integration instructions.
9 + *
10 + */
11 +
12 +export default class CopyRectDecoder {
13 + decodeRect(x, y, width, height, sock, display, depth) {
14 + if (sock.rQwait("COPYRECT", 4)) {
15 + return false;
16 + }
17 +
18 + let deltaX = sock.rQshift16();
19 + let deltaY = sock.rQshift16();
20 + display.copyImage(deltaX, deltaY, x, y, width, height);
21 +
22 + return true;
23 + }
24 +}
public/novnc/core/decoders/hextile.js new
+139
@@ -0,0 +1,139 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
5 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
6 + * Licensed under MPL 2.0 (see LICENSE.txt)
7 + *
8 + * See README.md for usage and integration instructions.
9 + *
10 + */
11 +
12 +import * as Log from '../util/logging.js';
13 +
14 +export default class HextileDecoder {
15 + constructor() {
16 + this._tiles = 0;
17 + this._lastsubencoding = 0;
18 + }
19 +
20 + decodeRect(x, y, width, height, sock, display, depth) {
21 + if (this._tiles === 0) {
22 + this._tiles_x = Math.ceil(width / 16);
23 + this._tiles_y = Math.ceil(height / 16);
24 + this._total_tiles = this._tiles_x * this._tiles_y;
25 + this._tiles = this._total_tiles;
26 + }
27 +
28 + while (this._tiles > 0) {
29 + let bytes = 1;
30 +
31 + if (sock.rQwait("HEXTILE", bytes)) {
32 + return false;
33 + }
34 +
35 + let rQ = sock.rQ;
36 + let rQi = sock.rQi;
37 +
38 + let subencoding = rQ[rQi]; // Peek
39 + if (subencoding > 30) { // Raw
40 + throw new Error("Illegal hextile subencoding (subencoding: " +
41 + subencoding + ")");
42 + }
43 +
44 + const curr_tile = this._total_tiles - this._tiles;
45 + const tile_x = curr_tile % this._tiles_x;
46 + const tile_y = Math.floor(curr_tile / this._tiles_x);
47 + const tx = x + tile_x * 16;
48 + const ty = y + tile_y * 16;
49 + const tw = Math.min(16, (x + width) - tx);
50 + const th = Math.min(16, (y + height) - ty);
51 +
52 + // Figure out how much we are expecting
53 + if (subencoding & 0x01) { // Raw
54 + bytes += tw * th * 4;
55 + } else {
56 + if (subencoding & 0x02) { // Background
57 + bytes += 4;
58 + }
59 + if (subencoding & 0x04) { // Foreground
60 + bytes += 4;
61 + }
62 + if (subencoding & 0x08) { // AnySubrects
63 + bytes++; // Since we aren't shifting it off
64 +
65 + if (sock.rQwait("HEXTILE", bytes)) {
66 + return false;
67 + }
68 +
69 + let subrects = rQ[rQi + bytes - 1]; // Peek
70 + if (subencoding & 0x10) { // SubrectsColoured
71 + bytes += subrects * (4 + 2);
72 + } else {
73 + bytes += subrects * 2;
74 + }
75 + }
76 + }
77 +
78 + if (sock.rQwait("HEXTILE", bytes)) {
79 + return false;
80 + }
81 +
82 + // We know the encoding and have a whole tile
83 + rQi++;
84 + if (subencoding === 0) {
85 + if (this._lastsubencoding & 0x01) {
86 + // Weird: ignore blanks are RAW
87 + Log.Debug(" Ignoring blank after RAW");
88 + } else {
89 + display.fillRect(tx, ty, tw, th, this._background);
90 + }
91 + } else if (subencoding & 0x01) { // Raw
92 + display.blitImage(tx, ty, tw, th, rQ, rQi);
93 + rQi += bytes - 1;
94 + } else {
95 + if (subencoding & 0x02) { // Background
96 + this._background = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];
97 + rQi += 4;
98 + }
99 + if (subencoding & 0x04) { // Foreground
100 + this._foreground = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];
101 + rQi += 4;
102 + }
103 +
104 + display.startTile(tx, ty, tw, th, this._background);
105 + if (subencoding & 0x08) { // AnySubrects
106 + let subrects = rQ[rQi];
107 + rQi++;
108 +
109 + for (let s = 0; s < subrects; s++) {
110 + let color;
111 + if (subencoding & 0x10) { // SubrectsColoured
112 + color = [rQ[rQi], rQ[rQi + 1], rQ[rQi + 2], rQ[rQi + 3]];
113 + rQi += 4;
114 + } else {
115 + color = this._foreground;
116 + }
117 + const xy = rQ[rQi];
118 + rQi++;
119 + const sx = (xy >> 4);
120 + const sy = (xy & 0x0f);
121 +
122 + const wh = rQ[rQi];
123 + rQi++;
124 + const sw = (wh >> 4) + 1;
125 + const sh = (wh & 0x0f) + 1;
126 +
127 + display.subTile(sx, sy, sw, sh, color);
128 + }
129 + }
130 + display.finishTile();
131 + }
132 + sock.rQi = rQi;
133 + this._lastsubencoding = subencoding;
134 + this._tiles--;
135 + }
136 +
137 + return true;
138 + }
139 +}
public/novnc/core/decoders/raw.js new
+58
@@ -0,0 +1,58 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
5 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
6 + * Licensed under MPL 2.0 (see LICENSE.txt)
7 + *
8 + * See README.md for usage and integration instructions.
9 + *
10 + */
11 +
12 +export default class RawDecoder {
13 + constructor() {
14 + this._lines = 0;
15 + }
16 +
17 + decodeRect(x, y, width, height, sock, display, depth) {
18 + if (this._lines === 0) {
19 + this._lines = height;
20 + }
21 +
22 + const pixelSize = depth == 8 ? 1 : 4;
23 + const bytesPerLine = width * pixelSize;
24 +
25 + if (sock.rQwait("RAW", bytesPerLine)) {
26 + return false;
27 + }
28 +
29 + const cur_y = y + (height - this._lines);
30 + const curr_height = Math.min(this._lines,
31 + Math.floor(sock.rQlen / bytesPerLine));
32 + let data = sock.rQ;
33 + let index = sock.rQi;
34 +
35 + // Convert data if needed
36 + if (depth == 8) {
37 + const pixels = width * curr_height;
38 + const newdata = new Uint8Array(pixels * 4);
39 + for (let i = 0; i < pixels; i++) {
40 + newdata[i * 4 + 0] = ((data[index + i] >> 0) & 0x3) * 255 / 3;
41 + newdata[i * 4 + 1] = ((data[index + i] >> 2) & 0x3) * 255 / 3;
42 + newdata[i * 4 + 2] = ((data[index + i] >> 4) & 0x3) * 255 / 3;
43 + newdata[i * 4 + 4] = 0;
44 + }
45 + data = newdata;
46 + index = 0;
47 + }
48 +
49 + display.blitImage(x, cur_y, width, curr_height, data, index);
50 + sock.rQskipBytes(curr_height * bytesPerLine);
51 + this._lines -= curr_height;
52 + if (this._lines > 0) {
53 + return false;
54 + }
55 +
56 + return true;
57 + }
58 +}
public/novnc/core/decoders/rre.js new
+46
@@ -0,0 +1,46 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
5 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
6 + * Licensed under MPL 2.0 (see LICENSE.txt)
7 + *
8 + * See README.md for usage and integration instructions.
9 + *
10 + */
11 +
12 +export default class RREDecoder {
13 + constructor() {
14 + this._subrects = 0;
15 + }
16 +
17 + decodeRect(x, y, width, height, sock, display, depth) {
18 + if (this._subrects === 0) {
19 + if (sock.rQwait("RRE", 4 + 4)) {
20 + return false;
21 + }
22 +
23 + this._subrects = sock.rQshift32();
24 +
25 + let color = sock.rQshiftBytes(4); // Background
26 + display.fillRect(x, y, width, height, color);
27 + }
28 +
29 + while (this._subrects > 0) {
30 + if (sock.rQwait("RRE", 4 + 8)) {
31 + return false;
32 + }
33 +
34 + let color = sock.rQshiftBytes(4);
35 + let sx = sock.rQshift16();
36 + let sy = sock.rQshift16();
37 + let swidth = sock.rQshift16();
38 + let sheight = sock.rQshift16();
39 + display.fillRect(x + sx, y + sy, swidth, sheight, color);
40 +
41 + this._subrects--;
42 + }
43 +
44 + return true;
45 + }
46 +}
public/novnc/core/decoders/tight.js new
+319
@@ -0,0 +1,319 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * (c) 2012 Michael Tinglof, Joe Balaz, Les Piech (Mercuri.ca)
5 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
6 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
7 + * Licensed under MPL 2.0 (see LICENSE.txt)
8 + *
9 + * See README.md for usage and integration instructions.
10 + *
11 + */
12 +
13 +import * as Log from '../util/logging.js';
14 +import Inflator from "../inflator.js";
15 +
16 +export default class TightDecoder {
17 + constructor() {
18 + this._ctl = null;
19 + this._filter = null;
20 + this._numColors = 0;
21 + this._palette = new Uint8Array(1024); // 256 * 4 (max palette size * max bytes-per-pixel)
22 + this._len = 0;
23 +
24 + this._zlibs = [];
25 + for (let i = 0; i < 4; i++) {
26 + this._zlibs[i] = new Inflator();
27 + }
28 + }
29 +
30 + decodeRect(x, y, width, height, sock, display, depth) {
31 + if (this._ctl === null) {
32 + if (sock.rQwait("TIGHT compression-control", 1)) {
33 + return false;
34 + }
35 +
36 + this._ctl = sock.rQshift8();
37 +
38 + // Reset streams if the server requests it
39 + for (let i = 0; i < 4; i++) {
40 + if ((this._ctl >> i) & 1) {
41 + this._zlibs[i].reset();
42 + Log.Info("Reset zlib stream " + i);
43 + }
44 + }
45 +
46 + // Figure out filter
47 + this._ctl = this._ctl >> 4;
48 + }
49 +
50 + let ret;
51 +
52 + if (this._ctl === 0x08) {
53 + ret = this._fillRect(x, y, width, height,
54 + sock, display, depth);
55 + } else if (this._ctl === 0x09) {
56 + ret = this._jpegRect(x, y, width, height,
57 + sock, display, depth);
58 + } else if (this._ctl === 0x0A) {
59 + ret = this._pngRect(x, y, width, height,
60 + sock, display, depth);
61 + } else if ((this._ctl & 0x80) == 0) {
62 + ret = this._basicRect(this._ctl, x, y, width, height,
63 + sock, display, depth);
64 + } else {
65 + throw new Error("Illegal tight compression received (ctl: " +
66 + this._ctl + ")");
67 + }
68 +
69 + if (ret) {
70 + this._ctl = null;
71 + }
72 +
73 + return ret;
74 + }
75 +
76 + _fillRect(x, y, width, height, sock, display, depth) {
77 + if (sock.rQwait("TIGHT", 3)) {
78 + return false;
79 + }
80 +
81 + const rQi = sock.rQi;
82 + const rQ = sock.rQ;
83 +
84 + display.fillRect(x, y, width, height,
85 + [rQ[rQi + 2], rQ[rQi + 1], rQ[rQi]], false);
86 + sock.rQskipBytes(3);
87 +
88 + return true;
89 + }
90 +
91 + _jpegRect(x, y, width, height, sock, display, depth) {
92 + let data = this._readData(sock);
93 + if (data === null) {
94 + return false;
95 + }
96 +
97 + display.imageRect(x, y, "image/jpeg", data);
98 +
99 + return true;
100 + }
101 +
102 + _pngRect(x, y, width, height, sock, display, depth) {
103 + throw new Error("PNG received in standard Tight rect");
104 + }
105 +
106 + _basicRect(ctl, x, y, width, height, sock, display, depth) {
107 + if (this._filter === null) {
108 + if (ctl & 0x4) {
109 + if (sock.rQwait("TIGHT", 1)) {
110 + return false;
111 + }
112 +
113 + this._filter = sock.rQshift8();
114 + } else {
115 + // Implicit CopyFilter
116 + this._filter = 0;
117 + }
118 + }
119 +
120 + let streamId = ctl & 0x3;
121 +
122 + let ret;
123 +
124 + switch (this._filter) {
125 + case 0: // CopyFilter
126 + ret = this._copyFilter(streamId, x, y, width, height,
127 + sock, display, depth);
128 + break;
129 + case 1: // PaletteFilter
130 + ret = this._paletteFilter(streamId, x, y, width, height,
131 + sock, display, depth);
132 + break;
133 + case 2: // GradientFilter
134 + ret = this._gradientFilter(streamId, x, y, width, height,
135 + sock, display, depth);
136 + break;
137 + default:
138 + throw new Error("Illegal tight filter received (ctl: " +
139 + this._filter + ")");
140 + }
141 +
142 + if (ret) {
143 + this._filter = null;
144 + }
145 +
146 + return ret;
147 + }
148 +
149 + _copyFilter(streamId, x, y, width, height, sock, display, depth) {
150 + const uncompressedSize = width * height * 3;
151 + let data;
152 +
153 + if (uncompressedSize < 12) {
154 + if (sock.rQwait("TIGHT", uncompressedSize)) {
155 + return false;
156 + }
157 +
158 + data = sock.rQshiftBytes(uncompressedSize);
159 + } else {
160 + data = this._readData(sock);
161 + if (data === null) {
162 + return false;
163 + }
164 +
165 + data = this._zlibs[streamId].inflate(data, true, uncompressedSize);
166 + if (data.length != uncompressedSize) {
167 + throw new Error("Incomplete zlib block");
168 + }
169 + }
170 +
171 + display.blitRgbImage(x, y, width, height, data, 0, false);
172 +
173 + return true;
174 + }
175 +
176 + _paletteFilter(streamId, x, y, width, height, sock, display, depth) {
177 + if (this._numColors === 0) {
178 + if (sock.rQwait("TIGHT palette", 1)) {
179 + return false;
180 + }
181 +
182 + const numColors = sock.rQpeek8() + 1;
183 + const paletteSize = numColors * 3;
184 +
185 + if (sock.rQwait("TIGHT palette", 1 + paletteSize)) {
186 + return false;
187 + }
188 +
189 + this._numColors = numColors;
190 + sock.rQskipBytes(1);
191 +
192 + sock.rQshiftTo(this._palette, paletteSize);
193 + }
194 +
195 + const bpp = (this._numColors <= 2) ? 1 : 8;
196 + const rowSize = Math.floor((width * bpp + 7) / 8);
197 + const uncompressedSize = rowSize * height;
198 +
199 + let data;
200 +
201 + if (uncompressedSize < 12) {
202 + if (sock.rQwait("TIGHT", uncompressedSize)) {
203 + return false;
204 + }
205 +
206 + data = sock.rQshiftBytes(uncompressedSize);
207 + } else {
208 + data = this._readData(sock);
209 + if (data === null) {
210 + return false;
211 + }
212 +
213 + data = this._zlibs[streamId].inflate(data, true, uncompressedSize);
214 + if (data.length != uncompressedSize) {
215 + throw new Error("Incomplete zlib block");
216 + }
217 + }
218 +
219 + // Convert indexed (palette based) image data to RGB
220 + if (this._numColors == 2) {
221 + this._monoRect(x, y, width, height, data, this._palette, display);
222 + } else {
223 + this._paletteRect(x, y, width, height, data, this._palette, display);
224 + }
225 +
226 + this._numColors = 0;
227 +
228 + return true;
229 + }
230 +
231 + _monoRect(x, y, width, height, data, palette, display) {
232 + // Convert indexed (palette based) image data to RGB
233 + // TODO: reduce number of calculations inside loop
234 + const dest = this._getScratchBuffer(width * height * 4);
235 + const w = Math.floor((width + 7) / 8);
236 + const w1 = Math.floor(width / 8);
237 +
238 + for (let y = 0; y < height; y++) {
239 + let dp, sp, x;
240 + for (x = 0; x < w1; x++) {
241 + for (let b = 7; b >= 0; b--) {
242 + dp = (y * width + x * 8 + 7 - b) * 4;
243 + sp = (data[y * w + x] >> b & 1) * 3;
244 + dest[dp] = palette[sp];
245 + dest[dp + 1] = palette[sp + 1];
246 + dest[dp + 2] = palette[sp + 2];
247 + dest[dp + 3] = 255;
248 + }
249 + }
250 +
251 + for (let b = 7; b >= 8 - width % 8; b--) {
252 + dp = (y * width + x * 8 + 7 - b) * 4;
253 + sp = (data[y * w + x] >> b & 1) * 3;
254 + dest[dp] = palette[sp];
255 + dest[dp + 1] = palette[sp + 1];
256 + dest[dp + 2] = palette[sp + 2];
257 + dest[dp + 3] = 255;
258 + }
259 + }
260 +
261 + display.blitRgbxImage(x, y, width, height, dest, 0, false);
262 + }
263 +
264 + _paletteRect(x, y, width, height, data, palette, display) {
265 + // Convert indexed (palette based) image data to RGB
266 + const dest = this._getScratchBuffer(width * height * 4);
267 + const total = width * height * 4;
268 + for (let i = 0, j = 0; i < total; i += 4, j++) {
269 + const sp = data[j] * 3;
270 + dest[i] = palette[sp];
271 + dest[i + 1] = palette[sp + 1];
272 + dest[i + 2] = palette[sp + 2];
273 + dest[i + 3] = 255;
274 + }
275 +
276 + display.blitRgbxImage(x, y, width, height, dest, 0, false);
277 + }
278 +
279 + _gradientFilter(streamId, x, y, width, height, sock, display, depth) {
280 + throw new Error("Gradient filter not implemented");
281 + }
282 +
283 + _readData(sock) {
284 + if (this._len === 0) {
285 + if (sock.rQwait("TIGHT", 3)) {
286 + return null;
287 + }
288 +
289 + let byte;
290 +
291 + byte = sock.rQshift8();
292 + this._len = byte & 0x7f;
293 + if (byte & 0x80) {
294 + byte = sock.rQshift8();
295 + this._len |= (byte & 0x7f) << 7;
296 + if (byte & 0x80) {
297 + byte = sock.rQshift8();
298 + this._len |= byte << 14;
299 + }
300 + }
301 + }
302 +
303 + if (sock.rQwait("TIGHT", this._len)) {
304 + return null;
305 + }
306 +
307 + let data = sock.rQshiftBytes(this._len);
308 + this._len = 0;
309 +
310 + return data;
311 + }
312 +
313 + _getScratchBuffer(size) {
314 + if (!this._scratchBuffer || (this._scratchBuffer.length < size)) {
315 + this._scratchBuffer = new Uint8Array(size);
316 + }
317 + return this._scratchBuffer;
318 + }
319 +}
public/novnc/core/decoders/tightpng.js new
+29
@@ -0,0 +1,29 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2012 Joel Martin
4 + * Copyright (C) 2018 Samuel Mannehed for Cendio AB
5 + * Copyright (C) 2018 Pierre Ossman for Cendio AB
6 + * Licensed under MPL 2.0 (see LICENSE.txt)
7 + *
8 + * See README.md for usage and integration instructions.
9 + *
10 + */
11 +
12 +import TightDecoder from './tight.js';
13 +
14 +export default class TightPNGDecoder extends TightDecoder {
15 + _pngRect(x, y, width, height, sock, display, depth) {
16 + let data = this._readData(sock);
17 + if (data === null) {
18 + return false;
19 + }
20 +
21 + display.imageRect(x, y, "image/png", data);
22 +
23 + return true;
24 + }
25 +
26 + _basicRect(ctl, x, y, width, height, sock, display, depth) {
27 + throw new Error("BasicCompression received in TightPNG rect");
28 + }
29 +}
public/novnc/core/des.js new
+266
@@ -0,0 +1,266 @@
1 +/*
2 + * Ported from Flashlight VNC ActionScript implementation:
3 + * http://www.wizhelp.com/flashlight-vnc/
4 + *
5 + * Full attribution follows:
6 + *
7 + * -------------------------------------------------------------------------
8 + *
9 + * This DES class has been extracted from package Acme.Crypto for use in VNC.
10 + * The unnecessary odd parity code has been removed.
11 + *
12 + * These changes are:
13 + * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
14 + *
15 + * This software is distributed in the hope that it will be useful,
16 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 + *
19 +
20 + * DesCipher - the DES encryption method
21 + *
22 + * The meat of this code is by Dave Zimmerman <dzimm@widget.com>, and is:
23 + *
24 + * Copyright (c) 1996 Widget Workshop, Inc. All Rights Reserved.
25 + *
26 + * Permission to use, copy, modify, and distribute this software
27 + * and its documentation for NON-COMMERCIAL or COMMERCIAL purposes and
28 + * without fee is hereby granted, provided that this copyright notice is kept
29 + * intact.
30 + *
31 + * WIDGET WORKSHOP MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY
32 + * OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
33 + * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
34 + * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. WIDGET WORKSHOP SHALL NOT BE LIABLE
35 + * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
36 + * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
37 + *
38 + * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
39 + * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
40 + * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
41 + * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
42 + * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
43 + * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
44 + * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). WIDGET WORKSHOP
45 + * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
46 + * HIGH RISK ACTIVITIES.
47 + *
48 + *
49 + * The rest is:
50 + *
51 + * Copyright (C) 1996 by Jef Poskanzer <jef@acme.com>. All rights reserved.
52 + *
53 + * Redistribution and use in source and binary forms, with or without
54 + * modification, are permitted provided that the following conditions
55 + * are met:
56 + * 1. Redistributions of source code must retain the above copyright
57 + * notice, this list of conditions and the following disclaimer.
58 + * 2. Redistributions in binary form must reproduce the above copyright
59 + * notice, this list of conditions and the following disclaimer in the
60 + * documentation and/or other materials provided with the distribution.
61 + *
62 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
63 + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
66 + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 + * SUCH DAMAGE.
73 + *
74 + * Visit the ACME Labs Java page for up-to-date versions of this and other
75 + * fine Java utilities: http://www.acme.com/java/
76 + */
77 +
78 +/* eslint-disable comma-spacing */
79 +
80 +// Tables, permutations, S-boxes, etc.
81 +const PC2 = [13,16,10,23, 0, 4, 2,27,14, 5,20, 9,22,18,11, 3,
82 + 25, 7,15, 6,26,19,12, 1,40,51,30,36,46,54,29,39,
83 + 50,44,32,47,43,48,38,55,33,52,45,41,49,35,28,31 ],
84 + totrot = [ 1, 2, 4, 6, 8,10,12,14,15,17,19,21,23,25,27,28];
85 +
86 +const z = 0x0;
87 +let a,b,c,d,e,f;
88 +a=1<<16; b=1<<24; c=a|b; d=1<<2; e=1<<10; f=d|e;
89 +const SP1 = [c|e,z|z,a|z,c|f,c|d,a|f,z|d,a|z,z|e,c|e,c|f,z|e,b|f,c|d,b|z,z|d,
90 + z|f,b|e,b|e,a|e,a|e,c|z,c|z,b|f,a|d,b|d,b|d,a|d,z|z,z|f,a|f,b|z,
91 + a|z,c|f,z|d,c|z,c|e,b|z,b|z,z|e,c|d,a|z,a|e,b|d,z|e,z|d,b|f,a|f,
92 + c|f,a|d,c|z,b|f,b|d,z|f,a|f,c|e,z|f,b|e,b|e,z|z,a|d,a|e,z|z,c|d];
93 +a=1<<20; b=1<<31; c=a|b; d=1<<5; e=1<<15; f=d|e;
94 +const SP2 = [c|f,b|e,z|e,a|f,a|z,z|d,c|d,b|f,b|d,c|f,c|e,b|z,b|e,a|z,z|d,c|d,
95 + a|e,a|d,b|f,z|z,b|z,z|e,a|f,c|z,a|d,b|d,z|z,a|e,z|f,c|e,c|z,z|f,
96 + z|z,a|f,c|d,a|z,b|f,c|z,c|e,z|e,c|z,b|e,z|d,c|f,a|f,z|d,z|e,b|z,
97 + z|f,c|e,a|z,b|d,a|d,b|f,b|d,a|d,a|e,z|z,b|e,z|f,b|z,c|d,c|f,a|e];
98 +a=1<<17; b=1<<27; c=a|b; d=1<<3; e=1<<9; f=d|e;
99 +const SP3 = [z|f,c|e,z|z,c|d,b|e,z|z,a|f,b|e,a|d,b|d,b|d,a|z,c|f,a|d,c|z,z|f,
100 + b|z,z|d,c|e,z|e,a|e,c|z,c|d,a|f,b|f,a|e,a|z,b|f,z|d,c|f,z|e,b|z,
101 + c|e,b|z,a|d,z|f,a|z,c|e,b|e,z|z,z|e,a|d,c|f,b|e,b|d,z|e,z|z,c|d,
102 + b|f,a|z,b|z,c|f,z|d,a|f,a|e,b|d,c|z,b|f,z|f,c|z,a|f,z|d,c|d,a|e];
103 +a=1<<13; b=1<<23; c=a|b; d=1<<0; e=1<<7; f=d|e;
104 +const SP4 = [c|d,a|f,a|f,z|e,c|e,b|f,b|d,a|d,z|z,c|z,c|z,c|f,z|f,z|z,b|e,b|d,
105 + z|d,a|z,b|z,c|d,z|e,b|z,a|d,a|e,b|f,z|d,a|e,b|e,a|z,c|e,c|f,z|f,
106 + b|e,b|d,c|z,c|f,z|f,z|z,z|z,c|z,a|e,b|e,b|f,z|d,c|d,a|f,a|f,z|e,
107 + c|f,z|f,z|d,a|z,b|d,a|d,c|e,b|f,a|d,a|e,b|z,c|d,z|e,b|z,a|z,c|e];
108 +a=1<<25; b=1<<30; c=a|b; d=1<<8; e=1<<19; f=d|e;
109 +const SP5 = [z|d,a|f,a|e,c|d,z|e,z|d,b|z,a|e,b|f,z|e,a|d,b|f,c|d,c|e,z|f,b|z,
110 + a|z,b|e,b|e,z|z,b|d,c|f,c|f,a|d,c|e,b|d,z|z,c|z,a|f,a|z,c|z,z|f,
111 + z|e,c|d,z|d,a|z,b|z,a|e,c|d,b|f,a|d,b|z,c|e,a|f,b|f,z|d,a|z,c|e,
112 + c|f,z|f,c|z,c|f,a|e,z|z,b|e,c|z,z|f,a|d,b|d,z|e,z|z,b|e,a|f,b|d];
113 +a=1<<22; b=1<<29; c=a|b; d=1<<4; e=1<<14; f=d|e;
114 +const SP6 = [b|d,c|z,z|e,c|f,c|z,z|d,c|f,a|z,b|e,a|f,a|z,b|d,a|d,b|e,b|z,z|f,
115 + z|z,a|d,b|f,z|e,a|e,b|f,z|d,c|d,c|d,z|z,a|f,c|e,z|f,a|e,c|e,b|z,
116 + b|e,z|d,c|d,a|e,c|f,a|z,z|f,b|d,a|z,b|e,b|z,z|f,b|d,c|f,a|e,c|z,
117 + a|f,c|e,z|z,c|d,z|d,z|e,c|z,a|f,z|e,a|d,b|f,z|z,c|e,b|z,a|d,b|f];
118 +a=1<<21; b=1<<26; c=a|b; d=1<<1; e=1<<11; f=d|e;
119 +const SP7 = [a|z,c|d,b|f,z|z,z|e,b|f,a|f,c|e,c|f,a|z,z|z,b|d,z|d,b|z,c|d,z|f,
120 + b|e,a|f,a|d,b|e,b|d,c|z,c|e,a|d,c|z,z|e,z|f,c|f,a|e,z|d,b|z,a|e,
121 + b|z,a|e,a|z,b|f,b|f,c|d,c|d,z|d,a|d,b|z,b|e,a|z,c|e,z|f,a|f,c|e,
122 + z|f,b|d,c|f,c|z,a|e,z|z,z|d,c|f,z|z,a|f,c|z,z|e,b|d,b|e,z|e,a|d];
123 +a=1<<18; b=1<<28; c=a|b; d=1<<6; e=1<<12; f=d|e;
124 +const SP8 = [b|f,z|e,a|z,c|f,b|z,b|f,z|d,b|z,a|d,c|z,c|f,a|e,c|e,a|f,z|e,z|d,
125 + c|z,b|d,b|e,z|f,a|e,a|d,c|d,c|e,z|f,z|z,z|z,c|d,b|d,b|e,a|f,a|z,
126 + a|f,a|z,c|e,z|e,z|d,c|d,z|e,a|f,b|e,z|d,b|d,c|z,c|d,b|z,a|z,b|f,
127 + z|z,c|f,a|d,b|d,c|z,b|e,b|f,z|z,c|f,a|e,a|e,z|f,z|f,a|d,b|z,c|e];
128 +
129 +/* eslint-enable comma-spacing */
130 +
131 +export default class DES {
132 + constructor(password) {
133 + this.keys = [];
134 +
135 + // Set the key.
136 + const pc1m = [], pcr = [], kn = [];
137 +
138 + for (let j = 0, l = 56; j < 56; ++j, l -= 8) {
139 + l += l < -5 ? 65 : l < -3 ? 31 : l < -1 ? 63 : l === 27 ? 35 : 0; // PC1
140 + const m = l & 0x7;
141 + pc1m[j] = ((password[l >>> 3] & (1<<m)) !== 0) ? 1: 0;
142 + }
143 +
144 + for (let i = 0; i < 16; ++i) {
145 + const m = i << 1;
146 + const n = m + 1;
147 + kn[m] = kn[n] = 0;
148 + for (let o = 28; o < 59; o += 28) {
149 + for (let j = o - 28; j < o; ++j) {
150 + const l = j + totrot[i];
151 + pcr[j] = l < o ? pc1m[l] : pc1m[l - 28];
152 + }
153 + }
154 + for (let j = 0; j < 24; ++j) {
155 + if (pcr[PC2[j]] !== 0) {
156 + kn[m] |= 1 << (23 - j);
157 + }
158 + if (pcr[PC2[j + 24]] !== 0) {
159 + kn[n] |= 1 << (23 - j);
160 + }
161 + }
162 + }
163 +
164 + // cookey
165 + for (let i = 0, rawi = 0, KnLi = 0; i < 16; ++i) {
166 + const raw0 = kn[rawi++];
167 + const raw1 = kn[rawi++];
168 + this.keys[KnLi] = (raw0 & 0x00fc0000) << 6;
169 + this.keys[KnLi] |= (raw0 & 0x00000fc0) << 10;
170 + this.keys[KnLi] |= (raw1 & 0x00fc0000) >>> 10;
171 + this.keys[KnLi] |= (raw1 & 0x00000fc0) >>> 6;
172 + ++KnLi;
173 + this.keys[KnLi] = (raw0 & 0x0003f000) << 12;
174 + this.keys[KnLi] |= (raw0 & 0x0000003f) << 16;
175 + this.keys[KnLi] |= (raw1 & 0x0003f000) >>> 4;
176 + this.keys[KnLi] |= (raw1 & 0x0000003f);
177 + ++KnLi;
178 + }
179 + }
180 +
181 + // Encrypt 8 bytes of text
182 + enc8(text) {
183 + const b = text.slice();
184 + let i = 0, l, r, x; // left, right, accumulator
185 +
186 + // Squash 8 bytes to 2 ints
187 + l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];
188 + r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];
189 +
190 + x = ((l >>> 4) ^ r) & 0x0f0f0f0f;
191 + r ^= x;
192 + l ^= (x << 4);
193 + x = ((l >>> 16) ^ r) & 0x0000ffff;
194 + r ^= x;
195 + l ^= (x << 16);
196 + x = ((r >>> 2) ^ l) & 0x33333333;
197 + l ^= x;
198 + r ^= (x << 2);
199 + x = ((r >>> 8) ^ l) & 0x00ff00ff;
200 + l ^= x;
201 + r ^= (x << 8);
202 + r = (r << 1) | ((r >>> 31) & 1);
203 + x = (l ^ r) & 0xaaaaaaaa;
204 + l ^= x;
205 + r ^= x;
206 + l = (l << 1) | ((l >>> 31) & 1);
207 +
208 + for (let i = 0, keysi = 0; i < 8; ++i) {
209 + x = (r << 28) | (r >>> 4);
210 + x ^= this.keys[keysi++];
211 + let fval = SP7[x & 0x3f];
212 + fval |= SP5[(x >>> 8) & 0x3f];
213 + fval |= SP3[(x >>> 16) & 0x3f];
214 + fval |= SP1[(x >>> 24) & 0x3f];
215 + x = r ^ this.keys[keysi++];
216 + fval |= SP8[x & 0x3f];
217 + fval |= SP6[(x >>> 8) & 0x3f];
218 + fval |= SP4[(x >>> 16) & 0x3f];
219 + fval |= SP2[(x >>> 24) & 0x3f];
220 + l ^= fval;
221 + x = (l << 28) | (l >>> 4);
222 + x ^= this.keys[keysi++];
223 + fval = SP7[x & 0x3f];
224 + fval |= SP5[(x >>> 8) & 0x3f];
225 + fval |= SP3[(x >>> 16) & 0x3f];
226 + fval |= SP1[(x >>> 24) & 0x3f];
227 + x = l ^ this.keys[keysi++];
228 + fval |= SP8[x & 0x0000003f];
229 + fval |= SP6[(x >>> 8) & 0x3f];
230 + fval |= SP4[(x >>> 16) & 0x3f];
231 + fval |= SP2[(x >>> 24) & 0x3f];
232 + r ^= fval;
233 + }
234 +
235 + r = (r << 31) | (r >>> 1);
236 + x = (l ^ r) & 0xaaaaaaaa;
237 + l ^= x;
238 + r ^= x;
239 + l = (l << 31) | (l >>> 1);
240 + x = ((l >>> 8) ^ r) & 0x00ff00ff;
241 + r ^= x;
242 + l ^= (x << 8);
243 + x = ((l >>> 2) ^ r) & 0x33333333;
244 + r ^= x;
245 + l ^= (x << 2);
246 + x = ((r >>> 16) ^ l) & 0x0000ffff;
247 + l ^= x;
248 + r ^= (x << 16);
249 + x = ((r >>> 4) ^ l) & 0x0f0f0f0f;
250 + l ^= x;
251 + r ^= (x << 4);
252 +
253 + // Spread ints to bytes
254 + x = [r, l];
255 + for (i = 0; i < 8; i++) {
256 + b[i] = (x[i>>>2] >>> (8 * (3 - (i % 4)))) % 256;
257 + if (b[i] < 0) { b[i] += 256; } // unsigned
258 + }
259 + return b;
260 + }
261 +
262 + // Encrypt 16 bytes of text using passwd as key
263 + encrypt(t) {
264 + return this.enc8(t.slice(0, 8)).concat(this.enc8(t.slice(8, 16)));
265 + }
266 +}
public/novnc/core/display.js new
+654
@@ -0,0 +1,654 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +import * as Log from './util/logging.js';
10 +import Base64 from "./base64.js";
11 +import { supportsImageMetadata } from './util/browser.js';
12 +
13 +export default class Display {
14 + constructor(target) {
15 + this._drawCtx = null;
16 + this._c_forceCanvas = false;
17 +
18 + this._renderQ = []; // queue drawing actions for in-oder rendering
19 + this._flushing = false;
20 +
21 + // the full frame buffer (logical canvas) size
22 + this._fb_width = 0;
23 + this._fb_height = 0;
24 +
25 + this._prevDrawStyle = "";
26 + this._tile = null;
27 + this._tile16x16 = null;
28 + this._tile_x = 0;
29 + this._tile_y = 0;
30 +
31 + Log.Debug(">> Display.constructor");
32 +
33 + // The visible canvas
34 + this._target = target;
35 +
36 + if (!this._target) {
37 + throw new Error("Target must be set");
38 + }
39 +
40 + if (typeof this._target === 'string') {
41 + throw new Error('target must be a DOM element');
42 + }
43 +
44 + if (!this._target.getContext) {
45 + throw new Error("no getContext method");
46 + }
47 +
48 + this._targetCtx = this._target.getContext('2d');
49 +
50 + // the visible canvas viewport (i.e. what actually gets seen)
51 + this._viewportLoc = { 'x': 0, 'y': 0, 'w': this._target.width, 'h': this._target.height };
52 +
53 + // The hidden canvas, where we do the actual rendering
54 + this._backbuffer = document.createElement('canvas');
55 + this._drawCtx = this._backbuffer.getContext('2d');
56 +
57 + this._damageBounds = { left: 0, top: 0,
58 + right: this._backbuffer.width,
59 + bottom: this._backbuffer.height };
60 +
61 + Log.Debug("User Agent: " + navigator.userAgent);
62 +
63 + this.clear();
64 +
65 + // Check canvas features
66 + if (!('createImageData' in this._drawCtx)) {
67 + throw new Error("Canvas does not support createImageData");
68 + }
69 +
70 + this._tile16x16 = this._drawCtx.createImageData(16, 16);
71 + Log.Debug("<< Display.constructor");
72 +
73 + // ===== PROPERTIES =====
74 +
75 + this._scale = 1.0;
76 + this._clipViewport = false;
77 + this.logo = null;
78 +
79 + // ===== EVENT HANDLERS =====
80 +
81 + this.onflush = () => {}; // A flush request has finished
82 + }
83 +
84 + // ===== PROPERTIES =====
85 +
86 + get scale() { return this._scale; }
87 + set scale(scale) {
88 + this._rescale(scale);
89 + }
90 +
91 + get clipViewport() { return this._clipViewport; }
92 + set clipViewport(viewport) {
93 + this._clipViewport = viewport;
94 + // May need to readjust the viewport dimensions
95 + const vp = this._viewportLoc;
96 + this.viewportChangeSize(vp.w, vp.h);
97 + this.viewportChangePos(0, 0);
98 + }
99 +
100 + get width() {
101 + return this._fb_width;
102 + }
103 +
104 + get height() {
105 + return this._fb_height;
106 + }
107 +
108 + // ===== PUBLIC METHODS =====
109 +
110 + viewportChangePos(deltaX, deltaY) {
111 + const vp = this._viewportLoc;
112 + deltaX = Math.floor(deltaX);
113 + deltaY = Math.floor(deltaY);
114 +
115 + if (!this._clipViewport) {
116 + deltaX = -vp.w; // clamped later of out of bounds
117 + deltaY = -vp.h;
118 + }
119 +
120 + const vx2 = vp.x + vp.w - 1;
121 + const vy2 = vp.y + vp.h - 1;
122 +
123 + // Position change
124 +
125 + if (deltaX < 0 && vp.x + deltaX < 0) {
126 + deltaX = -vp.x;
127 + }
128 + if (vx2 + deltaX >= this._fb_width) {
129 + deltaX -= vx2 + deltaX - this._fb_width + 1;
130 + }
131 +
132 + if (vp.y + deltaY < 0) {
133 + deltaY = -vp.y;
134 + }
135 + if (vy2 + deltaY >= this._fb_height) {
136 + deltaY -= (vy2 + deltaY - this._fb_height + 1);
137 + }
138 +
139 + if (deltaX === 0 && deltaY === 0) {
140 + return;
141 + }
142 + Log.Debug("viewportChange deltaX: " + deltaX + ", deltaY: " + deltaY);
143 +
144 + vp.x += deltaX;
145 + vp.y += deltaY;
146 +
147 + this._damage(vp.x, vp.y, vp.w, vp.h);
148 +
149 + this.flip();
150 + }
151 +
152 + viewportChangeSize(width, height) {
153 +
154 + if (!this._clipViewport ||
155 + typeof(width) === "undefined" ||
156 + typeof(height) === "undefined") {
157 +
158 + Log.Debug("Setting viewport to full display region");
159 + width = this._fb_width;
160 + height = this._fb_height;
161 + }
162 +
163 + width = Math.floor(width);
164 + height = Math.floor(height);
165 +
166 + if (width > this._fb_width) {
167 + width = this._fb_width;
168 + }
169 + if (height > this._fb_height) {
170 + height = this._fb_height;
171 + }
172 +
173 + const vp = this._viewportLoc;
174 + if (vp.w !== width || vp.h !== height) {
175 + vp.w = width;
176 + vp.h = height;
177 +
178 + const canvas = this._target;
179 + canvas.width = width;
180 + canvas.height = height;
181 +
182 + // The position might need to be updated if we've grown
183 + this.viewportChangePos(0, 0);
184 +
185 + this._damage(vp.x, vp.y, vp.w, vp.h);
186 + this.flip();
187 +
188 + // Update the visible size of the target canvas
189 + this._rescale(this._scale);
190 + }
191 + }
192 +
193 + absX(x) {
194 + if (this._scale === 0) {
195 + return 0;
196 + }
197 + return x / this._scale + this._viewportLoc.x;
198 + }
199 +
200 + absY(y) {
201 + if (this._scale === 0) {
202 + return 0;
203 + }
204 + return y / this._scale + this._viewportLoc.y;
205 + }
206 +
207 + resize(width, height) {
208 + this._prevDrawStyle = "";
209 +
210 + this._fb_width = width;
211 + this._fb_height = height;
212 +
213 + const canvas = this._backbuffer;
214 + if (canvas.width !== width || canvas.height !== height) {
215 +
216 + // We have to save the canvas data since changing the size will clear it
217 + let saveImg = null;
218 + if (canvas.width > 0 && canvas.height > 0) {
219 + saveImg = this._drawCtx.getImageData(0, 0, canvas.width, canvas.height);
220 + }
221 +
222 + if (canvas.width !== width) {
223 + canvas.width = width;
224 + }
225 + if (canvas.height !== height) {
226 + canvas.height = height;
227 + }
228 +
229 + if (saveImg) {
230 + this._drawCtx.putImageData(saveImg, 0, 0);
231 + }
232 + }
233 +
234 + // Readjust the viewport as it may be incorrectly sized
235 + // and positioned
236 + const vp = this._viewportLoc;
237 + this.viewportChangeSize(vp.w, vp.h);
238 + this.viewportChangePos(0, 0);
239 + }
240 +
241 + // Track what parts of the visible canvas that need updating
242 + _damage(x, y, w, h) {
243 + if (x < this._damageBounds.left) {
244 + this._damageBounds.left = x;
245 + }
246 + if (y < this._damageBounds.top) {
247 + this._damageBounds.top = y;
248 + }
249 + if ((x + w) > this._damageBounds.right) {
250 + this._damageBounds.right = x + w;
251 + }
252 + if ((y + h) > this._damageBounds.bottom) {
253 + this._damageBounds.bottom = y + h;
254 + }
255 + }
256 +
257 + // Update the visible canvas with the contents of the
258 + // rendering canvas
259 + flip(from_queue) {
260 + if (this._renderQ.length !== 0 && !from_queue) {
261 + this._renderQ_push({
262 + 'type': 'flip'
263 + });
264 + } else {
265 + let x = this._damageBounds.left;
266 + let y = this._damageBounds.top;
267 + let w = this._damageBounds.right - x;
268 + let h = this._damageBounds.bottom - y;
269 +
270 + let vx = x - this._viewportLoc.x;
271 + let vy = y - this._viewportLoc.y;
272 +
273 + if (vx < 0) {
274 + w += vx;
275 + x -= vx;
276 + vx = 0;
277 + }
278 + if (vy < 0) {
279 + h += vy;
280 + y -= vy;
281 + vy = 0;
282 + }
283 +
284 + if ((vx + w) > this._viewportLoc.w) {
285 + w = this._viewportLoc.w - vx;
286 + }
287 + if ((vy + h) > this._viewportLoc.h) {
288 + h = this._viewportLoc.h - vy;
289 + }
290 +
291 + if ((w > 0) && (h > 0)) {
292 + // FIXME: We may need to disable image smoothing here
293 + // as well (see copyImage()), but we haven't
294 + // noticed any problem yet.
295 + this._targetCtx.drawImage(this._backbuffer,
296 + x, y, w, h,
297 + vx, vy, w, h);
298 + }
299 +
300 + this._damageBounds.left = this._damageBounds.top = 65535;
301 + this._damageBounds.right = this._damageBounds.bottom = 0;
302 + }
303 + }
304 +
305 + clear() {
306 + if (this._logo) {
307 + this.resize(this._logo.width, this._logo.height);
308 + this.imageRect(0, 0, this._logo.type, this._logo.data);
309 + } else {
310 + this.resize(240, 20);
311 + this._drawCtx.clearRect(0, 0, this._fb_width, this._fb_height);
312 + }
313 + this.flip();
314 + }
315 +
316 + pending() {
317 + return this._renderQ.length > 0;
318 + }
319 +
320 + flush() {
321 + if (this._renderQ.length === 0) {
322 + this.onflush();
323 + } else {
324 + this._flushing = true;
325 + }
326 + }
327 +
328 + fillRect(x, y, width, height, color, from_queue) {
329 + if (this._renderQ.length !== 0 && !from_queue) {
330 + this._renderQ_push({
331 + 'type': 'fill',
332 + 'x': x,
333 + 'y': y,
334 + 'width': width,
335 + 'height': height,
336 + 'color': color
337 + });
338 + } else {
339 + this._setFillColor(color);
340 + this._drawCtx.fillRect(x, y, width, height);
341 + this._damage(x, y, width, height);
342 + }
343 + }
344 +
345 + copyImage(old_x, old_y, new_x, new_y, w, h, from_queue) {
346 + if (this._renderQ.length !== 0 && !from_queue) {
347 + this._renderQ_push({
348 + 'type': 'copy',
349 + 'old_x': old_x,
350 + 'old_y': old_y,
351 + 'x': new_x,
352 + 'y': new_y,
353 + 'width': w,
354 + 'height': h,
355 + });
356 + } else {
357 + // Due to this bug among others [1] we need to disable the image-smoothing to
358 + // avoid getting a blur effect when copying data.
359 + //
360 + // 1. https://bugzilla.mozilla.org/show_bug.cgi?id=1194719
361 + //
362 + // We need to set these every time since all properties are reset
363 + // when the the size is changed
364 + this._drawCtx.mozImageSmoothingEnabled = false;
365 + this._drawCtx.webkitImageSmoothingEnabled = false;
366 + this._drawCtx.msImageSmoothingEnabled = false;
367 + this._drawCtx.imageSmoothingEnabled = false;
368 +
369 + this._drawCtx.drawImage(this._backbuffer,
370 + old_x, old_y, w, h,
371 + new_x, new_y, w, h);
372 + this._damage(new_x, new_y, w, h);
373 + }
374 + }
375 +
376 + imageRect(x, y, mime, arr) {
377 + const img = new Image();
378 + img.src = "data: " + mime + ";base64," + Base64.encode(arr);
379 + this._renderQ_push({
380 + 'type': 'img',
381 + 'img': img,
382 + 'x': x,
383 + 'y': y
384 + });
385 + }
386 +
387 + // start updating a tile
388 + startTile(x, y, width, height, color) {
389 + this._tile_x = x;
390 + this._tile_y = y;
391 + if (width === 16 && height === 16) {
392 + this._tile = this._tile16x16;
393 + } else {
394 + this._tile = this._drawCtx.createImageData(width, height);
395 + }
396 +
397 + const red = color[2];
398 + const green = color[1];
399 + const blue = color[0];
400 +
401 + const data = this._tile.data;
402 + for (let i = 0; i < width * height * 4; i += 4) {
403 + data[i] = red;
404 + data[i + 1] = green;
405 + data[i + 2] = blue;
406 + data[i + 3] = 255;
407 + }
408 + }
409 +
410 + // update sub-rectangle of the current tile
411 + subTile(x, y, w, h, color) {
412 + const red = color[2];
413 + const green = color[1];
414 + const blue = color[0];
415 + const xend = x + w;
416 + const yend = y + h;
417 +
418 + const data = this._tile.data;
419 + const width = this._tile.width;
420 + for (let j = y; j < yend; j++) {
421 + for (let i = x; i < xend; i++) {
422 + const p = (i + (j * width)) * 4;
423 + data[p] = red;
424 + data[p + 1] = green;
425 + data[p + 2] = blue;
426 + data[p + 3] = 255;
427 + }
428 + }
429 + }
430 +
431 + // draw the current tile to the screen
432 + finishTile() {
433 + this._drawCtx.putImageData(this._tile, this._tile_x, this._tile_y);
434 + this._damage(this._tile_x, this._tile_y,
435 + this._tile.width, this._tile.height);
436 + }
437 +
438 + blitImage(x, y, width, height, arr, offset, from_queue) {
439 + if (this._renderQ.length !== 0 && !from_queue) {
440 + // NB(directxman12): it's technically more performant here to use preallocated arrays,
441 + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue,
442 + // this probably isn't getting called *nearly* as much
443 + const new_arr = new Uint8Array(width * height * 4);
444 + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length));
445 + this._renderQ_push({
446 + 'type': 'blit',
447 + 'data': new_arr,
448 + 'x': x,
449 + 'y': y,
450 + 'width': width,
451 + 'height': height,
452 + });
453 + } else {
454 + this._bgrxImageData(x, y, width, height, arr, offset);
455 + }
456 + }
457 +
458 + blitRgbImage(x, y, width, height, arr, offset, from_queue) {
459 + if (this._renderQ.length !== 0 && !from_queue) {
460 + // NB(directxman12): it's technically more performant here to use preallocated arrays,
461 + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue,
462 + // this probably isn't getting called *nearly* as much
463 + const new_arr = new Uint8Array(width * height * 3);
464 + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length));
465 + this._renderQ_push({
466 + 'type': 'blitRgb',
467 + 'data': new_arr,
468 + 'x': x,
469 + 'y': y,
470 + 'width': width,
471 + 'height': height,
472 + });
473 + } else {
474 + this._rgbImageData(x, y, width, height, arr, offset);
475 + }
476 + }
477 +
478 + blitRgbxImage(x, y, width, height, arr, offset, from_queue) {
479 + if (this._renderQ.length !== 0 && !from_queue) {
480 + // NB(directxman12): it's technically more performant here to use preallocated arrays,
481 + // but it's a lot of extra work for not a lot of payoff -- if we're using the render queue,
482 + // this probably isn't getting called *nearly* as much
483 + const new_arr = new Uint8Array(width * height * 4);
484 + new_arr.set(new Uint8Array(arr.buffer, 0, new_arr.length));
485 + this._renderQ_push({
486 + 'type': 'blitRgbx',
487 + 'data': new_arr,
488 + 'x': x,
489 + 'y': y,
490 + 'width': width,
491 + 'height': height,
492 + });
493 + } else {
494 + this._rgbxImageData(x, y, width, height, arr, offset);
495 + }
496 + }
497 +
498 + drawImage(img, x, y) {
499 + this._drawCtx.drawImage(img, x, y);
500 + this._damage(x, y, img.width, img.height);
501 + }
502 +
503 + autoscale(containerWidth, containerHeight) {
504 + let scaleRatio;
505 +
506 + if (containerWidth === 0 || containerHeight === 0) {
507 + scaleRatio = 0;
508 +
509 + } else {
510 +
511 + const vp = this._viewportLoc;
512 + const targetAspectRatio = containerWidth / containerHeight;
513 + const fbAspectRatio = vp.w / vp.h;
514 +
515 + if (fbAspectRatio >= targetAspectRatio) {
516 + scaleRatio = containerWidth / vp.w;
517 + } else {
518 + scaleRatio = containerHeight / vp.h;
519 + }
520 + }
521 +
522 + this._rescale(scaleRatio);
523 + }
524 +
525 + // ===== PRIVATE METHODS =====
526 +
527 + _rescale(factor) {
528 + this._scale = factor;
529 + const vp = this._viewportLoc;
530 +
531 + // NB(directxman12): If you set the width directly, or set the
532 + // style width to a number, the canvas is cleared.
533 + // However, if you set the style width to a string
534 + // ('NNNpx'), the canvas is scaled without clearing.
535 + const width = factor * vp.w + 'px';
536 + const height = factor * vp.h + 'px';
537 +
538 + if ((this._target.style.width !== width) ||
539 + (this._target.style.height !== height)) {
540 + this._target.style.width = width;
541 + this._target.style.height = height;
542 + }
543 + }
544 +
545 + _setFillColor(color) {
546 + const newStyle = 'rgb(' + color[2] + ',' + color[1] + ',' + color[0] + ')';
547 + if (newStyle !== this._prevDrawStyle) {
548 + this._drawCtx.fillStyle = newStyle;
549 + this._prevDrawStyle = newStyle;
550 + }
551 + }
552 +
553 + _rgbImageData(x, y, width, height, arr, offset) {
554 + const img = this._drawCtx.createImageData(width, height);
555 + const data = img.data;
556 + for (let i = 0, j = offset; i < width * height * 4; i += 4, j += 3) {
557 + data[i] = arr[j];
558 + data[i + 1] = arr[j + 1];
559 + data[i + 2] = arr[j + 2];
560 + data[i + 3] = 255; // Alpha
561 + }
562 + this._drawCtx.putImageData(img, x, y);
563 + this._damage(x, y, img.width, img.height);
564 + }
565 +
566 + _bgrxImageData(x, y, width, height, arr, offset) {
567 + const img = this._drawCtx.createImageData(width, height);
568 + const data = img.data;
569 + for (let i = 0, j = offset; i < width * height * 4; i += 4, j += 4) {
570 + data[i] = arr[j + 2];
571 + data[i + 1] = arr[j + 1];
572 + data[i + 2] = arr[j];
573 + data[i + 3] = 255; // Alpha
574 + }
575 + this._drawCtx.putImageData(img, x, y);
576 + this._damage(x, y, img.width, img.height);
577 + }
578 +
579 + _rgbxImageData(x, y, width, height, arr, offset) {
580 + // NB(directxman12): arr must be an Type Array view
581 + let img;
582 + if (supportsImageMetadata) {
583 + img = new ImageData(new Uint8ClampedArray(arr.buffer, arr.byteOffset, width * height * 4), width, height);
584 + } else {
585 + img = this._drawCtx.createImageData(width, height);
586 + img.data.set(new Uint8ClampedArray(arr.buffer, arr.byteOffset, width * height * 4));
587 + }
588 + this._drawCtx.putImageData(img, x, y);
589 + this._damage(x, y, img.width, img.height);
590 + }
591 +
592 + _renderQ_push(action) {
593 + this._renderQ.push(action);
594 + if (this._renderQ.length === 1) {
595 + // If this can be rendered immediately it will be, otherwise
596 + // the scanner will wait for the relevant event
597 + this._scan_renderQ();
598 + }
599 + }
600 +
601 + _resume_renderQ() {
602 + // "this" is the object that is ready, not the
603 + // display object
604 + this.removeEventListener('load', this._noVNC_display._resume_renderQ);
605 + this._noVNC_display._scan_renderQ();
606 + }
607 +
608 + _scan_renderQ() {
609 + let ready = true;
610 + while (ready && this._renderQ.length > 0) {
611 + const a = this._renderQ[0];
612 + switch (a.type) {
613 + case 'flip':
614 + this.flip(true);
615 + break;
616 + case 'copy':
617 + this.copyImage(a.old_x, a.old_y, a.x, a.y, a.width, a.height, true);
618 + break;
619 + case 'fill':
620 + this.fillRect(a.x, a.y, a.width, a.height, a.color, true);
621 + break;
622 + case 'blit':
623 + this.blitImage(a.x, a.y, a.width, a.height, a.data, 0, true);
624 + break;
625 + case 'blitRgb':
626 + this.blitRgbImage(a.x, a.y, a.width, a.height, a.data, 0, true);
627 + break;
628 + case 'blitRgbx':
629 + this.blitRgbxImage(a.x, a.y, a.width, a.height, a.data, 0, true);
630 + break;
631 + case 'img':
632 + if (a.img.complete) {
633 + this.drawImage(a.img, a.x, a.y);
634 + } else {
635 + a.img._noVNC_display = this;
636 + a.img.addEventListener('load', this._resume_renderQ);
637 + // We need to wait for this image to 'load'
638 + // to keep things in-order
639 + ready = false;
640 + }
641 + break;
642 + }
643 +
644 + if (ready) {
645 + this._renderQ.shift();
646 + }
647 + }
648 +
649 + if (this._renderQ.length === 0 && this._flushing) {
650 + this._flushing = false;
651 + this.onflush();
652 + }
653 + }
654 +}
public/novnc/core/encodings.js new
+41
@@ -0,0 +1,41 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +export const encodings = {
10 + encodingRaw: 0,
11 + encodingCopyRect: 1,
12 + encodingRRE: 2,
13 + encodingHextile: 5,
14 + encodingTight: 7,
15 + encodingTightPNG: -260,
16 +
17 + pseudoEncodingQualityLevel9: -23,
18 + pseudoEncodingQualityLevel0: -32,
19 + pseudoEncodingDesktopSize: -223,
20 + pseudoEncodingLastRect: -224,
21 + pseudoEncodingCursor: -239,
22 + pseudoEncodingQEMUExtendedKeyEvent: -258,
23 + pseudoEncodingExtendedDesktopSize: -308,
24 + pseudoEncodingXvp: -309,
25 + pseudoEncodingFence: -312,
26 + pseudoEncodingContinuousUpdates: -313,
27 + pseudoEncodingCompressLevel9: -247,
28 + pseudoEncodingCompressLevel0: -256,
29 +};
30 +
31 +export function encodingName(num) {
32 + switch (num) {
33 + case encodings.encodingRaw: return "Raw";
34 + case encodings.encodingCopyRect: return "CopyRect";
35 + case encodings.encodingRRE: return "RRE";
36 + case encodings.encodingHextile: return "Hextile";
37 + case encodings.encodingTight: return "Tight";
38 + case encodings.encodingTightPNG: return "TightPNG";
39 + default: return "[unknown encoding " + num + "]";
40 + }
41 +}
public/novnc/core/inflator.js new
+38
@@ -0,0 +1,38 @@
1 +import { inflateInit, inflate, inflateReset } from "../vendor/pako/lib/zlib/inflate.js";
2 +import ZStream from "../vendor/pako/lib/zlib/zstream.js";
3 +
4 +export default class Inflate {
5 + constructor() {
6 + this.strm = new ZStream();
7 + this.chunkSize = 1024 * 10 * 10;
8 + this.strm.output = new Uint8Array(this.chunkSize);
9 + this.windowBits = 5;
10 +
11 + inflateInit(this.strm, this.windowBits);
12 + }
13 +
14 + inflate(data, flush, expected) {
15 + this.strm.input = data;
16 + this.strm.avail_in = this.strm.input.length;
17 + this.strm.next_in = 0;
18 + this.strm.next_out = 0;
19 +
20 + // resize our output buffer if it's too small
21 + // (we could just use multiple chunks, but that would cause an extra
22 + // allocation each time to flatten the chunks)
23 + if (expected > this.chunkSize) {
24 + this.chunkSize = expected;
25 + this.strm.output = new Uint8Array(this.chunkSize);
26 + }
27 +
28 + this.strm.avail_out = this.chunkSize;
29 +
30 + inflate(this.strm, flush);
31 +
32 + return new Uint8Array(this.strm.output.buffer, 0, this.strm.next_out);
33 + }
34 +
35 + reset() {
36 + inflateReset(this.strm);
37 + }
38 +}
public/novnc/core/input/domkeytable.js new
+307
@@ -0,0 +1,307 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +import KeyTable from "./keysym.js";
8 +
9 +/*
10 + * Mapping between HTML key values and VNC/X11 keysyms for "special"
11 + * keys that cannot be handled via their Unicode codepoint.
12 + *
13 + * See https://www.w3.org/TR/uievents-key/ for possible values.
14 + */
15 +
16 +const DOMKeyTable = {};
17 +
18 +function addStandard(key, standard) {
19 + if (standard === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
20 + if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
21 + DOMKeyTable[key] = [standard, standard, standard, standard];
22 +}
23 +
24 +function addLeftRight(key, left, right) {
25 + if (left === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
26 + if (right === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
27 + if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
28 + DOMKeyTable[key] = [left, left, right, left];
29 +}
30 +
31 +function addNumpad(key, standard, numpad) {
32 + if (standard === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
33 + if (numpad === undefined) throw new Error("Undefined keysym for key \"" + key + "\"");
34 + if (key in DOMKeyTable) throw new Error("Duplicate entry for key \"" + key + "\"");
35 + DOMKeyTable[key] = [standard, standard, standard, numpad];
36 +}
37 +
38 +// 2.2. Modifier Keys
39 +
40 +addLeftRight("Alt", KeyTable.XK_Alt_L, KeyTable.XK_Alt_R);
41 +addStandard("AltGraph", KeyTable.XK_ISO_Level3_Shift);
42 +addStandard("CapsLock", KeyTable.XK_Caps_Lock);
43 +addLeftRight("Control", KeyTable.XK_Control_L, KeyTable.XK_Control_R);
44 +// - Fn
45 +// - FnLock
46 +addLeftRight("Hyper", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
47 +addLeftRight("Meta", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
48 +addStandard("NumLock", KeyTable.XK_Num_Lock);
49 +addStandard("ScrollLock", KeyTable.XK_Scroll_Lock);
50 +addLeftRight("Shift", KeyTable.XK_Shift_L, KeyTable.XK_Shift_R);
51 +addLeftRight("Super", KeyTable.XK_Super_L, KeyTable.XK_Super_R);
52 +// - Symbol
53 +// - SymbolLock
54 +
55 +// 2.3. Whitespace Keys
56 +
57 +addNumpad("Enter", KeyTable.XK_Return, KeyTable.XK_KP_Enter);
58 +addStandard("Tab", KeyTable.XK_Tab);
59 +addNumpad(" ", KeyTable.XK_space, KeyTable.XK_KP_Space);
60 +
61 +// 2.4. Navigation Keys
62 +
63 +addNumpad("ArrowDown", KeyTable.XK_Down, KeyTable.XK_KP_Down);
64 +addNumpad("ArrowUp", KeyTable.XK_Up, KeyTable.XK_KP_Up);
65 +addNumpad("ArrowLeft", KeyTable.XK_Left, KeyTable.XK_KP_Left);
66 +addNumpad("ArrowRight", KeyTable.XK_Right, KeyTable.XK_KP_Right);
67 +addNumpad("End", KeyTable.XK_End, KeyTable.XK_KP_End);
68 +addNumpad("Home", KeyTable.XK_Home, KeyTable.XK_KP_Home);
69 +addNumpad("PageDown", KeyTable.XK_Next, KeyTable.XK_KP_Next);
70 +addNumpad("PageUp", KeyTable.XK_Prior, KeyTable.XK_KP_Prior);
71 +
72 +// 2.5. Editing Keys
73 +
74 +addStandard("Backspace", KeyTable.XK_BackSpace);
75 +addNumpad("Clear", KeyTable.XK_Clear, KeyTable.XK_KP_Begin);
76 +addStandard("Copy", KeyTable.XF86XK_Copy);
77 +// - CrSel
78 +addStandard("Cut", KeyTable.XF86XK_Cut);
79 +addNumpad("Delete", KeyTable.XK_Delete, KeyTable.XK_KP_Delete);
80 +// - EraseEof
81 +// - ExSel
82 +addNumpad("Insert", KeyTable.XK_Insert, KeyTable.XK_KP_Insert);
83 +addStandard("Paste", KeyTable.XF86XK_Paste);
84 +addStandard("Redo", KeyTable.XK_Redo);
85 +addStandard("Undo", KeyTable.XK_Undo);
86 +
87 +// 2.6. UI Keys
88 +
89 +// - Accept
90 +// - Again (could just be XK_Redo)
91 +// - Attn
92 +addStandard("Cancel", KeyTable.XK_Cancel);
93 +addStandard("ContextMenu", KeyTable.XK_Menu);
94 +addStandard("Escape", KeyTable.XK_Escape);
95 +addStandard("Execute", KeyTable.XK_Execute);
96 +addStandard("Find", KeyTable.XK_Find);
97 +addStandard("Help", KeyTable.XK_Help);
98 +addStandard("Pause", KeyTable.XK_Pause);
99 +// - Play
100 +// - Props
101 +addStandard("Select", KeyTable.XK_Select);
102 +addStandard("ZoomIn", KeyTable.XF86XK_ZoomIn);
103 +addStandard("ZoomOut", KeyTable.XF86XK_ZoomOut);
104 +
105 +// 2.7. Device Keys
106 +
107 +addStandard("BrightnessDown", KeyTable.XF86XK_MonBrightnessDown);
108 +addStandard("BrightnessUp", KeyTable.XF86XK_MonBrightnessUp);
109 +addStandard("Eject", KeyTable.XF86XK_Eject);
110 +addStandard("LogOff", KeyTable.XF86XK_LogOff);
111 +addStandard("Power", KeyTable.XF86XK_PowerOff);
112 +addStandard("PowerOff", KeyTable.XF86XK_PowerDown);
113 +addStandard("PrintScreen", KeyTable.XK_Print);
114 +addStandard("Hibernate", KeyTable.XF86XK_Hibernate);
115 +addStandard("Standby", KeyTable.XF86XK_Standby);
116 +addStandard("WakeUp", KeyTable.XF86XK_WakeUp);
117 +
118 +// 2.8. IME and Composition Keys
119 +
120 +addStandard("AllCandidates", KeyTable.XK_MultipleCandidate);
121 +addStandard("Alphanumeric", KeyTable.XK_Eisu_Shift); // could also be _Eisu_Toggle
122 +addStandard("CodeInput", KeyTable.XK_Codeinput);
123 +addStandard("Compose", KeyTable.XK_Multi_key);
124 +addStandard("Convert", KeyTable.XK_Henkan);
125 +// - Dead
126 +// - FinalMode
127 +addStandard("GroupFirst", KeyTable.XK_ISO_First_Group);
128 +addStandard("GroupLast", KeyTable.XK_ISO_Last_Group);
129 +addStandard("GroupNext", KeyTable.XK_ISO_Next_Group);
130 +addStandard("GroupPrevious", KeyTable.XK_ISO_Prev_Group);
131 +// - ModeChange (XK_Mode_switch is often used for AltGr)
132 +// - NextCandidate
133 +addStandard("NonConvert", KeyTable.XK_Muhenkan);
134 +addStandard("PreviousCandidate", KeyTable.XK_PreviousCandidate);
135 +// - Process
136 +addStandard("SingleCandidate", KeyTable.XK_SingleCandidate);
137 +addStandard("HangulMode", KeyTable.XK_Hangul);
138 +addStandard("HanjaMode", KeyTable.XK_Hangul_Hanja);
139 +addStandard("JunjuaMode", KeyTable.XK_Hangul_Jeonja);
140 +addStandard("Eisu", KeyTable.XK_Eisu_toggle);
141 +addStandard("Hankaku", KeyTable.XK_Hankaku);
142 +addStandard("Hiragana", KeyTable.XK_Hiragana);
143 +addStandard("HiraganaKatakana", KeyTable.XK_Hiragana_Katakana);
144 +addStandard("KanaMode", KeyTable.XK_Kana_Shift); // could also be _Kana_Lock
145 +addStandard("KanjiMode", KeyTable.XK_Kanji);
146 +addStandard("Katakana", KeyTable.XK_Katakana);
147 +addStandard("Romaji", KeyTable.XK_Romaji);
148 +addStandard("Zenkaku", KeyTable.XK_Zenkaku);
149 +addStandard("ZenkakuHanaku", KeyTable.XK_Zenkaku_Hankaku);
150 +
151 +// 2.9. General-Purpose Function Keys
152 +
153 +addStandard("F1", KeyTable.XK_F1);
154 +addStandard("F2", KeyTable.XK_F2);
155 +addStandard("F3", KeyTable.XK_F3);
156 +addStandard("F4", KeyTable.XK_F4);
157 +addStandard("F5", KeyTable.XK_F5);
158 +addStandard("F6", KeyTable.XK_F6);
159 +addStandard("F7", KeyTable.XK_F7);
160 +addStandard("F8", KeyTable.XK_F8);
161 +addStandard("F9", KeyTable.XK_F9);
162 +addStandard("F10", KeyTable.XK_F10);
163 +addStandard("F11", KeyTable.XK_F11);
164 +addStandard("F12", KeyTable.XK_F12);
165 +addStandard("F13", KeyTable.XK_F13);
166 +addStandard("F14", KeyTable.XK_F14);
167 +addStandard("F15", KeyTable.XK_F15);
168 +addStandard("F16", KeyTable.XK_F16);
169 +addStandard("F17", KeyTable.XK_F17);
170 +addStandard("F18", KeyTable.XK_F18);
171 +addStandard("F19", KeyTable.XK_F19);
172 +addStandard("F20", KeyTable.XK_F20);
173 +addStandard("F21", KeyTable.XK_F21);
174 +addStandard("F22", KeyTable.XK_F22);
175 +addStandard("F23", KeyTable.XK_F23);
176 +addStandard("F24", KeyTable.XK_F24);
177 +addStandard("F25", KeyTable.XK_F25);
178 +addStandard("F26", KeyTable.XK_F26);
179 +addStandard("F27", KeyTable.XK_F27);
180 +addStandard("F28", KeyTable.XK_F28);
181 +addStandard("F29", KeyTable.XK_F29);
182 +addStandard("F30", KeyTable.XK_F30);
183 +addStandard("F31", KeyTable.XK_F31);
184 +addStandard("F32", KeyTable.XK_F32);
185 +addStandard("F33", KeyTable.XK_F33);
186 +addStandard("F34", KeyTable.XK_F34);
187 +addStandard("F35", KeyTable.XK_F35);
188 +// - Soft1...
189 +
190 +// 2.10. Multimedia Keys
191 +
192 +// - ChannelDown
193 +// - ChannelUp
194 +addStandard("Close", KeyTable.XF86XK_Close);
195 +addStandard("MailForward", KeyTable.XF86XK_MailForward);
196 +addStandard("MailReply", KeyTable.XF86XK_Reply);
197 +addStandard("MainSend", KeyTable.XF86XK_Send);
198 +addStandard("MediaFastForward", KeyTable.XF86XK_AudioForward);
199 +addStandard("MediaPause", KeyTable.XF86XK_AudioPause);
200 +addStandard("MediaPlay", KeyTable.XF86XK_AudioPlay);
201 +addStandard("MediaRecord", KeyTable.XF86XK_AudioRecord);
202 +addStandard("MediaRewind", KeyTable.XF86XK_AudioRewind);
203 +addStandard("MediaStop", KeyTable.XF86XK_AudioStop);
204 +addStandard("MediaTrackNext", KeyTable.XF86XK_AudioNext);
205 +addStandard("MediaTrackPrevious", KeyTable.XF86XK_AudioPrev);
206 +addStandard("New", KeyTable.XF86XK_New);
207 +addStandard("Open", KeyTable.XF86XK_Open);
208 +addStandard("Print", KeyTable.XK_Print);
209 +addStandard("Save", KeyTable.XF86XK_Save);
210 +addStandard("SpellCheck", KeyTable.XF86XK_Spell);
211 +
212 +// 2.11. Multimedia Numpad Keys
213 +
214 +// - Key11
215 +// - Key12
216 +
217 +// 2.12. Audio Keys
218 +
219 +// - AudioBalanceLeft
220 +// - AudioBalanceRight
221 +// - AudioBassDown
222 +// - AudioBassBoostDown
223 +// - AudioBassBoostToggle
224 +// - AudioBassBoostUp
225 +// - AudioBassUp
226 +// - AudioFaderFront
227 +// - AudioFaderRear
228 +// - AudioSurroundModeNext
229 +// - AudioTrebleDown
230 +// - AudioTrebleUp
231 +addStandard("AudioVolumeDown", KeyTable.XF86XK_AudioLowerVolume);
232 +addStandard("AudioVolumeUp", KeyTable.XF86XK_AudioRaiseVolume);
233 +addStandard("AudioVolumeMute", KeyTable.XF86XK_AudioMute);
234 +// - MicrophoneToggle
235 +// - MicrophoneVolumeDown
236 +// - MicrophoneVolumeUp
237 +addStandard("MicrophoneVolumeMute", KeyTable.XF86XK_AudioMicMute);
238 +
239 +// 2.13. Speech Keys
240 +
241 +// - SpeechCorrectionList
242 +// - SpeechInputToggle
243 +
244 +// 2.14. Application Keys
245 +
246 +addStandard("LaunchCalculator", KeyTable.XF86XK_Calculator);
247 +addStandard("LaunchCalendar", KeyTable.XF86XK_Calendar);
248 +addStandard("LaunchMail", KeyTable.XF86XK_Mail);
249 +addStandard("LaunchMediaPlayer", KeyTable.XF86XK_AudioMedia);
250 +addStandard("LaunchMusicPlayer", KeyTable.XF86XK_Music);
251 +addStandard("LaunchMyComputer", KeyTable.XF86XK_MyComputer);
252 +addStandard("LaunchPhone", KeyTable.XF86XK_Phone);
253 +addStandard("LaunchScreenSaver", KeyTable.XF86XK_ScreenSaver);
254 +addStandard("LaunchSpreadsheet", KeyTable.XF86XK_Excel);
255 +addStandard("LaunchWebBrowser", KeyTable.XF86XK_WWW);
256 +addStandard("LaunchWebCam", KeyTable.XF86XK_WebCam);
257 +addStandard("LaunchWordProcessor", KeyTable.XF86XK_Word);
258 +
259 +// 2.15. Browser Keys
260 +
261 +addStandard("BrowserBack", KeyTable.XF86XK_Back);
262 +addStandard("BrowserFavorites", KeyTable.XF86XK_Favorites);
263 +addStandard("BrowserForward", KeyTable.XF86XK_Forward);
264 +addStandard("BrowserHome", KeyTable.XF86XK_HomePage);
265 +addStandard("BrowserRefresh", KeyTable.XF86XK_Refresh);
266 +addStandard("BrowserSearch", KeyTable.XF86XK_Search);
267 +addStandard("BrowserStop", KeyTable.XF86XK_Stop);
268 +
269 +// 2.16. Mobile Phone Keys
270 +
271 +// - A whole bunch...
272 +
273 +// 2.17. TV Keys
274 +
275 +// - A whole bunch...
276 +
277 +// 2.18. Media Controller Keys
278 +
279 +// - A whole bunch...
280 +addStandard("Dimmer", KeyTable.XF86XK_BrightnessAdjust);
281 +addStandard("MediaAudioTrack", KeyTable.XF86XK_AudioCycleTrack);
282 +addStandard("RandomToggle", KeyTable.XF86XK_AudioRandomPlay);
283 +addStandard("SplitScreenToggle", KeyTable.XF86XK_SplitScreen);
284 +addStandard("Subtitle", KeyTable.XF86XK_Subtitle);
285 +addStandard("VideoModeNext", KeyTable.XF86XK_Next_VMode);
286 +
287 +// Extra: Numpad
288 +
289 +addNumpad("=", KeyTable.XK_equal, KeyTable.XK_KP_Equal);
290 +addNumpad("+", KeyTable.XK_plus, KeyTable.XK_KP_Add);
291 +addNumpad("-", KeyTable.XK_minus, KeyTable.XK_KP_Subtract);
292 +addNumpad("*", KeyTable.XK_asterisk, KeyTable.XK_KP_Multiply);
293 +addNumpad("/", KeyTable.XK_slash, KeyTable.XK_KP_Divide);
294 +addNumpad(".", KeyTable.XK_period, KeyTable.XK_KP_Decimal);
295 +addNumpad(",", KeyTable.XK_comma, KeyTable.XK_KP_Separator);
296 +addNumpad("0", KeyTable.XK_0, KeyTable.XK_KP_0);
297 +addNumpad("1", KeyTable.XK_1, KeyTable.XK_KP_1);
298 +addNumpad("2", KeyTable.XK_2, KeyTable.XK_KP_2);
299 +addNumpad("3", KeyTable.XK_3, KeyTable.XK_KP_3);
300 +addNumpad("4", KeyTable.XK_4, KeyTable.XK_KP_4);
301 +addNumpad("5", KeyTable.XK_5, KeyTable.XK_KP_5);
302 +addNumpad("6", KeyTable.XK_6, KeyTable.XK_KP_6);
303 +addNumpad("7", KeyTable.XK_7, KeyTable.XK_KP_7);
304 +addNumpad("8", KeyTable.XK_8, KeyTable.XK_KP_8);
305 +addNumpad("9", KeyTable.XK_9, KeyTable.XK_KP_9);
306 +
307 +export default DOMKeyTable;
public/novnc/core/input/fixedkeys.js new
+129
@@ -0,0 +1,129 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +/*
8 + * Fallback mapping between HTML key codes (physical keys) and
9 + * HTML key values. This only works for keys that don't vary
10 + * between layouts. We also omit those who manage fine by mapping the
11 + * Unicode representation.
12 + *
13 + * See https://www.w3.org/TR/uievents-code/ for possible codes.
14 + * See https://www.w3.org/TR/uievents-key/ for possible values.
15 + */
16 +
17 +/* eslint-disable key-spacing */
18 +
19 +export default {
20 +
21 +// 3.1.1.1. Writing System Keys
22 +
23 + 'Backspace': 'Backspace',
24 +
25 +// 3.1.1.2. Functional Keys
26 +
27 + 'AltLeft': 'Alt',
28 + 'AltRight': 'Alt', // This could also be 'AltGraph'
29 + 'CapsLock': 'CapsLock',
30 + 'ContextMenu': 'ContextMenu',
31 + 'ControlLeft': 'Control',
32 + 'ControlRight': 'Control',
33 + 'Enter': 'Enter',
34 + 'MetaLeft': 'Meta',
35 + 'MetaRight': 'Meta',
36 + 'ShiftLeft': 'Shift',
37 + 'ShiftRight': 'Shift',
38 + 'Tab': 'Tab',
39 + // FIXME: Japanese/Korean keys
40 +
41 +// 3.1.2. Control Pad Section
42 +
43 + 'Delete': 'Delete',
44 + 'End': 'End',
45 + 'Help': 'Help',
46 + 'Home': 'Home',
47 + 'Insert': 'Insert',
48 + 'PageDown': 'PageDown',
49 + 'PageUp': 'PageUp',
50 +
51 +// 3.1.3. Arrow Pad Section
52 +
53 + 'ArrowDown': 'ArrowDown',
54 + 'ArrowLeft': 'ArrowLeft',
55 + 'ArrowRight': 'ArrowRight',
56 + 'ArrowUp': 'ArrowUp',
57 +
58 +// 3.1.4. Numpad Section
59 +
60 + 'NumLock': 'NumLock',
61 + 'NumpadBackspace': 'Backspace',
62 + 'NumpadClear': 'Clear',
63 +
64 +// 3.1.5. Function Section
65 +
66 + 'Escape': 'Escape',
67 + 'F1': 'F1',
68 + 'F2': 'F2',
69 + 'F3': 'F3',
70 + 'F4': 'F4',
71 + 'F5': 'F5',
72 + 'F6': 'F6',
73 + 'F7': 'F7',
74 + 'F8': 'F8',
75 + 'F9': 'F9',
76 + 'F10': 'F10',
77 + 'F11': 'F11',
78 + 'F12': 'F12',
79 + 'F13': 'F13',
80 + 'F14': 'F14',
81 + 'F15': 'F15',
82 + 'F16': 'F16',
83 + 'F17': 'F17',
84 + 'F18': 'F18',
85 + 'F19': 'F19',
86 + 'F20': 'F20',
87 + 'F21': 'F21',
88 + 'F22': 'F22',
89 + 'F23': 'F23',
90 + 'F24': 'F24',
91 + 'F25': 'F25',
92 + 'F26': 'F26',
93 + 'F27': 'F27',
94 + 'F28': 'F28',
95 + 'F29': 'F29',
96 + 'F30': 'F30',
97 + 'F31': 'F31',
98 + 'F32': 'F32',
99 + 'F33': 'F33',
100 + 'F34': 'F34',
101 + 'F35': 'F35',
102 + 'PrintScreen': 'PrintScreen',
103 + 'ScrollLock': 'ScrollLock',
104 + 'Pause': 'Pause',
105 +
106 +// 3.1.6. Media Keys
107 +
108 + 'BrowserBack': 'BrowserBack',
109 + 'BrowserFavorites': 'BrowserFavorites',
110 + 'BrowserForward': 'BrowserForward',
111 + 'BrowserHome': 'BrowserHome',
112 + 'BrowserRefresh': 'BrowserRefresh',
113 + 'BrowserSearch': 'BrowserSearch',
114 + 'BrowserStop': 'BrowserStop',
115 + 'Eject': 'Eject',
116 + 'LaunchApp1': 'LaunchMyComputer',
117 + 'LaunchApp2': 'LaunchCalendar',
118 + 'LaunchMail': 'LaunchMail',
119 + 'MediaPlayPause': 'MediaPlay',
120 + 'MediaStop': 'MediaStop',
121 + 'MediaTrackNext': 'MediaTrackNext',
122 + 'MediaTrackPrevious': 'MediaTrackPrevious',
123 + 'Power': 'Power',
124 + 'Sleep': 'Sleep',
125 + 'AudioVolumeDown': 'AudioVolumeDown',
126 + 'AudioVolumeMute': 'AudioVolumeMute',
127 + 'AudioVolumeUp': 'AudioVolumeUp',
128 + 'WakeUp': 'WakeUp',
129 +};
public/novnc/core/input/keyboard.js new
+370
@@ -0,0 +1,370 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +import * as Log from '../util/logging.js';
8 +import { stopEvent } from '../util/events.js';
9 +import * as KeyboardUtil from "./util.js";
10 +import KeyTable from "./keysym.js";
11 +import * as browser from "../util/browser.js";
12 +
13 +//
14 +// Keyboard event handler
15 +//
16 +
17 +export default class Keyboard {
18 + constructor(target) {
19 + this._target = target || null;
20 +
21 + this._keyDownList = {}; // List of depressed keys
22 + // (even if they are happy)
23 + this._pendingKey = null; // Key waiting for keypress
24 + this._altGrArmed = false; // Windows AltGr detection
25 +
26 + // keep these here so we can refer to them later
27 + this._eventHandlers = {
28 + 'keyup': this._handleKeyUp.bind(this),
29 + 'keydown': this._handleKeyDown.bind(this),
30 + 'keypress': this._handleKeyPress.bind(this),
31 + 'blur': this._allKeysUp.bind(this),
32 + 'checkalt': this._checkAlt.bind(this),
33 + };
34 +
35 + // ===== EVENT HANDLERS =====
36 +
37 + this.onkeyevent = () => {}; // Handler for key press/release
38 + }
39 +
40 + // ===== PRIVATE METHODS =====
41 +
42 + _sendKeyEvent(keysym, code, down) {
43 + if (down) {
44 + this._keyDownList[code] = keysym;
45 + } else {
46 + // Do we really think this key is down?
47 + if (!(code in this._keyDownList)) {
48 + return;
49 + }
50 + delete this._keyDownList[code];
51 + }
52 +
53 + Log.Debug("onkeyevent " + (down ? "down" : "up") +
54 + ", keysym: " + keysym, ", code: " + code);
55 + this.onkeyevent(keysym, code, down);
56 + }
57 +
58 + _getKeyCode(e) {
59 + const code = KeyboardUtil.getKeycode(e);
60 + if (code !== 'Unidentified') {
61 + return code;
62 + }
63 +
64 + // Unstable, but we don't have anything else to go on
65 + // (don't use it for 'keypress' events thought since
66 + // WebKit sets it to the same as charCode)
67 + if (e.keyCode && (e.type !== 'keypress')) {
68 + // 229 is used for composition events
69 + if (e.keyCode !== 229) {
70 + return 'Platform' + e.keyCode;
71 + }
72 + }
73 +
74 + // A precursor to the final DOM3 standard. Unfortunately it
75 + // is not layout independent, so it is as bad as using keyCode
76 + if (e.keyIdentifier) {
77 + // Non-character key?
78 + if (e.keyIdentifier.substr(0, 2) !== 'U+') {
79 + return e.keyIdentifier;
80 + }
81 +
82 + const codepoint = parseInt(e.keyIdentifier.substr(2), 16);
83 + const char = String.fromCharCode(codepoint).toUpperCase();
84 +
85 + return 'Platform' + char.charCodeAt();
86 + }
87 +
88 + return 'Unidentified';
89 + }
90 +
91 + _handleKeyDown(e) {
92 + const code = this._getKeyCode(e);
93 + let keysym = KeyboardUtil.getKeysym(e);
94 +
95 + // Windows doesn't have a proper AltGr, but handles it using
96 + // fake Ctrl+Alt. However the remote end might not be Windows,
97 + // so we need to merge those in to a single AltGr event. We
98 + // detect this case by seeing the two key events directly after
99 + // each other with a very short time between them (<50ms).
100 + if (this._altGrArmed) {
101 + this._altGrArmed = false;
102 + clearTimeout(this._altGrTimeout);
103 +
104 + if ((code === "AltRight") &&
105 + ((e.timeStamp - this._altGrCtrlTime) < 50)) {
106 + // FIXME: We fail to detect this if either Ctrl key is
107 + // first manually pressed as Windows then no
108 + // longer sends the fake Ctrl down event. It
109 + // does however happily send real Ctrl events
110 + // even when AltGr is already down. Some
111 + // browsers detect this for us though and set the
112 + // key to "AltGraph".
113 + keysym = KeyTable.XK_ISO_Level3_Shift;
114 + } else {
115 + this._sendKeyEvent(KeyTable.XK_Control_L, "ControlLeft", true);
116 + }
117 + }
118 +
119 + // We cannot handle keys we cannot track, but we also need
120 + // to deal with virtual keyboards which omit key info
121 + // (iOS omits tracking info on keyup events, which forces us to
122 + // special treat that platform here)
123 + if ((code === 'Unidentified') || browser.isIOS()) {
124 + if (keysym) {
125 + // If it's a virtual keyboard then it should be
126 + // sufficient to just send press and release right
127 + // after each other
128 + this._sendKeyEvent(keysym, code, true);
129 + this._sendKeyEvent(keysym, code, false);
130 + }
131 +
132 + stopEvent(e);
133 + return;
134 + }
135 +
136 + // Alt behaves more like AltGraph on macOS, so shuffle the
137 + // keys around a bit to make things more sane for the remote
138 + // server. This method is used by RealVNC and TigerVNC (and
139 + // possibly others).
140 + if (browser.isMac()) {
141 + switch (keysym) {
142 + case KeyTable.XK_Super_L:
143 + keysym = KeyTable.XK_Alt_L;
144 + break;
145 + case KeyTable.XK_Super_R:
146 + keysym = KeyTable.XK_Super_L;
147 + break;
148 + case KeyTable.XK_Alt_L:
149 + keysym = KeyTable.XK_Mode_switch;
150 + break;
151 + case KeyTable.XK_Alt_R:
152 + keysym = KeyTable.XK_ISO_Level3_Shift;
153 + break;
154 + }
155 + }
156 +
157 + // Is this key already pressed? If so, then we must use the
158 + // same keysym or we'll confuse the server
159 + if (code in this._keyDownList) {
160 + keysym = this._keyDownList[code];
161 + }
162 +
163 + // macOS doesn't send proper key events for modifiers, only
164 + // state change events. That gets extra confusing for CapsLock
165 + // which toggles on each press, but not on release. So pretend
166 + // it was a quick press and release of the button.
167 + if (browser.isMac() && (code === 'CapsLock')) {
168 + this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);
169 + this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);
170 + stopEvent(e);
171 + return;
172 + }
173 +
174 + // If this is a legacy browser then we'll need to wait for
175 + // a keypress event as well
176 + // (IE and Edge has a broken KeyboardEvent.key, so we can't
177 + // just check for the presence of that field)
178 + if (!keysym && (!e.key || browser.isIE() || browser.isEdge())) {
179 + this._pendingKey = code;
180 + // However we might not get a keypress event if the key
181 + // is non-printable, which needs some special fallback
182 + // handling
183 + setTimeout(this._handleKeyPressTimeout.bind(this), 10, e);
184 + return;
185 + }
186 +
187 + this._pendingKey = null;
188 + stopEvent(e);
189 +
190 + // Possible start of AltGr sequence? (see above)
191 + if ((code === "ControlLeft") && browser.isWindows() &&
192 + !("ControlLeft" in this._keyDownList)) {
193 + this._altGrArmed = true;
194 + this._altGrTimeout = setTimeout(this._handleAltGrTimeout.bind(this), 100);
195 + this._altGrCtrlTime = e.timeStamp;
196 + return;
197 + }
198 +
199 + this._sendKeyEvent(keysym, code, true);
200 + }
201 +
202 + // Legacy event for browsers without code/key
203 + _handleKeyPress(e) {
204 + stopEvent(e);
205 +
206 + // Are we expecting a keypress?
207 + if (this._pendingKey === null) {
208 + return;
209 + }
210 +
211 + let code = this._getKeyCode(e);
212 + const keysym = KeyboardUtil.getKeysym(e);
213 +
214 + // The key we were waiting for?
215 + if ((code !== 'Unidentified') && (code != this._pendingKey)) {
216 + return;
217 + }
218 +
219 + code = this._pendingKey;
220 + this._pendingKey = null;
221 +
222 + if (!keysym) {
223 + Log.Info('keypress with no keysym:', e);
224 + return;
225 + }
226 +
227 + this._sendKeyEvent(keysym, code, true);
228 + }
229 +
230 + _handleKeyPressTimeout(e) {
231 + // Did someone manage to sort out the key already?
232 + if (this._pendingKey === null) {
233 + return;
234 + }
235 +
236 + let keysym;
237 +
238 + const code = this._pendingKey;
239 + this._pendingKey = null;
240 +
241 + // We have no way of knowing the proper keysym with the
242 + // information given, but the following are true for most
243 + // layouts
244 + if ((e.keyCode >= 0x30) && (e.keyCode <= 0x39)) {
245 + // Digit
246 + keysym = e.keyCode;
247 + } else if ((e.keyCode >= 0x41) && (e.keyCode <= 0x5a)) {
248 + // Character (A-Z)
249 + let char = String.fromCharCode(e.keyCode);
250 + // A feeble attempt at the correct case
251 + if (e.shiftKey) {
252 + char = char.toUpperCase();
253 + } else {
254 + char = char.toLowerCase();
255 + }
256 + keysym = char.charCodeAt();
257 + } else {
258 + // Unknown, give up
259 + keysym = 0;
260 + }
261 +
262 + this._sendKeyEvent(keysym, code, true);
263 + }
264 +
265 + _handleKeyUp(e) {
266 + stopEvent(e);
267 +
268 + const code = this._getKeyCode(e);
269 +
270 + // We can't get a release in the middle of an AltGr sequence, so
271 + // abort that detection
272 + if (this._altGrArmed) {
273 + this._altGrArmed = false;
274 + clearTimeout(this._altGrTimeout);
275 + this._sendKeyEvent(KeyTable.XK_Control_L, "ControlLeft", true);
276 + }
277 +
278 + // See comment in _handleKeyDown()
279 + if (browser.isMac() && (code === 'CapsLock')) {
280 + this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', true);
281 + this._sendKeyEvent(KeyTable.XK_Caps_Lock, 'CapsLock', false);
282 + return;
283 + }
284 +
285 + this._sendKeyEvent(this._keyDownList[code], code, false);
286 + }
287 +
288 + _handleAltGrTimeout() {
289 + this._altGrArmed = false;
290 + clearTimeout(this._altGrTimeout);
291 + this._sendKeyEvent(KeyTable.XK_Control_L, "ControlLeft", true);
292 + }
293 +
294 + _allKeysUp() {
295 + Log.Debug(">> Keyboard.allKeysUp");
296 + for (let code in this._keyDownList) {
297 + this._sendKeyEvent(this._keyDownList[code], code, false);
298 + }
299 + Log.Debug("<< Keyboard.allKeysUp");
300 + }
301 +
302 + // Firefox Alt workaround, see below
303 + _checkAlt(e) {
304 + if (e.altKey) {
305 + return;
306 + }
307 +
308 + const target = this._target;
309 + const downList = this._keyDownList;
310 + ['AltLeft', 'AltRight'].forEach((code) => {
311 + if (!(code in downList)) {
312 + return;
313 + }
314 +
315 + const event = new KeyboardEvent('keyup',
316 + { key: downList[code],
317 + code: code });
318 + target.dispatchEvent(event);
319 + });
320 + }
321 +
322 + // ===== PUBLIC METHODS =====
323 +
324 + grab() {
325 + //Log.Debug(">> Keyboard.grab");
326 +
327 + this._target.addEventListener('keydown', this._eventHandlers.keydown);
328 + this._target.addEventListener('keyup', this._eventHandlers.keyup);
329 + this._target.addEventListener('keypress', this._eventHandlers.keypress);
330 +
331 + // Release (key up) if window loses focus
332 + window.addEventListener('blur', this._eventHandlers.blur);
333 +
334 + // Firefox has broken handling of Alt, so we need to poll as
335 + // best we can for releases (still doesn't prevent the menu
336 + // from popping up though as we can't call preventDefault())
337 + if (browser.isWindows() && browser.isFirefox()) {
338 + const handler = this._eventHandlers.checkalt;
339 + ['mousedown', 'mouseup', 'mousemove', 'wheel',
340 + 'touchstart', 'touchend', 'touchmove',
341 + 'keydown', 'keyup'].forEach(type =>
342 + document.addEventListener(type, handler,
343 + { capture: true,
344 + passive: true }));
345 + }
346 +
347 + //Log.Debug("<< Keyboard.grab");
348 + }
349 +
350 + ungrab() {
351 + //Log.Debug(">> Keyboard.ungrab");
352 +
353 + if (browser.isWindows() && browser.isFirefox()) {
354 + const handler = this._eventHandlers.checkalt;
355 + ['mousedown', 'mouseup', 'mousemove', 'wheel',
356 + 'touchstart', 'touchend', 'touchmove',
357 + 'keydown', 'keyup'].forEach(type => document.removeEventListener(type, handler));
358 + }
359 +
360 + this._target.removeEventListener('keydown', this._eventHandlers.keydown);
361 + this._target.removeEventListener('keyup', this._eventHandlers.keyup);
362 + this._target.removeEventListener('keypress', this._eventHandlers.keypress);
363 + window.removeEventListener('blur', this._eventHandlers.blur);
364 +
365 + // Release (key up) all keys that are in a down state
366 + this._allKeysUp();
367 +
368 + //Log.Debug(">> Keyboard.ungrab");
369 + }
370 +}
public/novnc/core/input/keysym.js new
+616
@@ -0,0 +1,616 @@
1 +/* eslint-disable key-spacing */
2 +
3 +export default {
4 + XK_VoidSymbol: 0xffffff, /* Void symbol */
5 +
6 + XK_BackSpace: 0xff08, /* Back space, back char */
7 + XK_Tab: 0xff09,
8 + XK_Linefeed: 0xff0a, /* Linefeed, LF */
9 + XK_Clear: 0xff0b,
10 + XK_Return: 0xff0d, /* Return, enter */
11 + XK_Pause: 0xff13, /* Pause, hold */
12 + XK_Scroll_Lock: 0xff14,
13 + XK_Sys_Req: 0xff15,
14 + XK_Escape: 0xff1b,
15 + XK_Delete: 0xffff, /* Delete, rubout */
16 +
17 + /* International & multi-key character composition */
18 +
19 + XK_Multi_key: 0xff20, /* Multi-key character compose */
20 + XK_Codeinput: 0xff37,
21 + XK_SingleCandidate: 0xff3c,
22 + XK_MultipleCandidate: 0xff3d,
23 + XK_PreviousCandidate: 0xff3e,
24 +
25 + /* Japanese keyboard support */
26 +
27 + XK_Kanji: 0xff21, /* Kanji, Kanji convert */
28 + XK_Muhenkan: 0xff22, /* Cancel Conversion */
29 + XK_Henkan_Mode: 0xff23, /* Start/Stop Conversion */
30 + XK_Henkan: 0xff23, /* Alias for Henkan_Mode */
31 + XK_Romaji: 0xff24, /* to Romaji */
32 + XK_Hiragana: 0xff25, /* to Hiragana */
33 + XK_Katakana: 0xff26, /* to Katakana */
34 + XK_Hiragana_Katakana: 0xff27, /* Hiragana/Katakana toggle */
35 + XK_Zenkaku: 0xff28, /* to Zenkaku */
36 + XK_Hankaku: 0xff29, /* to Hankaku */
37 + XK_Zenkaku_Hankaku: 0xff2a, /* Zenkaku/Hankaku toggle */
38 + XK_Touroku: 0xff2b, /* Add to Dictionary */
39 + XK_Massyo: 0xff2c, /* Delete from Dictionary */
40 + XK_Kana_Lock: 0xff2d, /* Kana Lock */
41 + XK_Kana_Shift: 0xff2e, /* Kana Shift */
42 + XK_Eisu_Shift: 0xff2f, /* Alphanumeric Shift */
43 + XK_Eisu_toggle: 0xff30, /* Alphanumeric toggle */
44 + XK_Kanji_Bangou: 0xff37, /* Codeinput */
45 + XK_Zen_Koho: 0xff3d, /* Multiple/All Candidate(s) */
46 + XK_Mae_Koho: 0xff3e, /* Previous Candidate */
47 +
48 + /* Cursor control & motion */
49 +
50 + XK_Home: 0xff50,
51 + XK_Left: 0xff51, /* Move left, left arrow */
52 + XK_Up: 0xff52, /* Move up, up arrow */
53 + XK_Right: 0xff53, /* Move right, right arrow */
54 + XK_Down: 0xff54, /* Move down, down arrow */
55 + XK_Prior: 0xff55, /* Prior, previous */
56 + XK_Page_Up: 0xff55,
57 + XK_Next: 0xff56, /* Next */
58 + XK_Page_Down: 0xff56,
59 + XK_End: 0xff57, /* EOL */
60 + XK_Begin: 0xff58, /* BOL */
61 +
62 +
63 + /* Misc functions */
64 +
65 + XK_Select: 0xff60, /* Select, mark */
66 + XK_Print: 0xff61,
67 + XK_Execute: 0xff62, /* Execute, run, do */
68 + XK_Insert: 0xff63, /* Insert, insert here */
69 + XK_Undo: 0xff65,
70 + XK_Redo: 0xff66, /* Redo, again */
71 + XK_Menu: 0xff67,
72 + XK_Find: 0xff68, /* Find, search */
73 + XK_Cancel: 0xff69, /* Cancel, stop, abort, exit */
74 + XK_Help: 0xff6a, /* Help */
75 + XK_Break: 0xff6b,
76 + XK_Mode_switch: 0xff7e, /* Character set switch */
77 + XK_script_switch: 0xff7e, /* Alias for mode_switch */
78 + XK_Num_Lock: 0xff7f,
79 +
80 + /* Keypad functions, keypad numbers cleverly chosen to map to ASCII */
81 +
82 + XK_KP_Space: 0xff80, /* Space */
83 + XK_KP_Tab: 0xff89,
84 + XK_KP_Enter: 0xff8d, /* Enter */
85 + XK_KP_F1: 0xff91, /* PF1, KP_A, ... */
86 + XK_KP_F2: 0xff92,
87 + XK_KP_F3: 0xff93,
88 + XK_KP_F4: 0xff94,
89 + XK_KP_Home: 0xff95,
90 + XK_KP_Left: 0xff96,
91 + XK_KP_Up: 0xff97,
92 + XK_KP_Right: 0xff98,
93 + XK_KP_Down: 0xff99,
94 + XK_KP_Prior: 0xff9a,
95 + XK_KP_Page_Up: 0xff9a,
96 + XK_KP_Next: 0xff9b,
97 + XK_KP_Page_Down: 0xff9b,
98 + XK_KP_End: 0xff9c,
99 + XK_KP_Begin: 0xff9d,
100 + XK_KP_Insert: 0xff9e,
101 + XK_KP_Delete: 0xff9f,
102 + XK_KP_Equal: 0xffbd, /* Equals */
103 + XK_KP_Multiply: 0xffaa,
104 + XK_KP_Add: 0xffab,
105 + XK_KP_Separator: 0xffac, /* Separator, often comma */
106 + XK_KP_Subtract: 0xffad,
107 + XK_KP_Decimal: 0xffae,
108 + XK_KP_Divide: 0xffaf,
109 +
110 + XK_KP_0: 0xffb0,
111 + XK_KP_1: 0xffb1,
112 + XK_KP_2: 0xffb2,
113 + XK_KP_3: 0xffb3,
114 + XK_KP_4: 0xffb4,
115 + XK_KP_5: 0xffb5,
116 + XK_KP_6: 0xffb6,
117 + XK_KP_7: 0xffb7,
118 + XK_KP_8: 0xffb8,
119 + XK_KP_9: 0xffb9,
120 +
121 + /*
122 + * Auxiliary functions; note the duplicate definitions for left and right
123 + * function keys; Sun keyboards and a few other manufacturers have such
124 + * function key groups on the left and/or right sides of the keyboard.
125 + * We've not found a keyboard with more than 35 function keys total.
126 + */
127 +
128 + XK_F1: 0xffbe,
129 + XK_F2: 0xffbf,
130 + XK_F3: 0xffc0,
131 + XK_F4: 0xffc1,
132 + XK_F5: 0xffc2,
133 + XK_F6: 0xffc3,
134 + XK_F7: 0xffc4,
135 + XK_F8: 0xffc5,
136 + XK_F9: 0xffc6,
137 + XK_F10: 0xffc7,
138 + XK_F11: 0xffc8,
139 + XK_L1: 0xffc8,
140 + XK_F12: 0xffc9,
141 + XK_L2: 0xffc9,
142 + XK_F13: 0xffca,
143 + XK_L3: 0xffca,
144 + XK_F14: 0xffcb,
145 + XK_L4: 0xffcb,
146 + XK_F15: 0xffcc,
147 + XK_L5: 0xffcc,
148 + XK_F16: 0xffcd,
149 + XK_L6: 0xffcd,
150 + XK_F17: 0xffce,
151 + XK_L7: 0xffce,
152 + XK_F18: 0xffcf,
153 + XK_L8: 0xffcf,
154 + XK_F19: 0xffd0,
155 + XK_L9: 0xffd0,
156 + XK_F20: 0xffd1,
157 + XK_L10: 0xffd1,
158 + XK_F21: 0xffd2,
159 + XK_R1: 0xffd2,
160 + XK_F22: 0xffd3,
161 + XK_R2: 0xffd3,
162 + XK_F23: 0xffd4,
163 + XK_R3: 0xffd4,
164 + XK_F24: 0xffd5,
165 + XK_R4: 0xffd5,
166 + XK_F25: 0xffd6,
167 + XK_R5: 0xffd6,
168 + XK_F26: 0xffd7,
169 + XK_R6: 0xffd7,
170 + XK_F27: 0xffd8,
171 + XK_R7: 0xffd8,
172 + XK_F28: 0xffd9,
173 + XK_R8: 0xffd9,
174 + XK_F29: 0xffda,
175 + XK_R9: 0xffda,
176 + XK_F30: 0xffdb,
177 + XK_R10: 0xffdb,
178 + XK_F31: 0xffdc,
179 + XK_R11: 0xffdc,
180 + XK_F32: 0xffdd,
181 + XK_R12: 0xffdd,
182 + XK_F33: 0xffde,
183 + XK_R13: 0xffde,
184 + XK_F34: 0xffdf,
185 + XK_R14: 0xffdf,
186 + XK_F35: 0xffe0,
187 + XK_R15: 0xffe0,
188 +
189 + /* Modifiers */
190 +
191 + XK_Shift_L: 0xffe1, /* Left shift */
192 + XK_Shift_R: 0xffe2, /* Right shift */
193 + XK_Control_L: 0xffe3, /* Left control */
194 + XK_Control_R: 0xffe4, /* Right control */
195 + XK_Caps_Lock: 0xffe5, /* Caps lock */
196 + XK_Shift_Lock: 0xffe6, /* Shift lock */
197 +
198 + XK_Meta_L: 0xffe7, /* Left meta */
199 + XK_Meta_R: 0xffe8, /* Right meta */
200 + XK_Alt_L: 0xffe9, /* Left alt */
201 + XK_Alt_R: 0xffea, /* Right alt */
202 + XK_Super_L: 0xffeb, /* Left super */
203 + XK_Super_R: 0xffec, /* Right super */
204 + XK_Hyper_L: 0xffed, /* Left hyper */
205 + XK_Hyper_R: 0xffee, /* Right hyper */
206 +
207 + /*
208 + * Keyboard (XKB) Extension function and modifier keys
209 + * (from Appendix C of "The X Keyboard Extension: Protocol Specification")
210 + * Byte 3 = 0xfe
211 + */
212 +
213 + XK_ISO_Level3_Shift: 0xfe03, /* AltGr */
214 + XK_ISO_Next_Group: 0xfe08,
215 + XK_ISO_Prev_Group: 0xfe0a,
216 + XK_ISO_First_Group: 0xfe0c,
217 + XK_ISO_Last_Group: 0xfe0e,
218 +
219 + /*
220 + * Latin 1
221 + * (ISO/IEC 8859-1: Unicode U+0020..U+00FF)
222 + * Byte 3: 0
223 + */
224 +
225 + XK_space: 0x0020, /* U+0020 SPACE */
226 + XK_exclam: 0x0021, /* U+0021 EXCLAMATION MARK */
227 + XK_quotedbl: 0x0022, /* U+0022 QUOTATION MARK */
228 + XK_numbersign: 0x0023, /* U+0023 NUMBER SIGN */
229 + XK_dollar: 0x0024, /* U+0024 DOLLAR SIGN */
230 + XK_percent: 0x0025, /* U+0025 PERCENT SIGN */
231 + XK_ampersand: 0x0026, /* U+0026 AMPERSAND */
232 + XK_apostrophe: 0x0027, /* U+0027 APOSTROPHE */
233 + XK_quoteright: 0x0027, /* deprecated */
234 + XK_parenleft: 0x0028, /* U+0028 LEFT PARENTHESIS */
235 + XK_parenright: 0x0029, /* U+0029 RIGHT PARENTHESIS */
236 + XK_asterisk: 0x002a, /* U+002A ASTERISK */
237 + XK_plus: 0x002b, /* U+002B PLUS SIGN */
238 + XK_comma: 0x002c, /* U+002C COMMA */
239 + XK_minus: 0x002d, /* U+002D HYPHEN-MINUS */
240 + XK_period: 0x002e, /* U+002E FULL STOP */
241 + XK_slash: 0x002f, /* U+002F SOLIDUS */
242 + XK_0: 0x0030, /* U+0030 DIGIT ZERO */
243 + XK_1: 0x0031, /* U+0031 DIGIT ONE */
244 + XK_2: 0x0032, /* U+0032 DIGIT TWO */
245 + XK_3: 0x0033, /* U+0033 DIGIT THREE */
246 + XK_4: 0x0034, /* U+0034 DIGIT FOUR */
247 + XK_5: 0x0035, /* U+0035 DIGIT FIVE */
248 + XK_6: 0x0036, /* U+0036 DIGIT SIX */
249 + XK_7: 0x0037, /* U+0037 DIGIT SEVEN */
250 + XK_8: 0x0038, /* U+0038 DIGIT EIGHT */
251 + XK_9: 0x0039, /* U+0039 DIGIT NINE */
252 + XK_colon: 0x003a, /* U+003A COLON */
253 + XK_semicolon: 0x003b, /* U+003B SEMICOLON */
254 + XK_less: 0x003c, /* U+003C LESS-THAN SIGN */
255 + XK_equal: 0x003d, /* U+003D EQUALS SIGN */
256 + XK_greater: 0x003e, /* U+003E GREATER-THAN SIGN */
257 + XK_question: 0x003f, /* U+003F QUESTION MARK */
258 + XK_at: 0x0040, /* U+0040 COMMERCIAL AT */
259 + XK_A: 0x0041, /* U+0041 LATIN CAPITAL LETTER A */
260 + XK_B: 0x0042, /* U+0042 LATIN CAPITAL LETTER B */
261 + XK_C: 0x0043, /* U+0043 LATIN CAPITAL LETTER C */
262 + XK_D: 0x0044, /* U+0044 LATIN CAPITAL LETTER D */
263 + XK_E: 0x0045, /* U+0045 LATIN CAPITAL LETTER E */
264 + XK_F: 0x0046, /* U+0046 LATIN CAPITAL LETTER F */
265 + XK_G: 0x0047, /* U+0047 LATIN CAPITAL LETTER G */
266 + XK_H: 0x0048, /* U+0048 LATIN CAPITAL LETTER H */
267 + XK_I: 0x0049, /* U+0049 LATIN CAPITAL LETTER I */
268 + XK_J: 0x004a, /* U+004A LATIN CAPITAL LETTER J */
269 + XK_K: 0x004b, /* U+004B LATIN CAPITAL LETTER K */
270 + XK_L: 0x004c, /* U+004C LATIN CAPITAL LETTER L */
271 + XK_M: 0x004d, /* U+004D LATIN CAPITAL LETTER M */
272 + XK_N: 0x004e, /* U+004E LATIN CAPITAL LETTER N */
273 + XK_O: 0x004f, /* U+004F LATIN CAPITAL LETTER O */
274 + XK_P: 0x0050, /* U+0050 LATIN CAPITAL LETTER P */
275 + XK_Q: 0x0051, /* U+0051 LATIN CAPITAL LETTER Q */
276 + XK_R: 0x0052, /* U+0052 LATIN CAPITAL LETTER R */
277 + XK_S: 0x0053, /* U+0053 LATIN CAPITAL LETTER S */
278 + XK_T: 0x0054, /* U+0054 LATIN CAPITAL LETTER T */
279 + XK_U: 0x0055, /* U+0055 LATIN CAPITAL LETTER U */
280 + XK_V: 0x0056, /* U+0056 LATIN CAPITAL LETTER V */
281 + XK_W: 0x0057, /* U+0057 LATIN CAPITAL LETTER W */
282 + XK_X: 0x0058, /* U+0058 LATIN CAPITAL LETTER X */
283 + XK_Y: 0x0059, /* U+0059 LATIN CAPITAL LETTER Y */
284 + XK_Z: 0x005a, /* U+005A LATIN CAPITAL LETTER Z */
285 + XK_bracketleft: 0x005b, /* U+005B LEFT SQUARE BRACKET */
286 + XK_backslash: 0x005c, /* U+005C REVERSE SOLIDUS */
287 + XK_bracketright: 0x005d, /* U+005D RIGHT SQUARE BRACKET */
288 + XK_asciicircum: 0x005e, /* U+005E CIRCUMFLEX ACCENT */
289 + XK_underscore: 0x005f, /* U+005F LOW LINE */
290 + XK_grave: 0x0060, /* U+0060 GRAVE ACCENT */
291 + XK_quoteleft: 0x0060, /* deprecated */
292 + XK_a: 0x0061, /* U+0061 LATIN SMALL LETTER A */
293 + XK_b: 0x0062, /* U+0062 LATIN SMALL LETTER B */
294 + XK_c: 0x0063, /* U+0063 LATIN SMALL LETTER C */
295 + XK_d: 0x0064, /* U+0064 LATIN SMALL LETTER D */
296 + XK_e: 0x0065, /* U+0065 LATIN SMALL LETTER E */
297 + XK_f: 0x0066, /* U+0066 LATIN SMALL LETTER F */
298 + XK_g: 0x0067, /* U+0067 LATIN SMALL LETTER G */
299 + XK_h: 0x0068, /* U+0068 LATIN SMALL LETTER H */
300 + XK_i: 0x0069, /* U+0069 LATIN SMALL LETTER I */
301 + XK_j: 0x006a, /* U+006A LATIN SMALL LETTER J */
302 + XK_k: 0x006b, /* U+006B LATIN SMALL LETTER K */
303 + XK_l: 0x006c, /* U+006C LATIN SMALL LETTER L */
304 + XK_m: 0x006d, /* U+006D LATIN SMALL LETTER M */
305 + XK_n: 0x006e, /* U+006E LATIN SMALL LETTER N */
306 + XK_o: 0x006f, /* U+006F LATIN SMALL LETTER O */
307 + XK_p: 0x0070, /* U+0070 LATIN SMALL LETTER P */
308 + XK_q: 0x0071, /* U+0071 LATIN SMALL LETTER Q */
309 + XK_r: 0x0072, /* U+0072 LATIN SMALL LETTER R */
310 + XK_s: 0x0073, /* U+0073 LATIN SMALL LETTER S */
311 + XK_t: 0x0074, /* U+0074 LATIN SMALL LETTER T */
312 + XK_u: 0x0075, /* U+0075 LATIN SMALL LETTER U */
313 + XK_v: 0x0076, /* U+0076 LATIN SMALL LETTER V */
314 + XK_w: 0x0077, /* U+0077 LATIN SMALL LETTER W */
315 + XK_x: 0x0078, /* U+0078 LATIN SMALL LETTER X */
316 + XK_y: 0x0079, /* U+0079 LATIN SMALL LETTER Y */
317 + XK_z: 0x007a, /* U+007A LATIN SMALL LETTER Z */
318 + XK_braceleft: 0x007b, /* U+007B LEFT CURLY BRACKET */
319 + XK_bar: 0x007c, /* U+007C VERTICAL LINE */
320 + XK_braceright: 0x007d, /* U+007D RIGHT CURLY BRACKET */
321 + XK_asciitilde: 0x007e, /* U+007E TILDE */
322 +
323 + XK_nobreakspace: 0x00a0, /* U+00A0 NO-BREAK SPACE */
324 + XK_exclamdown: 0x00a1, /* U+00A1 INVERTED EXCLAMATION MARK */
325 + XK_cent: 0x00a2, /* U+00A2 CENT SIGN */
326 + XK_sterling: 0x00a3, /* U+00A3 POUND SIGN */
327 + XK_currency: 0x00a4, /* U+00A4 CURRENCY SIGN */
328 + XK_yen: 0x00a5, /* U+00A5 YEN SIGN */
329 + XK_brokenbar: 0x00a6, /* U+00A6 BROKEN BAR */
330 + XK_section: 0x00a7, /* U+00A7 SECTION SIGN */
331 + XK_diaeresis: 0x00a8, /* U+00A8 DIAERESIS */
332 + XK_copyright: 0x00a9, /* U+00A9 COPYRIGHT SIGN */
333 + XK_ordfeminine: 0x00aa, /* U+00AA FEMININE ORDINAL INDICATOR */
334 + XK_guillemotleft: 0x00ab, /* U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */
335 + XK_notsign: 0x00ac, /* U+00AC NOT SIGN */
336 + XK_hyphen: 0x00ad, /* U+00AD SOFT HYPHEN */
337 + XK_registered: 0x00ae, /* U+00AE REGISTERED SIGN */
338 + XK_macron: 0x00af, /* U+00AF MACRON */
339 + XK_degree: 0x00b0, /* U+00B0 DEGREE SIGN */
340 + XK_plusminus: 0x00b1, /* U+00B1 PLUS-MINUS SIGN */
341 + XK_twosuperior: 0x00b2, /* U+00B2 SUPERSCRIPT TWO */
342 + XK_threesuperior: 0x00b3, /* U+00B3 SUPERSCRIPT THREE */
343 + XK_acute: 0x00b4, /* U+00B4 ACUTE ACCENT */
344 + XK_mu: 0x00b5, /* U+00B5 MICRO SIGN */
345 + XK_paragraph: 0x00b6, /* U+00B6 PILCROW SIGN */
346 + XK_periodcentered: 0x00b7, /* U+00B7 MIDDLE DOT */
347 + XK_cedilla: 0x00b8, /* U+00B8 CEDILLA */
348 + XK_onesuperior: 0x00b9, /* U+00B9 SUPERSCRIPT ONE */
349 + XK_masculine: 0x00ba, /* U+00BA MASCULINE ORDINAL INDICATOR */
350 + XK_guillemotright: 0x00bb, /* U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */
351 + XK_onequarter: 0x00bc, /* U+00BC VULGAR FRACTION ONE QUARTER */
352 + XK_onehalf: 0x00bd, /* U+00BD VULGAR FRACTION ONE HALF */
353 + XK_threequarters: 0x00be, /* U+00BE VULGAR FRACTION THREE QUARTERS */
354 + XK_questiondown: 0x00bf, /* U+00BF INVERTED QUESTION MARK */
355 + XK_Agrave: 0x00c0, /* U+00C0 LATIN CAPITAL LETTER A WITH GRAVE */
356 + XK_Aacute: 0x00c1, /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */
357 + XK_Acircumflex: 0x00c2, /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
358 + XK_Atilde: 0x00c3, /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */
359 + XK_Adiaeresis: 0x00c4, /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */
360 + XK_Aring: 0x00c5, /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */
361 + XK_AE: 0x00c6, /* U+00C6 LATIN CAPITAL LETTER AE */
362 + XK_Ccedilla: 0x00c7, /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */
363 + XK_Egrave: 0x00c8, /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */
364 + XK_Eacute: 0x00c9, /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */
365 + XK_Ecircumflex: 0x00ca, /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
366 + XK_Ediaeresis: 0x00cb, /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */
367 + XK_Igrave: 0x00cc, /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */
368 + XK_Iacute: 0x00cd, /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */
369 + XK_Icircumflex: 0x00ce, /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
370 + XK_Idiaeresis: 0x00cf, /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */
371 + XK_ETH: 0x00d0, /* U+00D0 LATIN CAPITAL LETTER ETH */
372 + XK_Eth: 0x00d0, /* deprecated */
373 + XK_Ntilde: 0x00d1, /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */
374 + XK_Ograve: 0x00d2, /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */
375 + XK_Oacute: 0x00d3, /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */
376 + XK_Ocircumflex: 0x00d4, /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
377 + XK_Otilde: 0x00d5, /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */
378 + XK_Odiaeresis: 0x00d6, /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */
379 + XK_multiply: 0x00d7, /* U+00D7 MULTIPLICATION SIGN */
380 + XK_Oslash: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
381 + XK_Ooblique: 0x00d8, /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
382 + XK_Ugrave: 0x00d9, /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */
383 + XK_Uacute: 0x00da, /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */
384 + XK_Ucircumflex: 0x00db, /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
385 + XK_Udiaeresis: 0x00dc, /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */
386 + XK_Yacute: 0x00dd, /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */
387 + XK_THORN: 0x00de, /* U+00DE LATIN CAPITAL LETTER THORN */
388 + XK_Thorn: 0x00de, /* deprecated */
389 + XK_ssharp: 0x00df, /* U+00DF LATIN SMALL LETTER SHARP S */
390 + XK_agrave: 0x00e0, /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */
391 + XK_aacute: 0x00e1, /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */
392 + XK_acircumflex: 0x00e2, /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */
393 + XK_atilde: 0x00e3, /* U+00E3 LATIN SMALL LETTER A WITH TILDE */
394 + XK_adiaeresis: 0x00e4, /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */
395 + XK_aring: 0x00e5, /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */
396 + XK_ae: 0x00e6, /* U+00E6 LATIN SMALL LETTER AE */
397 + XK_ccedilla: 0x00e7, /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */
398 + XK_egrave: 0x00e8, /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */
399 + XK_eacute: 0x00e9, /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */
400 + XK_ecircumflex: 0x00ea, /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */
401 + XK_ediaeresis: 0x00eb, /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */
402 + XK_igrave: 0x00ec, /* U+00EC LATIN SMALL LETTER I WITH GRAVE */
403 + XK_iacute: 0x00ed, /* U+00ED LATIN SMALL LETTER I WITH ACUTE */
404 + XK_icircumflex: 0x00ee, /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */
405 + XK_idiaeresis: 0x00ef, /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */
406 + XK_eth: 0x00f0, /* U+00F0 LATIN SMALL LETTER ETH */
407 + XK_ntilde: 0x00f1, /* U+00F1 LATIN SMALL LETTER N WITH TILDE */
408 + XK_ograve: 0x00f2, /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */
409 + XK_oacute: 0x00f3, /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */
410 + XK_ocircumflex: 0x00f4, /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */
411 + XK_otilde: 0x00f5, /* U+00F5 LATIN SMALL LETTER O WITH TILDE */
412 + XK_odiaeresis: 0x00f6, /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */
413 + XK_division: 0x00f7, /* U+00F7 DIVISION SIGN */
414 + XK_oslash: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
415 + XK_ooblique: 0x00f8, /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
416 + XK_ugrave: 0x00f9, /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */
417 + XK_uacute: 0x00fa, /* U+00FA LATIN SMALL LETTER U WITH ACUTE */
418 + XK_ucircumflex: 0x00fb, /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */
419 + XK_udiaeresis: 0x00fc, /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */
420 + XK_yacute: 0x00fd, /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */
421 + XK_thorn: 0x00fe, /* U+00FE LATIN SMALL LETTER THORN */
422 + XK_ydiaeresis: 0x00ff, /* U+00FF LATIN SMALL LETTER Y WITH DIAERESIS */
423 +
424 + /*
425 + * Korean
426 + * Byte 3 = 0x0e
427 + */
428 +
429 + XK_Hangul: 0xff31, /* Hangul start/stop(toggle) */
430 + XK_Hangul_Hanja: 0xff34, /* Start Hangul->Hanja Conversion */
431 + XK_Hangul_Jeonja: 0xff38, /* Jeonja mode */
432 +
433 + /*
434 + * XFree86 vendor specific keysyms.
435 + *
436 + * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
437 + */
438 +
439 + XF86XK_ModeLock: 0x1008FF01,
440 + XF86XK_MonBrightnessUp: 0x1008FF02,
441 + XF86XK_MonBrightnessDown: 0x1008FF03,
442 + XF86XK_KbdLightOnOff: 0x1008FF04,
443 + XF86XK_KbdBrightnessUp: 0x1008FF05,
444 + XF86XK_KbdBrightnessDown: 0x1008FF06,
445 + XF86XK_Standby: 0x1008FF10,
446 + XF86XK_AudioLowerVolume: 0x1008FF11,
447 + XF86XK_AudioMute: 0x1008FF12,
448 + XF86XK_AudioRaiseVolume: 0x1008FF13,
449 + XF86XK_AudioPlay: 0x1008FF14,
450 + XF86XK_AudioStop: 0x1008FF15,
451 + XF86XK_AudioPrev: 0x1008FF16,
452 + XF86XK_AudioNext: 0x1008FF17,
453 + XF86XK_HomePage: 0x1008FF18,
454 + XF86XK_Mail: 0x1008FF19,
455 + XF86XK_Start: 0x1008FF1A,
456 + XF86XK_Search: 0x1008FF1B,
457 + XF86XK_AudioRecord: 0x1008FF1C,
458 + XF86XK_Calculator: 0x1008FF1D,
459 + XF86XK_Memo: 0x1008FF1E,
460 + XF86XK_ToDoList: 0x1008FF1F,
461 + XF86XK_Calendar: 0x1008FF20,
462 + XF86XK_PowerDown: 0x1008FF21,
463 + XF86XK_ContrastAdjust: 0x1008FF22,
464 + XF86XK_RockerUp: 0x1008FF23,
465 + XF86XK_RockerDown: 0x1008FF24,
466 + XF86XK_RockerEnter: 0x1008FF25,
467 + XF86XK_Back: 0x1008FF26,
468 + XF86XK_Forward: 0x1008FF27,
469 + XF86XK_Stop: 0x1008FF28,
470 + XF86XK_Refresh: 0x1008FF29,
471 + XF86XK_PowerOff: 0x1008FF2A,
472 + XF86XK_WakeUp: 0x1008FF2B,
473 + XF86XK_Eject: 0x1008FF2C,
474 + XF86XK_ScreenSaver: 0x1008FF2D,
475 + XF86XK_WWW: 0x1008FF2E,
476 + XF86XK_Sleep: 0x1008FF2F,
477 + XF86XK_Favorites: 0x1008FF30,
478 + XF86XK_AudioPause: 0x1008FF31,
479 + XF86XK_AudioMedia: 0x1008FF32,
480 + XF86XK_MyComputer: 0x1008FF33,
481 + XF86XK_VendorHome: 0x1008FF34,
482 + XF86XK_LightBulb: 0x1008FF35,
483 + XF86XK_Shop: 0x1008FF36,
484 + XF86XK_History: 0x1008FF37,
485 + XF86XK_OpenURL: 0x1008FF38,
486 + XF86XK_AddFavorite: 0x1008FF39,
487 + XF86XK_HotLinks: 0x1008FF3A,
488 + XF86XK_BrightnessAdjust: 0x1008FF3B,
489 + XF86XK_Finance: 0x1008FF3C,
490 + XF86XK_Community: 0x1008FF3D,
491 + XF86XK_AudioRewind: 0x1008FF3E,
492 + XF86XK_BackForward: 0x1008FF3F,
493 + XF86XK_Launch0: 0x1008FF40,
494 + XF86XK_Launch1: 0x1008FF41,
495 + XF86XK_Launch2: 0x1008FF42,
496 + XF86XK_Launch3: 0x1008FF43,
497 + XF86XK_Launch4: 0x1008FF44,
498 + XF86XK_Launch5: 0x1008FF45,
499 + XF86XK_Launch6: 0x1008FF46,
500 + XF86XK_Launch7: 0x1008FF47,
501 + XF86XK_Launch8: 0x1008FF48,
502 + XF86XK_Launch9: 0x1008FF49,
503 + XF86XK_LaunchA: 0x1008FF4A,
504 + XF86XK_LaunchB: 0x1008FF4B,
505 + XF86XK_LaunchC: 0x1008FF4C,
506 + XF86XK_LaunchD: 0x1008FF4D,
507 + XF86XK_LaunchE: 0x1008FF4E,
508 + XF86XK_LaunchF: 0x1008FF4F,
509 + XF86XK_ApplicationLeft: 0x1008FF50,
510 + XF86XK_ApplicationRight: 0x1008FF51,
511 + XF86XK_Book: 0x1008FF52,
512 + XF86XK_CD: 0x1008FF53,
513 + XF86XK_Calculater: 0x1008FF54,
514 + XF86XK_Clear: 0x1008FF55,
515 + XF86XK_Close: 0x1008FF56,
516 + XF86XK_Copy: 0x1008FF57,
517 + XF86XK_Cut: 0x1008FF58,
518 + XF86XK_Display: 0x1008FF59,
519 + XF86XK_DOS: 0x1008FF5A,
520 + XF86XK_Documents: 0x1008FF5B,
521 + XF86XK_Excel: 0x1008FF5C,
522 + XF86XK_Explorer: 0x1008FF5D,
523 + XF86XK_Game: 0x1008FF5E,
524 + XF86XK_Go: 0x1008FF5F,
525 + XF86XK_iTouch: 0x1008FF60,
526 + XF86XK_LogOff: 0x1008FF61,
527 + XF86XK_Market: 0x1008FF62,
528 + XF86XK_Meeting: 0x1008FF63,
529 + XF86XK_MenuKB: 0x1008FF65,
530 + XF86XK_MenuPB: 0x1008FF66,
531 + XF86XK_MySites: 0x1008FF67,
532 + XF86XK_New: 0x1008FF68,
533 + XF86XK_News: 0x1008FF69,
534 + XF86XK_OfficeHome: 0x1008FF6A,
535 + XF86XK_Open: 0x1008FF6B,
536 + XF86XK_Option: 0x1008FF6C,
537 + XF86XK_Paste: 0x1008FF6D,
538 + XF86XK_Phone: 0x1008FF6E,
539 + XF86XK_Q: 0x1008FF70,
540 + XF86XK_Reply: 0x1008FF72,
541 + XF86XK_Reload: 0x1008FF73,
542 + XF86XK_RotateWindows: 0x1008FF74,
543 + XF86XK_RotationPB: 0x1008FF75,
544 + XF86XK_RotationKB: 0x1008FF76,
545 + XF86XK_Save: 0x1008FF77,
546 + XF86XK_ScrollUp: 0x1008FF78,
547 + XF86XK_ScrollDown: 0x1008FF79,
548 + XF86XK_ScrollClick: 0x1008FF7A,
549 + XF86XK_Send: 0x1008FF7B,
550 + XF86XK_Spell: 0x1008FF7C,
551 + XF86XK_SplitScreen: 0x1008FF7D,
552 + XF86XK_Support: 0x1008FF7E,
553 + XF86XK_TaskPane: 0x1008FF7F,
554 + XF86XK_Terminal: 0x1008FF80,
555 + XF86XK_Tools: 0x1008FF81,
556 + XF86XK_Travel: 0x1008FF82,
557 + XF86XK_UserPB: 0x1008FF84,
558 + XF86XK_User1KB: 0x1008FF85,
559 + XF86XK_User2KB: 0x1008FF86,
560 + XF86XK_Video: 0x1008FF87,
561 + XF86XK_WheelButton: 0x1008FF88,
562 + XF86XK_Word: 0x1008FF89,
563 + XF86XK_Xfer: 0x1008FF8A,
564 + XF86XK_ZoomIn: 0x1008FF8B,
565 + XF86XK_ZoomOut: 0x1008FF8C,
566 + XF86XK_Away: 0x1008FF8D,
567 + XF86XK_Messenger: 0x1008FF8E,
568 + XF86XK_WebCam: 0x1008FF8F,
569 + XF86XK_MailForward: 0x1008FF90,
570 + XF86XK_Pictures: 0x1008FF91,
571 + XF86XK_Music: 0x1008FF92,
572 + XF86XK_Battery: 0x1008FF93,
573 + XF86XK_Bluetooth: 0x1008FF94,
574 + XF86XK_WLAN: 0x1008FF95,
575 + XF86XK_UWB: 0x1008FF96,
576 + XF86XK_AudioForward: 0x1008FF97,
577 + XF86XK_AudioRepeat: 0x1008FF98,
578 + XF86XK_AudioRandomPlay: 0x1008FF99,
579 + XF86XK_Subtitle: 0x1008FF9A,
580 + XF86XK_AudioCycleTrack: 0x1008FF9B,
581 + XF86XK_CycleAngle: 0x1008FF9C,
582 + XF86XK_FrameBack: 0x1008FF9D,
583 + XF86XK_FrameForward: 0x1008FF9E,
584 + XF86XK_Time: 0x1008FF9F,
585 + XF86XK_Select: 0x1008FFA0,
586 + XF86XK_View: 0x1008FFA1,
587 + XF86XK_TopMenu: 0x1008FFA2,
588 + XF86XK_Red: 0x1008FFA3,
589 + XF86XK_Green: 0x1008FFA4,
590 + XF86XK_Yellow: 0x1008FFA5,
591 + XF86XK_Blue: 0x1008FFA6,
592 + XF86XK_Suspend: 0x1008FFA7,
593 + XF86XK_Hibernate: 0x1008FFA8,
594 + XF86XK_TouchpadToggle: 0x1008FFA9,
595 + XF86XK_TouchpadOn: 0x1008FFB0,
596 + XF86XK_TouchpadOff: 0x1008FFB1,
597 + XF86XK_AudioMicMute: 0x1008FFB2,
598 + XF86XK_Switch_VT_1: 0x1008FE01,
599 + XF86XK_Switch_VT_2: 0x1008FE02,
600 + XF86XK_Switch_VT_3: 0x1008FE03,
601 + XF86XK_Switch_VT_4: 0x1008FE04,
602 + XF86XK_Switch_VT_5: 0x1008FE05,
603 + XF86XK_Switch_VT_6: 0x1008FE06,
604 + XF86XK_Switch_VT_7: 0x1008FE07,
605 + XF86XK_Switch_VT_8: 0x1008FE08,
606 + XF86XK_Switch_VT_9: 0x1008FE09,
607 + XF86XK_Switch_VT_10: 0x1008FE0A,
608 + XF86XK_Switch_VT_11: 0x1008FE0B,
609 + XF86XK_Switch_VT_12: 0x1008FE0C,
610 + XF86XK_Ungrab: 0x1008FE20,
611 + XF86XK_ClearGrab: 0x1008FE21,
612 + XF86XK_Next_VMode: 0x1008FE22,
613 + XF86XK_Prev_VMode: 0x1008FE23,
614 + XF86XK_LogWindowTree: 0x1008FE24,
615 + XF86XK_LogGrabInfo: 0x1008FE25,
616 +};
public/novnc/core/input/keysymdef.js new
+688
@@ -0,0 +1,688 @@
1 +/*
2 + * Mapping from Unicode codepoints to X11/RFB keysyms
3 + *
4 + * This file was automatically generated from keysymdef.h
5 + * DO NOT EDIT!
6 + */
7 +
8 +/* Functions at the bottom */
9 +
10 +const codepoints = {
11 + 0x0100: 0x03c0, // XK_Amacron
12 + 0x0101: 0x03e0, // XK_amacron
13 + 0x0102: 0x01c3, // XK_Abreve
14 + 0x0103: 0x01e3, // XK_abreve
15 + 0x0104: 0x01a1, // XK_Aogonek
16 + 0x0105: 0x01b1, // XK_aogonek
17 + 0x0106: 0x01c6, // XK_Cacute
18 + 0x0107: 0x01e6, // XK_cacute
19 + 0x0108: 0x02c6, // XK_Ccircumflex
20 + 0x0109: 0x02e6, // XK_ccircumflex
21 + 0x010a: 0x02c5, // XK_Cabovedot
22 + 0x010b: 0x02e5, // XK_cabovedot
23 + 0x010c: 0x01c8, // XK_Ccaron
24 + 0x010d: 0x01e8, // XK_ccaron
25 + 0x010e: 0x01cf, // XK_Dcaron
26 + 0x010f: 0x01ef, // XK_dcaron
27 + 0x0110: 0x01d0, // XK_Dstroke
28 + 0x0111: 0x01f0, // XK_dstroke
29 + 0x0112: 0x03aa, // XK_Emacron
30 + 0x0113: 0x03ba, // XK_emacron
31 + 0x0116: 0x03cc, // XK_Eabovedot
32 + 0x0117: 0x03ec, // XK_eabovedot
33 + 0x0118: 0x01ca, // XK_Eogonek
34 + 0x0119: 0x01ea, // XK_eogonek
35 + 0x011a: 0x01cc, // XK_Ecaron
36 + 0x011b: 0x01ec, // XK_ecaron
37 + 0x011c: 0x02d8, // XK_Gcircumflex
38 + 0x011d: 0x02f8, // XK_gcircumflex
39 + 0x011e: 0x02ab, // XK_Gbreve
40 + 0x011f: 0x02bb, // XK_gbreve
41 + 0x0120: 0x02d5, // XK_Gabovedot
42 + 0x0121: 0x02f5, // XK_gabovedot
43 + 0x0122: 0x03ab, // XK_Gcedilla
44 + 0x0123: 0x03bb, // XK_gcedilla
45 + 0x0124: 0x02a6, // XK_Hcircumflex
46 + 0x0125: 0x02b6, // XK_hcircumflex
47 + 0x0126: 0x02a1, // XK_Hstroke
48 + 0x0127: 0x02b1, // XK_hstroke
49 + 0x0128: 0x03a5, // XK_Itilde
50 + 0x0129: 0x03b5, // XK_itilde
51 + 0x012a: 0x03cf, // XK_Imacron
52 + 0x012b: 0x03ef, // XK_imacron
53 + 0x012e: 0x03c7, // XK_Iogonek
54 + 0x012f: 0x03e7, // XK_iogonek
55 + 0x0130: 0x02a9, // XK_Iabovedot
56 + 0x0131: 0x02b9, // XK_idotless
57 + 0x0134: 0x02ac, // XK_Jcircumflex
58 + 0x0135: 0x02bc, // XK_jcircumflex
59 + 0x0136: 0x03d3, // XK_Kcedilla
60 + 0x0137: 0x03f3, // XK_kcedilla
61 + 0x0138: 0x03a2, // XK_kra
62 + 0x0139: 0x01c5, // XK_Lacute
63 + 0x013a: 0x01e5, // XK_lacute
64 + 0x013b: 0x03a6, // XK_Lcedilla
65 + 0x013c: 0x03b6, // XK_lcedilla
66 + 0x013d: 0x01a5, // XK_Lcaron
67 + 0x013e: 0x01b5, // XK_lcaron
68 + 0x0141: 0x01a3, // XK_Lstroke
69 + 0x0142: 0x01b3, // XK_lstroke
70 + 0x0143: 0x01d1, // XK_Nacute
71 + 0x0144: 0x01f1, // XK_nacute
72 + 0x0145: 0x03d1, // XK_Ncedilla
73 + 0x0146: 0x03f1, // XK_ncedilla
74 + 0x0147: 0x01d2, // XK_Ncaron
75 + 0x0148: 0x01f2, // XK_ncaron
76 + 0x014a: 0x03bd, // XK_ENG
77 + 0x014b: 0x03bf, // XK_eng
78 + 0x014c: 0x03d2, // XK_Omacron
79 + 0x014d: 0x03f2, // XK_omacron
80 + 0x0150: 0x01d5, // XK_Odoubleacute
81 + 0x0151: 0x01f5, // XK_odoubleacute
82 + 0x0152: 0x13bc, // XK_OE
83 + 0x0153: 0x13bd, // XK_oe
84 + 0x0154: 0x01c0, // XK_Racute
85 + 0x0155: 0x01e0, // XK_racute
86 + 0x0156: 0x03a3, // XK_Rcedilla
87 + 0x0157: 0x03b3, // XK_rcedilla
88 + 0x0158: 0x01d8, // XK_Rcaron
89 + 0x0159: 0x01f8, // XK_rcaron
90 + 0x015a: 0x01a6, // XK_Sacute
91 + 0x015b: 0x01b6, // XK_sacute
92 + 0x015c: 0x02de, // XK_Scircumflex
93 + 0x015d: 0x02fe, // XK_scircumflex
94 + 0x015e: 0x01aa, // XK_Scedilla
95 + 0x015f: 0x01ba, // XK_scedilla
96 + 0x0160: 0x01a9, // XK_Scaron
97 + 0x0161: 0x01b9, // XK_scaron
98 + 0x0162: 0x01de, // XK_Tcedilla
99 + 0x0163: 0x01fe, // XK_tcedilla
100 + 0x0164: 0x01ab, // XK_Tcaron
101 + 0x0165: 0x01bb, // XK_tcaron
102 + 0x0166: 0x03ac, // XK_Tslash
103 + 0x0167: 0x03bc, // XK_tslash
104 + 0x0168: 0x03dd, // XK_Utilde
105 + 0x0169: 0x03fd, // XK_utilde
106 + 0x016a: 0x03de, // XK_Umacron
107 + 0x016b: 0x03fe, // XK_umacron
108 + 0x016c: 0x02dd, // XK_Ubreve
109 + 0x016d: 0x02fd, // XK_ubreve
110 + 0x016e: 0x01d9, // XK_Uring
111 + 0x016f: 0x01f9, // XK_uring
112 + 0x0170: 0x01db, // XK_Udoubleacute
113 + 0x0171: 0x01fb, // XK_udoubleacute
114 + 0x0172: 0x03d9, // XK_Uogonek
115 + 0x0173: 0x03f9, // XK_uogonek
116 + 0x0178: 0x13be, // XK_Ydiaeresis
117 + 0x0179: 0x01ac, // XK_Zacute
118 + 0x017a: 0x01bc, // XK_zacute
119 + 0x017b: 0x01af, // XK_Zabovedot
120 + 0x017c: 0x01bf, // XK_zabovedot
121 + 0x017d: 0x01ae, // XK_Zcaron
122 + 0x017e: 0x01be, // XK_zcaron
123 + 0x0192: 0x08f6, // XK_function
124 + 0x01d2: 0x10001d1, // XK_Ocaron
125 + 0x02c7: 0x01b7, // XK_caron
126 + 0x02d8: 0x01a2, // XK_breve
127 + 0x02d9: 0x01ff, // XK_abovedot
128 + 0x02db: 0x01b2, // XK_ogonek
129 + 0x02dd: 0x01bd, // XK_doubleacute
130 + 0x0385: 0x07ae, // XK_Greek_accentdieresis
131 + 0x0386: 0x07a1, // XK_Greek_ALPHAaccent
132 + 0x0388: 0x07a2, // XK_Greek_EPSILONaccent
133 + 0x0389: 0x07a3, // XK_Greek_ETAaccent
134 + 0x038a: 0x07a4, // XK_Greek_IOTAaccent
135 + 0x038c: 0x07a7, // XK_Greek_OMICRONaccent
136 + 0x038e: 0x07a8, // XK_Greek_UPSILONaccent
137 + 0x038f: 0x07ab, // XK_Greek_OMEGAaccent
138 + 0x0390: 0x07b6, // XK_Greek_iotaaccentdieresis
139 + 0x0391: 0x07c1, // XK_Greek_ALPHA
140 + 0x0392: 0x07c2, // XK_Greek_BETA
141 + 0x0393: 0x07c3, // XK_Greek_GAMMA
142 + 0x0394: 0x07c4, // XK_Greek_DELTA
143 + 0x0395: 0x07c5, // XK_Greek_EPSILON
144 + 0x0396: 0x07c6, // XK_Greek_ZETA
145 + 0x0397: 0x07c7, // XK_Greek_ETA
146 + 0x0398: 0x07c8, // XK_Greek_THETA
147 + 0x0399: 0x07c9, // XK_Greek_IOTA
148 + 0x039a: 0x07ca, // XK_Greek_KAPPA
149 + 0x039b: 0x07cb, // XK_Greek_LAMDA
150 + 0x039c: 0x07cc, // XK_Greek_MU
151 + 0x039d: 0x07cd, // XK_Greek_NU
152 + 0x039e: 0x07ce, // XK_Greek_XI
153 + 0x039f: 0x07cf, // XK_Greek_OMICRON
154 + 0x03a0: 0x07d0, // XK_Greek_PI
155 + 0x03a1: 0x07d1, // XK_Greek_RHO
156 + 0x03a3: 0x07d2, // XK_Greek_SIGMA
157 + 0x03a4: 0x07d4, // XK_Greek_TAU
158 + 0x03a5: 0x07d5, // XK_Greek_UPSILON
159 + 0x03a6: 0x07d6, // XK_Greek_PHI
160 + 0x03a7: 0x07d7, // XK_Greek_CHI
161 + 0x03a8: 0x07d8, // XK_Greek_PSI
162 + 0x03a9: 0x07d9, // XK_Greek_OMEGA
163 + 0x03aa: 0x07a5, // XK_Greek_IOTAdieresis
164 + 0x03ab: 0x07a9, // XK_Greek_UPSILONdieresis
165 + 0x03ac: 0x07b1, // XK_Greek_alphaaccent
166 + 0x03ad: 0x07b2, // XK_Greek_epsilonaccent
167 + 0x03ae: 0x07b3, // XK_Greek_etaaccent
168 + 0x03af: 0x07b4, // XK_Greek_iotaaccent
169 + 0x03b0: 0x07ba, // XK_Greek_upsilonaccentdieresis
170 + 0x03b1: 0x07e1, // XK_Greek_alpha
171 + 0x03b2: 0x07e2, // XK_Greek_beta
172 + 0x03b3: 0x07e3, // XK_Greek_gamma
173 + 0x03b4: 0x07e4, // XK_Greek_delta
174 + 0x03b5: 0x07e5, // XK_Greek_epsilon
175 + 0x03b6: 0x07e6, // XK_Greek_zeta
176 + 0x03b7: 0x07e7, // XK_Greek_eta
177 + 0x03b8: 0x07e8, // XK_Greek_theta
178 + 0x03b9: 0x07e9, // XK_Greek_iota
179 + 0x03ba: 0x07ea, // XK_Greek_kappa
180 + 0x03bb: 0x07eb, // XK_Greek_lamda
181 + 0x03bc: 0x07ec, // XK_Greek_mu
182 + 0x03bd: 0x07ed, // XK_Greek_nu
183 + 0x03be: 0x07ee, // XK_Greek_xi
184 + 0x03bf: 0x07ef, // XK_Greek_omicron
185 + 0x03c0: 0x07f0, // XK_Greek_pi
186 + 0x03c1: 0x07f1, // XK_Greek_rho
187 + 0x03c2: 0x07f3, // XK_Greek_finalsmallsigma
188 + 0x03c3: 0x07f2, // XK_Greek_sigma
189 + 0x03c4: 0x07f4, // XK_Greek_tau
190 + 0x03c5: 0x07f5, // XK_Greek_upsilon
191 + 0x03c6: 0x07f6, // XK_Greek_phi
192 + 0x03c7: 0x07f7, // XK_Greek_chi
193 + 0x03c8: 0x07f8, // XK_Greek_psi
194 + 0x03c9: 0x07f9, // XK_Greek_omega
195 + 0x03ca: 0x07b5, // XK_Greek_iotadieresis
196 + 0x03cb: 0x07b9, // XK_Greek_upsilondieresis
197 + 0x03cc: 0x07b7, // XK_Greek_omicronaccent
198 + 0x03cd: 0x07b8, // XK_Greek_upsilonaccent
199 + 0x03ce: 0x07bb, // XK_Greek_omegaaccent
200 + 0x0401: 0x06b3, // XK_Cyrillic_IO
201 + 0x0402: 0x06b1, // XK_Serbian_DJE
202 + 0x0403: 0x06b2, // XK_Macedonia_GJE
203 + 0x0404: 0x06b4, // XK_Ukrainian_IE
204 + 0x0405: 0x06b5, // XK_Macedonia_DSE
205 + 0x0406: 0x06b6, // XK_Ukrainian_I
206 + 0x0407: 0x06b7, // XK_Ukrainian_YI
207 + 0x0408: 0x06b8, // XK_Cyrillic_JE
208 + 0x0409: 0x06b9, // XK_Cyrillic_LJE
209 + 0x040a: 0x06ba, // XK_Cyrillic_NJE
210 + 0x040b: 0x06bb, // XK_Serbian_TSHE
211 + 0x040c: 0x06bc, // XK_Macedonia_KJE
212 + 0x040e: 0x06be, // XK_Byelorussian_SHORTU
213 + 0x040f: 0x06bf, // XK_Cyrillic_DZHE
214 + 0x0410: 0x06e1, // XK_Cyrillic_A
215 + 0x0411: 0x06e2, // XK_Cyrillic_BE
216 + 0x0412: 0x06f7, // XK_Cyrillic_VE
217 + 0x0413: 0x06e7, // XK_Cyrillic_GHE
218 + 0x0414: 0x06e4, // XK_Cyrillic_DE
219 + 0x0415: 0x06e5, // XK_Cyrillic_IE
220 + 0x0416: 0x06f6, // XK_Cyrillic_ZHE
221 + 0x0417: 0x06fa, // XK_Cyrillic_ZE
222 + 0x0418: 0x06e9, // XK_Cyrillic_I
223 + 0x0419: 0x06ea, // XK_Cyrillic_SHORTI
224 + 0x041a: 0x06eb, // XK_Cyrillic_KA
225 + 0x041b: 0x06ec, // XK_Cyrillic_EL
226 + 0x041c: 0x06ed, // XK_Cyrillic_EM
227 + 0x041d: 0x06ee, // XK_Cyrillic_EN
228 + 0x041e: 0x06ef, // XK_Cyrillic_O
229 + 0x041f: 0x06f0, // XK_Cyrillic_PE
230 + 0x0420: 0x06f2, // XK_Cyrillic_ER
231 + 0x0421: 0x06f3, // XK_Cyrillic_ES
232 + 0x0422: 0x06f4, // XK_Cyrillic_TE
233 + 0x0423: 0x06f5, // XK_Cyrillic_U
234 + 0x0424: 0x06e6, // XK_Cyrillic_EF
235 + 0x0425: 0x06e8, // XK_Cyrillic_HA
236 + 0x0426: 0x06e3, // XK_Cyrillic_TSE
237 + 0x0427: 0x06fe, // XK_Cyrillic_CHE
238 + 0x0428: 0x06fb, // XK_Cyrillic_SHA
239 + 0x0429: 0x06fd, // XK_Cyrillic_SHCHA
240 + 0x042a: 0x06ff, // XK_Cyrillic_HARDSIGN
241 + 0x042b: 0x06f9, // XK_Cyrillic_YERU
242 + 0x042c: 0x06f8, // XK_Cyrillic_SOFTSIGN
243 + 0x042d: 0x06fc, // XK_Cyrillic_E
244 + 0x042e: 0x06e0, // XK_Cyrillic_YU
245 + 0x042f: 0x06f1, // XK_Cyrillic_YA
246 + 0x0430: 0x06c1, // XK_Cyrillic_a
247 + 0x0431: 0x06c2, // XK_Cyrillic_be
248 + 0x0432: 0x06d7, // XK_Cyrillic_ve
249 + 0x0433: 0x06c7, // XK_Cyrillic_ghe
250 + 0x0434: 0x06c4, // XK_Cyrillic_de
251 + 0x0435: 0x06c5, // XK_Cyrillic_ie
252 + 0x0436: 0x06d6, // XK_Cyrillic_zhe
253 + 0x0437: 0x06da, // XK_Cyrillic_ze
254 + 0x0438: 0x06c9, // XK_Cyrillic_i
255 + 0x0439: 0x06ca, // XK_Cyrillic_shorti
256 + 0x043a: 0x06cb, // XK_Cyrillic_ka
257 + 0x043b: 0x06cc, // XK_Cyrillic_el
258 + 0x043c: 0x06cd, // XK_Cyrillic_em
259 + 0x043d: 0x06ce, // XK_Cyrillic_en
260 + 0x043e: 0x06cf, // XK_Cyrillic_o
261 + 0x043f: 0x06d0, // XK_Cyrillic_pe
262 + 0x0440: 0x06d2, // XK_Cyrillic_er
263 + 0x0441: 0x06d3, // XK_Cyrillic_es
264 + 0x0442: 0x06d4, // XK_Cyrillic_te
265 + 0x0443: 0x06d5, // XK_Cyrillic_u
266 + 0x0444: 0x06c6, // XK_Cyrillic_ef
267 + 0x0445: 0x06c8, // XK_Cyrillic_ha
268 + 0x0446: 0x06c3, // XK_Cyrillic_tse
269 + 0x0447: 0x06de, // XK_Cyrillic_che
270 + 0x0448: 0x06db, // XK_Cyrillic_sha
271 + 0x0449: 0x06dd, // XK_Cyrillic_shcha
272 + 0x044a: 0x06df, // XK_Cyrillic_hardsign
273 + 0x044b: 0x06d9, // XK_Cyrillic_yeru
274 + 0x044c: 0x06d8, // XK_Cyrillic_softsign
275 + 0x044d: 0x06dc, // XK_Cyrillic_e
276 + 0x044e: 0x06c0, // XK_Cyrillic_yu
277 + 0x044f: 0x06d1, // XK_Cyrillic_ya
278 + 0x0451: 0x06a3, // XK_Cyrillic_io
279 + 0x0452: 0x06a1, // XK_Serbian_dje
280 + 0x0453: 0x06a2, // XK_Macedonia_gje
281 + 0x0454: 0x06a4, // XK_Ukrainian_ie
282 + 0x0455: 0x06a5, // XK_Macedonia_dse
283 + 0x0456: 0x06a6, // XK_Ukrainian_i
284 + 0x0457: 0x06a7, // XK_Ukrainian_yi
285 + 0x0458: 0x06a8, // XK_Cyrillic_je
286 + 0x0459: 0x06a9, // XK_Cyrillic_lje
287 + 0x045a: 0x06aa, // XK_Cyrillic_nje
288 + 0x045b: 0x06ab, // XK_Serbian_tshe
289 + 0x045c: 0x06ac, // XK_Macedonia_kje
290 + 0x045e: 0x06ae, // XK_Byelorussian_shortu
291 + 0x045f: 0x06af, // XK_Cyrillic_dzhe
292 + 0x0490: 0x06bd, // XK_Ukrainian_GHE_WITH_UPTURN
293 + 0x0491: 0x06ad, // XK_Ukrainian_ghe_with_upturn
294 + 0x05d0: 0x0ce0, // XK_hebrew_aleph
295 + 0x05d1: 0x0ce1, // XK_hebrew_bet
296 + 0x05d2: 0x0ce2, // XK_hebrew_gimel
297 + 0x05d3: 0x0ce3, // XK_hebrew_dalet
298 + 0x05d4: 0x0ce4, // XK_hebrew_he
299 + 0x05d5: 0x0ce5, // XK_hebrew_waw
300 + 0x05d6: 0x0ce6, // XK_hebrew_zain
301 + 0x05d7: 0x0ce7, // XK_hebrew_chet
302 + 0x05d8: 0x0ce8, // XK_hebrew_tet
303 + 0x05d9: 0x0ce9, // XK_hebrew_yod
304 + 0x05da: 0x0cea, // XK_hebrew_finalkaph
305 + 0x05db: 0x0ceb, // XK_hebrew_kaph
306 + 0x05dc: 0x0cec, // XK_hebrew_lamed
307 + 0x05dd: 0x0ced, // XK_hebrew_finalmem
308 + 0x05de: 0x0cee, // XK_hebrew_mem
309 + 0x05df: 0x0cef, // XK_hebrew_finalnun
310 + 0x05e0: 0x0cf0, // XK_hebrew_nun
311 + 0x05e1: 0x0cf1, // XK_hebrew_samech
312 + 0x05e2: 0x0cf2, // XK_hebrew_ayin
313 + 0x05e3: 0x0cf3, // XK_hebrew_finalpe
314 + 0x05e4: 0x0cf4, // XK_hebrew_pe
315 + 0x05e5: 0x0cf5, // XK_hebrew_finalzade
316 + 0x05e6: 0x0cf6, // XK_hebrew_zade
317 + 0x05e7: 0x0cf7, // XK_hebrew_qoph
318 + 0x05e8: 0x0cf8, // XK_hebrew_resh
319 + 0x05e9: 0x0cf9, // XK_hebrew_shin
320 + 0x05ea: 0x0cfa, // XK_hebrew_taw
321 + 0x060c: 0x05ac, // XK_Arabic_comma
322 + 0x061b: 0x05bb, // XK_Arabic_semicolon
323 + 0x061f: 0x05bf, // XK_Arabic_question_mark
324 + 0x0621: 0x05c1, // XK_Arabic_hamza
325 + 0x0622: 0x05c2, // XK_Arabic_maddaonalef
326 + 0x0623: 0x05c3, // XK_Arabic_hamzaonalef
327 + 0x0624: 0x05c4, // XK_Arabic_hamzaonwaw
328 + 0x0625: 0x05c5, // XK_Arabic_hamzaunderalef
329 + 0x0626: 0x05c6, // XK_Arabic_hamzaonyeh
330 + 0x0627: 0x05c7, // XK_Arabic_alef
331 + 0x0628: 0x05c8, // XK_Arabic_beh
332 + 0x0629: 0x05c9, // XK_Arabic_tehmarbuta
333 + 0x062a: 0x05ca, // XK_Arabic_teh
334 + 0x062b: 0x05cb, // XK_Arabic_theh
335 + 0x062c: 0x05cc, // XK_Arabic_jeem
336 + 0x062d: 0x05cd, // XK_Arabic_hah
337 + 0x062e: 0x05ce, // XK_Arabic_khah
338 + 0x062f: 0x05cf, // XK_Arabic_dal
339 + 0x0630: 0x05d0, // XK_Arabic_thal
340 + 0x0631: 0x05d1, // XK_Arabic_ra
341 + 0x0632: 0x05d2, // XK_Arabic_zain
342 + 0x0633: 0x05d3, // XK_Arabic_seen
343 + 0x0634: 0x05d4, // XK_Arabic_sheen
344 + 0x0635: 0x05d5, // XK_Arabic_sad
345 + 0x0636: 0x05d6, // XK_Arabic_dad
346 + 0x0637: 0x05d7, // XK_Arabic_tah
347 + 0x0638: 0x05d8, // XK_Arabic_zah
348 + 0x0639: 0x05d9, // XK_Arabic_ain
349 + 0x063a: 0x05da, // XK_Arabic_ghain
350 + 0x0640: 0x05e0, // XK_Arabic_tatweel
351 + 0x0641: 0x05e1, // XK_Arabic_feh
352 + 0x0642: 0x05e2, // XK_Arabic_qaf
353 + 0x0643: 0x05e3, // XK_Arabic_kaf
354 + 0x0644: 0x05e4, // XK_Arabic_lam
355 + 0x0645: 0x05e5, // XK_Arabic_meem
356 + 0x0646: 0x05e6, // XK_Arabic_noon
357 + 0x0647: 0x05e7, // XK_Arabic_ha
358 + 0x0648: 0x05e8, // XK_Arabic_waw
359 + 0x0649: 0x05e9, // XK_Arabic_alefmaksura
360 + 0x064a: 0x05ea, // XK_Arabic_yeh
361 + 0x064b: 0x05eb, // XK_Arabic_fathatan
362 + 0x064c: 0x05ec, // XK_Arabic_dammatan
363 + 0x064d: 0x05ed, // XK_Arabic_kasratan
364 + 0x064e: 0x05ee, // XK_Arabic_fatha
365 + 0x064f: 0x05ef, // XK_Arabic_damma
366 + 0x0650: 0x05f0, // XK_Arabic_kasra
367 + 0x0651: 0x05f1, // XK_Arabic_shadda
368 + 0x0652: 0x05f2, // XK_Arabic_sukun
369 + 0x0e01: 0x0da1, // XK_Thai_kokai
370 + 0x0e02: 0x0da2, // XK_Thai_khokhai
371 + 0x0e03: 0x0da3, // XK_Thai_khokhuat
372 + 0x0e04: 0x0da4, // XK_Thai_khokhwai
373 + 0x0e05: 0x0da5, // XK_Thai_khokhon
374 + 0x0e06: 0x0da6, // XK_Thai_khorakhang
375 + 0x0e07: 0x0da7, // XK_Thai_ngongu
376 + 0x0e08: 0x0da8, // XK_Thai_chochan
377 + 0x0e09: 0x0da9, // XK_Thai_choching
378 + 0x0e0a: 0x0daa, // XK_Thai_chochang
379 + 0x0e0b: 0x0dab, // XK_Thai_soso
380 + 0x0e0c: 0x0dac, // XK_Thai_chochoe
381 + 0x0e0d: 0x0dad, // XK_Thai_yoying
382 + 0x0e0e: 0x0dae, // XK_Thai_dochada
383 + 0x0e0f: 0x0daf, // XK_Thai_topatak
384 + 0x0e10: 0x0db0, // XK_Thai_thothan
385 + 0x0e11: 0x0db1, // XK_Thai_thonangmontho
386 + 0x0e12: 0x0db2, // XK_Thai_thophuthao
387 + 0x0e13: 0x0db3, // XK_Thai_nonen
388 + 0x0e14: 0x0db4, // XK_Thai_dodek
389 + 0x0e15: 0x0db5, // XK_Thai_totao
390 + 0x0e16: 0x0db6, // XK_Thai_thothung
391 + 0x0e17: 0x0db7, // XK_Thai_thothahan
392 + 0x0e18: 0x0db8, // XK_Thai_thothong
393 + 0x0e19: 0x0db9, // XK_Thai_nonu
394 + 0x0e1a: 0x0dba, // XK_Thai_bobaimai
395 + 0x0e1b: 0x0dbb, // XK_Thai_popla
396 + 0x0e1c: 0x0dbc, // XK_Thai_phophung
397 + 0x0e1d: 0x0dbd, // XK_Thai_fofa
398 + 0x0e1e: 0x0dbe, // XK_Thai_phophan
399 + 0x0e1f: 0x0dbf, // XK_Thai_fofan
400 + 0x0e20: 0x0dc0, // XK_Thai_phosamphao
401 + 0x0e21: 0x0dc1, // XK_Thai_moma
402 + 0x0e22: 0x0dc2, // XK_Thai_yoyak
403 + 0x0e23: 0x0dc3, // XK_Thai_rorua
404 + 0x0e24: 0x0dc4, // XK_Thai_ru
405 + 0x0e25: 0x0dc5, // XK_Thai_loling
406 + 0x0e26: 0x0dc6, // XK_Thai_lu
407 + 0x0e27: 0x0dc7, // XK_Thai_wowaen
408 + 0x0e28: 0x0dc8, // XK_Thai_sosala
409 + 0x0e29: 0x0dc9, // XK_Thai_sorusi
410 + 0x0e2a: 0x0dca, // XK_Thai_sosua
411 + 0x0e2b: 0x0dcb, // XK_Thai_hohip
412 + 0x0e2c: 0x0dcc, // XK_Thai_lochula
413 + 0x0e2d: 0x0dcd, // XK_Thai_oang
414 + 0x0e2e: 0x0dce, // XK_Thai_honokhuk
415 + 0x0e2f: 0x0dcf, // XK_Thai_paiyannoi
416 + 0x0e30: 0x0dd0, // XK_Thai_saraa
417 + 0x0e31: 0x0dd1, // XK_Thai_maihanakat
418 + 0x0e32: 0x0dd2, // XK_Thai_saraaa
419 + 0x0e33: 0x0dd3, // XK_Thai_saraam
420 + 0x0e34: 0x0dd4, // XK_Thai_sarai
421 + 0x0e35: 0x0dd5, // XK_Thai_saraii
422 + 0x0e36: 0x0dd6, // XK_Thai_saraue
423 + 0x0e37: 0x0dd7, // XK_Thai_sarauee
424 + 0x0e38: 0x0dd8, // XK_Thai_sarau
425 + 0x0e39: 0x0dd9, // XK_Thai_sarauu
426 + 0x0e3a: 0x0dda, // XK_Thai_phinthu
427 + 0x0e3f: 0x0ddf, // XK_Thai_baht
428 + 0x0e40: 0x0de0, // XK_Thai_sarae
429 + 0x0e41: 0x0de1, // XK_Thai_saraae
430 + 0x0e42: 0x0de2, // XK_Thai_sarao
431 + 0x0e43: 0x0de3, // XK_Thai_saraaimaimuan
432 + 0x0e44: 0x0de4, // XK_Thai_saraaimaimalai
433 + 0x0e45: 0x0de5, // XK_Thai_lakkhangyao
434 + 0x0e46: 0x0de6, // XK_Thai_maiyamok
435 + 0x0e47: 0x0de7, // XK_Thai_maitaikhu
436 + 0x0e48: 0x0de8, // XK_Thai_maiek
437 + 0x0e49: 0x0de9, // XK_Thai_maitho
438 + 0x0e4a: 0x0dea, // XK_Thai_maitri
439 + 0x0e4b: 0x0deb, // XK_Thai_maichattawa
440 + 0x0e4c: 0x0dec, // XK_Thai_thanthakhat
441 + 0x0e4d: 0x0ded, // XK_Thai_nikhahit
442 + 0x0e50: 0x0df0, // XK_Thai_leksun
443 + 0x0e51: 0x0df1, // XK_Thai_leknung
444 + 0x0e52: 0x0df2, // XK_Thai_leksong
445 + 0x0e53: 0x0df3, // XK_Thai_leksam
446 + 0x0e54: 0x0df4, // XK_Thai_leksi
447 + 0x0e55: 0x0df5, // XK_Thai_lekha
448 + 0x0e56: 0x0df6, // XK_Thai_lekhok
449 + 0x0e57: 0x0df7, // XK_Thai_lekchet
450 + 0x0e58: 0x0df8, // XK_Thai_lekpaet
451 + 0x0e59: 0x0df9, // XK_Thai_lekkao
452 + 0x2002: 0x0aa2, // XK_enspace
453 + 0x2003: 0x0aa1, // XK_emspace
454 + 0x2004: 0x0aa3, // XK_em3space
455 + 0x2005: 0x0aa4, // XK_em4space
456 + 0x2007: 0x0aa5, // XK_digitspace
457 + 0x2008: 0x0aa6, // XK_punctspace
458 + 0x2009: 0x0aa7, // XK_thinspace
459 + 0x200a: 0x0aa8, // XK_hairspace
460 + 0x2012: 0x0abb, // XK_figdash
461 + 0x2013: 0x0aaa, // XK_endash
462 + 0x2014: 0x0aa9, // XK_emdash
463 + 0x2015: 0x07af, // XK_Greek_horizbar
464 + 0x2017: 0x0cdf, // XK_hebrew_doublelowline
465 + 0x2018: 0x0ad0, // XK_leftsinglequotemark
466 + 0x2019: 0x0ad1, // XK_rightsinglequotemark
467 + 0x201a: 0x0afd, // XK_singlelowquotemark
468 + 0x201c: 0x0ad2, // XK_leftdoublequotemark
469 + 0x201d: 0x0ad3, // XK_rightdoublequotemark
470 + 0x201e: 0x0afe, // XK_doublelowquotemark
471 + 0x2020: 0x0af1, // XK_dagger
472 + 0x2021: 0x0af2, // XK_doubledagger
473 + 0x2022: 0x0ae6, // XK_enfilledcircbullet
474 + 0x2025: 0x0aaf, // XK_doubbaselinedot
475 + 0x2026: 0x0aae, // XK_ellipsis
476 + 0x2030: 0x0ad5, // XK_permille
477 + 0x2032: 0x0ad6, // XK_minutes
478 + 0x2033: 0x0ad7, // XK_seconds
479 + 0x2038: 0x0afc, // XK_caret
480 + 0x203e: 0x047e, // XK_overline
481 + 0x20a9: 0x0eff, // XK_Korean_Won
482 + 0x20ac: 0x20ac, // XK_EuroSign
483 + 0x2105: 0x0ab8, // XK_careof
484 + 0x2116: 0x06b0, // XK_numerosign
485 + 0x2117: 0x0afb, // XK_phonographcopyright
486 + 0x211e: 0x0ad4, // XK_prescription
487 + 0x2122: 0x0ac9, // XK_trademark
488 + 0x2153: 0x0ab0, // XK_onethird
489 + 0x2154: 0x0ab1, // XK_twothirds
490 + 0x2155: 0x0ab2, // XK_onefifth
491 + 0x2156: 0x0ab3, // XK_twofifths
492 + 0x2157: 0x0ab4, // XK_threefifths
493 + 0x2158: 0x0ab5, // XK_fourfifths
494 + 0x2159: 0x0ab6, // XK_onesixth
495 + 0x215a: 0x0ab7, // XK_fivesixths
496 + 0x215b: 0x0ac3, // XK_oneeighth
497 + 0x215c: 0x0ac4, // XK_threeeighths
498 + 0x215d: 0x0ac5, // XK_fiveeighths
499 + 0x215e: 0x0ac6, // XK_seveneighths
500 + 0x2190: 0x08fb, // XK_leftarrow
501 + 0x2191: 0x08fc, // XK_uparrow
502 + 0x2192: 0x08fd, // XK_rightarrow
503 + 0x2193: 0x08fe, // XK_downarrow
504 + 0x21d2: 0x08ce, // XK_implies
505 + 0x21d4: 0x08cd, // XK_ifonlyif
506 + 0x2202: 0x08ef, // XK_partialderivative
507 + 0x2207: 0x08c5, // XK_nabla
508 + 0x2218: 0x0bca, // XK_jot
509 + 0x221a: 0x08d6, // XK_radical
510 + 0x221d: 0x08c1, // XK_variation
511 + 0x221e: 0x08c2, // XK_infinity
512 + 0x2227: 0x08de, // XK_logicaland
513 + 0x2228: 0x08df, // XK_logicalor
514 + 0x2229: 0x08dc, // XK_intersection
515 + 0x222a: 0x08dd, // XK_union
516 + 0x222b: 0x08bf, // XK_integral
517 + 0x2234: 0x08c0, // XK_therefore
518 + 0x223c: 0x08c8, // XK_approximate
519 + 0x2243: 0x08c9, // XK_similarequal
520 + 0x2245: 0x1002248, // XK_approxeq
521 + 0x2260: 0x08bd, // XK_notequal
522 + 0x2261: 0x08cf, // XK_identical
523 + 0x2264: 0x08bc, // XK_lessthanequal
524 + 0x2265: 0x08be, // XK_greaterthanequal
525 + 0x2282: 0x08da, // XK_includedin
526 + 0x2283: 0x08db, // XK_includes
527 + 0x22a2: 0x0bfc, // XK_righttack
528 + 0x22a3: 0x0bdc, // XK_lefttack
529 + 0x22a4: 0x0bc2, // XK_downtack
530 + 0x22a5: 0x0bce, // XK_uptack
531 + 0x2308: 0x0bd3, // XK_upstile
532 + 0x230a: 0x0bc4, // XK_downstile
533 + 0x2315: 0x0afa, // XK_telephonerecorder
534 + 0x2320: 0x08a4, // XK_topintegral
535 + 0x2321: 0x08a5, // XK_botintegral
536 + 0x2395: 0x0bcc, // XK_quad
537 + 0x239b: 0x08ab, // XK_topleftparens
538 + 0x239d: 0x08ac, // XK_botleftparens
539 + 0x239e: 0x08ad, // XK_toprightparens
540 + 0x23a0: 0x08ae, // XK_botrightparens
541 + 0x23a1: 0x08a7, // XK_topleftsqbracket
542 + 0x23a3: 0x08a8, // XK_botleftsqbracket
543 + 0x23a4: 0x08a9, // XK_toprightsqbracket
544 + 0x23a6: 0x08aa, // XK_botrightsqbracket
545 + 0x23a8: 0x08af, // XK_leftmiddlecurlybrace
546 + 0x23ac: 0x08b0, // XK_rightmiddlecurlybrace
547 + 0x23b7: 0x08a1, // XK_leftradical
548 + 0x23ba: 0x09ef, // XK_horizlinescan1
549 + 0x23bb: 0x09f0, // XK_horizlinescan3
550 + 0x23bc: 0x09f2, // XK_horizlinescan7
551 + 0x23bd: 0x09f3, // XK_horizlinescan9
552 + 0x2409: 0x09e2, // XK_ht
553 + 0x240a: 0x09e5, // XK_lf
554 + 0x240b: 0x09e9, // XK_vt
555 + 0x240c: 0x09e3, // XK_ff
556 + 0x240d: 0x09e4, // XK_cr
557 + 0x2423: 0x0aac, // XK_signifblank
558 + 0x2424: 0x09e8, // XK_nl
559 + 0x2500: 0x08a3, // XK_horizconnector
560 + 0x2502: 0x08a6, // XK_vertconnector
561 + 0x250c: 0x08a2, // XK_topleftradical
562 + 0x2510: 0x09eb, // XK_uprightcorner
563 + 0x2514: 0x09ed, // XK_lowleftcorner
564 + 0x2518: 0x09ea, // XK_lowrightcorner
565 + 0x251c: 0x09f4, // XK_leftt
566 + 0x2524: 0x09f5, // XK_rightt
567 + 0x252c: 0x09f7, // XK_topt
568 + 0x2534: 0x09f6, // XK_bott
569 + 0x253c: 0x09ee, // XK_crossinglines
570 + 0x2592: 0x09e1, // XK_checkerboard
571 + 0x25aa: 0x0ae7, // XK_enfilledsqbullet
572 + 0x25ab: 0x0ae1, // XK_enopensquarebullet
573 + 0x25ac: 0x0adb, // XK_filledrectbullet
574 + 0x25ad: 0x0ae2, // XK_openrectbullet
575 + 0x25ae: 0x0adf, // XK_emfilledrect
576 + 0x25af: 0x0acf, // XK_emopenrectangle
577 + 0x25b2: 0x0ae8, // XK_filledtribulletup
578 + 0x25b3: 0x0ae3, // XK_opentribulletup
579 + 0x25b6: 0x0add, // XK_filledrighttribullet
580 + 0x25b7: 0x0acd, // XK_rightopentriangle
581 + 0x25bc: 0x0ae9, // XK_filledtribulletdown
582 + 0x25bd: 0x0ae4, // XK_opentribulletdown
583 + 0x25c0: 0x0adc, // XK_filledlefttribullet
584 + 0x25c1: 0x0acc, // XK_leftopentriangle
585 + 0x25c6: 0x09e0, // XK_soliddiamond
586 + 0x25cb: 0x0ace, // XK_emopencircle
587 + 0x25cf: 0x0ade, // XK_emfilledcircle
588 + 0x25e6: 0x0ae0, // XK_enopencircbullet
589 + 0x2606: 0x0ae5, // XK_openstar
590 + 0x260e: 0x0af9, // XK_telephone
591 + 0x2613: 0x0aca, // XK_signaturemark
592 + 0x261c: 0x0aea, // XK_leftpointer
593 + 0x261e: 0x0aeb, // XK_rightpointer
594 + 0x2640: 0x0af8, // XK_femalesymbol
595 + 0x2642: 0x0af7, // XK_malesymbol
596 + 0x2663: 0x0aec, // XK_club
597 + 0x2665: 0x0aee, // XK_heart
598 + 0x2666: 0x0aed, // XK_diamond
599 + 0x266d: 0x0af6, // XK_musicalflat
600 + 0x266f: 0x0af5, // XK_musicalsharp
601 + 0x2713: 0x0af3, // XK_checkmark
602 + 0x2717: 0x0af4, // XK_ballotcross
603 + 0x271d: 0x0ad9, // XK_latincross
604 + 0x2720: 0x0af0, // XK_maltesecross
605 + 0x27e8: 0x0abc, // XK_leftanglebracket
606 + 0x27e9: 0x0abe, // XK_rightanglebracket
607 + 0x3001: 0x04a4, // XK_kana_comma
608 + 0x3002: 0x04a1, // XK_kana_fullstop
609 + 0x300c: 0x04a2, // XK_kana_openingbracket
610 + 0x300d: 0x04a3, // XK_kana_closingbracket
611 + 0x309b: 0x04de, // XK_voicedsound
612 + 0x309c: 0x04df, // XK_semivoicedsound
613 + 0x30a1: 0x04a7, // XK_kana_a
614 + 0x30a2: 0x04b1, // XK_kana_A
615 + 0x30a3: 0x04a8, // XK_kana_i
616 + 0x30a4: 0x04b2, // XK_kana_I
617 + 0x30a5: 0x04a9, // XK_kana_u
618 + 0x30a6: 0x04b3, // XK_kana_U
619 + 0x30a7: 0x04aa, // XK_kana_e
620 + 0x30a8: 0x04b4, // XK_kana_E
621 + 0x30a9: 0x04ab, // XK_kana_o
622 + 0x30aa: 0x04b5, // XK_kana_O
623 + 0x30ab: 0x04b6, // XK_kana_KA
624 + 0x30ad: 0x04b7, // XK_kana_KI
625 + 0x30af: 0x04b8, // XK_kana_KU
626 + 0x30b1: 0x04b9, // XK_kana_KE
627 + 0x30b3: 0x04ba, // XK_kana_KO
628 + 0x30b5: 0x04bb, // XK_kana_SA
629 + 0x30b7: 0x04bc, // XK_kana_SHI
630 + 0x30b9: 0x04bd, // XK_kana_SU
631 + 0x30bb: 0x04be, // XK_kana_SE
632 + 0x30bd: 0x04bf, // XK_kana_SO
633 + 0x30bf: 0x04c0, // XK_kana_TA
634 + 0x30c1: 0x04c1, // XK_kana_CHI
635 + 0x30c3: 0x04af, // XK_kana_tsu
636 + 0x30c4: 0x04c2, // XK_kana_TSU
637 + 0x30c6: 0x04c3, // XK_kana_TE
638 + 0x30c8: 0x04c4, // XK_kana_TO
639 + 0x30ca: 0x04c5, // XK_kana_NA
640 + 0x30cb: 0x04c6, // XK_kana_NI
641 + 0x30cc: 0x04c7, // XK_kana_NU
642 + 0x30cd: 0x04c8, // XK_kana_NE
643 + 0x30ce: 0x04c9, // XK_kana_NO
644 + 0x30cf: 0x04ca, // XK_kana_HA
645 + 0x30d2: 0x04cb, // XK_kana_HI
646 + 0x30d5: 0x04cc, // XK_kana_FU
647 + 0x30d8: 0x04cd, // XK_kana_HE
648 + 0x30db: 0x04ce, // XK_kana_HO
649 + 0x30de: 0x04cf, // XK_kana_MA
650 + 0x30df: 0x04d0, // XK_kana_MI
651 + 0x30e0: 0x04d1, // XK_kana_MU
652 + 0x30e1: 0x04d2, // XK_kana_ME
653 + 0x30e2: 0x04d3, // XK_kana_MO
654 + 0x30e3: 0x04ac, // XK_kana_ya
655 + 0x30e4: 0x04d4, // XK_kana_YA
656 + 0x30e5: 0x04ad, // XK_kana_yu
657 + 0x30e6: 0x04d5, // XK_kana_YU
658 + 0x30e7: 0x04ae, // XK_kana_yo
659 + 0x30e8: 0x04d6, // XK_kana_YO
660 + 0x30e9: 0x04d7, // XK_kana_RA
661 + 0x30ea: 0x04d8, // XK_kana_RI
662 + 0x30eb: 0x04d9, // XK_kana_RU
663 + 0x30ec: 0x04da, // XK_kana_RE
664 + 0x30ed: 0x04db, // XK_kana_RO
665 + 0x30ef: 0x04dc, // XK_kana_WA
666 + 0x30f2: 0x04a6, // XK_kana_WO
667 + 0x30f3: 0x04dd, // XK_kana_N
668 + 0x30fb: 0x04a5, // XK_kana_conjunctive
669 + 0x30fc: 0x04b0, // XK_prolongedsound
670 +};
671 +
672 +export default {
673 + lookup(u) {
674 + // Latin-1 is one-to-one mapping
675 + if ((u >= 0x20) && (u <= 0xff)) {
676 + return u;
677 + }
678 +
679 + // Lookup table (fairly random)
680 + const keysym = codepoints[u];
681 + if (keysym !== undefined) {
682 + return keysym;
683 + }
684 +
685 + // General mapping as final fallback
686 + return 0x01000000 | u;
687 + },
688 +};
public/novnc/core/input/mouse.js new
+276
@@ -0,0 +1,276 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +import * as Log from '../util/logging.js';
8 +import { isTouchDevice } from '../util/browser.js';
9 +import { setCapture, stopEvent, getPointerEvent } from '../util/events.js';
10 +
11 +const WHEEL_STEP = 10; // Delta threshold for a mouse wheel step
12 +const WHEEL_STEP_TIMEOUT = 50; // ms
13 +const WHEEL_LINE_HEIGHT = 19;
14 +
15 +export default class Mouse {
16 + constructor(target) {
17 + this._target = target || document;
18 +
19 + this._doubleClickTimer = null;
20 + this._lastTouchPos = null;
21 +
22 + this._pos = null;
23 + this._wheelStepXTimer = null;
24 + this._wheelStepYTimer = null;
25 + this._accumulatedWheelDeltaX = 0;
26 + this._accumulatedWheelDeltaY = 0;
27 +
28 + this._eventHandlers = {
29 + 'mousedown': this._handleMouseDown.bind(this),
30 + 'mouseup': this._handleMouseUp.bind(this),
31 + 'mousemove': this._handleMouseMove.bind(this),
32 + 'mousewheel': this._handleMouseWheel.bind(this),
33 + 'mousedisable': this._handleMouseDisable.bind(this)
34 + };
35 +
36 + // ===== PROPERTIES =====
37 +
38 + this.touchButton = 1; // Button mask (1, 2, 4) for touch devices (0 means ignore clicks)
39 +
40 + // ===== EVENT HANDLERS =====
41 +
42 + this.onmousebutton = () => {}; // Handler for mouse button click/release
43 + this.onmousemove = () => {}; // Handler for mouse movement
44 + }
45 +
46 + // ===== PRIVATE METHODS =====
47 +
48 + _resetDoubleClickTimer() {
49 + this._doubleClickTimer = null;
50 + }
51 +
52 + _handleMouseButton(e, down) {
53 + this._updateMousePosition(e);
54 + let pos = this._pos;
55 +
56 + let bmask;
57 + if (e.touches || e.changedTouches) {
58 + // Touch device
59 +
60 + // When two touches occur within 500 ms of each other and are
61 + // close enough together a double click is triggered.
62 + if (down == 1) {
63 + if (this._doubleClickTimer === null) {
64 + this._lastTouchPos = pos;
65 + } else {
66 + clearTimeout(this._doubleClickTimer);
67 +
68 + // When the distance between the two touches is small enough
69 + // force the position of the latter touch to the position of
70 + // the first.
71 +
72 + const xs = this._lastTouchPos.x - pos.x;
73 + const ys = this._lastTouchPos.y - pos.y;
74 + const d = Math.sqrt((xs * xs) + (ys * ys));
75 +
76 + // The goal is to trigger on a certain physical width, the
77 + // devicePixelRatio brings us a bit closer but is not optimal.
78 + const threshold = 20 * (window.devicePixelRatio || 1);
79 + if (d < threshold) {
80 + pos = this._lastTouchPos;
81 + }
82 + }
83 + this._doubleClickTimer = setTimeout(this._resetDoubleClickTimer.bind(this), 500);
84 + }
85 + bmask = this.touchButton;
86 + // If bmask is set
87 + } else if (e.which) {
88 + /* everything except IE */
89 + bmask = 1 << e.button;
90 + } else {
91 + /* IE including 9 */
92 + bmask = (e.button & 0x1) + // Left
93 + (e.button & 0x2) * 2 + // Right
94 + (e.button & 0x4) / 2; // Middle
95 + }
96 +
97 + Log.Debug("onmousebutton " + (down ? "down" : "up") +
98 + ", x: " + pos.x + ", y: " + pos.y + ", bmask: " + bmask);
99 + this.onmousebutton(pos.x, pos.y, down, bmask);
100 +
101 + stopEvent(e);
102 + }
103 +
104 + _handleMouseDown(e) {
105 + // Touch events have implicit capture
106 + if (e.type === "mousedown") {
107 + setCapture(this._target);
108 + }
109 +
110 + this._handleMouseButton(e, 1);
111 + }
112 +
113 + _handleMouseUp(e) {
114 + this._handleMouseButton(e, 0);
115 + }
116 +
117 + // Mouse wheel events are sent in steps over VNC. This means that the VNC
118 + // protocol can't handle a wheel event with specific distance or speed.
119 + // Therefor, if we get a lot of small mouse wheel events we combine them.
120 + _generateWheelStepX() {
121 +
122 + if (this._accumulatedWheelDeltaX < 0) {
123 + this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 5);
124 + this.onmousebutton(this._pos.x, this._pos.y, 0, 1 << 5);
125 + } else if (this._accumulatedWheelDeltaX > 0) {
126 + this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 6);
127 + this.onmousebutton(this._pos.x, this._pos.y, 0, 1 << 6);
128 + }
129 +
130 + this._accumulatedWheelDeltaX = 0;
131 + }
132 +
133 + _generateWheelStepY() {
134 +
135 + if (this._accumulatedWheelDeltaY < 0) {
136 + this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 3);
137 + this.onmousebutton(this._pos.x, this._pos.y, 0, 1 << 3);
138 + } else if (this._accumulatedWheelDeltaY > 0) {
139 + this.onmousebutton(this._pos.x, this._pos.y, 1, 1 << 4);
140 + this.onmousebutton(this._pos.x, this._pos.y, 0, 1 << 4);
141 + }
142 +
143 + this._accumulatedWheelDeltaY = 0;
144 + }
145 +
146 + _resetWheelStepTimers() {
147 + window.clearTimeout(this._wheelStepXTimer);
148 + window.clearTimeout(this._wheelStepYTimer);
149 + this._wheelStepXTimer = null;
150 + this._wheelStepYTimer = null;
151 + }
152 +
153 + _handleMouseWheel(e) {
154 + this._resetWheelStepTimers();
155 +
156 + this._updateMousePosition(e);
157 +
158 + let dX = e.deltaX;
159 + let dY = e.deltaY;
160 +
161 + // Pixel units unless it's non-zero.
162 + // Note that if deltamode is line or page won't matter since we aren't
163 + // sending the mouse wheel delta to the server anyway.
164 + // The difference between pixel and line can be important however since
165 + // we have a threshold that can be smaller than the line height.
166 + if (e.deltaMode !== 0) {
167 + dX *= WHEEL_LINE_HEIGHT;
168 + dY *= WHEEL_LINE_HEIGHT;
169 + }
170 +
171 + this._accumulatedWheelDeltaX += dX;
172 + this._accumulatedWheelDeltaY += dY;
173 +
174 + // Generate a mouse wheel step event when the accumulated delta
175 + // for one of the axes is large enough.
176 + // Small delta events that do not pass the threshold get sent
177 + // after a timeout.
178 + if (Math.abs(this._accumulatedWheelDeltaX) > WHEEL_STEP) {
179 + this._generateWheelStepX();
180 + } else {
181 + this._wheelStepXTimer =
182 + window.setTimeout(this._generateWheelStepX.bind(this),
183 + WHEEL_STEP_TIMEOUT);
184 + }
185 + if (Math.abs(this._accumulatedWheelDeltaY) > WHEEL_STEP) {
186 + this._generateWheelStepY();
187 + } else {
188 + this._wheelStepYTimer =
189 + window.setTimeout(this._generateWheelStepY.bind(this),
190 + WHEEL_STEP_TIMEOUT);
191 + }
192 +
193 + stopEvent(e);
194 + }
195 +
196 + _handleMouseMove(e) {
197 + this._updateMousePosition(e);
198 + this.onmousemove(this._pos.x, this._pos.y);
199 + stopEvent(e);
200 + }
201 +
202 + _handleMouseDisable(e) {
203 + /*
204 + * Stop propagation if inside canvas area
205 + * Note: This is only needed for the 'click' event as it fails
206 + * to fire properly for the target element so we have
207 + * to listen on the document element instead.
208 + */
209 + if (e.target == this._target) {
210 + stopEvent(e);
211 + }
212 + }
213 +
214 + // Update coordinates relative to target
215 + _updateMousePosition(e) {
216 + e = getPointerEvent(e);
217 + const bounds = this._target.getBoundingClientRect();
218 + let x;
219 + let y;
220 + // Clip to target bounds
221 + if (e.clientX < bounds.left) {
222 + x = 0;
223 + } else if (e.clientX >= bounds.right) {
224 + x = bounds.width - 1;
225 + } else {
226 + x = e.clientX - bounds.left;
227 + }
228 + if (e.clientY < bounds.top) {
229 + y = 0;
230 + } else if (e.clientY >= bounds.bottom) {
231 + y = bounds.height - 1;
232 + } else {
233 + y = e.clientY - bounds.top;
234 + }
235 + this._pos = {x: x, y: y};
236 + }
237 +
238 + // ===== PUBLIC METHODS =====
239 +
240 + grab() {
241 + if (isTouchDevice) {
242 + this._target.addEventListener('touchstart', this._eventHandlers.mousedown);
243 + this._target.addEventListener('touchend', this._eventHandlers.mouseup);
244 + this._target.addEventListener('touchmove', this._eventHandlers.mousemove);
245 + }
246 + this._target.addEventListener('mousedown', this._eventHandlers.mousedown);
247 + this._target.addEventListener('mouseup', this._eventHandlers.mouseup);
248 + this._target.addEventListener('mousemove', this._eventHandlers.mousemove);
249 + this._target.addEventListener('wheel', this._eventHandlers.mousewheel);
250 +
251 + /* Prevent middle-click pasting (see above for why we bind to document) */
252 + document.addEventListener('click', this._eventHandlers.mousedisable);
253 +
254 + /* preventDefault() on mousedown doesn't stop this event for some
255 + reason so we have to explicitly block it */
256 + this._target.addEventListener('contextmenu', this._eventHandlers.mousedisable);
257 + }
258 +
259 + ungrab() {
260 + this._resetWheelStepTimers();
261 +
262 + if (isTouchDevice) {
263 + this._target.removeEventListener('touchstart', this._eventHandlers.mousedown);
264 + this._target.removeEventListener('touchend', this._eventHandlers.mouseup);
265 + this._target.removeEventListener('touchmove', this._eventHandlers.mousemove);
266 + }
267 + this._target.removeEventListener('mousedown', this._eventHandlers.mousedown);
268 + this._target.removeEventListener('mouseup', this._eventHandlers.mouseup);
269 + this._target.removeEventListener('mousemove', this._eventHandlers.mousemove);
270 + this._target.removeEventListener('wheel', this._eventHandlers.mousewheel);
271 +
272 + document.removeEventListener('click', this._eventHandlers.mousedisable);
273 +
274 + this._target.removeEventListener('contextmenu', this._eventHandlers.mousedisable);
275 + }
276 +}
public/novnc/core/input/util.js new
+164
@@ -0,0 +1,164 @@
1 +import keysyms from "./keysymdef.js";
2 +import vkeys from "./vkeys.js";
3 +import fixedkeys from "./fixedkeys.js";
4 +import DOMKeyTable from "./domkeytable.js";
5 +import * as browser from "../util/browser.js";
6 +
7 +// Get 'KeyboardEvent.code', handling legacy browsers
8 +export function getKeycode(evt) {
9 + // Are we getting proper key identifiers?
10 + // (unfortunately Firefox and Chrome are crappy here and gives
11 + // us an empty string on some platforms, rather than leaving it
12 + // undefined)
13 + if (evt.code) {
14 + // Mozilla isn't fully in sync with the spec yet
15 + switch (evt.code) {
16 + case 'OSLeft': return 'MetaLeft';
17 + case 'OSRight': return 'MetaRight';
18 + }
19 +
20 + return evt.code;
21 + }
22 +
23 + // The de-facto standard is to use Windows Virtual-Key codes
24 + // in the 'keyCode' field for non-printable characters. However
25 + // Webkit sets it to the same as charCode in 'keypress' events.
26 + if ((evt.type !== 'keypress') && (evt.keyCode in vkeys)) {
27 + let code = vkeys[evt.keyCode];
28 +
29 + // macOS has messed up this code for some reason
30 + if (browser.isMac() && (code === 'ContextMenu')) {
31 + code = 'MetaRight';
32 + }
33 +
34 + // The keyCode doesn't distinguish between left and right
35 + // for the standard modifiers
36 + if (evt.location === 2) {
37 + switch (code) {
38 + case 'ShiftLeft': return 'ShiftRight';
39 + case 'ControlLeft': return 'ControlRight';
40 + case 'AltLeft': return 'AltRight';
41 + }
42 + }
43 +
44 + // Nor a bunch of the numpad keys
45 + if (evt.location === 3) {
46 + switch (code) {
47 + case 'Delete': return 'NumpadDecimal';
48 + case 'Insert': return 'Numpad0';
49 + case 'End': return 'Numpad1';
50 + case 'ArrowDown': return 'Numpad2';
51 + case 'PageDown': return 'Numpad3';
52 + case 'ArrowLeft': return 'Numpad4';
53 + case 'ArrowRight': return 'Numpad6';
54 + case 'Home': return 'Numpad7';
55 + case 'ArrowUp': return 'Numpad8';
56 + case 'PageUp': return 'Numpad9';
57 + case 'Enter': return 'NumpadEnter';
58 + }
59 + }
60 +
61 + return code;
62 + }
63 +
64 + return 'Unidentified';
65 +}
66 +
67 +// Get 'KeyboardEvent.key', handling legacy browsers
68 +export function getKey(evt) {
69 + // Are we getting a proper key value?
70 + if (evt.key !== undefined) {
71 + // IE and Edge use some ancient version of the spec
72 + // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
73 + switch (evt.key) {
74 + case 'Spacebar': return ' ';
75 + case 'Esc': return 'Escape';
76 + case 'Scroll': return 'ScrollLock';
77 + case 'Win': return 'Meta';
78 + case 'Apps': return 'ContextMenu';
79 + case 'Up': return 'ArrowUp';
80 + case 'Left': return 'ArrowLeft';
81 + case 'Right': return 'ArrowRight';
82 + case 'Down': return 'ArrowDown';
83 + case 'Del': return 'Delete';
84 + case 'Divide': return '/';
85 + case 'Multiply': return '*';
86 + case 'Subtract': return '-';
87 + case 'Add': return '+';
88 + case 'Decimal': return evt.char;
89 + }
90 +
91 + // Mozilla isn't fully in sync with the spec yet
92 + switch (evt.key) {
93 + case 'OS': return 'Meta';
94 + }
95 +
96 + // iOS leaks some OS names
97 + switch (evt.key) {
98 + case 'UIKeyInputUpArrow': return 'ArrowUp';
99 + case 'UIKeyInputDownArrow': return 'ArrowDown';
100 + case 'UIKeyInputLeftArrow': return 'ArrowLeft';
101 + case 'UIKeyInputRightArrow': return 'ArrowRight';
102 + case 'UIKeyInputEscape': return 'Escape';
103 + }
104 +
105 + // IE and Edge have broken handling of AltGraph so we cannot
106 + // trust them for printable characters
107 + if ((evt.key.length !== 1) || (!browser.isIE() && !browser.isEdge())) {
108 + return evt.key;
109 + }
110 + }
111 +
112 + // Try to deduce it based on the physical key
113 + const code = getKeycode(evt);
114 + if (code in fixedkeys) {
115 + return fixedkeys[code];
116 + }
117 +
118 + // If that failed, then see if we have a printable character
119 + if (evt.charCode) {
120 + return String.fromCharCode(evt.charCode);
121 + }
122 +
123 + // At this point we have nothing left to go on
124 + return 'Unidentified';
125 +}
126 +
127 +// Get the most reliable keysym value we can get from a key event
128 +export function getKeysym(evt) {
129 + const key = getKey(evt);
130 +
131 + if (key === 'Unidentified') {
132 + return null;
133 + }
134 +
135 + // First look up special keys
136 + if (key in DOMKeyTable) {
137 + let location = evt.location;
138 +
139 + // Safari screws up location for the right cmd key
140 + if ((key === 'Meta') && (location === 0)) {
141 + location = 2;
142 + }
143 +
144 + if ((location === undefined) || (location > 3)) {
145 + location = 0;
146 + }
147 +
148 + return DOMKeyTable[key][location];
149 + }
150 +
151 + // Now we need to look at the Unicode symbol instead
152 +
153 + // Special key? (FIXME: Should have been caught earlier)
154 + if (key.length !== 1) {
155 + return null;
156 + }
157 +
158 + const codepoint = key.charCodeAt();
159 + if (codepoint) {
160 + return keysyms.lookup(codepoint);
161 + }
162 +
163 + return null;
164 +}
public/novnc/core/input/vkeys.js new
+117
@@ -0,0 +1,117 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +/*
8 + * Mapping between Microsoft® Windows® Virtual-Key codes and
9 + * HTML key codes.
10 + */
11 +
12 +export default {
13 + 0x08: 'Backspace',
14 + 0x09: 'Tab',
15 + 0x0a: 'NumpadClear',
16 + 0x0c: 'Numpad5', // IE11 sends evt.keyCode: 12 when numlock is off
17 + 0x0d: 'Enter',
18 + 0x10: 'ShiftLeft',
19 + 0x11: 'ControlLeft',
20 + 0x12: 'AltLeft',
21 + 0x13: 'Pause',
22 + 0x14: 'CapsLock',
23 + 0x15: 'Lang1',
24 + 0x19: 'Lang2',
25 + 0x1b: 'Escape',
26 + 0x1c: 'Convert',
27 + 0x1d: 'NonConvert',
28 + 0x20: 'Space',
29 + 0x21: 'PageUp',
30 + 0x22: 'PageDown',
31 + 0x23: 'End',
32 + 0x24: 'Home',
33 + 0x25: 'ArrowLeft',
34 + 0x26: 'ArrowUp',
35 + 0x27: 'ArrowRight',
36 + 0x28: 'ArrowDown',
37 + 0x29: 'Select',
38 + 0x2c: 'PrintScreen',
39 + 0x2d: 'Insert',
40 + 0x2e: 'Delete',
41 + 0x2f: 'Help',
42 + 0x30: 'Digit0',
43 + 0x31: 'Digit1',
44 + 0x32: 'Digit2',
45 + 0x33: 'Digit3',
46 + 0x34: 'Digit4',
47 + 0x35: 'Digit5',
48 + 0x36: 'Digit6',
49 + 0x37: 'Digit7',
50 + 0x38: 'Digit8',
51 + 0x39: 'Digit9',
52 + 0x5b: 'MetaLeft',
53 + 0x5c: 'MetaRight',
54 + 0x5d: 'ContextMenu',
55 + 0x5f: 'Sleep',
56 + 0x60: 'Numpad0',
57 + 0x61: 'Numpad1',
58 + 0x62: 'Numpad2',
59 + 0x63: 'Numpad3',
60 + 0x64: 'Numpad4',
61 + 0x65: 'Numpad5',
62 + 0x66: 'Numpad6',
63 + 0x67: 'Numpad7',
64 + 0x68: 'Numpad8',
65 + 0x69: 'Numpad9',
66 + 0x6a: 'NumpadMultiply',
67 + 0x6b: 'NumpadAdd',
68 + 0x6c: 'NumpadDecimal',
69 + 0x6d: 'NumpadSubtract',
70 + 0x6e: 'NumpadDecimal', // Duplicate, because buggy on Windows
71 + 0x6f: 'NumpadDivide',
72 + 0x70: 'F1',
73 + 0x71: 'F2',
74 + 0x72: 'F3',
75 + 0x73: 'F4',
76 + 0x74: 'F5',
77 + 0x75: 'F6',
78 + 0x76: 'F7',
79 + 0x77: 'F8',
80 + 0x78: 'F9',
81 + 0x79: 'F10',
82 + 0x7a: 'F11',
83 + 0x7b: 'F12',
84 + 0x7c: 'F13',
85 + 0x7d: 'F14',
86 + 0x7e: 'F15',
87 + 0x7f: 'F16',
88 + 0x80: 'F17',
89 + 0x81: 'F18',
90 + 0x82: 'F19',
91 + 0x83: 'F20',
92 + 0x84: 'F21',
93 + 0x85: 'F22',
94 + 0x86: 'F23',
95 + 0x87: 'F24',
96 + 0x90: 'NumLock',
97 + 0x91: 'ScrollLock',
98 + 0xa6: 'BrowserBack',
99 + 0xa7: 'BrowserForward',
100 + 0xa8: 'BrowserRefresh',
101 + 0xa9: 'BrowserStop',
102 + 0xaa: 'BrowserSearch',
103 + 0xab: 'BrowserFavorites',
104 + 0xac: 'BrowserHome',
105 + 0xad: 'AudioVolumeMute',
106 + 0xae: 'AudioVolumeDown',
107 + 0xaf: 'AudioVolumeUp',
108 + 0xb0: 'MediaTrackNext',
109 + 0xb1: 'MediaTrackPrevious',
110 + 0xb2: 'MediaStop',
111 + 0xb3: 'MediaPlayPause',
112 + 0xb4: 'LaunchMail',
113 + 0xb5: 'MediaSelect',
114 + 0xb6: 'LaunchApp1',
115 + 0xb7: 'LaunchApp2',
116 + 0xe1: 'AltRight', // Only when it is AltGraph
117 +};
public/novnc/core/input/xtscancodes.js new
+171
@@ -0,0 +1,171 @@
1 +/*
2 + * This file is auto-generated from keymaps.csv on 2017-05-31 16:20
3 + * Database checksum sha256(92fd165507f2a3b8c5b3fa56e425d45788dbcb98cf067a307527d91ce22cab94)
4 + * To re-generate, run:
5 + * keymap-gen --lang=js code-map keymaps.csv html atset1
6 +*/
7 +export default {
8 + "Again": 0xe005, /* html:Again (Again) -> linux:129 (KEY_AGAIN) -> atset1:57349 */
9 + "AltLeft": 0x38, /* html:AltLeft (AltLeft) -> linux:56 (KEY_LEFTALT) -> atset1:56 */
10 + "AltRight": 0xe038, /* html:AltRight (AltRight) -> linux:100 (KEY_RIGHTALT) -> atset1:57400 */
11 + "ArrowDown": 0xe050, /* html:ArrowDown (ArrowDown) -> linux:108 (KEY_DOWN) -> atset1:57424 */
12 + "ArrowLeft": 0xe04b, /* html:ArrowLeft (ArrowLeft) -> linux:105 (KEY_LEFT) -> atset1:57419 */
13 + "ArrowRight": 0xe04d, /* html:ArrowRight (ArrowRight) -> linux:106 (KEY_RIGHT) -> atset1:57421 */
14 + "ArrowUp": 0xe048, /* html:ArrowUp (ArrowUp) -> linux:103 (KEY_UP) -> atset1:57416 */
15 + "AudioVolumeDown": 0xe02e, /* html:AudioVolumeDown (AudioVolumeDown) -> linux:114 (KEY_VOLUMEDOWN) -> atset1:57390 */
16 + "AudioVolumeMute": 0xe020, /* html:AudioVolumeMute (AudioVolumeMute) -> linux:113 (KEY_MUTE) -> atset1:57376 */
17 + "AudioVolumeUp": 0xe030, /* html:AudioVolumeUp (AudioVolumeUp) -> linux:115 (KEY_VOLUMEUP) -> atset1:57392 */
18 + "Backquote": 0x29, /* html:Backquote (Backquote) -> linux:41 (KEY_GRAVE) -> atset1:41 */
19 + "Backslash": 0x2b, /* html:Backslash (Backslash) -> linux:43 (KEY_BACKSLASH) -> atset1:43 */
20 + "Backspace": 0xe, /* html:Backspace (Backspace) -> linux:14 (KEY_BACKSPACE) -> atset1:14 */
21 + "BracketLeft": 0x1a, /* html:BracketLeft (BracketLeft) -> linux:26 (KEY_LEFTBRACE) -> atset1:26 */
22 + "BracketRight": 0x1b, /* html:BracketRight (BracketRight) -> linux:27 (KEY_RIGHTBRACE) -> atset1:27 */
23 + "BrowserBack": 0xe06a, /* html:BrowserBack (BrowserBack) -> linux:158 (KEY_BACK) -> atset1:57450 */
24 + "BrowserFavorites": 0xe066, /* html:BrowserFavorites (BrowserFavorites) -> linux:156 (KEY_BOOKMARKS) -> atset1:57446 */
25 + "BrowserForward": 0xe069, /* html:BrowserForward (BrowserForward) -> linux:159 (KEY_FORWARD) -> atset1:57449 */
26 + "BrowserHome": 0xe032, /* html:BrowserHome (BrowserHome) -> linux:172 (KEY_HOMEPAGE) -> atset1:57394 */
27 + "BrowserRefresh": 0xe067, /* html:BrowserRefresh (BrowserRefresh) -> linux:173 (KEY_REFRESH) -> atset1:57447 */
28 + "BrowserSearch": 0xe065, /* html:BrowserSearch (BrowserSearch) -> linux:217 (KEY_SEARCH) -> atset1:57445 */
29 + "BrowserStop": 0xe068, /* html:BrowserStop (BrowserStop) -> linux:128 (KEY_STOP) -> atset1:57448 */
30 + "CapsLock": 0x3a, /* html:CapsLock (CapsLock) -> linux:58 (KEY_CAPSLOCK) -> atset1:58 */
31 + "Comma": 0x33, /* html:Comma (Comma) -> linux:51 (KEY_COMMA) -> atset1:51 */
32 + "ContextMenu": 0xe05d, /* html:ContextMenu (ContextMenu) -> linux:127 (KEY_COMPOSE) -> atset1:57437 */
33 + "ControlLeft": 0x1d, /* html:ControlLeft (ControlLeft) -> linux:29 (KEY_LEFTCTRL) -> atset1:29 */
34 + "ControlRight": 0xe01d, /* html:ControlRight (ControlRight) -> linux:97 (KEY_RIGHTCTRL) -> atset1:57373 */
35 + "Convert": 0x79, /* html:Convert (Convert) -> linux:92 (KEY_HENKAN) -> atset1:121 */
36 + "Copy": 0xe078, /* html:Copy (Copy) -> linux:133 (KEY_COPY) -> atset1:57464 */
37 + "Cut": 0xe03c, /* html:Cut (Cut) -> linux:137 (KEY_CUT) -> atset1:57404 */
38 + "Delete": 0xe053, /* html:Delete (Delete) -> linux:111 (KEY_DELETE) -> atset1:57427 */
39 + "Digit0": 0xb, /* html:Digit0 (Digit0) -> linux:11 (KEY_0) -> atset1:11 */
40 + "Digit1": 0x2, /* html:Digit1 (Digit1) -> linux:2 (KEY_1) -> atset1:2 */
41 + "Digit2": 0x3, /* html:Digit2 (Digit2) -> linux:3 (KEY_2) -> atset1:3 */
42 + "Digit3": 0x4, /* html:Digit3 (Digit3) -> linux:4 (KEY_3) -> atset1:4 */
43 + "Digit4": 0x5, /* html:Digit4 (Digit4) -> linux:5 (KEY_4) -> atset1:5 */
44 + "Digit5": 0x6, /* html:Digit5 (Digit5) -> linux:6 (KEY_5) -> atset1:6 */
45 + "Digit6": 0x7, /* html:Digit6 (Digit6) -> linux:7 (KEY_6) -> atset1:7 */
46 + "Digit7": 0x8, /* html:Digit7 (Digit7) -> linux:8 (KEY_7) -> atset1:8 */
47 + "Digit8": 0x9, /* html:Digit8 (Digit8) -> linux:9 (KEY_8) -> atset1:9 */
48 + "Digit9": 0xa, /* html:Digit9 (Digit9) -> linux:10 (KEY_9) -> atset1:10 */
49 + "Eject": 0xe07d, /* html:Eject (Eject) -> linux:162 (KEY_EJECTCLOSECD) -> atset1:57469 */
50 + "End": 0xe04f, /* html:End (End) -> linux:107 (KEY_END) -> atset1:57423 */
51 + "Enter": 0x1c, /* html:Enter (Enter) -> linux:28 (KEY_ENTER) -> atset1:28 */
52 + "Equal": 0xd, /* html:Equal (Equal) -> linux:13 (KEY_EQUAL) -> atset1:13 */
53 + "Escape": 0x1, /* html:Escape (Escape) -> linux:1 (KEY_ESC) -> atset1:1 */
54 + "F1": 0x3b, /* html:F1 (F1) -> linux:59 (KEY_F1) -> atset1:59 */
55 + "F10": 0x44, /* html:F10 (F10) -> linux:68 (KEY_F10) -> atset1:68 */
56 + "F11": 0x57, /* html:F11 (F11) -> linux:87 (KEY_F11) -> atset1:87 */
57 + "F12": 0x58, /* html:F12 (F12) -> linux:88 (KEY_F12) -> atset1:88 */
58 + "F13": 0x5d, /* html:F13 (F13) -> linux:183 (KEY_F13) -> atset1:93 */
59 + "F14": 0x5e, /* html:F14 (F14) -> linux:184 (KEY_F14) -> atset1:94 */
60 + "F15": 0x5f, /* html:F15 (F15) -> linux:185 (KEY_F15) -> atset1:95 */
61 + "F16": 0x55, /* html:F16 (F16) -> linux:186 (KEY_F16) -> atset1:85 */
62 + "F17": 0xe003, /* html:F17 (F17) -> linux:187 (KEY_F17) -> atset1:57347 */
63 + "F18": 0xe077, /* html:F18 (F18) -> linux:188 (KEY_F18) -> atset1:57463 */
64 + "F19": 0xe004, /* html:F19 (F19) -> linux:189 (KEY_F19) -> atset1:57348 */
65 + "F2": 0x3c, /* html:F2 (F2) -> linux:60 (KEY_F2) -> atset1:60 */
66 + "F20": 0x5a, /* html:F20 (F20) -> linux:190 (KEY_F20) -> atset1:90 */
67 + "F21": 0x74, /* html:F21 (F21) -> linux:191 (KEY_F21) -> atset1:116 */
68 + "F22": 0xe079, /* html:F22 (F22) -> linux:192 (KEY_F22) -> atset1:57465 */
69 + "F23": 0x6d, /* html:F23 (F23) -> linux:193 (KEY_F23) -> atset1:109 */
70 + "F24": 0x6f, /* html:F24 (F24) -> linux:194 (KEY_F24) -> atset1:111 */
71 + "F3": 0x3d, /* html:F3 (F3) -> linux:61 (KEY_F3) -> atset1:61 */
72 + "F4": 0x3e, /* html:F4 (F4) -> linux:62 (KEY_F4) -> atset1:62 */
73 + "F5": 0x3f, /* html:F5 (F5) -> linux:63 (KEY_F5) -> atset1:63 */
74 + "F6": 0x40, /* html:F6 (F6) -> linux:64 (KEY_F6) -> atset1:64 */
75 + "F7": 0x41, /* html:F7 (F7) -> linux:65 (KEY_F7) -> atset1:65 */
76 + "F8": 0x42, /* html:F8 (F8) -> linux:66 (KEY_F8) -> atset1:66 */
77 + "F9": 0x43, /* html:F9 (F9) -> linux:67 (KEY_F9) -> atset1:67 */
78 + "Find": 0xe041, /* html:Find (Find) -> linux:136 (KEY_FIND) -> atset1:57409 */
79 + "Help": 0xe075, /* html:Help (Help) -> linux:138 (KEY_HELP) -> atset1:57461 */
80 + "Hiragana": 0x77, /* html:Hiragana (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */
81 + "Home": 0xe047, /* html:Home (Home) -> linux:102 (KEY_HOME) -> atset1:57415 */
82 + "Insert": 0xe052, /* html:Insert (Insert) -> linux:110 (KEY_INSERT) -> atset1:57426 */
83 + "IntlBackslash": 0x56, /* html:IntlBackslash (IntlBackslash) -> linux:86 (KEY_102ND) -> atset1:86 */
84 + "IntlRo": 0x73, /* html:IntlRo (IntlRo) -> linux:89 (KEY_RO) -> atset1:115 */
85 + "IntlYen": 0x7d, /* html:IntlYen (IntlYen) -> linux:124 (KEY_YEN) -> atset1:125 */
86 + "KanaMode": 0x70, /* html:KanaMode (KanaMode) -> linux:93 (KEY_KATAKANAHIRAGANA) -> atset1:112 */
87 + "Katakana": 0x78, /* html:Katakana (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */
88 + "KeyA": 0x1e, /* html:KeyA (KeyA) -> linux:30 (KEY_A) -> atset1:30 */
89 + "KeyB": 0x30, /* html:KeyB (KeyB) -> linux:48 (KEY_B) -> atset1:48 */
90 + "KeyC": 0x2e, /* html:KeyC (KeyC) -> linux:46 (KEY_C) -> atset1:46 */
91 + "KeyD": 0x20, /* html:KeyD (KeyD) -> linux:32 (KEY_D) -> atset1:32 */
92 + "KeyE": 0x12, /* html:KeyE (KeyE) -> linux:18 (KEY_E) -> atset1:18 */
93 + "KeyF": 0x21, /* html:KeyF (KeyF) -> linux:33 (KEY_F) -> atset1:33 */
94 + "KeyG": 0x22, /* html:KeyG (KeyG) -> linux:34 (KEY_G) -> atset1:34 */
95 + "KeyH": 0x23, /* html:KeyH (KeyH) -> linux:35 (KEY_H) -> atset1:35 */
96 + "KeyI": 0x17, /* html:KeyI (KeyI) -> linux:23 (KEY_I) -> atset1:23 */
97 + "KeyJ": 0x24, /* html:KeyJ (KeyJ) -> linux:36 (KEY_J) -> atset1:36 */
98 + "KeyK": 0x25, /* html:KeyK (KeyK) -> linux:37 (KEY_K) -> atset1:37 */
99 + "KeyL": 0x26, /* html:KeyL (KeyL) -> linux:38 (KEY_L) -> atset1:38 */
100 + "KeyM": 0x32, /* html:KeyM (KeyM) -> linux:50 (KEY_M) -> atset1:50 */
101 + "KeyN": 0x31, /* html:KeyN (KeyN) -> linux:49 (KEY_N) -> atset1:49 */
102 + "KeyO": 0x18, /* html:KeyO (KeyO) -> linux:24 (KEY_O) -> atset1:24 */
103 + "KeyP": 0x19, /* html:KeyP (KeyP) -> linux:25 (KEY_P) -> atset1:25 */
104 + "KeyQ": 0x10, /* html:KeyQ (KeyQ) -> linux:16 (KEY_Q) -> atset1:16 */
105 + "KeyR": 0x13, /* html:KeyR (KeyR) -> linux:19 (KEY_R) -> atset1:19 */
106 + "KeyS": 0x1f, /* html:KeyS (KeyS) -> linux:31 (KEY_S) -> atset1:31 */
107 + "KeyT": 0x14, /* html:KeyT (KeyT) -> linux:20 (KEY_T) -> atset1:20 */
108 + "KeyU": 0x16, /* html:KeyU (KeyU) -> linux:22 (KEY_U) -> atset1:22 */
109 + "KeyV": 0x2f, /* html:KeyV (KeyV) -> linux:47 (KEY_V) -> atset1:47 */
110 + "KeyW": 0x11, /* html:KeyW (KeyW) -> linux:17 (KEY_W) -> atset1:17 */
111 + "KeyX": 0x2d, /* html:KeyX (KeyX) -> linux:45 (KEY_X) -> atset1:45 */
112 + "KeyY": 0x15, /* html:KeyY (KeyY) -> linux:21 (KEY_Y) -> atset1:21 */
113 + "KeyZ": 0x2c, /* html:KeyZ (KeyZ) -> linux:44 (KEY_Z) -> atset1:44 */
114 + "Lang3": 0x78, /* html:Lang3 (Lang3) -> linux:90 (KEY_KATAKANA) -> atset1:120 */
115 + "Lang4": 0x77, /* html:Lang4 (Lang4) -> linux:91 (KEY_HIRAGANA) -> atset1:119 */
116 + "Lang5": 0x76, /* html:Lang5 (Lang5) -> linux:85 (KEY_ZENKAKUHANKAKU) -> atset1:118 */
117 + "LaunchApp1": 0xe06b, /* html:LaunchApp1 (LaunchApp1) -> linux:157 (KEY_COMPUTER) -> atset1:57451 */
118 + "LaunchApp2": 0xe021, /* html:LaunchApp2 (LaunchApp2) -> linux:140 (KEY_CALC) -> atset1:57377 */
119 + "LaunchMail": 0xe06c, /* html:LaunchMail (LaunchMail) -> linux:155 (KEY_MAIL) -> atset1:57452 */
120 + "MediaPlayPause": 0xe022, /* html:MediaPlayPause (MediaPlayPause) -> linux:164 (KEY_PLAYPAUSE) -> atset1:57378 */
121 + "MediaSelect": 0xe06d, /* html:MediaSelect (MediaSelect) -> linux:226 (KEY_MEDIA) -> atset1:57453 */
122 + "MediaStop": 0xe024, /* html:MediaStop (MediaStop) -> linux:166 (KEY_STOPCD) -> atset1:57380 */
123 + "MediaTrackNext": 0xe019, /* html:MediaTrackNext (MediaTrackNext) -> linux:163 (KEY_NEXTSONG) -> atset1:57369 */
124 + "MediaTrackPrevious": 0xe010, /* html:MediaTrackPrevious (MediaTrackPrevious) -> linux:165 (KEY_PREVIOUSSONG) -> atset1:57360 */
125 + "MetaLeft": 0xe05b, /* html:MetaLeft (MetaLeft) -> linux:125 (KEY_LEFTMETA) -> atset1:57435 */
126 + "MetaRight": 0xe05c, /* html:MetaRight (MetaRight) -> linux:126 (KEY_RIGHTMETA) -> atset1:57436 */
127 + "Minus": 0xc, /* html:Minus (Minus) -> linux:12 (KEY_MINUS) -> atset1:12 */
128 + "NonConvert": 0x7b, /* html:NonConvert (NonConvert) -> linux:94 (KEY_MUHENKAN) -> atset1:123 */
129 + "NumLock": 0x45, /* html:NumLock (NumLock) -> linux:69 (KEY_NUMLOCK) -> atset1:69 */
130 + "Numpad0": 0x52, /* html:Numpad0 (Numpad0) -> linux:82 (KEY_KP0) -> atset1:82 */
131 + "Numpad1": 0x4f, /* html:Numpad1 (Numpad1) -> linux:79 (KEY_KP1) -> atset1:79 */
132 + "Numpad2": 0x50, /* html:Numpad2 (Numpad2) -> linux:80 (KEY_KP2) -> atset1:80 */
133 + "Numpad3": 0x51, /* html:Numpad3 (Numpad3) -> linux:81 (KEY_KP3) -> atset1:81 */
134 + "Numpad4": 0x4b, /* html:Numpad4 (Numpad4) -> linux:75 (KEY_KP4) -> atset1:75 */
135 + "Numpad5": 0x4c, /* html:Numpad5 (Numpad5) -> linux:76 (KEY_KP5) -> atset1:76 */
136 + "Numpad6": 0x4d, /* html:Numpad6 (Numpad6) -> linux:77 (KEY_KP6) -> atset1:77 */
137 + "Numpad7": 0x47, /* html:Numpad7 (Numpad7) -> linux:71 (KEY_KP7) -> atset1:71 */
138 + "Numpad8": 0x48, /* html:Numpad8 (Numpad8) -> linux:72 (KEY_KP8) -> atset1:72 */
139 + "Numpad9": 0x49, /* html:Numpad9 (Numpad9) -> linux:73 (KEY_KP9) -> atset1:73 */
140 + "NumpadAdd": 0x4e, /* html:NumpadAdd (NumpadAdd) -> linux:78 (KEY_KPPLUS) -> atset1:78 */
141 + "NumpadComma": 0x7e, /* html:NumpadComma (NumpadComma) -> linux:121 (KEY_KPCOMMA) -> atset1:126 */
142 + "NumpadDecimal": 0x53, /* html:NumpadDecimal (NumpadDecimal) -> linux:83 (KEY_KPDOT) -> atset1:83 */
143 + "NumpadDivide": 0xe035, /* html:NumpadDivide (NumpadDivide) -> linux:98 (KEY_KPSLASH) -> atset1:57397 */
144 + "NumpadEnter": 0xe01c, /* html:NumpadEnter (NumpadEnter) -> linux:96 (KEY_KPENTER) -> atset1:57372 */
145 + "NumpadEqual": 0x59, /* html:NumpadEqual (NumpadEqual) -> linux:117 (KEY_KPEQUAL) -> atset1:89 */
146 + "NumpadMultiply": 0x37, /* html:NumpadMultiply (NumpadMultiply) -> linux:55 (KEY_KPASTERISK) -> atset1:55 */
147 + "NumpadParenLeft": 0xe076, /* html:NumpadParenLeft (NumpadParenLeft) -> linux:179 (KEY_KPLEFTPAREN) -> atset1:57462 */
148 + "NumpadParenRight": 0xe07b, /* html:NumpadParenRight (NumpadParenRight) -> linux:180 (KEY_KPRIGHTPAREN) -> atset1:57467 */
149 + "NumpadSubtract": 0x4a, /* html:NumpadSubtract (NumpadSubtract) -> linux:74 (KEY_KPMINUS) -> atset1:74 */
150 + "Open": 0x64, /* html:Open (Open) -> linux:134 (KEY_OPEN) -> atset1:100 */
151 + "PageDown": 0xe051, /* html:PageDown (PageDown) -> linux:109 (KEY_PAGEDOWN) -> atset1:57425 */
152 + "PageUp": 0xe049, /* html:PageUp (PageUp) -> linux:104 (KEY_PAGEUP) -> atset1:57417 */
153 + "Paste": 0x65, /* html:Paste (Paste) -> linux:135 (KEY_PASTE) -> atset1:101 */
154 + "Pause": 0xe046, /* html:Pause (Pause) -> linux:119 (KEY_PAUSE) -> atset1:57414 */
155 + "Period": 0x34, /* html:Period (Period) -> linux:52 (KEY_DOT) -> atset1:52 */
156 + "Power": 0xe05e, /* html:Power (Power) -> linux:116 (KEY_POWER) -> atset1:57438 */
157 + "PrintScreen": 0x54, /* html:PrintScreen (PrintScreen) -> linux:99 (KEY_SYSRQ) -> atset1:84 */
158 + "Props": 0xe006, /* html:Props (Props) -> linux:130 (KEY_PROPS) -> atset1:57350 */
159 + "Quote": 0x28, /* html:Quote (Quote) -> linux:40 (KEY_APOSTROPHE) -> atset1:40 */
160 + "ScrollLock": 0x46, /* html:ScrollLock (ScrollLock) -> linux:70 (KEY_SCROLLLOCK) -> atset1:70 */
161 + "Semicolon": 0x27, /* html:Semicolon (Semicolon) -> linux:39 (KEY_SEMICOLON) -> atset1:39 */
162 + "ShiftLeft": 0x2a, /* html:ShiftLeft (ShiftLeft) -> linux:42 (KEY_LEFTSHIFT) -> atset1:42 */
163 + "ShiftRight": 0x36, /* html:ShiftRight (ShiftRight) -> linux:54 (KEY_RIGHTSHIFT) -> atset1:54 */
164 + "Slash": 0x35, /* html:Slash (Slash) -> linux:53 (KEY_SLASH) -> atset1:53 */
165 + "Sleep": 0xe05f, /* html:Sleep (Sleep) -> linux:142 (KEY_SLEEP) -> atset1:57439 */
166 + "Space": 0x39, /* html:Space (Space) -> linux:57 (KEY_SPACE) -> atset1:57 */
167 + "Suspend": 0xe025, /* html:Suspend (Suspend) -> linux:205 (KEY_SUSPEND) -> atset1:57381 */
168 + "Tab": 0xf, /* html:Tab (Tab) -> linux:15 (KEY_TAB) -> atset1:15 */
169 + "Undo": 0xe007, /* html:Undo (Undo) -> linux:131 (KEY_UNDO) -> atset1:57351 */
170 + "WakeUp": 0xe063, /* html:WakeUp (WakeUp) -> linux:143 (KEY_WAKEUP) -> atset1:57443 */
171 +};
public/novnc/core/rfb.js new
+2055
@@ -0,0 +1,2055 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + *
8 + */
9 +
10 +import * as Log from './util/logging.js';
11 +import { decodeUTF8 } from './util/strings.js';
12 +import { dragThreshold } from './util/browser.js';
13 +import EventTargetMixin from './util/eventtarget.js';
14 +import Display from "./display.js";
15 +import Keyboard from "./input/keyboard.js";
16 +import Mouse from "./input/mouse.js";
17 +import Cursor from "./util/cursor.js";
18 +import Websock from "./websock.js";
19 +import DES from "./des.js";
20 +import KeyTable from "./input/keysym.js";
21 +import XtScancode from "./input/xtscancodes.js";
22 +import { encodings } from "./encodings.js";
23 +import "./util/polyfill.js";
24 +
25 +import RawDecoder from "./decoders/raw.js";
26 +import CopyRectDecoder from "./decoders/copyrect.js";
27 +import RREDecoder from "./decoders/rre.js";
28 +import HextileDecoder from "./decoders/hextile.js";
29 +import TightDecoder from "./decoders/tight.js";
30 +import TightPNGDecoder from "./decoders/tightpng.js";
31 +
32 +// How many seconds to wait for a disconnect to finish
33 +const DISCONNECT_TIMEOUT = 3;
34 +const DEFAULT_BACKGROUND = 'rgb(40, 40, 40)';
35 +
36 +export default class RFB extends EventTargetMixin {
37 + constructor(target, url, options) {
38 + if (!target) {
39 + throw new Error("Must specify target");
40 + }
41 + if (!url) {
42 + throw new Error("Must specify URL");
43 + }
44 +
45 + super();
46 +
47 + this._target = target;
48 + this._url = url;
49 +
50 + // Connection details
51 + options = options || {};
52 + this._rfb_credentials = options.credentials || {};
53 + this._shared = 'shared' in options ? !!options.shared : true;
54 + this._repeaterID = options.repeaterID || '';
55 + this._showDotCursor = options.showDotCursor || false;
56 +
57 + // Internal state
58 + this._rfb_connection_state = '';
59 + this._rfb_init_state = '';
60 + this._rfb_auth_scheme = -1;
61 + this._rfb_clean_disconnect = true;
62 +
63 + // Server capabilities
64 + this._rfb_version = 0;
65 + this._rfb_max_version = 3.8;
66 + this._rfb_tightvnc = false;
67 + this._rfb_xvp_ver = 0;
68 +
69 + this._fb_width = 0;
70 + this._fb_height = 0;
71 +
72 + this._fb_name = "";
73 +
74 + this._capabilities = { power: false };
75 +
76 + this._supportsFence = false;
77 +
78 + this._supportsContinuousUpdates = false;
79 + this._enabledContinuousUpdates = false;
80 +
81 + this._supportsSetDesktopSize = false;
82 + this._screen_id = 0;
83 + this._screen_flags = 0;
84 +
85 + this._qemuExtKeyEventSupported = false;
86 +
87 + // Internal objects
88 + this._sock = null; // Websock object
89 + this._display = null; // Display object
90 + this._flushing = false; // Display flushing state
91 + this._keyboard = null; // Keyboard input handler object
92 + this._mouse = null; // Mouse input handler object
93 +
94 + // Timers
95 + this._disconnTimer = null; // disconnection timer
96 + this._resizeTimeout = null; // resize rate limiting
97 +
98 + // Decoder states
99 + this._decoders = {};
100 +
101 + this._FBU = {
102 + rects: 0,
103 + x: 0,
104 + y: 0,
105 + width: 0,
106 + height: 0,
107 + encoding: null,
108 + };
109 +
110 + // Mouse state
111 + this._mouse_buttonMask = 0;
112 + this._mouse_arr = [];
113 + this._viewportDragging = false;
114 + this._viewportDragPos = {};
115 + this._viewportHasMoved = false;
116 +
117 + // Bound event handlers
118 + this._eventHandlers = {
119 + focusCanvas: this._focusCanvas.bind(this),
120 + windowResize: this._windowResize.bind(this),
121 + };
122 +
123 + // main setup
124 + Log.Debug(">> RFB.constructor");
125 +
126 + // Create DOM elements
127 + this._screen = document.createElement('div');
128 + this._screen.style.display = 'flex';
129 + this._screen.style.width = '100%';
130 + this._screen.style.height = '100%';
131 + this._screen.style.overflow = 'auto';
132 + this._screen.style.background = DEFAULT_BACKGROUND;
133 + this._canvas = document.createElement('canvas');
134 + this._canvas.style.margin = 'auto';
135 + // Some browsers add an outline on focus
136 + this._canvas.style.outline = 'none';
137 + // IE miscalculates width without this :(
138 + this._canvas.style.flexShrink = '0';
139 + this._canvas.width = 0;
140 + this._canvas.height = 0;
141 + this._canvas.tabIndex = -1;
142 + this._screen.appendChild(this._canvas);
143 +
144 + // Cursor
145 + this._cursor = new Cursor();
146 +
147 + // XXX: TightVNC 2.8.11 sends no cursor at all until Windows changes
148 + // it. Result: no cursor at all until a window border or an edit field
149 + // is hit blindly. But there are also VNC servers that draw the cursor
150 + // in the framebuffer and don't send the empty local cursor. There is
151 + // no way to satisfy both sides.
152 + //
153 + // The spec is unclear on this "initial cursor" issue. Many other
154 + // viewers (TigerVNC, RealVNC, Remmina) display an arrow as the
155 + // initial cursor instead.
156 + this._cursorImage = RFB.cursors.none;
157 +
158 + // populate decoder array with objects
159 + this._decoders[encodings.encodingRaw] = new RawDecoder();
160 + this._decoders[encodings.encodingCopyRect] = new CopyRectDecoder();
161 + this._decoders[encodings.encodingRRE] = new RREDecoder();
162 + this._decoders[encodings.encodingHextile] = new HextileDecoder();
163 + this._decoders[encodings.encodingTight] = new TightDecoder();
164 + this._decoders[encodings.encodingTightPNG] = new TightPNGDecoder();
165 +
166 + // NB: nothing that needs explicit teardown should be done
167 + // before this point, since this can throw an exception
168 + try {
169 + this._display = new Display(this._canvas);
170 + } catch (exc) {
171 + Log.Error("Display exception: " + exc);
172 + throw exc;
173 + }
174 + this._display.onflush = this._onFlush.bind(this);
175 + this._display.clear();
176 +
177 + this._keyboard = new Keyboard(this._canvas);
178 + this._keyboard.onkeyevent = this._handleKeyEvent.bind(this);
179 +
180 + this._mouse = new Mouse(this._canvas);
181 + this._mouse.onmousebutton = this._handleMouseButton.bind(this);
182 + this._mouse.onmousemove = this._handleMouseMove.bind(this);
183 +
184 + this._sock = new Websock();
185 + this._sock.on('message', () => {
186 + this._handle_message();
187 + });
188 + this._sock.on('open', () => {
189 + if ((this._rfb_connection_state === 'connecting') &&
190 + (this._rfb_init_state === '')) {
191 + this._rfb_init_state = 'ProtocolVersion';
192 + Log.Debug("Starting VNC handshake");
193 + } else {
194 + this._fail("Unexpected server connection while " +
195 + this._rfb_connection_state);
196 + }
197 + });
198 + this._sock.on('close', (e) => {
199 + Log.Debug("WebSocket on-close event");
200 + let msg = "";
201 + if (e.code) {
202 + msg = "(code: " + e.code;
203 + if (e.reason) {
204 + msg += ", reason: " + e.reason;
205 + }
206 + msg += ")";
207 + }
208 + switch (this._rfb_connection_state) {
209 + case 'connecting':
210 + this._fail("Connection closed " + msg);
211 + break;
212 + case 'connected':
213 + // Handle disconnects that were initiated server-side
214 + this._updateConnectionState('disconnecting');
215 + this._updateConnectionState('disconnected');
216 + break;
217 + case 'disconnecting':
218 + // Normal disconnection path
219 + this._updateConnectionState('disconnected');
220 + break;
221 + case 'disconnected':
222 + this._fail("Unexpected server disconnect " +
223 + "when already disconnected " + msg);
224 + break;
225 + default:
226 + this._fail("Unexpected server disconnect before connecting " +
227 + msg);
228 + break;
229 + }
230 + this._sock.off('close');
231 + });
232 + this._sock.on('error', e => Log.Warn("WebSocket on-error event"));
233 +
234 + // Slight delay of the actual connection so that the caller has
235 + // time to set up callbacks
236 + setTimeout(this._updateConnectionState.bind(this, 'connecting'));
237 +
238 + Log.Debug("<< RFB.constructor");
239 +
240 + // ===== PROPERTIES =====
241 +
242 + this.dragViewport = false;
243 + this.focusOnClick = true;
244 +
245 + this._viewOnly = false;
246 + this._clipViewport = false;
247 + this._scaleViewport = false;
248 + this._resizeSession = false;
249 + }
250 +
251 + // ===== PROPERTIES =====
252 +
253 + get viewOnly() { return this._viewOnly; }
254 + set viewOnly(viewOnly) {
255 + this._viewOnly = viewOnly;
256 +
257 + if (this._rfb_connection_state === "connecting" ||
258 + this._rfb_connection_state === "connected") {
259 + if (viewOnly) {
260 + this._keyboard.ungrab();
261 + this._mouse.ungrab();
262 + } else {
263 + this._keyboard.grab();
264 + this._mouse.grab();
265 + }
266 + }
267 + }
268 +
269 + get capabilities() { return this._capabilities; }
270 +
271 + get touchButton() { return this._mouse.touchButton; }
272 + set touchButton(button) { this._mouse.touchButton = button; }
273 +
274 + get clipViewport() { return this._clipViewport; }
275 + set clipViewport(viewport) {
276 + this._clipViewport = viewport;
277 + this._updateClip();
278 + }
279 +
280 + get scaleViewport() { return this._scaleViewport; }
281 + set scaleViewport(scale) {
282 + this._scaleViewport = scale;
283 + // Scaling trumps clipping, so we may need to adjust
284 + // clipping when enabling or disabling scaling
285 + if (scale && this._clipViewport) {
286 + this._updateClip();
287 + }
288 + this._updateScale();
289 + if (!scale && this._clipViewport) {
290 + this._updateClip();
291 + }
292 + }
293 +
294 + get resizeSession() { return this._resizeSession; }
295 + set resizeSession(resize) {
296 + this._resizeSession = resize;
297 + if (resize) {
298 + this._requestRemoteResize();
299 + }
300 + }
301 +
302 + get showDotCursor() { return this._showDotCursor; }
303 + set showDotCursor(show) {
304 + this._showDotCursor = show;
305 + this._refreshCursor();
306 + }
307 +
308 + get background() { return this._screen.style.background; }
309 + set background(cssValue) { this._screen.style.background = cssValue; }
310 +
311 + // ===== PUBLIC METHODS =====
312 +
313 + disconnect() {
314 + this._updateConnectionState('disconnecting');
315 + this._sock.off('error');
316 + this._sock.off('message');
317 + this._sock.off('open');
318 + }
319 +
320 + sendCredentials(creds) {
321 + this._rfb_credentials = creds;
322 + setTimeout(this._init_msg.bind(this), 0);
323 + }
324 +
325 + sendCtrlAltDel() {
326 + if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; }
327 + Log.Info("Sending Ctrl-Alt-Del");
328 +
329 + this.sendKey(KeyTable.XK_Control_L, "ControlLeft", true);
330 + this.sendKey(KeyTable.XK_Alt_L, "AltLeft", true);
331 + this.sendKey(KeyTable.XK_Delete, "Delete", true);
332 + this.sendKey(KeyTable.XK_Delete, "Delete", false);
333 + this.sendKey(KeyTable.XK_Alt_L, "AltLeft", false);
334 + this.sendKey(KeyTable.XK_Control_L, "ControlLeft", false);
335 + }
336 +
337 + machineShutdown() {
338 + this._xvpOp(1, 2);
339 + }
340 +
341 + machineReboot() {
342 + this._xvpOp(1, 3);
343 + }
344 +
345 + machineReset() {
346 + this._xvpOp(1, 4);
347 + }
348 +
349 + // Send a key press. If 'down' is not specified then send a down key
350 + // followed by an up key.
351 + sendKey(keysym, code, down) {
352 + if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; }
353 +
354 + if (down === undefined) {
355 + this.sendKey(keysym, code, true);
356 + this.sendKey(keysym, code, false);
357 + return;
358 + }
359 +
360 + const scancode = XtScancode[code];
361 +
362 + if (this._qemuExtKeyEventSupported && scancode) {
363 + // 0 is NoSymbol
364 + keysym = keysym || 0;
365 +
366 + Log.Info("Sending key (" + (down ? "down" : "up") + "): keysym " + keysym + ", scancode " + scancode);
367 +
368 + RFB.messages.QEMUExtendedKeyEvent(this._sock, keysym, down, scancode);
369 + } else {
370 + if (!keysym) {
371 + return;
372 + }
373 + Log.Info("Sending keysym (" + (down ? "down" : "up") + "): " + keysym);
374 + RFB.messages.keyEvent(this._sock, keysym, down ? 1 : 0);
375 + }
376 + }
377 +
378 + focus() {
379 + this._canvas.focus();
380 + }
381 +
382 + blur() {
383 + this._canvas.blur();
384 + }
385 +
386 + clipboardPasteFrom(text) {
387 + if (this._rfb_connection_state !== 'connected' || this._viewOnly) { return; }
388 + RFB.messages.clientCutText(this._sock, text);
389 + }
390 +
391 + // ===== PRIVATE METHODS =====
392 +
393 + _connect() {
394 + Log.Debug(">> RFB.connect");
395 +
396 + Log.Info("connecting to " + this._url);
397 +
398 + try {
399 + // WebSocket.onopen transitions to the RFB init states
400 + this._sock.open(this._url, ['binary']);
401 + } catch (e) {
402 + if (e.name === 'SyntaxError') {
403 + this._fail("Invalid host or port (" + e + ")");
404 + } else {
405 + this._fail("Error when opening socket (" + e + ")");
406 + }
407 + }
408 +
409 + // Make our elements part of the page
410 + this._target.appendChild(this._screen);
411 +
412 + this._cursor.attach(this._canvas);
413 + this._refreshCursor();
414 +
415 + // Monitor size changes of the screen
416 + // FIXME: Use ResizeObserver, or hidden overflow
417 + window.addEventListener('resize', this._eventHandlers.windowResize);
418 +
419 + // Always grab focus on some kind of click event
420 + this._canvas.addEventListener("mousedown", this._eventHandlers.focusCanvas);
421 + this._canvas.addEventListener("touchstart", this._eventHandlers.focusCanvas);
422 +
423 + Log.Debug("<< RFB.connect");
424 + }
425 +
426 + _disconnect() {
427 + Log.Debug(">> RFB.disconnect");
428 + this._cursor.detach();
429 + this._canvas.removeEventListener("mousedown", this._eventHandlers.focusCanvas);
430 + this._canvas.removeEventListener("touchstart", this._eventHandlers.focusCanvas);
431 + window.removeEventListener('resize', this._eventHandlers.windowResize);
432 + this._keyboard.ungrab();
433 + this._mouse.ungrab();
434 + this._sock.close();
435 + try {
436 + this._target.removeChild(this._screen);
437 + } catch (e) {
438 + if (e.name === 'NotFoundError') {
439 + // Some cases where the initial connection fails
440 + // can disconnect before the _screen is created
441 + } else {
442 + throw e;
443 + }
444 + }
445 + clearTimeout(this._resizeTimeout);
446 + Log.Debug("<< RFB.disconnect");
447 + }
448 +
449 + _focusCanvas(event) {
450 + // Respect earlier handlers' request to not do side-effects
451 + if (event.defaultPrevented) {
452 + return;
453 + }
454 +
455 + if (!this.focusOnClick) {
456 + return;
457 + }
458 +
459 + this.focus();
460 + }
461 +
462 + _windowResize(event) {
463 + // If the window resized then our screen element might have
464 + // as well. Update the viewport dimensions.
465 + window.requestAnimationFrame(() => {
466 + this._updateClip();
467 + this._updateScale();
468 + });
469 +
470 + if (this._resizeSession) {
471 + // Request changing the resolution of the remote display to
472 + // the size of the local browser viewport.
473 +
474 + // In order to not send multiple requests before the browser-resize
475 + // is finished we wait 0.5 seconds before sending the request.
476 + clearTimeout(this._resizeTimeout);
477 + this._resizeTimeout = setTimeout(this._requestRemoteResize.bind(this), 500);
478 + }
479 + }
480 +
481 + // Update state of clipping in Display object, and make sure the
482 + // configured viewport matches the current screen size
483 + _updateClip() {
484 + const cur_clip = this._display.clipViewport;
485 + let new_clip = this._clipViewport;
486 +
487 + if (this._scaleViewport) {
488 + // Disable viewport clipping if we are scaling
489 + new_clip = false;
490 + }
491 +
492 + if (cur_clip !== new_clip) {
493 + this._display.clipViewport = new_clip;
494 + }
495 +
496 + if (new_clip) {
497 + // When clipping is enabled, the screen is limited to
498 + // the size of the container.
499 + const size = this._screenSize();
500 + this._display.viewportChangeSize(size.w, size.h);
501 + this._fixScrollbars();
502 + }
503 + }
504 +
505 + _updateScale() {
506 + if (!this._scaleViewport) {
507 + this._display.scale = 1.0;
508 + } else {
509 + const size = this._screenSize();
510 + this._display.autoscale(size.w, size.h);
511 + }
512 + this._fixScrollbars();
513 + }
514 +
515 + // Requests a change of remote desktop size. This message is an extension
516 + // and may only be sent if we have received an ExtendedDesktopSize message
517 + _requestRemoteResize() {
518 + clearTimeout(this._resizeTimeout);
519 + this._resizeTimeout = null;
520 +
521 + if (!this._resizeSession || this._viewOnly ||
522 + !this._supportsSetDesktopSize) {
523 + return;
524 + }
525 +
526 + const size = this._screenSize();
527 + RFB.messages.setDesktopSize(this._sock,
528 + Math.floor(size.w), Math.floor(size.h),
529 + this._screen_id, this._screen_flags);
530 +
531 + Log.Debug('Requested new desktop size: ' +
532 + size.w + 'x' + size.h);
533 + }
534 +
535 + // Gets the the size of the available screen
536 + _screenSize() {
537 + let r = this._screen.getBoundingClientRect();
538 + return { w: r.width, h: r.height };
539 + }
540 +
541 + _fixScrollbars() {
542 + // This is a hack because Chrome screws up the calculation
543 + // for when scrollbars are needed. So to fix it we temporarily
544 + // toggle them off and on.
545 + const orig = this._screen.style.overflow;
546 + this._screen.style.overflow = 'hidden';
547 + // Force Chrome to recalculate the layout by asking for
548 + // an element's dimensions
549 + this._screen.getBoundingClientRect();
550 + this._screen.style.overflow = orig;
551 + }
552 +
553 + /*
554 + * Connection states:
555 + * connecting
556 + * connected
557 + * disconnecting
558 + * disconnected - permanent state
559 + */
560 + _updateConnectionState(state) {
561 + const oldstate = this._rfb_connection_state;
562 +
563 + if (state === oldstate) {
564 + Log.Debug("Already in state '" + state + "', ignoring");
565 + return;
566 + }
567 +
568 + // The 'disconnected' state is permanent for each RFB object
569 + if (oldstate === 'disconnected') {
570 + Log.Error("Tried changing state of a disconnected RFB object");
571 + return;
572 + }
573 +
574 + // Ensure proper transitions before doing anything
575 + switch (state) {
576 + case 'connected':
577 + if (oldstate !== 'connecting') {
578 + Log.Error("Bad transition to connected state, " +
579 + "previous connection state: " + oldstate);
580 + return;
581 + }
582 + break;
583 +
584 + case 'disconnected':
585 + if (oldstate !== 'disconnecting') {
586 + Log.Error("Bad transition to disconnected state, " +
587 + "previous connection state: " + oldstate);
588 + return;
589 + }
590 + break;
591 +
592 + case 'connecting':
593 + if (oldstate !== '') {
594 + Log.Error("Bad transition to connecting state, " +
595 + "previous connection state: " + oldstate);
596 + return;
597 + }
598 + break;
599 +
600 + case 'disconnecting':
601 + if (oldstate !== 'connected' && oldstate !== 'connecting') {
602 + Log.Error("Bad transition to disconnecting state, " +
603 + "previous connection state: " + oldstate);
604 + return;
605 + }
606 + break;
607 +
608 + default:
609 + Log.Error("Unknown connection state: " + state);
610 + return;
611 + }
612 +
613 + // State change actions
614 +
615 + this._rfb_connection_state = state;
616 +
617 + Log.Debug("New state '" + state + "', was '" + oldstate + "'.");
618 +
619 + if (this._disconnTimer && state !== 'disconnecting') {
620 + Log.Debug("Clearing disconnect timer");
621 + clearTimeout(this._disconnTimer);
622 + this._disconnTimer = null;
623 +
624 + // make sure we don't get a double event
625 + this._sock.off('close');
626 + }
627 +
628 + switch (state) {
629 + case 'connecting':
630 + this._connect();
631 + break;
632 +
633 + case 'connected':
634 + this.dispatchEvent(new CustomEvent("connect", { detail: {} }));
635 + break;
636 +
637 + case 'disconnecting':
638 + this._disconnect();
639 +
640 + this._disconnTimer = setTimeout(() => {
641 + Log.Error("Disconnection timed out.");
642 + this._updateConnectionState('disconnected');
643 + }, DISCONNECT_TIMEOUT * 1000);
644 + break;
645 +
646 + case 'disconnected':
647 + this.dispatchEvent(new CustomEvent(
648 + "disconnect", { detail:
649 + { clean: this._rfb_clean_disconnect } }));
650 + break;
651 + }
652 + }
653 +
654 + /* Print errors and disconnect
655 + *
656 + * The parameter 'details' is used for information that
657 + * should be logged but not sent to the user interface.
658 + */
659 + _fail(details) {
660 + switch (this._rfb_connection_state) {
661 + case 'disconnecting':
662 + Log.Error("Failed when disconnecting: " + details);
663 + break;
664 + case 'connected':
665 + Log.Error("Failed while connected: " + details);
666 + break;
667 + case 'connecting':
668 + Log.Error("Failed when connecting: " + details);
669 + break;
670 + default:
671 + Log.Error("RFB failure: " + details);
672 + break;
673 + }
674 + this._rfb_clean_disconnect = false; //This is sent to the UI
675 +
676 + // Transition to disconnected without waiting for socket to close
677 + this._updateConnectionState('disconnecting');
678 + this._updateConnectionState('disconnected');
679 +
680 + return false;
681 + }
682 +
683 + _setCapability(cap, val) {
684 + this._capabilities[cap] = val;
685 + this.dispatchEvent(new CustomEvent("capabilities",
686 + { detail: { capabilities: this._capabilities } }));
687 + }
688 +
689 + _handle_message() {
690 + if (this._sock.rQlen === 0) {
691 + Log.Warn("handle_message called on an empty receive queue");
692 + return;
693 + }
694 +
695 + switch (this._rfb_connection_state) {
696 + case 'disconnected':
697 + Log.Error("Got data while disconnected");
698 + break;
699 + case 'connected':
700 + while (true) {
701 + if (this._flushing) {
702 + break;
703 + }
704 + if (!this._normal_msg()) {
705 + break;
706 + }
707 + if (this._sock.rQlen === 0) {
708 + break;
709 + }
710 + }
711 + break;
712 + default:
713 + this._init_msg();
714 + break;
715 + }
716 + }
717 +
718 + _handleKeyEvent(keysym, code, down) {
719 + this.sendKey(keysym, code, down);
720 + }
721 +
722 + _handleMouseButton(x, y, down, bmask) {
723 + if (down) {
724 + this._mouse_buttonMask |= bmask;
725 + } else {
726 + this._mouse_buttonMask &= ~bmask;
727 + }
728 +
729 + if (this.dragViewport) {
730 + if (down && !this._viewportDragging) {
731 + this._viewportDragging = true;
732 + this._viewportDragPos = {'x': x, 'y': y};
733 + this._viewportHasMoved = false;
734 +
735 + // Skip sending mouse events
736 + return;
737 + } else {
738 + this._viewportDragging = false;
739 +
740 + // If we actually performed a drag then we are done
741 + // here and should not send any mouse events
742 + if (this._viewportHasMoved) {
743 + return;
744 + }
745 +
746 + // Otherwise we treat this as a mouse click event.
747 + // Send the button down event here, as the button up
748 + // event is sent at the end of this function.
749 + RFB.messages.pointerEvent(this._sock,
750 + this._display.absX(x),
751 + this._display.absY(y),
752 + bmask);
753 + }
754 + }
755 +
756 + if (this._viewOnly) { return; } // View only, skip mouse events
757 +
758 + if (this._rfb_connection_state !== 'connected') { return; }
759 + RFB.messages.pointerEvent(this._sock, this._display.absX(x), this._display.absY(y), this._mouse_buttonMask);
760 + }
761 +
762 + _handleMouseMove(x, y) {
763 + if (this._viewportDragging) {
764 + const deltaX = this._viewportDragPos.x - x;
765 + const deltaY = this._viewportDragPos.y - y;
766 +
767 + if (this._viewportHasMoved || (Math.abs(deltaX) > dragThreshold ||
768 + Math.abs(deltaY) > dragThreshold)) {
769 + this._viewportHasMoved = true;
770 +
771 + this._viewportDragPos = {'x': x, 'y': y};
772 + this._display.viewportChangePos(deltaX, deltaY);
773 + }
774 +
775 + // Skip sending mouse events
776 + return;
777 + }
778 +
779 + if (this._viewOnly) { return; } // View only, skip mouse events
780 +
781 + if (this._rfb_connection_state !== 'connected') { return; }
782 + RFB.messages.pointerEvent(this._sock, this._display.absX(x), this._display.absY(y), this._mouse_buttonMask);
783 + }
784 +
785 + // Message Handlers
786 +
787 + _negotiate_protocol_version() {
788 + if (this._sock.rQwait("version", 12)) {
789 + return false;
790 + }
791 +
792 + const sversion = this._sock.rQshiftStr(12).substr(4, 7);
793 + Log.Info("Server ProtocolVersion: " + sversion);
794 + let is_repeater = 0;
795 + switch (sversion) {
796 + case "000.000": // UltraVNC repeater
797 + is_repeater = 1;
798 + break;
799 + case "003.003":
800 + case "003.006": // UltraVNC
801 + case "003.889": // Apple Remote Desktop
802 + this._rfb_version = 3.3;
803 + break;
804 + case "003.007":
805 + this._rfb_version = 3.7;
806 + break;
807 + case "003.008":
808 + case "004.000": // Intel AMT KVM
809 + case "004.001": // RealVNC 4.6
810 + case "005.000": // RealVNC 5.3
811 + this._rfb_version = 3.8;
812 + break;
813 + default:
814 + return this._fail("Invalid server version " + sversion);
815 + }
816 +
817 + if (is_repeater) {
818 + let repeaterID = "ID:" + this._repeaterID;
819 + while (repeaterID.length < 250) {
820 + repeaterID += "\0";
821 + }
822 + this._sock.send_string(repeaterID);
823 + return true;
824 + }
825 +
826 + if (this._rfb_version > this._rfb_max_version) {
827 + this._rfb_version = this._rfb_max_version;
828 + }
829 +
830 + const cversion = "00" + parseInt(this._rfb_version, 10) +
831 + ".00" + ((this._rfb_version * 10) % 10);
832 + this._sock.send_string("RFB " + cversion + "\n");
833 + Log.Debug('Sent ProtocolVersion: ' + cversion);
834 +
835 + this._rfb_init_state = 'Security';
836 + }
837 +
838 + _negotiate_security() {
839 + // Polyfill since IE and PhantomJS doesn't have
840 + // TypedArray.includes()
841 + function includes(item, array) {
842 + for (let i = 0; i < array.length; i++) {
843 + if (array[i] === item) {
844 + return true;
845 + }
846 + }
847 + return false;
848 + }
849 +
850 + if (this._rfb_version >= 3.7) {
851 + // Server sends supported list, client decides
852 + const num_types = this._sock.rQshift8();
853 + if (this._sock.rQwait("security type", num_types, 1)) { return false; }
854 +
855 + if (num_types === 0) {
856 + this._rfb_init_state = "SecurityReason";
857 + this._security_context = "no security types";
858 + this._security_status = 1;
859 + return this._init_msg();
860 + }
861 +
862 + const types = this._sock.rQshiftBytes(num_types);
863 + Log.Debug("Server security types: " + types);
864 +
865 + // Look for each auth in preferred order
866 + if (includes(1, types)) {
867 + this._rfb_auth_scheme = 1; // None
868 + } else if (includes(22, types)) {
869 + this._rfb_auth_scheme = 22; // XVP
870 + } else if (includes(16, types)) {
871 + this._rfb_auth_scheme = 16; // Tight
872 + } else if (includes(2, types)) {
873 + this._rfb_auth_scheme = 2; // VNC Auth
874 + } else {
875 + return this._fail("Unsupported security types (types: " + types + ")");
876 + }
877 +
878 + this._sock.send([this._rfb_auth_scheme]);
879 + } else {
880 + // Server decides
881 + if (this._sock.rQwait("security scheme", 4)) { return false; }
882 + this._rfb_auth_scheme = this._sock.rQshift32();
883 +
884 + if (this._rfb_auth_scheme == 0) {
885 + this._rfb_init_state = "SecurityReason";
886 + this._security_context = "authentication scheme";
887 + this._security_status = 1;
888 + return this._init_msg();
889 + }
890 + }
891 +
892 + this._rfb_init_state = 'Authentication';
893 + Log.Debug('Authenticating using scheme: ' + this._rfb_auth_scheme);
894 +
895 + return this._init_msg(); // jump to authentication
896 + }
897 +
898 + _handle_security_reason() {
899 + if (this._sock.rQwait("reason length", 4)) {
900 + return false;
901 + }
902 + const strlen = this._sock.rQshift32();
903 + let reason = "";
904 +
905 + if (strlen > 0) {
906 + if (this._sock.rQwait("reason", strlen, 4)) { return false; }
907 + reason = this._sock.rQshiftStr(strlen);
908 + }
909 +
910 + if (reason !== "") {
911 + this.dispatchEvent(new CustomEvent(
912 + "securityfailure",
913 + { detail: { status: this._security_status,
914 + reason: reason } }));
915 +
916 + return this._fail("Security negotiation failed on " +
917 + this._security_context +
918 + " (reason: " + reason + ")");
919 + } else {
920 + this.dispatchEvent(new CustomEvent(
921 + "securityfailure",
922 + { detail: { status: this._security_status } }));
923 +
924 + return this._fail("Security negotiation failed on " +
925 + this._security_context);
926 + }
927 + }
928 +
929 + // authentication
930 + _negotiate_xvp_auth() {
931 + if (!this._rfb_credentials.username ||
932 + !this._rfb_credentials.password ||
933 + !this._rfb_credentials.target) {
934 + this.dispatchEvent(new CustomEvent(
935 + "credentialsrequired",
936 + { detail: { types: ["username", "password", "target"] } }));
937 + return false;
938 + }
939 +
940 + const xvp_auth_str = String.fromCharCode(this._rfb_credentials.username.length) +
941 + String.fromCharCode(this._rfb_credentials.target.length) +
942 + this._rfb_credentials.username +
943 + this._rfb_credentials.target;
944 + this._sock.send_string(xvp_auth_str);
945 + this._rfb_auth_scheme = 2;
946 + return this._negotiate_authentication();
947 + }
948 +
949 + _negotiate_std_vnc_auth() {
950 + if (this._sock.rQwait("auth challenge", 16)) { return false; }
951 +
952 + if (!this._rfb_credentials.password) {
953 + this.dispatchEvent(new CustomEvent(
954 + "credentialsrequired",
955 + { detail: { types: ["password"] } }));
956 + return false;
957 + }
958 +
959 + // TODO(directxman12): make genDES not require an Array
960 + const challenge = Array.prototype.slice.call(this._sock.rQshiftBytes(16));
961 + const response = RFB.genDES(this._rfb_credentials.password, challenge);
962 + this._sock.send(response);
963 + this._rfb_init_state = "SecurityResult";
964 + return true;
965 + }
966 +
967 + _negotiate_tight_tunnels(numTunnels) {
968 + const clientSupportedTunnelTypes = {
969 + 0: { vendor: 'TGHT', signature: 'NOTUNNEL' }
970 + };
971 + const serverSupportedTunnelTypes = {};
972 + // receive tunnel capabilities
973 + for (let i = 0; i < numTunnels; i++) {
974 + const cap_code = this._sock.rQshift32();
975 + const cap_vendor = this._sock.rQshiftStr(4);
976 + const cap_signature = this._sock.rQshiftStr(8);
977 + serverSupportedTunnelTypes[cap_code] = { vendor: cap_vendor, signature: cap_signature };
978 + }
979 +
980 + Log.Debug("Server Tight tunnel types: " + serverSupportedTunnelTypes);
981 +
982 + // Siemens touch panels have a VNC server that supports NOTUNNEL,
983 + // but forgets to advertise it. Try to detect such servers by
984 + // looking for their custom tunnel type.
985 + if (serverSupportedTunnelTypes[1] &&
986 + (serverSupportedTunnelTypes[1].vendor === "SICR") &&
987 + (serverSupportedTunnelTypes[1].signature === "SCHANNEL")) {
988 + Log.Debug("Detected Siemens server. Assuming NOTUNNEL support.");
989 + serverSupportedTunnelTypes[0] = { vendor: 'TGHT', signature: 'NOTUNNEL' };
990 + }
991 +
992 + // choose the notunnel type
993 + if (serverSupportedTunnelTypes[0]) {
994 + if (serverSupportedTunnelTypes[0].vendor != clientSupportedTunnelTypes[0].vendor ||
995 + serverSupportedTunnelTypes[0].signature != clientSupportedTunnelTypes[0].signature) {
996 + return this._fail("Client's tunnel type had the incorrect " +
997 + "vendor or signature");
998 + }
999 + Log.Debug("Selected tunnel type: " + clientSupportedTunnelTypes[0]);
1000 + this._sock.send([0, 0, 0, 0]); // use NOTUNNEL
1001 + return false; // wait until we receive the sub auth count to continue
1002 + } else {
1003 + return this._fail("Server wanted tunnels, but doesn't support " +
1004 + "the notunnel type");
1005 + }
1006 + }
1007 +
1008 + _negotiate_tight_auth() {
1009 + if (!this._rfb_tightvnc) { // first pass, do the tunnel negotiation
1010 + if (this._sock.rQwait("num tunnels", 4)) { return false; }
1011 + const numTunnels = this._sock.rQshift32();
1012 + if (numTunnels > 0 && this._sock.rQwait("tunnel capabilities", 16 * numTunnels, 4)) { return false; }
1013 +
1014 + this._rfb_tightvnc = true;
1015 +
1016 + if (numTunnels > 0) {
1017 + this._negotiate_tight_tunnels(numTunnels);
1018 + return false; // wait until we receive the sub auth to continue
1019 + }
1020 + }
1021 +
1022 + // second pass, do the sub-auth negotiation
1023 + if (this._sock.rQwait("sub auth count", 4)) { return false; }
1024 + const subAuthCount = this._sock.rQshift32();
1025 + if (subAuthCount === 0) { // empty sub-auth list received means 'no auth' subtype selected
1026 + this._rfb_init_state = 'SecurityResult';
1027 + return true;
1028 + }
1029 +
1030 + if (this._sock.rQwait("sub auth capabilities", 16 * subAuthCount, 4)) { return false; }
1031 +
1032 + const clientSupportedTypes = {
1033 + 'STDVNOAUTH__': 1,
1034 + 'STDVVNCAUTH_': 2
1035 + };
1036 +
1037 + const serverSupportedTypes = [];
1038 +
1039 + for (let i = 0; i < subAuthCount; i++) {
1040 + this._sock.rQshift32(); // capNum
1041 + const capabilities = this._sock.rQshiftStr(12);
1042 + serverSupportedTypes.push(capabilities);
1043 + }
1044 +
1045 + Log.Debug("Server Tight authentication types: " + serverSupportedTypes);
1046 +
1047 + for (let authType in clientSupportedTypes) {
1048 + if (serverSupportedTypes.indexOf(authType) != -1) {
1049 + this._sock.send([0, 0, 0, clientSupportedTypes[authType]]);
1050 + Log.Debug("Selected authentication type: " + authType);
1051 +
1052 + switch (authType) {
1053 + case 'STDVNOAUTH__': // no auth
1054 + this._rfb_init_state = 'SecurityResult';
1055 + return true;
1056 + case 'STDVVNCAUTH_': // VNC auth
1057 + this._rfb_auth_scheme = 2;
1058 + return this._init_msg();
1059 + default:
1060 + return this._fail("Unsupported tiny auth scheme " +
1061 + "(scheme: " + authType + ")");
1062 + }
1063 + }
1064 + }
1065 +
1066 + return this._fail("No supported sub-auth types!");
1067 + }
1068 +
1069 + _negotiate_authentication() {
1070 + switch (this._rfb_auth_scheme) {
1071 + case 1: // no auth
1072 + if (this._rfb_version >= 3.8) {
1073 + this._rfb_init_state = 'SecurityResult';
1074 + return true;
1075 + }
1076 + this._rfb_init_state = 'ClientInitialisation';
1077 + return this._init_msg();
1078 +
1079 + case 22: // XVP auth
1080 + return this._negotiate_xvp_auth();
1081 +
1082 + case 2: // VNC authentication
1083 + return this._negotiate_std_vnc_auth();
1084 +
1085 + case 16: // TightVNC Security Type
1086 + return this._negotiate_tight_auth();
1087 +
1088 + default:
1089 + return this._fail("Unsupported auth scheme (scheme: " +
1090 + this._rfb_auth_scheme + ")");
1091 + }
1092 + }
1093 +
1094 + _handle_security_result() {
1095 + if (this._sock.rQwait('VNC auth response ', 4)) { return false; }
1096 +
1097 + const status = this._sock.rQshift32();
1098 +
1099 + if (status === 0) { // OK
1100 + this._rfb_init_state = 'ClientInitialisation';
1101 + Log.Debug('Authentication OK');
1102 + return this._init_msg();
1103 + } else {
1104 + if (this._rfb_version >= 3.8) {
1105 + this._rfb_init_state = "SecurityReason";
1106 + this._security_context = "security result";
1107 + this._security_status = status;
1108 + return this._init_msg();
1109 + } else {
1110 + this.dispatchEvent(new CustomEvent(
1111 + "securityfailure",
1112 + { detail: { status: status } }));
1113 +
1114 + return this._fail("Security handshake failed");
1115 + }
1116 + }
1117 + }
1118 +
1119 + _negotiate_server_init() {
1120 + if (this._sock.rQwait("server initialization", 24)) { return false; }
1121 +
1122 + /* Screen size */
1123 + const width = this._sock.rQshift16();
1124 + const height = this._sock.rQshift16();
1125 +
1126 + /* PIXEL_FORMAT */
1127 + const bpp = this._sock.rQshift8();
1128 + const depth = this._sock.rQshift8();
1129 + const big_endian = this._sock.rQshift8();
1130 + const true_color = this._sock.rQshift8();
1131 +
1132 + const red_max = this._sock.rQshift16();
1133 + const green_max = this._sock.rQshift16();
1134 + const blue_max = this._sock.rQshift16();
1135 + const red_shift = this._sock.rQshift8();
1136 + const green_shift = this._sock.rQshift8();
1137 + const blue_shift = this._sock.rQshift8();
1138 + this._sock.rQskipBytes(3); // padding
1139 +
1140 + // NB(directxman12): we don't want to call any callbacks or print messages until
1141 + // *after* we're past the point where we could backtrack
1142 +
1143 + /* Connection name/title */
1144 + const name_length = this._sock.rQshift32();
1145 + if (this._sock.rQwait('server init name', name_length, 24)) { return false; }
1146 + this._fb_name = decodeUTF8(this._sock.rQshiftStr(name_length));
1147 +
1148 + if (this._rfb_tightvnc) {
1149 + if (this._sock.rQwait('TightVNC extended server init header', 8, 24 + name_length)) { return false; }
1150 + // In TightVNC mode, ServerInit message is extended
1151 + const numServerMessages = this._sock.rQshift16();
1152 + const numClientMessages = this._sock.rQshift16();
1153 + const numEncodings = this._sock.rQshift16();
1154 + this._sock.rQskipBytes(2); // padding
1155 +
1156 + const totalMessagesLength = (numServerMessages + numClientMessages + numEncodings) * 16;
1157 + if (this._sock.rQwait('TightVNC extended server init header', totalMessagesLength, 32 + name_length)) { return false; }
1158 +
1159 + // we don't actually do anything with the capability information that TIGHT sends,
1160 + // so we just skip the all of this.
1161 +
1162 + // TIGHT server message capabilities
1163 + this._sock.rQskipBytes(16 * numServerMessages);
1164 +
1165 + // TIGHT client message capabilities
1166 + this._sock.rQskipBytes(16 * numClientMessages);
1167 +
1168 + // TIGHT encoding capabilities
1169 + this._sock.rQskipBytes(16 * numEncodings);
1170 + }
1171 +
1172 + // NB(directxman12): these are down here so that we don't run them multiple times
1173 + // if we backtrack
1174 + Log.Info("Screen: " + width + "x" + height +
1175 + ", bpp: " + bpp + ", depth: " + depth +
1176 + ", big_endian: " + big_endian +
1177 + ", true_color: " + true_color +
1178 + ", red_max: " + red_max +
1179 + ", green_max: " + green_max +
1180 + ", blue_max: " + blue_max +
1181 + ", red_shift: " + red_shift +
1182 + ", green_shift: " + green_shift +
1183 + ", blue_shift: " + blue_shift);
1184 +
1185 + if (big_endian !== 0) {
1186 + Log.Warn("Server native endian is not little endian");
1187 + }
1188 +
1189 + if (red_shift !== 16) {
1190 + Log.Warn("Server native red-shift is not 16");
1191 + }
1192 +
1193 + if (blue_shift !== 0) {
1194 + Log.Warn("Server native blue-shift is not 0");
1195 + }
1196 +
1197 + // we're past the point where we could backtrack, so it's safe to call this
1198 + this.dispatchEvent(new CustomEvent(
1199 + "desktopname",
1200 + { detail: { name: this._fb_name } }));
1201 +
1202 + this._resize(width, height);
1203 +
1204 + if (!this._viewOnly) { this._keyboard.grab(); }
1205 + if (!this._viewOnly) { this._mouse.grab(); }
1206 +
1207 + this._fb_depth = 24;
1208 +
1209 + if (this._fb_name === "Intel(r) AMT KVM") {
1210 + Log.Warn("Intel AMT KVM only supports 8/16 bit depths. Using low color mode.");
1211 + this._fb_depth = 8;
1212 + }
1213 +
1214 + RFB.messages.pixelFormat(this._sock, this._fb_depth, true);
1215 + this._sendEncodings();
1216 + RFB.messages.fbUpdateRequest(this._sock, false, 0, 0, this._fb_width, this._fb_height);
1217 +
1218 + this._updateConnectionState('connected');
1219 + return true;
1220 + }
1221 +
1222 + _sendEncodings() {
1223 + const encs = [];
1224 +
1225 + // In preference order
1226 + encs.push(encodings.encodingCopyRect);
1227 + // Only supported with full depth support
1228 + if (this._fb_depth == 24) {
1229 + encs.push(encodings.encodingTight);
1230 + encs.push(encodings.encodingTightPNG);
1231 + encs.push(encodings.encodingHextile);
1232 + encs.push(encodings.encodingRRE);
1233 + }
1234 + encs.push(encodings.encodingRaw);
1235 +
1236 + // Psuedo-encoding settings
1237 + encs.push(encodings.pseudoEncodingQualityLevel0 + 6);
1238 + encs.push(encodings.pseudoEncodingCompressLevel0 + 2);
1239 +
1240 + encs.push(encodings.pseudoEncodingDesktopSize);
1241 + encs.push(encodings.pseudoEncodingLastRect);
1242 + encs.push(encodings.pseudoEncodingQEMUExtendedKeyEvent);
1243 + encs.push(encodings.pseudoEncodingExtendedDesktopSize);
1244 + encs.push(encodings.pseudoEncodingXvp);
1245 + encs.push(encodings.pseudoEncodingFence);
1246 + encs.push(encodings.pseudoEncodingContinuousUpdates);
1247 +
1248 + if (this._fb_depth == 24) {
1249 + encs.push(encodings.pseudoEncodingCursor);
1250 + }
1251 +
1252 + RFB.messages.clientEncodings(this._sock, encs);
1253 + }
1254 +
1255 + /* RFB protocol initialization states:
1256 + * ProtocolVersion
1257 + * Security
1258 + * Authentication
1259 + * SecurityResult
1260 + * ClientInitialization - not triggered by server message
1261 + * ServerInitialization
1262 + */
1263 + _init_msg() {
1264 + switch (this._rfb_init_state) {
1265 + case 'ProtocolVersion':
1266 + return this._negotiate_protocol_version();
1267 +
1268 + case 'Security':
1269 + return this._negotiate_security();
1270 +
1271 + case 'Authentication':
1272 + return this._negotiate_authentication();
1273 +
1274 + case 'SecurityResult':
1275 + return this._handle_security_result();
1276 +
1277 + case 'SecurityReason':
1278 + return this._handle_security_reason();
1279 +
1280 + case 'ClientInitialisation':
1281 + this._sock.send([this._shared ? 1 : 0]); // ClientInitialisation
1282 + this._rfb_init_state = 'ServerInitialisation';
1283 + return true;
1284 +
1285 + case 'ServerInitialisation':
1286 + return this._negotiate_server_init();
1287 +
1288 + default:
1289 + return this._fail("Unknown init state (state: " +
1290 + this._rfb_init_state + ")");
1291 + }
1292 + }
1293 +
1294 + _handle_set_colour_map_msg() {
1295 + Log.Debug("SetColorMapEntries");
1296 +
1297 + return this._fail("Unexpected SetColorMapEntries message");
1298 + }
1299 +
1300 + _handle_server_cut_text() {
1301 + Log.Debug("ServerCutText");
1302 +
1303 + if (this._sock.rQwait("ServerCutText header", 7, 1)) { return false; }
1304 + this._sock.rQskipBytes(3); // Padding
1305 + const length = this._sock.rQshift32();
1306 + if (this._sock.rQwait("ServerCutText", length, 8)) { return false; }
1307 +
1308 + const text = this._sock.rQshiftStr(length);
1309 +
1310 + if (this._viewOnly) { return true; }
1311 +
1312 + this.dispatchEvent(new CustomEvent(
1313 + "clipboard",
1314 + { detail: { text: text } }));
1315 +
1316 + return true;
1317 + }
1318 +
1319 + _handle_server_fence_msg() {
1320 + if (this._sock.rQwait("ServerFence header", 8, 1)) { return false; }
1321 + this._sock.rQskipBytes(3); // Padding
1322 + let flags = this._sock.rQshift32();
1323 + let length = this._sock.rQshift8();
1324 +
1325 + if (this._sock.rQwait("ServerFence payload", length, 9)) { return false; }
1326 +
1327 + if (length > 64) {
1328 + Log.Warn("Bad payload length (" + length + ") in fence response");
1329 + length = 64;
1330 + }
1331 +
1332 + const payload = this._sock.rQshiftStr(length);
1333 +
1334 + this._supportsFence = true;
1335 +
1336 + /*
1337 + * Fence flags
1338 + *
1339 + * (1<<0) - BlockBefore
1340 + * (1<<1) - BlockAfter
1341 + * (1<<2) - SyncNext
1342 + * (1<<31) - Request
1343 + */
1344 +
1345 + if (!(flags & (1<<31))) {
1346 + return this._fail("Unexpected fence response");
1347 + }
1348 +
1349 + // Filter out unsupported flags
1350 + // FIXME: support syncNext
1351 + flags &= (1<<0) | (1<<1);
1352 +
1353 + // BlockBefore and BlockAfter are automatically handled by
1354 + // the fact that we process each incoming message
1355 + // synchronuosly.
1356 + RFB.messages.clientFence(this._sock, flags, payload);
1357 +
1358 + return true;
1359 + }
1360 +
1361 + _handle_xvp_msg() {
1362 + if (this._sock.rQwait("XVP version and message", 3, 1)) { return false; }
1363 + this._sock.rQskipBytes(1); // Padding
1364 + const xvp_ver = this._sock.rQshift8();
1365 + const xvp_msg = this._sock.rQshift8();
1366 +
1367 + switch (xvp_msg) {
1368 + case 0: // XVP_FAIL
1369 + Log.Error("XVP Operation Failed");
1370 + break;
1371 + case 1: // XVP_INIT
1372 + this._rfb_xvp_ver = xvp_ver;
1373 + Log.Info("XVP extensions enabled (version " + this._rfb_xvp_ver + ")");
1374 + this._setCapability("power", true);
1375 + break;
1376 + default:
1377 + this._fail("Illegal server XVP message (msg: " + xvp_msg + ")");
1378 + break;
1379 + }
1380 +
1381 + return true;
1382 + }
1383 +
1384 + _normal_msg() {
1385 + let msg_type;
1386 + if (this._FBU.rects > 0) {
1387 + msg_type = 0;
1388 + } else {
1389 + msg_type = this._sock.rQshift8();
1390 + }
1391 +
1392 + let first, ret;
1393 + switch (msg_type) {
1394 + case 0: // FramebufferUpdate
1395 + ret = this._framebufferUpdate();
1396 + if (ret && !this._enabledContinuousUpdates) {
1397 + RFB.messages.fbUpdateRequest(this._sock, true, 0, 0,
1398 + this._fb_width, this._fb_height);
1399 + }
1400 + return ret;
1401 +
1402 + case 1: // SetColorMapEntries
1403 + return this._handle_set_colour_map_msg();
1404 +
1405 + case 2: // Bell
1406 + Log.Debug("Bell");
1407 + this.dispatchEvent(new CustomEvent(
1408 + "bell",
1409 + { detail: {} }));
1410 + return true;
1411 +
1412 + case 3: // ServerCutText
1413 + return this._handle_server_cut_text();
1414 +
1415 + case 150: // EndOfContinuousUpdates
1416 + first = !this._supportsContinuousUpdates;
1417 + this._supportsContinuousUpdates = true;
1418 + this._enabledContinuousUpdates = false;
1419 + if (first) {
1420 + this._enabledContinuousUpdates = true;
1421 + this._updateContinuousUpdates();
1422 + Log.Info("Enabling continuous updates.");
1423 + } else {
1424 + // FIXME: We need to send a framebufferupdaterequest here
1425 + // if we add support for turning off continuous updates
1426 + }
1427 + return true;
1428 +
1429 + case 248: // ServerFence
1430 + return this._handle_server_fence_msg();
1431 +
1432 + case 250: // XVP
1433 + return this._handle_xvp_msg();
1434 +
1435 + default:
1436 + this._fail("Unexpected server message (type " + msg_type + ")");
1437 + Log.Debug("sock.rQslice(0, 30): " + this._sock.rQslice(0, 30));
1438 + return true;
1439 + }
1440 + }
1441 +
1442 + _onFlush() {
1443 + this._flushing = false;
1444 + // Resume processing
1445 + if (this._sock.rQlen > 0) {
1446 + this._handle_message();
1447 + }
1448 + }
1449 +
1450 + _framebufferUpdate() {
1451 + if (this._FBU.rects === 0) {
1452 + if (this._sock.rQwait("FBU header", 3, 1)) { return false; }
1453 + this._sock.rQskipBytes(1); // Padding
1454 + this._FBU.rects = this._sock.rQshift16();
1455 +
1456 + // Make sure the previous frame is fully rendered first
1457 + // to avoid building up an excessive queue
1458 + if (this._display.pending()) {
1459 + this._flushing = true;
1460 + this._display.flush();
1461 + return false;
1462 + }
1463 + }
1464 +
1465 + while (this._FBU.rects > 0) {
1466 + if (this._FBU.encoding === null) {
1467 + if (this._sock.rQwait("rect header", 12)) { return false; }
1468 + /* New FramebufferUpdate */
1469 +
1470 + const hdr = this._sock.rQshiftBytes(12);
1471 + this._FBU.x = (hdr[0] << 8) + hdr[1];
1472 + this._FBU.y = (hdr[2] << 8) + hdr[3];
1473 + this._FBU.width = (hdr[4] << 8) + hdr[5];
1474 + this._FBU.height = (hdr[6] << 8) + hdr[7];
1475 + this._FBU.encoding = parseInt((hdr[8] << 24) + (hdr[9] << 16) +
1476 + (hdr[10] << 8) + hdr[11], 10);
1477 + }
1478 +
1479 + if (!this._handleRect()) {
1480 + return false;
1481 + }
1482 +
1483 + this._FBU.rects--;
1484 + this._FBU.encoding = null;
1485 + }
1486 +
1487 + this._display.flip();
1488 +
1489 + return true; // We finished this FBU
1490 + }
1491 +
1492 + _handleRect() {
1493 + switch (this._FBU.encoding) {
1494 + case encodings.pseudoEncodingLastRect:
1495 + this._FBU.rects = 1; // Will be decreased when we return
1496 + return true;
1497 +
1498 + case encodings.pseudoEncodingCursor:
1499 + return this._handleCursor();
1500 +
1501 + case encodings.pseudoEncodingQEMUExtendedKeyEvent:
1502 + // Old Safari doesn't support creating keyboard events
1503 + try {
1504 + const keyboardEvent = document.createEvent("keyboardEvent");
1505 + if (keyboardEvent.code !== undefined) {
1506 + this._qemuExtKeyEventSupported = true;
1507 + }
1508 + } catch (err) {
1509 + // Do nothing
1510 + }
1511 + return true;
1512 +
1513 + case encodings.pseudoEncodingDesktopSize:
1514 + this._resize(this._FBU.width, this._FBU.height);
1515 + return true;
1516 +
1517 + case encodings.pseudoEncodingExtendedDesktopSize:
1518 + return this._handleExtendedDesktopSize();
1519 +
1520 + default:
1521 + return this._handleDataRect();
1522 + }
1523 + }
1524 +
1525 + _handleCursor() {
1526 + const hotx = this._FBU.x; // hotspot-x
1527 + const hoty = this._FBU.y; // hotspot-y
1528 + const w = this._FBU.width;
1529 + const h = this._FBU.height;
1530 +
1531 + const pixelslength = w * h * 4;
1532 + const masklength = Math.ceil(w / 8) * h;
1533 +
1534 + let bytes = pixelslength + masklength;
1535 + if (this._sock.rQwait("cursor encoding", bytes)) {
1536 + return false;
1537 + }
1538 +
1539 + // Decode from BGRX pixels + bit mask to RGBA
1540 + const pixels = this._sock.rQshiftBytes(pixelslength);
1541 + const mask = this._sock.rQshiftBytes(masklength);
1542 + let rgba = new Uint8Array(w * h * 4);
1543 +
1544 + let pix_idx = 0;
1545 + for (let y = 0; y < h; y++) {
1546 + for (let x = 0; x < w; x++) {
1547 + let mask_idx = y * Math.ceil(w / 8) + Math.floor(x / 8);
1548 + let alpha = (mask[mask_idx] << (x % 8)) & 0x80 ? 255 : 0;
1549 + rgba[pix_idx ] = pixels[pix_idx + 2];
1550 + rgba[pix_idx + 1] = pixels[pix_idx + 1];
1551 + rgba[pix_idx + 2] = pixels[pix_idx];
1552 + rgba[pix_idx + 3] = alpha;
1553 + pix_idx += 4;
1554 + }
1555 + }
1556 +
1557 + this._updateCursor(rgba, hotx, hoty, w, h);
1558 +
1559 + return true;
1560 + }
1561 +
1562 + _handleExtendedDesktopSize() {
1563 + if (this._sock.rQwait("ExtendedDesktopSize", 4)) {
1564 + return false;
1565 + }
1566 +
1567 + const number_of_screens = this._sock.rQpeek8();
1568 +
1569 + let bytes = 4 + (number_of_screens * 16);
1570 + if (this._sock.rQwait("ExtendedDesktopSize", bytes)) {
1571 + return false;
1572 + }
1573 +
1574 + const firstUpdate = !this._supportsSetDesktopSize;
1575 + this._supportsSetDesktopSize = true;
1576 +
1577 + // Normally we only apply the current resize mode after a
1578 + // window resize event. However there is no such trigger on the
1579 + // initial connect. And we don't know if the server supports
1580 + // resizing until we've gotten here.
1581 + if (firstUpdate) {
1582 + this._requestRemoteResize();
1583 + }
1584 +
1585 + this._sock.rQskipBytes(1); // number-of-screens
1586 + this._sock.rQskipBytes(3); // padding
1587 +
1588 + for (let i = 0; i < number_of_screens; i += 1) {
1589 + // Save the id and flags of the first screen
1590 + if (i === 0) {
1591 + this._screen_id = this._sock.rQshiftBytes(4); // id
1592 + this._sock.rQskipBytes(2); // x-position
1593 + this._sock.rQskipBytes(2); // y-position
1594 + this._sock.rQskipBytes(2); // width
1595 + this._sock.rQskipBytes(2); // height
1596 + this._screen_flags = this._sock.rQshiftBytes(4); // flags
1597 + } else {
1598 + this._sock.rQskipBytes(16);
1599 + }
1600 + }
1601 +
1602 + /*
1603 + * The x-position indicates the reason for the change:
1604 + *
1605 + * 0 - server resized on its own
1606 + * 1 - this client requested the resize
1607 + * 2 - another client requested the resize
1608 + */
1609 +
1610 + // We need to handle errors when we requested the resize.
1611 + if (this._FBU.x === 1 && this._FBU.y !== 0) {
1612 + let msg = "";
1613 + // The y-position indicates the status code from the server
1614 + switch (this._FBU.y) {
1615 + case 1:
1616 + msg = "Resize is administratively prohibited";
1617 + break;
1618 + case 2:
1619 + msg = "Out of resources";
1620 + break;
1621 + case 3:
1622 + msg = "Invalid screen layout";
1623 + break;
1624 + default:
1625 + msg = "Unknown reason";
1626 + break;
1627 + }
1628 + Log.Warn("Server did not accept the resize request: "
1629 + + msg);
1630 + } else {
1631 + this._resize(this._FBU.width, this._FBU.height);
1632 + }
1633 +
1634 + return true;
1635 + }
1636 +
1637 + _handleDataRect() {
1638 + let decoder = this._decoders[this._FBU.encoding];
1639 + if (!decoder) {
1640 + this._fail("Unsupported encoding (encoding: " +
1641 + this._FBU.encoding + ")");
1642 + return false;
1643 + }
1644 +
1645 + try {
1646 + return decoder.decodeRect(this._FBU.x, this._FBU.y,
1647 + this._FBU.width, this._FBU.height,
1648 + this._sock, this._display,
1649 + this._fb_depth);
1650 + } catch (err) {
1651 + this._fail("Error decoding rect: " + err);
1652 + return false;
1653 + }
1654 + }
1655 +
1656 + _updateContinuousUpdates() {
1657 + if (!this._enabledContinuousUpdates) { return; }
1658 +
1659 + RFB.messages.enableContinuousUpdates(this._sock, true, 0, 0,
1660 + this._fb_width, this._fb_height);
1661 + }
1662 +
1663 + _resize(width, height) {
1664 + this._fb_width = width;
1665 + this._fb_height = height;
1666 +
1667 + this._display.resize(this._fb_width, this._fb_height);
1668 +
1669 + // Adjust the visible viewport based on the new dimensions
1670 + this._updateClip();
1671 + this._updateScale();
1672 +
1673 + this._updateContinuousUpdates();
1674 + }
1675 +
1676 + _xvpOp(ver, op) {
1677 + if (this._rfb_xvp_ver < ver) { return; }
1678 + Log.Info("Sending XVP operation " + op + " (version " + ver + ")");
1679 + RFB.messages.xvpOp(this._sock, ver, op);
1680 + }
1681 +
1682 + _updateCursor(rgba, hotx, hoty, w, h) {
1683 + this._cursorImage = {
1684 + rgbaPixels: rgba,
1685 + hotx: hotx, hoty: hoty, w: w, h: h,
1686 + };
1687 + this._refreshCursor();
1688 + }
1689 +
1690 + _shouldShowDotCursor() {
1691 + // Called when this._cursorImage is updated
1692 + if (!this._showDotCursor) {
1693 + // User does not want to see the dot, so...
1694 + return false;
1695 + }
1696 +
1697 + // The dot should not be shown if the cursor is already visible,
1698 + // i.e. contains at least one not-fully-transparent pixel.
1699 + // So iterate through all alpha bytes in rgba and stop at the
1700 + // first non-zero.
1701 + for (let i = 3; i < this._cursorImage.rgbaPixels.length; i += 4) {
1702 + if (this._cursorImage.rgbaPixels[i]) {
1703 + return false;
1704 + }
1705 + }
1706 +
1707 + // At this point, we know that the cursor is fully transparent, and
1708 + // the user wants to see the dot instead of this.
1709 + return true;
1710 + }
1711 +
1712 + _refreshCursor() {
1713 + const image = this._shouldShowDotCursor() ? RFB.cursors.dot : this._cursorImage;
1714 + this._cursor.change(image.rgbaPixels,
1715 + image.hotx, image.hoty,
1716 + image.w, image.h
1717 + );
1718 + }
1719 +
1720 + static genDES(password, challenge) {
1721 + const passwordChars = password.split('').map(c => c.charCodeAt(0));
1722 + return (new DES(passwordChars)).encrypt(challenge);
1723 + }
1724 +}
1725 +
1726 +// Class Methods
1727 +RFB.messages = {
1728 + keyEvent(sock, keysym, down) {
1729 + const buff = sock._sQ;
1730 + const offset = sock._sQlen;
1731 +
1732 + buff[offset] = 4; // msg-type
1733 + buff[offset + 1] = down;
1734 +
1735 + buff[offset + 2] = 0;
1736 + buff[offset + 3] = 0;
1737 +
1738 + buff[offset + 4] = (keysym >> 24);
1739 + buff[offset + 5] = (keysym >> 16);
1740 + buff[offset + 6] = (keysym >> 8);
1741 + buff[offset + 7] = keysym;
1742 +
1743 + sock._sQlen += 8;
1744 + sock.flush();
1745 + },
1746 +
1747 + QEMUExtendedKeyEvent(sock, keysym, down, keycode) {
1748 + function getRFBkeycode(xt_scancode) {
1749 + const upperByte = (keycode >> 8);
1750 + const lowerByte = (keycode & 0x00ff);
1751 + if (upperByte === 0xe0 && lowerByte < 0x7f) {
1752 + return lowerByte | 0x80;
1753 + }
1754 + return xt_scancode;
1755 + }
1756 +
1757 + const buff = sock._sQ;
1758 + const offset = sock._sQlen;
1759 +
1760 + buff[offset] = 255; // msg-type
1761 + buff[offset + 1] = 0; // sub msg-type
1762 +
1763 + buff[offset + 2] = (down >> 8);
1764 + buff[offset + 3] = down;
1765 +
1766 + buff[offset + 4] = (keysym >> 24);
1767 + buff[offset + 5] = (keysym >> 16);
1768 + buff[offset + 6] = (keysym >> 8);
1769 + buff[offset + 7] = keysym;
1770 +
1771 + const RFBkeycode = getRFBkeycode(keycode);
1772 +
1773 + buff[offset + 8] = (RFBkeycode >> 24);
1774 + buff[offset + 9] = (RFBkeycode >> 16);
1775 + buff[offset + 10] = (RFBkeycode >> 8);
1776 + buff[offset + 11] = RFBkeycode;
1777 +
1778 + sock._sQlen += 12;
1779 + sock.flush();
1780 + },
1781 +
1782 + pointerEvent(sock, x, y, mask) {
1783 + const buff = sock._sQ;
1784 + const offset = sock._sQlen;
1785 +
1786 + buff[offset] = 5; // msg-type
1787 +
1788 + buff[offset + 1] = mask;
1789 +
1790 + buff[offset + 2] = x >> 8;
1791 + buff[offset + 3] = x;
1792 +
1793 + buff[offset + 4] = y >> 8;
1794 + buff[offset + 5] = y;
1795 +
1796 + sock._sQlen += 6;
1797 + sock.flush();
1798 + },
1799 +
1800 + // TODO(directxman12): make this unicode compatible?
1801 + clientCutText(sock, text) {
1802 + const buff = sock._sQ;
1803 + const offset = sock._sQlen;
1804 +
1805 + buff[offset] = 6; // msg-type
1806 +
1807 + buff[offset + 1] = 0; // padding
1808 + buff[offset + 2] = 0; // padding
1809 + buff[offset + 3] = 0; // padding
1810 +
1811 + let length = text.length;
1812 +
1813 + buff[offset + 4] = length >> 24;
1814 + buff[offset + 5] = length >> 16;
1815 + buff[offset + 6] = length >> 8;
1816 + buff[offset + 7] = length;
1817 +
1818 + sock._sQlen += 8;
1819 +
1820 + // We have to keep track of from where in the text we begin creating the
1821 + // buffer for the flush in the next iteration.
1822 + let textOffset = 0;
1823 +
1824 + let remaining = length;
1825 + while (remaining > 0) {
1826 +
1827 + let flushSize = Math.min(remaining, (sock._sQbufferSize - sock._sQlen));
1828 + for (let i = 0; i < flushSize; i++) {
1829 + buff[sock._sQlen + i] = text.charCodeAt(textOffset + i);
1830 + }
1831 +
1832 + sock._sQlen += flushSize;
1833 + sock.flush();
1834 +
1835 + remaining -= flushSize;
1836 + textOffset += flushSize;
1837 + }
1838 + },
1839 +
1840 + setDesktopSize(sock, width, height, id, flags) {
1841 + const buff = sock._sQ;
1842 + const offset = sock._sQlen;
1843 +
1844 + buff[offset] = 251; // msg-type
1845 + buff[offset + 1] = 0; // padding
1846 + buff[offset + 2] = width >> 8; // width
1847 + buff[offset + 3] = width;
1848 + buff[offset + 4] = height >> 8; // height
1849 + buff[offset + 5] = height;
1850 +
1851 + buff[offset + 6] = 1; // number-of-screens
1852 + buff[offset + 7] = 0; // padding
1853 +
1854 + // screen array
1855 + buff[offset + 8] = id >> 24; // id
1856 + buff[offset + 9] = id >> 16;
1857 + buff[offset + 10] = id >> 8;
1858 + buff[offset + 11] = id;
1859 + buff[offset + 12] = 0; // x-position
1860 + buff[offset + 13] = 0;
1861 + buff[offset + 14] = 0; // y-position
1862 + buff[offset + 15] = 0;
1863 + buff[offset + 16] = width >> 8; // width
1864 + buff[offset + 17] = width;
1865 + buff[offset + 18] = height >> 8; // height
1866 + buff[offset + 19] = height;
1867 + buff[offset + 20] = flags >> 24; // flags
1868 + buff[offset + 21] = flags >> 16;
1869 + buff[offset + 22] = flags >> 8;
1870 + buff[offset + 23] = flags;
1871 +
1872 + sock._sQlen += 24;
1873 + sock.flush();
1874 + },
1875 +
1876 + clientFence(sock, flags, payload) {
1877 + const buff = sock._sQ;
1878 + const offset = sock._sQlen;
1879 +
1880 + buff[offset] = 248; // msg-type
1881 +
1882 + buff[offset + 1] = 0; // padding
1883 + buff[offset + 2] = 0; // padding
1884 + buff[offset + 3] = 0; // padding
1885 +
1886 + buff[offset + 4] = flags >> 24; // flags
1887 + buff[offset + 5] = flags >> 16;
1888 + buff[offset + 6] = flags >> 8;
1889 + buff[offset + 7] = flags;
1890 +
1891 + const n = payload.length;
1892 +
1893 + buff[offset + 8] = n; // length
1894 +
1895 + for (let i = 0; i < n; i++) {
1896 + buff[offset + 9 + i] = payload.charCodeAt(i);
1897 + }
1898 +
1899 + sock._sQlen += 9 + n;
1900 + sock.flush();
1901 + },
1902 +
1903 + enableContinuousUpdates(sock, enable, x, y, width, height) {
1904 + const buff = sock._sQ;
1905 + const offset = sock._sQlen;
1906 +
1907 + buff[offset] = 150; // msg-type
1908 + buff[offset + 1] = enable; // enable-flag
1909 +
1910 + buff[offset + 2] = x >> 8; // x
1911 + buff[offset + 3] = x;
1912 + buff[offset + 4] = y >> 8; // y
1913 + buff[offset + 5] = y;
1914 + buff[offset + 6] = width >> 8; // width
1915 + buff[offset + 7] = width;
1916 + buff[offset + 8] = height >> 8; // height
1917 + buff[offset + 9] = height;
1918 +
1919 + sock._sQlen += 10;
1920 + sock.flush();
1921 + },
1922 +
1923 + pixelFormat(sock, depth, true_color) {
1924 + const buff = sock._sQ;
1925 + const offset = sock._sQlen;
1926 +
1927 + let bpp;
1928 +
1929 + if (depth > 16) {
1930 + bpp = 32;
1931 + } else if (depth > 8) {
1932 + bpp = 16;
1933 + } else {
1934 + bpp = 8;
1935 + }
1936 +
1937 + const bits = Math.floor(depth/3);
1938 +
1939 + buff[offset] = 0; // msg-type
1940 +
1941 + buff[offset + 1] = 0; // padding
1942 + buff[offset + 2] = 0; // padding
1943 + buff[offset + 3] = 0; // padding
1944 +
1945 + buff[offset + 4] = bpp; // bits-per-pixel
1946 + buff[offset + 5] = depth; // depth
1947 + buff[offset + 6] = 0; // little-endian
1948 + buff[offset + 7] = true_color ? 1 : 0; // true-color
1949 +
1950 + buff[offset + 8] = 0; // red-max
1951 + buff[offset + 9] = (1 << bits) - 1; // red-max
1952 +
1953 + buff[offset + 10] = 0; // green-max
1954 + buff[offset + 11] = (1 << bits) - 1; // green-max
1955 +
1956 + buff[offset + 12] = 0; // blue-max
1957 + buff[offset + 13] = (1 << bits) - 1; // blue-max
1958 +
1959 + buff[offset + 14] = bits * 2; // red-shift
1960 + buff[offset + 15] = bits * 1; // green-shift
1961 + buff[offset + 16] = bits * 0; // blue-shift
1962 +
1963 + buff[offset + 17] = 0; // padding
1964 + buff[offset + 18] = 0; // padding
1965 + buff[offset + 19] = 0; // padding
1966 +
1967 + sock._sQlen += 20;
1968 + sock.flush();
1969 + },
1970 +
1971 + clientEncodings(sock, encodings) {
1972 + const buff = sock._sQ;
1973 + const offset = sock._sQlen;
1974 +
1975 + buff[offset] = 2; // msg-type
1976 + buff[offset + 1] = 0; // padding
1977 +
1978 + buff[offset + 2] = encodings.length >> 8;
1979 + buff[offset + 3] = encodings.length;
1980 +
1981 + let j = offset + 4;
1982 + for (let i = 0; i < encodings.length; i++) {
1983 + const enc = encodings[i];
1984 + buff[j] = enc >> 24;
1985 + buff[j + 1] = enc >> 16;
1986 + buff[j + 2] = enc >> 8;
1987 + buff[j + 3] = enc;
1988 +
1989 + j += 4;
1990 + }
1991 +
1992 + sock._sQlen += j - offset;
1993 + sock.flush();
1994 + },
1995 +
1996 + fbUpdateRequest(sock, incremental, x, y, w, h) {
1997 + const buff = sock._sQ;
1998 + const offset = sock._sQlen;
1999 +
2000 + if (typeof(x) === "undefined") { x = 0; }
2001 + if (typeof(y) === "undefined") { y = 0; }
2002 +
2003 + buff[offset] = 3; // msg-type
2004 + buff[offset + 1] = incremental ? 1 : 0;
2005 +
2006 + buff[offset + 2] = (x >> 8) & 0xFF;
2007 + buff[offset + 3] = x & 0xFF;
2008 +
2009 + buff[offset + 4] = (y >> 8) & 0xFF;
2010 + buff[offset + 5] = y & 0xFF;
2011 +
2012 + buff[offset + 6] = (w >> 8) & 0xFF;
2013 + buff[offset + 7] = w & 0xFF;
2014 +
2015 + buff[offset + 8] = (h >> 8) & 0xFF;
2016 + buff[offset + 9] = h & 0xFF;
2017 +
2018 + sock._sQlen += 10;
2019 + sock.flush();
2020 + },
2021 +
2022 + xvpOp(sock, ver, op) {
2023 + const buff = sock._sQ;
2024 + const offset = sock._sQlen;
2025 +
2026 + buff[offset] = 250; // msg-type
2027 + buff[offset + 1] = 0; // padding
2028 +
2029 + buff[offset + 2] = ver;
2030 + buff[offset + 3] = op;
2031 +
2032 + sock._sQlen += 4;
2033 + sock.flush();
2034 + }
2035 +};
2036 +
2037 +RFB.cursors = {
2038 + none: {
2039 + rgbaPixels: new Uint8Array(),
2040 + w: 0, h: 0,
2041 + hotx: 0, hoty: 0,
2042 + },
2043 +
2044 + dot: {
2045 + /* eslint-disable indent */
2046 + rgbaPixels: new Uint8Array([
2047 + 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,
2048 + 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 255,
2049 + 255, 255, 255, 255, 0, 0, 0, 255, 255, 255, 255, 255,
2050 + ]),
2051 + /* eslint-enable indent */
2052 + w: 3, h: 3,
2053 + hotx: 1, hoty: 1,
2054 + }
2055 +};
public/novnc/core/util/browser.js new
+90
@@ -0,0 +1,90 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +import * as Log from './logging.js';
10 +
11 +// Touch detection
12 +export let isTouchDevice = ('ontouchstart' in document.documentElement) ||
13 + // requried for Chrome debugger
14 + (document.ontouchstart !== undefined) ||
15 + // required for MS Surface
16 + (navigator.maxTouchPoints > 0) ||
17 + (navigator.msMaxTouchPoints > 0);
18 +window.addEventListener('touchstart', function onFirstTouch() {
19 + isTouchDevice = true;
20 + window.removeEventListener('touchstart', onFirstTouch, false);
21 +}, false);
22 +
23 +
24 +// The goal is to find a certain physical width, the devicePixelRatio
25 +// brings us a bit closer but is not optimal.
26 +export let dragThreshold = 10 * (window.devicePixelRatio || 1);
27 +
28 +let _supportsCursorURIs = false;
29 +
30 +try {
31 + const target = document.createElement('canvas');
32 + target.style.cursor = 'url("data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==") 2 2, default';
33 +
34 + if (target.style.cursor) {
35 + Log.Info("Data URI scheme cursor supported");
36 + _supportsCursorURIs = true;
37 + } else {
38 + Log.Warn("Data URI scheme cursor not supported");
39 + }
40 +} catch (exc) {
41 + Log.Error("Data URI scheme cursor test exception: " + exc);
42 +}
43 +
44 +export const supportsCursorURIs = _supportsCursorURIs;
45 +
46 +let _supportsImageMetadata = false;
47 +try {
48 + new ImageData(new Uint8ClampedArray(4), 1, 1);
49 + _supportsImageMetadata = true;
50 +} catch (ex) {
51 + // ignore failure
52 +}
53 +export const supportsImageMetadata = _supportsImageMetadata;
54 +
55 +export function isMac() {
56 + return navigator && !!(/mac/i).exec(navigator.platform);
57 +}
58 +
59 +export function isWindows() {
60 + return navigator && !!(/win/i).exec(navigator.platform);
61 +}
62 +
63 +export function isIOS() {
64 + return navigator &&
65 + (!!(/ipad/i).exec(navigator.platform) ||
66 + !!(/iphone/i).exec(navigator.platform) ||
67 + !!(/ipod/i).exec(navigator.platform));
68 +}
69 +
70 +export function isAndroid() {
71 + return navigator && !!(/android/i).exec(navigator.userAgent);
72 +}
73 +
74 +export function isSafari() {
75 + return navigator && (navigator.userAgent.indexOf('Safari') !== -1 &&
76 + navigator.userAgent.indexOf('Chrome') === -1);
77 +}
78 +
79 +export function isIE() {
80 + return navigator && !!(/trident/i).exec(navigator.userAgent);
81 +}
82 +
83 +export function isEdge() {
84 + return navigator && !!(/edge/i).exec(navigator.userAgent);
85 +}
86 +
87 +export function isFirefox() {
88 + return navigator && !!(/firefox/i).exec(navigator.userAgent);
89 +}
90 +
public/novnc/core/util/cursor.js new
+221
@@ -0,0 +1,221 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +import { supportsCursorURIs, isTouchDevice } from './browser.js';
8 +
9 +const useFallback = !supportsCursorURIs || isTouchDevice;
10 +
11 +export default class Cursor {
12 + constructor() {
13 + this._target = null;
14 +
15 + this._canvas = document.createElement('canvas');
16 +
17 + if (useFallback) {
18 + this._canvas.style.position = 'fixed';
19 + this._canvas.style.zIndex = '65535';
20 + this._canvas.style.pointerEvents = 'none';
21 + // Can't use "display" because of Firefox bug #1445997
22 + this._canvas.style.visibility = 'hidden';
23 + document.body.appendChild(this._canvas);
24 + }
25 +
26 + this._position = { x: 0, y: 0 };
27 + this._hotSpot = { x: 0, y: 0 };
28 +
29 + this._eventHandlers = {
30 + 'mouseover': this._handleMouseOver.bind(this),
31 + 'mouseleave': this._handleMouseLeave.bind(this),
32 + 'mousemove': this._handleMouseMove.bind(this),
33 + 'mouseup': this._handleMouseUp.bind(this),
34 + 'touchstart': this._handleTouchStart.bind(this),
35 + 'touchmove': this._handleTouchMove.bind(this),
36 + 'touchend': this._handleTouchEnd.bind(this),
37 + };
38 + }
39 +
40 + attach(target) {
41 + if (this._target) {
42 + this.detach();
43 + }
44 +
45 + this._target = target;
46 +
47 + if (useFallback) {
48 + // FIXME: These don't fire properly except for mouse
49 + /// movement in IE. We want to also capture element
50 + // movement, size changes, visibility, etc.
51 + const options = { capture: true, passive: true };
52 + this._target.addEventListener('mouseover', this._eventHandlers.mouseover, options);
53 + this._target.addEventListener('mouseleave', this._eventHandlers.mouseleave, options);
54 + this._target.addEventListener('mousemove', this._eventHandlers.mousemove, options);
55 + this._target.addEventListener('mouseup', this._eventHandlers.mouseup, options);
56 +
57 + // There is no "touchleave" so we monitor touchstart globally
58 + window.addEventListener('touchstart', this._eventHandlers.touchstart, options);
59 + this._target.addEventListener('touchmove', this._eventHandlers.touchmove, options);
60 + this._target.addEventListener('touchend', this._eventHandlers.touchend, options);
61 + }
62 +
63 + this.clear();
64 + }
65 +
66 + detach() {
67 + if (useFallback) {
68 + const options = { capture: true, passive: true };
69 + this._target.removeEventListener('mouseover', this._eventHandlers.mouseover, options);
70 + this._target.removeEventListener('mouseleave', this._eventHandlers.mouseleave, options);
71 + this._target.removeEventListener('mousemove', this._eventHandlers.mousemove, options);
72 + this._target.removeEventListener('mouseup', this._eventHandlers.mouseup, options);
73 +
74 + window.removeEventListener('touchstart', this._eventHandlers.touchstart, options);
75 + this._target.removeEventListener('touchmove', this._eventHandlers.touchmove, options);
76 + this._target.removeEventListener('touchend', this._eventHandlers.touchend, options);
77 + }
78 +
79 + this._target = null;
80 + }
81 +
82 + change(rgba, hotx, hoty, w, h) {
83 + if ((w === 0) || (h === 0)) {
84 + this.clear();
85 + return;
86 + }
87 +
88 + this._position.x = this._position.x + this._hotSpot.x - hotx;
89 + this._position.y = this._position.y + this._hotSpot.y - hoty;
90 + this._hotSpot.x = hotx;
91 + this._hotSpot.y = hoty;
92 +
93 + let ctx = this._canvas.getContext('2d');
94 +
95 + this._canvas.width = w;
96 + this._canvas.height = h;
97 +
98 + let img;
99 + try {
100 + // IE doesn't support this
101 + img = new ImageData(new Uint8ClampedArray(rgba), w, h);
102 + } catch (ex) {
103 + img = ctx.createImageData(w, h);
104 + img.data.set(new Uint8ClampedArray(rgba));
105 + }
106 + ctx.clearRect(0, 0, w, h);
107 + ctx.putImageData(img, 0, 0);
108 +
109 + if (useFallback) {
110 + this._updatePosition();
111 + } else {
112 + let url = this._canvas.toDataURL();
113 + this._target.style.cursor = 'url(' + url + ')' + hotx + ' ' + hoty + ', default';
114 + }
115 + }
116 +
117 + clear() {
118 + this._target.style.cursor = 'none';
119 + this._canvas.width = 0;
120 + this._canvas.height = 0;
121 + this._position.x = this._position.x + this._hotSpot.x;
122 + this._position.y = this._position.y + this._hotSpot.y;
123 + this._hotSpot.x = 0;
124 + this._hotSpot.y = 0;
125 + }
126 +
127 + _handleMouseOver(event) {
128 + // This event could be because we're entering the target, or
129 + // moving around amongst its sub elements. Let the move handler
130 + // sort things out.
131 + this._handleMouseMove(event);
132 + }
133 +
134 + _handleMouseLeave(event) {
135 + this._hideCursor();
136 + }
137 +
138 + _handleMouseMove(event) {
139 + this._updateVisibility(event.target);
140 +
141 + this._position.x = event.clientX - this._hotSpot.x;
142 + this._position.y = event.clientY - this._hotSpot.y;
143 +
144 + this._updatePosition();
145 + }
146 +
147 + _handleMouseUp(event) {
148 + // We might get this event because of a drag operation that
149 + // moved outside of the target. Check what's under the cursor
150 + // now and adjust visibility based on that.
151 + let target = document.elementFromPoint(event.clientX, event.clientY);
152 + this._updateVisibility(target);
153 + }
154 +
155 + _handleTouchStart(event) {
156 + // Just as for mouseover, we let the move handler deal with it
157 + this._handleTouchMove(event);
158 + }
159 +
160 + _handleTouchMove(event) {
161 + this._updateVisibility(event.target);
162 +
163 + this._position.x = event.changedTouches[0].clientX - this._hotSpot.x;
164 + this._position.y = event.changedTouches[0].clientY - this._hotSpot.y;
165 +
166 + this._updatePosition();
167 + }
168 +
169 + _handleTouchEnd(event) {
170 + // Same principle as for mouseup
171 + let target = document.elementFromPoint(event.changedTouches[0].clientX,
172 + event.changedTouches[0].clientY);
173 + this._updateVisibility(target);
174 + }
175 +
176 + _showCursor() {
177 + if (this._canvas.style.visibility === 'hidden') {
178 + this._canvas.style.visibility = '';
179 + }
180 + }
181 +
182 + _hideCursor() {
183 + if (this._canvas.style.visibility !== 'hidden') {
184 + this._canvas.style.visibility = 'hidden';
185 + }
186 + }
187 +
188 + // Should we currently display the cursor?
189 + // (i.e. are we over the target, or a child of the target without a
190 + // different cursor set)
191 + _shouldShowCursor(target) {
192 + // Easy case
193 + if (target === this._target) {
194 + return true;
195 + }
196 + // Other part of the DOM?
197 + if (!this._target.contains(target)) {
198 + return false;
199 + }
200 + // Has the child its own cursor?
201 + // FIXME: How can we tell that a sub element has an
202 + // explicit "cursor: none;"?
203 + if (window.getComputedStyle(target).cursor !== 'none') {
204 + return false;
205 + }
206 + return true;
207 + }
208 +
209 + _updateVisibility(target) {
210 + if (this._shouldShowCursor(target)) {
211 + this._showCursor();
212 + } else {
213 + this._hideCursor();
214 + }
215 + }
216 +
217 + _updatePosition() {
218 + this._canvas.style.left = this._position.x + "px";
219 + this._canvas.style.top = this._position.y + "px";
220 + }
221 +}
public/novnc/core/util/events.js new
+139
@@ -0,0 +1,139 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +/*
10 + * Cross-browser event and position routines
11 + */
12 +
13 +export function getPointerEvent(e) {
14 + return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e;
15 +}
16 +
17 +export function stopEvent(e) {
18 + e.stopPropagation();
19 + e.preventDefault();
20 +}
21 +
22 +// Emulate Element.setCapture() when not supported
23 +let _captureRecursion = false;
24 +let _captureElem = null;
25 +function _captureProxy(e) {
26 + // Recursion protection as we'll see our own event
27 + if (_captureRecursion) return;
28 +
29 + // Clone the event as we cannot dispatch an already dispatched event
30 + const newEv = new e.constructor(e.type, e);
31 +
32 + _captureRecursion = true;
33 + _captureElem.dispatchEvent(newEv);
34 + _captureRecursion = false;
35 +
36 + // Avoid double events
37 + e.stopPropagation();
38 +
39 + // Respect the wishes of the redirected event handlers
40 + if (newEv.defaultPrevented) {
41 + e.preventDefault();
42 + }
43 +
44 + // Implicitly release the capture on button release
45 + if (e.type === "mouseup") {
46 + releaseCapture();
47 + }
48 +}
49 +
50 +// Follow cursor style of target element
51 +function _captureElemChanged() {
52 + const captureElem = document.getElementById("noVNC_mouse_capture_elem");
53 + captureElem.style.cursor = window.getComputedStyle(_captureElem).cursor;
54 +}
55 +
56 +const _captureObserver = new MutationObserver(_captureElemChanged);
57 +
58 +let _captureIndex = 0;
59 +
60 +export function setCapture(elem) {
61 + if (elem.setCapture) {
62 +
63 + elem.setCapture();
64 +
65 + // IE releases capture on 'click' events which might not trigger
66 + elem.addEventListener('mouseup', releaseCapture);
67 +
68 + } else {
69 + // Release any existing capture in case this method is
70 + // called multiple times without coordination
71 + releaseCapture();
72 +
73 + let captureElem = document.getElementById("noVNC_mouse_capture_elem");
74 +
75 + if (captureElem === null) {
76 + captureElem = document.createElement("div");
77 + captureElem.id = "noVNC_mouse_capture_elem";
78 + captureElem.style.position = "fixed";
79 + captureElem.style.top = "0px";
80 + captureElem.style.left = "0px";
81 + captureElem.style.width = "100%";
82 + captureElem.style.height = "100%";
83 + captureElem.style.zIndex = 10000;
84 + captureElem.style.display = "none";
85 + document.body.appendChild(captureElem);
86 +
87 + // This is to make sure callers don't get confused by having
88 + // our blocking element as the target
89 + captureElem.addEventListener('contextmenu', _captureProxy);
90 +
91 + captureElem.addEventListener('mousemove', _captureProxy);
92 + captureElem.addEventListener('mouseup', _captureProxy);
93 + }
94 +
95 + _captureElem = elem;
96 + _captureIndex++;
97 +
98 + // Track cursor and get initial cursor
99 + _captureObserver.observe(elem, {attributes: true});
100 + _captureElemChanged();
101 +
102 + captureElem.style.display = "";
103 +
104 + // We listen to events on window in order to keep tracking if it
105 + // happens to leave the viewport
106 + window.addEventListener('mousemove', _captureProxy);
107 + window.addEventListener('mouseup', _captureProxy);
108 + }
109 +}
110 +
111 +export function releaseCapture() {
112 + if (document.releaseCapture) {
113 +
114 + document.releaseCapture();
115 +
116 + } else {
117 + if (!_captureElem) {
118 + return;
119 + }
120 +
121 + // There might be events already queued, so we need to wait for
122 + // them to flush. E.g. contextmenu in Microsoft Edge
123 + window.setTimeout((expected) => {
124 + // Only clear it if it's the expected grab (i.e. no one
125 + // else has initiated a new grab)
126 + if (_captureIndex === expected) {
127 + _captureElem = null;
128 + }
129 + }, 0, _captureIndex);
130 +
131 + _captureObserver.disconnect();
132 +
133 + const captureElem = document.getElementById("noVNC_mouse_capture_elem");
134 + captureElem.style.display = "none";
135 +
136 + window.removeEventListener('mousemove', _captureProxy);
137 + window.removeEventListener('mouseup', _captureProxy);
138 + }
139 +}
public/novnc/core/util/eventtarget.js new
+35
@@ -0,0 +1,35 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +export default class EventTargetMixin {
10 + constructor() {
11 + this._listeners = new Map();
12 + }
13 +
14 + addEventListener(type, callback) {
15 + if (!this._listeners.has(type)) {
16 + this._listeners.set(type, new Set());
17 + }
18 + this._listeners.get(type).add(callback);
19 + }
20 +
21 + removeEventListener(type, callback) {
22 + if (this._listeners.has(type)) {
23 + this._listeners.get(type).delete(callback);
24 + }
25 + }
26 +
27 + dispatchEvent(event) {
28 + if (!this._listeners.has(event.type)) {
29 + return true;
30 + }
31 + this._listeners.get(event.type)
32 + .forEach(callback => callback.call(this, event));
33 + return !event.defaultPrevented;
34 + }
35 +}
public/novnc/core/util/logging.js new
+56
@@ -0,0 +1,56 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +/*
10 + * Logging/debug routines
11 + */
12 +
13 +let _log_level = 'warn';
14 +
15 +let Debug = () => {};
16 +let Info = () => {};
17 +let Warn = () => {};
18 +let Error = () => {};
19 +
20 +export function init_logging(level) {
21 + if (typeof level === 'undefined') {
22 + level = _log_level;
23 + } else {
24 + _log_level = level;
25 + }
26 +
27 + Debug = Info = Warn = Error = () => {};
28 +
29 + if (typeof window.console !== "undefined") {
30 + /* eslint-disable no-console, no-fallthrough */
31 + switch (level) {
32 + case 'debug':
33 + Debug = console.debug.bind(window.console);
34 + case 'info':
35 + Info = console.info.bind(window.console);
36 + case 'warn':
37 + Warn = console.warn.bind(window.console);
38 + case 'error':
39 + Error = console.error.bind(window.console);
40 + case 'none':
41 + break;
42 + default:
43 + throw new window.Error("invalid logging type '" + level + "'");
44 + }
45 + /* eslint-enable no-console, no-fallthrough */
46 + }
47 +}
48 +
49 +export function get_logging() {
50 + return _log_level;
51 +}
52 +
53 +export { Debug, Info, Warn, Error };
54 +
55 +// Initialize logging level
56 +init_logging();
public/novnc/core/util/polyfill.js new
+54
@@ -0,0 +1,54 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 or any later version (see LICENSE.txt)
5 + */
6 +
7 +/* Polyfills to provide new APIs in old browsers */
8 +
9 +/* Object.assign() (taken from MDN) */
10 +if (typeof Object.assign != 'function') {
11 + // Must be writable: true, enumerable: false, configurable: true
12 + Object.defineProperty(Object, "assign", {
13 + value: function assign(target, varArgs) { // .length of function is 2
14 + 'use strict';
15 + if (target == null) { // TypeError if undefined or null
16 + throw new TypeError('Cannot convert undefined or null to object');
17 + }
18 +
19 + const to = Object(target);
20 +
21 + for (let index = 1; index < arguments.length; index++) {
22 + const nextSource = arguments[index];
23 +
24 + if (nextSource != null) { // Skip over if undefined or null
25 + for (let nextKey in nextSource) {
26 + // Avoid bugs when hasOwnProperty is shadowed
27 + if (Object.prototype.hasOwnProperty.call(nextSource, nextKey)) {
28 + to[nextKey] = nextSource[nextKey];
29 + }
30 + }
31 + }
32 + }
33 + return to;
34 + },
35 + writable: true,
36 + configurable: true
37 + });
38 +}
39 +
40 +/* CustomEvent constructor (taken from MDN) */
41 +(() => {
42 + function CustomEvent(event, params) {
43 + params = params || { bubbles: false, cancelable: false, detail: undefined };
44 + const evt = document.createEvent( 'CustomEvent' );
45 + evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
46 + return evt;
47 + }
48 +
49 + CustomEvent.prototype = window.Event.prototype;
50 +
51 + if (typeof window.CustomEvent !== "function") {
52 + window.CustomEvent = CustomEvent;
53 + }
54 +})();
public/novnc/core/util/strings.js new
+14
@@ -0,0 +1,14 @@
1 +/*
2 + * noVNC: HTML5 VNC client
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * See README.md for usage and integration instructions.
7 + */
8 +
9 +/*
10 + * Decode from UTF-8
11 + */
12 +export function decodeUTF8(utf8string) {
13 + return decodeURIComponent(escape(utf8string));
14 +}
public/novnc/core/websock.js new
+290
@@ -0,0 +1,290 @@
1 +/*
2 + * Websock: high-performance binary WebSockets
3 + * Copyright (C) 2018 The noVNC Authors
4 + * Licensed under MPL 2.0 (see LICENSE.txt)
5 + *
6 + * Websock is similar to the standard WebSocket object but with extra
7 + * buffer handling.
8 + *
9 + * Websock has built-in receive queue buffering; the message event
10 + * does not contain actual data but is simply a notification that
11 + * there is new data available. Several rQ* methods are available to
12 + * read binary data off of the receive queue.
13 + */
14 +
15 +import * as Log from './util/logging.js';
16 +
17 +// this has performance issues in some versions Chromium, and
18 +// doesn't gain a tremendous amount of performance increase in Firefox
19 +// at the moment. It may be valuable to turn it on in the future.
20 +const ENABLE_COPYWITHIN = false;
21 +const MAX_RQ_GROW_SIZE = 40 * 1024 * 1024; // 40 MiB
22 +
23 +export default class Websock {
24 + constructor() {
25 + this._websocket = null; // WebSocket object
26 +
27 + this._rQi = 0; // Receive queue index
28 + this._rQlen = 0; // Next write position in the receive queue
29 + this._rQbufferSize = 1024 * 1024 * 4; // Receive queue buffer size (4 MiB)
30 + this._rQmax = this._rQbufferSize / 8;
31 + // called in init: this._rQ = new Uint8Array(this._rQbufferSize);
32 + this._rQ = null; // Receive queue
33 +
34 + this._sQbufferSize = 1024 * 10; // 10 KiB
35 + // called in init: this._sQ = new Uint8Array(this._sQbufferSize);
36 + this._sQlen = 0;
37 + this._sQ = null; // Send queue
38 +
39 + this._eventHandlers = {
40 + message: () => {},
41 + open: () => {},
42 + close: () => {},
43 + error: () => {}
44 + };
45 + }
46 +
47 + // Getters and Setters
48 + get sQ() {
49 + return this._sQ;
50 + }
51 +
52 + get rQ() {
53 + return this._rQ;
54 + }
55 +
56 + get rQi() {
57 + return this._rQi;
58 + }
59 +
60 + set rQi(val) {
61 + this._rQi = val;
62 + }
63 +
64 + // Receive Queue
65 + get rQlen() {
66 + return this._rQlen - this._rQi;
67 + }
68 +
69 + rQpeek8() {
70 + return this._rQ[this._rQi];
71 + }
72 +
73 + rQskipBytes(bytes) {
74 + this._rQi += bytes;
75 + }
76 +
77 + rQshift8() {
78 + return this._rQshift(1);
79 + }
80 +
81 + rQshift16() {
82 + return this._rQshift(2);
83 + }
84 +
85 + rQshift32() {
86 + return this._rQshift(4);
87 + }
88 +
89 + // TODO(directxman12): test performance with these vs a DataView
90 + _rQshift(bytes) {
91 + let res = 0;
92 + for (let byte = bytes - 1; byte >= 0; byte--) {
93 + res += this._rQ[this._rQi++] << (byte * 8);
94 + }
95 + return res;
96 + }
97 +
98 + rQshiftStr(len) {
99 + if (typeof(len) === 'undefined') { len = this.rQlen; }
100 + let str = "";
101 + // Handle large arrays in steps to avoid long strings on the stack
102 + for (let i = 0; i < len; i += 4096) {
103 + let part = this.rQshiftBytes(Math.min(4096, len - i));
104 + str += String.fromCharCode.apply(null, part);
105 + }
106 + return str;
107 + }
108 +
109 + rQshiftBytes(len) {
110 + if (typeof(len) === 'undefined') { len = this.rQlen; }
111 + this._rQi += len;
112 + return new Uint8Array(this._rQ.buffer, this._rQi - len, len);
113 + }
114 +
115 + rQshiftTo(target, len) {
116 + if (len === undefined) { len = this.rQlen; }
117 + // TODO: make this just use set with views when using a ArrayBuffer to store the rQ
118 + target.set(new Uint8Array(this._rQ.buffer, this._rQi, len));
119 + this._rQi += len;
120 + }
121 +
122 + rQslice(start, end = this.rQlen) {
123 + return new Uint8Array(this._rQ.buffer, this._rQi + start, end - start);
124 + }
125 +
126 + // Check to see if we must wait for 'num' bytes (default to FBU.bytes)
127 + // to be available in the receive queue. Return true if we need to
128 + // wait (and possibly print a debug message), otherwise false.
129 + rQwait(msg, num, goback) {
130 + if (this.rQlen < num) {
131 + if (goback) {
132 + if (this._rQi < goback) {
133 + throw new Error("rQwait cannot backup " + goback + " bytes");
134 + }
135 + this._rQi -= goback;
136 + }
137 + return true; // true means need more data
138 + }
139 + return false;
140 + }
141 +
142 + // Send Queue
143 +
144 + flush() {
145 + if (this._sQlen > 0 && this._websocket.readyState === WebSocket.OPEN) {
146 + this._websocket.send(this._encode_message());
147 + this._sQlen = 0;
148 + }
149 + }
150 +
151 + send(arr) {
152 + this._sQ.set(arr, this._sQlen);
153 + this._sQlen += arr.length;
154 + this.flush();
155 + }
156 +
157 + send_string(str) {
158 + this.send(str.split('').map(chr => chr.charCodeAt(0)));
159 + }
160 +
161 + // Event Handlers
162 + off(evt) {
163 + this._eventHandlers[evt] = () => {};
164 + }
165 +
166 + on(evt, handler) {
167 + this._eventHandlers[evt] = handler;
168 + }
169 +
170 + _allocate_buffers() {
171 + this._rQ = new Uint8Array(this._rQbufferSize);
172 + this._sQ = new Uint8Array(this._sQbufferSize);
173 + }
174 +
175 + init() {
176 + this._allocate_buffers();
177 + this._rQi = 0;
178 + this._websocket = null;
179 + }
180 +
181 + open(uri, protocols) {
182 + this.init();
183 +
184 + this._websocket = new WebSocket(uri, protocols);
185 + this._websocket.binaryType = 'arraybuffer';
186 +
187 + this._websocket.onmessage = this._recv_message.bind(this);
188 + this._websocket.onopen = () => {
189 + Log.Debug('>> WebSock.onopen');
190 + if (this._websocket.protocol) {
191 + Log.Info("Server choose sub-protocol: " + this._websocket.protocol);
192 + }
193 +
194 + this._eventHandlers.open();
195 + Log.Debug("<< WebSock.onopen");
196 + };
197 + this._websocket.onclose = (e) => {
198 + Log.Debug(">> WebSock.onclose");
199 + this._eventHandlers.close(e);
200 + Log.Debug("<< WebSock.onclose");
201 + };
202 + this._websocket.onerror = (e) => {
203 + Log.Debug(">> WebSock.onerror: " + e);
204 + this._eventHandlers.error(e);
205 + Log.Debug("<< WebSock.onerror: " + e);
206 + };
207 + }
208 +
209 + close() {
210 + if (this._websocket) {
211 + if ((this._websocket.readyState === WebSocket.OPEN) ||
212 + (this._websocket.readyState === WebSocket.CONNECTING)) {
213 + Log.Info("Closing WebSocket connection");
214 + this._websocket.close();
215 + }
216 +
217 + this._websocket.onmessage = () => {};
218 + }
219 + }
220 +
221 + // private methods
222 + _encode_message() {
223 + // Put in a binary arraybuffer
224 + // according to the spec, you can send ArrayBufferViews with the send method
225 + return new Uint8Array(this._sQ.buffer, 0, this._sQlen);
226 + }
227 +
228 + _expand_compact_rQ(min_fit) {
229 + const resizeNeeded = min_fit || this.rQlen > this._rQbufferSize / 2;
230 + if (resizeNeeded) {
231 + if (!min_fit) {
232 + // just double the size if we need to do compaction
233 + this._rQbufferSize *= 2;
234 + } else {
235 + // otherwise, make sure we satisy rQlen - rQi + min_fit < rQbufferSize / 8
236 + this._rQbufferSize = (this.rQlen + min_fit) * 8;
237 + }
238 + }
239 +
240 + // we don't want to grow unboundedly
241 + if (this._rQbufferSize > MAX_RQ_GROW_SIZE) {
242 + this._rQbufferSize = MAX_RQ_GROW_SIZE;
243 + if (this._rQbufferSize - this.rQlen < min_fit) {
244 + throw new Error("Receive Queue buffer exceeded " + MAX_RQ_GROW_SIZE + " bytes, and the new message could not fit");
245 + }
246 + }
247 +
248 + if (resizeNeeded) {
249 + const old_rQbuffer = this._rQ.buffer;
250 + this._rQmax = this._rQbufferSize / 8;
251 + this._rQ = new Uint8Array(this._rQbufferSize);
252 + this._rQ.set(new Uint8Array(old_rQbuffer, this._rQi));
253 + } else {
254 + if (ENABLE_COPYWITHIN) {
255 + this._rQ.copyWithin(0, this._rQi);
256 + } else {
257 + this._rQ.set(new Uint8Array(this._rQ.buffer, this._rQi));
258 + }
259 + }
260 +
261 + this._rQlen = this._rQlen - this._rQi;
262 + this._rQi = 0;
263 + }
264 +
265 + _decode_message(data) {
266 + // push arraybuffer values onto the end
267 + const u8 = new Uint8Array(data);
268 + if (u8.length > this._rQbufferSize - this._rQlen) {
269 + this._expand_compact_rQ(u8.length);
270 + }
271 + this._rQ.set(u8, this._rQlen);
272 + this._rQlen += u8.length;
273 + }
274 +
275 + _recv_message(e) {
276 + this._decode_message(e.data);
277 + if (this.rQlen > 0) {
278 + this._eventHandlers.message();
279 + // Compact the receive queue
280 + if (this._rQlen == this._rQi) {
281 + this._rQlen = 0;
282 + this._rQi = 0;
283 + } else if (this._rQlen > this._rQmax) {
284 + this._expand_compact_rQ();
285 + }
286 + } else {
287 + Log.Debug("Ignoring empty message");
288 + }
289 + }
290 +}
public/novnc/vendor/browser-es-module-loader/README.md new
+15
@@ -0,0 +1,15 @@
1 +Custom Browser ES Module Loader
2 +===============================
3 +
4 +This is a module loader using babel and the ES Module Loader polyfill.
5 +It's based heavily on
6 +https://github.com/ModuleLoader/browser-es-module-loader, but uses
7 +WebWorkers to compile the modules in the background.
8 +
9 +To generate, run `rollup -c` in this directory, and then run `browserify
10 +src/babel-worker.js > dist/babel-worker.js`.
11 +
12 +LICENSE
13 +-------
14 +
15 +MIT
public/novnc/vendor/browser-es-module-loader/dist/babel-worker.js new
+55799
@@ -0,0 +1,55799 @@
1 +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2 +'use strict';
3 +module.exports = function () {
4 + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
5 +};
6 +
7 +},{}],2:[function(require,module,exports){
8 +'use strict';
9 +
10 +function assembleStyles () {
11 + var styles = {
12 + modifiers: {
13 + reset: [0, 0],
14 + bold: [1, 22], // 21 isn't widely supported and 22 does the same thing
15 + dim: [2, 22],
16 + italic: [3, 23],
17 + underline: [4, 24],
18 + inverse: [7, 27],
19 + hidden: [8, 28],
20 + strikethrough: [9, 29]
21 + },
22 + colors: {
23 + black: [30, 39],
24 + red: [31, 39],
25 + green: [32, 39],
26 + yellow: [33, 39],
27 + blue: [34, 39],
28 + magenta: [35, 39],
29 + cyan: [36, 39],
30 + white: [37, 39],
31 + gray: [90, 39]
32 + },
33 + bgColors: {
34 + bgBlack: [40, 49],
35 + bgRed: [41, 49],
36 + bgGreen: [42, 49],
37 + bgYellow: [43, 49],
38 + bgBlue: [44, 49],
39 + bgMagenta: [45, 49],
40 + bgCyan: [46, 49],
41 + bgWhite: [47, 49]
42 + }
43 + };
44 +
45 + // fix humans
46 + styles.colors.grey = styles.colors.gray;
47 +
48 + Object.keys(styles).forEach(function (groupName) {
49 + var group = styles[groupName];
50 +
51 + Object.keys(group).forEach(function (styleName) {
52 + var style = group[styleName];
53 +
54 + styles[styleName] = group[styleName] = {
55 + open: '\u001b[' + style[0] + 'm',
56 + close: '\u001b[' + style[1] + 'm'
57 + };
58 + });
59 +
60 + Object.defineProperty(styles, groupName, {
61 + value: group,
62 + enumerable: false
63 + });
64 + });
65 +
66 + return styles;
67 +}
68 +
69 +Object.defineProperty(module, 'exports', {
70 + enumerable: true,
71 + get: assembleStyles
72 +});
73 +
74 +},{}],3:[function(require,module,exports){
75 +(function (global){
76 +'use strict';
77 +
78 +// compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js
79 +// original notice:
80 +
81 +/*!
82 + * The buffer module from node.js, for the browser.
83 + *
84 + * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
85 + * @license MIT
86 + */
87 +function compare(a, b) {
88 + if (a === b) {
89 + return 0;
90 + }
91 +
92 + var x = a.length;
93 + var y = b.length;
94 +
95 + for (var i = 0, len = Math.min(x, y); i < len; ++i) {
96 + if (a[i] !== b[i]) {
97 + x = a[i];
98 + y = b[i];
99 + break;
100 + }
101 + }
102 +
103 + if (x < y) {
104 + return -1;
105 + }
106 + if (y < x) {
107 + return 1;
108 + }
109 + return 0;
110 +}
111 +function isBuffer(b) {
112 + if (global.Buffer && typeof global.Buffer.isBuffer === 'function') {
113 + return global.Buffer.isBuffer(b);
114 + }
115 + return !!(b != null && b._isBuffer);
116 +}
117 +
118 +// based on node assert, original notice:
119 +
120 +// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
121 +//
122 +// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
123 +//
124 +// Originally from narwhal.js (http://narwhaljs.org)
125 +// Copyright (c) 2009 Thomas Robinson <280north.com>
126 +//
127 +// Permission is hereby granted, free of charge, to any person obtaining a copy
128 +// of this software and associated documentation files (the 'Software'), to
129 +// deal in the Software without restriction, including without limitation the
130 +// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
131 +// sell copies of the Software, and to permit persons to whom the Software is
132 +// furnished to do so, subject to the following conditions:
133 +//
134 +// The above copyright notice and this permission notice shall be included in
135 +// all copies or substantial portions of the Software.
136 +//
137 +// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
138 +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
139 +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
140 +// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
141 +// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
142 +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
143 +
144 +var util = require('util/');
145 +var hasOwn = Object.prototype.hasOwnProperty;
146 +var pSlice = Array.prototype.slice;
147 +var functionsHaveNames = (function () {
148 + return function foo() {}.name === 'foo';
149 +}());
150 +function pToString (obj) {
151 + return Object.prototype.toString.call(obj);
152 +}
153 +function isView(arrbuf) {
154 + if (isBuffer(arrbuf)) {
155 + return false;
156 + }
157 + if (typeof global.ArrayBuffer !== 'function') {
158 + return false;
159 + }
160 + if (typeof ArrayBuffer.isView === 'function') {
161 + return ArrayBuffer.isView(arrbuf);
162 + }
163 + if (!arrbuf) {
164 + return false;
165 + }
166 + if (arrbuf instanceof DataView) {
167 + return true;
168 + }
169 + if (arrbuf.buffer && arrbuf.buffer instanceof ArrayBuffer) {
170 + return true;
171 + }
172 + return false;
173 +}
174 +// 1. The assert module provides functions that throw
175 +// AssertionError's when particular conditions are not met. The
176 +// assert module must conform to the following interface.
177 +
178 +var assert = module.exports = ok;
179 +
180 +// 2. The AssertionError is defined in assert.
181 +// new assert.AssertionError({ message: message,
182 +// actual: actual,
183 +// expected: expected })
184 +
185 +var regex = /\s*function\s+([^\(\s]*)\s*/;
186 +// based on https://github.com/ljharb/function.prototype.name/blob/adeeeec8bfcc6068b187d7d9fb3d5bb1d3a30899/implementation.js
187 +function getName(func) {
188 + if (!util.isFunction(func)) {
189 + return;
190 + }
191 + if (functionsHaveNames) {
192 + return func.name;
193 + }
194 + var str = func.toString();
195 + var match = str.match(regex);
196 + return match && match[1];
197 +}
198 +assert.AssertionError = function AssertionError(options) {
199 + this.name = 'AssertionError';
200 + this.actual = options.actual;
201 + this.expected = options.expected;
202 + this.operator = options.operator;
203 + if (options.message) {
204 + this.message = options.message;
205 + this.generatedMessage = false;
206 + } else {
207 + this.message = getMessage(this);
208 + this.generatedMessage = true;
209 + }
210 + var stackStartFunction = options.stackStartFunction || fail;
211 + if (Error.captureStackTrace) {
212 + Error.captureStackTrace(this, stackStartFunction);
213 + } else {
214 + // non v8 browsers so we can have a stacktrace
215 + var err = new Error();
216 + if (err.stack) {
217 + var out = err.stack;
218 +
219 + // try to strip useless frames
220 + var fn_name = getName(stackStartFunction);
221 + var idx = out.indexOf('\n' + fn_name);
222 + if (idx >= 0) {
223 + // once we have located the function frame
224 + // we need to strip out everything before it (and its line)
225 + var next_line = out.indexOf('\n', idx + 1);
226 + out = out.substring(next_line + 1);
227 + }
228 +
229 + this.stack = out;
230 + }
231 + }
232 +};
233 +
234 +// assert.AssertionError instanceof Error
235 +util.inherits(assert.AssertionError, Error);
236 +
237 +function truncate(s, n) {
238 + if (typeof s === 'string') {
239 + return s.length < n ? s : s.slice(0, n);
240 + } else {
241 + return s;
242 + }
243 +}
244 +function inspect(something) {
245 + if (functionsHaveNames || !util.isFunction(something)) {
246 + return util.inspect(something);
247 + }
248 + var rawname = getName(something);
249 + var name = rawname ? ': ' + rawname : '';
250 + return '[Function' + name + ']';
251 +}
252 +function getMessage(self) {
253 + return truncate(inspect(self.actual), 128) + ' ' +
254 + self.operator + ' ' +
255 + truncate(inspect(self.expected), 128);
256 +}
257 +
258 +// At present only the three keys mentioned above are used and
259 +// understood by the spec. Implementations or sub modules can pass
260 +// other keys to the AssertionError's constructor - they will be
261 +// ignored.
262 +
263 +// 3. All of the following functions must throw an AssertionError
264 +// when a corresponding condition is not met, with a message that
265 +// may be undefined if not provided. All assertion methods provide
266 +// both the actual and expected values to the assertion error for
267 +// display purposes.
268 +
269 +function fail(actual, expected, message, operator, stackStartFunction) {
270 + throw new assert.AssertionError({
271 + message: message,
272 + actual: actual,
273 + expected: expected,
274 + operator: operator,
275 + stackStartFunction: stackStartFunction
276 + });
277 +}
278 +
279 +// EXTENSION! allows for well behaved errors defined elsewhere.
280 +assert.fail = fail;
281 +
282 +// 4. Pure assertion tests whether a value is truthy, as determined
283 +// by !!guard.
284 +// assert.ok(guard, message_opt);
285 +// This statement is equivalent to assert.equal(true, !!guard,
286 +// message_opt);. To test strictly for the value true, use
287 +// assert.strictEqual(true, guard, message_opt);.
288 +
289 +function ok(value, message) {
290 + if (!value) fail(value, true, message, '==', assert.ok);
291 +}
292 +assert.ok = ok;
293 +
294 +// 5. The equality assertion tests shallow, coercive equality with
295 +// ==.
296 +// assert.equal(actual, expected, message_opt);
297 +
298 +assert.equal = function equal(actual, expected, message) {
299 + if (actual != expected) fail(actual, expected, message, '==', assert.equal);
300 +};
301 +
302 +// 6. The non-equality assertion tests for whether two objects are not equal
303 +// with != assert.notEqual(actual, expected, message_opt);
304 +
305 +assert.notEqual = function notEqual(actual, expected, message) {
306 + if (actual == expected) {
307 + fail(actual, expected, message, '!=', assert.notEqual);
308 + }
309 +};
310 +
311 +// 7. The equivalence assertion tests a deep equality relation.
312 +// assert.deepEqual(actual, expected, message_opt);
313 +
314 +assert.deepEqual = function deepEqual(actual, expected, message) {
315 + if (!_deepEqual(actual, expected, false)) {
316 + fail(actual, expected, message, 'deepEqual', assert.deepEqual);
317 + }
318 +};
319 +
320 +assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
321 + if (!_deepEqual(actual, expected, true)) {
322 + fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
323 + }
324 +};
325 +
326 +function _deepEqual(actual, expected, strict, memos) {
327 + // 7.1. All identical values are equivalent, as determined by ===.
328 + if (actual === expected) {
329 + return true;
330 + } else if (isBuffer(actual) && isBuffer(expected)) {
331 + return compare(actual, expected) === 0;
332 +
333 + // 7.2. If the expected value is a Date object, the actual value is
334 + // equivalent if it is also a Date object that refers to the same time.
335 + } else if (util.isDate(actual) && util.isDate(expected)) {
336 + return actual.getTime() === expected.getTime();
337 +
338 + // 7.3 If the expected value is a RegExp object, the actual value is
339 + // equivalent if it is also a RegExp object with the same source and
340 + // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
341 + } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
342 + return actual.source === expected.source &&
343 + actual.global === expected.global &&
344 + actual.multiline === expected.multiline &&
345 + actual.lastIndex === expected.lastIndex &&
346 + actual.ignoreCase === expected.ignoreCase;
347 +
348 + // 7.4. Other pairs that do not both pass typeof value == 'object',
349 + // equivalence is determined by ==.
350 + } else if ((actual === null || typeof actual !== 'object') &&
351 + (expected === null || typeof expected !== 'object')) {
352 + return strict ? actual === expected : actual == expected;
353 +
354 + // If both values are instances of typed arrays, wrap their underlying
355 + // ArrayBuffers in a Buffer each to increase performance
356 + // This optimization requires the arrays to have the same type as checked by
357 + // Object.prototype.toString (aka pToString). Never perform binary
358 + // comparisons for Float*Arrays, though, since e.g. +0 === -0 but their
359 + // bit patterns are not identical.
360 + } else if (isView(actual) && isView(expected) &&
361 + pToString(actual) === pToString(expected) &&
362 + !(actual instanceof Float32Array ||
363 + actual instanceof Float64Array)) {
364 + return compare(new Uint8Array(actual.buffer),
365 + new Uint8Array(expected.buffer)) === 0;
366 +
367 + // 7.5 For all other Object pairs, including Array objects, equivalence is
368 + // determined by having the same number of owned properties (as verified
369 + // with Object.prototype.hasOwnProperty.call), the same set of keys
370 + // (although not necessarily the same order), equivalent values for every
371 + // corresponding key, and an identical 'prototype' property. Note: this
372 + // accounts for both named and indexed properties on Arrays.
373 + } else if (isBuffer(actual) !== isBuffer(expected)) {
374 + return false;
375 + } else {
376 + memos = memos || {actual: [], expected: []};
377 +
378 + var actualIndex = memos.actual.indexOf(actual);
379 + if (actualIndex !== -1) {
380 + if (actualIndex === memos.expected.indexOf(expected)) {
381 + return true;
382 + }
383 + }
384 +
385 + memos.actual.push(actual);
386 + memos.expected.push(expected);
387 +
388 + return objEquiv(actual, expected, strict, memos);
389 + }
390 +}
391 +
392 +function isArguments(object) {
393 + return Object.prototype.toString.call(object) == '[object Arguments]';
394 +}
395 +
396 +function objEquiv(a, b, strict, actualVisitedObjects) {
397 + if (a === null || a === undefined || b === null || b === undefined)
398 + return false;
399 + // if one is a primitive, the other must be same
400 + if (util.isPrimitive(a) || util.isPrimitive(b))
401 + return a === b;
402 + if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
403 + return false;
404 + var aIsArgs = isArguments(a);
405 + var bIsArgs = isArguments(b);
406 + if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
407 + return false;
408 + if (aIsArgs) {
409 + a = pSlice.call(a);
410 + b = pSlice.call(b);
411 + return _deepEqual(a, b, strict);
412 + }
413 + var ka = objectKeys(a);
414 + var kb = objectKeys(b);
415 + var key, i;
416 + // having the same number of owned properties (keys incorporates
417 + // hasOwnProperty)
418 + if (ka.length !== kb.length)
419 + return false;
420 + //the same set of keys (although not necessarily the same order),
421 + ka.sort();
422 + kb.sort();
423 + //~~~cheap key test
424 + for (i = ka.length - 1; i >= 0; i--) {
425 + if (ka[i] !== kb[i])
426 + return false;
427 + }
428 + //equivalent values for every corresponding key, and
429 + //~~~possibly expensive deep test
430 + for (i = ka.length - 1; i >= 0; i--) {
431 + key = ka[i];
432 + if (!_deepEqual(a[key], b[key], strict, actualVisitedObjects))
433 + return false;
434 + }
435 + return true;
436 +}
437 +
438 +// 8. The non-equivalence assertion tests for any deep inequality.
439 +// assert.notDeepEqual(actual, expected, message_opt);
440 +
441 +assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
442 + if (_deepEqual(actual, expected, false)) {
443 + fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
444 + }
445 +};
446 +
447 +assert.notDeepStrictEqual = notDeepStrictEqual;
448 +function notDeepStrictEqual(actual, expected, message) {
449 + if (_deepEqual(actual, expected, true)) {
450 + fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
451 + }
452 +}
453 +
454 +
455 +// 9. The strict equality assertion tests strict equality, as determined by ===.
456 +// assert.strictEqual(actual, expected, message_opt);
457 +
458 +assert.strictEqual = function strictEqual(actual, expected, message) {
459 + if (actual !== expected) {
460 + fail(actual, expected, message, '===', assert.strictEqual);
461 + }
462 +};
463 +
464 +// 10. The strict non-equality assertion tests for strict inequality, as
465 +// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
466 +
467 +assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
468 + if (actual === expected) {
469 + fail(actual, expected, message, '!==', assert.notStrictEqual);
470 + }
471 +};
472 +
473 +function expectedException(actual, expected) {
474 + if (!actual || !expected) {
475 + return false;
476 + }
477 +
478 + if (Object.prototype.toString.call(expected) == '[object RegExp]') {
479 + return expected.test(actual);
480 + }
481 +
482 + try {
483 + if (actual instanceof expected) {
484 + return true;
485 + }
486 + } catch (e) {
487 + // Ignore. The instanceof check doesn't work for arrow functions.
488 + }
489 +
490 + if (Error.isPrototypeOf(expected)) {
491 + return false;
492 + }
493 +
494 + return expected.call({}, actual) === true;
495 +}
496 +
497 +function _tryBlock(block) {
498 + var error;
499 + try {
500 + block();
501 + } catch (e) {
502 + error = e;
503 + }
504 + return error;
505 +}
506 +
507 +function _throws(shouldThrow, block, expected, message) {
508 + var actual;
509 +
510 + if (typeof block !== 'function') {
511 + throw new TypeError('"block" argument must be a function');
512 + }
513 +
514 + if (typeof expected === 'string') {
515 + message = expected;
516 + expected = null;
517 + }
518 +
519 + actual = _tryBlock(block);
520 +
521 + message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
522 + (message ? ' ' + message : '.');
523 +
524 + if (shouldThrow && !actual) {
525 + fail(actual, expected, 'Missing expected exception' + message);
526 + }
527 +
528 + var userProvidedMessage = typeof message === 'string';
529 + var isUnwantedException = !shouldThrow && util.isError(actual);
530 + var isUnexpectedException = !shouldThrow && actual && !expected;
531 +
532 + if ((isUnwantedException &&
533 + userProvidedMessage &&
534 + expectedException(actual, expected)) ||
535 + isUnexpectedException) {
536 + fail(actual, expected, 'Got unwanted exception' + message);
537 + }
538 +
539 + if ((shouldThrow && actual && expected &&
540 + !expectedException(actual, expected)) || (!shouldThrow && actual)) {
541 + throw actual;
542 + }
543 +}
544 +
545 +// 11. Expected to throw an error:
546 +// assert.throws(block, Error_opt, message_opt);
547 +
548 +assert.throws = function(block, /*optional*/error, /*optional*/message) {
549 + _throws(true, block, error, message);
550 +};
551 +
552 +// EXTENSION! This is annoying to write outside this module.
553 +assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
554 + _throws(false, block, error, message);
555 +};
556 +
557 +assert.ifError = function(err) { if (err) throw err; };
558 +
559 +var objectKeys = Object.keys || function (obj) {
560 + var keys = [];
561 + for (var key in obj) {
562 + if (hasOwn.call(obj, key)) keys.push(key);
563 + }
564 + return keys;
565 +};
566 +
567 +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
568 +},{"util/":560}],4:[function(require,module,exports){
569 +"use strict";
570 +
571 +exports.__esModule = true;
572 +
573 +exports.default = function (rawLines, lineNumber, colNumber) {
574 + var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
575 +
576 + colNumber = Math.max(colNumber, 0);
577 +
578 + var highlighted = opts.highlightCode && _chalk2.default.supportsColor || opts.forceColor;
579 + var chalk = _chalk2.default;
580 + if (opts.forceColor) {
581 + chalk = new _chalk2.default.constructor({ enabled: true });
582 + }
583 + var maybeHighlight = function maybeHighlight(chalkFn, string) {
584 + return highlighted ? chalkFn(string) : string;
585 + };
586 + var defs = getDefs(chalk);
587 + if (highlighted) rawLines = highlight(defs, rawLines);
588 +
589 + var linesAbove = opts.linesAbove || 2;
590 + var linesBelow = opts.linesBelow || 3;
591 +
592 + var lines = rawLines.split(NEWLINE);
593 + var start = Math.max(lineNumber - (linesAbove + 1), 0);
594 + var end = Math.min(lines.length, lineNumber + linesBelow);
595 +
596 + if (!lineNumber && !colNumber) {
597 + start = 0;
598 + end = lines.length;
599 + }
600 +
601 + var numberMaxWidth = String(end).length;
602 +
603 + var frame = lines.slice(start, end).map(function (line, index) {
604 + var number = start + 1 + index;
605 + var paddedNumber = (" " + number).slice(-numberMaxWidth);
606 + var gutter = " " + paddedNumber + " | ";
607 + if (number === lineNumber) {
608 + var markerLine = "";
609 + if (colNumber) {
610 + var markerSpacing = line.slice(0, colNumber - 1).replace(/[^\t]/g, " ");
611 + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), markerSpacing, maybeHighlight(defs.marker, "^")].join("");
612 + }
613 + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line, markerLine].join("");
614 + } else {
615 + return " " + maybeHighlight(defs.gutter, gutter) + line;
616 + }
617 + }).join("\n");
618 +
619 + if (highlighted) {
620 + return chalk.reset(frame);
621 + } else {
622 + return frame;
623 + }
624 +};
625 +
626 +var _jsTokens = require("js-tokens");
627 +
628 +var _jsTokens2 = _interopRequireDefault(_jsTokens);
629 +
630 +var _esutils = require("esutils");
631 +
632 +var _esutils2 = _interopRequireDefault(_esutils);
633 +
634 +var _chalk = require("chalk");
635 +
636 +var _chalk2 = _interopRequireDefault(_chalk);
637 +
638 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
639 +
640 +function getDefs(chalk) {
641 + return {
642 + keyword: chalk.cyan,
643 + capitalized: chalk.yellow,
644 + jsx_tag: chalk.yellow,
645 + punctuator: chalk.yellow,
646 +
647 + number: chalk.magenta,
648 + string: chalk.green,
649 + regex: chalk.magenta,
650 + comment: chalk.grey,
651 + invalid: chalk.white.bgRed.bold,
652 + gutter: chalk.grey,
653 + marker: chalk.red.bold
654 + };
655 +}
656 +
657 +var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
658 +
659 +var JSX_TAG = /^[a-z][\w-]*$/i;
660 +
661 +var BRACKET = /^[()\[\]{}]$/;
662 +
663 +function getTokenType(match) {
664 + var _match$slice = match.slice(-2),
665 + offset = _match$slice[0],
666 + text = _match$slice[1];
667 +
668 + var token = (0, _jsTokens.matchToToken)(match);
669 +
670 + if (token.type === "name") {
671 + if (_esutils2.default.keyword.isReservedWordES6(token.value)) {
672 + return "keyword";
673 + }
674 +
675 + if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.substr(offset - 2, 2) == "</")) {
676 + return "jsx_tag";
677 + }
678 +
679 + if (token.value[0] !== token.value[0].toLowerCase()) {
680 + return "capitalized";
681 + }
682 + }
683 +
684 + if (token.type === "punctuator" && BRACKET.test(token.value)) {
685 + return "bracket";
686 + }
687 +
688 + return token.type;
689 +}
690 +
691 +function highlight(defs, text) {
692 + return text.replace(_jsTokens2.default, function () {
693 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
694 + args[_key] = arguments[_key];
695 + }
696 +
697 + var type = getTokenType(args);
698 + var colorize = defs[type];
699 + if (colorize) {
700 + return args[0].split(NEWLINE).map(function (str) {
701 + return colorize(str);
702 + }).join("\n");
703 + } else {
704 + return args[0];
705 + }
706 + });
707 +}
708 +
709 +module.exports = exports["default"];
710 +},{"chalk":161,"esutils":287,"js-tokens":295}],5:[function(require,module,exports){
711 +module.exports = require("./lib/api/node.js");
712 +
713 +},{"./lib/api/node.js":6}],6:[function(require,module,exports){
714 +"use strict";
715 +
716 +exports.__esModule = true;
717 +exports.transformFromAst = exports.transform = exports.analyse = exports.Pipeline = exports.OptionManager = exports.traverse = exports.types = exports.messages = exports.util = exports.version = exports.resolvePreset = exports.resolvePlugin = exports.template = exports.buildExternalHelpers = exports.options = exports.File = undefined;
718 +
719 +var _file = require("../transformation/file");
720 +
721 +Object.defineProperty(exports, "File", {
722 + enumerable: true,
723 + get: function get() {
724 + return _interopRequireDefault(_file).default;
725 + }
726 +});
727 +
728 +var _config = require("../transformation/file/options/config");
729 +
730 +Object.defineProperty(exports, "options", {
731 + enumerable: true,
732 + get: function get() {
733 + return _interopRequireDefault(_config).default;
734 + }
735 +});
736 +
737 +var _buildExternalHelpers = require("../tools/build-external-helpers");
738 +
739 +Object.defineProperty(exports, "buildExternalHelpers", {
740 + enumerable: true,
741 + get: function get() {
742 + return _interopRequireDefault(_buildExternalHelpers).default;
743 + }
744 +});
745 +
746 +var _babelTemplate = require("babel-template");
747 +
748 +Object.defineProperty(exports, "template", {
749 + enumerable: true,
750 + get: function get() {
751 + return _interopRequireDefault(_babelTemplate).default;
752 + }
753 +});
754 +
755 +var _resolvePlugin = require("../helpers/resolve-plugin");
756 +
757 +Object.defineProperty(exports, "resolvePlugin", {
758 + enumerable: true,
759 + get: function get() {
760 + return _interopRequireDefault(_resolvePlugin).default;
761 + }
762 +});
763 +
764 +var _resolvePreset = require("../helpers/resolve-preset");
765 +
766 +Object.defineProperty(exports, "resolvePreset", {
767 + enumerable: true,
768 + get: function get() {
769 + return _interopRequireDefault(_resolvePreset).default;
770 + }
771 +});
772 +
773 +var _package = require("../../package");
774 +
775 +Object.defineProperty(exports, "version", {
776 + enumerable: true,
777 + get: function get() {
778 + return _package.version;
779 + }
780 +});
781 +exports.Plugin = Plugin;
782 +exports.transformFile = transformFile;
783 +exports.transformFileSync = transformFileSync;
784 +
785 +var _fs = require("fs");
786 +
787 +var _fs2 = _interopRequireDefault(_fs);
788 +
789 +var _util = require("../util");
790 +
791 +var util = _interopRequireWildcard(_util);
792 +
793 +var _babelMessages = require("babel-messages");
794 +
795 +var messages = _interopRequireWildcard(_babelMessages);
796 +
797 +var _babelTypes = require("babel-types");
798 +
799 +var t = _interopRequireWildcard(_babelTypes);
800 +
801 +var _babelTraverse = require("babel-traverse");
802 +
803 +var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
804 +
805 +var _optionManager = require("../transformation/file/options/option-manager");
806 +
807 +var _optionManager2 = _interopRequireDefault(_optionManager);
808 +
809 +var _pipeline = require("../transformation/pipeline");
810 +
811 +var _pipeline2 = _interopRequireDefault(_pipeline);
812 +
813 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
814 +
815 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
816 +
817 +exports.util = util;
818 +exports.messages = messages;
819 +exports.types = t;
820 +exports.traverse = _babelTraverse2.default;
821 +exports.OptionManager = _optionManager2.default;
822 +function Plugin(alias) {
823 + throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6.");
824 +}
825 +
826 +exports.Pipeline = _pipeline2.default;
827 +
828 +
829 +var pipeline = new _pipeline2.default();
830 +var analyse = exports.analyse = pipeline.analyse.bind(pipeline);
831 +var transform = exports.transform = pipeline.transform.bind(pipeline);
832 +var transformFromAst = exports.transformFromAst = pipeline.transformFromAst.bind(pipeline);
833 +
834 +function transformFile(filename, opts, callback) {
835 + if (typeof opts === "function") {
836 + callback = opts;
837 + opts = {};
838 + }
839 +
840 + opts.filename = filename;
841 +
842 + _fs2.default.readFile(filename, function (err, code) {
843 + var result = void 0;
844 +
845 + if (!err) {
846 + try {
847 + result = transform(code, opts);
848 + } catch (_err) {
849 + err = _err;
850 + }
851 + }
852 +
853 + if (err) {
854 + callback(err);
855 + } else {
856 + callback(null, result);
857 + }
858 + });
859 +}
860 +
861 +function transformFileSync(filename) {
862 + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
863 +
864 + opts.filename = filename;
865 + return transform(_fs2.default.readFileSync(filename, "utf8"), opts);
866 +}
867 +},{"../../package":32,"../helpers/resolve-plugin":12,"../helpers/resolve-preset":13,"../tools/build-external-helpers":16,"../transformation/file":17,"../transformation/file/options/config":21,"../transformation/file/options/option-manager":23,"../transformation/pipeline":28,"../util":31,"babel-messages":61,"babel-template":114,"babel-traverse":118,"babel-types":151,"fs":159}],7:[function(require,module,exports){
868 +"use strict";
869 +
870 +exports.__esModule = true;
871 +exports.default = getPossiblePluginNames;
872 +function getPossiblePluginNames(pluginName) {
873 + return ["babel-plugin-" + pluginName, pluginName];
874 +}
875 +module.exports = exports["default"];
876 +},{}],8:[function(require,module,exports){
877 +"use strict";
878 +
879 +exports.__esModule = true;
880 +exports.default = getPossiblePresetNames;
881 +function getPossiblePresetNames(presetName) {
882 + var possibleNames = ["babel-preset-" + presetName, presetName];
883 +
884 + var matches = presetName.match(/^(@[^/]+)\/(.+)$/);
885 + if (matches) {
886 + var orgName = matches[1],
887 + presetPath = matches[2];
888 +
889 + possibleNames.push(orgName + "/babel-preset-" + presetPath);
890 + }
891 +
892 + return possibleNames;
893 +}
894 +module.exports = exports["default"];
895 +},{}],9:[function(require,module,exports){
896 +"use strict";
897 +
898 +exports.__esModule = true;
899 +
900 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
901 +
902 +var _getIterator3 = _interopRequireDefault(_getIterator2);
903 +
904 +exports.default = function (dest, src) {
905 + if (!dest || !src) return;
906 +
907 + return (0, _mergeWith2.default)(dest, src, function (a, b) {
908 + if (b && Array.isArray(a)) {
909 + var newArray = b.slice(0);
910 +
911 + for (var _iterator = a, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
912 + var _ref;
913 +
914 + if (_isArray) {
915 + if (_i >= _iterator.length) break;
916 + _ref = _iterator[_i++];
917 + } else {
918 + _i = _iterator.next();
919 + if (_i.done) break;
920 + _ref = _i.value;
921 + }
922 +
923 + var item = _ref;
924 +
925 + if (newArray.indexOf(item) < 0) {
926 + newArray.push(item);
927 + }
928 + }
929 +
930 + return newArray;
931 + }
932 + });
933 +};
934 +
935 +var _mergeWith = require("lodash/mergeWith");
936 +
937 +var _mergeWith2 = _interopRequireDefault(_mergeWith);
938 +
939 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
940 +
941 +module.exports = exports["default"];
942 +},{"babel-runtime/core-js/get-iterator":95,"lodash/mergeWith":502}],10:[function(require,module,exports){
943 +"use strict";
944 +
945 +exports.__esModule = true;
946 +
947 +exports.default = function (ast, comments, tokens) {
948 + if (ast) {
949 + if (ast.type === "Program") {
950 + return t.file(ast, comments || [], tokens || []);
951 + } else if (ast.type === "File") {
952 + return ast;
953 + }
954 + }
955 +
956 + throw new Error("Not a valid ast?");
957 +};
958 +
959 +var _babelTypes = require("babel-types");
960 +
961 +var t = _interopRequireWildcard(_babelTypes);
962 +
963 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
964 +
965 +module.exports = exports["default"];
966 +},{"babel-types":151}],11:[function(require,module,exports){
967 +"use strict";
968 +
969 +exports.__esModule = true;
970 +exports.default = resolveFromPossibleNames;
971 +
972 +var _resolve = require("./resolve");
973 +
974 +var _resolve2 = _interopRequireDefault(_resolve);
975 +
976 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
977 +
978 +function resolveFromPossibleNames(possibleNames, dirname) {
979 + return possibleNames.reduce(function (accum, curr) {
980 + return accum || (0, _resolve2.default)(curr, dirname);
981 + }, null);
982 +}
983 +module.exports = exports["default"];
984 +},{"./resolve":14}],12:[function(require,module,exports){
985 +(function (process){
986 +"use strict";
987 +
988 +exports.__esModule = true;
989 +exports.default = resolvePlugin;
990 +
991 +var _resolveFromPossibleNames = require("./resolve-from-possible-names");
992 +
993 +var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
994 +
995 +var _getPossiblePluginNames = require("./get-possible-plugin-names");
996 +
997 +var _getPossiblePluginNames2 = _interopRequireDefault(_getPossiblePluginNames);
998 +
999 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1000 +
1001 +function resolvePlugin(pluginName) {
1002 + var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
1003 +
1004 + return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePluginNames2.default)(pluginName), dirname);
1005 +}
1006 +module.exports = exports["default"];
1007 +}).call(this,require('_process'))
1008 +},{"./get-possible-plugin-names":7,"./resolve-from-possible-names":11,"_process":525}],13:[function(require,module,exports){
1009 +(function (process){
1010 +"use strict";
1011 +
1012 +exports.__esModule = true;
1013 +exports.default = resolvePreset;
1014 +
1015 +var _resolveFromPossibleNames = require("./resolve-from-possible-names");
1016 +
1017 +var _resolveFromPossibleNames2 = _interopRequireDefault(_resolveFromPossibleNames);
1018 +
1019 +var _getPossiblePresetNames = require("./get-possible-preset-names");
1020 +
1021 +var _getPossiblePresetNames2 = _interopRequireDefault(_getPossiblePresetNames);
1022 +
1023 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1024 +
1025 +function resolvePreset(presetName) {
1026 + var dirname = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
1027 +
1028 + return (0, _resolveFromPossibleNames2.default)((0, _getPossiblePresetNames2.default)(presetName), dirname);
1029 +}
1030 +module.exports = exports["default"];
1031 +}).call(this,require('_process'))
1032 +},{"./get-possible-preset-names":8,"./resolve-from-possible-names":11,"_process":525}],14:[function(require,module,exports){
1033 +(function (process){
1034 +"use strict";
1035 +
1036 +exports.__esModule = true;
1037 +
1038 +var _typeof2 = require("babel-runtime/helpers/typeof");
1039 +
1040 +var _typeof3 = _interopRequireDefault(_typeof2);
1041 +
1042 +exports.default = function (loc) {
1043 + var relative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.cwd();
1044 +
1045 + if ((typeof _module2.default === "undefined" ? "undefined" : (0, _typeof3.default)(_module2.default)) === "object") return null;
1046 +
1047 + var relativeMod = relativeModules[relative];
1048 +
1049 + if (!relativeMod) {
1050 + relativeMod = new _module2.default();
1051 +
1052 + var filename = _path2.default.join(relative, ".babelrc");
1053 + relativeMod.id = filename;
1054 + relativeMod.filename = filename;
1055 +
1056 + relativeMod.paths = _module2.default._nodeModulePaths(relative);
1057 + relativeModules[relative] = relativeMod;
1058 + }
1059 +
1060 + try {
1061 + return _module2.default._resolveFilename(loc, relativeMod);
1062 + } catch (err) {
1063 + return null;
1064 + }
1065 +};
1066 +
1067 +var _module = require("module");
1068 +
1069 +var _module2 = _interopRequireDefault(_module);
1070 +
1071 +var _path = require("path");
1072 +
1073 +var _path2 = _interopRequireDefault(_path);
1074 +
1075 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1076 +
1077 +var relativeModules = {};
1078 +
1079 +module.exports = exports["default"];
1080 +}).call(this,require('_process'))
1081 +},{"_process":525,"babel-runtime/helpers/typeof":113,"module":159,"path":522}],15:[function(require,module,exports){
1082 +"use strict";
1083 +
1084 +exports.__esModule = true;
1085 +
1086 +var _map = require("babel-runtime/core-js/map");
1087 +
1088 +var _map2 = _interopRequireDefault(_map);
1089 +
1090 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
1091 +
1092 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1093 +
1094 +var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
1095 +
1096 +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
1097 +
1098 +var _inherits2 = require("babel-runtime/helpers/inherits");
1099 +
1100 +var _inherits3 = _interopRequireDefault(_inherits2);
1101 +
1102 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1103 +
1104 +var Store = function (_Map) {
1105 + (0, _inherits3.default)(Store, _Map);
1106 +
1107 + function Store() {
1108 + (0, _classCallCheck3.default)(this, Store);
1109 +
1110 + var _this = (0, _possibleConstructorReturn3.default)(this, _Map.call(this));
1111 +
1112 + _this.dynamicData = {};
1113 + return _this;
1114 + }
1115 +
1116 + Store.prototype.setDynamic = function setDynamic(key, fn) {
1117 + this.dynamicData[key] = fn;
1118 + };
1119 +
1120 + Store.prototype.get = function get(key) {
1121 + if (this.has(key)) {
1122 + return _Map.prototype.get.call(this, key);
1123 + } else {
1124 + if (Object.prototype.hasOwnProperty.call(this.dynamicData, key)) {
1125 + var val = this.dynamicData[key]();
1126 + this.set(key, val);
1127 + return val;
1128 + }
1129 + }
1130 + };
1131 +
1132 + return Store;
1133 +}(_map2.default);
1134 +
1135 +exports.default = Store;
1136 +module.exports = exports["default"];
1137 +},{"babel-runtime/core-js/map":97,"babel-runtime/helpers/classCallCheck":109,"babel-runtime/helpers/inherits":110,"babel-runtime/helpers/possibleConstructorReturn":112}],16:[function(require,module,exports){
1138 +"use strict";
1139 +
1140 +exports.__esModule = true;
1141 +
1142 +exports.default = function (whitelist) {
1143 + var outputType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "global";
1144 +
1145 + var namespace = t.identifier("babelHelpers");
1146 +
1147 + var builder = function builder(body) {
1148 + return buildHelpers(body, namespace, whitelist);
1149 + };
1150 +
1151 + var tree = void 0;
1152 +
1153 + var build = {
1154 + global: buildGlobal,
1155 + umd: buildUmd,
1156 + var: buildVar
1157 + }[outputType];
1158 +
1159 + if (build) {
1160 + tree = build(namespace, builder);
1161 + } else {
1162 + throw new Error(messages.get("unsupportedOutputType", outputType));
1163 + }
1164 +
1165 + return (0, _babelGenerator2.default)(tree).code;
1166 +};
1167 +
1168 +var _babelHelpers = require("babel-helpers");
1169 +
1170 +var helpers = _interopRequireWildcard(_babelHelpers);
1171 +
1172 +var _babelGenerator = require("babel-generator");
1173 +
1174 +var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
1175 +
1176 +var _babelMessages = require("babel-messages");
1177 +
1178 +var messages = _interopRequireWildcard(_babelMessages);
1179 +
1180 +var _babelTemplate = require("babel-template");
1181 +
1182 +var _babelTemplate2 = _interopRequireDefault(_babelTemplate);
1183 +
1184 +var _babelTypes = require("babel-types");
1185 +
1186 +var t = _interopRequireWildcard(_babelTypes);
1187 +
1188 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1189 +
1190 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1191 +
1192 +var buildUmdWrapper = (0, _babelTemplate2.default)("\n (function (root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(AMD_ARGUMENTS, factory);\n } else if (typeof exports === \"object\") {\n factory(COMMON_ARGUMENTS);\n } else {\n factory(BROWSER_ARGUMENTS);\n }\n })(UMD_ROOT, function (FACTORY_PARAMETERS) {\n FACTORY_BODY\n });\n");
1193 +
1194 +function buildGlobal(namespace, builder) {
1195 + var body = [];
1196 + var container = t.functionExpression(null, [t.identifier("global")], t.blockStatement(body));
1197 + var tree = t.program([t.expressionStatement(t.callExpression(container, [helpers.get("selfGlobal")]))]);
1198 +
1199 + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.assignmentExpression("=", t.memberExpression(t.identifier("global"), namespace), t.objectExpression([])))]));
1200 +
1201 + builder(body);
1202 +
1203 + return tree;
1204 +}
1205 +
1206 +function buildUmd(namespace, builder) {
1207 + var body = [];
1208 + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.identifier("global"))]));
1209 +
1210 + builder(body);
1211 +
1212 + return t.program([buildUmdWrapper({
1213 + FACTORY_PARAMETERS: t.identifier("global"),
1214 + BROWSER_ARGUMENTS: t.assignmentExpression("=", t.memberExpression(t.identifier("root"), namespace), t.objectExpression([])),
1215 + COMMON_ARGUMENTS: t.identifier("exports"),
1216 + AMD_ARGUMENTS: t.arrayExpression([t.stringLiteral("exports")]),
1217 + FACTORY_BODY: body,
1218 + UMD_ROOT: t.identifier("this")
1219 + })]);
1220 +}
1221 +
1222 +function buildVar(namespace, builder) {
1223 + var body = [];
1224 + body.push(t.variableDeclaration("var", [t.variableDeclarator(namespace, t.objectExpression([]))]));
1225 + builder(body);
1226 + body.push(t.expressionStatement(namespace));
1227 + return t.program(body);
1228 +}
1229 +
1230 +function buildHelpers(body, namespace, whitelist) {
1231 + helpers.list.forEach(function (name) {
1232 + if (whitelist && whitelist.indexOf(name) < 0) return;
1233 +
1234 + var key = t.identifier(name);
1235 + body.push(t.expressionStatement(t.assignmentExpression("=", t.memberExpression(namespace, key), helpers.get(name))));
1236 + });
1237 +}
1238 +module.exports = exports["default"];
1239 +},{"babel-generator":44,"babel-helpers":60,"babel-messages":61,"babel-template":114,"babel-types":151}],17:[function(require,module,exports){
1240 +(function (process){
1241 +"use strict";
1242 +
1243 +exports.__esModule = true;
1244 +exports.File = undefined;
1245 +
1246 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
1247 +
1248 +var _getIterator3 = _interopRequireDefault(_getIterator2);
1249 +
1250 +var _create = require("babel-runtime/core-js/object/create");
1251 +
1252 +var _create2 = _interopRequireDefault(_create);
1253 +
1254 +var _assign = require("babel-runtime/core-js/object/assign");
1255 +
1256 +var _assign2 = _interopRequireDefault(_assign);
1257 +
1258 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
1259 +
1260 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1261 +
1262 +var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
1263 +
1264 +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
1265 +
1266 +var _inherits2 = require("babel-runtime/helpers/inherits");
1267 +
1268 +var _inherits3 = _interopRequireDefault(_inherits2);
1269 +
1270 +var _babelHelpers = require("babel-helpers");
1271 +
1272 +var _babelHelpers2 = _interopRequireDefault(_babelHelpers);
1273 +
1274 +var _metadata = require("./metadata");
1275 +
1276 +var metadataVisitor = _interopRequireWildcard(_metadata);
1277 +
1278 +var _convertSourceMap = require("convert-source-map");
1279 +
1280 +var _convertSourceMap2 = _interopRequireDefault(_convertSourceMap);
1281 +
1282 +var _optionManager = require("./options/option-manager");
1283 +
1284 +var _optionManager2 = _interopRequireDefault(_optionManager);
1285 +
1286 +var _pluginPass = require("../plugin-pass");
1287 +
1288 +var _pluginPass2 = _interopRequireDefault(_pluginPass);
1289 +
1290 +var _babelTraverse = require("babel-traverse");
1291 +
1292 +var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
1293 +
1294 +var _sourceMap = require("source-map");
1295 +
1296 +var _sourceMap2 = _interopRequireDefault(_sourceMap);
1297 +
1298 +var _babelGenerator = require("babel-generator");
1299 +
1300 +var _babelGenerator2 = _interopRequireDefault(_babelGenerator);
1301 +
1302 +var _babelCodeFrame = require("babel-code-frame");
1303 +
1304 +var _babelCodeFrame2 = _interopRequireDefault(_babelCodeFrame);
1305 +
1306 +var _defaults = require("lodash/defaults");
1307 +
1308 +var _defaults2 = _interopRequireDefault(_defaults);
1309 +
1310 +var _logger = require("./logger");
1311 +
1312 +var _logger2 = _interopRequireDefault(_logger);
1313 +
1314 +var _store = require("../../store");
1315 +
1316 +var _store2 = _interopRequireDefault(_store);
1317 +
1318 +var _babylon = require("babylon");
1319 +
1320 +var _util = require("../../util");
1321 +
1322 +var util = _interopRequireWildcard(_util);
1323 +
1324 +var _path = require("path");
1325 +
1326 +var _path2 = _interopRequireDefault(_path);
1327 +
1328 +var _babelTypes = require("babel-types");
1329 +
1330 +var t = _interopRequireWildcard(_babelTypes);
1331 +
1332 +var _resolve = require("../../helpers/resolve");
1333 +
1334 +var _resolve2 = _interopRequireDefault(_resolve);
1335 +
1336 +var _blockHoist = require("../internal-plugins/block-hoist");
1337 +
1338 +var _blockHoist2 = _interopRequireDefault(_blockHoist);
1339 +
1340 +var _shadowFunctions = require("../internal-plugins/shadow-functions");
1341 +
1342 +var _shadowFunctions2 = _interopRequireDefault(_shadowFunctions);
1343 +
1344 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1345 +
1346 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1347 +
1348 +var shebangRegex = /^#!.*/;
1349 +
1350 +var INTERNAL_PLUGINS = [[_blockHoist2.default], [_shadowFunctions2.default]];
1351 +
1352 +var errorVisitor = {
1353 + enter: function enter(path, state) {
1354 + var loc = path.node.loc;
1355 + if (loc) {
1356 + state.loc = loc;
1357 + path.stop();
1358 + }
1359 + }
1360 +};
1361 +
1362 +var File = function (_Store) {
1363 + (0, _inherits3.default)(File, _Store);
1364 +
1365 + function File() {
1366 + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1367 + var pipeline = arguments[1];
1368 + (0, _classCallCheck3.default)(this, File);
1369 +
1370 + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
1371 +
1372 + _this.pipeline = pipeline;
1373 +
1374 + _this.log = new _logger2.default(_this, opts.filename || "unknown");
1375 + _this.opts = _this.initOptions(opts);
1376 +
1377 + _this.parserOpts = {
1378 + sourceType: _this.opts.sourceType,
1379 + sourceFileName: _this.opts.filename,
1380 + plugins: []
1381 + };
1382 +
1383 + _this.pluginVisitors = [];
1384 + _this.pluginPasses = [];
1385 +
1386 + _this.buildPluginsForOptions(_this.opts);
1387 +
1388 + if (_this.opts.passPerPreset) {
1389 + _this.perPresetOpts = [];
1390 + _this.opts.presets.forEach(function (presetOpts) {
1391 + var perPresetOpts = (0, _assign2.default)((0, _create2.default)(_this.opts), presetOpts);
1392 + _this.perPresetOpts.push(perPresetOpts);
1393 + _this.buildPluginsForOptions(perPresetOpts);
1394 + });
1395 + }
1396 +
1397 + _this.metadata = {
1398 + usedHelpers: [],
1399 + marked: [],
1400 + modules: {
1401 + imports: [],
1402 + exports: {
1403 + exported: [],
1404 + specifiers: []
1405 + }
1406 + }
1407 + };
1408 +
1409 + _this.dynamicImportTypes = {};
1410 + _this.dynamicImportIds = {};
1411 + _this.dynamicImports = [];
1412 + _this.declarations = {};
1413 + _this.usedHelpers = {};
1414 +
1415 + _this.path = null;
1416 + _this.ast = {};
1417 +
1418 + _this.code = "";
1419 + _this.shebang = "";
1420 +
1421 + _this.hub = new _babelTraverse.Hub(_this);
1422 + return _this;
1423 + }
1424 +
1425 + File.prototype.getMetadata = function getMetadata() {
1426 + var has = false;
1427 + for (var _iterator = this.ast.program.body, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
1428 + var _ref;
1429 +
1430 + if (_isArray) {
1431 + if (_i >= _iterator.length) break;
1432 + _ref = _iterator[_i++];
1433 + } else {
1434 + _i = _iterator.next();
1435 + if (_i.done) break;
1436 + _ref = _i.value;
1437 + }
1438 +
1439 + var node = _ref;
1440 +
1441 + if (t.isModuleDeclaration(node)) {
1442 + has = true;
1443 + break;
1444 + }
1445 + }
1446 + if (has) {
1447 + this.path.traverse(metadataVisitor, this);
1448 + }
1449 + };
1450 +
1451 + File.prototype.initOptions = function initOptions(opts) {
1452 + opts = new _optionManager2.default(this.log, this.pipeline).init(opts);
1453 +
1454 + if (opts.inputSourceMap) {
1455 + opts.sourceMaps = true;
1456 + }
1457 +
1458 + if (opts.moduleId) {
1459 + opts.moduleIds = true;
1460 + }
1461 +
1462 + opts.basename = _path2.default.basename(opts.filename, _path2.default.extname(opts.filename));
1463 +
1464 + opts.ignore = util.arrayify(opts.ignore, util.regexify);
1465 +
1466 + if (opts.only) opts.only = util.arrayify(opts.only, util.regexify);
1467 +
1468 + (0, _defaults2.default)(opts, {
1469 + moduleRoot: opts.sourceRoot
1470 + });
1471 +
1472 + (0, _defaults2.default)(opts, {
1473 + sourceRoot: opts.moduleRoot
1474 + });
1475 +
1476 + (0, _defaults2.default)(opts, {
1477 + filenameRelative: opts.filename
1478 + });
1479 +
1480 + var basenameRelative = _path2.default.basename(opts.filenameRelative);
1481 +
1482 + (0, _defaults2.default)(opts, {
1483 + sourceFileName: basenameRelative,
1484 + sourceMapTarget: basenameRelative
1485 + });
1486 +
1487 + return opts;
1488 + };
1489 +
1490 + File.prototype.buildPluginsForOptions = function buildPluginsForOptions(opts) {
1491 + if (!Array.isArray(opts.plugins)) {
1492 + return;
1493 + }
1494 +
1495 + var plugins = opts.plugins.concat(INTERNAL_PLUGINS);
1496 + var currentPluginVisitors = [];
1497 + var currentPluginPasses = [];
1498 +
1499 + for (var _iterator2 = plugins, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
1500 + var _ref2;
1501 +
1502 + if (_isArray2) {
1503 + if (_i2 >= _iterator2.length) break;
1504 + _ref2 = _iterator2[_i2++];
1505 + } else {
1506 + _i2 = _iterator2.next();
1507 + if (_i2.done) break;
1508 + _ref2 = _i2.value;
1509 + }
1510 +
1511 + var ref = _ref2;
1512 + var plugin = ref[0],
1513 + pluginOpts = ref[1];
1514 +
1515 +
1516 + currentPluginVisitors.push(plugin.visitor);
1517 + currentPluginPasses.push(new _pluginPass2.default(this, plugin, pluginOpts));
1518 +
1519 + if (plugin.manipulateOptions) {
1520 + plugin.manipulateOptions(opts, this.parserOpts, this);
1521 + }
1522 + }
1523 +
1524 + this.pluginVisitors.push(currentPluginVisitors);
1525 + this.pluginPasses.push(currentPluginPasses);
1526 + };
1527 +
1528 + File.prototype.getModuleName = function getModuleName() {
1529 + var opts = this.opts;
1530 + if (!opts.moduleIds) {
1531 + return null;
1532 + }
1533 +
1534 + if (opts.moduleId != null && !opts.getModuleId) {
1535 + return opts.moduleId;
1536 + }
1537 +
1538 + var filenameRelative = opts.filenameRelative;
1539 + var moduleName = "";
1540 +
1541 + if (opts.moduleRoot != null) {
1542 + moduleName = opts.moduleRoot + "/";
1543 + }
1544 +
1545 + if (!opts.filenameRelative) {
1546 + return moduleName + opts.filename.replace(/^\//, "");
1547 + }
1548 +
1549 + if (opts.sourceRoot != null) {
1550 + var sourceRootRegEx = new RegExp("^" + opts.sourceRoot + "\/?");
1551 + filenameRelative = filenameRelative.replace(sourceRootRegEx, "");
1552 + }
1553 +
1554 + filenameRelative = filenameRelative.replace(/\.(\w*?)$/, "");
1555 +
1556 + moduleName += filenameRelative;
1557 +
1558 + moduleName = moduleName.replace(/\\/g, "/");
1559 +
1560 + if (opts.getModuleId) {
1561 + return opts.getModuleId(moduleName) || moduleName;
1562 + } else {
1563 + return moduleName;
1564 + }
1565 + };
1566 +
1567 + File.prototype.resolveModuleSource = function resolveModuleSource(source) {
1568 + var resolveModuleSource = this.opts.resolveModuleSource;
1569 + if (resolveModuleSource) source = resolveModuleSource(source, this.opts.filename);
1570 + return source;
1571 + };
1572 +
1573 + File.prototype.addImport = function addImport(source, imported) {
1574 + var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : imported;
1575 +
1576 + var alias = source + ":" + imported;
1577 + var id = this.dynamicImportIds[alias];
1578 +
1579 + if (!id) {
1580 + source = this.resolveModuleSource(source);
1581 + id = this.dynamicImportIds[alias] = this.scope.generateUidIdentifier(name);
1582 +
1583 + var specifiers = [];
1584 +
1585 + if (imported === "*") {
1586 + specifiers.push(t.importNamespaceSpecifier(id));
1587 + } else if (imported === "default") {
1588 + specifiers.push(t.importDefaultSpecifier(id));
1589 + } else {
1590 + specifiers.push(t.importSpecifier(id, t.identifier(imported)));
1591 + }
1592 +
1593 + var declar = t.importDeclaration(specifiers, t.stringLiteral(source));
1594 + declar._blockHoist = 3;
1595 +
1596 + this.path.unshiftContainer("body", declar);
1597 + }
1598 +
1599 + return id;
1600 + };
1601 +
1602 + File.prototype.addHelper = function addHelper(name) {
1603 + var declar = this.declarations[name];
1604 + if (declar) return declar;
1605 +
1606 + if (!this.usedHelpers[name]) {
1607 + this.metadata.usedHelpers.push(name);
1608 + this.usedHelpers[name] = true;
1609 + }
1610 +
1611 + var generator = this.get("helperGenerator");
1612 + var runtime = this.get("helpersNamespace");
1613 + if (generator) {
1614 + var res = generator(name);
1615 + if (res) return res;
1616 + } else if (runtime) {
1617 + return t.memberExpression(runtime, t.identifier(name));
1618 + }
1619 +
1620 + var ref = (0, _babelHelpers2.default)(name);
1621 + var uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
1622 +
1623 + if (t.isFunctionExpression(ref) && !ref.id) {
1624 + ref.body._compact = true;
1625 + ref._generated = true;
1626 + ref.id = uid;
1627 + ref.type = "FunctionDeclaration";
1628 + this.path.unshiftContainer("body", ref);
1629 + } else {
1630 + ref._compact = true;
1631 + this.scope.push({
1632 + id: uid,
1633 + init: ref,
1634 + unique: true
1635 + });
1636 + }
1637 +
1638 + return uid;
1639 + };
1640 +
1641 + File.prototype.addTemplateObject = function addTemplateObject(helperName, strings, raw) {
1642 + var stringIds = raw.elements.map(function (string) {
1643 + return string.value;
1644 + });
1645 + var name = helperName + "_" + raw.elements.length + "_" + stringIds.join(",");
1646 +
1647 + var declar = this.declarations[name];
1648 + if (declar) return declar;
1649 +
1650 + var uid = this.declarations[name] = this.scope.generateUidIdentifier("templateObject");
1651 +
1652 + var helperId = this.addHelper(helperName);
1653 + var init = t.callExpression(helperId, [strings, raw]);
1654 + init._compact = true;
1655 + this.scope.push({
1656 + id: uid,
1657 + init: init,
1658 + _blockHoist: 1.9 });
1659 + return uid;
1660 + };
1661 +
1662 + File.prototype.buildCodeFrameError = function buildCodeFrameError(node, msg) {
1663 + var Error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : SyntaxError;
1664 +
1665 + var loc = node && (node.loc || node._loc);
1666 +
1667 + var err = new Error(msg);
1668 +
1669 + if (loc) {
1670 + err.loc = loc.start;
1671 + } else {
1672 + (0, _babelTraverse2.default)(node, errorVisitor, this.scope, err);
1673 +
1674 + err.message += " (This is an error on an internal node. Probably an internal error";
1675 +
1676 + if (err.loc) {
1677 + err.message += ". Location has been estimated.";
1678 + }
1679 +
1680 + err.message += ")";
1681 + }
1682 +
1683 + return err;
1684 + };
1685 +
1686 + File.prototype.mergeSourceMap = function mergeSourceMap(map) {
1687 + var inputMap = this.opts.inputSourceMap;
1688 +
1689 + if (inputMap) {
1690 + var inputMapConsumer = new _sourceMap2.default.SourceMapConsumer(inputMap);
1691 + var outputMapConsumer = new _sourceMap2.default.SourceMapConsumer(map);
1692 +
1693 + var mergedGenerator = new _sourceMap2.default.SourceMapGenerator({
1694 + file: inputMapConsumer.file,
1695 + sourceRoot: inputMapConsumer.sourceRoot
1696 + });
1697 +
1698 + var source = outputMapConsumer.sources[0];
1699 +
1700 + inputMapConsumer.eachMapping(function (mapping) {
1701 + var generatedPosition = outputMapConsumer.generatedPositionFor({
1702 + line: mapping.generatedLine,
1703 + column: mapping.generatedColumn,
1704 + source: source
1705 + });
1706 + if (generatedPosition.column != null) {
1707 + mergedGenerator.addMapping({
1708 + source: mapping.source,
1709 +
1710 + original: mapping.source == null ? null : {
1711 + line: mapping.originalLine,
1712 + column: mapping.originalColumn
1713 + },
1714 +
1715 + generated: generatedPosition
1716 + });
1717 + }
1718 + });
1719 +
1720 + var mergedMap = mergedGenerator.toJSON();
1721 + inputMap.mappings = mergedMap.mappings;
1722 + return inputMap;
1723 + } else {
1724 + return map;
1725 + }
1726 + };
1727 +
1728 + File.prototype.parse = function parse(code) {
1729 + var parseCode = _babylon.parse;
1730 + var parserOpts = this.opts.parserOpts;
1731 +
1732 + if (parserOpts) {
1733 + parserOpts = (0, _assign2.default)({}, this.parserOpts, parserOpts);
1734 +
1735 + if (parserOpts.parser) {
1736 + if (typeof parserOpts.parser === "string") {
1737 + var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
1738 + var parser = (0, _resolve2.default)(parserOpts.parser, dirname);
1739 + if (parser) {
1740 + parseCode = require(parser).parse;
1741 + } else {
1742 + throw new Error("Couldn't find parser " + parserOpts.parser + " with \"parse\" method " + ("relative to directory " + dirname));
1743 + }
1744 + } else {
1745 + parseCode = parserOpts.parser;
1746 + }
1747 +
1748 + parserOpts.parser = {
1749 + parse: function parse(source) {
1750 + return (0, _babylon.parse)(source, parserOpts);
1751 + }
1752 + };
1753 + }
1754 + }
1755 +
1756 + this.log.debug("Parse start");
1757 + var ast = parseCode(code, parserOpts || this.parserOpts);
1758 + this.log.debug("Parse stop");
1759 + return ast;
1760 + };
1761 +
1762 + File.prototype._addAst = function _addAst(ast) {
1763 + this.path = _babelTraverse.NodePath.get({
1764 + hub: this.hub,
1765 + parentPath: null,
1766 + parent: ast,
1767 + container: ast,
1768 + key: "program"
1769 + }).setContext();
1770 + this.scope = this.path.scope;
1771 + this.ast = ast;
1772 + this.getMetadata();
1773 + };
1774 +
1775 + File.prototype.addAst = function addAst(ast) {
1776 + this.log.debug("Start set AST");
1777 + this._addAst(ast);
1778 + this.log.debug("End set AST");
1779 + };
1780 +
1781 + File.prototype.transform = function transform() {
1782 + for (var i = 0; i < this.pluginPasses.length; i++) {
1783 + var pluginPasses = this.pluginPasses[i];
1784 + this.call("pre", pluginPasses);
1785 + this.log.debug("Start transform traverse");
1786 +
1787 + var visitor = _babelTraverse2.default.visitors.merge(this.pluginVisitors[i], pluginPasses, this.opts.wrapPluginVisitorMethod);
1788 + (0, _babelTraverse2.default)(this.ast, visitor, this.scope);
1789 +
1790 + this.log.debug("End transform traverse");
1791 + this.call("post", pluginPasses);
1792 + }
1793 +
1794 + return this.generate();
1795 + };
1796 +
1797 + File.prototype.wrap = function wrap(code, callback) {
1798 + code = code + "";
1799 +
1800 + try {
1801 + if (this.shouldIgnore()) {
1802 + return this.makeResult({ code: code, ignored: true });
1803 + } else {
1804 + return callback();
1805 + }
1806 + } catch (err) {
1807 + if (err._babel) {
1808 + throw err;
1809 + } else {
1810 + err._babel = true;
1811 + }
1812 +
1813 + var message = err.message = this.opts.filename + ": " + err.message;
1814 +
1815 + var loc = err.loc;
1816 + if (loc) {
1817 + err.codeFrame = (0, _babelCodeFrame2.default)(code, loc.line, loc.column + 1, this.opts);
1818 + message += "\n" + err.codeFrame;
1819 + }
1820 +
1821 + if (process.browser) {
1822 + err.message = message;
1823 + }
1824 +
1825 + if (err.stack) {
1826 + var newStack = err.stack.replace(err.message, message);
1827 + err.stack = newStack;
1828 + }
1829 +
1830 + throw err;
1831 + }
1832 + };
1833 +
1834 + File.prototype.addCode = function addCode(code) {
1835 + code = (code || "") + "";
1836 + code = this.parseInputSourceMap(code);
1837 + this.code = code;
1838 + };
1839 +
1840 + File.prototype.parseCode = function parseCode() {
1841 + this.parseShebang();
1842 + var ast = this.parse(this.code);
1843 + this.addAst(ast);
1844 + };
1845 +
1846 + File.prototype.shouldIgnore = function shouldIgnore() {
1847 + var opts = this.opts;
1848 + return util.shouldIgnore(opts.filename, opts.ignore, opts.only);
1849 + };
1850 +
1851 + File.prototype.call = function call(key, pluginPasses) {
1852 + for (var _iterator3 = pluginPasses, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
1853 + var _ref3;
1854 +
1855 + if (_isArray3) {
1856 + if (_i3 >= _iterator3.length) break;
1857 + _ref3 = _iterator3[_i3++];
1858 + } else {
1859 + _i3 = _iterator3.next();
1860 + if (_i3.done) break;
1861 + _ref3 = _i3.value;
1862 + }
1863 +
1864 + var pass = _ref3;
1865 +
1866 + var plugin = pass.plugin;
1867 + var fn = plugin[key];
1868 + if (fn) fn.call(pass, this);
1869 + }
1870 + };
1871 +
1872 + File.prototype.parseInputSourceMap = function parseInputSourceMap(code) {
1873 + var opts = this.opts;
1874 +
1875 + if (opts.inputSourceMap !== false) {
1876 + var inputMap = _convertSourceMap2.default.fromSource(code);
1877 + if (inputMap) {
1878 + opts.inputSourceMap = inputMap.toObject();
1879 + code = _convertSourceMap2.default.removeComments(code);
1880 + }
1881 + }
1882 +
1883 + return code;
1884 + };
1885 +
1886 + File.prototype.parseShebang = function parseShebang() {
1887 + var shebangMatch = shebangRegex.exec(this.code);
1888 + if (shebangMatch) {
1889 + this.shebang = shebangMatch[0];
1890 + this.code = this.code.replace(shebangRegex, "");
1891 + }
1892 + };
1893 +
1894 + File.prototype.makeResult = function makeResult(_ref4) {
1895 + var code = _ref4.code,
1896 + map = _ref4.map,
1897 + ast = _ref4.ast,
1898 + ignored = _ref4.ignored;
1899 +
1900 + var result = {
1901 + metadata: null,
1902 + options: this.opts,
1903 + ignored: !!ignored,
1904 + code: null,
1905 + ast: null,
1906 + map: map || null
1907 + };
1908 +
1909 + if (this.opts.code) {
1910 + result.code = code;
1911 + }
1912 +
1913 + if (this.opts.ast) {
1914 + result.ast = ast;
1915 + }
1916 +
1917 + if (this.opts.metadata) {
1918 + result.metadata = this.metadata;
1919 + }
1920 +
1921 + return result;
1922 + };
1923 +
1924 + File.prototype.generate = function generate() {
1925 + var opts = this.opts;
1926 + var ast = this.ast;
1927 +
1928 + var result = { ast: ast };
1929 + if (!opts.code) return this.makeResult(result);
1930 +
1931 + var gen = _babelGenerator2.default;
1932 + if (opts.generatorOpts.generator) {
1933 + gen = opts.generatorOpts.generator;
1934 +
1935 + if (typeof gen === "string") {
1936 + var dirname = _path2.default.dirname(this.opts.filename) || process.cwd();
1937 + var generator = (0, _resolve2.default)(gen, dirname);
1938 + if (generator) {
1939 + gen = require(generator).print;
1940 + } else {
1941 + throw new Error("Couldn't find generator " + gen + " with \"print\" method relative " + ("to directory " + dirname));
1942 + }
1943 + }
1944 + }
1945 +
1946 + this.log.debug("Generation start");
1947 +
1948 + var _result = gen(ast, opts.generatorOpts ? (0, _assign2.default)(opts, opts.generatorOpts) : opts, this.code);
1949 + result.code = _result.code;
1950 + result.map = _result.map;
1951 +
1952 + this.log.debug("Generation end");
1953 +
1954 + if (this.shebang) {
1955 + result.code = this.shebang + "\n" + result.code;
1956 + }
1957 +
1958 + if (result.map) {
1959 + result.map = this.mergeSourceMap(result.map);
1960 + }
1961 +
1962 + if (opts.sourceMaps === "inline" || opts.sourceMaps === "both") {
1963 + result.code += "\n" + _convertSourceMap2.default.fromObject(result.map).toComment();
1964 + }
1965 +
1966 + if (opts.sourceMaps === "inline") {
1967 + result.map = null;
1968 + }
1969 +
1970 + return this.makeResult(result);
1971 + };
1972 +
1973 + return File;
1974 +}(_store2.default);
1975 +
1976 +exports.default = File;
1977 +exports.File = File;
1978 +}).call(this,require('_process'))
1979 +},{"../../helpers/resolve":14,"../../store":15,"../../util":31,"../internal-plugins/block-hoist":26,"../internal-plugins/shadow-functions":27,"../plugin-pass":29,"./logger":18,"./metadata":19,"./options/option-manager":23,"_process":525,"babel-code-frame":4,"babel-generator":44,"babel-helpers":60,"babel-runtime/core-js/get-iterator":95,"babel-runtime/core-js/object/assign":99,"babel-runtime/core-js/object/create":100,"babel-runtime/helpers/classCallCheck":109,"babel-runtime/helpers/inherits":110,"babel-runtime/helpers/possibleConstructorReturn":112,"babel-traverse":118,"babel-types":151,"babylon":155,"convert-source-map":163,"lodash/defaults":470,"path":522,"source-map":552}],18:[function(require,module,exports){
1980 +"use strict";
1981 +
1982 +exports.__esModule = true;
1983 +
1984 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
1985 +
1986 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
1987 +
1988 +var _node = require("debug/node");
1989 +
1990 +var _node2 = _interopRequireDefault(_node);
1991 +
1992 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1993 +
1994 +var verboseDebug = (0, _node2.default)("babel:verbose");
1995 +var generalDebug = (0, _node2.default)("babel");
1996 +
1997 +var seenDeprecatedMessages = [];
1998 +
1999 +var Logger = function () {
2000 + function Logger(file, filename) {
2001 + (0, _classCallCheck3.default)(this, Logger);
2002 +
2003 + this.filename = filename;
2004 + this.file = file;
2005 + }
2006 +
2007 + Logger.prototype._buildMessage = function _buildMessage(msg) {
2008 + var parts = "[BABEL] " + this.filename;
2009 + if (msg) parts += ": " + msg;
2010 + return parts;
2011 + };
2012 +
2013 + Logger.prototype.warn = function warn(msg) {
2014 + console.warn(this._buildMessage(msg));
2015 + };
2016 +
2017 + Logger.prototype.error = function error(msg) {
2018 + var Constructor = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Error;
2019 +
2020 + throw new Constructor(this._buildMessage(msg));
2021 + };
2022 +
2023 + Logger.prototype.deprecate = function deprecate(msg) {
2024 + if (this.file.opts && this.file.opts.suppressDeprecationMessages) return;
2025 +
2026 + msg = this._buildMessage(msg);
2027 +
2028 + if (seenDeprecatedMessages.indexOf(msg) >= 0) return;
2029 +
2030 + seenDeprecatedMessages.push(msg);
2031 +
2032 + console.error(msg);
2033 + };
2034 +
2035 + Logger.prototype.verbose = function verbose(msg) {
2036 + if (verboseDebug.enabled) verboseDebug(this._buildMessage(msg));
2037 + };
2038 +
2039 + Logger.prototype.debug = function debug(msg) {
2040 + if (generalDebug.enabled) generalDebug(this._buildMessage(msg));
2041 + };
2042 +
2043 + Logger.prototype.deopt = function deopt(node, msg) {
2044 + this.debug(msg);
2045 + };
2046 +
2047 + return Logger;
2048 +}();
2049 +
2050 +exports.default = Logger;
2051 +module.exports = exports["default"];
2052 +},{"babel-runtime/helpers/classCallCheck":109,"debug/node":278}],19:[function(require,module,exports){
2053 +"use strict";
2054 +
2055 +exports.__esModule = true;
2056 +exports.ImportDeclaration = exports.ModuleDeclaration = undefined;
2057 +
2058 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
2059 +
2060 +var _getIterator3 = _interopRequireDefault(_getIterator2);
2061 +
2062 +exports.ExportDeclaration = ExportDeclaration;
2063 +exports.Scope = Scope;
2064 +
2065 +var _babelTypes = require("babel-types");
2066 +
2067 +var t = _interopRequireWildcard(_babelTypes);
2068 +
2069 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2070 +
2071 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2072 +
2073 +var ModuleDeclaration = exports.ModuleDeclaration = {
2074 + enter: function enter(path, file) {
2075 + var node = path.node;
2076 +
2077 + if (node.source) {
2078 + node.source.value = file.resolveModuleSource(node.source.value);
2079 + }
2080 + }
2081 +};
2082 +
2083 +var ImportDeclaration = exports.ImportDeclaration = {
2084 + exit: function exit(path, file) {
2085 + var node = path.node;
2086 +
2087 +
2088 + var specifiers = [];
2089 + var imported = [];
2090 + file.metadata.modules.imports.push({
2091 + source: node.source.value,
2092 + imported: imported,
2093 + specifiers: specifiers
2094 + });
2095 +
2096 + for (var _iterator = path.get("specifiers"), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
2097 + var _ref;
2098 +
2099 + if (_isArray) {
2100 + if (_i >= _iterator.length) break;
2101 + _ref = _iterator[_i++];
2102 + } else {
2103 + _i = _iterator.next();
2104 + if (_i.done) break;
2105 + _ref = _i.value;
2106 + }
2107 +
2108 + var specifier = _ref;
2109 +
2110 + var local = specifier.node.local.name;
2111 +
2112 + if (specifier.isImportDefaultSpecifier()) {
2113 + imported.push("default");
2114 + specifiers.push({
2115 + kind: "named",
2116 + imported: "default",
2117 + local: local
2118 + });
2119 + }
2120 +
2121 + if (specifier.isImportSpecifier()) {
2122 + var importedName = specifier.node.imported.name;
2123 + imported.push(importedName);
2124 + specifiers.push({
2125 + kind: "named",
2126 + imported: importedName,
2127 + local: local
2128 + });
2129 + }
2130 +
2131 + if (specifier.isImportNamespaceSpecifier()) {
2132 + imported.push("*");
2133 + specifiers.push({
2134 + kind: "namespace",
2135 + local: local
2136 + });
2137 + }
2138 + }
2139 + }
2140 +};
2141 +
2142 +function ExportDeclaration(path, file) {
2143 + var node = path.node;
2144 +
2145 +
2146 + var source = node.source ? node.source.value : null;
2147 + var exports = file.metadata.modules.exports;
2148 +
2149 + var declar = path.get("declaration");
2150 + if (declar.isStatement()) {
2151 + var bindings = declar.getBindingIdentifiers();
2152 +
2153 + for (var name in bindings) {
2154 + exports.exported.push(name);
2155 + exports.specifiers.push({
2156 + kind: "local",
2157 + local: name,
2158 + exported: path.isExportDefaultDeclaration() ? "default" : name
2159 + });
2160 + }
2161 + }
2162 +
2163 + if (path.isExportNamedDeclaration() && node.specifiers) {
2164 + for (var _iterator2 = node.specifiers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
2165 + var _ref2;
2166 +
2167 + if (_isArray2) {
2168 + if (_i2 >= _iterator2.length) break;
2169 + _ref2 = _iterator2[_i2++];
2170 + } else {
2171 + _i2 = _iterator2.next();
2172 + if (_i2.done) break;
2173 + _ref2 = _i2.value;
2174 + }
2175 +
2176 + var specifier = _ref2;
2177 +
2178 + var exported = specifier.exported.name;
2179 + exports.exported.push(exported);
2180 +
2181 + if (t.isExportDefaultSpecifier(specifier)) {
2182 + exports.specifiers.push({
2183 + kind: "external",
2184 + local: exported,
2185 + exported: exported,
2186 + source: source
2187 + });
2188 + }
2189 +
2190 + if (t.isExportNamespaceSpecifier(specifier)) {
2191 + exports.specifiers.push({
2192 + kind: "external-namespace",
2193 + exported: exported,
2194 + source: source
2195 + });
2196 + }
2197 +
2198 + var local = specifier.local;
2199 + if (!local) continue;
2200 +
2201 + if (source) {
2202 + exports.specifiers.push({
2203 + kind: "external",
2204 + local: local.name,
2205 + exported: exported,
2206 + source: source
2207 + });
2208 + }
2209 +
2210 + if (!source) {
2211 + exports.specifiers.push({
2212 + kind: "local",
2213 + local: local.name,
2214 + exported: exported
2215 + });
2216 + }
2217 + }
2218 + }
2219 +
2220 + if (path.isExportAllDeclaration()) {
2221 + exports.specifiers.push({
2222 + kind: "external-all",
2223 + source: source
2224 + });
2225 + }
2226 +}
2227 +
2228 +function Scope(path) {
2229 + path.skip();
2230 +}
2231 +},{"babel-runtime/core-js/get-iterator":95,"babel-types":151}],20:[function(require,module,exports){
2232 +(function (process){
2233 +"use strict";
2234 +
2235 +exports.__esModule = true;
2236 +
2237 +var _assign = require("babel-runtime/core-js/object/assign");
2238 +
2239 +var _assign2 = _interopRequireDefault(_assign);
2240 +
2241 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
2242 +
2243 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
2244 +
2245 +exports.default = buildConfigChain;
2246 +
2247 +var _resolve = require("../../../helpers/resolve");
2248 +
2249 +var _resolve2 = _interopRequireDefault(_resolve);
2250 +
2251 +var _json = require("json5");
2252 +
2253 +var _json2 = _interopRequireDefault(_json);
2254 +
2255 +var _pathIsAbsolute = require("path-is-absolute");
2256 +
2257 +var _pathIsAbsolute2 = _interopRequireDefault(_pathIsAbsolute);
2258 +
2259 +var _path = require("path");
2260 +
2261 +var _path2 = _interopRequireDefault(_path);
2262 +
2263 +var _fs = require("fs");
2264 +
2265 +var _fs2 = _interopRequireDefault(_fs);
2266 +
2267 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2268 +
2269 +var existsCache = {};
2270 +var jsonCache = {};
2271 +
2272 +var BABELIGNORE_FILENAME = ".babelignore";
2273 +var BABELRC_FILENAME = ".babelrc";
2274 +var PACKAGE_FILENAME = "package.json";
2275 +
2276 +function exists(filename) {
2277 + var cached = existsCache[filename];
2278 + if (cached == null) {
2279 + return existsCache[filename] = _fs2.default.existsSync(filename);
2280 + } else {
2281 + return cached;
2282 + }
2283 +}
2284 +
2285 +function buildConfigChain() {
2286 + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2287 + var log = arguments[1];
2288 +
2289 + var filename = opts.filename;
2290 + var builder = new ConfigChainBuilder(log);
2291 +
2292 + if (opts.babelrc !== false) {
2293 + builder.findConfigs(filename);
2294 + }
2295 +
2296 + builder.mergeConfig({
2297 + options: opts,
2298 + alias: "base",
2299 + dirname: filename && _path2.default.dirname(filename)
2300 + });
2301 +
2302 + return builder.configs;
2303 +}
2304 +
2305 +var ConfigChainBuilder = function () {
2306 + function ConfigChainBuilder(log) {
2307 + (0, _classCallCheck3.default)(this, ConfigChainBuilder);
2308 +
2309 + this.resolvedConfigs = [];
2310 + this.configs = [];
2311 + this.log = log;
2312 + }
2313 +
2314 + ConfigChainBuilder.prototype.findConfigs = function findConfigs(loc) {
2315 + if (!loc) return;
2316 +
2317 + if (!(0, _pathIsAbsolute2.default)(loc)) {
2318 + loc = _path2.default.join(process.cwd(), loc);
2319 + }
2320 +
2321 + var foundConfig = false;
2322 + var foundIgnore = false;
2323 +
2324 + while (loc !== (loc = _path2.default.dirname(loc))) {
2325 + if (!foundConfig) {
2326 + var configLoc = _path2.default.join(loc, BABELRC_FILENAME);
2327 + if (exists(configLoc)) {
2328 + this.addConfig(configLoc);
2329 + foundConfig = true;
2330 + }
2331 +
2332 + var pkgLoc = _path2.default.join(loc, PACKAGE_FILENAME);
2333 + if (!foundConfig && exists(pkgLoc)) {
2334 + foundConfig = this.addConfig(pkgLoc, "babel", JSON);
2335 + }
2336 + }
2337 +
2338 + if (!foundIgnore) {
2339 + var ignoreLoc = _path2.default.join(loc, BABELIGNORE_FILENAME);
2340 + if (exists(ignoreLoc)) {
2341 + this.addIgnoreConfig(ignoreLoc);
2342 + foundIgnore = true;
2343 + }
2344 + }
2345 +
2346 + if (foundIgnore && foundConfig) return;
2347 + }
2348 + };
2349 +
2350 + ConfigChainBuilder.prototype.addIgnoreConfig = function addIgnoreConfig(loc) {
2351 + var file = _fs2.default.readFileSync(loc, "utf8");
2352 + var lines = file.split("\n");
2353 +
2354 + lines = lines.map(function (line) {
2355 + return line.replace(/#(.*?)$/, "").trim();
2356 + }).filter(function (line) {
2357 + return !!line;
2358 + });
2359 +
2360 + if (lines.length) {
2361 + this.mergeConfig({
2362 + options: { ignore: lines },
2363 + alias: loc,
2364 + dirname: _path2.default.dirname(loc)
2365 + });
2366 + }
2367 + };
2368 +
2369 + ConfigChainBuilder.prototype.addConfig = function addConfig(loc, key) {
2370 + var json = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _json2.default;
2371 +
2372 + if (this.resolvedConfigs.indexOf(loc) >= 0) {
2373 + return false;
2374 + }
2375 +
2376 + this.resolvedConfigs.push(loc);
2377 +
2378 + var content = _fs2.default.readFileSync(loc, "utf8");
2379 + var options = void 0;
2380 +
2381 + try {
2382 + options = jsonCache[content] = jsonCache[content] || json.parse(content);
2383 + if (key) options = options[key];
2384 + } catch (err) {
2385 + err.message = loc + ": Error while parsing JSON - " + err.message;
2386 + throw err;
2387 + }
2388 +
2389 + this.mergeConfig({
2390 + options: options,
2391 + alias: loc,
2392 + dirname: _path2.default.dirname(loc)
2393 + });
2394 +
2395 + return !!options;
2396 + };
2397 +
2398 + ConfigChainBuilder.prototype.mergeConfig = function mergeConfig(_ref) {
2399 + var options = _ref.options,
2400 + alias = _ref.alias,
2401 + loc = _ref.loc,
2402 + dirname = _ref.dirname;
2403 +
2404 + if (!options) {
2405 + return false;
2406 + }
2407 +
2408 + options = (0, _assign2.default)({}, options);
2409 +
2410 + dirname = dirname || process.cwd();
2411 + loc = loc || alias;
2412 +
2413 + if (options.extends) {
2414 + var extendsLoc = (0, _resolve2.default)(options.extends, dirname);
2415 + if (extendsLoc) {
2416 + this.addConfig(extendsLoc);
2417 + } else {
2418 + if (this.log) this.log.error("Couldn't resolve extends clause of " + options.extends + " in " + alias);
2419 + }
2420 + delete options.extends;
2421 + }
2422 +
2423 + this.configs.push({
2424 + options: options,
2425 + alias: alias,
2426 + loc: loc,
2427 + dirname: dirname
2428 + });
2429 +
2430 + var envOpts = void 0;
2431 + var envKey = process.env.BABEL_ENV || process.env.NODE_ENV || "development";
2432 + if (options.env) {
2433 + envOpts = options.env[envKey];
2434 + delete options.env;
2435 + }
2436 +
2437 + this.mergeConfig({
2438 + options: envOpts,
2439 + alias: alias + ".env." + envKey,
2440 + dirname: dirname
2441 + });
2442 + };
2443 +
2444 + return ConfigChainBuilder;
2445 +}();
2446 +
2447 +module.exports = exports["default"];
2448 +}).call(this,require('_process'))
2449 +},{"../../../helpers/resolve":14,"_process":525,"babel-runtime/core-js/object/assign":99,"babel-runtime/helpers/classCallCheck":109,"fs":159,"json5":297,"path":522,"path-is-absolute":523}],21:[function(require,module,exports){
2450 +"use strict";
2451 +
2452 +module.exports = {
2453 + filename: {
2454 + type: "filename",
2455 + description: "filename to use when reading from stdin - this will be used in source-maps, errors etc",
2456 + default: "unknown",
2457 + shorthand: "f"
2458 + },
2459 +
2460 + filenameRelative: {
2461 + hidden: true,
2462 + type: "string"
2463 + },
2464 +
2465 + inputSourceMap: {
2466 + hidden: true
2467 + },
2468 +
2469 + env: {
2470 + hidden: true,
2471 + default: {}
2472 + },
2473 +
2474 + mode: {
2475 + description: "",
2476 + hidden: true
2477 + },
2478 +
2479 + retainLines: {
2480 + type: "boolean",
2481 + default: false,
2482 + description: "retain line numbers - will result in really ugly code"
2483 + },
2484 +
2485 + highlightCode: {
2486 + description: "enable/disable ANSI syntax highlighting of code frames (on by default)",
2487 + type: "boolean",
2488 + default: true
2489 + },
2490 +
2491 + suppressDeprecationMessages: {
2492 + type: "boolean",
2493 + default: false,
2494 + hidden: true
2495 + },
2496 +
2497 + presets: {
2498 + type: "list",
2499 + description: "",
2500 + default: []
2501 + },
2502 +
2503 + plugins: {
2504 + type: "list",
2505 + default: [],
2506 + description: ""
2507 + },
2508 +
2509 + ignore: {
2510 + type: "list",
2511 + description: "list of glob paths to **not** compile",
2512 + default: []
2513 + },
2514 +
2515 + only: {
2516 + type: "list",
2517 + description: "list of glob paths to **only** compile"
2518 + },
2519 +
2520 + code: {
2521 + hidden: true,
2522 + default: true,
2523 + type: "boolean"
2524 + },
2525 +
2526 + metadata: {
2527 + hidden: true,
2528 + default: true,
2529 + type: "boolean"
2530 + },
2531 +
2532 + ast: {
2533 + hidden: true,
2534 + default: true,
2535 + type: "boolean"
2536 + },
2537 +
2538 + extends: {
2539 + type: "string",
2540 + hidden: true
2541 + },
2542 +
2543 + comments: {
2544 + type: "boolean",
2545 + default: true,
2546 + description: "write comments to generated output (true by default)"
2547 + },
2548 +
2549 + shouldPrintComment: {
2550 + hidden: true,
2551 + description: "optional callback to control whether a comment should be inserted, when this is used the comments option is ignored"
2552 + },
2553 +
2554 + wrapPluginVisitorMethod: {
2555 + hidden: true,
2556 + description: "optional callback to wrap all visitor methods"
2557 + },
2558 +
2559 + compact: {
2560 + type: "booleanString",
2561 + default: "auto",
2562 + description: "do not include superfluous whitespace characters and line terminators [true|false|auto]"
2563 + },
2564 +
2565 + minified: {
2566 + type: "boolean",
2567 + default: false,
2568 + description: "save as much bytes when printing [true|false]"
2569 + },
2570 +
2571 + sourceMap: {
2572 + alias: "sourceMaps",
2573 + hidden: true
2574 + },
2575 +
2576 + sourceMaps: {
2577 + type: "booleanString",
2578 + description: "[true|false|inline]",
2579 + default: false,
2580 + shorthand: "s"
2581 + },
2582 +
2583 + sourceMapTarget: {
2584 + type: "string",
2585 + description: "set `file` on returned source map"
2586 + },
2587 +
2588 + sourceFileName: {
2589 + type: "string",
2590 + description: "set `sources[0]` on returned source map"
2591 + },
2592 +
2593 + sourceRoot: {
2594 + type: "filename",
2595 + description: "the root from which all sources are relative"
2596 + },
2597 +
2598 + babelrc: {
2599 + description: "Whether or not to look up .babelrc and .babelignore files",
2600 + type: "boolean",
2601 + default: true
2602 + },
2603 +
2604 + sourceType: {
2605 + description: "",
2606 + default: "module"
2607 + },
2608 +
2609 + auxiliaryCommentBefore: {
2610 + type: "string",
2611 + description: "print a comment before any injected non-user code"
2612 + },
2613 +
2614 + auxiliaryCommentAfter: {
2615 + type: "string",
2616 + description: "print a comment after any injected non-user code"
2617 + },
2618 +
2619 + resolveModuleSource: {
2620 + hidden: true
2621 + },
2622 +
2623 + getModuleId: {
2624 + hidden: true
2625 + },
2626 +
2627 + moduleRoot: {
2628 + type: "filename",
2629 + description: "optional prefix for the AMD module formatter that will be prepend to the filename on module definitions"
2630 + },
2631 +
2632 + moduleIds: {
2633 + type: "boolean",
2634 + default: false,
2635 + shorthand: "M",
2636 + description: "insert an explicit id for modules"
2637 + },
2638 +
2639 + moduleId: {
2640 + description: "specify a custom name for module ids",
2641 + type: "string"
2642 + },
2643 +
2644 + passPerPreset: {
2645 + description: "Whether to spawn a traversal pass per a preset. By default all presets are merged.",
2646 + type: "boolean",
2647 + default: false,
2648 + hidden: true
2649 + },
2650 +
2651 + parserOpts: {
2652 + description: "Options to pass into the parser, or to change parsers (parserOpts.parser)",
2653 + default: false
2654 + },
2655 +
2656 + generatorOpts: {
2657 + description: "Options to pass into the generator, or to change generators (generatorOpts.generator)",
2658 + default: false
2659 + }
2660 +};
2661 +},{}],22:[function(require,module,exports){
2662 +"use strict";
2663 +
2664 +exports.__esModule = true;
2665 +exports.config = undefined;
2666 +exports.normaliseOptions = normaliseOptions;
2667 +
2668 +var _parsers = require("./parsers");
2669 +
2670 +var parsers = _interopRequireWildcard(_parsers);
2671 +
2672 +var _config = require("./config");
2673 +
2674 +var _config2 = _interopRequireDefault(_config);
2675 +
2676 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2677 +
2678 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2679 +
2680 +exports.config = _config2.default;
2681 +function normaliseOptions() {
2682 + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2683 +
2684 + for (var key in options) {
2685 + var val = options[key];
2686 + if (val == null) continue;
2687 +
2688 + var opt = _config2.default[key];
2689 + if (opt && opt.alias) opt = _config2.default[opt.alias];
2690 + if (!opt) continue;
2691 +
2692 + var parser = parsers[opt.type];
2693 + if (parser) val = parser(val);
2694 +
2695 + options[key] = val;
2696 + }
2697 +
2698 + return options;
2699 +}
2700 +},{"./config":21,"./parsers":24}],23:[function(require,module,exports){
2701 +(function (process){
2702 +"use strict";
2703 +
2704 +exports.__esModule = true;
2705 +
2706 +var _objectWithoutProperties2 = require("babel-runtime/helpers/objectWithoutProperties");
2707 +
2708 +var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
2709 +
2710 +var _stringify = require("babel-runtime/core-js/json/stringify");
2711 +
2712 +var _stringify2 = _interopRequireDefault(_stringify);
2713 +
2714 +var _assign = require("babel-runtime/core-js/object/assign");
2715 +
2716 +var _assign2 = _interopRequireDefault(_assign);
2717 +
2718 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
2719 +
2720 +var _getIterator3 = _interopRequireDefault(_getIterator2);
2721 +
2722 +var _typeof2 = require("babel-runtime/helpers/typeof");
2723 +
2724 +var _typeof3 = _interopRequireDefault(_typeof2);
2725 +
2726 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
2727 +
2728 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
2729 +
2730 +var _node = require("../../../api/node");
2731 +
2732 +var context = _interopRequireWildcard(_node);
2733 +
2734 +var _plugin2 = require("../../plugin");
2735 +
2736 +var _plugin3 = _interopRequireDefault(_plugin2);
2737 +
2738 +var _babelMessages = require("babel-messages");
2739 +
2740 +var messages = _interopRequireWildcard(_babelMessages);
2741 +
2742 +var _index = require("./index");
2743 +
2744 +var _resolvePlugin = require("../../../helpers/resolve-plugin");
2745 +
2746 +var _resolvePlugin2 = _interopRequireDefault(_resolvePlugin);
2747 +
2748 +var _resolvePreset = require("../../../helpers/resolve-preset");
2749 +
2750 +var _resolvePreset2 = _interopRequireDefault(_resolvePreset);
2751 +
2752 +var _cloneDeepWith = require("lodash/cloneDeepWith");
2753 +
2754 +var _cloneDeepWith2 = _interopRequireDefault(_cloneDeepWith);
2755 +
2756 +var _clone = require("lodash/clone");
2757 +
2758 +var _clone2 = _interopRequireDefault(_clone);
2759 +
2760 +var _merge = require("../../../helpers/merge");
2761 +
2762 +var _merge2 = _interopRequireDefault(_merge);
2763 +
2764 +var _config2 = require("./config");
2765 +
2766 +var _config3 = _interopRequireDefault(_config2);
2767 +
2768 +var _removed = require("./removed");
2769 +
2770 +var _removed2 = _interopRequireDefault(_removed);
2771 +
2772 +var _buildConfigChain = require("./build-config-chain");
2773 +
2774 +var _buildConfigChain2 = _interopRequireDefault(_buildConfigChain);
2775 +
2776 +var _path = require("path");
2777 +
2778 +var _path2 = _interopRequireDefault(_path);
2779 +
2780 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2781 +
2782 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2783 +
2784 +var OptionManager = function () {
2785 + function OptionManager(log) {
2786 + (0, _classCallCheck3.default)(this, OptionManager);
2787 +
2788 + this.resolvedConfigs = [];
2789 + this.options = OptionManager.createBareOptions();
2790 + this.log = log;
2791 + }
2792 +
2793 + OptionManager.memoisePluginContainer = function memoisePluginContainer(fn, loc, i, alias) {
2794 + for (var _iterator = OptionManager.memoisedPlugins, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
2795 + var _ref;
2796 +
2797 + if (_isArray) {
2798 + if (_i >= _iterator.length) break;
2799 + _ref = _iterator[_i++];
2800 + } else {
2801 + _i = _iterator.next();
2802 + if (_i.done) break;
2803 + _ref = _i.value;
2804 + }
2805 +
2806 + var cache = _ref;
2807 +
2808 + if (cache.container === fn) return cache.plugin;
2809 + }
2810 +
2811 + var obj = void 0;
2812 +
2813 + if (typeof fn === "function") {
2814 + obj = fn(context);
2815 + } else {
2816 + obj = fn;
2817 + }
2818 +
2819 + if ((typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) === "object") {
2820 + var _plugin = new _plugin3.default(obj, alias);
2821 + OptionManager.memoisedPlugins.push({
2822 + container: fn,
2823 + plugin: _plugin
2824 + });
2825 + return _plugin;
2826 + } else {
2827 + throw new TypeError(messages.get("pluginNotObject", loc, i, typeof obj === "undefined" ? "undefined" : (0, _typeof3.default)(obj)) + loc + i);
2828 + }
2829 + };
2830 +
2831 + OptionManager.createBareOptions = function createBareOptions() {
2832 + var opts = {};
2833 +
2834 + for (var _key in _config3.default) {
2835 + var opt = _config3.default[_key];
2836 + opts[_key] = (0, _clone2.default)(opt.default);
2837 + }
2838 +
2839 + return opts;
2840 + };
2841 +
2842 + OptionManager.normalisePlugin = function normalisePlugin(plugin, loc, i, alias) {
2843 + plugin = plugin.__esModule ? plugin.default : plugin;
2844 +
2845 + if (!(plugin instanceof _plugin3.default)) {
2846 + if (typeof plugin === "function" || (typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)) === "object") {
2847 + plugin = OptionManager.memoisePluginContainer(plugin, loc, i, alias);
2848 + } else {
2849 + throw new TypeError(messages.get("pluginNotFunction", loc, i, typeof plugin === "undefined" ? "undefined" : (0, _typeof3.default)(plugin)));
2850 + }
2851 + }
2852 +
2853 + plugin.init(loc, i);
2854 +
2855 + return plugin;
2856 + };
2857 +
2858 + OptionManager.normalisePlugins = function normalisePlugins(loc, dirname, plugins) {
2859 + return plugins.map(function (val, i) {
2860 + var plugin = void 0,
2861 + options = void 0;
2862 +
2863 + if (!val) {
2864 + throw new TypeError("Falsy value found in plugins");
2865 + }
2866 +
2867 + if (Array.isArray(val)) {
2868 + plugin = val[0];
2869 + options = val[1];
2870 + } else {
2871 + plugin = val;
2872 + }
2873 +
2874 + var alias = typeof plugin === "string" ? plugin : loc + "$" + i;
2875 +
2876 + if (typeof plugin === "string") {
2877 + var pluginLoc = (0, _resolvePlugin2.default)(plugin, dirname);
2878 + if (pluginLoc) {
2879 + plugin = require(pluginLoc);
2880 + } else {
2881 + throw new ReferenceError(messages.get("pluginUnknown", plugin, loc, i, dirname));
2882 + }
2883 + }
2884 +
2885 + plugin = OptionManager.normalisePlugin(plugin, loc, i, alias);
2886 +
2887 + return [plugin, options];
2888 + });
2889 + };
2890 +
2891 + OptionManager.prototype.mergeOptions = function mergeOptions(_ref2) {
2892 + var _this = this;
2893 +
2894 + var rawOpts = _ref2.options,
2895 + extendingOpts = _ref2.extending,
2896 + alias = _ref2.alias,
2897 + loc = _ref2.loc,
2898 + dirname = _ref2.dirname;
2899 +
2900 + alias = alias || "foreign";
2901 + if (!rawOpts) return;
2902 +
2903 + if ((typeof rawOpts === "undefined" ? "undefined" : (0, _typeof3.default)(rawOpts)) !== "object" || Array.isArray(rawOpts)) {
2904 + this.log.error("Invalid options type for " + alias, TypeError);
2905 + }
2906 +
2907 + var opts = (0, _cloneDeepWith2.default)(rawOpts, function (val) {
2908 + if (val instanceof _plugin3.default) {
2909 + return val;
2910 + }
2911 + });
2912 +
2913 + dirname = dirname || process.cwd();
2914 + loc = loc || alias;
2915 +
2916 + for (var _key2 in opts) {
2917 + var option = _config3.default[_key2];
2918 +
2919 + if (!option && this.log) {
2920 + if (_removed2.default[_key2]) {
2921 + this.log.error("Using removed Babel 5 option: " + alias + "." + _key2 + " - " + _removed2.default[_key2].message, ReferenceError);
2922 + } else {
2923 + var unknownOptErr = "Unknown option: " + alias + "." + _key2 + ". Check out http://babeljs.io/docs/usage/options/ for more information about options.";
2924 + var presetConfigErr = "A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:\n\nInvalid:\n `{ presets: [{option: value}] }`\nValid:\n `{ presets: [['presetName', {option: value}]] }`\n\nFor more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.";
2925 +
2926 +
2927 + this.log.error(unknownOptErr + "\n\n" + presetConfigErr, ReferenceError);
2928 + }
2929 + }
2930 + }
2931 +
2932 + (0, _index.normaliseOptions)(opts);
2933 +
2934 + if (opts.plugins) {
2935 + opts.plugins = OptionManager.normalisePlugins(loc, dirname, opts.plugins);
2936 + }
2937 +
2938 + if (opts.presets) {
2939 + if (opts.passPerPreset) {
2940 + opts.presets = this.resolvePresets(opts.presets, dirname, function (preset, presetLoc) {
2941 + _this.mergeOptions({
2942 + options: preset,
2943 + extending: preset,
2944 + alias: presetLoc,
2945 + loc: presetLoc,
2946 + dirname: dirname
2947 + });
2948 + });
2949 + } else {
2950 + this.mergePresets(opts.presets, dirname);
2951 + delete opts.presets;
2952 + }
2953 + }
2954 +
2955 + if (rawOpts === extendingOpts) {
2956 + (0, _assign2.default)(extendingOpts, opts);
2957 + } else {
2958 + (0, _merge2.default)(extendingOpts || this.options, opts);
2959 + }
2960 + };
2961 +
2962 + OptionManager.prototype.mergePresets = function mergePresets(presets, dirname) {
2963 + var _this2 = this;
2964 +
2965 + this.resolvePresets(presets, dirname, function (presetOpts, presetLoc) {
2966 + _this2.mergeOptions({
2967 + options: presetOpts,
2968 + alias: presetLoc,
2969 + loc: presetLoc,
2970 + dirname: _path2.default.dirname(presetLoc || "")
2971 + });
2972 + });
2973 + };
2974 +
2975 + OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) {
2976 + return presets.map(function (val) {
2977 + var options = void 0;
2978 + if (Array.isArray(val)) {
2979 + if (val.length > 2) {
2980 + throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset.");
2981 + }
2982 +
2983 + var _val = val;
2984 + val = _val[0];
2985 + options = _val[1];
2986 + }
2987 +
2988 + var presetLoc = void 0;
2989 + try {
2990 + if (typeof val === "string") {
2991 + presetLoc = (0, _resolvePreset2.default)(val, dirname);
2992 +
2993 + if (!presetLoc) {
2994 + throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname));
2995 + }
2996 +
2997 + val = require(presetLoc);
2998 + }
2999 +
3000 + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.__esModule) {
3001 + if (val.default) {
3002 + val = val.default;
3003 + } else {
3004 + var _val2 = val,
3005 + __esModule = _val2.__esModule,
3006 + rest = (0, _objectWithoutProperties3.default)(_val2, ["__esModule"]);
3007 +
3008 + val = rest;
3009 + }
3010 + }
3011 +
3012 + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object" && val.buildPreset) val = val.buildPreset;
3013 +
3014 + if (typeof val !== "function" && options !== undefined) {
3015 + throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options.");
3016 + }
3017 +
3018 + if (typeof val === "function") val = val(context, options, { dirname: dirname });
3019 +
3020 + if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") {
3021 + throw new Error("Unsupported preset format: " + val + ".");
3022 + }
3023 +
3024 + onResolve && onResolve(val, presetLoc);
3025 + } catch (e) {
3026 + if (presetLoc) {
3027 + e.message += " (While processing preset: " + (0, _stringify2.default)(presetLoc) + ")";
3028 + }
3029 + throw e;
3030 + }
3031 + return val;
3032 + });
3033 + };
3034 +
3035 + OptionManager.prototype.normaliseOptions = function normaliseOptions() {
3036 + var opts = this.options;
3037 +
3038 + for (var _key3 in _config3.default) {
3039 + var option = _config3.default[_key3];
3040 + var val = opts[_key3];
3041 +
3042 + if (!val && option.optional) continue;
3043 +
3044 + if (option.alias) {
3045 + opts[option.alias] = opts[option.alias] || val;
3046 + } else {
3047 + opts[_key3] = val;
3048 + }
3049 + }
3050 + };
3051 +
3052 + OptionManager.prototype.init = function init() {
3053 + var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3054 +
3055 + for (var _iterator2 = (0, _buildConfigChain2.default)(opts, this.log), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
3056 + var _ref3;
3057 +
3058 + if (_isArray2) {
3059 + if (_i2 >= _iterator2.length) break;
3060 + _ref3 = _iterator2[_i2++];
3061 + } else {
3062 + _i2 = _iterator2.next();
3063 + if (_i2.done) break;
3064 + _ref3 = _i2.value;
3065 + }
3066 +
3067 + var _config = _ref3;
3068 +
3069 + this.mergeOptions(_config);
3070 + }
3071 +
3072 + this.normaliseOptions(opts);
3073 +
3074 + return this.options;
3075 + };
3076 +
3077 + return OptionManager;
3078 +}();
3079 +
3080 +exports.default = OptionManager;
3081 +
3082 +
3083 +OptionManager.memoisedPlugins = [];
3084 +module.exports = exports["default"];
3085 +}).call(this,require('_process'))
3086 +},{"../../../api/node":6,"../../../helpers/merge":9,"../../../helpers/resolve-plugin":12,"../../../helpers/resolve-preset":13,"../../plugin":30,"./build-config-chain":20,"./config":21,"./index":22,"./removed":25,"_process":525,"babel-messages":61,"babel-runtime/core-js/get-iterator":95,"babel-runtime/core-js/json/stringify":96,"babel-runtime/core-js/object/assign":99,"babel-runtime/helpers/classCallCheck":109,"babel-runtime/helpers/objectWithoutProperties":111,"babel-runtime/helpers/typeof":113,"lodash/clone":466,"lodash/cloneDeepWith":468,"path":522}],24:[function(require,module,exports){
3087 +"use strict";
3088 +
3089 +exports.__esModule = true;
3090 +exports.filename = undefined;
3091 +exports.boolean = boolean;
3092 +exports.booleanString = booleanString;
3093 +exports.list = list;
3094 +
3095 +var _slash = require("slash");
3096 +
3097 +var _slash2 = _interopRequireDefault(_slash);
3098 +
3099 +var _util = require("../../../util");
3100 +
3101 +var util = _interopRequireWildcard(_util);
3102 +
3103 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
3104 +
3105 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3106 +
3107 +var filename = exports.filename = _slash2.default;
3108 +
3109 +function boolean(val) {
3110 + return !!val;
3111 +}
3112 +
3113 +function booleanString(val) {
3114 + return util.booleanify(val);
3115 +}
3116 +
3117 +function list(val) {
3118 + return util.list(val);
3119 +}
3120 +},{"../../../util":31,"slash":541}],25:[function(require,module,exports){
3121 +"use strict";
3122 +
3123 +module.exports = {
3124 + "auxiliaryComment": {
3125 + "message": "Use `auxiliaryCommentBefore` or `auxiliaryCommentAfter`"
3126 + },
3127 + "blacklist": {
3128 + "message": "Put the specific transforms you want in the `plugins` option"
3129 + },
3130 + "breakConfig": {
3131 + "message": "This is not a necessary option in Babel 6"
3132 + },
3133 + "experimental": {
3134 + "message": "Put the specific transforms you want in the `plugins` option"
3135 + },
3136 + "externalHelpers": {
3137 + "message": "Use the `external-helpers` plugin instead. Check out http://babeljs.io/docs/plugins/external-helpers/"
3138 + },
3139 + "extra": {
3140 + "message": ""
3141 + },
3142 + "jsxPragma": {
3143 + "message": "use the `pragma` option in the `react-jsx` plugin . Check out http://babeljs.io/docs/plugins/transform-react-jsx/"
3144 + },
3145 +
3146 + "loose": {
3147 + "message": "Specify the `loose` option for the relevant plugin you are using or use a preset that sets the option."
3148 + },
3149 + "metadataUsedHelpers": {
3150 + "message": "Not required anymore as this is enabled by default"
3151 + },
3152 + "modules": {
3153 + "message": "Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules"
3154 + },
3155 + "nonStandard": {
3156 + "message": "Use the `react-jsx` and `flow-strip-types` plugins to support JSX and Flow. Also check out the react preset http://babeljs.io/docs/plugins/preset-react/"
3157 + },
3158 + "optional": {
3159 + "message": "Put the specific transforms you want in the `plugins` option"
3160 + },
3161 + "sourceMapName": {
3162 + "message": "Use the `sourceMapTarget` option"
3163 + },
3164 + "stage": {
3165 + "message": "Check out the corresponding stage-x presets http://babeljs.io/docs/plugins/#presets"
3166 + },
3167 + "whitelist": {
3168 + "message": "Put the specific transforms you want in the `plugins` option"
3169 + }
3170 +};
3171 +},{}],26:[function(require,module,exports){
3172 +"use strict";
3173 +
3174 +exports.__esModule = true;
3175 +
3176 +var _plugin = require("../plugin");
3177 +
3178 +var _plugin2 = _interopRequireDefault(_plugin);
3179 +
3180 +var _sortBy = require("lodash/sortBy");
3181 +
3182 +var _sortBy2 = _interopRequireDefault(_sortBy);
3183 +
3184 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3185 +
3186 +exports.default = new _plugin2.default({
3187 +
3188 + name: "internal.blockHoist",
3189 +
3190 + visitor: {
3191 + Block: {
3192 + exit: function exit(_ref) {
3193 + var node = _ref.node;
3194 +
3195 + var hasChange = false;
3196 + for (var i = 0; i < node.body.length; i++) {
3197 + var bodyNode = node.body[i];
3198 + if (bodyNode && bodyNode._blockHoist != null) {
3199 + hasChange = true;
3200 + break;
3201 + }
3202 + }
3203 + if (!hasChange) return;
3204 +
3205 + node.body = (0, _sortBy2.default)(node.body, function (bodyNode) {
3206 + var priority = bodyNode && bodyNode._blockHoist;
3207 + if (priority == null) priority = 1;
3208 + if (priority === true) priority = 2;
3209 +
3210 + return -1 * priority;
3211 + });
3212 + }
3213 + }
3214 + }
3215 +});
3216 +module.exports = exports["default"];
3217 +},{"../plugin":30,"lodash/sortBy":508}],27:[function(require,module,exports){
3218 +"use strict";
3219 +
3220 +exports.__esModule = true;
3221 +
3222 +var _symbol = require("babel-runtime/core-js/symbol");
3223 +
3224 +var _symbol2 = _interopRequireDefault(_symbol);
3225 +
3226 +var _plugin = require("../plugin");
3227 +
3228 +var _plugin2 = _interopRequireDefault(_plugin);
3229 +
3230 +var _babelTypes = require("babel-types");
3231 +
3232 +var t = _interopRequireWildcard(_babelTypes);
3233 +
3234 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
3235 +
3236 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3237 +
3238 +var SUPER_THIS_BOUND = (0, _symbol2.default)("super this bound");
3239 +
3240 +var superVisitor = {
3241 + CallExpression: function CallExpression(path) {
3242 + if (!path.get("callee").isSuper()) return;
3243 +
3244 + var node = path.node;
3245 +
3246 + if (node[SUPER_THIS_BOUND]) return;
3247 + node[SUPER_THIS_BOUND] = true;
3248 +
3249 + path.replaceWith(t.assignmentExpression("=", this.id, node));
3250 + }
3251 +};
3252 +
3253 +exports.default = new _plugin2.default({
3254 + name: "internal.shadowFunctions",
3255 +
3256 + visitor: {
3257 + ThisExpression: function ThisExpression(path) {
3258 + remap(path, "this");
3259 + },
3260 + ReferencedIdentifier: function ReferencedIdentifier(path) {
3261 + if (path.node.name === "arguments") {
3262 + remap(path, "arguments");
3263 + }
3264 + }
3265 + }
3266 +});
3267 +
3268 +
3269 +function shouldShadow(path, shadowPath) {
3270 + if (path.is("_forceShadow")) {
3271 + return true;
3272 + } else {
3273 + return shadowPath;
3274 + }
3275 +}
3276 +
3277 +function remap(path, key) {
3278 + var shadowPath = path.inShadow(key);
3279 + if (!shouldShadow(path, shadowPath)) return;
3280 +
3281 + var shadowFunction = path.node._shadowedFunctionLiteral;
3282 +
3283 + var currentFunction = void 0;
3284 + var passedShadowFunction = false;
3285 +
3286 + var fnPath = path.find(function (innerPath) {
3287 + if (innerPath.parentPath && innerPath.parentPath.isClassProperty() && innerPath.key === "value") {
3288 + return true;
3289 + }
3290 + if (path === innerPath) return false;
3291 + if (innerPath.isProgram() || innerPath.isFunction()) {
3292 + currentFunction = currentFunction || innerPath;
3293 + }
3294 +
3295 + if (innerPath.isProgram()) {
3296 + passedShadowFunction = true;
3297 +
3298 + return true;
3299 + } else if (innerPath.isFunction() && !innerPath.isArrowFunctionExpression()) {
3300 + if (shadowFunction) {
3301 + if (innerPath === shadowFunction || innerPath.node === shadowFunction.node) return true;
3302 + } else {
3303 + if (!innerPath.is("shadow")) return true;
3304 + }
3305 +
3306 + passedShadowFunction = true;
3307 + return false;
3308 + }
3309 +
3310 + return false;
3311 + });
3312 +
3313 + if (shadowFunction && fnPath.isProgram() && !shadowFunction.isProgram()) {
3314 + fnPath = path.findParent(function (p) {
3315 + return p.isProgram() || p.isFunction();
3316 + });
3317 + }
3318 +
3319 + if (fnPath === currentFunction) return;
3320 +
3321 + if (!passedShadowFunction) return;
3322 +
3323 + var cached = fnPath.getData(key);
3324 + if (cached) return path.replaceWith(cached);
3325 +
3326 + var id = path.scope.generateUidIdentifier(key);
3327 +
3328 + fnPath.setData(key, id);
3329 +
3330 + var classPath = fnPath.findParent(function (p) {
3331 + return p.isClass();
3332 + });
3333 + var hasSuperClass = !!(classPath && classPath.node && classPath.node.superClass);
3334 +
3335 + if (key === "this" && fnPath.isMethod({ kind: "constructor" }) && hasSuperClass) {
3336 + fnPath.scope.push({ id: id });
3337 +
3338 + fnPath.traverse(superVisitor, { id: id });
3339 + } else {
3340 + var init = key === "this" ? t.thisExpression() : t.identifier(key);
3341 +
3342 + if (shadowFunction) init._shadowedFunctionLiteral = shadowFunction;
3343 +
3344 + fnPath.scope.push({ id: id, init: init });
3345 + }
3346 +
3347 + return path.replaceWith(id);
3348 +}
3349 +module.exports = exports["default"];
3350 +},{"../plugin":30,"babel-runtime/core-js/symbol":104,"babel-types":151}],28:[function(require,module,exports){
3351 +"use strict";
3352 +
3353 +exports.__esModule = true;
3354 +
3355 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3356 +
3357 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3358 +
3359 +var _normalizeAst = require("../helpers/normalize-ast");
3360 +
3361 +var _normalizeAst2 = _interopRequireDefault(_normalizeAst);
3362 +
3363 +var _plugin = require("./plugin");
3364 +
3365 +var _plugin2 = _interopRequireDefault(_plugin);
3366 +
3367 +var _file = require("./file");
3368 +
3369 +var _file2 = _interopRequireDefault(_file);
3370 +
3371 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3372 +
3373 +var Pipeline = function () {
3374 + function Pipeline() {
3375 + (0, _classCallCheck3.default)(this, Pipeline);
3376 + }
3377 +
3378 + Pipeline.prototype.lint = function lint(code) {
3379 + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3380 +
3381 + opts.code = false;
3382 + opts.mode = "lint";
3383 + return this.transform(code, opts);
3384 + };
3385 +
3386 + Pipeline.prototype.pretransform = function pretransform(code, opts) {
3387 + var file = new _file2.default(opts, this);
3388 + return file.wrap(code, function () {
3389 + file.addCode(code);
3390 + file.parseCode(code);
3391 + return file;
3392 + });
3393 + };
3394 +
3395 + Pipeline.prototype.transform = function transform(code, opts) {
3396 + var file = new _file2.default(opts, this);
3397 + return file.wrap(code, function () {
3398 + file.addCode(code);
3399 + file.parseCode(code);
3400 + return file.transform();
3401 + });
3402 + };
3403 +
3404 + Pipeline.prototype.analyse = function analyse(code) {
3405 + var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3406 + var visitor = arguments[2];
3407 +
3408 + opts.code = false;
3409 + if (visitor) {
3410 + opts.plugins = opts.plugins || [];
3411 + opts.plugins.push(new _plugin2.default({ visitor: visitor }));
3412 + }
3413 + return this.transform(code, opts).metadata;
3414 + };
3415 +
3416 + Pipeline.prototype.transformFromAst = function transformFromAst(ast, code, opts) {
3417 + ast = (0, _normalizeAst2.default)(ast);
3418 +
3419 + var file = new _file2.default(opts, this);
3420 + return file.wrap(code, function () {
3421 + file.addCode(code);
3422 + file.addAst(ast);
3423 + return file.transform();
3424 + });
3425 + };
3426 +
3427 + return Pipeline;
3428 +}();
3429 +
3430 +exports.default = Pipeline;
3431 +module.exports = exports["default"];
3432 +},{"../helpers/normalize-ast":10,"./file":17,"./plugin":30,"babel-runtime/helpers/classCallCheck":109}],29:[function(require,module,exports){
3433 +"use strict";
3434 +
3435 +exports.__esModule = true;
3436 +
3437 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3438 +
3439 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3440 +
3441 +var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
3442 +
3443 +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
3444 +
3445 +var _inherits2 = require("babel-runtime/helpers/inherits");
3446 +
3447 +var _inherits3 = _interopRequireDefault(_inherits2);
3448 +
3449 +var _store = require("../store");
3450 +
3451 +var _store2 = _interopRequireDefault(_store);
3452 +
3453 +var _file5 = require("./file");
3454 +
3455 +var _file6 = _interopRequireDefault(_file5);
3456 +
3457 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3458 +
3459 +var PluginPass = function (_Store) {
3460 + (0, _inherits3.default)(PluginPass, _Store);
3461 +
3462 + function PluginPass(file, plugin) {
3463 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3464 + (0, _classCallCheck3.default)(this, PluginPass);
3465 +
3466 + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
3467 +
3468 + _this.plugin = plugin;
3469 + _this.key = plugin.key;
3470 + _this.file = file;
3471 + _this.opts = options;
3472 + return _this;
3473 + }
3474 +
3475 + PluginPass.prototype.addHelper = function addHelper() {
3476 + var _file;
3477 +
3478 + return (_file = this.file).addHelper.apply(_file, arguments);
3479 + };
3480 +
3481 + PluginPass.prototype.addImport = function addImport() {
3482 + var _file2;
3483 +
3484 + return (_file2 = this.file).addImport.apply(_file2, arguments);
3485 + };
3486 +
3487 + PluginPass.prototype.getModuleName = function getModuleName() {
3488 + var _file3;
3489 +
3490 + return (_file3 = this.file).getModuleName.apply(_file3, arguments);
3491 + };
3492 +
3493 + PluginPass.prototype.buildCodeFrameError = function buildCodeFrameError() {
3494 + var _file4;
3495 +
3496 + return (_file4 = this.file).buildCodeFrameError.apply(_file4, arguments);
3497 + };
3498 +
3499 + return PluginPass;
3500 +}(_store2.default);
3501 +
3502 +exports.default = PluginPass;
3503 +module.exports = exports["default"];
3504 +},{"../store":15,"./file":17,"babel-runtime/helpers/classCallCheck":109,"babel-runtime/helpers/inherits":110,"babel-runtime/helpers/possibleConstructorReturn":112}],30:[function(require,module,exports){
3505 +"use strict";
3506 +
3507 +exports.__esModule = true;
3508 +
3509 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
3510 +
3511 +var _getIterator3 = _interopRequireDefault(_getIterator2);
3512 +
3513 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3514 +
3515 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3516 +
3517 +var _possibleConstructorReturn2 = require("babel-runtime/helpers/possibleConstructorReturn");
3518 +
3519 +var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
3520 +
3521 +var _inherits2 = require("babel-runtime/helpers/inherits");
3522 +
3523 +var _inherits3 = _interopRequireDefault(_inherits2);
3524 +
3525 +var _optionManager = require("./file/options/option-manager");
3526 +
3527 +var _optionManager2 = _interopRequireDefault(_optionManager);
3528 +
3529 +var _babelMessages = require("babel-messages");
3530 +
3531 +var messages = _interopRequireWildcard(_babelMessages);
3532 +
3533 +var _store = require("../store");
3534 +
3535 +var _store2 = _interopRequireDefault(_store);
3536 +
3537 +var _babelTraverse = require("babel-traverse");
3538 +
3539 +var _babelTraverse2 = _interopRequireDefault(_babelTraverse);
3540 +
3541 +var _assign = require("lodash/assign");
3542 +
3543 +var _assign2 = _interopRequireDefault(_assign);
3544 +
3545 +var _clone = require("lodash/clone");
3546 +
3547 +var _clone2 = _interopRequireDefault(_clone);
3548 +
3549 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
3550 +
3551 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3552 +
3553 +var GLOBAL_VISITOR_PROPS = ["enter", "exit"];
3554 +
3555 +var Plugin = function (_Store) {
3556 + (0, _inherits3.default)(Plugin, _Store);
3557 +
3558 + function Plugin(plugin, key) {
3559 + (0, _classCallCheck3.default)(this, Plugin);
3560 +
3561 + var _this = (0, _possibleConstructorReturn3.default)(this, _Store.call(this));
3562 +
3563 + _this.initialized = false;
3564 + _this.raw = (0, _assign2.default)({}, plugin);
3565 + _this.key = _this.take("name") || key;
3566 +
3567 + _this.manipulateOptions = _this.take("manipulateOptions");
3568 + _this.post = _this.take("post");
3569 + _this.pre = _this.take("pre");
3570 + _this.visitor = _this.normaliseVisitor((0, _clone2.default)(_this.take("visitor")) || {});
3571 + return _this;
3572 + }
3573 +
3574 + Plugin.prototype.take = function take(key) {
3575 + var val = this.raw[key];
3576 + delete this.raw[key];
3577 + return val;
3578 + };
3579 +
3580 + Plugin.prototype.chain = function chain(target, key) {
3581 + if (!target[key]) return this[key];
3582 + if (!this[key]) return target[key];
3583 +
3584 + var fns = [target[key], this[key]];
3585 +
3586 + return function () {
3587 + var val = void 0;
3588 +
3589 + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
3590 + args[_key] = arguments[_key];
3591 + }
3592 +
3593 + for (var _iterator = fns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
3594 + var _ref;
3595 +
3596 + if (_isArray) {
3597 + if (_i >= _iterator.length) break;
3598 + _ref = _iterator[_i++];
3599 + } else {
3600 + _i = _iterator.next();
3601 + if (_i.done) break;
3602 + _ref = _i.value;
3603 + }
3604 +
3605 + var fn = _ref;
3606 +
3607 + if (fn) {
3608 + var ret = fn.apply(this, args);
3609 + if (ret != null) val = ret;
3610 + }
3611 + }
3612 + return val;
3613 + };
3614 + };
3615 +
3616 + Plugin.prototype.maybeInherit = function maybeInherit(loc) {
3617 + var inherits = this.take("inherits");
3618 + if (!inherits) return;
3619 +
3620 + inherits = _optionManager2.default.normalisePlugin(inherits, loc, "inherits");
3621 +
3622 + this.manipulateOptions = this.chain(inherits, "manipulateOptions");
3623 + this.post = this.chain(inherits, "post");
3624 + this.pre = this.chain(inherits, "pre");
3625 + this.visitor = _babelTraverse2.default.visitors.merge([inherits.visitor, this.visitor]);
3626 + };
3627 +
3628 + Plugin.prototype.init = function init(loc, i) {
3629 + if (this.initialized) return;
3630 + this.initialized = true;
3631 +
3632 + this.maybeInherit(loc);
3633 +
3634 + for (var key in this.raw) {
3635 + throw new Error(messages.get("pluginInvalidProperty", loc, i, key));
3636 + }
3637 + };
3638 +
3639 + Plugin.prototype.normaliseVisitor = function normaliseVisitor(visitor) {
3640 + for (var _iterator2 = GLOBAL_VISITOR_PROPS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
3641 + var _ref2;
3642 +
3643 + if (_isArray2) {
3644 + if (_i2 >= _iterator2.length) break;
3645 + _ref2 = _iterator2[_i2++];
3646 + } else {
3647 + _i2 = _iterator2.next();
3648 + if (_i2.done) break;
3649 + _ref2 = _i2.value;
3650 + }
3651 +
3652 + var key = _ref2;
3653 +
3654 + if (visitor[key]) {
3655 + throw new Error("Plugins aren't allowed to specify catch-all enter/exit handlers. " + "Please target individual nodes.");
3656 + }
3657 + }
3658 +
3659 + _babelTraverse2.default.explode(visitor);
3660 + return visitor;
3661 + };
3662 +
3663 + return Plugin;
3664 +}(_store2.default);
3665 +
3666 +exports.default = Plugin;
3667 +module.exports = exports["default"];
3668 +},{"../store":15,"./file/options/option-manager":23,"babel-messages":61,"babel-runtime/core-js/get-iterator":95,"babel-runtime/helpers/classCallCheck":109,"babel-runtime/helpers/inherits":110,"babel-runtime/helpers/possibleConstructorReturn":112,"babel-traverse":118,"lodash/assign":463,"lodash/clone":466}],31:[function(require,module,exports){
3669 +"use strict";
3670 +
3671 +exports.__esModule = true;
3672 +exports.inspect = exports.inherits = undefined;
3673 +
3674 +var _getIterator2 = require("babel-runtime/core-js/get-iterator");
3675 +
3676 +var _getIterator3 = _interopRequireDefault(_getIterator2);
3677 +
3678 +var _util = require("util");
3679 +
3680 +Object.defineProperty(exports, "inherits", {
3681 + enumerable: true,
3682 + get: function get() {
3683 + return _util.inherits;
3684 + }
3685 +});
3686 +Object.defineProperty(exports, "inspect", {
3687 + enumerable: true,
3688 + get: function get() {
3689 + return _util.inspect;
3690 + }
3691 +});
3692 +exports.canCompile = canCompile;
3693 +exports.list = list;
3694 +exports.regexify = regexify;
3695 +exports.arrayify = arrayify;
3696 +exports.booleanify = booleanify;
3697 +exports.shouldIgnore = shouldIgnore;
3698 +
3699 +var _escapeRegExp = require("lodash/escapeRegExp");
3700 +
3701 +var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp);
3702 +
3703 +var _startsWith = require("lodash/startsWith");
3704 +
3705 +var _startsWith2 = _interopRequireDefault(_startsWith);
3706 +
3707 +var _minimatch = require("minimatch");
3708 +
3709 +var _minimatch2 = _interopRequireDefault(_minimatch);
3710 +
3711 +var _includes = require("lodash/includes");
3712 +
3713 +var _includes2 = _interopRequireDefault(_includes);
3714 +
3715 +var _isRegExp = require("lodash/isRegExp");
3716 +
3717 +var _isRegExp2 = _interopRequireDefault(_isRegExp);
3718 +
3719 +var _path = require("path");
3720 +
3721 +var _path2 = _interopRequireDefault(_path);
3722 +
3723 +var _slash = require("slash");
3724 +
3725 +var _slash2 = _interopRequireDefault(_slash);
3726 +
3727 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3728 +
3729 +function canCompile(filename, altExts) {
3730 + var exts = altExts || canCompile.EXTENSIONS;
3731 + var ext = _path2.default.extname(filename);
3732 + return (0, _includes2.default)(exts, ext);
3733 +}
3734 +
3735 +canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
3736 +
3737 +function list(val) {
3738 + if (!val) {
3739 + return [];
3740 + } else if (Array.isArray(val)) {
3741 + return val;
3742 + } else if (typeof val === "string") {
3743 + return val.split(",");
3744 + } else {
3745 + return [val];
3746 + }
3747 +}
3748 +
3749 +function regexify(val) {
3750 + if (!val) {
3751 + return new RegExp(/.^/);
3752 + }
3753 +
3754 + if (Array.isArray(val)) {
3755 + val = new RegExp(val.map(_escapeRegExp2.default).join("|"), "i");
3756 + }
3757 +
3758 + if (typeof val === "string") {
3759 + val = (0, _slash2.default)(val);
3760 +
3761 + if ((0, _startsWith2.default)(val, "./") || (0, _startsWith2.default)(val, "*/")) val = val.slice(2);
3762 + if ((0, _startsWith2.default)(val, "**/")) val = val.slice(3);
3763 +
3764 + var regex = _minimatch2.default.makeRe(val, { nocase: true });
3765 + return new RegExp(regex.source.slice(1, -1), "i");
3766 + }
3767 +
3768 + if ((0, _isRegExp2.default)(val)) {
3769 + return val;
3770 + }
3771 +
3772 + throw new TypeError("illegal type for regexify");
3773 +}
3774 +
3775 +function arrayify(val, mapFn) {
3776 + if (!val) return [];
3777 + if (typeof val === "boolean") return arrayify([val], mapFn);
3778 + if (typeof val === "string") return arrayify(list(val), mapFn);
3779 +
3780 + if (Array.isArray(val)) {
3781 + if (mapFn) val = val.map(mapFn);
3782 + return val;
3783 + }
3784 +
3785 + return [val];
3786 +}
3787 +
3788 +function booleanify(val) {
3789 + if (val === "true" || val == 1) {
3790 + return true;
3791 + }
3792 +
3793 + if (val === "false" || val == 0 || !val) {
3794 + return false;
3795 + }
3796 +
3797 + return val;
3798 +}
3799 +
3800 +function shouldIgnore(filename) {
3801 + var ignore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3802 + var only = arguments[2];
3803 +
3804 + filename = filename.replace(/\\/g, "/");
3805 +
3806 + if (only) {
3807 + for (var _iterator = only, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
3808 + var _ref;
3809 +
3810 + if (_isArray) {
3811 + if (_i >= _iterator.length) break;
3812 + _ref = _iterator[_i++];
3813 + } else {
3814 + _i = _iterator.next();
3815 + if (_i.done) break;
3816 + _ref = _i.value;
3817 + }
3818 +
3819 + var pattern = _ref;
3820 +
3821 + if (_shouldIgnore(pattern, filename)) return false;
3822 + }
3823 + return true;
3824 + } else if (ignore.length) {
3825 + for (var _iterator2 = ignore, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
3826 + var _ref2;
3827 +
3828 + if (_isArray2) {
3829 + if (_i2 >= _iterator2.length) break;
3830 + _ref2 = _iterator2[_i2++];
3831 + } else {
3832 + _i2 = _iterator2.next();
3833 + if (_i2.done) break;
3834 + _ref2 = _i2.value;
3835 + }
3836 +
3837 + var _pattern = _ref2;
3838 +
3839 + if (_shouldIgnore(_pattern, filename)) return true;
3840 + }
3841 + }
3842 +
3843 + return false;
3844 +}
3845 +
3846 +function _shouldIgnore(pattern, filename) {
3847 + if (typeof pattern === "function") {
3848 + return pattern(filename);
3849 + } else {
3850 + return pattern.test(filename);
3851 + }
3852 +}
3853 +},{"babel-runtime/core-js/get-iterator":95,"lodash/escapeRegExp":472,"lodash/includes":482,"lodash/isRegExp":494,"lodash/startsWith":509,"minimatch":519,"path":522,"slash":541,"util":560}],32:[function(require,module,exports){
3854 +module.exports={
3855 + "_from": "babel-core@^6.22.1",
3856 + "_id": "babel-core@6.26.0",
3857 + "_inBundle": false,
3858 + "_integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=",
3859 + "_location": "/babel-core",
3860 + "_phantomChildren": {},
3861 + "_requested": {
3862 + "type": "range",
3863 + "registry": true,
3864 + "raw": "babel-core@^6.22.1",
3865 + "name": "babel-core",
3866 + "escapedName": "babel-core",
3867 + "rawSpec": "^6.22.1",
3868 + "saveSpec": null,
3869 + "fetchSpec": "^6.22.1"
3870 + },
3871 + "_requiredBy": [
3872 + "#DEV:/",
3873 + "/babel-register",
3874 + "/babelify",
3875 + "/karma-babel-preprocessor"
3876 + ],
3877 + "_resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz",
3878 + "_shasum": "af32f78b31a6fcef119c87b0fd8d9753f03a0bb8",
3879 + "_spec": "babel-core@^6.22.1",
3880 + "_where": "/Users/juanjodiaz/Documents/code/OSS libs/noVNC",
3881 + "author": {
3882 + "name": "Sebastian McKenzie",
3883 + "email": "sebmck@gmail.com"
3884 + },
3885 + "bundleDependencies": false,
3886 + "dependencies": {
3887 + "babel-code-frame": "^6.26.0",
3888 + "babel-generator": "^6.26.0",
3889 + "babel-helpers": "^6.24.1",
3890 + "babel-messages": "^6.23.0",
3891 + "babel-register": "^6.26.0",
3892 + "babel-runtime": "^6.26.0",
3893 + "babel-template": "^6.26.0",
3894 + "babel-traverse": "^6.26.0",
3895 + "babel-types": "^6.26.0",
3896 + "babylon": "^6.18.0",
3897 + "convert-source-map": "^1.5.0",
3898 + "debug": "^2.6.8",
3899 + "json5": "^0.5.1",
3900 + "lodash": "^4.17.4",
3901 + "minimatch": "^3.0.4",
3902 + "path-is-absolute": "^1.0.1",
3903 + "private": "^0.1.7",
3904 + "slash": "^1.0.0",
3905 + "source-map": "^0.5.6"
3906 + },
3907 + "deprecated": false,
3908 + "description": "Babel compiler core.",
3909 + "devDependencies": {
3910 + "babel-helper-fixtures": "^6.26.0",
3911 + "babel-helper-transform-fixture-test-runner": "^6.26.0",
3912 + "babel-polyfill": "^6.26.0"
3913 + },
3914 + "homepage": "https://babeljs.io/",
3915 + "keywords": [
3916 + "6to5",
3917 + "babel",
3918 + "classes",
3919 + "const",
3920 + "es6",
3921 + "harmony",
3922 + "let",
3923 + "modules",
3924 + "transpile",
3925 + "transpiler",
3926 + "var",
3927 + "babel-core",
3928 + "compiler"
3929 + ],
3930 + "license": "MIT",
3931 + "name": "babel-core",
3932 + "repository": {
3933 + "type": "git",
3934 + "url": "https://github.com/babel/babel/tree/master/packages/babel-core"
3935 + },
3936 + "scripts": {
3937 + "bench": "make bench",
3938 + "test": "make test"
3939 + },
3940 + "version": "6.26.0"
3941 +}
3942 +
3943 +},{}],33:[function(require,module,exports){
3944 +"use strict";
3945 +
3946 +exports.__esModule = true;
3947 +
3948 +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
3949 +
3950 +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
3951 +
3952 +var _trimRight = require("trim-right");
3953 +
3954 +var _trimRight2 = _interopRequireDefault(_trimRight);
3955 +
3956 +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
3957 +
3958 +var SPACES_RE = /^[ \t]+$/;
3959 +
3960 +var Buffer = function () {
3961 + function Buffer(map) {
3962 + (0, _classCallCheck3.default)(this, Buffer);
3963 + this._map = null;
3964 + this._buf = [];
3965 + this._last = "";
3966 + this._queue = [];
3967 + this._position = {
3968 + line: 1,
3969 + column: 0
3970 + };
3971 + this._sourcePosition = {
3972 + identifierName: null,
3973 + line: null,
3974 + column: null,
3975 + filename: null
3976 + };
3977 +
3978 + this._map = map;
3979 + }
3980 +
3981 + Buffer.prototype.get = function get() {
3982 + this._flush();
3983 +
3984 + var map = this._map;
3985 + var result = {
3986 + code: (0, _trimRight2.default)(this._buf.join("")),
3987 + map: null,
3988 + rawMappings: map && map.getRawMappings()
3989 + };
3990 +
3991 + if (map) {
3992 + Object.defineProperty(result, "map", {
3993 + configurable: true,
3994 + enumerable: true,
3995 + get: function get() {
3996 + return this.map = map.get();
3997 + },
3998 + set: function set(value) {
3999 + Object.defineProperty(this, "map", { value: value, writable: true });
4000 + }
4001 + });
4002 + }
4003 +
4004 + return result;
4005 + };
4006 +
4007 + Buffer.prototype.append = function append(str) {
4008 + this._flush();
4009 + var _sourcePosition = this._sourcePosition,
4010 + line = _sourcePosition.line,
4011 + column = _sourcePosition.column,
4012 + filename = _sourcePosition.filename,
4013 + identifierName = _sourcePosition.identifierName;
4014 +
4015 + this._append(str, line, column, identifierName, filename);
4016 + };
4017 +
4018 + Buffer.prototype.queue = function queue(str) {
4019 + if (str === "\n") while (this._queue.length > 0 && SPACES_RE.test(this._queue[0][0])) {
4020 + this._queue.shift();
4021 + }var _sourcePosition2 = this._sourcePosition,
4022 + line = _sourcePosition2.line,
4023 + column = _sourcePosition2.column,
4024 + filename = _sourcePosition2.filename,
4025 + identifierName = _sourcePosition2.identifierName;
4026 +
4027 + this._queue.unshift([str, line, column, identifierName, filename]);
4028 + };
4029 +
4030 + Buffer.prototype._flush = function _flush() {
4031 + var item = void 0;
4032 + while (item = this._queue.pop()) {
4033 + this._append.apply(this, item);
4034 + }
4035 + };
4036 +
4037 + Buffer.prototype._append = function _append(str, line, column, identifierName, filename) {
4038 + if (this._map && str[0] !== "\n") {
4039 + this._map.mark(this._position.line, this._position.column, line, column, identifierName, filename);
4040 + }
4041 +
4042 + this._buf.push(str);
4043 + this._last = str[str.length - 1];
4044 +
4045 + for (var i = 0; i < str.length; i++) {
4046 + if (str[i] === "\n") {
4047 + this._position.line++;
4048 + this._position.column = 0;
4049 + } else {
4050 + this._position.column++;
4051 + }
4052 + }
4053 + };
4054 +
4055 + Buffer.prototype.removeTrailingNewline = function removeTrailingNewline() {
4056 + if (this._queue.length > 0 && this._queue[0][0] === "\n") this._queue.shift();
4057 + };
4058 +
4059 + Buffer.prototype.removeLastSemicolon = function removeLastSemicolon() {
4060 + if (this._queue.length > 0 && this._queue[0][0] === ";") this._queue.shift();
4061 + };
4062 +
4063 + Buffer.prototype.endsWith = function endsWith(suffix) {
4064 + if (suffix.length === 1) {
4065 + var last = void 0;
4066 + if (this._queue.length > 0) {
4067 + var str = this._queue[0][0];
4068 + last = str[str.length - 1];
4069 + } else {
4070 + last = this._last;
4071 + }
4072 +
4073 + return last === suffix;
4074 + }
4075 +
4076 + var end = this._last + this._queue.reduce(function (acc, item) {
4077 + return item[0] + acc;
4078 + }, "");
4079 + if (suffix.length <= end.length) {
4080 + return end.slice(-suffix.length) === suffix;
4081 + }
4082 +
4083 + return false;
4084 + };
4085 +
4086 + Buffer.prototype.hasContent = function hasContent() {
4087 + return this._queue.length > 0 || !!this._last;
4088 + };
4089 +
4090 + Buffer.prototype.source = function source(prop, loc) {
4091 + if (prop && !loc) return;
4092 +
4093 + var pos = loc ? loc[prop] : null;
4094 +
4095 + this._sourcePosition.identifierName = loc && loc.identifierName || null;
4096 + this._sourcePosition.line = pos ? pos.line : null;
4097 + this._sourcePosition.column = pos ? pos.column : null;
4098 + this._sourcePosition.filename = loc && loc.filename || null;
4099 + };
4100 +
4101 + Buffer.prototype.withSource = function withSource(prop, loc, cb) {
4102 + if (!this._map) return cb();
4103 +
4104 + var originalLine = this._sourcePosition.line;
4105 + var originalColumn = this._sourcePosition.column;
4106 + var originalFilename = this._sourcePosition.filename;
4107 + var originalIdentifierName = this._sourcePosition.identifierName;
4108 +
4109 + this.source(prop, loc);
4110 +
4111 + cb();
4112 +
4113 + this._sourcePosition.line = originalLine;
4114 + this._sourcePosition.column = originalColumn;
4115 + this._sourcePosition.filename = originalFilename;
4116 + this._sourcePosition.identifierName = originalIdentifierName;
4117 + };
4118 +
4119 + Buffer.prototype.getCurrentColumn = function getCurrentColumn() {
4120 + var extra = this._queue.reduce(function (acc, item) {
4121 + return item[0] + acc;
4122 + }, "");
4123 + var lastIndex = extra.lastIndexOf("\n");
4124 +
4125 + return lastIndex === -1 ? this._position.column + extra.length : extra.length - 1 - lastIndex;
4126 + };
4127 +
4128 + Buffer.prototype.getCurrentLine = function getCurrentLine() {
4129 + var extra = this._queue.reduce(function (acc, item) {
4130 + return item[0] + acc;
4131 + }, "");
4132 +
4133 + var count = 0;
4134 + for (var i = 0; i < extra.length; i++) {
4135 + if (extra[i] === "\n") count++;
4136 + }
4137 +
4138 + return this._position.line + count;
4139 + };
4140 +
4141 + return Buffer;
4142 +}();
4143 +
4144 +exports.default = Buffer;
4145 +module.exports = exports["default"];
4146 +},{"babel-runtime/helpers/classCallCheck":109,"trim-right":556}],34:[function(require,module,exports){
4147 +"use strict";
4148 +
4149 +exports.__esModule = true;
4150 +exports.File = File;
4151 +exports.Program = Program;
4152 +exports.BlockStatement = BlockStatement;
4153 +exports.Noop = Noop;
4154 +exports.Directive = Directive;
4155 +
4156 +var _types = require("./types");
4157 +
4158 +Object.defineProperty(exports, "DirectiveLiteral", {
4159 + enumerable: true,
4160 + get: function get() {
4161 + return _types.StringLiteral;
4162 + }
4163 +});
4164 +function File(node) {
4165 + this.print(node.program, node);
4166 +}
4167 +
4168 +function Program(node) {
4169 + this.printInnerComments(node, false);
4170 +
4171 + this.printSequence(node.directives, node);
4172 + if (node.directives && node.directives.length) this.newline();
4173 +
4174 + this.printSequence(node.body, node);
4175 +}
4176 +
4177 +function BlockStatement(node) {
4178 + this.token("{");
4179 + this.printInnerComments(node);
4180 +
4181 + var hasDirectives = node.directives && node.directives.length;
4182 +
4183 + if (node.body.length || hasDirectives) {
4184 + this.newline();
4185 +
4186 + this.printSequence(node.directives, node, { indent: true });
4187 + if (hasDirectives) this.newline();
4188 +
4189 + this.printSequence(node.body, node, { indent: true });
4190 + this.removeTrailingNewline();
4191 +
4192 + this.source("end", node.loc);
4193 +
4194 + if (!this.endsWith("\n")) this.newline();
4195 +
4196 + this.rightBrace();
4197 + } else {
4198 + this.source("end", node.loc);
4199 + this.token("}");
4200 + }
4201 +}
4202 +
4203 +function Noop() {}
4204 +
4205 +function Directive(node) {
4206 + this.print(node.value, node);
4207 + this.semicolon();
4208 +}
4209 +},{"./types":43}],35:[function(require,module,exports){
4210 +"use strict";
4211 +
4212 +exports.__esModule = true;
4213 +exports.ClassDeclaration = ClassDeclaration;
4214 +exports.ClassBody = ClassBody;
4215 +exports.ClassProperty = ClassProperty;
4216 +exports.ClassMethod = ClassMethod;
4217 +function ClassDeclaration(node) {
4218 + this.printJoin(node.decorators, node);
4219 + this.word("class");
4220 +
4221 + if (node.id) {
4222 + this.space();
4223 + this.print(node.id, node);
4224 + }
4225 +
4226 + this.print(node.typeParameters, node);
4227 +
4228 + if (node.superClass) {
4229 + this.space();
4230 + this.word("extends");
4231 + this.space();
4232 + this.print(node.superClass, node);
4233 + this.print(node.superTypeParameters, node);
4234 + }
4235 +
4236 + if (node.implements) {
4237 + this.space();
4238 + this.word("implements");
4239 + this.space();
4240 + this.printList(node.implements, node);
4241 + }
4242 +
4243 + this.space();
4244 + this.print(node.body, node);
4245 +}
4246 +
4247 +exports.ClassExpression = ClassDeclaration;
4248 +function ClassBody(node) {
4249 + this.token("{");
4250 + this.printInnerComments(node);
4251 + if (node.body.length === 0) {
4252 + this.token("}");
4253 + } else {
4254 + this.newline();
4255 +
4256 + this.indent();
4257 + this.printSequence(node.body, node);
4258 + this.dedent();
4259 +
4260 + if (!this.endsWith("\n")) this.newline();
4261 +
4262 + this.rightBrace();
4263 + }
4264 +}
4265 +
4266 +function ClassProperty(node) {
4267 + this.printJoin(node.decorators, node);
4268 +
4269 + if (node.static) {
4270 + this.word("static");
4271 + this.space();
4272 + }
4273 + if (node.computed) {
4274 + this.token("[");
4275 + this.print(node.key, node);
4276 + this.token("]");
4277 + } else {
4278 + this._variance(node);
4279 + this.print(node.key, node);
4280 + }
4281 + this.print(node.typeAnnotation, node);
4282 + if (node.value) {
4283 + this.space();
4284 + this.token("=");
4285 + this.space();
4286 + this.print(node.value, node);
4287 + }
4288 + this.semicolon();
4289 +}
4290 +
4291 +function ClassMethod(node) {
4292 + this.printJoin(node.decorators, node);
4293 +
4294 + if (node.static) {
4295 + this.word("static");
4296 + this.space();
4297 + }
4298 +
4299 + if (node.kind === "constructorCall") {
4300 + this.word("call");
4301 + this.space();
4302 + }
4303 +
4304 + this._method(node);
4305 +}
4306 +},{}],36:[function(require,module,exports){
4307 +"use strict";
4308 +
4309 +exports.__esModule = true;
4310 +exports.LogicalExpression = exports.BinaryExpression = exports.AwaitExpression = exports.YieldExpression = undefined;
4311 +exports.UnaryExpression = UnaryExpression;
4312 +exports.DoExpression = DoExpression;
4313 +exports.ParenthesizedExpression = ParenthesizedExpression;
4314 +exports.UpdateExpression = UpdateExpression;
4315 +exports.ConditionalExpression = ConditionalExpression;
4316 +exports.NewExpression = NewExpression;
4317 +exports.SequenceExpression = SequenceExpression;
4318 +exports.ThisExpression = ThisExpression;
4319 +exports.Super = Super;
4320 +exports.Decorator = Decorator;
4321 +exports.CallExpression = CallExpression;
4322 +exports.Import = Import;
4323 +exports.EmptyStatement = EmptyStatement;
4324 +exports.ExpressionStatement = ExpressionStatement;
4325 +exports.AssignmentPattern = AssignmentPattern;
4326 +exports.AssignmentExpression = AssignmentExpression;
4327 +exports.BindExpression = BindExpression;
4328 +exports.MemberExpression = MemberExpression;
4329 +exports.MetaProperty = MetaProperty;
4330 +
4331 +var _babelTypes = require("babel-types");
4332 +
4333 +var t = _interopRequireWildcard(_babelTypes);
4334 +
4335 +var _node = require("../node");
4336 +
4337 +var n = _interopRequireWildcard(_node);
4338 +
4339 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
4340 +
4341 +function UnaryExpression(node) {
4342 + if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {
4343 + this.word(node.operator);
4344 + this.space();
4345 + } else {
4346 + this.token(node.operator);
4347 + }
4348 +
4349 + this.print(node.argument, node);
4350 +}
4351 +
4352 +function DoExpression(node) {
4353 + this.word("do");
4354 + this.space();
4355 + this.print(node.body, node);
4356 +}
4357 +
4358 +function ParenthesizedExpression(node) {
4359 + this.token("(");
4360 + this.print(node.expression, node);
4361 + this.token(")");
4362 +}
4363 +
4364 +function UpdateExpression(node) {
4365 + if (node.prefix) {
4366 + this.token(node.operator);
4367 + this.print(node.argument, node);
4368 + } else {
4369 + this.print(node.argument, node);
4370 + this.token(node.operator);
4371 + }
4372 +}
4373 +
4374 +function ConditionalExpression(node) {
4375 + this.print(node.test, node);
4376 + this.space();
4377 + this.token("?");
4378 + this.space();
4379 + this.print(node.consequent, node);
4380 + this.space();
4381 + this.token(":");
4382 + this.space();
4383 + this.print(node.alternate, node);
4384 +}
4385 +
4386 +function NewExpression(node, parent) {
4387 + this.word("new");
4388 + this.space();
4389 + this.print(node.callee, node);
4390 + if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return;
4391 +
4392 + this.token("(");
4393 + this.printList(node.arguments, node);
4394 + this.token(")");
4395 +}
4396 +
4397 +function SequenceExpression(node) {
4398 + this.printList(node.expressions, node);
4399 +}
4400 +
4401 +function ThisExpression() {
4402 + this.word("this");
4403 +}
4404 +
4405 +function Super() {
4406 + this.word("super");
4407 +}
4408 +
4409 +function Decorator(node) {
4410 + this.token("@");
4411 + this.print(node.expression, node);
4412 + this.newline();
4413 +}
4414 +
4415 +function commaSeparatorNewline() {
4416 + this.token(",");
4417 + this.newline();
4418 +
4419 + if (!this.endsWith("\n")) this.space();
4420 +}
4421 +
4422 +function CallExpression(node) {
4423 + this.print(node.callee, node);
4424 +
4425 + this.token("(");
4426 +
4427 + var isPrettyCall = node._prettyCall;
4428 +
4429 + var separator = void 0;
4430 + if (isPrettyCall) {
4431 + separator = commaSeparatorNewline;
4432 + this.newline();
4433 + this.indent();
4434 + }
4435 +
4436 + this.printList(node.arguments, node, { separator: separator });
4437 +
4438 + if (isPrettyCall) {
4439 + this.newline();
4440 + this.dedent();
4441 + }
4442 +
4443 + this.token(")");
4444 +}
4445 +
4446 +function Import() {
4447 + this.word("import");
4448 +}
4449 +
4450 +function buildYieldAwait(keyword) {
4451 + return function (node) {
4452 + this.word(keyword);
4453 +
4454 + if (node.delegate) {
4455 + this.token("*");
4456 + }
4457 +
4458 + if (node.argument) {
4459 + this.space();
4460 + var terminatorState = this.startTerminatorless();
4461 + this.print(node.argument, node);
4462 + this.endTerminatorless(terminatorState);
4463 + }
4464 + };
4465 +}
4466 +
4467 +var YieldExpression = exports.YieldExpression = buildYieldAwait("yield");
4468 +var AwaitExpression = exports.AwaitExpression = buildYieldAwait("await");
4469 +
4470 +function EmptyStatement() {
4471 + this.semicolon(true);
4472 +}
4473 +
4474 +function ExpressionStatement(node) {
4475 + this.print(node.expression, node);
4476 + this.semicolon();
4477 +}
4478 +
4479 +function AssignmentPattern(node) {
4480 + this.print(node.left, node);
4481 + if (node.left.optional) this.token("?");
4482 + this.print(node.left.typeAnnotation, node);
4483 + this.space();
4484 + this.token("=");
4485 + this.space();
4486 + this.print(node.right, node);
4487 +}
4488 +
4489 +function AssignmentExpression(node, parent) {
4490 + var parens = this.inForStatementInitCounter && node.operator === "in" && !n.needsParens(node, parent);
4491 +
4492 + if (parens) {
4493 + this.token("(");
4494 + }
4495 +
4496 + this.print(node.left, node);
4497 +
4498 + this.space();
4499 + if (node.operator === "in" || node.operator === "instanceof") {
4500 + this.word(node.operator);
4501 + } else {
4502 + this.token(node.operator);
4503 + }
4504 + this.space();
4505 +
4506 + this.print(node.right, node);
4507 +
4508 + if (parens) {
4509 + this.token(")");
4510 + }
4511 +}
4512 +
4513 +function BindExpression(node) {
4514 + this.print(node.object, node);
4515 + this.token("::");
4516 + this.print(node.callee, node);
4517 +}
4518 +
4519 +exports.BinaryExpression = AssignmentExpression;
4520 +exports.LogicalExpression = AssignmentExpression;
4521 +function MemberExpression(node) {
4522 + this.print(node.object, node);
4523 +
4524 + if (!node.computed && t.isMemberExpression(node.property)) {
4525 + throw new TypeError("Got a MemberExpression for MemberExpression property");
4526 + }
4527 +
4528 + var computed = node.computed;
4529 + if (t.isLiteral(node.property) && typeof node.property.value === "number") {
4530 + computed = true;
4531 + }
4532 +
4533 + if (computed) {
4534 + this.token("[");
4535 + this.print(node.property, node);
4536 + this.token("]");
4537 + } else {
4538 + this.token(".");
4539 + this.print(node.property, node);
4540 + }
4541 +}
4542 +
4543 +function MetaProperty(node) {
4544 + this.print(node.meta, node);
4545 + this.token(".");
4546 + this.print(node.property, node);
4547 +}
4548 +},{"../node":45,"babel-types":151}],37:[function(require,module,exports){
4549 +"use strict";
4550 +
4551 +exports.__esModule = true;
4552 +exports.TypeParameterDeclaration = exports.StringLiteralTypeAnnotation = exports.NumericLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
4553 +exports.AnyTypeAnnotation = AnyTypeAnnotation;
4554 +exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
4555 +exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
4556 +exports.BooleanLiteralTypeAnnotation = BooleanLiteralTypeAnnotation;
4557 +exports.NullLiteralTypeAnnotation = NullLiteralTypeAnnotation;
4558 +exports.DeclareClass = DeclareClass;
4559 +exports.DeclareFunction = DeclareFunction;
4560 +exports.DeclareInterface = DeclareInterface;
4561 +exports.DeclareModule = DeclareModule;
4562 +exports.DeclareModuleExports = DeclareModuleExports;
4563 +exports.DeclareTypeAlias = DeclareTypeAlias;
4564 +exports.DeclareOpaqueType = DeclareOpaqueType;
4565 +exports.DeclareVariable = DeclareVariable;
4566 +exports.DeclareExportDeclaration = DeclareExportDeclaration;
4567 +exports.ExistentialTypeParam = ExistentialTypeParam;
4568 +exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
4569 +exports.FunctionTypeParam = FunctionTypeParam;
4570 +exports.InterfaceExtends = InterfaceExtends;
4571 +exports._interfaceish = _interfaceish;
4572 +exports._variance = _variance;
4573 +exports.InterfaceDeclaration = InterfaceDeclaration;
4574 +exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
4575 +exports.MixedTypeAnnotation = MixedTypeAnnotation;
4576 +exports.EmptyTypeAnnotation = EmptyTypeAnnotation;
4577 +exports.NullableTypeAnnotation = NullableTypeAnnotation;
4578 +
4579 +var _types = require("./types");
4580 +
4581 +Object.defineProperty(exports, "NumericLiteralTypeAnnotation", {
4582 + enumerable: true,
4583 + get: function get() {
4584 + return _types.NumericLiteral;
4585 + }
4586 +});
4587 +Object.defineProperty(exports, "StringLiteralTypeAnnotation", {
4588 + enumerable: true,
4589 + get: function get() {
4590 + return _types.StringLiteral;
4591 + }
4592 +});
4593 +exports.NumberTypeAnnotation = NumberTypeAnnotation;
4594 +exports.StringTypeAnnotation = StringTypeAnnotation;
4595 +exports.ThisTypeAnnotation = ThisTypeAnnotation;
4596 +exports.TupleTypeAnnotation = TupleTypeAnnotation;
4597 +exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
4598 +exports.TypeAlias = TypeAlias;
4599 +exports.OpaqueType = OpaqueType;
4600 +exports.TypeAnnotation = TypeAnnotation;
4601 +exports.TypeParameter = TypeParameter;
4602 +exports.TypeParameterInstantiation = TypeParameterInstantiation;
4603 +exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
4604 +exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
4605 +exports.ObjectTypeIndexer = ObjectTypeIndexer;
4606 +exports.ObjectTypeProperty = ObjectTypeProperty;
4607 +exports.ObjectTypeSpreadProperty = ObjectTypeSpreadProperty;
4608 +exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
4609 +exports.UnionTypeAnnotation = UnionTypeAnnotation;
4610 +exports.TypeCastExpression = TypeCastExpression;
4611 +exports.VoidTypeAnnotation = VoidTypeAnnotation;
4612 +
4613 +var _babelTypes = require("babel-types");
4614 +
4615 +var t = _interopRequireWildcard(_babelTypes);
4616 +
4617 +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
4618 +
4619 +function AnyTypeAnnotation() {
4620 + this.word("any");
4621 +}
4622 +
4623 +function ArrayTypeAnnotation(node) {
4624 + this.print(node.elementType, node);
4625 + this.token("[");
4626 + this.token("]");
4627 +}
4628 +
4629 +function BooleanTypeAnnotation() {
4630 + this.word("boolean");
4631 +}
4632 +
4633 +function BooleanLiteralTypeAnnotation(node) {
4634 + this.word(node.value ? "true" : "false");
4635 +}
4636 +
4637 +function NullLiteralTypeAnnotation() {
4638 + this.word("null");
4639 +}
4640 +
4641 +function DeclareClass(node, parent) {
4642 + if (!t.isDeclareExportDeclaration(parent)) {
4643 + this.word("declare");
4644 + this.space();
4645 + }
4646 + this.word("class");
4647 + this.space();
4648 + this._interfaceish(node);
4649 +}
4650 +
4651 +function DeclareFunction(node, parent) {
4652 + if (!t.isDeclareExportDeclaration(parent)) {
4653 + this.word("declare");
4654 + this.space();
4655 + }
4656 + this.word("function");
4657 + this.space();
4658 + this.print(node.id, node);
4659 + this.print(node.id.typeAnnotation.typeAnnotation, node);
4660 + this.semicolon();
4661 +}
4662 +
4663 +function DeclareInterface(node) {
4664 + this.word("declare");
4665 + this.space();
4666 + this.InterfaceDeclaration(node);
4667 +}
4668 +
4669 +function DeclareModule(node) {
4670 + this.word("declare");
4671 + this.space();
4672 + this.word("module");
4673 + this.space();
4674 + this.print(node.id, node);
4675 + this.space();
4676 + this.print(node.body, node);
4677 +}
4678 +
4679 +function DeclareModuleExports(node) {
4680 + this.word("declare");
4681 + this.space();
4682 + this.word("module");
4683 + this.token(".");
4684 + this.word("exports");
4685 + this.print(node.typeAnnotation, node);
4686 +}
4687 +
4688 +function DeclareTypeAlias(node) {
4689 + this.word("declare");
4690 + this.space();
4691 + this.TypeAlias(node);
4692 +}
4693 +
4694 +function DeclareOpaqueType(node, parent) {
4695 + if (!t.isDeclareExportDeclaration(parent)) {
4696 + this.word("declare");
4697 + this.space();
4698 + }
4699 + this.OpaqueType(node);
4700 +}
4701 +
4702 +function DeclareVariable(node, parent) {
4703 + if (!t.isDeclareExportDeclaration(parent)) {
4704 + this.word("declare");
4705 + this.space();
4706 + }
4707 + this.word("var");
4708 + this.space();
4709 + this.print(node.id, node);
4710 + this.print(node.id.typeAnnotation, node);
4711 + this.semicolon();
4712 +}
4713 +
4714 +function DeclareExportDeclaration(node) {
4715 + this.word("declare");
4716 + this.space();
4717 + this.word("export");
4718 + this.space();
4719 + if (node.default) {
4720 + this.word("default");
4721 + this.space();
4722 + }
4723 +
4724 + FlowExportDeclaration.apply(this, arguments);
4725 +}
4726 +
4727 +function FlowExportDeclaration(node) {
4728 + if (node.declaration) {
4729 + var declar = node.declaration;
4730 + this.print(declar, node);
4731 + if (!t.isStatement(declar)) this.semicolon();
4732 + } else {
4733 + this.token("{");
4734 + if (node.specifiers.length) {
4735 + this.space();
4736 + this.printList(node.specifiers, node);
4737 + this.space();
4738 + }
4739 + this.token("}");
4740 +
4741 + if (node.source) {
4742 + this.space();
4743 + this.word("from");
4744 + this.space();
4745 + this.print(node.source, node);
4746 + }
4747 +
4748 + this.semicolon();
4749 + }
4750 +}
4751 +
4752 +function ExistentialTypeParam() {
4753 + this.token("*");
4754 +}
4755 +
4756 +function FunctionTypeAnnotation(node, parent) {
4757 + this.print(node.typeParameters, node);
4758 + this.token("(");
4759 + this.printList(node.params, node);
4760 +
4761 + if (node.rest) {
4762 + if (node.params.length) {
4763 + this.token(",");
4764 + this.space();
4765 + }
4766 + this.token("...");
4767 + this.print(node.rest, node);
4768 + }
4769 +
4770 + this.token(")");
4771 +
4772 + if (parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") {
4773 + this.token(":");
4774 + } else {
4775 + this.space();
4776 + this.token("=>");
4777 + }
4778 +
4779 + this.space();
4780 + this.print(node.returnType, node);
4781 +}
4782 +
4783 +function FunctionTypeParam(node) {
4784 + this.print(node.name, node);
4785 + if (node.optional) this.token("?");
4786 + this.token(":");
4787 + this.space();
4788 + this.print(node.typeAnnotation, node);
4789 +}
4790 +
4791 +function InterfaceExtends(node) {
4792 + this.print(node.id, node);
4793 + this.print(node.typeParameters, node);
4794 +}
4795 +
4796 +exports.ClassImplements = InterfaceExtends;
4797 +exports.GenericTypeAnnotation = InterfaceExtends;
4798 +function _interfaceish(node) {
4799 + this.print(node.id, node);
4800 + this.print(node.typeParameters, node);
4801 + if (node.extends.length) {
4802 + this.space();
4803 + this.word("extends");
4804 + this.space();
4805 + this.printList(node.extends, node);
4806 + }
4807 + if (node.mixins && node.mixins.length) {
4808 + this.space();
4809 + this.word("mixins");
4810 + this.space();
4811 + this.printList(node.mixins, node);
4812 + }
4813 + this.space();
4814 + this.print(node.body, node);
4815 +}
4816 +
4817 +function _variance(node) {
4818 + if (node.variance === "plus") {
4819 + this.token("+");
4820 + } else if (node.variance === "minus") {
4821 + this.token("-");
4822 + }
4823 +}
4824 +
4825 +function InterfaceDeclaration(node) {
4826 + this.word("interface");
4827 + this.space();
4828 + this._interfaceish(node);
4829 +}
4830 +
4831 +function andSeparator() {
4832 + this.space();
4833 + this.token("&");
4834 + this.space();
4835 +}
4836 +
4837 +function IntersectionTypeAnnotation(node) {
4838 + this.printJoin(node.types, node, { separator: andSeparator });
4839 +}
4840 +
4841 +function MixedTypeAnnotation() {
4842 + this.word("mixed");
4843 +}
4844 +
4845 +function EmptyTypeAnnotation() {
4846 + this.word("empty");
4847 +}
4848 +
4849 +function NullableTypeAnnotation(node) {
4850 + this.token("?");
4851 + this.print(node.typeAnnotation, node);
4852 +}
4853 +
4854 +function NumberTypeAnnotation() {
4855 + this.word("number");
4856 +}
4857 +
4858 +function StringTypeAnnotation() {
4859 + this.word("string");
4860 +}
4861 +
4862 +function ThisTypeAnnotation() {
4863 + this.word("this");
4864 +}
4865 +
4866 +function TupleTypeAnnotation(node) {
4867 + this.token("[");
4868 + this.printList(node.types, node);
4869 + this.token("]");
4870 +}
4871 +
4872 +function TypeofTypeAnnotation(node) {
4873 + this.word("typeof");
4874 + this.space();
4875 + this.print(node.argument, node);
4876 +}
4877 +
4878 +function TypeAlias(node) {
4879 + this.word("type");
4880 + this.space();
4881 + this.print(node.id, node);
4882 + this.print(node.typeParameters, node);
4883 + this.space();
4884 + this.token("=");
4885 + this.space();
4886 + this.print(node.right, node);
4887 + this.semicolon();
4888 +}
4889 +function OpaqueType(node) {
4890 + this.word("opaque");
4891 + this.space();
4892 + this.word("type");
4893 + this.space();
4894 + this.print(node.id, node);
4895 + this.print(node.typeParameters, node);
4896 + if (node.supertype) {
4897 + this.token(":");
4898 + this.space();
4899 + this.print(node.supertype, node);
4900 + }
4901 + if (node.impltype) {
4902 + this.space();
4903 + this.token("=");
4904 + this.space();
4905 + this.print(node.impltype, node);
4906 + }
4907 + this.semicolon();
4908 +}
4909 +
4910 +function TypeAnnotation(node) {
4911 + this.token(":");
4912 + this.space();
4913 + if (node.optional) this.token("?");
4914 + this.print(node.typeAnnotation, node);
4915 +}
4916 +
4917 +function TypeParameter(node) {
4918 + this._variance(node);
4919 +
4920 + this.word(node.name);
4921 +
4922 + if (node.bound) {
4923 + this.print(node.bound, node);
4924 + }
4925 +
4926 + if (node.default) {
4927 + this.space();
4928 + this.token("=");
4929 + this.space();
4930 + this.print(node.default, node);
4931 + }
4932 +}
4933 +
4934 +function TypeParameterInstantiation(node) {
4935 + this.token("<");
4936 + this.printList(node.params, node, {});
4937 + this.token(">");
4938 +}
4939 +
4940 +exports.TypeParameterDeclaration = TypeParameterInstantiation;
4941 +function ObjectTypeAnnotation(node) {
4942 + var _this = this;
4943 +
4944 + if (node.exact) {
4945 + this.token("{|");
4946 + } else {
4947 + this.token("{");
4948 + }
4949 +
4950 + var props = node.properties.concat(node.callProperties, node.indexers);
4951 +
4952 + if (props.length) {
4953 + this.space();
4954 +
4955 + this.printJoin(props, node, {
4956 + addNewlines: function addNewlines(leading) {
4957 + if (leading && !props[0]) return 1;
4958 + },
4959 +
4960 + indent: true,
4961 + statement: true,
4962 + iterator: function iterator() {
4963 + if (props.length !== 1) {
4964 + if (_this.format.flowCommaSeparator) {
4965 + _this.token(",");
4966 + } else {
4967 + _this.semicolon();
4968 + }
4969 + _this.space();
4970 + }
4971 + }
4972 + });
4973 +
4974 + this.space();
4975 + }
4976 +
4977 + if (node.exact) {
4978 + this.token("|}");
4979 + } else {
4980 + this.token("}");
4981 + }
4982 +}
4983 +
4984 +function ObjectTypeCallProperty(node) {
4985 + if (node.static) {
4986 + this.word("static");
4987 + this.space();
4988 + }
4989 + this.print(node.value, node);
4990 +}
4991 +
4992 +function ObjectTypeIndexer(node) {
4993 + if (node.static) {
4994 + this.word("static");
4995 + this.space();
4996 + }
4997 + this._variance(node);
4998 + this.token("[");
4999 + this.print(node.id, node);

This file is too large to show in full.

public/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js new
+1486
@@ -0,0 +1,1486 @@
1 +(function (global, factory) {
2 + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3 + typeof define === 'function' && define.amd ? define(factory) :
4 + (global.BrowserESModuleLoader = factory());
5 +}(this, (function () { 'use strict';
6 +
7 +/*
8 + * Environment
9 + */
10 +var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
11 +var isNode = typeof process !== 'undefined' && process.versions && process.versions.node;
12 +var isWindows = typeof process !== 'undefined' && typeof process.platform === 'string' && process.platform.match(/^win/);
13 +
14 +var envGlobal = typeof self !== 'undefined' ? self : global;
15 +/*
16 + * Simple Symbol() shim
17 + */
18 +var hasSymbol = typeof Symbol !== 'undefined';
19 +function createSymbol (name) {
20 + return hasSymbol ? Symbol() : '@@' + name;
21 +}
22 +
23 +var toStringTag = hasSymbol && Symbol.toStringTag;
24 +
25 +
26 +
27 +
28 +
29 +/*
30 + * Environment baseURI
31 + */
32 +var baseURI;
33 +
34 +// environent baseURI detection
35 +if (typeof document != 'undefined' && document.getElementsByTagName) {
36 + baseURI = document.baseURI;
37 +
38 + if (!baseURI) {
39 + var bases = document.getElementsByTagName('base');
40 + baseURI = bases[0] && bases[0].href || window.location.href;
41 + }
42 +}
43 +else if (typeof location != 'undefined') {
44 + baseURI = location.href;
45 +}
46 +
47 +// sanitize out the hash and querystring
48 +if (baseURI) {
49 + baseURI = baseURI.split('#')[0].split('?')[0];
50 + var slashIndex = baseURI.lastIndexOf('/');
51 + if (slashIndex !== -1)
52 + baseURI = baseURI.substr(0, slashIndex + 1);
53 +}
54 +else if (typeof process !== 'undefined' && process.cwd) {
55 + baseURI = 'file://' + (isWindows ? '/' : '') + process.cwd();
56 + if (isWindows)
57 + baseURI = baseURI.replace(/\\/g, '/');
58 +}
59 +else {
60 + throw new TypeError('No environment baseURI');
61 +}
62 +
63 +// ensure baseURI has trailing "/"
64 +if (baseURI[baseURI.length - 1] !== '/')
65 + baseURI += '/';
66 +
67 +/*
68 + * LoaderError with chaining for loader stacks
69 + */
70 +var errArgs = new Error(0, '_').fileName == '_';
71 +function LoaderError__Check_error_message_for_loader_stack (childErr, newMessage) {
72 + // Convert file:/// URLs to paths in Node
73 + if (!isBrowser)
74 + newMessage = newMessage.replace(isWindows ? /file:\/\/\//g : /file:\/\//g, '');
75 +
76 + var message = (childErr.message || childErr) + '\n ' + newMessage;
77 +
78 + var err;
79 + if (errArgs && childErr.fileName)
80 + err = new Error(message, childErr.fileName, childErr.lineNumber);
81 + else
82 + err = new Error(message);
83 +
84 +
85 + var stack = childErr.originalErr ? childErr.originalErr.stack : childErr.stack;
86 +
87 + if (isNode)
88 + // node doesn't show the message otherwise
89 + err.stack = message + '\n ' + stack;
90 + else
91 + err.stack = stack;
92 +
93 + err.originalErr = childErr.originalErr || childErr;
94 +
95 + return err;
96 +}
97 +
98 +var resolvedPromise$1 = Promise.resolve();
99 +
100 +/*
101 + * Simple Array values shim
102 + */
103 +function arrayValues (arr) {
104 + if (arr.values)
105 + return arr.values();
106 +
107 + if (typeof Symbol === 'undefined' || !Symbol.iterator)
108 + throw new Error('Symbol.iterator not supported in this browser');
109 +
110 + var iterable = {};
111 + iterable[Symbol.iterator] = function () {
112 + var keys = Object.keys(arr);
113 + var keyIndex = 0;
114 + return {
115 + next: function () {
116 + if (keyIndex < keys.length)
117 + return {
118 + value: arr[keys[keyIndex++]],
119 + done: false
120 + };
121 + else
122 + return {
123 + value: undefined,
124 + done: true
125 + };
126 + }
127 + };
128 + };
129 + return iterable;
130 +}
131 +
132 +/*
133 + * 3. Reflect.Loader
134 + *
135 + * We skip the entire native internal pipeline, just providing the bare API
136 + */
137 +// 3.1.1
138 +function Loader () {
139 + this.registry = new Registry();
140 +}
141 +// 3.3.1
142 +Loader.prototype.constructor = Loader;
143 +
144 +function ensureInstantiated (module) {
145 + if (module === undefined)
146 + return;
147 + if (module instanceof ModuleNamespace === false && module[toStringTag] !== 'module')
148 + throw new TypeError('Module instantiation did not return a valid namespace object.');
149 + return module;
150 +}
151 +
152 +// 3.3.2
153 +Loader.prototype.import = function (key, parent) {
154 + if (typeof key !== 'string')
155 + throw new TypeError('Loader import method must be passed a module key string');
156 + // custom resolveInstantiate combined hook for better perf
157 + var loader = this;
158 + return resolvedPromise$1
159 + .then(function () {
160 + return loader[RESOLVE_INSTANTIATE](key, parent);
161 + })
162 + .then(ensureInstantiated)
163 + //.then(Module.evaluate)
164 + .catch(function (err) {
165 + throw LoaderError__Check_error_message_for_loader_stack(err, 'Loading ' + key + (parent ? ' from ' + parent : ''));
166 + });
167 +};
168 +// 3.3.3
169 +var RESOLVE = Loader.resolve = createSymbol('resolve');
170 +
171 +/*
172 + * Combined resolve / instantiate hook
173 + *
174 + * Not in current reduced spec, but necessary to separate RESOLVE from RESOLVE + INSTANTIATE as described
175 + * in the spec notes of this repo to ensure that loader.resolve doesn't instantiate when not wanted.
176 + *
177 + * We implement RESOLVE_INSTANTIATE as a single hook instead of a separate INSTANTIATE in order to avoid
178 + * the need for double registry lookups as a performance optimization.
179 + */
180 +var RESOLVE_INSTANTIATE = Loader.resolveInstantiate = createSymbol('resolveInstantiate');
181 +
182 +// default resolveInstantiate is just to call resolve and then get from the registry
183 +// this provides compatibility for the resolveInstantiate optimization
184 +Loader.prototype[RESOLVE_INSTANTIATE] = function (key, parent) {
185 + var loader = this;
186 + return loader.resolve(key, parent)
187 + .then(function (resolved) {
188 + return loader.registry.get(resolved);
189 + });
190 +};
191 +
192 +function ensureResolution (resolvedKey) {
193 + if (resolvedKey === undefined)
194 + throw new RangeError('No resolution found.');
195 + return resolvedKey;
196 +}
197 +
198 +Loader.prototype.resolve = function (key, parent) {
199 + var loader = this;
200 + return resolvedPromise$1
201 + .then(function() {
202 + return loader[RESOLVE](key, parent);
203 + })
204 + .then(ensureResolution)
205 + .catch(function (err) {
206 + throw LoaderError__Check_error_message_for_loader_stack(err, 'Resolving ' + key + (parent ? ' to ' + parent : ''));
207 + });
208 +};
209 +
210 +// 3.3.4 (import without evaluate)
211 +// this is not documented because the use of deferred evaluation as in Module.evaluate is not
212 +// documented, as it is not considered a stable feature to be encouraged
213 +// Loader.prototype.load may well be deprecated if this stays disabled
214 +/* Loader.prototype.load = function (key, parent) {
215 + return Promise.resolve(this[RESOLVE_INSTANTIATE](key, parent || this.key))
216 + .catch(function (err) {
217 + throw addToError(err, 'Loading ' + key + (parent ? ' from ' + parent : ''));
218 + });
219 +}; */
220 +
221 +/*
222 + * 4. Registry
223 + *
224 + * Instead of structuring through a Map, just use a dictionary object
225 + * We throw for construction attempts so this doesn't affect the public API
226 + *
227 + * Registry has been adjusted to use Namespace objects over ModuleStatus objects
228 + * as part of simplifying loader API implementation
229 + */
230 +var iteratorSupport = typeof Symbol !== 'undefined' && Symbol.iterator;
231 +var REGISTRY = createSymbol('registry');
232 +function Registry() {
233 + this[REGISTRY] = {};
234 +}
235 +// 4.4.1
236 +if (iteratorSupport) {
237 + // 4.4.2
238 + Registry.prototype[Symbol.iterator] = function () {
239 + return this.entries()[Symbol.iterator]();
240 + };
241 +
242 + // 4.4.3
243 + Registry.prototype.entries = function () {
244 + var registry = this[REGISTRY];
245 + return arrayValues(Object.keys(registry).map(function (key) {
246 + return [key, registry[key]];
247 + }));
248 + };
249 +}
250 +
251 +// 4.4.4
252 +Registry.prototype.keys = function () {
253 + return arrayValues(Object.keys(this[REGISTRY]));
254 +};
255 +// 4.4.5
256 +Registry.prototype.values = function () {
257 + var registry = this[REGISTRY];
258 + return arrayValues(Object.keys(registry).map(function (key) {
259 + return registry[key];
260 + }));
261 +};
262 +// 4.4.6
263 +Registry.prototype.get = function (key) {
264 + return this[REGISTRY][key];
265 +};
266 +// 4.4.7
267 +Registry.prototype.set = function (key, namespace) {
268 + if (!(namespace instanceof ModuleNamespace || namespace[toStringTag] === 'module'))
269 + throw new Error('Registry must be set with an instance of Module Namespace');
270 + this[REGISTRY][key] = namespace;
271 + return this;
272 +};
273 +// 4.4.8
274 +Registry.prototype.has = function (key) {
275 + return Object.hasOwnProperty.call(this[REGISTRY], key);
276 +};
277 +// 4.4.9
278 +Registry.prototype.delete = function (key) {
279 + if (Object.hasOwnProperty.call(this[REGISTRY], key)) {
280 + delete this[REGISTRY][key];
281 + return true;
282 + }
283 + return false;
284 +};
285 +
286 +/*
287 + * Simple ModuleNamespace Exotic object based on a baseObject
288 + * We export this for allowing a fast-path for module namespace creation over Module descriptors
289 + */
290 +// var EVALUATE = createSymbol('evaluate');
291 +var BASE_OBJECT = createSymbol('baseObject');
292 +
293 +// 8.3.1 Reflect.Module
294 +/*
295 + * Best-effort simplified non-spec implementation based on
296 + * a baseObject referenced via getters.
297 + *
298 + * Allows:
299 + *
300 + * loader.registry.set('x', new Module({ default: 'x' }));
301 + *
302 + * Optional evaluation function provides experimental Module.evaluate
303 + * support for non-executed modules in registry.
304 + */
305 +function ModuleNamespace (baseObject/*, evaluate*/) {
306 + Object.defineProperty(this, BASE_OBJECT, {
307 + value: baseObject
308 + });
309 +
310 + // evaluate defers namespace population
311 + /* if (evaluate) {
312 + Object.defineProperty(this, EVALUATE, {
313 + value: evaluate,
314 + configurable: true,
315 + writable: true
316 + });
317 + }
318 + else { */
319 + Object.keys(baseObject).forEach(extendNamespace, this);
320 + //}
321 +}
322 +// 8.4.2
323 +ModuleNamespace.prototype = Object.create(null);
324 +
325 +if (toStringTag)
326 + Object.defineProperty(ModuleNamespace.prototype, toStringTag, {
327 + value: 'Module'
328 + });
329 +
330 +function extendNamespace (key) {
331 + Object.defineProperty(this, key, {
332 + enumerable: true,
333 + get: function () {
334 + return this[BASE_OBJECT][key];
335 + }
336 + });
337 +}
338 +
339 +/* function doEvaluate (evaluate, context) {
340 + try {
341 + evaluate.call(context);
342 + }
343 + catch (e) {
344 + return e;
345 + }
346 +}
347 +
348 +// 8.4.1 Module.evaluate... not documented or used because this is potentially unstable
349 +Module.evaluate = function (ns) {
350 + var evaluate = ns[EVALUATE];
351 + if (evaluate) {
352 + ns[EVALUATE] = undefined;
353 + var err = doEvaluate(evaluate);
354 + if (err) {
355 + // cache the error
356 + ns[EVALUATE] = function () {
357 + throw err;
358 + };
359 + throw err;
360 + }
361 + Object.keys(ns[BASE_OBJECT]).forEach(extendNamespace, ns);
362 + }
363 + // make chainable
364 + return ns;
365 +}; */
366 +
367 +/*
368 + * Optimized URL normalization assuming a syntax-valid URL parent
369 + */
370 +function throwResolveError (relUrl, parentUrl) {
371 + throw new RangeError('Unable to resolve "' + relUrl + '" to ' + parentUrl);
372 +}
373 +var backslashRegEx = /\\/g;
374 +function resolveIfNotPlain (relUrl, parentUrl) {
375 + if (relUrl[0] === ' ' || relUrl[relUrl.length - 1] === ' ')
376 + relUrl = relUrl.trim();
377 + var parentProtocol = parentUrl && parentUrl.substr(0, parentUrl.indexOf(':') + 1);
378 +
379 + var firstChar = relUrl[0];
380 + var secondChar = relUrl[1];
381 +
382 + // protocol-relative
383 + if (firstChar === '/' && secondChar === '/') {
384 + if (!parentProtocol)
385 + throwResolveError(relUrl, parentUrl);
386 + if (relUrl.indexOf('\\') !== -1)
387 + relUrl = relUrl.replace(backslashRegEx, '/');
388 + return parentProtocol + relUrl;
389 + }
390 + // relative-url
391 + else if (firstChar === '.' && (secondChar === '/' || secondChar === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||
392 + relUrl.length === 1 && (relUrl += '/')) ||
393 + firstChar === '/') {
394 + if (relUrl.indexOf('\\') !== -1)
395 + relUrl = relUrl.replace(backslashRegEx, '/');
396 + var parentIsPlain = !parentProtocol || parentUrl[parentProtocol.length] !== '/';
397 +
398 + // read pathname from parent if a URL
399 + // pathname taken to be part after leading "/"
400 + var pathname;
401 + if (parentIsPlain) {
402 + // resolving to a plain parent -> skip standard URL prefix, and treat entire parent as pathname
403 + if (parentUrl === undefined)
404 + throwResolveError(relUrl, parentUrl);
405 + pathname = parentUrl;
406 + }
407 + else if (parentUrl[parentProtocol.length + 1] === '/') {
408 + // resolving to a :// so we need to read out the auth and host
409 + if (parentProtocol !== 'file:') {
410 + pathname = parentUrl.substr(parentProtocol.length + 2);
411 + pathname = pathname.substr(pathname.indexOf('/') + 1);
412 + }
413 + else {
414 + pathname = parentUrl.substr(8);
415 + }
416 + }
417 + else {
418 + // resolving to :/ so pathname is the /... part
419 + pathname = parentUrl.substr(parentProtocol.length + 1);
420 + }
421 +
422 + if (firstChar === '/') {
423 + if (parentIsPlain)
424 + throwResolveError(relUrl, parentUrl);
425 + else
426 + return parentUrl.substr(0, parentUrl.length - pathname.length - 1) + relUrl;
427 + }
428 +
429 + // join together and split for removal of .. and . segments
430 + // looping the string instead of anything fancy for perf reasons
431 + // '../../../../../z' resolved to 'x/y' is just 'z' regardless of parentIsPlain
432 + var segmented = pathname.substr(0, pathname.lastIndexOf('/') + 1) + relUrl;
433 +
434 + var output = [];
435 + var segmentIndex = -1;
436 +
437 + for (var i = 0; i < segmented.length; i++) {
438 + // busy reading a segment - only terminate on '/'
439 + if (segmentIndex !== -1) {
440 + if (segmented[i] === '/') {
441 + output.push(segmented.substring(segmentIndex, i + 1));
442 + segmentIndex = -1;
443 + }
444 + continue;
445 + }
446 +
447 + // new segment - check if it is relative
448 + if (segmented[i] === '.') {
449 + // ../ segment
450 + if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {
451 + output.pop();
452 + i += 2;
453 + }
454 + // ./ segment
455 + else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {
456 + i += 1;
457 + }
458 + else {
459 + // the start of a new segment as below
460 + segmentIndex = i;
461 + continue;
462 + }
463 +
464 + // this is the plain URI backtracking error (../, package:x -> error)
465 + if (parentIsPlain && output.length === 0)
466 + throwResolveError(relUrl, parentUrl);
467 +
468 + continue;
469 + }
470 +
471 + // it is the start of a new segment
472 + segmentIndex = i;
473 + }
474 + // finish reading out the last segment
475 + if (segmentIndex !== -1)
476 + output.push(segmented.substr(segmentIndex));
477 +
478 + return parentUrl.substr(0, parentUrl.length - pathname.length) + output.join('');
479 + }
480 +
481 + // sanitizes and verifies (by returning undefined if not a valid URL-like form)
482 + // Windows filepath compatibility is an added convenience here
483 + var protocolIndex = relUrl.indexOf(':');
484 + if (protocolIndex !== -1) {
485 + if (isNode) {
486 + // C:\x becomes file:///c:/x (we don't support C|\x)
487 + if (relUrl[1] === ':' && relUrl[2] === '\\' && relUrl[0].match(/[a-z]/i))
488 + return 'file:///' + relUrl.replace(backslashRegEx, '/');
489 + }
490 + return relUrl;
491 + }
492 +}
493 +
494 +var resolvedPromise = Promise.resolve();
495 +/*
496 + * Register Loader
497 + *
498 + * Builds directly on top of loader polyfill to provide:
499 + * - loader.register support
500 + * - hookable higher-level resolve
501 + * - instantiate hook returning a ModuleNamespace or undefined for es module loading
502 + * - loader error behaviour as in HTML and loader specs, caching load and eval errors separately
503 + * - build tracing support by providing a .trace=true and .loads object format
504 + */
505 +
506 +var REGISTER_INTERNAL = createSymbol('register-internal');
507 +
508 +function RegisterLoader$1 () {
509 + Loader.call(this);
510 +
511 + var registryDelete = this.registry.delete;
512 + this.registry.delete = function (key) {
513 + var deleted = registryDelete.call(this, key);
514 +
515 + // also delete from register registry if linked
516 + if (records.hasOwnProperty(key) && !records[key].linkRecord) {
517 + delete records[key];
518 + deleted = true;
519 + }
520 +
521 + return deleted;
522 + };
523 +
524 + var records = {};
525 +
526 + this[REGISTER_INTERNAL] = {
527 + // last anonymous System.register call
528 + lastRegister: undefined,
529 + // in-flight es module load records
530 + records: records
531 + };
532 +
533 + // tracing
534 + this.trace = false;
535 +}
536 +
537 +RegisterLoader$1.prototype = Object.create(Loader.prototype);
538 +RegisterLoader$1.prototype.constructor = RegisterLoader$1;
539 +
540 +var INSTANTIATE = RegisterLoader$1.instantiate = createSymbol('instantiate');
541 +
542 +// default normalize is the WhatWG style normalizer
543 +RegisterLoader$1.prototype[RegisterLoader$1.resolve = Loader.resolve] = function (key, parentKey) {
544 + return resolveIfNotPlain(key, parentKey || baseURI);
545 +};
546 +
547 +RegisterLoader$1.prototype[INSTANTIATE] = function (key, processAnonRegister) {};
548 +
549 +// once evaluated, the linkRecord is set to undefined leaving just the other load record properties
550 +// this allows tracking new binding listeners for es modules through importerSetters
551 +// for dynamic modules, the load record is removed entirely.
552 +function createLoadRecord (state, key, registration) {
553 + return state.records[key] = {
554 + key: key,
555 +
556 + // defined System.register cache
557 + registration: registration,
558 +
559 + // module namespace object
560 + module: undefined,
561 +
562 + // es-only
563 + // this sticks around so new module loads can listen to binding changes
564 + // for already-loaded modules by adding themselves to their importerSetters
565 + importerSetters: undefined,
566 +
567 + loadError: undefined,
568 + evalError: undefined,
569 +
570 + // in-flight linking record
571 + linkRecord: {
572 + // promise for instantiated
573 + instantiatePromise: undefined,
574 + dependencies: undefined,
575 + execute: undefined,
576 + executingRequire: false,
577 +
578 + // underlying module object bindings
579 + moduleObj: undefined,
580 +
581 + // es only, also indicates if es or not
582 + setters: undefined,
583 +
584 + // promise for instantiated dependencies (dependencyInstantiations populated)
585 + depsInstantiatePromise: undefined,
586 + // will be the array of dependency load record or a module namespace
587 + dependencyInstantiations: undefined,
588 +
589 + // top-level await!
590 + evaluatePromise: undefined,
591 +
592 + // NB optimization and way of ensuring module objects in setters
593 + // indicates setters which should run pre-execution of that dependency
594 + // setters is then just for completely executed module objects
595 + // alternatively we just pass the partially filled module objects as
596 + // arguments into the execute function
597 + // hoisted: undefined
598 + }
599 + };
600 +}
601 +
602 +RegisterLoader$1.prototype[Loader.resolveInstantiate] = function (key, parentKey) {
603 + var loader = this;
604 + var state = this[REGISTER_INTERNAL];
605 + var registry = this.registry[REGISTRY];
606 +
607 + return resolveInstantiate(loader, key, parentKey, registry, state)
608 + .then(function (instantiated) {
609 + if (instantiated instanceof ModuleNamespace || instantiated[toStringTag] === 'module')
610 + return instantiated;
611 +
612 + // resolveInstantiate always returns a load record with a link record and no module value
613 + var link = instantiated.linkRecord;
614 +
615 + // if already beaten to done, return
616 + if (!link) {
617 + if (instantiated.module)
618 + return instantiated.module;
619 + throw instantiated.evalError;
620 + }
621 +
622 + return deepInstantiateDeps(loader, instantiated, link, registry, state)
623 + .then(function () {
624 + return ensureEvaluate(loader, instantiated, link, registry, state);
625 + });
626 + });
627 +};
628 +
629 +function resolveInstantiate (loader, key, parentKey, registry, state) {
630 + // normalization shortpath for already-normalized key
631 + // could add a plain name filter, but doesn't yet seem necessary for perf
632 + var module = registry[key];
633 + if (module)
634 + return Promise.resolve(module);
635 +
636 + var load = state.records[key];
637 +
638 + // already linked but not in main registry is ignored
639 + if (load && !load.module) {
640 + if (load.loadError)
641 + return Promise.reject(load.loadError);
642 + return instantiate(loader, load, load.linkRecord, registry, state);
643 + }
644 +
645 + return loader.resolve(key, parentKey)
646 + .then(function (resolvedKey) {
647 + // main loader registry always takes preference
648 + module = registry[resolvedKey];
649 + if (module)
650 + return module;
651 +
652 + load = state.records[resolvedKey];
653 +
654 + // already has a module value but not already in the registry (load.module)
655 + // means it was removed by registry.delete, so we should
656 + // disgard the current load record creating a new one over it
657 + // but keep any existing registration
658 + if (!load || load.module)
659 + load = createLoadRecord(state, resolvedKey, load && load.registration);
660 +
661 + if (load.loadError)
662 + return Promise.reject(load.loadError);
663 +
664 + var link = load.linkRecord;
665 + if (!link)
666 + return load;
667 +
668 + return instantiate(loader, load, link, registry, state);
669 + });
670 +}
671 +
672 +function createProcessAnonRegister (loader, load, state) {
673 + return function () {
674 + var lastRegister = state.lastRegister;
675 +
676 + if (!lastRegister)
677 + return !!load.registration;
678 +
679 + state.lastRegister = undefined;
680 + load.registration = lastRegister;
681 +
682 + return true;
683 + };
684 +}
685 +
686 +function instantiate (loader, load, link, registry, state) {
687 + return link.instantiatePromise || (link.instantiatePromise =
688 + // if there is already an existing registration, skip running instantiate
689 + (load.registration ? resolvedPromise : resolvedPromise.then(function () {
690 + state.lastRegister = undefined;
691 + return loader[INSTANTIATE](load.key, loader[INSTANTIATE].length > 1 && createProcessAnonRegister(loader, load, state));
692 + }))
693 + .then(function (instantiation) {
694 + // direct module return from instantiate -> we're done
695 + if (instantiation !== undefined) {
696 + if (!(instantiation instanceof ModuleNamespace || instantiation[toStringTag] === 'module'))
697 + throw new TypeError('Instantiate did not return a valid Module object.');
698 +
699 + delete state.records[load.key];
700 + if (loader.trace)
701 + traceLoad(loader, load, link);
702 + return registry[load.key] = instantiation;
703 + }
704 +
705 + // run the cached loader.register declaration if there is one
706 + var registration = load.registration;
707 + // clear to allow new registrations for future loads (combined with registry delete)
708 + load.registration = undefined;
709 + if (!registration)
710 + throw new TypeError('Module instantiation did not call an anonymous or correctly named System.register.');
711 +
712 + link.dependencies = registration[0];
713 +
714 + load.importerSetters = [];
715 +
716 + link.moduleObj = {};
717 +
718 + // process System.registerDynamic declaration
719 + if (registration[2]) {
720 + link.moduleObj.default = link.moduleObj.__useDefault = {};
721 + link.executingRequire = registration[1];
722 + link.execute = registration[2];
723 + }
724 +
725 + // process System.register declaration
726 + else {
727 + registerDeclarative(loader, load, link, registration[1]);
728 + }
729 +
730 + return load;
731 + })
732 + .catch(function (err) {
733 + load.linkRecord = undefined;
734 + throw load.loadError = load.loadError || LoaderError__Check_error_message_for_loader_stack(err, 'Instantiating ' + load.key);
735 + }));
736 +}
737 +
738 +// like resolveInstantiate, but returning load records for linking
739 +function resolveInstantiateDep (loader, key, parentKey, registry, state, traceDepMap) {
740 + // normalization shortpaths for already-normalized key
741 + // DISABLED to prioritise consistent resolver calls
742 + // could add a plain name filter, but doesn't yet seem necessary for perf
743 + /* var load = state.records[key];
744 + var module = registry[key];
745 +
746 + if (module) {
747 + if (traceDepMap)
748 + traceDepMap[key] = key;
749 +
750 + // registry authority check in case module was deleted or replaced in main registry
751 + if (load && load.module && load.module === module)
752 + return load;
753 + else
754 + return module;
755 + }
756 +
757 + // already linked but not in main registry is ignored
758 + if (load && !load.module) {
759 + if (traceDepMap)
760 + traceDepMap[key] = key;
761 + return instantiate(loader, load, load.linkRecord, registry, state);
762 + } */
763 + return loader.resolve(key, parentKey)
764 + .then(function (resolvedKey) {
765 + if (traceDepMap)
766 + traceDepMap[key] = resolvedKey;
767 +
768 + // normalization shortpaths for already-normalized key
769 + var load = state.records[resolvedKey];
770 + var module = registry[resolvedKey];
771 +
772 + // main loader registry always takes preference
773 + if (module && (!load || load.module && module !== load.module))
774 + return module;
775 +
776 + if (load && load.loadError)
777 + throw load.loadError;
778 +
779 + // already has a module value but not already in the registry (load.module)
780 + // means it was removed by registry.delete, so we should
781 + // disgard the current load record creating a new one over it
782 + // but keep any existing registration
783 + if (!load || !module && load.module)
784 + load = createLoadRecord(state, resolvedKey, load && load.registration);
785 +
786 + var link = load.linkRecord;
787 + if (!link)
788 + return load;
789 +
790 + return instantiate(loader, load, link, registry, state);
791 + });
792 +}
793 +
794 +function traceLoad (loader, load, link) {
795 + loader.loads = loader.loads || {};
796 + loader.loads[load.key] = {
797 + key: load.key,
798 + deps: link.dependencies,
799 + dynamicDeps: [],
800 + depMap: link.depMap || {}
801 + };
802 +}
803 +
804 +/*
805 + * Convert a CJS module.exports into a valid object for new Module:
806 + *
807 + * new Module(getEsModule(module.exports))
808 + *
809 + * Sets the default value to the module, while also reading off named exports carefully.
810 + */
811 +function registerDeclarative (loader, load, link, declare) {
812 + var moduleObj = link.moduleObj;
813 + var importerSetters = load.importerSetters;
814 +
815 + var definedExports = false;
816 +
817 + // closure especially not based on link to allow link record disposal
818 + var declared = declare.call(envGlobal, function (name, value) {
819 + if (typeof name === 'object') {
820 + var changed = false;
821 + for (var p in name) {
822 + value = name[p];
823 + if (p !== '__useDefault' && (!(p in moduleObj) || moduleObj[p] !== value)) {
824 + changed = true;
825 + moduleObj[p] = value;
826 + }
827 + }
828 + if (changed === false)
829 + return value;
830 + }
831 + else {
832 + if ((definedExports || name in moduleObj) && moduleObj[name] === value)
833 + return value;
834 + moduleObj[name] = value;
835 + }
836 +
837 + for (var i = 0; i < importerSetters.length; i++)
838 + importerSetters[i](moduleObj);
839 +
840 + return value;
841 + }, new ContextualLoader(loader, load.key));
842 +
843 + link.setters = declared.setters || [];
844 + link.execute = declared.execute;
845 + if (declared.exports) {
846 + link.moduleObj = moduleObj = declared.exports;
847 + definedExports = true;
848 + }
849 +}
850 +
851 +function instantiateDeps (loader, load, link, registry, state) {
852 + if (link.depsInstantiatePromise)
853 + return link.depsInstantiatePromise;
854 +
855 + var depsInstantiatePromises = Array(link.dependencies.length);
856 +
857 + for (var i = 0; i < link.dependencies.length; i++)
858 + depsInstantiatePromises[i] = resolveInstantiateDep(loader, link.dependencies[i], load.key, registry, state, loader.trace && link.depMap || (link.depMap = {}));
859 +
860 + var depsInstantiatePromise = Promise.all(depsInstantiatePromises)
861 + .then(function (dependencyInstantiations) {
862 + link.dependencyInstantiations = dependencyInstantiations;
863 +
864 + // run setters to set up bindings to instantiated dependencies
865 + if (link.setters) {
866 + for (var i = 0; i < dependencyInstantiations.length; i++) {
867 + var setter = link.setters[i];
868 + if (setter) {
869 + var instantiation = dependencyInstantiations[i];
870 +
871 + if (instantiation instanceof ModuleNamespace || instantiation[toStringTag] === 'module') {
872 + setter(instantiation);
873 + }
874 + else {
875 + if (instantiation.loadError)
876 + throw instantiation.loadError;
877 + setter(instantiation.module || instantiation.linkRecord.moduleObj);
878 + // this applies to both es and dynamic registrations
879 + if (instantiation.importerSetters)
880 + instantiation.importerSetters.push(setter);
881 + }
882 + }
883 + }
884 + }
885 +
886 + return load;
887 + });
888 +
889 + if (loader.trace)
890 + depsInstantiatePromise = depsInstantiatePromise.then(function () {
891 + traceLoad(loader, load, link);
892 + return load;
893 + });
894 +
895 + depsInstantiatePromise = depsInstantiatePromise.catch(function (err) {
896 + // throw up the instantiateDeps stack
897 + link.depsInstantiatePromise = undefined;
898 + throw LoaderError__Check_error_message_for_loader_stack(err, 'Loading ' + load.key);
899 + });
900 +
901 + depsInstantiatePromise.catch(function () {});
902 +
903 + return link.depsInstantiatePromise = depsInstantiatePromise;
904 +}
905 +
906 +function deepInstantiateDeps (loader, load, link, registry, state) {
907 + var seen = [];
908 + function addDeps (load, link) {
909 + if (!link)
910 + return resolvedPromise;
911 + if (seen.indexOf(load) !== -1)
912 + return resolvedPromise;
913 + seen.push(load);
914 +
915 + return instantiateDeps(loader, load, link, registry, state)
916 + .then(function () {
917 + var depPromises;
918 + for (var i = 0; i < link.dependencies.length; i++) {
919 + var depLoad = link.dependencyInstantiations[i];
920 + if (!(depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module')) {
921 + depPromises = depPromises || [];
922 + depPromises.push(addDeps(depLoad, depLoad.linkRecord));
923 + }
924 + }
925 + if (depPromises)
926 + return Promise.all(depPromises);
927 + });
928 + }
929 +
930 + return addDeps(load, link);
931 +}
932 +
933 +/*
934 + * System.register
935 + */
936 +RegisterLoader$1.prototype.register = function (key, deps, declare) {
937 + var state = this[REGISTER_INTERNAL];
938 +
939 + // anonymous modules get stored as lastAnon
940 + if (declare === undefined) {
941 + state.lastRegister = [key, deps, undefined];
942 + }
943 +
944 + // everything else registers into the register cache
945 + else {
946 + var load = state.records[key] || createLoadRecord(state, key, undefined);
947 + load.registration = [deps, declare, undefined];
948 + }
949 +};
950 +
951 +/*
952 + * System.registerDyanmic
953 + */
954 +RegisterLoader$1.prototype.registerDynamic = function (key, deps, executingRequire, execute) {
955 + var state = this[REGISTER_INTERNAL];
956 +
957 + // anonymous modules get stored as lastAnon
958 + if (typeof key !== 'string') {
959 + state.lastRegister = [key, deps, executingRequire];
960 + }
961 +
962 + // everything else registers into the register cache
963 + else {
964 + var load = state.records[key] || createLoadRecord(state, key, undefined);
965 + load.registration = [deps, executingRequire, execute];
966 + }
967 +};
968 +
969 +// ContextualLoader class
970 +// backwards-compatible with previous System.register context argument by exposing .id, .key
971 +function ContextualLoader (loader, key) {
972 + this.loader = loader;
973 + this.key = this.id = key;
974 + this.meta = {
975 + url: key
976 + // scriptElement: null
977 + };
978 +}
979 +/*ContextualLoader.prototype.constructor = function () {
980 + throw new TypeError('Cannot subclass the contextual loader only Reflect.Loader.');
981 +};*/
982 +ContextualLoader.prototype.import = function (key) {
983 + if (this.loader.trace)
984 + this.loader.loads[this.key].dynamicDeps.push(key);
985 + return this.loader.import(key, this.key);
986 +};
987 +/*ContextualLoader.prototype.resolve = function (key) {
988 + return this.loader.resolve(key, this.key);
989 +};*/
990 +
991 +function ensureEvaluate (loader, load, link, registry, state) {
992 + if (load.module)
993 + return load.module;
994 + if (load.evalError)
995 + throw load.evalError;
996 + if (link.evaluatePromise)
997 + return link.evaluatePromise;
998 +
999 + if (link.setters) {
1000 + var evaluatePromise = doEvaluateDeclarative(loader, load, link, registry, state, [load]);
1001 + if (evaluatePromise)
1002 + return evaluatePromise;
1003 + }
1004 + else {
1005 + doEvaluateDynamic(loader, load, link, registry, state, [load]);
1006 + }
1007 + return load.module;
1008 +}
1009 +
1010 +function makeDynamicRequire (loader, key, dependencies, dependencyInstantiations, registry, state, seen) {
1011 + // we can only require from already-known dependencies
1012 + return function (name) {
1013 + for (var i = 0; i < dependencies.length; i++) {
1014 + if (dependencies[i] === name) {
1015 + var depLoad = dependencyInstantiations[i];
1016 + var module;
1017 +
1018 + if (depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module') {
1019 + module = depLoad;
1020 + }
1021 + else {
1022 + if (depLoad.evalError)
1023 + throw depLoad.evalError;
1024 + if (depLoad.module === undefined && seen.indexOf(depLoad) === -1 && !depLoad.linkRecord.evaluatePromise) {
1025 + if (depLoad.linkRecord.setters) {
1026 + doEvaluateDeclarative(loader, depLoad, depLoad.linkRecord, registry, state, [depLoad]);
1027 + }
1028 + else {
1029 + seen.push(depLoad);
1030 + doEvaluateDynamic(loader, depLoad, depLoad.linkRecord, registry, state, seen);
1031 + }
1032 + }
1033 + module = depLoad.module || depLoad.linkRecord.moduleObj;
1034 + }
1035 +
1036 + return '__useDefault' in module ? module.__useDefault : module;
1037 + }
1038 + }
1039 + throw new Error('Module ' + name + ' not declared as a System.registerDynamic dependency of ' + key);
1040 + };
1041 +}
1042 +
1043 +function evalError (load, err) {
1044 + load.linkRecord = undefined;
1045 + var evalError = LoaderError__Check_error_message_for_loader_stack(err, 'Evaluating ' + load.key);
1046 + if (load.evalError === undefined)
1047 + load.evalError = evalError;
1048 + throw evalError;
1049 +}
1050 +
1051 +// es modules evaluate dependencies first
1052 +// returns the error if any
1053 +function doEvaluateDeclarative (loader, load, link, registry, state, seen) {
1054 + var depLoad, depLink;
1055 + var depLoadPromises;
1056 + for (var i = 0; i < link.dependencies.length; i++) {
1057 + var depLoad = link.dependencyInstantiations[i];
1058 + if (depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module')
1059 + continue;
1060 +
1061 + // custom Module returned from instantiate
1062 + depLink = depLoad.linkRecord;
1063 + if (depLink) {
1064 + if (depLoad.evalError) {
1065 + evalError(load, depLoad.evalError);
1066 + }
1067 + else if (depLink.setters) {
1068 + if (seen.indexOf(depLoad) === -1) {
1069 + seen.push(depLoad);
1070 + try {
1071 + var depLoadPromise = doEvaluateDeclarative(loader, depLoad, depLink, registry, state, seen);
1072 + }
1073 + catch (e) {
1074 + evalError(load, e);
1075 + }
1076 + if (depLoadPromise) {
1077 + depLoadPromises = depLoadPromises || [];
1078 + depLoadPromises.push(depLoadPromise.catch(function (err) {
1079 + evalError(load, err);
1080 + }));
1081 + }
1082 + }
1083 + }
1084 + else {
1085 + try {
1086 + doEvaluateDynamic(loader, depLoad, depLink, registry, state, [depLoad]);
1087 + }
1088 + catch (e) {
1089 + evalError(load, e);
1090 + }
1091 + }
1092 + }
1093 + }
1094 +
1095 + if (depLoadPromises)
1096 + return link.evaluatePromise = Promise.all(depLoadPromises)
1097 + .then(function () {
1098 + if (link.execute) {
1099 + // ES System.register execute
1100 + // "this" is null in ES
1101 + try {
1102 + var execPromise = link.execute.call(nullContext);
1103 + }
1104 + catch (e) {
1105 + evalError(load, e);
1106 + }
1107 + if (execPromise)
1108 + return execPromise.catch(function (e) {
1109 + evalError(load, e);
1110 + })
1111 + .then(function () {
1112 + load.linkRecord = undefined;
1113 + return registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);
1114 + });
1115 + }
1116 +
1117 + // dispose link record
1118 + load.linkRecord = undefined;
1119 + registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);
1120 + });
1121 +
1122 + if (link.execute) {
1123 + // ES System.register execute
1124 + // "this" is null in ES
1125 + try {
1126 + var execPromise = link.execute.call(nullContext);
1127 + }
1128 + catch (e) {
1129 + evalError(load, e);
1130 + }
1131 + if (execPromise)
1132 + return link.evaluatePromise = execPromise.catch(function (e) {
1133 + evalError(load, e);
1134 + })
1135 + .then(function () {
1136 + load.linkRecord = undefined;
1137 + return registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);
1138 + });
1139 + }
1140 +
1141 + // dispose link record
1142 + load.linkRecord = undefined;
1143 + registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);
1144 +}
1145 +
1146 +// non es modules explicitly call moduleEvaluate through require
1147 +function doEvaluateDynamic (loader, load, link, registry, state, seen) {
1148 + // System.registerDynamic execute
1149 + // "this" is "exports" in CJS
1150 + var module = { id: load.key };
1151 + var moduleObj = link.moduleObj;
1152 + Object.defineProperty(module, 'exports', {
1153 + configurable: true,
1154 + set: function (exports) {
1155 + moduleObj.default = moduleObj.__useDefault = exports;
1156 + },
1157 + get: function () {
1158 + return moduleObj.__useDefault;
1159 + }
1160 + });
1161 +
1162 + var require = makeDynamicRequire(loader, load.key, link.dependencies, link.dependencyInstantiations, registry, state, seen);
1163 +
1164 + // evaluate deps first
1165 + if (!link.executingRequire)
1166 + for (var i = 0; i < link.dependencies.length; i++)
1167 + require(link.dependencies[i]);
1168 +
1169 + try {
1170 + var output = link.execute.call(envGlobal, require, moduleObj.default, module);
1171 + if (output !== undefined)
1172 + module.exports = output;
1173 + }
1174 + catch (e) {
1175 + evalError(load, e);
1176 + }
1177 +
1178 + load.linkRecord = undefined;
1179 +
1180 + // pick up defineProperty calls to module.exports when we can
1181 + if (module.exports !== moduleObj.__useDefault)
1182 + moduleObj.default = moduleObj.__useDefault = module.exports;
1183 +
1184 + var moduleDefault = moduleObj.default;
1185 +
1186 + // __esModule flag extension support via lifting
1187 + if (moduleDefault && moduleDefault.__esModule) {
1188 + for (var p in moduleDefault) {
1189 + if (Object.hasOwnProperty.call(moduleDefault, p))
1190 + moduleObj[p] = moduleDefault[p];
1191 + }
1192 + }
1193 +
1194 + registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);
1195 +
1196 + // run importer setters and clear them
1197 + // this allows dynamic modules to update themselves into es modules
1198 + // as soon as execution has completed
1199 + if (load.importerSetters)
1200 + for (var i = 0; i < load.importerSetters.length; i++)
1201 + load.importerSetters[i](load.module);
1202 + load.importerSetters = undefined;
1203 +}
1204 +
1205 +// the closest we can get to call(undefined)
1206 +var nullContext = Object.create(null);
1207 +if (Object.freeze)
1208 + Object.freeze(nullContext);
1209 +
1210 +var loader;
1211 +
1212 +// <script type="module"> support
1213 +var anonSources = {};
1214 +if (typeof document != 'undefined' && document.getElementsByTagName) {
1215 + var handleError = function(err) {
1216 + // dispatch an error event so that we can display in errors in browsers
1217 + // that don't yet support unhandledrejection
1218 + if (window.onunhandledrejection === undefined) {
1219 + try {
1220 + var evt = new Event('error');
1221 + } catch (_eventError) {
1222 + var evt = document.createEvent('Event');
1223 + evt.initEvent('error', true, true);
1224 + }
1225 + evt.message = err.message;
1226 + if (err.fileName) {
1227 + evt.filename = err.fileName;
1228 + evt.lineno = err.lineNumber;
1229 + evt.colno = err.columnNumber;
1230 + } else if (err.sourceURL) {
1231 + evt.filename = err.sourceURL;
1232 + evt.lineno = err.line;
1233 + evt.colno = err.column;
1234 + }
1235 + evt.error = err;
1236 + window.dispatchEvent(evt);
1237 + }
1238 +
1239 + // throw so it still shows up in the console
1240 + throw err;
1241 + };
1242 +
1243 + var ready = function() {
1244 + document.removeEventListener('DOMContentLoaded', ready, false );
1245 +
1246 + var anonCnt = 0;
1247 +
1248 + var scripts = document.getElementsByTagName('script');
1249 + for (var i = 0; i < scripts.length; i++) {
1250 + var script = scripts[i];
1251 + if (script.type == 'module' && !script.loaded) {
1252 + script.loaded = true;
1253 + if (script.src) {
1254 + loader.import(script.src).catch(handleError);
1255 + }
1256 + // anonymous modules supported via a custom naming scheme and registry
1257 + else {
1258 + var uri = './<anon' + ++anonCnt + '>.js';
1259 + if (script.id !== ""){
1260 + uri = "./" + script.id;
1261 + }
1262 +
1263 + var anonName = resolveIfNotPlain(uri, baseURI);
1264 + anonSources[anonName] = script.innerHTML;
1265 + loader.import(anonName).catch(handleError);
1266 + }
1267 + }
1268 + }
1269 + };
1270 +
1271 + // simple DOM ready
1272 + if (document.readyState !== 'loading')
1273 + setTimeout(ready);
1274 + else
1275 + document.addEventListener('DOMContentLoaded', ready, false);
1276 +}
1277 +
1278 +function BrowserESModuleLoader(baseKey) {
1279 + if (baseKey)
1280 + this.baseKey = resolveIfNotPlain(baseKey, baseURI) || resolveIfNotPlain('./' + baseKey, baseURI);
1281 +
1282 + RegisterLoader$1.call(this);
1283 +
1284 + var loader = this;
1285 +
1286 + // ensure System.register is available
1287 + envGlobal.System = envGlobal.System || {};
1288 + if (typeof envGlobal.System.register == 'function')
1289 + var prevRegister = envGlobal.System.register;
1290 + envGlobal.System.register = function() {
1291 + loader.register.apply(loader, arguments);
1292 + if (prevRegister)
1293 + prevRegister.apply(this, arguments);
1294 + };
1295 +}
1296 +BrowserESModuleLoader.prototype = Object.create(RegisterLoader$1.prototype);
1297 +
1298 +// normalize is never given a relative name like "./x", that part is already handled
1299 +BrowserESModuleLoader.prototype[RegisterLoader$1.resolve] = function(key, parent) {
1300 + var resolved = RegisterLoader$1.prototype[RegisterLoader$1.resolve].call(this, key, parent || this.baseKey) || key;
1301 + if (!resolved)
1302 + throw new RangeError('ES module loader does not resolve plain module names, resolving "' + key + '" to ' + parent);
1303 +
1304 + return resolved;
1305 +};
1306 +
1307 +function xhrFetch(url, resolve, reject) {
1308 + var xhr = new XMLHttpRequest();
1309 + var load = function(source) {
1310 + resolve(xhr.responseText);
1311 + };
1312 + var error = function() {
1313 + reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url));
1314 + };
1315 +
1316 + xhr.onreadystatechange = function () {
1317 + if (xhr.readyState === 4) {
1318 + // in Chrome on file:/// URLs, status is 0
1319 + if (xhr.status == 0) {
1320 + if (xhr.responseText) {
1321 + load();
1322 + }
1323 + else {
1324 + // when responseText is empty, wait for load or error event
1325 + // to inform if it is a 404 or empty file
1326 + xhr.addEventListener('error', error);
1327 + xhr.addEventListener('load', load);
1328 + }
1329 + }
1330 + else if (xhr.status === 200) {
1331 + load();
1332 + }
1333 + else {
1334 + error();
1335 + }
1336 + }
1337 + };
1338 + xhr.open("GET", url, true);
1339 + xhr.send(null);
1340 +}
1341 +
1342 +var WorkerPool = function (script, size) {
1343 + var current = document.currentScript;
1344 + // IE doesn't support currentScript
1345 + if (!current) {
1346 + // Find an entry with out basename
1347 + var scripts = document.getElementsByTagName('script');
1348 + for (var i = 0; i < scripts.length; i++) {
1349 + if (scripts[i].src.indexOf("browser-es-module-loader.js") !== -1) {
1350 + current = scripts[i];
1351 + break;
1352 + }
1353 + }
1354 + if (!current)
1355 + throw Error("Could not find own <script> element");
1356 + }
1357 + script = current.src.substr(0, current.src.lastIndexOf("/")) + "/" + script;
1358 + this._workers = new Array(size);
1359 + this._ind = 0;
1360 + this._size = size;
1361 + this._jobs = 0;
1362 + this.onmessage = undefined;
1363 + this._stopTimeout = undefined;
1364 + for (var i = 0; i < size; i++) {
1365 + var wrkr = new Worker(script);
1366 + wrkr._count = 0;
1367 + wrkr._ind = i;
1368 + wrkr.onmessage = this._onmessage.bind(this, wrkr);
1369 + wrkr.onerror = this._onerror.bind(this);
1370 + this._workers[i] = wrkr;
1371 + }
1372 +
1373 + this._checkJobs();
1374 +};
1375 +WorkerPool.prototype = {
1376 + postMessage: function (msg) {
1377 + if (this._stopTimeout !== undefined) {
1378 + clearTimeout(this._stopTimeout);
1379 + this._stopTimeout = undefined;
1380 + }
1381 + var wrkr = this._workers[this._ind % this._size];
1382 + wrkr._count++;
1383 + this._jobs++;
1384 + wrkr.postMessage(msg);
1385 + this._ind++;
1386 + },
1387 +
1388 + _onmessage: function (wrkr, evt) {
1389 + wrkr._count--;
1390 + this._jobs--;
1391 + this.onmessage(evt, wrkr);
1392 + this._checkJobs();
1393 + },
1394 +
1395 + _onerror: function(err) {
1396 + try {
1397 + var evt = new Event('error');
1398 + } catch (_eventError) {
1399 + var evt = document.createEvent('Event');
1400 + evt.initEvent('error', true, true);
1401 + }
1402 + evt.message = err.message;
1403 + evt.filename = err.filename;
1404 + evt.lineno = err.lineno;
1405 + evt.colno = err.colno;
1406 + evt.error = err.error;
1407 + window.dispatchEvent(evt);
1408 + },
1409 +
1410 + _checkJobs: function () {
1411 + if (this._jobs === 0 && this._stopTimeout === undefined) {
1412 + // wait for 2s of inactivity before stopping (that should be enough for local loading)
1413 + this._stopTimeout = setTimeout(this._stop.bind(this), 2000);
1414 + }
1415 + },
1416 +
1417 + _stop: function () {
1418 + this._workers.forEach(function(wrkr) {
1419 + wrkr.terminate();
1420 + });
1421 + }
1422 +};
1423 +
1424 +var promiseMap = new Map();
1425 +var babelWorker = new WorkerPool('babel-worker.js', 3);
1426 +babelWorker.onmessage = function (evt) {
1427 + var promFuncs = promiseMap.get(evt.data.key);
1428 + promFuncs.resolve(evt.data);
1429 + promiseMap.delete(evt.data.key);
1430 +};
1431 +
1432 +// instantiate just needs to run System.register
1433 +// so we fetch the source, convert into the Babel System module format, then evaluate it
1434 +BrowserESModuleLoader.prototype[RegisterLoader$1.instantiate] = function(key, processAnonRegister) {
1435 + var loader = this;
1436 +
1437 + // load as ES with Babel converting into System.register
1438 + return new Promise(function(resolve, reject) {
1439 + // anonymous module
1440 + if (anonSources[key]) {
1441 + resolve(anonSources[key]);
1442 + anonSources[key] = undefined;
1443 + }
1444 + // otherwise we fetch
1445 + else {
1446 + xhrFetch(key, resolve, reject);
1447 + }
1448 + })
1449 + .then(function(source) {
1450 + // check our cache first
1451 + var cacheEntry = localStorage.getItem(key);
1452 + if (cacheEntry) {
1453 + cacheEntry = JSON.parse(cacheEntry);
1454 + // TODO: store a hash instead
1455 + if (cacheEntry.source === source) {
1456 + return Promise.resolve({key: key, code: cacheEntry.code, source: cacheEntry.source});
1457 + }
1458 + }
1459 + return new Promise(function (resolve, reject) {
1460 + promiseMap.set(key, {resolve: resolve, reject: reject});
1461 + babelWorker.postMessage({key: key, source: source});
1462 + });
1463 + }).then(function (data) {
1464 + // evaluate without require, exports and module variables
1465 + // we leave module in for now to allow module.require access
1466 + try {
1467 + var cacheEntry = JSON.stringify({source: data.source, code: data.code});
1468 + localStorage.setItem(key, cacheEntry);
1469 + } catch (e) {
1470 + if (window.console) {
1471 + window.console.warn('Unable to cache transpiled version of ' + key + ': ' + e);
1472 + }
1473 + }
1474 + (0, eval)(data.code + '\n//# sourceURL=' + data.key + '!transpiled');
1475 + processAnonRegister();
1476 + });
1477 +};
1478 +
1479 +// create a default loader instance in the browser
1480 +if (isBrowser)
1481 + loader = new BrowserESModuleLoader();
1482 +
1483 +return BrowserESModuleLoader;
1484 +
1485 +})));
1486 +//# sourceMappingURL=browser-es-module-loader.js.map
public/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js.map new
+1
@@ -0,0 +1 @@
1 +{"version":3,"file":"browser-es-module-loader.js","sources":["../../../node_modules/es-module-loader/core/common.js","../../../node_modules/es-module-loader/core/loader-polyfill.js","../../../node_modules/es-module-loader/core/resolve.js","../../../node_modules/es-module-loader/core/register-loader.js","../src/browser-es-module-loader.js"],"sourcesContent":["/*\r\n * Environment\r\n */\r\nexport var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';\r\nexport var isNode = typeof process !== 'undefined' && process.versions && process.versions.node;\r\nexport var isWindows = typeof process !== 'undefined' && typeof process.platform === 'string' && process.platform.match(/^win/);\r\n\r\nvar envGlobal = typeof self !== 'undefined' ? self : global;\r\nexport { envGlobal as global }\r\n\r\n/*\r\n * Simple Symbol() shim\r\n */\r\nvar hasSymbol = typeof Symbol !== 'undefined';\r\nexport function createSymbol (name) {\r\n return hasSymbol ? Symbol() : '@@' + name;\r\n}\r\n\r\nexport var toStringTag = hasSymbol && Symbol.toStringTag;\r\n\r\nexport function pathToFileUrl (filePath) {\r\n return 'file://' + (isWindows ? '/' : '') + (isWindows ? filePath.replace(/\\\\/g, '/') : filePath);\r\n}\r\n\r\nexport function fileUrlToPath (fileUrl) {\r\n if (fileUrl.substr(0, 7) !== 'file://')\r\n throw new RangeError(fileUrl + ' is not a valid file url');\r\n if (isWindows)\r\n return fileUrl.substr(8).replace(/\\\\/g, '/');\r\n else\r\n return fileUrl.substr(7);\r\n}\r\n\r\n/*\r\n * Environment baseURI\r\n */\r\nexport var baseURI;\r\n\r\n// environent baseURI detection\r\nif (typeof document != 'undefined' && document.getElementsByTagName) {\r\n baseURI = document.baseURI;\r\n\r\n if (!baseURI) {\r\n var bases = document.getElementsByTagName('base');\r\n baseURI = bases[0] && bases[0].href || window.location.href;\r\n }\r\n}\r\nelse if (typeof location != 'undefined') {\r\n baseURI = location.href;\r\n}\r\n\r\n// sanitize out the hash and querystring\r\nif (baseURI) {\r\n baseURI = baseURI.split('#')[0].split('?')[0];\r\n var slashIndex = baseURI.lastIndexOf('/');\r\n if (slashIndex !== -1)\r\n baseURI = baseURI.substr(0, slashIndex + 1);\r\n}\r\nelse if (typeof process !== 'undefined' && process.cwd) {\r\n baseURI = 'file://' + (isWindows ? '/' : '') + process.cwd();\r\n if (isWindows)\r\n baseURI = baseURI.replace(/\\\\/g, '/');\r\n}\r\nelse {\r\n throw new TypeError('No environment baseURI');\r\n}\r\n\r\n// ensure baseURI has trailing \"/\"\r\nif (baseURI[baseURI.length - 1] !== '/')\r\n baseURI += '/';\r\n\r\n/*\r\n * LoaderError with chaining for loader stacks\r\n */\r\nvar errArgs = new Error(0, '_').fileName == '_';\r\nfunction LoaderError__Check_error_message_for_loader_stack (childErr, newMessage) {\r\n // Convert file:/// URLs to paths in Node\r\n if (!isBrowser)\r\n newMessage = newMessage.replace(isWindows ? /file:\\/\\/\\//g : /file:\\/\\//g, '');\r\n\r\n var message = (childErr.message || childErr) + '\\n ' + newMessage;\r\n\r\n var err;\r\n if (errArgs && childErr.fileName)\r\n err = new Error(message, childErr.fileName, childErr.lineNumber);\r\n else\r\n err = new Error(message);\r\n\r\n\r\n var stack = childErr.originalErr ? childErr.originalErr.stack : childErr.stack;\r\n\r\n if (isNode)\r\n // node doesn't show the message otherwise\r\n err.stack = message + '\\n ' + stack;\r\n else\r\n err.stack = stack;\r\n\r\n err.originalErr = childErr.originalErr || childErr;\r\n\r\n return err;\r\n}\r\nexport { LoaderError__Check_error_message_for_loader_stack as addToError }\r\n","import { addToError, createSymbol, toStringTag } from './common.js';\r\n\r\nexport { Loader, ModuleNamespace, REGISTRY }\r\n\r\nvar resolvedPromise = Promise.resolve();\r\n\r\n/*\r\n * Simple Array values shim\r\n */\r\nfunction arrayValues (arr) {\r\n if (arr.values)\r\n return arr.values();\r\n\r\n if (typeof Symbol === 'undefined' || !Symbol.iterator)\r\n throw new Error('Symbol.iterator not supported in this browser');\r\n\r\n var iterable = {};\r\n iterable[Symbol.iterator] = function () {\r\n var keys = Object.keys(arr);\r\n var keyIndex = 0;\r\n return {\r\n next: function () {\r\n if (keyIndex < keys.length)\r\n return {\r\n value: arr[keys[keyIndex++]],\r\n done: false\r\n };\r\n else\r\n return {\r\n value: undefined,\r\n done: true\r\n };\r\n }\r\n };\r\n };\r\n return iterable;\r\n}\r\n\r\n/*\r\n * 3. Reflect.Loader\r\n *\r\n * We skip the entire native internal pipeline, just providing the bare API\r\n */\r\n// 3.1.1\r\nfunction Loader () {\r\n this.registry = new Registry();\r\n}\r\n// 3.3.1\r\nLoader.prototype.constructor = Loader;\r\n\r\nfunction ensureInstantiated (module) {\r\n if (module === undefined)\r\n return;\r\n if (module instanceof ModuleNamespace === false && module[toStringTag] !== 'module')\r\n throw new TypeError('Module instantiation did not return a valid namespace object.');\r\n return module;\r\n}\r\n\r\n// 3.3.2\r\nLoader.prototype.import = function (key, parent) {\r\n if (typeof key !== 'string')\r\n throw new TypeError('Loader import method must be passed a module key string');\r\n // custom resolveInstantiate combined hook for better perf\r\n var loader = this;\r\n return resolvedPromise\r\n .then(function () {\r\n return loader[RESOLVE_INSTANTIATE](key, parent);\r\n })\r\n .then(ensureInstantiated)\r\n //.then(Module.evaluate)\r\n .catch(function (err) {\r\n throw addToError(err, 'Loading ' + key + (parent ? ' from ' + parent : ''));\r\n });\r\n};\r\n// 3.3.3\r\nvar RESOLVE = Loader.resolve = createSymbol('resolve');\r\n\r\n/*\r\n * Combined resolve / instantiate hook\r\n *\r\n * Not in current reduced spec, but necessary to separate RESOLVE from RESOLVE + INSTANTIATE as described\r\n * in the spec notes of this repo to ensure that loader.resolve doesn't instantiate when not wanted.\r\n *\r\n * We implement RESOLVE_INSTANTIATE as a single hook instead of a separate INSTANTIATE in order to avoid\r\n * the need for double registry lookups as a performance optimization.\r\n */\r\nvar RESOLVE_INSTANTIATE = Loader.resolveInstantiate = createSymbol('resolveInstantiate');\r\n\r\n// default resolveInstantiate is just to call resolve and then get from the registry\r\n// this provides compatibility for the resolveInstantiate optimization\r\nLoader.prototype[RESOLVE_INSTANTIATE] = function (key, parent) {\r\n var loader = this;\r\n return loader.resolve(key, parent)\r\n .then(function (resolved) {\r\n return loader.registry.get(resolved);\r\n });\r\n};\r\n\r\nfunction ensureResolution (resolvedKey) {\r\n if (resolvedKey === undefined)\r\n throw new RangeError('No resolution found.');\r\n return resolvedKey;\r\n}\r\n\r\nLoader.prototype.resolve = function (key, parent) {\r\n var loader = this;\r\n return resolvedPromise\r\n .then(function() {\r\n return loader[RESOLVE](key, parent);\r\n })\r\n .then(ensureResolution)\r\n .catch(function (err) {\r\n throw addToError(err, 'Resolving ' + key + (parent ? ' to ' + parent : ''));\r\n });\r\n};\r\n\r\n// 3.3.4 (import without evaluate)\r\n// this is not documented because the use of deferred evaluation as in Module.evaluate is not\r\n// documented, as it is not considered a stable feature to be encouraged\r\n// Loader.prototype.load may well be deprecated if this stays disabled\r\n/* Loader.prototype.load = function (key, parent) {\r\n return Promise.resolve(this[RESOLVE_INSTANTIATE](key, parent || this.key))\r\n .catch(function (err) {\r\n throw addToError(err, 'Loading ' + key + (parent ? ' from ' + parent : ''));\r\n });\r\n}; */\r\n\r\n/*\r\n * 4. Registry\r\n *\r\n * Instead of structuring through a Map, just use a dictionary object\r\n * We throw for construction attempts so this doesn't affect the public API\r\n *\r\n * Registry has been adjusted to use Namespace objects over ModuleStatus objects\r\n * as part of simplifying loader API implementation\r\n */\r\nvar iteratorSupport = typeof Symbol !== 'undefined' && Symbol.iterator;\r\nvar REGISTRY = createSymbol('registry');\r\nfunction Registry() {\r\n this[REGISTRY] = {};\r\n}\r\n// 4.4.1\r\nif (iteratorSupport) {\r\n // 4.4.2\r\n Registry.prototype[Symbol.iterator] = function () {\r\n return this.entries()[Symbol.iterator]();\r\n };\r\n\r\n // 4.4.3\r\n Registry.prototype.entries = function () {\r\n var registry = this[REGISTRY];\r\n return arrayValues(Object.keys(registry).map(function (key) {\r\n return [key, registry[key]];\r\n }));\r\n };\r\n}\r\n\r\n// 4.4.4\r\nRegistry.prototype.keys = function () {\r\n return arrayValues(Object.keys(this[REGISTRY]));\r\n};\r\n// 4.4.5\r\nRegistry.prototype.values = function () {\r\n var registry = this[REGISTRY];\r\n return arrayValues(Object.keys(registry).map(function (key) {\r\n return registry[key];\r\n }));\r\n};\r\n// 4.4.6\r\nRegistry.prototype.get = function (key) {\r\n return this[REGISTRY][key];\r\n};\r\n// 4.4.7\r\nRegistry.prototype.set = function (key, namespace) {\r\n if (!(namespace instanceof ModuleNamespace || namespace[toStringTag] === 'module'))\r\n throw new Error('Registry must be set with an instance of Module Namespace');\r\n this[REGISTRY][key] = namespace;\r\n return this;\r\n};\r\n// 4.4.8\r\nRegistry.prototype.has = function (key) {\r\n return Object.hasOwnProperty.call(this[REGISTRY], key);\r\n};\r\n// 4.4.9\r\nRegistry.prototype.delete = function (key) {\r\n if (Object.hasOwnProperty.call(this[REGISTRY], key)) {\r\n delete this[REGISTRY][key];\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\n/*\r\n * Simple ModuleNamespace Exotic object based on a baseObject\r\n * We export this for allowing a fast-path for module namespace creation over Module descriptors\r\n */\r\n// var EVALUATE = createSymbol('evaluate');\r\nvar BASE_OBJECT = createSymbol('baseObject');\r\n\r\n// 8.3.1 Reflect.Module\r\n/*\r\n * Best-effort simplified non-spec implementation based on\r\n * a baseObject referenced via getters.\r\n *\r\n * Allows:\r\n *\r\n * loader.registry.set('x', new Module({ default: 'x' }));\r\n *\r\n * Optional evaluation function provides experimental Module.evaluate\r\n * support for non-executed modules in registry.\r\n */\r\nfunction ModuleNamespace (baseObject/*, evaluate*/) {\r\n Object.defineProperty(this, BASE_OBJECT, {\r\n value: baseObject\r\n });\r\n\r\n // evaluate defers namespace population\r\n /* if (evaluate) {\r\n Object.defineProperty(this, EVALUATE, {\r\n value: evaluate,\r\n configurable: true,\r\n writable: true\r\n });\r\n }\r\n else { */\r\n Object.keys(baseObject).forEach(extendNamespace, this);\r\n //}\r\n};\r\n// 8.4.2\r\nModuleNamespace.prototype = Object.create(null);\r\n\r\nif (toStringTag)\r\n Object.defineProperty(ModuleNamespace.prototype, toStringTag, {\r\n value: 'Module'\r\n });\r\n\r\nfunction extendNamespace (key) {\r\n Object.defineProperty(this, key, {\r\n enumerable: true,\r\n get: function () {\r\n return this[BASE_OBJECT][key];\r\n }\r\n });\r\n}\r\n\r\n/* function doEvaluate (evaluate, context) {\r\n try {\r\n evaluate.call(context);\r\n }\r\n catch (e) {\r\n return e;\r\n }\r\n}\r\n\r\n// 8.4.1 Module.evaluate... not documented or used because this is potentially unstable\r\nModule.evaluate = function (ns) {\r\n var evaluate = ns[EVALUATE];\r\n if (evaluate) {\r\n ns[EVALUATE] = undefined;\r\n var err = doEvaluate(evaluate);\r\n if (err) {\r\n // cache the error\r\n ns[EVALUATE] = function () {\r\n throw err;\r\n };\r\n throw err;\r\n }\r\n Object.keys(ns[BASE_OBJECT]).forEach(extendNamespace, ns);\r\n }\r\n // make chainable\r\n return ns;\r\n}; */\r\n","import { isNode } from './common.js';\r\n\r\n/*\r\n * Optimized URL normalization assuming a syntax-valid URL parent\r\n */\r\nfunction throwResolveError (relUrl, parentUrl) {\r\n throw new RangeError('Unable to resolve \"' + relUrl + '\" to ' + parentUrl);\r\n}\r\nvar backslashRegEx = /\\\\/g;\r\nexport function resolveIfNotPlain (relUrl, parentUrl) {\r\n if (relUrl[0] === ' ' || relUrl[relUrl.length - 1] === ' ')\r\n relUrl = relUrl.trim();\r\n var parentProtocol = parentUrl && parentUrl.substr(0, parentUrl.indexOf(':') + 1);\r\n\r\n var firstChar = relUrl[0];\r\n var secondChar = relUrl[1];\r\n\r\n // protocol-relative\r\n if (firstChar === '/' && secondChar === '/') {\r\n if (!parentProtocol)\r\n throwResolveError(relUrl, parentUrl);\r\n if (relUrl.indexOf('\\\\') !== -1)\r\n relUrl = relUrl.replace(backslashRegEx, '/');\r\n return parentProtocol + relUrl;\r\n }\r\n // relative-url\r\n else if (firstChar === '.' && (secondChar === '/' || secondChar === '.' && (relUrl[2] === '/' || relUrl.length === 2 && (relUrl += '/')) ||\r\n relUrl.length === 1 && (relUrl += '/')) ||\r\n firstChar === '/') {\r\n if (relUrl.indexOf('\\\\') !== -1)\r\n relUrl = relUrl.replace(backslashRegEx, '/');\r\n var parentIsPlain = !parentProtocol || parentUrl[parentProtocol.length] !== '/';\r\n\r\n // read pathname from parent if a URL\r\n // pathname taken to be part after leading \"/\"\r\n var pathname;\r\n if (parentIsPlain) {\r\n // resolving to a plain parent -> skip standard URL prefix, and treat entire parent as pathname\r\n if (parentUrl === undefined)\r\n throwResolveError(relUrl, parentUrl);\r\n pathname = parentUrl;\r\n }\r\n else if (parentUrl[parentProtocol.length + 1] === '/') {\r\n // resolving to a :// so we need to read out the auth and host\r\n if (parentProtocol !== 'file:') {\r\n pathname = parentUrl.substr(parentProtocol.length + 2);\r\n pathname = pathname.substr(pathname.indexOf('/') + 1);\r\n }\r\n else {\r\n pathname = parentUrl.substr(8);\r\n }\r\n }\r\n else {\r\n // resolving to :/ so pathname is the /... part\r\n pathname = parentUrl.substr(parentProtocol.length + 1);\r\n }\r\n\r\n if (firstChar === '/') {\r\n if (parentIsPlain)\r\n throwResolveError(relUrl, parentUrl);\r\n else\r\n return parentUrl.substr(0, parentUrl.length - pathname.length - 1) + relUrl;\r\n }\r\n\r\n // join together and split for removal of .. and . segments\r\n // looping the string instead of anything fancy for perf reasons\r\n // '../../../../../z' resolved to 'x/y' is just 'z' regardless of parentIsPlain\r\n var segmented = pathname.substr(0, pathname.lastIndexOf('/') + 1) + relUrl;\r\n\r\n var output = [];\r\n var segmentIndex = -1;\r\n\r\n for (var i = 0; i < segmented.length; i++) {\r\n // busy reading a segment - only terminate on '/'\r\n if (segmentIndex !== -1) {\r\n if (segmented[i] === '/') {\r\n output.push(segmented.substring(segmentIndex, i + 1));\r\n segmentIndex = -1;\r\n }\r\n continue;\r\n }\r\n\r\n // new segment - check if it is relative\r\n if (segmented[i] === '.') {\r\n // ../ segment\r\n if (segmented[i + 1] === '.' && (segmented[i + 2] === '/' || i + 2 === segmented.length)) {\r\n output.pop();\r\n i += 2;\r\n }\r\n // ./ segment\r\n else if (segmented[i + 1] === '/' || i + 1 === segmented.length) {\r\n i += 1;\r\n }\r\n else {\r\n // the start of a new segment as below\r\n segmentIndex = i;\r\n continue;\r\n }\r\n\r\n // this is the plain URI backtracking error (../, package:x -> error)\r\n if (parentIsPlain && output.length === 0)\r\n throwResolveError(relUrl, parentUrl);\r\n\r\n continue;\r\n }\r\n\r\n // it is the start of a new segment\r\n segmentIndex = i;\r\n }\r\n // finish reading out the last segment\r\n if (segmentIndex !== -1)\r\n output.push(segmented.substr(segmentIndex));\r\n\r\n return parentUrl.substr(0, parentUrl.length - pathname.length) + output.join('');\r\n }\r\n\r\n // sanitizes and verifies (by returning undefined if not a valid URL-like form)\r\n // Windows filepath compatibility is an added convenience here\r\n var protocolIndex = relUrl.indexOf(':');\r\n if (protocolIndex !== -1) {\r\n if (isNode) {\r\n // C:\\x becomes file:///c:/x (we don't support C|\\x)\r\n if (relUrl[1] === ':' && relUrl[2] === '\\\\' && relUrl[0].match(/[a-z]/i))\r\n return 'file:///' + relUrl.replace(backslashRegEx, '/');\r\n }\r\n return relUrl;\r\n }\r\n}\r\n","import { Loader, ModuleNamespace, REGISTRY } from './loader-polyfill.js';\r\nimport { resolveIfNotPlain } from './resolve.js';\r\nimport { addToError, global, createSymbol, baseURI, toStringTag } from './common.js';\r\n\r\nexport default RegisterLoader;\r\n\r\nvar resolvedPromise = Promise.resolve();\r\nvar emptyArray = [];\r\n\r\n/*\r\n * Register Loader\r\n *\r\n * Builds directly on top of loader polyfill to provide:\r\n * - loader.register support\r\n * - hookable higher-level resolve\r\n * - instantiate hook returning a ModuleNamespace or undefined for es module loading\r\n * - loader error behaviour as in HTML and loader specs, caching load and eval errors separately\r\n * - build tracing support by providing a .trace=true and .loads object format\r\n */\r\n\r\nvar REGISTER_INTERNAL = createSymbol('register-internal');\r\n\r\nfunction RegisterLoader () {\r\n Loader.call(this);\r\n\r\n var registryDelete = this.registry.delete;\r\n this.registry.delete = function (key) {\r\n var deleted = registryDelete.call(this, key);\r\n\r\n // also delete from register registry if linked\r\n if (records.hasOwnProperty(key) && !records[key].linkRecord) {\r\n delete records[key];\r\n deleted = true;\r\n }\r\n\r\n return deleted;\r\n };\r\n\r\n var records = {};\r\n\r\n this[REGISTER_INTERNAL] = {\r\n // last anonymous System.register call\r\n lastRegister: undefined,\r\n // in-flight es module load records\r\n records: records\r\n };\r\n\r\n // tracing\r\n this.trace = false;\r\n}\r\n\r\nRegisterLoader.prototype = Object.create(Loader.prototype);\r\nRegisterLoader.prototype.constructor = RegisterLoader;\r\n\r\nvar INSTANTIATE = RegisterLoader.instantiate = createSymbol('instantiate');\r\n\r\n// default normalize is the WhatWG style normalizer\r\nRegisterLoader.prototype[RegisterLoader.resolve = Loader.resolve] = function (key, parentKey) {\r\n return resolveIfNotPlain(key, parentKey || baseURI);\r\n};\r\n\r\nRegisterLoader.prototype[INSTANTIATE] = function (key, processAnonRegister) {};\r\n\r\n// once evaluated, the linkRecord is set to undefined leaving just the other load record properties\r\n// this allows tracking new binding listeners for es modules through importerSetters\r\n// for dynamic modules, the load record is removed entirely.\r\nfunction createLoadRecord (state, key, registration) {\r\n return state.records[key] = {\r\n key: key,\r\n\r\n // defined System.register cache\r\n registration: registration,\r\n\r\n // module namespace object\r\n module: undefined,\r\n\r\n // es-only\r\n // this sticks around so new module loads can listen to binding changes\r\n // for already-loaded modules by adding themselves to their importerSetters\r\n importerSetters: undefined,\r\n\r\n loadError: undefined,\r\n evalError: undefined,\r\n\r\n // in-flight linking record\r\n linkRecord: {\r\n // promise for instantiated\r\n instantiatePromise: undefined,\r\n dependencies: undefined,\r\n execute: undefined,\r\n executingRequire: false,\r\n\r\n // underlying module object bindings\r\n moduleObj: undefined,\r\n\r\n // es only, also indicates if es or not\r\n setters: undefined,\r\n\r\n // promise for instantiated dependencies (dependencyInstantiations populated)\r\n depsInstantiatePromise: undefined,\r\n // will be the array of dependency load record or a module namespace\r\n dependencyInstantiations: undefined,\r\n\r\n // top-level await!\r\n evaluatePromise: undefined,\r\n\r\n // NB optimization and way of ensuring module objects in setters\r\n // indicates setters which should run pre-execution of that dependency\r\n // setters is then just for completely executed module objects\r\n // alternatively we just pass the partially filled module objects as\r\n // arguments into the execute function\r\n // hoisted: undefined\r\n }\r\n };\r\n}\r\n\r\nRegisterLoader.prototype[Loader.resolveInstantiate] = function (key, parentKey) {\r\n var loader = this;\r\n var state = this[REGISTER_INTERNAL];\r\n var registry = this.registry[REGISTRY];\r\n\r\n return resolveInstantiate(loader, key, parentKey, registry, state)\r\n .then(function (instantiated) {\r\n if (instantiated instanceof ModuleNamespace || instantiated[toStringTag] === 'module')\r\n return instantiated;\r\n\r\n // resolveInstantiate always returns a load record with a link record and no module value\r\n var link = instantiated.linkRecord;\r\n\r\n // if already beaten to done, return\r\n if (!link) {\r\n if (instantiated.module)\r\n return instantiated.module;\r\n throw instantiated.evalError;\r\n }\r\n\r\n return deepInstantiateDeps(loader, instantiated, link, registry, state)\r\n .then(function () {\r\n return ensureEvaluate(loader, instantiated, link, registry, state);\r\n });\r\n });\r\n};\r\n\r\nfunction resolveInstantiate (loader, key, parentKey, registry, state) {\r\n // normalization shortpath for already-normalized key\r\n // could add a plain name filter, but doesn't yet seem necessary for perf\r\n var module = registry[key];\r\n if (module)\r\n return Promise.resolve(module);\r\n\r\n var load = state.records[key];\r\n\r\n // already linked but not in main registry is ignored\r\n if (load && !load.module) {\r\n if (load.loadError)\r\n return Promise.reject(load.loadError);\r\n return instantiate(loader, load, load.linkRecord, registry, state);\r\n }\r\n\r\n return loader.resolve(key, parentKey)\r\n .then(function (resolvedKey) {\r\n // main loader registry always takes preference\r\n module = registry[resolvedKey];\r\n if (module)\r\n return module;\r\n\r\n load = state.records[resolvedKey];\r\n\r\n // already has a module value but not already in the registry (load.module)\r\n // means it was removed by registry.delete, so we should\r\n // disgard the current load record creating a new one over it\r\n // but keep any existing registration\r\n if (!load || load.module)\r\n load = createLoadRecord(state, resolvedKey, load && load.registration);\r\n\r\n if (load.loadError)\r\n return Promise.reject(load.loadError);\r\n\r\n var link = load.linkRecord;\r\n if (!link)\r\n return load;\r\n\r\n return instantiate(loader, load, link, registry, state);\r\n });\r\n}\r\n\r\nfunction createProcessAnonRegister (loader, load, state) {\r\n return function () {\r\n var lastRegister = state.lastRegister;\r\n\r\n if (!lastRegister)\r\n return !!load.registration;\r\n\r\n state.lastRegister = undefined;\r\n load.registration = lastRegister;\r\n\r\n return true;\r\n };\r\n}\r\n\r\nfunction instantiate (loader, load, link, registry, state) {\r\n return link.instantiatePromise || (link.instantiatePromise =\r\n // if there is already an existing registration, skip running instantiate\r\n (load.registration ? resolvedPromise : resolvedPromise.then(function () {\r\n state.lastRegister = undefined;\r\n return loader[INSTANTIATE](load.key, loader[INSTANTIATE].length > 1 && createProcessAnonRegister(loader, load, state));\r\n }))\r\n .then(function (instantiation) {\r\n // direct module return from instantiate -> we're done\r\n if (instantiation !== undefined) {\r\n if (!(instantiation instanceof ModuleNamespace || instantiation[toStringTag] === 'module'))\r\n throw new TypeError('Instantiate did not return a valid Module object.');\r\n\r\n delete state.records[load.key];\r\n if (loader.trace)\r\n traceLoad(loader, load, link);\r\n return registry[load.key] = instantiation;\r\n }\r\n\r\n // run the cached loader.register declaration if there is one\r\n var registration = load.registration;\r\n // clear to allow new registrations for future loads (combined with registry delete)\r\n load.registration = undefined;\r\n if (!registration)\r\n throw new TypeError('Module instantiation did not call an anonymous or correctly named System.register.');\r\n\r\n link.dependencies = registration[0];\r\n\r\n load.importerSetters = [];\r\n\r\n link.moduleObj = {};\r\n\r\n // process System.registerDynamic declaration\r\n if (registration[2]) {\r\n link.moduleObj.default = link.moduleObj.__useDefault = {};\r\n link.executingRequire = registration[1];\r\n link.execute = registration[2];\r\n }\r\n\r\n // process System.register declaration\r\n else {\r\n registerDeclarative(loader, load, link, registration[1]);\r\n }\r\n\r\n return load;\r\n })\r\n .catch(function (err) {\r\n load.linkRecord = undefined;\r\n throw load.loadError = load.loadError || addToError(err, 'Instantiating ' + load.key);\r\n }));\r\n}\r\n\r\n// like resolveInstantiate, but returning load records for linking\r\nfunction resolveInstantiateDep (loader, key, parentKey, registry, state, traceDepMap) {\r\n // normalization shortpaths for already-normalized key\r\n // DISABLED to prioritise consistent resolver calls\r\n // could add a plain name filter, but doesn't yet seem necessary for perf\r\n /* var load = state.records[key];\r\n var module = registry[key];\r\n\r\n if (module) {\r\n if (traceDepMap)\r\n traceDepMap[key] = key;\r\n\r\n // registry authority check in case module was deleted or replaced in main registry\r\n if (load && load.module && load.module === module)\r\n return load;\r\n else\r\n return module;\r\n }\r\n\r\n // already linked but not in main registry is ignored\r\n if (load && !load.module) {\r\n if (traceDepMap)\r\n traceDepMap[key] = key;\r\n return instantiate(loader, load, load.linkRecord, registry, state);\r\n } */\r\n return loader.resolve(key, parentKey)\r\n .then(function (resolvedKey) {\r\n if (traceDepMap)\r\n traceDepMap[key] = resolvedKey;\r\n\r\n // normalization shortpaths for already-normalized key\r\n var load = state.records[resolvedKey];\r\n var module = registry[resolvedKey];\r\n\r\n // main loader registry always takes preference\r\n if (module && (!load || load.module && module !== load.module))\r\n return module;\r\n\r\n if (load && load.loadError)\r\n throw load.loadError;\r\n\r\n // already has a module value but not already in the registry (load.module)\r\n // means it was removed by registry.delete, so we should\r\n // disgard the current load record creating a new one over it\r\n // but keep any existing registration\r\n if (!load || !module && load.module)\r\n load = createLoadRecord(state, resolvedKey, load && load.registration);\r\n\r\n var link = load.linkRecord;\r\n if (!link)\r\n return load;\r\n\r\n return instantiate(loader, load, link, registry, state);\r\n });\r\n}\r\n\r\nfunction traceLoad (loader, load, link) {\r\n loader.loads = loader.loads || {};\r\n loader.loads[load.key] = {\r\n key: load.key,\r\n deps: link.dependencies,\r\n dynamicDeps: [],\r\n depMap: link.depMap || {}\r\n };\r\n}\r\n\r\n/*\r\n * Convert a CJS module.exports into a valid object for new Module:\r\n *\r\n * new Module(getEsModule(module.exports))\r\n *\r\n * Sets the default value to the module, while also reading off named exports carefully.\r\n */\r\nfunction registerDeclarative (loader, load, link, declare) {\r\n var moduleObj = link.moduleObj;\r\n var importerSetters = load.importerSetters;\r\n\r\n var definedExports = false;\r\n\r\n // closure especially not based on link to allow link record disposal\r\n var declared = declare.call(global, function (name, value) {\r\n if (typeof name === 'object') {\r\n var changed = false;\r\n for (var p in name) {\r\n value = name[p];\r\n if (p !== '__useDefault' && (!(p in moduleObj) || moduleObj[p] !== value)) {\r\n changed = true;\r\n moduleObj[p] = value;\r\n }\r\n }\r\n if (changed === false)\r\n return value;\r\n }\r\n else {\r\n if ((definedExports || name in moduleObj) && moduleObj[name] === value)\r\n return value;\r\n moduleObj[name] = value;\r\n }\r\n\r\n for (var i = 0; i < importerSetters.length; i++)\r\n importerSetters[i](moduleObj);\r\n\r\n return value;\r\n }, new ContextualLoader(loader, load.key));\r\n\r\n link.setters = declared.setters || [];\r\n link.execute = declared.execute;\r\n if (declared.exports) {\r\n link.moduleObj = moduleObj = declared.exports;\r\n definedExports = true;\r\n }\r\n}\r\n\r\nfunction instantiateDeps (loader, load, link, registry, state) {\r\n if (link.depsInstantiatePromise)\r\n return link.depsInstantiatePromise;\r\n\r\n var depsInstantiatePromises = Array(link.dependencies.length);\r\n\r\n for (var i = 0; i < link.dependencies.length; i++)\r\n depsInstantiatePromises[i] = resolveInstantiateDep(loader, link.dependencies[i], load.key, registry, state, loader.trace && link.depMap || (link.depMap = {}));\r\n\r\n var depsInstantiatePromise = Promise.all(depsInstantiatePromises)\r\n .then(function (dependencyInstantiations) {\r\n link.dependencyInstantiations = dependencyInstantiations;\r\n\r\n // run setters to set up bindings to instantiated dependencies\r\n if (link.setters) {\r\n for (var i = 0; i < dependencyInstantiations.length; i++) {\r\n var setter = link.setters[i];\r\n if (setter) {\r\n var instantiation = dependencyInstantiations[i];\r\n\r\n if (instantiation instanceof ModuleNamespace || instantiation[toStringTag] === 'module') {\r\n setter(instantiation);\r\n }\r\n else {\r\n if (instantiation.loadError)\r\n throw instantiation.loadError;\r\n setter(instantiation.module || instantiation.linkRecord.moduleObj);\r\n // this applies to both es and dynamic registrations\r\n if (instantiation.importerSetters)\r\n instantiation.importerSetters.push(setter);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return load;\r\n });\r\n\r\n if (loader.trace)\r\n depsInstantiatePromise = depsInstantiatePromise.then(function () {\r\n traceLoad(loader, load, link);\r\n return load;\r\n });\r\n\r\n depsInstantiatePromise = depsInstantiatePromise.catch(function (err) {\r\n // throw up the instantiateDeps stack\r\n link.depsInstantiatePromise = undefined;\r\n throw addToError(err, 'Loading ' + load.key);\r\n });\r\n\r\n depsInstantiatePromise.catch(function () {});\r\n\r\n return link.depsInstantiatePromise = depsInstantiatePromise;\r\n}\r\n\r\nfunction deepInstantiateDeps (loader, load, link, registry, state) {\r\n var seen = [];\r\n function addDeps (load, link) {\r\n if (!link)\r\n return resolvedPromise;\r\n if (seen.indexOf(load) !== -1)\r\n return resolvedPromise;\r\n seen.push(load);\r\n \r\n return instantiateDeps(loader, load, link, registry, state)\r\n .then(function () {\r\n var depPromises;\r\n for (var i = 0; i < link.dependencies.length; i++) {\r\n var depLoad = link.dependencyInstantiations[i];\r\n if (!(depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module')) {\r\n depPromises = depPromises || [];\r\n depPromises.push(addDeps(depLoad, depLoad.linkRecord));\r\n }\r\n }\r\n if (depPromises)\r\n return Promise.all(depPromises);\r\n });\r\n };\r\n\r\n return addDeps(load, link);\r\n}\r\n\r\n/*\r\n * System.register\r\n */\r\nRegisterLoader.prototype.register = function (key, deps, declare) {\r\n var state = this[REGISTER_INTERNAL];\r\n\r\n // anonymous modules get stored as lastAnon\r\n if (declare === undefined) {\r\n state.lastRegister = [key, deps, undefined];\r\n }\r\n\r\n // everything else registers into the register cache\r\n else {\r\n var load = state.records[key] || createLoadRecord(state, key, undefined);\r\n load.registration = [deps, declare, undefined];\r\n }\r\n};\r\n\r\n/*\r\n * System.registerDyanmic\r\n */\r\nRegisterLoader.prototype.registerDynamic = function (key, deps, executingRequire, execute) {\r\n var state = this[REGISTER_INTERNAL];\r\n\r\n // anonymous modules get stored as lastAnon\r\n if (typeof key !== 'string') {\r\n state.lastRegister = [key, deps, executingRequire];\r\n }\r\n\r\n // everything else registers into the register cache\r\n else {\r\n var load = state.records[key] || createLoadRecord(state, key, undefined);\r\n load.registration = [deps, executingRequire, execute];\r\n }\r\n};\r\n\r\n// ContextualLoader class\r\n// backwards-compatible with previous System.register context argument by exposing .id, .key\r\nfunction ContextualLoader (loader, key) {\r\n this.loader = loader;\r\n this.key = this.id = key;\r\n this.meta = {\r\n url: key\r\n // scriptElement: null\r\n };\r\n}\r\n/*ContextualLoader.prototype.constructor = function () {\r\n throw new TypeError('Cannot subclass the contextual loader only Reflect.Loader.');\r\n};*/\r\nContextualLoader.prototype.import = function (key) {\r\n if (this.loader.trace)\r\n this.loader.loads[this.key].dynamicDeps.push(key);\r\n return this.loader.import(key, this.key);\r\n};\r\n/*ContextualLoader.prototype.resolve = function (key) {\r\n return this.loader.resolve(key, this.key);\r\n};*/\r\n\r\nfunction ensureEvaluate (loader, load, link, registry, state) {\r\n if (load.module)\r\n return load.module;\r\n if (load.evalError)\r\n throw load.evalError;\r\n if (link.evaluatePromise)\r\n return link.evaluatePromise;\r\n\r\n if (link.setters) {\r\n var evaluatePromise = doEvaluateDeclarative(loader, load, link, registry, state, [load]);\r\n if (evaluatePromise)\r\n return evaluatePromise;\r\n }\r\n else {\r\n doEvaluateDynamic(loader, load, link, registry, state, [load]);\r\n }\r\n return load.module;\r\n}\r\n\r\nfunction makeDynamicRequire (loader, key, dependencies, dependencyInstantiations, registry, state, seen) {\r\n // we can only require from already-known dependencies\r\n return function (name) {\r\n for (var i = 0; i < dependencies.length; i++) {\r\n if (dependencies[i] === name) {\r\n var depLoad = dependencyInstantiations[i];\r\n var module;\r\n\r\n if (depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module') {\r\n module = depLoad;\r\n }\r\n else {\r\n if (depLoad.evalError)\r\n throw depLoad.evalError;\r\n if (depLoad.module === undefined && seen.indexOf(depLoad) === -1 && !depLoad.linkRecord.evaluatePromise) {\r\n if (depLoad.linkRecord.setters) {\r\n doEvaluateDeclarative(loader, depLoad, depLoad.linkRecord, registry, state, [depLoad]);\r\n }\r\n else {\r\n seen.push(depLoad);\r\n doEvaluateDynamic(loader, depLoad, depLoad.linkRecord, registry, state, seen);\r\n }\r\n }\r\n module = depLoad.module || depLoad.linkRecord.moduleObj;\r\n }\r\n\r\n return '__useDefault' in module ? module.__useDefault : module;\r\n }\r\n }\r\n throw new Error('Module ' + name + ' not declared as a System.registerDynamic dependency of ' + key);\r\n };\r\n}\r\n\r\nfunction evalError (load, err) {\r\n load.linkRecord = undefined;\r\n var evalError = addToError(err, 'Evaluating ' + load.key);\r\n if (load.evalError === undefined)\r\n load.evalError = evalError;\r\n throw evalError;\r\n}\r\n\r\n// es modules evaluate dependencies first\r\n// returns the error if any\r\nfunction doEvaluateDeclarative (loader, load, link, registry, state, seen) {\r\n var depLoad, depLink;\r\n var depLoadPromises;\r\n for (var i = 0; i < link.dependencies.length; i++) {\r\n var depLoad = link.dependencyInstantiations[i];\r\n if (depLoad instanceof ModuleNamespace || depLoad[toStringTag] === 'module')\r\n continue;\r\n\r\n // custom Module returned from instantiate\r\n depLink = depLoad.linkRecord;\r\n if (depLink) {\r\n if (depLoad.evalError) {\r\n evalError(load, depLoad.evalError);\r\n }\r\n else if (depLink.setters) {\r\n if (seen.indexOf(depLoad) === -1) {\r\n seen.push(depLoad);\r\n try {\r\n var depLoadPromise = doEvaluateDeclarative(loader, depLoad, depLink, registry, state, seen);\r\n }\r\n catch (e) {\r\n evalError(load, e);\r\n }\r\n if (depLoadPromise) {\r\n depLoadPromises = depLoadPromises || [];\r\n depLoadPromises.push(depLoadPromise.catch(function (err) {\r\n evalError(load, err);\r\n }));\r\n }\r\n }\r\n }\r\n else {\r\n try {\r\n doEvaluateDynamic(loader, depLoad, depLink, registry, state, [depLoad]);\r\n }\r\n catch (e) {\r\n evalError(load, e);\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (depLoadPromises)\r\n return link.evaluatePromise = Promise.all(depLoadPromises)\r\n .then(function () {\r\n if (link.execute) {\r\n // ES System.register execute\r\n // \"this\" is null in ES\r\n try {\r\n var execPromise = link.execute.call(nullContext);\r\n }\r\n catch (e) {\r\n evalError(load, e);\r\n }\r\n if (execPromise)\r\n return execPromise.catch(function (e) {\r\n evalError(load, e);\r\n })\r\n .then(function () {\r\n load.linkRecord = undefined;\r\n return registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);\r\n });\r\n }\r\n \r\n // dispose link record\r\n load.linkRecord = undefined;\r\n registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);\r\n });\r\n\r\n if (link.execute) {\r\n // ES System.register execute\r\n // \"this\" is null in ES\r\n try {\r\n var execPromise = link.execute.call(nullContext);\r\n }\r\n catch (e) {\r\n evalError(load, e);\r\n }\r\n if (execPromise)\r\n return link.evaluatePromise = execPromise.catch(function (e) {\r\n evalError(load, e);\r\n })\r\n .then(function () {\r\n load.linkRecord = undefined;\r\n return registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);\r\n });\r\n }\r\n\r\n // dispose link record\r\n load.linkRecord = undefined;\r\n registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);\r\n}\r\n\r\n// non es modules explicitly call moduleEvaluate through require\r\nfunction doEvaluateDynamic (loader, load, link, registry, state, seen) {\r\n // System.registerDynamic execute\r\n // \"this\" is \"exports\" in CJS\r\n var module = { id: load.key };\r\n var moduleObj = link.moduleObj;\r\n Object.defineProperty(module, 'exports', {\r\n configurable: true,\r\n set: function (exports) {\r\n moduleObj.default = moduleObj.__useDefault = exports;\r\n },\r\n get: function () {\r\n return moduleObj.__useDefault;\r\n }\r\n });\r\n\r\n var require = makeDynamicRequire(loader, load.key, link.dependencies, link.dependencyInstantiations, registry, state, seen);\r\n\r\n // evaluate deps first\r\n if (!link.executingRequire)\r\n for (var i = 0; i < link.dependencies.length; i++)\r\n require(link.dependencies[i]);\r\n\r\n try {\r\n var output = link.execute.call(global, require, moduleObj.default, module);\r\n if (output !== undefined)\r\n module.exports = output;\r\n }\r\n catch (e) {\r\n evalError(load, e);\r\n }\r\n\r\n load.linkRecord = undefined;\r\n\r\n // pick up defineProperty calls to module.exports when we can\r\n if (module.exports !== moduleObj.__useDefault)\r\n moduleObj.default = moduleObj.__useDefault = module.exports;\r\n\r\n var moduleDefault = moduleObj.default;\r\n\r\n // __esModule flag extension support via lifting\r\n if (moduleDefault && moduleDefault.__esModule) {\r\n for (var p in moduleDefault) {\r\n if (Object.hasOwnProperty.call(moduleDefault, p))\r\n moduleObj[p] = moduleDefault[p];\r\n }\r\n }\r\n\r\n registry[load.key] = load.module = new ModuleNamespace(link.moduleObj);\r\n\r\n // run importer setters and clear them\r\n // this allows dynamic modules to update themselves into es modules\r\n // as soon as execution has completed\r\n if (load.importerSetters)\r\n for (var i = 0; i < load.importerSetters.length; i++)\r\n load.importerSetters[i](load.module);\r\n load.importerSetters = undefined;\r\n}\r\n\r\n// the closest we can get to call(undefined)\r\nvar nullContext = Object.create(null);\r\nif (Object.freeze)\r\n Object.freeze(nullContext);\r\n","import RegisterLoader from 'es-module-loader/core/register-loader.js';\nimport { InternalModuleNamespace as ModuleNamespace } from 'es-module-loader/core/loader-polyfill.js';\n\nimport { baseURI, global, isBrowser } from 'es-module-loader/core/common.js';\nimport { resolveIfNotPlain } from 'es-module-loader/core/resolve.js';\n\nvar loader;\n\n// <script type=\"module\"> support\nvar anonSources = {};\nif (typeof document != 'undefined' && document.getElementsByTagName) {\n var handleError = function(err) {\n // dispatch an error event so that we can display in errors in browsers\n // that don't yet support unhandledrejection\n if (window.onunhandledrejection === undefined) {\n try {\n var evt = new Event('error');\n } catch (_eventError) {\n var evt = document.createEvent('Event');\n evt.initEvent('error', true, true);\n }\n evt.message = err.message;\n if (err.fileName) {\n evt.filename = err.fileName;\n evt.lineno = err.lineNumber;\n evt.colno = err.columnNumber;\n } else if (err.sourceURL) {\n evt.filename = err.sourceURL;\n evt.lineno = err.line;\n evt.colno = err.column;\n }\n evt.error = err;\n window.dispatchEvent(evt);\n }\n\n // throw so it still shows up in the console\n throw err;\n }\n\n var ready = function() {\n document.removeEventListener('DOMContentLoaded', ready, false );\n\n var anonCnt = 0;\n\n var scripts = document.getElementsByTagName('script');\n for (var i = 0; i < scripts.length; i++) {\n var script = scripts[i];\n if (script.type == 'module' && !script.loaded) {\n script.loaded = true;\n if (script.src) {\n loader.import(script.src).catch(handleError);\n }\n // anonymous modules supported via a custom naming scheme and registry\n else {\n var uri = './<anon' + ++anonCnt + '>.js';\n if (script.id !== \"\"){\n uri = \"./\" + script.id;\n }\n\n var anonName = resolveIfNotPlain(uri, baseURI);\n anonSources[anonName] = script.innerHTML;\n loader.import(anonName).catch(handleError);\n }\n }\n }\n }\n\n // simple DOM ready\n if (document.readyState !== 'loading')\n setTimeout(ready);\n else\n document.addEventListener('DOMContentLoaded', ready, false);\n}\n\nfunction BrowserESModuleLoader(baseKey) {\n if (baseKey)\n this.baseKey = resolveIfNotPlain(baseKey, baseURI) || resolveIfNotPlain('./' + baseKey, baseURI);\n\n RegisterLoader.call(this);\n\n var loader = this;\n\n // ensure System.register is available\n global.System = global.System || {};\n if (typeof global.System.register == 'function')\n var prevRegister = global.System.register;\n global.System.register = function() {\n loader.register.apply(loader, arguments);\n if (prevRegister)\n prevRegister.apply(this, arguments);\n };\n}\nBrowserESModuleLoader.prototype = Object.create(RegisterLoader.prototype);\n\n// normalize is never given a relative name like \"./x\", that part is already handled\nBrowserESModuleLoader.prototype[RegisterLoader.resolve] = function(key, parent) {\n var resolved = RegisterLoader.prototype[RegisterLoader.resolve].call(this, key, parent || this.baseKey) || key;\n if (!resolved)\n throw new RangeError('ES module loader does not resolve plain module names, resolving \"' + key + '\" to ' + parent);\n\n return resolved;\n};\n\nfunction xhrFetch(url, resolve, reject) {\n var xhr = new XMLHttpRequest();\n var load = function(source) {\n resolve(xhr.responseText);\n }\n var error = function() {\n reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url));\n }\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n // in Chrome on file:/// URLs, status is 0\n if (xhr.status == 0) {\n if (xhr.responseText) {\n load();\n }\n else {\n // when responseText is empty, wait for load or error event\n // to inform if it is a 404 or empty file\n xhr.addEventListener('error', error);\n xhr.addEventListener('load', load);\n }\n }\n else if (xhr.status === 200) {\n load();\n }\n else {\n error();\n }\n }\n };\n xhr.open(\"GET\", url, true);\n xhr.send(null);\n}\n\nvar WorkerPool = function (script, size) {\n var current = document.currentScript;\n // IE doesn't support currentScript\n if (!current) {\n // Find an entry with out basename\n var scripts = document.getElementsByTagName('script');\n for (var i = 0; i < scripts.length; i++) {\n if (scripts[i].src.indexOf(\"browser-es-module-loader.js\") !== -1) {\n current = scripts[i];\n break;\n }\n }\n if (!current)\n throw Error(\"Could not find own <script> element\");\n }\n script = current.src.substr(0, current.src.lastIndexOf(\"/\")) + \"/\" + script;\n this._workers = new Array(size);\n this._ind = 0;\n this._size = size;\n this._jobs = 0;\n this.onmessage = undefined;\n this._stopTimeout = undefined;\n for (var i = 0; i < size; i++) {\n var wrkr = new Worker(script);\n wrkr._count = 0;\n wrkr._ind = i;\n wrkr.onmessage = this._onmessage.bind(this, wrkr);\n wrkr.onerror = this._onerror.bind(this);\n this._workers[i] = wrkr;\n }\n\n this._checkJobs();\n};\nWorkerPool.prototype = {\n postMessage: function (msg) {\n if (this._stopTimeout !== undefined) {\n clearTimeout(this._stopTimeout);\n this._stopTimeout = undefined;\n }\n var wrkr = this._workers[this._ind % this._size];\n wrkr._count++;\n this._jobs++;\n wrkr.postMessage(msg);\n this._ind++;\n },\n\n _onmessage: function (wrkr, evt) {\n wrkr._count--;\n this._jobs--;\n this.onmessage(evt, wrkr);\n this._checkJobs();\n },\n\n _onerror: function(err) {\n try {\n var evt = new Event('error');\n } catch (_eventError) {\n var evt = document.createEvent('Event');\n evt.initEvent('error', true, true);\n }\n evt.message = err.message;\n evt.filename = err.filename;\n evt.lineno = err.lineno;\n evt.colno = err.colno;\n evt.error = err.error;\n window.dispatchEvent(evt);\n },\n\n _checkJobs: function () {\n if (this._jobs === 0 && this._stopTimeout === undefined) {\n // wait for 2s of inactivity before stopping (that should be enough for local loading)\n this._stopTimeout = setTimeout(this._stop.bind(this), 2000);\n }\n },\n\n _stop: function () {\n this._workers.forEach(function(wrkr) {\n wrkr.terminate();\n });\n }\n};\n\nvar promiseMap = new Map();\nvar babelWorker = new WorkerPool('babel-worker.js', 3);\nbabelWorker.onmessage = function (evt) {\n var promFuncs = promiseMap.get(evt.data.key);\n promFuncs.resolve(evt.data);\n promiseMap.delete(evt.data.key);\n};\n\n// instantiate just needs to run System.register\n// so we fetch the source, convert into the Babel System module format, then evaluate it\nBrowserESModuleLoader.prototype[RegisterLoader.instantiate] = function(key, processAnonRegister) {\n var loader = this;\n\n // load as ES with Babel converting into System.register\n return new Promise(function(resolve, reject) {\n // anonymous module\n if (anonSources[key]) {\n resolve(anonSources[key])\n anonSources[key] = undefined;\n }\n // otherwise we fetch\n else {\n xhrFetch(key, resolve, reject);\n }\n })\n .then(function(source) {\n // check our cache first\n var cacheEntry = localStorage.getItem(key);\n if (cacheEntry) {\n cacheEntry = JSON.parse(cacheEntry);\n // TODO: store a hash instead\n if (cacheEntry.source === source) {\n return Promise.resolve({key: key, code: cacheEntry.code, source: cacheEntry.source});\n }\n }\n return new Promise(function (resolve, reject) {\n promiseMap.set(key, {resolve: resolve, reject: reject});\n babelWorker.postMessage({key: key, source: source});\n });\n }).then(function (data) {\n // evaluate without require, exports and module variables\n // we leave module in for now to allow module.require access\n try {\n var cacheEntry = JSON.stringify({source: data.source, code: data.code});\n localStorage.setItem(key, cacheEntry);\n } catch (e) {\n if (window.console) {\n window.console.warn('Unable to cache transpiled version of ' + key + ': ' + e);\n }\n }\n (0, eval)(data.code + '\\n//# sourceURL=' + data.key + '!transpiled');\n processAnonRegister();\n });\n};\n\n// create a default loader instance in the browser\nif (isBrowser)\n loader = new BrowserESModuleLoader();\n\nexport default BrowserESModuleLoader;\n"],"names":["resolvedPromise","addToError","RegisterLoader","global"],"mappings":";;;;;;AAAA;;;AAGA,AAAO,IAAI,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,CAAC;AACxF,AAAO,IAAI,MAAM,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;AAChG,AAAO,IAAI,SAAS,GAAG,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;;AAEhI,IAAI,SAAS,GAAG,OAAO,IAAI,KAAK,WAAW,GAAG,IAAI,GAAG,MAAM,CAAC;AAC5D,AAEA;;;AAGA,IAAI,SAAS,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;AAC9C,AAAO,SAAS,YAAY,EAAE,IAAI,EAAE;EAClC,OAAO,SAAS,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3C;;AAED,AAAO,IAAI,WAAW,GAAG,SAAS,IAAI,MAAM,CAAC,WAAW,CAAC;;AAEzD,AAAO,AAEN;;AAED,AAAO,AAON;;;;;AAKD,AAAO,IAAI,OAAO,CAAC;;;AAGnB,IAAI,OAAO,QAAQ,IAAI,WAAW,IAAI,QAAQ,CAAC,oBAAoB,EAAE;EACnE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;;EAE3B,IAAI,CAAC,OAAO,EAAE;IACZ,IAAI,KAAK,GAAG,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;GAC7D;CACF;KACI,IAAI,OAAO,QAAQ,IAAI,WAAW,EAAE;EACvC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC;CACzB;;;AAGD,IAAI,OAAO,EAAE;EACX,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;EAC9C,IAAI,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;EAC1C,IAAI,UAAU,KAAK,CAAC,CAAC;IACnB,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;CAC/C;KACI,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE;EACtD,OAAO,GAAG,SAAS,IAAI,SAAS,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;EAC7D,IAAI,SAAS;IACX,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;CACzC;KACI;EACH,MAAM,IAAI,SAAS,CAAC,wBAAwB,CAAC,CAAC;CAC/C;;;AAGD,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG;EACrC,OAAO,IAAI,GAAG,CAAC;;;;;AAKjB,IAAI,OAAO,GAAG,IAAI,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,QAAQ,IAAI,GAAG,CAAC;AAChD,SAAS,iDAAiD,EAAE,QAAQ,EAAE,UAAU,EAAE;;EAEhF,IAAI,CAAC,SAAS;IACZ,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,GAAG,cAAc,GAAG,YAAY,EAAE,EAAE,CAAC,CAAC;;EAEjF,IAAI,OAAO,GAAG,CAAC,QAAQ,CAAC,OAAO,IAAI,QAAQ,IAAI,MAAM,GAAG,UAAU,CAAC;;EAEnE,IAAI,GAAG,CAAC;EACR,IAAI,OAAO,IAAI,QAAQ,CAAC,QAAQ;IAC9B,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;;IAEjE,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;;;EAG3B,IAAI,KAAK,GAAG,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;;EAE/E,IAAI,MAAM;;IAER,GAAG,CAAC,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;;IAErC,GAAG,CAAC,KAAK,GAAG,KAAK,CAAC;;EAEpB,GAAG,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,IAAI,QAAQ,CAAC;;EAEnD,OAAO,GAAG,CAAC;CACZ,AACD,AAA0E;;ACjG1E,IAAIA,iBAAe,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;;;;;AAKxC,SAAS,WAAW,EAAE,GAAG,EAAE;EACzB,IAAI,GAAG,CAAC,MAAM;IACZ,OAAO,GAAG,CAAC,MAAM,EAAE,CAAC;;EAEtB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,QAAQ;IACnD,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;;EAEnE,IAAI,QAAQ,GAAG,EAAE,CAAC;EAClB,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,YAAY;IACtC,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,OAAO;MACL,IAAI,EAAE,YAAY;QAChB,IAAI,QAAQ,GAAG,IAAI,CAAC,MAAM;UACxB,OAAO;YACL,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC5B,IAAI,EAAE,KAAK;WACZ,CAAC;;UAEF,OAAO;YACL,KAAK,EAAE,SAAS;YAChB,IAAI,EAAE,IAAI;WACX,CAAC;OACL;KACF,CAAC;GACH,CAAC;EACF,OAAO,QAAQ,CAAC;CACjB;;;;;;;;AAQD,SAAS,MAAM,IAAI;EACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;CAChC;;AAED,MAAM,CAAC,SAAS,CAAC,WAAW,GAAG,MAAM,CAAC;;AAEtC,SAAS,kBAAkB,EAAE,MAAM,EAAE;EACnC,IAAI,MAAM,KAAK,SAAS;IACtB,OAAO;EACT,IAAI,MAAM,YAAY,eAAe,KAAK,KAAK,IAAI,MAAM,CAAC,WAAW,CAAC,KAAK,QAAQ;IACjF,MAAM,IAAI,SAAS,CAAC,+DAA+D,CAAC,CAAC;EACvF,OAAO,MAAM,CAAC;CACf;;;AAGD,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,GAAG,EAAE,MAAM,EAAE;EAC/C,IAAI,OAAO,GAAG,KAAK,QAAQ;IACzB,MAAM,IAAI,SAAS,CAAC,yDAAyD,CAAC,CAAC;;EAEjF,IAAI,MAAM,GAAG,IAAI,CAAC;EAClB,OAAOA,iBAAe;GACrB,IAAI,CAAC,YAAY;IAChB,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;GACjD,CAAC;GACD,IAAI,CAAC,kBAAkB,CAAC;;GAExB,KAAK,CAAC,UAAU,GAAG,EAAE;IACpB,MAAMC,iDAAU,CAAC,GAAG,EAAE,UAAU,GAAG,GAAG,IAAI,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;GAC7E,CAAC,CAAC;CACJ,CAAC;;AAEF,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAC;;;;;;;;;;;AAWvD,IAAI,mBAAmB,GAAG,MAAM,CAAC,kBAAkB,GAAG,YAAY,CAAC,oBAAoB,CAAC,CAAC;;;;AAIzF,MAAM,CAAC,SAAS,CAAC,mBAAmB,CAAC,GAAG,UAAU,GAAG,EAAE,MAAM,EAAE;EAC7D,IAAI,MAAM,GAAG,IAAI,CAAC;EAClB,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC;GACjC,IAAI,CAAC,UAAU,QAAQ,EAAE;IACxB,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;GACtC,CAAC,CAAC;CACJ,CAAC;;AAEF,SAAS,gBAAgB,EAAE,WAAW,EAAE;EACtC,IAAI,WAAW,KAAK,SAAS;IAC3B,MAAM,IAAI,UAAU,CAAC,sBAAsB,CAAC,CAAC;EAC/C,OAAO,WAAW,CAAC;CACpB;;AAED,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,MAAM,EAAE;EAChD,IAAI,MAAM,GAAG,IAAI,CAAC;EAClB,OAAOD,iBAAe;GACrB,IAAI,CAAC,WAAW;IACf,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;GACrC,CAAC;GACD,IAAI,CAAC,gBAAgB,CAAC;GACtB,KAAK,CAAC,UAAU,GAAG,EAAE;IACpB,MAAMC,iDAAU,CAAC,GAAG,EAAE,YAAY,GAAG,GAAG,IAAI,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;GAC7E,CAAC,CAAC;CACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;AAsBF,IAAI,eAAe,GAAG,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC;AACvE,IAAI,QAAQ,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;AACxC,SAAS,QAAQ,GAAG;EAClB,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;CACrB;;AAED,IAAI,eAAe,EAAE;;EAEnB,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,YAAY;IAChD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC;GAC1C,CAAC;;;EAGF,QAAQ,CAAC,SAAS,CAAC,OAAO,GAAG,YAAY;IACvC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE;MAC1D,OAAO,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B,CAAC,CAAC,CAAC;GACL,CAAC;CACH;;;AAGD,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,YAAY;EACpC,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;CACjD,CAAC;;AAEF,QAAQ,CAAC,SAAS,CAAC,MAAM,GAAG,YAAY;EACtC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;EAC9B,OAAO,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE;IAC1D,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;GACtB,CAAC,CAAC,CAAC;CACL,CAAC;;AAEF,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,GAAG,EAAE;EACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;CAC5B,CAAC;;AAEF,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,GAAG,EAAE,SAAS,EAAE;EACjD,IAAI,EAAE,SAAS,YAAY,eAAe,IAAI,SAAS,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC;IAChF,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;EAC/E,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;EAChC,OAAO,IAAI,CAAC;CACb,CAAC;;AAEF,QAAQ,CAAC,SAAS,CAAC,GAAG,GAAG,UAAU,GAAG,EAAE;EACtC,OAAO,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;CACxD,CAAC;;AAEF,QAAQ,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,GAAG,EAAE;EACzC,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,EAAE;IACnD,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC;GACb;EACD,OAAO,KAAK,CAAC;CACd,CAAC;;;;;;;AAOF,IAAI,WAAW,GAAG,YAAY,CAAC,YAAY,CAAC,CAAC;;;;;;;;;;;;;;AAc7C,SAAS,eAAe,EAAE,UAAU,gBAAgB;EAClD,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE;IACvC,KAAK,EAAE,UAAU;GAClB,CAAC,CAAC;;;;;;;;;;;IAWD,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;;CAE1D,AAAC;;AAEF,eAAe,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;;AAEhD,IAAI,WAAW;EACb,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,EAAE,WAAW,EAAE;IAC5D,KAAK,EAAE,QAAQ;GAChB,CAAC,CAAC;;AAEL,SAAS,eAAe,EAAE,GAAG,EAAE;EAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE;IAC/B,UAAU,EAAE,IAAI;IAChB,GAAG,EAAE,YAAY;MACf,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC;KAC/B;GACF,CAAC,CAAC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4BI;;AC7QL;;;AAGA,SAAS,iBAAiB,EAAE,MAAM,EAAE,SAAS,EAAE;EAC7C,MAAM,IAAI,UAAU,CAAC,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC5E;AACD,IAAI,cAAc,GAAG,KAAK,CAAC;AAC3B,AAAO,SAAS,iBAAiB,EAAE,MAAM,EAAE,SAAS,EAAE;EACpD,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG;IACxD,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;EACzB,IAAI,cAAc,GAAG,SAAS,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;;EAElF,IAAI,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;EAC1B,IAAI,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;;EAG3B,IAAI,SAAS,KAAK,GAAG,IAAI,UAAU,KAAK,GAAG,EAAE;IAC3C,IAAI,CAAC,cAAc;MACjB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACvC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAC7B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAC/C,OAAO,cAAc,GAAG,MAAM,CAAC;GAChC;;OAEI,IAAI,SAAS,KAAK,GAAG,KAAK,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,GAAG,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,KAAK,MAAM,IAAI,GAAG,CAAC,CAAC;MACpI,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,MAAM,IAAI,GAAG,CAAC,CAAC;MACxC,SAAS,KAAK,GAAG,EAAE;IACrB,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAC7B,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IAC/C,IAAI,aAAa,GAAG,CAAC,cAAc,IAAI,SAAS,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC;;;;IAIhF,IAAI,QAAQ,CAAC;IACb,IAAI,aAAa,EAAE;;MAEjB,IAAI,SAAS,KAAK,SAAS;QACzB,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;MACvC,QAAQ,GAAG,SAAS,CAAC;KACtB;SACI,IAAI,SAAS,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;;MAErD,IAAI,cAAc,KAAK,OAAO,EAAE;QAC9B,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACvD,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;OACvD;WACI;QACH,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;OAChC;KACF;SACI;;MAEH,QAAQ,GAAG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KACxD;;IAED,IAAI,SAAS,KAAK,GAAG,EAAE;MACrB,IAAI,aAAa;QACf,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;;QAErC,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;KAC/E;;;;;IAKD,IAAI,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC;;IAE3E,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC;;IAEtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;;MAEzC,IAAI,YAAY,KAAK,CAAC,CAAC,EAAE;QACvB,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;UACxB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;UACtD,YAAY,GAAG,CAAC,CAAC,CAAC;SACnB;QACD,SAAS;OACV;;;MAGD,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;;QAExB,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,KAAK,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE;UACxF,MAAM,CAAC,GAAG,EAAE,CAAC;UACb,CAAC,IAAI,CAAC,CAAC;SACR;;aAEI,IAAI,SAAS,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,MAAM,EAAE;UAC/D,CAAC,IAAI,CAAC,CAAC;SACR;aACI;;UAEH,YAAY,GAAG,CAAC,CAAC;UACjB,SAAS;SACV;;;QAGD,IAAI,aAAa,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;UACtC,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;;QAEvC,SAAS;OACV;;;MAGD,YAAY,GAAG,CAAC,CAAC;KAClB;;IAED,IAAI,YAAY,KAAK,CAAC,CAAC;MACrB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;;IAE9C,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;GAClF;;;;EAID,IAAI,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;EACxC,IAAI,aAAa,KAAK,CAAC,CAAC,EAAE;IACxB,IAAI,MAAM,EAAE;;MAEV,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;QACtE,OAAO,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;KAC3D;IACD,OAAO,MAAM,CAAC;GACf;CACF;;ACzHD,IAAI,eAAe,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACxC,AAEA;;;;;;;;;;;AAWA,IAAI,iBAAiB,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC;;AAE1D,SAASC,gBAAc,IAAI;EACzB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;EAElB,IAAI,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;EAC1C,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,UAAU,GAAG,EAAE;IACpC,IAAI,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;;;IAG7C,IAAI,OAAO,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE;MAC3D,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;MACpB,OAAO,GAAG,IAAI,CAAC;KAChB;;IAED,OAAO,OAAO,CAAC;GAChB,CAAC;;EAEF,IAAI,OAAO,GAAG,EAAE,CAAC;;EAEjB,IAAI,CAAC,iBAAiB,CAAC,GAAG;;IAExB,YAAY,EAAE,SAAS;;IAEvB,OAAO,EAAE,OAAO;GACjB,CAAC;;;EAGF,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;CACpB;;AAEDA,gBAAc,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC3DA,gBAAc,CAAC,SAAS,CAAC,WAAW,GAAGA,gBAAc,CAAC;;AAEtD,IAAI,WAAW,GAAGA,gBAAc,CAAC,WAAW,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;;;AAG3EA,gBAAc,CAAC,SAAS,CAACA,gBAAc,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,UAAU,GAAG,EAAE,SAAS,EAAE;EAC5F,OAAO,iBAAiB,CAAC,GAAG,EAAE,SAAS,IAAI,OAAO,CAAC,CAAC;CACrD,CAAC;;AAEFA,gBAAc,CAAC,SAAS,CAAC,WAAW,CAAC,GAAG,UAAU,GAAG,EAAE,mBAAmB,EAAE,EAAE,CAAC;;;;;AAK/E,SAAS,gBAAgB,EAAE,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE;EACnD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG;IAC1B,GAAG,EAAE,GAAG;;;IAGR,YAAY,EAAE,YAAY;;;IAG1B,MAAM,EAAE,SAAS;;;;;IAKjB,eAAe,EAAE,SAAS;;IAE1B,SAAS,EAAE,SAAS;IACpB,SAAS,EAAE,SAAS;;;IAGpB,UAAU,EAAE;;MAEV,kBAAkB,EAAE,SAAS;MAC7B,YAAY,EAAE,SAAS;MACvB,OAAO,EAAE,SAAS;MAClB,gBAAgB,EAAE,KAAK;;;MAGvB,SAAS,EAAE,SAAS;;;MAGpB,OAAO,EAAE,SAAS;;;MAGlB,sBAAsB,EAAE,SAAS;;MAEjC,wBAAwB,EAAE,SAAS;;;MAGnC,eAAe,EAAE,SAAS;;;;;;;;KAQ3B;GACF,CAAC;CACH;;AAEDA,gBAAc,CAAC,SAAS,CAAC,MAAM,CAAC,kBAAkB,CAAC,GAAG,UAAU,GAAG,EAAE,SAAS,EAAE;EAC9E,IAAI,MAAM,GAAG,IAAI,CAAC;EAClB,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;EACpC,IAAI,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;EAEvC,OAAO,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC;GACjE,IAAI,CAAC,UAAU,YAAY,EAAE;IAC5B,IAAI,YAAY,YAAY,eAAe,IAAI,YAAY,CAAC,WAAW,CAAC,KAAK,QAAQ;MACnF,OAAO,YAAY,CAAC;;;IAGtB,IAAI,IAAI,GAAG,YAAY,CAAC,UAAU,CAAC;;;IAGnC,IAAI,CAAC,IAAI,EAAE;MACT,IAAI,YAAY,CAAC,MAAM;QACrB,OAAO,YAAY,CAAC,MAAM,CAAC;MAC7B,MAAM,YAAY,CAAC,SAAS,CAAC;KAC9B;;IAED,OAAO,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;KACtE,IAAI,CAAC,YAAY;MAChB,OAAO,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;KACpE,CAAC,CAAC;GACJ,CAAC,CAAC;CACJ,CAAC;;AAEF,SAAS,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE;;;EAGpE,IAAI,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;EAC3B,IAAI,MAAM;IACR,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;EAEjC,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;;;EAG9B,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;IACxB,IAAI,IAAI,CAAC,SAAS;MAChB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxC,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;GACpE;;EAED,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC;GACpC,IAAI,CAAC,UAAU,WAAW,EAAE;;IAE3B,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/B,IAAI,MAAM;MACR,OAAO,MAAM,CAAC;;IAEhB,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;;;;;;IAMlC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM;MACtB,IAAI,GAAG,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;;IAEzE,IAAI,IAAI,CAAC,SAAS;MAChB,OAAO,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;IAExC,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC3B,IAAI,CAAC,IAAI;MACP,OAAO,IAAI,CAAC;;IAEd,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;GACzD,CAAC,CAAC;CACJ;;AAED,SAAS,yBAAyB,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE;EACvD,OAAO,YAAY;IACjB,IAAI,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;;IAEtC,IAAI,CAAC,YAAY;MACf,OAAO,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC;;IAE7B,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;;IAEjC,OAAO,IAAI,CAAC;GACb,CAAC;CACH;;AAED,SAAS,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;EACzD,OAAO,IAAI,CAAC,kBAAkB,KAAK,IAAI,CAAC,kBAAkB;;EAE1D,CAAC,IAAI,CAAC,YAAY,GAAG,eAAe,GAAG,eAAe,CAAC,IAAI,CAAC,YAAY;IACtE,KAAK,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,yBAAyB,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;GACxH,CAAC;GACD,IAAI,CAAC,UAAU,aAAa,EAAE;;IAE7B,IAAI,aAAa,KAAK,SAAS,EAAE;MAC/B,IAAI,EAAE,aAAa,YAAY,eAAe,IAAI,aAAa,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC;QACxF,MAAM,IAAI,SAAS,CAAC,mDAAmD,CAAC,CAAC;;MAE3E,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;MAC/B,IAAI,MAAM,CAAC,KAAK;QACd,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;MAChC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC;KAC3C;;;IAGD,IAAI,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;;IAErC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC9B,IAAI,CAAC,YAAY;MACf,MAAM,IAAI,SAAS,CAAC,oFAAoF,CAAC,CAAC;;IAE5G,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;;IAEpC,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;;IAE1B,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;;;IAGpB,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE;MACnB,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,GAAG,EAAE,CAAC;MAC1D,IAAI,CAAC,gBAAgB,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;MACxC,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;KAChC;;;SAGI;MACH,mBAAmB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;KAC1D;;IAED,OAAO,IAAI,CAAC;GACb,CAAC;GACD,KAAK,CAAC,UAAU,GAAG,EAAE;IACpB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC5B,MAAM,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAID,iDAAU,CAAC,GAAG,EAAE,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;GACvF,CAAC,CAAC,CAAC;CACL;;;AAGD,SAAS,qBAAqB,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;EAwBpF,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,SAAS,CAAC;GACpC,IAAI,CAAC,UAAU,WAAW,EAAE;IAC3B,IAAI,WAAW;MACb,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;;;IAGjC,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACtC,IAAI,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;;;IAGnC,IAAI,MAAM,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC;MAC5D,OAAO,MAAM,CAAC;;IAEhB,IAAI,IAAI,IAAI,IAAI,CAAC,SAAS;MACxB,MAAM,IAAI,CAAC,SAAS,CAAC;;;;;;IAMvB,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM;MACjC,IAAI,GAAG,gBAAgB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;;IAEzE,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC3B,IAAI,CAAC,IAAI;MACP,OAAO,IAAI,CAAC;;IAEd,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;GACzD,CAAC,CAAC;CACJ;;AAED,SAAS,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE;EACtC,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;EAClC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG;IACvB,GAAG,EAAE,IAAI,CAAC,GAAG;IACb,IAAI,EAAE,IAAI,CAAC,YAAY;IACvB,WAAW,EAAE,EAAE;IACf,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,EAAE;GAC1B,CAAC;CACH;;;;;;;;;AASD,SAAS,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE;EACzD,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;EAC/B,IAAI,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;;EAE3C,IAAI,cAAc,GAAG,KAAK,CAAC;;;EAG3B,IAAI,QAAQ,GAAG,OAAO,CAAC,IAAI,CAACE,SAAM,EAAE,UAAU,IAAI,EAAE,KAAK,EAAE;IACzD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;MAC5B,IAAI,OAAO,GAAG,KAAK,CAAC;MACpB,KAAK,IAAI,CAAC,IAAI,IAAI,EAAE;QAClB,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAChB,IAAI,CAAC,KAAK,cAAc,KAAK,EAAE,CAAC,IAAI,SAAS,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,EAAE;UACzE,OAAO,GAAG,IAAI,CAAC;UACf,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;SACtB;OACF;MACD,IAAI,OAAO,KAAK,KAAK;QACnB,OAAO,KAAK,CAAC;KAChB;SACI;MACH,IAAI,CAAC,cAAc,IAAI,IAAI,IAAI,SAAS,KAAK,SAAS,CAAC,IAAI,CAAC,KAAK,KAAK;QACpE,OAAO,KAAK,CAAC;MACf,SAAS,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;KACzB;;IAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE;MAC7C,eAAe,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;;IAEhC,OAAO,KAAK,CAAC;GACd,EAAE,IAAI,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;;EAE3C,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;EACtC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;EAChC,IAAI,QAAQ,CAAC,OAAO,EAAE;IACpB,IAAI,CAAC,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC;IAC9C,cAAc,GAAG,IAAI,CAAC;GACvB;CACF;;AAED,SAAS,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;EAC7D,IAAI,IAAI,CAAC,sBAAsB;IAC7B,OAAO,IAAI,CAAC,sBAAsB,CAAC;;EAErC,IAAI,uBAAuB,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;;EAE9D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;IAC/C,uBAAuB,CAAC,CAAC,CAAC,GAAG,qBAAqB,CAAC,MAAM,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;;EAEjK,IAAI,sBAAsB,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;GAChE,IAAI,CAAC,UAAU,wBAAwB,EAAE;IACxC,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;;;IAGzD,IAAI,IAAI,CAAC,OAAO,EAAE;MAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,wBAAwB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACxD,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,MAAM,EAAE;UACV,IAAI,aAAa,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;;UAEhD,IAAI,aAAa,YAAY,eAAe,IAAI,aAAa,CAAC,WAAW,CAAC,KAAK,QAAQ,EAAE;YACvF,MAAM,CAAC,aAAa,CAAC,CAAC;WACvB;eACI;YACH,IAAI,aAAa,CAAC,SAAS;cACzB,MAAM,aAAa,CAAC,SAAS,CAAC;YAChC,MAAM,CAAC,aAAa,CAAC,MAAM,IAAI,aAAa,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;;YAEnE,IAAI,aAAa,CAAC,eAAe;cAC/B,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;WAC9C;SACF;OACF;KACF;;IAED,OAAO,IAAI,CAAC;GACb,CAAC,CAAC;;EAEH,IAAI,MAAM,CAAC,KAAK;IACd,sBAAsB,GAAG,sBAAsB,CAAC,IAAI,CAAC,YAAY;MAC/D,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;MAC9B,OAAO,IAAI,CAAC;KACb,CAAC,CAAC;;EAEL,sBAAsB,GAAG,sBAAsB,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE;;IAEnE,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;IACxC,MAAMF,iDAAU,CAAC,GAAG,EAAE,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;GAC9C,CAAC,CAAC;;EAEH,sBAAsB,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC;;EAE7C,OAAO,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;CAC7D;;AAED,SAAS,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;EACjE,IAAI,IAAI,GAAG,EAAE,CAAC;EACd,SAAS,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE;IAC5B,IAAI,CAAC,IAAI;MACP,OAAO,eAAe,CAAC;IACzB,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;MAC3B,OAAO,eAAe,CAAC;IACzB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;IAEhB,OAAO,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC;KAC1D,IAAI,CAAC,YAAY;MAChB,IAAI,WAAW,CAAC;MAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACjD,IAAI,OAAO,GAAG,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;QAC/C,IAAI,EAAE,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC,EAAE;UAC9E,WAAW,GAAG,WAAW,IAAI,EAAE,CAAC;UAChC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;SACxD;OACF;MACD,IAAI,WAAW;QACb,OAAO,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;KACnC,CAAC,CAAC;GACJ,AAAC;;EAEF,OAAO,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;CAC5B;;;;;AAKDC,gBAAc,CAAC,SAAS,CAAC,QAAQ,GAAG,UAAU,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;EAChE,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;;;EAGpC,IAAI,OAAO,KAAK,SAAS,EAAE;IACzB,KAAK,CAAC,YAAY,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;GAC7C;;;OAGI;IACH,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IACzE,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;GAChD;CACF,CAAC;;;;;AAKFA,gBAAc,CAAC,SAAS,CAAC,eAAe,GAAG,UAAU,GAAG,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE;EACzF,IAAI,KAAK,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;;;EAGpC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;IAC3B,KAAK,CAAC,YAAY,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC;GACpD;;;OAGI;IACH,IAAI,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,SAAS,CAAC,CAAC;IACzE,IAAI,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;GACvD;CACF,CAAC;;;;AAIF,SAAS,gBAAgB,EAAE,MAAM,EAAE,GAAG,EAAE;EACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;EACrB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;EACzB,IAAI,CAAC,IAAI,GAAG;IACV,GAAG,EAAE,GAAG;;GAET,CAAC;CACH;;;;AAID,gBAAgB,CAAC,SAAS,CAAC,MAAM,GAAG,UAAU,GAAG,EAAE;EACjD,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK;IACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;EACpD,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;CAC1C,CAAC;;;;;AAKF,SAAS,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;EAC5D,IAAI,IAAI,CAAC,MAAM;IACb,OAAO,IAAI,CAAC,MAAM,CAAC;EACrB,IAAI,IAAI,CAAC,SAAS;IAChB,MAAM,IAAI,CAAC,SAAS,CAAC;EACvB,IAAI,IAAI,CAAC,eAAe;IACtB,OAAO,IAAI,CAAC,eAAe,CAAC;;EAE9B,IAAI,IAAI,CAAC,OAAO,EAAE;IAChB,IAAI,eAAe,GAAG,qBAAqB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACzF,IAAI,eAAe;MACjB,OAAO,eAAe,CAAC;GAC1B;OACI;IACH,iBAAiB,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;GAChE;EACD,OAAO,IAAI,CAAC,MAAM,CAAC;CACpB;;AAED,SAAS,kBAAkB,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,wBAAwB,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;;EAEvG,OAAO,UAAU,IAAI,EAAE;IACrB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MAC5C,IAAI,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;QAC5B,IAAI,OAAO,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;QAC1C,IAAI,MAAM,CAAC;;QAEX,IAAI,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,KAAK,QAAQ,EAAE;UAC3E,MAAM,GAAG,OAAO,CAAC;SAClB;aACI;UACH,IAAI,OAAO,CAAC,SAAS;YACnB,MAAM,OAAO,CAAC,SAAS,CAAC;UAC1B,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,EAAE;YACvG,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE;cAC9B,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;aACxF;iBACI;cACH,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;cACnB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;aAC/E;WACF;UACD,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC;SACzD;;QAED,OAAO,cAAc,IAAI,MAAM,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC;OAChE;KACF;IACD,MAAM,IAAI,KAAK,CAAC,SAAS,GAAG,IAAI,GAAG,0DAA0D,GAAG,GAAG,CAAC,CAAC;GACtG,CAAC;CACH;;AAED,SAAS,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE;EAC7B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;EAC5B,IAAI,SAAS,GAAGD,iDAAU,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;EAC1D,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS;IAC9B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;EAC7B,MAAM,SAAS,CAAC;CACjB;;;;AAID,SAAS,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;EACzE,IAAI,OAAO,EAAE,OAAO,CAAC;EACrB,IAAI,eAAe,CAAC;EACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACjD,IAAI,OAAO,GAAG,IAAI,CAAC,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAC/C,IAAI,OAAO,YAAY,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,KAAK,QAAQ;MACzE,SAAS;;;IAGX,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAC7B,IAAI,OAAO,EAAE;MACX,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;OACpC;WACI,IAAI,OAAO,CAAC,OAAO,EAAE;QACxB,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE;UAChC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;UACnB,IAAI;YACF,IAAI,cAAc,GAAG,qBAAqB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;WAC7F;UACD,OAAO,CAAC,EAAE;YACR,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;WACpB;UACD,IAAI,cAAc,EAAE;YAClB,eAAe,GAAG,eAAe,IAAI,EAAE,CAAC;YACxC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE;cACvD,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;aACtB,CAAC,CAAC,CAAC;WACL;SACF;OACF;WACI;QACH,IAAI;UACF,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;SACzE;QACD,OAAO,CAAC,EAAE;UACR,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACpB;OACF;KACF;GACF;;EAED,IAAI,eAAe;IACjB,OAAO,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;KACzD,IAAI,CAAC,YAAY;MAChB,IAAI,IAAI,CAAC,OAAO,EAAE;;;QAGhB,IAAI;UACF,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SAClD;QACD,OAAO,CAAC,EAAE;UACR,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;SACpB;QACD,IAAI,WAAW;UACb,OAAO,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;YACpC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;WACpB,CAAC;WACD,IAAI,CAAC,YAAY;YAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;WAC/E,CAAC,CAAC;OACN;;;MAGD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;MAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACxE,CAAC,CAAC;;EAEL,IAAI,IAAI,CAAC,OAAO,EAAE;;;IAGhB,IAAI;MACF,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;KAClD;IACD,OAAO,CAAC,EAAE;MACR,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;KACpB;IACD,IAAI,WAAW;MACb,OAAO,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE;QAC3D,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;OACpB,CAAC;OACD,IAAI,CAAC,YAAY;QAChB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;OAC/E,CAAC,CAAC;GACN;;;EAGD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;EAC5B,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;CACxE;;;AAGD,SAAS,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE;;;EAGrE,IAAI,MAAM,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC;EAC9B,IAAI,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;EAC/B,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE;IACvC,YAAY,EAAE,IAAI;IAClB,GAAG,EAAE,UAAU,OAAO,EAAE;MACtB,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,YAAY,GAAG,OAAO,CAAC;KACtD;IACD,GAAG,EAAE,YAAY;MACf,OAAO,SAAS,CAAC,YAAY,CAAC;KAC/B;GACF,CAAC,CAAC;;EAEH,IAAI,OAAO,GAAG,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;;;EAG5H,IAAI,CAAC,IAAI,CAAC,gBAAgB;IACxB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE;MAC/C,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;;EAElC,IAAI;IACF,IAAI,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAACE,SAAM,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3E,IAAI,MAAM,KAAK,SAAS;MACtB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;GAC3B;EACD,OAAO,CAAC,EAAE;IACR,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;GACpB;;EAED,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;;;EAG5B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,YAAY;IAC3C,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC;;EAE9D,IAAI,aAAa,GAAG,SAAS,CAAC,OAAO,CAAC;;;EAGtC,IAAI,aAAa,IAAI,aAAa,CAAC,UAAU,EAAE;IAC7C,KAAK,IAAI,CAAC,IAAI,aAAa,EAAE;MAC3B,IAAI,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC9C,SAAS,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;KACnC;GACF;;EAED,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;;;;;EAKvE,IAAI,IAAI,CAAC,eAAe;IACtB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE;MAClD,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;EACzC,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;CAClC;;;AAGD,IAAI,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AACtC,IAAI,MAAM,CAAC,MAAM;EACf,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;;AC5sB7B,IAAI,MAAM,CAAC;;;AAGX,IAAI,WAAW,GAAG,EAAE,CAAC;AACrB,IAAI,OAAO,QAAQ,IAAI,WAAW,IAAI,QAAQ,CAAC,oBAAoB,EAAE;EACnE,IAAI,WAAW,GAAG,SAAS,GAAG,EAAE;;;IAG9B,IAAI,MAAM,CAAC,oBAAoB,KAAK,SAAS,EAAE;MAC7C,IAAI;QACF,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;OAC9B,CAAC,OAAO,WAAW,EAAE;QACpB,IAAI,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACxC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;OACpC;MACD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;MAC1B,IAAI,GAAG,CAAC,QAAQ,EAAE;QAChB,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;QAC5B,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;QAC5B,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC;OAC9B,MAAM,IAAI,GAAG,CAAC,SAAS,EAAE;QACxB,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC;QAC7B,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC;QACtB,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;OACxB;MACD,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC;MAChB,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;KAC3B;;;IAGD,MAAM,GAAG,CAAC;GACX,CAAA;;EAED,IAAI,KAAK,GAAG,WAAW;IACrB,QAAQ,CAAC,mBAAmB,CAAC,kBAAkB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;;IAEhE,IAAI,OAAO,GAAG,CAAC,CAAC;;IAEhB,IAAI,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MACvC,IAAI,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;MACxB,IAAI,MAAM,CAAC,IAAI,IAAI,QAAQ,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE;QAC7C,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,IAAI,MAAM,CAAC,GAAG,EAAE;UACd,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;SAC9C;;aAEI;UACH,IAAI,GAAG,GAAG,SAAS,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;UACzC,IAAI,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;YACnB,GAAG,GAAG,IAAI,GAAG,MAAM,CAAC,EAAE,CAAC;WACxB;;UAED,IAAI,QAAQ,GAAG,iBAAiB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;UAC/C,WAAW,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC;UACzC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;SAC5C;OACF;KACF;GACF,CAAA;;;EAGD,IAAI,QAAQ,CAAC,UAAU,KAAK,SAAS;IACnC,UAAU,CAAC,KAAK,CAAC,CAAC;;IAElB,QAAQ,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;CAC/D;;AAED,SAAS,qBAAqB,CAAC,OAAO,EAAE;EACtC,IAAI,OAAO;IACT,IAAI,CAAC,OAAO,GAAG,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,iBAAiB,CAAC,IAAI,GAAG,OAAO,EAAE,OAAO,CAAC,CAAC;;EAEnGD,gBAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;;EAE1B,IAAI,MAAM,GAAG,IAAI,CAAC;;;EAGlBC,SAAM,CAAC,MAAM,GAAGA,SAAM,CAAC,MAAM,IAAI,EAAE,CAAC;EACpC,IAAI,OAAOA,SAAM,CAAC,MAAM,CAAC,QAAQ,IAAI,UAAU;IAC7C,IAAI,YAAY,GAAGA,SAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;EAC5CA,SAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,WAAW;IAClC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACzC,IAAI,YAAY;MACd,YAAY,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;GACvC,CAAC;CACH;AACD,qBAAqB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAACD,gBAAc,CAAC,SAAS,CAAC,CAAC;;;AAG1E,qBAAqB,CAAC,SAAS,CAACA,gBAAc,CAAC,OAAO,CAAC,GAAG,SAAS,GAAG,EAAE,MAAM,EAAE;EAC9E,IAAI,QAAQ,GAAGA,gBAAc,CAAC,SAAS,CAACA,gBAAc,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC;EAC/G,IAAI,CAAC,QAAQ;IACX,MAAM,IAAI,UAAU,CAAC,mEAAmE,GAAG,GAAG,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;;EAErH,OAAO,QAAQ,CAAC;CACjB,CAAC;;AAEF,SAAS,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE;EACtC,IAAI,GAAG,GAAG,IAAI,cAAc,EAAE,CAAC;EAC/B,IAAI,IAAI,GAAG,SAAS,MAAM,EAAE;IAC1B,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;GAC3B,CAAA;EACD,IAAI,KAAK,GAAG,WAAW;IACrB,MAAM,CAAC,IAAI,KAAK,CAAC,WAAW,IAAI,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC,GAAG,WAAW,GAAG,GAAG,CAAC,CAAC,CAAC;GAClJ,CAAA;;EAED,GAAG,CAAC,kBAAkB,GAAG,YAAY;IACnC,IAAI,GAAG,CAAC,UAAU,KAAK,CAAC,EAAE;;MAExB,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,EAAE;QACnB,IAAI,GAAG,CAAC,YAAY,EAAE;UACpB,IAAI,EAAE,CAAC;SACR;aACI;;;UAGH,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;UACrC,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;SACpC;OACF;WACI,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;QAC3B,IAAI,EAAE,CAAC;OACR;WACI;QACH,KAAK,EAAE,CAAC;OACT;KACF;GACF,CAAC;EACF,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;EAC3B,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;CAChB;;AAED,IAAI,UAAU,GAAG,UAAU,MAAM,EAAE,IAAI,EAAE;EACvC,IAAI,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC;;EAErC,IAAI,CAAC,OAAO,EAAE;;IAEZ,IAAI,OAAO,GAAG,QAAQ,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IACtD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;MACvC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC,EAAE;QAChE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,MAAM;OACP;KACF;IACD,IAAI,CAAC,OAAO;MACV,MAAM,KAAK,CAAC,qCAAqC,CAAC,CAAC;GACtD;EACD,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC;EAC5E,IAAI,CAAC,QAAQ,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;EAChC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;EACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EAClB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;EACf,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;EAC3B,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;EAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;IAC7B,IAAI,IAAI,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAChB,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;GACzB;;EAED,IAAI,CAAC,UAAU,EAAE,CAAC;CACnB,CAAC;AACF,UAAU,CAAC,SAAS,GAAG;EACrB,WAAW,EAAE,UAAU,GAAG,EAAE;IAC1B,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;MACnC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;MAChC,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;KAC/B;IACD,IAAI,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;IACjD,IAAI,CAAC,MAAM,EAAE,CAAC;IACd,IAAI,CAAC,KAAK,EAAE,CAAC;IACb,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,CAAC,IAAI,EAAE,CAAC;GACb;;EAED,UAAU,EAAE,UAAU,IAAI,EAAE,GAAG,EAAE;IAC/B,IAAI,CAAC,MAAM,EAAE,CAAC;IACd,IAAI,CAAC,KAAK,EAAE,CAAC;IACb,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;GACnB;;EAED,QAAQ,EAAE,SAAS,GAAG,EAAE;IACtB,IAAI;QACA,IAAI,GAAG,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAChC,CAAC,OAAO,WAAW,EAAE;QAClB,IAAI,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACxC,GAAG,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;KACtC;IACD,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAC1B,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;IAC5B,GAAG,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IACxB,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACtB,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;IACtB,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;GAC3B;;EAED,UAAU,EAAE,YAAY;IACtB,IAAI,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE;;MAEvD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;KAC7D;GACF;;EAED,KAAK,EAAE,YAAY;IACjB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE;MACnC,IAAI,CAAC,SAAS,EAAE,CAAC;KAClB,CAAC,CAAC;GACJ;CACF,CAAC;;AAEF,IAAI,UAAU,GAAG,IAAI,GAAG,EAAE,CAAC;AAC3B,IAAI,WAAW,GAAG,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;AACvD,WAAW,CAAC,SAAS,GAAG,UAAU,GAAG,EAAE;IACnC,IAAI,SAAS,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC7C,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;CACnC,CAAC;;;;AAIF,qBAAqB,CAAC,SAAS,CAACA,gBAAc,CAAC,WAAW,CAAC,GAAG,SAAS,GAAG,EAAE,mBAAmB,EAAE;EAC/F,IAAI,MAAM,GAAG,IAAI,CAAC;;;EAGlB,OAAO,IAAI,OAAO,CAAC,SAAS,OAAO,EAAE,MAAM,EAAE;;IAE3C,IAAI,WAAW,CAAC,GAAG,CAAC,EAAE;MACpB,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;MACzB,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;KAC9B;;SAEI;MACH,QAAQ,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;KAChC;GACF,CAAC;GACD,IAAI,CAAC,SAAS,MAAM,EAAE;;IAErB,IAAI,UAAU,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,IAAI,UAAU,EAAE;MACd,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;;MAEpC,IAAI,UAAU,CAAC,MAAM,KAAK,MAAM,EAAE;QAChC,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;OACtF;KACF;IACD,OAAO,IAAI,OAAO,CAAC,UAAU,OAAO,EAAE,MAAM,EAAE;MAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;MACxD,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACrD,CAAC,CAAC;GACJ,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE;;;IAGtB,IAAI;MACF,IAAI,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;MACxE,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KACvC,CAAC,OAAO,CAAC,EAAE;MACV,IAAI,MAAM,CAAC,OAAO,EAAE;QAClB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,wCAAwC,GAAG,GAAG,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC;OAChF;KACF;IACD,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,kBAAkB,GAAG,IAAI,CAAC,GAAG,GAAG,aAAa,CAAC,CAAC;IACrE,mBAAmB,EAAE,CAAC;GACvB,CAAC,CAAC;CACJ,CAAC;;;AAGF,IAAI,SAAS;EACX,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC,AAEvC,AAAqC,;;,;;"}
\ No newline at end of file
public/novnc/vendor/browser-es-module-loader/rollup.config.js new
+16
@@ -0,0 +1,16 @@
1 +import nodeResolve from 'rollup-plugin-node-resolve';
2 +
3 +export default {
4 + entry: 'src/browser-es-module-loader.js',
5 + dest: 'dist/browser-es-module-loader.js',
6 + format: 'umd',
7 + moduleName: 'BrowserESModuleLoader',
8 + sourceMap: true,
9 +
10 + plugins: [
11 + nodeResolve(),
12 + ],
13 +
14 + // skip rollup warnings (specifically the eval warning)
15 + onwarn: function() {}
16 +};
public/novnc/vendor/browser-es-module-loader/src/babel-worker.js new
+25
@@ -0,0 +1,25 @@
1 +/*import { transform as babelTransform } from 'babel-core';
2 +import babelTransformDynamicImport from 'babel-plugin-syntax-dynamic-import';
3 +import babelTransformES2015ModulesSystemJS from 'babel-plugin-transform-es2015-modules-systemjs';*/
4 +
5 +// sadly, due to how rollup works, we can't use es6 imports here
6 +var babelTransform = require('babel-core').transform;
7 +var babelTransformDynamicImport = require('babel-plugin-syntax-dynamic-import');
8 +var babelTransformES2015ModulesSystemJS = require('babel-plugin-transform-es2015-modules-systemjs');
9 +var babelPresetES2015 = require('babel-preset-es2015');
10 +
11 +self.onmessage = function (evt) {
12 + // transform source with Babel
13 + var output = babelTransform(evt.data.source, {
14 + compact: false,
15 + filename: evt.data.key + '!transpiled',
16 + sourceFileName: evt.data.key,
17 + moduleIds: false,
18 + sourceMaps: 'inline',
19 + babelrc: false,
20 + plugins: [babelTransformDynamicImport, babelTransformES2015ModulesSystemJS],
21 + presets: [babelPresetES2015],
22 + });
23 +
24 + self.postMessage({key: evt.data.key, code: output.code, source: evt.data.source});
25 +};
public/novnc/vendor/browser-es-module-loader/src/browser-es-module-loader.js new
+280
@@ -0,0 +1,280 @@
1 +import RegisterLoader from 'es-module-loader/core/register-loader.js';
2 +import { InternalModuleNamespace as ModuleNamespace } from 'es-module-loader/core/loader-polyfill.js';
3 +
4 +import { baseURI, global, isBrowser } from 'es-module-loader/core/common.js';
5 +import { resolveIfNotPlain } from 'es-module-loader/core/resolve.js';
6 +
7 +var loader;
8 +
9 +// <script type="module"> support
10 +var anonSources = {};
11 +if (typeof document != 'undefined' && document.getElementsByTagName) {
12 + var handleError = function(err) {
13 + // dispatch an error event so that we can display in errors in browsers
14 + // that don't yet support unhandledrejection
15 + if (window.onunhandledrejection === undefined) {
16 + try {
17 + var evt = new Event('error');
18 + } catch (_eventError) {
19 + var evt = document.createEvent('Event');
20 + evt.initEvent('error', true, true);
21 + }
22 + evt.message = err.message;
23 + if (err.fileName) {
24 + evt.filename = err.fileName;
25 + evt.lineno = err.lineNumber;
26 + evt.colno = err.columnNumber;
27 + } else if (err.sourceURL) {
28 + evt.filename = err.sourceURL;
29 + evt.lineno = err.line;
30 + evt.colno = err.column;
31 + }
32 + evt.error = err;
33 + window.dispatchEvent(evt);
34 + }
35 +
36 + // throw so it still shows up in the console
37 + throw err;
38 + }
39 +
40 + var ready = function() {
41 + document.removeEventListener('DOMContentLoaded', ready, false );
42 +
43 + var anonCnt = 0;
44 +
45 + var scripts = document.getElementsByTagName('script');
46 + for (var i = 0; i < scripts.length; i++) {
47 + var script = scripts[i];
48 + if (script.type == 'module' && !script.loaded) {
49 + script.loaded = true;
50 + if (script.src) {
51 + loader.import(script.src).catch(handleError);
52 + }
53 + // anonymous modules supported via a custom naming scheme and registry
54 + else {
55 + var uri = './<anon' + ++anonCnt + '>.js';
56 + if (script.id !== ""){
57 + uri = "./" + script.id;
58 + }
59 +
60 + var anonName = resolveIfNotPlain(uri, baseURI);
61 + anonSources[anonName] = script.innerHTML;
62 + loader.import(anonName).catch(handleError);
63 + }
64 + }
65 + }
66 + }
67 +
68 + // simple DOM ready
69 + if (document.readyState !== 'loading')
70 + setTimeout(ready);
71 + else
72 + document.addEventListener('DOMContentLoaded', ready, false);
73 +}
74 +
75 +function BrowserESModuleLoader(baseKey) {
76 + if (baseKey)
77 + this.baseKey = resolveIfNotPlain(baseKey, baseURI) || resolveIfNotPlain('./' + baseKey, baseURI);
78 +
79 + RegisterLoader.call(this);
80 +
81 + var loader = this;
82 +
83 + // ensure System.register is available
84 + global.System = global.System || {};
85 + if (typeof global.System.register == 'function')
86 + var prevRegister = global.System.register;
87 + global.System.register = function() {
88 + loader.register.apply(loader, arguments);
89 + if (prevRegister)
90 + prevRegister.apply(this, arguments);
91 + };
92 +}
93 +BrowserESModuleLoader.prototype = Object.create(RegisterLoader.prototype);
94 +
95 +// normalize is never given a relative name like "./x", that part is already handled
96 +BrowserESModuleLoader.prototype[RegisterLoader.resolve] = function(key, parent) {
97 + var resolved = RegisterLoader.prototype[RegisterLoader.resolve].call(this, key, parent || this.baseKey) || key;
98 + if (!resolved)
99 + throw new RangeError('ES module loader does not resolve plain module names, resolving "' + key + '" to ' + parent);
100 +
101 + return resolved;
102 +};
103 +
104 +function xhrFetch(url, resolve, reject) {
105 + var xhr = new XMLHttpRequest();
106 + var load = function(source) {
107 + resolve(xhr.responseText);
108 + }
109 + var error = function() {
110 + reject(new Error('XHR error' + (xhr.status ? ' (' + xhr.status + (xhr.statusText ? ' ' + xhr.statusText : '') + ')' : '') + ' loading ' + url));
111 + }
112 +
113 + xhr.onreadystatechange = function () {
114 + if (xhr.readyState === 4) {
115 + // in Chrome on file:/// URLs, status is 0
116 + if (xhr.status == 0) {
117 + if (xhr.responseText) {
118 + load();
119 + }
120 + else {
121 + // when responseText is empty, wait for load or error event
122 + // to inform if it is a 404 or empty file
123 + xhr.addEventListener('error', error);
124 + xhr.addEventListener('load', load);
125 + }
126 + }
127 + else if (xhr.status === 200) {
128 + load();
129 + }
130 + else {
131 + error();
132 + }
133 + }
134 + };
135 + xhr.open("GET", url, true);
136 + xhr.send(null);
137 +}
138 +
139 +var WorkerPool = function (script, size) {
140 + var current = document.currentScript;
141 + // IE doesn't support currentScript
142 + if (!current) {
143 + // Find an entry with out basename
144 + var scripts = document.getElementsByTagName('script');
145 + for (var i = 0; i < scripts.length; i++) {
146 + if (scripts[i].src.indexOf("browser-es-module-loader.js") !== -1) {
147 + current = scripts[i];
148 + break;
149 + }
150 + }
151 + if (!current)
152 + throw Error("Could not find own <script> element");
153 + }
154 + script = current.src.substr(0, current.src.lastIndexOf("/")) + "/" + script;
155 + this._workers = new Array(size);
156 + this._ind = 0;
157 + this._size = size;
158 + this._jobs = 0;
159 + this.onmessage = undefined;
160 + this._stopTimeout = undefined;
161 + for (var i = 0; i < size; i++) {
162 + var wrkr = new Worker(script);
163 + wrkr._count = 0;
164 + wrkr._ind = i;
165 + wrkr.onmessage = this._onmessage.bind(this, wrkr);
166 + wrkr.onerror = this._onerror.bind(this);
167 + this._workers[i] = wrkr;
168 + }
169 +
170 + this._checkJobs();
171 +};
172 +WorkerPool.prototype = {
173 + postMessage: function (msg) {
174 + if (this._stopTimeout !== undefined) {
175 + clearTimeout(this._stopTimeout);
176 + this._stopTimeout = undefined;
177 + }
178 + var wrkr = this._workers[this._ind % this._size];
179 + wrkr._count++;
180 + this._jobs++;
181 + wrkr.postMessage(msg);
182 + this._ind++;
183 + },
184 +
185 + _onmessage: function (wrkr, evt) {
186 + wrkr._count--;
187 + this._jobs--;
188 + this.onmessage(evt, wrkr);
189 + this._checkJobs();
190 + },
191 +
192 + _onerror: function(err) {
193 + try {
194 + var evt = new Event('error');
195 + } catch (_eventError) {
196 + var evt = document.createEvent('Event');
197 + evt.initEvent('error', true, true);
198 + }
199 + evt.message = err.message;
200 + evt.filename = err.filename;
201 + evt.lineno = err.lineno;
202 + evt.colno = err.colno;
203 + evt.error = err.error;
204 + window.dispatchEvent(evt);
205 + },
206 +
207 + _checkJobs: function () {
208 + if (this._jobs === 0 && this._stopTimeout === undefined) {
209 + // wait for 2s of inactivity before stopping (that should be enough for local loading)
210 + this._stopTimeout = setTimeout(this._stop.bind(this), 2000);
211 + }
212 + },
213 +
214 + _stop: function () {
215 + this._workers.forEach(function(wrkr) {
216 + wrkr.terminate();
217 + });
218 + }
219 +};
220 +
221 +var promiseMap = new Map();
222 +var babelWorker = new WorkerPool('babel-worker.js', 3);
223 +babelWorker.onmessage = function (evt) {
224 + var promFuncs = promiseMap.get(evt.data.key);
225 + promFuncs.resolve(evt.data);
226 + promiseMap.delete(evt.data.key);
227 +};
228 +
229 +// instantiate just needs to run System.register
230 +// so we fetch the source, convert into the Babel System module format, then evaluate it
231 +BrowserESModuleLoader.prototype[RegisterLoader.instantiate] = function(key, processAnonRegister) {
232 + var loader = this;
233 +
234 + // load as ES with Babel converting into System.register
235 + return new Promise(function(resolve, reject) {
236 + // anonymous module
237 + if (anonSources[key]) {
238 + resolve(anonSources[key])
239 + anonSources[key] = undefined;
240 + }
241 + // otherwise we fetch
242 + else {
243 + xhrFetch(key, resolve, reject);
244 + }
245 + })
246 + .then(function(source) {
247 + // check our cache first
248 + var cacheEntry = localStorage.getItem(key);
249 + if (cacheEntry) {
250 + cacheEntry = JSON.parse(cacheEntry);
251 + // TODO: store a hash instead
252 + if (cacheEntry.source === source) {
253 + return Promise.resolve({key: key, code: cacheEntry.code, source: cacheEntry.source});
254 + }
255 + }
256 + return new Promise(function (resolve, reject) {
257 + promiseMap.set(key, {resolve: resolve, reject: reject});
258 + babelWorker.postMessage({key: key, source: source});
259 + });
260 + }).then(function (data) {
261 + // evaluate without require, exports and module variables
262 + // we leave module in for now to allow module.require access
263 + try {
264 + var cacheEntry = JSON.stringify({source: data.source, code: data.code});
265 + localStorage.setItem(key, cacheEntry);
266 + } catch (e) {
267 + if (window.console) {
268 + window.console.warn('Unable to cache transpiled version of ' + key + ': ' + e);
269 + }
270 + }
271 + (0, eval)(data.code + '\n//# sourceURL=' + data.key + '!transpiled');
272 + processAnonRegister();
273 + });
274 +};
275 +
276 +// create a default loader instance in the browser
277 +if (isBrowser)
278 + loader = new BrowserESModuleLoader();
279 +
280 +export default BrowserESModuleLoader;
public/novnc/vendor/pako/LICENSE new
+21
@@ -0,0 +1,21 @@
1 +(The MIT License)
2 +
3 +Copyright (C) 2014-2016 by Vitaly Puzrin
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
public/novnc/vendor/pako/README.md new
+6
@@ -0,0 +1,6 @@
1 +This is an ES6-modules-compatible version of
2 +https://github.com/nodeca/pako, based on pako version 1.0.3.
3 +
4 +It's more-or-less a direct translation of the original, with unused parts
5 +removed, and the dynamic support for non-typed arrays removed (since ES6
6 +modules don't work well with dynamic exports).
public/novnc/vendor/pako/lib/utils/common.js new
+45
@@ -0,0 +1,45 @@
1 +// reduce buffer size, avoiding mem copy
2 +export function shrinkBuf (buf, size) {
3 + if (buf.length === size) { return buf; }
4 + if (buf.subarray) { return buf.subarray(0, size); }
5 + buf.length = size;
6 + return buf;
7 +};
8 +
9 +
10 +export function arraySet (dest, src, src_offs, len, dest_offs) {
11 + if (src.subarray && dest.subarray) {
12 + dest.set(src.subarray(src_offs, src_offs + len), dest_offs);
13 + return;
14 + }
15 + // Fallback to ordinary array
16 + for (var i = 0; i < len; i++) {
17 + dest[dest_offs + i] = src[src_offs + i];
18 + }
19 +}
20 +
21 +// Join array of chunks to single array.
22 +export function flattenChunks (chunks) {
23 + var i, l, len, pos, chunk, result;
24 +
25 + // calculate data length
26 + len = 0;
27 + for (i = 0, l = chunks.length; i < l; i++) {
28 + len += chunks[i].length;
29 + }
30 +
31 + // join chunks
32 + result = new Uint8Array(len);
33 + pos = 0;
34 + for (i = 0, l = chunks.length; i < l; i++) {
35 + chunk = chunks[i];
36 + result.set(chunk, pos);
37 + pos += chunk.length;
38 + }
39 +
40 + return result;
41 +}
42 +
43 +export var Buf8 = Uint8Array;
44 +export var Buf16 = Uint16Array;
45 +export var Buf32 = Int32Array;
public/novnc/vendor/pako/lib/zlib/adler32.js new
+27
@@ -0,0 +1,27 @@
1 +// Note: adler32 takes 12% for level 0 and 2% for level 6.
2 +// It doesn't worth to make additional optimizationa as in original.
3 +// Small size is preferable.
4 +
5 +export default function adler32(adler, buf, len, pos) {
6 + var s1 = (adler & 0xffff) |0,
7 + s2 = ((adler >>> 16) & 0xffff) |0,
8 + n = 0;
9 +
10 + while (len !== 0) {
11 + // Set limit ~ twice less than 5552, to keep
12 + // s2 in 31-bits, because we force signed ints.
13 + // in other case %= will fail.
14 + n = len > 2000 ? 2000 : len;
15 + len -= n;
16 +
17 + do {
18 + s1 = (s1 + buf[pos++]) |0;
19 + s2 = (s2 + s1) |0;
20 + } while (--n);
21 +
22 + s1 %= 65521;
23 + s2 %= 65521;
24 + }
25 +
26 + return (s1 | (s2 << 16)) |0;
27 +}
public/novnc/vendor/pako/lib/zlib/constants.js new
+47
@@ -0,0 +1,47 @@
1 +export default {
2 +
3 + /* Allowed flush values; see deflate() and inflate() below for details */
4 + Z_NO_FLUSH: 0,
5 + Z_PARTIAL_FLUSH: 1,
6 + Z_SYNC_FLUSH: 2,
7 + Z_FULL_FLUSH: 3,
8 + Z_FINISH: 4,
9 + Z_BLOCK: 5,
10 + Z_TREES: 6,
11 +
12 + /* Return codes for the compression/decompression functions. Negative values
13 + * are errors, positive values are used for special but normal events.
14 + */
15 + Z_OK: 0,
16 + Z_STREAM_END: 1,
17 + Z_NEED_DICT: 2,
18 + Z_ERRNO: -1,
19 + Z_STREAM_ERROR: -2,
20 + Z_DATA_ERROR: -3,
21 + //Z_MEM_ERROR: -4,
22 + Z_BUF_ERROR: -5,
23 + //Z_VERSION_ERROR: -6,
24 +
25 + /* compression levels */
26 + Z_NO_COMPRESSION: 0,
27 + Z_BEST_SPEED: 1,
28 + Z_BEST_COMPRESSION: 9,
29 + Z_DEFAULT_COMPRESSION: -1,
30 +
31 +
32 + Z_FILTERED: 1,
33 + Z_HUFFMAN_ONLY: 2,
34 + Z_RLE: 3,
35 + Z_FIXED: 4,
36 + Z_DEFAULT_STRATEGY: 0,
37 +
38 + /* Possible values of the data_type field (though see inflate()) */
39 + Z_BINARY: 0,
40 + Z_TEXT: 1,
41 + //Z_ASCII: 1, // = Z_TEXT (deprecated)
42 + Z_UNKNOWN: 2,
43 +
44 + /* The deflate compression method */
45 + Z_DEFLATED: 8
46 + //Z_NULL: null // Use -1 or null inline, depending on var type
47 +};
public/novnc/vendor/pako/lib/zlib/crc32.js new
+36
@@ -0,0 +1,36 @@
1 +// Note: we can't get significant speed boost here.
2 +// So write code to minimize size - no pregenerated tables
3 +// and array tools dependencies.
4 +
5 +
6 +// Use ordinary array, since untyped makes no boost here
7 +export default function makeTable() {
8 + var c, table = [];
9 +
10 + for (var n = 0; n < 256; n++) {
11 + c = n;
12 + for (var k = 0; k < 8; k++) {
13 + c = ((c & 1) ? (0xEDB88320 ^ (c >>> 1)) : (c >>> 1));
14 + }
15 + table[n] = c;
16 + }
17 +
18 + return table;
19 +}
20 +
21 +// Create table on load. Just 255 signed longs. Not a problem.
22 +var crcTable = makeTable();
23 +
24 +
25 +function crc32(crc, buf, len, pos) {
26 + var t = crcTable,
27 + end = pos + len;
28 +
29 + crc ^= -1;
30 +
31 + for (var i = pos; i < end; i++) {
32 + crc = (crc >>> 8) ^ t[(crc ^ buf[i]) & 0xFF];
33 + }
34 +
35 + return (crc ^ (-1)); // >>> 0;
36 +}
public/novnc/vendor/pako/lib/zlib/deflate.js new
+1846
@@ -0,0 +1,1846 @@
1 +import * as utils from "../utils/common.js";
2 +import * as trees from "./trees.js";
3 +import adler32 from "./adler32.js";
4 +import crc32 from "./crc32.js";
5 +import msg from "./messages.js";
6 +
7 +/* Public constants ==========================================================*/
8 +/* ===========================================================================*/
9 +
10 +
11 +/* Allowed flush values; see deflate() and inflate() below for details */
12 +var Z_NO_FLUSH = 0;
13 +var Z_PARTIAL_FLUSH = 1;
14 +//var Z_SYNC_FLUSH = 2;
15 +var Z_FULL_FLUSH = 3;
16 +var Z_FINISH = 4;
17 +var Z_BLOCK = 5;
18 +//var Z_TREES = 6;
19 +
20 +
21 +/* Return codes for the compression/decompression functions. Negative values
22 + * are errors, positive values are used for special but normal events.
23 + */
24 +var Z_OK = 0;
25 +var Z_STREAM_END = 1;
26 +//var Z_NEED_DICT = 2;
27 +//var Z_ERRNO = -1;
28 +var Z_STREAM_ERROR = -2;
29 +var Z_DATA_ERROR = -3;
30 +//var Z_MEM_ERROR = -4;
31 +var Z_BUF_ERROR = -5;
32 +//var Z_VERSION_ERROR = -6;
33 +
34 +
35 +/* compression levels */
36 +//var Z_NO_COMPRESSION = 0;
37 +//var Z_BEST_SPEED = 1;
38 +//var Z_BEST_COMPRESSION = 9;
39 +var Z_DEFAULT_COMPRESSION = -1;
40 +
41 +
42 +var Z_FILTERED = 1;
43 +var Z_HUFFMAN_ONLY = 2;
44 +var Z_RLE = 3;
45 +var Z_FIXED = 4;
46 +var Z_DEFAULT_STRATEGY = 0;
47 +
48 +/* Possible values of the data_type field (though see inflate()) */
49 +//var Z_BINARY = 0;
50 +//var Z_TEXT = 1;
51 +//var Z_ASCII = 1; // = Z_TEXT
52 +var Z_UNKNOWN = 2;
53 +
54 +
55 +/* The deflate compression method */
56 +var Z_DEFLATED = 8;
57 +
58 +/*============================================================================*/
59 +
60 +
61 +var MAX_MEM_LEVEL = 9;
62 +/* Maximum value for memLevel in deflateInit2 */
63 +var MAX_WBITS = 15;
64 +/* 32K LZ77 window */
65 +var DEF_MEM_LEVEL = 8;
66 +
67 +
68 +var LENGTH_CODES = 29;
69 +/* number of length codes, not counting the special END_BLOCK code */
70 +var LITERALS = 256;
71 +/* number of literal bytes 0..255 */
72 +var L_CODES = LITERALS + 1 + LENGTH_CODES;
73 +/* number of Literal or Length codes, including the END_BLOCK code */
74 +var D_CODES = 30;
75 +/* number of distance codes */
76 +var BL_CODES = 19;
77 +/* number of codes used to transfer the bit lengths */
78 +var HEAP_SIZE = 2 * L_CODES + 1;
79 +/* maximum heap size */
80 +var MAX_BITS = 15;
81 +/* All codes must not exceed MAX_BITS bits */
82 +
83 +var MIN_MATCH = 3;
84 +var MAX_MATCH = 258;
85 +var MIN_LOOKAHEAD = (MAX_MATCH + MIN_MATCH + 1);
86 +
87 +var PRESET_DICT = 0x20;
88 +
89 +var INIT_STATE = 42;
90 +var EXTRA_STATE = 69;
91 +var NAME_STATE = 73;
92 +var COMMENT_STATE = 91;
93 +var HCRC_STATE = 103;
94 +var BUSY_STATE = 113;
95 +var FINISH_STATE = 666;
96 +
97 +var BS_NEED_MORE = 1; /* block not completed, need more input or more output */
98 +var BS_BLOCK_DONE = 2; /* block flush performed */
99 +var BS_FINISH_STARTED = 3; /* finish started, need only more output at next deflate */
100 +var BS_FINISH_DONE = 4; /* finish done, accept no more input or output */
101 +
102 +var OS_CODE = 0x03; // Unix :) . Don't detect, use this default.
103 +
104 +function err(strm, errorCode) {
105 + strm.msg = msg[errorCode];
106 + return errorCode;
107 +}
108 +
109 +function rank(f) {
110 + return ((f) << 1) - ((f) > 4 ? 9 : 0);
111 +}
112 +
113 +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
114 +
115 +
116 +/* =========================================================================
117 + * Flush as much pending output as possible. All deflate() output goes
118 + * through this function so some applications may wish to modify it
119 + * to avoid allocating a large strm->output buffer and copying into it.
120 + * (See also read_buf()).
121 + */
122 +function flush_pending(strm) {
123 + var s = strm.state;
124 +
125 + //_tr_flush_bits(s);
126 + var len = s.pending;
127 + if (len > strm.avail_out) {
128 + len = strm.avail_out;
129 + }
130 + if (len === 0) { return; }
131 +
132 + utils.arraySet(strm.output, s.pending_buf, s.pending_out, len, strm.next_out);
133 + strm.next_out += len;
134 + s.pending_out += len;
135 + strm.total_out += len;
136 + strm.avail_out -= len;
137 + s.pending -= len;
138 + if (s.pending === 0) {
139 + s.pending_out = 0;
140 + }
141 +}
142 +
143 +
144 +function flush_block_only(s, last) {
145 + trees._tr_flush_block(s, (s.block_start >= 0 ? s.block_start : -1), s.strstart - s.block_start, last);
146 + s.block_start = s.strstart;
147 + flush_pending(s.strm);
148 +}
149 +
150 +
151 +function put_byte(s, b) {
152 + s.pending_buf[s.pending++] = b;
153 +}
154 +
155 +
156 +/* =========================================================================
157 + * Put a short in the pending buffer. The 16-bit value is put in MSB order.
158 + * IN assertion: the stream state is correct and there is enough room in
159 + * pending_buf.
160 + */
161 +function putShortMSB(s, b) {
162 +// put_byte(s, (Byte)(b >> 8));
163 +// put_byte(s, (Byte)(b & 0xff));
164 + s.pending_buf[s.pending++] = (b >>> 8) & 0xff;
165 + s.pending_buf[s.pending++] = b & 0xff;
166 +}
167 +
168 +
169 +/* ===========================================================================
170 + * Read a new buffer from the current input stream, update the adler32
171 + * and total number of bytes read. All deflate() input goes through
172 + * this function so some applications may wish to modify it to avoid
173 + * allocating a large strm->input buffer and copying from it.
174 + * (See also flush_pending()).
175 + */
176 +function read_buf(strm, buf, start, size) {
177 + var len = strm.avail_in;
178 +
179 + if (len > size) { len = size; }
180 + if (len === 0) { return 0; }
181 +
182 + strm.avail_in -= len;
183 +
184 + // zmemcpy(buf, strm->next_in, len);
185 + utils.arraySet(buf, strm.input, strm.next_in, len, start);
186 + if (strm.state.wrap === 1) {
187 + strm.adler = adler32(strm.adler, buf, len, start);
188 + }
189 +
190 + else if (strm.state.wrap === 2) {
191 + strm.adler = crc32(strm.adler, buf, len, start);
192 + }
193 +
194 + strm.next_in += len;
195 + strm.total_in += len;
196 +
197 + return len;
198 +}
199 +
200 +
201 +/* ===========================================================================
202 + * Set match_start to the longest match starting at the given string and
203 + * return its length. Matches shorter or equal to prev_length are discarded,
204 + * in which case the result is equal to prev_length and match_start is
205 + * garbage.
206 + * IN assertions: cur_match is the head of the hash chain for the current
207 + * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
208 + * OUT assertion: the match length is not greater than s->lookahead.
209 + */
210 +function longest_match(s, cur_match) {
211 + var chain_length = s.max_chain_length; /* max hash chain length */
212 + var scan = s.strstart; /* current string */
213 + var match; /* matched string */
214 + var len; /* length of current match */
215 + var best_len = s.prev_length; /* best match length so far */
216 + var nice_match = s.nice_match; /* stop if match long enough */
217 + var limit = (s.strstart > (s.w_size - MIN_LOOKAHEAD)) ?
218 + s.strstart - (s.w_size - MIN_LOOKAHEAD) : 0/*NIL*/;
219 +
220 + var _win = s.window; // shortcut
221 +
222 + var wmask = s.w_mask;
223 + var prev = s.prev;
224 +
225 + /* Stop when cur_match becomes <= limit. To simplify the code,
226 + * we prevent matches with the string of window index 0.
227 + */
228 +
229 + var strend = s.strstart + MAX_MATCH;
230 + var scan_end1 = _win[scan + best_len - 1];
231 + var scan_end = _win[scan + best_len];
232 +
233 + /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
234 + * It is easy to get rid of this optimization if necessary.
235 + */
236 + // Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
237 +
238 + /* Do not waste too much time if we already have a good match: */
239 + if (s.prev_length >= s.good_match) {
240 + chain_length >>= 2;
241 + }
242 + /* Do not look for matches beyond the end of the input. This is necessary
243 + * to make deflate deterministic.
244 + */
245 + if (nice_match > s.lookahead) { nice_match = s.lookahead; }
246 +
247 + // Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
248 +
249 + do {
250 + // Assert(cur_match < s->strstart, "no future");
251 + match = cur_match;
252 +
253 + /* Skip to next match if the match length cannot increase
254 + * or if the match length is less than 2. Note that the checks below
255 + * for insufficient lookahead only occur occasionally for performance
256 + * reasons. Therefore uninitialized memory will be accessed, and
257 + * conditional jumps will be made that depend on those values.
258 + * However the length of the match is limited to the lookahead, so
259 + * the output of deflate is not affected by the uninitialized values.
260 + */
261 +
262 + if (_win[match + best_len] !== scan_end ||
263 + _win[match + best_len - 1] !== scan_end1 ||
264 + _win[match] !== _win[scan] ||
265 + _win[++match] !== _win[scan + 1]) {
266 + continue;
267 + }
268 +
269 + /* The check at best_len-1 can be removed because it will be made
270 + * again later. (This heuristic is not always a win.)
271 + * It is not necessary to compare scan[2] and match[2] since they
272 + * are always equal when the other bytes match, given that
273 + * the hash keys are equal and that HASH_BITS >= 8.
274 + */
275 + scan += 2;
276 + match++;
277 + // Assert(*scan == *match, "match[2]?");
278 +
279 + /* We check for insufficient lookahead only every 8th comparison;
280 + * the 256th check will be made at strstart+258.
281 + */
282 + do {
283 + // Do nothing
284 + } while (_win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
285 + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
286 + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
287 + _win[++scan] === _win[++match] && _win[++scan] === _win[++match] &&
288 + scan < strend);
289 +
290 + // Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
291 +
292 + len = MAX_MATCH - (strend - scan);
293 + scan = strend - MAX_MATCH;
294 +
295 + if (len > best_len) {
296 + s.match_start = cur_match;
297 + best_len = len;
298 + if (len >= nice_match) {
299 + break;
300 + }
301 + scan_end1 = _win[scan + best_len - 1];
302 + scan_end = _win[scan + best_len];
303 + }
304 + } while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length !== 0);
305 +
306 + if (best_len <= s.lookahead) {
307 + return best_len;
308 + }
309 + return s.lookahead;
310 +}
311 +
312 +
313 +/* ===========================================================================
314 + * Fill the window when the lookahead becomes insufficient.
315 + * Updates strstart and lookahead.
316 + *
317 + * IN assertion: lookahead < MIN_LOOKAHEAD
318 + * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD
319 + * At least one byte has been read, or avail_in == 0; reads are
320 + * performed for at least two bytes (required for the zip translate_eol
321 + * option -- not supported here).
322 + */
323 +function fill_window(s) {
324 + var _w_size = s.w_size;
325 + var p, n, m, more, str;
326 +
327 + //Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
328 +
329 + do {
330 + more = s.window_size - s.lookahead - s.strstart;
331 +
332 + // JS ints have 32 bit, block below not needed
333 + /* Deal with !@#$% 64K limit: */
334 + //if (sizeof(int) <= 2) {
335 + // if (more == 0 && s->strstart == 0 && s->lookahead == 0) {
336 + // more = wsize;
337 + //
338 + // } else if (more == (unsigned)(-1)) {
339 + // /* Very unlikely, but possible on 16 bit machine if
340 + // * strstart == 0 && lookahead == 1 (input done a byte at time)
341 + // */
342 + // more--;
343 + // }
344 + //}
345 +
346 +
347 + /* If the window is almost full and there is insufficient lookahead,
348 + * move the upper half to the lower one to make room in the upper half.
349 + */
350 + if (s.strstart >= _w_size + (_w_size - MIN_LOOKAHEAD)) {
351 +
352 + utils.arraySet(s.window, s.window, _w_size, _w_size, 0);
353 + s.match_start -= _w_size;
354 + s.strstart -= _w_size;
355 + /* we now have strstart >= MAX_DIST */
356 + s.block_start -= _w_size;
357 +
358 + /* Slide the hash table (could be avoided with 32 bit values
359 + at the expense of memory usage). We slide even when level == 0
360 + to keep the hash table consistent if we switch back to level > 0
361 + later. (Using level 0 permanently is not an optimal usage of
362 + zlib, so we don't care about this pathological case.)
363 + */
364 +
365 + n = s.hash_size;
366 + p = n;
367 + do {
368 + m = s.head[--p];
369 + s.head[p] = (m >= _w_size ? m - _w_size : 0);
370 + } while (--n);
371 +
372 + n = _w_size;
373 + p = n;
374 + do {
375 + m = s.prev[--p];
376 + s.prev[p] = (m >= _w_size ? m - _w_size : 0);
377 + /* If n is not on any hash chain, prev[n] is garbage but
378 + * its value will never be used.
379 + */
380 + } while (--n);
381 +
382 + more += _w_size;
383 + }
384 + if (s.strm.avail_in === 0) {
385 + break;
386 + }
387 +
388 + /* If there was no sliding:
389 + * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 &&
390 + * more == window_size - lookahead - strstart
391 + * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1)
392 + * => more >= window_size - 2*WSIZE + 2
393 + * In the BIG_MEM or MMAP case (not yet supported),
394 + * window_size == input_size + MIN_LOOKAHEAD &&
395 + * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
396 + * Otherwise, window_size == 2*WSIZE so more >= 2.
397 + * If there was sliding, more >= WSIZE. So in all cases, more >= 2.
398 + */
399 + //Assert(more >= 2, "more < 2");
400 + n = read_buf(s.strm, s.window, s.strstart + s.lookahead, more);
401 + s.lookahead += n;
402 +
403 + /* Initialize the hash value now that we have some input: */
404 + if (s.lookahead + s.insert >= MIN_MATCH) {
405 + str = s.strstart - s.insert;
406 + s.ins_h = s.window[str];
407 +
408 + /* UPDATE_HASH(s, s->ins_h, s->window[str + 1]); */
409 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + 1]) & s.hash_mask;
410 +//#if MIN_MATCH != 3
411 +// Call update_hash() MIN_MATCH-3 more times
412 +//#endif
413 + while (s.insert) {
414 + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
415 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
416 +
417 + s.prev[str & s.w_mask] = s.head[s.ins_h];
418 + s.head[s.ins_h] = str;
419 + str++;
420 + s.insert--;
421 + if (s.lookahead + s.insert < MIN_MATCH) {
422 + break;
423 + }
424 + }
425 + }
426 + /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage,
427 + * but this is not important since only literal bytes will be emitted.
428 + */
429 +
430 + } while (s.lookahead < MIN_LOOKAHEAD && s.strm.avail_in !== 0);
431 +
432 + /* If the WIN_INIT bytes after the end of the current data have never been
433 + * written, then zero those bytes in order to avoid memory check reports of
434 + * the use of uninitialized (or uninitialised as Julian writes) bytes by
435 + * the longest match routines. Update the high water mark for the next
436 + * time through here. WIN_INIT is set to MAX_MATCH since the longest match
437 + * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead.
438 + */
439 +// if (s.high_water < s.window_size) {
440 +// var curr = s.strstart + s.lookahead;
441 +// var init = 0;
442 +//
443 +// if (s.high_water < curr) {
444 +// /* Previous high water mark below current data -- zero WIN_INIT
445 +// * bytes or up to end of window, whichever is less.
446 +// */
447 +// init = s.window_size - curr;
448 +// if (init > WIN_INIT)
449 +// init = WIN_INIT;
450 +// zmemzero(s->window + curr, (unsigned)init);
451 +// s->high_water = curr + init;
452 +// }
453 +// else if (s->high_water < (ulg)curr + WIN_INIT) {
454 +// /* High water mark at or above current data, but below current data
455 +// * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up
456 +// * to end of window, whichever is less.
457 +// */
458 +// init = (ulg)curr + WIN_INIT - s->high_water;
459 +// if (init > s->window_size - s->high_water)
460 +// init = s->window_size - s->high_water;
461 +// zmemzero(s->window + s->high_water, (unsigned)init);
462 +// s->high_water += init;
463 +// }
464 +// }
465 +//
466 +// Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
467 +// "not enough room for search");
468 +}
469 +
470 +/* ===========================================================================
471 + * Copy without compression as much as possible from the input stream, return
472 + * the current block state.
473 + * This function does not insert new strings in the dictionary since
474 + * uncompressible data is probably not useful. This function is used
475 + * only for the level=0 compression option.
476 + * NOTE: this function should be optimized to avoid extra copying from
477 + * window to pending_buf.
478 + */
479 +function deflate_stored(s, flush) {
480 + /* Stored blocks are limited to 0xffff bytes, pending_buf is limited
481 + * to pending_buf_size, and each stored block has a 5 byte header:
482 + */
483 + var max_block_size = 0xffff;
484 +
485 + if (max_block_size > s.pending_buf_size - 5) {
486 + max_block_size = s.pending_buf_size - 5;
487 + }
488 +
489 + /* Copy as much as possible from input to output: */
490 + for (;;) {
491 + /* Fill the window as much as possible: */
492 + if (s.lookahead <= 1) {
493 +
494 + //Assert(s->strstart < s->w_size+MAX_DIST(s) ||
495 + // s->block_start >= (long)s->w_size, "slide too late");
496 +// if (!(s.strstart < s.w_size + (s.w_size - MIN_LOOKAHEAD) ||
497 +// s.block_start >= s.w_size)) {
498 +// throw new Error("slide too late");
499 +// }
500 +
501 + fill_window(s);
502 + if (s.lookahead === 0 && flush === Z_NO_FLUSH) {
503 + return BS_NEED_MORE;
504 + }
505 +
506 + if (s.lookahead === 0) {
507 + break;
508 + }
509 + /* flush the current block */
510 + }
511 + //Assert(s->block_start >= 0L, "block gone");
512 +// if (s.block_start < 0) throw new Error("block gone");
513 +
514 + s.strstart += s.lookahead;
515 + s.lookahead = 0;
516 +
517 + /* Emit a stored block if pending_buf will be full: */
518 + var max_start = s.block_start + max_block_size;
519 +
520 + if (s.strstart === 0 || s.strstart >= max_start) {
521 + /* strstart == 0 is possible when wraparound on 16-bit machine */
522 + s.lookahead = s.strstart - max_start;
523 + s.strstart = max_start;
524 + /*** FLUSH_BLOCK(s, 0); ***/
525 + flush_block_only(s, false);
526 + if (s.strm.avail_out === 0) {
527 + return BS_NEED_MORE;
528 + }
529 + /***/
530 +
531 +
532 + }
533 + /* Flush if we may have to slide, otherwise block_start may become
534 + * negative and the data will be gone:
535 + */
536 + if (s.strstart - s.block_start >= (s.w_size - MIN_LOOKAHEAD)) {
537 + /*** FLUSH_BLOCK(s, 0); ***/
538 + flush_block_only(s, false);
539 + if (s.strm.avail_out === 0) {
540 + return BS_NEED_MORE;
541 + }
542 + /***/
543 + }
544 + }
545 +
546 + s.insert = 0;
547 +
548 + if (flush === Z_FINISH) {
549 + /*** FLUSH_BLOCK(s, 1); ***/
550 + flush_block_only(s, true);
551 + if (s.strm.avail_out === 0) {
552 + return BS_FINISH_STARTED;
553 + }
554 + /***/
555 + return BS_FINISH_DONE;
556 + }
557 +
558 + if (s.strstart > s.block_start) {
559 + /*** FLUSH_BLOCK(s, 0); ***/
560 + flush_block_only(s, false);
561 + if (s.strm.avail_out === 0) {
562 + return BS_NEED_MORE;
563 + }
564 + /***/
565 + }
566 +
567 + return BS_NEED_MORE;
568 +}
569 +
570 +/* ===========================================================================
571 + * Compress as much as possible from the input stream, return the current
572 + * block state.
573 + * This function does not perform lazy evaluation of matches and inserts
574 + * new strings in the dictionary only for unmatched strings or for short
575 + * matches. It is used only for the fast compression options.
576 + */
577 +function deflate_fast(s, flush) {
578 + var hash_head; /* head of the hash chain */
579 + var bflush; /* set if current block must be flushed */
580 +
581 + for (;;) {
582 + /* Make sure that we always have enough lookahead, except
583 + * at the end of the input file. We need MAX_MATCH bytes
584 + * for the next match, plus MIN_MATCH bytes to insert the
585 + * string following the next match.
586 + */
587 + if (s.lookahead < MIN_LOOKAHEAD) {
588 + fill_window(s);
589 + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
590 + return BS_NEED_MORE;
591 + }
592 + if (s.lookahead === 0) {
593 + break; /* flush the current block */
594 + }
595 + }
596 +
597 + /* Insert the string window[strstart .. strstart+2] in the
598 + * dictionary, and set hash_head to the head of the hash chain:
599 + */
600 + hash_head = 0/*NIL*/;
601 + if (s.lookahead >= MIN_MATCH) {
602 + /*** INSERT_STRING(s, s.strstart, hash_head); ***/
603 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
604 + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
605 + s.head[s.ins_h] = s.strstart;
606 + /***/
607 + }
608 +
609 + /* Find the longest match, discarding those <= prev_length.
610 + * At this point we have always match_length < MIN_MATCH
611 + */
612 + if (hash_head !== 0/*NIL*/ && ((s.strstart - hash_head) <= (s.w_size - MIN_LOOKAHEAD))) {
613 + /* To simplify the code, we prevent matches with the string
614 + * of window index 0 (in particular we have to avoid a match
615 + * of the string with itself at the start of the input file).
616 + */
617 + s.match_length = longest_match(s, hash_head);
618 + /* longest_match() sets match_start */
619 + }
620 + if (s.match_length >= MIN_MATCH) {
621 + // check_match(s, s.strstart, s.match_start, s.match_length); // for debug only
622 +
623 + /*** _tr_tally_dist(s, s.strstart - s.match_start,
624 + s.match_length - MIN_MATCH, bflush); ***/
625 + bflush = trees._tr_tally(s, s.strstart - s.match_start, s.match_length - MIN_MATCH);
626 +
627 + s.lookahead -= s.match_length;
628 +
629 + /* Insert new strings in the hash table only if the match length
630 + * is not too large. This saves time but degrades compression.
631 + */
632 + if (s.match_length <= s.max_lazy_match/*max_insert_length*/ && s.lookahead >= MIN_MATCH) {
633 + s.match_length--; /* string at strstart already in table */
634 + do {
635 + s.strstart++;
636 + /*** INSERT_STRING(s, s.strstart, hash_head); ***/
637 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
638 + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
639 + s.head[s.ins_h] = s.strstart;
640 + /***/
641 + /* strstart never exceeds WSIZE-MAX_MATCH, so there are
642 + * always MIN_MATCH bytes ahead.
643 + */
644 + } while (--s.match_length !== 0);
645 + s.strstart++;
646 + } else
647 + {
648 + s.strstart += s.match_length;
649 + s.match_length = 0;
650 + s.ins_h = s.window[s.strstart];
651 + /* UPDATE_HASH(s, s.ins_h, s.window[s.strstart+1]); */
652 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + 1]) & s.hash_mask;
653 +
654 +//#if MIN_MATCH != 3
655 +// Call UPDATE_HASH() MIN_MATCH-3 more times
656 +//#endif
657 + /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not
658 + * matter since it will be recomputed at next deflate call.
659 + */
660 + }
661 + } else {
662 + /* No match, output a literal byte */
663 + //Tracevv((stderr,"%c", s.window[s.strstart]));
664 + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
665 + bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
666 +
667 + s.lookahead--;
668 + s.strstart++;
669 + }
670 + if (bflush) {
671 + /*** FLUSH_BLOCK(s, 0); ***/
672 + flush_block_only(s, false);
673 + if (s.strm.avail_out === 0) {
674 + return BS_NEED_MORE;
675 + }
676 + /***/
677 + }
678 + }
679 + s.insert = ((s.strstart < (MIN_MATCH - 1)) ? s.strstart : MIN_MATCH - 1);
680 + if (flush === Z_FINISH) {
681 + /*** FLUSH_BLOCK(s, 1); ***/
682 + flush_block_only(s, true);
683 + if (s.strm.avail_out === 0) {
684 + return BS_FINISH_STARTED;
685 + }
686 + /***/
687 + return BS_FINISH_DONE;
688 + }
689 + if (s.last_lit) {
690 + /*** FLUSH_BLOCK(s, 0); ***/
691 + flush_block_only(s, false);
692 + if (s.strm.avail_out === 0) {
693 + return BS_NEED_MORE;
694 + }
695 + /***/
696 + }
697 + return BS_BLOCK_DONE;
698 +}
699 +
700 +/* ===========================================================================
701 + * Same as above, but achieves better compression. We use a lazy
702 + * evaluation for matches: a match is finally adopted only if there is
703 + * no better match at the next window position.
704 + */
705 +function deflate_slow(s, flush) {
706 + var hash_head; /* head of hash chain */
707 + var bflush; /* set if current block must be flushed */
708 +
709 + var max_insert;
710 +
711 + /* Process the input block. */
712 + for (;;) {
713 + /* Make sure that we always have enough lookahead, except
714 + * at the end of the input file. We need MAX_MATCH bytes
715 + * for the next match, plus MIN_MATCH bytes to insert the
716 + * string following the next match.
717 + */
718 + if (s.lookahead < MIN_LOOKAHEAD) {
719 + fill_window(s);
720 + if (s.lookahead < MIN_LOOKAHEAD && flush === Z_NO_FLUSH) {
721 + return BS_NEED_MORE;
722 + }
723 + if (s.lookahead === 0) { break; } /* flush the current block */
724 + }
725 +
726 + /* Insert the string window[strstart .. strstart+2] in the
727 + * dictionary, and set hash_head to the head of the hash chain:
728 + */
729 + hash_head = 0/*NIL*/;
730 + if (s.lookahead >= MIN_MATCH) {
731 + /*** INSERT_STRING(s, s.strstart, hash_head); ***/
732 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
733 + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
734 + s.head[s.ins_h] = s.strstart;
735 + /***/
736 + }
737 +
738 + /* Find the longest match, discarding those <= prev_length.
739 + */
740 + s.prev_length = s.match_length;
741 + s.prev_match = s.match_start;
742 + s.match_length = MIN_MATCH - 1;
743 +
744 + if (hash_head !== 0/*NIL*/ && s.prev_length < s.max_lazy_match &&
745 + s.strstart - hash_head <= (s.w_size - MIN_LOOKAHEAD)/*MAX_DIST(s)*/) {
746 + /* To simplify the code, we prevent matches with the string
747 + * of window index 0 (in particular we have to avoid a match
748 + * of the string with itself at the start of the input file).
749 + */
750 + s.match_length = longest_match(s, hash_head);
751 + /* longest_match() sets match_start */
752 +
753 + if (s.match_length <= 5 &&
754 + (s.strategy === Z_FILTERED || (s.match_length === MIN_MATCH && s.strstart - s.match_start > 4096/*TOO_FAR*/))) {
755 +
756 + /* If prev_match is also MIN_MATCH, match_start is garbage
757 + * but we will ignore the current match anyway.
758 + */
759 + s.match_length = MIN_MATCH - 1;
760 + }
761 + }
762 + /* If there was a match at the previous step and the current
763 + * match is not better, output the previous match:
764 + */
765 + if (s.prev_length >= MIN_MATCH && s.match_length <= s.prev_length) {
766 + max_insert = s.strstart + s.lookahead - MIN_MATCH;
767 + /* Do not insert strings in hash table beyond this. */
768 +
769 + //check_match(s, s.strstart-1, s.prev_match, s.prev_length);
770 +
771 + /***_tr_tally_dist(s, s.strstart - 1 - s.prev_match,
772 + s.prev_length - MIN_MATCH, bflush);***/
773 + bflush = trees._tr_tally(s, s.strstart - 1 - s.prev_match, s.prev_length - MIN_MATCH);
774 + /* Insert in hash table all strings up to the end of the match.
775 + * strstart-1 and strstart are already inserted. If there is not
776 + * enough lookahead, the last two strings are not inserted in
777 + * the hash table.
778 + */
779 + s.lookahead -= s.prev_length - 1;
780 + s.prev_length -= 2;
781 + do {
782 + if (++s.strstart <= max_insert) {
783 + /*** INSERT_STRING(s, s.strstart, hash_head); ***/
784 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[s.strstart + MIN_MATCH - 1]) & s.hash_mask;
785 + hash_head = s.prev[s.strstart & s.w_mask] = s.head[s.ins_h];
786 + s.head[s.ins_h] = s.strstart;
787 + /***/
788 + }
789 + } while (--s.prev_length !== 0);
790 + s.match_available = 0;
791 + s.match_length = MIN_MATCH - 1;
792 + s.strstart++;
793 +
794 + if (bflush) {
795 + /*** FLUSH_BLOCK(s, 0); ***/
796 + flush_block_only(s, false);
797 + if (s.strm.avail_out === 0) {
798 + return BS_NEED_MORE;
799 + }
800 + /***/
801 + }
802 +
803 + } else if (s.match_available) {
804 + /* If there was no match at the previous position, output a
805 + * single literal. If there was a match but the current match
806 + * is longer, truncate the previous match to a single literal.
807 + */
808 + //Tracevv((stderr,"%c", s->window[s->strstart-1]));
809 + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
810 + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
811 +
812 + if (bflush) {
813 + /*** FLUSH_BLOCK_ONLY(s, 0) ***/
814 + flush_block_only(s, false);
815 + /***/
816 + }
817 + s.strstart++;
818 + s.lookahead--;
819 + if (s.strm.avail_out === 0) {
820 + return BS_NEED_MORE;
821 + }
822 + } else {
823 + /* There is no previous match to compare with, wait for
824 + * the next step to decide.
825 + */
826 + s.match_available = 1;
827 + s.strstart++;
828 + s.lookahead--;
829 + }
830 + }
831 + //Assert (flush != Z_NO_FLUSH, "no flush?");
832 + if (s.match_available) {
833 + //Tracevv((stderr,"%c", s->window[s->strstart-1]));
834 + /*** _tr_tally_lit(s, s.window[s.strstart-1], bflush); ***/
835 + bflush = trees._tr_tally(s, 0, s.window[s.strstart - 1]);
836 +
837 + s.match_available = 0;
838 + }
839 + s.insert = s.strstart < MIN_MATCH - 1 ? s.strstart : MIN_MATCH - 1;
840 + if (flush === Z_FINISH) {
841 + /*** FLUSH_BLOCK(s, 1); ***/
842 + flush_block_only(s, true);
843 + if (s.strm.avail_out === 0) {
844 + return BS_FINISH_STARTED;
845 + }
846 + /***/
847 + return BS_FINISH_DONE;
848 + }
849 + if (s.last_lit) {
850 + /*** FLUSH_BLOCK(s, 0); ***/
851 + flush_block_only(s, false);
852 + if (s.strm.avail_out === 0) {
853 + return BS_NEED_MORE;
854 + }
855 + /***/
856 + }
857 +
858 + return BS_BLOCK_DONE;
859 +}
860 +
861 +
862 +/* ===========================================================================
863 + * For Z_RLE, simply look for runs of bytes, generate matches only of distance
864 + * one. Do not maintain a hash table. (It will be regenerated if this run of
865 + * deflate switches away from Z_RLE.)
866 + */
867 +function deflate_rle(s, flush) {
868 + var bflush; /* set if current block must be flushed */
869 + var prev; /* byte at distance one to match */
870 + var scan, strend; /* scan goes up to strend for length of run */
871 +
872 + var _win = s.window;
873 +
874 + for (;;) {
875 + /* Make sure that we always have enough lookahead, except
876 + * at the end of the input file. We need MAX_MATCH bytes
877 + * for the longest run, plus one for the unrolled loop.
878 + */
879 + if (s.lookahead <= MAX_MATCH) {
880 + fill_window(s);
881 + if (s.lookahead <= MAX_MATCH && flush === Z_NO_FLUSH) {
882 + return BS_NEED_MORE;
883 + }
884 + if (s.lookahead === 0) { break; } /* flush the current block */
885 + }
886 +
887 + /* See how many times the previous byte repeats */
888 + s.match_length = 0;
889 + if (s.lookahead >= MIN_MATCH && s.strstart > 0) {
890 + scan = s.strstart - 1;
891 + prev = _win[scan];
892 + if (prev === _win[++scan] && prev === _win[++scan] && prev === _win[++scan]) {
893 + strend = s.strstart + MAX_MATCH;
894 + do {
895 + // Do nothing
896 + } while (prev === _win[++scan] && prev === _win[++scan] &&
897 + prev === _win[++scan] && prev === _win[++scan] &&
898 + prev === _win[++scan] && prev === _win[++scan] &&
899 + prev === _win[++scan] && prev === _win[++scan] &&
900 + scan < strend);
901 + s.match_length = MAX_MATCH - (strend - scan);
902 + if (s.match_length > s.lookahead) {
903 + s.match_length = s.lookahead;
904 + }
905 + }
906 + //Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
907 + }
908 +
909 + /* Emit match if have run of MIN_MATCH or longer, else emit literal */
910 + if (s.match_length >= MIN_MATCH) {
911 + //check_match(s, s.strstart, s.strstart - 1, s.match_length);
912 +
913 + /*** _tr_tally_dist(s, 1, s.match_length - MIN_MATCH, bflush); ***/
914 + bflush = trees._tr_tally(s, 1, s.match_length - MIN_MATCH);
915 +
916 + s.lookahead -= s.match_length;
917 + s.strstart += s.match_length;
918 + s.match_length = 0;
919 + } else {
920 + /* No match, output a literal byte */
921 + //Tracevv((stderr,"%c", s->window[s->strstart]));
922 + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
923 + bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
924 +
925 + s.lookahead--;
926 + s.strstart++;
927 + }
928 + if (bflush) {
929 + /*** FLUSH_BLOCK(s, 0); ***/
930 + flush_block_only(s, false);
931 + if (s.strm.avail_out === 0) {
932 + return BS_NEED_MORE;
933 + }
934 + /***/
935 + }
936 + }
937 + s.insert = 0;
938 + if (flush === Z_FINISH) {
939 + /*** FLUSH_BLOCK(s, 1); ***/
940 + flush_block_only(s, true);
941 + if (s.strm.avail_out === 0) {
942 + return BS_FINISH_STARTED;
943 + }
944 + /***/
945 + return BS_FINISH_DONE;
946 + }
947 + if (s.last_lit) {
948 + /*** FLUSH_BLOCK(s, 0); ***/
949 + flush_block_only(s, false);
950 + if (s.strm.avail_out === 0) {
951 + return BS_NEED_MORE;
952 + }
953 + /***/
954 + }
955 + return BS_BLOCK_DONE;
956 +}
957 +
958 +/* ===========================================================================
959 + * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table.
960 + * (It will be regenerated if this run of deflate switches away from Huffman.)
961 + */
962 +function deflate_huff(s, flush) {
963 + var bflush; /* set if current block must be flushed */
964 +
965 + for (;;) {
966 + /* Make sure that we have a literal to write. */
967 + if (s.lookahead === 0) {
968 + fill_window(s);
969 + if (s.lookahead === 0) {
970 + if (flush === Z_NO_FLUSH) {
971 + return BS_NEED_MORE;
972 + }
973 + break; /* flush the current block */
974 + }
975 + }
976 +
977 + /* Output a literal byte */
978 + s.match_length = 0;
979 + //Tracevv((stderr,"%c", s->window[s->strstart]));
980 + /*** _tr_tally_lit(s, s.window[s.strstart], bflush); ***/
981 + bflush = trees._tr_tally(s, 0, s.window[s.strstart]);
982 + s.lookahead--;
983 + s.strstart++;
984 + if (bflush) {
985 + /*** FLUSH_BLOCK(s, 0); ***/
986 + flush_block_only(s, false);
987 + if (s.strm.avail_out === 0) {
988 + return BS_NEED_MORE;
989 + }
990 + /***/
991 + }
992 + }
993 + s.insert = 0;
994 + if (flush === Z_FINISH) {
995 + /*** FLUSH_BLOCK(s, 1); ***/
996 + flush_block_only(s, true);
997 + if (s.strm.avail_out === 0) {
998 + return BS_FINISH_STARTED;
999 + }
1000 + /***/
1001 + return BS_FINISH_DONE;
1002 + }
1003 + if (s.last_lit) {
1004 + /*** FLUSH_BLOCK(s, 0); ***/
1005 + flush_block_only(s, false);
1006 + if (s.strm.avail_out === 0) {
1007 + return BS_NEED_MORE;
1008 + }
1009 + /***/
1010 + }
1011 + return BS_BLOCK_DONE;
1012 +}
1013 +
1014 +/* Values for max_lazy_match, good_match and max_chain_length, depending on
1015 + * the desired pack level (0..9). The values given below have been tuned to
1016 + * exclude worst case performance for pathological files. Better values may be
1017 + * found for specific files.
1018 + */
1019 +function Config(good_length, max_lazy, nice_length, max_chain, func) {
1020 + this.good_length = good_length;
1021 + this.max_lazy = max_lazy;
1022 + this.nice_length = nice_length;
1023 + this.max_chain = max_chain;
1024 + this.func = func;
1025 +}
1026 +
1027 +var configuration_table;
1028 +
1029 +configuration_table = [
1030 + /* good lazy nice chain */
1031 + new Config(0, 0, 0, 0, deflate_stored), /* 0 store only */
1032 + new Config(4, 4, 8, 4, deflate_fast), /* 1 max speed, no lazy matches */
1033 + new Config(4, 5, 16, 8, deflate_fast), /* 2 */
1034 + new Config(4, 6, 32, 32, deflate_fast), /* 3 */
1035 +
1036 + new Config(4, 4, 16, 16, deflate_slow), /* 4 lazy matches */
1037 + new Config(8, 16, 32, 32, deflate_slow), /* 5 */
1038 + new Config(8, 16, 128, 128, deflate_slow), /* 6 */
1039 + new Config(8, 32, 128, 256, deflate_slow), /* 7 */
1040 + new Config(32, 128, 258, 1024, deflate_slow), /* 8 */
1041 + new Config(32, 258, 258, 4096, deflate_slow) /* 9 max compression */
1042 +];
1043 +
1044 +
1045 +/* ===========================================================================
1046 + * Initialize the "longest match" routines for a new zlib stream
1047 + */
1048 +function lm_init(s) {
1049 + s.window_size = 2 * s.w_size;
1050 +
1051 + /*** CLEAR_HASH(s); ***/
1052 + zero(s.head); // Fill with NIL (= 0);
1053 +
1054 + /* Set the default configuration parameters:
1055 + */
1056 + s.max_lazy_match = configuration_table[s.level].max_lazy;
1057 + s.good_match = configuration_table[s.level].good_length;
1058 + s.nice_match = configuration_table[s.level].nice_length;
1059 + s.max_chain_length = configuration_table[s.level].max_chain;
1060 +
1061 + s.strstart = 0;
1062 + s.block_start = 0;
1063 + s.lookahead = 0;
1064 + s.insert = 0;
1065 + s.match_length = s.prev_length = MIN_MATCH - 1;
1066 + s.match_available = 0;
1067 + s.ins_h = 0;
1068 +}
1069 +
1070 +
1071 +function DeflateState() {
1072 + this.strm = null; /* pointer back to this zlib stream */
1073 + this.status = 0; /* as the name implies */
1074 + this.pending_buf = null; /* output still pending */
1075 + this.pending_buf_size = 0; /* size of pending_buf */
1076 + this.pending_out = 0; /* next pending byte to output to the stream */
1077 + this.pending = 0; /* nb of bytes in the pending buffer */
1078 + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
1079 + this.gzhead = null; /* gzip header information to write */
1080 + this.gzindex = 0; /* where in extra, name, or comment */
1081 + this.method = Z_DEFLATED; /* can only be DEFLATED */
1082 + this.last_flush = -1; /* value of flush param for previous deflate call */
1083 +
1084 + this.w_size = 0; /* LZ77 window size (32K by default) */
1085 + this.w_bits = 0; /* log2(w_size) (8..16) */
1086 + this.w_mask = 0; /* w_size - 1 */
1087 +
1088 + this.window = null;
1089 + /* Sliding window. Input bytes are read into the second half of the window,
1090 + * and move to the first half later to keep a dictionary of at least wSize
1091 + * bytes. With this organization, matches are limited to a distance of
1092 + * wSize-MAX_MATCH bytes, but this ensures that IO is always
1093 + * performed with a length multiple of the block size.
1094 + */
1095 +
1096 + this.window_size = 0;
1097 + /* Actual size of window: 2*wSize, except when the user input buffer
1098 + * is directly used as sliding window.
1099 + */
1100 +
1101 + this.prev = null;
1102 + /* Link to older string with same hash index. To limit the size of this
1103 + * array to 64K, this link is maintained only for the last 32K strings.
1104 + * An index in this array is thus a window index modulo 32K.
1105 + */
1106 +
1107 + this.head = null; /* Heads of the hash chains or NIL. */
1108 +
1109 + this.ins_h = 0; /* hash index of string to be inserted */
1110 + this.hash_size = 0; /* number of elements in hash table */
1111 + this.hash_bits = 0; /* log2(hash_size) */
1112 + this.hash_mask = 0; /* hash_size-1 */
1113 +
1114 + this.hash_shift = 0;
1115 + /* Number of bits by which ins_h must be shifted at each input
1116 + * step. It must be such that after MIN_MATCH steps, the oldest
1117 + * byte no longer takes part in the hash key, that is:
1118 + * hash_shift * MIN_MATCH >= hash_bits
1119 + */
1120 +
1121 + this.block_start = 0;
1122 + /* Window position at the beginning of the current output block. Gets
1123 + * negative when the window is moved backwards.
1124 + */
1125 +
1126 + this.match_length = 0; /* length of best match */
1127 + this.prev_match = 0; /* previous match */
1128 + this.match_available = 0; /* set if previous match exists */
1129 + this.strstart = 0; /* start of string to insert */
1130 + this.match_start = 0; /* start of matching string */
1131 + this.lookahead = 0; /* number of valid bytes ahead in window */
1132 +
1133 + this.prev_length = 0;
1134 + /* Length of the best match at previous step. Matches not greater than this
1135 + * are discarded. This is used in the lazy match evaluation.
1136 + */
1137 +
1138 + this.max_chain_length = 0;
1139 + /* To speed up deflation, hash chains are never searched beyond this
1140 + * length. A higher limit improves compression ratio but degrades the
1141 + * speed.
1142 + */
1143 +
1144 + this.max_lazy_match = 0;
1145 + /* Attempt to find a better match only when the current match is strictly
1146 + * smaller than this value. This mechanism is used only for compression
1147 + * levels >= 4.
1148 + */
1149 + // That's alias to max_lazy_match, don't use directly
1150 + //this.max_insert_length = 0;
1151 + /* Insert new strings in the hash table only if the match length is not
1152 + * greater than this length. This saves time but degrades compression.
1153 + * max_insert_length is used only for compression levels <= 3.
1154 + */
1155 +
1156 + this.level = 0; /* compression level (1..9) */
1157 + this.strategy = 0; /* favor or force Huffman coding*/
1158 +
1159 + this.good_match = 0;
1160 + /* Use a faster search when the previous match is longer than this */
1161 +
1162 + this.nice_match = 0; /* Stop searching when current match exceeds this */
1163 +
1164 + /* used by trees.c: */
1165 +
1166 + /* Didn't use ct_data typedef below to suppress compiler warning */
1167 +
1168 + // struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */
1169 + // struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */
1170 + // struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */
1171 +
1172 + // Use flat array of DOUBLE size, with interleaved fata,
1173 + // because JS does not support effective
1174 + this.dyn_ltree = new utils.Buf16(HEAP_SIZE * 2);
1175 + this.dyn_dtree = new utils.Buf16((2 * D_CODES + 1) * 2);
1176 + this.bl_tree = new utils.Buf16((2 * BL_CODES + 1) * 2);
1177 + zero(this.dyn_ltree);
1178 + zero(this.dyn_dtree);
1179 + zero(this.bl_tree);
1180 +
1181 + this.l_desc = null; /* desc. for literal tree */
1182 + this.d_desc = null; /* desc. for distance tree */
1183 + this.bl_desc = null; /* desc. for bit length tree */
1184 +
1185 + //ush bl_count[MAX_BITS+1];
1186 + this.bl_count = new utils.Buf16(MAX_BITS + 1);
1187 + /* number of codes at each bit length for an optimal tree */
1188 +
1189 + //int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */
1190 + this.heap = new utils.Buf16(2 * L_CODES + 1); /* heap used to build the Huffman trees */
1191 + zero(this.heap);
1192 +
1193 + this.heap_len = 0; /* number of elements in the heap */
1194 + this.heap_max = 0; /* element of largest frequency */
1195 + /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used.
1196 + * The same heap array is used to build all trees.
1197 + */
1198 +
1199 + this.depth = new utils.Buf16(2 * L_CODES + 1); //uch depth[2*L_CODES+1];
1200 + zero(this.depth);
1201 + /* Depth of each subtree used as tie breaker for trees of equal frequency
1202 + */
1203 +
1204 + this.l_buf = 0; /* buffer index for literals or lengths */
1205 +
1206 + this.lit_bufsize = 0;
1207 + /* Size of match buffer for literals/lengths. There are 4 reasons for
1208 + * limiting lit_bufsize to 64K:
1209 + * - frequencies can be kept in 16 bit counters
1210 + * - if compression is not successful for the first block, all input
1211 + * data is still in the window so we can still emit a stored block even
1212 + * when input comes from standard input. (This can also be done for
1213 + * all blocks if lit_bufsize is not greater than 32K.)
1214 + * - if compression is not successful for a file smaller than 64K, we can
1215 + * even emit a stored file instead of a stored block (saving 5 bytes).
1216 + * This is applicable only for zip (not gzip or zlib).
1217 + * - creating new Huffman trees less frequently may not provide fast
1218 + * adaptation to changes in the input data statistics. (Take for
1219 + * example a binary file with poorly compressible code followed by
1220 + * a highly compressible string table.) Smaller buffer sizes give
1221 + * fast adaptation but have of course the overhead of transmitting
1222 + * trees more frequently.
1223 + * - I can't count above 4
1224 + */
1225 +
1226 + this.last_lit = 0; /* running index in l_buf */
1227 +
1228 + this.d_buf = 0;
1229 + /* Buffer index for distances. To simplify the code, d_buf and l_buf have
1230 + * the same number of elements. To use different lengths, an extra flag
1231 + * array would be necessary.
1232 + */
1233 +
1234 + this.opt_len = 0; /* bit length of current block with optimal trees */
1235 + this.static_len = 0; /* bit length of current block with static trees */
1236 + this.matches = 0; /* number of string matches in current block */
1237 + this.insert = 0; /* bytes at end of window left to insert */
1238 +
1239 +
1240 + this.bi_buf = 0;
1241 + /* Output buffer. bits are inserted starting at the bottom (least
1242 + * significant bits).
1243 + */
1244 + this.bi_valid = 0;
1245 + /* Number of valid bits in bi_buf. All bits above the last valid bit
1246 + * are always zero.
1247 + */
1248 +
1249 + // Used for window memory init. We safely ignore it for JS. That makes
1250 + // sense only for pointers and memory check tools.
1251 + //this.high_water = 0;
1252 + /* High water mark offset in window for initialized bytes -- bytes above
1253 + * this are set to zero in order to avoid memory check warnings when
1254 + * longest match routines access bytes past the input. This is then
1255 + * updated to the new high water mark.
1256 + */
1257 +}
1258 +
1259 +
1260 +function deflateResetKeep(strm) {
1261 + var s;
1262 +
1263 + if (!strm || !strm.state) {
1264 + return err(strm, Z_STREAM_ERROR);
1265 + }
1266 +
1267 + strm.total_in = strm.total_out = 0;
1268 + strm.data_type = Z_UNKNOWN;
1269 +
1270 + s = strm.state;
1271 + s.pending = 0;
1272 + s.pending_out = 0;
1273 +
1274 + if (s.wrap < 0) {
1275 + s.wrap = -s.wrap;
1276 + /* was made negative by deflate(..., Z_FINISH); */
1277 + }
1278 + s.status = (s.wrap ? INIT_STATE : BUSY_STATE);
1279 + strm.adler = (s.wrap === 2) ?
1280 + 0 // crc32(0, Z_NULL, 0)
1281 + :
1282 + 1; // adler32(0, Z_NULL, 0)
1283 + s.last_flush = Z_NO_FLUSH;
1284 + trees._tr_init(s);
1285 + return Z_OK;
1286 +}
1287 +
1288 +
1289 +function deflateReset(strm) {
1290 + var ret = deflateResetKeep(strm);
1291 + if (ret === Z_OK) {
1292 + lm_init(strm.state);
1293 + }
1294 + return ret;
1295 +}
1296 +
1297 +
1298 +function deflateSetHeader(strm, head) {
1299 + if (!strm || !strm.state) { return Z_STREAM_ERROR; }
1300 + if (strm.state.wrap !== 2) { return Z_STREAM_ERROR; }
1301 + strm.state.gzhead = head;
1302 + return Z_OK;
1303 +}
1304 +
1305 +
1306 +function deflateInit2(strm, level, method, windowBits, memLevel, strategy) {
1307 + if (!strm) { // === Z_NULL
1308 + return Z_STREAM_ERROR;
1309 + }
1310 + var wrap = 1;
1311 +
1312 + if (level === Z_DEFAULT_COMPRESSION) {
1313 + level = 6;
1314 + }
1315 +
1316 + if (windowBits < 0) { /* suppress zlib wrapper */
1317 + wrap = 0;
1318 + windowBits = -windowBits;
1319 + }
1320 +
1321 + else if (windowBits > 15) {
1322 + wrap = 2; /* write gzip wrapper instead */
1323 + windowBits -= 16;
1324 + }
1325 +
1326 +
1327 + if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method !== Z_DEFLATED ||
1328 + windowBits < 8 || windowBits > 15 || level < 0 || level > 9 ||
1329 + strategy < 0 || strategy > Z_FIXED) {
1330 + return err(strm, Z_STREAM_ERROR);
1331 + }
1332 +
1333 +
1334 + if (windowBits === 8) {
1335 + windowBits = 9;
1336 + }
1337 + /* until 256-byte window bug fixed */
1338 +
1339 + var s = new DeflateState();
1340 +
1341 + strm.state = s;
1342 + s.strm = strm;
1343 +
1344 + s.wrap = wrap;
1345 + s.gzhead = null;
1346 + s.w_bits = windowBits;
1347 + s.w_size = 1 << s.w_bits;
1348 + s.w_mask = s.w_size - 1;
1349 +
1350 + s.hash_bits = memLevel + 7;
1351 + s.hash_size = 1 << s.hash_bits;
1352 + s.hash_mask = s.hash_size - 1;
1353 + s.hash_shift = ~~((s.hash_bits + MIN_MATCH - 1) / MIN_MATCH);
1354 +
1355 + s.window = new utils.Buf8(s.w_size * 2);
1356 + s.head = new utils.Buf16(s.hash_size);
1357 + s.prev = new utils.Buf16(s.w_size);
1358 +
1359 + // Don't need mem init magic for JS.
1360 + //s.high_water = 0; /* nothing written to s->window yet */
1361 +
1362 + s.lit_bufsize = 1 << (memLevel + 6); /* 16K elements by default */
1363 +
1364 + s.pending_buf_size = s.lit_bufsize * 4;
1365 +
1366 + //overlay = (ushf *) ZALLOC(strm, s->lit_bufsize, sizeof(ush)+2);
1367 + //s->pending_buf = (uchf *) overlay;
1368 + s.pending_buf = new utils.Buf8(s.pending_buf_size);
1369 +
1370 + // It is offset from `s.pending_buf` (size is `s.lit_bufsize * 2`)
1371 + //s->d_buf = overlay + s->lit_bufsize/sizeof(ush);
1372 + s.d_buf = 1 * s.lit_bufsize;
1373 +
1374 + //s->l_buf = s->pending_buf + (1+sizeof(ush))*s->lit_bufsize;
1375 + s.l_buf = (1 + 2) * s.lit_bufsize;
1376 +
1377 + s.level = level;
1378 + s.strategy = strategy;
1379 + s.method = method;
1380 +
1381 + return deflateReset(strm);
1382 +}
1383 +
1384 +function deflateInit(strm, level) {
1385 + return deflateInit2(strm, level, Z_DEFLATED, MAX_WBITS, DEF_MEM_LEVEL, Z_DEFAULT_STRATEGY);
1386 +}
1387 +
1388 +
1389 +function deflate(strm, flush) {
1390 + var old_flush, s;
1391 + var beg, val; // for gzip header write only
1392 +
1393 + if (!strm || !strm.state ||
1394 + flush > Z_BLOCK || flush < 0) {
1395 + return strm ? err(strm, Z_STREAM_ERROR) : Z_STREAM_ERROR;
1396 + }
1397 +
1398 + s = strm.state;
1399 +
1400 + if (!strm.output ||
1401 + (!strm.input && strm.avail_in !== 0) ||
1402 + (s.status === FINISH_STATE && flush !== Z_FINISH)) {
1403 + return err(strm, (strm.avail_out === 0) ? Z_BUF_ERROR : Z_STREAM_ERROR);
1404 + }
1405 +
1406 + s.strm = strm; /* just in case */
1407 + old_flush = s.last_flush;
1408 + s.last_flush = flush;
1409 +
1410 + /* Write the header */
1411 + if (s.status === INIT_STATE) {
1412 +
1413 + if (s.wrap === 2) { // GZIP header
1414 + strm.adler = 0; //crc32(0L, Z_NULL, 0);
1415 + put_byte(s, 31);
1416 + put_byte(s, 139);
1417 + put_byte(s, 8);
1418 + if (!s.gzhead) { // s->gzhead == Z_NULL
1419 + put_byte(s, 0);
1420 + put_byte(s, 0);
1421 + put_byte(s, 0);
1422 + put_byte(s, 0);
1423 + put_byte(s, 0);
1424 + put_byte(s, s.level === 9 ? 2 :
1425 + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
1426 + 4 : 0));
1427 + put_byte(s, OS_CODE);
1428 + s.status = BUSY_STATE;
1429 + }
1430 + else {
1431 + put_byte(s, (s.gzhead.text ? 1 : 0) +
1432 + (s.gzhead.hcrc ? 2 : 0) +
1433 + (!s.gzhead.extra ? 0 : 4) +
1434 + (!s.gzhead.name ? 0 : 8) +
1435 + (!s.gzhead.comment ? 0 : 16)
1436 + );
1437 + put_byte(s, s.gzhead.time & 0xff);
1438 + put_byte(s, (s.gzhead.time >> 8) & 0xff);
1439 + put_byte(s, (s.gzhead.time >> 16) & 0xff);
1440 + put_byte(s, (s.gzhead.time >> 24) & 0xff);
1441 + put_byte(s, s.level === 9 ? 2 :
1442 + (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2 ?
1443 + 4 : 0));
1444 + put_byte(s, s.gzhead.os & 0xff);
1445 + if (s.gzhead.extra && s.gzhead.extra.length) {
1446 + put_byte(s, s.gzhead.extra.length & 0xff);
1447 + put_byte(s, (s.gzhead.extra.length >> 8) & 0xff);
1448 + }
1449 + if (s.gzhead.hcrc) {
1450 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending, 0);
1451 + }
1452 + s.gzindex = 0;
1453 + s.status = EXTRA_STATE;
1454 + }
1455 + }
1456 + else // DEFLATE header
1457 + {
1458 + var header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;
1459 + var level_flags = -1;
1460 +
1461 + if (s.strategy >= Z_HUFFMAN_ONLY || s.level < 2) {
1462 + level_flags = 0;
1463 + } else if (s.level < 6) {
1464 + level_flags = 1;
1465 + } else if (s.level === 6) {
1466 + level_flags = 2;
1467 + } else {
1468 + level_flags = 3;
1469 + }
1470 + header |= (level_flags << 6);
1471 + if (s.strstart !== 0) { header |= PRESET_DICT; }
1472 + header += 31 - (header % 31);
1473 +
1474 + s.status = BUSY_STATE;
1475 + putShortMSB(s, header);
1476 +
1477 + /* Save the adler32 of the preset dictionary: */
1478 + if (s.strstart !== 0) {
1479 + putShortMSB(s, strm.adler >>> 16);
1480 + putShortMSB(s, strm.adler & 0xffff);
1481 + }
1482 + strm.adler = 1; // adler32(0L, Z_NULL, 0);
1483 + }
1484 + }
1485 +
1486 +//#ifdef GZIP
1487 + if (s.status === EXTRA_STATE) {
1488 + if (s.gzhead.extra/* != Z_NULL*/) {
1489 + beg = s.pending; /* start of bytes to update crc */
1490 +
1491 + while (s.gzindex < (s.gzhead.extra.length & 0xffff)) {
1492 + if (s.pending === s.pending_buf_size) {
1493 + if (s.gzhead.hcrc && s.pending > beg) {
1494 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1495 + }
1496 + flush_pending(strm);
1497 + beg = s.pending;
1498 + if (s.pending === s.pending_buf_size) {
1499 + break;
1500 + }
1501 + }
1502 + put_byte(s, s.gzhead.extra[s.gzindex] & 0xff);
1503 + s.gzindex++;
1504 + }
1505 + if (s.gzhead.hcrc && s.pending > beg) {
1506 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1507 + }
1508 + if (s.gzindex === s.gzhead.extra.length) {
1509 + s.gzindex = 0;
1510 + s.status = NAME_STATE;
1511 + }
1512 + }
1513 + else {
1514 + s.status = NAME_STATE;
1515 + }
1516 + }
1517 + if (s.status === NAME_STATE) {
1518 + if (s.gzhead.name/* != Z_NULL*/) {
1519 + beg = s.pending; /* start of bytes to update crc */
1520 + //int val;
1521 +
1522 + do {
1523 + if (s.pending === s.pending_buf_size) {
1524 + if (s.gzhead.hcrc && s.pending > beg) {
1525 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1526 + }
1527 + flush_pending(strm);
1528 + beg = s.pending;
1529 + if (s.pending === s.pending_buf_size) {
1530 + val = 1;
1531 + break;
1532 + }
1533 + }
1534 + // JS specific: little magic to add zero terminator to end of string
1535 + if (s.gzindex < s.gzhead.name.length) {
1536 + val = s.gzhead.name.charCodeAt(s.gzindex++) & 0xff;
1537 + } else {
1538 + val = 0;
1539 + }
1540 + put_byte(s, val);
1541 + } while (val !== 0);
1542 +
1543 + if (s.gzhead.hcrc && s.pending > beg) {
1544 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1545 + }
1546 + if (val === 0) {
1547 + s.gzindex = 0;
1548 + s.status = COMMENT_STATE;
1549 + }
1550 + }
1551 + else {
1552 + s.status = COMMENT_STATE;
1553 + }
1554 + }
1555 + if (s.status === COMMENT_STATE) {
1556 + if (s.gzhead.comment/* != Z_NULL*/) {
1557 + beg = s.pending; /* start of bytes to update crc */
1558 + //int val;
1559 +
1560 + do {
1561 + if (s.pending === s.pending_buf_size) {
1562 + if (s.gzhead.hcrc && s.pending > beg) {
1563 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1564 + }
1565 + flush_pending(strm);
1566 + beg = s.pending;
1567 + if (s.pending === s.pending_buf_size) {
1568 + val = 1;
1569 + break;
1570 + }
1571 + }
1572 + // JS specific: little magic to add zero terminator to end of string
1573 + if (s.gzindex < s.gzhead.comment.length) {
1574 + val = s.gzhead.comment.charCodeAt(s.gzindex++) & 0xff;
1575 + } else {
1576 + val = 0;
1577 + }
1578 + put_byte(s, val);
1579 + } while (val !== 0);
1580 +
1581 + if (s.gzhead.hcrc && s.pending > beg) {
1582 + strm.adler = crc32(strm.adler, s.pending_buf, s.pending - beg, beg);
1583 + }
1584 + if (val === 0) {
1585 + s.status = HCRC_STATE;
1586 + }
1587 + }
1588 + else {
1589 + s.status = HCRC_STATE;
1590 + }
1591 + }
1592 + if (s.status === HCRC_STATE) {
1593 + if (s.gzhead.hcrc) {
1594 + if (s.pending + 2 > s.pending_buf_size) {
1595 + flush_pending(strm);
1596 + }
1597 + if (s.pending + 2 <= s.pending_buf_size) {
1598 + put_byte(s, strm.adler & 0xff);
1599 + put_byte(s, (strm.adler >> 8) & 0xff);
1600 + strm.adler = 0; //crc32(0L, Z_NULL, 0);
1601 + s.status = BUSY_STATE;
1602 + }
1603 + }
1604 + else {
1605 + s.status = BUSY_STATE;
1606 + }
1607 + }
1608 +//#endif
1609 +
1610 + /* Flush as much pending output as possible */
1611 + if (s.pending !== 0) {
1612 + flush_pending(strm);
1613 + if (strm.avail_out === 0) {
1614 + /* Since avail_out is 0, deflate will be called again with
1615 + * more output space, but possibly with both pending and
1616 + * avail_in equal to zero. There won't be anything to do,
1617 + * but this is not an error situation so make sure we
1618 + * return OK instead of BUF_ERROR at next call of deflate:
1619 + */
1620 + s.last_flush = -1;
1621 + return Z_OK;
1622 + }
1623 +
1624 + /* Make sure there is something to do and avoid duplicate consecutive
1625 + * flushes. For repeated and useless calls with Z_FINISH, we keep
1626 + * returning Z_STREAM_END instead of Z_BUF_ERROR.
1627 + */
1628 + } else if (strm.avail_in === 0 && rank(flush) <= rank(old_flush) &&
1629 + flush !== Z_FINISH) {
1630 + return err(strm, Z_BUF_ERROR);
1631 + }
1632 +
1633 + /* User must not provide more input after the first FINISH: */
1634 + if (s.status === FINISH_STATE && strm.avail_in !== 0) {
1635 + return err(strm, Z_BUF_ERROR);
1636 + }
1637 +
1638 + /* Start a new block or continue the current one.
1639 + */
1640 + if (strm.avail_in !== 0 || s.lookahead !== 0 ||
1641 + (flush !== Z_NO_FLUSH && s.status !== FINISH_STATE)) {
1642 + var bstate = (s.strategy === Z_HUFFMAN_ONLY) ? deflate_huff(s, flush) :
1643 + (s.strategy === Z_RLE ? deflate_rle(s, flush) :
1644 + configuration_table[s.level].func(s, flush));
1645 +
1646 + if (bstate === BS_FINISH_STARTED || bstate === BS_FINISH_DONE) {
1647 + s.status = FINISH_STATE;
1648 + }
1649 + if (bstate === BS_NEED_MORE || bstate === BS_FINISH_STARTED) {
1650 + if (strm.avail_out === 0) {
1651 + s.last_flush = -1;
1652 + /* avoid BUF_ERROR next call, see above */
1653 + }
1654 + return Z_OK;
1655 + /* If flush != Z_NO_FLUSH && avail_out == 0, the next call
1656 + * of deflate should use the same flush parameter to make sure
1657 + * that the flush is complete. So we don't have to output an
1658 + * empty block here, this will be done at next call. This also
1659 + * ensures that for a very small output buffer, we emit at most
1660 + * one empty block.
1661 + */
1662 + }
1663 + if (bstate === BS_BLOCK_DONE) {
1664 + if (flush === Z_PARTIAL_FLUSH) {
1665 + trees._tr_align(s);
1666 + }
1667 + else if (flush !== Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */
1668 +
1669 + trees._tr_stored_block(s, 0, 0, false);
1670 + /* For a full flush, this empty block will be recognized
1671 + * as a special marker by inflate_sync().
1672 + */
1673 + if (flush === Z_FULL_FLUSH) {
1674 + /*** CLEAR_HASH(s); ***/ /* forget history */
1675 + zero(s.head); // Fill with NIL (= 0);
1676 +
1677 + if (s.lookahead === 0) {
1678 + s.strstart = 0;
1679 + s.block_start = 0;
1680 + s.insert = 0;
1681 + }
1682 + }
1683 + }
1684 + flush_pending(strm);
1685 + if (strm.avail_out === 0) {
1686 + s.last_flush = -1; /* avoid BUF_ERROR at next call, see above */
1687 + return Z_OK;
1688 + }
1689 + }
1690 + }
1691 + //Assert(strm->avail_out > 0, "bug2");
1692 + //if (strm.avail_out <= 0) { throw new Error("bug2");}
1693 +
1694 + if (flush !== Z_FINISH) { return Z_OK; }
1695 + if (s.wrap <= 0) { return Z_STREAM_END; }
1696 +
1697 + /* Write the trailer */
1698 + if (s.wrap === 2) {
1699 + put_byte(s, strm.adler & 0xff);
1700 + put_byte(s, (strm.adler >> 8) & 0xff);
1701 + put_byte(s, (strm.adler >> 16) & 0xff);
1702 + put_byte(s, (strm.adler >> 24) & 0xff);
1703 + put_byte(s, strm.total_in & 0xff);
1704 + put_byte(s, (strm.total_in >> 8) & 0xff);
1705 + put_byte(s, (strm.total_in >> 16) & 0xff);
1706 + put_byte(s, (strm.total_in >> 24) & 0xff);
1707 + }
1708 + else
1709 + {
1710 + putShortMSB(s, strm.adler >>> 16);
1711 + putShortMSB(s, strm.adler & 0xffff);
1712 + }
1713 +
1714 + flush_pending(strm);
1715 + /* If avail_out is zero, the application will call deflate again
1716 + * to flush the rest.
1717 + */
1718 + if (s.wrap > 0) { s.wrap = -s.wrap; }
1719 + /* write the trailer only once! */
1720 + return s.pending !== 0 ? Z_OK : Z_STREAM_END;
1721 +}
1722 +
1723 +function deflateEnd(strm) {
1724 + var status;
1725 +
1726 + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
1727 + return Z_STREAM_ERROR;
1728 + }
1729 +
1730 + status = strm.state.status;
1731 + if (status !== INIT_STATE &&
1732 + status !== EXTRA_STATE &&
1733 + status !== NAME_STATE &&
1734 + status !== COMMENT_STATE &&
1735 + status !== HCRC_STATE &&
1736 + status !== BUSY_STATE &&
1737 + status !== FINISH_STATE
1738 + ) {
1739 + return err(strm, Z_STREAM_ERROR);
1740 + }
1741 +
1742 + strm.state = null;
1743 +
1744 + return status === BUSY_STATE ? err(strm, Z_DATA_ERROR) : Z_OK;
1745 +}
1746 +
1747 +
1748 +/* =========================================================================
1749 + * Initializes the compression dictionary from the given byte
1750 + * sequence without producing any compressed output.
1751 + */
1752 +function deflateSetDictionary(strm, dictionary) {
1753 + var dictLength = dictionary.length;
1754 +
1755 + var s;
1756 + var str, n;
1757 + var wrap;
1758 + var avail;
1759 + var next;
1760 + var input;
1761 + var tmpDict;
1762 +
1763 + if (!strm/*== Z_NULL*/ || !strm.state/*== Z_NULL*/) {
1764 + return Z_STREAM_ERROR;
1765 + }
1766 +
1767 + s = strm.state;
1768 + wrap = s.wrap;
1769 +
1770 + if (wrap === 2 || (wrap === 1 && s.status !== INIT_STATE) || s.lookahead) {
1771 + return Z_STREAM_ERROR;
1772 + }
1773 +
1774 + /* when using zlib wrappers, compute Adler-32 for provided dictionary */
1775 + if (wrap === 1) {
1776 + /* adler32(strm->adler, dictionary, dictLength); */
1777 + strm.adler = adler32(strm.adler, dictionary, dictLength, 0);
1778 + }
1779 +
1780 + s.wrap = 0; /* avoid computing Adler-32 in read_buf */
1781 +
1782 + /* if dictionary would fill window, just replace the history */
1783 + if (dictLength >= s.w_size) {
1784 + if (wrap === 0) { /* already empty otherwise */
1785 + /*** CLEAR_HASH(s); ***/
1786 + zero(s.head); // Fill with NIL (= 0);
1787 + s.strstart = 0;
1788 + s.block_start = 0;
1789 + s.insert = 0;
1790 + }
1791 + /* use the tail */
1792 + // dictionary = dictionary.slice(dictLength - s.w_size);
1793 + tmpDict = new utils.Buf8(s.w_size);
1794 + utils.arraySet(tmpDict, dictionary, dictLength - s.w_size, s.w_size, 0);
1795 + dictionary = tmpDict;
1796 + dictLength = s.w_size;
1797 + }
1798 + /* insert dictionary into window and hash */
1799 + avail = strm.avail_in;
1800 + next = strm.next_in;
1801 + input = strm.input;
1802 + strm.avail_in = dictLength;
1803 + strm.next_in = 0;
1804 + strm.input = dictionary;
1805 + fill_window(s);
1806 + while (s.lookahead >= MIN_MATCH) {
1807 + str = s.strstart;
1808 + n = s.lookahead - (MIN_MATCH - 1);
1809 + do {
1810 + /* UPDATE_HASH(s, s->ins_h, s->window[str + MIN_MATCH-1]); */
1811 + s.ins_h = ((s.ins_h << s.hash_shift) ^ s.window[str + MIN_MATCH - 1]) & s.hash_mask;
1812 +
1813 + s.prev[str & s.w_mask] = s.head[s.ins_h];
1814 +
1815 + s.head[s.ins_h] = str;
1816 + str++;
1817 + } while (--n);
1818 + s.strstart = str;
1819 + s.lookahead = MIN_MATCH - 1;
1820 + fill_window(s);
1821 + }
1822 + s.strstart += s.lookahead;
1823 + s.block_start = s.strstart;
1824 + s.insert = s.lookahead;
1825 + s.lookahead = 0;
1826 + s.match_length = s.prev_length = MIN_MATCH - 1;
1827 + s.match_available = 0;
1828 + strm.next_in = next;
1829 + strm.input = input;
1830 + strm.avail_in = avail;
1831 + s.wrap = wrap;
1832 + return Z_OK;
1833 +}
1834 +
1835 +
1836 +export { deflateInit, deflateInit2, deflateReset, deflateResetKeep, deflateSetHeader, deflate, deflateEnd, deflateSetDictionary };
1837 +export var deflateInfo = 'pako deflate (from Nodeca project)';
1838 +
1839 +/* Not implemented
1840 +exports.deflateBound = deflateBound;
1841 +exports.deflateCopy = deflateCopy;
1842 +exports.deflateParams = deflateParams;
1843 +exports.deflatePending = deflatePending;
1844 +exports.deflatePrime = deflatePrime;
1845 +exports.deflateTune = deflateTune;
1846 +*/
public/novnc/vendor/pako/lib/zlib/gzheader.js new
+35
@@ -0,0 +1,35 @@
1 +export default function GZheader() {
2 + /* true if compressed data believed to be text */
3 + this.text = 0;
4 + /* modification time */
5 + this.time = 0;
6 + /* extra flags (not used when writing a gzip file) */
7 + this.xflags = 0;
8 + /* operating system */
9 + this.os = 0;
10 + /* pointer to extra field or Z_NULL if none */
11 + this.extra = null;
12 + /* extra field length (valid if extra != Z_NULL) */
13 + this.extra_len = 0; // Actually, we don't need it in JS,
14 + // but leave for few code modifications
15 +
16 + //
17 + // Setup limits is not necessary because in js we should not preallocate memory
18 + // for inflate use constant limit in 65536 bytes
19 + //
20 +
21 + /* space at extra (only when reading header) */
22 + // this.extra_max = 0;
23 + /* pointer to zero-terminated file name or Z_NULL */
24 + this.name = '';
25 + /* space at name (only when reading header) */
26 + // this.name_max = 0;
27 + /* pointer to zero-terminated comment or Z_NULL */
28 + this.comment = '';
29 + /* space at comment (only when reading header) */
30 + // this.comm_max = 0;
31 + /* true if there was or will be a header crc */
32 + this.hcrc = 0;
33 + /* true when done reading gzip header (not used when writing a gzip file) */
34 + this.done = false;
35 +}
public/novnc/vendor/pako/lib/zlib/inffast.js new
+324
@@ -0,0 +1,324 @@
1 +// See state defs from inflate.js
2 +var BAD = 30; /* got a data error -- remain here until reset */
3 +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
4 +
5 +/*
6 + Decode literal, length, and distance codes and write out the resulting
7 + literal and match bytes until either not enough input or output is
8 + available, an end-of-block is encountered, or a data error is encountered.
9 + When large enough input and output buffers are supplied to inflate(), for
10 + example, a 16K input buffer and a 64K output buffer, more than 95% of the
11 + inflate execution time is spent in this routine.
12 +
13 + Entry assumptions:
14 +
15 + state.mode === LEN
16 + strm.avail_in >= 6
17 + strm.avail_out >= 258
18 + start >= strm.avail_out
19 + state.bits < 8
20 +
21 + On return, state.mode is one of:
22 +
23 + LEN -- ran out of enough output space or enough available input
24 + TYPE -- reached end of block code, inflate() to interpret next block
25 + BAD -- error in block data
26 +
27 + Notes:
28 +
29 + - The maximum input bits used by a length/distance pair is 15 bits for the
30 + length code, 5 bits for the length extra, 15 bits for the distance code,
31 + and 13 bits for the distance extra. This totals 48 bits, or six bytes.
32 + Therefore if strm.avail_in >= 6, then there is enough input to avoid
33 + checking for available input while decoding.
34 +
35 + - The maximum bytes that a single length/distance pair can output is 258
36 + bytes, which is the maximum length that can be coded. inflate_fast()
37 + requires strm.avail_out >= 258 for each loop to avoid checking for
38 + output space.
39 + */
40 +export default function inflate_fast(strm, start) {
41 + var state;
42 + var _in; /* local strm.input */
43 + var last; /* have enough input while in < last */
44 + var _out; /* local strm.output */
45 + var beg; /* inflate()'s initial strm.output */
46 + var end; /* while out < end, enough space available */
47 +//#ifdef INFLATE_STRICT
48 + var dmax; /* maximum distance from zlib header */
49 +//#endif
50 + var wsize; /* window size or zero if not using window */
51 + var whave; /* valid bytes in the window */
52 + var wnext; /* window write index */
53 + // Use `s_window` instead `window`, avoid conflict with instrumentation tools
54 + var s_window; /* allocated sliding window, if wsize != 0 */
55 + var hold; /* local strm.hold */
56 + var bits; /* local strm.bits */
57 + var lcode; /* local strm.lencode */
58 + var dcode; /* local strm.distcode */
59 + var lmask; /* mask for first level of length codes */
60 + var dmask; /* mask for first level of distance codes */
61 + var here; /* retrieved table entry */
62 + var op; /* code bits, operation, extra bits, or */
63 + /* window position, window bytes to copy */
64 + var len; /* match length, unused bytes */
65 + var dist; /* match distance */
66 + var from; /* where to copy match from */
67 + var from_source;
68 +
69 +
70 + var input, output; // JS specific, because we have no pointers
71 +
72 + /* copy state to local variables */
73 + state = strm.state;
74 + //here = state.here;
75 + _in = strm.next_in;
76 + input = strm.input;
77 + last = _in + (strm.avail_in - 5);
78 + _out = strm.next_out;
79 + output = strm.output;
80 + beg = _out - (start - strm.avail_out);
81 + end = _out + (strm.avail_out - 257);
82 +//#ifdef INFLATE_STRICT
83 + dmax = state.dmax;
84 +//#endif
85 + wsize = state.wsize;
86 + whave = state.whave;
87 + wnext = state.wnext;
88 + s_window = state.window;
89 + hold = state.hold;
90 + bits = state.bits;
91 + lcode = state.lencode;
92 + dcode = state.distcode;
93 + lmask = (1 << state.lenbits) - 1;
94 + dmask = (1 << state.distbits) - 1;
95 +
96 +
97 + /* decode literals and length/distances until end-of-block or not enough
98 + input data or output space */
99 +
100 + top:
101 + do {
102 + if (bits < 15) {
103 + hold += input[_in++] << bits;
104 + bits += 8;
105 + hold += input[_in++] << bits;
106 + bits += 8;
107 + }
108 +
109 + here = lcode[hold & lmask];
110 +
111 + dolen:
112 + for (;;) { // Goto emulation
113 + op = here >>> 24/*here.bits*/;
114 + hold >>>= op;
115 + bits -= op;
116 + op = (here >>> 16) & 0xff/*here.op*/;
117 + if (op === 0) { /* literal */
118 + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
119 + // "inflate: literal '%c'\n" :
120 + // "inflate: literal 0x%02x\n", here.val));
121 + output[_out++] = here & 0xffff/*here.val*/;
122 + }
123 + else if (op & 16) { /* length base */
124 + len = here & 0xffff/*here.val*/;
125 + op &= 15; /* number of extra bits */
126 + if (op) {
127 + if (bits < op) {
128 + hold += input[_in++] << bits;
129 + bits += 8;
130 + }
131 + len += hold & ((1 << op) - 1);
132 + hold >>>= op;
133 + bits -= op;
134 + }
135 + //Tracevv((stderr, "inflate: length %u\n", len));
136 + if (bits < 15) {
137 + hold += input[_in++] << bits;
138 + bits += 8;
139 + hold += input[_in++] << bits;
140 + bits += 8;
141 + }
142 + here = dcode[hold & dmask];
143 +
144 + dodist:
145 + for (;;) { // goto emulation
146 + op = here >>> 24/*here.bits*/;
147 + hold >>>= op;
148 + bits -= op;
149 + op = (here >>> 16) & 0xff/*here.op*/;
150 +
151 + if (op & 16) { /* distance base */
152 + dist = here & 0xffff/*here.val*/;
153 + op &= 15; /* number of extra bits */
154 + if (bits < op) {
155 + hold += input[_in++] << bits;
156 + bits += 8;
157 + if (bits < op) {
158 + hold += input[_in++] << bits;
159 + bits += 8;
160 + }
161 + }
162 + dist += hold & ((1 << op) - 1);
163 +//#ifdef INFLATE_STRICT
164 + if (dist > dmax) {
165 + strm.msg = 'invalid distance too far back';
166 + state.mode = BAD;
167 + break top;
168 + }
169 +//#endif
170 + hold >>>= op;
171 + bits -= op;
172 + //Tracevv((stderr, "inflate: distance %u\n", dist));
173 + op = _out - beg; /* max distance in output */
174 + if (dist > op) { /* see if copy from window */
175 + op = dist - op; /* distance back in window */
176 + if (op > whave) {
177 + if (state.sane) {
178 + strm.msg = 'invalid distance too far back';
179 + state.mode = BAD;
180 + break top;
181 + }
182 +
183 +// (!) This block is disabled in zlib defailts,
184 +// don't enable it for binary compatibility
185 +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
186 +// if (len <= op - whave) {
187 +// do {
188 +// output[_out++] = 0;
189 +// } while (--len);
190 +// continue top;
191 +// }
192 +// len -= op - whave;
193 +// do {
194 +// output[_out++] = 0;
195 +// } while (--op > whave);
196 +// if (op === 0) {
197 +// from = _out - dist;
198 +// do {
199 +// output[_out++] = output[from++];
200 +// } while (--len);
201 +// continue top;
202 +// }
203 +//#endif
204 + }
205 + from = 0; // window index
206 + from_source = s_window;
207 + if (wnext === 0) { /* very common case */
208 + from += wsize - op;
209 + if (op < len) { /* some from window */
210 + len -= op;
211 + do {
212 + output[_out++] = s_window[from++];
213 + } while (--op);
214 + from = _out - dist; /* rest from output */
215 + from_source = output;
216 + }
217 + }
218 + else if (wnext < op) { /* wrap around window */
219 + from += wsize + wnext - op;
220 + op -= wnext;
221 + if (op < len) { /* some from end of window */
222 + len -= op;
223 + do {
224 + output[_out++] = s_window[from++];
225 + } while (--op);
226 + from = 0;
227 + if (wnext < len) { /* some from start of window */
228 + op = wnext;
229 + len -= op;
230 + do {
231 + output[_out++] = s_window[from++];
232 + } while (--op);
233 + from = _out - dist; /* rest from output */
234 + from_source = output;
235 + }
236 + }
237 + }
238 + else { /* contiguous in window */
239 + from += wnext - op;
240 + if (op < len) { /* some from window */
241 + len -= op;
242 + do {
243 + output[_out++] = s_window[from++];
244 + } while (--op);
245 + from = _out - dist; /* rest from output */
246 + from_source = output;
247 + }
248 + }
249 + while (len > 2) {
250 + output[_out++] = from_source[from++];
251 + output[_out++] = from_source[from++];
252 + output[_out++] = from_source[from++];
253 + len -= 3;
254 + }
255 + if (len) {
256 + output[_out++] = from_source[from++];
257 + if (len > 1) {
258 + output[_out++] = from_source[from++];
259 + }
260 + }
261 + }
262 + else {
263 + from = _out - dist; /* copy direct from output */
264 + do { /* minimum length is three */
265 + output[_out++] = output[from++];
266 + output[_out++] = output[from++];
267 + output[_out++] = output[from++];
268 + len -= 3;
269 + } while (len > 2);
270 + if (len) {
271 + output[_out++] = output[from++];
272 + if (len > 1) {
273 + output[_out++] = output[from++];
274 + }
275 + }
276 + }
277 + }
278 + else if ((op & 64) === 0) { /* 2nd level distance code */
279 + here = dcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
280 + continue dodist;
281 + }
282 + else {
283 + strm.msg = 'invalid distance code';
284 + state.mode = BAD;
285 + break top;
286 + }
287 +
288 + break; // need to emulate goto via "continue"
289 + }
290 + }
291 + else if ((op & 64) === 0) { /* 2nd level length code */
292 + here = lcode[(here & 0xffff)/*here.val*/ + (hold & ((1 << op) - 1))];
293 + continue dolen;
294 + }
295 + else if (op & 32) { /* end-of-block */
296 + //Tracevv((stderr, "inflate: end of block\n"));
297 + state.mode = TYPE;
298 + break top;
299 + }
300 + else {
301 + strm.msg = 'invalid literal/length code';
302 + state.mode = BAD;
303 + break top;
304 + }
305 +
306 + break; // need to emulate goto via "continue"
307 + }
308 + } while (_in < last && _out < end);
309 +
310 + /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
311 + len = bits >> 3;
312 + _in -= len;
313 + bits -= len << 3;
314 + hold &= (1 << bits) - 1;
315 +
316 + /* update state and return */
317 + strm.next_in = _in;
318 + strm.next_out = _out;
319 + strm.avail_in = (_in < last ? 5 + (last - _in) : 5 - (_in - last));
320 + strm.avail_out = (_out < end ? 257 + (end - _out) : 257 - (_out - end));
321 + state.hold = hold;
322 + state.bits = bits;
323 + return;
324 +};
public/novnc/vendor/pako/lib/zlib/inflate.js new
+1527
@@ -0,0 +1,1527 @@
1 +import * as utils from "../utils/common.js";
2 +import adler32 from "./adler32.js";
3 +import crc32 from "./crc32.js";
4 +import inflate_fast from "./inffast.js";
5 +import inflate_table from "./inftrees.js";
6 +
7 +var CODES = 0;
8 +var LENS = 1;
9 +var DISTS = 2;
10 +
11 +/* Public constants ==========================================================*/
12 +/* ===========================================================================*/
13 +
14 +
15 +/* Allowed flush values; see deflate() and inflate() below for details */
16 +//var Z_NO_FLUSH = 0;
17 +//var Z_PARTIAL_FLUSH = 1;
18 +//var Z_SYNC_FLUSH = 2;
19 +//var Z_FULL_FLUSH = 3;
20 +var Z_FINISH = 4;
21 +var Z_BLOCK = 5;
22 +var Z_TREES = 6;
23 +
24 +
25 +/* Return codes for the compression/decompression functions. Negative values
26 + * are errors, positive values are used for special but normal events.
27 + */
28 +var Z_OK = 0;
29 +var Z_STREAM_END = 1;
30 +var Z_NEED_DICT = 2;
31 +//var Z_ERRNO = -1;
32 +var Z_STREAM_ERROR = -2;
33 +var Z_DATA_ERROR = -3;
34 +var Z_MEM_ERROR = -4;
35 +var Z_BUF_ERROR = -5;
36 +//var Z_VERSION_ERROR = -6;
37 +
38 +/* The deflate compression method */
39 +var Z_DEFLATED = 8;
40 +
41 +
42 +/* STATES ====================================================================*/
43 +/* ===========================================================================*/
44 +
45 +
46 +var HEAD = 1; /* i: waiting for magic header */
47 +var FLAGS = 2; /* i: waiting for method and flags (gzip) */
48 +var TIME = 3; /* i: waiting for modification time (gzip) */
49 +var OS = 4; /* i: waiting for extra flags and operating system (gzip) */
50 +var EXLEN = 5; /* i: waiting for extra length (gzip) */
51 +var EXTRA = 6; /* i: waiting for extra bytes (gzip) */
52 +var NAME = 7; /* i: waiting for end of file name (gzip) */
53 +var COMMENT = 8; /* i: waiting for end of comment (gzip) */
54 +var HCRC = 9; /* i: waiting for header crc (gzip) */
55 +var DICTID = 10; /* i: waiting for dictionary check value */
56 +var DICT = 11; /* waiting for inflateSetDictionary() call */
57 +var TYPE = 12; /* i: waiting for type bits, including last-flag bit */
58 +var TYPEDO = 13; /* i: same, but skip check to exit inflate on new block */
59 +var STORED = 14; /* i: waiting for stored size (length and complement) */
60 +var COPY_ = 15; /* i/o: same as COPY below, but only first time in */
61 +var COPY = 16; /* i/o: waiting for input or output to copy stored block */
62 +var TABLE = 17; /* i: waiting for dynamic block table lengths */
63 +var LENLENS = 18; /* i: waiting for code length code lengths */
64 +var CODELENS = 19; /* i: waiting for length/lit and distance code lengths */
65 +var LEN_ = 20; /* i: same as LEN below, but only first time in */
66 +var LEN = 21; /* i: waiting for length/lit/eob code */
67 +var LENEXT = 22; /* i: waiting for length extra bits */
68 +var DIST = 23; /* i: waiting for distance code */
69 +var DISTEXT = 24; /* i: waiting for distance extra bits */
70 +var MATCH = 25; /* o: waiting for output space to copy string */
71 +var LIT = 26; /* o: waiting for output space to write literal */
72 +var CHECK = 27; /* i: waiting for 32-bit check value */
73 +var LENGTH = 28; /* i: waiting for 32-bit length (gzip) */
74 +var DONE = 29; /* finished check, done -- remain here until reset */
75 +var BAD = 30; /* got a data error -- remain here until reset */
76 +var MEM = 31; /* got an inflate() memory error -- remain here until reset */
77 +var SYNC = 32; /* looking for synchronization bytes to restart inflate() */
78 +
79 +/* ===========================================================================*/
80 +
81 +
82 +
83 +var ENOUGH_LENS = 852;
84 +var ENOUGH_DISTS = 592;
85 +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
86 +
87 +var MAX_WBITS = 15;
88 +/* 32K LZ77 window */
89 +var DEF_WBITS = MAX_WBITS;
90 +
91 +
92 +function zswap32(q) {
93 + return (((q >>> 24) & 0xff) +
94 + ((q >>> 8) & 0xff00) +
95 + ((q & 0xff00) << 8) +
96 + ((q & 0xff) << 24));
97 +}
98 +
99 +
100 +function InflateState() {
101 + this.mode = 0; /* current inflate mode */
102 + this.last = false; /* true if processing last block */
103 + this.wrap = 0; /* bit 0 true for zlib, bit 1 true for gzip */
104 + this.havedict = false; /* true if dictionary provided */
105 + this.flags = 0; /* gzip header method and flags (0 if zlib) */
106 + this.dmax = 0; /* zlib header max distance (INFLATE_STRICT) */
107 + this.check = 0; /* protected copy of check value */
108 + this.total = 0; /* protected copy of output count */
109 + // TODO: may be {}
110 + this.head = null; /* where to save gzip header information */
111 +
112 + /* sliding window */
113 + this.wbits = 0; /* log base 2 of requested window size */
114 + this.wsize = 0; /* window size or zero if not using window */
115 + this.whave = 0; /* valid bytes in the window */
116 + this.wnext = 0; /* window write index */
117 + this.window = null; /* allocated sliding window, if needed */
118 +
119 + /* bit accumulator */
120 + this.hold = 0; /* input bit accumulator */
121 + this.bits = 0; /* number of bits in "in" */
122 +
123 + /* for string and stored block copying */
124 + this.length = 0; /* literal or length of data to copy */
125 + this.offset = 0; /* distance back to copy string from */
126 +
127 + /* for table and code decoding */
128 + this.extra = 0; /* extra bits needed */
129 +
130 + /* fixed and dynamic code tables */
131 + this.lencode = null; /* starting table for length/literal codes */
132 + this.distcode = null; /* starting table for distance codes */
133 + this.lenbits = 0; /* index bits for lencode */
134 + this.distbits = 0; /* index bits for distcode */
135 +
136 + /* dynamic table building */
137 + this.ncode = 0; /* number of code length code lengths */
138 + this.nlen = 0; /* number of length code lengths */
139 + this.ndist = 0; /* number of distance code lengths */
140 + this.have = 0; /* number of code lengths in lens[] */
141 + this.next = null; /* next available space in codes[] */
142 +
143 + this.lens = new utils.Buf16(320); /* temporary storage for code lengths */
144 + this.work = new utils.Buf16(288); /* work area for code table building */
145 +
146 + /*
147 + because we don't have pointers in js, we use lencode and distcode directly
148 + as buffers so we don't need codes
149 + */
150 + //this.codes = new utils.Buf32(ENOUGH); /* space for code tables */
151 + this.lendyn = null; /* dynamic table for length/literal codes (JS specific) */
152 + this.distdyn = null; /* dynamic table for distance codes (JS specific) */
153 + this.sane = 0; /* if false, allow invalid distance too far */
154 + this.back = 0; /* bits back of last unprocessed length/lit */
155 + this.was = 0; /* initial length of match */
156 +}
157 +
158 +function inflateResetKeep(strm) {
159 + var state;
160 +
161 + if (!strm || !strm.state) { return Z_STREAM_ERROR; }
162 + state = strm.state;
163 + strm.total_in = strm.total_out = state.total = 0;
164 + strm.msg = ''; /*Z_NULL*/
165 + if (state.wrap) { /* to support ill-conceived Java test suite */
166 + strm.adler = state.wrap & 1;
167 + }
168 + state.mode = HEAD;
169 + state.last = 0;
170 + state.havedict = 0;
171 + state.dmax = 32768;
172 + state.head = null/*Z_NULL*/;
173 + state.hold = 0;
174 + state.bits = 0;
175 + //state.lencode = state.distcode = state.next = state.codes;
176 + state.lencode = state.lendyn = new utils.Buf32(ENOUGH_LENS);
177 + state.distcode = state.distdyn = new utils.Buf32(ENOUGH_DISTS);
178 +
179 + state.sane = 1;
180 + state.back = -1;
181 + //Tracev((stderr, "inflate: reset\n"));
182 + return Z_OK;
183 +}
184 +
185 +function inflateReset(strm) {
186 + var state;
187 +
188 + if (!strm || !strm.state) { return Z_STREAM_ERROR; }
189 + state = strm.state;
190 + state.wsize = 0;
191 + state.whave = 0;
192 + state.wnext = 0;
193 + return inflateResetKeep(strm);
194 +
195 +}
196 +
197 +function inflateReset2(strm, windowBits) {
198 + var wrap;
199 + var state;
200 +
201 + /* get the state */
202 + if (!strm || !strm.state) { return Z_STREAM_ERROR; }
203 + state = strm.state;
204 +
205 + /* extract wrap request from windowBits parameter */
206 + if (windowBits < 0) {
207 + wrap = 0;
208 + windowBits = -windowBits;
209 + }
210 + else {
211 + wrap = (windowBits >> 4) + 1;
212 + if (windowBits < 48) {
213 + windowBits &= 15;
214 + }
215 + }
216 +
217 + /* set number of window bits, free window if different */
218 + if (windowBits && (windowBits < 8 || windowBits > 15)) {
219 + return Z_STREAM_ERROR;
220 + }
221 + if (state.window !== null && state.wbits !== windowBits) {
222 + state.window = null;
223 + }
224 +
225 + /* update state and reset the rest of it */
226 + state.wrap = wrap;
227 + state.wbits = windowBits;
228 + return inflateReset(strm);
229 +}
230 +
231 +function inflateInit2(strm, windowBits) {
232 + var ret;
233 + var state;
234 +
235 + if (!strm) { return Z_STREAM_ERROR; }
236 + //strm.msg = Z_NULL; /* in case we return an error */
237 +
238 + state = new InflateState();
239 +
240 + //if (state === Z_NULL) return Z_MEM_ERROR;
241 + //Tracev((stderr, "inflate: allocated\n"));
242 + strm.state = state;
243 + state.window = null/*Z_NULL*/;
244 + ret = inflateReset2(strm, windowBits);
245 + if (ret !== Z_OK) {
246 + strm.state = null/*Z_NULL*/;
247 + }
248 + return ret;
249 +}
250 +
251 +function inflateInit(strm) {
252 + return inflateInit2(strm, DEF_WBITS);
253 +}
254 +
255 +
256 +/*
257 + Return state with length and distance decoding tables and index sizes set to
258 + fixed code decoding. Normally this returns fixed tables from inffixed.h.
259 + If BUILDFIXED is defined, then instead this routine builds the tables the
260 + first time it's called, and returns those tables the first time and
261 + thereafter. This reduces the size of the code by about 2K bytes, in
262 + exchange for a little execution time. However, BUILDFIXED should not be
263 + used for threaded applications, since the rewriting of the tables and virgin
264 + may not be thread-safe.
265 + */
266 +var virgin = true;
267 +
268 +var lenfix, distfix; // We have no pointers in JS, so keep tables separate
269 +
270 +function fixedtables(state) {
271 + /* build fixed huffman tables if first call (may not be thread safe) */
272 + if (virgin) {
273 + var sym;
274 +
275 + lenfix = new utils.Buf32(512);
276 + distfix = new utils.Buf32(32);
277 +
278 + /* literal/length table */
279 + sym = 0;
280 + while (sym < 144) { state.lens[sym++] = 8; }
281 + while (sym < 256) { state.lens[sym++] = 9; }
282 + while (sym < 280) { state.lens[sym++] = 7; }
283 + while (sym < 288) { state.lens[sym++] = 8; }
284 +
285 + inflate_table(LENS, state.lens, 0, 288, lenfix, 0, state.work, { bits: 9 });
286 +
287 + /* distance table */
288 + sym = 0;
289 + while (sym < 32) { state.lens[sym++] = 5; }
290 +
291 + inflate_table(DISTS, state.lens, 0, 32, distfix, 0, state.work, { bits: 5 });
292 +
293 + /* do this just once */
294 + virgin = false;
295 + }
296 +
297 + state.lencode = lenfix;
298 + state.lenbits = 9;
299 + state.distcode = distfix;
300 + state.distbits = 5;
301 +}
302 +
303 +
304 +/*
305 + Update the window with the last wsize (normally 32K) bytes written before
306 + returning. If window does not exist yet, create it. This is only called
307 + when a window is already in use, or when output has been written during this
308 + inflate call, but the end of the deflate stream has not been reached yet.
309 + It is also called to create a window for dictionary data when a dictionary
310 + is loaded.
311 +
312 + Providing output buffers larger than 32K to inflate() should provide a speed
313 + advantage, since only the last 32K of output is copied to the sliding window
314 + upon return from inflate(), and since all distances after the first 32K of
315 + output will fall in the output data, making match copies simpler and faster.
316 + The advantage may be dependent on the size of the processor's data caches.
317 + */
318 +function updatewindow(strm, src, end, copy) {
319 + var dist;
320 + var state = strm.state;
321 +
322 + /* if it hasn't been done already, allocate space for the window */
323 + if (state.window === null) {
324 + state.wsize = 1 << state.wbits;
325 + state.wnext = 0;
326 + state.whave = 0;
327 +
328 + state.window = new utils.Buf8(state.wsize);
329 + }
330 +
331 + /* copy state->wsize or less output bytes into the circular window */
332 + if (copy >= state.wsize) {
333 + utils.arraySet(state.window, src, end - state.wsize, state.wsize, 0);
334 + state.wnext = 0;
335 + state.whave = state.wsize;
336 + }
337 + else {
338 + dist = state.wsize - state.wnext;
339 + if (dist > copy) {
340 + dist = copy;
341 + }
342 + //zmemcpy(state->window + state->wnext, end - copy, dist);
343 + utils.arraySet(state.window, src, end - copy, dist, state.wnext);
344 + copy -= dist;
345 + if (copy) {
346 + //zmemcpy(state->window, end - copy, copy);
347 + utils.arraySet(state.window, src, end - copy, copy, 0);
348 + state.wnext = copy;
349 + state.whave = state.wsize;
350 + }
351 + else {
352 + state.wnext += dist;
353 + if (state.wnext === state.wsize) { state.wnext = 0; }
354 + if (state.whave < state.wsize) { state.whave += dist; }
355 + }
356 + }
357 + return 0;
358 +}
359 +
360 +function inflate(strm, flush) {
361 + var state;
362 + var input, output; // input/output buffers
363 + var next; /* next input INDEX */
364 + var put; /* next output INDEX */
365 + var have, left; /* available input and output */
366 + var hold; /* bit buffer */
367 + var bits; /* bits in bit buffer */
368 + var _in, _out; /* save starting available input and output */
369 + var copy; /* number of stored or match bytes to copy */
370 + var from; /* where to copy match bytes from */
371 + var from_source;
372 + var here = 0; /* current decoding table entry */
373 + var here_bits, here_op, here_val; // paked "here" denormalized (JS specific)
374 + //var last; /* parent table entry */
375 + var last_bits, last_op, last_val; // paked "last" denormalized (JS specific)
376 + var len; /* length to copy for repeats, bits to drop */
377 + var ret; /* return code */
378 + var hbuf = new utils.Buf8(4); /* buffer for gzip header crc calculation */
379 + var opts;
380 +
381 + var n; // temporary var for NEED_BITS
382 +
383 + var order = /* permutation of code lengths */
384 + [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ];
385 +
386 +
387 + if (!strm || !strm.state || !strm.output ||
388 + (!strm.input && strm.avail_in !== 0)) {
389 + return Z_STREAM_ERROR;
390 + }
391 +
392 + state = strm.state;
393 + if (state.mode === TYPE) { state.mode = TYPEDO; } /* skip check */
394 +
395 +
396 + //--- LOAD() ---
397 + put = strm.next_out;
398 + output = strm.output;
399 + left = strm.avail_out;
400 + next = strm.next_in;
401 + input = strm.input;
402 + have = strm.avail_in;
403 + hold = state.hold;
404 + bits = state.bits;
405 + //---
406 +
407 + _in = have;
408 + _out = left;
409 + ret = Z_OK;
410 +
411 + inf_leave: // goto emulation
412 + for (;;) {
413 + switch (state.mode) {
414 + case HEAD:
415 + if (state.wrap === 0) {
416 + state.mode = TYPEDO;
417 + break;
418 + }
419 + //=== NEEDBITS(16);
420 + while (bits < 16) {
421 + if (have === 0) { break inf_leave; }
422 + have--;
423 + hold += input[next++] << bits;
424 + bits += 8;
425 + }
426 + //===//
427 + if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
428 + state.check = 0/*crc32(0L, Z_NULL, 0)*/;
429 + //=== CRC2(state.check, hold);
430 + hbuf[0] = hold & 0xff;
431 + hbuf[1] = (hold >>> 8) & 0xff;
432 + state.check = crc32(state.check, hbuf, 2, 0);
433 + //===//
434 +
435 + //=== INITBITS();
436 + hold = 0;
437 + bits = 0;
438 + //===//
439 + state.mode = FLAGS;
440 + break;
441 + }
442 + state.flags = 0; /* expect zlib header */
443 + if (state.head) {
444 + state.head.done = false;
445 + }
446 + if (!(state.wrap & 1) || /* check if zlib header allowed */
447 + (((hold & 0xff)/*BITS(8)*/ << 8) + (hold >> 8)) % 31) {
448 + strm.msg = 'incorrect header check';
449 + state.mode = BAD;
450 + break;
451 + }
452 + if ((hold & 0x0f)/*BITS(4)*/ !== Z_DEFLATED) {
453 + strm.msg = 'unknown compression method';
454 + state.mode = BAD;
455 + break;
456 + }
457 + //--- DROPBITS(4) ---//
458 + hold >>>= 4;
459 + bits -= 4;
460 + //---//
461 + len = (hold & 0x0f)/*BITS(4)*/ + 8;
462 + if (state.wbits === 0) {
463 + state.wbits = len;
464 + }
465 + else if (len > state.wbits) {
466 + strm.msg = 'invalid window size';
467 + state.mode = BAD;
468 + break;
469 + }
470 + state.dmax = 1 << len;
471 + //Tracev((stderr, "inflate: zlib header ok\n"));
472 + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
473 + state.mode = hold & 0x200 ? DICTID : TYPE;
474 + //=== INITBITS();
475 + hold = 0;
476 + bits = 0;
477 + //===//
478 + break;
479 + case FLAGS:
480 + //=== NEEDBITS(16); */
481 + while (bits < 16) {
482 + if (have === 0) { break inf_leave; }
483 + have--;
484 + hold += input[next++] << bits;
485 + bits += 8;
486 + }
487 + //===//
488 + state.flags = hold;
489 + if ((state.flags & 0xff) !== Z_DEFLATED) {
490 + strm.msg = 'unknown compression method';
491 + state.mode = BAD;
492 + break;
493 + }
494 + if (state.flags & 0xe000) {
495 + strm.msg = 'unknown header flags set';
496 + state.mode = BAD;
497 + break;
498 + }
499 + if (state.head) {
500 + state.head.text = ((hold >> 8) & 1);
501 + }
502 + if (state.flags & 0x0200) {
503 + //=== CRC2(state.check, hold);
504 + hbuf[0] = hold & 0xff;
505 + hbuf[1] = (hold >>> 8) & 0xff;
506 + state.check = crc32(state.check, hbuf, 2, 0);
507 + //===//
508 + }
509 + //=== INITBITS();
510 + hold = 0;
511 + bits = 0;
512 + //===//
513 + state.mode = TIME;
514 + /* falls through */
515 + case TIME:
516 + //=== NEEDBITS(32); */
517 + while (bits < 32) {
518 + if (have === 0) { break inf_leave; }
519 + have--;
520 + hold += input[next++] << bits;
521 + bits += 8;
522 + }
523 + //===//
524 + if (state.head) {
525 + state.head.time = hold;
526 + }
527 + if (state.flags & 0x0200) {
528 + //=== CRC4(state.check, hold)
529 + hbuf[0] = hold & 0xff;
530 + hbuf[1] = (hold >>> 8) & 0xff;
531 + hbuf[2] = (hold >>> 16) & 0xff;
532 + hbuf[3] = (hold >>> 24) & 0xff;
533 + state.check = crc32(state.check, hbuf, 4, 0);
534 + //===
535 + }
536 + //=== INITBITS();
537 + hold = 0;
538 + bits = 0;
539 + //===//
540 + state.mode = OS;
541 + /* falls through */
542 + case OS:
543 + //=== NEEDBITS(16); */
544 + while (bits < 16) {
545 + if (have === 0) { break inf_leave; }
546 + have--;
547 + hold += input[next++] << bits;
548 + bits += 8;
549 + }
550 + //===//
551 + if (state.head) {
552 + state.head.xflags = (hold & 0xff);
553 + state.head.os = (hold >> 8);
554 + }
555 + if (state.flags & 0x0200) {
556 + //=== CRC2(state.check, hold);
557 + hbuf[0] = hold & 0xff;
558 + hbuf[1] = (hold >>> 8) & 0xff;
559 + state.check = crc32(state.check, hbuf, 2, 0);
560 + //===//
561 + }
562 + //=== INITBITS();
563 + hold = 0;
564 + bits = 0;
565 + //===//
566 + state.mode = EXLEN;
567 + /* falls through */
568 + case EXLEN:
569 + if (state.flags & 0x0400) {
570 + //=== NEEDBITS(16); */
571 + while (bits < 16) {
572 + if (have === 0) { break inf_leave; }
573 + have--;
574 + hold += input[next++] << bits;
575 + bits += 8;
576 + }
577 + //===//
578 + state.length = hold;
579 + if (state.head) {
580 + state.head.extra_len = hold;
581 + }
582 + if (state.flags & 0x0200) {
583 + //=== CRC2(state.check, hold);
584 + hbuf[0] = hold & 0xff;
585 + hbuf[1] = (hold >>> 8) & 0xff;
586 + state.check = crc32(state.check, hbuf, 2, 0);
587 + //===//
588 + }
589 + //=== INITBITS();
590 + hold = 0;
591 + bits = 0;
592 + //===//
593 + }
594 + else if (state.head) {
595 + state.head.extra = null/*Z_NULL*/;
596 + }
597 + state.mode = EXTRA;
598 + /* falls through */
599 + case EXTRA:
600 + if (state.flags & 0x0400) {
601 + copy = state.length;
602 + if (copy > have) { copy = have; }
603 + if (copy) {
604 + if (state.head) {
605 + len = state.head.extra_len - state.length;
606 + if (!state.head.extra) {
607 + // Use untyped array for more conveniend processing later
608 + state.head.extra = new Array(state.head.extra_len);
609 + }
610 + utils.arraySet(
611 + state.head.extra,
612 + input,
613 + next,
614 + // extra field is limited to 65536 bytes
615 + // - no need for additional size check
616 + copy,
617 + /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
618 + len
619 + );
620 + //zmemcpy(state.head.extra + len, next,
621 + // len + copy > state.head.extra_max ?
622 + // state.head.extra_max - len : copy);
623 + }
624 + if (state.flags & 0x0200) {
625 + state.check = crc32(state.check, input, copy, next);
626 + }
627 + have -= copy;
628 + next += copy;
629 + state.length -= copy;
630 + }
631 + if (state.length) { break inf_leave; }
632 + }
633 + state.length = 0;
634 + state.mode = NAME;
635 + /* falls through */
636 + case NAME:
637 + if (state.flags & 0x0800) {
638 + if (have === 0) { break inf_leave; }
639 + copy = 0;
640 + do {
641 + // TODO: 2 or 1 bytes?
642 + len = input[next + copy++];
643 + /* use constant limit because in js we should not preallocate memory */
644 + if (state.head && len &&
645 + (state.length < 65536 /*state.head.name_max*/)) {
646 + state.head.name += String.fromCharCode(len);
647 + }
648 + } while (len && copy < have);
649 +
650 + if (state.flags & 0x0200) {
651 + state.check = crc32(state.check, input, copy, next);
652 + }
653 + have -= copy;
654 + next += copy;
655 + if (len) { break inf_leave; }
656 + }
657 + else if (state.head) {
658 + state.head.name = null;
659 + }
660 + state.length = 0;
661 + state.mode = COMMENT;
662 + /* falls through */
663 + case COMMENT:
664 + if (state.flags & 0x1000) {
665 + if (have === 0) { break inf_leave; }
666 + copy = 0;
667 + do {
668 + len = input[next + copy++];
669 + /* use constant limit because in js we should not preallocate memory */
670 + if (state.head && len &&
671 + (state.length < 65536 /*state.head.comm_max*/)) {
672 + state.head.comment += String.fromCharCode(len);
673 + }
674 + } while (len && copy < have);
675 + if (state.flags & 0x0200) {
676 + state.check = crc32(state.check, input, copy, next);
677 + }
678 + have -= copy;
679 + next += copy;
680 + if (len) { break inf_leave; }
681 + }
682 + else if (state.head) {
683 + state.head.comment = null;
684 + }
685 + state.mode = HCRC;
686 + /* falls through */
687 + case HCRC:
688 + if (state.flags & 0x0200) {
689 + //=== NEEDBITS(16); */
690 + while (bits < 16) {
691 + if (have === 0) { break inf_leave; }
692 + have--;
693 + hold += input[next++] << bits;
694 + bits += 8;
695 + }
696 + //===//
697 + if (hold !== (state.check & 0xffff)) {
698 + strm.msg = 'header crc mismatch';
699 + state.mode = BAD;
700 + break;
701 + }
702 + //=== INITBITS();
703 + hold = 0;
704 + bits = 0;
705 + //===//
706 + }
707 + if (state.head) {
708 + state.head.hcrc = ((state.flags >> 9) & 1);
709 + state.head.done = true;
710 + }
711 + strm.adler = state.check = 0;
712 + state.mode = TYPE;
713 + break;
714 + case DICTID:
715 + //=== NEEDBITS(32); */
716 + while (bits < 32) {
717 + if (have === 0) { break inf_leave; }
718 + have--;
719 + hold += input[next++] << bits;
720 + bits += 8;
721 + }
722 + //===//
723 + strm.adler = state.check = zswap32(hold);
724 + //=== INITBITS();
725 + hold = 0;
726 + bits = 0;
727 + //===//
728 + state.mode = DICT;
729 + /* falls through */
730 + case DICT:
731 + if (state.havedict === 0) {
732 + //--- RESTORE() ---
733 + strm.next_out = put;
734 + strm.avail_out = left;
735 + strm.next_in = next;
736 + strm.avail_in = have;
737 + state.hold = hold;
738 + state.bits = bits;
739 + //---
740 + return Z_NEED_DICT;
741 + }
742 + strm.adler = state.check = 1/*adler32(0L, Z_NULL, 0)*/;
743 + state.mode = TYPE;
744 + /* falls through */
745 + case TYPE:
746 + if (flush === Z_BLOCK || flush === Z_TREES) { break inf_leave; }
747 + /* falls through */
748 + case TYPEDO:
749 + if (state.last) {
750 + //--- BYTEBITS() ---//
751 + hold >>>= bits & 7;
752 + bits -= bits & 7;
753 + //---//
754 + state.mode = CHECK;
755 + break;
756 + }
757 + //=== NEEDBITS(3); */
758 + while (bits < 3) {
759 + if (have === 0) { break inf_leave; }
760 + have--;
761 + hold += input[next++] << bits;
762 + bits += 8;
763 + }
764 + //===//
765 + state.last = (hold & 0x01)/*BITS(1)*/;
766 + //--- DROPBITS(1) ---//
767 + hold >>>= 1;
768 + bits -= 1;
769 + //---//
770 +
771 + switch ((hold & 0x03)/*BITS(2)*/) {
772 + case 0: /* stored block */
773 + //Tracev((stderr, "inflate: stored block%s\n",
774 + // state.last ? " (last)" : ""));
775 + state.mode = STORED;
776 + break;
777 + case 1: /* fixed block */
778 + fixedtables(state);
779 + //Tracev((stderr, "inflate: fixed codes block%s\n",
780 + // state.last ? " (last)" : ""));
781 + state.mode = LEN_; /* decode codes */
782 + if (flush === Z_TREES) {
783 + //--- DROPBITS(2) ---//
784 + hold >>>= 2;
785 + bits -= 2;
786 + //---//
787 + break inf_leave;
788 + }
789 + break;
790 + case 2: /* dynamic block */
791 + //Tracev((stderr, "inflate: dynamic codes block%s\n",
792 + // state.last ? " (last)" : ""));
793 + state.mode = TABLE;
794 + break;
795 + case 3:
796 + strm.msg = 'invalid block type';
797 + state.mode = BAD;
798 + }
799 + //--- DROPBITS(2) ---//
800 + hold >>>= 2;
801 + bits -= 2;
802 + //---//
803 + break;
804 + case STORED:
805 + //--- BYTEBITS() ---// /* go to byte boundary */
806 + hold >>>= bits & 7;
807 + bits -= bits & 7;
808 + //---//
809 + //=== NEEDBITS(32); */
810 + while (bits < 32) {
811 + if (have === 0) { break inf_leave; }
812 + have--;
813 + hold += input[next++] << bits;
814 + bits += 8;
815 + }
816 + //===//
817 + if ((hold & 0xffff) !== ((hold >>> 16) ^ 0xffff)) {
818 + strm.msg = 'invalid stored block lengths';
819 + state.mode = BAD;
820 + break;
821 + }
822 + state.length = hold & 0xffff;
823 + //Tracev((stderr, "inflate: stored length %u\n",
824 + // state.length));
825 + //=== INITBITS();
826 + hold = 0;
827 + bits = 0;
828 + //===//
829 + state.mode = COPY_;
830 + if (flush === Z_TREES) { break inf_leave; }
831 + /* falls through */
832 + case COPY_:
833 + state.mode = COPY;
834 + /* falls through */
835 + case COPY:
836 + copy = state.length;
837 + if (copy) {
838 + if (copy > have) { copy = have; }
839 + if (copy > left) { copy = left; }
840 + if (copy === 0) { break inf_leave; }
841 + //--- zmemcpy(put, next, copy); ---
842 + utils.arraySet(output, input, next, copy, put);
843 + //---//
844 + have -= copy;
845 + next += copy;
846 + left -= copy;
847 + put += copy;
848 + state.length -= copy;
849 + break;
850 + }
851 + //Tracev((stderr, "inflate: stored end\n"));
852 + state.mode = TYPE;
853 + break;
854 + case TABLE:
855 + //=== NEEDBITS(14); */
856 + while (bits < 14) {
857 + if (have === 0) { break inf_leave; }
858 + have--;
859 + hold += input[next++] << bits;
860 + bits += 8;
861 + }
862 + //===//
863 + state.nlen = (hold & 0x1f)/*BITS(5)*/ + 257;
864 + //--- DROPBITS(5) ---//
865 + hold >>>= 5;
866 + bits -= 5;
867 + //---//
868 + state.ndist = (hold & 0x1f)/*BITS(5)*/ + 1;
869 + //--- DROPBITS(5) ---//
870 + hold >>>= 5;
871 + bits -= 5;
872 + //---//
873 + state.ncode = (hold & 0x0f)/*BITS(4)*/ + 4;
874 + //--- DROPBITS(4) ---//
875 + hold >>>= 4;
876 + bits -= 4;
877 + //---//
878 +//#ifndef PKZIP_BUG_WORKAROUND
879 + if (state.nlen > 286 || state.ndist > 30) {
880 + strm.msg = 'too many length or distance symbols';
881 + state.mode = BAD;
882 + break;
883 + }
884 +//#endif
885 + //Tracev((stderr, "inflate: table sizes ok\n"));
886 + state.have = 0;
887 + state.mode = LENLENS;
888 + /* falls through */
889 + case LENLENS:
890 + while (state.have < state.ncode) {
891 + //=== NEEDBITS(3);
892 + while (bits < 3) {
893 + if (have === 0) { break inf_leave; }
894 + have--;
895 + hold += input[next++] << bits;
896 + bits += 8;
897 + }
898 + //===//
899 + state.lens[order[state.have++]] = (hold & 0x07);//BITS(3);
900 + //--- DROPBITS(3) ---//
901 + hold >>>= 3;
902 + bits -= 3;
903 + //---//
904 + }
905 + while (state.have < 19) {
906 + state.lens[order[state.have++]] = 0;
907 + }
908 + // We have separate tables & no pointers. 2 commented lines below not needed.
909 + //state.next = state.codes;
910 + //state.lencode = state.next;
911 + // Switch to use dynamic table
912 + state.lencode = state.lendyn;
913 + state.lenbits = 7;
914 +
915 + opts = { bits: state.lenbits };
916 + ret = inflate_table(CODES, state.lens, 0, 19, state.lencode, 0, state.work, opts);
917 + state.lenbits = opts.bits;
918 +
919 + if (ret) {
920 + strm.msg = 'invalid code lengths set';
921 + state.mode = BAD;
922 + break;
923 + }
924 + //Tracev((stderr, "inflate: code lengths ok\n"));
925 + state.have = 0;
926 + state.mode = CODELENS;
927 + /* falls through */
928 + case CODELENS:
929 + while (state.have < state.nlen + state.ndist) {
930 + for (;;) {
931 + here = state.lencode[hold & ((1 << state.lenbits) - 1)];/*BITS(state.lenbits)*/
932 + here_bits = here >>> 24;
933 + here_op = (here >>> 16) & 0xff;
934 + here_val = here & 0xffff;
935 +
936 + if ((here_bits) <= bits) { break; }
937 + //--- PULLBYTE() ---//
938 + if (have === 0) { break inf_leave; }
939 + have--;
940 + hold += input[next++] << bits;
941 + bits += 8;
942 + //---//
943 + }
944 + if (here_val < 16) {
945 + //--- DROPBITS(here.bits) ---//
946 + hold >>>= here_bits;
947 + bits -= here_bits;
948 + //---//
949 + state.lens[state.have++] = here_val;
950 + }
951 + else {
952 + if (here_val === 16) {
953 + //=== NEEDBITS(here.bits + 2);
954 + n = here_bits + 2;
955 + while (bits < n) {
956 + if (have === 0) { break inf_leave; }
957 + have--;
958 + hold += input[next++] << bits;
959 + bits += 8;
960 + }
961 + //===//
962 + //--- DROPBITS(here.bits) ---//
963 + hold >>>= here_bits;
964 + bits -= here_bits;
965 + //---//
966 + if (state.have === 0) {
967 + strm.msg = 'invalid bit length repeat';
968 + state.mode = BAD;
969 + break;
970 + }
971 + len = state.lens[state.have - 1];
972 + copy = 3 + (hold & 0x03);//BITS(2);
973 + //--- DROPBITS(2) ---//
974 + hold >>>= 2;
975 + bits -= 2;
976 + //---//
977 + }
978 + else if (here_val === 17) {
979 + //=== NEEDBITS(here.bits + 3);
980 + n = here_bits + 3;
981 + while (bits < n) {
982 + if (have === 0) { break inf_leave; }
983 + have--;
984 + hold += input[next++] << bits;
985 + bits += 8;
986 + }
987 + //===//
988 + //--- DROPBITS(here.bits) ---//
989 + hold >>>= here_bits;
990 + bits -= here_bits;
991 + //---//
992 + len = 0;
993 + copy = 3 + (hold & 0x07);//BITS(3);
994 + //--- DROPBITS(3) ---//
995 + hold >>>= 3;
996 + bits -= 3;
997 + //---//
998 + }
999 + else {
1000 + //=== NEEDBITS(here.bits + 7);
1001 + n = here_bits + 7;
1002 + while (bits < n) {
1003 + if (have === 0) { break inf_leave; }
1004 + have--;
1005 + hold += input[next++] << bits;
1006 + bits += 8;
1007 + }
1008 + //===//
1009 + //--- DROPBITS(here.bits) ---//
1010 + hold >>>= here_bits;
1011 + bits -= here_bits;
1012 + //---//
1013 + len = 0;
1014 + copy = 11 + (hold & 0x7f);//BITS(7);
1015 + //--- DROPBITS(7) ---//
1016 + hold >>>= 7;
1017 + bits -= 7;
1018 + //---//
1019 + }
1020 + if (state.have + copy > state.nlen + state.ndist) {
1021 + strm.msg = 'invalid bit length repeat';
1022 + state.mode = BAD;
1023 + break;
1024 + }
1025 + while (copy--) {
1026 + state.lens[state.have++] = len;
1027 + }
1028 + }
1029 + }
1030 +
1031 + /* handle error breaks in while */
1032 + if (state.mode === BAD) { break; }
1033 +
1034 + /* check for end-of-block code (better have one) */
1035 + if (state.lens[256] === 0) {
1036 + strm.msg = 'invalid code -- missing end-of-block';
1037 + state.mode = BAD;
1038 + break;
1039 + }
1040 +
1041 + /* build code tables -- note: do not change the lenbits or distbits
1042 + values here (9 and 6) without reading the comments in inftrees.h
1043 + concerning the ENOUGH constants, which depend on those values */
1044 + state.lenbits = 9;
1045 +
1046 + opts = { bits: state.lenbits };
1047 + ret = inflate_table(LENS, state.lens, 0, state.nlen, state.lencode, 0, state.work, opts);
1048 + // We have separate tables & no pointers. 2 commented lines below not needed.
1049 + // state.next_index = opts.table_index;
1050 + state.lenbits = opts.bits;
1051 + // state.lencode = state.next;
1052 +
1053 + if (ret) {
1054 + strm.msg = 'invalid literal/lengths set';
1055 + state.mode = BAD;
1056 + break;
1057 + }
1058 +
1059 + state.distbits = 6;
1060 + //state.distcode.copy(state.codes);
1061 + // Switch to use dynamic table
1062 + state.distcode = state.distdyn;
1063 + opts = { bits: state.distbits };
1064 + ret = inflate_table(DISTS, state.lens, state.nlen, state.ndist, state.distcode, 0, state.work, opts);
1065 + // We have separate tables & no pointers. 2 commented lines below not needed.
1066 + // state.next_index = opts.table_index;
1067 + state.distbits = opts.bits;
1068 + // state.distcode = state.next;
1069 +
1070 + if (ret) {
1071 + strm.msg = 'invalid distances set';
1072 + state.mode = BAD;
1073 + break;
1074 + }
1075 + //Tracev((stderr, 'inflate: codes ok\n'));
1076 + state.mode = LEN_;
1077 + if (flush === Z_TREES) { break inf_leave; }
1078 + /* falls through */
1079 + case LEN_:
1080 + state.mode = LEN;
1081 + /* falls through */
1082 + case LEN:
1083 + if (have >= 6 && left >= 258) {
1084 + //--- RESTORE() ---
1085 + strm.next_out = put;
1086 + strm.avail_out = left;
1087 + strm.next_in = next;
1088 + strm.avail_in = have;
1089 + state.hold = hold;
1090 + state.bits = bits;
1091 + //---
1092 + inflate_fast(strm, _out);
1093 + //--- LOAD() ---
1094 + put = strm.next_out;
1095 + output = strm.output;
1096 + left = strm.avail_out;
1097 + next = strm.next_in;
1098 + input = strm.input;
1099 + have = strm.avail_in;
1100 + hold = state.hold;
1101 + bits = state.bits;
1102 + //---
1103 +
1104 + if (state.mode === TYPE) {
1105 + state.back = -1;
1106 + }
1107 + break;
1108 + }
1109 + state.back = 0;
1110 + for (;;) {
1111 + here = state.lencode[hold & ((1 << state.lenbits) - 1)]; /*BITS(state.lenbits)*/
1112 + here_bits = here >>> 24;
1113 + here_op = (here >>> 16) & 0xff;
1114 + here_val = here & 0xffff;
1115 +
1116 + if (here_bits <= bits) { break; }
1117 + //--- PULLBYTE() ---//
1118 + if (have === 0) { break inf_leave; }
1119 + have--;
1120 + hold += input[next++] << bits;
1121 + bits += 8;
1122 + //---//
1123 + }
1124 + if (here_op && (here_op & 0xf0) === 0) {
1125 + last_bits = here_bits;
1126 + last_op = here_op;
1127 + last_val = here_val;
1128 + for (;;) {
1129 + here = state.lencode[last_val +
1130 + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
1131 + here_bits = here >>> 24;
1132 + here_op = (here >>> 16) & 0xff;
1133 + here_val = here & 0xffff;
1134 +
1135 + if ((last_bits + here_bits) <= bits) { break; }
1136 + //--- PULLBYTE() ---//
1137 + if (have === 0) { break inf_leave; }
1138 + have--;
1139 + hold += input[next++] << bits;
1140 + bits += 8;
1141 + //---//
1142 + }
1143 + //--- DROPBITS(last.bits) ---//
1144 + hold >>>= last_bits;
1145 + bits -= last_bits;
1146 + //---//
1147 + state.back += last_bits;
1148 + }
1149 + //--- DROPBITS(here.bits) ---//
1150 + hold >>>= here_bits;
1151 + bits -= here_bits;
1152 + //---//
1153 + state.back += here_bits;
1154 + state.length = here_val;
1155 + if (here_op === 0) {
1156 + //Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ?
1157 + // "inflate: literal '%c'\n" :
1158 + // "inflate: literal 0x%02x\n", here.val));
1159 + state.mode = LIT;
1160 + break;
1161 + }
1162 + if (here_op & 32) {
1163 + //Tracevv((stderr, "inflate: end of block\n"));
1164 + state.back = -1;
1165 + state.mode = TYPE;
1166 + break;
1167 + }
1168 + if (here_op & 64) {
1169 + strm.msg = 'invalid literal/length code';
1170 + state.mode = BAD;
1171 + break;
1172 + }
1173 + state.extra = here_op & 15;
1174 + state.mode = LENEXT;
1175 + /* falls through */
1176 + case LENEXT:
1177 + if (state.extra) {
1178 + //=== NEEDBITS(state.extra);
1179 + n = state.extra;
1180 + while (bits < n) {
1181 + if (have === 0) { break inf_leave; }
1182 + have--;
1183 + hold += input[next++] << bits;
1184 + bits += 8;
1185 + }
1186 + //===//
1187 + state.length += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
1188 + //--- DROPBITS(state.extra) ---//
1189 + hold >>>= state.extra;
1190 + bits -= state.extra;
1191 + //---//
1192 + state.back += state.extra;
1193 + }
1194 + //Tracevv((stderr, "inflate: length %u\n", state.length));
1195 + state.was = state.length;
1196 + state.mode = DIST;
1197 + /* falls through */
1198 + case DIST:
1199 + for (;;) {
1200 + here = state.distcode[hold & ((1 << state.distbits) - 1)];/*BITS(state.distbits)*/
1201 + here_bits = here >>> 24;
1202 + here_op = (here >>> 16) & 0xff;
1203 + here_val = here & 0xffff;
1204 +
1205 + if ((here_bits) <= bits) { break; }
1206 + //--- PULLBYTE() ---//
1207 + if (have === 0) { break inf_leave; }
1208 + have--;
1209 + hold += input[next++] << bits;
1210 + bits += 8;
1211 + //---//
1212 + }
1213 + if ((here_op & 0xf0) === 0) {
1214 + last_bits = here_bits;
1215 + last_op = here_op;
1216 + last_val = here_val;
1217 + for (;;) {
1218 + here = state.distcode[last_val +
1219 + ((hold & ((1 << (last_bits + last_op)) - 1))/*BITS(last.bits + last.op)*/ >> last_bits)];
1220 + here_bits = here >>> 24;
1221 + here_op = (here >>> 16) & 0xff;
1222 + here_val = here & 0xffff;
1223 +
1224 + if ((last_bits + here_bits) <= bits) { break; }
1225 + //--- PULLBYTE() ---//
1226 + if (have === 0) { break inf_leave; }
1227 + have--;
1228 + hold += input[next++] << bits;
1229 + bits += 8;
1230 + //---//
1231 + }
1232 + //--- DROPBITS(last.bits) ---//
1233 + hold >>>= last_bits;
1234 + bits -= last_bits;
1235 + //---//
1236 + state.back += last_bits;
1237 + }
1238 + //--- DROPBITS(here.bits) ---//
1239 + hold >>>= here_bits;
1240 + bits -= here_bits;
1241 + //---//
1242 + state.back += here_bits;
1243 + if (here_op & 64) {
1244 + strm.msg = 'invalid distance code';
1245 + state.mode = BAD;
1246 + break;
1247 + }
1248 + state.offset = here_val;
1249 + state.extra = (here_op) & 15;
1250 + state.mode = DISTEXT;
1251 + /* falls through */
1252 + case DISTEXT:
1253 + if (state.extra) {
1254 + //=== NEEDBITS(state.extra);
1255 + n = state.extra;
1256 + while (bits < n) {
1257 + if (have === 0) { break inf_leave; }
1258 + have--;
1259 + hold += input[next++] << bits;
1260 + bits += 8;
1261 + }
1262 + //===//
1263 + state.offset += hold & ((1 << state.extra) - 1)/*BITS(state.extra)*/;
1264 + //--- DROPBITS(state.extra) ---//
1265 + hold >>>= state.extra;
1266 + bits -= state.extra;
1267 + //---//
1268 + state.back += state.extra;
1269 + }
1270 +//#ifdef INFLATE_STRICT
1271 + if (state.offset > state.dmax) {
1272 + strm.msg = 'invalid distance too far back';
1273 + state.mode = BAD;
1274 + break;
1275 + }
1276 +//#endif
1277 + //Tracevv((stderr, "inflate: distance %u\n", state.offset));
1278 + state.mode = MATCH;
1279 + /* falls through */
1280 + case MATCH:
1281 + if (left === 0) { break inf_leave; }
1282 + copy = _out - left;
1283 + if (state.offset > copy) { /* copy from window */
1284 + copy = state.offset - copy;
1285 + if (copy > state.whave) {
1286 + if (state.sane) {
1287 + strm.msg = 'invalid distance too far back';
1288 + state.mode = BAD;
1289 + break;
1290 + }
1291 +// (!) This block is disabled in zlib defailts,
1292 +// don't enable it for binary compatibility
1293 +//#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR
1294 +// Trace((stderr, "inflate.c too far\n"));
1295 +// copy -= state.whave;
1296 +// if (copy > state.length) { copy = state.length; }
1297 +// if (copy > left) { copy = left; }
1298 +// left -= copy;
1299 +// state.length -= copy;
1300 +// do {
1301 +// output[put++] = 0;
1302 +// } while (--copy);
1303 +// if (state.length === 0) { state.mode = LEN; }
1304 +// break;
1305 +//#endif
1306 + }
1307 + if (copy > state.wnext) {
1308 + copy -= state.wnext;
1309 + from = state.wsize - copy;
1310 + }
1311 + else {
1312 + from = state.wnext - copy;
1313 + }
1314 + if (copy > state.length) { copy = state.length; }
1315 + from_source = state.window;
1316 + }
1317 + else { /* copy from output */
1318 + from_source = output;
1319 + from = put - state.offset;
1320 + copy = state.length;
1321 + }
1322 + if (copy > left) { copy = left; }
1323 + left -= copy;
1324 + state.length -= copy;
1325 + do {
1326 + output[put++] = from_source[from++];
1327 + } while (--copy);
1328 + if (state.length === 0) { state.mode = LEN; }
1329 + break;
1330 + case LIT:
1331 + if (left === 0) { break inf_leave; }
1332 + output[put++] = state.length;
1333 + left--;
1334 + state.mode = LEN;
1335 + break;
1336 + case CHECK:
1337 + if (state.wrap) {
1338 + //=== NEEDBITS(32);
1339 + while (bits < 32) {
1340 + if (have === 0) { break inf_leave; }
1341 + have--;
1342 + // Use '|' insdead of '+' to make sure that result is signed
1343 + hold |= input[next++] << bits;
1344 + bits += 8;
1345 + }
1346 + //===//
1347 + _out -= left;
1348 + strm.total_out += _out;
1349 + state.total += _out;
1350 + if (_out) {
1351 + strm.adler = state.check =
1352 + /*UPDATE(state.check, put - _out, _out);*/
1353 + (state.flags ? crc32(state.check, output, _out, put - _out) : adler32(state.check, output, _out, put - _out));
1354 +
1355 + }
1356 + _out = left;
1357 + // NB: crc32 stored as signed 32-bit int, zswap32 returns signed too
1358 + if ((state.flags ? hold : zswap32(hold)) !== state.check) {
1359 + strm.msg = 'incorrect data check';
1360 + state.mode = BAD;
1361 + break;
1362 + }
1363 + //=== INITBITS();
1364 + hold = 0;
1365 + bits = 0;
1366 + //===//
1367 + //Tracev((stderr, "inflate: check matches trailer\n"));
1368 + }
1369 + state.mode = LENGTH;
1370 + /* falls through */
1371 + case LENGTH:
1372 + if (state.wrap && state.flags) {
1373 + //=== NEEDBITS(32);
1374 + while (bits < 32) {
1375 + if (have === 0) { break inf_leave; }
1376 + have--;
1377 + hold += input[next++] << bits;
1378 + bits += 8;
1379 + }
1380 + //===//
1381 + if (hold !== (state.total & 0xffffffff)) {
1382 + strm.msg = 'incorrect length check';
1383 + state.mode = BAD;
1384 + break;
1385 + }
1386 + //=== INITBITS();
1387 + hold = 0;
1388 + bits = 0;
1389 + //===//
1390 + //Tracev((stderr, "inflate: length matches trailer\n"));
1391 + }
1392 + state.mode = DONE;
1393 + /* falls through */
1394 + case DONE:
1395 + ret = Z_STREAM_END;
1396 + break inf_leave;
1397 + case BAD:
1398 + ret = Z_DATA_ERROR;
1399 + break inf_leave;
1400 + case MEM:
1401 + return Z_MEM_ERROR;
1402 + case SYNC:
1403 + /* falls through */
1404 + default:
1405 + return Z_STREAM_ERROR;
1406 + }
1407 + }
1408 +
1409 + // inf_leave <- here is real place for "goto inf_leave", emulated via "break inf_leave"
1410 +
1411 + /*
1412 + Return from inflate(), updating the total counts and the check value.
1413 + If there was no progress during the inflate() call, return a buffer
1414 + error. Call updatewindow() to create and/or update the window state.
1415 + Note: a memory error from inflate() is non-recoverable.
1416 + */
1417 +
1418 + //--- RESTORE() ---
1419 + strm.next_out = put;
1420 + strm.avail_out = left;
1421 + strm.next_in = next;
1422 + strm.avail_in = have;
1423 + state.hold = hold;
1424 + state.bits = bits;
1425 + //---
1426 +
1427 + if (state.wsize || (_out !== strm.avail_out && state.mode < BAD &&
1428 + (state.mode < CHECK || flush !== Z_FINISH))) {
1429 + if (updatewindow(strm, strm.output, strm.next_out, _out - strm.avail_out)) {
1430 + state.mode = MEM;
1431 + return Z_MEM_ERROR;
1432 + }
1433 + }
1434 + _in -= strm.avail_in;
1435 + _out -= strm.avail_out;
1436 + strm.total_in += _in;
1437 + strm.total_out += _out;
1438 + state.total += _out;
1439 + if (state.wrap && _out) {
1440 + strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/
1441 + (state.flags ? crc32(state.check, output, _out, strm.next_out - _out) : adler32(state.check, output, _out, strm.next_out - _out));
1442 + }
1443 + strm.data_type = state.bits + (state.last ? 64 : 0) +
1444 + (state.mode === TYPE ? 128 : 0) +
1445 + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0);
1446 + if (((_in === 0 && _out === 0) || flush === Z_FINISH) && ret === Z_OK) {
1447 + ret = Z_BUF_ERROR;
1448 + }
1449 + return ret;
1450 +}
1451 +
1452 +function inflateEnd(strm) {
1453 +
1454 + if (!strm || !strm.state /*|| strm->zfree == (free_func)0*/) {
1455 + return Z_STREAM_ERROR;
1456 + }
1457 +
1458 + var state = strm.state;
1459 + if (state.window) {
1460 + state.window = null;
1461 + }
1462 + strm.state = null;
1463 + return Z_OK;
1464 +}
1465 +
1466 +function inflateGetHeader(strm, head) {
1467 + var state;
1468 +
1469 + /* check state */
1470 + if (!strm || !strm.state) { return Z_STREAM_ERROR; }
1471 + state = strm.state;
1472 + if ((state.wrap & 2) === 0) { return Z_STREAM_ERROR; }
1473 +
1474 + /* save header structure */
1475 + state.head = head;
1476 + head.done = false;
1477 + return Z_OK;
1478 +}
1479 +
1480 +function inflateSetDictionary(strm, dictionary) {
1481 + var dictLength = dictionary.length;
1482 +
1483 + var state;
1484 + var dictid;
1485 + var ret;
1486 +
1487 + /* check state */
1488 + if (!strm /* == Z_NULL */ || !strm.state /* == Z_NULL */) { return Z_STREAM_ERROR; }
1489 + state = strm.state;
1490 +
1491 + if (state.wrap !== 0 && state.mode !== DICT) {
1492 + return Z_STREAM_ERROR;
1493 + }
1494 +
1495 + /* check for correct dictionary identifier */
1496 + if (state.mode === DICT) {
1497 + dictid = 1; /* adler32(0, null, 0)*/
1498 + /* dictid = adler32(dictid, dictionary, dictLength); */
1499 + dictid = adler32(dictid, dictionary, dictLength, 0);
1500 + if (dictid !== state.check) {
1501 + return Z_DATA_ERROR;
1502 + }
1503 + }
1504 + /* copy dictionary to window using updatewindow(), which will amend the
1505 + existing dictionary if appropriate */
1506 + ret = updatewindow(strm, dictionary, dictLength, dictLength);
1507 + if (ret) {
1508 + state.mode = MEM;
1509 + return Z_MEM_ERROR;
1510 + }
1511 + state.havedict = 1;
1512 + // Tracev((stderr, "inflate: dictionary set\n"));
1513 + return Z_OK;
1514 +}
1515 +
1516 +export { inflateReset, inflateReset2, inflateResetKeep, inflateInit, inflateInit2, inflate, inflateEnd, inflateGetHeader, inflateSetDictionary };
1517 +export var inflateInfo = 'pako inflate (from Nodeca project)';
1518 +
1519 +/* Not implemented
1520 +exports.inflateCopy = inflateCopy;
1521 +exports.inflateGetDictionary = inflateGetDictionary;
1522 +exports.inflateMark = inflateMark;
1523 +exports.inflatePrime = inflatePrime;
1524 +exports.inflateSync = inflateSync;
1525 +exports.inflateSyncPoint = inflateSyncPoint;
1526 +exports.inflateUndermine = inflateUndermine;
1527 +*/
public/novnc/vendor/pako/lib/zlib/inftrees.js new
+322
@@ -0,0 +1,322 @@
1 +import * as utils from "../utils/common.js";
2 +
3 +var MAXBITS = 15;
4 +var ENOUGH_LENS = 852;
5 +var ENOUGH_DISTS = 592;
6 +//var ENOUGH = (ENOUGH_LENS+ENOUGH_DISTS);
7 +
8 +var CODES = 0;
9 +var LENS = 1;
10 +var DISTS = 2;
11 +
12 +var lbase = [ /* Length codes 257..285 base */
13 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
14 + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
15 +];
16 +
17 +var lext = [ /* Length codes 257..285 extra */
18 + 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
19 + 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78
20 +];
21 +
22 +var dbase = [ /* Distance codes 0..29 base */
23 + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
24 + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
25 + 8193, 12289, 16385, 24577, 0, 0
26 +];
27 +
28 +var dext = [ /* Distance codes 0..29 extra */
29 + 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22,
30 + 23, 23, 24, 24, 25, 25, 26, 26, 27, 27,
31 + 28, 28, 29, 29, 64, 64
32 +];
33 +
34 +export default function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts)
35 +{
36 + var bits = opts.bits;
37 + //here = opts.here; /* table entry for duplication */
38 +
39 + var len = 0; /* a code's length in bits */
40 + var sym = 0; /* index of code symbols */
41 + var min = 0, max = 0; /* minimum and maximum code lengths */
42 + var root = 0; /* number of index bits for root table */
43 + var curr = 0; /* number of index bits for current table */
44 + var drop = 0; /* code bits to drop for sub-table */
45 + var left = 0; /* number of prefix codes available */
46 + var used = 0; /* code entries in table used */
47 + var huff = 0; /* Huffman code */
48 + var incr; /* for incrementing code, index */
49 + var fill; /* index for replicating entries */
50 + var low; /* low bits for current root entry */
51 + var mask; /* mask for low root bits */
52 + var next; /* next available space in table */
53 + var base = null; /* base value table to use */
54 + var base_index = 0;
55 +// var shoextra; /* extra bits table to use */
56 + var end; /* use base and extra for symbol > end */
57 + var count = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* number of codes of each length */
58 + var offs = new utils.Buf16(MAXBITS + 1); //[MAXBITS+1]; /* offsets in table for each length */
59 + var extra = null;
60 + var extra_index = 0;
61 +
62 + var here_bits, here_op, here_val;
63 +
64 + /*
65 + Process a set of code lengths to create a canonical Huffman code. The
66 + code lengths are lens[0..codes-1]. Each length corresponds to the
67 + symbols 0..codes-1. The Huffman code is generated by first sorting the
68 + symbols by length from short to long, and retaining the symbol order
69 + for codes with equal lengths. Then the code starts with all zero bits
70 + for the first code of the shortest length, and the codes are integer
71 + increments for the same length, and zeros are appended as the length
72 + increases. For the deflate format, these bits are stored backwards
73 + from their more natural integer increment ordering, and so when the
74 + decoding tables are built in the large loop below, the integer codes
75 + are incremented backwards.
76 +
77 + This routine assumes, but does not check, that all of the entries in
78 + lens[] are in the range 0..MAXBITS. The caller must assure this.
79 + 1..MAXBITS is interpreted as that code length. zero means that that
80 + symbol does not occur in this code.
81 +
82 + The codes are sorted by computing a count of codes for each length,
83 + creating from that a table of starting indices for each length in the
84 + sorted table, and then entering the symbols in order in the sorted
85 + table. The sorted table is work[], with that space being provided by
86 + the caller.
87 +
88 + The length counts are used for other purposes as well, i.e. finding
89 + the minimum and maximum length codes, determining if there are any
90 + codes at all, checking for a valid set of lengths, and looking ahead
91 + at length counts to determine sub-table sizes when building the
92 + decoding tables.
93 + */
94 +
95 + /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */
96 + for (len = 0; len <= MAXBITS; len++) {
97 + count[len] = 0;
98 + }
99 + for (sym = 0; sym < codes; sym++) {
100 + count[lens[lens_index + sym]]++;
101 + }
102 +
103 + /* bound code lengths, force root to be within code lengths */
104 + root = bits;
105 + for (max = MAXBITS; max >= 1; max--) {
106 + if (count[max] !== 0) { break; }
107 + }
108 + if (root > max) {
109 + root = max;
110 + }
111 + if (max === 0) { /* no symbols to code at all */
112 + //table.op[opts.table_index] = 64; //here.op = (var char)64; /* invalid code marker */
113 + //table.bits[opts.table_index] = 1; //here.bits = (var char)1;
114 + //table.val[opts.table_index++] = 0; //here.val = (var short)0;
115 + table[table_index++] = (1 << 24) | (64 << 16) | 0;
116 +
117 +
118 + //table.op[opts.table_index] = 64;
119 + //table.bits[opts.table_index] = 1;
120 + //table.val[opts.table_index++] = 0;
121 + table[table_index++] = (1 << 24) | (64 << 16) | 0;
122 +
123 + opts.bits = 1;
124 + return 0; /* no symbols, but wait for decoding to report error */
125 + }
126 + for (min = 1; min < max; min++) {
127 + if (count[min] !== 0) { break; }
128 + }
129 + if (root < min) {
130 + root = min;
131 + }
132 +
133 + /* check for an over-subscribed or incomplete set of lengths */
134 + left = 1;
135 + for (len = 1; len <= MAXBITS; len++) {
136 + left <<= 1;
137 + left -= count[len];
138 + if (left < 0) {
139 + return -1;
140 + } /* over-subscribed */
141 + }
142 + if (left > 0 && (type === CODES || max !== 1)) {
143 + return -1; /* incomplete set */
144 + }
145 +
146 + /* generate offsets into symbol table for each length for sorting */
147 + offs[1] = 0;
148 + for (len = 1; len < MAXBITS; len++) {
149 + offs[len + 1] = offs[len] + count[len];
150 + }
151 +
152 + /* sort symbols by length, by symbol order within each length */
153 + for (sym = 0; sym < codes; sym++) {
154 + if (lens[lens_index + sym] !== 0) {
155 + work[offs[lens[lens_index + sym]]++] = sym;
156 + }
157 + }
158 +
159 + /*
160 + Create and fill in decoding tables. In this loop, the table being
161 + filled is at next and has curr index bits. The code being used is huff
162 + with length len. That code is converted to an index by dropping drop
163 + bits off of the bottom. For codes where len is less than drop + curr,
164 + those top drop + curr - len bits are incremented through all values to
165 + fill the table with replicated entries.
166 +
167 + root is the number of index bits for the root table. When len exceeds
168 + root, sub-tables are created pointed to by the root entry with an index
169 + of the low root bits of huff. This is saved in low to check for when a
170 + new sub-table should be started. drop is zero when the root table is
171 + being filled, and drop is root when sub-tables are being filled.
172 +
173 + When a new sub-table is needed, it is necessary to look ahead in the
174 + code lengths to determine what size sub-table is needed. The length
175 + counts are used for this, and so count[] is decremented as codes are
176 + entered in the tables.
177 +
178 + used keeps track of how many table entries have been allocated from the
179 + provided *table space. It is checked for LENS and DIST tables against
180 + the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in
181 + the initial root table size constants. See the comments in inftrees.h
182 + for more information.
183 +
184 + sym increments through all symbols, and the loop terminates when
185 + all codes of length max, i.e. all codes, have been processed. This
186 + routine permits incomplete codes, so another loop after this one fills
187 + in the rest of the decoding tables with invalid code markers.
188 + */
189 +
190 + /* set up for code type */
191 + // poor man optimization - use if-else instead of switch,
192 + // to avoid deopts in old v8
193 + if (type === CODES) {
194 + base = extra = work; /* dummy value--not used */
195 + end = 19;
196 +
197 + } else if (type === LENS) {
198 + base = lbase;
199 + base_index -= 257;
200 + extra = lext;
201 + extra_index -= 257;
202 + end = 256;
203 +
204 + } else { /* DISTS */
205 + base = dbase;
206 + extra = dext;
207 + end = -1;
208 + }
209 +
210 + /* initialize opts for loop */
211 + huff = 0; /* starting code */
212 + sym = 0; /* starting code symbol */
213 + len = min; /* starting code length */
214 + next = table_index; /* current table to fill in */
215 + curr = root; /* current table index bits */
216 + drop = 0; /* current bits to drop from code for index */
217 + low = -1; /* trigger new sub-table when len > root */
218 + used = 1 << root; /* use root table entries */
219 + mask = used - 1; /* mask for comparing low */
220 +
221 + /* check available table space */
222 + if ((type === LENS && used > ENOUGH_LENS) ||
223 + (type === DISTS && used > ENOUGH_DISTS)) {
224 + return 1;
225 + }
226 +
227 + /* process all codes and make table entries */
228 + for (;;) {
229 + /* create table entry */
230 + here_bits = len - drop;
231 + if (work[sym] < end) {
232 + here_op = 0;
233 + here_val = work[sym];
234 + }
235 + else if (work[sym] > end) {
236 + here_op = extra[extra_index + work[sym]];
237 + here_val = base[base_index + work[sym]];
238 + }
239 + else {
240 + here_op = 32 + 64; /* end of block */
241 + here_val = 0;
242 + }
243 +
244 + /* replicate for those indices with low len bits equal to huff */
245 + incr = 1 << (len - drop);
246 + fill = 1 << curr;
247 + min = fill; /* save offset to next table */
248 + do {
249 + fill -= incr;
250 + table[next + (huff >> drop) + fill] = (here_bits << 24) | (here_op << 16) | here_val |0;
251 + } while (fill !== 0);
252 +
253 + /* backwards increment the len-bit code huff */
254 + incr = 1 << (len - 1);
255 + while (huff & incr) {
256 + incr >>= 1;
257 + }
258 + if (incr !== 0) {
259 + huff &= incr - 1;
260 + huff += incr;
261 + } else {
262 + huff = 0;
263 + }
264 +
265 + /* go to next symbol, update count, len */
266 + sym++;
267 + if (--count[len] === 0) {
268 + if (len === max) { break; }
269 + len = lens[lens_index + work[sym]];
270 + }
271 +
272 + /* create new sub-table if needed */
273 + if (len > root && (huff & mask) !== low) {
274 + /* if first time, transition to sub-tables */
275 + if (drop === 0) {
276 + drop = root;
277 + }
278 +
279 + /* increment past last table */
280 + next += min; /* here min is 1 << curr */
281 +
282 + /* determine length of next table */
283 + curr = len - drop;
284 + left = 1 << curr;
285 + while (curr + drop < max) {
286 + left -= count[curr + drop];
287 + if (left <= 0) { break; }
288 + curr++;
289 + left <<= 1;
290 + }
291 +
292 + /* check for enough space */
293 + used += 1 << curr;
294 + if ((type === LENS && used > ENOUGH_LENS) ||
295 + (type === DISTS && used > ENOUGH_DISTS)) {
296 + return 1;
297 + }
298 +
299 + /* point entry in root table to sub-table */
300 + low = huff & mask;
301 + /*table.op[low] = curr;
302 + table.bits[low] = root;
303 + table.val[low] = next - opts.table_index;*/
304 + table[low] = (root << 24) | (curr << 16) | (next - table_index) |0;
305 + }
306 + }
307 +
308 + /* fill in remaining table entry if code is incomplete (guaranteed to have
309 + at most one remaining entry, since if the code is incomplete, the
310 + maximum code length that was allowed to get this far is one bit) */
311 + if (huff !== 0) {
312 + //table.op[next + huff] = 64; /* invalid code marker */
313 + //table.bits[next + huff] = len - drop;
314 + //table.val[next + huff] = 0;
315 + table[next + huff] = ((len - drop) << 24) | (64 << 16) |0;
316 + }
317 +
318 + /* set return parameters */
319 + //opts.table_index += used;
320 + opts.bits = root;
321 + return 0;
322 +};
public/novnc/vendor/pako/lib/zlib/messages.js new
+11
@@ -0,0 +1,11 @@
1 +export default {
2 + 2: 'need dictionary', /* Z_NEED_DICT 2 */
3 + 1: 'stream end', /* Z_STREAM_END 1 */
4 + 0: '', /* Z_OK 0 */
5 + '-1': 'file error', /* Z_ERRNO (-1) */
6 + '-2': 'stream error', /* Z_STREAM_ERROR (-2) */
7 + '-3': 'data error', /* Z_DATA_ERROR (-3) */
8 + '-4': 'insufficient memory', /* Z_MEM_ERROR (-4) */
9 + '-5': 'buffer error', /* Z_BUF_ERROR (-5) */
10 + '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */
11 +};
public/novnc/vendor/pako/lib/zlib/trees.js new
+1195
@@ -0,0 +1,1195 @@
1 +import * as utils from "../utils/common.js";
2 +
3 +/* Public constants ==========================================================*/
4 +/* ===========================================================================*/
5 +
6 +
7 +//var Z_FILTERED = 1;
8 +//var Z_HUFFMAN_ONLY = 2;
9 +//var Z_RLE = 3;
10 +var Z_FIXED = 4;
11 +//var Z_DEFAULT_STRATEGY = 0;
12 +
13 +/* Possible values of the data_type field (though see inflate()) */
14 +var Z_BINARY = 0;
15 +var Z_TEXT = 1;
16 +//var Z_ASCII = 1; // = Z_TEXT
17 +var Z_UNKNOWN = 2;
18 +
19 +/*============================================================================*/
20 +
21 +
22 +function zero(buf) { var len = buf.length; while (--len >= 0) { buf[len] = 0; } }
23 +
24 +// From zutil.h
25 +
26 +var STORED_BLOCK = 0;
27 +var STATIC_TREES = 1;
28 +var DYN_TREES = 2;
29 +/* The three kinds of block type */
30 +
31 +var MIN_MATCH = 3;
32 +var MAX_MATCH = 258;
33 +/* The minimum and maximum match lengths */
34 +
35 +// From deflate.h
36 +/* ===========================================================================
37 + * Internal compression state.
38 + */
39 +
40 +var LENGTH_CODES = 29;
41 +/* number of length codes, not counting the special END_BLOCK code */
42 +
43 +var LITERALS = 256;
44 +/* number of literal bytes 0..255 */
45 +
46 +var L_CODES = LITERALS + 1 + LENGTH_CODES;
47 +/* number of Literal or Length codes, including the END_BLOCK code */
48 +
49 +var D_CODES = 30;
50 +/* number of distance codes */
51 +
52 +var BL_CODES = 19;
53 +/* number of codes used to transfer the bit lengths */
54 +
55 +var HEAP_SIZE = 2 * L_CODES + 1;
56 +/* maximum heap size */
57 +
58 +var MAX_BITS = 15;
59 +/* All codes must not exceed MAX_BITS bits */
60 +
61 +var Buf_size = 16;
62 +/* size of bit buffer in bi_buf */
63 +
64 +
65 +/* ===========================================================================
66 + * Constants
67 + */
68 +
69 +var MAX_BL_BITS = 7;
70 +/* Bit length codes must not exceed MAX_BL_BITS bits */
71 +
72 +var END_BLOCK = 256;
73 +/* end of block literal code */
74 +
75 +var REP_3_6 = 16;
76 +/* repeat previous bit length 3-6 times (2 bits of repeat count) */
77 +
78 +var REPZ_3_10 = 17;
79 +/* repeat a zero length 3-10 times (3 bits of repeat count) */
80 +
81 +var REPZ_11_138 = 18;
82 +/* repeat a zero length 11-138 times (7 bits of repeat count) */
83 +
84 +/* eslint-disable comma-spacing,array-bracket-spacing */
85 +var extra_lbits = /* extra bits for each length code */
86 + [0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];
87 +
88 +var extra_dbits = /* extra bits for each distance code */
89 + [0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];
90 +
91 +var extra_blbits = /* extra bits for each bit length code */
92 + [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];
93 +
94 +var bl_order =
95 + [16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
96 +/* eslint-enable comma-spacing,array-bracket-spacing */
97 +
98 +/* The lengths of the bit length codes are sent in order of decreasing
99 + * probability, to avoid transmitting the lengths for unused bit length codes.
100 + */
101 +
102 +/* ===========================================================================
103 + * Local data. These are initialized only once.
104 + */
105 +
106 +// We pre-fill arrays with 0 to avoid uninitialized gaps
107 +
108 +var DIST_CODE_LEN = 512; /* see definition of array dist_code below */
109 +
110 +// !!!! Use flat array insdead of structure, Freq = i*2, Len = i*2+1
111 +var static_ltree = new Array((L_CODES + 2) * 2);
112 +zero(static_ltree);
113 +/* The static literal tree. Since the bit lengths are imposed, there is no
114 + * need for the L_CODES extra codes used during heap construction. However
115 + * The codes 286 and 287 are needed to build a canonical tree (see _tr_init
116 + * below).
117 + */
118 +
119 +var static_dtree = new Array(D_CODES * 2);
120 +zero(static_dtree);
121 +/* The static distance tree. (Actually a trivial tree since all codes use
122 + * 5 bits.)
123 + */
124 +
125 +var _dist_code = new Array(DIST_CODE_LEN);
126 +zero(_dist_code);
127 +/* Distance codes. The first 256 values correspond to the distances
128 + * 3 .. 258, the last 256 values correspond to the top 8 bits of
129 + * the 15 bit distances.
130 + */
131 +
132 +var _length_code = new Array(MAX_MATCH - MIN_MATCH + 1);
133 +zero(_length_code);
134 +/* length code for each normalized match length (0 == MIN_MATCH) */
135 +
136 +var base_length = new Array(LENGTH_CODES);
137 +zero(base_length);
138 +/* First normalized length for each code (0 = MIN_MATCH) */
139 +
140 +var base_dist = new Array(D_CODES);
141 +zero(base_dist);
142 +/* First normalized distance for each code (0 = distance of 1) */
143 +
144 +
145 +function StaticTreeDesc(static_tree, extra_bits, extra_base, elems, max_length) {
146 +
147 + this.static_tree = static_tree; /* static tree or NULL */
148 + this.extra_bits = extra_bits; /* extra bits for each code or NULL */
149 + this.extra_base = extra_base; /* base index for extra_bits */
150 + this.elems = elems; /* max number of elements in the tree */
151 + this.max_length = max_length; /* max bit length for the codes */
152 +
153 + // show if `static_tree` has data or dummy - needed for monomorphic objects
154 + this.has_stree = static_tree && static_tree.length;
155 +}
156 +
157 +
158 +var static_l_desc;
159 +var static_d_desc;
160 +var static_bl_desc;
161 +
162 +
163 +function TreeDesc(dyn_tree, stat_desc) {
164 + this.dyn_tree = dyn_tree; /* the dynamic tree */
165 + this.max_code = 0; /* largest code with non zero frequency */
166 + this.stat_desc = stat_desc; /* the corresponding static tree */
167 +}
168 +
169 +
170 +
171 +function d_code(dist) {
172 + return dist < 256 ? _dist_code[dist] : _dist_code[256 + (dist >>> 7)];
173 +}
174 +
175 +
176 +/* ===========================================================================
177 + * Output a short LSB first on the stream.
178 + * IN assertion: there is enough room in pendingBuf.
179 + */
180 +function put_short(s, w) {
181 +// put_byte(s, (uch)((w) & 0xff));
182 +// put_byte(s, (uch)((ush)(w) >> 8));
183 + s.pending_buf[s.pending++] = (w) & 0xff;
184 + s.pending_buf[s.pending++] = (w >>> 8) & 0xff;
185 +}
186 +
187 +
188 +/* ===========================================================================
189 + * Send a value on a given number of bits.
190 + * IN assertion: length <= 16 and value fits in length bits.
191 + */
192 +function send_bits(s, value, length) {
193 + if (s.bi_valid > (Buf_size - length)) {
194 + s.bi_buf |= (value << s.bi_valid) & 0xffff;
195 + put_short(s, s.bi_buf);
196 + s.bi_buf = value >> (Buf_size - s.bi_valid);
197 + s.bi_valid += length - Buf_size;
198 + } else {
199 + s.bi_buf |= (value << s.bi_valid) & 0xffff;
200 + s.bi_valid += length;
201 + }
202 +}
203 +
204 +
205 +function send_code(s, c, tree) {
206 + send_bits(s, tree[c * 2]/*.Code*/, tree[c * 2 + 1]/*.Len*/);
207 +}
208 +
209 +
210 +/* ===========================================================================
211 + * Reverse the first len bits of a code, using straightforward code (a faster
212 + * method would use a table)
213 + * IN assertion: 1 <= len <= 15
214 + */
215 +function bi_reverse(code, len) {
216 + var res = 0;
217 + do {
218 + res |= code & 1;
219 + code >>>= 1;
220 + res <<= 1;
221 + } while (--len > 0);
222 + return res >>> 1;
223 +}
224 +
225 +
226 +/* ===========================================================================
227 + * Flush the bit buffer, keeping at most 7 bits in it.
228 + */
229 +function bi_flush(s) {
230 + if (s.bi_valid === 16) {
231 + put_short(s, s.bi_buf);
232 + s.bi_buf = 0;
233 + s.bi_valid = 0;
234 +
235 + } else if (s.bi_valid >= 8) {
236 + s.pending_buf[s.pending++] = s.bi_buf & 0xff;
237 + s.bi_buf >>= 8;
238 + s.bi_valid -= 8;
239 + }
240 +}
241 +
242 +
243 +/* ===========================================================================
244 + * Compute the optimal bit lengths for a tree and update the total bit length
245 + * for the current block.
246 + * IN assertion: the fields freq and dad are set, heap[heap_max] and
247 + * above are the tree nodes sorted by increasing frequency.
248 + * OUT assertions: the field len is set to the optimal bit length, the
249 + * array bl_count contains the frequencies for each bit length.
250 + * The length opt_len is updated; static_len is also updated if stree is
251 + * not null.
252 + */
253 +function gen_bitlen(s, desc)
254 +// deflate_state *s;
255 +// tree_desc *desc; /* the tree descriptor */
256 +{
257 + var tree = desc.dyn_tree;
258 + var max_code = desc.max_code;
259 + var stree = desc.stat_desc.static_tree;
260 + var has_stree = desc.stat_desc.has_stree;
261 + var extra = desc.stat_desc.extra_bits;
262 + var base = desc.stat_desc.extra_base;
263 + var max_length = desc.stat_desc.max_length;
264 + var h; /* heap index */
265 + var n, m; /* iterate over the tree elements */
266 + var bits; /* bit length */
267 + var xbits; /* extra bits */
268 + var f; /* frequency */
269 + var overflow = 0; /* number of elements with bit length too large */
270 +
271 + for (bits = 0; bits <= MAX_BITS; bits++) {
272 + s.bl_count[bits] = 0;
273 + }
274 +
275 + /* In a first pass, compute the optimal bit lengths (which may
276 + * overflow in the case of the bit length tree).
277 + */
278 + tree[s.heap[s.heap_max] * 2 + 1]/*.Len*/ = 0; /* root of the heap */
279 +
280 + for (h = s.heap_max + 1; h < HEAP_SIZE; h++) {
281 + n = s.heap[h];
282 + bits = tree[tree[n * 2 + 1]/*.Dad*/ * 2 + 1]/*.Len*/ + 1;
283 + if (bits > max_length) {
284 + bits = max_length;
285 + overflow++;
286 + }
287 + tree[n * 2 + 1]/*.Len*/ = bits;
288 + /* We overwrite tree[n].Dad which is no longer needed */
289 +
290 + if (n > max_code) { continue; } /* not a leaf node */
291 +
292 + s.bl_count[bits]++;
293 + xbits = 0;
294 + if (n >= base) {
295 + xbits = extra[n - base];
296 + }
297 + f = tree[n * 2]/*.Freq*/;
298 + s.opt_len += f * (bits + xbits);
299 + if (has_stree) {
300 + s.static_len += f * (stree[n * 2 + 1]/*.Len*/ + xbits);
301 + }
302 + }
303 + if (overflow === 0) { return; }
304 +
305 + // Trace((stderr,"\nbit length overflow\n"));
306 + /* This happens for example on obj2 and pic of the Calgary corpus */
307 +
308 + /* Find the first bit length which could increase: */
309 + do {
310 + bits = max_length - 1;
311 + while (s.bl_count[bits] === 0) { bits--; }
312 + s.bl_count[bits]--; /* move one leaf down the tree */
313 + s.bl_count[bits + 1] += 2; /* move one overflow item as its brother */
314 + s.bl_count[max_length]--;
315 + /* The brother of the overflow item also moves one step up,
316 + * but this does not affect bl_count[max_length]
317 + */
318 + overflow -= 2;
319 + } while (overflow > 0);
320 +
321 + /* Now recompute all bit lengths, scanning in increasing frequency.
322 + * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all
323 + * lengths instead of fixing only the wrong ones. This idea is taken
324 + * from 'ar' written by Haruhiko Okumura.)
325 + */
326 + for (bits = max_length; bits !== 0; bits--) {
327 + n = s.bl_count[bits];
328 + while (n !== 0) {
329 + m = s.heap[--h];
330 + if (m > max_code) { continue; }
331 + if (tree[m * 2 + 1]/*.Len*/ !== bits) {
332 + // Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits));
333 + s.opt_len += (bits - tree[m * 2 + 1]/*.Len*/) * tree[m * 2]/*.Freq*/;
334 + tree[m * 2 + 1]/*.Len*/ = bits;
335 + }
336 + n--;
337 + }
338 + }
339 +}
340 +
341 +
342 +/* ===========================================================================
343 + * Generate the codes for a given tree and bit counts (which need not be
344 + * optimal).
345 + * IN assertion: the array bl_count contains the bit length statistics for
346 + * the given tree and the field len is set for all tree elements.
347 + * OUT assertion: the field code is set for all tree elements of non
348 + * zero code length.
349 + */
350 +function gen_codes(tree, max_code, bl_count)
351 +// ct_data *tree; /* the tree to decorate */
352 +// int max_code; /* largest code with non zero frequency */
353 +// ushf *bl_count; /* number of codes at each bit length */
354 +{
355 + var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */
356 + var code = 0; /* running code value */
357 + var bits; /* bit index */
358 + var n; /* code index */
359 +
360 + /* The distribution counts are first used to generate the code values
361 + * without bit reversal.
362 + */
363 + for (bits = 1; bits <= MAX_BITS; bits++) {
364 + next_code[bits] = code = (code + bl_count[bits - 1]) << 1;
365 + }
366 + /* Check that the bit counts in bl_count are consistent. The last code
367 + * must be all ones.
368 + */
369 + //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
370 + // "inconsistent bit counts");
371 + //Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
372 +
373 + for (n = 0; n <= max_code; n++) {
374 + var len = tree[n * 2 + 1]/*.Len*/;
375 + if (len === 0) { continue; }
376 + /* Now reverse the bits */
377 + tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);
378 +
379 + //Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
380 + // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
381 + }
382 +}
383 +
384 +
385 +/* ===========================================================================
386 + * Initialize the various 'constant' tables.
387 + */
388 +function tr_static_init() {
389 + var n; /* iterates over tree elements */
390 + var bits; /* bit counter */
391 + var length; /* length value */
392 + var code; /* code value */
393 + var dist; /* distance index */
394 + var bl_count = new Array(MAX_BITS + 1);
395 + /* number of codes at each bit length for an optimal tree */
396 +
397 + // do check in _tr_init()
398 + //if (static_init_done) return;
399 +
400 + /* For some embedded targets, global variables are not initialized: */
401 +/*#ifdef NO_INIT_GLOBAL_POINTERS
402 + static_l_desc.static_tree = static_ltree;
403 + static_l_desc.extra_bits = extra_lbits;
404 + static_d_desc.static_tree = static_dtree;
405 + static_d_desc.extra_bits = extra_dbits;
406 + static_bl_desc.extra_bits = extra_blbits;
407 +#endif*/
408 +
409 + /* Initialize the mapping length (0..255) -> length code (0..28) */
410 + length = 0;
411 + for (code = 0; code < LENGTH_CODES - 1; code++) {
412 + base_length[code] = length;
413 + for (n = 0; n < (1 << extra_lbits[code]); n++) {
414 + _length_code[length++] = code;
415 + }
416 + }
417 + //Assert (length == 256, "tr_static_init: length != 256");
418 + /* Note that the length 255 (match length 258) can be represented
419 + * in two different ways: code 284 + 5 bits or code 285, so we
420 + * overwrite length_code[255] to use the best encoding:
421 + */
422 + _length_code[length - 1] = code;
423 +
424 + /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
425 + dist = 0;
426 + for (code = 0; code < 16; code++) {
427 + base_dist[code] = dist;
428 + for (n = 0; n < (1 << extra_dbits[code]); n++) {
429 + _dist_code[dist++] = code;
430 + }
431 + }
432 + //Assert (dist == 256, "tr_static_init: dist != 256");
433 + dist >>= 7; /* from now on, all distances are divided by 128 */
434 + for (; code < D_CODES; code++) {
435 + base_dist[code] = dist << 7;
436 + for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
437 + _dist_code[256 + dist++] = code;
438 + }
439 + }
440 + //Assert (dist == 256, "tr_static_init: 256+dist != 512");
441 +
442 + /* Construct the codes of the static literal tree */
443 + for (bits = 0; bits <= MAX_BITS; bits++) {
444 + bl_count[bits] = 0;
445 + }
446 +
447 + n = 0;
448 + while (n <= 143) {
449 + static_ltree[n * 2 + 1]/*.Len*/ = 8;
450 + n++;
451 + bl_count[8]++;
452 + }
453 + while (n <= 255) {
454 + static_ltree[n * 2 + 1]/*.Len*/ = 9;
455 + n++;
456 + bl_count[9]++;
457 + }
458 + while (n <= 279) {
459 + static_ltree[n * 2 + 1]/*.Len*/ = 7;
460 + n++;
461 + bl_count[7]++;
462 + }
463 + while (n <= 287) {
464 + static_ltree[n * 2 + 1]/*.Len*/ = 8;
465 + n++;
466 + bl_count[8]++;
467 + }
468 + /* Codes 286 and 287 do not exist, but we must include them in the
469 + * tree construction to get a canonical Huffman tree (longest code
470 + * all ones)
471 + */
472 + gen_codes(static_ltree, L_CODES + 1, bl_count);
473 +
474 + /* The static distance tree is trivial: */
475 + for (n = 0; n < D_CODES; n++) {
476 + static_dtree[n * 2 + 1]/*.Len*/ = 5;
477 + static_dtree[n * 2]/*.Code*/ = bi_reverse(n, 5);
478 + }
479 +
480 + // Now data ready and we can init static trees
481 + static_l_desc = new StaticTreeDesc(static_ltree, extra_lbits, LITERALS + 1, L_CODES, MAX_BITS);
482 + static_d_desc = new StaticTreeDesc(static_dtree, extra_dbits, 0, D_CODES, MAX_BITS);
483 + static_bl_desc = new StaticTreeDesc(new Array(0), extra_blbits, 0, BL_CODES, MAX_BL_BITS);
484 +
485 + //static_init_done = true;
486 +}
487 +
488 +
489 +/* ===========================================================================
490 + * Initialize a new block.
491 + */
492 +function init_block(s) {
493 + var n; /* iterates over tree elements */
494 +
495 + /* Initialize the trees. */
496 + for (n = 0; n < L_CODES; n++) { s.dyn_ltree[n * 2]/*.Freq*/ = 0; }
497 + for (n = 0; n < D_CODES; n++) { s.dyn_dtree[n * 2]/*.Freq*/ = 0; }
498 + for (n = 0; n < BL_CODES; n++) { s.bl_tree[n * 2]/*.Freq*/ = 0; }
499 +
500 + s.dyn_ltree[END_BLOCK * 2]/*.Freq*/ = 1;
501 + s.opt_len = s.static_len = 0;
502 + s.last_lit = s.matches = 0;
503 +}
504 +
505 +
506 +/* ===========================================================================
507 + * Flush the bit buffer and align the output on a byte boundary
508 + */
509 +function bi_windup(s)
510 +{
511 + if (s.bi_valid > 8) {
512 + put_short(s, s.bi_buf);
513 + } else if (s.bi_valid > 0) {
514 + //put_byte(s, (Byte)s->bi_buf);
515 + s.pending_buf[s.pending++] = s.bi_buf;
516 + }
517 + s.bi_buf = 0;
518 + s.bi_valid = 0;
519 +}
520 +
521 +/* ===========================================================================
522 + * Copy a stored block, storing first the length and its
523 + * one's complement if requested.
524 + */
525 +function copy_block(s, buf, len, header)
526 +//DeflateState *s;
527 +//charf *buf; /* the input data */
528 +//unsigned len; /* its length */
529 +//int header; /* true if block header must be written */
530 +{
531 + bi_windup(s); /* align on byte boundary */
532 +
533 + if (header) {
534 + put_short(s, len);
535 + put_short(s, ~len);
536 + }
537 +// while (len--) {
538 +// put_byte(s, *buf++);
539 +// }
540 + utils.arraySet(s.pending_buf, s.window, buf, len, s.pending);
541 + s.pending += len;
542 +}
543 +
544 +/* ===========================================================================
545 + * Compares to subtrees, using the tree depth as tie breaker when
546 + * the subtrees have equal frequency. This minimizes the worst case length.
547 + */
548 +function smaller(tree, n, m, depth) {
549 + var _n2 = n * 2;
550 + var _m2 = m * 2;
551 + return (tree[_n2]/*.Freq*/ < tree[_m2]/*.Freq*/ ||
552 + (tree[_n2]/*.Freq*/ === tree[_m2]/*.Freq*/ && depth[n] <= depth[m]));
553 +}
554 +
555 +/* ===========================================================================
556 + * Restore the heap property by moving down the tree starting at node k,
557 + * exchanging a node with the smallest of its two sons if necessary, stopping
558 + * when the heap property is re-established (each father smaller than its
559 + * two sons).
560 + */
561 +function pqdownheap(s, tree, k)
562 +// deflate_state *s;
563 +// ct_data *tree; /* the tree to restore */
564 +// int k; /* node to move down */
565 +{
566 + var v = s.heap[k];
567 + var j = k << 1; /* left son of k */
568 + while (j <= s.heap_len) {
569 + /* Set j to the smallest of the two sons: */
570 + if (j < s.heap_len &&
571 + smaller(tree, s.heap[j + 1], s.heap[j], s.depth)) {
572 + j++;
573 + }
574 + /* Exit if v is smaller than both sons */
575 + if (smaller(tree, v, s.heap[j], s.depth)) { break; }
576 +
577 + /* Exchange v with the smallest son */
578 + s.heap[k] = s.heap[j];
579 + k = j;
580 +
581 + /* And continue down the tree, setting j to the left son of k */
582 + j <<= 1;
583 + }
584 + s.heap[k] = v;
585 +}
586 +
587 +
588 +// inlined manually
589 +// var SMALLEST = 1;
590 +
591 +/* ===========================================================================
592 + * Send the block data compressed using the given Huffman trees
593 + */
594 +function compress_block(s, ltree, dtree)
595 +// deflate_state *s;
596 +// const ct_data *ltree; /* literal tree */
597 +// const ct_data *dtree; /* distance tree */
598 +{
599 + var dist; /* distance of matched string */
600 + var lc; /* match length or unmatched char (if dist == 0) */
601 + var lx = 0; /* running index in l_buf */
602 + var code; /* the code to send */
603 + var extra; /* number of extra bits to send */
604 +
605 + if (s.last_lit !== 0) {
606 + do {
607 + dist = (s.pending_buf[s.d_buf + lx * 2] << 8) | (s.pending_buf[s.d_buf + lx * 2 + 1]);
608 + lc = s.pending_buf[s.l_buf + lx];
609 + lx++;
610 +
611 + if (dist === 0) {
612 + send_code(s, lc, ltree); /* send a literal byte */
613 + //Tracecv(isgraph(lc), (stderr," '%c' ", lc));
614 + } else {
615 + /* Here, lc is the match length - MIN_MATCH */
616 + code = _length_code[lc];
617 + send_code(s, code + LITERALS + 1, ltree); /* send the length code */
618 + extra = extra_lbits[code];
619 + if (extra !== 0) {
620 + lc -= base_length[code];
621 + send_bits(s, lc, extra); /* send the extra length bits */
622 + }
623 + dist--; /* dist is now the match distance - 1 */
624 + code = d_code(dist);
625 + //Assert (code < D_CODES, "bad d_code");
626 +
627 + send_code(s, code, dtree); /* send the distance code */
628 + extra = extra_dbits[code];
629 + if (extra !== 0) {
630 + dist -= base_dist[code];
631 + send_bits(s, dist, extra); /* send the extra distance bits */
632 + }
633 + } /* literal or match pair ? */
634 +
635 + /* Check that the overlay between pending_buf and d_buf+l_buf is ok: */
636 + //Assert((uInt)(s->pending) < s->lit_bufsize + 2*lx,
637 + // "pendingBuf overflow");
638 +
639 + } while (lx < s.last_lit);
640 + }
641 +
642 + send_code(s, END_BLOCK, ltree);
643 +}
644 +
645 +
646 +/* ===========================================================================
647 + * Construct one Huffman tree and assigns the code bit strings and lengths.
648 + * Update the total bit length for the current block.
649 + * IN assertion: the field freq is set for all tree elements.
650 + * OUT assertions: the fields len and code are set to the optimal bit length
651 + * and corresponding code. The length opt_len is updated; static_len is
652 + * also updated if stree is not null. The field max_code is set.
653 + */
654 +function build_tree(s, desc)
655 +// deflate_state *s;
656 +// tree_desc *desc; /* the tree descriptor */
657 +{
658 + var tree = desc.dyn_tree;
659 + var stree = desc.stat_desc.static_tree;
660 + var has_stree = desc.stat_desc.has_stree;
661 + var elems = desc.stat_desc.elems;
662 + var n, m; /* iterate over heap elements */
663 + var max_code = -1; /* largest code with non zero frequency */
664 + var node; /* new node being created */
665 +
666 + /* Construct the initial heap, with least frequent element in
667 + * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
668 + * heap[0] is not used.
669 + */
670 + s.heap_len = 0;
671 + s.heap_max = HEAP_SIZE;
672 +
673 + for (n = 0; n < elems; n++) {
674 + if (tree[n * 2]/*.Freq*/ !== 0) {
675 + s.heap[++s.heap_len] = max_code = n;
676 + s.depth[n] = 0;
677 +
678 + } else {
679 + tree[n * 2 + 1]/*.Len*/ = 0;
680 + }
681 + }
682 +
683 + /* The pkzip format requires that at least one distance code exists,
684 + * and that at least one bit should be sent even if there is only one
685 + * possible code. So to avoid special checks later on we force at least
686 + * two codes of non zero frequency.
687 + */
688 + while (s.heap_len < 2) {
689 + node = s.heap[++s.heap_len] = (max_code < 2 ? ++max_code : 0);
690 + tree[node * 2]/*.Freq*/ = 1;
691 + s.depth[node] = 0;
692 + s.opt_len--;
693 +
694 + if (has_stree) {
695 + s.static_len -= stree[node * 2 + 1]/*.Len*/;
696 + }
697 + /* node is 0 or 1 so it does not have extra bits */
698 + }
699 + desc.max_code = max_code;
700 +
701 + /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
702 + * establish sub-heaps of increasing lengths:
703 + */
704 + for (n = (s.heap_len >> 1/*int /2*/); n >= 1; n--) { pqdownheap(s, tree, n); }
705 +
706 + /* Construct the Huffman tree by repeatedly combining the least two
707 + * frequent nodes.
708 + */
709 + node = elems; /* next internal node of the tree */
710 + do {
711 + //pqremove(s, tree, n); /* n = node of least frequency */
712 + /*** pqremove ***/
713 + n = s.heap[1/*SMALLEST*/];
714 + s.heap[1/*SMALLEST*/] = s.heap[s.heap_len--];
715 + pqdownheap(s, tree, 1/*SMALLEST*/);
716 + /***/
717 +
718 + m = s.heap[1/*SMALLEST*/]; /* m = node of next least frequency */
719 +
720 + s.heap[--s.heap_max] = n; /* keep the nodes sorted by frequency */
721 + s.heap[--s.heap_max] = m;
722 +
723 + /* Create a new node father of n and m */
724 + tree[node * 2]/*.Freq*/ = tree[n * 2]/*.Freq*/ + tree[m * 2]/*.Freq*/;
725 + s.depth[node] = (s.depth[n] >= s.depth[m] ? s.depth[n] : s.depth[m]) + 1;
726 + tree[n * 2 + 1]/*.Dad*/ = tree[m * 2 + 1]/*.Dad*/ = node;
727 +
728 + /* and insert the new node in the heap */
729 + s.heap[1/*SMALLEST*/] = node++;
730 + pqdownheap(s, tree, 1/*SMALLEST*/);
731 +
732 + } while (s.heap_len >= 2);
733 +
734 + s.heap[--s.heap_max] = s.heap[1/*SMALLEST*/];
735 +
736 + /* At this point, the fields freq and dad are set. We can now
737 + * generate the bit lengths.
738 + */
739 + gen_bitlen(s, desc);
740 +
741 + /* The field len is now set, we can generate the bit codes */
742 + gen_codes(tree, max_code, s.bl_count);
743 +}
744 +
745 +
746 +/* ===========================================================================
747 + * Scan a literal or distance tree to determine the frequencies of the codes
748 + * in the bit length tree.
749 + */
750 +function scan_tree(s, tree, max_code)
751 +// deflate_state *s;
752 +// ct_data *tree; /* the tree to be scanned */
753 +// int max_code; /* and its largest code of non zero frequency */
754 +{
755 + var n; /* iterates over all tree elements */
756 + var prevlen = -1; /* last emitted length */
757 + var curlen; /* length of current code */
758 +
759 + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
760 +
761 + var count = 0; /* repeat count of the current code */
762 + var max_count = 7; /* max repeat count */
763 + var min_count = 4; /* min repeat count */
764 +
765 + if (nextlen === 0) {
766 + max_count = 138;
767 + min_count = 3;
768 + }
769 + tree[(max_code + 1) * 2 + 1]/*.Len*/ = 0xffff; /* guard */
770 +
771 + for (n = 0; n <= max_code; n++) {
772 + curlen = nextlen;
773 + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
774 +
775 + if (++count < max_count && curlen === nextlen) {
776 + continue;
777 +
778 + } else if (count < min_count) {
779 + s.bl_tree[curlen * 2]/*.Freq*/ += count;
780 +
781 + } else if (curlen !== 0) {
782 +
783 + if (curlen !== prevlen) { s.bl_tree[curlen * 2]/*.Freq*/++; }
784 + s.bl_tree[REP_3_6 * 2]/*.Freq*/++;
785 +
786 + } else if (count <= 10) {
787 + s.bl_tree[REPZ_3_10 * 2]/*.Freq*/++;
788 +
789 + } else {
790 + s.bl_tree[REPZ_11_138 * 2]/*.Freq*/++;
791 + }
792 +
793 + count = 0;
794 + prevlen = curlen;
795 +
796 + if (nextlen === 0) {
797 + max_count = 138;
798 + min_count = 3;
799 +
800 + } else if (curlen === nextlen) {
801 + max_count = 6;
802 + min_count = 3;
803 +
804 + } else {
805 + max_count = 7;
806 + min_count = 4;
807 + }
808 + }
809 +}
810 +
811 +
812 +/* ===========================================================================
813 + * Send a literal or distance tree in compressed form, using the codes in
814 + * bl_tree.
815 + */
816 +function send_tree(s, tree, max_code)
817 +// deflate_state *s;
818 +// ct_data *tree; /* the tree to be scanned */
819 +// int max_code; /* and its largest code of non zero frequency */
820 +{
821 + var n; /* iterates over all tree elements */
822 + var prevlen = -1; /* last emitted length */
823 + var curlen; /* length of current code */
824 +
825 + var nextlen = tree[0 * 2 + 1]/*.Len*/; /* length of next code */
826 +
827 + var count = 0; /* repeat count of the current code */
828 + var max_count = 7; /* max repeat count */
829 + var min_count = 4; /* min repeat count */
830 +
831 + /* tree[max_code+1].Len = -1; */ /* guard already set */
832 + if (nextlen === 0) {
833 + max_count = 138;
834 + min_count = 3;
835 + }
836 +
837 + for (n = 0; n <= max_code; n++) {
838 + curlen = nextlen;
839 + nextlen = tree[(n + 1) * 2 + 1]/*.Len*/;
840 +
841 + if (++count < max_count && curlen === nextlen) {
842 + continue;
843 +
844 + } else if (count < min_count) {
845 + do { send_code(s, curlen, s.bl_tree); } while (--count !== 0);
846 +
847 + } else if (curlen !== 0) {
848 + if (curlen !== prevlen) {
849 + send_code(s, curlen, s.bl_tree);
850 + count--;
851 + }
852 + //Assert(count >= 3 && count <= 6, " 3_6?");
853 + send_code(s, REP_3_6, s.bl_tree);
854 + send_bits(s, count - 3, 2);
855 +
856 + } else if (count <= 10) {
857 + send_code(s, REPZ_3_10, s.bl_tree);
858 + send_bits(s, count - 3, 3);
859 +
860 + } else {
861 + send_code(s, REPZ_11_138, s.bl_tree);
862 + send_bits(s, count - 11, 7);
863 + }
864 +
865 + count = 0;
866 + prevlen = curlen;
867 + if (nextlen === 0) {
868 + max_count = 138;
869 + min_count = 3;
870 +
871 + } else if (curlen === nextlen) {
872 + max_count = 6;
873 + min_count = 3;
874 +
875 + } else {
876 + max_count = 7;
877 + min_count = 4;
878 + }
879 + }
880 +}
881 +
882 +
883 +/* ===========================================================================
884 + * Construct the Huffman tree for the bit lengths and return the index in
885 + * bl_order of the last bit length code to send.
886 + */
887 +function build_bl_tree(s) {
888 + var max_blindex; /* index of last bit length code of non zero freq */
889 +
890 + /* Determine the bit length frequencies for literal and distance trees */
891 + scan_tree(s, s.dyn_ltree, s.l_desc.max_code);
892 + scan_tree(s, s.dyn_dtree, s.d_desc.max_code);
893 +
894 + /* Build the bit length tree: */
895 + build_tree(s, s.bl_desc);
896 + /* opt_len now includes the length of the tree representations, except
897 + * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
898 + */
899 +
900 + /* Determine the number of bit length codes to send. The pkzip format
901 + * requires that at least 4 bit length codes be sent. (appnote.txt says
902 + * 3 but the actual value used is 4.)
903 + */
904 + for (max_blindex = BL_CODES - 1; max_blindex >= 3; max_blindex--) {
905 + if (s.bl_tree[bl_order[max_blindex] * 2 + 1]/*.Len*/ !== 0) {
906 + break;
907 + }
908 + }
909 + /* Update opt_len to include the bit length tree and counts */
910 + s.opt_len += 3 * (max_blindex + 1) + 5 + 5 + 4;
911 + //Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
912 + // s->opt_len, s->static_len));
913 +
914 + return max_blindex;
915 +}
916 +
917 +
918 +/* ===========================================================================
919 + * Send the header for a block using dynamic Huffman trees: the counts, the
920 + * lengths of the bit length codes, the literal tree and the distance tree.
921 + * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4.
922 + */
923 +function send_all_trees(s, lcodes, dcodes, blcodes)
924 +// deflate_state *s;
925 +// int lcodes, dcodes, blcodes; /* number of codes for each tree */
926 +{
927 + var rank; /* index in bl_order */
928 +
929 + //Assert (lcodes >= 257 && dcodes >= 1 && blcodes >= 4, "not enough codes");
930 + //Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
931 + // "too many codes");
932 + //Tracev((stderr, "\nbl counts: "));
933 + send_bits(s, lcodes - 257, 5); /* not +255 as stated in appnote.txt */
934 + send_bits(s, dcodes - 1, 5);
935 + send_bits(s, blcodes - 4, 4); /* not -3 as stated in appnote.txt */
936 + for (rank = 0; rank < blcodes; rank++) {
937 + //Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
938 + send_bits(s, s.bl_tree[bl_order[rank] * 2 + 1]/*.Len*/, 3);
939 + }
940 + //Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
941 +
942 + send_tree(s, s.dyn_ltree, lcodes - 1); /* literal tree */
943 + //Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
944 +
945 + send_tree(s, s.dyn_dtree, dcodes - 1); /* distance tree */
946 + //Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
947 +}
948 +
949 +
950 +/* ===========================================================================
951 + * Check if the data type is TEXT or BINARY, using the following algorithm:
952 + * - TEXT if the two conditions below are satisfied:
953 + * a) There are no non-portable control characters belonging to the
954 + * "black list" (0..6, 14..25, 28..31).
955 + * b) There is at least one printable character belonging to the
956 + * "white list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255).
957 + * - BINARY otherwise.
958 + * - The following partially-portable control characters form a
959 + * "gray list" that is ignored in this detection algorithm:
960 + * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}).
961 + * IN assertion: the fields Freq of dyn_ltree are set.
962 + */
963 +function detect_data_type(s) {
964 + /* black_mask is the bit mask of black-listed bytes
965 + * set bits 0..6, 14..25, and 28..31
966 + * 0xf3ffc07f = binary 11110011111111111100000001111111
967 + */
968 + var black_mask = 0xf3ffc07f;
969 + var n;
970 +
971 + /* Check for non-textual ("black-listed") bytes. */
972 + for (n = 0; n <= 31; n++, black_mask >>>= 1) {
973 + if ((black_mask & 1) && (s.dyn_ltree[n * 2]/*.Freq*/ !== 0)) {
974 + return Z_BINARY;
975 + }
976 + }
977 +
978 + /* Check for textual ("white-listed") bytes. */
979 + if (s.dyn_ltree[9 * 2]/*.Freq*/ !== 0 || s.dyn_ltree[10 * 2]/*.Freq*/ !== 0 ||
980 + s.dyn_ltree[13 * 2]/*.Freq*/ !== 0) {
981 + return Z_TEXT;
982 + }
983 + for (n = 32; n < LITERALS; n++) {
984 + if (s.dyn_ltree[n * 2]/*.Freq*/ !== 0) {
985 + return Z_TEXT;
986 + }
987 + }
988 +
989 + /* There are no "black-listed" or "white-listed" bytes:
990 + * this stream either is empty or has tolerated ("gray-listed") bytes only.
991 + */
992 + return Z_BINARY;
993 +}
994 +
995 +
996 +var static_init_done = false;
997 +
998 +/* ===========================================================================
999 + * Initialize the tree data structures for a new zlib stream.
1000 + */
1001 +function _tr_init(s)
1002 +{
1003 +
1004 + if (!static_init_done) {
1005 + tr_static_init();
1006 + static_init_done = true;
1007 + }
1008 +
1009 + s.l_desc = new TreeDesc(s.dyn_ltree, static_l_desc);
1010 + s.d_desc = new TreeDesc(s.dyn_dtree, static_d_desc);
1011 + s.bl_desc = new TreeDesc(s.bl_tree, static_bl_desc);
1012 +
1013 + s.bi_buf = 0;
1014 + s.bi_valid = 0;
1015 +
1016 + /* Initialize the first block of the first file: */
1017 + init_block(s);
1018 +}
1019 +
1020 +
1021 +/* ===========================================================================
1022 + * Send a stored block
1023 + */
1024 +function _tr_stored_block(s, buf, stored_len, last)
1025 +//DeflateState *s;
1026 +//charf *buf; /* input block */
1027 +//ulg stored_len; /* length of input block */
1028 +//int last; /* one if this is the last block for a file */
1029 +{
1030 + send_bits(s, (STORED_BLOCK << 1) + (last ? 1 : 0), 3); /* send block type */
1031 + copy_block(s, buf, stored_len, true); /* with header */
1032 +}
1033 +
1034 +
1035 +/* ===========================================================================
1036 + * Send one empty static block to give enough lookahead for inflate.
1037 + * This takes 10 bits, of which 7 may remain in the bit buffer.
1038 + */
1039 +function _tr_align(s) {
1040 + send_bits(s, STATIC_TREES << 1, 3);
1041 + send_code(s, END_BLOCK, static_ltree);
1042 + bi_flush(s);
1043 +}
1044 +
1045 +
1046 +/* ===========================================================================
1047 + * Determine the best encoding for the current block: dynamic trees, static
1048 + * trees or store, and output the encoded block to the zip file.
1049 + */
1050 +function _tr_flush_block(s, buf, stored_len, last)
1051 +//DeflateState *s;
1052 +//charf *buf; /* input block, or NULL if too old */
1053 +//ulg stored_len; /* length of input block */
1054 +//int last; /* one if this is the last block for a file */
1055 +{
1056 + var opt_lenb, static_lenb; /* opt_len and static_len in bytes */
1057 + var max_blindex = 0; /* index of last bit length code of non zero freq */
1058 +
1059 + /* Build the Huffman trees unless a stored block is forced */
1060 + if (s.level > 0) {
1061 +
1062 + /* Check if the file is binary or text */
1063 + if (s.strm.data_type === Z_UNKNOWN) {
1064 + s.strm.data_type = detect_data_type(s);
1065 + }
1066 +
1067 + /* Construct the literal and distance trees */
1068 + build_tree(s, s.l_desc);
1069 + // Tracev((stderr, "\nlit data: dyn %ld, stat %ld", s->opt_len,
1070 + // s->static_len));
1071 +
1072 + build_tree(s, s.d_desc);
1073 + // Tracev((stderr, "\ndist data: dyn %ld, stat %ld", s->opt_len,
1074 + // s->static_len));
1075 + /* At this point, opt_len and static_len are the total bit lengths of
1076 + * the compressed block data, excluding the tree representations.
1077 + */
1078 +
1079 + /* Build the bit length tree for the above two trees, and get the index
1080 + * in bl_order of the last bit length code to send.
1081 + */
1082 + max_blindex = build_bl_tree(s);
1083 +
1084 + /* Determine the best encoding. Compute the block lengths in bytes. */
1085 + opt_lenb = (s.opt_len + 3 + 7) >>> 3;
1086 + static_lenb = (s.static_len + 3 + 7) >>> 3;
1087 +
1088 + // Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
1089 + // opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
1090 + // s->last_lit));
1091 +
1092 + if (static_lenb <= opt_lenb) { opt_lenb = static_lenb; }
1093 +
1094 + } else {
1095 + // Assert(buf != (char*)0, "lost buf");
1096 + opt_lenb = static_lenb = stored_len + 5; /* force a stored block */
1097 + }
1098 +
1099 + if ((stored_len + 4 <= opt_lenb) && (buf !== -1)) {
1100 + /* 4: two words for the lengths */
1101 +
1102 + /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
1103 + * Otherwise we can't have processed more than WSIZE input bytes since
1104 + * the last block flush, because compression would have been
1105 + * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to
1106 + * transform a block into a stored block.
1107 + */
1108 + _tr_stored_block(s, buf, stored_len, last);
1109 +
1110 + } else if (s.strategy === Z_FIXED || static_lenb === opt_lenb) {
1111 +
1112 + send_bits(s, (STATIC_TREES << 1) + (last ? 1 : 0), 3);
1113 + compress_block(s, static_ltree, static_dtree);
1114 +
1115 + } else {
1116 + send_bits(s, (DYN_TREES << 1) + (last ? 1 : 0), 3);
1117 + send_all_trees(s, s.l_desc.max_code + 1, s.d_desc.max_code + 1, max_blindex + 1);
1118 + compress_block(s, s.dyn_ltree, s.dyn_dtree);
1119 + }
1120 + // Assert (s->compressed_len == s->bits_sent, "bad compressed size");
1121 + /* The above check is made mod 2^32, for files larger than 512 MB
1122 + * and uLong implemented on 32 bits.
1123 + */
1124 + init_block(s);
1125 +
1126 + if (last) {
1127 + bi_windup(s);
1128 + }
1129 + // Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
1130 + // s->compressed_len-7*last));
1131 +}
1132 +
1133 +/* ===========================================================================
1134 + * Save the match info and tally the frequency counts. Return true if
1135 + * the current block must be flushed.
1136 + */
1137 +function _tr_tally(s, dist, lc)
1138 +// deflate_state *s;
1139 +// unsigned dist; /* distance of matched string */
1140 +// unsigned lc; /* match length-MIN_MATCH or unmatched char (if dist==0) */
1141 +{
1142 + //var out_length, in_length, dcode;
1143 +
1144 + s.pending_buf[s.d_buf + s.last_lit * 2] = (dist >>> 8) & 0xff;
1145 + s.pending_buf[s.d_buf + s.last_lit * 2 + 1] = dist & 0xff;
1146 +
1147 + s.pending_buf[s.l_buf + s.last_lit] = lc & 0xff;
1148 + s.last_lit++;
1149 +
1150 + if (dist === 0) {
1151 + /* lc is the unmatched char */
1152 + s.dyn_ltree[lc * 2]/*.Freq*/++;
1153 + } else {
1154 + s.matches++;
1155 + /* Here, lc is the match length - MIN_MATCH */
1156 + dist--; /* dist = match distance - 1 */
1157 + //Assert((ush)dist < (ush)MAX_DIST(s) &&
1158 + // (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
1159 + // (ush)d_code(dist) < (ush)D_CODES, "_tr_tally: bad match");
1160 +
1161 + s.dyn_ltree[(_length_code[lc] + LITERALS + 1) * 2]/*.Freq*/++;
1162 + s.dyn_dtree[d_code(dist) * 2]/*.Freq*/++;
1163 + }
1164 +
1165 +// (!) This block is disabled in zlib defailts,
1166 +// don't enable it for binary compatibility
1167 +
1168 +//#ifdef TRUNCATE_BLOCK
1169 +// /* Try to guess if it is profitable to stop the current block here */
1170 +// if ((s.last_lit & 0x1fff) === 0 && s.level > 2) {
1171 +// /* Compute an upper bound for the compressed length */
1172 +// out_length = s.last_lit*8;
1173 +// in_length = s.strstart - s.block_start;
1174 +//
1175 +// for (dcode = 0; dcode < D_CODES; dcode++) {
1176 +// out_length += s.dyn_dtree[dcode*2]/*.Freq*/ * (5 + extra_dbits[dcode]);
1177 +// }
1178 +// out_length >>>= 3;
1179 +// //Tracev((stderr,"\nlast_lit %u, in %ld, out ~%ld(%ld%%) ",
1180 +// // s->last_lit, in_length, out_length,
1181 +// // 100L - out_length*100L/in_length));
1182 +// if (s.matches < (s.last_lit>>1)/*int /2*/ && out_length < (in_length>>1)/*int /2*/) {
1183 +// return true;
1184 +// }
1185 +// }
1186 +//#endif
1187 +
1188 + return (s.last_lit === s.lit_bufsize - 1);
1189 + /* We avoid equality with lit_bufsize because of wraparound at 64K
1190 + * on 16 bit machines and because stored blocks are restricted to
1191 + * 64K-1 bytes.
1192 + */
1193 +}
1194 +
1195 +export { _tr_init, _tr_stored_block, _tr_flush_block, _tr_tally, _tr_align };
public/novnc/vendor/pako/lib/zlib/zstream.js new
+24
@@ -0,0 +1,24 @@
1 +export default function ZStream() {
2 + /* next input byte */
3 + this.input = null; // JS specific, because we have no pointers
4 + this.next_in = 0;
5 + /* number of bytes available at input */
6 + this.avail_in = 0;
7 + /* total number of input bytes read so far */
8 + this.total_in = 0;
9 + /* next output byte should be put there */
10 + this.output = null; // JS specific, because we have no pointers
11 + this.next_out = 0;
12 + /* remaining free space at output */
13 + this.avail_out = 0;
14 + /* total number of bytes output so far */
15 + this.total_out = 0;
16 + /* last error message, NULL if no error */
17 + this.msg = ''/*Z_NULL*/;
18 + /* not visible by applications */
19 + this.state = null;
20 + /* best guess about the data type: binary or text */
21 + this.data_type = 2/*Z_UNKNOWN*/;
22 + /* adler32 value of the uncompressed data */
23 + this.adler = 0;
24 +}
public/novnc/vendor/promise.js new
+255
@@ -0,0 +1,255 @@
1 +/* Copyright (c) 2014 Taylor Hakes
2 + * Copyright (c) 2014 Forbes Lindesay
3 + *
4 + * Permission is hereby granted, free of charge, to any person obtaining a copy
5 + * of this software and associated documentation files (the "Software"), to deal
6 + * in the Software without restriction, including without limitation the rights
7 + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 + * copies of the Software, and to permit persons to whom the Software is
9 + * furnished to do so, subject to the following conditions:
10 + *
11 + * The above copyright notice and this permission notice shall be included in
12 + * all copies or substantial portions of the Software.
13 + *
14 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 + * THE SOFTWARE.
21 + */
22 +
23 +(function (root) {
24 +
25 + // Store setTimeout reference so promise-polyfill will be unaffected by
26 + // other code modifying setTimeout (like sinon.useFakeTimers())
27 + var setTimeoutFunc = setTimeout;
28 +
29 + function noop() {}
30 +
31 + // Polyfill for Function.prototype.bind
32 + function bind(fn, thisArg) {
33 + return function () {
34 + fn.apply(thisArg, arguments);
35 + };
36 + }
37 +
38 + function Promise(fn) {
39 + if (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');
40 + if (typeof fn !== 'function') throw new TypeError('not a function');
41 + this._state = 0;
42 + this._handled = false;
43 + this._value = undefined;
44 + this._deferreds = [];
45 +
46 + doResolve(fn, this);
47 + }
48 +
49 + function handle(self, deferred) {
50 + while (self._state === 3) {
51 + self = self._value;
52 + }
53 + if (self._state === 0) {
54 + self._deferreds.push(deferred);
55 + return;
56 + }
57 + self._handled = true;
58 + Promise._immediateFn(function () {
59 + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
60 + if (cb === null) {
61 + (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
62 + return;
63 + }
64 + var ret;
65 + try {
66 + ret = cb(self._value);
67 + } catch (e) {
68 + reject(deferred.promise, e);
69 + return;
70 + }
71 + resolve(deferred.promise, ret);
72 + });
73 + }
74 +
75 + function resolve(self, newValue) {
76 + try {
77 + // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
78 + if (newValue === self) throw new TypeError('A promise cannot be resolved with itself.');
79 + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {
80 + var then = newValue.then;
81 + if (newValue instanceof Promise) {
82 + self._state = 3;
83 + self._value = newValue;
84 + finale(self);
85 + return;
86 + } else if (typeof then === 'function') {
87 + doResolve(bind(then, newValue), self);
88 + return;
89 + }
90 + }
91 + self._state = 1;
92 + self._value = newValue;
93 + finale(self);
94 + } catch (e) {
95 + reject(self, e);
96 + }
97 + }
98 +
99 + function reject(self, newValue) {
100 + self._state = 2;
101 + self._value = newValue;
102 + finale(self);
103 + }
104 +
105 + function finale(self) {
106 + if (self._state === 2 && self._deferreds.length === 0) {
107 + Promise._immediateFn(function() {
108 + if (!self._handled) {
109 + Promise._unhandledRejectionFn(self._value);
110 + }
111 + });
112 + }
113 +
114 + for (var i = 0, len = self._deferreds.length; i < len; i++) {
115 + handle(self, self._deferreds[i]);
116 + }
117 + self._deferreds = null;
118 + }
119 +
120 + function Handler(onFulfilled, onRejected, promise) {
121 + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
122 + this.onRejected = typeof onRejected === 'function' ? onRejected : null;
123 + this.promise = promise;
124 + }
125 +
126 + /**
127 + * Take a potentially misbehaving resolver function and make sure
128 + * onFulfilled and onRejected are only called once.
129 + *
130 + * Makes no guarantees about asynchrony.
131 + */
132 + function doResolve(fn, self) {
133 + var done = false;
134 + try {
135 + fn(function (value) {
136 + if (done) return;
137 + done = true;
138 + resolve(self, value);
139 + }, function (reason) {
140 + if (done) return;
141 + done = true;
142 + reject(self, reason);
143 + });
144 + } catch (ex) {
145 + if (done) return;
146 + done = true;
147 + reject(self, ex);
148 + }
149 + }
150 +
151 + Promise.prototype['catch'] = function (onRejected) {
152 + return this.then(null, onRejected);
153 + };
154 +
155 + Promise.prototype.then = function (onFulfilled, onRejected) {
156 + var prom = new (this.constructor)(noop);
157 +
158 + handle(this, new Handler(onFulfilled, onRejected, prom));
159 + return prom;
160 + };
161 +
162 + Promise.all = function (arr) {
163 + var args = Array.prototype.slice.call(arr);
164 +
165 + return new Promise(function (resolve, reject) {
166 + if (args.length === 0) return resolve([]);
167 + var remaining = args.length;
168 +
169 + function res(i, val) {
170 + try {
171 + if (val && (typeof val === 'object' || typeof val === 'function')) {
172 + var then = val.then;
173 + if (typeof then === 'function') {
174 + then.call(val, function (val) {
175 + res(i, val);
176 + }, reject);
177 + return;
178 + }
179 + }
180 + args[i] = val;
181 + if (--remaining === 0) {
182 + resolve(args);
183 + }
184 + } catch (ex) {
185 + reject(ex);
186 + }
187 + }
188 +
189 + for (var i = 0; i < args.length; i++) {
190 + res(i, args[i]);
191 + }
192 + });
193 + };
194 +
195 + Promise.resolve = function (value) {
196 + if (value && typeof value === 'object' && value.constructor === Promise) {
197 + return value;
198 + }
199 +
200 + return new Promise(function (resolve) {
201 + resolve(value);
202 + });
203 + };
204 +
205 + Promise.reject = function (value) {
206 + return new Promise(function (resolve, reject) {
207 + reject(value);
208 + });
209 + };
210 +
211 + Promise.race = function (values) {
212 + return new Promise(function (resolve, reject) {
213 + for (var i = 0, len = values.length; i < len; i++) {
214 + values[i].then(resolve, reject);
215 + }
216 + });
217 + };
218 +
219 + // Use polyfill for setImmediate for performance gains
220 + Promise._immediateFn = (typeof setImmediate === 'function' && function (fn) { setImmediate(fn); }) ||
221 + function (fn) {
222 + setTimeoutFunc(fn, 0);
223 + };
224 +
225 + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
226 + if (typeof console !== 'undefined' && console) {
227 + console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
228 + }
229 + };
230 +
231 + /**
232 + * Set the immediate function to execute callbacks
233 + * @param fn {function} Function to execute
234 + * @deprecated
235 + */
236 + Promise._setImmediateFn = function _setImmediateFn(fn) {
237 + Promise._immediateFn = fn;
238 + };
239 +
240 + /**
241 + * Change the function to execute on unhandled rejection
242 + * @param {function} fn Function to execute on unhandled rejection
243 + * @deprecated
244 + */
245 + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) {
246 + Promise._unhandledRejectionFn = fn;
247 + };
248 +
249 + if (typeof module !== 'undefined' && module.exports) {
250 + module.exports = Promise;
251 + } else if (!root.Promise) {
252 + root.Promise = Promise;
253 + }
254 +
255 +})(this);
public/novnc/vnc.html new
+336
@@ -0,0 +1,336 @@
1 +<!DOCTYPE html>
2 +<html lang="en" class="noVNC_loading">
3 +<head>
4 +
5 + <!--
6 + noVNC example: simple example using default UI
7 + Copyright (C) 2018 The noVNC Authors
8 + noVNC is licensed under the MPL 2.0 (see LICENSE.txt)
9 + This file is licensed under the 2-Clause BSD license (see LICENSE.txt).
10 +
11 + Connect parameters are provided in query string:
12 + http://example.com/?host=HOST&port=PORT&encrypt=1
13 + or the fragment:
14 + http://example.com/#host=HOST&port=PORT&encrypt=1
15 + -->
16 + <title>noVNC</title>
17 +
18 + <meta charset="utf-8">
19 +
20 + <!-- Icons (see app/images/icons/Makefile for what the sizes are for) -->
21 +<!--
22 + <link rel="icon" sizes="16x16" type="image/png" href="app/images/icons/novnc-16x16.png">
23 + <link rel="icon" sizes="24x24" type="image/png" href="app/images/icons/novnc-24x24.png">
24 + <link rel="icon" sizes="32x32" type="image/png" href="app/images/icons/novnc-32x32.png">
25 + <link rel="icon" sizes="48x48" type="image/png" href="app/images/icons/novnc-48x48.png">
26 + <link rel="icon" sizes="60x60" type="image/png" href="app/images/icons/novnc-60x60.png">
27 + <link rel="icon" sizes="64x64" type="image/png" href="app/images/icons/novnc-64x64.png">
28 + <link rel="icon" sizes="72x72" type="image/png" href="app/images/icons/novnc-72x72.png">
29 + <link rel="icon" sizes="76x76" type="image/png" href="app/images/icons/novnc-76x76.png">
30 + <link rel="icon" sizes="96x96" type="image/png" href="app/images/icons/novnc-96x96.png">
31 + <link rel="icon" sizes="120x120" type="image/png" href="app/images/icons/novnc-120x120.png">
32 + <link rel="icon" sizes="144x144" type="image/png" href="app/images/icons/novnc-144x144.png">
33 + <link rel="icon" sizes="152x152" type="image/png" href="app/images/icons/novnc-152x152.png">
34 + <link rel="icon" sizes="192x192" type="image/png" href="app/images/icons/novnc-192x192.png">
35 +-->
36 + <!-- Firefox currently mishandles SVG, see #1419039
37 + <link rel="icon" sizes="any" type="image/svg+xml" href="app/images/icons/novnc-icon.svg">
38 + -->
39 + <!-- Repeated last so that legacy handling will pick this -->
40 +<!--
41 + <link rel="icon" sizes="16x16" type="image/png" href="app/images/icons/novnc-16x16.png">
42 +-->
43 +
44 + <!-- Apple iOS Safari settings -->
45 + <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
46 + <meta name="apple-mobile-web-app-capable" content="yes">
47 + <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
48 + <!-- Home Screen Icons (favourites and bookmarks use the normal icons) -->
49 +<!--
50 + <link rel="apple-touch-icon" sizes="60x60" type="image/png" href="app/images/icons/novnc-60x60.png">
51 + <link rel="apple-touch-icon" sizes="76x76" type="image/png" href="app/images/icons/novnc-76x76.png">
52 + <link rel="apple-touch-icon" sizes="120x120" type="image/png" href="app/images/icons/novnc-120x120.png">
53 + <link rel="apple-touch-icon" sizes="152x152" type="image/png" href="app/images/icons/novnc-152x152.png">
54 +-->
55 +
56 + <!-- Stylesheets -->
57 + <link rel="stylesheet" href="app/styles/base.css">
58 +
59 + <!-- this is included as a normal file in order to catch script-loading errors as well -->
60 + <script src="app/error-handler.js"></script>
61 +
62 + <!-- begin scripts -->
63 + <!-- promise polyfills promises for IE11 -->
64 + <script src="vendor/promise.js"></script>
65 + <!-- ES2015/ES6 modules polyfill -->
66 + <script type="module">
67 + window._noVNC_has_module_support = true;
68 + </script>
69 + <script>
70 + window.addEventListener("load", function() {
71 + if (window._noVNC_has_module_support) return;
72 + var loader = document.createElement("script");
73 + loader.src = "vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
74 + document.head.appendChild(loader);
75 + });
76 + </script>
77 + <!-- actual script modules -->
78 + <script type="module" crossorigin="anonymous" src="app/ui.js"></script>
79 + <!-- end scripts -->
80 +</head>
81 +
82 +<body>
83 +
84 + <div id="noVNC_fallback_error" class="noVNC_center">
85 + <div>
86 + <div>noVNC encountered an error:</div>
87 + <br>
88 + <div id="noVNC_fallback_errormsg"></div>
89 + </div>
90 + </div>
91 +
92 + <!-- noVNC Control Bar -->
93 + <div id="noVNC_control_bar_anchor" class="noVNC_vcenter">
94 +
95 + <div id="noVNC_control_bar">
96 + <div id="noVNC_control_bar_handle" title="Hide/Show the control bar"><div></div></div>
97 +
98 + <div class="noVNC_scroll">
99 +
100 + <!--<h1 class="noVNC_logo" translate="no"><span>no</span><br>VNC</h1>-->
101 +
102 + <!-- Drag/Pan the viewport -->
103 + <input type="image" alt="viewport drag" src="app/images/drag.svg"
104 + id="noVNC_view_drag_button" class="noVNC_button noVNC_hidden"
105 + title="Move/Drag Viewport">
106 +
107 + <!--noVNC Touch Device only buttons-->
108 + <div id="noVNC_mobile_buttons">
109 + <input type="image" alt="No mousebutton" src="app/images/mouse_none.svg"
110 + id="noVNC_mouse_button0" class="noVNC_button"
111 + title="Active Mouse Button">
112 + <input type="image" alt="Left mousebutton" src="app/images/mouse_left.svg"
113 + id="noVNC_mouse_button1" class="noVNC_button"
114 + title="Active Mouse Button">
115 + <input type="image" alt="Middle mousebutton" src="app/images/mouse_middle.svg"
116 + id="noVNC_mouse_button2" class="noVNC_button"
117 + title="Active Mouse Button">
118 + <input type="image" alt="Right mousebutton" src="app/images/mouse_right.svg"
119 + id="noVNC_mouse_button4" class="noVNC_button"
120 + title="Active Mouse Button">
121 + <input type="image" alt="Keyboard" src="app/images/keyboard.svg"
122 + id="noVNC_keyboard_button" class="noVNC_button" title="Show Keyboard">
123 + </div>
124 +
125 + <!-- Extra manual keys -->
126 + <div id="noVNC_extra_keys">
127 + <input type="image" alt="Extra keys" src="app/images/toggleextrakeys.svg"
128 + id="noVNC_toggle_extra_keys_button" class="noVNC_button"
129 + title="Show Extra Keys">
130 + <div class="noVNC_vcenter">
131 + <div id="noVNC_modifiers" class="noVNC_panel">
132 + <input type="image" alt="Ctrl" src="app/images/ctrl.svg"
133 + id="noVNC_toggle_ctrl_button" class="noVNC_button"
134 + title="Toggle Ctrl">
135 + <input type="image" alt="Alt" src="app/images/alt.svg"
136 + id="noVNC_toggle_alt_button" class="noVNC_button"
137 + title="Toggle Alt">
138 + <input type="image" alt="Windows" src="app/images/windows.svg"
139 + id="noVNC_toggle_windows_button" class="noVNC_button"
140 + title="Toggle Windows">
141 + <input type="image" alt="Tab" src="app/images/tab.svg"
142 + id="noVNC_send_tab_button" class="noVNC_button"
143 + title="Send Tab">
144 + <input type="image" alt="Esc" src="app/images/esc.svg"
145 + id="noVNC_send_esc_button" class="noVNC_button"
146 + title="Send Escape">
147 + <input type="image" alt="Ctrl+Alt+Del" src="app/images/ctrlaltdel.svg"
148 + id="noVNC_send_ctrl_alt_del_button" class="noVNC_button"
149 + title="Send Ctrl-Alt-Del">
150 + </div>
151 + </div>
152 + </div>
153 +
154 + <!-- Shutdown/Reboot -->
155 + <input type="image" alt="Shutdown/Reboot" src="app/images/power.svg"
156 + id="noVNC_power_button" class="noVNC_button"
157 + title="Shutdown/Reboot...">
158 + <div class="noVNC_vcenter">
159 + <div id="noVNC_power" class="noVNC_panel">
160 + <div class="noVNC_heading">
161 + <img alt="" src="app/images/power.svg"> Power
162 + </div>
163 + <input type="button" id="noVNC_shutdown_button" value="Shutdown">
164 + <input type="button" id="noVNC_reboot_button" value="Reboot">
165 + <input type="button" id="noVNC_reset_button" value="Reset">
166 + </div>
167 + </div>
168 +
169 + <!-- Clipboard -->
170 + <input type="image" alt="Clipboard" src="app/images/clipboard.svg"
171 + id="noVNC_clipboard_button" class="noVNC_button"
172 + title="Clipboard">
173 + <div class="noVNC_vcenter">
174 + <div id="noVNC_clipboard" class="noVNC_panel">
175 + <div class="noVNC_heading">
176 + <img alt="" src="app/images/clipboard.svg"> Clipboard
177 + </div>
178 + <textarea id="noVNC_clipboard_text" rows=5></textarea>
179 + <br>
180 + <input id="noVNC_clipboard_clear_button" type="button"
181 + value="Clear" class="noVNC_submit">
182 + </div>
183 + </div>
184 +
185 + <!-- Toggle fullscreen -->
186 + <input type="image" alt="Fullscreen" src="app/images/fullscreen.svg"
187 + id="noVNC_fullscreen_button" class="noVNC_button noVNC_hidden"
188 + title="Fullscreen">
189 +
190 + <!-- Settings -->
191 + <input type="image" alt="Settings" src="app/images/settings.svg"
192 + id="noVNC_settings_button" class="noVNC_button"
193 + title="Settings">
194 + <div class="noVNC_vcenter">
195 + <div id="noVNC_settings" class="noVNC_panel">
196 + <ul>
197 + <li class="noVNC_heading">
198 + <img alt="" src="app/images/settings.svg"> Settings
199 + </li>
200 + <li>
201 + <label><input id="noVNC_setting_shared" type="checkbox"> Shared Mode</label>
202 + </li>
203 + <li>
204 + <label><input id="noVNC_setting_view_only" type="checkbox"> View Only</label>
205 + </li>
206 + <li><hr></li>
207 + <li>
208 + <label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
209 + </li>
210 + <li>
211 + <label for="noVNC_setting_resize">Scaling Mode:</label>
212 + <select id="noVNC_setting_resize" name="vncResize">
213 + <option value="off">None</option>
214 + <option value="scale">Local Scaling</option>
215 + <option value="remote">Remote Resizing</option>
216 + </select>
217 + </li>
218 + <li><hr></li>
219 + <li>
220 + <div class="noVNC_expander">Advanced</div>
221 + <div><ul>
222 + <li>
223 + <label for="noVNC_setting_repeaterID">Repeater ID:</label>
224 + <input id="noVNC_setting_repeaterID" type="text" value="">
225 + </li>
226 + <li>
227 + <div class="noVNC_expander">WebSocket</div>
228 + <div><ul>
229 + <li>
230 + <label><input id="noVNC_setting_encrypt" type="checkbox"> Encrypt</label>
231 + </li>
232 + <li>
233 + <label for="noVNC_setting_host">Host:</label>
234 + <input id="noVNC_setting_host">
235 + </li>
236 + <li>
237 + <label for="noVNC_setting_port">Port:</label>
238 + <input id="noVNC_setting_port" type="number">
239 + </li>
240 + <li>
241 + <label for="noVNC_setting_path">Path:</label>
242 + <input id="noVNC_setting_path" type="text" value="websockify">
243 + </li>
244 + </ul></div>
245 + </li>
246 + <li><hr></li>
247 + <li>
248 + <label><input id="noVNC_setting_reconnect" type="checkbox"> Automatic Reconnect</label>
249 + </li>
250 + <li>
251 + <label for="noVNC_setting_reconnect_delay">Reconnect Delay (ms):</label>
252 + <input id="noVNC_setting_reconnect_delay" type="number">
253 + </li>
254 + <li><hr></li>
255 + <li>
256 + <label><input id="noVNC_setting_show_dot" type="checkbox"> Show Dot when No Cursor</label>
257 + </li>
258 + <li><hr></li>
259 + <!-- Logging selection dropdown -->
260 + <li>
261 + <label>Logging:
262 + <select id="noVNC_setting_logging" name="vncLogging">
263 + </select>
264 + </label>
265 + </li>
266 + </ul></div>
267 + </li>
268 + </ul>
269 + </div>
270 + </div>
271 +
272 + <!-- Connection Controls -->
273 + <input type="image" alt="Disconnect" src="app/images/disconnect.svg"
274 + id="noVNC_disconnect_button" class="noVNC_button"
275 + title="Disconnect">
276 +
277 + </div>
278 + </div>
279 +
280 + <div id="noVNC_control_bar_hint"></div>
281 +
282 + </div> <!-- End of noVNC_control_bar -->
283 +
284 + <!-- Status Dialog -->
285 + <div id="noVNC_status"></div>
286 +
287 + <!-- Connect button -->
288 + <div class="noVNC_center">
289 + <div id="noVNC_connect_dlg">
290 + <!--<div class="noVNC_logo" translate="no"><span>no</span>VNC</div>-->
291 + <div id="noVNC_connect_button"><div>
292 + <img alt="" src="app/images/connect.svg"> Connect
293 + </div></div>
294 + </div>
295 + </div>
296 +
297 + <!-- Password Dialog -->
298 + <div class="noVNC_center noVNC_connect_layer">
299 + <div id="noVNC_password_dlg" class="noVNC_panel"><form>
300 + <ul>
301 + <li>
302 + <label>Password:</label>
303 + <input id="noVNC_password_input" type="password">
304 + </li>
305 + <li>
306 + <input id="noVNC_password_button" type="submit" value="Send Password" class="noVNC_submit">
307 + </li>
308 + </ul>
309 + </form></div>
310 + </div>
311 +
312 + <!-- Transition Screens -->
313 + <div id="noVNC_transition">
314 + <div id="noVNC_transition_text"></div>
315 + <div>
316 + <input type="button" id="noVNC_cancel_reconnect_button" value="Cancel" class="noVNC_submit">
317 + </div>
318 + <div class="noVNC_spinner"></div>
319 + </div>
320 +
321 + <!-- This is where the RFB elements will attach -->
322 + <div id="noVNC_container">
323 + <!-- Note that Google Chrome on Android doesn't respect any of these,
324 + html attributes which attempt to disable text suggestions on the
325 + on-screen keyboard. Let's hope Chrome implements the ime-mode
326 + style for example -->
327 + <textarea id="noVNC_keyboardinput" autocapitalize="off"
328 + autocomplete="off" spellcheck="false" tabindex="-1"></textarea>
329 + </div>
330 +
331 + <audio id="noVNC_bell">
332 + <source src="app/sounds/bell.oga" type="audio/ogg">
333 + <source src="app/sounds/bell.mp3" type="audio/mpeg">
334 + </audio>
335 + </body>
336 +</html>
translate/translate.json
+1833 -1808
@@ -14,8 +14,8 @@
14 "ru": " + CIRA",
15 "zh-chs": " + CIRA",
16 "xloc": [
17 - "default.handlebars->25->1189",
18 - "default.handlebars->25->1191"
17 + "default.handlebars->27->1193",
18 + "default.handlebars->27->1195"
19 ]
20 },
21 {
@@ -33,7 +33,7 @@
33 "zh-chs": " - 1天后重設。",
34 "xloc": [
35 "default-mobile.handlebars->9->46",
36 - "default.handlebars->25->57"
36 + "default.handlebars->27->57"
37 ]
38 },
39 {
@@ -51,7 +51,7 @@
51 "zh-chs": " - 1小時後重設。",
52 "xloc": [
53 "default-mobile.handlebars->9->44",
54 - "default.handlebars->25->55"
54 + "default.handlebars->27->55"
55 ]
56 },
57 {
@@ -69,7 +69,7 @@
69 "zh-chs": " - 1分鐘後重設。",
70 "xloc": [
71 "default-mobile.handlebars->9->42",
72 - "default.handlebars->25->53"
72 + "default.handlebars->27->53"
73 ]
74 },
75 {
@@ -87,7 +87,7 @@
87 "zh-chs": " - 在{0}天內重置。",
88 "xloc": [
89 "default-mobile.handlebars->9->47",
90 - "default.handlebars->25->58"
90 + "default.handlebars->27->58"
91 ]
92 },
93 {
@@ -105,7 +105,7 @@
105 "zh-chs": " - 在{0}小時內重置。",
106 "xloc": [
107 "default-mobile.handlebars->9->45",
108 - "default.handlebars->25->56"
108 + "default.handlebars->27->56"
109 ]
110 },
111 {
@@ -123,7 +123,7 @@
123 "zh-chs": " - 在{0}分鐘內重置。",
124 "xloc": [
125 "default-mobile.handlebars->9->43",
126 - "default.handlebars->25->54"
126 + "default.handlebars->27->54"
127 ]
128 },
129 {
@@ -142,8 +142,8 @@
142 "xloc": [
143 "default-mobile.handlebars->9->40",
144 "default-mobile.handlebars->9->41",
145 - "default.handlebars->25->51",
146 - "default.handlebars->25->52"
145 + "default.handlebars->27->51",
146 + "default.handlebars->27->52"
147 ]
148 },
149 {
@@ -174,7 +174,7 @@
174 "ru": " Может быть использована подсказка пароля, но не рекоммендуется.",
175 "zh-chs": " 可以使用密碼提示,但不建議使用。",
176 "xloc": [
177 - "default.handlebars->25->1115"
177 + "default.handlebars->27->1119"
178 ]
179 },
180 {
@@ -191,8 +191,8 @@
191 "ru": " Для добавления в группу устройств, пользователь должен зайти на сервер хотя бы один раз.",
192 "zh-chs": " 用戶需要先登錄到該服務器一次,然後才能將其添加到設備組。",
193 "xloc": [
194 - "default.handlebars->25->1264",
195 - "default.handlebars->25->1577"
194 + "default.handlebars->27->1268",
195 + "default.handlebars->27->1581"
196 ]
197 },
198 {
@@ -209,7 +209,7 @@
209 "ru": " и задайте указанное ниже имя пользователя и любой пароль.",
210 "zh-chs": " 並使用該用戶名和任何密碼對服務器進行身份驗證。",
211 "xloc": [
212 - "default.handlebars->25->275"
212 + "default.handlebars->27->275"
213 ]
214 },
215 {
@@ -226,7 +226,7 @@
226 "ru": " и задайте указанные ниже имя пользователя и пароль.",
227 "zh-chs": " 並使用該用戶名和密碼向服務器驗證身份。",
228 "xloc": [
229 - "default.handlebars->25->274"
229 + "default.handlebars->27->274"
230 ]
231 },
232 {
@@ -277,7 +277,7 @@
277 "ru": " с TLS.",
278 "zh-chs": " TLS。",
279 "xloc": [
280 - "default.handlebars->25->154"
280 + "default.handlebars->27->154"
281 ]
282 },
283 {
@@ -294,7 +294,7 @@
294 "ru": " без TLS",
295 "zh-chs": " 沒有TLS。",
296 "xloc": [
297 - "default.handlebars->25->155"
297 + "default.handlebars->27->155"
298 ]
299 },
300 {
@@ -327,7 +327,7 @@
327 "ru": "(необязательно)",
328 "zh-chs": "(可選的)",
329 "xloc": [
330 - "default.handlebars->25->314"
330 + "default.handlebars->27->314"
331 ]
332 },
333 {
@@ -360,7 +360,7 @@
360 "ru": "* Для BSD сначала запустите \\\"pkg install wget sudo bash\\\".",
361 "zh-chs": "*對於BSD,首先運行 “pkg install wget sudo bash”。",
362 "xloc": [
363 - "default.handlebars->25->347"
363 + "default.handlebars->27->347"
364 ]
365 },
366 {
@@ -377,7 +377,7 @@
377 "ru": "* Оставьте пустым для установления случайного пароля каждому устройству.",
378 "zh-chs": "*保留空白以為每個設備分配一個隨機密碼。",
379 "xloc": [
380 - "default.handlebars->25->1236"
380 + "default.handlebars->27->1240"
381 ]
382 },
383 {
@@ -411,7 +411,7 @@
411 "zh-chs": ",",
412 "xloc": [
413 "default-mobile.handlebars->9->435",
414 - "default.handlebars->25->1330"
414 + "default.handlebars->27->1334"
415 ]
416 },
417 {
@@ -429,7 +429,7 @@
429 "zh-chs": ",僅限Intel&reg;AMT",
430 "xloc": [
431 "default-mobile.handlebars->9->147",
432 - "default.handlebars->25->172"
432 + "default.handlebars->27->172"
433 ]
434 },
435 {
@@ -446,7 +446,7 @@
446 "ru": ", MQTT онлайн",
447 "zh-chs": ",MQTT在線",
448 "xloc": [
449 - "default.handlebars->25->858"
449 + "default.handlebars->27->862"
450 ]
451 },
452 {
@@ -463,7 +463,7 @@
463 "ru": ", Soft-KVM",
464 "zh-chs": ",軟KVM",
465 "xloc": [
466 - "default.handlebars->25->704"
466 + "default.handlebars->27->708"
467 ]
468 },
469 {
@@ -482,9 +482,9 @@
482 "xloc": [
483 "default-mobile.handlebars->9->277",
484 "default-mobile.handlebars->9->286",
485 - "default.handlebars->25->711",
486 - "default.handlebars->25->742",
487 - "default.handlebars->25->754",
485 + "default.handlebars->27->715",
486 + "default.handlebars->27->746",
487 + "default.handlebars->27->758",
488 "xterm.handlebars->9->6"
489 ]
490 },
@@ -510,7 +510,7 @@
510 "en": ", for this link to work you must download MeshCentral Router run it and click the install button.",
511 "nl": ", om deze link te laten werken, moet u MeshCentral Router downloaden, het uitvoeren en op de installatieknop klikken.",
512 "xloc": [
513 - "default.handlebars->25->668"
513 + "default.handlebars->27->672"
514 ]
515 },
516 {
@@ -568,7 +568,7 @@
568 "en": ", {0} watching",
569 "nl": ", {0} kijken",
570 "xloc": [
571 - "default.handlebars->25->705"
571 + "default.handlebars->27->709"
572 ]
573 },
574 {
@@ -625,9 +625,9 @@
625 "xloc": [
626 "default-mobile.handlebars->9->108",
627 "default-mobile.handlebars->9->288",
628 - "default.handlebars->25->1371",
629 - "default.handlebars->25->1725",
630 - "default.handlebars->25->756"
628 + "default.handlebars->27->1375",
629 + "default.handlebars->27->1729",
630 + "default.handlebars->27->760"
631 ]
632 },
633 {
@@ -676,7 +676,7 @@
676 "ru": "1 активная сессия",
677 "zh-chs": "1個活動會話",
678 "xloc": [
679 - "default.handlebars->25->1643"
679 + "default.handlebars->27->1647"
680 ]
681 },
682 {
@@ -695,14 +695,14 @@
695 "xloc": [
696 "default-mobile.handlebars->9->118",
697 "default-mobile.handlebars->9->439",
698 - "default.handlebars->25->1390"
698 + "default.handlebars->27->1394"
699 ]
700 },
701 {
702 "en": "1 connection",
703 "nl": "1 verbinding",
704 "xloc": [
705 - "default.handlebars->25->707"
705 + "default.handlebars->27->711"
706 ]
707 },
708 {
@@ -719,9 +719,9 @@
719 "ru": "1 день",
720 "zh-chs": "1天",
721 "xloc": [
722 - "default.handlebars->25->162",
723 - "default.handlebars->25->305",
724 - "default.handlebars->25->319"
722 + "default.handlebars->27->162",
723 + "default.handlebars->27->305",
724 + "default.handlebars->27->319"
725 ]
726 },
727 {
@@ -738,7 +738,7 @@
738 "ru": "1 группа",
739 "zh-chs": "1組",
740 "xloc": [
741 - "default.handlebars->25->1608"
741 + "default.handlebars->27->1612"
742 ]
743 },
744 {
@@ -755,9 +755,9 @@
755 "ru": "1 час",
756 "zh-chs": "1小時",
757 "xloc": [
758 - "default.handlebars->25->160",
759 - "default.handlebars->25->303",
760 - "default.handlebars->25->317"
758 + "default.handlebars->27->160",
759 + "default.handlebars->27->303",
760 + "default.handlebars->27->317"
761 ]
762 },
763 {
@@ -774,7 +774,7 @@
774 "ru": "1 минута до разъединения",
775 "zh-chs": "1分鐘直到斷開連接",
776 "xloc": [
777 - "default.handlebars->25->61"
777 + "default.handlebars->27->61"
778 ]
779 },
780 {
@@ -791,9 +791,9 @@
791 "ru": "1 месяц",
792 "zh-chs": "1個月",
793 "xloc": [
794 - "default.handlebars->25->164",
795 - "default.handlebars->25->307",
796 - "default.handlebars->25->321"
794 + "default.handlebars->27->164",
795 + "default.handlebars->27->307",
796 + "default.handlebars->27->321"
797 ]
798 },
799 {
@@ -810,7 +810,7 @@
810 "ru": "Еще 1 пользователь не показан, используйте поиск чтобы найти пользователей...",
811 "zh-chs": "未再顯示1個用戶,請使用搜索框查找用戶...",
812 "xloc": [
813 - "default.handlebars->25->1425"
813 + "default.handlebars->27->1429"
814 ]
815 },
816 {
@@ -827,7 +827,7 @@
827 "ru": "1 устройство",
828 "zh-chs": "1個節點",
829 "xloc": [
830 - "default.handlebars->25->361"
830 + "default.handlebars->27->361"
831 ]
832 },
833 {
@@ -844,7 +844,7 @@
844 "ru": "1 секунда до разъединения",
845 "zh-chs": "1秒,直到斷開連接",
846 "xloc": [
847 - "default.handlebars->25->59"
847 + "default.handlebars->27->59"
848 ]
849 },
850 {
@@ -865,11 +865,11 @@
865 "default-mobile.handlebars->9->162",
866 "default-mobile.handlebars->9->165",
867 "default-mobile.handlebars->9->168",
868 - "default.handlebars->25->1429",
869 - "default.handlebars->25->212",
870 - "default.handlebars->25->215",
871 - "default.handlebars->25->218",
872 - "default.handlebars->25->221"
868 + "default.handlebars->27->1433",
869 + "default.handlebars->27->212",
870 + "default.handlebars->27->215",
871 + "default.handlebars->27->218",
872 + "default.handlebars->27->221"
873 ]
874 },
875 {
@@ -886,9 +886,9 @@
886 "ru": "1 неделя",
887 "zh-chs": "1週",
888 "xloc": [
889 - "default.handlebars->25->163",
890 - "default.handlebars->25->306",
891 - "default.handlebars->25->320"
889 + "default.handlebars->27->163",
890 + "default.handlebars->27->306",
891 + "default.handlebars->27->320"
892 ]
893 },
894 {
@@ -1047,7 +1047,7 @@
1047 "ru": "Активация двухэтапного входа не удалась.",
1048 "zh-chs": "兩步登錄激活失敗。",
1049 "xloc": [
1050 - "default.handlebars->25->112"
1050 + "default.handlebars->27->112"
1051 ]
1052 },
1053 {
@@ -1064,7 +1064,7 @@
1064 "ru": "Удаление активации двухэтапного входа не удалось.",
1065 "zh-chs": "兩步登錄激活刪除失敗。",
1066 "xloc": [
1067 - "default.handlebars->25->117"
1067 + "default.handlebars->27->117"
1068 ]
1069 },
1070 {
@@ -1137,8 +1137,8 @@
1137 "ru": "двухфакторная аутентификация включена",
1138 "zh-chs": "啟用第二因素身份驗證",
1139 "xloc": [
1140 - "default.handlebars->25->1442",
1141 - "default.handlebars->25->1630"
1140 + "default.handlebars->27->1446",
1141 + "default.handlebars->27->1634"
1142 ]
1143 },
1144 {
@@ -1240,8 +1240,8 @@
1240 "ru": "32-разрядная версия MeshAgent",
1241 "zh-chs": "MeshAgent的32位版本",
1242 "xloc": [
1243 - "default.handlebars->25->337",
1244 - "default.handlebars->25->354"
1243 + "default.handlebars->27->337",
1244 + "default.handlebars->27->354"
1245 ]
1246 },
1247 {
@@ -1454,7 +1454,7 @@
1454 "ru": "64-битная версия MacOS Mesh Agent",
1455 "zh-chs": "64位版本的MacOS Mesh Agent",
1456 "xloc": [
1457 - "default.handlebars->25->350"
1457 + "default.handlebars->27->350"
1458 ]
1459 },
1460 {
@@ -1471,8 +1471,8 @@
1471 "ru": "64-разрядная версия MeshAgent",
1472 "zh-chs": "MeshAgent的64位版本",
1473 "xloc": [
1474 - "default.handlebars->25->341",
1475 - "default.handlebars->25->357"
1474 + "default.handlebars->27->341",
1475 + "default.handlebars->27->357"
1476 ]
1477 },
1478 {
@@ -1503,7 +1503,7 @@
1503 "ru": "7-дневная статистика работы",
1504 "zh-chs": "7天電源狀態",
1505 "xloc": [
1506 - "default.handlebars->25->637"
1506 + "default.handlebars->27->641"
1507 ]
1508 },
1509 {
@@ -1556,8 +1556,8 @@
1556 "ru": "8 часов",
1557 "zh-chs": "8小時",
1558 "xloc": [
1559 - "default.handlebars->25->304",
1560 - "default.handlebars->25->318"
1559 + "default.handlebars->27->304",
1560 + "default.handlebars->27->318"
1561 ]
1562 },
1563 {
@@ -1640,7 +1640,7 @@
1640 "ru": "<a href=\\\"https://www.yubico.com/\\\" rel=\\\"noreferrer noopener\\\" target=\\\"_blank\\\">Аппаратные ключи</a> используются в качестве дополнительной аутентификации.",
1641 "zh-chs": "<a href=\\\"https://www.yubico.com/\\\" rel=\\\"noreferrer noopener\\\" target=\\\"_blank\\\">硬件密鑰</a>用作輔助登錄身份驗證。",
1642 "xloc": [
1643 - "default.handlebars->25->126"
1643 + "default.handlebars->27->126"
1644 ]
1645 },
1646 {
@@ -1743,7 +1743,7 @@
1743 "zh-chs": "ACM",
1744 "xloc": [
1745 "default-mobile.handlebars->9->224",
1746 - "default.handlebars->25->493"
1746 + "default.handlebars->27->495"
1747 ]
1748 },
1749 {
@@ -1760,8 +1760,8 @@
1760 "ru": "AMT",
1761 "zh-chs": "AMT",
1762 "xloc": [
1763 - "default.handlebars->25->183",
1764 - "default.handlebars->25->389"
1763 + "default.handlebars->27->183",
1764 + "default.handlebars->27->389"
1765 ]
1766 },
1767 {
@@ -1779,7 +1779,7 @@
1779 "zh-chs": "ARM-Linaro",
1780 "xloc": [
1781 "default-mobile.handlebars->9->30",
1782 - "default.handlebars->25->37"
1782 + "default.handlebars->27->37"
1783 ]
1784 },
1785 {
@@ -1797,7 +1797,7 @@
1797 "zh-chs": "ARMv6l / ARMv7l",
1798 "xloc": [
1799 "default-mobile.handlebars->9->31",
1800 - "default.handlebars->25->38"
1800 + "default.handlebars->27->38"
1801 ]
1802 },
1803 {
@@ -1815,7 +1815,7 @@
1815 "zh-chs": "ARMv6l / ARMv7l / NoKVM",
1816 "xloc": [
1817 "default-mobile.handlebars->9->33",
1818 - "default.handlebars->25->40"
1818 + "default.handlebars->27->40"
1819 ]
1820 },
1821 {
@@ -1833,7 +1833,7 @@
1833 "zh-chs": "ARMv8 64位",
1834 "xloc": [
1835 "default-mobile.handlebars->9->32",
1836 - "default.handlebars->25->39"
1836 + "default.handlebars->27->39"
1837 ]
1838 },
1839 {
@@ -1850,7 +1850,7 @@
1850 "ru": "Отказано в доступе",
1851 "zh-chs": "拒絕訪問",
1852 "xloc": [
1853 - "default.handlebars->25->859"
1853 + "default.handlebars->27->863"
1854 ]
1855 },
1856 {
@@ -1885,7 +1885,7 @@
1885 "ru": "Доступ к файлам сервера",
1886 "zh-chs": "訪問服務器文件",
1887 "xloc": [
1888 - "default.handlebars->25->1583"
1888 + "default.handlebars->27->1587"
1889 ]
1890 },
1891 {
@@ -1960,10 +1960,10 @@
1960 "default-mobile.handlebars->9->93",
1961 "default-mobile.handlebars->9->95",
1962 "default-mobile.handlebars->container->page_content->column_l->p3->p3info->1->p3AccountActions->p2AccountSecurity->1->0",
1963 - "default.handlebars->25->1124",
1964 - "default.handlebars->25->1126",
1965 - "default.handlebars->25->462",
1966 - "default.handlebars->25->464"
1963 + "default.handlebars->27->1128",
1964 + "default.handlebars->27->1130",
1965 + "default.handlebars->27->464",
1966 + "default.handlebars->27->466"
1967 ]
1968 },
1969 {
@@ -2009,8 +2009,8 @@
2009 "ru": "Аккаунт заблокирован",
2010 "zh-chs": "帐户已被锁定",
2011 "xloc": [
2012 - "default.handlebars->25->1444",
2013 - "default.handlebars->25->1580"
2012 + "default.handlebars->27->1448",
2013 + "default.handlebars->27->1584"
2014 ]
2015 },
2016 {
@@ -2098,7 +2098,7 @@
2098 "ru": "Действиe",
2099 "zh-chs": "行動",
2100 "xloc": [
2101 - "default.handlebars->25->864",
2101 + "default.handlebars->27->868",
2102 "default.handlebars->container->column_l->p42->p42tbl->1->0->8"
2103 ]
2104 },
@@ -2116,8 +2116,8 @@
2116 "ru": "Файл действий",
2117 "zh-chs": "動作文件",
2118 "xloc": [
2119 - "default.handlebars->25->680",
2120 - "default.handlebars->25->682"
2119 + "default.handlebars->27->684",
2120 + "default.handlebars->27->686"
2121 ]
2122 },
2123 {
@@ -2137,7 +2137,7 @@
2137 "default-mobile.handlebars->9->241",
2138 "default-mobile.handlebars->container->page_content->column_l->p10->p10desktop->deskarea4->1->3",
2139 "default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->0->1->1",
2140 - "default.handlebars->25->538",
2140 + "default.handlebars->27->540",
2141 "default.handlebars->container->column_l->p11->deskarea0->deskarea1->1",
2142 "default.handlebars->container->column_l->p12->termTable->1->1->0->1->1",
2143 "default.handlebars->container->column_l->p13->p13toolbar->1->0->1->1"
@@ -2194,9 +2194,9 @@
2194 "default-mobile.handlebars->9->219",
2195 "default-mobile.handlebars->9->221",
2196 "default-mobile.handlebars->9->344",
2197 - "default.handlebars->25->486",
2198 - "default.handlebars->25->488",
2199 - "default.handlebars->25->822"
2197 + "default.handlebars->27->488",
2198 + "default.handlebars->27->490",
2199 + "default.handlebars->27->826"
2200 ]
2201 },
2202 {
@@ -2213,10 +2213,10 @@
2213 "ru": "Активация",
2214 "zh-chs": "激活",
2215 "xloc": [
2216 - "default.handlebars->25->1202",
2217 - "default.handlebars->25->1204",
2218 - "default.handlebars->25->238",
2219 - "default.handlebars->25->240"
2216 + "default.handlebars->27->1206",
2217 + "default.handlebars->27->1208",
2218 + "default.handlebars->27->238",
2219 + "default.handlebars->27->240"
2220 ]
2221 },
2222 {
@@ -2233,7 +2233,7 @@
2233 "ru": "Активный пользователь",
2234 "zh-chs": "活動用戶{0}",
2235 "xloc": [
2236 - "default.handlebars->25->513"
2236 + "default.handlebars->27->515"
2237 ]
2238 },
2239 {
@@ -2250,8 +2250,8 @@
2250 "ru": "Добавить агент",
2251 "zh-chs": "添加代理",
2252 "xloc": [
2253 - "default.handlebars->25->1206",
2254 - "default.handlebars->25->242"
2253 + "default.handlebars->27->1210",
2254 + "default.handlebars->27->242"
2255 ]
2256 },
2257 {
@@ -2268,7 +2268,7 @@
2268 "ru": "Добавить CIRA",
2269 "zh-chs": "添加CIRA",
2270 "xloc": [
2271 - "default.handlebars->25->232"
2271 + "default.handlebars->27->232"
2272 ]
2273 },
2274 {
@@ -2285,8 +2285,8 @@
2285 "ru": "Добавить устройство",
2286 "zh-chs": "添加設備",
2287 "xloc": [
2288 - "default.handlebars->25->1557",
2289 - "default.handlebars->25->1676"
2288 + "default.handlebars->27->1561",
2289 + "default.handlebars->27->1680"
2290 ]
2291 },
2292 {
@@ -2303,7 +2303,7 @@
2303 "ru": "Добавить событие к устройству",
2304 "zh-chs": "添加設備事件",
2305 "xloc": [
2306 - "default.handlebars->25->618"
2306 + "default.handlebars->27->622"
2307 ]
2308 },
2309 {
@@ -2320,10 +2320,10 @@
2320 "ru": "Добавить группу устройств",
2321 "zh-chs": "添加設備組",
2322 "xloc": [
2323 - "default.handlebars->25->1296",
2324 - "default.handlebars->25->1551",
2325 - "default.handlebars->25->1664",
2326 - "default.handlebars->25->200"
2323 + "default.handlebars->27->1300",
2324 + "default.handlebars->27->1555",
2325 + "default.handlebars->27->1668",
2326 + "default.handlebars->27->200"
2327 ]
2328 },
2329 {
@@ -2337,7 +2337,7 @@
2337 "nl": "Machtigingen voor apparaatgroep toevoegen",
2338 "zh-chs": "添加设备组权限",
2339 "xloc": [
2340 - "default.handlebars->25->1293"
2340 + "default.handlebars->27->1297"
2341 ]
2342 },
2343 {
@@ -2353,8 +2353,8 @@
2353 "ru": "Добавить разрешения для устройства",
2354 "zh-chs": "添加设备权限",
2355 "xloc": [
2356 - "default.handlebars->25->1298",
2357 - "default.handlebars->25->1300"
2356 + "default.handlebars->27->1302",
2357 + "default.handlebars->27->1304"
2358 ]
2359 },
2360 {
@@ -2371,7 +2371,7 @@
2371 "ru": "Добавить Intel&reg; AMT CIRA устройство",
2372 "zh-chs": "添加英特爾&reg;AMT CIRA設備",
2373 "xloc": [
2374 - "default.handlebars->25->288"
2374 + "default.handlebars->27->288"
2375 ]
2376 },
2377 {
@@ -2388,7 +2388,7 @@
2388 "ru": "Добавить Intel&reg; AMT устройство",
2389 "zh-chs": "添加英特爾&reg;AMT設備",
2390 "xloc": [
2391 - "default.handlebars->25->255"
2391 + "default.handlebars->27->255"
2392 ]
2393 },
2394 {
@@ -2405,7 +2405,7 @@
2405 "ru": "Добавить ключ",
2406 "zh-chs": "新增金鑰",
2407 "xloc": [
2408 - "default.handlebars->25->130"
2408 + "default.handlebars->27->130"
2409 ]
2410 },
2411 {
@@ -2422,7 +2422,7 @@
2422 "ru": "Добавить локально",
2423 "zh-chs": "添加本地",
2424 "xloc": [
2425 - "default.handlebars->25->234"
2425 + "default.handlebars->27->234"
2426 ]
2427 },
2428 {
@@ -2439,7 +2439,7 @@
2439 "ru": "Добавить участие",
2440 "zh-chs": "添加會員",
2441 "xloc": [
2442 - "default.handlebars->25->1694"
2442 + "default.handlebars->27->1698"
2443 ]
2444 },
2445 {
@@ -2456,7 +2456,7 @@
2456 "ru": "Добавить Mesh Agent",
2457 "zh-chs": "添加網格代理",
2458 "xloc": [
2459 - "default.handlebars->25->360"
2459 + "default.handlebars->27->360"
2460 ]
2461 },
2462 {
@@ -2473,12 +2473,12 @@
2473 "ru": "Добавить ключ безопасности",
2474 "zh-chs": "添加安全密鑰",
2475 "xloc": [
2476 - "default.handlebars->25->133",
2477 - "default.handlebars->25->135",
2478 - "default.handlebars->25->138",
2479 - "default.handlebars->25->139",
2480 - "default.handlebars->25->892",
2481 - "default.handlebars->25->893"
2476 + "default.handlebars->27->133",
2477 + "default.handlebars->27->135",
2478 + "default.handlebars->27->138",
2479 + "default.handlebars->27->139",
2480 + "default.handlebars->27->896",
2481 + "default.handlebars->27->897"
2482 ]
2483 },
2484 {
@@ -2496,7 +2496,7 @@
2496 "zh-chs": "添加用戶",
2497 "xloc": [
2498 "default-mobile.handlebars->9->384",
2499 - "default.handlebars->25->575"
2499 + "default.handlebars->27->579"
2500 ]
2501 },
2502 {
@@ -2512,7 +2512,7 @@
2512 "ru": "Добавить разрешения для пользовательских устройств",
2513 "zh-chs": "添加用户设备权限",
2514 "xloc": [
2515 - "default.handlebars->25->1303"
2515 + "default.handlebars->27->1307"
2516 ]
2517 },
2518 {
@@ -2529,10 +2529,10 @@
2529 "ru": "Добавить группу пользователей",
2530 "zh-chs": "添加用戶組",
2531 "xloc": [
2532 - "default.handlebars->25->1196",
2533 - "default.handlebars->25->1295",
2534 - "default.handlebars->25->1670",
2535 - "default.handlebars->25->576"
2532 + "default.handlebars->27->1200",
2533 + "default.handlebars->27->1299",
2534 + "default.handlebars->27->1674",
2535 + "default.handlebars->27->580"
2536 ]
2537 },
2538 {
@@ -2546,7 +2546,7 @@
2546 "nl": "Gebruikersmachtigingen voor apparaatgroep toevoegen",
2547 "zh-chs": "添加用户组设备权限",
2548 "xloc": [
2549 - "default.handlebars->25->1305"
2549 + "default.handlebars->27->1309"
2550 ]
2551 },
2552 {
@@ -2591,8 +2591,8 @@
2591 "ru": "Добавить пользователей",
2592 "zh-chs": "添加用戶",
2593 "xloc": [
2594 - "default.handlebars->25->1195",
2595 - "default.handlebars->25->1546"
2594 + "default.handlebars->27->1199",
2595 + "default.handlebars->27->1550"
2596 ]
2597 },
2598 {
@@ -2609,7 +2609,7 @@
2609 "ru": "Добавить пользователей в группу устройств",
2610 "zh-chs": "將用戶添加到設備組",
2611 "xloc": [
2612 - "default.handlebars->25->1292"
2612 + "default.handlebars->27->1296"
2613 ]
2614 },
2615 {
@@ -2626,7 +2626,7 @@
2626 "ru": "Добавить пользователей в группу",
2627 "zh-chs": "將用戶添加到用戶組",
2628 "xloc": [
2629 - "default.handlebars->25->1579"
2629 + "default.handlebars->27->1583"
2630 ]
2631 },
2632 {
@@ -2643,7 +2643,7 @@
2643 "ru": "Добавить YubiKey&reg; OTP",
2644 "zh-chs": "添加YubiKey&reg;OTP",
2645 "xloc": [
2646 - "default.handlebars->25->131"
2646 + "default.handlebars->27->131"
2647 ]
2648 },
2649 {
@@ -2660,7 +2660,7 @@
2660 "ru": "Добавить новый Intel&reg; AMT компьютер сканированием локальной сети.",
2661 "zh-chs": "通過掃描本地網絡添加新的英特爾&reg;AMT計算機。",
2662 "xloc": [
2663 - "default.handlebars->25->235"
2663 + "default.handlebars->27->235"
2664 ]
2665 },
2666 {
@@ -2677,8 +2677,8 @@
2677 "ru": "Добавить новый Intel&reg; AMT компьютер, находящийся в интернете.",
2678 "zh-chs": "添加位於互聯網上的新英特爾&reg;AMT計算機。",
2679 "xloc": [
2680 - "default.handlebars->25->1197",
2681 - "default.handlebars->25->231"
2680 + "default.handlebars->27->1201",
2681 + "default.handlebars->27->231"
2682 ]
2683 },
2684 {
@@ -2695,8 +2695,8 @@
2695 "ru": "Добавить новый Intel&reg; AMT компьютер, находящийся в локальной сети.",
2696 "zh-chs": "添加位於本地網絡上的新英特爾&reg;AMT計算機。",
2697 "xloc": [
2698 - "default.handlebars->25->1199",
2699 - "default.handlebars->25->233"
2698 + "default.handlebars->27->1203",
2699 + "default.handlebars->27->233"
2700 ]
2701 },
2702 {
@@ -2713,7 +2713,7 @@
2713 "ru": "Добавить новое Intel&reg; AMT устройство к группе устройств \\\"{0}\\\".",
2714 "zh-chs": "將新的英特爾&reg;AMT設備添加到設備組“{0}”。",
2715 "xloc": [
2716 - "default.handlebars->25->245"
2716 + "default.handlebars->27->245"
2717 ]
2718 },
2719 {
@@ -2727,8 +2727,8 @@
2727 "nl": "Voeg een nieuwe computer toe aan deze apparaatgroep door de mesh-agent te installeren.",
2728 "zh-chs": "通过安装网状代理,将新计算机添加到该设备组。",
2729 "xloc": [
2730 - "default.handlebars->25->1205",
2731 - "default.handlebars->25->241"
2730 + "default.handlebars->27->1209",
2731 + "default.handlebars->27->241"
2732 ]
2733 },
2734 {
@@ -2745,7 +2745,7 @@
2745 "ru": "Адрес",
2746 "zh-chs": "地址",
2747 "xloc": [
2748 - "default.handlebars->25->196"
2748 + "default.handlebars->27->196"
2749 ]
2750 },
2751 {
@@ -2780,7 +2780,7 @@
2780 "zh-chs": "管理員控制模式(ACM)",
2781 "xloc": [
2782 "default-mobile.handlebars->9->346",
2783 - "default.handlebars->25->824"
2783 + "default.handlebars->27->828"
2784 ]
2785 },
2786 {
@@ -2798,7 +2798,7 @@
2798 "zh-chs": "管理員憑證",
2799 "xloc": [
2800 "default-mobile.handlebars->9->352",
2801 - "default.handlebars->25->830"
2801 + "default.handlebars->27->834"
2802 ]
2803 },
2804 {
@@ -2833,7 +2833,7 @@
2833 "ru": "Области администратора",
2834 "zh-chs": "管理領域",
2835 "xloc": [
2836 - "default.handlebars->25->1612"
2836 + "default.handlebars->27->1616"
2837 ]
2838 },
2839 {
@@ -2868,7 +2868,7 @@
2868 "ru": "Административные области",
2869 "zh-chs": "行政領域",
2870 "xloc": [
2871 - "default.handlebars->25->1497"
2871 + "default.handlebars->27->1501"
2872 ]
2873 },
2874 {
@@ -2885,7 +2885,7 @@
2885 "ru": "Администратор",
2886 "zh-chs": "管理員",
2887 "xloc": [
2888 - "default.handlebars->25->1436"
2888 + "default.handlebars->27->1440"
2889 ]
2890 },
2891 {
@@ -2902,7 +2902,7 @@
2902 "ru": "Африканский",
2903 "zh-chs": "南非語",
2904 "xloc": [
2905 - "default.handlebars->25->895"
2905 + "default.handlebars->27->899"
2906 ]
2907 },
2908 {
@@ -2922,10 +2922,10 @@
2922 "default-mobile.handlebars->9->192",
2923 "default-mobile.handlebars->9->216",
2924 "default-mobile.handlebars->9->232",
2925 - "default.handlebars->25->1357",
2926 - "default.handlebars->25->1365",
2927 - "default.handlebars->25->179",
2928 - "default.handlebars->25->385",
2925 + "default.handlebars->27->1361",
2926 + "default.handlebars->27->1369",
2927 + "default.handlebars->27->179",
2928 + "default.handlebars->27->385",
2929 "default.handlebars->container->column_l->p15->consoleTable->1->6->1->1->1->0->p15outputselecttd->p15outputselect->1"
2930 ]
2931 },
@@ -2943,8 +2943,8 @@
2943 "ru": "Агент + Intel AMT",
2944 "zh-chs": "代理+英特爾AMT",
2945 "xloc": [
2946 - "default.handlebars->25->1359",
2947 - "default.handlebars->25->1367"
2946 + "default.handlebars->27->1363",
2947 + "default.handlebars->27->1371"
2948 ]
2949 },
2950 {
@@ -2979,7 +2979,7 @@
2979 "zh-chs": "代理控制台",
2980 "xloc": [
2981 "default-mobile.handlebars->9->419",
2982 - "default.handlebars->25->1313"
2982 + "default.handlebars->27->1317"
2983 ]
2984 },
2985 {
@@ -2996,7 +2996,7 @@
2996 "ru": "Счетчик ошибок агента",
2997 "zh-chs": "座席錯誤計數器",
2998 "xloc": [
2999 - "default.handlebars->25->1735"
2999 + "default.handlebars->27->1739"
3000 ]
3001 },
3002 {
@@ -3065,7 +3065,7 @@
3065 "ru": "Сессии агентов",
3066 "zh-chs": "座席會議",
3067 "xloc": [
3068 - "default.handlebars->25->1751"
3068 + "default.handlebars->27->1755"
3069 ]
3070 },
3071 {
@@ -3083,7 +3083,7 @@
3083 "zh-chs": "代理商標籤",
3084 "xloc": [
3085 "default-mobile.handlebars->9->231",
3086 - "default.handlebars->25->506"
3086 + "default.handlebars->27->508"
3087 ]
3088 },
3089 {
@@ -3100,7 +3100,7 @@
3100 "ru": "Типы агента",
3101 "zh-chs": "代理類型",
3102 "xloc": [
3103 - "default.handlebars->25->1363",
3103 + "default.handlebars->27->1367",
3104 "default.handlebars->container->column_l->p21->3->1->meshOsChartDiv->1"
3105 ]
3106 },
@@ -3118,9 +3118,9 @@
3118 "ru": "Агент подключен",
3119 "zh-chs": "代理已連接",
3120 "xloc": [
3121 - "default.handlebars->25->144",
3122 - "default.handlebars->25->566",
3123 - "default.handlebars->25->567"
3121 + "default.handlebars->27->144",
3122 + "default.handlebars->27->570",
3123 + "default.handlebars->27->571"
3124 ]
3125 },
3126 {
@@ -3137,7 +3137,7 @@
3137 "ru": "Агент отключился",
3138 "zh-chs": "代理已斷開連接",
3139 "xloc": [
3140 - "default.handlebars->25->148"
3140 + "default.handlebars->27->148"
3141 ]
3142 },
3143 {
@@ -3154,7 +3154,7 @@
3154 "ru": "Агент оффлайн",
3155 "zh-chs": "代理離線",
3156 "xloc": [
3157 - "default.handlebars->25->857"
3157 + "default.handlebars->27->861"
3158 ]
3159 },
3160 {
@@ -3171,7 +3171,7 @@
3171 "ru": "Агент онлайн",
3172 "zh-chs": "代理在線",
3173 "xloc": [
3174 - "default.handlebars->25->856"
3174 + "default.handlebars->27->860"
3175 ]
3176 },
3177 {
@@ -3188,7 +3188,7 @@
3188 "ru": "Агенты",
3189 "zh-chs": "代理商",
3190 "xloc": [
3191 - "default.handlebars->25->1764"
3191 + "default.handlebars->27->1768"
3192 ]
3193 },
3194 {
@@ -3205,7 +3205,7 @@
3205 "ru": "Албанский",
3206 "zh-chs": "阿爾巴尼亞語",
3207 "xloc": [
3208 - "default.handlebars->25->896"
3208 + "default.handlebars->27->900"
3209 ]
3210 },
3211 {
@@ -3255,9 +3255,9 @@
3255 "ru": "Фокусирование всех",
3256 "zh-chs": "全部聚焦",
3257 "xloc": [
3258 - "default.handlebars->25->712",
3259 - "default.handlebars->25->714",
3260 - "default.handlebars->25->715"
3258 + "default.handlebars->27->716",
3259 + "default.handlebars->27->718",
3260 + "default.handlebars->27->719"
3261 ]
3262 },
3263 {
@@ -3274,8 +3274,8 @@
3274 "ru": "Разрешить пользователям управлять этой группой и устройствами этой группы.",
3275 "zh-chs": "允許用戶管理此設備組和該組中的設備。",
3276 "xloc": [
3277 - "default.handlebars->25->1262",
3278 - "default.handlebars->25->1576"
3277 + "default.handlebars->27->1266",
3278 + "default.handlebars->27->1580"
3279 ]
3280 },
3281 {
@@ -3291,7 +3291,7 @@
3291 "ru": "Разрешить пользователям управлять этим устройством.",
3292 "zh-chs": "允许用户管理此设备。",
3293 "xloc": [
3294 - "default.handlebars->25->1263"
3294 + "default.handlebars->27->1267"
3295 ]
3296 },
3297 {
@@ -3344,7 +3344,7 @@
3344 "ru": "Поменять (F10 = ESC+0)",
3345 "zh-chs": "備用(F10 = ESC + 0)",
3346 "xloc": [
3347 - "default.handlebars->25->747"
3347 + "default.handlebars->27->751"
3348 ]
3349 },
3350 {
@@ -3361,7 +3361,8 @@
3361 "ru": "Поменять порт",
3362 "zh-chs": "備用端口",
3363 "xloc": [
3364 - "default.handlebars->altPortContextMenu->1"
3364 + "default.handlebars->altPortContextMenu->1",
3365 + "default.handlebars->rfbPortContextMenu->1"
3366 ]
3367 },
3368 {
@@ -3378,9 +3379,9 @@
3379 "ru": "Всегда уведомлять",
3380 "zh-chs": "始終通知",
3381 "xloc": [
3381 - "default.handlebars->25->1176",
3382 - "default.handlebars->25->1621",
3383 - "default.handlebars->25->522"
3382 + "default.handlebars->27->1180",
3383 + "default.handlebars->27->1625",
3384 + "default.handlebars->27->524"
3385 ]
3386 },
3387 {
@@ -3397,9 +3398,9 @@
3398 "ru": "Всегда запрашивать",
3399 "zh-chs": "總是提示",
3400 "xloc": [
3400 - "default.handlebars->25->1177",
3401 - "default.handlebars->25->1622",
3402 - "default.handlebars->25->523"
3401 + "default.handlebars->27->1181",
3402 + "default.handlebars->27->1626",
3403 + "default.handlebars->27->525"
3404 ]
3405 },
3406 {
@@ -3460,7 +3461,7 @@
3461 "zh-chs": "Android APK",
3462 "xloc": [
3463 "default-mobile.handlebars->9->20",
3463 - "default.handlebars->25->27"
3464 + "default.handlebars->27->27"
3465 ]
3466 },
3467 {
@@ -3478,7 +3479,7 @@
3479 "zh-chs": "Android ARM",
3480 "xloc": [
3481 "default-mobile.handlebars->9->15",
3481 - "default.handlebars->25->22"
3482 + "default.handlebars->27->22"
3483 ]
3484 },
3485 {
@@ -3496,7 +3497,7 @@
3497 "zh-chs": "安卓x86",
3498 "xloc": [
3499 "default-mobile.handlebars->9->18",
3499 - "default.handlebars->25->25"
3500 + "default.handlebars->27->25"
3501 ]
3502 },
3503 {
@@ -3513,7 +3514,7 @@
3514 "ru": "Антивирус",
3515 "zh-chs": "防毒軟件",
3516 "xloc": [
3516 - "default.handlebars->25->512"
3517 + "default.handlebars->27->514"
3518 ]
3519 },
3520 {
@@ -3530,7 +3531,7 @@
3531 "ru": "Любые поддерживаемые",
3532 "zh-chs": "任何支持",
3533 "xloc": [
3533 - "default.handlebars->25->298"
3534 + "default.handlebars->27->298"
3535 ]
3536 },
3537 {
@@ -3547,7 +3548,7 @@
3548 "ru": "Apple MacOS",
3549 "zh-chs": "蘋果MacOS",
3550 "xloc": [
3550 - "default.handlebars->25->328"
3551 + "default.handlebars->27->328"
3552 ]
3553 },
3554 {
@@ -3564,7 +3565,7 @@
3565 "ru": "Только Apple MacOS",
3566 "zh-chs": "僅限Apple MacOS",
3567 "xloc": [
3567 - "default.handlebars->25->300"
3568 + "default.handlebars->27->300"
3569 ]
3570 },
3571 {
@@ -3598,7 +3599,7 @@
3599 "ru": "Арабский (Алжир)",
3600 "zh-chs": "阿拉伯文(阿爾及利亞)",
3601 "xloc": [
3601 - "default.handlebars->25->898"
3602 + "default.handlebars->27->902"
3603 ]
3604 },
3605 {
@@ -3615,7 +3616,7 @@
3616 "ru": "Арабский (Бахрейн)",
3617 "zh-chs": "阿拉伯文(巴林)",
3618 "xloc": [
3618 - "default.handlebars->25->899"
3619 + "default.handlebars->27->903"
3620 ]
3621 },
3622 {
@@ -3632,7 +3633,7 @@
3633 "ru": "Арабский (Египет)",
3634 "zh-chs": "阿拉伯文(埃及)",
3635 "xloc": [
3635 - "default.handlebars->25->900"
3636 + "default.handlebars->27->904"
3637 ]
3638 },
3639 {
@@ -3649,7 +3650,7 @@
3650 "ru": "Арабский (Ирак)",
3651 "zh-chs": "阿拉伯文(伊拉克)",
3652 "xloc": [
3652 - "default.handlebars->25->901"
3653 + "default.handlebars->27->905"
3654 ]
3655 },
3656 {
@@ -3666,7 +3667,7 @@
3667 "ru": "Арабский (Иордания)",
3668 "zh-chs": "阿拉伯語(約旦)",
3669 "xloc": [
3669 - "default.handlebars->25->902"
3670 + "default.handlebars->27->906"
3671 ]
3672 },
3673 {
@@ -3683,7 +3684,7 @@
3684 "ru": "Арабский (Кувейт)",
3685 "zh-chs": "阿拉伯文(科威特)",
3686 "xloc": [
3686 - "default.handlebars->25->903"
3687 + "default.handlebars->27->907"
3688 ]
3689 },
3690 {
@@ -3700,7 +3701,7 @@
3701 "ru": "Арабский (Ливан)",
3702 "zh-chs": "阿拉伯語(黎巴嫩)",
3703 "xloc": [
3703 - "default.handlebars->25->904"
3704 + "default.handlebars->27->908"
3705 ]
3706 },
3707 {
@@ -3717,7 +3718,7 @@
3718 "ru": "Арабский (Ливия)",
3719 "zh-chs": "阿拉伯文(利比亞)",
3720 "xloc": [
3720 - "default.handlebars->25->905"
3721 + "default.handlebars->27->909"
3722 ]
3723 },
3724 {
@@ -3734,7 +3735,7 @@
3735 "ru": "Арабский (Марокко)",
3736 "zh-chs": "阿拉伯文(摩洛哥)",
3737 "xloc": [
3737 - "default.handlebars->25->906"
3738 + "default.handlebars->27->910"
3739 ]
3740 },
3741 {
@@ -3751,7 +3752,7 @@
3752 "ru": "Арабский (Оман)",
3753 "zh-chs": "阿拉伯文(阿曼)",
3754 "xloc": [
3754 - "default.handlebars->25->907"
3755 + "default.handlebars->27->911"
3756 ]
3757 },
3758 {
@@ -3768,7 +3769,7 @@
3769 "ru": "Арабский (Катар)",
3770 "zh-chs": "阿拉伯語(卡塔爾)",
3771 "xloc": [
3771 - "default.handlebars->25->908"
3772 + "default.handlebars->27->912"
3773 ]
3774 },
3775 {
@@ -3785,7 +3786,7 @@
3786 "ru": "Арабский (Саудовская Аравия)",
3787 "zh-chs": "阿拉伯語(沙特阿拉伯)",
3788 "xloc": [
3788 - "default.handlebars->25->909"
3789 + "default.handlebars->27->913"
3790 ]
3791 },
3792 {
@@ -3802,7 +3803,7 @@
3803 "ru": "Арабский (стандартный)",
3804 "zh-chs": "阿拉伯語(標準)",
3805 "xloc": [
3805 - "default.handlebars->25->897"
3806 + "default.handlebars->27->901"
3807 ]
3808 },
3809 {
@@ -3819,7 +3820,7 @@
3820 "ru": "Арабский (Сирия)",
3821 "zh-chs": "阿拉伯語(敘利亞)",
3822 "xloc": [
3822 - "default.handlebars->25->910"
3823 + "default.handlebars->27->914"
3824 ]
3825 },
3826 {
@@ -3836,7 +3837,7 @@
3837 "ru": "Арабский (Тунис)",
3838 "zh-chs": "阿拉伯文(突尼斯)",
3839 "xloc": [
3839 - "default.handlebars->25->911"
3840 + "default.handlebars->27->915"
3841 ]
3842 },
3843 {
@@ -3853,7 +3854,7 @@
3854 "ru": "Арабский (О.А.Э.)",
3855 "zh-chs": "阿拉伯文(阿聯酋)",
3856 "xloc": [
3856 - "default.handlebars->25->912"
3857 + "default.handlebars->27->916"
3858 ]
3859 },
3860 {
@@ -3870,7 +3871,7 @@
3871 "ru": "Арабский (Йемен)",
3872 "zh-chs": "阿拉伯文(也門)",
3873 "xloc": [
3873 - "default.handlebars->25->913"
3874 + "default.handlebars->27->917"
3875 ]
3876 },
3877 {
@@ -3887,7 +3888,7 @@
3888 "ru": "Арагонский",
3889 "zh-chs": "阿拉貢人",
3890 "xloc": [
3890 - "default.handlebars->25->914"
3891 + "default.handlebars->27->918"
3892 ]
3893 },
3894 {
@@ -3905,7 +3906,7 @@
3906 "zh-chs": "建築",
3907 "xloc": [
3908 "default-mobile.handlebars->9->320",
3908 - "default.handlebars->25->798"
3909 + "default.handlebars->27->802"
3910 ]
3911 },
3912 {
@@ -3922,7 +3923,7 @@
3923 "ru": "Вы действительно хотите подключиться к {0} устройствам?",
3924 "zh-chs": "您確定要連接到{0}設備嗎?",
3925 "xloc": [
3925 - "default.handlebars->25->226"
3926 + "default.handlebars->27->226"
3927 ]
3928 },
3929 {
@@ -3940,7 +3941,7 @@
3941 "zh-chs": "您確定要刪除組{0}嗎?刪除設備組還將刪除該組中有關設備的所有信息。",
3942 "xloc": [
3943 "default-mobile.handlebars->9->390",
3943 - "default.handlebars->25->1240"
3944 + "default.handlebars->27->1244"
3945 ]
3946 },
3947 {
@@ -3957,7 +3958,7 @@
3958 "ru": "Вы действительно хотите удалить устройство \\\"{0}\\\"?",
3959 "zh-chs": "您確定要刪除節點{0}嗎?",
3960 "xloc": [
3960 - "default.handlebars->25->659"
3961 + "default.handlebars->27->663"
3962 ]
3963 },
3964 {
@@ -3974,7 +3975,7 @@
3975 "ru": "Вы действительно хотите деинсталировать выбранного агента?",
3976 "zh-chs": "您確定要卸載所選代理嗎?",
3977 "xloc": [
3977 - "default.handlebars->25->648"
3978 + "default.handlebars->27->652"
3979 ]
3980 },
3981 {
@@ -3991,7 +3992,7 @@
3992 "ru": "Вы действительно хотите деинсталлировать выбранных {0} агентов?",
3993 "zh-chs": "您確定要卸載所選的{0}代理嗎?",
3994 "xloc": [
3994 - "default.handlebars->25->647"
3995 + "default.handlebars->27->651"
3996 ]
3997 },
3998 {
@@ -4008,7 +4009,7 @@
4009 "ru": "Вы уверенны, что {0} плагин: {1}",
4010 "zh-chs": "您確定要{0}插件嗎:{1}",
4011 "xloc": [
4011 - "default.handlebars->25->1804"
4012 + "default.handlebars->27->1808"
4013 ]
4014 },
4015 {
@@ -4025,7 +4026,7 @@
4026 "ru": "Армянский",
4027 "zh-chs": "亞美尼亞人",
4028 "xloc": [
4028 - "default.handlebars->25->915"
4029 + "default.handlebars->27->919"
4030 ]
4031 },
4032 {
@@ -4070,7 +4071,7 @@
4071 "ru": "Ассамский",
4072 "zh-chs": "阿薩姆語",
4073 "xloc": [
4073 - "default.handlebars->25->916"
4074 + "default.handlebars->27->920"
4075 ]
4076 },
4077 {
@@ -4087,7 +4088,7 @@
4088 "ru": "Астурии",
4089 "zh-chs": "阿斯圖里亞斯人",
4090 "xloc": [
4090 - "default.handlebars->25->917"
4091 + "default.handlebars->27->921"
4092 ]
4093 },
4094 {
@@ -4104,7 +4105,7 @@
4105 "ru": "Приложение аутентификации",
4106 "zh-chs": "身份驗證應用",
4107 "xloc": [
4107 - "default.handlebars->25->1625"
4108 + "default.handlebars->27->1629"
4109 ]
4110 },
4111 {
@@ -4125,10 +4126,10 @@
4126 "default-mobile.handlebars->9->52",
4127 "default-mobile.handlebars->9->71",
4128 "default-mobile.handlebars->9->73",
4128 - "default.handlebars->25->109",
4129 - "default.handlebars->25->114",
4130 - "default.handlebars->25->881",
4131 - "default.handlebars->25->883"
4129 + "default.handlebars->27->109",
4130 + "default.handlebars->27->114",
4131 + "default.handlebars->27->885",
4132 + "default.handlebars->27->887"
4133 ]
4134 },
4135 {
@@ -4145,7 +4146,7 @@
4146 "ru": "Приложение для аутентификации активированно успешно.",
4147 "zh-chs": "身份驗證器應用程序激活成功。",
4148 "xloc": [
4148 - "default.handlebars->25->110"
4149 + "default.handlebars->27->110"
4150 ]
4151 },
4152 {
@@ -4162,7 +4163,7 @@
4163 "ru": "Приложение для аутентификации удалено.",
4164 "zh-chs": "身份驗證器應用程序已刪除。",
4165 "xloc": [
4165 - "default.handlebars->25->115"
4166 + "default.handlebars->27->115"
4167 ]
4168 },
4169 {
@@ -4196,7 +4197,7 @@
4197 "ru": "Автоудаление",
4198 "zh-chs": "自動刪除",
4199 "xloc": [
4199 - "default.handlebars->25->1164"
4200 + "default.handlebars->27->1168"
4201 ]
4202 },
4203 {
@@ -4250,7 +4251,7 @@
4251 "ru": "Азербайджанский",
4252 "zh-chs": "阿塞拜疆",
4253 "xloc": [
4253 - "default.handlebars->25->918"
4254 + "default.handlebars->27->922"
4255 ]
4256 },
4257 {
@@ -4268,7 +4269,7 @@
4269 "zh-chs": "的BIOS",
4270 "xloc": [
4271 "default-mobile.handlebars->9->358",
4271 - "default.handlebars->25->836"
4272 + "default.handlebars->27->840"
4273 ]
4274 },
4275 {
@@ -4348,7 +4349,7 @@
4349 "ru": "Фоновый и интерактивный",
4350 "zh-chs": "背景與互動",
4351 "xloc": [
4351 - "default.handlebars->25->332"
4352 + "default.handlebars->27->332"
4353 ]
4354 },
4355 {
@@ -4365,9 +4366,9 @@
4366 "ru": "Фоновый и интерактивный",
4367 "zh-chs": "背景與互動",
4368 "xloc": [
4368 - "default.handlebars->25->1340",
4369 - "default.handlebars->25->1347",
4370 - "default.handlebars->25->310"
4369 + "default.handlebars->27->1344",
4370 + "default.handlebars->27->1351",
4371 + "default.handlebars->27->310"
4372 ]
4373 },
4374 {
@@ -4384,10 +4385,10 @@
4385 "ru": "Только фоновый",
4386 "zh-chs": "僅背景",
4387 "xloc": [
4387 - "default.handlebars->25->1341",
4388 - "default.handlebars->25->1348",
4389 - "default.handlebars->25->311",
4390 - "default.handlebars->25->333"
4388 + "default.handlebars->27->1345",
4389 + "default.handlebars->27->1352",
4390 + "default.handlebars->27->311",
4391 + "default.handlebars->27->333"
4392 ]
4393 },
4394 {
@@ -4421,7 +4422,7 @@
4422 "ru": "Резервные коды",
4423 "zh-chs": "備用碼",
4424 "xloc": [
4424 - "default.handlebars->25->1627"
4425 + "default.handlebars->27->1631"
4426 ]
4427 },
4428 {
@@ -4438,7 +4439,7 @@
4439 "ru": "Плохой ключ",
4440 "zh-chs": "錯誤的簽名",
4441 "xloc": [
4441 - "default.handlebars->25->1742"
4442 + "default.handlebars->27->1746"
4443 ]
4444 },
4445 {
@@ -4455,7 +4456,7 @@
4456 "ru": "Плохой веб-сертификат",
4457 "zh-chs": "錯誤的網絡證書",
4458 "xloc": [
4458 - "default.handlebars->25->1741"
4459 + "default.handlebars->27->1745"
4460 ]
4461 },
4462 {
@@ -4472,7 +4473,7 @@
4473 "ru": "Баскский",
4474 "zh-chs": "巴斯克",
4475 "xloc": [
4475 - "default.handlebars->25->919"
4476 + "default.handlebars->27->923"
4477 ]
4478 },
4479 {
@@ -4506,7 +4507,7 @@
4507 "ru": "Белорусский",
4508 "zh-chs": "白俄羅斯語",
4509 "xloc": [
4509 - "default.handlebars->25->921"
4510 + "default.handlebars->27->925"
4511 ]
4512 },
4513 {
@@ -4523,7 +4524,7 @@
4524 "ru": "Бенгальский",
4525 "zh-chs": "孟加拉",
4526 "xloc": [
4526 - "default.handlebars->25->922"
4527 + "default.handlebars->27->926"
4528 ]
4529 },
4530 {
@@ -4559,7 +4560,7 @@
4560 "ru": "Боснийский",
4561 "zh-chs": "波斯尼亞人",
4562 "xloc": [
4562 - "default.handlebars->25->923"
4563 + "default.handlebars->27->927"
4564 ]
4565 },
4566 {
@@ -4576,7 +4577,7 @@
4577 "ru": "Бретонский",
4578 "zh-chs": "布列塔尼",
4579 "xloc": [
4579 - "default.handlebars->25->924"
4580 + "default.handlebars->27->928"
4581 ]
4582 },
4583 {
@@ -4593,7 +4594,7 @@
4594 "ru": "Отправить сообщение",
4595 "zh-chs": "廣播",
4596 "xloc": [
4596 - "default.handlebars->25->1544",
4597 + "default.handlebars->27->1548",
4598 "default.handlebars->container->column_l->p4->3->1->0->3->1"
4599 ]
4600 },
@@ -4611,7 +4612,7 @@
4612 "ru": "Отправить сообщение",
4613 "zh-chs": "廣播消息",
4614 "xloc": [
4614 - "default.handlebars->25->1479"
4615 + "default.handlebars->27->1483"
4616 ]
4617 },
4618 {
@@ -4628,7 +4629,7 @@
4629 "ru": "Отправить сообщение всем подключенным пользователям.",
4630 "zh-chs": "向所有連接的用戶廣播消息。",
4631 "xloc": [
4631 - "default.handlebars->25->1478"
4632 + "default.handlebars->27->1482"
4633 ]
4634 },
4635 {
@@ -4645,7 +4646,7 @@
4646 "ru": "Болгарский",
4647 "zh-chs": "保加利亞語",
4648 "xloc": [
4648 - "default.handlebars->25->920"
4649 + "default.handlebars->27->924"
4650 ]
4651 },
4652 {
@@ -4662,7 +4663,7 @@
4663 "ru": "Бирманский",
4664 "zh-chs": "緬甸人",
4665 "xloc": [
4665 - "default.handlebars->25->925"
4666 + "default.handlebars->27->929"
4667 ]
4668 },
4669 {
@@ -4680,7 +4681,7 @@
4681 "zh-chs": "CCM",
4682 "xloc": [
4683 "default-mobile.handlebars->9->223",
4683 - "default.handlebars->25->491"
4684 + "default.handlebars->27->493"
4685 ]
4686 },
4687 {
@@ -4698,10 +4699,10 @@
4699 "zh-chs": "CIRA",
4700 "xloc": [
4701 "default-mobile.handlebars->9->193",
4701 - "default.handlebars->25->1228",
4702 - "default.handlebars->25->1233",
4703 - "default.handlebars->25->181",
4704 - "default.handlebars->25->387"
4702 + "default.handlebars->27->1232",
4703 + "default.handlebars->27->1237",
4704 + "default.handlebars->27->181",
4705 + "default.handlebars->27->387"
4706 ]
4707 },
4708 {
@@ -4718,7 +4719,7 @@
4719 "ru": "CIRA Сервер",
4720 "zh-chs": "CIRA服務器",
4721 "xloc": [
4721 - "default.handlebars->25->1792"
4722 + "default.handlebars->27->1796"
4723 ]
4724 },
4725 {
@@ -4735,7 +4736,7 @@
4736 "ru": "CIRA Сервер команды",
4737 "zh-chs": "CIRA服務器命令",
4738 "xloc": [
4738 - "default.handlebars->25->1793"
4739 + "default.handlebars->27->1797"
4740 ]
4741 },
4742 {
@@ -4752,7 +4753,7 @@
4753 "zh-chs": "CPU",
4754 "xloc": [
4755 "default-mobile.handlebars->9->364",
4755 - "default.handlebars->25->842"
4756 + "default.handlebars->27->846"
4757 ]
4758 },
4759 {
@@ -4769,7 +4770,7 @@
4770 "ru": "Загрузка CPU",
4771 "zh-chs": "CPU負載",
4772 "xloc": [
4772 - "default.handlebars->25->1756"
4773 + "default.handlebars->27->1760"
4774 ]
4775 },
4776 {
@@ -4786,7 +4787,7 @@
4787 "ru": "Загрузка CPU за последние 15 минут",
4788 "zh-chs": "最近15分鐘的CPU負載",
4789 "xloc": [
4789 - "default.handlebars->25->1759"
4790 + "default.handlebars->27->1763"
4791 ]
4792 },
4793 {
@@ -4803,7 +4804,7 @@
4804 "ru": "Загрузка CPU за последние 5 минут",
4805 "zh-chs": "最近5分鐘的CPU負載",
4806 "xloc": [
4806 - "default.handlebars->25->1758"
4807 + "default.handlebars->27->1762"
4808 ]
4809 },
4810 {
@@ -4820,7 +4821,7 @@
4821 "ru": "Загрузка CPU за последнюю минуту",
4822 "zh-chs": "最後一分鐘的CPU負載",
4823 "xloc": [
4823 - "default.handlebars->25->1757"
4824 + "default.handlebars->27->1761"
4825 ]
4826 },
4827 {
@@ -4837,8 +4838,8 @@
4838 "ru": "CR+LF",
4839 "zh-chs": "CR +低頻",
4840 "xloc": [
4840 - "default.handlebars->25->740",
4841 - "default.handlebars->25->749",
4841 + "default.handlebars->27->744",
4842 + "default.handlebars->27->753",
4843 "default.handlebars->container->column_l->p12->termTable->1->1->6->1->1->terminalSettingsButtons"
4844 ]
4845 },
@@ -4856,9 +4857,9 @@
4857 "ru": "Формат CSV",
4858 "zh-chs": "CSV格式",
4859 "xloc": [
4859 - "default.handlebars->25->1411",
4860 - "default.handlebars->25->1470",
4861 - "default.handlebars->25->413"
4860 + "default.handlebars->27->1415",
4861 + "default.handlebars->27->1474",
4862 + "default.handlebars->27->413"
4863 ]
4864 },
4865 {
@@ -4875,7 +4876,7 @@
4876 "ru": "Ошибка вызова",
4877 "zh-chs": "通話錯誤",
4878 "xloc": [
4878 - "default.handlebars->25->1805"
4879 + "default.handlebars->27->1809"
4880 ]
4881 },
4882 {
@@ -4894,7 +4895,7 @@
4895 "xloc": [
4896 "default-mobile.handlebars->9->82",
4897 "default-mobile.handlebars->dialog->idx_dlgButtonBar",
4897 - "default.handlebars->25->1145",
4898 + "default.handlebars->27->1149",
4899 "default.handlebars->container->dialog->idx_dlgButtonBar",
4900 "login-mobile.handlebars->dialog->idx_dlgButtonBar",
4901 "login.handlebars->dialog->idx_dlgButtonBar",
@@ -4914,8 +4915,8 @@
4915 "xloc": [
4916 "default-mobile.handlebars->9->372",
4917 "default-mobile.handlebars->9->374",
4917 - "default.handlebars->25->850",
4918 - "default.handlebars->25->852"
4918 + "default.handlebars->27->854",
4919 + "default.handlebars->27->856"
4920 ]
4921 },
4922 {
@@ -4933,7 +4934,7 @@
4934 "zh-chs": "容量/速度",
4935 "xloc": [
4936 "default-mobile.handlebars->9->367",
4936 - "default.handlebars->25->845"
4937 + "default.handlebars->27->849"
4938 ]
4939 },
4940 {
@@ -4950,7 +4951,7 @@
4951 "ru": "Каталонский",
4952 "zh-chs": "加泰羅尼亞語",
4953 "xloc": [
4953 - "default.handlebars->25->926"
4954 + "default.handlebars->27->930"
4955 ]
4956 },
4957 {
@@ -4967,7 +4968,7 @@
4968 "ru": "Установить центр карты здесь",
4969 "zh-chs": "中心地圖在這裡",
4970 "xloc": [
4970 - "default.handlebars->25->453"
4971 + "default.handlebars->27->455"
4972 ]
4973 },
4974 {
@@ -4984,7 +4985,7 @@
4985 "ru": "Чаморро",
4986 "zh-chs": "查莫羅",
4987 "xloc": [
4987 - "default.handlebars->25->927"
4988 + "default.handlebars->27->931"
4989 ]
4990 },
4991 {
@@ -5015,7 +5016,7 @@
5016 "ru": "Смена email для {0}",
5017 "zh-chs": "更改{0}的電子郵件",
5018 "xloc": [
5018 - "default.handlebars->25->1653"
5019 + "default.handlebars->27->1657"
5020 ]
5021 },
5022 {
@@ -5032,9 +5033,9 @@
5033 "ru": "Смена группы",
5034 "zh-chs": "變更組",
5035 "xloc": [
5035 - "default.handlebars->25->547",
5036 - "default.handlebars->25->656",
5037 - "default.handlebars->25->657"
5036 + "default.handlebars->27->549",
5037 + "default.handlebars->27->660",
5038 + "default.handlebars->27->661"
5039 ]
5040 },
5041 {
@@ -5052,8 +5053,8 @@
5053 "zh-chs": "更改密碼",
5054 "xloc": [
5055 "default-mobile.handlebars->9->90",
5055 - "default.handlebars->25->1121",
5056 - "default.handlebars->25->1642"
5056 + "default.handlebars->27->1125",
5057 + "default.handlebars->27->1646"
5058 ]
5059 },
5060 {
@@ -5070,7 +5071,7 @@
5071 "ru": "Смена пароля для {0}",
5072 "zh-chs": "更改{0}的密碼",
5073 "xloc": [
5073 - "default.handlebars->25->1660"
5074 + "default.handlebars->27->1664"
5075 ]
5076 },
5077 {
@@ -5140,7 +5141,7 @@
5141 "ru": "Изменить пароль для этого пользователя",
5142 "zh-chs": "更改該用戶的密碼",
5143 "xloc": [
5143 - "default.handlebars->25->1641"
5144 + "default.handlebars->27->1645"
5145 ]
5146 },
5147 {
@@ -5174,7 +5175,7 @@
5175 "ru": "Измените адрес электронной почты вашей учетной записи здесь.",
5176 "zh-chs": "在此處更改您的帳戶電子郵件地址。",
5177 "xloc": [
5177 - "default.handlebars->25->1108"
5178 + "default.handlebars->27->1112"
5179 ]
5180 },
5181 {
@@ -5191,7 +5192,7 @@
5192 "ru": "Измените пароль своей учетной записи, введя старый пароль и дважды новый пароль в поля ниже.",
5193 "zh-chs": "在下面的框中兩次輸入舊密碼和新密碼,以更改帳戶密碼。",
5194 "xloc": [
5194 - "default.handlebars->25->1114"
5195 + "default.handlebars->27->1118"
5196 ]
5197 },
5198 {
@@ -5208,7 +5209,7 @@
5209 "ru": "Изменение языка потребует перезагрузить страницу.",
5210 "zh-chs": "更改語言將需要刷新頁面。",
5211 "xloc": [
5211 - "default.handlebars->25->1093"
5212 + "default.handlebars->27->1097"
5213 ]
5214 },
5215 {
@@ -5225,9 +5226,9 @@
5226 "ru": "Чат",
5227 "zh-chs": "聊天室",
5228 "xloc": [
5228 - "default.handlebars->25->1428",
5229 - "default.handlebars->25->596",
5230 - "default.handlebars->25->615"
5229 + "default.handlebars->27->1432",
5230 + "default.handlebars->27->600",
5231 + "default.handlebars->27->619"
5232 ]
5233 },
5234 {
@@ -5246,8 +5247,8 @@
5247 "xloc": [
5248 "default-mobile.handlebars->9->411",
5249 "default-mobile.handlebars->9->429",
5249 - "default.handlebars->25->1290",
5250 - "default.handlebars->25->1324"
5250 + "default.handlebars->27->1294",
5251 + "default.handlebars->27->1328"
5252 ]
5253 },
5254 {
@@ -5264,7 +5265,7 @@
5265 "ru": "Чеченский",
5266 "zh-chs": "車臣",
5267 "xloc": [
5267 - "default.handlebars->25->928"
5268 + "default.handlebars->27->932"
5269 ]
5270 },
5271 {
@@ -5281,7 +5282,7 @@
5282 "ru": "Установите флажок и нажмите ОК для очищения журнала ошибок.",
5283 "zh-chs": "檢查並單擊確定以清除錯誤日誌。",
5284 "xloc": [
5284 - "default.handlebars->25->105"
5285 + "default.handlebars->27->105"
5286 ]
5287 },
5288 {
@@ -5298,7 +5299,7 @@
5299 "ru": "Установите флажок и нажмите ОК для начала самообновления.",
5300 "zh-chs": "檢查並單擊確定以開始服務器自我更新。",
5301 "xloc": [
5301 - "default.handlebars->25->100"
5302 + "default.handlebars->27->100"
5303 ]
5304 },
5305 {
@@ -5328,7 +5329,7 @@
5329 "nl": "Controleer uw telefoon en voer de verificatiecode in.",
5330 "zh-chs": "检查您的电话并输入验证码。",
5331 "xloc": [
5331 - "default.handlebars->25->141"
5332 + "default.handlebars->27->141"
5333 ]
5334 },
5335 {
@@ -5345,8 +5346,8 @@
5346 "ru": "Проверка...",
5347 "zh-chs": "檢查...",
5348 "xloc": [
5348 - "default.handlebars->25->1799",
5349 - "default.handlebars->25->894"
5349 + "default.handlebars->27->1803",
5350 + "default.handlebars->27->898"
5351 ]
5352 },
5353 {
@@ -5363,7 +5364,7 @@
5364 "ru": "Китайский",
5365 "zh-chs": "中文",
5366 "xloc": [
5366 - "default.handlebars->25->929"
5367 + "default.handlebars->27->933"
5368 ]
5369 },
5370 {
@@ -5380,7 +5381,7 @@
5381 "ru": "Китайский (Гонконг)",
5382 "zh-chs": "中文(香港)",
5383 "xloc": [
5383 - "default.handlebars->25->930"
5384 + "default.handlebars->27->934"
5385 ]
5386 },
5387 {
@@ -5397,7 +5398,7 @@
5398 "ru": "Китайский (КНР)",
5399 "zh-chs": "中文(中國)",
5400 "xloc": [
5400 - "default.handlebars->25->931"
5401 + "default.handlebars->27->935"
5402 ]
5403 },
5404 {
@@ -5414,7 +5415,7 @@
5415 "ru": "Упрощенный китайский)",
5416 "zh-chs": "简体中文)",
5417 "xloc": [
5417 - "default.handlebars->25->1091"
5418 + "default.handlebars->27->1095"
5419 ]
5420 },
5421 {
@@ -5431,7 +5432,7 @@
5432 "ru": "Китайский (Сингапур)",
5433 "zh-chs": "中文(新加坡)",
5434 "xloc": [
5434 - "default.handlebars->25->932"
5435 + "default.handlebars->27->936"
5436 ]
5437 },
5438 {
@@ -5448,7 +5449,7 @@
5449 "ru": "Китайский (Тайвань)",
5450 "zh-chs": "中文(台灣)",
5451 "xloc": [
5451 - "default.handlebars->25->933"
5452 + "default.handlebars->27->937"
5453 ]
5454 },
5455 {
@@ -5466,7 +5467,7 @@
5467 "zh-chs": "ChromeOS",
5468 "xloc": [
5469 "default-mobile.handlebars->9->23",
5469 - "default.handlebars->25->30"
5470 + "default.handlebars->27->30"
5471 ]
5472 },
5473 {
@@ -5483,7 +5484,7 @@
5484 "ru": "Чувашский",
5485 "zh-chs": "楚瓦什",
5486 "xloc": [
5486 - "default.handlebars->25->934"
5487 + "default.handlebars->27->938"
5488 ]
5489 },
5490 {
@@ -5500,7 +5501,7 @@
5501 "ru": "Очистка CIRA",
5502 "zh-chs": "清理CIRA",
5503 "xloc": [
5503 - "default.handlebars->25->272"
5504 + "default.handlebars->27->272"
5505 ]
5506 },
5507 {
@@ -5523,11 +5524,11 @@
5524 "default-mobile.handlebars->9->311",
5525 "default-mobile.handlebars->9->313",
5526 "default-mobile.handlebars->9->59",
5526 - "default.handlebars->25->1405",
5527 - "default.handlebars->25->775",
5528 - "default.handlebars->25->777",
5529 - "default.handlebars->25->779",
5530 - "default.handlebars->25->781",
5527 + "default.handlebars->27->1409",
5528 + "default.handlebars->27->779",
5529 + "default.handlebars->27->781",
5530 + "default.handlebars->27->783",
5531 + "default.handlebars->27->785",
5532 "default.handlebars->container->column_l->p15->consoleTable->1->6->1->1->1->0->7",
5533 "default.handlebars->container->column_l->p41->3->1",
5534 "messenger.handlebars->xbottom"
@@ -5547,7 +5548,7 @@
5548 "ru": "Очистить токены",
5549 "zh-chs": "清除令牌",
5550 "xloc": [
5550 - "default.handlebars->25->123"
5551 + "default.handlebars->27->123"
5552 ]
5553 },
5554 {
@@ -5561,7 +5562,7 @@
5562 "nl": "Wis alle meldingen",
5563 "zh-chs": "全部清除",
5564 "xloc": [
5564 - "default.handlebars->25->1729"
5565 + "default.handlebars->27->1733"
5566 ]
5567 },
5568 {
@@ -5578,7 +5579,7 @@
5579 "ru": "Очистить ядро",
5580 "zh-chs": "清除核心",
5581 "xloc": [
5581 - "default.handlebars->25->866"
5582 + "default.handlebars->27->870"
5583 ]
5584 },
5585 {
@@ -5595,7 +5596,7 @@
5596 "ru": "Удалите ключ из приложения и попробуйте еще раз. У вас есть всего несколько минут, чтобы ввести правильный код.",
5597 "zh-chs": "從應用程序中清除機密,然後重試。您只有幾分鐘的時間來輸入正確的代碼。",
5598 "xloc": [
5598 - "default.handlebars->25->113"
5599 + "default.handlebars->27->113"
5600 ]
5601 },
5602 {
@@ -5611,7 +5612,7 @@
5612 "ru": "Очистить это уведомление",
5613 "zh-chs": "清除此通知",
5614 "xloc": [
5614 - "default.handlebars->25->1728"
5615 + "default.handlebars->27->1732"
5616 ]
5617 },
5618 {
@@ -5656,8 +5657,8 @@
5657 "nl": "Klik hier om de apparaatgroepsnaam te bewerken",
5658 "zh-chs": "单击此处编辑设备组名称",
5659 "xloc": [
5659 - "default.handlebars->25->1156",
5660 - "default.handlebars->25->1361"
5660 + "default.handlebars->27->1160",
5661 + "default.handlebars->27->1365"
5662 ]
5663 },
5664 {
@@ -5674,7 +5675,7 @@
5675 "ru": "Для изменения имени устройства на сервере нажмите сюда",
5676 "zh-chs": "單擊此處編輯服務器端設備名稱",
5677 "xloc": [
5677 - "default.handlebars->25->469"
5678 + "default.handlebars->27->471"
5679 ]
5680 },
5681 {
@@ -5687,7 +5688,7 @@
5688 "nl": "Klik hier om de gebruikersgroepsnaam te bewerken",
5689 "zh-chs": "单击此处编辑用户组名称",
5690 "xloc": [
5690 - "default.handlebars->25->1533"
5691 + "default.handlebars->27->1537"
5692 ]
5693 },
5694 {
@@ -5737,7 +5738,7 @@
5738 "zh-chs": "單擊確定將驗證郵件發送到:",
5739 "xloc": [
5740 "default-mobile.handlebars->9->75",
5740 - "default.handlebars->25->1105"
5741 + "default.handlebars->27->1109"
5742 ]
5743 },
5744 {
@@ -5772,7 +5773,7 @@
5773 "zh-chs": "客戶端控制模式(CCM)",
5774 "xloc": [
5775 "default-mobile.handlebars->9->345",
5775 - "default.handlebars->25->823"
5776 + "default.handlebars->27->827"
5777 ]
5778 },
5779 {
@@ -5789,8 +5790,8 @@
5790 "ru": "Клиент инициировал удаленный доступ",
5791 "zh-chs": "客戶端啟動的遠程訪問",
5792 "xloc": [
5792 - "default.handlebars->25->1227",
5793 - "default.handlebars->25->1232"
5793 + "default.handlebars->27->1231",
5794 + "default.handlebars->27->1236"
5795 ]
5796 },
5797 {
@@ -5825,9 +5826,9 @@
5826 "zh-chs": "關",
5827 "xloc": [
5828 "default-mobile.handlebars->9->57",
5828 - "default.handlebars->25->121",
5829 - "default.handlebars->25->129",
5830 - "default.handlebars->25->733"
5829 + "default.handlebars->27->121",
5830 + "default.handlebars->27->129",
5831 + "default.handlebars->27->737"
5832 ]
5833 },
5834 {
@@ -5862,8 +5863,8 @@
5863 "ru": "Общие группы устройств",
5864 "zh-chs": "通用設備組",
5865 "xloc": [
5865 - "default.handlebars->25->1552",
5866 - "default.handlebars->25->1665"
5866 + "default.handlebars->27->1556",
5867 + "default.handlebars->27->1669"
5868 ]
5869 },
5870 {
@@ -5880,8 +5881,8 @@
5881 "ru": "Общие устройства",
5882 "zh-chs": "通用設備",
5883 "xloc": [
5883 - "default.handlebars->25->1558",
5884 - "default.handlebars->25->1677"
5884 + "default.handlebars->27->1562",
5885 + "default.handlebars->27->1681"
5886 ]
5887 },
5888 {
@@ -5899,7 +5900,7 @@
5900 "zh-chs": "將{1}入口{2}中的{0}限製到此位置?",
5901 "xloc": [
5902 "default-mobile.handlebars->9->127",
5902 - "default.handlebars->25->1400"
5903 + "default.handlebars->27->1404"
5904 ]
5905 },
5906 {
@@ -5918,14 +5919,14 @@
5919 "xloc": [
5920 "default-mobile.handlebars->9->269",
5921 "default-mobile.handlebars->9->391",
5921 - "default.handlebars->25->1241",
5922 - "default.handlebars->25->1454",
5923 - "default.handlebars->25->1523",
5924 - "default.handlebars->25->1572",
5925 - "default.handlebars->25->1663",
5926 - "default.handlebars->25->410",
5927 - "default.handlebars->25->651",
5928 - "default.handlebars->25->660"
5922 + "default.handlebars->27->1245",
5923 + "default.handlebars->27->1458",
5924 + "default.handlebars->27->1527",
5925 + "default.handlebars->27->1576",
5926 + "default.handlebars->27->1667",
5927 + "default.handlebars->27->410",
5928 + "default.handlebars->27->655",
5929 + "default.handlebars->27->664"
5930 ]
5931 },
5932 {
@@ -5943,7 +5944,7 @@
5944 "zh-chs": "確認將1個副本複製到此位置?",
5945 "xloc": [
5946 "default-mobile.handlebars->9->302",
5946 - "default.handlebars->25->770"
5947 + "default.handlebars->27->774"
5948 ]
5949 },
5950 {
@@ -5961,7 +5962,7 @@
5962 "zh-chs": "確認{0}個條目的副本到此位置?",
5963 "xloc": [
5964 "default-mobile.handlebars->9->301",
5964 - "default.handlebars->25->769"
5965 + "default.handlebars->27->773"
5966 ]
5967 },
5968 {
@@ -5975,7 +5976,7 @@
5976 "nl": "Bevestig verwijdering geselecteerde account(s)?",
5977 "zh-chs": "确认删除选定的帐户?",
5978 "xloc": [
5978 - "default.handlebars->25->1453"
5979 + "default.handlebars->27->1457"
5980 ]
5981 },
5982 {
@@ -5992,7 +5993,7 @@
5993 "ru": "Подтвердить удаление выбранных устройств?",
5994 "zh-chs": "確認刪除所選設備?",
5995 "xloc": [
5995 - "default.handlebars->25->409"
5996 + "default.handlebars->27->409"
5997 ]
5998 },
5999 {
@@ -6006,7 +6007,7 @@
6007 "nl": "Bevestig verwijdering geselecteerde gebruikersgroep(en)?",
6008 "zh-chs": "确认删除选定的用户组?",
6009 "xloc": [
6009 - "default.handlebars->25->1522"
6010 + "default.handlebars->27->1526"
6011 ]
6012 },
6013 {
@@ -6023,7 +6024,7 @@
6024 "ru": "Подтвердить удаление пользователя {0}?",
6025 "zh-chs": "確認刪除用戶{0}?",
6026 "xloc": [
6026 - "default.handlebars->25->1662"
6027 + "default.handlebars->27->1666"
6028 ]
6029 },
6030 {
@@ -6037,7 +6038,7 @@
6038 "nl": "Bevestig lidmaatschap verwijderen van gebruiker \\\"{0}\\\"?",
6039 "zh-chs": "确认删除用户\\“ {0} \\”的成员身份?",
6040 "xloc": [
6040 - "default.handlebars->25->1575"
6041 + "default.handlebars->27->1579"
6042 ]
6043 },
6044 {
@@ -6051,7 +6052,7 @@
6052 "nl": "Bevestig lidmaatschap verwijdering van gebruikergroep \\\"{0}\\\"?",
6053 "zh-chs": "确认删除用户组 “{0}” 的成员身份?",
6054 "xloc": [
6054 - "default.handlebars->25->1692"
6055 + "default.handlebars->27->1696"
6056 ]
6057 },
6058 {
@@ -6069,7 +6070,7 @@
6070 "zh-chs": "確認將1個入口移動到此位置?",
6071 "xloc": [
6072 "default-mobile.handlebars->9->304",
6072 - "default.handlebars->25->772"
6073 + "default.handlebars->27->776"
6074 ]
6075 },
6076 {
@@ -6087,7 +6088,7 @@
6088 "zh-chs": "確認將{0}個條目移到此位置?",
6089 "xloc": [
6090 "default-mobile.handlebars->9->303",
6090 - "default.handlebars->25->771"
6091 + "default.handlebars->27->775"
6092 ]
6093 },
6094 {
@@ -6104,7 +6105,7 @@
6105 "ru": "Подтвердить перезапись?",
6106 "zh-chs": "確認覆蓋?",
6107 "xloc": [
6107 - "default.handlebars->25->1399"
6108 + "default.handlebars->27->1403"
6109 ]
6110 },
6111 {
@@ -6118,8 +6119,8 @@
6119 "nl": "Bevestig verwijdering van toegangsrechten voor apparaat \\\"{0}\\\"?",
6120 "zh-chs": "确认删除设备“ {0} ”的访问权限?",
6121 "xloc": [
6121 - "default.handlebars->25->1565",
6122 - "default.handlebars->25->1683"
6122 + "default.handlebars->27->1569",
6123 + "default.handlebars->27->1687"
6124 ]
6125 },
6126 {
@@ -6133,8 +6134,8 @@
6134 "nl": "Bevestig verwijdering van toegangsrechten voor apparaatgroep \\\"{0}\\\"?",
6135 "zh-chs": "是否确认删除设备组“ {0}”的访问权限?",
6136 "xloc": [
6136 - "default.handlebars->25->1567",
6137 - "default.handlebars->25->1696"
6137 + "default.handlebars->27->1571",
6138 + "default.handlebars->27->1700"
6139 ]
6140 },
6141 {
@@ -6148,7 +6149,7 @@
6149 "nl": "Bevestig verwijdering van toegangsrechten voor gebruiker \\\"{0}\\\"?",
6150 "zh-chs": "确认删除用户\\“ {0} \\”的访问权限?",
6151 "xloc": [
6151 - "default.handlebars->25->1685"
6152 + "default.handlebars->27->1689"
6153 ]
6154 },
6155 {
@@ -6162,7 +6163,7 @@
6163 "nl": "Bevestig verwijdering van toegangsrechten voor gebruikergroep \\\"{0}\\\"?",
6164 "zh-chs": "确认删除用户组“ {0}”的访问权限?",
6165 "xloc": [
6165 - "default.handlebars->25->1688"
6166 + "default.handlebars->27->1692"
6167 ]
6168 },
6169 {
@@ -6176,8 +6177,8 @@
6177 "nl": "Verwijdering van toegangsrechten bevestigen?",
6178 "zh-chs": "确认删除访问权限?",
6179 "xloc": [
6179 - "default.handlebars->25->1686",
6180 - "default.handlebars->25->1689"
6180 + "default.handlebars->27->1690",
6181 + "default.handlebars->27->1693"
6182 ]
6183 },
6184 {
@@ -6195,7 +6196,7 @@
6196 "zh-chs": "確認刪除身份驗證器應用程序兩步登錄?",
6197 "xloc": [
6198 "default-mobile.handlebars->9->74",
6198 - "default.handlebars->25->884"
6199 + "default.handlebars->27->888"
6200 ]
6201 },
6202 {
@@ -6250,7 +6251,7 @@
6251 "nl": "Bevestig de verwijdering van rechten voor gebruiker \\\"{0}\\\"?",
6252 "zh-chs": "确认删除用户“ {0} ”的权限?",
6253 "xloc": [
6253 - "default.handlebars->25->1333"
6254 + "default.handlebars->27->1337"
6255 ]
6256 },
6257 {
@@ -6264,7 +6265,7 @@
6265 "nl": "Bevestig de verwijdering van rechten voor de gebruikergroep \\\"{0}\\\"?",
6266 "zh-chs": "确认删除用户组“ {0} ”的权限?",
6267 "xloc": [
6267 - "default.handlebars->25->1335"
6268 + "default.handlebars->27->1339"
6269 ]
6270 },
6271 {
@@ -6312,8 +6313,8 @@
6313 "default-mobile.handlebars->9->284",
6314 "default-mobile.handlebars->container->page_content->column_l->p10->p10desktop->deskarea1->1->3",
6315 "default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->0->1->3",
6315 - "default.handlebars->25->1180",
6316 - "default.handlebars->25->752",
6316 + "default.handlebars->27->1184",
6317 + "default.handlebars->27->756",
6318 "default.handlebars->container->column_l->p11->deskarea0->deskarea1->3->connectbutton1span",
6319 "default.handlebars->container->column_l->p12->termTable->1->1->0->1->3->connectbutton2span",
6320 "default.handlebars->container->column_l->p13->p13toolbar->1->0->1->3",
@@ -6334,7 +6335,7 @@
6335 "ru": "Подключиться ко всем",
6336 "zh-chs": "全部連接",
6337 "xloc": [
6337 - "default.handlebars->25->225",
6338 + "default.handlebars->27->225",
6339 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->kvmListToolbar"
6340 ]
6341 },
@@ -6352,8 +6353,8 @@
6353 "ru": "Подключиться к серверу",
6354 "zh-chs": "連接到服務器",
6355 "xloc": [
6355 - "default.handlebars->25->1231",
6356 - "default.handlebars->25->1235"
6356 + "default.handlebars->27->1235",
6357 + "default.handlebars->27->1239"
6358 ]
6359 },
6360 {
@@ -6406,7 +6407,7 @@
6407 "zh-chs": "連接的",
6408 "xloc": [
6409 "default-mobile.handlebars->9->4",
6409 - "default.handlebars->25->11",
6410 + "default.handlebars->27->11",
6411 "xterm.handlebars->9->4"
6412 ]
6413 },
@@ -6424,7 +6425,7 @@
6425 "ru": "Подключено Intel&reg; AMT",
6426 "zh-chs": "連接的英特爾&reg;AMT",
6427 "xloc": [
6427 - "default.handlebars->25->1747"
6428 + "default.handlebars->27->1751"
6429 ]
6430 },
6431 {
@@ -6441,7 +6442,7 @@
6442 "ru": "Подключенные пользователи",
6443 "zh-chs": "關聯用戶",
6444 "xloc": [
6444 - "default.handlebars->25->1752"
6445 + "default.handlebars->27->1756"
6446 ]
6447 },
6448 {
@@ -6459,7 +6460,7 @@
6460 "zh-chs": "現在已連接",
6461 "xloc": [
6462 "default-mobile.handlebars->9->324",
6462 - "default.handlebars->25->802"
6463 + "default.handlebars->27->806"
6464 ]
6465 },
6466 {
@@ -6496,11 +6497,11 @@
6497 "default-mobile.handlebars->9->2",
6498 "default-mobile.handlebars->9->317",
6499 "default-mobile.handlebars->9->37",
6499 - "default.handlebars->25->206",
6500 - "default.handlebars->25->209",
6501 - "default.handlebars->25->228",
6502 - "default.handlebars->25->793",
6503 - "default.handlebars->25->9",
6500 + "default.handlebars->27->206",
6501 + "default.handlebars->27->209",
6502 + "default.handlebars->27->228",
6503 + "default.handlebars->27->797",
6504 + "default.handlebars->27->9",
6505 "xterm.handlebars->9->2"
6506 ]
6507 },
@@ -6518,7 +6519,7 @@
6519 "ru": "Подключений ",
6520 "zh-chs": "連接數",
6521 "xloc": [
6521 - "default.handlebars->25->1763"
6522 + "default.handlebars->27->1767"
6523 ]
6524 },
6525 {
@@ -6535,7 +6536,7 @@
6536 "ru": "Ретранслятор подключения",
6537 "zh-chs": "連接繼電器",
6538 "xloc": [
6538 - "default.handlebars->25->1791"
6539 + "default.handlebars->27->1795"
6540 ]
6541 },
6542 {
@@ -6587,9 +6588,9 @@
6588 "zh-chs": "連接性",
6589 "xloc": [
6590 "default-mobile.handlebars->9->237",
6590 - "default.handlebars->25->1368",
6591 - "default.handlebars->25->197",
6592 - "default.handlebars->25->536",
6591 + "default.handlebars->27->1372",
6592 + "default.handlebars->27->197",
6593 + "default.handlebars->27->538",
6594 "default.handlebars->container->column_l->p21->3->1->meshConnChartDiv->1"
6595 ]
6596 },
@@ -6607,8 +6608,8 @@
6608 "ru": "Консоль",
6609 "zh-chs": "安慰",
6610 "xloc": [
6610 - "default.handlebars->25->591",
6611 - "default.handlebars->25->610",
6611 + "default.handlebars->27->595",
6612 + "default.handlebars->27->614",
6613 "default.handlebars->container->topbar->1->1->MainSubMenuSpan->MainSubMenu->1->0->MainDevConsole",
6614 "default.handlebars->container->topbar->1->1->ServerSubMenuSpan->ServerSubMenu->1->0->ServerConsole",
6615 "default.handlebars->contextMenu->cxconsole"
@@ -6628,7 +6629,7 @@
6629 "ru": "Консоль - ",
6630 "zh-chs": "安慰 -",
6631 "xloc": [
6631 - "default.handlebars->25->470"
6632 + "default.handlebars->27->472"
6633 ]
6634 },
6635 {
@@ -6644,8 +6645,8 @@
6645 "ru": "контроль",
6646 "zh-chs": "控制",
6647 "xloc": [
6647 - "default.handlebars->25->590",
6648 - "default.handlebars->25->609"
6648 + "default.handlebars->27->594",
6649 + "default.handlebars->27->613"
6650 ]
6651 },
6652 {
@@ -6662,7 +6663,7 @@
6663 "ru": "Cookie-кодировщик",
6664 "zh-chs": "Cookie編碼器",
6665 "xloc": [
6665 - "default.handlebars->25->1777"
6666 + "default.handlebars->27->1781"
6667 ]
6668 },
6669 {
@@ -6699,8 +6700,8 @@
6700 "ru": "Скопировать МАС адрес в буфер обмена",
6701 "zh-chs": "將MAC地址複製到剪貼板",
6702 "xloc": [
6702 - "default.handlebars->25->82",
6703 - "default.handlebars->25->90"
6703 + "default.handlebars->27->82",
6704 + "default.handlebars->27->90"
6705 ]
6706 },
6707 {
@@ -6717,7 +6718,7 @@
6718 "ru": "Скопировать ссылку MacOS agent в буфер обмена",
6719 "zh-chs": "將MacOS代理URL複製到剪貼板",
6720 "xloc": [
6720 - "default.handlebars->25->351"
6721 + "default.handlebars->27->351"
6722 ]
6723 },
6724 {
@@ -6733,7 +6734,7 @@
6734 "ru": "Скопировать URL-адрес агента Windows 32bit в буфер обмена",
6735 "zh-chs": "将Windows 32位代理URL复制到剪贴板",
6736 "xloc": [
6736 - "default.handlebars->25->339"
6737 + "default.handlebars->27->339"
6738 ]
6739 },
6740 {
@@ -6749,7 +6750,7 @@
6750 "ru": "Скопировать URL-адрес агента Windows 64bit в буфер обмена",
6751 "zh-chs": "将Windows 64位代理URL复制到剪贴板",
6752 "xloc": [
6752 - "default.handlebars->25->343"
6753 + "default.handlebars->27->343"
6754 ]
6755 },
6756 {
@@ -6766,12 +6767,12 @@
6767 "ru": "Скопировать адрес в буфер обмена",
6768 "zh-chs": "將地址複製到剪貼板",
6769 "xloc": [
6769 - "default.handlebars->25->71",
6770 - "default.handlebars->25->73",
6771 - "default.handlebars->25->75",
6772 - "default.handlebars->25->84",
6773 - "default.handlebars->25->86",
6774 - "default.handlebars->25->88"
6770 + "default.handlebars->27->71",
6771 + "default.handlebars->27->73",
6772 + "default.handlebars->27->75",
6773 + "default.handlebars->27->84",
6774 + "default.handlebars->27->86",
6775 + "default.handlebars->27->88"
6776 ]
6777 },
6778 {
@@ -6788,9 +6789,9 @@
6789 "ru": "Скопировать ссылку в буфер обмена",
6790 "zh-chs": "複製鏈接到剪貼板",
6791 "xloc": [
6791 - "default.handlebars->25->1373",
6792 - "default.handlebars->25->1387",
6793 - "default.handlebars->25->323"
6792 + "default.handlebars->27->1377",
6793 + "default.handlebars->27->1391",
6794 + "default.handlebars->27->323"
6795 ]
6796 },
6797 {
@@ -6807,7 +6808,7 @@
6808 "ru": "Скопировать имя в буфер обмена",
6809 "zh-chs": "將名稱複製到剪貼板",
6810 "xloc": [
6810 - "default.handlebars->25->80"
6811 + "default.handlebars->27->80"
6812 ]
6813 },
6814 {
@@ -6842,7 +6843,7 @@
6843 "ru": "Скопировать действительные коды в буфер обмена",
6844 "zh-chs": "將有效代碼複製到剪貼板",
6845 "xloc": [
6845 - "default.handlebars->25->124"
6846 + "default.handlebars->27->124"
6847 ]
6848 },
6849 {
@@ -6967,7 +6968,7 @@
6968 "ru": "Основной сервер",
6969 "zh-chs": "核心服務器",
6970 "xloc": [
6970 - "default.handlebars->25->1776"
6971 + "default.handlebars->27->1780"
6972 ]
6973 },
6974 {
@@ -6984,7 +6985,7 @@
6985 "ru": "Kорсиканский",
6986 "zh-chs": "科西嘉人",
6987 "xloc": [
6987 - "default.handlebars->25->935"
6988 + "default.handlebars->27->939"
6989 ]
6990 },
6991 {
@@ -7001,7 +7002,7 @@
7002 "ru": "Создать учетную запись",
7003 "zh-chs": "創建帳號",
7004 "xloc": [
7004 - "default.handlebars->25->1493",
7005 + "default.handlebars->27->1497",
7006 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->createpanel->1->1->9->1->12->1->1",
7007 "login.handlebars->container->column_l->centralTable->1->0->logincell->createpanel->1->9->1->12->1->1"
7008 ]
@@ -7037,7 +7038,7 @@
7038 "ru": "Создать группу пользователей",
7039 "zh-chs": "創建用戶組",
7040 "xloc": [
7040 - "default.handlebars->25->1530"
7041 + "default.handlebars->27->1534"
7042 ]
7043 },
7044 {
@@ -7054,7 +7055,7 @@
7055 "ru": "Создайте новую группу устройств, используя параметры ниже.",
7056 "zh-chs": "使用以下選項創建一個新的設備組。",
7057 "xloc": [
7057 - "default.handlebars->25->1128"
7058 + "default.handlebars->27->1132"
7059 ]
7060 },
7061 {
@@ -7071,7 +7072,7 @@
7072 "ru": "Создать новую группу устройств.",
7073 "zh-chs": "創建一個新的設備組。",
7074 "xloc": [
7074 - "default.handlebars->25->199"
7075 + "default.handlebars->27->199"
7076 ]
7077 },
7078 {
@@ -7088,7 +7089,7 @@
7089 "ru": "Создайте сразу несколько учетных записей, импортировав файл JSON в следующем формате:",
7090 "zh-chs": "通過導入以下格式的JSON文件一次創建多個帳戶:",
7091 "xloc": [
7091 - "default.handlebars->25->1461"
7092 + "default.handlebars->27->1465"
7093 ]
7094 },
7095 {
@@ -7123,7 +7124,7 @@
7124 "ru": "Создано",
7125 "zh-chs": "創建",
7126 "xloc": [
7126 - "default.handlebars->25->1601"
7127 + "default.handlebars->27->1605"
7128 ]
7129 },
7130 {
@@ -7158,7 +7159,7 @@
7159 "ru": "Кри (Канадский язык)",
7160 "zh-chs": "克里",
7161 "xloc": [
7161 - "default.handlebars->25->936"
7162 + "default.handlebars->27->940"
7163 ]
7164 },
7165 {
@@ -7175,7 +7176,7 @@
7176 "ru": "Хорватский",
7177 "zh-chs": "克羅地亞語",
7178 "xloc": [
7178 - "default.handlebars->25->937"
7179 + "default.handlebars->27->941"
7180 ]
7181 },
7182 {
@@ -7226,7 +7227,7 @@
7227 "ru": "Ctrl",
7228 "zh-chs": "Ctrl",
7229 "xloc": [
7229 - "default.handlebars->25->46"
7230 + "default.handlebars->27->46"
7231 ]
7232 },
7233 {
@@ -7279,7 +7280,7 @@
7280 "ru": "Текущая версия",
7281 "zh-chs": "當前版本",
7282 "xloc": [
7282 - "default.handlebars->25->94"
7283 + "default.handlebars->27->94"
7284 ]
7285 },
7286 {
@@ -7316,7 +7317,7 @@
7317 "ru": "Чешский",
7318 "zh-chs": "捷克文",
7319 "xloc": [
7319 - "default.handlebars->25->938"
7320 + "default.handlebars->27->942"
7321 ]
7322 },
7323 {
@@ -7333,7 +7334,7 @@
7334 "ru": "DNS-суффикс",
7335 "zh-chs": "DNS後綴",
7336 "xloc": [
7336 - "default.handlebars->25->79"
7337 + "default.handlebars->27->79"
7338 ]
7339 },
7340 {
@@ -7350,7 +7351,7 @@
7351 "ru": "Датский",
7352 "zh-chs": "丹麥文",
7353 "xloc": [
7353 - "default.handlebars->25->939"
7354 + "default.handlebars->27->943"
7355 ]
7356 },
7357 {
@@ -7367,7 +7368,7 @@
7368 "ru": "DataChannel",
7369 "zh-chs": "數據通道",
7370 "xloc": [
7370 - "default.handlebars->25->703"
7371 + "default.handlebars->27->707"
7372 ]
7373 },
7374 {
@@ -7384,7 +7385,7 @@
7385 "ru": "Дата & Время",
7386 "zh-chs": "日期和時間",
7387 "xloc": [
7387 - "default.handlebars->25->1096"
7388 + "default.handlebars->27->1100"
7389 ]
7390 },
7391 {
@@ -7402,7 +7403,7 @@
7403 "zh-chs": "天",
7404 "xloc": [
7405 "default-mobile.handlebars->9->259",
7405 - "default.handlebars->25->635"
7406 + "default.handlebars->27->639"
7407 ]
7408 },
7409 {
@@ -7419,7 +7420,7 @@
7420 "ru": "Деактивировать режим управления клиентом (CCM)",
7421 "zh-chs": "停用客戶端控制模式(CCM)",
7422 "xloc": [
7422 - "default.handlebars->25->1219"
7423 + "default.handlebars->27->1223"
7424 ]
7425 },
7426 {
@@ -7437,17 +7438,17 @@
7438 "zh-chs": "沉睡",
7439 "xloc": [
7440 "default-mobile.handlebars->9->181",
7440 - "default.handlebars->25->370"
7441 + "default.handlebars->27->370"
7442 ]
7443 },
7444 {
7445 "en": "Default",
7446 "nl": "Standaard",
7447 "xloc": [
7447 - "default.handlebars->25->1480",
7448 - "default.handlebars->25->1526",
7449 - "default.handlebars->25->1537",
7450 - "default.handlebars->25->1592"
7448 + "default.handlebars->27->1484",
7449 + "default.handlebars->27->1530",
7450 + "default.handlebars->27->1541",
7451 + "default.handlebars->27->1596"
7452 ]
7453 },
7454 {
@@ -7468,9 +7469,9 @@
7469 "default-mobile.handlebars->9->294",
7470 "default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->2->1->1",
7471 "default-mobile.handlebars->container->page_content->column_l->p5->p5myfiles->p5toolbar->1->0->1->1",
7471 - "default.handlebars->25->1394",
7472 - "default.handlebars->25->440",
7473 - "default.handlebars->25->762",
7472 + "default.handlebars->27->1398",
7473 + "default.handlebars->27->442",
7474 + "default.handlebars->27->766",
7475 "default.handlebars->container->column_l->p13->p13toolbar->1->2->1->3",
7476 "default.handlebars->container->column_l->p5->p5toolbar->1->0->p5filehead->3",
7477 "default.handlebars->container->dialog->idx_dlgButtonBar->5",
@@ -7494,7 +7495,7 @@
7495 "zh-chs": "刪除帳戶",
7496 "xloc": [
7497 "default-mobile.handlebars->9->84",
7497 - "default.handlebars->25->1113"
7498 + "default.handlebars->27->1117"
7499 ]
7500 },
7501 {
@@ -7508,7 +7509,7 @@
7509 "nl": "Verwijder accounts",
7510 "zh-chs": "删除帐号",
7511 "xloc": [
7511 - "default.handlebars->25->1455"
7512 + "default.handlebars->27->1459"
7513 ]
7514 },
7515 {
@@ -7526,7 +7527,7 @@
7527 "zh-chs": "刪除裝置",
7528 "xloc": [
7529 "default-mobile.handlebars->9->242",
7529 - "default.handlebars->25->549"
7530 + "default.handlebars->27->551"
7531 ]
7532 },
7533 {
@@ -7545,8 +7546,8 @@
7546 "xloc": [
7547 "default-mobile.handlebars->9->389",
7548 "default-mobile.handlebars->9->392",
7548 - "default.handlebars->25->1212",
7549 - "default.handlebars->25->1242"
7549 + "default.handlebars->27->1216",
7550 + "default.handlebars->27->1246"
7551 ]
7552 },
7553 {
@@ -7564,7 +7565,7 @@
7565 "zh-chs": "刪除節點",
7566 "xloc": [
7567 "default-mobile.handlebars->9->267",
7567 - "default.handlebars->25->661"
7568 + "default.handlebars->27->665"
7569 ]
7570 },
7571 {
@@ -7581,7 +7582,7 @@
7582 "ru": "Удалить устройства",
7583 "zh-chs": "刪除節點",
7584 "xloc": [
7584 - "default.handlebars->25->411"
7585 + "default.handlebars->27->411"
7586 ]
7587 },
7588 {
@@ -7598,7 +7599,7 @@
7599 "ru": "Удалить пользователя",
7600 "zh-chs": "刪除用戶",
7601 "xloc": [
7601 - "default.handlebars->25->1640"
7602 + "default.handlebars->27->1644"
7603 ]
7604 },
7605 {
@@ -7615,8 +7616,8 @@
7616 "ru": "Удалить группу пользователей",
7617 "zh-chs": "刪除用戶組",
7618 "xloc": [
7618 - "default.handlebars->25->1563",
7619 - "default.handlebars->25->1573"
7619 + "default.handlebars->27->1567",
7620 + "default.handlebars->27->1577"
7621 ]
7622 },
7623 {
@@ -7630,7 +7631,7 @@
7631 "nl": "Gebruikersgroepen verwijderen",
7632 "zh-chs": "删除用户组",
7633 "xloc": [
7633 - "default.handlebars->25->1524"
7634 + "default.handlebars->27->1528"
7635 ]
7636 },
7637 {
@@ -7647,7 +7648,7 @@
7648 "ru": "Удалить пользователя {0}",
7649 "zh-chs": "刪除用戶{0}",
7650 "xloc": [
7650 - "default.handlebars->25->1661"
7651 + "default.handlebars->27->1665"
7652 ]
7653 },
7654 {
@@ -7665,7 +7666,7 @@
7666 "zh-chs": "刪除帳戶",
7667 "xloc": [
7668 "default-mobile.handlebars->container->page_content->column_l->p3->p3info->1->p3AccountActions->p2AccountActions->3->9->0",
7668 - "default.handlebars->25->1451",
7669 + "default.handlebars->27->1455",
7670 "default.handlebars->container->column_l->p2->p2info->p2AccountActions->3->p2AccountPassActions->7"
7671 ]
7672 },
@@ -7683,7 +7684,7 @@
7684 "ru": "Удалить устройства",
7685 "zh-chs": "刪除設備",
7686 "xloc": [
7686 - "default.handlebars->25->407"
7687 + "default.handlebars->27->407"
7688 ]
7689 },
7690 {
@@ -7697,7 +7698,7 @@
7698 "nl": "Verwijder groep",
7699 "zh-chs": "删除群组",
7700 "xloc": [
7700 - "default.handlebars->25->1520"
7701 + "default.handlebars->27->1524"
7702 ]
7703 },
7704 {
@@ -7714,7 +7715,7 @@
7715 "ru": "Удалить пункт?",
7716 "zh-chs": "刪除項目?",
7717 "xloc": [
7717 - "default.handlebars->25->441"
7718 + "default.handlebars->27->443"
7719 ]
7720 },
7721 {
@@ -7733,8 +7734,8 @@
7734 "xloc": [
7735 "default-mobile.handlebars->9->124",
7736 "default-mobile.handlebars->9->296",
7736 - "default.handlebars->25->1396",
7737 - "default.handlebars->25->764"
7737 + "default.handlebars->27->1400",
7738 + "default.handlebars->27->768"
7739 ]
7740 },
7741 {
@@ -7751,7 +7752,7 @@
7752 "ru": "Удалить группу пользователей {0}?",
7753 "zh-chs": "刪除用戶組{0}?",
7754 "xloc": [
7754 - "default.handlebars->25->1571"
7755 + "default.handlebars->27->1575"
7756 ]
7757 },
7758 {
@@ -7770,8 +7771,8 @@
7771 "xloc": [
7772 "default-mobile.handlebars->9->123",
7773 "default-mobile.handlebars->9->295",
7773 - "default.handlebars->25->1395",
7774 - "default.handlebars->25->763"
7774 + "default.handlebars->27->1399",
7775 + "default.handlebars->27->767"
7776 ]
7777 },
7778 {
@@ -7801,7 +7802,7 @@
7802 "ko": "거부",
7803 "zh-chs": "被拒绝",
7804 "xloc": [
7804 - "default.handlebars->25->699"
7805 + "default.handlebars->27->703"
7806 ]
7807 },
7808 {
@@ -7885,18 +7886,18 @@
7886 "default-mobile.handlebars->9->330",
7887 "default-mobile.handlebars->9->381",
7888 "default-mobile.handlebars->9->394",
7888 - "default.handlebars->25->1133",
7889 - "default.handlebars->25->1161",
7890 - "default.handlebars->25->1244",
7891 - "default.handlebars->25->1529",
7892 - "default.handlebars->25->1539",
7893 - "default.handlebars->25->1540",
7894 - "default.handlebars->25->1569",
7895 - "default.handlebars->25->481",
7896 - "default.handlebars->25->482",
7897 - "default.handlebars->25->694",
7898 - "default.handlebars->25->78",
7899 - "default.handlebars->25->808",
7889 + "default.handlebars->27->1137",
7890 + "default.handlebars->27->1165",
7891 + "default.handlebars->27->1248",
7892 + "default.handlebars->27->1533",
7893 + "default.handlebars->27->1543",
7894 + "default.handlebars->27->1544",
7895 + "default.handlebars->27->1573",
7896 + "default.handlebars->27->483",
7897 + "default.handlebars->27->484",
7898 + "default.handlebars->27->698",
7899 + "default.handlebars->27->78",
7900 + "default.handlebars->27->812",
7901 "default.handlebars->container->column_l->p42->p42tbl->1->0->3"
7902 ]
7903 },
@@ -7929,9 +7930,9 @@
7930 "zh-chs": "桌面",
7931 "xloc": [
7932 "default-mobile.handlebars->9->249",
7932 - "default.handlebars->25->1249",
7933 - "default.handlebars->25->1706",
7934 - "default.handlebars->25->446",
7933 + "default.handlebars->27->1253",
7934 + "default.handlebars->27->1710",
7935 + "default.handlebars->27->448",
7936 "default.handlebars->container->topbar->1->1->MainSubMenuSpan->MainSubMenu->1->0->MainDevDesktop",
7937 "default.handlebars->contextMenu->cxdesktop"
7938 ]
@@ -7967,9 +7968,9 @@
7968 "ru": "Уведомление на рабочем столе",
7969 "zh-chs": "桌面通知",
7970 "xloc": [
7970 - "default.handlebars->25->1171",
7971 - "default.handlebars->25->1616",
7972 - "default.handlebars->25->517"
7971 + "default.handlebars->27->1175",
7972 + "default.handlebars->27->1620",
7973 + "default.handlebars->27->519"
7974 ]
7975 },
7976 {
@@ -7986,9 +7987,9 @@
7987 "ru": "Запрос рабочего стола",
7988 "zh-chs": "桌面提示",
7989 "xloc": [
7989 - "default.handlebars->25->1170",
7990 - "default.handlebars->25->1615",
7991 - "default.handlebars->25->516"
7990 + "default.handlebars->27->1174",
7991 + "default.handlebars->27->1619",
7992 + "default.handlebars->27->518"
7993 ]
7994 },
7995 {
@@ -8005,9 +8006,9 @@
8006 "ru": "Запрос рабочего стола + панель инструментов",
8007 "zh-chs": "桌面提示+工具欄",
8008 "xloc": [
8008 - "default.handlebars->25->1168",
8009 - "default.handlebars->25->1613",
8010 - "default.handlebars->25->514"
8009 + "default.handlebars->27->1172",
8010 + "default.handlebars->27->1617",
8011 + "default.handlebars->27->516"
8012 ]
8013 },
8014 {
@@ -8038,9 +8039,9 @@
8039 "ru": "Панель инструментов рабочего стола",
8040 "zh-chs": "桌面工具欄",
8041 "xloc": [
8041 - "default.handlebars->25->1169",
8042 - "default.handlebars->25->1614",
8043 - "default.handlebars->25->515"
8042 + "default.handlebars->27->1173",
8043 + "default.handlebars->27->1618",
8044 + "default.handlebars->27->517"
8045 ]
8046 },
8047 {
@@ -8111,8 +8112,8 @@
8112 "ru": "Устройство",
8113 "zh-chs": "設備",
8114 "xloc": [
8114 - "default.handlebars->25->1271",
8115 - "default.handlebars->25->1680",
8115 + "default.handlebars->27->1275",
8116 + "default.handlebars->27->1684",
8117 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->9->devListToolbarSort->sortselect->5"
8118 ]
8119 },
@@ -8131,7 +8132,7 @@
8132 "zh-chs": "設備動作",
8133 "xloc": [
8134 "default-mobile.handlebars->9->258",
8134 - "default.handlebars->25->634"
8135 + "default.handlebars->27->638"
8136 ]
8137 },
8138 {
@@ -8148,13 +8149,13 @@
8149 "ru": "Группа устройства",
8150 "zh-chs": "設備組",
8151 "xloc": [
8151 - "default.handlebars->25->1266",
8152 - "default.handlebars->25->1269",
8153 - "default.handlebars->25->1270",
8154 - "default.handlebars->25->1555",
8155 - "default.handlebars->25->1561",
8156 - "default.handlebars->25->1668",
8157 - "default.handlebars->25->1715"
8152 + "default.handlebars->27->1270",
8153 + "default.handlebars->27->1273",
8154 + "default.handlebars->27->1274",
8155 + "default.handlebars->27->1559",
8156 + "default.handlebars->27->1565",
8157 + "default.handlebars->27->1672",
8158 + "default.handlebars->27->1719"
8159 ]
8160 },
8161 {
@@ -8172,7 +8173,7 @@
8173 "zh-chs": "設備組用戶",
8174 "xloc": [
8175 "default-mobile.handlebars->9->436",
8175 - "default.handlebars->25->1331"
8176 + "default.handlebars->27->1335"
8177 ]
8178 },
8179 {
@@ -8190,11 +8191,11 @@
8191 "zh-chs": "設備組",
8192 "xloc": [
8193 "default-mobile.handlebars->container->page_content->column_l->p3->p3info->1->3",
8193 - "default.handlebars->25->1420",
8194 - "default.handlebars->25->1514",
8195 - "default.handlebars->25->1542",
8196 - "default.handlebars->25->1610",
8197 - "default.handlebars->25->1750",
8194 + "default.handlebars->27->1424",
8195 + "default.handlebars->27->1518",
8196 + "default.handlebars->27->1546",
8197 + "default.handlebars->27->1614",
8198 + "default.handlebars->27->1754",
8199 "default.handlebars->container->column_l->p2->p2info->7"
8200 ]
8201 },
@@ -8212,7 +8213,7 @@
8213 "ru": "Экспорт информации об устройстве",
8214 "zh-chs": "設備信息導出",
8215 "xloc": [
8215 - "default.handlebars->25->417"
8216 + "default.handlebars->27->417"
8217 ]
8218 },
8219 {
@@ -8229,14 +8230,14 @@
8230 "ru": "Местонахождение устройства",
8231 "zh-chs": "設備位置",
8232 "xloc": [
8232 - "default.handlebars->25->662"
8233 + "default.handlebars->27->666"
8234 ]
8235 },
8236 {
8237 "en": "Device Message",
8238 "nl": "Apparaatbericht",
8239 "xloc": [
8239 - "default.handlebars->25->623"
8240 + "default.handlebars->27->627"
8241 ]
8242 },
8243 {
@@ -8254,9 +8255,9 @@
8255 "zh-chs": "設備名稱",
8256 "xloc": [
8257 "default-mobile.handlebars->9->271",
8257 - "default.handlebars->25->1714",
8258 - "default.handlebars->25->246",
8259 - "default.handlebars->25->692",
8258 + "default.handlebars->27->1718",
8259 + "default.handlebars->27->246",
8260 + "default.handlebars->27->696",
8261 "player.handlebars->3->9"
8262 ]
8263 },
@@ -8274,7 +8275,7 @@
8275 "ru": "Уведомление устройства",
8276 "zh-chs": "設備通知",
8277 "xloc": [
8277 - "default.handlebars->25->625"
8278 + "default.handlebars->27->629"
8279 ]
8280 },
8281 {
@@ -8308,8 +8309,8 @@
8309 "ru": "Подключения устройств.",
8310 "zh-chs": "設備連接。",
8311 "xloc": [
8311 - "default.handlebars->25->1101",
8312 - "default.handlebars->25->1352"
8312 + "default.handlebars->27->1105",
8313 + "default.handlebars->27->1356"
8314 ]
8315 },
8316 {
@@ -8326,8 +8327,8 @@
8327 "ru": "Отключения устройств.",
8328 "zh-chs": "設備斷開連接。",
8329 "xloc": [
8329 - "default.handlebars->25->1102",
8330 - "default.handlebars->25->1353"
8330 + "default.handlebars->27->1106",
8331 + "default.handlebars->27->1357"
8332 ]
8333 },
8334 {
@@ -8344,7 +8345,7 @@
8345 "ru": "Примечания могут быть просмотрены и изменены другими администраторами.",
8346 "zh-chs": "其他設備組管理員可以查看和更改設備組註釋。",
8347 "xloc": [
8347 - "default.handlebars->25->621"
8348 + "default.handlebars->27->625"
8349 ]
8350 },
8351 {
@@ -8353,8 +8354,8 @@
8354 "xloc": [
8355 "default-mobile.handlebars->9->152",
8356 "default-mobile.handlebars->9->205",
8356 - "default.handlebars->25->177",
8357 - "default.handlebars->25->467"
8357 + "default.handlebars->27->177",
8358 + "default.handlebars->27->469"
8359 ]
8360 },
8361 {
@@ -8371,7 +8372,7 @@
8372 "ru": "Устройство обнаружено, но состояние питания не может быть получено.",
8373 "zh-chs": "檢測到設備,但無法獲得電源狀態。",
8374 "xloc": [
8374 - "default.handlebars->25->375"
8375 + "default.handlebars->27->375"
8376 ]
8377 },
8378 {
@@ -8389,7 +8390,7 @@
8390 "zh-chs": "設備正在休眠(S4)",
8391 "xloc": [
8392 "default-mobile.handlebars->9->189",
8392 - "default.handlebars->25->381"
8393 + "default.handlebars->27->381"
8394 ]
8395 },
8396 {
@@ -8407,7 +8408,7 @@
8408 "zh-chs": "設備處於深度睡眠狀態(S3)",
8409 "xloc": [
8410 "default-mobile.handlebars->9->188",
8410 - "default.handlebars->25->380"
8411 + "default.handlebars->27->380"
8412 ]
8413 },
8414 {
@@ -8424,7 +8425,7 @@
8425 "ru": "Устройство находится в состоянии глубокого сна (S3).",
8426 "zh-chs": "設備處於深度睡眠狀態(S3)。",
8427 "xloc": [
8427 - "default.handlebars->25->369"
8428 + "default.handlebars->27->369"
8429 ]
8430 },
8431 {
@@ -8441,7 +8442,7 @@
8442 "ru": "Устройство находится в режиме гибернации (S4).",
8443 "zh-chs": "設備處於休眠狀態(S4)。",
8444 "xloc": [
8444 - "default.handlebars->25->371"
8445 + "default.handlebars->27->371"
8446 ]
8447 },
8448 {
@@ -8458,7 +8459,7 @@
8459 "ru": "Устройство находится в выключенном состоянии (S5).",
8460 "zh-chs": "設備處於關機狀態(S5)。",
8461 "xloc": [
8461 - "default.handlebars->25->373"
8462 + "default.handlebars->27->373"
8463 ]
8464 },
8465 {
@@ -8476,7 +8477,7 @@
8477 "zh-chs": "設備處於睡眠狀態(S1)",
8478 "xloc": [
8479 "default-mobile.handlebars->9->186",
8479 - "default.handlebars->25->378"
8480 + "default.handlebars->27->378"
8481 ]
8482 },
8483 {
@@ -8493,7 +8494,7 @@
8494 "ru": "Устройство находится в спящем режиме (S1).",
8495 "zh-chs": "設備處於睡眠狀態(S1)。",
8496 "xloc": [
8496 - "default.handlebars->25->365"
8497 + "default.handlebars->27->365"
8498 ]
8499 },
8500 {
@@ -8511,7 +8512,7 @@
8512 "zh-chs": "設備處於睡眠狀態(S2)",
8513 "xloc": [
8514 "default-mobile.handlebars->9->187",
8514 - "default.handlebars->25->379"
8515 + "default.handlebars->27->379"
8516 ]
8517 },
8518 {
@@ -8528,7 +8529,7 @@
8529 "ru": "Устройство находится в спящем режиме (S2).",
8530 "zh-chs": "設備處於睡眠狀態(S2)。",
8531 "xloc": [
8531 - "default.handlebars->25->367"
8532 + "default.handlebars->27->367"
8533 ]
8534 },
8535 {
@@ -8546,7 +8547,7 @@
8547 "zh-chs": "設備處於軟斷開狀態(S5)",
8548 "xloc": [
8549 "default-mobile.handlebars->9->190",
8549 - "default.handlebars->25->382"
8550 + "default.handlebars->27->382"
8551 ]
8552 },
8553 {
@@ -8555,8 +8556,8 @@
8556 "xloc": [
8557 "default-mobile.handlebars->9->151",
8558 "default-mobile.handlebars->9->204",
8558 - "default.handlebars->25->176",
8559 - "default.handlebars->25->466"
8559 + "default.handlebars->27->176",
8560 + "default.handlebars->27->468"
8561 ]
8562 },
8563 {
@@ -8574,7 +8575,7 @@
8575 "zh-chs": "設備已上電",
8576 "xloc": [
8577 "default-mobile.handlebars->9->185",
8577 - "default.handlebars->25->377"
8578 + "default.handlebars->27->377"
8579 ]
8580 },
8581 {
@@ -8591,7 +8592,7 @@
8592 "ru": "Устройство включено.",
8593 "zh-chs": "設備上電。",
8594 "xloc": [
8594 - "default.handlebars->25->363"
8595 + "default.handlebars->27->363"
8596 ]
8597 },
8598 {
@@ -8609,7 +8610,7 @@
8610 "zh-chs": "設備存在,但無法確定電源狀態",
8611 "xloc": [
8612 "default-mobile.handlebars->9->191",
8612 - "default.handlebars->25->383"
8613 + "default.handlebars->27->383"
8614 ]
8615 },
8616 {
@@ -8626,7 +8627,7 @@
8627 "ru": "Имя устройства",
8628 "zh-chs": "設備名稱",
8629 "xloc": [
8629 - "default.handlebars->25->458"
8630 + "default.handlebars->27->460"
8631 ]
8632 },
8633 {
@@ -8654,8 +8655,8 @@
8655 "nl": "Apparaten",
8656 "zh-chs": "设备",
8657 "xloc": [
8657 - "default.handlebars->25->1515",
8658 - "default.handlebars->25->1543"
8658 + "default.handlebars->27->1519",
8659 + "default.handlebars->27->1547"
8660 ]
8661 },
8662 {
@@ -8672,7 +8673,7 @@
8673 "ru": "Отключено",
8674 "zh-chs": "殘障人士",
8675 "xloc": [
8675 - "default.handlebars->25->509"
8676 + "default.handlebars->27->511"
8677 ]
8678 },
8679 {
@@ -8691,8 +8692,8 @@
8692 "xloc": [
8693 "default-mobile.handlebars->9->285",
8694 "default-mobile.handlebars->container->page_content->column_l->p10->p10desktop->deskarea1->1->3",
8694 - "default.handlebars->25->1181",
8695 - "default.handlebars->25->753",
8695 + "default.handlebars->27->1185",
8696 + "default.handlebars->27->757",
8697 "default.handlebars->container->column_l->p11->deskarea0->deskarea1->3->disconnectbutton1span",
8698 "default.handlebars->container->column_l->p12->termTable->1->1->0->1->3->disconnectbutton2span",
8699 "xterm.handlebars->p11->deskarea0->deskarea1->3"
@@ -8732,11 +8733,11 @@
8733 "default-mobile.handlebars->9->1",
8734 "default-mobile.handlebars->container->page_content->column_l->p10->p10desktop->deskarea1->1->3->deskstatus",
8735 "default-mobile.handlebars->container->page_content->column_l->p10->p10files->p13toolbar->1->0->1->3->p13Status",
8735 - "default.handlebars->25->188",
8736 - "default.handlebars->25->205",
8737 - "default.handlebars->25->208",
8738 - "default.handlebars->25->227",
8739 - "default.handlebars->25->8",
8736 + "default.handlebars->27->188",
8737 + "default.handlebars->27->205",
8738 + "default.handlebars->27->208",
8739 + "default.handlebars->27->227",
8740 + "default.handlebars->27->8",
8741 "default.handlebars->container->column_l->p11->deskarea0->deskarea1->3->deskstatus",
8742 "default.handlebars->container->column_l->p12->termTable->1->1->0->1->3->termstatus",
8743 "default.handlebars->container->column_l->p13->p13toolbar->1->0->1->3->p13Status",
@@ -8747,7 +8748,7 @@
8748 "en": "Display a message box on the remote device.",
8749 "nl": "Geef een berichtvenster weer op het externe apparaat.",
8750 "xloc": [
8750 - "default.handlebars->25->624"
8751 + "default.handlebars->27->628"
8752 ]
8753 },
8754 {
@@ -8771,7 +8772,7 @@
8772 "en": "Display a text message on the remote device",
8773 "nl": "Geef een tekstbericht weer op het externe apparaat",
8774 "xloc": [
8774 - "default.handlebars->25->545"
8775 + "default.handlebars->27->547"
8776 ]
8777 },
8778 {
@@ -8788,7 +8789,7 @@
8789 "ru": "Отобразить имя группы устройств",
8790 "zh-chs": "顯示設備組名稱",
8791 "xloc": [
8791 - "default.handlebars->25->1100"
8792 + "default.handlebars->27->1104"
8793 ]
8794 },
8795 {
@@ -8805,7 +8806,7 @@
8806 "ru": "Отображаемое имя",
8807 "zh-chs": "顯示名稱",
8808 "xloc": [
8808 - "default.handlebars->25->724"
8809 + "default.handlebars->27->728"
8810 ]
8811 },
8812 {
@@ -8821,7 +8822,7 @@
8822 "ru": "Показать публичную ссылку",
8823 "zh-chs": "显示公共链接",
8824 "xloc": [
8824 - "default.handlebars->25->1372"
8825 + "default.handlebars->27->1376"
8826 ]
8827 },
8828 {
@@ -8838,17 +8839,17 @@
8839 "ru": "Ничего не делать",
8840 "zh-chs": "沒做什麼",
8841 "xloc": [
8841 - "default.handlebars->25->1225"
8842 + "default.handlebars->27->1229"
8843 ]
8844 },
8845 {
8846 "en": "Domain",
8847 "nl": "Domein",
8848 "xloc": [
8848 - "default.handlebars->25->1481",
8849 - "default.handlebars->25->1527",
8850 - "default.handlebars->25->1536",
8851 - "default.handlebars->25->1591"
8849 + "default.handlebars->27->1485",
8850 + "default.handlebars->27->1531",
8851 + "default.handlebars->27->1540",
8852 + "default.handlebars->27->1595"
8853 ]
8854 },
8855 {
@@ -8861,8 +8862,8 @@
8862 "nl": "Niet configureren",
8863 "zh-chs": "不要配置",
8864 "xloc": [
8864 - "default.handlebars->25->1229",
8865 - "default.handlebars->25->1234"
8865 + "default.handlebars->27->1233",
8866 + "default.handlebars->27->1238"
8867 ]
8868 },
8869 {
@@ -8875,7 +8876,7 @@
8876 "nl": "Maak geen verbinding met de server",
8877 "zh-chs": "不要连接到服务器",
8878 "xloc": [
8878 - "default.handlebars->25->1230"
8879 + "default.handlebars->27->1234"
8880 ]
8881 },
8882 {
@@ -8975,7 +8976,7 @@
8976 "zh-chs": "下載文件",
8977 "xloc": [
8978 "default-mobile.handlebars->9->315",
8978 - "default.handlebars->25->782"
8979 + "default.handlebars->27->786"
8980 ]
8981 },
8982 {
@@ -8992,7 +8993,7 @@
8993 "ru": "Скачать MeshCentral Router, инструмент сопоставления TCP портов.",
8994 "zh-chs": "下載MeshCentral Router,一個TCP端口映射工具。",
8995 "xloc": [
8995 - "default.handlebars->25->203"
8996 + "default.handlebars->27->203"
8997 ]
8998 },
8999 {
@@ -9009,7 +9010,7 @@
9010 "ru": "Скачать MeshCmd",
9011 "zh-chs": "下載MeshCmd",
9012 "xloc": [
9012 - "default.handlebars->25->684"
9013 + "default.handlebars->27->688"
9014 ]
9015 },
9016 {
@@ -9026,7 +9027,7 @@
9027 "ru": "Скачать MeshCmd, инструмент командной строки, выполняющий множество функций.",
9028 "zh-chs": "下載MeshCmd,這是一個執行許多功能的命令行工具。",
9029 "xloc": [
9029 - "default.handlebars->25->201"
9030 + "default.handlebars->27->201"
9031 ]
9032 },
9033 {
@@ -9060,7 +9061,7 @@
9061 "ru": "Скачайте \\\"meshcmd\\\" с файлом команд для маршрутизации трафика к этому устройству через сервер. Не забудьте указать пароль от своей учетной записи в meshaction.txt и сделать другие правки при необходимости.",
9062 "zh-chs": "下載帶有動作文件的“ meshcmd”,以將通過此服務器的流量路由到該設備。確保編輯meshaction.txt並添加您的帳戶密碼或進行任何必要的更改。",
9063 "xloc": [
9063 - "default.handlebars->25->677"
9064 + "default.handlebars->27->681"
9065 ]
9066 },
9067 {
@@ -9111,7 +9112,7 @@
9112 "ru": "Скачать журнал ошибок",
9113 "zh-chs": "下載錯誤日誌",
9114 "xloc": [
9114 - "default.handlebars->25->104"
9115 + "default.handlebars->27->104"
9116 ]
9117 },
9118 {
@@ -9128,7 +9129,7 @@
9129 "ru": "Скачать события состояния питания",
9130 "zh-chs": "下載電源事件",
9131 "xloc": [
9131 - "default.handlebars->25->636"
9132 + "default.handlebars->27->640"
9133 ]
9134 },
9135 {
@@ -9179,7 +9180,7 @@
9180 "ru": "Загрузите список устройств с одним из форматов файлов ниже.",
9181 "zh-chs": "使用以下一種文件格式下載設備列表。",
9182 "xloc": [
9182 - "default.handlebars->25->412"
9183 + "default.handlebars->27->412"
9184 ]
9185 },
9186 {
@@ -9196,7 +9197,7 @@
9197 "ru": "Скачать список событий в одном из форматов ниже.",
9198 "zh-chs": "使用以下一種文件格式下載事件列表。",
9199 "xloc": [
9199 - "default.handlebars->25->1410"
9200 + "default.handlebars->27->1414"
9201 ]
9202 },
9203 {
@@ -9213,7 +9214,7 @@
9214 "ru": "Скачать список пользователей в одном из форматов ниже.",
9215 "zh-chs": "使用以下一種文件格式下載用戶列表。",
9216 "xloc": [
9216 - "default.handlebars->25->1469"
9217 + "default.handlebars->27->1473"
9218 ]
9219 },
9220 {
@@ -9296,7 +9297,7 @@
9297 "nl": "Dubbele agent",
9298 "zh-chs": "代理重复",
9299 "xloc": [
9299 - "default.handlebars->25->1746"
9300 + "default.handlebars->27->1750"
9301 ]
9302 },
9303 {
@@ -9330,7 +9331,7 @@
9331 "ru": "Скопировать группу пользователей",
9332 "zh-chs": "重複的用戶組",
9333 "xloc": [
9333 - "default.handlebars->25->1531"
9334 + "default.handlebars->27->1535"
9335 ]
9336 },
9337 {
@@ -9361,8 +9362,8 @@
9362 "ru": "Длительность",
9363 "zh-chs": "持續時間",
9364 "xloc": [
9364 - "default.handlebars->25->1700",
9365 - "default.handlebars->25->1720",
9365 + "default.handlebars->27->1704",
9366 + "default.handlebars->27->1724",
9367 "player.handlebars->3->2"
9368 ]
9369 },
@@ -9380,7 +9381,7 @@
9381 "ru": "Во время активации агент будет иметь доступ к паролю администратора.",
9382 "zh-chs": "在激活期間,代理將有權訪問管理員密碼信息。",
9383 "xloc": [
9383 - "default.handlebars->25->1239"
9384 + "default.handlebars->27->1243"
9385 ]
9386 },
9387 {
@@ -9397,7 +9398,7 @@
9398 "ru": "Голландский (Бельгийский)",
9399 "zh-chs": "荷蘭語(比利時)",
9400 "xloc": [
9400 - "default.handlebars->25->941"
9401 + "default.handlebars->27->945"
9402 ]
9403 },
9404 {
@@ -9414,7 +9415,7 @@
9415 "ru": "Голландский (Стандартный)",
9416 "zh-chs": "荷蘭語(標準)",
9417 "xloc": [
9417 - "default.handlebars->25->940"
9418 + "default.handlebars->27->944"
9419 ]
9420 },
9421 {
@@ -9470,7 +9471,7 @@
9471 "ru": "ОШИБКА:",
9472 "zh-chs": "錯誤:",
9473 "xloc": [
9473 - "default.handlebars->25->140"
9474 + "default.handlebars->27->140"
9475 ]
9476 },
9477 {
@@ -9552,7 +9553,7 @@
9553 "ru": "ОШИБКА: Невозможно добавить ключ.",
9554 "zh-chs": "錯誤:無法添加密鑰。",
9555 "xloc": [
9555 - "default.handlebars->25->136"
9556 + "default.handlebars->27->136"
9557 ]
9558 },
9559 {
@@ -9605,7 +9606,7 @@
9606 "zh-chs": "編輯裝置",
9607 "xloc": [
9608 "default-mobile.handlebars->9->276",
9608 - "default.handlebars->25->697"
9609 + "default.handlebars->27->701"
9610 ]
9611 },
9612 {
@@ -9625,10 +9626,10 @@
9626 "default-mobile.handlebars->9->395",
9627 "default-mobile.handlebars->9->397",
9628 "default-mobile.handlebars->9->415",
9628 - "default.handlebars->25->1245",
9629 - "default.handlebars->25->1275",
9630 - "default.handlebars->25->1297",
9631 - "default.handlebars->25->1309"
9629 + "default.handlebars->27->1249",
9630 + "default.handlebars->27->1279",
9631 + "default.handlebars->27->1301",
9632 + "default.handlebars->27->1313"
9633 ]
9634 },
9635 {
@@ -9645,7 +9646,7 @@
9646 "ru": "Редактировать функции группы устройств",
9647 "zh-chs": "編輯設備組功能",
9648 "xloc": [
9648 - "default.handlebars->25->1261"
9649 + "default.handlebars->27->1265"
9650 ]
9651 },
9652 {
@@ -9662,8 +9663,8 @@
9663 "ru": "Редактировать права группы устройств",
9664 "zh-chs": "編輯設備組權限",
9665 "xloc": [
9665 - "default.handlebars->25->1294",
9666 - "default.handlebars->25->1306"
9666 + "default.handlebars->27->1298",
9667 + "default.handlebars->27->1310"
9668 ]
9669 },
9670 {
@@ -9680,7 +9681,7 @@
9681 "ru": "Редактировать согласие пользователя группы устройств",
9682 "zh-chs": "編輯設備組用戶同意",
9683 "xloc": [
9683 - "default.handlebars->25->1246"
9684 + "default.handlebars->27->1250"
9685 ]
9686 },
9687 {
@@ -9698,7 +9699,7 @@
9699 "zh-chs": "編輯設備說明",
9700 "xloc": [
9701 "default-mobile.handlebars->9->409",
9701 - "default.handlebars->25->1288"
9702 + "default.handlebars->27->1292"
9703 ]
9704 },
9705 {
@@ -9714,8 +9715,8 @@
9715 "ru": "Изменить разрешения устройства",
9716 "zh-chs": "编辑设备权限",
9717 "xloc": [
9717 - "default.handlebars->25->1299",
9718 - "default.handlebars->25->1301"
9718 + "default.handlebars->27->1303",
9719 + "default.handlebars->27->1305"
9720 ]
9721 },
9722 {
@@ -9729,7 +9730,7 @@
9730 "nl": "Gebruikerstoestemming apparaat bewerken",
9731 "zh-chs": "编辑设备用户同意",
9732 "xloc": [
9732 - "default.handlebars->25->1248"
9733 + "default.handlebars->27->1252"
9734 ]
9735 },
9736 {
@@ -9745,7 +9746,7 @@
9746 "ru": "Редактировать группу",
9747 "zh-chs": "编辑组",
9748 "xloc": [
9748 - "default.handlebars->25->600"
9749 + "default.handlebars->27->604"
9750 ]
9751 },
9752 {
@@ -9763,9 +9764,9 @@
9764 "zh-chs": "編輯英特爾&reg;AMT憑據",
9765 "xloc": [
9766 "default-mobile.handlebars->9->266",
9766 - "default.handlebars->25->496",
9767 - "default.handlebars->25->499",
9768 - "default.handlebars->25->643"
9767 + "default.handlebars->27->498",
9768 + "default.handlebars->27->501",
9769 + "default.handlebars->27->647"
9770 ]
9771 },
9772 {
@@ -9783,7 +9784,7 @@
9784 "zh-chs": "編輯筆記",
9785 "xloc": [
9786 "default-mobile.handlebars->9->422",
9786 - "default.handlebars->25->1316"
9787 + "default.handlebars->27->1320"
9788 ]
9789 },
9790 {
@@ -9797,7 +9798,7 @@
9798 "nl": "Gebruikerstoestemming bewerken",
9799 "zh-chs": "编辑用户同意",
9800 "xloc": [
9800 - "default.handlebars->25->1247"
9801 + "default.handlebars->27->1251"
9802 ]
9803 },
9804 {
@@ -9814,7 +9815,7 @@
9815 "ru": "Редактировать права пользователя для группы устройств",
9816 "zh-chs": "編輯用戶設備組權限",
9817 "xloc": [
9817 - "default.handlebars->25->1307"
9818 + "default.handlebars->27->1311"
9819 ]
9820 },
9821 {
@@ -9830,7 +9831,7 @@
9831 "ru": "Изменить разрешения для пользовательских устройств",
9832 "zh-chs": "编辑用户设备权限",
9833 "xloc": [
9833 - "default.handlebars->25->1302"
9834 + "default.handlebars->27->1306"
9835 ]
9836 },
9837 {
@@ -9847,7 +9848,7 @@
9848 "ru": "Редактировать группу пользователей",
9849 "zh-chs": "編輯用戶組",
9850 "xloc": [
9850 - "default.handlebars->25->1570"
9851 + "default.handlebars->27->1574"
9852 ]
9853 },
9854 {
@@ -9861,7 +9862,7 @@
9862 "nl": "Gebruikersmachtigingen voor apparaatgroep bewerken",
9863 "zh-chs": "编辑用户组设备权限",
9864 "xloc": [
9864 - "default.handlebars->25->1304"
9865 + "default.handlebars->27->1308"
9866 ]
9867 },
9868 {
@@ -9896,12 +9897,12 @@
9897 "zh-chs": "電子郵件",
9898 "xloc": [
9899 "default-mobile.handlebars->9->78",
9899 - "default.handlebars->25->1483",
9900 - "default.handlebars->25->1595",
9901 - "default.handlebars->25->1596",
9902 - "default.handlebars->25->1635",
9903 - "default.handlebars->25->1649",
9904 - "default.handlebars->25->294",
9900 + "default.handlebars->27->1487",
9901 + "default.handlebars->27->1599",
9902 + "default.handlebars->27->1600",
9903 + "default.handlebars->27->1639",
9904 + "default.handlebars->27->1653",
9905 + "default.handlebars->27->294",
9906 "login-mobile.handlebars->5->42",
9907 "login-mobile.handlebars->container->page_content->column_l->1->1->0->1->tokenpanel->1->7->1->4->1->3",
9908 "login.handlebars->5->43",
@@ -9923,7 +9924,7 @@
9924 "zh-chs": "電郵地址變更",
9925 "xloc": [
9926 "default-mobile.handlebars->9->79",
9926 - "default.handlebars->25->1109"
9927 + "default.handlebars->27->1113"
9928 ]
9929 },
9930 {
@@ -9941,7 +9942,7 @@
9942 "zh-chs": "郵件認證",
9943 "xloc": [
9944 "default-mobile.handlebars->9->68",
9944 - "default.handlebars->25->878"
9945 + "default.handlebars->27->882"
9946 ]
9947 },
9948 {
@@ -9986,7 +9987,7 @@
9987 "zh-chs": "電子郵件驗證",
9988 "xloc": [
9989 "default-mobile.handlebars->9->77",
9989 - "default.handlebars->25->1107"
9990 + "default.handlebars->27->1111"
9991 ]
9992 },
9993 {
@@ -10000,7 +10001,7 @@
10001 "nl": "E-mail uitnodiging",
10002 "zh-chs": "电子邮件邀请",
10003 "xloc": [
10003 - "default.handlebars->25->291"
10004 + "default.handlebars->27->291"
10005 ]
10006 },
10007 {
@@ -10016,7 +10017,7 @@
10017 "ru": "Электронная почта не подтверждена",
10018 "zh-chs": "邮件未验证",
10019 "xloc": [
10019 - "default.handlebars->25->1439"
10020 + "default.handlebars->27->1443"
10021 ]
10022 },
10023 {
@@ -10033,8 +10034,8 @@
10034 "ru": "Email подтвержден",
10035 "zh-chs": "電子郵件已驗證",
10036 "xloc": [
10036 - "default.handlebars->25->1440",
10037 - "default.handlebars->25->1589"
10037 + "default.handlebars->27->1444",
10038 + "default.handlebars->27->1593"
10039 ]
10040 },
10041 {
@@ -10051,7 +10052,7 @@
10052 "ru": "Email подтвержден.",
10053 "zh-chs": "電子郵件已驗證。",
10054 "xloc": [
10054 - "default.handlebars->25->1489"
10055 + "default.handlebars->27->1493"
10056 ]
10057 },
10058 {
@@ -10068,7 +10069,7 @@
10069 "ru": "Email не подтвержден",
10070 "zh-chs": "電子郵件未驗證",
10071 "xloc": [
10071 - "default.handlebars->25->1590"
10072 + "default.handlebars->27->1594"
10073 ]
10074 },
10075 {
@@ -10107,7 +10108,7 @@
10108 "en": "Email verified and forced password reset required.",
10109 "nl": "E-mail geverifieerd en geforceerd opnieuw instellen van wachtwoord vereist.",
10110 "xloc": [
10110 - "default.handlebars->25->1490"
10111 + "default.handlebars->27->1494"
10112 ]
10113 },
10114 {
@@ -10120,7 +10121,7 @@
10121 "nl": "Email/SMS verkeer",
10122 "zh-chs": "电子邮件/短信流量",
10123 "xloc": [
10123 - "default.handlebars->25->1785"
10124 + "default.handlebars->27->1789"
10125 ]
10126 },
10127 {
@@ -10159,7 +10160,7 @@
10160 "ru": "Включить коды приглашения",
10161 "zh-chs": "啟用邀請代碼",
10162 "xloc": [
10162 - "default.handlebars->25->1337"
10163 + "default.handlebars->27->1341"
10164 ]
10165 },
10166 {
@@ -10194,7 +10195,7 @@
10195 "zh-chs": "啟用電子郵件兩因素驗證。",
10196 "xloc": [
10197 "default-mobile.handlebars->9->70",
10197 - "default.handlebars->25->880"
10198 + "default.handlebars->27->884"
10199 ]
10200 },
10201 {
@@ -10218,7 +10219,7 @@
10219 "en": "Enabled",
10220 "nl": "Ingeschakeld",
10221 "xloc": [
10221 - "default.handlebars->25->1722"
10222 + "default.handlebars->27->1726"
10223 ]
10224 },
10225 {
@@ -10242,7 +10243,7 @@
10243 "en": "End Time",
10244 "nl": "Eindtijd",
10245 "xloc": [
10245 - "default.handlebars->25->1719"
10246 + "default.handlebars->27->1723"
10247 ]
10248 },
10249 {
@@ -10259,7 +10260,7 @@
10260 "ru": "Английский",
10261 "zh-chs": "英語",
10262 "xloc": [
10262 - "default.handlebars->25->942"
10263 + "default.handlebars->27->946"
10264 ]
10265 },
10266 {
@@ -10276,7 +10277,7 @@
10277 "ru": "Английский (Австралия)",
10278 "zh-chs": "英文(澳洲)",
10279 "xloc": [
10279 - "default.handlebars->25->943"
10280 + "default.handlebars->27->947"
10281 ]
10282 },
10283 {
@@ -10293,7 +10294,7 @@
10294 "ru": "Английский (Белиз)",
10295 "zh-chs": "英語(伯利茲)",
10296 "xloc": [
10296 - "default.handlebars->25->944"
10297 + "default.handlebars->27->948"
10298 ]
10299 },
10300 {
@@ -10310,7 +10311,7 @@
10311 "ru": "Английский (Канада)",
10312 "zh-chs": "英文(加拿大)",
10313 "xloc": [
10313 - "default.handlebars->25->945"
10314 + "default.handlebars->27->949"
10315 ]
10316 },
10317 {
@@ -10327,7 +10328,7 @@
10328 "ru": "Английский (Ирландия)",
10329 "zh-chs": "英文(愛爾蘭)",
10330 "xloc": [
10330 - "default.handlebars->25->946"
10331 + "default.handlebars->27->950"
10332 ]
10333 },
10334 {
@@ -10344,7 +10345,7 @@
10345 "ru": "Английский (Ямайка)",
10346 "zh-chs": "英文(牙買加)",
10347 "xloc": [
10347 - "default.handlebars->25->947"
10348 + "default.handlebars->27->951"
10349 ]
10350 },
10351 {
@@ -10361,7 +10362,7 @@
10362 "ru": "Английский (Новая Зеландия)",
10363 "zh-chs": "英文(紐西蘭)",
10364 "xloc": [
10364 - "default.handlebars->25->948"
10365 + "default.handlebars->27->952"
10366 ]
10367 },
10368 {
@@ -10378,7 +10379,7 @@
10379 "ru": "Английский (Филиппины)",
10380 "zh-chs": "英文(菲律賓)",
10381 "xloc": [
10381 - "default.handlebars->25->949"
10382 + "default.handlebars->27->953"
10383 ]
10384 },
10385 {
@@ -10395,7 +10396,7 @@
10396 "ru": "Английский (Южная Африка)",
10397 "zh-chs": "英語(南非)",
10398 "xloc": [
10398 - "default.handlebars->25->950"
10399 + "default.handlebars->27->954"
10400 ]
10401 },
10402 {
@@ -10412,7 +10413,7 @@
10413 "ru": "Английский (Тринидад и Тобаго)",
10414 "zh-chs": "英文(特立尼達和多巴哥)",
10415 "xloc": [
10415 - "default.handlebars->25->951"
10416 + "default.handlebars->27->955"
10417 ]
10418 },
10419 {
@@ -10429,7 +10430,7 @@
10430 "ru": "Английский (Великобритания)",
10431 "zh-chs": "英文(英國)",
10432 "xloc": [
10432 - "default.handlebars->25->952"
10433 + "default.handlebars->27->956"
10434 ]
10435 },
10436 {
@@ -10446,7 +10447,7 @@
10447 "ru": "Английский (Соединенные Штаты)",
10448 "zh-chs": "美國英語)",
10449 "xloc": [
10449 - "default.handlebars->25->953"
10450 + "default.handlebars->27->957"
10451 ]
10452 },
10453 {
@@ -10463,7 +10464,7 @@
10464 "ru": "Английский (Зимбабве)",
10465 "zh-chs": "英文(津巴布韋)",
10466 "xloc": [
10466 - "default.handlebars->25->954"
10467 + "default.handlebars->27->958"
10468 ]
10469 },
10470 {
@@ -10480,8 +10481,8 @@
10481 "ru": "Ввод",
10482 "zh-chs": "輸入",
10483 "xloc": [
10483 - "default.handlebars->25->1135",
10484 - "default.handlebars->25->1136"
10484 + "default.handlebars->27->1139",
10485 + "default.handlebars->27->1140"
10486 ]
10487 },
10488 {
@@ -10498,7 +10499,7 @@
10499 "ru": "Введите разделенный запятыми список имен административных областей.",
10500 "zh-chs": "輸入管理領域名稱的逗號分隔列表。",
10501 "xloc": [
10501 - "default.handlebars->25->1494"
10502 + "default.handlebars->27->1498"
10503 ]
10504 },
10505 {
@@ -10515,7 +10516,7 @@
10516 "ru": "Введите диапазон IP-адресов для сканирования Intel AMT устройств.",
10517 "zh-chs": "輸入IP地址範圍以掃描Intel AMT設備。",
10518 "xloc": [
10518 - "default.handlebars->25->261"
10519 + "default.handlebars->27->261"
10520 ]
10521 },
10522 {
@@ -10532,7 +10533,7 @@
10533 "ru": "Для удаленного набора введите текст, используя английскую раскладку и нажмите OK. Перед продолжением убедитесь, что курсор на удаленном компьютере установлен в правильное положение.",
10534 "zh-chs": "輸入文本,然後單擊“確定”以使用美式英語鍵盤遠程輸入文本。在繼續操作之前,請確保將遠程光標放置在正確的位置。",
10535 "xloc": [
10535 - "default.handlebars->25->718"
10536 + "default.handlebars->27->722"
10537 ]
10538 },
10539 {
@@ -10567,7 +10568,7 @@
10568 "ru": "Для двухэтапного входа введите токен здесь:",
10569 "zh-chs": "在此處輸入令牌以進行兩步登錄:",
10570 "xloc": [
10570 - "default.handlebars->25->108"
10571 + "default.handlebars->27->108"
10572 ]
10573 },
10574 {
@@ -10580,7 +10581,7 @@
10581 "nl": "Voer uw telefoonnummer in dat geschikt is voor SMS. Na verificatie kan het nummer worden gebruikt voor inlogverificatie en andere meldingen.",
10582 "zh-chs": "输入支持SMS的电话号码。验证后,该号码可用于登录验证和其他通知。",
10583 "xloc": [
10583 - "default.handlebars->25->875"
10584 + "default.handlebars->27->879"
10585 ]
10586 },
10587 {
@@ -10597,7 +10598,7 @@
10598 "ru": "Ошибка, Невозможно добавить код.",
10599 "zh-chs": "錯誤,無法添加密鑰。",
10600 "xloc": [
10600 - "default.handlebars->25->134"
10601 + "default.handlebars->27->134"
10602 ]
10603 },
10604 {
@@ -10631,7 +10632,7 @@
10632 "ru": "Эсперанто",
10633 "zh-chs": "世界語",
10634 "xloc": [
10634 - "default.handlebars->25->955"
10635 + "default.handlebars->27->959"
10636 ]
10637 },
10638 {
@@ -10648,7 +10649,7 @@
10649 "ru": "Эстонский",
10650 "zh-chs": "愛沙尼亞語",
10651 "xloc": [
10651 - "default.handlebars->25->956"
10652 + "default.handlebars->27->960"
10653 ]
10654 },
10655 {
@@ -10665,7 +10666,7 @@
10666 "ru": "Детали события",
10667 "zh-chs": "活動詳情",
10668 "xloc": [
10668 - "default.handlebars->25->795"
10669 + "default.handlebars->27->799"
10670 ]
10671 },
10672 {
@@ -10682,7 +10683,7 @@
10683 "ru": "Экспорт списка событий",
10684 "zh-chs": "活動列表導出",
10685 "xloc": [
10685 - "default.handlebars->25->1415"
10686 + "default.handlebars->27->1419"
10687 ]
10688 },
10689 {
@@ -10754,7 +10755,7 @@
10755 "ru": "Экспорт информации об устройстве",
10756 "zh-chs": "導出設備信息",
10757 "xloc": [
10757 - "default.handlebars->25->405"
10758 + "default.handlebars->27->405"
10759 ]
10760 },
10761 {
@@ -10771,7 +10772,7 @@
10772 "ru": "Расширенный ASCII",
10773 "zh-chs": "擴展ASCII",
10774 "xloc": [
10774 - "default.handlebars->25->744"
10775 + "default.handlebars->27->748"
10776 ]
10777 },
10778 {
@@ -10805,7 +10806,7 @@
10806 "ru": "Внешний",
10807 "zh-chs": "外部",
10808 "xloc": [
10808 - "default.handlebars->25->1770"
10809 + "default.handlebars->27->1774"
10810 ]
10811 },
10812 {
@@ -10822,7 +10823,7 @@
10823 "ru": "Mакедонский (БЮР)",
10824 "zh-chs": "FYRO馬其頓語",
10825 "xloc": [
10825 - "default.handlebars->25->1006"
10826 + "default.handlebars->27->1010"
10827 ]
10828 },
10829 {
@@ -10839,7 +10840,7 @@
10840 "ru": "Фарерский",
10841 "zh-chs": "法羅語",
10842 "xloc": [
10842 - "default.handlebars->25->957"
10843 + "default.handlebars->27->961"
10844 ]
10845 },
10846 {
@@ -10856,7 +10857,7 @@
10857 "ru": "Не удалось",
10858 "zh-chs": "失敗的",
10859 "xloc": [
10859 - "default.handlebars->25->67"
10860 + "default.handlebars->27->67"
10861 ]
10862 },
10863 {
@@ -10869,7 +10870,7 @@
10870 "ko": "원격 터미널 세션을 시작하지 못했습니다 : {0} ({1})",
10871 "zh-chs": "无法启动远程终端会话{0}({1})",
10872 "xloc": [
10872 - "default.handlebars->25->700"
10873 + "default.handlebars->27->704"
10874 ]
10875 },
10876 {
@@ -10886,7 +10887,7 @@
10887 "ru": "Фарси (Персидский)",
10888 "zh-chs": "波斯語(波斯語)",
10889 "xloc": [
10889 - "default.handlebars->25->958"
10890 + "default.handlebars->27->962"
10891 ]
10892 },
10893 {
@@ -10921,7 +10922,7 @@
10922 "ru": "Функции",
10923 "zh-chs": "特徵",
10924 "xloc": [
10924 - "default.handlebars->25->1167"
10925 + "default.handlebars->27->1171"
10926 ]
10927 },
10928 {
@@ -10938,7 +10939,7 @@
10939 "ru": "Фиджи",
10940 "zh-chs": "斐濟",
10941 "xloc": [
10941 - "default.handlebars->25->959"
10942 + "default.handlebars->27->963"
10943 ]
10944 },
10945 {
@@ -10956,8 +10957,8 @@
10957 "zh-chs": "文件編輯器",
10958 "xloc": [
10959 "default-mobile.handlebars->9->299",
10959 - "default.handlebars->25->438",
10960 - "default.handlebars->25->767"
10960 + "default.handlebars->27->440",
10961 + "default.handlebars->27->771"
10962 ]
10963 },
10964 {
@@ -10991,7 +10992,7 @@
10992 "ru": "Драйвер файловой системы",
10993 "zh-chs": "FileSystemDriver",
10994 "xloc": [
10994 - "default.handlebars->25->727"
10995 + "default.handlebars->27->731"
10996 ]
10997 },
10998 {
@@ -11010,9 +11011,9 @@
11011 "xloc": [
11012 "default-mobile.handlebars->9->167",
11013 "default-mobile.handlebars->9->250",
11013 - "default.handlebars->25->1256",
11014 - "default.handlebars->25->1707",
11015 - "default.handlebars->25->220",
11014 + "default.handlebars->27->1260",
11015 + "default.handlebars->27->1711",
11016 + "default.handlebars->27->220",
11017 "default.handlebars->container->topbar->1->1->MainSubMenuSpan->MainSubMenu->1->0->MainDevFiles",
11018 "default.handlebars->contextMenu->cxfiles"
11019 ]
@@ -11048,9 +11049,9 @@
11049 "ru": "Уведомление файлов",
11050 "zh-chs": "文件通知",
11051 "xloc": [
11051 - "default.handlebars->25->1175",
11052 - "default.handlebars->25->1620",
11053 - "default.handlebars->25->521"
11052 + "default.handlebars->27->1179",
11053 + "default.handlebars->27->1624",
11054 + "default.handlebars->27->523"
11055 ]
11056 },
11057 {
@@ -11067,9 +11068,9 @@
11068 "ru": "Запрос файлов",
11069 "zh-chs": "文件提示",
11070 "xloc": [
11070 - "default.handlebars->25->1174",
11071 - "default.handlebars->25->1619",
11072 - "default.handlebars->25->520"
11071 + "default.handlebars->27->1178",
11072 + "default.handlebars->27->1623",
11073 + "default.handlebars->27->522"
11074 ]
11075 },
11076 {
@@ -11106,7 +11107,7 @@
11107 "ru": "Финский",
11108 "zh-chs": "芬蘭",
11109 "xloc": [
11109 - "default.handlebars->25->960"
11110 + "default.handlebars->27->964"
11111 ]
11112 },
11113 {
@@ -11229,8 +11230,8 @@
11230 "ru": "Принудительно сбросить пароль при следующем входе в систему.",
11231 "zh-chs": "下次登錄時強制重置密碼。",
11232 "xloc": [
11232 - "default.handlebars->25->1488",
11233 - "default.handlebars->25->1658"
11233 + "default.handlebars->27->1492",
11234 + "default.handlebars->27->1662"
11235 ]
11236 },
11237 {
@@ -11316,8 +11317,8 @@
11317 "ru": "Свободно",
11318 "zh-chs": "自由",
11319 "xloc": [
11319 - "default.handlebars->25->1731",
11320 - "default.handlebars->25->1733"
11320 + "default.handlebars->27->1735",
11321 + "default.handlebars->27->1737"
11322 ]
11323 },
11324 {
@@ -11335,7 +11336,7 @@
11336 "zh-chs": "FreeBSD x86-64",
11337 "xloc": [
11338 "default-mobile.handlebars->9->36",
11338 - "default.handlebars->25->43"
11339 + "default.handlebars->27->43"
11340 ]
11341 },
11342 {
@@ -11352,7 +11353,7 @@
11353 "ru": "Французский (Бельгия)",
11354 "zh-chs": "法語(比利時)",
11355 "xloc": [
11355 - "default.handlebars->25->962"
11356 + "default.handlebars->27->966"
11357 ]
11358 },
11359 {
@@ -11369,7 +11370,7 @@
11370 "ru": "Французский (Канада)",
11371 "zh-chs": "法語(加拿大)",
11372 "xloc": [
11372 - "default.handlebars->25->963"
11373 + "default.handlebars->27->967"
11374 ]
11375 },
11376 {
@@ -11386,7 +11387,7 @@
11387 "ru": "Французский (Франция)",
11388 "zh-chs": "法語(法國)",
11389 "xloc": [
11389 - "default.handlebars->25->964"
11390 + "default.handlebars->27->968"
11391 ]
11392 },
11393 {
@@ -11403,7 +11404,7 @@
11404 "ru": "Французский (Люксембург)",
11405 "zh-chs": "法語(盧森堡)",
11406 "xloc": [
11406 - "default.handlebars->25->965"
11407 + "default.handlebars->27->969"
11408 ]
11409 },
11410 {
@@ -11420,7 +11421,7 @@
11421 "ru": "Французский (Монако)",
11422 "zh-chs": "法語(摩納哥)",
11423 "xloc": [
11423 - "default.handlebars->25->966"
11424 + "default.handlebars->27->970"
11425 ]
11426 },
11427 {
@@ -11437,7 +11438,7 @@
11438 "ru": "Французский (Стандартный)",
11439 "zh-chs": "法語(標準)",
11440 "xloc": [
11440 - "default.handlebars->25->961"
11441 + "default.handlebars->27->965"
11442 ]
11443 },
11444 {
@@ -11454,7 +11455,7 @@
11455 "ru": "Французский (Швейцария)",
11456 "zh-chs": "法語(瑞士)",
11457 "xloc": [
11457 - "default.handlebars->25->967"
11458 + "default.handlebars->27->971"
11459 ]
11460 },
11461 {
@@ -11471,7 +11472,7 @@
11472 "ru": "Фризский",
11473 "zh-chs": "弗里斯蘭語",
11474 "xloc": [
11474 - "default.handlebars->25->968"
11475 + "default.handlebars->27->972"
11476 ]
11477 },
11478 {
@@ -11488,7 +11489,7 @@
11489 "ru": "Фриульский",
11490 "zh-chs": "弗留利",
11491 "xloc": [
11491 - "default.handlebars->25->969"
11492 + "default.handlebars->27->973"
11493 ]
11494 },
11495 {
@@ -11509,9 +11510,9 @@
11510 "default-mobile.handlebars->9->387",
11511 "default-mobile.handlebars->9->396",
11512 "default-mobile.handlebars->9->414",
11512 - "default.handlebars->25->1142",
11513 - "default.handlebars->25->1274",
11514 - "default.handlebars->25->1500"
11513 + "default.handlebars->27->1146",
11514 + "default.handlebars->27->1278",
11515 + "default.handlebars->27->1504"
11516 ]
11517 },
11518 {
@@ -11528,7 +11529,7 @@
11529 "ru": "Администратор с полным доступом (все права)",
11530 "zh-chs": "正式管理員(保留所有權利)",
11531 "xloc": [
11531 - "default.handlebars->25->1308"
11532 + "default.handlebars->27->1312"
11533 ]
11534 },
11535 {
@@ -11559,7 +11560,7 @@
11560 "ru": "Полные права на устройство",
11561 "zh-chs": "完整的設備權限",
11562 "xloc": [
11562 - "default.handlebars->25->583"
11563 + "default.handlebars->27->587"
11564 ]
11565 },
11566 {
@@ -11575,7 +11576,7 @@
11576 "ru": "Полные права",
11577 "zh-chs": "完全权利",
11578 "xloc": [
11578 - "default.handlebars->25->599"
11579 + "default.handlebars->27->603"
11580 ]
11581 },
11582 {
@@ -11611,7 +11612,7 @@
11612 "ru": "Администратор с полным доступом",
11613 "zh-chs": "正式管理員",
11614 "xloc": [
11614 - "default.handlebars->25->1584"
11615 + "default.handlebars->27->1588"
11616 ]
11617 },
11618 {
@@ -11625,7 +11626,7 @@
11626 "zh-chs": "显卡",
11627 "xloc": [
11628 "default-mobile.handlebars->9->365",
11628 - "default.handlebars->25->843"
11629 + "default.handlebars->27->847"
11630 ]
11631 },
11632 {
@@ -11642,7 +11643,7 @@
11643 "ru": "Гэльский (Ирландский)",
11644 "zh-chs": "蓋爾語(愛爾蘭)",
11645 "xloc": [
11645 - "default.handlebars->25->971"
11646 + "default.handlebars->27->975"
11647 ]
11648 },
11649 {
@@ -11659,7 +11660,7 @@
11660 "ru": "Гэльский (Шотландия)",
11661 "zh-chs": "蓋爾語(蘇格蘭語)",
11662 "xloc": [
11662 - "default.handlebars->25->970"
11663 + "default.handlebars->27->974"
11664 ]
11665 },
11666 {
@@ -11676,7 +11677,7 @@
11677 "ru": "Галицкий",
11678 "zh-chs": "加拉契人",
11679 "xloc": [
11679 - "default.handlebars->25->972"
11680 + "default.handlebars->27->976"
11681 ]
11682 },
11683 {
@@ -11693,7 +11694,7 @@
11694 "ru": "MAC шлюза",
11695 "zh-chs": "網關MAC",
11696 "xloc": [
11696 - "default.handlebars->25->89"
11697 + "default.handlebars->27->89"
11698 ]
11699 },
11700 {
@@ -11750,7 +11751,7 @@
11751 "ru": "Общая информация",
11752 "zh-chs": "一般信息",
11753 "xloc": [
11753 - "default.handlebars->25->445"
11754 + "default.handlebars->27->447"
11755 ]
11756 },
11757 {
@@ -11767,7 +11768,7 @@
11768 "ru": "Генерация новых токенов",
11769 "zh-chs": "生成新令牌",
11770 "xloc": [
11770 - "default.handlebars->25->122"
11771 + "default.handlebars->27->122"
11772 ]
11773 },
11774 {
@@ -11784,7 +11785,7 @@
11785 "ru": "Грузинский",
11786 "zh-chs": "格魯吉亞人",
11787 "xloc": [
11787 - "default.handlebars->25->973"
11788 + "default.handlebars->27->977"
11789 ]
11790 },
11791 {
@@ -11801,7 +11802,7 @@
11802 "ru": "Немецкий (Австрия)",
11803 "zh-chs": "德語(奧地利)",
11804 "xloc": [
11804 - "default.handlebars->25->975"
11805 + "default.handlebars->27->979"
11806 ]
11807 },
11808 {
@@ -11818,7 +11819,7 @@
11819 "ru": "Немецкий (Германия)",
11820 "zh-chs": "德文(德國)",
11821 "xloc": [
11821 - "default.handlebars->25->976"
11822 + "default.handlebars->27->980"
11823 ]
11824 },
11825 {
@@ -11835,7 +11836,7 @@
11836 "ru": "Немецкий (Лихтенштейн)",
11837 "zh-chs": "德文(列支敦士登)",
11838 "xloc": [
11838 - "default.handlebars->25->977"
11839 + "default.handlebars->27->981"
11840 ]
11841 },
11842 {
@@ -11852,7 +11853,7 @@
11853 "ru": "Немецкий (Люксембург)",
11854 "zh-chs": "德語(盧森堡)",
11855 "xloc": [
11855 - "default.handlebars->25->978"
11856 + "default.handlebars->27->982"
11857 ]
11858 },
11859 {
@@ -11869,7 +11870,7 @@
11870 "ru": "Немецкий (Стандартный)",
11871 "zh-chs": "德語(標準)",
11872 "xloc": [
11872 - "default.handlebars->25->974"
11873 + "default.handlebars->27->978"
11874 ]
11875 },
11876 {
@@ -11886,7 +11887,7 @@
11887 "ru": "Немецкий (Швейцария)",
11888 "zh-chs": "德語(瑞士)",
11889 "xloc": [
11889 - "default.handlebars->25->979"
11890 + "default.handlebars->27->983"
11891 ]
11892 },
11893 {
@@ -11903,7 +11904,7 @@
11904 "ru": "Получить учетные данные MQTT для этого устройства.",
11905 "zh-chs": "獲取此設備的MQTT登錄憑據。",
11906 "xloc": [
11906 - "default.handlebars->25->564"
11907 + "default.handlebars->27->568"
11908 ]
11909 },
11910 {
@@ -11969,7 +11970,7 @@
11970 "ru": "Хорошо",
11971 "zh-chs": "好",
11972 "xloc": [
11972 - "default.handlebars->25->1138"
11973 + "default.handlebars->27->1142"
11974 ]
11975 },
11976 {
@@ -12006,7 +12007,7 @@
12007 "ru": "Греческий",
12008 "zh-chs": "希臘語",
12009 "xloc": [
12009 - "default.handlebars->25->980"
12010 + "default.handlebars->27->984"
12011 ]
12012 },
12013 {
@@ -12024,7 +12025,7 @@
12025 "zh-chs": "組",
12026 "xloc": [
12027 "default-mobile.handlebars->9->207",
12027 - "default.handlebars->25->473",
12028 + "default.handlebars->27->475",
12029 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->9->devListToolbarSort->sortselect->1"
12030 ]
12031 },
@@ -12042,9 +12043,9 @@
12043 "ru": "Групповое действие",
12044 "zh-chs": "集體行動",
12045 "xloc": [
12045 - "default.handlebars->25->1452",
12046 - "default.handlebars->25->1521",
12047 - "default.handlebars->25->408",
12046 + "default.handlebars->27->1456",
12047 + "default.handlebars->27->1525",
12048 + "default.handlebars->27->408",
12049 "default.handlebars->container->column_l->p1->devListToolbarSpan->1->0->devListToolbar",
12050 "default.handlebars->container->column_l->p4->3->1->0->3->3",
12051 "default.handlebars->container->column_l->p50->3->1->0->3->3"
@@ -12054,7 +12055,7 @@
12055 "en": "Group Identifier",
12056 "nl": "Groepsidentificatie",
12057 "xloc": [
12057 - "default.handlebars->25->1538"
12058 + "default.handlebars->27->1542"
12059 ]
12060 },
12061 {
@@ -12071,7 +12072,7 @@
12072 "ru": "Члены группы",
12073 "zh-chs": "小組成員",
12074 "xloc": [
12074 - "default.handlebars->25->1547"
12075 + "default.handlebars->27->1551"
12076 ]
12077 },
12078 {
@@ -12088,7 +12089,7 @@
12089 "ru": "Права на группу для пользователя {0}.",
12090 "zh-chs": "用戶{0}的組權限。",
12091 "xloc": [
12091 - "default.handlebars->25->1273"
12092 + "default.handlebars->27->1277"
12093 ]
12094 },
12095 {
@@ -12105,7 +12106,7 @@
12106 "ru": "Права на группу для {0}.",
12107 "zh-chs": "{0}的組權限。",
12108 "xloc": [
12108 - "default.handlebars->25->1272"
12109 + "default.handlebars->27->1276"
12110 ]
12111 },
12112 {
@@ -12156,7 +12157,7 @@
12157 "ru": "Гуджарати",
12158 "zh-chs": "古久拉提",
12159 "xloc": [
12159 - "default.handlebars->25->981"
12160 + "default.handlebars->27->985"
12161 ]
12162 },
12163 {
@@ -12192,7 +12193,7 @@
12193 "ru": "Гаитянский",
12194 "zh-chs": "海地",
12195 "xloc": [
12195 - "default.handlebars->25->982"
12196 + "default.handlebars->27->986"
12197 ]
12198 },
12199 {
@@ -12226,7 +12227,7 @@
12227 "ru": "Жесткое отключение агента",
12228 "zh-chs": "硬斷開劑",
12229 "xloc": [
12229 - "default.handlebars->25->870"
12230 + "default.handlebars->27->874"
12231 ]
12232 },
12233 {
@@ -12243,7 +12244,7 @@
12244 "ru": "Всего кучи",
12245 "zh-chs": "堆總數",
12246 "xloc": [
12246 - "default.handlebars->25->1772"
12247 + "default.handlebars->27->1776"
12248 ]
12249 },
12250 {
@@ -12260,7 +12261,7 @@
12261 "ru": "Куча используется",
12262 "zh-chs": "堆使用",
12263 "xloc": [
12263 - "default.handlebars->25->1771"
12264 + "default.handlebars->27->1775"
12265 ]
12266 },
12267 {
@@ -12277,7 +12278,7 @@
12278 "ru": "Иврит",
12279 "zh-chs": "希伯來語",
12280 "xloc": [
12280 - "default.handlebars->25->983"
12281 + "default.handlebars->27->987"
12282 ]
12283 },
12284 {
@@ -12311,7 +12312,7 @@
12312 "ru": "Помочь перевести MeshCentral",
12313 "zh-chs": "幫助翻譯MeshCentral",
12314 "xloc": [
12314 - "default.handlebars->25->1097"
12315 + "default.handlebars->27->1101"
12316 ]
12317 },
12318 {
@@ -12379,8 +12380,8 @@
12380 "xloc": [
12381 "default-mobile.handlebars->9->175",
12382 "default-mobile.handlebars->9->182",
12382 - "default.handlebars->25->372",
12383 - "default.handlebars->25->5"
12383 + "default.handlebars->27->372",
12384 + "default.handlebars->27->5"
12385 ]
12386 },
12387 {
@@ -12397,7 +12398,7 @@
12398 "ru": "Хинди",
12399 "zh-chs": "印地語",
12400 "xloc": [
12400 - "default.handlebars->25->984"
12401 + "default.handlebars->27->988"
12402 ]
12403 },
12404 {
@@ -12433,7 +12434,7 @@
12434 "zh-chs": "持有1份副本",
12435 "xloc": [
12436 "default-mobile.handlebars->9->308",
12436 - "default.handlebars->25->776"
12437 + "default.handlebars->27->780"
12438 ]
12439 },
12440 {
@@ -12451,7 +12452,7 @@
12452 "zh-chs": "持有1個搬家公司",
12453 "xloc": [
12454 "default-mobile.handlebars->9->312",
12454 - "default.handlebars->25->780"
12455 + "default.handlebars->27->784"
12456 ]
12457 },
12458 {
@@ -12469,7 +12470,7 @@
12470 "zh-chs": "保留{0}個條目進行複制",
12471 "xloc": [
12472 "default-mobile.handlebars->9->306",
12472 - "default.handlebars->25->774"
12473 + "default.handlebars->27->778"
12474 ]
12475 },
12476 {
@@ -12487,7 +12488,7 @@
12488 "zh-chs": "保留{0}個條目以進行移動",
12489 "xloc": [
12490 "default-mobile.handlebars->9->310",
12490 - "default.handlebars->25->778"
12491 + "default.handlebars->27->782"
12492 ]
12493 },
12494 {
@@ -12505,7 +12506,7 @@
12506 "zh-chs": "保持{2}的{0}入口{1}",
12507 "xloc": [
12508 "default-mobile.handlebars->9->129",
12508 - "default.handlebars->25->1402"
12509 + "default.handlebars->27->1406"
12510 ]
12511 },
12512 {
@@ -12526,9 +12527,9 @@
12527 "default-mobile.handlebars->9->210",
12528 "default-mobile.handlebars->9->212",
12529 "default-mobile.handlebars->9->272",
12529 - "default.handlebars->25->247",
12530 - "default.handlebars->25->478",
12531 - "default.handlebars->25->693"
12530 + "default.handlebars->27->247",
12531 + "default.handlebars->27->480",

This file is too large to show in full.

views/default.handlebars
+36
@@ -77,6 +77,9 @@
77 <div id="altPortContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
78 <div class="cmtext" onclick="cmaltportaction(1,event)">Alternate Port</div>
79 </div>
80 + <div id="rfbPortContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
81 + <div class="cmtext" onclick="cmrfbportaction(1,event)">Alternate Port</div>
82 + </div>
83 <div id="filesContextMenu" class="contextMenu noselect" style="display:none;min-width:0px">
84 <div class="cmtext" onclick="cmfilesaction(1,event)">Rename</div>
85 <div class="cmtext" onclick="cmfilesaction(2,event)">Edit</div>
@@ -2193,6 +2196,13 @@
2196 newWindow.opener = null;
2197 }
2198 }
2199 + if (message.tag == 'novnc') {
2200 + var vncurl = window.location.origin + domainUrl + 'novnc/vnc.html?ws=wss%3A%2F%2F' + window.location.hostname + '%2Fmeshrelay.ashx%3Fauth%3D' + message.cookie;
2201 + var node = getNodeFromId(message.nodeid);
2202 + if (node != null) { vncurl += '&name=' + encodeURIComponentEx(node.name); }
2203 + var newWindow = window.open(vncurl, 'mcnovnc/' + message.nodeid);
2204 + newWindow.opener = null;
2205 + }
2206 break;
2207 }
2208 case 'getNotes': {
@@ -2605,6 +2615,7 @@
2615 node.tags = message.event.node.tags;
2616 node.userloc = message.event.node.userloc;
2617 node.rdpport = message.event.node.rdpport;
2618 + node.rfbport = message.event.node.rfbport;
2619 node.consent = message.event.node.consent;
2620 if (message.event.node.links != null) { node.links = message.event.node.links; } else { delete node.links; }
2621 if (message.event.node.agent != null) {
@@ -4413,6 +4424,20 @@
4424 if (currentNode.rdpport != null) { Q('d10rdpport').value = currentNode.rdpport; }
4425 }
4426
4427 + function cmrfbportaction(action) {
4428 + if (xxdialogMode) return;
4429 + var x = "noVNC remote connection port:" + '<br /><br /><input type=text placeholder="5900" inputmode="numeric" pattern="[0-9]*" onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" maxlength=5 id=d10rfbport type=text>';
4430 + setDialogMode(2, "noVNC Connection", 3, function() {
4431 + setDialogMode(0);
4432 + // Save the new RFB port to the server
4433 + var rfbport = ((Q('d10rfbport').value.length > 0) ? parseInt(Q('d10rfbport').value) : 3389);
4434 + meshserver.send({ action: 'changedevice', nodeid: currentNode._id, rfbport: rfbport });
4435 + if (currentNode != null) { p10rfb(currentNode._id, rfbport); }
4436 + }, x, currentNode);
4437 + Q('d10rfbport').focus();
4438 + if (currentNode.rfbport != null) { Q('d10rfbport').value = currentNode.rfbport; }
4439 + }
4440 +
4441 function cmfilesaction(action) {
4442 if (xxdialogMode) return;
4443 var filetreexx = p13sort_files(p13filetree.dir);
@@ -4459,6 +4484,7 @@
4484 QV('termShellContextMenuLinux', false);
4485 QV('deskConnectContextMenu', false);
4486 QV('altPortContextMenu', false);
4487 + QV('rfbPortContextMenu', false);
4488 QV('filesContextMenu', false);
4489 QV('deskPlayerContextMenu', false);
4490 //QV('pluginTabContextMenu', false);
@@ -5336,6 +5362,11 @@
5362 }
5363 }
5364
5365 + // noVNC link
5366 + if (((connectivity & 1) != 0) && (node.agent) && ((meshrights & 8) != 0)) {
5367 + x += '<a href=# cmenu=rfbPortContextMenu id=rfbLink onclick=p10rfb("' + node._id + '") title="' + "Launch noVNC session to this device" + '.">' + "noVNC" + '</a>&nbsp;';
5368 + }
5369 +
5370 // MQTT options
5371 if ((meshrights == 0xFFFFFFFF) && (features & 0x00400000)) { x += '<a href=# onclick=p10showMqttLoginDialog("' + node._id + '") title="' + "Get MQTT login credentials for this device." + '">' + "MQTT Login" + '</a>&nbsp;'; }
5372 x += '</div><br>'
@@ -5844,6 +5875,11 @@
5875 return false;
5876 }
5877
5878 + function p10rfb(nodeid, port) {
5879 + if (port == null) { if (currentNode.rfbport != null) { port = currentNode.rfbport; } else { port = 5900; } }
5880 + meshserver.send({ action: 'getcookie', nodeid: nodeid, tcpport: port, tag: 'novnc' });
5881 + }
5882 +
5883 // Show current location
5884 var d2map = null;
5885 function p10showNodeLocationDialog() {
webserver.js
+1 -1
@@ -4216,7 +4216,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
4216 'Referrer-Policy': 'no-referrer',
4217 'X-XSS-Protection': '1; mode=block',
4218 'X-Content-Type-Options': 'nosniff',
4219 - 'Content-Security-Policy': "default-src 'none'; script-src 'self' 'unsafe-inline'; connect-src 'self'" + geourl + selfurl + "; img-src 'self'" + geourl + " data:; style-src 'self' 'unsafe-inline'; frame-src 'self' mcrouter:; media-src 'self'; form-action 'self'"
4219 + 'Content-Security-Policy': "default-src 'none'; font-src 'self'; script-src 'self' 'unsafe-inline'; connect-src 'self'" + geourl + selfurl + "; img-src 'self'" + geourl + " data:; style-src 'self' 'unsafe-inline'; frame-src 'self' mcrouter:; media-src 'self'; form-action 'self'"
4220 };
4221 if ((parent.config.settings.allowframing !== true) && (typeof parent.config.settings.allowframing !== 'string')) { headers['X-Frame-Options'] = 'sameorigin'; }
4222 res.set(headers);