Updated MeshCommander and fixes to message dispatch.
Ylian Saint-Hilaire committed
Jul 10, 2019 at 14:27 UTC
d443645423399f2aaf26f82df1919665c6dd6df6
6 files changed
+909
-907
db.js
+3
-1
@@ -31,6 +31,7 @@ module.exports.CreateDB = function (parent, func) {
31
var expireEventsSeconds = (60 * 60 * 24 * 20); // By default, expire events after 20 days. (Seconds * Minutes * Hours * Days)
32
var expirePowerEventsSeconds = (60 * 60 * 24 * 10); // By default, expire power events after 10 days. (Seconds * Minutes * Hours * Days)
33
var expireServerStatsSeconds = (60 * 60 * 24 * 30); // By default, expire power events after 30 days. (Seconds * Minutes * Hours * Days)
34
+ const common = require('./common.js');
35
obj.identifier = null;
36
obj.dbKey = null;
37
obj.changeStream = false;
@@ -851,6 +852,7 @@ module.exports.CreateDB = function (parent, func) {
852
853
// Called when a device group has changed
854
function dbMeshChange(meshChange, added) {
855
+ common.unEscapeLinksFieldName(meshChange.fullDocument);
856
const mesh = meshChange.fullDocument;
857
858
// Update the mesh object in memory
@@ -865,7 +867,7 @@ module.exports.CreateDB = function (parent, func) {
867
delete mesh.type;
868
delete mesh._id;
869
if (mesh.amt) { delete mesh.amt.password; } // Remove the Intel AMT password if present
868
- parent.DispatchEvent(['*', mesh._id], obj, mesh);
870
+ parent.DispatchEvent(['*', mesh.meshid], obj, mesh);
871
}
872
873
// Called when a user account has changed
meshuser.js
+45
-54
@@ -566,7 +566,14 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
566
case 'help': {
567
r = 'Available commands: help, info, versions, args, resetserver, showconfig, usersessions, tasklimiter, setmaxtasks, cores,\r\n'
568
r += 'migrationagents, agentstats, webstats, mpsstats, swarmstats, acceleratorsstats, updatecheck, serverupdate, nodeconfig,\r\n';
569
- r += 'heapdump, relays, autobackup, backupconfig, dupagents.';
569
+ r += 'heapdump, relays, autobackup, backupconfig, dupagents, dispatchtable.';
570
+ break;
571
+ }
572
+ case 'dispatchtable': {
573
+ r = '';
574
+ for (var i in parent.parent.eventsDispatch) {
575
+ r += (i + ', ' + parent.parent.eventsDispatch[i].length + '\r\n');
576
+ }
577
break;
578
}
579
case 'dupagents': {
@@ -972,7 +979,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
979
mesh = parent.meshes[meshid];
980
if (mesh) {
981
// Remove user from the mesh
975
- if (mesh.links[deluser._id] != null) { delete mesh.links[deluser._id]; parent.db.Set(mesh); }
982
+ if (mesh.links[deluser._id] != null) { delete mesh.links[deluser._id]; parent.db.Set(common.escapeLinksFieldName(mesh)); }
983
// Notify mesh change
984
change = 'Removed user ' + deluser.name + ' from group ' + mesh.name;
985
var event = { etype: 'mesh', username: user.name, userid: user._id, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, action: 'meshchange', links: mesh.links, msg: change, domain: domain.id };
@@ -1522,65 +1529,50 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1529
} catch (ex) { err = 'Validation exception: ' + ex; }
1530
1531
// Handle any errors
1525
- if (err != null) {
1526
- if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: err })); } catch (ex) { } }
1527
- break;
1528
- }
1532
+ if (err != null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: err })); } catch (ex) { } } break; }
1533
1530
- db.Get(command.meshid, function (err, meshes) {
1531
- if (meshes.length != 1) {
1532
- if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: 'Unknown device group' })); } catch (ex) { } }
1533
- return;
1534
- }
1535
- var mesh = common.unEscapeLinksFieldName(meshes[0]);
1534
+ // Get the device group reference we are going to delete
1535
+ var mesh = parent.meshes[command.meshid];
1536
+ if (mesh == null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: 'Unknown device group' })); } catch (ex) { } } return; }
1537
1537
- // Check if this user has rights to do this
1538
- var err = null;
1539
- if (mesh.links[user._id] == null || mesh.links[user._id].rights != 0xFFFFFFFF) { err = 'Access denied'; }
1540
- if ((command.meshid.split('/').length != 3) || (command.meshid.split('/')[1] != domain.id)) { err = 'Invalid group'; } // Invalid domain, operation only valid for current domain
1541
-
1542
- // Handle any errors
1543
- if (err != null) {
1544
- if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: err })); } catch (ex) { } }
1545
- return;
1546
- }
1547
-
1548
- // Fire the removal event first, because after this, the event will not route
1549
- var event = { etype: 'mesh', username: user.name, meshid: command.meshid, name: command.meshname, action: 'deletemesh', msg: 'Mesh deleted: ' + command.meshname, domain: domain.id };
1550
- parent.parent.DispatchEvent(['*', command.meshid], obj, event); // Even if DB change stream is active, this event need to be acted on.
1551
-
1552
- // Remove all user links to this mesh
1553
- for (i in meshes) {
1554
- var links = meshes[i].links;
1555
- for (var j in links) {
1556
- var xuser = parent.users[j];
1557
- if (xuser && xuser.links) {
1558
- delete xuser.links[meshes[i]._id];
1559
- db.SetUser(xuser);
1560
- parent.parent.DispatchEvent([xuser._id], obj, 'resubscribe');
1561
- }
1562
- }
1538
+ // Check if this user has rights to do this
1539
+ var err = null;
1540
+ if (mesh.links[user._id] == null || mesh.links[user._id].rights != 0xFFFFFFFF) { err = 'Access denied'; }
1541
+ if ((command.meshid.split('/').length != 3) || (command.meshid.split('/')[1] != domain.id)) { err = 'Invalid group'; } // Invalid domain, operation only valid for current domain
1542
+
1543
+ // Handle any errors
1544
+ if (err != null) { if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: err })); } catch (ex) { } } return; }
1545
+
1546
+ // Fire the removal event first, because after this, the event will not route
1547
+ var event = { etype: 'mesh', username: user.name, meshid: command.meshid, name: command.meshname, action: 'deletemesh', msg: 'Mesh deleted: ' + command.meshname, domain: domain.id };
1548
+ parent.parent.DispatchEvent(['*', command.meshid], obj, event); // Even if DB change stream is active, this event need to be acted on.
1549
+
1550
+ // Remove all user links to this mesh
1551
+ for (var j in mesh.links) {
1552
+ var xuser = parent.users[j];
1553
+ if (xuser && xuser.links) {
1554
+ delete xuser.links[mesh._id];
1555
+ db.SetUser(xuser);
1556
+ parent.parent.DispatchEvent([xuser._id], obj, 'resubscribe');
1557
}
1558
+ }
1559
1565
- // Delete all files on the server for this mesh
1566
- try {
1567
- var meshpath = parent.getServerRootFilePath(mesh);
1568
- if (meshpath != null) { parent.deleteFolderRec(meshpath); }
1569
- } catch (e) { }
1560
+ // Delete all files on the server for this mesh
1561
+ try {
1562
+ var meshpath = parent.getServerRootFilePath(mesh);
1563
+ if (meshpath != null) { parent.deleteFolderRec(meshpath); }
1564
+ } catch (e) { }
1565
1571
- parent.parent.RemoveEventDispatchId(command.meshid); // Remove all subscriptions to this mesh
1566
+ parent.parent.RemoveEventDispatchId(command.meshid); // Remove all subscriptions to this mesh
1567
1573
- // Mark the mesh as deleted
1574
- var dbmesh = meshes[0];
1575
- dbmesh.deleted = new Date(); // Mark the time this mesh was deleted, we can expire it at some point.
1576
- db.Set(common.escapeLinksFieldName(mesh)); // We don't really delete meshes because if a device connects to is again, we will up-delete it.
1577
- parent.meshes[command.meshid] = mesh; // Update the mesh in memory;
1568
+ // Mark the mesh as deleted
1569
+ mesh.deleted = new Date(); // Mark the time this mesh was deleted, we can expire it at some point.
1570
+ db.Set(common.escapeLinksFieldName(mesh)); // We don't really delete meshes because if a device connects to is again, we will un-delete it.
1571
1579
- // Delete all devices attached to this mesh in the database
1580
- db.RemoveMeshDocuments(command.meshid);
1572
+ // Delete all devices attached to this mesh in the database
1573
+ db.RemoveMeshDocuments(command.meshid);
1574
1582
- if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: 'ok' })); } catch (ex) { } }
1583
- });
1575
+ if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'deletemesh', responseid: command.responseid, result: 'ok' })); } catch (ex) { } }
1576
break;
1577
}
1578
case 'editmesh':
@@ -1712,7 +1704,6 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
1704
} else {
1705
event = { etype: 'mesh', username: user.name, userid: (deluserid.split('/')[2]), meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, action: 'meshchange', links: mesh.links, msg: 'Removed user ' + (deluserid.split('/')[2]) + ' from group ' + mesh.name, domain: domain.id };
1706
}
1715
- if (db.changeStream) { event.noact = 1; } // If DB change stream is active, don't use this event to change the mesh. Another event will come.
1707
parent.parent.DispatchEvent(['*', mesh._id, user._id, command.userid], obj, event);
1708
if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'removemeshuser', responseid: command.responseid, result: 'ok' })); } catch (ex) { } }
1709
} else {
public/commander.htm
+832
-831
@@ -1,4 +1,4 @@
1
-<!DOCTYPE html><html style=height:100%><head><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="text/html;charset=utf-8" http-equiv=Content-Type><meta name=format-detection content="telephone=no"><link rel="icon" type=image/png href="data:image/png;base64,iVBORw0KGgo="><style>body{height:100%;max-height:100%;overflow:hidden;font-family:arial, helvetica, sans-serif;font-size:9pt;color:black;background:white;margin-top:0;margin-left:0;margin-right:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}li{margin:0;padding:0;}label{display:block;color:windowtext;background-color:window;margin:0;padding:0;width:100%;}label:hover{background-color:highlight;color:highlighttext;}a:visited{text-decoration:none;color:#04f;}a:link{text-decoration:none;color:#04f;}a:hover{color:#a32;}h1{font-size:11pt;font-weight:bold;color:black;margin-left:5px;margin-top:10px;margin-bottom:6px;}h2{font-size:9pt;font-weight:bold;color:black;margin-left:6px;margin-top:6px;margin-bottom:0;}p{margin-left:6px;margin-top:4px;margin-bottom:0;margin-right:2px;}td{font-size:9pt;}th{font-size:9pt;}th:hover{cursor:pointer;background:#aaa;}.header{position:fixed;top:0;left:0;right:0;height:24px;background:#c0c0c0;}.progressbar{position:fixed;top:24px;left:0;right:0;height:2px;background:#ff9e30;}.in{margin-left:40px;}.log{background:#bbbab5;}.log1{background:#bbbab5;}.log tbody tr:nth-child(odd){background:#e8eefe;}.fullcell{position:fixed;top:26px;right:0;bottom:0;left:0px;overflow:hidden;}.maincell{position:fixed;top:26px;right:0;bottom:0;left:156px;overflow:auto;padding-left:2px;vertical-align:top;}.navbar{position:fixed;top:26px;left:0;bottom:0;width:156px;border-right:2px solid #ff9e30;vertical-align:top;background:#72726f;background:linear-gradient(45deg, #72726f 0%,#a6a5a0 100%);}.nav1{padding:1px 0px 1px 8px;margin:0px;font-weight:bold;color:black;white-space:nowrap;cursor:pointer;}.nav2{margin-left:32px;margin-top:0;color:black;cursor:pointer;}.r{font-size:11pt;}.r0{background:white;}.r1{border-bottom:1px solid gray;text-align:left;}.r2{text-align:left;}.r3{border-bottom:1px solid gray;text-align:left;}.r3:hover{background-color:#83827b;cursor:pointer;}.spread{height:100%;width:100%;background-color:white;}.timer{border:1px solid #abcae1;background-color:#abcae1;}.tm{font-size:7pt;}.top1{font-size:14pt;font-weight:bold;color:white;margin-top:11px;}.top2{color:white;}.warn{font-weight:bold;color:#c00000;}.icon1{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMISURBVHjadJPPb9t0GMY//rbJaEKSxoPFQQ1WxhQ7RaGoIDEpTBMqgk7iBvwNKJdJXDnssEMl7pMGfwOH9YBYh0AglYiBBNKa0cSGNpiRxs7aJE2aH7aTmkPXqTvwXt7L8z56pef5SEEQcHYMwyjWarX3rLr1tu3YOQAlpZhqVv1J1/VvNU0rn9VLpwbtdlspb5ZLNdNcuZBKF1NKmuS8DECn28axm7ScZlnP5b4vXinelmXZfmrQbreVjbsbN3r9YSmTLbA/Ps92K8FgFAbAdYcsLXRRk10af/9BPBa5vXpt9aYsy7YAKG+WS73+sJS+eJmKneZe5QWEiHHreoJb1xNEInHu/Bzw3cM45zNv0usPS+XNcglAGIZRrJnmSiZbYOtRhF93ZvHcHoPRlN3GkL4Ho5HHeOxRqbv8sHVM+uVFaqa5YhhGUVpfXw+6hwP86DJ3fgkzK44hOGZuLkH7KIQIxuw9dkk812Hqu0wmPh9djZIKG8wnogirbpFS0jy0YOqPcMcurjvh3Vc7fPHpHF9//iLLyja75p/sNWxazj73t9qklDRW3ULYjk1yXmb3Xw/P9fA9n35/AMD0yAIgGQ8zOtxnMhFM/ClG/YjkvIzt2Mye5un5Lr4HY9el5RwA2tOsY9FzCCFBICCYOdlPRigphU63jZKEwWDAweMDJt7kmXINBhOkIEAQQiLMpczzJzcpBaFmVRy7iZ4RdA/7TKcBknTymOd5APT6PiAhghlmpHO8ocdw7CZqVkXour7Ycppriwsuy7koEgKQANDy+dPCIokQkhTiciFG4aJPy2mu6bq+OKtpWlXPmZWGtc2H77yOhOD+gxE7//T45sdHzEjQ7Y0IgmPeKszxwdUwTuM39Fyuomla9bTKyY27Gx/3+sMvlYU8lXqI36sef+1UkCS4pMZZyuu89oqL09gmHot8snpt9StZljtnYUqWN8vv10yzcCGV/ux/YFrTc7lK8UrxnizLnWdoPINzvlarLVl1K2879ktPcN5Ts2pV1/UHmqZVz+r/GwBWYYCoNUz0KwAAAABJRU5ErkJggg==");}.icon2{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAIuSURBVHjalJNBTBNBFIb/2S4tlliFdLBNW0mktibaeivBm9eejFeDZw81kROXHj2SyIEDB65wI3iBI5iYmEjSREtIpI1tQdOm20KBdkuX3ZnnYUVq2Cb6kklm3vxv3vdm3oCI4DTazZ3p3HpM5NZjot3cmR6kY0QEJ9vdnNJcaoMP3xyB3vI2EunP4046xcl5WttK99olHn4URSA2AaNT5qe1rbST1pFgd3NKU93H/P6TJADg8GthIMU1gqODtZlep8QjiegfXzBuUxwdrM1cy9Z/IVIYSn4jpe1vx8jsviAABIBM/Tl9/5Sg/EZKk8JQ+mP+ImiUVjJGp8xDDycB2b1KIgSC0RCMTpk3SisZxxKkpXvqhaXs7aAfnhtukBBXKmFCHVLgj4yjXljKSkv3XDugXlyeM/QKDz24CxIWSJhXBKYJMk2MT3AYeoXXi8tzl3sqAFgXLV+zvJrxhzkUqwdxQQARZl+FbbqeXY7CGHjEj2Z5NcMnXy6o7tEzRkT4mX/7Tisuvok/joBJC5ACl8/LmAIov0EVBZIYvn35gUD89UI4mZ1lRrca2N9+lh8bPeG3RgCyTEBKgAi+1CEAoJ27B6gqGGMAY2idCbRORhvxp++TanVvviaMQ/g8XshzAxACIIn+/pLGOWAqYIoLAODzuKB1K7y6N19j+Y0U3fG3MCw6IMsCyM4Oxvob1l4ze84YQ5u8OD7jUNWhMXz4uI//tx4Syfjg3/iv9msAKbs79bi84QcAAAAASUVORK5CYII=");}.icon3{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAANGSURBVHjadJNNTBwFAIW//UFWfrbsgDuzBTvu0s6OWhHwYMhCOEAbSESC4dpL07TFg9GkxIRDjT3YhEBNPUjC0SbaJjVNQyJQaxtDpzYmlDYUOjuUrhspO0N0gQVWl/0ZD5ZmPfiSd3t5l/c+h23bFCsajR7Rdf1GPBbHtEwAJFFCDsqoqno0HA7/WJx37BUkk8k6bUYb0g2jxy8G6kQpgK9KAGB9I4llJlizEiuqokxE2iJfCIKw8qIgmUzWTU1OfZXaSve9KQep3tzA9fQJhfhvZHd3yfl85OUg26F6os9W8FaWXevq7vpIEIQVJ4A2ow2lttJ9LTU1hH64Tt1qHHv8a0rnH/LS4iPsK9/iixnUXr1Ck3cfqa10nzajDQG4o9HoEd0wet493Ij/zm18n3yMJxQivbND7Px58thUD3xI+egoBcMgd+FLlO73mTUWe5Ro9Jqrs7Nz2eUu9YbSacriT8lms5Q3NlLR3s6uaVJQFISRC1SUuFm9dInJ6WlCfpGMFPBub6eOueOxOMobb+H4+Ta/f3cZz927FPJ5hOPHqRkZgT/+xFniIjY6yveDg0gOB9l6BbHpBMbiPE7TMvFVCWSXl3DU7secnWXu9GniFy+ymctRIfhYHxvj6pkzBG2bA0Du8SN8VQKmZeLc2zOXybA2P8+mbeNpbydTWUmJ203etvGIInV+PxVA9t/pXvzALYkS6xtJqoRq/rJtqoNB/KdO8Up/P+atWxSA8t5e3vN6mT55kgOrq5TUH2J9I4kkSjjloIxlJiiEDiK2tREYHkbq7yd57x6XOzr4paMD59IS+7q7+WB8nPtuNyVN72CZCeSgjFNV1dY1K6H9fbiBDWk/uwsL5G7e5JuWFhTgVUBrbmZX11memyMgv0a64W3WrISmqmqrw7ZtJq5PfP4sYZ0Nl5ayPjJM4fECKdtGAF5+bt3pxBt+HWXwU37NZKgNiOd6ens+27uyNDU5dTa1lR44JAXwPHiA/fA++ScGTsB1UMHV1MxOQyOGmcBbWTbW1d11ThAEsxgmSZvRBnTD6PCLgcj/wKSpivJTpC0yJgiC+R8ai3CO6Lp+NB6Lt5qWqTzH2ZCD8h1VVW+Ew2GtOP/PAFZGexs+cGPjAAAAAElFTkSuQmCC");}.itemBar{padding:7px;min-height:20px;margin-top:4px;margin-right:8px;width:auto;border-radius:8px;background-color:#7e7d74;cursor:pointer;}.computeritem{cursor:pointer;width:auto;border-radius:5px;background-color:#a6a5a0;height:28px;margin:4px;padding:2px;}.computeritem:hover{background-color:#83827b;}.us{-webkit-touch-callout:initial;-webkit-user-select:auto;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}.rb{cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px;}.fileIcon1{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb49Y2Sj9LT2f///yH5BAEAAAMALAAAAAAQABAAAAImnI+py+1vhJwyUYAzHTL4D3qdlJWaIFJqmKod607sDKIiDUP63hQAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.fileIcon2{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAM2xV/Xur+XPgP///yH5BAEAAAMALAAAAAAQABAAAAJD3ISZIGHWUGihznesYDYATFVM+D2hJ4lgN1olxALAtAlmPCJvuMmJd6PJckDYwicrHhTD5o7plJmg0Uc0asNMkphHAQA7);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.fileIcon3{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb19IGBgbq6uv///yH5BAEAAAMALAAAAAAQABAAAAIy3ISpxgcPH2ouQgFEw1YmxnUXKEaaEZZnVWZk66JwzKpvuwZzwOgwb/C1gIOA8Yg8DgoAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.filelist{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;cursor:default;-khtml-user-drag:element;background-color:white;clear:both;}.fsize{float:right;text-align:right;width:180px;}</style><body onunload="cleanup()"><div id=0 class=header><table id=1 cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td id=2 class=style6><div> <input type=button class=connectbutton id=xconnectbutton1 value=Connect onclick="connectButtonfunction(event, false)" onkeypress="return false" onkeydown="return false"> <span id=constatus></span></div></table><div class=progressbar><div id=3 style=height:2px;width:0%;background-color:red></div></div></div><div id=4 class=fullcell style=text-align:center;padding-top:100px;font-size:20px><span id=5>Disconnected</span></div><div id=6 style=height:100%;display:none><div id=7 class=navbar><br><p id=go1 class=nav1 onclick=go(1)><a>System Status</a><p id=go14 class=nav1 onclick=go(14)><a>Remote Desktop</a><p id=go24 class=nav1 onclick=go(24)> <a>Files</a><p id=go13 class=nav1 onclick=go(13)><a>Serial-over-LAN</a><p id=go2 class=nav1 onclick=go(2)><a>Hardware Information</a><p id=go6 class=nav1 onclick=go(6)><a>Event Log</a><p id=go15 class=nav1 onclick=go(15)><a>Audit Log</a><p id=go21 class=nav1 onclick=go(21)><a>Storage</a><p id=go8 class=nav1 onclick=go(8)><a>Network Settings</a><p id=go17 class=nav1 onclick=go(17)><a>Internet Settings</a><p id=go16 class=nav1 onclick=go(16)><a>Security Settings</a><p id=go19 class=nav1 onclick=go(19)><a>Agent Presence</a><p id=go18 class=nav1 onclick=go(18)><a>System Defense</a><p id=go11 class=nav1 onclick=go(11)><a>User Accounts</a><p id=go22 class=nav1 onclick=go(22)><a>Subscriptions</a><p id=go23 class=nav1 onclick=go(23)><a>Wake Alarms</a><p id=go20 class=nav1 onclick=go(20)><a>Script Editor</a><p id=go12 class=nav1 onclick=go(12)><a>WSMAN Browser</a></div><div id=8 class=maincell><div id=9 style=position:relative;height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none><div style=float:right><input type=button value="Disk Map" onclick=iderToggleDiskMap()><input type=button value="Stop IDE-R Session" onclick=iderStop()></div><div style=font-size:16px;padding-top:2px> <span id=10></span></div><div id=iderHeatmap style="z-index:1000;position:absolute;top:31px;right:8px;border:1px solid black;box-shadow:0px 0px 10px;border-radius:5px;padding:8px;width:600px;background-color:#99CC99;display:none"><div id=floppyHeatMap style=display:none><div id=floppyHeatMapText style=margin:2px>Floppy, blocks are 512 bytes.</div><canvas id=floppyHeatMapCanvas width=600 height=0></canvas></div><div id=cdromHeatMap style=display:none><div id=cdromHeatMapText style=margin:2px>CDROM, blocks are 2048 bytes.</div><canvas id=cdromHeatMapCanvas width=600 height=0></canvas></div></div></div><div id=11 style=height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none;overflow:hidden><div style=float:right><input type=button value="Stop Script" onclick=script_Stop()></div><div style=font-size:16px;padding-top:2px;overflow:hidden> <b>Running Script</b><span style=overflow:hidden id=12></span></div></div><div id=13 style=height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none><div style=font-size:16px;float:right;cursor:pointer;padding-right:5px;padding-left:5px;padding-top:2px;font-size:15px onclick="QV(13, false)">✖</div><div style=font-size:14px;padding-top:2px> <b>This computer's firmware should be updated, <a style=cursor:pointer href="https://security-center.intel.com/advisory.aspx?intelid=INTEL-SA-00075&languageid=en-fr" rel="noreferrer noopener" target="_blank"><u>please check here</u></a>.</b></div></div><div id=14 style=width:100%;height:100%><iframe id=15 style=width:100%;height:100%;border:0></iframe></div><div id=16 style=padding:8px;overflow-x:hidden><div id=p0><h1>Loading...</h1></div><div id=p1 style=display:none><h1>System Status</h1><span id=17></span></div><div id=p2 style=display:none><h1 style=margin-bottom:16px>Hardware Information</h1><span id=18></span></div><div id=p6 style=display:none><h1>Event Log</h1><span id=19></span><span id=20></span></div><div id=p8 style=display:none><h1>Network Settings</h1><span id=21></span><span id=22></span></div><div id=p11 style=display:none><h1>User Accounts</h1><span id=23></span></div><div id=p12 style=display:none><h1>WSMAN Browser</h1><div><table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><div style=padding:4px><select id=24 multiple="multiple" style=width:100%;height:120px></select></div><tr><td><input id=25 type=button value=Query style=margin:4px onclick=wsmanQuery()><input type=button value=Clear style=margin:4px onclick="QH(26, '')"><input id=c0 placeholder=Filter style=margin:4px onkeyup=wsmanFilter()></table></div><br><div class=us id=26></div></div><div id=p13 style=display:none;min-width:780px><h1>Serial-over-LAN Terminal</h1><br><div id=27 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showFeaturesDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Intel® AMT Redirection port or Serial-over-LAN feature is disabled<span id=28>, click here to enable it.</span></div></div><div id=29 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showPowerActionDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Remote computer is not powered on, click here to issue a power command.</div></div><table cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><input onkeyup=sendTermInputKeys(event) autocorrect=off autocapitalize=off style=opacity:0;width:0;height:0;font-size:1px onblur="keyInputBlur()"><span id=30></span> <input type=button onkeypress="return false" onkeydown="return false" class=cadbutton value="Power Actions..." onclick=showPowerActionDlg() style=margin-right:3px><input type=button id=c1 value=SIDER title="Start server-side remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderServerStart() style=margin-right:3px><input type=button id=c2 value=IDER title="Start remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderStart() style=margin-right:3px><input id=c3 type=button onkeypress="return false" onkeydown="return false" class=cadbutton value="Start Capture" title="Toggle start/stop of terminal capture, when stopping the content of the capture buffer will be saved to a file." onclick=terminalCaptureToggle() style=margin-right:3px></div><div> <input type=button id=c4 value=Connect onclick=connectTerminal(event) disabled="disabled"> <span id=31>Disconnected.</span></div><tr><td style=background:#000;text-align:center><pre id=Term></pre><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><input id=32 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value=CR+LF title="Toggle what the return key will send" onclick=termToggleCr()><input id=33 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=80x25 title="Toggle terminal size" onclick=termToggleSize()><input id=34 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value="Intel (F10 = ESC+[OM)" title="Toggle F1 to F10 keys emulation type" onclick=termToggleFx()><input id=35 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value="Extended Ascii" title="Toggle terminal emulation type" onclick=termToggleType()> </div><div> <input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Ctl-C onclick=termSendKey(3)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Ctl-X onclick=termSendKey(24)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=ESC onclick=termSendKey(27)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Backspace onclick=termSendKey(8)><input id=36 type=button onkeypress="return false" onkeydown="return false" class=cadbutton value=Paste disabled="disabled" onclick="setDialogMode(3,'Paste',3,termPaste)"></div></table></div><div id=p14 style=display:none;min-width:780px><div id=37><h1>Remote Desktop</h1><br></div><div id=38 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showFeaturesDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Intel® AMT Redirection port or KVM feature is disabled<span id=39>, click here to enable it.</span></div></div><div id=40 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showPowerActionDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Remote computer is not powered on, click here to issue a power command.</div></div><table cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><span id=41></span> <div class=rb title="Rotate Left" onclick=drotate(-1)>↺</div><div class=rb title="Rotate Right" onclick=drotate(1)>↻</div><input id=c5 type=button title="Toggle full screen mode" onkeypress="return false" onkeydown="return false" value=Full onclick=deskToggleFull() style=margin-right:3px><input id=c6 type=button title="Save a screenshot of the remote desktop" onkeypress="return false" onkeydown="return false" value=Save... onclick=deskSaveImage() style=margin-right:3px><input type=button value=Settings... title="Edit remote desktop settings" onkeypress="return false" onkeydown="return false" onclick=showDesktopSettings() style=margin-right:3px><input type=button id=c7 value=SIDER title="Start server-side remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderServerStart() style=margin-right:3px><input type=button id=c8 value=IDER title="Start remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderStart() style=margin-right:3px><input type=button title="Change the power state of the remote machine" onkeypress="return false" onkeydown="return false" value="Power Actions..." onclick=showPowerActionDlg() style=margin-right:3px></div><div><div id=c9 onclick=deskToggleFull() style=float:left;cursor:pointer;font-size:15px;display:none> ✖</div> <input type=button id=c10 value=Connect onclick=connectDesktop(event) onkeypress="return false" onkeydown="return false" disabled="disabled"> <span id=42>Disconnected.</span></div><tr><td id=43 style=background:black;text-align:center;position:relative><canvas id=Desk width=640 height=400 style=-ms-touch-action:none;margin-left:0px oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel="dmousewheel(event)" moz-opaque=""></canvas><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div id=44 style=float:right></div><div> <span id=deskkeysspan><select style=margin-left:6px id=deskkeys><option value=0>Win<option value=1>Win+Down<option value=2>Win+Up<option value=3>Win+L<option value=4>Win+M<option value=5>Shift+Win+M<option value=6>F1<option value=7>F2<option value=8>F3<option value=9>F4<option value=10>F5<option value=11>F6<option value=12>F7<option value=13>F8<option value=14>F9<option value=15>F10<option value=16>F11<option value=17>F12</select><input id=DeskWD type=button value=Send onkeypress="return false" onkeydown="return false" onclick=deskSendKeys()> </span><input id=45 type=button value=Ctrl-Alt-Del onkeypress="return false" onkeydown="return false" onclick=sendCAD()> <span id=46><input id=47 type=checkbox>Blank Screen </span><span id=48><input id=49 type=checkbox>View only </span></div></table></div><div id=p15 style=display:none><span id=50></span><h1>Audit Log</h1><span id=51></span></div><div id=p16 style=display:none><h1>Security Settings</h1><span id=52></span></div><div id=p17 style=display:none><h1>Internet Settings</h1><span id=53></span></div><div id=p18 style=display:none><h1>System Defense</h1><span id=54></span></div><div id=p19 style=display:none><h1>Agent Presence</h1><span id=55></span></div><div id=p20 style=display:none><h1>Script Editor</h1><div class=log1 style=padding:5px;border-radius:5px><div id=EditScriptStatus style=float:right;font-weight:bold;padding:5px>Stopped</div><div><input type=button value="View Editor" title="Switch to script line editor view" id=viewEditorButton onclick=scriptViewButton(0)><input type=button value="View Builder" title="Switch to block editor view" id=viewBuilderButton onclick=scriptViewButton(1)><input type=button value=New... title="Clear the script editor" onclick=script_newScriptDlg()><input type=button value=Load... title="Load a script from file" onclick=script_runScriptDlg()><input type=button value=Save... title="Save a script to file" onclick=script_saveScript(event)><input type=button value=Restart title="Compile the script and get ready to run it from the start" onclick=resetScriptButton()><input type=button value=Continue title="Run the script from the current execution point" onclick=runScriptButton()><input type=button value=Break title="Pause the execution of the script" onclick=breakScriptButton()><input type=button value=Step title="Execute one step of the script" onclick=stepScriptButton()></div></div><div id=scriptbuilder style=display:none><h2>Script Builder</h2><div style=padding:0;margin:0><div style=width:250px;height:400px;float:left;padding:0;margin:0;padding-right:3px><input id=blockfilter style="width:inherit;height:24px;padding:0;margin:0;border:1px solid gray;margin-bottom:1px" placeholder="Filter blocks..." onkeyup=script_fonfilterchanged()><div id=blocks style="width:inherit;height:373px;border:1px solid gray;overflow-y:scroll;padding:0;margin:0"></div></div><div id=scriptblocks style="width:auto;height:400px;padding:0;margin:0;border:1px solid gray;overflow-y:scroll" ondrop="script_fondrop(event, this)" onclick=script_fonclick(event)></div></div></div><div id=scripteditor><h2>Script</h2><textarea id=scriptarea style=width:100%;height:176px;resize:vertical;margin:0;padding:0;font-family:Arial,Helvetica,sans-serif spellcheck="false"></textarea><div style=display:none><br><h2>Compiled Script</h2><textarea id=compiledarea style=width:100%;height:16px;resize:vertical;margin:0;padding:0 spellcheck="false"></textarea><br></div><h2>Variables</h2><div id=variables style="width:100%;height:200px;resize:vertical;border:1px solid gray;overflow:scroll;margin:0;padding:0;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text"></div></div><h2>Console</h2><textarea id=console style=width:100%;height:80px;resize:vertical;margin:0;padding:0;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text readonly=""></textarea></div><div id=p21 style=display:none><h1>Storage</h1><span id=56></span></div><div id=p22 style=display:none><h1>Event Subscriptions</h1><span id=57></span></div><div id=p23 style=display:none><h1>Wake Alarms</h1><span id=58></span></div><div id=p24 style=display:none;position:absolute;top:0px;bottom:0px;left:8px;right:24px><h1>Files</h1><br><table id=p24toolbar style=width:100%;position:absolute;top:35px cellpadding=0 cellspacing=0><tr><td style=width:100%;background-color:#d3d9d6;text-align:left;padding:4px valign="bottom"><div id=p24rightOfButtons style=float:right;margin-top:3px></div><div><input type=button id=p24FolderUp disabled="disabled" onclick=p24folderup() value=Up> <input type=button id=p24SelectAllButton disabled="disabled" onclick=p24selectallfile() value="Select All" onkeypress="return false" onkeydown="return false"> <input type=button id=p24RenameFileButton disabled="disabled" value=Rename onclick=p24renamefile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24DeleteFileButton disabled="disabled" value=Delete onclick=p24deletefile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24NewFolderButton disabled="disabled" value="New Folder" onclick=p24createfolder() onkeypress="return false" onkeydown="return false"> <input type=button id=p24UploadButton disabled="disabled" value=Upload onclick=p24uploadFile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24CutButton disabled="disabled" value=Cut onclick=p24copyFile(1) onkeypress="return false" onkeydown="return false"> <input type=button id=p24CopyButton disabled="disabled" value=Copy onclick=p24copyFile(0) onkeypress="return false" onkeydown="return false"> <input type=button id=p24PasteButton disabled="disabled" value=Paste onclick=p24pasteFile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24RefreshButton disabled="disabled" value=Refresh onclick=p24folderup(9999) onkeypress="return false" onkeydown="return false"> </div><tr><td style=background-color:#E4E9E7;height:28px><div style=float:right;margin-right:4px><select id=p24sortdropdown onchange=p24updateFiles()><option value=1 selected="selected">Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p24currentpath></span></div></table><div id=p24filetable style=width:100%;overflow:auto;-webkit-user-select:none;position:absolute;top:92px;bottom:30px><div id=p24bigok style=width:256px;overflow:hidden;position:absolute;top:80px;width:100%;text-align:center;font-size:1600%;color:#AAAAAA;display:none><b>✓</b></div><div id=p24bigfail style=width:256px;overflow:hidden;position:absolute;top:80px;width:100%;text-align:center;font-size:1600%;color:#AAAAAA;display:none><b>✗</b></div><span id=p24files></span></div><table id=p24toolbarBottom style=width:100%;position:absolute;bottom:10px cellpadding=0 cellspacing=0><tr><td style=text-align:left;padding:3px;text-align:center;background-color:#D3D9D6> <span id=p24bottomstatus></span></table></div></div></div></div><div id=dialog style="z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666;font-family:Arial, Helvetica, sans-serif;border-radius:5px;position:fixed;overflow:auto;top:75px;width:400px;max-height:550px;display:none"><div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"><div id=59 style=float:right;padding:1px;margin-right:5px;cursor:pointer;font-size:15px onclick=setDialogMode()>✖</div><div id=60 style=padding:5px></div><div style=width:100%;margin:6px></div></div><div style=margin-right:16px;margin-left:8px><div id=dialog1 style=margin:auto;text-align:center;margin:3px><div id=61 style=padding:10px></div></div><div id=dialog2 style=margin:auto;margin:3px><br><div style=height:26px><input id=d2username style=float:right;width:200px onkeyup=updateAccountDialog()><div>Username</div></div><div style=height:26px><input id=d2password1 type=password autocomplete="off" style=float:right;width:200px onkeyup=updateAccountDialog()><div>Password*</div></div><div style=height:26px><input id=d2password2 type=password autocomplete="off" style=float:right;width:200px onkeyup=updateAccountDialog()><div>Confirm Password</div></div><div id=62><div style=height:26px><select id=d2permission style=float:right;width:200px><option value=0>Local<option value=1>Network<option value=2>Any</select><div>Permission</div></div><div>Granted Permissions</div><ul id=63 style="list-style-type:none;height:100px;overflow:auto;width:100%;border:1px solid #000;background-color:white;overflow-x:hidden;margin:0;padding:0"></ul></div><div style=font-size:10px><br>*Minimum 8 characters with upper, lowercase, 0-9, and one of !@#$%^&*()+-</div></div><div id=dialog3 style=margin:auto;text-align:center;margin:3px><textarea id=d3pastetextarea maxlength="4096" style=width:100%;height:200px;resize:none></textarea></div><div id=dialog5 style=margin:auto;margin:3px><br><div style=height:26px><select id=d5actionSelect style=float:right;width:200px></select><div>Power Action</div></div><div><span style=color:red>Warning:</span>Some power actions may result in data loss and may disconnect the desktop, terminal or disk redirection sessions.</div></div><div id=dialog6 style=margin:auto;margin:3px><br><div style=height:26px><input id=d6ConsentText style=float:right;width:200px maxlength="6" onkeyup=consentChanged() onkeypress="return numbersOnly(event)"><div>Consent Code</div></div><div style=height:26px><select id=d6Display onchange=changeConsentDisplay() style=float:right;width:200px><option value=0>Primary display<option value=1>Secondary display<option id=d6ThirdDisplay value=2 style=display:none>Third display</select><div>Consent Display</div></div></div><div id=dialog7 style=margin:auto;margin:3px><br><div style=height:26px><select id=c11 style=float:right;width:200px><option value=1>RLE8, Color Fast<option value=2>RLE16, Color<option id=d7gray4 value=5>RLE4G, Gray Fastest<option id=d7gray8 value=6>RLE8G, Gray Fast<option value=3>RAW8, Color Slow<option value=4>RAW16, Color Very Slow</select><div>Image Encoding</div></div><div style=height:80px><div style="float:right;border:1px solid #666;width:200px;height:80px;overflow-y:scroll;background-color:white"><input type=checkbox id=d7showcursor>Show Local Mouse Cursor<br><input type=checkbox id=d7showcad>Show Ctrl-Alt-Del<br><input type=checkbox id=d7limitFrameRate>Limit Frame Rate<br><input type=checkbox id=d7noMouseRotate>Don't Rotate Mouse<br></div><div>Other Settings</div></div><div id=d7softkvmsettings style=display:none><h4 style="width:100%;border-bottom:1px solid gray">Software KVM</h4><div style="margin:3px 0 3px 0"><select id=d7bitmapquality style=float:right;width:200px;height:20px dir="rtl"><option value=50>50%<option value=40>40%<option selected="selected" value=30>30%<option value=20>20%<option value=10>10%<option value=5>5%<option value=1>1%</select><div style=height:20px>Quality</div></div><div style="margin:3px 0 3px 0"><select id=d7bitmapscaling style=float:right;width:200px;height:20px dir="rtl"><option selected="selected" value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select><div style=height:20px>Scaling</div></div></div></div><div id=dialog8 style=display:table;margin:3px><div style="margin:3px 0 3px 0;padding-top:5px"><input id=c12 value=admin style=float:right;width:220px><div style=height:20px>Username</div></div><div style="margin:3px 0 3px 0"><input id=c13 type=password autocomplete="off" style=float:right;width:220px><div style=height:20px>Password</div></div></div><div id=dialog9 style=margin:auto;margin:3px><input type=checkbox id=c14>Redirection Port<br><div id=c15><input type=checkbox id=c16>KVM Remote Desktop<br></div><input type=checkbox id=c17>IDE-Redirection<br><input type=checkbox id=c18>Serial-over-LAN<br></div><div id=dialog10 style=margin:auto;margin:3px><input type=radio name=d10 id=c19 value=0>Not Required<br><input type=radio name=d10 id=c20 value=1>Required for KVM only<br><input type=radio name=d10 id=c21 value=4294967295>Always Required<br></div><div id=dialog11 style=margin:auto;margin:3px><div id=64></div></div><div id=dialog12 style=margin:auto;margin:3px><br><div style=height:26px><input id=c22 style=float:right;width:200px maxlength="32" onkeyup=updateWifiDialog() title="Maximum 32 characters"><div title="Maximum 32 characters">Profile Name</div></div><div style=height:26px><input id=c23 style=float:right;width:200px maxlength="32" onkeyup=updateWifiDialog() title="Maximum 32 characters"><div title="Maximum 32 characters">SSID</div></div><div style=height:26px><select id=c24 style=float:right;width:200px onclick=updateWifiDialog()></select><div>Priority</div></div><div style=height:26px><select id=c25 style=float:right;width:200px onclick=updateWifiDialog()><option value=6>WPA2 PSK<option value=4>WPA PSK</select><div>Authentication</div></div><div style=height:26px><select id=c26 style=float:right;width:200px onclick=updateWifiDialog()><option id=65 value=4>CCMP-AES<option id=66 value=3>TKIP-RC4<option id=67 value=2>WEP<option id=68 value=5>None</select><div>Encryption</div></div><div style=height:26px><input id=c27 type=password style=float:right;width:200px maxlength="63" onkeyup=updateWifiDialog() title="Length between 8 and 63 characters"><div title="Length between 8 and 63 characters">Password*</div></div><div style=height:26px><input id=c28 type=password style=float:right;width:200px maxlength="63" onkeyup=updateWifiDialog() title="Length between 8 and 63 characters"><div title="Length between 8 and 63 characters">Confirm Password</div></div></div><div id=dialog19 style=margin:auto;margin:3px>This will save the entire state of Intel® AMT for this machine into file. Passwords will not be saved, but some sensitive data may be included.<br><br><input id=c29 style=width:100% value=amtstate.json></div><div id=dialog20 style=margin:auto;margin:3px><input type=radio name=d20 id=d20a value=0>Disabled<br><input type=radio name=d20 id=d20b value=1>ICMP response<br><input type=radio name=d20 id=d20c value=2>RMCP response<br><input type=radio name=d20 id=d20d value=3>ICMP & RMCP response<br><br></div><div id=dialog21 style=margin:auto;margin:3px><input type=radio name=d21 id=d21o0 onclick=updateIPSetupDlg()><span id=d21l0></span><br><input type=radio name=d21 id=d21o1 onclick=updateIPSetupDlg()><span id=d21l1></span><br><div id=69><input type=radio name=d21 id=d21o2 onclick=updateIPSetupDlg()><span id=d21l2></span><br><br><div style=margin-left:20px><div style=height:26px><input id=c30 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>IP address</div></div><div style=height:26px id=70><input id=c31 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Subnet mark</div></div><div style=height:26px><input id=c32 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Gateway</div></div><div style=height:26px><input id=c33 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Primary DNS</div></div><div style=height:26px><input id=c34 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Alternate DNS</div></div></div></div></div><div id=dialog23 style=margin:auto;margin:3px><br><div style=height:26px><select id=c35 style=float:right;width:200px onchange=showEditDnsDlgChange()><option value=0>Disabled<option value=1>Disabled, DHCP update<option value=2>Enabled</select><div>Dynamic DNS client</div></div><div style=height:26px><input id=c36 style=float:right;width:200px><div>Update Interval (minutes)</div></div><div style=height:26px><input id=c37 style=float:right;width:200px><div>TTL (seconds)</div></div><div style=font-size:10px><br>Defaut Interval is 1440 minutes, Default TTL is 900 seconds.</div></div><div id=dialog24 style=margin:auto;margin:3px><br><div style=height:26px><select id=c38 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=2>Power up<option value=5>Power cycle<option value=8>Power down<option value=10>Reset<option value=999>Set boot options</select><div>Remote Command</div></div><div style=height:80px><div id=c39 style="float:right;border:1px solid #666;width:200px;height:72px;overflow-y:scroll;background-color:white"><div id=d24dBiosPause><input type=checkbox id=d24BiosPause onchange=showAdvPowerDlgChange()>BIOS Pause<br></div><div id=d24dBiosSecureBoot><input type=checkbox id=d24BiosSecureBoot onchange=showAdvPowerDlgChange()>Enforce Secure Boot<br></div><div id=d24dBiosSetup><input type=checkbox id=d24BiosSetup onchange=showAdvPowerDlgChange()>BIOS Setup<br></div><div id=d24dForceProgressEvents><input type=checkbox id=d24ForceProgressEvents onchange=showAdvPowerDlgChange()>Force progress events<br></div><div id=d24dLockPowerButton><input type=checkbox id=d24LockPowerButton onchange=showAdvPowerDlgChange()>Lock power button<br></div><div id=d24dLockResetButton><input type=checkbox id=d24LockResetButton onchange=showAdvPowerDlgChange()>Lock reset button<br></div><div id=d24dLockSleepButton><input type=checkbox id=d24LockSleepButton onchange=showAdvPowerDlgChange()>Lock sleep button<br></div><div id=d24dLockKeyboard><input type=checkbox id=d24LockKeyboard onchange=showAdvPowerDlgChange()>Lock keyboard<br></div><div id=d24dUserPasswordBypass><input type=checkbox id=d24UserPasswordBypass onchange=showAdvPowerDlgChange()>BIOS password bypass<br></div><div id=d24dReflashBios><input type=checkbox id=d24ReflashBios onchange=showAdvPowerDlgChange()>Reflash BIOS<br></div><div id=d24dSafeMode><input type=checkbox id=d24SafeMode onchange=showAdvPowerDlgChange()>Safe mode<br></div><div id=d24dUseIDER><input type=checkbox id=d24UseIDER onchange=showAdvPowerDlgChange()>Use IDER<br></div><div id=d24dSerialOverLan><input type=checkbox id=d24SerialOverLan onchange=showAdvPowerDlgChange()>Serial-over-LAN<br></div><div id=d24dSecureErase><input type=checkbox id=d24SecureErase onchange=showAdvPowerDlgChange()>Intel® Remote Secure Erase<br></div></div><div>Boot Settings</div></div><div style=height:26px><select id=c40 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>None<option value=1>Force CD/DVD Boot<option value=2>Force PXE Boot<option value=3>Force Hard Disk Boot<option value=4>Force Diagnostic Boot</select><div>Boot Source</div></div><div style=height:26px><select id=c41 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>None<option value=1>Index 1<option value=2>Index 2<option value=3>Index 3<option value=3>Index 4</select><div>Boot Media Index</div></div><div style=height:26px id=idd_d24IDERBootDevice><select id=c42 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>Boot to floppy<option value=1>Boot to CDROM</select><div>IDER Boot Device</div></div><div style=height:26px><select id=c43 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>System Default<option id=c44 value=1>Quiet<option id=c45 value=2>Verbose<option id=c46 value=3>Blank Screen</select><div>Verbocity</div></div><div style=height:26px id=idd_d24RSEPass><div style=float:right;width:200px><input type=password id=d24rsepass maxlength="32" style=float:right;width:100%></div><div>RSE Password</div></div></div><div id=dialog25 style=margin:auto;margin:3px><div style=text-align:left><div style=height:26px;margin-top:4px><input id=d25alarm_name style=float:right;width:180px maxlength="32" onkeyup=alertDialogUpdate()><div style=padding-top:4px>Alarm name</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_sdate style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,45)"></div><div style=padding-top:4px>Wake date (year-month-day)</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_stime style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,58)"></div><div style=padding-top:4px>Wake time (hour:min:sec)</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_interval style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,45)"></div><div style=padding-top:4px>Interval (days-hours-min)</div></div><div style=height:26px;margin-top:4px><div style=float:right;width:180px><select id=d25alarm_doc style=width:100% onchange=showAdvPowerDlgChange()><option value=0>Keep alarm<option value=1>Delete on completion</select></div><div style=padding-top:4px>After wake</div></div></div></div></div><div style=padding:10px;margin-bottom:4px><input id=c47 type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)><input id=c48 type=button value=OK style=float:right;width:80px onclick=dialogclose(1)><div style=height:25px><input id=c49 type=button value=Delete style=width:80px;display:none onclick=dialogclose(2)></div></div></div><script>var $jscomp={scope:{},getGlobal:function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(b){return"jscomp_symbol_"+b+$jscomp.symbolCounter_++};
1
+<!DOCTYPE html><html style=height:100%><head><meta http-equiv=X-UA-Compatible content="IE=edge"><meta content="text/html;charset=utf-8" http-equiv=Content-Type><meta name=format-detection content="telephone=no"><link rel="icon" type=image/png href="data:image/png;base64,iVBORw0KGgo="><style>body{height:100%;max-height:100%;overflow:hidden;font-family:arial, helvetica, sans-serif;font-size:9pt;color:black;background:white;margin-top:0;margin-left:0;margin-right:0;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}li{margin:0;padding:0;}label{display:block;color:windowtext;background-color:window;margin:0;padding:0;width:100%;}label:hover{background-color:highlight;color:highlighttext;}a:visited{text-decoration:none;color:#04f;}a:link{text-decoration:none;color:#04f;}a:hover{color:#a32;}h1{font-size:11pt;font-weight:bold;color:black;margin-left:5px;margin-top:10px;margin-bottom:6px;}h2{font-size:9pt;font-weight:bold;color:black;margin-left:6px;margin-top:6px;margin-bottom:0;}p{margin-left:6px;margin-top:4px;margin-bottom:0;margin-right:2px;}td{font-size:9pt;}th{font-size:9pt;}th:hover{cursor:pointer;background:#aaa;}.header{position:fixed;top:0;left:0;right:0;height:24px;background:#c0c0c0;}.progressbar{position:fixed;top:24px;left:0;right:0;height:2px;background:#ff9e30;}.in{margin-left:40px;}.log{background:#bbbab5;}.log1{background:#bbbab5;}.log tbody tr:nth-child(odd){background:#e8eefe;}.fullcell{position:fixed;top:26px;right:0;bottom:0;left:0px;overflow:hidden;}.maincell{position:fixed;top:26px;right:0;bottom:0;left:156px;overflow:auto;padding-left:2px;vertical-align:top;}.navbar{position:fixed;top:26px;left:0;bottom:0;width:156px;border-right:2px solid #ff9e30;vertical-align:top;background:#72726f;background:linear-gradient(45deg, #72726f 0%,#a6a5a0 100%);}.nav1{padding:1px 0px 1px 8px;margin:0px;font-weight:bold;color:black;white-space:nowrap;cursor:pointer;}.nav2{margin-left:32px;margin-top:0;color:black;cursor:pointer;}.r{font-size:11pt;}.r0{background:white;}.r1{border-bottom:1px solid gray;text-align:left;}.r2{text-align:left;}.r3{border-bottom:1px solid gray;text-align:left;}.r3:hover{background-color:#83827b;cursor:pointer;}.spread{height:100%;width:100%;background-color:white;}.timer{border:1px solid #abcae1;background-color:#abcae1;}.tm{font-size:7pt;}.top1{font-size:14pt;font-weight:bold;color:white;margin-top:11px;}.top2{color:white;}.warn{font-weight:bold;color:#c00000;}.icon1{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAMISURBVHjadJPPb9t0GMY//rbJaEKSxoPFQQ1WxhQ7RaGoIDEpTBMqgk7iBvwNKJdJXDnssEMl7pMGfwOH9YBYh0AglYiBBNKa0cSGNpiRxs7aJE2aH7aTmkPXqTvwXt7L8z56pef5SEEQcHYMwyjWarX3rLr1tu3YOQAlpZhqVv1J1/VvNU0rn9VLpwbtdlspb5ZLNdNcuZBKF1NKmuS8DECn28axm7ScZlnP5b4vXinelmXZfmrQbreVjbsbN3r9YSmTLbA/Ps92K8FgFAbAdYcsLXRRk10af/9BPBa5vXpt9aYsy7YAKG+WS73+sJS+eJmKneZe5QWEiHHreoJb1xNEInHu/Bzw3cM45zNv0usPS+XNcglAGIZRrJnmSiZbYOtRhF93ZvHcHoPRlN3GkL4Ho5HHeOxRqbv8sHVM+uVFaqa5YhhGUVpfXw+6hwP86DJ3fgkzK44hOGZuLkH7KIQIxuw9dkk812Hqu0wmPh9djZIKG8wnogirbpFS0jy0YOqPcMcurjvh3Vc7fPHpHF9//iLLyja75p/sNWxazj73t9qklDRW3ULYjk1yXmb3Xw/P9fA9n35/AMD0yAIgGQ8zOtxnMhFM/ClG/YjkvIzt2Mye5un5Lr4HY9el5RwA2tOsY9FzCCFBICCYOdlPRigphU63jZKEwWDAweMDJt7kmXINBhOkIEAQQiLMpczzJzcpBaFmVRy7iZ4RdA/7TKcBknTymOd5APT6PiAhghlmpHO8ocdw7CZqVkXour7Ycppriwsuy7koEgKQANDy+dPCIokQkhTiciFG4aJPy2mu6bq+OKtpWlXPmZWGtc2H77yOhOD+gxE7//T45sdHzEjQ7Y0IgmPeKszxwdUwTuM39Fyuomla9bTKyY27Gx/3+sMvlYU8lXqI36sef+1UkCS4pMZZyuu89oqL09gmHot8snpt9StZljtnYUqWN8vv10yzcCGV/ux/YFrTc7lK8UrxnizLnWdoPINzvlarLVl1K2879ktPcN5Ts2pV1/UHmqZVz+r/GwBWYYCoNUz0KwAAAABJRU5ErkJggg==");}.icon2{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAIuSURBVHjalJNBTBNBFIb/2S4tlliFdLBNW0mktibaeivBm9eejFeDZw81kROXHj2SyIEDB65wI3iBI5iYmEjSREtIpI1tQdOm20KBdkuX3ZnnYUVq2Cb6kklm3vxv3vdm3oCI4DTazZ3p3HpM5NZjot3cmR6kY0QEJ9vdnNJcaoMP3xyB3vI2EunP4046xcl5WttK99olHn4URSA2AaNT5qe1rbST1pFgd3NKU93H/P6TJADg8GthIMU1gqODtZlep8QjiegfXzBuUxwdrM1cy9Z/IVIYSn4jpe1vx8jsviAABIBM/Tl9/5Sg/EZKk8JQ+mP+ImiUVjJGp8xDDycB2b1KIgSC0RCMTpk3SisZxxKkpXvqhaXs7aAfnhtukBBXKmFCHVLgj4yjXljKSkv3XDugXlyeM/QKDz24CxIWSJhXBKYJMk2MT3AYeoXXi8tzl3sqAFgXLV+zvJrxhzkUqwdxQQARZl+FbbqeXY7CGHjEj2Z5NcMnXy6o7tEzRkT4mX/7Tisuvok/joBJC5ACl8/LmAIov0EVBZIYvn35gUD89UI4mZ1lRrca2N9+lh8bPeG3RgCyTEBKgAi+1CEAoJ27B6gqGGMAY2idCbRORhvxp++TanVvviaMQ/g8XshzAxACIIn+/pLGOWAqYIoLAODzuKB1K7y6N19j+Y0U3fG3MCw6IMsCyM4Oxvob1l4ze84YQ5u8OD7jUNWhMXz4uI//tx4Syfjg3/iv9msAKbs79bi84QcAAAAASUVORK5CYII=");}.icon3{width:14px;height:15px;background-repeat:no-repeat;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAEZ0FNQQAAsY58+1GTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAANGSURBVHjadJNNTBwFAIW//UFWfrbsgDuzBTvu0s6OWhHwYMhCOEAbSESC4dpL07TFg9GkxIRDjT3YhEBNPUjC0SbaJjVNQyJQaxtDpzYmlDYUOjuUrhspO0N0gQVWl/0ZD5ZmPfiSd3t5l/c+h23bFCsajR7Rdf1GPBbHtEwAJFFCDsqoqno0HA7/WJx37BUkk8k6bUYb0g2jxy8G6kQpgK9KAGB9I4llJlizEiuqokxE2iJfCIKw8qIgmUzWTU1OfZXaSve9KQep3tzA9fQJhfhvZHd3yfl85OUg26F6os9W8FaWXevq7vpIEIQVJ4A2ow2lttJ9LTU1hH64Tt1qHHv8a0rnH/LS4iPsK9/iixnUXr1Ck3cfqa10nzajDQG4o9HoEd0wet493Ij/zm18n3yMJxQivbND7Px58thUD3xI+egoBcMgd+FLlO73mTUWe5Ro9Jqrs7Nz2eUu9YbSacriT8lms5Q3NlLR3s6uaVJQFISRC1SUuFm9dInJ6WlCfpGMFPBub6eOueOxOMobb+H4+Ta/f3cZz927FPJ5hOPHqRkZgT/+xFniIjY6yveDg0gOB9l6BbHpBMbiPE7TMvFVCWSXl3DU7secnWXu9GniFy+ymctRIfhYHxvj6pkzBG2bA0Du8SN8VQKmZeLc2zOXybA2P8+mbeNpbydTWUmJ203etvGIInV+PxVA9t/pXvzALYkS6xtJqoRq/rJtqoNB/KdO8Up/P+atWxSA8t5e3vN6mT55kgOrq5TUH2J9I4kkSjjloIxlJiiEDiK2tREYHkbq7yd57x6XOzr4paMD59IS+7q7+WB8nPtuNyVN72CZCeSgjFNV1dY1K6H9fbiBDWk/uwsL5G7e5JuWFhTgVUBrbmZX11memyMgv0a64W3WrISmqmqrw7ZtJq5PfP4sYZ0Nl5ayPjJM4fECKdtGAF5+bt3pxBt+HWXwU37NZKgNiOd6ens+27uyNDU5dTa1lR44JAXwPHiA/fA++ScGTsB1UMHV1MxOQyOGmcBbWTbW1d11ThAEsxgmSZvRBnTD6PCLgcj/wKSpivJTpC0yJgiC+R8ai3CO6Lp+NB6Lt5qWqTzH2ZCD8h1VVW+Ew2GtOP/PAFZGexs+cGPjAAAAAElFTkSuQmCC");}.itemBar{padding:7px;min-height:20px;margin-top:4px;margin-right:8px;width:auto;border-radius:8px;background-color:#7e7d74;cursor:pointer;}.computeritem{cursor:pointer;width:auto;border-radius:5px;background-color:#a6a5a0;height:28px;margin:4px;padding:2px;}.computeritem:hover{background-color:#83827b;}.us{-webkit-touch-callout:initial;-webkit-user-select:auto;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;}.rb{cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px;}.fileIcon1{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb49Y2Sj9LT2f///yH5BAEAAAMALAAAAAAQABAAAAImnI+py+1vhJwyUYAzHTL4D3qdlJWaIFJqmKod607sDKIiDUP63hQAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.fileIcon2{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAM2xV/Xur+XPgP///yH5BAEAAAMALAAAAAAQABAAAAJD3ISZIGHWUGihznesYDYATFVM+D2hJ4lgN1olxALAtAlmPCJvuMmJd6PJckDYwicrHhTD5o7plJmg0Uc0asNMkphHAQA7);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.fileIcon3{background:url(data:image/gif;base64,R0lGODlhEAAQAJEDAPb19IGBgbq6uv///yH5BAEAAAMALAAAAAAQABAAAAIy3ISpxgcPH2ouQgFEw1YmxnUXKEaaEZZnVWZk66JwzKpvuwZzwOgwb/C1gIOA8Yg8DgoAOw==);height:16px;width:16px;cursor:pointer;border:none;float:left;margin-top:1px;}.filelist{-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-o-user-select:none;cursor:default;-khtml-user-drag:element;background-color:white;clear:both;}.fsize{float:right;text-align:right;width:180px;}</style><body onunload="cleanup()"><div id=0 class=header><table id=1 cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td id=2 class=style6><div> <input type=button class=connectbutton id=xconnectbutton1 value=Connect onclick="connectButtonfunction(event, false)" onkeypress="return false" onkeydown="return false"> <span id=constatus></span></div></table><div class=progressbar><div id=3 style=height:2px;width:0%;background-color:red></div></div></div><div id=4 class=fullcell style=text-align:center;padding-top:100px;font-size:20px><span id=5>Disconnected</span></div><div id=6 style=height:100%;display:none><div id=7 class=navbar><br><p id=go1 class=nav1 onclick=go(1)><a>System Status</a><p id=go14 class=nav1 onclick=go(14)><a>Remote Desktop</a><p id=go24 class=nav1 onclick=go(24)> <a>Files</a><p id=go13 class=nav1 onclick=go(13)><a>Serial-over-LAN</a><p id=go2 class=nav1 onclick=go(2)><a>Hardware Information</a><p id=go6 class=nav1 onclick=go(6)><a>Event Log</a><p id=go15 class=nav1 onclick=go(15)><a>Audit Log</a><p id=go21 class=nav1 onclick=go(21)><a>Storage</a><p id=go8 class=nav1 onclick=go(8)><a>Network Settings</a><p id=go17 class=nav1 onclick=go(17)><a>Internet Settings</a><p id=go16 class=nav1 onclick=go(16)><a>Security Settings</a><p id=go19 class=nav1 onclick=go(19)><a>Agent Presence</a><p id=go18 class=nav1 onclick=go(18)><a>System Defense</a><p id=go11 class=nav1 onclick=go(11)><a>User Accounts</a><p id=go22 class=nav1 onclick=go(22)><a>Subscriptions</a><p id=go23 class=nav1 onclick=go(23)><a>Wake Alarms</a><p id=go20 class=nav1 onclick=go(20)><a>Script Editor</a><p id=go12 class=nav1 onclick=go(12)><a>WSMAN Browser</a></div><div id=8 class=maincell><div id=9 style=position:relative;height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none><div style=float:right><input id=IDERDiskMapButton type=button value="Disk Map" onclick=iderToggleDiskMap()><input type=button value="Stop IDE-R Session" onclick=iderStop()></div><div style=font-size:16px;padding-top:2px> <span id=10></span></div><div id=iderHeatmap style="z-index:1000;position:absolute;top:31px;right:8px;border:1px solid black;box-shadow:0px 0px 10px;border-radius:5px;padding:8px;width:600px;background-color:#99CC99;display:none"><div id=floppyHeatMap style=display:none><div id=floppyHeatMapText style=margin:2px>Floppy, blocks are 512 bytes.</div><canvas id=floppyHeatMapCanvas width=600 height=0></canvas></div><div id=cdromHeatMap style=display:none><div id=cdromHeatMapText style=margin:2px>CDROM, blocks are 2048 bytes.</div><canvas id=cdromHeatMapCanvas width=600 height=0></canvas></div></div></div><div id=11 style=height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none;overflow:hidden><div style=float:right><input type=button value="Stop Script" onclick=script_Stop()></div><div style=font-size:16px;padding-top:2px;overflow:hidden> <b>Running Script</b><span style=overflow:hidden id=12></span></div></div><div id=13 style=height:21px;background:#8fac8d;padding:5px;margin-bottom:1px;display:none><div style=font-size:16px;float:right;cursor:pointer;padding-right:5px;padding-left:5px;padding-top:2px;font-size:15px onclick="QV(13, false)">✖</div><div style=font-size:14px;padding-top:2px> <b>This computer's firmware should be updated, <a style=cursor:pointer href="https://security-center.intel.com/advisory.aspx?intelid=INTEL-SA-00075&languageid=en-fr" rel="noreferrer noopener" target="_blank"><u>please check here</u></a>.</b></div></div><div id=14 style=width:100%;height:100%><iframe id=15 style=width:100%;height:100%;border:0></iframe></div><div id=16 style=padding:8px;overflow-x:hidden><div id=p0><h1>Loading...</h1></div><div id=p1 style=display:none><h1>System Status</h1><span id=17></span></div><div id=p2 style=display:none><h1 style=margin-bottom:16px>Hardware Information</h1><span id=18></span></div><div id=p6 style=display:none><h1>Event Log</h1><span id=19></span><span id=20></span></div><div id=p8 style=display:none><h1>Network Settings</h1><span id=21></span><span id=22></span></div><div id=p11 style=display:none><h1>User Accounts</h1><span id=23></span></div><div id=p12 style=display:none><h1>WSMAN Browser</h1><div><table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><div style=padding:4px><select id=24 multiple="multiple" style=width:100%;height:120px></select></div><tr><td><input id=25 type=button value=Query style=margin:4px onclick=wsmanQuery()><input type=button value=Clear style=margin:4px onclick="QH(26, '')"><input id=c0 placeholder=Filter style=margin:4px onkeyup=wsmanFilter()></table></div><br><div class=us id=26></div></div><div id=p13 style=display:none;min-width:780px><h1>Serial-over-LAN Terminal</h1><br><div id=27 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showFeaturesDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Intel® AMT Redirection port or Serial-over-LAN feature is disabled<span id=28>, click here to enable it.</span></div></div><div id=29 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showPowerActionDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Remote computer is not powered on, click here to issue a power command.</div></div><table cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><input onkeyup=sendTermInputKeys(event) autocorrect=off autocapitalize=off style=opacity:0;width:0;height:0;font-size:1px onblur="keyInputBlur()"><span id=30></span> <input type=button onkeypress="return false" onkeydown="return false" class=cadbutton value="Power Actions..." onclick=showPowerActionDlg() style=margin-right:3px><input type=button id=c1 value=SIDER title="Start server-side remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderServerStart() style=margin-right:3px><input type=button id=c2 value=IDER title="Start remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderStart(event) style=margin-right:3px><input id=c3 type=button onkeypress="return false" onkeydown="return false" class=cadbutton value="Start Capture" title="Toggle start/stop of terminal capture, when stopping the content of the capture buffer will be saved to a file." onclick=terminalCaptureToggle() style=margin-right:3px></div><div> <input type=button id=c4 value=Connect onclick=connectTerminal(event) disabled="disabled"> <span id=31>Disconnected.</span></div><tr><td style=background:#000;text-align:center><pre id=Term></pre><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><input id=32 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value=CR+LF title="Toggle what the return key will send" onclick=termToggleCr()><input id=33 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=80x25 title="Toggle terminal size" onclick=termToggleSize()><input id=34 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value="Intel (F10 = ESC+[OM)" title="Toggle F1 to F10 keys emulation type" onclick=termToggleFx()><input id=35 type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event);return false" class=bottombutton value="Extended Ascii" title="Toggle terminal emulation type" onclick=termToggleType()> </div><div> <input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Ctl-C onclick=termSendKey(3)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Ctl-X onclick=termSendKey(24)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=ESC onclick=termSendKey(27)><input type=button onkeypress="return false" onkeydown="if (event.keyCode == 13) handleKeyPress(event); return false" class=bottombutton value=Backspace onclick=termSendKey(8)><input id=36 type=button onkeypress="return false" onkeydown="return false" class=cadbutton value=Paste disabled="disabled" onclick="setDialogMode(3,'Paste',3,termPaste)"></div></table></div><div id=p14 style=display:none;min-width:780px><div id=37><h1>Remote Desktop</h1><br></div><div id=38 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showFeaturesDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Intel® AMT Redirection port or KVM feature is disabled<span id=39>, click here to enable it.</span></div></div><div id=40 style=max-width:100%;display:none;cursor:pointer;margin-bottom:5px onclick=showPowerActionDlg()><div class=icon2 style=float:left;margin:7px></div><div style=width:auto;border-radius:8px;padding:8px;background-color:lightsalmon>Remote computer is not powered on, click here to issue a power command.</div></div><table cellpadding=0 cellspacing=0 style=width:100%;padding:0px;padding:0px;margin-top:0px><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div style=float:right;text-align:right><span id=41></span> <div class=rb title="Rotate Left" onclick=drotate(-1)>↺</div><div class=rb title="Rotate Right" onclick=drotate(1)>↻</div><input id=c5 type=button title="Toggle full screen mode" onkeypress="return false" onkeydown="return false" value=Full onclick=deskToggleFull() style=margin-right:3px><input id=c6 type=button title="Save a screenshot of the remote desktop" onkeypress="return false" onkeydown="return false" value=Save... onclick=deskSaveImage() style=margin-right:3px><input type=button value=Settings... title="Edit remote desktop settings" onkeypress="return false" onkeydown="return false" onclick=showDesktopSettings() style=margin-right:3px><input type=button id=c7 value=SIDER title="Start server-side remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderServerStart() style=margin-right:3px><input type=button id=c8 value=IDER title="Start remote disk mount operation" onkeypress="return false" onkeydown="return false" onclick=iderStart(event) style=margin-right:3px><input type=button title="Change the power state of the remote machine" onkeypress="return false" onkeydown="return false" value="Power Actions..." onclick=showPowerActionDlg() style=margin-right:3px></div><div><div id=c9 onclick=deskToggleFull() style=float:left;cursor:pointer;font-size:15px;display:none> ✖</div> <input type=button id=c10 value=Connect onclick=connectDesktop(event) onkeypress="return false" onkeydown="return false" disabled="disabled"> <span id=42>Disconnected.</span></div><tr><td id=43 style=background:black;text-align:center;position:relative><canvas id=Desk width=640 height=400 style=-ms-touch-action:none;margin-left:0px oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event) onmousewheel="dmousewheel(event)" moz-opaque=""></canvas><tr><td style=padding-top:2px;padding-bottom:2px;background:#CCC><div id=44 style=float:right></div><div> <span id=deskkeysspan><select style=margin-left:6px id=deskkeys><option value=0>Win<option value=1>Win+Down<option value=2>Win+Up<option value=3>Win+L<option value=4>Win+M<option value=5>Shift+Win+M<option value=6>F1<option value=7>F2<option value=8>F3<option value=9>F4<option value=10>F5<option value=11>F6<option value=12>F7<option value=13>F8<option value=14>F9<option value=15>F10<option value=16>F11<option value=17>F12</select><input id=DeskWD type=button value=Send onkeypress="return false" onkeydown="return false" onclick=deskSendKeys()> </span><input id=45 type=button value=Ctrl-Alt-Del onkeypress="return false" onkeydown="return false" onclick=sendCAD()> <span id=46><input id=47 type=checkbox>Blank Screen </span><span id=48><input id=49 type=checkbox>View only </span></div></table></div><div id=p15 style=display:none><span id=50></span><h1>Audit Log</h1><span id=51></span></div><div id=p16 style=display:none><h1>Security Settings</h1><span id=52></span></div><div id=p17 style=display:none><h1>Internet Settings</h1><span id=53></span></div><div id=p18 style=display:none><h1>System Defense</h1><span id=54></span></div><div id=p19 style=display:none><h1>Agent Presence</h1><span id=55></span></div><div id=p20 style=display:none><h1>Script Editor</h1><div class=log1 style=padding:5px;border-radius:5px><div id=EditScriptStatus style=float:right;font-weight:bold;padding:5px>Stopped</div><div><input type=button value="View Editor" title="Switch to script line editor view" id=viewEditorButton onclick=scriptViewButton(0)><input type=button value="View Builder" title="Switch to block editor view" id=viewBuilderButton onclick=scriptViewButton(1)><input type=button value=New... title="Clear the script editor" onclick=script_newScriptDlg()><input type=button value=Load... title="Load a script from file" onclick=script_runScriptDlg()><input type=button value=Save... title="Save a script to file" onclick=script_saveScript(event)><input type=button value=Restart title="Compile the script and get ready to run it from the start" onclick=resetScriptButton()><input type=button value=Continue title="Run the script from the current execution point" onclick=runScriptButton()><input type=button value=Break title="Pause the execution of the script" onclick=breakScriptButton()><input type=button value=Step title="Execute one step of the script" onclick=stepScriptButton()></div></div><div id=scriptbuilder style=display:none><h2>Script Builder</h2><div style=padding:0;margin:0><div style=width:250px;height:400px;float:left;padding:0;margin:0;padding-right:3px><input id=blockfilter style="width:inherit;height:24px;padding:0;margin:0;border:1px solid gray;margin-bottom:1px" placeholder="Filter blocks..." onkeyup=script_fonfilterchanged()><div id=blocks style="width:inherit;height:373px;border:1px solid gray;overflow-y:scroll;padding:0;margin:0"></div></div><div id=scriptblocks style="width:auto;height:400px;padding:0;margin:0;border:1px solid gray;overflow-y:scroll" ondrop="script_fondrop(event, this)" onclick=script_fonclick(event)></div></div></div><div id=scripteditor><h2>Script</h2><textarea id=scriptarea style=width:100%;height:176px;resize:vertical;margin:0;padding:0;font-family:Arial,Helvetica,sans-serif spellcheck="false"></textarea><div style=display:none><br><h2>Compiled Script</h2><textarea id=compiledarea style=width:100%;height:16px;resize:vertical;margin:0;padding:0 spellcheck="false"></textarea><br></div><h2>Variables</h2><div id=variables style="width:100%;height:200px;resize:vertical;border:1px solid gray;overflow:scroll;margin:0;padding:0;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text"></div></div><h2>Console</h2><textarea id=console style=width:100%;height:80px;resize:vertical;margin:0;padding:0;user-select:text;-webkit-user-select:text;-khtml-user-select:text;-moz-user-select:text;-ms-user-select:text readonly=""></textarea></div><div id=p21 style=display:none><h1>Storage</h1><span id=56></span></div><div id=p22 style=display:none><h1>Event Subscriptions</h1><span id=57></span></div><div id=p23 style=display:none><h1>Wake Alarms</h1><span id=58></span></div><div id=p24 style=display:none;position:absolute;top:0px;bottom:0px;left:8px;right:24px><h1>Files</h1><br><table id=p24toolbar style=width:100%;position:absolute;top:35px cellpadding=0 cellspacing=0><tr><td style=width:100%;background-color:#d3d9d6;text-align:left;padding:4px valign="bottom"><div id=p24rightOfButtons style=float:right;margin-top:3px></div><div><input type=button id=p24FolderUp disabled="disabled" onclick=p24folderup() value=Up> <input type=button id=p24SelectAllButton disabled="disabled" onclick=p24selectallfile() value="Select All" onkeypress="return false" onkeydown="return false"> <input type=button id=p24RenameFileButton disabled="disabled" value=Rename onclick=p24renamefile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24DeleteFileButton disabled="disabled" value=Delete onclick=p24deletefile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24NewFolderButton disabled="disabled" value="New Folder" onclick=p24createfolder() onkeypress="return false" onkeydown="return false"> <input type=button id=p24UploadButton disabled="disabled" value=Upload onclick=p24uploadFile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24CutButton disabled="disabled" value=Cut onclick=p24copyFile(1) onkeypress="return false" onkeydown="return false"> <input type=button id=p24CopyButton disabled="disabled" value=Copy onclick=p24copyFile(0) onkeypress="return false" onkeydown="return false"> <input type=button id=p24PasteButton disabled="disabled" value=Paste onclick=p24pasteFile() onkeypress="return false" onkeydown="return false"> <input type=button id=p24RefreshButton disabled="disabled" value=Refresh onclick=p24folderup(9999) onkeypress="return false" onkeydown="return false"> </div><tr><td style=background-color:#E4E9E7;height:28px><div style=float:right;margin-right:4px><select id=p24sortdropdown onchange=p24updateFiles()><option value=1 selected="selected">Sort by name<option value=2>Sort by size<option value=3>Sort by date<option value=4>Descend by name<option value=5>Descend by size<option value=6>Descend by date</select></div><div> <span id=p24currentpath></span></div></table><div id=p24filetable style=width:100%;overflow:auto;-webkit-user-select:none;position:absolute;top:92px;bottom:30px><div id=p24bigok style=width:256px;overflow:hidden;position:absolute;top:80px;width:100%;text-align:center;font-size:1600%;color:#AAAAAA;display:none><b>✓</b></div><div id=p24bigfail style=width:256px;overflow:hidden;position:absolute;top:80px;width:100%;text-align:center;font-size:1600%;color:#AAAAAA;display:none><b>✗</b></div><span id=p24files></span></div><table id=p24toolbarBottom style=width:100%;position:absolute;bottom:10px cellpadding=0 cellspacing=0><tr><td style=text-align:left;padding:3px;text-align:center;background-color:#D3D9D6> <span id=p24bottomstatus></span></table></div></div></div></div><div id=dialog style="z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666;font-family:Arial, Helvetica, sans-serif;border-radius:5px;position:fixed;overflow:auto;top:75px;width:400px;max-height:550px;display:none"><div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"><div id=59 style=float:right;padding:1px;margin-right:5px;cursor:pointer;font-size:15px onclick=setDialogMode()>✖</div><div id=60 style=padding:5px></div><div style=width:100%;margin:6px></div></div><div style=margin-right:16px;margin-left:8px><div id=dialog1 style=margin:auto;text-align:center;margin:3px><div id=61 style=padding:10px></div></div><div id=dialog2 style=margin:auto;margin:3px><br><div style=height:26px><input id=d2username style=float:right;width:200px onkeyup=updateAccountDialog()><div>Username</div></div><div style=height:26px><input id=d2password1 type=password autocomplete="off" style=float:right;width:200px onkeyup=updateAccountDialog()><div>Password*</div></div><div style=height:26px><input id=d2password2 type=password autocomplete="off" style=float:right;width:200px onkeyup=updateAccountDialog()><div>Confirm Password</div></div><div id=62><div style=height:26px><select id=d2permission style=float:right;width:200px><option value=0>Local<option value=1>Network<option value=2>Any</select><div>Permission</div></div><div>Granted Permissions</div><ul id=63 style="list-style-type:none;height:100px;overflow:auto;width:100%;border:1px solid #000;background-color:white;overflow-x:hidden;margin:0;padding:0"></ul></div><div style=font-size:10px><br>*Minimum 8 characters with upper, lowercase, 0-9, and one of !@#$%^&*()+-</div></div><div id=dialog3 style=margin:auto;text-align:center;margin:3px><textarea id=d3pastetextarea maxlength="4096" style=width:100%;height:200px;resize:none></textarea></div><div id=dialog5 style=margin:auto;margin:3px><br><div style=height:26px><select id=d5actionSelect style=float:right;width:200px></select><div>Power Action</div></div><div><span style=color:red>Warning:</span>Some power actions may result in data loss and may disconnect the desktop, terminal or disk redirection sessions.</div></div><div id=dialog6 style=margin:auto;margin:3px><br><div style=height:26px><input id=d6ConsentText style=float:right;width:200px maxlength="6" onkeyup=consentChanged() onkeypress="return numbersOnly(event)"><div>Consent Code</div></div><div style=height:26px><select id=d6Display onchange=changeConsentDisplay() style=float:right;width:200px><option value=0>Primary display<option value=1>Secondary display<option id=d6ThirdDisplay value=2 style=display:none>Third display</select><div>Consent Display</div></div></div><div id=dialog7 style=margin:auto;margin:3px><br><div style=height:26px><select id=c11 style=float:right;width:200px><option value=1>RLE8, Color Fast<option value=2>RLE16, Color<option id=d7gray4 value=5>RLE4G, Gray Fastest<option id=d7gray8 value=6>RLE8G, Gray Fast<option value=3>RAW8, Color Slow<option value=4>RAW16, Color Very Slow</select><div>Image Encoding</div></div><div style=height:80px><div style="float:right;border:1px solid #666;width:200px;height:80px;overflow-y:scroll;background-color:white"><input type=checkbox id=d7showcursor>Show Local Mouse Cursor<br><input type=checkbox id=d7showcad>Show Ctrl-Alt-Del<br><input type=checkbox id=d7limitFrameRate>Limit Frame Rate<br><input type=checkbox id=d7noMouseRotate>Don't Rotate Mouse<br></div><div>Other Settings</div></div><div id=d7softkvmsettings style=display:none><h4 style="width:100%;border-bottom:1px solid gray">Software KVM</h4><div style="margin:3px 0 3px 0"><select id=d7bitmapquality style=float:right;width:200px;height:20px dir="rtl"><option value=50>50%<option value=40>40%<option selected="selected" value=30>30%<option value=20>20%<option value=10>10%<option value=5>5%<option value=1>1%</select><div style=height:20px>Quality</div></div><div style="margin:3px 0 3px 0"><select id=d7bitmapscaling style=float:right;width:200px;height:20px dir="rtl"><option selected="selected" value=1024>100%<option value=896>87.5%<option value=768>75%<option value=640>62.5%<option value=512>50%<option value=384>37.5%<option value=256>25%<option value=128>12.5%</select><div style=height:20px>Scaling</div></div></div></div><div id=dialog8 style=display:table;margin:3px><div style="margin:3px 0 3px 0;padding-top:5px"><input id=c12 value=admin style=float:right;width:220px><div style=height:20px>Username</div></div><div style="margin:3px 0 3px 0"><input id=c13 type=password autocomplete="off" style=float:right;width:220px><div style=height:20px>Password</div></div></div><div id=dialog9 style=margin:auto;margin:3px><input type=checkbox id=c14>Redirection Port<br><div id=c15><input type=checkbox id=c16>KVM Remote Desktop<br></div><input type=checkbox id=c17>IDE-Redirection<br><input type=checkbox id=c18>Serial-over-LAN<br></div><div id=dialog10 style=margin:auto;margin:3px><input type=radio name=d10 id=c19 value=0>Not Required<br><input type=radio name=d10 id=c20 value=1>Required for KVM only<br><input type=radio name=d10 id=c21 value=4294967295>Always Required<br></div><div id=dialog11 style=margin:auto;margin:3px><div id=64></div></div><div id=dialog12 style=margin:auto;margin:3px><br><div style=height:26px><input id=c22 style=float:right;width:200px maxlength="32" onkeyup=updateWifiDialog() title="Maximum 32 characters"><div title="Maximum 32 characters">Profile Name</div></div><div style=height:26px><input id=c23 style=float:right;width:200px maxlength="32" onkeyup=updateWifiDialog() title="Maximum 32 characters"><div title="Maximum 32 characters">SSID</div></div><div style=height:26px><select id=c24 style=float:right;width:200px onclick=updateWifiDialog()></select><div>Priority</div></div><div style=height:26px><select id=c25 style=float:right;width:200px onclick=updateWifiDialog()><option value=6>WPA2 PSK<option value=4>WPA PSK</select><div>Authentication</div></div><div style=height:26px><select id=c26 style=float:right;width:200px onclick=updateWifiDialog()><option id=65 value=4>CCMP-AES<option id=66 value=3>TKIP-RC4<option id=67 value=2>WEP<option id=68 value=5>None</select><div>Encryption</div></div><div style=height:26px><input id=c27 type=password style=float:right;width:200px maxlength="63" onkeyup=updateWifiDialog() title="Length between 8 and 63 characters"><div title="Length between 8 and 63 characters">Password*</div></div><div style=height:26px><input id=c28 type=password style=float:right;width:200px maxlength="63" onkeyup=updateWifiDialog() title="Length between 8 and 63 characters"><div title="Length between 8 and 63 characters">Confirm Password</div></div></div><div id=dialog19 style=margin:auto;margin:3px>This will save the entire state of Intel® AMT for this machine into file. Passwords will not be saved, but some sensitive data may be included.<br><br><input id=c29 style=width:100% value=amtstate.json></div><div id=dialog20 style=margin:auto;margin:3px><input type=radio name=d20 id=d20a value=0>Disabled<br><input type=radio name=d20 id=d20b value=1>ICMP response<br><input type=radio name=d20 id=d20c value=2>RMCP response<br><input type=radio name=d20 id=d20d value=3>ICMP & RMCP response<br><br></div><div id=dialog21 style=margin:auto;margin:3px><input type=radio name=d21 id=d21o0 onclick=updateIPSetupDlg()><span id=d21l0></span><br><input type=radio name=d21 id=d21o1 onclick=updateIPSetupDlg()><span id=d21l1></span><br><div id=69><input type=radio name=d21 id=d21o2 onclick=updateIPSetupDlg()><span id=d21l2></span><br><br><div style=margin-left:20px><div style=height:26px><input id=c30 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>IP address</div></div><div style=height:26px id=70><input id=c31 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Subnet mark</div></div><div style=height:26px><input id=c32 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Gateway</div></div><div style=height:26px><input id=c33 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Primary DNS</div></div><div style=height:26px><input id=c34 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Alternate DNS</div></div></div></div></div><div id=dialog23 style=margin:auto;margin:3px><br><div style=height:26px><select id=c35 style=float:right;width:200px onchange=showEditDnsDlgChange()><option value=0>Disabled<option value=1>Disabled, DHCP update<option value=2>Enabled</select><div>Dynamic DNS client</div></div><div style=height:26px><input id=c36 style=float:right;width:200px><div>Update Interval (minutes)</div></div><div style=height:26px><input id=c37 style=float:right;width:200px><div>TTL (seconds)</div></div><div style=font-size:10px><br>Defaut Interval is 1440 minutes, Default TTL is 900 seconds.</div></div><div id=dialog24 style=margin:auto;margin:3px><br><div style=height:26px><select id=c38 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=2>Power up<option value=5>Power cycle<option value=8>Power down<option value=10>Reset<option value=999>Set boot options</select><div>Remote Command</div></div><div style=height:80px><div id=c39 style="float:right;border:1px solid #666;width:200px;height:72px;overflow-y:scroll;background-color:white"><div id=d24dBiosPause><input type=checkbox id=d24BiosPause onchange=showAdvPowerDlgChange()>BIOS Pause<br></div><div id=d24dBiosSecureBoot><input type=checkbox id=d24BiosSecureBoot onchange=showAdvPowerDlgChange()>Enforce Secure Boot<br></div><div id=d24dBiosSetup><input type=checkbox id=d24BiosSetup onchange=showAdvPowerDlgChange()>BIOS Setup<br></div><div id=d24dForceProgressEvents><input type=checkbox id=d24ForceProgressEvents onchange=showAdvPowerDlgChange()>Force progress events<br></div><div id=d24dLockPowerButton><input type=checkbox id=d24LockPowerButton onchange=showAdvPowerDlgChange()>Lock power button<br></div><div id=d24dLockResetButton><input type=checkbox id=d24LockResetButton onchange=showAdvPowerDlgChange()>Lock reset button<br></div><div id=d24dLockSleepButton><input type=checkbox id=d24LockSleepButton onchange=showAdvPowerDlgChange()>Lock sleep button<br></div><div id=d24dLockKeyboard><input type=checkbox id=d24LockKeyboard onchange=showAdvPowerDlgChange()>Lock keyboard<br></div><div id=d24dUserPasswordBypass><input type=checkbox id=d24UserPasswordBypass onchange=showAdvPowerDlgChange()>BIOS password bypass<br></div><div id=d24dReflashBios><input type=checkbox id=d24ReflashBios onchange=showAdvPowerDlgChange()>Reflash BIOS<br></div><div id=d24dSafeMode><input type=checkbox id=d24SafeMode onchange=showAdvPowerDlgChange()>Safe mode<br></div><div id=d24dUseIDER><input type=checkbox id=d24UseIDER onchange=showAdvPowerDlgChange()>Use IDER<br></div><div id=d24dSerialOverLan><input type=checkbox id=d24SerialOverLan onchange=showAdvPowerDlgChange()>Serial-over-LAN<br></div><div id=d24dSecureErase><input type=checkbox id=d24SecureErase onchange=showAdvPowerDlgChange()>Intel® Remote Secure Erase<br></div></div><div>Boot Settings</div></div><div style=height:26px><select id=c40 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>None<option value=1>Force CD/DVD Boot<option value=2>Force PXE Boot<option value=3>Force Hard Disk Boot<option value=4>Force Diagnostic Boot</select><div>Boot Source</div></div><div style=height:26px><select id=c41 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>None<option value=1>Index 1<option value=2>Index 2<option value=3>Index 3<option value=3>Index 4</select><div>Boot Media Index</div></div><div style=height:26px id=idd_d24IDERBootDevice><select id=c42 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>Boot to floppy<option value=1>Boot to CDROM</select><div>IDER Boot Device</div></div><div style=height:26px><select id=c43 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>System Default<option id=c44 value=1>Quiet<option id=c45 value=2>Verbose<option id=c46 value=3>Blank Screen</select><div>Verbocity</div></div><div style=height:26px id=idd_d24RSEPass><div style=float:right;width:200px><input type=password id=d24rsepass maxlength="32" style=float:right;width:100%></div><div>RSE Password</div></div></div><div id=dialog25 style=margin:auto;margin:3px><div style=text-align:left><div style=height:26px;margin-top:4px><input id=d25alarm_name style=float:right;width:180px maxlength="32" onkeyup=alertDialogUpdate()><div style=padding-top:4px>Alarm name</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_sdate style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,45)"></div><div style=padding-top:4px>Wake date (year-month-day)</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_stime style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,58)"></div><div style=padding-top:4px>Wake time (hour:min:sec)</div></div><div style=height:26px;margin-top:4px><div style=float:right><input id=d25alarm_interval style=width:180px maxlength="10" onkeyup=alertDialogUpdate() onkeypress="return numbersOnly(event,45)"></div><div style=padding-top:4px>Interval (days-hours-min)</div></div><div style=height:26px;margin-top:4px><div style=float:right;width:180px><select id=d25alarm_doc style=width:100% onchange=showAdvPowerDlgChange()><option value=0>Keep alarm<option value=1>Delete on completion</select></div><div style=padding-top:4px>After wake</div></div></div></div></div><div style=padding:10px;margin-bottom:4px><input id=c47 type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)><input id=c48 type=button value=OK style=float:right;width:80px onclick=dialogclose(1)><div style=height:25px><input id=c49 type=button value=Delete style=width:80px;display:none onclick=dialogclose(2)></div></div></div><script>var $jscomp={scope:{},getGlobal:function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global?global:b}};$jscomp.global=$jscomp.getGlobal(this);$jscomp.initSymbol=function(){$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol);$jscomp.initSymbol=function(){}};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(b){return"jscomp_symbol_"+b+$jscomp.symbolCounter_++};
2
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();$jscomp.global.Symbol.iterator||($jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));$jscomp.initSymbolIterator=function(){}};
3
$jscomp.makeIterator=function(b){$jscomp.initSymbolIterator();if(b[$jscomp.global.Symbol.iterator])return b[$jscomp.global.Symbol.iterator]();if(!(b instanceof Array||"string"==typeof b||b instanceof String))throw new TypeError(b+" is not iterable");var c=0;return{next:function(){return c==b.length?{done:!0}:{done:!1,value:b[c++]}}}};$jscomp.arrayFromIterator=function(b){for(var c,a=[];!(c=b.next()).done;)a.push(c.value);return a};
4
$jscomp.arrayFromIterable=function(b){return b instanceof Array?b:$jscomp.arrayFromIterator($jscomp.makeIterator(b))};$jscomp.arrayFromArguments=function(b){for(var c=[],a=0;a<b.length;a++)c.push(b[a]);return c};
@@ -11,169 +11,169 @@ function ObjectToStringEx(b,c){var a="";if(0!=b&&(!b||null==b))return"(Null)";if
11
function ObjectToStringEx2(b,c){var a="";if(0!=b&&(!b||null==b))return"(Null)";if(b instanceof Array)for(var d in b)a+="\r\n"+gap2(c)+"Item #"+d+": "+ObjectToStringEx2(b[d],c+1);else if(b instanceof Object)for(d in b)a+="\r\n"+gap2(c)+d+" = "+ObjectToStringEx2(b[d],c+1);else a+=EscapeHtml(b);return a}function gap(b){for(var c="",a=0;a<4*b;a++)c+=" ";return c}function gap2(b){for(var c="",a=0;a<4*b;a++)c+=" ";return c}function ObjectToString(b){return ObjectToStringEx(b,0)}
12
function ObjectToString2(b){return ObjectToStringEx2(b,0)}function hex2rstr(b){if("string"!=typeof b||0==b.length)return"";var c="";b=(""+b).match(/../g);for(var a;a=b.shift();)c+=String.fromCharCode("0x"+a);return c}function char2hex(b){return(b+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(b){var c="",a;for(a=0;a<b.length;a++)c+=char2hex(b.charCodeAt(a));return c}function encode_utf8(b){return unescape(encodeURIComponent(b))}
13
function decode_utf8(b){return decodeURIComponent(escape(b))}function data2blob(b){for(var c=Array(b.length),a=0;a<b.length;a++)c[a]=b.charCodeAt(a);return new Blob([new Uint8Array(c)])}function random(b){return Math.floor(Math.random()*b)}function trademarks(b){return b.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}
14
-var CreateAmtRemoteIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}function c(c,d,y,A){switch(d.charCodeAt(0)){case 0:b("SCSI: TEST_UNIT_READY",c);switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.floppyReady)return e.floppyReady=!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.cdromReady)return e.cdromReady=
15
-!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;default:return b("SCSI Internal error 3",c),-1}e.SendCommandEndResponse(1,0,c,0,0);break;case 8:A=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3);d=d.charCodeAt(4);0==d&&(d=256);b("SCSI: READ_6",c,A,d);a(c,A,d,y);break;case 10:return A=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3),d=d.charCodeAt(4),0==d&&(d=256),b("SCSI: WRITE_6",c,A,d),e.SendCommandEndResponse(1,2,c,58,0),-1;case 26:b("SCSI: MODE_SENSE_6",c);if(63==
16
-d.charCodeAt(2)&&0==d.charCodeAt(3)){A=d=0;switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=0;A=128;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=5;A=128;break;default:return b("SCSI Internal error 6",c),-1}e.SendDataToHost(c,!0,String.fromCharCode(0,d,A,0),y&1);return}e.SendCommandEndResponse(1,5,c,36,0);break;case 27:e.SendCommandEndResponse(1,0,c);break;case 30:b("SCSI: ALLOW_MEDIUM_REMOVAL",c);if(160==c&&null==e.floppy||176==
17
-c&&null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;e.SendCommandEndResponse(1,0,c,0,0);break;case 35:b("SCSI: READ_FORMAT_CAPACITIES",c);A=ReadShort(d,7);switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;default:return b("SCSI Internal error 4",c),-1}e.SendDataToHost(c,!0,IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),y&1);break;
18
-case 37:b("SCSI: READ_CAPACITY",c);d=0;switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.floppy&&(d=(e.floppy.size>>9)-1);b("DEV_FLOPPY",d);break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.cdrom&&(d=(e.cdrom.size>>11)-1);b("DEV_CDDVD",d);break;default:return b("SCSI Internal error 4",c),-1}b("SCSI: READ_CAPACITY2",c,A);e.SendDataToHost(A,!0,IntToStr(d)+String.fromCharCode(0,0,176==c?
19
-8:2,0),y&1);break;case 40:A=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: READ_10",c,A,d);a(c,A,d,y);break;case 42:case 46:A=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: WRITE_10",c,A,d);e.SendGetDataFromHost(c,512*d);break;case 67:A=ReadShort(d,7);var C=d.charCodeAt(1)&2,q=d.charCodeAt(2)&7;0==q&&(q=d.charCodeAt(9)>>6);b("SCSI: READ_TOC, dev="+c+", buflen="+A+", msf="+C+", format="+q);switch(c){case 160:return e.SendCommandEndResponse(1,5,c,32,0),-1;case 176:break;default:return b("SCSI Internal error 9",c),
20
--1}1==q?e.SendDataToHost(c,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),y&1):0==q&&(C?e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),y&1):e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),y&1));break;case 70:var q=2!=d.charCodeAt(1),M=ReadShort(d,2);A=ReadShort(d,7);b("SCSI: GET_CONFIGURATION",c,q,M,A);if(0==A)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),y&1),-1;C=IntToStr(8);0==M&&(C+=h);if(1==M||q&&1>
21
-M)C+=v;if(2==M||q&&2>M)C+=g;if(3==M||q&&3>M)C+=K;if(16==M||q&&16>M)C+=r;if(30==M||q&&30>M)C+=E;if(256==M||q&&256>M)C+=z;if(261==M||q&&261>M)C+=B;C=IntToStr(C.length)+C;C.length>A&&(C=C.substring(0,A));e.SendDataToHost(c,!0,C,y&1);return-1;case 74:b("SCSI: GET_EVENT_STATUS_NOTIFICATION",c,d.charCodeAt(1),d.charCodeAt(4),d.charCodeAt(9));if(1!=d.charCodeAt(1)&&16!=d.charCodeAt(4)){b("SCSI ERROR");e.SendCommandEndResponse(1,5,c,38,1);break}d=0;160==c&&null!=e.floppy?d=2:176==c&&null!=e.cdrom&&(d=2);
22
-e.SendDataToHost(c,!0,String.fromCharCode(0,d,128,0),y&1);break;case 76:e.SendCommand(81,IntToStrX(0)+IntToStrX(0)+IntToStrX(0)+String.fromCharCode(135,80,3,0,0,0,176,81,5,32,0),!0);break;case 81:return b("SCSI READ_DISC_INFO",c),e.SendCommandEndResponse(0,5,c,32,0),-1;case 85:return b("SCSI ERROR: MODE_SELECT_10",c),e.SendCommandEndResponse(1,5,c,32,0),-1;case 90:b("SCSI: MODE_SENSE_10",c,d.charCodeAt(2)&63);A=ReadShort(d,7);C=null;if(0==A)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),y&
23
-1),-1;A=0;160==c?null!=e.floppy&&(A=e.floppy.size>>9):null!=e.cdrom&&(A=e.cdrom.size>>11);switch(d.charCodeAt(2)&63){case 1:C=160==c?2880>=A?I:F:D;break;case 5:160==c&&(C=2880>=A?u:k);break;case 63:C=160==c?2880>=A?n:l:w;break;case 26:176==c&&(C=p);break;case 29:176==c&&(C=x);break;case 42:176==c&&(C=m)}null==C?e.SendCommandEndResponse(0,5,c,32,0):e.SendDataToHost(c,!0,C,y&1);break;default:return b("IDER: Unknown SCSI command",d.charCodeAt(0)),e.SendCommandEndResponse(0,5,c,32,0),-1}return 0}function a(a,
24
-b,c,n){var B=null,h=0;160==a&&(B=e.floppy,null!=e.floppy&&(h=e.floppy.size>>9));176==a&&(B=e.cdrom,null!=e.cdrom&&(h=e.cdrom.size>>11));if(0>c||b+c>h)return e.SendCommandEndResponse(1,5,a,33,0),0;if(0==c)return e.SendCommandEndResponse(1,0,a,0,0),0;null!=B&&(e.sectorStats&&e.sectorStats(1,160==a?0:1,h,b,c),160==a?(b<<=9,c<<=9):(b<<=11,c<<=11),null!==C?A.push({media:B,dev:a,lba:b,len:c,fr:n}):(C=B,M=a,ba=b,q=c,d(n)))}function d(a){var b=q,c=ba;q>e.iderinfo.readbfr&&(b=e.iderinfo.readbfr);q-=b;ba+=
25
-b;var n=new FileReader;n.onload=function(){e.SendDataToHost(M,0==q,this.result,a&1);if(0<q&&0==y)d(a);else if(C=null,y)e.SendCommand(71),A=[],y=!1;else if(0<A.length){var b=A.shift();C=b.media;M=b.dev;ba=b.lba;q=b.len;d(b.fr)}};n.readAsBinaryString(C.slice(c,c+b))}var e={protocol:3,bytesToAmt:0,bytesFromAmt:0,rx_timeout:3E4,tx_timeout:0,heartbeat:2E4,version:1,acc:"",inSequence:0,outSequence:0,iderinfo:null,enabled:!1,iderStart:0,floppy:null,cdrom:null,floppyReady:!1,cdromReady:!1,sectorStats:null},
26
-k=String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),l=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),u=String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),n=String.fromCharCode(0,92,36,128,
27
-0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),p=String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),x=String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),m=String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),w=String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,
28
-0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0);String.fromCharCode(0,0,0,40,0,0,0,8);var h=String.fromCharCode(0,0,3,4,0,8,1,0),v=String.fromCharCode(0,1,3,4,0,0,0,2),g=String.fromCharCode(0,2,3,4,0,0,0,0),K=String.fromCharCode(0,3,3,4,41,0,0,2),r=String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0),E=String.fromCharCode(0,30,3,0),z=String.fromCharCode(1,0,3,0),B=String.fromCharCode(1,5,3,0),I=String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),F=String.fromCharCode(0,18,49,128,0,0,0,0,
29
-1,10,0,1,0,0,0,0,2,0,0,0),D=String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0);e.xxStateChange=function(a){b("IDER-StateChange",a);0==a&&e.Stop();3==a&&e.Start()};e.Start=function(){b("IDER-Start");b(e.floppy,e.cdrom);e.bytesToAmt=0;e.bytesFromAmt=0;e.inSequence=0;e.outSequence=0;A=[];e.SendCommand(64,ShortToStrX(e.rx_timeout)+ShortToStrX(e.tx_timeout)+ShortToStrX(e.heartbeat)+IntToStrX(e.version));e.sectorStats&&(e.sectorStats(0,0,e.floppy?e.floppy.size>>9:0),e.sectorStats(0,1,e.cdrom?e.cdrom.size>>
30
-11:0))};e.Stop=function(){b("IDER-Stop");e.parent.Stop()};e.ProcessData=function(a){e.bytesFromAmt+=a.length;e.acc+=a;for(b("IDER-ProcessData",e.acc.length,rstr2hex(e.acc));;){a=e.ProcessDataEx();if(0==a)break;if(e.inSequence!=ReadIntX(e.acc,4)){b("ERROR: Out of sequence",e.inSequence,ReadIntX(e.acc,4));e.Stop();break}e.inSequence++;e.acc=e.acc.substring(a)}};e.SendCommand=function(a,c,n,B){null==c&&(c="");n=50<a&&1==n?2:0;B&&(n+=1);c=String.fromCharCode(a,0,0,n)+IntToStrX(e.outSequence++)+c;e.parent.xxSend(c);
31
-e.bytesToAmt+=c.length;75!=a&&b("IDER-SendData",c.length,rstr2hex(c))};e.SendCommandEndResponse=function(a,b,c,n,B){a?e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,c,80,0,0,0),!0):e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,b<<4,3,0,0,0,c,81,b,n,B),!0)};e.SendDataToHost=function(a,b,c,n){var B=n?0:c.length;1==b?e.SendCommand(84,String.fromCharCode(0,c.length&255,c.length>>8,0,n?180:181,0,2,0,B&255,B>>8,a,88,133,0,3,0,0,0,a,80,0,0,0,0,0,0)+c,b,n):e.SendCommand(84,
32
-String.fromCharCode(0,c.length&255,c.length>>8,0,n?180:181,0,2,0,B&255,B>>8,a,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+c,b,n)};e.SendGetDataFromHost=function(a,b){e.SendCommand(82,String.fromCharCode(0,b&255,b>>8,0,181,0,0,0,b&255,b>>8,a,88,0,0,0,0,0,0,0,0,0,0,0),!1)};e.SendDisableEnableFeatures=function(a,b){null==b&&(b="");e.SendCommand(72,String.fromCharCode(a)+b)};e.ProcessDataEx=function(){if(8>e.acc.length)return 0;switch(e.acc.charCodeAt(0)){case 65:if(30>e.acc.length)break;var a=e.acc.charCodeAt(29);
14
+var CreateAmtRemoteIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}function c(c,d,A,y){switch(d.charCodeAt(0)){case 0:b("SCSI: TEST_UNIT_READY",c);switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.floppyReady)return e.floppyReady=!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;if(0==e.cdromReady)return e.cdromReady=
15
+!0,e.SendCommandEndResponse(1,6,c,40,0),-1;break;default:return b("SCSI Internal error 3",c),-1}e.SendCommandEndResponse(1,0,c,0,0);break;case 8:y=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3);d=d.charCodeAt(4);0==d&&(d=256);b("SCSI: READ_6",c,y,d);a(c,y,d,A);break;case 10:return y=((d.charCodeAt(1)&31)<<16)+(d.charCodeAt(2)<<8)+d.charCodeAt(3),d=d.charCodeAt(4),0==d&&(d=256),b("SCSI: WRITE_6",c,y,d),e.SendCommandEndResponse(1,2,c,58,0),-1;case 26:b("SCSI: MODE_SENSE_6",c);if(63==
16
+d.charCodeAt(2)&&0==d.charCodeAt(3)){y=d=0;switch(c){case 160:if(null==e.floppy)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=0;y=128;break;case 176:if(null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;d=5;y=128;break;default:return b("SCSI Internal error 6",c),-1}e.SendDataToHost(c,!0,String.fromCharCode(0,d,y,0),A&1);return}e.SendCommandEndResponse(1,5,c,36,0);break;case 27:e.SendCommandEndResponse(1,0,c);break;case 30:b("SCSI: ALLOW_MEDIUM_REMOVAL",c);if(160==c&&null==e.floppy||176==
17
+c&&null==e.cdrom)return e.SendCommandEndResponse(1,2,c,58,0),-1;e.SendCommandEndResponse(1,0,c,0,0);break;case 35:b("SCSI: READ_FORMAT_CAPACITIES",c);y=ReadShort(d,7);switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,5,c,36,0),-1;break;default:return b("SCSI Internal error 4",c),-1}e.SendDataToHost(c,!0,IntToStr(8)+String.fromCharCode(0,0,11,64,2,0,2,0),A&1);break;
18
+case 37:b("SCSI: READ_CAPACITY",c);d=0;switch(c){case 160:if(null==e.floppy||0==e.floppy.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.floppy&&(d=(e.floppy.size>>9)-1);b("DEV_FLOPPY",d);break;case 176:if(null==e.cdrom||0==e.cdrom.size)return e.SendCommandEndResponse(0,2,c,58,0),-1;null!=e.cdrom&&(d=(e.cdrom.size>>11)-1);b("DEV_CDDVD",d);break;default:return b("SCSI Internal error 4",c),-1}b("SCSI: READ_CAPACITY2",c,y);e.SendDataToHost(y,!0,IntToStr(d)+String.fromCharCode(0,0,176==c?
19
+8:2,0),A&1);break;case 40:y=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: READ_10",c,y,d);a(c,y,d,A);break;case 42:case 46:y=ReadInt(d,2);d=ReadShort(d,7);b("SCSI: WRITE_10",c,y,d);e.SendGetDataFromHost(c,512*d);break;case 67:y=ReadShort(d,7);var C=d.charCodeAt(1)&2,p=d.charCodeAt(2)&7;0==p&&(p=d.charCodeAt(9)>>6);b("SCSI: READ_TOC, dev="+c+", buflen="+y+", msf="+C+", format="+p);switch(c){case 160:return e.SendCommandEndResponse(1,5,c,32,0),-1;case 176:break;default:return b("SCSI Internal error 9",c),
20
+-1}1==p?e.SendDataToHost(c,!0,String.fromCharCode(0,10,1,1,0,20,1,0,0,0,0,0),A&1):0==p&&(C?e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,2,0,0,20,170,0,0,0,52,19),A&1):e.SendDataToHost(c,!0,String.fromCharCode(0,18,1,1,0,20,1,0,0,0,0,0,0,20,170,0,0,0,0,0),A&1));break;case 70:var p=2!=d.charCodeAt(1),M=ReadShort(d,2);y=ReadShort(d,7);b("SCSI: GET_CONFIGURATION",c,p,M,y);if(0==y)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),A&1),-1;C=IntToStr(8);0==M&&(C+=B);if(1==M||p&&1>
21
+M)C+=l;if(2==M||p&&2>M)C+=g;if(3==M||p&&3>M)C+=I;if(16==M||p&&16>M)C+=u;if(30==M||p&&30>M)C+=D;if(256==M||p&&256>M)C+=z;if(261==M||p&&261>M)C+=x;C=IntToStr(C.length)+C;C.length>y&&(C=C.substring(0,y));e.SendDataToHost(c,!0,C,A&1);return-1;case 74:b("SCSI: GET_EVENT_STATUS_NOTIFICATION",c,d.charCodeAt(1),d.charCodeAt(4),d.charCodeAt(9));if(1!=d.charCodeAt(1)&&16!=d.charCodeAt(4)){b("SCSI ERROR");e.SendCommandEndResponse(1,5,c,38,1);break}d=0;160==c&&null!=e.floppy?d=2:176==c&&null!=e.cdrom&&(d=2);
22
+e.SendDataToHost(c,!0,String.fromCharCode(0,d,128,0),A&1);break;case 76:e.SendCommand(81,IntToStrX(0)+IntToStrX(0)+IntToStrX(0)+String.fromCharCode(135,80,3,0,0,0,176,81,5,32,0),!0);break;case 81:return b("SCSI READ_DISC_INFO",c),e.SendCommandEndResponse(0,5,c,32,0),-1;case 85:return b("SCSI ERROR: MODE_SELECT_10",c),e.SendCommandEndResponse(1,5,c,32,0),-1;case 90:b("SCSI: MODE_SENSE_10",c,d.charCodeAt(2)&63);y=ReadShort(d,7);C=null;if(0==y)return e.SendDataToHost(c,!0,IntToStr(60)+IntToStr(8),A&
23
+1),-1;y=0;160==c?null!=e.floppy&&(y=e.floppy.size>>9):null!=e.cdrom&&(y=e.cdrom.size>>11);switch(d.charCodeAt(2)&63){case 1:C=160==c?2880>=y?F:G:E;break;case 5:160==c&&(C=2880>=y?r:q);break;case 63:C=160==c?2880>=y?n:h:v;break;case 26:176==c&&(C=m);break;case 29:176==c&&(C=w);break;case 42:176==c&&(C=k)}null==C?e.SendCommandEndResponse(0,5,c,32,0):e.SendDataToHost(c,!0,C,A&1);break;default:return b("IDER: Unknown SCSI command",d.charCodeAt(0)),e.SendCommandEndResponse(0,5,c,32,0),-1}return 0}function a(a,
24
+b,c,g){var n=null,x=0;160==a&&(n=e.floppy,null!=e.floppy&&(x=e.floppy.size>>9));176==a&&(n=e.cdrom,null!=e.cdrom&&(x=e.cdrom.size>>11));if(0>c||b+c>x)return e.SendCommandEndResponse(1,5,a,33,0),0;if(0==c)return e.SendCommandEndResponse(1,0,a,0,0),0;null!=n&&(e.sectorStats&&e.sectorStats(1,160==a?0:1,x,b,c),160==a?(b<<=9,c<<=9):(b<<=11,c<<=11),null!==C?A.push({media:n,dev:a,lba:b,len:c,fr:g}):(C=n,M=a,ba=b,p=c,d(g)))}function d(a){var b=p,c=ba;p>e.iderinfo.readbfr&&(b=e.iderinfo.readbfr);p-=b;ba+=
25
+b;var g=new FileReader;g.onload=function(){e.SendDataToHost(M,0==p,this.result,a&1);if(0<p&&0==y)d(a);else if(C=null,y)e.SendCommand(71),A=[],y=!1;else if(0<A.length){var b=A.shift();C=b.media;M=b.dev;ba=b.lba;p=b.len;d(b.fr)}};g.readAsBinaryString(C.slice(c,c+b))}var e={protocol:3,bytesToAmt:0,bytesFromAmt:0,rx_timeout:3E4,tx_timeout:0,heartbeat:2E4,version:1,acc:"",inSequence:0,outSequence:0,iderinfo:null,enabled:!1,iderStart:0,floppy:null,cdrom:null,floppyReady:!1,cdromReady:!1,sectorStats:null},
26
+q=String.fromCharCode(0,38,49,128,0,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),h=String.fromCharCode(0,92,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,16,169,8,32,2,0,3,195,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),r=String.fromCharCode(0,38,36,128,0,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0),n=String.fromCharCode(0,92,36,128,
27
+0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0,3,22,0,160,0,0,0,0,0,18,2,0,0,0,0,0,0,0,160,0,0,0,5,30,4,176,2,18,2,0,0,80,0,0,0,0,0,0,0,0,0,0,40,0,0,0,0,0,0,0,2,208,0,0,8,10,0,0,0,0,0,0,0,0,0,0,11,6,0,0,0,17,36,49),m=String.fromCharCode(0,18,1,128,0,0,0,0,26,10,0,0,0,0,0,0,0,0,0,0),w=String.fromCharCode(0,18,1,128,0,0,0,0,29,10,0,0,0,0,0,0,0,0,0,0),k=String.fromCharCode(0,32,1,128,0,0,0,0,42,24,0,0,0,0,32,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0),v=String.fromCharCode(0,40,1,128,0,0,0,0,1,6,0,255,0,0,0,0,42,24,
28
+0,0,0,0,2,0,0,0,0,0,0,128,0,0,0,0,0,0,0,0,0,0,0,0);String.fromCharCode(0,0,0,40,0,0,0,8);var B=String.fromCharCode(0,0,3,4,0,8,1,0),l=String.fromCharCode(0,1,3,4,0,0,0,2),g=String.fromCharCode(0,2,3,4,0,0,0,0),I=String.fromCharCode(0,3,3,4,41,0,0,2),u=String.fromCharCode(0,16,1,8,0,0,8,0,0,1,0,0),D=String.fromCharCode(0,30,3,0),z=String.fromCharCode(1,0,3,0),x=String.fromCharCode(1,5,3,0),F=String.fromCharCode(0,18,36,128,0,0,0,0,1,10,0,1,0,0,0,0,2,0,0,0),G=String.fromCharCode(0,18,49,128,0,0,0,0,
29
+1,10,0,1,0,0,0,0,2,0,0,0),E=String.fromCharCode(0,14,1,128,0,0,0,0,1,6,0,255,0,0,0,0);e.xxStateChange=function(a){b("IDER-StateChange",a);0==a&&e.Stop();3==a&&e.Start()};e.Start=function(){b("IDER-Start");b(e.floppy,e.cdrom);e.bytesToAmt=0;e.bytesFromAmt=0;e.inSequence=0;e.outSequence=0;A=[];e.SendCommand(64,ShortToStrX(e.rx_timeout)+ShortToStrX(e.tx_timeout)+ShortToStrX(e.heartbeat)+IntToStrX(e.version));e.sectorStats&&(e.sectorStats(0,0,e.floppy?e.floppy.size>>9:0),e.sectorStats(0,1,e.cdrom?e.cdrom.size>>
30
+11:0))};e.Stop=function(){b("IDER-Stop");e.parent.Stop()};e.ProcessData=function(a){e.bytesFromAmt+=a.length;e.acc+=a;for(b("IDER-ProcessData",e.acc.length,rstr2hex(e.acc));;){a=e.ProcessDataEx();if(0==a)break;if(e.inSequence!=ReadIntX(e.acc,4)){b("ERROR: Out of sequence",e.inSequence,ReadIntX(e.acc,4));e.Stop();break}e.inSequence++;e.acc=e.acc.substring(a)}};e.SendCommand=function(a,c,g,n){null==c&&(c="");g=50<a&&1==g?2:0;n&&(g+=1);c=String.fromCharCode(a,0,0,g)+IntToStrX(e.outSequence++)+c;e.parent.xxSend(c);
31
+e.bytesToAmt+=c.length;75!=a&&b("IDER-SendData",c.length,rstr2hex(c))};e.SendCommandEndResponse=function(a,b,c,g,n){a?e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,197,0,3,0,0,0,c,80,0,0,0),!0):e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,b<<4,3,0,0,0,c,81,b,g,n),!0)};e.SendDataToHost=function(a,b,c,g){var n=g?0:c.length;1==b?e.SendCommand(84,String.fromCharCode(0,c.length&255,c.length>>8,0,g?180:181,0,2,0,n&255,n>>8,a,88,133,0,3,0,0,0,a,80,0,0,0,0,0,0)+c,b,g):e.SendCommand(84,
32
+String.fromCharCode(0,c.length&255,c.length>>8,0,g?180:181,0,2,0,n&255,n>>8,a,88,0,0,0,0,0,0,0,0,0,0,0,0,0,0)+c,b,g)};e.SendGetDataFromHost=function(a,b){e.SendCommand(82,String.fromCharCode(0,b&255,b>>8,0,181,0,0,0,b&255,b>>8,a,88,0,0,0,0,0,0,0,0,0,0,0),!1)};e.SendDisableEnableFeatures=function(a,b){null==b&&(b="");e.SendCommand(72,String.fromCharCode(a)+b)};e.ProcessDataEx=function(){if(8>e.acc.length)return 0;switch(e.acc.charCodeAt(0)){case 65:if(30>e.acc.length)break;var a=e.acc.charCodeAt(29);
33
if(e.acc.length<30+a)break;e.iderinfo={};e.iderinfo.major=e.acc.charCodeAt(8);e.iderinfo.minor=e.acc.charCodeAt(9);e.iderinfo.fwmajor=e.acc.charCodeAt(10);e.iderinfo.fwminor=e.acc.charCodeAt(11);e.iderinfo.readbfr=ReadShortX(e.acc,16);e.iderinfo.writebfr=ReadShortX(e.acc,18);e.iderinfo.proto=e.acc.charCodeAt(21);e.iderinfo.iana=ReadIntX(e.acc,25);b(e.iderinfo);0!=e.iderinfo.proto&&(b("Unknown proto",e.iderinfo.proto),e.Stop());8192<e.iderinfo.readbfr&&(b("Illegal read buffer size",e.iderinfo.readbfr),
34
e.Stop());8192<e.iderinfo.writebfr&&(b("Illegal write buffer size",e.iderinfo.writebfr),e.Stop());0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25));return 30+a;case 67:return b("CLOSE"),e.Stop(),8;case 68:return e.SendCommand(69),8;case 69:return b("PONG"),8;case 70:if(9>e.acc.length)break;a=e.acc.charCodeAt(8);null===C?(e.SendCommand(71),b("RESETOCCURED1",a)):(y=!0,b("RESETOCCURED2",
35
-a));return 9;case 73:if(13>e.acc.length)break;var a=e.acc.charCodeAt(8),n=ReadIntX(e.acc,9);b("STATUS_DATA",a,n);switch(a){case 1:n&1&&(0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25)));break;case 2:e.enabled=n&2?!0:!1;b("IDER Status: "+e.enabled);break;case 3:1!=n&&b("Register toggle failure")}return 13;case 74:if(11>e.acc.length)break;b("IDER: ABORT",e.acc.charCodeAt(8));
36
-return 11;case 75:return 8;case 80:if(28>e.acc.length)break;var a=e.acc.charCodeAt(14)&16?176:160,n=e.acc.charCodeAt(14),B=e.acc.substring(16,28),d=e.acc.charCodeAt(9);b("SCSI_CMD",a,rstr2hex(B),d,n);c(a,B,d,n);return 28;case 83:if(14>e.acc.length)break;a=ReadShortX(e.acc,9);if(e.acc.length<14+a)break;b("SCSI_WRITE, len = "+(14+a));e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0);return 14+a;default:b("Unknown IDER command",e.acc[0]),e.Stop()}return 0};
37
-var A=[],y=!1,C=null,M,ba,q;return e},CreateAmtRemoteServerIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}var c={protocol:4,iderStart:0,floppy:null,cdrom:null,state:0,onStateChanged:null,m:{sectorStats:null,onDialogPrompt:null,dialogPrompt:function(a){c.socket.send(JSON.stringify({action:"dialogResponse",args:a}))},bytesToAmt:0,bytesFromAmt:0,server:!0,Stop:function(){c.Stop()}},xxStateChange:function(a){if(c.state!=
38
-a&&(b("SIDER-StateChange",a),c.state=a,null!=c.onStateChanged))c.onStateChanged(c,c.state)},Start:function(a,d,e,k,l){b("SIDER-Start",a,d,e,k,l);c.host=a;c.port=d;c.user=e;c.pass=k;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webider.ashx?host="+a+"&port="+d+"&tls="+l+("*"==e?"&serverauth=1":"")+("undefined"===typeof k?"&serverauth=1&user="+e:"")+"&tls1only="+
35
+a));return 9;case 73:if(13>e.acc.length)break;var a=e.acc.charCodeAt(8),g=ReadIntX(e.acc,9);b("STATUS_DATA",a,g);switch(a){case 1:g&1&&(0==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(9)):1==e.iderStart?e.SendDisableEnableFeatures(3,IntToStrX(17)):2==e.iderStart&&e.SendDisableEnableFeatures(3,IntToStrX(25)));break;case 2:e.enabled=g&2?!0:!1;b("IDER Status: "+e.enabled);break;case 3:1!=g&&b("Register toggle failure")}return 13;case 74:if(11>e.acc.length)break;b("IDER: ABORT",e.acc.charCodeAt(8));
36
+return 11;case 75:return 8;case 80:if(28>e.acc.length)break;var a=e.acc.charCodeAt(14)&16?176:160,g=e.acc.charCodeAt(14),n=e.acc.substring(16,28),x=e.acc.charCodeAt(9);b("SCSI_CMD",a,rstr2hex(n),x,g);c(a,n,x,g);return 28;case 83:if(14>e.acc.length)break;a=ReadShortX(e.acc,9);if(e.acc.length<14+a)break;b("SCSI_WRITE, len = "+(14+a));e.SendCommand(81,String.fromCharCode(0,0,0,0,0,0,0,0,0,0,0,0,135,112,3,0,0,0,160,81,7,39,0),!0);return 14+a;default:b("Unknown IDER command",e.acc[0]),e.Stop()}return 0};
37
+var A=[],y=!1,C=null,M,ba,p;return e},CreateAmtRemoteServerIder=function(){function b(){urlvars&&urlvars.idertrace&&console.log.apply(console,[].concat($jscomp.arrayFromArguments(arguments)))}var c={protocol:4,iderStart:0,floppy:null,cdrom:null,state:0,onStateChanged:null,m:{sectorStats:null,onDialogPrompt:null,dialogPrompt:function(a){c.socket.send(JSON.stringify({action:"dialogResponse",args:a}))},bytesToAmt:0,bytesFromAmt:0,server:!0,Stop:function(){c.Stop()}},xxStateChange:function(a){if(c.state!=
38
+a&&(b("SIDER-StateChange",a),c.state=a,null!=c.onStateChanged))c.onStateChanged(c,c.state)},Start:function(a,d,e,q,h){b("SIDER-Start",a,d,e,q,h);c.host=a;c.port=d;c.user=e;c.pass=q;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webider.ashx?host="+a+"&port="+d+"&tls="+h+("*"==e?"&serverauth=1":"")+("undefined"===typeof q?"&serverauth=1&user="+e:"")+"&tls1only="+
39
c.tlsv1only);c.socket.onopen=c.xxOnSocketConnected;c.socket.onmessage=c.xxOnMessage;c.socket.onclose=c.xxOnSocketClosed;c.xxStateChange(1)},Stop:function(){b("SIDER-Stop");null!=c.socket&&(c.socket.close(),c.socket=null);c.xxStateChange(0)},xxOnSocketConnected:function(){c.xxStateChange(2);c.socket.send(JSON.stringify({action:"start"}))},xxOnMessage:function(a){var b=null;try{b=JSON.parse(a.data)}catch(e){}if(null!=b&&"string"==typeof b.action)switch(b.action){case "dialog":if(null!=c.m.onDialogPrompt)c.m.onDialogPrompt(c,
40
b.args,b.buttons);break;case "state":2==b.state&&c.xxStateChange(3);break;case "stats":c.m.bytesToAmt=b.toAmt;c.m.bytesFromAmt=b.fromAmt;c.m.sectorStats&&c.m.sectorStats(b.mode,b.dev,b.total,b.start,b.len);break;case "error":console.log("IDER Error: "+";Floppy disk image does not exist;Invalid floppy disk image;Unable to open floppy disk image;CDROM disk image does not exist;Invalid CDROM disk image;Unable to open CDROM disk image;Can't perform IDER with no disk images".split(";")[b.code]);break;
41
-default:console.log("Unknown Server IDER action: "+b.action),breal}},xxOnSocketClosed:function(){c.Stop()}};return c},CreateWsmanComm=function(b,c,a,d,e){function k(){p.socketState=2;p.socketParseState=0;p.socketAccumulator="";p.socketHeader=null;p.socketData="";for(i in p.pendingAjaxCall)p.sendRequest(p.pendingAjaxCall[i][0],p.pendingAjaxCall[i][3],p.pendingAjaxCall[i][4])}function l(a){if("object"==typeof a.data)if(1==m)w.push(a.data);else if(x.readAsBinaryString)m=!0,x.readAsBinaryString(new Blob([a.data]));
42
-else if(x.readAsArrayBuffer)m=!0,x.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,n=0;n<c;n++)b+=String.fromCharCode(a[n]);u(b)}else u(a.data)}function u(a){if("object"===typeof a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,n=0;n<c;n++)b+=String.fromCharCode(a[n]);a=b}else if("string"!==typeof a)return;for(p.socketAccumulator+=a;;){if(0==p.socketParseState){a=p.socketAccumulator.indexOf("\r\n\r\n");if(0>a)break;p.socketHeader=p.socketAccumulator.substring(0,
43
-a).split("\r\n");if(null==p.amtVersion)for(n in p.socketHeader)0==p.socketHeader[n].indexOf("Server: Intel(R) Active Management Technology ")&&(p.amtVersion=p.socketHeader[n].substring(46));p.socketAccumulator=p.socketAccumulator.substring(a+4);p.socketParseState=1;p.socketData="";p.socketXHeader={Directive:p.socketHeader[0].split(" ")};for(n in p.socketHeader)0!=n&&(a=p.socketHeader[n].indexOf(":"),p.socketXHeader[p.socketHeader[n].substring(0,a).toLowerCase()]=p.socketHeader[n].substring(a+2))}if(1==
44
-p.socketParseState){b=-1;if(void 0==p.socketXHeader.connection||"close"!=p.socketXHeader.connection.toLowerCase()||void 0!=p.socketXHeader["transfer-encoding"]&&"chunked"==p.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=p.socketXHeader["content-length"]){b=parseInt(p.socketXHeader["content-length"]);if(p.socketAccumulator.length<b)break;a=p.socketAccumulator.substring(0,b);p.socketAccumulator=p.socketAccumulator.substring(b);p.socketData=a;b=0}else{c=p.socketAccumulator.indexOf("\r\n");
45
-if(0>c)break;b=parseInt(p.socketAccumulator.substring(0,c),16);if(isNaN(b)){p.websocket&&p.websocket.close();break}if(p.socketAccumulator.length<c+2+b+2)break;a=p.socketAccumulator.substring(c+2,c+2+b);p.socketAccumulator=p.socketAccumulator.substring(c+2+b+2);p.socketData+=a}else b=0;0==b&&(c=p.socketXHeader,a=p.socketData,b=parseInt(c.Directive[1]),isNaN(b)&&(b=602),401==b&&3>++p.authcounter?p.challengeParams=p.parseDigest(c["www-authenticate"]):(c=p.pendingAjaxCall.shift(),p.authcounter=0,p.ActiveAjaxCount--,
46
-p.gotNextMessages(a,"success",{status:b},c),p.PerformNextAjax()),p.socketParseState=0,p.socketHeader=null)}}}function n(a){0==p.inDataCount&&(p.tlsv1only=1-p.tlsv1only);p.socketState=0;null!=p.socket&&(p.socket.close(),p.socket=null);if(0<p.pendingAjaxCall.length){a=p.pendingAjaxCall.shift();var b=a[5];p.PerformAjaxExNodeJS2(a[0],a[1],a[2],a[3],a[4],--b)}}var p={PendingAjax:[],ActiveAjaxCount:0,MaxActiveAjaxCount:1,FailAllError:0,challengeParams:null,noncecounter:1,authcounter:0,socket:null,socketState:0};
47
-p.host=b;p.port=c;p.user=a;p.pass=d;p.tls=e;p.tlsv1only=0;p.cnonce=Math.random().toString(36).substring(7);p.inDataCount=0;p.amtVersion=null;p.digestRealmMatch=null;p.digestRealm=null;p.PerformAjax=function(a,b,c,n,d,e){p.ActiveAjaxCount<p.MaxActiveAjaxCount&&0==p.PendingAjax.length?p.PerformAjaxEx(a,b,c,d,e):1==n?p.PendingAjax.unshift([a,b,c,d,e]):p.PendingAjax.push([a,b,c,d,e])};p.PerformNextAjax=function(){if(!(p.ActiveAjaxCount>=p.MaxActiveAjaxCount||0==p.PendingAjax.length)){var a=p.PendingAjax.shift();
48
-p.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);p.PerformNextAjax()}};p.PerformAjaxEx=function(a,b,c,n,d){if(0!=p.FailAllError)p.gotNextMessagesError({status:p.FailAllError},"error",null,[a,b,c,n,d]);else return a||(a=""),p.ActiveAjaxCount++,p.PerformAjaxExNodeJS(a,b,c,n,d)};p.pendingAjaxCall=[];p.PerformAjaxExNodeJS=function(a,b,c,n,d){p.PerformAjaxExNodeJS2(a,b,c,n,d,3)};p.PerformAjaxExNodeJS2=function(a,b,c,n,d,e){0>=e||0!=p.FailAllError?(p.ActiveAjaxCount--,999!=p.FailAllError&&p.gotNextMessages(null,
49
-"error",{status:0==p.FailAllError?408:p.FailAllError},[a,b,c,n,d]),p.PerformNextAjax()):(p.pendingAjaxCall.push([a,b,c,n,d,e]),0==p.socketState?p.xxConnectHttpSocket():2==p.socketState&&p.sendRequest(a,n,d))};p.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var n=c+" "+b+" HTTP/1.1\r\n";if(null!=p.challengeParams){p.digestRealm=p.challengeParams.realm;if(p.digestRealmMatch&&p.digestRealm!=p.digestRealmMatch){p.FailAllError=997;p.CancelAllQueries(997);return}c=hex_md5(hex_md5(p.user+":"+p.challengeParams.realm+
50
-":"+p.pass)+":"+p.challengeParams.nonce+":"+p.noncecounter+":"+p.cnonce+":"+p.challengeParams.qop+":"+hex_md5(c+":"+b));n+="Authorization: "+p.renderDigest({username:p.user,realm:p.challengeParams.realm,nonce:p.challengeParams.nonce,uri:b,qop:p.challengeParams.qop,response:c,nc:p.noncecounter++,cnonce:p.cnonce})+"\r\n"}a=n+="Host: "+p.host+":"+p.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==p.socketState&&null!=p.socket&&p.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(n=
51
-0;n<a.length;++n)b[n]=a.charCodeAt(n);try{p.socket.send(b.buffer)}catch(d){}}};p.parseDigest=function(a){a=a.substring(7).split(",");for(i in a)a[i]=a[i].trim();return a.reduce(function(a,b){var c=b.split("=");a[c[0]]=c[1].replace(/"/g,"");return a},{})};p.renderDigest=function(a){var b=[];for(i in a)b.push(i);return"Digest "+b.reduce(function(b,c){return b+","+c+'="'+a[c]+'"'},"").substring(1)};p.xxConnectHttpSocket=function(){p.inDataCount=0;p.socketState=1;p.socket=new WebSocket(window.location.protocol.replace("http",
52
-"ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+p.host+"&port="+p.port+"&tls="+p.tls+"&tls1only="+p.tlsv1only+("*"==a?"&serverauth=1":"")+("undefined"===typeof d?"&serverauth=1&user="+a:""));p.socket.onopen=k;p.socket.onmessage=l;p.socket.onclose=n};var x=new FileReader,m=!1,w=[];x.readAsBinaryString?x.onload=function(a){u(a.target.result);0==w.length?m=!1:x.readAsBinaryString(new Blob([w.shift()]))}:x.readAsArrayBuffer&&
53
-(x.onloadend=function(a){u(a.target.result);0==w.length?m=!1:x.readAsArrayBuffer(w.shift())});p.gotNextMessages=function(a,b,c,n){if(999!=p.FailAllError)if(0!=p.FailAllError)n[1](null,p.FailAllError,n[2]);else if(200!=c.status)n[1](null,c.status,n[2]);else n[1](a,200,n[2])};p.gotNextMessagesError=function(a,b,c,n){if(999!=p.FailAllError)if(0!=p.FailAllError)n[1](null,p.FailAllError,n[2]);else n[1](p,null,{Header:{HttpError:a.status}},a.status,n[2])};p.CancelAllQueries=function(a){for(;0<p.PendingAjax.length;){var b=
54
-p.PendingAjax.shift();b[1](null,a,b[2])}null!=p.websocket&&(p.websocket.close(),p.websocket=null,p.socketState=0)};return p},CreateAmtRedirect=function(b){var c={};c.m=b;b.parent=c;c.State=0;c.socket=null;c.host=null;c.port=0;c.user=null;c.pass=null;c.authuri="/RedirectionService";c.tlsv1only=0;c.connectstate=0;c.protocol=b.protocol;c.amtaccumulator="";c.amtsequence=1;c.amtkeepalivetimer=null;c.digestRealmMatch=null;c.onStateChanged=null;c.Start=function(a,b,d,n,e){c.host=a;c.port=b;c.user=d;c.pass=
41
+default:console.log("Unknown Server IDER action: "+b.action),breal}},xxOnSocketClosed:function(){c.Stop()}};return c},CreateWsmanComm=function(b,c,a,d,e){function q(){m.socketState=2;m.socketParseState=0;m.socketAccumulator="";m.socketHeader=null;m.socketData="";for(i in m.pendingAjaxCall)m.sendRequest(m.pendingAjaxCall[i][0],m.pendingAjaxCall[i][3],m.pendingAjaxCall[i][4])}function h(a){if("object"==typeof a.data)if(1==k)v.push(a.data);else if(w.readAsBinaryString)k=!0,w.readAsBinaryString(new Blob([a.data]));
42
+else if(w.readAsArrayBuffer)k=!0,w.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,n=0;n<c;n++)b+=String.fromCharCode(a[n]);r(b)}else r(a.data)}function r(a){if("object"===typeof a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,n=0;n<c;n++)b+=String.fromCharCode(a[n]);a=b}else if("string"!==typeof a)return;for(m.socketAccumulator+=a;;){if(0==m.socketParseState){a=m.socketAccumulator.indexOf("\r\n\r\n");if(0>a)break;m.socketHeader=m.socketAccumulator.substring(0,
43
+a).split("\r\n");if(null==m.amtVersion)for(n in m.socketHeader)0==m.socketHeader[n].indexOf("Server: Intel(R) Active Management Technology ")&&(m.amtVersion=m.socketHeader[n].substring(46));m.socketAccumulator=m.socketAccumulator.substring(a+4);m.socketParseState=1;m.socketData="";m.socketXHeader={Directive:m.socketHeader[0].split(" ")};for(n in m.socketHeader)0!=n&&(a=m.socketHeader[n].indexOf(":"),m.socketXHeader[m.socketHeader[n].substring(0,a).toLowerCase()]=m.socketHeader[n].substring(a+2))}if(1==
44
+m.socketParseState){b=-1;if(void 0==m.socketXHeader.connection||"close"!=m.socketXHeader.connection.toLowerCase()||void 0!=m.socketXHeader["transfer-encoding"]&&"chunked"==m.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=m.socketXHeader["content-length"]){b=parseInt(m.socketXHeader["content-length"]);if(m.socketAccumulator.length<b)break;a=m.socketAccumulator.substring(0,b);m.socketAccumulator=m.socketAccumulator.substring(b);m.socketData=a;b=0}else{c=m.socketAccumulator.indexOf("\r\n");
45
+if(0>c)break;b=parseInt(m.socketAccumulator.substring(0,c),16);if(isNaN(b)){m.websocket&&m.websocket.close();break}if(m.socketAccumulator.length<c+2+b+2)break;a=m.socketAccumulator.substring(c+2,c+2+b);m.socketAccumulator=m.socketAccumulator.substring(c+2+b+2);m.socketData+=a}else b=0;0==b&&(c=m.socketXHeader,a=m.socketData,b=parseInt(c.Directive[1]),isNaN(b)&&(b=602),401==b&&3>++m.authcounter?m.challengeParams=m.parseDigest(c["www-authenticate"]):(c=m.pendingAjaxCall.shift(),m.authcounter=0,m.ActiveAjaxCount--,
46
+m.gotNextMessages(a,"success",{status:b},c),m.PerformNextAjax()),m.socketParseState=0,m.socketHeader=null)}}}function n(a){0==m.inDataCount&&(m.tlsv1only=1-m.tlsv1only);m.socketState=0;null!=m.socket&&(m.socket.close(),m.socket=null);if(0<m.pendingAjaxCall.length){a=m.pendingAjaxCall.shift();var b=a[5];m.PerformAjaxExNodeJS2(a[0],a[1],a[2],a[3],a[4],--b)}}var m={PendingAjax:[],ActiveAjaxCount:0,MaxActiveAjaxCount:1,FailAllError:0,challengeParams:null,noncecounter:1,authcounter:0,socket:null,socketState:0};
47
+m.host=b;m.port=c;m.user=a;m.pass=d;m.tls=e;m.tlsv1only=0;m.cnonce=Math.random().toString(36).substring(7);m.inDataCount=0;m.amtVersion=null;m.digestRealmMatch=null;m.digestRealm=null;m.PerformAjax=function(a,b,c,n,d,e){m.ActiveAjaxCount<m.MaxActiveAjaxCount&&0==m.PendingAjax.length?m.PerformAjaxEx(a,b,c,d,e):1==n?m.PendingAjax.unshift([a,b,c,d,e]):m.PendingAjax.push([a,b,c,d,e])};m.PerformNextAjax=function(){if(!(m.ActiveAjaxCount>=m.MaxActiveAjaxCount||0==m.PendingAjax.length)){var a=m.PendingAjax.shift();
48
+m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx=function(a,b,c,n,d){if(0!=m.FailAllError)m.gotNextMessagesError({status:m.FailAllError},"error",null,[a,b,c,n,d]);else return a||(a=""),m.ActiveAjaxCount++,m.PerformAjaxExNodeJS(a,b,c,n,d)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(a,b,c,n,d){m.PerformAjaxExNodeJS2(a,b,c,n,d,3)};m.PerformAjaxExNodeJS2=function(a,b,c,n,d,e){0>=e||0!=m.FailAllError?(m.ActiveAjaxCount--,999!=m.FailAllError&&m.gotNextMessages(null,
49
+"error",{status:0==m.FailAllError?408:m.FailAllError},[a,b,c,n,d]),m.PerformNextAjax()):(m.pendingAjaxCall.push([a,b,c,n,d,e]),0==m.socketState?m.xxConnectHttpSocket():2==m.socketState&&m.sendRequest(a,n,d))};m.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var n=c+" "+b+" HTTP/1.1\r\n";if(null!=m.challengeParams){m.digestRealm=m.challengeParams.realm;if(m.digestRealmMatch&&m.digestRealm!=m.digestRealmMatch){m.FailAllError=997;m.CancelAllQueries(997);return}c=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+
50
+":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(c+":"+b));n+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:b,qop:m.challengeParams.qop,response:c,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}a=n+="Host: "+m.host+":"+m.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==m.socketState&&null!=m.socket&&m.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(n=
51
+0;n<a.length;++n)b[n]=a.charCodeAt(n);try{m.socket.send(b.buffer)}catch(d){}}};m.parseDigest=function(a){a=a.substring(7).split(",");for(i in a)a[i]=a[i].trim();return a.reduce(function(a,b){var c=b.split("=");a[c[0]]=c[1].replace(/"/g,"");return a},{})};m.renderDigest=function(a){var b=[];for(i in a)b.push(i);return"Digest "+b.reduce(function(b,c){return b+","+c+'="'+a[c]+'"'},"").substring(1)};m.xxConnectHttpSocket=function(){m.inDataCount=0;m.socketState=1;m.socket=new WebSocket(window.location.protocol.replace("http",
52
+"ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+m.host+"&port="+m.port+"&tls="+m.tls+"&tls1only="+m.tlsv1only+("*"==a?"&serverauth=1":"")+("undefined"===typeof d?"&serverauth=1&user="+a:""));m.socket.onopen=q;m.socket.onmessage=h;m.socket.onclose=n};var w=new FileReader,k=!1,v=[];w.readAsBinaryString?w.onload=function(a){r(a.target.result);0==v.length?k=!1:w.readAsBinaryString(new Blob([v.shift()]))}:w.readAsArrayBuffer&&
53
+(w.onloadend=function(a){r(a.target.result);0==v.length?k=!1:w.readAsArrayBuffer(v.shift())});m.gotNextMessages=function(a,b,c,n){if(999!=m.FailAllError)if(0!=m.FailAllError)n[1](null,m.FailAllError,n[2]);else if(200!=c.status)n[1](null,c.status,n[2]);else n[1](a,200,n[2])};m.gotNextMessagesError=function(a,b,c,n){if(999!=m.FailAllError)if(0!=m.FailAllError)n[1](null,m.FailAllError,n[2]);else n[1](m,null,{Header:{HttpError:a.status}},a.status,n[2])};m.CancelAllQueries=function(a){for(;0<m.PendingAjax.length;){var b=
54
+m.PendingAjax.shift();b[1](null,a,b[2])}null!=m.websocket&&(m.websocket.close(),m.websocket=null,m.socketState=0)};return m},CreateAmtRedirect=function(b){var c={};c.m=b;b.parent=c;c.State=0;c.socket=null;c.host=null;c.port=0;c.user=null;c.pass=null;c.authuri="/RedirectionService";c.tlsv1only=0;c.connectstate=0;c.protocol=b.protocol;c.amtaccumulator="";c.amtsequence=1;c.amtkeepalivetimer=null;c.digestRealmMatch=null;c.onStateChanged=null;c.Start=function(a,b,d,n,e){c.host=a;c.port=b;c.user=d;c.pass=
55
n;c.connectstate=0;c.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+a+"&port="+b+"&tls="+e+("*"==d?"&serverauth=1":"")+("undefined"===typeof n?"&serverauth=1&user="+d:"")+"&tls1only="+c.tlsv1only);c.socket.onopen=c.xxOnSocketConnected;c.socket.onmessage=c.xxOnMessage;c.socket.onclose=c.xxOnSocketClosed;c.xxStateChange(1)};c.xxOnSocketConnected=function(){urlvars&&
56
urlvars.redirtrace&&console.log("REDIR-CONNECT");c.xxStateChange(2);1==c.protocol&&c.xxSend(c.RedirectStartSol);2==c.protocol&&c.xxSend(c.RedirectStartKvm);3==c.protocol&&c.xxSend(c.RedirectStartIder)};var a=new FileReader,d=!1,e=[];a.readAsBinaryString?a.onload=function(b){c.xxOnSocketData(b.target.result);0==e.length?d=!1:a.readAsBinaryString(new Blob([e.shift()]))}:a.readAsArrayBuffer&&(a.onloadend=function(b){c.xxOnSocketData(b.target.result);0==e.length?d=!1:a.readAsArrayBuffer(e.shift())});
57
-c.xxOnMessage=function(b){c.inDataCount++;if("object"==typeof b.data)if(1==d)e.push(b.data);else if(a.readAsBinaryString)d=!0,a.readAsBinaryString(new Blob([b.data]));else if(a.readAsArrayBuffer)d=!0,a.readAsArrayBuffer(b.data);else{var l="";b=new Uint8Array(b.data);for(var u=b.byteLength,n=0;n<u;n++)l+=String.fromCharCode(b[n]);c.xxOnSocketData(l)}else c.xxOnSocketData(b.data)};c.xxOnSocketData=function(a){if(a&&-1!=c.connectstate){if("object"===typeof a){var b="",d=new Uint8Array(a),n=d.byteLength;
57
+c.xxOnMessage=function(b){c.inDataCount++;if("object"==typeof b.data)if(1==d)e.push(b.data);else if(a.readAsBinaryString)d=!0,a.readAsBinaryString(new Blob([b.data]));else if(a.readAsArrayBuffer)d=!0,a.readAsArrayBuffer(b.data);else{var h="";b=new Uint8Array(b.data);for(var r=b.byteLength,n=0;n<r;n++)h+=String.fromCharCode(b[n]);c.xxOnSocketData(h)}else c.xxOnSocketData(b.data)};c.xxOnSocketData=function(a){if(a&&-1!=c.connectstate){if("object"===typeof a){var b="",d=new Uint8Array(a),n=d.byteLength;
58
for(a=0;a<n;a++)b+=String.fromCharCode(d[a]);a=b}else if("string"!==typeof a)return;if((2==c.protocol||3==c.protocol)&&1==c.connectstate)return c.m.ProcessData(a);c.amtaccumulator+=a;for(urlvars&&urlvars.redirtrace&&console.log("REDIR-RECV("+c.amtaccumulator.length+"): "+rstr2hex(c.amtaccumulator));1<=c.amtaccumulator.length;){a=0;switch(c.amtaccumulator.charCodeAt(0)){case 17:if(4>c.amtaccumulator.length)return;switch(c.amtaccumulator.charCodeAt(1)){case 0:if(13>c.amtaccumulator.length)return;b=
59
-c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var e=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+e)return;var n=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),x=[];for(a=0;a<e;a++)x.push(c.amtaccumulator.charCodeAt(9+a));d=c.amtaccumulator.substring(9,9+e);a=9+e;if(0==b)0<=x.indexOf(4)?c.xxSend(String.fromCharCode(19,
60
-0,0,0,4)+IntToStrX(c.user.length+c.authuri.length+8)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(0,0)+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(0,0,0,0)):0<=x.indexOf(3)?c.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(c.user.length+c.authuri.length+7)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(0,0)+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(0,0,0)):0<=x.indexOf(1)?c.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(c.user.length+
61
-c.pass.length+2)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(c.pass.length)+c.pass):c.Stop();else if(3!=b&&4!=b||1!=n)0==n?(1==c.protocol&&c.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(c.amtsequence++)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0)),2==c.protocol&&c.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3==c.protocol&&(c.connectstate=1,c.xxStateChange(3))):c.Stop();else{e=0;x=d.charCodeAt(e);n=d.substring(e+
62
-1,e+1+x);e+=x+1;if(c.digestRealmMatch&&c.digestRealmMatch!=n){c.Stop();return}var m=d.charCodeAt(e),x=d.substring(e+1,e+1+m),e=e+(m+1),m=0,m=null,w=c.xxRandomNonce(32),h="";4==b&&(m=d.charCodeAt(e),m=d.substring(e+1,e+1+m),h="00000002:"+w+":"+m+":");d=hex_md5(hex_md5(c.user+":"+n+":"+c.pass)+":"+x+":"+h+hex_md5("POST:"+c.authuri));e=c.user.length+n.length+x.length+c.authuri.length+w.length+8+d.length+7;4==b&&(e+=m.length+1);d=String.fromCharCode(19,0,0,0,b)+IntToStrX(e)+String.fromCharCode(c.user.length)+
63
-c.user+String.fromCharCode(n.length)+n+String.fromCharCode(x.length)+x+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(w.length)+w+String.fromCharCode(8)+"00000002"+String.fromCharCode(d.length)+d;4==b&&(d+=String.fromCharCode(m.length)+m);c.xxSend(d)}break;case 33:if(23>c.amtaccumulator.length)break;a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3));
59
+c.amtaccumulator.charCodeAt(12);if(c.amtaccumulator.length<13+b)return;c.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+b;break;default:c.Stop()}break;case 20:if(9>c.amtaccumulator.length)return;var e=ReadIntX(c.amtaccumulator,5);if(c.amtaccumulator.length<9+e)return;var n=c.amtaccumulator.charCodeAt(1),b=c.amtaccumulator.charCodeAt(4),w=[];for(a=0;a<e;a++)w.push(c.amtaccumulator.charCodeAt(9+a));d=c.amtaccumulator.substring(9,9+e);a=9+e;if(0==b)0<=w.indexOf(4)?c.xxSend(String.fromCharCode(19,
60
+0,0,0,4)+IntToStrX(c.user.length+c.authuri.length+8)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(0,0)+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(0,0,0,0)):0<=w.indexOf(3)?c.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(c.user.length+c.authuri.length+7)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(0,0)+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(0,0,0)):0<=w.indexOf(1)?c.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(c.user.length+
61
+c.pass.length+2)+String.fromCharCode(c.user.length)+c.user+String.fromCharCode(c.pass.length)+c.pass):c.Stop();else if(3!=b&&4!=b||1!=n)0==n?(1==c.protocol&&c.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(c.amtsequence++)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0)),2==c.protocol&&c.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3==c.protocol&&(c.connectstate=1,c.xxStateChange(3))):c.Stop();else{e=0;w=d.charCodeAt(e);n=d.substring(e+
62
+1,e+1+w);e+=w+1;if(c.digestRealmMatch&&c.digestRealmMatch!=n){c.Stop();return}var k=d.charCodeAt(e),w=d.substring(e+1,e+1+k),e=e+(k+1),k=0,k=null,v=c.xxRandomNonce(32),B="";4==b&&(k=d.charCodeAt(e),k=d.substring(e+1,e+1+k),B="00000002:"+v+":"+k+":");d=hex_md5(hex_md5(c.user+":"+n+":"+c.pass)+":"+w+":"+B+hex_md5("POST:"+c.authuri));e=c.user.length+n.length+w.length+c.authuri.length+v.length+8+d.length+7;4==b&&(e+=k.length+1);d=String.fromCharCode(19,0,0,0,b)+IntToStrX(e)+String.fromCharCode(c.user.length)+
63
+c.user+String.fromCharCode(n.length)+n+String.fromCharCode(w.length)+w+String.fromCharCode(c.authuri.length)+c.authuri+String.fromCharCode(v.length)+v+String.fromCharCode(8)+"00000002"+String.fromCharCode(d.length)+d;4==b&&(d+=String.fromCharCode(k.length)+k);c.xxSend(d)}break;case 33:if(23>c.amtaccumulator.length)break;a=23;c.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(c.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==c.protocol&&(c.amtkeepalivetimer=setInterval(c.xxSendAmtKeepAlive,2E3));
64
c.connectstate=1;c.xxStateChange(3);break;case 41:if(10>c.amtaccumulator.length)break;a=10;break;case 42:if(10>c.amtaccumulator.length)break;b=10+((c.amtaccumulator.charCodeAt(9)&255)<<8)+(c.amtaccumulator.charCodeAt(8)&255);if(c.amtaccumulator.length<b)break;c.m.ProcessData(c.amtaccumulator.substring(10,b));a=b;break;case 43:if(8>c.amtaccumulator.length)break;a=8;break;case 65:if(8>c.amtaccumulator.length)break;c.connectstate=1;c.m.Start();8<c.amtaccumulator.length&&c.m.ProcessData(c.amtaccumulator.substring(8));
65
a=c.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+c.amtaccumulator.charCodeAt(0)+" acclen="+c.amtaccumulator.length);c.Stop();return}if(0==a)break;c.amtaccumulator=c.amtaccumulator.substring(a)}}};c.xxSend=function(a){urlvars&&urlvars.redirtrace&&console.log("REDIR-SEND("+a.length+"): "+rstr2hex(a));if(null!=c.socket&&c.socket.readyState==WebSocket.OPEN){for(var b=new Uint8Array(a.length),d=0;d<a.length;++d)b[d]=a.charCodeAt(d);c.socket.send(b.buffer)}};c.Send=function(a){null!=
66
c.socket&&1==c.connectstate&&(1==c.protocol?c.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(c.amtsequence++)+ShortToStrX(a.length)+a):c.xxSend(a))};c.xxSendAmtKeepAlive=function(){null!=c.socket&&c.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(c.amtsequence++))};c.xxRandomNonceX="abcdef0123456789";c.xxRandomNonce=function(a){for(var b="",d=0;d<a;d++)b+=c.xxRandomNonceX.charAt(Math.floor(Math.random()*c.xxRandomNonceX.length));return b};c.xxOnSocketClosed=function(){urlvars&&urlvars.redirtrace&&
67
console.log("REDIR-CLOSED");c.Stop()};c.xxStateChange=function(a){if(c.State!=a&&(c.State=a,c.m.xxStateChange(c.State),null!=c.onStateChanged))c.onStateChanged(c,c.State)};c.Stop=function(){c.xxStateChange(0);c.connectstate=-1;c.amtaccumulator="";null!=c.socket&&(c.socket.close(),c.socket=null);null!=c.amtkeepalivetimer&&(clearInterval(c.amtkeepalivetimer),c.amtkeepalivetimer=null)};c.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32);c.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,
68
-77,82);c.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return c},WsmanStackCreateService=function(b,c,a,d,e,k){function l(a){for(var b,c={},n=0;n<a.childNodes.length;n++){var d=a.childNodes[n];b=null==d.childElementCount||0==d.childElementCount?d.textContent:l(d);"true"==b&&(b=!0);"false"==b&&(b=!1);parseInt(b)+""===b&&(b=parseInt(b));var e=b;if(null!=d.attributes&&0<d.attributes.length)for(e={Value:b},b=0;b<d.attributes.length;b++)e["@"+d.attributes[b].name]=d.attributes[b].value;c[d.localName]instanceof
69
-Array?c[d.localName].push(e):c[d.localName]=null==c[d.localName]?e:[c[d.localName],e]}return c}function u(a){if(!a)return"";var b="",c;for(c in a)a.hasOwnProperty(c)&&0===c.indexOf("@")&&(b+=" "+c.substring(1)+'="'+a[c]+'"');return b}function n(a){if(!a)return"";if("string"==typeof a)return a;if(a.InstanceID)return'<w:SelectorSet><w:Selector Name="InstanceID">'+a.InstanceID+"</w:Selector></w:SelectorSet>";var b="<w:SelectorSet>",c;for(c in a)if(a.hasOwnProperty(c)){b+='<w:Selector Name="'+c+'">';
70
-if(a[c].ReferenceParameters){var b=b+"<a:EndpointReference>",b=b+("<a:Address>"+a[c].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+a[c].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>"),n=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(n))for(var d=0;d<n.length;d++)b+="<w:Selector"+u(n[d])+">"+n[d].Value+"</w:Selector>";else b+="<w:Selector"+u(n)+">"+n.Value+"</w:Selector>";b+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else b+=a[c];
71
-b+="</w:Selector>"}return b+"</w:SelectorSet>"}var p={NextMessageId:1,Address:"/wsman"};p.comm=CreateWsmanComm(b,c,a,d,e,k);p.PerformAjax=function(a,b,c,n,d){null==d&&(d="");p.comm.PerformAjax('<?xml version="1.0" encoding="utf-8"?><Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope" '+
72
-d+"><Header><a:Action>"+a,function(a,c,n){200!=c?b(p,null,{Header:{HttpError:c}},c,n):(a=p.ParseWsman(a))&&null!=a?b(p,a.Header.ResourceURI,a,200,n):b(p,null,{Header:{HttpError:c}},601,n)},c,n)};p.CancelAllQueries=function(a){p.comm.CancelAllQueries(a)};p.GetNameFromUrl=function(a){var b=a.lastIndexOf("/");return-1==b?a:a.substring(b+1)};p.ExecSubscribe=function(a,b,c,d,e,g,K,r,E,z){var B="",I="";r="";null!=E&&null!=z&&(B='<t:IssuedTokens xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><t:RequestSecurityTokenResponse><t:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</t:TokenType><t:RequestedSecurityToken><se:UsernameToken><se:Username>'+
73
-E+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+z+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",I='<w:Auth Profile="http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/digest"/>');null!=r&&(r="<a:ReferenceParameters><m:arg>"+r+"</m:arg></a:ReferenceParameters>");"PushWithAck"==b?b="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==b&&(b="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push");
74
-a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+n(K)+B+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.'+b+'"><e:NotifyTo><a:Address>'+c+"</a:Address>"+r+"</e:NotifyTo>"+I+"</e:Delivery></e:Subscribe>";p.PerformAjax(a+"</Body></Envelope>",d,e,
75
-g,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};p.ExecUnSubscribe=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+n(e)+"</Header><Body><e:Unsubscribe/>";p.PerformAjax(a+"</Body></Envelope>",b,c,d,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};
76
-p.ExecPut=function(a,b,c,d,e,g){g="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout>"+n(g)+"</Header><Body>";if(a&&null!=b){var K=p.GetNameFromUrl(a);a="<r:"+K+' xmlns:r="'+a+'">';for(var r in b)if(b.hasOwnProperty(r)&&
77
-0!==r.indexOf("__")&&0!==r.indexOf("@")&&null!=b[r]&&"function"!==typeof b[r])if("object"===typeof b[r]&&b[r].ReferenceParameters){a+="<r:"+r+"><a:Address>"+b[r].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+b[r].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var E=b[r].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(E))for(var z=0;z<E.length;z++)a+="<w:Selector"+u(E[z])+">"+E[z].Value+"</w:Selector>";else a+="<w:Selector"+u(E)+">"+E.Value+"</w:Selector>";
78
-a+="</w:SelectorSet></a:ReferenceParameters></r:"+r+">"}else if(Array.isArray(b[r]))for(z=0;z<b[r].length;z++)a+="<r:"+r+">"+b[r][z].toString()+"</r:"+r+">";else a+="<r:"+r+">"+b[r].toString()+"</r:"+r+">";b=a+("</r:"+K+">")}else b="";p.PerformAjax(g+b+"</Body></Envelope>",c,d,e)};p.ExecCreate=function(a,b,c,d,e,g){var K=p.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +
79
-"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+n(g)+"</Header><Body><g:"+K+' xmlns:g="'+a+'">';for(var r in b)a+="<g:"+r+">"+b[r]+"</g:"+r+">";p.PerformAjax(a+"</g:"+K+"></Body></Envelope>",c,d,e)};p.ExecDelete=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +
80
-"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+n(b)+"</Header><Body /></Envelope>";p.PerformAjax(a,c,d,e)};p.ExecGet=function(a,b,c,n){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body /></Envelope>",
81
-b,c,n)};p.ExecMethod=function(a,b,c,n,d,e,K){var r="",E;for(E in c)if(null!=c[E])if(Array.isArray(c[E]))for(var z in c[E])r+="<r:"+E+">"+c[E][z]+"</r:"+E+">";else r+="<r:"+E+">"+c[E]+"</r:"+E+">";p.ExecMethodXml(a,b,r,n,d,e,K)};p.ExecMethodXml=function(a,b,c,d,e,g,K){p.PerformAjax(a+"/"+b+"</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+
82
-n(K)+"</Header><Body><r:"+b+'_INPUT xmlns:r="'+a+'">'+c+"</r:"+b+"_INPUT></Body></Envelope>",d,e,g)};p.ExecEnum=function(a,b,c,n){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>',
83
-b,c,n)};p.ExecPull=function(a,b,c,n,d){p.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+p.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+p.NextMessageId++ +'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>'+b+"</EnumerationContext></Pull></Body></Envelope>",
84
-c,n,d)};p.ParseWsman=function(a){try{if(!a.childNodes){var b=a;if(window.DOMParser)a=(new DOMParser).parseFromString(b,"text/xml");else{var c=new ActiveXObject("Microsoft.XMLDOM");c.async=!1;c.loadXML(b);a=c}}var b={Header:{}},n=a.getElementsByTagName("Header")[0],d;n||(n=a.getElementsByTagName("a:Header")[0]);if(!n)return null;for(c=0;c<n.childNodes.length;c++){var e=n.childNodes[c];b.Header[e.localName]=e.textContent}var p=a.getElementsByTagName("Body")[0];p||(p=a.getElementsByTagName("a:Body")[0]);
85
-if(!p)return null;0<p.childNodes.length&&(d=p.childNodes[0].localName,d.indexOf("_OUTPUT")==d.length-7&&(d=d.substring(0,d.length-7)),b.Header.Method=d,b.Body=l(p.childNodes[0]));return b}catch(r){return console.log("Unable to parse XML: "+a),null}};return p};
86
-function AmtStackCreateService(b){function c(){var a=m.GetPendingActions();w<a&&(w=a);null!=m.onProcessChanged&&h!=a&&(h=a,m.onProcessChanged(a,w));0==a&&(w=0)}function a(a,b,c,n,h,g,A){200!=h?(c(m,a,null,h,g),e(1)):null!=b&&"EnumerateResponse"==b.Header.Method&&b.Body.EnumerationContext?m.wsman.ExecPull(n,b.Body.EnumerationContext,function(b,n,e,h){d(a,e,c,n,[],h,g,A)}):(c(m,a,null,603,g),e(1))}function d(a,b,n,h,g,r,A,y){if(200!=r)n(m,a,null,r,A),e(1);else if(null==b||"PullResponse"!=b.Header.Method)n(m,
87
-a,null,604,A),e(1);else{for(var C in b.Body.Items)if(b.Body.Items[C]instanceof Array)for(var v in b.Body.Items[C])"function"!=typeof b.Body.Items[C][v]&&g.push(b.Body.Items[C][v]);else"function"!=typeof b.Body.Items[C]&&g.push(b.Body.Items[C]);b.Body.EnumerationContext?m.wsman.ExecPull(h,b.Body.EnumerationContext,function(b,c,e,y){d(a,e,n,c,g,y,A,1)}):(e(1),n(m,a,g,r,A),c())}}function e(a){m.ActiveEnumsCount-=a;m.ActiveEnumsCount>=m.MaxActiveEnumsCount||0==m.PendingEnums.length?c():(a=m.PendingEnums.shift(),
88
-m.Enum(a[0],a[1],a[2]),e(0))}function k(a,b,n,d,e,h,A){m.PendingBatchOperations-=2;var y=b.shift(),g=m.Enum;"*"==y[0]&&(g=m.Get,y=y.substring(1));g(y,function(e,y,g,C,r){r[2][y]={response:null==g?null:g.Body,responses:g,status:C};0==r[1].length||401==C||1!=h&&200!=C&&400!=C?(m.PendingBatchOperations-=2*b.length,c(),n(m,a,r[2],C,d)):(c(),k(a,b,n,d,r[2],A))},[a,b,e],A);c()}function l(a){a.names.length<=a.current?a.callback(m,a.name,a.responses,200,a.tag):(m.wsman.ExecGet(m.CompleteName(a.names[a.current]),
89
-function(b,c,n,d){null==n||200!=d?a.callback(m,a.name,null,d,a.tag):(a.responses[n.Header.Method]=n,l(a))},a.pri),a.current++);c()}function u(a,b,c,d,e){if(200!=d||"0"!=c.Body.ReturnValue)e[0](m,null,e[2]);else m.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,e)}function n(a,b,c,d,e){if(200!=d||"0"!=c.Body.ReturnValue)e[0](m,null,e[2]);else{var h,A,y;b=e[2];d=new Date;var g=c.Body.RecordArray;"string"===typeof g&&(c.Body.RecordArray=[c.Body.RecordArray]);for(h in g){a=null;try{a=window.atob(g[h])}catch(r){}if(null!=
90
-a&&(A=ReadIntX(a,0),0<A&&4294967295>A)){y={DeviceAddress:a.charCodeAt(4),EventSensorType:a.charCodeAt(5),EventType:a.charCodeAt(6),EventOffset:a.charCodeAt(7),EventSourceType:a.charCodeAt(8),EventSeverity:a.charCodeAt(9),SensorNumber:a.charCodeAt(10),Entity:a.charCodeAt(11),EntityInstance:a.charCodeAt(12),EventData:[],Time:new Date(1E3*(A+60*d.getTimezoneOffset()))};for(A=13;21>A;A++)y.EventData.push(a.charCodeAt(A));y.EntityStr=K[y.Entity];y.Desc=p(y.EventSensorType,y.EventOffset,y.EventData,y.Entity);
91
-y.EntityStr||(y.EntityStr="Unknown");b.push(y)}}if(1!=c.Body.NoMoreRecords)m.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,[e[0],b,e[2]]);else e[0](m,b,e[2])}}function p(a,b,c,n){if(15==a)return 235==c[0]?"Invalid Data":0==b?v[c[1]]:g[c[1]];if(18==a&&170==c[0])return"Agent watchdog "+char2hex(c[4])+char2hex(c[3])+char2hex(c[2])+char2hex(c[1])+"-"+char2hex(c[6])+char2hex(c[5])+"-... changed to "+m.WatchdogCurrentStates[c[7]];if(5==a&&0==b)return"Case intrusion";if(192==a&&0==b&&170==c[0]&&
68
+77,82);c.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return c},WsmanStackCreateService=function(b,c,a,d,e,q){function h(a){for(var b,c={},n=0;n<a.childNodes.length;n++){var d=a.childNodes[n];b=null==d.childElementCount||0==d.childElementCount?d.textContent:h(d);"true"==b&&(b=!0);"false"==b&&(b=!1);parseInt(b)+""===b&&(b=parseInt(b));var g=b;if(null!=d.attributes&&0<d.attributes.length)for(g={Value:b},b=0;b<d.attributes.length;b++)g["@"+d.attributes[b].name]=d.attributes[b].value;c[d.localName]instanceof
69
+Array?c[d.localName].push(g):c[d.localName]=null==c[d.localName]?g:[c[d.localName],g]}return c}function r(a){if(!a)return"";var b="",c;for(c in a)a.hasOwnProperty(c)&&0===c.indexOf("@")&&(b+=" "+c.substring(1)+'="'+a[c]+'"');return b}function n(a){if(!a)return"";if("string"==typeof a)return a;if(a.InstanceID)return'<w:SelectorSet><w:Selector Name="InstanceID">'+a.InstanceID+"</w:Selector></w:SelectorSet>";var b="<w:SelectorSet>",c;for(c in a)if(a.hasOwnProperty(c)){b+='<w:Selector Name="'+c+'">';
70
+if(a[c].ReferenceParameters){var b=b+"<a:EndpointReference>",b=b+("<a:Address>"+a[c].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+a[c].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>"),n=a[c].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(n))for(var d=0;d<n.length;d++)b+="<w:Selector"+r(n[d])+">"+n[d].Value+"</w:Selector>";else b+="<w:Selector"+r(n)+">"+n.Value+"</w:Selector>";b+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else b+=a[c];
71
+b+="</w:Selector>"}return b+"</w:SelectorSet>"}var m={NextMessageId:1,Address:"/wsman"};m.comm=CreateWsmanComm(b,c,a,d,e,q);m.PerformAjax=function(a,b,c,n,d){null==d&&(d="");m.comm.PerformAjax('<?xml version="1.0" encoding="utf-8"?><Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns="http://www.w3.org/2003/05/soap-envelope" '+
72
+d+"><Header><a:Action>"+a,function(a,c,n){200!=c?b(m,null,{Header:{HttpError:c}},c,n):(a=m.ParseWsman(a))&&null!=a?b(m,a.Header.ResourceURI,a,200,n):b(m,null,{Header:{HttpError:c}},601,n)},c,n)};m.CancelAllQueries=function(a){m.comm.CancelAllQueries(a)};m.GetNameFromUrl=function(a){var b=a.lastIndexOf("/");return-1==b?a:a.substring(b+1)};m.ExecSubscribe=function(a,b,c,d,e,g,I,u,D,z){var x="",F="";u="";null!=D&&null!=z&&(x='<t:IssuedTokens xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust" xmlns:se="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><t:RequestSecurityTokenResponse><t:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken</t:TokenType><t:RequestedSecurityToken><se:UsernameToken><se:Username>'+
73
+D+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+z+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",F='<w:Auth Profile="http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/digest"/>');null!=u&&(u="<a:ReferenceParameters><m:arg>"+u+"</m:arg></a:ReferenceParameters>");"PushWithAck"==b?b="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==b&&(b="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push");
74
+a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+n(I)+x+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.'+b+'"><e:NotifyTo><a:Address>'+c+"</a:Address>"+u+"</e:NotifyTo>"+F+"</e:Delivery></e:Subscribe>";m.PerformAjax(a+"</Body></Envelope>",d,e,
75
+g,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};m.ExecUnSubscribe=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+n(e)+"</Header><Body><e:Unsubscribe/>";m.PerformAjax(a+"</Body></Envelope>",b,c,d,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};
76
+m.ExecPut=function(a,b,c,d,e,g){g="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60.000S</w:OperationTimeout>"+n(g)+"</Header><Body>";if(a&&null!=b){var I=m.GetNameFromUrl(a);a="<r:"+I+' xmlns:r="'+a+'">';for(var u in b)if(b.hasOwnProperty(u)&&
77
+0!==u.indexOf("__")&&0!==u.indexOf("@")&&null!=b[u]&&"function"!==typeof b[u])if("object"===typeof b[u]&&b[u].ReferenceParameters){a+="<r:"+u+"><a:Address>"+b[u].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+b[u].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var D=b[u].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(D))for(var z=0;z<D.length;z++)a+="<w:Selector"+r(D[z])+">"+D[z].Value+"</w:Selector>";else a+="<w:Selector"+r(D)+">"+D.Value+"</w:Selector>";
78
+a+="</w:SelectorSet></a:ReferenceParameters></r:"+u+">"}else if(Array.isArray(b[u]))for(z=0;z<b[u].length;z++)a+="<r:"+u+">"+b[u][z].toString()+"</r:"+u+">";else a+="<r:"+u+">"+b[u].toString()+"</r:"+u+">";b=a+("</r:"+I+">")}else b="";m.PerformAjax(g+b+"</Body></Envelope>",c,d,e)};m.ExecCreate=function(a,b,c,d,e,g){var I=m.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +
79
+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+n(g)+"</Header><Body><g:"+I+' xmlns:g="'+a+'">';for(var u in b)a+="<g:"+u+">"+b[u]+"</g:"+u+">";m.PerformAjax(a+"</g:"+I+"></Body></Envelope>",c,d,e)};m.ExecDelete=function(a,b,c,d,e){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +
80
+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+n(b)+"</Header><Body /></Envelope>";m.PerformAjax(a,c,d,e)};m.ExecGet=function(a,b,c,n){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body /></Envelope>",
81
+b,c,n)};m.ExecMethod=function(a,b,c,n,d,g,e){var u="",D;for(D in c)if(null!=c[D])if(Array.isArray(c[D]))for(var z in c[D])u+="<r:"+D+">"+c[D][z]+"</r:"+D+">";else u+="<r:"+D+">"+c[D]+"</r:"+D+">";m.ExecMethodXml(a,b,u,n,d,g,e)};m.ExecMethodXml=function(a,b,c,d,e,g,I){m.PerformAjax(a+"/"+b+"</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout>"+
82
+n(I)+"</Header><Body><r:"+b+'_INPUT xmlns:r="'+a+'">'+c+"</r:"+b+"_INPUT></Body></Envelope>",d,e,g)};m.ExecEnum=function(a,b,c,n){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Enumerate xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration" /></Body></Envelope>',
83
+b,c,n)};m.ExecPull=function(a,b,c,n,d){m.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+m.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+m.NextMessageId++ +'</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo><w:OperationTimeout>PT60S</w:OperationTimeout></Header><Body><Pull xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration"><EnumerationContext>'+b+"</EnumerationContext></Pull></Body></Envelope>",
84
+c,n,d)};m.ParseWsman=function(a){try{if(!a.childNodes){var b=a;if(window.DOMParser)a=(new DOMParser).parseFromString(b,"text/xml");else{var c=new ActiveXObject("Microsoft.XMLDOM");c.async=!1;c.loadXML(b);a=c}}var b={Header:{}},n=a.getElementsByTagName("Header")[0],d;n||(n=a.getElementsByTagName("a:Header")[0]);if(!n)return null;for(c=0;c<n.childNodes.length;c++){var g=n.childNodes[c];b.Header[g.localName]=g.textContent}var e=a.getElementsByTagName("Body")[0];e||(e=a.getElementsByTagName("a:Body")[0]);
85
+if(!e)return null;0<e.childNodes.length&&(d=e.childNodes[0].localName,d.indexOf("_OUTPUT")==d.length-7&&(d=d.substring(0,d.length-7)),b.Header.Method=d,b.Body=h(e.childNodes[0]));return b}catch(m){return console.log("Unable to parse XML: "+a),null}};return m};
86
+function AmtStackCreateService(b){function c(){var a=k.GetPendingActions();v<a&&(v=a);null!=k.onProcessChanged&&B!=a&&(B=a,k.onProcessChanged(a,v));0==a&&(v=0)}function a(a,b,c,g,n,E,A){200!=n?(c(k,a,null,n,E),e(1)):null!=b&&"EnumerateResponse"==b.Header.Method&&b.Body.EnumerationContext?k.wsman.ExecPull(g,b.Body.EnumerationContext,function(b,g,n,e){d(a,n,c,g,[],e,E,A)}):(c(k,a,null,603,E),e(1))}function d(a,b,g,n,l,E,A,y){if(200!=E)g(k,a,null,E,A),e(1);else if(null==b||"PullResponse"!=b.Header.Method)g(k,
87
+a,null,604,A),e(1);else{for(var C in b.Body.Items)if(b.Body.Items[C]instanceof Array)for(var m in b.Body.Items[C])"function"!=typeof b.Body.Items[C][m]&&l.push(b.Body.Items[C][m]);else"function"!=typeof b.Body.Items[C]&&l.push(b.Body.Items[C]);b.Body.EnumerationContext?k.wsman.ExecPull(n,b.Body.EnumerationContext,function(b,c,n,e){d(a,n,g,c,l,e,A,1)}):(e(1),g(k,a,l,E,A),c())}}function e(a){k.ActiveEnumsCount-=a;k.ActiveEnumsCount>=k.MaxActiveEnumsCount||0==k.PendingEnums.length?c():(a=k.PendingEnums.shift(),
88
+k.Enum(a[0],a[1],a[2]),e(0))}function q(a,b,g,n,d,e,A){k.PendingBatchOperations-=2;var y=b.shift(),C=k.Enum;"*"==y[0]&&(C=k.Get,y=y.substring(1));C(y,function(d,y,C,l,m){m[2][y]={response:null==C?null:C.Body,responses:C,status:l};0==m[1].length||401==l||1!=e&&200!=l&&400!=l?(k.PendingBatchOperations-=2*b.length,c(),g(k,a,m[2],l,n)):(c(),q(a,b,g,n,m[2],A))},[a,b,d],A);c()}function h(a){a.names.length<=a.current?a.callback(k,a.name,a.responses,200,a.tag):(k.wsman.ExecGet(k.CompleteName(a.names[a.current]),
89
+function(b,c,g,n){null==g||200!=n?a.callback(k,a.name,null,n,a.tag):(a.responses[g.Header.Method]=g,h(a))},a.pri),a.current++);c()}function r(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](k,null,d[2]);else k.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,d)}function n(a,b,c,g,d){if(200!=g||"0"!=c.Body.ReturnValue)d[0](k,null,d[2]);else{var e,A,y;b=d[2];g=new Date;var C=c.Body.RecordArray;"string"===typeof C&&(c.Body.RecordArray=[c.Body.RecordArray]);for(e in C){a=null;try{a=window.atob(C[e])}catch(l){}if(null!=
90
+a&&(A=ReadIntX(a,0),0<A&&4294967295>A)){y={DeviceAddress:a.charCodeAt(4),EventSensorType:a.charCodeAt(5),EventType:a.charCodeAt(6),EventOffset:a.charCodeAt(7),EventSourceType:a.charCodeAt(8),EventSeverity:a.charCodeAt(9),SensorNumber:a.charCodeAt(10),Entity:a.charCodeAt(11),EntityInstance:a.charCodeAt(12),EventData:[],Time:new Date(1E3*(A+60*g.getTimezoneOffset()))};for(A=13;21>A;A++)y.EventData.push(a.charCodeAt(A));y.EntityStr=I[y.Entity];y.Desc=m(y.EventSensorType,y.EventOffset,y.EventData,y.Entity);
91
+y.EntityStr||(y.EntityStr="Unknown");b.push(y)}}if(1!=c.Body.NoMoreRecords)k.AMT_MessageLog_GetRecords(c.Body.IterationIdentifier,390,n,[d[0],b,d[2]]);else d[0](k,b,d[2])}}function m(a,b,c,n){if(15==a)return 235==c[0]?"Invalid Data":0==b?l[c[1]]:g[c[1]];if(18==a&&170==c[0])return"Agent watchdog "+char2hex(c[4])+char2hex(c[3])+char2hex(c[2])+char2hex(c[1])+"-"+char2hex(c[6])+char2hex(c[5])+"-... changed to "+k.WatchdogCurrentStates[c[7]];if(5==a&&0==b)return"Case intrusion";if(192==a&&0==b&&170==c[0]&&
92
48==c[1]){if(0==c[2])return"A remote Serial Over LAN session was established.";if(1==c[2])return"Remote Serial Over LAN session finished. User control was restored.";if(2==c[2])return"A remote IDE-Redirection session was established.";if(3==c[2])return"Remote IDE-Redirection session finished. User control was restored."}if(36==a)return a=(c[1]<<24)+(c[2]<<16)+(c[3]<<8)+c[4],b="#"+c[0],170==c[0]&&(b="wired"),4294967293==a?"All received packet filter was matched on "+b+" interface.":4294967292==a?"All outbound packet filter was matched on "+
93
b+" interface.":4294967290==a?"Spoofed packet filter was matched on "+b+" interface.":"Filter "+a+" was matched on "+b+" interface.";if(192==a)return 0==c[2]?"Security policy invoked. Some or all network traffic (TX) was stopped.":2==c[2]?"Security policy invoked. Some or all network traffic (RX) was stopped.":"Security policy invoked.";if(193==a){if(170==c[0]&&48==c[1]&&0==c[2]&&0==c[3])return"User request for remote connection.";if(170==c[0]&&32==c[1]&&3==c[2]&&1==c[3])return"EAC error: attempt to get posture while NAC in Intel\ufffd AMT is disabled.";
94
-if(170==c[0]&&32==c[1]&&4==c[2]&&0==c[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(c[1]+(c[2]<<8))+" times. The system may be under attack.":30==a?"No bootable media":32==a?"Operating system lockup or power interrupt":35==a?"System boot failure":37==a?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+a}function x(a,b,c,n,d){if(200!=n)d[0](m,[],n);else{var e,A,y=d[1],h=new Date,g;if(0<c.Body.RecordsReturned)for(A in c.Body.EventRecords=
95
-MakeToArray(c.Body.EventRecords),c.Body.EventRecords){a=null;try{a=window.atob(c.Body.EventRecords[A])}catch(v){console.log(v+" "+c.Body.EventRecords[A])}b={AuditAppID:ReadShort(a,0),EventID:ReadShort(a,2),InitiatorType:a.charCodeAt(4)};b.AuditApp=r[b.AuditAppID];b.Event=r[100*b.AuditAppID+b.EventID];b.Event||(b.Event="#"+b.EventID);0==b.InitiatorType&&(e=a.charCodeAt(5),b.Initiator=a.substring(6,6+e),e=6+e);1==b.InitiatorType&&(b.KerberosUserInDomain=ReadInt(a,5),e=a.charCodeAt(9),b.Initiator=GetSidString(a.substring(10,
96
-10+e)),e=10+e);2==b.InitiatorType&&(b.Initiator="<i>Local</i>",e=5);3==b.InitiatorType&&(b.Initiator="<i>KVM Default Port</i>",e=5);g=ReadInt(a,e);b.Time=new Date(1E3*(g+60*h.getTimezoneOffset()));e+=4;b.MCLocationType=a.charCodeAt(e++);g=a.charCodeAt(e++);b.NetAddress=a.substring(e,e+g);e+=g;g=a.charCodeAt(e++);b.Ex=a.substring(e,e+g);b.ExStr=m.GetAuditLogExtendedDataStr(100*b.AuditAppID+b.EventID,b.Ex);y.push(b)}if(c.Body.TotalRecordCount>y.length)m.AMT_AuditLog_ReadRecords(y.length+1,x,[d[0],y]);
97
-else d[0](m,y,n)}}var m={};m.wsman=b;m.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];m.PendingEnums=[];m.PendingBatchOperations=0;m.ActiveEnumsCount=0;m.MaxActiveEnumsCount=1;m.onProcessChanged=null;var w=0,h=0;m.GetPendingActions=function(){return 2*m.PendingEnums.length+m.ActiveEnumsCount+m.wsman.comm.PendingAjax.length+m.wsman.comm.ActiveAjaxCount+m.PendingBatchOperations};m.Subscribe=function(a,
98
-b,n,d,e,h,A,y,g,r){m.wsman.ExecSubscribe(m.CompleteName(a),b,n,function(b,n,B,A){c();d(m,a,B,A,e)},0,h,A,y,g,r);c()};m.UnSubscribe=function(a,b,n,d,e){m.wsman.ExecUnSubscribe(m.CompleteName(a),function(d,e,y,h){c();b(m,a,y,h,n)},0,d,e);c()};m.Get=function(a,b,n,d){m.wsman.ExecGet(m.CompleteName(a),function(d,e,A,y){c();b(m,a,A,y,n)},0,d);c()};m.Put=function(a,b,n,d,e,h){m.wsman.ExecPut(m.CompleteName(a),b,function(b,e,h,g){c();n(m,a,h,g,d)},0,e,h);c()};m.Create=function(a,b,n,d,e){m.wsman.ExecCreate(m.CompleteName(a),
99
-b,function(b,e,y,h){c();n(m,a,y,h,d)},0,e);c()};m.Delete=function(a,b,n,d,e){m.wsman.ExecDelete(m.CompleteName(a),b,function(b,e,y,h){c();n(m,a,y,h,d)},0,e);c()};m.Exec=function(a,b,n,d,e,h,A){m.wsman.ExecMethod(m.CompleteName(a),b,n,function(b,n,B,A){c();d(m,a,m.CompleteExecResponse(B),A,e)},0,h,A);c()};m.ExecWithXml=function(a,b,n,d,e,h,A){m.wsman.ExecMethodXml(m.CompleteName(a),b,execArgumentsToXml(n),function(b,n,B,A){c();d(m,a,m.CompleteExecResponse(B),A,e)},0,h,A);c()};m.Enum=function(b,n,d,
100
-e){m.ActiveEnumsCount<m.MaxActiveEnumsCount?(m.ActiveEnumsCount++,m.wsman.ExecEnum(m.CompleteName(b),function(d,e,B,y,h){c();a(b,B,n,e,y,h)},d,e)):m.PendingEnums.push([b,n,d,e]);c()};m.BatchEnum=function(a,b,n,d,e,h){m.PendingBatchOperations+=2*b.length;k(a,Clone(b),n,d,{},e,h);c()};m.BatchGet=function(a,b,n,d,e){l({name:a,names:b,callback:n,current:0,responses:{},tag:d,pri:e});c()};m.CompleteName=function(a){if(0==a.indexOf("AMT_"))return m.pfx[0]+a;if(0==a.indexOf("CIM_"))return m.pfx[1]+a;if(0==
101
-a.indexOf("IPS_"))return m.pfx[2]+a};m.CompleteExecResponse=function(a){a&&null!=a&&a.Body&&void 0!=a.Body.ReturnValue&&(a.Body.ReturnValueStr=m.AmtStatusToStr(a.Body.ReturnValue));return a};m.RequestPowerStateChange=function(a,b){m.CIM_PowerManagementService_RequestPowerStateChange(a,'<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="CreationClassName">CIM_ComputerSystem</Selector><Selector Name="Name">ManagedSystem</Selector></SelectorSet></ReferenceParameters>',
102
-null,null,b)};m.SetBootConfigRole=function(a,b){m.CIM_BootService_SetBootConfigRole('<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>',
103
-a,b)};m.CancelAllQueries=function(a){m.wsman.CancelAllQueries(a)};m.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){m.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};m.AMT_AgentPresenceWatchdog_AssertPresence=function(a,b){m.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},b)};m.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,b){m.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},b)};m.AMT_AgentPresenceWatchdog_AddAction=function(a,b,c,n,d,e,
104
-A,y,h){m.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:n,ActionEac:d},e,A,y,h)};m.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,b,c,n){m.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,b,c,n)};m.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){m.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};m.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){m.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};m.AMT_AgentPresenceWatchdogVA_AssertPresence=
105
-function(a,b){m.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},b)};m.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,b){m.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},b)};m.AMT_AgentPresenceWatchdogVA_AddAction=function(a,b,c,n,d,e){m.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:n,ActionEac:d},e)};m.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,b){m.Exec("AMT_AgentPresenceWatchdogVA",
106
-"DeleteAllActions",{_method_dummy:a},b)};m.AMT_AuditLog_ClearLog=function(a){m.Exec("AMT_AuditLog","ClearLog",{},a)};m.AMT_AuditLog_RequestStateChange=function(a,b,c){m.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.AMT_AuditLog_ReadRecords=function(a,b,c){m.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},b,c)};m.AMT_AuditLog_SetAuditLock=function(a,b,c,n){m.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:b,Handle:c},n)};m.AMT_AuditLog_ExportAuditLogSignature=
107
-function(a,b){m.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},b)};m.AMT_AuditLog_SetSigningKeyMaterial=function(a,b,c,n,d){m.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:b,LengthOfCertificates:c,Certificates:n},d)};m.AMT_AuditPolicyRule_SetAuditPolicy=function(a,b,c,n,d){m.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:n},d)};m.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,b,c,n,d){m.Exec("AMT_AuditPolicyRule",
108
-"SetAuditPolicyBulk",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:n},d)};m.AMT_AuthorizationService_AddUserAclEntryEx=function(a,b,c,n,d,e){m.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:b,KerberosUserSid:c,AccessPermission:n,Realms:d},e)};m.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,b){m.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},b)};m.AMT_AuthorizationService_GetUserAclEntryEx=function(a,b,c){m.Exec("AMT_AuthorizationService",
109
-"GetUserAclEntryEx",{Handle:a},b,c)};m.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,b,c,n,d,e,A){m.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:b,DigestPassword:c,KerberosUserSid:n,AccessPermission:d,Realms:e},A)};m.AMT_AuthorizationService_RemoveUserAclEntry=function(a,b){m.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},b)};m.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,b,c){m.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",
110
-{Username:a,DigestPassword:b},c)};m.AMT_AuthorizationService_GetAdminAclEntry=function(a){m.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};m.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){m.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};m.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){m.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};m.AMT_AuthorizationService_SetAclEnabledState=function(a,b,c,n){m.Exec("AMT_AuthorizationService",
111
-"SetAclEnabledState",{Handle:a,Enabled:b},c,n)};m.AMT_AuthorizationService_GetAclEnabledState=function(a,b,c){m.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},b,c)};m.AMT_EndpointAccessControlService_RequestStateChange=function(a,b,c){m.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.AMT_EndpointAccessControlService_GetPosture=function(a,b){m.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},b)};m.AMT_EndpointAccessControlService_GetPostureHash=
112
-function(a,b){m.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:a},b)};m.AMT_EndpointAccessControlService_UpdatePostureState=function(a,b){m.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:a},b)};m.AMT_EndpointAccessControlService_GetEacOptions=function(a){m.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},a)};m.AMT_EndpointAccessControlService_SetEacOptions=function(a,b,c){m.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:a,
113
-PostureHashAlgorithm:b},c)};m.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(a,b){m.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:a},b)};m.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(a,b){m.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:a},b)};m.AMT_EthernetPortSettings_SetLinkPreference=function(a,b,c){m.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:a,Timeout:b},c)};m.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=
114
-function(a,b){m.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:a},b)};m.AMT_KerberosSettingData_GetCredentialCacheState=function(a){m.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},a)};m.AMT_KerberosSettingData_SetCredentialCacheState=function(a,b){m.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:a},b)};m.AMT_MessageLog_CancelIteration=function(a,b){m.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:a},b)};m.AMT_MessageLog_RequestStateChange=
115
-function(a,b,c){m.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.AMT_MessageLog_ClearLog=function(a){m.Exec("AMT_MessageLog","ClearLog",{},a)};m.AMT_MessageLog_GetRecords=function(a,b,c,n){m.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:b},c,n)};m.AMT_MessageLog_GetRecord=function(a,b,c){m.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:b},c)};m.AMT_MessageLog_PositionAtRecord=function(a,b,c,n){m.Exec("AMT_MessageLog",
116
-"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:b,RecordNumber:c},n)};m.AMT_MessageLog_PositionToFirstRecord=function(a,b){m.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,b)};m.AMT_MessageLog_FreezeLog=function(a,b){m.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},b)};m.AMT_PublicKeyManagementService_AddCRL=function(a,b,c){m.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:b},c)};m.AMT_PublicKeyManagementService_ResetCRLList=function(a,b){m.Exec("AMT_PublicKeyManagementService",
117
-"ResetCRLList",{_method_dummy:a},b)};m.AMT_PublicKeyManagementService_AddCertificate=function(a,b){m.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:a},b)};m.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(a,b){m.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:a},b)};m.AMT_PublicKeyManagementService_AddKey=function(a,b){m.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:a},b)};m.AMT_PublicKeyManagementService_GeneratePKCS10Request=
118
-function(a,b,c,n){m.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:b,Usage:c},n)};m.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,b,c,n){m.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:b,NullSignedCertificateRequest:c},n)};m.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,b,c){m.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:b},c)};m.AMT_RedirectionService_RequestStateChange=
119
-function(a,b){m.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},b)};m.AMT_RedirectionService_TerminateSession=function(a,b){m.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},b)};m.AMT_RemoteAccessService_AddMpServer=function(a,b,c,n,d,e,A,y,h){m.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:b,Port:c,AuthMethod:n,Certificate:d,Username:e,Password:A,CN:y},h)};m.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,b,c,n,d,e){m.Exec("AMT_RemoteAccessService",
120
-"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:b,ExtendedData:c,MpServer:n,InternalMpServer:d},e)};m.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,b){m.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},b)};m.AMT_SetupAndConfigurationService_CommitChanges=function(a,b){m.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},b)};m.AMT_SetupAndConfigurationService_Unprovision=function(a,b){m.Exec("AMT_SetupAndConfigurationService",
121
-"Unprovision",{ProvisioningMode:a},b)};m.AMT_SetupAndConfigurationService_PartialUnprovision=function(a,b){m.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:a},b)};m.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(a,b){m.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:a},b)};m.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,b){m.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",
122
-{Duration:a},b)};m.AMT_SetupAndConfigurationService_SetMEBxPassword=function(a,b){m.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:a},b)};m.AMT_SetupAndConfigurationService_SetTLSPSK=function(a,b,c){m.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:a,PPS:b},c)};m.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(a){m.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},a)};m.AMT_SetupAndConfigurationService_GetUuid=function(a){m.Exec("AMT_SetupAndConfigurationService",
123
-"GetUuid",{},a)};m.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){m.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};m.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){m.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};m.AMT_SystemDefensePolicy_GetTimeout=function(a){m.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};m.AMT_SystemDefensePolicy_SetTimeout=function(a,b){m.Exec("AMT_SystemDefensePolicy",
124
-"SetTimeout",{Timeout:a},b)};m.AMT_SystemDefensePolicy_UpdateStatistics=function(a,b,c,n,d,e){m.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:b},c,n,d,e)};m.AMT_SystemPowerScheme_SetPowerScheme=function(a,b,c){m.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,c,0,{InstanceID:b})};m.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,b){m.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,b)};m.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=
125
-function(a,b,c,n,d){m.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:b,Tm2:c},n,d)};m.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,b,c){m.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.AMT_WebUIService_RequestStateChange=function(a,b,c){m.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,n,d,e){m.ExecWithXml("AMT_WiFiPortConfigurationService",
126
-"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:n,CACredential:d},e)};m.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,b,c,n,d,e){m.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:n,CACredential:d},e)};m.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){m.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",
127
-{_method_dummy:a},b)};m.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){m.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},b)};m.CIM_Account_RequestStateChange=function(a,b,c){m.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_AccountManagementService_CreateAccount=function(a,b,c){m.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};m.CIM_BootConfigSetting_ChangeBootOrder=function(a,
128
-b){m.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};m.CIM_BootService_SetBootConfigRole=function(a,b,c){m.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:b},c,0,1)};m.CIM_Card_ConnectorPower=function(a,b,c){m.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};m.CIM_Card_IsCompatible=function(a,b){m.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};m.CIM_Chassis_IsCompatible=function(a,b){m.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)};
129
-m.CIM_Fan_SetSpeed=function(a,b){m.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},b)};m.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){m.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},c)};m.CIM_MediaAccessDevice_LockMedia=function(a,b){m.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};m.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){m.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_MediaAccessDevice_Reset=function(a){m.Exec("CIM_MediaAccessDevice",
130
-"Reset",{},a)};m.CIM_MediaAccessDevice_EnableDevice=function(a,b){m.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};m.CIM_MediaAccessDevice_OnlineDevice=function(a,b){m.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};m.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){m.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};m.CIM_MediaAccessDevice_SaveProperties=function(a){m.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};m.CIM_MediaAccessDevice_RestoreProperties=
131
-function(a){m.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};m.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){m.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_PhysicalFrame_IsCompatible=function(a,b){m.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};m.CIM_PhysicalPackage_IsCompatible=function(a,b){m.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};m.CIM_PowerManagementService_RequestPowerStateChange=
132
-function(a,b,c,n,d){m.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:n},d,0,1)};m.CIM_PowerSupply_SetPowerState=function(a,b,c){m.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_PowerSupply_Reset=function(a){m.Exec("CIM_PowerSupply","Reset",{},a)};m.CIM_PowerSupply_EnableDevice=function(a,b){m.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};m.CIM_PowerSupply_OnlineDevice=function(a,b){m.Exec("CIM_PowerSupply",
133
-"OnlineDevice",{Online:a},b)};m.CIM_PowerSupply_QuiesceDevice=function(a,b){m.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},b)};m.CIM_PowerSupply_SaveProperties=function(a){m.Exec("CIM_PowerSupply","SaveProperties",{},a)};m.CIM_PowerSupply_RestoreProperties=function(a){m.Exec("CIM_PowerSupply","RestoreProperties",{},a)};m.CIM_PowerSupply_RequestStateChange=function(a,b,c){m.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_Processor_SetPowerState=function(a,
134
-b,c){m.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_Processor_Reset=function(a){m.Exec("CIM_Processor","Reset",{},a)};m.CIM_Processor_EnableDevice=function(a,b){m.Exec("CIM_Processor","EnableDevice",{Enabled:a},b)};m.CIM_Processor_OnlineDevice=function(a,b){m.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};m.CIM_Processor_QuiesceDevice=function(a,b){m.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};m.CIM_Processor_SaveProperties=function(a){m.Exec("CIM_Processor","SaveProperties",
135
-{},a)};m.CIM_Processor_RestoreProperties=function(a){m.Exec("CIM_Processor","RestoreProperties",{},a)};m.CIM_Processor_RequestStateChange=function(a,b,c){m.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_RecordLog_ClearLog=function(a){m.Exec("CIM_RecordLog","ClearLog",{},a)};m.CIM_RecordLog_RequestStateChange=function(a,b,c){m.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_RedirectionService_RequestStateChange=function(a,
136
-b,c){m.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_Sensor_SetPowerState=function(a,b,c){m.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_Sensor_Reset=function(a){m.Exec("CIM_Sensor","Reset",{},a)};m.CIM_Sensor_EnableDevice=function(a,b){m.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};m.CIM_Sensor_OnlineDevice=function(a,b){m.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};m.CIM_Sensor_QuiesceDevice=function(a,b){m.Exec("CIM_Sensor",
137
-"QuiesceDevice",{Quiesce:a},b)};m.CIM_Sensor_SaveProperties=function(a){m.Exec("CIM_Sensor","SaveProperties",{},a)};m.CIM_Sensor_RestoreProperties=function(a){m.Exec("CIM_Sensor","RestoreProperties",{},a)};m.CIM_Sensor_RequestStateChange=function(a,b,c){m.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_StatisticalData_ResetSelectedStats=function(a,b){m.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};m.CIM_Watchdog_KeepAlive=function(a){m.Exec("CIM_Watchdog",
138
-"KeepAlive",{},a)};m.CIM_Watchdog_SetPowerState=function(a,b,c){m.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_Watchdog_Reset=function(a){m.Exec("CIM_Watchdog","Reset",{},a)};m.CIM_Watchdog_EnableDevice=function(a,b){m.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};m.CIM_Watchdog_OnlineDevice=function(a,b){m.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};m.CIM_Watchdog_QuiesceDevice=function(a,b){m.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};m.CIM_Watchdog_SaveProperties=
139
-function(a){m.Exec("CIM_Watchdog","SaveProperties",{},a)};m.CIM_Watchdog_RestoreProperties=function(a){m.Exec("CIM_Watchdog","RestoreProperties",{},a)};m.CIM_Watchdog_RequestStateChange=function(a,b,c){m.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.CIM_WiFiPort_SetPowerState=function(a,b,c){m.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};m.CIM_WiFiPort_Reset=function(a){m.Exec("CIM_WiFiPort","Reset",{},a)};m.CIM_WiFiPort_EnableDevice=function(a,
140
-b){m.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};m.CIM_WiFiPort_OnlineDevice=function(a,b){m.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},b)};m.CIM_WiFiPort_QuiesceDevice=function(a,b){m.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};m.CIM_WiFiPort_SaveProperties=function(a){m.Exec("CIM_WiFiPort","SaveProperties",{},a)};m.CIM_WiFiPort_RestoreProperties=function(a){m.Exec("CIM_WiFiPort","RestoreProperties",{},a)};m.CIM_WiFiPort_RequestStateChange=function(a,b,c){m.Exec("CIM_WiFiPort",
141
-"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.IPS_HostBasedSetupService_Setup=function(a,b,c,n,d,e,A){m.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,Certificate:n,SigningAlgorithm:d,DigitalSignature:e},A)};m.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,n){m.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},n)};m.IPS_HostBasedSetupService_AdminSetup=
142
-function(a,b,c,n,d,e){m.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:n,DigitalSignature:d},e)};m.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,b,c,n){m.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},n)};m.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){m.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},
143
-b)};m.IPS_KVMRedirectionSettingData_TerminateSession=function(a){m.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};m.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){m.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};m.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){m.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};m.IPS_OptInService_StartOptIn=function(a){m.Exec("IPS_OptInService","StartOptIn",{},a)};m.IPS_OptInService_CancelOptIn=
144
-function(a){m.Exec("IPS_OptInService","CancelOptIn",{},a)};m.IPS_OptInService_SendOptInCode=function(a,b){m.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)};m.IPS_OptInService_StartService=function(a){m.Exec("IPS_OptInService","StartService",{},a)};m.IPS_OptInService_StopService=function(a){m.Exec("IPS_OptInService","StopService",{},a)};m.IPS_OptInService_RequestStateChange=function(a,b,c){m.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.IPS_ProvisioningRecordLog_RequestStateChange=
145
-function(a,b,c){m.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};m.IPS_ProvisioningRecordLog_ClearLog=function(a,b){m.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};m.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){m.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};m.IPS_SecIOService_RequestStateChange=function(a,b,c){m.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a,
146
-TimeoutPeriod:b},c)};m.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,n,d){m.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:n},d)};m.AmtStatusToStr=function(a){return m.AmtStatusCodes[a]?m.AmtStatusCodes[a]:"UNKNOWN_ERROR"};m.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",
94
+if(170==c[0]&&32==c[1]&&4==c[2]&&0==c[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(c[1]+(c[2]<<8))+" times. The system may be under attack.":30==a?"No bootable media":32==a?"Operating system lockup or power interrupt":35==a?"System boot failure":37==a?"System firmware started (at least one CPU is properly executing).":"Unknown Sensor Type #"+a}function w(a,b,c,g,n){if(200!=g)n[0](k,[],g);else{var d,e,y=n[1],C=new Date,l;if(0<c.Body.RecordsReturned)for(e in c.Body.EventRecords=
95
+MakeToArray(c.Body.EventRecords),c.Body.EventRecords){a=null;try{a=window.atob(c.Body.EventRecords[e])}catch(m){console.log(m+" "+c.Body.EventRecords[e])}b={AuditAppID:ReadShort(a,0),EventID:ReadShort(a,2),InitiatorType:a.charCodeAt(4)};b.AuditApp=u[b.AuditAppID];b.Event=u[100*b.AuditAppID+b.EventID];b.Event||(b.Event="#"+b.EventID);0==b.InitiatorType&&(d=a.charCodeAt(5),b.Initiator=a.substring(6,6+d),d=6+d);1==b.InitiatorType&&(b.KerberosUserInDomain=ReadInt(a,5),d=a.charCodeAt(9),b.Initiator=GetSidString(a.substring(10,
96
+10+d)),d=10+d);2==b.InitiatorType&&(b.Initiator="<i>Local</i>",d=5);3==b.InitiatorType&&(b.Initiator="<i>KVM Default Port</i>",d=5);l=ReadInt(a,d);b.Time=new Date(1E3*(l+60*C.getTimezoneOffset()));d+=4;b.MCLocationType=a.charCodeAt(d++);l=a.charCodeAt(d++);b.NetAddress=a.substring(d,d+l);d+=l;l=a.charCodeAt(d++);b.Ex=a.substring(d,d+l);b.ExStr=k.GetAuditLogExtendedDataStr(100*b.AuditAppID+b.EventID,b.Ex);y.push(b)}if(c.Body.TotalRecordCount>y.length)k.AMT_AuditLog_ReadRecords(y.length+1,w,[n[0],y]);
97
+else n[0](k,y,g)}}var k={};k.wsman=b;k.pfx=["http://intel.com/wbem/wscim/1/amt-schema/1/","http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/","http://intel.com/wbem/wscim/1/ips-schema/1/"];k.PendingEnums=[];k.PendingBatchOperations=0;k.ActiveEnumsCount=0;k.MaxActiveEnumsCount=1;k.onProcessChanged=null;var v=0,B=0;k.GetPendingActions=function(){return 2*k.PendingEnums.length+k.ActiveEnumsCount+k.wsman.comm.PendingAjax.length+k.wsman.comm.ActiveAjaxCount+k.PendingBatchOperations};k.Subscribe=function(a,
98
+b,g,n,d,e,A,y,C,l){k.wsman.ExecSubscribe(k.CompleteName(a),b,g,function(b,g,x,e){c();n(k,a,x,e,d)},0,e,A,y,C,l);c()};k.UnSubscribe=function(a,b,g,n,d){k.wsman.ExecUnSubscribe(k.CompleteName(a),function(n,d,e,C){c();b(k,a,e,C,g)},0,n,d);c()};k.Get=function(a,b,g,n){k.wsman.ExecGet(k.CompleteName(a),function(n,d,e,y){c();b(k,a,e,y,g)},0,n);c()};k.Put=function(a,b,g,n,d,e){k.wsman.ExecPut(k.CompleteName(a),b,function(b,d,e,l){c();g(k,a,e,l,n)},0,d,e);c()};k.Create=function(a,b,g,n,d){k.wsman.ExecCreate(k.CompleteName(a),
99
+b,function(b,d,e,C){c();g(k,a,e,C,n)},0,d);c()};k.Delete=function(a,b,g,n,d){k.wsman.ExecDelete(k.CompleteName(a),b,function(b,d,e,C){c();g(k,a,e,C,n)},0,d);c()};k.Exec=function(a,b,g,n,d,e,A){k.wsman.ExecMethod(k.CompleteName(a),b,g,function(b,g,x,e){c();n(k,a,k.CompleteExecResponse(x),e,d)},0,e,A);c()};k.ExecWithXml=function(a,b,g,n,d,e,A){k.wsman.ExecMethodXml(k.CompleteName(a),b,execArgumentsToXml(g),function(b,g,x,e){c();n(k,a,k.CompleteExecResponse(x),e,d)},0,e,A);c()};k.Enum=function(b,g,n,
100
+d){k.ActiveEnumsCount<k.MaxActiveEnumsCount?(k.ActiveEnumsCount++,k.wsman.ExecEnum(k.CompleteName(b),function(n,d,x,e,C){c();a(b,x,g,d,e,C)},n,d)):k.PendingEnums.push([b,g,n,d]);c()};k.BatchEnum=function(a,b,g,n,d,e){k.PendingBatchOperations+=2*b.length;q(a,Clone(b),g,n,{},d,e);c()};k.BatchGet=function(a,b,g,n,d){h({name:a,names:b,callback:g,current:0,responses:{},tag:n,pri:d});c()};k.CompleteName=function(a){if(0==a.indexOf("AMT_"))return k.pfx[0]+a;if(0==a.indexOf("CIM_"))return k.pfx[1]+a;if(0==
101
+a.indexOf("IPS_"))return k.pfx[2]+a};k.CompleteExecResponse=function(a){a&&null!=a&&a.Body&&void 0!=a.Body.ReturnValue&&(a.Body.ReturnValueStr=k.AmtStatusToStr(a.Body.ReturnValue));return a};k.RequestPowerStateChange=function(a,b){k.CIM_PowerManagementService_RequestPowerStateChange(a,'<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="CreationClassName">CIM_ComputerSystem</Selector><Selector Name="Name">ManagedSystem</Selector></SelectorSet></ReferenceParameters>',
102
+null,null,b)};k.SetBootConfigRole=function(a,b){k.CIM_BootService_SetBootConfigRole('<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>',
103
+a,b)};k.CancelAllQueries=function(a){k.wsman.CancelAllQueries(a)};k.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){k.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};k.AMT_AgentPresenceWatchdog_AssertPresence=function(a,b){k.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,b){k.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdog_AddAction=function(a,b,c,g,n,d,
104
+e,y,C){k.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d,e,y,C)};k.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,b,c,g){k.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,b,c,g)};k.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){k.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};k.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){k.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};k.AMT_AgentPresenceWatchdogVA_AssertPresence=
105
+function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},b)};k.AMT_AgentPresenceWatchdogVA_AddAction=function(a,b,c,g,n,d){k.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:b,EventOnTransition:c,ActionSd:g,ActionEac:n},d)};k.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,b){k.Exec("AMT_AgentPresenceWatchdogVA",
106
+"DeleteAllActions",{_method_dummy:a},b)};k.AMT_AuditLog_ClearLog=function(a){k.Exec("AMT_AuditLog","ClearLog",{},a)};k.AMT_AuditLog_RequestStateChange=function(a,b,c){k.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_AuditLog_ReadRecords=function(a,b,c){k.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},b,c)};k.AMT_AuditLog_SetAuditLock=function(a,b,c,g){k.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:b,Handle:c},g)};k.AMT_AuditLog_ExportAuditLogSignature=
107
+function(a,b){k.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},b)};k.AMT_AuditLog_SetSigningKeyMaterial=function(a,b,c,g,n){k.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:b,LengthOfCertificates:c,Certificates:g},n)};k.AMT_AuditPolicyRule_SetAuditPolicy=function(a,b,c,g,n){k.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};k.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,b,c,g,n){k.Exec("AMT_AuditPolicyRule",
108
+"SetAuditPolicyBulk",{Enable:a,AuditedAppID:b,EventID:c,PolicyType:g},n)};k.AMT_AuthorizationService_AddUserAclEntryEx=function(a,b,c,g,n,d){k.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:b,KerberosUserSid:c,AccessPermission:g,Realms:n},d)};k.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,b){k.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},b)};k.AMT_AuthorizationService_GetUserAclEntryEx=function(a,b,c){k.Exec("AMT_AuthorizationService",
109
+"GetUserAclEntryEx",{Handle:a},b,c)};k.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,b,c,g,n,d,e){k.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:b,DigestPassword:c,KerberosUserSid:g,AccessPermission:n,Realms:d},e)};k.AMT_AuthorizationService_RemoveUserAclEntry=function(a,b){k.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},b)};k.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,b,c){k.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",
110
+{Username:a,DigestPassword:b},c)};k.AMT_AuthorizationService_GetAdminAclEntry=function(a){k.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};k.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){k.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};k.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){k.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};k.AMT_AuthorizationService_SetAclEnabledState=function(a,b,c,g){k.Exec("AMT_AuthorizationService",
111
+"SetAclEnabledState",{Handle:a,Enabled:b},c,g)};k.AMT_AuthorizationService_GetAclEnabledState=function(a,b,c){k.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},b,c)};k.AMT_EndpointAccessControlService_RequestStateChange=function(a,b,c){k.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_EndpointAccessControlService_GetPosture=function(a,b){k.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},b)};k.AMT_EndpointAccessControlService_GetPostureHash=
112
+function(a,b){k.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:a},b)};k.AMT_EndpointAccessControlService_UpdatePostureState=function(a,b){k.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:a},b)};k.AMT_EndpointAccessControlService_GetEacOptions=function(a){k.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},a)};k.AMT_EndpointAccessControlService_SetEacOptions=function(a,b,c){k.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:a,
113
+PostureHashAlgorithm:b},c)};k.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(a,b){k.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:a},b)};k.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(a,b){k.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:a},b)};k.AMT_EthernetPortSettings_SetLinkPreference=function(a,b,c){k.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:a,Timeout:b},c)};k.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=
114
+function(a,b){k.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:a},b)};k.AMT_KerberosSettingData_GetCredentialCacheState=function(a){k.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},a)};k.AMT_KerberosSettingData_SetCredentialCacheState=function(a,b){k.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:a},b)};k.AMT_MessageLog_CancelIteration=function(a,b){k.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:a},b)};k.AMT_MessageLog_RequestStateChange=
115
+function(a,b,c){k.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_MessageLog_ClearLog=function(a){k.Exec("AMT_MessageLog","ClearLog",{},a)};k.AMT_MessageLog_GetRecords=function(a,b,c,g){k.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:b},c,g)};k.AMT_MessageLog_GetRecord=function(a,b,c){k.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:b},c)};k.AMT_MessageLog_PositionAtRecord=function(a,b,c,g){k.Exec("AMT_MessageLog",
116
+"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:b,RecordNumber:c},g)};k.AMT_MessageLog_PositionToFirstRecord=function(a,b){k.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,b)};k.AMT_MessageLog_FreezeLog=function(a,b){k.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},b)};k.AMT_PublicKeyManagementService_AddCRL=function(a,b,c){k.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:b},c)};k.AMT_PublicKeyManagementService_ResetCRLList=function(a,b){k.Exec("AMT_PublicKeyManagementService",
117
+"ResetCRLList",{_method_dummy:a},b)};k.AMT_PublicKeyManagementService_AddCertificate=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:a},b)};k.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:a},b)};k.AMT_PublicKeyManagementService_AddKey=function(a,b){k.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:a},b)};k.AMT_PublicKeyManagementService_GeneratePKCS10Request=
118
+function(a,b,c,g){k.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:b,Usage:c},g)};k.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,b,c,g){k.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:b,NullSignedCertificateRequest:c},g)};k.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,b,c){k.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:b},c)};k.AMT_RedirectionService_RequestStateChange=
119
+function(a,b){k.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},b)};k.AMT_RedirectionService_TerminateSession=function(a,b){k.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},b)};k.AMT_RemoteAccessService_AddMpServer=function(a,b,c,g,n,d,e,y,C){k.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:b,Port:c,AuthMethod:g,Certificate:n,Username:d,Password:e,CN:y},C)};k.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,b,c,g,n,d){k.Exec("AMT_RemoteAccessService",
120
+"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:b,ExtendedData:c,MpServer:g,InternalMpServer:n},d)};k.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,b){k.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_CommitChanges=function(a,b){k.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_Unprovision=function(a,b){k.Exec("AMT_SetupAndConfigurationService",
121
+"Unprovision",{ProvisioningMode:a},b)};k.AMT_SetupAndConfigurationService_PartialUnprovision=function(a,b){k.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(a,b){k.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:a},b)};k.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,b){k.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",
122
+{Duration:a},b)};k.AMT_SetupAndConfigurationService_SetMEBxPassword=function(a,b){k.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:a},b)};k.AMT_SetupAndConfigurationService_SetTLSPSK=function(a,b,c){k.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:a,PPS:b},c)};k.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(a){k.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},a)};k.AMT_SetupAndConfigurationService_GetUuid=function(a){k.Exec("AMT_SetupAndConfigurationService",
123
+"GetUuid",{},a)};k.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){k.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};k.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){k.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};k.AMT_SystemDefensePolicy_GetTimeout=function(a){k.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};k.AMT_SystemDefensePolicy_SetTimeout=function(a,b){k.Exec("AMT_SystemDefensePolicy",
124
+"SetTimeout",{Timeout:a},b)};k.AMT_SystemDefensePolicy_UpdateStatistics=function(a,b,c,g,n,d){k.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:b},c,g,n,d)};k.AMT_SystemPowerScheme_SetPowerScheme=function(a,b,c){k.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,c,0,{InstanceID:b})};k.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,b){k.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,b)};k.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=
125
+function(a,b,c,g,n){k.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:b,Tm2:c},g,n)};k.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,b,c){k.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_WebUIService_RequestStateChange=function(a,b,c){k.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,b,c,g,n,d){k.ExecWithXml("AMT_WiFiPortConfigurationService",
126
+"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};k.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,b,c,g,n,d){k.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:b,IEEE8021xSettingsInput:c,ClientCredential:g,CACredential:n},d)};k.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,b){k.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",
127
+{_method_dummy:a},b)};k.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,b){k.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},b)};k.CIM_Account_RequestStateChange=function(a,b,c){k.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_AccountManagementService_CreateAccount=function(a,b,c){k.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:b},c)};k.CIM_BootConfigSetting_ChangeBootOrder=function(a,
128
+b){k.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},b)};k.CIM_BootService_SetBootConfigRole=function(a,b,c){k.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:b},c,0,1)};k.CIM_Card_ConnectorPower=function(a,b,c){k.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:b},c)};k.CIM_Card_IsCompatible=function(a,b){k.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},b)};k.CIM_Chassis_IsCompatible=function(a,b){k.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},b)};
129
+k.CIM_Fan_SetSpeed=function(a,b){k.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},b)};k.CIM_KVMRedirectionSAP_RequestStateChange=function(a,b,c){k.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},c)};k.CIM_MediaAccessDevice_LockMedia=function(a,b){k.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},b)};k.CIM_MediaAccessDevice_SetPowerState=function(a,b,c){k.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_MediaAccessDevice_Reset=function(a){k.Exec("CIM_MediaAccessDevice",
130
+"Reset",{},a)};k.CIM_MediaAccessDevice_EnableDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},b)};k.CIM_MediaAccessDevice_OnlineDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},b)};k.CIM_MediaAccessDevice_QuiesceDevice=function(a,b){k.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},b)};k.CIM_MediaAccessDevice_SaveProperties=function(a){k.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};k.CIM_MediaAccessDevice_RestoreProperties=
131
+function(a){k.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};k.CIM_MediaAccessDevice_RequestStateChange=function(a,b,c){k.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_PhysicalFrame_IsCompatible=function(a,b){k.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},b)};k.CIM_PhysicalPackage_IsCompatible=function(a,b){k.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},b)};k.CIM_PowerManagementService_RequestPowerStateChange=
132
+function(a,b,c,g,n){k.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:b,Time:c,TimeoutPeriod:g},n,0,1)};k.CIM_PowerSupply_SetPowerState=function(a,b,c){k.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_PowerSupply_Reset=function(a){k.Exec("CIM_PowerSupply","Reset",{},a)};k.CIM_PowerSupply_EnableDevice=function(a,b){k.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},b)};k.CIM_PowerSupply_OnlineDevice=function(a,b){k.Exec("CIM_PowerSupply",
133
+"OnlineDevice",{Online:a},b)};k.CIM_PowerSupply_QuiesceDevice=function(a,b){k.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},b)};k.CIM_PowerSupply_SaveProperties=function(a){k.Exec("CIM_PowerSupply","SaveProperties",{},a)};k.CIM_PowerSupply_RestoreProperties=function(a){k.Exec("CIM_PowerSupply","RestoreProperties",{},a)};k.CIM_PowerSupply_RequestStateChange=function(a,b,c){k.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_Processor_SetPowerState=function(a,
134
+b,c){k.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Processor_Reset=function(a){k.Exec("CIM_Processor","Reset",{},a)};k.CIM_Processor_EnableDevice=function(a,b){k.Exec("CIM_Processor","EnableDevice",{Enabled:a},b)};k.CIM_Processor_OnlineDevice=function(a,b){k.Exec("CIM_Processor","OnlineDevice",{Online:a},b)};k.CIM_Processor_QuiesceDevice=function(a,b){k.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},b)};k.CIM_Processor_SaveProperties=function(a){k.Exec("CIM_Processor","SaveProperties",
135
+{},a)};k.CIM_Processor_RestoreProperties=function(a){k.Exec("CIM_Processor","RestoreProperties",{},a)};k.CIM_Processor_RequestStateChange=function(a,b,c){k.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_RecordLog_ClearLog=function(a){k.Exec("CIM_RecordLog","ClearLog",{},a)};k.CIM_RecordLog_RequestStateChange=function(a,b,c){k.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_RedirectionService_RequestStateChange=function(a,
136
+b,c){k.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_Sensor_SetPowerState=function(a,b,c){k.Exec("CIM_Sensor","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Sensor_Reset=function(a){k.Exec("CIM_Sensor","Reset",{},a)};k.CIM_Sensor_EnableDevice=function(a,b){k.Exec("CIM_Sensor","EnableDevice",{Enabled:a},b)};k.CIM_Sensor_OnlineDevice=function(a,b){k.Exec("CIM_Sensor","OnlineDevice",{Online:a},b)};k.CIM_Sensor_QuiesceDevice=function(a,b){k.Exec("CIM_Sensor",
137
+"QuiesceDevice",{Quiesce:a},b)};k.CIM_Sensor_SaveProperties=function(a){k.Exec("CIM_Sensor","SaveProperties",{},a)};k.CIM_Sensor_RestoreProperties=function(a){k.Exec("CIM_Sensor","RestoreProperties",{},a)};k.CIM_Sensor_RequestStateChange=function(a,b,c){k.Exec("CIM_Sensor","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_StatisticalData_ResetSelectedStats=function(a,b){k.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:a},b)};k.CIM_Watchdog_KeepAlive=function(a){k.Exec("CIM_Watchdog",
138
+"KeepAlive",{},a)};k.CIM_Watchdog_SetPowerState=function(a,b,c){k.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_Watchdog_Reset=function(a){k.Exec("CIM_Watchdog","Reset",{},a)};k.CIM_Watchdog_EnableDevice=function(a,b){k.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},b)};k.CIM_Watchdog_OnlineDevice=function(a,b){k.Exec("CIM_Watchdog","OnlineDevice",{Online:a},b)};k.CIM_Watchdog_QuiesceDevice=function(a,b){k.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},b)};k.CIM_Watchdog_SaveProperties=
139
+function(a){k.Exec("CIM_Watchdog","SaveProperties",{},a)};k.CIM_Watchdog_RestoreProperties=function(a){k.Exec("CIM_Watchdog","RestoreProperties",{},a)};k.CIM_Watchdog_RequestStateChange=function(a,b,c){k.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.CIM_WiFiPort_SetPowerState=function(a,b,c){k.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:b},c)};k.CIM_WiFiPort_Reset=function(a){k.Exec("CIM_WiFiPort","Reset",{},a)};k.CIM_WiFiPort_EnableDevice=function(a,
140
+b){k.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},b)};k.CIM_WiFiPort_OnlineDevice=function(a,b){k.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},b)};k.CIM_WiFiPort_QuiesceDevice=function(a,b){k.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},b)};k.CIM_WiFiPort_SaveProperties=function(a){k.Exec("CIM_WiFiPort","SaveProperties",{},a)};k.CIM_WiFiPort_RestoreProperties=function(a){k.Exec("CIM_WiFiPort","RestoreProperties",{},a)};k.CIM_WiFiPort_RequestStateChange=function(a,b,c){k.Exec("CIM_WiFiPort",
141
+"RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_HostBasedSetupService_Setup=function(a,b,c,g,n,d,e){k.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,Certificate:g,SigningAlgorithm:n,DigitalSignature:d},e)};k.IPS_HostBasedSetupService_AddNextCertInChain=function(a,b,c,g){k.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:b,IsRootCertificate:c},g)};k.IPS_HostBasedSetupService_AdminSetup=
142
+function(a,b,c,g,n,d){k.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:b,McNonce:c,SigningAlgorithm:g,DigitalSignature:n},d)};k.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,b,c,g){k.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:b,DigitalSignature:c},g)};k.IPS_HostBasedSetupService_DisableClientControlMode=function(a,b){k.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},
143
+b)};k.IPS_KVMRedirectionSettingData_TerminateSession=function(a){k.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};k.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){k.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};k.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,b){k.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},b)};k.IPS_OptInService_StartOptIn=function(a){k.Exec("IPS_OptInService","StartOptIn",{},a)};k.IPS_OptInService_CancelOptIn=
144
+function(a){k.Exec("IPS_OptInService","CancelOptIn",{},a)};k.IPS_OptInService_SendOptInCode=function(a,b){k.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},b)};k.IPS_OptInService_StartService=function(a){k.Exec("IPS_OptInService","StartService",{},a)};k.IPS_OptInService_StopService=function(a){k.Exec("IPS_OptInService","StopService",{},a)};k.IPS_OptInService_RequestStateChange=function(a,b,c){k.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_ProvisioningRecordLog_RequestStateChange=
145
+function(a,b,c){k.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:b},c)};k.IPS_ProvisioningRecordLog_ClearLog=function(a,b){k.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},b)};k.IPS_ScreenConfigurationService_SetSessionState=function(a,b,c){k.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:b},c)};k.IPS_SecIOService_RequestStateChange=function(a,b,c){k.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a,
146
+TimeoutPeriod:b},c)};k.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,b,c,g,n){k.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:b,Port:c,NetworkDnsSuffix:g},n)};k.AmtStatusToStr=function(a){return k.AmtStatusCodes[a]?k.AmtStatusCodes[a]:"UNKNOWN_ERROR"};k.AmtStatusCodes={0:"SUCCESS",1:"INTERNAL_ERROR",2:"NOT_READY",3:"INVALID_PT_MODE",4:"INVALID_MESSAGE_LENGTH",5:"TABLE_FINGERPRINT_NOT_AVAILABLE",6:"INTEGRITY_CHECK_FAILED",7:"UNSUPPORTED_ISVS_VERSION",8:"APPLICATION_NOT_REGISTERED",
147
9:"INVALID_REGISTRATION_DATA",10:"APPLICATION_DOES_NOT_EXIST",11:"NOT_ENOUGH_STORAGE",12:"INVALID_NAME",13:"BLOCK_DOES_NOT_EXIST",14:"INVALID_BYTE_OFFSET",15:"INVALID_BYTE_COUNT",16:"NOT_PERMITTED",17:"NOT_OWNER",18:"BLOCK_LOCKED_BY_OTHER",19:"BLOCK_NOT_LOCKED",20:"INVALID_GROUP_PERMISSIONS",21:"GROUP_DOES_NOT_EXIST",22:"INVALID_MEMBER_COUNT",23:"MAX_LIMIT_REACHED",24:"INVALID_AUTH_TYPE",25:"AUTHENTICATION_FAILED",26:"INVALID_DHCP_MODE",27:"INVALID_IP_ADDRESS",28:"INVALID_DOMAIN_NAME",29:"UNSUPPORTED_VERSION",
148
30:"REQUEST_UNEXPECTED",31:"INVALID_TABLE_TYPE",32:"INVALID_PROVISIONING_STATE",33:"UNSUPPORTED_OBJECT",34:"INVALID_TIME",35:"INVALID_INDEX",36:"INVALID_PARAMETER",37:"INVALID_NETMASK",38:"FLASH_WRITE_LIMIT_EXCEEDED",39:"INVALID_IMAGE_LENGTH",40:"INVALID_IMAGE_SIGNATURE",41:"PROPOSE_ANOTHER_VERSION",42:"INVALID_PID_FORMAT",43:"INVALID_PPS_FORMAT",44:"BIST_COMMAND_BLOCKED",45:"CONNECTION_FAILED",46:"CONNECTION_TOO_MANY",47:"RNG_GENERATION_IN_PROGRESS",48:"RNG_NOT_READY",49:"CERTIFICATE_NOT_READY",
149
1024:"DISABLED_BY_POLICY",2048:"NETWORK_IF_ERROR_BASE",2049:"UNSUPPORTED_OEM_NUMBER",2050:"UNSUPPORTED_BOOT_OPTION",2051:"INVALID_COMMAND",2052:"INVALID_SPECIAL_COMMAND",2053:"INVALID_HANDLE",2054:"INVALID_PASSWORD",2055:"INVALID_REALM",2056:"STORAGE_ACL_ENTRY_IN_USE",2057:"DATA_MISSING",2058:"DUPLICATE",2059:"EVENTLOG_FROZEN",2060:"PKI_MISSING_KEYS",2061:"PKI_GENERATING_KEYS",2062:"INVALID_KEY",2063:"INVALID_CERT",2064:"CERT_KEY_NOT_MATCH",2065:"MAX_KERB_DOMAIN_REACHED",2066:"UNSUPPORTED",2067:"INVALID_PRIORITY",
150
-2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};m.GetMessageLog=function(a,b){m.AMT_MessageLog_PositionToFirstRecord(u,
151
-[a,b,[]])};var v="Unspecified.;No system memory is physically installed in the system.;No usable system memory, all installed memory has experienced an unrecoverable failure.;Unrecoverable hard-disk/ATAPI/IDE device failure.;Unrecoverable system-board failure.;Unrecoverable diskette subsystem failure.;Unrecoverable hard-disk controller failure.;Unrecoverable PS/2 or USB keyboard failure.;Removable boot media not found.;Unrecoverable video controller failure.;No video device detected.;Firmware (BIOS) ROM corruption detected.;CPU voltage mismatch (processors that share same supply have mismatched voltage requirements);CPU speed matching failure".split(";"),
150
+2068:"NOT_FOUND",2069:"INVALID_CREDENTIALS",2070:"INVALID_PASSPHRASE",2072:"NO_ASSOCIATION",2075:"AUDIT_FAIL",2076:"BLOCKING_COMPONENT",2081:"USER_CONSENT_REQUIRED",4096:"APP_INTERNAL_ERROR",4097:"NOT_INITIALIZED",4098:"LIB_VERSION_UNSUPPORTED",4099:"INVALID_PARAM",4100:"RESOURCES",4101:"HARDWARE_ACCESS_ERROR",4102:"REQUESTOR_NOT_REGISTERED",4103:"NETWORK_ERROR",4104:"PARAM_BUFFER_TOO_SHORT",4105:"COM_NOT_INITIALIZED_IN_THREAD",4106:"URL_REQUIRED"};k.GetMessageLog=function(a,b){k.AMT_MessageLog_PositionToFirstRecord(r,
151
+[a,b,[]])};var l="Unspecified.;No system memory is physically installed in the system.;No usable system memory, all installed memory has experienced an unrecoverable failure.;Unrecoverable hard-disk/ATAPI/IDE device failure.;Unrecoverable system-board failure.;Unrecoverable diskette subsystem failure.;Unrecoverable hard-disk controller failure.;Unrecoverable PS/2 or USB keyboard failure.;Removable boot media not found.;Unrecoverable video controller failure.;No video device detected.;Firmware (BIOS) ROM corruption detected.;CPU voltage mismatch (processors that share same supply have mismatched voltage requirements);CPU speed matching failure".split(";"),
152
g="Unspecified.;Memory initialization.;Starting hard-disk initialization and test;Secondary processor(s) initialization;User authentication;User-initiated system setup;USB resource configuration;PCI resource configuration;Option ROM initialization;Video initialization;Cache initialization;SM Bus initialization;Keyboard controller initialization;Embedded controller/management controller initialization;Docking station attachment;Enabling docking station;Docking station ejection;Disabling docking station;Calling operating system wake-up vector;Starting operating system boot process;Baseboard or motherboard initialization;reserved;Floppy initialization;Keyboard test;Pointing device test;Primary processor initialization".split(";"),
153
-K="Unspecified;Other;Unknown;Processor;Disk;Peripheral;System management module;System board;Memory module;Processor module;Power supply;Add in card;Front panel board;Back panel board;Power system board;Drive backplane;System internal expansion board;Other system board;Processor board;Power unit;Power module;Power management board;Chassis back panel board;System chassis;Sub chassis;Other chassis board;Disk drive bay;Peripheral bay;Device bay;Fan cooling;Cooling unit;Cable interconnect;Memory device;System management software;BIOS;Intel(r) ME;System bus;Group;Intel(r) ME;External environment;Battery;Processing blade;Connectivity switch;Processor/memory module;I/O module;Processor I/O module;Management controller firmware;IPMI channel;PCI bus;PCI express bus;SCSI bus;SATA/SAS bus;Processor front side bus".split(";");
154
-m.RealmNames=";;Redirection;;Hardware Asset;Remote Control;Storage;Event Manager;Storage Admin;Agent Presence Local;Agent Presence Remote;Circuit Breaker;Network Time;General Information;Firmware Update;EIT;LocalUN;Endpoint Access Control;Endpoint Access Control Admin;Event Log Reader;Audit Log;ACL Realm;;;Local System".split(";");m.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var r={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",
153
+I="Unspecified;Other;Unknown;Processor;Disk;Peripheral;System management module;System board;Memory module;Processor module;Power supply;Add in card;Front panel board;Back panel board;Power system board;Drive backplane;System internal expansion board;Other system board;Processor board;Power unit;Power module;Power management board;Chassis back panel board;System chassis;Sub chassis;Other chassis board;Disk drive bay;Peripheral bay;Device bay;Fan cooling;Cooling unit;Cable interconnect;Memory device;System management software;BIOS;Intel(r) ME;System bus;Group;Intel(r) ME;External environment;Battery;Processing blade;Connectivity switch;Processor/memory module;I/O module;Processor I/O module;Management controller firmware;IPMI channel;PCI bus;PCI express bus;SCSI bus;SATA/SAS bus;Processor front side bus".split(";");
154
+k.RealmNames=";;Redirection;;Hardware Asset;Remote Control;Storage;Event Manager;Storage Admin;Agent Presence Local;Agent Presence Remote;Circuit Breaker;Network Time;General Information;Firmware Update;EIT;LocalUN;Endpoint Access Control;Endpoint Access Control Admin;Event Log Reader;Audit Log;ACL Realm;;;Local System".split(";");k.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var u={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",
155
20:"Security Audit Log",21:"Network Time",22:"Network Administration",23:"Storage Administration",24:"Event Manager",25:"Circuit Breaker Manager",26:"Agent Presence Manager",27:"Wireless Configuration",28:"EAC",29:"KVM",30:"User Opt-In Events",32:"Screen Blanking",33:"Watchdog Events",1600:"Provisioning Started",1601:"Provisioning Completed",1602:"ACL Entry Added",1603:"ACL Entry Modified",1604:"ACL Entry Removed",1605:"ACL Access with Invalid Credentials",1606:"ACL Entry State",1607:"TLS State Changed",
156
1608:"TLS Server Certificate Set",1609:"TLS Server Certificate Remove",1610:"TLS Trusted Root Certificate Added",1611:"TLS Trusted Root Certificate Removed",1612:"TLS Preshared Key Set",1613:"Kerberos Settings Modified",1614:"Kerberos Master Key Modified",1615:"Flash Wear out Counters Reset",1616:"Power Package Modified",1617:"Set Realm Authentication Mode",1618:"Upgrade Client to Admin Control Mode",1619:"Unprovisioning Started",1700:"Performed Power Up",1701:"Performed Power Down",1702:"Performed Power Cycle",
157
1703:"Performed Reset",1704:"Set Boot Options",1800:"IDER Session Opened",1801:"IDER Session Closed",1802:"IDER Enabled",1803:"IDER Disabled",1804:"SoL Session Opened",1805:"SoL Session Closed",1806:"SoL Enabled",1807:"SoL Disabled",1808:"KVM Session Started",1809:"KVM Session Ended",1810:"KVM Enabled",1811:"KVM Disabled",1812:"VNC Password Failed 3 Times",1900:"Firmware Updated",1901:"Firmware Update Failed",2E3:"Security Audit Log Cleared",2001:"Security Audit Policy Modified",2002:"Security Audit Log Disabled",
158
2003:"Security Audit Log Enabled",2004:"Security Audit Log Exported",2005:"Security Audit Log Recovered",2100:"Intel® ME Time Set",2200:"TCPIP Parameters Set",2201:"Host Name Set",2202:"Domain Name Set",2203:"VLAN Parameters Set",2204:"Link Policy Set",2205:"IPv6 Parameters Set",2300:"Global Storage Attributes Set",2301:"Storage EACL Modified",2302:"Storage FPACL Modified",2303:"Storage Write Operation",2400:"Alert Subscribed",2401:"Alert Unsubscribed",2402:"Event Log Cleared",2403:"Event Log Frozen",
159
2500:"CB Filter Added",2501:"CB Filter Removed",2502:"CB Policy Added",2503:"CB Policy Removed",2504:"CB Default Policy Set",2505:"CB Heuristics Option Set",2506:"CB Heuristics State Cleared",2600:"Agent Watchdog Added",2601:"Agent Watchdog Removed",2602:"Agent Watchdog Action Set",2700:"Wireless Profile Added",2701:"Wireless Profile Removed",2702:"Wireless Profile Updated",2800:"EAC Posture Signer SET",2801:"EAC Enabled",2802:"EAC Disabled",2803:"EAC Posture State",2804:"EAC Set Options",2900:"KVM Opt-in Enabled",
160
-2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3E3:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};m.GetAuditLogExtendedDataStr=function(a,b){if((1602==a||1604==a)&&0==b.charCodeAt(0))return b.substring(2,2+b.charCodeAt(1));if(1603==a)return 0==b.charCodeAt(1)?b.substring(3):null;if(1605==a)return["Invalid ME access","Invalid MEBx access"][b.charCodeAt(0)];if(1606==a){var c=["Disabled","Enabled"][b.charCodeAt(0)];
161
-0==b.charCodeAt(1)&&(c+=", "+b.substring(3));return c}return 1607==a?"Remote "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(1)]:1617==a?m.RealmNames[ReadInt(b,0)]+", "+["NoAuth","Auth","Disabled"][b.charCodeAt(4)]:1619==a?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][b.charCodeAt(0)]:1900==a?"From "+ReadShort(b,0)+"."+ReadShort(b,2)+"."+ReadShort(b,4)+"."+ReadShort(b,6)+" to "+ReadShort(b,8)+"."+ReadShort(b,10)+"."+ReadShort(b,
162
-12)+"."+ReadShort(b,14):2100==a?(c=new Date,c.setTime(1E3*ReadInt(b,0)+6E4*(new Date).getTimezoneOffset()),c.toLocaleString()):3E3==a?"From "+["None","KVM","All"][b.charCodeAt(0)]+" to "+["None","KVM","All"][b.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][b.charCodeAt(0)]:null};m.GetAuditLog=function(a){m.AMT_AuditLog_ReadRecords(1,x,[a,[]])};return m}function hex_md5(b){return forge.md.md5.create().update(b).digest().toHex()}function rstr_md5(b){return hex2rstr(hex_md5(b))}
160
+2901:"KVM Opt-in Disabled",2902:"KVM Password Changed",2903:"KVM Consent Succeeded",2904:"KVM Consent Failed",3E3:"Opt-In Policy Change",3001:"Send Consent Code Event",3002:"Start Opt-In Blocked Event"};k.GetAuditLogExtendedDataStr=function(a,b){if((1602==a||1604==a)&&0==b.charCodeAt(0))return b.substring(2,2+b.charCodeAt(1));if(1603==a)return 0==b.charCodeAt(1)?b.substring(3):null;if(1605==a)return["Invalid ME access","Invalid MEBx access"][b.charCodeAt(0)];if(1606==a){var c=["Disabled","Enabled"][b.charCodeAt(0)];
161
+0==b.charCodeAt(1)&&(c+=", "+b.substring(3));return c}return 1607==a?"Remote "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][b.charCodeAt(1)]:1617==a?k.RealmNames[ReadInt(b,0)]+", "+["NoAuth","Auth","Disabled"][b.charCodeAt(4)]:1619==a?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][b.charCodeAt(0)]:1900==a?"From "+ReadShort(b,0)+"."+ReadShort(b,2)+"."+ReadShort(b,4)+"."+ReadShort(b,6)+" to "+ReadShort(b,8)+"."+ReadShort(b,10)+"."+ReadShort(b,
162
+12)+"."+ReadShort(b,14):2100==a?(c=new Date,c.setTime(1E3*ReadInt(b,0)+6E4*(new Date).getTimezoneOffset()),c.toLocaleString()):3E3==a?"From "+["None","KVM","All"][b.charCodeAt(0)]+" to "+["None","KVM","All"][b.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][b.charCodeAt(0)]:null};k.GetAuditLog=function(a){k.AMT_AuditLog_ReadRecords(1,w,[a,[]])};return k}function hex_md5(b){return forge.md.md5.create().update(b).digest().toHex()}function rstr_md5(b){return hex2rstr(hex_md5(b))}
163
function execArgumentsToXml(b){if(void 0===b||null===b)return null;var c="",a;for(a in b){var d=b[a];d&&(c="reference"===d.__parameterType?c+referenceToXml(a,d):c+instanceToXml(a,d))}return c}
164
-function instanceToXml(b,c){if(void 0===c||null===c)return null;var a=!!c.__namespace,d=a?"<q:":"<",e=a?"</q:":"</",a="<r:"+b+(a?' xmlns:q="'+c.__namespace+'"':"")+">",k;for(k in c)c.hasOwnProperty(k)&&0!==k.indexOf("__")&&("function"===typeof c[k]||Array.isArray(c[k])||("object"===typeof c[k]?console.error("only convert one level down..."):a+=d+k+">"+c[k].toString()+e+k+">"));return a+("</r:"+b+">")}
164
+function instanceToXml(b,c){if(void 0===c||null===c)return null;var a=!!c.__namespace,d=a?"<q:":"<",e=a?"</q:":"</",a="<r:"+b+(a?' xmlns:q="'+c.__namespace+'"':"")+">",q;for(q in c)c.hasOwnProperty(q)&&0!==q.indexOf("__")&&("function"===typeof c[q]||Array.isArray(c[q])||("object"===typeof c[q]?console.error("only convert one level down..."):a+=d+q+">"+c[q].toString()+e+q+">"));return a+("</r:"+b+">")}
165
function referenceToXml(b,c){if(void 0===c||null===c)return null;var a="<r:"+b+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+c.__resourceUri+"</w:ResourceURI><w:SelectorSet>",d;for(d in c)c.hasOwnProperty(d)&&0!==d.indexOf("__")&&("function"===typeof c[d]||"object"===typeof c[d]||Array.isArray(c[d])||(a+='<w:Selector Name="'+d+'">'+c[d].toString()+"</w:Selector>"));return a+("</w:SelectorSet></a:ReferenceParameters></r:"+b+">")}
166
function GetSidString(b){for(var c="S-"+b.charCodeAt(0)+"-"+b.charCodeAt(7),a=2;a<b.length/4;a++)c+="-"+ReadIntX(b,4*a);return c}
167
function GetSidByteArray(b){if(!b||null==b)return null;b=b.split("-");if(4>b.length||"s"!=b[0]&&"S"!=b[0])return null;for(var c=1;c<b.length;c++){var a=parseInt(b[c]);if(a!=b[c])return null;b[c]=a}a=String.fromCharCode(b[1])+String.fromCharCode(b.length-3)+ShortToStr(Math.floor(b[2]/Math.pow(2,32)))+IntToStr(b[2]&65535);for(c=3;c<b.length;c++)a+=IntToStrX(b[c]);return a}
168
-(function(b,c){"function"===typeof define&&define.amd?define([],c):b.forge=c()})(this,function(){var b,c,a;(function(d){function e(a,b){var c,n,d,e,h,B,g,v,m,p=b&&b.split("/"),x=r.map,w=x&&x["*"]||{};if(a&&"."===a.charAt(0))if(b){p=p.slice(0,p.length-1);a=a.split("/");h=a.length-1;r.nodeIdCompat&&I.test(a[h])&&(a[h]=a[h].replace(I,""));a=p.concat(a);for(h=0;h<a.length;h+=1)if(c=a[h],"."===c)a.splice(h,1),--h;else if(".."===c)if(1!==h||".."!==a[2]&&".."!==a[0])0<h&&(a.splice(h-1,2),h-=2);else break;
169
-a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((p||w)&&x){c=a.split("/");for(h=c.length;0<h;--h){n=c.slice(0,h).join("/");if(p)for(m=p.length;0<m;--m)if(d=x[p.slice(0,m).join("/")])if(d=d[n]){e=d;B=h;break}if(e)break;!g&&w&&w[n]&&(g=w[n],v=h)}!e&&g&&(e=g,B=v);e&&(c.splice(0,B,e),a=c.join("/"))}return a}function k(a,b){return function(){return w.apply(d,B.call(arguments,0).concat([a,b]))}}function l(a){return function(b){return e(b,a)}}function u(a){return function(b){g[a]=b}}function n(a){if(z.call(K,
170
-a)){var b=K[a];delete K[a];E[a]=!0;m.apply(d,b)}if(!z.call(g,a)&&!z.call(E,a))throw Error("No "+a);return g[a]}function p(a){var b,c=a?a.indexOf("!"):-1;-1<c&&(b=a.substring(0,c),a=a.substring(c+1,a.length));return[b,a]}function x(a){return function(){return r&&r.config&&r.config[a]||{}}}var m,w,h,v,g={},K={},r={},E={},z=Object.prototype.hasOwnProperty,B=[].slice,I=/\.js$/;h=function(a,b){var c,d=p(a),h=d[0];a=d[1];h&&(h=e(h,b),c=n(h));h?a=c&&c.normalize?c.normalize(a,l(b)):e(a,b):(a=e(a,b),d=p(a),
171
-h=d[0],a=d[1],h&&(c=n(h)));return{f:h?h+"!"+a:a,n:a,pr:h,p:c}};v={require:function(a){return k(a)},exports:function(a){var b=g[a];return"undefined"!==typeof b?b:g[a]={}},module:function(a){return{id:a,uri:"",exports:g[a],config:x(a)}}};m=function(a,b,c,e){var B,r,m,p,x=[];r=typeof c;var I;e=e||a;if("undefined"===r||"function"===r){b=!b.length&&c.length?["require","exports","module"]:b;for(p=0;p<b.length;p+=1)if(m=h(b[p],e),r=m.f,"require"===r)x[p]=v.require(a);else if("exports"===r)x[p]=v.exports(a),
172
-I=!0;else if("module"===r)B=x[p]=v.module(a);else if(z.call(g,r)||z.call(K,r)||z.call(E,r))x[p]=n(r);else if(m.p)m.p.load(m.n,k(e,!0),u(r),{}),x[p]=g[r];else throw Error(a+" missing "+r);b=c?c.apply(g[a],x):void 0;a&&(B&&B.exports!==d&&B.exports!==g[a]?g[a]=B.exports:b===d&&I||(g[a]=b))}else a&&(g[a]=c)};b=c=w=function(a,b,c,e,B){if("string"===typeof a)return v[a]?v[a](b):n(h(a,b).f);if(!a.splice){r=a;r.deps&&w(r.deps,r.callback);if(!b)return;b.splice?(a=b,b=c,c=null):a=d}b=b||function(){};"function"===
173
-typeof c&&(c=e,e=B);e?m(d,a,b,c):setTimeout(function(){m(d,a,b,c)},4);return w};w.config=function(a){return w(a)};b._defined=g;a=function(a,b,c){b.splice||(c=b,b=[]);z.call(g,a)||z.call(K,a)||(K[a]=[a,b,c])};a.amd={jQuery:!0}})();a("node_modules/almond/almond",function(){});(function(){function b(a){function c(a){this.data="";this.read=0;if("string"===typeof a)this.data=a;else if(d.isArrayBuffer(a)||d.isArrayBufferView(a)){a=new Uint8Array(a);try{this.data=String.fromCharCode.apply(null,a)}catch(b){for(var n=
174
-0;n<a.length;++n)this.putByte(a[n])}}else if(a instanceof c||"object"===typeof a&&"string"===typeof a.data&&"number"===typeof a.read)this.data=a.data,this.read=a.read;this._constructedStringLength=0}var d=a.util=a.util||{};(function(){if("undefined"!==typeof process&&process.nextTick)d.nextTick=process.nextTick,d.setImmediate="function"===typeof setImmediate?setImmediate:d.nextTick;else if("function"===typeof setImmediate)d.setImmediate=setImmediate,d.nextTick=function(a){return setImmediate(a)};
175
-else{d.setImmediate=function(a){setTimeout(a,0)};if("undefined"!==typeof window&&"function"===typeof window.postMessage){var a=[];d.setImmediate=function(b){a.push(b);1===a.length&&window.postMessage("forge.setImmediate","*")};window.addEventListener("message",function(b){b.source===window&&"forge.setImmediate"===b.data&&(b.stopPropagation(),b=a.slice(),a.length=0,b.forEach(function(a){a()}))},!0)}if("undefined"!==typeof MutationObserver){var b=Date.now(),c=!0,n=document.createElement("div"),a=[];
176
-(new MutationObserver(function(){var b=a.slice();a.length=0;b.forEach(function(a){a()})})).observe(n,{attributes:!0});var e=d.setImmediate;d.setImmediate=function(d){15<Date.now()-b?(b=Date.now(),e(d)):(a.push(d),1===a.length&&n.setAttribute("a",c=!c))}}d.nextTick=d.setImmediate}})();d.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};d.isArrayBuffer=function(a){return"undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer};d.isArrayBufferView=function(a){return a&&
168
+(function(b,c){"function"===typeof define&&define.amd?define([],c):b.forge=c()})(this,function(){var b,c,a;(function(d){function e(a,b){var c,g,n,d,e,x,l,k,m,w=b&&b.split("/"),v=u.map,z=v&&v["*"]||{};if(a&&"."===a.charAt(0))if(b){w=w.slice(0,w.length-1);a=a.split("/");e=a.length-1;u.nodeIdCompat&&F.test(a[e])&&(a[e]=a[e].replace(F,""));a=w.concat(a);for(e=0;e<a.length;e+=1)if(c=a[e],"."===c)a.splice(e,1),--e;else if(".."===c)if(1!==e||".."!==a[2]&&".."!==a[0])0<e&&(a.splice(e-1,2),e-=2);else break;
169
+a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((w||z)&&v){c=a.split("/");for(e=c.length;0<e;--e){g=c.slice(0,e).join("/");if(w)for(m=w.length;0<m;--m)if(n=v[w.slice(0,m).join("/")])if(n=n[g]){d=n;x=e;break}if(d)break;!l&&z&&z[g]&&(l=z[g],k=e)}!d&&l&&(d=l,x=k);d&&(c.splice(0,x,d),a=c.join("/"))}return a}function q(a,b){return function(){return v.apply(d,x.call(arguments,0).concat([a,b]))}}function h(a){return function(b){return e(b,a)}}function r(a){return function(b){g[a]=b}}function n(a){if(z.call(I,
170
+a)){var b=I[a];delete I[a];D[a]=!0;k.apply(d,b)}if(!z.call(g,a)&&!z.call(D,a))throw Error("No "+a);return g[a]}function m(a){var b,c=a?a.indexOf("!"):-1;-1<c&&(b=a.substring(0,c),a=a.substring(c+1,a.length));return[b,a]}function w(a){return function(){return u&&u.config&&u.config[a]||{}}}var k,v,B,l,g={},I={},u={},D={},z=Object.prototype.hasOwnProperty,x=[].slice,F=/\.js$/;B=function(a,b){var c,g=m(a),d=g[0];a=g[1];d&&(d=e(d,b),c=n(d));d?a=c&&c.normalize?c.normalize(a,h(b)):e(a,b):(a=e(a,b),g=m(a),
171
+d=g[0],a=g[1],d&&(c=n(d)));return{f:d?d+"!"+a:a,n:a,pr:d,p:c}};l={require:function(a){return q(a)},exports:function(a){var b=g[a];return"undefined"!==typeof b?b:g[a]={}},module:function(a){return{id:a,uri:"",exports:g[a],config:w(a)}}};k=function(a,b,c,e){var x,k,m,u,F=[];k=typeof c;var w;e=e||a;if("undefined"===k||"function"===k){b=!b.length&&c.length?["require","exports","module"]:b;for(u=0;u<b.length;u+=1)if(m=B(b[u],e),k=m.f,"require"===k)F[u]=l.require(a);else if("exports"===k)F[u]=l.exports(a),
172
+w=!0;else if("module"===k)x=F[u]=l.module(a);else if(z.call(g,k)||z.call(I,k)||z.call(D,k))F[u]=n(k);else if(m.p)m.p.load(m.n,q(e,!0),r(k),{}),F[u]=g[k];else throw Error(a+" missing "+k);b=c?c.apply(g[a],F):void 0;a&&(x&&x.exports!==d&&x.exports!==g[a]?g[a]=x.exports:b===d&&w||(g[a]=b))}else a&&(g[a]=c)};b=c=v=function(a,b,c,g,e){if("string"===typeof a)return l[a]?l[a](b):n(B(a,b).f);if(!a.splice){u=a;u.deps&&v(u.deps,u.callback);if(!b)return;b.splice?(a=b,b=c,c=null):a=d}b=b||function(){};"function"===
173
+typeof c&&(c=g,g=e);g?k(d,a,b,c):setTimeout(function(){k(d,a,b,c)},4);return v};v.config=function(a){return v(a)};b._defined=g;a=function(a,b,c){b.splice||(c=b,b=[]);z.call(g,a)||z.call(I,a)||(I[a]=[a,b,c])};a.amd={jQuery:!0}})();a("node_modules/almond/almond",function(){});(function(){function b(a){function c(a){this.data="";this.read=0;if("string"===typeof a)this.data=a;else if(d.isArrayBuffer(a)||d.isArrayBufferView(a)){a=new Uint8Array(a);try{this.data=String.fromCharCode.apply(null,a)}catch(b){for(var g=
174
+0;g<a.length;++g)this.putByte(a[g])}}else if(a instanceof c||"object"===typeof a&&"string"===typeof a.data&&"number"===typeof a.read)this.data=a.data,this.read=a.read;this._constructedStringLength=0}var d=a.util=a.util||{};(function(){if("undefined"!==typeof process&&process.nextTick)d.nextTick=process.nextTick,d.setImmediate="function"===typeof setImmediate?setImmediate:d.nextTick;else if("function"===typeof setImmediate)d.setImmediate=setImmediate,d.nextTick=function(a){return setImmediate(a)};
175
+else{d.setImmediate=function(a){setTimeout(a,0)};if("undefined"!==typeof window&&"function"===typeof window.postMessage){var a=[];d.setImmediate=function(b){a.push(b);1===a.length&&window.postMessage("forge.setImmediate","*")};window.addEventListener("message",function(b){b.source===window&&"forge.setImmediate"===b.data&&(b.stopPropagation(),b=a.slice(),a.length=0,b.forEach(function(a){a()}))},!0)}if("undefined"!==typeof MutationObserver){var b=Date.now(),c=!0,g=document.createElement("div"),a=[];
176
+(new MutationObserver(function(){var b=a.slice();a.length=0;b.forEach(function(a){a()})})).observe(g,{attributes:!0});var n=d.setImmediate;d.setImmediate=function(d){15<Date.now()-b?(b=Date.now(),n(d)):(a.push(d),1===a.length&&g.setAttribute("a",c=!c))}}d.nextTick=d.setImmediate}})();d.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};d.isArrayBuffer=function(a){return"undefined"!==typeof ArrayBuffer&&a instanceof ArrayBuffer};d.isArrayBufferView=function(a){return a&&
177
d.isArrayBuffer(a.buffer)&&void 0!==a.byteLength};d.ByteBuffer=c;d.ByteStringBuffer=c;d.ByteStringBuffer.prototype._optimizeConstructedString=function(a){this._constructedStringLength+=a;4096<this._constructedStringLength&&(this.data.substr(0,1),this._constructedStringLength=0)};d.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read};d.ByteStringBuffer.prototype.isEmpty=function(){return 0>=this.length()};d.ByteStringBuffer.prototype.putByte=function(a){return this.putBytes(String.fromCharCode(a))};
178
d.ByteStringBuffer.prototype.fillWithByte=function(a,b){a=String.fromCharCode(a);for(var c=this.data;0<b;)b&1&&(c+=a),b>>>=1,0<b&&(a+=a);this.data=c;this._optimizeConstructedString(b);return this};d.ByteStringBuffer.prototype.putBytes=function(a){this.data+=a;this._optimizeConstructedString(a.length);return this};d.ByteStringBuffer.prototype.putString=function(a){return this.putBytes(d.encodeUtf8(a))};d.ByteStringBuffer.prototype.putInt16=function(a){return this.putBytes(String.fromCharCode(a>>8&
179
255)+String.fromCharCode(a&255))};d.ByteStringBuffer.prototype.putInt24=function(a){return this.putBytes(String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))};d.ByteStringBuffer.prototype.putInt32=function(a){return this.putBytes(String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255))};d.ByteStringBuffer.prototype.putInt16Le=function(a){return this.putBytes(String.fromCharCode(a&255)+String.fromCharCode(a>>
@@ -184,10 +184,10 @@ function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+
184
function(a){var b=this.getInt(a);a=2<<a-2;b>=a&&(b-=a<<1);return b};d.ByteStringBuffer.prototype.getBytes=function(a){var b;a?(a=Math.min(this.length(),a),b=this.data.slice(this.read,this.read+a),this.read+=a):0===a?b="":(b=0===this.read?this.data:this.data.slice(this.read),this.clear());return b};d.ByteStringBuffer.prototype.bytes=function(a){return"undefined"===typeof a?this.data.slice(this.read):this.data.slice(this.read,this.read+a)};d.ByteStringBuffer.prototype.at=function(a){return this.data.charCodeAt(this.read+
185
a)};d.ByteStringBuffer.prototype.setAt=function(a,b){this.data=this.data.substr(0,this.read+a)+String.fromCharCode(b)+this.data.substr(this.read+a+1);return this};d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};d.ByteStringBuffer.prototype.copy=function(){var a=d.createBuffer(this.data);a.read=this.read;return a};d.ByteStringBuffer.prototype.compact=function(){0<this.read&&(this.data=this.data.slice(this.read),this.read=0);return this};d.ByteStringBuffer.prototype.clear=
186
function(){this.data="";this.read=0;return this};d.ByteStringBuffer.prototype.truncate=function(a){a=Math.max(0,this.length()-a);this.data=this.data.substr(this.read,a);this.read=0;return this};d.ByteStringBuffer.prototype.toHex=function(){for(var a="",b=this.read;b<this.data.length;++b){var c=this.data.charCodeAt(b);16>c&&(a+="0");a+=c.toString(16)}return a};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};d.DataBuffer=function(a,b){b=b||{};this.read=b.readOffset||
187
-0;this.growSize=b.growSize||1024;var c=d.isArrayBuffer(a),n=d.isArrayBufferView(a);c||n?(this.data=c?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in b?b.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in b&&(this.write=b.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()};
188
-d.DataBuffer.prototype.accommodate=function(a,b){if(this.length()>=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),d=new Uint8Array(this.length()+b);d.set(c);this.data=new DataView(d.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;c<b;++c)this.data.setUint8(a);
189
-return this};d.DataBuffer.prototype.putBytes=function(a,b){if(d.isArrayBufferView(a)){var c=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),n=c.byteLength-c.byteOffset;this.accommodate(n);var e=new Uint8Array(this.data.buffer,this.write);e.set(c);this.write+=n;return this}if(d.isArrayBuffer(a))return c=new Uint8Array(a),this.accommodate(c.byteLength),e=new Uint8Array(this.data.buffer),e.set(c,this.write),this.write+=c.byteLength,this;if(a instanceof d.DataBuffer||"object"===typeof a&&"number"===
190
-typeof a.read&&"number"===typeof a.write&&d.isArrayBufferView(a.data))return c=new Uint8Array(a.data.byteLength,a.read,a.length()),this.accommodate(c.byteLength),e=new Uint8Array(a.data.byteLength,this.write),e.set(c),this.write+=c.byteLength,this;a instanceof d.ByteStringBuffer&&(a=a.data,b="binary");b=b||"binary";if("string"===typeof a){if("hex"===b)return this.accommodate(Math.ceil(a.length/2)),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(a,c,this.write),this;if("base64"===
187
+0;this.growSize=b.growSize||1024;var c=d.isArrayBuffer(a),g=d.isArrayBufferView(a);c||g?(this.data=c?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in b?b.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in b&&(this.write=b.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()};
188
+d.DataBuffer.prototype.accommodate=function(a,b){if(this.length()>=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),g=new Uint8Array(this.length()+b);g.set(c);this.data=new DataView(g.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;c<b;++c)this.data.setUint8(a);
189
+return this};d.DataBuffer.prototype.putBytes=function(a,b){if(d.isArrayBufferView(a)){var c=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),g=c.byteLength-c.byteOffset;this.accommodate(g);var n=new Uint8Array(this.data.buffer,this.write);n.set(c);this.write+=g;return this}if(d.isArrayBuffer(a))return c=new Uint8Array(a),this.accommodate(c.byteLength),n=new Uint8Array(this.data.buffer),n.set(c,this.write),this.write+=c.byteLength,this;if(a instanceof d.DataBuffer||"object"===typeof a&&"number"===
190
+typeof a.read&&"number"===typeof a.write&&d.isArrayBufferView(a.data))return c=new Uint8Array(a.data.byteLength,a.read,a.length()),this.accommodate(c.byteLength),n=new Uint8Array(a.data.byteLength,this.write),n.set(c),this.write+=c.byteLength,this;a instanceof d.ByteStringBuffer&&(a=a.data,b="binary");b=b||"binary";if("string"===typeof a){if("hex"===b)return this.accommodate(Math.ceil(a.length/2)),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(a,c,this.write),this;if("base64"===
191
b)return this.accommodate(3*Math.ceil(a.length/4)),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.base64.decode(a,c,this.write),this;"utf8"===b&&(a=d.encodeUtf8(a),b="binary");if("binary"===b||"raw"===b)return this.accommodate(a.length),c=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.raw.decode(c),this;if("utf16"===b)return this.accommodate(2*a.length),c=new Uint16Array(this.data.buffer,this.write),this.write+=d.text.utf16.encode(c),this;throw Error("Invalid encoding: "+
192
b);}throw Error("Invalid parameter: "+a);};d.DataBuffer.prototype.putBuffer=function(a){this.putBytes(a);a.clear();return this};d.DataBuffer.prototype.putString=function(a){return this.putBytes(a,"utf16")};d.DataBuffer.prototype.putInt16=function(a){this.accommodate(2);this.data.setInt16(this.write,a);this.write+=2;return this};d.DataBuffer.prototype.putInt24=function(a){this.accommodate(3);this.data.setInt16(this.write,a>>8&65535);this.data.setInt8(this.write,a>>16&255);this.write+=3;return this};
193
d.DataBuffer.prototype.putInt32=function(a){this.accommodate(4);this.data.setInt32(this.write,a);this.write+=4;return this};d.DataBuffer.prototype.putInt16Le=function(a){this.accommodate(2);this.data.setInt16(this.write,a,!0);this.write+=2;return this};d.DataBuffer.prototype.putInt24Le=function(a){this.accommodate(3);this.data.setInt8(this.write,a>>16&255);this.data.setInt16(this.write,a>>8&65535,!0);this.write+=3;return this};d.DataBuffer.prototype.putInt32Le=function(a){this.accommodate(4);this.data.setInt32(this.write,
@@ -197,69 +197,69 @@ this.data.getInt32(this.read,!0);this.read+=4;return a};d.DataBuffer.prototype.g
197
d.DataBuffer.prototype.bytes=function(a){return"undefined"===typeof a?this.data.slice(this.read):this.data.slice(this.read,this.read+a)};d.DataBuffer.prototype.at=function(a){return this.data.getUint8(this.read+a)};d.DataBuffer.prototype.setAt=function(a,b){this.data.setUint8(a,b);return this};d.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)};d.DataBuffer.prototype.copy=function(){return new d.DataBuffer(this)};d.DataBuffer.prototype.compact=function(){if(0<this.read){var a=
198
new Uint8Array(this.data.buffer,this.read),b=new Uint8Array(a.byteLength);b.set(a);this.data=new DataView(b);this.write-=this.read;this.read=0}return this};d.DataBuffer.prototype.clear=function(){this.data=new DataView(new ArrayBuffer(0));this.read=this.write=0;return this};d.DataBuffer.prototype.truncate=function(a){this.write=Math.max(0,this.length()-a);this.read=Math.min(this.read,this.write);return this};d.DataBuffer.prototype.toHex=function(){for(var a="",b=this.read;b<this.data.byteLength;++b){var c=
199
this.data.getUint8(b);16>c&&(a+="0");a+=c.toString(16)}return a};d.DataBuffer.prototype.toString=function(a){var b=new Uint8Array(this.data,this.read,this.length());a=a||"utf8";if("binary"===a||"raw"===a)return d.binary.raw.encode(b);if("hex"===a)return d.binary.hex.encode(b);if("base64"===a)return d.binary.base64.encode(b);if("utf8"===a)return d.text.utf8.decode(b);if("utf16"===a)return d.text.utf16.decode(b);throw Error("Invalid encoding: "+a);};d.createBuffer=function(a,b){void 0!==a&&"utf8"===
200
-(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0<b;)b&1&&(c+=a),b>>>=1,0<b&&(a+=a);return c};d.xorBytes=function(a,b,c){for(var d="",n="",e="",h=0,g=0;0<c;--c,++h)n=a.charCodeAt(h)^b.charCodeAt(h),10<=g&&(d+=e,e="",g=0),e+=String.fromCharCode(n),++g;return d+e};d.hexToBytes=function(a){var b="",c=0;a.length&1&&(c=1,b+=String.fromCharCode(parseInt(a[0],16)));for(;c<a.length;c+=2)b+=String.fromCharCode(parseInt(a.substr(c,2),16));return b};d.bytesToHex=
201
-function(a){return d.createBuffer(a).toHex()};d.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",d="",n,e,h,g=0;g<a.length;)n=
202
-a.charCodeAt(g++),e=a.charCodeAt(g++),h=a.charCodeAt(g++),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&3)<<4|e>>4),isNaN(e)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((e&15)<<2|h>>6),c+=isNaN(h)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h&63)),b&&c.length>b&&(d+=c.substr(0,b)+"\r\n",c=c.substr(b));return d+
203
-c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,d,n,h,g=0;g<a.length;)c=e[a.charCodeAt(g++)-43],d=e[a.charCodeAt(g++)-43],n=e[a.charCodeAt(g++)-43],h=e[a.charCodeAt(g++)-43],b+=String.fromCharCode(c<<2|d>>4),64!==n&&(b+=String.fromCharCode((d&15)<<4|n>>2),64!==h&&(b+=String.fromCharCode((n&3)<<6|h)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
204
-d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(a.length));for(var n=c=c||0,e=0;e<a.length;++e)d[n++]=a.charCodeAt(e);return b?n-c:d};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(Math.ceil(a.length/2)));c=c||0;var n=0,e=c;a.length&1&&(n=1,d[e++]=parseInt(a[0],16));for(;n<a.length;n+=2)d[e++]=parseInt(a.substr(n,2),16);return b?e-c:d};d.binary.base64.encode=
205
-function(a,b){for(var c="",d="",n,e,h,g=0;g<a.byteLength;)n=a[g++],e=a[g++],h=a[g++],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&3)<<4|e>>4),isNaN(e)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((e&15)<<2|h>>6),c+=isNaN(h)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(h&63)),b&&c.length>b&&(d+=c.substr(0,
206
-b)+"\r\n",c=c.substr(b));return d+c};d.binary.base64.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var n,h,g,r,v=0,p=c;v<a.length;)n=e[a.charCodeAt(v++)-43],h=e[a.charCodeAt(v++)-43],g=e[a.charCodeAt(v++)-43],r=e[a.charCodeAt(v++)-43],d[p++]=n<<2|h>>4,64!==g&&(d[p++]=(h&15)<<4|g>>2,64!==r&&(d[p++]=(g&3)<<6|r));return b?p-c:d.subarray(0,p)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a);
207
-var n=b;n||(n=new Uint8Array(a.length));for(var e=c=c||0,h=0;h<a.length;++h)n[e++]=a.charCodeAt(h);return b?e-c:n};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,b,c){var d=b;d||(d=new Uint8Array(2*a.length));for(var n=new Uint16Array(d.buffer),e=c=c||0,h=c,g=0;g<a.length;++g)n[h++]=a.charCodeAt(g),e+=2;return b?e-c:d};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
208
-b,c){b=d.decode64(a.deflate(d.encode64(b)).rval);c&&(a=2,b.charCodeAt(1)&32&&(a=6),b=b.substring(a,b.length-4));return b};d.inflate=function(a,b,c){a=a.inflate(d.encode64(b)).rval;return null===a?null:d.decode64(a)};var w=function(a,b,c){if(!a)throw Error("WebStorage not available.");null===c?a=a.removeItem(b):(c=d.encode64(JSON.stringify(c)),a=a.setItem(b,c));if("undefined"!==typeof a&&!0!==a.rval)throw b=Error(a.error.message),b.id=a.error.id,b.name=a.error.name,b;},h=function(a,b){if(!a)throw Error("WebStorage not available.");
209
-var c=a.getItem(b);if(a.init)if(null===c.rval){if(c.error){var n=Error(c.error.message);n.id=c.error.id;n.name=c.error.name;throw n;}c=null}else c=c.rval;null!==c&&(c=JSON.parse(d.decode64(c)));return c},v=function(a,b,c,d){var n=h(a,b);null===n&&(n={});n[c]=d;w(a,b,n)},g=function(a,b,c){a=h(a,b);null!==a&&(a=c in a?a[c]:null);return a},K=function(a,b,c){var d=h(a,b);if(null!==d&&c in d){delete d[c];c=!0;for(var n in d){c=!1;break}c&&(d=null);w(a,b,d)}},r=function(a,b){w(a,b,null)},E=function(a,b,
210
-c){var d=null;"undefined"===typeof c&&(c=["web","flash"]);var n,e=!1,h=null,g;for(g in c){n=c[g];try{if("flash"===n||"both"===n){if(null===b[0])throw Error("Flash local storage not available.");d=a.apply(this,b);e="flash"===n}if("web"===n||"both"===n)b[0]=localStorage,d=a.apply(this,b),e=!0}catch(r){h=r}if(e)break}if(!e)throw h;return d};d.setItem=function(a,b,c,d,n){E(v,arguments,n)};d.getItem=function(a,b,c,d){return E(g,arguments,d)};d.removeItem=function(a,b,c,d){E(K,arguments,d)};d.clearItems=
211
-function(a,b,c){E(r,arguments,c)};d.parseUrl=function(a){var b=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;b.lastIndex=0;b=b.exec(a);if(a=null===b?null:{full:a,scheme:b[1],host:b[2],port:b[3],path:b[4]})a.fullHost=a.host,a.port?80!==a.port&&"http"===a.scheme?a.fullHost+=":"+a.port:443!==a.port&&"https"===a.scheme&&(a.fullHost+=":"+a.port):"http"===a.scheme?a.port=80:"https"===a.scheme&&(a.port=443),a.full=a.scheme+"://"+a.fullHost;return a};var z=null;d.getQueryVariables=function(a){var b=function(a){var b=
212
-{};a=a.split("&");for(var c=0;c<a.length;c++){var d=a[c].indexOf("="),n;0<d?(n=a[c].substring(0,d),d=a[c].substring(d+1)):(n=a[c],d=null);n in b||(b[n]=[]);n in Object.prototype||null===d||b[n].push(unescape(d))}return b};"undefined"===typeof a?(null===z&&(z="undefined"!==typeof window&&window.location&&window.location.search?b(window.location.search.substring(1)):{}),a=z):a=b(a);return a};d.parseFragment=function(a){var b=a,c="",n=a.indexOf("?");0<n&&(b=a.substring(0,n),c=a.substring(n+1));a=b.split("/");
213
-0<a.length&&""===a[0]&&a.shift();n=""===c?{}:d.getQueryVariables(c);return{pathString:b,queryString:c,path:a,query:n}};d.makeRequest=function(a){var b=d.parseFragment(a),c={path:b.pathString,query:b.queryString,getPath:function(a){return"undefined"===typeof a?b.path:b.path[a]},getQuery:function(a,c){var d;"undefined"===typeof a?d=b.query:(d=b.query[a])&&"undefined"!==typeof c&&(d=d[c]);return d},getQueryLast:function(a,b){var d=c.getQuery(a);return d?d[d.length-1]:b}};return c};d.makeLink=function(a,
214
-b,c){a=jQuery.isArray(a)?a.join("/"):a;b=jQuery.param(b||{});c=c||"";return a+(0<b.length?"?"+b:"")+(0<c.length?"#"+c:"")};d.setPath=function(a,b,c){if("object"===typeof a&&null!==a)for(var d=0,n=b.length;d<n;){var e=b[d++];if(d==n)a[e]=c;else{var h=e in a;if(!h||h&&"object"!==typeof a[e]||h&&null===a[e])a[e]={};a=a[e]}}};d.getPath=function(a,b,c){for(var d=0,n=b.length,e=!0;e&&d<n&&"object"===typeof a&&null!==a;){var h=b[d++];(e=h in a)&&(a=a[h])}return e?a:c};d.deletePath=function(a,b){if("object"===
215
-typeof a&&null!==a)for(var c=0,d=b.length;c<d;){var n=b[c++];if(c==d)delete a[n];else{if(!(n in a)||"object"!==typeof a[n]||null===a[n])break;a=a[n]}}};d.isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};d.format=function(a){var b=/%./g,c,d,n=0,e=[];for(d=0;c=b.exec(a);)switch(d=a.substring(d,b.lastIndex-2),0<d.length&&e.push(d),d=b.lastIndex,c=c[0][1],c){case "s":case "o":n<arguments.length?e.push(arguments[n++ +1]):e.push("<?>");break;case "%":e.push("%");break;default:e.push("<#"+
216
-c+"?>")}e.push(a.substring(d));return e.join("")};d.formatNumber=function(a,b,c,d){var n=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;d=void 0===d?".":d;c=0>a?"-":"";var e=parseInt(a=Math.abs(+a||0).toFixed(n),10)+"",h=3<e.length?e.length%3:0;return c+(h?e.substr(0,h)+d:"")+e.substr(h).replace(/(\d{3})(?=\d)/g,"$1"+d)+(n?b+Math.abs(a-e).toFixed(n).slice(2):"")};d.formatSize=function(a){return a=1073741824<=a?d.formatNumber(a/1073741824,2,".","")+" GiB":1048576<=a?d.formatNumber(a/1048576,2,".","")+
217
-" MiB":1024<=a?d.formatNumber(a/1024,0)+" KiB":d.formatNumber(a,0)+" bytes"};d.bytesFromIP=function(a){return-1!==a.indexOf(".")?d.bytesFromIPv4(a):-1!==a.indexOf(":")?d.bytesFromIPv6(a):null};d.bytesFromIPv4=function(a){a=a.split(".");if(4!==a.length)return null;for(var b=d.createBuffer(),c=0;c<a.length;++c){var n=parseInt(a[c],10);if(isNaN(n))return null;b.putByte(n)}return b.getBytes()};d.bytesFromIPv6=function(a){var b=0;a=a.split(":").filter(function(a){0===a.length&&++b;return!0});for(var c=
218
-2*(8-a.length+b),n=d.createBuffer(),e=0;8>e;++e)if(a[e]&&0!==a[e].length){var h=d.hexToBytes(a[e]);2>h.length&&n.putByte(0);n.putBytes(h)}else n.fillWithByte(0,c),c=0;return n.getBytes()};d.bytesToIP=function(a){return 4===a.length?d.bytesToIPv4(a):16===a.length?d.bytesToIPv6(a):null};d.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return b.join(".")};d.bytesToIPv6=function(a){if(16!==a.length)return null;for(var b=[],c=[],n=0,e=0;e<a.length;e+=
219
-2){for(var h=d.bytesToHex(a[e]+a[e+1]);"0"===h[0]&&"0"!==h;)h=h.substr(1);if("0"===h){var g=c[c.length-1],r=b.length;g&&r===g.end+1?(g.end=r,g.end-g.start>c[n].end-c[n].start&&(n=c.length-1)):c.push({start:r,end:r})}b.push(h)}0<c.length&&(a=c[n],0<a.end-a.start&&(b.splice(a.start,a.end-a.start+1,""),0===a.start&&b.unshift(""),7===a.end&&b.push("")));return b.join(":")};d.estimateCores=function(a,b){function c(a,g,r){if(0===g){var v=Math.floor(a.reduce(function(a,b){return a+b},0)/a.length);d.cores=
220
-Math.max(1,v);URL.revokeObjectURL(h);return b(null,d.cores)}n(r,function(b,d){a.push(e(r,d));c(a,g-1,r)})}function n(a,b){for(var c=[],d=[],e=0;e<a;++e){var g=new Worker(h);g.addEventListener("message",function(n){d.push(n.data);if(d.length===a){for(n=0;n<a;++n)c[n].terminate();b(null,d)}});c.push(g)}for(e=0;e<a;++e)c[e].postMessage(e)}function e(a,b){for(var c=[],d=0;d<a;++d)for(var n=b[d],h=c[d]=[],g=0;g<a;++g)if(d!==g){var A=b[g];(n.st>A.st&&n.st<A.et||A.st>n.st&&A.st<n.et)&&h.push(g)}return c.reduce(function(a,
221
-b){return Math.max(a,b.length)},0)}"function"===typeof a&&(b=a,a={});a=a||{};if("cores"in d&&!a.update)return b(null,d.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&0<navigator.hardwareConcurrency)return d.cores=navigator.hardwareConcurrency,b(null,d.cores);if("undefined"===typeof Worker)return d.cores=1,b(null,d.cores);if("undefined"===typeof Blob)return d.cores=2,b(null,d.cores);var h=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){a=
222
-Date.now();for(var b=a+4;Date.now()<b;);self.postMessage({st:a,et:b})})}.toString(),")()"],{type:"application/javascript"}));c([],5,16)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.util)return c.util;c.defined.util=!0;for(var p=0;p<e.length;++p)e[p](c);
223
-return c.util}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/util",["require","module"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.cipher=a.cipher||{};a.cipher.algorithms=a.cipher.algorithms||{};a.cipher.createCipher=function(b,c){var d=b;"string"===typeof d&&(d=a.cipher.getAlgorithm(d))&&
200
+(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0<b;)b&1&&(c+=a),b>>>=1,0<b&&(a+=a);return c};d.xorBytes=function(a,b,c){for(var g="",d="",n="",e=0,l=0;0<c;--c,++e)d=a.charCodeAt(e)^b.charCodeAt(e),10<=l&&(g+=n,n="",l=0),n+=String.fromCharCode(d),++l;return g+n};d.hexToBytes=function(a){var b="",c=0;a.length&1&&(c=1,b+=String.fromCharCode(parseInt(a[0],16)));for(;c<a.length;c+=2)b+=String.fromCharCode(parseInt(a.substr(c,2),16));return b};d.bytesToHex=
201
+function(a){return d.createBuffer(a).toHex()};d.int32ToBytes=function(a){return String.fromCharCode(a>>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",g="",d,n,e,l=0;l<a.length;)d=
202
+a.charCodeAt(l++),n=a.charCodeAt(l++),e=a.charCodeAt(l++),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,b)+"\r\n",c=c.substr(b));return g+
203
+c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,g,d,n,l=0;l<a.length;)c=e[a.charCodeAt(l++)-43],g=e[a.charCodeAt(l++)-43],d=e[a.charCodeAt(l++)-43],n=e[a.charCodeAt(l++)-43],b+=String.fromCharCode(c<<2|g>>4),64!==d&&(b+=String.fromCharCode((g&15)<<4|d>>2),64!==n&&(b+=String.fromCharCode((d&3)<<6|n)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
204
+d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(a.length));for(var d=c=c||0,n=0;n<a.length;++n)g[d++]=a.charCodeAt(n);return b?d-c:g};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(Math.ceil(a.length/2)));c=c||0;var d=0,n=c;a.length&1&&(d=1,g[n++]=parseInt(a[0],16));for(;d<a.length;d+=2)g[n++]=parseInt(a.substr(d,2),16);return b?n-c:g};d.binary.base64.encode=
205
+function(a,b){for(var c="",g="",d,n,e,l=0;l<a.byteLength;)d=a[l++],n=a[l++],e=a[l++],c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|n>>4),isNaN(n)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((n&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,
206
+b)+"\r\n",c=c.substr(b));return g+c};d.binary.base64.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var d,n,l,m,u=0,p=c;u<a.length;)d=e[a.charCodeAt(u++)-43],n=e[a.charCodeAt(u++)-43],l=e[a.charCodeAt(u++)-43],m=e[a.charCodeAt(u++)-43],g[p++]=d<<2|n>>4,64!==l&&(g[p++]=(n&15)<<4|l>>2,64!==m&&(g[p++]=(l&3)<<6|m));return b?p-c:g.subarray(0,p)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a);
207
+var g=b;g||(g=new Uint8Array(a.length));for(var n=c=c||0,e=0;e<a.length;++e)g[n++]=a.charCodeAt(e);return b?n-c:g};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,b,c){var g=b;g||(g=new Uint8Array(2*a.length));for(var d=new Uint16Array(g.buffer),n=c=c||0,e=c,l=0;l<a.length;++l)d[e++]=a.charCodeAt(l),n+=2;return b?n-c:g};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
208
+b,c){b=d.decode64(a.deflate(d.encode64(b)).rval);c&&(a=2,b.charCodeAt(1)&32&&(a=6),b=b.substring(a,b.length-4));return b};d.inflate=function(a,b,c){a=a.inflate(d.encode64(b)).rval;return null===a?null:d.decode64(a)};var v=function(a,b,c){if(!a)throw Error("WebStorage not available.");null===c?a=a.removeItem(b):(c=d.encode64(JSON.stringify(c)),a=a.setItem(b,c));if("undefined"!==typeof a&&!0!==a.rval)throw b=Error(a.error.message),b.id=a.error.id,b.name=a.error.name,b;},B=function(a,b){if(!a)throw Error("WebStorage not available.");
209
+var c=a.getItem(b);if(a.init)if(null===c.rval){if(c.error){var g=Error(c.error.message);g.id=c.error.id;g.name=c.error.name;throw g;}c=null}else c=c.rval;null!==c&&(c=JSON.parse(d.decode64(c)));return c},l=function(a,b,c,g){var d=B(a,b);null===d&&(d={});d[c]=g;v(a,b,d)},g=function(a,b,c){a=B(a,b);null!==a&&(a=c in a?a[c]:null);return a},I=function(a,b,c){var g=B(a,b);if(null!==g&&c in g){delete g[c];c=!0;for(var d in g){c=!1;break}c&&(g=null);v(a,b,g)}},u=function(a,b){v(a,b,null)},h=function(a,b,
210
+c){var g=null;"undefined"===typeof c&&(c=["web","flash"]);var d,n=!1,e=null,l;for(l in c){d=c[l];try{if("flash"===d||"both"===d){if(null===b[0])throw Error("Flash local storage not available.");g=a.apply(this,b);n="flash"===d}if("web"===d||"both"===d)b[0]=localStorage,g=a.apply(this,b),n=!0}catch(k){e=k}if(n)break}if(!n)throw e;return g};d.setItem=function(a,b,c,g,d){h(l,arguments,d)};d.getItem=function(a,b,c,d){return h(g,arguments,d)};d.removeItem=function(a,b,c,g){h(I,arguments,g)};d.clearItems=
211
+function(a,b,c){h(u,arguments,c)};d.parseUrl=function(a){var b=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;b.lastIndex=0;b=b.exec(a);if(a=null===b?null:{full:a,scheme:b[1],host:b[2],port:b[3],path:b[4]})a.fullHost=a.host,a.port?80!==a.port&&"http"===a.scheme?a.fullHost+=":"+a.port:443!==a.port&&"https"===a.scheme&&(a.fullHost+=":"+a.port):"http"===a.scheme?a.port=80:"https"===a.scheme&&(a.port=443),a.full=a.scheme+"://"+a.fullHost;return a};var z=null;d.getQueryVariables=function(a){var b=function(a){var b=
212
+{};a=a.split("&");for(var c=0;c<a.length;c++){var g=a[c].indexOf("="),d;0<g?(d=a[c].substring(0,g),g=a[c].substring(g+1)):(d=a[c],g=null);d in b||(b[d]=[]);d in Object.prototype||null===g||b[d].push(unescape(g))}return b};"undefined"===typeof a?(null===z&&(z="undefined"!==typeof window&&window.location&&window.location.search?b(window.location.search.substring(1)):{}),a=z):a=b(a);return a};d.parseFragment=function(a){var b=a,c="",g=a.indexOf("?");0<g&&(b=a.substring(0,g),c=a.substring(g+1));a=b.split("/");
213
+0<a.length&&""===a[0]&&a.shift();g=""===c?{}:d.getQueryVariables(c);return{pathString:b,queryString:c,path:a,query:g}};d.makeRequest=function(a){var b=d.parseFragment(a),c={path:b.pathString,query:b.queryString,getPath:function(a){return"undefined"===typeof a?b.path:b.path[a]},getQuery:function(a,c){var g;"undefined"===typeof a?g=b.query:(g=b.query[a])&&"undefined"!==typeof c&&(g=g[c]);return g},getQueryLast:function(a,b){var g=c.getQuery(a);return g?g[g.length-1]:b}};return c};d.makeLink=function(a,
214
+b,c){a=jQuery.isArray(a)?a.join("/"):a;b=jQuery.param(b||{});c=c||"";return a+(0<b.length?"?"+b:"")+(0<c.length?"#"+c:"")};d.setPath=function(a,b,c){if("object"===typeof a&&null!==a)for(var g=0,d=b.length;g<d;){var n=b[g++];if(g==d)a[n]=c;else{var e=n in a;if(!e||e&&"object"!==typeof a[n]||e&&null===a[n])a[n]={};a=a[n]}}};d.getPath=function(a,b,c){for(var g=0,d=b.length,n=!0;n&&g<d&&"object"===typeof a&&null!==a;){var e=b[g++];(n=e in a)&&(a=a[e])}return n?a:c};d.deletePath=function(a,b){if("object"===
215
+typeof a&&null!==a)for(var c=0,g=b.length;c<g;){var d=b[c++];if(c==g)delete a[d];else{if(!(d in a)||"object"!==typeof a[d]||null===a[d])break;a=a[d]}}};d.isEmpty=function(a){for(var b in a)if(a.hasOwnProperty(b))return!1;return!0};d.format=function(a){var b=/%./g,c,g,d=0,n=[];for(g=0;c=b.exec(a);)switch(g=a.substring(g,b.lastIndex-2),0<g.length&&n.push(g),g=b.lastIndex,c=c[0][1],c){case "s":case "o":d<arguments.length?n.push(arguments[d++ +1]):n.push("<?>");break;case "%":n.push("%");break;default:n.push("<#"+
216
+c+"?>")}n.push(a.substring(g));return n.join("")};d.formatNumber=function(a,b,c,g){var d=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;g=void 0===g?".":g;c=0>a?"-":"";var n=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",e=3<n.length?n.length%3:0;return c+(e?n.substr(0,e)+g:"")+n.substr(e).replace(/(\d{3})(?=\d)/g,"$1"+g)+(d?b+Math.abs(a-n).toFixed(d).slice(2):"")};d.formatSize=function(a){return a=1073741824<=a?d.formatNumber(a/1073741824,2,".","")+" GiB":1048576<=a?d.formatNumber(a/1048576,2,".","")+
217
+" MiB":1024<=a?d.formatNumber(a/1024,0)+" KiB":d.formatNumber(a,0)+" bytes"};d.bytesFromIP=function(a){return-1!==a.indexOf(".")?d.bytesFromIPv4(a):-1!==a.indexOf(":")?d.bytesFromIPv6(a):null};d.bytesFromIPv4=function(a){a=a.split(".");if(4!==a.length)return null;for(var b=d.createBuffer(),c=0;c<a.length;++c){var g=parseInt(a[c],10);if(isNaN(g))return null;b.putByte(g)}return b.getBytes()};d.bytesFromIPv6=function(a){var b=0;a=a.split(":").filter(function(a){0===a.length&&++b;return!0});for(var c=
218
+2*(8-a.length+b),g=d.createBuffer(),n=0;8>n;++n)if(a[n]&&0!==a[n].length){var e=d.hexToBytes(a[n]);2>e.length&&g.putByte(0);g.putBytes(e)}else g.fillWithByte(0,c),c=0;return g.getBytes()};d.bytesToIP=function(a){return 4===a.length?d.bytesToIPv4(a):16===a.length?d.bytesToIPv6(a):null};d.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;c<a.length;++c)b.push(a.charCodeAt(c));return b.join(".")};d.bytesToIPv6=function(a){if(16!==a.length)return null;for(var b=[],c=[],g=0,n=0;n<a.length;n+=
219
+2){for(var e=d.bytesToHex(a[n]+a[n+1]);"0"===e[0]&&"0"!==e;)e=e.substr(1);if("0"===e){var l=c[c.length-1],k=b.length;l&&k===l.end+1?(l.end=k,l.end-l.start>c[g].end-c[g].start&&(g=c.length-1)):c.push({start:k,end:k})}b.push(e)}0<c.length&&(a=c[g],0<a.end-a.start&&(b.splice(a.start,a.end-a.start+1,""),0===a.start&&b.unshift(""),7===a.end&&b.push("")));return b.join(":")};d.estimateCores=function(a,b){function c(a,l,k){if(0===l){var m=Math.floor(a.reduce(function(a,b){return a+b},0)/a.length);d.cores=
220
+Math.max(1,m);URL.revokeObjectURL(e);return b(null,d.cores)}g(k,function(b,g){a.push(n(k,g));c(a,l-1,k)})}function g(a,b){for(var c=[],d=[],n=0;n<a;++n){var A=new Worker(e);A.addEventListener("message",function(g){d.push(g.data);if(d.length===a){for(g=0;g<a;++g)c[g].terminate();b(null,d)}});c.push(A)}for(n=0;n<a;++n)c[n].postMessage(n)}function n(a,b){for(var c=[],g=0;g<a;++g)for(var d=b[g],e=c[g]=[],y=0;y<a;++y)if(g!==y){var A=b[y];(d.st>A.st&&d.st<A.et||A.st>d.st&&A.st<d.et)&&e.push(y)}return c.reduce(function(a,
221
+b){return Math.max(a,b.length)},0)}"function"===typeof a&&(b=a,a={});a=a||{};if("cores"in d&&!a.update)return b(null,d.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&0<navigator.hardwareConcurrency)return d.cores=navigator.hardwareConcurrency,b(null,d.cores);if("undefined"===typeof Worker)return d.cores=1,b(null,d.cores);if("undefined"===typeof Blob)return d.cores=2,b(null,d.cores);var e=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){a=
222
+Date.now();for(var b=a+4;Date.now()<b;);self.postMessage({st:a,et:b})})}.toString(),")()"],{type:"application/javascript"}));c([],5,16)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.util)return c.util;c.defined.util=!0;for(var m=0;m<e.length;++m)e[m](c);
223
+return c.util}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/util",["require","module"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.cipher=a.cipher||{};a.cipher.algorithms=a.cipher.algorithms||{};a.cipher.createCipher=function(b,c){var d=b;"string"===typeof d&&(d=a.cipher.getAlgorithm(d))&&
224
(d=d());if(!d)throw Error("Unsupported algorithm: "+b);return new a.cipher.BlockCipher({algorithm:d,key:c,decrypt:!1})};a.cipher.createDecipher=function(b,c){var d=b;"string"===typeof d&&(d=a.cipher.getAlgorithm(d))&&(d=d());if(!d)throw Error("Unsupported algorithm: "+b);return new a.cipher.BlockCipher({algorithm:d,key:c,decrypt:!0})};a.cipher.registerAlgorithm=function(b,c){b=b.toUpperCase();a.cipher.algorithms[b]=c};a.cipher.getAlgorithm=function(b){b=b.toUpperCase();return b in a.cipher.algorithms?
225
a.cipher.algorithms[b]:null};var c=a.cipher.BlockCipher=function(a){this.algorithm=a.algorithm;this.mode=this.algorithm.mode;this.blockSize=this.mode.blockSize;this._finish=!1;this.output=this._input=null;this._op=a.decrypt?this.mode.decrypt:this.mode.encrypt;this._decrypt=a.decrypt;this.algorithm.initialize(a)};c.prototype.start=function(b){b=b||{};var c={},d;for(d in b)c[d]=b[d];c.decrypt=this._decrypt;this._finish=!1;this._input=a.util.createBuffer();this.output=b.output||a.util.createBuffer();
226
this.mode.start(c)};c.prototype.update=function(a){for(a&&this._input.putBuffer(a);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()};c.prototype.finish=function(a){!a||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(b){return a(this.blockSize,b,!1)},this.mode.unpad=function(b){return a(this.blockSize,b,!0)});var b={};b.decrypt=this._decrypt;b.overflow=this._input.length()%this.blockSize;if(!this._decrypt&&this.mode.pad&&
227
-!this.mode.pad(this._input,b))return!1;this._finish=!0;this.update();return this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,b)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,b)?!1:!0}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.cipher)return c.cipher;
228
-c.defined.cipher=!0;for(var p=0;p<e.length;++p)e[p](c);return c.cipher}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/cipher",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b){"string"===typeof b&&(b=a.util.createBuffer(b));if(a.util.isArray(b)&&
229
-4<b.length){var d=b;b=a.util.createBuffer();for(var e=0;e<d.length;++e)b.putByte(d[e])}a.util.isArray(b)||(b=[b.getInt32(),b.getInt32(),b.getInt32(),b.getInt32()]);return b}function d(a){a[a.length-1]=a[a.length-1]+1&4294967295}function e(a){return[a/4294967296|0,a&4294967295]}a.cipher=a.cipher||{};var w=a.cipher.modes=a.cipher.modes||{};w.ecb=function(a){a=a||{};this.name="ECB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=
230
-Array(this._ints)};w.ecb.prototype.start=function(a){};w.ecb.prototype.encrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c])};w.ecb.prototype.decrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.decrypt(this._inBlock,
231
-this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c])};w.ecb.prototype.pad=function(a,b){var c=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(c,c);return!0};w.ecb.prototype.unpad=function(a,b){if(0<b.overflow)return!1;var c=a.length(),c=a.at(c-1);if(c>this.blockSize<<2)return!1;a.truncate(c);return!0};w.cbc=function(a){a=a||{};this.name="CBC";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);
232
-this._outBlock=Array(this._ints)};w.cbc.prototype.start=function(a){if(null===a.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=c(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};w.cbc.prototype.encrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=this._prev[c]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c]);
233
-this._prev=this._outBlock};w.cbc.prototype.decrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._prev[c]^this._outBlock[c]);this._prev=this._inBlock.slice(0)};w.cbc.prototype.pad=function(a,b){var c=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(c,c);return!0};w.cbc.prototype.unpad=function(a,
234
-b){if(0<b.overflow)return!1;var c=a.length(),c=a.at(c-1);if(c>this.blockSize<<2)return!1;a.truncate(c);return!0};w.cfb=function(b){b=b||{};this.name="CFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};w.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock=
235
-this._iv.slice(0);this._partialBytes=0};w.cfb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=a.getInt32()^this._outBlock[n],b.putInt32(this._inBlock[n]);else{var e=(this.blockSize-d)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialBlock[n]=a.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);
236
-if(0<e)a.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};w.cfb.prototype.decrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&
227
+!this.mode.pad(this._input,b))return!1;this._finish=!0;this.update();return this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,b)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,b)?!1:!0}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.cipher)return c.cipher;
228
+c.defined.cipher=!0;for(var m=0;m<e.length;++m)e[m](c);return c.cipher}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/cipher",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b){"string"===typeof b&&(b=a.util.createBuffer(b));if(a.util.isArray(b)&&
229
+4<b.length){var d=b;b=a.util.createBuffer();for(var g=0;g<d.length;++g)b.putByte(d[g])}a.util.isArray(b)||(b=[b.getInt32(),b.getInt32(),b.getInt32(),b.getInt32()]);return b}function d(a){a[a.length-1]=a[a.length-1]+1&4294967295}function e(a){return[a/4294967296|0,a&4294967295]}a.cipher=a.cipher||{};var v=a.cipher.modes=a.cipher.modes||{};v.ecb=function(a){a=a||{};this.name="ECB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=
230
+Array(this._ints)};v.ecb.prototype.start=function(a){};v.ecb.prototype.encrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c])};v.ecb.prototype.decrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.decrypt(this._inBlock,
231
+this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c])};v.ecb.prototype.pad=function(a,b){var c=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(c,c);return!0};v.ecb.prototype.unpad=function(a,b){if(0<b.overflow)return!1;var c=a.length(),c=a.at(c-1);if(c>this.blockSize<<2)return!1;a.truncate(c);return!0};v.cbc=function(a){a=a||{};this.name="CBC";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);
232
+this._outBlock=Array(this._ints)};v.cbc.prototype.start=function(a){if(null===a.iv){if(!this._prev)throw Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else if("iv"in a)this._iv=c(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};v.cbc.prototype.encrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=this._prev[c]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._outBlock[c]);
233
+this._prev=this._outBlock};v.cbc.prototype.decrypt=function(a,b,c){if(a.length()<this.blockSize&&!(c&&0<a.length()))return!0;for(c=0;c<this._ints;++c)this._inBlock[c]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(c=0;c<this._ints;++c)b.putInt32(this._prev[c]^this._outBlock[c]);this._prev=this._inBlock.slice(0)};v.cbc.prototype.pad=function(a,b){var c=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(c,c);return!0};v.cbc.prototype.unpad=function(a,
234
+b){if(0<b.overflow)return!1;var c=a.length(),c=a.at(c-1);if(c>this.blockSize<<2)return!1;a.truncate(c);return!0};v.cfb=function(b){b=b||{};this.name="CFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};v.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock=
235
+this._iv.slice(0);this._partialBytes=0};v.cfb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=a.getInt32()^this._outBlock[n],b.putInt32(this._inBlock[n]);else{var e=(this.blockSize-d)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialBlock[n]=a.getInt32()^this._outBlock[n],this._partialOutput.putInt32(this._partialBlock[n]);
236
+if(0<e)a.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};v.cfb.prototype.decrypt=function(a,b,c){var d=a.length();if(0===d)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&
237
d>=this.blockSize)for(var n=0;n<this._ints;++n)this._inBlock[n]=a.getInt32(),b.putInt32(this._inBlock[n]^this._outBlock[n]);else{var e=(this.blockSize-d)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialBlock[n]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[n]^this._outBlock[n]);if(0<e)a.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._partialBlock[n];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);
238
-if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};w.ofb=function(b){b=b||{};this.name="OFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};w.ofb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");
239
-this._iv=c(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};w.ofb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===a.length())return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;n<this._ints;++n)b.putInt32(a.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];else{var e=(this.blockSize-d)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialOutput.putInt32(a.getInt32()^
240
-this._outBlock[n]);if(0<e)a.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};w.ofb.prototype.decrypt=w.ofb.prototype.encrypt;w.ctr=function(b){b=b||{};this.name="CTR";this.cipher=b.cipher;this.blockSize=
241
-b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};w.ctr.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};w.ctr.prototype.encrypt=function(a,b,c){var n=a.length();if(0===n)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&n>=this.blockSize)for(var e=0;e<
242
-this._ints;++e)b.putInt32(a.getInt32()^this._outBlock[e]);else{var p=(this.blockSize-n)%this.blockSize;0<p&&(p=this.blockSize-p);this._partialOutput.clear();for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);0<p&&(a.read-=this.blockSize);0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<p&&!c)return b.putBytes(this._partialOutput.getBytes(p-this._partialBytes)),this._partialBytes=p,!0;b.putBytes(this._partialOutput.getBytes(n-this._partialBytes));
243
-this._partialBytes=0}d(this._inBlock)};w.ctr.prototype.decrypt=w.ctr.prototype.encrypt;w.gcm=function(b){b=b||{};this.name="GCM";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0;this._R=3774873600};w.gcm.prototype.start=function(b){if(!("iv"in b))throw Error("Invalid IV parameter.");var c=a.util.createBuffer(b.iv);this._cipherLength=0;var g;
238
+if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};v.ofb=function(b){b=b||{};this.name="OFB";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};v.ofb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");
239
+this._iv=c(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};v.ofb.prototype.encrypt=function(a,b,c){var d=a.length();if(0===a.length())return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&d>=this.blockSize)for(var n=0;n<this._ints;++n)b.putInt32(a.getInt32()^this._outBlock[n]),this._inBlock[n]=this._outBlock[n];else{var e=(this.blockSize-d)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(n=0;n<this._ints;++n)this._partialOutput.putInt32(a.getInt32()^
240
+this._outBlock[n]);if(0<e)a.read-=this.blockSize;else for(n=0;n<this._ints;++n)this._inBlock[n]=this._outBlock[n];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!c)return b.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;b.putBytes(this._partialOutput.getBytes(d-this._partialBytes));this._partialBytes=0}};v.ofb.prototype.decrypt=v.ofb.prototype.encrypt;v.ctr=function(b){b=b||{};this.name="CTR";this.cipher=b.cipher;this.blockSize=
241
+b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0};v.ctr.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=c(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};v.ctr.prototype.encrypt=function(a,b,c){var n=a.length();if(0===n)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&n>=this.blockSize)for(var e=0;e<
242
+this._ints;++e)b.putInt32(a.getInt32()^this._outBlock[e]);else{var k=(this.blockSize-n)%this.blockSize;0<k&&(k=this.blockSize-k);this._partialOutput.clear();for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);0<k&&(a.read-=this.blockSize);0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<k&&!c)return b.putBytes(this._partialOutput.getBytes(k-this._partialBytes)),this._partialBytes=k,!0;b.putBytes(this._partialOutput.getBytes(n-this._partialBytes));
243
+this._partialBytes=0}d(this._inBlock)};v.ctr.prototype.decrypt=v.ctr.prototype.encrypt;v.gcm=function(b){b=b||{};this.name="GCM";this.cipher=b.cipher;this.blockSize=b.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints);this._partialOutput=a.util.createBuffer();this._partialBytes=0;this._R=3774873600};v.gcm.prototype.start=function(b){if(!("iv"in b))throw Error("Invalid IV parameter.");var c=a.util.createBuffer(b.iv);this._cipherLength=0;var g;
244
g="additionalData"in b?a.util.createBuffer(b.additionalData):a.util.createBuffer();this._tagLength="tagLength"in b?b.tagLength:128;this._tag=null;if(b.decrypt&&(this._tag=a.util.createBuffer(b.tag).getBytes(),this._tag.length!==this._tagLength/8))throw Error("Authentication tag does not match tag length.");this._hashBlock=Array(this._ints);this.tag=null;this._hashSubkey=Array(this._ints);this.cipher.encrypt([0,0,0,0],this._hashSubkey);this.componentBits=4;this._m=this.generateHashTable(this._hashSubkey,
245
this.componentBits);b=c.length();if(12===b)this._j0=[c.getInt32(),c.getInt32(),c.getInt32(),1];else{for(this._j0=[0,0,0,0];0<c.length();)this._j0=this.ghash(this._hashSubkey,this._j0,[c.getInt32(),c.getInt32(),c.getInt32(),c.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(e(8*b)))}this._inBlock=this._j0.slice(0);d(this._inBlock);this._partialBytes=0;g=a.util.createBuffer(g);this._aDataLength=e(8*g.length());(c=g.length()%this.blockSize)&&g.fillWithByte(0,this.blockSize-c);
246
-for(this._s=[0,0,0,0];0<g.length();)this._s=this.ghash(this._hashSubkey,this._s,[g.getInt32(),g.getInt32(),g.getInt32(),g.getInt32()])};w.gcm.prototype.encrypt=function(a,b,c){var n=a.length();if(0===n)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&n>=this.blockSize){for(var e=0;e<this._ints;++e)b.putInt32(this._outBlock[e]^=a.getInt32());this._cipherLength+=this.blockSize}else{var p=(this.blockSize-n)%this.blockSize;0<p&&(p=this.blockSize-p);this._partialOutput.clear();
247
-for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);if(0===p||c){c?(e=n%this.blockSize,this._cipherLength+=e,this._partialOutput.truncate(this.blockSize-e)):this._cipherLength+=this.blockSize;for(e=0;e<this._ints;++e)this._outBlock[e]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<p&&!c)return a.read-=this.blockSize,b.putBytes(this._partialOutput.getBytes(p-this._partialBytes)),
248
-this._partialBytes=p,!0;b.putBytes(this._partialOutput.getBytes(n-this._partialBytes));this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock);d(this._inBlock)};w.gcm.prototype.decrypt=function(a,b,c){var n=a.length();if(n<this.blockSize&&!(c&&0<n))return!0;this.cipher.encrypt(this._inBlock,this._outBlock);d(this._inBlock);this._hashBlock[0]=a.getInt32();this._hashBlock[1]=a.getInt32();this._hashBlock[2]=a.getInt32();this._hashBlock[3]=a.getInt32();this._s=this.ghash(this._hashSubkey,
249
-this._s,this._hashBlock);for(a=0;a<this._ints;++a)b.putInt32(this._outBlock[a]^this._hashBlock[a]);this._cipherLength=n<this.blockSize?this._cipherLength+n%this.blockSize:this._cipherLength+this.blockSize};w.gcm.prototype.afterFinish=function(b,c){var d=!0;c.decrypt&&c.overflow&&b.truncate(this.blockSize-c.overflow);this.tag=a.util.createBuffer();var p=this._aDataLength.concat(e(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,p);p=[];this.cipher.encrypt(this._j0,p);for(var r=0;r<
250
-this._ints;++r)this.tag.putInt32(this._s[r]^p[r]);this.tag.truncate(this.tag.length()%(this._tagLength/8));c.decrypt&&this.tag.bytes()!==this._tag&&(d=!1);return d};w.gcm.prototype.multiply=function(a,b){for(var c=[0,0,0,0],d=b.slice(0),n=0;128>n;++n)a[n/32|0]&1<<31-n%32&&(c[0]^=d[0],c[1]^=d[1],c[2]^=d[2],c[3]^=d[3]),this.pow(d,d);return c};w.gcm.prototype.pow=function(a,b){for(var c=a[3]&1,d=3;0<d;--d)b[d]=a[d]>>>1|(a[d-1]&1)<<31;b[0]=a[0]>>>1;c&&(b[0]^=this._R)};w.gcm.prototype.tableMultiply=function(a){for(var b=
251
-[0,0,0,0],c=0;32>c;++c){var d=this._m[c][a[c/8|0]>>>4*(7-c%8)&15];b[0]^=d[0];b[1]^=d[1];b[2]^=d[2];b[3]^=d[3]}return b};w.gcm.prototype.ghash=function(a,b,c){b[0]^=c[0];b[1]^=c[1];b[2]^=c[2];b[3]^=c[3];return this.tableMultiply(b)};w.gcm.prototype.generateHashTable=function(a,b){for(var c=8/b,d=4*c,c=16*c,n=Array(c),e=0;e<c;++e){var p=[0,0,0,0];p[e/d|0]=1<<b-1<<(d-1-e%d)*b;n[e]=this.generateSubHashTable(this.multiply(p,a),b)}return n};w.gcm.prototype.generateSubHashTable=function(a,b){var c=1<<b,
252
-d=c>>>1,n=Array(c);n[d]=a.slice(0);for(var e=d>>>1;0<e;)this.pow(n[2*e],n[e]=[]),e>>=1;for(e=2;e<d;){for(var p=1;p<e;++p){var m=n[e],w=n[p];n[e+p]=[m[0]^w[0],m[1]^w[1],m[2]^w[2],m[3]^w[3]]}e*=2}n[0]=[0,0,0,0];for(e=d+1;e<c;++e)p=n[e^d],n[e]=[a[0]^p[0],a[1]^p[1],a[2]^p[2],a[3]^p[3]];return n}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=
253
-k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.cipherModes)return c.cipherModes;c.defined.cipherModes=!0;for(var p=0;p<e.length;++p)e[p](c);return c.cipherModes}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/cipherModes",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,
254
-0))})})();(function(){function b(a){function c(b,d){a.cipher.registerAlgorithm(b,function(){return new a.aes.Algorithm(b,d)})}function d(){v=!0;E=[0,1,2,4,8,16,32,64,128,27,54];for(var a=Array(256),b=0;128>b;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;l=Array(256);r=Array(256);z=Array(4);B=Array(4);for(b=0;4>b;++b)z[b]=Array(256),B[b]=Array(256);for(var c=0,n=0,e,h,g,p,m,b=0;256>b;++b){p=n^n<<1^n<<2^n<<3^n<<4;p=p>>8^p&255^99;l[c]=p;r[p]=c;m=a[p];e=a[c];h=a[e];g=a[h];m^=m<<24^p<<16^p<<8^p;h=(e^h^g)<<24^(c^
255
-g)<<16^(c^h^g)<<8^c^e^g;for(var w=0;4>w;++w)z[w][c]=m,B[w][p]=h,m=m<<24|m>>>8,h=h<<24|h>>>8;0===c?c=n=1:(c=e^a[a[a[e^g]]],n^=a[a[n]])}}function e(a,b){for(var c=a.slice(0),d,n=1,h=c.length,r=g*(h+6+1),p=h;p<r;++p)d=c[p-1],0===p%h?(d=l[d>>>16&255]<<24^l[d>>>8&255]<<16^l[d&255]<<8^l[d>>>24]^E[n]<<24,n++):6<h&&4===p%h&&(d=l[d>>>24]<<24^l[d>>>16&255]<<16^l[d>>>8&255]<<8^l[d&255]),c[p]=c[p-h]^d;if(b){for(var n=B[0],h=B[1],m=B[2],v=B[3],w=c.slice(0),r=c.length,p=0,z=r-g;p<r;p+=g,z-=g)if(0===p||p===r-g)w[p]=
256
-c[z],w[p+1]=c[z+3],w[p+2]=c[z+2],w[p+3]=c[z+1];else for(var x=0;x<g;++x)d=c[z+x],w[p+(3&-x)]=n[l[d>>>24]]^h[l[d>>>16&255]]^m[l[d>>>8&255]]^v[l[d&255]];c=w}return c}function w(a,b,c,d){var n=a.length/4-1,e,h,g,p,m;d?(e=B[0],h=B[1],g=B[2],p=B[3],m=r):(e=z[0],h=z[1],g=z[2],p=z[3],m=l);var v,w,x,E,k,u;v=b[0]^a[0];w=b[d?3:1]^a[1];x=b[2]^a[2];b=b[d?1:3]^a[3];for(var U=3,Z=1;Z<n;++Z)E=e[v>>>24]^h[w>>>16&255]^g[x>>>8&255]^p[b&255]^a[++U],k=e[w>>>24]^h[x>>>16&255]^g[b>>>8&255]^p[v&255]^a[++U],u=e[x>>>24]^
257
-h[b>>>16&255]^g[v>>>8&255]^p[w&255]^a[++U],b=e[b>>>24]^h[v>>>16&255]^g[w>>>8&255]^p[x&255]^a[++U],v=E,w=k,x=u;c[0]=m[v>>>24]<<24^m[w>>>16&255]<<16^m[x>>>8&255]<<8^m[b&255]^a[++U];c[d?3:1]=m[w>>>24]<<24^m[x>>>16&255]<<16^m[b>>>8&255]<<8^m[v&255]^a[++U];c[2]=m[x>>>24]<<24^m[b>>>16&255]<<16^m[v>>>8&255]<<8^m[w&255]^a[++U];c[d?1:3]=m[b>>>24]<<24^m[v>>>16&255]<<16^m[w>>>8&255]<<8^m[x&255]^a[++U]}function h(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):
258
-a.cipher.createCipher(c,b.key);var e=d.start;d.start=function(b,c){var h=null;c instanceof a.util.ByteBuffer&&(h=c,c={});c=c||{};c.output=h;c.iv=b;e.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!1,mode:d});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return h({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!0,mode:d});a.start(b);return a};a.aes.createDecryptionCipher=
259
-function(a,b){return h({key:a,output:null,decrypt:!0,mode:b})};a.aes.Algorithm=function(a,b){v||d();var c=this;c.name=a;c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return w(c._w,a,b,!1)},decrypt:function(a,b){return w(c._w,a,b,!0)}}});c._init=!1};a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c=b.key,d;if("string"===typeof c&&(16===c.length||24===c.length||32===c.length))c=a.util.createBuffer(c);else if(a.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){d=
260
-c;for(var c=a.util.createBuffer(),h=0;h<d.length;++h)c.putByte(d[h])}if(!a.util.isArray(c)){d=c;var c=[],y=d.length();if(16===y||24===y||32===y)for(y>>>=2,h=0;h<y;++h)c.push(d.getInt32())}if(!a.util.isArray(c)||4!==c.length&&6!==c.length&&8!==c.length)throw Error("Invalid key parameter.");d=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=e(c,b.decrypt&&!d);this._init=!0}};a.aes._expandKey=function(a,b){v||d();return e(a,b)};a.aes._updateBlock=w;c("AES-ECB",a.cipher.modes.ecb);c("AES-CBC",
261
-a.cipher.modes.cbc);c("AES-CFB",a.cipher.modes.cfb);c("AES-OFB",a.cipher.modes.ofb);c("AES-CTR",a.cipher.modes.ctr);c("AES-GCM",a.cipher.modes.gcm);var v=!1,g=4,l,r,E,z,B}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aes)return c.aes;c.defined.aes=
262
-!0;for(var p=0;p<e.length;++p)e[p](c);return c.aes}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/aes",["require","module","./cipher","./cipherModes","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.pki=a.pki||{};a=a.pki.oids=a.oids=a.oids||{};a["1.2.840.113549.1.1.1"]="rsaEncryption";
246
+for(this._s=[0,0,0,0];0<g.length();)this._s=this.ghash(this._hashSubkey,this._s,[g.getInt32(),g.getInt32(),g.getInt32(),g.getInt32()])};v.gcm.prototype.encrypt=function(a,b,c){var n=a.length();if(0===n)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&n>=this.blockSize){for(var e=0;e<this._ints;++e)b.putInt32(this._outBlock[e]^=a.getInt32());this._cipherLength+=this.blockSize}else{var k=(this.blockSize-n)%this.blockSize;0<k&&(k=this.blockSize-k);this._partialOutput.clear();
247
+for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);if(0===k||c){c?(e=n%this.blockSize,this._cipherLength+=e,this._partialOutput.truncate(this.blockSize-e)):this._cipherLength+=this.blockSize;for(e=0;e<this._ints;++e)this._outBlock[e]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<k&&!c)return a.read-=this.blockSize,b.putBytes(this._partialOutput.getBytes(k-this._partialBytes)),
248
+this._partialBytes=k,!0;b.putBytes(this._partialOutput.getBytes(n-this._partialBytes));this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock);d(this._inBlock)};v.gcm.prototype.decrypt=function(a,b,c){var n=a.length();if(n<this.blockSize&&!(c&&0<n))return!0;this.cipher.encrypt(this._inBlock,this._outBlock);d(this._inBlock);this._hashBlock[0]=a.getInt32();this._hashBlock[1]=a.getInt32();this._hashBlock[2]=a.getInt32();this._hashBlock[3]=a.getInt32();this._s=this.ghash(this._hashSubkey,
249
+this._s,this._hashBlock);for(a=0;a<this._ints;++a)b.putInt32(this._outBlock[a]^this._hashBlock[a]);this._cipherLength=n<this.blockSize?this._cipherLength+n%this.blockSize:this._cipherLength+this.blockSize};v.gcm.prototype.afterFinish=function(b,c){var d=!0;c.decrypt&&c.overflow&&b.truncate(this.blockSize-c.overflow);this.tag=a.util.createBuffer();var m=this._aDataLength.concat(e(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,m);m=[];this.cipher.encrypt(this._j0,m);for(var u=0;u<
250
+this._ints;++u)this.tag.putInt32(this._s[u]^m[u]);this.tag.truncate(this.tag.length()%(this._tagLength/8));c.decrypt&&this.tag.bytes()!==this._tag&&(d=!1);return d};v.gcm.prototype.multiply=function(a,b){for(var c=[0,0,0,0],d=b.slice(0),n=0;128>n;++n)a[n/32|0]&1<<31-n%32&&(c[0]^=d[0],c[1]^=d[1],c[2]^=d[2],c[3]^=d[3]),this.pow(d,d);return c};v.gcm.prototype.pow=function(a,b){for(var c=a[3]&1,d=3;0<d;--d)b[d]=a[d]>>>1|(a[d-1]&1)<<31;b[0]=a[0]>>>1;c&&(b[0]^=this._R)};v.gcm.prototype.tableMultiply=function(a){for(var b=
251
+[0,0,0,0],c=0;32>c;++c){var d=this._m[c][a[c/8|0]>>>4*(7-c%8)&15];b[0]^=d[0];b[1]^=d[1];b[2]^=d[2];b[3]^=d[3]}return b};v.gcm.prototype.ghash=function(a,b,c){b[0]^=c[0];b[1]^=c[1];b[2]^=c[2];b[3]^=c[3];return this.tableMultiply(b)};v.gcm.prototype.generateHashTable=function(a,b){for(var c=8/b,d=4*c,c=16*c,n=Array(c),e=0;e<c;++e){var k=[0,0,0,0];k[e/d|0]=1<<b-1<<(d-1-e%d)*b;n[e]=this.generateSubHashTable(this.multiply(k,a),b)}return n};v.gcm.prototype.generateSubHashTable=function(a,b){var c=1<<b,
252
+d=c>>>1,n=Array(c);n[d]=a.slice(0);for(var e=d>>>1;0<e;)this.pow(n[2*e],n[e]=[]),e>>=1;for(e=2;e<d;){for(var k=1;k<e;++k){var m=n[e],v=n[k];n[e+k]=[m[0]^v[0],m[1]^v[1],m[2]^v[2],m[3]^v[3]]}e*=2}n[0]=[0,0,0,0];for(e=d+1;e<c;++e)k=n[e^d],n[e]=[a[0]^k[0],a[1]^k[1],a[2]^k[2],a[3]^k[3]];return n}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=
253
+q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.cipherModes)return c.cipherModes;c.defined.cipherModes=!0;for(var m=0;m<e.length;++m)e[m](c);return c.cipherModes}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/cipherModes",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,
254
+0))})})();(function(){function b(a){function c(b,d){a.cipher.registerAlgorithm(b,function(){return new a.aes.Algorithm(b,d)})}function d(){l=!0;q=[0,1,2,4,8,16,32,64,128,27,54];for(var a=Array(256),b=0;128>b;++b)a[b]=b<<1,a[b+128]=b+128<<1^283;I=Array(256);u=Array(256);z=Array(4);x=Array(4);for(b=0;4>b;++b)z[b]=Array(256),x[b]=Array(256);for(var c=0,g=0,n,e,k,m,p,b=0;256>b;++b){m=g^g<<1^g<<2^g<<3^g<<4;m=m>>8^m&255^99;I[c]=m;u[m]=c;p=a[m];n=a[c];e=a[n];k=a[e];p^=p<<24^m<<16^m<<8^m;e=(n^e^k)<<24^(c^
255
+k)<<16^(c^e^k)<<8^c^n^k;for(var v=0;4>v;++v)z[v][c]=p,x[v][m]=e,p=p<<24|p>>>8,e=e<<24|e>>>8;0===c?c=g=1:(c=n^a[a[a[n^k]]],g^=a[a[g]])}}function e(a,b){for(var c=a.slice(0),d,n=1,l=c.length,k=g*(l+6+1),m=l;m<k;++m)d=c[m-1],0===m%l?(d=I[d>>>16&255]<<24^I[d>>>8&255]<<16^I[d&255]<<8^I[d>>>24]^q[n]<<24,n++):6<l&&4===m%l&&(d=I[d>>>24]<<24^I[d>>>16&255]<<16^I[d>>>8&255]<<8^I[d&255]),c[m]=c[m-l]^d;if(b){for(var n=x[0],l=x[1],p=x[2],u=x[3],v=c.slice(0),k=c.length,m=0,z=k-g;m<k;m+=g,z-=g)if(0===m||m===k-g)v[m]=
256
+c[z],v[m+1]=c[z+3],v[m+2]=c[z+2],v[m+3]=c[z+1];else for(var h=0;h<g;++h)d=c[z+h],v[m+(3&-h)]=n[I[d>>>24]]^l[I[d>>>16&255]]^p[I[d>>>8&255]]^u[I[d&255]];c=v}return c}function v(a,b,c,d){var g=a.length/4-1,n,e,l,k,m;d?(n=x[0],e=x[1],l=x[2],k=x[3],m=u):(n=z[0],e=z[1],l=z[2],k=z[3],m=I);var v,h,w,q,B,D;v=b[0]^a[0];h=b[d?3:1]^a[1];w=b[2]^a[2];b=b[d?1:3]^a[3];for(var r=3,aa=1;aa<g;++aa)q=n[v>>>24]^e[h>>>16&255]^l[w>>>8&255]^k[b&255]^a[++r],B=n[h>>>24]^e[w>>>16&255]^l[b>>>8&255]^k[v&255]^a[++r],D=n[w>>>24]^
257
+e[b>>>16&255]^l[v>>>8&255]^k[h&255]^a[++r],b=n[b>>>24]^e[v>>>16&255]^l[h>>>8&255]^k[w&255]^a[++r],v=q,h=B,w=D;c[0]=m[v>>>24]<<24^m[h>>>16&255]<<16^m[w>>>8&255]<<8^m[b&255]^a[++r];c[d?3:1]=m[h>>>24]<<24^m[w>>>16&255]<<16^m[b>>>8&255]<<8^m[v&255]^a[++r];c[2]=m[w>>>24]<<24^m[b>>>16&255]<<16^m[v>>>8&255]<<8^m[h&255]^a[++r];c[d?1:3]=m[b>>>24]<<24^m[v>>>16&255]<<16^m[h>>>8&255]<<8^m[w&255]^a[++r]}function h(b){b=b||{};var c="AES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):
258
+a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e=null;c instanceof a.util.ByteBuffer&&(e=c,c={});c=c||{};c.output=e;c.iv=b;g.call(d,c)};return d}a.aes=a.aes||{};a.aes.startEncrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!1,mode:d});a.start(b);return a};a.aes.createEncryptionCipher=function(a,b){return h({key:a,output:null,decrypt:!1,mode:b})};a.aes.startDecrypting=function(a,b,c,d){a=h({key:a,output:c,decrypt:!0,mode:d});a.start(b);return a};a.aes.createDecryptionCipher=
259
+function(a,b){return h({key:a,output:null,decrypt:!0,mode:b})};a.aes.Algorithm=function(a,b){l||d();var c=this;c.name=a;c.mode=new b({blockSize:16,cipher:{encrypt:function(a,b){return v(c._w,a,b,!1)},decrypt:function(a,b){return v(c._w,a,b,!0)}}});c._init=!1};a.aes.Algorithm.prototype.initialize=function(b){if(!this._init){var c=b.key,d;if("string"===typeof c&&(16===c.length||24===c.length||32===c.length))c=a.util.createBuffer(c);else if(a.util.isArray(c)&&(16===c.length||24===c.length||32===c.length)){d=
260
+c;for(var c=a.util.createBuffer(),g=0;g<d.length;++g)c.putByte(d[g])}if(!a.util.isArray(c)){d=c;var c=[],y=d.length();if(16===y||24===y||32===y)for(y>>>=2,g=0;g<y;++g)c.push(d.getInt32())}if(!a.util.isArray(c)||4!==c.length&&6!==c.length&&8!==c.length)throw Error("Invalid key parameter.");d=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=e(c,b.decrypt&&!d);this._init=!0}};a.aes._expandKey=function(a,b){l||d();return e(a,b)};a.aes._updateBlock=v;c("AES-ECB",a.cipher.modes.ecb);c("AES-CBC",
261
+a.cipher.modes.cbc);c("AES-CFB",a.cipher.modes.cfb);c("AES-OFB",a.cipher.modes.ofb);c("AES-CTR",a.cipher.modes.ctr);c("AES-GCM",a.cipher.modes.gcm);var l=!1,g=4,I,u,q,z,x}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aes)return c.aes;c.defined.aes=
262
+!0;for(var m=0;m<e.length;++m)e[m](c);return c.aes}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/aes",["require","module","./cipher","./cipherModes","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.pki=a.pki||{};a=a.pki.oids=a.oids=a.oids||{};a["1.2.840.113549.1.1.1"]="rsaEncryption";
263
a.rsaEncryption="1.2.840.113549.1.1.1";a["1.2.840.113549.1.1.4"]="md5WithRSAEncryption";a.md5WithRSAEncryption="1.2.840.113549.1.1.4";a["1.2.840.113549.1.1.5"]="sha1WithRSAEncryption";a.sha1WithRSAEncryption="1.2.840.113549.1.1.5";a["1.2.840.113549.1.1.7"]="RSAES-OAEP";a["RSAES-OAEP"]="1.2.840.113549.1.1.7";a["1.2.840.113549.1.1.8"]="mgf1";a.mgf1="1.2.840.113549.1.1.8";a["1.2.840.113549.1.1.9"]="pSpecified";a.pSpecified="1.2.840.113549.1.1.9";a["1.2.840.113549.1.1.10"]="RSASSA-PSS";a["RSASSA-PSS"]=
264
"1.2.840.113549.1.1.10";a["1.2.840.113549.1.1.11"]="sha256WithRSAEncryption";a.sha256WithRSAEncryption="1.2.840.113549.1.1.11";a["1.2.840.113549.1.1.12"]="sha384WithRSAEncryption";a.sha384WithRSAEncryption="1.2.840.113549.1.1.12";a["1.2.840.113549.1.1.13"]="sha512WithRSAEncryption";a.sha512WithRSAEncryption="1.2.840.113549.1.1.13";a["1.3.14.3.2.7"]="desCBC";a.desCBC="1.3.14.3.2.7";a["1.3.14.3.2.26"]="sha1";a.sha1="1.3.14.3.2.26";a["2.16.840.1.101.3.4.2.1"]="sha256";a.sha256="2.16.840.1.101.3.4.2.1";
265
a["2.16.840.1.101.3.4.2.2"]="sha384";a.sha384="2.16.840.1.101.3.4.2.2";a["2.16.840.1.101.3.4.2.3"]="sha512";a.sha512="2.16.840.1.101.3.4.2.3";a["1.2.840.113549.2.5"]="md5";a.md5="1.2.840.113549.2.5";a["1.2.840.113549.1.7.1"]="data";a.data="1.2.840.113549.1.7.1";a["1.2.840.113549.1.7.2"]="signedData";a.signedData="1.2.840.113549.1.7.2";a["1.2.840.113549.1.7.3"]="envelopedData";a.envelopedData="1.2.840.113549.1.7.3";a["1.2.840.113549.1.7.4"]="signedAndEnvelopedData";a.signedAndEnvelopedData="1.2.840.113549.1.7.4";
@@ -273,215 +273,215 @@ a["2.5.4.8"]="stateOrProvinceName";a.stateOrProvinceName="2.5.4.8";a["2.5.4.10"]
273
"subjectAltName";a["2.5.29.8"]="issuerAltName";a["2.5.29.9"]="subjectDirectoryAttributes";a["2.5.29.10"]="basicConstraints";a["2.5.29.11"]="nameConstraints";a["2.5.29.12"]="policyConstraints";a["2.5.29.13"]="basicConstraints";a["2.5.29.14"]="subjectKeyIdentifier";a.subjectKeyIdentifier="2.5.29.14";a["2.5.29.15"]="keyUsage";a.keyUsage="2.5.29.15";a["2.5.29.16"]="privateKeyUsagePeriod";a["2.5.29.17"]="subjectAltName";a.subjectAltName="2.5.29.17";a["2.5.29.18"]="issuerAltName";a.issuerAltName="2.5.29.18";
274
a["2.5.29.19"]="basicConstraints";a.basicConstraints="2.5.29.19";a["2.5.29.20"]="cRLNumber";a["2.5.29.21"]="cRLReason";a["2.5.29.22"]="expirationDate";a["2.5.29.23"]="instructionCode";a["2.5.29.24"]="invalidityDate";a["2.5.29.25"]="cRLDistributionPoints";a["2.5.29.26"]="issuingDistributionPoint";a["2.5.29.27"]="deltaCRLIndicator";a["2.5.29.28"]="issuingDistributionPoint";a["2.5.29.29"]="certificateIssuer";a["2.5.29.30"]="nameConstraints";a["2.5.29.31"]="cRLDistributionPoints";a["2.5.29.32"]="certificatePolicies";
275
a["2.5.29.33"]="policyMappings";a["2.5.29.34"]="policyConstraints";a["2.5.29.35"]="authorityKeyIdentifier";a["2.5.29.36"]="policyConstraints";a["2.5.29.37"]="extKeyUsage";a.extKeyUsage="2.5.29.37";a["2.5.29.46"]="freshestCRL";a["2.5.29.54"]="inhibitAnyPolicy";a["1.3.6.1.5.5.7.3.1"]="serverAuth";a.serverAuth="1.3.6.1.5.5.7.3.1";a["1.3.6.1.5.5.7.3.2"]="clientAuth";a.clientAuth="1.3.6.1.5.5.7.3.2";a["1.3.6.1.5.5.7.3.3"]="codeSigning";a.codeSigning="1.3.6.1.5.5.7.3.3";a["1.3.6.1.5.5.7.3.4"]="emailProtection";
276
-a.emailProtection="1.3.6.1.5.5.7.3.4";a["1.3.6.1.5.5.7.3.8"]="timeStamping";a.timeStamping="1.3.6.1.5.5.7.3.8"}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.oids)return c.oids;c.defined.oids=!0;for(var p=0;p<e.length;++p)e[p](c);return c.oids}},
277
-u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/oids",["require","module"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1=a.asn1||{};c.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};c.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,
278
-ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};c.create=function(b,c,d,e){if(a.util.isArray(e)){for(var m=[],r=0;r<e.length;++r)void 0!==e[r]&&m.push(e[r]);e=m}return{tagClass:b,type:c,constructed:d,composed:d||a.util.isArray(e),value:e}};var d=c.getBerValueLength=function(a){var b=a.getByte();if(128!==b)return b&128?a.getInt((b&127)<<3):b};c.fromDer=function(b,e){void 0===e&&(e=!0);
279
-"string"===typeof b&&(b=a.util.createBuffer(b));if(2>b.length()){var m=Error("Too few bytes to parse DER.");m.bytes=b.length();throw m;}var g=b.getByte(),m=g&192,l=g&31,r=d(b);if(b.length()<r){if(e)throw m=Error("Too few bytes to read ASN.1 value."),m.detail=b.length()+" < "+r,m;r=b.length()}var E,z=32===(g&32);E=z;if(!E&&m===c.Class.UNIVERSAL&&l===c.Type.BITSTRING&&1<r){var B=b.read;if(0===b.getByte()&&(g=b.getByte(),g&=192,g===c.Class.UNIVERSAL||g===c.Class.CONTEXT_SPECIFIC))try{if(E=d(b)===r-(b.read-
280
-B))++B,--r}catch(k){}b.read=B}if(E)if(E=[],void 0===r)for(;;){if(b.bytes(2)===String.fromCharCode(0,0)){b.getBytes(2);break}E.push(c.fromDer(b,e))}else for(B=b.length();0<r;)E.push(c.fromDer(b,e)),r-=B-b.length(),B=b.length();else{if(void 0===r){if(e)throw Error("Non-constructed ASN.1 object of indefinite length.");r=b.length()}if(l===c.Type.BMPSTRING)for(E="",B=0;B<r;B+=2)E+=String.fromCharCode(b.getInt16());else E=b.getBytes(r)}return c.create(m,l,z,E)};c.toDer=function(b){var d=a.util.createBuffer(),
281
-e=b.tagClass|b.type,g=a.util.createBuffer();if(b.composed){b.constructed?e|=32:g.putByte(0);for(var m=0;m<b.value.length;++m)void 0!==b.value[m]&&g.putBuffer(c.toDer(b.value[m]))}else if(b.type===c.Type.BMPSTRING)for(m=0;m<b.value.length;++m)g.putInt16(b.value.charCodeAt(m));else g.putBytes(b.value);d.putByte(e);if(127>=g.length())d.putByte(g.length()&127);else{m=g.length();b="";do b+=String.fromCharCode(m&255),m>>>=8;while(0<m);d.putByte(b.length|128);for(m=b.length-1;0<=m;--m)d.putByte(b.charCodeAt(m))}d.putBuffer(g);
282
-return d};c.oidToDer=function(b){b=b.split(".");var c=a.util.createBuffer();c.putByte(40*parseInt(b[0],10)+parseInt(b[1],10));for(var d,e,m,r,p=2;p<b.length;++p){d=!0;e=[];m=parseInt(b[p],10);do r=m&127,m>>>=7,d||(r|=128),e.push(r),d=!1;while(0<m);for(d=e.length-1;0<=d;--d)c.putByte(e[d])}return c};c.derToOid=function(b){var c;"string"===typeof b&&(b=a.util.createBuffer(b));var d=b.getByte();c=Math.floor(d/40)+"."+d%40;for(var e=0;0<b.length();)d=b.getByte(),e<<=7,d&128?e+=d&127:(c+="."+(e+d),e=0);
283
-return c};c.utcTimeToDate=function(a){var b=new Date,c=parseInt(a.substr(0,2),10),c=50<=c?1900+c:2E3+c,d=parseInt(a.substr(2,2),10)-1,e=parseInt(a.substr(4,2),10),n=parseInt(a.substr(6,2),10),m=parseInt(a.substr(8,2),10),p=0;if(11<a.length){var B=a.charAt(10),l=10;"+"!==B&&"-"!==B&&(p=parseInt(a.substr(10,2),10),l+=2)}b.setUTCFullYear(c,d,e);b.setUTCHours(n,m,p,0);l&&(B=a.charAt(l),"+"===B||"-"===B)&&(c=parseInt(a.substr(l+1,2),10),a=parseInt(a.substr(l+4,2),10),a=6E4*(60*c+a),"+"===B?b.setTime(+b-
284
-a):b.setTime(+b+a));return b};c.generalizedTimeToDate=function(a){var b=new Date,c=parseInt(a.substr(0,4),10),d=parseInt(a.substr(4,2),10)-1,e=parseInt(a.substr(6,2),10),n=parseInt(a.substr(8,2),10),m=parseInt(a.substr(10,2),10),p=parseInt(a.substr(12,2),10),B=0,l=0,x=!1;"Z"===a.charAt(a.length-1)&&(x=!0);var D=a.length-5,A=a.charAt(D);if("+"===A||"-"===A)l=parseInt(a.substr(D+1,2),10),D=parseInt(a.substr(D+4,2),10),l=6E4*(60*l+D),"+"===A&&(l*=-1),x=!0;"."===a.charAt(14)&&(B=1E3*parseFloat(a.substr(14),
285
-10));x?(b.setUTCFullYear(c,d,e),b.setUTCHours(n,m,p,B),b.setTime(+b+l)):(b.setFullYear(c,d,e),b.setHours(n,m,p,B));return b};c.dateToUtcTime=function(a){if("string"===typeof a)return a;var b="",c=[];c.push((""+a.getUTCFullYear()).substr(2));c.push(""+(a.getUTCMonth()+1));c.push(""+a.getUTCDate());c.push(""+a.getUTCHours());c.push(""+a.getUTCMinutes());c.push(""+a.getUTCSeconds());for(a=0;a<c.length;++a)2>c[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.dateToGeneralizedTime=function(a){if("string"===
276
+a.emailProtection="1.3.6.1.5.5.7.3.4";a["1.3.6.1.5.5.7.3.8"]="timeStamping";a.timeStamping="1.3.6.1.5.5.7.3.8"}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.oids)return c.oids;c.defined.oids=!0;for(var m=0;m<e.length;++m)e[m](c);return c.oids}},
277
+r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/oids",["require","module"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1=a.asn1||{};c.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};c.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,
278
+ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30};c.create=function(b,c,d,g){if(a.util.isArray(g)){for(var e=[],k=0;k<g.length;++k)void 0!==g[k]&&e.push(g[k]);g=e}return{tagClass:b,type:c,constructed:d,composed:d||a.util.isArray(g),value:g}};var d=c.getBerValueLength=function(a){var b=a.getByte();if(128!==b)return b&128?a.getInt((b&127)<<3):b};c.fromDer=function(b,e){void 0===e&&(e=!0);
279
+"string"===typeof b&&(b=a.util.createBuffer(b));if(2>b.length()){var l=Error("Too few bytes to parse DER.");l.bytes=b.length();throw l;}var g=b.getByte(),l=g&192,k=g&31,u=d(b);if(b.length()<u){if(e)throw l=Error("Too few bytes to read ASN.1 value."),l.detail=b.length()+" < "+u,l;u=b.length()}var h,z=32===(g&32);h=z;if(!h&&l===c.Class.UNIVERSAL&&k===c.Type.BITSTRING&&1<u){var x=b.read;if(0===b.getByte()&&(g=b.getByte(),g&=192,g===c.Class.UNIVERSAL||g===c.Class.CONTEXT_SPECIFIC))try{if(h=d(b)===u-(b.read-
280
+x))++x,--u}catch(F){}b.read=x}if(h)if(h=[],void 0===u)for(;;){if(b.bytes(2)===String.fromCharCode(0,0)){b.getBytes(2);break}h.push(c.fromDer(b,e))}else for(x=b.length();0<u;)h.push(c.fromDer(b,e)),u-=x-b.length(),x=b.length();else{if(void 0===u){if(e)throw Error("Non-constructed ASN.1 object of indefinite length.");u=b.length()}if(k===c.Type.BMPSTRING)for(h="",x=0;x<u;x+=2)h+=String.fromCharCode(b.getInt16());else h=b.getBytes(u)}return c.create(l,k,z,h)};c.toDer=function(b){var d=a.util.createBuffer(),
281
+e=b.tagClass|b.type,g=a.util.createBuffer();if(b.composed){b.constructed?e|=32:g.putByte(0);for(var k=0;k<b.value.length;++k)void 0!==b.value[k]&&g.putBuffer(c.toDer(b.value[k]))}else if(b.type===c.Type.BMPSTRING)for(k=0;k<b.value.length;++k)g.putInt16(b.value.charCodeAt(k));else g.putBytes(b.value);d.putByte(e);if(127>=g.length())d.putByte(g.length()&127);else{k=g.length();b="";do b+=String.fromCharCode(k&255),k>>>=8;while(0<k);d.putByte(b.length|128);for(k=b.length-1;0<=k;--k)d.putByte(b.charCodeAt(k))}d.putBuffer(g);
282
+return d};c.oidToDer=function(b){b=b.split(".");var c=a.util.createBuffer();c.putByte(40*parseInt(b[0],10)+parseInt(b[1],10));for(var d,g,e,k,m=2;m<b.length;++m){d=!0;g=[];e=parseInt(b[m],10);do k=e&127,e>>>=7,d||(k|=128),g.push(k),d=!1;while(0<e);for(d=g.length-1;0<=d;--d)c.putByte(g[d])}return c};c.derToOid=function(b){var c;"string"===typeof b&&(b=a.util.createBuffer(b));var d=b.getByte();c=Math.floor(d/40)+"."+d%40;for(var g=0;0<b.length();)d=b.getByte(),g<<=7,d&128?g+=d&127:(c+="."+(g+d),g=0);
283
+return c};c.utcTimeToDate=function(a){var b=new Date,c=parseInt(a.substr(0,2),10),c=50<=c?1900+c:2E3+c,d=parseInt(a.substr(2,2),10)-1,e=parseInt(a.substr(4,2),10),n=parseInt(a.substr(6,2),10),k=parseInt(a.substr(8,2),10),m=0;if(11<a.length){var x=a.charAt(10),h=10;"+"!==x&&"-"!==x&&(m=parseInt(a.substr(10,2),10),h+=2)}b.setUTCFullYear(c,d,e);b.setUTCHours(n,k,m,0);h&&(x=a.charAt(h),"+"===x||"-"===x)&&(c=parseInt(a.substr(h+1,2),10),a=parseInt(a.substr(h+4,2),10),a=6E4*(60*c+a),"+"===x?b.setTime(+b-
284
+a):b.setTime(+b+a));return b};c.generalizedTimeToDate=function(a){var b=new Date,c=parseInt(a.substr(0,4),10),d=parseInt(a.substr(4,2),10)-1,e=parseInt(a.substr(6,2),10),n=parseInt(a.substr(8,2),10),k=parseInt(a.substr(10,2),10),m=parseInt(a.substr(12,2),10),x=0,h=0,w=!1;"Z"===a.charAt(a.length-1)&&(w=!0);var E=a.length-5,A=a.charAt(E);if("+"===A||"-"===A)h=parseInt(a.substr(E+1,2),10),E=parseInt(a.substr(E+4,2),10),h=6E4*(60*h+E),"+"===A&&(h*=-1),w=!0;"."===a.charAt(14)&&(x=1E3*parseFloat(a.substr(14),
285
+10));w?(b.setUTCFullYear(c,d,e),b.setUTCHours(n,k,m,x),b.setTime(+b+h)):(b.setFullYear(c,d,e),b.setHours(n,k,m,x));return b};c.dateToUtcTime=function(a){if("string"===typeof a)return a;var b="",c=[];c.push((""+a.getUTCFullYear()).substr(2));c.push(""+(a.getUTCMonth()+1));c.push(""+a.getUTCDate());c.push(""+a.getUTCHours());c.push(""+a.getUTCMinutes());c.push(""+a.getUTCSeconds());for(a=0;a<c.length;++a)2>c[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.dateToGeneralizedTime=function(a){if("string"===
286
typeof a)return a;var b="",c=[];c.push(""+a.getUTCFullYear());c.push(""+(a.getUTCMonth()+1));c.push(""+a.getUTCDate());c.push(""+a.getUTCHours());c.push(""+a.getUTCMinutes());c.push(""+a.getUTCSeconds());for(a=0;a<c.length;++a)2>c[a].length&&(b+="0"),b+=c[a];return b+"Z"};c.integerToDer=function(b){var c=a.util.createBuffer();if(-128<=b&&128>b)return c.putSignedInt(b,8);if(-32768<=b&&32768>b)return c.putSignedInt(b,16);if(-8388608<=b&&8388608>b)return c.putSignedInt(b,24);if(-2147483648<=b&&2147483648>
287
-b)return c.putSignedInt(b,32);c=Error("Integer too large; max is 32-bits.");c.integer=b;throw c;};c.derToInteger=function(b){"string"===typeof b&&(b=a.util.createBuffer(b));var c=8*b.length();if(32<c)throw Error("Integer too large; max is 32-bits.");return b.getSignedInt(c)};c.validate=function(b,d,e,g){var m=!1;if(b.tagClass!==d.tagClass&&"undefined"!==typeof d.tagClass||b.type!==d.type&&"undefined"!==typeof d.type)g&&(b.tagClass!==d.tagClass&&g.push("["+d.name+'] Expected tag class "'+d.tagClass+
288
-'", got "'+b.tagClass+'"'),b.type!==d.type&&g.push("["+d.name+'] Expected type "'+d.type+'", got "'+b.type+'"'));else if(b.constructed===d.constructed||"undefined"===typeof d.constructed){m=!0;if(d.value&&a.util.isArray(d.value))for(var r=0,l=0;m&&l<d.value.length;++l)m=d.value[l].optional||!1,b.value[r]&&((m=c.validate(b.value[r],d.value[l],e,g))?++r:d.value[l].optional&&(m=!0)),!m&&g&&g.push("["+d.name+'] Tag class "'+d.tagClass+'", type "'+d.type+'" expected value length "'+d.value.length+'", got "'+
289
-b.value.length+'"');m&&e&&(d.capture&&(e[d.capture]=b.value),d.captureAsn1&&(e[d.captureAsn1]=b))}else g&&g.push("["+d.name+'] Expected constructed "'+d.constructed+'", got "'+b.constructed+'"');return m};var e=/[^\\u0000-\\u00ff]/;c.prettyPrint=function(b,d,v){var g="";d=d||0;v=v||2;0<d&&(g+="\n");for(var l="",r=0;r<d*v;++r)l+=" ";g+=l+"Tag: ";switch(b.tagClass){case c.Class.UNIVERSAL:g+="Universal:";break;case c.Class.APPLICATION:g+="Application:";break;case c.Class.CONTEXT_SPECIFIC:g+="Context-Specific:";
287
+b)return c.putSignedInt(b,32);c=Error("Integer too large; max is 32-bits.");c.integer=b;throw c;};c.derToInteger=function(b){"string"===typeof b&&(b=a.util.createBuffer(b));var c=8*b.length();if(32<c)throw Error("Integer too large; max is 32-bits.");return b.getSignedInt(c)};c.validate=function(b,d,e,g){var k=!1;if(b.tagClass!==d.tagClass&&"undefined"!==typeof d.tagClass||b.type!==d.type&&"undefined"!==typeof d.type)g&&(b.tagClass!==d.tagClass&&g.push("["+d.name+'] Expected tag class "'+d.tagClass+
288
+'", got "'+b.tagClass+'"'),b.type!==d.type&&g.push("["+d.name+'] Expected type "'+d.type+'", got "'+b.type+'"'));else if(b.constructed===d.constructed||"undefined"===typeof d.constructed){k=!0;if(d.value&&a.util.isArray(d.value))for(var u=0,h=0;k&&h<d.value.length;++h)k=d.value[h].optional||!1,b.value[u]&&((k=c.validate(b.value[u],d.value[h],e,g))?++u:d.value[h].optional&&(k=!0)),!k&&g&&g.push("["+d.name+'] Tag class "'+d.tagClass+'", type "'+d.type+'" expected value length "'+d.value.length+'", got "'+
289
+b.value.length+'"');k&&e&&(d.capture&&(e[d.capture]=b.value),d.captureAsn1&&(e[d.captureAsn1]=b))}else g&&g.push("["+d.name+'] Expected constructed "'+d.constructed+'", got "'+b.constructed+'"');return k};var e=/[^\\u0000-\\u00ff]/;c.prettyPrint=function(b,d,l){var g="";d=d||0;l=l||2;0<d&&(g+="\n");for(var h="",u=0;u<d*l;++u)h+=" ";g+=h+"Tag: ";switch(b.tagClass){case c.Class.UNIVERSAL:g+="Universal:";break;case c.Class.APPLICATION:g+="Application:";break;case c.Class.CONTEXT_SPECIFIC:g+="Context-Specific:";
290
break;case c.Class.PRIVATE:g+="Private:"}if(b.tagClass===c.Class.UNIVERSAL)switch(g+=b.type,b.type){case c.Type.NONE:g+=" (None)";break;case c.Type.BOOLEAN:g+=" (Boolean)";break;case c.Type.BITSTRING:g+=" (Bit string)";break;case c.Type.INTEGER:g+=" (Integer)";break;case c.Type.OCTETSTRING:g+=" (Octet string)";break;case c.Type.NULL:g+=" (Null)";break;case c.Type.OID:g+=" (Object Identifier)";break;case c.Type.ODESC:g+=" (Object Descriptor)";break;case c.Type.EXTERNAL:g+=" (External or Instance of)";
291
break;case c.Type.REAL:g+=" (Real)";break;case c.Type.ENUMERATED:g+=" (Enumerated)";break;case c.Type.EMBEDDED:g+=" (Embedded PDV)";break;case c.Type.UTF8:g+=" (UTF8)";break;case c.Type.ROID:g+=" (Relative Object Identifier)";break;case c.Type.SEQUENCE:g+=" (Sequence)";break;case c.Type.SET:g+=" (Set)";break;case c.Type.PRINTABLESTRING:g+=" (Printable String)";break;case c.Type.IA5String:g+=" (IA5String (ASCII))";break;case c.Type.UTCTIME:g+=" (UTC time)";break;case c.Type.GENERALIZEDTIME:g+=" (Generalized time)";
292
-break;case c.Type.BMPSTRING:g+=" (BMP String)"}else g+=b.type;g=g+"\n"+(l+"Constructed: "+b.constructed+"\n");if(b.composed){for(var x=0,z="",r=0;r<b.value.length;++r)void 0!==b.value[r]&&(x+=1,z+=c.prettyPrint(b.value[r],d+1,v),r+1<b.value.length&&(z+=","));g+=l+"Sub values: "+x+z}else if(g+=l+"Value: ",b.type===c.Type.OID&&(d=c.derToOid(b.value),g+=d,a.pki&&a.pki.oids&&d in a.pki.oids&&(g+=" ("+a.pki.oids[d]+") ")),b.type===c.Type.INTEGER)try{g+=c.derToInteger(b.value)}catch(B){g+="0x"+a.util.bytesToHex(b.value)}else b.type===
293
-c.Type.OCTETSTRING?(e.test(b.value)||(g+="("+b.value+") "),g+="0x"+a.util.bytesToHex(b.value)):g=b.type===c.Type.UTF8?g+a.util.decodeUtf8(b.value):b.type===c.Type.PRINTABLESTRING||b.type===c.Type.IA5String?g+b.value:e.test(b.value)?g+("0x"+a.util.bytesToHex(b.value)):0===b.value.length?g+"[null]":g+b.value;return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,
294
-c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.asn1)return c.asn1;c.defined.asn1=!0;for(var p=0;p<e.length;++p)e[p](c);return c.asn1}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/asn1",["require","module","./util","./oids"],function(){l.apply(null,Array.prototype.slice.call(arguments,
295
-0))})})();(function(){function b(a){function c(){l=String.fromCharCode(128);l+=a.util.fillString(String.fromCharCode(0),64);h=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9];v=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21];g=Array(64);for(var b=0;64>b;++b)g[b]=Math.floor(4294967296*
296
-Math.abs(Math.sin(b+1)));k=!0}function d(a,b,c){for(var e,n,m,p,A,y,C,l=c.length();64<=l;){n=a.h0;m=a.h1;p=a.h2;A=a.h3;for(C=0;16>C;++C)b[C]=c.getInt32Le(),e=A^m&(p^A),e=n+e+g[C]+b[C],y=v[C],n=A,A=p,p=m,m+=e<<y|e>>>32-y;for(;32>C;++C)e=p^A&(m^p),e=n+e+g[C]+b[h[C]],y=v[C],n=A,A=p,p=m,m+=e<<y|e>>>32-y;for(;48>C;++C)e=m^p^A,e=n+e+g[C]+b[h[C]],y=v[C],n=A,A=p,p=m,m+=e<<y|e>>>32-y;for(;64>C;++C)e=p^(m|~A),e=n+e+g[C]+b[h[C]],y=v[C],n=A,A=p,p=m,m+=e<<y|e>>>32-y;a.h0=a.h0+n|0;a.h1=a.h1+m|0;a.h2=a.h2+p|0;a.h3=
297
-a.h3+A|0;l-=64}}var e=a.md5=a.md5||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.md5=a.md.algorithms.md5=e;e.create=function(){k||c();var b=null,e=a.util.createBuffer(),g=Array(16),h={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){h.messageLength=0;h.fullMessageLength=h.messageLength64=[];for(var c=h.messageLengthSize/4,d=0;d<c;++d)h.fullMessageLength.push(0);e=a.util.createBuffer();b={h0:1732584193,h1:4023233417,
298
-h2:2562383102,h3:271733878};return h}};h.start();h.update=function(c,m){"utf8"===m&&(c=a.util.encodeUtf8(c));var p=c.length;h.messageLength+=p;for(var p=[p/4294967296>>>0,p>>>0],A=h.fullMessageLength.length-1;0<=A;--A)h.fullMessageLength[A]+=p[1],p[1]=p[0]+(h.fullMessageLength[A]/4294967296>>>0),h.fullMessageLength[A]>>>=0,p[0]=p[1]/4294967296>>>0;e.putBytes(c);d(b,g,e);(2048<e.read||0===e.length())&&e.compact();return h};h.digest=function(){var c=a.util.createBuffer();c.putBytes(e.bytes());c.putBytes(l.substr(0,
299
-h.blockLength-(h.fullMessageLength[h.fullMessageLength.length-1]+h.messageLengthSize&h.blockLength-1)));for(var m,p=0,A=h.fullMessageLength.length-1;0<=A;--A)m=8*h.fullMessageLength[A]+p,p=m/4294967296>>>0,c.putInt32Le(m>>>0);m={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3};d(m,g,c);c=a.util.createBuffer();c.putInt32Le(m.h0);c.putInt32Le(m.h1);c.putInt32Le(m.h2);c.putInt32Le(m.h3);return c};return h};var l=null,h=null,v=null,g=null,k=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=
300
-!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md5)return c.md5;c.defined.md5=!0;for(var p=0;p<e.length;++p)e[p](c);return c.md5}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,
301
-0))};a("js/md5",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,n,m,p,l,w,x,D,A=d.length();64<=A;){n=a.h0;m=a.h1;p=a.h2;l=a.h3;w=a.h4;for(D=0;16>D;++D)e=d.getInt32(),b[D]=e,x=l^m&(p^l),e=(n<<5|n>>>27)+x+w+1518500249+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;for(;20>D;++D)e=b[D-3]^b[D-8]^b[D-14]^b[D-16],e=e<<1|e>>>31,b[D]=e,x=l^m&(p^l),e=(n<<5|n>>>27)+x+w+1518500249+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;for(;32>
302
-D;++D)e=b[D-3]^b[D-8]^b[D-14]^b[D-16],e=e<<1|e>>>31,b[D]=e,x=m^p^l,e=(n<<5|n>>>27)+x+w+1859775393+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;for(;40>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,x=m^p^l,e=(n<<5|n>>>27)+x+w+1859775393+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;for(;60>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,x=m&p|l&(m^p),e=(n<<5|n>>>27)+x+w+2400959708+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;for(;80>D;++D)e=b[D-6]^b[D-16]^b[D-28]^b[D-32],e=e<<2|e>>>30,b[D]=e,x=m^p^l,e=(n<<5|n>>>
303
-27)+x+w+3395469782+e,w=l,l=p,p=m<<30|m>>>2,m=n,n=e;a.h0=a.h0+n|0;a.h1=a.h1+m|0;a.h2=a.h2+p|0;a.h3=a.h3+l|0;a.h4=a.h4+w|0;A-=64}}var d=a.sha1=a.sha1||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha1=a.md.algorithms.sha1=d;d.create=function(){l||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),l=!0);var b=null,d=a.util.createBuffer(),g=Array(80),x={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){x.messageLength=
304
-0;x.fullMessageLength=x.messageLength64=[];for(var c=x.messageLengthSize/4,e=0;e<c;++e)x.fullMessageLength.push(0);d=a.util.createBuffer();b={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520};return x}};x.start();x.update=function(e,m){"utf8"===m&&(e=a.util.encodeUtf8(e));var z=e.length;x.messageLength+=z;for(var z=[z/4294967296>>>0,z>>>0],l=x.fullMessageLength.length-1;0<=l;--l)x.fullMessageLength[l]+=z[1],z[1]=z[0]+(x.fullMessageLength[l]/4294967296>>>0),x.fullMessageLength[l]>>>=
305
-0,z[0]=z[1]/4294967296>>>0;d.putBytes(e);c(b,g,d);(2048<d.read||0===d.length())&&d.compact();return x};x.digest=function(){var r=a.util.createBuffer();r.putBytes(d.bytes());r.putBytes(e.substr(0,x.blockLength-(x.fullMessageLength[x.fullMessageLength.length-1]+x.messageLengthSize&x.blockLength-1)));a.util.createBuffer();for(var l,z,w=8*x.fullMessageLength[0],k=0;k<x.fullMessageLength.length;++k)l=8*x.fullMessageLength[k+1],z=l/4294967296>>>0,w+=z,r.putInt32(w>>>0),w=l;l={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,
306
-h4:b.h4};c(l,g,r);r=a.util.createBuffer();r.putInt32(l.h0);r.putInt32(l.h1);r.putInt32(l.h2);r.putInt32(l.h3);r.putInt32(l.h4);return r};return x};var e=null,l=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha1)return c.sha1;c.defined.sha1=
307
-!0;for(var p=0;p<e.length;++p)e[p](c);return c.sha1}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha1",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,n,m,p,l,x,D,A,y,C,w,k,q,u=d.length();64<=u;){for(l=0;16>l;++l)b[l]=d.getInt32();
308
-for(;64>l;++l)e=b[l-2],e=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10,n=b[l-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,b[l]=e+b[l-7]+n+b[l-16]|0;x=a.h0;D=a.h1;A=a.h2;y=a.h3;C=a.h4;w=a.h5;k=a.h6;q=a.h7;for(l=0;64>l;++l)e=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),m=k^C&(w^k),n=(x>>>2|x<<30)^(x>>>13|x<<19)^(x>>>22|x<<10),p=x&D|A&(x^D),e=q+e+m+h[l]+b[l],n+=p,q=k,k=w,w=C,C=y+e|0,y=A,A=D,D=x,x=e+n|0;a.h0=a.h0+x|0;a.h1=a.h1+D|0;a.h2=a.h2+A|0;a.h3=a.h3+y|0;a.h4=a.h4+C|0;a.h5=a.h5+w|0;a.h6=a.h6+k|0;a.h7=a.h7+q|0;u-=
309
-64}}var d=a.sha256=a.sha256||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha256=a.md.algorithms.sha256=d;d.create=function(){l||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,
310
-2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=!0);var b=null,d=a.util.createBuffer(),x=Array(64),r={algorithm:"sha256",blockLength:64,digestLength:32,
311
-messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){r.messageLength=0;r.fullMessageLength=r.messageLength64=[];for(var c=r.messageLengthSize/4,e=0;e<c;++e)r.fullMessageLength.push(0);d=a.util.createBuffer();b={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225};return r}};r.start();r.update=function(e,m){"utf8"===m&&(e=a.util.encodeUtf8(e));var h=e.length;r.messageLength+=h;for(var h=[h/4294967296>>>0,h>>>0],l=r.fullMessageLength.length-
312
-1;0<=l;--l)r.fullMessageLength[l]+=h[1],h[1]=h[0]+(r.fullMessageLength[l]/4294967296>>>0),r.fullMessageLength[l]>>>=0,h[0]=h[1]/4294967296>>>0;d.putBytes(e);c(b,x,d);(2048<d.read||0===d.length())&&d.compact();return r};r.digest=function(){var h=a.util.createBuffer();h.putBytes(d.bytes());h.putBytes(e.substr(0,r.blockLength-(r.fullMessageLength[r.fullMessageLength.length-1]+r.messageLengthSize&r.blockLength-1)));a.util.createBuffer();for(var l,w,k=8*r.fullMessageLength[0],F=0;F<r.fullMessageLength.length;++F)l=
313
-8*r.fullMessageLength[F+1],w=l/4294967296>>>0,k+=w,h.putInt32(k>>>0),k=l;l={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(l,x,h);h=a.util.createBuffer();h.putInt32(l.h0);h.putInt32(l.h1);h.putInt32(l.h2);h.putInt32(l.h3);h.putInt32(l.h4);h.putInt32(l.h5);h.putInt32(l.h6);h.putInt32(l.h7);return h};return r};var e=null,l=!1,h=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge=
314
-{}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var p=0;p<e.length;++p)e[p](c);return c.sha256}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha256",["require","module","./util"],function(){l.apply(null,
315
-Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,n,h,m,g,A,y,p,l,x,q,w,k,S,aa,O,u,W,U,Z,N,Y,L,G,H,ca=d.length();128<=ca;){for(H=0;16>H;++H)b[H][0]=d.getInt32()>>>0,b[H][1]=d.getInt32()>>>0;for(;80>H;++H)g=b[H-2],l=g[0],g=g[1],e=((l>>>19|g<<13)^(g>>>29|l<<3)^l>>>6)>>>0,n=((l<<13|g>>>19)^(g<<3|l>>>29)^(l<<26|g>>>6))>>>0,g=b[H-15],l=g[0],g=g[1],h=((l>>>1|g<<31)^(l>>>8|g<<24)^l>>>7)>>>0,m=((l<<31|g>>>1)^(l<<24|g>>>8)^(l<<25|g>>>7))>>>0,l=b[H-7],x=b[H-
316
-16],g=n+l[1]+m+x[1],b[H][0]=e+l[0]+h+x[0]+(g/4294967296>>>0)>>>0,b[H][1]=g>>>0;l=a[0][0];x=a[0][1];q=a[1][0];w=a[1][1];k=a[2][0];S=a[2][1];aa=a[3][0];O=a[3][1];u=a[4][0];W=a[4][1];U=a[5][0];Z=a[5][1];N=a[6][0];Y=a[6][1];L=a[7][0];G=a[7][1];for(H=0;80>H;++H)e=((u>>>14|W<<18)^(u>>>18|W<<14)^(W>>>9|u<<23))>>>0,g=((u<<18|W>>>14)^(u<<14|W>>>18)^(W<<23|u>>>9))>>>0,n=(N^u&(U^N))>>>0,A=(Y^W&(Z^Y))>>>0,h=((l>>>28|x<<4)^(x>>>2|l<<30)^(x>>>7|l<<25))>>>0,m=((l<<4|x>>>28)^(x<<30|l>>>2)^(x<<25|l>>>7))>>>0,y=(l&
317
-q|k&(l^q))>>>0,p=(x&w|S&(x^w))>>>0,g=G+g+A+v[H][1]+b[H][1],e=L+e+n+v[H][0]+b[H][0]+(g/4294967296>>>0)>>>0,n=g>>>0,g=m+p,h=h+y+(g/4294967296>>>0)>>>0,m=g>>>0,L=N,G=Y,N=U,Y=Z,U=u,Z=W,g=O+n,u=aa+e+(g/4294967296>>>0)>>>0,W=g>>>0,aa=k,O=S,k=q,S=w,q=l,w=x,g=n+m,l=e+h+(g/4294967296>>>0)>>>0,x=g>>>0;g=a[0][1]+x;a[0][0]=a[0][0]+l+(g/4294967296>>>0)>>>0;a[0][1]=g>>>0;g=a[1][1]+w;a[1][0]=a[1][0]+q+(g/4294967296>>>0)>>>0;a[1][1]=g>>>0;g=a[2][1]+S;a[2][0]=a[2][0]+k+(g/4294967296>>>0)>>>0;a[2][1]=g>>>0;g=a[3][1]+
318
-O;a[3][0]=a[3][0]+aa+(g/4294967296>>>0)>>>0;a[3][1]=g>>>0;g=a[4][1]+W;a[4][0]=a[4][0]+u+(g/4294967296>>>0)>>>0;a[4][1]=g>>>0;g=a[5][1]+Z;a[5][0]=a[5][0]+U+(g/4294967296>>>0)>>>0;a[5][1]=g>>>0;g=a[6][1]+Y;a[6][0]=a[6][0]+N+(g/4294967296>>>0)>>>0;a[6][1]=g>>>0;g=a[7][1]+G;a[7][0]=a[7][0]+L+(g/4294967296>>>0)>>>0;a[7][1]=g>>>0;ca-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384||{};
319
-e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){h||(l=String.fromCharCode(128),l+=a.util.fillString(String.fromCharCode(0),128),v=[[1116352408,
292
+break;case c.Type.BMPSTRING:g+=" (BMP String)"}else g+=b.type;g=g+"\n"+(h+"Constructed: "+b.constructed+"\n");if(b.composed){for(var w=0,z="",u=0;u<b.value.length;++u)void 0!==b.value[u]&&(w+=1,z+=c.prettyPrint(b.value[u],d+1,l),u+1<b.value.length&&(z+=","));g+=h+"Sub values: "+w+z}else if(g+=h+"Value: ",b.type===c.Type.OID&&(d=c.derToOid(b.value),g+=d,a.pki&&a.pki.oids&&d in a.pki.oids&&(g+=" ("+a.pki.oids[d]+") ")),b.type===c.Type.INTEGER)try{g+=c.derToInteger(b.value)}catch(x){g+="0x"+a.util.bytesToHex(b.value)}else b.type===
293
+c.Type.OCTETSTRING?(e.test(b.value)||(g+="("+b.value+") "),g+="0x"+a.util.bytesToHex(b.value)):g=b.type===c.Type.UTF8?g+a.util.decodeUtf8(b.value):b.type===c.Type.PRINTABLESTRING||b.type===c.Type.IA5String?g+b.value:e.test(b.value)?g+("0x"+a.util.bytesToHex(b.value)):0===b.value.length?g+"[null]":g+b.value;return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,
294
+c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.asn1)return c.asn1;c.defined.asn1=!0;for(var m=0;m<e.length;++m)e[m](c);return c.asn1}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/asn1",["require","module","./util","./oids"],function(){h.apply(null,Array.prototype.slice.call(arguments,
295
+0))})})();(function(){function b(a){function c(){h=String.fromCharCode(128);h+=a.util.fillString(String.fromCharCode(0),64);q=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9];l=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21];g=Array(64);for(var b=0;64>b;++b)g[b]=Math.floor(4294967296*
296
+Math.abs(Math.sin(b+1)));I=!0}function d(a,b,c){for(var e,n,k,m,A,y,C,h=c.length();64<=h;){n=a.h0;k=a.h1;m=a.h2;A=a.h3;for(C=0;16>C;++C)b[C]=c.getInt32Le(),e=A^k&(m^A),e=n+e+g[C]+b[C],y=l[C],n=A,A=m,m=k,k+=e<<y|e>>>32-y;for(;32>C;++C)e=m^A&(k^m),e=n+e+g[C]+b[q[C]],y=l[C],n=A,A=m,m=k,k+=e<<y|e>>>32-y;for(;48>C;++C)e=k^m^A,e=n+e+g[C]+b[q[C]],y=l[C],n=A,A=m,m=k,k+=e<<y|e>>>32-y;for(;64>C;++C)e=m^(k|~A),e=n+e+g[C]+b[q[C]],y=l[C],n=A,A=m,m=k,k+=e<<y|e>>>32-y;a.h0=a.h0+n|0;a.h1=a.h1+k|0;a.h2=a.h2+m|0;a.h3=
297
+a.h3+A|0;h-=64}}var e=a.md5=a.md5||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.md5=a.md.algorithms.md5=e;e.create=function(){I||c();var b=null,g=a.util.createBuffer(),e=Array(16),k={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){k.messageLength=0;k.fullMessageLength=k.messageLength64=[];for(var c=k.messageLengthSize/4,d=0;d<c;++d)k.fullMessageLength.push(0);g=a.util.createBuffer();b={h0:1732584193,h1:4023233417,
298
+h2:2562383102,h3:271733878};return k}};k.start();k.update=function(c,m){"utf8"===m&&(c=a.util.encodeUtf8(c));var l=c.length;k.messageLength+=l;for(var l=[l/4294967296>>>0,l>>>0],A=k.fullMessageLength.length-1;0<=A;--A)k.fullMessageLength[A]+=l[1],l[1]=l[0]+(k.fullMessageLength[A]/4294967296>>>0),k.fullMessageLength[A]>>>=0,l[0]=l[1]/4294967296>>>0;g.putBytes(c);d(b,e,g);(2048<g.read||0===g.length())&&g.compact();return k};k.digest=function(){var c=a.util.createBuffer();c.putBytes(g.bytes());c.putBytes(h.substr(0,
299
+k.blockLength-(k.fullMessageLength[k.fullMessageLength.length-1]+k.messageLengthSize&k.blockLength-1)));for(var l,m=0,A=k.fullMessageLength.length-1;0<=A;--A)l=8*k.fullMessageLength[A]+m,m=l/4294967296>>>0,c.putInt32Le(l>>>0);l={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3};d(l,e,c);c=a.util.createBuffer();c.putInt32Le(l.h0);c.putInt32Le(l.h1);c.putInt32Le(l.h2);c.putInt32Le(l.h3);return c};return k};var h=null,q=null,l=null,g=null,I=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=
300
+!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md5)return c.md5;c.defined.md5=!0;for(var m=0;m<e.length;++m)e[m](c);return c.md5}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,
301
+0))};a("js/md5",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,n,k,m,h,v,w,E,A=d.length();64<=A;){n=a.h0;k=a.h1;m=a.h2;h=a.h3;v=a.h4;for(E=0;16>E;++E)e=d.getInt32(),b[E]=e,w=h^k&(m^h),e=(n<<5|n>>>27)+w+v+1518500249+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;20>E;++E)e=b[E-3]^b[E-8]^b[E-14]^b[E-16],e=e<<1|e>>>31,b[E]=e,w=h^k&(m^h),e=(n<<5|n>>>27)+w+v+1518500249+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;32>
302
+E;++E)e=b[E-3]^b[E-8]^b[E-14]^b[E-16],e=e<<1|e>>>31,b[E]=e,w=k^m^h,e=(n<<5|n>>>27)+w+v+1859775393+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;40>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,w=k^m^h,e=(n<<5|n>>>27)+w+v+1859775393+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;60>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,w=k&m|h&(k^m),e=(n<<5|n>>>27)+w+v+2400959708+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;for(;80>E;++E)e=b[E-6]^b[E-16]^b[E-28]^b[E-32],e=e<<2|e>>>30,b[E]=e,w=k^m^h,e=(n<<5|n>>>
303
+27)+w+v+3395469782+e,v=h,h=m,m=k<<30|k>>>2,k=n,n=e;a.h0=a.h0+n|0;a.h1=a.h1+k|0;a.h2=a.h2+m|0;a.h3=a.h3+h|0;a.h4=a.h4+v|0;A-=64}}var d=a.sha1=a.sha1||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha1=a.md.algorithms.sha1=d;d.create=function(){h||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),h=!0);var b=null,d=a.util.createBuffer(),g=Array(80),w={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){w.messageLength=
304
+0;w.fullMessageLength=w.messageLength64=[];for(var c=w.messageLengthSize/4,g=0;g<c;++g)w.fullMessageLength.push(0);d=a.util.createBuffer();b={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520};return w}};w.start();w.update=function(e,k){"utf8"===k&&(e=a.util.encodeUtf8(e));var z=e.length;w.messageLength+=z;for(var z=[z/4294967296>>>0,z>>>0],h=w.fullMessageLength.length-1;0<=h;--h)w.fullMessageLength[h]+=z[1],z[1]=z[0]+(w.fullMessageLength[h]/4294967296>>>0),w.fullMessageLength[h]>>>=
305
+0,z[0]=z[1]/4294967296>>>0;d.putBytes(e);c(b,g,d);(2048<d.read||0===d.length())&&d.compact();return w};w.digest=function(){var u=a.util.createBuffer();u.putBytes(d.bytes());u.putBytes(e.substr(0,w.blockLength-(w.fullMessageLength[w.fullMessageLength.length-1]+w.messageLengthSize&w.blockLength-1)));a.util.createBuffer();for(var h,z,x=8*w.fullMessageLength[0],v=0;v<w.fullMessageLength.length;++v)h=8*w.fullMessageLength[v+1],z=h/4294967296>>>0,x+=z,u.putInt32(x>>>0),x=h;h={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,
306
+h4:b.h4};c(h,g,u);u=a.util.createBuffer();u.putInt32(h.h0);u.putInt32(h.h1);u.putInt32(h.h2);u.putInt32(h.h3);u.putInt32(h.h4);return u};return w};var e=null,h=!1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha1)return c.sha1;c.defined.sha1=
307
+!0;for(var m=0;m<e.length;++m)e[m](c);return c.sha1}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha1",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,n,k,m,h,w,E,A,y,C,v,r,p,T=d.length();64<=T;){for(h=0;16>h;++h)b[h]=d.getInt32();
308
+for(;64>h;++h)e=b[h-2],e=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10,n=b[h-15],n=(n>>>7|n<<25)^(n>>>18|n<<14)^n>>>3,b[h]=e+b[h-7]+n+b[h-16]|0;w=a.h0;E=a.h1;A=a.h2;y=a.h3;C=a.h4;v=a.h5;r=a.h6;p=a.h7;for(h=0;64>h;++h)e=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),k=r^C&(v^r),n=(w>>>2|w<<30)^(w>>>13|w<<19)^(w>>>22|w<<10),m=w&E|A&(w^E),e=p+e+k+q[h]+b[h],n+=m,p=r,r=v,v=C,C=y+e|0,y=A,A=E,E=w,w=e+n|0;a.h0=a.h0+w|0;a.h1=a.h1+E|0;a.h2=a.h2+A|0;a.h3=a.h3+y|0;a.h4=a.h4+C|0;a.h5=a.h5+v|0;a.h6=a.h6+r|0;a.h7=a.h7+p|0;T-=
309
+64}}var d=a.sha256=a.sha256||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha256=a.md.algorithms.sha256=d;d.create=function(){h||(e=String.fromCharCode(128),e+=a.util.fillString(String.fromCharCode(0),64),q=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,
310
+2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=!0);var b=null,d=a.util.createBuffer(),w=Array(64),u={algorithm:"sha256",blockLength:64,digestLength:32,
311
+messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){u.messageLength=0;u.fullMessageLength=u.messageLength64=[];for(var c=u.messageLengthSize/4,e=0;e<c;++e)u.fullMessageLength.push(0);d=a.util.createBuffer();b={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225};return u}};u.start();u.update=function(e,k){"utf8"===k&&(e=a.util.encodeUtf8(e));var h=e.length;u.messageLength+=h;for(var h=[h/4294967296>>>0,h>>>0],v=u.fullMessageLength.length-
312
+1;0<=v;--v)u.fullMessageLength[v]+=h[1],h[1]=h[0]+(u.fullMessageLength[v]/4294967296>>>0),u.fullMessageLength[v]>>>=0,h[0]=h[1]/4294967296>>>0;d.putBytes(e);c(b,w,d);(2048<d.read||0===d.length())&&d.compact();return u};u.digest=function(){var h=a.util.createBuffer();h.putBytes(d.bytes());h.putBytes(e.substr(0,u.blockLength-(u.fullMessageLength[u.fullMessageLength.length-1]+u.messageLengthSize&u.blockLength-1)));a.util.createBuffer();for(var z,v,q=8*u.fullMessageLength[0],G=0;G<u.fullMessageLength.length;++G)z=
313
+8*u.fullMessageLength[G+1],v=z/4294967296>>>0,q+=v,h.putInt32(q>>>0),q=z;z={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(z,w,h);h=a.util.createBuffer();h.putInt32(z.h0);h.putInt32(z.h1);h.putInt32(z.h2);h.putInt32(z.h3);h.putInt32(z.h4);h.putInt32(z.h5);h.putInt32(z.h6);h.putInt32(z.h7);return h};return u};var e=null,h=!1,q=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge=
314
+{}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var m=0;m<e.length;++m)e[m](c);return c.sha256}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha256",["require","module","./util"],function(){h.apply(null,
315
+Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var g,e,n,k,m,A,y,C,h,v,p,w,q,S,ca,B,r,V,Z,aa,N,Y,L,H,J,X=d.length();128<=X;){for(J=0;16>J;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],h=m[0],m=m[1],g=((h>>>19|m<<13)^(m>>>29|h<<3)^h>>>6)>>>0,e=((h<<13|m>>>19)^(m<<3|h>>>29)^(h<<26|m>>>6))>>>0,m=b[J-15],h=m[0],m=m[1],n=((h>>>1|m<<31)^(h>>>8|m<<24)^h>>>7)>>>0,k=((h<<31|m>>>1)^(h<<24|m>>>8)^(h<<25|m>>>7))>>>0,h=b[J-7],v=b[J-
316
+16],m=e+h[1]+k+v[1],b[J][0]=g+h[0]+n+v[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;h=a[0][0];v=a[0][1];p=a[1][0];w=a[1][1];q=a[2][0];S=a[2][1];ca=a[3][0];B=a[3][1];r=a[4][0];V=a[4][1];Z=a[5][0];aa=a[5][1];N=a[6][0];Y=a[6][1];L=a[7][0];H=a[7][1];for(J=0;80>J;++J)g=((r>>>14|V<<18)^(r>>>18|V<<14)^(V>>>9|r<<23))>>>0,m=((r<<18|V>>>14)^(r<<14|V>>>18)^(V<<23|r>>>9))>>>0,e=(N^r&(Z^N))>>>0,A=(Y^V&(aa^Y))>>>0,n=((h>>>28|v<<4)^(v>>>2|h<<30)^(v>>>7|h<<25))>>>0,k=((h<<4|v>>>28)^(v<<30|h>>>2)^(v<<25|h>>>7))>>>0,y=
317
+(h&p|q&(h^p))>>>0,C=(v&w|S&(v^w))>>>0,m=H+m+A+l[J][1]+b[J][1],g=L+g+e+l[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,e=m>>>0,m=k+C,n=n+y+(m/4294967296>>>0)>>>0,k=m>>>0,L=N,H=Y,N=Z,Y=aa,Z=r,aa=V,m=B+e,r=ca+g+(m/4294967296>>>0)>>>0,V=m>>>0,ca=q,B=S,q=p,S=w,p=h,w=v,m=e+k,h=g+n+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+h+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+w;a[1][0]=a[1][0]+p+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+S;a[2][0]=a[2][0]+q+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m=
318
+a[3][1]+B;a[3][0]=a[3][0]+ca+(m/4294967296>>>0)>>>0;a[3][1]=m>>>0;m=a[4][1]+V;a[4][0]=a[4][0]+r+(m/4294967296>>>0)>>>0;a[4][1]=m>>>0;m=a[5][1]+aa;a[5][0]=a[5][0]+Z+(m/4294967296>>>0)>>>0;a[5][1]=m>>>0;m=a[6][1]+Y;a[6][0]=a[6][0]+N+(m/4294967296>>>0)>>>0;a[6][1]=m>>>0;m=a[7][1]+H;a[7][0]=a[7][0]+L+(m/4294967296>>>0)>>>0;a[7][1]=m>>>0;X-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384||
319
+{};e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){q||(h=String.fromCharCode(128),h+=a.util.fillString(String.fromCharCode(0),128),l=[[1116352408,
320
3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],
321
[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,
322
106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],
323
[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],g={"SHA-512":[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],
324
[528734635,4215389547],[1541459225,327033209]],"SHA-384":[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],"SHA-512/256":[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],"SHA-512/224":[[2352822216,424955298],[1944164710,
325
-2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},h=!0);"undefined"===typeof b&&(b="SHA-512");if(!(b in g))throw Error("Invalid SHA-512 algorithm: "+b);for(var d=g[b],e=null,m=a.util.createBuffer(),x=Array(80),k=0;80>k;++k)x[k]=Array(2);var F={algorithm:b.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){F.messageLength=
326
-0;F.fullMessageLength=F.messageLength128=[];for(var b=F.messageLengthSize/4,c=0;c<b;++c)F.fullMessageLength.push(0);m=a.util.createBuffer();e=Array(d.length);for(c=0;c<d.length;++c)e[c]=d[c].slice(0);return F}};F.start();F.update=function(b,d){"utf8"===d&&(b=a.util.encodeUtf8(b));var g=b.length;F.messageLength+=g;for(var g=[g/4294967296>>>0,g>>>0],h=F.fullMessageLength.length-1;0<=h;--h)F.fullMessageLength[h]+=g[1],g[1]=g[0]+(F.fullMessageLength[h]/4294967296>>>0),F.fullMessageLength[h]>>>=0,g[0]=
327
-g[1]/4294967296>>>0;m.putBytes(b);c(e,x,m);(2048<m.read||0===m.length())&&m.compact();return F};F.digest=function(){var d=a.util.createBuffer();d.putBytes(m.bytes());d.putBytes(l.substr(0,F.blockLength-(F.fullMessageLength[F.fullMessageLength.length-1]+F.messageLengthSize&F.blockLength-1)));a.util.createBuffer();for(var g,h,r=8*F.fullMessageLength[0],v=0;v<F.fullMessageLength.length;++v)g=8*F.fullMessageLength[v+1],h=g/4294967296>>>0,r+=h,d.putInt32(r>>>0),r=g;g=Array(e.length);for(v=0;v<e.length;++v)g[v]=
328
-e[v].slice(0);c(g,x,d);d=a.util.createBuffer();h="SHA-512"===b?g.length:"SHA-384"===b?g.length-2:g.length-4;for(v=0;v<h;++v)d.putInt32(g[v][0]),v===h-1&&"SHA-512/224"===b||d.putInt32(g[v][1]);return d};return F};var l=null,h=!1,v=null,g=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);
329
-c=c||{};c.defined=c.defined||{};if(c.defined.sha512)return c.sha512;c.defined.sha512=!0;for(var p=0;p<e.length;++p)e[p](c);return c.sha512}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha512",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.md=a.md||{};
330
-a.md.algorithms={md5:a.md5,sha1:a.sha1,sha256:a.sha256};a.md.md5=a.md5;a.md.sha1=a.sha1;a.md.sha256=a.sha256}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md)return c.md;c.defined.md=!0;for(var p=0;p<e.length;++p)e[p](c);return c.md}},u=a;a=function(b,
331
-c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/md","require module ./md5 ./sha1 ./sha256 ./sha512".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){(a.hmac=a.hmac||{}).create=function(){var b=null,c=null,d=null,e={start:function(e,v){if(null!==e)if("string"===typeof e)if(e=e.toLowerCase(),e in a.md.algorithms)b=
332
-a.md.algorithms[e].create();else throw Error('Unknown hash algorithm "'+e+'"');else b=e;if(null!==v){if("string"===typeof v)v=a.util.createBuffer(v);else if(a.util.isArray(v)){var g=v;v=a.util.createBuffer();for(var l=0;l<g.length;++l)v.putByte(g[l])}var r=v.length();r>b.blockLength&&(b.start(),b.update(v.bytes()),v=b.digest());c=a.util.createBuffer();d=a.util.createBuffer();r=v.length();for(l=0;l<r;++l)g=v.at(l),c.putByte(54^g),d.putByte(92^g);if(r<b.blockLength)for(g=b.blockLength-r,l=0;l<g;++l)c.putByte(54),
333
-d.putByte(92);c=c.bytes();d=d.bytes()}b.start();b.update(c)},update:function(a){b.update(a)},getMac:function(){var a=b.digest().bytes();b.start();b.update(d);b.update(a);return b.digest()}};e.digest=e.getMac;return e}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
334
-{};if(c.defined.hmac)return c.hmac;c.defined.hmac=!0;for(var p=0;p<e.length;++p)e[p](c);return c.hmac}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/hmac",["require","module","./md","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a){for(var b=a.name+": ",d=[],e=function(a,
335
-b){return" "+b},n=0;n<a.values.length;++n)d.push(a.values[n].replace(/^(\S+\r\n)/,e));b+=d.join(",")+"\r\n";d=0;a=-1;for(n=0;n<b.length;++n,++d)if(65<d&&-1!==a)d=b[a],","===d?(++a,b=b.substr(0,a)+"\r\n "+b.substr(a)):b=b.substr(0,a)+"\r\n"+d+b.substr(a+1),d=n-a-1,a=-1,++n;else if(" "===b[n]||"\t"===b[n]||","===b[n])a=n;return b}var d=a.pem=a.pem||{};d.encode=function(b,d){d=d||{};var e="-----BEGIN "+b.type+"-----\r\n",v;b.procType&&(v={name:"Proc-Type",values:[String(b.procType.version),b.procType.type]},
336
-e+=c(v));b.contentDomain&&(v={name:"Content-Domain",values:[b.contentDomain]},e+=c(v));b.dekInfo&&(v={name:"DEK-Info",values:[b.dekInfo.algorithm]},b.dekInfo.parameters&&v.values.push(b.dekInfo.parameters),e+=c(v));if(b.headers)for(v=0;v<b.headers.length;++v)e+=c(b.headers[v]);b.procType&&(e+="\r\n");e+=a.util.encode64(b.body,d.maxline||64)+"\r\n";return e+="-----END "+b.type+"-----\r\n"};d.decode=function(b){for(var c=[],d=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,
337
-e=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,g=/\r?\n/,p;;){p=d.exec(b);if(!p)break;var r={type:p[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(p[3])};c.push(r);if(p[2]){for(var l=p[2].split(g),z=0;p&&z<l.length;){p=l[z].replace(/\s+$/,"");for(var x=z+1;x<l.length;++x){var k=l[x];if(!/\s/.test(k[0]))break;p+=k;z=x}if(p=p.match(e)){for(var x={name:p[1],values:[]},k=p[2].split(","),F=0;F<k.length;++F)x.values.push(k[F].replace(/^\s+/,""));if(r.procType)if(r.contentDomain||
338
-"Content-Domain"!==x.name)if(r.dekInfo||"DEK-Info"!==x.name)r.headers.push(x);else{if(0===x.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');r.dekInfo={algorithm:k[0],parameters:k[1]||null}}else r.contentDomain=k[0]||"";else{if("Proc-Type"!==x.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==x.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');
339
-r.procType={version:k[0],type:k[1]}}}++z}if("ENCRYPTED"===r.procType&&!r.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');}}if(0===c.length)throw Error("Invalid PEM formatted message.");return c}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);
340
-c=c||{};c.defined=c.defined||{};if(c.defined.pem)return c.pem;c.defined.pem=!0;for(var p=0;p<e.length;++p)e[p](c);return c.pem}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pem",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d){a.cipher.registerAlgorithm(b,
341
-function(){return new a.des.Algorithm(b,d)})}function d(a,b,c,e){var n=32===a.length?3:9;e=3===n?e?[30,-2,-2]:[0,32,2]:e?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=b[0],m=b[1];b=(y>>>4^m)&252645135;m^=b;y^=b<<4;b=(y>>>16^m)&65535;m^=b;y^=b<<16;b=(m>>>2^y)&858993459;y^=b;m^=b<<2;b=(m>>>8^y)&16711935;y^=b;m^=b<<8;b=(y>>>1^m)&1431655765;for(var m=m^b,y=y^b<<1,y=y<<1|y>>>31,m=m<<1|m>>>31,p=0;p<n;p+=3){for(var x=e[p+1],q=e[p+2],u=e[p];u!=x;u+=q){var T=m^a[u],S=(m>>>4|m<<28)^a[u+1];b=y;
342
-y=m;m=b^(h[T>>>24&63]|g[T>>>16&63]|r[T>>>8&63]|z[T&63]|l[S>>>24&63]|v[S>>>16&63]|k[S>>>8&63]|E[S&63])}b=y;y=m;m=b}y=y>>>1|y<<31;m=m>>>1|m<<31;b=(y>>>1^m)&1431655765;m^=b;y^=b<<1;b=(m>>>8^y)&16711935;y^=b;m^=b<<8;b=(m>>>2^y)&858993459;y^=b;m^=b<<2;b=(y>>>16^m)&65535;m^=b;y^=b<<16;b=(y>>>4^m)&252645135;c[0]=y^b<<4;c[1]=m^b}function e(b){b=b||{};var c="DES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e=
325
+2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},q=!0);"undefined"===typeof b&&(b="SHA-512");if(!(b in g))throw Error("Invalid SHA-512 algorithm: "+b);for(var d=g[b],e=null,k=a.util.createBuffer(),w=Array(80),F=0;80>F;++F)w[F]=Array(2);var G={algorithm:b.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){G.messageLength=
326
+0;G.fullMessageLength=G.messageLength128=[];for(var b=G.messageLengthSize/4,c=0;c<b;++c)G.fullMessageLength.push(0);k=a.util.createBuffer();e=Array(d.length);for(c=0;c<d.length;++c)e[c]=d[c].slice(0);return G}};G.start();G.update=function(b,d){"utf8"===d&&(b=a.util.encodeUtf8(b));var g=b.length;G.messageLength+=g;for(var g=[g/4294967296>>>0,g>>>0],C=G.fullMessageLength.length-1;0<=C;--C)G.fullMessageLength[C]+=g[1],g[1]=g[0]+(G.fullMessageLength[C]/4294967296>>>0),G.fullMessageLength[C]>>>=0,g[0]=
327
+g[1]/4294967296>>>0;k.putBytes(b);c(e,w,k);(2048<k.read||0===k.length())&&k.compact();return G};G.digest=function(){var d=a.util.createBuffer();d.putBytes(k.bytes());d.putBytes(h.substr(0,G.blockLength-(G.fullMessageLength[G.fullMessageLength.length-1]+G.messageLengthSize&G.blockLength-1)));a.util.createBuffer();for(var g,y,C=8*G.fullMessageLength[0],l=0;l<G.fullMessageLength.length;++l)g=8*G.fullMessageLength[l+1],y=g/4294967296>>>0,C+=y,d.putInt32(C>>>0),C=g;g=Array(e.length);for(l=0;l<e.length;++l)g[l]=
328
+e[l].slice(0);c(g,w,d);d=a.util.createBuffer();y="SHA-512"===b?g.length:"SHA-384"===b?g.length-2:g.length-4;for(l=0;l<y;++l)d.putInt32(g[l][0]),l===y-1&&"SHA-512/224"===b||d.putInt32(g[l][1]);return d};return G};var h=null,q=!1,l=null,g=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);
329
+c=c||{};c.defined=c.defined||{};if(c.defined.sha512)return c.sha512;c.defined.sha512=!0;for(var m=0;m<e.length;++m)e[m](c);return c.sha512}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/sha512",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.md=a.md||{};
330
+a.md.algorithms={md5:a.md5,sha1:a.sha1,sha256:a.sha256};a.md.md5=a.md5;a.md.sha1=a.sha1;a.md.sha256=a.sha256}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.md)return c.md;c.defined.md=!0;for(var m=0;m<e.length;++m)e[m](c);return c.md}},r=a;a=function(b,
331
+c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/md","require module ./md5 ./sha1 ./sha256 ./sha512".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){(a.hmac=a.hmac||{}).create=function(){var b=null,c=null,d=null,e={start:function(e,l){if(null!==e)if("string"===typeof e)if(e=e.toLowerCase(),e in a.md.algorithms)b=
332
+a.md.algorithms[e].create();else throw Error('Unknown hash algorithm "'+e+'"');else b=e;if(null!==l){if("string"===typeof l)l=a.util.createBuffer(l);else if(a.util.isArray(l)){var g=l;l=a.util.createBuffer();for(var h=0;h<g.length;++h)l.putByte(g[h])}var u=l.length();u>b.blockLength&&(b.start(),b.update(l.bytes()),l=b.digest());c=a.util.createBuffer();d=a.util.createBuffer();u=l.length();for(h=0;h<u;++h)g=l.at(h),c.putByte(54^g),d.putByte(92^g);if(u<b.blockLength)for(g=b.blockLength-u,h=0;h<g;++h)c.putByte(54),
333
+d.putByte(92);c=c.bytes();d=d.bytes()}b.start();b.update(c)},update:function(a){b.update(a)},getMac:function(){var a=b.digest().bytes();b.start();b.update(d);b.update(a);return b.digest()}};e.digest=e.getMac;return e}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
334
+{};if(c.defined.hmac)return c.hmac;c.defined.hmac=!0;for(var m=0;m<e.length;++m)e[m](c);return c.hmac}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/hmac",["require","module","./md","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a){for(var b=a.name+": ",d=[],e=function(a,
335
+b){return" "+b},g=0;g<a.values.length;++g)d.push(a.values[g].replace(/^(\S+\r\n)/,e));b+=d.join(",")+"\r\n";d=0;a=-1;for(g=0;g<b.length;++g,++d)if(65<d&&-1!==a)d=b[a],","===d?(++a,b=b.substr(0,a)+"\r\n "+b.substr(a)):b=b.substr(0,a)+"\r\n"+d+b.substr(a+1),d=g-a-1,a=-1,++g;else if(" "===b[g]||"\t"===b[g]||","===b[g])a=g;return b}var d=a.pem=a.pem||{};d.encode=function(b,d){d=d||{};var e="-----BEGIN "+b.type+"-----\r\n",l;b.procType&&(l={name:"Proc-Type",values:[String(b.procType.version),b.procType.type]},
336
+e+=c(l));b.contentDomain&&(l={name:"Content-Domain",values:[b.contentDomain]},e+=c(l));b.dekInfo&&(l={name:"DEK-Info",values:[b.dekInfo.algorithm]},b.dekInfo.parameters&&l.values.push(b.dekInfo.parameters),e+=c(l));if(b.headers)for(l=0;l<b.headers.length;++l)e+=c(b.headers[l]);b.procType&&(e+="\r\n");e+=a.util.encode64(b.body,d.maxline||64)+"\r\n";return e+="-----END "+b.type+"-----\r\n"};d.decode=function(b){for(var c=[],d=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,
337
+e=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,g=/\r?\n/,m;;){m=d.exec(b);if(!m)break;var h={type:m[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:a.util.decode64(m[3])};c.push(h);if(m[2]){for(var q=m[2].split(g),z=0;m&&z<q.length;){m=q[z].replace(/\s+$/,"");for(var x=z+1;x<q.length;++x){var w=q[x];if(!/\s/.test(w[0]))break;m+=w;z=x}if(m=m.match(e)){for(var x={name:m[1],values:[]},w=m[2].split(","),G=0;G<w.length;++G)x.values.push(w[G].replace(/^\s+/,""));if(h.procType)if(h.contentDomain||
338
+"Content-Domain"!==x.name)if(h.dekInfo||"DEK-Info"!==x.name)h.headers.push(x);else{if(0===x.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');h.dekInfo={algorithm:w[0],parameters:w[1]||null}}else h.contentDomain=w[0]||"";else{if("Proc-Type"!==x.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==x.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');
339
+h.procType={version:w[0],type:w[1]}}}++z}if("ENCRYPTED"===h.procType&&!h.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');}}if(0===c.length)throw Error("Invalid PEM formatted message.");return c}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);
340
+c=c||{};c.defined=c.defined||{};if(c.defined.pem)return c.pem;c.defined.pem=!0;for(var m=0;m<e.length;++m)e[m](c);return c.pem}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pem",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d){a.cipher.registerAlgorithm(b,
341
+function(){return new a.des.Algorithm(b,d)})}function d(a,b,c,e){var n=32===a.length?3:9;e=3===n?e?[30,-2,-2]:[0,32,2]:e?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var y=b[0],k=b[1];b=(y>>>4^k)&252645135;k^=b;y^=b<<4;b=(y>>>16^k)&65535;k^=b;y^=b<<16;b=(k>>>2^y)&858993459;y^=b;k^=b<<2;b=(k>>>8^y)&16711935;y^=b;k^=b<<8;b=(y>>>1^k)&1431655765;for(var k=k^b,y=y^b<<1,y=y<<1|y>>>31,k=k<<1|k>>>31,m=0;m<n;m+=3){for(var w=e[m+1],p=e[m+2],r=e[m];r!=w;r+=p){var U=k^a[r],S=(k>>>4|k<<28)^a[r+1];b=y;
342
+y=k;k=b^(q[U>>>24&63]|g[U>>>16&63]|u[U>>>8&63]|z[U&63]|h[S>>>24&63]|l[S>>>16&63]|I[S>>>8&63]|D[S&63])}b=y;y=k;k=b}y=y>>>1|y<<31;k=k>>>1|k<<31;b=(y>>>1^k)&1431655765;k^=b;y^=b<<1;b=(k>>>8^y)&16711935;y^=b;k^=b<<8;b=(k>>>2^y)&858993459;y^=b;k^=b<<2;b=(y>>>16^k)&65535;k^=b;y^=b<<16;b=(y>>>4^k)&252645135;c[0]=y^b<<4;c[1]=k^b}function e(b){b=b||{};var c="DES-"+(b.mode||"CBC").toUpperCase(),d;d=b.decrypt?a.cipher.createDecipher(c,b.key):a.cipher.createCipher(c,b.key);var g=d.start;d.start=function(b,c){var e=
343
null;c instanceof a.util.ByteBuffer&&(e=c,c={});c=c||{};c.output=e;c.iv=b;g.call(d,c)};return d}a.des=a.des||{};a.des.startEncrypting=function(a,b,c,d){a=e({key:a,output:c,decrypt:!1,mode:d||(null===b?"ECB":"CBC")});a.start(b);return a};a.des.createEncryptionCipher=function(a,b){return e({key:a,output:null,decrypt:!1,mode:b})};a.des.startDecrypting=function(a,b,c,d){a=e({key:a,output:c,decrypt:!0,mode:d||(null===b?"ECB":"CBC")});a.start(b);return a};a.des.createDecryptionCipher=function(a,b){return e({key:a,
344
output:null,decrypt:!0,mode:b})};a.des.Algorithm=function(a,b){var c=this;c.name=a;c.mode=new b({blockSize:8,cipher:{encrypt:function(a,b){return d(c._keys,a,b,!1)},decrypt:function(a,b){return d(c._keys,a,b,!0)}}});c._init=!1};a.des.Algorithm.prototype.initialize=function(b){if(!this._init){b=a.util.createBuffer(b.key);if(0===this.name.indexOf("3DES")&&24!==b.length())throw Error("Invalid Triple-DES key size: "+8*b.length());for(var c=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,
345
-516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],e=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],g=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],y=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],
346
-m=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],h=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],p=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],r=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],v=[0,268435456,8,268435464,0,268435456,
347
-8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],z=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],k=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],x=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],w=8<b.length()?3:
348
-1,E=[],K=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],u=0,N,Y=0;Y<w;Y++){var L=b.getInt32(),G=b.getInt32();N=(L>>>4^G)&252645135;G^=N;L^=N<<4;N=(G>>>-16^L)&65535;L^=N;G^=N<<-16;N=(L>>>2^G)&858993459;G^=N;L^=N<<2;N=(G>>>-16^L)&65535;L^=N;G^=N<<-16;N=(L>>>1^G)&1431655765;G^=N;L^=N<<1;N=(G>>>8^L)&16711935;L^=N;G^=N<<8;N=(L>>>1^G)&1431655765;G^=N;L^=N<<1;N=L<<8|G>>>20&240;for(var L=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=N,H=0;H<K.length;++H){K[H]?(L=L<<2|L>>>26,G=G<<2|G>>>26):(L=L<<1|L>>>27,G=G<<1|G>>>27);
349
-var L=L&-15,G=G&-15,ca=c[L>>>28]|d[L>>>24&15]|e[L>>>20&15]|g[L>>>16&15]|y[L>>>12&15]|m[L>>>8&15]|h[L>>>4&15],da=p[G>>>28]|r[G>>>24&15]|v[G>>>20&15]|l[G>>>16&15]|z[G>>>12&15]|k[G>>>8&15]|x[G>>>4&15];N=(da>>>16^ca)&65535;E[u++]=ca^N;E[u++]=da^N<<16}}this._keys=E;this._init=!0}};c("DES-ECB",a.cipher.modes.ecb);c("DES-CBC",a.cipher.modes.cbc);c("DES-CFB",a.cipher.modes.cfb);c("DES-OFB",a.cipher.modes.ofb);c("DES-CTR",a.cipher.modes.ctr);c("3DES-ECB",a.cipher.modes.ecb);c("3DES-CBC",a.cipher.modes.cbc);
350
-c("3DES-CFB",a.cipher.modes.cfb);c("3DES-OFB",a.cipher.modes.ofb);c("3DES-CTR",a.cipher.modes.ctr);var l=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,
351
-16778240,16778240,0,65540,66560,0,16842756],h=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,
352
--2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],v=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,
353
-134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],g=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],k=[256,
354
-34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,
355
-524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],r=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,
356
-541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],E=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,
357
-0,2099202,69206016,2048,67108866,67110912,2048,2097154],z=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,
358
-266240,4160,4160,262208,268435456,268701696]}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.des)return c.des;c.defined.des=!0;for(var p=0;p<e.length;++p)e[p](c);return c.des}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,
359
-u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/des",["require","module","./cipher","./cipherModes","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var d=a.pkcs5=a.pkcs5||{},e="undefined"!==typeof process&&process.versions&&process.versions.node,m;e&&!a.disableNativeCode&&(m=c("crypto"));a.pbkdf2=d.pbkdf2=function(b,c,d,g,p,r){function l(){if(u>I)return r(null,A);
360
-D.start(null,null);D.update(c);D.update(a.util.int32ToBytes(u));y=M=D.digest().getBytes();q=2;z()}function z(){if(q<=d)return D.start(null,null),D.update(M),C=D.digest().getBytes(),y=a.util.xorBytes(y,C,k),M=C,++q,a.util.setImmediate(z);A+=u<I?y:y.substr(0,F);++u;l()}"function"===typeof p&&(r=p,p=null);if(e&&!a.disableNativeCode&&m.pbkdf2&&(null===p||"object"!==typeof p)&&(4<m.pbkdf2Sync.length||!p||"sha1"===p))return"string"!==typeof p&&(p="sha1"),c=new Buffer(c,"binary"),r?4===m.pbkdf2Sync.length?
361
-m.pbkdf2(b,c,d,g,function(a,b){if(a)return r(a);r(null,b.toString("binary"))}):m.pbkdf2(b,c,d,g,p,function(a,b){if(a)return r(a);r(null,b.toString("binary"))}):4===m.pbkdf2Sync.length?m.pbkdf2Sync(b,c,d,g).toString("binary"):m.pbkdf2Sync(b,c,d,g,p).toString("binary");if("undefined"===typeof p||null===p)p=a.md.sha1.create();if("string"===typeof p){if(!(p in a.md.algorithms))throw Error("Unknown hash algorithm: "+p);p=a.md[p].create()}var k=p.digestLength;if(g>4294967295*k){b=Error("Derived key is too long.");
362
-if(r)return r(b);throw b;}var I=Math.ceil(g/k),F=g-(I-1)*k,D=a.hmac.create();D.start(p,b);var A="",y,C,M;if(!r){for(var u=1;u<=I;++u){D.start(null,null);D.update(c);D.update(a.util.int32ToBytes(u));y=M=D.digest().getBytes();for(var q=2;q<=d;++q)D.start(null,null),D.update(M),C=D.digest().getBytes(),y=a.util.xorBytes(y,C,k),M=C;A+=u<I?y:y.substr(0,F)}return A}u=1;l()}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===
363
-typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pbkdf2)return c.pbkdf2;c.defined.pbkdf2=!0;for(var p=0;p<e.length;++p)e[p](c);return c.pbkdf2}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pbkdf2",["require","module",
364
-"./hmac","./md","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var d="undefined"!==typeof process&&process.versions&&process.versions.node,e=null;a.disableNativeCode||!d||process.versions["node-webkit"]||(e=c("crypto"));(a.prng=a.prng||{}).create=function(b){function c(a){if(32<=g.pools[0].messageLength)return d(),a();g.seedFile(32-g.pools[0].messageLength<<5,function(b,c){if(b)return a(b);g.collect(c);d();a()})}function d(){var a=g.plugin.md.create();
365
-a.update(g.pools[0].digest().getBytes());g.pools[0].start();for(var b=1,c=1;32>c;++c)b=31===b?2147483648:b<<2,0===b%g.reseeds&&(a.update(g.pools[c].digest().getBytes()),g.pools[c].start());b=a.digest().getBytes();a.start();a.update(b);a=a.digest().getBytes();g.key=g.plugin.formatKey(b);g.seed=g.plugin.formatSeed(a);g.reseeds=4294967295===g.reseeds?0:g.reseeds+1;g.generated=0}function p(b){var c=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(c=function(a){return d.getRandomValues(a)})}var e=
366
-a.util.createBuffer();if(c)for(;e.length()<b;){var g=Math.max(1,Math.min(b-e.length(),65536)/4),m=new Uint32Array(Math.floor(g));try{for(c(m),g=0;g<m.length;++g)e.putInt32(m[g])}catch(A){if(!("undefined"!==typeof QuotaExceededError&&A instanceof QuotaExceededError))throw A;}}if(e.length()<b)for(c=Math.floor(65536*Math.random());e.length()<b;)for(g=16807*(c&65535),c=16807*(c>>16),g+=(c&32767)<<16,g+=c>>15,g=(g&2147483647)+(g>>31),c=g&4294967295,g=0;3>g;++g)m=c>>>(g<<3),m^=Math.floor(256*Math.random()),
367
-e.putByte(String.fromCharCode(m&255));return e.getBytes(b)}var g={plugin:b,key:null,seed:null,time:null,reseeds:0,generated:0};b=b.md;for(var l=Array(32),r=0;32>r;++r)l[r]=b.create();g.pools=l;g.pool=0;g.generate=function(b,d){function e(r){if(r)return d(r);if(y.length()>=b)return d(null,y.getBytes(b));1048575<g.generated&&(g.key=null);if(null===g.key)return a.util.nextTick(function(){c(e)});r=m(g.key,g.seed);g.generated+=r.length;y.putBytes(r);g.key=p(m(g.key,h(g.seed)));g.seed=A(m(g.key,g.seed));
368
-a.util.setImmediate(e)}if(!d)return g.generateSync(b);var m=g.plugin.cipher,h=g.plugin.increment,p=g.plugin.formatKey,A=g.plugin.formatSeed,y=a.util.createBuffer();g.key=null;e()};g.generateSync=function(b){var c=g.plugin.cipher,e=g.plugin.increment,m=g.plugin.formatKey,p=g.plugin.formatSeed;g.key=null;for(var r=a.util.createBuffer();r.length()<b;){1048575<g.generated&&(g.key=null);null===g.key&&(32<=g.pools[0].messageLength||g.collect(g.seedFileSync(32-g.pools[0].messageLength<<5)),d());var A=c(g.key,
369
-g.seed);g.generated+=A.length;r.putBytes(A);g.key=m(c(g.key,e(g.seed)));g.seed=p(c(g.key,g.seed))}return r.getBytes(b)};e?(g.seedFile=function(a,b){e.randomBytes(a,function(a,c){if(a)return b(a);b(null,c.toString())})},g.seedFileSync=function(a){return e.randomBytes(a).toString()}):(g.seedFile=function(a,b){try{b(null,p(a))}catch(c){b(c)}},g.seedFileSync=p);g.collect=function(a){for(var b=a.length,c=0;c<b;++c)g.pools[g.pool].update(a.substr(c,1)),g.pool=31===g.pool?0:g.pool+1};g.collectInt=function(a,
345
+516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],g=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],e=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],k=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],
346
+m=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],l=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],h=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],p=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,
347
+8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],z=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],q=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],v=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],w=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],I=8<b.length()?3:
348
+1,B=[],r=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],D=0,N,Y=0;Y<I;Y++){var L=b.getInt32(),H=b.getInt32();N=(L>>>4^H)&252645135;H^=N;L^=N<<4;N=(H>>>-16^L)&65535;L^=N;H^=N<<-16;N=(L>>>2^H)&858993459;H^=N;L^=N<<2;N=(H>>>-16^L)&65535;L^=N;H^=N<<-16;N=(L>>>1^H)&1431655765;H^=N;L^=N<<1;N=(H>>>8^L)&16711935;L^=N;H^=N<<8;N=(L>>>1^H)&1431655765;H^=N;L^=N<<1;N=L<<8|H>>>20&240;for(var L=H<<24|H<<8&16711680|H>>>8&65280|H>>>24&240,H=N,J=0;J<r.length;++J){r[J]?(L=L<<2|L>>>26,H=H<<2|H>>>26):(L=L<<1|L>>>27,H=H<<1|H>>>27);
349
+var L=L&-15,H=H&-15,X=c[L>>>28]|d[L>>>24&15]|g[L>>>20&15]|e[L>>>16&15]|k[L>>>12&15]|m[L>>>8&15]|l[L>>>4&15],da=h[H>>>28]|p[H>>>24&15]|u[H>>>20&15]|z[H>>>16&15]|q[H>>>12&15]|v[H>>>8&15]|w[H>>>4&15];N=(da>>>16^X)&65535;B[D++]=X^N;B[D++]=da^N<<16}}this._keys=B;this._init=!0}};c("DES-ECB",a.cipher.modes.ecb);c("DES-CBC",a.cipher.modes.cbc);c("DES-CFB",a.cipher.modes.cfb);c("DES-OFB",a.cipher.modes.ofb);c("DES-CTR",a.cipher.modes.ctr);c("3DES-ECB",a.cipher.modes.ecb);c("3DES-CBC",a.cipher.modes.cbc);c("3DES-CFB",
350
+a.cipher.modes.cfb);c("3DES-OFB",a.cipher.modes.ofb);c("3DES-CTR",a.cipher.modes.ctr);var h=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,
351
+0,65540,66560,0,16842756],q=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,
352
+-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],l=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,
353
+8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],g=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],I=[256,34078976,34078720,1107296512,
354
+524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,
355
+524288,0,1074266112,34078976,1073742080],u=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,
356
+4194320,536887312,0,541081600,536870912,4194320,536887312],D=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,
357
+67108866,67110912,2048,2097154],z=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,
358
+268435456,268701696]}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.des)return c.des;c.defined.des=!0;for(var m=0;m<e.length;++m)e[m](c);return c.des}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,
359
+Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/des",["require","module","./cipher","./cipherModes","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var d=a.pkcs5=a.pkcs5||{},e="undefined"!==typeof process&&process.versions&&process.versions.node,k;e&&!a.disableNativeCode&&(k=c("crypto"));a.pbkdf2=d.pbkdf2=function(b,c,d,g,m,h){function q(){if(r>F)return h(null,A);E.start(null,
360
+null);E.update(c);E.update(a.util.int32ToBytes(r));y=M=E.digest().getBytes();p=2;z()}function z(){if(p<=d)return E.start(null,null),E.update(M),C=E.digest().getBytes(),y=a.util.xorBytes(y,C,x),M=C,++p,a.util.setImmediate(z);A+=r<F?y:y.substr(0,G);++r;q()}"function"===typeof m&&(h=m,m=null);if(e&&!a.disableNativeCode&&k.pbkdf2&&(null===m||"object"!==typeof m)&&(4<k.pbkdf2Sync.length||!m||"sha1"===m))return"string"!==typeof m&&(m="sha1"),c=new Buffer(c,"binary"),h?4===k.pbkdf2Sync.length?k.pbkdf2(b,
361
+c,d,g,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):k.pbkdf2(b,c,d,g,m,function(a,b){if(a)return h(a);h(null,b.toString("binary"))}):4===k.pbkdf2Sync.length?k.pbkdf2Sync(b,c,d,g).toString("binary"):k.pbkdf2Sync(b,c,d,g,m).toString("binary");if("undefined"===typeof m||null===m)m=a.md.sha1.create();if("string"===typeof m){if(!(m in a.md.algorithms))throw Error("Unknown hash algorithm: "+m);m=a.md[m].create()}var x=m.digestLength;if(g>4294967295*x){b=Error("Derived key is too long.");
362
+if(h)return h(b);throw b;}var F=Math.ceil(g/x),G=g-(F-1)*x,E=a.hmac.create();E.start(m,b);var A="",y,C,M;if(!h){for(var r=1;r<=F;++r){E.start(null,null);E.update(c);E.update(a.util.int32ToBytes(r));y=M=E.digest().getBytes();for(var p=2;p<=d;++p)E.start(null,null),E.update(M),C=E.digest().getBytes(),y=a.util.xorBytes(y,C,x),M=C;A+=r<F?y:y.substr(0,G)}return A}r=1;q()}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===
363
+typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pbkdf2)return c.pbkdf2;c.defined.pbkdf2=!0;for(var m=0;m<e.length;++m)e[m](c);return c.pbkdf2}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pbkdf2",["require","module",
364
+"./hmac","./md","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var d="undefined"!==typeof process&&process.versions&&process.versions.node,e=null;a.disableNativeCode||!d||process.versions["node-webkit"]||(e=c("crypto"));(a.prng=a.prng||{}).create=function(b){function c(a){if(32<=g.pools[0].messageLength)return d(),a();g.seedFile(32-g.pools[0].messageLength<<5,function(b,c){if(b)return a(b);g.collect(c);d();a()})}function d(){var a=g.plugin.md.create();
365
+a.update(g.pools[0].digest().getBytes());g.pools[0].start();for(var b=1,c=1;32>c;++c)b=31===b?2147483648:b<<2,0===b%g.reseeds&&(a.update(g.pools[c].digest().getBytes()),g.pools[c].start());b=a.digest().getBytes();a.start();a.update(b);a=a.digest().getBytes();g.key=g.plugin.formatKey(b);g.seed=g.plugin.formatSeed(a);g.reseeds=4294967295===g.reseeds?0:g.reseeds+1;g.generated=0}function m(b){var c=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(c=function(a){return d.getRandomValues(a)})}var g=
366
+a.util.createBuffer();if(c)for(;g.length()<b;){var e=Math.max(1,Math.min(b-g.length(),65536)/4),k=new Uint32Array(Math.floor(e));try{for(c(k),e=0;e<k.length;++e)g.putInt32(k[e])}catch(A){if(!("undefined"!==typeof QuotaExceededError&&A instanceof QuotaExceededError))throw A;}}if(g.length()<b)for(c=Math.floor(65536*Math.random());g.length()<b;)for(e=16807*(c&65535),c=16807*(c>>16),e+=(c&32767)<<16,e+=c>>15,e=(e&2147483647)+(e>>31),c=e&4294967295,e=0;3>e;++e)k=c>>>(e<<3),k^=Math.floor(256*Math.random()),
367
+g.putByte(String.fromCharCode(k&255));return g.getBytes(b)}var g={plugin:b,key:null,seed:null,time:null,reseeds:0,generated:0};b=b.md;for(var h=Array(32),u=0;32>u;++u)h[u]=b.create();g.pools=h;g.pool=0;g.generate=function(b,d){function e(C){if(C)return d(C);if(y.length()>=b)return d(null,y.getBytes(b));1048575<g.generated&&(g.key=null);if(null===g.key)return a.util.nextTick(function(){c(e)});C=k(g.key,g.seed);g.generated+=C.length;y.putBytes(C);g.key=l(k(g.key,m(g.seed)));g.seed=A(k(g.key,g.seed));
368
+a.util.setImmediate(e)}if(!d)return g.generateSync(b);var k=g.plugin.cipher,m=g.plugin.increment,l=g.plugin.formatKey,A=g.plugin.formatSeed,y=a.util.createBuffer();g.key=null;e()};g.generateSync=function(b){var c=g.plugin.cipher,e=g.plugin.increment,k=g.plugin.formatKey,m=g.plugin.formatSeed;g.key=null;for(var l=a.util.createBuffer();l.length()<b;){1048575<g.generated&&(g.key=null);null===g.key&&(32<=g.pools[0].messageLength||g.collect(g.seedFileSync(32-g.pools[0].messageLength<<5)),d());var A=c(g.key,
369
+g.seed);g.generated+=A.length;l.putBytes(A);g.key=k(c(g.key,e(g.seed)));g.seed=m(c(g.key,g.seed))}return l.getBytes(b)};e?(g.seedFile=function(a,b){e.randomBytes(a,function(a,c){if(a)return b(a);b(null,c.toString())})},g.seedFileSync=function(a){return e.randomBytes(a).toString()}):(g.seedFile=function(a,b){try{b(null,m(a))}catch(c){b(c)}},g.seedFileSync=m);g.collect=function(a){for(var b=a.length,c=0;c<b;++c)g.pools[g.pool].update(a.substr(c,1)),g.pool=31===g.pool?0:g.pool+1};g.collectInt=function(a,
370
b){for(var c="",d=0;d<b;d+=8)c+=String.fromCharCode(a>>d&255);g.collect(c)};g.registerWorker=function(a){a===self?g.seedFile=function(a,b){function c(a){a=a.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",c),b(a.forge.prng.err,a.forge.prng.bytes))}self.addEventListener("message",c);self.postMessage({forge:{prng:{needed:a}}})}:a.addEventListener("message",function(b){b=b.data;b.forge&&b.forge.prng&&g.seedFile(b.forge.prng.needed,function(b,c){a.postMessage({forge:{prng:{err:b,bytes:c}}})})})};
371
-return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.prng)return c.prng;c.defined.prng=!0;for(var p=0;p<e.length;++p)e[p](c);return c.prng}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,
372
-0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/prng",["require","module","./md","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.random&&a.random.getBytes||function(b){function c(){var b=a.prng.create(d);b.getBytes=function(a,c){return b.generate(a,c)};b.getBytesSync=function(a){return b.generate(a)};return b}var d={},e=Array(4),h=a.util.createBuffer();d.formatKey=function(b){var c=a.util.createBuffer(b);b=Array(4);
373
-b[0]=c.getInt32();b[1]=c.getInt32();b[2]=c.getInt32();b[3]=c.getInt32();return a.aes._expandKey(b,!1)};d.formatSeed=function(b){var c=a.util.createBuffer(b);b=Array(4);b[0]=c.getInt32();b[1]=c.getInt32();b[2]=c.getInt32();b[3]=c.getInt32();return b};d.cipher=function(b,c){a.aes._updateBlock(b,c,e,!1);h.putInt32(e[0]);h.putInt32(e[1]);h.putInt32(e[2]);h.putInt32(e[3]);return h.getBytes()};d.increment=function(a){++a[3];return a};d.md=a.md.sha256;var v=c(),g="undefined"!==typeof process&&process.versions&&
374
-process.versions.node,l=null;if("undefined"!==typeof window){var r=window.crypto||window.msCrypto;r&&r.getRandomValues&&(l=function(a){return r.getRandomValues(a)})}if(a.disableNativeCode||!g&&!l){v.collectInt(+new Date,32);if("undefined"!==typeof navigator){var g="",k;for(k in navigator)try{"string"==typeof navigator[k]&&(g+=navigator[k])}catch(z){}v.collect(g);g=null}b&&(b().mousemove(function(a){v.collectInt(a.clientX,16);v.collectInt(a.clientY,16)}),b().keypress(function(a){v.collectInt(a.charCode,
375
-8)}))}if(a.random)for(k in v)a.random[k]=v[k];else a.random=v;a.random.createInstance=c}("undefined"!==typeof jQuery?jQuery:null)}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.random)return c.random;c.defined.random=!0;for(var p=0;p<e.length;++p)e[p](c);
376
-return c.random}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/random","require module ./aes ./md ./prng ./util".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,
371
+return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.prng)return c.prng;c.defined.prng=!0;for(var m=0;m<e.length;++m)e[m](c);return c.prng}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,
372
+0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/prng",["require","module","./md","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.random&&a.random.getBytes||function(b){function c(){var b=a.prng.create(d);b.getBytes=function(a,c){return b.generate(a,c)};b.getBytesSync=function(a){return b.generate(a)};return b}var d={},e=Array(4),h=a.util.createBuffer();d.formatKey=function(b){var c=a.util.createBuffer(b);b=Array(4);
373
+b[0]=c.getInt32();b[1]=c.getInt32();b[2]=c.getInt32();b[3]=c.getInt32();return a.aes._expandKey(b,!1)};d.formatSeed=function(b){var c=a.util.createBuffer(b);b=Array(4);b[0]=c.getInt32();b[1]=c.getInt32();b[2]=c.getInt32();b[3]=c.getInt32();return b};d.cipher=function(b,c){a.aes._updateBlock(b,c,e,!1);h.putInt32(e[0]);h.putInt32(e[1]);h.putInt32(e[2]);h.putInt32(e[3]);return h.getBytes()};d.increment=function(a){++a[3];return a};d.md=a.md.sha256;var l=c(),g="undefined"!==typeof process&&process.versions&&
374
+process.versions.node,q=null;if("undefined"!==typeof window){var u=window.crypto||window.msCrypto;u&&u.getRandomValues&&(q=function(a){return u.getRandomValues(a)})}if(a.disableNativeCode||!g&&!q){l.collectInt(+new Date,32);if("undefined"!==typeof navigator){var g="",r;for(r in navigator)try{"string"==typeof navigator[r]&&(g+=navigator[r])}catch(z){}l.collect(g);g=null}b&&(b().mousemove(function(a){l.collectInt(a.clientX,16);l.collectInt(a.clientY,16)}),b().keypress(function(a){l.collectInt(a.charCode,
375
+8)}))}if(a.random)for(r in l)a.random[r]=l[r];else a.random=l;a.random.createInstance=c}("undefined"!==typeof jQuery?jQuery:null)}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.random)return c.random;c.defined.random=!0;for(var m=0;m<e.length;++m)e[m](c);
376
+return c.random}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/random","require module ./aes ./md ./prng ./util".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,
377
139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,
378
-175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],d=[1,2,3,5];a.rc2=a.rc2||{};a.rc2.expandKey=function(b,d){"string"===typeof b&&(b=a.util.createBuffer(b));d=d||128;var e=b,g=b.length(),m=d,r=Math.ceil(m/8),m=255>>(m&7),l;for(l=g;128>l;l++)e.putByte(c[e.at(l-
379
-1)+e.at(l-g)&255]);e.setAt(128-r,c[e.at(128-r)&m]);for(l=127-r;0<=l;l--)e.setAt(l,c[e.at(l+1)^e.at(l+r)]);return e};var e=function(b,c,e){var g=!1,m=null,p=null,l=null,k,B,u,F,D=[];b=a.rc2.expandKey(b,c);for(u=0;64>u;u++)D.push(b.getInt16Le());e?(k=function(a){for(u=0;4>u;u++){a[u]+=D[F]+(a[(u+3)%4]&a[(u+2)%4])+(~a[(u+3)%4]&a[(u+1)%4]);var b=a[u],c=d[u];a[u]=b<<c&65535|(b&65535)>>16-c;F++}},B=function(a){for(u=0;4>u;u++)a[u]+=D[a[(u+3)%4]&63]}):(k=function(a){for(u=3;0<=u;u--){var b=a[u],c=d[u];a[u]=
380
-(b&65535)>>c|b<<16-c&65535;a[u]-=D[F]+(a[(u+3)%4]&a[(u+2)%4])+(~a[(u+3)%4]&a[(u+1)%4]);F--}},B=function(a){for(u=3;0<=u;u--)a[u]-=D[a[(u+3)%4]&63]});var A=null;return A={start:function(b,c){b&&"string"===typeof b&&(b=a.util.createBuffer(b));g=!1;m=a.util.createBuffer();p=c||new a.util.createBuffer;l=b;A.output=p},update:function(a){for(g||m.putBuffer(a);8<=m.length();){a=[[5,k],[1,B],[6,k],[1,B],[5,k]];var b=[];for(u=0;4>u;u++){var c=m.getInt16Le();null!==l&&(e?c^=l.getInt16Le():l.putInt16Le(c));
381
-b.push(c&65535)}F=e?0:63;for(c=0;c<a.length;c++)for(var d=0;d<a[c][0];d++)a[c][1](b);for(u=0;4>u;u++)null!==l&&(e?l.putInt16Le(b[u]):b[u]^=l.getInt16Le()),p.putInt16Le(b[u])}},finish:function(a){var b=!0;if(e)if(a)b=a(8,m,!e);else{var c=8===m.length()?8:8-m.length();m.fillWithByte(c,c)}b&&(g=!0,A.update());!e&&(b=0===m.length())&&(a?b=a(8,p,!e):(a=p.length(),c=p.at(a-1),c>a?b=!1:p.truncate(c)));return b}}};a.rc2.startEncrypting=function(b,c,d){b=a.rc2.createEncryptionCipher(b,128);b.start(c,d);return b};
382
-a.rc2.createEncryptionCipher=function(a,b){return e(a,b,!0)};a.rc2.startDecrypting=function(b,c,d){b=a.rc2.createDecryptionCipher(b,128);b.start(c,d);return b};a.rc2.createDecryptionCipher=function(a,b){return e(a,b,!1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
383
-{};if(c.defined.rc2)return c.rc2;c.defined.rc2=!0;for(var p=0;p<e.length;++p)e[p](c);return c.rc2}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/rc2",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){this.data=[];null!=a&&("number"==typeof a?
384
-this.fromNumber(a,b,d):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function d(){return new c(null)}function e(a,b,c,d,n,g){for(;0<=--g;){var m=b*this.data[a++]+c.data[d]+n;n=Math.floor(m/67108864);c.data[d++]=m&67108863}return n}function l(a,b,c,d,e,n){var g=b&32767;for(b>>=15;0<=--n;){var m=this.data[a]&32767,A=this.data[a++]>>15,y=b*m+A*g,m=g*m+((y&32767)<<15)+c.data[d]+(e&1073741823);e=(m>>>30)+(y>>>15)+b*A+(e>>>30);c.data[d++]=m&1073741823}return e}function h(a,b,
385
-c,d,e,n){var g=b&16383;for(b>>=14;0<=--n;){var m=this.data[a]&16383,A=this.data[a++]>>14,y=b*m+A*g,m=g*m+((y&16383)<<14)+c.data[d]+e;e=(m>>28)+(y>>14)+b*A;c.data[d++]=m&268435455}return e}function v(a,b){var c=ba[a.charCodeAt(b)];return null==c?-1:c}function g(a){var b=d();b.fromInt(a);return b}function k(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function r(a){this.m=a}function E(a){this.m=a;this.mp=a.invDigit();
386
-this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}function z(a,b){return a&b}function B(a,b){return a|b}function u(a,b){return a^b}function F(a,b){return a&~b}function D(){}function A(a){return a}function y(a){this.r2=d();this.q3=d();c.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function C(){return{nextBytes:function(a){for(var b=0;b<a.length;++b)a[b]=Math.floor(256*Math.random())}}}var M;"undefined"===typeof navigator?(c.prototype.am=h,M=28):"Microsoft Internet Explorer"==
387
-navigator.appName?(c.prototype.am=l,M=30):"Netscape"!=navigator.appName?(c.prototype.am=e,M=26):(c.prototype.am=h,M=28);c.prototype.DB=M;c.prototype.DM=(1<<M)-1;c.prototype.DV=1<<M;c.prototype.FV=Math.pow(2,52);c.prototype.F1=52-M;c.prototype.F2=2*M-52;var ba=[],q;M=48;for(q=0;9>=q;++q)ba[M++]=q;M=97;for(q=10;36>q;++q)ba[M++]=q;M=65;for(q=10;36>q;++q)ba[M++]=q;r.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};r.prototype.revert=function(a){return a};r.prototype.reduce=
388
-function(a){a.divRemTo(this.m,null,a)};r.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};r.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};E.prototype.convert=function(a){var b=d();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);0>a.s&&0<b.compareTo(c.ZERO)&&this.m.subTo(b,b);return b};E.prototype.revert=function(a){var b=d();a.copyTo(b);this.reduce(b);return b};E.prototype.reduce=function(a){for(;a.t<=this.mt2;)a.data[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=
389
-a.data[b]&32767,d=c*this.mpl+((c*this.mph+(a.data[b]>>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a.data[c]+=this.m.am(0,d,a,b,0,this.m.t);a.data[c]>=a.DV;)a.data[c]-=a.DV,a.data[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};E.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};E.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};c.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a.data[b]=this.data[b];a.t=this.t;a.s=this.s};
390
-c.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0<a?this.data[0]=a:-1>a?this.data[0]=a+this.DV:this.t=0};c.prototype.fromString=function(a,b){var d;if(16==b)d=4;else if(8==b)d=3;else if(256==b)d=8;else if(2==b)d=1;else if(32==b)d=5;else if(4==b)d=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var e=a.length,n=!1,g=0;0<=--e;){var m=8==d?a[e]&255:v(a,e);0>m?"-"==a.charAt(e)&&(n=!0):(n=!1,0==g?this.data[this.t++]=m:g+d>this.DB?(this.data[this.t-1]|=(m&(1<<this.DB-g)-1)<<g,this.data[this.t++]=
391
-m>>this.DB-g):this.data[this.t-1]|=m<<g,g+=d,g>=this.DB&&(g-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0<g&&(this.data[this.t-1]|=(1<<this.DB-g)-1<<g));this.clamp();n&&c.ZERO.subTo(this,this)};c.prototype.clamp=function(){for(var a=this.s&this.DM;0<this.t&&this.data[this.t-1]==a;)--this.t};c.prototype.dlShiftTo=function(a,b){var c;for(c=this.t-1;0<=c;--c)b.data[c+a]=this.data[c];for(c=a-1;0<=c;--c)b.data[c]=0;b.t=this.t+a;b.s=this.s};c.prototype.drShiftTo=function(a,b){for(var c=a;c<this.t;++c)b.data[c-
392
-a]=this.data[c];b.t=Math.max(this.t-a,0);b.s=this.s};c.prototype.lShiftTo=function(a,b){var c=a%this.DB,d=this.DB-c,e=(1<<d)-1,n=Math.floor(a/this.DB),g=this.s<<c&this.DM,m;for(m=this.t-1;0<=m;--m)b.data[m+n+1]=this.data[m]>>d|g,g=(this.data[m]&e)<<c;for(m=n-1;0<=m;--m)b.data[m]=0;b.data[n]=g;b.t=this.t+n+1;b.s=this.s;b.clamp()};c.prototype.rShiftTo=function(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,n=(1<<d)-1;b.data[0]=this.data[c]>>d;for(var g=
393
-c+1;g<this.t;++g)b.data[g-c-1]|=(this.data[g]&n)<<e,b.data[g-c]=this.data[g]>>d;0<d&&(b.data[this.t-c-1]|=(this.s&n)<<e);b.t=this.t-c;b.clamp()}};c.prototype.subTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this.data[c]-a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b.data[c++]=this.DV+d:0<d&&
394
-(b.data[c++]=d);b.t=c;b.clamp()};c.prototype.multiplyTo=function(a,b){var d=this.abs(),e=a.abs(),n=d.t;for(b.t=n+e.t;0<=--n;)b.data[n]=0;for(n=0;n<e.t;++n)b.data[n+d.t]=d.am(0,e.data[n],b,n,0,d.t);b.s=0;b.clamp();this.s!=a.s&&c.ZERO.subTo(b,b)};c.prototype.squareTo=function(a){for(var b=this.abs(),c=a.t=2*b.t;0<=--c;)a.data[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b.data[c],a,2*c,0,1);(a.data[c+b.t]+=b.am(c+1,2*b.data[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a.data[c+b.t]-=b.DV,a.data[c+b.t+1]=1)}0<a.t&&(a.data[a.t-
395
-1]+=b.am(c,b.data[c],a,2*c,0,1));a.s=0;a.clamp()};c.prototype.divRemTo=function(a,b,e){var n=a.abs();if(!(0>=n.t)){var g=this.abs();if(g.t<n.t)null!=b&&b.fromInt(0),null!=e&&this.copyTo(e);else{null==e&&(e=d());var m=d(),A=this.s;a=a.s;var y=this.DB-k(n.data[n.t-1]);0<y?(n.lShiftTo(y,m),g.lShiftTo(y,e)):(n.copyTo(m),g.copyTo(e));n=m.t;g=m.data[n-1];if(0!=g){var h=g*(1<<this.F1)+(1<n?m.data[n-2]>>this.F2:0),r=this.FV/h,h=(1<<this.F1)/h,C=1<<this.F2,l=e.t,v=l-n,q=null==b?d():b;m.dlShiftTo(v,q);0<=e.compareTo(q)&&
396
-(e.data[e.t++]=1,e.subTo(q,e));c.ONE.dlShiftTo(n,q);for(q.subTo(m,m);m.t<n;)m.data[m.t++]=0;for(;0<=--v;){var D=e.data[--l]==g?this.DM:Math.floor(e.data[l]*r+(e.data[l-1]+C)*h);if((e.data[l]+=m.am(0,D,e,v,0,n))<D)for(m.dlShiftTo(v,q),e.subTo(q,e);e.data[l]<--D;)e.subTo(q,e)}null!=b&&(e.drShiftTo(n,b),A!=a&&c.ZERO.subTo(b,b));e.t=n;e.clamp();0<y&&e.rShiftTo(y,e);0>A&&c.ZERO.subTo(e,e)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-
397
-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0<b?this.DV-b:-b};c.prototype.isEven=function(){return 0==(0<this.t?this.data[0]&1:this.s)};c.prototype.exp=function(a,b){if(4294967295<a||1>a)return c.ONE;var e=d(),n=d(),g=b.convert(this),m=k(a)-1;for(g.copyTo(e);0<=--m;)if(b.sqrTo(e,n),0<(a&1<<m))b.mulTo(n,g,e);else var A=e,e=n,n=A;return b.revert(e)};c.prototype.toString=function(a){if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=
398
-4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<<a)-1,c,d=!1,e="",n=this.t,g=this.DB-n*this.DB%a;if(0<n--)for(g<this.DB&&0<(c=this.data[n]>>g)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=n;)g<a?(c=(this.data[n]&(1<<g)-1)<<a-g,c|=this.data[--n]>>(g+=this.DB-a)):(c=this.data[n]>>(g-=a)&b,0>=g&&(g+=this.DB,--n)),0<c&&(d=!0),d&&(e+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));return d?e:"0"};c.prototype.negate=function(){var a=
399
-d();c.ZERO.subTo(this,a);return a};c.prototype.abs=function(){return 0>this.s?this.negate():this};c.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this.data[c]-a.data[c]))return b;return 0};c.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+k(this.data[this.t-1]^this.s&this.DM)};c.prototype.mod=function(a){var b=d();this.abs().divRemTo(a,null,b);0>this.s&&0<b.compareTo(c.ZERO)&&a.subTo(b,
400
-b);return b};c.prototype.modPowInt=function(a,b){var c;c=256>a||b.isEven()?new r(b):new E(b);return this.exp(a,c)};c.ZERO=g(0);c.ONE=g(1);D.prototype.convert=A;D.prototype.revert=A;D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};D.prototype.sqrTo=function(a,b){a.squareTo(b)};y.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=d();a.copyTo(b);this.reduce(b);return b};y.prototype.revert=function(a){return a};y.prototype.reduce=function(a){a.drShiftTo(this.m.t-
401
-1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};y.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};y.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var V=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,
402
-113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],T=67108864/V[V.length-1];c.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};c.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36<a)return"0";var b=this.chunkSize(a),b=Math.pow(a,
403
-b),c=g(b),e=d(),n=d(),m="";for(this.divRemTo(c,e,n);0<e.signum();)m=(b+n.intValue()).toString(a).substr(1)+m,e.divRemTo(c,e,n);return n.intValue().toString(a)+m};c.prototype.fromRadix=function(a,b){this.fromInt(0);null==b&&(b=10);for(var d=this.chunkSize(b),e=Math.pow(b,d),n=!1,g=0,m=0,A=0;A<a.length;++A){var y=v(a,A);0>y?"-"==a.charAt(A)&&0==this.signum()&&(n=!0):(m=b*m+y,++g>=d&&(this.dMultiply(e),this.dAddOffset(m,0),m=g=0))}0<g&&(this.dMultiply(Math.pow(b,g)),this.dAddOffset(m,0));n&&c.ZERO.subTo(this,
404
-this)};c.prototype.fromNumber=function(a,b,d){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),B,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0<e?d[0]&(1<<e)-1:0;this.fromString(d,256)}};c.prototype.bitwiseTo=function(a,b,c){var d,e,n=Math.min(a.t,this.t);for(d=
405
-0;d<n;++d)c.data[d]=b(this.data[d],a.data[d]);if(a.t<this.t){e=a.s&this.DM;for(d=n;d<this.t;++d)c.data[d]=b(this.data[d],e);c.t=this.t}else{e=this.s&this.DM;for(d=n;d<a.t;++d)c.data[d]=b(e,a.data[d]);c.t=a.t}c.s=b(this.s,a.s);c.clamp()};c.prototype.changeBit=function(a,b){var d=c.ONE.shiftLeft(a);this.bitwiseTo(d,b,d);return d};c.prototype.addTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this.data[c]+a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=
378
+175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],d=[1,2,3,5];a.rc2=a.rc2||{};a.rc2.expandKey=function(b,d){"string"===typeof b&&(b=a.util.createBuffer(b));d=d||128;var e=b,g=b.length(),k=d,h=Math.ceil(k/8),k=255>>(k&7),q;for(q=g;128>q;q++)e.putByte(c[e.at(q-
379
+1)+e.at(q-g)&255]);e.setAt(128-h,c[e.at(128-h)&k]);for(q=127-h;0<=q;q--)e.setAt(q,c[e.at(q+1)^e.at(q+h)]);return e};var e=function(b,c,e){var g=!1,k=null,m=null,h=null,q,x,F,G,E=[];b=a.rc2.expandKey(b,c);for(F=0;64>F;F++)E.push(b.getInt16Le());e?(q=function(a){for(F=0;4>F;F++){a[F]+=E[G]+(a[(F+3)%4]&a[(F+2)%4])+(~a[(F+3)%4]&a[(F+1)%4]);var b=a[F],c=d[F];a[F]=b<<c&65535|(b&65535)>>16-c;G++}},x=function(a){for(F=0;4>F;F++)a[F]+=E[a[(F+3)%4]&63]}):(q=function(a){for(F=3;0<=F;F--){var b=a[F],c=d[F];a[F]=
380
+(b&65535)>>c|b<<16-c&65535;a[F]-=E[G]+(a[(F+3)%4]&a[(F+2)%4])+(~a[(F+3)%4]&a[(F+1)%4]);G--}},x=function(a){for(F=3;0<=F;F--)a[F]-=E[a[(F+3)%4]&63]});var A=null;return A={start:function(b,c){b&&"string"===typeof b&&(b=a.util.createBuffer(b));g=!1;k=a.util.createBuffer();m=c||new a.util.createBuffer;h=b;A.output=m},update:function(a){for(g||k.putBuffer(a);8<=k.length();){a=[[5,q],[1,x],[6,q],[1,x],[5,q]];var b=[];for(F=0;4>F;F++){var c=k.getInt16Le();null!==h&&(e?c^=h.getInt16Le():h.putInt16Le(c));
381
+b.push(c&65535)}G=e?0:63;for(c=0;c<a.length;c++)for(var d=0;d<a[c][0];d++)a[c][1](b);for(F=0;4>F;F++)null!==h&&(e?h.putInt16Le(b[F]):b[F]^=h.getInt16Le()),m.putInt16Le(b[F])}},finish:function(a){var b=!0;if(e)if(a)b=a(8,k,!e);else{var c=8===k.length()?8:8-k.length();k.fillWithByte(c,c)}b&&(g=!0,A.update());!e&&(b=0===k.length())&&(a?b=a(8,m,!e):(a=m.length(),c=m.at(a-1),c>a?b=!1:m.truncate(c)));return b}}};a.rc2.startEncrypting=function(b,c,d){b=a.rc2.createEncryptionCipher(b,128);b.start(c,d);return b};
382
+a.rc2.createEncryptionCipher=function(a,b){return e(a,b,!0)};a.rc2.startDecrypting=function(b,c,d){b=a.rc2.createDecryptionCipher(b,128);b.start(c,d);return b};a.rc2.createDecryptionCipher=function(a,b){return e(a,b,!1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
383
+{};if(c.defined.rc2)return c.rc2;c.defined.rc2=!0;for(var m=0;m<e.length;++m)e[m](c);return c.rc2}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/rc2",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){this.data=[];null!=a&&("number"==typeof a?
384
+this.fromNumber(a,b,d):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function d(){return new c(null)}function e(a,b,c,d,g,n){for(;0<=--n;){var k=b*this.data[a++]+c.data[d]+g;g=Math.floor(k/67108864);c.data[d++]=k&67108863}return g}function h(a,b,c,d,e,g){var n=b&32767;for(b>>=15;0<=--g;){var k=this.data[a]&32767,y=this.data[a++]>>15,A=b*k+y*n,k=n*k+((A&32767)<<15)+c.data[d]+(e&1073741823);e=(k>>>30)+(A>>>15)+b*y+(e>>>30);c.data[d++]=k&1073741823}return e}function q(a,b,
385
+c,d,e,g){var n=b&16383;for(b>>=14;0<=--g;){var k=this.data[a]&16383,y=this.data[a++]>>14,A=b*k+y*n,k=n*k+((A&16383)<<14)+c.data[d]+e;e=(k>>28)+(A>>14)+b*y;c.data[d++]=k&268435455}return e}function l(a,b){var c=ba[a.charCodeAt(b)];return null==c?-1:c}function g(a){var b=d();b.fromInt(a);return b}function r(a){var b=1,c;0!=(c=a>>>16)&&(a=c,b+=16);0!=(c=a>>8)&&(a=c,b+=8);0!=(c=a>>4)&&(a=c,b+=4);0!=(c=a>>2)&&(a=c,b+=2);0!=a>>1&&(b+=1);return b}function u(a){this.m=a}function D(a){this.m=a;this.mp=a.invDigit();
386
+this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}function z(a,b){return a&b}function x(a,b){return a|b}function F(a,b){return a^b}function G(a,b){return a&~b}function E(){}function A(a){return a}function y(a){this.r2=d();this.q3=d();c.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function C(){return{nextBytes:function(a){for(var b=0;b<a.length;++b)a[b]=Math.floor(256*Math.random())}}}var M;"undefined"===typeof navigator?(c.prototype.am=q,M=28):"Microsoft Internet Explorer"==
387
+navigator.appName?(c.prototype.am=h,M=30):"Netscape"!=navigator.appName?(c.prototype.am=e,M=26):(c.prototype.am=q,M=28);c.prototype.DB=M;c.prototype.DM=(1<<M)-1;c.prototype.DV=1<<M;c.prototype.FV=Math.pow(2,52);c.prototype.F1=52-M;c.prototype.F2=2*M-52;var ba=[],p;M=48;for(p=0;9>=p;++p)ba[M++]=p;M=97;for(p=10;36>p;++p)ba[M++]=p;M=65;for(p=10;36>p;++p)ba[M++]=p;u.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};u.prototype.revert=function(a){return a};u.prototype.reduce=
388
+function(a){a.divRemTo(this.m,null,a)};u.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};u.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};D.prototype.convert=function(a){var b=d();a.abs().dlShiftTo(this.m.t,b);b.divRemTo(this.m,null,b);0>a.s&&0<b.compareTo(c.ZERO)&&this.m.subTo(b,b);return b};D.prototype.revert=function(a){var b=d();a.copyTo(b);this.reduce(b);return b};D.prototype.reduce=function(a){for(;a.t<=this.mt2;)a.data[a.t++]=0;for(var b=0;b<this.m.t;++b){var c=
389
+a.data[b]&32767,d=c*this.mpl+((c*this.mph+(a.data[b]>>15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a.data[c]+=this.m.am(0,d,a,b,0,this.m.t);a.data[c]>=a.DV;)a.data[c]-=a.DV,a.data[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};D.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};D.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};c.prototype.copyTo=function(a){for(var b=this.t-1;0<=b;--b)a.data[b]=this.data[b];a.t=this.t;a.s=this.s};
390
+c.prototype.fromInt=function(a){this.t=1;this.s=0>a?-1:0;0<a?this.data[0]=a:-1>a?this.data[0]=a+this.DV:this.t=0};c.prototype.fromString=function(a,b){var d;if(16==b)d=4;else if(8==b)d=3;else if(256==b)d=8;else if(2==b)d=1;else if(32==b)d=5;else if(4==b)d=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var e=a.length,g=!1,n=0;0<=--e;){var k=8==d?a[e]&255:l(a,e);0>k?"-"==a.charAt(e)&&(g=!0):(g=!1,0==n?this.data[this.t++]=k:n+d>this.DB?(this.data[this.t-1]|=(k&(1<<this.DB-n)-1)<<n,this.data[this.t++]=
391
+k>>this.DB-n):this.data[this.t-1]|=k<<n,n+=d,n>=this.DB&&(n-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0<n&&(this.data[this.t-1]|=(1<<this.DB-n)-1<<n));this.clamp();g&&c.ZERO.subTo(this,this)};c.prototype.clamp=function(){for(var a=this.s&this.DM;0<this.t&&this.data[this.t-1]==a;)--this.t};c.prototype.dlShiftTo=function(a,b){var c;for(c=this.t-1;0<=c;--c)b.data[c+a]=this.data[c];for(c=a-1;0<=c;--c)b.data[c]=0;b.t=this.t+a;b.s=this.s};c.prototype.drShiftTo=function(a,b){for(var c=a;c<this.t;++c)b.data[c-
392
+a]=this.data[c];b.t=Math.max(this.t-a,0);b.s=this.s};c.prototype.lShiftTo=function(a,b){var c=a%this.DB,d=this.DB-c,e=(1<<d)-1,g=Math.floor(a/this.DB),n=this.s<<c&this.DM,k;for(k=this.t-1;0<=k;--k)b.data[k+g+1]=this.data[k]>>d|n,n=(this.data[k]&e)<<c;for(k=g-1;0<=k;--k)b.data[k]=0;b.data[g]=n;b.t=this.t+g+1;b.s=this.s;b.clamp()};c.prototype.rShiftTo=function(a,b){b.s=this.s;var c=Math.floor(a/this.DB);if(c>=this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,g=(1<<d)-1;b.data[0]=this.data[c]>>d;for(var n=
393
+c+1;n<this.t;++n)b.data[n-c-1]|=(this.data[n]&g)<<e,b.data[n-c]=this.data[n]>>d;0<d&&(b.data[this.t-c-1]|=(this.s&g)<<e);b.t=this.t-c;b.clamp()}};c.prototype.subTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this.data[c]-a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;c<this.t;)d+=this.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d-=a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b.data[c++]=this.DV+d:0<d&&
394
+(b.data[c++]=d);b.t=c;b.clamp()};c.prototype.multiplyTo=function(a,b){var d=this.abs(),e=a.abs(),g=d.t;for(b.t=g+e.t;0<=--g;)b.data[g]=0;for(g=0;g<e.t;++g)b.data[g+d.t]=d.am(0,e.data[g],b,g,0,d.t);b.s=0;b.clamp();this.s!=a.s&&c.ZERO.subTo(b,b)};c.prototype.squareTo=function(a){for(var b=this.abs(),c=a.t=2*b.t;0<=--c;)a.data[c]=0;for(c=0;c<b.t-1;++c){var d=b.am(c,b.data[c],a,2*c,0,1);(a.data[c+b.t]+=b.am(c+1,2*b.data[c],a,2*c+1,d,b.t-c-1))>=b.DV&&(a.data[c+b.t]-=b.DV,a.data[c+b.t+1]=1)}0<a.t&&(a.data[a.t-
395
+1]+=b.am(c,b.data[c],a,2*c,0,1));a.s=0;a.clamp()};c.prototype.divRemTo=function(a,b,e){var g=a.abs();if(!(0>=g.t)){var n=this.abs();if(n.t<g.t)null!=b&&b.fromInt(0),null!=e&&this.copyTo(e);else{null==e&&(e=d());var k=d(),y=this.s;a=a.s;var A=this.DB-r(g.data[g.t-1]);0<A?(g.lShiftTo(A,k),n.lShiftTo(A,e)):(g.copyTo(k),n.copyTo(e));g=k.t;n=k.data[g-1];if(0!=n){var l=n*(1<<this.F1)+(1<g?k.data[g-2]>>this.F2:0),C=this.FV/l,l=(1<<this.F1)/l,h=1<<this.F2,p=e.t,u=p-g,q=null==b?d():b;k.dlShiftTo(u,q);0<=e.compareTo(q)&&
396
+(e.data[e.t++]=1,e.subTo(q,e));c.ONE.dlShiftTo(g,q);for(q.subTo(k,k);k.t<g;)k.data[k.t++]=0;for(;0<=--u;){var E=e.data[--p]==n?this.DM:Math.floor(e.data[p]*C+(e.data[p-1]+h)*l);if((e.data[p]+=k.am(0,E,e,u,0,g))<E)for(k.dlShiftTo(u,q),e.subTo(q,e);e.data[p]<--E;)e.subTo(q,e)}null!=b&&(e.drShiftTo(g,b),y!=a&&c.ZERO.subTo(b,b));e.t=g;e.clamp();0<A&&e.rShiftTo(A,e);0>y&&c.ZERO.subTo(e,e)}}}};c.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-
397
+(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0<b?this.DV-b:-b};c.prototype.isEven=function(){return 0==(0<this.t?this.data[0]&1:this.s)};c.prototype.exp=function(a,b){if(4294967295<a||1>a)return c.ONE;var e=d(),g=d(),n=b.convert(this),k=r(a)-1;for(n.copyTo(e);0<=--k;)if(b.sqrTo(e,g),0<(a&1<<k))b.mulTo(g,n,e);else var y=e,e=g,g=y;return b.revert(e)};c.prototype.toString=function(a){if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=
398
+4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<<a)-1,c,d=!1,e="",g=this.t,n=this.DB-g*this.DB%a;if(0<g--)for(n<this.DB&&0<(c=this.data[g]>>n)&&(d=!0,e="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));0<=g;)n<a?(c=(this.data[g]&(1<<n)-1)<<a-n,c|=this.data[--g]>>(n+=this.DB-a)):(c=this.data[g]>>(n-=a)&b,0>=n&&(n+=this.DB,--g)),0<c&&(d=!0),d&&(e+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(c));return d?e:"0"};c.prototype.negate=function(){var a=
399
+d();c.ZERO.subTo(this,a);return a};c.prototype.abs=function(){return 0>this.s?this.negate():this};c.prototype.compareTo=function(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return 0>this.s?-b:b;for(;0<=--c;)if(0!=(b=this.data[c]-a.data[c]))return b;return 0};c.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+r(this.data[this.t-1]^this.s&this.DM)};c.prototype.mod=function(a){var b=d();this.abs().divRemTo(a,null,b);0>this.s&&0<b.compareTo(c.ZERO)&&a.subTo(b,
400
+b);return b};c.prototype.modPowInt=function(a,b){var c;c=256>a||b.isEven()?new u(b):new D(b);return this.exp(a,c)};c.ZERO=g(0);c.ONE=g(1);E.prototype.convert=A;E.prototype.revert=A;E.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c)};E.prototype.sqrTo=function(a,b){a.squareTo(b)};y.prototype.convert=function(a){if(0>a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=d();a.copyTo(b);this.reduce(b);return b};y.prototype.revert=function(a){return a};y.prototype.reduce=function(a){a.drShiftTo(this.m.t-
401
+1,this.r2);a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp());this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)};y.prototype.mulTo=function(a,b,c){a.multiplyTo(b,c);this.reduce(c)};y.prototype.sqrTo=function(a,b){a.squareTo(b);this.reduce(b)};var T=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,
402
+113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],U=67108864/T[T.length-1];c.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};c.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36<a)return"0";var b=this.chunkSize(a),b=Math.pow(a,
403
+b),c=g(b),e=d(),n=d(),k="";for(this.divRemTo(c,e,n);0<e.signum();)k=(b+n.intValue()).toString(a).substr(1)+k,e.divRemTo(c,e,n);return n.intValue().toString(a)+k};c.prototype.fromRadix=function(a,b){this.fromInt(0);null==b&&(b=10);for(var d=this.chunkSize(b),e=Math.pow(b,d),g=!1,n=0,k=0,y=0;y<a.length;++y){var A=l(a,y);0>A?"-"==a.charAt(y)&&0==this.signum()&&(g=!0):(k=b*k+A,++n>=d&&(this.dMultiply(e),this.dAddOffset(k,0),k=n=0))}0<n&&(this.dMultiply(Math.pow(b,n)),this.dAddOffset(k,0));g&&c.ZERO.subTo(this,
404
+this)};c.prototype.fromNumber=function(a,b,d){if("number"==typeof b)if(2>a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(c.ONE.shiftLeft(a-1),x,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(c.ONE.shiftLeft(a-1),this);else{d=[];var e=a&7;d.length=(a>>3)+1;b.nextBytes(d);d[0]=0<e?d[0]&(1<<e)-1:0;this.fromString(d,256)}};c.prototype.bitwiseTo=function(a,b,c){var d,e,g=Math.min(a.t,this.t);for(d=
405
+0;d<g;++d)c.data[d]=b(this.data[d],a.data[d]);if(a.t<this.t){e=a.s&this.DM;for(d=g;d<this.t;++d)c.data[d]=b(this.data[d],e);c.t=this.t}else{e=this.s&this.DM;for(d=g;d<a.t;++d)c.data[d]=b(e,a.data[d]);c.t=a.t}c.s=b(this.s,a.s);c.clamp()};c.prototype.changeBit=function(a,b){var d=c.ONE.shiftLeft(a);this.bitwiseTo(d,b,d);return d};c.prototype.addTo=function(a,b){for(var c=0,d=0,e=Math.min(a.t,this.t);c<e;)d+=this.data[c]+a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;c<this.t;)d+=
406
this.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;c<a.t;)d+=a.data[c],b.data[c++]=d&this.DM,d>>=this.DB;d+=a.s}b.s=0>d?-1:0;0<d?b.data[c++]=d:-1>d&&(b.data[c++]=this.DV+d);b.t=c;b.clamp()};c.prototype.dMultiply=function(a){this.data[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};c.prototype.dAddOffset=function(a,b){if(0!=a){for(;this.t<=b;)this.data[this.t++]=0;for(this.data[b]+=a;this.data[b]>=this.DV;)this.data[b]-=this.DV,++b>=this.t&&(this.data[this.t++]=
407
0),++this.data[b]}};c.prototype.multiplyLowerTo=function(a,b,c){var d=Math.min(this.t+a.t,b);c.s=0;for(c.t=d;0<d;)c.data[--d]=0;var e;for(e=c.t-this.t;d<e;++d)c.data[d+this.t]=this.am(0,a.data[d],c,d,0,this.t);for(e=Math.min(a.t,b);d<e;++d)this.am(0,a.data[d],c,d,0,b-d);c.clamp()};c.prototype.multiplyUpperTo=function(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;0<=--d;)c.data[d]=0;for(d=Math.max(b-this.t,0);d<a.t;++d)c.data[this.t+d-b]=this.am(b-d,a.data[d],c,0,0,this.t+d-b);c.clamp();c.drShiftTo(1,
408
-c)};c.prototype.modInt=function(a){if(0>=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0<this.t)if(0==b)c=this.data[0]%a;else for(var d=this.t-1;0<=d;--d)c=(b*c+this.data[d])%a;return c};c.prototype.millerRabin=function(a){var b=this.subtract(c.ONE),d=b.getLowestSetBit();if(0>=d)return!1;for(var e=b.shiftRight(d),n=C(),g,m=0;m<a;++m){do g=new c(this.bitLength(),n);while(0>=g.compareTo(c.ONE)||0<=g.compareTo(b));g=g.modPow(e,this);if(0!=g.compareTo(c.ONE)&&0!=g.compareTo(b)){for(var A=1;A++<d&&0!=
409
-g.compareTo(b);)if(g=g.modPowInt(2,this),0==g.compareTo(c.ONE))return!1;if(0!=g.compareTo(b))return!1}}return!0};c.prototype.clone=function(){var a=d();this.copyTo(a);return a};c.prototype.intValue=function(){if(0>this.s){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]};c.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24};c.prototype.shortValue=
408
+c)};c.prototype.modInt=function(a){if(0>=a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0<this.t)if(0==b)c=this.data[0]%a;else for(var d=this.t-1;0<=d;--d)c=(b*c+this.data[d])%a;return c};c.prototype.millerRabin=function(a){var b=this.subtract(c.ONE),d=b.getLowestSetBit();if(0>=d)return!1;for(var e=b.shiftRight(d),g=C(),n,k=0;k<a;++k){do n=new c(this.bitLength(),g);while(0>=n.compareTo(c.ONE)||0<=n.compareTo(b));n=n.modPow(e,this);if(0!=n.compareTo(c.ONE)&&0!=n.compareTo(b)){for(var y=1;y++<d&&0!=
409
+n.compareTo(b);)if(n=n.modPowInt(2,this),0==n.compareTo(c.ONE))return!1;if(0!=n.compareTo(b))return!1}}return!0};c.prototype.clone=function(){var a=d();this.copyTo(a);return a};c.prototype.intValue=function(){if(0>this.s){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]};c.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24};c.prototype.shortValue=
410
function(){return 0==this.t?this.s:this.data[0]<<16>>16};c.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this.data[0]?0:1};c.prototype.toByteArray=function(){var a=this.t,b=[];b[0]=this.s;var c=this.DB-a*this.DB%8,d,e=0;if(0<a--)for(c<this.DB&&(d=this.data[a]>>c)!=(this.s&this.DM)>>c&&(b[e++]=d|this.s<<this.DB-c);0<=a;)if(8>c?(d=(this.data[a]&(1<<c)-1)<<8-c,d|=this.data[--a]>>(c+=this.DB-8)):(d=this.data[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0!=(d&128)&&(d|=-256),0==e&&
411
-(this.s&128)!=(d&128)&&++e,0<e||d!=this.s)b[e++]=d;return b};c.prototype.equals=function(a){return 0==this.compareTo(a)};c.prototype.min=function(a){return 0>this.compareTo(a)?this:a};c.prototype.max=function(a){return 0<this.compareTo(a)?this:a};c.prototype.and=function(a){var b=d();this.bitwiseTo(a,z,b);return b};c.prototype.or=function(a){var b=d();this.bitwiseTo(a,B,b);return b};c.prototype.xor=function(a){var b=d();this.bitwiseTo(a,u,b);return b};c.prototype.andNot=function(a){var b=d();this.bitwiseTo(a,
412
-F,b);return b};c.prototype.not=function(){for(var a=d(),b=0;b<this.t;++b)a.data[b]=this.DM&~this.data[b];a.t=this.t;a.s=~this.s;return a};c.prototype.shiftLeft=function(a){var b=d();0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};c.prototype.shiftRight=function(a){var b=d();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};c.prototype.getLowestSetBit=function(){for(var a=0;a<this.t;++a)if(0!=this.data[a]){var b=a*this.DB;a=this.data[a];if(0==a)a=-1;else{var c=0;0==(a&65535)&&(a>>=16,c+=16);
413
-0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};c.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c){for(var d=this.data[c]^b,e=0;0!=d;)d&=d-1,++e;a+=e}return a};c.prototype.testBit=function(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this.data[b]&1<<a%this.DB)};c.prototype.setBit=function(a){return this.changeBit(a,B)};c.prototype.clearBit=function(a){return this.changeBit(a,
414
-F)};c.prototype.flipBit=function(a){return this.changeBit(a,u)};c.prototype.add=function(a){var b=d();this.addTo(a,b);return b};c.prototype.subtract=function(a){var b=d();this.subTo(a,b);return b};c.prototype.multiply=function(a){var b=d();this.multiplyTo(a,b);return b};c.prototype.divide=function(a){var b=d();this.divRemTo(a,b,null);return b};c.prototype.remainder=function(a){var b=d();this.divRemTo(a,null,b);return b};c.prototype.divideAndRemainder=function(a){var b=d(),c=d();this.divRemTo(a,b,
415
-c);return[b,c]};c.prototype.modPow=function(a,b){var c=a.bitLength(),e,n=g(1),m;if(0>=c)return n;e=18>c?1:48>c?3:144>c?4:768>c?5:6;m=8>c?new r(b):b.isEven()?new y(b):new E(b);var A=[],h=3,p=e-1,C=(1<<e)-1;A[1]=m.convert(this);if(1<e)for(c=d(),m.sqrTo(A[1],c);h<=C;)A[h]=d(),m.mulTo(c,A[h-2],A[h]),h+=2;for(var l=a.t-1,v,q=!0,D=d(),c=k(a.data[l])-1;0<=l;){c>=p?v=a.data[l]>>c-p&C:(v=(a.data[l]&(1<<c+1)-1)<<p-c,0<l&&(v|=a.data[l-1]>>this.DB+c-p));for(h=e;0==(v&1);)v>>=1,--h;0>(c-=h)&&(c+=this.DB,--l);
416
-if(q)A[v].copyTo(n),q=!1;else{for(;1<h;)m.sqrTo(n,D),m.sqrTo(D,n),h-=2;0<h?m.sqrTo(n,D):(h=n,n=D,D=h);m.mulTo(D,A[v],n)}for(;0<=l&&0==(a.data[l]&1<<c);)m.sqrTo(n,D),h=n,n=D,D=h,0>--c&&(c=this.DB-1,--l)}return m.revert(n)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),n=g(1),m=g(0),A=g(0),y=g(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(n.isEven()&&m.isEven()||(n.addTo(this,n),m.subTo(a,m)),n.rShiftTo(1,
417
-n)):m.isEven()||m.subTo(a,m),m.rShiftTo(1,m);for(;e.isEven();)e.rShiftTo(1,e),b?(A.isEven()&&y.isEven()||(A.addTo(this,A),y.subTo(a,y)),A.rShiftTo(1,A)):y.isEven()||y.subTo(a,y),y.rShiftTo(1,y);0<=d.compareTo(e)?(d.subTo(e,d),b&&n.subTo(A,n),m.subTo(y,m)):(e.subTo(d,e),b&&A.subTo(n,A),y.subTo(m,y))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=y.compareTo(a))return y.subtract(a);if(0>y.signum())y.addTo(a,y);else return y;return 0>y.signum()?y.add(a):y};c.prototype.pow=function(a){return this.exp(a,
418
-new D)};c.prototype.gcd=function(a){var b=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c<d&&(d=c);0<d&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;0<b.signum();)0<(c=b.getLowestSetBit())&&b.rShiftTo(c,b),0<(c=a.getLowestSetBit())&&a.rShiftTo(c,a),0<=b.compareTo(a)?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));0<d&&a.lShiftTo(d,a);return a};c.prototype.isProbablePrime=
419
-function(a){var b,c=this.abs();if(1==c.t&&c.data[0]<=V[V.length-1]){for(b=0;b<V.length;++b)if(c.data[0]==V[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<V.length;){for(var d=V[b],e=b+1;e<V.length&&d<T;)d*=V[e++];for(d=c.modInt(d);b<e;)if(0==d%V[b++])return!1}return c.millerRabin(a)};a.jsbn=a.jsbn||{};a.jsbn.BigInteger=c}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,
420
-l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.jsbn)return c.jsbn;c.defined.jsbn=!0;for(var p=0;p<e.length;++p)e[p](c);return c.jsbn}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/jsbn",["require","module"],function(){l.apply(null,Array.prototype.slice.call(arguments,
421
-0))})})();(function(){function b(a){function c(b,d,e){e||(e=a.md.sha1.create());for(var p="",g=Math.ceil(d/e.digestLength),l=0;l<g;++l){var r=String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,l&255);e.start();e.update(b+r);p+=e.digest().getBytes()}return p.substring(0,d)}var d=a.pkcs1=a.pkcs1||{};d.encode_rsa_oaep=function(b,d,e,l,g){var k,r,x,z;"string"===typeof e?(k=e,r=l||void 0,x=g||void 0):e&&(k=e.label||void 0,r=e.seed||void 0,x=e.md||void 0,e.mgf1&&e.mgf1.md&&(z=e.mgf1.md));x?x.start():x=a.md.sha1.create();
422
-z||(z=x);b=Math.ceil(b.n.bitLength()/8);e=b-2*x.digestLength-2;if(d.length>e)throw z=Error("RSAES-OAEP input message length is too long."),z.length=d.length,z.maxLength=e,z;k||(k="");x.update(k,"raw");k=x.digest();l="";e-=d.length;for(g=0;g<e;g++)l+="\x00";d=k.getBytes()+l+"\u0001"+d;if(!r)r=a.random.getBytes(x.digestLength);else if(r.length!==x.digestLength)throw z=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."),z.seedLength=r.length,z.digestLength=x.digestLength,
423
-z;b=c(r,b-x.digestLength-1,z);d=a.util.xorBytes(d,b,d.length);x=c(d,x.digestLength,z);return"\x00"+a.util.xorBytes(r,x,r.length)+d};d.decode_rsa_oaep=function(b,d,e,l){var g,k,r;"string"===typeof e?(g=e,k=l||void 0):e&&(g=e.label||void 0,k=e.md||void 0,e.mgf1&&e.mgf1.md&&(r=e.mgf1.md));e=Math.ceil(b.n.bitLength()/8);if(d.length!==e)throw r=Error("RSAES-OAEP encoded message length is invalid."),r.length=d.length,r.expectedLength=e,r;void 0===k?k=a.md.sha1.create():k.start();r||(r=k);if(e<2*k.digestLength+
424
-2)throw Error("RSAES-OAEP key is too short for the hash function.");g||(g="");k.update(g,"raw");g=k.digest().getBytes();b=d.charAt(0);l=d.substring(1,k.digestLength+1);d=d.substring(1+k.digestLength);var x=c(d,k.digestLength,r);l=a.util.xorBytes(l,x,l.length);r=c(l,e-k.digestLength-1,r);d=a.util.xorBytes(d,r,d.length);e=d.substring(0,k.digestLength);r="\x00"!==b;for(b=0;b<k.digestLength;++b)r|=g.charAt(b)!==e.charAt(b);g=1;for(k=b=k.digestLength;k<d.length;k++)e=d.charCodeAt(k),l=e&1^1,r|=e&(g?65534:
425
-0),g&=l,b+=g;if(r||1!==d.charCodeAt(b))throw Error("Invalid RSAES-OAEP padding.");return d.substring(b+1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs1)return c.pkcs1;c.defined.pkcs1=!0;for(var p=0;p<e.length;++p)e[p](c);return c.pkcs1}},
426
-u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs1",["require","module","./util","./random","./sha1"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,n,g){return"workers"in n?e(a,b,n,g):d(a,b,n,g)}function d(b,c,e,g){var m=l(b,c),A=0,y=h(m.bitLength());"millerRabinTests"in
427
-e&&(y=e.millerRabinTests);var r=10;"maxBlockTime"in e&&(r=e.maxBlockTime);var p=+new Date;do{m.bitLength()>b&&(m=l(b,c));if(m.isProbablePrime(y))return g(null,m);m.dAddOffset(k[A++%8],0)}while(0>r||+new Date-p<r);a.util.setImmediate(function(){d(b,c,e,g)})}function e(b,c,m,h){function r(){function a(e){if(!m){--n;var y=e.data;if(y.found){for(e=0;e<d.length;++e)d[e].terminate();m=!0;return h(null,new g(y.prime,16))}A.bitLength()>b&&(A=l(b,c));y=A.toString(16);e.target.postMessage({hex:y,workLoad:p});
428
-A.dAddOffset(v,0)}}y=Math.max(1,y);for(var d=[],e=0;e<y;++e)d[e]=new Worker(k);for(var n=y,e=0;e<y;++e)d[e].addEventListener("message",a);var m=!1}if("undefined"===typeof Worker)return d(b,c,m,h);var A=l(b,c),y=m.workers,p=m.workLoad||100,v=30*p/8,k=m.workerScript||"forge/prime.worker.js";if(-1===y)return a.util.estimateCores(function(a,b){a&&(b=2);y=b-1;r()});r()}function l(a,b){var c=new g(a,b),d=a-1;c.testBit(d)||c.bitwiseTo(g.ONE.shiftLeft(d),E,c);c.dAddOffset(31-c.mod(r).byteValue(),0);return c}
429
-function h(a){return 100>=a?27:150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if(!a.prime){var v=a.prime=a.prime||{},g=a.jsbn.BigInteger,k=[6,4,2,4,2,4,6,2],r=new g(null);r.fromInt(30);var E=function(a,b){return a|b};v.generateProbablePrime=function(b,d,e){"function"===typeof d&&(e=d,d={});d=d||{};var g=d.algorithm||"PRIMEINC";"string"===typeof g&&(g={name:g});g.options=g.options||{};var m=d.prng||a.random;d={nextBytes:function(a){for(var b=m.getBytesSync(a.length),
430
-c=0;c<a.length;++c)a[c]=b.charCodeAt(c)}};if("PRIMEINC"===g.name)return c(b,d,g.options,e);throw Error("Invalid prime generation algorithm: "+g.name);}}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.prime)return c.prime;c.defined.prime=!0;for(var p=
431
-0;p<e.length;++p)e[p](c);return c.prime}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/prime",["require","module","./util","./jsbn","./random"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d,e){var g=a.util.createBuffer();d=Math.ceil(d.n.bitLength()/8);if(b.length>d-11)throw g=
432
-Error("Message is too long for PKCS#1 v1.5 padding."),g.length=b.length,g.max=d-11,g;g.putByte(0);g.putByte(e);d=d-3-b.length;if(0===e||1===e){e=0===e?0:255;for(var m=0;m<d;++m)g.putByte(e)}else for(;0<d;){for(var h=0,r=a.random.getBytes(d),m=0;m<d;++m)e=r.charCodeAt(m),0===e?++h:g.putByte(e);d=h}g.putByte(0);g.putBytes(b);return g}function d(b,c,e,g){c=Math.ceil(c.n.bitLength()/8);b=a.util.createBuffer(b);var m=b.getByte(),h=b.getByte();if(0!==m||e&&0!==h&&1!==h||!e&&2!=h||e&&0===h&&"undefined"===
433
-typeof g)throw Error("Encryption block is invalid.");e=0;if(0===h)for(e=c-3-g,g=0;g<e;++g){if(0!==b.getByte())throw Error("Encryption block is invalid.");}else if(1===h)for(e=0;1<b.length();){if(255!==b.getByte()){--b.read;break}++e}else if(2===h)for(e=0;1<b.length();){if(0===b.getByte()){--b.read;break}++e}if(0!==b.getByte()||e!==c-3-b.length())throw Error("Encryption block is invalid.");return b.getBytes()}function e(b,c,d){function g(){m(b.pBits,function(a,c){if(a)return d(a);b.p=c;if(null!==b.q)return h(a,
434
-b.q);m(b.qBits,h)})}function m(b,c){a.prime.generateProbablePrime(b,r,c)}function h(a,c){if(a)return d(a);b.q=c;if(0>b.p.compareTo(b.q)){var e=b.p;b.p=b.q;b.q=e}0!==b.p.subtract(v.ONE).gcd(b.e).compareTo(v.ONE)?(b.p=null,g()):0!==b.q.subtract(v.ONE).gcd(b.e).compareTo(v.ONE)?(b.q=null,m(b.qBits,h)):(b.p1=b.p.subtract(v.ONE),b.q1=b.q.subtract(v.ONE),b.phi=b.p1.multiply(b.q1),0!==b.phi.gcd(b.e).compareTo(v.ONE)?(b.p=b.q=null,g()):(b.n=b.p.multiply(b.q),b.n.bitLength()!==b.bits?(b.q=null,m(b.qBits,h)):
435
-(e=b.e.modInverse(b.phi),b.keys={privateKey:k.rsa.setPrivateKey(b.n,b.e,e,b.p,b.q,e.mod(b.p1),e.mod(b.q1),b.q.modInverse(b.p)),publicKey:k.rsa.setPublicKey(b.n,b.e)},d(null,b.keys))))}"function"===typeof c&&(d=c,c={});c=c||{};var r={algorithm:{name:c.algorithm||"PRIMEINC",options:{workers:c.workers||2,workLoad:c.workLoad||100,workerScript:c.workerScript}}};"prng"in c&&(r.prng=c.prng);g()}function l(b){b=b.toString(16);"8"<=b[0]&&(b="00"+b);return a.util.hexToBytes(b)}function h(a){return 100>=a?27:
436
-150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if("undefined"===typeof v)var v=a.jsbn.BigInteger;var g=a.asn1;a.pki=a.pki||{};a.pki.rsa=a.rsa=a.rsa||{};var k=a.pki,r=[6,4,2,4,2,4,6,2],E={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL,
411
+(this.s&128)!=(d&128)&&++e,0<e||d!=this.s)b[e++]=d;return b};c.prototype.equals=function(a){return 0==this.compareTo(a)};c.prototype.min=function(a){return 0>this.compareTo(a)?this:a};c.prototype.max=function(a){return 0<this.compareTo(a)?this:a};c.prototype.and=function(a){var b=d();this.bitwiseTo(a,z,b);return b};c.prototype.or=function(a){var b=d();this.bitwiseTo(a,x,b);return b};c.prototype.xor=function(a){var b=d();this.bitwiseTo(a,F,b);return b};c.prototype.andNot=function(a){var b=d();this.bitwiseTo(a,
412
+G,b);return b};c.prototype.not=function(){for(var a=d(),b=0;b<this.t;++b)a.data[b]=this.DM&~this.data[b];a.t=this.t;a.s=~this.s;return a};c.prototype.shiftLeft=function(a){var b=d();0>a?this.rShiftTo(-a,b):this.lShiftTo(a,b);return b};c.prototype.shiftRight=function(a){var b=d();0>a?this.lShiftTo(-a,b):this.rShiftTo(a,b);return b};c.prototype.getLowestSetBit=function(){for(var a=0;a<this.t;++a)if(0!=this.data[a]){var b=a*this.DB;a=this.data[a];if(0==a)a=-1;else{var c=0;0==(a&65535)&&(a>>=16,c+=16);
413
+0==(a&255)&&(a>>=8,c+=8);0==(a&15)&&(a>>=4,c+=4);0==(a&3)&&(a>>=2,c+=2);0==(a&1)&&++c;a=c}return b+a}return 0>this.s?this.t*this.DB:-1};c.prototype.bitCount=function(){for(var a=0,b=this.s&this.DM,c=0;c<this.t;++c){for(var d=this.data[c]^b,e=0;0!=d;)d&=d-1,++e;a+=e}return a};c.prototype.testBit=function(a){var b=Math.floor(a/this.DB);return b>=this.t?0!=this.s:0!=(this.data[b]&1<<a%this.DB)};c.prototype.setBit=function(a){return this.changeBit(a,x)};c.prototype.clearBit=function(a){return this.changeBit(a,
414
+G)};c.prototype.flipBit=function(a){return this.changeBit(a,F)};c.prototype.add=function(a){var b=d();this.addTo(a,b);return b};c.prototype.subtract=function(a){var b=d();this.subTo(a,b);return b};c.prototype.multiply=function(a){var b=d();this.multiplyTo(a,b);return b};c.prototype.divide=function(a){var b=d();this.divRemTo(a,b,null);return b};c.prototype.remainder=function(a){var b=d();this.divRemTo(a,null,b);return b};c.prototype.divideAndRemainder=function(a){var b=d(),c=d();this.divRemTo(a,b,
415
+c);return[b,c]};c.prototype.modPow=function(a,b){var c=a.bitLength(),e,n=g(1),k;if(0>=c)return n;e=18>c?1:48>c?3:144>c?4:768>c?5:6;k=8>c?new u(b):b.isEven()?new y(b):new D(b);var A=[],m=3,l=e-1,C=(1<<e)-1;A[1]=k.convert(this);if(1<e)for(c=d(),k.sqrTo(A[1],c);m<=C;)A[m]=d(),k.mulTo(c,A[m-2],A[m]),m+=2;for(var h=a.t-1,p,q=!0,E=d(),c=r(a.data[h])-1;0<=h;){c>=l?p=a.data[h]>>c-l&C:(p=(a.data[h]&(1<<c+1)-1)<<l-c,0<h&&(p|=a.data[h-1]>>this.DB+c-l));for(m=e;0==(p&1);)p>>=1,--m;0>(c-=m)&&(c+=this.DB,--h);
416
+if(q)A[p].copyTo(n),q=!1;else{for(;1<m;)k.sqrTo(n,E),k.sqrTo(E,n),m-=2;0<m?k.sqrTo(n,E):(m=n,n=E,E=m);k.mulTo(E,A[p],n)}for(;0<=h&&0==(a.data[h]&1<<c);)k.sqrTo(n,E),m=n,n=E,E=m,0>--c&&(c=this.DB-1,--h)}return k.revert(n)};c.prototype.modInverse=function(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return c.ZERO;for(var d=a.clone(),e=this.clone(),n=g(1),k=g(0),y=g(0),A=g(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),b?(n.isEven()&&k.isEven()||(n.addTo(this,n),k.subTo(a,k)),n.rShiftTo(1,
417
+n)):k.isEven()||k.subTo(a,k),k.rShiftTo(1,k);for(;e.isEven();)e.rShiftTo(1,e),b?(y.isEven()&&A.isEven()||(y.addTo(this,y),A.subTo(a,A)),y.rShiftTo(1,y)):A.isEven()||A.subTo(a,A),A.rShiftTo(1,A);0<=d.compareTo(e)?(d.subTo(e,d),b&&n.subTo(y,n),k.subTo(A,k)):(e.subTo(d,e),b&&y.subTo(n,y),A.subTo(k,A))}if(0!=e.compareTo(c.ONE))return c.ZERO;if(0<=A.compareTo(a))return A.subtract(a);if(0>A.signum())A.addTo(a,A);else return A;return 0>A.signum()?A.add(a):A};c.prototype.pow=function(a){return this.exp(a,
418
+new E)};c.prototype.gcd=function(a){var b=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a)){var c=b,b=a;a=c}var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c<d&&(d=c);0<d&&(b.rShiftTo(d,b),a.rShiftTo(d,a));for(;0<b.signum();)0<(c=b.getLowestSetBit())&&b.rShiftTo(c,b),0<(c=a.getLowestSetBit())&&a.rShiftTo(c,a),0<=b.compareTo(a)?(b.subTo(a,b),b.rShiftTo(1,b)):(a.subTo(b,a),a.rShiftTo(1,a));0<d&&a.lShiftTo(d,a);return a};c.prototype.isProbablePrime=
419
+function(a){var b,c=this.abs();if(1==c.t&&c.data[0]<=T[T.length-1]){for(b=0;b<T.length;++b)if(c.data[0]==T[b])return!0;return!1}if(c.isEven())return!1;for(b=1;b<T.length;){for(var d=T[b],e=b+1;e<T.length&&d<U;)d*=T[e++];for(d=c.modInt(d);b<e;)if(0==d%T[b++])return!1}return c.millerRabin(a)};a.jsbn=a.jsbn||{};a.jsbn.BigInteger=c}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,
420
+h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.jsbn)return c.jsbn;c.defined.jsbn=!0;for(var m=0;m<e.length;++m)e[m](c);return c.jsbn}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/jsbn",["require","module"],function(){h.apply(null,Array.prototype.slice.call(arguments,
421
+0))})})();(function(){function b(a){function c(b,d,e){e||(e=a.md.sha1.create());for(var m="",g=Math.ceil(d/e.digestLength),h=0;h<g;++h){var u=String.fromCharCode(h>>24&255,h>>16&255,h>>8&255,h&255);e.start();e.update(b+u);m+=e.digest().getBytes()}return m.substring(0,d)}var d=a.pkcs1=a.pkcs1||{};d.encode_rsa_oaep=function(b,d,e,l,g){var h,u,q,z;"string"===typeof e?(h=e,u=l||void 0,q=g||void 0):e&&(h=e.label||void 0,u=e.seed||void 0,q=e.md||void 0,e.mgf1&&e.mgf1.md&&(z=e.mgf1.md));q?q.start():q=a.md.sha1.create();
422
+z||(z=q);b=Math.ceil(b.n.bitLength()/8);e=b-2*q.digestLength-2;if(d.length>e)throw z=Error("RSAES-OAEP input message length is too long."),z.length=d.length,z.maxLength=e,z;h||(h="");q.update(h,"raw");h=q.digest();l="";e-=d.length;for(g=0;g<e;g++)l+="\x00";d=h.getBytes()+l+"\u0001"+d;if(!u)u=a.random.getBytes(q.digestLength);else if(u.length!==q.digestLength)throw z=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."),z.seedLength=u.length,z.digestLength=q.digestLength,
423
+z;b=c(u,b-q.digestLength-1,z);d=a.util.xorBytes(d,b,d.length);q=c(d,q.digestLength,z);return"\x00"+a.util.xorBytes(u,q,u.length)+d};d.decode_rsa_oaep=function(b,d,e,l){var g,h,u;"string"===typeof e?(g=e,h=l||void 0):e&&(g=e.label||void 0,h=e.md||void 0,e.mgf1&&e.mgf1.md&&(u=e.mgf1.md));e=Math.ceil(b.n.bitLength()/8);if(d.length!==e)throw u=Error("RSAES-OAEP encoded message length is invalid."),u.length=d.length,u.expectedLength=e,u;void 0===h?h=a.md.sha1.create():h.start();u||(u=h);if(e<2*h.digestLength+
424
+2)throw Error("RSAES-OAEP key is too short for the hash function.");g||(g="");h.update(g,"raw");g=h.digest().getBytes();b=d.charAt(0);l=d.substring(1,h.digestLength+1);d=d.substring(1+h.digestLength);var q=c(d,h.digestLength,u);l=a.util.xorBytes(l,q,l.length);u=c(l,e-h.digestLength-1,u);d=a.util.xorBytes(d,u,d.length);e=d.substring(0,h.digestLength);u="\x00"!==b;for(b=0;b<h.digestLength;++b)u|=g.charAt(b)!==e.charAt(b);g=1;for(h=b=h.digestLength;h<d.length;h++)e=d.charCodeAt(h),l=e&1^1,u|=e&(g?65534:
425
+0),g&=l,b+=g;if(u||1!==d.charCodeAt(b))throw Error("Invalid RSAES-OAEP padding.");return d.substring(b+1)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs1)return c.pkcs1;c.defined.pkcs1=!0;for(var m=0;m<e.length;++m)e[m](c);return c.pkcs1}},
426
+r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs1",["require","module","./util","./random","./sha1"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,g,n){return"workers"in g?e(a,b,g,n):d(a,b,g,n)}function d(b,c,e,g){var k=h(b,c),A=0,y=q(k.bitLength());"millerRabinTests"in
427
+e&&(y=e.millerRabinTests);var m=10;"maxBlockTime"in e&&(m=e.maxBlockTime);var l=+new Date;do{k.bitLength()>b&&(k=h(b,c));if(k.isProbablePrime(y))return g(null,k);k.dAddOffset(r[A++%8],0)}while(0>m||+new Date-l<m);a.util.setImmediate(function(){d(b,c,e,g)})}function e(b,c,k,m){function l(){function a(e){if(!k){--n;var y=e.data;if(y.found){for(e=0;e<d.length;++e)d[e].terminate();k=!0;return m(null,new g(y.prime,16))}A.bitLength()>b&&(A=h(b,c));y=A.toString(16);e.target.postMessage({hex:y,workLoad:C});
428
+A.dAddOffset(u,0)}}y=Math.max(1,y);for(var d=[],e=0;e<y;++e)d[e]=new Worker(q);for(var n=y,e=0;e<y;++e)d[e].addEventListener("message",a);var k=!1}if("undefined"===typeof Worker)return d(b,c,k,m);var A=h(b,c),y=k.workers,C=k.workLoad||100,u=30*C/8,q=k.workerScript||"forge/prime.worker.js";if(-1===y)return a.util.estimateCores(function(a,b){a&&(b=2);y=b-1;l()});l()}function h(a,b){var c=new g(a,b),d=a-1;c.testBit(d)||c.bitwiseTo(g.ONE.shiftLeft(d),D,c);c.dAddOffset(31-c.mod(u).byteValue(),0);return c}
429
+function q(a){return 100>=a?27:150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if(!a.prime){var l=a.prime=a.prime||{},g=a.jsbn.BigInteger,r=[6,4,2,4,2,4,6,2],u=new g(null);u.fromInt(30);var D=function(a,b){return a|b};l.generateProbablePrime=function(b,d,e){"function"===typeof d&&(e=d,d={});d=d||{};var g=d.algorithm||"PRIMEINC";"string"===typeof g&&(g={name:g});g.options=g.options||{};var k=d.prng||a.random;d={nextBytes:function(a){for(var b=k.getBytesSync(a.length),
430
+c=0;c<a.length;++c)a[c]=b.charCodeAt(c)}};if("PRIMEINC"===g.name)return c(b,d,g.options,e);throw Error("Invalid prime generation algorithm: "+g.name);}}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.prime)return c.prime;c.defined.prime=!0;for(var m=
431
+0;m<e.length;++m)e[m](c);return c.prime}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/prime",["require","module","./util","./jsbn","./random"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d,e){var g=a.util.createBuffer();d=Math.ceil(d.n.bitLength()/8);if(b.length>d-11)throw g=
432
+Error("Message is too long for PKCS#1 v1.5 padding."),g.length=b.length,g.max=d-11,g;g.putByte(0);g.putByte(e);d=d-3-b.length;if(0===e||1===e){e=0===e?0:255;for(var k=0;k<d;++k)g.putByte(e)}else for(;0<d;){for(var m=0,l=a.random.getBytes(d),k=0;k<d;++k)e=l.charCodeAt(k),0===e?++m:g.putByte(e);d=m}g.putByte(0);g.putBytes(b);return g}function d(b,c,e,g){c=Math.ceil(c.n.bitLength()/8);b=a.util.createBuffer(b);var k=b.getByte(),m=b.getByte();if(0!==k||e&&0!==m&&1!==m||!e&&2!=m||e&&0===m&&"undefined"===
433
+typeof g)throw Error("Encryption block is invalid.");e=0;if(0===m)for(e=c-3-g,g=0;g<e;++g){if(0!==b.getByte())throw Error("Encryption block is invalid.");}else if(1===m)for(e=0;1<b.length();){if(255!==b.getByte()){--b.read;break}++e}else if(2===m)for(e=0;1<b.length();){if(0===b.getByte()){--b.read;break}++e}if(0!==b.getByte()||e!==c-3-b.length())throw Error("Encryption block is invalid.");return b.getBytes()}function e(b,c,d){function g(){k(b.pBits,function(a,c){if(a)return d(a);b.p=c;if(null!==b.q)return m(a,
434
+b.q);k(b.qBits,m)})}function k(b,c){a.prime.generateProbablePrime(b,h,c)}function m(a,c){if(a)return d(a);b.q=c;if(0>b.p.compareTo(b.q)){var e=b.p;b.p=b.q;b.q=e}0!==b.p.subtract(l.ONE).gcd(b.e).compareTo(l.ONE)?(b.p=null,g()):0!==b.q.subtract(l.ONE).gcd(b.e).compareTo(l.ONE)?(b.q=null,k(b.qBits,m)):(b.p1=b.p.subtract(l.ONE),b.q1=b.q.subtract(l.ONE),b.phi=b.p1.multiply(b.q1),0!==b.phi.gcd(b.e).compareTo(l.ONE)?(b.p=b.q=null,g()):(b.n=b.p.multiply(b.q),b.n.bitLength()!==b.bits?(b.q=null,k(b.qBits,m)):
435
+(e=b.e.modInverse(b.phi),b.keys={privateKey:r.rsa.setPrivateKey(b.n,b.e,e,b.p,b.q,e.mod(b.p1),e.mod(b.q1),b.q.modInverse(b.p)),publicKey:r.rsa.setPublicKey(b.n,b.e)},d(null,b.keys))))}"function"===typeof c&&(d=c,c={});c=c||{};var h={algorithm:{name:c.algorithm||"PRIMEINC",options:{workers:c.workers||2,workLoad:c.workLoad||100,workerScript:c.workerScript}}};"prng"in c&&(h.prng=c.prng);g()}function h(b){b=b.toString(16);"8"<=b[0]&&(b="00"+b);return a.util.hexToBytes(b)}function q(a){return 100>=a?27:
436
+150>=a?18:200>=a?15:250>=a?12:300>=a?9:350>=a?8:400>=a?7:500>=a?6:600>=a?5:800>=a?4:1250>=a?3:2}if("undefined"===typeof l)var l=a.jsbn.BigInteger;var g=a.asn1;a.pki=a.pki||{};a.pki.rsa=a.rsa=a.rsa||{};var r=a.pki,u=[6,4,2,4,2,4,6,2],D={name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:g.Class.UNIVERSAL,
437
type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},z={name:"RSAPrivateKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",
438
tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",
439
-tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},B={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL,
440
-type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},u=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,
441
-type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},F=function(a){var b;if(a.algorithm in k.oids)b=k.oids[a.algorithm];
442
-else throw b=Error("Unknown message digest algorithm."),b.algorithm=a.algorithm,b;var c=g.oidToDer(b).getBytes();b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var d=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);d.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,c));d.value.push(g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,""));a=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,a.digest().getBytes());b.value.push(d);b.value.push(a);return g.toDer(b).getBytes()},D=function(b,c,d){if(d)return b.modPow(c.e,
443
-c.n);if(!c.p||!c.q)return b.modPow(c.d,c.n);c.dP||(c.dP=c.d.mod(c.p.subtract(v.ONE)));c.dQ||(c.dQ=c.d.mod(c.q.subtract(v.ONE)));c.qInv||(c.qInv=c.q.modInverse(c.p));do d=new v(a.util.bytesToHex(a.random.getBytes(c.n.bitLength()/8)),16);while(0<=d.compareTo(c.n)||!d.gcd(c.n).equals(v.ONE));b=b.multiply(d.modPow(c.e,c.n)).mod(c.n);var e=b.mod(c.p).modPow(c.dP,c.p);for(b=b.mod(c.q).modPow(c.dQ,c.q);0>e.compareTo(b);)e=e.add(c.p);b=e.subtract(b).multiply(c.qInv).mod(c.p).multiply(c.q).add(b);return b=
444
-b.multiply(d.modInverse(c.n)).mod(c.n)};k.rsa.encrypt=function(b,d,e){var g=e,m=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(g=2===e,e=c(b,d,e)):(e=a.util.createBuffer(),e.putBytes(b));b=new v(e.toHex(),16);d=D(b,d,g).toString(16);g=a.util.createBuffer();for(m-=Math.ceil(d.length/2);0<m;)g.putByte(0),--m;g.putBytes(a.util.hexToBytes(d));return g.getBytes()};k.rsa.decrypt=function(b,c,e,g){var m=Math.ceil(c.n.bitLength()/8);if(b.length!==m)throw c=Error("Encrypted message length is invalid."),c.length=
445
-b.length,c.expected=m,c;b=new v(a.util.createBuffer(b).toHex(),16);if(0<=b.compareTo(c.n))throw Error("Encrypted message is invalid.");b=D(b,c,e).toString(16);for(var h=a.util.createBuffer(),m=m-Math.ceil(b.length/2);0<m;)h.putByte(0),--m;h.putBytes(a.util.hexToBytes(b));return!1!==g?d(h.getBytes(),c,e):h.getBytes()};k.rsa.createKeyPairGenerationState=function(b,c,d){"string"===typeof b&&(b=parseInt(b,10));b=b||2048;d=d||{};var e=d.prng||a.random,g={nextBytes:function(a){for(var b=e.getBytesSync(a.length),
446
-c=0;c<a.length;++c)a[c]=b.charCodeAt(c)}};d=d.algorithm||"PRIMEINC";if("PRIMEINC"===d)b={algorithm:d,state:0,bits:b,rng:g,eInt:c||65537,e:new v(null),p:null,q:null,qBits:b>>1,pBits:b-(b>>1),pqState:0,num:null,keys:null},b.e.fromInt(b.eInt);else throw Error("Invalid key generation algorithm: "+d);return b};k.rsa.stepKeyPairGenerationState=function(a,b){"algorithm"in a||(a.algorithm="PRIMEINC");var c=new v(null);c.fromInt(30);for(var d=0,e=function(a,b){return a|b},n=+new Date,g,m=0;null===a.keys&&
447
-(0>=b||m<b);){if(0===a.state){g=null===a.p?a.pBits:a.qBits;var p=g-1;0===a.pqState?(a.num=new v(g,a.rng),a.num.testBit(p)||a.num.bitwiseTo(v.ONE.shiftLeft(p),e,a.num),a.num.dAddOffset(31-a.num.mod(c).byteValue(),0),d=0,++a.pqState):1===a.pqState?a.num.bitLength()>g?a.pqState=0:a.num.isProbablePrime(h(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(r[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(v.ONE).gcd(a.e).compareTo(v.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num,
448
-null!==a.p&&null!==a.q&&++a.state,a.num=null)}else 1===a.state?(0>a.p.compareTo(a.q)&&(a.num=a.p,a.p=a.q,a.q=a.num),++a.state):2===a.state?(a.p1=a.p.subtract(v.ONE),a.q1=a.q.subtract(v.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(v.ONE)?++a.state:(a.p=null,a.q=null,a.state=0):4===a.state?(a.n=a.p.multiply(a.q),a.n.bitLength()===a.bits?++a.state:(a.q=null,a.state=0)):5===a.state&&(g=a.e.modInverse(a.phi),a.keys={privateKey:k.rsa.setPrivateKey(a.n,a.e,g,a.p,a.q,
449
-g.mod(a.p1),g.mod(a.q1),a.q.modInverse(a.p)),publicKey:k.rsa.setPublicKey(a.n,a.e)});g=+new Date;m+=g-n;n=g}return null!==a.keys};k.rsa.generateKeyPair=function(a,b,c,d){1===arguments.length?"object"===typeof a?(c=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof b?(d=b,b=void 0):"number"!==typeof b&&(c=b,b=void 0):(c=a,d=b,b=a=void 0):3===arguments.length&&("number"===typeof b?"function"===typeof c&&(d=c,c=void 0):(d=c,c=b,b=void 0));c=
450
-c||{};void 0===a&&(a=c.bits||2048);void 0===b&&(b=c.e||65537);var n=k.rsa.createKeyPairGenerationState(a,b,c);if(!d)return k.rsa.stepKeyPairGenerationState(n,0),n.keys;e(n,c,d)};k.setRsaPublicKey=k.rsa.setPublicKey=function(b,e){var m={n:b,e:e,encrypt:function(b,d,e){"string"===typeof d?d=d.toUpperCase():void 0===d&&(d="RSAES-PKCS1-V1_5");if("RSAES-PKCS1-V1_5"===d)d={encode:function(a,b,d){return c(a,b,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(b,c){return a.pkcs1.encode_rsa_oaep(c,
451
-b,e)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(d))d={encode:function(a){return a}};else if("string"===typeof d)throw Error('Unsupported encryption scheme: "'+d+'".');b=d.encode(b,m,!0);return k.rsa.encrypt(b,m,!0)},verify:function(a,b,c){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===c)c={verify:function(a,b){b=d(b,m,!0);var c=g.fromDer(b);return a===c.value[1].value}};else if("NONE"===c||"NULL"===c||null===c)c={verify:function(a,b){b=d(b,
452
-m,!0);return a===b}};b=k.rsa.decrypt(b,m,!0,!1);return c.verify(a,b,m.n.bitLength())}};return m};k.setRsaPrivateKey=k.rsa.setPrivateKey=function(b,c,e,g,m,h,r,p){var l={n:b,e:c,d:e,p:g,q:m,dP:h,dQ:r,qInv:p,decrypt:function(b,c,e){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSAES-PKCS1-V1_5");b=k.rsa.decrypt(b,l,!1,!1);if("RSAES-PKCS1-V1_5"===c)c={decode:d};else if("RSA-OAEP"===c||"RSAES-OAEP"===c)c={decode:function(b,c){return a.pkcs1.decode_rsa_oaep(c,b,e)}};else if(-1!==["RAW","NONE",
453
-"NULL",null].indexOf(c))c={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+c+'".');return c.decode(b,l,!1)},sign:function(a,b){var c=!1;"string"===typeof b&&(b=b.toUpperCase());if(void 0===b||"RSASSA-PKCS1-V1_5"===b)b={encode:F},c=1;else if("NONE"===b||"NULL"===b||null===b)b={encode:function(){return a}},c=1;var d=b.encode(a,l.n.bitLength());return k.rsa.encrypt(d,l,c)}};return l};k.wrapRsaPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,
454
-[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(k.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(a).getBytes())])};k.privateKeyFromAsn1=function(b){var c={},d=[];g.validate(b,E,c,d)&&(b=g.fromDer(a.util.createBuffer(c.privateKey)));c={};d=[];if(!g.validate(b,z,c,d))throw c=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."),
455
-c.errors=d,c;var e,m,h,r,p,d=a.util.createBuffer(c.privateKeyModulus).toHex();b=a.util.createBuffer(c.privateKeyPublicExponent).toHex();e=a.util.createBuffer(c.privateKeyPrivateExponent).toHex();m=a.util.createBuffer(c.privateKeyPrime1).toHex();h=a.util.createBuffer(c.privateKeyPrime2).toHex();r=a.util.createBuffer(c.privateKeyExponent1).toHex();p=a.util.createBuffer(c.privateKeyExponent2).toHex();c=a.util.createBuffer(c.privateKeyCoefficient).toHex();return k.setRsaPrivateKey(new v(d,16),new v(b,
456
-16),new v(e,16),new v(m,16),new v(h,16),new v(r,16),new v(p,16),new v(c,16))};k.privateKeyToAsn1=k.privateKeyToRSAPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.p)),g.create(g.Class.UNIVERSAL,
457
-g.Type.INTEGER,!1,l(a.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.qInv))])};k.publicKeyFromAsn1=function(b){var c={},d=[];if(g.validate(b,u,c,d)){d=g.derToOid(c.publicKeyOid);if(d!==k.oids.rsaEncryption)throw c=Error("Cannot read public key. Unknown OID."),c.oid=d,c;b=c.rsaPublicKey}d=[];if(!g.validate(b,B,c,d))throw c=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."),
458
-c.errors=d,c;d=a.util.createBuffer(c.publicKeyModulus).toHex();c=a.util.createBuffer(c.publicKeyExponent).toHex();return k.setRsaPublicKey(new v(d,16),new v(c,16))};k.publicKeyToAsn1=k.publicKeyToSubjectPublicKeyInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(k.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
459
-!1,[k.publicKeyToRSAPublicKey(a)])])};k.publicKeyToRSAPublicKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,l(a.e))])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||
460
-{};c.defined=c.defined||{};if(c.defined.rsa)return c.rsa;c.defined.rsa=!0;for(var p=0;p<e.length;++p)e[p](c);return c.rsa}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/rsa","require module ./asn1 ./jsbn ./oids ./pkcs1 ./prime ./random ./util".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,
461
-b){return a.start().update(b).digest().getBytes()}if("undefined"===typeof d)var d=a.jsbn.BigInteger;var e=a.asn1,l=a.pki=a.pki||{};l.pbe=a.pbe=a.pbe||{};var h=l.oids,v={name:"EncryptedPrivateKeyInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encryptionOid"},
439
+tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},x={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL,
440
+type:g.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},F=a.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,
441
+type:g.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},G=function(a){var b;if(a.algorithm in r.oids)b=r.oids[a.algorithm];
442
+else throw b=Error("Unknown message digest algorithm."),b.algorithm=a.algorithm,b;var c=g.oidToDer(b).getBytes();b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);var d=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);d.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,c));d.value.push(g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,""));a=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,a.digest().getBytes());b.value.push(d);b.value.push(a);return g.toDer(b).getBytes()},E=function(b,c,d){if(d)return b.modPow(c.e,
443
+c.n);if(!c.p||!c.q)return b.modPow(c.d,c.n);c.dP||(c.dP=c.d.mod(c.p.subtract(l.ONE)));c.dQ||(c.dQ=c.d.mod(c.q.subtract(l.ONE)));c.qInv||(c.qInv=c.q.modInverse(c.p));do d=new l(a.util.bytesToHex(a.random.getBytes(c.n.bitLength()/8)),16);while(0<=d.compareTo(c.n)||!d.gcd(c.n).equals(l.ONE));b=b.multiply(d.modPow(c.e,c.n)).mod(c.n);var e=b.mod(c.p).modPow(c.dP,c.p);for(b=b.mod(c.q).modPow(c.dQ,c.q);0>e.compareTo(b);)e=e.add(c.p);b=e.subtract(b).multiply(c.qInv).mod(c.p).multiply(c.q).add(b);return b=
444
+b.multiply(d.modInverse(c.n)).mod(c.n)};r.rsa.encrypt=function(b,d,e){var g=e,k=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(g=2===e,e=c(b,d,e)):(e=a.util.createBuffer(),e.putBytes(b));b=new l(e.toHex(),16);d=E(b,d,g).toString(16);g=a.util.createBuffer();for(k-=Math.ceil(d.length/2);0<k;)g.putByte(0),--k;g.putBytes(a.util.hexToBytes(d));return g.getBytes()};r.rsa.decrypt=function(b,c,e,g){var k=Math.ceil(c.n.bitLength()/8);if(b.length!==k)throw c=Error("Encrypted message length is invalid."),c.length=
445
+b.length,c.expected=k,c;b=new l(a.util.createBuffer(b).toHex(),16);if(0<=b.compareTo(c.n))throw Error("Encrypted message is invalid.");b=E(b,c,e).toString(16);for(var m=a.util.createBuffer(),k=k-Math.ceil(b.length/2);0<k;)m.putByte(0),--k;m.putBytes(a.util.hexToBytes(b));return!1!==g?d(m.getBytes(),c,e):m.getBytes()};r.rsa.createKeyPairGenerationState=function(b,c,d){"string"===typeof b&&(b=parseInt(b,10));b=b||2048;d=d||{};var e=d.prng||a.random,g={nextBytes:function(a){for(var b=e.getBytesSync(a.length),
446
+c=0;c<a.length;++c)a[c]=b.charCodeAt(c)}};d=d.algorithm||"PRIMEINC";if("PRIMEINC"===d)b={algorithm:d,state:0,bits:b,rng:g,eInt:c||65537,e:new l(null),p:null,q:null,qBits:b>>1,pBits:b-(b>>1),pqState:0,num:null,keys:null},b.e.fromInt(b.eInt);else throw Error("Invalid key generation algorithm: "+d);return b};r.rsa.stepKeyPairGenerationState=function(a,b){"algorithm"in a||(a.algorithm="PRIMEINC");var c=new l(null);c.fromInt(30);for(var d=0,e=function(a,b){return a|b},g=+new Date,n,k=0;null===a.keys&&
447
+(0>=b||k<b);){if(0===a.state){n=null===a.p?a.pBits:a.qBits;var m=n-1;0===a.pqState?(a.num=new l(n,a.rng),a.num.testBit(m)||a.num.bitwiseTo(l.ONE.shiftLeft(m),e,a.num),a.num.dAddOffset(31-a.num.mod(c).byteValue(),0),d=0,++a.pqState):1===a.pqState?a.num.bitLength()>n?a.pqState=0:a.num.isProbablePrime(q(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(u[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(l.ONE).gcd(a.e).compareTo(l.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num,
448
+null!==a.p&&null!==a.q&&++a.state,a.num=null)}else 1===a.state?(0>a.p.compareTo(a.q)&&(a.num=a.p,a.p=a.q,a.q=a.num),++a.state):2===a.state?(a.p1=a.p.subtract(l.ONE),a.q1=a.q.subtract(l.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(l.ONE)?++a.state:(a.p=null,a.q=null,a.state=0):4===a.state?(a.n=a.p.multiply(a.q),a.n.bitLength()===a.bits?++a.state:(a.q=null,a.state=0)):5===a.state&&(n=a.e.modInverse(a.phi),a.keys={privateKey:r.rsa.setPrivateKey(a.n,a.e,n,a.p,a.q,
449
+n.mod(a.p1),n.mod(a.q1),a.q.modInverse(a.p)),publicKey:r.rsa.setPublicKey(a.n,a.e)});n=+new Date;k+=n-g;g=n}return null!==a.keys};r.rsa.generateKeyPair=function(a,b,c,d){1===arguments.length?"object"===typeof a?(c=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof b?(d=b,b=void 0):"number"!==typeof b&&(c=b,b=void 0):(c=a,d=b,b=a=void 0):3===arguments.length&&("number"===typeof b?"function"===typeof c&&(d=c,c=void 0):(d=c,c=b,b=void 0));c=
450
+c||{};void 0===a&&(a=c.bits||2048);void 0===b&&(b=c.e||65537);var g=r.rsa.createKeyPairGenerationState(a,b,c);if(!d)return r.rsa.stepKeyPairGenerationState(g,0),g.keys;e(g,c,d)};r.setRsaPublicKey=r.rsa.setPublicKey=function(b,e){var k={n:b,e:e,encrypt:function(b,d,e){"string"===typeof d?d=d.toUpperCase():void 0===d&&(d="RSAES-PKCS1-V1_5");if("RSAES-PKCS1-V1_5"===d)d={encode:function(a,b,d){return c(a,b,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(b,c){return a.pkcs1.encode_rsa_oaep(c,
451
+b,e)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(d))d={encode:function(a){return a}};else if("string"===typeof d)throw Error('Unsupported encryption scheme: "'+d+'".');b=d.encode(b,k,!0);return r.rsa.encrypt(b,k,!0)},verify:function(a,b,c){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===c)c={verify:function(a,b){b=d(b,k,!0);var c=g.fromDer(b);return a===c.value[1].value}};else if("NONE"===c||"NULL"===c||null===c)c={verify:function(a,b){b=d(b,
452
+k,!0);return a===b}};b=r.rsa.decrypt(b,k,!0,!1);return c.verify(a,b,k.n.bitLength())}};return k};r.setRsaPrivateKey=r.rsa.setPrivateKey=function(b,c,e,g,k,m,h,l){var u={n:b,e:c,d:e,p:g,q:k,dP:m,dQ:h,qInv:l,decrypt:function(b,c,e){"string"===typeof c?c=c.toUpperCase():void 0===c&&(c="RSAES-PKCS1-V1_5");b=r.rsa.decrypt(b,u,!1,!1);if("RSAES-PKCS1-V1_5"===c)c={decode:d};else if("RSA-OAEP"===c||"RSAES-OAEP"===c)c={decode:function(b,c){return a.pkcs1.decode_rsa_oaep(c,b,e)}};else if(-1!==["RAW","NONE",
453
+"NULL",null].indexOf(c))c={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+c+'".');return c.decode(b,u,!1)},sign:function(a,b){var c=!1;"string"===typeof b&&(b=b.toUpperCase());if(void 0===b||"RSASSA-PKCS1-V1_5"===b)b={encode:G},c=1;else if("NONE"===b||"NULL"===b||null===b)b={encode:function(){return a}},c=1;var d=b.encode(a,u.n.bitLength());return r.rsa.encrypt(d,u,c)}};return u};r.wrapRsaPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,
454
+[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(r.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,g.toDer(a).getBytes())])};r.privateKeyFromAsn1=function(b){var c={},d=[];g.validate(b,D,c,d)&&(b=g.fromDer(a.util.createBuffer(c.privateKey)));c={};d=[];if(!g.validate(b,z,c,d))throw c=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."),
455
+c.errors=d,c;var e,k,m,h,u,d=a.util.createBuffer(c.privateKeyModulus).toHex();b=a.util.createBuffer(c.privateKeyPublicExponent).toHex();e=a.util.createBuffer(c.privateKeyPrivateExponent).toHex();k=a.util.createBuffer(c.privateKeyPrime1).toHex();m=a.util.createBuffer(c.privateKeyPrime2).toHex();h=a.util.createBuffer(c.privateKeyExponent1).toHex();u=a.util.createBuffer(c.privateKeyExponent2).toHex();c=a.util.createBuffer(c.privateKeyCoefficient).toHex();return r.setRsaPrivateKey(new l(d,16),new l(b,
456
+16),new l(e,16),new l(k,16),new l(m,16),new l(h,16),new l(u,16),new l(c,16))};r.privateKeyToAsn1=r.privateKeyToRSAPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(0).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.p)),g.create(g.Class.UNIVERSAL,
457
+g.Type.INTEGER,!1,h(a.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.qInv))])};r.publicKeyFromAsn1=function(b){var c={},d=[];if(g.validate(b,F,c,d)){d=g.derToOid(c.publicKeyOid);if(d!==r.oids.rsaEncryption)throw c=Error("Cannot read public key. Unknown OID."),c.oid=d,c;b=c.rsaPublicKey}d=[];if(!g.validate(b,x,c,d))throw c=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."),
458
+c.errors=d,c;d=a.util.createBuffer(c.publicKeyModulus).toHex();c=a.util.createBuffer(c.publicKeyExponent).toHex();return r.setRsaPublicKey(new l(d,16),new l(c,16))};r.publicKeyToAsn1=r.publicKeyToSubjectPublicKeyInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(r.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
459
+!1,[r.publicKeyToRSAPublicKey(a)])])};r.publicKeyToRSAPublicKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,h(a.e))])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||
460
+{};c.defined=c.defined||{};if(c.defined.rsa)return c.rsa;c.defined.rsa=!0;for(var m=0;m<e.length;++m)e[m](c);return c.rsa}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/rsa","require module ./asn1 ./jsbn ./oids ./pkcs1 ./prime ./random ./util".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,
461
+b){return a.start().update(b).digest().getBytes()}if("undefined"===typeof d)var d=a.jsbn.BigInteger;var e=a.asn1,h=a.pki=a.pki||{};h.pbe=a.pbe=a.pbe||{};var q=h.oids,l={name:"EncryptedPrivateKeyInfo",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encryptionOid"},
462
{name:"AlgorithmIdentifier.parameters",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},g={name:"PBES2Algorithms",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",
463
tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,onstructed:!0,capture:"kdfIterationCount"}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:e.Class.UNIVERSAL,
464
-type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},k={name:"pkcs-12PbeParams",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"salt"},
465
-{name:"pkcs-12PbeParams.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"iterations"}]};l.encryptPrivateKeyInfo=function(b,c,d){d=d||{};d.saltSize=d.saltSize||8;d.count=d.count||2048;d.algorithm=d.algorithm||"aes128";var g=a.random.getBytesSync(d.saltSize),p=d.count,v=e.integerToDer(p),k;if(0===d.algorithm.indexOf("aes")||"des"===d.algorithm){var A,y;switch(d.algorithm){case "aes128":A=k=16;d=h["aes128-CBC"];y=a.aes.createEncryptionCipher;break;case "aes192":k=24;
466
-A=16;d=h["aes192-CBC"];y=a.aes.createEncryptionCipher;break;case "aes256":k=32;A=16;d=h["aes256-CBC"];y=a.aes.createEncryptionCipher;break;case "des":A=k=8;d=h.desCBC;y=a.des.createEncryptionCipher;break;default:throw g=Error("Cannot encrypt private key. Unknown encryption algorithm."),g.algorithm=d.algorithm,g;}var C=a.pkcs5.pbkdf2(c,g,p,k);c=a.random.getBytesSync(A);p=y(C);p.start(c);p.update(e.toDer(b));p.finish();b=p.output.getBytes();g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,
467
-e.Type.OID,!1,e.oidToDer(h.pkcs5PBES2).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(h.pkcs5PBKDF2).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,g),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,v.getBytes())])]),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(d).getBytes()),e.create(e.Class.UNIVERSAL,
468
-e.Type.OCTETSTRING,!1,c)])])])}else if("3des"===d.algorithm)k=24,d=new a.util.ByteBuffer(g),C=l.pbe.generatePkcs12Key(c,d,1,p,k),c=l.pbe.generatePkcs12Key(c,d,2,p,k),p=a.des.createEncryptionCipher(C),p.start(c),p.update(e.toDer(b)),p.finish(),b=p.output.getBytes(),g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(h["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,
469
-!1,g),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,v.getBytes())])]);else throw g=Error("Cannot encrypt private key. Unknown encryption algorithm."),g.algorithm=d.algorithm,g;return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[g,e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,b)])};l.decryptPrivateKeyInfo=function(b,c){var d=null,g={},h=[];if(!e.validate(b,v,g,h))throw d=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=h,d;h=e.derToOid(g.encryptionOid);
470
-h=l.pbe.getCipher(h,g.encryptionParams,c);g=a.util.createBuffer(g.encryptedData);h.update(g);h.finish()&&(d=e.fromDer(h.output));return d};l.encryptedPrivateKeyToPem=function(b,c){var d={type:"ENCRYPTED PRIVATE KEY",body:e.toDer(b).getBytes()};return a.pem.encode(d,{maxline:c})};l.encryptedPrivateKeyFromPem=function(b){b=a.pem.decode(b)[0];if("ENCRYPTED PRIVATE KEY"!==b.type){var c=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');c.headerType=
471
-b.type;throw c;}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return e.fromDer(b.body)};l.encryptRsaPrivateKey=function(b,c,d){d=d||{};if(!d.legacy)return b=l.wrapRsaPrivateKey(l.privateKeyToAsn1(b)),b=l.encryptPrivateKeyInfo(b,c,d),l.encryptedPrivateKeyToPem(b);var g,h,p;switch(d.algorithm){case "aes128":d="AES-128-CBC";h=16;g=a.random.getBytesSync(16);p=a.aes.createEncryptionCipher;break;case "aes192":d="AES-192-CBC";
472
-h=24;g=a.random.getBytesSync(16);p=a.aes.createEncryptionCipher;break;case "aes256":d="AES-256-CBC";h=32;g=a.random.getBytesSync(16);p=a.aes.createEncryptionCipher;break;case "3des":d="DES-EDE3-CBC";h=24;g=a.random.getBytesSync(8);p=a.des.createEncryptionCipher;break;case "des":d="DES-CBC";h=8;g=a.random.getBytesSync(8);p=a.des.createEncryptionCipher;break;default:throw b=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+d.algorithm+'".'),b.algorithm=d.algorithm,b;}c=a.pbe.opensslDeriveBytes(c,
473
-g.substr(0,8),h);c=p(c);c.start(g);c.update(e.toDer(l.privateKeyToAsn1(b)));c.finish();b={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:d,parameters:a.util.bytesToHex(g).toUpperCase()},body:c.output.getBytes()};return a.pem.encode(b)};l.decryptRsaPrivateKey=function(b,c){var d=null,g=a.pem.decode(b)[0];if("ENCRYPTED PRIVATE KEY"!==g.type&&"PRIVATE KEY"!==g.type&&"RSA PRIVATE KEY"!==g.type)throw d=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'),
474
-d.headerType=d,d;if(g.procType&&"ENCRYPTED"===g.procType.type){var h,p;switch(g.dekInfo.algorithm){case "DES-CBC":h=8;p=a.des.createDecryptionCipher;break;case "DES-EDE3-CBC":h=24;p=a.des.createDecryptionCipher;break;case "AES-128-CBC":h=16;p=a.aes.createDecryptionCipher;break;case "AES-192-CBC":h=24;p=a.aes.createDecryptionCipher;break;case "AES-256-CBC":h=32;p=a.aes.createDecryptionCipher;break;case "RC2-40-CBC":h=5;p=function(b){return a.rc2.createDecryptionCipher(b,40)};break;case "RC2-64-CBC":h=
475
-8;p=function(b){return a.rc2.createDecryptionCipher(b,64)};break;case "RC2-128-CBC":h=16;p=function(b){return a.rc2.createDecryptionCipher(b,128)};break;default:throw d=Error('Could not decrypt private key; unsupported encryption algorithm "'+g.dekInfo.algorithm+'".'),d.algorithm=g.dekInfo.algorithm,d;}var v=a.util.hexToBytes(g.dekInfo.parameters);h=a.pbe.opensslDeriveBytes(c,v.substr(0,8),h);p=p(h);p.start(v);p.update(a.util.createBuffer(g.body));if(p.finish())d=p.output.getBytes();else return d}else d=
476
-g.body;d="ENCRYPTED PRIVATE KEY"===g.type?l.decryptPrivateKeyInfo(e.fromDer(d),c):e.fromDer(d);null!==d&&(d=l.privateKeyFromAsn1(d));return d};l.pbe.generatePkcs12Key=function(b,c,d,e,g,m){var h,p;if("undefined"===typeof m||null===m)m=a.md.sha1.create();var l=m.digestLength,v=m.blockLength,k=new a.util.ByteBuffer,x=new a.util.ByteBuffer;if(null!==b&&void 0!==b){for(p=0;p<b.length;p++)x.putInt16(b.charCodeAt(p));x.putInt16(0)}b=x.length();var q=c.length(),w=new a.util.ByteBuffer;w.fillWithByte(d,v);
477
-var u=v*Math.ceil(q/v);d=new a.util.ByteBuffer;for(p=0;p<u;p++)d.putByte(c.at(p%q));u=v*Math.ceil(b/v);c=new a.util.ByteBuffer;for(p=0;p<u;p++)c.putByte(x.at(p%b));x=d;x.putBuffer(c);c=Math.ceil(g/l);for(d=1;d<=c;d++){u=new a.util.ByteBuffer;u.putBytes(w.bytes());u.putBytes(x.bytes());for(p=0;p<e;p++)m.start(),m.update(u.getBytes()),u=m.digest();var K=new a.util.ByteBuffer;for(p=0;p<v;p++)K.putByte(u.at(p%l));var aa=Math.ceil(q/v)+Math.ceil(b/v),O=new a.util.ByteBuffer;for(h=0;h<aa;h++){var R=new a.util.ByteBuffer(x.getBytes(v)),
478
-W=511;for(p=K.length()-1;0<=p;p--)W>>=8,W+=K.at(p)+R.at(p),R.setAt(p,W&255);O.putBuffer(R)}x=O;k.putBuffer(u)}k.truncate(k.length()-g);return k};l.pbe.getCipher=function(a,b,c){switch(a){case l.oids.pkcs5PBES2:return l.pbe.getCipherForPBES2(a,b,c);case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case l.oids["pbewithSHAAnd40BitRC2-CBC"]:return l.pbe.getCipherForPKCS12PBE(a,b,c);default:throw b=Error("Cannot read encrypted PBE data block. Unsupported OID."),b.oid=a,b.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC",
479
-"pbewithSHAAnd40BitRC2-CBC"],b;}};l.pbe.getCipherForPBES2=function(b,c,d){var h={};b=[];if(!e.validate(c,g,h,b)){var p=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");p.errors=b;throw p;}b=e.derToOid(h.kdfOid);if(b!==l.oids.pkcs5PBKDF2)throw p=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),p.oid=b,p.supportedOids=["pkcs5PBKDF2"],p;b=e.derToOid(h.encOid);if(b!==l.oids["aes128-CBC"]&&
480
-b!==l.oids["aes192-CBC"]&&b!==l.oids["aes256-CBC"]&&b!==l.oids["des-EDE3-CBC"]&&b!==l.oids.desCBC)throw p=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),p.oid=b,p.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],p;c=h.kdfSalt;var v=a.util.createBuffer(h.kdfIterationCount),v=v.getInt(v.length()<<3),k;switch(l.oids[b]){case "aes128-CBC":k=16;p=a.aes.createDecryptionCipher;break;case "aes192-CBC":k=24;p=a.aes.createDecryptionCipher;break;
481
-case "aes256-CBC":k=32;p=a.aes.createDecryptionCipher;break;case "des-EDE3-CBC":k=24;p=a.des.createDecryptionCipher;break;case "desCBC":k=8,p=a.des.createDecryptionCipher}b=a.pkcs5.pbkdf2(d,c,v,k);h=h.encIv;p=p(b);p.start(h);return p};l.pbe.getCipherForPKCS12PBE=function(b,c,d){var g={},h=[];if(!e.validate(c,k,g,h))throw d=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=h,d;var h=a.util.createBuffer(g.salt),g=a.util.createBuffer(g.iterations),
482
-g=g.getInt(g.length()<<3),p;switch(b){case l.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:p=24;c=8;b=a.des.startDecrypting;break;case l.oids["pbewithSHAAnd40BitRC2-CBC"]:p=5;c=8;b=function(b,c){var d=a.rc2.createDecryptionCipher(b,40);d.start(c,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=b,d;}p=l.pbe.generatePkcs12Key(d,h,1,g,p);d=l.pbe.generatePkcs12Key(d,h,2,g,c);return b(p,d)};l.pbe.opensslDeriveBytes=function(b,d,e,g){if("undefined"===
483
-typeof g||null===g)g=a.md.md5.create();null===d&&(d="");for(var h=[c(g,b+d)],m=16,l=1;m<e;++l,m+=16)h.push(c(g,h[l-1]+b+d));return h.join("").substr(0,e)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pbe)return c.pbe;c.defined.pbe=!0;for(var p=
484
-0;p<e.length;++p)e[p](c);return c.pbe}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pbe","require module ./aes ./asn1 ./des ./md ./oids ./pem ./pbkdf2 ./random ./rc2 ./rsa ./util".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1,d=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=
464
+type:e.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:e.Class.UNIVERSAL,type:e.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},r={name:"pkcs-12PbeParams",tagClass:e.Class.UNIVERSAL,type:e.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:e.Class.UNIVERSAL,type:e.Type.OCTETSTRING,constructed:!1,capture:"salt"},
465
+{name:"pkcs-12PbeParams.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"iterations"}]};h.encryptPrivateKeyInfo=function(b,c,d){d=d||{};d.saltSize=d.saltSize||8;d.count=d.count||2048;d.algorithm=d.algorithm||"aes128";var g=a.random.getBytesSync(d.saltSize),m=d.count,l=e.integerToDer(m),E;if(0===d.algorithm.indexOf("aes")||"des"===d.algorithm){var A,y;switch(d.algorithm){case "aes128":A=E=16;d=q["aes128-CBC"];y=a.aes.createEncryptionCipher;break;case "aes192":E=24;
466
+A=16;d=q["aes192-CBC"];y=a.aes.createEncryptionCipher;break;case "aes256":E=32;A=16;d=q["aes256-CBC"];y=a.aes.createEncryptionCipher;break;case "des":A=E=8;d=q.desCBC;y=a.des.createEncryptionCipher;break;default:throw g=Error("Cannot encrypt private key. Unknown encryption algorithm."),g.algorithm=d.algorithm,g;}var C=a.pkcs5.pbkdf2(c,g,m,E);c=a.random.getBytesSync(A);m=y(C);m.start(c);m.update(e.toDer(b));m.finish();b=m.output.getBytes();g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,
467
+e.Type.OID,!1,e.oidToDer(q.pkcs5PBES2).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(q.pkcs5PBKDF2).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,g),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,l.getBytes())])]),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(d).getBytes()),e.create(e.Class.UNIVERSAL,
468
+e.Type.OCTETSTRING,!1,c)])])])}else if("3des"===d.algorithm)E=24,d=new a.util.ByteBuffer(g),C=h.pbe.generatePkcs12Key(c,d,1,m,E),c=h.pbe.generatePkcs12Key(c,d,2,m,E),m=a.des.createEncryptionCipher(C),m.start(c),m.update(e.toDer(b)),m.finish(),b=m.output.getBytes(),g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(q["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,
469
+!1,g),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,l.getBytes())])]);else throw g=Error("Cannot encrypt private key. Unknown encryption algorithm."),g.algorithm=d.algorithm,g;return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[g,e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,b)])};h.decryptPrivateKeyInfo=function(b,c){var d=null,g={},m=[];if(!e.validate(b,l,g,m))throw d=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=m,d;m=e.derToOid(g.encryptionOid);
470
+m=h.pbe.getCipher(m,g.encryptionParams,c);g=a.util.createBuffer(g.encryptedData);m.update(g);m.finish()&&(d=e.fromDer(m.output));return d};h.encryptedPrivateKeyToPem=function(b,c){var d={type:"ENCRYPTED PRIVATE KEY",body:e.toDer(b).getBytes()};return a.pem.encode(d,{maxline:c})};h.encryptedPrivateKeyFromPem=function(b){b=a.pem.decode(b)[0];if("ENCRYPTED PRIVATE KEY"!==b.type){var c=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');c.headerType=
471
+b.type;throw c;}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return e.fromDer(b.body)};h.encryptRsaPrivateKey=function(b,c,d){d=d||{};if(!d.legacy)return b=h.wrapRsaPrivateKey(h.privateKeyToAsn1(b)),b=h.encryptPrivateKeyInfo(b,c,d),h.encryptedPrivateKeyToPem(b);var g,m,l;switch(d.algorithm){case "aes128":d="AES-128-CBC";m=16;g=a.random.getBytesSync(16);l=a.aes.createEncryptionCipher;break;case "aes192":d="AES-192-CBC";
472
+m=24;g=a.random.getBytesSync(16);l=a.aes.createEncryptionCipher;break;case "aes256":d="AES-256-CBC";m=32;g=a.random.getBytesSync(16);l=a.aes.createEncryptionCipher;break;case "3des":d="DES-EDE3-CBC";m=24;g=a.random.getBytesSync(8);l=a.des.createEncryptionCipher;break;case "des":d="DES-CBC";m=8;g=a.random.getBytesSync(8);l=a.des.createEncryptionCipher;break;default:throw b=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+d.algorithm+'".'),b.algorithm=d.algorithm,b;}c=a.pbe.opensslDeriveBytes(c,
473
+g.substr(0,8),m);c=l(c);c.start(g);c.update(e.toDer(h.privateKeyToAsn1(b)));c.finish();b={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:d,parameters:a.util.bytesToHex(g).toUpperCase()},body:c.output.getBytes()};return a.pem.encode(b)};h.decryptRsaPrivateKey=function(b,c){var d=null,g=a.pem.decode(b)[0];if("ENCRYPTED PRIVATE KEY"!==g.type&&"PRIVATE KEY"!==g.type&&"RSA PRIVATE KEY"!==g.type)throw d=Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'),
474
+d.headerType=d,d;if(g.procType&&"ENCRYPTED"===g.procType.type){var m,l;switch(g.dekInfo.algorithm){case "DES-CBC":m=8;l=a.des.createDecryptionCipher;break;case "DES-EDE3-CBC":m=24;l=a.des.createDecryptionCipher;break;case "AES-128-CBC":m=16;l=a.aes.createDecryptionCipher;break;case "AES-192-CBC":m=24;l=a.aes.createDecryptionCipher;break;case "AES-256-CBC":m=32;l=a.aes.createDecryptionCipher;break;case "RC2-40-CBC":m=5;l=function(b){return a.rc2.createDecryptionCipher(b,40)};break;case "RC2-64-CBC":m=
475
+8;l=function(b){return a.rc2.createDecryptionCipher(b,64)};break;case "RC2-128-CBC":m=16;l=function(b){return a.rc2.createDecryptionCipher(b,128)};break;default:throw d=Error('Could not decrypt private key; unsupported encryption algorithm "'+g.dekInfo.algorithm+'".'),d.algorithm=g.dekInfo.algorithm,d;}var q=a.util.hexToBytes(g.dekInfo.parameters);m=a.pbe.opensslDeriveBytes(c,q.substr(0,8),m);l=l(m);l.start(q);l.update(a.util.createBuffer(g.body));if(l.finish())d=l.output.getBytes();else return d}else d=
476
+g.body;d="ENCRYPTED PRIVATE KEY"===g.type?h.decryptPrivateKeyInfo(e.fromDer(d),c):e.fromDer(d);null!==d&&(d=h.privateKeyFromAsn1(d));return d};h.pbe.generatePkcs12Key=function(b,c,d,e,g,k){var m,h;if("undefined"===typeof k||null===k)k=a.md.sha1.create();var l=k.digestLength,C=k.blockLength,q=new a.util.ByteBuffer,w=new a.util.ByteBuffer;if(null!==b&&void 0!==b){for(h=0;h<b.length;h++)w.putInt16(b.charCodeAt(h));w.putInt16(0)}b=w.length();var p=c.length(),v=new a.util.ByteBuffer;v.fillWithByte(d,C);
477
+var r=C*Math.ceil(p/C);d=new a.util.ByteBuffer;for(h=0;h<r;h++)d.putByte(c.at(h%p));r=C*Math.ceil(b/C);c=new a.util.ByteBuffer;for(h=0;h<r;h++)c.putByte(w.at(h%b));w=d;w.putBuffer(c);c=Math.ceil(g/l);for(d=1;d<=c;d++){r=new a.util.ByteBuffer;r.putBytes(v.bytes());r.putBytes(w.bytes());for(h=0;h<e;h++)k.start(),k.update(r.getBytes()),r=k.digest();var I=new a.util.ByteBuffer;for(h=0;h<C;h++)I.putByte(r.at(h%l));var B=Math.ceil(p/C)+Math.ceil(b/C),P=new a.util.ByteBuffer;for(m=0;m<B;m++){var R=new a.util.ByteBuffer(w.getBytes(C)),
478
+V=511;for(h=I.length()-1;0<=h;h--)V>>=8,V+=I.at(h)+R.at(h),R.setAt(h,V&255);P.putBuffer(R)}w=P;q.putBuffer(r)}q.truncate(q.length()-g);return q};h.pbe.getCipher=function(a,b,c){switch(a){case h.oids.pkcs5PBES2:return h.pbe.getCipherForPBES2(a,b,c);case h.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case h.oids["pbewithSHAAnd40BitRC2-CBC"]:return h.pbe.getCipherForPKCS12PBE(a,b,c);default:throw b=Error("Cannot read encrypted PBE data block. Unsupported OID."),b.oid=a,b.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC",
479
+"pbewithSHAAnd40BitRC2-CBC"],b;}};h.pbe.getCipherForPBES2=function(b,c,d){var m={};b=[];if(!e.validate(c,g,m,b)){var l=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");l.errors=b;throw l;}b=e.derToOid(m.kdfOid);if(b!==h.oids.pkcs5PBKDF2)throw l=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),l.oid=b,l.supportedOids=["pkcs5PBKDF2"],l;b=e.derToOid(m.encOid);if(b!==h.oids["aes128-CBC"]&&
480
+b!==h.oids["aes192-CBC"]&&b!==h.oids["aes256-CBC"]&&b!==h.oids["des-EDE3-CBC"]&&b!==h.oids.desCBC)throw l=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),l.oid=b,l.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],l;c=m.kdfSalt;var q=a.util.createBuffer(m.kdfIterationCount),q=q.getInt(q.length()<<3),E;switch(h.oids[b]){case "aes128-CBC":E=16;l=a.aes.createDecryptionCipher;break;case "aes192-CBC":E=24;l=a.aes.createDecryptionCipher;break;
481
+case "aes256-CBC":E=32;l=a.aes.createDecryptionCipher;break;case "des-EDE3-CBC":E=24;l=a.des.createDecryptionCipher;break;case "desCBC":E=8,l=a.des.createDecryptionCipher}b=a.pkcs5.pbkdf2(d,c,q,E);m=m.encIv;l=l(b);l.start(m);return l};h.pbe.getCipherForPKCS12PBE=function(b,c,d){var g={},m=[];if(!e.validate(c,r,g,m))throw d=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=m,d;var m=a.util.createBuffer(g.salt),g=a.util.createBuffer(g.iterations),
482
+g=g.getInt(g.length()<<3),l;switch(b){case h.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24;c=8;b=a.des.startDecrypting;break;case h.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5;c=8;b=function(b,c){var d=a.rc2.createDecryptionCipher(b,40);d.start(c,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=b,d;}l=h.pbe.generatePkcs12Key(d,m,1,g,l);d=h.pbe.generatePkcs12Key(d,m,2,g,c);return b(l,d)};h.pbe.opensslDeriveBytes=function(b,d,e,g){if("undefined"===
483
+typeof g||null===g)g=a.md.md5.create();null===d&&(d="");for(var k=[c(g,b+d)],h=16,l=1;h<e;++l,h+=16)k.push(c(g,k[l-1]+b+d));return k.join("").substr(0,e)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pbe)return c.pbe;c.defined.pbe=!0;for(var m=
484
+0;m<e.length;++m)e[m](c);return c.pbe}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pbe","require module ./aes ./asn1 ./des ./md ./oids ./pem ./pbkdf2 ./random ./rc2 ./rsa ./util".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1,d=a.pkcs7asn1=a.pkcs7asn1||{};a.pkcs7=
485
a.pkcs7||{};a.pkcs7.asn1=d;a={name:"ContentInfo",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:c.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};d.contentInfoValidator=a;var e={name:"EncryptedContentInfo",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",
486
tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:c.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",
487
tagClass:c.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};d.envelopedDataValidator={name:"EnvelopedData",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:c.Class.UNIVERSAL,type:c.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(e)};d.encryptedDataValidator={name:"EncryptedData",
@@ -492,408 +492,409 @@ value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:c.Class.UNIVERSAL,t
492
constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:c.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]}]}]};d.recipientInfoValidator={name:"RecipientInfo",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,
493
constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:c.Class.UNIVERSAL,type:c.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.SEQUENCE,constructed:!0,
494
value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:c.Class.UNIVERSAL,type:c.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:c.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:c.Class.UNIVERSAL,type:c.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===
495
-typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs7asn1)return c.pkcs7asn1;c.defined.pkcs7asn1=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pkcs7asn1}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs7asn1",
496
-["require","module","./asn1","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.mgf=a.mgf||{};(a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(b){return{generate:function(c,d){for(var e=new a.util.ByteBuffer,h=Math.ceil(d/b.digestLength),l=0;l<h;l++){var g=new a.util.ByteBuffer;g.putInt32(l);b.start();b.update(c+g.getBytes());e.putBuffer(b.digest())}e.truncate(e.length()-d);return e.getBytes()}}}}if("function"!==typeof a)if("object"===typeof module&&
497
-module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.mgf1)return c.mgf1;c.defined.mgf1=!0;for(var l=0;l<e.length;++l)e[l](c);return c.mgf1}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,
498
-Array.prototype.slice.call(arguments,0))};a("js/mgf1",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.mgf=a.mgf||{};a.mgf.mgf1=a.mgf1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
499
-{};if(c.defined.mgf)return c.mgf;c.defined.mgf=!0;for(var l=0;l<e.length;++l)e[l](c);return c.mgf}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/mgf",["require","module","./mgf1"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){(a.pss=a.pss||{}).create=function(b){3===arguments.length&&
500
-(b={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var c=b.md,d=b.mgf,e=c.digestLength,h=b.salt||null;"string"===typeof h&&(h=a.util.createBuffer(h));var l;if("saltLength"in b)l=b.saltLength;else if(null!==h)l=h.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==h&&h.length()!==l)throw Error("Given salt length does not match length of given salt.");var g=b.prng||a.random;return{encode:function(b,p){var k,z=p-1,u=Math.ceil(z/8),I=b.digest().getBytes();
501
-if(u<e+l+2)throw Error("Message is too long to encrypt.");var F;F=null===h?g.getBytesSync(l):h.bytes();k=new a.util.ByteBuffer;k.fillWithByte(0,8);k.putBytes(I);k.putBytes(F);c.start();c.update(k.getBytes());I=c.digest().getBytes();k=new a.util.ByteBuffer;k.fillWithByte(0,u-l-e-2);k.putByte(1);k.putBytes(F);var D=k.getBytes(),A=u-e-1,y=d.generate(I,A);F="";for(k=0;k<A;k++)F+=String.fromCharCode(D.charCodeAt(k)^y.charCodeAt(k));z=65280>>8*u-z&255;F=String.fromCharCode(F.charCodeAt(0)&~z)+F.substr(1);
502
-return F+I+String.fromCharCode(188)},verify:function(b,g,h){var p;p=h-1;h=Math.ceil(p/8);g=g.substr(-h);if(h<e+l+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==g.charCodeAt(h-1))throw Error("Encoded message does not end in 0xBC.");var k=h-e-1,u=g.substr(0,k);g=g.substr(k,e);var F=65280>>8*h-p&255;if(0!==(u.charCodeAt(0)&F))throw Error("Bits beyond keysize not zero as expected.");var D=d.generate(g,k),A="";for(p=0;p<k;p++)A+=String.fromCharCode(u.charCodeAt(p)^D.charCodeAt(p));
503
-A=String.fromCharCode(A.charCodeAt(0)&~F)+A.substr(1);h=h-e-l-2;for(p=0;p<h;p++)if(0!==A.charCodeAt(p))throw Error("Leftmost octets not zero as expected");if(1!==A.charCodeAt(h))throw Error("Inconsistent PSS signature, 0x01 marker not found");h=A.substr(-l);k=new a.util.ByteBuffer;k.fillWithByte(0,8);k.putBytes(b);k.putBytes(h);c.start();c.update(k.getBytes());b=c.digest().getBytes();return g===b}}}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,
504
-module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pss)return c.pss;c.defined.pss=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pss}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pss",
505
-["require","module","./random","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b){"string"===typeof b&&(b={shortName:b});for(var d=null,e,g=0;null===d&&g<a.attributes.length;++g)e=a.attributes[g],b.type&&b.type===e.type?d=e:b.name&&b.name===e.name?d=e:b.shortName&&b.shortName===e.shortName&&(d=e);return d}function d(b){var c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),e;b=b.attributes;for(var h=0;h<b.length;++h){e=b[h];
506
-var m=e.value,l=g.Type.PRINTABLESTRING;"valueTagClass"in e&&(l=e.valueTagClass,l===g.Type.UTF8&&(m=a.util.encodeUtf8(m)));e=g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e.type).getBytes()),g.create(g.Class.UNIVERSAL,l,!1,m)])]);c.value.push(e)}return c}function e(a){for(var b,c=0;c<a.length;++c){b=a[c];"undefined"===typeof b.name&&(b.type&&b.type in k.oids?b.name=k.oids[b.type]:b.shortName&&b.shortName in
507
-u&&(b.name=k.oids[u[b.shortName]]));if("undefined"===typeof b.type)if(b.name&&b.name in k.oids)b.type=k.oids[b.name];else throw a=Error("Attribute type not specified."),a.attribute=b,a;"undefined"===typeof b.shortName&&b.name&&b.name in u&&(b.shortName=u[b.name]);if(b.type===r.extensionRequest&&(b.valueConstructed=!0,b.valueTagClass=g.Type.SEQUENCE,!b.value&&b.extensions)){b.value=[];for(var d=0;d<b.extensions.length;++d)b.value.push(k.certificateExtensionToAsn1(l(b.extensions[d])))}if("undefined"===
508
-typeof b.value)throw a=Error("Attribute value not specified."),a.attribute=b,a;}}function l(b,c){c=c||{};"undefined"===typeof b.name&&b.id&&b.id in k.oids&&(b.name=k.oids[b.id]);if("undefined"===typeof b.id)if(b.name&&b.name in k.oids)b.id=k.oids[b.name];else{var d=Error("Extension ID not specified.");d.extension=b;throw d;}if("undefined"!==typeof b.value)return b;if("keyUsage"===b.name){var e=d=0,h=0;b.digitalSignature&&(e|=128,d=7);b.nonRepudiation&&(e|=64,d=6);b.keyEncipherment&&(e|=32,d=5);b.dataEncipherment&&
509
-(e|=16,d=4);b.keyAgreement&&(e|=8,d=3);b.keyCertSign&&(e|=4,d=2);b.cRLSign&&(e|=2,d=1);b.encipherOnly&&(e|=1,d=0);b.decipherOnly&&(h|=128,d=7);d=String.fromCharCode(d);0!==h?d+=String.fromCharCode(e)+String.fromCharCode(h):0!==e&&(d+=String.fromCharCode(e));b.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d)}else if("basicConstraints"===b.name)b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),b.cA&&b.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255))),
510
-"pathLenConstraint"in b&&b.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(b.pathLenConstraint).getBytes()));else if("extKeyUsage"===b.name)for(e in b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),d=b.value.value,b)!0===b[e]&&(e in r?d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(r[e]).getBytes())):-1!==e.indexOf(".")&&d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e).getBytes())));else if("nsCertType"===b.name)e=d=0,b.client&&(e|=128,
511
-d=7),b.server&&(e|=64,d=6),b.email&&(e|=32,d=5),b.objsign&&(e|=16,d=4),b.reserved&&(e|=8,d=3),b.sslCA&&(e|=4,d=2),b.emailCA&&(e|=2,d=1),b.objCA&&(e|=1,d=0),d=String.fromCharCode(d),0!==e&&(d+=String.fromCharCode(e)),b.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d);else if("subjectAltName"===b.name||"issuerAltName"===b.name)for(b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),h=0;h<b.altNames.length;++h){e=b.altNames[h];d=e.value;if(7===e.type&&e.ip){if(d=a.util.bytesFromIP(e.ip),
495
+typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs7asn1)return c.pkcs7asn1;c.defined.pkcs7asn1=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pkcs7asn1}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs7asn1",
496
+["require","module","./asn1","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.mgf=a.mgf||{};(a.mgf.mgf1=a.mgf1=a.mgf1||{}).create=function(b){return{generate:function(c,d){for(var e=new a.util.ByteBuffer,h=Math.ceil(d/b.digestLength),l=0;l<h;l++){var g=new a.util.ByteBuffer;g.putInt32(l);b.start();b.update(c+g.getBytes());e.putBuffer(b.digest())}e.truncate(e.length()-d);return e.getBytes()}}}}if("function"!==typeof a)if("object"===typeof module&&
497
+module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.mgf1)return c.mgf1;c.defined.mgf1=!0;for(var h=0;h<e.length;++h)e[h](c);return c.mgf1}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,
498
+Array.prototype.slice.call(arguments,0))};a("js/mgf1",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.mgf=a.mgf||{};a.mgf.mgf1=a.mgf1}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||
499
+{};if(c.defined.mgf)return c.mgf;c.defined.mgf=!0;for(var h=0;h<e.length;++h)e[h](c);return c.mgf}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/mgf",["require","module","./mgf1"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){(a.pss=a.pss||{}).create=function(b){3===arguments.length&&
500
+(b={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var c=b.md,d=b.mgf,e=c.digestLength,h=b.salt||null;"string"===typeof h&&(h=a.util.createBuffer(h));var l;if("saltLength"in b)l=b.saltLength;else if(null!==h)l=h.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==h&&h.length()!==l)throw Error("Given salt length does not match length of given salt.");var g=b.prng||a.random;return{encode:function(b,m){var q,z=m-1,r=Math.ceil(z/8),F=b.digest().getBytes();
501
+if(r<e+l+2)throw Error("Message is too long to encrypt.");var G;G=null===h?g.getBytesSync(l):h.bytes();q=new a.util.ByteBuffer;q.fillWithByte(0,8);q.putBytes(F);q.putBytes(G);c.start();c.update(q.getBytes());F=c.digest().getBytes();q=new a.util.ByteBuffer;q.fillWithByte(0,r-l-e-2);q.putByte(1);q.putBytes(G);var E=q.getBytes(),A=r-e-1,y=d.generate(F,A);G="";for(q=0;q<A;q++)G+=String.fromCharCode(E.charCodeAt(q)^y.charCodeAt(q));z=65280>>8*r-z&255;G=String.fromCharCode(G.charCodeAt(0)&~z)+G.substr(1);
502
+return G+F+String.fromCharCode(188)},verify:function(b,g,h){var m;m=h-1;h=Math.ceil(m/8);g=g.substr(-h);if(h<e+l+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==g.charCodeAt(h-1))throw Error("Encoded message does not end in 0xBC.");var q=h-e-1,r=g.substr(0,q);g=g.substr(q,e);var G=65280>>8*h-m&255;if(0!==(r.charCodeAt(0)&G))throw Error("Bits beyond keysize not zero as expected.");var E=d.generate(g,q),A="";for(m=0;m<q;m++)A+=String.fromCharCode(r.charCodeAt(m)^E.charCodeAt(m));
503
+A=String.fromCharCode(A.charCodeAt(0)&~G)+A.substr(1);h=h-e-l-2;for(m=0;m<h;m++)if(0!==A.charCodeAt(m))throw Error("Leftmost octets not zero as expected");if(1!==A.charCodeAt(h))throw Error("Inconsistent PSS signature, 0x01 marker not found");h=A.substr(-l);q=new a.util.ByteBuffer;q.fillWithByte(0,8);q.putBytes(b);q.putBytes(h);c.start();c.update(q.getBytes());b=c.digest().getBytes();return g===b}}}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,
504
+module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pss)return c.pss;c.defined.pss=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pss}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pss",
505
+["require","module","./random","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b){"string"===typeof b&&(b={shortName:b});for(var d=null,e,g=0;null===d&&g<a.attributes.length;++g)e=a.attributes[g],b.type&&b.type===e.type?d=e:b.name&&b.name===e.name?d=e:b.shortName&&b.shortName===e.shortName&&(d=e);return d}function d(b){var c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),e;b=b.attributes;for(var k=0;k<b.length;++k){e=b[k];
506
+var h=e.value,l=g.Type.PRINTABLESTRING;"valueTagClass"in e&&(l=e.valueTagClass,l===g.Type.UTF8&&(h=a.util.encodeUtf8(h)));e=g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e.type).getBytes()),g.create(g.Class.UNIVERSAL,l,!1,h)])]);c.value.push(e)}return c}function e(a){for(var b,c=0;c<a.length;++c){b=a[c];"undefined"===typeof b.name&&(b.type&&b.type in r.oids?b.name=r.oids[b.type]:b.shortName&&b.shortName in
507
+D&&(b.name=r.oids[D[b.shortName]]));if("undefined"===typeof b.type)if(b.name&&b.name in r.oids)b.type=r.oids[b.name];else throw a=Error("Attribute type not specified."),a.attribute=b,a;"undefined"===typeof b.shortName&&b.name&&b.name in D&&(b.shortName=D[b.name]);if(b.type===u.extensionRequest&&(b.valueConstructed=!0,b.valueTagClass=g.Type.SEQUENCE,!b.value&&b.extensions)){b.value=[];for(var d=0;d<b.extensions.length;++d)b.value.push(r.certificateExtensionToAsn1(h(b.extensions[d])))}if("undefined"===
508
+typeof b.value)throw a=Error("Attribute value not specified."),a.attribute=b,a;}}function h(b,c){c=c||{};"undefined"===typeof b.name&&b.id&&b.id in r.oids&&(b.name=r.oids[b.id]);if("undefined"===typeof b.id)if(b.name&&b.name in r.oids)b.id=r.oids[b.name];else{var d=Error("Extension ID not specified.");d.extension=b;throw d;}if("undefined"!==typeof b.value)return b;if("keyUsage"===b.name){var e=d=0,k=0;b.digitalSignature&&(e|=128,d=7);b.nonRepudiation&&(e|=64,d=6);b.keyEncipherment&&(e|=32,d=5);b.dataEncipherment&&
509
+(e|=16,d=4);b.keyAgreement&&(e|=8,d=3);b.keyCertSign&&(e|=4,d=2);b.cRLSign&&(e|=2,d=1);b.encipherOnly&&(e|=1,d=0);b.decipherOnly&&(k|=128,d=7);d=String.fromCharCode(d);0!==k?d+=String.fromCharCode(e)+String.fromCharCode(k):0!==e&&(d+=String.fromCharCode(e));b.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d)}else if("basicConstraints"===b.name)b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),b.cA&&b.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255))),
510
+"pathLenConstraint"in b&&b.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(b.pathLenConstraint).getBytes()));else if("extKeyUsage"===b.name)for(e in b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),d=b.value.value,b)!0===b[e]&&(e in u?d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(u[e]).getBytes())):-1!==e.indexOf(".")&&d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e).getBytes())));else if("nsCertType"===b.name)e=d=0,b.client&&(e|=128,
511
+d=7),b.server&&(e|=64,d=6),b.email&&(e|=32,d=5),b.objsign&&(e|=16,d=4),b.reserved&&(e|=8,d=3),b.sslCA&&(e|=4,d=2),b.emailCA&&(e|=2,d=1),b.objCA&&(e|=1,d=0),d=String.fromCharCode(d),0!==e&&(d+=String.fromCharCode(e)),b.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d);else if("subjectAltName"===b.name||"issuerAltName"===b.name)for(b.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),k=0;k<b.altNames.length;++k){e=b.altNames[k];d=e.value;if(7===e.type&&e.ip){if(d=a.util.bytesFromIP(e.ip),
512
null===d)throw d=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.'),d.extension=b,d;}else 8===e.type&&(d=e.oid?g.oidToDer(g.oidToDer(e.oid)):g.oidToDer(d));b.value.value.push(g.create(g.Class.CONTEXT_SPECIFIC,e.type,!1,d))}else"subjectKeyIdentifier"===b.name&&c.cert&&(d=c.cert.generateSubjectKeyIdentifier(),b.subjectKeyIdentifier=d.toHex(),b.value=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,d.getBytes()));if("undefined"===typeof b.value)throw d=Error("Extension value not specified."),
513
-d.extension=b,d;return b}function h(a,b){switch(a){case r["RSASSA-PSS"]:var c=[];void 0!==b.hash.algorithmOid&&c.push(g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(b.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])]));void 0!==b.mgf.algorithmOid&&c.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,
513
+d.extension=b,d;return b}function q(a,b){switch(a){case u["RSASSA-PSS"]:var c=[];void 0!==b.hash.algorithmOid&&c.push(g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(b.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])]));void 0!==b.mgf.algorithmOid&&c.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,
514
!1,g.oidToDer(b.mgf.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(b.mgf.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])])]));void 0!==b.saltLength&&c.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(b.saltLength).getBytes())]));return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,c);default:return g.create(g.Class.UNIVERSAL,g.Type.NULL,
515
-!1,"")}}function v(b){var c=g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===b.attributes.length)return c;b=b.attributes;for(var d=0;d<b.length;++d){var e=b[d],h=e.value,m=g.Type.UTF8;"valueTagClass"in e&&(m=e.valueTagClass);m===g.Type.UTF8&&(h=a.util.encodeUtf8(h));var l=!1;"valueConstructed"in e&&(l=e.valueConstructed);e=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e.type).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,
516
-m,l,h)])]);c.value.push(e)}return c}var g=a.asn1,k=a.pki=a.pki||{},r=k.oids,u={};u.CN=r.commonName;u.commonName="CN";u.C=r.countryName;u.countryName="C";u.L=r.localityName;u.localityName="L";u.ST=r.stateOrProvinceName;u.stateOrProvinceName="ST";u.O=r.organizationName;u.organizationName="O";u.OU=r.organizationalUnitName;u.organizationalUnitName="OU";u.E=r.emailAddress;u.emailAddress="E";var z=a.pki.rsa.publicKeyValidator,B={name:"Certificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,
515
+!1,"")}}function l(b){var c=g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===b.attributes.length)return c;b=b.attributes;for(var d=0;d<b.length;++d){var e=b[d],k=e.value,h=g.Type.UTF8;"valueTagClass"in e&&(h=e.valueTagClass);h===g.Type.UTF8&&(k=a.util.encodeUtf8(k));var l=!1;"valueConstructed"in e&&(l=e.valueConstructed);e=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e.type).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SET,!0,[g.create(g.Class.UNIVERSAL,
516
+h,l,k)])]);c.value.push(e)}return c}var g=a.asn1,r=a.pki=a.pki||{},u=r.oids,D={};D.CN=u.commonName;D.commonName="CN";D.C=u.countryName;D.countryName="C";D.L=u.localityName;D.localityName="L";D.ST=u.stateOrProvinceName;D.stateOrProvinceName="ST";D.O=u.organizationName;D.organizationName="O";D.OU=u.organizationalUnitName;D.organizationalUnitName="OU";D.E=u.emailAddress;D.emailAddress="E";var z=a.pki.rsa.publicKeyValidator,x={name:"Certificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,
517
value:[{name:"Certificate.TBSCertificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,
518
capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,
519
constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:g.Class.UNIVERSAL,type:g.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:g.Class.UNIVERSAL,type:g.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},
520
{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:g.Class.UNIVERSAL,type:g.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:g.Class.UNIVERSAL,type:g.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},z,{name:"Certificate.TBSCertificate.issuerUniqueID",
521
tagClass:g.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:g.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},
522
{name:"Certificate.TBSCertificate.extensions",tagClass:g.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},
523
-{name:"Certificate.signatureValue",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},I={name:"rsapss",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,
523
+{name:"Certificate.signatureValue",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},F={name:"rsapss",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,
524
type:g.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:g.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:g.Class.UNIVERSAL,type:g.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:g.Class.UNIVERSAL,
525
type:g.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:g.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:g.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",
526
-tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},F={name:"CertificationRequest",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[{name:"CertificationRequestInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",
526
+tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},G={name:"CertificationRequest",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[{name:"CertificationRequestInfo",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:g.Class.UNIVERSAL,type:g.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",
527
tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},z,{name:"CertificationRequestInfo.attributes",tagClass:g.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",
528
tagClass:g.Class.UNIVERSAL,type:g.Type.SET,constructed:!0}]}]}]},{name:"CertificationRequest.signatureAlgorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:g.Class.UNIVERSAL,type:g.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:g.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:g.Class.UNIVERSAL,
529
-type:g.Type.BITSTRING,constructed:!1,capture:"csrSignature"}]};k.RDNAttributesAsArray=function(a,b){for(var c=[],d,e,n,h=0;h<a.value.length;++h){d=a.value[h];for(var m=0;m<d.value.length;++m)n={},e=d.value[m],n.type=g.derToOid(e.value[0].value),n.value=e.value[1].value,n.valueTagClass=e.value[1].type,n.type in r&&(n.name=r[n.type],n.name in u&&(n.shortName=u[n.name])),b&&(b.update(n.type),b.update(n.value)),c.push(n)}return c};k.CRIAttributesAsArray=function(a){for(var b=[],c=0;c<a.length;++c)for(var d=
530
-a[c],e=g.derToOid(d.value[0].value),d=d.value[1].value,n=0;n<d.length;++n){var h={};h.type=e;h.value=d[n].value;h.valueTagClass=d[n].type;h.type in r&&(h.name=r[h.type],h.name in u&&(h.shortName=u[h.name]));if(h.type===r.extensionRequest){h.extensions=[];for(var m=0;m<h.value.length;++m)h.extensions.push(k.certificateExtensionFromAsn1(h.value[m]))}b.push(h)}return b};var D=function(a,b,c){var d={};if(a!==r["RSASSA-PSS"])return d;c&&(d={hash:{algorithmOid:r.sha1},mgf:{algorithmOid:r.mgf1,hash:{algorithmOid:r.sha1}},
531
-saltLength:20});c={};a=[];if(!g.validate(b,I,c,a))throw b=Error("Cannot read RSASSA-PSS parameter block."),b.errors=a,b;void 0!==c.hashOid&&(d.hash=d.hash||{},d.hash.algorithmOid=g.derToOid(c.hashOid));void 0!==c.maskGenOid&&(d.mgf=d.mgf||{},d.mgf.algorithmOid=g.derToOid(c.maskGenOid),d.mgf.hash=d.mgf.hash||{},d.mgf.hash.algorithmOid=g.derToOid(c.maskGenHashOid));void 0!==c.saltLength&&(d.saltLength=c.saltLength.charCodeAt(0));return d};k.certificateFromPem=function(b,c,d){b=a.pem.decode(b)[0];if("CERTIFICATE"!==
532
-b.type&&"X509 CERTIFICATE"!==b.type&&"TRUSTED CERTIFICATE"!==b.type)throw c=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'),c.headerType=b.type,c;if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");d=g.fromDer(b.body,d);return k.certificateFromAsn1(d,c)};k.certificateToPem=function(b,c){var d={type:"CERTIFICATE",body:g.toDer(k.certificateToAsn1(b)).getBytes()};
533
-return a.pem.encode(d,{maxline:c})};k.publicKeyFromPem=function(b){b=a.pem.decode(b)[0];if("PUBLIC KEY"!==b.type&&"RSA PUBLIC KEY"!==b.type){var c=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');c.headerType=b.type;throw c;}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");b=g.fromDer(b.body);return k.publicKeyFromAsn1(b)};k.publicKeyToPem=function(b,c){var d={type:"PUBLIC KEY",
534
-body:g.toDer(k.publicKeyToAsn1(b)).getBytes()};return a.pem.encode(d,{maxline:c})};k.publicKeyToRSAPublicKeyPem=function(b,c){var d={type:"RSA PUBLIC KEY",body:g.toDer(k.publicKeyToRSAPublicKey(b)).getBytes()};return a.pem.encode(d,{maxline:c})};k.getPublicKeyFingerprint=function(b,c){c=c||{};var d=c.md||a.md.sha1.create(),e;switch(c.type||"RSAPublicKey"){case "RSAPublicKey":e=g.toDer(k.publicKeyToRSAPublicKey(b)).getBytes();break;case "SubjectPublicKeyInfo":e=g.toDer(k.publicKeyToAsn1(b)).getBytes();
535
-break;default:throw Error('Unknown fingerprint type "'+c.type+'".');}d.start();d.update(e);d=d.digest();if("hex"===c.encoding)return d=d.toHex(),c.delimiter?d.match(/.{2}/g).join(c.delimiter):d;if("binary"===c.encoding)return d.getBytes();if(c.encoding)throw Error('Unknown encoding "'+c.encoding+'".');return d};k.certificationRequestFromPem=function(b,c,d){b=a.pem.decode(b)[0];if("CERTIFICATE REQUEST"!==b.type)throw c=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'),
536
-c.headerType=b.type,c;if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");d=g.fromDer(b.body,d);return k.certificationRequestFromAsn1(d,c)};k.certificationRequestToPem=function(b,c){var d={type:"CERTIFICATE REQUEST",body:g.toDer(k.certificationRequestToAsn1(b)).getBytes()};return a.pem.encode(d,{maxline:c})};k.createCertificate=function(){var b={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};b.siginfo.algorithmOid=
529
+type:g.Type.BITSTRING,constructed:!1,capture:"csrSignature"}]};r.RDNAttributesAsArray=function(a,b){for(var c=[],d,e,n,k=0;k<a.value.length;++k){d=a.value[k];for(var h=0;h<d.value.length;++h)n={},e=d.value[h],n.type=g.derToOid(e.value[0].value),n.value=e.value[1].value,n.valueTagClass=e.value[1].type,n.type in u&&(n.name=u[n.type],n.name in D&&(n.shortName=D[n.name])),b&&(b.update(n.type),b.update(n.value)),c.push(n)}return c};r.CRIAttributesAsArray=function(a){for(var b=[],c=0;c<a.length;++c)for(var d=
530
+a[c],e=g.derToOid(d.value[0].value),d=d.value[1].value,n=0;n<d.length;++n){var k={};k.type=e;k.value=d[n].value;k.valueTagClass=d[n].type;k.type in u&&(k.name=u[k.type],k.name in D&&(k.shortName=D[k.name]));if(k.type===u.extensionRequest){k.extensions=[];for(var h=0;h<k.value.length;++h)k.extensions.push(r.certificateExtensionFromAsn1(k.value[h]))}b.push(k)}return b};var E=function(a,b,c){var d={};if(a!==u["RSASSA-PSS"])return d;c&&(d={hash:{algorithmOid:u.sha1},mgf:{algorithmOid:u.mgf1,hash:{algorithmOid:u.sha1}},
531
+saltLength:20});c={};a=[];if(!g.validate(b,F,c,a))throw b=Error("Cannot read RSASSA-PSS parameter block."),b.errors=a,b;void 0!==c.hashOid&&(d.hash=d.hash||{},d.hash.algorithmOid=g.derToOid(c.hashOid));void 0!==c.maskGenOid&&(d.mgf=d.mgf||{},d.mgf.algorithmOid=g.derToOid(c.maskGenOid),d.mgf.hash=d.mgf.hash||{},d.mgf.hash.algorithmOid=g.derToOid(c.maskGenHashOid));void 0!==c.saltLength&&(d.saltLength=c.saltLength.charCodeAt(0));return d};r.certificateFromPem=function(b,c,d){b=a.pem.decode(b)[0];if("CERTIFICATE"!==
532
+b.type&&"X509 CERTIFICATE"!==b.type&&"TRUSTED CERTIFICATE"!==b.type)throw c=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'),c.headerType=b.type,c;if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");d=g.fromDer(b.body,d);return r.certificateFromAsn1(d,c)};r.certificateToPem=function(b,c){var d={type:"CERTIFICATE",body:g.toDer(r.certificateToAsn1(b)).getBytes()};
533
+return a.pem.encode(d,{maxline:c})};r.publicKeyFromPem=function(b){b=a.pem.decode(b)[0];if("PUBLIC KEY"!==b.type&&"RSA PUBLIC KEY"!==b.type){var c=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');c.headerType=b.type;throw c;}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");b=g.fromDer(b.body);return r.publicKeyFromAsn1(b)};r.publicKeyToPem=function(b,c){var d={type:"PUBLIC KEY",
534
+body:g.toDer(r.publicKeyToAsn1(b)).getBytes()};return a.pem.encode(d,{maxline:c})};r.publicKeyToRSAPublicKeyPem=function(b,c){var d={type:"RSA PUBLIC KEY",body:g.toDer(r.publicKeyToRSAPublicKey(b)).getBytes()};return a.pem.encode(d,{maxline:c})};r.getPublicKeyFingerprint=function(b,c){c=c||{};var d=c.md||a.md.sha1.create(),e;switch(c.type||"RSAPublicKey"){case "RSAPublicKey":e=g.toDer(r.publicKeyToRSAPublicKey(b)).getBytes();break;case "SubjectPublicKeyInfo":e=g.toDer(r.publicKeyToAsn1(b)).getBytes();
535
+break;default:throw Error('Unknown fingerprint type "'+c.type+'".');}d.start();d.update(e);d=d.digest();if("hex"===c.encoding)return d=d.toHex(),c.delimiter?d.match(/.{2}/g).join(c.delimiter):d;if("binary"===c.encoding)return d.getBytes();if(c.encoding)throw Error('Unknown encoding "'+c.encoding+'".');return d};r.certificationRequestFromPem=function(b,c,d){b=a.pem.decode(b)[0];if("CERTIFICATE REQUEST"!==b.type)throw c=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'),
536
+c.headerType=b.type,c;if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");d=g.fromDer(b.body,d);return r.certificationRequestFromAsn1(d,c)};r.certificationRequestToPem=function(b,c){var d={type:"CERTIFICATE REQUEST",body:g.toDer(r.certificationRequestToAsn1(b)).getBytes()};return a.pem.encode(d,{maxline:c})};r.createCertificate=function(){var b={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};b.siginfo.algorithmOid=
537
null;b.validity={};b.validity.notBefore=new Date;b.validity.notAfter=new Date;b.issuer={};b.issuer.getField=function(a){return c(b.issuer,a)};b.issuer.addField=function(a){e([a]);b.issuer.attributes.push(a)};b.issuer.attributes=[];b.issuer.hash=null;b.subject={};b.subject.getField=function(a){return c(b.subject,a)};b.subject.addField=function(a){e([a]);b.subject.attributes.push(a)};b.subject.attributes=[];b.subject.hash=null;b.extensions=[];b.publicKey=null;b.md=null;b.setSubject=function(a,c){e(a);
538
-b.subject.attributes=a;delete b.subject.uniqueId;c&&(b.subject.uniqueId=c);b.subject.hash=null};b.setIssuer=function(a,c){e(a);b.issuer.attributes=a;delete b.issuer.uniqueId;c&&(b.issuer.uniqueId=c);b.issuer.hash=null};b.setExtensions=function(a){for(var c=0;c<a.length;++c)l(a[c],{cert:b});b.extensions=a};b.getExtension=function(a){"string"===typeof a&&(a={name:a});for(var c=null,d,e=0;null===c&&e<b.extensions.length;++e)d=b.extensions[e],a.id&&d.id===a.id?c=d:a.name&&d.name===a.name&&(c=d);return c};
539
-b.sign=function(c,d){b.md=d||a.md.sha1.create();var e=r[b.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certificate digest. Unknown message digest algorithm OID."),e.algorithm=b.md.algorithm,e;b.signatureOid=b.siginfo.algorithmOid=e;b.tbsCertificate=k.getTBSCertificate(b);e=g.toDer(b.tbsCertificate);b.md.update(e.getBytes());b.signature=c.sign(b.md)};b.verify=function(c){var d=!1;if(!b.issued(c)){var d=b.subject,e=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");
540
-e.expectedIssuer=c.issuer.attributes;e.actualIssuer=d.attributes;throw e;}e=c.md;if(null===e){if(c.signatureOid in r)switch(r[c.signatureOid]){case "sha1WithRSAEncryption":e=a.md.sha1.create();break;case "md5WithRSAEncryption":e=a.md.md5.create();break;case "sha256WithRSAEncryption":e=a.md.sha256.create();break;case "sha512WithRSAEncryption":e=a.md.sha512.create();break;case "RSASSA-PSS":e=a.md.sha256.create()}if(null===e)throw e=Error("Could not compute certificate digest. Unknown signature OID."),
541
-e.signatureOid=c.signatureOid,e;var h=c.tbsCertificate||k.getTBSCertificate(c),h=g.toDer(h);e.update(h.getBytes())}if(null!==e){var m;switch(c.signatureOid){case r.sha1WithRSAEncryption:m=void 0;break;case r["RSASSA-PSS"]:d=r[c.signatureParameters.mgf.hash.algorithmOid];if(void 0===d||void 0===a.md[d])throw e=Error("Unsupported MGF hash function."),e.oid=c.signatureParameters.mgf.hash.algorithmOid,e.name=d,e;m=r[c.signatureParameters.mgf.algorithmOid];if(void 0===m||void 0===a.mgf[m])throw e=Error("Unsupported MGF function."),
542
-e.oid=c.signatureParameters.mgf.algorithmOid,e.name=m,e;m=a.mgf[m].create(a.md[d].create());d=r[c.signatureParameters.hash.algorithmOid];if(void 0===d||void 0===a.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:c.signatureParameters.hash.algorithmOid,name:d};m=a.pss.create(a.md[d].create(),m,c.signatureParameters.saltLength)}d=b.publicKey.verify(e.digest().getBytes(),c.signature,m)}return d};b.isIssuer=function(a){var c=!1,d=b.issuer;a=a.subject;if(d.hash&&a.hash)c=d.hash===a.hash;
543
-else if(d.attributes.length===a.attributes.length)for(var c=!0,e,g,n=0;c&&n<d.attributes.length;++n)if(e=d.attributes[n],g=a.attributes[n],e.type!==g.type||e.value!==g.value)c=!1;return c};b.issued=function(a){return a.isIssuer(b)};b.generateSubjectKeyIdentifier=function(){return k.getPublicKeyFingerprint(b.publicKey,{type:"RSAPublicKey"})};b.verifySubjectKeyIdentifier=function(){for(var c=r.subjectKeyIdentifier,d=0;d<b.extensions.length;++d){var e=b.extensions[d];if(e.id===c)return c=b.generateSubjectKeyIdentifier().getBytes(),
544
-a.util.hexToBytes(e.subjectKeyIdentifier)===c}return!1};return b};k.certificateFromAsn1=function(b,d){var h={},l=[];if(!g.validate(b,B,h,l))throw h=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."),h.errors=l,h;if("string"!==typeof h.certSignature){for(var l="\x00",v=0;v<h.certSignature.length;++v)l+=g.toDer(h.certSignature[v]).getBytes();h.certSignature=l}l=g.derToOid(h.publicKeyOid);if(l!==k.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");
545
-var q=k.createCertificate();q.version=h.certVersion?h.certVersion.charCodeAt(0):0;l=a.util.createBuffer(h.certSerialNumber);q.serialNumber=l.toHex();q.signatureOid=a.asn1.derToOid(h.certSignatureOid);q.signatureParameters=D(q.signatureOid,h.certSignatureParams,!0);q.siginfo.algorithmOid=a.asn1.derToOid(h.certinfoSignatureOid);q.siginfo.parameters=D(q.siginfo.algorithmOid,h.certinfoSignatureParams,!1);l=a.util.createBuffer(h.certSignature);++l.read;q.signature=l.getBytes();l=[];void 0!==h.certValidity1UTCTime&&
538
+b.subject.attributes=a;delete b.subject.uniqueId;c&&(b.subject.uniqueId=c);b.subject.hash=null};b.setIssuer=function(a,c){e(a);b.issuer.attributes=a;delete b.issuer.uniqueId;c&&(b.issuer.uniqueId=c);b.issuer.hash=null};b.setExtensions=function(a){for(var c=0;c<a.length;++c)h(a[c],{cert:b});b.extensions=a};b.getExtension=function(a){"string"===typeof a&&(a={name:a});for(var c=null,d,e=0;null===c&&e<b.extensions.length;++e)d=b.extensions[e],a.id&&d.id===a.id?c=d:a.name&&d.name===a.name&&(c=d);return c};
539
+b.sign=function(c,d){b.md=d||a.md.sha1.create();var e=u[b.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certificate digest. Unknown message digest algorithm OID."),e.algorithm=b.md.algorithm,e;b.signatureOid=b.siginfo.algorithmOid=e;b.tbsCertificate=r.getTBSCertificate(b);e=g.toDer(b.tbsCertificate);b.md.update(e.getBytes());b.signature=c.sign(b.md)};b.verify=function(c){var d=!1;if(!b.issued(c)){var d=b.subject,e=Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");
540
+e.expectedIssuer=c.issuer.attributes;e.actualIssuer=d.attributes;throw e;}e=c.md;if(null===e){if(c.signatureOid in u)switch(u[c.signatureOid]){case "sha1WithRSAEncryption":e=a.md.sha1.create();break;case "md5WithRSAEncryption":e=a.md.md5.create();break;case "sha256WithRSAEncryption":e=a.md.sha256.create();break;case "sha512WithRSAEncryption":e=a.md.sha512.create();break;case "RSASSA-PSS":e=a.md.sha256.create()}if(null===e)throw e=Error("Could not compute certificate digest. Unknown signature OID."),
541
+e.signatureOid=c.signatureOid,e;var k=c.tbsCertificate||r.getTBSCertificate(c),k=g.toDer(k);e.update(k.getBytes())}if(null!==e){var h;switch(c.signatureOid){case u.sha1WithRSAEncryption:h=void 0;break;case u["RSASSA-PSS"]:d=u[c.signatureParameters.mgf.hash.algorithmOid];if(void 0===d||void 0===a.md[d])throw e=Error("Unsupported MGF hash function."),e.oid=c.signatureParameters.mgf.hash.algorithmOid,e.name=d,e;h=u[c.signatureParameters.mgf.algorithmOid];if(void 0===h||void 0===a.mgf[h])throw e=Error("Unsupported MGF function."),
542
+e.oid=c.signatureParameters.mgf.algorithmOid,e.name=h,e;h=a.mgf[h].create(a.md[d].create());d=u[c.signatureParameters.hash.algorithmOid];if(void 0===d||void 0===a.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:c.signatureParameters.hash.algorithmOid,name:d};h=a.pss.create(a.md[d].create(),h,c.signatureParameters.saltLength)}d=b.publicKey.verify(e.digest().getBytes(),c.signature,h)}return d};b.isIssuer=function(a){var c=!1,d=b.issuer;a=a.subject;if(d.hash&&a.hash)c=d.hash===a.hash;
543
+else if(d.attributes.length===a.attributes.length)for(var c=!0,e,g,n=0;c&&n<d.attributes.length;++n)if(e=d.attributes[n],g=a.attributes[n],e.type!==g.type||e.value!==g.value)c=!1;return c};b.issued=function(a){return a.isIssuer(b)};b.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(b.publicKey,{type:"RSAPublicKey"})};b.verifySubjectKeyIdentifier=function(){for(var c=u.subjectKeyIdentifier,d=0;d<b.extensions.length;++d){var e=b.extensions[d];if(e.id===c)return c=b.generateSubjectKeyIdentifier().getBytes(),
544
+a.util.hexToBytes(e.subjectKeyIdentifier)===c}return!1};return b};r.certificateFromAsn1=function(b,d){var h={},l=[];if(!g.validate(b,x,h,l))throw h=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."),h.errors=l,h;if("string"!==typeof h.certSignature){for(var l="\x00",q=0;q<h.certSignature.length;++q)l+=g.toDer(h.certSignature[q]).getBytes();h.certSignature=l}l=g.derToOid(h.publicKeyOid);if(l!==r.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");
545
+var p=r.createCertificate();p.version=h.certVersion?h.certVersion.charCodeAt(0):0;l=a.util.createBuffer(h.certSerialNumber);p.serialNumber=l.toHex();p.signatureOid=a.asn1.derToOid(h.certSignatureOid);p.signatureParameters=E(p.signatureOid,h.certSignatureParams,!0);p.siginfo.algorithmOid=a.asn1.derToOid(h.certinfoSignatureOid);p.siginfo.parameters=E(p.siginfo.algorithmOid,h.certinfoSignatureParams,!1);l=a.util.createBuffer(h.certSignature);++l.read;p.signature=l.getBytes();l=[];void 0!==h.certValidity1UTCTime&&
546
l.push(g.utcTimeToDate(h.certValidity1UTCTime));void 0!==h.certValidity2GeneralizedTime&&l.push(g.generalizedTimeToDate(h.certValidity2GeneralizedTime));void 0!==h.certValidity3UTCTime&&l.push(g.utcTimeToDate(h.certValidity3UTCTime));void 0!==h.certValidity4GeneralizedTime&&l.push(g.generalizedTimeToDate(h.certValidity4GeneralizedTime));if(2<l.length)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(2>l.length)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");
547
-q.validity.notBefore=l[0];q.validity.notAfter=l[1];q.tbsCertificate=h.tbsCertificate;if(d){q.md=null;if(q.signatureOid in r)switch(l=r[q.signatureOid],l){case "sha1WithRSAEncryption":q.md=a.md.sha1.create();break;case "md5WithRSAEncryption":q.md=a.md.md5.create();break;case "sha256WithRSAEncryption":q.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=a.md.sha512.create();break;case "RSASSA-PSS":q.md=a.md.sha256.create()}if(null===q.md)throw h=Error("Could not compute certificate digest. Unknown signature OID."),
548
-h.signatureOid=q.signatureOid,h;l=g.toDer(q.tbsCertificate);q.md.update(l.getBytes())}l=a.md.sha1.create();q.issuer.getField=function(a){return c(q.issuer,a)};q.issuer.addField=function(a){e([a]);q.issuer.attributes.push(a)};q.issuer.attributes=k.RDNAttributesAsArray(h.certIssuer,l);h.certIssuerUniqueId&&(q.issuer.uniqueId=h.certIssuerUniqueId);q.issuer.hash=l.digest().toHex();l=a.md.sha1.create();q.subject.getField=function(a){return c(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};
549
-q.subject.attributes=k.RDNAttributesAsArray(h.certSubject,l);h.certSubjectUniqueId&&(q.subject.uniqueId=h.certSubjectUniqueId);q.subject.hash=l.digest().toHex();q.extensions=h.certExtensions?k.certificateExtensionsFromAsn1(h.certExtensions):[];q.publicKey=k.publicKeyFromAsn1(h.subjectPublicKeyInfo);return q};k.certificateExtensionsFromAsn1=function(a){for(var b=[],c=0;c<a.value.length;++c)for(var d=a.value[c],e=0;e<d.value.length;++e)b.push(k.certificateExtensionFromAsn1(d.value[e]));return b};k.certificateExtensionFromAsn1=
550
-function(b){var c={};c.id=g.derToOid(b.value[0].value);c.critical=!1;b.value[1].type===g.Type.BOOLEAN?(c.critical=0!==b.value[1].value.charCodeAt(0),c.value=b.value[2].value):c.value=b.value[1].value;if(c.id in r)if(c.name=r[c.id],"keyUsage"===c.name){b=g.fromDer(c.value);var d=0,e=0;1<b.value.length&&(d=b.value.charCodeAt(1),e=2<b.value.length?b.value.charCodeAt(2):0);c.digitalSignature=128===(d&128);c.nonRepudiation=64===(d&64);c.keyEncipherment=32===(d&32);c.dataEncipherment=16===(d&16);c.keyAgreement=
547
+p.validity.notBefore=l[0];p.validity.notAfter=l[1];p.tbsCertificate=h.tbsCertificate;if(d){p.md=null;if(p.signatureOid in u)switch(l=u[p.signatureOid],l){case "sha1WithRSAEncryption":p.md=a.md.sha1.create();break;case "md5WithRSAEncryption":p.md=a.md.md5.create();break;case "sha256WithRSAEncryption":p.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":p.md=a.md.sha512.create();break;case "RSASSA-PSS":p.md=a.md.sha256.create()}if(null===p.md)throw h=Error("Could not compute certificate digest. Unknown signature OID."),
548
+h.signatureOid=p.signatureOid,h;l=g.toDer(p.tbsCertificate);p.md.update(l.getBytes())}l=a.md.sha1.create();p.issuer.getField=function(a){return c(p.issuer,a)};p.issuer.addField=function(a){e([a]);p.issuer.attributes.push(a)};p.issuer.attributes=r.RDNAttributesAsArray(h.certIssuer,l);h.certIssuerUniqueId&&(p.issuer.uniqueId=h.certIssuerUniqueId);p.issuer.hash=l.digest().toHex();l=a.md.sha1.create();p.subject.getField=function(a){return c(p.subject,a)};p.subject.addField=function(a){e([a]);p.subject.attributes.push(a)};
549
+p.subject.attributes=r.RDNAttributesAsArray(h.certSubject,l);h.certSubjectUniqueId&&(p.subject.uniqueId=h.certSubjectUniqueId);p.subject.hash=l.digest().toHex();p.extensions=h.certExtensions?r.certificateExtensionsFromAsn1(h.certExtensions):[];p.publicKey=r.publicKeyFromAsn1(h.subjectPublicKeyInfo);return p};r.certificateExtensionsFromAsn1=function(a){for(var b=[],c=0;c<a.value.length;++c)for(var d=a.value[c],e=0;e<d.value.length;++e)b.push(r.certificateExtensionFromAsn1(d.value[e]));return b};r.certificateExtensionFromAsn1=
550
+function(b){var c={};c.id=g.derToOid(b.value[0].value);c.critical=!1;b.value[1].type===g.Type.BOOLEAN?(c.critical=0!==b.value[1].value.charCodeAt(0),c.value=b.value[2].value):c.value=b.value[1].value;if(c.id in u)if(c.name=u[c.id],"keyUsage"===c.name){b=g.fromDer(c.value);var d=0,e=0;1<b.value.length&&(d=b.value.charCodeAt(1),e=2<b.value.length?b.value.charCodeAt(2):0);c.digitalSignature=128===(d&128);c.nonRepudiation=64===(d&64);c.keyEncipherment=32===(d&32);c.dataEncipherment=16===(d&16);c.keyAgreement=
551
8===(d&8);c.keyCertSign=4===(d&4);c.cRLSign=2===(d&2);c.encipherOnly=1===(d&1);c.decipherOnly=128===(e&128)}else if("basicConstraints"===c.name)b=g.fromDer(c.value),c.cA=0<b.value.length&&b.value[0].type===g.Type.BOOLEAN?0!==b.value[0].value.charCodeAt(0):!1,d=null,0<b.value.length&&b.value[0].type===g.Type.INTEGER?d=b.value[0].value:1<b.value.length&&(d=b.value[1].value),null!==d&&(c.pathLenConstraint=g.derToInteger(d));else if("extKeyUsage"===c.name)for(b=g.fromDer(c.value),d=0;d<b.value.length;++d)e=
552
-g.derToOid(b.value[d].value),e in r?c[r[e]]=!0:c[e]=!0;else if("nsCertType"===c.name)b=g.fromDer(c.value),d=0,1<b.value.length&&(d=b.value.charCodeAt(1)),c.client=128===(d&128),c.server=64===(d&64),c.email=32===(d&32),c.objsign=16===(d&16),c.reserved=8===(d&8),c.sslCA=4===(d&4),c.emailCA=2===(d&2),c.objCA=1===(d&1);else if("subjectAltName"===c.name||"issuerAltName"===c.name)for(c.altNames=[],b=g.fromDer(c.value),e=0;e<b.value.length;++e){var d=b.value[e],h={type:d.type,value:d.value};c.altNames.push(h);
553
-switch(d.type){case 7:h.ip=a.util.bytesToIP(d.value);break;case 8:h.oid=g.derToOid(d.value)}}else"subjectKeyIdentifier"===c.name&&(b=g.fromDer(c.value),c.subjectKeyIdentifier=a.util.bytesToHex(b.value));return c};k.certificationRequestFromAsn1=function(b,d){var h={},l=[];if(!g.validate(b,F,h,l))throw h=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."),h.errors=l,h;if("string"!==typeof h.csrSignature){for(var l="\x00",v=0;v<h.csrSignature.length;++v)l+=
554
-g.toDer(h.csrSignature[v]).getBytes();h.csrSignature=l}l=g.derToOid(h.publicKeyOid);if(l!==k.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var q=k.createCertificationRequest();q.version=h.csrVersion?h.csrVersion.charCodeAt(0):0;q.signatureOid=a.asn1.derToOid(h.csrSignatureOid);q.signatureParameters=D(q.signatureOid,h.csrSignatureParams,!0);q.siginfo.algorithmOid=a.asn1.derToOid(h.csrSignatureOid);q.siginfo.parameters=D(q.siginfo.algorithmOid,h.csrSignatureParams,!1);l=
555
-a.util.createBuffer(h.csrSignature);++l.read;q.signature=l.getBytes();q.certificationRequestInfo=h.certificationRequestInfo;if(d){q.md=null;if(q.signatureOid in r)switch(l=r[q.signatureOid],l){case "sha1WithRSAEncryption":q.md=a.md.sha1.create();break;case "md5WithRSAEncryption":q.md=a.md.md5.create();break;case "sha256WithRSAEncryption":q.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=a.md.sha512.create();break;case "RSASSA-PSS":q.md=a.md.sha256.create()}if(null===q.md)throw h=
556
-Error("Could not compute certification request digest. Unknown signature OID."),h.signatureOid=q.signatureOid,h;l=g.toDer(q.certificationRequestInfo);q.md.update(l.getBytes())}l=a.md.sha1.create();q.subject.getField=function(a){return c(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};q.subject.attributes=k.RDNAttributesAsArray(h.certificationRequestInfoSubject,l);q.subject.hash=l.digest().toHex();q.publicKey=k.publicKeyFromAsn1(h.subjectPublicKeyInfo);q.getAttribute=
557
-function(a){return c(q,a)};q.addAttribute=function(a){e([a]);q.attributes.push(a)};q.attributes=k.CRIAttributesAsArray(h.certificationRequestInfoAttributes||[]);return q};k.createCertificationRequest=function(){var b={version:0,signatureOid:null,signature:null,siginfo:{}};b.siginfo.algorithmOid=null;b.subject={};b.subject.getField=function(a){return c(b.subject,a)};b.subject.addField=function(a){e([a]);b.subject.attributes.push(a)};b.subject.attributes=[];b.subject.hash=null;b.publicKey=null;b.attributes=
558
-[];b.getAttribute=function(a){return c(b,a)};b.addAttribute=function(a){e([a]);b.attributes.push(a)};b.md=null;b.setSubject=function(a){e(a);b.subject.attributes=a;b.subject.hash=null};b.setAttributes=function(a){e(a);b.attributes=a};b.sign=function(c,d){b.md=d||a.md.sha1.create();var e=r[b.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certification request digest. Unknown message digest algorithm OID."),e.algorithm=b.md.algorithm,e;b.signatureOid=b.siginfo.algorithmOid=
559
-e;b.certificationRequestInfo=k.getCertificationRequestInfo(b);e=g.toDer(b.certificationRequestInfo);b.md.update(e.getBytes());b.signature=c.sign(b.md)};b.verify=function(){var c=!1,d=b.md;if(null===d){if(b.signatureOid in r)switch(r[b.signatureOid]){case "sha1WithRSAEncryption":d=a.md.sha1.create();break;case "md5WithRSAEncryption":d=a.md.md5.create();break;case "sha256WithRSAEncryption":d=a.md.sha256.create();break;case "sha512WithRSAEncryption":d=a.md.sha512.create();break;case "RSASSA-PSS":d=a.md.sha256.create()}if(null===
560
-d)throw d=Error("Could not compute certification request digest. Unknown signature OID."),d.signatureOid=b.signatureOid,d;var e=b.certificationRequestInfo||k.getCertificationRequestInfo(b),e=g.toDer(e);d.update(e.getBytes())}if(null!==d){var h;switch(b.signatureOid){case r["RSASSA-PSS"]:c=r[b.signatureParameters.mgf.hash.algorithmOid];if(void 0===c||void 0===a.md[c])throw d=Error("Unsupported MGF hash function."),d.oid=b.signatureParameters.mgf.hash.algorithmOid,d.name=c,d;h=r[b.signatureParameters.mgf.algorithmOid];
561
-if(void 0===h||void 0===a.mgf[h])throw d=Error("Unsupported MGF function."),d.oid=b.signatureParameters.mgf.algorithmOid,d.name=h,d;h=a.mgf[h].create(a.md[c].create());c=r[b.signatureParameters.hash.algorithmOid];if(void 0===c||void 0===a.md[c])throw d=Error("Unsupported RSASSA-PSS hash function."),d.oid=b.signatureParameters.hash.algorithmOid,d.name=c,d;h=a.pss.create(a.md[c].create(),h,b.signatureParameters.saltLength)}c=b.publicKey.verify(d.digest().getBytes(),b.signature,h)}return c};return b};
562
-k.getTBSCertificate=function(b){var c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(b.version).getBytes())]),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber)),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(b.siginfo.algorithmOid).getBytes()),h(b.siginfo.algorithmOid,b.siginfo.parameters)]),d(b.issuer),g.create(g.Class.UNIVERSAL,
563
-g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(b.validity.notBefore)),g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(b.validity.notAfter))]),d(b.subject),k.publicKeyToAsn1(b.publicKey)]);b.issuer.uniqueId&&c.value.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+b.issuer.uniqueId)]));b.subject.uniqueId&&c.value.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
564
-!1,String.fromCharCode(0)+b.subject.uniqueId)]));0<b.extensions.length&&c.value.push(k.certificateExtensionsToAsn1(b.extensions));return c};k.getCertificationRequestInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(a.version).getBytes()),d(a.subject),k.publicKeyToAsn1(a.publicKey),v(a)])};k.distinguishedNameToAsn1=function(a){return d(a)};k.certificateToAsn1=function(a){var b=a.tbsCertificate||k.getTBSCertificate(a);
565
-return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[b,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),h(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};k.certificateExtensionsToAsn1=function(a){var b=g.create(g.Class.CONTEXT_SPECIFIC,3,!0,[]),c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);b.value.push(c);for(var d=0;d<a.length;++d)c.value.push(k.certificateExtensionToAsn1(a[d]));
566
-return b};k.certificateExtensionToAsn1=function(a){var b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);b.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.id).getBytes()));a.critical&&b.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255)));var c=a.value;"string"!==typeof a.value&&(c=g.toDer(c).getBytes());b.value.push(g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,c));return b};k.certificationRequestToAsn1=function(a){var b=a.certificationRequestInfo||
567
-k.getCertificationRequestInfo(a);return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[b,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),h(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};k.createCaStore=function(b){function c(b){if(!b.hash){var g=a.md.sha1.create();b.attributes=k.RDNAttributesAsArray(d(b),g);b.hash=g.digest().toHex()}return e.certs[b.hash]||
568
-null}var e={certs:{},getIssuer:function(a){return c(a.issuer)},addCertificate:function(b){"string"===typeof b&&(b=a.pki.certificateFromPem(b));if(!b.subject.hash){var c=a.md.sha1.create();b.subject.attributes=k.RDNAttributesAsArray(d(b.subject),c);b.subject.hash=c.digest().toHex()}b.subject.hash in e.certs?(c=e.certs[b.subject.hash],a.util.isArray(c)||(c=[c]),c.push(b)):e.certs[b.subject.hash]=b},hasCertificate:function(b){var d=c(b.subject);if(!d)return!1;a.util.isArray(d)||(d=[d]);b=g.toDer(k.certificateToAsn1(b)).getBytes();
569
-for(var e=0;e<d.length;++e){var h=g.toDer(k.certificateToAsn1(d[e])).getBytes();if(b===h)return!0}return!1}};if(b)for(var h=0;h<b.length;++h)e.addCertificate(b[h]);return e};k.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};
570
-k.verifyCertificateChain=function(b,c,d){c=c.slice(0);var e=c.slice(0),g=new Date,h=!0,m=null,l=0;do{var p=c.shift(),r=null,v=!1;if(g<p.validity.notBefore||g>p.validity.notAfter)m={message:"Certificate is not valid yet or has expired.",error:k.certificateError.certificate_expired,notBefore:p.validity.notBefore,notAfter:p.validity.notAfter,now:g};if(null===m){r=c[0]||b.getIssuer(p);null===r&&p.isIssuer(p)&&(v=!0,r=p);if(r){var D=r;a.util.isArray(D)||(D=[D]);for(var u=!1;!u&&0<D.length;){r=D.shift();
571
-try{u=r.verify(p)}catch(z){}}u||(m={message:"Certificate signature is invalid.",error:k.certificateError.bad_certificate})}null!==m||r&&!v||b.hasCertificate(p)||(m={message:"Certificate is not trusted.",error:k.certificateError.unknown_ca})}null===m&&r&&!p.isIssuer(r)&&(m={message:"Certificate issuer is invalid.",error:k.certificateError.bad_certificate});if(null===m)for(D={keyUsage:!0,basicConstraints:!0},u=0;null===m&&u<p.extensions.length;++u){var x=p.extensions[u];!x.critical||x.name in D||(m=
572
-{message:"Certificate has an unsupported critical extension.",error:k.certificateError.unsupported_certificate})}null!==m||h&&(0!==c.length||r&&!v)||(h=p.getExtension("basicConstraints"),p=p.getExtension("keyUsage"),null!==p&&(p.keyCertSign&&null!==h||(m={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:k.certificateError.bad_certificate})),
573
-null!==m||null===h||h.cA||(m={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:k.certificateError.bad_certificate}),null===m&&null!==p&&"pathLenConstraint"in h&&l-1>h.pathLenConstraint&&(m={message:"Certificate basicConstraints pathLenConstraint violated.",error:k.certificateError.bad_certificate}));p=null===m?!0:m.error;h=d?d(p,l,e):p;if(!0===h)m=null;else{!0===p&&(m={message:"The application rejected the certificate.",error:k.certificateError.bad_certificate});
574
-if(h||0===h)"object"!==typeof h||a.util.isArray(h)?"string"===typeof h&&(m.error=h):(h.message&&(m.message=h.message),h.error&&(m.error=h.error));throw m;}h=!1;++l}while(0<c.length);return!0}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.x509)return c.x509;
575
-c.defined.x509=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pki}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/x509","require module ./aes ./asn1 ./des ./md ./mgf ./oids ./pem ./pss ./rsa ./util".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d,e){for(var g=
576
-[],h=0;h<a.length;h++)for(var n=0;n<a[h].safeBags.length;n++){var m=a[h].safeBags[n];if(void 0===e||m.type===e)null===b?g.push(m):void 0!==m.attributes[b]&&0<=m.attributes[b].indexOf(d)&&g.push(m)}return g}function d(b){if(b.composed||b.constructed){for(var c=a.util.createBuffer(),e=0;e<b.value.length;++e)c.putBytes(b.value[e].value);b.composed=b.constructed=!1;b.value=c.getBytes()}return b}function e(b,c,h,m){c=v.fromDer(c,h);if(c.tagClass!==v.Class.UNIVERSAL||c.type!==v.Type.SEQUENCE||!0!==c.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");
577
-for(var p=0;p<c.value.length;p++){var k={},u=[];if(!v.validate(c.value[p],r,k,u))throw b=Error("Cannot read ContentInfo."),b.errors=u,b;var u={encrypted:!1},q=null,q=k.content.value[0];switch(v.derToOid(k.contentType)){case g.oids.data:if(q.tagClass!==v.Class.UNIVERSAL||q.type!==v.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");q=d(q).value;break;case g.oids.encryptedData:var z=m,k={},B=[];if(!v.validate(q,a.pkcs7.asn1.encryptedDataValidator,k,B))throw b=Error("Cannot read EncryptedContentInfo."),
578
-b.errors=B,b;q=v.derToOid(k.contentType);if(q!==g.oids.data)throw b=Error("PKCS#12 EncryptedContentInfo ContentType is not Data."),b.oid=q,b;q=v.derToOid(k.encAlgorithm);q=g.pbe.getCipher(q,k.encParameter,z);k=d(k.encryptedContentAsn1);k=a.util.createBuffer(k.value);q.update(k);if(!q.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");q=q.output.getBytes();u.encrypted=!0;break;default:throw b=Error("Unsupported PKCS#12 contentType."),b.contentType=v.derToOid(k.contentType),b;}u.safeBags=
579
-l(q,h,m);b.safeContents.push(u)}}function l(a,b,c){if(!b&&0===a.length)return[];a=v.fromDer(a,b);if(a.tagClass!==v.Class.UNIVERSAL||a.type!==v.Type.SEQUENCE||!0!==a.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var d=[],e=0;e<a.value.length;e++){var n={},m=[];if(!v.validate(a.value[e],z,n,m))throw a=Error("Cannot read SafeBag."),a.errors=m,a;var p={type:v.derToOid(n.bagId),attributes:h(n.bagAttributes)};d.push(p);var r,k,u=n.bagValue.value[0];switch(p.type){case g.oids.pkcs8ShroudedKeyBag:if(u=
580
-g.decryptPrivateKeyInfo(u,c),null===u)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case g.oids.keyBag:try{p.key=g.privateKeyFromAsn1(u)}catch(x){p.key=null,p.asn1=u}continue;case g.oids.certBag:r=I;k=function(){if(v.derToOid(n.certId)!==g.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");a.oid=v.derToOid(n.certId);throw a;}a=v.fromDer(n.cert,b);try{p.cert=g.certificateFromAsn1(a,!0)}catch(c){p.cert=null,p.asn1=a}};break;default:throw a=
581
-Error("Unsupported PKCS#12 SafeBag type."),a.oid=p.type,a;}if(void 0!==r&&!v.validate(u,r,n,m))throw a=Error("Cannot read PKCS#12 "+r.name),a.errors=m,a;k()}return d}function h(a){var b={};if(void 0!==a)for(var c=0;c<a.length;++c){var d={},e=[];if(!v.validate(a[c],B,d,e))throw a=Error("Cannot read PKCS#12 BagAttribute."),a.errors=e,a;e=v.derToOid(d.oid);if(void 0!==g.oids[e]){b[g.oids[e]]=[];for(var h=0;h<d.values.length;++h)b[g.oids[e]].push(d.values[h].value)}}return b}var v=a.asn1,g=a.pki,k=a.pkcs12=
582
-a.pkcs12||{},r={name:"ContentInfo",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:v.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,capture:"version"},
583
-r,{name:"PFX.macData",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",
584
-tagClass:v.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:v.Class.UNIVERSAL,type:v.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:v.Class.UNIVERSAL,type:v.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},z={name:"SafeBag",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,
585
-value:[{name:"SafeBag.bagId",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:v.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:v.Class.UNIVERSAL,type:v.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},B={name:"Attribute",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,
586
-capture:"oid"},{name:"Attribute.attrValues",tagClass:v.Class.UNIVERSAL,type:v.Type.SET,constructed:!0,capture:"values"}]},I={name:"CertBag",tagClass:v.Class.UNIVERSAL,type:v.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:v.Class.UNIVERSAL,type:v.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:v.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:v.Class.UNIVERSAL,type:v.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};
587
-k.pkcs12FromAsn1=function(b,h,l){"string"===typeof h?(l=h,h=!0):void 0===h&&(h=!0);var r={};if(!v.validate(b,u,r,[]))throw h=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),h.errors=h,h;var z={version:r.version.charCodeAt(0),safeContents:[],getBags:function(b){var d={},e;"localKeyId"in b?e=b.localKeyId:"localKeyIdHex"in b&&(e=a.util.hexToBytes(b.localKeyIdHex));void 0===e&&!("friendlyName"in b)&&"bagType"in b&&(d[b.bagType]=c(z.safeContents,null,null,b.bagType));void 0!==e&&
588
-(d.localKeyId=c(z.safeContents,"localKeyId",e,b.bagType));"friendlyName"in b&&(d.friendlyName=c(z.safeContents,"friendlyName",b.friendlyName,b.bagType));return d},getBagsByFriendlyName:function(a,b){return c(z.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return c(z.safeContents,"localKeyId",a,b)}};if(3!==r.version.charCodeAt(0))throw h=Error("PKCS#12 PFX of version other than 3 not supported."),h.version=r.version.charCodeAt(0),h;if(v.derToOid(r.contentType)!==g.oids.data)throw h=
589
-Error("Only PKCS#12 PFX in password integrity mode supported."),h.oid=v.derToOid(r.contentType),h;b=r.content.value[0];if(b.tagClass!==v.Class.UNIVERSAL||b.type!==v.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");b=d(b);if(r.mac){var w=null,B=0,q=v.derToOid(r.macAlgorithm);switch(q){case g.oids.sha1:w=a.md.sha1.create();B=20;break;case g.oids.sha256:w=a.md.sha256.create();B=32;break;case g.oids.sha384:w=a.md.sha384.create();B=48;break;case g.oids.sha512:w=a.md.sha512.create();
590
-B=64;break;case g.oids.md5:w=a.md.md5.create(),B=16}if(null===w)throw Error("PKCS#12 uses unsupported MAC algorithm: "+q);var q=new a.util.ByteBuffer(r.macSalt),I="macIterations"in r?parseInt(a.util.bytesToHex(r.macIterations),16):1,B=k.generateKey(l,q,3,I,B,w),q=a.hmac.create();q.start(w,B);q.update(b.value);if(q.getMac().getBytes()!==r.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(z,b.value,h,l);return z};k.toPkcs12Asn1=function(b,c,d,e){e=e||{};e.saltSize=e.saltSize||
591
-8;e.count=e.count||2048;e.algorithm=e.algorithm||e.encAlgorithm||"aes128";"useMac"in e||(e.useMac=!0);"localKeyId"in e||(e.localKeyId=null);"generateLocalKeyId"in e||(e.generateLocalKeyId=!0);var h=e.localKeyId,m;if(null!==h)h=a.util.hexToBytes(h);else if(e.generateLocalKeyId)if(c){var l=a.util.isArray(c)?c[0]:c;"string"===typeof l&&(l=g.certificateFromPem(l));h=a.md.sha1.create();h.update(v.toDer(g.certificateToAsn1(l)).getBytes());h=h.digest().getBytes()}else h=a.random.getBytes(20);l=[];null!==
592
-h&&l.push(v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.localKeyId).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SET,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,h)])]));"friendlyName"in e&&l.push(v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.friendlyName).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SET,!0,[v.create(v.Class.UNIVERSAL,v.Type.BMPSTRING,!1,e.friendlyName)])]));
593
-0<l.length&&(m=v.create(v.Class.UNIVERSAL,v.Type.SET,!0,l));h=[];l=[];null!==c&&(l=a.util.isArray(c)?c:[c]);for(var p=[],r=0;r<l.length;++r){c=l[r];"string"===typeof c&&(c=g.certificateFromPem(c));var u=0===r?m:void 0;c=g.certificateToAsn1(c);c=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.certBag).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.x509Certificate).getBytes()),
594
-v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(c).getBytes())])])]),u]);p.push(c)}0<p.length&&(c=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,p),c=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.data).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(c).getBytes())])]),h.push(c));c=null;null!==b&&(b=g.wrapRsaPrivateKey(g.privateKeyToAsn1(b)),
595
-c=null===d?v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.keyBag).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[b]),m]):v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.pkcs8ShroudedKeyBag).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[g.encryptPrivateKeyInfo(b,d,e)]),m]),b=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[c]),b=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,
596
-[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.data).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(b).getBytes())])]),h.push(b));m=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,h);var z;e.useMac&&(h=a.md.sha1.create(),z=new a.util.ByteBuffer(a.random.getBytes(e.saltSize)),e=e.count,b=k.generateKey(d,z,3,e,20),d=a.hmac.create(),d.start(h,b),d.update(v.toDer(m).getBytes()),d=d.getMac(),z=v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,
597
-!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.sha1).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.NULL,!1,"")]),v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,d.getBytes())]),v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,z.getBytes()),v.create(v.Class.UNIVERSAL,v.Type.INTEGER,!1,v.integerToDer(e).getBytes())]));return v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,
598
-v.Type.INTEGER,!1,v.integerToDer(3).getBytes()),v.create(v.Class.UNIVERSAL,v.Type.SEQUENCE,!0,[v.create(v.Class.UNIVERSAL,v.Type.OID,!1,v.oidToDer(g.oids.data).getBytes()),v.create(v.Class.CONTEXT_SPECIFIC,0,!0,[v.create(v.Class.UNIVERSAL,v.Type.OCTETSTRING,!1,v.toDer(m).getBytes())])]),z])};k.generateKey=a.pbe.generatePkcs12Key}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,
599
-l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs12)return c.pkcs12;c.defined.pkcs12=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pkcs12}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs12","require module ./asn1 ./hmac ./oids ./pkcs7asn1 ./pbe ./random ./rsa ./sha1 ./util ./x509".split(" "),
600
-function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1,d=a.pki=a.pki||{};d.pemToDer=function(b){b=a.pem.decode(b)[0];if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return a.util.createBuffer(b.body)};d.privateKeyFromPem=function(b){b=a.pem.decode(b)[0];if("PRIVATE KEY"!==b.type&&"RSA PRIVATE KEY"!==b.type){var e=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');
552
+g.derToOid(b.value[d].value),e in u?c[u[e]]=!0:c[e]=!0;else if("nsCertType"===c.name)b=g.fromDer(c.value),d=0,1<b.value.length&&(d=b.value.charCodeAt(1)),c.client=128===(d&128),c.server=64===(d&64),c.email=32===(d&32),c.objsign=16===(d&16),c.reserved=8===(d&8),c.sslCA=4===(d&4),c.emailCA=2===(d&2),c.objCA=1===(d&1);else if("subjectAltName"===c.name||"issuerAltName"===c.name)for(c.altNames=[],b=g.fromDer(c.value),e=0;e<b.value.length;++e){var d=b.value[e],k={type:d.type,value:d.value};c.altNames.push(k);
553
+switch(d.type){case 7:k.ip=a.util.bytesToIP(d.value);break;case 8:k.oid=g.derToOid(d.value)}}else"subjectKeyIdentifier"===c.name&&(b=g.fromDer(c.value),c.subjectKeyIdentifier=a.util.bytesToHex(b.value));return c};r.certificationRequestFromAsn1=function(b,d){var h={},l=[];if(!g.validate(b,G,h,l))throw h=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."),h.errors=l,h;if("string"!==typeof h.csrSignature){for(var l="\x00",q=0;q<h.csrSignature.length;++q)l+=
554
+g.toDer(h.csrSignature[q]).getBytes();h.csrSignature=l}l=g.derToOid(h.publicKeyOid);if(l!==r.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var p=r.createCertificationRequest();p.version=h.csrVersion?h.csrVersion.charCodeAt(0):0;p.signatureOid=a.asn1.derToOid(h.csrSignatureOid);p.signatureParameters=E(p.signatureOid,h.csrSignatureParams,!0);p.siginfo.algorithmOid=a.asn1.derToOid(h.csrSignatureOid);p.siginfo.parameters=E(p.siginfo.algorithmOid,h.csrSignatureParams,!1);l=
555
+a.util.createBuffer(h.csrSignature);++l.read;p.signature=l.getBytes();p.certificationRequestInfo=h.certificationRequestInfo;if(d){p.md=null;if(p.signatureOid in u)switch(l=u[p.signatureOid],l){case "sha1WithRSAEncryption":p.md=a.md.sha1.create();break;case "md5WithRSAEncryption":p.md=a.md.md5.create();break;case "sha256WithRSAEncryption":p.md=a.md.sha256.create();break;case "sha512WithRSAEncryption":p.md=a.md.sha512.create();break;case "RSASSA-PSS":p.md=a.md.sha256.create()}if(null===p.md)throw h=
556
+Error("Could not compute certification request digest. Unknown signature OID."),h.signatureOid=p.signatureOid,h;l=g.toDer(p.certificationRequestInfo);p.md.update(l.getBytes())}l=a.md.sha1.create();p.subject.getField=function(a){return c(p.subject,a)};p.subject.addField=function(a){e([a]);p.subject.attributes.push(a)};p.subject.attributes=r.RDNAttributesAsArray(h.certificationRequestInfoSubject,l);p.subject.hash=l.digest().toHex();p.publicKey=r.publicKeyFromAsn1(h.subjectPublicKeyInfo);p.getAttribute=
557
+function(a){return c(p,a)};p.addAttribute=function(a){e([a]);p.attributes.push(a)};p.attributes=r.CRIAttributesAsArray(h.certificationRequestInfoAttributes||[]);return p};r.createCertificationRequest=function(){var b={version:0,signatureOid:null,signature:null,siginfo:{}};b.siginfo.algorithmOid=null;b.subject={};b.subject.getField=function(a){return c(b.subject,a)};b.subject.addField=function(a){e([a]);b.subject.attributes.push(a)};b.subject.attributes=[];b.subject.hash=null;b.publicKey=null;b.attributes=
558
+[];b.getAttribute=function(a){return c(b,a)};b.addAttribute=function(a){e([a]);b.attributes.push(a)};b.md=null;b.setSubject=function(a){e(a);b.subject.attributes=a;b.subject.hash=null};b.setAttributes=function(a){e(a);b.attributes=a};b.sign=function(c,d){b.md=d||a.md.sha1.create();var e=u[b.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certification request digest. Unknown message digest algorithm OID."),e.algorithm=b.md.algorithm,e;b.signatureOid=b.siginfo.algorithmOid=
559
+e;b.certificationRequestInfo=r.getCertificationRequestInfo(b);e=g.toDer(b.certificationRequestInfo);b.md.update(e.getBytes());b.signature=c.sign(b.md)};b.verify=function(){var c=!1,d=b.md;if(null===d){if(b.signatureOid in u)switch(u[b.signatureOid]){case "sha1WithRSAEncryption":d=a.md.sha1.create();break;case "md5WithRSAEncryption":d=a.md.md5.create();break;case "sha256WithRSAEncryption":d=a.md.sha256.create();break;case "sha512WithRSAEncryption":d=a.md.sha512.create();break;case "RSASSA-PSS":d=a.md.sha256.create()}if(null===
560
+d)throw d=Error("Could not compute certification request digest. Unknown signature OID."),d.signatureOid=b.signatureOid,d;var e=b.certificationRequestInfo||r.getCertificationRequestInfo(b),e=g.toDer(e);d.update(e.getBytes())}if(null!==d){var h;switch(b.signatureOid){case u["RSASSA-PSS"]:c=u[b.signatureParameters.mgf.hash.algorithmOid];if(void 0===c||void 0===a.md[c])throw d=Error("Unsupported MGF hash function."),d.oid=b.signatureParameters.mgf.hash.algorithmOid,d.name=c,d;h=u[b.signatureParameters.mgf.algorithmOid];
561
+if(void 0===h||void 0===a.mgf[h])throw d=Error("Unsupported MGF function."),d.oid=b.signatureParameters.mgf.algorithmOid,d.name=h,d;h=a.mgf[h].create(a.md[c].create());c=u[b.signatureParameters.hash.algorithmOid];if(void 0===c||void 0===a.md[c])throw d=Error("Unsupported RSASSA-PSS hash function."),d.oid=b.signatureParameters.hash.algorithmOid,d.name=c,d;h=a.pss.create(a.md[c].create(),h,b.signatureParameters.saltLength)}c=b.publicKey.verify(d.digest().getBytes(),b.signature,h)}return c};return b};
562
+r.getTBSCertificate=function(b){var c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(b.version).getBytes())]),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber)),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(b.siginfo.algorithmOid).getBytes()),q(b.siginfo.algorithmOid,b.siginfo.parameters)]),d(b.issuer),g.create(g.Class.UNIVERSAL,
563
+g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(b.validity.notBefore)),g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(b.validity.notAfter))]),d(b.subject),r.publicKeyToAsn1(b.publicKey)]);b.issuer.uniqueId&&c.value.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+b.issuer.uniqueId)]));b.subject.uniqueId&&c.value.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
564
+!1,String.fromCharCode(0)+b.subject.uniqueId)]));0<b.extensions.length&&c.value.push(r.certificateExtensionsToAsn1(b.extensions));return c};r.getCertificationRequestInfo=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(a.version).getBytes()),d(a.subject),r.publicKeyToAsn1(a.publicKey),l(a)])};r.distinguishedNameToAsn1=function(a){return d(a)};r.certificateToAsn1=function(a){var b=a.tbsCertificate||r.getTBSCertificate(a);
565
+return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[b,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),q(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};r.certificateExtensionsToAsn1=function(a){var b=g.create(g.Class.CONTEXT_SPECIFIC,3,!0,[]),c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);b.value.push(c);for(var d=0;d<a.length;++d)c.value.push(r.certificateExtensionToAsn1(a[d]));
566
+return b};r.certificateExtensionToAsn1=function(a){var b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);b.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.id).getBytes()));a.critical&&b.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255)));var c=a.value;"string"!==typeof a.value&&(c=g.toDer(c).getBytes());b.value.push(g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,c));return b};r.certificationRequestToAsn1=function(a){var b=a.certificationRequestInfo||
567
+r.getCertificationRequestInfo(a);return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[b,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),q(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};r.createCaStore=function(b){function c(b){if(!b.hash){var g=a.md.sha1.create();b.attributes=r.RDNAttributesAsArray(d(b),g);b.hash=g.digest().toHex()}return e.certs[b.hash]||
568
+null}var e={certs:{},getIssuer:function(a){return c(a.issuer)},addCertificate:function(b){"string"===typeof b&&(b=a.pki.certificateFromPem(b));if(!b.subject.hash){var c=a.md.sha1.create();b.subject.attributes=r.RDNAttributesAsArray(d(b.subject),c);b.subject.hash=c.digest().toHex()}b.subject.hash in e.certs?(c=e.certs[b.subject.hash],a.util.isArray(c)||(c=[c]),c.push(b)):e.certs[b.subject.hash]=b},hasCertificate:function(b){var d=c(b.subject);if(!d)return!1;a.util.isArray(d)||(d=[d]);b=g.toDer(r.certificateToAsn1(b)).getBytes();
569
+for(var e=0;e<d.length;++e){var h=g.toDer(r.certificateToAsn1(d[e])).getBytes();if(b===h)return!0}return!1}};if(b)for(var h=0;h<b.length;++h)e.addCertificate(b[h]);return e};r.certificateError={bad_certificate:"forge.pki.BadCertificate",unsupported_certificate:"forge.pki.UnsupportedCertificate",certificate_revoked:"forge.pki.CertificateRevoked",certificate_expired:"forge.pki.CertificateExpired",certificate_unknown:"forge.pki.CertificateUnknown",unknown_ca:"forge.pki.UnknownCertificateAuthority"};
570
+r.verifyCertificateChain=function(b,c,d){c=c.slice(0);var e=c.slice(0),g=new Date,h=!0,k=null,l=0;do{var m=c.shift(),q=null,u=!1;if(g<m.validity.notBefore||g>m.validity.notAfter)k={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:m.validity.notBefore,notAfter:m.validity.notAfter,now:g};if(null===k){q=c[0]||b.getIssuer(m);null===q&&m.isIssuer(m)&&(u=!0,q=m);if(q){var E=q;a.util.isArray(E)||(E=[E]);for(var z=!1;!z&&0<E.length;){q=E.shift();
571
+try{z=q.verify(m)}catch(x){}}z||(k={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==k||q&&!u||b.hasCertificate(m)||(k={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}null===k&&q&&!m.isIssuer(q)&&(k={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate});if(null===k)for(E={keyUsage:!0,basicConstraints:!0},z=0;null===k&&z<m.extensions.length;++z){var v=m.extensions[z];!v.critical||v.name in E||(k=
572
+{message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}null!==k||h&&(0!==c.length||q&&!u)||(h=m.getExtension("basicConstraints"),m=m.getExtension("keyUsage"),null!==m&&(m.keyCertSign&&null!==h||(k={message:"Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error:r.certificateError.bad_certificate})),
573
+null!==k||null===h||h.cA||(k={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===k&&null!==m&&"pathLenConstraint"in h&&l-1>h.pathLenConstraint&&(k={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate}));m=null===k?!0:k.error;h=d?d(m,l,e):m;if(!0===h)k=null;else{!0===m&&(k={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate});
574
+if(h||0===h)"object"!==typeof h||a.util.isArray(h)?"string"===typeof h&&(k.error=h):(h.message&&(k.message=h.message),h.error&&(k.error=h.error));throw k;}h=!1;++l}while(0<c.length);return!0}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.x509)return c.x509;
575
+c.defined.x509=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pki}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/x509","require module ./aes ./asn1 ./des ./md ./mgf ./oids ./pem ./pss ./rsa ./util".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d,e){for(var g=
576
+[],h=0;h<a.length;h++)for(var n=0;n<a[h].safeBags.length;n++){var k=a[h].safeBags[n];if(void 0===e||k.type===e)null===b?g.push(k):void 0!==k.attributes[b]&&0<=k.attributes[b].indexOf(d)&&g.push(k)}return g}function d(b){if(b.composed||b.constructed){for(var c=a.util.createBuffer(),e=0;e<b.value.length;++e)c.putBytes(b.value[e].value);b.composed=b.constructed=!1;b.value=c.getBytes()}return b}function e(b,c,k,m){c=l.fromDer(c,k);if(c.tagClass!==l.Class.UNIVERSAL||c.type!==l.Type.SEQUENCE||!0!==c.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");
577
+for(var q=0;q<c.value.length;q++){var r={},z=[];if(!l.validate(c.value[q],u,r,z))throw b=Error("Cannot read ContentInfo."),b.errors=z,b;var z={encrypted:!1},p=null,p=r.content.value[0];switch(l.derToOid(r.contentType)){case g.oids.data:if(p.tagClass!==l.Class.UNIVERSAL||p.type!==l.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");p=d(p).value;break;case g.oids.encryptedData:var x=m,r={},F=[];if(!l.validate(p,a.pkcs7.asn1.encryptedDataValidator,r,F))throw b=Error("Cannot read EncryptedContentInfo."),
578
+b.errors=F,b;p=l.derToOid(r.contentType);if(p!==g.oids.data)throw b=Error("PKCS#12 EncryptedContentInfo ContentType is not Data."),b.oid=p,b;p=l.derToOid(r.encAlgorithm);p=g.pbe.getCipher(p,r.encParameter,x);r=d(r.encryptedContentAsn1);r=a.util.createBuffer(r.value);p.update(r);if(!p.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");p=p.output.getBytes();z.encrypted=!0;break;default:throw b=Error("Unsupported PKCS#12 contentType."),b.contentType=l.derToOid(r.contentType),b;}z.safeBags=
579
+h(p,k,m);b.safeContents.push(z)}}function h(a,b,c){if(!b&&0===a.length)return[];a=l.fromDer(a,b);if(a.tagClass!==l.Class.UNIVERSAL||a.type!==l.Type.SEQUENCE||!0!==a.constructed)throw Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");for(var d=[],e=0;e<a.value.length;e++){var n={},k=[];if(!l.validate(a.value[e],z,n,k))throw a=Error("Cannot read SafeBag."),a.errors=k,a;var m={type:l.derToOid(n.bagId),attributes:q(n.bagAttributes)};d.push(m);var u,r,x=n.bagValue.value[0];switch(m.type){case g.oids.pkcs8ShroudedKeyBag:if(x=
580
+g.decryptPrivateKeyInfo(x,c),null===x)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case g.oids.keyBag:try{m.key=g.privateKeyFromAsn1(x)}catch(v){m.key=null,m.asn1=x}continue;case g.oids.certBag:u=F;r=function(){if(l.derToOid(n.certId)!==g.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");a.oid=l.derToOid(n.certId);throw a;}a=l.fromDer(n.cert,b);try{m.cert=g.certificateFromAsn1(a,!0)}catch(c){m.cert=null,m.asn1=a}};break;default:throw a=
581
+Error("Unsupported PKCS#12 SafeBag type."),a.oid=m.type,a;}if(void 0!==u&&!l.validate(x,u,n,k))throw a=Error("Cannot read PKCS#12 "+u.name),a.errors=k,a;r()}return d}function q(a){var b={};if(void 0!==a)for(var c=0;c<a.length;++c){var d={},e=[];if(!l.validate(a[c],x,d,e))throw a=Error("Cannot read PKCS#12 BagAttribute."),a.errors=e,a;e=l.derToOid(d.oid);if(void 0!==g.oids[e]){b[g.oids[e]]=[];for(var h=0;h<d.values.length;++h)b[g.oids[e]].push(d.values[h].value)}}return b}var l=a.asn1,g=a.pki,r=a.pkcs12=
582
+a.pkcs12||{},u={name:"ContentInfo",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},D={name:"PFX",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,capture:"version"},
583
+u,{name:"PFX.macData",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",
584
+tagClass:l.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:l.Class.UNIVERSAL,type:l.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:l.Class.UNIVERSAL,type:l.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},z={name:"SafeBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,
585
+value:[{name:"SafeBag.bagId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},x={name:"Attribute",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,
586
+capture:"oid"},{name:"Attribute.attrValues",tagClass:l.Class.UNIVERSAL,type:l.Type.SET,constructed:!0,capture:"values"}]},F={name:"CertBag",tagClass:l.Class.UNIVERSAL,type:l.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:l.Class.UNIVERSAL,type:l.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:l.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:l.Class.UNIVERSAL,type:l.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};
587
+r.pkcs12FromAsn1=function(b,h,q){"string"===typeof h?(q=h,h=!0):void 0===h&&(h=!0);var u={};if(!l.validate(b,D,u,[]))throw h=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),h.errors=h,h;var z={version:u.version.charCodeAt(0),safeContents:[],getBags:function(b){var d={},e;"localKeyId"in b?e=b.localKeyId:"localKeyIdHex"in b&&(e=a.util.hexToBytes(b.localKeyIdHex));void 0===e&&!("friendlyName"in b)&&"bagType"in b&&(d[b.bagType]=c(z.safeContents,null,null,b.bagType));void 0!==e&&
588
+(d.localKeyId=c(z.safeContents,"localKeyId",e,b.bagType));"friendlyName"in b&&(d.friendlyName=c(z.safeContents,"friendlyName",b.friendlyName,b.bagType));return d},getBagsByFriendlyName:function(a,b){return c(z.safeContents,"friendlyName",a,b)},getBagsByLocalKeyId:function(a,b){return c(z.safeContents,"localKeyId",a,b)}};if(3!==u.version.charCodeAt(0))throw h=Error("PKCS#12 PFX of version other than 3 not supported."),h.version=u.version.charCodeAt(0),h;if(l.derToOid(u.contentType)!==g.oids.data)throw h=
589
+Error("Only PKCS#12 PFX in password integrity mode supported."),h.oid=l.derToOid(u.contentType),h;b=u.content.value[0];if(b.tagClass!==l.Class.UNIVERSAL||b.type!==l.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");b=d(b);if(u.mac){var x=null,v=0,p=l.derToOid(u.macAlgorithm);switch(p){case g.oids.sha1:x=a.md.sha1.create();v=20;break;case g.oids.sha256:x=a.md.sha256.create();v=32;break;case g.oids.sha384:x=a.md.sha384.create();v=48;break;case g.oids.sha512:x=a.md.sha512.create();
590
+v=64;break;case g.oids.md5:x=a.md.md5.create(),v=16}if(null===x)throw Error("PKCS#12 uses unsupported MAC algorithm: "+p);var p=new a.util.ByteBuffer(u.macSalt),F="macIterations"in u?parseInt(a.util.bytesToHex(u.macIterations),16):1,v=r.generateKey(q,p,3,F,v,x),p=a.hmac.create();p.start(x,v);p.update(b.value);if(p.getMac().getBytes()!==u.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(z,b.value,h,q);return z};r.toPkcs12Asn1=function(b,c,d,e){e=e||{};e.saltSize=e.saltSize||
591
+8;e.count=e.count||2048;e.algorithm=e.algorithm||e.encAlgorithm||"aes128";"useMac"in e||(e.useMac=!0);"localKeyId"in e||(e.localKeyId=null);"generateLocalKeyId"in e||(e.generateLocalKeyId=!0);var h=e.localKeyId,k;if(null!==h)h=a.util.hexToBytes(h);else if(e.generateLocalKeyId)if(c){var m=a.util.isArray(c)?c[0]:c;"string"===typeof m&&(m=g.certificateFromPem(m));h=a.md.sha1.create();h.update(l.toDer(g.certificateToAsn1(m)).getBytes());h=h.digest().getBytes()}else h=a.random.getBytes(20);m=[];null!==
592
+h&&m.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.localKeyId).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,h)])]));"friendlyName"in e&&m.push(l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.friendlyName).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SET,!0,[l.create(l.Class.UNIVERSAL,l.Type.BMPSTRING,!1,e.friendlyName)])]));
593
+0<m.length&&(k=l.create(l.Class.UNIVERSAL,l.Type.SET,!0,m));h=[];m=[];null!==c&&(m=a.util.isArray(c)?c:[c]);for(var q=[],u=0;u<m.length;++u){c=m[u];"string"===typeof c&&(c=g.certificateFromPem(c));var z=0===u?k:void 0;c=g.certificateToAsn1(c);c=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.certBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.x509Certificate).getBytes()),
594
+l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(c).getBytes())])])]),z]);q.push(c)}0<q.length&&(c=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,q),c=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(c).getBytes())])]),h.push(c));c=null;null!==b&&(b=g.wrapRsaPrivateKey(g.privateKeyToAsn1(b)),
595
+c=null===d?l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.keyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[b]),k]):l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.pkcs8ShroudedKeyBag).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[g.encryptPrivateKeyInfo(b,d,e)]),k]),b=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[c]),b=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,
596
+[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(b).getBytes())])]),h.push(b));k=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,h);var x;e.useMac&&(h=a.md.sha1.create(),x=new a.util.ByteBuffer(a.random.getBytes(e.saltSize)),e=e.count,b=r.generateKey(d,x,3,e,20),d=a.hmac.create(),d.start(h,b),d.update(l.toDer(k).getBytes()),d=d.getMac(),x=l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,
597
+!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.sha1).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.NULL,!1,"")]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,d.getBytes())]),l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,x.getBytes()),l.create(l.Class.UNIVERSAL,l.Type.INTEGER,!1,l.integerToDer(e).getBytes())]));return l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,
598
+l.Type.INTEGER,!1,l.integerToDer(3).getBytes()),l.create(l.Class.UNIVERSAL,l.Type.SEQUENCE,!0,[l.create(l.Class.UNIVERSAL,l.Type.OID,!1,l.oidToDer(g.oids.data).getBytes()),l.create(l.Class.CONTEXT_SPECIFIC,0,!0,[l.create(l.Class.UNIVERSAL,l.Type.OCTETSTRING,!1,l.toDer(k).getBytes())])]),x])};r.generateKey=a.pbe.generatePkcs12Key}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,
599
+h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs12)return c.pkcs12;c.defined.pkcs12=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pkcs12}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/pkcs12","require module ./asn1 ./hmac ./oids ./pkcs7asn1 ./pbe ./random ./rsa ./sha1 ./util ./x509".split(" "),
600
+function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=a.asn1,d=a.pki=a.pki||{};d.pemToDer=function(b){b=a.pem.decode(b)[0];if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return a.util.createBuffer(b.body)};d.privateKeyFromPem=function(b){b=a.pem.decode(b)[0];if("PRIVATE KEY"!==b.type&&"RSA PRIVATE KEY"!==b.type){var e=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');
601
e.headerType=b.type;throw e;}if(b.procType&&"ENCRYPTED"===b.procType.type)throw Error("Could not convert private key from PEM; PEM is encrypted.");b=c.fromDer(b.body);return d.privateKeyFromAsn1(b)};d.privateKeyToPem=function(b,e){var h={type:"RSA PRIVATE KEY",body:c.toDer(d.privateKeyToAsn1(b)).getBytes()};return a.pem.encode(h,{maxline:e})};d.privateKeyInfoToPem=function(b,d){var e={type:"PRIVATE KEY",body:c.toDer(b).getBytes()};return a.pem.encode(e,{maxline:d})}}if("function"!==typeof a)if("object"===
602
-typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pki)return c.pki;c.defined.pki=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pki}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,
603
-Array.prototype.slice.call(arguments,0))};a("js/pki","require module ./asn1 ./oids ./pbe ./pem ./pbkdf2 ./pkcs12 ./pss ./rsa ./util ./x509".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=function(b,c,d,e){var g=a.util.createBuffer(),h=b.length>>1,k=h+(b.length&1),m=b.substr(0,k),k=b.substr(h,k);b=a.util.createBuffer();h=a.hmac.create();d=c+d;var l=Math.ceil(e/16);c=Math.ceil(e/20);h.start("MD5",m);m=a.util.createBuffer();b.putBytes(d);
604
-for(var r=0;r<l;++r)h.start(null,null),h.update(b.getBytes()),b.putBuffer(h.digest()),h.start(null,null),h.update(b.bytes()+d),m.putBuffer(h.digest());h.start("SHA1",k);k=a.util.createBuffer();b.clear();b.putBytes(d);for(r=0;r<c;++r)h.start(null,null),h.update(b.getBytes()),b.putBuffer(h.digest()),h.start(null,null),h.update(b.bytes()+d),k.putBuffer(h.digest());g.putBytes(a.util.xorBytes(m.getBytes(),k.getBytes(),e));return g},d=function(b,c,d){d=!1;try{var e=b.deflate(c.fragment.getBytes());c.fragment=
605
-a.util.createBuffer(e);c.length=e.length;d=!0}catch(g){}return d},e=function(b,c,d){d=!1;try{var e=b.inflate(c.fragment.getBytes());c.fragment=a.util.createBuffer(e);c.length=e.length;d=!0}catch(g){}return d},l=function(b,c){var d=0;switch(c){case 1:d=b.getByte();break;case 2:d=b.getInt16();break;case 3:d=b.getInt24();break;case 4:d=b.getInt32()}return a.util.createBuffer(b.getBytes(d))},h=function(a,b,c){a.putInt(c.length(),b<<3);a.putBuffer(c)},k={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,
606
-minor:2},TLS_1_2:{major:3,minor:3}}};k.SupportedVersions=[k.Versions.TLS_1_1,k.Versions.TLS_1_0];k.Version=k.SupportedVersions[0];k.MaxFragment=15360;k.ConnectionEnd={server:0,client:1};k.PRFAlgorithm={tls_prf_sha256:0};k.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};k.CipherType={stream:0,block:1,aead:2};k.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};k.CompressionMethod={none:0,deflate:1};k.ContentType={change_cipher_spec:20,alert:21,handshake:22,
607
-application_data:23,heartbeat:24};k.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};k.Alert={};k.Alert.Level={warning:1,fatal:2};k.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,
608
-certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};k.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};k.CipherSuites={};k.getCipherSuite=function(a){var b=null,c;for(c in k.CipherSuites){var d=k.CipherSuites[c];if(d.id[0]===a.charCodeAt(0)&&d.id[1]===a.charCodeAt(1)){b=d;break}}return b};
609
-k.handleUnexpected=function(a,b){(a.open||a.entity!==k.ConnectionEnd.client)&&a.error(a,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unexpected_message}})};k.handleHelloRequest=function(a,b,c){!a.handshaking&&0<a.handshakes&&(k.queue(a,k.createAlert(a,{level:k.Alert.Level.warning,description:k.Alert.Description.no_renegotiation})),k.flush(a));a.process()};k.parseHelloMessage=function(b,c,d){var e=null,g=b.entity===
610
-k.ConnectionEnd.client;if(38>d)b.error(b,{message:g?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});else{c=c.fragment;var h=c.length(),e={version:{major:c.getByte(),minor:c.getByte()},random:a.util.createBuffer(c.getBytes(32)),session_id:l(c,1),extensions:[]};g?(e.cipher_suite=c.getBytes(2),e.compression_method=c.getByte()):(e.cipher_suites=l(c,2),e.compression_methods=
611
-l(c,1));h=d-(h-c.length());if(0<h){for(d=l(c,2);0<d.length();)e.extensions.push({type:[d.getByte(),d.getByte()],data:l(d,2)});if(!g)for(d=0;d<e.extensions.length;++d)if(c=e.extensions[d],0===c.type[0]&&0===c.type[1])for(c=l(c.data,2);0<c.length()&&0===c.getByte();)b.session.extensions.server_name.serverNameList.push(l(c,2).getBytes())}if(b.session.version&&(e.version.major!==b.session.version.major||e.version.minor!==b.session.version.minor))return b.error(b,{message:"TLS version change is disallowed during renegotiation.",
612
-send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.protocol_version}});if(g)b.session.cipherSuite=k.getCipherSuite(e.cipher_suite);else for(d=a.util.createBuffer(e.cipher_suites.bytes());0<d.length()&&(b.session.cipherSuite=k.getCipherSuite(d.getBytes(2)),null===b.session.cipherSuite););if(null===b.session.cipherSuite)return b.error(b,{message:"No cipher suites in common.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(e.cipher_suite)});
613
-b.session.compressionMethod=g?e.compression_method:k.CompressionMethod.none}return e};k.createSecurityParameters=function(a,b){var c=a.entity===k.ConnectionEnd.client,d=b.random.bytes(),e=c?a.session.sp.client_random:d,c=c?d:k.createRandom().getBytes();a.session.sp={entity:a.entity,prf_algorithm:k.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,
614
-compression_algorithm:a.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:e,server_random:c}};k.handleServerHello=function(a,b,c){b=k.parseHelloMessage(a,b,c);if(!a.fail){if(b.version.minor<=a.version.minor)a.version.minor=b.version.minor;else return a.error(a,{message:"Incompatible TLS version.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.protocol_version}});a.session.version=a.version;c=b.session_id.bytes();0<c.length&&c===a.session.id?
615
-(a.expect=z,a.session.resuming=!0,a.session.sp.server_random=b.random.bytes()):(a.expect=g,a.session.resuming=!1,k.createSecurityParameters(a,b));a.session.id=c;a.process()}};k.handleClientHello=function(b,c,d){c=k.parseHelloMessage(b,c,d);if(!b.fail){var e=c.session_id.bytes();d=null;if(b.sessionCache)if(d=b.sessionCache.getSession(e),null===d)e="";else if(d.version.major!==c.version.major||d.version.minor>c.version.minor)d=null,e="";0===e.length&&(e=a.random.getBytes(32));b.session.id=e;b.session.clientHelloVersion=
616
-c.version;b.session.sp={};if(d)b.version=b.session.version=d.version,b.session.sp=d.sp;else{for(var g,e=1;e<k.SupportedVersions.length&&!(g=k.SupportedVersions[e],g.minor<=c.version.minor);++e);b.version={major:g.major,minor:g.minor};b.session.version=b.version}null!==d?(b.expect=C,b.session.resuming=!0,b.session.sp.client_random=c.random.bytes()):(b.expect=!1!==b.verifyClient?D:A,b.session.resuming=!1,k.createSecurityParameters(b,c));b.open=!0;k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,
617
-data:k.createServerHello(b)}));b.session.resuming?(k.queue(b,k.createRecord(b,{type:k.ContentType.change_cipher_spec,data:k.createChangeCipherSpec()})),b.state.pending=k.createConnectionState(b),b.state.current.write=b.state.pending.write,k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createFinished(b)}))):(k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createCertificate(b)})),b.fail||(k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createServerKeyExchange(b)})),
618
-!1!==b.verifyClient&&k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createCertificateRequest(b)})),k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createServerHelloDone(b)}))));k.flush(b);b.process()}};k.handleCertificate=function(b,c,d){if(3>d)return b.error(b,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=l(c.fragment,3);var e,g;c=[];try{for(;0<d.length();)e=
619
-l(d,3),g=a.asn1.fromDer(e),e=a.pki.certificateFromAsn1(g,!0),c.push(e)}catch(h){return b.error(b,{message:"Could not parse certificate list.",cause:h,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate}})}e=b.entity===k.ConnectionEnd.client;!e&&!0!==b.verifyClient||0!==c.length?0===c.length?b.expect=e?u:A:(e?b.session.serverCertificate=c[0]:b.session.clientCertificate=c[0],k.verifyCertificateChain(b,c)&&(b.expect=e?u:A)):b.error(b,{message:e?"No server certificate provided.":
620
-"No client certificate provided.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});b.process()};k.handleServerKeyExchange=function(a,b,c){if(0<c)return a.error(a,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unsupported_certificate}});a.expect=r;a.process()};k.handleClientKeyExchange=function(b,c,d){if(48>d)return b.error(b,{message:"Invalid key parameters. Only RSA is supported.",
621
-send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unsupported_certificate}});c=l(c.fragment,2).getBytes();d=null;if(b.getPrivateKey)try{d=b.getPrivateKey(b,b.session.serverCertificate),d=a.pki.privateKeyFromPem(d)}catch(e){b.error(b,{message:"Could not get private key.",cause:e,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}})}if(null===d)return b.error(b,{message:"No private key set.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}});
622
-try{var g=b.session.sp;g.pre_master_secret=d.decrypt(c);var h=b.session.clientHelloVersion;if(h.major!==g.pre_master_secret.charCodeAt(0)||h.minor!==g.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(e){g.pre_master_secret=a.random.getBytes(48)}b.expect=C;null!==b.session.clientCertificate&&(b.expect=y);b.process()};k.handleCertificateRequest=function(a,b,c){if(3>c)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,
623
-description:k.Alert.Description.illegal_parameter}});b=b.fragment;b={certificate_types:l(b,1),certificate_authorities:l(b,2)};a.session.certificateRequest=b;a.expect=E;a.process()};k.handleCertificateVerify=function(b,c,d){if(2>d)return b.error(b,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=c.fragment;d.read-=4;c=d.bytes();d.read+=4;d=l(d,2).getBytes();var e=a.util.createBuffer();e.putBuffer(b.session.md5.digest());
624
-e.putBuffer(b.session.sha1.digest());e=e.getBytes();try{if(!b.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");b.session.md5.update(c);b.session.sha1.update(c)}catch(g){return b.error(b,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.handshake_failure}})}b.expect=C;b.process()};k.handleServerHelloDone=function(b,c,d){if(0<d)return b.error(b,{message:"Invalid ServerHelloDone message. Invalid length.",
625
-send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.record_overflow}});if(null===b.serverCertificate&&(c={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.insufficient_security}},d=b.verify(b,c.alert.description,0,[]),!0!==d)){if(d||0===d)"object"!==typeof d||a.util.isArray(d)?"number"===typeof d&&(c.alert.description=d):(d.message&&(c.message=d.message),d.alert&&(c.alert.description=d.alert));
626
-return b.error(b,c)}null!==b.session.certificateRequest&&(c=k.createRecord(b,{type:k.ContentType.handshake,data:k.createCertificate(b)}),k.queue(b,c));c=k.createRecord(b,{type:k.ContentType.handshake,data:k.createClientKeyExchange(b)});k.queue(b,c);b.expect=F;c=function(a,b){null!==a.session.certificateRequest&&null!==a.session.clientCertificate&&k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createCertificateVerify(a,b)}));k.queue(a,k.createRecord(a,{type:k.ContentType.change_cipher_spec,
627
-data:k.createChangeCipherSpec()}));a.state.pending=k.createConnectionState(a);a.state.current.write=a.state.pending.write;k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createFinished(a)}));a.expect=z;k.flush(a);a.process()};if(null===b.session.certificateRequest||null===b.session.clientCertificate)return c(b,null);k.getClientSignature(b,c)};k.handleChangeCipherSpec=function(a,b){if(1!==b.fragment.getByte())return a.error(a,{message:"Invalid ChangeCipherSpec message received.",send:!0,
628
-alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});var c=a.entity===k.ConnectionEnd.client;if(a.session.resuming&&c||!a.session.resuming&&!c)a.state.pending=k.createConnectionState(a);a.state.current.read=a.state.pending.read;if(!a.session.resuming&&c||a.session.resuming&&!c)a.state.pending=null;a.expect=c?B:M;a.process()};k.handleFinished=function(b,d,e){e=d.fragment;e.read-=4;var g=e.bytes();e.read+=4;d=d.fragment.getBytes();e=a.util.createBuffer();e.putBuffer(b.session.md5.digest());
629
-e.putBuffer(b.session.sha1.digest());var h=b.entity===k.ConnectionEnd.client;e=c(b.session.sp.master_secret,h?"server finished":"client finished",e.getBytes(),12);if(e.getBytes()!==d)return b.error(b,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.decrypt_error}});b.session.md5.update(g);b.session.sha1.update(g);if(b.session.resuming&&h||!b.session.resuming&&!h)k.queue(b,k.createRecord(b,{type:k.ContentType.change_cipher_spec,
630
-data:k.createChangeCipherSpec()})),b.state.current.write=b.state.pending.write,b.state.pending=null,k.queue(b,k.createRecord(b,{type:k.ContentType.handshake,data:k.createFinished(b)}));b.expect=h?I:ba;b.handshaking=!1;++b.handshakes;b.peerCertificate=h?b.session.serverCertificate:b.session.clientCertificate;k.flush(b);b.isConnected=!0;b.connected(b);b.process()};k.handleAlert=function(a,b){var c=b.fragment,c={level:c.getByte(),description:c.getByte()},d;switch(c.description){case k.Alert.Description.close_notify:d=
631
-"Connection closed.";break;case k.Alert.Description.unexpected_message:d="Unexpected message.";break;case k.Alert.Description.bad_record_mac:d="Bad record MAC.";break;case k.Alert.Description.decryption_failed:d="Decryption failed.";break;case k.Alert.Description.record_overflow:d="Record overflow.";break;case k.Alert.Description.decompression_failure:d="Decompression failed.";break;case k.Alert.Description.handshake_failure:d="Handshake failure.";break;case k.Alert.Description.bad_certificate:d=
632
-"Bad certificate.";break;case k.Alert.Description.unsupported_certificate:d="Unsupported certificate.";break;case k.Alert.Description.certificate_revoked:d="Certificate revoked.";break;case k.Alert.Description.certificate_expired:d="Certificate expired.";break;case k.Alert.Description.certificate_unknown:d="Certificate unknown.";break;case k.Alert.Description.illegal_parameter:d="Illegal parameter.";break;case k.Alert.Description.unknown_ca:d="Unknown certificate authority.";break;case k.Alert.Description.access_denied:d=
633
-"Access denied.";break;case k.Alert.Description.decode_error:d="Decode error.";break;case k.Alert.Description.decrypt_error:d="Decrypt error.";break;case k.Alert.Description.export_restriction:d="Export restriction.";break;case k.Alert.Description.protocol_version:d="Unsupported protocol version.";break;case k.Alert.Description.insufficient_security:d="Insufficient security.";break;case k.Alert.Description.internal_error:d="Internal error.";break;case k.Alert.Description.user_canceled:d="User canceled.";
634
-break;case k.Alert.Description.no_renegotiation:d="Renegotiation not supported.";break;default:d="Unknown error."}if(c.description===k.Alert.Description.close_notify)return a.close();a.error(a,{message:d,send:!1,origin:a.entity===k.ConnectionEnd.client?"server":"client",alert:c});a.process()};k.handleHandshake=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt24();if(g>d.length())return b.fragmented=c,c.fragment=a.util.createBuffer(),d.read-=4,b.process();b.fragmented=null;d.read-=4;var h=d.bytes(g+
635
-4);d.read+=4;e in U[b.entity][b.expect]?(b.entity!==k.ConnectionEnd.server||b.open||b.fail||(b.handshaking=!0,b.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),e!==k.HandshakeType.hello_request&&e!==k.HandshakeType.certificate_verify&&e!==k.HandshakeType.finished&&(b.session.md5.update(h),b.session.sha1.update(h)),U[b.entity][b.expect][e](b,c,g)):
636
-k.handleUnexpected(b,c)};k.handleApplicationData=function(a,b){a.data.putBuffer(b.fragment);a.dataReady(a);a.process()};k.handleHeartbeat=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt16(),d=d.getBytes(g);if(e===k.HeartbeatMessageType.heartbeat_request){if(b.handshaking||g>d.length)return b.process();k.queue(b,k.createRecord(b,{type:k.ContentType.heartbeat,data:k.createHeartbeat(k.HeartbeatMessageType.heartbeat_response,d)}));k.flush(b)}else if(e===k.HeartbeatMessageType.heartbeat_response){if(d!==
637
-b.expectedHeartbeatPayload)return b.process();b.heartbeatReceived&&b.heartbeatReceived(b,a.util.createBuffer(d))}b.process()};var g=1,u=2,r=3,E=4,z=5,B=6,I=7,F=8,D=1,A=2,y=3,C=4,M=5,ba=6,q=k.handleUnexpected,V=k.handleChangeCipherSpec,T=k.handleAlert,S=k.handleHandshake,aa=k.handleApplicationData,O=k.handleHeartbeat,R=[];R[k.ConnectionEnd.client]=[[q,T,S,q,O],[q,T,S,q,O],[q,T,S,q,O],[q,T,S,q,O],[q,T,S,q,O],[V,T,q,q,O],[q,T,S,q,O],[q,T,S,aa,O],[q,T,S,q,O]];R[k.ConnectionEnd.server]=[[q,T,S,q,O],[q,
638
-T,S,q,O],[q,T,S,q,O],[q,T,S,q,O],[V,T,q,q,O],[q,T,S,q,O],[q,T,S,aa,O],[q,T,S,q,O]];var V=k.handleHelloRequest,T=k.handleCertificate,S=k.handleServerKeyExchange,aa=k.handleCertificateRequest,O=k.handleServerHelloDone,W=k.handleFinished,U=[];U[k.ConnectionEnd.client]=[[q,q,k.handleServerHello,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,T,S,aa,O,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,S,aa,O,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,q,aa,O,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,q,q,O,q,q,q,
639
-q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,W],[V,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[V,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];U[k.ConnectionEnd.server]=[[q,k.handleClientHello,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,T,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,k.handleClientKeyExchange,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,k.handleCertificateVerify,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q,
640
-q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,W],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];k.generateKeys=function(a,b){var d=b.client_random+b.server_random;a.session.resuming||(b.master_secret=c(b.pre_master_secret,"master secret",d,48).bytes(),b.pre_master_secret=null);var d=b.server_random+b.client_random,e=2*b.mac_key_length+2*b.enc_key_length,g=a.version.major===k.Versions.TLS_1_0.major&&a.version.minor===k.Versions.TLS_1_0.minor;g&&(e+=2*b.fixed_iv_length);
641
-d=c(b.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(b.mac_key_length),server_write_MAC_key:d.getBytes(b.mac_key_length),client_write_key:d.getBytes(b.enc_key_length),server_write_key:d.getBytes(b.enc_key_length)};g&&(e.client_write_IV=d.getBytes(b.fixed_iv_length),e.server_write_IV=d.getBytes(b.fixed_iv_length));return e};k.createConnectionState=function(a){var b=a.entity===k.ConnectionEnd.client,c=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,
642
-cipherState:null,cipherFunction:function(a){return!0},compressionState:null,compressFunction:function(a){return!0},updateSequenceNumber:function(){4294967295===a.sequenceNumber[1]?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},g={read:c(),write:c()};g.read.update=function(a,b){g.read.cipherFunction(b,g.read)?g.read.compressFunction(a,b,g.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.decompression_failure}}):
643
-a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_record_mac}});return!a.fail};g.write.update=function(a,b){g.write.compressFunction(a,b,g.write)?g.write.cipherFunction(b,g.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}});
644
-return!a.fail};if(a.session)switch(c=a.session.sp,a.session.cipherSuite.initSecurityParameters(c),c.keys=k.generateKeys(a,c),g.read.macKey=b?c.keys.server_write_MAC_key:c.keys.client_write_MAC_key,g.write.macKey=b?c.keys.client_write_MAC_key:c.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(g,a,c),c.compression_algorithm){case k.CompressionMethod.none:break;case k.CompressionMethod.deflate:g.read.compressFunction=e;g.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm.");
645
-}return g};k.createRandom=function(){var b=new Date,b=+b+6E4*b.getTimezoneOffset(),c=a.util.createBuffer();c.putInt32(b);c.putBytes(a.random.getBytes(28));return c};k.createRecord=function(a,b){return b.data?{type:b.type,version:{major:a.version.major,minor:a.version.minor},length:b.data.length(),fragment:b.data}:null};k.createAlert=function(b,c){var d=a.util.createBuffer();d.putByte(c.level);d.putByte(c.description);return k.createRecord(b,{type:k.ContentType.alert,data:d})};k.createClientHello=
646
-function(b){b.session.clientHelloVersion={major:b.version.major,minor:b.version.minor};for(var c=a.util.createBuffer(),d=0;d<b.cipherSuites.length;++d){var e=b.cipherSuites[d];c.putByte(e.id[0]);c.putByte(e.id[1])}var g=c.length(),d=a.util.createBuffer();d.putByte(k.CompressionMethod.none);var m=d.length(),e=a.util.createBuffer();if(b.virtualHost){var l=a.util.createBuffer();l.putByte(0);l.putByte(0);var r=a.util.createBuffer();r.putByte(0);h(r,2,a.util.createBuffer(b.virtualHost));var p=a.util.createBuffer();
647
-h(p,2,r);h(l,2,p);e.putBuffer(l)}l=e.length();0<l&&(l+=2);r=b.session.id;g=r.length+1+2+4+28+2+g+1+m+l;m=a.util.createBuffer();m.putByte(k.HandshakeType.client_hello);m.putInt24(g);m.putByte(b.version.major);m.putByte(b.version.minor);m.putBytes(b.session.sp.client_random);h(m,1,a.util.createBuffer(r));h(m,2,c);h(m,1,d);0<l&&h(m,2,e);return m};k.createServerHello=function(b){var c=b.session.id,d=c.length+1+2+4+28+2+1,e=a.util.createBuffer();e.putByte(k.HandshakeType.server_hello);e.putInt24(d);e.putByte(b.version.major);
648
-e.putByte(b.version.minor);e.putBytes(b.session.sp.server_random);h(e,1,a.util.createBuffer(c));e.putByte(b.session.cipherSuite.id[0]);e.putByte(b.session.cipherSuite.id[1]);e.putByte(b.session.compressionMethod);return e};k.createCertificate=function(b){var c=b.entity===k.ConnectionEnd.client,d=null;b.getCertificate&&(d=b.getCertificate(b,c?b.session.certificateRequest:b.session.extensions.server_name.serverNameList));var e=a.util.createBuffer();if(null!==d)try{a.util.isArray(d)||(d=[d]);for(var g=
649
-null,m=0;m<d.length;++m){var l=a.pem.decode(d[m])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var r=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');r.headerType=l.type;throw r;}if(l.procType&&"ENCRYPTED"===l.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var p=a.util.createBuffer(l.body);null===g&&(g=a.asn1.fromDer(p.bytes(),!1));
650
-var q=a.util.createBuffer();h(q,3,p);e.putBuffer(q)}d=a.pki.certificateFromAsn1(g);c?b.session.clientCertificate=d:b.session.serverCertificate=d}catch(y){return b.error(b,{message:"Could not send certificate list.",cause:y,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate}})}b=3+e.length();c=a.util.createBuffer();c.putByte(k.HandshakeType.certificate);c.putInt24(b);h(c,3,e);return c};k.createClientKeyExchange=function(b){var c=a.util.createBuffer();c.putByte(b.session.clientHelloVersion.major);
651
-c.putByte(b.session.clientHelloVersion.minor);c.putBytes(a.random.getBytes(46));var d=b.session.sp;d.pre_master_secret=c.getBytes();c=b.session.serverCertificate.publicKey.encrypt(d.pre_master_secret);b=c.length+2;d=a.util.createBuffer();d.putByte(k.HandshakeType.client_key_exchange);d.putInt24(b);d.putInt16(c.length);d.putBytes(c);return d};k.createServerKeyExchange=function(b){return a.util.createBuffer()};k.getClientSignature=function(b,c){var d=a.util.createBuffer();d.putBuffer(b.session.md5.digest());
652
-d.putBuffer(b.session.sha1.digest());d=d.getBytes();b.getSignature=b.getSignature||function(b,c,d){var e=null;if(b.getPrivateKey)try{e=b.getPrivateKey(b,b.session.clientCertificate),e=a.pki.privateKeyFromPem(e)}catch(g){b.error(b,{message:"Could not get private key.",cause:g,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}})}null===e?b.error(b,{message:"No private key set.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}):
653
-c=e.sign(c,null);d(b,c)};b.getSignature(b,d,c)};k.createCertificateVerify=function(b,c){var d=c.length+2,e=a.util.createBuffer();e.putByte(k.HandshakeType.certificate_verify);e.putInt24(d);e.putInt16(c.length);e.putBytes(c);return e};k.createCertificateRequest=function(b){var c=a.util.createBuffer();c.putByte(1);var d=a.util.createBuffer(),e;for(e in b.caStore.certs){var g=a.pki.distinguishedNameToAsn1(b.caStore.certs[e].subject);d.putBuffer(a.asn1.toDer(g))}b=1+c.length()+2+d.length();e=a.util.createBuffer();
654
-e.putByte(k.HandshakeType.certificate_request);e.putInt24(b);h(e,1,c);h(e,2,d);return e};k.createServerHelloDone=function(b){b=a.util.createBuffer();b.putByte(k.HandshakeType.server_hello_done);b.putInt24(0);return b};k.createChangeCipherSpec=function(){var b=a.util.createBuffer();b.putByte(1);return b};k.createFinished=function(b){var d=a.util.createBuffer();d.putBuffer(b.session.md5.digest());d.putBuffer(b.session.sha1.digest());d=c(b.session.sp.master_secret,b.entity===k.ConnectionEnd.client?"client finished":
655
-"server finished",d.getBytes(),12);b=a.util.createBuffer();b.putByte(k.HandshakeType.finished);b.putInt24(d.length());b.putBuffer(d);return b};k.createHeartbeat=function(b,c,d){"undefined"===typeof d&&(d=c.length);var e=a.util.createBuffer();e.putByte(b);e.putInt16(d);e.putBytes(c);b=e.length();e.putBytes(a.random.getBytes(Math.max(16,b-d-3)));return e};k.queue=function(b,c){if(c){if(c.type===k.ContentType.handshake){var d=c.fragment.bytes();b.session.md5.update(d);b.session.sha1.update(d)}if(c.fragment.length()<=
656
-k.MaxFragment)d=[c];else{for(var d=[],e=c.fragment.bytes();e.length>k.MaxFragment;)d.push(k.createRecord(b,{type:c.type,data:a.util.createBuffer(e.slice(0,k.MaxFragment))})),e=e.slice(k.MaxFragment);0<e.length&&d.push(k.createRecord(b,{type:c.type,data:a.util.createBuffer(e)}))}for(e=0;e<d.length&&!b.fail;++e){var g=d[e];b.state.current.write.update(b,g)&&b.records.push(g)}}};k.flush=function(a){for(var b=0;b<a.records.length;++b){var c=a.records[b];a.tlsData.putByte(c.type);a.tlsData.putByte(c.version.major);
657
-a.tlsData.putByte(c.version.minor);a.tlsData.putInt16(c.fragment.length());a.tlsData.putBuffer(a.records[b].fragment)}a.records=[];return a.tlsDataReady(a)};var Z=function(b){switch(b){case !0:return!0;case a.pki.certificateError.bad_certificate:return k.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return k.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return k.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return k.Alert.Description.certificate_expired;
658
-case a.pki.certificateError.certificate_unknown:return k.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return k.Alert.Description.unknown_ca;default:return k.Alert.Description.bad_certificate}},N=function(b){switch(b){case !0:return!0;case k.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case k.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case k.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;
659
-case k.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case k.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case k.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}};k.verifyCertificateChain=function(b,c){try{a.pki.verifyCertificateChain(b.caStore,c,function(c,d,e){Z(c);d=b.verify(b,c,d,e);if(!0!==d){if("object"===typeof d&&!a.util.isArray(d))throw c=
660
-Error("The application rejected the certificate."),c.send=!0,c.alert={level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate},d.message&&(c.message=d.message),d.alert&&(c.alert.description=d.alert),c;d!==c&&(d=N(d))}return d})}catch(d){var e=d;if("object"!==typeof e||a.util.isArray(e))e={send:!0,alert:{level:k.Alert.Level.fatal,description:Z(d)}};"send"in e||(e.send=!0);"alert"in e||(e.alert={level:k.Alert.Level.fatal,description:Z(e.error)});b.error(b,e)}return!b.fail};k.createSessionCache=
602
+typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pki)return c.pki;c.defined.pki=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pki}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,
603
+Array.prototype.slice.call(arguments,0))};a("js/pki","require module ./asn1 ./oids ./pbe ./pem ./pbkdf2 ./pkcs12 ./pss ./rsa ./util ./x509".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c=function(b,c,d,e){var g=a.util.createBuffer(),h=b.length>>1,k=h+(b.length&1),l=b.substr(0,k),k=b.substr(h,k);b=a.util.createBuffer();h=a.hmac.create();d=c+d;var m=Math.ceil(e/16);c=Math.ceil(e/20);h.start("MD5",l);l=a.util.createBuffer();b.putBytes(d);
604
+for(var q=0;q<m;++q)h.start(null,null),h.update(b.getBytes()),b.putBuffer(h.digest()),h.start(null,null),h.update(b.bytes()+d),l.putBuffer(h.digest());h.start("SHA1",k);k=a.util.createBuffer();b.clear();b.putBytes(d);for(q=0;q<c;++q)h.start(null,null),h.update(b.getBytes()),b.putBuffer(h.digest()),h.start(null,null),h.update(b.bytes()+d),k.putBuffer(h.digest());g.putBytes(a.util.xorBytes(l.getBytes(),k.getBytes(),e));return g},d=function(b,c,d){d=!1;try{var e=b.deflate(c.fragment.getBytes());c.fragment=
605
+a.util.createBuffer(e);c.length=e.length;d=!0}catch(g){}return d},e=function(b,c,d){d=!1;try{var e=b.inflate(c.fragment.getBytes());c.fragment=a.util.createBuffer(e);c.length=e.length;d=!0}catch(g){}return d},h=function(b,c){var d=0;switch(c){case 1:d=b.getByte();break;case 2:d=b.getInt16();break;case 3:d=b.getInt24();break;case 4:d=b.getInt32()}return a.util.createBuffer(b.getBytes(d))},q=function(a,b,c){a.putInt(c.length(),b<<3);a.putBuffer(c)},l={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,
606
+minor:2},TLS_1_2:{major:3,minor:3}}};l.SupportedVersions=[l.Versions.TLS_1_1,l.Versions.TLS_1_0];l.Version=l.SupportedVersions[0];l.MaxFragment=15360;l.ConnectionEnd={server:0,client:1};l.PRFAlgorithm={tls_prf_sha256:0};l.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};l.CipherType={stream:0,block:1,aead:2};l.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};l.CompressionMethod={none:0,deflate:1};l.ContentType={change_cipher_spec:20,alert:21,handshake:22,
607
+application_data:23,heartbeat:24};l.HandshakeType={hello_request:0,client_hello:1,server_hello:2,certificate:11,server_key_exchange:12,certificate_request:13,server_hello_done:14,certificate_verify:15,client_key_exchange:16,finished:20};l.Alert={};l.Alert.Level={warning:1,fatal:2};l.Alert.Description={close_notify:0,unexpected_message:10,bad_record_mac:20,decryption_failed:21,record_overflow:22,decompression_failure:30,handshake_failure:40,bad_certificate:42,unsupported_certificate:43,certificate_revoked:44,
608
+certificate_expired:45,certificate_unknown:46,illegal_parameter:47,unknown_ca:48,access_denied:49,decode_error:50,decrypt_error:51,export_restriction:60,protocol_version:70,insufficient_security:71,internal_error:80,user_canceled:90,no_renegotiation:100};l.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};l.CipherSuites={};l.getCipherSuite=function(a){var b=null,c;for(c in l.CipherSuites){var d=l.CipherSuites[c];if(d.id[0]===a.charCodeAt(0)&&d.id[1]===a.charCodeAt(1)){b=d;break}}return b};
609
+l.handleUnexpected=function(a,b){(a.open||a.entity!==l.ConnectionEnd.client)&&a.error(a,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})};l.handleHelloRequest=function(a,b,c){!a.handshaking&&0<a.handshakes&&(l.queue(a,l.createAlert(a,{level:l.Alert.Level.warning,description:l.Alert.Description.no_renegotiation})),l.flush(a));a.process()};l.parseHelloMessage=function(b,c,d){var e=null,g=b.entity===
610
+l.ConnectionEnd.client;if(38>d)b.error(b,{message:g?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});else{c=c.fragment;var k=c.length(),e={version:{major:c.getByte(),minor:c.getByte()},random:a.util.createBuffer(c.getBytes(32)),session_id:h(c,1),extensions:[]};g?(e.cipher_suite=c.getBytes(2),e.compression_method=c.getByte()):(e.cipher_suites=h(c,2),e.compression_methods=
611
+h(c,1));k=d-(k-c.length());if(0<k){for(d=h(c,2);0<d.length();)e.extensions.push({type:[d.getByte(),d.getByte()],data:h(d,2)});if(!g)for(d=0;d<e.extensions.length;++d)if(c=e.extensions[d],0===c.type[0]&&0===c.type[1])for(c=h(c.data,2);0<c.length()&&0===c.getByte();)b.session.extensions.server_name.serverNameList.push(h(c,2).getBytes())}if(b.session.version&&(e.version.major!==b.session.version.major||e.version.minor!==b.session.version.minor))return b.error(b,{message:"TLS version change is disallowed during renegotiation.",
612
+send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});if(g)b.session.cipherSuite=l.getCipherSuite(e.cipher_suite);else for(d=a.util.createBuffer(e.cipher_suites.bytes());0<d.length()&&(b.session.cipherSuite=l.getCipherSuite(d.getBytes(2)),null===b.session.cipherSuite););if(null===b.session.cipherSuite)return b.error(b,{message:"No cipher suites in common.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure},cipherSuite:a.util.bytesToHex(e.cipher_suite)});
613
+b.session.compressionMethod=g?e.compression_method:l.CompressionMethod.none}return e};l.createSecurityParameters=function(a,b){var c=a.entity===l.ConnectionEnd.client,d=b.random.bytes(),e=c?a.session.sp.client_random:d,c=c?d:l.createRandom().getBytes();a.session.sp={entity:a.entity,prf_algorithm:l.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm:null,cipher_type:null,enc_key_length:null,block_length:null,fixed_iv_length:null,record_iv_length:null,mac_algorithm:null,mac_length:null,mac_key_length:null,
614
+compression_algorithm:a.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:e,server_random:c}};l.handleServerHello=function(a,b,c){b=l.parseHelloMessage(a,b,c);if(!a.fail){if(b.version.minor<=a.version.minor)a.version.minor=b.version.minor;else return a.error(a,{message:"Incompatible TLS version.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}});a.session.version=a.version;c=b.session_id.bytes();0<c.length&&c===a.session.id?
615
+(a.expect=z,a.session.resuming=!0,a.session.sp.server_random=b.random.bytes()):(a.expect=g,a.session.resuming=!1,l.createSecurityParameters(a,b));a.session.id=c;a.process()}};l.handleClientHello=function(b,c,d){c=l.parseHelloMessage(b,c,d);if(!b.fail){var e=c.session_id.bytes();d=null;if(b.sessionCache)if(d=b.sessionCache.getSession(e),null===d)e="";else if(d.version.major!==c.version.major||d.version.minor>c.version.minor)d=null,e="";0===e.length&&(e=a.random.getBytes(32));b.session.id=e;b.session.clientHelloVersion=
616
+c.version;b.session.sp={};if(d)b.version=b.session.version=d.version,b.session.sp=d.sp;else{for(var g,e=1;e<l.SupportedVersions.length&&!(g=l.SupportedVersions[e],g.minor<=c.version.minor);++e);b.version={major:g.major,minor:g.minor};b.session.version=b.version}null!==d?(b.expect=C,b.session.resuming=!0,b.session.sp.client_random=c.random.bytes()):(b.expect=!1!==b.verifyClient?E:A,b.session.resuming=!1,l.createSecurityParameters(b,c));b.open=!0;l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,
617
+data:l.createServerHello(b)}));b.session.resuming?(l.queue(b,l.createRecord(b,{type:l.ContentType.change_cipher_spec,data:l.createChangeCipherSpec()})),b.state.pending=l.createConnectionState(b),b.state.current.write=b.state.pending.write,l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createFinished(b)}))):(l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createCertificate(b)})),b.fail||(l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createServerKeyExchange(b)})),
618
+!1!==b.verifyClient&&l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createCertificateRequest(b)})),l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createServerHelloDone(b)}))));l.flush(b);b.process()}};l.handleCertificate=function(b,c,d){if(3>d)return b.error(b,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});d=h(c.fragment,3);var e,g;c=[];try{for(;0<d.length();)e=
619
+h(d,3),g=a.asn1.fromDer(e),e=a.pki.certificateFromAsn1(g,!0),c.push(e)}catch(k){return b.error(b,{message:"Could not parse certificate list.",cause:k,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}e=b.entity===l.ConnectionEnd.client;!e&&!0!==b.verifyClient||0!==c.length?0===c.length?b.expect=e?r:A:(e?b.session.serverCertificate=c[0]:b.session.clientCertificate=c[0],l.verifyCertificateChain(b,c)&&(b.expect=e?r:A)):b.error(b,{message:e?"No server certificate provided.":
620
+"No client certificate provided.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});b.process()};l.handleServerKeyExchange=function(a,b,c){if(0<c)return a.error(a,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});a.expect=u;a.process()};l.handleClientKeyExchange=function(b,c,d){if(48>d)return b.error(b,{message:"Invalid key parameters. Only RSA is supported.",
621
+send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unsupported_certificate}});c=h(c.fragment,2).getBytes();d=null;if(b.getPrivateKey)try{d=b.getPrivateKey(b,b.session.serverCertificate),d=a.pki.privateKeyFromPem(d)}catch(e){b.error(b,{message:"Could not get private key.",cause:e,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}if(null===d)return b.error(b,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});
622
+try{var g=b.session.sp;g.pre_master_secret=d.decrypt(c);var k=b.session.clientHelloVersion;if(k.major!==g.pre_master_secret.charCodeAt(0)||k.minor!==g.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(e){g.pre_master_secret=a.random.getBytes(48)}b.expect=C;null!==b.session.clientCertificate&&(b.expect=y);b.process()};l.handleCertificateRequest=function(a,b,c){if(3>c)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,
623
+description:l.Alert.Description.illegal_parameter}});b=b.fragment;b={certificate_types:h(b,1),certificate_authorities:h(b,2)};a.session.certificateRequest=b;a.expect=D;a.process()};l.handleCertificateVerify=function(b,c,d){if(2>d)return b.error(b,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});d=c.fragment;d.read-=4;c=d.bytes();d.read+=4;d=h(d,2).getBytes();var e=a.util.createBuffer();e.putBuffer(b.session.md5.digest());
624
+e.putBuffer(b.session.sha1.digest());e=e.getBytes();try{if(!b.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");b.session.md5.update(c);b.session.sha1.update(c)}catch(g){return b.error(b,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.handshake_failure}})}b.expect=C;b.process()};l.handleServerHelloDone=function(b,c,d){if(0<d)return b.error(b,{message:"Invalid ServerHelloDone message. Invalid length.",
625
+send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.record_overflow}});if(null===b.serverCertificate&&(c={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.insufficient_security}},d=b.verify(b,c.alert.description,0,[]),!0!==d)){if(d||0===d)"object"!==typeof d||a.util.isArray(d)?"number"===typeof d&&(c.alert.description=d):(d.message&&(c.message=d.message),d.alert&&(c.alert.description=d.alert));
626
+return b.error(b,c)}null!==b.session.certificateRequest&&(c=l.createRecord(b,{type:l.ContentType.handshake,data:l.createCertificate(b)}),l.queue(b,c));c=l.createRecord(b,{type:l.ContentType.handshake,data:l.createClientKeyExchange(b)});l.queue(b,c);b.expect=G;c=function(a,b){null!==a.session.certificateRequest&&null!==a.session.clientCertificate&&l.queue(a,l.createRecord(a,{type:l.ContentType.handshake,data:l.createCertificateVerify(a,b)}));l.queue(a,l.createRecord(a,{type:l.ContentType.change_cipher_spec,
627
+data:l.createChangeCipherSpec()}));a.state.pending=l.createConnectionState(a);a.state.current.write=a.state.pending.write;l.queue(a,l.createRecord(a,{type:l.ContentType.handshake,data:l.createFinished(a)}));a.expect=z;l.flush(a);a.process()};if(null===b.session.certificateRequest||null===b.session.clientCertificate)return c(b,null);l.getClientSignature(b,c)};l.handleChangeCipherSpec=function(a,b){if(1!==b.fragment.getByte())return a.error(a,{message:"Invalid ChangeCipherSpec message received.",send:!0,
628
+alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.illegal_parameter}});var c=a.entity===l.ConnectionEnd.client;if(a.session.resuming&&c||!a.session.resuming&&!c)a.state.pending=l.createConnectionState(a);a.state.current.read=a.state.pending.read;if(!a.session.resuming&&c||a.session.resuming&&!c)a.state.pending=null;a.expect=c?x:M;a.process()};l.handleFinished=function(b,d,e){e=d.fragment;e.read-=4;var g=e.bytes();e.read+=4;d=d.fragment.getBytes();e=a.util.createBuffer();e.putBuffer(b.session.md5.digest());
629
+e.putBuffer(b.session.sha1.digest());var h=b.entity===l.ConnectionEnd.client;e=c(b.session.sp.master_secret,h?"server finished":"client finished",e.getBytes(),12);if(e.getBytes()!==d)return b.error(b,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decrypt_error}});b.session.md5.update(g);b.session.sha1.update(g);if(b.session.resuming&&h||!b.session.resuming&&!h)l.queue(b,l.createRecord(b,{type:l.ContentType.change_cipher_spec,
630
+data:l.createChangeCipherSpec()})),b.state.current.write=b.state.pending.write,b.state.pending=null,l.queue(b,l.createRecord(b,{type:l.ContentType.handshake,data:l.createFinished(b)}));b.expect=h?F:ba;b.handshaking=!1;++b.handshakes;b.peerCertificate=h?b.session.serverCertificate:b.session.clientCertificate;l.flush(b);b.isConnected=!0;b.connected(b);b.process()};l.handleAlert=function(a,b){var c=b.fragment,c={level:c.getByte(),description:c.getByte()},d;switch(c.description){case l.Alert.Description.close_notify:d=
631
+"Connection closed.";break;case l.Alert.Description.unexpected_message:d="Unexpected message.";break;case l.Alert.Description.bad_record_mac:d="Bad record MAC.";break;case l.Alert.Description.decryption_failed:d="Decryption failed.";break;case l.Alert.Description.record_overflow:d="Record overflow.";break;case l.Alert.Description.decompression_failure:d="Decompression failed.";break;case l.Alert.Description.handshake_failure:d="Handshake failure.";break;case l.Alert.Description.bad_certificate:d=
632
+"Bad certificate.";break;case l.Alert.Description.unsupported_certificate:d="Unsupported certificate.";break;case l.Alert.Description.certificate_revoked:d="Certificate revoked.";break;case l.Alert.Description.certificate_expired:d="Certificate expired.";break;case l.Alert.Description.certificate_unknown:d="Certificate unknown.";break;case l.Alert.Description.illegal_parameter:d="Illegal parameter.";break;case l.Alert.Description.unknown_ca:d="Unknown certificate authority.";break;case l.Alert.Description.access_denied:d=
633
+"Access denied.";break;case l.Alert.Description.decode_error:d="Decode error.";break;case l.Alert.Description.decrypt_error:d="Decrypt error.";break;case l.Alert.Description.export_restriction:d="Export restriction.";break;case l.Alert.Description.protocol_version:d="Unsupported protocol version.";break;case l.Alert.Description.insufficient_security:d="Insufficient security.";break;case l.Alert.Description.internal_error:d="Internal error.";break;case l.Alert.Description.user_canceled:d="User canceled.";
634
+break;case l.Alert.Description.no_renegotiation:d="Renegotiation not supported.";break;default:d="Unknown error."}if(c.description===l.Alert.Description.close_notify)return a.close();a.error(a,{message:d,send:!1,origin:a.entity===l.ConnectionEnd.client?"server":"client",alert:c});a.process()};l.handleHandshake=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt24();if(g>d.length())return b.fragmented=c,c.fragment=a.util.createBuffer(),d.read-=4,b.process();b.fragmented=null;d.read-=4;var h=d.bytes(g+
635
+4);d.read+=4;e in Z[b.entity][b.expect]?(b.entity!==l.ConnectionEnd.server||b.open||b.fail||(b.handshaking=!0,b.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:a.md.md5.create(),sha1:a.md.sha1.create()}),e!==l.HandshakeType.hello_request&&e!==l.HandshakeType.certificate_verify&&e!==l.HandshakeType.finished&&(b.session.md5.update(h),b.session.sha1.update(h)),Z[b.entity][b.expect][e](b,c,g)):
636
+l.handleUnexpected(b,c)};l.handleApplicationData=function(a,b){a.data.putBuffer(b.fragment);a.dataReady(a);a.process()};l.handleHeartbeat=function(b,c){var d=c.fragment,e=d.getByte(),g=d.getInt16(),d=d.getBytes(g);if(e===l.HeartbeatMessageType.heartbeat_request){if(b.handshaking||g>d.length)return b.process();l.queue(b,l.createRecord(b,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_response,d)}));l.flush(b)}else if(e===l.HeartbeatMessageType.heartbeat_response){if(d!==
637
+b.expectedHeartbeatPayload)return b.process();b.heartbeatReceived&&b.heartbeatReceived(b,a.util.createBuffer(d))}b.process()};var g=1,r=2,u=3,D=4,z=5,x=6,F=7,G=8,E=1,A=2,y=3,C=4,M=5,ba=6,p=l.handleUnexpected,T=l.handleChangeCipherSpec,U=l.handleAlert,S=l.handleHandshake,ca=l.handleApplicationData,P=l.handleHeartbeat,R=[];R[l.ConnectionEnd.client]=[[p,U,S,p,P],[p,U,S,p,P],[p,U,S,p,P],[p,U,S,p,P],[p,U,S,p,P],[T,U,p,p,P],[p,U,S,p,P],[p,U,S,ca,P],[p,U,S,p,P]];R[l.ConnectionEnd.server]=[[p,U,S,p,P],[p,
638
+U,S,p,P],[p,U,S,p,P],[p,U,S,p,P],[T,U,p,p,P],[p,U,S,p,P],[p,U,S,ca,P],[p,U,S,p,P]];var T=l.handleHelloRequest,U=l.handleCertificate,S=l.handleServerKeyExchange,ca=l.handleCertificateRequest,P=l.handleServerHelloDone,V=l.handleFinished,Z=[];Z[l.ConnectionEnd.client]=[[p,p,l.handleServerHello,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,U,S,ca,P,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,S,ca,P,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,p,ca,P,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,p,p,P,p,p,p,
639
+p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,V],[T,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[T,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];Z[l.ConnectionEnd.server]=[[p,l.handleClientHello,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,U,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,l.handleClientKeyExchange,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,l.handleCertificateVerify,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,
640
+p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,V],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p],[p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p,p]];l.generateKeys=function(a,b){var d=b.client_random+b.server_random;a.session.resuming||(b.master_secret=c(b.pre_master_secret,"master secret",d,48).bytes(),b.pre_master_secret=null);var d=b.server_random+b.client_random,e=2*b.mac_key_length+2*b.enc_key_length,g=a.version.major===l.Versions.TLS_1_0.major&&a.version.minor===l.Versions.TLS_1_0.minor;g&&(e+=2*b.fixed_iv_length);
641
+d=c(b.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(b.mac_key_length),server_write_MAC_key:d.getBytes(b.mac_key_length),client_write_key:d.getBytes(b.enc_key_length),server_write_key:d.getBytes(b.enc_key_length)};g&&(e.client_write_IV=d.getBytes(b.fixed_iv_length),e.server_write_IV=d.getBytes(b.fixed_iv_length));return e};l.createConnectionState=function(a){var b=a.entity===l.ConnectionEnd.client,c=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,
642
+cipherState:null,cipherFunction:function(a){return!0},compressionState:null,compressFunction:function(a){return!0},updateSequenceNumber:function(){4294967295===a.sequenceNumber[1]?(a.sequenceNumber[1]=0,++a.sequenceNumber[0]):++a.sequenceNumber[1]}};return a},g={read:c(),write:c()};g.read.update=function(a,b){g.read.cipherFunction(b,g.read)?g.read.compressFunction(a,b,g.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.decompression_failure}}):
643
+a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_record_mac}});return!a.fail};g.write.update=function(a,b){g.write.compressFunction(a,b,g.write)?g.write.cipherFunction(b,g.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}});
644
+return!a.fail};if(a.session)switch(c=a.session.sp,a.session.cipherSuite.initSecurityParameters(c),c.keys=l.generateKeys(a,c),g.read.macKey=b?c.keys.server_write_MAC_key:c.keys.client_write_MAC_key,g.write.macKey=b?c.keys.client_write_MAC_key:c.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(g,a,c),c.compression_algorithm){case l.CompressionMethod.none:break;case l.CompressionMethod.deflate:g.read.compressFunction=e;g.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm.");
645
+}return g};l.createRandom=function(){var b=new Date,b=+b+6E4*b.getTimezoneOffset(),c=a.util.createBuffer();c.putInt32(b);c.putBytes(a.random.getBytes(28));return c};l.createRecord=function(a,b){return b.data?{type:b.type,version:{major:a.version.major,minor:a.version.minor},length:b.data.length(),fragment:b.data}:null};l.createAlert=function(b,c){var d=a.util.createBuffer();d.putByte(c.level);d.putByte(c.description);return l.createRecord(b,{type:l.ContentType.alert,data:d})};l.createClientHello=
646
+function(b){b.session.clientHelloVersion={major:b.version.major,minor:b.version.minor};for(var c=a.util.createBuffer(),d=0;d<b.cipherSuites.length;++d){var e=b.cipherSuites[d];c.putByte(e.id[0]);c.putByte(e.id[1])}var g=c.length(),d=a.util.createBuffer();d.putByte(l.CompressionMethod.none);var h=d.length(),e=a.util.createBuffer();if(b.virtualHost){var k=a.util.createBuffer();k.putByte(0);k.putByte(0);var m=a.util.createBuffer();m.putByte(0);q(m,2,a.util.createBuffer(b.virtualHost));var p=a.util.createBuffer();
647
+q(p,2,m);q(k,2,p);e.putBuffer(k)}k=e.length();0<k&&(k+=2);m=b.session.id;g=m.length+1+2+4+28+2+g+1+h+k;h=a.util.createBuffer();h.putByte(l.HandshakeType.client_hello);h.putInt24(g);h.putByte(b.version.major);h.putByte(b.version.minor);h.putBytes(b.session.sp.client_random);q(h,1,a.util.createBuffer(m));q(h,2,c);q(h,1,d);0<k&&q(h,2,e);return h};l.createServerHello=function(b){var c=b.session.id,d=c.length+1+2+4+28+2+1,e=a.util.createBuffer();e.putByte(l.HandshakeType.server_hello);e.putInt24(d);e.putByte(b.version.major);
648
+e.putByte(b.version.minor);e.putBytes(b.session.sp.server_random);q(e,1,a.util.createBuffer(c));e.putByte(b.session.cipherSuite.id[0]);e.putByte(b.session.cipherSuite.id[1]);e.putByte(b.session.compressionMethod);return e};l.createCertificate=function(b){var c=b.entity===l.ConnectionEnd.client,d=null;b.getCertificate&&(d=b.getCertificate(b,c?b.session.certificateRequest:b.session.extensions.server_name.serverNameList));var e=a.util.createBuffer();if(null!==d)try{a.util.isArray(d)||(d=[d]);for(var g=
649
+null,h=0;h<d.length;++h){var k=a.pem.decode(d[h])[0];if("CERTIFICATE"!==k.type&&"X509 CERTIFICATE"!==k.type&&"TRUSTED CERTIFICATE"!==k.type){var m=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');m.headerType=k.type;throw m;}if(k.procType&&"ENCRYPTED"===k.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var p=a.util.createBuffer(k.body);null===g&&(g=a.asn1.fromDer(p.bytes(),!1));
650
+var u=a.util.createBuffer();q(u,3,p);e.putBuffer(u)}d=a.pki.certificateFromAsn1(g);c?b.session.clientCertificate=d:b.session.serverCertificate=d}catch(y){return b.error(b,{message:"Could not send certificate list.",cause:y,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate}})}b=3+e.length();c=a.util.createBuffer();c.putByte(l.HandshakeType.certificate);c.putInt24(b);q(c,3,e);return c};l.createClientKeyExchange=function(b){var c=a.util.createBuffer();c.putByte(b.session.clientHelloVersion.major);
651
+c.putByte(b.session.clientHelloVersion.minor);c.putBytes(a.random.getBytes(46));var d=b.session.sp;d.pre_master_secret=c.getBytes();c=b.session.serverCertificate.publicKey.encrypt(d.pre_master_secret);b=c.length+2;d=a.util.createBuffer();d.putByte(l.HandshakeType.client_key_exchange);d.putInt24(b);d.putInt16(c.length);d.putBytes(c);return d};l.createServerKeyExchange=function(b){return a.util.createBuffer()};l.getClientSignature=function(b,c){var d=a.util.createBuffer();d.putBuffer(b.session.md5.digest());
652
+d.putBuffer(b.session.sha1.digest());d=d.getBytes();b.getSignature=b.getSignature||function(b,c,d){var e=null;if(b.getPrivateKey)try{e=b.getPrivateKey(b,b.session.clientCertificate),e=a.pki.privateKeyFromPem(e)}catch(g){b.error(b,{message:"Could not get private key.",cause:g,send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}})}null===e?b.error(b,{message:"No private key set.",send:!0,alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.internal_error}}):
653
+c=e.sign(c,null);d(b,c)};b.getSignature(b,d,c)};l.createCertificateVerify=function(b,c){var d=c.length+2,e=a.util.createBuffer();e.putByte(l.HandshakeType.certificate_verify);e.putInt24(d);e.putInt16(c.length);e.putBytes(c);return e};l.createCertificateRequest=function(b){var c=a.util.createBuffer();c.putByte(1);var d=a.util.createBuffer(),e;for(e in b.caStore.certs){var g=a.pki.distinguishedNameToAsn1(b.caStore.certs[e].subject);d.putBuffer(a.asn1.toDer(g))}b=1+c.length()+2+d.length();e=a.util.createBuffer();
654
+e.putByte(l.HandshakeType.certificate_request);e.putInt24(b);q(e,1,c);q(e,2,d);return e};l.createServerHelloDone=function(b){b=a.util.createBuffer();b.putByte(l.HandshakeType.server_hello_done);b.putInt24(0);return b};l.createChangeCipherSpec=function(){var b=a.util.createBuffer();b.putByte(1);return b};l.createFinished=function(b){var d=a.util.createBuffer();d.putBuffer(b.session.md5.digest());d.putBuffer(b.session.sha1.digest());d=c(b.session.sp.master_secret,b.entity===l.ConnectionEnd.client?"client finished":
655
+"server finished",d.getBytes(),12);b=a.util.createBuffer();b.putByte(l.HandshakeType.finished);b.putInt24(d.length());b.putBuffer(d);return b};l.createHeartbeat=function(b,c,d){"undefined"===typeof d&&(d=c.length);var e=a.util.createBuffer();e.putByte(b);e.putInt16(d);e.putBytes(c);b=e.length();e.putBytes(a.random.getBytes(Math.max(16,b-d-3)));return e};l.queue=function(b,c){if(c){if(c.type===l.ContentType.handshake){var d=c.fragment.bytes();b.session.md5.update(d);b.session.sha1.update(d)}if(c.fragment.length()<=
656
+l.MaxFragment)d=[c];else{for(var d=[],e=c.fragment.bytes();e.length>l.MaxFragment;)d.push(l.createRecord(b,{type:c.type,data:a.util.createBuffer(e.slice(0,l.MaxFragment))})),e=e.slice(l.MaxFragment);0<e.length&&d.push(l.createRecord(b,{type:c.type,data:a.util.createBuffer(e)}))}for(e=0;e<d.length&&!b.fail;++e){var g=d[e];b.state.current.write.update(b,g)&&b.records.push(g)}}};l.flush=function(a){for(var b=0;b<a.records.length;++b){var c=a.records[b];a.tlsData.putByte(c.type);a.tlsData.putByte(c.version.major);
657
+a.tlsData.putByte(c.version.minor);a.tlsData.putInt16(c.fragment.length());a.tlsData.putBuffer(a.records[b].fragment)}a.records=[];return a.tlsDataReady(a)};var aa=function(b){switch(b){case !0:return!0;case a.pki.certificateError.bad_certificate:return l.Alert.Description.bad_certificate;case a.pki.certificateError.unsupported_certificate:return l.Alert.Description.unsupported_certificate;case a.pki.certificateError.certificate_revoked:return l.Alert.Description.certificate_revoked;case a.pki.certificateError.certificate_expired:return l.Alert.Description.certificate_expired;
658
+case a.pki.certificateError.certificate_unknown:return l.Alert.Description.certificate_unknown;case a.pki.certificateError.unknown_ca:return l.Alert.Description.unknown_ca;default:return l.Alert.Description.bad_certificate}},N=function(b){switch(b){case !0:return!0;case l.Alert.Description.bad_certificate:return a.pki.certificateError.bad_certificate;case l.Alert.Description.unsupported_certificate:return a.pki.certificateError.unsupported_certificate;case l.Alert.Description.certificate_revoked:return a.pki.certificateError.certificate_revoked;
659
+case l.Alert.Description.certificate_expired:return a.pki.certificateError.certificate_expired;case l.Alert.Description.certificate_unknown:return a.pki.certificateError.certificate_unknown;case l.Alert.Description.unknown_ca:return a.pki.certificateError.unknown_ca;default:return a.pki.certificateError.bad_certificate}};l.verifyCertificateChain=function(b,c){try{a.pki.verifyCertificateChain(b.caStore,c,function(c,d,e){aa(c);d=b.verify(b,c,d,e);if(!0!==d){if("object"===typeof d&&!a.util.isArray(d))throw c=
660
+Error("The application rejected the certificate."),c.send=!0,c.alert={level:l.Alert.Level.fatal,description:l.Alert.Description.bad_certificate},d.message&&(c.message=d.message),d.alert&&(c.alert.description=d.alert),c;d!==c&&(d=N(d))}return d})}catch(d){var e=d;if("object"!==typeof e||a.util.isArray(e))e={send:!0,alert:{level:l.Alert.Level.fatal,description:aa(d)}};"send"in e||(e.send=!0);"alert"in e||(e.alert={level:l.Alert.Level.fatal,description:aa(e.error)});b.error(b,e)}return!b.fail};l.createSessionCache=
661
function(b,c){var d=null;if(b&&b.getSession&&b.setSession&&b.order)d=b;else{d={};d.cache=b||{};d.capacity=Math.max(c||100,1);d.order=[];for(var e in b)d.order.length<=c?d.order.push(e):delete b[e];d.getSession=function(b){var c=null,e=null;b?e=a.util.bytesToHex(b):0<d.order.length&&(e=d.order[0]);if(null!==e&&e in d.cache){c=d.cache[e];delete d.cache[e];for(var g in d.order)if(d.order[g]===e){d.order.splice(g,1);break}}return c};d.setSession=function(b,c){if(d.order.length===d.capacity){var e=d.order.shift();
662
-delete d.cache[e]}e=a.util.bytesToHex(b);d.order.push(e);d.cache[e]=c}}return d};k.createConnection=function(b){var c=null,c=b.caStore?a.util.isArray(b.caStore)?a.pki.createCaStore(b.caStore):b.caStore:a.pki.createCaStore(),d=b.cipherSuites||null;if(null===d){var d=[],e;for(e in k.CipherSuites)d.push(k.CipherSuites[e])}e=b.server?k.ConnectionEnd.server:k.ConnectionEnd.client;var g=b.sessionCache?k.createSessionCache(b.sessionCache):null,h={version:{major:k.Version.major,minor:k.Version.minor},entity:e,
662
+delete d.cache[e]}e=a.util.bytesToHex(b);d.order.push(e);d.cache[e]=c}}return d};l.createConnection=function(b){var c=null,c=b.caStore?a.util.isArray(b.caStore)?a.pki.createCaStore(b.caStore):b.caStore:a.pki.createCaStore(),d=b.cipherSuites||null;if(null===d){var d=[],e;for(e in l.CipherSuites)d.push(l.CipherSuites[e])}e=b.server?l.ConnectionEnd.server:l.ConnectionEnd.client;var g=b.sessionCache?l.createSessionCache(b.sessionCache):null,h={version:{major:l.Version.major,minor:l.Version.minor},entity:e,
663
sessionId:b.sessionId,caStore:c,sessionCache:g,cipherSuites:d,connected:b.connected,virtualHost:b.virtualHost||null,verifyClient:b.verifyClient||!1,verify:b.verify||function(a,b,c,d){return b},getCertificate:b.getCertificate||null,getPrivateKey:b.getPrivateKey||null,getSignature:b.getSignature||null,input:a.util.createBuffer(),tlsData:a.util.createBuffer(),data:a.util.createBuffer(),tlsDataReady:b.tlsDataReady,dataReady:b.dataReady,heartbeatReceived:b.heartbeatReceived,closed:b.closed,error:function(a,
664
-c){c.origin=c.origin||(a.entity===k.ConnectionEnd.client?"client":"server");c.send&&(k.queue(a,k.createAlert(a,c.alert)),k.flush(a));var d=!1!==c.fatal;d&&(a.fail=!0);b.error(a,c);d&&a.close(!1)},deflate:b.deflate||null,inflate:b.inflate||null,reset:function(a){h.version={major:k.Version.major,minor:k.Version.minor};h.record=null;h.session=null;h.peerCertificate=null;h.state={pending:null,current:null};h.expect=0;h.fragmented=null;h.records=[];h.open=!1;h.handshakes=0;h.handshaking=!1;h.isConnected=
665
-!1;h.fail=!(a||"undefined"===typeof a);h.input.clear();h.tlsData.clear();h.data.clear();h.state.current=k.createConnectionState(h)}};h.reset();h.handshake=function(b){if(h.entity!==k.ConnectionEnd.client)h.error(h,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(h.handshaking)h.error(h,{message:"Handshake already in progress.",fatal:!1});else{h.fail&&!h.open&&0===h.handshakes&&(h.fail=!1);h.handshaking=!0;b=b||"";var c=null;0<b.length&&(h.sessionCache&&(c=h.sessionCache.getSession(b)),
666
-null===c&&(b=""));0===b.length&&h.sessionCache&&(c=h.sessionCache.getSession(),null!==c&&(b=c.id));h.session={id:b,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()};c&&(h.version=c.version,h.session.sp=c.sp);h.session.sp.client_random=k.createRandom().getBytes();h.open=!0;k.queue(h,k.createRecord(h,{type:k.ContentType.handshake,data:k.createClientHello(h)}));k.flush(h)}};h.process=
664
+c){c.origin=c.origin||(a.entity===l.ConnectionEnd.client?"client":"server");c.send&&(l.queue(a,l.createAlert(a,c.alert)),l.flush(a));var d=!1!==c.fatal;d&&(a.fail=!0);b.error(a,c);d&&a.close(!1)},deflate:b.deflate||null,inflate:b.inflate||null,reset:function(a){h.version={major:l.Version.major,minor:l.Version.minor};h.record=null;h.session=null;h.peerCertificate=null;h.state={pending:null,current:null};h.expect=0;h.fragmented=null;h.records=[];h.open=!1;h.handshakes=0;h.handshaking=!1;h.isConnected=
665
+!1;h.fail=!(a||"undefined"===typeof a);h.input.clear();h.tlsData.clear();h.data.clear();h.state.current=l.createConnectionState(h)}};h.reset();h.handshake=function(b){if(h.entity!==l.ConnectionEnd.client)h.error(h,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(h.handshaking)h.error(h,{message:"Handshake already in progress.",fatal:!1});else{h.fail&&!h.open&&0===h.handshakes&&(h.fail=!1);h.handshaking=!0;b=b||"";var c=null;0<b.length&&(h.sessionCache&&(c=h.sessionCache.getSession(b)),
666
+null===c&&(b=""));0===b.length&&h.sessionCache&&(c=h.sessionCache.getSession(),null!==c&&(b=c.id));h.session={id:b,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:a.md.md5.create(),sha1:a.md.sha1.create()};c&&(h.version=c.version,h.session.sp=c.sp);h.session.sp.client_random=l.createRandom().getBytes();h.open=!0;l.queue(h,l.createRecord(h,{type:l.ContentType.handshake,data:l.createClientHello(h)}));l.flush(h)}};h.process=
667
function(b){var c=0;b&&h.input.putBytes(b);if(!h.fail){null!==h.record&&h.record.ready&&h.record.fragment.isEmpty()&&(h.record=null);if(null===h.record){c=0;b=h.input;var d=b.length();5>d?c=5-d:(h.record={type:b.getByte(),version:{major:b.getByte(),minor:b.getByte()},length:b.getInt16(),fragment:a.util.createBuffer(),ready:!1},(b=h.record.version.major===h.version.major)&&h.session&&h.session.version&&(b=h.record.version.minor===h.version.minor),b||h.error(h,{message:"Incompatible TLS version.",send:!0,
668
-alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.protocol_version}}))}if(!h.fail&&null!==h.record&&!h.record.ready){c=h;b=0;var d=c.input,e=d.length();e<c.record.length?b=c.record.length-e:(c.record.fragment.putBytes(d.getBytes(c.record.length)),d.compact(),c.state.current.read.update(c,c.record)&&(null!==c.fragmented&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,
669
-alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unexpected_message}})),c.record.ready=!0));c=b}if(!h.fail&&null!==h.record&&h.record.ready)if(b=h.record,d=b.type-k.ContentType.change_cipher_spec,e=R[h.entity][h.expect],d in e)e[d](h,b);else k.handleUnexpected(h,b)}return c};h.prepare=function(b){k.queue(h,k.createRecord(h,{type:k.ContentType.application_data,data:a.util.createBuffer(b)}));return k.flush(h)};h.prepareHeartbeatRequest=function(b,c){b instanceof a.util.ByteBuffer&&(b=
670
-b.bytes());"undefined"===typeof c&&(c=b.length);h.expectedHeartbeatPayload=b;k.queue(h,k.createRecord(h,{type:k.ContentType.heartbeat,data:k.createHeartbeat(k.HeartbeatMessageType.heartbeat_request,b,c)}));return k.flush(h)};h.close=function(a){if(!h.fail&&h.sessionCache&&h.session){var b={id:h.session.id,version:h.session.version,sp:h.session.sp};b.sp.keys=null;h.sessionCache.setSession(b.id,b)}if(h.open){h.open=!1;h.input.clear();if(h.isConnected||h.handshaking)h.isConnected=h.handshaking=!1,k.queue(h,
671
-k.createAlert(h,{level:k.Alert.Level.warning,description:k.Alert.Description.close_notify})),k.flush(h);h.closed(h)}h.reset(a)};return h};a.tls=a.tls||{};for(var Y in k)"function"!==typeof k[Y]&&(a.tls[Y]=k[Y]);a.tls.prf_tls1=c;a.tls.hmac_sha1=function(b,c,d){var e=a.hmac.create();e.start("SHA1",b);b=a.util.createBuffer();b.putInt32(c[0]);b.putInt32(c[1]);b.putByte(d.type);b.putByte(d.version.major);b.putByte(d.version.minor);b.putInt16(d.length);b.putBytes(d.fragment.bytes());e.update(b.getBytes());
672
-return e.digest().getBytes()};a.tls.createSessionCache=k.createSessionCache;a.tls.createConnection=k.createConnection}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.tls)return c.tls;c.defined.tls=!0;for(var l=0;l<e.length;++l)e[l](c);return c.tls}},
673
-u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/tls","require module ./asn1 ./hmac ./md ./pem ./pki ./random ./util".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,e,g){e=e.entity===a.tls.ConnectionEnd.client;b.read.cipherState={init:!1,cipher:a.cipher.createDecipher("AES-CBC",
674
-e?g.keys.server_write_key:g.keys.client_write_key),iv:e?g.keys.server_write_IV:g.keys.client_write_IV};b.write.cipherState={init:!1,cipher:a.cipher.createCipher("AES-CBC",e?g.keys.client_write_key:g.keys.server_write_key),iv:e?g.keys.client_write_IV:g.keys.server_write_IV};b.read.cipherFunction=h;b.write.cipherFunction=d;b.read.macLength=b.write.macLength=g.mac_length;b.read.macFunction=b.write.macFunction=l.hmac_sha1}function d(b,c){var g=!1,h=c.macFunction(c.macKey,c.sequenceNumber,b);b.fragment.putBytes(h);
675
-c.updateSequenceNumber();h=b.version.minor===l.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:a.random.getBytesSync(16);c.cipherState.init=!0;var k=c.cipherState.cipher;k.start({iv:h});b.version.minor>=l.Versions.TLS_1_1.minor&&k.output.putBytes(h);k.update(b.fragment);k.finish(e)&&(b.fragment=k.output,b.length=b.fragment.length(),g=!0);return g}function e(a,b,c){c||(a-=b.length()%a,b.fillWithByte(a-1,a));return!0}function k(a,b,c){a=!0;if(c){c=b.length();for(var d=b.last(),e=c-1-
676
-d;e<c-1;++e)a=a&&b.at(e)==d;a&&b.truncate(d+1)}return a}function h(b,c){var d=!1;++g;d=b.version.minor===l.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:b.fragment.getBytes(16);c.cipherState.init=!0;var e=c.cipherState.cipher;e.start({iv:d});e.update(b.fragment);var d=e.finish(k),h=c.macLength,m=a.random.getBytesSync(h),p=e.output.length();p>=h?(b.fragment=e.output.getBytes(p-h),m=e.output.getBytes(h)):b.fragment=e.output.getBytes();b.fragment=a.util.createBuffer(b.fragment);b.length=
677
-b.fragment.length();h=c.macFunction(c.macKey,c.sequenceNumber,b);c.updateSequenceNumber();e=c.macKey;p=a.hmac.create();p.start("SHA1",e);p.update(m);m=p.digest().getBytes();p.start(null,null);p.update(h);h=p.digest().getBytes();return m===h&&d}var l=a.tls;l.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=l.BulkCipherAlgorithm.aes;a.cipher_type=l.CipherType.block;a.enc_key_length=16;a.block_length=16;
668
+alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.protocol_version}}))}if(!h.fail&&null!==h.record&&!h.record.ready){c=h;b=0;var d=c.input,e=d.length();e<c.record.length?b=c.record.length-e:(c.record.fragment.putBytes(d.getBytes(c.record.length)),d.compact(),c.state.current.read.update(c,c.record)&&(null!==c.fragmented&&(c.fragmented.type===c.record.type?(c.fragmented.fragment.putBuffer(c.record.fragment),c.record=c.fragmented):c.error(c,{message:"Invalid fragmented record.",send:!0,
669
+alert:{level:l.Alert.Level.fatal,description:l.Alert.Description.unexpected_message}})),c.record.ready=!0));c=b}if(!h.fail&&null!==h.record&&h.record.ready)if(b=h.record,d=b.type-l.ContentType.change_cipher_spec,e=R[h.entity][h.expect],d in e)e[d](h,b);else l.handleUnexpected(h,b)}return c};h.prepare=function(b){l.queue(h,l.createRecord(h,{type:l.ContentType.application_data,data:a.util.createBuffer(b)}));return l.flush(h)};h.prepareHeartbeatRequest=function(b,c){b instanceof a.util.ByteBuffer&&(b=
670
+b.bytes());"undefined"===typeof c&&(c=b.length);h.expectedHeartbeatPayload=b;l.queue(h,l.createRecord(h,{type:l.ContentType.heartbeat,data:l.createHeartbeat(l.HeartbeatMessageType.heartbeat_request,b,c)}));return l.flush(h)};h.close=function(a){if(!h.fail&&h.sessionCache&&h.session){var b={id:h.session.id,version:h.session.version,sp:h.session.sp};b.sp.keys=null;h.sessionCache.setSession(b.id,b)}if(h.open){h.open=!1;h.input.clear();if(h.isConnected||h.handshaking)h.isConnected=h.handshaking=!1,l.queue(h,
671
+l.createAlert(h,{level:l.Alert.Level.warning,description:l.Alert.Description.close_notify})),l.flush(h);h.closed(h)}h.reset(a)};return h};a.tls=a.tls||{};for(var Y in l)"function"!==typeof l[Y]&&(a.tls[Y]=l[Y]);a.tls.prf_tls1=c;a.tls.hmac_sha1=function(b,c,d){var e=a.hmac.create();e.start("SHA1",b);b=a.util.createBuffer();b.putInt32(c[0]);b.putInt32(c[1]);b.putByte(d.type);b.putByte(d.version.major);b.putByte(d.version.minor);b.putInt16(d.length);b.putBytes(d.fragment.bytes());e.update(b.getBytes());
672
+return e.digest().getBytes()};a.tls.createSessionCache=l.createSessionCache;a.tls.createConnection=l.createConnection}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.tls)return c.tls;c.defined.tls=!0;for(var h=0;h<e.length;++h)e[h](c);return c.tls}},
673
+r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/tls","require module ./asn1 ./hmac ./md ./pem ./pki ./random ./util".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,e,g){e=e.entity===a.tls.ConnectionEnd.client;b.read.cipherState={init:!1,cipher:a.cipher.createDecipher("AES-CBC",
674
+e?g.keys.server_write_key:g.keys.client_write_key),iv:e?g.keys.server_write_IV:g.keys.client_write_IV};b.write.cipherState={init:!1,cipher:a.cipher.createCipher("AES-CBC",e?g.keys.client_write_key:g.keys.server_write_key),iv:e?g.keys.client_write_IV:g.keys.server_write_IV};b.read.cipherFunction=q;b.write.cipherFunction=d;b.read.macLength=b.write.macLength=g.mac_length;b.read.macFunction=b.write.macFunction=l.hmac_sha1}function d(b,c){var g=!1,h=c.macFunction(c.macKey,c.sequenceNumber,b);b.fragment.putBytes(h);
675
+c.updateSequenceNumber();h=b.version.minor===l.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:a.random.getBytesSync(16);c.cipherState.init=!0;var m=c.cipherState.cipher;m.start({iv:h});b.version.minor>=l.Versions.TLS_1_1.minor&&m.output.putBytes(h);m.update(b.fragment);m.finish(e)&&(b.fragment=m.output,b.length=b.fragment.length(),g=!0);return g}function e(a,b,c){c||(a-=b.length()%a,b.fillWithByte(a-1,a));return!0}function h(a,b,c){a=!0;if(c){c=b.length();for(var d=b.last(),e=c-1-
676
+d;e<c-1;++e)a=a&&b.at(e)==d;a&&b.truncate(d+1)}return a}function q(b,c){var d=!1;++g;d=b.version.minor===l.Versions.TLS_1_0.minor?c.cipherState.init?null:c.cipherState.iv:b.fragment.getBytes(16);c.cipherState.init=!0;var e=c.cipherState.cipher;e.start({iv:d});e.update(b.fragment);var d=e.finish(h),k=c.macLength,m=a.random.getBytesSync(k),r=e.output.length();r>=k?(b.fragment=e.output.getBytes(r-k),m=e.output.getBytes(k)):b.fragment=e.output.getBytes();b.fragment=a.util.createBuffer(b.fragment);b.length=
677
+b.fragment.length();k=c.macFunction(c.macKey,c.sequenceNumber,b);c.updateSequenceNumber();e=c.macKey;r=a.hmac.create();r.start("SHA1",e);r.update(m);m=r.digest().getBytes();r.start(null,null);r.update(k);k=r.digest().getBytes();return m===k&&d}var l=a.tls;l.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA={id:[0,47],name:"TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=l.BulkCipherAlgorithm.aes;a.cipher_type=l.CipherType.block;a.enc_key_length=16;a.block_length=16;
678
a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=l.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=20},initConnectionState:c};l.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA={id:[0,53],name:"TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters:function(a){a.bulk_cipher_algorithm=l.BulkCipherAlgorithm.aes;a.cipher_type=l.CipherType.block;a.enc_key_length=32;a.block_length=16;a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=l.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=
679
-20},initConnectionState:c};var g=0}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aesCipherSuites)return c.aesCipherSuites;c.defined.aesCipherSuites=!0;for(var l=0;l<e.length;++l)e[l](c);return c.aesCipherSuites}},u=a;a=function(b,c){k="string"===
680
-typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/aesCipherSuites",["require","module","./aes","./tls"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.debug=a.debug||{};a.debug.storage={};a.debug.get=function(b,c){var d;"undefined"===typeof b?d=a.debug.storage:b in a.debug.storage&&(d="undefined"===typeof c?a.debug.storage[b]:
681
-a.debug.storage[b][c]);return d};a.debug.set=function(b,c,d){b in a.debug.storage||(a.debug.storage[b]={});a.debug.storage[b][c]=d};a.debug.clear=function(b,c){"undefined"===typeof b?a.debug.storage={}:b in a.debug.storage&&("undefined"===typeof c?delete a.debug.storage[b]:delete a.debug.storage[b][c])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=
682
-function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.debug)return c.debug;c.defined.debug=!0;for(var l=0;l<e.length;++l)e[l](c);return c.debug}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/debug",["require","module"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();
683
-(function(){function b(a){function c(b,d,e,k){b.generate=function(b,c){for(var l=new a.util.ByteBuffer,m=Math.ceil(c/k)+e,p=new a.util.ByteBuffer,u=e;u<m;++u){p.putInt32(u);d.start();d.update(b+p.getBytes());var x=d.digest();l.putBytes(x.getBytes(k))}l.truncate(l.length()-c);return l.getBytes()}}a.kem=a.kem||{};var d=a.jsbn.BigInteger;a.kem.rsa={};a.kem.rsa.create=function(b,c){c=c||{};var e=c.prng||a.random;return{encrypt:function(c,g){var k=Math.ceil(c.n.bitLength()/8),l;do l=(new d(a.util.bytesToHex(e.getBytesSync(k)),
684
-16)).mod(c.n);while(l.equals(d.ZERO));l=a.util.hexToBytes(l.toString(16));k-=l.length;0<k&&(l=a.util.fillString(String.fromCharCode(0),k)+l);k=c.encrypt(l,"NONE");l=b.generate(l,g);return{encapsulation:k,key:l}},decrypt:function(a,c,d){a=a.decrypt(c,"NONE");return b.generate(a,d)}}};a.kem.kdf1=function(a,b){c(this,a,0,b||a.digestLength)};a.kem.kdf2=function(a,b){c(this,a,1,b||a.digestLength)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===
685
-typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.kem)return c.kem;c.defined.kem=!0;for(var l=0;l<e.length;++l)e[l](c);return c.kem}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/kem",["require","module","./util","./random",
686
-"./jsbn"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.log=a.log||{};a.log.levels="none error warning info debug verbose max".split(" ");var c={},d=[],e=null;a.log.LEVEL_LOCKED=2;a.log.NO_LEVEL_CHECK=4;a.log.INTERPOLATE=8;for(var k=0;k<a.log.levels.length;++k){var h=a.log.levels[k];c[h]={index:k,name:h.toUpperCase()}}a.log.logMessage=function(b){for(var e=c[b.level].index,h=0;h<d.length;++h){var k=d[h];k.flags&a.log.NO_LEVEL_CHECK?k.f(b):e<=c[k.level].index&&
687
-k.f(k,b)}};a.log.prepareStandard=function(a){"standard"in a||(a.standard=c[a.level].name+" ["+a.category+"] "+a.message)};a.log.prepareFull=function(b){if(!("full"in b)){var c=[b.message],c=c.concat([]);b.full=a.util.format.apply(this,c)}};a.log.prepareStandardFull=function(b){"standardFull"in b||(a.log.prepareStandard(b),b.standardFull=b.standard)};h=["error","warning","info","debug","verbose"];for(k=0;k<h.length;++k)(function(b){a.log[b]=function(c,d){var e=Array.prototype.slice.call(arguments).slice(2);
688
-a.log.logMessage({timestamp:new Date,level:b,category:c,message:d,arguments:e})}})(h[k]);a.log.makeLogger=function(b){b={flags:0,f:b};a.log.setLevel(b,"none");return b};a.log.setLevel=function(b,c){var d=!1;if(b&&!(b.flags&a.log.LEVEL_LOCKED))for(var e=0;e<a.log.levels.length;++e)if(c==a.log.levels[e]){b.level=c;d=!0;break}return d};a.log.lock=function(b,c){b.flags="undefined"===typeof c||c?b.flags|a.log.LEVEL_LOCKED:b.flags&~a.log.LEVEL_LOCKED};a.log.addLogger=function(a){d.push(a)};if("undefined"!==
679
+20},initConnectionState:c};var g=0}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.aesCipherSuites)return c.aesCipherSuites;c.defined.aesCipherSuites=!0;for(var h=0;h<e.length;++h)e[h](c);return c.aesCipherSuites}},r=a;a=function(b,c){q="string"===
680
+typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/aesCipherSuites",["require","module","./aes","./tls"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.debug=a.debug||{};a.debug.storage={};a.debug.get=function(b,c){var d;"undefined"===typeof b?d=a.debug.storage:b in a.debug.storage&&(d="undefined"===typeof c?a.debug.storage[b]:
681
+a.debug.storage[b][c]);return d};a.debug.set=function(b,c,d){b in a.debug.storage||(a.debug.storage[b]={});a.debug.storage[b][c]=d};a.debug.clear=function(b,c){"undefined"===typeof b?a.debug.storage={}:b in a.debug.storage&&("undefined"===typeof c?delete a.debug.storage[b]:delete a.debug.storage[b][c])}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=
682
+function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.debug)return c.debug;c.defined.debug=!0;for(var h=0;h<e.length;++h)e[h](c);return c.debug}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/debug",["require","module"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();
683
+(function(){function b(a){function c(b,d,e,h){b.generate=function(b,c){for(var k=new a.util.ByteBuffer,m=Math.ceil(c/h)+e,q=new a.util.ByteBuffer,r=e;r<m;++r){q.putInt32(r);d.start();d.update(b+q.getBytes());var F=d.digest();k.putBytes(F.getBytes(h))}k.truncate(k.length()-c);return k.getBytes()}}a.kem=a.kem||{};var d=a.jsbn.BigInteger;a.kem.rsa={};a.kem.rsa.create=function(b,c){c=c||{};var e=c.prng||a.random;return{encrypt:function(c,g){var h=Math.ceil(c.n.bitLength()/8),m;do m=(new d(a.util.bytesToHex(e.getBytesSync(h)),
684
+16)).mod(c.n);while(m.equals(d.ZERO));m=a.util.hexToBytes(m.toString(16));h-=m.length;0<h&&(m=a.util.fillString(String.fromCharCode(0),h)+m);h=c.encrypt(m,"NONE");m=b.generate(m,g);return{encapsulation:h,key:m}},decrypt:function(a,c,d){a=a.decrypt(c,"NONE");return b.generate(a,d)}}};a.kem.kdf1=function(a,b){c(this,a,0,b||a.digestLength)};a.kem.kdf2=function(a,b){c(this,a,1,b||a.digestLength)}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===
685
+typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.kem)return c.kem;c.defined.kem=!0;for(var h=0;h<e.length;++h)e[h](c);return c.kem}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/kem",["require","module","./util","./random",
686
+"./jsbn"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){a.log=a.log||{};a.log.levels="none error warning info debug verbose max".split(" ");var c={},d=[],e=null;a.log.LEVEL_LOCKED=2;a.log.NO_LEVEL_CHECK=4;a.log.INTERPOLATE=8;for(var h=0;h<a.log.levels.length;++h){var q=a.log.levels[h];c[q]={index:h,name:q.toUpperCase()}}a.log.logMessage=function(b){for(var e=c[b.level].index,h=0;h<d.length;++h){var k=d[h];k.flags&a.log.NO_LEVEL_CHECK?k.f(b):e<=c[k.level].index&&
687
+k.f(k,b)}};a.log.prepareStandard=function(a){"standard"in a||(a.standard=c[a.level].name+" ["+a.category+"] "+a.message)};a.log.prepareFull=function(b){if(!("full"in b)){var c=[b.message],c=c.concat([]);b.full=a.util.format.apply(this,c)}};a.log.prepareStandardFull=function(b){"standardFull"in b||(a.log.prepareStandard(b),b.standardFull=b.standard)};q=["error","warning","info","debug","verbose"];for(h=0;h<q.length;++h)(function(b){a.log[b]=function(c,d){var e=Array.prototype.slice.call(arguments).slice(2);
688
+a.log.logMessage({timestamp:new Date,level:b,category:c,message:d,arguments:e})}})(q[h]);a.log.makeLogger=function(b){b={flags:0,f:b};a.log.setLevel(b,"none");return b};a.log.setLevel=function(b,c){var d=!1;if(b&&!(b.flags&a.log.LEVEL_LOCKED))for(var e=0;e<a.log.levels.length;++e)if(c==a.log.levels[e]){b.level=c;d=!0;break}return d};a.log.lock=function(b,c){b.flags="undefined"===typeof c||c?b.flags|a.log.LEVEL_LOCKED:b.flags&~a.log.LEVEL_LOCKED};a.log.addLogger=function(a){d.push(a)};if("undefined"!==
689
typeof console&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug)var l={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},e=function(b,c){a.log.prepareStandard(c);var d=l[c.level],e=[c.standard],e=e.concat(c.arguments.slice());d.apply(console,e)};else e=function(b,c){a.log.prepareStandardFull(c);console.log(c.standardFull)};e=a.log.makeLogger(e);a.log.setLevel(e,"debug");a.log.addLogger(e)}else console={log:function(){}};
690
-null!==e&&(k=a.util.getQueryVariables(),"console.level"in k&&a.log.setLevel(e,k["console.level"].slice(-1)[0]),"console.lock"in k&&"true"==k["console.lock"].slice(-1)[0]&&a.log.lock(e));a.log.consoleLogger=e}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.log)return c.log;
691
-c.defined.log=!0;for(var l=0;l<e.length;++l)e[l](c);return c.log}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/log",["require","module","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b){var d={},e=[];if(!r.validate(b,E.asn1.recipientInfoValidator,d,e))throw b=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."),
692
-b.errors=e,b;return{version:d.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(d.issuer),serialNumber:a.util.createBuffer(d.serial).toHex(),encryptedContent:{algorithm:r.derToOid(d.encAlgorithm),parameter:d.encParameter.value,content:d.encKey}}}function d(b){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(b.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:b.issuer}),
693
-r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber))]),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.encryptedContent.algorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]),r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,b.encryptedContent.content)])}function e(a){for(var b=[],c=0;c<a.length;++c)b.push(d(a[c]));return b}function k(b){var c=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,
694
-r.Type.INTEGER,!1,r.integerToDer(b.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:b.issuer}),r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber))]),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.digestAlgorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")])]);b.authenticatedAttributesAsn1&&c.value.push(b.authenticatedAttributesAsn1);c.value.push(r.create(r.Class.UNIVERSAL,
695
-r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.signatureAlgorithm).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.NULL,!1,"")]));c.value.push(r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,b.signature));if(0<b.unauthenticatedAttributes.length){for(var d=r.create(r.Class.CONTEXT_SPECIFIC,1,!0,[]),e=0;e<b.unauthenticatedAttributes.length;++e)d.values.push(h(b.unauthenticatedAttributes[e]));c.value.push(d)}return c}function h(b){var c;if(b.type===a.pki.oids.contentType)c=
696
-r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.value).getBytes());else if(b.type===a.pki.oids.messageDigest)c=r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,b.value.bytes());else if(b.type===a.pki.oids.signingTime){c=new Date("Jan 1, 1950 00:00:00Z");var d=new Date("Jan 1, 2050 00:00:00Z"),e=b.value;if("string"===typeof e)var g=Date.parse(e),e=isNaN(g)?13===e.length?r.utcTimeToDate(e):r.generalizedTimeToDate(e):new Date(g);c=e>=c&&e<d?r.create(r.Class.UNIVERSAL,r.Type.UTCTIME,!1,r.dateToUtcTime(e)):
697
-r.create(r.Class.UNIVERSAL,r.Type.GENERALIZEDTIME,!1,r.dateToGeneralizedTime(e))}return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.type).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[c])])}function l(b){return[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.pki.oids.data).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.algorithm).getBytes()),r.create(r.Class.UNIVERSAL,
698
-r.Type.OCTETSTRING,!1,b.parameter.getBytes())]),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,b.content.getBytes())])]}function g(b,c,d){var e={};if(!r.validate(c,d,e,[]))throw b=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."),b.errors=b,b;if(r.derToOid(e.contentType)!==a.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(e.encryptedContent){c="";if(a.util.isArray(e.encryptedContent))for(d=
699
-0;d<e.encryptedContent.length;++d){if(e.encryptedContent[d].type!==r.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");c+=e.encryptedContent[d].value}else c=e.encryptedContent;b.encryptedContent={algorithm:r.derToOid(e.encAlgorithm),parameter:a.util.createBuffer(e.encParameter.value),content:a.util.createBuffer(c)}}if(e.content){c="";if(a.util.isArray(e.content))for(d=0;d<e.content.length;++d){if(e.content[d].type!==r.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");
700
-c+=e.content[d].value}else c=e.content;b.content=a.util.createBuffer(c)}b.version=e.version.charCodeAt(0);return b.rawCapture=e}function u(b){if(void 0===b.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===b.content){var c;switch(b.encryptedContent.algorithm){case a.pki.oids["aes128-CBC"]:case a.pki.oids["aes192-CBC"]:case a.pki.oids["aes256-CBC"]:c=a.aes.createDecryptionCipher(b.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids["des-EDE3-CBC"]:c=a.des.createDecryptionCipher(b.encryptedContent.key);
701
-break;default:throw Error("Unsupported symmetric cipher, OID "+b.encryptedContent.algorithm);}c.start(b.encryptedContent.parameter);c.update(b.encryptedContent.content);if(!c.finish())throw Error("Symmetric decryption failed.");b.content=c.output}}var r=a.asn1,E=a.pkcs7=a.pkcs7||{};E.messageFromPem=function(b){b=a.pem.decode(b)[0];if("PKCS7"!==b.type){var c=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');c.headerType=b.type;throw c;}if(b.procType&&"ENCRYPTED"===
702
-b.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");b=r.fromDer(b.body);return E.messageFromAsn1(b)};E.messageToPem=function(b,c){var d={type:"PKCS7",body:r.toDer(b.toAsn1()).getBytes()};return a.pem.encode(d,{maxline:c})};E.messageFromAsn1=function(b){var c={},d=[];if(!r.validate(b,E.asn1.contentInfoValidator,c,d))throw c=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."),c.errors=d,c;d=r.derToOid(c.contentType);switch(d){case a.pki.oids.envelopedData:d=
703
-E.createEnvelopedData();break;case a.pki.oids.encryptedData:d=E.createEncryptedData();break;case a.pki.oids.signedData:d=E.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+d+" is not (yet) supported.");}d.fromAsn1(c.content.value[0]);return d};E.createSignedData=function(){var b=null;return b={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(c){g(b,
704
-c,E.asn1.signedDataValidator);b.certificates=[];b.crls=[];b.digestAlgorithmIdentifiers=[];b.contentInfo=null;b.signerInfos=[];c=b.rawCapture.certificates.value;for(var d=0;d<c.length;++d)b.certificates.push(a.pki.certificateFromAsn1(c[d]))},toAsn1:function(){b.contentInfo||b.sign();for(var c=[],d=0;d<b.certificates.length;++d)c.push(a.pki.certificateToAsn1(b.certificates[d]));var d=[],e=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,
705
-r.Type.INTEGER,!1,r.integerToDer(b.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,b.digestAlgorithmIdentifiers),b.contentInfo])]);0<c.length&&e.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,0,!0,c));0<d.length&&e.value[0].value.push(r.create(r.Class.CONTEXT_SPECIFIC,1,!0,d));e.value[0].value.push(r.create(r.Class.UNIVERSAL,r.Type.SET,!0,b.signerInfos));return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.type).getBytes()),
690
+null!==e&&(h=a.util.getQueryVariables(),"console.level"in h&&a.log.setLevel(e,h["console.level"].slice(-1)[0]),"console.lock"in h&&"true"==h["console.lock"].slice(-1)[0]&&a.log.lock(e));a.log.consoleLogger=e}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.log)return c.log;
691
+c.defined.log=!0;for(var h=0;h<e.length;++h)e[h](c);return c.log}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/log",["require","module","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b){var d={},e=[];if(!u.validate(b,D.asn1.recipientInfoValidator,d,e))throw b=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."),
692
+b.errors=e,b;return{version:d.version.charCodeAt(0),issuer:a.pki.RDNAttributesAsArray(d.issuer),serialNumber:a.util.createBuffer(d.serial).toHex(),encryptedContent:{algorithm:u.derToOid(d.encAlgorithm),parameter:d.encParameter.value,content:d.encKey}}}function d(b){return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,u.integerToDer(b.version).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:b.issuer}),
693
+u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber))]),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.encryptedContent.algorithm).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.NULL,!1,"")]),u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,b.encryptedContent.content)])}function e(a){for(var b=[],c=0;c<a.length;++c)b.push(d(a[c]));return b}function h(b){var c=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,
694
+u.Type.INTEGER,!1,u.integerToDer(b.version).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[a.pki.distinguishedNameToAsn1({attributes:b.issuer}),u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,a.util.hexToBytes(b.serialNumber))]),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.digestAlgorithm).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.NULL,!1,"")])]);b.authenticatedAttributesAsn1&&c.value.push(b.authenticatedAttributesAsn1);c.value.push(u.create(u.Class.UNIVERSAL,
695
+u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.signatureAlgorithm).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.NULL,!1,"")]));c.value.push(u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,b.signature));if(0<b.unauthenticatedAttributes.length){for(var d=u.create(u.Class.CONTEXT_SPECIFIC,1,!0,[]),e=0;e<b.unauthenticatedAttributes.length;++e)d.values.push(q(b.unauthenticatedAttributes[e]));c.value.push(d)}return c}function q(b){var c;if(b.type===a.pki.oids.contentType)c=
696
+u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.value).getBytes());else if(b.type===a.pki.oids.messageDigest)c=u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,b.value.bytes());else if(b.type===a.pki.oids.signingTime){c=new Date("Jan 1, 1950 00:00:00Z");var d=new Date("Jan 1, 2050 00:00:00Z"),e=b.value;if("string"===typeof e)var g=Date.parse(e),e=isNaN(g)?13===e.length?u.utcTimeToDate(e):u.generalizedTimeToDate(e):new Date(g);c=e>=c&&e<d?u.create(u.Class.UNIVERSAL,u.Type.UTCTIME,!1,u.dateToUtcTime(e)):
697
+u.create(u.Class.UNIVERSAL,u.Type.GENERALIZEDTIME,!1,u.dateToGeneralizedTime(e))}return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.type).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SET,!0,[c])])}function l(b){return[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(a.pki.oids.data).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.algorithm).getBytes()),u.create(u.Class.UNIVERSAL,
698
+u.Type.OCTETSTRING,!1,b.parameter.getBytes())]),u.create(u.Class.CONTEXT_SPECIFIC,0,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,b.content.getBytes())])]}function g(b,c,d){var e={};if(!u.validate(c,d,e,[]))throw b=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."),b.errors=b,b;if(u.derToOid(e.contentType)!==a.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(e.encryptedContent){c="";if(a.util.isArray(e.encryptedContent))for(d=
699
+0;d<e.encryptedContent.length;++d){if(e.encryptedContent[d].type!==u.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");c+=e.encryptedContent[d].value}else c=e.encryptedContent;b.encryptedContent={algorithm:u.derToOid(e.encAlgorithm),parameter:a.util.createBuffer(e.encParameter.value),content:a.util.createBuffer(c)}}if(e.content){c="";if(a.util.isArray(e.content))for(d=0;d<e.content.length;++d){if(e.content[d].type!==u.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");
700
+c+=e.content[d].value}else c=e.content;b.content=a.util.createBuffer(c)}b.version=e.version.charCodeAt(0);return b.rawCapture=e}function r(b){if(void 0===b.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===b.content){var c;switch(b.encryptedContent.algorithm){case a.pki.oids["aes128-CBC"]:case a.pki.oids["aes192-CBC"]:case a.pki.oids["aes256-CBC"]:c=a.aes.createDecryptionCipher(b.encryptedContent.key);break;case a.pki.oids.desCBC:case a.pki.oids["des-EDE3-CBC"]:c=a.des.createDecryptionCipher(b.encryptedContent.key);
701
+break;default:throw Error("Unsupported symmetric cipher, OID "+b.encryptedContent.algorithm);}c.start(b.encryptedContent.parameter);c.update(b.encryptedContent.content);if(!c.finish())throw Error("Symmetric decryption failed.");b.content=c.output}}var u=a.asn1,D=a.pkcs7=a.pkcs7||{};D.messageFromPem=function(b){b=a.pem.decode(b)[0];if("PKCS7"!==b.type){var c=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');c.headerType=b.type;throw c;}if(b.procType&&"ENCRYPTED"===
702
+b.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");b=u.fromDer(b.body);return D.messageFromAsn1(b)};D.messageToPem=function(b,c){var d={type:"PKCS7",body:u.toDer(b.toAsn1()).getBytes()};return a.pem.encode(d,{maxline:c})};D.messageFromAsn1=function(b){var c={},d=[];if(!u.validate(b,D.asn1.contentInfoValidator,c,d))throw c=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."),c.errors=d,c;d=u.derToOid(c.contentType);switch(d){case a.pki.oids.envelopedData:d=
703
+D.createEnvelopedData();break;case a.pki.oids.encryptedData:d=D.createEncryptedData();break;case a.pki.oids.signedData:d=D.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+d+" is not (yet) supported.");}d.fromAsn1(c.content.value[0]);return d};D.createSignedData=function(){var b=null;return b={type:a.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(c){g(b,
704
+c,D.asn1.signedDataValidator);b.certificates=[];b.crls=[];b.digestAlgorithmIdentifiers=[];b.contentInfo=null;b.signerInfos=[];c=b.rawCapture.certificates.value;for(var d=0;d<c.length;++d)b.certificates.push(a.pki.certificateFromAsn1(c[d]))},toAsn1:function(){b.contentInfo||b.sign();for(var c=[],d=0;d<b.certificates.length;++d)c.push(a.pki.certificateToAsn1(b.certificates[d]));var d=[],e=u.create(u.Class.CONTEXT_SPECIFIC,0,!0,[u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,
705
+u.Type.INTEGER,!1,u.integerToDer(b.version).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SET,!0,b.digestAlgorithmIdentifiers),b.contentInfo])]);0<c.length&&e.value[0].value.push(u.create(u.Class.CONTEXT_SPECIFIC,0,!0,c));0<d.length&&e.value[0].value.push(u.create(u.Class.CONTEXT_SPECIFIC,1,!0,d));e.value[0].value.push(u.create(u.Class.UNIVERSAL,u.Type.SET,!0,b.signerInfos));return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.type).getBytes()),
706
e])},addSigner:function(c){var d=c.issuer,e=c.serialNumber;c.certificate&&(e=c.certificate,"string"===typeof e&&(e=a.pki.certificateFromPem(e)),d=e.issuer.attributes,e=e.serialNumber);var g=c.key;if(!g)throw Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof g&&(g=a.pki.privateKeyFromPem(g));var h=c.digestAlgorithm||a.pki.oids.sha1;switch(h){case a.pki.oids.sha1:case a.pki.oids.sha256:case a.pki.oids.sha384:case a.pki.oids.sha512:case a.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+
707
-h);}c=c.authenticatedAttributes||[];if(0<c.length){for(var k=!1,l=!1,m=0;m<c.length;++m){var r=c[m];if(!k&&r.type===a.pki.oids.contentType){if(k=!0,l)break}else if(!l&&r.type===a.pki.oids.messageDigest&&(l=!0,k))break}if(!k||!l)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.");}b.signers.push({key:g,version:1,issuer:d,serialNumber:e,digestAlgorithm:h,
708
-signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(){if("object"!==typeof b.content||null===b.contentInfo)if(b.contentInfo=r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(a.pki.oids.data).getBytes())]),"content"in b){var c;b.content instanceof a.util.ByteBuffer?c=b.content.bytes():"string"===typeof b.content&&(c=a.util.encodeUtf8(b.content));b.contentInfo.value.push(r.create(r.Class.CONTEXT_SPECIFIC,
709
-0,!0,[r.create(r.Class.UNIVERSAL,r.Type.OCTETSTRING,!1,c)]))}if(0!==b.signers.length){c={};for(var d=0;d<b.signers.length;++d){var e=b.signers[d],g=e.digestAlgorithm;g in c||(c[g]=a.md[a.pki.oids[g]].create());e.md=0===e.authenticatedAttributes.length?c[g]:a.md[a.pki.oids[g]].create()}b.digestAlgorithmIdentifiers=[];for(g in c)b.digestAlgorithmIdentifiers.push(r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(g).getBytes()),r.create(r.Class.UNIVERSAL,
710
-r.Type.NULL,!1,"")]));if(2>b.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var g=r.derToOid(b.contentInfo.value[0].value),d=b.contentInfo.value[1],d=d.value[0],l=r.toDer(d);l.getByte();r.getBerValueLength(l);var l=l.getBytes(),m;for(m in c)c[m].start().update(l);m=new Date;for(d=0;d<b.signers.length;++d){e=b.signers[d];if(0===e.authenticatedAttributes.length){if(g!==a.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
711
-}else{e.authenticatedAttributesAsn1=r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var l=r.create(r.Class.UNIVERSAL,r.Type.SET,!0,[]),p=0;p<e.authenticatedAttributes.length;++p){var u=e.authenticatedAttributes[p];u.type===a.pki.oids.messageDigest?u.value=c[e.digestAlgorithm].digest():u.type!==a.pki.oids.signingTime||u.value||(u.value=m);l.value.push(h(u));e.authenticatedAttributesAsn1.value.push(h(u))}l=r.toDer(l).getBytes();e.md.start().update(l)}e.signature=e.key.sign(e.md,"RSASSA-PKCS1-V1_5")}c=
712
-b;g=b.signers;m=[];for(d=0;d<g.length;++d)m.push(k(g[d]));c.signerInfos=m}},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.");},addCertificate:function(c){"string"===typeof c&&(c=a.pki.certificateFromPem(c));b.certificates.push(c)},addCertificateRevokationList:function(a){throw Error("PKCS#7 CRL support not yet implemented.");}}};E.createEncryptedData=function(){var b=null;return b={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},
713
-fromAsn1:function(a){g(b,a,E.asn1.encryptedDataValidator)},decrypt:function(a){void 0!==a&&(b.encryptedContent.key=a);u(b)}}};E.createEnvelopedData=function(){var b=null;return b={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(a){var d=g(b,a,E.asn1.envelopedDataValidator);a=b;for(var d=d.recipientInfos.value,e=[],h=0;h<d.length;++h)e.push(c(d[h]));a.recipients=e},toAsn1:function(){return r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,
714
-!0,[r.create(r.Class.UNIVERSAL,r.Type.OID,!1,r.oidToDer(b.type).getBytes()),r.create(r.Class.CONTEXT_SPECIFIC,0,!0,[r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,[r.create(r.Class.UNIVERSAL,r.Type.INTEGER,!1,r.integerToDer(b.version).getBytes()),r.create(r.Class.UNIVERSAL,r.Type.SET,!0,e(b.recipients)),r.create(r.Class.UNIVERSAL,r.Type.SEQUENCE,!0,l(b.encryptedContent))])])])},findRecipient:function(a){for(var c=a.issuer.attributes,d=0;d<b.recipients.length;++d){var e=b.recipients[d],g=e.issuer;if(e.serialNumber===
707
+h);}c=c.authenticatedAttributes||[];if(0<c.length){for(var k=!1,l=!1,m=0;m<c.length;++m){var q=c[m];if(!k&&q.type===a.pki.oids.contentType){if(k=!0,l)break}else if(!l&&q.type===a.pki.oids.messageDigest&&(l=!0,k))break}if(!k||!l)throw Error("Invalid signer.authenticatedAttributes. If signer.authenticatedAttributes is specified, then it must contain at least two attributes, PKCS #9 content-type and PKCS #9 message-digest.");}b.signers.push({key:g,version:1,issuer:d,serialNumber:e,digestAlgorithm:h,
708
+signatureAlgorithm:a.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:c,unauthenticatedAttributes:[]})},sign:function(){if("object"!==typeof b.content||null===b.contentInfo)if(b.contentInfo=u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(a.pki.oids.data).getBytes())]),"content"in b){var c;b.content instanceof a.util.ByteBuffer?c=b.content.bytes():"string"===typeof b.content&&(c=a.util.encodeUtf8(b.content));b.contentInfo.value.push(u.create(u.Class.CONTEXT_SPECIFIC,
709
+0,!0,[u.create(u.Class.UNIVERSAL,u.Type.OCTETSTRING,!1,c)]))}if(0!==b.signers.length){c={};for(var d=0;d<b.signers.length;++d){var e=b.signers[d],g=e.digestAlgorithm;g in c||(c[g]=a.md[a.pki.oids[g]].create());e.md=0===e.authenticatedAttributes.length?c[g]:a.md[a.pki.oids[g]].create()}b.digestAlgorithmIdentifiers=[];for(g in c)b.digestAlgorithmIdentifiers.push(u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(g).getBytes()),u.create(u.Class.UNIVERSAL,
710
+u.Type.NULL,!1,"")]));if(2>b.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var g=u.derToOid(b.contentInfo.value[0].value),d=b.contentInfo.value[1],d=d.value[0],k=u.toDer(d);k.getByte();u.getBerValueLength(k);var k=k.getBytes(),l;for(l in c)c[l].start().update(k);l=new Date;for(d=0;d<b.signers.length;++d){e=b.signers[d];if(0===e.authenticatedAttributes.length){if(g!==a.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
711
+}else{e.authenticatedAttributesAsn1=u.create(u.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var k=u.create(u.Class.UNIVERSAL,u.Type.SET,!0,[]),m=0;m<e.authenticatedAttributes.length;++m){var r=e.authenticatedAttributes[m];r.type===a.pki.oids.messageDigest?r.value=c[e.digestAlgorithm].digest():r.type!==a.pki.oids.signingTime||r.value||(r.value=l);k.value.push(q(r));e.authenticatedAttributesAsn1.value.push(q(r))}k=u.toDer(k).getBytes();e.md.start().update(k)}e.signature=e.key.sign(e.md,"RSASSA-PKCS1-V1_5")}c=
712
+b;g=b.signers;l=[];for(d=0;d<g.length;++d)l.push(h(g[d]));c.signerInfos=l}},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.");},addCertificate:function(c){"string"===typeof c&&(c=a.pki.certificateFromPem(c));b.certificates.push(c)},addCertificateRevokationList:function(a){throw Error("PKCS#7 CRL support not yet implemented.");}}};D.createEncryptedData=function(){var b=null;return b={type:a.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},
713
+fromAsn1:function(a){g(b,a,D.asn1.encryptedDataValidator)},decrypt:function(a){void 0!==a&&(b.encryptedContent.key=a);r(b)}}};D.createEnvelopedData=function(){var b=null;return b={type:a.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:a.pki.oids["aes256-CBC"]},fromAsn1:function(a){var d=g(b,a,D.asn1.envelopedDataValidator);a=b;for(var d=d.recipientInfos.value,e=[],h=0;h<d.length;++h)e.push(c(d[h]));a.recipients=e},toAsn1:function(){return u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,
714
+!0,[u.create(u.Class.UNIVERSAL,u.Type.OID,!1,u.oidToDer(b.type).getBytes()),u.create(u.Class.CONTEXT_SPECIFIC,0,!0,[u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,[u.create(u.Class.UNIVERSAL,u.Type.INTEGER,!1,u.integerToDer(b.version).getBytes()),u.create(u.Class.UNIVERSAL,u.Type.SET,!0,e(b.recipients)),u.create(u.Class.UNIVERSAL,u.Type.SEQUENCE,!0,l(b.encryptedContent))])])])},findRecipient:function(a){for(var c=a.issuer.attributes,d=0;d<b.recipients.length;++d){var e=b.recipients[d],g=e.issuer;if(e.serialNumber===
715
a.serialNumber&&g.length===c.length){for(var h=!0,k=0;k<c.length;++k)if(g[k].type!==c[k].type||g[k].value!==c[k].value){h=!1;break}if(h)return e}}return null},decrypt:function(c,d){if(void 0===b.encryptedContent.key&&void 0!==c&&void 0!==d)switch(c.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:case a.pki.oids.desCBC:var e=d.decrypt(c.encryptedContent.content);b.encryptedContent.key=a.util.createBuffer(e);break;default:throw Error("Unsupported asymmetric cipher, OID "+c.encryptedContent.algorithm);
716
-}u(b)},addRecipient:function(c){b.recipients.push({version:0,issuer:c.issuer.attributes,serialNumber:c.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:c.publicKey}})},encrypt:function(c,d){if(void 0===b.encryptedContent.content){d=d||b.encryptedContent.algorithm;c=c||b.encryptedContent.key;var e,g,h;switch(d){case a.pki.oids["aes128-CBC"]:g=e=16;h=a.aes.createEncryptionCipher;break;case a.pki.oids["aes192-CBC"]:e=24;g=16;h=a.aes.createEncryptionCipher;break;case a.pki.oids["aes256-CBC"]:e=
716
+}r(b)},addRecipient:function(c){b.recipients.push({version:0,issuer:c.issuer.attributes,serialNumber:c.serialNumber,encryptedContent:{algorithm:a.pki.oids.rsaEncryption,key:c.publicKey}})},encrypt:function(c,d){if(void 0===b.encryptedContent.content){d=d||b.encryptedContent.algorithm;c=c||b.encryptedContent.key;var e,g,h;switch(d){case a.pki.oids["aes128-CBC"]:g=e=16;h=a.aes.createEncryptionCipher;break;case a.pki.oids["aes192-CBC"]:e=24;g=16;h=a.aes.createEncryptionCipher;break;case a.pki.oids["aes256-CBC"]:e=
717
32;g=16;h=a.aes.createEncryptionCipher;break;case a.pki.oids["des-EDE3-CBC"]:e=24;g=8;h=a.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+d);}if(void 0===c)c=a.util.createBuffer(a.random.getBytes(e));else if(c.length()!=e)throw Error("Symmetric key has wrong length; got "+c.length()+" bytes, expected "+e+".");b.encryptedContent.algorithm=d;b.encryptedContent.key=c;b.encryptedContent.parameter=a.util.createBuffer(a.random.getBytes(g));e=h(c);e.start(b.encryptedContent.parameter.copy());
718
e.update(b.content);if(!e.finish())throw Error("Symmetric encryption failed.");b.encryptedContent.content=e.output}for(e=0;e<b.recipients.length;++e)if(g=b.recipients[e],void 0===g.encryptedContent.content)switch(g.encryptedContent.algorithm){case a.pki.oids.rsaEncryption:g.encryptedContent.content=g.encryptedContent.key.encrypt(b.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+g.encryptedContent.algorithm);}}}}}if("function"!==typeof a)if("object"===typeof module&&
719
-module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs7)return c.pkcs7;c.defined.pkcs7=!0;for(var l=0;l<e.length;++l)e[l](c);return c.pkcs7}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,
720
-Array.prototype.slice.call(arguments,0))};a("js/pkcs7","require module ./aes ./asn1 ./des ./oids ./pem ./pkcs7asn1 ./random ./util ./x509".split(" "),function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d){var e=d.toString(16);"8"<=e[0]&&(e="00"+e);e=a.util.hexToBytes(e);b.putInt32(e.length);b.putBytes(e)}function d(a,b){a.putInt32(b.length);a.putString(b)}function e(){for(var b=a.md.sha1.create(),c=arguments.length,d=0;d<c;++d)b.update(arguments[d]);
721
-return b.digest()}var k=a.ssh=a.ssh||{};k.privateKeyToPutty=function(b,k,g){g=g||"";k=k||"";var l=""===k?"none":"aes256-cbc",r;r="PuTTY-User-Key-File-2: ssh-rsa\r\n"+("Encryption: "+l+"\r\n")+("Comment: "+g+"\r\n");var u=a.util.createBuffer();d(u,"ssh-rsa");c(u,b.e);c(u,b.n);var w=a.util.encode64(u.bytes(),64),B=Math.floor(w.length/66)+1;r+="Public-Lines: "+B+"\r\n";r+=w;w=a.util.createBuffer();c(w,b.d);c(w,b.p);c(w,b.q);c(w,b.qInv);k?(B=w.length()+16-1,B-=B%16,b=e(w.bytes()),b.truncate(b.length()-
722
-B+w.length()),w.putBuffer(b),B=a.util.createBuffer(),B.putBuffer(e("\x00\x00\x00\x00",k)),B.putBuffer(e("\x00\x00\x00\u0001",k)),B=a.aes.createEncryptionCipher(B.truncate(8),"CBC"),B.start(a.util.createBuffer().fillWithByte(0,16)),B.update(w.copy()),B.finish(),B=B.output,B.truncate(16),b=a.util.encode64(B.bytes(),64)):b=a.util.encode64(w.bytes(),64);B=Math.floor(b.length/66)+1;r+="\r\nPrivate-Lines: "+B+"\r\n";r+=b;k=e("putty-private-key-file-mac-key",k);B=a.util.createBuffer();d(B,"ssh-rsa");d(B,
723
-l);d(B,g);B.putInt32(u.length());B.putBuffer(u);B.putInt32(w.length());B.putBuffer(w);g=a.hmac.create();g.start("sha1",k);g.update(B.bytes());return r+="\r\nPrivate-MAC: "+g.digest().toHex()+"\r\n"};k.publicKeyToOpenSSH=function(b,e){e=e||"";var g=a.util.createBuffer();d(g,"ssh-rsa");c(g,b.e);c(g,b.n);return"ssh-rsa "+a.util.encode64(g.bytes())+" "+e};k.privateKeyToOpenSSH=function(b,c){return c?a.pki.encryptRsaPrivateKey(b,c,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(b)};k.getPublicKeyFingerprint=
724
-function(b,e){e=e||{};var g=e.md||a.md.md5.create(),k=a.util.createBuffer();d(k,"ssh-rsa");c(k,b.e);c(k,b.n);g.start();g.update(k.getBytes());g=g.digest();if("hex"===e.encoding)return g=g.toHex(),e.delimiter?g.match(/.{2}/g).join(e.delimiter):g;if("binary"===e.encoding)return g.getBytes();if(e.encoding)throw Error('Unknown encoding "'+e.encoding+'".');return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&
725
-(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.ssh)return c.ssh;c.defined.ssh=!0;for(var l=0;l<e.length;++l)e[l](c);return c.ssh}},u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/ssh","require module ./aes ./hmac ./md5 ./sha1 ./util".split(" "),
726
-function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c={},d=0;a.debug.set("forge.task","tasks",c);var e={};a.debug.set("forge.task","queues",e);var k={ready:{}};k.ready.stop="ready";k.ready.start="running";k.ready.cancel="done";k.ready.fail="error";k.running={};k.running.stop="ready";k.running.start="running";k.running.block="blocked";k.running.unblock="running";k.running.sleep="sleeping";k.running.wakeup="running";k.running.cancel="done";k.running.fail=
727
-"error";k.blocked={};k.blocked.stop="blocked";k.blocked.start="blocked";k.blocked.block="blocked";k.blocked.unblock="blocked";k.blocked.sleep="blocked";k.blocked.wakeup="blocked";k.blocked.cancel="done";k.blocked.fail="error";k.sleeping={};k.sleeping.stop="sleeping";k.sleeping.start="sleeping";k.sleeping.block="sleeping";k.sleeping.unblock="sleeping";k.sleeping.sleep="sleeping";k.sleeping.wakeup="sleeping";k.sleeping.cancel="done";k.sleeping.fail="error";k.done={};k.done.stop="done";k.done.start=
728
-"done";k.done.block="done";k.done.unblock="done";k.done.sleep="done";k.done.wakeup="done";k.done.cancel="done";k.done.fail="error";k.error={};k.error.stop="error";k.error.start="error";k.error.block="error";k.error.unblock="error";k.error.sleep="error";k.error.wakeup="error";k.error.cancel="error";k.error.fail="error";var h=function(a){this.id=-1;this.name=a.name||"?";this.parent=a.parent||null;this.run=a.run;this.subtasks=[];this.error=!1;this.state="ready";this.blocks=0;this.userData=this.swapTime=
729
-this.timeoutId=null;this.id=d++;c[this.id]=this};h.prototype.debug=function(b){a.log.debug("forge.task",b||"","[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",e)};h.prototype.next=function(a,b){"function"===typeof a&&(b=a,a=this.name);var c=new h({run:b,name:a,parent:this});c.state="running";c.type=this.type;c.successCallback=this.successCallback||null;c.failureCallback=this.failureCallback||null;this.subtasks.push(c);return this};h.prototype.parallel=function(b,c){a.util.isArray(b)&&
730
-(c=b,b=this.name);return this.next(b,function(d){d.block(c.length);for(var e=function(b,e){a.task.start({type:b,run:function(a){c[e](a)},success:function(a){d.unblock()},failure:function(a){d.unblock()}})},g=0;g<c.length;g++)e(b+"__parallel-"+d.id+"-"+g,g)})};h.prototype.stop=function(){this.state=k[this.state].stop};h.prototype.start=function(){this.error=!1;this.state=k[this.state].start;"running"===this.state&&(this.start=new Date,this.run(this),g(this,0))};h.prototype.block=function(a){this.blocks+=
731
-"undefined"===typeof a?1:a;0<this.blocks&&(this.state=k[this.state].block)};h.prototype.unblock=function(a){this.blocks-="undefined"===typeof a?1:a;0===this.blocks&&"done"!==this.state&&(this.state="running",g(this,0));return this.blocks};h.prototype.sleep=function(a){this.state=k[this.state].sleep;var b=this;this.timeoutId=setTimeout(function(){b.timeoutId=null;b.state="running";g(b,0)},"undefined"===typeof a?0:a)};h.prototype.wait=function(a){a.wait(this)};h.prototype.wakeup=function(){"sleeping"===
732
-this.state&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state="running",g(this,0))};h.prototype.cancel=function(){this.state=k[this.state].cancel;this.permitsNeeded=0;null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null);this.subtasks=[]};h.prototype.fail=function(a){this.error=!0;u(this,!0);if(a)a.error=this.error,a.swapTime=this.swapTime,a.userData=this.userData,g(a,0);else{if(null!==this.parent){for(a=this.parent;null!==a.parent;)a.error=this.error,a.swapTime=this.swapTime,
733
-a.userData=this.userData,a=a.parent;u(a,!0)}this.failureCallback&&this.failureCallback(this)}};var l=function(a){a.error=!1;a.state=k[a.state].start;setTimeout(function(){"running"===a.state&&(a.swapTime=+new Date,a.run(a),g(a,0))},0)},g=function(a,b){var c=30<b||20<+new Date-a.swapTime,d=function(b){b++;if("running"===a.state)if(c&&(a.swapTime=+new Date),0<a.subtasks.length){var d=a.subtasks.shift();d.error=a.error;d.swapTime=a.swapTime;d.userData=a.userData;d.run(d);d.error||g(d,b)}else u(a),a.error||
734
-null===a.parent||(a.parent.error=a.error,a.parent.swapTime=a.swapTime,a.parent.userData=a.userData,g(a.parent,b))};c?setTimeout(d,0):d(b)},u=function(b,d){b.state="done";delete c[b.id];null===b.parent&&(b.type in e?0===e[b.type].length?a.log.error("forge.task","[%s][%s] task queue empty [%s]",b.id,b.name,b.type):e[b.type][0]!==b?a.log.error("forge.task","[%s][%s] task not first in queue [%s]",b.id,b.name,b.type):(e[b.type].shift(),0===e[b.type].length?delete e[b.type]:e[b.type][0].start()):a.log.error("forge.task",
735
-"[%s][%s] task queue missing [%s]",b.id,b.name,b.type),d||(b.error&&b.failureCallback?b.failureCallback(b):!b.error&&b.successCallback&&b.successCallback(b)))};a.task=a.task||{};a.task.start=function(a){var b=new h({run:a.run,name:a.name||"?"});b.type=a.type;b.successCallback=a.success||null;b.failureCallback=a.failure||null;b.type in e?e[a.type].push(b):(e[b.type]=[b],l(b))};a.task.cancel=function(a){a in e&&(e[a]=[e[a][0]])};a.task.createCondition=function(){var a={tasks:{},wait:function(b){b.id in
736
-a.tasks||(b.block(),a.tasks[b.id]=b)},notify:function(){var b=a.tasks;a.tasks={};for(var c in b)b[c].unblock()}};return a}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var k,l=function(a,c){c.exports=function(c){var e=k.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.task)return c.task;c.defined.task=!0;for(var l=0;l<e.length;++l)e[l](c);return c.task}},
737
-u=a;a=function(b,c){k="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,u.apply(null,Array.prototype.slice.call(arguments,0));a=u;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/task",["require","module","./debug","./log","./util"],function(){l.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){if("function"!==typeof a)if("object"===typeof module&&module.exports){var b=!0;a=function(a,b){b(c,module)}}else{"undefined"===typeof forge&&(forge={disableNativeCode:!1});
738
-return}var e,k=function(a,b){b.exports=function(b){var c=e.map(function(b){return a(b)});b=b||{};b.defined=b.defined||{};if(b.defined.forge)return b.forge;b.defined.forge=!0;for(var d=0;d<c.length;++d)c[d](b);return b};b.exports.disableNativeCode=!0;b.exports(b.exports)},l=a;a=function(c,k){e="string"===typeof c?k.slice(2):c.slice(2);if(b)return delete a,l.apply(null,Array.prototype.slice.call(arguments,0));a=l;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/forge","require module ./aes ./aesCipherSuites ./asn1 ./cipher ./cipherModes ./debug ./des ./hmac ./kem ./log ./md ./mgf1 ./pbkdf2 ./pem ./pkcs7 ./pkcs1 ./pkcs12 ./pki ./prime ./prng ./pss ./random ./rc2 ./ssh ./task ./tls ./util".split(" "),
739
-function(){k.apply(null,Array.prototype.slice.call(arguments,0))})})();return c("js/forge")});function amtcert_linkCertPrivateKey(b,c){for(var a in b){var d=b[a];try{if(0==xxCertPrivateKeys.length)break;for(var e=forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(d.X509Certificate)).publicKey).substring(60).replace(/(\r\n|\n|\r)/gm,""),k=0;k<c.length;k++)e===c[k].DERKey+"-----END PUBLIC KEY-----"&&(c[k].XCert=d,d.XPrivateKey=c[k])}catch(l){console.log(l)}}}
740
-function amtcert_loadP12File(b,c,a){try{var d=window.forge.util.decode64(btoa(b)),e=window.forge.asn1.fromDer(d),k=window.forge.pkcs12.pkcs12FromAsn1(e,c),l=k.getBags({bagType:window.forge.pki.oids.pkcs8ShroudedKeyBag});console.assert(l[window.forge.pki.oids.pkcs8ShroudedKeyBag]&&0<l[window.forge.pki.oids.pkcs8ShroudedKeyBag].length);var u=l[window.forge.pki.oids.pkcs8ShroudedKeyBag][0].key,n=window.forge.pki.privateKeyToAsn1(u),p=window.forge.pki.wrapRsaPrivateKey(n);window.forge.asn1.toDer(p).getBytes();
741
-var x=k.getBags({bagType:window.forge.pki.oids.certBag})[window.forge.pki.oids.certBag][0].cert.subject.attributes,m=k.getBags({bagType:forge.pki.oids.certBag})[forge.pki.oids.certBag][0].cert;a(u,x,m);return!0}catch(w){}return!1}function amtcert_signWithCaKey(b,c,a,d,e){c&&null!=c||(c=amtcert_createCertificate(d).key);return amtcert_createCertificate(a,c,b,d,e)}
742
-function amtcert_createCertificate(b,c,a,d,e){var k,l=forge.pki.createCertificate();a?l.publicKey=forge.pki.publicKeyFromPem("-----BEGIN PUBLIC KEY-----"+a+"-----END PUBLIC KEY-----"):(k=forge.pki.rsa.generateKeyPair(2048),l.publicKey=k.publicKey);l.serialNumber=""+Math.floor(1E5*Math.random()+1);l.validity.notBefore=new Date;l.validity.notBefore.setFullYear(l.validity.notBefore.getFullYear()-1);l.validity.notAfter=new Date;l.validity.notAfter.setFullYear(l.validity.notAfter.getFullYear()+30);var u=
743
-[];b.CN&&u.push({name:"commonName",value:b.CN});b.C&&u.push({name:"countryName",value:b.C});b.ST&&u.push({shortName:"ST",value:b.ST});b.O&&u.push({name:"organizationName",value:b.O});l.setSubject(u);c?(b=[],d.CN&&b.push({name:"commonName",value:d.CN}),d.C&&b.push({name:"countryName",value:d.C}),d.ST&&b.push({shortName:"ST",value:d.ST}),d.O&&b.push({name:"organizationName",value:d.O}),l.setIssuer(b)):l.setIssuer(u);void 0==c?l.setExtensions([{name:"basicConstraints",cA:!0},{name:"nsCertType",sslCA:!0,
744
-emailCA:!0,objCA:!0},{name:"subjectKeyIdentifier"}]):(null==e?e={name:"extKeyUsage",serverAuth:!0}:e.name="extKeyUsage",l.setExtensions([{name:"basicConstraints"},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},e,{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0},{name:"subjectKeyIdentifier"}]));c?l.sign(c,forge.md.sha256.create()):l.sign(k.privateKey,forge.md.sha256.create());return a?l:{cert:l,key:k.privateKey}}
719
+module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.pkcs7)return c.pkcs7;c.defined.pkcs7=!0;for(var h=0;h<e.length;++h)e[h](c);return c.pkcs7}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,
720
+Array.prototype.slice.call(arguments,0))};a("js/pkcs7","require module ./aes ./asn1 ./des ./oids ./pem ./pkcs7asn1 ./random ./util ./x509".split(" "),function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(b,d){var e=d.toString(16);"8"<=e[0]&&(e="00"+e);e=a.util.hexToBytes(e);b.putInt32(e.length);b.putBytes(e)}function d(a,b){a.putInt32(b.length);a.putString(b)}function e(){for(var b=a.md.sha1.create(),c=arguments.length,d=0;d<c;++d)b.update(arguments[d]);
721
+return b.digest()}var h=a.ssh=a.ssh||{};h.privateKeyToPutty=function(b,h,g){g=g||"";h=h||"";var q=""===h?"none":"aes256-cbc",u;u="PuTTY-User-Key-File-2: ssh-rsa\r\n"+("Encryption: "+q+"\r\n")+("Comment: "+g+"\r\n");var r=a.util.createBuffer();d(r,"ssh-rsa");c(r,b.e);c(r,b.n);var z=a.util.encode64(r.bytes(),64),v=Math.floor(z.length/66)+1;u+="Public-Lines: "+v+"\r\n";u+=z;z=a.util.createBuffer();c(z,b.d);c(z,b.p);c(z,b.q);c(z,b.qInv);h?(v=z.length()+16-1,v-=v%16,b=e(z.bytes()),b.truncate(b.length()-
722
+v+z.length()),z.putBuffer(b),v=a.util.createBuffer(),v.putBuffer(e("\x00\x00\x00\x00",h)),v.putBuffer(e("\x00\x00\x00\u0001",h)),v=a.aes.createEncryptionCipher(v.truncate(8),"CBC"),v.start(a.util.createBuffer().fillWithByte(0,16)),v.update(z.copy()),v.finish(),v=v.output,v.truncate(16),b=a.util.encode64(v.bytes(),64)):b=a.util.encode64(z.bytes(),64);v=Math.floor(b.length/66)+1;u+="\r\nPrivate-Lines: "+v+"\r\n";u+=b;h=e("putty-private-key-file-mac-key",h);v=a.util.createBuffer();d(v,"ssh-rsa");d(v,
723
+q);d(v,g);v.putInt32(r.length());v.putBuffer(r);v.putInt32(z.length());v.putBuffer(z);g=a.hmac.create();g.start("sha1",h);g.update(v.bytes());return u+="\r\nPrivate-MAC: "+g.digest().toHex()+"\r\n"};h.publicKeyToOpenSSH=function(b,e){e=e||"";var g=a.util.createBuffer();d(g,"ssh-rsa");c(g,b.e);c(g,b.n);return"ssh-rsa "+a.util.encode64(g.bytes())+" "+e};h.privateKeyToOpenSSH=function(b,c){return c?a.pki.encryptRsaPrivateKey(b,c,{legacy:!0,algorithm:"aes128"}):a.pki.privateKeyToPem(b)};h.getPublicKeyFingerprint=
724
+function(b,e){e=e||{};var g=e.md||a.md.md5.create(),h=a.util.createBuffer();d(h,"ssh-rsa");c(h,b.e);c(h,b.n);g.start();g.update(h.getBytes());g=g.digest();if("hex"===e.encoding)return g=g.toHex(),e.delimiter?g.match(/.{2}/g).join(e.delimiter):g;if("binary"===e.encoding)return g.getBytes();if(e.encoding)throw Error('Unknown encoding "'+e.encoding+'".');return g}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&
725
+(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.ssh)return c.ssh;c.defined.ssh=!0;for(var h=0;h<e.length;++h)e[h](c);return c.ssh}},r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/ssh","require module ./aes ./hmac ./md5 ./sha1 ./util".split(" "),
726
+function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){var c={},d=0;a.debug.set("forge.task","tasks",c);var e={};a.debug.set("forge.task","queues",e);var h={ready:{}};h.ready.stop="ready";h.ready.start="running";h.ready.cancel="done";h.ready.fail="error";h.running={};h.running.stop="ready";h.running.start="running";h.running.block="blocked";h.running.unblock="running";h.running.sleep="sleeping";h.running.wakeup="running";h.running.cancel="done";h.running.fail=
727
+"error";h.blocked={};h.blocked.stop="blocked";h.blocked.start="blocked";h.blocked.block="blocked";h.blocked.unblock="blocked";h.blocked.sleep="blocked";h.blocked.wakeup="blocked";h.blocked.cancel="done";h.blocked.fail="error";h.sleeping={};h.sleeping.stop="sleeping";h.sleeping.start="sleeping";h.sleeping.block="sleeping";h.sleeping.unblock="sleeping";h.sleeping.sleep="sleeping";h.sleeping.wakeup="sleeping";h.sleeping.cancel="done";h.sleeping.fail="error";h.done={};h.done.stop="done";h.done.start=
728
+"done";h.done.block="done";h.done.unblock="done";h.done.sleep="done";h.done.wakeup="done";h.done.cancel="done";h.done.fail="error";h.error={};h.error.stop="error";h.error.start="error";h.error.block="error";h.error.unblock="error";h.error.sleep="error";h.error.wakeup="error";h.error.cancel="error";h.error.fail="error";var q=function(a){this.id=-1;this.name=a.name||"?";this.parent=a.parent||null;this.run=a.run;this.subtasks=[];this.error=!1;this.state="ready";this.blocks=0;this.userData=this.swapTime=
729
+this.timeoutId=null;this.id=d++;c[this.id]=this};q.prototype.debug=function(b){a.log.debug("forge.task",b||"","[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",e)};q.prototype.next=function(a,b){"function"===typeof a&&(b=a,a=this.name);var c=new q({run:b,name:a,parent:this});c.state="running";c.type=this.type;c.successCallback=this.successCallback||null;c.failureCallback=this.failureCallback||null;this.subtasks.push(c);return this};q.prototype.parallel=function(b,c){a.util.isArray(b)&&
730
+(c=b,b=this.name);return this.next(b,function(d){d.block(c.length);for(var e=function(b,e){a.task.start({type:b,run:function(a){c[e](a)},success:function(a){d.unblock()},failure:function(a){d.unblock()}})},g=0;g<c.length;g++)e(b+"__parallel-"+d.id+"-"+g,g)})};q.prototype.stop=function(){this.state=h[this.state].stop};q.prototype.start=function(){this.error=!1;this.state=h[this.state].start;"running"===this.state&&(this.start=new Date,this.run(this),g(this,0))};q.prototype.block=function(a){this.blocks+=
731
+"undefined"===typeof a?1:a;0<this.blocks&&(this.state=h[this.state].block)};q.prototype.unblock=function(a){this.blocks-="undefined"===typeof a?1:a;0===this.blocks&&"done"!==this.state&&(this.state="running",g(this,0));return this.blocks};q.prototype.sleep=function(a){this.state=h[this.state].sleep;var b=this;this.timeoutId=setTimeout(function(){b.timeoutId=null;b.state="running";g(b,0)},"undefined"===typeof a?0:a)};q.prototype.wait=function(a){a.wait(this)};q.prototype.wakeup=function(){"sleeping"===
732
+this.state&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state="running",g(this,0))};q.prototype.cancel=function(){this.state=h[this.state].cancel;this.permitsNeeded=0;null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null);this.subtasks=[]};q.prototype.fail=function(a){this.error=!0;r(this,!0);if(a)a.error=this.error,a.swapTime=this.swapTime,a.userData=this.userData,g(a,0);else{if(null!==this.parent){for(a=this.parent;null!==a.parent;)a.error=this.error,a.swapTime=this.swapTime,
733
+a.userData=this.userData,a=a.parent;r(a,!0)}this.failureCallback&&this.failureCallback(this)}};var l=function(a){a.error=!1;a.state=h[a.state].start;setTimeout(function(){"running"===a.state&&(a.swapTime=+new Date,a.run(a),g(a,0))},0)},g=function(a,b){var c=30<b||20<+new Date-a.swapTime,d=function(b){b++;if("running"===a.state)if(c&&(a.swapTime=+new Date),0<a.subtasks.length){var d=a.subtasks.shift();d.error=a.error;d.swapTime=a.swapTime;d.userData=a.userData;d.run(d);d.error||g(d,b)}else r(a),a.error||
734
+null===a.parent||(a.parent.error=a.error,a.parent.swapTime=a.swapTime,a.parent.userData=a.userData,g(a.parent,b))};c?setTimeout(d,0):d(b)},r=function(b,d){b.state="done";delete c[b.id];null===b.parent&&(b.type in e?0===e[b.type].length?a.log.error("forge.task","[%s][%s] task queue empty [%s]",b.id,b.name,b.type):e[b.type][0]!==b?a.log.error("forge.task","[%s][%s] task not first in queue [%s]",b.id,b.name,b.type):(e[b.type].shift(),0===e[b.type].length?delete e[b.type]:e[b.type][0].start()):a.log.error("forge.task",
735
+"[%s][%s] task queue missing [%s]",b.id,b.name,b.type),d||(b.error&&b.failureCallback?b.failureCallback(b):!b.error&&b.successCallback&&b.successCallback(b)))};a.task=a.task||{};a.task.start=function(a){var b=new q({run:a.run,name:a.name||"?"});b.type=a.type;b.successCallback=a.success||null;b.failureCallback=a.failure||null;b.type in e?e[a.type].push(b):(e[b.type]=[b],l(b))};a.task.cancel=function(a){a in e&&(e[a]=[e[a][0]])};a.task.createCondition=function(){var a={tasks:{},wait:function(b){b.id in
736
+a.tasks||(b.block(),a.tasks[b.id]=b)},notify:function(){var b=a.tasks;a.tasks={};for(var c in b)b[c].unblock()}};return a}}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge={}),b(forge);var q,h=function(a,c){c.exports=function(c){var e=q.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.task)return c.task;c.defined.task=!0;for(var h=0;h<e.length;++h)e[h](c);return c.task}},
737
+r=a;a=function(b,c){q="string"===typeof b?c.slice(2):b.slice(2);if(e)return delete a,r.apply(null,Array.prototype.slice.call(arguments,0));a=r;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/task",["require","module","./debug","./log","./util"],function(){h.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){if("function"!==typeof a)if("object"===typeof module&&module.exports){var b=!0;a=function(a,b){b(c,module)}}else{"undefined"===typeof forge&&(forge={disableNativeCode:!1});
738
+return}var e,q=function(a,b){b.exports=function(b){var c=e.map(function(b){return a(b)});b=b||{};b.defined=b.defined||{};if(b.defined.forge)return b.forge;b.defined.forge=!0;for(var d=0;d<c.length;++d)c[d](b);return b};b.exports.disableNativeCode=!0;b.exports(b.exports)},h=a;a=function(c,n){e="string"===typeof c?n.slice(2):c.slice(2);if(b)return delete a,h.apply(null,Array.prototype.slice.call(arguments,0));a=h;return a.apply(null,Array.prototype.slice.call(arguments,0))};a("js/forge","require module ./aes ./aesCipherSuites ./asn1 ./cipher ./cipherModes ./debug ./des ./hmac ./kem ./log ./md ./mgf1 ./pbkdf2 ./pem ./pkcs7 ./pkcs1 ./pkcs12 ./pki ./prime ./prng ./pss ./random ./rc2 ./ssh ./task ./tls ./util".split(" "),
739
+function(){q.apply(null,Array.prototype.slice.call(arguments,0))})})();return c("js/forge")});function amtcert_linkCertPrivateKey(b,c){for(var a in b){var d=b[a];try{if(0==xxCertPrivateKeys.length)break;for(var e=forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(d.X509Certificate)).publicKey).substring(60).replace(/(\r\n|\n|\r)/gm,""),q=0;q<c.length;q++)e===c[q].DERKey+"-----END PUBLIC KEY-----"&&(c[q].XCert=d,d.XPrivateKey=c[q])}catch(h){console.log(h)}}}
740
+function amtcert_loadP12File(b,c,a){try{var d=window.forge.util.decode64(btoa(b)),e=window.forge.asn1.fromDer(d),q=window.forge.pkcs12.pkcs12FromAsn1(e,c),h=q.getBags({bagType:window.forge.pki.oids.pkcs8ShroudedKeyBag});console.assert(h[window.forge.pki.oids.pkcs8ShroudedKeyBag]&&0<h[window.forge.pki.oids.pkcs8ShroudedKeyBag].length);var r=h[window.forge.pki.oids.pkcs8ShroudedKeyBag][0].key,n=window.forge.pki.privateKeyToAsn1(r),m=window.forge.pki.wrapRsaPrivateKey(n);window.forge.asn1.toDer(m).getBytes();
741
+var w=q.getBags({bagType:window.forge.pki.oids.certBag})[window.forge.pki.oids.certBag][0].cert.subject.attributes,k=q.getBags({bagType:forge.pki.oids.certBag})[forge.pki.oids.certBag][0].cert;a(r,w,k);return!0}catch(v){}return!1}function amtcert_signWithCaKey(b,c,a,d,e){c&&null!=c||(c=amtcert_createCertificate(d).key);return amtcert_createCertificate(a,c,b,d,e)}
742
+function amtcert_createCertificate(b,c,a,d,e){var q,h=forge.pki.createCertificate();a?h.publicKey=forge.pki.publicKeyFromPem("-----BEGIN PUBLIC KEY-----"+a+"-----END PUBLIC KEY-----"):(q=forge.pki.rsa.generateKeyPair(2048),h.publicKey=q.publicKey);h.serialNumber=""+Math.floor(1E5*Math.random()+1);h.validity.notBefore=new Date;h.validity.notBefore.setFullYear(h.validity.notBefore.getFullYear()-1);h.validity.notAfter=new Date;h.validity.notAfter.setFullYear(h.validity.notAfter.getFullYear()+30);var r=
743
+[];b.CN&&r.push({name:"commonName",value:b.CN});b.C&&r.push({name:"countryName",value:b.C});b.ST&&r.push({shortName:"ST",value:b.ST});b.O&&r.push({name:"organizationName",value:b.O});h.setSubject(r);c?(b=[],d.CN&&b.push({name:"commonName",value:d.CN}),d.C&&b.push({name:"countryName",value:d.C}),d.ST&&b.push({shortName:"ST",value:d.ST}),d.O&&b.push({name:"organizationName",value:d.O}),h.setIssuer(b)):h.setIssuer(r);void 0==c?h.setExtensions([{name:"basicConstraints",cA:!0},{name:"nsCertType",sslCA:!0,
744
+emailCA:!0,objCA:!0},{name:"subjectKeyIdentifier"}]):(null==e?e={name:"extKeyUsage",serverAuth:!0}:e.name="extKeyUsage",h.setExtensions([{name:"basicConstraints"},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},e,{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0},{name:"subjectKeyIdentifier"}]));c?h.sign(c,forge.md.sha256.create()):h.sign(q.privateKey,forge.md.sha256.create());return a?h:{cert:h,key:q.privateKey}}
745
function _stringToArrayBuffer(b){for(var c=new ArrayBuffer(b.length),a=new Uint8Array(c),d=0,e=b.length;d<e;d++)a[d]=b.charCodeAt(d);return c}function _arrayBufferToString(b){var c="";b=new Uint8Array(b);for(var a=b.byteLength,d=0;d<a;d++)c+=String.fromCharCode(b[d]);return c}script_functionTable1="nop jump set print dialog getitem substr indexof split join length jsonparse jsonstr add substract parseint wsbatchenum wsput wscreate wsdelete wsexec scriptspeed wssubscribe wsunsubscribe readchar signwithdummyca".split(" ");
746
script_functionTable2="encodeuri decodeuri passwordcheck atob btoa hex2str str2hex random md5 maketoarray readshort readshortx readint readsint readintx shorttostr shorttostrx inttostr inttostrx".split(" ");script_functionTableX2=[encodeURI,decodeURI,passwordcheck,window.atob.bind(window),window.btoa.bind(window),hex2rstr,rstr2hex,random,rstr_md5,MakeToArray,ReadShort,ReadShortX,ReadInt,ReadSInt,ReadIntX,ShortToStr,ShortToStrX,IntToStr,IntToStrX];script_functionTable3="pullsystemstatus pulleventlog pullauditlog pullcertificates pullwatchdog pullsystemdefense pullhardware pulluserinfo pullremoteaccess highlightblock disconnect getsidstring getsidbytearray pulleventsubscriptions".split(" ");
747
script_functionTableX3=[PullSystemStatus,PullEventLog,PullAuditLog,PullCertificates,PullWatchdog,PullSystemDefense,PullHardware,PullUserInfo,PullRemoteAccess,script_HighlightBlock,,function(b,c){return GetSidString(c)},function(b,c){return GetSidByteArray(c)},PullEventSubscriptions];
748
function script_setup(b,c){var a={startvars:c};if(6>b.length)return console.error("Invalid script length"),null;if(612182341!=ReadInt(b,0))return console.error("Invalid binary script"),null;if(1<ReadShort(b,4))return console.error("Unsupported script version"),null;a.script=b.substring(6);a.reset=function(b){a.stop();a.ip=0;a.variables=c;a.state=1};a.start=function(b){a.stop();a.stepspeed=b;0<b&&(a.timer=setInterval(function(){a.step()},b))};a.stop=function(){null!=a.timer&&clearInterval(a.timer);
749
-a.timer=null;a.stepspeed=0};a.getVar=function(b){return void 0==b?void 0:a.getVarEx(b.split("."),a.variables)};a.getVarEx=function(b,c){try{return void 0==b?void 0:0==b.length?c:a.getVarEx(b.slice(1),c[b[0]])}catch(k){return null}};a.setVar=function(b,c){a.setVarEx(b.split("."),a.variables,c)};a.setVarEx=function(b,c,k){1==b.length?c[b[0]]=k:a.setVarEx(b.slice(1),c[b[0]],k)};a.step=function(){if(1==a.state){if(a.ip<a.script.length){var b=ReadShort(a.script,a.ip),c=ReadShort(a.script,a.ip+2),k=ReadShort(a.script,
750
-a.ip+4),l=a.ip+6,u=[],n;for(n in a.variables)n.startsWith("__")&&delete a.variables[n];for(n=0;n<k;n++){var p=ReadShort(a.script,l),x=a.script.substring(l+2,l+2+p),m=x.charCodeAt(0),x=x.substring(1);if(2>m){for(;1<x.split("{").length;)var w=x.split("{").pop().split("}").shift(),x=x.replace("{"+w+"}",a.getVar(w));1==m&&(a.variables["__"+n]=decodeURI(x),x="__"+n);u.push(x)}if(2==m||3==m)a.variables["__"+n]=ReadSInt(x,0),u.push("__"+n);l+=2+p}a.ip+=c;c=[];for(n=0;10>n;n++)c.push(a.getVar(u[n]));var h;
751
-try{if(1E4>b)switch(b){case 0:break;case 1:if(c[2]){if("<"==c[2]&&c[1]<c[3]||"<="==c[2]&&c[1]<=c[3]||"!="==c[2]&&c[1]!=c[3]||"="==c[2]&&c[1]==c[3]||">="==c[2]&&c[1]>=c[3]||">"==c[2]&&c[1]>c[3])a.ip=c[0]}else a.ip=c[0];break;case 2:void 0==u[1]?delete a.variables[u[0]]:a.setVar(u[0],c[1]);break;case 3:if(a.onConsole)a.onConsole(a.toString(c[0]),a);else console.log(a.toString(c[0]));break;case 4:a.state=2;a.dialog=!0;setDialogMode(11,c[0],c[2],a.xxStepDialogOk,c[1],a);break;case 5:for(n in c[1])c[1][n][c[2]]==
752
-c[3]&&(h=n);break;case 6:h=c[1].substr(c[2],c[3]);break;case 7:h=c[1].indexOf(c[2]);break;case 8:h=c[1].split(c[2]);break;case 9:h=c[1].join(c[2]);break;case 10:h=c[1].length;break;case 11:h=JSON.parse(c[1]);break;case 12:h=JSON.stringify(c[1]);break;case 13:h=c[1]+c[2];break;case 14:h=c[1]-c[2];break;case 15:h=parseInt(c[1]);break;case 16:a.state=2;a.amtstack.BatchEnum(c[0],c[1],a.xxWsmanReturn,a);break;case 17:a.state=2;a.amtstack.Put(c[0],c[1],a.xxWsmanReturn,a);break;case 18:a.state=2;a.amtstack.Create(c[0],
749
+a.timer=null;a.stepspeed=0};a.getVar=function(b){return void 0==b?void 0:a.getVarEx(b.split("."),a.variables)};a.getVarEx=function(b,c){try{return void 0==b?void 0:0==b.length?c:a.getVarEx(b.slice(1),c[b[0]])}catch(q){return null}};a.setVar=function(b,c){a.setVarEx(b.split("."),a.variables,c)};a.setVarEx=function(b,c,q){1==b.length?c[b[0]]=q:a.setVarEx(b.slice(1),c[b[0]],q)};a.step=function(){if(1==a.state){if(a.ip<a.script.length){var b=ReadShort(a.script,a.ip),c=ReadShort(a.script,a.ip+2),q=ReadShort(a.script,
750
+a.ip+4),h=a.ip+6,r=[],n;for(n in a.variables)n.startsWith("__")&&delete a.variables[n];for(n=0;n<q;n++){var m=ReadShort(a.script,h),w=a.script.substring(h+2,h+2+m),k=w.charCodeAt(0),w=w.substring(1);if(2>k){for(;1<w.split("{").length;)var v=w.split("{").pop().split("}").shift(),w=w.replace("{"+v+"}",a.getVar(v));1==k&&(a.variables["__"+n]=decodeURI(w),w="__"+n);r.push(w)}if(2==k||3==k)a.variables["__"+n]=ReadSInt(w,0),r.push("__"+n);h+=2+m}a.ip+=c;c=[];for(n=0;10>n;n++)c.push(a.getVar(r[n]));var B;
751
+try{if(1E4>b)switch(b){case 0:break;case 1:if(c[2]){if("<"==c[2]&&c[1]<c[3]||"<="==c[2]&&c[1]<=c[3]||"!="==c[2]&&c[1]!=c[3]||"="==c[2]&&c[1]==c[3]||">="==c[2]&&c[1]>=c[3]||">"==c[2]&&c[1]>c[3])a.ip=c[0]}else a.ip=c[0];break;case 2:void 0==r[1]?delete a.variables[r[0]]:a.setVar(r[0],c[1]);break;case 3:if(a.onConsole)a.onConsole(a.toString(c[0]),a);else console.log(a.toString(c[0]));break;case 4:a.state=2;a.dialog=!0;setDialogMode(11,c[0],c[2],a.xxStepDialogOk,c[1],a);break;case 5:for(n in c[1])c[1][n][c[2]]==
752
+c[3]&&(B=n);break;case 6:B=c[1].substr(c[2],c[3]);break;case 7:B=c[1].indexOf(c[2]);break;case 8:B=c[1].split(c[2]);break;case 9:B=c[1].join(c[2]);break;case 10:B=c[1].length;break;case 11:B=JSON.parse(c[1]);break;case 12:B=JSON.stringify(c[1]);break;case 13:B=c[1]+c[2];break;case 14:B=c[1]-c[2];break;case 15:B=parseInt(c[1]);break;case 16:a.state=2;a.amtstack.BatchEnum(c[0],c[1],a.xxWsmanReturn,a);break;case 17:a.state=2;a.amtstack.Put(c[0],c[1],a.xxWsmanReturn,a);break;case 18:a.state=2;a.amtstack.Create(c[0],
753
c[1],a.xxWsmanReturn,a);break;case 19:a.state=2;a.amtstack.Delete(c[0],c[1],a.xxWsmanReturn,a);break;case 20:a.state=2;a.amtstack.Exec(c[0],c[1],c[2],a.xxWsmanReturn,a,0,c[3]);break;case 21:a.stepspeed=c[0];null!=a.timer&&(clearInterval(a.timer),a.timer=setInterval(function(){a.step()},a.stepspeed));break;case 22:a.state=2;a.amtstack.Subscribe(c[0],c[1],c[2],a.xxWsmanReturn,a,0,c[3],c[4],c[5],c[6]);break;case 23:a.state=2;a.amtstack.UnSubscribe(c[0],a.xxWsmanReturn,a,0,c[1]);break;case 24:console.log(c[1],
754
-c[2],c[1].charCodeAt(c[2]));h=c[1].charCodeAt(c[2]);break;case 25:a.state=2;amtcert_signWithCaKey(c[0],null,c[1],{CN:"Untrusted Root Certificate"},a.xxSignWithDummyCaReturn);break;default:a.state=9,console.error("Script Error, unknown command: "+b)}else 2E4>b?h=script_functionTableX2[b-1E4](c[1],c[2],c[3],c[4],c[5],c[6]):script_functionTableX3&&script_functionTableX3[b-2E4]&&(h=script_functionTableX3[b-2E4](a,c[1],c[2],c[3],c[4],c[5],c[6]));void 0!=h&&a.setVar(u[0],h)}catch(v){"object"==typeof v&&
755
-(v=v.message),a.setVar("_exception",v)}}1==a.state&&a.ip>=a.script.length&&(a.state=0,a.stop());if(a.onStep)a.onStep(a);return a}};a.xxStepDialogOk=function(b){a.variables.DialogSelect=b;a.state=1;a.dialog=!1;if(a.onStep)a.onStep(a)};a.xxWsmanReturn=function(b,c,k,l){a.setVar(c,k);a.setVar("wsman_result",l);a.setVar("wsman_result_str",httpErrorTable[l]?httpErrorTable[l]:"Error #"+l);a.state=1;if(a.onStep)a.onStep(a)};a.xxSignWithDummyCaReturn=function(b){a.setVar("signed_cert",btoa(_arrayBufferToString(b)));
754
+c[2],c[1].charCodeAt(c[2]));B=c[1].charCodeAt(c[2]);break;case 25:a.state=2;amtcert_signWithCaKey(c[0],null,c[1],{CN:"Untrusted Root Certificate"},a.xxSignWithDummyCaReturn);break;default:a.state=9,console.error("Script Error, unknown command: "+b)}else 2E4>b?B=script_functionTableX2[b-1E4](c[1],c[2],c[3],c[4],c[5],c[6]):script_functionTableX3&&script_functionTableX3[b-2E4]&&(B=script_functionTableX3[b-2E4](a,c[1],c[2],c[3],c[4],c[5],c[6]));void 0!=B&&a.setVar(r[0],B)}catch(l){"object"==typeof l&&
755
+(l=l.message),a.setVar("_exception",l)}}1==a.state&&a.ip>=a.script.length&&(a.state=0,a.stop());if(a.onStep)a.onStep(a);return a}};a.xxStepDialogOk=function(b){a.variables.DialogSelect=b;a.state=1;a.dialog=!1;if(a.onStep)a.onStep(a)};a.xxWsmanReturn=function(b,c,q,h){a.setVar(c,q);a.setVar("wsman_result",h);a.setVar("wsman_result_str",httpErrorTable[h]?httpErrorTable[h]:"Error #"+h);a.state=1;if(a.onStep)a.onStep(a)};a.xxSignWithDummyCaReturn=function(b){a.setVar("signed_cert",btoa(_arrayBufferToString(b)));
756
a.state=1;if(a.onStep)a.onStep(a)};a.toString=function(a){return"object"==typeof a?JSON.stringify(a):a};a.reset();return a}
757
-function script_compile(b,c){var a="",d=b.split("\n"),e={},k=[],l=[],u;for(u in d){var n=d[u];if(n.startsWith("##SWAP ")){var p=n.split(" ");3==p.length&&(l[p[1]]=p[2])}if("#"!=n[0]&&0!=n.length){for(p in l)n=n.split(p).join(l[p]);var x=n.match(/"[^"]*"|[^\s"]+/g);if(0!=x.length)if(":"==n[0])e[x[0].toUpperCase()]=a.length;else{n=script_functionTable1.indexOf(x[0].toLowerCase());-1==n&&(n=script_functionTable2.indexOf(x[0].toLowerCase()),0<=n&&(n+=1E4));-1==n&&(n=script_functionTable3.indexOf(x[0].toLowerCase()),
758
-0<=n&&(n+=2E4));if(-1==n)return c&&c("Unabled to compile, unknown command: "+x[0]),"";var m=ShortToStr(x.length-1),w;for(w in x)if(0!=w)if(":"==x[w][0])k.push([x[w],a.length+m.length+7]),m+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var h=parseInt(x[w]),m=h==x[w]?m+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(h)):'"'==x[w][0]&&'"'==x[w][x[w].length-1]?m+(ShortToStr(x[w].length-1)+String.fromCharCode(1)+x[w].substring(1,x[w].length-1)):m+(ShortToStr(x[w].length+1)+String.fromCharCode(0)+
759
-x[w]);m=ShortToStr(n)+ShortToStr(m.length+4)+m;a+=m}}}for(u in k){d=k[u][0].toUpperCase();l=k[u][1];p=e[d];if(void 0==p)return c&&c("Unabled to compile, unknown label: "+d),"";a=a.substr(0,l)+IntToStr(p)+a.substr(l+4)}return IntToStr(612182341)+ShortToStr(1)+a}
760
-function script_decompile(b,c){var a="",d=6,e={};if(0<=c)d=c;else{if(6>b.length)return"# Invalid script length";var k=ReadInt(b,0),l=ReadShort(b,4);if(612182341!=k)return"# Invalid binary script: "+k;if(1!=l)return"# Invalid script version"}for(;d<b.length;){var k=ReadShort(b,d),l=ReadShort(b,d+2),u=ReadShort(b,d+4),n=d+6,p="";0<=c||(a+=":label"+(d-6)+"\n");for(var x=0;x<u;x++){var m=ReadShort(b,n),w=b.substring(n+2,n+2+m),h=w.charCodeAt(0);0==h?p+=" "+w.substring(1):1==h?p+=' "'+w.substring(1)+'"':
761
-2==h?p+=" "+ReadInt(w,1):3==h&&(w=ReadInt(w,1),h=e[w],h||(h=":label"+w,e[h]=w),p+=" "+h);n+=2+m}a=1E4>k?a+(script_functionTable1[k]+p+"\n"):2E4<=k?a+(script_functionTable3[k-2E4]+p+"\n"):a+(script_functionTable2[k-1E4]+p+"\n");d+=l;if(0<=c)return a}d=a.split("\n");a="";for(x in d)k=d[x],":"!=k[0]?a+=k+"\n":e[k]&&(a+=k+"\n");return a}
762
-var CreateAmtRemoteDesktop=function(b,c){function a(a,b,c,g,m,v,D,A){var y=a.charCodeAt(b++);A={};var C=0,w=0;if(0==y){if(2==h.bpp)for(m=0;m<D;m++)k(a.charCodeAt(b++)+(a.charCodeAt(b++)<<8),m);else for(m=0;m<D;m++)e(a.charCodeAt(b++),m);d(h.spare,c,g)}else if(1==y)y=a.charCodeAt(b++)+(2==h.bpp?a.charCodeAt(b++)<<8:0),h.canvas.fillStyle="rgb("+(1==h.bpp?(y&224)+","+((y&28)<<3)+","+x((y&3)<<6):(y>>8&248)+","+(y>>3&252)+","+((y&31)<<3))+")",a=n(c,g),g=p(c,g),h.canvas.fillRect(a,g,m,v);else if(1<y&&17>
763
-y){v=4;w=15;if(2==h.bpp){for(m=0;m<y;m++)A[m]=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);2==y?w=v=1:4>=y&&(v=2,w=3);for(;C<D&&b<a.length;)for(y=a.charCodeAt(b++),m=8-v;0<=m;m-=v)k(A[y>>m&w],C++)}else{for(m=0;m<y;m++)A[m]=a.charCodeAt(b++);2==y?w=v=1:4>=y&&(v=2,w=3);for(;C<D&&b<a.length;)for(y=a.charCodeAt(b++),m=8-v;0<=m;m-=v)e(A[y>>m&w],C++)}d(h.spare,c,g)}else if(128==y){if(2==h.bpp)for(;C<D&&b<a.length;){y=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);w=1;do w+=m=a.charCodeAt(b++);while(255==m);if(0==
764
-h.rotation)u(y,C,w),C+=w;else for(;0<=--w;)k(y,C++)}else for(;C<D&&b<a.length;){y=a.charCodeAt(b++);w=1;do w+=m=a.charCodeAt(b++);while(255==m);if(0==h.rotation)l(y,C,w),C+=w;else for(;0<=--w;)e(y,C++)}d(h.spare,c,g)}else if(129<y){if(2==h.bpp)for(m=0;m<y-128;m++)A[m]=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);else for(m=0;m<y-128;m++)A[m]=a.charCodeAt(b++);for(;C<D&&b<a.length;){w=1;m=a.charCodeAt(b++);y=A[m%128];if(127<m){do w+=m=a.charCodeAt(b++);while(255==m)}if(0==h.rotation)2==h.bpp?u(y,C,w):
765
-l(y,C,w),C+=w;else if(2==h.bpp)for(;0<=--w;)k(y,C++);else for(;0<=--w;)e(y,C++)}d(h.spare,c,g)}}function d(a,b,c){if(1!=h.holding){var d=0==h.rotation?b:1==h.rotation?h.canvas.canvas.width-h.sparew2-c:2==h.rotation?h.canvas.canvas.width-h.sparew2-b:3==h.rotation?c:0;c=0==h.rotation?c:1==h.rotation?b:2==h.rotation?h.canvas.canvas.height-h.spareh2-c:3==h.rotation?h.canvas.canvas.height-h.spareh-b:0;h.canvas.putImageData(a,d,c)}}function e(a,b){var c=b<<2;if(0<h.rotation)if(1==h.rotation){var c=b%h.sparew,
766
-d=Math.floor(b/h.sparew);b=c*h.sparew2+(h.sparew2-1-d);c=b<<2}else 2==h.rotation?c=h.sparew*h.spareh*4-4-c:3==h.rotation&&(c=b%h.sparew,d=Math.floor(b/h.sparew),b=(h.sparew2-1-c)*h.sparew2+d,c=b<<2);0==h.graymode?(h.spare.data[c]=a&224,h.spare.data[c+1]=(a&28)<<3,h.spare.data[c+2]=x((a&3)<<6)):h.spare.data[c]=h.spare.data[c+1]=h.spare.data[c+2]=a}function k(a,b){var c=b<<2;if(0<h.rotation)if(1==h.rotation){var c=b%h.sparew,d=Math.floor(b/h.sparew);b=c*h.sparew2+(h.sparew2-1-d);c=b<<2}else 2==h.rotation?
767
-c=h.sparew*h.spareh*4-4-c:3==h.rotation&&(c=b%h.sparew,d=Math.floor(b/h.sparew),b=(h.sparew2-1-c)*h.sparew2+d,c=b<<2);h.spare.data[c]=a>>8&248;h.spare.data[c+1]=a>>3&252;h.spare.data[c+2]=(a&31)<<3}function l(a,b,c){b<<=2;var d=a&224,e=(a&28)<<3;for(a=x((a&3)<<6);0<=--c;)h.spare.data[b]=d,h.spare.data[b+1]=e,h.spare.data[b+2]=a,b+=4}function u(a,b,c){b<<=2;var d=a>>8&248,e=a>>3&252;for(a=(a&31)<<3;0<=--c;)h.spare.data[b]=d,h.spare.data[b+1]=e,h.spare.data[b+2]=a,b+=4}function n(a,b){return 0==h.rotation||
768
-1==h.rotation?a:2==h.rotation?a-h.canvas.canvas.width:3==h.rotation?a-h.canvas.canvas.height:0}function p(a,b){return 0==h.rotation?b:1==h.rotation?b-h.canvas.canvas.width:2==h.rotation?b-h.canvas.canvas.height:3==h.rotation?b:0}function x(a){return 127<a?a+32:a}function m(){1!=h.holding&&h.Send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(h.rwidth)+ShortToStr(h.rheight))}function w(a,b){b||(b=window.event);if(b.code){var c;c=b;c=c.code.startsWith("Key")&&4==c.code.length?c.code.charCodeAt(3)+(0==
769
-c.shiftKey?32:0):c.code.startsWith("Digit")&&6==c.code.length?c.code.charCodeAt(5):c.code.startsWith("Numpad")&&7==c.code.length?c.code.charCodeAt(6):v[c.code];null!=c&&h.sendkey(c,a)}else{c=b.keyCode;173==c&&(c=189);61==c&&(c=187);var d=c;0==b.shiftKey&&65<=c&&90>=c&&(d=c+32);112<=c&&124>=c&&(d=c+65358);8==c&&(d=65288);9==c&&(d=65289);13==c&&(d=65293);16==c&&(d=65505);17==c&&(d=65507);18==c&&(d=65513);27==c&&(d=65307);33==c&&(d=65365);34==c&&(d=65366);35==c&&(d=65367);36==c&&(d=65360);37==c&&(d=
770
-65361);38==c&&(d=65362);39==c&&(d=65363);40==c&&(d=65364);45==c&&(d=65379);46==c&&(d=65535);96<=c&&105>=c&&(d=c-48);106==c&&(d=42);107==c&&(d=43);109==c&&(d=45);110==c&&(d=46);111==c&&(d=47);186==c&&(d=59);187==c&&(d=61);188==c&&(d=44);189==c&&(d=45);190==c&&(d=46);191==c&&(d=47);192==c&&(d=96);219==c&&(d=91);220==c&&(d=92);221==c&&(d=93);222==c&&(d=39);h.sendkey(d,a)}return h.haltEvent(b)}var h={};h.canvasid=b;h.scrolldiv=c;h.canvas=Q(b).getContext("2d");h.protocol=2;h.state=0;h.acc="";h.ScreenWidth=
771
-960;h.ScreenHeight=700;h.width=0;h.height=0;h.rwidth=0;h.rheight=0;h.bpp=2;h.graymode=0;h.useZRLE=!0;h.showmouse=!0;h.buttonmask=0;h.spare=null;h.sparew=0;h.spareh=0;h.sparew2=0;h.spareh2=0;h.sparecache={};h.ZRLEfirst=1;h.onScreenSizeChange=null;h.frameRateDelay=0;h.noMouseRotate=!1;h.rotation=0;h.kvmDataSupported=!1;h.onKvmData=null;h.onKvmDataPending=[];h.onKvmDataAck=-1;h.holding=!1;h.lastKeepAlive=Date.now();h.inflate=ZLIB.inflateInit(-15);h.Debug=function(a){console.log(a)};h.xxStateChange=function(a){0==
772
-a?(h.canvas.fillStyle="#000000",h.canvas.fillRect(0,0,h.width,h.height),h.canvas.canvas.width=h.rwidth=h.width=640,h.canvas.canvas.height=h.rheight=h.height=400,QS(h.canvasid).cursor="auto",h.inflate=ZLIB.inflateInit(-15)):h.showmouse||(QS(h.canvasid).cursor="none")};h.ProcessData=function(b){if(b)for(h.acc+=b;0<h.acc.length;){var c=0;if(0==h.state&&12<=h.acc.length)c=12,h.state=1,h.Send("RFB 003.008\n");else if(1==h.state&&1<=h.acc.length)c=h.acc.charCodeAt(0)+1,h.Send(String.fromCharCode(1)),h.state=
773
-2;else if(2==h.state&&4<=h.acc.length){c=4;if(0!=ReadInt(h.acc,0))return h.Stop();h.Send(String.fromCharCode(1));h.state=3}else if(3==h.state&&24<=h.acc.length){h.rotation=0;b=ReadInt(h.acc,20);if(h.acc.length<24+b)break;c=24+b;h.canvas.canvas.width=h.rwidth=h.width=h.ScreenWidth=ReadShort(h.acc,0);h.canvas.canvas.height=h.rheight=h.height=h.ScreenHeight=ReadShort(h.acc,2);b="";h.useZRLE&&(b+=IntToStr(16));b+=IntToStr(0);b+=IntToStr(1092);h.Send(String.fromCharCode(2,0)+ShortToStr(b.length/4+1)+b+
774
-IntToStr(-223));0==h.graymode?1==h.bpp&&h.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(h.bpp=1,1==h.graymode&&h.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)),2==h.graymode&&h.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)));h.state=4;h.parent.xxStateChange(3);m();if(null!=h.onScreenSizeChange)h.onScreenSizeChange(h,
775
-h.ScreenWidth,h.ScreenHeight)}else if(4==h.state)switch(h.acc.charCodeAt(0)){case 0:if(4>h.acc.length)return;h.state=100+ReadShort(h.acc,2);c=4;break;case 2:c=1;break;case 3:if(8>h.acc.length)return;b=ReadInt(h.acc,4)+8;if(h.acc.length<b)return;var g=h.acc;if(8>g.length)c=0;else if(b=ReadInt(h.acc,4)+8,g.length<b)c=0;else{if(null!=h.onKvmData&&(g=g.substring(8,b),16<=g.length&&"\x00KvmDataChannel"==g.substring(0,15))){0==h.kvmDataSupported&&(h.kvmDataSupported=!0,console.log("KVM Data Channel Supported."));
776
-if(-1==h.onKvmDataAck&&16==g.length||0!=g.charCodeAt(15))h.onKvmDataAck=!0;urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Recv("+(g.length-16)+"): "+g.substring(16));if(16<g.length)h.onKvmData(g.substring(16));1==h.onKvmDataAck&&0<h.onKvmDataPending.length&&h.sendKvmData(h.onKvmDataPending.shift())}c=b}}else if(100<h.state&&12<=h.acc.length){b=ReadShort(h.acc,0);var g=ReadShort(h.acc,2),c=ReadShort(h.acc,4),l=ReadShort(h.acc,6),n=c*l,p=ReadInt(h.acc,8);if(17>p){if(1>c||64<c||1>l||64<l)return console.log("Invalid tile size ("+
777
-c+","+l+"), disconnecting."),h.Stop();if(h.sparew!=c||h.spareh!=l){h.sparew=h.sparew2=c;h.spareh=h.spareh2=l;if(1==h.rotation||3==h.rotation)h.sparew2=l,h.spareh2=c;var u=h.sparew2+"x"+h.spareh2;h.spare=h.sparecache[u];if(!h.spare){h.sparecache[u]=h.spare=h.canvas.createImageData(h.sparew2,h.spareh2);for(var v=h.sparew2*h.spareh2<<2,u=3;u<v;u+=4)h.spare.data[u]=255}}}if(4294967073==p){if(h.canvas.canvas.width=h.ScreenWidth=h.rwidth=h.width=c,h.canvas.canvas.height=h.ScreenHeight=h.rheight=h.height=
778
-l,h.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(h.width)+ShortToStr(h.height)),c=12,null!=h.onScreenSizeChange)h.onScreenSizeChange(h,h.ScreenWidth,h.ScreenHeight)}else if(0==p){p=12;c=12+n*h.bpp;if(h.acc.length<c)break;if(2==h.bpp)for(u=0;u<n;u++)k(h.acc.charCodeAt(p++)+(h.acc.charCodeAt(p++)<<8),u);else for(u=0;u<n;u++)e(h.acc.charCodeAt(p++),u);d(h.spare,b,g)}else if(16==p){if(16>h.acc.length)break;u=ReadInt(h.acc,12);if(h.acc.length<16+u)break;p=16;5<u&&0==h.acc.charCodeAt(p)&&ReadShortX(h.acc,
779
-p+1)==u-5?a(h.acc,p+5,b,g,c,l,n,u):(p=h.inflate.inflate(h.acc.substring(p,p+u-0)),0<p.length?a(p,0,b,g,c,l,n,p.length):h.Debug("Invalid deflate data"));c=16+u}else return h.Debug("Unknown Encoding: "+p+", HEX: "+rstr2hex(h.acc)),h.Stop();100==--h.state&&(h.state=4,0==h.frameRateDelay?m():setTimeout(m,h.frameRateDelay))}if(0==c)break;h.acc=h.acc.substring(c)}};h.hold=function(a){if(h.holding!=a)if(h.holding=a,h.canvas.fillStyle="#000000",h.canvas.fillRect(0,0,h.width,h.height),0==h.holding){if(h.canvas.canvas.width!=
780
-h.width||h.canvas.canvas.height!=h.height)if(h.canvas.canvas.width=h.width,h.canvas.canvas.height=h.height,null!=h.onScreenSizeChange)h.onScreenSizeChange(h,h.ScreenWidth,h.ScreenHeight);h.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(h.width)+ShortToStr(h.height))}else h.UnGrabMouseInput(),h.UnGrabKeyInput()};h.tcanvas=null;h.setRotation=function(a){for(;0>a;)a+=4;a%=4;if(1==h.holding)h.rotation=a;else{if(a==h.rotation)return!0;var b=h.canvas.canvas.width,c=h.canvas.canvas.height;if(1==h.rotation||
781
-3==h.rotation)b=h.canvas.canvas.height,c=h.canvas.canvas.width;null==h.tcanvas&&(h.tcanvas=document.createElement("canvas"));var d=h.tcanvas.getContext("2d");d.setTransform(1,0,0,1,0,0);d.canvas.width=b;d.canvas.height=c;d.rotate(-90*h.rotation*Math.PI/180);0==h.rotation&&d.drawImage(h.canvas.canvas,0,0);1==h.rotation&&d.drawImage(h.canvas.canvas,-h.canvas.canvas.width,0);2==h.rotation&&d.drawImage(h.canvas.canvas,-h.canvas.canvas.width,-h.canvas.canvas.height);3==h.rotation&&d.drawImage(h.canvas.canvas,
782
-0,-h.canvas.canvas.height);if(0==h.rotation||2==h.rotation)h.canvas.canvas.height=b,h.canvas.canvas.width=c;if(1==h.rotation||3==h.rotation)h.canvas.canvas.height=c,h.canvas.canvas.width=b;h.canvas.setTransform(1,0,0,1,0,0);h.canvas.rotate(90*a*Math.PI/180);h.rotation=a;h.canvas.drawImage(h.tcanvas,n(0,0),p(0,0));h.width=h.canvas.canvas.width;h.height=h.canvas.canvas.height;if(null!=h.onScreenResize)h.onScreenResize(h,h.width,h.height,h.CanvasId);return!0}};h.Start=function(){h.state=0;h.acc="";h.ZRLEfirst=
783
-1;h.inflate.inflateReset();h.onKvmDataPending=[];h.onKvmDataAck=-1;h.kvmDataSupported=!1;for(var a in h.sparecache)delete h.sparecache[a]};h.Stop=function(){h.UnGrabMouseInput();h.UnGrabKeyInput();h.parent.Stop()};h.Send=function(a){h.parent.Send(a)};var v={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,
784
-BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,
785
-MetaRight:65512};h.sendkey=function(a,b){if("object"==typeof a)for(var c in a)h.sendkey(a[c][0],a[c][1]);else h.Send(String.fromCharCode(4,b,0,0)+IntToStr(a))};h.sendKvmData=function(a){!0!==h.onKvmDataAck?h.onKvmDataPending.push(a):(urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Send("+a.length+"): "+a),a="\x00KvmDataChannel\x00"+a,h.Send(String.fromCharCode(6,0,0,0)+IntToStr(a.length)+a),h.onKvmDataAck=!1)};h.sendKeepAlive=function(){h.lastKeepAlive<Date.now()-5E3&&(h.lastKeepAlive=Date.now(),
786
-h.Send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\x00KvmDataChannel\x00"))};h.SendCtrlAltDelMsg=function(){h.sendcad()};h.sendcad=function(){h.sendkey(65507,1);h.sendkey(65513,1);h.sendkey(65535,1);h.sendkey(65535,0);h.sendkey(65513,0);h.sendkey(65507,0)};var g=!1,K=!1;h.GrabMouseInput=function(){if(1!=g){var a=h.canvas.canvas;a.onmouseup=h.mouseup;a.onmousedown=h.mousedown;a.onmousemove=h.mousemove;g=!0}};h.UnGrabMouseInput=function(){if(0!=g){var a=h.canvas.canvas;a.onmousemove=null;a.onmouseup=
787
-null;a.onmousedown=null;g=!1}};h.GrabKeyInput=function(){1!=K&&(document.onkeyup=h.handleKeyUp,document.onkeydown=h.handleKeyDown,document.onkeypress=h.handleKeys,K=!0)};h.UnGrabKeyInput=function(){0!=K&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,K=!1)};h.handleKeys=function(a){return h.haltEvent(a)};h.handleKeyUp=function(a){return w(0,a)};h.handleKeyDown=function(a){return w(1,a)};h.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();
788
-return!1};h.mousedown=function(a){h.buttonmask|=1<<a.button;return h.mousemove(a)};h.mouseup=function(a){h.buttonmask&=65535-(1<<a.button);return h.mousemove(a)};h.mousemove=function(a){if(4!=h.state)return!0;var b=h.getPositionOfControl(Q(h.canvasid));h.mx=(a.pageX-b[0])*(h.canvas.canvas.height/Q(h.canvasid).offsetHeight);h.my=(a.pageY-b[1]+(c?c.scrollTop:0))*(h.canvas.canvas.width/Q(h.canvasid).offsetWidth);if(1!=h.noMouseRotate){var b=h.mx,d=h.my;h.mx2=0==h.rotation?b:1==h.rotation?d:2==h.rotation?
789
-h.canvas.canvas.width-b:3==h.rotation?h.canvas.canvas.height-d:0;b=h.mx;d=h.my;h.my=0==h.rotation?d:1==h.rotation?h.canvas.canvas.width-b:2==h.rotation?h.canvas.canvas.height-d:3==h.rotation?b:0;h.mx=h.mx2}h.Send(String.fromCharCode(5,h.buttonmask)+ShortToStr(h.mx)+ShortToStr(h.my));return h.haltEvent(a)};h.getPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};return h},CreateAgentRemoteDesktop=function(b,c){var a={};a.CanvasId=
790
-b;"string"===typeof b&&(a.CanvasId=Q(b));a.Canvas=a.CanvasId.getContext("2d");a.scrolldiv=c;a.State=0;a.PendingOperations=[];a.tilesReceived=0;a.TilesDrawn=0;a.KillDraw=0;a.ipad=!1;a.tabletKeyboardVisible=!1;a.LastX=0;a.LastY=0;a.touchenabled=0;a.submenuoffset=0;a.touchtimer=null;a.TouchArray={};a.connectmode=0;a.connectioncount=0;a.rotation=0;a.protocol=2;a.debugmode=0;a.firstUpKeys=[];a.stopInput=!1;a.sessionid=0;a.username;a.oldie=!1;a.CompressionLevel=50;a.ScalingLevel=1024;a.FrameRateTimer=50;
791
-a.FirstDraw=!1;a.ScreenWidth=960;a.ScreenHeight=700;a.width=960;a.height=960;a.onScreenSizeChange=null;a.onMessage=null;a.onConnectCountChanged=null;a.onDebugMessage=null;a.onTouchEnabledChanged=null;a.onDisplayinfo=null;a.Start=function(){a.State=0};a.Stop=function(){a.setRotation(0);a.UnGrabKeyInput();a.UnGrabMouseInput();a.touchenabled=0;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.Canvas.clearRect(0,0,a.CanvasId.width,a.CanvasId.height)};a.xxStateChange=
792
-function(b){if(a.State!=b)switch(a.State=b,b){case 0:a.Stop()}};a.send=function(b){a.parent.send(b)};a.ProcessPictureMsg=function(b,c,d){var u=new Image;u.xcount=a.tilesReceived++;var n=a.tilesReceived;u.src="data:image/jpeg;base64,"+btoa(b.substring(4,b.length));u.onload=function(){if(null!=a.Canvas&&a.KillDraw<n&&0!=a.State)for(a.PendingOperations.push([n,2,u,c,d]);a.DoPendingOperations(););};u.error=function(){console.log("DecodeTileError")}};a.DoPendingOperations=function(){if(0==a.PendingOperations.length)return!1;
793
-for(var b=0;b<a.PendingOperations.length;b++){var c=a.PendingOperations[b];if(c[0]==a.TilesDrawn+1)return 1==c[1]?a.ProcessCopyRectMsg(c[2]):2==c[1]&&(a.Canvas.drawImage(c[2],a.rotX(c[3],c[4]),a.rotY(c[3],c[4])),delete c[2]),a.PendingOperations.splice(b,1),delete c,a.TilesDrawn++,a.TilesDrawn==a.tilesReceived&&a.KillDraw<a.TilesDrawn&&(a.KillDraw=a.TilesDrawn=a.tilesReceived=0),!0}a.oldie&&0<a.PendingOperations.length&&a.TilesDrawn++;return!1};a.ProcessCopyRectMsg=function(b){var c=((b.charCodeAt(0)&
794
-255)<<8)+(b.charCodeAt(1)&255),d=((b.charCodeAt(2)&255)<<8)+(b.charCodeAt(3)&255),u=((b.charCodeAt(4)&255)<<8)+(b.charCodeAt(5)&255),n=((b.charCodeAt(6)&255)<<8)+(b.charCodeAt(7)&255),p=((b.charCodeAt(8)&255)<<8)+(b.charCodeAt(9)&255);b=((b.charCodeAt(10)&255)<<8)+(b.charCodeAt(11)&255);a.Canvas.drawImage(Canvas.canvas,c,d,p,b,u,n,p,b)};a.SendUnPause=function(){a.send(String.fromCharCode(0,8,0,5,0))};a.SendPause=function(){a.send(String.fromCharCode(0,8,0,5,1))};a.SendCompressionLevel=function(b,
795
-c,d,u){c&&(a.CompressionLevel=c);d&&(a.ScalingLevel=d);u&&(a.FrameRateTimer=u);a.send(String.fromCharCode(0,5,0,10,b,a.CompressionLevel)+a.shortToStr(a.ScalingLevel)+a.shortToStr(a.FrameRateTimer))};a.SendRefresh=function(){a.send(String.fromCharCode(0,6,0,4))};a.ProcessScreenMsg=function(b,c){a.Canvas.setTransform(1,0,0,1,0,0);a.rotation=0;a.FirstDraw=!0;a.ScreenWidth=a.width=b;a.ScreenHeight=a.height=c;for(a.KillDraw=a.tilesReceived;0<a.PendingOperations.length;)a.PendingOperations.shift();a.SendCompressionLevel(1);
796
-a.SendUnPause();if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId)};a.ProcessData=function(b){for(var c=0;c<b.length;)c+=a.ProcessDataEx(b.substring(c))};a.ProcessDataEx=function(b){if(!(4>b.length)){var c=null,d=0,u=0,n=ReadShort(b,0),p=ReadShort(b,2);p!=b.length&&1==a.debugmode&&console.log(p,b.length,p==b.length);if(18<=n)console.error("Invalid KVM command "+n+" of size "+p),console.log("Invalid KVM data",b.length,b,rstr2hex(b));else if(p>b.length)console.error("KVM invalid command size",
797
-p,b.length);else{if(3==n||4==n||7==n)c=b.substring(4,p),d=((c.charCodeAt(0)&255)<<8)+(c.charCodeAt(1)&255),u=((c.charCodeAt(2)&255)<<8)+(c.charCodeAt(3)&255);switch(n){case 3:if(a.FirstDraw)a.onResize();a.ProcessPictureMsg(c,d,u);break;case 4:if(a.FirstDraw)a.onResize();a.TilesDrawn==a.tilesReceived?a.ProcessCopyRectMsg(c):a.PendingOperations.push([++tilesReceived,1,c]);break;case 7:a.ProcessScreenMsg(d,u);a.SendKeyMsgKC(a.KeyAction.UP,16);a.SendKeyMsgKC(a.KeyAction.UP,17);a.SendKeyMsgKC(a.KeyAction.UP,
798
-18);a.SendKeyMsgKC(a.KeyAction.UP,91);a.SendKeyMsgKC(a.KeyAction.UP,92);a.SendKeyMsgKC(a.KeyAction.UP,16);a.send(String.fromCharCode(0,14,0,4));break;case 11:c=[];d=((b.charCodeAt(4)&255)<<8)+(b.charCodeAt(5)&255);if(0<d)for(var x=0,u=((b.charCodeAt(6+2*d)&255)<<8)+(b.charCodeAt(7+2*d)&255),n=0;n<d;n++){var m=((b.charCodeAt(6+2*n)&255)<<8)+(b.charCodeAt(7+2*n)&255);65535==m?c.push("All Displays"):c.push("Display "+m);m==u&&(x=n)}if(null!=a.onDisplayinfo)a.onDisplayinfo(a,c,x);break;case 14:a.touchenabled=
799
-1;a.TouchArray={};if(null!=a.onTouchEnabledChanged)a.onTouchEnabledChanged(a.touchenabled);break;case 15:a.TouchArray={};break;case 16:a.connectioncount=ReadInt(b,4);if(null!=a.onConnectCountChanged)a.onConnectCountChanged(a.connectioncount,a);break;case 17:if(null!=a.onMessage)a.onMessage(b.substring(4,p),a)}return p}}};a.MouseButton={NONE:0,LEFT:2,RIGHT:8,MIDDLE:32};a.KeyAction={NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5};a.InputType={KEY:1,MOUSE:2,CTRLALTDEL:10,TOUCH:15};a.Alternate=0;var d={Pause:19,
800
-CapsLock:20,Space:32,Quote:222,Minus:189,NumpadMultiply:106,NumpadAdd:107,PrintScreen:44,Comma:188,NumpadSubtract:109,NumpadDecimal:110,Period:190,Slash:191,NumpadDivide:111,Semicolon:186,Equal:187,OSLeft:91,BracketLeft:219,OSRight:91,Backslash:220,BracketRight:221,ContextMenu:93,Backquote:192,NumLock:144,ScrollLock:145,Backspace:8,Tab:9,Enter:13,NumpadEnter:13,Escape:27,Delete:46,Home:36,PageUp:33,PageDown:34,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,End:35,Insert:45,F1:112,F2:113,F3:114,
801
-F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,ShiftLeft:16,ShiftRight:16,ControlLeft:17,ControlRight:17,AltLeft:18,AltRight:18,MetaLeft:91,MetaRight:92,VolumeMute:181};a.SendKeyMsg=function(b,c){if(null!=b)if(c||(c=window.event),c.code){var l;l=c;l=l.code.startsWith("Key")&&4==l.code.length?l.code.charCodeAt(3):l.code.startsWith("Digit")&&6==l.code.length?l.code.charCodeAt(5):l.code.startsWith("Numpad")&&7==l.code.length?l.code.charCodeAt(6)+48:d[l.code];null!=l&&a.SendKeyMsgKC(b,
802
-l)}else l=c.keyCode,59==l&&(l=186),a.SendKeyMsgKC(b,l)};a.SendMessage=function(b){3==a.State&&a.send(String.fromCharCode(0,17)+a.shortToStr(4+b.length)+b)};a.SendKeyMsgKC=function(b,c){3==a.State&&a.send(String.fromCharCode(0,a.InputType.KEY,0,6,b-1,c))};a.sendcad=function(){a.SendCtrlAltDelMsg()};a.SendCtrlAltDelMsg=function(){3==a.State&&a.send(String.fromCharCode(0,a.InputType.CTRLALTDEL,0,4))};a.SendEscKey=function(){3==a.State&&a.send(String.fromCharCode(0,a.InputType.KEY,0,6,0,27,0,a.InputType.KEY,
803
-0,6,1,27))};a.SendStartMsg=function(){a.SendKeyMsgKC(a.KeyAction.EXDOWN,91);a.SendKeyMsgKC(a.KeyAction.EXUP,91)};a.SendCharmsMsg=function(){a.SendKeyMsgKC(a.KeyAction.EXDOWN,91);a.SendKeyMsgKC(a.KeyAction.DOWN,67);a.SendKeyMsgKC(a.KeyAction.UP,67);a.SendKeyMsgKC(a.KeyAction.EXUP,91)};a.SendTouchMsg1=function(b,c,d,u){3==a.State&&a.send(String.fromCharCode(0,a.InputType.TOUCH)+a.shortToStr(14)+String.fromCharCode(1,b)+a.intToStr(c)+a.shortToStr(d)+a.shortToStr(u))};a.SendTouchMsg2=function(b,c){var d=
804
-"",u,n;for(n in a.TouchArray)n==b?u=c:1==a.TouchArray[n].f?(u=65542,a.TouchArray[n].f=3):u=2==a.TouchArray[n].f?262144:131078,d+=String.fromCharCode(n)+a.intToStr(u)+a.shortToStr(a.TouchArray[n].x)+a.shortToStr(a.TouchArray[n].y),2==a.TouchArray[n].f&&delete a.TouchArray[n];3==a.State&&a.send(String.fromCharCode(0,a.InputType.TOUCH)+a.shortToStr(5+d.length)+String.fromCharCode(2)+d);0==Object.keys(a.TouchArray).length&&null!=a.touchtimer&&(clearInterval(a.touchtimer),a.touchtimer=null)};a.SendMouseMsg=
805
-function(b,c){if(3==a.State&&null!=b&&null!=a.Canvas){c||(c=window.event);var d=a.Canvas.canvas.height/a.CanvasId.clientHeight,u=a.Canvas.canvas.width/a.CanvasId.clientWidth,n=a.GetPositionOfControl(a.Canvas.canvas),u=(c.pageX-n[0])*u,d=(c.pageY-n[1])*d,n=0==a.rotation?u:1==a.rotation?d:2==a.rotation?a.Canvas.canvas.width-u:3==a.rotation?a.Canvas.canvas.height-d:0,d=0==a.rotation?d:1==a.rotation?a.Canvas.canvas.width-u:2==a.rotation?a.Canvas.canvas.height-d:3==a.rotation?u:0,u=n;if(0<=u&&u<=a.Canvas.canvas.width&&
806
-0<=d&&d<=a.Canvas.canvas.height){var p=n=0;b==a.KeyAction.UP||b==a.KeyAction.DOWN?c.which?1==c.which?n=a.MouseButton.LEFT:2==c.which?n=a.MouseButton.MIDDLE:n=a.MouseButton.RIGHT:c.button&&(0==c.button?n=a.MouseButton.LEFT:1==c.button?n=a.MouseButton.MIDDLE:n=a.MouseButton.RIGHT):b==a.KeyAction.SCROLL&&(c.detail?p=-120*c.detail:c.wheelDelta&&(p=3*c.wheelDelta));var x="",x=b==a.KeyAction.SCROLL?String.fromCharCode(0,a.InputType.MOUSE,0,12,0,b==a.KeyAction.DOWN?n:2*n&255,u/256&255,u&255,d/256&255,d&
807
-255,p/256&255,p&255):String.fromCharCode(0,a.InputType.MOUSE,0,10,0,b==a.KeyAction.DOWN?n:2*n&255,u/256&255,u&255,d/256&255,d&255);a.Action==a.KeyAction.NONE?0==a.Alternate||a.ipad?(a.send(x),a.Alternate=1):a.Alternate=0:a.send(x)}}};a.GetDisplayNumbers=function(){a.send(String.fromCharCode(0,11,0,4))};a.SetDisplay=function(b){a.send(String.fromCharCode(0,12,0,6,b>>8,b&255))};a.intToStr=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};a.shortToStr=function(a){return String.fromCharCode(a>>
808
-8&255,a&255)};a.onResize=function(){if(0!=a.ScreenWidth&&0!=a.ScreenHeight&&(a.Canvas.canvas.width!=a.ScreenWidth||a.Canvas.canvas.height!=a.ScreenHeight)){if(a.FirstDraw&&(a.Canvas.canvas.width=a.ScreenWidth,a.Canvas.canvas.height=a.ScreenHeight,a.Canvas.fillRect(0,0,a.ScreenWidth,a.ScreenHeight),null!=a.onScreenSizeChange))a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.FirstDraw=!1}};a.xxMouseInputGrab=!1;a.xxKeyInputGrab=!1;a.xxMouseMove=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.NONE,
809
-b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseUp=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseDown=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxDOMMouseScroll=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxMouseWheel=
810
-function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxKeyUp=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyDown=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyPress=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};a.handleKeys=
811
-function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyPress(b)};a.handleKeyUp=function(b){if(1==a.stopInput||3!=desktop.State)return!1;if(5>a.firstUpKeys.length&&(a.firstUpKeys.push(b.keyCode),5==a.firstUpKeys.length)){var c=a.firstUpKeys.join(",");if("16,17,91,91,16"==c||"16,17,18,91,92"==c)a.stopInput=!0}return a.xxKeyUp(b)};a.handleKeyDown=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyDown(b)};a.mousedown=function(b){return 1==a.stopInput?!1:a.xxMouseDown(b)};a.mouseup=
812
-function(b){return 1==a.stopInput?!1:a.xxMouseUp(b)};a.mousemove=function(b){return 1==a.stopInput?!1:a.xxMouseMove(b)};a.mousewheel=function(b){return 1==a.stopInput?!1:a.xxMouseWheel(b)};a.xxMsTouchEvent=function(b){if(4!=b.originalEvent.pointerType){b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();if("MSPointerDown"==b.type||"MSPointerMove"==b.type||"MSPointerUp"==b.type){var c=0,d=b.originalEvent.pointerId%256,u=Canvas.canvas.width/a.CanvasId.clientWidth*b.offsetX,n=
813
-Canvas.canvas.height/a.CanvasId.clientHeight*b.offsetY;"MSPointerDown"==b.type?c=65542:"MSPointerMove"==b.type?c=131078:"MSPointerUp"==b.type&&(c=262144);a.TouchArray[d]||(a.TouchArray[d]={x:u,y:n});a.SendTouchMsg2(d,c);"MSPointerUp"==b.type&&delete a.TouchArray[d]}else alert(b.type);return!0}};a.xxTouchStart=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1<b.originalEvent.touches.length)){var c=b.originalEvent.touches[0];b.which=1;a.LastX=
814
-b.pageX=c.pageX;a.LastY=b.pageY=c.pageY;a.SendMouseMsg(KeyAction.DOWN,b)}}else{var c=a.GetPositionOfControl(Canvas.canvas),d;for(d in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[d].identifier){var u=b.originalEvent.changedTouches[d].identifier%256;a.TouchArray[u]||(a.TouchArray[u]={x:Canvas.canvas.width/a.CanvasId.clientWidth*(b.originalEvent.touches[d].pageX-c[0]),y:Canvas.canvas.height/a.CanvasId.clientHeight*(b.originalEvent.touches[d].pageY-c[1]),f:1})}0<Object.keys(a.TouchArray).length&&
815
-null==touchtimer&&(a.touchtimer=setInterval(function(){a.SendTouchMsg2(256,0)},50))}};a.xxTouchMove=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1<b.originalEvent.touches.length)){var c=b.originalEvent.touches[0];b.which=1;a.LastX=b.pageX=c.pageX;a.LastY=b.pageY=c.pageY;a.SendMouseMsg(a.KeyAction.NONE,b)}}else{var c=a.GetPositionOfControl(Canvas.canvas),d;for(d in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[d].identifier){var u=
816
-b.originalEvent.changedTouches[d].identifier%256;a.TouchArray[u]&&(a.TouchArray[u].x=a.Canvas.canvas.width/a.CanvasId.clientWidth*(b.originalEvent.touches[d].pageX-c[0]),a.TouchArray[u].y=a.Canvas.canvas.height/a.CanvasId.clientHeight*(b.originalEvent.touches[d].pageY-c[1]))}}};a.xxTouchEnd=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled)1<b.originalEvent.touches.length||(b.which=1,b.pageX=LastX,b.pageY=LastY,a.SendMouseMsg(KeyAction.UP,b));else for(var c in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[c].identifier){var d=
817
-b.originalEvent.changedTouches[c].identifier%256;a.TouchArray[d]&&(a.TouchArray[d].f=2)}};a.GrabMouseInput=function(){if(1!=a.xxMouseInputGrab){var b=a.CanvasId;b.onmousemove=a.xxMouseMove;b.onmouseup=a.xxMouseUp;b.onmousedown=a.xxMouseDown;b.touchstart=a.xxTouchStart;b.touchmove=a.xxTouchMove;b.touchend=a.xxTouchEnd;b.MSPointerDown=a.xxMsTouchEvent;b.MSPointerMove=a.xxMsTouchEvent;b.MSPointerUp=a.xxMsTouchEvent;navigator.userAgent.match(/mozilla/i)?b.DOMMouseScroll=a.xxDOMMouseScroll:b.onmousewheel=
818
-a.xxMouseWheel;a.xxMouseInputGrab=!0}};a.UnGrabMouseInput=function(){if(0!=a.xxMouseInputGrab){var b=a.CanvasId;b.onmousemove=null;b.onmouseup=null;b.onmousedown=null;b.touchstart=null;b.touchmove=null;b.touchend=null;b.MSPointerDown=null;b.MSPointerMove=null;b.MSPointerUp=null;navigator.userAgent.match(/mozilla/i)?b.DOMMouseScroll=null:b.onmousewheel=null;a.xxMouseInputGrab=!1}};a.GrabKeyInput=function(){1!=a.xxKeyInputGrab&&(document.onkeyup=a.xxKeyUp,document.onkeydown=a.xxKeyDown,document.onkeypress=
819
-a.xxKeyPress,a.xxKeyInputGrab=!0)};a.UnGrabKeyInput=function(){0!=a.xxKeyInputGrab&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,a.xxKeyInputGrab=!1)};a.GetPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};a.crotX=function(b,c){if(0==a.rotation)return b;if(1==a.rotation)return c;if(2==a.rotation)return a.Canvas.canvas.width-b;if(3==a.rotation)return a.Canvas.canvas.height-c};a.crotY=function(b,
820
-c){if(0==a.rotation)return c;if(1==a.rotation)return a.Canvas.canvas.width-b;if(2==a.rotation)return a.Canvas.canvas.height-c;if(3==a.rotation)return b};a.rotX=function(b,c){if(0==a.rotation||1==a.rotation)return b;if(2==a.rotation)return b-a.Canvas.canvas.width;if(3==a.rotation)return b-a.Canvas.canvas.height};a.rotY=function(b,c){if(0==a.rotation||3==a.rotation)return c;if(1==a.rotation)return c-a.Canvas.canvas.width;if(2==a.rotation)return c-a.Canvas.canvas.height};a.tcanvas=null;a.setRotation=
821
-function(b){for(;0>b;)b+=4;b%=4;if(b==a.rotation)return!0;var c=a.Canvas.canvas.width,d=a.Canvas.canvas.height;if(1==a.rotation||3==a.rotation)c=a.Canvas.canvas.height,d=a.Canvas.canvas.width;null==a.tcanvas&&(a.tcanvas=document.createElement("canvas"));var u=a.tcanvas.getContext("2d");u.setTransform(1,0,0,1,0,0);u.canvas.width=c;u.canvas.height=d;u.rotate(-90*a.rotation*Math.PI/180);0==a.rotation&&u.drawImage(a.Canvas.canvas,0,0);1==a.rotation&&u.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,
822
-0);2==a.rotation&&u.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,-a.Canvas.canvas.height);3==a.rotation&&u.drawImage(a.Canvas.canvas,0,-a.Canvas.canvas.height);if(0==a.rotation||2==a.rotation)a.Canvas.canvas.height=c,a.Canvas.canvas.width=d;if(1==a.rotation||3==a.rotation)a.Canvas.canvas.height=d,a.Canvas.canvas.width=c;a.Canvas.setTransform(1,0,0,1,0,0);a.Canvas.rotate(90*b*Math.PI/180);a.rotation=b;a.Canvas.drawImage(a.tcanvas,a.rotX(0,0),a.rotY(0,0));a.ScreenWidth=a.Canvas.canvas.width;a.ScreenHeight=
823
-a.Canvas.canvas.height;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);return!0};a.MuchTheSame=function(a,b){return 4>Math.abs(a-b)};a.Debug=function(a){console.log(a)};a.getIEVersion=function(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a};a.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};
824
-return a},CreateKvmDataChannel=function(b,c,a){var d={};d.m=c;c.parent=d;d.webchannel=b;d.State=0;d.protocol=c.protocol;d.onStateChanged=null;d.onControlMsg=null;d.debugmode=0;d.keepalive=a;d.rtcKeepAlive=null;d.Start=function(){1==d.debugmode&&console.log("start");d.xxStateChange(3);d.webchannel.onmessage=d.xxOnMessage;d.rtcKeepAlive=setInterval(d.xxSendRtcKeepAlive,3E4)};var e=new FileReader,k=!1,l=[];e.readAsBinaryString?e.onload=function(a){d.xxOnSocketData(a.target.result);0==l.length?k=!1:e.readAsBinaryString(new Blob([l.shift()]))}:
825
-e.readAsArrayBuffer&&(e.onloadend=function(a){d.xxOnSocketData(a.target.result);0==l.length?k=!1:e.readAsArrayBuffer(l.shift())});d.xxOnMessage=function(a){if("string"==typeof a.data){if(null!=d.onControlMsg)d.onControlMsg(a.data)}else if("object"==typeof a.data)if(1==k)l.push(a.data);else if(e.readAsBinaryString)k=!0,e.readAsBinaryString(new Blob([a.data]));else if(f.readAsArrayBuffer)k=!0,e.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,x=0;x<c;x++)b+=String.fromCharCode(a[x]);
826
-d.xxOnSocketData(b)}else d.xxOnSocketData(a.data)};d.xxOnSocketData=function(a){if(a){if("object"===typeof a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,e=0;e<c;e++)b+=String.fromCharCode(a[e]);a=b}else if("string"!==typeof a)return;return d.m.ProcessData(a)}};d.sendCtrlMsg=function(a){"string"==typeof a&&(d.webchannel.send(a),urlvars&&urlvars.webrtctrace&&console.log("WebRTC-Send("+d.State+"): ",typeof a,a),null!=d.keepalive&&d.keepalive.sendKeepAlive())};d.send=function(a){if("string"==
827
-typeof a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);a=b}urlvars&&urlvars.webrtctrace&&console.log("WebRTC-Send("+d.State+"): ",typeof a,a);d.webchannel.send(a)};d.xxStateChange=function(a){if(d.State!=a&&(d.State=a,d.m.xxStateChange(d.State),null!=d.onStateChanged))d.onStateChanged(d,d.State)};d.Stop=function(){1==d.debugmode&&console.log("stop");null!=d.rtcKeepAlive&&(clearInterval(d.rtcKeepAlive),d.rtcKeepAlive=null);d.xxStateChange(0)};d.xxSendRtcKeepAlive=function(){urlvars&&
828
-urlvars.webrtctrace&&console.log("WebRTC-SendKeepAlive()");d.sendCtrlMsg(JSON.stringify({action:"ping"}))};return d},CreateAmtRemoteTerminal=function(b){function c(b){if("\x00"!=b&&7!=b.charCodeAt()){var d=b.charCodeAt();if(0==l.terminalEmulation){b=!0;0==(d&128)?(z=d,B=0,b=!1):192==(d&224)?(z=d&31,B=1,b=!0):224==(d&240)?(z=d&15,B=2,b=!0):128==(d&192)&&(0<B?(z<<=6,z+=d&63,B--,b=0!=B):(B=z=0,b=!0));if(1==b)return;b=String.fromCharCode(z)}else 1==l.terminalEmulation?0!=(d&128)&&(b=String.fromCharCode(I[d&
829
-127])):2==l.terminalEmulation&&0!=(d&128)&&(b=String.fromCharCode(F[d&127]));switch(d){case 16:b=" ";break;case 24:b="\u2191";break;case 25:b="\u2193"}w>l.width&&(w=l.width);h>l.height-1&&(h=l.height-1);switch(b){case "\b":0<w&&(--w,a(" "));break;case "\t":d=8-w%8;for(b=0;b<d;b++)c(" ");break;case "\n":h++;h>l.height-1&&(k(1),h=l.height-1);break;case "\r":w=0;break;default:w>=l.width&&(w=0,m&&h++,h>=l.height-1&&(k(1),h=l.height-1)),a(b),w++}}}function a(a){E[h][w]=a;r[h][w]=(p<<6)+(x<<12)+n}function d(){for(var a=
830
-x<<12,b=w;b<l.width;b++)E[h][b]=" ",r[h][b]=a}function e(a){for(var b=x<<12,c=0;c<l.width;c++)E[a][c]=" ",r[a][c]=b}function k(a){var b;for(b=0;b<l.height-a;b++)E[b]=E[b+a],r[b]=r[b+a];for(b=l.height-a;b<l.height;b++)for(E[b]=[],r[b]=[],a=0;a<l.width;a++)E[b][a]=" ",r[b][a]=448}var l={};l.DivId=b;l.DivElement=document.getElementById(b);l.protocol=1;l.terminalEmulation=1;l.fxEmulation=0;l.fxLineBreak=0;l.width=80;l.height=25;var u="000000 BB0000 00BB00 BBBB00 0000BB BB00BB 00BBBB BBBBBB 555555 FF5555 55FF55 FFFF55 5555FF FF55FF 55FFFF FFFFFF".split(" "),
831
-n=0,p=7,x=0,m=!0,w=0,h=0,v=0,g=[],K=0,r=[],E=[],z=0,B=0;l.Start=function(){};l.Init=function(a,b){l.width=a?a:80;l.height=b?b:25;for(var c=0;c<l.height;c++){E[c]=[];r[c]=[];for(var d=0;d<l.width;d++)E[c][d]=" ",r[c][d]=448}l.TermInit();l.TermDraw()};l.xxStateChange=function(a){};l.ProcessData=function(a){null!=l.capture&&(l.capture+=a);for(var b=0;b<a.length;b++){var k=String.fromCharCode(a.charCodeAt(b)),u=a.charCodeAt(b);switch(v){case 0:switch(u){case 27:v=1;break;default:c(k)}break;case 1:switch(k){case "[":K=
832
-0;g=[];v=2;break;case "(":v=4;break;case ")":v=5;break;default:v=0}break;case 2:if("0"<=k&&"9">=k){g[K]=g[K]?10*g[K]+(k-0):k-0;break}else if(";"==k){K++;break}else{g[0]||(g[0]=0);var u=g,B=K+1,z=void 0;switch(k){case "c":l.TermResetScreen();break;case "A":1==B&&(h-=u[0],0>h&&(h=0));break;case "B":1==B&&(h+=u[0],h>l.height&&(h=l.height));break;case "C":1==B&&(w+=u[0],w>l.width&&(w=l.width));break;case "D":1==B&&(w-=u[0],0>w&&(w=0));break;case "d":1==B&&(h=u[0]-1,h>l.height&&(h=l.height),0>h&&(h=0));
833
-break;case "G":1==B&&(w=u[0]-1,0>w&&(w=0),79<w&&(w=79));break;case "J":if(1==B&&2==u[0])l.TermClear((x<<12)+(p<<6)),h=w=0;else if(0==B||1==B&&0==u[0])for(d(),z=h+1;z<l.height;z++)e(z);else if(1==B&&1==u[0])for(d(),z=0;z<h-1;z++)e(z);break;case "H":2==B?(1>u[0]&&(u[0]=1),1>u[1]&&(u[1]=1),u[0]>l.height&&(u[0]=l.height),u[1]>l.width&&(u[1]=l.width),h=u[0]-1,w=u[1]-1):w=h=0;break;case "m":for(z=0;z<B;z++)u[z]&&0!=u[z]?1==u[z]?8>p&&(p+=8):2==u[z]||22==u[z]?8<=p&&(p-=8):7==u[z]?n=2:27==u[z]?n=0:30<=u[z]&&
834
-37>=u[z]?(k=8<=p,p=u[z]-30,k&&8>=p&&(p+=8)):40<=u[z]&&47>=u[z]?x=u[z]-40:90<=u[z]&&99>=u[z]?p=u[z]-82:100<=u[z]&&109>=u[z]&&(x=u[z]-92):(x=0,p=7,n=0);break;case "K":if(0!=B&&(1!=B||u[0]&&0!=u[0])){if(1==B)if(1==u[0])for(k=x<<12,u=0;u<w;u++)E[h][u]=" ",r[h][u]=k;else 2==u[0]&&e(h)}else d();break;case "h":m=!0;break;case "l":m=!1}v=0}break;case 4:v=0;break;case 5:v=0}}l.TermDraw()};l.ProcessVt100String=function(a){for(var b=0;b<a.length;b++)c(String.fromCharCode(a.charCodeAt(b)))};var I=[199,252,233,
835
-226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,
836
-8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],F=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,
837
-223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];l.TermClear=function(a){for(var b=0;b<l.height;b++)for(var c=0;c<l.width;c++)E[b][c]=" ",r[b][c]=a};l.TermResetScreen=function(){n=0;p=7;x=0;m=!0;h=w=0;l.TermClear(448)};l.TermSendKeys=function(a){console.log(a);l.parent.Send(a)};l.TermSendKey=function(a){l.parent.Send(String.fromCharCode(a))};l.TermHandleKeys=function(a){if(!a.ctrlKey)return 127==a.which?l.TermSendKey(8):
838
-13==a.which?l.TermSendKeys(0==l.fxLineBreak?"\r\n":"\n"):0!=a.which&&l.TermSendKey(a.which),!1;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation()};l.TermHandleKeyUp=function(a){if(8!=a.which&&32!=a.which&&9!=a.which)return!0;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};l.TermHandleKeyDown=function(a){if(65<=a.which&&90>=a.which&&1==a.ctrlKey)l.TermSendKey(a.which-64),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation();
839
-else{if(27==a.which)return l.TermSendKeys(String.fromCharCode(27)),!0;if(37==a.which)return l.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==a.which)return l.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==a.which)return l.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==a.which)return l.TermSendKeys(String.fromCharCode(27,91,66)),!0;if(9==a.which)return l.TermSendKeys("\t"),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!0;var b=[80,81,119,120,116,117,
840
-113,114,112,77],c=[49,50,51,52,53,54,55,56,57,48,33,64],d=[80,81,82,83,84,85,86,87,88,89,90,91];if(111<a.which&124>a.which&&0==a.repeat){if(0==l.fxEmulation&&122>a.which)return l.TermSendKeys(String.fromCharCode(27,91,79,b[a.which-112])),!0;if(1==l.fxEmulation)return l.TermSendKeys(String.fromCharCode(27,c[a.which-112])),!0;if(2==l.fxEmulation)return l.TermSendKeys(String.fromCharCode(27,79,d[a.which-112])),!0}if(8!=a.which&&32!=a.which&&9!=a.which)return!0;l.TermSendKey(a.which);a.preventDefault&&
841
-a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}};l.TermDraw=function(){for(var a,b="",c="",d=1,e,g=0;g<l.height;++g){for(var k=0;k<l.width;++k)switch(a=r[g][k],w==k&&h==g&&(a|=2),a!=d&&(b+=c,c="",d=6,e=12,a&2&&(d=12,e=6),b+='<span style="color:#'+u[a>>d&63]+";background-color:#"+u[a>>e&63],a&1&&(b+=";text-decoration:underline"),b+=';">',c="</span>"+c,d=a),a=E[g][k],a){case "&":b+="&";break;case "<":b+="<";break;case ">":b+=">";break;case " ":b+=" ";break;default:b+=
842
-a}g!=l.height-1&&(b+="<br>")}l.DivElement.innerHTML="<font size='4'><b>"+b+c+"</b></font>"};l.TermInit=function(){l.TermResetScreen()};l.Init();return l},ZLIB=ZLIB||{};
757
+function script_compile(b,c){var a="",d=b.split("\n"),e={},q=[],h=[],r;for(r in d){var n=d[r];if(n.startsWith("##SWAP ")){var m=n.split(" ");3==m.length&&(h[m[1]]=m[2])}if("#"!=n[0]&&0!=n.length){for(m in h)n=n.split(m).join(h[m]);var w=n.match(/"[^"]*"|[^\s"]+/g);if(0!=w.length)if(":"==n[0])e[w[0].toUpperCase()]=a.length;else{n=script_functionTable1.indexOf(w[0].toLowerCase());-1==n&&(n=script_functionTable2.indexOf(w[0].toLowerCase()),0<=n&&(n+=1E4));-1==n&&(n=script_functionTable3.indexOf(w[0].toLowerCase()),
758
+0<=n&&(n+=2E4));if(-1==n)return c&&c("Unabled to compile, unknown command: "+w[0]),"";var k=ShortToStr(w.length-1),v;for(v in w)if(0!=v)if(":"==w[v][0])q.push([w[v],a.length+k.length+7]),k+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var B=parseInt(w[v]),k=B==w[v]?k+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(B)):'"'==w[v][0]&&'"'==w[v][w[v].length-1]?k+(ShortToStr(w[v].length-1)+String.fromCharCode(1)+w[v].substring(1,w[v].length-1)):k+(ShortToStr(w[v].length+1)+String.fromCharCode(0)+
759
+w[v]);k=ShortToStr(n)+ShortToStr(k.length+4)+k;a+=k}}}for(r in q){d=q[r][0].toUpperCase();h=q[r][1];m=e[d];if(void 0==m)return c&&c("Unabled to compile, unknown label: "+d),"";a=a.substr(0,h)+IntToStr(m)+a.substr(h+4)}return IntToStr(612182341)+ShortToStr(1)+a}
760
+function script_decompile(b,c){var a="",d=6,e={};if(0<=c)d=c;else{if(6>b.length)return"# Invalid script length";var q=ReadInt(b,0),h=ReadShort(b,4);if(612182341!=q)return"# Invalid binary script: "+q;if(1!=h)return"# Invalid script version"}for(;d<b.length;){var q=ReadShort(b,d),h=ReadShort(b,d+2),r=ReadShort(b,d+4),n=d+6,m="";0<=c||(a+=":label"+(d-6)+"\n");for(var w=0;w<r;w++){var k=ReadShort(b,n),v=b.substring(n+2,n+2+k),B=v.charCodeAt(0);0==B?m+=" "+v.substring(1):1==B?m+=' "'+v.substring(1)+'"':
761
+2==B?m+=" "+ReadInt(v,1):3==B&&(v=ReadInt(v,1),B=e[v],B||(B=":label"+v,e[B]=v),m+=" "+B);n+=2+k}a=1E4>q?a+(script_functionTable1[q]+m+"\n"):2E4<=q?a+(script_functionTable3[q-2E4]+m+"\n"):a+(script_functionTable2[q-1E4]+m+"\n");d+=h;if(0<=c)return a}d=a.split("\n");a="";for(w in d)q=d[w],":"!=q[0]?a+=q+"\n":e[q]&&(a+=q+"\n");return a}
762
+var CreateAmtRemoteDesktop=function(b,c){function a(a,b,c,l,m,n,y,u){var B=a.charCodeAt(b++);u={};var D=0,p=0;if(0==B){if(2==g.bpp)for(m=0;m<y;m++)q(a.charCodeAt(b++)+(a.charCodeAt(b++)<<8),m);else for(m=0;m<y;m++)e(a.charCodeAt(b++),m);d(g.spare,c,l)}else if(1==B)B=a.charCodeAt(b++)+(2==g.bpp?a.charCodeAt(b++)<<8:0),g.canvas.fillStyle="rgb("+(1==g.bpp?(B&224)+","+((B&28)<<3)+","+v((B&3)<<6):(B>>8&248)+","+(B>>3&252)+","+((B&31)<<3))+")",a=w(c,l),l=k(c,l),g.canvas.fillRect(a,l,m,n);else if(1<B&&17>
763
+B){n=4;p=15;if(2==g.bpp){for(m=0;m<B;m++)u[m]=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);2==B?p=n=1:4>=B&&(n=2,p=3);for(;D<y&&b<a.length;)for(B=a.charCodeAt(b++),m=8-n;0<=m;m-=n)q(u[B>>m&p],D++)}else{for(m=0;m<B;m++)u[m]=a.charCodeAt(b++);2==B?p=n=1:4>=B&&(n=2,p=3);for(;D<y&&b<a.length;)for(B=a.charCodeAt(b++),m=8-n;0<=m;m-=n)e(u[B>>m&p],D++)}d(g.spare,c,l)}else if(128==B){if(2==g.bpp)for(;D<y&&b<a.length;){B=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);p=1;do p+=m=a.charCodeAt(b++);while(255==m);if(0==
764
+g.rotation)r(B,D,p),D+=p;else for(;0<=--p;)q(B,D++)}else for(;D<y&&b<a.length;){B=a.charCodeAt(b++);p=1;do p+=m=a.charCodeAt(b++);while(255==m);if(0==g.rotation)h(B,D,p),D+=p;else for(;0<=--p;)e(B,D++)}d(g.spare,c,l)}else if(129<B){if(2==g.bpp)for(m=0;m<B-128;m++)u[m]=a.charCodeAt(b++)+(a.charCodeAt(b++)<<8);else for(m=0;m<B-128;m++)u[m]=a.charCodeAt(b++);for(;D<y&&b<a.length;){p=1;m=a.charCodeAt(b++);B=u[m%128];if(127<m){do p+=m=a.charCodeAt(b++);while(255==m)}if(0==g.rotation)2==g.bpp?r(B,D,p):
765
+h(B,D,p),D+=p;else if(2==g.bpp)for(;0<=--p;)q(B,D++);else for(;0<=--p;)e(B,D++)}d(g.spare,c,l)}}function d(a,b,c){if(1!=g.holding){var d=0==g.rotation?b:1==g.rotation?g.canvas.canvas.width-g.sparew2-c:2==g.rotation?g.canvas.canvas.width-g.sparew2-b:3==g.rotation?c:0;c=0==g.rotation?c:1==g.rotation?b:2==g.rotation?g.canvas.canvas.height-g.spareh2-c:3==g.rotation?g.canvas.canvas.height-g.spareh-b:0;g.canvas.putImageData(a,d,c)}}function e(a,b){var c=b<<2;if(0<g.rotation)if(1==g.rotation){var c=b%g.sparew,
766
+d=Math.floor(b/g.sparew);b=c*g.sparew2+(g.sparew2-1-d);c=b<<2}else 2==g.rotation?c=g.sparew*g.spareh*4-4-c:3==g.rotation&&(c=b%g.sparew,d=Math.floor(b/g.sparew),b=(g.sparew2-1-c)*g.sparew2+d,c=b<<2);0==g.graymode?(g.spare.data[c]=a&224,g.spare.data[c+1]=(a&28)<<3,g.spare.data[c+2]=v((a&3)<<6)):g.spare.data[c]=g.spare.data[c+1]=g.spare.data[c+2]=a}function q(a,b){var c=b<<2;if(0<g.rotation)if(1==g.rotation){var c=b%g.sparew,d=Math.floor(b/g.sparew);b=c*g.sparew2+(g.sparew2-1-d);c=b<<2}else 2==g.rotation?
767
+c=g.sparew*g.spareh*4-4-c:3==g.rotation&&(c=b%g.sparew,d=Math.floor(b/g.sparew),b=(g.sparew2-1-c)*g.sparew2+d,c=b<<2);g.spare.data[c]=a>>8&248;g.spare.data[c+1]=a>>3&252;g.spare.data[c+2]=(a&31)<<3}function h(a,b,c){b<<=2;var d=a&224,e=(a&28)<<3;for(a=v((a&3)<<6);0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function r(a,b,c){b<<=2;var d=a>>8&248,e=a>>3&252;for(a=(a&31)<<3;0<=--c;)g.spare.data[b]=d,g.spare.data[b+1]=e,g.spare.data[b+2]=a,b+=4}function n(a,b){return 0==g.rotation?
768
+a:1==g.rotation?b:2==g.rotation?g.canvas.canvas.width-a:3==g.rotation?g.canvas.canvas.height-b:0}function m(a,b){return 0==g.rotation?b:1==g.rotation?g.canvas.canvas.width-a:2==g.rotation?g.canvas.canvas.height-b:3==g.rotation?a:0}function w(a,b){return 0==g.rotation||1==g.rotation?a:2==g.rotation?a-g.canvas.canvas.width:3==g.rotation?a-g.canvas.canvas.height:0}function k(a,b){return 0==g.rotation?b:1==g.rotation?b-g.canvas.canvas.width:2==g.rotation?b-g.canvas.canvas.height:3==g.rotation?b:0}function v(a){return 127<
769
+a?a+32:a}function B(){1!=g.holding&&g.Send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(g.rwidth)+ShortToStr(g.rheight))}function l(a,b){b||(b=window.event);if(b.code){var c;c=b;c=c.code.startsWith("Key")&&4==c.code.length?c.code.charCodeAt(3)+(0==c.shiftKey?32:0):c.code.startsWith("Digit")&&6==c.code.length?c.code.charCodeAt(5):c.code.startsWith("Numpad")&&7==c.code.length?c.code.charCodeAt(6):I[c.code];null!=c&&g.sendkey(c,a)}else{c=b.keyCode;173==c&&(c=189);61==c&&(c=187);var d=c;0==b.shiftKey&&
770
+65<=c&&90>=c&&(d=c+32);112<=c&&124>=c&&(d=c+65358);8==c&&(d=65288);9==c&&(d=65289);13==c&&(d=65293);16==c&&(d=65505);17==c&&(d=65507);18==c&&(d=65513);27==c&&(d=65307);33==c&&(d=65365);34==c&&(d=65366);35==c&&(d=65367);36==c&&(d=65360);37==c&&(d=65361);38==c&&(d=65362);39==c&&(d=65363);40==c&&(d=65364);45==c&&(d=65379);46==c&&(d=65535);96<=c&&105>=c&&(d=c-48);106==c&&(d=42);107==c&&(d=43);109==c&&(d=45);110==c&&(d=46);111==c&&(d=47);186==c&&(d=59);187==c&&(d=61);188==c&&(d=44);189==c&&(d=45);190==
771
+c&&(d=46);191==c&&(d=47);192==c&&(d=96);219==c&&(d=91);220==c&&(d=92);221==c&&(d=93);222==c&&(d=39);g.sendkey(d,a)}return g.haltEvent(b)}var g={};g.canvasid=b;g.scrolldiv=c;g.canvas=Q(b).getContext("2d");g.protocol=2;g.state=0;g.acc="";g.ScreenWidth=960;g.ScreenHeight=700;g.width=0;g.height=0;g.rwidth=0;g.rheight=0;g.bpp=2;g.graymode=0;g.useZRLE=!0;g.showmouse=!0;g.buttonmask=0;g.spare=null;g.sparew=0;g.spareh=0;g.sparew2=0;g.spareh2=0;g.sparecache={};g.ZRLEfirst=1;g.onScreenSizeChange=null;g.frameRateDelay=
772
+0;g.noMouseRotate=!1;g.rotation=0;g.kvmDataSupported=!1;g.onKvmData=null;g.onKvmDataPending=[];g.onKvmDataAck=-1;g.holding=!1;g.lastKeepAlive=Date.now();g.mNagleTimer=null;g.mx=0;g.my=0;g.inflate=ZLIB.inflateInit(-15);g.Debug=function(a){console.log(a)};g.xxStateChange=function(a){0==a?(g.canvas.fillStyle="#000000",g.canvas.fillRect(0,0,g.width,g.height),g.canvas.canvas.width=g.rwidth=g.width=640,g.canvas.canvas.height=g.rheight=g.height=400,QS(g.canvasid).cursor="auto",g.inflate=ZLIB.inflateInit(-15)):
773
+g.showmouse||(QS(g.canvasid).cursor="none")};g.ProcessData=function(b){if(b)for(g.acc+=b;0<g.acc.length;){var c=0;if(0==g.state&&12<=g.acc.length)c=12,g.state=1,g.Send("RFB 003.008\n");else if(1==g.state&&1<=g.acc.length)c=g.acc.charCodeAt(0)+1,g.Send(String.fromCharCode(1)),g.state=2;else if(2==g.state&&4<=g.acc.length){c=4;if(0!=ReadInt(g.acc,0))return g.Stop();g.Send(String.fromCharCode(1));g.state=3}else if(3==g.state&&24<=g.acc.length){g.rotation=0;b=ReadInt(g.acc,20);if(g.acc.length<24+b)break;
774
+c=24+b;g.canvas.canvas.width=g.rwidth=g.width=g.ScreenWidth=ReadShort(g.acc,0);g.canvas.canvas.height=g.rheight=g.height=g.ScreenHeight=ReadShort(g.acc,2);b="";g.useZRLE&&(b+=IntToStr(16));b+=IntToStr(0);b+=IntToStr(1092);g.Send(String.fromCharCode(2,0)+ShortToStr(b.length/4+1)+b+IntToStr(-223));0==g.graymode?1==g.bpp&&g.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(7)+ShortToStr(7)+ShortToStr(3)+String.fromCharCode(5,2,0,0,0,0)):(g.bpp=1,1==g.graymode&&g.Send(String.fromCharCode(0,0,0,0,8,
775
+8,0,1)+ShortToStr(255)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)),2==g.graymode&&g.Send(String.fromCharCode(0,0,0,0,8,8,0,1)+ShortToStr(15)+ShortToStr(0)+ShortToStr(0)+String.fromCharCode(0,0,0,0,0,0)));g.state=4;g.parent.xxStateChange(3);B();if(null!=g.onScreenSizeChange)g.onScreenSizeChange(g,g.ScreenWidth,g.ScreenHeight)}else if(4==g.state)switch(g.acc.charCodeAt(0)){case 0:if(4>g.acc.length)return;g.state=100+ReadShort(g.acc,2);c=4;break;case 2:c=1;break;case 3:if(8>g.acc.length)return;
776
+b=ReadInt(g.acc,4)+8;if(g.acc.length<b)return;var h=g.acc;if(8>h.length)c=0;else if(b=ReadInt(g.acc,4)+8,h.length<b)c=0;else{if(null!=g.onKvmData&&(h=h.substring(8,b),16<=h.length&&"\x00KvmDataChannel"==h.substring(0,15))){0==g.kvmDataSupported&&(g.kvmDataSupported=!0,console.log("KVM Data Channel Supported."));if(-1==g.onKvmDataAck&&16==h.length||0!=h.charCodeAt(15))g.onKvmDataAck=!0;urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Recv("+(h.length-16)+"): "+h.substring(16));if(16<h.length)g.onKvmData(h.substring(16));
777
+1==g.onKvmDataAck&&0<g.onKvmDataPending.length&&g.sendKvmData(g.onKvmDataPending.shift())}c=b}}else if(100<g.state&&12<=g.acc.length){b=ReadShort(g.acc,0);var h=ReadShort(g.acc,2),c=ReadShort(g.acc,4),k=ReadShort(g.acc,6),l=c*k,m=ReadInt(g.acc,8);if(17>m){if(1>c||64<c||1>k||64<k)return console.log("Invalid tile size ("+c+","+k+"), disconnecting."),g.Stop();if(g.sparew!=c||g.spareh!=k){g.sparew=g.sparew2=c;g.spareh=g.spareh2=k;if(1==g.rotation||3==g.rotation)g.sparew2=k,g.spareh2=c;var n=g.sparew2+
778
+"x"+g.spareh2;g.spare=g.sparecache[n];if(!g.spare){g.sparecache[n]=g.spare=g.canvas.createImageData(g.sparew2,g.spareh2);for(var r=g.sparew2*g.spareh2<<2,n=3;n<r;n+=4)g.spare.data[n]=255}}}if(4294967073==m){if(g.canvas.canvas.width=g.ScreenWidth=g.rwidth=g.width=c,g.canvas.canvas.height=g.ScreenHeight=g.rheight=g.height=k,g.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(g.width)+ShortToStr(g.height)),c=12,null!=g.onScreenSizeChange)g.onScreenSizeChange(g,g.ScreenWidth,g.ScreenHeight)}else if(0==
779
+m){m=12;c=12+l*g.bpp;if(g.acc.length<c)break;if(2==g.bpp)for(n=0;n<l;n++)q(g.acc.charCodeAt(m++)+(g.acc.charCodeAt(m++)<<8),n);else for(n=0;n<l;n++)e(g.acc.charCodeAt(m++),n);d(g.spare,b,h)}else if(16==m){if(16>g.acc.length)break;n=ReadInt(g.acc,12);if(g.acc.length<16+n)break;m=16;5<n&&0==g.acc.charCodeAt(m)&&ReadShortX(g.acc,m+1)==n-5?a(g.acc,m+5,b,h,c,k,l,n):(m=g.inflate.inflate(g.acc.substring(m,m+n-0)),0<m.length?a(m,0,b,h,c,k,l,m.length):g.Debug("Invalid deflate data"));c=16+n}else return g.Debug("Unknown Encoding: "+
780
+m+", HEX: "+rstr2hex(g.acc)),g.Stop();100==--g.state&&(g.state=4,0==g.frameRateDelay?B():setTimeout(B,g.frameRateDelay))}if(0==c)break;g.acc=g.acc.substring(c)}};g.hold=function(a){if(g.holding!=a)if(g.holding=a,g.canvas.fillStyle="#000000",g.canvas.fillRect(0,0,g.width,g.height),0==g.holding){if(g.canvas.canvas.width!=g.width||g.canvas.canvas.height!=g.height)if(g.canvas.canvas.width=g.width,g.canvas.canvas.height=g.height,null!=g.onScreenSizeChange)g.onScreenSizeChange(g,g.ScreenWidth,g.ScreenHeight);
781
+g.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(g.width)+ShortToStr(g.height))}else g.UnGrabMouseInput(),g.UnGrabKeyInput()};g.tcanvas=null;g.setRotation=function(a){for(;0>a;)a+=4;a%=4;if(1==g.holding)g.rotation=a;else{if(a==g.rotation)return!0;var b=g.canvas.canvas.width,c=g.canvas.canvas.height;if(1==g.rotation||3==g.rotation)b=g.canvas.canvas.height,c=g.canvas.canvas.width;null==g.tcanvas&&(g.tcanvas=document.createElement("canvas"));var d=g.tcanvas.getContext("2d");d.setTransform(1,0,0,1,
782
+0,0);d.canvas.width=b;d.canvas.height=c;d.rotate(-90*g.rotation*Math.PI/180);0==g.rotation&&d.drawImage(g.canvas.canvas,0,0);1==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,0);2==g.rotation&&d.drawImage(g.canvas.canvas,-g.canvas.canvas.width,-g.canvas.canvas.height);3==g.rotation&&d.drawImage(g.canvas.canvas,0,-g.canvas.canvas.height);if(0==g.rotation||2==g.rotation)g.canvas.canvas.height=b,g.canvas.canvas.width=c;if(1==g.rotation||3==g.rotation)g.canvas.canvas.height=c,g.canvas.canvas.width=
783
+b;g.canvas.setTransform(1,0,0,1,0,0);g.canvas.rotate(90*a*Math.PI/180);g.rotation=a;g.canvas.drawImage(g.tcanvas,w(0,0),k(0,0));g.width=g.canvas.canvas.width;g.height=g.canvas.canvas.height;if(null!=g.onScreenResize)g.onScreenResize(g,g.width,g.height,g.CanvasId);return!0}};g.Start=function(){g.state=0;g.acc="";g.ZRLEfirst=1;g.inflate.inflateReset();g.onKvmDataPending=[];g.onKvmDataAck=-1;g.kvmDataSupported=!1;for(var a in g.sparecache)delete g.sparecache[a]};g.Stop=function(){g.UnGrabMouseInput();
784
+g.UnGrabKeyInput();g.parent.Stop()};g.Send=function(a){g.parent.Send(a)};var I={Pause:19,CapsLock:20,Space:32,Quote:39,Minus:45,NumpadMultiply:42,NumpadAdd:43,PrintScreen:44,Comma:44,NumpadSubtract:45,NumpadDecimal:46,Period:46,Slash:47,NumpadDivide:47,Semicolon:59,Equal:61,OSLeft:91,BracketLeft:91,OSRight:91,Backslash:92,BracketRight:93,ContextMenu:93,Backquote:96,NumLock:144,ScrollLock:145,Backspace:65288,Tab:65289,Enter:65293,NumpadEnter:65293,Escape:65307,Delete:65535,Home:65360,PageUp:65365,
785
+PageDown:65366,ArrowLeft:65361,ArrowUp:65362,ArrowRight:65363,ArrowDown:65364,End:65367,Insert:65379,F1:65470,F2:65471,F3:65472,F4:65473,F5:65474,F6:65475,F7:65476,F8:65477,F9:65478,F10:65479,F11:65480,F12:65481,ShiftLeft:65505,ShiftRight:65506,ControlLeft:65507,ControlRight:65508,AltLeft:65513,AltRight:65514,MetaLeft:65511,MetaRight:65512};g.sendkey=function(a,b){if("object"==typeof a)for(var c in a)g.sendkey(a[c][0],a[c][1]);else g.Send(String.fromCharCode(4,b,0,0)+IntToStr(a))};g.sendKvmData=function(a){!0!==
786
+g.onKvmDataAck?g.onKvmDataPending.push(a):(urlvars&&urlvars.kvmdatatrace&&console.log("KVM-Send("+a.length+"): "+a),a="\x00KvmDataChannel\x00"+a,g.Send(String.fromCharCode(6,0,0,0)+IntToStr(a.length)+a),g.onKvmDataAck=!1)};g.sendKeepAlive=function(){g.lastKeepAlive<Date.now()-5E3&&(g.lastKeepAlive=Date.now(),g.Send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\x00KvmDataChannel\x00"))};g.SendCtrlAltDelMsg=function(){g.sendcad()};g.sendcad=function(){g.sendkey(65507,1);g.sendkey(65513,1);g.sendkey(65535,
787
+1);g.sendkey(65535,0);g.sendkey(65513,0);g.sendkey(65507,0)};var u=!1,D=!1;g.GrabMouseInput=function(){if(1!=u){var a=g.canvas.canvas;a.onmouseup=g.mouseup;a.onmousedown=g.mousedown;a.onmousemove=g.mousemove;u=!0}};g.UnGrabMouseInput=function(){if(0!=u){var a=g.canvas.canvas;a.onmousemove=null;a.onmouseup=null;a.onmousedown=null;u=!1}};g.GrabKeyInput=function(){1!=D&&(document.onkeyup=g.handleKeyUp,document.onkeydown=g.handleKeyDown,document.onkeypress=g.handleKeys,D=!0)};g.UnGrabKeyInput=function(){0!=
788
+D&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,D=!1)};g.handleKeys=function(a){return g.haltEvent(a)};g.handleKeyUp=function(a){return l(0,a)};g.handleKeyDown=function(a){return l(1,a)};g.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};g.mousedown=function(a){g.buttonmask|=1<<a.button;return g.mousemove(a,1)};g.mouseup=function(a){g.buttonmask&=65535-(1<<a.button);return g.mousemove(a,1)};g.mousemove=function(a,
789
+b){if(4>g.state)return!0;var d=g.getPositionOfControl(Q(g.canvasid));g.mx=(a.pageX-d[0])*(g.canvas.canvas.height/Q(g.canvasid).offsetHeight);g.my=(a.pageY-d[1]+(c?c.scrollTop:0))*(g.canvas.canvas.width/Q(g.canvasid).offsetWidth);1!=g.noMouseRotate&&(g.mx2=n(g.mx,g.my),g.my=m(g.mx,g.my),g.mx=g.mx2);1==b?(g.Send(String.fromCharCode(5,g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my)),null!=g.mNagleTimer&&(clearTimeout(g.mNagleTimer),g.mNagleTimer=null)):null==g.mNagleTimer&&(g.mNagleTimer=setTimeout(function(){g.Send(String.fromCharCode(5,
790
+g.buttonmask)+ShortToStr(g.mx)+ShortToStr(g.my));g.mNagleTimer=null},50));return g.haltEvent(a)};g.getPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};return g},CreateAgentRemoteDesktop=function(b,c){var a={};a.CanvasId=b;"string"===typeof b&&(a.CanvasId=Q(b));a.Canvas=a.CanvasId.getContext("2d");a.scrolldiv=c;a.State=0;a.PendingOperations=[];a.tilesReceived=0;a.TilesDrawn=0;a.KillDraw=0;a.ipad=!1;a.tabletKeyboardVisible=
791
+!1;a.LastX=0;a.LastY=0;a.touchenabled=0;a.submenuoffset=0;a.touchtimer=null;a.TouchArray={};a.connectmode=0;a.connectioncount=0;a.rotation=0;a.protocol=2;a.debugmode=0;a.firstUpKeys=[];a.stopInput=!1;a.sessionid=0;a.username;a.oldie=!1;a.CompressionLevel=50;a.ScalingLevel=1024;a.FrameRateTimer=50;a.FirstDraw=!1;a.ScreenWidth=960;a.ScreenHeight=700;a.width=960;a.height=960;a.onScreenSizeChange=null;a.onMessage=null;a.onConnectCountChanged=null;a.onDebugMessage=null;a.onTouchEnabledChanged=null;a.onDisplayinfo=
792
+null;a.Start=function(){a.State=0};a.Stop=function(){a.setRotation(0);a.UnGrabKeyInput();a.UnGrabMouseInput();a.touchenabled=0;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.Canvas.clearRect(0,0,a.CanvasId.width,a.CanvasId.height)};a.xxStateChange=function(b){if(a.State!=b)switch(a.State=b,b){case 0:a.Stop()}};a.send=function(b){a.parent.send(b)};a.ProcessPictureMsg=function(b,c,d){var r=new Image;r.xcount=a.tilesReceived++;var n=a.tilesReceived;r.src=
793
+"data:image/jpeg;base64,"+btoa(b.substring(4,b.length));r.onload=function(){if(null!=a.Canvas&&a.KillDraw<n&&0!=a.State)for(a.PendingOperations.push([n,2,r,c,d]);a.DoPendingOperations(););};r.error=function(){console.log("DecodeTileError")}};a.DoPendingOperations=function(){if(0==a.PendingOperations.length)return!1;for(var b=0;b<a.PendingOperations.length;b++){var c=a.PendingOperations[b];if(c[0]==a.TilesDrawn+1)return 1==c[1]?a.ProcessCopyRectMsg(c[2]):2==c[1]&&(a.Canvas.drawImage(c[2],a.rotX(c[3],
794
+c[4]),a.rotY(c[3],c[4])),delete c[2]),a.PendingOperations.splice(b,1),delete c,a.TilesDrawn++,a.TilesDrawn==a.tilesReceived&&a.KillDraw<a.TilesDrawn&&(a.KillDraw=a.TilesDrawn=a.tilesReceived=0),!0}a.oldie&&0<a.PendingOperations.length&&a.TilesDrawn++;return!1};a.ProcessCopyRectMsg=function(b){var c=((b.charCodeAt(0)&255)<<8)+(b.charCodeAt(1)&255),d=((b.charCodeAt(2)&255)<<8)+(b.charCodeAt(3)&255),r=((b.charCodeAt(4)&255)<<8)+(b.charCodeAt(5)&255),n=((b.charCodeAt(6)&255)<<8)+(b.charCodeAt(7)&255),
795
+m=((b.charCodeAt(8)&255)<<8)+(b.charCodeAt(9)&255);b=((b.charCodeAt(10)&255)<<8)+(b.charCodeAt(11)&255);a.Canvas.drawImage(Canvas.canvas,c,d,m,b,r,n,m,b)};a.SendUnPause=function(){a.send(String.fromCharCode(0,8,0,5,0))};a.SendPause=function(){a.send(String.fromCharCode(0,8,0,5,1))};a.SendCompressionLevel=function(b,c,d,r){c&&(a.CompressionLevel=c);d&&(a.ScalingLevel=d);r&&(a.FrameRateTimer=r);a.send(String.fromCharCode(0,5,0,10,b,a.CompressionLevel)+a.shortToStr(a.ScalingLevel)+a.shortToStr(a.FrameRateTimer))};
796
+a.SendRefresh=function(){a.send(String.fromCharCode(0,6,0,4))};a.ProcessScreenMsg=function(b,c){a.Canvas.setTransform(1,0,0,1,0,0);a.rotation=0;a.FirstDraw=!0;a.ScreenWidth=a.width=b;a.ScreenHeight=a.height=c;for(a.KillDraw=a.tilesReceived;0<a.PendingOperations.length;)a.PendingOperations.shift();a.SendCompressionLevel(1);a.SendUnPause();if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId)};a.ProcessData=function(b){for(var c=0;c<b.length;)c+=a.ProcessDataEx(b.substring(c))};
797
+a.ProcessDataEx=function(b){if(!(4>b.length)){var c=null,d=0,r=0,n=ReadShort(b,0),m=ReadShort(b,2);m!=b.length&&1==a.debugmode&&console.log(m,b.length,m==b.length);if(18<=n)console.error("Invalid KVM command "+n+" of size "+m),console.log("Invalid KVM data",b.length,b,rstr2hex(b));else if(m>b.length)console.error("KVM invalid command size",m,b.length);else{if(3==n||4==n||7==n)c=b.substring(4,m),d=((c.charCodeAt(0)&255)<<8)+(c.charCodeAt(1)&255),r=((c.charCodeAt(2)&255)<<8)+(c.charCodeAt(3)&255);switch(n){case 3:if(a.FirstDraw)a.onResize();
798
+a.ProcessPictureMsg(c,d,r);break;case 4:if(a.FirstDraw)a.onResize();a.TilesDrawn==a.tilesReceived?a.ProcessCopyRectMsg(c):a.PendingOperations.push([++tilesReceived,1,c]);break;case 7:a.ProcessScreenMsg(d,r);a.SendKeyMsgKC(a.KeyAction.UP,16);a.SendKeyMsgKC(a.KeyAction.UP,17);a.SendKeyMsgKC(a.KeyAction.UP,18);a.SendKeyMsgKC(a.KeyAction.UP,91);a.SendKeyMsgKC(a.KeyAction.UP,92);a.SendKeyMsgKC(a.KeyAction.UP,16);a.send(String.fromCharCode(0,14,0,4));break;case 11:c=[];d=((b.charCodeAt(4)&255)<<8)+(b.charCodeAt(5)&
799
+255);if(0<d)for(var w=0,r=((b.charCodeAt(6+2*d)&255)<<8)+(b.charCodeAt(7+2*d)&255),n=0;n<d;n++){var k=((b.charCodeAt(6+2*n)&255)<<8)+(b.charCodeAt(7+2*n)&255);65535==k?c.push("All Displays"):c.push("Display "+k);k==r&&(w=n)}if(null!=a.onDisplayinfo)a.onDisplayinfo(a,c,w);break;case 14:a.touchenabled=1;a.TouchArray={};if(null!=a.onTouchEnabledChanged)a.onTouchEnabledChanged(a.touchenabled);break;case 15:a.TouchArray={};break;case 16:a.connectioncount=ReadInt(b,4);if(null!=a.onConnectCountChanged)a.onConnectCountChanged(a.connectioncount,
800
+a);break;case 17:if(null!=a.onMessage)a.onMessage(b.substring(4,m),a)}return m}}};a.MouseButton={NONE:0,LEFT:2,RIGHT:8,MIDDLE:32};a.KeyAction={NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5};a.InputType={KEY:1,MOUSE:2,CTRLALTDEL:10,TOUCH:15};a.Alternate=0;var d={Pause:19,CapsLock:20,Space:32,Quote:222,Minus:189,NumpadMultiply:106,NumpadAdd:107,PrintScreen:44,Comma:188,NumpadSubtract:109,NumpadDecimal:110,Period:190,Slash:191,NumpadDivide:111,Semicolon:186,Equal:187,OSLeft:91,BracketLeft:219,OSRight:91,
801
+Backslash:220,BracketRight:221,ContextMenu:93,Backquote:192,NumLock:144,ScrollLock:145,Backspace:8,Tab:9,Enter:13,NumpadEnter:13,Escape:27,Delete:46,Home:36,PageUp:33,PageDown:34,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,End:35,Insert:45,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,ShiftLeft:16,ShiftRight:16,ControlLeft:17,ControlRight:17,AltLeft:18,AltRight:18,MetaLeft:91,MetaRight:92,VolumeMute:181};a.SendKeyMsg=function(b,c){if(null!=b)if(c||(c=
802
+window.event),c.code){var h;h=c;h=h.code.startsWith("Key")&&4==h.code.length?h.code.charCodeAt(3):h.code.startsWith("Digit")&&6==h.code.length?h.code.charCodeAt(5):h.code.startsWith("Numpad")&&7==h.code.length?h.code.charCodeAt(6)+48:d[h.code];null!=h&&a.SendKeyMsgKC(b,h)}else h=c.keyCode,59==h&&(h=186),a.SendKeyMsgKC(b,h)};a.SendMessage=function(b){3==a.State&&a.send(String.fromCharCode(0,17)+a.shortToStr(4+b.length)+b)};a.SendKeyMsgKC=function(b,c){3==a.State&&a.send(String.fromCharCode(0,a.InputType.KEY,
803
+0,6,b-1,c))};a.sendcad=function(){a.SendCtrlAltDelMsg()};a.SendCtrlAltDelMsg=function(){3==a.State&&a.send(String.fromCharCode(0,a.InputType.CTRLALTDEL,0,4))};a.SendEscKey=function(){3==a.State&&a.send(String.fromCharCode(0,a.InputType.KEY,0,6,0,27,0,a.InputType.KEY,0,6,1,27))};a.SendStartMsg=function(){a.SendKeyMsgKC(a.KeyAction.EXDOWN,91);a.SendKeyMsgKC(a.KeyAction.EXUP,91)};a.SendCharmsMsg=function(){a.SendKeyMsgKC(a.KeyAction.EXDOWN,91);a.SendKeyMsgKC(a.KeyAction.DOWN,67);a.SendKeyMsgKC(a.KeyAction.UP,
804
+67);a.SendKeyMsgKC(a.KeyAction.EXUP,91)};a.SendTouchMsg1=function(b,c,d,r){3==a.State&&a.send(String.fromCharCode(0,a.InputType.TOUCH)+a.shortToStr(14)+String.fromCharCode(1,b)+a.intToStr(c)+a.shortToStr(d)+a.shortToStr(r))};a.SendTouchMsg2=function(b,c){var d="",r,n;for(n in a.TouchArray)n==b?r=c:1==a.TouchArray[n].f?(r=65542,a.TouchArray[n].f=3):r=2==a.TouchArray[n].f?262144:131078,d+=String.fromCharCode(n)+a.intToStr(r)+a.shortToStr(a.TouchArray[n].x)+a.shortToStr(a.TouchArray[n].y),2==a.TouchArray[n].f&&
805
+delete a.TouchArray[n];3==a.State&&a.send(String.fromCharCode(0,a.InputType.TOUCH)+a.shortToStr(5+d.length)+String.fromCharCode(2)+d);0==Object.keys(a.TouchArray).length&&null!=a.touchtimer&&(clearInterval(a.touchtimer),a.touchtimer=null)};a.SendMouseMsg=function(b,c){if(3==a.State&&null!=b&&null!=a.Canvas){c||(c=window.event);var d=a.Canvas.canvas.height/a.CanvasId.clientHeight,r=a.Canvas.canvas.width/a.CanvasId.clientWidth,n=a.GetPositionOfControl(a.Canvas.canvas),r=(c.pageX-n[0])*r,d=(c.pageY-
806
+n[1])*d,n=0==a.rotation?r:1==a.rotation?d:2==a.rotation?a.Canvas.canvas.width-r:3==a.rotation?a.Canvas.canvas.height-d:0,d=0==a.rotation?d:1==a.rotation?a.Canvas.canvas.width-r:2==a.rotation?a.Canvas.canvas.height-d:3==a.rotation?r:0,r=n;if(0<=r&&r<=a.Canvas.canvas.width&&0<=d&&d<=a.Canvas.canvas.height){var m=n=0;b==a.KeyAction.UP||b==a.KeyAction.DOWN?c.which?1==c.which?n=a.MouseButton.LEFT:2==c.which?n=a.MouseButton.MIDDLE:n=a.MouseButton.RIGHT:c.button&&(0==c.button?n=a.MouseButton.LEFT:1==c.button?
807
+n=a.MouseButton.MIDDLE:n=a.MouseButton.RIGHT):b==a.KeyAction.SCROLL&&(c.detail?m=-120*c.detail:c.wheelDelta&&(m=3*c.wheelDelta));var w="",w=b==a.KeyAction.SCROLL?String.fromCharCode(0,a.InputType.MOUSE,0,12,0,b==a.KeyAction.DOWN?n:2*n&255,r/256&255,r&255,d/256&255,d&255,m/256&255,m&255):String.fromCharCode(0,a.InputType.MOUSE,0,10,0,b==a.KeyAction.DOWN?n:2*n&255,r/256&255,r&255,d/256&255,d&255);a.Action==a.KeyAction.NONE?0==a.Alternate||a.ipad?(a.send(w),a.Alternate=1):a.Alternate=0:a.send(w)}}};
808
+a.GetDisplayNumbers=function(){a.send(String.fromCharCode(0,11,0,4))};a.SetDisplay=function(b){a.send(String.fromCharCode(0,12,0,6,b>>8,b&255))};a.intToStr=function(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)};a.shortToStr=function(a){return String.fromCharCode(a>>8&255,a&255)};a.onResize=function(){if(0!=a.ScreenWidth&&0!=a.ScreenHeight&&(a.Canvas.canvas.width!=a.ScreenWidth||a.Canvas.canvas.height!=a.ScreenHeight)){if(a.FirstDraw&&(a.Canvas.canvas.width=a.ScreenWidth,a.Canvas.canvas.height=
809
+a.ScreenHeight,a.Canvas.fillRect(0,0,a.ScreenWidth,a.ScreenHeight),null!=a.onScreenSizeChange))a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);a.FirstDraw=!1}};a.xxMouseInputGrab=!1;a.xxKeyInputGrab=!1;a.xxMouseMove=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.NONE,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxMouseUp=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&
810
+b.stopPropagation();return!1};a.xxMouseDown=function(b){3==a.State&&a.SendMouseMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxDOMMouseScroll=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxMouseWheel=function(b){return 3==a.State?(a.SendMouseMsg(a.KeyAction.SCROLL,b),!1):!0};a.xxKeyUp=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.UP,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();
811
+return!1};a.xxKeyDown=function(b){3==a.State&&a.SendKeyMsg(a.KeyAction.DOWN,b);b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1};a.xxKeyPress=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};a.handleKeys=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyPress(b)};a.handleKeyUp=function(b){if(1==a.stopInput||3!=desktop.State)return!1;if(5>a.firstUpKeys.length&&(a.firstUpKeys.push(b.keyCode),5==a.firstUpKeys.length)){var c=
812
+a.firstUpKeys.join(",");if("16,17,91,91,16"==c||"16,17,18,91,92"==c)a.stopInput=!0}return a.xxKeyUp(b)};a.handleKeyDown=function(b){return 1==a.stopInput||3!=desktop.State?!1:a.xxKeyDown(b)};a.mousedown=function(b){return 1==a.stopInput?!1:a.xxMouseDown(b)};a.mouseup=function(b){return 1==a.stopInput?!1:a.xxMouseUp(b)};a.mousemove=function(b){return 1==a.stopInput?!1:a.xxMouseMove(b)};a.mousewheel=function(b){return 1==a.stopInput?!1:a.xxMouseWheel(b)};a.xxMsTouchEvent=function(b){if(4!=b.originalEvent.pointerType){b.preventDefault&&
813
+b.preventDefault();b.stopPropagation&&b.stopPropagation();if("MSPointerDown"==b.type||"MSPointerMove"==b.type||"MSPointerUp"==b.type){var c=0,d=b.originalEvent.pointerId%256,r=Canvas.canvas.width/a.CanvasId.clientWidth*b.offsetX,n=Canvas.canvas.height/a.CanvasId.clientHeight*b.offsetY;"MSPointerDown"==b.type?c=65542:"MSPointerMove"==b.type?c=131078:"MSPointerUp"==b.type&&(c=262144);a.TouchArray[d]||(a.TouchArray[d]={x:r,y:n});a.SendTouchMsg2(d,c);"MSPointerUp"==b.type&&delete a.TouchArray[d]}else alert(b.type);
814
+return!0}};a.xxTouchStart=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1<b.originalEvent.touches.length)){var c=b.originalEvent.touches[0];b.which=1;a.LastX=b.pageX=c.pageX;a.LastY=b.pageY=c.pageY;a.SendMouseMsg(KeyAction.DOWN,b)}}else{var c=a.GetPositionOfControl(Canvas.canvas),d;for(d in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[d].identifier){var r=b.originalEvent.changedTouches[d].identifier%256;a.TouchArray[r]||
815
+(a.TouchArray[r]={x:Canvas.canvas.width/a.CanvasId.clientWidth*(b.originalEvent.touches[d].pageX-c[0]),y:Canvas.canvas.height/a.CanvasId.clientHeight*(b.originalEvent.touches[d].pageY-c[1]),f:1})}0<Object.keys(a.TouchArray).length&&null==touchtimer&&(a.touchtimer=setInterval(function(){a.SendTouchMsg2(256,0)},50))}};a.xxTouchMove=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled){if(!(1<b.originalEvent.touches.length)){var c=b.originalEvent.touches[0];
816
+b.which=1;a.LastX=b.pageX=c.pageX;a.LastY=b.pageY=c.pageY;a.SendMouseMsg(a.KeyAction.NONE,b)}}else{var c=a.GetPositionOfControl(Canvas.canvas),d;for(d in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[d].identifier){var r=b.originalEvent.changedTouches[d].identifier%256;a.TouchArray[r]&&(a.TouchArray[r].x=a.Canvas.canvas.width/a.CanvasId.clientWidth*(b.originalEvent.touches[d].pageX-c[0]),a.TouchArray[r].y=a.Canvas.canvas.height/a.CanvasId.clientHeight*(b.originalEvent.touches[d].pageY-
817
+c[1]))}}};a.xxTouchEnd=function(b){if(3==a.State)if(b.preventDefault&&b.preventDefault(),0==a.touchenabled||1==a.touchenabled)1<b.originalEvent.touches.length||(b.which=1,b.pageX=LastX,b.pageY=LastY,a.SendMouseMsg(KeyAction.UP,b));else for(var c in b.originalEvent.changedTouches)if(b.originalEvent.changedTouches[c].identifier){var d=b.originalEvent.changedTouches[c].identifier%256;a.TouchArray[d]&&(a.TouchArray[d].f=2)}};a.GrabMouseInput=function(){if(1!=a.xxMouseInputGrab){var b=a.CanvasId;b.onmousemove=
818
+a.xxMouseMove;b.onmouseup=a.xxMouseUp;b.onmousedown=a.xxMouseDown;b.touchstart=a.xxTouchStart;b.touchmove=a.xxTouchMove;b.touchend=a.xxTouchEnd;b.MSPointerDown=a.xxMsTouchEvent;b.MSPointerMove=a.xxMsTouchEvent;b.MSPointerUp=a.xxMsTouchEvent;navigator.userAgent.match(/mozilla/i)?b.DOMMouseScroll=a.xxDOMMouseScroll:b.onmousewheel=a.xxMouseWheel;a.xxMouseInputGrab=!0}};a.UnGrabMouseInput=function(){if(0!=a.xxMouseInputGrab){var b=a.CanvasId;b.onmousemove=null;b.onmouseup=null;b.onmousedown=null;b.touchstart=
819
+null;b.touchmove=null;b.touchend=null;b.MSPointerDown=null;b.MSPointerMove=null;b.MSPointerUp=null;navigator.userAgent.match(/mozilla/i)?b.DOMMouseScroll=null:b.onmousewheel=null;a.xxMouseInputGrab=!1}};a.GrabKeyInput=function(){1!=a.xxKeyInputGrab&&(document.onkeyup=a.xxKeyUp,document.onkeydown=a.xxKeyDown,document.onkeypress=a.xxKeyPress,a.xxKeyInputGrab=!0)};a.UnGrabKeyInput=function(){0!=a.xxKeyInputGrab&&(document.onkeyup=null,document.onkeydown=null,document.onkeypress=null,a.xxKeyInputGrab=
820
+!1)};a.GetPositionOfControl=function(a){var b=Array(2);for(b[0]=b[1]=0;a;)b[0]+=a.offsetLeft,b[1]+=a.offsetTop,a=a.offsetParent;return b};a.crotX=function(b,c){if(0==a.rotation)return b;if(1==a.rotation)return c;if(2==a.rotation)return a.Canvas.canvas.width-b;if(3==a.rotation)return a.Canvas.canvas.height-c};a.crotY=function(b,c){if(0==a.rotation)return c;if(1==a.rotation)return a.Canvas.canvas.width-b;if(2==a.rotation)return a.Canvas.canvas.height-c;if(3==a.rotation)return b};a.rotX=function(b,c){if(0==
821
+a.rotation||1==a.rotation)return b;if(2==a.rotation)return b-a.Canvas.canvas.width;if(3==a.rotation)return b-a.Canvas.canvas.height};a.rotY=function(b,c){if(0==a.rotation||3==a.rotation)return c;if(1==a.rotation)return c-a.Canvas.canvas.width;if(2==a.rotation)return c-a.Canvas.canvas.height};a.tcanvas=null;a.setRotation=function(b){for(;0>b;)b+=4;b%=4;if(b==a.rotation)return!0;var c=a.Canvas.canvas.width,d=a.Canvas.canvas.height;if(1==a.rotation||3==a.rotation)c=a.Canvas.canvas.height,d=a.Canvas.canvas.width;
822
+null==a.tcanvas&&(a.tcanvas=document.createElement("canvas"));var r=a.tcanvas.getContext("2d");r.setTransform(1,0,0,1,0,0);r.canvas.width=c;r.canvas.height=d;r.rotate(-90*a.rotation*Math.PI/180);0==a.rotation&&r.drawImage(a.Canvas.canvas,0,0);1==a.rotation&&r.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,0);2==a.rotation&&r.drawImage(a.Canvas.canvas,-a.Canvas.canvas.width,-a.Canvas.canvas.height);3==a.rotation&&r.drawImage(a.Canvas.canvas,0,-a.Canvas.canvas.height);if(0==a.rotation||2==a.rotation)a.Canvas.canvas.height=
823
+c,a.Canvas.canvas.width=d;if(1==a.rotation||3==a.rotation)a.Canvas.canvas.height=d,a.Canvas.canvas.width=c;a.Canvas.setTransform(1,0,0,1,0,0);a.Canvas.rotate(90*b*Math.PI/180);a.rotation=b;a.Canvas.drawImage(a.tcanvas,a.rotX(0,0),a.rotY(0,0));a.ScreenWidth=a.Canvas.canvas.width;a.ScreenHeight=a.Canvas.canvas.height;if(null!=a.onScreenSizeChange)a.onScreenSizeChange(a,a.ScreenWidth,a.ScreenHeight,a.CanvasId);return!0};a.MuchTheSame=function(a,b){return 4>Math.abs(a-b)};a.Debug=function(a){console.log(a)};
824
+a.getIEVersion=function(){var a=-1;"Microsoft Internet Explorer"==navigator.appName&&null!=/MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent)&&(a=parseFloat(RegExp.$1));return a};a.haltEvent=function(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};return a},CreateKvmDataChannel=function(b,c,a){var d={};d.m=c;c.parent=d;d.webchannel=b;d.State=0;d.protocol=c.protocol;d.onStateChanged=null;d.onControlMsg=null;d.debugmode=0;d.keepalive=a;d.rtcKeepAlive=null;
825
+d.Start=function(){1==d.debugmode&&console.log("start");d.xxStateChange(3);d.webchannel.onmessage=d.xxOnMessage;d.rtcKeepAlive=setInterval(d.xxSendRtcKeepAlive,3E4)};var e=new FileReader,q=!1,h=[];e.readAsBinaryString?e.onload=function(a){d.xxOnSocketData(a.target.result);0==h.length?q=!1:e.readAsBinaryString(new Blob([h.shift()]))}:e.readAsArrayBuffer&&(e.onloadend=function(a){d.xxOnSocketData(a.target.result);0==h.length?q=!1:e.readAsArrayBuffer(h.shift())});d.xxOnMessage=function(a){if("string"==
826
+typeof a.data){if(null!=d.onControlMsg)d.onControlMsg(a.data)}else if("object"==typeof a.data)if(1==q)h.push(a.data);else if(e.readAsBinaryString)q=!0,e.readAsBinaryString(new Blob([a.data]));else if(f.readAsArrayBuffer)q=!0,e.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);for(var c=a.byteLength,w=0;w<c;w++)b+=String.fromCharCode(a[w]);d.xxOnSocketData(b)}else d.xxOnSocketData(a.data)};d.xxOnSocketData=function(a){if(a){if("object"===typeof a){var b="";a=new Uint8Array(a);for(var c=
827
+a.byteLength,e=0;e<c;e++)b+=String.fromCharCode(a[e]);a=b}else if("string"!==typeof a)return;return d.m.ProcessData(a)}};d.sendCtrlMsg=function(a){"string"==typeof a&&(d.webchannel.send(a),urlvars&&urlvars.webrtctrace&&console.log("WebRTC-Send("+d.State+"): ",typeof a,a),null!=d.keepalive&&d.keepalive.sendKeepAlive())};d.send=function(a){if("string"==typeof a){for(var b=new Uint8Array(a.length),c=0;c<a.length;++c)b[c]=a.charCodeAt(c);a=b}urlvars&&urlvars.webrtctrace&&console.log("WebRTC-Send("+d.State+
828
+"): ",typeof a,a);d.webchannel.send(a)};d.xxStateChange=function(a){if(d.State!=a&&(d.State=a,d.m.xxStateChange(d.State),null!=d.onStateChanged))d.onStateChanged(d,d.State)};d.Stop=function(){1==d.debugmode&&console.log("stop");null!=d.rtcKeepAlive&&(clearInterval(d.rtcKeepAlive),d.rtcKeepAlive=null);d.xxStateChange(0)};d.xxSendRtcKeepAlive=function(){urlvars&&urlvars.webrtctrace&&console.log("WebRTC-SendKeepAlive()");d.sendCtrlMsg(JSON.stringify({action:"ping"}))};return d},CreateAmtRemoteTerminal=
829
+function(b){function c(b){if("\x00"!=b&&7!=b.charCodeAt()){var d=b.charCodeAt();if(0==h.terminalEmulation){b=!0;0==(d&128)?(z=d,x=0,b=!1):192==(d&224)?(z=d&31,x=1,b=!0):224==(d&240)?(z=d&15,x=2,b=!0):128==(d&192)&&(0<x?(z<<=6,z+=d&63,x--,b=0!=x):(x=z=0,b=!0));if(1==b)return;b=String.fromCharCode(z)}else 1==h.terminalEmulation?0!=(d&128)&&(b=String.fromCharCode(F[d&127])):2==h.terminalEmulation&&0!=(d&128)&&(b=String.fromCharCode(G[d&127]));switch(d){case 16:b=" ";break;case 24:b="\u2191";break;case 25:b=
830
+"\u2193"}v>h.width&&(v=h.width);B>h.height-1&&(B=h.height-1);switch(b){case "\b":0<v&&(--v,a(" "));break;case "\t":d=8-v%8;for(b=0;b<d;b++)c(" ");break;case "\n":B++;B>h.height-1&&(q(1),B=h.height-1);break;case "\r":v=0;break;default:v>=h.width&&(v=0,k&&B++,B>=h.height-1&&(q(1),B=h.height-1)),a(b),v++}}}function a(a){D[B][v]=a;u[B][v]=(m<<6)+(w<<12)+n}function d(){for(var a=w<<12,b=v;b<h.width;b++)D[B][b]=" ",u[B][b]=a}function e(a){for(var b=w<<12,c=0;c<h.width;c++)D[a][c]=" ",u[a][c]=b}function q(a){var b;
831
+for(b=0;b<h.height-a;b++)D[b]=D[b+a],u[b]=u[b+a];for(b=h.height-a;b<h.height;b++)for(D[b]=[],u[b]=[],a=0;a<h.width;a++)D[b][a]=" ",u[b][a]=448}var h={};h.DivId=b;h.DivElement=document.getElementById(b);h.protocol=1;h.terminalEmulation=1;h.fxEmulation=0;h.fxLineBreak=0;h.width=80;h.height=25;var r="000000 BB0000 00BB00 BBBB00 0000BB BB00BB 00BBBB BBBBBB 555555 FF5555 55FF55 FFFF55 5555FF FF55FF 55FFFF FFFFFF".split(" "),n=0,m=7,w=0,k=!0,v=0,B=0,l=0,g=[],I=0,u=[],D=[],z=0,x=0;h.Start=function(){};h.Init=
832
+function(a,b){h.width=a?a:80;h.height=b?b:25;for(var c=0;c<h.height;c++){D[c]=[];u[c]=[];for(var d=0;d<h.width;d++)D[c][d]=" ",u[c][d]=448}h.TermInit();h.TermDraw()};h.xxStateChange=function(a){};h.ProcessData=function(a){null!=h.capture&&(h.capture+=a);for(var b=0;b<a.length;b++){var q=String.fromCharCode(a.charCodeAt(b)),r=a.charCodeAt(b);switch(l){case 0:switch(r){case 27:l=1;break;default:c(q)}break;case 1:switch(q){case "[":I=0;g=[];l=2;break;case "(":l=4;break;case ")":l=5;break;default:l=0}break;
833
+case 2:if("0"<=q&&"9">=q){g[I]=g[I]?10*g[I]+(q-0):q-0;break}else if(";"==q){I++;break}else{g[0]||(g[0]=0);var r=g,z=I+1,x=void 0;switch(q){case "c":h.TermResetScreen();break;case "A":1==z&&(B-=r[0],0>B&&(B=0));break;case "B":1==z&&(B+=r[0],B>h.height&&(B=h.height));break;case "C":1==z&&(v+=r[0],v>h.width&&(v=h.width));break;case "D":1==z&&(v-=r[0],0>v&&(v=0));break;case "d":1==z&&(B=r[0]-1,B>h.height&&(B=h.height),0>B&&(B=0));break;case "G":1==z&&(v=r[0]-1,0>v&&(v=0),79<v&&(v=79));break;case "J":if(1==
834
+z&&2==r[0])h.TermClear((w<<12)+(m<<6)),B=v=0;else if(0==z||1==z&&0==r[0])for(d(),x=B+1;x<h.height;x++)e(x);else if(1==z&&1==r[0])for(d(),x=0;x<B-1;x++)e(x);break;case "H":2==z?(1>r[0]&&(r[0]=1),1>r[1]&&(r[1]=1),r[0]>h.height&&(r[0]=h.height),r[1]>h.width&&(r[1]=h.width),B=r[0]-1,v=r[1]-1):v=B=0;break;case "m":for(x=0;x<z;x++)r[x]&&0!=r[x]?1==r[x]?8>m&&(m+=8):2==r[x]||22==r[x]?8<=m&&(m-=8):7==r[x]?n=2:27==r[x]?n=0:30<=r[x]&&37>=r[x]?(q=8<=m,m=r[x]-30,q&&8>=m&&(m+=8)):40<=r[x]&&47>=r[x]?w=r[x]-40:90<=
835
+r[x]&&99>=r[x]?m=r[x]-82:100<=r[x]&&109>=r[x]&&(w=r[x]-92):(w=0,m=7,n=0);break;case "K":if(0!=z&&(1!=z||r[0]&&0!=r[0])){if(1==z)if(1==r[0])for(q=w<<12,r=0;r<v;r++)D[B][r]=" ",u[B][r]=q;else 2==r[0]&&e(B)}else d();break;case "h":k=!0;break;case "l":k=!1}l=0}break;case 4:l=0;break;case 5:l=0}}h.TermDraw()};h.ProcessVt100String=function(a){for(var b=0;b<a.length;b++)c(String.fromCharCode(a.charCodeAt(b)))};var F=[199,252,233,226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,
836
+251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,171,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160],G=[199,252,233,
837
+226,228,224,229,231,234,235,232,239,238,236,196,197,201,230,198,244,246,242,251,249,255,214,220,162,163,165,8359,402,225,237,243,250,241,209,170,218,191,8976,172,189,188,161,174,187,9619,9618,9617,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9576,9560,9554,9555,9579,9578,9496,9484,9608,9604,9611,9616,9600,945,223,915,960,931,963,181,964,966,952,8486,948,8734,248,949,8719,8801,177,8805,
838
+8806,8992,8993,247,8776,176,8226,183,8730,8319,178,8718,160];h.TermClear=function(a){for(var b=0;b<h.height;b++)for(var c=0;c<h.width;c++)D[b][c]=" ",u[b][c]=a};h.TermResetScreen=function(){n=0;m=7;w=0;k=!0;B=v=0;h.TermClear(448)};h.TermSendKeys=function(a){console.log(a);h.parent.Send(a)};h.TermSendKey=function(a){h.parent.Send(String.fromCharCode(a))};h.TermHandleKeys=function(a){if(!a.ctrlKey)return 127==a.which?h.TermSendKey(8):13==a.which?h.TermSendKeys(0==h.fxLineBreak?"\r\n":"\n"):0!=a.which&&
839
+h.TermSendKey(a.which),!1;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation()};h.TermHandleKeyUp=function(a){if(8!=a.which&&32!=a.which&&9!=a.which)return!0;a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1};h.TermHandleKeyDown=function(a){if(65<=a.which&&90>=a.which&&1==a.ctrlKey)h.TermSendKey(a.which-64),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation();else{if(27==a.which)return h.TermSendKeys(String.fromCharCode(27)),
840
+!0;if(37==a.which)return h.TermSendKeys(String.fromCharCode(27,91,68)),!0;if(38==a.which)return h.TermSendKeys(String.fromCharCode(27,91,65)),!0;if(39==a.which)return h.TermSendKeys(String.fromCharCode(27,91,67)),!0;if(40==a.which)return h.TermSendKeys(String.fromCharCode(27,91,66)),!0;if(9==a.which)return h.TermSendKeys("\t"),a.preventDefault&&a.preventDefault(),a.stopPropagation&&a.stopPropagation(),!0;var b=[80,81,119,120,116,117,113,114,112,77],c=[49,50,51,52,53,54,55,56,57,48,33,64],d=[80,81,
841
+82,83,84,85,86,87,88,89,90,91];if(111<a.which&124>a.which&&0==a.repeat){if(0==h.fxEmulation&&122>a.which)return h.TermSendKeys(String.fromCharCode(27,91,79,b[a.which-112])),!0;if(1==h.fxEmulation)return h.TermSendKeys(String.fromCharCode(27,c[a.which-112])),!0;if(2==h.fxEmulation)return h.TermSendKeys(String.fromCharCode(27,79,d[a.which-112])),!0}if(8!=a.which&&32!=a.which&&9!=a.which)return!0;h.TermSendKey(a.which);a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}};
842
+h.TermDraw=function(){for(var a,b="",c="",d=1,e,g=0;g<h.height;++g){for(var k=0;k<h.width;++k)switch(a=u[g][k],v==k&&B==g&&(a|=2),a!=d&&(b+=c,c="",d=6,e=12,a&2&&(d=12,e=6),b+='<span style="color:#'+r[a>>d&63]+";background-color:#"+r[a>>e&63],a&1&&(b+=";text-decoration:underline"),b+=';">',c="</span>"+c,d=a),a=D[g][k],a){case "&":b+="&";break;case "<":b+="<";break;case ">":b+=">";break;case " ":b+=" ";break;default:b+=a}g!=h.height-1&&(b+="<br>")}h.DivElement.innerHTML="<font size='4'><b>"+
843
+b+c+"</b></font>"};h.TermInit=function(){h.TermResetScreen()};h.Init();return h},ZLIB=ZLIB||{};
844
"undefined"===typeof ZLIB.common_initialized&&(ZLIB.Z_NO_FLUSH=0,ZLIB.Z_PARTIAL_FLUSH=1,ZLIB.Z_SYNC_FLUSH=2,ZLIB.Z_FULL_FLUSH=3,ZLIB.Z_FINISH=4,ZLIB.Z_BLOCK=5,ZLIB.Z_TREES=6,ZLIB.Z_OK=0,ZLIB.Z_STREAM_END=1,ZLIB.Z_NEED_DICT=2,ZLIB.Z_ERRNO=-1,ZLIB.Z_STREAM_ERROR=-2,ZLIB.Z_DATA_ERROR=-3,ZLIB.Z_MEM_ERROR=-4,ZLIB.Z_BUF_ERROR=-5,ZLIB.Z_VERSION_ERROR=-6,ZLIB.Z_DEFLATED=8,ZLIB.z_stream=function(){this.total_out=this.avail_out=this.next_out=this.total_in=this.avail_in=this.next_in=0;this.state=this.msg=null;
845
this.adler=this.data_type=0;this.output_data=this.input_data="";this.error=0;this.checksum_function=null},ZLIB.gz_header=function(){this.xflags=this.time=this.text=0;this.os=255;this.extra=null;this.extra_max=this.extra_len=0;this.name=null;this.name_max=0;this.comment=null;this.done=this.hcrc=this.comm_max=0},ZLIB.common_initialized=!0);"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js");
845
-(function(){function b(a,b){var c=a.next,d=2==b?a.distbits:a.lenbits,e=a.work,g=a.lens,h=2==b?a.nlen:0,k=a.codes,l;l=1==b?a.nlen:2==b?a.ndist:19;var m,n,p,u,v,w,x,B,F,L,G,H,I,da,fa,ga,ha,P,J=Array(16);v=Array(16);for(m=0;15>=m;m++)J[m]=0;for(n=0;n<l;n++)J[g[h+n]]++;u=d;for(p=15;1<=p&&0==J[p];p--);u>p&&(u=p);if(0==p)return H={op:64,bits:1,val:0},k[c++]=H,k[c++]=H,2==b?a.distbits=1:a.lenbits=1,a.next=c,0;for(d=1;d<p&&0==J[d];d++);u<d&&(u=d);for(m=w=1;15>=m;m++)if(w<<=1,w-=J[m],0>w)return-1;if(0<w&&
846
-(0==b||1!=p))return a.next=c,-1;v[1]=0;for(m=1;15>m;m++)v[m+1]=v[m]+J[m];for(n=0;n<l;n++)0!=g[h+n]&&(e[v[g[h+n]]++]=n);switch(b){case 0:da=ga=e;ha=fa=0;P=19;break;case 1:da=K;fa=-257;ga=r;ha=-257;P=256;break;default:da=E,ga=z,ha=fa=0,P=-1}n=B=0;m=d;I=c;l=u;v=0;L=-1;x=1<<u;G=x-1;if(1==b&&852<=x||2==b&&592<=x)return a.next=c,1;for(;;){H={op:0,bits:m-v,val:0};e[n]<P?H.val=e[n]:e[n]>P?(H.op=ga[ha+e[n]],H.val=da[fa+e[n]]):H.op=96;w=1<<m-v;d=F=1<<l;do F-=w,k[I+(B>>>v)+F]=H;while(0!=F);for(w=1<<m-1;B&w;)w>>>=
847
-1;0!=w?(B&=w-1,B+=w):B=0;n++;if(0==--J[m]){if(m==p)break;m=g[h+e[n]]}if(m>u&&(B&G)!=L){0==v&&(v=u);I+=d;l=m-v;for(w=1<<l;l+v<p;){w-=J[l+v];if(0>=w)break;l++;w<<=1}x+=1<<l;if(1==b&&852<=x||2==b&&592<=x)return a.next=c,1;L=B&G;k[c+L]={op:l,bits:u,val:I-c}}}0!=B&&(k[I+B]={op:64,bits:m-v,val:0});a.next=c+x;2==b?a.distbits=u:a.lenbits=u;return 0}function c(a){var b,c=Array(a);for(b=0;b<a;b++)c[b]=0;return c}function a(a,b,c){return a&&b in a?a[b]:c}function d(){return 0}function e(){var a;this.total=this.check=
848
-this.dmax=this.flags=this.havedict=this.wrap=this.last=this.mode=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.next=this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=this.distcode=this.lencode=this.extra=this.offset=this.length=this.bits=this.hold=0;this.lens=c(320);this.work=c(288);this.codes=Array(1444);var b={op:0,bits:0,val:0};for(a=0;1444>a;a++)this.codes[a]=b;this.was=this.back=this.sane=0}function k(a){var b;B||(B=eval("([ {op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48}, {op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128}, {op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59}, {op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176}, {op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20}, {op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100}, {op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8}, {op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216}, {op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76}, {op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114}, {op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2}, {op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148}, {op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42}, {op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86}, {op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15}, {op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236}, {op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62}, {op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142}, {op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31}, {op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162}, {op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25}, {op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105}, {op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4}, {op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202}, {op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69}, {op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125}, {op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13}, {op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195}, {op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35}, {op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91}, {op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19}, {op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246}, {op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55}, {op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135}, {op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99}, {op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190}, {op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16}, {op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96}, {op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6}, {op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209}, {op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72}, {op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116}, {op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4}, {op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153}, {op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44}, {op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82}, {op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11}, {op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229}, {op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58}, {op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138}, {op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51}, {op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173}, {op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30}, {op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110}, {op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0}, {op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195}, {op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65}, {op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121}, {op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9}, {op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258}, {op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37}, {op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93}, {op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23}, {op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251}, {op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51}, {op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131}, {op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67}, {op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183}, {op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23}, {op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103}, {op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9}, {op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223}, {op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79}, {op:0,bits:9,val:255}])"));
849
-I||(I=eval("([ {op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025}, {op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193}, {op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385}, {op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577}, {op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073}, {op:22,bits:5,val:193},{op:64,bits:5,val:0}])"));
850
-a.lencode=0;a.distcode=512;for(b=0;512>b;b++)a.codes[b]=B[b];for(b=0;32>b;b++)a.codes[b+512]=I[b];a.lenbits=9;a.distbits=5}function l(a,b){a.state.check=a.checksum_function(a.state.check,[b&255,b>>>8&255],0,2)}function u(a,b){b.strm=a;b.left=a.avail_out;b.next=a.next_in;b.have=a.avail_in;b.hold=a.state.hold;b.bits=a.state.bits;return b}function n(a){var b=a.strm;b.next_in=a.next;b.avail_out=a.left;b.avail_in=a.have;b.state.hold=a.hold;b.state.bits=a.bits}function p(a){a.hold=0;a.bits=0}function x(a){if(0==
851
-a.have)return!1;a.have--;a.hold+=(a.strm.input_data.charCodeAt(a.next++)&255)<<a.bits;a.bits+=8;return!0}function m(a,b){for(;a.bits<b;)if(!x(a))return!1;return!0}function w(a,b){return a.hold&(1<<b)-1}function h(a,b){a.hold>>>=b;a.bits-=b}function v(a){a.hold>>>=a.bits&7;a.bits-=a.bits&7}function g(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}var K=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,
852
-18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],E=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],z=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ";ZLIB.inflateResetKeep=function(a){var b;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;b=a.state;a.total_in=a.total_out=b.total=0;a.msg=null;b.wrap&&(a.adler=
846
+(function(){function b(a,b){var c=a.next,d=2==b?a.distbits:a.lenbits,e=a.work,g=a.lens,h=2==b?a.nlen:0,k=a.codes,l;l=1==b?a.nlen:2==b?a.ndist:19;var m,n,q,r,v,w,B,x,F,G,H,J,X,da,fa,ga,ha,O,K=Array(16);v=Array(16);for(m=0;15>=m;m++)K[m]=0;for(n=0;n<l;n++)K[g[h+n]]++;r=d;for(q=15;1<=q&&0==K[q];q--);r>q&&(r=q);if(0==q)return J={op:64,bits:1,val:0},k[c++]=J,k[c++]=J,2==b?a.distbits=1:a.lenbits=1,a.next=c,0;for(d=1;d<q&&0==K[d];d++);r<d&&(r=d);for(m=w=1;15>=m;m++)if(w<<=1,w-=K[m],0>w)return-1;if(0<w&&
847
+(0==b||1!=q))return a.next=c,-1;v[1]=0;for(m=1;15>m;m++)v[m+1]=v[m]+K[m];for(n=0;n<l;n++)0!=g[h+n]&&(e[v[g[h+n]]++]=n);switch(b){case 0:da=ga=e;ha=fa=0;O=19;break;case 1:da=I;fa=-257;ga=u;ha=-257;O=256;break;default:da=D,ga=z,ha=fa=0,O=-1}n=x=0;m=d;X=c;l=r;v=0;G=-1;B=1<<r;H=B-1;if(1==b&&852<=B||2==b&&592<=B)return a.next=c,1;for(;;){J={op:0,bits:m-v,val:0};e[n]<O?J.val=e[n]:e[n]>O?(J.op=ga[ha+e[n]],J.val=da[fa+e[n]]):J.op=96;w=1<<m-v;d=F=1<<l;do F-=w,k[X+(x>>>v)+F]=J;while(0!=F);for(w=1<<m-1;x&w;)w>>>=
848
+1;0!=w?(x&=w-1,x+=w):x=0;n++;if(0==--K[m]){if(m==q)break;m=g[h+e[n]]}if(m>r&&(x&H)!=G){0==v&&(v=r);X+=d;l=m-v;for(w=1<<l;l+v<q;){w-=K[l+v];if(0>=w)break;l++;w<<=1}B+=1<<l;if(1==b&&852<=B||2==b&&592<=B)return a.next=c,1;G=x&H;k[c+G]={op:l,bits:r,val:X-c}}}0!=x&&(k[X+x]={op:64,bits:m-v,val:0});a.next=c+B;2==b?a.distbits=r:a.lenbits=r;return 0}function c(a){var b,c=Array(a);for(b=0;b<a;b++)c[b]=0;return c}function a(a,b,c){return a&&b in a?a[b]:c}function d(){return 0}function e(){var a;this.total=this.check=
849
+this.dmax=this.flags=this.havedict=this.wrap=this.last=this.mode=0;this.head=null;this.wnext=this.whave=this.wsize=this.wbits=0;this.window=null;this.next=this.have=this.ndist=this.nlen=this.ncode=this.distbits=this.lenbits=this.distcode=this.lencode=this.extra=this.offset=this.length=this.bits=this.hold=0;this.lens=c(320);this.work=c(288);this.codes=Array(1444);var b={op:0,bits:0,val:0};for(a=0;1444>a;a++)this.codes[a]=b;this.was=this.back=this.sane=0}function q(a){var b;x||(x=eval("([ {op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16},{op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48}, {op:0,bits:9,val:192},{op:16,bits:7,val:10},{op:0,bits:8,val:96},{op:0,bits:8,val:32},{op:0,bits:9,val:160},{op:0,bits:8,val:0},{op:0,bits:8,val:128}, {op:0,bits:8,val:64},{op:0,bits:9,val:224},{op:16,bits:7,val:6},{op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:144},{op:19,bits:7,val:59}, {op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:208},{op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:176}, {op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72},{op:0,bits:9,val:240},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20}, {op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116},{op:0,bits:8,val:52},{op:0,bits:9,val:200},{op:17,bits:7,val:13},{op:0,bits:8,val:100}, {op:0,bits:8,val:36},{op:0,bits:9,val:168},{op:0,bits:8,val:4},{op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:232},{op:16,bits:7,val:8}, {op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:152},{op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:216}, {op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44},{op:0,bits:9,val:184},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76}, {op:0,bits:9,val:248},{op:16,bits:7,val:3},{op:0,bits:8,val:82},{op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114}, {op:0,bits:8,val:50},{op:0,bits:9,val:196},{op:17,bits:7,val:11},{op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:164},{op:0,bits:8,val:2}, {op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:228},{op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:148}, {op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58},{op:0,bits:9,val:212},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42}, {op:0,bits:9,val:180},{op:0,bits:8,val:10},{op:0,bits:8,val:138},{op:0,bits:8,val:74},{op:0,bits:9,val:244},{op:16,bits:7,val:5},{op:0,bits:8,val:86}, {op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:204},{op:17,bits:7,val:15}, {op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:172},{op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:236}, {op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30},{op:0,bits:9,val:156},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62}, {op:0,bits:9,val:220},{op:18,bits:7,val:27},{op:0,bits:8,val:110},{op:0,bits:8,val:46},{op:0,bits:9,val:188},{op:0,bits:8,val:14},{op:0,bits:8,val:142}, {op:0,bits:8,val:78},{op:0,bits:9,val:252},{op:96,bits:7,val:0},{op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31}, {op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:194},{op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:162}, {op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65},{op:0,bits:9,val:226},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25}, {op:0,bits:9,val:146},{op:19,bits:7,val:59},{op:0,bits:8,val:121},{op:0,bits:8,val:57},{op:0,bits:9,val:210},{op:17,bits:7,val:17},{op:0,bits:8,val:105}, {op:0,bits:8,val:41},{op:0,bits:9,val:178},{op:0,bits:8,val:9},{op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:242},{op:16,bits:7,val:4}, {op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258},{op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:202}, {op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37},{op:0,bits:9,val:170},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69}, {op:0,bits:9,val:234},{op:16,bits:7,val:8},{op:0,bits:8,val:93},{op:0,bits:8,val:29},{op:0,bits:9,val:154},{op:20,bits:7,val:83},{op:0,bits:8,val:125}, {op:0,bits:8,val:61},{op:0,bits:9,val:218},{op:18,bits:7,val:23},{op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:186},{op:0,bits:8,val:13}, {op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:250},{op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195}, {op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51},{op:0,bits:9,val:198},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35}, {op:0,bits:9,val:166},{op:0,bits:8,val:3},{op:0,bits:8,val:131},{op:0,bits:8,val:67},{op:0,bits:9,val:230},{op:16,bits:7,val:7},{op:0,bits:8,val:91}, {op:0,bits:8,val:27},{op:0,bits:9,val:150},{op:20,bits:7,val:67},{op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:214},{op:18,bits:7,val:19}, {op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:182},{op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:246}, {op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23},{op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55}, {op:0,bits:9,val:206},{op:17,bits:7,val:15},{op:0,bits:8,val:103},{op:0,bits:8,val:39},{op:0,bits:9,val:174},{op:0,bits:8,val:7},{op:0,bits:8,val:135}, {op:0,bits:8,val:71},{op:0,bits:9,val:238},{op:16,bits:7,val:9},{op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:158},{op:20,bits:7,val:99}, {op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:222},{op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:190}, {op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79},{op:0,bits:9,val:254},{op:96,bits:7,val:0},{op:0,bits:8,val:80},{op:0,bits:8,val:16}, {op:20,bits:8,val:115},{op:18,bits:7,val:31},{op:0,bits:8,val:112},{op:0,bits:8,val:48},{op:0,bits:9,val:193},{op:16,bits:7,val:10},{op:0,bits:8,val:96}, {op:0,bits:8,val:32},{op:0,bits:9,val:161},{op:0,bits:8,val:0},{op:0,bits:8,val:128},{op:0,bits:8,val:64},{op:0,bits:9,val:225},{op:16,bits:7,val:6}, {op:0,bits:8,val:88},{op:0,bits:8,val:24},{op:0,bits:9,val:145},{op:19,bits:7,val:59},{op:0,bits:8,val:120},{op:0,bits:8,val:56},{op:0,bits:9,val:209}, {op:17,bits:7,val:17},{op:0,bits:8,val:104},{op:0,bits:8,val:40},{op:0,bits:9,val:177},{op:0,bits:8,val:8},{op:0,bits:8,val:136},{op:0,bits:8,val:72}, {op:0,bits:9,val:241},{op:16,bits:7,val:4},{op:0,bits:8,val:84},{op:0,bits:8,val:20},{op:21,bits:8,val:227},{op:19,bits:7,val:43},{op:0,bits:8,val:116}, {op:0,bits:8,val:52},{op:0,bits:9,val:201},{op:17,bits:7,val:13},{op:0,bits:8,val:100},{op:0,bits:8,val:36},{op:0,bits:9,val:169},{op:0,bits:8,val:4}, {op:0,bits:8,val:132},{op:0,bits:8,val:68},{op:0,bits:9,val:233},{op:16,bits:7,val:8},{op:0,bits:8,val:92},{op:0,bits:8,val:28},{op:0,bits:9,val:153}, {op:20,bits:7,val:83},{op:0,bits:8,val:124},{op:0,bits:8,val:60},{op:0,bits:9,val:217},{op:18,bits:7,val:23},{op:0,bits:8,val:108},{op:0,bits:8,val:44}, {op:0,bits:9,val:185},{op:0,bits:8,val:12},{op:0,bits:8,val:140},{op:0,bits:8,val:76},{op:0,bits:9,val:249},{op:16,bits:7,val:3},{op:0,bits:8,val:82}, {op:0,bits:8,val:18},{op:21,bits:8,val:163},{op:19,bits:7,val:35},{op:0,bits:8,val:114},{op:0,bits:8,val:50},{op:0,bits:9,val:197},{op:17,bits:7,val:11}, {op:0,bits:8,val:98},{op:0,bits:8,val:34},{op:0,bits:9,val:165},{op:0,bits:8,val:2},{op:0,bits:8,val:130},{op:0,bits:8,val:66},{op:0,bits:9,val:229}, {op:16,bits:7,val:7},{op:0,bits:8,val:90},{op:0,bits:8,val:26},{op:0,bits:9,val:149},{op:20,bits:7,val:67},{op:0,bits:8,val:122},{op:0,bits:8,val:58}, {op:0,bits:9,val:213},{op:18,bits:7,val:19},{op:0,bits:8,val:106},{op:0,bits:8,val:42},{op:0,bits:9,val:181},{op:0,bits:8,val:10},{op:0,bits:8,val:138}, {op:0,bits:8,val:74},{op:0,bits:9,val:245},{op:16,bits:7,val:5},{op:0,bits:8,val:86},{op:0,bits:8,val:22},{op:64,bits:8,val:0},{op:19,bits:7,val:51}, {op:0,bits:8,val:118},{op:0,bits:8,val:54},{op:0,bits:9,val:205},{op:17,bits:7,val:15},{op:0,bits:8,val:102},{op:0,bits:8,val:38},{op:0,bits:9,val:173}, {op:0,bits:8,val:6},{op:0,bits:8,val:134},{op:0,bits:8,val:70},{op:0,bits:9,val:237},{op:16,bits:7,val:9},{op:0,bits:8,val:94},{op:0,bits:8,val:30}, {op:0,bits:9,val:157},{op:20,bits:7,val:99},{op:0,bits:8,val:126},{op:0,bits:8,val:62},{op:0,bits:9,val:221},{op:18,bits:7,val:27},{op:0,bits:8,val:110}, {op:0,bits:8,val:46},{op:0,bits:9,val:189},{op:0,bits:8,val:14},{op:0,bits:8,val:142},{op:0,bits:8,val:78},{op:0,bits:9,val:253},{op:96,bits:7,val:0}, {op:0,bits:8,val:81},{op:0,bits:8,val:17},{op:21,bits:8,val:131},{op:18,bits:7,val:31},{op:0,bits:8,val:113},{op:0,bits:8,val:49},{op:0,bits:9,val:195}, {op:16,bits:7,val:10},{op:0,bits:8,val:97},{op:0,bits:8,val:33},{op:0,bits:9,val:163},{op:0,bits:8,val:1},{op:0,bits:8,val:129},{op:0,bits:8,val:65}, {op:0,bits:9,val:227},{op:16,bits:7,val:6},{op:0,bits:8,val:89},{op:0,bits:8,val:25},{op:0,bits:9,val:147},{op:19,bits:7,val:59},{op:0,bits:8,val:121}, {op:0,bits:8,val:57},{op:0,bits:9,val:211},{op:17,bits:7,val:17},{op:0,bits:8,val:105},{op:0,bits:8,val:41},{op:0,bits:9,val:179},{op:0,bits:8,val:9}, {op:0,bits:8,val:137},{op:0,bits:8,val:73},{op:0,bits:9,val:243},{op:16,bits:7,val:4},{op:0,bits:8,val:85},{op:0,bits:8,val:21},{op:16,bits:8,val:258}, {op:19,bits:7,val:43},{op:0,bits:8,val:117},{op:0,bits:8,val:53},{op:0,bits:9,val:203},{op:17,bits:7,val:13},{op:0,bits:8,val:101},{op:0,bits:8,val:37}, {op:0,bits:9,val:171},{op:0,bits:8,val:5},{op:0,bits:8,val:133},{op:0,bits:8,val:69},{op:0,bits:9,val:235},{op:16,bits:7,val:8},{op:0,bits:8,val:93}, {op:0,bits:8,val:29},{op:0,bits:9,val:155},{op:20,bits:7,val:83},{op:0,bits:8,val:125},{op:0,bits:8,val:61},{op:0,bits:9,val:219},{op:18,bits:7,val:23}, {op:0,bits:8,val:109},{op:0,bits:8,val:45},{op:0,bits:9,val:187},{op:0,bits:8,val:13},{op:0,bits:8,val:141},{op:0,bits:8,val:77},{op:0,bits:9,val:251}, {op:16,bits:7,val:3},{op:0,bits:8,val:83},{op:0,bits:8,val:19},{op:21,bits:8,val:195},{op:19,bits:7,val:35},{op:0,bits:8,val:115},{op:0,bits:8,val:51}, {op:0,bits:9,val:199},{op:17,bits:7,val:11},{op:0,bits:8,val:99},{op:0,bits:8,val:35},{op:0,bits:9,val:167},{op:0,bits:8,val:3},{op:0,bits:8,val:131}, {op:0,bits:8,val:67},{op:0,bits:9,val:231},{op:16,bits:7,val:7},{op:0,bits:8,val:91},{op:0,bits:8,val:27},{op:0,bits:9,val:151},{op:20,bits:7,val:67}, {op:0,bits:8,val:123},{op:0,bits:8,val:59},{op:0,bits:9,val:215},{op:18,bits:7,val:19},{op:0,bits:8,val:107},{op:0,bits:8,val:43},{op:0,bits:9,val:183}, {op:0,bits:8,val:11},{op:0,bits:8,val:139},{op:0,bits:8,val:75},{op:0,bits:9,val:247},{op:16,bits:7,val:5},{op:0,bits:8,val:87},{op:0,bits:8,val:23}, {op:64,bits:8,val:0},{op:19,bits:7,val:51},{op:0,bits:8,val:119},{op:0,bits:8,val:55},{op:0,bits:9,val:207},{op:17,bits:7,val:15},{op:0,bits:8,val:103}, {op:0,bits:8,val:39},{op:0,bits:9,val:175},{op:0,bits:8,val:7},{op:0,bits:8,val:135},{op:0,bits:8,val:71},{op:0,bits:9,val:239},{op:16,bits:7,val:9}, {op:0,bits:8,val:95},{op:0,bits:8,val:31},{op:0,bits:9,val:159},{op:20,bits:7,val:99},{op:0,bits:8,val:127},{op:0,bits:8,val:63},{op:0,bits:9,val:223}, {op:18,bits:7,val:27},{op:0,bits:8,val:111},{op:0,bits:8,val:47},{op:0,bits:9,val:191},{op:0,bits:8,val:15},{op:0,bits:8,val:143},{op:0,bits:8,val:79}, {op:0,bits:9,val:255}])"));
850
+F||(F=eval("([ {op:16,bits:5,val:1},{op:23,bits:5,val:257},{op:19,bits:5,val:17},{op:27,bits:5,val:4097},{op:17,bits:5,val:5},{op:25,bits:5,val:1025}, {op:21,bits:5,val:65},{op:29,bits:5,val:16385},{op:16,bits:5,val:3},{op:24,bits:5,val:513},{op:20,bits:5,val:33},{op:28,bits:5,val:8193}, {op:18,bits:5,val:9},{op:26,bits:5,val:2049},{op:22,bits:5,val:129},{op:64,bits:5,val:0},{op:16,bits:5,val:2},{op:23,bits:5,val:385}, {op:19,bits:5,val:25},{op:27,bits:5,val:6145},{op:17,bits:5,val:7},{op:25,bits:5,val:1537},{op:21,bits:5,val:97},{op:29,bits:5,val:24577}, {op:16,bits:5,val:4},{op:24,bits:5,val:769},{op:20,bits:5,val:49},{op:28,bits:5,val:12289},{op:18,bits:5,val:13},{op:26,bits:5,val:3073}, {op:22,bits:5,val:193},{op:64,bits:5,val:0}])"));
851
+a.lencode=0;a.distcode=512;for(b=0;512>b;b++)a.codes[b]=x[b];for(b=0;32>b;b++)a.codes[b+512]=F[b];a.lenbits=9;a.distbits=5}function h(a,b){a.state.check=a.checksum_function(a.state.check,[b&255,b>>>8&255],0,2)}function r(a,b){b.strm=a;b.left=a.avail_out;b.next=a.next_in;b.have=a.avail_in;b.hold=a.state.hold;b.bits=a.state.bits;return b}function n(a){var b=a.strm;b.next_in=a.next;b.avail_out=a.left;b.avail_in=a.have;b.state.hold=a.hold;b.state.bits=a.bits}function m(a){a.hold=0;a.bits=0}function w(a){if(0==
852
+a.have)return!1;a.have--;a.hold+=(a.strm.input_data.charCodeAt(a.next++)&255)<<a.bits;a.bits+=8;return!0}function k(a,b){for(;a.bits<b;)if(!w(a))return!1;return!0}function v(a,b){return a.hold&(1<<b)-1}function B(a,b){a.hold>>>=b;a.bits-=b}function l(a){a.hold>>>=a.bits&7;a.bits-=a.bits&7}function g(a){return(a>>>24&255)+(a>>>8&65280)+((a&65280)<<8)+((a&255)<<24)}var I=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,
853
+18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69],D=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],z=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];ZLIB.inflate_copyright=" inflate 1.2.6 Copyright 1995-2012 Mark Adler ";ZLIB.inflateResetKeep=function(a){var b;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;b=a.state;a.total_in=a.total_out=b.total=0;a.msg=null;b.wrap&&(a.adler=
854
b.wrap&1);b.mode=0;b.last=0;b.havedict=0;b.dmax=32768;b.head=null;b.hold=0;b.bits=0;b.lencode=0;b.distcode=0;b.next=0;b.sane=1;b.back=-1;return ZLIB.Z_OK};ZLIB.inflateReset=function(a,b){var c,e;if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;e=a.state;"undefined"===typeof b&&(b=15);0>b?(c=0,b=-b):(c=(b>>>4)+1,48>b&&(b&=15));a.checksum_function=1==c&&"function"===typeof ZLIB.adler32?ZLIB.adler32:2==c&&"function"===typeof ZLIB.crc32?ZLIB.crc32:d;if(b&&(8>b||15<b))return ZLIB.Z_STREAM_ERROR;e.window&&e.wbits!=
854
-b&&(e.window=null);e.wrap=c;e.wbits=b;e.wsize=0;e.whave=0;e.wnext=0;return ZLIB.inflateResetKeep(a)};ZLIB.inflateInit=function(a){var b=new ZLIB.z_stream;b.state=new e;ZLIB.inflateReset(b,a);return b};ZLIB.inflatePrime=function(a,b,c){if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;a=a.state;if(0>b)return a.hold=0,a.bits=0,ZLIB.Z_OK;if(16<b||32<a.bits+b)return ZLIB.Z_STREAM_ERROR;a.hold+=(c&(1<<b)-1)<<a.bits;a.bits+=b;return ZLIB.Z_OK};var B=null,I=null,F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
855
-ZLIB.inflate=function(a,c){var d,e,r,B,q,z=-1,E=-1,K;if(!a||!a.state||!a.input_data&&0!=a.avail_in)return ZLIB.Z_STREAM_ERROR;d=a.state;11==d.mode&&(d.mode=12);e={};u(a,e);r=e.have;B=e.left;K=ZLIB.Z_OK;a:for(;;)switch(d.mode){case 0:if(0==d.wrap){d.mode=12;break}if(!m(e,16))break a;if(d.wrap&2&&35615==e.hold){d.check=a.checksum_function(0,null,0,0);l(a,e.hold);p(e);d.mode=1;break}d.flags=0;null!==d.head&&(d.head.done=-1);if(!(d.wrap&1)||((w(e,8)<<8)+(e.hold>>>8))%31){a.msg="incorrect header check";
856
-d.mode=29;break}if(w(e,4)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}h(e,4);z=w(e,4)+8;if(0==d.wbits)d.wbits=z;else if(z>d.wbits){a.msg="invalid window size";d.mode=29;break}d.dmax=1<<z;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=e.hold&512?9:11;p(e);break;case 1:if(!m(e,16))break a;d.flags=e.hold;if((d.flags&255)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}if(d.flags&57344){a.msg="unknown header flags set";d.mode=29;break}null!==d.head&&
857
-(d.head.text=e.hold>>>8&1);d.flags&512&&l(a,e.hold);p(e);d.mode=2;case 2:if(!m(e,32))break a;null!==d.head&&(d.head.time=e.hold);d.flags&512&&(q=e.hold,a.state.check=a.checksum_function(a.state.check,[q&255,q>>>8&255,q>>>16&255,q>>>24&255],0,4));p(e);d.mode=3;case 3:if(!m(e,16))break a;null!==d.head&&(d.head.xflags=e.hold&255,d.head.os=e.hold>>>8);d.flags&512&&l(a,e.hold);p(e);d.mode=4;case 4:if(d.flags&1024){if(!m(e,16))break a;d.length=e.hold;null!==d.head&&(d.head.extra_len=e.hold);d.flags&512&&
858
-l(a,e.hold);p(e);d.head.extra=""}else null!==d.head&&(d.head.extra=null);d.mode=5;case 5:if(d.flags&1024&&(q=d.length,q>e.have&&(q=e.have),q&&(null!==d.head&&null!==d.head.extra&&(z=d.head.extra_len-d.length,d.head.extra+=a.input_data.substring(e.next,e.next+(z+q>d.head.extra_max?d.head.extra_max-z:q))),d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,q)),e.have-=q,e.next+=q,d.length-=q),d.length))break a;d.length=0;d.mode=6;case 6:if(d.flags&2048){if(0==e.have)break a;null!==
859
-d.head&&null===d.head.name&&(d.head.name="");q=0;do{z=a.input_data.charAt(e.next+q);q++;if("\x00"===z)break;null!==d.head&&d.length<d.head.name_max&&(d.head.name+=z,d.length++)}while(q<e.have);d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,q));e.have-=q;e.next+=q;if("\x00"!==z)break a}else null!==d.head&&(d.head.name=null);d.length=0;d.mode=7;case 7:if(d.flags&4096){if(0==e.have)break a;q=0;null!==d.head&&null===d.head.comment&&(d.head.comment="");do{z=a.input_data.charAt(e.next+
860
-q);q++;if("\x00"===z)break;null!==d.head&&d.length<d.head.comm_max&&(d.head.comment+=z,d.length++)}while(q<e.have);d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,q));e.have-=q;e.next+=q;if("\x00"!==z)break a}else null!==d.head&&(d.head.comment=null);d.mode=8;case 8:if(d.flags&512){if(!m(e,16))break a;if(e.hold!=(d.check&65535)){a.msg="header crc mismatch";d.mode=29;break}p(e)}null!==d.head&&(d.head.hcrc=d.flags>>>9&1,d.head.done=1);a.adler=d.check=a.checksum_function(0,null,
861
-0,0);d.mode=11;break;case 9:if(!m(e,32))break a;a.adler=d.check=g(e.hold);p(e);d.mode=10;case 10:if(0==d.havedict)return n(e),ZLIB.Z_NEED_DICT;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=11;case 11:if(c==ZLIB.Z_BLOCK||c==ZLIB.Z_TREES)break a;case 12:if(d.last){v(e);d.mode=26;break}if(!m(e,3))break a;d.last=w(e,1);h(e,1);switch(w(e,2)){case 0:d.mode=13;break;case 1:k(d);d.mode=19;if(c==ZLIB.Z_TREES){h(e,2);break a}break;case 2:d.mode=16;break;case 3:a.msg="invalid block type",d.mode=29}h(e,
862
-2);break;case 13:v(e);if(!m(e,32))break a;if((e.hold&65535)!=(e.hold>>>16&65535^65535)){a.msg="invalid stored block lengths";d.mode=29;break}d.length=e.hold&65535;p(e);d.mode=14;if(c==ZLIB.Z_TREES)break a;case 14:d.mode=15;case 15:if(q=d.length){q>e.have&&(q=e.have);q>e.left&&(q=e.left);if(0==q)break a;a.output_data+=a.input_data.substring(e.next,e.next+q);a.next_out+=q;e.have-=q;e.next+=q;e.left-=q;d.length-=q;break}d.mode=11;break;case 16:if(!m(e,14))break a;d.nlen=w(e,5)+257;h(e,5);d.ndist=w(e,
863
-5)+1;h(e,5);d.ncode=w(e,4)+4;h(e,4);if(286<d.nlen||30<d.ndist){a.msg="too many length or distance symbols";d.mode=29;break}d.have=0;d.mode=17;case 17:for(;d.have<d.ncode;){if(!m(e,3))break a;q=w(e,3);d.lens[F[d.have++]]=q;h(e,3)}for(;19>d.have;)d.lens[F[d.have++]]=0;d.next=0;d.lencode=0;d.lenbits=7;if(K=b(d,0)){a.msg="invalid code lengths set";d.mode=29;break}d.have=0;d.mode=18;case 18:for(;d.have<d.nlen+d.ndist;){for(;;){q=d.codes[d.lencode+w(e,d.lenbits)];if(q.bits<=e.bits)break;if(!x(e))break a}if(16>
864
-q.val)h(e,q.bits),d.lens[d.have++]=q.val;else{if(16==q.val){if(!m(e,q.bits+2))break a;h(e,q.bits);if(0==d.have){a.msg="invalid bit length repeat";d.mode=29;break}z=d.lens[d.have-1];q=3+w(e,2);h(e,2)}else if(17==q.val){if(!m(e,q.bits+3))break a;h(e,q.bits);z=0;q=3+w(e,3);h(e,3)}else{if(!m(e,q.bits+7))break a;h(e,q.bits);z=0;q=11+w(e,7);h(e,7)}if(d.have+q>d.nlen+d.ndist){a.msg="invalid bit length repeat";d.mode=29;break}for(;q--;)d.lens[d.have++]=z}}if(29==d.mode)break;if(0==d.lens[256]){a.msg="invalid code -- missing end-of-block";
865
-d.mode=29;break}d.next=0;d.lencode=d.next;d.lenbits=9;if(K=b(d,1)){a.msg="invalid literal/lengths set";d.mode=29;break}d.distcode=d.next;d.distbits=6;if(K=b(d,2)){a.msg="invalid distances set";d.mode=29;break}d.mode=19;if(c==ZLIB.Z_TREES)break a;case 19:d.mode=20;case 20:if(6<=e.have&&258<=e.left){n(e);q=a;var I=E=z=void 0,O=void 0,R=void 0,W=void 0,U=void 0,Z=void 0,N=void 0,Y=void 0,L=void 0,G=void 0,H=void 0,ca=void 0,da=void 0,fa=void 0,ga=void 0,ha=void 0,P=void 0,J=void 0,X=void 0,ia=void 0,
866
-ea=-1,P=-1,z=q.state,E=q.input_data,I=q.next_in,O=I+q.avail_in-5,R=q.next_out,W=R-(B-q.avail_out),U=R+(q.avail_out-257),Z=z.wsize,N=z.whave,Y=z.wnext,L=z.window,G=z.hold,H=z.bits,ca=z.codes,da=z.lencode,fa=z.distcode,ga=(1<<z.lenbits)-1,ha=(1<<z.distbits)-1;b:do c:for(15>H&&(G+=(E.charCodeAt(I++)&255)<<H,H+=8,G+=(E.charCodeAt(I++)&255)<<H,H+=8),P=ca[da+(G&ga)];;){J=P.bits;G>>>=J;H-=J;J=P.op;if(0==J)q.output_data+=String.fromCharCode(P.val),R++;else if(J&16){X=P.val;if(J&=15)H<J&&(G+=(E.charCodeAt(I++)&
867
-255)<<H,H+=8),X+=G&(1<<J)-1,G>>>=J,H-=J;15>H&&(G+=(E.charCodeAt(I++)&255)<<H,H+=8,G+=(E.charCodeAt(I++)&255)<<H,H+=8);P=ca[fa+(G&ha)];d:for(;;){J=P.bits;G>>>=J;H-=J;J=P.op;if(J&16){ia=P.val;J&=15;H<J&&(G+=(E.charCodeAt(I++)&255)<<H,H+=8,H<J&&(G+=(E.charCodeAt(I++)&255)<<H,H+=8));ia+=G&(1<<J)-1;G>>>=J;H-=J;J=R-W;if(ia>J){J=ia-J;if(J>N&&z.sane){q.msg="invalid distance too far back";z.mode=29;break b}ea=0;P=-1;ea=0==Y?ea+(Z-J):ea+(Y-J);J<X&&(X-=J,q.output_data+=L.substring(ea,ea+J),R+=J,ea=-1,P=R-ia)}else ea=
868
--1,P=R-ia;if(0<=ea)q.output_data+=L.substring(ea,ea+X),R+=X;else{J=X;J>R-P&&(J=R-P);q.output_data+=q.output_data.substring(P,P+J);R+=J;X-=J;P+=J;for(R+=X;2<X;)q.output_data+=q.output_data.charAt(P++),q.output_data+=q.output_data.charAt(P++),q.output_data+=q.output_data.charAt(P++),X-=3;X&&(q.output_data+=q.output_data.charAt(P++),1<X&&(q.output_data+=q.output_data.charAt(P++)))}}else if(0==(J&64)){P=ca[fa+(P.val+(G&(1<<J)-1))];continue d}else{q.msg="invalid distance code";z.mode=29;break b}break d}}else if(0==
869
-(J&64)){P=ca[da+(P.val+(G&(1<<J)-1))];continue c}else{J&32?z.mode=11:(q.msg="invalid literal/length code",z.mode=29);break b}break c}while(I<O&&R<U);X=H>>>3;I-=X;H-=X<<3;G&=(1<<H)-1;q.next_in=I;q.next_out=R;q.avail_in=I<O?5+(O-I):5-(I-O);q.avail_out=R<U?257+(U-R):257-(R-U);z.hold=G;z.bits=H;u(a,e);11==d.mode&&(d.back=-1);break}for(d.back=0;;){q=d.codes[d.lencode+w(e,d.lenbits)];if(q.bits<=e.bits)break;if(!x(e))break a}if(q.op&&0==(q.op&240)){for(z=q;;){q=d.codes[d.lencode+z.val+(w(e,z.bits+z.op)>>>
870
-z.bits)];if(z.bits+q.bits<=e.bits)break;if(!x(e))break a}h(e,z.bits);d.back+=z.bits}h(e,q.bits);d.back+=q.bits;d.length=q.val;if(0==q.op){d.mode=25;break}if(q.op&32){d.back=-1;d.mode=11;break}if(q.op&64){a.msg="invalid literal/length code";d.mode=29;break}d.extra=q.op&15;d.mode=21;case 21:if(d.extra){if(!m(e,d.extra))break a;d.length+=w(e,d.extra);h(e,d.extra);d.back+=d.extra}d.was=d.length;d.mode=22;case 22:for(;;){q=d.codes[d.distcode+w(e,d.distbits)];if(q.bits<=e.bits)break;if(!x(e))break a}if(0==
871
-(q.op&240)){for(z=q;;){q=d.codes[d.distcode+z.val+(w(e,z.bits+z.op)>>>z.bits)];if(z.bits+q.bits<=e.bits)break;if(!x(e))break a}h(e,z.bits);d.back+=z.bits}h(e,q.bits);d.back+=q.bits;if(q.op&64){a.msg="invalid distance code";d.mode=29;break}d.offset=q.val;d.extra=q.op&15;d.mode=23;case 23:if(d.extra){if(!m(e,d.extra))break a;d.offset+=w(e,d.extra);h(e,d.extra);d.back+=d.extra}d.mode=24;case 24:if(0==e.left)break a;q=B-e.left;if(d.offset>q){q=d.offset-q;if(q>d.whave&&d.sane){a.msg="invalid distance too far back";
872
-d.mode=29;break}q>d.wnext?(q-=d.wnext,z=d.wsize-q):z=d.wnext-q;E=-1;q>d.length&&(q=d.length)}else z=-1,E=a.next_out-d.offset,q=d.length;q>e.left&&(q=e.left);e.left-=q;d.length-=q;if(0<=z)a.output_data+=d.window.substring(z,z+q),a.next_out+=q;else{a.next_out+=q;do a.output_data+=a.output_data.charAt(E++);while(--q)}0==d.length&&(d.mode=20);break;case 25:if(0==e.left)break a;a.output_data+=String.fromCharCode(d.length);a.next_out++;e.left--;d.mode=20;break;case 26:if(d.wrap){if(!m(e,32))break a;B-=
873
-e.left;a.total_out+=B;d.total+=B;B&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,a.output_data.length-B,B));B=e.left;if((d.flags?e.hold:g(e.hold))!=d.check){a.msg="incorrect data check";d.mode=29;break}p(e)}d.mode=27;case 27:if(d.wrap&&d.flags){if(!m(e,32))break a;if(e.hold!=(d.total&4294967295)){a.msg="incorrect length check";d.mode=29;break}p(e)}d.mode=28;case 28:K=ZLIB.Z_STREAM_END;break a;case 29:K=ZLIB.Z_DATA_ERROR;break a;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}n(e);
874
-if(d.wsize||B!=a.avail_out&&29>d.mode&&(26>d.mode||c!=ZLIB.Z_FINISH))e=a.state,q=a.output_data.length,null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<<e.wbits),e.window=q>=e.wsize?a.output_data.substring(q-e.wsize):e.whave+q<e.wsize?e.window+a.output_data:e.window.substring(e.whave-(e.wsize-q))+a.output_data,e.whave=e.window.length,e.wnext=e.whave<e.wsize?e.whave:0;r-=a.avail_in;B-=a.avail_out;a.total_in+=r;a.total_out+=B;d.total+=B;d.wrap&&B&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,
875
-0,a.output_data.length));a.data_type=d.bits+(d.last?64:0)+(11==d.mode?128:0)+(19==d.mode||14==d.mode?256:0);(0==r&&0==B||c==ZLIB.Z_FINISH)&&K==ZLIB.Z_OK&&(K=ZLIB.Z_BUF_ERROR);return K};ZLIB.inflateEnd=function(a){if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;a.state.window=null;a.state=null;return ZLIB.Z_OK};ZLIB.z_stream.prototype.inflate=function(b,c){var d,e;this.input_data=b;this.next_in=a(c,"next_in",0);this.avail_in=a(c,"avail_in",b.length-this.next_in);d=a(c,"flush",ZLIB.Z_SYNC_FLUSH);e=a(c,"avail_out",
855
+b&&(e.window=null);e.wrap=c;e.wbits=b;e.wsize=0;e.whave=0;e.wnext=0;return ZLIB.inflateResetKeep(a)};ZLIB.inflateInit=function(a){var b=new ZLIB.z_stream;b.state=new e;ZLIB.inflateReset(b,a);return b};ZLIB.inflatePrime=function(a,b,c){if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;a=a.state;if(0>b)return a.hold=0,a.bits=0,ZLIB.Z_OK;if(16<b||32<a.bits+b)return ZLIB.Z_STREAM_ERROR;a.hold+=(c&(1<<b)-1)<<a.bits;a.bits+=b;return ZLIB.Z_OK};var x=null,F=null,G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];
856
+ZLIB.inflate=function(a,c){var d,e,u,z,p,x=-1,D=-1,F;if(!a||!a.state||!a.input_data&&0!=a.avail_in)return ZLIB.Z_STREAM_ERROR;d=a.state;11==d.mode&&(d.mode=12);e={};r(a,e);u=e.have;z=e.left;F=ZLIB.Z_OK;a:for(;;)switch(d.mode){case 0:if(0==d.wrap){d.mode=12;break}if(!k(e,16))break a;if(d.wrap&2&&35615==e.hold){d.check=a.checksum_function(0,null,0,0);h(a,e.hold);m(e);d.mode=1;break}d.flags=0;null!==d.head&&(d.head.done=-1);if(!(d.wrap&1)||((v(e,8)<<8)+(e.hold>>>8))%31){a.msg="incorrect header check";
857
+d.mode=29;break}if(v(e,4)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}B(e,4);x=v(e,4)+8;if(0==d.wbits)d.wbits=x;else if(x>d.wbits){a.msg="invalid window size";d.mode=29;break}d.dmax=1<<x;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=e.hold&512?9:11;m(e);break;case 1:if(!k(e,16))break a;d.flags=e.hold;if((d.flags&255)!=ZLIB.Z_DEFLATED){a.msg="unknown compression method";d.mode=29;break}if(d.flags&57344){a.msg="unknown header flags set";d.mode=29;break}null!==d.head&&
858
+(d.head.text=e.hold>>>8&1);d.flags&512&&h(a,e.hold);m(e);d.mode=2;case 2:if(!k(e,32))break a;null!==d.head&&(d.head.time=e.hold);d.flags&512&&(p=e.hold,a.state.check=a.checksum_function(a.state.check,[p&255,p>>>8&255,p>>>16&255,p>>>24&255],0,4));m(e);d.mode=3;case 3:if(!k(e,16))break a;null!==d.head&&(d.head.xflags=e.hold&255,d.head.os=e.hold>>>8);d.flags&512&&h(a,e.hold);m(e);d.mode=4;case 4:if(d.flags&1024){if(!k(e,16))break a;d.length=e.hold;null!==d.head&&(d.head.extra_len=e.hold);d.flags&512&&
859
+h(a,e.hold);m(e);d.head.extra=""}else null!==d.head&&(d.head.extra=null);d.mode=5;case 5:if(d.flags&1024&&(p=d.length,p>e.have&&(p=e.have),p&&(null!==d.head&&null!==d.head.extra&&(x=d.head.extra_len-d.length,d.head.extra+=a.input_data.substring(e.next,e.next+(x+p>d.head.extra_max?d.head.extra_max-x:p))),d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,p)),e.have-=p,e.next+=p,d.length-=p),d.length))break a;d.length=0;d.mode=6;case 6:if(d.flags&2048){if(0==e.have)break a;null!==
860
+d.head&&null===d.head.name&&(d.head.name="");p=0;do{x=a.input_data.charAt(e.next+p);p++;if("\x00"===x)break;null!==d.head&&d.length<d.head.name_max&&(d.head.name+=x,d.length++)}while(p<e.have);d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,p));e.have-=p;e.next+=p;if("\x00"!==x)break a}else null!==d.head&&(d.head.name=null);d.length=0;d.mode=7;case 7:if(d.flags&4096){if(0==e.have)break a;p=0;null!==d.head&&null===d.head.comment&&(d.head.comment="");do{x=a.input_data.charAt(e.next+
861
+p);p++;if("\x00"===x)break;null!==d.head&&d.length<d.head.comm_max&&(d.head.comment+=x,d.length++)}while(p<e.have);d.flags&512&&(d.check=a.checksum_function(d.check,a.input_data,e.next,p));e.have-=p;e.next+=p;if("\x00"!==x)break a}else null!==d.head&&(d.head.comment=null);d.mode=8;case 8:if(d.flags&512){if(!k(e,16))break a;if(e.hold!=(d.check&65535)){a.msg="header crc mismatch";d.mode=29;break}m(e)}null!==d.head&&(d.head.hcrc=d.flags>>>9&1,d.head.done=1);a.adler=d.check=a.checksum_function(0,null,
862
+0,0);d.mode=11;break;case 9:if(!k(e,32))break a;a.adler=d.check=g(e.hold);m(e);d.mode=10;case 10:if(0==d.havedict)return n(e),ZLIB.Z_NEED_DICT;a.adler=d.check=a.checksum_function(0,null,0,0);d.mode=11;case 11:if(c==ZLIB.Z_BLOCK||c==ZLIB.Z_TREES)break a;case 12:if(d.last){l(e);d.mode=26;break}if(!k(e,3))break a;d.last=v(e,1);B(e,1);switch(v(e,2)){case 0:d.mode=13;break;case 1:q(d);d.mode=19;if(c==ZLIB.Z_TREES){B(e,2);break a}break;case 2:d.mode=16;break;case 3:a.msg="invalid block type",d.mode=29}B(e,
863
+2);break;case 13:l(e);if(!k(e,32))break a;if((e.hold&65535)!=(e.hold>>>16&65535^65535)){a.msg="invalid stored block lengths";d.mode=29;break}d.length=e.hold&65535;m(e);d.mode=14;if(c==ZLIB.Z_TREES)break a;case 14:d.mode=15;case 15:if(p=d.length){p>e.have&&(p=e.have);p>e.left&&(p=e.left);if(0==p)break a;a.output_data+=a.input_data.substring(e.next,e.next+p);a.next_out+=p;e.have-=p;e.next+=p;e.left-=p;d.length-=p;break}d.mode=11;break;case 16:if(!k(e,14))break a;d.nlen=v(e,5)+257;B(e,5);d.ndist=v(e,
864
+5)+1;B(e,5);d.ncode=v(e,4)+4;B(e,4);if(286<d.nlen||30<d.ndist){a.msg="too many length or distance symbols";d.mode=29;break}d.have=0;d.mode=17;case 17:for(;d.have<d.ncode;){if(!k(e,3))break a;p=v(e,3);d.lens[G[d.have++]]=p;B(e,3)}for(;19>d.have;)d.lens[G[d.have++]]=0;d.next=0;d.lencode=0;d.lenbits=7;if(F=b(d,0)){a.msg="invalid code lengths set";d.mode=29;break}d.have=0;d.mode=18;case 18:for(;d.have<d.nlen+d.ndist;){for(;;){p=d.codes[d.lencode+v(e,d.lenbits)];if(p.bits<=e.bits)break;if(!w(e))break a}if(16>
865
+p.val)B(e,p.bits),d.lens[d.have++]=p.val;else{if(16==p.val){if(!k(e,p.bits+2))break a;B(e,p.bits);if(0==d.have){a.msg="invalid bit length repeat";d.mode=29;break}x=d.lens[d.have-1];p=3+v(e,2);B(e,2)}else if(17==p.val){if(!k(e,p.bits+3))break a;B(e,p.bits);x=0;p=3+v(e,3);B(e,3)}else{if(!k(e,p.bits+7))break a;B(e,p.bits);x=0;p=11+v(e,7);B(e,7)}if(d.have+p>d.nlen+d.ndist){a.msg="invalid bit length repeat";d.mode=29;break}for(;p--;)d.lens[d.have++]=x}}if(29==d.mode)break;if(0==d.lens[256]){a.msg="invalid code -- missing end-of-block";
866
+d.mode=29;break}d.next=0;d.lencode=d.next;d.lenbits=9;if(F=b(d,1)){a.msg="invalid literal/lengths set";d.mode=29;break}d.distcode=d.next;d.distbits=6;if(F=b(d,2)){a.msg="invalid distances set";d.mode=29;break}d.mode=19;if(c==ZLIB.Z_TREES)break a;case 19:d.mode=20;case 20:if(6<=e.have&&258<=e.left){n(e);p=a;var I=D=x=void 0,P=void 0,R=void 0,V=void 0,Z=void 0,aa=void 0,N=void 0,Y=void 0,L=void 0,H=void 0,J=void 0,X=void 0,da=void 0,fa=void 0,ga=void 0,ha=void 0,O=void 0,K=void 0,W=void 0,ia=void 0,
867
+ea=-1,O=-1,x=p.state,D=p.input_data,I=p.next_in,P=I+p.avail_in-5,R=p.next_out,V=R-(z-p.avail_out),Z=R+(p.avail_out-257),aa=x.wsize,N=x.whave,Y=x.wnext,L=x.window,H=x.hold,J=x.bits,X=x.codes,da=x.lencode,fa=x.distcode,ga=(1<<x.lenbits)-1,ha=(1<<x.distbits)-1;b:do c:for(15>J&&(H+=(D.charCodeAt(I++)&255)<<J,J+=8,H+=(D.charCodeAt(I++)&255)<<J,J+=8),O=X[da+(H&ga)];;){K=O.bits;H>>>=K;J-=K;K=O.op;if(0==K)p.output_data+=String.fromCharCode(O.val),R++;else if(K&16){W=O.val;if(K&=15)J<K&&(H+=(D.charCodeAt(I++)&
868
+255)<<J,J+=8),W+=H&(1<<K)-1,H>>>=K,J-=K;15>J&&(H+=(D.charCodeAt(I++)&255)<<J,J+=8,H+=(D.charCodeAt(I++)&255)<<J,J+=8);O=X[fa+(H&ha)];d:for(;;){K=O.bits;H>>>=K;J-=K;K=O.op;if(K&16){ia=O.val;K&=15;J<K&&(H+=(D.charCodeAt(I++)&255)<<J,J+=8,J<K&&(H+=(D.charCodeAt(I++)&255)<<J,J+=8));ia+=H&(1<<K)-1;H>>>=K;J-=K;K=R-V;if(ia>K){K=ia-K;if(K>N&&x.sane){p.msg="invalid distance too far back";x.mode=29;break b}ea=0;O=-1;ea=0==Y?ea+(aa-K):ea+(Y-K);K<W&&(W-=K,p.output_data+=L.substring(ea,ea+K),R+=K,ea=-1,O=R-ia)}else ea=
869
+-1,O=R-ia;if(0<=ea)p.output_data+=L.substring(ea,ea+W),R+=W;else{K=W;K>R-O&&(K=R-O);p.output_data+=p.output_data.substring(O,O+K);R+=K;W-=K;O+=K;for(R+=W;2<W;)p.output_data+=p.output_data.charAt(O++),p.output_data+=p.output_data.charAt(O++),p.output_data+=p.output_data.charAt(O++),W-=3;W&&(p.output_data+=p.output_data.charAt(O++),1<W&&(p.output_data+=p.output_data.charAt(O++)))}}else if(0==(K&64)){O=X[fa+(O.val+(H&(1<<K)-1))];continue d}else{p.msg="invalid distance code";x.mode=29;break b}break d}}else if(0==
870
+(K&64)){O=X[da+(O.val+(H&(1<<K)-1))];continue c}else{K&32?x.mode=11:(p.msg="invalid literal/length code",x.mode=29);break b}break c}while(I<P&&R<Z);W=J>>>3;I-=W;J-=W<<3;H&=(1<<J)-1;p.next_in=I;p.next_out=R;p.avail_in=I<P?5+(P-I):5-(I-P);p.avail_out=R<Z?257+(Z-R):257-(R-Z);x.hold=H;x.bits=J;r(a,e);11==d.mode&&(d.back=-1);break}for(d.back=0;;){p=d.codes[d.lencode+v(e,d.lenbits)];if(p.bits<=e.bits)break;if(!w(e))break a}if(p.op&&0==(p.op&240)){for(x=p;;){p=d.codes[d.lencode+x.val+(v(e,x.bits+x.op)>>>
871
+x.bits)];if(x.bits+p.bits<=e.bits)break;if(!w(e))break a}B(e,x.bits);d.back+=x.bits}B(e,p.bits);d.back+=p.bits;d.length=p.val;if(0==p.op){d.mode=25;break}if(p.op&32){d.back=-1;d.mode=11;break}if(p.op&64){a.msg="invalid literal/length code";d.mode=29;break}d.extra=p.op&15;d.mode=21;case 21:if(d.extra){if(!k(e,d.extra))break a;d.length+=v(e,d.extra);B(e,d.extra);d.back+=d.extra}d.was=d.length;d.mode=22;case 22:for(;;){p=d.codes[d.distcode+v(e,d.distbits)];if(p.bits<=e.bits)break;if(!w(e))break a}if(0==
872
+(p.op&240)){for(x=p;;){p=d.codes[d.distcode+x.val+(v(e,x.bits+x.op)>>>x.bits)];if(x.bits+p.bits<=e.bits)break;if(!w(e))break a}B(e,x.bits);d.back+=x.bits}B(e,p.bits);d.back+=p.bits;if(p.op&64){a.msg="invalid distance code";d.mode=29;break}d.offset=p.val;d.extra=p.op&15;d.mode=23;case 23:if(d.extra){if(!k(e,d.extra))break a;d.offset+=v(e,d.extra);B(e,d.extra);d.back+=d.extra}d.mode=24;case 24:if(0==e.left)break a;p=z-e.left;if(d.offset>p){p=d.offset-p;if(p>d.whave&&d.sane){a.msg="invalid distance too far back";
873
+d.mode=29;break}p>d.wnext?(p-=d.wnext,x=d.wsize-p):x=d.wnext-p;D=-1;p>d.length&&(p=d.length)}else x=-1,D=a.next_out-d.offset,p=d.length;p>e.left&&(p=e.left);e.left-=p;d.length-=p;if(0<=x)a.output_data+=d.window.substring(x,x+p),a.next_out+=p;else{a.next_out+=p;do a.output_data+=a.output_data.charAt(D++);while(--p)}0==d.length&&(d.mode=20);break;case 25:if(0==e.left)break a;a.output_data+=String.fromCharCode(d.length);a.next_out++;e.left--;d.mode=20;break;case 26:if(d.wrap){if(!k(e,32))break a;z-=
874
+e.left;a.total_out+=z;d.total+=z;z&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,a.output_data.length-z,z));z=e.left;if((d.flags?e.hold:g(e.hold))!=d.check){a.msg="incorrect data check";d.mode=29;break}m(e)}d.mode=27;case 27:if(d.wrap&&d.flags){if(!k(e,32))break a;if(e.hold!=(d.total&4294967295)){a.msg="incorrect length check";d.mode=29;break}m(e)}d.mode=28;case 28:F=ZLIB.Z_STREAM_END;break a;case 29:F=ZLIB.Z_DATA_ERROR;break a;case 30:return ZLIB.Z_MEM_ERROR;default:return ZLIB.Z_STREAM_ERROR}n(e);
875
+if(d.wsize||z!=a.avail_out&&29>d.mode&&(26>d.mode||c!=ZLIB.Z_FINISH))e=a.state,p=a.output_data.length,null===e.window&&(e.window=""),0==e.wsize&&(e.wsize=1<<e.wbits),e.window=p>=e.wsize?a.output_data.substring(p-e.wsize):e.whave+p<e.wsize?e.window+a.output_data:e.window.substring(e.whave-(e.wsize-p))+a.output_data,e.whave=e.window.length,e.wnext=e.whave<e.wsize?e.whave:0;u-=a.avail_in;z-=a.avail_out;a.total_in+=u;a.total_out+=z;d.total+=z;d.wrap&&z&&(a.adler=d.check=a.checksum_function(d.check,a.output_data,
876
+0,a.output_data.length));a.data_type=d.bits+(d.last?64:0)+(11==d.mode?128:0)+(19==d.mode||14==d.mode?256:0);(0==u&&0==z||c==ZLIB.Z_FINISH)&&F==ZLIB.Z_OK&&(F=ZLIB.Z_BUF_ERROR);return F};ZLIB.inflateEnd=function(a){if(!a||!a.state)return ZLIB.Z_STREAM_ERROR;a.state.window=null;a.state=null;return ZLIB.Z_OK};ZLIB.z_stream.prototype.inflate=function(b,c){var d,e;this.input_data=b;this.next_in=a(c,"next_in",0);this.avail_in=a(c,"avail_in",b.length-this.next_in);d=a(c,"flush",ZLIB.Z_SYNC_FLUSH);e=a(c,"avail_out",
877
-1);var g="";do{this.avail_out=0<=e?e:16384;this.output_data="";this.next_out=0;this.error=ZLIB.inflate(this,d);if(0<=e)return this.output_data;g+=this.output_data;if(0<this.avail_out)break}while(this.error==ZLIB.Z_OK);return g};ZLIB.z_stream.prototype.inflateReset=function(a){return ZLIB.inflateReset(this,a)}})();"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js");
877
-(function(){function b(a,b,c,k){var l,u;l=a>>>16&65535;a&=65535;if(1==k)return a+=b.charCodeAt(c)&255,65521<=a&&(a-=65521),l+=a,65521<=l&&(l-=65521),a|l<<16;if(null===b)return 1;if(16>k){for(;k--;)a+=b.charCodeAt(c++)&255,l+=a;65521<=a&&(a-=65521);return a|l%65521<<16}for(;5552<=k;){k-=5552;u=347;do a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&
878
-255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a;while(--u);a%=65521;l%=65521}if(k){for(;16<=k;)k-=16,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&
879
-255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a,a+=b.charCodeAt(c++)&255,l+=a;for(;k--;)a+=b.charCodeAt(c++)&255,l+=a;a%=65521;l%=65521}return a|l<<16}function c(a,b,c,k){var l,u;l=a>>>16&65535;a&=65535;if(1==k)return a+=b[c],65521<=a&&(a-=65521),l+=a,65521<=l&&(l-=65521),
880
-a|l<<16;if(null===b)return 1;if(16>k){for(;k--;)a+=b[c++],l+=a;65521<=a&&(a-=65521);return a|l%65521<<16}for(;5552<=k;){k-=5552;u=347;do a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a;while(--u);a%=65521;l%=65521}if(k){for(;16<=k;)k-=16,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=
881
-a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a,a+=b[c++],l+=a;for(;k--;)a+=b[c++],l+=a;a%=65521;l%=65521}return a|l<<16}ZLIB.adler32=function(a,d,e,k){return"string"===typeof d?b(a,d,e,k):c(a,d,e,k)};ZLIB.adler32_combine=function(a,b,c){var k,l;if(0>c)return 4294967295;l=c%65521;c=a&65535;k=l*c%65521;c+=(b&65535)+65521-1;k+=(a>>16&65535)+(b>>16&65535)+65521-l;65521<=c&&(c-=65521);65521<=c&&(c-=
882
-65521);131042<=k&&(k-=131042);65521<=k&&(k-=65521);return c|k<<16}})();"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js");
883
-(function(){function b(a,b){var c,l=0;for(c=0;b;)b&1&&(c^=a[l]),b>>=1,l++;return c}function c(a,c){var k;for(k=0;32>k;k++)a[k]=b(c,c[k])}var a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,
878
+(function(){function b(a,b,c,q){var h,r;h=a>>>16&65535;a&=65535;if(1==q)return a+=b.charCodeAt(c)&255,65521<=a&&(a-=65521),h+=a,65521<=h&&(h-=65521),a|h<<16;if(null===b)return 1;if(16>q){for(;q--;)a+=b.charCodeAt(c++)&255,h+=a;65521<=a&&(a-=65521);return a|h%65521<<16}for(;5552<=q;){q-=5552;r=347;do a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&
879
+255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a;while(--r);a%=65521;h%=65521}if(q){for(;16<=q;)q-=16,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&
880
+255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a,a+=b.charCodeAt(c++)&255,h+=a;for(;q--;)a+=b.charCodeAt(c++)&255,h+=a;a%=65521;h%=65521}return a|h<<16}function c(a,b,c,q){var h,r;h=a>>>16&65535;a&=65535;if(1==q)return a+=b[c],65521<=a&&(a-=65521),h+=a,65521<=h&&(h-=65521),
881
+a|h<<16;if(null===b)return 1;if(16>q){for(;q--;)a+=b[c++],h+=a;65521<=a&&(a-=65521);return a|h%65521<<16}for(;5552<=q;){q-=5552;r=347;do a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a;while(--r);a%=65521;h%=65521}if(q){for(;16<=q;)q-=16,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=
882
+a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a,a+=b[c++],h+=a;for(;q--;)a+=b[c++],h+=a;a%=65521;h%=65521}return a|h<<16}ZLIB.adler32=function(a,d,e,q){return"string"===typeof d?b(a,d,e,q):c(a,d,e,q)};ZLIB.adler32_combine=function(a,b,c){var q,h;if(0>c)return 4294967295;h=c%65521;c=a&65535;q=h*c%65521;c+=(b&65535)+65521-1;q+=(a>>16&65535)+(b>>16&65535)+65521-h;65521<=c&&(c-=65521);65521<=c&&(c-=
883
+65521);131042<=q&&(q-=131042);65521<=q&&(q-=65521);return c|q<<16}})();"undefined"===typeof ZLIB&&alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js");
884
+(function(){function b(a,b){var c,h=0;for(c=0;b;)b&1&&(c^=a[h]),b>>=1,h++;return c}function c(a,c){var q;for(q=0;32>q;q++)a[q]=b(c,c[q])}var a=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,
885
3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,
886
476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,
887
3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,
888
1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,
888
-1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];ZLIB.crc32=function(b,c,k,l){if("string"===typeof c){if(null==c)c=0;else{for(b^=4294967295;8<=l;)b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=
889
-a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,b=a[(b^c.charCodeAt(k++))&255]^b>>>8,l-=8;if(l){do b=a[(b^c.charCodeAt(k++))&255]^b>>>8;while(--l)}c=b^4294967295}return c}if(null==c)c=0;else{for(b^=4294967295;8<=l;)b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&
890
-255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,b=a[(b^c[k++])&255]^b>>>8,l-=8;if(l){do b=a[(b^c[k++])&255]^b>>>8;while(--l)}c=b^4294967295}return c};ZLIB.crc32_combine=function(a,e,k){var l,u,n,p;if(0>=k)return a;n=Array(32);p=Array(32);p[0]=3988292384;for(l=u=1;32>l;l++)p[l]=u,u<<=1;c(n,p);c(p,n);do{c(n,p);k&1&&(a=b(n,a));k>>=1;if(0==k)break;c(p,n);k&1&&(a=b(p,a));k>>=1}while(0!=k);return a^e}})();
891
-var saveAs=saveAs||function(b){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var c=b.document.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in c,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),e=b.webkitRequestFileSystem,k=b.requestFileSystem||e||b.mozRequestFileSystem,l=function(a){(b.setImmediate||b.setTimeout)(function(){throw a;},0)},u=0,n=function(a){var c=function(){"string"===typeof a?(b.URL||b.webkitURL||b).revokeObjectURL(a):a.remove()};
892
-b.chrome?c():setTimeout(c,500)},p=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"===typeof e)try{e.call(a,c||a)}catch(k){l(k)}}},x=function(a){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a},m=function(h,l,g){g||(h=x(h));var m=this;g=h.type;var r=!1,w,z,B=function(){p(m,["writestart","progress","write","writeend"])},I=function(){if(z&&d&&"undefined"!==typeof FileReader){var a=
893
-new FileReader;a.onloadend=function(){var b=a.result;z.location.href="data:attachment/file"+b.slice(b.search(/[,;]/));m.readyState=m.DONE;B()};a.readAsDataURL(h);m.readyState=m.INIT}else{if(r||!w)w=(b.URL||b.webkitURL||b).createObjectURL(h);z?z.location.href=w:void 0==b.open(w,"_blank")&&d&&(b.location.href=w);m.readyState=m.DONE;B();n(w)}},F=function(a){return function(){if(m.readyState!==m.DONE)return a.apply(this,arguments)}},D={create:!0,exclusive:!1},A;m.readyState=m.INIT;l||(l="download");if(a)w=
894
-(b.URL||b.webkitURL||b).createObjectURL(h),c.href=w,c.download=l,setTimeout(function(){var a=new MouseEvent("click");c.dispatchEvent(a);B();n(w);m.readyState=m.DONE});else{b.chrome&&g&&"application/octet-stream"!==g&&(A=h.slice||h.webkitSlice,h=A.call(h,0,h.size,"application/octet-stream"),r=!0);e&&"download"!==l&&(l+=".download");if("application/octet-stream"===g||e)z=b;k?(u+=h.size,k(b.TEMPORARY,u,F(function(a){a.root.getDirectory("saved",D,F(function(a){var b=function(){a.getFile(l,D,F(function(a){a.createWriter(F(function(b){b.onwriteend=
895
-function(b){z.location.href=a.toURL();m.readyState=m.DONE;p(m,"writeend",b);n(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&I()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=m["on"+a]});b.write(h);m.abort=function(){b.abort();m.readyState=m.DONE};m.readyState=m.WRITING}),I)}),I)};a.getFile(l,{create:!1},F(function(a){a.remove();b()}),F(function(a){a.code===a.NOT_FOUND_ERR?b():I()}))}),I)}),I)):I()}},w=m.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a,
896
-b,c){c||(a=x(a));return navigator.msSaveOrOpenBlob(a,b||"download")};w.abort=function(){this.readyState=this.DONE;p(this,"abort")};w.readyState=w.INIT=0;w.WRITING=1;w.DONE=2;w.error=w.onwritestart=w.onprogress=w.onwrite=w.onabort=w.onerror=w.onwriteend=null;return function(a,b,c){return new m(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content);
889
+1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];ZLIB.crc32=function(b,c,q,h){if("string"===typeof c){if(null==c)c=0;else{for(b^=4294967295;8<=h;)b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=
890
+a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,b=a[(b^c.charCodeAt(q++))&255]^b>>>8,h-=8;if(h){do b=a[(b^c.charCodeAt(q++))&255]^b>>>8;while(--h)}c=b^4294967295}return c}if(null==c)c=0;else{for(b^=4294967295;8<=h;)b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&
891
+255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,b=a[(b^c[q++])&255]^b>>>8,h-=8;if(h){do b=a[(b^c[q++])&255]^b>>>8;while(--h)}c=b^4294967295}return c};ZLIB.crc32_combine=function(a,e,q){var h,r,n,m;if(0>=q)return a;n=Array(32);m=Array(32);m[0]=3988292384;for(h=r=1;32>h;h++)m[h]=r,r<<=1;c(n,m);c(m,n);do{c(n,m);q&1&&(a=b(n,a));q>>=1;if(0==q)break;c(m,n);q&1&&(a=b(m,a));q>>=1}while(0!=q);return a^e}})();
892
+var saveAs=saveAs||function(b){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var c=b.document.createElementNS("http://www.w3.org/1999/xhtml","a"),a="download"in c,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),e=b.webkitRequestFileSystem,q=b.requestFileSystem||e||b.mozRequestFileSystem,h=function(a){(b.setImmediate||b.setTimeout)(function(){throw a;},0)},r=0,n=function(a){var c=function(){"string"===typeof a?(b.URL||b.webkitURL||b).revokeObjectURL(a):a.remove()};
893
+b.chrome?c():setTimeout(c,500)},m=function(a,b,c){b=[].concat(b);for(var d=b.length;d--;){var e=a["on"+b[d]];if("function"===typeof e)try{e.call(a,c||a)}catch(k){h(k)}}},w=function(a){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\ufeff",a],{type:a.type}):a},k=function(h,k,g){g||(h=w(h));var v=this;g=h.type;var u=!1,D,z,x=function(){m(v,["writestart","progress","write","writeend"])},F=function(){if(z&&d&&"undefined"!==typeof FileReader){var a=
894
+new FileReader;a.onloadend=function(){var b=a.result;z.location.href="data:attachment/file"+b.slice(b.search(/[,;]/));v.readyState=v.DONE;x()};a.readAsDataURL(h);v.readyState=v.INIT}else{if(u||!D)D=(b.URL||b.webkitURL||b).createObjectURL(h);z?z.location.href=D:void 0==b.open(D,"_blank")&&d&&(b.location.href=D);v.readyState=v.DONE;x();n(D)}},G=function(a){return function(){if(v.readyState!==v.DONE)return a.apply(this,arguments)}},E={create:!0,exclusive:!1},A;v.readyState=v.INIT;k||(k="download");if(a)D=
895
+(b.URL||b.webkitURL||b).createObjectURL(h),c.href=D,c.download=k,setTimeout(function(){var a=new MouseEvent("click");c.dispatchEvent(a);x();n(D);v.readyState=v.DONE});else{b.chrome&&g&&"application/octet-stream"!==g&&(A=h.slice||h.webkitSlice,h=A.call(h,0,h.size,"application/octet-stream"),u=!0);e&&"download"!==k&&(k+=".download");if("application/octet-stream"===g||e)z=b;q?(r+=h.size,q(b.TEMPORARY,r,G(function(a){a.root.getDirectory("saved",E,G(function(a){var b=function(){a.getFile(k,E,G(function(a){a.createWriter(G(function(b){b.onwriteend=
896
+function(b){z.location.href=a.toURL();v.readyState=v.DONE;m(v,"writeend",b);n(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&F()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=v["on"+a]});b.write(h);v.abort=function(){b.abort();v.readyState=v.DONE};v.readyState=v.WRITING}),F)}),F)};a.getFile(k,{create:!1},G(function(a){a.remove();b()}),G(function(a){a.code===a.NOT_FOUND_ERR?b():F()}))}),F)}),F)):F()}},v=k.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a,
897
+b,c){c||(a=w(a));return navigator.msSaveOrOpenBlob(a,b||"download")};v.abort=function(){this.readyState=this.DONE;m(this,"abort")};v.readyState=v.INIT=0;v.WRITING=1;v.DONE=2;v.error=v.onwritestart=v.onprogress=v.onwrite=v.onabort=v.onerror=v.onwriteend=null;return function(a,b,c){return new k(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content);
898
"undefined"!==typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs});
899
var version="0.7.8",urlvars={},amtstack,wsstack=null,AllWsman="AMT_8021xCredentialContext AMT_8021XProfile AMT_ActiveFilterStatistics AMT_AgentPresenceCapabilities AMT_AgentPresenceInterfacePolicy AMT_AgentPresenceService AMT_AgentPresenceWatchdog AMT_AgentPresenceWatchdogAction AMT_AlarmClockService IPS_AlarmClockOccurrence AMT_AssetTable AMT_AssetTableService AMT_AuditLog AMT_AuditPolicyRule AMT_AuthorizationService AMT_BootCapabilities AMT_BootSettingData AMT_ComplexFilterEntryBase AMT_CRL AMT_CryptographicCapabilities AMT_EACCredentialContext AMT_EndpointAccessControlService AMT_EnvironmentDetectionInterfacePolicy AMT_EnvironmentDetectionSettingData AMT_EthernetPortSettings AMT_EventLogEntry AMT_EventManagerService AMT_EventSubscriber AMT_FilterEntryBase AMT_FilterInSystemDefensePolicy AMT_GeneralSettings AMT_GeneralSystemDefenseCapabilities AMT_Hdr8021Filter AMT_HeuristicPacketFilterInterfacePolicy AMT_HeuristicPacketFilterSettings AMT_HeuristicPacketFilterStatistics AMT_InterfacePolicy AMT_IPHeadersFilter AMT_KerberosSettingData AMT_ManagementPresenceRemoteSAP AMT_MessageLog AMT_MPSUsernamePassword AMT_NetworkFilter AMT_NetworkPortDefaultSystemDefensePolicy AMT_NetworkPortSystemDefenseCapabilities AMT_NetworkPortSystemDefensePolicy AMT_PCIDevice AMT_PETCapabilities AMT_PETFilterForTarget AMT_PETFilterSetting AMT_ProvisioningCertificateHash AMT_PublicKeyCertificate AMT_PublicKeyManagementCapabilities AMT_PublicKeyManagementService AMT_PublicPrivateKeyPair AMT_RedirectionService AMT_RemoteAccessCapabilities AMT_RemoteAccessCredentialContext AMT_RemoteAccessPolicyAppliesToMPS AMT_RemoteAccessPolicyRule AMT_RemoteAccessService AMT_SetupAndConfigurationService AMT_SNMPEventSubscriber AMT_StateTransitionCondition AMT_SystemDefensePolicy AMT_SystemDefensePolicyInService AMT_SystemDefenseService AMT_SystemPowerScheme AMT_ThirdPartyDataStorageAdministrationService AMT_ThirdPartyDataStorageService AMT_TimeSynchronizationService AMT_TLSCredentialContext AMT_TLSProtocolEndpoint AMT_TLSProtocolEndpointCollection AMT_TLSSettingData AMT_TrapTargetForService AMT_UserInitiatedConnectionService AMT_WebUIService AMT_WiFiPortConfigurationService CIM_AbstractIndicationSubscription CIM_Account CIM_AccountManagementCapabilities CIM_AccountManagementService CIM_AccountOnSystem CIM_AdminDomain CIM_AlertIndication CIM_AssignedIdentity CIM_AssociatedPowerManagementService CIM_AuthenticationService CIM_AuthorizationService CIM_BIOSElement CIM_BIOSFeature CIM_BIOSFeatureBIOSElements CIM_BootConfigSetting CIM_BootService CIM_BootSettingData CIM_BootSourceSetting CIM_Capabilities CIM_Card CIM_Chassis CIM_Chip CIM_Collection CIM_Component CIM_ComputerSystem CIM_ComputerSystemPackage CIM_ConcreteComponent CIM_ConcreteDependency CIM_Controller CIM_CoolingDevice CIM_Credential CIM_CredentialContext CIM_CredentialManagementService CIM_Dependency CIM_DeviceSAPImplementation CIM_ElementCapabilities CIM_ElementConformsToProfile CIM_ElementLocation CIM_ElementSettingData CIM_ElementSoftwareIdentity CIM_ElementStatisticalData CIM_EnabledLogicalElement CIM_EnabledLogicalElementCapabilities CIM_EthernetPort CIM_Fan CIM_FilterCollection CIM_FilterCollectionSubscription CIM_HostedAccessPoint CIM_HostedDependency CIM_HostedService CIM_Identity CIM_IEEE8021xCapabilities CIM_IEEE8021xSettings CIM_Indication CIM_IndicationService CIM_InstalledSoftwareIdentity CIM_KVMRedirectionSAP CIM_LANEndpoint CIM_ListenerDestination CIM_ListenerDestinationWSManagement CIM_Location CIM_Log CIM_LogEntry CIM_LogicalDevice CIM_LogicalElement CIM_LogicalPort CIM_LogicalPortCapabilities CIM_LogManagesRecord CIM_ManagedCredential CIM_ManagedElement CIM_ManagedSystemElement CIM_MediaAccessDevice CIM_MemberOfCollection CIM_Memory CIM_MessageLog CIM_NetworkPort CIM_NetworkPortCapabilities CIM_NetworkPortConfigurationService CIM_OrderedComponent CIM_OwningCollectionElement CIM_OwningJobElement CIM_PCIController CIM_PhysicalComponent CIM_PhysicalElement CIM_PhysicalElementLocation CIM_PhysicalFrame CIM_PhysicalMemory CIM_PhysicalPackage CIM_Policy CIM_PolicyAction CIM_PolicyCondition CIM_PolicyInSystem CIM_PolicyRule CIM_PolicyRuleInSystem CIM_PolicySet CIM_PolicySetAppliesToElement CIM_PolicySetInSystem CIM_PowerManagementCapabilities CIM_PowerManagementService CIM_PowerSupply CIM_Privilege CIM_PrivilegeManagementCapabilities CIM_PrivilegeManagementService CIM_ProcessIndication CIM_Processor CIM_ProtocolEndpoint CIM_ProvidesServiceToElement CIM_Realizes CIM_RecordForLog CIM_RecordLog CIM_RedirectionService CIM_ReferencedProfile CIM_RegisteredProfile CIM_RemoteAccessAvailableToElement CIM_RemoteIdentity CIM_RemotePort CIM_RemoteServiceAccessPoint CIM_Role CIM_RoleBasedAuthorizationService CIM_RoleBasedManagementCapabilities CIM_RoleLimitedToTarget CIM_SAPAvailableForElement CIM_SecurityService CIM_Sensor CIM_Service CIM_ServiceAccessBySAP CIM_ServiceAccessPoint CIM_ServiceAffectsElement CIM_ServiceAvailableToElement CIM_ServiceSAPDependency CIM_ServiceServiceDependency CIM_SettingData CIM_SharedCredential CIM_SoftwareElement CIM_SoftwareFeature CIM_SoftwareFeatureSoftwareElements CIM_SoftwareIdentity CIM_StatisticalData CIM_StorageExtent CIM_System CIM_SystemBIOS CIM_SystemComponent CIM_SystemDevice CIM_SystemPackaging CIM_UseOfLog CIM_Watchdog CIM_WiFiEndpoint CIM_WiFiEndpointCapabilities CIM_WiFiEndpointSettings CIM_WiFiPort CIM_WiFiPortCapabilities IPS_AdminProvisioningRecord IPS_ClientProvisioningRecord IPS_HostBasedSetupService IPS_HostIPSettings IPS_HTTPProxyService IPS_HTTPProxyAccessPoint IPS_IderSessionUsingPort IPS_IPv6PortSettings IPS_KVMRedirectionSettingData IPS_KvmSessionUsingPort IPS_ManualProvisioningRecord IPS_OptInService IPS_ProvisioningAuditRecord IPS_ProvisioningRecordLog IPS_RasSessionUsingPort IPS_ScreenConfigurationService IPS_ScreenSettingData IPS_SecIOService IPS_SessionUsingPort IPS_SolSessionUsingPort IPS_TLSProvisioningRecord IPS_WatchDogAction".split(" "),disconnecturl=
900
null,terminal,currentView=0,LoadingHtml="<div style=text-align:center;padding-top:20px>Loading...<div>",amtversion=0,amtversionmin=0,amtFirstPull=0,amtwirelessif=-1,desktop,desktopsettings={encoding:1,showfocus:!1,showmouse:!0,showcad:!0,limitFrameRate:!1,noMouseRotate:!1},currentMeshNode=null,webcompilerfeatures="AgentPresence Alarms AuditLog Certificates ComputerSelectorToolbar Desktop DesktopInband DesktopInbandFiles Desktop-Multi DesktopRotation Desktop-Settings EventLog EventSubscriptions FileSaver HardwareInfo IDER IDERDebug IDERStats Inflate Look-MeshCentral Mode-MeshCentral2 NetworkSettings PowerControl PowerControl-Advanced RemoteAccess Scripting Scripting-Editor Storage SystemDefense Terminal Terminal-Enumation-All Terminal-FxEnumation-All TerminalSize VersionWarning Wireless WsmanBrowser".split(" "),
@@ -909,7 +910,7 @@ function setUrlVar(b,c){urlvars||(urlvars={});urlvars[b]=c}function cleanup(){c3
910
function handleKeyUp(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(49).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeyUp(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeyUp(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeyUp(b)}}
911
function handleKeyDown(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(49).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeyDown(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeyDown(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeyDown(b)}}
912
function handleKeyPress(b){if(!xxdialogMode){if(14==currentView&&3==desktop.State){if(Q(49).checked)return;if(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop)webRtcDesktop.softdesktop.m.handleKeys(b),desktop.m.sendKeepAlive();else return desktop.m.handleKeys(b)}if(13==currentView&&3==terminal.State)return terminal.m.TermHandleKeys(b)}}var connectFunc=null,connectFuncTag=null;
912
-function connect(b,c,a,d,e,k,l){go(0);fullscreenonly=!1;connectFunc=k;connectFuncTag=l;1==urlvars.kvm&&go(14);if(1==urlvars.kvmfull||1==urlvars.kvmonly)go(14),deskToggleFull(1==urlvars.kvmonly);1==urlvars.sol&&go(13);wsstack=WsmanStackCreateService(b,c,a,d,e);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(b=2;25>b;b++)QV("go"+b,!1);QV("go8",!0);QV("go13",!1);QV("go12",!0);QV("go20",!0);QH(30,"");QH(41,"");amtversion=amtversionmin=amtFirstPull=
913
+function connect(b,c,a,d,e,q,h){go(0);fullscreenonly=!1;connectFunc=q;connectFuncTag=h;1==urlvars.kvm&&go(14);if(1==urlvars.kvmfull||1==urlvars.kvmonly)go(14),deskToggleFull(1==urlvars.kvmonly);1==urlvars.sol&&go(13);wsstack=WsmanStackCreateService(b,c,a,d,e);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(b=2;25>b;b++)QV("go"+b,!1);QV("go8",!0);QV("go13",!1);QV("go12",!0);QV("go20",!0);QH(30,"");QH(41,"");amtversion=amtversionmin=amtFirstPull=
914
0;amtsysstate=amtdeltatime=amtlogicalelements=HardwareInventory=void 0;amtPowerBootCapabilities=null;xxAccountFetch=999;QH(17,LoadingHtml);QH(21,LoadingHtml);amtwirelessif=-1;xxWireless=void 0;QH(22,"");QH(18,LoadingHtml);xxAccountAdminName=null;xxAccountRealmInfo={};QH(23,LoadingHtml);eventmessages=null;QH(19,"");QH(20,LoadingHtml);auditLog=null;QH(50,"");
915
QH(51,LoadingHtml);xxCertificates=null;QH(52,LoadingHtml);QH(26,"");iderStop();xxPolicies=xxMPSUserPass=xxRemoteAccessCredentiaLinks=xxUserInitiatedCira=xxCiraServers=xxEnvironementDetection=xxRemoteAccess=null;QH(53,LoadingHtml);QH(55,LoadingHtml);xxSystemDefense=null;xxSystemDefenceLinkedPolicy={};xxUpdatingDefenseStats=!1;xxFilterStatistics=[{},{}];xxFilterStatisticsTimer=null;xxFilterStatisticsTimerActive=
916
!1;QH(54,LoadingHtml);QE(45,!1);QE("DeskWD",!1);QE("deskkeys",!1);urlvars.kvmviewonly&&(QE(49,!1),Q(49).checked=!0);desktopScreenInfo=null;amtstack.BatchEnum("",["CIM_SoftwareIdentity","*AMT_SetupAndConfigurationService"],processSystemVersion);QV(13,!1);fupdatescript()}
@@ -926,22 +927,22 @@ function processSystemStatus(b,c,a,d){if(void 0==a.IPS_ScreenConfigurationServic
927
200==a.AMT_RedirectionService.status&&QV("go13",!0);d=0;for(var e in a)null!=a[e]&&a[e].status>d&&(d=a[e].status);400!=d&&errcheck(d,b)||(amtsysstate=a,updateSystemStatus())}function syncClock(){xxdialogMode||setDialogMode(11,"Synchronize Clock",3,syncClockEx,"Synchronize Intel AMT clock with this computer?")}
928
function syncClockEx(){amtstack.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch(function(b,c,a,d){200!=d?messagebox("","Failed to set time, status = "+d):0!=a.Body.ReturnValue?messagebox("","Failed to set time, error: "+a.Body.ReturnValueStr):(b=new Date,b=Math.round((b.getTime()-6E4*b.getTimezoneOffset())/1E3),amtstack.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch(a.Body.Ta0,b,b,function(){amtstack.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch(processSystemTime)}))})}
929
var DMTFPowerStates=";;Power on;Light sleep;Deep sleep;Power cycle (Soft off);Off - Hard;Hibernate (Off soft);Soft off;Power cycle (Off-hard);Master bus reset;Diagnostic interrupt (NMI);Not applicable;Off - Soft graceful;Off - Hard graceful;Master bus reset graceful;Power cycle (Off - Soft graceful);Power cycle (Off - Hard graceful);Diagnostic interrupt (INIT)".split(";");
929
-function updateSystemStatus(){if(amtsysstate&&!(99<currentView)){var b=0,c,a,d=TableStart(),e="",k=amtsysstate.AMT_GeneralSettings.response;a="<i>Unknown</i>";null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&(a=DMTFPowerStates[amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState],QH(30,a),0!=desktop.State&&0<Q(41).innerHTML.length&&Q(41).innerHTML!=
930
-a&&(desktop.Stop(),setTimeout(connectDesktop,50)),QH(41,a));k.PowerSource&&(a+=[", Plugged-in",", On Battery"][k.PowerSource]);d+=TableEntry("Power",addLink(a,"showPowerActionDlg()"));c=k.HostName;a=k.DomainName;null!=a&&0<a.length&&(c+="."+a);c=0==c.length?"<i>None</i>":EscapeHtml(c);d+=TableEntry("Name & Domain",addLinkConditional(c,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));
931
-if(amtlogicalelements){var l="",u=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==u.ProvisioningState&&5<amtversion&&(l=" activated in Admin Control Mode (ACM)",4==u.ProvisioningMode&&(l=" activated in Client Control Mode (CCM)",b=9));d+=TableEntry("Intel® ME","v"+getItem(amtlogicalelements,"InstanceID","AMT").VersionString+l)}null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&
932
-(QV(29,2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState),QV(40,2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState));if(200==amtsysstate.AMT_RedirectionService.status){var n=amtfeatures[0]=1==amtsysstate.AMT_RedirectionService.response.ListenerEnabled,p=amtfeatures[1]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&2),l=amtfeatures[2]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&1),x=amtfeatures[3]=void 0;
933
-5<amtversion&&null!=amtsysstate.CIM_KVMRedirectionSAP&&(QV("go14",!0),x=amtfeatures[3]=6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState&&2==amtsysstate.CIM_KVMRedirectionSAP.response.RequestedState||2==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState||6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState);n&&(e+=", Redirection Port");p&&(e+=", Serial-over-LAN");l&&(e+=", IDE-Redirect");x&&(e+=", KVM");""==e&&(e=" None");d+=TableEntry("Active Features",addLinkConditional(e.substring(2),
934
-"showFeaturesDlg()",xxAccountAdminName))}null!=amtsysstate.IPS_KVMRedirectionSettingData&&amtsysstate.IPS_KVMRedirectionSettingData.response&&(l=amtsysstate.IPS_KVMRedirectionSettingData.response,e="Primary display",7<amtversion&&void 0!==l.DefaultScreen&&255>l.DefaultScreen&&(e=["Primary display","Secondary display","3rd display"][l.DefaultScreen]),e='<span title="The default remote display is the '+e.toLowerCase()+'">'+e+"</span>",1==l.Is5900PortEnabled&&(e+=", Port 5900 enabled"),1==l.OptInPolicy&&
935
-(e+=", "+l.OptInPolicyTimeout+" second"+(0<l.OptInPolicyTimeout?"s":"")+" opt-in"),e+=", "+l.SessionTimeout+" minute"+(0<l.SessionTimeout?"s":"")+" session timeout",9<amtversion&&null!=amtsysstate.IPS_ScreenConfigurationService?((l=0!=(amtsysstate.IPS_ScreenConfigurationService.response.EnabledState&1))&&(e+=", Blanking Allowed"),QV(46,l),Q(47).checked=!1):QV(46,!1),d+=TableEntry("Remote Desktop",addLinkConditional(e,"showDesktopSettingsDlg()",xxAccountAdminName)));
936
-QV(27,!n||!p);QV(28,xxAccountAdminName);QV(38,!n||!x);QV(39,xxAccountAdminName);5<amtversion&&null!=amtsysstate.IPS_OptInService&&void 0!=amtsysstate.IPS_OptInService.response&&(e="Unknown state",n=amtsysstate.IPS_OptInService.response.OptInRequired,0==n&&(e="Not Required"),1==n&&(e="Required for KVM only"),4294967295==n&&(e="Always Required"),1==amtsysstate.IPS_OptInService.response.CanModifyOptInPolicy&&(e=addLinkConditional(e,"showConsentDlg()",
937
-xxAccountAdminName)),d+=TableEntry("User Consent",e));if(null!=AmtSystemPowerSchemes)for(e=amtsysstate.CIM_ElementSettingData.responses,n=0;n<e.length;n++)if(e[n].SettingData&&1==e[n].IsCurrent&&"http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SystemPowerScheme"==e[n].SettingData.ReferenceParameters.ResourceURI)for(p=e[n].SettingData.ReferenceParameters.SelectorSet.Selector[1].Value,x=0;x<AmtSystemPowerSchemes.length;x++)AmtSystemPowerSchemes[x].SchemeGUID==p&&(d+=TableEntry("Power Policy",addLinkConditional(AmtSystemPowerSchemes[x].Description.split(":")[1],
938
-'showPowerPolicyDlg("'+p+'")',xxAccountAdminName)));amtdeltatime&&(d+=TableEntry("Date & Time",addLinkConditional((new Date((new Date).getTime()+amtdeltatime)).toLocaleString(),"syncClock()",xxAccountAdminName)));e=AddRefreshButton("PullSystemStatus()")+" ";e+=AddButton("Power Actions...","showPowerActionDlg()")+" ";e+=AddButton("Save State...","saveEntireAmtState()")+" ";e+=AddButton("Run Script...","script_runScriptDlg()")+" ";d+=TableEnd(e);QH(17,d);d="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>"+
939
-TableEnd("<div> "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"<br><h2>General Settings</h2>"+TableStart();e="";"<i>None</i>"!=c&&(1==k.SharedFQDN&&(e=", shared with OS"),0==k.SharedFQDN&&(e=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(c+e,"showEditNameDlg(1)",xxAccountAdminName));c="Disabled";1==k.DDNSUpdateEnabled?c="Enabled each "+k.DDNSPeriodicUpdateInterval+" minutes, TTL is "+k.DDNSTTL+
940
-" minutes":1==k.DDNSUpdateByDHCPServerEnabled&&(c="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(c,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(a in amtsysstate.AMT_EthernetPortSettings.responses){c=amtsysstate.AMT_EthernetPortSettings.responses[a];if(c.WLANLinkProtectionLevel||1==a)amtwirelessif=a;if(0!=a||amtwirelessif==a||"00-00-00-00-00-00"!=c.MACAddress){0==a&&b++;d+="<br><h2>"+(amtwirelessif==a?"Wireless":"Wired")+" Interface</h2>";d+=TableStart();d+=TableEntry("Link state",
930
+function updateSystemStatus(){if(amtsysstate&&!(99<currentView)){var b=0,c,a,d=TableStart(),e="",q=amtsysstate.AMT_GeneralSettings.response;a="<i>Unknown</i>";null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&(a=DMTFPowerStates[amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState],QH(30,a),0!=desktop.State&&0<Q(41).innerHTML.length&&Q(41).innerHTML!=
931
+a&&(desktop.Stop(),setTimeout(connectDesktop,50)),QH(41,a));q.PowerSource&&(a+=[", Plugged-in",", On Battery"][q.PowerSource]);d+=TableEntry("Power",addLink(a,"showPowerActionDlg()"));c=q.HostName;a=q.DomainName;null!=a&&0<a.length&&(c+="."+a);c=0==c.length?"<i>None</i>":EscapeHtml(c);d+=TableEntry("Name & Domain",addLinkConditional(c,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));
932
+if(amtlogicalelements){var h="",r=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==r.ProvisioningState&&5<amtversion&&(h=" activated in Admin Control Mode (ACM)",4==r.ProvisioningMode&&(h=" activated in Client Control Mode (CCM)",b=9));d+=TableEntry("Intel® ME","v"+getItem(amtlogicalelements,"InstanceID","AMT").VersionString+h)}null!=amtsysstate.CIM_ServiceAvailableToElement&&null!=amtsysstate.CIM_ServiceAvailableToElement.responses&&0<amtsysstate.CIM_ServiceAvailableToElement.responses.length&&
933
+(QV(29,2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState),QV(40,2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState));if(200==amtsysstate.AMT_RedirectionService.status){var n=amtfeatures[0]=1==amtsysstate.AMT_RedirectionService.response.ListenerEnabled,m=amtfeatures[1]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&2),h=amtfeatures[2]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&1),w=amtfeatures[3]=void 0;
934
+5<amtversion&&null!=amtsysstate.CIM_KVMRedirectionSAP&&(QV("go14",!0),w=amtfeatures[3]=6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState&&2==amtsysstate.CIM_KVMRedirectionSAP.response.RequestedState||2==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState||6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState);n&&(e+=", Redirection Port");m&&(e+=", Serial-over-LAN");h&&(e+=", IDE-Redirect");w&&(e+=", KVM");""==e&&(e=" None");d+=TableEntry("Active Features",addLinkConditional(e.substring(2),
935
+"showFeaturesDlg()",xxAccountAdminName))}null!=amtsysstate.IPS_KVMRedirectionSettingData&&amtsysstate.IPS_KVMRedirectionSettingData.response&&(h=amtsysstate.IPS_KVMRedirectionSettingData.response,e="Primary display",7<amtversion&&void 0!==h.DefaultScreen&&255>h.DefaultScreen&&(e=["Primary display","Secondary display","3rd display"][h.DefaultScreen]),e='<span title="The default remote display is the '+e.toLowerCase()+'">'+e+"</span>",1==h.Is5900PortEnabled&&(e+=", Port 5900 enabled"),1==h.OptInPolicy&&
936
+(e+=", "+h.OptInPolicyTimeout+" second"+(0<h.OptInPolicyTimeout?"s":"")+" opt-in"),e+=", "+h.SessionTimeout+" minute"+(0<h.SessionTimeout?"s":"")+" session timeout",9<amtversion&&null!=amtsysstate.IPS_ScreenConfigurationService?((h=0!=(amtsysstate.IPS_ScreenConfigurationService.response.EnabledState&1))&&(e+=", Blanking Allowed"),QV(46,h),Q(47).checked=!1):QV(46,!1),d+=TableEntry("Remote Desktop",addLinkConditional(e,"showDesktopSettingsDlg()",xxAccountAdminName)));
937
+QV(27,!n||!m);QV(28,xxAccountAdminName);QV(38,!n||!w);QV(39,xxAccountAdminName);5<amtversion&&null!=amtsysstate.IPS_OptInService&&void 0!=amtsysstate.IPS_OptInService.response&&(e="Unknown state",n=amtsysstate.IPS_OptInService.response.OptInRequired,0==n&&(e="Not Required"),1==n&&(e="Required for KVM only"),4294967295==n&&(e="Always Required"),1==amtsysstate.IPS_OptInService.response.CanModifyOptInPolicy&&(e=addLinkConditional(e,"showConsentDlg()",
938
+xxAccountAdminName)),d+=TableEntry("User Consent",e));if(null!=AmtSystemPowerSchemes)for(e=amtsysstate.CIM_ElementSettingData.responses,n=0;n<e.length;n++)if(e[n].SettingData&&1==e[n].IsCurrent&&"http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SystemPowerScheme"==e[n].SettingData.ReferenceParameters.ResourceURI)for(m=e[n].SettingData.ReferenceParameters.SelectorSet.Selector[1].Value,w=0;w<AmtSystemPowerSchemes.length;w++)AmtSystemPowerSchemes[w].SchemeGUID==m&&(d+=TableEntry("Power Policy",addLinkConditional(AmtSystemPowerSchemes[w].Description.split(":")[1],
939
+'showPowerPolicyDlg("'+m+'")',xxAccountAdminName)));amtdeltatime&&(d+=TableEntry("Date & Time",addLinkConditional((new Date((new Date).getTime()+amtdeltatime)).toLocaleString(),"syncClock()",xxAccountAdminName)));e=AddRefreshButton("PullSystemStatus()")+" ";e+=AddButton("Power Actions...","showPowerActionDlg()")+" ";e+=AddButton("Save State...","saveEntireAmtState()")+" ";e+=AddButton("Run Script...","script_runScriptDlg()")+" ";d+=TableEnd(e);QH(17,d);d="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>"+
940
+TableEnd("<div> "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"<br><h2>General Settings</h2>"+TableStart();e="";"<i>None</i>"!=c&&(1==q.SharedFQDN&&(e=", shared with OS"),0==q.SharedFQDN&&(e=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(c+e,"showEditNameDlg(1)",xxAccountAdminName));c="Disabled";1==q.DDNSUpdateEnabled?c="Enabled each "+q.DDNSPeriodicUpdateInterval+" minutes, TTL is "+q.DDNSTTL+
941
+" minutes":1==q.DDNSUpdateByDHCPServerEnabled&&(c="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(c,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(a in amtsysstate.AMT_EthernetPortSettings.responses){c=amtsysstate.AMT_EthernetPortSettings.responses[a];if(c.WLANLinkProtectionLevel||1==a)amtwirelessif=a;if(0!=a||amtwirelessif==a||"00-00-00-00-00-00"!=c.MACAddress){0==a&&b++;d+="<br><h2>"+(amtwirelessif==a?"Wireless":"Wired")+" Interface</h2>";d+=TableStart();d+=TableEntry("Link state",
942
1==c.LinkIsUp?"Link is up":"Link is down");"00-00-00-00-00-00"!=c.MACAddress&&(d+=TableEntry("MAC address",c.MACAddress));amtwirelessif==a&&xxWireless&&xxWireless.CIM_WiFiPortCapabilities.response&&(d+=TableEntry("State",addLinkConditional(xxWifiState[xxWireless.CIM_WiFiPort.response.EnabledState],"showWifiStateDlg()",xxAccountAdminName)),s=xxWireless.CIM_WiFiEndpoint.response.LANID,d+=TableEntry("Radio State",xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"<i>None</i>")));
942
-amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][k.PingResponseEnabled+(k.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),d+=TableEntry("IPv4 state",addLinkConditional(1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address","showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",
943
-c.DefaultGateway+" / "+isIpAddress(c.SubnetMask,"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5<amtversion){c=amtsysstate.IPS_IPv6PortSettings.responses[a];for(var p="Disabled",m,e=amtsysstate.CIM_ElementSettingData.responses,n=0;n<e.length;n++)e[n].SettingData&&e[n].SettingData.ReferenceParameters.SelectorSet.Selector.Value=="Intel(r) IPS IPv6 Settings "+a&&(m=1==e[n].IsCurrent);
944
-1==m&&(e=isIpAddress(c.IPv6Address)||isIpAddress(c.DefaultRouter)||isIpAddress(c.PrimaryDNS)||isIpAddress(c.SecondaryDNS),p="Enabled, Automatic "+(e?"& manual":"")+" addresses");d+=TableEntry("IPv6 state",addLinkConditional(p,"showIPv6StateDlg("+a+","+m+")",xxAccountAdminName));if(1==m){if(c.CurrentAddressInfo&&0<c.CurrentAddressInfo.length){c.CurrentAddressInfo=MakeToArray(c.CurrentAddressInfo);ipv6addr="";for(n=0;n<c.CurrentAddressInfo.length;n++)0<ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=c.CurrentAddressInfo[n].split(",")[0];
943
+amtwirelessif!=a&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][q.PingResponseEnabled+(q.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),d+=TableEntry("IPv4 state",addLinkConditional(1==c.DHCPEnabled?"Automatic using DHCP server":"Static IP address","showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",isIpAddress(c.IPAddress,"None"));isIpAddress(c.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",
944
+c.DefaultGateway+" / "+isIpAddress(c.SubnetMask,"None")));e=c.PrimaryDNS;isIpAddress(e)&&(c.SecondaryDNS&&(e+=" / "+c.SecondaryDNS),d+=TableEntry("IPv4 domain name server",e));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5<amtversion){c=amtsysstate.IPS_IPv6PortSettings.responses[a];for(var m="Disabled",k,e=amtsysstate.CIM_ElementSettingData.responses,n=0;n<e.length;n++)e[n].SettingData&&e[n].SettingData.ReferenceParameters.SelectorSet.Selector.Value=="Intel(r) IPS IPv6 Settings "+a&&(k=1==e[n].IsCurrent);
945
+1==k&&(e=isIpAddress(c.IPv6Address)||isIpAddress(c.DefaultRouter)||isIpAddress(c.PrimaryDNS)||isIpAddress(c.SecondaryDNS),m="Enabled, Automatic "+(e?"& manual":"")+" addresses");d+=TableEntry("IPv6 state",addLinkConditional(m,"showIPv6StateDlg("+a+","+k+")",xxAccountAdminName));if(1==k){if(c.CurrentAddressInfo&&0<c.CurrentAddressInfo.length){c.CurrentAddressInfo=MakeToArray(c.CurrentAddressInfo);ipv6addr="";for(n=0;n<c.CurrentAddressInfo.length;n++)0<ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=c.CurrentAddressInfo[n].split(",")[0];
946
d+=TableEntry("IPv6 address",addLink(ipv6addr,"showIPv6AddrDlg("+a+',"'+c.CurrentAddressInfo+'")'))}else d+=TableEntry("IPv6 address","None");isIpAddress(c.CurrentDefaultRouter)&&(d+=TableEntry("IPv6 default router",c.CurrentDefaultRouter));isIpAddress(c.CurrentPrimaryDNS)&&(e=c.CurrentPrimaryDNS,isIpAddress(c.CurrentSecondaryDNS)&&(e+=" / "+c.CurrentSecondaryDNS),d+=TableEntry("IPv6 domain name server",e))}}d+=TableEnd()}}1!=urlvars.kvmonly&&0==fullscreenonly&&(-1!=amtwirelessif&&0==(amtFirstPull&
947
2)&&PullWireless(),QH(21,d),1==b&&0==(amtFirstPull&4)&&PullSystemDefense(),0==(amtFirstPull&8)&&(11<amtversion||11==amtversion&&5<amtversionmin)&&PullStorage());0==currentView&&go(1,1)}}function isIpAddress(b,c){return b&&null!=b&&0<b.length&&"::"!=b&&"::0"!=b?b:c}var IntelAmtEntireState,IntelAmtEntireStateCalls;
948
function saveEntireAmtState(){if(!xxdialogMode){var b="",c=new Date;amtsysstate&&(b="-"+amtsysstate.AMT_GeneralSettings.response.HostName);b+="-"+c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2)+"-"+("0"+c.getHours()).slice(-2)+"-"+("0"+c.getMinutes()).slice(-2);c29.value="amtstate"+b+".json";setDialogMode(19,"Save Entire Intel® AMT State",3,saveEntireAmtStateOk)}}
@@ -958,8 +959,8 @@ function showDesktopSettingsDlgOk3(b,c,a,d){200!=d?messagebox("Error","Screen Bl
959
var processMessageLog0responses=null;
960
function processMessageLog0(b,c,a,d){200==d&&(d&&QV("go6",!0),a&&(processMessageLog0responses=a),b="",c="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>",null!=processMessageLog0responses&&(b=1==processMessageLog0responses[0].IsFrozen?AddButton("Un-freeze Log","FreezeLog(0)"):AddButton("Freeze Log","FreezeLog(1)")),c+=TableEnd("<div style=float:right><input id=eventFilter placeholder=Filter style=margin:4px onkeyup=eventFilter()> </div><div> "+AddRefreshButton("PullEventLog(1)")+
961
AddButton("Clear Log","ClearLog()")+AddButton("Save...","SaveEventLog()")+b),QH(19,c+"<br>"))}function SaveEventLog(){xxdialogMode||null==eventmessages||SaveJsonFile("IntelAmtEventlog","events","Intel AMT Event Log",eventmessages)}var eventmessages=null;
961
-function processMessageLog1(b,c){eventmessages=c;var a,d=0,e;e="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=80px><p><td><td><td><tr><td class=r1 style=width:90px><b> Event</b><td class=r1 style=width:110px><b>Time</b><td class=r1 style=width:160px><b>Source</b><td class=r1><b>Description</b>";for(a in c){d++;var k=1,l=c[a];8<=l.EventSeverity&&(k=2);16<=l.EventSeverity&&(k=3);e+="<tr id=xamtevent"+a+" class=r3 onclick=showEventDetails("+
962
-a+")><td class=r1><p><div class=icon"+k+" style=display:block;float:left;margin-left:5px;margin-right:5px></div>"+(parseInt(a)+1)+"<td class=r1 title='"+l.Time.toLocaleString()+"'>"+l.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br>"+l.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+l.EntityStr.replace("(r)","®")+"<td class=r1>"+l.Desc}e+=TableEnd(0==d?" ":"");QH(20,e+"<br>");processMessageLog0()}
962
+function processMessageLog1(b,c){eventmessages=c;var a,d=0,e;e="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=80px><p><td><td><td><tr><td class=r1 style=width:90px><b> Event</b><td class=r1 style=width:110px><b>Time</b><td class=r1 style=width:160px><b>Source</b><td class=r1><b>Description</b>";for(a in c){d++;var q=1,h=c[a];8<=h.EventSeverity&&(q=2);16<=h.EventSeverity&&(q=3);e+="<tr id=xamtevent"+a+" class=r3 onclick=showEventDetails("+
963
+a+")><td class=r1><p><div class=icon"+q+" style=display:block;float:left;margin-left:5px;margin-right:5px></div>"+(parseInt(a)+1)+"<td class=r1 title='"+h.Time.toLocaleString()+"'>"+h.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br>"+h.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+h.EntityStr.replace("(r)","®")+"<td class=r1>"+h.Desc}e+=TableEnd(0==d?" ":"");QH(20,e+"<br>");processMessageLog0()}
964
function FreezeLog(b){xxdialogMode||amtstack.AMT_MessageLog_FreezeLog(b,function(){amtstack.Enum("AMT_MessageLog",processMessageLog0)})}function ClearLog(b){xxdialogMode||(QH(61,"Clear event log?"),setDialogMode(1,"Event Log",3,ClearLogEx))}function ClearLogEx(){amtstack.AMT_MessageLog_ClearLog(function(b,c,a,d){200!=d?messagebox("Event Log","Unable to clear, Error: "+d):PullEventLog()})}
965
function showEventDetails(b){if(!xxdialogMode){var c=eventmessages[b],a;a="<div style=text-align:left>"+addHtmlValue("Time",c.Time.toLocaleString());a+=addHtmlValue("Source",c.EntityStr.replace("(r)","®"));a+=addHtmlValue("Description",c.Desc);a+=MoreStart();a+=addHtmlValue("Device Address",c.DeviceAddress);a+=addHtmlValue("Entity",c.Entity);a+=addHtmlValue("Entity Instance",c.EntityInstance);var d="",e;for(e in c.EventData)0<d.length&&(d+=","),d+=c.EventData[e];a+=addHtmlValue("Data",d);a+=addHtmlValue("Offset",
966
c.EventOffset);a+=addHtmlValue("Sensor Type",c.EventSensorType);a+=addHtmlValue("Severity",c.EventSeverity);a+=addHtmlValue("Source Type",c.EventSourceType);a+=addHtmlValue("Type",c.EventType);a+=addHtmlValue("Sensor Number",c.SensorNumber);a+=MoreEnd();messagebox("Event #"+(b+1)+" Details",a+"</div>")}}
@@ -980,8 +981,8 @@ function newSubscriptionButtonOk(){var b=0==Q("subuser").value.length?void 0:Q("
981
function PullAuditLog(b){1==b&&xxdialogMode||(amtFirstPull|=32,amtstack.Enum("AMT_AuditLog",processAuditLog0))}var auditLog=null,auditLogEnabledStates="Unknown;Other;Enabled;Disabled;Shutting Down;Not Applicable;Enabled but Offline;In Test;Deferred;Quiesce;Starting".split(";");
982
function processAuditLog0(b,c,a,d){200==d&&(QV("go15",!0),c=a[0].AuditState,b=c&1?"Disabled":"Enabled",c&2&&(b+=", Locked"),c&4&&(b+=", Almost Full"),c&8&&(b+=", Full"),c&16&&(b+=", NoKey"),c="<h1>Audit Log Settings</h1>"+TableStart(),c+=TableEntry("State",b),c+=TableEntry("Storage",a[0].CurrentNumberOfRecords+" record(s), "+a[0].PercentageFree+"% free"),c+=TableEntry("Overwrite policy",2==a[0].OverwritePolicy?"Wraps when full":"Never overwrites"),c+=TableEnd(),QH(50,c),amtstack.GetAuditLog(processAuditLog1))}
983
function processAuditLog1(b,c){auditLog=c;var a,d;d="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>"+(TableEnd("<div style=float:right><input id=auditFilter placeholder=Filter style=margin:4px onkeyup=auditFilter()> </div><div> "+AddRefreshButton("PullAuditLog(1)")+AddButton("Save...","SaveAuditLog()")+AddButton("Clear Log","ClearAuditLog()"))+"<br>");if(0==c.length)d="No audit log events found.";else{var e=0;d+="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=80px><p><td><td><td><tr><td class=r1 style=width:110px> <b>Time</b><td class=r1 style=width:260px><b>Initiator</b><td class=r1><b>Action</b>";
983
-for(a in c){var k=c[a],l=k.AuditApp,u=k.Initiator;e++;var n="";0<k.NetAddress.length&&(n=k.NetAddress.replace("0000:0000:0000:0000:0000:0000:0000:0001","::1"));k.Event&&(l+=", "+k.Event);null!=k.ExStr&&(l+=", "+k.ExStr);""!=u&&""!=n&&(u+=", ");d+="<tr id=xamtaudit"+a+" class=r3 onclick=showAuditDetails("+a+")><td class=r1 title='"+k.Time.toLocaleString()+"'> "+k.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br> "+k.Time.toLocaleTimeString("en",
984
-{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+u+n+"<td class=r1>"+l}d+=TableEnd(0==e?" ":"")+"<br>"}QH(51,d)}function auditFilter(){var b=Q("auditFilter").value.toLowerCase(),c;for(c in auditLog)QV("xamtaudit"+c,""==b||0<=JSON.stringify(auditLog[c]).toLowerCase().indexOf(b))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)}
984
+for(a in c){var q=c[a],h=q.AuditApp,r=q.Initiator;e++;var n="";0<q.NetAddress.length&&(n=q.NetAddress.replace("0000:0000:0000:0000:0000:0000:0000:0001","::1"));q.Event&&(h+=", "+q.Event);null!=q.ExStr&&(h+=", "+q.ExStr);""!=r&&""!=n&&(r+=", ");d+="<tr id=xamtaudit"+a+" class=r3 onclick=showAuditDetails("+a+")><td class=r1 title='"+q.Time.toLocaleString()+"'> "+q.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br> "+q.Time.toLocaleTimeString("en",
985
+{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+r+n+"<td class=r1>"+h}d+=TableEnd(0==e?" ":"")+"<br>"}QH(51,d)}function auditFilter(){var b=Q("auditFilter").value.toLowerCase(),c;for(c in auditLog)QV("xamtaudit"+c,""==b||0<=JSON.stringify(auditLog[c]).toLowerCase().indexOf(b))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)}
986
function ClearAuditLog(b){QH(61,"Clear audit log?");setDialogMode(1,"Audit Log",3,ClearAuditLogEx)}function ClearAuditLogEx(){var b=amtstack.AMT_AuditLog_SetAuditLock(1,0,b,function(){amtstack.AMT_AuditLog_ClearLog(function(){amtstack.AMT_AuditLog_SetAuditLock(0,2,b,function(){setTimeout(PullAuditLog,1E3)})})})}function ShowAuditLogSettings(){xxdialogMode||amtstack.AMT_AuditLog_RequestStateChange(2,0,AuditLogSettingsCompleted)}
987
function AuditLogSettingsCompleted(b,c,a,d){200==d?PullAuditLog():messagebox("Audit Log","Error: "+d)}
988
function showAuditDetails(b){if(!xxdialogMode){var c,a=auditLog[b],d;d="<div style=text-align:left>"+addHtmlValue("Time",a.Time.toLocaleString());""!=a.Initiator&&(d+=addHtmlValue("Initiator",a.Initiator));""!=a.NetAddress&&(d+=addHtmlValue("Address",a.NetAddress));d+=addHtmlValue("Application",a.AuditApp);d+=addHtmlValue("Event",a.Event);if(null!=a.ExStr)d+=addHtmlValue("Extended Data",a.ExStr);else if(0<a.Ex.length){var e="";for(c in a.Ex)0<e.length&&(e+=","),e+=a.Ex.charCodeAt(c);""!=e&&(d+=addHtmlValue("Data Values",
@@ -1008,8 +1009,8 @@ function issueCertButtonUpdate(){var b=getInputElement("certopen");QE("certopenp
1009
function issueCertButtonOk(){var b=getInputElement("certopen"),c=xxDragDropCertFiles;b&&(c=b.files);c&&1==c.length?(b=new FileReader,b.onload=issueCertButtonOk2,b.readAsBinaryString(c[0])):issueCertButtonOk3(null)}function issueCertButtonOk2(b){0==amtcert_loadP12File(b.target.result,Q("certopenpass").value,issueCertButtonOk3)&&messagebox("Issue Certificate","Unable to decrypt/decode certificate.")}
1010
function issueCertButtonOk3(b,c,a){xxCaPrivateKey=b;xxCaSubjectAttributes=c;amtstack.AMT_PublicKeyManagementService_GenerateKeyPair(0,2048,GenerateKeyPairResponse)}
1011
function GenerateKeyPairResponse(b,c,a,d){200!=d?messagebox("Issue Certificate","Failed to generate key pair. Status: "+d):0!=a.Body.ReturnValue?messagebox("Issue Certificate","Failed to generate key pair, "+a.Body.ReturnValueStr):amtstack.Enum("AMT_PublicPrivateKeyPair",GenerateKeyPairResponse2,a.Body.KeyPair.ReferenceParameters.SelectorSet.Selector.Value)}
1011
-function GenerateKeyPairResponse2(b,c,a,d,e){if(200!=d)messagebox("Issue Certificate","Failed to generate key pair. Status: "+d);else{b=null;for(var k in a)a[k].InstanceID==e&&(b=a[k].DERKey);a={CN:getInputElement("certcn").value,O:getInputElement("certo").value,ST:getInputElement("certst").value,C:getInputElement("certc").value};e={CN:"Untrusted Root Certificate"};if(null!=xxCaPrivateKey&&xxCaSubjectAttributes)for(k in e={},xxCaSubjectAttributes)e[xxCaSubjectAttributes[k].shortName]=xxCaSubjectAttributes[k].value;
1012
-k={name:"extKeyUsage"};Q("d11_cu4").checked&&(k.serverAuth=!0);Q("d11_cu5").checked&&(k.clientAuth=!0);Q("d11_cu6").checked&&(k.emailProtection=!0);Q("d11_cu7").checked&&(k.codeSigning=!0);Q("d11_cu8").checked&&(k.timeStamping=!0);k=amtcert_signWithCaKey(b,xxCaPrivateKey,a,e,k);null==k?messagebox("Issue Certificate","Unable to sign certificate."):(k=forge.pki.certificateToPem(k).replace(/(\r\n|\n|\r)/gm,""),amtstack.AMT_PublicKeyManagementService_AddCertificate(k.substring(27,k.length-25),GenerateKeyPairResponse4))}}
1012
+function GenerateKeyPairResponse2(b,c,a,d,e){if(200!=d)messagebox("Issue Certificate","Failed to generate key pair. Status: "+d);else{b=null;for(var q in a)a[q].InstanceID==e&&(b=a[q].DERKey);a={CN:getInputElement("certcn").value,O:getInputElement("certo").value,ST:getInputElement("certst").value,C:getInputElement("certc").value};e={CN:"Untrusted Root Certificate"};if(null!=xxCaPrivateKey&&xxCaSubjectAttributes)for(q in e={},xxCaSubjectAttributes)e[xxCaSubjectAttributes[q].shortName]=xxCaSubjectAttributes[q].value;
1013
+q={name:"extKeyUsage"};Q("d11_cu4").checked&&(q.serverAuth=!0);Q("d11_cu5").checked&&(q.clientAuth=!0);Q("d11_cu6").checked&&(q.emailProtection=!0);Q("d11_cu7").checked&&(q.codeSigning=!0);Q("d11_cu8").checked&&(q.timeStamping=!0);q=amtcert_signWithCaKey(b,xxCaPrivateKey,a,e,q);null==q?messagebox("Issue Certificate","Unable to sign certificate."):(q=forge.pki.certificateToPem(q).replace(/(\r\n|\n|\r)/gm,""),amtstack.AMT_PublicKeyManagementService_AddCertificate(q.substring(27,q.length-25),GenerateKeyPairResponse4))}}
1014
function GenerateKeyPairResponse4(b,c,a,d){200!=d?messagebox("Issue Certificate","Failed to generate key pair. Status: "+d):PullCertificates()}function certificateAdded(b,c,a,d){200!=d||0!=a.Body.ReturnValue?messagebox("Add Certificate","Unable to add certificate, error "+(200!=d?d:a.Body.ReturnValueStr)):PullCertificates()}function certificateRemoved(b,c,a,d){200!=d?messagebox("Remove Certificate","Unable to remove certificate, error "+d):PullCertificates()}
1015
function getInputElement(b){var c=document.getElementsByTagName("input");for(t=0;t<c.length;t++)if(c[t].id==b)return c[t]}function getSelectElement(b){var c=document.getElementsByTagName("select");for(t=0;t<c.length;t++)if(c[t].id==b)return c[t]}
1016
function showSetTlsSecurityDlg(b){if(!xxdialogMode){b="<div style=height:26px;margin-top:4px><select onchange=showSetTlsSecurityDlgUpdate() id=tlscert style=float:right;width:260px><option value=-1>No Certificate, TLS Disabled</option>";for(var c in xxCertificates)0!=xxCertificates[c].TrustedRootCertficate||!xxCertificates[c].XPrivateKey||null!=xxTlsCurrentCert&&xxTlsCurrentCert!=c||(b+="<option value="+c+">"+xxCertificates[c].XSubject.CN+"</option>");b+="</select><div style=padding-top:4px>Certificate</div></div><div style=height:26px;margin-top:4px><select id=tlsremote style=float:right;width:260px onchange=showSetTlsSecurityDlgUpdate()><option value=0>Server-auth TLS only</option><option value=1>Server-auth, non-TLS allowed</option>";
@@ -1030,7 +1031,7 @@ function PullWatchdogResponse(b,c,a,d){if(200==d&&200==a.AMT_AgentPresenceCapabi
1031
"PolicyConditionName",a),b=getItem(xxWatchdog.AMT_AgentPresenceWatchdogAction.responses,"PolicyActionName",b),a.actions||(a.actions=[]),a.actions.push(b));updateWatchdog();QV("go19",!0)}}var watchdogEnabledStates="Unknown;Other;Enabled;Disabled;Shutting Down;Not Applicable;Enabled but Offline;In Test;Deferred;Quiesce;Starting".split(";"),watchdogMonitoredEntity="Unknown;Other;Operating System;Operating System Boot Process;Operating System Shutdown Process;Firmware Boot Process;BIOS Boot Process;Application;Service Processor".split(";");
1032
function updateWatchdog(){if(null!=xxWatchdog){var b;b=""+TableStart();b+=TableEntry("Maximum Watchdogs",xxWatchdog.AMT_AgentPresenceCapabilities.response.MaxTotalAgents+" watchdogs");b+=TableEntry("Maximum Total Actions",xxWatchdog.AMT_AgentPresenceCapabilities.response.MaxTotalActions+" actions");b+=TableEnd()+"<br>";b+=TableStart2();b+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT agent presence watchdogs.<br><br>";if(null==xxWatchdog.AMT_AgentPresenceWatchdog.responses||
1033
0==xxWatchdog.AMT_AgentPresenceWatchdog.responses.length)b+="<div style=padding-left:15px><i>No agent presence watchdog found.</i></div><br>";else for(var c in xxWatchdog.AMT_AgentPresenceWatchdog.responses){var a=xxWatchdog.AMT_AgentPresenceWatchdog.responses[c],d=guidToStr(rstr2hex(atob(a.DeviceID)));a.MonitoredEntityDescription&&""!=a.MonitoredEntityDescription&&(d=EscapeHtml(a.MonitoredEntityDescription));b+="<div class=itemBar onclick=showWatchdogDetails("+c+")><input type=button style=float:right value='Add Action...' onclick=addWatchdogAction(event,"+
1033
-c+")>";a.transitions&&(b+="<input type=button style=float:right value='Delete Actions...' onclick=deleteWatchdogActions(event,"+c+")>");b+="<div style=padding-top:3px><b>"+d+"</b>, "+amtstack.WatchdogCurrentStates[a.CurrentState]+"</div>";var d="",e;for(e in a.transitions){var k=a.transitions[e];""!=d&&(d+="<br>");d+=getWatchdogTransitionStr(k.OldState)+" → "+getWatchdogTransitionStr(k.NewState);k.actions&&1==k.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(b+="<div style=padding:12px>"+
1034
+c+")>";a.transitions&&(b+="<input type=button style=float:right value='Delete Actions...' onclick=deleteWatchdogActions(event,"+c+")>");b+="<div style=padding-top:3px><b>"+d+"</b>, "+amtstack.WatchdogCurrentStates[a.CurrentState]+"</div>";var d="",e;for(e in a.transitions){var q=a.transitions[e];""!=d&&(d+="<br>");d+=getWatchdogTransitionStr(q.OldState)+" → "+getWatchdogTransitionStr(q.NewState);q.actions&&1==q.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(b+="<div style=padding:12px>"+
1035
d+"</div>");b+="</div>"}b=b+"<br>"+TableEnd(AddRefreshButton("PullWatchdog()")+AddButton("Add Watchdog...","AddWatchdog()"));b+="<br>";QH(55,b)}}function getWatchdogTransitionStr(b){if(31==b)return"Any State";var c="",a;for(a in amtstack.WatchdogCurrentStates)0!=(b&a)&&(c+=", "+amtstack.WatchdogCurrentStates[a]);return c.substring(2)}
1036
function showWatchdogDetails(b){b=xxWatchdog.AMT_AgentPresenceWatchdog.responses[b];var c="";b.MonitoredEntityDescription&&""!=b.MonitoredEntityDescription&&(c+=addHtmlValue("Description",EscapeHtml(b.MonitoredEntityDescription)));c+=addHtmlValue("Monitored Entity",watchdogMonitoredEntity[b.MonitoredEntity]);c+=addHtmlValue("Current State",amtstack.WatchdogCurrentStates[b.CurrentState]);c+=addHtmlValue("Enabled State",watchdogEnabledStates[b.EnabledState]);c+=addHtmlValue("Startup Interval",b.StartupInterval+
1037
" second(s)");c+=addHtmlValue("Timeout Interval",b.TimeoutInterval+" second(s)");setDialogMode(11,"Watchdog "+guidToStr(rstr2hex(atob(b.DeviceID))),5,showWatchdogDetailsOk,c,b)}function showWatchdogDetailsOk(b,c){2==b&&amtstack.Delete("AMT_AgentPresenceWatchdog",{DeviceID:c.DeviceID},PullWatchdog)}
@@ -1051,11 +1052,11 @@ a}b+=TableStart();c="<i>None</i>";xxSystemDefenceLinkedPolicy[0]&&(c=xxSystemDef
1052
"<div style=padding-left:15px><i>No system defense policies found.</i></div><br>";else for(c in xxSystemDefense.AMT_SystemDefensePolicy.responses)a=xxSystemDefense.AMT_SystemDefensePolicy.responses[c],d="",a.FilterCreationHandles&&(a.FilterCreationHandles=MakeToArray(a.FilterCreationHandles),d=a.FilterCreationHandles.length,d=", "+d+" filter"+(1<d?"s":"")),b+="<div class=itemBar onclick=showPolicyDetails("+c+")><div style=padding-top:3px><b>"+EscapeHtml(a.PolicyName)+"</b>"+d+"</div></div>";b+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT system defense filters.<br><br>";
1053
if(0==xxSystemDefense.AMT_Hdr8021Filter.responses.length&&0==xxSystemDefense.AMT_IPHeadersFilter.responses.length)b+="<div style=padding-left:15px><i>No system defense filters found.</i></div><br>";else{for(c in xxSystemDefense.AMT_Hdr8021Filter.responses)a=xxSystemDefense.AMT_Hdr8021Filter.responses[c],(d=xxSystemDefenceFilterEthernetTypes[a.HdrProtocolID8021])||(d="All Ethernet Protocol "+a.HdrProtocolID8021),d+=", "+xxSystemDefenceFilterDesc[a.FilterProfile],2==a.FilterProfile&&(d+=" at "+a.FilterProfileData+
1054
" packet / sec"),1==a.ActionEventOnMatch&&(d+=", Event on match"),b+="<div class=itemBar onclick=showFilterDetails(0,"+c+")><div style=padding-top:3px><b>"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+"</b>, "+d+"</div></div>";for(c in xxSystemDefense.AMT_IPHeadersFilter.responses){a=xxSystemDefense.AMT_IPHeadersFilter.responses[c];(d=xxSystemDefenceFilterIPTypes[a.HdrIPVersion])||(d="All Ethernet Protocol "+a.HdrIPVersion);d+=", "+xxSystemDefenceFilterDesc[a.FilterProfile];2==
1054
-a.FilterProfile&&(d+=" at "+a.FilterProfileData+" packet / sec");1==a.ActionEventOnMatch&&(d+=", Event on match");var k=0;for(e in xxSystemDefenceFilters)a[e]&&k++;0<k&&(d+=", "+k+" filter"+(1<k?"s":""));b+="<div class=itemBar onclick=showFilterDetails(1,"+c+")><div style=padding-top:3px><b>"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+"</b>, "+d+"</div></div>"}}b+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+
1055
+a.FilterProfile&&(d+=" at "+a.FilterProfileData+" packet / sec");1==a.ActionEventOnMatch&&(d+=", Event on match");var q=0;for(e in xxSystemDefenceFilters)a[e]&&q++;0<q&&(d+=", "+q+" filter"+(1<q?"s":""));b+="<div class=itemBar onclick=showFilterDetails(1,"+c+")><div style=padding-top:3px><b>"+(0==a.FilterDirection?"← ":"→ ")+EscapeHtml(a.Name)+"</b>, "+d+"</div></div>"}}b+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+
1056
AddButton("Add Policy...","AddDefensePolicy()"));QH(54,b);null==xxFilterStatisticsTimer&&(UpdateDefenseStats(),xxFilterStatisticsTimerActive=!1,urlvars.norefresh||(xxFilterStatisticsTimer=setInterval(UpdateDefenseStats,5E3)))}}function StopDefenseStatsTimer(){null!=xxFilterStatisticsTimer&&(clearInterval(xxFilterStatisticsTimer),xxFilterStatisticsTimer=null);xxFilterStatisticsTimerActive=!1}
1057
function UpdateDefenseStats(b){if(b||1!=xxFilterStatisticsTimerActive)xxFilterStatisticsTimerActive=!0,b=b?b:0,xxSystemDefenceLinkedPolicy[b]?amtstack.AMT_SystemDefensePolicy_UpdateStatistics('<a:Address></a:Address><a:ReferenceParameters><w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPort</w:ResourceURI><w:SelectorSet><w:Selector Name="DeviceID">Intel(r) AMT Ethernet Port '+b+"</w:Selector></w:SelectorSet></a:ReferenceParameters>",!1,UpdateDefenseStats2,b,0,{InstanceID:xxSystemDefenceLinkedPolicy[b].InstanceID}):
1058
(xxFilterStatistics[b]={},updateSystemDefense(),StopDefenseStatsTimer())}function UpdateDefenseStats2(b,c,a,d,e){200==d?amtstack.Enum("AMT_ActiveFilterStatistics",UpdateDefenseStats3,e):StopDefenseStatsTimer()}
1058
-function UpdateDefenseStats3(b,c,a,d,e){b=0;if(200==d){xxFilterStatistics[e]={};for(var k in a)d=a[k].ReadCount,c=getItem(a[k].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[e][c]=d,b++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==b&&StopDefenseStatsTimer()}
1059
+function UpdateDefenseStats3(b,c,a,d,e){b=0;if(200==d){xxFilterStatistics[e]={};for(var q in a)d=a[q].ReadCount,c=getItem(a[q].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[e][c]=d,b++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==b&&StopDefenseStatsTimer()}
1060
function changeDefaultPolicy(b){if(!xxdialogMode){var c;c="<div style=height:26px;margin-top:4px><select id=policySelection style=float:right;width:266px><option value=-1>None";for(var a in xxSystemDefense.AMT_SystemDefensePolicy.responses)c+="<option value="+a+(xxSystemDefenceLinkedPolicy[b]&&xxSystemDefense.AMT_SystemDefensePolicy.responses[a].InstanceID==xxSystemDefenceLinkedPolicy[b].InstanceID?" selected":"")+">"+xxSystemDefense.AMT_SystemDefensePolicy.responses[a].PolicyName;setDialogMode(11,
1061
"Default System Defense Policy",3,changeDefaultPolicyOk,c+"</select><div style=padding-top:4px>Default Policy</div></div>",b)}}
1062
function changeDefaultPolicyOk(b,c){var a=Q("policySelection").value,d=xxSystemDefenceLinkedPolicy[c];d&&amtstack.Delete("AMT_NetworkPortSystemDefensePolicy",'<w:SelectorSet><w:Selector Name="Antecedent"><a:EndpointReference xmlns:b="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:c="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address><a:ReferenceParameters><w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_EthernetPort</w:ResourceURI><w:SelectorSet><w:Selector Name="CreationClassName">CIM_EthernetPort</w:Selector><w:Selector Name="DeviceID">Intel(r) AMT Ethernet Port '+c+
@@ -1068,12 +1069,12 @@ function AddDefenseFilter(){if(!xxdialogMode){var b;b="<div style=height:26px;ma
1069
b+="<div style=height:26px;margin-top:4px id=filterdatadiv><input id=filterdata style=float:right;width:260px maxlength=8 onkeyup=AddDefenseFilterUpdate()><div style=padding-top:4px>Packets / second</div></div>";b+="<div style=height:26px;margin-top:4px><select id=filteraction style=float:right;width:266px onchange=AddDefenseFilterUpdate()><option value=false>Do Nothing<option value=1>Event on match</select><div style=padding-top:4px>Event Log</div></div>";setDialogMode(11,"Add System Defense Filter",
1070
3,AddDefenseFilterOk,b);AddDefenseFilterUpdate()}}
1071
function AddDefenseFilterOk(){if(1>=Q("filtertype").value){var b=0==Q("filtertype").value?2048:2054,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrProtocolID8021:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value};2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_Hdr8021Filter",c,AddDefenseFilterOk2)}else{var b=2==Q("filtertype").value?
1071
-4:6,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},a=Q("ipfilter").value.split(","),d;for(d in a){var e=a[d].indexOf("="),k=a[d].substring(0,e),e=a[d].substring(e+1),l=xxSystemDefenceFilters[k];l||(k="Hdr"+k,l=xxSystemDefenceFilters[k]);l&&(2==l&&4==b?(e=e.split("."),4==e.length&&(c[k]=rstr2hex(String.fromCharCode(parseInt(e[0]),
1072
-parseInt(e[1]),parseInt(e[2]),parseInt(e[3]))))):c[k]=e)}2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",c,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var b=0<Q("filtername").value.length;b&&2==Q("filterprofile").value&&(b=parseInt(Q("filterdata").value),b=0<b&&4294967295>b);QE("c48",b);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)}
1072
+4:6,c={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:b,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},a=Q("ipfilter").value.split(","),d;for(d in a){var e=a[d].indexOf("="),q=a[d].substring(0,e),e=a[d].substring(e+1),h=xxSystemDefenceFilters[q];h||(q="Hdr"+q,h=xxSystemDefenceFilters[q]);h&&(2==h&&4==b?(e=e.split("."),4==e.length&&(c[q]=rstr2hex(String.fromCharCode(parseInt(e[0]),
1073
+parseInt(e[1]),parseInt(e[2]),parseInt(e[3]))))):c[q]=e)}2==Q("filterprofile").value&&(c.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",c,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var b=0<Q("filtername").value.length;b&&2==Q("filterprofile").value&&(b=parseInt(Q("filterdata").value),b=0<b&&4294967295>b);QE("c48",b);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)}
1074
function AddDefenseFilterOk2(b,c,a,d){200!=d?messagebox("Add System Defense Filter","Unable to add filter, error #"+d):PullSystemDefense()}
1074
-function showFilterDetails(b,c){if(!xxdialogMode){var a,d,e,k;0==b?(k="AMT_Hdr8021Filter",e="Ethernet Traffic",d=xxSystemDefense[k].responses[c],(a=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(a="All Ethernet Protocol "+d.HdrProtocolID8021)):(k="AMT_IPHeadersFilter",e="IP Traffic",d=xxSystemDefense[k].responses[c],(a=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(a="All IP Protocol "+d.HdrIPVersion));var l;l=""+addHtmlValue("Name",EscapeHtml(d.Name));l+=addHtmlValue("Type",e);l+=addHtmlValue("Matching Traffic",
1075
-a);l+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==b)for(var u in xxSystemDefenceFilters)d[u]&&(a=u,e=d[u],b=xxSystemDefenceFilters[u],2==b&&4==e.length&&(e=hex2rstr(e),e=e.charCodeAt(0)+"."+e.charCodeAt(1)+"."+e.charCodeAt(2)+"."+e.charCodeAt(3)),a.startsWith("Hdr")&&(a=a.substring(3)),l+=addHtmlValue("Filter "+a,e));l+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk,
1076
-l,[k,d])}}function showFilterDetailsOk(b,c){2==b&&amtstack.Delete(c[0],c[1],deleteDefenseFilter)}function deleteDefenseFilter(b,c,a,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters;
1075
+function showFilterDetails(b,c){if(!xxdialogMode){var a,d,e,q;0==b?(q="AMT_Hdr8021Filter",e="Ethernet Traffic",d=xxSystemDefense[q].responses[c],(a=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(a="All Ethernet Protocol "+d.HdrProtocolID8021)):(q="AMT_IPHeadersFilter",e="IP Traffic",d=xxSystemDefense[q].responses[c],(a=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(a="All IP Protocol "+d.HdrIPVersion));var h;h=""+addHtmlValue("Name",EscapeHtml(d.Name));h+=addHtmlValue("Type",e);h+=addHtmlValue("Matching Traffic",
1076
+a);h+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==b)for(var r in xxSystemDefenceFilters)d[r]&&(a=r,e=d[r],b=xxSystemDefenceFilters[r],2==b&&4==e.length&&(e=hex2rstr(e),e=e.charCodeAt(0)+"."+e.charCodeAt(1)+"."+e.charCodeAt(2)+"."+e.charCodeAt(3)),a.startsWith("Hdr")&&(a=a.substring(3)),h+=addHtmlValue("Filter "+a,e));h+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk,
1077
+h,[q,d])}}function showFilterDetailsOk(b,c){2==b&&amtstack.Delete(c[0],c[1],deleteDefenseFilter)}function deleteDefenseFilter(b,c,a,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters;
1078
function AddDefensePolicy(){if(!xxdialogMode){xxAddDefensePolicyFilters=[];var b;b="<div style=height:26px;margin-top:4px><input id=policyname title='<policy name>:<policy precedence number>' style=float:right;width:260px maxlength=16 onkeyup=AddDefensePolicyUpdate()><div style=padding-top:4px>Name</div></div><div style=height:26px;margin-top:4px><select id=policytx title='Default action to take for outbound traffic' style=float:right;width:133px><option value=0>Allow<option value=1>Drop<option value=2>Allow,Count<option value=3>Drop,Count<option value=4>Allow,Count,Event<option value=5>Drop,Count,Event</select><select id=policyrx style=float:right;width:133px title='Default action to take for inbound traffic'><option value=0>Allow<option value=1>Drop<option value=2>Allow,Count<option value=3>Drop,Count<option value=4>Allow,Count,Event<option value=5>Drop,Count,Event</select><div style=padding-top:4px>Default TX / RX</div></div>";b+=
1079
"<div id=policyFilters></div>";if(0<xxSystemDefense.AMT_Hdr8021Filter.responses.length||0<xxSystemDefense.AMT_IPHeadersFilter.responses.length){b+="<div style=height:26px;margin-top:4px><div style=float:right><select id=xfilter style=width:186px>";for(var c in xxSystemDefense.AMT_Hdr8021Filter.responses){var a=xxSystemDefense.AMT_Hdr8021Filter.responses[c];b+="<option value="+a.InstanceID+">"+a.Name}for(c in xxSystemDefense.AMT_IPHeadersFilter.responses)a=xxSystemDefense.AMT_IPHeadersFilter.responses[c],
1080
b+="<option value="+a.InstanceID+">"+a.Name;b+="</select><input id=addFilterButton type=button value=Add style=width:80px onclick=addFilterButton()></div><div style=padding-top:4px>Add Filter</div></div>"}setDialogMode(11,"Add System Defense Policy",3,AddDefensePolicyOk,b);AddDefensePolicyUpdate()}}function addFilterButton(){0<=xxAddDefensePolicyFilters.indexOf(Q("xfilter").value)||(xxAddDefensePolicyFilters.push(Q("xfilter").value),AddDefensePolicyUpdate())}
@@ -1100,8 +1101,8 @@ function updateWifiDialog(){var b=!0,c=c25.value,a=c26.value;QV(67,4>c);QV(66,3<
1101
c28.value)}function PullHardware(){amtstack.BatchEnum("","*CIM_ComputerSystemPackage CIM_SystemPackaging *CIM_Chassis CIM_Chip *CIM_Card *CIM_BIOSElement CIM_Processor CIM_PhysicalMemory CIM_MediaAccessDevice CIM_PhysicalPackage".split(" "),processHardware);amtFirstPull|=1}
1102
var DMTFCPUStatus="Unknown;Enabled;Disabled by User;Disabled By BIOS (POST Error);Idle;Other".split(";"),DMTFMemType="Unknown;Other;DRAM;Synchronous DRAM;Cache DRAM;EDO;EDRAM;VRAM;SRAM;RAM;ROM;Flash;EEPROM;FEPROM;EPROM;CDRAM;3DRAM;SDRAM;SGRAM;RDRAM;DDR;DDR-2;BRAM;FB-DIMM;DDR3;FBD2;DDR4;LPDDR;LPDDR2;LPDDR3;LPDDR4".split(";"),DMTFMemFormFactor=";Other;Unknown;SIMM;SIP;Chip;DIP;ZIP;Proprietary Card;DIMM;TSOP;Row of chips;RIMM;SODIMM;SRIMM;FB-DIM".split(";"),DMTFProcFamilly={191:"Intel® Core™ 2 Duo Processor",
1103
192:"Intel® Core™ 2 Solo processor",193:"Intel® Core™ 2 Extreme processor",194:"Intel® Core™ 2 Quad processor",195:"Intel® Core™ 2 Extreme mobile processor",196:"Intel® Core™ 2 Duo mobile processor",197:"Intel® Core™ 2 Solo mobile processor",198:"Intel® Core™ i7 processor",199:"Dual-Core Intel® Celeron® processor"},HardwareInventory;
1103
-function processHardware(b,c,a,d){if(200==d){var e;b="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>";HardwareInventory=a;QV("go2",!0);b+=TableEnd("<div> "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");c=a.CIM_Chassis.response;d=a.CIM_Card.response;var k=a.CIM_BIOSElement.response.SoftwareElementID;b=b+"<br><h2>Platform</h2>"+FullTable({"Computer model":c.Model,Manufacturer:c.Manufacturer,
1104
-Version:c.Version,"Serial number":c.SerialNumber,"System ID":guidToStr(a.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");b+="<br><h2>Baseboard</h2>";b+=FullTable({Manufacturer:d.Manufacturer,"Product name":d.Model,Version:d.Version,"Serial number":d.SerialNumber,"Asset tag":d.Tag,"Replaceable?":1==d.CanBeFRUed?"Yes":"No"},"");b+="<br><h2>BIOS</h2>";b+=FullTable({Vendor:a.CIM_BIOSElement.response.Manufacturer,Version:k,"Release date":(new Date(a.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en",
1104
+function processHardware(b,c,a,d){if(200==d){var e;b="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>";HardwareInventory=a;QV("go2",!0);b+=TableEnd("<div> "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");c=a.CIM_Chassis.response;d=a.CIM_Card.response;var q=a.CIM_BIOSElement.response.SoftwareElementID;b=b+"<br><h2>Platform</h2>"+FullTable({"Computer model":c.Model,Manufacturer:c.Manufacturer,
1105
+Version:c.Version,"Serial number":c.SerialNumber,"System ID":guidToStr(a.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");b+="<br><h2>Baseboard</h2>";b+=FullTable({Manufacturer:d.Manufacturer,"Product name":d.Model,Version:d.Version,"Serial number":d.SerialNumber,"Asset tag":d.Tag,"Replaceable?":1==d.CanBeFRUed?"Yes":"No"},"");b+="<br><h2>BIOS</h2>";b+=FullTable({Vendor:a.CIM_BIOSElement.response.Manufacturer,Version:q,"Release date":(new Date(a.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en",
1106
{timeZone:"UTC"})},"");b+="<br>";for(e in a.CIM_Processor.responses)c=a.CIM_Processor.responses[e],d=a.CIM_Chip.responses[e],b+="<h2>Processor "+(parseInt(e)+1)+"</h2>",b+=FullTable({Manufacturer:trademarks(d.Manufacturer),Family:DMTFProcFamilly[c.Family],Version:trademarks(d.Version),"Maximum socket speed":c.MaxClockSpeed+" MHz",Status:DMTFCPUStatus[c.CPUStatus]},"");b+="<br>";for(e in a.CIM_PhysicalMemory.responses)c=a.CIM_PhysicalMemory.responses[e],b+="<h2>Memory Module "+(+e+1)+"</h2>",b+=FullTable({"Bank Label":c.BankLabel,
1107
Manufacturer:c.Manufacturer,"Serial Number":c.SerialNumber,Size:parseInt(c.Capacity/1048576)+" MB","Form factor":DMTFMemFormFactor[c.FormFactor],Type:DMTFMemType[c.MemoryType],"Asset tag":c.Tag,"Part number":c.PartNumber},"");b+="<br>";for(e in a.CIM_MediaAccessDevice.responses)c=a.CIM_MediaAccessDevice.responses[e],d=a.CIM_PhysicalPackage.responses[+e+1],b+="<h2>Storage Media "+(parseInt(e)+1)+"</h2>",b+=FullTable({Model:d.Model,"Serial number":""==d.SerialNumber?"Unknown":d.SerialNumber,Size:parseInt(Math.round(1E3*
1108
c.MaxMediaSize/1048576))+" MB"},"");b+="<br>";QH(18,b);updateSystemStatus()}}function SaveHardwareLog(){!xxdialogMode&&HardwareInventory&&SaveJsonFile("IntelAmtHardware","hardware","Intel AMT Hardware Information",HardwareInventory)}var AmtSystemPowerSchemes=null;function PullPowerPolicy(){amtstack.Enum("AMT_SystemPowerScheme",powerPolicyResponse)}function powerPolicyResponse(b,c,a,d){AmtSystemPowerSchemes=a;updateSystemStatus()}
@@ -1110,18 +1111,18 @@ function showPowerPolicyDlgOk(){for(var b=null,c=0,a=document.getElementsByTagNa
1111
function PullUserInfo(){xxAccountFetch=1;delete xxAccountAdminName;xxAccountRealmInfo={};amtstack.AMT_AuthorizationService_GetAdminAclEntry(getAdminAclEntryResponse);amtstack.AMT_AuthorizationService_EnumerateUserAclEntries(1,enumerateUserAclEntriesResponse)}function getAdminAclEntryResponse(b,c,a,d){200==d&&(xxAccountRealmInfo[-1]={AccessPermission:999,DigestUsername:a.Body.Username,Realms:null},xxAccountAdminName=a.Body.Username,updateAccounts())}
1112
function enumerateUserAclEntriesResponse(b,c,a,d){if(200==d){methodcheck(a);QV("go11",!0);xxAccountFetch=a.Body.Handles.length;for(var e in a.Body.Handles)b=a.Body.Handles[e],amtstack.AMT_AuthorizationService_GetAclEnabledState(b,getAclEnabledStateResponse,b),amtstack.AMT_AuthorizationService_GetUserAclEntryEx(b,getUserAclEntryExResponse,b);updateAccounts()}}
1113
function getUserAclEntryExResponse(b,c,a,d,e){xxAccountFetch--;200==d&&(a.Body.Handle=e,a.Body.Realms?Array.isArray(a.Body.Realms)||(a.Body.Realms=[a.Body.Realms]):a.Body.Realms=[],xxAccountRealmInfo[e]=a.Body,updateAccounts())}function getAclEnabledStateResponse(b,c,a,d,e){200==d&&(xxAccountEnabledInfo[e]=a.Body,updateAccounts())}function setAclEnabledStateResponse(b,c,a,d,e){errcheck(d,b)||(methodcheck(a),amtstack.AMT_AuthorizationService_GetAclEnabledState(e,getAclEnabledStateResponse,e))}
1113
-function updateAccounts(){if(!(0<xxAccountFetch)){var b=TableStart2(),b=b+"<tr><td class=r1 style=padding-left:15px><br>Manage the Intel® AMT user accounts for this computer.<br><br>",c;for(c in xxAccountRealmInfo){var a=xxAccountRealmInfo[c],d,e=!1,k=0;a.DigestUsername?(d=a.DigestUsername,e="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(a.KerberosUserSid));xxAccountEnabledInfo[c]&&"$$OsAdmin"!=d&&(k=1==xxAccountEnabledInfo[c].Enabled?1:2);if(showHiddenAccounts||!e){var l="";if(999!=a.AccessPermission){2==
1114
-k&&(l+="Disabled, ");var u=0;for(c in a.Realms)""!=amtstack.RealmNames[a.Realms[c]]&&u++;0<=a.Realms.indexOf(20)&&(l+="Auditor, ");l=0<=a.Realms.indexOf(3)?l+"Administrator":1==u?l+"1 realm":l+(u+" realms")}else l+="Administrator",a.Handle=-1;b+="<div class=itemBar onclick=showUserDetails("+a.Handle+")><div style=float:right>";0<k&&xxAccountAdminName&&(b+=" "+AddButton2(1==k?"Disable":"Enable","changeAccountStateButton(event,"+a.Handle+","+k+")"));!e&&xxAccountAdminName&&(b+=" "+AddButton2("Edit...",
1115
-"changeAccountButton(event,"+a.Handle+")"));b+="</div><div style=padding-top:3px;width:330px;float:left;overflow-x:hidden title='"+d+"'><b>"+d+"</b></div><div style=padding-top:3px>"+l+"</div></div>"}}c="<div style=float:right;margin-right:8px><a title='Toggle hidden accounts' style=color:gray;cursor:pointer onclick=toggleAccountButton()>"+(showHiddenAccounts?"▲":"▼")+"</a></div><div> "+AddRefreshButton("xxAccountFetch=999;PullUserInfo()");xxAccountAdminName&&(c+=AddButton("New Account",
1114
+function updateAccounts(){if(!(0<xxAccountFetch)){var b=TableStart2(),b=b+"<tr><td class=r1 style=padding-left:15px><br>Manage the Intel® AMT user accounts for this computer.<br><br>",c;for(c in xxAccountRealmInfo){var a=xxAccountRealmInfo[c],d,e=!1,q=0;a.DigestUsername?(d=a.DigestUsername,e="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(a.KerberosUserSid));xxAccountEnabledInfo[c]&&"$$OsAdmin"!=d&&(q=1==xxAccountEnabledInfo[c].Enabled?1:2);if(showHiddenAccounts||!e){var h="";if(999!=a.AccessPermission){2==
1115
+q&&(h+="Disabled, ");var r=0;for(c in a.Realms)""!=amtstack.RealmNames[a.Realms[c]]&&r++;0<=a.Realms.indexOf(20)&&(h+="Auditor, ");h=0<=a.Realms.indexOf(3)?h+"Administrator":1==r?h+"1 realm":h+(r+" realms")}else h+="Administrator",a.Handle=-1;b+="<div class=itemBar onclick=showUserDetails("+a.Handle+")><div style=float:right>";0<q&&xxAccountAdminName&&(b+=" "+AddButton2(1==q?"Disable":"Enable","changeAccountStateButton(event,"+a.Handle+","+q+")"));!e&&xxAccountAdminName&&(b+=" "+AddButton2("Edit...",
1116
+"changeAccountButton(event,"+a.Handle+")"));b+="</div><div style=padding-top:3px;width:330px;float:left;overflow-x:hidden title='"+d+"'><b>"+d+"</b></div><div style=padding-top:3px>"+h+"</div></div>"}}c="<div style=float:right;margin-right:8px><a title='Toggle hidden accounts' style=color:gray;cursor:pointer onclick=toggleAccountButton()>"+(showHiddenAccounts?"▲":"▼")+"</a></div><div> "+AddRefreshButton("xxAccountFetch=999;PullUserInfo()");xxAccountAdminName&&(c+=AddButton("New Account",
1117
"newAccountButton()"));b+="<br><td class=r1>"+TableEnd(c+"</div>");QH(23,b)}}function toggleAccountButton(){showHiddenAccounts=!showHiddenAccounts;updateAccounts()}function removeUserAclEntryResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()}function changeAccountStateButton(b,c,a){haltEvent(b);xxdialogMode||amtstack.AMT_AuthorizationService_SetAclEnabledState(c,1==a?!1:!0,setAclEnabledStateResponse,c)}
1118
function changeAccountButton(b,c){haltEvent(b);xxdialogMode||(updateRealms(xxAccountRealmInfo[c].Realms),d2username.value=xxAccountRealmInfo[c].DigestUsername?xxAccountRealmInfo[c].DigestUsername:GetSidString(atob(xxAccountRealmInfo[c].KerberosUserSid)),d2password1.value=d2password2.value="",d2permission.value=xxAccountRealmInfo[c].AccessPermission,setDialogMode(2,"Edit Account",-1==c?3:7,function(a){changeAccountButtonEx(c,a)}),updateAccountDialog())}
1119
function newAccountButton(){xxdialogMode||(updateRealms([]),d2username.value=d2password1.value=d2password2.value="",d2permission.value=2,setDialogMode(2,"New Account",3,function(){changeAccountButtonEx(null,1)}),updateAccountDialog())}
1119
-function changeAccountButtonEx(b,c){if(1==c){var a=[],d=d2username.value,e=d2permission.value,k=d2password1.value,l=GetSidByteArray(Q("d2username").value),u=null;if(0==d.length||k!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==l?u=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+k)):(d=null,l=btoa(l));if(-1!=b)for(var n in amtstack.RealmNames)(amtstack.RealmNames[n]||3==n)&&Q("rx"+n).checked&&a.push(n);null==b?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d,
1120
-u,l,e,a,userAclEntryExResponse):-1==b?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,u,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(b,d,u,l,e,a,userAclEntryExResponse)}2==c&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(b,removeUserAclEntryResponse)}function userAclEntryExResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()}
1120
+function changeAccountButtonEx(b,c){if(1==c){var a=[],d=d2username.value,e=d2permission.value,q=d2password1.value,h=GetSidByteArray(Q("d2username").value),r=null;if(0==d.length||q!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==h?r=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+q)):(d=null,h=btoa(h));if(-1!=b)for(var n in amtstack.RealmNames)(amtstack.RealmNames[n]||3==n)&&Q("rx"+n).checked&&a.push(n);null==b?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d,
1121
+r,h,e,a,userAclEntryExResponse):-1==b?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,r,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(b,d,r,h,e,a,userAclEntryExResponse)}2==c&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(b,removeUserAclEntryResponse)}function userAclEntryExResponse(b,c,a,d,e){methodcheck(a)||PullUserInfo()}
1122
function updateRealms(b){QV(62,null!=b);if(null!=b){var c="<li><label><input type=checkbox onchange=updateAccountDialog() id=rx3"+(0<=b.indexOf(3)?" checked":"")+">Administrator</label></li><hr />",a;for(a in amtstack.RealmNames){var d="";0<=b.indexOf(parseInt(a))&&(d=" checked");amtstack.RealmNames[a]&&(c+="<li><label><input type=checkbox onchange=updateAccountDialog() id=rx"+a+d+">"+amtstack.RealmNames[a]+"</label></li>")}QH(63,c)}}
1123
function updateAccountDialog(){var b=!0;if("none"!=Q(62).style.display){var b=!1,c;for(c in amtstack.RealmNames)(amtstack.RealmNames[c]||3==c)&&Q("rx"+c).checked&&(b=!0)}b&&(b=0<d2username.value.length&&passwordcheck(d2password1.value)&&d2password1.value==d2password2.value);QE("c48",b)}var xxUserPermissions=["Local only","Network only","All (Local & Network)"];
1123
-function showUserDetails(b){if(!xxdialogMode){var c=xxAccountRealmInfo[b],a="<div style=text-align:left>",d,e=c.DigestUsername;e||(e=GetSidString(atob(c.KerberosUserSid)));a+=addHtmlValue("Name",e);xxAccountEnabledInfo[b]&&(a+=addHtmlValue("State",1==xxAccountEnabledInfo[b].Enabled?"Enabled":"Disabled"));if(e==xxAccountAdminName)a+=addHtmlValue("Permission","Administrator");else{var a=a+addHtmlValue("Permission",xxUserPermissions[c.AccessPermission]),k="";if(0<=c.Realms.indexOf(3))k="Administrator",
1124
-0<=c.Realms.indexOf(20)&&(k+=", Auditor");else for(d in xxAccountRealmInfo[b].Realms)""!=amtstack.RealmNames[c.Realms[d]]&&(0<k.length&&(k+=", "),k+=amtstack.RealmNames[c.Realms[d]]);0==k.length&&(k="None");a+=addHtmlValue("Realms","")+"<b>"+k+"</b>"}messagebox("Account "+e,a+"</div>")}}
1124
+function showUserDetails(b){if(!xxdialogMode){var c=xxAccountRealmInfo[b],a="<div style=text-align:left>",d,e=c.DigestUsername;e||(e=GetSidString(atob(c.KerberosUserSid)));a+=addHtmlValue("Name",e);xxAccountEnabledInfo[b]&&(a+=addHtmlValue("State",1==xxAccountEnabledInfo[b].Enabled?"Enabled":"Disabled"));if(e==xxAccountAdminName)a+=addHtmlValue("Permission","Administrator");else{var a=a+addHtmlValue("Permission",xxUserPermissions[c.AccessPermission]),q="";if(0<=c.Realms.indexOf(3))q="Administrator",
1125
+0<=c.Realms.indexOf(20)&&(q+=", Auditor");else for(d in xxAccountRealmInfo[b].Realms)""!=amtstack.RealmNames[c.Realms[d]]&&(0<q.length&&(q+=", "),q+=amtstack.RealmNames[c.Realms[d]]);0==q.length&&(q="None");a+=addHtmlValue("Realms","")+"<b>"+q+"</b>"}messagebox("Account "+e,a+"</div>")}}
1126
function wsmanQuery(){QH(26,"");var b=getSelectedOptions(Q(24)),c=[],a;for(a in b)""==QS("WSB-"+b[a]).display&&c.push(b[a]);0!=c.length&&(QE(25,!1),c&&0<c.length&&amtstack.BatchEnum("Browser",c,browserResponse,null,!0))}
1127
function browserResponse(b,c,a,d){QE(25,!0);b="";for(var e in a)c=a[e],b+="<h2>"+e+"</h2><div style=margin-left:20px>",b=200==c.status?0==c.responses.length?b+"<br>(Empty)":b+ObjectToString(c.responses).replace(/Intel\(r\)/g,"Intel®"):b+("<br><div style=color:red>Error #"+c.status+"</div>"),b+="</div><br>";QH(26,b)}
1128
function wsmanFilter(){var b=c0.value.toLowerCase(),c;for(c in AllWsman)QV("WSB-"+AllWsman[c],""==b||0<=AllWsman[c].toLowerCase().indexOf(b))}function connectTerminal(){terminal&&(0==terminal.State?(terminal.tlsv1only=amtstack.wsman.comm.tlsv1only,terminal.Start(currentMeshNode._id,16994,"*","*",0)):terminal.Stop())}
@@ -1157,10 +1158,10 @@ function dmousemove(b){xxdialogMode||Q(49).checked||(null!=webRtcDesktop&&null!=
1158
function drotate(b){b=desktop.m.rotation+b;desktop.m.setRotation(b);null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop&&null!=webRtcDesktop.softdesktop.m&&webRtcDesktop.softdesktop.m.setRotation(b);center()}var p24files=null,p24filetree=null,p24targetpath=null,p24filetreelocation=[];
1159
function onFilesControlData(b){if(0<b.length&&123!=b.charCodeAt(0))p24gotDownloadBinaryData(b);else if(b=JSON.parse(b),"download"==b.action)p24gotDownloadCommand(b);else if("upload"==b.action)p24gotUploadData(b);else if("pong"!=b.action)if(b.path=b.path.replace(/\//g,"\\"),null!=p24filetree&&b.path==p24filetree.path){var c=p24getCheckedNames();p24filetree=b;p24updateFiles(c)}else{for(var c=b.path.split("/").join("\\"),a=p24targetpath.split("/").join("\\");0<c.length&&"\\"==c[0];)c=c.substring(1);
1160
for(;0<a.length&&"\\"==a[0];)a=a.substring(1);if(c==a||"\\"==b.path&&""==p24targetpath)p24filetree=b,p24updateFiles()}}function p24getCheckedNames(){for(var b=[],c=document.getElementsByName("fd"),a=0;a<c.length;a++)c[a].checked&&b.push(p24filetree.dir[c[a].value].n);return b}
1160
-function p24updateFiles(b){var c="",a="",d="<a style=cursor:pointer onclick=p24folderup(0)>Root</a>",e=p24filetree.path.split("\\");p24filetreelocation=[];for(var k in e)""!=e[k]&&p24filetreelocation.push(e[k]);for(k in p24filetreelocation)d+=" / <a style=cursor:pointer onclick=p24folderup("+(parseInt(k)+1)+")>"+p24filetreelocation[k]+"</a>";var e=p24filetreelocation.join("/"),l=p24sort_files(p24filetree.dir);for(k in l){var u=l[k],n=u.n,p;p=70<n.length?'<span title="'+EscapeHtml(n)+'">'+EscapeHtml(n.substring(0,
1161
-70))+"...</span>":EscapeHtml(n);var n=EscapeHtml(n),x="";null!=u.d&&(x=new Date(u.d),x=x.getMonth()+1+"/"+x.getDate()+"/"+x.getFullYear()+" "+x.toLocaleTimeString()+" ");var m="";null!=u.s&&(m=getFileSizeStr(u.s));var w="";3>u.t?w="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p24setActions() value='"+u.nx+'\'> <span style=float:right title=""></span><span><div class=fileIcon'+u.t+'></div><a style=cursor:pointer onclick=p24folderset("'+
1162
-encodeURIComponent(u.nx)+'")>'+p+"</a></span></div>":(w=p,0<u.s&&(w='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p24downloadfile(\''+encodeURIComponent(e+"/"+n)+"','"+encodeURIComponent(n)+"',"+u.s+')">'+p+"</a>"),w="<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p24setActions() value='"+u.nx+"'> <span class=fsize>"+x+"</span><span style=float:right>"+m+"</span><span><div class=fileIcon"+u.t+"></div>"+w+"</span></div>");
1163
-3>u.t?c+=w:a+=w}QH("p24files",c+a);QH("p24currentpath",d);QE("p24FolderUp",0!=p24filetreelocation.length);if(null!=b)for(c=document.getElementsByName("fd"),k=0;k<c.length;k++)0<=b.indexOf(p24filetree.dir[c[k].value].n)&&(c[k].checked=!0);p24setActions()}function p24folderset(b){p24targetpath=joinPaths(p24filetree.path,p24filetree.dir[b].n).split("\\").join("/");p24files.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:p24targetpath}))}
1161
+function p24updateFiles(b){var c="",a="",d="<a style=cursor:pointer onclick=p24folderup(0)>Root</a>",e=p24filetree.path.split("\\");p24filetreelocation=[];for(var q in e)""!=e[q]&&p24filetreelocation.push(e[q]);for(q in p24filetreelocation)d+=" / <a style=cursor:pointer onclick=p24folderup("+(parseInt(q)+1)+")>"+p24filetreelocation[q]+"</a>";var e=p24filetreelocation.join("/"),h=p24sort_files(p24filetree.dir);for(q in h){var r=h[q],n=r.n,m;m=70<n.length?'<span title="'+EscapeHtml(n)+'">'+EscapeHtml(n.substring(0,
1162
+70))+"...</span>":EscapeHtml(n);var n=EscapeHtml(n),w="";null!=r.d&&(w=new Date(r.d),w=w.getMonth()+1+"/"+w.getDate()+"/"+w.getFullYear()+" "+w.toLocaleTimeString()+" ");var k="";null!=r.s&&(k=getFileSizeStr(r.s));var v="";3>r.t?v="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p24setActions() value='"+r.nx+'\'> <span style=float:right title=""></span><span><div class=fileIcon'+r.t+'></div><a style=cursor:pointer onclick=p24folderset("'+
1163
+encodeURIComponent(r.nx)+'")>'+m+"</a></span></div>":(v=m,0<r.s&&(v='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p24downloadfile(\''+encodeURIComponent(e+"/"+n)+"','"+encodeURIComponent(n)+"',"+r.s+')">'+m+"</a>"),v="<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p24setActions() value='"+r.nx+"'> <span class=fsize>"+w+"</span><span style=float:right>"+k+"</span><span><div class=fileIcon"+r.t+"></div>"+v+"</span></div>");
1164
+3>r.t?c+=v:a+=v}QH("p24files",c+a);QH("p24currentpath",d);QE("p24FolderUp",0!=p24filetreelocation.length);if(null!=b)for(c=document.getElementsByName("fd"),q=0;q<c.length;q++)0<=b.indexOf(p24filetree.dir[c[q].value].n)&&(c[q].checked=!0);p24setActions()}function p24folderset(b){p24targetpath=joinPaths(p24filetree.path,p24filetree.dir[b].n).split("\\").join("/");p24files.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:p24targetpath}))}
1165
function p24folderup(b){if(null==b)p24filetreelocation.pop();else for(;p24filetreelocation.length>b;)p24filetreelocation.pop();p24targetpath=p24filetreelocation.join("/");p24files.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:p24targetpath}))}var p24sortorder;function p24sort_filename(b,c){return b.ln>c.ln?1*p24sortorder:b.ln<c.ln?-1*p24sortorder:0}function p24sort_timestamp(b,c){return b.d>c.d?1*p24sortorder:b.d<c.d?-1*p24sortorder:0}
1166
function p24sort_bysize(b,c){return b.s==c.s?p24sort_filename(b,c):(b.s-c.s)*p24sortorder}function p24sort_files(b){var c=[],a=Q("p24sortdropdown").value,d;for(d in b)b[d].nx=d,null==b[d].s&&(b[d].s=0),null==b[d].n&&(b[d].n=d),b[d].ln=b[d].n.toLowerCase(),c.push(b[d]);p24sortorder=1;3<a&&(p24sortorder=-1,a-=3);1==a?c.sort(p24sort_filename):2==a?c.sort(p24sort_bysize):3==a&&c.sort(p24sort_timestamp);return c}
1167
function p24setActions(){if(null==p24filetree)QE("p24DeleteFileButton",!1),QE("p24NewFolderButton",!1),QE("p24UploadButton",!1),QE("p24RenameFileButton",!1),QE("p24SelectAllButton",!1),Q("p24SelectAllButton").value="Select All",QE("p24RefreshButton",!1),QE("p24CutButton",!1),QE("p24CopyButton",!1),QE("p24PasteButton",!1);else{var b=p24getFileSelCount(),c=p24getFileCount(),a=p24getFileSelCount(!1),d="win32"==webRtcDesktop.platform;QE("p24DeleteFileButton",0<b&&(0<p24filetreelocation.length||0==d));
@@ -1187,15 +1188,15 @@ function p24uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>u
1188
uploadFile.xreader.onerror=function(){p24uploadNextFile()};uploadFile.xreader.readAsArrayBuffer(b)}else p24uploadFileCancel(),p24folderup(9999)}function p24uploadFileCancel(b,c){null!=uploadFile&&(uploadFile=null,setDialogMode(0),99==c&&null!=p24files&&p24files.sendCtrlMsg(JSON.stringify({action:"upload",sub:"cancel"})))}
1189
function p24gotUploadData(b){if(null!=uploadFile&&parseInt(uploadFile.xfilePtr)==parseInt(b.reqid))if("start"==b.sub)for(p24uploadNextPart(!1),b=0;8>b;b++)p24uploadNextPart(!0);else"ack"==b.sub?p24uploadNextPart(!1):"error"==b.sub&&p24uploadFileCancel()}function ab2str(b){return String.fromCharCode.apply(null,new Uint8Array(b))}
1190
function p24uploadNextPart(b){var c=uploadFile.xdata,a=uploadFile.xptr,d=uploadFile.xptr+4096;if(d>c.byteLength){if(1==b)return;d=c.byteLength}a==c.byteLength?p24uploadNextFile():(p24files.sendCtrlMsg(btoa(IntToStr(d!=c.byteLength?16777216:16777217)+ab2str(c.slice(a,d)))),uploadFile.xptr=d,Q("d2progressBar").value=d)}var ider,iderCodeBlock,iderTimer;
1190
-function iderStart(){var b;b='<div>Mount disk images on a Intel® AMT computer - Experimental.</div><br /><div style=height:26px><input id=floppyImageInput type=file style=float:right;width:250px accept=".img"><div>Floppy (.img)</div></div><div style=height:26px><input id=cdromImageInput type=file style=float:right;width:250px accept=".iso"><div>CDROM (.iso)</div></div>';b+="<div style=height:26px><select id=iderStartType style=float:right;width:250px><option value=0>On next boot<option value=1>Graceful<option value=2>Immediate</select><div>Session Start</div></div>";
1191
+function iderStart(b){b='<div>Mount disk images on a Intel® AMT computer - Experimental.</div><br /><div style=height:26px><input id=floppyImageInput type=file style=float:right;width:250px accept=".img"><div>Floppy (.img)</div></div><div style=height:26px><input id=cdromImageInput type=file style=float:right;width:250px accept=".iso"><div>CDROM (.iso)</div></div>';b+="<div style=height:26px><select id=iderStartType style=float:right;width:250px><option value=0>On next boot<option value=1>Graceful<option value=2>Immediate</select><div>Session Start</div></div>";
1192
setDialogMode(11,"Storage Redirection",3,iderStart2,b);if(b=localStorage.getItem("iderurl"))Q("storageserverurl").value=b.substring(1,b.length-1)}
1193
function iderStart2(){if(1!=Q("floppyImageInput").files.length&&1!=Q("cdromImageInput").files.length)messagebox("Storage Redirection Error","At least one disk image file must be selected.");else if(1==Q("floppyImageInput").files.length&&0!=Q("floppyImageInput").files[0].size%512)messagebox("Storage Redirection Error","Invalid .img file.");else if(1==Q("cdromImageInput").files.length&&0!=Q("cdromImageInput").files[0].size%2048)messagebox("Storage Redirection Error","Invalid .iso file.");else{var b=
1194
null,c=null;1==Q("floppyImageInput").files.length&&(b=Q("floppyImageInput").files[0]);1==Q("cdromImageInput").files.length&&(c=Q("cdromImageInput").files[0]);null==b&&null==c||iderStart3(b,c,Q("iderStartType").value)}}
1194
-function iderStart3(b,c,a){iderStop();ider=CreateAmtRedirect(CreateAmtRemoteIder());ider.onStateChanged=onIderStateChange;ider.m.floppy=b;ider.m.cdrom=c;ider.m.iderStart=a;ider.m.sectorStats=iderSectorStats;ider.tlsv1only=amtstack.wsman.comm.tlsv1only;ider.Start(currentMeshNode._id,16994,"*","*",0)}function iderStop(){ider&&(ider.m.Stop(),ider.onStateChanged=null,ider.m.onDialogPrompt=null,delete ider);iderTimer&&(clearInterval(iderTimer),delete iderTimer);iderToggleDiskMap(!1)}
1195
-function onIderStateChange(b,c){QE("c2",3!=c);QE("c8",3!=c);QE("c1",3!=c);QE("c7",3!=c);QV(9,3==c);center();3==c?(urlvars.norefresh||(iderTimer=setInterval(onIderTimer,500)),onIderTimer()):iderTimer&&(clearInterval(iderTimer),delete iderTimer)}
1195
+function iderStart3(b,c,a){iderStop();ider=CreateAmtRedirect(CreateAmtRemoteIder());ider.onStateChanged=onIderStateChange;ider.m.floppy=b;ider.m.cdrom=c;ider.m.iderStart=a;ider.m.sectorStats=iderSectorStats;ider.tlsv1only=amtstack.wsman.comm.tlsv1only;ider.Start(currentMeshNode._id,16994,"*","*",0);QV("IDERDiskMapButton",!0)}
1196
+function iderStop(){ider&&(ider.m.Stop(),ider.onStateChanged=null,ider.m.onDialogPrompt=null,delete ider);iderTimer&&(clearInterval(iderTimer),delete iderTimer);iderToggleDiskMap(!1)}function onIderStateChange(b,c){QE("c2",3!=c);QE("c8",3!=c);QE("c1",3!=c);QE("c7",3!=c);QV(9,3==c);center();3==c?(urlvars.norefresh||(iderTimer=setInterval(onIderTimer,500)),onIderTimer()):iderTimer&&(clearInterval(iderTimer),delete iderTimer)}
1197
function onIderTimer(){ider.m.Update&&ider.m.Update();-1==ider.m.bytesFromAmt?iderStop():QH(10,"<b>"+(ider.m.server?"Server ":"")+"IDE-R Session</b>, Connected, "+ider.m.bytesFromAmt+" in, "+ider.m.bytesToAmt+" out.")}var heatMapWidth=600,heatMapDividor={};
1197
-function iderSectorStats(b,c,a,d,e){var k=c?Q("cdromHeatMapCanvas"):Q("floppyHeatMapCanvas"),l=k.getContext("2d");if(0==b){heatMapDividor[c]=1;if(0<a)for(;8E3<a/heatMapDividor[c];)heatMapDividor[c]*=2;c?(QV("cdromHeatMap",a),QH("cdromHeatMapText","<b>CDROM</b>, blocks are "+2048*heatMapDividor[c]+" bytes.")):(QV("floppyHeatMap",a),QH("floppyHeatMapText","<b>Floppy</b>, blocks are "+512*heatMapDividor[c]+" bytes."))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)k.height=6*(Math.floor(a/(heatMapWidth/
1198
-6))+(a%heatMapWidth?1:0)),l.fillStyle="rgba(225,250,225,1)",l.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&l.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),l.fillStyle="rgba(0,0,0,0.3)";else for(b=d;b<d+e;b++)sectorHeat(l,b,6,c)}function sectorHeat(b,c,a,d){b.fillRect(c%(heatMapWidth/a)*a,Math.floor(c/(heatMapWidth/a))*a,a,a)}
1198
+function iderSectorStats(b,c,a,d,e){var q=c?Q("cdromHeatMapCanvas"):Q("floppyHeatMapCanvas"),h=q.getContext("2d");if(0==b){heatMapDividor[c]=1;if(0<a)for(;8E3<a/heatMapDividor[c];)heatMapDividor[c]*=2;c?(QV("cdromHeatMap",a),QH("cdromHeatMapText","<b>CDROM</b>, blocks are "+2048*heatMapDividor[c]+" bytes.")):(QV("floppyHeatMap",a),QH("floppyHeatMapText","<b>Floppy</b>, blocks are "+512*heatMapDividor[c]+" bytes."))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)q.height=6*(Math.floor(a/(heatMapWidth/
1199
+6))+(a%heatMapWidth?1:0)),h.fillStyle="rgba(225,250,225,1)",h.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&h.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),h.fillStyle="rgba(0,0,0,0.3)";else for(b=d;b<d+e;b++)sectorHeat(h,b,6,c)}function sectorHeat(b,c,a,d){b.fillRect(c%(heatMapWidth/a)*a,Math.floor(c/(heatMapWidth/a))*a,a,a)}
1200
function iderToggleDiskMap(b){var c="none"!=QS("iderHeatmap").display;null==b&&(b=!c);xxdialogMode&&(b=!1);QS("iderHeatmap").display=b?"":"none"}function onIderDialogPrompt(b,c,a){iderCodeBlock&&(document.body.removeChild(iderCodeBlock),delete iderCodeBlock);c.js&&(b=document.createElement("script"),b.text=c.js,iderCodeBlock=document.body.appendChild(b));setDialogMode(11,"Storage Redirection",a?a:3,onIderDialogPromptOk,c.html)}
1201
function onIderDialogPromptOk(b){1==b?window.iderServerCall?ider.m.dialogPrompt(window.iderServerCall()):ider.m.dialogPrompt():iderStop()}function iderServerStart(){iderStop();ider=CreateAmtRemoteServerIder();null!=ider&&(ider.onStateChanged=onIderStateChange,ider.m.sectorStats=iderSectorStats,ider.m.onDialogPrompt=onIderDialogPrompt,ider.tlsv1only=amtstack.wsman.comm.tlsv1only,ider.Start(currentMeshNode._id,16994,"*","*",0))}
1202
var xxRemoteAccess=null,xxEnvironementDetection=null,xxCiraServers=null,xxUserInitiatedCira=null,xxUserInitiatedEnabledState={32768:"Disabled",32769:"BIOS enabled",32770:"OS enable",32771:"BIOS & OS enabled"},xxRemoteAccessCredentiaLinks=null,xxMPSUserPass=null,xxPolicies=null;
@@ -1205,8 +1206,8 @@ a.AMT_RemoteAccessCredentialContext.responses;xxMPSUserPass=a.AMT_MPSUsernamePas
1206
xxPolicies[c].push(b);updateRemoteAccess()}}
1207
function updateRemoteAccess(){if(null!=xxEnvironementDetection){var b,c="Disabled",a=xxRemoteAccess.IPS_HTTPProxyService&&xxRemoteAccess.IPS_HTTPProxyAccessPoint;xxEnvironementDetection.DetectionStrings&&0<xxEnvironementDetection.DetectionStrings.length&&(c="Enabled, "+xxEnvironementDetection.DetectionStrings.length+" domain"+(1<xxEnvironementDetection.DetectionStrings.length?"s":""));b=""+TableStart();b+=TableEntry("Environment detection",addLink(c,"editEnvironmentDetection()"));b+=TableEntry("User initiation options",
1208
addLinkConditional(xxUserInitiatedEnabledState[xxUserInitiatedCira.EnabledState],"editUserInitiatedCira()",xxAccountAdminName));c="<i>None</i>";if(0<xxPolicies.User.length){var c="",d;for(d in xxPolicies.User)0<c.length&&(c+=", "),c+=xxPolicies.User[d].AccessInfo,1==xxPolicies.User[d].MpsType&&(c+=" (CILA)")}b+=TableEntry("User initiated connection",addLinkConditional(c,'editMpsPolicy("User")',xxAccountAdminName));c="<i>None</i>";if(0<xxPolicies.Alert.length)for(d in c="",xxPolicies.Alert)0<c.length&&
1208
-(c+=", "),c+=xxPolicies.Alert[d].AccessInfo,1==xxPolicies.Alert[d].MpsType&&(c+=" (CILA)");b+=TableEntry("Alert initiated connection",addLinkConditional(c,'editMpsPolicy("Alert")',xxAccountAdminName));c="<i>None</i>";if(0<xxPolicies.Periodic.length)for(d in c="",xxPolicies.Periodic)0<c.length&&(c+=", "),c+=xxPolicies.Periodic[d].AccessInfo,1==xxPolicies.Periodic[d].MpsType&&(c+=" (CILA)");var e=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName","Periodic");if(e){var k=atob(e.ExtendedData);
1209
-0==ReadInt(k,0)&&(c+=", each "+ReadInt(k,4)+" seconds");1==ReadInt(k,0)&&(e=ReadInt(k,4),k=ReadInt(k,8),10>k&&(k="0"+k),c+=", at "+e+":"+k+" daily")}b+=TableEntry("Periodic connection",addLinkConditional(c,'editMpsPolicy("Periodic")',xxAccountAdminName));b+=TableEnd();b=b+"<br>"+TableStart2();b+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT remote management servers.<br><br>";if(0==xxCiraServers.length)b+="<div style=padding-left:15px><br><i>No remote servers found.</i></div><br>";
1209
+(c+=", "),c+=xxPolicies.Alert[d].AccessInfo,1==xxPolicies.Alert[d].MpsType&&(c+=" (CILA)");b+=TableEntry("Alert initiated connection",addLinkConditional(c,'editMpsPolicy("Alert")',xxAccountAdminName));c="<i>None</i>";if(0<xxPolicies.Periodic.length)for(d in c="",xxPolicies.Periodic)0<c.length&&(c+=", "),c+=xxPolicies.Periodic[d].AccessInfo,1==xxPolicies.Periodic[d].MpsType&&(c+=" (CILA)");var e=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName","Periodic");if(e){var q=atob(e.ExtendedData);
1210
+0==ReadInt(q,0)&&(c+=", each "+ReadInt(q,4)+" seconds");1==ReadInt(q,0)&&(e=ReadInt(q,4),q=ReadInt(q,8),10>q&&(q="0"+q),c+=", at "+e+":"+q+" daily")}b+=TableEntry("Periodic connection",addLinkConditional(c,'editMpsPolicy("Periodic")',xxAccountAdminName));b+=TableEnd();b=b+"<br>"+TableStart2();b+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT remote management servers.<br><br>";if(0==xxCiraServers.length)b+="<div style=padding-left:15px><br><i>No remote servers found.</i></div><br>";
1211
else for(d in xxCiraServers)c=":"+xxCiraServers[d].Port,xxCiraServers[d].CN&&(c+=", "+xxCiraServers[d].CN),b+="<div class=itemBar onclick=showServerDetails("+d+")><div style=padding-top:3px><b>"+xxCiraServers[d].AccessInfo+"</b>"+EscapeHtml(c)+"</div></div>";if(a)if(b+="<br>Manage HTTP proxies used for management connections.<br><br>",c=xxRemoteAccess.IPS_HTTPProxyAccessPoint.responses,0==c.length)b+="<div style=padding-left:15px><br><i>No proxies configured.</i></div><br>";else for(d in c)b+="<div class=itemBar onclick=showProxyDetails("+
1212
d+")><div style=padding-top:3px><b>"+EscapeHtml(c[d].AccessInfo)+":"+c[d].Port+"</b> / "+EscapeHtml(c[d].NetworkDnsSuffix)+"</div></div>";d="";xxAccountAdminName&&(d=AddButton("Add Server...","AddRemoteAccessServer()"),a&&(d+=AddButton("Add Proxy...","AddRemoteAccessProxy()")));b+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullRemoteAccess()")+d);QH(53,b)}}var xxEditMpsPolicyType;
1213
function editMpsPolicy(b){var c="",a=11<amtversion||11==amtversion&&6<=amtversion,d=xxEditMpsPolicyType=b;"User"==d&&(d="User Initiated");var d=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName",d),c=c+"<div style=height:26px><select id=d2server1 style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=-1>(None)",e;for(e in xxCiraServers)c+="<option value="+e+""+(xxPolicies[b][0]&&xxPolicies[b][0].Name==xxCiraServers[e].Name?" selected":"")+">"+xxCiraServers[e].AccessInfo;
@@ -1217,9 +1218,9 @@ for(e in xxCiraServers)c+="<option value="+e+""+(xxPolicies[b][1]&&xxPolicies[b]
1218
function editMpsPolicyUpdate(){var b=11<amtversion||11==amtversion&&6<=amtversion,c=1>=xxCiraServers.length||-1==Q("d2server1").value||Q("d2server1").value!=Q("d2server2").value;if(1==c&&"Periodic"==xxEditMpsPolicyType&&1==Q("d2ttype").value){var a=Q("d2timer").value.split(":");if(2!=a.length)c=!1;else{var d=parseInt(a[0]),a=parseInt(a[1]);if(0>d||23<d||0>a||59<a)c=!1}}QE("c48",c);1<xxCiraServers.length&&QE("d2server2",-1!=Q("d2server1").value);"Periodic"==xxEditMpsPolicyType&&(QE("d2timer",
1219
-1!=Q("d2server1").value),QH("ttypelabel",0==Q("d2ttype").value?"Trigger interval (Seconds)":"Time of day (HH:MM)"),QE("d2ttype",-1!=Q("d2server1").value));QE("d2lifetime",-1!=Q("d2server1").value);b&&(QE("d2server1cira",-1<Q("d2server1").value),1<xxCiraServers.length&&QE("d2server2cira",-1<Q("d2server1").value&&-1<Q("d2server2").value))}
1220
function editMpsPolicyOk(){var b=xxEditMpsPolicyType;"User"==b&&(b="User Initiated");getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName",b)?amtstack.Delete("AMT_RemoteAccessPolicyRule",{PolicyRuleName:b},editMpsPolicyOk2):editMpsPolicyOk2()}
1220
-function editMpsPolicyOk2(b,c,a,d){b=11<amtversion||11==amtversion&&6<=amtversion;if(-1==Q("d2server1").value)PullRemoteAccess();else{c=0;"Alert"==xxEditMpsPolicyType&&(c=1);"Periodic"==xxEditMpsPolicyType&&(c=2);a=null;2==c&&(a=Q("d2ttype").value,d=IntToStr(Q("d2timer").value),1==a&&(d=Q("d2timer").value.split(":"),d=IntToStr(parseInt(d[0]))+IntToStr(parseInt(d[1]))),a=btoa(IntToStr(a)+d));var e,k;0<=Q("d2server1").value&&(e='<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="Name">'+
1221
-xxCiraServers[Q("d2server1").value].Name+"</Selector></SelectorSet></ReferenceParameters>");0<=Q("d2server1").value&&1<xxCiraServers.length&&0<=Q("d2server2").value&&(k='<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="Name">'+
1222
-xxCiraServers[Q("d2server2").value].Name+"</Selector></SelectorSet></ReferenceParameters>");d=[];var l=[];b?e&&(0==Q("d2server1cira").value?d.push(e):l.push(e),k&&(0==Q("d2server2cira").value?d.push(k):l.push(k))):e&&(d.push(e),k&&d.push(k));amtstack.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(c,Q("d2lifetime").value,a,d,l,PullRemoteAccess)}}var editEnvironmentDetectionTmp;
1221
+function editMpsPolicyOk2(b,c,a,d){b=11<amtversion||11==amtversion&&6<=amtversion;if(-1==Q("d2server1").value)PullRemoteAccess();else{c=0;"Alert"==xxEditMpsPolicyType&&(c=1);"Periodic"==xxEditMpsPolicyType&&(c=2);a=null;2==c&&(a=Q("d2ttype").value,d=IntToStr(Q("d2timer").value),1==a&&(d=Q("d2timer").value.split(":"),d=IntToStr(parseInt(d[0]))+IntToStr(parseInt(d[1]))),a=btoa(IntToStr(a)+d));var e,q;0<=Q("d2server1").value&&(e='<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="Name">'+
1222
+xxCiraServers[Q("d2server1").value].Name+"</Selector></SelectorSet></ReferenceParameters>");0<=Q("d2server1").value&&1<xxCiraServers.length&&0<=Q("d2server2").value&&(q='<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd">http://intel.com/wbem/wscim/1/amt-schema/1/AMT_ManagementPresenceRemoteSAP</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="Name">'+
1223
+xxCiraServers[Q("d2server2").value].Name+"</Selector></SelectorSet></ReferenceParameters>");d=[];var h=[];b?e&&(0==Q("d2server1cira").value?d.push(e):h.push(e),q&&(0==Q("d2server2cira").value?d.push(q):h.push(q))):e&&(d.push(e),q&&d.push(q));amtstack.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(c,Q("d2lifetime").value,a,d,h,PullRemoteAccess)}}var editEnvironmentDetectionTmp;
1224
function editEnvironmentDetection(b){1!=b&&(editEnvironmentDetectionTmp=xxEnvironementDetection.DetectionStrings?Clone(xxEnvironementDetection.DetectionStrings):[]);var c="";xxAccountAdminName&&(c+="Enter up to 5 intranet domain suffix. If the computer is outside these domains, Intel® AMT local ports will be closed and remote server connections will be active.<br><br>");0==editEnvironmentDetectionTmp.length&&(c+="<i>No intranet domains, Environemnt detection disabled.</i><br>");for(var a in editEnvironmentDetectionTmp)c+=
1225
"<div class=itemBar style=margin-right:0><div style=float:right>"+AddButton2("Remove","editEnvironmentDetectionRemove("+a+")")+"</div><div style=padding-top:3px;max-width:260px;overflow:hidden title='"+editEnvironmentDetectionTmp[a]+"'><b>"+editEnvironmentDetectionTmp[a]+"</b></div></div>";xxAccountAdminName&&5>editEnvironmentDetectionTmp.length&&(c+="<br><input id=edInput placeholder=intranet.org style=width:276px onkeyup=edInputChg() maxlength=63><input type=button id=edAdd value=Add style=width:80px;margin-left:5px onclick=editEnvironmentDetectionAdd()>");
1226
1==b?QH(64,c):setDialogMode(11,"Environment Detection",xxAccountAdminName?3:1,editEnvironmentDetectionDlg,c);edInputChg()}function editEnvironmentDetectionDlg(){if(xxAccountAdminName){var b=Clone(xxEnvironementDetection);b.DetectionStrings=editEnvironmentDetectionTmp;amtstack.Put("AMT_EnvironmentDetectionSettingData",b,editEnvironmentDetectionDlg2,0,1)}}
@@ -1294,11 +1295,11 @@ function powerActionResponse3(b,c,a,d){console.log("powerActionResponse3("+c+","
1295
function checkConsentDisplay(){amtstack.Get("IPS_SecIOService",checkConsentDisplayResponse1)}var xxchangeConsentDisplay=!1;
1296
function checkConsentDisplayResponse1(b,c,a,d){200==d&&(a.Body.DefaultScreen&&(a.Body.DefaultScreen=parseInt(a.Body.DefaultScreen)),a.Body.NumberOfScreens&&(a.Body.NumberOfScreens=parseInt(a.Body.NumberOfScreens)),1==xxchangeConsentDisplay?(xxchangeConsentDisplay=!1,a.Body.DefaultScreen=d6Display.value,amtstack.Put("IPS_SecIOService",a.Body,checkConsentDisplayResponse1)):(d6Display.value=a.Body.DefaultScreen,QV("d6ThirdDisplay",2<a.Body.NumberOfScreens)))}
1297
var xxStorage=null,xxStorageVendors=[],xxStorageApplications=[];function PullStorage(){amtFirstPull|=8;wsstack.comm.PerformAjax("",PullStorageResponse,null,0,"/amt-storage/","GET")}
1297
-function PullStorageResponse(b,c,a){0==amtstack.PendingBatchOperations&&refreshButtons(!0);if(200==c){QV("go21",!0);for(c=0;32>c;c++){do a=b.length,b=b.replace(String.fromCharCode(c),"");while(a>b.length)}try{xxStorage=JSON.parse(b)}catch(w){return}xxStorageVendors=[];xxStorageApplications=[];b=xxStorage.content;if(Array.isArray(b)){a={};for(c in b){var d=b[c].vendor?b[c].vendor:"";a[d]||(a[d]={});var e=b[c].app?b[c].app:"";a[d][e]||(a[d][e]={});b[c].name&&(a[d][e][b[c].name]=b[c])}xxStorage.content=
1298
-b=a}else{if(b["index.htm"]||b["logon.htm"])b[""]={"":{}};b["index.htm"]&&(b[""][""]["index.htm"]=b["index.htm"],delete b["index.htm"]);b["logon.htm"]&&(b[""][""]["logon.htm"]=b["logon.htm"],delete b["logon.htm"])}a=0;var d=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT storage for this computer.<br><br>",k,l,e="";for(c in b){var u=0,n;for(n in b[c]){u++;var p=0,x;for(x in b[c][n]){p++;if(c!=k||n!=l)""!=e&&(d+=e,e="<br>"),k=c,l=n,e=""!=c?e+EscapeHtml(c+" / "+n):e+
1299
-"Root";var m='"'+c+(""!=c?"/":"")+n+(""!=n?"/":"")+x+'"',e=e+('<div class=itemBar onclick=showStorageDetails("'+c+'","'+n+'","'+x+'",'+m+")><div style=float:right>"),e=e+(" "+AddButton2("Download","DownloadFromStorage("+m+',"'+x+'",event)')),e=e+("</div><div style=padding-top:3px><b>"+EscapeHtml(x)+"</b>, <i>"+b[c][n][x].size+" bytes</i></div></div>");a++;-1==xxStorageVendors.indexOf(c)&&xxStorageVendors.push(c);-1==xxStorageApplications.indexOf(n)&&xxStorageApplications.push(n)}0==p&&(wsstack.comm.PerformAjax("",
1300
-function(){},null,0,"/amt-storage/"+c+"/"+n,"DELETE"),wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE"))}0==u&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE")}""!=e&&(d+=e);0==a&&(d+="<div style=padding-left:15px><br><i>No files found.</i></div><br>");d+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullStorage()")+AddButton("Upload...","UploadToStorage()"));QH(56,d)}else QH(56,"Unable to load storage data...<br/>"+
1301
-AddButton("Refresh","PullStorage()"))}function showStorageDetails(b,c,a,d){if(!xxdialogMode){var e="",k=xxStorage.content[b][c][a];""!=b&&(e+=addHtmlValue("Vendor",b));""!=c&&(e+=addHtmlValue("Application",c));e+=addHtmlValue("Name",a);e+=addHtmlValue("Size",k.size+" bytes");k.link&&(e+=addHtmlValue("Link",k.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,e,d)}}
1298
+function PullStorageResponse(b,c,a){0==amtstack.PendingBatchOperations&&refreshButtons(!0);if(200==c){QV("go21",!0);for(c=0;32>c;c++){do a=b.length,b=b.replace(String.fromCharCode(c),"");while(a>b.length)}try{xxStorage=JSON.parse(b)}catch(v){return}xxStorageVendors=[];xxStorageApplications=[];b=xxStorage.content;if(Array.isArray(b)){a={};for(c in b){var d=b[c].vendor?b[c].vendor:"";a[d]||(a[d]={});var e=b[c].app?b[c].app:"";a[d][e]||(a[d][e]={});b[c].name&&(a[d][e][b[c].name]=b[c])}xxStorage.content=
1299
+b=a}else{if(b["index.htm"]||b["logon.htm"])b[""]={"":{}};b["index.htm"]&&(b[""][""]["index.htm"]=b["index.htm"],delete b["index.htm"]);b["logon.htm"]&&(b[""][""]["logon.htm"]=b["logon.htm"],delete b["logon.htm"])}a=0;var d=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT storage for this computer.<br><br>",q,h,e="";for(c in b){var r=0,n;for(n in b[c]){r++;var m=0,w;for(w in b[c][n]){m++;if(c!=q||n!=h)""!=e&&(d+=e,e="<br>"),q=c,h=n,e=""!=c?e+EscapeHtml(c+" / "+n):e+
1300
+"Root";var k='"'+c+(""!=c?"/":"")+n+(""!=n?"/":"")+w+'"',e=e+('<div class=itemBar onclick=showStorageDetails("'+c+'","'+n+'","'+w+'",'+k+")><div style=float:right>"),e=e+(" "+AddButton2("Download","DownloadFromStorage("+k+',"'+w+'",event)')),e=e+("</div><div style=padding-top:3px><b>"+EscapeHtml(w)+"</b>, <i>"+b[c][n][w].size+" bytes</i></div></div>");a++;-1==xxStorageVendors.indexOf(c)&&xxStorageVendors.push(c);-1==xxStorageApplications.indexOf(n)&&xxStorageApplications.push(n)}0==m&&(wsstack.comm.PerformAjax("",
1301
+function(){},null,0,"/amt-storage/"+c+"/"+n,"DELETE"),wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE"))}0==r&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+c,"DELETE")}""!=e&&(d+=e);0==a&&(d+="<div style=padding-left:15px><br><i>No files found.</i></div><br>");d+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullStorage()")+AddButton("Upload...","UploadToStorage()"));QH(56,d)}else QH(56,"Unable to load storage data...<br/>"+
1302
+AddButton("Refresh","PullStorage()"))}function showStorageDetails(b,c,a,d){if(!xxdialogMode){var e="",q=xxStorage.content[b][c][a];""!=b&&(e+=addHtmlValue("Vendor",b));""!=c&&(e+=addHtmlValue("Application",c));e+=addHtmlValue("Name",a);e+=addHtmlValue("Size",q.size+" bytes");q.link&&(e+=addHtmlValue("Link",q.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,e,d)}}
1303
function showStorageDetailsEx(b,c){2==b&&wsstack.comm.PerformAjax("",storageDeleteResponse,null,0,"/amt-storage/"+c,"DELETE")}function storageDeleteResponse(b,c){200!=c?messagebox("Storage","Unable to delete file (ERR"+c+"), check that the computer is powered on."):PullStorage()}function DownloadFromStorage(b,c,a){xxdialogMode||(haltEvent(a),wsstack.comm.PerformAjax("",DownloadFromStorageEx,c,0,"/amt-storage/"+b,"GET"))}
1304
function DownloadFromStorageEx(b,c,a){200!=c||null==b?console.log(c,"Data = null"):saveAs(data2blob(b),a)}function OpenFromStorage(b,c){if(!xxdialogMode){haltEvent(c);var a=window.open("http://"+wsstack.comm.host+":"+wsstack.comm.port+"/amt-storage/"+b,"_blank");a.opener=null;a.focus()}}function PushToStorage(b,c,a){var d=null;7E3<c.length&&(d=[b,c.substring(7E3)],c=c.substring(0,7E3));wsstack.comm.PerformAjax(c,PushToStorageResponse,d,0,"/amt-storage/"+b+(1==a?"?append=":""),"PUT")}
1305
function PushToStorageResponse(b,c,a){200!=c?messagebox("Storage","Unable to push file (ERR"+c+"), check that the computer is powered on."):null!=a?PushToStorage(a[0],a[1],!0):PullStorage()}
@@ -1308,23 +1309,23 @@ a+='<br><div style=height:16px><input id=mstoragelink style=float:right;width:24
1309
setDialogMode(11,"Storage Upload",3,UploadToStorageEx,a,b);b&&SetStorageName(c)}}function UploadToStorageEx(b,c){if(c)d=new FileReader,d.onload=UploadToStorageEx2,d.filename=Q("mstoragefile").value,d.readAsBinaryString(c);else{var a=Q("mstoragefile");if(1==a.files.length){var d=new FileReader;d.onload=UploadToStorageEx2;d.filename=a.files[0].name;d.readAsBinaryString(a.files[0])}}}
1310
function SetStorageName(b){b||(b=Q("mstoragefile"),b=1==b.files.length?b.files[0].name:"");b=b.split(" ").join("");var c=b.split("-");3==c.length&&12>c[0].length&&12>c[1].length&&(Q("mstoragevendor").value=c[0],Q("mstorageapplication").value=c[1],b=c[2]);b=b.split("-").join("");b.endsWith(".gz")&&(b=b.substring(0,b.length-3));b.endsWith(".htm")||b.endsWith(".html")?Q("mstoragetype").value="text/html":b.endsWith(".txt")&&(Q("mstoragetype").value="text/plain");11<b.length&&(b=b.substring(0,11));Q("mstoragefilename").value=
1311
b}
1311
-function UploadToStorageEx2(b){var c;c=Q("mstoragevendor").value;var a=Q("mstorageapplication").value,d=Q("mstoragefilename").value;""==d&&(d="Filename");var e=Q("mstoragetype").value;""==e&&(e="application/octet-stream");var k=Q("mstoragelink").value;""!=c||""!=a||"logon.htm"!=d.toLowerCase()&&"index.htm"!=d.toLowerCase()?(""==c&&(c="Vendor"),""==a&&(a="App"),c=c+"/"+a+"/"+d):c=d.toLowerCase();a="<metadata><headers>";d=b.target.filename;d||(d=Q("mstoragefile").files[0].name);d.endsWith(".gz")&&(a+=
1312
-"<h>Content-Encoding: gzip</h>");a+="<h>Content-Type: "+e+"</h></headers>";""!=k&&(a+="<link>"+k+"</link>");a+="</metadata>"+b.target.result;PushToStorage(c,a)}function _fmtdatetime(b){return b.replace("T"," ").replace("Z","")}
1312
+function UploadToStorageEx2(b){var c;c=Q("mstoragevendor").value;var a=Q("mstorageapplication").value,d=Q("mstoragefilename").value;""==d&&(d="Filename");var e=Q("mstoragetype").value;""==e&&(e="application/octet-stream");var q=Q("mstoragelink").value;""!=c||""!=a||"logon.htm"!=d.toLowerCase()&&"index.htm"!=d.toLowerCase()?(""==c&&(c="Vendor"),""==a&&(a="App"),c=c+"/"+a+"/"+d):c=d.toLowerCase();a="<metadata><headers>";d=b.target.filename;d||(d=Q("mstoragefile").files[0].name);d.endsWith(".gz")&&(a+=
1313
+"<h>Content-Encoding: gzip</h>");a+="<h>Content-Type: "+e+"</h></headers>";""!=q&&(a+="<link>"+q+"</link>");a+="</metadata>"+b.target.result;PushToStorage(c,a)}function _fmtdatetime(b){return b.replace("T"," ").replace("Z","")}
1314
function _fmtinterval(b){b=b.replace("T","").substring(b.indexOf("P")+1);b=" "+b.replace("D"," days ").replace("H"," hours ").replace("M"," minutes ");b=b.replace(" 1 days "," 1 day ").replace(" 1 hours "," 1 hour ").replace(" 1 minutes "," 1 minute ");return b.substring(0,b.length-1)}function _fmttimepad(b){for(b=""+b;2>b.length;)b="0"+b;return b}
1315
function convertAmtDataStr(b){b=b.split("Z").join("").split("T").join("-").split(":").join("-").split("-");return new Date(b[0],b[1],b[2],b[3],b[4],b[5])}var xxAlarms=null;
1316
function PullAlarms(){var b=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage wake alarms.<br><br>";amtstack.Enum("IPS_AlarmClockOccurrence",function(c,a,d,e){if(200==e){QV("go23",!0);if(0<d.length)for(xxAlarms=d,c=0;c<d.length;c++)a=convertAmtDataStr(d[c].StartTime.Datetime),a="<b>"+d[c].ElementName+"</b>, wake on "+a.toLocaleString().replace(", "," at "),void 0!=d[c].Interval&&(a+=" and each"+_fmtinterval(d[c].Interval.Interval)),1==d[c].DeleteOnCompletion&&(a+=", delete when done"),
1317
b+="<div class=itemBar onclick=showAlertDetails("+c+")><div style=float:right>",xxAccountAdminName&&(b+=" "+AddButton2("Edit...","showAddAlarm("+c+")")),b+="</div><div style=padding-top:3px;width:auto;float:left;overflow-x:hidden>"+a+"</div></div>";else xxAlarms=null,b+="<div style=padding-left:15px><br><i>No wake alarms registered.</i></div><br>";d="<div> "+AddRefreshButton("PullAlarms()");xxAccountAdminName&&(d+=AddButton("Remove all alarms","RemoveAllAlarms()")+AddButton("Add","showAddAlarm()"));
1318
b+="<br><td class=r1>"+TableEnd(d+"</div>");QH(58,b)}},null,!0)}
1319
function prepareAlarmOccurenceTemplate(b,c,a,d,e){return'<d:AlarmTemplate xmlns:d="http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService" xmlns:s="http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence"><s:InstanceID>'+b+'</s:InstanceID><s:StartTime><p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+a+'</p:Datetime></s:StartTime><s:Interval><p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+d+"</p:Interval></s:Interval><s:DeleteOnCompletion>"+
1319
-e+"</s:DeleteOnCompletion></d:AlarmTemplate>"}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var b=xxAlarms.length,c;for(c in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,c,e,k){0==--b&&PullAlarms()})}
1320
+e+"</s:DeleteOnCompletion></d:AlarmTemplate>"}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var b=xxAlarms.length,c;for(c in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,c,e,q){0==--b&&PullAlarms()})}
1321
function showAddAlarm(b){if(!xxdialogMode){QE("d25alarm_name",!b);if(void 0!=b){var c=xxAlarms[b],a=convertAmtDataStr(c.StartTime.Datetime);Q("d25alarm_name").value=c.ElementName;Q("d25alarm_sdate").value=a.getFullYear()+"-"+_fmttimepad(a.getMonth()+1)+"-"+_fmttimepad(a.getDate());Q("d25alarm_stime").value=a.getHours()+":"+_fmttimepad(a.getMinutes())+":"+_fmttimepad(a.getSeconds());if(c.Interval){var a=c.Interval.Interval.replace("P","").replace("T","").replace("D","D,").replace("H","H,").replace("M",
1321
-"M,").split(","),d=[0,0,0],e;for(e in a){var k=a[e].length-1;"D"==a[e][k]&&(d[0]=parseInt(a[e].substring(0,k)));"H"==a[e][k]&&(d[1]=parseInt(a[e].substring(0,k)));"M"==a[e][k]&&(d[2]=parseInt(a[e].substring(0,k)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==c.DeleteOnCompletion?1:0}else c=new Date,c.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=c.getFullYear()+"-"+_fmttimepad(c.getMonth()+1)+"-"+_fmttimepad(c.getDate()),
1322
+"M,").split(","),d=[0,0,0],e;for(e in a){var q=a[e].length-1;"D"==a[e][q]&&(d[0]=parseInt(a[e].substring(0,q)));"H"==a[e][q]&&(d[1]=parseInt(a[e].substring(0,q)));"M"==a[e][q]&&(d[2]=parseInt(a[e].substring(0,q)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==c.DeleteOnCompletion?1:0}else c=new Date,c.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=c.getFullYear()+"-"+_fmttimepad(c.getMonth()+1)+"-"+_fmttimepad(c.getDate()),
1323
Q("d25alarm_stime").value=c.getHours()+":"+_fmttimepad(c.getMinutes())+":00",Q("d25alarm_interval").value="",Q("d25alarm_doc").value=0;setDialogMode(25,"Add new alarm",void 0!=b?7:3,showAddAlarmOk,"",b);alertDialogUpdate()}}function alertDialogUpdate(){var b=Q("d25alarm_interval").value.split("-").length,b=0<Q("d25alarm_name").value.length&&3==Q("d25alarm_sdate").value.split("-").length&&3==Q("d25alarm_stime").value.split(":").length&&(1==b||3==b);QE("c48",b)}
1324
function showAddAlarmOk(b,c){if(2==b)showAlertDetailsDelete(b,c);else{var a=Q("d25alarm_name").value,d=Q("d25alarm_sdate").value.split("-"),e=Q("d25alarm_stime").value.split(":"),d=new Date(d[0],d[1]-1,d[2],e[0],e[1],e[2],0),d=_fmttimepad(d.getFullYear())+"-"+_fmttimepad(d.getMonth()+1)+"-"+_fmttimepad(d.getDate())+"T"+_fmttimepad(d.getHours())+":"+_fmttimepad(d.getMinutes())+":"+_fmttimepad(d.getSeconds())+"Z",e=Q("d25alarm_interval").value.split("-");3!=e.length&&(e=[0,0,0]);var e="P"+e[0]+"DT"+
1324
-e[1]+"H"+e[2]+"M",k=1==Q("d25alarm_doc").value,a=prepareAlarmOccurenceTemplate(a,a,d,e,k);void 0==c?wsstack.ExecMethodXml(amtstack.CompleteName("AMT_AlarmClockService"),"AddAlarm",a,function(a,b,c,d){200!=d?messagebox("Add alarm","Failed to add alarm. Status: "+d+".<br/>Verify the alarm is for a future time."):0!=c.Body.ReturnValue?messagebox("Add alarm","Failed to add alarm, "+c.Body.ReturnValueStr+".<br/>Verify the alarm is for a future time."):PullAlarms()}):(a=Clone(xxAlarms[c]),a.StartTime='<p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+
1325
-d+"</p:Datetime>",a.Interval='<p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+e+"</p:Interval>",a.DeleteOnCompletion=k,amtstack.Put("IPS_AlarmClockOccurrence",a,function(a,b,c,d){200!=d?messagebox("Edit alarm","Failed to change alarm. Status: "+d+".<br/>Verify the alarm for at a future time."):PullAlarms()},null,null,{InstanceID:a.InstanceID}))}}
1325
+e[1]+"H"+e[2]+"M",q=1==Q("d25alarm_doc").value,a=prepareAlarmOccurenceTemplate(a,a,d,e,q);void 0==c?wsstack.ExecMethodXml(amtstack.CompleteName("AMT_AlarmClockService"),"AddAlarm",a,function(a,b,c,d){200!=d?messagebox("Add alarm","Failed to add alarm. Status: "+d+".<br/>Verify the alarm is for a future time."):0!=c.Body.ReturnValue?messagebox("Add alarm","Failed to add alarm, "+c.Body.ReturnValueStr+".<br/>Verify the alarm is for a future time."):PullAlarms()}):(a=Clone(xxAlarms[c]),a.StartTime='<p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+
1326
+d+"</p:Datetime>",a.Interval='<p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+e+"</p:Interval>",a.DeleteOnCompletion=q,amtstack.Put("IPS_AlarmClockOccurrence",a,function(a,b,c,d){200!=d?messagebox("Edit alarm","Failed to change alarm. Status: "+d+".<br/>Verify the alarm for at a future time."):PullAlarms()},null,null,{InstanceID:a.InstanceID}))}}
1327
function showAlertDetails(b){if(!xxdialogMode){var c=xxAlarms[b],a=convertAmtDataStr(c.StartTime.Datetime),a="<div style=text-align:left>"+addHtmlValue("Name",c.ElementName)+addHtmlValue("Wake time",a.toLocaleString().replace(", "," at "));void 0!=c.Interval&&(a+=addHtmlValue("Internal",_fmtinterval(c.Interval.Interval)));a+=addHtmlValue("After wake",1==c.DeleteOnCompletion?"Delete Alarm":"Keep Alarm")+"</div>";messagebox("Alarm "+c.ElementName,a);setDialogMode(11,"Alarm "+c.ElementName,5,showAlertDetailsDelete,
1327
-a,b)}}function showAlertDetailsDelete(b,c){2==b&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,b,c,k){PullAlarms()})}function script_runScriptDlg(){xxdialogMode||scriptstate||setDialogMode(11,"Run Script",3,script_runScriptDlgOk,"<br><input id=scriptopen type=file style=width:100% accept=.mescript>")}function script_runScriptDlgOk(b){if(1==b&&(b=Q("scriptopen"),1==b.files.length)){var c=new FileReader;c.onload=script_onScriptRead;c.readAsBinaryString(b.files[0])}}
1328
+a,b)}}function showAlertDetailsDelete(b,c){2==b&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[c],function(a,b,c,q){PullAlarms()})}function script_runScriptDlg(){xxdialogMode||scriptstate||setDialogMode(11,"Run Script",3,script_runScriptDlgOk,"<br><input id=scriptopen type=file style=width:100% accept=.mescript>")}function script_runScriptDlgOk(b){if(1==b&&(b=Q("scriptopen"),1==b.files.length)){var c=new FileReader;c.onload=script_onScriptRead;c.readAsBinaryString(b.files[0])}}
1329
function script_onScriptRead(b){var c;try{c=JSON.parse(b.target.result)}catch(e){}if(20==currentView){c.scriptText&&(Q("scriptarea").value=c.scriptText);c.mescript&&(Q("compiledarea").value=rstr2hex(atob(c.mescript)));c.blocks?(script_setBuildBlocks(c.blocks),scriptViewButton(1)):(script_setBuildBlocks(),scriptViewButton(0));c.scriptBlocks?script_BlockScript=c.scriptBlocks:script_BuildingBlocks||(script_BlockScript=[]);for(var a in script_BlockScript)if(c=script_BlockScript[a],b=script_BuildingBlocks[c.xname]){b=
1330
Clone(b);b.id=c.id;b.xname=c.xname;for(var d in b.vars)c.vars[d]&&(b.vars[d].value=c.vars[d].value);script_BlockScript[a]=b}fupdatescript();delete scriptstate;resetScriptButton()}else a={_interactive:1,_certificates:1,_mode:"Firmware"},c&&c.mescript&&(scriptstate=script_setup(atob(c.mescript),a)),scriptstate?(scriptstate.wsstack=wsstack,scriptstate.amtstack=amtstack,scriptstate.onStep=script_updateScriptState,scriptstate.onConsole=script_console,scriptstate.start(100)):messagebox("Run Script","Invalid script file.")}
1331
function script_updateScriptState(){scriptstate&&(QV(11,0<scriptstate.state),center(),0==scriptstate.state&&(scriptstate=void 0))}function script_console(b){0==b.indexOf("INFO: ")&&(b=b.substring(6));0==b.indexOf("SUCCESS: ")&&(b=b.substring(9));0==b.indexOf("ERROR: ")&&(b=b.substring(7));QH(12,", "+b)}function script_Stop(){scriptstate&&(1==scriptstate.dialog&&setDialogMode(0),scriptstate.stop(),scriptstate.state=0,script_updateScriptState())}
@@ -1333,21 +1334,21 @@ function scriptLoadStartingBlocks(){var b=new XMLHttpRequest;b.onload=function()
1334
function scriptViewButton(b){script_BuilderView=b;QV("scripteditor",0==b);QV("scriptbuilder",1==b);QV("viewEditorButton",script_BuildingBlocks&&1==b);QV("viewBuilderButton",script_BuildingBlocks&&0==b)}
1335
function script_setBuildBlocks(b){script_BuildingBlocks=b;var c="";if(b)for(var a in b)95!=a.charCodeAt(0)&&(c+="<div id=sblock_"+a+' style=cursor:pointer;background-color:#ccc;width:auto;padding:5px;margin:2px ondblclick=script_faddblock("'+a+'") draggable=true ondragstart=script_fondragstart(event,this) ondragend=script_fondragend(event,this) title="'+b[a].desc+'"',c+=">"+b[a].name+"</div>");QH("blocks",c);script_fonfilterchanged();scriptViewButton(script_BuildingBlocks?1:0)}
1336
function script_faddblock(b){var c=Clone(script_BuildingBlocks[b]);c.id=Math.random();c.xname=b;script_BlockScript.push(c);script_BlockScriptSelectedId=script_BlockScript.length-1;fupdatescript()}function script_feditblock(b){xxdialogMode||setDialogMode(11,"Edit "+script_BuildingBlocks[b].name,3,script_feditblockEx,"Edit this block? This operation will reset the block editor and load the block code into the code editor.",b)}
1336
-function script_feditblockEx(b,c){script_newScriptDlgOk();scriptViewButton(0);var a,d=script_BuildingBlocks[c];a=""+("##!BLOCK!##\r\n#id="+c+"\r\n#name="+d.name+"\r\n#desc="+d.desc+"\r\n##!BLOCK!##\r\n");for(var e in d.vars){var k=d.vars[e];a+="##!VAR!##\r\n#id="+e+"\r\n#name="+k.name+"\r\n#desc="+k.desc+"\r\n#type="+k.type+"\r\n";k.maxlength&&(a+="#maxlength="+k.maxlength+"\r\n");if(k.values)for(var l in k.values)a+="#values-"+l+"="+k.values[l]+"\r\n";a+="#value="+k.value+"\r\n##SWAP %%%"+e+"%%% "+
1337
-k.value+"\r\n"}a+="##!VAR!##\r\n##SWAP %%%~%%% 0\r\n\r\n##!BLOCK!##\r\n"+d.code+"\r\n##!BLOCK!##\r\n";Q("scriptarea").value=a}
1338
-function script_fConvertScriptToJsonBlock(b){var c={};b=b.split("##!BLOCK!##\n");var a=b[1].split("\n"),d;for(d in a){var e=a[d].split("=");2==e.length&&(c[e[0].substring(1)]=e[1])}c.vars={};scriptvariables=b[2].split("##!VAR!##\n");for(d in scriptvariables){var a=scriptvariables[d].split("\n"),k={},l={},u=0,n;for(n in a)e=a[n].split("="),2==e.length&&e[1]&&e[0]&&0<e[0].length&&("#values-"==e[0].substring(0,8)?(l[e[0].substring(8)]=e[1],u++):k[e[0].substring(1)]=e[1]);k.id&&(0<u&&(k.values=l),a=k.id,
1339
-delete k.id,c.vars[a]=k)}c.code=b[3];a=c.id;delete c.id;d={};d[a]=c;return JSON.stringify(d,null," ")}function script_fonfilterchanged(){var b=Q("blockfilter").value.toLowerCase(),c;for(c in script_BuildingBlocks)95!=c.charCodeAt(0)&&QV("sblock_"+c,0<=script_BuildingBlocks[c].name.toLowerCase().indexOf(b)||0<=script_BuildingBlocks[c].desc.toLowerCase().indexOf(b))}var script_fonclickDblClickDetectIndex=null,script_fonclickDblClickDetectTime=null;
1337
+function script_feditblockEx(b,c){script_newScriptDlgOk();scriptViewButton(0);var a,d=script_BuildingBlocks[c];a=""+("##!BLOCK!##\r\n#id="+c+"\r\n#name="+d.name+"\r\n#desc="+d.desc+"\r\n##!BLOCK!##\r\n");for(var e in d.vars){var q=d.vars[e];a+="##!VAR!##\r\n#id="+e+"\r\n#name="+q.name+"\r\n#desc="+q.desc+"\r\n#type="+q.type+"\r\n";q.maxlength&&(a+="#maxlength="+q.maxlength+"\r\n");if(q.values)for(var h in q.values)a+="#values-"+h+"="+q.values[h]+"\r\n";a+="#value="+q.value+"\r\n##SWAP %%%"+e+"%%% "+
1338
+q.value+"\r\n"}a+="##!VAR!##\r\n##SWAP %%%~%%% 0\r\n\r\n##!BLOCK!##\r\n"+d.code+"\r\n##!BLOCK!##\r\n";Q("scriptarea").value=a}
1339
+function script_fConvertScriptToJsonBlock(b){var c={};b=b.split("##!BLOCK!##\n");var a=b[1].split("\n"),d;for(d in a){var e=a[d].split("=");2==e.length&&(c[e[0].substring(1)]=e[1])}c.vars={};scriptvariables=b[2].split("##!VAR!##\n");for(d in scriptvariables){var a=scriptvariables[d].split("\n"),q={},h={},r=0,n;for(n in a)e=a[n].split("="),2==e.length&&e[1]&&e[0]&&0<e[0].length&&("#values-"==e[0].substring(0,8)?(h[e[0].substring(8)]=e[1],r++):q[e[0].substring(1)]=e[1]);q.id&&(0<r&&(q.values=h),a=q.id,
1340
+delete q.id,c.vars[a]=q)}c.code=b[3];a=c.id;delete c.id;d={};d[a]=c;return JSON.stringify(d,null," ")}function script_fonfilterchanged(){var b=Q("blockfilter").value.toLowerCase(),c;for(c in script_BuildingBlocks)95!=c.charCodeAt(0)&&QV("sblock_"+c,0<=script_BuildingBlocks[c].name.toLowerCase().indexOf(b)||0<=script_BuildingBlocks[c].desc.toLowerCase().indexOf(b))}var script_fonclickDblClickDetectIndex=null,script_fonclickDblClickDetectTime=null;
1341
function script_fonclick(b,c){if(!xxdialogMode){script_BlockScriptSelectedId=null;c&&(c=fgetParentWithId(c),c.id.startsWith("xblock_")&&(script_BlockScriptSelectedId=c.id.substring(7)));fupdatescript();haltEvent(b);if(script_fonclickDblClickDetectIndex==script_BlockScriptSelectedId&&250>(new Date).getTime()-script_fonclickDblClickDetectTime)return script_foneditclick(script_BlockScriptSelectedId);script_fonclickDblClickDetectIndex=script_BlockScriptSelectedId;script_fonclickDblClickDetectTime=(new Date).getTime()}}
1342
function script_fondragstart(b,c){xxdialogMode||(c=fgetParentWithId(c),c.style.opacity="0.4",b.dataTransfer.effectAllowed="move",b.dataTransfer.setData("scriptbuilder/block",c.id))}function script_fondragend(b,c){xxdialogMode||(c=fgetParentWithId(c),c.style.opacity="1.0")}function script_fondragenter(b,c){xxdialogMode||(fgetParentWithId(c).style["border-top"]="solid 2px black")}
1343
function script_fondragleave(b,c){if(!xxdialogMode){b=b.originalEvent||b;var a=document.elementFromPoint(b.pageX,b.pageY);c.contains(a)||(fgetParentWithId(c).style["border-top"]="none")}}
1344
function script_fondrop(b,c){if(!xxdialogMode){c=fgetParentWithId(c);var a,d=b.dataTransfer.getData("scriptbuilder/block"),e=parseInt(c.id.substring(7));""==d?documentFileSelectHandler(b):(d.startsWith("sblock_")?(a=Clone(script_BuildingBlocks[d.substring(7)]),a.id=Math.random(),a.xname=d.substring(7)):(d=parseInt(d.substring(7)),a=script_BlockScript[d],script_BlockScript.splice(d,1),e>d&&e--),"scriptblocks"==c.id?(a&&script_BlockScript.push(a),script_BlockScriptSelectedId=script_BlockScript.length-
1345
1):(script_BlockScript.splice(e,0,a),script_BlockScriptSelectedId=e),fupdatescript(),haltEvent(b))}}
1345
-function script_foneditclick(b){if(!xxdialogMode){var c=script_BlockScript[b];script_BlockScriptSelectedId=b;fupdatescript();if(null!=c){var a=c.vars?7:5,d=c.desc+"<br><br>";if(c.vars)for(var e in c.vars){var k=c.vars[e].value,l="";c.vars[e].maxlength&&(l+=" maxlength="+c.vars[e].maxlength);2==c.vars[e].type&&(l+=" onkeypress='return numbersOnly(event)'");if(1==c.vars[e].type||2==c.vars[e].type)k="<input title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" value='"+c.vars[e].value+"' "+l+" style=width:100%></input>";
1346
-if(3==c.vars[e].type){var k="<select title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" style=width:100%;padding:0;margin:0>",u;for(u in c.vars[e].values)k+="<option value="+u+(u==c.vars[e].value?" selected":"")+">"+c.vars[e].values[u]+"</option>";k+="</select>"}4==c.vars[e].type&&(k="<input type=password autocomplete=off title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" value='"+c.vars[e].value+"' "+l+" style=width:100%></input>");5==c.vars[e].type&&(k="");6==c.vars[e].type&&(k="<input type=file title='"+
1347
-c.vars[e].desc+"' id=scriptXvalue_"+e+" "+l+" style=width:100%></input>");d+='<table style=width:100% title="'+c.vars[e].desc+'"><td style=width:120px>'+c.vars[e].name+"<td><b>"+k+"</b></table>";if(5==c.vars[e].type){var d=d+("<ul id=scriptXvalue_"+e+' style="list-style-type:none;height:100px;overflow:auto;width:100%;border:1px solid #000;background-color:white;overflow-x:hidden;margin:0;padding:0">'),n;for(n in c.vars[e].values)k="",0<=c.vars[e].value.indexOf(n)&&(k=" checked"),d+="<li><label><input type=checkbox id=scriptXvaluex_"+
1348
-e+"-"+n+""+k+">"+c.vars[e].values[n]+"</label></li>";d+="</ul>"}}}setDialogMode(11,c.name,a,script_foneditclickEx,d,b)}}
1349
-function script_foneditclickEx(b,c){if(!xxdialogMode){if(2==b)script_BlockScript.splice(c,1),script_BlockScriptSelectedId==c&&(script_BlockScriptSelectedId=null);else{var a=script_BlockScript[c];if(a.vars)for(var d in a.vars)if(5==a.vars[d].type){a.vars[d].value=[];for(var e in a.vars[d].values)Q("scriptXvaluex_"+d+"-"+e).checked&&a.vars[d].value.push(e)}else if(6==a.vars[d].type){var k=Q("scriptXvalue_"+d);if(1==k.files.length){var l=new FileReader;l.onload=function(b){a.vars[d].value=btoa(b.target.result);
1350
-fupdatescript()};l.readAsBinaryString(k.files[0])}}else a.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(b){for(;!b.id;)b=b.parentElement;return b}
1346
+function script_foneditclick(b){if(!xxdialogMode){var c=script_BlockScript[b];script_BlockScriptSelectedId=b;fupdatescript();if(null!=c){var a=c.vars?7:5,d=c.desc+"<br><br>";if(c.vars)for(var e in c.vars){var q=c.vars[e].value,h="";c.vars[e].maxlength&&(h+=" maxlength="+c.vars[e].maxlength);2==c.vars[e].type&&(h+=" onkeypress='return numbersOnly(event)'");if(1==c.vars[e].type||2==c.vars[e].type)q="<input title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" value='"+c.vars[e].value+"' "+h+" style=width:100%></input>";
1347
+if(3==c.vars[e].type){var q="<select title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" style=width:100%;padding:0;margin:0>",r;for(r in c.vars[e].values)q+="<option value="+r+(r==c.vars[e].value?" selected":"")+">"+c.vars[e].values[r]+"</option>";q+="</select>"}4==c.vars[e].type&&(q="<input type=password autocomplete=off title='"+c.vars[e].desc+"' id=scriptXvalue_"+e+" value='"+c.vars[e].value+"' "+h+" style=width:100%></input>");5==c.vars[e].type&&(q="");6==c.vars[e].type&&(q="<input type=file title='"+
1348
+c.vars[e].desc+"' id=scriptXvalue_"+e+" "+h+" style=width:100%></input>");d+='<table style=width:100% title="'+c.vars[e].desc+'"><td style=width:120px>'+c.vars[e].name+"<td><b>"+q+"</b></table>";if(5==c.vars[e].type){var d=d+("<ul id=scriptXvalue_"+e+' style="list-style-type:none;height:100px;overflow:auto;width:100%;border:1px solid #000;background-color:white;overflow-x:hidden;margin:0;padding:0">'),n;for(n in c.vars[e].values)q="",0<=c.vars[e].value.indexOf(n)&&(q=" checked"),d+="<li><label><input type=checkbox id=scriptXvaluex_"+
1349
+e+"-"+n+""+q+">"+c.vars[e].values[n]+"</label></li>";d+="</ul>"}}}setDialogMode(11,c.name,a,script_foneditclickEx,d,b)}}
1350
+function script_foneditclickEx(b,c){if(!xxdialogMode){if(2==b)script_BlockScript.splice(c,1),script_BlockScriptSelectedId==c&&(script_BlockScriptSelectedId=null);else{var a=script_BlockScript[c];if(a.vars)for(var d in a.vars)if(5==a.vars[d].type){a.vars[d].value=[];for(var e in a.vars[d].values)Q("scriptXvaluex_"+d+"-"+e).checked&&a.vars[d].value.push(e)}else if(6==a.vars[d].type){var q=Q("scriptXvalue_"+d);if(1==q.files.length){var h=new FileReader;h.onload=function(b){a.vars[d].value=btoa(b.target.result);
1351
+fupdatescript()};h.readAsBinaryString(q.files[0])}}else a.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(b){for(;!b.id;)b=b.parentElement;return b}
1352
function fupdatescript(){var b="",c;for(c in script_BlockScript){b+="<div id=xblock_"+c+" style=cursor:pointer;min-height:24px;background-color:#"+(script_BlockScriptSelectedId==c?"aaa":"ccc")+';width:auto;padding:5px;margin:2px draggable=true onclick=script_fonclick(event,this) ondragenter=script_fondragenter(event,this) ondragleave=script_fondragleave(event,this) ondragstart=script_fondragstart(event,this) ondragend=script_fondragend(event,this) ondrop=script_fondrop(event,this) title="'+script_BlockScript[c].desc+
1353
'"';b+="><input style=float:right type=button value=Edit... onclick=script_foneditclick("+c+")><div style=font-size:16px><b>"+script_BlockScript[c].name+"</b>";if(script_BlockScript[c].vars){var a=0,b=b+"<table class='scriptBlockVar us' cellpadding=0 cellspacing=0 style=width:100%;border-radius:5px;margin-top:8px>",d;for(d in script_BlockScript[c].vars){var e=script_BlockScript[c].vars[d].value;4==script_BlockScript[c].vars[d].type&&0<script_BlockScript[c].vars[d].value.length&&(e="*****");3==script_BlockScript[c].vars[d].type&&
1354
(e=script_BlockScript[c].vars[d].values[script_BlockScript[c].vars[d].value]);6==script_BlockScript[c].vars[d].type&&(e=script_BlockScript[c].vars[d].value?"Binary file, "+script_BlockScript[c].vars[d].value.length+" bytes":"Not set");b+="<tr title='"+script_BlockScript[c].vars[d].desc+"'><td width=200px style='"+(0<a?"border-top:1px solid #a810a8":"")+"'><p>"+script_BlockScript[c].vars[d].name+"<td style='"+(0<a?"border-top:1px solid #a810a8":"")+"'>"+e;a++}b+="<tr><td style=height:3px></table>"}b+=
@@ -1362,16 +1363,16 @@ function editscript_updateScriptState(b){var c="";if(b&&null!=b){var a=[],d;for(
1363
50)+"...");QH("EditScriptStatus",c)}function script_toString(b){return"object"==typeof b?JSON.stringify(b):b}
1364
function script_saveScript(b){xxdialogMode||scriptstate||(b&&1==b.shiftKey?(setDialogMode(11,"Script Block",1,null,"<br><textarea id=scriptSaveScriptJsonBlock style=width:100%;height:200px;resize:vertical />"),QH("scriptSaveScriptJsonBlock",script_fConvertScriptToJsonBlock(Q("scriptarea").value))):setDialogMode(11,"Save Script",3,script_saveScriptOk,"<br><input id=scriptsavename style=width:100% value=test.mescript >"))}
1365
function script_saveScriptOk(){if(!xxdialogMode){var b=JSON.stringify({scriptText:Q("scriptarea").value,mescript:btoa(script_compile(Q("scriptarea").value)),blocks:script_StartingBuildingBlocks,scriptBlocks:script_BlockScript},null," ");saveAs(data2blob(b),Q("scriptsavename").value)}}var xxdialogMode,xxdialogFunc,xxdialogButtons,xxdialogTag;
1365
-function setDialogMode(b,c,a,d,e,k){xxdialogMode=b;xxdialogFunc=d;xxdialogButtons=a;xxdialogTag=k;QE("c48",!0);QV("c48",a&1);QV("c47",a&2);QV(59,a&2);QV("c49",a&4);c&&QH(60,c);for(c=1;26>c;c++)QV("dialog"+c,c==b);QV("dialog",b);e&&(11==b?QH(64,e):QH(61,e));0!=xxdialogMode&&iderToggleDiskMap(!1)}
1366
+function setDialogMode(b,c,a,d,e,q){xxdialogMode=b;xxdialogFunc=d;xxdialogButtons=a;xxdialogTag=q;QE("c48",!0);QV("c48",a&1);QV("c47",a&2);QV(59,a&2);QV("c49",a&4);c&&QH(60,c);for(c=1;26>c;c++)QV("dialog"+c,c==b);QV("dialog",b);e&&(11==b?QH(64,e):QH(61,e));0!=xxdialogMode&&iderToggleDiskMap(!1)}
1367
function dialogclose(b){var c=xxdialogFunc,a=xxdialogButtons,d=xxdialogTag;setDialogMode();(a&8||b)&&c&&c(b,d)}
1368
function center(){QS("dialog").left=(getDocWidth()-400)/2+"px";var b=0,c=Q(8).offsetHeight-(0==fullscreen?126:53);""==QS(11).display&&(b+=32);""==QS(9).display&&(b+=32);QS(16).height=Q(8).offsetHeight-b-(0==fullscreen?16:0)+"px";QS("Desk")["max-height"]=c-b+"px";QS("Desk")["max-width"]=Q(8).offsetWidth-(0==fullscreen?32:0)+"px";0!=Q(43).offsetWidth&&(QS("Desk")["max-width"]=Q(43).offsetWidth);
1369
fullscreen?(QS(16)["overflow-y"]="hidden",b=(c-b-Q("Desk").offsetHeight)/2,QS("Desk")["margin-top"]=b+"px",QS("Desk")["margin-bottom"]=b+"px"):(QS(16)["overflow-y"]="scroll",QS("Desk")["margin-top"]="0",QS("Desk")["margin-bottom"]="0")}function messagebox(b,c){QH(61,c);setDialogMode(1,b,1)}function statusbox(b,c){QH(61,c);setDialogMode(1,b)}
1369
-function SaveJsonFile(b,c,a,d){var e="",k={},l=new Date;amtsysstate&&(e="-"+amtsysstate.AMT_GeneralSettings.response.HostName,k={webappversion:version,description:a,hostname:amtsysstate.AMT_GeneralSettings.response.HostName,localtime:Date(),utctime:(new Date).toUTCString(),isotime:(new Date).toISOString()},HardwareInventory&&(k.systemid=guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));e+="-"+l.getFullYear()+"-"+("0"+(l.getMonth()+1)).slice(-2)+"-"+("0"+
1370
-l.getDate()).slice(-2)+"-"+("0"+l.getHours()).slice(-2)+"-"+("0"+l.getMinutes()).slice(-2);k[c]=d;saveAs(data2blob(JSON.stringify(k,null," ").replace(/\n/g,"\r\n")),b+e+".json")}var httpErrorTable={200:"OK",401:"Authentication Error",408:"Timeout Error",601:"WSMAN Parsing Error",602:"Unable to parse HTTP response header",603:"Unexpected HTTP enum response",604:"Unexpected HTTP pull response",997:"Invalid Digest Realm"};
1370
+function SaveJsonFile(b,c,a,d){var e="",q={},h=new Date;amtsysstate&&(e="-"+amtsysstate.AMT_GeneralSettings.response.HostName,q={webappversion:version,description:a,hostname:amtsysstate.AMT_GeneralSettings.response.HostName,localtime:Date(),utctime:(new Date).toUTCString(),isotime:(new Date).toISOString()},HardwareInventory&&(q.systemid=guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));e+="-"+h.getFullYear()+"-"+("0"+(h.getMonth()+1)).slice(-2)+"-"+("0"+
1371
+h.getDate()).slice(-2)+"-"+("0"+h.getHours()).slice(-2)+"-"+("0"+h.getMinutes()).slice(-2);q[c]=d;saveAs(data2blob(JSON.stringify(q,null," ").replace(/\n/g,"\r\n")),b+e+".json")}var httpErrorTable={200:"OK",401:"Authentication Error",408:"Timeout Error",601:"WSMAN Parsing Error",602:"Unable to parse HTTP response header",603:"Unexpected HTTP enum response",604:"Unexpected HTTP pull response",997:"Invalid Digest Realm"};
1372
function errcheck(b,c){if(null==wsstack||amtstack!=c)return!0;200!=b&&9!=b&&(setDialogMode(),wsstack.comm.FailAllError=999,amtstack.CancelAllQueries(999),QH(5,httpErrorTable[b]?httpErrorTable[b]:"Error #"+b),401==b&&QH(5,'Authentication Error<br /><br /><input type=button value="Set new credentials" onclick=meshcentral2credCallback(true)></input>'),go(100),QS(3).width=0);return 200!=b}
1373
function goiFrame(b,c,a){if(!xxdialogMode){go(c);if(1==b.shiftKey||0==Q(15).src.endsWith(a))Q(15).src=a;QV(16,!1);QV(14,!0)}}function go(b,c){if(!xxdialogMode||1==c){QV(14,!1);QV(16,!0);QV(4,100==b);QV(6,100>b);for(var a=0;80>a;a++){QV("p"+a,a==b);var d=QS("go"+a);d&&(d["background-color"]=a==b?"#abcae1":"");d&&(d["background-color"]=a==b?"gray":"")}currentView=b;center()}}
1374
function portsFromHost(b,c){var a=decodeURIComponent(b).split(":"),d=0==c?16992:16993,e=0==c?16994:16995;1<a.length&&(d=parseInt(a[1]));2<a.length&&(e=parseInt(a[2]));return{host:a[0],http:d,redir:e}}function addLink(b,c){return"<a style=cursor:pointer;color:blue onclick='"+c+"'>♦ "+b+"</a>"}function addLinkConditional(b,c,a){return a?addLink(b,c):b}function haltEvent(b){b.preventDefault&&b.preventDefault();b.stopPropagation&&b.stopPropagation();return!1}
1374
-function addOption(b,c,a){var d=document.createElement("option");d.text=c;d.value=a;Q(b).add(d)}function addDisabledOption(b,c,a){var d=document.createElement("option");d.text=c;d.value=a;d.disabled=1;Q(b).add(d)}function passwordcheck(b){if(8>b.length)return!1;var c=0,a=0,d=0,e=0,k;for(k in b){var l=b.charCodeAt(k);64<l&&91>l?c=1:96<l&&123>l?a=1:47<l&&58>l?d=1:e=1}return 4==c+a+d+e}
1375
+function addOption(b,c,a){var d=document.createElement("option");d.text=c;d.value=a;Q(b).add(d)}function addDisabledOption(b,c,a){var d=document.createElement("option");d.text=c;d.value=a;d.disabled=1;Q(b).add(d)}function passwordcheck(b){if(8>b.length)return!1;var c=0,a=0,d=0,e=0,q;for(q in b){var h=b.charCodeAt(q);64<h&&91>h?c=1:96<h&&123>h?a=1:47<h&&58>h?d=1:e=1}return 4==c+a+d+e}
1376
function methodcheck(b){return b&&null!=b&&b.Body&&0!=b.Body.ReturnValue?(messagebox("Call Error",b.Header.Method+": "+(b.Body.ReturnValueStr+"").replace("_"," ")),!0):!1}function TableStart(){return"<table class='log1 us' cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=200px><p><td>"}function TableStart2(){return"<table class='log1 us' cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><p><td>"}
1377
function TableEntry(b,c){return"<tr><td class=r1><p>"+b+"<td class=r1>"+c}function FullTable(b,c){var a=TableStart();for(i in b)i&&b[i]&&(a+=TableEntry(i,b[i]));return a+TableEnd(c)}function TableEnd(b){return"<tr><td colspan=2><p>"+(b?b:"")+"</table>"}function AddButton(b,c){return"<input type=button value='"+b+"' onclick='"+c+"' style=margin:4px>"}function AddButton2(b,c,a){return"<input type=button value='"+b+"' onclick='"+c+"' "+a+">"}
1378
function AddRefreshButton(b){return"<input type=button name=refreshbtn value=Refresh onclick='refreshButtons(false);"+b+"' style=margin:4px "+(0==refreshButtonsState?"disabled":"")+">"}function MoreStart(){return'<a style=cursor:pointer;color:blue id=morexxx1 onclick=QV("morexxx1",false);QV("morexxx2",true)>▼ More</a><div id=morexxx2 style=display:none><br><hr>'}
public/scripts/amt-desktop-0.0.2.js
+18
-6
@@ -49,9 +49,10 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
49
obj.lastKeepAlive = Date.now();
50
// ###END###{DesktopInband}
51
52
- // ###BEGIN###{DesktopFocus}
52
+ obj.mNagleTimer = null; // Mouse motion slowdown timer
53
obj.mx = 0; // Last mouse x position
54
obj.my = 0; // Last mouse y position
55
+ // ###BEGIN###{DesktopFocus}
56
obj.ox = -1; // Old mouse x position
57
obj.oy = -1; // Old mouse y position
58
obj.focusmode = 0;
@@ -836,10 +837,10 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
837
838
// RFB "PointerEvent" and mouse handlers
839
obj.mousedblclick = function (e) { }
839
- obj.mousedown = function (e) { obj.buttonmask |= (1 << e.button); return obj.mousemove(e); }
840
- obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e); }
841
- obj.mousemove = function (e) {
842
- if (obj.state != 4) return true;
840
+ obj.mousedown = function (e) { obj.buttonmask |= (1 << e.button); return obj.mousemove(e, 1); }
841
+ obj.mouseup = function (e) { obj.buttonmask &= (0xFFFF - (1 << e.button)); return obj.mousemove(e, 1); }
842
+ obj.mousemove = function (e, force) {
843
+ if (obj.state < 4) return true;
844
var ScaleFactorHeight = (obj.canvas.canvas.height / Q(obj.canvasid).offsetHeight);
845
var ScaleFactorWidth = (obj.canvas.canvas.width / Q(obj.canvasid).offsetWidth);
846
var Offsets = obj.getPositionOfControl(Q(obj.canvasid));
@@ -856,7 +857,18 @@ var CreateAmtRemoteDesktop = function (divid, scrolldiv) {
857
}
858
// ###END###{DesktopRotation}
859
859
- obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
860
+ // This is the mouse motion nagle timer. Slow down the mouse motion event rate.
861
+ if (force == 1) {
862
+ obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
863
+ if (obj.mNagleTimer != null) { clearTimeout(obj.mNagleTimer); obj.mNagleTimer = null; }
864
+ } else {
865
+ if (obj.mNagleTimer == null) {
866
+ obj.mNagleTimer = setTimeout(function () {
867
+ obj.send(String.fromCharCode(5, obj.buttonmask) + ShortToStr(obj.mx) + ShortToStr(obj.my));
868
+ obj.mNagleTimer = null;
869
+ }, 50);
870
+ }
871
+ }
872
873
// ###BEGIN###{DesktopFocus}
874
// Update focus area if we are in focus mode
public/scripts/amt-redir-ws-0.1.0.js
+1
-1
@@ -261,7 +261,7 @@ var CreateAmtRedirect = function (module, authCookie) {
261
if (obj.debugmode == 1) { console.log('Send', x); }
262
var b = new Uint8Array(x.length);
263
for (var i = 0; i < x.length; ++i) { b[i] = x.charCodeAt(i); }
264
- obj.socket.send(b.buffer);
264
+ try { obj.socket.send(b.buffer); } catch (ex) { }
265
}
266
}
267
webserver.js
+10
-14
@@ -1125,8 +1125,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
1125
var mesh = obj.meshes[meshid];
1126
if (mesh) {
1127
// Remove user from the mesh
1128
- var escUserId = obj.common.escapeFieldName(userid);
1129
- if (mesh.links[escUserId] != null) { delete mesh.links[escUserId]; obj.db.Set(mesh); }
1128
+ if (mesh.links[userid] != null) { delete mesh.links[userid]; obj.db.Set(obj.common.escapeLinksFieldName(mesh)); }
1129
// Notify mesh change
1130
var change = 'Removed user ' + user.name + ' from group ' + mesh.name;
1131
obj.parent.DispatchEvent(['*', mesh._id, user._id, userid], obj, { etype: 'mesh', username: user.name, userid: userid, meshid: mesh._id, name: mesh.name, mtype: mesh.mtype, desc: mesh.desc, action: 'meshchange', links: mesh.links, msg: change, domain: domain.id });
@@ -2529,7 +2528,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2528
if (domain == null) { res.sendStatus(404); return; }
2529
2530
// If required, check if this user has rights to do this
2532
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true) && (req.session.userid == null)) { res.sendStatus(401); return; }
2531
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true)) && (req.session.userid == null)) { res.sendStatus(401); return; }
2532
2533
if (req.query.id != null) {
2534
// Send a specific mesh agent back
@@ -2545,10 +2544,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2544
if (mesh == null) { res.sendStatus(401); return; }
2545
2546
// If required, check if this user has rights to do this
2548
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true)) {
2547
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true))) {
2548
var user = obj.users[req.session.userid];
2550
- var escUserId = obj.common.escapeFieldName(user._id);
2551
- if ((user == null) || (mesh.links[escUserId] == null) || ((mesh.links[escUserId].rights & 1) == 0)) { res.sendStatus(401); return; }
2549
+ if ((user == null) || (mesh.links[user._id] == null) || ((mesh.links[user._id].rights & 1) == 0)) { res.sendStatus(401); return; }
2550
if (domain.id != mesh.domain) { res.sendStatus(401); return; }
2551
}
2552
@@ -2690,7 +2688,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2688
if ((domain == null) || (req.query.id == null)) { res.sendStatus(404); return; }
2689
2690
// If required, check if this user has rights to do this
2693
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true) && (req.session.userid == null)) { res.sendStatus(401); return; }
2691
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true)) && (req.session.userid == null)) { res.sendStatus(401); return; }
2692
2693
// Send a specific mesh agent back
2694
var argentInfo = obj.parent.meshAgentBinaries[req.query.id];
@@ -2702,10 +2700,9 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2700
if (mesh == null) { res.sendStatus(401); return; }
2701
2702
// If required, check if this user has rights to do this
2705
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true)) {
2703
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true))) {
2704
var user = obj.users[req.session.userid];
2707
- var escUserId = obj.common.escapeFieldName(user._id);
2708
- if ((user == null) || (mesh.links[escUserId] == null) || ((mesh.links[escUserId].rights & 1) == 0)) { res.sendStatus(401); return; }
2705
+ if ((user == null) || (mesh.links[user._id] == null) || ((mesh.links[user._id].rights & 1) == 0)) { res.sendStatus(401); return; }
2706
if (domain.id != mesh.domain) { res.sendStatus(401); return; }
2707
}
2708
@@ -2785,17 +2782,16 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
2782
//if ((domain.id !== '') || (!req.session) || (req.session == null) || (!req.session.userid)) { res.sendStatus(401); return; }
2783
2784
// If required, check if this user has rights to do this
2788
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true) && (req.session.userid == null)) { res.sendStatus(401); return; }
2785
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true)) && (req.session.userid == null)) { res.sendStatus(401); return; }
2786
2787
// Fetch the mesh object
2788
var mesh = obj.meshes['mesh/' + domain.id + '/' + req.query.id];
2789
if (mesh == null) { res.sendStatus(401); return; }
2790
2791
// If needed, check if this user has rights to do this
2795
- if ((obj.parent.config.settings != null) && (obj.parent.config.settings.lockagentdownload == true)) {
2792
+ if ((obj.parent.config.settings != null) && ((obj.parent.config.settings.lockagentdownload == true) || (domain.lockagentdownload == true))) {
2793
var user = obj.users[req.session.userid];
2797
- var escUserId = obj.common.escapeFieldName(user._id);
2798
- if ((user == null) || (mesh.links[escUserId] == null) || ((mesh.links[escUserId].rights & 1) == 0)) { res.sendStatus(401); return; }
2794
+ if ((user == null) || (mesh.links[user._id] == null) || ((mesh.links[user._id].rights & 1) == 0)) { res.sendStatus(401); return; }
2795
if (domain.id != mesh.domain) { res.sendStatus(401); return; }
2796
}
2797