Fixed Intel AMT tab in Chrome
Ylian Saint-Hilaire committed
Feb 25, 2019 at 13:14 UTC
565722cfa91f84d461bdd19d3a56bf76e3de3936
6 files changed
+759
-753
bob1.json
deleted
-1
@@ -1 +0,0 @@
1
-[{"_id":"DatabaseIdentifier","value":"b3fc66a9d549b77438368c9708d19c60152f8bf8476e7f63afcaeb534791b1676deda021b8249c1962758b775329b8a3"},{"_id":"LoginCookieEncryptionKey","key":"2e9d25ffca125737f31f194bb7c7c0f6f99408721f5d4aa33b433fb50a40277b6ce48ecf41f3092a75887e07222de2c217d5b3742bc2bc3c8425741b41b391fafff6ed91719e5ef9ae51bd148f55c4b0","time":1546111996727},{"_id":"MailCookieEncryptionKey","key":"eea1761332a82a70762f7ac6ea810cdd6093ab59b6b672a614cb5c33eab8c1bd","time":1513132896149},{"_id":"SchemaVersion","value":2},{"_id":"cfile/agentserver-cert-private.key","type":"cfile","data":"mK3eu1IPOFDMcfnLRhhiNgH0hUMuOXakBLCcVTWJFIFmTa8bT7iBZB5NMdBwmeEHmYxDvRGUVgMXn9evjSmct+CrP/Fy16woYGlUJJCfN/ZHSgECrcnBM64lDKhXB57wZbMK18tUi/QrkXvrDB8QEhaYmH6VqXA572yYmRaTtWEUmGpbf/A5qt+C9cF2k9McnI4o8ItSLKzJznZdfS230chaRd8WLQ0p3qwI8w28BHM/JtiyZJyVm485qnDPctS2dOp8U+9Mx3uZjjs6h8oZOQ6EBNu2Sq/bI75tYCZTEJUoeGDmXrKd2dqBaAkRTyEtsujU0PBdXtG1Y7ldJphMH2ofZ9vEIQR4Vk1blvipkPIfl+9sX3PKhWtOJrXxycF42hugoFhUjVGKgC95tROShJMEbGsaBL4JLqXR9ZJ4ZQVDg7nJK85uS+FByyjn2AjZrkHcE7DLiTtwGyRF7fHje1ke5+/0qgMfJXF1U6vLoWl60DJcD5U1xvYf5ohTH/jwcN/9RL72f/bt9XXTxxyhvHt1A080RAP2Iuu/ChrAwu/yXv4HD/hMvnqrxBnUwu4ktRN4qlkPXT1maXph/lpVv45nvaUUmi//7Z/VLWUG7dcWMqY/RL5S+ZACOIpGWi2zsZMMXHpHqLNGjFoxyf8gJf/qG47eCzh829rTxUKAvTdrUO8SncDaSB8nC7uQcFUMAZJtVRXniUSrjQUsomXBTo5n5qKIx1dx4th+HmpMDj5nLcgAfioeJk7uFRvOQhpoHcmQdr12flf/Q5DUt2B9V1EgONMGoaz2RTy37hM2h1BBioeeYyW35igXYh46mNZTowAdN6eT+O3lc4COKVZ5wdvvQ3ZPNS3LIkvU66Kh4IzKSkmcC5L6AijVq+/JBXYvrF2nGVw2CjL+IRzaWocQTjuxs1+Geifw+OZpOsM70mC3L4Id8829xbUXd9YfKbW1YQUQSagD/xe/LkM3dajIF5k0cRr0Ni5TFXhL5cMcbzvr6WejBk0cJGDgXzii4G1eysO2bjXLFxFR+oS3mdYF7nFo1y6EAeOj02JLu6Aru+u5hOpEqapPIjPK99XB6aRQHa+a+q9N5bzu5suCi8atNvJ4GAq1Bp8u0ZL0uXMMT62wzyDw9d5EkmFmMKCfqDfeSdql4yMSYRlaJ+1gJVHDTU4OALVxg9h+DARVvZmCdMuDXb6e6YVO5iTrqDjpcOx8xF75KvfaCHcsNIfVDstIVj4VtYniZsBz1TYa9nWixOYPhUVfNgqxiAhJVxng4jfEm8pf1wnKSNfLG4PvXhzPu5lwGZSFD4XTvUKQ4w/TGX8rJKeUdDxRynE4SImkKP59731FYO+5BEdbrEK8aTqwjvPa9JUsxpODALrEDdbzCRVbl79HHMXC89BPU1IAP+1mdSxpmyjN9ROmD0H04X6gaAvMdkFmRMMyh3KjTzVBnysWfhzZdsgzKlPrCCd1/l/JcZ3irRHpJ56RSsaAdReyWVUkvqo+lBu7l3r69eFdTRX6RzxeYkCq/p3wdxDckGDHZXRI77x94OSd0qAbS7pfvI6fjXevBFHeZrJCKH3lTUZSovQrX4fzxQyAb4RT54KJpFFH/irVx9Jeu/ayAQg9CIh3mWZEli2KD+aLJH+YUap+DbWFq+a9W9fzn1Bp+GOt7lMXtNhlHZHJL1vLN2P7pj7B2bZlMeIZMPcLMFUbkAqHYxdPTUuwqVtm82K2wwVmjACY+MSOtVdG7ElYzRwvosbky9c5PQsvpGZbjJEE75Ip0EuysIgZ8p6kXK3Qa0B6bvPbIolRn1JggQ8tVlW2SeVifF5KliS35Cd2nCyy+gwCUhJQAiZVsKSaAYQ7UzL6UuXt9ves4I/iNRxngP7iLKi1O7mJ7Qviif98M8gwR7xZEwfeUJW9sEEPbpNFiTR5O76hSu29y7XyPO7nEiCFQWfLyGJW4CIzVNd07ty6+r68q+0A2albrnp20gPLqdbPMjnx5rmCfyp+wVs6Hb9sRn+Lb3NYZZZhvS85PTiBlthR80I59zpAUmLANu3K9htdjX4tE7O+OLzx8vD4UUNCfTET1Y9lLFtGCasXuLV1L3vYTtvDlThsv6EOC6h2/PP450LJABuKi0dUOECtOSo0KD8LA0QUMAcH2sS5XYLES2wHNsulESs7XVOuDE3Ss8GyBmWEI4TyTztxfbeVFwaGzu7iKQhbYr3yiNtwM8mm98lnGXgCR4Ld+c0MFRMNMdpLk02jZfVX/qDPeE8zeYhoQRC1AKvuq+GFA5sZOEljSsda2mnG3j+EuLNrJ7UsnghDSaDbeEBHqjEdyIb+6njac7WFIKmRJN7zPAzAfJfk1hX4Hks8pf12puxJhINeQQPzor9We5Qps/bwq8dyn8IPJ9omXjBBB1J1dlx8kNECS9Luyuo6ldxZlJv9cMwFX18/02UXM/45YPsAZYbprA85MB+7B2eHhE/HhKDFa0UqwfdHhDK7A5gebmMK6Z9haV4SjNXNqKa5zSSLe2jhjBltxCqIYU60D0TsLAe2XVwStpob7qTtveXEwHpuFUpNu8cBYtmsJNl1Gwcj7XkDUmtdw6Wn4pUKOd0jlkGBqIHLTcSiCMsZQt04430ctiAUbLbibo/SKvJeIuKmpnIU4Nz3x1GcxuasRpshqRdNxzWS9oKAlGaTBJW3Y4l5LQaQwW3X4dKJBc8/TKclq/7Os51iQagqKD9/xh0kUK8gPm/HfmTZPQ98MnHgKBkGmOqSh2hp7qzPauuCeFLBI63JPr9yRn+vggFR0Qb4ZAWU8NpI3BRtq3RwHCGrTKtXjATUn0E9QrlQeYFrB7911V/iXAtvTaIVkAWO9lplLNcOdsZmm7+NML5KaufooR2ZAUsWDg0LePCIRb/+OY+R4FpcsCSJQOnptl8sxF8Knu3v0lEbRf3UbiuA4E0ZabFPfLVJVFB8yyKSGGDIHx2g3sdQzxupwRC3fWDWTbSOTE9wafmHaIbEYvtt0Z9u4IDqX2wr2cWAkpfiHTCZ5vILxXs1Iq17MdhLqEEGe74Oac24vTmgj6KNWV+9uAWKgErJyA377whwtJCZi9ISOdTzX5N9+zKyddJ5CyqT3QTyL3LfRWMrgyyKzGrd9701kyMmNt6eodUoZb4KW+obmuLx3f7j+FJWtakRaUeecJIW5Gw6DNBFyJKPYM6e62HnK/iU6CZ0eLczPps9U1nirlbulDtu8nGHQd/uT59KEiDS4ppKDikEj+Hqel5YpcfvKrFyyZB36x6JiglfTVEouJf11MEH0eC1mLl0ayNjgJYhERr3t75qds7nPkEnQV7lkiJum7aznjB5u2+yxdZWNCZOexWSdrmGTw=="},{"_id":"cfile/agentserver-cert-public.crt","type":"cfile","data":"cZzL3tPH1N2tJsOgw3b1a5uT53KRTQKd9ig094Yg0YGPP/l9ugnhfJV6aGsYd7o9XfPt6GLCYpQq3FpJNFEqcg3K5YBdiTulUo1hbl0O73KJXrC6/IYfpphoG+qvWh91ZLJzVbZ9RvG2mniUwYEaIQjBkBB3YkRrt6/ByDdBKu6arpB8EDT5ygcq/PwvvVT9UYsjn4NcRURkMBiKK/UpKUqPnNYHeqJ1loYhbZf4RXpyZMqT5jiHf4j5fY4qHt8xbhzManWJ3TwRRAQhCj3boFVy+iiJdDxKApJ7o5Vf4SJSnCA+VzT74oh8whxeyKtrqctL6tkp7FKhkAobrFI/HOFTDbI9p3Ua/GV7FgYnhPvFUn1tGdFRFrE1O/PJt6KnODTeRmuRuyjQaZtUCPbNRJLRcH5h+J+SG3pyacIIfteeLtGj9hLPFgqF2mOTzasJ0/jliHjb7MmfZ1KU+QGQIKCbMwxZ/wXSpzKSlwFOnsUIMEL6hSeVIVS1oqiCmi1KmSwVp2JUGvUK2Cydo0FqVgvu2W0ZeV5htaueacvMG5sM2C41jb6gljP4i9yX6V2Yv+qJ0sUW2/T6DaDFbFJVi98r8pZv57UHgr+dE9HKMIf2SlKG16TI2n9OZKxase2OkXaMWoimxe3f2y5VxoT6vtxtF2XB/UDxx+6N06VRejAHki1sx3QfOWo/LFHHhAlaeow2SLAvwDEP4gNeIFpYpCfZiTdQ9fz2Y6PruDbrtBlQfqLps9W0/6g9UoFvV+wn7CI1SO5BrvCX68q8j2DuwUGD+C2osP+p1/PkRVYoCOBTqC2oxLGRp46OZqzVUnMf2YUFYOayy4FRiXYqj0VxlyDqKdKUHADqfvgoVAC2TCerJd6B3xmqspdS6fnSJKupB3XYN7YNSN2JqeM0XpVFRPE1efrZovBmPE8mHdu5lWrDHwVeuAOSxcTAeIAHjLaY6ixnMxnZVm9wk9Gw9WrjJwvn0jaDtFgaNeOt0Zvzc/rIUljN9MYVB+ZLVANcrW05631Hz7TUVVqTyC5o/TYG61PcUQf361Ai1JOpp2CSQtLZBi4T2CF9pvLCkixwJqS6c+5rmV2gonLSGX7Kzf/q+okBKYLNyV81nvw1MBN9DAM0ylfNjRGq6iyKt8Lp87iTE60XqUtExbRItJohjW5zy8sqgs88p55LF4B0RBv8hIuER6EM1vL1vHFWHGKv7YGqLNzJURovV/5rUOH3MgiY00ueViJjdvsvl9FtdY3P+sR0d0xzsKl+yuyL/RYus5y28W+0I5Zg1Fa8lEj1u6mZFXTzQ8SGGdbFu4elooXvVAZVasOCjikPvSCszs0snbyTEJFWIK3qxA3iyZQ8BC1gVp+Gz1VEzaD9JXsPhcPWWLov50tl8V81K1NgYu7FytSg/hTb9u5Gs33VjxVpc/px+9WOlpxPl8WCbq1ikdp5bgGbU7GquB0zQDs721ByiZVvLPB9O+YOkaJ85XoJxWBvwgeaAGt2IeQU0BUX3aGAeKgJCOO2CdmQFB4w+Sp5aaNI6dEXTP/i23/U9RROcZGphHPlm4Fh7ZAguxF08UTARSV4YAhGHWTeAxWpfRAmmZ2zBYhqrEpa24tL2v6gMh8xCN9Ew9Ml/pkiJX+d/t7RgxAv/P848AXlxCqVkpvP0mNs7Dif5qbxPRuhm97xQkM50MCu0hcxbPVqgk62e/jitWx7YsSQ9a2ZEzieqWSrJ2KH9JdlohBAKWjM4kzwVVn7DDG15DoxR+idvJucDnf/hK+P1pumiKaiwT597dv/l4ou8qmd8Lc+b0LL1Rr5O0QGGitWkc4sPbrhCplQvGx31LrxGT4U/wlXaerF7rRN0jG3fCi32h/bop4XWVUBCdbBVMdwBCGy13nkox/Op49PPh5uMeK8Vcp7ayB37+b4D9jWjIFz/h0KTJ4dakY/1ChTopN7LuIjPkl8PdjYNaRshNzEW7AgX72bxkvBantXn2+b4Dz+2mDmlqGxAmSb3HVu0kAFtR+818pQj9sAZUsQ+CccoqqwQ8Nby8jcTCRxHL0X56Lo/fLDQnZyaqyuhZFJ0aqQ/O8qD/vULnK/F25SqTLuKDoEFkQSrInJkALCzZpwkYJ/KXUN8tCFbmUeyi6K03aNve0+KSf/f/Ok+gsRmkpYtPE93o3BHt+qz4gaH9RqPJrSuNrOOg1rHqYNwe+1N6baG0xvebpq9tMpLzEbbkKbuLYe/6Yny9CJJSDYcJd0JBnBl+usUlDXTzsfqBIxSQ=="},{"_id":"cfile/config-doc.json","type":"cfile","data":"Uty8qEYmEsDtFGvWQ0cW5cPLTBsPc/er3ahWNDqAVkKtuAsJ7vf7EX9mVTNUUEdW19gacdOM5RxS4ednwaduhbrSHTEq1qxMvw91l0jxK+SsuqFc8g9POBDEYdU8U0Y+bp3xM81iko1KekIXIooZcbMdj6XrHiSV1USqGXniLfOrBpw6fD0pXZuxULQhv7aIMf+IwLhna97CzI12fX7xM1sAm2uMWJzPVQM+Eus5NIw4Q7W4mIdfVsUotYlMHwaiNeWSVQAuLCQzczXHfta8AlpuQmipYmrIdAa/+zP54xw="},{"_id":"cfile/config-ngnix.json","type":"cfile","data":"nXdriKjgSXtac8fIZg/Yr04xiw6bSOW6MlwclLK1m7Fkd84cZsJ0lSDuO2gJU+A+JXakE78Gv1pZ8XKs2ZOuNVq/yC9aJsYGurBgk1yelsh4Sh6x9qriE26mRZy0nTWApiY6CxXixRZN6NSMQgC4Mpl+qz69bAZp/MW8YLSZhi/UPp63FaGJ1twXdLp7E6wvHI6stm5rXfOEiHp3bhfsIIgqnCM/v+WGDQtd8u0Lz2GOkWeG+EkcXHXi0iWRelKAp1c7Exolnzh5xJ167TpukPpcEKmTRNqVHUbwF+qW7gP6Lnzyk5RVoBZbdp4R4IkTC+FQgobyqkibbw2g3E2jVFKgcr7CpdgIJxW1U2mnl3QUM1NtXBMoGfN+iiVf2xldAzZ7age/vl3zCvdgvAmWoGdC8pV9rV6hrBGLwTwD8HgOagpTMPSOSCLwDvejZIccMnlWjaN7+V9wYeHk26Nf0bR5bAfVSN83FVZ1XksmGB+FbVPCleTBP6iiafAx0ldqgFk94bUTtvRzrS1i4Ofuil7XSSdeFsXOKnl6TQGcxlEwfUo8ym5U4cXNiLYNGAeDlOxL7CZ+iuQV8Ntba+gpEruRZKhAXgsNfTanQ5nwLAmVfXmURBHemXMMpv0uQUYLqYzY6fy/B8hDN7w/sabACWFACE1VrUhg35uKDy9ejO0OEL15pnbyRZP+XfIbF5FJjl6PmzauEbbapN5ep9liq+lKpU5B4mMmmKovOoBw5nNPFrQFxd2mYp4q1MkkXpjh0BOM0BgxRzkKbWVoIsdahg8IZ8KxVhEiEWpfaDhOHIH/DSsNUAtlGfmD4RfWQWJHl/rw1JnnOpviRqNk8akGpMZbkpTeZM4XvjrkfPsNOIkrWpllwXLNijS1yY2SSXWrqrfYMSJRPWwlr5bAfdoqxaOTbAR0XDJb81G8eBAfPPqVHCaq7deZ2S321BLnNafJduA+ZO/aq2WG/rofceUaMTjKFKk0ty/Hw0rgaLzaOUiRbXlh6wfVkpO/RUAJEVvkHxfVc/5K6VZEcvhCCDvDXsGrJSNCahVS6kFg0hKJQAPK6E6S4ZbmnU1J7yBMcEgcsjbb3u9yM+f7fSc4wLGTyKrM8NVY4hNV79SJK77LQvPaDO/J+QX2+caGNFAH60zj6tGZikrCKRZTHU71fl6ttQv+umo+Ap3DwQTn0wUGaRIbwciLOB0ZglrzuA74cS9zANGEnv2SP0v2c5T2eXdL7zmTsQFbMUEFjuXx+MypjK/Qqgm6wXlfxuiyc1YYGhpiTHHA0pYgLqWdsYJzhckP5RibF5SOJEZeDajM6iO38FsB+hlojJbBMil7aFctLYG1pw5uyqUylWI8kNxGyeqCZ2tjFHwdfBIMSDkrLz6/ToUtWXiS3Dadcf64Is/8XT0HCqqgK8bx3C8EWqeC93YR6Ge2EUOzwajz7+U5jyl0HNcc83dST0WP3ne4zm8WxCpNlxcLxaiLcKefkvEbvr7WPwM/Qt3CDGMIR5oogM79j6PudpJf1JGvs4okCMYlxsTwcgEb+BJrKaYFjwNGxlZN6olKxUHcbpFSmsagV5b0kbCeUCVP7QlgsDBT69e0cig3FWVAa6sKbw23++QwSioqrGDsfU8WwOOuHeMe5oNP4auKjofoo39YkopnM28/CENTIG2flAy5DihFCeqpzYV/DUI/CvANDa4UkHqQNn/afRRghWEV09H/66ILovY0ewj/wDG6jVhB0IdbNvbH0N4T2gv2+wuEncpOP3WivY9Iq1SO92q0t3OO7IKB1vISnxSRXAHRWbtdN8LZLyDjrfhQcfWshrP+KZ1yLrvfqNlUuBrFMatg5eZMbpsxSEfzDLGUIJHyEWm5+Qbk+ZwaZ3i1bI0EG13e4lw8Ieoal23SURwdZp0dWfV0db1WIy+NJmPC+zZQgxsKyFrKoedx+PpK8oMB+3vl4ubrKPIWyUDJDAWpYxMtaa1sBRNwEsRerq5M4Z4yapZeuEnRwbBoS2Tl1r8FBCywCruAxNa6cB7Ay237AR3cC4sQBESndF5GSY/zWXNQhbqrWa5NsE12RniG5vVav0IldbPQ48HhV2ei+RuvmTGkSbkm0Z94aP/ScqP7SNSzak7WXr8wVNq5UUFyGyeaet3nzq3e8NQbPkcr7uw5Oj4wbRLu0T+mlwU+YNcMjKg79ShhbVX8Om/Qlfp62VF2+8v9ZYY0zeG4/yjgByLfYnXdEcrtnacXzIHS0l3nZwO39jh0S9pCbHksgXKPfJAp+JZgKiCCImGsF1Fm9bumU+iwwak4r/p6lAp0nDGCX+Tsg2ZM56WHvw478WMvLGhuVITXbYBY7o8dcwZGA5MhAnDUPe9AaBqyIC6wFLnaFOhS0BNK139LF7u3PGKnFjWKfHPzy9DYVUAv+/JSOPIJiT9iRcq+x9ib5EHIkiX791wgWdI7OwPgxaFOAKkqZsuMDX0uCxaO8QyMqUieVCeB5K6ZWoNys4xvkqDWkETrKI4CREjmv92bT/I3qgovDf4oR3ZNogcjCO5NoEqdD+s+zP7Br7lbEI3MNsAkV41zOmDeD2Fpg6QUeTsCPs/bMXMWWTrh8KlP+brmU9ZZBP89JFPG2G35BFUvvn2Qyev3aYG0l+ynq0GdUGjeMPGVVUG2AZ5yOXyoJA9R/h0zRCCIaXudgMpJiwADU+4D0nWIIbWFS5p9j2+QpmIAig8DlpNNBf4S/cv3Ytu/LoOJ5EMb12y5S4N0Hk5d2xp12QoE8GNHlKBWzLD/fECTgEvrSKXKs1+emoAZh9Z1UTGs+qv+MHQmMlLiyAwtYa/1TNSIMJq7GQU69A4SEOlSMIQZXpSuApkjrVnHYWsRlD72oakff5ja+FL6BrMdOBp0NZpBvlKHywqMs/9MLPGFBXiz+7FMAaCNDh9R0cZDe7egC8KSGzOVJ3nVvu3mRa1EDUSY"},{"_id":"cfile/config.json","type":"cfile","data":"AF+UHbOnvwUOr9L+o4pTh0nU9hhK+kKXH2oqPZ3uqX/RuWxQLlPRYGxJ33EgU6I2Q+mqu1POuKkm2DoPBRb+76wRazgvmZ7vizTE5SFhaD5O91ZGFYvc6E7NweTv35mAdoArM5qSg4Gmocpc+y5Ur1ktRLnubX9GLHM9deTP1dolu0kxM0R8rE3p44HZXaQ6QDZV0w/7QMTcj9bYMKl9vJHkg2z0m9+BQVpv34v7dqWmQ1q2wT49fMU+0JtPCFzsMcGEo7KZSyFVcwjG3zCXhPBTz4FPi6ZNdMUTevCijg85FNFu+tOsHHirjW/yFgfkQnqYEjf9ZfJfKKOKkijqVCn0J2iTFrp8kFOxr0lDy7Z2CSTdwhwmMUOdn8S1I30HEsdPNWCNM/MzaC+RD2wDvlz50XBVz4157Bj9ryAhiPZ8Ge8Hv3beMd/Horuw2YYICw/qHL8pFgHF+DSxCAXIWwh1vkWSHzCZNF8VlbnlDBqF6+S96ow0tikQG0ky+Z7zJKvR29hI0ESbR6IUuKUx2mxSbj6gR63MEgYg5T6fGfdyQ1nBDX1gN/sNIf05mtDjpkafcjTEHA1cdiGCzQbKYRsN5CZnZxSmY81Pu89Aw+in1QKuuLBz8mFbSxA3X9z82GRX3uzFhgl67a+hIyOxYy8TudAPnBpxkBTxbyggj7gTooFfWONrEz0QDvhm6h+PPMl0aD1RxWIBezKSOFppSWcNwzLkfh2E65EcW71rBrtpi3l+yXYug4yj6J3zBT115jcwXHpaQ6eryxvZkdY/vtmeaPSdvitUytfZV3ZQClRPLhrPVrlRXiJOR5uyV3uT21Pi4IAqpZ13daZ5mkpzdCRvdSHXYeUhvPW3528Ajh1r/0LB4hQJSuxygOOYSX4yrzYPbuX6cVeWykeodFfFk8pwlFCr5A+zbY00wjWxQ0bEhPJqH/OFizy+YGnmkqHcMwVelJK6nwTqym+4IKJTmhS7a2x73nH5cUeGMwqyKprnrHRXW4w+L+uMIFaPXFKQlrsYaV8cLlLdq2/lFrAAyhXQGEi1uPnLoYJ38EextpdSEjtLxnDAkNdfzfZU2TucxQ7o+f/rjvf4WlGf+gPJ2zExj8xsk52aaeA8tUlNah0qoY0a0LjmvUwjueRZSwkSS9f2MfF4M7XzDuwurd6WVIHE4ERaHen73tpNE3aVGfsNd4WEjKlar8F8cjYr/3jm05Lp95WcHM7HHdC7KhMBfvdDbZXagxnUlrrlnvPaZm8s7HP6sM71Hd/eFlpTppQhb0aMYbRYdhk4EpiwLwOorrHUwk8u4IMQeunk0Qd3HCXhum/YmJidi4GZGAGw0JSuvlDslj4/K2y4LPrpvMjJEafKbq9Iin1MNX+CTV80SZi7JFP65iAH/f2o/AVbXPSj4mbVWzq/WuPVpA0EHkC6Ahzop4dEJBQZZBdF6c0VQm3HKx95FIvYCHh4hBaHHhJaC0vGFSCNU0U4jbh/kURC+Ca/t7wKfXJaTv7P25HPHtIjgEkzMpXVnVUrMBCrsGsRVxol9WCvK6TtoYoUpueR2BofOwRVv/pLaG7OmqmLLRfjvk1F9xGeusaGx/m0r6kHf/zKs3Z7MDyGuup8T2PLCUvNdh2+2DJ7G1siN/ABZD0UGfUxXOfjZh62cbohXtBP3o99nrfrZOmt7fntTSRjW4F3t/rt0ReYwivNAF1Z0AeQmRv6EW3pWpdacRpNgSHScq9Uvi4BpbDpgBNPZMara3zNtb1dEK5b5yPRVn+BMP97PdV8nPrJplgzPpEma9fJuZIB+ALHHIj7pJFM+6TW/XWgf/PIUPDBmf+o3AjduS8jaJNo7iFeozHVnC6AF6WhXtBOk5yE+J7lzfi1ivIn6SS+R7PnM17aVT5bwu4d06jmBi7HFGrealhrNJ5tY1HamIUnatJoTO92MBJPqmZob7PnJ4JAApqY+snsKBB+PbyIJnlQBFyriFgV2uETvhL0PZNYGjQQxlKeb74k8QgFUNG4HSjNQXiz0+yy01IxE55VBkWuC64y2jkxOFgX93Q1cwxHf3oqyehXURcUR8hN3kpUpUhduC04n1CKLaD+YT8YemWyhD7M2iFXn+2DGti15jHuNYYn1c5WAOsUjpF/s9m3t3RYb3q8uU7M2vzEeUV/UUyKaV7VtmhhEuZp5I450DX5gNhQWGmdQYZK26Vx6DWVZnCoP0R7x7iN0iWw20VZ/2F5peiGbsEQfk1+IYATgQDcWWLhGRazpouBAs3rYlefJDuVdVoTJ/y7q/VLLdaCn542g7fg4QDLcAB69oqR+AYMdLDYIYzPkS0fA5ytLBOxXRBNzoOVtgPdXsfkIR+CwPSKPckLjBdBqF5M+szcKyOxWf5c/oZnYAY5tPmTqo8bGNM/luPmwB4BNzlLdqS00Vr05/ZCufGPsFa3P2UtNnvelc4EhBWq4kXDCLouhk56UcnuIi7fDtHrX63rjcBPb1hSv8jyEvtBKnzEH2hRbJhkCYJXGKJWbPevuJUixFwp/6r0PF6yGiAdkWHa1dNHwOcFVy8eBGKDm/BWVEGyb5BtgUsWFNjrs09q5pBOM1HqtuMBT/+SrQT5pK2PHzh7DWNUz92K7EfpB14fdm5/j0/nDCE/odXbLE7LKbLELNVXB6RAGQIUhFiVptkl9bEBRPJ1UG2XYrEk1zJ02wbJwhUqLyjlwgV49jqueToffpVZU0mpOFNU8WmRFygrexRMVUexEA2yPFg01VhEKA/4jhsuTYLx4YCXV8u6p5egLwoTN/TsGrOwcu3IZIlrsHSJ1Vi42AY7pjsM+7RXZ2frzM2FJbc9fEOxu9y9U3T7v33MV5/97mDq5qN9lm3U6/8hSWu4CU50QV5ySNs1qjudHGDl+BJMO2WOLMlkWohj0Ki0gs1cnShqbUD6AMhcLuwnJ5cIKsVx56ejxOoqe84hhMWk0nfD674Ibr2ypU30vA5IQSmv1Oq7651d0Hf3wbQdVGVtXHgwt+GR+mnTaZ8tQaTL8wujSmWJ9lNetUTUB8bfbgILRHsBQAk+u/1CfXTE1xC2hu5rcw2MaM+e7nHXfXmQmU8ukAlJKcY1KgoGahu6QR5QhHiOCXaVaYk/9w+GCgJL287uilCe2rBB0+N6r4gEjj7u34pUXIrON4Keyb1lO7H5PP94FW5gZZaCp+mLCOuQnbsXaH7IVMlc0vlTcorrYj5qCGBujwHG3v6FEKAlIdn1PhID1GG5hRBz4Bhh8WJkJkUcgJ6yMQxKvLCBgabA+qeP6jHVHnL7SVTVewoUyFbawzHAmC7o/DvPbT7DZOpZdKgwWIBTVwFBkFC2bNGQ1srnkccVFaFiFLJmHfOSODoJln6cPKhjs63JXn6k9g28HdDOWPzs5qwYAmpowUI6vbqM1ojLZ3PPYebjicF46LoXlS+GxTAxbV8kH3LARGTRNZsaT0RnZe9fEgptxdoxNTjm5BNrantFG53w2x7mqe7v954RYuzFcUlNmzP58ihp3XGWpdOWR6hYiEMDqAgTyukJxv0SYfOeM9S2ZgaDbG/9thkPqvZ0by0DikO85E4qv3kBNdONEx7RpRcT43PBQ94Umj8lepBV3zKjdfX6bVML5/sOkU5fa/8LYKU="},{"_id":"cfile/config2.json","type":"cfile","data":"yzpRXHHPGN2WxBhD2NgnmEcu87Yhrl+KhAWxsVXj23cLpAD0v5iMwY1ahubvfbEb9hLKleqHlUJzZ+g+ofVtOQlI9BFmybD3NJByCtqeOktiFTcViGMHHiwAXp3kopo+86riTfD/rhzCgUo40EblN7xGtSswqn/bnSlRh3ra5oOky4Q3fnpvowXa8JwvuneJdw33N5Kb0bvn3EOVeTdgrChROGHb9XAHbyFlqWlot8xiM2FQiIB/9xZsYemapiP1IDEmoE6ZoyVsg51iM7N8bV5G1iGr3uyff1qPw5GmWv9NqWf4qhmr2E4nrf+nW/NU2ZDGVD8lQqpDBTISngyKYNBOKA5f1sG9k+HjwF9YKksQDsGKDF651B5CDilZ0Gnpj08+TnbLAxLMNlDENHJ5/G9mrMIkQjYW6ijuvjK+HSyJnRs+T8zmHfzj40OsnTjNmwKe5STBYbR0J0fBpbCali8OZTREQ3pkyu//vld7YesXjGa1zRaGN0D/V5gb12Z4YADOklz8KBgg7LVpZarLyLSL7MSGghQSWtuA7okzRhV4VIVFqgCmjwxvlT8XVIIj"},{"_id":"cfile/mpsserver-cert-private.key","type":"cfile","data":"vQp21LQpi+uNS9bSTHL/H+mfN37EnYuDc/MUfvM17MnnFvCdLsjMp5RbmSFohLa2jcGeLChB/bkgE3ba+Pxe7HmeHcnI/3HHA81htgUscn00KJMJ6Pb9AarjTTJ3/3CZrmCEquBEoJf8tlx78yPXUwts0bfBDuGIv9VKr5lKPzcL+n4IExbS62c51roAYP2Az0pryrPPgPoU0vwmUuBisjRdSUCUd/ia8CwYJirR3svyxYKdR7QTe3viHZibU7AwDO31jj9mbkB9KxOFS8sd89LcHThB/s3TQAkRxbnfxOJL92whOqUrguZYL8RYuomzeA5cYqsli8hP/GBFL9w4FTkBQRl9jHa5ORl1COE2uqBApR/2T2KLnwp3tJ3kp9cx79Ggv1R4tgJhfNCKzqZmtMwKJ9OwUwREjIi1xuwOguTu+70shZJib9STD7u5usUaxfnITV94iDsJQOBBPI5qf4z9OuBAHw5iVGYwyUoU26l4E9QwTtTJYzBXsJdWY9P0DbXSxgGwRRM49VJjS1/l8fKj84O9sKiqEZBtfo3R3DNVA92/IZo6+Yhd/b8M02f1l4stHVe2LHn38oa+v95pkxZs+CaIrB0cn6UC7bFHDmJzkRL9kbP2vOOcuLJaall/mR1N6TMIeVPG75tj8NaxEnY12xjyA9QeD+OkPAIwflMmtHKxAmWkB4e7d66VZOIV/vz0YAF4cSZ8lxQhULwbSnhybPCN6jMODaAvq+ZpYqvvLkLSO0bXGQ3rIeS5CZcJdWA4Tb9w1jLGX51uf8kPJf7TXdNGuas4efagGMzBPr1h9qIbPWKIyPYfJgF7r3nTafLY+Efcb19j96cXJcI2WhbJxmTFxmysKy7EFJ34aG4PZ7c3rWfly0gxJAJuymUpBjCaagN1b6cRClM4/l864NFsQP9ZBUjMNEv8HfXjIzpJXg/SwiQg0LpsO53R4e0tbDDCh270+1BwTq65AQYcwd88CMuSrznt6rriAN/yXl+pMB+HhCV0NHjJ4qN4vX4tdvzBlA/VLb1p5TOPoLoWu85xOK5/NyY9pXuhM11CI+wmmdPxaiVHSFBn4wSnsVsvnM2RP32ZDPyYwMRP+D5MT9wL2vNcVPTX1RLagkBxz+VNchPAU2g00fI1kiSMredPCG+BZYiRwxNZwQivVB1nw2oS867UNOyZM5GKYNPpCfP0sDFpK29hgxLPgWB3vVjGGZekSDnDmm8M4r3AsApfJ6vMG/QTW5fTkvG0RtvD5wk74Hy61gIP9256xhowYRkPkTJo7WywXD3i23el0FzoJxSsfjl8SWz/szj3j+LNjTzBdzLVb4YMNoXrnqszv2ifAsEtjRgbBCVa7vratEz06lCUJVk/zaIvG2Lv2Po4RhAaWhQu2Llgx810u9V6/jmAnhh8nRX44uBJMHAvcyJBV3HqBlBqshTSKRVLzV9w7Bx/4auejvhGvfQeUTNu81Gu0x+LBxiFKBpiT9pSmKAuSOk+D8FJQnRiRKY2rjsML0fmw5+R3r0HJX7yboJqFns/mLbi8jnzMTEIGiYENHmZHe+n0lf1G/CADSbjpjTfVYGi/XIrChfjGJLzRSvSQQS3kVT5Lc4S12OB3Qe+J54TTN1bJHFvhkZ2GJR3jyZxC+LvqTeYLxyycmKJ/L/dAm9JgyUxQuaE7FpkKewv3hKca1VdwFG37W6yBDcQ44GCERDfEo0gt1Btus7mhoVlGawnMJ2nedNVBCEA+9D4J4w0N2AjdIQOpu49WOqwFd4aqiAIBQXkSOw5cm1tZKvZ3D+o47rpYC+fFln2wdPeIt73ugAJGC2oaMRB8wb9nfayY9nbPHgnWSExpgfNuYS809p/p2NEIVt4tCPQ2rg96qWcmTMxG8KrZpWzKp20czIDsSsT0XJsewEFtwiT5xK/COpiVCC5dTuFDG+X+JFGvRiqJ4AuPWWmKTVNrWAkG5+hykxFaADQMgwZAvWq746iPzuVL/q/18t5ehc3B5UUqVBOfYKDYqKFUm1LcIHH7GvvrOz6TmO7sxP6OWWnZg3BnMbCB4xmdhyzHpJlwIQwBr4vGEO86FnvJvi574X85eEFaXDawJna3AKK2XrVUFiFxN4u8PDoBasOwqYcwJQcXgzqewrVLEqNuqykWcAAF7/2nNPW8xlCbG48+eOB1bTKul0EQQ2/90NotjhZgwLHe9yc3Pcq5o6Z9FfWxhmTC15PuBU2AbMka6t9l6ahZ7NB6589je8yCND3qgiXccqtkBK35Is3Ko4YBLSoTt1qdxb38PC+clt5h2eqkY0pD592RPPn"},{"_id":"cfile/mpsserver-cert-public.crt","type":"cfile","data":"4j5XKOZfsvKh666jFxur5o9SaL5ZIXDeco00YwdQHKc25JNr/k1GfPhQnQviBpDRM8nrASaQqfTtlupLswI90ksDkfjIC1K8sFfdsGwAnWqAdJfzZk41Irr2LD8QhkNU/nWeOzmYAyERzhcxdxsmMFda8X9IJ7GHDLA0SK9STAu2A9s0dJ8nJfaAibkRbqpGW3nvqzmsOrVt1C4aBMsa4LvipJZnpXut0WeRwhvB7bmpXLD84z4OthH2KZ0imJcirY+Hn7Y3jDK0+BUs/CuP2ygkLohOx5zTq3yei1adpm4P1mqaCbwtiinc0dRTk15LsH3QCeTzfkHNgHG4u6oCGKYBkL4rDtKSZ+PBWjupQpewXHQxbGoq0984fjmxStVSIu1VxiYwTEfrC08EQxqSTOFXnwCEi8kiP2qTwk4qdmnpO4UnqiTkQOS5VVHe1F8D+cqSOEsXkVq3nzU8jp4YPWe+inIgA62uWib8ye1+/RdScInx8gCi3GQi5sPZfPEGztazrQoROiHXK2wlz9KZs1xyKlkukZJN8yKJGg6h1meS8aCq2xqwxhEEfnyDTyt+ZdwomPFfBk80HPwLd8nUUsxm1O7ABePnpqXEwVvLQl2Ogja3K2B5a4B/S+Gwy+IQ4JedG/CeqxrAm+D0uYMpaFx7OHNvcZg3nfmY6sMAfsGO/Bs+dBB9WhpbZsz0ufNOjVcO2BfVwCMa9BEARu05nEuumK8py5lN5w/zrKl+BjvlaxZceU/tQ1qCWNviHje7gvcyXfFaKZplKpwxWR4J/m8I/iRQWwqwLll3YKxDys0TikxraXrqPPgDD2njaTMXB5Ssls4hlNrL3i+QQSiWGnRNwpS9gfOdbt0U+2ri6Kfs/lIqXHg7II4zb6mQyVYLSPCNGUxkOkPjMHKhPnKgXKOPOo8qSbeAoEM1svn9aUX/bQ1cERws/3A/j1QbP3Bx0jYwFNS4RvObB2mWOJkO2kV8kC8Xc3UDUV+x5LV75Th8LtOdiZ9Jj+Zfeo1dHu/4Zy1vYx/9iQRvnI5IF+cBE4ZRImV4iGD8ksoF7Bwi8qz+5ownSoi/wA10y3SXU1w1jB2jGN+7h6EeJbngm1sHDkhboNi097UJCPwioQ8Yp6ZD8HYP7tp9X8yC16GFsKHj9zJZvWuvX+gX+4zAPT4NYMqbPUY2G9Jg7DJTa47ACeuLKPWPke9vWt3L22fuyTSw0ul7KNHkwwQF4tR1oUu2ebZpQ2i1gfaZRjO4ayth7rJfL9sgfuIlYS3vTLUJZJD9vFyqdn1eeHqBTV1+ZQjJvbI5fIlHHnoyOpwPS0qvEpTscVZCRjEM2dMA+yOoJwkniwmFG/5SkhKmjoZdkz+iDB1QC7jVvhURZt3x/3AR7J63Vb8g4vw9ZBxbviRJ8fVsC5TjBD9Dx5B+GoiJTuIca+isTMcHWoDxuQmDjBrMobDsSweH7xZ2SP1Ve3c7wP7WQECFBxQPQl+fkHxX3/PcW7mtSmR3TtNtPA8Pf6rAC8uA2m0So1YDkW3n5vO8uiUipbnz0n/RX6jGhFphCg1nqQf0qXy579/heWw749CMXezY0m6/wGnOrvT/noM0qK/M51xYfv8j6G/Sr8MuKIVi31/VW+nUKCAWPI53I5QVkvDVJ+PDrccqBKHzZfG0HfkQNl5DUG3qsBypx/FtN98rL/rryQxwuVXPJ5YJQZtHFiXJPTv8Fq1NlG9JoMcYebhqp8okb7F2mkqmf6YOASwGIHcMEW/oW5xOevcGqFazYz+WOCd48wZQhB7J0Ocv0iAZujOp/gnYrYlVk31OIIO189XqdMv2EEhoJVGybUslS3HNhWdt+/YSo4FyiWPD5Y+UlbIve6UvpOmgAvQYuBm6hp9IkoS2ZkXU6PGO9SnJ2r7mCVWxpKor9HSqBjLjVd/rCMJMaF2csODc+/JyUN4GdFr19gZpBNYyWvDEuSQ18X4jvK2KS1ZHNIg427a2gwx3"},{"_id":"cfile/root-cert-private.key","type":"cfile","data":"AhAULl71TpgpgmsR23myLpDr4QCaxhOqpMhkw6kinijl0GeUbOQ3oIabgVs7q3jMf1C4WphwunexulfGCXRJuqpSC6PO5ZRy+b4wvezDzbvcyCz1pszuZJk3VRw9galxt2BETOfPYhzIPlweSbc0+xeBD9mq0A/2xLFC4Z5PskCJ/I2M58/2uKehyuOidu/bukUJGODE1IALHOIWLoaxovsEMsH0dL4VvyvJt1xs3VxN+gcnXNkKlfuIFTwnNNADnaQduF7BDq3M89Swe45rmAdAy16/40xdSR7tY3/KGqanTbWwA84y1DDmLek7ftxn/P9wze1xPHfAJB7C3XVjcgxHHq7qhDVW1I5uGzxEjQi38fOCStOFjoWJIMFtzfbKk0iJJgILId+ttF66j6hEwPeUY9XJKcA7WMsbFKfpMLQmIYc3k8NASyd2sj8w0qMoPne0aElqtIs5MlsUtxnbyL6xhMiMXcJRJf4lGZBQFDtY/qgYNoy21T335LgtAaCGHyKIbbZ49NYkaydxjmnWzAL0fCNFUyV/II03okUJvObp106yYD/B9BsRbEWd+f4vE3Woz0iHnM5AV+Bfz3UryaSI0G8PH+n2HeDchbToEf01l7SElE6QR+NvhngUAkd6PKahdfo2uzlO1PGiRVepPfpCMLSyjXYlENYve5IWmOB0W/zsePHYPdursxskY3oPasgfs4XJnLWmAMvLHdc6MK3mrpXYyvM6xMhghSIHTv3OpQkMD+K1ggAb2d6WgP6uDeJM+GAZKv6oBckJdgszCJ7wu0kc4nAHJpDY4pVb3XY56vIU2xJQUT8C9763WWwEtPcC7X+fAx2MP99Lsd74YpzkouPprDQ902pycm2cLk5wP+VeDjVy9RrCYN7LQBJOWtVYK6Hv7zTxRZNrI60RV8RJ8STg+N0iKA61ZLZyBy49S8TkpnZEmUCidvuDEImqTBfsEBGUzWrUSrBgWg7B82sqgPkOgC/GzqyGVqam9rW6vhds6yzB+IsA45anNlRHL9ieeBS1L1lkAgY+18xdyxjIPQjFAwvS8DTy/A0ZlGDU8/ikLwq9eSapntPTjTZwrBoAzKkbo6GqMQWY5uXzULD71xY8K1J2xrzOv6TU7w6nfu5DiLy4wVqiqqValsAO3vZX1Sk3d+b8mHxRwykIJwTnJCPXrYo8gYdLlqYkRtoO0b+1vgzNL4Cn3eUC9yrzBugvQd8+EmH4wRcRZFIm5UoS9nRR7P7Uu53UDhY3XMq2vqa8sUKaL6ewWc+vy/w4brbMfh6gVu/j0EAp5Nsnkbp+xAG8CJ5eshzOqrih3BK6lESxAaMnvtlwMHktsaQ/yqo8onNZj5SdPHW0SmEhrOjkRsQ8Fxmu8E7vVN7mQ8bMCZ3T79SUq3wVlpQLxWrWPNfcFpZEsA2pqc5x9MaFVrEtQXkbznvpY93+Y37mOEwqSlCb802mc5mhOhyfrL0vLR7Z2pTT14jIugbBlc/ogFd08Y2K3UlySdLmLmxZxoO7X7uFmoGB8iOb0JHutB5FchY/rEeLLXFdenJfIg6FSNsNgDaS074CzOXZVgohxiyncpV2F3EjDnfKNCEB30FJS+eVyQ9Q9ZDf1i1l34bQkRKIc7opKX+oJEiV33p0P7y9p2zpJbQOG5RA/lGq8MY4Zb1JfiBnZhk07qDUtIr1ykyjvWJXmSAfZaiQ3l+llYlQbJe2XW+WgXGL3oxp96ZanDNY5VQuVump9GsSBwCfHZy50VglTBwGzVv0hewnPIUTHcH5m2VAQTZaTb4tmMlCC6xMzjGapOcg6SLaEdVgd/TQfomiBm/s6lRTuDOqEzNKGGxdSC619+3NE3cd5aCsF5EMmBVVOv9Fjmts2JEL9ZOeXRNaHJSBGNOjMlaydwq1rrWcnckYVcbSmEq0RoAXK/GmmUhK0oCxTdmsfnSmbKS1fol+VLrfYqfZjPCxFWAMCx1RtBfP3FlkR4OY0KvTrm2xtbeuyNQyrHPVoceJ8JINaWsDldLw6MHHz0vXdys7LR7JEVMOr5yCFoDIngLyIGGlxcJVh5I58o0dfgYVb/e8JJc/rRb4p93vceehM9I+zbX1gwnP39uFXk3+gjSMrAJ2yIOZdMkde7QN73vF4U7/uS0R/7C35fD4BQKXMKWBKeUTuP8+QzxG0hEUAfiMTYXbpimf1iRoRrXEluB815RLC5P4qyoAfVEaiV1Y4u4bkGfHFOrmmG34QHbrqAEbD4wTPkiVEqvU+xu7dKKvq5KGO/R1s5ko154F2Geci/mypRxlq7QO+iVYXB4rVUf1RL0t4dtYJe33WHpVFnXBIlL/Xyt6jYCdTTCJm0SqFL+ZZRy6lrS41r+CnhRRbyM6aELwWj7l2uvTWKzWlCQHhpZbyEvVaCIe9F5iWPfxCfWmcvqYuTgoWsTc0dyOx0BFK4Evt4j0ue4pqdJ+26RFoEPjEVlfNnHo2RsDzQq8u2YI8d+VOYCnsvn87fd//XcEFRpLjeOGPz1sXqLADhD0036Ki823XmQnK3sYOzGWhE61VYqQeDDVprd5gjNIvYFQaK5qpryyUHXwf6H6mpMSgJOmepb9zIwoExbtg+RkhiRqjVd1LYvCzRoIgquCg74wLvUm8Ta8UYnYb20Ctt5GqjHtStXZNDxS+BBwg+zriQvnb1W5TrDXCQAP+jNoqpw6l9z8F3X5nT+9XO6W5s6ARgHf7RhK4G4mowY2nYezuBbZsnnjdJiwVoer9lb9v3HC3wp1StAu8K2sGHsSRJZS4B107GjBZyhH7bkF093x4bDIu8swUj1VHzzT3GQE67OcrAcnoX11AkHTnlGQADcWK0s/4M8zbpJ+wVbhBdT/VWk9WVR6cRa34Sz9lFJGgvQ9U0hMLKyAhAuobwwlZtK5pxrMSx7avG5yGojcnVNUHR30bJJU4/XRB5gayeZZpoIIdpiejMYoFpOBr5zLCskZPNlbiPvxzFV+4iAswUwvu5ZQsC3LMSB4dFdGb8//WRqaQL+bL7zvakLiOoc2ZyNAmdckqAMuv+FGHNKhqC9eQYG0LXB7bDSmUeWD0oXu7H7Zk9WHHfubFKxmNtZilbw0tz9aIz+A9EzVmGCWL8cuSHQVToTNnJwkO+3dF7crjvlTg/88pW4pVwC8rnjmrI9TD9enrY133/K3res4yuHauD1geYaKqBLjacskCFjJRPasiZXHCavxD1pZviNMek1w8+BSJLlXceVeoXq9/G4AyoEL3NzYL1jxhm9hRuCOq86IZGmF+/wB95bSFZPMBepUc4xdeYxPAnT5An2zRVZX4WuH6C7+E7a8fA3cUg1Mui82fFBsppgXAaSLNgaHl2Skr2cqOkfS4sO7GdTFrVWi8Ps="},{"_id":"cfile/root-cert-public.crt","type":"cfile","data":"ZkzVjbwyBT1HJ4t+r66xeIcm11IIe3phRBZaIHnh4hMu+8HMqtS693t2NAWtRd1+LfypYgM2uQeZ1+7SAmZkRGfTFRP6wyWd3QtMz/zN26O2n7bx9PdlAG1PRwQ7e25Sx75a5O6d+INMJcyZjy9405Mdty8PCDREOyH9laiZTeDCsRNWyOQRjR4HVPgZA3GznsKaPU/pQCxvgtAfKVgw8ZGpAL0Jj2Vh0tPJIkPVcHXoZ1LJ3yBpBjJTHhekp0LJ+vGYqGKaYpRzlU8NysQ0EOCS5aHku1l1BQxIHYMWxGuFmjzhDj8nqgj65uJSiIedcnGqNsQ5od9h1uIE/sD/uCNRto7Dzc2U05Igy+hMFXxDIL0DvBBe+s5wGHyq/gwl/y/5p209v8S/l0CSYZXf7BY/jikaz0gRJky4xFOpUF8Q/sbeYKoVXnQDJYIC7XHvSLq2wNK32G1MPh1yxNzzP6FRgm+jLz1q7jqvv9qg6k08SV7TWsNZ43pIOXeRFYOtmrda0k5a5UGR/bD4dXTdwdZTrSQXDwISlclyGsDfKdA2zEWlZJpufvEV27E0Jks2YXdAice3l+vCL39HnN9VXrGiywq0GmwCAQmFWVdzXgoU8VMg7wG2Clf0qVn88PmAVo5w951uwn+ZcGDrJ6GdOlu0IIsEx7OH2iAkHNFI3tToqS6CZ80zq9BpedQEgrHkQTteyGCRYY42OFK/TvUvR9WrRkzYuCGKd8YgjO/ras8lxCHJkoembBXE5c/jVHZVOEdNu0LlbBCi4Qi04tk3NqrW3o92M6F8/W54kEWv0DwK463fxE1uc7miYCGryQheLjrKNkU1ijYmqS/YKNtFTqHrr8Jtg92bHjGoQwWVuSasd3NQ4/XSbczUB+khJLMXDTsj3vKwMRKBaIrDOqzQrCNekjbhSvhLIL74p2v/MR8LOGUJZn9JoIAad6IqKo2ty8ChKSW7F+xeRXfLd45fbd3/oGexP1di+fPWQq1pxgnzdiGuYKxEjGHVsRAPndtBSg+UfJXyl5dhQCjkb1iRx5j3JmZax2MGdCOQZDgkwiP1v8pytJoRXd1BsyVkCaWm4bPSJZ766tGNAJlYtRFJHpvlzzajTDkhhDgQ0WeUZ65AGDftfygkYHP4E8RC6q2s5POr6bqQSvrxvZtGTT/2MM54tpjTSxCgbhlxY0MKJVFw3M/99dI83ZRiOz9BqNr04FiJoiVauT8weEfsVzDGdjK3kVndUlRM7F91eC9+lh5wFRarzhfJbTx1NGkeSUNW8HvHxux/V2gTPYQxkFFeNGfnbk0BwLUQWLSNW9Sy5kyZQ2uy4GovgNnh8UsAyKmJr9h3qhjAjpiEU/CSIRK9P1epxw22JCsf7KF9ikYWmJbAOJ+JhPWGMLYL/wxSkLzsxIeehJWZlbrCRUIlQY4tt8ZeuVwU718xKeGBOyDwU8wP/5tO6zkzdT3Ls/DTDY4ul4nkuNpm1q3cT/jPtw+a/DND5qOVsUd4XJ7K3WLOx0bOtQSSFwX1jCif/6Cjenotn1vnDUw27eozFMZL2ztLyw291jN+JhmpxM7QCTqc4W1Qh4uHph7n6V9JNV+YXZLg3JTO/5Lub+4uDD1+Hb8FboAU0tdKPaEv8vsNoRXK/7tceB3u8X8HrPeJF8Wlh4p7X4GnmE4kpBlvUT4OPGqxehPQcrAIDqp+UpD77k8skAT+x47Ol+5qb4VX4ssRhw4GdiKp0SbLJoYTXel5xtzGlwrmoBcyW5Gv6AJ5Z967wvkP+F56LB8yCAZ039GE4SxL7js2biAmRIv3Jd1OiDVnESTO01MPNmkBbzs6Re/Nw7xtC7ZQjYCrStvfm1Eh77QgFpmUvL/1h2awRN5vmWo6tJkwR/zzR5TSIN6YTYo7yyDOGYdCLL3MoE6banpq+ZFv/W9L7COhNBCc4TL4LUab6sSqYsi70WMfG558CVF6oIeRU8O/PNc5lMkUbxUqv+4+6Uh8OdDdCc0nG9f8N58S0duf2xmDKqzzYuSRMe9qi/uzAmVtT6ghWJaXqTb8yHhUWAGIjkyqaa7TAqDeXXtyWsEIh8C61K3CFsHzTwoavYWE5wK0ZxlG/7PpKS5zwlnzuL0D2Syz3woyhCDHCV3neQ=="},{"_id":"cfile/swarmserver-cert-private.key","type":"cfile","data":"dhTh2paTTFR1yOMoyYz1sOyGt5ZiPn6i579/3toaCtPnYsZGL790xXT6vzYkR2GIjcL7u00Ji+WpYeHi7MYrTOo9c2Jta3ErWursiMvFpPKaXldh2Sm9z59kKDJRel+eU8FwpYRkYyqIjC5yYh335wLEEzAFAX5jpVTjqSWsVdaRjND2pmvIBjQfZeMH3RSsyBpmSmhvyyctuFCNXEZj6fPCsffxgqWpYpo2dz11LGbE7ipNeJPP5WijXJ8INj+sx71PH8IVzDDC55PPxzuZkVVSpNyZyoTG7eKsV19SWtQ+K2EAZIEGc5i+rma+k0iejpGyYKdkv8BHO8h2KdZtUVexZwd9vberIgOPnJmtSN5Cl0PzMSHb5Lzy+NvdGoR0T12EG9260OIUTbUxHQwCekHVmBKQ4iDwxSukCE/OIoJEpYiijwmSb8xM3u911sA9u6dNyTkdisIvGKcj0M3WA9t3vOkZ7l9YBglgdvEV+YrWUvKlwkfbl/x1fUeg/E06TXZCeM7AYQWnRZHxzofKMRaGZp20OOBEVUzjuBCSRj1WdQhOLU3l+IOB/BxksW8Dsflq091yOu6Gg8ir+hn6THfXsFWOJeZkbKlTDs8PSoD7elaUkN1UI36mzrJUUimn+cnNgKJkwIQ0RN5ymyw1vF0G/3GwnJ+8k8XtskScm6MrRv+zJaUQ02d/KVWn/T2I94xgeJmQipZbyaALi5LMQUHNnm8vGoRqE8JhzKztQunz49MkDwmsA2d3mqh0HesHH9oqaRedp0+rmAqQehubs6MzSYLTA1Y2sbz3cK+wbg76rpc00WWC2VO0B3tlrKFG5bVlKesUQfARWkVW5UUawLVDkDbuCjXqRXC1mTjwLHPLOTXd1Q0TB6kcHbaxLiR66XhmobYDHun8qgTgbZ5GBiuRY0GtcJYyqNbUE+gxFtqGenExBudzuOWg/cMOmB4hNyLAkz36JChe9nGHLxG2d96gyDfENg5mVIJdqz7EENLhI0mKOWve5fCzU1z9W372ZQhffEoBavkEkBMX0QiNHkD7zFerCu/CAOkNai1EGMvToOkQSAkZF58UC6WMKDif7mMWHegT3IlyxX+MUOaPYMSM0ImzyH9fH8qw4+/OwekUJ1Abj4sd+fkHL2oqjVNDHtkVeg79IBRZ52sppo/8mksDWeK7H5sMndzpjSeHmFRTzalwuKHsIw34ADbHhJnG8KmZStGeT4PNvGXWbkWjtTNpwoGLsT/gzZ4e8449UAmjZHyGeT1tW+qMT4IMlKzhmIKBeG2irBQbYejyvlPezD7weu+sPhs1IgKgktrGJs6dRqaIfnF7BtLwV6evwAl2mQDtoskGM538IhFXTmpvw5ZPDG1gcBjfDNnvzJuXXRVj42WzBM2adXkMs0EfAHVFeWHEn8UokTlwjm74S3iw/0e6w4ZISTEGYnaisFX65WQWkyndEoR6CnRQPUg0I5BX6dnF7St4IsvEL3lolyMIlZm8M9ZZZYt9qlOg3XZnwgazHWJa3iymS1u5keo0jY4opgaah79ToBi+fiRKyEPTc4DFtOy/8mqhlsveAjyV5661dYSCkC/FvqYAHIhteuxEOMeVTyAoPnLX/KNxKvY8LRDua4zy+wB1S7wqTr6ExiwiSUay5G/2WlV+8RU8h4zjW0O/5DdoIFbM2ChV5px4UiYPdopyXaWf5Mub4FP6hOp2VKot3jth0OTmZu5WacOv75vv9In+KTb+V/s9+92rrRC//IUVZv3Qk7yJVKHZmXwfvD4QT2C4aPgE3l2OJ/6zgmzGgcG4N8fp/9unBwNJfFB4AEGjOtY0DvVr+FQ85hU9rq+PInLRRlnMitC8AHGAuoZmhdayfdvRYB5py+doPpyl0/oqwlaQy5uUY0xifH+DZ6vFI7bi8fSzePVhcCqYNl5B68Vay0QvgrTMJI/Ad7urrS/X6Npl2qSOEQADzmjl2rdkZKiCH/rM0bGl8sGVEPJoWHoSv98OCgCTs8OdhS8uYccSSFs0ogm//OTwiI7oIVjzqNGw5DGhFgBXxYp1Sd8V/iN2gESTqIHZaNK7JFbJDFGrBzBPeHNSHnwJOSbHce+xe/xgFrdL8BCHuhSJ4Rkppl7UuhPvkOt9mLY/hEdYQIKIWYULcRoTGHQuJB2bxUXHghRtNpwvD6E3O59AB4q2l5xFZd+59bdZODI2hl8uFjGk+gnWJx9i/qovz/D0lVxrDPyHVeml8jyhjzf9lbS+oFCdVd81p4eJ9eEyEw=="},{"_id":"cfile/swarmserver-cert-public.crt","type":"cfile","data":"Hz/XBp40KBzUr/PIWqRdWRAdugtgiSb7mT/TdpZ2SgjHAefKslsWTbxYRXbxH3ruzgTqIuiS7CfMvziLQnR/ZDMEcDxAi/W6IMhWlH+9OfotlQXSXhNV8j6c556Rv80No+B2YMB7kBBKMrRJtwg352yC/vpeGmEZBERoOCzkbbl4KkCl2xTUeDketcVyuw7rVz6Fxkv3lYmzFGroPYYkork5RhJ9KYhjN7jeNsXSZ3fD0SO/rGUxL4qaXUeXbUunbIQztw2+QjXiYPQAku2I3vbKWMVnQb2ckJB5jxTHpKlep9mPuThkU5vmuKBj7Vj+W2QBTj1CWb0QAvem7fGEAeaEtrW0hmOOOechCCJw7tIsiUdw1OFvRaxpYZOeKOkZ55p7aIl9V7f4IiKN4exGWp6TJByBHD7Jk6TWy/WsXtqvXm6biQ17s7NsFmaBRbIhU+FWaX49VlBSmvCHwj1nspQuIWS6MvWPLX8vLscjZrc12sD4Ru+LjmItkdqFV83Ekj52dw7jCDHj3GtpzIqkfJffNNe6ZSIRU90Uhde0pZdhrbyNeSleR6i4eOBgxFLGDhwTD92eLHzdZTeuL/lWf2yDchyXnEQiT1sjC0wrTjOukSRflEUKmMaXhw11C6KcLPnbV5uye6UQEd2pHuCefm6ky0CNFX32g7I6W2J0JUiOAm3UjzUkpMow+HZEMY3xy1wCxv0uLuTJE1X83L2rIthUUSgxIghMfL01sZYvdeTHCNJbH4Y8+YeV4xwDYb+7sZNBTliaH+quSzkN5QrFjgG0Qy7emiAPVcv/L9jw6sDeS/nUqqUOJ2hJCQi2xrWKrVwHTEc3KD2pWOdbjWqd4ld3Mx2ZakBF9uYs49qcS5Z6MO9EsWyc4lhUwFq5w3OmgTHsYe5V4bxaAISbkWhoNePcr4yQekFlTi1s0YrovvJ0kWNkIHxBHCAV/plPJBMBA6kuvww/gKtVb6YT52QD087NlaAX7RjwWCm8uy8tn/HpItX7RSAOY8CSQ3y131Wc8M2Dr1JX4CyVvjJ8twO+c/MR4HFgY2jGcqepIGkZdz3BnYw3jC7zeas4qel0tRxoCRk3km9ncQYv8BIZAhcx35efSWEpTYRWSi/X49zDse87d65CVNS57x2RoKGpREhLqLxHQ6FciChrigw2obfa4w1zIylmwjrF+Orkh1pMPQ+VBGPUF2DEpsQ2F22xGXEJTqnVeFe+5zyX4aJ7gIVsXgnAUGx+Nz25jP3nlRq7RqtXQcD7dUjLX+kDsG8t+ubOXFV18traepflBUKq4i01N6RyJtgL+ALk4Lr3XTnw0p8WRBOA36/MDaYgSSuEH1bgUmVCbup9LPHYMyx1cFQToSgHXVf4hHdrDtqkKR+8QENrBVwFlhBdovTBb24gOtzQ/Qjux8qvu4jrDAN0SVmuXku1/7RcjrK8nsUdlhtBLF3NZrHoR0m/RrT8dSHdfogNlDdOHS+GUvxat16j5CWD1w5WTQBl95qU+3xhNIDLqmY="},{"_id":"cfile/swarmserverroot-cert-private.key","type":"cfile","data":"JiZx+e4Tzl6Gvucw+bDSJHVt3p3bOnHtUlZ7fcBc5j90WghvIMXrD6+BIyBubqZg5ZniYhDqVWR6FQ28u6ubB+UxeXkHbhR4sDebKvEcGwVWNAGDxsJ6q4wC13paBIAREl6eoTCAslXwRnMpkSDKKrSbgixfOeIIxllNsTdCRK21vF85JKIBkvkKvZ7B5lhzPiuNVX5iedtEK6qDRiO7PcfEZHw/WPdymYTIWHedCsPFbzElYWnWcBwp94KXS121kbF4qVWYURzzAkzampv0APO1ZMITFUmqVUuNwmYnACxXJMt1CfeVjgbnCrDRl5lLPWjCMsutnaBlxdp1u11snUkTXBdgnzhoPK5jJy4EzkcwDNBL1fxubF9IqZAytuTyyg1XWkqKNavajX07FhIZv9VXLswY6F2srlj1BqCkydh0bHVMxzA8pE3Abal5GsuqiuLSROe81paGvu+pYZrVgS6X9PWtrssFirkO6qwRQ/POoiAk/siFj/sYVMsCS7s0np8J8e0vfxmO8at65UcHI1di5J4mJxulmbl76ivC/GAtpE9C53GbJDfQl9ZE35DGX7FUejFrU8zS4ji2oNSHEjWq6rujcNyIhLbZ6PbPA49CkaA2S/X0GoEHip1QQZklSuuVEOp1fr69p+zOxxYHR8GIGKuX7jeDupAsoqHyao2ciF4uuM3KJpk6q1TXlMoXGNNH4TL2jl5B7KIboj/XRnveBRkpoJuWNk76pSkIJrzgW54luTXYja1+UdXhujlJuGBtyBMHQ4kdzuIAFRO0VfSKqt1q3HqxU6jM3N0WGx5NS3XSNmgVLMzHtXwJqocOVxXTWmiejitlP32AXuCRhX9WGQMRDOmuJQG4nkQLEHKOQO8gwXkVCHzK5DsKDFaf0fS7s/ajfHqrg7+zpgRD2DuYkg0o2VYPP7Zwm77rwLWclfHNdVFWf6KMtq9JPq4APR0nb9fIqc8IR2IREjVUXfF0Py1Og9ikROM+6VYgudhRIe2lWaffV78tuWSFMDz4k8uObJrWf+WPggaHKt9vzFPI5qKZomvNNrMeforxRjj0fAgY9hnWXi+4W5ga/hdf9XXozEKJAUBE4pZaokSGG0+q3f80WAiDupy7laQAylpPjDXW7PtO8cdxS/n1HzdOOdLlXcXaKUB8avDEnLi+YD+3JeMpyRbBA045KapBb+sBYvzdbUDAl5vTU1CYc4BdoeSrXuWa1D1WADdskxsZ7SuJTPntOQvNF1CHO9Y8J+1KtuMl4Dral78LCplFU70pWpd9NE8Sqacus/+0pghHKafq7gIiEbw244+P/xoM4QMxTE9E++TTx3OraW0HIi4aEvnTaz6/ph//fhQuaI81R6bgA+3D8zWt26oV9g7jFwMcVQwsRAxV2HpfcC59zqgHRFFBa8VcFYbD1KBEh2tLaBCdRGd+wmvzfPEbtCCgTK/zCRoja3h8HLBLtH4ckHD6tO6j/C6G4/LYXiFKmlbKiTwPk0yOkaqTs0OlHrBM53v3VwpAImoduqpYM6pzs/8kFR+yfhiVnLJ8QQwa4oErox2pnR4mcZdVENHftmkkW8IDQqJol2FHh4QNmhoAnTn81nonYSM6LaTvmrC+BjYxbyPobgDF9S1U2RdTF4HpG+n77RMChaFPr8wakqNH0TmUjSBjciTmmPnQjcudLZH5/NcEzJqf4MhkspIQsYdjzNhXfSWs7Qm59UsRNVpkwwDT0CW3JsDDF0zZ00BBNdeVAMnsoVMVgSb4wN+Ik3NtlQ1sgnlQnbFjNRF2i4ObTYGo1zzQ22hgrZsRf2IfrogjIWV55f0MpbaQWsAVZnGpcVtmYsfWgwnLIbit7EDEjWOy7M+V6Tavsgkd8Ub1i+tKUDMwW7j/J1L1tK5mbO63DM2QYZKWlTL72rq1ami3aLFkv+Y8LM6zrfWRlHvBVsInPJ7KnsVhuGl6CAtz2Z/C4BiNSdNNQFjusIzJ/wXNXnwWI57DljppFn7MaCSjuR6N0iunUAk0c0HcfWxic5ekN380acs+MpDcphsiby3SSLjWRYt7LxWMjJw9uP0J8x9Faq7xvL9om2hHk8gp1dEhja1k7uIb5sBMzwaJBlKN+gJNRusJ6xoVbC2jyO2Tr+xp0bUiBfbwzyPcjvDXfEXwCe8C7LOV//Bhm3rebPV9eLEh5FH3lT9jcCGKheywUeg3scFM228mqs8CCCu9GpGYrvKhQKTYsO6umXd3YgKqBT8fe3U5q/Q2t5ZQmnnATEZLmQ=="},{"_id":"cfile/swarmserverroot-cert-public.crt","type":"cfile","data":"aDVK5PwnxapoU+CIenjKfEdJEBpADYxfSwyyUU5/DabJmYdtJizyszd1Z5bxT8OWKukGDtVk+ZivwbzymfQaoR2tkK1X1YZe/rrke51O9BHmDiqK9hC0i+b0mF3SlQsO2nkG57ZQG+kFJsY/0JXcpudFBWaeIgQ+vExQNYQq3yMBlRCoajE8IcH3sSMwyGYc/G6o+Yu5hGMsobFJxj9avMW05nveEKSbqboF6JRBkJpMyPFzJMeo70x8Lq+eiw44/+TdAU64RKcGZB9/PqyJn8pNVknnSKUqWHsc20BaZcbhbuSo+9CxfWtfwIoBFMiTu/4pVT4D2J+6ma93hrlDbbcmBG4ieFSPKa2s0i+0wOpDtViWHPgEMtIaBwcGoG8YT2RVL2hHkjSgt+xyG9WLXsy7fElIdFXQVGZNU0zQKXLy16VkRxwzhfhefUW8XdiI6SRBnKPUlqDGFu9CWQHSh/SMtEOgVeMHzuqPDmL9V5LiqSk6BfYHwL3Ezm3N6PwcHSVsDCyeAGly/ox+TJAte/wzsRWDi31soFHXLTxoY66YWMawe7Dlux6AU+MN4QGln3GlJ0m+HnhStq+pxT6k9fCA6SRWCZHNNVXaf7bPBnHOXQBsoNd+wlk8SRp/IisRGGTlfAhz7MswZkA59rp5WsCViaVvm0zRQNk3vJ3SfkZ+GKN0G9NuIHsFQiiDqVnGLf5UtHiwghxCq6l1EJzrPPmzADQYPFVloLshCvH6v7P+VbQP0QHcqbib9TTqRwxxb3jiMnRABNK1U4Z4JTIxiUFKmG1IsKVrdXEQ43cv4v2gcYzy57AhUXHpz4Q4MybMFPX4BL0xPZYsHnqIbqXQuVHsylD3FOCqco2DTCR4KUFDphVzQaOZzvwR0JFRiMav+fB/7aMg6cG7p4p0zVFkvkf2JZVeahYFL6i0wI9MLGzHAZ3fvi4i4V2nfbqaPSAqcHytp3/n+KwtROvBbHWvGSq038hIP5KRuERDE0xb/AOhIAfwJcTi2zTtXTWO0qGM+/9lrolRLSEeTfaSYb42D3UapV8l087AzJ16Om1UWq9guuDwyIEw4J42Qe6EI4/6nW/6E8GIoR1sBR4wd3TEZxjg9ypYjCxSTIN3QWYbxr0+IXHcEcAxUke70Pg+F8MvODOsIDh/0UTR7VvNITF+qxGPa7rGwS5vvCgKFJwIde0u0NWUdz1Ziw/doPH6eKFLWMYKyBozjdI9ki8cXBFiE4zLnu4lqAnOdghB6457kNyc9Bsl80vJgMZPRt2jGiTuPxB1tZ1viGwhNZ0dR+zOguvvYxqBzL+d3dUReBJGyXVzlPRVs49FrjNMJ1mrlL4KMdHEgvOZlbBoIEMiCAaQglyg1G3R77wCfBYTWWCSRSx4ORENeJ6L9GLA7IFu641avODtvsZqB3XyEKaqZ7mMuPj7EkOkNwcN+u0TyKJldXI="},{"_id":"cfile/webserver-cert-private.key","type":"cfile","data":"MnYMycMl4jNtMo2be7+x5+aJVqAB4muiLAVkxtqJDfwR83oVPpjJmWQLZ5vRzIK7qLZze2L4/kSyWqD2pr7F06GfOQ2Mixm50hl2dE9hrlbmWclUaTQRb/s0q2s5Bm645faqFGU/KbH83qlYTrluBW1m0Mg0zsg+sslGv3LT5+QA4sBxreQRSmPKDO5BxCh8OrfLvioi+vZXw+9VwIbMJ0xIPXNVf/Hyrp3uzSSk0M7Dm7ds+N5FUbWfp/PwaabrVb8kSnMaiV50YVgdQ3XNVfcZokf4WRUYkfcpQBSYb0PQoBMBzhfI8Ky2RFR72/V6EixFrMeeCHadBFsBFZReXoh4Qx3ESTJ9jp1K63KVFlOWAG8dpq9e/b7+GZcPghhsiJ8hqpDohEUv/QI9N4LehB3vw0ZLOY4Iq8fsGO/rwhtyIhvFdb5zYNqZ62lU5MD8fV1CAlrwNTXIDQZPxmzd5ZW2eD5d6FEA3fh0HEHHecUsHJXBG7dvdP1HdoYgARfeYyLb/ydk7o5sTglpeOZSEuuGZpct/UivIFdhmdnxPbkEEK8AAxgQOF7tfEIEEybKiXnMVtFYYP2xqlusrvHq6AW5kiE/BmmFlun4amU3rrtAs2BW7WeXuKhCIHy4o9c1/9kJMLzzuGmDI9LOlu4b+Ox3n9VfifZ/E6KZ/00O+i/OH/y1VW22ZXC42KxjetD1UoXUmQSCQPywdzWAO2mDMIANRaZYYSnjb16tHp3Hx+OGzxNul981WDscRZNPdUcn37vyO26dzg0Aznm36p1hvoviF69+7+VbM75iMcWJBrvJ+JI4PKTB//f6n6BxDIh+JDrXKzT27EKV3o4U76PtZn7e9D5US6rRL7Ef8lQU3DIbLpIE6OL97g74JTCQOmP8YJYpSv7pLwBvTjKMME78A7Q5v8lmdwqcuek2BOzaC68TBIxk3oYpIY2iuRW/v1vsH0t4ai3PkH/qK122Scw6dUgtLEOKYmrgmhHSreFvma4EPBi0z1j6lusn1e0JaUcgkZ/2B/Q7xX83JkDCmSv8ALcCwWDaNdQHtDuRu/NfhHZbi82L8y6pM6WefbMg+Z7LKMXgt8IpQkCy+rZV0bybadSeFkoTGEX5mGW1k5mAmxeCFWR29Gz/wu3xOhsXbFWaLOJQXSCW76DC5z9Jky3UsODbeocJzy7IFPIm66Vzk9D7x9uOyjXQYAGS1vtA2JoQL6DDEuba4PcokcIWWRwM4bFKLKOg4Yr3rNhOBMTRdzcvuzniV4+QGb9hKthwIYOamc3k6SoxlH5RHuy+lAipqLLDYxYqfh5GwwRkCP15wNkTy2C06Gs+CTV5xRU2MKLwXofXXY8XsoV2GsXcmNNLXxGDwGWplexDnhV7tzH97ZVTJk5AZSbjAJK+FieSs/oNX/Z9B/h3mcbdgnp912QAQlt3PCtXcGqB1yWklCmer4lGFoVvb8KblKF/Mq+B3iuH+W01U+30qYRp0gRdS/Vgi38+UBrK+b3O9sondulCTETFkwvF4Ry94jBa0NEpzjMdKBb9eTrTzWNw90psS0ki/sdKZ7UpGNN6bb6J2G1a6JqbmOPA2gY74TnOu7F1sHiDJsWDMmWHRgozwLhYcnSOWJtDTh4D+EblcROGNmonbiuFBjMzSek4KpMoSJiJAadHwCAFjsFNuLrQ0bO7/BOxkKu1xxHAB3C1DIL1m/JqTFnq2ITMecP21xY5u180DsnBMfl7dQG87eLxdAWyyxp3wYGZincS2jSQE3VAybYGsMwAhVCprUrAA2wRfnIunybK0eVw/hJO2PVft1s1lmM3CBiJp9qT4QqpiodzBHFMK1i+QfcvigFq3AF4BmNT/a0lJ6HDjSKo46EDlrjjgt3EmnemhElp4idhubGrit8Jzt9fuvFd4fLPs0o4BXJUurjbi1hcTlIhg6t0aIgySyT4f3wwQlTPy9LOGWZ841HwQ/zP3Vlmd2WwRYdJYVHEPqA4bfc/2p9yHDvu20q1xp1ZpqL8XZ4iYm35q17IWduhjJJHXBgGF47Jmb9eGlYE3zFlZM1bTJgyg+oK9BT/axOWXzmZRgwa7uaC3843X/neadtQr5w2/JCXk1fsxjGz66+WWreG5CT2vvXtbxWTKbnkiBrGRaQW+ZdgPyDQAmOr00kmY6wZX/ZQx2v+MX41Ert6uFhx/hLMvn0dcZeF/CsrPWhhQWkyKo0Fkn0ojW+Iuwi9bg1nvgDNPqPdVzsbTNCi39Mr8+ebsedblol8ILZIFPOAu3mJx7rsnV19BaKjT+FVOtLgD3qCF+1mwH6nq333uWvTjcMHiAc6amy4ap7+eqhc98VoDldYkitMBto9TeqMlzu1tekSSyUL3ZnNNmfoHZGi4Fxbai6JIQWFgDFiMNxbP1+1C8qwaiu/2K0NxE0+t7Pqu2AIc07RhcdbRAbwp45QpKyp54U2SEVx3eShinMla7gs0t8KySzgUgXeDwy1rSrKUOv1c1lCn/WxGOFMRAgBBstLktV3a5JhZ0q3oBTPIl0z3DokW5PorbcZgPDipjbbxAH6ZUzLrv1ZKRaM2pZ3+d5cGU9KgGVHvMaoX2i1gSx+UwkMAl6iG7gMyZm6UZvcEXS1rTMKVAU0DNB/tG3gIeFwd2Ze8flgKlsErB04bmJV2ppNva3ei5gfjBMdfwFIT3jilzHhbENvFfQmaUXvOJlUYwRSzMGI1hheunI7kReoI5bVUG7+xwn22lK4a/05DEBcGfvLGKHrPBUU24par7ABUzr0jEBWkN1N/ZooRbNauHzDyKToPlKlI+wnjgwXonyYmP+gFcCTEMnwX7itqmkjaafarIVvPwd9B9ANvx9sKcRg65MDFFgvS4lwFRLUS5/w7dLkIZEK44qZ7XDbP1aPTssQsYwQ+48EXtpbEmioMkbxRaMPNS2kMFtd/UuGkV+gd1/f842yVRBpYNW8UrSvD/+Gr2Xx0bLxqu8Gj4N7hFGmGhfnY4CTlxzAgIx/x4XHW/wUP8rPVIrvz9131QybeoIY6RQo+5UhEQlKBwTpDMCTEphEyWoLlBItX1PgvDkztllcKyJq48GtttN0ED0hUwSv6vmngkcJ/qSc2D6uYsnoRkHfYFZ7gwNmyaD4eqX28WDvNc4GVZhvA9htSwJjzK7ByRoUvc29Mcd7aocvrIM03ZIgBP4nLoBckJ7jLDr7BSVsI8bcE9yRgejeFQ92gm8hASKvGTUIjRp4A7H9tsSrNaT3oPFdBXjJ1MVtg/RV82iY9EAziJY8z1xDEIA1Job9oXKf/RvPJYx3f5mFM0uKCjZyhl0hUCeBpDPAVAiEiiQ8DGUSnhv2sntVu+RPb3FNn0LYAhIMretvzsblaVhLdoKdGUPhHm4="},{"_id":"cfile/webserver-cert-public.crt","type":"cfile","data":"JyuiDJcTiqHDXq33T3rqbiw/qDLUlj5cbGx1p+OFq05VPqa9rR1vQvXW+eM7dh/z7Z734xqXp87LhqqL2gvmR81enKFT4xmqANtWg5Nmlc+Gj3LhD1b+xSeXDbw8fyJHIag/W89h2zZo2IRg2WqDLXh3qywrYbxgaC/UZ5zLiTW6L4M0+4O8GDmx8jkOIJXE8tNOLAnWOlOx0q3SxuD/SUtJF+4fQmf1fdNj4avvDaEy7KHrv/0NF2ZjR86Gsnt+uGZqM5VMrmqe05kljkYTgfquUb6k6Dd04UHlewyKiU0R8GmhuAXmbMYG5Efk2soabk8uQ4QyAnQNjTxTgm22N/DJSeAcc9X9P6yv7BZAmNC49Optmv0aeW6kHBQ6Knyzj/4gPFwsQM/UGKJXejSJ/AYrsMklc8Ufccf0Wtp8p+P8lrrAv1BeZsqWi3Q5KTD93hTcz3kY3lMqAe5C53ob/Dt+eYoHd4YFEtTgHHzX33ODAYSEIgeRFc3Hv6hYwea5xuEODGLoTkiwpqpfKGsJXyIGhOm1Fyoxq0cdvLB0mGkx1sSBknNB2MKe1bqD8h61tgc0plcJnmuO7yLhL/OdaBmYVG5U+knJTrzWZQN2sc54yhor7pYnDB3VRoxZC6cMhY9uPcKvI3dniz5dLdsAJGj1avZARKAtwu13WKa1+hwfuFEMxmZEbEbylQK04p6m3qRIB0/E7O6dPLrwwVM4bksNx0TjiJSLk5YF70iltPACWPrVUONcKXvmr3K8iSpxlv40Rtpt8kljTEtJKd25XG0BMgGM3BLvfFEGXMMeRx6x6gkaBJIVQ4fYIjd0NeIG/v5GjrWh4CIVxDGC+Fz4sTaWB5s+igrsjy/pY3bOHnYTs0VJLiPWCf4ZBNFzNRYYM2M4996LvkJSvaBWds9XrGEkYteyp5t32YAATrHCagJ6/wUnGP9WH52QcGs9XyNBYNTbnInvDn4Fx22/AKhFQ2fpfwQPxeCbsGOAi1Nt62t4XyFSBdP84qhVta6xeqHsYywqi6hzJPULCZTJqBO4+nZrEcfTvxkEDm5+kYeYpzCQ0rDCXt/nEZSdWe5AetrW9vkU1ITDYoXENVSPXCp4f3AVpFPKonTPFzOYmFwbPwXWxTVxZcTx6wnMspKbCBi8DdDghtBK/Y0j2he4zagPvPk2jqrp/XO4F8MlLXmLF5Wkb/Q+lWRLQ1T569qfR4u/qqEHvJuhvt4JNAafGgGiVeFMt/6GqRDN212UTCjVRMj9oDlpqwH22djMYAy9cKP95WNwo1MB//M+r/jIujELpKwbA+niLQkwV5vUGLLqGBo5yTC9AbsXRGgo657VUT69lOC9BFJyaCAV7M2n5ckhQGLbr9BwvNZY622pp25aixXiSzbqtuW663CCrBiC917gA3KfJyzzzUniLrxRrxvVemHzWjKyDvmf5abQXZgPiBA2mEMKzLFhCM4bfB12JM+O7X67Vg2lNiphRRKphdIBT7rcJ7mxGTxBSp/q5MR4e5Ut/QTKr6wSIn+VtPcr6RjOsAEbACIxwEeAMn6tL8cO2J0fssKodNBnQWBBiAzMm8OSz2wDN8qAuPH/PC+ww2oAtFahSea4UTPxuDeVpoL1PsprJdA8tgRyEvSWE8N16dzoXQxL6qg8U/erTbYgSS5LapodHzxc/ggxUHyebvHAHucPtxJoy3gqPaTVprQMJP/65CV/3M7U/HlHRGPX2jzX7CWtXVl4+CLKf50d1lBJYKoqfnCDKwSyMZAEZMO3Akgg1L3T2B+cWQ36/MlUDY7lvJsC7wNw3Q2a9kOHSiAISRhcG1JVRPgz91vR/hlsoEV4NW5wSzY1fHnEHbRgOK6XMLMYP0bKPOC6uMz12TIl8lM14BhEsPhs5jTWJZTRoheQ05Rt7qI9HJC3MbEvT109B1Julp7C6ZxZspQ+DbuEnZgVivEtW48j39IlWslTvfrASomR+/y7BTdwg2DPCBwJvlbjh2JcvVaxakooiAZtxV5wWIa1tbabVy/Q+8bUAuyuUDgQwEmN/DwwDnu/C/DatEYdc9Zvc4z6DA+rIvJQbbOYXR3Ek1SbUblbErNoFmlhXtDrqGMonP7Ovw566lfsuKw2W1MNnu0+Q8OZ1hSVLFzR/g9ZhikO3ZlU/e1fK1AGesuZDf0ZXuD09+KeABwj"},{"_id":"cfile/webserver-devtest-cert-private.key","type":"cfile","data":"CGS6EEbIMN2YPCDXZUkGLwOuLVXFZGCglcxI5RgqkH5iHzxZ0JSwMihxnOJ+SzFzmhkZRyvmStyddddJjQoLDt+bjrMDAwYFS+zDvwbxyPnBTrV12nbuHdfBgN2bExjlA6hb2POLG8Zptr3d74hrd8xC5ocQ/vbmehiVieQtlbs7Z2ukhSpFpoV+KDsBRbsNhUUyILEvm9JRF5YpXE/HfzV0j/OA253v+jWMHdz6WGiHInwDaAIUXEkY5+Tnjrad87X+YyVx2BuXpgOnAvDyXspeowZvjX+SZxr8dz2HSF0rMxm6yy+fszXiENu0X1XbWULaDoADRdObWS0zQMa6a/YQRn7hgApm6LUqxJB3k7WKj81XI8f0f/LA4tFEz4wXXcjq7hCxJf872racRZDs3vldtEe9jFiz2332aTUvI3FTEUME0vsG69zqJCtNZZevVQyoA11IxNMvOoM2BXFsUYv/7mPPonjvywpRqjqBddQM0B7DlBRPIwpR/kEU1SzAkAZDo/Hl1fSZvBVmtvFeWN3CJRnUTOe87wz83AJod3mtRfAE+itNoZW4ungpzdpRJsooXBmlB2YRYp6yQcKHV8wplI/WOTsiBtojp6RtyKnUkf/QvXJEflnOh99iJoKJ9DY5157UznoOaXZv6U9a+5kZR1b/5fYiZewfp20/h9O6hoy+7RUG0Ek+AH5qY8h/vI7kLV2B0jz/Me26wN8qwmnvw9nZaRImmAzHX/Zw5ycQwgJqFq71vlwNnqndJPvWYZwWSb3sBHDQB2gRtlX2lFCc1hPqj0PXmz1/vtNq3UtMmwYb+KFsrKIFDBiU0qAoMP7JcCd5XULeiFV/NzhkdvJaLTKZ1Yc3Pt4uLci6maHnbcyBycCbVuMJLad/2/b3dTcw/NAT0gpckcc0nft89q2k0d9AQH7chWKZd12h7AXIrDJKxrXIgfgRR3DM1ORivEugDXobjnmlPFi5MzGpFNvoULnL14SmjjSfYf19DYwTtqs/D/5xipDqz4wCuQcm9G1eQyWpTX+zUY4YcBcEMWmKNbqDupfya5veWQJ12tb61D1k+sxoJamdo7l+ZpIbPLoesqKx52DobZSROCeXDHKkdjNtfhzqwyKJhRlq6XqjamXtfx8/8S0Dz6S0N11gMWKxov3FNBcrFR9eZONWnDzAnKJCVEFjgDkerLn6PU/3G8j4HV/b0sSKNHI9rjAkm7jzajNK3pUKHNOZ7UWXymEd8SB+efYqwi3EGC0wLntbOW/drdp4b/SKa7uGFQ8cevBTC6NvewWUoA/etiLjaEEFSX2z0ZmcA6I4PJmFYtySbY+yA3iiJcOOMHSWb76X+uo1wrp7rhfKhk0gcTOb2xbgOqYkSv4OQ5GCJgPY9fcZVkkTLA9zL1kvBHzIKt4AWzFblpy3pIfBTHM3il3oZdP9gvWM3x7L/iZ55K3R43N/Pil7x2XfKN5HRpth2wzlTIpdHr0/73JLfmp+qwD2YpcRInJvyk36+RKDC04NcbGVqOL51WFheC5YzWpIcNR6ALElEoG7KYNVHJcT1XO1NBJ0zs5L4X+drfLvSoz/2u+uIjzh+fu04JM4Wk+iQjxHs2vvQ01i23W76YBN4HxHtxwis8/cdf/32guV+hqnbtuqE6nyCaMyQ475pGDvLuVyfJoIwLavHlCnDnq7Do4Z7UtRB7XzTp+3tIvHXfHCm2U0nSuSdLuG4Lc7vN6TqpK8MDDBVMLwP6u1ZNCU0pjEGTUg9K6eMg20D0qHufR54fGJsdRj0zL7egRb9km4uxjmSMZ4w4DlBhBjyvkf9dQFQKNmFopPMIu5izUtFFwkkHqaC9ZctgPEFIasmOOkf0q+iuEpn3v2ASBxPWLgzSNcoA8ia4WvkMIPq5dhDPe2t3G0RloxRnokv/wERq/sBU9m9cOGNoM++EYz5VN8XtocQt9IjBbHwpnu9zcAbWG8E0MtgwVVxGPj3/dS2Hc1nGPRUNdc7UwMF3EdjfaZZ9yUnRNPGmRh+Gl5ligsPy2M6whK8CFOvB1mbL7isjIZAKBmzpCPIfxZt7OzjMOzpDgg9/kB8HTAL51NyFrKy3qoHRl80SiVSEdBVsr27H2rTBxbZp1KRzHnCAMMWOV9EBqrILbDjsm+RxekTHqpKmYF0YFSbVZu0DhhLa/ZKFN18WBim5UW83o96Mo2JIjRZeiqJ3lrlUZ/GjWskiAcQ1wm5gNusVyvK4q5ttMer1bLYE27st2z9qk/clZe/BbEpRc1FVZYgyRyPug+m2CeDD5shZCs8+GVumZjldCD9gDQAb288INnzgBy5yv82PFIUWhYlYFTGBjfW8ACWsFPUTClCQIZ+UFuIdL4LZFAL12Stqyvl2SSHh73jfTcOaDs4sBZsf9PmsssIiham1omEtA0rxz1qlEY7QlWyAsqLz17O3fk+T1apOeHUqWqDzFcXHJ4CY/MQMTUVVvblWZabGYL7BHhgvarUNd9FsSVbtskn72FQe9tIXgWJhR5VCfgxk8LzpFp9rbyhDC3mSYaMkSHRNyr0ODCKcWQ+QG/D6IVv4NHVNBk4iNjuopZbDMVJyS1bP6U0/bO1Oew8GUXtejfvHyRGrFGygv50eoq/sYFQEkovYSTHtrtvouLnNAvVruQFZlLNZdi84/YREnXEUbrz/aljC+LP/ZPogvWKNFHVJ7fYe4QLMzfOSaRTBFJOvuKcy6qGSw/VBtYg0vAgu3uB0uh1XmScz2xU3RVq7Opdel5yBH5pmFGw6Kwbh0CPB6IvQdiw3JuT0BYUjPQv9PByCbpSR3iDVmy4RebSAg2uCbAZWeQ5VBq/WJ95PCu3YdQ02iMVnq6Io3BTTiJUDmCqRY1OsBTcTwvqKYTLSUU5M+upx31ptkarK/mnjEa2YAhUvqye/GmAYrfngUym7A/rNyYjTF6qQxoxksHAxrTzLkyG+MJcNF/WNBD/Y+OcrrnNomEZJ0I34Yt2GTtYHnMlJhU2AZ/hnTQdqFJTTx34s/aJvKMEcRtv57fJYE612sg4jj1yjJaCTEiIJEyBpQimdcfJqwwa3ZHGuh+0SyO5IoxaOU5/tdfc8TtuTpyh9SSVG1VUkkewSGuRp9dT68xDwcLE/+HH5QuZSt5PHUsZb4dOQ8ZVIyoHxIdBxSYCYdSHWnZQllGbghxZbneRwR+IjtRI85MQHp9Z7DyJ5ocMB+nUDS8uD0F8cfTuHJ96vPhOgOTgcvWeln1L9pvuziPL8adANFg2Ae8wr3TThvd7Ns0xggNfalcr2yx7NSOOJ80qRKlC2ThASUxTz89525p07GgZCgCcpaijrT9PqSDTaH8itwCUF6RDtFoCEH/tYFhNA=="},{"_id":"cfile/webserver-devtest-cert-public.crt","type":"cfile","data":"BXx5KScnrg918FXls9LAj5MT1vzpHTATwGpkhJDRKGBeWWSR0BP1GaYCP3WQQ8rqhUWrRS4eu5trr0Bs2lvsc3NaPHDaC00SGfBXXIY/zmSZdiM3Tvhar+0JtqyEJ2Jpzu9LJYey2e6IVZpSJZzmfKzfdryW9unAUIPYHPJaHp2uuAhY8TA1ZpaikpemtV3YhaZDZHb4LFwZEUBewUlZxhn+l+WctOJ7kDaWPdvQQFuzgFMlb/ium53VYuSyZ80nVx7UTQvk8wub4UdRT/50/J+TsJm+s/4Yh7eMm3G5AnapPpe34IA/4ilxO35iIJMpYQw9qSthXnqtJApOniJvUNIAcllKIjFSF8jAnaiHdJ3cuSPm30am7sdmkXcH3bEhYof3yUMwAs7LdlOgoTBL0WKBVM1fPned5hFMVSuypOJvhYJnVe5etkzSXTOWxlx7drl0dR0H/LrZKvvC4AYRnFwgzVPK5790C5AU9JdgRWOLdVikz6xjj5Ei17/7aNi/UXQNQ5I2+TqQC40cb2ZKaMszB2oWwcoFrb7JdYGpxyZwUbH4DaCmLg2jrhxjqpBAzHybo7IG9iD1ridf/uWYlL34rADgrNBK0w5qvLcLnCPG1wHFOqvsCzbp2Pk2u0MSW9J8S588U7CS8lfVsmu5S9yyFgNax1NGhuT9E//U633zOxoTl/asPMKWfWgpuBkHSOMNkLfBKgOTCMqQanq2/u/yqRRoQPMyVQvnHC+DPCFxe1vAzp4csiFB5asY3ZjzPUOTzG+YvcXXFnWNbzv7PGms2eElzt/NY2rp6cWm66sHC2iGuBH9vHONu5SoG+RiEjG49hObeproLHhEJHDizoIVzi7GvJoQVZhcjlzAaT8kgzzljQaCVAN7JLOlT+ecVIHRP56BM0DXBcusljHESbhXaR2iNaJIZ0+/HYAeEJJ+pov0UbRNxjA9nYwGoe/ifwpDyq7CubbuL70sYGKBKCXojDIIgHTOi0yw2eiLZ7kL6V2J96DVq8jnYOshiaZNIE32PqxFZPww1MMz95sPsMySrcGzxJFepO9qdIwcq2wF/JgqiL1lS2JL/lA4tlIU2UBcrEqzKkwe0RYrcCiplc1zRymcTmLoNB8GAowzVkQ+RGaXBPiowdQ5uImYu95vS7gDsZ0Pwds6tCJeJmOeoReqA7FenxKO2dqCZ7EFiwiwRWnp1gOoQ+Cxfls9eupyDlzLTbn5AMN5x95XO5mlgnI/dtYeYa3Kn57Sw5KZTSGok4g4nUEjcDoEQPKCQEFsjd6oJJa7dxIZpllyrWYSJNZGB3M92nMtTYfyTZ5T+ke9s5Q2kmfSKMbaNfUI/AhNxYpQ2KuWBgUjGdlySiTCq6rtmHLY0dL+ad7CSVOzaBb2omGH/pnMvNainbv7ffLl+teDnW9OxPpQLywewtx8dp8nrrL8FRmb4AZ6P3Uk+t5hmgktj+14cFlv6snFBY+U8HntJ1megQTxwMKMa+X/c+lk29NzkIDT+nUoNq4Qq57lJRs46uXR9nbyc2weHiAJ/129EzxLpHg9n9mG+KWM6SZ9UrG/ucB1k4BI112zOX04nmQpgFSiSAvKgtvmxFi2cwiLU6DOEZAPYVqRhGymYu59bJk/E8Qj/ngrr6imjQpygW7ozWNbqwkrvA7o+Cc0yOWqt6CGg/WCmvB+Yh6mRYUHYnu0W940/oU8DF34tbvcX+zSjvtp8ZBatKQ8AWPoXnWl44Na5GP/Ee/VR979puOwexd2E5Xtdvof3/HNY1n/UHr+/PUuAD5eAeufDowSxqVVNYjbIdmiSOpZ2Pp/4Z+HoNPimw15FZDxGpUoLOu7t8tsNx4y+0bmIxqzjYwaeX6kj2aaVRTMZmyDTR1jlSwbbrGWDcgyi5I1wD96pESbXYPczfFgb84Iom1HSEL6O3co+scfB0BDrF0+ihEJYYhqhM9EoEqhOL5WVT+mnKQ05RwheLjYEw4R+PgNuYIETxeptZb/Y+RdnKexYaoBKuX11k5XEZFzxyhDkgByYymbCySFOHANZCVQQMBlJteVlJOeaXvO1FyJbmlL2zO1vauByGRCSeiMIhS2m6ocN6mDOSbYefz5L6PKxgChRK0Hcq2YNIemTp0dlrv/18vgxQ=="},{"_id":"cfile/webserver-info-cert-private.key","type":"cfile","data":"xgLrOje9NMJhx0dFUOtZSShphV8b6J2ru0xk2EGhl1Xh3PEb9knEcFYhRBEq4glBwP3GCbhbVV5BsWNIKRa7D2MLjEVP1KQOYrtv1iCGCH2VMiFYL6Am1gL+ny7F7XJm7lha6KjJ3QasKzkGuYNSqzHoc5XTDGDZofH6ifsTuEB+Zpl/BcGbocZGysXbZh9d+w/ZTwIsNdkE92rFR9PQz+hBxoB0DTiQMmoqeCkvYaOWBVqIT1xKKd+4hk8gSBagbylfFX9PCDPGxxJdFahYN56i8nwq1KEvbO8dFQQWTvR4q4DhmfpAoZh5dGhWLgylC8Azo1G4kP8O2hWlgNWKK6AYi2DLqgZOZGW43cauXLC0atc/fhwT6wpVHMN1EiCK4ag6QD1VUxVZJaghuXxpjcbbbg7BrCi0Wi3X8okHXQFuXIni46Buq6Lqm/SulqbOQCIbR+TkpFiqRBTqpiULZXHKD44JEDgim9y50HhGu1NOJYDtKlq7qF9kIlaeqbM1uYUBphRTqp6WQxIXkrnX8XkKqloWmC8n/8e7lPr4teFVymQLD4KHlndBhV2QYqUTkr+EHFAaTcRbqqlnZI5UZhINo7w9/uuagNdScGzt3ub2twBbwh25f4+DaSgx8FHMYHu0x1+FgsVNBhfq3zNIqHgZvoy+Zoi1fPJcMIDPt+0ZXrIBzQlPZqLbsRXCNQig2/xs++13P0pRvfleLDcucEtQi4fK1QcoW7m4IjLAVntQaQvG44umNHbIZyW+ShjpZm8ls65ncOszPQmP2XoKWhqb12+FM6e8wOl7KytJx3MkdR1nTL1mrLAYiHXr2zI6p4YxZZTORceWfXA0ir58BMsFxMUPVRh9mi/LZyNa8mwaT98hOjOTXRw/pWeWC1ekerrlXrziSB849u42CJHEryawTlIRst4Q40tAoiZeF0tG1h4u6NQegyUYprH/elTXlLrso9aRP0pDUI/BawF12RthM4A9OOkZY/YXBC0QRy5Olh0KvLubv1pTu1Own2xneUhBmjmN4Pbx5i0Qc2SM2UcEz0Pv55DGlqQsSxlw3PTl/J+jIbGJulyNPYAS+GLnF4xya1Fo5gvI6hWwrN1oVanVGOgi3MS9T2SbeGCYE//QOlcnbyV50imZHQQgzjmJMarbDWlgl2Ls3aybAjDsxo9J1xz+6HYVcUOQ4nyuje0eqVJcrj9wZvoUdFuem1m4JpnB5d6HAnRtT/bM+GfQQME86YI2mEitYKge8Nu7/WFnz9HWczjqhJd6mdEx8XjL1S/uqNLxYKQI46BhJYOIIZwYVp7+XtRCr3RzwAYE0brAfPyWV+Wxpl86QFb8B0sLm/oy3YqwpS+RSlyFZAgw77FmmIYEl0glAhrM+1726wMayZDBv9GXma1YLn2LVEkau2kT6I5bt2I2fBN0rCAwGCFXq/JLTgAPtBuxUcH69P1/ltmjA0IFsFuzFHv7UBkJABKpK9/X0JMTQWGx6QBULuC/gG39Fvi5+mU1Yvx0VWB83spnzrWBPylK2T07qJkT+ho7weYdQp/FehaYRkbP70yOku5keY1/w82C9J41TBebX7jXuhldhsRpAqmv+Ik1DAIc/3HVuXpKa5o1jV17X+Ia7+CWsG8U/celA5+UVV3OWItq7Gdam9W3mgugrNzAnHuzWZn/k0BkiT7nQ1L+XgV3oOps4CqjaU26pU3lT2MC93C9LMvCVwvBbNCHz/JlRkgFBvXx2bJWEwbgmaCbPlIELIkT3QPjBls4ijuQEyV8ycWFWPeEWYSxVBfBjpBG9jO9oq4XHQNbh6vQsGcDWB2lAf2X3Sskaz6Ubzd7jl472WVnwKN/JvMfakU3QBz0MqBH9jB8LDrx0zuWuXo9ZlFqiClyjYXQmYcsiWGQr+oVGQnKMbMjd5ZVysZtZtovRduVDjS6WXHQ/jwjPOGrJVThT3jLueFz7wTEsZganqGuJGMsFuwkELSxP6k3yZCSWt5QCJ3IrF0jF22hmBH/d9PctKZJOnM+nHfSEvZw9/x2iyoE6IuGkvmosQavIHZEbqZqqqx13j2XJNrAnBembk94/E9JAuIMP2ufPYJqgK7w/r48cCB8+RTGcIOc5rCzQ40wLu2uvjL9ouFthbPOHuTLQw+JI4aoFBxJQYRsCS3qQJGXM430xAT0iCSUtJexVMeYIBHLpC59ZulReOIqxCwH89ScFs8+4aui74dfOXdM97WZqa6w6myw9+N1AOQwchAc5v1+ztQD4hGWC2ESMhxuEpQG2X7AOygnOgG7Dhwxjhme8wfbZtpBj1rNoLlJa5vL3VRv59EQsndFJ/A4JsiprIhM8NoQWgQo60XBu/LX5Xd81wYe92asVaZD79bo++jlnH+HQcs74AS+1YT7GkzJQSQjUFoogcuh8zv5tk8GzCGGwmEUn7BqkFJNo7IqrPEi9Iy3aXURGZiuHmQ8x+mGIXLhjlzhp25HG7Iq62fBy9zNv9ie+WR6uLXXqdeCIIcUiz1tQ843pbf/SUESNtNLb/UAx3X1x73iBwUoZuf3ZHnGrhmGvAYgOvgJ46yI6ymUlx3eJ44DI3/56FGpB8ZccCN+Tgt0dJHCQGN29CSXu9jgGsL/n1DqzQ49OK3Vt5QDIxE6qndx0fieJVy1cDr4w7DWrrshGWaZo19PsEMtkftjhwy19Hu4MgGXVlXtKhnF1l3+MSeoEainXcrwKMcQnPxpc7y/vejVBFC17QlkPjou7bOoePghYdt+Z9k9Um3hYbkhGAG6x1nlk9oLs3ZlxgR7FUJVn+f22OkR1+jNNP67wqJOCbi0zmtwmaPPeEWLIh6H0grZb9YR143UXC+lNSG1deL33xWe0JfX/0BKuL3eF5r47zi4oYX51THURJigJep2QCL2rRorYW1QCfnxhMeoO3ei+BvtqUdnLfgnW+Mm+BOKdKV/71QOi3Ix8wS+pq9doTdL0DEfcqzCx2ioOdFHRXtXrjYWNnPCrccspDseqjTPcXdOIM2CeD7uvVjyoGdSfiu5n6iKpiJOiyuvMkFfOTKKg1amHG2Zv8ugCKdMi/6/T6QZwX+LA2IUDuJMOhIRgjY7PFYtSDGVTi6cMh7lr5OwH8QYwSmYoS1eYObyDZhO55/OjFVlOd9hk8ZlTUIKu0n/KteOhdI3qEeSbYkokMeETsGn8Ud45WR9/Ng/1poPK7YcdUrw/YKLm/zuGKqSq5pjw6bxKnnrrL53FHJHQDxEDixptHuzTpGy/2YIORe7hyok1FR76JIuT6sRQj/1tSzLJbI0Xti2mz9PRL3MUH8VUBMJG3CM8b2fn7UbbDRqrkNuFewEC7GQkSEjLAwNjV+unIPKVW2hGrTu4B6tn2he7TkDUkEFIV0="},{"_id":"cfile/webserver-info-cert-public.crt","type":"cfile","data":"2Rom2SB4jbQeK3ZB0J8FNkfZf96rS1mVqqXZiyL9bSbEeR9DqrZAdt9C7ZZO949kmtKA4GNe2mxmn5PUkkY9urPXXmZ/z4gc7qzr5eqpxKp69oK98sx4PzQpYqjhURO5swtuMh4eao2VjArSu68mJITdbFwogseoPhYeu2be3MNd4XEZmadNtBV3jkw03YOKqO5PSfWPXgqdFMamkU4b4c+HfUC8zNSkpmg919+gR+ZLCKRLhxtdLnLZFJH9By6weKv+Ep87YU6w3JyT3ewZrRsszjvLPYJqKJsU4YMnFkuxtFsnaroln0+XFZsgn6LEBJMv4lP+C9TKbquJrD6bjzKeYgiIfIfGff1F7BMSQrOZUDM1vogFmW2nRghfEkoWCZOz1opHitZ/jHfrFC6rwBTwOVZqCNA5Z5c7DPw5z6QFx8926ArviHOu2Po6La1zrKuMgkneSPz9rBQhviBCbLQu9YRmuOZa9rg0FBBIC8c1S4cJowCrF2i0IzXJeJ031nDlV1tKukWehZ2HzOTDZM9+N/AeJ83xDd0Vrj0ugH5ew1erTkfn/PbSLaRwdu5RpiT9z+DbRHw4CmYhYtjU+h0sfpo54uwy+9pLdImDLqbxmhXWNc+A/FKAx2ZeilRpSSMgLQoNt11e6gNrdjM7strJ+EJYIgPjqieutufxoywXm+W/U6QiLIxxtmQuemfL46cOrw0PjlhtwboPSMHb27TBBGIOZ9rkVLb7grqkJpiT4TNv9H5KloiOFlt1vQ48EBlF0lgI33PKbz+47Lqfz/rhDCxM0e5i0skWFgETsXckeLZLOqow1vmoTkhUpG62oGWxaPmWKkBKWICyFnsfRkvyVRn/JJPYbPKcoqi9A4vRJX3MT4M5JYHXkQ9jTqfUdGfEAoE6P3jg66ieMR6jNWDOB9gK6zBDRKjcDwUd5i1/baX/+lxxqWb+N96HRJLdQgjvx51W84kHtFqEAX3m03dK7DupxGtgXufWEgHvAxgM5U+6/X1bcStpb3qiMlTE4bur5jfuc8ELdtZkm1N1sQ76P/5FVlOYFqbU9+Q0c/ka4UaEk8DLwqY7FrhpECWl4FQtyaR0nXrS9j3QMA81/8jx+YhRl10l8kIPfiSmC1DoWrfcrkecWxZQSi3IxWN5D5aV6xhrm5h3PLncHLD3bdgaQchkiB8zoDUg3pP3saN+kVmBvMdPZVzuhGJHa/HyN/5rJOkwbPZFpFZVNQQbYyOtuVfYa/KSUiy0RNtoXEMyirTdfoRhLsFMRYIZdfC9W6+LgHAx50C7uCFasrpf3dAkYmdrs2M9gkw4n0FljpStwQFZMn5Roj98Kg4HpBznQBsHArv0LlgCq3PYIrNdSNFZop/MkoDVxPhxqmKLPfB+DWbHlOuMHLM+oe9lvGa2u3hndWSGSif1eqk+Os3Q4/ba8OAlA0ogaciIsG1QFPecG4cAtVtzOxb1Hn6MGyrukFJ6Pu8ijrO79hKn0AOaXNVy/XVkn6KFMMWXk/KEYtmvwGRukMpcEuGf2KbciDaIxxm/c+2hTgnjJhmYQVMpyb1EvbU6zF2axqaG8+kdw8p0V39B6zpEnRjhJAWTW9HSiUJ4lcZSZGKjVoLvrvbbjIyn5TVO9zVkg++R0Tpy096c+JvlyKj7d6gEUojVXe2JBKXXN7WizvAS+PTaZqqQkz+CFc7kqfrgclNrYKoK9fQf68pffr5hRkL/TxFkS2P0uA/GzkPCOtDlTIXMTXiY61MWhhmWz48Bp7jheabBOvnG9GvK8rGWpPU8nhg/ncUNuhluyPkWVwcsGZyBmBSSiZ8PYh6j7y+yZ0EI6rxD7Pqf64c1R/CbOkfougFWdyHnvQx458tDx0lWGNhcCJv/5D0aY7z5LYo2s8PXeyVkMt/AInBdFykdqB+R+yhUlrU4cw1WMy7ntH8Bn8eXwo3HGopTKludZY0stvfU+0eTm2iSvA/5PCCGiLVB957o3ekcO1CyzgvnTjRH6E8AbM7INZoXimtuhPfyOySwOI4tOZDNlqD4gkBdB8srt1gt/TVLYK3N1VNjgJ2uKkLo+v17/Ih0LK65bzt3WjE+uhUidUL68/3PS9CkxSgS8tKqouFnMpPy2cnt8niahUSvtRwMKcNrwMicygEKIdZmQ++UX+OmD4dS/5MoRW6ASq2kTD4S"},{"_id":"dbconfig","version":1,"amtWsEventSecret":"5b79c3011efe0a85ba584e3f9cd7c4360f64955d8731bacbfa063a8b75dbbf91"},{"netif":[{"name":"eth0","dnssuffix":"mesh.meshcentral.com","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","type":"6","mac":"b827ebd083b2","v4addr":"192.168.2.125","v4mask":"255.255.255.0"}],"updateTime":1550885555813,"_id":"ifnode//5CY6T$dcePOUyo4YxZfpii0awTQp6l32vNxwK75nkTjah1kqPN5Mg8vRhNB1bZ3i","type":"ifinfo"},{"netif":[{"type":6,"name":"Mesh Network","desc":"Intel(R) 82579LM Gigabit Network Connection","mac":"001e8cf54fed","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.10","v4mask":"255.255.255.0","v4gateway":"192.168.2.1"},{"type":6,"name":"Comcast Network","desc":"Intel(R) PRO/100+ Server Adapter (PILA8470B)","mac":"0003470cefe2","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Intel Network","desc":"Intel(R) 82574L Gigabit Network Connection","mac":"001e8cf54fef","dnssuffix":"hf.intel.com","v4addr":"10.23.79.198","v4mask":"255.255.255.128","v4gateway":"10.23.79.129"},{"type":6,"name":"Ethernet","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter","mac":"a0369f02a96f","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Ethernet 3","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter #3","mac":"a0369f02a96c","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Ethernet 4","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter #4","mac":"a0369f02a96e","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"VirtualBox Host-Only Network","desc":"VirtualBox Host-Only Ethernet Adapter","mac":"0a0027000019","v4addr":"192.168.56.1","v4mask":"255.255.255.0","v4gateway":"0.0.0.0"},{"type":6,"name":"vEthernet (Default Switch)","desc":"Hyper-V Virtual Ethernet Adapter","mac":"0215b5e7a781","v4addr":"172.23.78.17","v4mask":"255.255.255.240","v4gateway":"0.0.0.0"},{"type":6,"name":"vEthernet (DockerNAT)","desc":"Hyper-V Virtual Ethernet Adapter #2","mac":"00155d4fc604","v4addr":"10.0.75.1","v4mask":"255.255.255.0","v4gateway":"0.0.0.0"}],"updateTime":1550379037504,"_id":"ifnode//5XnCB0vpWgZXf20BU1WViLDu0wTejjg7qiYTwfUgBznIZh0WYgK5$iIVqDPGqHAG","type":"ifinfo"},{"netif":[{"name":"eth0","dnssuffix":"mesh.meshcentral.com","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","type":"6","mac":"b827ebff514e","v4addr":"192.168.2.146","v4mask":"255.255.255.0"}],"updateTime":1550885555895,"_id":"ifnode//8MvKOVHjBmvbERotepDOazSKFEczzT0lD6pkR0Y2kY6rVT5iByWCLjbXVsffjUub","type":"ifinfo"},{"netif":[{"type":71,"name":"Wireless Network Connection 2","desc":"Microsoft Virtual WiFi Miniport Adapter","mac":"80000b6eec9b","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Wireless Network Connection","desc":"Intel(R) Centrino(R) Advanced-N 6235","mac":"80000b6eec9a","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Bluetooth Network Connection","desc":"Bluetooth Device (Personal Area Network)","mac":"80000b6eec9e","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Local Area Connection","desc":"Intel(R) Ethernet Connection I217-LM","mac":"34e6d72e7147","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.111","v4mask":"255.255.255.0","v4gateway":"192.168.2.1"}],"updateTime":1550885617820,"_id":"ifnode//9h5XPDmWPFf9VKv8uwNjK@hUx8oAPRpeUjbL3bRM7067dn1nkyvYIfwXsufDrXSS","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet 2","desc":"Intel(R) Ethernet Connection (3) I218-LM","mac":"b8aeed733245","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.147","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"}],"updateTime":1550885556932,"_id":"ifnode//ECAI7NO893JoN3ntK7@mbniyDq0qriG82wqGKQF4s8SpXs3NdnvuHR76Bzq14Pik","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) Ethernet Connection (7) I219-LM","mac":"9049fa034ade","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.139","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"},{"type":6,"name":"Bluetooth Network Connection","desc":"Bluetooth Device (Personal Area Network)","mac":"3413e893c410","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Wi-Fi","desc":"Intel(R) Wireless-AC 9560","mac":"3413e893c40c","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 2","desc":"Microsoft Wi-Fi Direct Virtual Adapter","mac":"3413e893c40d","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 3","desc":"Microsoft Wi-Fi Direct Virtual Adapter #2","mac":"3613e893c40c","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"}],"updateTime":1550885553234,"_id":"ifnode//YRGm4AQVRR38Ypisuo40KhvBGhDl2pE5YCp4j4eIbLaX3kmH3tmumOUbxb44A@Rh","type":"ifinfo"},{"netif":[{"name":"enx00e04c36415a","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","mac":"00e04c36415a","v4addr":"192.168.2.137","v4mask":"255.255.255.0"}],"updateTime":1550885555150,"_id":"ifnode//bCQgn$j077x65muhUe1$OAaMgEmseq0trqfGqx0@Doo7sCwvlaoKvAubiMxqAqUg","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) 82579LM Gigabit Network Connection","mac":"00224d996b15","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.106","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"}],"updateTime":1550885554429,"_id":"ifnode//cxnGVtHKLyLyNRb814cTFhMxnm6vUSjWLqYn0un9Yiu@4JKrRxu9k1mzsUIixbv6","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) Ethernet Connection (3) I218-LM","mac":"b8aeed7f5469","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.133","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"},{"type":6,"name":"Bluetooth Network Connection","desc":"Bluetooth Device (Personal Area Network)","mac":"1002b5682f5d","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Wi-Fi","desc":"Intel(R) Dual Band Wireless-AC 7265","mac":"1002b5682f59","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 1","desc":"Microsoft Wi-Fi Direct Virtual Adapter","mac":"1002b5682f5a","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 2","desc":"Microsoft Wi-Fi Direct Virtual Adapter #2","mac":"1202b5682f59","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"}],"updateTime":1550885554679,"_id":"ifnode//ggifepc5wqK7sCVnOIjOZy9i9kaJizalIarz7Qwe5bJ4icpLD69zWYpjAaU@sfY$","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"ASIX AX88772 USB2.0 to Fast Ethernet Adapter","mac":"c8d719d8069d","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.117","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"},{"type":71,"name":"Wi-Fi","desc":"Intel(R) Dual Band Wireless-AC 7260","mac":"f81654405d17","dnssuffix":"wifi.lab.net","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Bluetooth Network Connection","desc":"Bluetooth Device (Personal Area Network)","mac":"f81654405d1b","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 2","desc":"Microsoft Wi-Fi Direct Virtual Adapter","mac":"f81654405d18","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"}],"updateTime":1550885553328,"_id":"ifnode//hPIs53zBqqPkyKaLTi2oegl3O1FNRnC4YdheQGx@uFIq33PWHLb0Ru9ghRa3qQ7h","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) Ethernet Connection I219-LM","mac":"d45ddf134db4","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.122","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"},{"type":71,"name":"Wi-Fi","desc":"Intel(R) Dual Band Wireless-AC 8265","mac":"44032ceb1284","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 1","desc":"Microsoft Wi-Fi Direct Virtual Adapter","mac":"44032ceb1285","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":71,"name":"Local Area Connection* 2","desc":"Microsoft Wi-Fi Direct Virtual Adapter #2","mac":"46032ceb1284","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"}],"updateTime":1551086856134,"_id":"ifnode//hfbJ7zAgwZK@LQfsZkr1cqTSp6mjjZ3MjGC$v4X8E7HM1cZEnlGBgcorELu1hZWe","type":"ifinfo"},{"netif":[{"name":"eth0","dnssuffix":"mesh.meshcentral.com","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","type":"6","mac":"b827ebbcab6d","v4addr":"192.168.2.118","v4mask":"255.255.255.0"}],"updateTime":1550885554792,"_id":"ifnode//p3HOhDapgT@VyO$upGJYxEa$v4YCY76Y2G@hOGmJnbPXjkSHP@AgJ1M6FkqSEUqg","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) Ethernet Connection (3) I218-LM","mac":"b8aeed73319d","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.138","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"}],"updateTime":1550885554532,"_id":"ifnode//tyR7l2j5@wOjDeRbOQNfjU7xB$ss6VZQPDkFsALPzJ4zbTI4IamV$OdwHeqiXV0K","type":"ifinfo"},{"netif":[{"name":"eth0","dnssuffix":"mesh.meshcentral.com","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","type":"6","mac":"009027794d55","v4addr":"192.168.2.140","v4mask":"255.255.255.0"}],"updateTime":1550788151686,"_id":"ifnode//u$Ys81cgdCynYfh0i8FkgLE8Nirv8o5zu9aamWyWMoAWH1@ymVfYblbm5435VEdW","type":"ifinfo"},{"netif":[{"type":6,"name":"Mesh Network","desc":"Intel(R) 82579LM Gigabit Network Connection","mac":"001e8cf54fed","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.10","v4mask":"255.255.255.0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91"},{"type":6,"name":"Comcast Network","desc":"Intel(R) PRO/100+ Server Adapter (PILA8470B)","mac":"0003470cefe2","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Intel Network","desc":"Intel(R) 82574L Gigabit Network Connection","mac":"001e8cf54fef","dnssuffix":"hf.intel.com","v4addr":"10.23.79.198","v4mask":"255.255.255.128","v4gateway":"10.23.79.129"},{"type":6,"name":"Ethernet","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter","mac":"a0369f02a96f","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Ethernet 3","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter #3","mac":"a0369f02a96c","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"Ethernet 4","desc":"Intel(R) PRO/1000 PT Quad Port LP Server Adapter #4","mac":"a0369f02a96e","v4addr":"0.0.0.0","v4mask":"0.0.0.0","v4gateway":"0.0.0.0"},{"type":6,"name":"VirtualBox Host-Only Network","desc":"VirtualBox Host-Only Ethernet Adapter","mac":"0a0027000019","v4addr":"192.168.56.1","v4mask":"255.255.255.0","v4gateway":"0.0.0.0"},{"type":6,"name":"vEthernet (Default Switch)","desc":"Hyper-V Virtual Ethernet Adapter","mac":"0215b5e7a781","v4addr":"172.23.78.17","v4mask":"255.255.255.240","v4gateway":"0.0.0.0"},{"type":6,"name":"vEthernet (DockerNAT)","desc":"Hyper-V Virtual Ethernet Adapter #2","mac":"00155d4fc604","v4addr":"10.0.75.1","v4mask":"255.255.255.0","v4gateway":"0.0.0.0"}],"updateTime":1550273193047,"_id":"ifnode//w6SZkaty2wrfKjc2eHWEMP49Chs52AI7pBTsW5VERYfUukks9js6oLezQG8AfHTJ","type":"ifinfo"},{"netif":[{"name":"eth0","v4gateway":"192.168.2.1","gatewaymac":"0016b6295e91","type":"6","mac":"0c9d920c20af","v4addr":"192.168.2.112","v4mask":"255.255.255.0"}],"updateTime":1550885555229,"_id":"ifnode//yjbMXlQBf09TSIqKlkwrRucm767TcXfNbSinQWXgpdBBY5MEU1gg0kzshwiwFCOp","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) 82579LM Gigabit Network Connection","mac":"00224d996b15","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.106","v4mask":"255.255.255.0","v4gateway":"192.168.2.1"}],"updateTime":1515724630835,"_id":"ifnode/devtest/@yw$s5jLUivpzZ49laprt4T0sBaOKImbDAiniothQwccZPukCB696$BvPWAW0Bg2","type":"ifinfo"},{"netif":[{"type":6,"name":"Ethernet","desc":"Intel(R) 82579LM Gigabit Network Connection","mac":"00224d996b15","dnssuffix":"mesh.meshcentral.com","v4addr":"192.168.2.106","v4mask":"255.255.255.0","v4gateway":"192.168.2.1"}],"updateTime":1515610973068,"_id":"ifnull","type":"ifinfo"},{"_id":"ipLocationRequestLimitor","value":0,"day":"1/21/2019"},{"ip":"192.55.64.246","city":"Santa Clara","region":"California","country":"US","loc":"37.3541,-121.9552","org":"AS4983 Intel Corporation","postal":"95052","_id":"iploc_192.55.64.246","type":"iploc","date":1547225972174},{"_id":"lcnode//5CY6T$dcePOUyo4YxZfpii0awTQp6l32vNxwK75nkTjah1kqPN5Mg8vRhNB1bZ3i","type":"lastconnect","domain":"","time":1551120797667,"addr":"192.168.2.125:51589"},{"_id":"lcnode//5XnCB0vpWgZXf20BU1WViLDu0wTejjg7qiYTwfUgBznIZh0WYgK5$iIVqDPGqHAG","type":"lastconnect","domain":"","time":1550788973419,"addr":"127.0.0.1:57031"},{"_id":"lcnode//8MvKOVHjBmvbERotepDOazSKFEczzT0lD6pkR0Y2kY6rVT5iByWCLjbXVsffjUub","type":"lastconnect","domain":"","time":1551120797716,"addr":"192.168.2.146:37453"},{"_id":"lcnode//9h5XPDmWPFf9VKv8uwNjK@hUx8oAPRpeUjbL3bRM7067dn1nkyvYIfwXsufDrXSS","type":"lastconnect","domain":"","time":1551120799314,"addr":"192.168.2.111:63165"},{"_id":"lcnode//ECAI7NO893JoN3ntK7@mbniyDq0qriG82wqGKQF4s8SpXs3NdnvuHR76Bzq14Pik","type":"lastconnect","domain":"","time":1551120799298,"addr":"192.168.2.147:53878"},{"_id":"lcnode//YRGm4AQVRR38Ypisuo40KhvBGhDl2pE5YCp4j4eIbLaX3kmH3tmumOUbxb44A@Rh","type":"lastconnect","domain":"","time":1551120799296,"addr":"192.168.2.139:49226"},{"_id":"lcnode//bCQgn$j077x65muhUe1$OAaMgEmseq0trqfGqx0@Doo7sCwvlaoKvAubiMxqAqUg","type":"lastconnect","domain":"","time":1551120797436,"addr":"192.168.2.137:48501"},{"_id":"lcnode//cxnGVtHKLyLyNRb814cTFhMxnm6vUSjWLqYn0un9Yiu@4JKrRxu9k1mzsUIixbv6","type":"lastconnect","domain":"","time":1551120799297,"addr":"192.168.2.106:58034"},{"_id":"lcnode//ggifepc5wqK7sCVnOIjOZy9i9kaJizalIarz7Qwe5bJ4icpLD69zWYpjAaU@sfY$","type":"lastconnect","domain":"","time":1551120799282,"addr":"192.168.2.133:53789"},{"_id":"lcnode//hPIs53zBqqPkyKaLTi2oegl3O1FNRnC4YdheQGx@uFIq33PWHLb0Ru9ghRa3qQ7h","type":"lastconnect","domain":"","time":1551120799325,"addr":"192.168.2.117:52536"},{"_id":"lcnode//hfbJ7zAgwZK@LQfsZkr1cqTSp6mjjZ3MjGC$v4X8E7HM1cZEnlGBgcorELu1hZWe","type":"lastconnect","domain":"","time":1551120799297,"addr":"192.168.2.122:49679"},{"_id":"lcnode//p3HOhDapgT@VyO$upGJYxEa$v4YCY76Y2G@hOGmJnbPXjkSHP@AgJ1M6FkqSEUqg","type":"lastconnect","domain":"","time":1551120797582,"addr":"192.168.2.118:60423"},{"_id":"lcnode//tyR7l2j5@wOjDeRbOQNfjU7xB$ss6VZQPDkFsALPzJ4zbTI4IamV$OdwHeqiXV0K","type":"lastconnect","domain":"","time":1551120799280,"addr":"192.168.2.138:53966"},{"_id":"lcnode//u$Ys81cgdCynYfh0i8FkgLE8Nirv8o5zu9aamWyWMoAWH1@ymVfYblbm5435VEdW","type":"lastconnect","domain":"","time":1550788145997,"addr":"192.168.2.140:43807"},{"_id":"lcnode//w6SZkaty2wrfKjc2eHWEMP49Chs52AI7pBTsW5VERYfUukks9js6oLezQG8AfHTJ","type":"lastconnect","domain":"","time":1550273186991,"addr":"127.0.0.1:54535"},{"_id":"lcnode//yjbMXlQBf09TSIqKlkwrRucm767TcXfNbSinQWXgpdBBY5MEU1gg0kzshwiwFCOp","type":"lastconnect","domain":"","time":1551120797486,"addr":"192.168.2.112:59913"},{"_id":"lcnull","type":"lastconnect","domain":"","time":null},{"type":"mesh","_id":"mesh//542dea438e6065bffa9318c149e9982440dba4ce6ba3ba2b577e0e127b6a7f24","name":"test","domain":"","mtype":2,"links":{"user//bryan":{"rights":4294967295}}},{"type":"mesh","_id":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Lab-Computers","domain":"","mtype":2,"links":{"user//admin":{"rights":4294967295},"user//bcpd":{"rights":4294967295},"user//demo":{"rights":4294967295},"user//redge":{"rights":4294967295},"user//ylian":{"rights":4294967295},"user//ro":{"name":"ro","rights":256},"user//c":{"name":"c","rights":4294967295},"user//robert":{"name":"Robert","rights":4294967295},"user//aa":{"name":"aa","rights":4294967295},"user//joe%2Ebob":{"name":"joe.bob","rights":4294967295}},"desc":"","flags":0,"amt":{"type":2,"password":"","badpass":0,"cirasetup":2}},{"type":"mesh","_id":"mesh//994a35a3ffcc0b3968080ec73add4bdb5f1317152e7db0b0c3caf7144eb1556e","name":"test","domain":"","mtype":2,"links":{}},{"type":"mesh","_id":"mesh//UE0kxwDwTXkSUtSvrF8W24iOkO@dRUOU5LMtPKA@powM68T7omPqSJM6gSXqLDKq","name":"MyHomeComputers","mtype":"2","desc":"","domain":"","links":{}},{"type":"mesh","_id":"mesh//lm2AD7PVRyTkGqXXqVPpWCYthR8WjQC5v2r$sS39tT207MI190MqeXQfdMpgUxvW","name":"SampleMesh","mtype":"2","desc":"","domain":"","links":{"user//test":{"name":"test","rights":4294967295}}},{"type":"mesh","_id":"mesh//nanrglVfQE5teW1fRPUY3lgZ2LvLnBnJ9ubzvDpfnRYX3T8Tsvp0SHlY5vgk58pA","name":"Test Group","mtype":"2","desc":"","domain":"","links":{"user//admin":{"name":"admin","rights":4294967295}}},{"type":"mesh","_id":"mesh//oRdanQLDwNTP9BXftlic0g2u0QW59$y4xY15aqpZ$O9oUfjwpTDu5OLe@5lQzEQ1","name":"MyHomeComputers","mtype":"2","desc":"","domain":"","links":{}},{"type":"mesh","_id":"mesh//tqni$zxbaBI2ko4MerpTDcOBs5AK22NNLb7LIn6zs46K3@2d1DtC3bESX81EP1H4","name":"tqni$zxbaBI2ko4Mer","mtype":2,"desc":"","domain":"","links":{"user//admin":{"name":"admin","rights":4294967295}},"deleted":"2019-02-21T01:35:16.984Z"},{"type":"mesh","_id":"mesh//xYMpQG$jfLh6nPzpCbdHwoiT6aXWaki2O7DJY0LLuNold2Cz71sq@kFtxqS9Hxa8","name":"MyHomeComputers","mtype":"2","desc":"","domain":"","links":{"user//b":{"name":"b","rights":4294967295}}},{"type":"mesh","_id":"mesh/devtest/8CvC1wI7ivS289DcIUcMwXivGD2nKuj5jpUQ0qBd5Xd@R@jGkKSAA24A6UA9YRTe","name":"Test","mtype":"2","desc":"","domain":"devtest","links":{"user/devtest/a":{"name":"a","rights":4294967295}}},{"type":"node","mtype":2,"_id":"node//5CY6T$dcePOUyo4YxZfpii0awTQp6l32vNxwK75nkTjah1kqPN5Mg8vRhNB1bZ3i","icon":5,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Raspberry Pi 2","rname":"raspberrypi","domain":"","agent":{"ver":0,"id":25,"caps":30,"core":"MeshCore v6"},"host":"192.168.2.125","osdesc":"Raspbian GNU/Linux 9 (stretch)"},{"type":"node","mtype":2,"_id":"node//5XnCB0vpWgZXf20BU1WViLDu0wTejjg7qiYTwfUgBznIZh0WYgK5$iIVqDPGqHAG","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"DevBox","rname":"DevBox","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"127.0.0.1","users":["DEVBOX\\Default"],"osdesc":"Microsoft Windows [Version 10.0.17134.590]","intelamt":{"ver":"8.1.71","state":2,"flags":2,"uuid":"d9837bc5-4ea9-e111-8ba1-505054503030"}},{"type":"node","mtype":2,"_id":"node//8MvKOVHjBmvbERotepDOazSKFEczzT0lD6pkR0Y2kY6rVT5iByWCLjbXVsffjUub","icon":5,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Raspberry Pi 3+ #1","rname":"raspberrypi","domain":"","agent":{"ver":0,"id":25,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.146","osdesc":"Raspbian GNU/Linux 9 (stretch)"},{"type":"node","mtype":2,"_id":"node//9h5XPDmWPFf9VKv8uwNjK@hUx8oAPRpeUjbL3bRM7067dn1nkyvYIfwXsufDrXSS","icon":2,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"DellWin7","rname":"Dell-DEMO-PC","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.111","users":["VPRODEMO\\Administrator"],"osdesc":"Microsoft Windows [Version 6.1.7601]","intelamt":{"ver":"9.0.21","state":2,"flags":4,"uuid":"4c4c4544-0057-3310-8054-c4c04f4b3132","tls":1}},{"type":"node","mtype":2,"_id":"node//ECAI7NO893JoN3ntK7@mbniyDq0qriG82wqGKQF4s8SpXs3NdnvuHR76Bzq14Pik","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"MeshLabRight","rname":"MeshLabRight-x","domain":"","agent":{"ver":0,"id":3,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.147","osdesc":"Microsoft Windows [Version 10.0.16299.192]","users":["MESHLABRIGHT-X\\Default"],"intelamt":{"ver":"10.0.56","state":2,"flags":2,"uuid":"41646200-ac01-11e4-b405-b8aeed733245","tls":0,"user":"admin","pass":"P@ssw0rd"},"publicip":"192.55.64.246","iploc":"37.3541,-121.9552,1547225972"},{"type":"node","mtype":2,"_id":"node//YRGm4AQVRR38Ypisuo40KhvBGhDl2pE5YCp4j4eIbLaX3kmH3tmumOUbxb44A@Rh","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Coffee","rname":"Coffee-x","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.139","osdesc":"Microsoft Windows [Version 10.0.17627.1000]","users":["COFFEE-X\\Administrator"],"intelamt":{"ver":"12.0.20","state":2,"flags":4,"uuid":"03fa4990-de4a-4990-fa03-4ade9049fa03","tls":0,"user":"admin","pass":"P@ssw0rd"}},{"type":"node","mtype":2,"_id":"node//bCQgn$j077x65muhUe1$OAaMgEmseq0trqfGqx0@Doo7sCwvlaoKvAubiMxqAqUg","icon":5,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Latte Panda","rname":"lattepanda","domain":"","agent":{"ver":0,"id":6,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.137","osdesc":"Ubuntu 16.04.2 LTS","users":[]},{"type":"node","mtype":2,"_id":"node//cxnGVtHKLyLyNRb814cTFhMxnm6vUSjWLqYn0un9Yiu@4JKrRxu9k1mzsUIixbv6","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"AmtMachine7","rname":"AmtMachine7","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.106","users":["AMTMACHINE7\\Default"],"osdesc":"Microsoft Windows [Version 10.0.17763.292]","intelamt":{"ver":"7.1.91","state":2,"flags":2,"uuid":"2cdf2ab0-7eb7-e111-a30f-001320e77720","tls":0}},{"type":"node","mtype":2,"_id":"node//ggifepc5wqK7sCVnOIjOZy9i9kaJizalIarz7Qwe5bJ4icpLD69zWYpjAaU@sfY$","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"MeshLabTop","rname":"MeshLabTop-x","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.133","osdesc":"Microsoft Windows [Version 10.0.17134.320]","users":["MESHLABTOP-X\\Default"],"intelamt":{"ver":"10.0.56","state":2,"flags":4,"uuid":"12246900-c162-11e5-86bc-b8aeed7f5469","tls":0,"user":"admin","pass":"P@ssw0rd"}},{"type":"node","mtype":2,"_id":"node//hPIs53zBqqPkyKaLTi2oegl3O1FNRnC4YdheQGx@uFIq33PWHLb0Ru9ghRa3qQ7h","icon":2,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Yoga","rname":"Yoga","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.117","osdesc":"Microsoft Windows [Version 10.0.10240]","users":["YOGA\\Demo"]},{"type":"node","mtype":2,"_id":"node//hfbJ7zAgwZK@LQfsZkr1cqTSp6mjjZ3MjGC$v4X8E7HM1cZEnlGBgcorELu1hZWe","icon":1,"meshid":"mesh//nanrglVfQE5teW1fRPUY3lgZ2LvLnBnJ9ubzvDpfnRYX3T8Tsvp0SHlY5vgk58pA","name":"AmtMachine11","rname":"DESKTOP-8737VKT","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.122","osdesc":"Microsoft Windows [Version 10.0.17134.1]","users":["DESKTOP-8737VKT\\Default"],"conn":1,"pwr":1,"agct":1550715027463},{"type":"node","mtype":2,"_id":"node//p3HOhDapgT@VyO$upGJYxEa$v4YCY76Y2G@hOGmJnbPXjkSHP@AgJ1M6FkqSEUqg","icon":5,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"Raspberry Pi 3+ #2","rname":"raspberrypi","domain":"","agent":{"ver":0,"id":25,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.118","osdesc":"Raspbian GNU/Linux 9 (stretch)","conn":1,"pwr":1,"agct":1549936978234},{"type":"node","mtype":2,"_id":"node//tyR7l2j5@wOjDeRbOQNfjU7xB$ss6VZQPDkFsALPzJ4zbTI4IamV$OdwHeqiXV0K","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"MeshLabLeft","rname":"meshLabLeft-x","domain":"","agent":{"ver":0,"id":4,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.138","osdesc":"Microsoft Windows [Version 10.0.16299.192]","users":["MESHLABLEFT-X\\Default"],"intelamt":{"ver":"10.0.56","state":2,"flags":4,"uuid":"972a0380-d871-11dd-81b6-b8aeed73319d","tls":1,"user":"admin","pass":"P@ssw0rd"}},{"type":"node","mtype":2,"_id":"node//u$Ys81cgdCynYfh0i8FkgLE8Nirv8o5zu9aamWyWMoAWH1@ymVfYblbm5435VEdW","icon":1,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"DevLinux","rname":"DevLinux","domain":"","agent":{"ver":0,"id":6,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.140","users":["default"]},{"type":"node","mtype":2,"_id":"node//yjbMXlQBf09TSIqKlkwrRucm767TcXfNbSinQWXgpdBBY5MEU1gg0kzshwiwFCOp","icon":5,"meshid":"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","name":"TinkerBoard","rname":"tinkerboard","domain":"","agent":{"ver":0,"id":25,"caps":31,"core":"MeshCore v6"},"host":"192.168.2.112","osdesc":"Debian GNU/Linux 9 (stretch)"},{"type":"node","mtype":"2","_id":"node/devtest/@yw$s5jLUivpzZ49laprt4T0sBaOKImbDAiniothQwccZPukCB696$BvPWAW0Bg2","icon":1,"meshid":"mesh/devtest/8CvC1wI7ivS289DcIUcMwXivGD2nKuj5jpUQ0qBd5Xd@R@jGkKSAA24A6UA9YRTe","name":"AmtMachine7","domain":"devtest","agent":{"ver":0,"id":3,"caps":31,"core":"MeshCore v4"},"host":"192.168.2.106"},{"_id":"ntmesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c","type":"note","value":"This%20is%20a%20mesh%20note."},{"_id":"performSelfUpdate","value":0,"day":"12/14/2017"},{"type":"user","_id":"user//aa","name":"aa","creation":1548376016,"domain":"","email":"aa@aa.com","salt":"lR91kNQwChPodSSec78V3BzcS0eWo68sYu+A8xPtuiUBLPWi1l1XPNtR+D6HlnySDbMH7i2wFCiw3Mq+icEmj7JOJFfKMRk5BF+bEHZmO6AJNcEf1TAEXvsJpD3E67vz9JAIJ2vfZSAR4q/eh1Ip3IoC2EPcaiv+uYVYWSY/3x4=","hash":"o5o4WNYe8KitnzSYkUQdDAxi6rSMNrBVpZQz36NOKGLSnC4lE6WBwG+wg4A7c4E4e8Qt4699aXXhvGjuS3J1zBOh6ug7SYy5SGlHvH7TW8VGiwMftPv3tM2z4bKDnFOTtBXNfNaXCd9SlmNtHuOAOI1ZU3jK2y/KVsLhzdAZpO0=","siteadmin":0,"login":1550348699,"passhint":"aa","links":{"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c":{"rights":4294967295}}},{"type":"user","_id":"user//admin","name":"admin","domain":"","creation":1417814230,"salt":"lYDXB4XOadc7OrkriOG+5u0b/SjYQG12oDygffZPVQ8oBnVs144cQy+6tsZjsdhZKaYZQBWwysG48mECgpeim1c97wTpeHno5BIs0qGuv3A61o5yt29UopZobLrzkCwd6hWJsZOIaCK1re36v6En5fMV3BpraCaa+cP/ezgE3Ac=","hash":"1fj0WCYTviOBklsr+Q61dUCXdvmuE2pCpxVrtAVx01RqP/FanKcDojfZZJO61xQGOfycBft1d7j/NPikeXQw9YmkuO97iJ+yTzqmD66ngiNLQtZ7wMwVFB6xEACLW6LXI6TjOy85xMutGv4a1bMCEbdpHLd1LtXqgWjLHcuPeWQ=","siteadmin":4294967295,"links":{"mesh//1bc82505ef750af28b19292eaf2260eae83bc2939a367f1a885efe865b729193":{"name":"admin","rights":4294967295},"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c":{"name":"admin","rights":4294967295},"mesh//93c713c5cda428bb06777a7e7cd8075527f8a2f305945ac241852b37b1f30739":{"name":"admin","rights":4294967295},"mesh//acf0460d17df45ff977d2ceb3fcc84ced94a68bc67ef513bbdb1fc59a591bd5d":{"name":"admin","rights":4294967295},"mesh//nanrglVfQE5teW1fRPUY3lgZ2LvLnBnJ9ubzvDpfnRYX3T8Tsvp0SHlY5vgk58pA":{"rights":4294967295}},"login":1550516718,"email":"ylian.saint-hilaire@intel.com","emailVerified":true,"passchange":1550021065,"otpkeys":{"keys":[{"p":42912413,"u":true},{"p":91187036,"u":true},{"p":78407346,"u":true},{"p":5142221,"u":true},{"p":70167177,"u":true},{"p":26847405,"u":true},{"p":80846605,"u":true},{"p":67902311,"u":false},{"p":25101234,"u":true},{"p":7896011,"u":true}]},"otphkeys":[{"name":"MySecondKey","type":1,"publicKey":"BN1rZSAwiAODxJKHKur9TuMAaRY1tO9VzcfuxjMIarpVyMM2qfpyLhJ15g9B1nmnJLZBULZ-4oghvSqDsWjiaT8","keyHandle":"M-QXvN8rFYW_qXCQ3YuW4Aa_1p8JIdcREF3gL-Yv-zuNX9-IcU65MrUAYTibhPlE9MvDU3fBo8pFbm8oiPG-HQ","certificate":"-----BEGIN CERTIFICATE-----\nMIICTzCCATegAwIBAgIEPGgpTTANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNZ\ndWJpY28gVTJGIFJvb3QgQ0EgU2VyaWFsIDQ1NzIwMDYzMTAgFw0xNDA4MDEwMDAw\nMDBaGA8yMDUwMDkwNDAwMDAwMFowMTEvMC0GA1UEAwwmWXViaWNvIFUyRiBFRSBT\nZXJpYWwgMjM5MjU3MzQ4MTExMTc5MDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\nAAS932eT23eUw1Axce0sTUVK2XNmdRpIuqXZ+bVqOiCBeWtO3yvNe5J6FJMQ+8Ro\nR2/8V5KpfbYvoChrxqMgAg5jozswOTAiBgkrBgEEAYLECgIEFTEuMy42LjEuNC4x\nLjQxNDgyLjEuNTATBgsrBgEEAYLlHAIBAQQEAwIFIDANBgkqhkiG9w0BAQsFAAOC\nAQEAqsANUQl+7BWkhrN5vMSDQPhn05cuzmpn+6Rw42DGRFnwrThC0/8IHnHqiVOX\nGyP5JcCtAMJHMRhSBvCzqRkp+5G3ZrU/4TNSKoNYuNEgtKv7f+jvJHtk/8amIUrB\n2b5zNv3g86gYP5NLUhh19eP3iYCvlwpbHgQqOHbXS6i+7+kt0uNzzGRByJStfNmk\n9H2tPaT+r0eRmEdT41oInOTL49PINurQoqfOpWFa1+RIEIbDd7NmRNL7mWu84psh\nrbiV95OC7sVJPk7BM8IWfwdx9ZkxcxIP8o1T6IGol0DBMs88NGgsu89OXb3B4IAi\nH4dSmYFB3RSW1w86sD8sW8B/rQ==\n-----END CERTIFICATE-----","keyIndex":4230878418},{"name":"MySecondKey","type":2,"keyid":"cccccciciklt","keyIndex":2486137822},{"name":"MyKey","type":1,"publicKey":"BKXtIhE4Pmzj09kwq0GnpF4gFy_9ubFeQXXINIdS8wrhGGpb6w5GhLRVh1dICmI6wysRJ1sYw_v_WFvNH5azMF8","keyHandle":"U7kr-iAtWnnMQKRILnIB_ey6zP2seVwYSROxoQ61ggqlEOeOk1R8w-_oKFy93yyAbwAJ7Ha32easV97QNIUuzQ","certificate":"-----BEGIN CERTIFICATE-----\nMIICTzCCATegAwIBAgIEPGgpTTANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNZ\ndWJpY28gVTJGIFJvb3QgQ0EgU2VyaWFsIDQ1NzIwMDYzMTAgFw0xNDA4MDEwMDAw\nMDBaGA8yMDUwMDkwNDAwMDAwMFowMTEvMC0GA1UEAwwmWXViaWNvIFUyRiBFRSBT\nZXJpYWwgMjM5MjU3MzQ4MTExMTc5MDEwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNC\nAAS932eT23eUw1Axce0sTUVK2XNmdRpIuqXZ+bVqOiCBeWtO3yvNe5J6FJMQ+8Ro\nR2/8V5KpfbYvoChrxqMgAg5jozswOTAiBgkrBgEEAYLECgIEFTEuMy42LjEuNC4x\nLjQxNDgyLjEuNTATBgsrBgEEAYLlHAIBAQQEAwIFIDANBgkqhkiG9w0BAQsFAAOC\nAQEAqsANUQl+7BWkhrN5vMSDQPhn05cuzmpn+6Rw42DGRFnwrThC0/8IHnHqiVOX\nGyP5JcCtAMJHMRhSBvCzqRkp+5G3ZrU/4TNSKoNYuNEgtKv7f+jvJHtk/8amIUrB\n2b5zNv3g86gYP5NLUhh19eP3iYCvlwpbHgQqOHbXS6i+7+kt0uNzzGRByJStfNmk\n9H2tPaT+r0eRmEdT41oInOTL49PINurQoqfOpWFa1+RIEIbDd7NmRNL7mWu84psh\nrbiV95OC7sVJPk7BM8IWfwdx9ZkxcxIP8o1T6IGol0DBMs88NGgsu89OXb3B4IAi\nH4dSmYFB3RSW1w86sD8sW8B/rQ==\n-----END CERTIFICATE-----","keyIndex":2675771216},{"name":"MyKey","type":2,"keyid":"cccccciciknf","keyIndex":3604924884}],"otpsecret":"JZ2EYUCKF5IVQVLLM5IXKZLZPBWHARZX"},{"type":"user","_id":"user//b","name":"b","email":"b@b.com","creation":1541571127,"login":1541571437,"domain":"","passhint":"b","salt":"S691HvbnvwqMlafjTtoNSrh7O0zhGgUj3vbiYF/EolvjQqsQ+k1fAZ2fpAqPTFWpwqlJbcZeB4kJzgPhwRhNmRfWHjXkmTsCNdmBobYz40AXysKGrxa/6jrR7MKIkI2/pBkzNLcx3cALB/B0zia/YSAP0/lGpFprB2IeEri0gS4=","hash":"cskKkLN8JOOxzytDb63bNN6yCdz34euXIuTF/EiClmXvHda4JcanyPTrUvrM+u9P7pD4wdapr0BYV7X86fkCFtl6A3nxh45LM34GTdSTey3i/kh7geSLM5uZIkm1pGeXaXpP0o7obCPnf0SRbq1X/k4yPY6BBUve6bOwsQX+3FU=","links":{"mesh//xYMpQG$jfLh6nPzpCbdHwoiT6aXWaki2O7DJY0LLuNold2Cz71sq@kFtxqS9Hxa8":{"rights":4294967295}},"siteadmin":0},{"type":"user","_id":"user//bob","name":"bob","creation":1523394756,"domain":"","email":"bob@bob.com","salt":"53GmyHZq0DyCEqX8ndsU8gnv/2QfmRb3F/a03Rorl+X/wH7mG5GvvYtXL4aS+NWsr43Mm4jFx38qTmQi961ufGy8RWEKjo3FsAPFq3fnYJvBpmWCDPz8svPe5UtU6yGi8SPUWQD3d5fb4FZ4Qub49agVG52lMAoI7+XPee1aodw=","hash":"CtvD7IX3ytdJXmlbYEMRhSq0GuHVmis/a6qKGeJpb6MDvcB1MOPVuR3KMguPHxC2VQci0nkYosft/0V4RFxB1Y0OBCEo480Lprpce/TbJ1OvbUGxTpt0EJ3W8GFDrHW2MEyJlG0DTqrz5fM4cNS4zgYoM6XltEN4YYOcDvoeYFc=","login":1523394761,"links":{},"siteadmin":0},{"type":"user","_id":"user//bryan","name":"Bryan","domain":"","creation":1373413118,"passtype":1,"salt":"GoMdgNplNW5Tq1LI38Fi0Q==","hash":"HSelSEKY8BJWdAV6D0PD4Gwiazg=","links":{"mesh//542dea438e6065bffa9318c149e9982440dba4ce6ba3ba2b577e0e127b6a7f24":{"name":"Bryan","rights":4294967295}},"siteadmin":0,"login":null},{"type":"user","_id":"user//demo","name":"demo","domain":"","creation":1428090949,"salt":"sGIIlqmi5YN8+BEBOYI2Ub+TGV0nAcE7UdM7itv80HGriQKtAeajer18WdJIsfEvXwEMjqftvEmNE1QLafb7edZ4LVTSe90+mluRxQ6na+GauoXIazTHCola+Ke3ySpedWuHvnKPrwQEWtTFDAp6UjppfwFtd8W6yAPyzYJwpfM=","hash":"0YfvLDm9NIMOHcbK9lQon+dH70vlQRnTW+b1BdQCBIcx4HyM6NpPeEs+nU6wqDk6nXwBp50OpBNmPLlCslpZAFg6R4sQzIJEcirb8GZnRaABDus8kq3Gq23DWp45j/uwQMAA6Z4orqXmr0OHEMB9Cr+p2jg+c01QTM2FU+TUvBc=","links":{"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c":{"name":"demo","rights":4294967295}},"login":1513299316,"siteadmin":0},{"type":"user","_id":"user//devbox\\default","name":"DEVBOX\\Default","domain":"","sid":"S-1-5-21-3031010259-3226202738-568380285-1001","creation":1548377831,"login":1548377831},{"type":"user","_id":"user//ee","name":"ee","creation":1549848166,"domain":"","email":"ee@ee.com","salt":"LeNt8wc8HT/ggJjA3M1m/uVJQaDZ5ezwYy9w8PQoeyXr3Ug83ooHoDgJ0GbSpwDKbXhmyk9t2Ku7t2iLBI4NjvIcX4u5t/3ugfNKs8ChZMwgIwp0JEs9HpOFJrE5iKCLFHAiS7IhDMqpMUEkWsA1izH3mqEZb7zOQNHQvHy2Kk4=","hash":"R2L9B7V/yahBePRbVW4zqKiZcxJ+yauHNDUVwGg9V41p7PMNIsFmgonUp6aLOPkDKuqdKE8gFh2Yrdgm56Xrdkrfm8VMd2ecKU0wjj6uNmvXa9mA7HB2wC4txo6LpfLjXkkPtyZiUY+Z0gT6maRRVW3P3zOS+GIftK4iwegxFB4="},{"type":"user","_id":"user//joe.bob","name":"joe.bob","email":"bob@bob.com","creation":1531530565,"login":1531534497,"domain":"","passhint":"bob","salt":"6P9m1LSHS+S1L7+HJO23pDBHn6eiZmAKXVckawjGNFPz8Py0zu6jDCcbP89lgnqLN8KjyWc7NO4dOPyL26QEkKOA2PghljDwjaWaCnX1EYkYDiJV3b4muHrQ0hVsdbYP/52gtRZAE5f0qM3xZjxfHz2dVyrRCFb+iNvCB/OiikQ=","hash":"yMsV9ATYiOcVOAjaH8Gxc6+jM28JwxsK0+GaA6b6Y8kL871sENd8/5nqi0QWYRKKahkpFe+xAaTdze/+/7vXt3Ly/WJsU7q8asZgORxqxWU0wsekFP2tnAjdiC/Grhj5euAXqft84p5aQHQt2PE/CoT+FOIVvUiM5gD/Iq1ev1M=","links":{"mesh//1fHXfQIiCOOOFw8lkIlUnXSQ3A75kFrKw2PvGQFkaAsGCM7mz@3$Mrr5NbPNTmxy":{"rights":4294967295},"mesh//PleIaEpGvRNLCx6rLcsKOogtaKfEDI7Tm2YSPGUurBLqNzRgLPd4ZurifZonL$7X":{"rights":4294967295},"mesh//8kWnSpFr$cIj2YvibBdMkBxBlcuNZp0yBZQSoWV12DTZV2f@34wJi5CIPMSUoOou":{"rights":4294967295},"mesh//CWsMAU4u63zNLLvdmoZP8uPcg$lzLnVcC25buVmqI05r1Wxk3ngk1OEgyHoFg7Oa":{"rights":4294967295},"mesh//Gt0Eo1GNpJmQ1WRwvKeIhibHBQ2j@XOV@omqmvsf8ZY6k3oKswvDdjzPn1KA4IQf":{"rights":4294967295},"mesh//GXbvFkWNsVKJCBbTvhBHCgFAY5fayzcStTJeZ5TdDfLC0sDL5TDs1ALFm8hMFoQ9":{"rights":4294967295},"mesh//7z0GW8pppHVGDw@Rz$fb1E29GnA9yExEKASjAf$r$hyBMP0$BSH$rVqWKCwxQ7D6":{"rights":4294967295},"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c":{"rights":4294967295}}},{"type":"user","_id":"user//mytestuser","name":"MyTestUser","email":"a@a.com","creation":1541494376,"login":1541494376,"domain":"","passhint":"a","salt":"3bURHy0OVDLNGJrEyQGs2UBhktEoJao9p4dIPS+uZwWdzPCcCZr4r7/dWlsjFGyKqCoWoStR6XzIFGElAAW5eUq2dM7lG9GXvrp59TzizKwTUAJWyCTfCmoP2jbTBjFLr5umBNsapiBY1HXXJxoRpJJJDGCt0ysETgIYjJfWUN8=","hash":"VzMdJ9paS12tH3KM3yUsVJXYt6tB/LJ8jX3665otE4AmQgaxBOXiEVr5Ff8oYd6MPonr6D93ACUems0R0NiX4EjGcOveT1zNijjaVYxFRu2PzkKayxqeupZQvniz6HdrtptEa96GpWXqXJ0dzsVbMcpfEKz1Tjk5cFku3swfZYw="},{"type":"user","_id":"user//qqq","name":"qqq","email":"qqq@qqq.com","creation":1549852967,"login":1549853132,"domain":"","passhint":"allq","salt":"+pzWoML4DMmYZ3y9DFMEwkJz/sal3qDKHKnhmVu352zzZPzXC+mL/hbmHOSi1Quw65tMMLtcjXn5cquMFToX1DlsURnuDbxaINuzZ9pec6dxIn26EJ8urZ00bVXTSusv2xhcJuYKEabC/gKWpe6E0VR8xctEUjjqAgP1BCOAifo=","hash":"n7gXwzoFS9UkTHQbbuuabGjCJmRadzWENmkjwMBnNrhQwG2qLeD5f/A1EPKIwr2P39J0cClFHPt25kX0PtItEyJO5wcnVrbESfc3Jsm6nG+Kze0ayW3Na+iEmnwWMDZYNgFe3k95ubOXzKl/CCUjuW4RAEwj5f631XoTS6ygW1Y=","siteadmin":32},{"type":"user","_id":"user//robert","name":"Robert","email":"robert@bob.com","creation":1543864529,"login":1543864529,"domain":"","passhint":"robert","salt":"/brZFf8ljdG2eZAFgBl3CaMnY5FGYPB93S3Y97wym/kUAVkF5NHlDVVNfmghC97VzZuHnlIoFlt4IUHbZHSc4/KAOc4pX/ZcyicsacMXyW+4CtDgSllnXeejK0nkVV/AdJSwKMQZ3K5+77TvydXbwLFuGoZ0NVOzCto/CgaWtsQ=","hash":"X7OlXcp514ay/HXV2qDsAQVerr2jWGdCUAVnl6FVsvw4XN+jgBsq8E7f0RnuAZp/BFIlqkLaj8TqYtpFPR87LCJdcg8LZ3Y7ygyiZp0rdpztyxBAJ3YyiFRrSvJB/u4JM0GJ88WPCRK6CbHwBlhg4i+VRSMPetn1XiemubK1Qv8=","links":{"mesh//7b4b43cdad850135f36ab31124b52e47c167fba055ce800267a4dc89fe0e581c":{"rights":4294967295}}},{"type":"user","_id":"user//rrr","name":"rrr","creation":1549902723,"domain":"","email":"rrr@rrr.com","salt":"xUp0ahkXM0cQmyS0m7YPv9fx+DGcRJQgk6GLqVzxavjwPcWBojR5yKXCr5i7I0Hh69ooeYceg+edg/CDOLvU9Eso9jslsZEVUHvF3hdFoBMQdNC8trNLG0vIgyPcLejASKV7N7Oz1cS3Hm8woFI3Fy8HoiMoghuVxjnK8K5oAYc=","hash":"simcj91gtv0os0m8aSawEU8085ZTy6PlZ+zPEJXzrQcZlUdNZakjqOfwaQphsvYuBupe12L4VIgALxEQQdwc9UAD/NWseLgMuaSrRUt41aRq7gX3nd5CysKfMcQFrEhLJvJcmBxmUmQdXPIvJxoJE4LZiy5I7sRODTyPx3qIJDY="},{"type":"user","_id":"user//test","name":"test","domain":"","creation":1443471004,"salt":"oIjWYPLCbUaAFW6OtG6ByA5/cQGXLtlszVrbS+gKZsz+Hi0Gt1EENRJtD/cWTfVdZhhjyevSTL96+29434R1Qr9BRnyRqBiBIDO5vps0+JOdiHr5UqyjRBgxCqoel6jA8JMFCaRtuIg7N7kgZvVaUaEgviPxxYYsj5Et6nCGx88=","hash":"381jAwP+/+rcxF2i4Jd6RJepNF3Ukz5kfRkWgf1C1bMPmH4535Atq9LABsgyw4fKG6dafV4sHU1WFh2dHzqnN7lGuZV2unT3z2/P0SWwroT5vIBcZId8ZuJ/7FQBXQUHwRAM+EvF7BSCvabSfXSq0+1JrbeGvdYHRAa/NhYKdJw=","links":{"mesh//lm2AD7PVRyTkGqXXqVPpWCYthR8WjQC5v2r$sS39tT207MI190MqeXQfdMpgUxvW":{"rights":4294967295}},"login":1516996988},{"type":"user","_id":"user//test1","name":"test1","domain":"","creation":1374174496,"passtype":0,"hash":"test2","links":{},"login":null},{"type":"user","_id":"user//testuser","name":"TestUser","creation":1523658499,"domain":"","email":"TestUser@meshcentral.com","salt":"KsM9DOWsz3Ub8Q1m5ex/Ge7XP6fBJ+MMA8LqjXmSRhLE0HWfv4uWAarWjZYYYM4/kWKZZSjkQWMMzCeZul3krBTogZRqMUar+VgKgZbjW0vX6NvMFn32Y2m+K/YSyl0XQoN09nmU5EN/RA95bkTz3RK/pXsOYVNdCcojs1uISj0=","hash":"uMO6etn7jwT1BBFqIY+DSqozcMIlpIAu9d4ruhxNmu/5smo/8M7Pvwa42tCza0bNsBNybPB6xOEYa4z+2W30WQ2dnN1AaHvRltdllxrPjmW0PjuD/4cNG+Z6Lb3v6R6QIUxYpUwo7gC87rM4+KyGiMFUq83VG67T4AcBxtKhzm4=","siteadmin":32,"login":null},{"type":"user","_id":"user/devtest/a","name":"a","email":"ylian.saint-hilaire@intel.com","creation":1514930104,"login":1515724646,"domain":"devtest","passhint":"a","siteadmin":4294967295,"salt":"g4aZeKUV0aPjzW8YpALfO7SYcyY03vdJVGNSowLqOlWZrFmnActIo+AvDb7ydC+DpSCWBq5fTHBj4Eol++PXeqyjcbVAKfMoZzGA6gdqNJ+UgabpzcddGm3oYEWcuEbvIzlLXSkZA+2LeXwRM9LbiRwH/dY0TrHVO2pwg8Hc3NU=","hash":"1+l9Wi2xEmoKNEH1jNkQGfI+F1gSId/SL7qAjxfe/lu5QvoFE4X9d3kajaC2GtWn73ilB5qmThOFqbL3nqut84EgHDmGWlxEJfGFytZwN0JlJSrid9OSKbfvS1E4P6jPWnbOLyiiKMWYktFwX2aNHRJZktrwcx07xpNuK7T5zFw=","links":{"mesh/devtest/8CvC1wI7ivS289DcIUcMwXivGD2nKuj5jpUQ0qBd5Xd@R@jGkKSAA24A6UA9YRTe":{"rights":4294967295}},"emailVerified":true}]
\ No newline at end of file
meshagent.js
+6
-1
@@ -894,7 +894,12 @@ module.exports.CreateMeshAgent = function (parent, db, ws, req, args, domain) {
894
case 'smbios':
895
{
896
// Store the RAW SMBios table of this computer
897
- obj.db.SetSMBIOS({ _id: obj.dbNodeKey, domain: domain.id, time: new Date(), value: JSON.stringify(command.value) });
897
+ // We store SMBIOS information as a string because we don't want the MongoDB to attempt to store all of the sub-documents seperatly.
898
+ // If an agent sends an insanely large SMBIOS table, don't store it.
899
+ try {
900
+ var smbiosstr = JSON.stringify(command.value);
901
+ if (smbiosstr.length < 65535) { obj.db.SetSMBIOS({ _id: obj.dbNodeKey, domain: domain.id, time: new Date(), value: smbiosstr }); }
902
+ } catch (ex) { }
903
904
// Event the node interface information change (This is a lot of traffic, probably don't need this).
905
//obj.parent.parent.DispatchEvent(['*', obj.meshid], obj, { action: 'smBiosChange', nodeid: obj.dbNodeKey, domain: domain.id, smbios: command.value, nolog: 1 });
meshcentral.js
+1
-1
@@ -60,7 +60,7 @@ function CreateMeshCentralServer(config, args) {
60
obj.serverKey = Buffer.from(obj.crypto.randomBytes(48), 'binary');
61
obj.loginCookieEncryptionKey = null;
62
obj.serverSelfWriteAllowed = true;
63
- obj.taskLimiter = obj.common.createTaskLimiterQueue(30, 20, 60); // This is a task limiter queue to smooth out server work.
63
+ obj.taskLimiter = obj.common.createTaskLimiterQueue(8, 20, 60); // This is a task limiter queue to smooth out server work.
64
try { obj.currentVer = JSON.parse(obj.fs.readFileSync(obj.path.join(__dirname, 'package.json'), 'utf8')).version; } catch (e) { } // Fetch server version
65
66
// Setup the default configuration and files paths
public/commander.htm
+748
-747
@@ -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;}</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=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=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=10></span></div></div><div id=11 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(11, 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=12 style=width:100%;height:100%><iframe id=13 style=width:100%;height:100%;border:0></iframe></div><div id=14 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=15></span></div><div id=p2 style=display:none><h1 style=margin-bottom:16px>Hardware Information</h1><span id=16></span></div><div id=p6 style=display:none><h1>Event Log</h1><span id=17></span><span id=18></span></div><div id=p8 style=display:none><h1>Network Settings</h1><span id=19></span><span id=20></span></div><div id=p11 style=display:none><h1>User Accounts</h1><span id=21></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=22 multiple="multiple" style=width:100%;height:120px></select></div><tr><td><input id=23 type=button value=Query style=margin:4px onclick=wsmanQuery()><input type=button value=Clear style=margin:4px onclick="QH(24, '')"><input id=c0 placeholder=Filter style=margin:4px onkeyup=wsmanFilter()></table></div><br><div class=us id=24></div></div><div id=p15 style=display:none><span id=25></span><h1>Audit Log</h1><span id=26></span></div><div id=p16 style=display:none><h1>Security Settings</h1><span id=27></span></div><div id=p17 style=display:none><h1>Internet Settings</h1><span id=28></span></div><div id=p18 style=display:none><h1>System Defense</h1><span id=29></span></div><div id=p19 style=display:none><h1>Agent Presence</h1><span id=30></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=31></span></div><div id=p22 style=display:none><h1>Event Subscriptions</h1><span id=32></span></div><div id=p23 style=display:none><h1>Wake Alarms</h1><span id=33></span></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=34 style=float:right;padding:1px;margin-right:5px;cursor:pointer;font-size:15px onclick=setDialogMode()>✖</div><div id=35 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=36 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=37><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=38 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=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=dialog8 style=display:table;margin:3px><div style="margin:3px 0 3px 0;padding-top:5px"><input id=c1 value=admin style=float:right;width:220px><div style=height:20px>Username</div></div><div style="margin:3px 0 3px 0"><input id=c2 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=c3>Redirection Port<br><div id=c4><input type=checkbox id=c5>KVM Remote Desktop<br></div><input type=checkbox id=c6>IDE-Redirection<br><input type=checkbox id=c7>Serial-over-LAN<br></div><div id=dialog10 style=margin:auto;margin:3px><input type=radio name=d10 id=c8 value=0>Not Required<br><input type=radio name=d10 id=c9 value=1>Required for KVM only<br><input type=radio name=d10 id=c10 value=4294967295>Always Required<br></div><div id=dialog11 style=margin:auto;margin:3px><div id=39></div></div><div id=dialog12 style=margin:auto;margin:3px><br><div style=height:26px><input id=c11 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=c12 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=c13 style=float:right;width:200px onclick=updateWifiDialog()></select><div>Priority</div></div><div style=height:26px><select id=c14 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=c15 style=float:right;width:200px onclick=updateWifiDialog()><option id=40 value=4>CCMP-AES<option id=41 value=3>TKIP-RC4<option id=42 value=2>WEP<option id=43 value=5>None</select><div>Encryption</div></div><div style=height:26px><input id=c16 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=c17 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=c18 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=44><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=c19 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>IP address</div></div><div style=height:26px id=45><input id=c20 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Subnet mark</div></div><div style=height:26px><input id=c21 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Gateway</div></div><div style=height:26px><input id=c22 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Primary DNS</div></div><div style=height:26px><input id=c23 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=c24 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=c25 style=float:right;width:200px><div>Update Interval (minutes)</div></div><div style=height:26px><input id=c26 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=c27 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=c28 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=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=c29 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=c30 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=c31 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=c32 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>System Default<option id=c33 value=1>Quiet<option id=c34 value=2>Verbose<option id=c35 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=c36 type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)><input id=c37 type=button value=OK style=float:right;width:80px onclick=dialogclose(1)><div style=height:25px><input id=c38 type=button value=Delete style=width:80px;display:none onclick=dialogclose(2)></div></div></div><script>String.prototype.startsWith||(String.prototype.startsWith=function(a){return 0===this.lastIndexOf(a,0)});String.prototype.endsWith||(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)});function Q(a){return document.getElementById(a)}function QS(a){try{return Q(a).style}catch(b){}}function QE(a,b){try{Q(a).disabled=!b}catch(c){}}function QV(a,b){try{QS(a).display=b?"":"none"}catch(c){}}function QA(a,b){Q(a).innerHTML+=b}function QH(a,b){Q(a).innerHTML=b}
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;}</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=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=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=10></span></div></div><div id=11 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(11, 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=12 style=width:100%;height:100%><iframe id=13 style=width:100%;height:100%;border:0></iframe></div><div id=14 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=15></span></div><div id=p2 style=display:none><h1 style=margin-bottom:16px>Hardware Information</h1><span id=16></span></div><div id=p6 style=display:none><h1>Event Log</h1><span id=17></span><span id=18></span></div><div id=p8 style=display:none><h1>Network Settings</h1><span id=19></span><span id=20></span></div><div id=p11 style=display:none><h1>User Accounts</h1><span id=21></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=22 multiple="multiple" style=width:100%;height:120px></select></div><tr><td><input id=23 type=button value=Query style=margin:4px onclick=wsmanQuery()><input type=button value=Clear style=margin:4px onclick="QH(24, '')"><input id=c0 placeholder=Filter style=margin:4px onkeyup=wsmanFilter()></table></div><br><div class=us id=24></div></div><div id=p15 style=display:none><span id=25></span><h1>Audit Log</h1><span id=26></span></div><div id=p16 style=display:none><h1>Security Settings</h1><span id=27></span></div><div id=p17 style=display:none><h1>Internet Settings</h1><span id=28></span></div><div id=p18 style=display:none><h1>System Defense</h1><span id=29></span></div><div id=p19 style=display:none><h1>Agent Presence</h1><span id=30></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=31></span></div><div id=p22 style=display:none><h1>Event Subscriptions</h1><span id=32></span></div><div id=p23 style=display:none><h1>Wake Alarms</h1><span id=33></span></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=34 style=float:right;padding:1px;margin-right:5px;cursor:pointer;font-size:15px onclick=setDialogMode()>✖</div><div id=35 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=36 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=37><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=38 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=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=dialog8 style=display:table;margin:3px><div style="margin:3px 0 3px 0;padding-top:5px"><input id=c1 value=admin style=float:right;width:220px><div style=height:20px>Username</div></div><div style="margin:3px 0 3px 0"><input id=c2 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=c3>Redirection Port<br><div id=c4><input type=checkbox id=c5>KVM Remote Desktop<br></div><input type=checkbox id=c6>IDE-Redirection<br><input type=checkbox id=c7>Serial-over-LAN<br></div><div id=dialog10 style=margin:auto;margin:3px><input type=radio name=d10 id=c8 value=0>Not Required<br><input type=radio name=d10 id=c9 value=1>Required for KVM only<br><input type=radio name=d10 id=c10 value=4294967295>Always Required<br></div><div id=dialog11 style=margin:auto;margin:3px><div id=39></div></div><div id=dialog12 style=margin:auto;margin:3px><br><div style=height:26px><input id=c11 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=c12 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=c13 style=float:right;width:200px onclick=updateWifiDialog()></select><div>Priority</div></div><div style=height:26px><select id=c14 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=c15 style=float:right;width:200px onclick=updateWifiDialog()><option id=40 value=4>CCMP-AES<option id=41 value=3>TKIP-RC4<option id=42 value=2>WEP<option id=43 value=5>None</select><div>Encryption</div></div><div style=height:26px><input id=c16 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=c17 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=c18 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=44><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=c19 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>IP address</div></div><div style=height:26px id=45><input id=c20 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Subnet mark</div></div><div style=height:26px><input id=c21 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Gateway</div></div><div style=height:26px><input id=c22 onkeyup=updateIPSetupDlg() style=float:right;width:230px><div>Primary DNS</div></div><div style=height:26px><input id=c23 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=c24 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=c25 style=float:right;width:200px><div>Update Interval (minutes)</div></div><div style=height:26px><input id=c26 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=c27 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=c28 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=c29 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=c30 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=c31 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=c32 style=float:right;width:200px onchange=showAdvPowerDlgChange()><option value=0>System Default<option id=c33 value=1>Quiet<option id=c34 value=2>Verbose<option id=c35 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=c36 type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)><input id=c37 type=button value=OK style=float:right;width:80px onclick=dialogclose(1)><div style=height:25px><input id=c38 type=button value=Delete style=width:80px;display:none onclick=dialogclose(2)></div></div></div><script>String.prototype.startsWith||(String.prototype.startsWith=function(a){return 0===this.lastIndexOf(a,0)});String.prototype.endsWith||(String.prototype.endsWith=function(a){return-1!==this.indexOf(a,this.length-a.length)});function Q(a){return document.getElementById(a)}function QS(a){try{return Q(a).style}catch(b){}}function QE(a,b){try{Q(a).disabled=!b}catch(c){}}function QV(a,b){try{QS(a).display=b?"":"none"}catch(c){}}function QA(a,b){Q(a).innerHTML+=b}function QH(a,b){Q(a).innerHTML=b}
2
function inputBoxFocus(a){Q(a).focus();var b=Q(a).value;Q(a).value="";Q(a).value=b}function ReadShort(a,b){return(a.charCodeAt(b)<<8)+a.charCodeAt(b+1)}function ReadShortX(a,b){return(a.charCodeAt(b+1)<<8)+a.charCodeAt(b)}function ReadInt(a,b){return 16777216*a.charCodeAt(b)+(a.charCodeAt(b+1)<<16)+(a.charCodeAt(b+2)<<8)+a.charCodeAt(b+3)}function ReadSInt(a,b){return(a.charCodeAt(b)<<24)+(a.charCodeAt(b+1)<<16)+(a.charCodeAt(b+2)<<8)+a.charCodeAt(b+3)}
3
function ReadIntX(a,b){return 16777216*a.charCodeAt(b+3)+(a.charCodeAt(b+2)<<16)+(a.charCodeAt(b+1)<<8)+a.charCodeAt(b)}function ShortToStr(a){return String.fromCharCode(a>>8&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,a>>8&255)}function IntToStr(a){return String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,a>>8&255,a>>16&255,a>>24&255)}function MakeToArray(a){return a&&null!=a&&"object"!=typeof a?[a]:a}
4
function SplitArray(a){return a.split(",")}function Clone(a){return JSON.parse(JSON.stringify(a))}function EscapeHtml(a){if("string"==typeof a)return a.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'");if("boolean"==typeof a||"number"==typeof a)return a}function ArrayElementMove(a,b,c){a.splice(c,0,a.splice(b,1)[0])}
@@ -6,96 +6,97 @@ function ObjectToStringEx(a,b){var c="";if(0!=a&&(!a||null==a))return"(Null)";if
6
function ObjectToStringEx2(a,b){var c="";if(0!=a&&(!a||null==a))return"(Null)";if(a instanceof Array)for(var d in a)c+="\r\n"+gap2(b)+"Item #"+d+": "+ObjectToStringEx2(a[d],b+1);else if(a instanceof Object)for(d in a)c+="\r\n"+gap2(b)+d+" = "+ObjectToStringEx2(a[d],b+1);else c+=EscapeHtml(a);return c}function gap(a){for(var b="",c=0;c<4*a;c++)b+=" ";return b}function gap2(a){for(var b="",c=0;c<4*a;c++)b+=" ";return b}function ObjectToString(a){return ObjectToStringEx(a,0)}
7
function ObjectToString2(a){return ObjectToStringEx2(a,0)}function hex2rstr(a){if("string"!=typeof a||0==a.length)return"";var b="";a=(""+a).match(/../g);for(var c;c=a.shift();)b+=String.fromCharCode("0x"+c);return b}function char2hex(a){return(a+256).toString(16).substr(-2).toUpperCase()}function rstr2hex(a){var b="",c;for(c=0;c<a.length;c++)b+=char2hex(a.charCodeAt(c));return b}function encode_utf8(a){return unescape(encodeURIComponent(a))}
8
function decode_utf8(a){return decodeURIComponent(escape(a))}function data2blob(a){for(var b=Array(a.length),c=0;c<a.length;c++)b[c]=a.charCodeAt(c);return new Blob([new Uint8Array(b)])}function random(a){return Math.floor(Math.random()*a)}function trademarks(a){return a.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}
9
-var CreateWsmanComm=function(a,b,c,d,f){function m(){k.socketState=2;k.socketParseState=0;k.socketAccumulator="";k.socketHeader=null;k.socketData="";for(i in k.pendingAjaxCall)k.sendRequest(k.pendingAjaxCall[i][0],k.pendingAjaxCall[i][3],k.pendingAjaxCall[i][4])}function p(a){k.inDataCount++;if("object"==typeof a.data){var c=new FileReader;if(c.readAsBinaryString)c.onload=function(a){r(a.target.result)},c.readAsBinaryString(new Blob([a.data]));else if(c.readAsArrayBuffer)c.onloadend=function(a){r(a.target.result)},
10
-c.readAsArrayBuffer(a.data);else{c="";a=new Uint8Array(a.data);for(var b=a.byteLength,l=0;l<b;l++)c+=String.fromCharCode(a[l]);r(c)}}else"string"==typeof a.data&&r(a.data)}function r(a){if("object"===typeof a){var c="";a=new Uint8Array(a);for(var b=a.byteLength,l=0;l<b;l++)c+=String.fromCharCode(a[l]);a=c}else if("string"!==typeof a)return;for(k.socketAccumulator+=a;;){if(0==k.socketParseState){a=k.socketAccumulator.indexOf("\r\n\r\n");if(0>a)break;k.socketHeader=k.socketAccumulator.substring(0,a).split("\r\n");
11
-if(null==k.amtVersion)for(l in k.socketHeader)0==k.socketHeader[l].indexOf("Server: Intel(R) Active Management Technology ")&&(k.amtVersion=k.socketHeader[l].substring(46));k.socketAccumulator=k.socketAccumulator.substring(a+4);k.socketParseState=1;k.socketData="";k.socketXHeader={Directive:k.socketHeader[0].split(" ")};for(l in k.socketHeader)0!=l&&(a=k.socketHeader[l].indexOf(":"),k.socketXHeader[k.socketHeader[l].substring(0,a).toLowerCase()]=k.socketHeader[l].substring(a+2))}if(1==k.socketParseState){c=
12
--1;if(void 0==k.socketXHeader.connection||"close"!=k.socketXHeader.connection.toLowerCase()||void 0!=k.socketXHeader["transfer-encoding"]&&"chunked"==k.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=k.socketXHeader["content-length"]){c=parseInt(k.socketXHeader["content-length"]);if(k.socketAccumulator.length<c)break;a=k.socketAccumulator.substring(0,c);k.socketAccumulator=k.socketAccumulator.substring(c);k.socketData=a;c=0}else{b=k.socketAccumulator.indexOf("\r\n");if(0>b)break;c=parseInt(k.socketAccumulator.substring(0,
13
-b),16);if(isNaN(c)){k.websocket&&k.websocket.close();break}if(k.socketAccumulator.length<b+2+c+2)break;a=k.socketAccumulator.substring(b+2,b+2+c);k.socketAccumulator=k.socketAccumulator.substring(b+2+c+2);k.socketData+=a}else c=0;0==c&&(b=k.socketXHeader,a=k.socketData,c=parseInt(b.Directive[1]),isNaN(c)&&(c=602),401==c&&3>++k.authcounter?k.challengeParams=k.parseDigest(b["www-authenticate"]):(b=k.pendingAjaxCall.shift(),k.authcounter=0,k.ActiveAjaxCount--,k.gotNextMessages(a,"success",{status:c},
14
-b),k.PerformNextAjax()),k.socketParseState=0,k.socketHeader=null)}}}function l(a){0==k.inDataCount&&(k.tlsv1only=1-k.tlsv1only);k.socketState=0;null!=k.socket&&(k.socket.close(),k.socket=null);if(0<k.pendingAjaxCall.length){a=k.pendingAjaxCall.shift();var c=a[5];k.PerformAjaxExNodeJS2(a[0],a[1],a[2],a[3],a[4],--c)}}var k={PendingAjax:[],ActiveAjaxCount:0,MaxActiveAjaxCount:1,FailAllError:0,challengeParams:null,noncecounter:1,authcounter:0,socket:null,socketState:0};k.host=a;k.port=b;k.user=c;k.pass=
15
-d;k.tls=f;k.tlsv1only=0;k.cnonce=Math.random().toString(36).substring(7);k.inDataCount=0;k.amtVersion=null;k.PerformAjax=function(a,c,b,l,h,g){k.ActiveAjaxCount<k.MaxActiveAjaxCount&&0==k.PendingAjax.length?k.PerformAjaxEx(a,c,b,h,g):1==l?k.PendingAjax.unshift([a,c,b,h,g]):k.PendingAjax.push([a,c,b,h,g])};k.PerformNextAjax=function(){if(!(k.ActiveAjaxCount>=k.MaxActiveAjaxCount||0==k.PendingAjax.length)){var a=k.PendingAjax.shift();k.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);k.PerformNextAjax()}};k.PerformAjaxEx=
16
-function(a,c,b,l,h){if(0!=k.FailAllError)k.gotNextMessagesError({status:k.FailAllError},"error",null,[a,c,b,l,h]);else return a||(a=""),k.ActiveAjaxCount++,k.PerformAjaxExNodeJS(a,c,b,l,h)};k.pendingAjaxCall=[];k.PerformAjaxExNodeJS=function(a,c,b,l,h){k.PerformAjaxExNodeJS2(a,c,b,l,h,3)};k.PerformAjaxExNodeJS2=function(a,c,b,l,h,g){0>=g||0!=k.FailAllError?(k.ActiveAjaxCount--,999!=k.FailAllError&&k.gotNextMessages(null,"error",{status:0==k.FailAllError?408:k.FailAllError},[a,c,b,l,h]),k.PerformNextAjax()):
17
-(k.pendingAjaxCall.push([a,c,b,l,h,g]),0==k.socketState?k.xxConnectHttpSocket():2==k.socketState&&k.sendRequest(a,l,h))};k.sendRequest=function(a,c,b){c=c?c:"/wsman";b=b?b:"POST";var l=b+" "+c+" HTTP/1.1\r\n";null!=k.challengeParams&&(b=hex_md5(hex_md5(k.user+":"+k.challengeParams.realm+":"+k.pass)+":"+k.challengeParams.nonce+":"+k.noncecounter+":"+k.cnonce+":"+k.challengeParams.qop+":"+hex_md5(b+":"+c)),l+="Authorization: "+k.renderDigest({username:k.user,realm:k.challengeParams.realm,nonce:k.challengeParams.nonce,
18
-uri:c,qop:k.challengeParams.qop,response:b,nc:k.noncecounter++,cnonce:k.cnonce})+"\r\n");a=l+="Host: "+k.host+":"+k.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==k.socketState&&null!=k.socket&&k.socket.readyState==WebSocket.OPEN){c=new Uint8Array(a.length);for(l=0;l<a.length;++l)c[l]=a.charCodeAt(l);try{k.socket.send(c.buffer)}catch(h){}}};k.parseDigest=function(a){a=a.substring(7).split(",");for(i in a)a[i]=a[i].trim();return a.reduce(function(a,c){var b=c.split("=");a[b[0]]=b[1].replace(/"/g,
19
-"");return a},{})};k.renderDigest=function(a){var c=[];for(i in a)c.push(i);return"Digest "+c.reduce(function(c,b){return c+","+b+'="'+a[b]+'"'},"").substring(1)};k.xxConnectHttpSocket=function(){k.inDataCount=0;k.socketState=1;k.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+k.host+"&port="+k.port+"&tls="+k.tls+"&tls1only="+k.tlsv1only+("*"==c?"&serverauth=1":
20
-"")+("undefined"===typeof d?"&serverauth=1&user="+c:""));k.socket.onopen=m;k.socket.onmessage=p;k.socket.onclose=l};k.gotNextMessages=function(a,c,b,l){if(999!=k.FailAllError)if(0!=k.FailAllError)l[1](null,k.FailAllError,l[2]);else if(200!=b.status)l[1](null,b.status,l[2]);else l[1](a,200,l[2])};k.gotNextMessagesError=function(a,c,b,l){if(999!=k.FailAllError)if(0!=k.FailAllError)l[1](null,k.FailAllError,l[2]);else l[1](k,null,{Header:{HttpError:a.status}},a.status,l[2])};k.CancelAllQueries=function(a){for(;0<
21
-k.PendingAjax.length;){var c=k.PendingAjax.shift();c[1](null,a,c[2])}null!=k.websocket&&(k.websocket.close(),k.websocket=null,k.socketState=0)};return k},CreateAmtRedirect=function(a){var b={};b.m=a;a.parent=b;b.State=0;b.socket=null;b.host=null;b.port=0;b.user=null;b.pass=null;b.authuri="/RedirectionService";b.tlsv1only=0;b.connectstate=0;b.protocol=a.protocol;b.amtaccumulator="";b.amtsequence=1;b.amtkeepalivetimer=null;b.onStateChanged=null;b.Start=function(a,d,f,m,p){b.host=a;b.port=d;b.user=f;
22
-b.pass=m;b.connectstate=0;b.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="+d+"&tls="+p+("*"==f?"&serverauth=1":"")+("undefined"===typeof m?"&serverauth=1&user="+f:"")+"&tls1only="+b.tlsv1only);b.socket.onopen=b.xxOnSocketConnected;b.socket.onmessage=b.xxOnMessage;b.socket.onclose=b.xxOnSocketClosed;b.xxStateChange(1)};b.xxOnSocketConnected=
23
-function(){urlvars&&urlvars.redirtrace&&console.log("REDIR-CONNECT");b.xxStateChange(2);1==b.protocol&&b.xxSend(b.RedirectStartSol);2==b.protocol&&b.xxSend(b.RedirectStartKvm);3==b.protocol&&b.xxSend(b.RedirectStartIder)};b.xxOnMessage=function(a){if("object"==typeof a.data){var d=new FileReader;if(d.readAsBinaryString)d.onload=function(a){b.xxOnSocketData(a.target.result)},d.readAsBinaryString(new Blob([a.data]));else if(d.readAsArrayBuffer)d.onloadend=function(a){b.xxOnSocketData(a.target.result)},
24
-d.readAsArrayBuffer(a.data);else{d="";a=new Uint8Array(a.data);for(var f=a.byteLength,m=0;m<f;m++)d+=String.fromCharCode(a[m]);b.xxOnSocketData(d)}}else b.xxOnSocketData(a.data)};b.xxOnSocketData=function(a){if(a&&-1!=b.connectstate){if("object"===typeof a){var d="",f=new Uint8Array(a),m=f.byteLength;for(a=0;a<m;a++)d+=String.fromCharCode(f[a]);a=d}else if("string"!==typeof a)return;if((2==b.protocol||3==b.protocol)&&1==b.connectstate)return b.m.ProcessData(a);b.amtaccumulator+=a;for(urlvars&&urlvars.redirtrace&&
25
-console.log("REDIR-RECV("+b.amtaccumulator.length+"): "+rstr2hex(b.amtaccumulator));1<=b.amtaccumulator.length;){a=0;switch(b.amtaccumulator.charCodeAt(0)){case 17:if(4>b.amtaccumulator.length)return;switch(b.amtaccumulator.charCodeAt(1)){case 0:if(13>b.amtaccumulator.length)return;d=b.amtaccumulator.charCodeAt(12);if(b.amtaccumulator.length<13+d)return;b.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+d;break;default:b.Stop()}break;case 20:if(9>b.amtaccumulator.length)return;var p=ReadIntX(b.amtaccumulator,
26
-5);if(b.amtaccumulator.length<9+p)return;var m=b.amtaccumulator.charCodeAt(1),d=b.amtaccumulator.charCodeAt(4),r=[];for(a=0;a<p;a++)r.push(b.amtaccumulator.charCodeAt(9+a));f=b.amtaccumulator.substring(9,9+p);a=9+p;if(0==d)0<=r.indexOf(4)?b.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(b.user.length+b.authuri.length+8)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0,0)):0<=r.indexOf(3)?b.xxSend(String.fromCharCode(19,
27
-0,0,0,3)+IntToStrX(b.user.length+b.authuri.length+7)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0)):0<=r.indexOf(1)?b.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(b.user.length+b.pass.length+2)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(b.pass.length)+b.pass):b.Stop();else if(3!=d&&4!=d||1!=m)0==m?(1==b.protocol&&b.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(b.amtsequence++)+ShortToStrX(1E4)+
28
-ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+IntToStrX(0)),2==b.protocol&&b.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3==b.protocol&&(b.connectstate=1,b.xxStateChange(3))):b.Stop();else{var p=0,r=f.charCodeAt(p),m=f.substring(p+1,p+1+r),p=p+(r+1),l=f.charCodeAt(p),r=f.substring(p+1,p+1+l),p=p+(l+1),l=0,l=null,k=b.xxRandomNonce(32),v="";4==d&&(l=f.charCodeAt(p),l=f.substring(p+1,p+1+l),v="00000002:"+k+":"+l+":");f=hex_md5(hex_md5(b.user+":"+m+":"+b.pass)+":"+
29
-r+":"+v+hex_md5("POST:"+b.authuri));p=b.user.length+m.length+r.length+b.authuri.length+k.length+8+f.length+7;4==d&&(p+=l.length+1);f=String.fromCharCode(19,0,0,0,d)+IntToStrX(p)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(m.length)+m+String.fromCharCode(r.length)+r+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(k.length)+k+String.fromCharCode(8)+"00000002"+String.fromCharCode(f.length)+f;4==d&&(f+=String.fromCharCode(l.length)+l);b.xxSend(f)}break;case 33:if(23>
30
-b.amtaccumulator.length)break;a=23;b.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(b.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));1==b.protocol&&(b.amtkeepalivetimer=setInterval(b.xxSendAmtKeepAlive,2E3));b.connectstate=1;b.xxStateChange(3);break;case 41:if(10>b.amtaccumulator.length)break;a=10;break;case 42:if(10>b.amtaccumulator.length)break;d=10+((b.amtaccumulator.charCodeAt(9)&255)<<8)+(b.amtaccumulator.charCodeAt(8)&255);if(b.amtaccumulator.length<d)break;b.m.ProcessData(b.amtaccumulator.substring(10,
31
-d));a=d;break;case 43:if(8>b.amtaccumulator.length)break;a=8;break;case 65:if(8>b.amtaccumulator.length)break;b.connectstate=1;b.m.Start();8<b.amtaccumulator.length&&b.m.ProcessData(b.amtaccumulator.substring(8));a=b.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+b.amtaccumulator.charCodeAt(0)+" acclen="+b.amtaccumulator.length);b.Stop();return}if(0==a)break;b.amtaccumulator=b.amtaccumulator.substring(a)}}};b.xxSend=function(a){urlvars&&urlvars.redirtrace&&console.log("REDIR-SEND("+
32
-a.length+"): "+rstr2hex(a));if(null!=b.socket&&b.socket.readyState==WebSocket.OPEN){for(var d=new Uint8Array(a.length),f=0;f<a.length;++f)d[f]=a.charCodeAt(f);b.socket.send(d.buffer)}};b.Send=function(a){null!=b.socket&&1==b.connectstate&&(1==b.protocol?b.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(b.amtsequence++)+ShortToStrX(a.length)+a):b.xxSend(a))};b.xxSendAmtKeepAlive=function(){null!=b.socket&&b.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(b.amtsequence++))};b.xxRandomNonceX="abcdef0123456789";
33
-b.xxRandomNonce=function(a){for(var d="",f=0;f<a;f++)d+=b.xxRandomNonceX.charAt(Math.floor(Math.random()*b.xxRandomNonceX.length));return d};b.xxOnSocketClosed=function(){urlvars&&urlvars.redirtrace&&console.log("REDIR-CLOSED");b.Stop()};b.xxStateChange=function(a){if(b.State!=a&&(b.State=a,b.m.xxStateChange(b.State),null!=b.onStateChanged))b.onStateChanged(b,b.State)};b.Stop=function(){b.xxStateChange(0);b.connectstate=-1;b.amtaccumulator="";null!=b.socket&&(b.socket.close(),b.socket=null);null!=
34
-b.amtkeepalivetimer&&(clearInterval(b.amtkeepalivetimer),b.amtkeepalivetimer=null)};b.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32);b.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82);b.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return b},WsmanStackCreateService=function(a,b,c,d,f,m){function p(a){for(var c,b={},l=0;l<a.childNodes.length;l++){var h=a.childNodes[l];c=null==h.childElementCount||0==h.childElementCount?h.textContent:p(h);"true"==c&&(c=!0);"false"==
35
-c&&(c=!1);parseInt(c)+""===c&&(c=parseInt(c));var g=c;if(null!=h.attributes&&0<h.attributes.length)for(g={Value:c},c=0;c<h.attributes.length;c++)g["@"+h.attributes[c].name]=h.attributes[c].value;b[h.localName]instanceof Array?b[h.localName].push(g):b[h.localName]=null==b[h.localName]?g:[b[h.localName],g]}return b}function r(a){if(!a)return"";var c="",b;for(b in a)a.hasOwnProperty(b)&&0===b.indexOf("@")&&(c+=" "+b.substring(1)+'="'+a[b]+'"');return c}function l(a){if(!a)return"";if("string"==typeof a)return a;
36
-if(a.InstanceID)return'<w:SelectorSet><w:Selector Name="InstanceID">'+a.InstanceID+"</w:Selector></w:SelectorSet>";var c="<w:SelectorSet>",b;for(b in a)if(a.hasOwnProperty(b)){c+='<w:Selector Name="'+b+'">';if(a[b].ReferenceParameters){var c=c+"<a:EndpointReference>",c=c+("<a:Address>"+a[b].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+a[b].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>"),l=a[b].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(l))for(var h=
37
-0;h<l.length;h++)c+="<w:Selector"+r(l[h])+">"+l[h].Value+"</w:Selector>";else c+="<w:Selector"+r(l)+">"+l.Value+"</w:Selector>";c+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else c+=a[b];c+="</w:Selector>"}return c+"</w:SelectorSet>"}var k={NextMessageId:1,Address:"/wsman"};k.comm=CreateWsmanComm(a,b,c,d,f,m);k.PerformAjax=function(a,c,b,l,h){null==h&&(h="");k.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" '+
38
-h+"><Header><a:Action>"+a,function(a,b,l){200!=b?c(k,null,{Header:{HttpError:b}},b,l):(a=k.ParseWsman(a))&&null!=a?c(k,a.Header.ResourceURI,a,200,l):c(k,null,{Header:{HttpError:b}},601,l)},b,l)};k.CancelAllQueries=function(a){k.comm.CancelAllQueries(a)};k.GetNameFromUrl=function(a){var c=a.lastIndexOf("/");return-1==c?a:a.substring(c+1)};k.ExecSubscribe=function(a,c,b,d,h,g,E,n,F,w){var y="",D="";n="";null!=F&&null!=w&&(y='<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>'+
39
-F+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+w+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",D='<w:Auth Profile="http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/digest"/>');null!=n&&(n="<a:ReferenceParameters><m:arg>"+n+"</m:arg></a:ReferenceParameters>");"PushWithAck"==c?c="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==c&&(c="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push");
40
-a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+l(E)+y+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.'+c+'"><e:NotifyTo><a:Address>'+b+"</a:Address>"+n+"</e:NotifyTo>"+D+"</e:Delivery></e:Subscribe>";k.PerformAjax(a+"</Body></Envelope>",d,h,
41
-g,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};k.ExecUnSubscribe=function(a,c,b,d,h){a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+l(h)+"</Header><Body><e:Unsubscribe/>";k.PerformAjax(a+"</Body></Envelope>",c,b,d,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};
42
-k.ExecPut=function(a,c,b,d,h,g){g="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.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>"+l(g)+"</Header><Body>";if(a&&null!=c){var E=k.GetNameFromUrl(a);a="<r:"+E+' xmlns:r="'+a+'">';for(var n in c)if(c.hasOwnProperty(n)&&
43
-0!==n.indexOf("__")&&0!==n.indexOf("@")&&null!=c[n]&&"function"!==typeof c[n])if("object"===typeof c[n]&&c[n].ReferenceParameters){a+="<r:"+n+"><a:Address>"+c[n].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+c[n].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var F=c[n].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(F))for(var w=0;w<F.length;w++)a+="<w:Selector"+r(F[w])+">"+F[w].Value+"</w:Selector>";else a+="<w:Selector"+r(F)+">"+F.Value+"</w:Selector>";
44
-a+="</w:SelectorSet></a:ReferenceParameters></r:"+n+">"}else if(Array.isArray(c[n]))for(w=0;w<c[n].length;w++)a+="<r:"+n+">"+c[n][w].toString()+"</r:"+n+">";else a+="<r:"+n+">"+c[n].toString()+"</r:"+n+">";c=a+("</r:"+E+">")}else c="";k.PerformAjax(g+c+"</Body></Envelope>",b,d,h)};k.ExecCreate=function(a,c,b,d,h,g){var E=k.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.NextMessageId++ +
45
-"</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>"+l(g)+"</Header><Body><g:"+E+' xmlns:g="'+a+'">';for(var n in c)a+="<g:"+n+">"+c[n]+"</g:"+n+">";k.PerformAjax(a+"</g:"+E+"></Body></Envelope>",b,d,h)};k.ExecDelete=function(a,c,b,d,h){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.NextMessageId++ +
46
-"</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>"+l(c)+"</Header><Body /></Envelope>";k.PerformAjax(a,b,d,h)};k.ExecGet=function(a,c,b,l){k.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.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>",
47
-c,b,l)};k.ExecMethod=function(a,c,b,l,h,g,d){var n="",F;for(F in b)if(null!=b[F])if(Array.isArray(b[F]))for(var w in b[F])n+="<r:"+F+">"+b[F][w]+"</r:"+F+">";else n+="<r:"+F+">"+b[F]+"</r:"+F+">";k.ExecMethodXml(a,c,n,l,h,g,d)};k.ExecMethodXml=function(a,c,b,d,h,g,E){k.PerformAjax(a+"/"+c+"</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.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>"+
48
-l(E)+"</Header><Body><r:"+c+'_INPUT xmlns:r="'+a+'">'+b+"</r:"+c+"_INPUT></Body></Envelope>",d,h,g)};k.ExecEnum=function(a,c,b,l){k.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.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>',
49
-c,b,l)};k.ExecPull=function(a,c,b,l,h){k.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+k.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+k.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>'+c+"</EnumerationContext></Pull></Body></Envelope>",
50
-b,l,h)};k.ParseWsman=function(a){try{if(!a.childNodes){var c=a;if(window.DOMParser)a=(new DOMParser).parseFromString(c,"text/xml");else{var b=new ActiveXObject("Microsoft.XMLDOM");b.async=!1;b.loadXML(c);a=b}}var c={Header:{}},l=a.getElementsByTagName("Header")[0],h;l||(l=a.getElementsByTagName("a:Header")[0]);if(!l)return null;for(b=0;b<l.childNodes.length;b++){var g=l.childNodes[b];c.Header[g.localName]=g.textContent}var d=a.getElementsByTagName("Body")[0];d||(d=a.getElementsByTagName("a:Body")[0]);
51
-if(!d)return null;0<d.childNodes.length&&(h=d.childNodes[0].localName,h.indexOf("_OUTPUT")==h.length-7&&(h=h.substring(0,h.length-7)),c.Header.Method=h,c.Body=p(d.childNodes[0]));return c}catch(n){return console.log("Unable to parse XML: "+a),null}};return k};
52
-function AmtStackCreateService(a){function b(){var a=e.GetPendingActions();u<a&&(u=a);null!=e.onProcessChanged&&B!=a&&(B=a,e.onProcessChanged(a,u));0==a&&(u=0)}function c(a,c,b,l,g,h,z){200!=g?(b(e,a,null,g,h),f(1)):null!=c&&"EnumerateResponse"==c.Header.Method&&c.Body.EnumerationContext?e.wsman.ExecPull(l,c.Body.EnumerationContext,function(c,l,g,w){d(a,g,b,l,[],w,h,z)}):(b(e,a,null,603,h),f(1))}function d(a,c,l,g,h,n,z,k){if(200!=n)l(e,a,null,n,z),f(1);else if(null==c||"PullResponse"!=c.Header.Method)l(e,
53
-a,null,604,z),f(1);else{for(var v in c.Body.Items)if(c.Body.Items[v]instanceof Array)for(var u in c.Body.Items[v])"function"!=typeof c.Body.Items[v][u]&&h.push(c.Body.Items[v][u]);else"function"!=typeof c.Body.Items[v]&&h.push(c.Body.Items[v]);c.Body.EnumerationContext?e.wsman.ExecPull(g,c.Body.EnumerationContext,function(c,b,g,w){d(a,g,l,b,h,w,z,1)}):(f(1),l(e,a,h,n,z),b())}}function f(a){e.ActiveEnumsCount-=a;e.ActiveEnumsCount>=e.MaxActiveEnumsCount||0==e.PendingEnums.length?b():(a=e.PendingEnums.shift(),
54
-e.Enum(a[0],a[1],a[2]),f(0))}function m(a,c,l,g,h,d,z){e.PendingBatchOperations-=2;var n=c.shift(),k=e.Enum;"*"==n[0]&&(k=e.Get,n=n.substring(1));k(n,function(h,n,k,A,C){C[2][n]={response:null==k?null:k.Body,responses:k,status:A};0==C[1].length||401==A||1!=d&&200!=A&&400!=A?(e.PendingBatchOperations-=2*c.length,b(),l(e,a,C[2],A,g)):(b(),m(a,c,l,g,C[2],z))},[a,c,h],z);b()}function p(a){a.names.length<=a.current?a.callback(e,a.name,a.responses,200,a.tag):(e.wsman.ExecGet(e.CompleteName(a.names[a.current]),
55
-function(c,b,l,g){null==l||200!=g?a.callback(e,a.name,null,g,a.tag):(a.responses[l.Header.Method]=l,p(a))},a.pri),a.current++);b()}function r(a,c,b,g,h){if(200!=g||"0"!=b.Body.ReturnValue)h[0](e,null,h[2]);else e.AMT_MessageLog_GetRecords(b.Body.IterationIdentifier,390,l,h)}function l(a,c,b,g,h){if(200!=g||"0"!=b.Body.ReturnValue)h[0](e,null,h[2]);else{var d,z,n;c=h[2];g=new Date;var v=b.Body.RecordArray;"string"===typeof v&&(b.Body.RecordArray=[b.Body.RecordArray]);for(d in v){a=null;try{a=window.atob(v[d])}catch(u){}if(null!=
56
-a&&(z=ReadIntX(a,0),0<z&&4294967295>z)){n={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*(z+60*g.getTimezoneOffset()))};for(z=13;21>z;z++)n.EventData.push(a.charCodeAt(z));n.EntityStr=E[n.Entity];n.Desc=k(n.EventSensorType,n.EventOffset,n.EventData,n.Entity);
57
-n.EntityStr||(n.EntityStr="Unknown");c.push(n)}}if(1!=b.Body.NoMoreRecords)e.AMT_MessageLog_GetRecords(b.Body.IterationIdentifier,390,l,[h[0],c,h[2]]);else h[0](e,c,h[2])}}function k(a,c,b,l){if(15==a)return 235==b[0]?"Invalid Data":0==c?h[b[1]]:g[b[1]];if(18==a&&170==b[0])return"Agent watchdog "+char2hex(b[4])+char2hex(b[3])+char2hex(b[2])+char2hex(b[1])+"-"+char2hex(b[6])+char2hex(b[5])+"-... changed to "+e.WatchdogCurrentStates[b[7]];if(5==a&&0==c)return"Case intrusion";if(192==a&&0==c&&170==b[0]&&
9
+var CreateWsmanComm=function(a,b,c,d,g){function n(){l.socketState=2;l.socketParseState=0;l.socketAccumulator="";l.socketHeader=null;l.socketData="";for(i in l.pendingAjaxCall)l.sendRequest(l.pendingAjaxCall[i][0],l.pendingAjaxCall[i][3],l.pendingAjaxCall[i][4])}function r(a){if("object"==typeof a.data)if(1==e)v.push(a.data);else if(w.readAsBinaryString)e=!0,w.readAsBinaryString(new Blob([a.data]));else if(w.readAsArrayBuffer)e=!0,w.readAsArrayBuffer(a.data);else{var b="";a=new Uint8Array(a.data);
10
+for(var c=a.byteLength,m=0;m<c;m++)b+=String.fromCharCode(a[m]);u(b)}else u(a.data)}function u(a){if("object"===typeof a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,m=0;m<c;m++)b+=String.fromCharCode(a[m]);a=b}else if("string"!==typeof a)return;for(l.socketAccumulator+=a;;){if(0==l.socketParseState){a=l.socketAccumulator.indexOf("\r\n\r\n");if(0>a)break;l.socketHeader=l.socketAccumulator.substring(0,a).split("\r\n");if(null==l.amtVersion)for(m in l.socketHeader)0==l.socketHeader[m].indexOf("Server: Intel(R) Active Management Technology ")&&
11
+(l.amtVersion=l.socketHeader[m].substring(46));l.socketAccumulator=l.socketAccumulator.substring(a+4);l.socketParseState=1;l.socketData="";l.socketXHeader={Directive:l.socketHeader[0].split(" ")};for(m in l.socketHeader)0!=m&&(a=l.socketHeader[m].indexOf(":"),l.socketXHeader[l.socketHeader[m].substring(0,a).toLowerCase()]=l.socketHeader[m].substring(a+2))}if(1==l.socketParseState){b=-1;if(void 0==l.socketXHeader.connection||"close"!=l.socketXHeader.connection.toLowerCase()||void 0!=l.socketXHeader["transfer-encoding"]&&
12
+"chunked"==l.socketXHeader["transfer-encoding"].toLowerCase())if(void 0!=l.socketXHeader["content-length"]){b=parseInt(l.socketXHeader["content-length"]);if(l.socketAccumulator.length<b)break;a=l.socketAccumulator.substring(0,b);l.socketAccumulator=l.socketAccumulator.substring(b);l.socketData=a;b=0}else{c=l.socketAccumulator.indexOf("\r\n");if(0>c)break;b=parseInt(l.socketAccumulator.substring(0,c),16);if(isNaN(b)){l.websocket&&l.websocket.close();break}if(l.socketAccumulator.length<c+2+b+2)break;
13
+a=l.socketAccumulator.substring(c+2,c+2+b);l.socketAccumulator=l.socketAccumulator.substring(c+2+b+2);l.socketData+=a}else b=0;0==b&&(c=l.socketXHeader,a=l.socketData,b=parseInt(c.Directive[1]),isNaN(b)&&(b=602),401==b&&3>++l.authcounter?l.challengeParams=l.parseDigest(c["www-authenticate"]):(c=l.pendingAjaxCall.shift(),l.authcounter=0,l.ActiveAjaxCount--,l.gotNextMessages(a,"success",{status:b},c),l.PerformNextAjax()),l.socketParseState=0,l.socketHeader=null)}}}function m(a){0==l.inDataCount&&(l.tlsv1only=
14
+1-l.tlsv1only);l.socketState=0;null!=l.socket&&(l.socket.close(),l.socket=null);if(0<l.pendingAjaxCall.length){a=l.pendingAjaxCall.shift();var b=a[5];l.PerformAjaxExNodeJS2(a[0],a[1],a[2],a[3],a[4],--b)}}var l={PendingAjax:[],ActiveAjaxCount:0,MaxActiveAjaxCount:1,FailAllError:0,challengeParams:null,noncecounter:1,authcounter:0,socket:null,socketState:0};l.host=a;l.port=b;l.user=c;l.pass=d;l.tls=g;l.tlsv1only=0;l.cnonce=Math.random().toString(36).substring(7);l.inDataCount=0;l.amtVersion=null;l.PerformAjax=
15
+function(a,b,c,m,e,F){l.ActiveAjaxCount<l.MaxActiveAjaxCount&&0==l.PendingAjax.length?l.PerformAjaxEx(a,b,c,e,F):1==m?l.PendingAjax.unshift([a,b,c,e,F]):l.PendingAjax.push([a,b,c,e,F])};l.PerformNextAjax=function(){if(!(l.ActiveAjaxCount>=l.MaxActiveAjaxCount||0==l.PendingAjax.length)){var a=l.PendingAjax.shift();l.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);l.PerformNextAjax()}};l.PerformAjaxEx=function(a,b,c,m,e){if(0!=l.FailAllError)l.gotNextMessagesError({status:l.FailAllError},"error",null,[a,b,
16
+c,m,e]);else return a||(a=""),l.ActiveAjaxCount++,l.PerformAjaxExNodeJS(a,b,c,m,e)};l.pendingAjaxCall=[];l.PerformAjaxExNodeJS=function(a,b,c,m,e){l.PerformAjaxExNodeJS2(a,b,c,m,e,3)};l.PerformAjaxExNodeJS2=function(a,b,c,m,e,F){0>=F||0!=l.FailAllError?(l.ActiveAjaxCount--,999!=l.FailAllError&&l.gotNextMessages(null,"error",{status:0==l.FailAllError?408:l.FailAllError},[a,b,c,m,e]),l.PerformNextAjax()):(l.pendingAjaxCall.push([a,b,c,m,e,F]),0==l.socketState?l.xxConnectHttpSocket():2==l.socketState&&
17
+l.sendRequest(a,m,e))};l.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var m=c+" "+b+" HTTP/1.1\r\n";null!=l.challengeParams&&(c=hex_md5(hex_md5(l.user+":"+l.challengeParams.realm+":"+l.pass)+":"+l.challengeParams.nonce+":"+l.noncecounter+":"+l.cnonce+":"+l.challengeParams.qop+":"+hex_md5(c+":"+b)),m+="Authorization: "+l.renderDigest({username:l.user,realm:l.challengeParams.realm,nonce:l.challengeParams.nonce,uri:b,qop:l.challengeParams.qop,response:c,nc:l.noncecounter++,cnonce:l.cnonce})+
18
+"\r\n");a=m+="Host: "+l.host+":"+l.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==l.socketState&&null!=l.socket&&l.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(m=0;m<a.length;++m)b[m]=a.charCodeAt(m);try{l.socket.send(b.buffer)}catch(e){}}};l.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},{})};l.renderDigest=function(a){var b=[];for(i in a)b.push(i);
19
+return"Digest "+b.reduce(function(b,c){return b+","+c+'="'+a[c]+'"'},"").substring(1)};l.xxConnectHttpSocket=function(){l.inDataCount=0;l.socketState=1;l.socket=new WebSocket(window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=1&host="+l.host+"&port="+l.port+"&tls="+l.tls+"&tls1only="+l.tlsv1only+("*"==c?"&serverauth=1":"")+("undefined"===typeof d?"&serverauth=1&user="+c:""));l.socket.onopen=
20
+n;l.socket.onmessage=r;l.socket.onclose=m};var w=new FileReader,e=!1,v=[];w.readAsBinaryString?w.onload=function(a){u(a.target.result);0==v.length?e=!1:w.readAsBinaryString(new Blob([v.shift()]))}:w.readAsArrayBuffer&&(w.onloadend=function(a){u(a.target.result);0==v.length?e=!1:w.readAsArrayBuffer(v.shift())});l.gotNextMessages=function(a,b,c,m){if(999!=l.FailAllError)if(0!=l.FailAllError)m[1](null,l.FailAllError,m[2]);else if(200!=c.status)m[1](null,c.status,m[2]);else m[1](a,200,m[2])};l.gotNextMessagesError=
21
+function(a,b,c,m){if(999!=l.FailAllError)if(0!=l.FailAllError)m[1](null,l.FailAllError,m[2]);else m[1](l,null,{Header:{HttpError:a.status}},a.status,m[2])};l.CancelAllQueries=function(a){for(;0<l.PendingAjax.length;){var b=l.PendingAjax.shift();b[1](null,a,b[2])}null!=l.websocket&&(l.websocket.close(),l.websocket=null,l.socketState=0)};return l},CreateAmtRedirect=function(a){var b={};b.m=a;a.parent=b;b.State=0;b.socket=null;b.host=null;b.port=0;b.user=null;b.pass=null;b.authuri="/RedirectionService";
22
+b.tlsv1only=0;b.connectstate=0;b.protocol=a.protocol;b.amtaccumulator="";b.amtsequence=1;b.amtkeepalivetimer=null;b.onStateChanged=null;b.Start=function(a,c,d,m,l){b.host=a;b.port=c;b.user=d;b.pass=m;b.connectstate=0;b.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="+c+"&tls="+l+("*"==d?"&serverauth=1":"")+("undefined"===typeof m?"&serverauth=1&user="+
23
+d:"")+"&tls1only="+b.tlsv1only);b.socket.onopen=b.xxOnSocketConnected;b.socket.onmessage=b.xxOnMessage;b.socket.onclose=b.xxOnSocketClosed;b.xxStateChange(1)};b.xxOnSocketConnected=function(){urlvars&&urlvars.redirtrace&&console.log("REDIR-CONNECT");b.xxStateChange(2);1==b.protocol&&b.xxSend(b.RedirectStartSol);2==b.protocol&&b.xxSend(b.RedirectStartKvm);3==b.protocol&&b.xxSend(b.RedirectStartIder)};var c=new FileReader,d=!1,g=[];c.readAsBinaryString?c.onload=function(a){b.xxOnSocketData(a.target.result);
24
+0==g.length?d=!1:c.readAsBinaryString(new Blob([g.shift()]))}:c.readAsArrayBuffer&&(c.onloadend=function(a){b.xxOnSocketData(a.target.result);0==g.length?d=!1:c.readAsArrayBuffer(g.shift())});b.xxOnMessage=function(a){b.inDataCount++;if("object"==typeof a.data)if(1==d)g.push(a.data);else if(c.readAsBinaryString)d=!0,c.readAsBinaryString(new Blob([a.data]));else if(f.readAsArrayBuffer)d=!0,c.readAsArrayBuffer(a.data);else{var r="";a=new Uint8Array(a.data);for(var u=a.byteLength,m=0;m<u;m++)r+=String.fromCharCode(a[m]);
25
+b.xxOnSocketData(r)}else b.xxOnSocketData(a.data)};b.xxOnSocketData=function(a){if(a&&-1!=b.connectstate){if("object"===typeof a){var c="",d=new Uint8Array(a),m=d.byteLength;for(a=0;a<m;a++)c+=String.fromCharCode(d[a]);a=c}else if("string"!==typeof a)return;if((2==b.protocol||3==b.protocol)&&1==b.connectstate)return b.m.ProcessData(a);b.amtaccumulator+=a;for(urlvars&&urlvars.redirtrace&&console.log("REDIR-RECV("+b.amtaccumulator.length+"): "+rstr2hex(b.amtaccumulator));1<=b.amtaccumulator.length;){a=
26
+0;switch(b.amtaccumulator.charCodeAt(0)){case 17:if(4>b.amtaccumulator.length)return;switch(b.amtaccumulator.charCodeAt(1)){case 0:if(13>b.amtaccumulator.length)return;c=b.amtaccumulator.charCodeAt(12);if(b.amtaccumulator.length<13+c)return;b.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));a=13+c;break;default:b.Stop()}break;case 20:if(9>b.amtaccumulator.length)return;var l=ReadIntX(b.amtaccumulator,5);if(b.amtaccumulator.length<9+l)return;var m=b.amtaccumulator.charCodeAt(1),c=b.amtaccumulator.charCodeAt(4),
27
+w=[];for(a=0;a<l;a++)w.push(b.amtaccumulator.charCodeAt(9+a));d=b.amtaccumulator.substring(9,9+l);a=9+l;if(0==c)0<=w.indexOf(4)?b.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(b.user.length+b.authuri.length+8)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0,0)):0<=w.indexOf(3)?b.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(b.user.length+b.authuri.length+7)+String.fromCharCode(b.user.length)+b.user+
28
+String.fromCharCode(0,0)+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(0,0,0)):0<=w.indexOf(1)?b.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(b.user.length+b.pass.length+2)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(b.pass.length)+b.pass):b.Stop();else if(3!=c&&4!=c||1!=m)0==m?(1==b.protocol&&b.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(b.amtsequence++)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+ShortToStrX(1E4)+ShortToStrX(100)+ShortToStrX(0)+
29
+IntToStrX(0)),2==b.protocol&&b.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0)),3==b.protocol&&(b.connectstate=1,b.xxStateChange(3))):b.Stop();else{var l=0,w=d.charCodeAt(l),m=d.substring(l+1,l+1+w),l=l+(w+1),e=d.charCodeAt(l),w=d.substring(l+1,l+1+e),l=l+(e+1),e=0,e=null,v=b.xxRandomNonce(32),E="";4==c&&(e=d.charCodeAt(l),e=d.substring(l+1,l+1+e),E="00000002:"+v+":"+e+":");d=hex_md5(hex_md5(b.user+":"+m+":"+b.pass)+":"+w+":"+E+hex_md5("POST:"+b.authuri));l=b.user.length+m.length+w.length+b.authuri.length+
30
+v.length+8+d.length+7;4==c&&(l+=e.length+1);d=String.fromCharCode(19,0,0,0,c)+IntToStrX(l)+String.fromCharCode(b.user.length)+b.user+String.fromCharCode(m.length)+m+String.fromCharCode(w.length)+w+String.fromCharCode(b.authuri.length)+b.authuri+String.fromCharCode(v.length)+v+String.fromCharCode(8)+"00000002"+String.fromCharCode(d.length)+d;4==c&&(d+=String.fromCharCode(e.length)+e);b.xxSend(d)}break;case 33:if(23>b.amtaccumulator.length)break;a=23;b.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(b.amtsequence++)+
31
+String.fromCharCode(0,0,27,0,0,0));1==b.protocol&&(b.amtkeepalivetimer=setInterval(b.xxSendAmtKeepAlive,2E3));b.connectstate=1;b.xxStateChange(3);break;case 41:if(10>b.amtaccumulator.length)break;a=10;break;case 42:if(10>b.amtaccumulator.length)break;c=10+((b.amtaccumulator.charCodeAt(9)&255)<<8)+(b.amtaccumulator.charCodeAt(8)&255);if(b.amtaccumulator.length<c)break;b.m.ProcessData(b.amtaccumulator.substring(10,c));a=c;break;case 43:if(8>b.amtaccumulator.length)break;a=8;break;case 65:if(8>b.amtaccumulator.length)break;
32
+b.connectstate=1;b.m.Start();8<b.amtaccumulator.length&&b.m.ProcessData(b.amtaccumulator.substring(8));a=b.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+b.amtaccumulator.charCodeAt(0)+" acclen="+b.amtaccumulator.length);b.Stop();return}if(0==a)break;b.amtaccumulator=b.amtaccumulator.substring(a)}}};b.xxSend=function(a){urlvars&&urlvars.redirtrace&&console.log("REDIR-SEND("+a.length+"): "+rstr2hex(a));if(null!=b.socket&&b.socket.readyState==WebSocket.OPEN){for(var c=
33
+new Uint8Array(a.length),d=0;d<a.length;++d)c[d]=a.charCodeAt(d);b.socket.send(c.buffer)}};b.Send=function(a){null!=b.socket&&1==b.connectstate&&(1==b.protocol?b.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(b.amtsequence++)+ShortToStrX(a.length)+a):b.xxSend(a))};b.xxSendAmtKeepAlive=function(){null!=b.socket&&b.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(b.amtsequence++))};b.xxRandomNonceX="abcdef0123456789";b.xxRandomNonce=function(a){for(var c="",d=0;d<a;d++)c+=b.xxRandomNonceX.charAt(Math.floor(Math.random()*
34
+b.xxRandomNonceX.length));return c};b.xxOnSocketClosed=function(){urlvars&&urlvars.redirtrace&&console.log("REDIR-CLOSED");b.Stop()};b.xxStateChange=function(a){if(b.State!=a&&(b.State=a,b.m.xxStateChange(b.State),null!=b.onStateChanged))b.onStateChanged(b,b.State)};b.Stop=function(){b.xxStateChange(0);b.connectstate=-1;b.amtaccumulator="";null!=b.socket&&(b.socket.close(),b.socket=null);null!=b.amtkeepalivetimer&&(clearInterval(b.amtkeepalivetimer),b.amtkeepalivetimer=null)};b.RedirectStartSol=String.fromCharCode(16,
35
+0,0,0,83,79,76,32);b.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82);b.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return b},WsmanStackCreateService=function(a,b,c,d,g,n){function r(a){for(var c,b={},m=0;m<a.childNodes.length;m++){var k=a.childNodes[m];c=null==k.childElementCount||0==k.childElementCount?k.textContent:r(k);"true"==c&&(c=!0);"false"==c&&(c=!1);parseInt(c)+""===c&&(c=parseInt(c));var h=c;if(null!=k.attributes&&0<k.attributes.length)for(h={Value:c},c=0;c<k.attributes.length;c++)h["@"+
36
+k.attributes[c].name]=k.attributes[c].value;b[k.localName]instanceof Array?b[k.localName].push(h):b[k.localName]=null==b[k.localName]?h:[b[k.localName],h]}return b}function u(a){if(!a)return"";var c="",b;for(b in a)a.hasOwnProperty(b)&&0===b.indexOf("@")&&(c+=" "+b.substring(1)+'="'+a[b]+'"');return c}function m(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 c="<w:SelectorSet>",
37
+b;for(b in a)if(a.hasOwnProperty(b)){c+='<w:Selector Name="'+b+'">';if(a[b].ReferenceParameters){var c=c+"<a:EndpointReference>",c=c+("<a:Address>"+a[b].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+a[b].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>"),m=a[b].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(m))for(var k=0;k<m.length;k++)c+="<w:Selector"+u(m[k])+">"+m[k].Value+"</w:Selector>";else c+="<w:Selector"+u(m)+">"+m.Value+"</w:Selector>";c+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else c+=
38
+a[b];c+="</w:Selector>"}return c+"</w:SelectorSet>"}var l={NextMessageId:1,Address:"/wsman"};l.comm=CreateWsmanComm(a,b,c,d,g,n);l.PerformAjax=function(a,c,b,m,k){null==k&&(k="");l.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" '+
39
+k+"><Header><a:Action>"+a,function(a,b,m){200!=b?c(l,null,{Header:{HttpError:b}},b,m):(a=l.ParseWsman(a))&&null!=a?c(l,a.Header.ResourceURI,a,200,m):c(l,null,{Header:{HttpError:b}},601,m)},b,m)};l.CancelAllQueries=function(a){l.comm.CancelAllQueries(a)};l.GetNameFromUrl=function(a){var c=a.lastIndexOf("/");return-1==c?a:a.substring(c+1)};l.ExecSubscribe=function(a,c,b,d,k,h,C,p,F,y){var z="",A="";p="";null!=F&&null!=y&&(z='<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>'+
40
+F+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+y+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>",A='<w:Auth Profile="http://schemas.dmtf.org/wbem/wsman/1/wsman/secprofile/http/digest"/>');null!=p&&(p="<a:ReferenceParameters><m:arg>"+p+"</m:arg></a:ReferenceParameters>");"PushWithAck"==c?c="dmtf.org/wbem/wsman/1/wsman/PushWithAck":"Push"==c&&(c="xmlsoap.org/ws/2004/08/eventing/DeliveryModes/Push");
41
+a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+m(C)+z+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.'+c+'"><e:NotifyTo><a:Address>'+b+"</a:Address>"+p+"</e:NotifyTo>"+A+"</e:Delivery></e:Subscribe>";l.PerformAjax(a+"</Body></Envelope>",d,k,
42
+h,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:m="http://x.com"')};l.ExecUnSubscribe=function(a,c,b,d,k){a="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.NextMessageId++ +"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+m(k)+"</Header><Body><e:Unsubscribe/>";l.PerformAjax(a+"</Body></Envelope>",c,b,d,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};
43
+l.ExecPut=function(a,c,b,d,k,h){h="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.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>"+m(h)+"</Header><Body>";if(a&&null!=c){var C=l.GetNameFromUrl(a);a="<r:"+C+' xmlns:r="'+a+'">';for(var p in c)if(c.hasOwnProperty(p)&&
44
+0!==p.indexOf("__")&&0!==p.indexOf("@")&&null!=c[p]&&"function"!==typeof c[p])if("object"===typeof c[p]&&c[p].ReferenceParameters){a+="<r:"+p+"><a:Address>"+c[p].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+c[p].ReferenceParameters.ResourceURI+"</w:ResourceURI><w:SelectorSet>";var F=c[p].ReferenceParameters.SelectorSet.Selector;if(Array.isArray(F))for(var y=0;y<F.length;y++)a+="<w:Selector"+u(F[y])+">"+F[y].Value+"</w:Selector>";else a+="<w:Selector"+u(F)+">"+F.Value+"</w:Selector>";
45
+a+="</w:SelectorSet></a:ReferenceParameters></r:"+p+">"}else if(Array.isArray(c[p]))for(y=0;y<c[p].length;y++)a+="<r:"+p+">"+c[p][y].toString()+"</r:"+p+">";else a+="<r:"+p+">"+c[p].toString()+"</r:"+p+">";c=a+("</r:"+C+">")}else c="";l.PerformAjax(h+c+"</Body></Envelope>",b,d,k)};l.ExecCreate=function(a,c,b,d,k,h){var C=l.GetNameFromUrl(a);a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.NextMessageId++ +
46
+"</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>"+m(h)+"</Header><Body><g:"+C+' xmlns:g="'+a+'">';for(var p in c)a+="<g:"+p+">"+c[p]+"</g:"+p+">";l.PerformAjax(a+"</g:"+C+"></Body></Envelope>",b,d,k)};l.ExecDelete=function(a,c,b,d,k){a="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.NextMessageId++ +
47
+"</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>"+m(c)+"</Header><Body /></Envelope>";l.PerformAjax(a,b,d,k)};l.ExecGet=function(a,c,b,m){l.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.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>",
48
+c,b,m)};l.ExecMethod=function(a,c,b,m,k,h,d){var p="",F;for(F in b)if(null!=b[F])if(Array.isArray(b[F]))for(var y in b[F])p+="<r:"+F+">"+b[F][y]+"</r:"+F+">";else p+="<r:"+F+">"+b[F]+"</r:"+F+">";l.ExecMethodXml(a,c,p,m,k,h,d)};l.ExecMethodXml=function(a,c,b,d,k,h,C){l.PerformAjax(a+"/"+c+"</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.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>"+
49
+m(C)+"</Header><Body><r:"+c+'_INPUT xmlns:r="'+a+'">'+b+"</r:"+c+"_INPUT></Body></Envelope>",d,k,h)};l.ExecEnum=function(a,c,b,m){l.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.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>',
50
+c,b,m)};l.ExecPull=function(a,c,b,m,k){l.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+l.Address+"</a:To><w:ResourceURI>"+a+"</w:ResourceURI><a:MessageID>"+l.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>'+c+"</EnumerationContext></Pull></Body></Envelope>",
51
+b,m,k)};l.ParseWsman=function(a){try{if(!a.childNodes){var c=a;if(window.DOMParser)a=(new DOMParser).parseFromString(c,"text/xml");else{var b=new ActiveXObject("Microsoft.XMLDOM");b.async=!1;b.loadXML(c);a=b}}var c={Header:{}},m=a.getElementsByTagName("Header")[0],k;m||(m=a.getElementsByTagName("a:Header")[0]);if(!m)return null;for(b=0;b<m.childNodes.length;b++){var h=m.childNodes[b];c.Header[h.localName]=h.textContent}var d=a.getElementsByTagName("Body")[0];d||(d=a.getElementsByTagName("a:Body")[0]);
52
+if(!d)return null;0<d.childNodes.length&&(k=d.childNodes[0].localName,k.indexOf("_OUTPUT")==k.length-7&&(k=k.substring(0,k.length-7)),c.Header.Method=k,c.Body=r(d.childNodes[0]));return c}catch(p){return console.log("Unable to parse XML: "+a),null}};return l};
53
+function AmtStackCreateService(a){function b(){var a=e.GetPendingActions();v<a&&(v=a);null!=e.onProcessChanged&&E!=a&&(E=a,e.onProcessChanged(a,v));0==a&&(v=0)}function c(a,c,b,m,h,k,x){200!=h?(b(e,a,null,h,k),g(1)):null!=c&&"EnumerateResponse"==c.Header.Method&&c.Body.EnumerationContext?e.wsman.ExecPull(m,c.Body.EnumerationContext,function(c,m,h,e){d(a,h,b,m,[],e,k,x)}):(b(e,a,null,603,k),g(1))}function d(a,c,m,h,k,p,x,l){if(200!=p)m(e,a,null,p,x),g(1);else if(null==c||"PullResponse"!=c.Header.Method)m(e,
54
+a,null,604,x),g(1);else{for(var w in c.Body.Items)if(c.Body.Items[w]instanceof Array)for(var v in c.Body.Items[w])"function"!=typeof c.Body.Items[w][v]&&k.push(c.Body.Items[w][v]);else"function"!=typeof c.Body.Items[w]&&k.push(c.Body.Items[w]);c.Body.EnumerationContext?e.wsman.ExecPull(h,c.Body.EnumerationContext,function(c,b,h,e){d(a,h,m,b,k,e,x,1)}):(g(1),m(e,a,k,p,x),b())}}function g(a){e.ActiveEnumsCount-=a;e.ActiveEnumsCount>=e.MaxActiveEnumsCount||0==e.PendingEnums.length?b():(a=e.PendingEnums.shift(),
55
+e.Enum(a[0],a[1],a[2]),g(0))}function n(a,c,m,h,k,d,x){e.PendingBatchOperations-=2;var p=c.shift(),l=e.Enum;"*"==p[0]&&(l=e.Get,p=p.substring(1));l(p,function(k,p,l,D,G){G[2][p]={response:null==l?null:l.Body,responses:l,status:D};0==G[1].length||401==D||1!=d&&200!=D&&400!=D?(e.PendingBatchOperations-=2*c.length,b(),m(e,a,G[2],D,h)):(b(),n(a,c,m,h,G[2],x))},[a,c,k],x);b()}function r(a){a.names.length<=a.current?a.callback(e,a.name,a.responses,200,a.tag):(e.wsman.ExecGet(e.CompleteName(a.names[a.current]),
56
+function(c,b,m,h){null==m||200!=h?a.callback(e,a.name,null,h,a.tag):(a.responses[m.Header.Method]=m,r(a))},a.pri),a.current++);b()}function u(a,c,b,h,k){if(200!=h||"0"!=b.Body.ReturnValue)k[0](e,null,k[2]);else e.AMT_MessageLog_GetRecords(b.Body.IterationIdentifier,390,m,k)}function m(a,c,b,h,k){if(200!=h||"0"!=b.Body.ReturnValue)k[0](e,null,k[2]);else{var d,x,p;c=k[2];h=new Date;var w=b.Body.RecordArray;"string"===typeof w&&(b.Body.RecordArray=[b.Body.RecordArray]);for(d in w){a=null;try{a=window.atob(w[d])}catch(v){}if(null!=
57
+a&&(x=ReadIntX(a,0),0<x&&4294967295>x)){p={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*(x+60*h.getTimezoneOffset()))};for(x=13;21>x;x++)p.EventData.push(a.charCodeAt(x));p.EntityStr=C[p.Entity];p.Desc=l(p.EventSensorType,p.EventOffset,p.EventData,p.Entity);
58
+p.EntityStr||(p.EntityStr="Unknown");c.push(p)}}if(1!=b.Body.NoMoreRecords)e.AMT_MessageLog_GetRecords(b.Body.IterationIdentifier,390,m,[k[0],c,k[2]]);else k[0](e,c,k[2])}}function l(a,c,b,m){if(15==a)return 235==b[0]?"Invalid Data":0==c?k[b[1]]:h[b[1]];if(18==a&&170==b[0])return"Agent watchdog "+char2hex(b[4])+char2hex(b[3])+char2hex(b[2])+char2hex(b[1])+"-"+char2hex(b[6])+char2hex(b[5])+"-... changed to "+e.WatchdogCurrentStates[b[7]];if(5==a&&0==c)return"Case intrusion";if(192==a&&0==c&&170==b[0]&&
59
48==b[1]){if(0==b[2])return"A remote Serial Over LAN session was established.";if(1==b[2])return"Remote Serial Over LAN session finished. User control was restored.";if(2==b[2])return"A remote IDE-Redirection session was established.";if(3==b[2])return"Remote IDE-Redirection session finished. User control was restored."}if(36==a)return a=(b[1]<<24)+(b[2]<<16)+(b[3]<<8)+b[4],c="#"+b[0],170==b[0]&&(c="wired"),4294967293==a?"All received packet filter was matched on "+c+" interface.":4294967292==a?"All outbound packet filter was matched on "+
60
c+" interface.":4294967290==a?"Spoofed packet filter was matched on "+c+" interface.":"Filter "+a+" was matched on "+c+" interface.";if(192==a)return 0==b[2]?"Security policy invoked. Some or all network traffic (TX) was stopped.":2==b[2]?"Security policy invoked. Some or all network traffic (RX) was stopped.":"Security policy invoked.";if(193==a){if(170==b[0]&&48==b[1]&&0==b[2]&&0==b[3])return"User request for remote connection.";if(170==b[0]&&32==b[1]&&3==b[2]&&1==b[3])return"EAC error: attempt to get posture while NAC in Intel\ufffd AMT is disabled.";
60
-if(170==b[0]&&32==b[1]&&4==b[2]&&0==b[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(b[1]+(b[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 v(a,c,b,l,g){if(200!=l)g[0](e,[],l);else{var h,d,k=g[1],x=new Date,u;if(0<b.Body.RecordsReturned)for(d in b.Body.EventRecords=
61
-MakeToArray(b.Body.EventRecords),b.Body.EventRecords){a=null;try{a=window.atob(b.Body.EventRecords[d])}catch(B){console.log(B+" "+b.Body.EventRecords[d])}c={AuditAppID:ReadShort(a,0),EventID:ReadShort(a,2),InitiatorType:a.charCodeAt(4)};c.AuditApp=n[c.AuditAppID];c.Event=n[100*c.AuditAppID+c.EventID];c.Event||(c.Event="#"+c.EventID);0==c.InitiatorType&&(h=a.charCodeAt(5),c.Initiator=a.substring(6,6+h),h=6+h);1==c.InitiatorType&&(c.KerberosUserInDomain=ReadInt(a,5),h=a.charCodeAt(9),c.Initiator=GetSidString(a.substring(10,
62
-10+h)),h=10+h);2==c.InitiatorType&&(c.Initiator="<i>Local</i>",h=5);3==c.InitiatorType&&(c.Initiator="<i>KVM Default Port</i>",h=5);u=ReadInt(a,h);c.Time=new Date(1E3*(u+60*x.getTimezoneOffset()));h+=4;c.MCLocationType=a.charCodeAt(h++);u=a.charCodeAt(h++);c.NetAddress=a.substring(h,h+u);h+=u;u=a.charCodeAt(h++);c.Ex=a.substring(h,h+u);c.ExStr=e.GetAuditLogExtendedDataStr(100*c.AuditAppID+c.EventID,c.Ex);k.push(c)}if(b.Body.TotalRecordCount>k.length)e.AMT_AuditLog_ReadRecords(k.length+1,v,[g[0],k]);
63
-else g[0](e,k,l)}}var e={};e.wsman=a;e.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/"];e.PendingEnums=[];e.PendingBatchOperations=0;e.ActiveEnumsCount=0;e.MaxActiveEnumsCount=1;e.onProcessChanged=null;var u=0,B=0;e.GetPendingActions=function(){return 2*e.PendingEnums.length+e.ActiveEnumsCount+e.wsman.comm.PendingAjax.length+e.wsman.comm.ActiveAjaxCount+e.PendingBatchOperations};e.Subscribe=function(a,
64
-c,l,h,g,d,z,n,k,v){e.wsman.ExecSubscribe(e.CompleteName(a),c,l,function(c,l,y,d){b();h(e,a,y,d,g)},0,d,z,n,k,v);b()};e.UnSubscribe=function(a,c,l,h,g){e.wsman.ExecUnSubscribe(e.CompleteName(a),function(h,g,d,n){b();c(e,a,d,n,l)},0,h,g);b()};e.Get=function(a,c,l,h){e.wsman.ExecGet(e.CompleteName(a),function(h,g,d,n){b();c(e,a,d,n,l)},0,h);b()};e.Put=function(a,c,l,h,g,d){e.wsman.ExecPut(e.CompleteName(a),c,function(c,g,d,n){b();l(e,a,d,n,h)},0,g,d);b()};e.Create=function(a,c,l,h,g){e.wsman.ExecCreate(e.CompleteName(a),
65
-c,function(c,g,d,n){b();l(e,a,d,n,h)},0,g);b()};e.Delete=function(a,c,l,h,g){e.wsman.ExecDelete(e.CompleteName(a),c,function(c,g,d,n){b();l(e,a,d,n,h)},0,g);b()};e.Exec=function(a,c,l,h,g,d,z){e.wsman.ExecMethod(e.CompleteName(a),c,l,function(c,l,y,d){b();h(e,a,e.CompleteExecResponse(y),d,g)},0,d,z);b()};e.ExecWithXml=function(a,c,l,h,g,d,z){e.wsman.ExecMethodXml(e.CompleteName(a),c,execArgumentsToXml(l),function(c,l,y,d){b();h(e,a,e.CompleteExecResponse(y),d,g)},0,d,z);b()};e.Enum=function(a,l,y,
66
-h){e.ActiveEnumsCount<e.MaxActiveEnumsCount?(e.ActiveEnumsCount++,e.wsman.ExecEnum(e.CompleteName(a),function(y,h,g,d,n){b();c(a,g,l,h,d,n)},y,h)):e.PendingEnums.push([a,l,y,h]);b()};e.BatchEnum=function(a,c,l,h,g,d){e.PendingBatchOperations+=2*c.length;m(a,Clone(c),l,h,{},g,d);b()};e.BatchGet=function(a,c,l,h,g){p({name:a,names:c,callback:l,current:0,responses:{},tag:h,pri:g});b()};e.CompleteName=function(a){if(0==a.indexOf("AMT_"))return e.pfx[0]+a;if(0==a.indexOf("CIM_"))return e.pfx[1]+a;if(0==
61
+if(170==b[0]&&32==b[1]&&4==b[2]&&0==b[3])return"Certificate revoked. "}return 6==a?"Authentication failed "+(b[1]+(b[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,c,b,m,h){if(200!=m)h[0](e,[],m);else{var k,d,l=h[1],B=new Date,v;if(0<b.Body.RecordsReturned)for(d in b.Body.EventRecords=
62
+MakeToArray(b.Body.EventRecords),b.Body.EventRecords){a=null;try{a=window.atob(b.Body.EventRecords[d])}catch(E){console.log(E+" "+b.Body.EventRecords[d])}c={AuditAppID:ReadShort(a,0),EventID:ReadShort(a,2),InitiatorType:a.charCodeAt(4)};c.AuditApp=p[c.AuditAppID];c.Event=p[100*c.AuditAppID+c.EventID];c.Event||(c.Event="#"+c.EventID);0==c.InitiatorType&&(k=a.charCodeAt(5),c.Initiator=a.substring(6,6+k),k=6+k);1==c.InitiatorType&&(c.KerberosUserInDomain=ReadInt(a,5),k=a.charCodeAt(9),c.Initiator=GetSidString(a.substring(10,
63
+10+k)),k=10+k);2==c.InitiatorType&&(c.Initiator="<i>Local</i>",k=5);3==c.InitiatorType&&(c.Initiator="<i>KVM Default Port</i>",k=5);v=ReadInt(a,k);c.Time=new Date(1E3*(v+60*B.getTimezoneOffset()));k+=4;c.MCLocationType=a.charCodeAt(k++);v=a.charCodeAt(k++);c.NetAddress=a.substring(k,k+v);k+=v;v=a.charCodeAt(k++);c.Ex=a.substring(k,k+v);c.ExStr=e.GetAuditLogExtendedDataStr(100*c.AuditAppID+c.EventID,c.Ex);l.push(c)}if(b.Body.TotalRecordCount>l.length)e.AMT_AuditLog_ReadRecords(l.length+1,w,[h[0],l]);
64
+else h[0](e,l,m)}}var e={};e.wsman=a;e.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/"];e.PendingEnums=[];e.PendingBatchOperations=0;e.ActiveEnumsCount=0;e.MaxActiveEnumsCount=1;e.onProcessChanged=null;var v=0,E=0;e.GetPendingActions=function(){return 2*e.PendingEnums.length+e.ActiveEnumsCount+e.wsman.comm.PendingAjax.length+e.wsman.comm.ActiveAjaxCount+e.PendingBatchOperations};e.Subscribe=function(a,
65
+c,m,h,k,d,x,p,l,w){e.wsman.ExecSubscribe(e.CompleteName(a),c,m,function(c,m,z,d){b();h(e,a,z,d,k)},0,d,x,p,l,w);b()};e.UnSubscribe=function(a,c,m,h,k){e.wsman.ExecUnSubscribe(e.CompleteName(a),function(h,k,d,p){b();c(e,a,d,p,m)},0,h,k);b()};e.Get=function(a,c,m,h){e.wsman.ExecGet(e.CompleteName(a),function(h,k,d,p){b();c(e,a,d,p,m)},0,h);b()};e.Put=function(a,c,m,h,k,d){e.wsman.ExecPut(e.CompleteName(a),c,function(c,k,d,p){b();m(e,a,d,p,h)},0,k,d);b()};e.Create=function(a,c,m,h,k){e.wsman.ExecCreate(e.CompleteName(a),
66
+c,function(c,k,d,p){b();m(e,a,d,p,h)},0,k);b()};e.Delete=function(a,c,m,h,k){e.wsman.ExecDelete(e.CompleteName(a),c,function(c,k,d,p){b();m(e,a,d,p,h)},0,k);b()};e.Exec=function(a,c,m,h,k,d,x){e.wsman.ExecMethod(e.CompleteName(a),c,m,function(c,m,z,d){b();h(e,a,e.CompleteExecResponse(z),d,k)},0,d,x);b()};e.ExecWithXml=function(a,c,m,h,k,d,x){e.wsman.ExecMethodXml(e.CompleteName(a),c,execArgumentsToXml(m),function(c,m,z,d){b();h(e,a,e.CompleteExecResponse(z),d,k)},0,d,x);b()};e.Enum=function(a,m,z,
67
+h){e.ActiveEnumsCount<e.MaxActiveEnumsCount?(e.ActiveEnumsCount++,e.wsman.ExecEnum(e.CompleteName(a),function(z,h,k,d,e){b();c(a,k,m,h,d,e)},z,h)):e.PendingEnums.push([a,m,z,h]);b()};e.BatchEnum=function(a,c,m,h,k,d){e.PendingBatchOperations+=2*c.length;n(a,Clone(c),m,h,{},k,d);b()};e.BatchGet=function(a,c,m,h,k){r({name:a,names:c,callback:m,current:0,responses:{},tag:h,pri:k});b()};e.CompleteName=function(a){if(0==a.indexOf("AMT_"))return e.pfx[0]+a;if(0==a.indexOf("CIM_"))return e.pfx[1]+a;if(0==
68
a.indexOf("IPS_"))return e.pfx[2]+a};e.CompleteExecResponse=function(a){a&&null!=a&&a.Body&&void 0!=a.Body.ReturnValue&&(a.Body.ReturnValueStr=e.AmtStatusToStr(a.Body.ReturnValue));return a};e.RequestPowerStateChange=function(a,c){e.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>',
69
null,null,c)};e.SetBootConfigRole=function(a,c){e.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>',
69
-a,c)};e.CancelAllQueries=function(a){e.wsman.CancelAllQueries(a)};e.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){e.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};e.AMT_AgentPresenceWatchdog_AssertPresence=function(a,c){e.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,c){e.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdog_AddAction=function(a,c,b,l,h,g,
70
-d,n,k){e.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:c,EventOnTransition:b,ActionSd:l,ActionEac:h},g,d,n,k)};e.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,c,b,l){e.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,c,b,l)};e.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){e.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};e.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){e.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};e.AMT_AgentPresenceWatchdogVA_AssertPresence=
71
-function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdogVA_AddAction=function(a,c,b,l,h,g){e.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:c,EventOnTransition:b,ActionSd:l,ActionEac:h},g)};e.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA",
72
-"DeleteAllActions",{_method_dummy:a},c)};e.AMT_AuditLog_ClearLog=function(a){e.Exec("AMT_AuditLog","ClearLog",{},a)};e.AMT_AuditLog_RequestStateChange=function(a,c,b){e.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_AuditLog_ReadRecords=function(a,c,b){e.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},c,b)};e.AMT_AuditLog_SetAuditLock=function(a,c,b,l){e.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:c,Handle:b},l)};e.AMT_AuditLog_ExportAuditLogSignature=
73
-function(a,c){e.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},c)};e.AMT_AuditLog_SetSigningKeyMaterial=function(a,c,b,l,h){e.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:c,LengthOfCertificates:b,Certificates:l},h)};e.AMT_AuditPolicyRule_SetAuditPolicy=function(a,c,b,l,h){e.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:c,EventID:b,PolicyType:l},h)};e.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,c,b,l,h){e.Exec("AMT_AuditPolicyRule",
74
-"SetAuditPolicyBulk",{Enable:a,AuditedAppID:c,EventID:b,PolicyType:l},h)};e.AMT_AuthorizationService_AddUserAclEntryEx=function(a,c,b,l,h,g){e.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:c,KerberosUserSid:b,AccessPermission:l,Realms:h},g)};e.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,c){e.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},c)};e.AMT_AuthorizationService_GetUserAclEntryEx=function(a,c,b){e.Exec("AMT_AuthorizationService",
75
-"GetUserAclEntryEx",{Handle:a},c,b)};e.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,c,b,l,h,g,d){e.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:c,DigestPassword:b,KerberosUserSid:l,AccessPermission:h,Realms:g},d)};e.AMT_AuthorizationService_RemoveUserAclEntry=function(a,c){e.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},c)};e.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,c,b){e.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",
76
-{Username:a,DigestPassword:c},b)};e.AMT_AuthorizationService_GetAdminAclEntry=function(a){e.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};e.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){e.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};e.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){e.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};e.AMT_AuthorizationService_SetAclEnabledState=function(a,c,b,l){e.Exec("AMT_AuthorizationService",
77
-"SetAclEnabledState",{Handle:a,Enabled:c},b,l)};e.AMT_AuthorizationService_GetAclEnabledState=function(a,c,b){e.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},c,b)};e.AMT_EndpointAccessControlService_RequestStateChange=function(a,c,b){e.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_EndpointAccessControlService_GetPosture=function(a,c){e.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},c)};e.AMT_EndpointAccessControlService_GetPostureHash=
70
+a,c)};e.CancelAllQueries=function(a){e.wsman.CancelAllQueries(a)};e.AMT_AgentPresenceWatchdog_RegisterAgent=function(a){e.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},a)};e.AMT_AgentPresenceWatchdog_AssertPresence=function(a,c){e.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdog_AssertShutdown=function(a,c){e.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdog_AddAction=function(a,c,b,m,h,k,
71
+d,p,l){e.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:a,NewState:c,EventOnTransition:b,ActionSd:m,ActionEac:h},k,d,p,l)};e.AMT_AgentPresenceWatchdog_DeleteAllActions=function(a,c,b,m){e.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},a,c,b,m)};e.AMT_AgentPresenceWatchdogAction_GetActionEac=function(a){e.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},a)};e.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(a){e.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},a)};e.AMT_AgentPresenceWatchdogVA_AssertPresence=
72
+function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:a},c)};e.AMT_AgentPresenceWatchdogVA_AddAction=function(a,c,b,m,h,k){e.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:a,NewState:c,EventOnTransition:b,ActionSd:m,ActionEac:h},k)};e.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(a,c){e.Exec("AMT_AgentPresenceWatchdogVA",
73
+"DeleteAllActions",{_method_dummy:a},c)};e.AMT_AuditLog_ClearLog=function(a){e.Exec("AMT_AuditLog","ClearLog",{},a)};e.AMT_AuditLog_RequestStateChange=function(a,c,b){e.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_AuditLog_ReadRecords=function(a,c,b){e.Exec("AMT_AuditLog","ReadRecords",{StartIndex:a},c,b)};e.AMT_AuditLog_SetAuditLock=function(a,c,b,m){e.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:a,Flag:c,Handle:b},m)};e.AMT_AuditLog_ExportAuditLogSignature=
74
+function(a,c){e.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:a},c)};e.AMT_AuditLog_SetSigningKeyMaterial=function(a,c,b,m,h){e.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:a,SigningKey:c,LengthOfCertificates:b,Certificates:m},h)};e.AMT_AuditPolicyRule_SetAuditPolicy=function(a,c,b,m,h){e.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:a,AuditedAppID:c,EventID:b,PolicyType:m},h)};e.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(a,c,b,m,h){e.Exec("AMT_AuditPolicyRule",
75
+"SetAuditPolicyBulk",{Enable:a,AuditedAppID:c,EventID:b,PolicyType:m},h)};e.AMT_AuthorizationService_AddUserAclEntryEx=function(a,c,b,m,h,k){e.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:a,DigestPassword:c,KerberosUserSid:b,AccessPermission:m,Realms:h},k)};e.AMT_AuthorizationService_EnumerateUserAclEntries=function(a,c){e.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:a},c)};e.AMT_AuthorizationService_GetUserAclEntryEx=function(a,c,b){e.Exec("AMT_AuthorizationService",
76
+"GetUserAclEntryEx",{Handle:a},c,b)};e.AMT_AuthorizationService_UpdateUserAclEntryEx=function(a,c,b,m,h,k,d){e.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:a,DigestUsername:c,DigestPassword:b,KerberosUserSid:m,AccessPermission:h,Realms:k},d)};e.AMT_AuthorizationService_RemoveUserAclEntry=function(a,c){e.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:a},c)};e.AMT_AuthorizationService_SetAdminAclEntryEx=function(a,c,b){e.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",
77
+{Username:a,DigestPassword:c},b)};e.AMT_AuthorizationService_GetAdminAclEntry=function(a){e.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},a)};e.AMT_AuthorizationService_GetAdminAclEntryStatus=function(a){e.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},a)};e.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(a){e.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},a)};e.AMT_AuthorizationService_SetAclEnabledState=function(a,c,b,m){e.Exec("AMT_AuthorizationService",
78
+"SetAclEnabledState",{Handle:a,Enabled:c},b,m)};e.AMT_AuthorizationService_GetAclEnabledState=function(a,c,b){e.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:a},c,b)};e.AMT_EndpointAccessControlService_RequestStateChange=function(a,c,b){e.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_EndpointAccessControlService_GetPosture=function(a,c){e.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:a},c)};e.AMT_EndpointAccessControlService_GetPostureHash=
79
function(a,c){e.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:a},c)};e.AMT_EndpointAccessControlService_UpdatePostureState=function(a,c){e.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:a},c)};e.AMT_EndpointAccessControlService_GetEacOptions=function(a){e.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},a)};e.AMT_EndpointAccessControlService_SetEacOptions=function(a,c,b){e.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:a,
80
PostureHashAlgorithm:c},b)};e.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(a,c){e.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:a},c)};e.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(a,c){e.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:a},c)};e.AMT_EthernetPortSettings_SetLinkPreference=function(a,c,b){e.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:a,Timeout:c},b)};e.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=
81
function(a,c){e.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:a},c)};e.AMT_KerberosSettingData_GetCredentialCacheState=function(a){e.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},a)};e.AMT_KerberosSettingData_SetCredentialCacheState=function(a,c){e.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:a},c)};e.AMT_MessageLog_CancelIteration=function(a,c){e.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:a},c)};e.AMT_MessageLog_RequestStateChange=
81
-function(a,c,b){e.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_MessageLog_ClearLog=function(a){e.Exec("AMT_MessageLog","ClearLog",{},a)};e.AMT_MessageLog_GetRecords=function(a,c,b,l){e.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:c},b,l)};e.AMT_MessageLog_GetRecord=function(a,c,b){e.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:c},b)};e.AMT_MessageLog_PositionAtRecord=function(a,c,b,l){e.Exec("AMT_MessageLog",
82
-"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:c,RecordNumber:b},l)};e.AMT_MessageLog_PositionToFirstRecord=function(a,c){e.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,c)};e.AMT_MessageLog_FreezeLog=function(a,c){e.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},c)};e.AMT_PublicKeyManagementService_AddCRL=function(a,c,b){e.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:c},b)};e.AMT_PublicKeyManagementService_ResetCRLList=function(a,c){e.Exec("AMT_PublicKeyManagementService",
82
+function(a,c,b){e.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_MessageLog_ClearLog=function(a){e.Exec("AMT_MessageLog","ClearLog",{},a)};e.AMT_MessageLog_GetRecords=function(a,c,b,m){e.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:a,MaxReadRecords:c},b,m)};e.AMT_MessageLog_GetRecord=function(a,c,b){e.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:a,PositionToNext:c},b)};e.AMT_MessageLog_PositionAtRecord=function(a,c,b,m){e.Exec("AMT_MessageLog",
83
+"PositionAtRecord",{IterationIdentifier:a,MoveAbsolute:c,RecordNumber:b},m)};e.AMT_MessageLog_PositionToFirstRecord=function(a,c){e.Exec("AMT_MessageLog","PositionToFirstRecord",{},a,c)};e.AMT_MessageLog_FreezeLog=function(a,c){e.Exec("AMT_MessageLog","FreezeLog",{Freeze:a},c)};e.AMT_PublicKeyManagementService_AddCRL=function(a,c,b){e.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:a,SerialNumbers:c},b)};e.AMT_PublicKeyManagementService_ResetCRLList=function(a,c){e.Exec("AMT_PublicKeyManagementService",
84
"ResetCRLList",{_method_dummy:a},c)};e.AMT_PublicKeyManagementService_AddCertificate=function(a,c){e.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:a},c)};e.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(a,c){e.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:a},c)};e.AMT_PublicKeyManagementService_AddKey=function(a,c){e.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:a},c)};e.AMT_PublicKeyManagementService_GeneratePKCS10Request=
84
-function(a,c,b,l){e.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:c,Usage:b},l)};e.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,c,b,l){e.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:c,NullSignedCertificateRequest:b},l)};e.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,c,b){e.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:c},b)};e.AMT_RedirectionService_RequestStateChange=
85
-function(a,c){e.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},c)};e.AMT_RedirectionService_TerminateSession=function(a,c){e.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},c)};e.AMT_RemoteAccessService_AddMpServer=function(a,c,b,l,h,g,d,n,k){e.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:c,Port:b,AuthMethod:l,Certificate:h,Username:g,Password:d,CN:n},k)};e.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,c,b,l,h,g){e.Exec("AMT_RemoteAccessService",
86
-"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:c,ExtendedData:b,MpServer:l,InternalMpServer:h},g)};e.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,c){e.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_CommitChanges=function(a,c){e.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_Unprovision=function(a,c){e.Exec("AMT_SetupAndConfigurationService",
85
+function(a,c,b,m){e.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:a,DNName:c,Usage:b},m)};e.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(a,c,b,m){e.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:a,SigningAlgorithm:c,NullSignedCertificateRequest:b},m)};e.AMT_PublicKeyManagementService_GenerateKeyPair=function(a,c,b){e.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:a,KeyLength:c},b)};e.AMT_RedirectionService_RequestStateChange=
86
+function(a,c){e.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:a},c)};e.AMT_RedirectionService_TerminateSession=function(a,c){e.Exec("AMT_RedirectionService","TerminateSession",{SessionType:a},c)};e.AMT_RemoteAccessService_AddMpServer=function(a,c,b,m,h,k,d,p,l){e.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:a,InfoFormat:c,Port:b,AuthMethod:m,Certificate:h,Username:k,Password:d,CN:p},l)};e.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(a,c,b,m,h,k){e.Exec("AMT_RemoteAccessService",
87
+"AddRemoteAccessPolicyRule",{Trigger:a,TunnelLifeTime:c,ExtendedData:b,MpServer:m,InternalMpServer:h},k)};e.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(a,c){e.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_CommitChanges=function(a,c){e.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_Unprovision=function(a,c){e.Exec("AMT_SetupAndConfigurationService",
88
"Unprovision",{ProvisioningMode:a},c)};e.AMT_SetupAndConfigurationService_PartialUnprovision=function(a,c){e.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(a,c){e.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:a},c)};e.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(a,c){e.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",
89
{Duration:a},c)};e.AMT_SetupAndConfigurationService_SetMEBxPassword=function(a,c){e.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:a},c)};e.AMT_SetupAndConfigurationService_SetTLSPSK=function(a,c,b){e.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:a,PPS:c},b)};e.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(a){e.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},a)};e.AMT_SetupAndConfigurationService_GetUuid=function(a){e.Exec("AMT_SetupAndConfigurationService",
90
"GetUuid",{},a)};e.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(a){e.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},a)};e.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(a){e.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},a)};e.AMT_SystemDefensePolicy_GetTimeout=function(a){e.Exec("AMT_SystemDefensePolicy","GetTimeout",{},a)};e.AMT_SystemDefensePolicy_SetTimeout=function(a,c){e.Exec("AMT_SystemDefensePolicy",
90
-"SetTimeout",{Timeout:a},c)};e.AMT_SystemDefensePolicy_UpdateStatistics=function(a,c,b,l,h,g){e.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:c},b,l,h,g)};e.AMT_SystemPowerScheme_SetPowerScheme=function(a,c,b){e.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,b,0,{InstanceID:c})};e.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,c){e.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,c)};e.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=
91
-function(a,c,b,l,h){e.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:c,Tm2:b},l,h)};e.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,c,b){e.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_WebUIService_RequestStateChange=function(a,c,b){e.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,c,b,l,h,g){e.ExecWithXml("AMT_WiFiPortConfigurationService",
92
-"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:c,IEEE8021xSettingsInput:b,ClientCredential:l,CACredential:h},g)};e.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,c,b,l,h,g){e.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:c,IEEE8021xSettingsInput:b,ClientCredential:l,CACredential:h},g)};e.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,c){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",
91
+"SetTimeout",{Timeout:a},c)};e.AMT_SystemDefensePolicy_UpdateStatistics=function(a,c,b,m,h,k){e.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:a,ResetOnRead:c},b,m,h,k)};e.AMT_SystemPowerScheme_SetPowerScheme=function(a,c,b){e.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},a,b,0,{InstanceID:c})};e.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(a,c){e.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},a,c)};e.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=
92
+function(a,c,b,m,h){e.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:a,Tm1:c,Tm2:b},m,h)};e.AMT_UserInitiatedConnectionService_RequestStateChange=function(a,c,b){e.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_WebUIService_RequestStateChange=function(a,c,b){e.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(a,c,b,m,h,k){e.ExecWithXml("AMT_WiFiPortConfigurationService",
93
+"AddWiFiSettings",{WiFiEndpoint:a,WiFiEndpointSettingsInput:c,IEEE8021xSettingsInput:b,ClientCredential:m,CACredential:h},k)};e.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(a,c,b,m,h,k){e.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:a,WiFiEndpointSettingsInput:c,IEEE8021xSettingsInput:b,ClientCredential:m,CACredential:h},k)};e.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(a,c){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",
94
{_method_dummy:a},c)};e.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(a,c){e.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:a},c)};e.CIM_Account_RequestStateChange=function(a,c,b){e.Exec("CIM_Account","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_AccountManagementService_CreateAccount=function(a,c,b){e.Exec("CIM_AccountManagementService","CreateAccount",{System:a,AccountTemplate:c},b)};e.CIM_BootConfigSetting_ChangeBootOrder=function(a,
95
c){e.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:a},c)};e.CIM_BootService_SetBootConfigRole=function(a,c,b){e.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:a,Role:c},b,0,1)};e.CIM_Card_ConnectorPower=function(a,c,b){e.Exec("CIM_Card","ConnectorPower",{Connector:a,PoweredOn:c},b)};e.CIM_Card_IsCompatible=function(a,c){e.Exec("CIM_Card","IsCompatible",{ElementToCheck:a},c)};e.CIM_Chassis_IsCompatible=function(a,c){e.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:a},c)};
96
e.CIM_Fan_SetSpeed=function(a,c){e.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:a},c)};e.CIM_KVMRedirectionSAP_RequestStateChange=function(a,c,b){e.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:a},b)};e.CIM_MediaAccessDevice_LockMedia=function(a,c){e.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:a},c)};e.CIM_MediaAccessDevice_SetPowerState=function(a,c,b){e.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_MediaAccessDevice_Reset=function(a){e.Exec("CIM_MediaAccessDevice",
97
"Reset",{},a)};e.CIM_MediaAccessDevice_EnableDevice=function(a,c){e.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:a},c)};e.CIM_MediaAccessDevice_OnlineDevice=function(a,c){e.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:a},c)};e.CIM_MediaAccessDevice_QuiesceDevice=function(a,c){e.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:a},c)};e.CIM_MediaAccessDevice_SaveProperties=function(a){e.Exec("CIM_MediaAccessDevice","SaveProperties",{},a)};e.CIM_MediaAccessDevice_RestoreProperties=
98
function(a){e.Exec("CIM_MediaAccessDevice","RestoreProperties",{},a)};e.CIM_MediaAccessDevice_RequestStateChange=function(a,c,b){e.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_PhysicalFrame_IsCompatible=function(a,c){e.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:a},c)};e.CIM_PhysicalPackage_IsCompatible=function(a,c){e.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:a},c)};e.CIM_PowerManagementService_RequestPowerStateChange=
98
-function(a,c,b,l,h){e.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:c,Time:b,TimeoutPeriod:l},h,0,1)};e.CIM_PowerSupply_SetPowerState=function(a,c,b){e.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_PowerSupply_Reset=function(a){e.Exec("CIM_PowerSupply","Reset",{},a)};e.CIM_PowerSupply_EnableDevice=function(a,c){e.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},c)};e.CIM_PowerSupply_OnlineDevice=function(a,c){e.Exec("CIM_PowerSupply",
99
+function(a,c,b,m,h){e.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:a,ManagedElement:c,Time:b,TimeoutPeriod:m},h,0,1)};e.CIM_PowerSupply_SetPowerState=function(a,c,b){e.Exec("CIM_PowerSupply","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_PowerSupply_Reset=function(a){e.Exec("CIM_PowerSupply","Reset",{},a)};e.CIM_PowerSupply_EnableDevice=function(a,c){e.Exec("CIM_PowerSupply","EnableDevice",{Enabled:a},c)};e.CIM_PowerSupply_OnlineDevice=function(a,c){e.Exec("CIM_PowerSupply",
100
"OnlineDevice",{Online:a},c)};e.CIM_PowerSupply_QuiesceDevice=function(a,c){e.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:a},c)};e.CIM_PowerSupply_SaveProperties=function(a){e.Exec("CIM_PowerSupply","SaveProperties",{},a)};e.CIM_PowerSupply_RestoreProperties=function(a){e.Exec("CIM_PowerSupply","RestoreProperties",{},a)};e.CIM_PowerSupply_RequestStateChange=function(a,c,b){e.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_Processor_SetPowerState=function(a,
101
c,b){e.Exec("CIM_Processor","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_Processor_Reset=function(a){e.Exec("CIM_Processor","Reset",{},a)};e.CIM_Processor_EnableDevice=function(a,c){e.Exec("CIM_Processor","EnableDevice",{Enabled:a},c)};e.CIM_Processor_OnlineDevice=function(a,c){e.Exec("CIM_Processor","OnlineDevice",{Online:a},c)};e.CIM_Processor_QuiesceDevice=function(a,c){e.Exec("CIM_Processor","QuiesceDevice",{Quiesce:a},c)};e.CIM_Processor_SaveProperties=function(a){e.Exec("CIM_Processor","SaveProperties",
102
{},a)};e.CIM_Processor_RestoreProperties=function(a){e.Exec("CIM_Processor","RestoreProperties",{},a)};e.CIM_Processor_RequestStateChange=function(a,c,b){e.Exec("CIM_Processor","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_RecordLog_ClearLog=function(a){e.Exec("CIM_RecordLog","ClearLog",{},a)};e.CIM_RecordLog_RequestStateChange=function(a,c,b){e.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_RedirectionService_RequestStateChange=function(a,
@@ -104,20 +105,20 @@ c,b){e.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:a,Time
105
"KeepAlive",{},a)};e.CIM_Watchdog_SetPowerState=function(a,c,b){e.Exec("CIM_Watchdog","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_Watchdog_Reset=function(a){e.Exec("CIM_Watchdog","Reset",{},a)};e.CIM_Watchdog_EnableDevice=function(a,c){e.Exec("CIM_Watchdog","EnableDevice",{Enabled:a},c)};e.CIM_Watchdog_OnlineDevice=function(a,c){e.Exec("CIM_Watchdog","OnlineDevice",{Online:a},c)};e.CIM_Watchdog_QuiesceDevice=function(a,c){e.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:a},c)};e.CIM_Watchdog_SaveProperties=
106
function(a){e.Exec("CIM_Watchdog","SaveProperties",{},a)};e.CIM_Watchdog_RestoreProperties=function(a){e.Exec("CIM_Watchdog","RestoreProperties",{},a)};e.CIM_Watchdog_RequestStateChange=function(a,c,b){e.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.CIM_WiFiPort_SetPowerState=function(a,c,b){e.Exec("CIM_WiFiPort","SetPowerState",{PowerState:a,Time:c},b)};e.CIM_WiFiPort_Reset=function(a){e.Exec("CIM_WiFiPort","Reset",{},a)};e.CIM_WiFiPort_EnableDevice=function(a,
107
c){e.Exec("CIM_WiFiPort","EnableDevice",{Enabled:a},c)};e.CIM_WiFiPort_OnlineDevice=function(a,c){e.Exec("CIM_WiFiPort","OnlineDevice",{Online:a},c)};e.CIM_WiFiPort_QuiesceDevice=function(a,c){e.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:a},c)};e.CIM_WiFiPort_SaveProperties=function(a){e.Exec("CIM_WiFiPort","SaveProperties",{},a)};e.CIM_WiFiPort_RestoreProperties=function(a){e.Exec("CIM_WiFiPort","RestoreProperties",{},a)};e.CIM_WiFiPort_RequestStateChange=function(a,c,b){e.Exec("CIM_WiFiPort",
107
-"RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.IPS_HostBasedSetupService_Setup=function(a,c,b,l,h,g,d){e.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:c,McNonce:b,Certificate:l,SigningAlgorithm:h,DigitalSignature:g},d)};e.IPS_HostBasedSetupService_AddNextCertInChain=function(a,c,b,l){e.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:c,IsRootCertificate:b},l)};e.IPS_HostBasedSetupService_AdminSetup=
108
-function(a,c,b,l,h,g){e.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:c,McNonce:b,SigningAlgorithm:l,DigitalSignature:h},g)};e.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,c,b,l){e.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:c,DigitalSignature:b},l)};e.IPS_HostBasedSetupService_DisableClientControlMode=function(a,c){e.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},
108
+"RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.IPS_HostBasedSetupService_Setup=function(a,c,b,m,h,k,d){e.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:c,McNonce:b,Certificate:m,SigningAlgorithm:h,DigitalSignature:k},d)};e.IPS_HostBasedSetupService_AddNextCertInChain=function(a,c,b,m){e.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:a,IsLeafCertificate:c,IsRootCertificate:b},m)};e.IPS_HostBasedSetupService_AdminSetup=
109
+function(a,c,b,m,h,k){e.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:a,NetworkAdminPassword:c,McNonce:b,SigningAlgorithm:m,DigitalSignature:h},k)};e.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(a,c,b,m){e.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:a,SigningAlgorithm:c,DigitalSignature:b},m)};e.IPS_HostBasedSetupService_DisableClientControlMode=function(a,c){e.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:a},
110
c)};e.IPS_KVMRedirectionSettingData_TerminateSession=function(a){e.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelRead=function(a){e.Exec("IPS_KVMRedirectionSettingData","DataChannelRead",{},a)};e.IPS_KVMRedirectionSettingData_DataChannelWrite=function(a,c){e.Exec("IPS_KVMRedirectionSettingData","DataChannelWrite",{DataMessage:a},c)};e.IPS_OptInService_StartOptIn=function(a){e.Exec("IPS_OptInService","StartOptIn",{},a)};e.IPS_OptInService_CancelOptIn=
111
function(a){e.Exec("IPS_OptInService","CancelOptIn",{},a)};e.IPS_OptInService_SendOptInCode=function(a,c){e.Exec("IPS_OptInService","SendOptInCode",{OptInCode:a},c)};e.IPS_OptInService_StartService=function(a){e.Exec("IPS_OptInService","StartService",{},a)};e.IPS_OptInService_StopService=function(a){e.Exec("IPS_OptInService","StopService",{},a)};e.IPS_OptInService_RequestStateChange=function(a,c,b){e.Exec("IPS_OptInService","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.IPS_ProvisioningRecordLog_RequestStateChange=
112
function(a,c,b){e.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:a,TimeoutPeriod:c},b)};e.IPS_ProvisioningRecordLog_ClearLog=function(a,c){e.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:a},c)};e.IPS_ScreenConfigurationService_SetSessionState=function(a,c,b){e.Exec("IPS_ScreenConfigurationService","SetSessionState",{SessionState:a,ConsecutiveRebootsNum:c},b)};e.IPS_SecIOService_RequestStateChange=function(a,c,b){e.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:a,
112
-TimeoutPeriod:c},b)};e.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,c,b,l,h){e.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:c,Port:b,NetworkDnsSuffix:l},h)};e.AmtStatusToStr=function(a){return e.AmtStatusCodes[a]?e.AmtStatusCodes[a]:"UNKNOWN_ERROR"};e.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",
113
+TimeoutPeriod:c},b)};e.IPS_HTTPProxyService_AddProxyAccessPoint=function(a,c,b,m,h){e.Exec("IPS_HTTPProxyService","AddProxyAccessPoint",{AccessInfo:a,InfoFormat:c,Port:b,NetworkDnsSuffix:m},h)};e.AmtStatusToStr=function(a){return e.AmtStatusCodes[a]?e.AmtStatusCodes[a]:"UNKNOWN_ERROR"};e.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",
114
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",
115
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",
116
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",
116
-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"};e.GetMessageLog=function(a,c){e.AMT_MessageLog_PositionToFirstRecord(r,
117
-[a,c,[]])};var h="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(";"),
118
-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(";"),
119
-E="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(";");
120
-e.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(";");e.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var n={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",
117
+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"};e.GetMessageLog=function(a,c){e.AMT_MessageLog_PositionToFirstRecord(u,
118
+[a,c,[]])};var k="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(";"),
119
+h="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(";"),
120
+C="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(";");
121
+e.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(";");e.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};var p={16:"Security Admin",17:"RCO",18:"Redirection Manager",19:"Firmware Update Manager",
122
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",
123
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",
124
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",
@@ -125,21 +126,21 @@ e.RealmNames=";;Redirection;;Hardware Asset;Remote Control;Storage;Event Manager
126
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",
127
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"};e.GetAuditLogExtendedDataStr=function(a,c){if((1602==a||1604==a)&&0==c.charCodeAt(0))return c.substring(2,2+c.charCodeAt(1));if(1603==a)return 0==c.charCodeAt(1)?c.substring(3):null;if(1605==a)return["Invalid ME access","Invalid MEBx access"][c.charCodeAt(0)];if(1606==a){var b=["Disabled","Enabled"][c.charCodeAt(0)];
128
0==c.charCodeAt(1)&&(b+=", "+c.substring(3));return b}return 1607==a?"Remote "+["NoAuth","ServerAuth","MutualAuth"][c.charCodeAt(0)]+", Local "+["NoAuth","ServerAuth","MutualAuth"][c.charCodeAt(1)]:1617==a?e.RealmNames[ReadInt(c,0)]+", "+["NoAuth","Auth","Disabled"][c.charCodeAt(4)]:1619==a?["BIOS","MEBx","Local MEI","Local WSMAN","Remote WSAMN"][c.charCodeAt(0)]:1900==a?"From "+ReadShort(c,0)+"."+ReadShort(c,2)+"."+ReadShort(c,4)+"."+ReadShort(c,6)+" to "+ReadShort(c,8)+"."+ReadShort(c,10)+"."+ReadShort(c,
128
-12)+"."+ReadShort(c,14):2100==a?(b=new Date,b.setTime(1E3*ReadInt(c,0)+6E4*(new Date).getTimezoneOffset()),b.toLocaleString()):3E3==a?"From "+["None","KVM","All"][c.charCodeAt(0)]+" to "+["None","KVM","All"][c.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][c.charCodeAt(0)]:null};e.GetAuditLog=function(a){e.AMT_AuditLog_ReadRecords(1,v,[a,[]])};return e}function hex_md5(a){return forge.md.md5.create().update(a).digest().toHex()}function rstr_md5(a){return hex2rstr(hex_md5(a))}
129
+12)+"."+ReadShort(c,14):2100==a?(b=new Date,b.setTime(1E3*ReadInt(c,0)+6E4*(new Date).getTimezoneOffset()),b.toLocaleString()):3E3==a?"From "+["None","KVM","All"][c.charCodeAt(0)]+" to "+["None","KVM","All"][c.charCodeAt(1)]:3001==a?["Success","Failed 3 times"][c.charCodeAt(0)]:null};e.GetAuditLog=function(a){e.AMT_AuditLog_ReadRecords(1,w,[a,[]])};return e}function hex_md5(a){return forge.md.md5.create().update(a).digest().toHex()}function rstr_md5(a){return hex2rstr(hex_md5(a))}
130
function execArgumentsToXml(a){if(void 0===a||null===a)return null;var b="",c;for(c in a){var d=a[c];d&&(b="reference"===d.__parameterType?b+referenceToXml(c,d):b+instanceToXml(c,d))}return b}
130
-function instanceToXml(a,b){if(void 0===b||null===b)return null;var c=!!b.__namespace,d=c?"<q:":"<",f=c?"</q:":"</",c="<r:"+a+(c?' xmlns:q="'+b.__namespace+'"':"")+">",m;for(m in b)b.hasOwnProperty(m)&&0!==m.indexOf("__")&&("function"===typeof b[m]||Array.isArray(b[m])||("object"===typeof b[m]?console.error("only convert one level down..."):c+=d+m+">"+b[m].toString()+f+m+">"));return c+("</r:"+a+">")}
131
+function instanceToXml(a,b){if(void 0===b||null===b)return null;var c=!!b.__namespace,d=c?"<q:":"<",g=c?"</q:":"</",c="<r:"+a+(c?' xmlns:q="'+b.__namespace+'"':"")+">",n;for(n in b)b.hasOwnProperty(n)&&0!==n.indexOf("__")&&("function"===typeof b[n]||Array.isArray(b[n])||("object"===typeof b[n]?console.error("only convert one level down..."):c+=d+n+">"+b[n].toString()+g+n+">"));return c+("</r:"+a+">")}
132
function referenceToXml(a,b){if(void 0===b||null===b)return null;var c="<r:"+a+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+b.__resourceUri+"</w:ResourceURI><w:SelectorSet>",d;for(d in b)b.hasOwnProperty(d)&&0!==d.indexOf("__")&&("function"===typeof b[d]||"object"===typeof b[d]||Array.isArray(b[d])||(c+='<w:Selector Name="'+d+'">'+b[d].toString()+"</w:Selector>"));return c+("</w:SelectorSet></a:ReferenceParameters></r:"+a+">")}
133
function GetSidString(a){for(var b="S-"+a.charCodeAt(0)+"-"+a.charCodeAt(7),c=2;c<a.length/4;c++)b+="-"+ReadIntX(a,4*c);return b}
134
function GetSidByteArray(a){if(!a||null==a)return null;a=a.split("-");if(4>a.length||"s"!=a[0]&&"S"!=a[0])return null;for(var b=1;b<a.length;b++){var c=parseInt(a[b]);if(c!=a[b])return null;a[b]=c}c=String.fromCharCode(a[1])+String.fromCharCode(a.length-3)+ShortToStr(Math.floor(a[2]/Math.pow(2,32)))+IntToStr(a[2]&65535);for(b=3;b<a.length;b++)c+=IntToStrX(a[b]);return c}
134
-(function(a,b){"function"===typeof define&&define.amd?define([],b):a.forge=b()})(this,function(){var a,b,c;(function(d){function f(a,c){var b,l,h,g,d,y,e,k,v,u=c&&c.split("/"),B=n.map,E=B&&B["*"]||{};if(a&&"."===a.charAt(0))if(c){u=u.slice(0,u.length-1);a=a.split("/");d=a.length-1;n.nodeIdCompat&&D.test(a[d])&&(a[d]=a[d].replace(D,""));a=u.concat(a);for(d=0;d<a.length;d+=1)if(b=a[d],"."===b)a.splice(d,1),--d;else if(".."===b)if(1!==d||".."!==a[2]&&".."!==a[0])0<d&&(a.splice(d-1,2),d-=2);else break;
135
-a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((u||E)&&B){b=a.split("/");for(d=b.length;0<d;--d){l=b.slice(0,d).join("/");if(u)for(v=u.length;0<v;--v)if(h=B[u.slice(0,v).join("/")])if(h=h[l]){g=h;y=d;break}if(g)break;!e&&E&&E[l]&&(e=E[l],k=d)}!g&&e&&(g=e,y=k);g&&(b.splice(0,y,g),a=b.join("/"))}return a}function m(a,c){return function(){return u.apply(d,y.call(arguments,0).concat([a,c]))}}function p(a){return function(c){return f(c,a)}}function r(a){return function(c){g[a]=c}}function l(a){if(w.call(E,
136
-a)){var c=E[a];delete E[a];F[a]=!0;e.apply(d,c)}if(!w.call(g,a)&&!w.call(F,a))throw Error("No "+a);return g[a]}function k(a){var c,b=a?a.indexOf("!"):-1;-1<b&&(c=a.substring(0,b),a=a.substring(b+1,a.length));return[c,a]}function v(a){return function(){return n&&n.config&&n.config[a]||{}}}var e,u,B,h,g={},E={},n={},F={},w=Object.prototype.hasOwnProperty,y=[].slice,D=/\.js$/;B=function(a,c){var b,h=k(a),g=h[0];a=h[1];g&&(g=f(g,c),b=l(g));g?a=b&&b.normalize?b.normalize(a,p(c)):f(a,c):(a=f(a,c),h=k(a),
137
-g=h[0],a=h[1],g&&(b=l(g)));return{f:g?g+"!"+a:a,n:a,pr:g,p:b}};h={require:function(a){return m(a)},exports:function(a){var c=g[a];return"undefined"!==typeof c?c:g[a]={}},module:function(a){return{id:a,uri:"",exports:g[a],config:v(a)}}};e=function(a,c,b,y){var n,e,k,v,D=[];e=typeof b;var u;y=y||a;if("undefined"===e||"function"===e){c=!c.length&&b.length?["require","exports","module"]:c;for(v=0;v<c.length;v+=1)if(k=B(c[v],y),e=k.f,"require"===e)D[v]=h.require(a);else if("exports"===e)D[v]=h.exports(a),
138
-u=!0;else if("module"===e)n=D[v]=h.module(a);else if(w.call(g,e)||w.call(E,e)||w.call(F,e))D[v]=l(e);else if(k.p)k.p.load(k.n,m(y,!0),r(e),{}),D[v]=g[e];else throw Error(a+" missing "+e);c=b?b.apply(g[a],D):void 0;a&&(n&&n.exports!==d&&n.exports!==g[a]?g[a]=n.exports:c===d&&u||(g[a]=c))}else a&&(g[a]=b)};a=b=u=function(a,c,b,g,y){if("string"===typeof a)return h[a]?h[a](c):l(B(a,c).f);if(!a.splice){n=a;n.deps&&u(n.deps,n.callback);if(!c)return;c.splice?(a=c,c=b,b=null):a=d}c=c||function(){};"function"===
139
-typeof b&&(b=g,g=y);g?e(d,a,c,b):setTimeout(function(){e(d,a,c,b)},4);return u};u.config=function(a){return u(a)};a._defined=g;c=function(a,c,b){c.splice||(b=c,c=[]);w.call(g,a)||w.call(E,a)||(E[a]=[a,c,b])};c.amd={jQuery:!0}})();c("node_modules/almond/almond",function(){});(function(){function a(c){function b(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(c){for(var l=
140
-0;l<a.length;++l)this.putByte(a[l])}}else if(a instanceof b||"object"===typeof a&&"string"===typeof a.data&&"number"===typeof a.read)this.data=a.data,this.read=a.read;this._constructedStringLength=0}var d=c.util=c.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)};
141
-else{d.setImmediate=function(a){setTimeout(a,0)};if("undefined"!==typeof window&&"function"===typeof window.postMessage){var a=[];d.setImmediate=function(c){a.push(c);1===a.length&&window.postMessage("forge.setImmediate","*")};window.addEventListener("message",function(c){c.source===window&&"forge.setImmediate"===c.data&&(c.stopPropagation(),c=a.slice(),a.length=0,c.forEach(function(a){a()}))},!0)}if("undefined"!==typeof MutationObserver){var c=Date.now(),b=!0,l=document.createElement("div"),a=[];
142
-(new MutationObserver(function(){var c=a.slice();a.length=0;c.forEach(function(a){a()})})).observe(l,{attributes:!0});var h=d.setImmediate;d.setImmediate=function(d){15<Date.now()-c?(c=Date.now(),h(d)):(a.push(d),1===a.length&&l.setAttribute("a",b=!b))}}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&&
135
+(function(a,b){"function"===typeof define&&define.amd?define([],b):a.forge=b()})(this,function(){var a,b,c;(function(d){function g(a,c){var b,m,h,k,d,z,e,l,w,v=c&&c.split("/"),E=p.map,C=E&&E["*"]||{};if(a&&"."===a.charAt(0))if(c){v=v.slice(0,v.length-1);a=a.split("/");d=a.length-1;p.nodeIdCompat&&A.test(a[d])&&(a[d]=a[d].replace(A,""));a=v.concat(a);for(d=0;d<a.length;d+=1)if(b=a[d],"."===b)a.splice(d,1),--d;else if(".."===b)if(1!==d||".."!==a[2]&&".."!==a[0])0<d&&(a.splice(d-1,2),d-=2);else break;
136
+a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((v||C)&&E){b=a.split("/");for(d=b.length;0<d;--d){m=b.slice(0,d).join("/");if(v)for(w=v.length;0<w;--w)if(h=E[v.slice(0,w).join("/")])if(h=h[m]){k=h;z=d;break}if(k)break;!e&&C&&C[m]&&(e=C[m],l=d)}!k&&e&&(k=e,z=l);k&&(b.splice(0,z,k),a=b.join("/"))}return a}function n(a,c){return function(){return v.apply(d,z.call(arguments,0).concat([a,c]))}}function r(a){return function(c){return g(c,a)}}function u(a){return function(c){h[a]=c}}function m(a){if(y.call(C,
137
+a)){var c=C[a];delete C[a];F[a]=!0;e.apply(d,c)}if(!y.call(h,a)&&!y.call(F,a))throw Error("No "+a);return h[a]}function l(a){var c,b=a?a.indexOf("!"):-1;-1<b&&(c=a.substring(0,b),a=a.substring(b+1,a.length));return[c,a]}function w(a){return function(){return p&&p.config&&p.config[a]||{}}}var e,v,E,k,h={},C={},p={},F={},y=Object.prototype.hasOwnProperty,z=[].slice,A=/\.js$/;E=function(a,c){var b,h=l(a),k=h[0];a=h[1];k&&(k=g(k,c),b=m(k));k?a=b&&b.normalize?b.normalize(a,r(c)):g(a,c):(a=g(a,c),h=l(a),
138
+k=h[0],a=h[1],k&&(b=m(k)));return{f:k?k+"!"+a:a,n:a,pr:k,p:b}};k={require:function(a){return n(a)},exports:function(a){var c=h[a];return"undefined"!==typeof c?c:h[a]={}},module:function(a){return{id:a,uri:"",exports:h[a],config:w(a)}}};e=function(a,c,b,z){var e,p,l,w,A=[];p=typeof b;var v;z=z||a;if("undefined"===p||"function"===p){c=!c.length&&b.length?["require","exports","module"]:c;for(w=0;w<c.length;w+=1)if(l=E(c[w],z),p=l.f,"require"===p)A[w]=k.require(a);else if("exports"===p)A[w]=k.exports(a),
139
+v=!0;else if("module"===p)e=A[w]=k.module(a);else if(y.call(h,p)||y.call(C,p)||y.call(F,p))A[w]=m(p);else if(l.p)l.p.load(l.n,n(z,!0),u(p),{}),A[w]=h[p];else throw Error(a+" missing "+p);c=b?b.apply(h[a],A):void 0;a&&(e&&e.exports!==d&&e.exports!==h[a]?h[a]=e.exports:c===d&&v||(h[a]=c))}else a&&(h[a]=b)};a=b=v=function(a,c,b,h,z){if("string"===typeof a)return k[a]?k[a](c):m(E(a,c).f);if(!a.splice){p=a;p.deps&&v(p.deps,p.callback);if(!c)return;c.splice?(a=c,c=b,b=null):a=d}c=c||function(){};"function"===
140
+typeof b&&(b=h,h=z);h?e(d,a,c,b):setTimeout(function(){e(d,a,c,b)},4);return v};v.config=function(a){return v(a)};a._defined=h;c=function(a,c,b){c.splice||(b=c,c=[]);y.call(h,a)||y.call(C,a)||(C[a]=[a,c,b])};c.amd={jQuery:!0}})();c("node_modules/almond/almond",function(){});(function(){function a(c){function b(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(c){for(var m=
141
+0;m<a.length;++m)this.putByte(a[m])}}else if(a instanceof b||"object"===typeof a&&"string"===typeof a.data&&"number"===typeof a.read)this.data=a.data,this.read=a.read;this._constructedStringLength=0}var d=c.util=c.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)};
142
+else{d.setImmediate=function(a){setTimeout(a,0)};if("undefined"!==typeof window&&"function"===typeof window.postMessage){var a=[];d.setImmediate=function(c){a.push(c);1===a.length&&window.postMessage("forge.setImmediate","*")};window.addEventListener("message",function(c){c.source===window&&"forge.setImmediate"===c.data&&(c.stopPropagation(),c=a.slice(),a.length=0,c.forEach(function(a){a()}))},!0)}if("undefined"!==typeof MutationObserver){var c=Date.now(),b=!0,m=document.createElement("div"),a=[];
143
+(new MutationObserver(function(){var c=a.slice();a.length=0;c.forEach(function(a){a()})})).observe(m,{attributes:!0});var h=d.setImmediate;d.setImmediate=function(d){15<Date.now()-c?(c=Date.now(),h(d)):(a.push(d),1===a.length&&m.setAttribute("a",b=!b))}}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&&
144
d.isArrayBuffer(a.buffer)&&void 0!==a.byteLength};d.ByteBuffer=b;d.ByteStringBuffer=b;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))};
145
d.ByteStringBuffer.prototype.fillWithByte=function(a,c){a=String.fromCharCode(a);for(var b=this.data;0<c;)c&1&&(b+=a),c>>>=1,0<c&&(a+=a);this.data=b;this._optimizeConstructedString(c);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&
146
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>>
@@ -150,9 +151,9 @@ function(){var a=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+
151
function(a){var c=this.getInt(a);a=2<<a-2;c>=a&&(c-=a<<1);return c};d.ByteStringBuffer.prototype.getBytes=function(a){var c;a?(a=Math.min(this.length(),a),c=this.data.slice(this.read,this.read+a),this.read+=a):0===a?c="":(c=0===this.read?this.data:this.data.slice(this.read),this.clear());return c};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+
152
a)};d.ByteStringBuffer.prototype.setAt=function(a,c){this.data=this.data.substr(0,this.read+a)+String.fromCharCode(c)+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=
153
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="",c=this.read;c<this.data.length;++c){var b=this.data.charCodeAt(c);16>b&&(a+="0");a+=b.toString(16)}return a};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};d.DataBuffer=function(a,c){c=c||{};this.read=c.readOffset||
153
-0;this.growSize=c.growSize||1024;var b=d.isArrayBuffer(a),l=d.isArrayBufferView(a);b||l?(this.data=b?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in c?c.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in c&&(this.write=c.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()};
154
-d.DataBuffer.prototype.accommodate=function(a,c){if(this.length()>=a)return this;c=Math.max(c||this.growSize,a);var b=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),l=new Uint8Array(this.length()+c);l.set(b);this.data=new DataView(l.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,c){this.accommodate(c);for(var b=0;b<c;++b)this.data.setUint8(a);
155
-return this};d.DataBuffer.prototype.putBytes=function(a,c){if(d.isArrayBufferView(a)){var b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),l=b.byteLength-b.byteOffset;this.accommodate(l);var h=new Uint8Array(this.data.buffer,this.write);h.set(b);this.write+=l;return this}if(d.isArrayBuffer(a))return b=new Uint8Array(a),this.accommodate(b.byteLength),h=new Uint8Array(this.data.buffer),h.set(b,this.write),this.write+=b.byteLength,this;if(a instanceof d.DataBuffer||"object"===typeof a&&"number"===
154
+0;this.growSize=c.growSize||1024;var b=d.isArrayBuffer(a),m=d.isArrayBufferView(a);b||m?(this.data=b?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in c?c.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in c&&(this.write=c.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()};
155
+d.DataBuffer.prototype.accommodate=function(a,c){if(this.length()>=a)return this;c=Math.max(c||this.growSize,a);var b=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),m=new Uint8Array(this.length()+c);m.set(b);this.data=new DataView(m.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,c){this.accommodate(c);for(var b=0;b<c;++b)this.data.setUint8(a);
156
+return this};d.DataBuffer.prototype.putBytes=function(a,c){if(d.isArrayBufferView(a)){var b=new Uint8Array(a.buffer,a.byteOffset,a.byteLength),m=b.byteLength-b.byteOffset;this.accommodate(m);var h=new Uint8Array(this.data.buffer,this.write);h.set(b);this.write+=m;return this}if(d.isArrayBuffer(a))return b=new Uint8Array(a),this.accommodate(b.byteLength),h=new Uint8Array(this.data.buffer),h.set(b,this.write),this.write+=b.byteLength,this;if(a instanceof d.DataBuffer||"object"===typeof a&&"number"===
157
typeof a.read&&"number"===typeof a.write&&d.isArrayBufferView(a.data))return b=new Uint8Array(a.data.byteLength,a.read,a.length()),this.accommodate(b.byteLength),h=new Uint8Array(a.data.byteLength,this.write),h.set(b),this.write+=b.byteLength,this;a instanceof d.ByteStringBuffer&&(a=a.data,c="binary");c=c||"binary";if("string"===typeof a){if("hex"===c)return this.accommodate(Math.ceil(a.length/2)),b=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.hex.decode(a,b,this.write),this;if("base64"===
158
c)return this.accommodate(3*Math.ceil(a.length/4)),b=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.base64.decode(a,b,this.write),this;"utf8"===c&&(a=d.encodeUtf8(a),c="binary");if("binary"===c||"raw"===c)return this.accommodate(a.length),b=new Uint8Array(this.data.buffer,this.write),this.write+=d.binary.raw.decode(b),this;if("utf16"===c)return this.accommodate(2*a.length),b=new Uint16Array(this.data.buffer,this.write),this.write+=d.text.utf16.encode(b),this;throw Error("Invalid encoding: "+
159
c);}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};
@@ -163,69 +164,69 @@ this.data.getInt32(this.read,!0);this.read+=4;return a};d.DataBuffer.prototype.g
164
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,c){this.data.setUint8(a,c);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=
165
new Uint8Array(this.data.buffer,this.read),c=new Uint8Array(a.byteLength);c.set(a);this.data=new DataView(c);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="",c=this.read;c<this.data.byteLength;++c){var b=
166
this.data.getUint8(c);16>b&&(a+="0");a+=b.toString(16)}return a};d.DataBuffer.prototype.toString=function(a){var c=new Uint8Array(this.data,this.read,this.length());a=a||"utf8";if("binary"===a||"raw"===a)return d.binary.raw.encode(c);if("hex"===a)return d.binary.hex.encode(c);if("base64"===a)return d.binary.base64.encode(c);if("utf8"===a)return d.text.utf8.decode(c);if("utf16"===a)return d.text.utf16.decode(c);throw Error("Invalid encoding: "+a);};d.createBuffer=function(a,c){void 0!==a&&"utf8"===
166
-(c||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,c){for(var b="";0<c;)c&1&&(b+=a),c>>>=1,0<c&&(a+=a);return b};d.xorBytes=function(a,c,b){for(var l="",d="",h="",g=0,n=0;0<b;--b,++g)d=a.charCodeAt(g)^c.charCodeAt(g),10<=n&&(l+=h,h="",n=0),h+=String.fromCharCode(d),++n;return l+h};d.hexToBytes=function(a){var c="",b=0;a.length&1&&(b=1,c+=String.fromCharCode(parseInt(a[0],16)));for(;b<a.length;b+=2)c+=String.fromCharCode(parseInt(a.substr(b,2),16));return c};d.bytesToHex=
167
-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,c){for(var b="",l="",d,h,g,n=0;n<a.length;)d=
168
-a.charCodeAt(n++),h=a.charCodeAt(n++),g=a.charCodeAt(n++),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|h>>4),isNaN(h)?b+="==":(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((h&15)<<2|g>>6),b+=isNaN(g)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g&63)),c&&b.length>c&&(l+=b.substr(0,c)+"\r\n",b=b.substr(c));return l+
169
-b};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c="",b,l,d,h,g=0;g<a.length;)b=e[a.charCodeAt(g++)-43],l=e[a.charCodeAt(g++)-43],d=e[a.charCodeAt(g++)-43],h=e[a.charCodeAt(g++)-43],c+=String.fromCharCode(b<<2|l>>4),64!==d&&(c+=String.fromCharCode((l&15)<<4|d>>2),64!==h&&(c+=String.fromCharCode((d&3)<<6|h)));return c};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
170
-d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,c,b){var l=c;l||(l=new Uint8Array(a.length));for(var d=b=b||0,h=0;h<a.length;++h)l[d++]=a.charCodeAt(h);return c?d-b:l};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,c,b){var l=c;l||(l=new Uint8Array(Math.ceil(a.length/2)));b=b||0;var d=0,h=b;a.length&1&&(d=1,l[h++]=parseInt(a[0],16));for(;d<a.length;d+=2)l[h++]=parseInt(a.substr(d,2),16);return c?h-b:l};d.binary.base64.encode=
171
-function(a,c){for(var b="",l="",d,h,g,n=0;n<a.byteLength;)d=a[n++],h=a[n++],g=a[n++],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|h>>4),isNaN(h)?b+="==":(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((h&15)<<2|g>>6),b+=isNaN(g)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g&63)),c&&b.length>c&&(l+=b.substr(0,
172
-c)+"\r\n",b=b.substr(c));return l+b};d.binary.base64.decode=function(a,c,b){var l=c;l||(l=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");b=b||0;for(var d,h,g,n,k=0,u=b;k<a.length;)d=e[a.charCodeAt(k++)-43],h=e[a.charCodeAt(k++)-43],g=e[a.charCodeAt(k++)-43],n=e[a.charCodeAt(k++)-43],l[u++]=d<<2|h>>4,64!==g&&(l[u++]=(h&15)<<4|g>>2,64!==n&&(l[u++]=(g&3)<<6|n));return c?u-b:l.subarray(0,u)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,c,b){a=d.encodeUtf8(a);
173
-var l=c;l||(l=new Uint8Array(a.length));for(var h=b=b||0,g=0;g<a.length;++g)l[h++]=a.charCodeAt(g);return c?h-b:l};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,c,b){var l=c;l||(l=new Uint8Array(2*a.length));for(var d=new Uint16Array(l.buffer),h=b=b||0,g=b,n=0;n<a.length;++n)d[g++]=a.charCodeAt(n),h+=2;return c?h-b:l};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
174
-c,b){c=d.decode64(a.deflate(d.encode64(c)).rval);b&&(a=2,c.charCodeAt(1)&32&&(a=6),c=c.substring(a,c.length-4));return c};d.inflate=function(a,c,b){a=a.inflate(d.encode64(c)).rval;return null===a?null:d.decode64(a)};var u=function(a,c,b){if(!a)throw Error("WebStorage not available.");null===b?a=a.removeItem(c):(b=d.encode64(JSON.stringify(b)),a=a.setItem(c,b));if("undefined"!==typeof a&&!0!==a.rval)throw c=Error(a.error.message),c.id=a.error.id,c.name=a.error.name,c;},B=function(a,c){if(!a)throw Error("WebStorage not available.");
175
-var b=a.getItem(c);if(a.init)if(null===b.rval){if(b.error){var l=Error(b.error.message);l.id=b.error.id;l.name=b.error.name;throw l;}b=null}else b=b.rval;null!==b&&(b=JSON.parse(d.decode64(b)));return b},h=function(a,c,b,l){var d=B(a,c);null===d&&(d={});d[b]=l;u(a,c,d)},g=function(a,c,b){a=B(a,c);null!==a&&(a=b in a?a[b]:null);return a},E=function(a,c,b){var l=B(a,c);if(null!==l&&b in l){delete l[b];b=!0;for(var d in l){b=!1;break}b&&(l=null);u(a,c,l)}},n=function(a,c){u(a,c,null)},f=function(a,c,
176
-b){var l=null;"undefined"===typeof b&&(b=["web","flash"]);var d,h=!1,g=null,n;for(n in b){d=b[n];try{if("flash"===d||"both"===d){if(null===c[0])throw Error("Flash local storage not available.");l=a.apply(this,c);h="flash"===d}if("web"===d||"both"===d)c[0]=localStorage,l=a.apply(this,c),h=!0}catch(e){g=e}if(h)break}if(!h)throw g;return l};d.setItem=function(a,c,b,l,d){f(h,arguments,d)};d.getItem=function(a,c,b,l){return f(g,arguments,l)};d.removeItem=function(a,c,b,l){f(E,arguments,l)};d.clearItems=
177
-function(a,c,b){f(n,arguments,b)};d.parseUrl=function(a){var c=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;c.lastIndex=0;c=c.exec(a);if(a=null===c?null:{full:a,scheme:c[1],host:c[2],port:c[3],path:c[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 w=null;d.getQueryVariables=function(a){var c=function(a){var c=
178
-{};a=a.split("&");for(var b=0;b<a.length;b++){var l=a[b].indexOf("="),d;0<l?(d=a[b].substring(0,l),l=a[b].substring(l+1)):(d=a[b],l=null);d in c||(c[d]=[]);d in Object.prototype||null===l||c[d].push(unescape(l))}return c};"undefined"===typeof a?(null===w&&(w="undefined"!==typeof window&&window.location&&window.location.search?c(window.location.search.substring(1)):{}),a=w):a=c(a);return a};d.parseFragment=function(a){var c=a,b="",l=a.indexOf("?");0<l&&(c=a.substring(0,l),b=a.substring(l+1));a=c.split("/");
179
-0<a.length&&""===a[0]&&a.shift();l=""===b?{}:d.getQueryVariables(b);return{pathString:c,queryString:b,path:a,query:l}};d.makeRequest=function(a){var c=d.parseFragment(a),b={path:c.pathString,query:c.queryString,getPath:function(a){return"undefined"===typeof a?c.path:c.path[a]},getQuery:function(a,b){var l;"undefined"===typeof a?l=c.query:(l=c.query[a])&&"undefined"!==typeof b&&(l=l[b]);return l},getQueryLast:function(a,c){var l=b.getQuery(a);return l?l[l.length-1]:c}};return b};d.makeLink=function(a,
180
-c,b){a=jQuery.isArray(a)?a.join("/"):a;c=jQuery.param(c||{});b=b||"";return a+(0<c.length?"?"+c:"")+(0<b.length?"#"+b:"")};d.setPath=function(a,c,b){if("object"===typeof a&&null!==a)for(var l=0,d=c.length;l<d;){var h=c[l++];if(l==d)a[h]=b;else{var g=h in a;if(!g||g&&"object"!==typeof a[h]||g&&null===a[h])a[h]={};a=a[h]}}};d.getPath=function(a,c,b){for(var l=0,d=c.length,h=!0;h&&l<d&&"object"===typeof a&&null!==a;){var g=c[l++];(h=g in a)&&(a=a[g])}return h?a:b};d.deletePath=function(a,c){if("object"===
181
-typeof a&&null!==a)for(var b=0,l=c.length;b<l;){var d=c[b++];if(b==l)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 c in a)if(a.hasOwnProperty(c))return!1;return!0};d.format=function(a){var c=/%./g,b,l,d=0,h=[];for(l=0;b=c.exec(a);)switch(l=a.substring(l,c.lastIndex-2),0<l.length&&h.push(l),l=c.lastIndex,b=b[0][1],b){case "s":case "o":d<arguments.length?h.push(arguments[d++ +1]):h.push("<?>");break;case "%":h.push("%");break;default:h.push("<#"+
182
-b+"?>")}h.push(a.substring(l));return h.join("")};d.formatNumber=function(a,c,b,l){var d=isNaN(c=Math.abs(c))?2:c;c=void 0===b?",":b;l=void 0===l?".":l;b=0>a?"-":"";var h=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",g=3<h.length?h.length%3:0;return b+(g?h.substr(0,g)+l:"")+h.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+l)+(d?c+Math.abs(a-h).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,".","")+
183
-" 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 c=d.createBuffer(),b=0;b<a.length;++b){var l=parseInt(a[b],10);if(isNaN(l))return null;c.putByte(l)}return c.getBytes()};d.bytesFromIPv6=function(a){var c=0;a=a.split(":").filter(function(a){0===a.length&&++c;return!0});for(var b=
184
-2*(8-a.length+c),l=d.createBuffer(),h=0;8>h;++h)if(a[h]&&0!==a[h].length){var g=d.hexToBytes(a[h]);2>g.length&&l.putByte(0);l.putBytes(g)}else l.fillWithByte(0,b),b=0;return l.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 c=[],b=0;b<a.length;++b)c.push(a.charCodeAt(b));return c.join(".")};d.bytesToIPv6=function(a){if(16!==a.length)return null;for(var c=[],b=[],l=0,h=0;h<a.length;h+=
185
-2){for(var g=d.bytesToHex(a[h]+a[h+1]);"0"===g[0]&&"0"!==g;)g=g.substr(1);if("0"===g){var n=b[b.length-1],e=c.length;n&&e===n.end+1?(n.end=e,n.end-n.start>b[l].end-b[l].start&&(l=b.length-1)):b.push({start:e,end:e})}c.push(g)}0<b.length&&(a=b[l],0<a.end-a.start&&(c.splice(a.start,a.end-a.start+1,""),0===a.start&&c.unshift(""),7===a.end&&c.push("")));return c.join(":")};d.estimateCores=function(a,c){function b(a,n,e){if(0===n){var k=Math.floor(a.reduce(function(a,c){return a+c},0)/a.length);d.cores=
186
-Math.max(1,k);URL.revokeObjectURL(g);return c(null,d.cores)}l(e,function(c,l){a.push(h(e,l));b(a,n-1,e)})}function l(a,c){for(var b=[],d=[],h=0;h<a;++h){var n=new Worker(g);n.addEventListener("message",function(l){d.push(l.data);if(d.length===a){for(l=0;l<a;++l)b[l].terminate();c(null,d)}});b.push(n)}for(h=0;h<a;++h)b[h].postMessage(h)}function h(a,c){for(var b=[],l=0;l<a;++l)for(var d=c[l],g=b[l]=[],n=0;n<a;++n)if(l!==n){var e=c[n];(d.st>e.st&&d.st<e.et||e.st>d.st&&e.st<d.et)&&g.push(n)}return b.reduce(function(a,
187
-c){return Math.max(a,c.length)},0)}"function"===typeof a&&(c=a,a={});a=a||{};if("cores"in d&&!a.update)return c(null,d.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&0<navigator.hardwareConcurrency)return d.cores=navigator.hardwareConcurrency,c(null,d.cores);if("undefined"===typeof Worker)return d.cores=1,c(null,d.cores);if("undefined"===typeof Blob)return d.cores=2,c(null,d.cores);var g=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){a=
188
-Date.now();for(var c=a+4;Date.now()<c;);self.postMessage({st:a,et:c})})}.toString(),")()"],{type:"application/javascript"}));b([],5,16)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.util)return b.util;b.defined.util=!0;for(var k=0;k<e.length;++k)e[k](b);
189
-return b.util}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/util",["require","module"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.cipher=c.cipher||{};c.cipher.algorithms=c.cipher.algorithms||{};c.cipher.createCipher=function(a,b){var d=a;"string"===typeof d&&(d=c.cipher.getAlgorithm(d))&&
167
+(c||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,c){for(var b="";0<c;)c&1&&(b+=a),c>>>=1,0<c&&(a+=a);return b};d.xorBytes=function(a,c,b){for(var m="",d="",h="",k=0,e=0;0<b;--b,++k)d=a.charCodeAt(k)^c.charCodeAt(k),10<=e&&(m+=h,h="",e=0),h+=String.fromCharCode(d),++e;return m+h};d.hexToBytes=function(a){var c="",b=0;a.length&1&&(b=1,c+=String.fromCharCode(parseInt(a[0],16)));for(;b<a.length;b+=2)c+=String.fromCharCode(parseInt(a.substr(b,2),16));return c};d.bytesToHex=
168
+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,c){for(var b="",m="",d,h,k,e=0;e<a.length;)d=
169
+a.charCodeAt(e++),h=a.charCodeAt(e++),k=a.charCodeAt(e++),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|h>>4),isNaN(h)?b+="==":(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((h&15)<<2|k>>6),b+=isNaN(k)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k&63)),c&&b.length>c&&(m+=b.substr(0,c)+"\r\n",b=b.substr(c));return m+
170
+b};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var c="",b,m,d,h,k=0;k<a.length;)b=e[a.charCodeAt(k++)-43],m=e[a.charCodeAt(k++)-43],d=e[a.charCodeAt(k++)-43],h=e[a.charCodeAt(k++)-43],c+=String.fromCharCode(b<<2|m>>4),64!==d&&(c+=String.fromCharCode((m&15)<<4|d>>2),64!==h&&(c+=String.fromCharCode((d&3)<<6|h)));return c};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}};
171
+d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,c,b){var m=c;m||(m=new Uint8Array(a.length));for(var d=b=b||0,h=0;h<a.length;++h)m[d++]=a.charCodeAt(h);return c?d-b:m};d.binary.hex.encode=d.bytesToHex;d.binary.hex.decode=function(a,c,b){var m=c;m||(m=new Uint8Array(Math.ceil(a.length/2)));b=b||0;var d=0,h=b;a.length&1&&(d=1,m[h++]=parseInt(a[0],16));for(;d<a.length;d+=2)m[h++]=parseInt(a.substr(d,2),16);return c?h-b:m};d.binary.base64.encode=
172
+function(a,c){for(var b="",m="",d,h,k,e=0;e<a.byteLength;)d=a[e++],h=a[e++],k=a[e++],b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d>>2),b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|h>>4),isNaN(h)?b+="==":(b+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((h&15)<<2|k>>6),b+=isNaN(k)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k&63)),c&&b.length>c&&(m+=b.substr(0,
173
+c)+"\r\n",b=b.substr(c));return m+b};d.binary.base64.decode=function(a,c,b){var m=c;m||(m=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");b=b||0;for(var d,h,k,p,l=0,v=b;l<a.length;)d=e[a.charCodeAt(l++)-43],h=e[a.charCodeAt(l++)-43],k=e[a.charCodeAt(l++)-43],p=e[a.charCodeAt(l++)-43],m[v++]=d<<2|h>>4,64!==k&&(m[v++]=(h&15)<<4|k>>2,64!==p&&(m[v++]=(k&3)<<6|p));return c?v-b:m.subarray(0,v)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,c,b){a=d.encodeUtf8(a);
174
+var m=c;m||(m=new Uint8Array(a.length));for(var h=b=b||0,k=0;k<a.length;++k)m[h++]=a.charCodeAt(k);return c?h-b:m};d.text.utf8.decode=function(a){return d.decodeUtf8(String.fromCharCode.apply(null,a))};d.text.utf16.encode=function(a,c,b){var m=c;m||(m=new Uint8Array(2*a.length));for(var d=new Uint16Array(m.buffer),h=b=b||0,k=b,e=0;e<a.length;++e)d[k++]=a.charCodeAt(e),h+=2;return c?h-b:m};d.text.utf16.decode=function(a){return String.fromCharCode.apply(null,new Uint16Array(a.buffer))};d.deflate=function(a,
175
+c,b){c=d.decode64(a.deflate(d.encode64(c)).rval);b&&(a=2,c.charCodeAt(1)&32&&(a=6),c=c.substring(a,c.length-4));return c};d.inflate=function(a,c,b){a=a.inflate(d.encode64(c)).rval;return null===a?null:d.decode64(a)};var v=function(a,c,b){if(!a)throw Error("WebStorage not available.");null===b?a=a.removeItem(c):(b=d.encode64(JSON.stringify(b)),a=a.setItem(c,b));if("undefined"!==typeof a&&!0!==a.rval)throw c=Error(a.error.message),c.id=a.error.id,c.name=a.error.name,c;},E=function(a,c){if(!a)throw Error("WebStorage not available.");
176
+var b=a.getItem(c);if(a.init)if(null===b.rval){if(b.error){var m=Error(b.error.message);m.id=b.error.id;m.name=b.error.name;throw m;}b=null}else b=b.rval;null!==b&&(b=JSON.parse(d.decode64(b)));return b},k=function(a,c,b,m){var d=E(a,c);null===d&&(d={});d[b]=m;v(a,c,d)},h=function(a,c,b){a=E(a,c);null!==a&&(a=b in a?a[b]:null);return a},C=function(a,c,b){var m=E(a,c);if(null!==m&&b in m){delete m[b];b=!0;for(var d in m){b=!1;break}b&&(m=null);v(a,c,m)}},p=function(a,c){v(a,c,null)},g=function(a,c,
177
+b){var m=null;"undefined"===typeof b&&(b=["web","flash"]);var d,h=!1,k=null,e;for(e in b){d=b[e];try{if("flash"===d||"both"===d){if(null===c[0])throw Error("Flash local storage not available.");m=a.apply(this,c);h="flash"===d}if("web"===d||"both"===d)c[0]=localStorage,m=a.apply(this,c),h=!0}catch(p){k=p}if(h)break}if(!h)throw k;return m};d.setItem=function(a,c,b,m,d){g(k,arguments,d)};d.getItem=function(a,c,b,m){return g(h,arguments,m)};d.removeItem=function(a,c,b,m){g(C,arguments,m)};d.clearItems=
178
+function(a,c,b){g(p,arguments,b)};d.parseUrl=function(a){var c=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;c.lastIndex=0;c=c.exec(a);if(a=null===c?null:{full:a,scheme:c[1],host:c[2],port:c[3],path:c[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 y=null;d.getQueryVariables=function(a){var c=function(a){var c=
179
+{};a=a.split("&");for(var b=0;b<a.length;b++){var m=a[b].indexOf("="),d;0<m?(d=a[b].substring(0,m),m=a[b].substring(m+1)):(d=a[b],m=null);d in c||(c[d]=[]);d in Object.prototype||null===m||c[d].push(unescape(m))}return c};"undefined"===typeof a?(null===y&&(y="undefined"!==typeof window&&window.location&&window.location.search?c(window.location.search.substring(1)):{}),a=y):a=c(a);return a};d.parseFragment=function(a){var c=a,b="",m=a.indexOf("?");0<m&&(c=a.substring(0,m),b=a.substring(m+1));a=c.split("/");
180
+0<a.length&&""===a[0]&&a.shift();m=""===b?{}:d.getQueryVariables(b);return{pathString:c,queryString:b,path:a,query:m}};d.makeRequest=function(a){var c=d.parseFragment(a),b={path:c.pathString,query:c.queryString,getPath:function(a){return"undefined"===typeof a?c.path:c.path[a]},getQuery:function(a,b){var m;"undefined"===typeof a?m=c.query:(m=c.query[a])&&"undefined"!==typeof b&&(m=m[b]);return m},getQueryLast:function(a,c){var m=b.getQuery(a);return m?m[m.length-1]:c}};return b};d.makeLink=function(a,
181
+c,b){a=jQuery.isArray(a)?a.join("/"):a;c=jQuery.param(c||{});b=b||"";return a+(0<c.length?"?"+c:"")+(0<b.length?"#"+b:"")};d.setPath=function(a,c,b){if("object"===typeof a&&null!==a)for(var m=0,d=c.length;m<d;){var h=c[m++];if(m==d)a[h]=b;else{var k=h in a;if(!k||k&&"object"!==typeof a[h]||k&&null===a[h])a[h]={};a=a[h]}}};d.getPath=function(a,c,b){for(var m=0,d=c.length,h=!0;h&&m<d&&"object"===typeof a&&null!==a;){var k=c[m++];(h=k in a)&&(a=a[k])}return h?a:b};d.deletePath=function(a,c){if("object"===
182
+typeof a&&null!==a)for(var b=0,m=c.length;b<m;){var d=c[b++];if(b==m)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 c in a)if(a.hasOwnProperty(c))return!1;return!0};d.format=function(a){var c=/%./g,b,m,d=0,h=[];for(m=0;b=c.exec(a);)switch(m=a.substring(m,c.lastIndex-2),0<m.length&&h.push(m),m=c.lastIndex,b=b[0][1],b){case "s":case "o":d<arguments.length?h.push(arguments[d++ +1]):h.push("<?>");break;case "%":h.push("%");break;default:h.push("<#"+
183
+b+"?>")}h.push(a.substring(m));return h.join("")};d.formatNumber=function(a,c,b,m){var d=isNaN(c=Math.abs(c))?2:c;c=void 0===b?",":b;m=void 0===m?".":m;b=0>a?"-":"";var h=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",k=3<h.length?h.length%3:0;return b+(k?h.substr(0,k)+m:"")+h.substr(k).replace(/(\d{3})(?=\d)/g,"$1"+m)+(d?c+Math.abs(a-h).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,".","")+
184
+" 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 c=d.createBuffer(),b=0;b<a.length;++b){var m=parseInt(a[b],10);if(isNaN(m))return null;c.putByte(m)}return c.getBytes()};d.bytesFromIPv6=function(a){var c=0;a=a.split(":").filter(function(a){0===a.length&&++c;return!0});for(var b=
185
+2*(8-a.length+c),m=d.createBuffer(),h=0;8>h;++h)if(a[h]&&0!==a[h].length){var k=d.hexToBytes(a[h]);2>k.length&&m.putByte(0);m.putBytes(k)}else m.fillWithByte(0,b),b=0;return m.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 c=[],b=0;b<a.length;++b)c.push(a.charCodeAt(b));return c.join(".")};d.bytesToIPv6=function(a){if(16!==a.length)return null;for(var c=[],b=[],m=0,h=0;h<a.length;h+=
186
+2){for(var k=d.bytesToHex(a[h]+a[h+1]);"0"===k[0]&&"0"!==k;)k=k.substr(1);if("0"===k){var e=b[b.length-1],p=c.length;e&&p===e.end+1?(e.end=p,e.end-e.start>b[m].end-b[m].start&&(m=b.length-1)):b.push({start:p,end:p})}c.push(k)}0<b.length&&(a=b[m],0<a.end-a.start&&(c.splice(a.start,a.end-a.start+1,""),0===a.start&&c.unshift(""),7===a.end&&c.push("")));return c.join(":")};d.estimateCores=function(a,c){function b(a,e,p){if(0===e){var l=Math.floor(a.reduce(function(a,c){return a+c},0)/a.length);d.cores=
187
+Math.max(1,l);URL.revokeObjectURL(k);return c(null,d.cores)}m(p,function(c,m){a.push(h(p,m));b(a,e-1,p)})}function m(a,c){for(var b=[],d=[],h=0;h<a;++h){var e=new Worker(k);e.addEventListener("message",function(m){d.push(m.data);if(d.length===a){for(m=0;m<a;++m)b[m].terminate();c(null,d)}});b.push(e)}for(h=0;h<a;++h)b[h].postMessage(h)}function h(a,c){for(var b=[],m=0;m<a;++m)for(var d=c[m],k=b[m]=[],e=0;e<a;++e)if(m!==e){var p=c[e];(d.st>p.st&&d.st<p.et||p.st>d.st&&p.st<d.et)&&k.push(e)}return b.reduce(function(a,
188
+c){return Math.max(a,c.length)},0)}"function"===typeof a&&(c=a,a={});a=a||{};if("cores"in d&&!a.update)return c(null,d.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&0<navigator.hardwareConcurrency)return d.cores=navigator.hardwareConcurrency,c(null,d.cores);if("undefined"===typeof Worker)return d.cores=1,c(null,d.cores);if("undefined"===typeof Blob)return d.cores=2,c(null,d.cores);var k=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(a){a=
189
+Date.now();for(var c=a+4;Date.now()<c;);self.postMessage({st:a,et:c})})}.toString(),")()"],{type:"application/javascript"}));b([],5,16)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.util)return b.util;b.defined.util=!0;for(var l=0;l<e.length;++l)e[l](b);
190
+return b.util}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/util",["require","module"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.cipher=c.cipher||{};c.cipher.algorithms=c.cipher.algorithms||{};c.cipher.createCipher=function(a,b){var d=a;"string"===typeof d&&(d=c.cipher.getAlgorithm(d))&&
191
(d=d());if(!d)throw Error("Unsupported algorithm: "+a);return new c.cipher.BlockCipher({algorithm:d,key:b,decrypt:!1})};c.cipher.createDecipher=function(a,b){var d=a;"string"===typeof d&&(d=c.cipher.getAlgorithm(d))&&(d=d());if(!d)throw Error("Unsupported algorithm: "+a);return new c.cipher.BlockCipher({algorithm:d,key:b,decrypt:!0})};c.cipher.registerAlgorithm=function(a,b){a=a.toUpperCase();c.cipher.algorithms[a]=b};c.cipher.getAlgorithm=function(a){a=a.toUpperCase();return a in c.cipher.algorithms?
192
c.cipher.algorithms[a]:null};var b=c.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)};b.prototype.start=function(a){a=a||{};var b={},d;for(d in a)b[d]=a[d];b.decrypt=this._decrypt;this._finish=!1;this._input=c.util.createBuffer();this.output=a.output||c.util.createBuffer();
193
this.mode.start(b)};b.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()};b.prototype.finish=function(a){!a||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(c){return a(this.blockSize,c,!1)},this.mode.unpad=function(c){return a(this.blockSize,c,!0)});var c={};c.decrypt=this._decrypt;c.overflow=this._input.length()%this.blockSize;if(!this._decrypt&&this.mode.pad&&
193
-!this.mode.pad(this._input,c))return!1;this._finish=!0;this.update();return this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,c)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,c)?!1:!0}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.cipher)return b.cipher;
194
-b.defined.cipher=!0;for(var k=0;k<e.length;++k)e[k](b);return b.cipher}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/cipher",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){"string"===typeof a&&(a=c.util.createBuffer(a));if(c.util.isArray(a)&&
195
-4<a.length){var d=a;a=c.util.createBuffer();for(var g=0;g<d.length;++g)a.putByte(d[g])}c.util.isArray(a)||(a=[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()]);return a}function d(a){a[a.length-1]=a[a.length-1]+1&4294967295}function e(a){return[a/4294967296|0,a&4294967295]}c.cipher=c.cipher||{};var u=c.cipher.modes=c.cipher.modes||{};u.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=
196
-Array(this._ints)};u.ecb.prototype.start=function(a){};u.ecb.prototype.encrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b])};u.ecb.prototype.decrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.decrypt(this._inBlock,
197
-this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b])};u.ecb.prototype.pad=function(a,c){var b=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(b,b);return!0};u.ecb.prototype.unpad=function(a,c){if(0<c.overflow)return!1;var b=a.length(),b=a.at(b-1);if(b>this.blockSize<<2)return!1;a.truncate(b);return!0};u.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);
198
-this._outBlock=Array(this._ints)};u.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=b(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};u.cbc.prototype.encrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=this._prev[b]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b]);
199
-this._prev=this._outBlock};u.cbc.prototype.decrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._prev[b]^this._outBlock[b]);this._prev=this._inBlock.slice(0)};u.cbc.prototype.pad=function(a,c){var b=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(b,b);return!0};u.cbc.prototype.unpad=function(a,
200
-c){if(0<c.overflow)return!1;var b=a.length(),b=a.at(b-1);if(b>this.blockSize<<2)return!1;a.truncate(b);return!0};u.cfb=function(a){a=a||{};this.name="CFB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};u.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=b(a.iv);this._inBlock=
201
-this._iv.slice(0);this._partialBytes=0};u.cfb.prototype.encrypt=function(a,c,b){var l=a.length();if(0===l)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&l>=this.blockSize)for(var d=0;d<this._ints;++d)this._inBlock[d]=a.getInt32()^this._outBlock[d],c.putInt32(this._inBlock[d]);else{var e=(this.blockSize-l)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialBlock[d]=a.getInt32()^this._outBlock[d],this._partialOutput.putInt32(this._partialBlock[d]);
202
-if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._partialBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(l-this._partialBytes));this._partialBytes=0}};u.cfb.prototype.decrypt=function(a,c,b){var l=a.length();if(0===l)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&
203
-l>=this.blockSize)for(var d=0;d<this._ints;++d)this._inBlock[d]=a.getInt32(),c.putInt32(this._inBlock[d]^this._outBlock[d]);else{var e=(this.blockSize-l)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialBlock[d]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[d]^this._outBlock[d]);if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._partialBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);
204
-if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(l-this._partialBytes));this._partialBytes=0}};u.ofb=function(a){a=a||{};this.name="OFB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};u.ofb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");
205
-this._iv=b(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};u.ofb.prototype.encrypt=function(a,c,b){var l=a.length();if(0===a.length())return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&l>=this.blockSize)for(var d=0;d<this._ints;++d)c.putInt32(a.getInt32()^this._outBlock[d]),this._inBlock[d]=this._outBlock[d];else{var e=(this.blockSize-l)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialOutput.putInt32(a.getInt32()^
206
-this._outBlock[d]);if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._outBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(l-this._partialBytes));this._partialBytes=0}};u.ofb.prototype.decrypt=u.ofb.prototype.encrypt;u.ctr=function(a){a=a||{};this.name="CTR";this.cipher=a.cipher;this.blockSize=
207
-a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};u.ctr.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=b(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};u.ctr.prototype.encrypt=function(a,c,b){var l=a.length();if(0===l)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&l>=this.blockSize)for(var e=0;e<
208
-this._ints;++e)c.putInt32(a.getInt32()^this._outBlock[e]);else{var k=(this.blockSize-l)%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&&!b)return c.putBytes(this._partialOutput.getBytes(k-this._partialBytes)),this._partialBytes=k,!0;c.putBytes(this._partialOutput.getBytes(l-this._partialBytes));
209
-this._partialBytes=0}d(this._inBlock)};u.ctr.prototype.decrypt=u.ctr.prototype.encrypt;u.gcm=function(a){a=a||{};this.name="GCM";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0;this._R=3774873600};u.gcm.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");var b=c.util.createBuffer(a.iv);this._cipherLength=0;var g;
210
-g="additionalData"in a?c.util.createBuffer(a.additionalData):c.util.createBuffer();this._tagLength="tagLength"in a?a.tagLength:128;this._tag=null;if(a.decrypt&&(this._tag=c.util.createBuffer(a.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,
211
-this.componentBits);a=b.length();if(12===a)this._j0=[b.getInt32(),b.getInt32(),b.getInt32(),1];else{for(this._j0=[0,0,0,0];0<b.length();)this._j0=this.ghash(this._hashSubkey,this._j0,[b.getInt32(),b.getInt32(),b.getInt32(),b.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(e(8*a)))}this._inBlock=this._j0.slice(0);d(this._inBlock);this._partialBytes=0;g=c.util.createBuffer(g);this._aDataLength=e(8*g.length());(b=g.length()%this.blockSize)&&g.fillWithByte(0,this.blockSize-b);
212
-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()])};u.gcm.prototype.encrypt=function(a,c,b){var l=a.length();if(0===l)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&l>=this.blockSize){for(var e=0;e<this._ints;++e)c.putInt32(this._outBlock[e]^=a.getInt32());this._cipherLength+=this.blockSize}else{var k=(this.blockSize-l)%this.blockSize;0<k&&(k=this.blockSize-k);this._partialOutput.clear();
213
-for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);if(0===k||b){b?(e=l%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&&!b)return a.read-=this.blockSize,c.putBytes(this._partialOutput.getBytes(k-this._partialBytes)),
214
-this._partialBytes=k,!0;c.putBytes(this._partialOutput.getBytes(l-this._partialBytes));this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock);d(this._inBlock)};u.gcm.prototype.decrypt=function(a,c,b){var l=a.length();if(l<this.blockSize&&!(b&&0<l))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,
215
-this._s,this._hashBlock);for(a=0;a<this._ints;++a)c.putInt32(this._outBlock[a]^this._hashBlock[a]);this._cipherLength=l<this.blockSize?this._cipherLength+l%this.blockSize:this._cipherLength+this.blockSize};u.gcm.prototype.afterFinish=function(a,b){var d=!0;b.decrypt&&b.overflow&&a.truncate(this.blockSize-b.overflow);this.tag=c.util.createBuffer();var k=this._aDataLength.concat(e(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,k);k=[];this.cipher.encrypt(this._j0,k);for(var n=0;n<
216
-this._ints;++n)this.tag.putInt32(this._s[n]^k[n]);this.tag.truncate(this.tag.length()%(this._tagLength/8));b.decrypt&&this.tag.bytes()!==this._tag&&(d=!1);return d};u.gcm.prototype.multiply=function(a,c){for(var b=[0,0,0,0],l=c.slice(0),d=0;128>d;++d)a[d/32|0]&1<<31-d%32&&(b[0]^=l[0],b[1]^=l[1],b[2]^=l[2],b[3]^=l[3]),this.pow(l,l);return b};u.gcm.prototype.pow=function(a,c){for(var b=a[3]&1,l=3;0<l;--l)c[l]=a[l]>>>1|(a[l-1]&1)<<31;c[0]=a[0]>>>1;b&&(c[0]^=this._R)};u.gcm.prototype.tableMultiply=function(a){for(var c=
217
-[0,0,0,0],b=0;32>b;++b){var l=this._m[b][a[b/8|0]>>>4*(7-b%8)&15];c[0]^=l[0];c[1]^=l[1];c[2]^=l[2];c[3]^=l[3]}return c};u.gcm.prototype.ghash=function(a,c,b){c[0]^=b[0];c[1]^=b[1];c[2]^=b[2];c[3]^=b[3];return this.tableMultiply(c)};u.gcm.prototype.generateHashTable=function(a,c){for(var b=8/c,l=4*b,b=16*b,d=Array(b),e=0;e<b;++e){var k=[0,0,0,0];k[e/l|0]=1<<c-1<<(l-1-e%l)*c;d[e]=this.generateSubHashTable(this.multiply(k,a),c)}return d};u.gcm.prototype.generateSubHashTable=function(a,c){var b=1<<c,
218
-l=b>>>1,d=Array(b);d[l]=a.slice(0);for(var e=l>>>1;0<e;)this.pow(d[2*e],d[e]=[]),e>>=1;for(e=2;e<l;){for(var k=1;k<e;++k){var u=d[e],f=d[k];d[e+k]=[u[0]^f[0],u[1]^f[1],u[2]^f[2],u[3]^f[3]]}e*=2}d[0]=[0,0,0,0];for(e=l+1;e<b;++e)k=d[e^l],d[e]=[a[0]^k[0],a[1]^k[1],a[2]^k[2],a[3]^k[3]];return d}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=
219
-m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.cipherModes)return b.cipherModes;b.defined.cipherModes=!0;for(var k=0;k<e.length;++k)e[k](b);return b.cipherModes}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/cipherModes",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,
220
-0))})})();(function(){function a(c){function b(a,d){c.cipher.registerAlgorithm(a,function(){return new c.aes.Algorithm(a,d)})}function d(){h=!0;F=[0,1,2,4,8,16,32,64,128,27,54];for(var a=Array(256),c=0;128>c;++c)a[c]=c<<1,a[c+128]=c+128<<1^283;E=Array(256);n=Array(256);w=Array(4);y=Array(4);for(c=0;4>c;++c)w[c]=Array(256),y[c]=Array(256);for(var b=0,l=0,g,e,k,u,f,c=0;256>c;++c){u=l^l<<1^l<<2^l<<3^l<<4;u=u>>8^u&255^99;E[b]=u;n[u]=b;f=a[u];g=a[b];e=a[g];k=a[e];f^=f<<24^u<<16^u<<8^u;e=(g^e^k)<<24^(b^
221
-k)<<16^(b^e^k)<<8^b^g^k;for(var v=0;4>v;++v)w[v][b]=f,y[v][u]=e,f=f<<24|f>>>8,e=e<<24|e>>>8;0===b?b=l=1:(b=g^a[a[a[g^k]]],l^=a[a[l]])}}function e(a,c){for(var b=a.slice(0),l,d=1,h=b.length,e=g*(h+6+1),k=h;k<e;++k)l=b[k-1],0===k%h?(l=E[l>>>16&255]<<24^E[l>>>8&255]<<16^E[l&255]<<8^E[l>>>24]^F[d]<<24,d++):6<h&&4===k%h&&(l=E[l>>>24]<<24^E[l>>>16&255]<<16^E[l>>>8&255]<<8^E[l&255]),b[k]=b[k-h]^l;if(c){for(var d=y[0],h=y[1],n=y[2],u=y[3],f=b.slice(0),e=b.length,k=0,v=e-g;k<e;k+=g,v-=g)if(0===k||k===e-g)f[k]=
222
-b[v],f[k+1]=b[v+3],f[k+2]=b[v+2],f[k+3]=b[v+1];else for(var w=0;w<g;++w)l=b[v+w],f[k+(3&-w)]=d[E[l>>>24]]^h[E[l>>>16&255]]^n[E[l>>>8&255]]^u[E[l&255]];b=f}return b}function u(a,c,b,l){var d=a.length/4-1,h,g,e,k,u;l?(h=y[0],g=y[1],e=y[2],k=y[3],u=n):(h=w[0],g=w[1],e=w[2],k=w[3],u=E);var f,v,B,F,m,p;f=c[0]^a[0];v=c[l?3:1]^a[1];B=c[2]^a[2];c=c[l?1:3]^a[3];for(var r=3,R=1;R<d;++R)F=h[f>>>24]^g[v>>>16&255]^e[B>>>8&255]^k[c&255]^a[++r],m=h[v>>>24]^g[B>>>16&255]^e[c>>>8&255]^k[f&255]^a[++r],p=h[B>>>24]^
223
-g[c>>>16&255]^e[f>>>8&255]^k[v&255]^a[++r],c=h[c>>>24]^g[f>>>16&255]^e[v>>>8&255]^k[B&255]^a[++r],f=F,v=m,B=p;b[0]=u[f>>>24]<<24^u[v>>>16&255]<<16^u[B>>>8&255]<<8^u[c&255]^a[++r];b[l?3:1]=u[v>>>24]<<24^u[B>>>16&255]<<16^u[c>>>8&255]<<8^u[f&255]^a[++r];b[2]=u[B>>>24]<<24^u[c>>>16&255]<<16^u[f>>>8&255]<<8^u[v&255]^a[++r];b[l?1:3]=u[c>>>24]<<24^u[f>>>16&255]<<16^u[v>>>8&255]<<8^u[B&255]^a[++r]}function f(a){a=a||{};var b="AES-"+(a.mode||"CBC").toUpperCase(),d;d=a.decrypt?c.cipher.createDecipher(b,a.key):
224
-c.cipher.createCipher(b,a.key);var h=d.start;d.start=function(a,b){var g=null;b instanceof c.util.ByteBuffer&&(g=b,b={});b=b||{};b.output=g;b.iv=a;h.call(d,b)};return d}c.aes=c.aes||{};c.aes.startEncrypting=function(a,c,b,l){a=f({key:a,output:b,decrypt:!1,mode:l});a.start(c);return a};c.aes.createEncryptionCipher=function(a,c){return f({key:a,output:null,decrypt:!1,mode:c})};c.aes.startDecrypting=function(a,c,b,l){a=f({key:a,output:b,decrypt:!0,mode:l});a.start(c);return a};c.aes.createDecryptionCipher=
225
-function(a,c){return f({key:a,output:null,decrypt:!0,mode:c})};c.aes.Algorithm=function(a,c){h||d();var b=this;b.name=a;b.mode=new c({blockSize:16,cipher:{encrypt:function(a,c){return u(b._w,a,c,!1)},decrypt:function(a,c){return u(b._w,a,c,!0)}}});b._init=!1};c.aes.Algorithm.prototype.initialize=function(a){if(!this._init){var b=a.key,d;if("string"===typeof b&&(16===b.length||24===b.length||32===b.length))b=c.util.createBuffer(b);else if(c.util.isArray(b)&&(16===b.length||24===b.length||32===b.length)){d=
226
-b;for(var b=c.util.createBuffer(),h=0;h<d.length;++h)b.putByte(d[h])}if(!c.util.isArray(b)){d=b;var b=[],g=d.length();if(16===g||24===g||32===g)for(g>>>=2,h=0;h<g;++h)b.push(d.getInt32())}if(!c.util.isArray(b)||4!==b.length&&6!==b.length&&8!==b.length)throw Error("Invalid key parameter.");d=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=e(b,a.decrypt&&!d);this._init=!0}};c.aes._expandKey=function(a,c){h||d();return e(a,c)};c.aes._updateBlock=u;b("AES-ECB",c.cipher.modes.ecb);b("AES-CBC",
227
-c.cipher.modes.cbc);b("AES-CFB",c.cipher.modes.cfb);b("AES-OFB",c.cipher.modes.ofb);b("AES-CTR",c.cipher.modes.ctr);b("AES-GCM",c.cipher.modes.gcm);var h=!1,g=4,E,n,F,w,y}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.aes)return b.aes;b.defined.aes=
228
-!0;for(var k=0;k<e.length;++k)e[k](b);return b.aes}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/aes",["require","module","./cipher","./cipherModes","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.pki=c.pki||{};c=c.pki.oids=c.oids=c.oids||{};c["1.2.840.113549.1.1.1"]="rsaEncryption";
194
+!this.mode.pad(this._input,c))return!1;this._finish=!0;this.update();return this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,c)||this.mode.afterFinish&&!this.mode.afterFinish(this.output,c)?!1:!0}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.cipher)return b.cipher;
195
+b.defined.cipher=!0;for(var l=0;l<e.length;++l)e[l](b);return b.cipher}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/cipher",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){"string"===typeof a&&(a=c.util.createBuffer(a));if(c.util.isArray(a)&&
196
+4<a.length){var d=a;a=c.util.createBuffer();for(var h=0;h<d.length;++h)a.putByte(d[h])}c.util.isArray(a)||(a=[a.getInt32(),a.getInt32(),a.getInt32(),a.getInt32()]);return a}function d(a){a[a.length-1]=a[a.length-1]+1&4294967295}function e(a){return[a/4294967296|0,a&4294967295]}c.cipher=c.cipher||{};var v=c.cipher.modes=c.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=
197
+Array(this._ints)};v.ecb.prototype.start=function(a){};v.ecb.prototype.encrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b])};v.ecb.prototype.decrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.decrypt(this._inBlock,
198
+this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b])};v.ecb.prototype.pad=function(a,c){var b=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(b,b);return!0};v.ecb.prototype.unpad=function(a,c){if(0<c.overflow)return!1;var b=a.length(),b=a.at(b-1);if(b>this.blockSize<<2)return!1;a.truncate(b);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);
199
+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=b(a.iv),this._prev=this._iv.slice(0);else throw Error("Invalid IV parameter.");};v.cbc.prototype.encrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=this._prev[b]^a.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._outBlock[b]);
200
+this._prev=this._outBlock};v.cbc.prototype.decrypt=function(a,c,b){if(a.length()<this.blockSize&&!(b&&0<a.length()))return!0;for(b=0;b<this._ints;++b)this._inBlock[b]=a.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(b=0;b<this._ints;++b)c.putInt32(this._prev[b]^this._outBlock[b]);this._prev=this._inBlock.slice(0)};v.cbc.prototype.pad=function(a,c){var b=a.length()===this.blockSize?this.blockSize:this.blockSize-a.length();a.fillWithByte(b,b);return!0};v.cbc.prototype.unpad=function(a,
201
+c){if(0<c.overflow)return!1;var b=a.length(),b=a.at(b-1);if(b>this.blockSize<<2)return!1;a.truncate(b);return!0};v.cfb=function(a){a=a||{};this.name="CFB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};v.cfb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=b(a.iv);this._inBlock=
202
+this._iv.slice(0);this._partialBytes=0};v.cfb.prototype.encrypt=function(a,c,b){var m=a.length();if(0===m)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&m>=this.blockSize)for(var d=0;d<this._ints;++d)this._inBlock[d]=a.getInt32()^this._outBlock[d],c.putInt32(this._inBlock[d]);else{var e=(this.blockSize-m)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialBlock[d]=a.getInt32()^this._outBlock[d],this._partialOutput.putInt32(this._partialBlock[d]);
203
+if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._partialBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(m-this._partialBytes));this._partialBytes=0}};v.cfb.prototype.decrypt=function(a,c,b){var m=a.length();if(0===m)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&
204
+m>=this.blockSize)for(var d=0;d<this._ints;++d)this._inBlock[d]=a.getInt32(),c.putInt32(this._inBlock[d]^this._outBlock[d]);else{var e=(this.blockSize-m)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialBlock[d]=a.getInt32(),this._partialOutput.putInt32(this._partialBlock[d]^this._outBlock[d]);if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._partialBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);
205
+if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(m-this._partialBytes));this._partialBytes=0}};v.ofb=function(a){a=a||{};this.name="OFB";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};v.ofb.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");
206
+this._iv=b(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};v.ofb.prototype.encrypt=function(a,c,b){var m=a.length();if(0===a.length())return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&m>=this.blockSize)for(var d=0;d<this._ints;++d)c.putInt32(a.getInt32()^this._outBlock[d]),this._inBlock[d]=this._outBlock[d];else{var e=(this.blockSize-m)%this.blockSize;0<e&&(e=this.blockSize-e);this._partialOutput.clear();for(d=0;d<this._ints;++d)this._partialOutput.putInt32(a.getInt32()^
207
+this._outBlock[d]);if(0<e)a.read-=this.blockSize;else for(d=0;d<this._ints;++d)this._inBlock[d]=this._outBlock[d];0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<e&&!b)return c.putBytes(this._partialOutput.getBytes(e-this._partialBytes)),this._partialBytes=e,!0;c.putBytes(this._partialOutput.getBytes(m-this._partialBytes));this._partialBytes=0}};v.ofb.prototype.decrypt=v.ofb.prototype.encrypt;v.ctr=function(a){a=a||{};this.name="CTR";this.cipher=a.cipher;this.blockSize=
208
+a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=null;this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0};v.ctr.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");this._iv=b(a.iv);this._inBlock=this._iv.slice(0);this._partialBytes=0};v.ctr.prototype.encrypt=function(a,c,b){var m=a.length();if(0===m)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&m>=this.blockSize)for(var e=0;e<
209
+this._ints;++e)c.putInt32(a.getInt32()^this._outBlock[e]);else{var l=(this.blockSize-m)%this.blockSize;0<l&&(l=this.blockSize-l);this._partialOutput.clear();for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);0<l&&(a.read-=this.blockSize);0<this._partialBytes&&this._partialOutput.getBytes(this._partialBytes);if(0<l&&!b)return c.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),this._partialBytes=l,!0;c.putBytes(this._partialOutput.getBytes(m-this._partialBytes));
210
+this._partialBytes=0}d(this._inBlock)};v.ctr.prototype.decrypt=v.ctr.prototype.encrypt;v.gcm=function(a){a=a||{};this.name="GCM";this.cipher=a.cipher;this.blockSize=a.blockSize||16;this._ints=this.blockSize/4;this._inBlock=Array(this._ints);this._outBlock=Array(this._ints);this._partialOutput=c.util.createBuffer();this._partialBytes=0;this._R=3774873600};v.gcm.prototype.start=function(a){if(!("iv"in a))throw Error("Invalid IV parameter.");var b=c.util.createBuffer(a.iv);this._cipherLength=0;var h;
211
+h="additionalData"in a?c.util.createBuffer(a.additionalData):c.util.createBuffer();this._tagLength="tagLength"in a?a.tagLength:128;this._tag=null;if(a.decrypt&&(this._tag=c.util.createBuffer(a.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,
212
+this.componentBits);a=b.length();if(12===a)this._j0=[b.getInt32(),b.getInt32(),b.getInt32(),1];else{for(this._j0=[0,0,0,0];0<b.length();)this._j0=this.ghash(this._hashSubkey,this._j0,[b.getInt32(),b.getInt32(),b.getInt32(),b.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(e(8*a)))}this._inBlock=this._j0.slice(0);d(this._inBlock);this._partialBytes=0;h=c.util.createBuffer(h);this._aDataLength=e(8*h.length());(b=h.length()%this.blockSize)&&h.fillWithByte(0,this.blockSize-b);
213
+for(this._s=[0,0,0,0];0<h.length();)this._s=this.ghash(this._hashSubkey,this._s,[h.getInt32(),h.getInt32(),h.getInt32(),h.getInt32()])};v.gcm.prototype.encrypt=function(a,c,b){var m=a.length();if(0===m)return!0;this.cipher.encrypt(this._inBlock,this._outBlock);if(0===this._partialBytes&&m>=this.blockSize){for(var e=0;e<this._ints;++e)c.putInt32(this._outBlock[e]^=a.getInt32());this._cipherLength+=this.blockSize}else{var l=(this.blockSize-m)%this.blockSize;0<l&&(l=this.blockSize-l);this._partialOutput.clear();
214
+for(e=0;e<this._ints;++e)this._partialOutput.putInt32(a.getInt32()^this._outBlock[e]);if(0===l||b){b?(e=m%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<l&&!b)return a.read-=this.blockSize,c.putBytes(this._partialOutput.getBytes(l-this._partialBytes)),
215
+this._partialBytes=l,!0;c.putBytes(this._partialOutput.getBytes(m-this._partialBytes));this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock);d(this._inBlock)};v.gcm.prototype.decrypt=function(a,c,b){var m=a.length();if(m<this.blockSize&&!(b&&0<m))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,
216
+this._s,this._hashBlock);for(a=0;a<this._ints;++a)c.putInt32(this._outBlock[a]^this._hashBlock[a]);this._cipherLength=m<this.blockSize?this._cipherLength+m%this.blockSize:this._cipherLength+this.blockSize};v.gcm.prototype.afterFinish=function(a,b){var d=!0;b.decrypt&&b.overflow&&a.truncate(this.blockSize-b.overflow);this.tag=c.util.createBuffer();var l=this._aDataLength.concat(e(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,l);l=[];this.cipher.encrypt(this._j0,l);for(var p=0;p<
217
+this._ints;++p)this.tag.putInt32(this._s[p]^l[p]);this.tag.truncate(this.tag.length()%(this._tagLength/8));b.decrypt&&this.tag.bytes()!==this._tag&&(d=!1);return d};v.gcm.prototype.multiply=function(a,c){for(var b=[0,0,0,0],m=c.slice(0),d=0;128>d;++d)a[d/32|0]&1<<31-d%32&&(b[0]^=m[0],b[1]^=m[1],b[2]^=m[2],b[3]^=m[3]),this.pow(m,m);return b};v.gcm.prototype.pow=function(a,c){for(var b=a[3]&1,m=3;0<m;--m)c[m]=a[m]>>>1|(a[m-1]&1)<<31;c[0]=a[0]>>>1;b&&(c[0]^=this._R)};v.gcm.prototype.tableMultiply=function(a){for(var c=
218
+[0,0,0,0],b=0;32>b;++b){var m=this._m[b][a[b/8|0]>>>4*(7-b%8)&15];c[0]^=m[0];c[1]^=m[1];c[2]^=m[2];c[3]^=m[3]}return c};v.gcm.prototype.ghash=function(a,c,b){c[0]^=b[0];c[1]^=b[1];c[2]^=b[2];c[3]^=b[3];return this.tableMultiply(c)};v.gcm.prototype.generateHashTable=function(a,c){for(var b=8/c,m=4*b,b=16*b,d=Array(b),e=0;e<b;++e){var l=[0,0,0,0];l[e/m|0]=1<<c-1<<(m-1-e%m)*c;d[e]=this.generateSubHashTable(this.multiply(l,a),c)}return d};v.gcm.prototype.generateSubHashTable=function(a,c){var b=1<<c,
219
+m=b>>>1,d=Array(b);d[m]=a.slice(0);for(var e=m>>>1;0<e;)this.pow(d[2*e],d[e]=[]),e>>=1;for(e=2;e<m;){for(var l=1;l<e;++l){var v=d[e],g=d[l];d[e+l]=[v[0]^g[0],v[1]^g[1],v[2]^g[2],v[3]^g[3]]}e*=2}d[0]=[0,0,0,0];for(e=m+1;e<b;++e)l=d[e^m],d[e]=[a[0]^l[0],a[1]^l[1],a[2]^l[2],a[3]^l[3]];return d}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=
220
+n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.cipherModes)return b.cipherModes;b.defined.cipherModes=!0;for(var l=0;l<e.length;++l)e[l](b);return b.cipherModes}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/cipherModes",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,
221
+0))})})();(function(){function a(c){function b(a,d){c.cipher.registerAlgorithm(a,function(){return new c.aes.Algorithm(a,d)})}function d(){k=!0;F=[0,1,2,4,8,16,32,64,128,27,54];for(var a=Array(256),c=0;128>c;++c)a[c]=c<<1,a[c+128]=c+128<<1^283;C=Array(256);p=Array(256);y=Array(4);z=Array(4);for(c=0;4>c;++c)y[c]=Array(256),z[c]=Array(256);for(var b=0,m=0,h,e,l,v,q,c=0;256>c;++c){v=m^m<<1^m<<2^m<<3^m<<4;v=v>>8^v&255^99;C[b]=v;p[v]=b;q=a[v];h=a[b];e=a[h];l=a[e];q^=q<<24^v<<16^v<<8^v;e=(h^e^l)<<24^(b^
222
+l)<<16^(b^e^l)<<8^b^h^l;for(var g=0;4>g;++g)y[g][b]=q,z[g][v]=e,q=q<<24|q>>>8,e=e<<24|e>>>8;0===b?b=m=1:(b=h^a[a[a[h^l]]],m^=a[a[m]])}}function e(a,c){for(var b=a.slice(0),m,d=1,k=b.length,e=h*(k+6+1),l=k;l<e;++l)m=b[l-1],0===l%k?(m=C[m>>>16&255]<<24^C[m>>>8&255]<<16^C[m&255]<<8^C[m>>>24]^F[d]<<24,d++):6<k&&4===l%k&&(m=C[m>>>24]<<24^C[m>>>16&255]<<16^C[m>>>8&255]<<8^C[m&255]),b[l]=b[l-k]^m;if(c){for(var d=z[0],k=z[1],p=z[2],v=z[3],g=b.slice(0),e=b.length,l=0,w=e-h;l<e;l+=h,w-=h)if(0===l||l===e-h)g[l]=
223
+b[w],g[l+1]=b[w+3],g[l+2]=b[w+2],g[l+3]=b[w+1];else for(var y=0;y<h;++y)m=b[w+y],g[l+(3&-y)]=d[C[m>>>24]]^k[C[m>>>16&255]]^p[C[m>>>8&255]]^v[C[m&255]];b=g}return b}function v(a,c,b,m){var d=a.length/4-1,h,k,e,l,v;m?(h=z[0],k=z[1],e=z[2],l=z[3],v=p):(h=y[0],k=y[1],e=y[2],l=y[3],v=C);var g,w,E,F,n,r;g=c[0]^a[0];w=c[m?3:1]^a[1];E=c[2]^a[2];c=c[m?1:3]^a[3];for(var u=3,U=1;U<d;++U)F=h[g>>>24]^k[w>>>16&255]^e[E>>>8&255]^l[c&255]^a[++u],n=h[w>>>24]^k[E>>>16&255]^e[c>>>8&255]^l[g&255]^a[++u],r=h[E>>>24]^
224
+k[c>>>16&255]^e[g>>>8&255]^l[w&255]^a[++u],c=h[c>>>24]^k[g>>>16&255]^e[w>>>8&255]^l[E&255]^a[++u],g=F,w=n,E=r;b[0]=v[g>>>24]<<24^v[w>>>16&255]<<16^v[E>>>8&255]<<8^v[c&255]^a[++u];b[m?3:1]=v[w>>>24]<<24^v[E>>>16&255]<<16^v[c>>>8&255]<<8^v[g&255]^a[++u];b[2]=v[E>>>24]<<24^v[c>>>16&255]<<16^v[g>>>8&255]<<8^v[w&255]^a[++u];b[m?1:3]=v[c>>>24]<<24^v[g>>>16&255]<<16^v[w>>>8&255]<<8^v[E&255]^a[++u]}function g(a){a=a||{};var b="AES-"+(a.mode||"CBC").toUpperCase(),d;d=a.decrypt?c.cipher.createDecipher(b,a.key):
225
+c.cipher.createCipher(b,a.key);var h=d.start;d.start=function(a,b){var k=null;b instanceof c.util.ByteBuffer&&(k=b,b={});b=b||{};b.output=k;b.iv=a;h.call(d,b)};return d}c.aes=c.aes||{};c.aes.startEncrypting=function(a,c,b,m){a=g({key:a,output:b,decrypt:!1,mode:m});a.start(c);return a};c.aes.createEncryptionCipher=function(a,c){return g({key:a,output:null,decrypt:!1,mode:c})};c.aes.startDecrypting=function(a,c,b,m){a=g({key:a,output:b,decrypt:!0,mode:m});a.start(c);return a};c.aes.createDecryptionCipher=
226
+function(a,c){return g({key:a,output:null,decrypt:!0,mode:c})};c.aes.Algorithm=function(a,c){k||d();var b=this;b.name=a;b.mode=new c({blockSize:16,cipher:{encrypt:function(a,c){return v(b._w,a,c,!1)},decrypt:function(a,c){return v(b._w,a,c,!0)}}});b._init=!1};c.aes.Algorithm.prototype.initialize=function(a){if(!this._init){var b=a.key,d;if("string"===typeof b&&(16===b.length||24===b.length||32===b.length))b=c.util.createBuffer(b);else if(c.util.isArray(b)&&(16===b.length||24===b.length||32===b.length)){d=
227
+b;for(var b=c.util.createBuffer(),h=0;h<d.length;++h)b.putByte(d[h])}if(!c.util.isArray(b)){d=b;var b=[],k=d.length();if(16===k||24===k||32===k)for(k>>>=2,h=0;h<k;++h)b.push(d.getInt32())}if(!c.util.isArray(b)||4!==b.length&&6!==b.length&&8!==b.length)throw Error("Invalid key parameter.");d=-1!==["CFB","OFB","CTR","GCM"].indexOf(this.mode.name);this._w=e(b,a.decrypt&&!d);this._init=!0}};c.aes._expandKey=function(a,c){k||d();return e(a,c)};c.aes._updateBlock=v;b("AES-ECB",c.cipher.modes.ecb);b("AES-CBC",
228
+c.cipher.modes.cbc);b("AES-CFB",c.cipher.modes.cfb);b("AES-OFB",c.cipher.modes.ofb);b("AES-CTR",c.cipher.modes.ctr);b("AES-GCM",c.cipher.modes.gcm);var k=!1,h=4,C,p,F,y,z}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.aes)return b.aes;b.defined.aes=
229
+!0;for(var l=0;l<e.length;++l)e[l](b);return b.aes}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/aes",["require","module","./cipher","./cipherModes","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.pki=c.pki||{};c=c.pki.oids=c.oids=c.oids||{};c["1.2.840.113549.1.1.1"]="rsaEncryption";
230
c.rsaEncryption="1.2.840.113549.1.1.1";c["1.2.840.113549.1.1.4"]="md5WithRSAEncryption";c.md5WithRSAEncryption="1.2.840.113549.1.1.4";c["1.2.840.113549.1.1.5"]="sha1WithRSAEncryption";c.sha1WithRSAEncryption="1.2.840.113549.1.1.5";c["1.2.840.113549.1.1.7"]="RSAES-OAEP";c["RSAES-OAEP"]="1.2.840.113549.1.1.7";c["1.2.840.113549.1.1.8"]="mgf1";c.mgf1="1.2.840.113549.1.1.8";c["1.2.840.113549.1.1.9"]="pSpecified";c.pSpecified="1.2.840.113549.1.1.9";c["1.2.840.113549.1.1.10"]="RSASSA-PSS";c["RSASSA-PSS"]=
231
"1.2.840.113549.1.1.10";c["1.2.840.113549.1.1.11"]="sha256WithRSAEncryption";c.sha256WithRSAEncryption="1.2.840.113549.1.1.11";c["1.2.840.113549.1.1.12"]="sha384WithRSAEncryption";c.sha384WithRSAEncryption="1.2.840.113549.1.1.12";c["1.2.840.113549.1.1.13"]="sha512WithRSAEncryption";c.sha512WithRSAEncryption="1.2.840.113549.1.1.13";c["1.3.14.3.2.7"]="desCBC";c.desCBC="1.3.14.3.2.7";c["1.3.14.3.2.26"]="sha1";c.sha1="1.3.14.3.2.26";c["2.16.840.1.101.3.4.2.1"]="sha256";c.sha256="2.16.840.1.101.3.4.2.1";
232
c["2.16.840.1.101.3.4.2.2"]="sha384";c.sha384="2.16.840.1.101.3.4.2.2";c["2.16.840.1.101.3.4.2.3"]="sha512";c.sha512="2.16.840.1.101.3.4.2.3";c["1.2.840.113549.2.5"]="md5";c.md5="1.2.840.113549.2.5";c["1.2.840.113549.1.7.1"]="data";c.data="1.2.840.113549.1.7.1";c["1.2.840.113549.1.7.2"]="signedData";c.signedData="1.2.840.113549.1.7.2";c["1.2.840.113549.1.7.3"]="envelopedData";c.envelopedData="1.2.840.113549.1.7.3";c["1.2.840.113549.1.7.4"]="signedAndEnvelopedData";c.signedAndEnvelopedData="1.2.840.113549.1.7.4";
@@ -239,215 +240,215 @@ c["2.5.4.8"]="stateOrProvinceName";c.stateOrProvinceName="2.5.4.8";c["2.5.4.10"]
240
"subjectAltName";c["2.5.29.8"]="issuerAltName";c["2.5.29.9"]="subjectDirectoryAttributes";c["2.5.29.10"]="basicConstraints";c["2.5.29.11"]="nameConstraints";c["2.5.29.12"]="policyConstraints";c["2.5.29.13"]="basicConstraints";c["2.5.29.14"]="subjectKeyIdentifier";c.subjectKeyIdentifier="2.5.29.14";c["2.5.29.15"]="keyUsage";c.keyUsage="2.5.29.15";c["2.5.29.16"]="privateKeyUsagePeriod";c["2.5.29.17"]="subjectAltName";c.subjectAltName="2.5.29.17";c["2.5.29.18"]="issuerAltName";c.issuerAltName="2.5.29.18";
241
c["2.5.29.19"]="basicConstraints";c.basicConstraints="2.5.29.19";c["2.5.29.20"]="cRLNumber";c["2.5.29.21"]="cRLReason";c["2.5.29.22"]="expirationDate";c["2.5.29.23"]="instructionCode";c["2.5.29.24"]="invalidityDate";c["2.5.29.25"]="cRLDistributionPoints";c["2.5.29.26"]="issuingDistributionPoint";c["2.5.29.27"]="deltaCRLIndicator";c["2.5.29.28"]="issuingDistributionPoint";c["2.5.29.29"]="certificateIssuer";c["2.5.29.30"]="nameConstraints";c["2.5.29.31"]="cRLDistributionPoints";c["2.5.29.32"]="certificatePolicies";
242
c["2.5.29.33"]="policyMappings";c["2.5.29.34"]="policyConstraints";c["2.5.29.35"]="authorityKeyIdentifier";c["2.5.29.36"]="policyConstraints";c["2.5.29.37"]="extKeyUsage";c.extKeyUsage="2.5.29.37";c["2.5.29.46"]="freshestCRL";c["2.5.29.54"]="inhibitAnyPolicy";c["1.3.6.1.5.5.7.3.1"]="serverAuth";c.serverAuth="1.3.6.1.5.5.7.3.1";c["1.3.6.1.5.5.7.3.2"]="clientAuth";c.clientAuth="1.3.6.1.5.5.7.3.2";c["1.3.6.1.5.5.7.3.3"]="codeSigning";c.codeSigning="1.3.6.1.5.5.7.3.3";c["1.3.6.1.5.5.7.3.4"]="emailProtection";
242
-c.emailProtection="1.3.6.1.5.5.7.3.4";c["1.3.6.1.5.5.7.3.8"]="timeStamping";c.timeStamping="1.3.6.1.5.5.7.3.8"}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.oids)return b.oids;b.defined.oids=!0;for(var k=0;k<e.length;++k)e[k](b);return b.oids}},
243
-r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/oids",["require","module"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1=c.asn1||{};b.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};b.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,
244
-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};b.create=function(a,b,d,g){if(c.util.isArray(g)){for(var e=[],n=0;n<g.length;++n)void 0!==g[n]&&e.push(g[n]);g=e}return{tagClass:a,type:b,constructed:d,composed:d||c.util.isArray(g),value:g}};var d=b.getBerValueLength=function(a){var c=a.getByte();if(128!==c)return c&128?a.getInt((c&127)<<3):c};b.fromDer=function(a,e){void 0===e&&(e=!0);
245
-"string"===typeof a&&(a=c.util.createBuffer(a));if(2>a.length()){var h=Error("Too few bytes to parse DER.");h.bytes=a.length();throw h;}var g=a.getByte(),h=g&192,f=g&31,n=d(a);if(a.length()<n){if(e)throw h=Error("Too few bytes to read ASN.1 value."),h.detail=a.length()+" < "+n,h;n=a.length()}var F,w=32===(g&32);F=w;if(!F&&h===b.Class.UNIVERSAL&&f===b.Type.BITSTRING&&1<n){var y=a.read;if(0===a.getByte()&&(g=a.getByte(),g&=192,g===b.Class.UNIVERSAL||g===b.Class.CONTEXT_SPECIFIC))try{if(F=d(a)===n-(a.read-
246
-y))++y,--n}catch(D){}a.read=y}if(F)if(F=[],void 0===n)for(;;){if(a.bytes(2)===String.fromCharCode(0,0)){a.getBytes(2);break}F.push(b.fromDer(a,e))}else for(y=a.length();0<n;)F.push(b.fromDer(a,e)),n-=y-a.length(),y=a.length();else{if(void 0===n){if(e)throw Error("Non-constructed ASN.1 object of indefinite length.");n=a.length()}if(f===b.Type.BMPSTRING)for(F="",y=0;y<n;y+=2)F+=String.fromCharCode(a.getInt16());else F=a.getBytes(n)}return b.create(h,f,w,F)};b.toDer=function(a){var d=c.util.createBuffer(),
247
-h=a.tagClass|a.type,g=c.util.createBuffer();if(a.composed){a.constructed?h|=32:g.putByte(0);for(var e=0;e<a.value.length;++e)void 0!==a.value[e]&&g.putBuffer(b.toDer(a.value[e]))}else if(a.type===b.Type.BMPSTRING)for(e=0;e<a.value.length;++e)g.putInt16(a.value.charCodeAt(e));else g.putBytes(a.value);d.putByte(h);if(127>=g.length())d.putByte(g.length()&127);else{e=g.length();a="";do a+=String.fromCharCode(e&255),e>>>=8;while(0<e);d.putByte(a.length|128);for(e=a.length-1;0<=e;--e)d.putByte(a.charCodeAt(e))}d.putBuffer(g);
248
-return d};b.oidToDer=function(a){a=a.split(".");var b=c.util.createBuffer();b.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var d,g,e,n,k=2;k<a.length;++k){d=!0;g=[];e=parseInt(a[k],10);do n=e&127,e>>>=7,d||(n|=128),g.push(n),d=!1;while(0<e);for(d=g.length-1;0<=d;--d)b.putByte(g[d])}return b};b.derToOid=function(a){var b;"string"===typeof a&&(a=c.util.createBuffer(a));var d=a.getByte();b=Math.floor(d/40)+"."+d%40;for(var g=0;0<a.length();)d=a.getByte(),g<<=7,d&128?g+=d&127:(b+="."+(g+d),g=0);
249
-return b};b.utcTimeToDate=function(a){var c=new Date,b=parseInt(a.substr(0,2),10),b=50<=b?1900+b:2E3+b,d=parseInt(a.substr(2,2),10)-1,l=parseInt(a.substr(4,2),10),e=parseInt(a.substr(6,2),10),k=parseInt(a.substr(8,2),10),f=0;if(11<a.length){var v=a.charAt(10),D=10;"+"!==v&&"-"!==v&&(f=parseInt(a.substr(10,2),10),D+=2)}c.setUTCFullYear(b,d,l);c.setUTCHours(e,k,f,0);D&&(v=a.charAt(D),"+"===v||"-"===v)&&(b=parseInt(a.substr(D+1,2),10),a=parseInt(a.substr(D+4,2),10),a=6E4*(60*b+a),"+"===v?c.setTime(+c-
250
-a):c.setTime(+c+a));return c};b.generalizedTimeToDate=function(a){var c=new Date,b=parseInt(a.substr(0,4),10),d=parseInt(a.substr(4,2),10)-1,l=parseInt(a.substr(6,2),10),e=parseInt(a.substr(8,2),10),k=parseInt(a.substr(10,2),10),f=parseInt(a.substr(12,2),10),v=0,D=0,A=!1;"Z"===a.charAt(a.length-1)&&(A=!0);var m=a.length-5,z=a.charAt(m);if("+"===z||"-"===z)D=parseInt(a.substr(m+1,2),10),m=parseInt(a.substr(m+4,2),10),D=6E4*(60*D+m),"+"===z&&(D*=-1),A=!0;"."===a.charAt(14)&&(v=1E3*parseFloat(a.substr(14),
251
-10));A?(c.setUTCFullYear(b,d,l),c.setUTCHours(e,k,f,v),c.setTime(+c+D)):(c.setFullYear(b,d,l),c.setHours(e,k,f,v));return c};b.dateToUtcTime=function(a){if("string"===typeof a)return a;var c="",b=[];b.push((""+a.getUTCFullYear()).substr(2));b.push(""+(a.getUTCMonth()+1));b.push(""+a.getUTCDate());b.push(""+a.getUTCHours());b.push(""+a.getUTCMinutes());b.push(""+a.getUTCSeconds());for(a=0;a<b.length;++a)2>b[a].length&&(c+="0"),c+=b[a];return c+"Z"};b.dateToGeneralizedTime=function(a){if("string"===
243
+c.emailProtection="1.3.6.1.5.5.7.3.4";c["1.3.6.1.5.5.7.3.8"]="timeStamping";c.timeStamping="1.3.6.1.5.5.7.3.8"}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.oids)return b.oids;b.defined.oids=!0;for(var l=0;l<e.length;++l)e[l](b);return b.oids}},
244
+u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/oids",["require","module"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1=c.asn1||{};b.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192};b.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,
245
+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};b.create=function(a,b,d,h){if(c.util.isArray(h)){for(var e=[],l=0;l<h.length;++l)void 0!==h[l]&&e.push(h[l]);h=e}return{tagClass:a,type:b,constructed:d,composed:d||c.util.isArray(h),value:h}};var d=b.getBerValueLength=function(a){var c=a.getByte();if(128!==c)return c&128?a.getInt((c&127)<<3):c};b.fromDer=function(a,e){void 0===e&&(e=!0);
246
+"string"===typeof a&&(a=c.util.createBuffer(a));if(2>a.length()){var k=Error("Too few bytes to parse DER.");k.bytes=a.length();throw k;}var h=a.getByte(),k=h&192,g=h&31,p=d(a);if(a.length()<p){if(e)throw k=Error("Too few bytes to read ASN.1 value."),k.detail=a.length()+" < "+p,k;p=a.length()}var F,y=32===(h&32);F=y;if(!F&&k===b.Class.UNIVERSAL&&g===b.Type.BITSTRING&&1<p){var z=a.read;if(0===a.getByte()&&(h=a.getByte(),h&=192,h===b.Class.UNIVERSAL||h===b.Class.CONTEXT_SPECIFIC))try{if(F=d(a)===p-(a.read-
247
+z))++z,--p}catch(A){}a.read=z}if(F)if(F=[],void 0===p)for(;;){if(a.bytes(2)===String.fromCharCode(0,0)){a.getBytes(2);break}F.push(b.fromDer(a,e))}else for(z=a.length();0<p;)F.push(b.fromDer(a,e)),p-=z-a.length(),z=a.length();else{if(void 0===p){if(e)throw Error("Non-constructed ASN.1 object of indefinite length.");p=a.length()}if(g===b.Type.BMPSTRING)for(F="",z=0;z<p;z+=2)F+=String.fromCharCode(a.getInt16());else F=a.getBytes(p)}return b.create(k,g,y,F)};b.toDer=function(a){var d=c.util.createBuffer(),
248
+k=a.tagClass|a.type,h=c.util.createBuffer();if(a.composed){a.constructed?k|=32:h.putByte(0);for(var e=0;e<a.value.length;++e)void 0!==a.value[e]&&h.putBuffer(b.toDer(a.value[e]))}else if(a.type===b.Type.BMPSTRING)for(e=0;e<a.value.length;++e)h.putInt16(a.value.charCodeAt(e));else h.putBytes(a.value);d.putByte(k);if(127>=h.length())d.putByte(h.length()&127);else{e=h.length();a="";do a+=String.fromCharCode(e&255),e>>>=8;while(0<e);d.putByte(a.length|128);for(e=a.length-1;0<=e;--e)d.putByte(a.charCodeAt(e))}d.putBuffer(h);
249
+return d};b.oidToDer=function(a){a=a.split(".");var b=c.util.createBuffer();b.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var d,h,e,l,g=2;g<a.length;++g){d=!0;h=[];e=parseInt(a[g],10);do l=e&127,e>>>=7,d||(l|=128),h.push(l),d=!1;while(0<e);for(d=h.length-1;0<=d;--d)b.putByte(h[d])}return b};b.derToOid=function(a){var b;"string"===typeof a&&(a=c.util.createBuffer(a));var d=a.getByte();b=Math.floor(d/40)+"."+d%40;for(var h=0;0<a.length();)d=a.getByte(),h<<=7,d&128?h+=d&127:(b+="."+(h+d),h=0);
250
+return b};b.utcTimeToDate=function(a){var c=new Date,b=parseInt(a.substr(0,2),10),b=50<=b?1900+b:2E3+b,d=parseInt(a.substr(2,2),10)-1,m=parseInt(a.substr(4,2),10),e=parseInt(a.substr(6,2),10),l=parseInt(a.substr(8,2),10),g=0;if(11<a.length){var w=a.charAt(10),A=10;"+"!==w&&"-"!==w&&(g=parseInt(a.substr(10,2),10),A+=2)}c.setUTCFullYear(b,d,m);c.setUTCHours(e,l,g,0);A&&(w=a.charAt(A),"+"===w||"-"===w)&&(b=parseInt(a.substr(A+1,2),10),a=parseInt(a.substr(A+4,2),10),a=6E4*(60*b+a),"+"===w?c.setTime(+c-
251
+a):c.setTime(+c+a));return c};b.generalizedTimeToDate=function(a){var c=new Date,b=parseInt(a.substr(0,4),10),d=parseInt(a.substr(4,2),10)-1,m=parseInt(a.substr(6,2),10),e=parseInt(a.substr(8,2),10),l=parseInt(a.substr(10,2),10),g=parseInt(a.substr(12,2),10),w=0,A=0,D=!1;"Z"===a.charAt(a.length-1)&&(D=!0);var N=a.length-5,x=a.charAt(N);if("+"===x||"-"===x)A=parseInt(a.substr(N+1,2),10),N=parseInt(a.substr(N+4,2),10),A=6E4*(60*A+N),"+"===x&&(A*=-1),D=!0;"."===a.charAt(14)&&(w=1E3*parseFloat(a.substr(14),
252
+10));D?(c.setUTCFullYear(b,d,m),c.setUTCHours(e,l,g,w),c.setTime(+c+A)):(c.setFullYear(b,d,m),c.setHours(e,l,g,w));return c};b.dateToUtcTime=function(a){if("string"===typeof a)return a;var c="",b=[];b.push((""+a.getUTCFullYear()).substr(2));b.push(""+(a.getUTCMonth()+1));b.push(""+a.getUTCDate());b.push(""+a.getUTCHours());b.push(""+a.getUTCMinutes());b.push(""+a.getUTCSeconds());for(a=0;a<b.length;++a)2>b[a].length&&(c+="0"),c+=b[a];return c+"Z"};b.dateToGeneralizedTime=function(a){if("string"===
253
typeof a)return a;var c="",b=[];b.push(""+a.getUTCFullYear());b.push(""+(a.getUTCMonth()+1));b.push(""+a.getUTCDate());b.push(""+a.getUTCHours());b.push(""+a.getUTCMinutes());b.push(""+a.getUTCSeconds());for(a=0;a<b.length;++a)2>b[a].length&&(c+="0"),c+=b[a];return c+"Z"};b.integerToDer=function(a){var b=c.util.createBuffer();if(-128<=a&&128>a)return b.putSignedInt(a,8);if(-32768<=a&&32768>a)return b.putSignedInt(a,16);if(-8388608<=a&&8388608>a)return b.putSignedInt(a,24);if(-2147483648<=a&&2147483648>
253
-a)return b.putSignedInt(a,32);b=Error("Integer too large; max is 32-bits.");b.integer=a;throw b;};b.derToInteger=function(a){"string"===typeof a&&(a=c.util.createBuffer(a));var b=8*a.length();if(32<b)throw Error("Integer too large; max is 32-bits.");return a.getSignedInt(b)};b.validate=function(a,d,h,g){var e=!1;if(a.tagClass!==d.tagClass&&"undefined"!==typeof d.tagClass||a.type!==d.type&&"undefined"!==typeof d.type)g&&(a.tagClass!==d.tagClass&&g.push("["+d.name+'] Expected tag class "'+d.tagClass+
254
-'", got "'+a.tagClass+'"'),a.type!==d.type&&g.push("["+d.name+'] Expected type "'+d.type+'", got "'+a.type+'"'));else if(a.constructed===d.constructed||"undefined"===typeof d.constructed){e=!0;if(d.value&&c.util.isArray(d.value))for(var n=0,f=0;e&&f<d.value.length;++f)e=d.value[f].optional||!1,a.value[n]&&((e=b.validate(a.value[n],d.value[f],h,g))?++n:d.value[f].optional&&(e=!0)),!e&&g&&g.push("["+d.name+'] Tag class "'+d.tagClass+'", type "'+d.type+'" expected value length "'+d.value.length+'", got "'+
255
-a.value.length+'"');e&&h&&(d.capture&&(h[d.capture]=a.value),d.captureAsn1&&(h[d.captureAsn1]=a))}else g&&g.push("["+d.name+'] Expected constructed "'+d.constructed+'", got "'+a.constructed+'"');return e};var e=/[^\\u0000-\\u00ff]/;b.prettyPrint=function(a,d,h){var g="";d=d||0;h=h||2;0<d&&(g+="\n");for(var f="",n=0;n<d*h;++n)f+=" ";g+=f+"Tag: ";switch(a.tagClass){case b.Class.UNIVERSAL:g+="Universal:";break;case b.Class.APPLICATION:g+="Application:";break;case b.Class.CONTEXT_SPECIFIC:g+="Context-Specific:";
256
-break;case b.Class.PRIVATE:g+="Private:"}if(a.tagClass===b.Class.UNIVERSAL)switch(g+=a.type,a.type){case b.Type.NONE:g+=" (None)";break;case b.Type.BOOLEAN:g+=" (Boolean)";break;case b.Type.BITSTRING:g+=" (Bit string)";break;case b.Type.INTEGER:g+=" (Integer)";break;case b.Type.OCTETSTRING:g+=" (Octet string)";break;case b.Type.NULL:g+=" (Null)";break;case b.Type.OID:g+=" (Object Identifier)";break;case b.Type.ODESC:g+=" (Object Descriptor)";break;case b.Type.EXTERNAL:g+=" (External or Instance of)";
257
-break;case b.Type.REAL:g+=" (Real)";break;case b.Type.ENUMERATED:g+=" (Enumerated)";break;case b.Type.EMBEDDED:g+=" (Embedded PDV)";break;case b.Type.UTF8:g+=" (UTF8)";break;case b.Type.ROID:g+=" (Relative Object Identifier)";break;case b.Type.SEQUENCE:g+=" (Sequence)";break;case b.Type.SET:g+=" (Set)";break;case b.Type.PRINTABLESTRING:g+=" (Printable String)";break;case b.Type.IA5String:g+=" (IA5String (ASCII))";break;case b.Type.UTCTIME:g+=" (UTC time)";break;case b.Type.GENERALIZEDTIME:g+=" (Generalized time)";
258
-break;case b.Type.BMPSTRING:g+=" (BMP String)"}else g+=a.type;g=g+"\n"+(f+"Constructed: "+a.constructed+"\n");if(a.composed){for(var v=0,w="",n=0;n<a.value.length;++n)void 0!==a.value[n]&&(v+=1,w+=b.prettyPrint(a.value[n],d+1,h),n+1<a.value.length&&(w+=","));g+=f+"Sub values: "+v+w}else if(g+=f+"Value: ",a.type===b.Type.OID&&(d=b.derToOid(a.value),g+=d,c.pki&&c.pki.oids&&d in c.pki.oids&&(g+=" ("+c.pki.oids[d]+") ")),a.type===b.Type.INTEGER)try{g+=b.derToInteger(a.value)}catch(y){g+="0x"+c.util.bytesToHex(a.value)}else a.type===
259
-b.Type.OCTETSTRING?(e.test(a.value)||(g+="("+a.value+") "),g+="0x"+c.util.bytesToHex(a.value)):g=a.type===b.Type.UTF8?g+c.util.decodeUtf8(a.value):a.type===b.Type.PRINTABLESTRING||a.type===b.Type.IA5String?g+a.value:e.test(a.value)?g+("0x"+c.util.bytesToHex(a.value)):0===a.value.length?g+"[null]":g+a.value;return g}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,
260
-b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.asn1)return b.asn1;b.defined.asn1=!0;for(var k=0;k<e.length;++k)e[k](b);return b.asn1}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/asn1",["require","module","./util","./oids"],function(){p.apply(null,Array.prototype.slice.call(arguments,
261
-0))})})();(function(){function a(c){function b(){f=String.fromCharCode(128);f+=c.util.fillString(String.fromCharCode(0),64);B=[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];h=[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 a=0;64>a;++a)g[a]=Math.floor(4294967296*
262
-Math.abs(Math.sin(a+1)));E=!0}function d(a,c,b){for(var l,e,k,f,z,C,x,v=b.length();64<=v;){e=a.h0;k=a.h1;f=a.h2;z=a.h3;for(x=0;16>x;++x)c[x]=b.getInt32Le(),l=z^k&(f^z),l=e+l+g[x]+c[x],C=h[x],e=z,z=f,f=k,k+=l<<C|l>>>32-C;for(;32>x;++x)l=f^z&(k^f),l=e+l+g[x]+c[B[x]],C=h[x],e=z,z=f,f=k,k+=l<<C|l>>>32-C;for(;48>x;++x)l=k^f^z,l=e+l+g[x]+c[B[x]],C=h[x],e=z,z=f,f=k,k+=l<<C|l>>>32-C;for(;64>x;++x)l=f^(k|~z),l=e+l+g[x]+c[B[x]],C=h[x],e=z,z=f,f=k,k+=l<<C|l>>>32-C;a.h0=a.h0+e|0;a.h1=a.h1+k|0;a.h2=a.h2+f|0;a.h3=
263
-a.h3+z|0;v-=64}}var e=c.md5=c.md5||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.md5=c.md.algorithms.md5=e;e.create=function(){E||b();var a=null,h=c.util.createBuffer(),g=Array(16),e={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){e.messageLength=0;e.fullMessageLength=e.messageLength64=[];for(var b=e.messageLengthSize/4,d=0;d<b;++d)e.fullMessageLength.push(0);h=c.util.createBuffer();a={h0:1732584193,h1:4023233417,
264
-h2:2562383102,h3:271733878};return e}};e.start();e.update=function(b,k){"utf8"===k&&(b=c.util.encodeUtf8(b));var f=b.length;e.messageLength+=f;for(var f=[f/4294967296>>>0,f>>>0],z=e.fullMessageLength.length-1;0<=z;--z)e.fullMessageLength[z]+=f[1],f[1]=f[0]+(e.fullMessageLength[z]/4294967296>>>0),e.fullMessageLength[z]>>>=0,f[0]=f[1]/4294967296>>>0;h.putBytes(b);d(a,g,h);(2048<h.read||0===h.length())&&h.compact();return e};e.digest=function(){var b=c.util.createBuffer();b.putBytes(h.bytes());b.putBytes(f.substr(0,
265
-e.blockLength-(e.fullMessageLength[e.fullMessageLength.length-1]+e.messageLengthSize&e.blockLength-1)));for(var k,E=0,z=e.fullMessageLength.length-1;0<=z;--z)k=8*e.fullMessageLength[z]+E,E=k/4294967296>>>0,b.putInt32Le(k>>>0);k={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3};d(k,g,b);b=c.util.createBuffer();b.putInt32Le(k.h0);b.putInt32Le(k.h1);b.putInt32Le(k.h2);b.putInt32Le(k.h3);return b};return e};var f=null,B=null,h=null,g=null,E=!1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=
266
-!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.md5)return b.md5;b.defined.md5=!0;for(var k=0;k<e.length;++k)e[k](b);return b.md5}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,
267
-0))};c("js/md5",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var l,e,k,f,v,u,A,m,z=d.length();64<=z;){e=a.h0;k=a.h1;f=a.h2;v=a.h3;u=a.h4;for(m=0;16>m;++m)l=d.getInt32(),c[m]=l,A=v^k&(f^v),l=(e<<5|e>>>27)+A+u+1518500249+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;for(;20>m;++m)l=c[m-3]^c[m-8]^c[m-14]^c[m-16],l=l<<1|l>>>31,c[m]=l,A=v^k&(f^v),l=(e<<5|e>>>27)+A+u+1518500249+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;for(;32>
268
-m;++m)l=c[m-3]^c[m-8]^c[m-14]^c[m-16],l=l<<1|l>>>31,c[m]=l,A=k^f^v,l=(e<<5|e>>>27)+A+u+1859775393+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;for(;40>m;++m)l=c[m-6]^c[m-16]^c[m-28]^c[m-32],l=l<<2|l>>>30,c[m]=l,A=k^f^v,l=(e<<5|e>>>27)+A+u+1859775393+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;for(;60>m;++m)l=c[m-6]^c[m-16]^c[m-28]^c[m-32],l=l<<2|l>>>30,c[m]=l,A=k&f|v&(k^f),l=(e<<5|e>>>27)+A+u+2400959708+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;for(;80>m;++m)l=c[m-6]^c[m-16]^c[m-28]^c[m-32],l=l<<2|l>>>30,c[m]=l,A=k^f^v,l=(e<<5|e>>>
269
-27)+A+u+3395469782+l,u=v,v=f,f=k<<30|k>>>2,k=e,e=l;a.h0=a.h0+e|0;a.h1=a.h1+k|0;a.h2=a.h2+f|0;a.h3=a.h3+v|0;a.h4=a.h4+u|0;z-=64}}var d=c.sha1=c.sha1||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha1=c.md.algorithms.sha1=d;d.create=function(){f||(e=String.fromCharCode(128),e+=c.util.fillString(String.fromCharCode(0),64),f=!0);var a=null,d=c.util.createBuffer(),g=Array(80),v={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){v.messageLength=
270
-0;v.fullMessageLength=v.messageLength64=[];for(var b=v.messageLengthSize/4,g=0;g<b;++g)v.fullMessageLength.push(0);d=c.util.createBuffer();a={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520};return v}};v.start();v.update=function(e,f){"utf8"===f&&(e=c.util.encodeUtf8(e));var u=e.length;v.messageLength+=u;for(var u=[u/4294967296>>>0,u>>>0],y=v.fullMessageLength.length-1;0<=y;--y)v.fullMessageLength[y]+=u[1],u[1]=u[0]+(v.fullMessageLength[y]/4294967296>>>0),v.fullMessageLength[y]>>>=
271
-0,u[0]=u[1]/4294967296>>>0;d.putBytes(e);b(a,g,d);(2048<d.read||0===d.length())&&d.compact();return v};v.digest=function(){var n=c.util.createBuffer();n.putBytes(d.bytes());n.putBytes(e.substr(0,v.blockLength-(v.fullMessageLength[v.fullMessageLength.length-1]+v.messageLengthSize&v.blockLength-1)));c.util.createBuffer();for(var f,u,y=8*v.fullMessageLength[0],D=0;D<v.fullMessageLength.length;++D)f=8*v.fullMessageLength[D+1],u=f/4294967296>>>0,y+=u,n.putInt32(y>>>0),y=f;f={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,
272
-h4:a.h4};b(f,g,n);n=c.util.createBuffer();n.putInt32(f.h0);n.putInt32(f.h1);n.putInt32(f.h2);n.putInt32(f.h3);n.putInt32(f.h4);return n};return v};var e=null,f=!1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha1)return b.sha1;b.defined.sha1=
273
-!0;for(var k=0;k<e.length;++k)e[k](b);return b.sha1}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha1",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var l,e,k,f,v,u,L,z,C,x,I,p,q,r=d.length();64<=r;){for(v=0;16>v;++v)c[v]=d.getInt32();
274
-for(;64>v;++v)l=c[v-2],l=(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10,e=c[v-15],e=(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,c[v]=l+c[v-7]+e+c[v-16]|0;u=a.h0;L=a.h1;z=a.h2;C=a.h3;x=a.h4;I=a.h5;p=a.h6;q=a.h7;for(v=0;64>v;++v)l=(x>>>6|x<<26)^(x>>>11|x<<21)^(x>>>25|x<<7),k=p^x&(I^p),e=(u>>>2|u<<30)^(u>>>13|u<<19)^(u>>>22|u<<10),f=u&L|z&(u^L),l=q+l+k+m[v]+c[v],e+=f,q=p,p=I,I=x,x=C+l|0,C=z,z=L,L=u,u=l+e|0;a.h0=a.h0+u|0;a.h1=a.h1+L|0;a.h2=a.h2+z|0;a.h3=a.h3+C|0;a.h4=a.h4+x|0;a.h5=a.h5+I|0;a.h6=a.h6+p|0;a.h7=a.h7+q|0;r-=
275
-64}}var d=c.sha256=c.sha256||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha256=c.md.algorithms.sha256=d;d.create=function(){f||(e=String.fromCharCode(128),e+=c.util.fillString(String.fromCharCode(0),64),m=[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,
276
-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],f=!0);var a=null,d=c.util.createBuffer(),v=Array(64),n={algorithm:"sha256",blockLength:64,digestLength:32,
277
-messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){n.messageLength=0;n.fullMessageLength=n.messageLength64=[];for(var b=n.messageLengthSize/4,e=0;e<b;++e)n.fullMessageLength.push(0);d=c.util.createBuffer();a={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225};return n}};n.start();n.update=function(e,f){"utf8"===f&&(e=c.util.encodeUtf8(e));var u=e.length;n.messageLength+=u;for(var u=[u/4294967296>>>0,u>>>0],m=n.fullMessageLength.length-
278
-1;0<=m;--m)n.fullMessageLength[m]+=u[1],u[1]=u[0]+(n.fullMessageLength[m]/4294967296>>>0),n.fullMessageLength[m]>>>=0,u[0]=u[1]/4294967296>>>0;d.putBytes(e);b(a,v,d);(2048<d.read||0===d.length())&&d.compact();return n};n.digest=function(){var f=c.util.createBuffer();f.putBytes(d.bytes());f.putBytes(e.substr(0,n.blockLength-(n.fullMessageLength[n.fullMessageLength.length-1]+n.messageLengthSize&n.blockLength-1)));c.util.createBuffer();for(var u,y,m=8*n.fullMessageLength[0],A=0;A<n.fullMessageLength.length;++A)u=
279
-8*n.fullMessageLength[A+1],y=u/4294967296>>>0,m+=y,f.putInt32(m>>>0),m=u;u={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};b(u,v,f);f=c.util.createBuffer();f.putInt32(u.h0);f.putInt32(u.h1);f.putInt32(u.h2);f.putInt32(u.h3);f.putInt32(u.h4);f.putInt32(u.h5);f.putInt32(u.h6);f.putInt32(u.h7);return f};return n};var e=null,f=!1,m=null}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge=
280
-{}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha256)return b.sha256;b.defined.sha256=!0;for(var k=0;k<e.length;++k)e[k](b);return b.sha256}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha256",["require","module","./util"],function(){p.apply(null,
281
-Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var l,e,g,k,f,z,C,x,u,v,q,m,B,J,S,K,p,r,T,R,V,P,H,G,N,Y=d.length();128<=Y;){for(N=0;16>N;++N)c[N][0]=d.getInt32()>>>0,c[N][1]=d.getInt32()>>>0;for(;80>N;++N)f=c[N-2],u=f[0],f=f[1],l=((u>>>19|f<<13)^(f>>>29|u<<3)^u>>>6)>>>0,e=((u<<13|f>>>19)^(f<<3|u>>>29)^(u<<26|f>>>6))>>>0,f=c[N-15],u=f[0],f=f[1],g=((u>>>1|f<<31)^(u>>>8|f<<24)^u>>>7)>>>0,k=((u<<31|f>>>1)^(u<<24|f>>>8)^(u<<25|f>>>7))>>>0,u=c[N-7],v=c[N-16],
282
-f=e+u[1]+k+v[1],c[N][0]=l+u[0]+g+v[0]+(f/4294967296>>>0)>>>0,c[N][1]=f>>>0;u=a[0][0];v=a[0][1];q=a[1][0];m=a[1][1];B=a[2][0];J=a[2][1];S=a[3][0];K=a[3][1];p=a[4][0];r=a[4][1];T=a[5][0];R=a[5][1];V=a[6][0];P=a[6][1];H=a[7][0];G=a[7][1];for(N=0;80>N;++N)l=((p>>>14|r<<18)^(p>>>18|r<<14)^(r>>>9|p<<23))>>>0,f=((p<<18|r>>>14)^(p<<14|r>>>18)^(r<<23|p>>>9))>>>0,e=(V^p&(T^V))>>>0,z=(P^r&(R^P))>>>0,g=((u>>>28|v<<4)^(v>>>2|u<<30)^(v>>>7|u<<25))>>>0,k=((u<<4|v>>>28)^(v<<30|u>>>2)^(v<<25|u>>>7))>>>0,C=(u&q|B&
283
-(u^q))>>>0,x=(v&m|J&(v^m))>>>0,f=G+f+z+h[N][1]+c[N][1],l=H+l+e+h[N][0]+c[N][0]+(f/4294967296>>>0)>>>0,e=f>>>0,f=k+x,g=g+C+(f/4294967296>>>0)>>>0,k=f>>>0,H=V,G=P,V=T,P=R,T=p,R=r,f=K+e,p=S+l+(f/4294967296>>>0)>>>0,r=f>>>0,S=B,K=J,B=q,J=m,q=u,m=v,f=e+k,u=l+g+(f/4294967296>>>0)>>>0,v=f>>>0;f=a[0][1]+v;a[0][0]=a[0][0]+u+(f/4294967296>>>0)>>>0;a[0][1]=f>>>0;f=a[1][1]+m;a[1][0]=a[1][0]+q+(f/4294967296>>>0)>>>0;a[1][1]=f>>>0;f=a[2][1]+J;a[2][0]=a[2][0]+B+(f/4294967296>>>0)>>>0;a[2][1]=f>>>0;f=a[3][1]+K;a[3][0]=
284
-a[3][0]+S+(f/4294967296>>>0)>>>0;a[3][1]=f>>>0;f=a[4][1]+r;a[4][0]=a[4][0]+p+(f/4294967296>>>0)>>>0;a[4][1]=f>>>0;f=a[5][1]+R;a[5][0]=a[5][0]+T+(f/4294967296>>>0)>>>0;a[5][1]=f>>>0;f=a[6][1]+P;a[6][0]=a[6][0]+V+(f/4294967296>>>0)>>>0;a[6][1]=f>>>0;f=a[7][1]+G;a[7][0]=a[7][0]+H+(f/4294967296>>>0)>>>0;a[7][1]=f>>>0;Y-=128}}var d=c.sha512=c.sha512||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha512=c.md.algorithms.sha512=d;var e=c.sha384=c.sha512.sha384=c.sha512.sha384||{};e.create=function(){return d.create("SHA-384")};
285
-c.md.sha384=c.md.algorithms.sha384=e;c.sha512.sha256=c.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};c.md["sha512/256"]=c.md.algorithms["sha512/256"]=c.sha512.sha256;c.sha512.sha224=c.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};c.md["sha512/224"]=c.md.algorithms["sha512/224"]=c.sha512.sha224;d.create=function(a){m||(f=String.fromCharCode(128),f+=c.util.fillString(String.fromCharCode(0),128),h=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],
254
+a)return b.putSignedInt(a,32);b=Error("Integer too large; max is 32-bits.");b.integer=a;throw b;};b.derToInteger=function(a){"string"===typeof a&&(a=c.util.createBuffer(a));var b=8*a.length();if(32<b)throw Error("Integer too large; max is 32-bits.");return a.getSignedInt(b)};b.validate=function(a,d,e,h){var g=!1;if(a.tagClass!==d.tagClass&&"undefined"!==typeof d.tagClass||a.type!==d.type&&"undefined"!==typeof d.type)h&&(a.tagClass!==d.tagClass&&h.push("["+d.name+'] Expected tag class "'+d.tagClass+
255
+'", got "'+a.tagClass+'"'),a.type!==d.type&&h.push("["+d.name+'] Expected type "'+d.type+'", got "'+a.type+'"'));else if(a.constructed===d.constructed||"undefined"===typeof d.constructed){g=!0;if(d.value&&c.util.isArray(d.value))for(var p=0,w=0;g&&w<d.value.length;++w)g=d.value[w].optional||!1,a.value[p]&&((g=b.validate(a.value[p],d.value[w],e,h))?++p:d.value[w].optional&&(g=!0)),!g&&h&&h.push("["+d.name+'] Tag class "'+d.tagClass+'", type "'+d.type+'" expected value length "'+d.value.length+'", got "'+
256
+a.value.length+'"');g&&e&&(d.capture&&(e[d.capture]=a.value),d.captureAsn1&&(e[d.captureAsn1]=a))}else h&&h.push("["+d.name+'] Expected constructed "'+d.constructed+'", got "'+a.constructed+'"');return g};var e=/[^\\u0000-\\u00ff]/;b.prettyPrint=function(a,d,k){var h="";d=d||0;k=k||2;0<d&&(h+="\n");for(var g="",p=0;p<d*k;++p)g+=" ";h+=g+"Tag: ";switch(a.tagClass){case b.Class.UNIVERSAL:h+="Universal:";break;case b.Class.APPLICATION:h+="Application:";break;case b.Class.CONTEXT_SPECIFIC:h+="Context-Specific:";
257
+break;case b.Class.PRIVATE:h+="Private:"}if(a.tagClass===b.Class.UNIVERSAL)switch(h+=a.type,a.type){case b.Type.NONE:h+=" (None)";break;case b.Type.BOOLEAN:h+=" (Boolean)";break;case b.Type.BITSTRING:h+=" (Bit string)";break;case b.Type.INTEGER:h+=" (Integer)";break;case b.Type.OCTETSTRING:h+=" (Octet string)";break;case b.Type.NULL:h+=" (Null)";break;case b.Type.OID:h+=" (Object Identifier)";break;case b.Type.ODESC:h+=" (Object Descriptor)";break;case b.Type.EXTERNAL:h+=" (External or Instance of)";
258
+break;case b.Type.REAL:h+=" (Real)";break;case b.Type.ENUMERATED:h+=" (Enumerated)";break;case b.Type.EMBEDDED:h+=" (Embedded PDV)";break;case b.Type.UTF8:h+=" (UTF8)";break;case b.Type.ROID:h+=" (Relative Object Identifier)";break;case b.Type.SEQUENCE:h+=" (Sequence)";break;case b.Type.SET:h+=" (Set)";break;case b.Type.PRINTABLESTRING:h+=" (Printable String)";break;case b.Type.IA5String:h+=" (IA5String (ASCII))";break;case b.Type.UTCTIME:h+=" (UTC time)";break;case b.Type.GENERALIZEDTIME:h+=" (Generalized time)";
259
+break;case b.Type.BMPSTRING:h+=" (BMP String)"}else h+=a.type;h=h+"\n"+(g+"Constructed: "+a.constructed+"\n");if(a.composed){for(var w=0,y="",p=0;p<a.value.length;++p)void 0!==a.value[p]&&(w+=1,y+=b.prettyPrint(a.value[p],d+1,k),p+1<a.value.length&&(y+=","));h+=g+"Sub values: "+w+y}else if(h+=g+"Value: ",a.type===b.Type.OID&&(d=b.derToOid(a.value),h+=d,c.pki&&c.pki.oids&&d in c.pki.oids&&(h+=" ("+c.pki.oids[d]+") ")),a.type===b.Type.INTEGER)try{h+=b.derToInteger(a.value)}catch(z){h+="0x"+c.util.bytesToHex(a.value)}else a.type===
260
+b.Type.OCTETSTRING?(e.test(a.value)||(h+="("+a.value+") "),h+="0x"+c.util.bytesToHex(a.value)):h=a.type===b.Type.UTF8?h+c.util.decodeUtf8(a.value):a.type===b.Type.PRINTABLESTRING||a.type===b.Type.IA5String?h+a.value:e.test(a.value)?h+("0x"+c.util.bytesToHex(a.value)):0===a.value.length?h+"[null]":h+a.value;return h}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,
261
+b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.asn1)return b.asn1;b.defined.asn1=!0;for(var l=0;l<e.length;++l)e[l](b);return b.asn1}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/asn1",["require","module","./util","./oids"],function(){r.apply(null,Array.prototype.slice.call(arguments,
262
+0))})})();(function(){function a(c){function b(){g=String.fromCharCode(128);g+=c.util.fillString(String.fromCharCode(0),64);E=[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];k=[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];h=Array(64);for(var a=0;64>a;++a)h[a]=Math.floor(4294967296*
263
+Math.abs(Math.sin(a+1)));C=!0}function d(a,c,b){for(var m,e,l,g,x,G,B,w=b.length();64<=w;){e=a.h0;l=a.h1;g=a.h2;x=a.h3;for(B=0;16>B;++B)c[B]=b.getInt32Le(),m=x^l&(g^x),m=e+m+h[B]+c[B],G=k[B],e=x,x=g,g=l,l+=m<<G|m>>>32-G;for(;32>B;++B)m=g^x&(l^g),m=e+m+h[B]+c[E[B]],G=k[B],e=x,x=g,g=l,l+=m<<G|m>>>32-G;for(;48>B;++B)m=l^g^x,m=e+m+h[B]+c[E[B]],G=k[B],e=x,x=g,g=l,l+=m<<G|m>>>32-G;for(;64>B;++B)m=g^(l|~x),m=e+m+h[B]+c[E[B]],G=k[B],e=x,x=g,g=l,l+=m<<G|m>>>32-G;a.h0=a.h0+e|0;a.h1=a.h1+l|0;a.h2=a.h2+g|0;a.h3=
264
+a.h3+x|0;w-=64}}var e=c.md5=c.md5||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.md5=c.md.algorithms.md5=e;e.create=function(){C||b();var a=null,h=c.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 b=k.messageLengthSize/4,d=0;d<b;++d)k.fullMessageLength.push(0);h=c.util.createBuffer();a={h0:1732584193,h1:4023233417,
265
+h2:2562383102,h3:271733878};return k}};k.start();k.update=function(b,l){"utf8"===l&&(b=c.util.encodeUtf8(b));var g=b.length;k.messageLength+=g;for(var g=[g/4294967296>>>0,g>>>0],x=k.fullMessageLength.length-1;0<=x;--x)k.fullMessageLength[x]+=g[1],g[1]=g[0]+(k.fullMessageLength[x]/4294967296>>>0),k.fullMessageLength[x]>>>=0,g[0]=g[1]/4294967296>>>0;h.putBytes(b);d(a,e,h);(2048<h.read||0===h.length())&&h.compact();return k};k.digest=function(){var b=c.util.createBuffer();b.putBytes(h.bytes());b.putBytes(g.substr(0,
266
+k.blockLength-(k.fullMessageLength[k.fullMessageLength.length-1]+k.messageLengthSize&k.blockLength-1)));for(var l,C=0,x=k.fullMessageLength.length-1;0<=x;--x)l=8*k.fullMessageLength[x]+C,C=l/4294967296>>>0,b.putInt32Le(l>>>0);l={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3};d(l,e,b);b=c.util.createBuffer();b.putInt32Le(l.h0);b.putInt32Le(l.h1);b.putInt32Le(l.h2);b.putInt32Le(l.h3);return b};return k};var g=null,E=null,k=null,h=null,C=!1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=
267
+!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.md5)return b.md5;b.defined.md5=!0;for(var l=0;l<e.length;++l)e[l](b);return b.md5}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,
268
+0))};c("js/md5",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var m,e,l,g,w,v,D,n,x=d.length();64<=x;){e=a.h0;l=a.h1;g=a.h2;w=a.h3;v=a.h4;for(n=0;16>n;++n)m=d.getInt32(),c[n]=m,D=w^l&(g^w),m=(e<<5|e>>>27)+D+v+1518500249+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;for(;20>n;++n)m=c[n-3]^c[n-8]^c[n-14]^c[n-16],m=m<<1|m>>>31,c[n]=m,D=w^l&(g^w),m=(e<<5|e>>>27)+D+v+1518500249+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;for(;32>
269
+n;++n)m=c[n-3]^c[n-8]^c[n-14]^c[n-16],m=m<<1|m>>>31,c[n]=m,D=l^g^w,m=(e<<5|e>>>27)+D+v+1859775393+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;for(;40>n;++n)m=c[n-6]^c[n-16]^c[n-28]^c[n-32],m=m<<2|m>>>30,c[n]=m,D=l^g^w,m=(e<<5|e>>>27)+D+v+1859775393+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;for(;60>n;++n)m=c[n-6]^c[n-16]^c[n-28]^c[n-32],m=m<<2|m>>>30,c[n]=m,D=l&g|w&(l^g),m=(e<<5|e>>>27)+D+v+2400959708+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;for(;80>n;++n)m=c[n-6]^c[n-16]^c[n-28]^c[n-32],m=m<<2|m>>>30,c[n]=m,D=l^g^w,m=(e<<5|e>>>
270
+27)+D+v+3395469782+m,v=w,w=g,g=l<<30|l>>>2,l=e,e=m;a.h0=a.h0+e|0;a.h1=a.h1+l|0;a.h2=a.h2+g|0;a.h3=a.h3+w|0;a.h4=a.h4+v|0;x-=64}}var d=c.sha1=c.sha1||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha1=c.md.algorithms.sha1=d;d.create=function(){g||(e=String.fromCharCode(128),e+=c.util.fillString(String.fromCharCode(0),64),g=!0);var a=null,d=c.util.createBuffer(),h=Array(80),w={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){w.messageLength=
271
+0;w.fullMessageLength=w.messageLength64=[];for(var b=w.messageLengthSize/4,h=0;h<b;++h)w.fullMessageLength.push(0);d=c.util.createBuffer();a={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520};return w}};w.start();w.update=function(e,g){"utf8"===g&&(e=c.util.encodeUtf8(e));var v=e.length;w.messageLength+=v;for(var v=[v/4294967296>>>0,v>>>0],z=w.fullMessageLength.length-1;0<=z;--z)w.fullMessageLength[z]+=v[1],v[1]=v[0]+(w.fullMessageLength[z]/4294967296>>>0),w.fullMessageLength[z]>>>=
272
+0,v[0]=v[1]/4294967296>>>0;d.putBytes(e);b(a,h,d);(2048<d.read||0===d.length())&&d.compact();return w};w.digest=function(){var p=c.util.createBuffer();p.putBytes(d.bytes());p.putBytes(e.substr(0,w.blockLength-(w.fullMessageLength[w.fullMessageLength.length-1]+w.messageLengthSize&w.blockLength-1)));c.util.createBuffer();for(var g,v,z=8*w.fullMessageLength[0],A=0;A<w.fullMessageLength.length;++A)g=8*w.fullMessageLength[A+1],v=g/4294967296>>>0,z+=v,p.putInt32(z>>>0),z=g;g={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,
273
+h4:a.h4};b(g,h,p);p=c.util.createBuffer();p.putInt32(g.h0);p.putInt32(g.h1);p.putInt32(g.h2);p.putInt32(g.h3);p.putInt32(g.h4);return p};return w};var e=null,g=!1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha1)return b.sha1;b.defined.sha1=
274
+!0;for(var l=0;l<e.length;++l)e[l](b);return b.sha1}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha1",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var m,e,l,g,w,v,N,x,G,B,H,r,q,u=d.length();64<=u;){for(w=0;16>w;++w)c[w]=d.getInt32();
275
+for(;64>w;++w)m=c[w-2],m=(m>>>17|m<<15)^(m>>>19|m<<13)^m>>>10,e=c[w-15],e=(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,c[w]=m+c[w-7]+e+c[w-16]|0;v=a.h0;N=a.h1;x=a.h2;G=a.h3;B=a.h4;H=a.h5;r=a.h6;q=a.h7;for(w=0;64>w;++w)m=(B>>>6|B<<26)^(B>>>11|B<<21)^(B>>>25|B<<7),l=r^B&(H^r),e=(v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10),g=v&N|x&(v^N),m=q+m+l+n[w]+c[w],e+=g,q=r,r=H,H=B,B=G+m|0,G=x,x=N,N=v,v=m+e|0;a.h0=a.h0+v|0;a.h1=a.h1+N|0;a.h2=a.h2+x|0;a.h3=a.h3+G|0;a.h4=a.h4+B|0;a.h5=a.h5+H|0;a.h6=a.h6+r|0;a.h7=a.h7+q|0;u-=
276
+64}}var d=c.sha256=c.sha256||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha256=c.md.algorithms.sha256=d;d.create=function(){g||(e=String.fromCharCode(128),e+=c.util.fillString(String.fromCharCode(0),64),n=[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,
277
+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],g=!0);var a=null,d=c.util.createBuffer(),w=Array(64),p={algorithm:"sha256",blockLength:64,digestLength:32,
278
+messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){p.messageLength=0;p.fullMessageLength=p.messageLength64=[];for(var b=p.messageLengthSize/4,e=0;e<b;++e)p.fullMessageLength.push(0);d=c.util.createBuffer();a={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225};return p}};p.start();p.update=function(e,g){"utf8"===g&&(e=c.util.encodeUtf8(e));var v=e.length;p.messageLength+=v;for(var v=[v/4294967296>>>0,v>>>0],A=p.fullMessageLength.length-
279
+1;0<=A;--A)p.fullMessageLength[A]+=v[1],v[1]=v[0]+(p.fullMessageLength[A]/4294967296>>>0),p.fullMessageLength[A]>>>=0,v[0]=v[1]/4294967296>>>0;d.putBytes(e);b(a,w,d);(2048<d.read||0===d.length())&&d.compact();return p};p.digest=function(){var g=c.util.createBuffer();g.putBytes(d.bytes());g.putBytes(e.substr(0,p.blockLength-(p.fullMessageLength[p.fullMessageLength.length-1]+p.messageLengthSize&p.blockLength-1)));c.util.createBuffer();for(var v,z,A=8*p.fullMessageLength[0],n=0;n<p.fullMessageLength.length;++n)v=
280
+8*p.fullMessageLength[n+1],z=v/4294967296>>>0,A+=z,g.putInt32(A>>>0),A=v;v={h0:a.h0,h1:a.h1,h2:a.h2,h3:a.h3,h4:a.h4,h5:a.h5,h6:a.h6,h7:a.h7};b(v,w,g);g=c.util.createBuffer();g.putInt32(v.h0);g.putInt32(v.h1);g.putInt32(v.h2);g.putInt32(v.h3);g.putInt32(v.h4);g.putInt32(v.h5);g.putInt32(v.h6);g.putInt32(v.h7);return g};return p};var e=null,g=!1,n=null}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge=
281
+{}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha256)return b.sha256;b.defined.sha256=!0;for(var l=0;l<e.length;++l)e[l](b);return b.sha256}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha256",["require","module","./util"],function(){r.apply(null,
282
+Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){for(var m,e,h,l,g,x,G,w,v,n,q,E,r,K,S,L,R,u,V,U,X,T,J,I,O,Y=d.length();128<=Y;){for(O=0;16>O;++O)c[O][0]=d.getInt32()>>>0,c[O][1]=d.getInt32()>>>0;for(;80>O;++O)g=c[O-2],v=g[0],g=g[1],m=((v>>>19|g<<13)^(g>>>29|v<<3)^v>>>6)>>>0,e=((v<<13|g>>>19)^(g<<3|v>>>29)^(v<<26|g>>>6))>>>0,g=c[O-15],v=g[0],g=g[1],h=((v>>>1|g<<31)^(v>>>8|g<<24)^v>>>7)>>>0,l=((v<<31|g>>>1)^(v<<24|g>>>8)^(v<<25|g>>>7))>>>0,v=c[O-7],n=c[O-16],
283
+g=e+v[1]+l+n[1],c[O][0]=m+v[0]+h+n[0]+(g/4294967296>>>0)>>>0,c[O][1]=g>>>0;v=a[0][0];n=a[0][1];q=a[1][0];E=a[1][1];r=a[2][0];K=a[2][1];S=a[3][0];L=a[3][1];R=a[4][0];u=a[4][1];V=a[5][0];U=a[5][1];X=a[6][0];T=a[6][1];J=a[7][0];I=a[7][1];for(O=0;80>O;++O)m=((R>>>14|u<<18)^(R>>>18|u<<14)^(u>>>9|R<<23))>>>0,g=((R<<18|u>>>14)^(R<<14|u>>>18)^(u<<23|R>>>9))>>>0,e=(X^R&(V^X))>>>0,x=(T^u&(U^T))>>>0,h=((v>>>28|n<<4)^(n>>>2|v<<30)^(n>>>7|v<<25))>>>0,l=((v<<4|n>>>28)^(n<<30|v>>>2)^(n<<25|v>>>7))>>>0,G=(v&q|r&
284
+(v^q))>>>0,w=(n&E|K&(n^E))>>>0,g=I+g+x+k[O][1]+c[O][1],m=J+m+e+k[O][0]+c[O][0]+(g/4294967296>>>0)>>>0,e=g>>>0,g=l+w,h=h+G+(g/4294967296>>>0)>>>0,l=g>>>0,J=X,I=T,X=V,T=U,V=R,U=u,g=L+e,R=S+m+(g/4294967296>>>0)>>>0,u=g>>>0,S=r,L=K,r=q,K=E,q=v,E=n,g=e+l,v=m+h+(g/4294967296>>>0)>>>0,n=g>>>0;g=a[0][1]+n;a[0][0]=a[0][0]+v+(g/4294967296>>>0)>>>0;a[0][1]=g>>>0;g=a[1][1]+E;a[1][0]=a[1][0]+q+(g/4294967296>>>0)>>>0;a[1][1]=g>>>0;g=a[2][1]+K;a[2][0]=a[2][0]+r+(g/4294967296>>>0)>>>0;a[2][1]=g>>>0;g=a[3][1]+L;a[3][0]=
285
+a[3][0]+S+(g/4294967296>>>0)>>>0;a[3][1]=g>>>0;g=a[4][1]+u;a[4][0]=a[4][0]+R+(g/4294967296>>>0)>>>0;a[4][1]=g>>>0;g=a[5][1]+U;a[5][0]=a[5][0]+V+(g/4294967296>>>0)>>>0;a[5][1]=g>>>0;g=a[6][1]+T;a[6][0]=a[6][0]+X+(g/4294967296>>>0)>>>0;a[6][1]=g>>>0;g=a[7][1]+I;a[7][0]=a[7][0]+J+(g/4294967296>>>0)>>>0;a[7][1]=g>>>0;Y-=128}}var d=c.sha512=c.sha512||{};c.md=c.md||{};c.md.algorithms=c.md.algorithms||{};c.md.sha512=c.md.algorithms.sha512=d;var e=c.sha384=c.sha512.sha384=c.sha512.sha384||{};e.create=function(){return d.create("SHA-384")};
286
+c.md.sha384=c.md.algorithms.sha384=e;c.sha512.sha256=c.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};c.md["sha512/256"]=c.md.algorithms["sha512/256"]=c.sha512.sha256;c.sha512.sha224=c.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};c.md["sha512/224"]=c.md.algorithms["sha512/224"]=c.sha512.sha224;d.create=function(a){n||(g=String.fromCharCode(128),g+=c.util.fillString(String.fromCharCode(0),128),k=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],
287
[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],[1555081692,3175218132],[1996064986,2198950837],[2554220882,
288
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,106217008],[3516065817,3606008344],[3600352804,1432725776],
289
[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],[3515267271,566280711],[3940187606,3454069534],[4118630271,
289
-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],[528734635,4215389547],[1541459225,327033209]],"SHA-384":[[3418070365,
290
+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]],h={"SHA-512":[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],"SHA-384":[[3418070365,
291
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,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],
291
-[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},m=!0);"undefined"===typeof a&&(a="SHA-512");if(!(a in g))throw Error("Invalid SHA-512 algorithm: "+a);for(var d=g[a],e=null,v=c.util.createBuffer(),y=Array(80),D=0;80>D;++D)y[D]=Array(2);var A={algorithm:a.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){A.messageLength=0;A.fullMessageLength=A.messageLength128=[];for(var a=A.messageLengthSize/
292
-4,b=0;b<a;++b)A.fullMessageLength.push(0);v=c.util.createBuffer();e=Array(d.length);for(b=0;b<d.length;++b)e[b]=d[b].slice(0);return A}};A.start();A.update=function(a,d){"utf8"===d&&(a=c.util.encodeUtf8(a));var g=a.length;A.messageLength+=g;for(var g=[g/4294967296>>>0,g>>>0],h=A.fullMessageLength.length-1;0<=h;--h)A.fullMessageLength[h]+=g[1],g[1]=g[0]+(A.fullMessageLength[h]/4294967296>>>0),A.fullMessageLength[h]>>>=0,g[0]=g[1]/4294967296>>>0;v.putBytes(a);b(e,y,v);(2048<v.read||0===v.length())&&
293
-v.compact();return A};A.digest=function(){var d=c.util.createBuffer();d.putBytes(v.bytes());d.putBytes(f.substr(0,A.blockLength-(A.fullMessageLength[A.fullMessageLength.length-1]+A.messageLengthSize&A.blockLength-1)));c.util.createBuffer();for(var g,h,n=8*A.fullMessageLength[0],m=0;m<A.fullMessageLength.length;++m)g=8*A.fullMessageLength[m+1],h=g/4294967296>>>0,n+=h,d.putInt32(n>>>0),n=g;g=Array(e.length);for(m=0;m<e.length;++m)g[m]=e[m].slice(0);b(g,y,d);d=c.util.createBuffer();h="SHA-512"===a?g.length:
294
-"SHA-384"===a?g.length-2:g.length-4;for(m=0;m<h;++m)d.putInt32(g[m][0]),m===h-1&&"SHA-512/224"===a||d.putInt32(g[m][1]);return d};return A};var f=null,m=!1,h=null,g=null}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha512)return b.sha512;b.defined.sha512=
295
-!0;for(var k=0;k<e.length;++k)e[k](b);return b.sha512}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha512",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.md=c.md||{};c.md.algorithms={md5:c.md5,sha1:c.sha1,sha256:c.sha256};c.md.md5=c.md5;c.md.sha1=c.sha1;
296
-c.md.sha256=c.sha256}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.md)return b.md;b.defined.md=!0;for(var k=0;k<e.length;++k)e[k](b);return b.md}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,
297
-Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/md","require module ./md5 ./sha1 ./sha256 ./sha512".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){(c.hmac=c.hmac||{}).create=function(){var a=null,b=null,d=null,f={start:function(f,h){if(null!==f)if("string"===typeof f)if(f=f.toLowerCase(),f in c.md.algorithms)a=c.md.algorithms[f].create();else throw Error('Unknown hash algorithm "'+
298
-f+'"');else a=f;if(null!==h){if("string"===typeof h)h=c.util.createBuffer(h);else if(c.util.isArray(h)){var g=h;h=c.util.createBuffer();for(var u=0;u<g.length;++u)h.putByte(g[u])}var n=h.length();n>a.blockLength&&(a.start(),a.update(h.bytes()),h=a.digest());b=c.util.createBuffer();d=c.util.createBuffer();n=h.length();for(u=0;u<n;++u)g=h.at(u),b.putByte(54^g),d.putByte(92^g);if(n<a.blockLength)for(g=a.blockLength-n,u=0;u<g;++u)b.putByte(54),d.putByte(92);b=b.bytes();d=d.bytes()}a.start();a.update(b)},
299
-update:function(c){a.update(c)},getMac:function(){var c=a.digest().bytes();a.start();a.update(d);a.update(c);return a.digest()}};f.digest=f.getMac;return f}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.hmac)return b.hmac;b.defined.hmac=!0;for(var k=
300
-0;k<e.length;++k)e[k](b);return b.hmac}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/hmac",["require","module","./md","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){for(var c=a.name+": ",d=[],l=function(a,c){return" "+c},g=0;g<a.values.length;++g)d.push(a.values[g].replace(/^(\S+\r\n)/,
301
-l));c+=d.join(",")+"\r\n";d=0;a=-1;for(g=0;g<c.length;++g,++d)if(65<d&&-1!==a)d=c[a],","===d?(++a,c=c.substr(0,a)+"\r\n "+c.substr(a)):c=c.substr(0,a)+"\r\n"+d+c.substr(a+1),d=g-a-1,a=-1,++g;else if(" "===c[g]||"\t"===c[g]||","===c[g])a=g;return c}var d=c.pem=c.pem||{};d.encode=function(a,d){d=d||{};var f="-----BEGIN "+a.type+"-----\r\n",h;a.procType&&(h={name:"Proc-Type",values:[String(a.procType.version),a.procType.type]},f+=b(h));a.contentDomain&&(h={name:"Content-Domain",values:[a.contentDomain]},
302
-f+=b(h));a.dekInfo&&(h={name:"DEK-Info",values:[a.dekInfo.algorithm]},a.dekInfo.parameters&&h.values.push(a.dekInfo.parameters),f+=b(h));if(a.headers)for(h=0;h<a.headers.length;++h)f+=b(a.headers[h]);a.procType&&(f+="\r\n");f+=c.util.encode64(a.body,d.maxline||64)+"\r\n";return f+="-----END "+a.type+"-----\r\n"};d.decode=function(a){for(var b=[],d=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,h=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,
303
-g=/\r?\n/,k;;){k=d.exec(a);if(!k)break;var f={type:k[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:c.util.decode64(k[3])};b.push(f);if(k[2]){for(var v=k[2].split(g),w=0;k&&w<v.length;){k=v[w].replace(/\s+$/,"");for(var y=w+1;y<v.length;++y){var m=v[y];if(!/\s/.test(m[0]))break;k+=m;w=y}if(k=k.match(h)){for(var y={name:k[1],values:[]},m=k[2].split(","),A=0;A<m.length;++A)y.values.push(m[A].replace(/^\s+/,""));if(f.procType)if(f.contentDomain||"Content-Domain"!==y.name)if(f.dekInfo||
304
-"DEK-Info"!==y.name)f.headers.push(y);else{if(0===y.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');f.dekInfo={algorithm:m[0],parameters:m[1]||null}}else f.contentDomain=m[0]||"";else{if("Proc-Type"!==y.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==y.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');f.procType={version:m[0],
305
-type:m[1]}}}++w}if("ENCRYPTED"===f.procType&&!f.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');}}if(0===b.length)throw Error("Invalid PEM formatted message.");return b}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);
306
-b=b||{};b.defined=b.defined||{};if(b.defined.pem)return b.pem;b.defined.pem=!0;for(var k=0;k<e.length;++k)e[k](b);return b.pem}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pem",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d){c.cipher.registerAlgorithm(a,
307
-function(){return new c.des.Algorithm(a,d)})}function d(a,c,b,l){var e=32===a.length?3:9;l=3===e?l?[30,-2,-2]:[0,32,2]:l?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var k=c[0],x=c[1];c=(k>>>4^x)&252645135;x^=c;k^=c<<4;c=(k>>>16^x)&65535;x^=c;k^=c<<16;c=(x>>>2^k)&858993459;k^=c;x^=c<<2;c=(x>>>8^k)&16711935;k^=c;x^=c<<8;c=(k>>>1^x)&1431655765;for(var x=x^c,k=k^c<<1,k=k<<1|k>>>31,x=x<<1|x>>>31,v=0;v<e;v+=3){for(var p=l[v+1],q=l[v+2],r=l[v];r!=p;r+=q){var M=x^a[r],J=(x>>>4|x<<28)^a[r+1];c=k;
308
-k=x;x=c^(m[M>>>24&63]|g[M>>>16&63]|n[M>>>8&63]|w[M&63]|f[J>>>24&63]|h[J>>>16&63]|E[J>>>8&63]|F[J&63])}c=k;k=x;x=c}k=k>>>1|k<<31;x=x>>>1|x<<31;c=(k>>>1^x)&1431655765;x^=c;k^=c<<1;c=(x>>>8^k)&16711935;k^=c;x^=c<<8;c=(x>>>2^k)&858993459;k^=c;x^=c<<2;c=(k>>>16^x)&65535;x^=c;k^=c<<16;c=(k>>>4^x)&252645135;b[0]=k^c<<4;b[1]=x^c}function e(a){a=a||{};var b="DES-"+(a.mode||"CBC").toUpperCase(),d;d=a.decrypt?c.cipher.createDecipher(b,a.key):c.cipher.createCipher(b,a.key);var g=d.start;d.start=function(a,b){var e=
309
-null;b instanceof c.util.ByteBuffer&&(e=b,b={});b=b||{};b.output=e;b.iv=a;g.call(d,b)};return d}c.des=c.des||{};c.des.startEncrypting=function(a,c,b,d){a=e({key:a,output:b,decrypt:!1,mode:d||(null===c?"ECB":"CBC")});a.start(c);return a};c.des.createEncryptionCipher=function(a,c){return e({key:a,output:null,decrypt:!1,mode:c})};c.des.startDecrypting=function(a,c,b,d){a=e({key:a,output:b,decrypt:!0,mode:d||(null===c?"ECB":"CBC")});a.start(c);return a};c.des.createDecryptionCipher=function(a,c){return e({key:a,
292
+[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]]},n=!0);"undefined"===typeof a&&(a="SHA-512");if(!(a in h))throw Error("Invalid SHA-512 algorithm: "+a);for(var d=h[a],e=null,w=c.util.createBuffer(),z=Array(80),A=0;80>A;++A)z[A]=Array(2);var D={algorithm:a.replace("-","").toLowerCase(),blockLength:128,digestLength:64,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){D.messageLength=0;D.fullMessageLength=D.messageLength128=[];for(var a=D.messageLengthSize/
293
+4,b=0;b<a;++b)D.fullMessageLength.push(0);w=c.util.createBuffer();e=Array(d.length);for(b=0;b<d.length;++b)e[b]=d[b].slice(0);return D}};D.start();D.update=function(a,d){"utf8"===d&&(a=c.util.encodeUtf8(a));var h=a.length;D.messageLength+=h;for(var h=[h/4294967296>>>0,h>>>0],k=D.fullMessageLength.length-1;0<=k;--k)D.fullMessageLength[k]+=h[1],h[1]=h[0]+(D.fullMessageLength[k]/4294967296>>>0),D.fullMessageLength[k]>>>=0,h[0]=h[1]/4294967296>>>0;w.putBytes(a);b(e,z,w);(2048<w.read||0===w.length())&&
294
+w.compact();return D};D.digest=function(){var d=c.util.createBuffer();d.putBytes(w.bytes());d.putBytes(g.substr(0,D.blockLength-(D.fullMessageLength[D.fullMessageLength.length-1]+D.messageLengthSize&D.blockLength-1)));c.util.createBuffer();for(var h,k,p=8*D.fullMessageLength[0],H=0;H<D.fullMessageLength.length;++H)h=8*D.fullMessageLength[H+1],k=h/4294967296>>>0,p+=k,d.putInt32(p>>>0),p=h;h=Array(e.length);for(H=0;H<e.length;++H)h[H]=e[H].slice(0);b(h,z,d);d=c.util.createBuffer();k="SHA-512"===a?h.length:
295
+"SHA-384"===a?h.length-2:h.length-4;for(H=0;H<k;++H)d.putInt32(h[H][0]),H===k-1&&"SHA-512/224"===a||d.putInt32(h[H][1]);return d};return D};var g=null,n=!1,k=null,h=null}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.sha512)return b.sha512;b.defined.sha512=
296
+!0;for(var l=0;l<e.length;++l)e[l](b);return b.sha512}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/sha512",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.md=c.md||{};c.md.algorithms={md5:c.md5,sha1:c.sha1,sha256:c.sha256};c.md.md5=c.md5;c.md.sha1=c.sha1;
297
+c.md.sha256=c.sha256}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.md)return b.md;b.defined.md=!0;for(var l=0;l<e.length;++l)e[l](b);return b.md}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,
298
+Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/md","require module ./md5 ./sha1 ./sha256 ./sha512".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){(c.hmac=c.hmac||{}).create=function(){var a=null,b=null,d=null,g={start:function(g,k){if(null!==g)if("string"===typeof g)if(g=g.toLowerCase(),g in c.md.algorithms)a=c.md.algorithms[g].create();else throw Error('Unknown hash algorithm "'+
299
+g+'"');else a=g;if(null!==k){if("string"===typeof k)k=c.util.createBuffer(k);else if(c.util.isArray(k)){var h=k;k=c.util.createBuffer();for(var v=0;v<h.length;++v)k.putByte(h[v])}var p=k.length();p>a.blockLength&&(a.start(),a.update(k.bytes()),k=a.digest());b=c.util.createBuffer();d=c.util.createBuffer();p=k.length();for(v=0;v<p;++v)h=k.at(v),b.putByte(54^h),d.putByte(92^h);if(p<a.blockLength)for(h=a.blockLength-p,v=0;v<h;++v)b.putByte(54),d.putByte(92);b=b.bytes();d=d.bytes()}a.start();a.update(b)},
300
+update:function(c){a.update(c)},getMac:function(){var c=a.digest().bytes();a.start();a.update(d);a.update(c);return a.digest()}};g.digest=g.getMac;return g}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.hmac)return b.hmac;b.defined.hmac=!0;for(var l=
301
+0;l<e.length;++l)e[l](b);return b.hmac}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/hmac",["require","module","./md","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){for(var c=a.name+": ",d=[],m=function(a,c){return" "+c},h=0;h<a.values.length;++h)d.push(a.values[h].replace(/^(\S+\r\n)/,
302
+m));c+=d.join(",")+"\r\n";d=0;a=-1;for(h=0;h<c.length;++h,++d)if(65<d&&-1!==a)d=c[a],","===d?(++a,c=c.substr(0,a)+"\r\n "+c.substr(a)):c=c.substr(0,a)+"\r\n"+d+c.substr(a+1),d=h-a-1,a=-1,++h;else if(" "===c[h]||"\t"===c[h]||","===c[h])a=h;return c}var d=c.pem=c.pem||{};d.encode=function(a,d){d=d||{};var g="-----BEGIN "+a.type+"-----\r\n",k;a.procType&&(k={name:"Proc-Type",values:[String(a.procType.version),a.procType.type]},g+=b(k));a.contentDomain&&(k={name:"Content-Domain",values:[a.contentDomain]},
303
+g+=b(k));a.dekInfo&&(k={name:"DEK-Info",values:[a.dekInfo.algorithm]},a.dekInfo.parameters&&k.values.push(a.dekInfo.parameters),g+=b(k));if(a.headers)for(k=0;k<a.headers.length;++k)g+=b(a.headers[k]);a.procType&&(g+="\r\n");g+=c.util.encode64(a.body,d.maxline||64)+"\r\n";return g+="-----END "+a.type+"-----\r\n"};d.decode=function(a){for(var b=[],d=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,k=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,
304
+h=/\r?\n/,l;;){l=d.exec(a);if(!l)break;var g={type:l[1],procType:null,contentDomain:null,dekInfo:null,headers:[],body:c.util.decode64(l[3])};b.push(g);if(l[2]){for(var w=l[2].split(h),y=0;l&&y<w.length;){l=w[y].replace(/\s+$/,"");for(var z=y+1;z<w.length;++z){var n=w[z];if(!/\s/.test(n[0]))break;l+=n;y=z}if(l=l.match(k)){for(var z={name:l[1],values:[]},n=l[2].split(","),D=0;D<n.length;++D)z.values.push(n[D].replace(/^\s+/,""));if(g.procType)if(g.contentDomain||"Content-Domain"!==z.name)if(g.dekInfo||
305
+"DEK-Info"!==z.name)g.headers.push(z);else{if(0===z.values.length)throw Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');g.dekInfo={algorithm:n[0],parameters:n[1]||null}}else g.contentDomain=n[0]||"";else{if("Proc-Type"!==z.name)throw Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==z.values.length)throw Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');g.procType={version:n[0],
306
+type:n[1]}}}++y}if("ENCRYPTED"===g.procType&&!g.dekInfo)throw Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".');}}if(0===b.length)throw Error("Invalid PEM formatted message.");return b}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);
307
+b=b||{};b.defined=b.defined||{};if(b.defined.pem)return b.pem;b.defined.pem=!0;for(var l=0;l<e.length;++l)e[l](b);return b.pem}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pem",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d){c.cipher.registerAlgorithm(a,
308
+function(){return new c.des.Algorithm(a,d)})}function d(a,c,b,m){var e=32===a.length?3:9;m=3===e?m?[30,-2,-2]:[0,32,2]:m?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var l=c[0],B=c[1];c=(l>>>4^B)&252645135;B^=c;l^=c<<4;c=(l>>>16^B)&65535;B^=c;l^=c<<16;c=(B>>>2^l)&858993459;l^=c;B^=c<<2;c=(B>>>8^l)&16711935;l^=c;B^=c<<8;c=(l>>>1^B)&1431655765;for(var B=B^c,l=l^c<<1,l=l<<1|l>>>31,B=B<<1|B>>>31,w=0;w<e;w+=3){for(var r=m[w+1],q=m[w+2],u=m[w];u!=r;u+=q){var M=B^a[u],K=(B>>>4|B<<28)^a[u+1];c=l;
309
+l=B;B=c^(n[M>>>24&63]|h[M>>>16&63]|p[M>>>8&63]|y[M&63]|g[K>>>24&63]|k[K>>>16&63]|C[K>>>8&63]|F[K&63])}c=l;l=B;B=c}l=l>>>1|l<<31;B=B>>>1|B<<31;c=(l>>>1^B)&1431655765;B^=c;l^=c<<1;c=(B>>>8^l)&16711935;l^=c;B^=c<<8;c=(B>>>2^l)&858993459;l^=c;B^=c<<2;c=(l>>>16^B)&65535;B^=c;l^=c<<16;c=(l>>>4^B)&252645135;b[0]=l^c<<4;b[1]=B^c}function e(a){a=a||{};var b="DES-"+(a.mode||"CBC").toUpperCase(),d;d=a.decrypt?c.cipher.createDecipher(b,a.key):c.cipher.createCipher(b,a.key);var h=d.start;d.start=function(a,b){var e=
310
+null;b instanceof c.util.ByteBuffer&&(e=b,b={});b=b||{};b.output=e;b.iv=a;h.call(d,b)};return d}c.des=c.des||{};c.des.startEncrypting=function(a,c,b,d){a=e({key:a,output:b,decrypt:!1,mode:d||(null===c?"ECB":"CBC")});a.start(c);return a};c.des.createEncryptionCipher=function(a,c){return e({key:a,output:null,decrypt:!1,mode:c})};c.des.startDecrypting=function(a,c,b,d){a=e({key:a,output:b,decrypt:!0,mode:d||(null===c?"ECB":"CBC")});a.start(c);return a};c.des.createDecryptionCipher=function(a,c){return e({key:a,
311
output:null,decrypt:!0,mode:c})};c.des.Algorithm=function(a,c){var b=this;b.name=a;b.mode=new c({blockSize:8,cipher:{encrypt:function(a,c){return d(b._keys,a,c,!1)},decrypt:function(a,c){return d(b._keys,a,c,!0)}}});b._init=!1};c.des.Algorithm.prototype.initialize=function(a){if(!this._init){a=c.util.createBuffer(a.key);if(0===this.name.indexOf("3DES")&&24!==a.length())throw Error("Invalid Triple-DES key size: "+8*a.length());for(var b=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,
311
-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],h=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],
312
-k=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],f=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],n=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],q=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],u=[0,268435456,8,268435464,0,268435456,
313
-8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],v=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],J=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],w=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],E=8<a.length()?3:
314
-1,F=[],B=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],p=0,r,P=0;P<E;P++){var H=a.getInt32(),G=a.getInt32();r=(H>>>4^G)&252645135;G^=r;H^=r<<4;r=(G>>>-16^H)&65535;H^=r;G^=r<<-16;r=(H>>>2^G)&858993459;G^=r;H^=r<<2;r=(G>>>-16^H)&65535;H^=r;G^=r<<-16;r=(H>>>1^G)&1431655765;G^=r;H^=r<<1;r=(G>>>8^H)&16711935;H^=r;G^=r<<8;r=(H>>>1^G)&1431655765;G^=r;H^=r<<1;r=H<<8|G>>>20&240;for(var H=G<<24|G<<8&16711680|G>>>8&65280|G>>>24&240,G=r,N=0;N<B.length;++N){B[N]?(H=H<<2|H>>>26,G=G<<2|G>>>26):(H=H<<1|H>>>27,G=G<<1|G>>>27);
315
-var H=H&-15,G=G&-15,Y=b[H>>>28]|d[H>>>24&15]|g[H>>>20&15]|e[H>>>16&15]|h[H>>>12&15]|k[H>>>8&15]|f[H>>>4&15],Z=n[G>>>28]|q[G>>>24&15]|u[G>>>20&15]|v[G>>>16&15]|J[G>>>12&15]|w[G>>>8&15]|m[G>>>4&15];r=(Z>>>16^Y)&65535;F[p++]=Y^r;F[p++]=Z^r<<16}}this._keys=F;this._init=!0}};b("DES-ECB",c.cipher.modes.ecb);b("DES-CBC",c.cipher.modes.cbc);b("DES-CFB",c.cipher.modes.cfb);b("DES-OFB",c.cipher.modes.ofb);b("DES-CTR",c.cipher.modes.ctr);b("3DES-ECB",c.cipher.modes.ecb);b("3DES-CBC",c.cipher.modes.cbc);b("3DES-CFB",
316
-c.cipher.modes.cfb);b("3DES-OFB",c.cipher.modes.ofb);b("3DES-CTR",c.cipher.modes.ctr);var f=[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,
317
-0,65540,66560,0,16842756],m=[-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,
318
--2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],h=[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,
319
-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],E=[256,34078976,34078720,1107296512,
312
+516,536871424,536871428,66048,66052,536936960,536936964],d=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],h=[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],
313
+l=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],g=[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],q=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],v=[0,268435456,8,268435464,0,268435456,
314
+8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],w=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],K=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],n=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],C=8<a.length()?3:
315
+1,F=[],E=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],r=0,u,T=0;T<C;T++){var J=a.getInt32(),I=a.getInt32();u=(J>>>4^I)&252645135;I^=u;J^=u<<4;u=(I>>>-16^J)&65535;J^=u;I^=u<<-16;u=(J>>>2^I)&858993459;I^=u;J^=u<<2;u=(I>>>-16^J)&65535;J^=u;I^=u<<-16;u=(J>>>1^I)&1431655765;I^=u;J^=u<<1;u=(I>>>8^J)&16711935;J^=u;I^=u<<8;u=(J>>>1^I)&1431655765;I^=u;J^=u<<1;u=J<<8|I>>>20&240;for(var J=I<<24|I<<8&16711680|I>>>8&65280|I>>>24&240,I=u,O=0;O<E.length;++O){E[O]?(J=J<<2|J>>>26,I=I<<2|I>>>26):(J=J<<1|J>>>27,I=I<<1|I>>>27);
316
+var J=J&-15,I=I&-15,Y=b[J>>>28]|d[J>>>24&15]|h[J>>>20&15]|e[J>>>16&15]|k[J>>>12&15]|l[J>>>8&15]|g[J>>>4&15],Z=p[I>>>28]|q[I>>>24&15]|v[I>>>20&15]|w[I>>>16&15]|K[I>>>12&15]|y[I>>>8&15]|n[I>>>4&15];u=(Z>>>16^Y)&65535;F[r++]=Y^u;F[r++]=Z^u<<16}}this._keys=F;this._init=!0}};b("DES-ECB",c.cipher.modes.ecb);b("DES-CBC",c.cipher.modes.cbc);b("DES-CFB",c.cipher.modes.cfb);b("DES-OFB",c.cipher.modes.ofb);b("DES-CTR",c.cipher.modes.ctr);b("3DES-ECB",c.cipher.modes.ecb);b("3DES-CBC",c.cipher.modes.cbc);b("3DES-CFB",
317
+c.cipher.modes.cfb);b("3DES-OFB",c.cipher.modes.ofb);b("3DES-CTR",c.cipher.modes.ctr);var g=[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,
318
+0,65540,66560,0,16842756],n=[-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,
319
+-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],k=[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,
320
+8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],h=[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],C=[256,34078976,34078720,1107296512,
321
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,
321
-524288,0,1074266112,34078976,1073742080],n=[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,
322
+524288,0,1074266112,34078976,1073742080],p=[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,
323
4194320,536887312,0,541081600,536870912,4194320,536887312],F=[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,
323
-67108866,67110912,2048,2097154],w=[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,
324
-268435456,268701696]}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.des)return b.des;b.defined.des=!0;for(var k=0;k<e.length;++k)e[k](b);return b.des}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,
325
-Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/des",["require","module","./cipher","./cipherModes","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var d=c.pkcs5=c.pkcs5||{},f="undefined"!==typeof process&&process.versions&&process.versions.node,e;f&&!c.disableNativeCode&&(e=b("crypto"));c.pbkdf2=d.pbkdf2=function(a,b,d,g,k,n){function m(){if(r>D)return n(null,z);p.start(null,
326
-null);p.update(b);p.update(c.util.int32ToBytes(r));C=I=p.digest().getBytes();q=2;w()}function w(){if(q<=d)return p.start(null,null),p.update(I),x=p.digest().getBytes(),C=c.util.xorBytes(C,x,y),I=x,++q,c.util.setImmediate(w);z+=r<D?C:C.substr(0,A);++r;m()}"function"===typeof k&&(n=k,k=null);if(f&&!c.disableNativeCode&&e.pbkdf2&&(null===k||"object"!==typeof k)&&(4<e.pbkdf2Sync.length||!k||"sha1"===k))return"string"!==typeof k&&(k="sha1"),b=new Buffer(b,"binary"),n?4===e.pbkdf2Sync.length?e.pbkdf2(a,
327
-b,d,g,function(a,c){if(a)return n(a);n(null,c.toString("binary"))}):e.pbkdf2(a,b,d,g,k,function(a,c){if(a)return n(a);n(null,c.toString("binary"))}):4===e.pbkdf2Sync.length?e.pbkdf2Sync(a,b,d,g).toString("binary"):e.pbkdf2Sync(a,b,d,g,k).toString("binary");if("undefined"===typeof k||null===k)k=c.md.sha1.create();if("string"===typeof k){if(!(k in c.md.algorithms))throw Error("Unknown hash algorithm: "+k);k=c.md[k].create()}var y=k.digestLength;if(g>4294967295*y){a=Error("Derived key is too long.");
328
-if(n)return n(a);throw a;}var D=Math.ceil(g/y),A=g-(D-1)*y,p=c.hmac.create();p.start(k,a);var z="",C,x,I;if(!n){for(var r=1;r<=D;++r){p.start(null,null);p.update(b);p.update(c.util.int32ToBytes(r));C=I=p.digest().getBytes();for(var q=2;q<=d;++q)p.start(null,null),p.update(I),x=p.digest().getBytes(),C=c.util.xorBytes(C,x,y),I=x;z+=r<D?C:C.substr(0,A)}return z}r=1;m()}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===
329
-typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pbkdf2)return b.pbkdf2;b.defined.pbkdf2=!0;for(var k=0;k<e.length;++k)e[k](b);return b.pbkdf2}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pbkdf2",["require","module",
330
-"./hmac","./md","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var d="undefined"!==typeof process&&process.versions&&process.versions.node,f=null;c.disableNativeCode||!d||process.versions["node-webkit"]||(f=b("crypto"));(c.prng=c.prng||{}).create=function(a){function b(a){if(32<=g.pools[0].messageLength)return d(),a();g.seedFile(32-g.pools[0].messageLength<<5,function(c,b){if(c)return a(c);g.collect(b);d();a()})}function d(){var a=g.plugin.md.create();
331
-a.update(g.pools[0].digest().getBytes());g.pools[0].start();for(var c=1,b=1;32>b;++b)c=31===c?2147483648:c<<2,0===c%g.reseeds&&(a.update(g.pools[b].digest().getBytes()),g.pools[b].start());c=a.digest().getBytes();a.start();a.update(c);a=a.digest().getBytes();g.key=g.plugin.formatKey(c);g.seed=g.plugin.formatSeed(a);g.reseeds=4294967295===g.reseeds?0:g.reseeds+1;g.generated=0}function h(a){var b=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(b=function(a){return d.getRandomValues(a)})}var g=
332
-c.util.createBuffer();if(b)for(;g.length()<a;){var e=Math.max(1,Math.min(a-g.length(),65536)/4),h=new Uint32Array(Math.floor(e));try{for(b(h),e=0;e<h.length;++e)g.putInt32(h[e])}catch(k){if(!("undefined"!==typeof QuotaExceededError&&k instanceof QuotaExceededError))throw k;}}if(g.length()<a)for(b=Math.floor(65536*Math.random());g.length()<a;)for(e=16807*(b&65535),b=16807*(b>>16),e+=(b&32767)<<16,e+=b>>15,e=(e&2147483647)+(e>>31),b=e&4294967295,e=0;3>e;++e)h=b>>>(e<<3),h^=Math.floor(256*Math.random()),
333
-g.putByte(String.fromCharCode(h&255));return g.getBytes(a)}var g={plugin:a,key:null,seed:null,time:null,reseeds:0,generated:0};a=a.md;for(var k=Array(32),n=0;32>n;++n)k[n]=a.create();g.pools=k;g.pool=0;g.generate=function(a,d){function e(x){if(x)return d(x);if(C.length()>=a)return d(null,C.getBytes(a));1048575<g.generated&&(g.key=null);if(null===g.key)return c.util.nextTick(function(){b(e)});x=h(g.key,g.seed);g.generated+=x.length;C.putBytes(x);g.key=f(h(g.key,k(g.seed)));g.seed=n(h(g.key,g.seed));
334
-c.util.setImmediate(e)}if(!d)return g.generateSync(a);var h=g.plugin.cipher,k=g.plugin.increment,f=g.plugin.formatKey,n=g.plugin.formatSeed,C=c.util.createBuffer();g.key=null;e()};g.generateSync=function(a){var b=g.plugin.cipher,e=g.plugin.increment,h=g.plugin.formatKey,k=g.plugin.formatSeed;g.key=null;for(var f=c.util.createBuffer();f.length()<a;){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 n=b(g.key,
335
-g.seed);g.generated+=n.length;f.putBytes(n);g.key=h(b(g.key,e(g.seed)));g.seed=k(b(g.key,g.seed))}return f.getBytes(a)};f?(g.seedFile=function(a,c){f.randomBytes(a,function(a,b){if(a)return c(a);c(null,b.toString())})},g.seedFileSync=function(a){return f.randomBytes(a).toString()}):(g.seedFile=function(a,c){try{c(null,h(a))}catch(b){c(b)}},g.seedFileSync=h);g.collect=function(a){for(var c=a.length,b=0;b<c;++b)g.pools[g.pool].update(a.substr(b,1)),g.pool=31===g.pool?0:g.pool+1};g.collectInt=function(a,
336
-c){for(var b="",d=0;d<c;d+=8)b+=String.fromCharCode(a>>d&255);g.collect(b)};g.registerWorker=function(a){a===self?g.seedFile=function(a,c){function b(a){a=a.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",b),c(a.forge.prng.err,a.forge.prng.bytes))}self.addEventListener("message",b);self.postMessage({forge:{prng:{needed:a}}})}:a.addEventListener("message",function(c){c=c.data;c.forge&&c.forge.prng&&g.seedFile(c.forge.prng.needed,function(c,b){a.postMessage({forge:{prng:{err:c,bytes:b}}})})})};
337
-return g}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.prng)return b.prng;b.defined.prng=!0;for(var k=0;k<e.length;++k)e[k](b);return b.prng}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,
338
-0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/prng",["require","module","./md","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.random&&c.random.getBytes||function(a){function b(){var a=c.prng.create(d);a.getBytes=function(c,b){return a.generate(c,b)};a.getBytesSync=function(c){return a.generate(c)};return a}var d={},f=Array(4),m=c.util.createBuffer();d.formatKey=function(a){var b=c.util.createBuffer(a);a=Array(4);
339
-a[0]=b.getInt32();a[1]=b.getInt32();a[2]=b.getInt32();a[3]=b.getInt32();return c.aes._expandKey(a,!1)};d.formatSeed=function(a){var b=c.util.createBuffer(a);a=Array(4);a[0]=b.getInt32();a[1]=b.getInt32();a[2]=b.getInt32();a[3]=b.getInt32();return a};d.cipher=function(a,b){c.aes._updateBlock(a,b,f,!1);m.putInt32(f[0]);m.putInt32(f[1]);m.putInt32(f[2]);m.putInt32(f[3]);return m.getBytes()};d.increment=function(a){++a[3];return a};d.md=c.md.sha256;var h=b(),g="undefined"!==typeof process&&process.versions&&
340
-process.versions.node,E=null;if("undefined"!==typeof window){var n=window.crypto||window.msCrypto;n&&n.getRandomValues&&(E=function(a){return n.getRandomValues(a)})}if(c.disableNativeCode||!g&&!E){h.collectInt(+new Date,32);if("undefined"!==typeof navigator){var g="",p;for(p in navigator)try{"string"==typeof navigator[p]&&(g+=navigator[p])}catch(w){}h.collect(g);g=null}a&&(a().mousemove(function(a){h.collectInt(a.clientX,16);h.collectInt(a.clientY,16)}),a().keypress(function(a){h.collectInt(a.charCode,
341
-8)}))}if(c.random)for(p in h)c.random[p]=h[p];else c.random=h;c.random.createInstance=b}("undefined"!==typeof jQuery?jQuery:null)}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.random)return b.random;b.defined.random=!0;for(var k=0;k<e.length;++k)e[k](b);
342
-return b.random}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/random","require module ./aes ./md ./prng ./util".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=[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,
324
+67108866,67110912,2048,2097154],y=[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,
325
+268435456,268701696]}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.des)return b.des;b.defined.des=!0;for(var l=0;l<e.length;++l)e[l](b);return b.des}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,
326
+Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/des",["require","module","./cipher","./cipherModes","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var d=c.pkcs5=c.pkcs5||{},g="undefined"!==typeof process&&process.versions&&process.versions.node,e;g&&!c.disableNativeCode&&(e=b("crypto"));c.pbkdf2=d.pbkdf2=function(a,b,d,h,l,p){function n(){if(u>A)return p(null,x);r.start(null,
327
+null);r.update(b);r.update(c.util.int32ToBytes(u));G=H=r.digest().getBytes();q=2;y()}function y(){if(q<=d)return r.start(null,null),r.update(H),B=r.digest().getBytes(),G=c.util.xorBytes(G,B,z),H=B,++q,c.util.setImmediate(y);x+=u<A?G:G.substr(0,D);++u;n()}"function"===typeof l&&(p=l,l=null);if(g&&!c.disableNativeCode&&e.pbkdf2&&(null===l||"object"!==typeof l)&&(4<e.pbkdf2Sync.length||!l||"sha1"===l))return"string"!==typeof l&&(l="sha1"),b=new Buffer(b,"binary"),p?4===e.pbkdf2Sync.length?e.pbkdf2(a,
328
+b,d,h,function(a,c){if(a)return p(a);p(null,c.toString("binary"))}):e.pbkdf2(a,b,d,h,l,function(a,c){if(a)return p(a);p(null,c.toString("binary"))}):4===e.pbkdf2Sync.length?e.pbkdf2Sync(a,b,d,h).toString("binary"):e.pbkdf2Sync(a,b,d,h,l).toString("binary");if("undefined"===typeof l||null===l)l=c.md.sha1.create();if("string"===typeof l){if(!(l in c.md.algorithms))throw Error("Unknown hash algorithm: "+l);l=c.md[l].create()}var z=l.digestLength;if(h>4294967295*z){a=Error("Derived key is too long.");
329
+if(p)return p(a);throw a;}var A=Math.ceil(h/z),D=h-(A-1)*z,r=c.hmac.create();r.start(l,a);var x="",G,B,H;if(!p){for(var u=1;u<=A;++u){r.start(null,null);r.update(b);r.update(c.util.int32ToBytes(u));G=H=r.digest().getBytes();for(var q=2;q<=d;++q)r.start(null,null),r.update(H),B=r.digest().getBytes(),G=c.util.xorBytes(G,B,z),H=B;x+=u<A?G:G.substr(0,D)}return x}u=1;n()}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===
330
+typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pbkdf2)return b.pbkdf2;b.defined.pbkdf2=!0;for(var l=0;l<e.length;++l)e[l](b);return b.pbkdf2}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pbkdf2",["require","module",
331
+"./hmac","./md","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var d="undefined"!==typeof process&&process.versions&&process.versions.node,g=null;c.disableNativeCode||!d||process.versions["node-webkit"]||(g=b("crypto"));(c.prng=c.prng||{}).create=function(a){function b(a){if(32<=h.pools[0].messageLength)return d(),a();h.seedFile(32-h.pools[0].messageLength<<5,function(c,b){if(c)return a(c);h.collect(b);d();a()})}function d(){var a=h.plugin.md.create();
332
+a.update(h.pools[0].digest().getBytes());h.pools[0].start();for(var c=1,b=1;32>b;++b)c=31===c?2147483648:c<<2,0===c%h.reseeds&&(a.update(h.pools[b].digest().getBytes()),h.pools[b].start());c=a.digest().getBytes();a.start();a.update(c);a=a.digest().getBytes();h.key=h.plugin.formatKey(c);h.seed=h.plugin.formatSeed(a);h.reseeds=4294967295===h.reseeds?0:h.reseeds+1;h.generated=0}function k(a){var b=null;if("undefined"!==typeof window){var d=window.crypto||window.msCrypto;d&&d.getRandomValues&&(b=function(a){return d.getRandomValues(a)})}var h=
333
+c.util.createBuffer();if(b)for(;h.length()<a;){var e=Math.max(1,Math.min(a-h.length(),65536)/4),k=new Uint32Array(Math.floor(e));try{for(b(k),e=0;e<k.length;++e)h.putInt32(k[e])}catch(l){if(!("undefined"!==typeof QuotaExceededError&&l instanceof QuotaExceededError))throw l;}}if(h.length()<a)for(b=Math.floor(65536*Math.random());h.length()<a;)for(e=16807*(b&65535),b=16807*(b>>16),e+=(b&32767)<<16,e+=b>>15,e=(e&2147483647)+(e>>31),b=e&4294967295,e=0;3>e;++e)k=b>>>(e<<3),k^=Math.floor(256*Math.random()),
334
+h.putByte(String.fromCharCode(k&255));return h.getBytes(a)}var h={plugin:a,key:null,seed:null,time:null,reseeds:0,generated:0};a=a.md;for(var l=Array(32),p=0;32>p;++p)l[p]=a.create();h.pools=l;h.pool=0;h.generate=function(a,d){function e(B){if(B)return d(B);if(p.length()>=a)return d(null,p.getBytes(a));1048575<h.generated&&(h.key=null);if(null===h.key)return c.util.nextTick(function(){b(e)});B=k(h.key,h.seed);h.generated+=B.length;p.putBytes(B);h.key=g(k(h.key,l(h.seed)));h.seed=x(k(h.key,h.seed));
335
+c.util.setImmediate(e)}if(!d)return h.generateSync(a);var k=h.plugin.cipher,l=h.plugin.increment,g=h.plugin.formatKey,x=h.plugin.formatSeed,p=c.util.createBuffer();h.key=null;e()};h.generateSync=function(a){var b=h.plugin.cipher,e=h.plugin.increment,k=h.plugin.formatKey,l=h.plugin.formatSeed;h.key=null;for(var g=c.util.createBuffer();g.length()<a;){1048575<h.generated&&(h.key=null);null===h.key&&(32<=h.pools[0].messageLength||h.collect(h.seedFileSync(32-h.pools[0].messageLength<<5)),d());var p=b(h.key,
336
+h.seed);h.generated+=p.length;g.putBytes(p);h.key=k(b(h.key,e(h.seed)));h.seed=l(b(h.key,h.seed))}return g.getBytes(a)};g?(h.seedFile=function(a,c){g.randomBytes(a,function(a,b){if(a)return c(a);c(null,b.toString())})},h.seedFileSync=function(a){return g.randomBytes(a).toString()}):(h.seedFile=function(a,c){try{c(null,k(a))}catch(b){c(b)}},h.seedFileSync=k);h.collect=function(a){for(var c=a.length,b=0;b<c;++b)h.pools[h.pool].update(a.substr(b,1)),h.pool=31===h.pool?0:h.pool+1};h.collectInt=function(a,
337
+c){for(var b="",d=0;d<c;d+=8)b+=String.fromCharCode(a>>d&255);h.collect(b)};h.registerWorker=function(a){a===self?h.seedFile=function(a,c){function b(a){a=a.data;a.forge&&a.forge.prng&&(self.removeEventListener("message",b),c(a.forge.prng.err,a.forge.prng.bytes))}self.addEventListener("message",b);self.postMessage({forge:{prng:{needed:a}}})}:a.addEventListener("message",function(c){c=c.data;c.forge&&c.forge.prng&&h.seedFile(c.forge.prng.needed,function(c,b){a.postMessage({forge:{prng:{err:c,bytes:b}}})})})};
338
+return h}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.prng)return b.prng;b.defined.prng=!0;for(var l=0;l<e.length;++l)e[l](b);return b.prng}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,
339
+0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/prng",["require","module","./md","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.random&&c.random.getBytes||function(a){function b(){var a=c.prng.create(d);a.getBytes=function(c,b){return a.generate(c,b)};a.getBytesSync=function(c){return a.generate(c)};return a}var d={},g=Array(4),n=c.util.createBuffer();d.formatKey=function(a){var b=c.util.createBuffer(a);a=Array(4);
340
+a[0]=b.getInt32();a[1]=b.getInt32();a[2]=b.getInt32();a[3]=b.getInt32();return c.aes._expandKey(a,!1)};d.formatSeed=function(a){var b=c.util.createBuffer(a);a=Array(4);a[0]=b.getInt32();a[1]=b.getInt32();a[2]=b.getInt32();a[3]=b.getInt32();return a};d.cipher=function(a,b){c.aes._updateBlock(a,b,g,!1);n.putInt32(g[0]);n.putInt32(g[1]);n.putInt32(g[2]);n.putInt32(g[3]);return n.getBytes()};d.increment=function(a){++a[3];return a};d.md=c.md.sha256;var k=b(),h="undefined"!==typeof process&&process.versions&&
341
+process.versions.node,C=null;if("undefined"!==typeof window){var p=window.crypto||window.msCrypto;p&&p.getRandomValues&&(C=function(a){return p.getRandomValues(a)})}if(c.disableNativeCode||!h&&!C){k.collectInt(+new Date,32);if("undefined"!==typeof navigator){var h="",F;for(F in navigator)try{"string"==typeof navigator[F]&&(h+=navigator[F])}catch(y){}k.collect(h);h=null}a&&(a().mousemove(function(a){k.collectInt(a.clientX,16);k.collectInt(a.clientY,16)}),a().keypress(function(a){k.collectInt(a.charCode,
342
+8)}))}if(c.random)for(F in k)c.random[F]=k[F];else c.random=k;c.random.createInstance=b}("undefined"!==typeof jQuery?jQuery:null)}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.random)return b.random;b.defined.random=!0;for(var l=0;l<e.length;++l)e[l](b);
343
+return b.random}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/random","require module ./aes ./md ./prng ./util".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=[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,
344
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,
344
-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];c.rc2=c.rc2||{};c.rc2.expandKey=function(a,d){"string"===typeof a&&(a=c.util.createBuffer(a));d=d||128;var e=a,g=a.length(),f=d,n=Math.ceil(f/8),f=255>>(f&7),v;for(v=g;128>v;v++)e.putByte(b[e.at(v-
345
-1)+e.at(v-g)&255]);e.setAt(128-n,b[e.at(128-n)&f]);for(v=127-n;0<=v;v--)e.setAt(v,b[e.at(v+1)^e.at(v+n)]);return e};var e=function(a,b,e){var g=!1,k=null,f=null,m=null,w,y,p,A,r=[];a=c.rc2.expandKey(a,b);for(p=0;64>p;p++)r.push(a.getInt16Le());e?(w=function(a){for(p=0;4>p;p++){a[p]+=r[A]+(a[(p+3)%4]&a[(p+2)%4])+(~a[(p+3)%4]&a[(p+1)%4]);var c=a[p],b=d[p];a[p]=c<<b&65535|(c&65535)>>16-b;A++}},y=function(a){for(p=0;4>p;p++)a[p]+=r[a[(p+3)%4]&63]}):(w=function(a){for(p=3;0<=p;p--){var c=a[p],b=d[p];a[p]=
346
-(c&65535)>>b|c<<16-b&65535;a[p]-=r[A]+(a[(p+3)%4]&a[(p+2)%4])+(~a[(p+3)%4]&a[(p+1)%4]);A--}},y=function(a){for(p=3;0<=p;p--)a[p]-=r[a[(p+3)%4]&63]});var z=null;return z={start:function(a,b){a&&"string"===typeof a&&(a=c.util.createBuffer(a));g=!1;k=c.util.createBuffer();f=b||new c.util.createBuffer;m=a;z.output=f},update:function(a){for(g||k.putBuffer(a);8<=k.length();){a=[[5,w],[1,y],[6,w],[1,y],[5,w]];var c=[];for(p=0;4>p;p++){var b=k.getInt16Le();null!==m&&(e?b^=m.getInt16Le():m.putInt16Le(b));
347
-c.push(b&65535)}A=e?0:63;for(b=0;b<a.length;b++)for(var d=0;d<a[b][0];d++)a[b][1](c);for(p=0;4>p;p++)null!==m&&(e?m.putInt16Le(c[p]):c[p]^=m.getInt16Le()),f.putInt16Le(c[p])}},finish:function(a){var c=!0;if(e)if(a)c=a(8,k,!e);else{var b=8===k.length()?8:8-k.length();k.fillWithByte(b,b)}c&&(g=!0,z.update());!e&&(c=0===k.length())&&(a?c=a(8,f,!e):(a=f.length(),b=f.at(a-1),b>a?c=!1:f.truncate(b)));return c}}};c.rc2.startEncrypting=function(a,b,d){a=c.rc2.createEncryptionCipher(a,128);a.start(b,d);return a};
348
-c.rc2.createEncryptionCipher=function(a,c){return e(a,c,!0)};c.rc2.startDecrypting=function(a,b,d){a=c.rc2.createDecryptionCipher(a,128);a.start(b,d);return a};c.rc2.createDecryptionCipher=function(a,c){return e(a,c,!1)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||
349
-{};if(b.defined.rc2)return b.rc2;b.defined.rc2=!0;for(var k=0;k<e.length;++k)e[k](b);return b.rc2}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/rc2",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){this.data=[];null!=a&&("number"==typeof a?
350
-this.fromNumber(a,c,d):null==c&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,c))}function d(){return new b(null)}function e(a,c,b,d,l,g){for(;0<=--g;){var e=c*this.data[a++]+b.data[d]+l;l=Math.floor(e/67108864);b.data[d++]=e&67108863}return l}function f(a,c,b,d,l,g){var e=c&32767;for(c>>=15;0<=--g;){var h=this.data[a]&32767,k=this.data[a++]>>15,n=c*h+k*e,h=e*h+((n&32767)<<15)+b.data[d]+(l&1073741823);l=(h>>>30)+(n>>>15)+c*k+(l>>>30);b.data[d++]=h&1073741823}return l}function m(a,c,
351
-b,d,l,g){var e=c&16383;for(c>>=14;0<=--g;){var h=this.data[a]&16383,f=this.data[a++]>>14,k=c*h+f*e,h=e*h+((k&16383)<<14)+b.data[d]+l;l=(h>>28)+(k>>14)+c*f;b.data[d++]=h&268435455}return l}function h(a,c){var b=X[a.charCodeAt(c)];return null==b?-1:b}function g(a){var c=d();c.fromInt(a);return c}function p(a){var c=1,b;0!=(b=a>>>16)&&(a=b,c+=16);0!=(b=a>>8)&&(a=b,c+=8);0!=(b=a>>4)&&(a=b,c+=4);0!=(b=a>>2)&&(a=b,c+=2);0!=a>>1&&(c+=1);return c}function n(a){this.m=a}function F(a){this.m=a;this.mp=a.invDigit();
352
-this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}function w(a,c){return a&c}function y(a,c){return a|c}function r(a,c){return a^c}function A(a,c){return a&~c}function L(){}function z(a){return a}function C(a){this.r2=d();this.q3=d();b.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function x(){return{nextBytes:function(a){for(var c=0;c<a.length;++c)a[c]=Math.floor(256*Math.random())}}}var I;"undefined"===typeof navigator?(b.prototype.am=m,I=28):"Microsoft Internet Explorer"==
353
-navigator.appName?(b.prototype.am=f,I=30):"Netscape"!=navigator.appName?(b.prototype.am=e,I=26):(b.prototype.am=m,I=28);b.prototype.DB=I;b.prototype.DM=(1<<I)-1;b.prototype.DV=1<<I;b.prototype.FV=Math.pow(2,52);b.prototype.F1=52-I;b.prototype.F2=2*I-52;var X=[],q;I=48;for(q=0;9>=q;++q)X[I++]=q;I=97;for(q=10;36>q;++q)X[I++]=q;I=65;for(q=10;36>q;++q)X[I++]=q;n.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};n.prototype.revert=function(a){return a};n.prototype.reduce=
354
-function(a){a.divRemTo(this.m,null,a)};n.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b);this.reduce(b)};n.prototype.sqrTo=function(a,c){a.squareTo(c);this.reduce(c)};F.prototype.convert=function(a){var c=d();a.abs().dlShiftTo(this.m.t,c);c.divRemTo(this.m,null,c);0>a.s&&0<c.compareTo(b.ZERO)&&this.m.subTo(c,c);return c};F.prototype.revert=function(a){var c=d();a.copyTo(c);this.reduce(c);return c};F.prototype.reduce=function(a){for(;a.t<=this.mt2;)a.data[a.t++]=0;for(var c=0;c<this.m.t;++c){var b=
345
+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];c.rc2=c.rc2||{};c.rc2.expandKey=function(a,d){"string"===typeof a&&(a=c.util.createBuffer(a));d=d||128;var e=a,h=a.length(),g=d,p=Math.ceil(g/8),g=255>>(g&7),w;for(w=h;128>w;w++)e.putByte(b[e.at(w-
346
+1)+e.at(w-h)&255]);e.setAt(128-p,b[e.at(128-p)&g]);for(w=127-p;0<=w;w--)e.setAt(w,b[e.at(w+1)^e.at(w+p)]);return e};var e=function(a,b,e){var h=!1,l=null,g=null,n=null,y,z,A,D,r=[];a=c.rc2.expandKey(a,b);for(A=0;64>A;A++)r.push(a.getInt16Le());e?(y=function(a){for(A=0;4>A;A++){a[A]+=r[D]+(a[(A+3)%4]&a[(A+2)%4])+(~a[(A+3)%4]&a[(A+1)%4]);var c=a[A],b=d[A];a[A]=c<<b&65535|(c&65535)>>16-b;D++}},z=function(a){for(A=0;4>A;A++)a[A]+=r[a[(A+3)%4]&63]}):(y=function(a){for(A=3;0<=A;A--){var c=a[A],b=d[A];a[A]=
347
+(c&65535)>>b|c<<16-b&65535;a[A]-=r[D]+(a[(A+3)%4]&a[(A+2)%4])+(~a[(A+3)%4]&a[(A+1)%4]);D--}},z=function(a){for(A=3;0<=A;A--)a[A]-=r[a[(A+3)%4]&63]});var x=null;return x={start:function(a,b){a&&"string"===typeof a&&(a=c.util.createBuffer(a));h=!1;l=c.util.createBuffer();g=b||new c.util.createBuffer;n=a;x.output=g},update:function(a){for(h||l.putBuffer(a);8<=l.length();){a=[[5,y],[1,z],[6,y],[1,z],[5,y]];var c=[];for(A=0;4>A;A++){var b=l.getInt16Le();null!==n&&(e?b^=n.getInt16Le():n.putInt16Le(b));
348
+c.push(b&65535)}D=e?0:63;for(b=0;b<a.length;b++)for(var d=0;d<a[b][0];d++)a[b][1](c);for(A=0;4>A;A++)null!==n&&(e?n.putInt16Le(c[A]):c[A]^=n.getInt16Le()),g.putInt16Le(c[A])}},finish:function(a){var c=!0;if(e)if(a)c=a(8,l,!e);else{var b=8===l.length()?8:8-l.length();l.fillWithByte(b,b)}c&&(h=!0,x.update());!e&&(c=0===l.length())&&(a?c=a(8,g,!e):(a=g.length(),b=g.at(a-1),b>a?c=!1:g.truncate(b)));return c}}};c.rc2.startEncrypting=function(a,b,d){a=c.rc2.createEncryptionCipher(a,128);a.start(b,d);return a};
349
+c.rc2.createEncryptionCipher=function(a,c){return e(a,c,!0)};c.rc2.startDecrypting=function(a,b,d){a=c.rc2.createDecryptionCipher(a,128);a.start(b,d);return a};c.rc2.createDecryptionCipher=function(a,c){return e(a,c,!1)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||
350
+{};if(b.defined.rc2)return b.rc2;b.defined.rc2=!0;for(var l=0;l<e.length;++l)e[l](b);return b.rc2}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/rc2",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d){this.data=[];null!=a&&("number"==typeof a?
351
+this.fromNumber(a,c,d):null==c&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,c))}function d(){return new b(null)}function e(a,c,b,d,m,h){for(;0<=--h;){var e=c*this.data[a++]+b.data[d]+m;m=Math.floor(e/67108864);b.data[d++]=e&67108863}return m}function g(a,c,b,d,m,h){var e=c&32767;for(c>>=15;0<=--h;){var k=this.data[a]&32767,l=this.data[a++]>>15,x=c*k+l*e,k=e*k+((x&32767)<<15)+b.data[d]+(m&1073741823);m=(k>>>30)+(x>>>15)+c*l+(m>>>30);b.data[d++]=k&1073741823}return m}function n(a,c,
352
+b,d,m,h){var e=c&16383;for(c>>=14;0<=--h;){var k=this.data[a]&16383,l=this.data[a++]>>14,g=c*k+l*e,k=e*k+((g&16383)<<14)+b.data[d]+m;m=(k>>28)+(g>>14)+c*l;b.data[d++]=k&268435455}return m}function k(a,c){var b=u[a.charCodeAt(c)];return null==b?-1:b}function h(a){var c=d();c.fromInt(a);return c}function C(a){var c=1,b;0!=(b=a>>>16)&&(a=b,c+=16);0!=(b=a>>8)&&(a=b,c+=8);0!=(b=a>>4)&&(a=b,c+=4);0!=(b=a>>2)&&(a=b,c+=2);0!=a>>1&&(c+=1);return c}function p(a){this.m=a}function F(a){this.m=a;this.mp=a.invDigit();
353
+this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<a.DB-15)-1;this.mt2=2*a.t}function y(a,c){return a&c}function z(a,c){return a|c}function A(a,c){return a^c}function D(a,c){return a&~c}function r(){}function x(a){return a}function G(a){this.r2=d();this.q3=d();b.ONE.dlShiftTo(2*a.t,this.r2);this.mu=this.r2.divide(a);this.m=a}function B(){return{nextBytes:function(a){for(var c=0;c<a.length;++c)a[c]=Math.floor(256*Math.random())}}}var H;"undefined"===typeof navigator?(b.prototype.am=n,H=28):"Microsoft Internet Explorer"==
354
+navigator.appName?(b.prototype.am=g,H=30):"Netscape"!=navigator.appName?(b.prototype.am=e,H=26):(b.prototype.am=n,H=28);b.prototype.DB=H;b.prototype.DM=(1<<H)-1;b.prototype.DV=1<<H;b.prototype.FV=Math.pow(2,52);b.prototype.F1=52-H;b.prototype.F2=2*H-52;var u=[],q;H=48;for(q=0;9>=q;++q)u[H++]=q;H=97;for(q=10;36>q;++q)u[H++]=q;H=65;for(q=10;36>q;++q)u[H++]=q;p.prototype.convert=function(a){return 0>a.s||0<=a.compareTo(this.m)?a.mod(this.m):a};p.prototype.revert=function(a){return a};p.prototype.reduce=
355
+function(a){a.divRemTo(this.m,null,a)};p.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b);this.reduce(b)};p.prototype.sqrTo=function(a,c){a.squareTo(c);this.reduce(c)};F.prototype.convert=function(a){var c=d();a.abs().dlShiftTo(this.m.t,c);c.divRemTo(this.m,null,c);0>a.s&&0<c.compareTo(b.ZERO)&&this.m.subTo(c,c);return c};F.prototype.revert=function(a){var c=d();a.copyTo(c);this.reduce(c);return c};F.prototype.reduce=function(a){for(;a.t<=this.mt2;)a.data[a.t++]=0;for(var c=0;c<this.m.t;++c){var b=
356
a.data[c]&32767,d=b*this.mpl+((b*this.mph+(a.data[c]>>15)*this.mpl&this.um)<<15)&a.DM,b=c+this.m.t;for(a.data[b]+=this.m.am(0,d,a,c,0,this.m.t);a.data[b]>=a.DV;)a.data[b]-=a.DV,a.data[++b]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)};F.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b);this.reduce(b)};F.prototype.sqrTo=function(a,c){a.squareTo(c);this.reduce(c)};b.prototype.copyTo=function(a){for(var c=this.t-1;0<=c;--c)a.data[c]=this.data[c];a.t=this.t;a.s=this.s};
356
-b.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};b.prototype.fromString=function(a,c){var d;if(16==c)d=4;else if(8==c)d=3;else if(256==c)d=8;else if(2==c)d=1;else if(32==c)d=5;else if(4==c)d=2;else{this.fromRadix(a,c);return}this.s=this.t=0;for(var l=a.length,g=!1,e=0;0<=--l;){var f=8==d?a[l]&255:h(a,l);0>f?"-"==a.charAt(l)&&(g=!0):(g=!1,0==e?this.data[this.t++]=f:e+d>this.DB?(this.data[this.t-1]|=(f&(1<<this.DB-e)-1)<<e,this.data[this.t++]=
357
-f>>this.DB-e):this.data[this.t-1]|=f<<e,e+=d,e>=this.DB&&(e-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0<e&&(this.data[this.t-1]|=(1<<this.DB-e)-1<<e));this.clamp();g&&b.ZERO.subTo(this,this)};b.prototype.clamp=function(){for(var a=this.s&this.DM;0<this.t&&this.data[this.t-1]==a;)--this.t};b.prototype.dlShiftTo=function(a,c){var b;for(b=this.t-1;0<=b;--b)c.data[b+a]=this.data[b];for(b=a-1;0<=b;--b)c.data[b]=0;c.t=this.t+a;c.s=this.s};b.prototype.drShiftTo=function(a,c){for(var b=a;b<this.t;++b)c.data[b-
358
-a]=this.data[b];c.t=Math.max(this.t-a,0);c.s=this.s};b.prototype.lShiftTo=function(a,c){var b=a%this.DB,d=this.DB-b,l=(1<<d)-1,e=Math.floor(a/this.DB),g=this.s<<b&this.DM,h;for(h=this.t-1;0<=h;--h)c.data[h+e+1]=this.data[h]>>d|g,g=(this.data[h]&l)<<b;for(h=e-1;0<=h;--h)c.data[h]=0;c.data[e]=g;c.t=this.t+e+1;c.s=this.s;c.clamp()};b.prototype.rShiftTo=function(a,c){c.s=this.s;var b=Math.floor(a/this.DB);if(b>=this.t)c.t=0;else{var d=a%this.DB,l=this.DB-d,e=(1<<d)-1;c.data[0]=this.data[b]>>d;for(var g=
359
-b+1;g<this.t;++g)c.data[g-b-1]|=(this.data[g]&e)<<l,c.data[g-b]=this.data[g]>>d;0<d&&(c.data[this.t-b-1]|=(this.s&e)<<l);c.t=this.t-b;c.clamp()}};b.prototype.subTo=function(a,c){for(var b=0,d=0,l=Math.min(a.t,this.t);b<l;)d+=this.data[b]-a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;b<this.t;)d+=this.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;b<a.t;)d-=a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d-=a.s}c.s=0>d?-1:0;-1>d?c.data[b++]=this.DV+d:0<d&&
360
-(c.data[b++]=d);c.t=b;c.clamp()};b.prototype.multiplyTo=function(a,c){var d=this.abs(),l=a.abs(),e=d.t;for(c.t=e+l.t;0<=--e;)c.data[e]=0;for(e=0;e<l.t;++e)c.data[e+d.t]=d.am(0,l.data[e],c,e,0,d.t);c.s=0;c.clamp();this.s!=a.s&&b.ZERO.subTo(c,c)};b.prototype.squareTo=function(a){for(var c=this.abs(),b=a.t=2*c.t;0<=--b;)a.data[b]=0;for(b=0;b<c.t-1;++b){var d=c.am(b,c.data[b],a,2*b,0,1);(a.data[b+c.t]+=c.am(b+1,2*c.data[b],a,2*b+1,d,c.t-b-1))>=c.DV&&(a.data[b+c.t]-=c.DV,a.data[b+c.t+1]=1)}0<a.t&&(a.data[a.t-
361
-1]+=c.am(b,c.data[b],a,2*b,0,1));a.s=0;a.clamp()};b.prototype.divRemTo=function(a,c,l){var e=a.abs();if(!(0>=e.t)){var g=this.abs();if(g.t<e.t)null!=c&&c.fromInt(0),null!=l&&this.copyTo(l);else{null==l&&(l=d());var h=d(),f=this.s;a=a.s;var n=this.DB-p(e.data[e.t-1]);0<n?(e.lShiftTo(n,h),g.lShiftTo(n,l)):(e.copyTo(h),g.copyTo(l));e=h.t;g=h.data[e-1];if(0!=g){var z=g*(1<<this.F1)+(1<e?h.data[e-2]>>this.F2:0),q=this.FV/z,z=(1<<this.F1)/z,x=1<<this.F2,C=l.t,u=C-e,m=null==c?d():c;h.dlShiftTo(u,m);0<=l.compareTo(m)&&
362
-(l.data[l.t++]=1,l.subTo(m,l));b.ONE.dlShiftTo(e,m);for(m.subTo(h,h);h.t<e;)h.data[h.t++]=0;for(;0<=--u;){var w=l.data[--C]==g?this.DM:Math.floor(l.data[C]*q+(l.data[C-1]+x)*z);if((l.data[C]+=h.am(0,w,l,u,0,e))<w)for(h.dlShiftTo(u,m),l.subTo(m,l);l.data[C]<--w;)l.subTo(m,l)}null!=c&&(l.drShiftTo(e,c),f!=a&&b.ZERO.subTo(c,c));l.t=e;l.clamp();0<n&&l.rShiftTo(n,l);0>f&&b.ZERO.subTo(l,l)}}}};b.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var c=a&3,c=c*(2-
363
-(a&15)*c)&15,c=c*(2-(a&255)*c)&255,c=c*(2-((a&65535)*c&65535))&65535,c=c*(2-a*c%this.DV)%this.DV;return 0<c?this.DV-c:-c};b.prototype.isEven=function(){return 0==(0<this.t?this.data[0]&1:this.s)};b.prototype.exp=function(a,c){if(4294967295<a||1>a)return b.ONE;var l=d(),e=d(),g=c.convert(this),h=p(a)-1;for(g.copyTo(l);0<=--h;)if(c.sqrTo(l,e),0<(a&1<<h))c.mulTo(e,g,l);else var f=l,l=e,e=f;return c.revert(l)};b.prototype.toString=function(a){if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=
364
-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 c=(1<<a)-1,b,d=!1,l="",e=this.t,g=this.DB-e*this.DB%a;if(0<e--)for(g<this.DB&&0<(b=this.data[e]>>g)&&(d=!0,l="0123456789abcdefghijklmnopqrstuvwxyz".charAt(b));0<=e;)g<a?(b=(this.data[e]&(1<<g)-1)<<a-g,b|=this.data[--e]>>(g+=this.DB-a)):(b=this.data[e]>>(g-=a)&c,0>=g&&(g+=this.DB,--e)),0<b&&(d=!0),d&&(l+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(b));return d?l:"0"};b.prototype.negate=function(){var a=
365
-d();b.ZERO.subTo(this,a);return a};b.prototype.abs=function(){return 0>this.s?this.negate():this};b.prototype.compareTo=function(a){var c=this.s-a.s;if(0!=c)return c;var b=this.t,c=b-a.t;if(0!=c)return 0>this.s?-c:c;for(;0<=--b;)if(0!=(c=this.data[b]-a.data[b]))return c;return 0};b.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)};b.prototype.mod=function(a){var c=d();this.abs().divRemTo(a,null,c);0>this.s&&0<c.compareTo(b.ZERO)&&a.subTo(c,
366
-c);return c};b.prototype.modPowInt=function(a,c){var b;b=256>a||c.isEven()?new n(c):new F(c);return this.exp(a,b)};b.ZERO=g(0);b.ONE=g(1);L.prototype.convert=z;L.prototype.revert=z;L.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b)};L.prototype.sqrTo=function(a,c){a.squareTo(c)};C.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 c=d();a.copyTo(c);this.reduce(c);return c};C.prototype.revert=function(a){return a};C.prototype.reduce=function(a){a.drShiftTo(this.m.t-
367
-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)};C.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b);this.reduce(b)};C.prototype.sqrTo=function(a,c){a.squareTo(c);this.reduce(c)};var O=[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,
368
-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],M=67108864/O[O.length-1];b.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};b.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36<a)return"0";var c=this.chunkSize(a),c=Math.pow(a,
369
-c),b=g(c),l=d(),e=d(),h="";for(this.divRemTo(b,l,e);0<l.signum();)h=(c+e.intValue()).toString(a).substr(1)+h,l.divRemTo(b,l,e);return e.intValue().toString(a)+h};b.prototype.fromRadix=function(a,c){this.fromInt(0);null==c&&(c=10);for(var d=this.chunkSize(c),l=Math.pow(c,d),e=!1,g=0,f=0,n=0;n<a.length;++n){var z=h(a,n);0>z?"-"==a.charAt(n)&&0==this.signum()&&(e=!0):(f=c*f+z,++g>=d&&(this.dMultiply(l),this.dAddOffset(f,0),f=g=0))}0<g&&(this.dMultiply(Math.pow(c,g)),this.dAddOffset(f,0));e&&b.ZERO.subTo(this,
370
-this)};b.prototype.fromNumber=function(a,c,d){if("number"==typeof c)if(2>a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(b.ONE.shiftLeft(a-1),y,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(c);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(b.ONE.shiftLeft(a-1),this);else{d=[];var l=a&7;d.length=(a>>3)+1;c.nextBytes(d);d[0]=0<l?d[0]&(1<<l)-1:0;this.fromString(d,256)}};b.prototype.bitwiseTo=function(a,c,b){var d,l,e=Math.min(a.t,this.t);for(d=
371
-0;d<e;++d)b.data[d]=c(this.data[d],a.data[d]);if(a.t<this.t){l=a.s&this.DM;for(d=e;d<this.t;++d)b.data[d]=c(this.data[d],l);b.t=this.t}else{l=this.s&this.DM;for(d=e;d<a.t;++d)b.data[d]=c(l,a.data[d]);b.t=a.t}b.s=c(this.s,a.s);b.clamp()};b.prototype.changeBit=function(a,c){var d=b.ONE.shiftLeft(a);this.bitwiseTo(d,c,d);return d};b.prototype.addTo=function(a,c){for(var b=0,d=0,l=Math.min(a.t,this.t);b<l;)d+=this.data[b]+a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;b<this.t;)d+=
357
+b.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};b.prototype.fromString=function(a,c){var d;if(16==c)d=4;else if(8==c)d=3;else if(256==c)d=8;else if(2==c)d=1;else if(32==c)d=5;else if(4==c)d=2;else{this.fromRadix(a,c);return}this.s=this.t=0;for(var m=a.length,h=!1,e=0;0<=--m;){var g=8==d?a[m]&255:k(a,m);0>g?"-"==a.charAt(m)&&(h=!0):(h=!1,0==e?this.data[this.t++]=g:e+d>this.DB?(this.data[this.t-1]|=(g&(1<<this.DB-e)-1)<<e,this.data[this.t++]=
358
+g>>this.DB-e):this.data[this.t-1]|=g<<e,e+=d,e>=this.DB&&(e-=this.DB))}8==d&&0!=(a[0]&128)&&(this.s=-1,0<e&&(this.data[this.t-1]|=(1<<this.DB-e)-1<<e));this.clamp();h&&b.ZERO.subTo(this,this)};b.prototype.clamp=function(){for(var a=this.s&this.DM;0<this.t&&this.data[this.t-1]==a;)--this.t};b.prototype.dlShiftTo=function(a,c){var b;for(b=this.t-1;0<=b;--b)c.data[b+a]=this.data[b];for(b=a-1;0<=b;--b)c.data[b]=0;c.t=this.t+a;c.s=this.s};b.prototype.drShiftTo=function(a,c){for(var b=a;b<this.t;++b)c.data[b-
359
+a]=this.data[b];c.t=Math.max(this.t-a,0);c.s=this.s};b.prototype.lShiftTo=function(a,c){var b=a%this.DB,d=this.DB-b,m=(1<<d)-1,h=Math.floor(a/this.DB),e=this.s<<b&this.DM,k;for(k=this.t-1;0<=k;--k)c.data[k+h+1]=this.data[k]>>d|e,e=(this.data[k]&m)<<b;for(k=h-1;0<=k;--k)c.data[k]=0;c.data[h]=e;c.t=this.t+h+1;c.s=this.s;c.clamp()};b.prototype.rShiftTo=function(a,c){c.s=this.s;var b=Math.floor(a/this.DB);if(b>=this.t)c.t=0;else{var d=a%this.DB,m=this.DB-d,h=(1<<d)-1;c.data[0]=this.data[b]>>d;for(var e=
360
+b+1;e<this.t;++e)c.data[e-b-1]|=(this.data[e]&h)<<m,c.data[e-b]=this.data[e]>>d;0<d&&(c.data[this.t-b-1]|=(this.s&h)<<m);c.t=this.t-b;c.clamp()}};b.prototype.subTo=function(a,c){for(var b=0,d=0,m=Math.min(a.t,this.t);b<m;)d+=this.data[b]-a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d-=a.s;b<this.t;)d+=this.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;b<a.t;)d-=a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d-=a.s}c.s=0>d?-1:0;-1>d?c.data[b++]=this.DV+d:0<d&&
361
+(c.data[b++]=d);c.t=b;c.clamp()};b.prototype.multiplyTo=function(a,c){var d=this.abs(),m=a.abs(),h=d.t;for(c.t=h+m.t;0<=--h;)c.data[h]=0;for(h=0;h<m.t;++h)c.data[h+d.t]=d.am(0,m.data[h],c,h,0,d.t);c.s=0;c.clamp();this.s!=a.s&&b.ZERO.subTo(c,c)};b.prototype.squareTo=function(a){for(var c=this.abs(),b=a.t=2*c.t;0<=--b;)a.data[b]=0;for(b=0;b<c.t-1;++b){var d=c.am(b,c.data[b],a,2*b,0,1);(a.data[b+c.t]+=c.am(b+1,2*c.data[b],a,2*b+1,d,c.t-b-1))>=c.DV&&(a.data[b+c.t]-=c.DV,a.data[b+c.t+1]=1)}0<a.t&&(a.data[a.t-
362
+1]+=c.am(b,c.data[b],a,2*b,0,1));a.s=0;a.clamp()};b.prototype.divRemTo=function(a,c,m){var h=a.abs();if(!(0>=h.t)){var e=this.abs();if(e.t<h.t)null!=c&&c.fromInt(0),null!=m&&this.copyTo(m);else{null==m&&(m=d());var k=d(),g=this.s;a=a.s;var x=this.DB-C(h.data[h.t-1]);0<x?(h.lShiftTo(x,k),e.lShiftTo(x,m)):(h.copyTo(k),e.copyTo(m));h=k.t;e=k.data[h-1];if(0!=e){var p=e*(1<<this.F1)+(1<h?k.data[h-2]>>this.F2:0),q=this.FV/p,p=(1<<this.F1)/p,B=1<<this.F2,v=m.t,G=v-h,n=null==c?d():c;k.dlShiftTo(G,n);0<=m.compareTo(n)&&
363
+(m.data[m.t++]=1,m.subTo(n,m));b.ONE.dlShiftTo(h,n);for(n.subTo(k,k);k.t<h;)k.data[k.t++]=0;for(;0<=--G;){var y=m.data[--v]==e?this.DM:Math.floor(m.data[v]*q+(m.data[v-1]+B)*p);if((m.data[v]+=k.am(0,y,m,G,0,h))<y)for(k.dlShiftTo(G,n),m.subTo(n,m);m.data[v]<--y;)m.subTo(n,m)}null!=c&&(m.drShiftTo(h,c),g!=a&&b.ZERO.subTo(c,c));m.t=h;m.clamp();0<x&&m.rShiftTo(x,m);0>g&&b.ZERO.subTo(m,m)}}}};b.prototype.invDigit=function(){if(1>this.t)return 0;var a=this.data[0];if(0==(a&1))return 0;var c=a&3,c=c*(2-
364
+(a&15)*c)&15,c=c*(2-(a&255)*c)&255,c=c*(2-((a&65535)*c&65535))&65535,c=c*(2-a*c%this.DV)%this.DV;return 0<c?this.DV-c:-c};b.prototype.isEven=function(){return 0==(0<this.t?this.data[0]&1:this.s)};b.prototype.exp=function(a,c){if(4294967295<a||1>a)return b.ONE;var m=d(),h=d(),e=c.convert(this),k=C(a)-1;for(e.copyTo(m);0<=--k;)if(c.sqrTo(m,h),0<(a&1<<k))c.mulTo(h,e,m);else var g=m,m=h,h=g;return c.revert(m)};b.prototype.toString=function(a){if(0>this.s)return"-"+this.negate().toString(a);if(16==a)a=
365
+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 c=(1<<a)-1,b,d=!1,m="",h=this.t,e=this.DB-h*this.DB%a;if(0<h--)for(e<this.DB&&0<(b=this.data[h]>>e)&&(d=!0,m="0123456789abcdefghijklmnopqrstuvwxyz".charAt(b));0<=h;)e<a?(b=(this.data[h]&(1<<e)-1)<<a-e,b|=this.data[--h]>>(e+=this.DB-a)):(b=this.data[h]>>(e-=a)&c,0>=e&&(e+=this.DB,--h)),0<b&&(d=!0),d&&(m+="0123456789abcdefghijklmnopqrstuvwxyz".charAt(b));return d?m:"0"};b.prototype.negate=function(){var a=
366
+d();b.ZERO.subTo(this,a);return a};b.prototype.abs=function(){return 0>this.s?this.negate():this};b.prototype.compareTo=function(a){var c=this.s-a.s;if(0!=c)return c;var b=this.t,c=b-a.t;if(0!=c)return 0>this.s?-c:c;for(;0<=--b;)if(0!=(c=this.data[b]-a.data[b]))return c;return 0};b.prototype.bitLength=function(){return 0>=this.t?0:this.DB*(this.t-1)+C(this.data[this.t-1]^this.s&this.DM)};b.prototype.mod=function(a){var c=d();this.abs().divRemTo(a,null,c);0>this.s&&0<c.compareTo(b.ZERO)&&a.subTo(c,
367
+c);return c};b.prototype.modPowInt=function(a,c){var b;b=256>a||c.isEven()?new p(c):new F(c);return this.exp(a,b)};b.ZERO=h(0);b.ONE=h(1);r.prototype.convert=x;r.prototype.revert=x;r.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b)};r.prototype.sqrTo=function(a,c){a.squareTo(c)};G.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 c=d();a.copyTo(c);this.reduce(c);return c};G.prototype.revert=function(a){return a};G.prototype.reduce=function(a){a.drShiftTo(this.m.t-
368
+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)};G.prototype.mulTo=function(a,c,b){a.multiplyTo(c,b);this.reduce(b)};G.prototype.sqrTo=function(a,c){a.squareTo(c);this.reduce(c)};var P=[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,
369
+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],M=67108864/P[P.length-1];b.prototype.chunkSize=function(a){return Math.floor(Math.LN2*this.DB/Math.log(a))};b.prototype.toRadix=function(a){null==a&&(a=10);if(0==this.signum()||2>a||36<a)return"0";var c=this.chunkSize(a),c=Math.pow(a,
370
+c),b=h(c),m=d(),e=d(),k="";for(this.divRemTo(b,m,e);0<m.signum();)k=(c+e.intValue()).toString(a).substr(1)+k,m.divRemTo(b,m,e);return e.intValue().toString(a)+k};b.prototype.fromRadix=function(a,c){this.fromInt(0);null==c&&(c=10);for(var d=this.chunkSize(c),m=Math.pow(c,d),h=!1,e=0,g=0,x=0;x<a.length;++x){var p=k(a,x);0>p?"-"==a.charAt(x)&&0==this.signum()&&(h=!0):(g=c*g+p,++e>=d&&(this.dMultiply(m),this.dAddOffset(g,0),g=e=0))}0<e&&(this.dMultiply(Math.pow(c,e)),this.dAddOffset(g,0));h&&b.ZERO.subTo(this,
371
+this)};b.prototype.fromNumber=function(a,c,d){if("number"==typeof c)if(2>a)this.fromInt(1);else for(this.fromNumber(a,d),this.testBit(a-1)||this.bitwiseTo(b.ONE.shiftLeft(a-1),z,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(c);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(b.ONE.shiftLeft(a-1),this);else{d=[];var m=a&7;d.length=(a>>3)+1;c.nextBytes(d);d[0]=0<m?d[0]&(1<<m)-1:0;this.fromString(d,256)}};b.prototype.bitwiseTo=function(a,c,b){var d,m,h=Math.min(a.t,this.t);for(d=
372
+0;d<h;++d)b.data[d]=c(this.data[d],a.data[d]);if(a.t<this.t){m=a.s&this.DM;for(d=h;d<this.t;++d)b.data[d]=c(this.data[d],m);b.t=this.t}else{m=this.s&this.DM;for(d=h;d<a.t;++d)b.data[d]=c(m,a.data[d]);b.t=a.t}b.s=c(this.s,a.s);b.clamp()};b.prototype.changeBit=function(a,c){var d=b.ONE.shiftLeft(a);this.bitwiseTo(d,c,d);return d};b.prototype.addTo=function(a,c){for(var b=0,d=0,m=Math.min(a.t,this.t);b<m;)d+=this.data[b]+a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;if(a.t<this.t){for(d+=a.s;b<this.t;)d+=
373
this.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d+=this.s}else{for(d+=this.s;b<a.t;)d+=a.data[b],c.data[b++]=d&this.DM,d>>=this.DB;d+=a.s}c.s=0>d?-1:0;0<d?c.data[b++]=d:-1>d&&(c.data[b++]=this.DV+d);c.t=b;c.clamp()};b.prototype.dMultiply=function(a){this.data[this.t]=this.am(0,a-1,this,0,0,this.t);++this.t;this.clamp()};b.prototype.dAddOffset=function(a,c){if(0!=a){for(;this.t<=c;)this.data[this.t++]=0;for(this.data[c]+=a;this.data[c]>=this.DV;)this.data[c]-=this.DV,++c>=this.t&&(this.data[this.t++]=
373
-0),++this.data[c]}};b.prototype.multiplyLowerTo=function(a,c,b){var d=Math.min(this.t+a.t,c);b.s=0;for(b.t=d;0<d;)b.data[--d]=0;var l;for(l=b.t-this.t;d<l;++d)b.data[d+this.t]=this.am(0,a.data[d],b,d,0,this.t);for(l=Math.min(a.t,c);d<l;++d)this.am(0,a.data[d],b,d,0,c-d);b.clamp()};b.prototype.multiplyUpperTo=function(a,c,b){--c;var d=b.t=this.t+a.t-c;for(b.s=0;0<=--d;)b.data[d]=0;for(d=Math.max(c-this.t,0);d<a.t;++d)b.data[this.t+d-c]=this.am(c-d,a.data[d],b,0,0,this.t+d-c);b.clamp();b.drShiftTo(1,
374
-b)};b.prototype.modInt=function(a){if(0>=a)return 0;var c=this.DV%a,b=0>this.s?a-1:0;if(0<this.t)if(0==c)b=this.data[0]%a;else for(var d=this.t-1;0<=d;--d)b=(c*b+this.data[d])%a;return b};b.prototype.millerRabin=function(a){var c=this.subtract(b.ONE),d=c.getLowestSetBit();if(0>=d)return!1;for(var l=c.shiftRight(d),e=x(),g,h=0;h<a;++h){do g=new b(this.bitLength(),e);while(0>=g.compareTo(b.ONE)||0<=g.compareTo(c));g=g.modPow(l,this);if(0!=g.compareTo(b.ONE)&&0!=g.compareTo(c)){for(var f=1;f++<d&&0!=
375
-g.compareTo(c);)if(g=g.modPowInt(2,this),0==g.compareTo(b.ONE))return!1;if(0!=g.compareTo(c))return!1}}return!0};b.prototype.clone=function(){var a=d();this.copyTo(a);return a};b.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]};b.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24};b.prototype.shortValue=
376
-function(){return 0==this.t?this.s:this.data[0]<<16>>16};b.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this.data[0]?0:1};b.prototype.toByteArray=function(){var a=this.t,c=[];c[0]=this.s;var b=this.DB-a*this.DB%8,d,l=0;if(0<a--)for(b<this.DB&&(d=this.data[a]>>b)!=(this.s&this.DM)>>b&&(c[l++]=d|this.s<<this.DB-b);0<=a;)if(8>b?(d=(this.data[a]&(1<<b)-1)<<8-b,d|=this.data[--a]>>(b+=this.DB-8)):(d=this.data[a]>>(b-=8)&255,0>=b&&(b+=this.DB,--a)),0!=(d&128)&&(d|=-256),0==l&&
377
-(this.s&128)!=(d&128)&&++l,0<l||d!=this.s)c[l++]=d;return c};b.prototype.equals=function(a){return 0==this.compareTo(a)};b.prototype.min=function(a){return 0>this.compareTo(a)?this:a};b.prototype.max=function(a){return 0<this.compareTo(a)?this:a};b.prototype.and=function(a){var c=d();this.bitwiseTo(a,w,c);return c};b.prototype.or=function(a){var c=d();this.bitwiseTo(a,y,c);return c};b.prototype.xor=function(a){var c=d();this.bitwiseTo(a,r,c);return c};b.prototype.andNot=function(a){var c=d();this.bitwiseTo(a,
378
-A,c);return c};b.prototype.not=function(){for(var a=d(),c=0;c<this.t;++c)a.data[c]=this.DM&~this.data[c];a.t=this.t;a.s=~this.s;return a};b.prototype.shiftLeft=function(a){var c=d();0>a?this.rShiftTo(-a,c):this.lShiftTo(a,c);return c};b.prototype.shiftRight=function(a){var c=d();0>a?this.lShiftTo(-a,c):this.rShiftTo(a,c);return c};b.prototype.getLowestSetBit=function(){for(var a=0;a<this.t;++a)if(0!=this.data[a]){var c=a*this.DB;a=this.data[a];if(0==a)a=-1;else{var b=0;0==(a&65535)&&(a>>=16,b+=16);
379
-0==(a&255)&&(a>>=8,b+=8);0==(a&15)&&(a>>=4,b+=4);0==(a&3)&&(a>>=2,b+=2);0==(a&1)&&++b;a=b}return c+a}return 0>this.s?this.t*this.DB:-1};b.prototype.bitCount=function(){for(var a=0,c=this.s&this.DM,b=0;b<this.t;++b){for(var d=this.data[b]^c,l=0;0!=d;)d&=d-1,++l;a+=l}return a};b.prototype.testBit=function(a){var c=Math.floor(a/this.DB);return c>=this.t?0!=this.s:0!=(this.data[c]&1<<a%this.DB)};b.prototype.setBit=function(a){return this.changeBit(a,y)};b.prototype.clearBit=function(a){return this.changeBit(a,
380
-A)};b.prototype.flipBit=function(a){return this.changeBit(a,r)};b.prototype.add=function(a){var c=d();this.addTo(a,c);return c};b.prototype.subtract=function(a){var c=d();this.subTo(a,c);return c};b.prototype.multiply=function(a){var c=d();this.multiplyTo(a,c);return c};b.prototype.divide=function(a){var c=d();this.divRemTo(a,c,null);return c};b.prototype.remainder=function(a){var c=d();this.divRemTo(a,null,c);return c};b.prototype.divideAndRemainder=function(a){var c=d(),b=d();this.divRemTo(a,c,
381
-b);return[c,b]};b.prototype.modPow=function(a,c){var b=a.bitLength(),l,e=g(1),h;if(0>=b)return e;l=18>b?1:48>b?3:144>b?4:768>b?5:6;h=8>b?new n(c):c.isEven()?new C(c):new F(c);var f=[],k=3,z=l-1,q=(1<<l)-1;f[1]=h.convert(this);if(1<l)for(b=d(),h.sqrTo(f[1],b);k<=q;)f[k]=d(),h.mulTo(b,f[k-2],f[k]),k+=2;for(var x=a.t-1,u,m=!0,w=d(),b=p(a.data[x])-1;0<=x;){b>=z?u=a.data[x]>>b-z&q:(u=(a.data[x]&(1<<b+1)-1)<<z-b,0<x&&(u|=a.data[x-1]>>this.DB+b-z));for(k=l;0==(u&1);)u>>=1,--k;0>(b-=k)&&(b+=this.DB,--x);
382
-if(m)f[u].copyTo(e),m=!1;else{for(;1<k;)h.sqrTo(e,w),h.sqrTo(w,e),k-=2;0<k?h.sqrTo(e,w):(k=e,e=w,w=k);h.mulTo(w,f[u],e)}for(;0<=x&&0==(a.data[x]&1<<b);)h.sqrTo(e,w),k=e,e=w,w=k,0>--b&&(b=this.DB-1,--x)}return h.revert(e)};b.prototype.modInverse=function(a){var c=a.isEven();if(this.isEven()&&c||0==a.signum())return b.ZERO;for(var d=a.clone(),l=this.clone(),e=g(1),h=g(0),f=g(0),n=g(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),c?(e.isEven()&&h.isEven()||(e.addTo(this,e),h.subTo(a,h)),e.rShiftTo(1,
383
-e)):h.isEven()||h.subTo(a,h),h.rShiftTo(1,h);for(;l.isEven();)l.rShiftTo(1,l),c?(f.isEven()&&n.isEven()||(f.addTo(this,f),n.subTo(a,n)),f.rShiftTo(1,f)):n.isEven()||n.subTo(a,n),n.rShiftTo(1,n);0<=d.compareTo(l)?(d.subTo(l,d),c&&e.subTo(f,e),h.subTo(n,h)):(l.subTo(d,l),c&&f.subTo(e,f),n.subTo(h,n))}if(0!=l.compareTo(b.ONE))return b.ZERO;if(0<=n.compareTo(a))return n.subtract(a);if(0>n.signum())n.addTo(a,n);else return n;return 0>n.signum()?n.add(a):n};b.prototype.pow=function(a){return this.exp(a,
384
-new L)};b.prototype.gcd=function(a){var c=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>c.compareTo(a)){var b=c,c=a;a=b}var b=c.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return c;b<d&&(d=b);0<d&&(c.rShiftTo(d,c),a.rShiftTo(d,a));for(;0<c.signum();)0<(b=c.getLowestSetBit())&&c.rShiftTo(b,c),0<(b=a.getLowestSetBit())&&a.rShiftTo(b,a),0<=c.compareTo(a)?(c.subTo(a,c),c.rShiftTo(1,c)):(a.subTo(c,a),a.rShiftTo(1,a));0<d&&a.lShiftTo(d,a);return a};b.prototype.isProbablePrime=
385
-function(a){var c,b=this.abs();if(1==b.t&&b.data[0]<=O[O.length-1]){for(c=0;c<O.length;++c)if(b.data[0]==O[c])return!0;return!1}if(b.isEven())return!1;for(c=1;c<O.length;){for(var d=O[c],l=c+1;l<O.length&&d<M;)d*=O[l++];for(d=b.modInt(d);c<l;)if(0==d%O[c++])return!1}return b.millerRabin(a)};c.jsbn=c.jsbn||{};c.jsbn.BigInteger=b}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,
386
-p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.jsbn)return b.jsbn;b.defined.jsbn=!0;for(var f=0;f<e.length;++f)e[f](b);return b.jsbn}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/jsbn",["require","module"],function(){p.apply(null,Array.prototype.slice.call(arguments,
387
-0))})})();(function(){function a(c){function b(a,d,f){f||(f=c.md.sha1.create());for(var h="",g=Math.ceil(d/f.digestLength),k=0;k<g;++k){var n=String.fromCharCode(k>>24&255,k>>16&255,k>>8&255,k&255);f.start();f.update(a+n);h+=f.digest().getBytes()}return h.substring(0,d)}var d=c.pkcs1=c.pkcs1||{};d.encode_rsa_oaep=function(a,d,f,h,g){var v,n,m,w;"string"===typeof f?(v=f,n=h||void 0,m=g||void 0):f&&(v=f.label||void 0,n=f.seed||void 0,m=f.md||void 0,f.mgf1&&f.mgf1.md&&(w=f.mgf1.md));m?m.start():m=c.md.sha1.create();
388
-w||(w=m);a=Math.ceil(a.n.bitLength()/8);f=a-2*m.digestLength-2;if(d.length>f)throw w=Error("RSAES-OAEP input message length is too long."),w.length=d.length,w.maxLength=f,w;v||(v="");m.update(v,"raw");v=m.digest();h="";f-=d.length;for(g=0;g<f;g++)h+="\x00";d=v.getBytes()+h+"\u0001"+d;if(!n)n=c.random.getBytes(m.digestLength);else if(n.length!==m.digestLength)throw w=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."),w.seedLength=n.length,w.digestLength=m.digestLength,
389
-w;a=b(n,a-m.digestLength-1,w);d=c.util.xorBytes(d,a,d.length);m=b(d,m.digestLength,w);return"\x00"+c.util.xorBytes(n,m,n.length)+d};d.decode_rsa_oaep=function(a,d,f,h){var g,m,n;"string"===typeof f?(g=f,m=h||void 0):f&&(g=f.label||void 0,m=f.md||void 0,f.mgf1&&f.mgf1.md&&(n=f.mgf1.md));f=Math.ceil(a.n.bitLength()/8);if(d.length!==f)throw n=Error("RSAES-OAEP encoded message length is invalid."),n.length=d.length,n.expectedLength=f,n;void 0===m?m=c.md.sha1.create():m.start();n||(n=m);if(f<2*m.digestLength+
390
-2)throw Error("RSAES-OAEP key is too short for the hash function.");g||(g="");m.update(g,"raw");g=m.digest().getBytes();a=d.charAt(0);h=d.substring(1,m.digestLength+1);d=d.substring(1+m.digestLength);var v=b(d,m.digestLength,n);h=c.util.xorBytes(h,v,h.length);n=b(h,f-m.digestLength-1,n);d=c.util.xorBytes(d,n,d.length);f=d.substring(0,m.digestLength);n="\x00"!==a;for(a=0;a<m.digestLength;++a)n|=g.charAt(a)!==f.charAt(a);g=1;for(m=a=m.digestLength;m<d.length;m++)f=d.charCodeAt(m),h=f&1^1,n|=f&(g?65534:
391
-0),g&=h,a+=g;if(n||1!==d.charCodeAt(a))throw Error("Invalid RSAES-OAEP padding.");return d.substring(a+1)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs1)return b.pkcs1;b.defined.pkcs1=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pkcs1}},
392
-r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs1",["require","module","./util","./random","./sha1"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,l,g){return"workers"in l?e(a,c,l,g):d(a,c,l,g)}function d(a,b,e,g){var h=f(a,b),k=0,n=m(h.bitLength());"millerRabinTests"in
393
-e&&(n=e.millerRabinTests);var x=10;"maxBlockTime"in e&&(x=e.maxBlockTime);var I=+new Date;do{h.bitLength()>a&&(h=f(a,b));if(h.isProbablePrime(n))return g(null,h);h.dAddOffset(p[k++%8],0)}while(0>x||+new Date-I<x);c.util.setImmediate(function(){d(a,b,e,g)})}function e(a,b,e,h){function k(){function c(l){if(!v){--e;var k=l.data;if(k.found){for(l=0;l<d.length;++l)d[l].terminate();v=!0;return h(null,new g(k.prime,16))}n.bitLength()>a&&(n=f(a,b));k=n.toString(16);l.target.postMessage({hex:k,workLoad:x});
394
-n.dAddOffset(m,0)}}C=Math.max(1,C);for(var d=[],l=0;l<C;++l)d[l]=new Worker(p);for(var e=C,l=0;l<C;++l)d[l].addEventListener("message",c);var v=!1}if("undefined"===typeof Worker)return d(a,b,e,h);var n=f(a,b),C=e.workers,x=e.workLoad||100,m=30*x/8,p=e.workerScript||"forge/prime.worker.js";if(-1===C)return c.util.estimateCores(function(a,c){a&&(c=2);C=c-1;k()});k()}function f(a,c){var b=new g(a,c),d=a-1;b.testBit(d)||b.bitwiseTo(g.ONE.shiftLeft(d),r,b);b.dAddOffset(31-b.mod(n).byteValue(),0);return b}
395
-function m(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(!c.prime){var h=c.prime=c.prime||{},g=c.jsbn.BigInteger,p=[6,4,2,4,2,4,6,2],n=new g(null);n.fromInt(30);var r=function(a,c){return a|c};h.generateProbablePrime=function(a,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 h=d.prng||c.random;d={nextBytes:function(a){for(var c=h.getBytesSync(a.length),
396
-b=0;b<a.length;++b)a[b]=c.charCodeAt(b)}};if("PRIMEINC"===g.name)return b(a,d,g.options,e);throw Error("Invalid prime generation algorithm: "+g.name);}}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.prime)return b.prime;b.defined.prime=!0;for(var f=
397
-0;f<e.length;++f)e[f](b);return b.prime}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/prime",["require","module","./util","./jsbn","./random"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d,e){var g=c.util.createBuffer();d=Math.ceil(d.n.bitLength()/8);if(a.length>d-11)throw g=
398
-Error("Message is too long for PKCS#1 v1.5 padding."),g.length=a.length,g.max=d-11,g;g.putByte(0);g.putByte(e);d=d-3-a.length;if(0===e||1===e){e=0===e?0:255;for(var h=0;h<d;++h)g.putByte(e)}else for(;0<d;){for(var f=0,k=c.random.getBytes(d),h=0;h<d;++h)e=k.charCodeAt(h),0===e?++f:g.putByte(e);d=f}g.putByte(0);g.putBytes(a);return g}function d(a,b,e,g){b=Math.ceil(b.n.bitLength()/8);a=c.util.createBuffer(a);var h=a.getByte(),f=a.getByte();if(0!==h||e&&0!==f&&1!==f||!e&&2!=f||e&&0===f&&"undefined"===
399
-typeof g)throw Error("Encryption block is invalid.");e=0;if(0===f)for(e=b-3-g,g=0;g<e;++g){if(0!==a.getByte())throw Error("Encryption block is invalid.");}else if(1===f)for(e=0;1<a.length();){if(255!==a.getByte()){--a.read;break}++e}else if(2===f)for(e=0;1<a.length();){if(0===a.getByte()){--a.read;break}++e}if(0!==a.getByte()||e!==b-3-a.length())throw Error("Encryption block is invalid.");return a.getBytes()}function e(a,b,d){function e(){g(a.pBits,function(c,b){if(c)return d(c);a.p=b;if(null!==a.q)return f(c,
400
-a.q);g(a.qBits,f)})}function g(a,b){c.prime.generateProbablePrime(a,k,b)}function f(c,b){if(c)return d(c);a.q=b;if(0>a.p.compareTo(a.q)){var l=a.p;a.p=a.q;a.q=l}0!==a.p.subtract(h.ONE).gcd(a.e).compareTo(h.ONE)?(a.p=null,e()):0!==a.q.subtract(h.ONE).gcd(a.e).compareTo(h.ONE)?(a.q=null,g(a.qBits,f)):(a.p1=a.p.subtract(h.ONE),a.q1=a.q.subtract(h.ONE),a.phi=a.p1.multiply(a.q1),0!==a.phi.gcd(a.e).compareTo(h.ONE)?(a.p=a.q=null,e()):(a.n=a.p.multiply(a.q),a.n.bitLength()!==a.bits?(a.q=null,g(a.qBits,f)):
401
-(l=a.e.modInverse(a.phi),a.keys={privateKey:p.rsa.setPrivateKey(a.n,a.e,l,a.p,a.q,l.mod(a.p1),l.mod(a.q1),a.q.modInverse(a.p)),publicKey:p.rsa.setPublicKey(a.n,a.e)},d(null,a.keys))))}"function"===typeof b&&(d=b,b={});b=b||{};var k={algorithm:{name:b.algorithm||"PRIMEINC",options:{workers:b.workers||2,workLoad:b.workLoad||100,workerScript:b.workerScript}}};"prng"in b&&(k.prng=b.prng);e()}function f(a){a=a.toString(16);"8"<=a[0]&&(a="00"+a);return c.util.hexToBytes(a)}function m(a){return 100>=a?27:
402
-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 h)var h=c.jsbn.BigInteger;var g=c.asn1;c.pki=c.pki||{};c.pki.rsa=c.rsa=c.rsa||{};var p=c.pki,n=[6,4,2,4,2,4,6,2],r={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,
403
-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"}]},w={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",
404
-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",
405
-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"}]},y={name:"RSAPublicKey",tagClass:g.Class.UNIVERSAL,
406
-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"}]},D=c.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,
407
-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"}]}]},A=function(a){var c;if(a.algorithm in p.oids)c=p.oids[a.algorithm];
408
-else throw c=Error("Unknown message digest algorithm."),c.algorithm=a.algorithm,c;var b=g.oidToDer(c).getBytes();c=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,b));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());c.value.push(d);c.value.push(a);return g.toDer(c).getBytes()},L=function(a,b,d){if(d)return a.modPow(b.e,
409
-b.n);if(!b.p||!b.q)return a.modPow(b.d,b.n);b.dP||(b.dP=b.d.mod(b.p.subtract(h.ONE)));b.dQ||(b.dQ=b.d.mod(b.q.subtract(h.ONE)));b.qInv||(b.qInv=b.q.modInverse(b.p));do d=new h(c.util.bytesToHex(c.random.getBytes(b.n.bitLength()/8)),16);while(0<=d.compareTo(b.n)||!d.gcd(b.n).equals(h.ONE));a=a.multiply(d.modPow(b.e,b.n)).mod(b.n);var e=a.mod(b.p).modPow(b.dP,b.p);for(a=a.mod(b.q).modPow(b.dQ,b.q);0>e.compareTo(a);)e=e.add(b.p);a=e.subtract(a).multiply(b.qInv).mod(b.p).multiply(b.q).add(a);return a=
410
-a.multiply(d.modInverse(b.n)).mod(b.n)};p.rsa.encrypt=function(a,d,e){var g=e,f=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(g=2===e,e=b(a,d,e)):(e=c.util.createBuffer(),e.putBytes(a));a=new h(e.toHex(),16);d=L(a,d,g).toString(16);g=c.util.createBuffer();for(f-=Math.ceil(d.length/2);0<f;)g.putByte(0),--f;g.putBytes(c.util.hexToBytes(d));return g.getBytes()};p.rsa.decrypt=function(a,b,e,g){var f=Math.ceil(b.n.bitLength()/8);if(a.length!==f)throw b=Error("Encrypted message length is invalid."),b.length=
411
-a.length,b.expected=f,b;a=new h(c.util.createBuffer(a).toHex(),16);if(0<=a.compareTo(b.n))throw Error("Encrypted message is invalid.");a=L(a,b,e).toString(16);for(var k=c.util.createBuffer(),f=f-Math.ceil(a.length/2);0<f;)k.putByte(0),--f;k.putBytes(c.util.hexToBytes(a));return!1!==g?d(k.getBytes(),b,e):k.getBytes()};p.rsa.createKeyPairGenerationState=function(a,b,d){"string"===typeof a&&(a=parseInt(a,10));a=a||2048;d=d||{};var e=d.prng||c.random,g={nextBytes:function(a){for(var c=e.getBytesSync(a.length),
412
-b=0;b<a.length;++b)a[b]=c.charCodeAt(b)}};d=d.algorithm||"PRIMEINC";if("PRIMEINC"===d)a={algorithm:d,state:0,bits:a,rng:g,eInt:b||65537,e:new h(null),p:null,q:null,qBits:a>>1,pBits:a-(a>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw Error("Invalid key generation algorithm: "+d);return a};p.rsa.stepKeyPairGenerationState=function(a,c){"algorithm"in a||(a.algorithm="PRIMEINC");var b=new h(null);b.fromInt(30);for(var d=0,l=function(a,c){return a|c},e=+new Date,g,f=0;null===a.keys&&
413
-(0>=c||f<c);){if(0===a.state){g=null===a.p?a.pBits:a.qBits;var k=g-1;0===a.pqState?(a.num=new h(g,a.rng),a.num.testBit(k)||a.num.bitwiseTo(h.ONE.shiftLeft(k),l,a.num),a.num.dAddOffset(31-a.num.mod(b).byteValue(),0),d=0,++a.pqState):1===a.pqState?a.num.bitLength()>g?a.pqState=0:a.num.isProbablePrime(m(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(n[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(h.ONE).gcd(a.e).compareTo(h.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num,
414
-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(h.ONE),a.q1=a.q.subtract(h.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(h.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:p.rsa.setPrivateKey(a.n,a.e,g,a.p,a.q,
415
-g.mod(a.p1),g.mod(a.q1),a.q.modInverse(a.p)),publicKey:p.rsa.setPublicKey(a.n,a.e)});g=+new Date;f+=g-e;e=g}return null!==a.keys};p.rsa.generateKeyPair=function(a,c,b,d){1===arguments.length?"object"===typeof a?(b=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof c?(d=c,c=void 0):"number"!==typeof c&&(b=c,c=void 0):(b=a,d=c,c=a=void 0):3===arguments.length&&("number"===typeof c?"function"===typeof b&&(d=b,b=void 0):(d=b,b=c,c=void 0));b=
416
-b||{};void 0===a&&(a=b.bits||2048);void 0===c&&(c=b.e||65537);var l=p.rsa.createKeyPairGenerationState(a,c,b);if(!d)return p.rsa.stepKeyPairGenerationState(l,0),l.keys;e(l,b,d)};p.setRsaPublicKey=p.rsa.setPublicKey=function(a,e){var h={n:a,e:e,encrypt:function(a,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,c,d){return b(a,c,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(a,b){return c.pkcs1.encode_rsa_oaep(b,
417
-a,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+'".');a=d.encode(a,h,!0);return p.rsa.encrypt(a,h,!0)},verify:function(a,c,b){"string"===typeof b?b=b.toUpperCase():void 0===b&&(b="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===b)b={verify:function(a,c){c=d(c,h,!0);var b=g.fromDer(c);return a===b.value[1].value}};else if("NONE"===b||"NULL"===b||null===b)b={verify:function(a,c){c=d(c,
418
-h,!0);return a===c}};c=p.rsa.decrypt(c,h,!0,!1);return b.verify(a,c,h.n.bitLength())}};return h};p.setRsaPrivateKey=p.rsa.setPrivateKey=function(a,b,e,g,h,f,k,n){var m={n:a,e:b,d:e,p:g,q:h,dP:f,dQ:k,qInv:n,decrypt:function(a,b,e){"string"===typeof b?b=b.toUpperCase():void 0===b&&(b="RSAES-PKCS1-V1_5");a=p.rsa.decrypt(a,m,!1,!1);if("RSAES-PKCS1-V1_5"===b)b={decode:d};else if("RSA-OAEP"===b||"RSAES-OAEP"===b)b={decode:function(a,b){return c.pkcs1.decode_rsa_oaep(b,a,e)}};else if(-1!==["RAW","NONE",
419
-"NULL",null].indexOf(b))b={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+b+'".');return b.decode(a,m,!1)},sign:function(a,c){var b=!1;"string"===typeof c&&(c=c.toUpperCase());if(void 0===c||"RSASSA-PKCS1-V1_5"===c)c={encode:A},b=1;else if("NONE"===c||"NULL"===c||null===c)c={encode:function(){return a}},b=1;var d=c.encode(a,m.n.bitLength());return p.rsa.encrypt(d,m,b)}};return m};p.wrapRsaPrivateKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,
420
-[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(p.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())])};p.privateKeyFromAsn1=function(a){var b={},d=[];g.validate(a,r,b,d)&&(a=g.fromDer(c.util.createBuffer(b.privateKey)));b={};d=[];if(!g.validate(a,w,b,d))throw b=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."),
421
-b.errors=d,b;var e,f,k,n,m,d=c.util.createBuffer(b.privateKeyModulus).toHex();a=c.util.createBuffer(b.privateKeyPublicExponent).toHex();e=c.util.createBuffer(b.privateKeyPrivateExponent).toHex();f=c.util.createBuffer(b.privateKeyPrime1).toHex();k=c.util.createBuffer(b.privateKeyPrime2).toHex();n=c.util.createBuffer(b.privateKeyExponent1).toHex();m=c.util.createBuffer(b.privateKeyExponent2).toHex();b=c.util.createBuffer(b.privateKeyCoefficient).toHex();return p.setRsaPrivateKey(new h(d,16),new h(a,
422
-16),new h(e,16),new h(f,16),new h(k,16),new h(n,16),new h(m,16),new h(b,16))};p.privateKeyToAsn1=p.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,f(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.e)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.d)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.p)),g.create(g.Class.UNIVERSAL,
423
-g.Type.INTEGER,!1,f(a.q)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.dP)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.dQ)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.qInv))])};p.publicKeyFromAsn1=function(a){var b={},d=[];if(g.validate(a,D,b,d)){d=g.derToOid(b.publicKeyOid);if(d!==p.oids.rsaEncryption)throw b=Error("Cannot read public key. Unknown OID."),b.oid=d,b;a=b.rsaPublicKey}d=[];if(!g.validate(a,y,b,d))throw b=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."),
424
-b.errors=d,b;d=c.util.createBuffer(b.publicKeyModulus).toHex();b=c.util.createBuffer(b.publicKeyExponent).toHex();return p.setRsaPublicKey(new h(d,16),new h(b,16))};p.publicKeyToAsn1=p.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(p.oids.rsaEncryption).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
425
-!1,[p.publicKeyToRSAPublicKey(a)])])};p.publicKeyToRSAPublicKey=function(a){return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.n)),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,f(a.e))])}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||
426
-{};b.defined=b.defined||{};if(b.defined.rsa)return b.rsa;b.defined.rsa=!0;for(var f=0;f<e.length;++f)e[f](b);return b.rsa}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/rsa","require module ./asn1 ./jsbn ./oids ./pkcs1 ./prime ./random ./util".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,
427
-c){return a.start().update(c).digest().getBytes()}if("undefined"===typeof d)var d=c.jsbn.BigInteger;var e=c.asn1,f=c.pki=c.pki||{};f.pbe=c.pbe=c.pbe||{};var m=f.oids,h={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"},
428
-{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",
374
+0),++this.data[c]}};b.prototype.multiplyLowerTo=function(a,c,b){var d=Math.min(this.t+a.t,c);b.s=0;for(b.t=d;0<d;)b.data[--d]=0;var m;for(m=b.t-this.t;d<m;++d)b.data[d+this.t]=this.am(0,a.data[d],b,d,0,this.t);for(m=Math.min(a.t,c);d<m;++d)this.am(0,a.data[d],b,d,0,c-d);b.clamp()};b.prototype.multiplyUpperTo=function(a,c,b){--c;var d=b.t=this.t+a.t-c;for(b.s=0;0<=--d;)b.data[d]=0;for(d=Math.max(c-this.t,0);d<a.t;++d)b.data[this.t+d-c]=this.am(c-d,a.data[d],b,0,0,this.t+d-c);b.clamp();b.drShiftTo(1,
375
+b)};b.prototype.modInt=function(a){if(0>=a)return 0;var c=this.DV%a,b=0>this.s?a-1:0;if(0<this.t)if(0==c)b=this.data[0]%a;else for(var d=this.t-1;0<=d;--d)b=(c*b+this.data[d])%a;return b};b.prototype.millerRabin=function(a){var c=this.subtract(b.ONE),d=c.getLowestSetBit();if(0>=d)return!1;for(var m=c.shiftRight(d),h=B(),e,k=0;k<a;++k){do e=new b(this.bitLength(),h);while(0>=e.compareTo(b.ONE)||0<=e.compareTo(c));e=e.modPow(m,this);if(0!=e.compareTo(b.ONE)&&0!=e.compareTo(c)){for(var g=1;g++<d&&0!=
376
+e.compareTo(c);)if(e=e.modPowInt(2,this),0==e.compareTo(b.ONE))return!1;if(0!=e.compareTo(c))return!1}}return!0};b.prototype.clone=function(){var a=d();this.copyTo(a);return a};b.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]};b.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24};b.prototype.shortValue=
377
+function(){return 0==this.t?this.s:this.data[0]<<16>>16};b.prototype.signum=function(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this.data[0]?0:1};b.prototype.toByteArray=function(){var a=this.t,c=[];c[0]=this.s;var b=this.DB-a*this.DB%8,d,m=0;if(0<a--)for(b<this.DB&&(d=this.data[a]>>b)!=(this.s&this.DM)>>b&&(c[m++]=d|this.s<<this.DB-b);0<=a;)if(8>b?(d=(this.data[a]&(1<<b)-1)<<8-b,d|=this.data[--a]>>(b+=this.DB-8)):(d=this.data[a]>>(b-=8)&255,0>=b&&(b+=this.DB,--a)),0!=(d&128)&&(d|=-256),0==m&&
378
+(this.s&128)!=(d&128)&&++m,0<m||d!=this.s)c[m++]=d;return c};b.prototype.equals=function(a){return 0==this.compareTo(a)};b.prototype.min=function(a){return 0>this.compareTo(a)?this:a};b.prototype.max=function(a){return 0<this.compareTo(a)?this:a};b.prototype.and=function(a){var c=d();this.bitwiseTo(a,y,c);return c};b.prototype.or=function(a){var c=d();this.bitwiseTo(a,z,c);return c};b.prototype.xor=function(a){var c=d();this.bitwiseTo(a,A,c);return c};b.prototype.andNot=function(a){var c=d();this.bitwiseTo(a,
379
+D,c);return c};b.prototype.not=function(){for(var a=d(),c=0;c<this.t;++c)a.data[c]=this.DM&~this.data[c];a.t=this.t;a.s=~this.s;return a};b.prototype.shiftLeft=function(a){var c=d();0>a?this.rShiftTo(-a,c):this.lShiftTo(a,c);return c};b.prototype.shiftRight=function(a){var c=d();0>a?this.lShiftTo(-a,c):this.rShiftTo(a,c);return c};b.prototype.getLowestSetBit=function(){for(var a=0;a<this.t;++a)if(0!=this.data[a]){var c=a*this.DB;a=this.data[a];if(0==a)a=-1;else{var b=0;0==(a&65535)&&(a>>=16,b+=16);
380
+0==(a&255)&&(a>>=8,b+=8);0==(a&15)&&(a>>=4,b+=4);0==(a&3)&&(a>>=2,b+=2);0==(a&1)&&++b;a=b}return c+a}return 0>this.s?this.t*this.DB:-1};b.prototype.bitCount=function(){for(var a=0,c=this.s&this.DM,b=0;b<this.t;++b){for(var d=this.data[b]^c,m=0;0!=d;)d&=d-1,++m;a+=m}return a};b.prototype.testBit=function(a){var c=Math.floor(a/this.DB);return c>=this.t?0!=this.s:0!=(this.data[c]&1<<a%this.DB)};b.prototype.setBit=function(a){return this.changeBit(a,z)};b.prototype.clearBit=function(a){return this.changeBit(a,
381
+D)};b.prototype.flipBit=function(a){return this.changeBit(a,A)};b.prototype.add=function(a){var c=d();this.addTo(a,c);return c};b.prototype.subtract=function(a){var c=d();this.subTo(a,c);return c};b.prototype.multiply=function(a){var c=d();this.multiplyTo(a,c);return c};b.prototype.divide=function(a){var c=d();this.divRemTo(a,c,null);return c};b.prototype.remainder=function(a){var c=d();this.divRemTo(a,null,c);return c};b.prototype.divideAndRemainder=function(a){var c=d(),b=d();this.divRemTo(a,c,
382
+b);return[c,b]};b.prototype.modPow=function(a,c){var b=a.bitLength(),m,e=h(1),k;if(0>=b)return e;m=18>b?1:48>b?3:144>b?4:768>b?5:6;k=8>b?new p(c):c.isEven()?new G(c):new F(c);var g=[],l=3,x=m-1,q=(1<<m)-1;g[1]=k.convert(this);if(1<m)for(b=d(),k.sqrTo(g[1],b);l<=q;)g[l]=d(),k.mulTo(b,g[l-2],g[l]),l+=2;for(var B=a.t-1,v,n=!0,y=d(),b=C(a.data[B])-1;0<=B;){b>=x?v=a.data[B]>>b-x&q:(v=(a.data[B]&(1<<b+1)-1)<<x-b,0<B&&(v|=a.data[B-1]>>this.DB+b-x));for(l=m;0==(v&1);)v>>=1,--l;0>(b-=l)&&(b+=this.DB,--B);
383
+if(n)g[v].copyTo(e),n=!1;else{for(;1<l;)k.sqrTo(e,y),k.sqrTo(y,e),l-=2;0<l?k.sqrTo(e,y):(l=e,e=y,y=l);k.mulTo(y,g[v],e)}for(;0<=B&&0==(a.data[B]&1<<b);)k.sqrTo(e,y),l=e,e=y,y=l,0>--b&&(b=this.DB-1,--B)}return k.revert(e)};b.prototype.modInverse=function(a){var c=a.isEven();if(this.isEven()&&c||0==a.signum())return b.ZERO;for(var d=a.clone(),m=this.clone(),e=h(1),k=h(0),g=h(0),x=h(1);0!=d.signum();){for(;d.isEven();)d.rShiftTo(1,d),c?(e.isEven()&&k.isEven()||(e.addTo(this,e),k.subTo(a,k)),e.rShiftTo(1,
384
+e)):k.isEven()||k.subTo(a,k),k.rShiftTo(1,k);for(;m.isEven();)m.rShiftTo(1,m),c?(g.isEven()&&x.isEven()||(g.addTo(this,g),x.subTo(a,x)),g.rShiftTo(1,g)):x.isEven()||x.subTo(a,x),x.rShiftTo(1,x);0<=d.compareTo(m)?(d.subTo(m,d),c&&e.subTo(g,e),k.subTo(x,k)):(m.subTo(d,m),c&&g.subTo(e,g),x.subTo(k,x))}if(0!=m.compareTo(b.ONE))return b.ZERO;if(0<=x.compareTo(a))return x.subtract(a);if(0>x.signum())x.addTo(a,x);else return x;return 0>x.signum()?x.add(a):x};b.prototype.pow=function(a){return this.exp(a,
385
+new r)};b.prototype.gcd=function(a){var c=0>this.s?this.negate():this.clone();a=0>a.s?a.negate():a.clone();if(0>c.compareTo(a)){var b=c,c=a;a=b}var b=c.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return c;b<d&&(d=b);0<d&&(c.rShiftTo(d,c),a.rShiftTo(d,a));for(;0<c.signum();)0<(b=c.getLowestSetBit())&&c.rShiftTo(b,c),0<(b=a.getLowestSetBit())&&a.rShiftTo(b,a),0<=c.compareTo(a)?(c.subTo(a,c),c.rShiftTo(1,c)):(a.subTo(c,a),a.rShiftTo(1,a));0<d&&a.lShiftTo(d,a);return a};b.prototype.isProbablePrime=
386
+function(a){var c,b=this.abs();if(1==b.t&&b.data[0]<=P[P.length-1]){for(c=0;c<P.length;++c)if(b.data[0]==P[c])return!0;return!1}if(b.isEven())return!1;for(c=1;c<P.length;){for(var d=P[c],m=c+1;m<P.length&&d<M;)d*=P[m++];for(d=b.modInt(d);c<m;)if(0==d%P[c++])return!1}return b.millerRabin(a)};c.jsbn=c.jsbn||{};c.jsbn.BigInteger=b}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,
387
+r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.jsbn)return b.jsbn;b.defined.jsbn=!0;for(var g=0;g<e.length;++g)e[g](b);return b.jsbn}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/jsbn",["require","module"],function(){r.apply(null,Array.prototype.slice.call(arguments,
388
+0))})})();(function(){function a(c){function b(a,d,g){g||(g=c.md.sha1.create());for(var k="",h=Math.ceil(d/g.digestLength),l=0;l<h;++l){var p=String.fromCharCode(l>>24&255,l>>16&255,l>>8&255,l&255);g.start();g.update(a+p);k+=g.digest().getBytes()}return k.substring(0,d)}var d=c.pkcs1=c.pkcs1||{};d.encode_rsa_oaep=function(a,d,g,k,h){var w,p,n,y;"string"===typeof g?(w=g,p=k||void 0,n=h||void 0):g&&(w=g.label||void 0,p=g.seed||void 0,n=g.md||void 0,g.mgf1&&g.mgf1.md&&(y=g.mgf1.md));n?n.start():n=c.md.sha1.create();
389
+y||(y=n);a=Math.ceil(a.n.bitLength()/8);g=a-2*n.digestLength-2;if(d.length>g)throw y=Error("RSAES-OAEP input message length is too long."),y.length=d.length,y.maxLength=g,y;w||(w="");n.update(w,"raw");w=n.digest();k="";g-=d.length;for(h=0;h<g;h++)k+="\x00";d=w.getBytes()+k+"\u0001"+d;if(!p)p=c.random.getBytes(n.digestLength);else if(p.length!==n.digestLength)throw y=Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."),y.seedLength=p.length,y.digestLength=n.digestLength,
390
+y;a=b(p,a-n.digestLength-1,y);d=c.util.xorBytes(d,a,d.length);n=b(d,n.digestLength,y);return"\x00"+c.util.xorBytes(p,n,p.length)+d};d.decode_rsa_oaep=function(a,d,g,k){var h,w,p;"string"===typeof g?(h=g,w=k||void 0):g&&(h=g.label||void 0,w=g.md||void 0,g.mgf1&&g.mgf1.md&&(p=g.mgf1.md));g=Math.ceil(a.n.bitLength()/8);if(d.length!==g)throw p=Error("RSAES-OAEP encoded message length is invalid."),p.length=d.length,p.expectedLength=g,p;void 0===w?w=c.md.sha1.create():w.start();p||(p=w);if(g<2*w.digestLength+
391
+2)throw Error("RSAES-OAEP key is too short for the hash function.");h||(h="");w.update(h,"raw");h=w.digest().getBytes();a=d.charAt(0);k=d.substring(1,w.digestLength+1);d=d.substring(1+w.digestLength);var n=b(d,w.digestLength,p);k=c.util.xorBytes(k,n,k.length);p=b(k,g-w.digestLength-1,p);d=c.util.xorBytes(d,p,d.length);g=d.substring(0,w.digestLength);p="\x00"!==a;for(a=0;a<w.digestLength;++a)p|=h.charAt(a)!==g.charAt(a);h=1;for(w=a=w.digestLength;w<d.length;w++)g=d.charCodeAt(w),k=g&1^1,p|=g&(h?65534:
392
+0),h&=k,a+=h;if(p||1!==d.charCodeAt(a))throw Error("Invalid RSAES-OAEP padding.");return d.substring(a+1)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs1)return b.pkcs1;b.defined.pkcs1=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pkcs1}},
393
+u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs1",["require","module","./util","./random","./sha1"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,m,h){return"workers"in m?e(a,c,m,h):d(a,c,m,h)}function d(a,b,h,e){var k=g(a,b),l=0,p=n(k.bitLength());"millerRabinTests"in
394
+h&&(p=h.millerRabinTests);var B=10;"maxBlockTime"in h&&(B=h.maxBlockTime);var H=+new Date;do{k.bitLength()>a&&(k=g(a,b));if(k.isProbablePrime(p))return e(null,k);k.dAddOffset(C[l++%8],0)}while(0>B||+new Date-H<B);c.util.setImmediate(function(){d(a,b,h,e)})}function e(a,b,e,k){function l(){function c(m){if(!w){--e;var l=m.data;if(l.found){for(m=0;m<d.length;++m)d[m].terminate();w=!0;return k(null,new h(l.prime,16))}x.bitLength()>a&&(x=g(a,b));l=x.toString(16);m.target.postMessage({hex:l,workLoad:B});
395
+x.dAddOffset(n,0)}}p=Math.max(1,p);for(var d=[],m=0;m<p;++m)d[m]=new Worker(C);for(var e=p,m=0;m<p;++m)d[m].addEventListener("message",c);var w=!1}if("undefined"===typeof Worker)return d(a,b,e,k);var x=g(a,b),p=e.workers,B=e.workLoad||100,n=30*B/8,C=e.workerScript||"forge/prime.worker.js";if(-1===p)return c.util.estimateCores(function(a,c){a&&(c=2);p=c-1;l()});l()}function g(a,c){var b=new h(a,c),d=a-1;b.testBit(d)||b.bitwiseTo(h.ONE.shiftLeft(d),r,b);b.dAddOffset(31-b.mod(p).byteValue(),0);return b}
396
+function n(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(!c.prime){var k=c.prime=c.prime||{},h=c.jsbn.BigInteger,C=[6,4,2,4,2,4,6,2],p=new h(null);p.fromInt(30);var r=function(a,c){return a|c};k.generateProbablePrime=function(a,d,h){"function"===typeof d&&(h=d,d={});d=d||{};var e=d.algorithm||"PRIMEINC";"string"===typeof e&&(e={name:e});e.options=e.options||{};var k=d.prng||c.random;d={nextBytes:function(a){for(var c=k.getBytesSync(a.length),
397
+b=0;b<a.length;++b)a[b]=c.charCodeAt(b)}};if("PRIMEINC"===e.name)return b(a,d,e.options,h);throw Error("Invalid prime generation algorithm: "+e.name);}}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.prime)return b.prime;b.defined.prime=!0;for(var g=
398
+0;g<e.length;++g)e[g](b);return b.prime}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/prime",["require","module","./util","./jsbn","./random"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d,h){var e=c.util.createBuffer();d=Math.ceil(d.n.bitLength()/8);if(a.length>d-11)throw e=
399
+Error("Message is too long for PKCS#1 v1.5 padding."),e.length=a.length,e.max=d-11,e;e.putByte(0);e.putByte(h);d=d-3-a.length;if(0===h||1===h){h=0===h?0:255;for(var k=0;k<d;++k)e.putByte(h)}else for(;0<d;){for(var g=0,l=c.random.getBytes(d),k=0;k<d;++k)h=l.charCodeAt(k),0===h?++g:e.putByte(h);d=g}e.putByte(0);e.putBytes(a);return e}function d(a,b,e,h){b=Math.ceil(b.n.bitLength()/8);a=c.util.createBuffer(a);var k=a.getByte(),g=a.getByte();if(0!==k||e&&0!==g&&1!==g||!e&&2!=g||e&&0===g&&"undefined"===
400
+typeof h)throw Error("Encryption block is invalid.");e=0;if(0===g)for(e=b-3-h,h=0;h<e;++h){if(0!==a.getByte())throw Error("Encryption block is invalid.");}else if(1===g)for(e=0;1<a.length();){if(255!==a.getByte()){--a.read;break}++e}else if(2===g)for(e=0;1<a.length();){if(0===a.getByte()){--a.read;break}++e}if(0!==a.getByte()||e!==b-3-a.length())throw Error("Encryption block is invalid.");return a.getBytes()}function e(a,b,d){function e(){h(a.pBits,function(c,b){if(c)return d(c);a.p=b;if(null!==a.q)return g(c,
401
+a.q);h(a.qBits,g)})}function h(a,b){c.prime.generateProbablePrime(a,l,b)}function g(c,b){if(c)return d(c);a.q=b;if(0>a.p.compareTo(a.q)){var m=a.p;a.p=a.q;a.q=m}0!==a.p.subtract(k.ONE).gcd(a.e).compareTo(k.ONE)?(a.p=null,e()):0!==a.q.subtract(k.ONE).gcd(a.e).compareTo(k.ONE)?(a.q=null,h(a.qBits,g)):(a.p1=a.p.subtract(k.ONE),a.q1=a.q.subtract(k.ONE),a.phi=a.p1.multiply(a.q1),0!==a.phi.gcd(a.e).compareTo(k.ONE)?(a.p=a.q=null,e()):(a.n=a.p.multiply(a.q),a.n.bitLength()!==a.bits?(a.q=null,h(a.qBits,g)):
402
+(m=a.e.modInverse(a.phi),a.keys={privateKey:C.rsa.setPrivateKey(a.n,a.e,m,a.p,a.q,m.mod(a.p1),m.mod(a.q1),a.q.modInverse(a.p)),publicKey:C.rsa.setPublicKey(a.n,a.e)},d(null,a.keys))))}"function"===typeof b&&(d=b,b={});b=b||{};var l={algorithm:{name:b.algorithm||"PRIMEINC",options:{workers:b.workers||2,workLoad:b.workLoad||100,workerScript:b.workerScript}}};"prng"in b&&(l.prng=b.prng);e()}function g(a){a=a.toString(16);"8"<=a[0]&&(a="00"+a);return c.util.hexToBytes(a)}function n(a){return 100>=a?27:
403
+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 k)var k=c.jsbn.BigInteger;var h=c.asn1;c.pki=c.pki||{};c.pki.rsa=c.rsa=c.rsa||{};var C=c.pki,p=[6,4,2,4,2,4,6,2],r={name:"PrivateKeyInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:h.Class.UNIVERSAL,
404
+type:h.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},y={name:"RSAPrivateKey",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",
405
+tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",
406
+tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},z={name:"RSAPublicKey",tagClass:h.Class.UNIVERSAL,
407
+type:h.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},A=c.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,
408
+type:h.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},D=function(a){var c;if(a.algorithm in C.oids)c=C.oids[a.algorithm];
409
+else throw c=Error("Unknown message digest algorithm."),c.algorithm=a.algorithm,c;var b=h.oidToDer(c).getBytes();c=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);var d=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);d.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,b));d.value.push(h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,""));a=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,a.digest().getBytes());c.value.push(d);c.value.push(a);return h.toDer(c).getBytes()},u=function(a,b,d){if(d)return a.modPow(b.e,
410
+b.n);if(!b.p||!b.q)return a.modPow(b.d,b.n);b.dP||(b.dP=b.d.mod(b.p.subtract(k.ONE)));b.dQ||(b.dQ=b.d.mod(b.q.subtract(k.ONE)));b.qInv||(b.qInv=b.q.modInverse(b.p));do d=new k(c.util.bytesToHex(c.random.getBytes(b.n.bitLength()/8)),16);while(0<=d.compareTo(b.n)||!d.gcd(b.n).equals(k.ONE));a=a.multiply(d.modPow(b.e,b.n)).mod(b.n);var e=a.mod(b.p).modPow(b.dP,b.p);for(a=a.mod(b.q).modPow(b.dQ,b.q);0>e.compareTo(a);)e=e.add(b.p);a=e.subtract(a).multiply(b.qInv).mod(b.p).multiply(b.q).add(a);return a=
411
+a.multiply(d.modInverse(b.n)).mod(b.n)};C.rsa.encrypt=function(a,d,e){var h=e,g=Math.ceil(d.n.bitLength()/8);!1!==e&&!0!==e?(h=2===e,e=b(a,d,e)):(e=c.util.createBuffer(),e.putBytes(a));a=new k(e.toHex(),16);d=u(a,d,h).toString(16);h=c.util.createBuffer();for(g-=Math.ceil(d.length/2);0<g;)h.putByte(0),--g;h.putBytes(c.util.hexToBytes(d));return h.getBytes()};C.rsa.decrypt=function(a,b,e,h){var g=Math.ceil(b.n.bitLength()/8);if(a.length!==g)throw b=Error("Encrypted message length is invalid."),b.length=
412
+a.length,b.expected=g,b;a=new k(c.util.createBuffer(a).toHex(),16);if(0<=a.compareTo(b.n))throw Error("Encrypted message is invalid.");a=u(a,b,e).toString(16);for(var l=c.util.createBuffer(),g=g-Math.ceil(a.length/2);0<g;)l.putByte(0),--g;l.putBytes(c.util.hexToBytes(a));return!1!==h?d(l.getBytes(),b,e):l.getBytes()};C.rsa.createKeyPairGenerationState=function(a,b,d){"string"===typeof a&&(a=parseInt(a,10));a=a||2048;d=d||{};var e=d.prng||c.random,h={nextBytes:function(a){for(var c=e.getBytesSync(a.length),
413
+b=0;b<a.length;++b)a[b]=c.charCodeAt(b)}};d=d.algorithm||"PRIMEINC";if("PRIMEINC"===d)a={algorithm:d,state:0,bits:a,rng:h,eInt:b||65537,e:new k(null),p:null,q:null,qBits:a>>1,pBits:a-(a>>1),pqState:0,num:null,keys:null},a.e.fromInt(a.eInt);else throw Error("Invalid key generation algorithm: "+d);return a};C.rsa.stepKeyPairGenerationState=function(a,c){"algorithm"in a||(a.algorithm="PRIMEINC");var b=new k(null);b.fromInt(30);for(var d=0,m=function(a,c){return a|c},e=+new Date,h,g=0;null===a.keys&&
414
+(0>=c||g<c);){if(0===a.state){h=null===a.p?a.pBits:a.qBits;var l=h-1;0===a.pqState?(a.num=new k(h,a.rng),a.num.testBit(l)||a.num.bitwiseTo(k.ONE.shiftLeft(l),m,a.num),a.num.dAddOffset(31-a.num.mod(b).byteValue(),0),d=0,++a.pqState):1===a.pqState?a.num.bitLength()>h?a.pqState=0:a.num.isProbablePrime(n(a.num.bitLength()))?++a.pqState:a.num.dAddOffset(p[d++%8],0):2===a.pqState?a.pqState=0===a.num.subtract(k.ONE).gcd(a.e).compareTo(k.ONE)?3:0:3===a.pqState&&(a.pqState=0,null===a.p?a.p=a.num:a.q=a.num,
415
+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(k.ONE),a.q1=a.q.subtract(k.ONE),a.phi=a.p1.multiply(a.q1),++a.state):3===a.state?0===a.phi.gcd(a.e).compareTo(k.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&&(h=a.e.modInverse(a.phi),a.keys={privateKey:C.rsa.setPrivateKey(a.n,a.e,h,a.p,a.q,
416
+h.mod(a.p1),h.mod(a.q1),a.q.modInverse(a.p)),publicKey:C.rsa.setPublicKey(a.n,a.e)});h=+new Date;g+=h-e;e=h}return null!==a.keys};C.rsa.generateKeyPair=function(a,c,b,d){1===arguments.length?"object"===typeof a?(b=a,a=void 0):"function"===typeof a&&(d=a,a=void 0):2===arguments.length?"number"===typeof a?"function"===typeof c?(d=c,c=void 0):"number"!==typeof c&&(b=c,c=void 0):(b=a,d=c,c=a=void 0):3===arguments.length&&("number"===typeof c?"function"===typeof b&&(d=b,b=void 0):(d=b,b=c,c=void 0));b=
417
+b||{};void 0===a&&(a=b.bits||2048);void 0===c&&(c=b.e||65537);var m=C.rsa.createKeyPairGenerationState(a,c,b);if(!d)return C.rsa.stepKeyPairGenerationState(m,0),m.keys;e(m,b,d)};C.setRsaPublicKey=C.rsa.setPublicKey=function(a,e){var k={n:a,e:e,encrypt:function(a,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,c,d){return b(a,c,2).getBytes()}};else if("RSA-OAEP"===d||"RSAES-OAEP"===d)d={encode:function(a,b){return c.pkcs1.encode_rsa_oaep(b,
418
+a,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+'".');a=d.encode(a,k,!0);return C.rsa.encrypt(a,k,!0)},verify:function(a,c,b){"string"===typeof b?b=b.toUpperCase():void 0===b&&(b="RSASSA-PKCS1-V1_5");if("RSASSA-PKCS1-V1_5"===b)b={verify:function(a,c){c=d(c,k,!0);var b=h.fromDer(c);return a===b.value[1].value}};else if("NONE"===b||"NULL"===b||null===b)b={verify:function(a,c){c=d(c,
419
+k,!0);return a===c}};c=C.rsa.decrypt(c,k,!0,!1);return b.verify(a,c,k.n.bitLength())}};return k};C.setRsaPrivateKey=C.rsa.setPrivateKey=function(a,b,e,h,k,g,l,p){var v={n:a,e:b,d:e,p:h,q:k,dP:g,dQ:l,qInv:p,decrypt:function(a,b,e){"string"===typeof b?b=b.toUpperCase():void 0===b&&(b="RSAES-PKCS1-V1_5");a=C.rsa.decrypt(a,v,!1,!1);if("RSAES-PKCS1-V1_5"===b)b={decode:d};else if("RSA-OAEP"===b||"RSAES-OAEP"===b)b={decode:function(a,b){return c.pkcs1.decode_rsa_oaep(b,a,e)}};else if(-1!==["RAW","NONE",
420
+"NULL",null].indexOf(b))b={decode:function(a){return a}};else throw Error('Unsupported encryption scheme: "'+b+'".');return b.decode(a,v,!1)},sign:function(a,c){var b=!1;"string"===typeof c&&(c=c.toUpperCase());if(void 0===c||"RSASSA-PKCS1-V1_5"===c)c={encode:D},b=1;else if("NONE"===c||"NULL"===c||null===c)c={encode:function(){return a}},b=1;var d=c.encode(a,v.n.bitLength());return C.rsa.encrypt(d,v,b)}};return v};C.wrapRsaPrivateKey=function(a){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,
421
+[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(0).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(C.oids.rsaEncryption).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(a).getBytes())])};C.privateKeyFromAsn1=function(a){var b={},d=[];h.validate(a,r,b,d)&&(a=h.fromDer(c.util.createBuffer(b.privateKey)));b={};d=[];if(!h.validate(a,y,b,d))throw b=Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."),
422
+b.errors=d,b;var e,g,l,p,v,d=c.util.createBuffer(b.privateKeyModulus).toHex();a=c.util.createBuffer(b.privateKeyPublicExponent).toHex();e=c.util.createBuffer(b.privateKeyPrivateExponent).toHex();g=c.util.createBuffer(b.privateKeyPrime1).toHex();l=c.util.createBuffer(b.privateKeyPrime2).toHex();p=c.util.createBuffer(b.privateKeyExponent1).toHex();v=c.util.createBuffer(b.privateKeyExponent2).toHex();b=c.util.createBuffer(b.privateKeyCoefficient).toHex();return C.setRsaPrivateKey(new k(d,16),new k(a,
423
+16),new k(e,16),new k(g,16),new k(l,16),new k(p,16),new k(v,16),new k(b,16))};C.privateKeyToAsn1=C.privateKeyToRSAPrivateKey=function(a){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(0).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.n)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.e)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.d)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.p)),h.create(h.Class.UNIVERSAL,
424
+h.Type.INTEGER,!1,g(a.q)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.dP)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.dQ)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.qInv))])};C.publicKeyFromAsn1=function(a){var b={},d=[];if(h.validate(a,A,b,d)){d=h.derToOid(b.publicKeyOid);if(d!==C.oids.rsaEncryption)throw b=Error("Cannot read public key. Unknown OID."),b.oid=d,b;a=b.rsaPublicKey}d=[];if(!h.validate(a,z,b,d))throw b=Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."),
425
+b.errors=d,b;d=c.util.createBuffer(b.publicKeyModulus).toHex();b=c.util.createBuffer(b.publicKeyExponent).toHex();return C.setRsaPublicKey(new k(d,16),new k(b,16))};C.publicKeyToAsn1=C.publicKeyToSubjectPublicKeyInfo=function(a){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(C.oids.rsaEncryption).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,
426
+!1,[C.publicKeyToRSAPublicKey(a)])])};C.publicKeyToRSAPublicKey=function(a){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.n)),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,g(a.e))])}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||
427
+{};b.defined=b.defined||{};if(b.defined.rsa)return b.rsa;b.defined.rsa=!0;for(var g=0;g<e.length;++g)e[g](b);return b.rsa}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/rsa","require module ./asn1 ./jsbn ./oids ./pkcs1 ./prime ./random ./util".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,
428
+c){return a.start().update(c).digest().getBytes()}if("undefined"===typeof d)var d=c.jsbn.BigInteger;var e=c.asn1,g=c.pki=c.pki||{};g.pbe=c.pbe=c.pbe||{};var n=g.oids,k={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"},
429
+{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"}]},h={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",
430
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,
430
-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"}]}]},p={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"},
431
-{name:"pkcs-12PbeParams.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"iterations"}]};f.encryptPrivateKeyInfo=function(a,b,d){d=d||{};d.saltSize=d.saltSize||8;d.count=d.count||2048;d.algorithm=d.algorithm||"aes128";var g=c.random.getBytesSync(d.saltSize),h=d.count,k=e.integerToDer(h),v;if(0===d.algorithm.indexOf("aes")||"des"===d.algorithm){var z,C;switch(d.algorithm){case "aes128":z=v=16;d=m["aes128-CBC"];C=c.aes.createEncryptionCipher;break;case "aes192":v=24;
432
-z=16;d=m["aes192-CBC"];C=c.aes.createEncryptionCipher;break;case "aes256":v=32;z=16;d=m["aes256-CBC"];C=c.aes.createEncryptionCipher;break;case "des":z=v=8;d=m.desCBC;C=c.des.createEncryptionCipher;break;default:throw g=Error("Cannot encrypt private key. Unknown encryption algorithm."),g.algorithm=d.algorithm,g;}var x=c.pkcs5.pbkdf2(b,g,h,v);b=c.random.getBytesSync(z);h=C(x);h.start(b);h.update(e.toDer(a));h.finish();a=h.output.getBytes();g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,
433
-e.Type.OID,!1,e.oidToDer(m.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(m.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,k.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,
434
-e.Type.OCTETSTRING,!1,b)])])])}else if("3des"===d.algorithm)v=24,d=new c.util.ByteBuffer(g),x=f.pbe.generatePkcs12Key(b,d,1,h,v),b=f.pbe.generatePkcs12Key(b,d,2,h,v),h=c.des.createEncryptionCipher(x),h.start(b),h.update(e.toDer(a)),h.finish(),a=h.output.getBytes(),g=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(m["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,
435
-!1,g),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,k.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,a)])};f.decryptPrivateKeyInfo=function(a,b){var d=null,g={},k=[];if(!e.validate(a,h,g,k))throw d=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=k,d;k=e.derToOid(g.encryptionOid);
436
-k=f.pbe.getCipher(k,g.encryptionParams,b);g=c.util.createBuffer(g.encryptedData);k.update(g);k.finish()&&(d=e.fromDer(k.output));return d};f.encryptedPrivateKeyToPem=function(a,b){var d={type:"ENCRYPTED PRIVATE KEY",body:e.toDer(a).getBytes()};return c.pem.encode(d,{maxline:b})};f.encryptedPrivateKeyFromPem=function(a){a=c.pem.decode(a)[0];if("ENCRYPTED PRIVATE KEY"!==a.type){var b=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');b.headerType=
437
-a.type;throw b;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return e.fromDer(a.body)};f.encryptRsaPrivateKey=function(a,b,d){d=d||{};if(!d.legacy)return a=f.wrapRsaPrivateKey(f.privateKeyToAsn1(a)),a=f.encryptPrivateKeyInfo(a,b,d),f.encryptedPrivateKeyToPem(a);var g,h,k;switch(d.algorithm){case "aes128":d="AES-128-CBC";h=16;g=c.random.getBytesSync(16);k=c.aes.createEncryptionCipher;break;case "aes192":d="AES-192-CBC";
438
-h=24;g=c.random.getBytesSync(16);k=c.aes.createEncryptionCipher;break;case "aes256":d="AES-256-CBC";h=32;g=c.random.getBytesSync(16);k=c.aes.createEncryptionCipher;break;case "3des":d="DES-EDE3-CBC";h=24;g=c.random.getBytesSync(8);k=c.des.createEncryptionCipher;break;case "des":d="DES-CBC";h=8;g=c.random.getBytesSync(8);k=c.des.createEncryptionCipher;break;default:throw a=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+d.algorithm+'".'),a.algorithm=d.algorithm,a;}b=c.pbe.opensslDeriveBytes(b,
439
-g.substr(0,8),h);b=k(b);b.start(g);b.update(e.toDer(f.privateKeyToAsn1(a)));b.finish();a={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:d,parameters:c.util.bytesToHex(g).toUpperCase()},body:b.output.getBytes()};return c.pem.encode(a)};f.decryptRsaPrivateKey=function(a,b){var d=null,g=c.pem.decode(a)[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".'),
440
-d.headerType=d,d;if(g.procType&&"ENCRYPTED"===g.procType.type){var h,k;switch(g.dekInfo.algorithm){case "DES-CBC":h=8;k=c.des.createDecryptionCipher;break;case "DES-EDE3-CBC":h=24;k=c.des.createDecryptionCipher;break;case "AES-128-CBC":h=16;k=c.aes.createDecryptionCipher;break;case "AES-192-CBC":h=24;k=c.aes.createDecryptionCipher;break;case "AES-256-CBC":h=32;k=c.aes.createDecryptionCipher;break;case "RC2-40-CBC":h=5;k=function(a){return c.rc2.createDecryptionCipher(a,40)};break;case "RC2-64-CBC":h=
441
-8;k=function(a){return c.rc2.createDecryptionCipher(a,64)};break;case "RC2-128-CBC":h=16;k=function(a){return c.rc2.createDecryptionCipher(a,128)};break;default:throw d=Error('Could not decrypt private key; unsupported encryption algorithm "'+g.dekInfo.algorithm+'".'),d.algorithm=g.dekInfo.algorithm,d;}var m=c.util.hexToBytes(g.dekInfo.parameters);h=c.pbe.opensslDeriveBytes(b,m.substr(0,8),h);k=k(h);k.start(m);k.update(c.util.createBuffer(g.body));if(k.finish())d=k.output.getBytes();else return d}else d=
442
-g.body;d="ENCRYPTED PRIVATE KEY"===g.type?f.decryptPrivateKeyInfo(e.fromDer(d),b):e.fromDer(d);null!==d&&(d=f.privateKeyFromAsn1(d));return d};f.pbe.generatePkcs12Key=function(a,b,d,g,e,h){var f,k;if("undefined"===typeof h||null===h)h=c.md.sha1.create();var m=h.digestLength,x=h.blockLength,v=new c.util.ByteBuffer,u=new c.util.ByteBuffer;if(null!==a&&void 0!==a){for(k=0;k<a.length;k++)u.putInt16(a.charCodeAt(k));u.putInt16(0)}a=u.length();var q=b.length(),p=new c.util.ByteBuffer;p.fillWithByte(d,x);
443
-var r=x*Math.ceil(q/x);d=new c.util.ByteBuffer;for(k=0;k<r;k++)d.putByte(b.at(k%q));r=x*Math.ceil(a/x);b=new c.util.ByteBuffer;for(k=0;k<r;k++)b.putByte(u.at(k%a));u=d;u.putBuffer(b);b=Math.ceil(e/m);for(d=1;d<=b;d++){r=new c.util.ByteBuffer;r.putBytes(p.bytes());r.putBytes(u.bytes());for(k=0;k<g;k++)h.start(),h.update(r.getBytes()),r=h.digest();var E=new c.util.ByteBuffer;for(k=0;k<x;k++)E.putByte(r.at(k%m));var B=Math.ceil(q/x)+Math.ceil(a/x),K=new c.util.ByteBuffer;for(f=0;f<B;f++){var W=new c.util.ByteBuffer(u.getBytes(x)),
444
-U=511;for(k=E.length()-1;0<=k;k--)U>>=8,U+=E.at(k)+W.at(k),W.setAt(k,U&255);K.putBuffer(W)}u=K;v.putBuffer(r)}v.truncate(v.length()-e);return v};f.pbe.getCipher=function(a,c,b){switch(a){case f.oids.pkcs5PBES2:return f.pbe.getCipherForPBES2(a,c,b);case f.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case f.oids["pbewithSHAAnd40BitRC2-CBC"]:return f.pbe.getCipherForPKCS12PBE(a,c,b);default:throw c=Error("Cannot read encrypted PBE data block. Unsupported OID."),c.oid=a,c.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC",
445
-"pbewithSHAAnd40BitRC2-CBC"],c;}};f.pbe.getCipherForPBES2=function(a,b,d){var h={};a=[];if(!e.validate(b,g,h,a)){var k=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");k.errors=a;throw k;}a=e.derToOid(h.kdfOid);if(a!==f.oids.pkcs5PBKDF2)throw k=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),k.oid=a,k.supportedOids=["pkcs5PBKDF2"],k;a=e.derToOid(h.encOid);if(a!==f.oids["aes128-CBC"]&&
446
-a!==f.oids["aes192-CBC"]&&a!==f.oids["aes256-CBC"]&&a!==f.oids["des-EDE3-CBC"]&&a!==f.oids.desCBC)throw k=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),k.oid=a,k.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],k;b=h.kdfSalt;var m=c.util.createBuffer(h.kdfIterationCount),m=m.getInt(m.length()<<3),v;switch(f.oids[a]){case "aes128-CBC":v=16;k=c.aes.createDecryptionCipher;break;case "aes192-CBC":v=24;k=c.aes.createDecryptionCipher;break;
447
-case "aes256-CBC":v=32;k=c.aes.createDecryptionCipher;break;case "des-EDE3-CBC":v=24;k=c.des.createDecryptionCipher;break;case "desCBC":v=8,k=c.des.createDecryptionCipher}a=c.pkcs5.pbkdf2(d,b,m,v);h=h.encIv;k=k(a);k.start(h);return k};f.pbe.getCipherForPKCS12PBE=function(a,b,d){var g={},h=[];if(!e.validate(b,p,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=c.util.createBuffer(g.salt),g=c.util.createBuffer(g.iterations),
448
-g=g.getInt(g.length()<<3),k;switch(a){case f.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:k=24;b=8;a=c.des.startDecrypting;break;case f.oids["pbewithSHAAnd40BitRC2-CBC"]:k=5;b=8;a=function(a,b){var d=c.rc2.createDecryptionCipher(a,40);d.start(b,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=a,d;}k=f.pbe.generatePkcs12Key(d,h,1,g,k);d=f.pbe.generatePkcs12Key(d,h,2,g,b);return a(k,d)};f.pbe.opensslDeriveBytes=function(a,d,g,e){if("undefined"===
449
-typeof e||null===e)e=c.md.md5.create();null===d&&(d="");for(var h=[b(e,a+d)],f=16,m=1;f<g;++m,f+=16)h.push(b(e,h[m-1]+a+d));return h.join("").substr(0,g)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pbe)return b.pbe;b.defined.pbe=!0;for(var f=
450
-0;f<e.length;++f)e[f](b);return b.pbe}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pbe","require module ./aes ./asn1 ./des ./md ./oids ./pem ./pbkdf2 ./random ./rc2 ./rsa ./util".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1,d=c.pkcs7asn1=c.pkcs7asn1||{};c.pkcs7=
431
+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"}]}]},C={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"},
432
+{name:"pkcs-12PbeParams.iterations",tagClass:e.Class.UNIVERSAL,type:e.Type.INTEGER,constructed:!1,capture:"iterations"}]};g.encryptPrivateKeyInfo=function(a,b,d){d=d||{};d.saltSize=d.saltSize||8;d.count=d.count||2048;d.algorithm=d.algorithm||"aes128";var h=c.random.getBytesSync(d.saltSize),k=d.count,l=e.integerToDer(k),w;if(0===d.algorithm.indexOf("aes")||"des"===d.algorithm){var x,G;switch(d.algorithm){case "aes128":x=w=16;d=n["aes128-CBC"];G=c.aes.createEncryptionCipher;break;case "aes192":w=24;
433
+x=16;d=n["aes192-CBC"];G=c.aes.createEncryptionCipher;break;case "aes256":w=32;x=16;d=n["aes256-CBC"];G=c.aes.createEncryptionCipher;break;case "des":x=w=8;d=n.desCBC;G=c.des.createEncryptionCipher;break;default:throw h=Error("Cannot encrypt private key. Unknown encryption algorithm."),h.algorithm=d.algorithm,h;}var B=c.pkcs5.pbkdf2(b,h,k,w);b=c.random.getBytesSync(x);k=G(B);k.start(b);k.update(e.toDer(a));k.finish();a=k.output.getBytes();h=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,
434
+e.Type.OID,!1,e.oidToDer(n.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(n.pkcs5PBKDF2).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,h),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,
435
+e.Type.OCTETSTRING,!1,b)])])])}else if("3des"===d.algorithm)w=24,d=new c.util.ByteBuffer(h),B=g.pbe.generatePkcs12Key(b,d,1,k,w),b=g.pbe.generatePkcs12Key(b,d,2,k,w),k=c.des.createEncryptionCipher(B),k.start(b),k.update(e.toDer(a)),k.finish(),a=k.output.getBytes(),h=e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OID,!1,e.oidToDer(n["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,
436
+!1,h),e.create(e.Class.UNIVERSAL,e.Type.INTEGER,!1,l.getBytes())])]);else throw h=Error("Cannot encrypt private key. Unknown encryption algorithm."),h.algorithm=d.algorithm,h;return e.create(e.Class.UNIVERSAL,e.Type.SEQUENCE,!0,[h,e.create(e.Class.UNIVERSAL,e.Type.OCTETSTRING,!1,a)])};g.decryptPrivateKeyInfo=function(a,b){var d=null,h={},l=[];if(!e.validate(a,k,h,l))throw d=Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=l,d;l=e.derToOid(h.encryptionOid);
437
+l=g.pbe.getCipher(l,h.encryptionParams,b);h=c.util.createBuffer(h.encryptedData);l.update(h);l.finish()&&(d=e.fromDer(l.output));return d};g.encryptedPrivateKeyToPem=function(a,b){var d={type:"ENCRYPTED PRIVATE KEY",body:e.toDer(a).getBytes()};return c.pem.encode(d,{maxline:b})};g.encryptedPrivateKeyFromPem=function(a){a=c.pem.decode(a)[0];if("ENCRYPTED PRIVATE KEY"!==a.type){var b=Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');b.headerType=
438
+a.type;throw b;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return e.fromDer(a.body)};g.encryptRsaPrivateKey=function(a,b,d){d=d||{};if(!d.legacy)return a=g.wrapRsaPrivateKey(g.privateKeyToAsn1(a)),a=g.encryptPrivateKeyInfo(a,b,d),g.encryptedPrivateKeyToPem(a);var h,k,l;switch(d.algorithm){case "aes128":d="AES-128-CBC";k=16;h=c.random.getBytesSync(16);l=c.aes.createEncryptionCipher;break;case "aes192":d="AES-192-CBC";
439
+k=24;h=c.random.getBytesSync(16);l=c.aes.createEncryptionCipher;break;case "aes256":d="AES-256-CBC";k=32;h=c.random.getBytesSync(16);l=c.aes.createEncryptionCipher;break;case "3des":d="DES-EDE3-CBC";k=24;h=c.random.getBytesSync(8);l=c.des.createEncryptionCipher;break;case "des":d="DES-CBC";k=8;h=c.random.getBytesSync(8);l=c.des.createEncryptionCipher;break;default:throw a=Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+d.algorithm+'".'),a.algorithm=d.algorithm,a;}b=c.pbe.opensslDeriveBytes(b,
440
+h.substr(0,8),k);b=l(b);b.start(h);b.update(e.toDer(g.privateKeyToAsn1(a)));b.finish();a={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:d,parameters:c.util.bytesToHex(h).toUpperCase()},body:b.output.getBytes()};return c.pem.encode(a)};g.decryptRsaPrivateKey=function(a,b){var d=null,h=c.pem.decode(a)[0];if("ENCRYPTED PRIVATE KEY"!==h.type&&"PRIVATE KEY"!==h.type&&"RSA PRIVATE KEY"!==h.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".'),
441
+d.headerType=d,d;if(h.procType&&"ENCRYPTED"===h.procType.type){var k,l;switch(h.dekInfo.algorithm){case "DES-CBC":k=8;l=c.des.createDecryptionCipher;break;case "DES-EDE3-CBC":k=24;l=c.des.createDecryptionCipher;break;case "AES-128-CBC":k=16;l=c.aes.createDecryptionCipher;break;case "AES-192-CBC":k=24;l=c.aes.createDecryptionCipher;break;case "AES-256-CBC":k=32;l=c.aes.createDecryptionCipher;break;case "RC2-40-CBC":k=5;l=function(a){return c.rc2.createDecryptionCipher(a,40)};break;case "RC2-64-CBC":k=
442
+8;l=function(a){return c.rc2.createDecryptionCipher(a,64)};break;case "RC2-128-CBC":k=16;l=function(a){return c.rc2.createDecryptionCipher(a,128)};break;default:throw d=Error('Could not decrypt private key; unsupported encryption algorithm "'+h.dekInfo.algorithm+'".'),d.algorithm=h.dekInfo.algorithm,d;}var w=c.util.hexToBytes(h.dekInfo.parameters);k=c.pbe.opensslDeriveBytes(b,w.substr(0,8),k);l=l(k);l.start(w);l.update(c.util.createBuffer(h.body));if(l.finish())d=l.output.getBytes();else return d}else d=
443
+h.body;d="ENCRYPTED PRIVATE KEY"===h.type?g.decryptPrivateKeyInfo(e.fromDer(d),b):e.fromDer(d);null!==d&&(d=g.privateKeyFromAsn1(d));return d};g.pbe.generatePkcs12Key=function(a,b,d,h,e,k){var g,l;if("undefined"===typeof k||null===k)k=c.md.sha1.create();var w=k.digestLength,n=k.blockLength,v=new c.util.ByteBuffer,C=new c.util.ByteBuffer;if(null!==a&&void 0!==a){for(l=0;l<a.length;l++)C.putInt16(a.charCodeAt(l));C.putInt16(0)}a=C.length();var q=b.length(),r=new c.util.ByteBuffer;r.fillWithByte(d,n);
444
+var u=n*Math.ceil(q/n);d=new c.util.ByteBuffer;for(l=0;l<u;l++)d.putByte(b.at(l%q));u=n*Math.ceil(a/n);b=new c.util.ByteBuffer;for(l=0;l<u;l++)b.putByte(C.at(l%a));C=d;C.putBuffer(b);b=Math.ceil(e/w);for(d=1;d<=b;d++){u=new c.util.ByteBuffer;u.putBytes(r.bytes());u.putBytes(C.bytes());for(l=0;l<h;l++)k.start(),k.update(u.getBytes()),u=k.digest();var E=new c.util.ByteBuffer;for(l=0;l<n;l++)E.putByte(u.at(l%w));var S=Math.ceil(q/n)+Math.ceil(a/n),L=new c.util.ByteBuffer;for(g=0;g<S;g++){var R=new c.util.ByteBuffer(C.getBytes(n)),
445
+W=511;for(l=E.length()-1;0<=l;l--)W>>=8,W+=E.at(l)+R.at(l),R.setAt(l,W&255);L.putBuffer(R)}C=L;v.putBuffer(u)}v.truncate(v.length()-e);return v};g.pbe.getCipher=function(a,c,b){switch(a){case g.oids.pkcs5PBES2:return g.pbe.getCipherForPBES2(a,c,b);case g.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case g.oids["pbewithSHAAnd40BitRC2-CBC"]:return g.pbe.getCipherForPKCS12PBE(a,c,b);default:throw c=Error("Cannot read encrypted PBE data block. Unsupported OID."),c.oid=a,c.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC",
446
+"pbewithSHAAnd40BitRC2-CBC"],c;}};g.pbe.getCipherForPBES2=function(a,b,d){var k={};a=[];if(!e.validate(b,h,k,a)){var l=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");l.errors=a;throw l;}a=e.derToOid(k.kdfOid);if(a!==g.oids.pkcs5PBKDF2)throw l=Error("Cannot read encrypted private key. Unsupported key derivation function OID."),l.oid=a,l.supportedOids=["pkcs5PBKDF2"],l;a=e.derToOid(k.encOid);if(a!==g.oids["aes128-CBC"]&&
447
+a!==g.oids["aes192-CBC"]&&a!==g.oids["aes256-CBC"]&&a!==g.oids["des-EDE3-CBC"]&&a!==g.oids.desCBC)throw l=Error("Cannot read encrypted private key. Unsupported encryption scheme OID."),l.oid=a,l.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],l;b=k.kdfSalt;var w=c.util.createBuffer(k.kdfIterationCount),w=w.getInt(w.length()<<3),n;switch(g.oids[a]){case "aes128-CBC":n=16;l=c.aes.createDecryptionCipher;break;case "aes192-CBC":n=24;l=c.aes.createDecryptionCipher;break;
448
+case "aes256-CBC":n=32;l=c.aes.createDecryptionCipher;break;case "des-EDE3-CBC":n=24;l=c.des.createDecryptionCipher;break;case "desCBC":n=8,l=c.des.createDecryptionCipher}a=c.pkcs5.pbkdf2(d,b,w,n);k=k.encIv;l=l(a);l.start(k);return l};g.pbe.getCipherForPKCS12PBE=function(a,b,d){var h={},k=[];if(!e.validate(b,C,h,k))throw d=Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."),d.errors=k,d;var k=c.util.createBuffer(h.salt),h=c.util.createBuffer(h.iterations),
449
+h=h.getInt(h.length()<<3),l;switch(a){case g.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:l=24;b=8;a=c.des.startDecrypting;break;case g.oids["pbewithSHAAnd40BitRC2-CBC"]:l=5;b=8;a=function(a,b){var d=c.rc2.createDecryptionCipher(a,40);d.start(b,null);return d};break;default:throw d=Error("Cannot read PKCS #12 PBE data block. Unsupported OID."),d.oid=a,d;}l=g.pbe.generatePkcs12Key(d,k,1,h,l);d=g.pbe.generatePkcs12Key(d,k,2,h,b);return a(l,d)};g.pbe.opensslDeriveBytes=function(a,d,h,e){if("undefined"===
450
+typeof e||null===e)e=c.md.md5.create();null===d&&(d="");for(var k=[b(e,a+d)],g=16,w=1;g<h;++w,g+=16)k.push(b(e,k[w-1]+a+d));return k.join("").substr(0,h)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pbe)return b.pbe;b.defined.pbe=!0;for(var g=
451
+0;g<e.length;++g)e[g](b);return b.pbe}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pbe","require module ./aes ./asn1 ./des ./md ./oids ./pem ./pbkdf2 ./random ./rc2 ./rsa ./util".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1,d=c.pkcs7asn1=c.pkcs7asn1||{};c.pkcs7=
452
c.pkcs7||{};c.pkcs7.asn1=d;c={name:"ContentInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:b.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};d.contentInfoValidator=c;var e={name:"EncryptedContentInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",
453
tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:b.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",
454
tagClass:b.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};d.envelopedDataValidator={name:"EnvelopedData",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:b.Class.UNIVERSAL,type:b.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(e)};d.encryptedDataValidator={name:"EncryptedData",
@@ -457,282 +458,282 @@ type:b.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tag
458
value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:b.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:b.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,
459
constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:b.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]}]}]};d.recipientInfoValidator={name:"RecipientInfo",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,
460
constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:b.Class.UNIVERSAL,type:b.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.SEQUENCE,constructed:!0,
460
-value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:b.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===
461
-typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs7asn1)return b.pkcs7asn1;b.defined.pkcs7asn1=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pkcs7asn1}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs7asn1",
462
-["require","module","./asn1","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.mgf=c.mgf||{};(c.mgf.mgf1=c.mgf1=c.mgf1||{}).create=function(a){return{generate:function(b,d){for(var f=new c.util.ByteBuffer,m=Math.ceil(d/a.digestLength),h=0;h<m;h++){var g=new c.util.ByteBuffer;g.putInt32(h);a.start();a.update(b+g.getBytes());f.putBuffer(a.digest())}f.truncate(f.length()-d);return f.getBytes()}}}}if("function"!==typeof c)if("object"===typeof module&&
463
-module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.mgf1)return b.mgf1;b.defined.mgf1=!0;for(var f=0;f<e.length;++f)e[f](b);return b.mgf1}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,
464
-Array.prototype.slice.call(arguments,0))};c("js/mgf1",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.mgf=c.mgf||{};c.mgf.mgf1=c.mgf1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||
465
-{};if(b.defined.mgf)return b.mgf;b.defined.mgf=!0;for(var f=0;f<e.length;++f)e[f](b);return b.mgf}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/mgf",["require","module","./mgf1"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){(c.pss=c.pss||{}).create=function(a){3===arguments.length&&
466
-(a={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var b=a.md,d=a.mgf,f=b.digestLength,m=a.salt||null;"string"===typeof m&&(m=c.util.createBuffer(m));var h;if("saltLength"in a)h=a.saltLength;else if(null!==m)h=m.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==m&&m.length()!==h)throw Error("Given salt length does not match length of given salt.");var g=a.prng||c.random;return{encode:function(a,k){var p,w=k-1,r=Math.ceil(w/8),D=a.digest().getBytes();
467
-if(r<f+h+2)throw Error("Message is too long to encrypt.");var A;A=null===m?g.getBytesSync(h):m.bytes();p=new c.util.ByteBuffer;p.fillWithByte(0,8);p.putBytes(D);p.putBytes(A);b.start();b.update(p.getBytes());D=b.digest().getBytes();p=new c.util.ByteBuffer;p.fillWithByte(0,r-h-f-2);p.putByte(1);p.putBytes(A);var L=p.getBytes(),z=r-f-1,C=d.generate(D,z);A="";for(p=0;p<z;p++)A+=String.fromCharCode(L.charCodeAt(p)^C.charCodeAt(p));w=65280>>8*r-w&255;A=String.fromCharCode(A.charCodeAt(0)&~w)+A.substr(1);
468
-return A+D+String.fromCharCode(188)},verify:function(a,g,k){var m;m=k-1;k=Math.ceil(m/8);g=g.substr(-k);if(k<f+h+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==g.charCodeAt(k-1))throw Error("Encoded message does not end in 0xBC.");var p=k-f-1,r=g.substr(0,p);g=g.substr(p,f);var A=65280>>8*k-m&255;if(0!==(r.charCodeAt(0)&A))throw Error("Bits beyond keysize not zero as expected.");var B=d.generate(g,p),z="";for(m=0;m<p;m++)z+=String.fromCharCode(r.charCodeAt(m)^B.charCodeAt(m));
469
-z=String.fromCharCode(z.charCodeAt(0)&~A)+z.substr(1);k=k-f-h-2;for(m=0;m<k;m++)if(0!==z.charCodeAt(m))throw Error("Leftmost octets not zero as expected");if(1!==z.charCodeAt(k))throw Error("Inconsistent PSS signature, 0x01 marker not found");k=z.substr(-h);p=new c.util.ByteBuffer;p.fillWithByte(0,8);p.putBytes(a);p.putBytes(k);b.start();b.update(p.getBytes());a=b.digest().getBytes();return g===a}}}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,
470
-module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pss)return b.pss;b.defined.pss=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pss}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pss",
471
-["require","module","./random","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c){"string"===typeof c&&(c={shortName:c});for(var d=null,g,e=0;null===d&&e<a.attributes.length;++e)g=a.attributes[e],c.type&&c.type===g.type?d=g:c.name&&c.name===g.name?d=g:c.shortName&&c.shortName===g.shortName&&(d=g);return d}function d(a){var b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),e;a=a.attributes;for(var h=0;h<a.length;++h){e=a[h];
472
-var f=e.value,k=g.Type.PRINTABLESTRING;"valueTagClass"in e&&(k=e.valueTagClass,k===g.Type.UTF8&&(f=c.util.encodeUtf8(f)));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,k,!1,f)])]);b.value.push(e)}return b}function e(a){for(var c,b=0;b<a.length;++b){c=a[b];"undefined"===typeof c.name&&(c.type&&c.type in p.oids?c.name=p.oids[c.type]:c.shortName&&c.shortName in
473
-r&&(c.name=p.oids[r[c.shortName]]));if("undefined"===typeof c.type)if(c.name&&c.name in p.oids)c.type=p.oids[c.name];else throw a=Error("Attribute type not specified."),a.attribute=c,a;"undefined"===typeof c.shortName&&c.name&&c.name in r&&(c.shortName=r[c.name]);if(c.type===n.extensionRequest&&(c.valueConstructed=!0,c.valueTagClass=g.Type.SEQUENCE,!c.value&&c.extensions)){c.value=[];for(var d=0;d<c.extensions.length;++d)c.value.push(p.certificateExtensionToAsn1(f(c.extensions[d])))}if("undefined"===
474
-typeof c.value)throw a=Error("Attribute value not specified."),a.attribute=c,a;}}function f(a,b){b=b||{};"undefined"===typeof a.name&&a.id&&a.id in p.oids&&(a.name=p.oids[a.id]);if("undefined"===typeof a.id)if(a.name&&a.name in p.oids)a.id=p.oids[a.name];else{var d=Error("Extension ID not specified.");d.extension=a;throw d;}if("undefined"!==typeof a.value)return a;if("keyUsage"===a.name){var e=d=0,h=0;a.digitalSignature&&(e|=128,d=7);a.nonRepudiation&&(e|=64,d=6);a.keyEncipherment&&(e|=32,d=5);a.dataEncipherment&&
475
-(e|=16,d=4);a.keyAgreement&&(e|=8,d=3);a.keyCertSign&&(e|=4,d=2);a.cRLSign&&(e|=2,d=1);a.encipherOnly&&(e|=1,d=0);a.decipherOnly&&(h|=128,d=7);d=String.fromCharCode(d);0!==h?d+=String.fromCharCode(e)+String.fromCharCode(h):0!==e&&(d+=String.fromCharCode(e));a.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d)}else if("basicConstraints"===a.name)a.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),a.cA&&a.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255))),
476
-"pathLenConstraint"in a&&a.value.value.push(g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(a.pathLenConstraint).getBytes()));else if("extKeyUsage"===a.name)for(e in a.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),d=a.value.value,a)!0===a[e]&&(e in n?d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(n[e]).getBytes())):-1!==e.indexOf(".")&&d.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(e).getBytes())));else if("nsCertType"===a.name)e=d=0,a.client&&(e|=128,
477
-d=7),a.server&&(e|=64,d=6),a.email&&(e|=32,d=5),a.objsign&&(e|=16,d=4),a.reserved&&(e|=8,d=3),a.sslCA&&(e|=4,d=2),a.emailCA&&(e|=2,d=1),a.objCA&&(e|=1,d=0),d=String.fromCharCode(d),0!==e&&(d+=String.fromCharCode(e)),a.value=g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,d);else if("subjectAltName"===a.name||"issuerAltName"===a.name)for(a.value=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]),h=0;h<a.altNames.length;++h){e=a.altNames[h];d=e.value;if(7===e.type&&e.ip){if(d=c.util.bytesFromIP(e.ip),
478
-null===d)throw d=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.'),d.extension=a,d;}else 8===e.type&&(d=e.oid?g.oidToDer(g.oidToDer(e.oid)):g.oidToDer(d));a.value.value.push(g.create(g.Class.CONTEXT_SPECIFIC,e.type,!1,d))}else"subjectKeyIdentifier"===a.name&&b.cert&&(d=b.cert.generateSubjectKeyIdentifier(),a.subjectKeyIdentifier=d.toHex(),a.value=g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,d.getBytes()));if("undefined"===typeof a.value)throw d=Error("Extension value not specified."),
479
-d.extension=a,d;return a}function m(a,c){switch(a){case n["RSASSA-PSS"]:var b=[];void 0!==c.hash.algorithmOid&&b.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(c.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])]));void 0!==c.mgf.algorithmOid&&b.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,
480
-!1,g.oidToDer(c.mgf.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(c.mgf.hash.algorithmOid).getBytes()),g.create(g.Class.UNIVERSAL,g.Type.NULL,!1,"")])])]));void 0!==c.saltLength&&b.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,g.integerToDer(c.saltLength).getBytes())]));return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,b);default:return g.create(g.Class.UNIVERSAL,g.Type.NULL,
481
-!1,"")}}function h(a){var b=g.create(g.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===a.attributes.length)return b;a=a.attributes;for(var d=0;d<a.length;++d){var e=a[d],h=e.value,f=g.Type.UTF8;"valueTagClass"in e&&(f=e.valueTagClass);f===g.Type.UTF8&&(h=c.util.encodeUtf8(h));var k=!1;"valueConstructed"in e&&(k=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,
482
-f,k,h)])]);b.value.push(e)}return b}var g=c.asn1,p=c.pki=c.pki||{},n=p.oids,r={};r.CN=n.commonName;r.commonName="CN";r.C=n.countryName;r.countryName="C";r.L=n.localityName;r.localityName="L";r.ST=n.stateOrProvinceName;r.stateOrProvinceName="ST";r.O=n.organizationName;r.organizationName="O";r.OU=n.organizationalUnitName;r.organizationalUnitName="OU";r.E=n.emailAddress;r.emailAddress="E";var w=c.pki.rsa.publicKeyValidator,y={name:"Certificate",tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,
483
-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,
484
-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,
485
-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"},
486
-{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"},w,{name:"Certificate.TBSCertificate.issuerUniqueID",
487
-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"}]},
488
-{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"}]},
489
-{name:"Certificate.signatureValue",tagClass:g.Class.UNIVERSAL,type:g.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},D={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,
490
-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,
491
-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",
492
-tagClass:g.Class.UNIVERSAL,type:g.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},A={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",
493
-tagClass:g.Class.UNIVERSAL,type:g.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},w,{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",
494
-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,
495
-type:g.Type.BITSTRING,constructed:!1,capture:"csrSignature"}]};p.RDNAttributesAsArray=function(a,c){for(var b=[],d,e,h,l=0;l<a.value.length;++l){d=a.value[l];for(var f=0;f<d.value.length;++f)h={},e=d.value[f],h.type=g.derToOid(e.value[0].value),h.value=e.value[1].value,h.valueTagClass=e.value[1].type,h.type in n&&(h.name=n[h.type],h.name in r&&(h.shortName=r[h.name])),c&&(c.update(h.type),c.update(h.value)),b.push(h)}return b};p.CRIAttributesAsArray=function(a){for(var c=[],b=0;b<a.length;++b)for(var d=
496
-a[b],e=g.derToOid(d.value[0].value),d=d.value[1].value,h=0;h<d.length;++h){var l={};l.type=e;l.value=d[h].value;l.valueTagClass=d[h].type;l.type in n&&(l.name=n[l.type],l.name in r&&(l.shortName=r[l.name]));if(l.type===n.extensionRequest){l.extensions=[];for(var f=0;f<l.value.length;++f)l.extensions.push(p.certificateExtensionFromAsn1(l.value[f]))}c.push(l)}return c};var L=function(a,c,b){var d={};if(a!==n["RSASSA-PSS"])return d;b&&(d={hash:{algorithmOid:n.sha1},mgf:{algorithmOid:n.mgf1,hash:{algorithmOid:n.sha1}},
497
-saltLength:20});b={};a=[];if(!g.validate(c,D,b,a))throw c=Error("Cannot read RSASSA-PSS parameter block."),c.errors=a,c;void 0!==b.hashOid&&(d.hash=d.hash||{},d.hash.algorithmOid=g.derToOid(b.hashOid));void 0!==b.maskGenOid&&(d.mgf=d.mgf||{},d.mgf.algorithmOid=g.derToOid(b.maskGenOid),d.mgf.hash=d.mgf.hash||{},d.mgf.hash.algorithmOid=g.derToOid(b.maskGenHashOid));void 0!==b.saltLength&&(d.saltLength=b.saltLength.charCodeAt(0));return d};p.certificateFromPem=function(a,b,d){a=c.pem.decode(a)[0];if("CERTIFICATE"!==
498
-a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type)throw b=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'),b.headerType=a.type,b;if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");d=g.fromDer(a.body,d);return p.certificateFromAsn1(d,b)};p.certificateToPem=function(a,b){var d={type:"CERTIFICATE",body:g.toDer(p.certificateToAsn1(a)).getBytes()};
499
-return c.pem.encode(d,{maxline:b})};p.publicKeyFromPem=function(a){a=c.pem.decode(a)[0];if("PUBLIC KEY"!==a.type&&"RSA PUBLIC KEY"!==a.type){var b=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');b.headerType=a.type;throw b;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");a=g.fromDer(a.body);return p.publicKeyFromAsn1(a)};p.publicKeyToPem=function(a,b){var d={type:"PUBLIC KEY",
500
-body:g.toDer(p.publicKeyToAsn1(a)).getBytes()};return c.pem.encode(d,{maxline:b})};p.publicKeyToRSAPublicKeyPem=function(a,b){var d={type:"RSA PUBLIC KEY",body:g.toDer(p.publicKeyToRSAPublicKey(a)).getBytes()};return c.pem.encode(d,{maxline:b})};p.getPublicKeyFingerprint=function(a,b){b=b||{};var d=b.md||c.md.sha1.create(),e;switch(b.type||"RSAPublicKey"){case "RSAPublicKey":e=g.toDer(p.publicKeyToRSAPublicKey(a)).getBytes();break;case "SubjectPublicKeyInfo":e=g.toDer(p.publicKeyToAsn1(a)).getBytes();
501
-break;default:throw Error('Unknown fingerprint type "'+b.type+'".');}d.start();d.update(e);d=d.digest();if("hex"===b.encoding)return d=d.toHex(),b.delimiter?d.match(/.{2}/g).join(b.delimiter):d;if("binary"===b.encoding)return d.getBytes();if(b.encoding)throw Error('Unknown encoding "'+b.encoding+'".');return d};p.certificationRequestFromPem=function(a,b,d){a=c.pem.decode(a)[0];if("CERTIFICATE REQUEST"!==a.type)throw b=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'),
502
-b.headerType=a.type,b;if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");d=g.fromDer(a.body,d);return p.certificationRequestFromAsn1(d,b)};p.certificationRequestToPem=function(a,b){var d={type:"CERTIFICATE REQUEST",body:g.toDer(p.certificationRequestToAsn1(a)).getBytes()};return c.pem.encode(d,{maxline:b})};p.createCertificate=function(){var a={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};a.siginfo.algorithmOid=
461
+value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:b.Class.UNIVERSAL,type:b.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:b.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:b.Class.UNIVERSAL,type:b.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===
462
+typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs7asn1)return b.pkcs7asn1;b.defined.pkcs7asn1=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pkcs7asn1}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs7asn1",
463
+["require","module","./asn1","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.mgf=c.mgf||{};(c.mgf.mgf1=c.mgf1=c.mgf1||{}).create=function(a){return{generate:function(b,d){for(var g=new c.util.ByteBuffer,n=Math.ceil(d/a.digestLength),k=0;k<n;k++){var h=new c.util.ByteBuffer;h.putInt32(k);a.start();a.update(b+h.getBytes());g.putBuffer(a.digest())}g.truncate(g.length()-d);return g.getBytes()}}}}if("function"!==typeof c)if("object"===typeof module&&
464
+module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.mgf1)return b.mgf1;b.defined.mgf1=!0;for(var g=0;g<e.length;++g)e[g](b);return b.mgf1}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,
465
+Array.prototype.slice.call(arguments,0))};c("js/mgf1",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.mgf=c.mgf||{};c.mgf.mgf1=c.mgf1}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||
466
+{};if(b.defined.mgf)return b.mgf;b.defined.mgf=!0;for(var g=0;g<e.length;++g)e[g](b);return b.mgf}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/mgf",["require","module","./mgf1"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){(c.pss=c.pss||{}).create=function(a){3===arguments.length&&
467
+(a={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var b=a.md,d=a.mgf,g=b.digestLength,n=a.salt||null;"string"===typeof n&&(n=c.util.createBuffer(n));var k;if("saltLength"in a)k=a.saltLength;else if(null!==n)k=n.length();else throw Error("Salt length not specified or specific salt not given.");if(null!==n&&n.length()!==k)throw Error("Given salt length does not match length of given salt.");var h=a.prng||c.random;return{encode:function(a,l){var r,y=l-1,z=Math.ceil(y/8),u=a.digest().getBytes();
468
+if(z<g+k+2)throw Error("Message is too long to encrypt.");var D;D=null===n?h.getBytesSync(k):n.bytes();r=new c.util.ByteBuffer;r.fillWithByte(0,8);r.putBytes(u);r.putBytes(D);b.start();b.update(r.getBytes());u=b.digest().getBytes();r=new c.util.ByteBuffer;r.fillWithByte(0,z-k-g-2);r.putByte(1);r.putBytes(D);var N=r.getBytes(),x=z-g-1,G=d.generate(u,x);D="";for(r=0;r<x;r++)D+=String.fromCharCode(N.charCodeAt(r)^G.charCodeAt(r));y=65280>>8*z-y&255;D=String.fromCharCode(D.charCodeAt(0)&~y)+D.substr(1);
469
+return D+u+String.fromCharCode(188)},verify:function(a,h,l){var n;n=l-1;l=Math.ceil(n/8);h=h.substr(-l);if(l<g+k+2)throw Error("Inconsistent parameters to PSS signature verification.");if(188!==h.charCodeAt(l-1))throw Error("Encoded message does not end in 0xBC.");var r=l-g-1,u=h.substr(0,r);h=h.substr(r,g);var D=65280>>8*l-n&255;if(0!==(u.charCodeAt(0)&D))throw Error("Bits beyond keysize not zero as expected.");var E=d.generate(h,r),x="";for(n=0;n<r;n++)x+=String.fromCharCode(u.charCodeAt(n)^E.charCodeAt(n));
470
+x=String.fromCharCode(x.charCodeAt(0)&~D)+x.substr(1);l=l-g-k-2;for(n=0;n<l;n++)if(0!==x.charCodeAt(n))throw Error("Leftmost octets not zero as expected");if(1!==x.charCodeAt(l))throw Error("Inconsistent PSS signature, 0x01 marker not found");l=x.substr(-k);r=new c.util.ByteBuffer;r.fillWithByte(0,8);r.putBytes(a);r.putBytes(l);b.start();b.update(r.getBytes());a=b.digest().getBytes();return h===a}}}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,
471
+module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pss)return b.pss;b.defined.pss=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pss}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pss",
472
+["require","module","./random","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c){"string"===typeof c&&(c={shortName:c});for(var d=null,h,e=0;null===d&&e<a.attributes.length;++e)h=a.attributes[e],c.type&&c.type===h.type?d=h:c.name&&c.name===h.name?d=h:c.shortName&&c.shortName===h.shortName&&(d=h);return d}function d(a){var b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),e;a=a.attributes;for(var k=0;k<a.length;++k){e=a[k];
473
+var g=e.value,l=h.Type.PRINTABLESTRING;"valueTagClass"in e&&(l=e.valueTagClass,l===h.Type.UTF8&&(g=c.util.encodeUtf8(g)));e=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.type).getBytes()),h.create(h.Class.UNIVERSAL,l,!1,g)])]);b.value.push(e)}return b}function e(a){for(var c,b=0;b<a.length;++b){c=a[b];"undefined"===typeof c.name&&(c.type&&c.type in r.oids?c.name=r.oids[c.type]:c.shortName&&c.shortName in
474
+u&&(c.name=r.oids[u[c.shortName]]));if("undefined"===typeof c.type)if(c.name&&c.name in r.oids)c.type=r.oids[c.name];else throw a=Error("Attribute type not specified."),a.attribute=c,a;"undefined"===typeof c.shortName&&c.name&&c.name in u&&(c.shortName=u[c.name]);if(c.type===p.extensionRequest&&(c.valueConstructed=!0,c.valueTagClass=h.Type.SEQUENCE,!c.value&&c.extensions)){c.value=[];for(var d=0;d<c.extensions.length;++d)c.value.push(r.certificateExtensionToAsn1(g(c.extensions[d])))}if("undefined"===
475
+typeof c.value)throw a=Error("Attribute value not specified."),a.attribute=c,a;}}function g(a,b){b=b||{};"undefined"===typeof a.name&&a.id&&a.id in r.oids&&(a.name=r.oids[a.id]);if("undefined"===typeof a.id)if(a.name&&a.name in r.oids)a.id=r.oids[a.name];else{var d=Error("Extension ID not specified.");d.extension=a;throw d;}if("undefined"!==typeof a.value)return a;if("keyUsage"===a.name){var e=d=0,k=0;a.digitalSignature&&(e|=128,d=7);a.nonRepudiation&&(e|=64,d=6);a.keyEncipherment&&(e|=32,d=5);a.dataEncipherment&&
476
+(e|=16,d=4);a.keyAgreement&&(e|=8,d=3);a.keyCertSign&&(e|=4,d=2);a.cRLSign&&(e|=2,d=1);a.encipherOnly&&(e|=1,d=0);a.decipherOnly&&(k|=128,d=7);d=String.fromCharCode(d);0!==k?d+=String.fromCharCode(e)+String.fromCharCode(k):0!==e&&(d+=String.fromCharCode(e));a.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,d)}else if("basicConstraints"===a.name)a.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),a.cA&&a.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,String.fromCharCode(255))),
477
+"pathLenConstraint"in a&&a.value.value.push(h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(a.pathLenConstraint).getBytes()));else if("extKeyUsage"===a.name)for(e in a.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),d=a.value.value,a)!0===a[e]&&(e in p?d.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(p[e]).getBytes())):-1!==e.indexOf(".")&&d.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e).getBytes())));else if("nsCertType"===a.name)e=d=0,a.client&&(e|=128,
478
+d=7),a.server&&(e|=64,d=6),a.email&&(e|=32,d=5),a.objsign&&(e|=16,d=4),a.reserved&&(e|=8,d=3),a.sslCA&&(e|=4,d=2),a.emailCA&&(e|=2,d=1),a.objCA&&(e|=1,d=0),d=String.fromCharCode(d),0!==e&&(d+=String.fromCharCode(e)),a.value=h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,d);else if("subjectAltName"===a.name||"issuerAltName"===a.name)for(a.value=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]),k=0;k<a.altNames.length;++k){e=a.altNames[k];d=e.value;if(7===e.type&&e.ip){if(d=c.util.bytesFromIP(e.ip),
479
+null===d)throw d=Error('Extension "ip" value is not a valid IPv4 or IPv6 address.'),d.extension=a,d;}else 8===e.type&&(d=e.oid?h.oidToDer(h.oidToDer(e.oid)):h.oidToDer(d));a.value.value.push(h.create(h.Class.CONTEXT_SPECIFIC,e.type,!1,d))}else"subjectKeyIdentifier"===a.name&&b.cert&&(d=b.cert.generateSubjectKeyIdentifier(),a.subjectKeyIdentifier=d.toHex(),a.value=h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,d.getBytes()));if("undefined"===typeof a.value)throw d=Error("Extension value not specified."),
480
+d.extension=a,d;return a}function n(a,c){switch(a){case p["RSASSA-PSS"]:var b=[];void 0!==c.hash.algorithmOid&&b.push(h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(c.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])]));void 0!==c.mgf.algorithmOid&&b.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,
481
+!1,h.oidToDer(c.mgf.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(c.mgf.hash.algorithmOid).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")])])]));void 0!==c.saltLength&&b.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(c.saltLength).getBytes())]));return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,b);default:return h.create(h.Class.UNIVERSAL,h.Type.NULL,
482
+!1,"")}}function k(a){var b=h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[]);if(0===a.attributes.length)return b;a=a.attributes;for(var d=0;d<a.length;++d){var e=a[d],k=e.value,g=h.Type.UTF8;"valueTagClass"in e&&(g=e.valueTagClass);g===h.Type.UTF8&&(k=c.util.encodeUtf8(k));var l=!1;"valueConstructed"in e&&(l=e.valueConstructed);e=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(e.type).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,
483
+g,l,k)])]);b.value.push(e)}return b}var h=c.asn1,r=c.pki=c.pki||{},p=r.oids,u={};u.CN=p.commonName;u.commonName="CN";u.C=p.countryName;u.countryName="C";u.L=p.localityName;u.localityName="L";u.ST=p.stateOrProvinceName;u.stateOrProvinceName="ST";u.O=p.organizationName;u.organizationName="O";u.OU=p.organizationalUnitName;u.organizationalUnitName="OU";u.E=p.emailAddress;u.emailAddress="E";var y=c.pki.rsa.publicKeyValidator,z={name:"Certificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,
484
+value:[{name:"Certificate.TBSCertificate",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,
485
+capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,
486
+constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},
487
+{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:h.Class.UNIVERSAL,type:h.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:h.Class.UNIVERSAL,type:h.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},y,{name:"Certificate.TBSCertificate.issuerUniqueID",
488
+tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,capture:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,capture:"certSubjectUniqueId"}]},
489
+{name:"Certificate.TBSCertificate.extensions",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},
490
+{name:"Certificate.signatureValue",tagClass:h.Class.UNIVERSAL,type:h.Type.BITSTRING,constructed:!1,capture:"certSignature"}]},A={name:"rsapss",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,
491
+type:h.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:h.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:h.Class.UNIVERSAL,type:h.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:h.Class.UNIVERSAL,
492
+type:h.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:h.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:h.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",
493
+tagClass:h.Class.UNIVERSAL,type:h.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},D={name:"CertificationRequest",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[{name:"CertificationRequestInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",
494
+tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},y,{name:"CertificationRequestInfo.attributes",tagClass:h.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",
495
+tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0}]}]}]},{name:"CertificationRequest.signatureAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:h.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:h.Class.UNIVERSAL,
496
+type:h.Type.BITSTRING,constructed:!1,capture:"csrSignature"}]};r.RDNAttributesAsArray=function(a,c){for(var b=[],d,e,k,m=0;m<a.value.length;++m){d=a.value[m];for(var g=0;g<d.value.length;++g)k={},e=d.value[g],k.type=h.derToOid(e.value[0].value),k.value=e.value[1].value,k.valueTagClass=e.value[1].type,k.type in p&&(k.name=p[k.type],k.name in u&&(k.shortName=u[k.name])),c&&(c.update(k.type),c.update(k.value)),b.push(k)}return b};r.CRIAttributesAsArray=function(a){for(var c=[],b=0;b<a.length;++b)for(var d=
497
+a[b],e=h.derToOid(d.value[0].value),d=d.value[1].value,k=0;k<d.length;++k){var m={};m.type=e;m.value=d[k].value;m.valueTagClass=d[k].type;m.type in p&&(m.name=p[m.type],m.name in u&&(m.shortName=u[m.name]));if(m.type===p.extensionRequest){m.extensions=[];for(var g=0;g<m.value.length;++g)m.extensions.push(r.certificateExtensionFromAsn1(m.value[g]))}c.push(m)}return c};var N=function(a,c,b){var d={};if(a!==p["RSASSA-PSS"])return d;b&&(d={hash:{algorithmOid:p.sha1},mgf:{algorithmOid:p.mgf1,hash:{algorithmOid:p.sha1}},
498
+saltLength:20});b={};a=[];if(!h.validate(c,A,b,a))throw c=Error("Cannot read RSASSA-PSS parameter block."),c.errors=a,c;void 0!==b.hashOid&&(d.hash=d.hash||{},d.hash.algorithmOid=h.derToOid(b.hashOid));void 0!==b.maskGenOid&&(d.mgf=d.mgf||{},d.mgf.algorithmOid=h.derToOid(b.maskGenOid),d.mgf.hash=d.mgf.hash||{},d.mgf.hash.algorithmOid=h.derToOid(b.maskGenHashOid));void 0!==b.saltLength&&(d.saltLength=b.saltLength.charCodeAt(0));return d};r.certificateFromPem=function(a,b,d){a=c.pem.decode(a)[0];if("CERTIFICATE"!==
499
+a.type&&"X509 CERTIFICATE"!==a.type&&"TRUSTED CERTIFICATE"!==a.type)throw b=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'),b.headerType=a.type,b;if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");d=h.fromDer(a.body,d);return r.certificateFromAsn1(d,b)};r.certificateToPem=function(a,b){var d={type:"CERTIFICATE",body:h.toDer(r.certificateToAsn1(a)).getBytes()};
500
+return c.pem.encode(d,{maxline:b})};r.publicKeyFromPem=function(a){a=c.pem.decode(a)[0];if("PUBLIC KEY"!==a.type&&"RSA PUBLIC KEY"!==a.type){var b=Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');b.headerType=a.type;throw b;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert public key from PEM; PEM is encrypted.");a=h.fromDer(a.body);return r.publicKeyFromAsn1(a)};r.publicKeyToPem=function(a,b){var d={type:"PUBLIC KEY",
501
+body:h.toDer(r.publicKeyToAsn1(a)).getBytes()};return c.pem.encode(d,{maxline:b})};r.publicKeyToRSAPublicKeyPem=function(a,b){var d={type:"RSA PUBLIC KEY",body:h.toDer(r.publicKeyToRSAPublicKey(a)).getBytes()};return c.pem.encode(d,{maxline:b})};r.getPublicKeyFingerprint=function(a,b){b=b||{};var d=b.md||c.md.sha1.create(),e;switch(b.type||"RSAPublicKey"){case "RSAPublicKey":e=h.toDer(r.publicKeyToRSAPublicKey(a)).getBytes();break;case "SubjectPublicKeyInfo":e=h.toDer(r.publicKeyToAsn1(a)).getBytes();
502
+break;default:throw Error('Unknown fingerprint type "'+b.type+'".');}d.start();d.update(e);d=d.digest();if("hex"===b.encoding)return d=d.toHex(),b.delimiter?d.match(/.{2}/g).join(b.delimiter):d;if("binary"===b.encoding)return d.getBytes();if(b.encoding)throw Error('Unknown encoding "'+b.encoding+'".');return d};r.certificationRequestFromPem=function(a,b,d){a=c.pem.decode(a)[0];if("CERTIFICATE REQUEST"!==a.type)throw b=Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'),
503
+b.headerType=a.type,b;if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert certification request from PEM; PEM is encrypted.");d=h.fromDer(a.body,d);return r.certificationRequestFromAsn1(d,b)};r.certificationRequestToPem=function(a,b){var d={type:"CERTIFICATE REQUEST",body:h.toDer(r.certificationRequestToAsn1(a)).getBytes()};return c.pem.encode(d,{maxline:b})};r.createCertificate=function(){var a={version:2,serialNumber:"00",signatureOid:null,signature:null,siginfo:{}};a.siginfo.algorithmOid=
504
null;a.validity={};a.validity.notBefore=new Date;a.validity.notAfter=new Date;a.issuer={};a.issuer.getField=function(c){return b(a.issuer,c)};a.issuer.addField=function(c){e([c]);a.issuer.attributes.push(c)};a.issuer.attributes=[];a.issuer.hash=null;a.subject={};a.subject.getField=function(c){return b(a.subject,c)};a.subject.addField=function(c){e([c]);a.subject.attributes.push(c)};a.subject.attributes=[];a.subject.hash=null;a.extensions=[];a.publicKey=null;a.md=null;a.setSubject=function(c,b){e(c);
504
-a.subject.attributes=c;delete a.subject.uniqueId;b&&(a.subject.uniqueId=b);a.subject.hash=null};a.setIssuer=function(c,b){e(c);a.issuer.attributes=c;delete a.issuer.uniqueId;b&&(a.issuer.uniqueId=b);a.issuer.hash=null};a.setExtensions=function(c){for(var b=0;b<c.length;++b)f(c[b],{cert:a});a.extensions=c};a.getExtension=function(c){"string"===typeof c&&(c={name:c});for(var b=null,d,e=0;null===b&&e<a.extensions.length;++e)d=a.extensions[e],c.id&&d.id===c.id?b=d:c.name&&d.name===c.name&&(b=d);return b};
505
-a.sign=function(b,d){a.md=d||c.md.sha1.create();var e=n[a.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certificate digest. Unknown message digest algorithm OID."),e.algorithm=a.md.algorithm,e;a.signatureOid=a.siginfo.algorithmOid=e;a.tbsCertificate=p.getTBSCertificate(a);e=g.toDer(a.tbsCertificate);a.md.update(e.getBytes());a.signature=b.sign(a.md)};a.verify=function(b){var d=!1;if(!a.issued(b)){var d=a.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.");
506
-e.expectedIssuer=b.issuer.attributes;e.actualIssuer=d.attributes;throw e;}e=b.md;if(null===e){if(b.signatureOid in n)switch(n[b.signatureOid]){case "sha1WithRSAEncryption":e=c.md.sha1.create();break;case "md5WithRSAEncryption":e=c.md.md5.create();break;case "sha256WithRSAEncryption":e=c.md.sha256.create();break;case "sha512WithRSAEncryption":e=c.md.sha512.create();break;case "RSASSA-PSS":e=c.md.sha256.create()}if(null===e)throw e=Error("Could not compute certificate digest. Unknown signature OID."),
507
-e.signatureOid=b.signatureOid,e;var h=b.tbsCertificate||p.getTBSCertificate(b),h=g.toDer(h);e.update(h.getBytes())}if(null!==e){var f;switch(b.signatureOid){case n.sha1WithRSAEncryption:f=void 0;break;case n["RSASSA-PSS"]:d=n[b.signatureParameters.mgf.hash.algorithmOid];if(void 0===d||void 0===c.md[d])throw e=Error("Unsupported MGF hash function."),e.oid=b.signatureParameters.mgf.hash.algorithmOid,e.name=d,e;f=n[b.signatureParameters.mgf.algorithmOid];if(void 0===f||void 0===c.mgf[f])throw e=Error("Unsupported MGF function."),
508
-e.oid=b.signatureParameters.mgf.algorithmOid,e.name=f,e;f=c.mgf[f].create(c.md[d].create());d=n[b.signatureParameters.hash.algorithmOid];if(void 0===d||void 0===c.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:b.signatureParameters.hash.algorithmOid,name:d};f=c.pss.create(c.md[d].create(),f,b.signatureParameters.saltLength)}d=a.publicKey.verify(e.digest().getBytes(),b.signature,f)}return d};a.isIssuer=function(c){var b=!1,d=a.issuer;c=c.subject;if(d.hash&&c.hash)b=d.hash===c.hash;
509
-else if(d.attributes.length===c.attributes.length)for(var b=!0,e,g,h=0;b&&h<d.attributes.length;++h)if(e=d.attributes[h],g=c.attributes[h],e.type!==g.type||e.value!==g.value)b=!1;return b};a.issued=function(c){return c.isIssuer(a)};a.generateSubjectKeyIdentifier=function(){return p.getPublicKeyFingerprint(a.publicKey,{type:"RSAPublicKey"})};a.verifySubjectKeyIdentifier=function(){for(var b=n.subjectKeyIdentifier,d=0;d<a.extensions.length;++d){var e=a.extensions[d];if(e.id===b)return b=a.generateSubjectKeyIdentifier().getBytes(),
510
-c.util.hexToBytes(e.subjectKeyIdentifier)===b}return!1};return a};p.certificateFromAsn1=function(a,d){var h={},f=[];if(!g.validate(a,y,h,f))throw h=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."),h.errors=f,h;if("string"!==typeof h.certSignature){for(var f="\x00",m=0;m<h.certSignature.length;++m)f+=g.toDer(h.certSignature[m]).getBytes();h.certSignature=f}f=g.derToOid(h.publicKeyOid);if(f!==p.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");
511
-var q=p.createCertificate();q.version=h.certVersion?h.certVersion.charCodeAt(0):0;f=c.util.createBuffer(h.certSerialNumber);q.serialNumber=f.toHex();q.signatureOid=c.asn1.derToOid(h.certSignatureOid);q.signatureParameters=L(q.signatureOid,h.certSignatureParams,!0);q.siginfo.algorithmOid=c.asn1.derToOid(h.certinfoSignatureOid);q.siginfo.parameters=L(q.siginfo.algorithmOid,h.certinfoSignatureParams,!1);f=c.util.createBuffer(h.certSignature);++f.read;q.signature=f.getBytes();f=[];void 0!==h.certValidity1UTCTime&&
512
-f.push(g.utcTimeToDate(h.certValidity1UTCTime));void 0!==h.certValidity2GeneralizedTime&&f.push(g.generalizedTimeToDate(h.certValidity2GeneralizedTime));void 0!==h.certValidity3UTCTime&&f.push(g.utcTimeToDate(h.certValidity3UTCTime));void 0!==h.certValidity4GeneralizedTime&&f.push(g.generalizedTimeToDate(h.certValidity4GeneralizedTime));if(2<f.length)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(2>f.length)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");
513
-q.validity.notBefore=f[0];q.validity.notAfter=f[1];q.tbsCertificate=h.tbsCertificate;if(d){q.md=null;if(q.signatureOid in n)switch(f=n[q.signatureOid],f){case "sha1WithRSAEncryption":q.md=c.md.sha1.create();break;case "md5WithRSAEncryption":q.md=c.md.md5.create();break;case "sha256WithRSAEncryption":q.md=c.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=c.md.sha512.create();break;case "RSASSA-PSS":q.md=c.md.sha256.create()}if(null===q.md)throw h=Error("Could not compute certificate digest. Unknown signature OID."),
514
-h.signatureOid=q.signatureOid,h;f=g.toDer(q.tbsCertificate);q.md.update(f.getBytes())}f=c.md.sha1.create();q.issuer.getField=function(a){return b(q.issuer,a)};q.issuer.addField=function(a){e([a]);q.issuer.attributes.push(a)};q.issuer.attributes=p.RDNAttributesAsArray(h.certIssuer,f);h.certIssuerUniqueId&&(q.issuer.uniqueId=h.certIssuerUniqueId);q.issuer.hash=f.digest().toHex();f=c.md.sha1.create();q.subject.getField=function(a){return b(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};
515
-q.subject.attributes=p.RDNAttributesAsArray(h.certSubject,f);h.certSubjectUniqueId&&(q.subject.uniqueId=h.certSubjectUniqueId);q.subject.hash=f.digest().toHex();q.extensions=h.certExtensions?p.certificateExtensionsFromAsn1(h.certExtensions):[];q.publicKey=p.publicKeyFromAsn1(h.subjectPublicKeyInfo);return q};p.certificateExtensionsFromAsn1=function(a){for(var c=[],b=0;b<a.value.length;++b)for(var d=a.value[b],e=0;e<d.value.length;++e)c.push(p.certificateExtensionFromAsn1(d.value[e]));return c};p.certificateExtensionFromAsn1=
516
-function(a){var b={};b.id=g.derToOid(a.value[0].value);b.critical=!1;a.value[1].type===g.Type.BOOLEAN?(b.critical=0!==a.value[1].value.charCodeAt(0),b.value=a.value[2].value):b.value=a.value[1].value;if(b.id in n)if(b.name=n[b.id],"keyUsage"===b.name){a=g.fromDer(b.value);var d=0,e=0;1<a.value.length&&(d=a.value.charCodeAt(1),e=2<a.value.length?a.value.charCodeAt(2):0);b.digitalSignature=128===(d&128);b.nonRepudiation=64===(d&64);b.keyEncipherment=32===(d&32);b.dataEncipherment=16===(d&16);b.keyAgreement=
517
-8===(d&8);b.keyCertSign=4===(d&4);b.cRLSign=2===(d&2);b.encipherOnly=1===(d&1);b.decipherOnly=128===(e&128)}else if("basicConstraints"===b.name)a=g.fromDer(b.value),b.cA=0<a.value.length&&a.value[0].type===g.Type.BOOLEAN?0!==a.value[0].value.charCodeAt(0):!1,d=null,0<a.value.length&&a.value[0].type===g.Type.INTEGER?d=a.value[0].value:1<a.value.length&&(d=a.value[1].value),null!==d&&(b.pathLenConstraint=g.derToInteger(d));else if("extKeyUsage"===b.name)for(a=g.fromDer(b.value),d=0;d<a.value.length;++d)e=
518
-g.derToOid(a.value[d].value),e in n?b[n[e]]=!0:b[e]=!0;else if("nsCertType"===b.name)a=g.fromDer(b.value),d=0,1<a.value.length&&(d=a.value.charCodeAt(1)),b.client=128===(d&128),b.server=64===(d&64),b.email=32===(d&32),b.objsign=16===(d&16),b.reserved=8===(d&8),b.sslCA=4===(d&4),b.emailCA=2===(d&2),b.objCA=1===(d&1);else if("subjectAltName"===b.name||"issuerAltName"===b.name)for(b.altNames=[],a=g.fromDer(b.value),e=0;e<a.value.length;++e){var d=a.value[e],h={type:d.type,value:d.value};b.altNames.push(h);
519
-switch(d.type){case 7:h.ip=c.util.bytesToIP(d.value);break;case 8:h.oid=g.derToOid(d.value)}}else"subjectKeyIdentifier"===b.name&&(a=g.fromDer(b.value),b.subjectKeyIdentifier=c.util.bytesToHex(a.value));return b};p.certificationRequestFromAsn1=function(a,d){var h={},f=[];if(!g.validate(a,A,h,f))throw h=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."),h.errors=f,h;if("string"!==typeof h.csrSignature){for(var f="\x00",m=0;m<h.csrSignature.length;++m)f+=
520
-g.toDer(h.csrSignature[m]).getBytes();h.csrSignature=f}f=g.derToOid(h.publicKeyOid);if(f!==p.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var q=p.createCertificationRequest();q.version=h.csrVersion?h.csrVersion.charCodeAt(0):0;q.signatureOid=c.asn1.derToOid(h.csrSignatureOid);q.signatureParameters=L(q.signatureOid,h.csrSignatureParams,!0);q.siginfo.algorithmOid=c.asn1.derToOid(h.csrSignatureOid);q.siginfo.parameters=L(q.siginfo.algorithmOid,h.csrSignatureParams,!1);f=
521
-c.util.createBuffer(h.csrSignature);++f.read;q.signature=f.getBytes();q.certificationRequestInfo=h.certificationRequestInfo;if(d){q.md=null;if(q.signatureOid in n)switch(f=n[q.signatureOid],f){case "sha1WithRSAEncryption":q.md=c.md.sha1.create();break;case "md5WithRSAEncryption":q.md=c.md.md5.create();break;case "sha256WithRSAEncryption":q.md=c.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=c.md.sha512.create();break;case "RSASSA-PSS":q.md=c.md.sha256.create()}if(null===q.md)throw h=
522
-Error("Could not compute certification request digest. Unknown signature OID."),h.signatureOid=q.signatureOid,h;f=g.toDer(q.certificationRequestInfo);q.md.update(f.getBytes())}f=c.md.sha1.create();q.subject.getField=function(a){return b(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};q.subject.attributes=p.RDNAttributesAsArray(h.certificationRequestInfoSubject,f);q.subject.hash=f.digest().toHex();q.publicKey=p.publicKeyFromAsn1(h.subjectPublicKeyInfo);q.getAttribute=
523
-function(a){return b(q,a)};q.addAttribute=function(a){e([a]);q.attributes.push(a)};q.attributes=p.CRIAttributesAsArray(h.certificationRequestInfoAttributes||[]);return q};p.createCertificationRequest=function(){var a={version:0,signatureOid:null,signature:null,siginfo:{}};a.siginfo.algorithmOid=null;a.subject={};a.subject.getField=function(c){return b(a.subject,c)};a.subject.addField=function(c){e([c]);a.subject.attributes.push(c)};a.subject.attributes=[];a.subject.hash=null;a.publicKey=null;a.attributes=
524
-[];a.getAttribute=function(c){return b(a,c)};a.addAttribute=function(c){e([c]);a.attributes.push(c)};a.md=null;a.setSubject=function(c){e(c);a.subject.attributes=c;a.subject.hash=null};a.setAttributes=function(c){e(c);a.attributes=c};a.sign=function(b,d){a.md=d||c.md.sha1.create();var e=n[a.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certification request digest. Unknown message digest algorithm OID."),e.algorithm=a.md.algorithm,e;a.signatureOid=a.siginfo.algorithmOid=
525
-e;a.certificationRequestInfo=p.getCertificationRequestInfo(a);e=g.toDer(a.certificationRequestInfo);a.md.update(e.getBytes());a.signature=b.sign(a.md)};a.verify=function(){var b=!1,d=a.md;if(null===d){if(a.signatureOid in n)switch(n[a.signatureOid]){case "sha1WithRSAEncryption":d=c.md.sha1.create();break;case "md5WithRSAEncryption":d=c.md.md5.create();break;case "sha256WithRSAEncryption":d=c.md.sha256.create();break;case "sha512WithRSAEncryption":d=c.md.sha512.create();break;case "RSASSA-PSS":d=c.md.sha256.create()}if(null===
526
-d)throw d=Error("Could not compute certification request digest. Unknown signature OID."),d.signatureOid=a.signatureOid,d;var e=a.certificationRequestInfo||p.getCertificationRequestInfo(a),e=g.toDer(e);d.update(e.getBytes())}if(null!==d){var h;switch(a.signatureOid){case n["RSASSA-PSS"]:b=n[a.signatureParameters.mgf.hash.algorithmOid];if(void 0===b||void 0===c.md[b])throw d=Error("Unsupported MGF hash function."),d.oid=a.signatureParameters.mgf.hash.algorithmOid,d.name=b,d;h=n[a.signatureParameters.mgf.algorithmOid];
527
-if(void 0===h||void 0===c.mgf[h])throw d=Error("Unsupported MGF function."),d.oid=a.signatureParameters.mgf.algorithmOid,d.name=h,d;h=c.mgf[h].create(c.md[b].create());b=n[a.signatureParameters.hash.algorithmOid];if(void 0===b||void 0===c.md[b])throw d=Error("Unsupported RSASSA-PSS hash function."),d.oid=a.signatureParameters.hash.algorithmOid,d.name=b,d;h=c.pss.create(c.md[b].create(),h,a.signatureParameters.saltLength)}b=a.publicKey.verify(d.digest().getBytes(),a.signature,h)}return b};return a};
528
-p.getTBSCertificate=function(a){var b=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(a.version).getBytes())]),g.create(g.Class.UNIVERSAL,g.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber)),g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.siginfo.algorithmOid).getBytes()),m(a.siginfo.algorithmOid,a.siginfo.parameters)]),d(a.issuer),g.create(g.Class.UNIVERSAL,
529
-g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(a.validity.notBefore)),g.create(g.Class.UNIVERSAL,g.Type.UTCTIME,!1,g.dateToUtcTime(a.validity.notAfter))]),d(a.subject),p.publicKeyToAsn1(a.publicKey)]);a.issuer.uniqueId&&b.value.push(g.create(g.Class.CONTEXT_SPECIFIC,1,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.issuer.uniqueId)]));a.subject.uniqueId&&b.value.push(g.create(g.Class.CONTEXT_SPECIFIC,2,!0,[g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,
530
-!1,String.fromCharCode(0)+a.subject.uniqueId)]));0<a.extensions.length&&b.value.push(p.certificateExtensionsToAsn1(a.extensions));return b};p.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),p.publicKeyToAsn1(a.publicKey),h(a)])};p.distinguishedNameToAsn1=function(a){return d(a)};p.certificateToAsn1=function(a){var c=a.tbsCertificate||p.getTBSCertificate(a);
531
-return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[c,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),m(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};p.certificateExtensionsToAsn1=function(a){var c=g.create(g.Class.CONTEXT_SPECIFIC,3,!0,[]),b=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);c.value.push(b);for(var d=0;d<a.length;++d)b.value.push(p.certificateExtensionToAsn1(a[d]));
532
-return c};p.certificateExtensionToAsn1=function(a){var c=g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[]);c.value.push(g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.id).getBytes()));a.critical&&c.value.push(g.create(g.Class.UNIVERSAL,g.Type.BOOLEAN,!1,String.fromCharCode(255)));var b=a.value;"string"!==typeof a.value&&(b=g.toDer(b).getBytes());c.value.push(g.create(g.Class.UNIVERSAL,g.Type.OCTETSTRING,!1,b));return c};p.certificationRequestToAsn1=function(a){var c=a.certificationRequestInfo||
533
-p.getCertificationRequestInfo(a);return g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[c,g.create(g.Class.UNIVERSAL,g.Type.SEQUENCE,!0,[g.create(g.Class.UNIVERSAL,g.Type.OID,!1,g.oidToDer(a.signatureOid).getBytes()),m(a.signatureOid,a.signatureParameters)]),g.create(g.Class.UNIVERSAL,g.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};p.createCaStore=function(a){function b(a){if(!a.hash){var h=c.md.sha1.create();a.attributes=p.RDNAttributesAsArray(d(a),h);a.hash=h.digest().toHex()}return e.certs[a.hash]||
534
-null}var e={certs:{},getIssuer:function(a){return b(a.issuer)},addCertificate:function(a){"string"===typeof a&&(a=c.pki.certificateFromPem(a));if(!a.subject.hash){var b=c.md.sha1.create();a.subject.attributes=p.RDNAttributesAsArray(d(a.subject),b);a.subject.hash=b.digest().toHex()}a.subject.hash in e.certs?(b=e.certs[a.subject.hash],c.util.isArray(b)||(b=[b]),b.push(a)):e.certs[a.subject.hash]=a},hasCertificate:function(a){var d=b(a.subject);if(!d)return!1;c.util.isArray(d)||(d=[d]);a=g.toDer(p.certificateToAsn1(a)).getBytes();
535
-for(var e=0;e<d.length;++e){var h=g.toDer(p.certificateToAsn1(d[e])).getBytes();if(a===h)return!0}return!1}};if(a)for(var h=0;h<a.length;++h)e.addCertificate(a[h]);return e};p.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"};
536
-p.verifyCertificateChain=function(a,b,d){b=b.slice(0);var e=b.slice(0),h=new Date,g=!0,f=null,k=0;do{var n=b.shift(),m=null,u=!1;if(h<n.validity.notBefore||h>n.validity.notAfter)f={message:"Certificate is not valid yet or has expired.",error:p.certificateError.certificate_expired,notBefore:n.validity.notBefore,notAfter:n.validity.notAfter,now:h};if(null===f){m=b[0]||a.getIssuer(n);null===m&&n.isIssuer(n)&&(u=!0,m=n);if(m){var v=m;c.util.isArray(v)||(v=[v]);for(var r=!1;!r&&0<v.length;){m=v.shift();
537
-try{r=m.verify(n)}catch(w){}}r||(f={message:"Certificate signature is invalid.",error:p.certificateError.bad_certificate})}null!==f||m&&!u||a.hasCertificate(n)||(f={message:"Certificate is not trusted.",error:p.certificateError.unknown_ca})}null===f&&m&&!n.isIssuer(m)&&(f={message:"Certificate issuer is invalid.",error:p.certificateError.bad_certificate});if(null===f)for(v={keyUsage:!0,basicConstraints:!0},r=0;null===f&&r<n.extensions.length;++r){var y=n.extensions[r];!y.critical||y.name in v||(f=
538
-{message:"Certificate has an unsupported critical extension.",error:p.certificateError.unsupported_certificate})}null!==f||g&&(0!==b.length||m&&!u)||(g=n.getExtension("basicConstraints"),n=n.getExtension("keyUsage"),null!==n&&(n.keyCertSign&&null!==g||(f={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:p.certificateError.bad_certificate})),
539
-null!==f||null===g||g.cA||(f={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:p.certificateError.bad_certificate}),null===f&&null!==n&&"pathLenConstraint"in g&&k-1>g.pathLenConstraint&&(f={message:"Certificate basicConstraints pathLenConstraint violated.",error:p.certificateError.bad_certificate}));n=null===f?!0:f.error;g=d?d(n,k,e):n;if(!0===g)f=null;else{!0===n&&(f={message:"The application rejected the certificate.",error:p.certificateError.bad_certificate});
540
-if(g||0===g)"object"!==typeof g||c.util.isArray(g)?"string"===typeof g&&(f.error=g):(g.message&&(f.message=g.message),g.error&&(f.error=g.error));throw f;}g=!1;++k}while(0<b.length);return!0}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.x509)return b.x509;
541
-b.defined.x509=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pki}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/x509","require module ./aes ./asn1 ./des ./md ./mgf ./oids ./pem ./pss ./rsa ./util".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d,e){for(var g=
542
-[],h=0;h<a.length;h++)for(var f=0;f<a[h].safeBags.length;f++){var l=a[h].safeBags[f];if(void 0===e||l.type===e)null===c?g.push(l):void 0!==l.attributes[c]&&0<=l.attributes[c].indexOf(d)&&g.push(l)}return g}function d(a){if(a.composed||a.constructed){for(var b=c.util.createBuffer(),e=0;e<a.value.length;++e)b.putBytes(a.value[e].value);a.composed=a.constructed=!1;a.value=b.getBytes()}return a}function e(a,b,e,k){b=h.fromDer(b,e);if(b.tagClass!==h.Class.UNIVERSAL||b.type!==h.Type.SEQUENCE||!0!==b.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");
543
-for(var m=0;m<b.value.length;m++){var p={},r=[];if(!h.validate(b.value[m],n,p,r))throw a=Error("Cannot read ContentInfo."),a.errors=r,a;var r={encrypted:!1},q=null,q=p.content.value[0];switch(h.derToOid(p.contentType)){case g.oids.data:if(q.tagClass!==h.Class.UNIVERSAL||q.type!==h.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");q=d(q).value;break;case g.oids.encryptedData:var w=k,p={},y=[];if(!h.validate(q,c.pkcs7.asn1.encryptedDataValidator,p,y))throw a=Error("Cannot read EncryptedContentInfo."),
544
-a.errors=y,a;q=h.derToOid(p.contentType);if(q!==g.oids.data)throw a=Error("PKCS#12 EncryptedContentInfo ContentType is not Data."),a.oid=q,a;q=h.derToOid(p.encAlgorithm);q=g.pbe.getCipher(q,p.encParameter,w);p=d(p.encryptedContentAsn1);p=c.util.createBuffer(p.value);q.update(p);if(!q.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");q=q.output.getBytes();r.encrypted=!0;break;default:throw a=Error("Unsupported PKCS#12 contentType."),a.contentType=h.derToOid(p.contentType),a;}r.safeBags=
545
-f(q,e,k);a.safeContents.push(r)}}function f(a,c,b){if(!c&&0===a.length)return[];a=h.fromDer(a,c);if(a.tagClass!==h.Class.UNIVERSAL||a.type!==h.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 l={},k=[];if(!h.validate(a.value[e],w,l,k))throw a=Error("Cannot read SafeBag."),a.errors=k,a;var n={type:h.derToOid(l.bagId),attributes:m(l.bagAttributes)};d.push(n);var p,u,v=l.bagValue.value[0];switch(n.type){case g.oids.pkcs8ShroudedKeyBag:if(v=
546
-g.decryptPrivateKeyInfo(v,b),null===v)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case g.oids.keyBag:try{n.key=g.privateKeyFromAsn1(v)}catch(r){n.key=null,n.asn1=v}continue;case g.oids.certBag:p=D;u=function(){if(h.derToOid(l.certId)!==g.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");a.oid=h.derToOid(l.certId);throw a;}a=h.fromDer(l.cert,c);try{n.cert=g.certificateFromAsn1(a,!0)}catch(b){n.cert=null,n.asn1=a}};break;default:throw a=
547
-Error("Unsupported PKCS#12 SafeBag type."),a.oid=n.type,a;}if(void 0!==p&&!h.validate(v,p,l,k))throw a=Error("Cannot read PKCS#12 "+p.name),a.errors=k,a;u()}return d}function m(a){var c={};if(void 0!==a)for(var b=0;b<a.length;++b){var d={},e=[];if(!h.validate(a[b],y,d,e))throw a=Error("Cannot read PKCS#12 BagAttribute."),a.errors=e,a;e=h.derToOid(d.oid);if(void 0!==g.oids[e]){c[g.oids[e]]=[];for(var f=0;f<d.values.length;++f)c[g.oids[e]].push(d.values[f].value)}}return c}var h=c.asn1,g=c.pki,p=c.pkcs12=
548
-c.pkcs12||{},n={name:"ContentInfo",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:h.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},r={name:"PFX",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,capture:"version"},
549
-n,{name:"PFX.macData",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",
550
-tagClass:h.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:h.Class.UNIVERSAL,type:h.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:h.Class.UNIVERSAL,type:h.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:h.Class.UNIVERSAL,type:h.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},w={name:"SafeBag",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,
551
-value:[{name:"SafeBag.bagId",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:h.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},y={name:"Attribute",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,
552
-capture:"oid"},{name:"Attribute.attrValues",tagClass:h.Class.UNIVERSAL,type:h.Type.SET,constructed:!0,capture:"values"}]},D={name:"CertBag",tagClass:h.Class.UNIVERSAL,type:h.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:h.Class.UNIVERSAL,type:h.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:h.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:h.Class.UNIVERSAL,type:h.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};
553
-p.pkcs12FromAsn1=function(a,f,n){"string"===typeof f?(n=f,f=!0):void 0===f&&(f=!0);var m={};if(!h.validate(a,r,m,[]))throw f=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),f.errors=f,f;var u={version:m.version.charCodeAt(0),safeContents:[],getBags:function(a){var d={},e;"localKeyId"in a?e=a.localKeyId:"localKeyIdHex"in a&&(e=c.util.hexToBytes(a.localKeyIdHex));void 0===e&&!("friendlyName"in a)&&"bagType"in a&&(d[a.bagType]=b(u.safeContents,null,null,a.bagType));void 0!==e&&
554
-(d.localKeyId=b(u.safeContents,"localKeyId",e,a.bagType));"friendlyName"in a&&(d.friendlyName=b(u.safeContents,"friendlyName",a.friendlyName,a.bagType));return d},getBagsByFriendlyName:function(a,c){return b(u.safeContents,"friendlyName",a,c)},getBagsByLocalKeyId:function(a,c){return b(u.safeContents,"localKeyId",a,c)}};if(3!==m.version.charCodeAt(0))throw f=Error("PKCS#12 PFX of version other than 3 not supported."),f.version=m.version.charCodeAt(0),f;if(h.derToOid(m.contentType)!==g.oids.data)throw f=
555
-Error("Only PKCS#12 PFX in password integrity mode supported."),f.oid=h.derToOid(m.contentType),f;a=m.content.value[0];if(a.tagClass!==h.Class.UNIVERSAL||a.type!==h.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");a=d(a);if(m.mac){var w=null,y=0,q=h.derToOid(m.macAlgorithm);switch(q){case g.oids.sha1:w=c.md.sha1.create();y=20;break;case g.oids.sha256:w=c.md.sha256.create();y=32;break;case g.oids.sha384:w=c.md.sha384.create();y=48;break;case g.oids.sha512:w=c.md.sha512.create();
556
-y=64;break;case g.oids.md5:w=c.md.md5.create(),y=16}if(null===w)throw Error("PKCS#12 uses unsupported MAC algorithm: "+q);var q=new c.util.ByteBuffer(m.macSalt),B="macIterations"in m?parseInt(c.util.bytesToHex(m.macIterations),16):1,y=p.generateKey(n,q,3,B,y,w),q=c.hmac.create();q.start(w,y);q.update(a.value);if(q.getMac().getBytes()!==m.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(u,a.value,f,n);return u};p.toPkcs12Asn1=function(a,b,d,e){e=e||{};e.saltSize=e.saltSize||
557
-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 f=e.localKeyId,k;if(null!==f)f=c.util.hexToBytes(f);else if(e.generateLocalKeyId)if(b){var n=c.util.isArray(b)?b[0]:b;"string"===typeof n&&(n=g.certificateFromPem(n));f=c.md.sha1.create();f.update(h.toDer(g.certificateToAsn1(n)).getBytes());f=f.digest().getBytes()}else f=c.random.getBytes(20);n=[];null!==
558
-f&&n.push(h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.localKeyId).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,f)])]));"friendlyName"in e&&n.push(h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.friendlyName).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SET,!0,[h.create(h.Class.UNIVERSAL,h.Type.BMPSTRING,!1,e.friendlyName)])]));
559
-0<n.length&&(k=h.create(h.Class.UNIVERSAL,h.Type.SET,!0,n));f=[];n=[];null!==b&&(n=c.util.isArray(b)?b:[b]);for(var m=[],u=0;u<n.length;++u){b=n[u];"string"===typeof b&&(b=g.certificateFromPem(b));var v=0===u?k:void 0;b=g.certificateToAsn1(b);b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.certBag).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.x509Certificate).getBytes()),
560
-h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(b).getBytes())])])]),v]);m.push(b)}0<m.length&&(b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,m),b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.data).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(b).getBytes())])]),f.push(b));b=null;null!==a&&(a=g.wrapRsaPrivateKey(g.privateKeyToAsn1(a)),
561
-b=null===d?h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.keyBag).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[a]),k]):h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.pkcs8ShroudedKeyBag).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[g.encryptPrivateKeyInfo(a,d,e)]),k]),a=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[b]),a=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,
562
-[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.data).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(a).getBytes())])]),f.push(a));k=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,f);var r;e.useMac&&(f=c.md.sha1.create(),r=new c.util.ByteBuffer(c.random.getBytes(e.saltSize)),e=e.count,a=p.generateKey(d,r,3,e,20),d=c.hmac.create(),d.start(f,a),d.update(h.toDer(k).getBytes()),d=d.getMac(),r=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,
563
-!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.sha1).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.NULL,!1,"")]),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,d.getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,r.getBytes()),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(e).getBytes())]));return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,
564
-h.Type.INTEGER,!1,h.integerToDer(3).getBytes()),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(g.oids.data).getBytes()),h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,h.toDer(k).getBytes())])]),r])};p.generateKey=c.pbe.generatePkcs12Key}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,
565
-p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs12)return b.pkcs12;b.defined.pkcs12=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pkcs12}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs12","require module ./asn1 ./hmac ./oids ./pkcs7asn1 ./pbe ./random ./rsa ./sha1 ./util ./x509".split(" "),
566
-function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1,d=c.pki=c.pki||{};d.pemToDer=function(a){a=c.pem.decode(a)[0];if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return c.util.createBuffer(a.body)};d.privateKeyFromPem=function(a){a=c.pem.decode(a)[0];if("PRIVATE KEY"!==a.type&&"RSA PRIVATE KEY"!==a.type){var f=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');
567
-f.headerType=a.type;throw f;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert private key from PEM; PEM is encrypted.");a=b.fromDer(a.body);return d.privateKeyFromAsn1(a)};d.privateKeyToPem=function(a,f){var m={type:"RSA PRIVATE KEY",body:b.toDer(d.privateKeyToAsn1(a)).getBytes()};return c.pem.encode(m,{maxline:f})};d.privateKeyInfoToPem=function(a,d){var f={type:"PRIVATE KEY",body:b.toDer(a).getBytes()};return c.pem.encode(f,{maxline:d})}}if("function"!==typeof c)if("object"===
568
-typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pki)return b.pki;b.defined.pki=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pki}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,
569
-Array.prototype.slice.call(arguments,0))};c("js/pki","require module ./asn1 ./oids ./pbe ./pem ./pbkdf2 ./pkcs12 ./pss ./rsa ./util ./x509".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=function(a,b,d,e){var g=c.util.createBuffer(),h=a.length>>1,f=h+(a.length&1),k=a.substr(0,f),f=a.substr(h,f);a=c.util.createBuffer();h=c.hmac.create();d=b+d;var n=Math.ceil(e/16);b=Math.ceil(e/20);h.start("MD5",k);k=c.util.createBuffer();a.putBytes(d);
570
-for(var m=0;m<n;++m)h.start(null,null),h.update(a.getBytes()),a.putBuffer(h.digest()),h.start(null,null),h.update(a.bytes()+d),k.putBuffer(h.digest());h.start("SHA1",f);f=c.util.createBuffer();a.clear();a.putBytes(d);for(m=0;m<b;++m)h.start(null,null),h.update(a.getBytes()),a.putBuffer(h.digest()),h.start(null,null),h.update(a.bytes()+d),f.putBuffer(h.digest());g.putBytes(c.util.xorBytes(k.getBytes(),f.getBytes(),e));return g},d=function(a,b,d){d=!1;try{var e=a.deflate(b.fragment.getBytes());b.fragment=
571
-c.util.createBuffer(e);b.length=e.length;d=!0}catch(h){}return d},e=function(a,b,d){d=!1;try{var e=a.inflate(b.fragment.getBytes());b.fragment=c.util.createBuffer(e);b.length=e.length;d=!0}catch(h){}return d},f=function(a,b){var d=0;switch(b){case 1:d=a.getByte();break;case 2:d=a.getInt16();break;case 3:d=a.getInt24();break;case 4:d=a.getInt32()}return c.util.createBuffer(a.getBytes(d))},m=function(a,c,b){a.putInt(b.length(),c<<3);a.putBuffer(b)},h={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,
572
-minor:2},TLS_1_2:{major:3,minor:3}}};h.SupportedVersions=[h.Versions.TLS_1_1,h.Versions.TLS_1_0];h.Version=h.SupportedVersions[0];h.MaxFragment=15360;h.ConnectionEnd={server:0,client:1};h.PRFAlgorithm={tls_prf_sha256:0};h.BulkCipherAlgorithm={none:null,rc4:0,des3:1,aes:2};h.CipherType={stream:0,block:1,aead:2};h.MACAlgorithm={none:null,hmac_md5:0,hmac_sha1:1,hmac_sha256:2,hmac_sha384:3,hmac_sha512:4};h.CompressionMethod={none:0,deflate:1};h.ContentType={change_cipher_spec:20,alert:21,handshake:22,
573
-application_data:23,heartbeat:24};h.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};h.Alert={};h.Alert.Level={warning:1,fatal:2};h.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,
574
-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};h.HeartbeatMessageType={heartbeat_request:1,heartbeat_response:2};h.CipherSuites={};h.getCipherSuite=function(a){var c=null,b;for(b in h.CipherSuites){var d=h.CipherSuites[b];if(d.id[0]===a.charCodeAt(0)&&d.id[1]===a.charCodeAt(1)){c=d;break}}return c};
575
-h.handleUnexpected=function(a,c){(a.open||a.entity!==h.ConnectionEnd.client)&&a.error(a,{message:"Unexpected message. Received TLS record out of order.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.unexpected_message}})};h.handleHelloRequest=function(a,c,b){!a.handshaking&&0<a.handshakes&&(h.queue(a,h.createAlert(a,{level:h.Alert.Level.warning,description:h.Alert.Description.no_renegotiation})),h.flush(a));a.process()};h.parseHelloMessage=function(a,b,d){var e=null,g=a.entity===
576
-h.ConnectionEnd.client;if(38>d)a.error(a,{message:g?"Invalid ServerHello message. Message too short.":"Invalid ClientHello message. Message too short.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.illegal_parameter}});else{b=b.fragment;var k=b.length(),e={version:{major:b.getByte(),minor:b.getByte()},random:c.util.createBuffer(b.getBytes(32)),session_id:f(b,1),extensions:[]};g?(e.cipher_suite=b.getBytes(2),e.compression_method=b.getByte()):(e.cipher_suites=f(b,2),e.compression_methods=
577
-f(b,1));k=d-(k-b.length());if(0<k){for(d=f(b,2);0<d.length();)e.extensions.push({type:[d.getByte(),d.getByte()],data:f(d,2)});if(!g)for(d=0;d<e.extensions.length;++d)if(b=e.extensions[d],0===b.type[0]&&0===b.type[1])for(b=f(b.data,2);0<b.length()&&0===b.getByte();)a.session.extensions.server_name.serverNameList.push(f(b,2).getBytes())}if(a.session.version&&(e.version.major!==a.session.version.major||e.version.minor!==a.session.version.minor))return a.error(a,{message:"TLS version change is disallowed during renegotiation.",
578
-send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.protocol_version}});if(g)a.session.cipherSuite=h.getCipherSuite(e.cipher_suite);else for(d=c.util.createBuffer(e.cipher_suites.bytes());0<d.length()&&(a.session.cipherSuite=h.getCipherSuite(d.getBytes(2)),null===a.session.cipherSuite););if(null===a.session.cipherSuite)return a.error(a,{message:"No cipher suites in common.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.handshake_failure},cipherSuite:c.util.bytesToHex(e.cipher_suite)});
579
-a.session.compressionMethod=g?e.compression_method:h.CompressionMethod.none}return e};h.createSecurityParameters=function(a,c){var b=a.entity===h.ConnectionEnd.client,d=c.random.bytes(),e=b?a.session.sp.client_random:d,b=b?d:h.createRandom().getBytes();a.session.sp={entity:a.entity,prf_algorithm:h.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,
580
-compression_algorithm:a.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:e,server_random:b}};h.handleServerHello=function(a,c,b){c=h.parseHelloMessage(a,c,b);if(!a.fail){if(c.version.minor<=a.version.minor)a.version.minor=c.version.minor;else return a.error(a,{message:"Incompatible TLS version.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.protocol_version}});a.session.version=a.version;b=c.session_id.bytes();0<b.length&&b===a.session.id?
581
-(a.expect=w,a.session.resuming=!0,a.session.sp.server_random=c.random.bytes()):(a.expect=g,a.session.resuming=!1,h.createSecurityParameters(a,c));a.session.id=b;a.process()}};h.handleClientHello=function(a,b,d){b=h.parseHelloMessage(a,b,d);if(!a.fail){var e=b.session_id.bytes();d=null;if(a.sessionCache)if(d=a.sessionCache.getSession(e),null===d)e="";else if(d.version.major!==b.version.major||d.version.minor>b.version.minor)d=null,e="";0===e.length&&(e=c.random.getBytes(32));a.session.id=e;a.session.clientHelloVersion=
582
-b.version;a.session.sp={};if(d)a.version=a.session.version=d.version,a.session.sp=d.sp;else{for(var g,e=1;e<h.SupportedVersions.length&&!(g=h.SupportedVersions[e],g.minor<=b.version.minor);++e);a.version={major:g.major,minor:g.minor};a.session.version=a.version}null!==d?(a.expect=x,a.session.resuming=!0,a.session.sp.client_random=b.random.bytes()):(a.expect=!1!==a.verifyClient?L:z,a.session.resuming=!1,h.createSecurityParameters(a,b));a.open=!0;h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,
583
-data:h.createServerHello(a)}));a.session.resuming?(h.queue(a,h.createRecord(a,{type:h.ContentType.change_cipher_spec,data:h.createChangeCipherSpec()})),a.state.pending=h.createConnectionState(a),a.state.current.write=a.state.pending.write,h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createFinished(a)}))):(h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createCertificate(a)})),a.fail||(h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createServerKeyExchange(a)})),
584
-!1!==a.verifyClient&&h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createCertificateRequest(a)})),h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createServerHelloDone(a)}))));h.flush(a);a.process()}};h.handleCertificate=function(a,b,d){if(3>d)return a.error(a,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.illegal_parameter}});d=f(b.fragment,3);var e,g;b=[];try{for(;0<d.length();)e=
585
-f(d,3),g=c.asn1.fromDer(e),e=c.pki.certificateFromAsn1(g,!0),b.push(e)}catch(k){return a.error(a,{message:"Could not parse certificate list.",cause:k,send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.bad_certificate}})}e=a.entity===h.ConnectionEnd.client;!e&&!0!==a.verifyClient||0!==b.length?0===b.length?a.expect=e?p:z:(e?a.session.serverCertificate=b[0]:a.session.clientCertificate=b[0],h.verifyCertificateChain(a,b)&&(a.expect=e?p:z)):a.error(a,{message:e?"No server certificate provided.":
586
-"No client certificate provided.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.illegal_parameter}});a.process()};h.handleServerKeyExchange=function(a,c,b){if(0<b)return a.error(a,{message:"Invalid key parameters. Only RSA is supported.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.unsupported_certificate}});a.expect=n;a.process()};h.handleClientKeyExchange=function(a,b,d){if(48>d)return a.error(a,{message:"Invalid key parameters. Only RSA is supported.",
587
-send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.unsupported_certificate}});b=f(b.fragment,2).getBytes();d=null;if(a.getPrivateKey)try{d=a.getPrivateKey(a,a.session.serverCertificate),d=c.pki.privateKeyFromPem(d)}catch(e){a.error(a,{message:"Could not get private key.",cause:e,send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}})}if(null===d)return a.error(a,{message:"No private key set.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}});
588
-try{var g=a.session.sp;g.pre_master_secret=d.decrypt(b);var k=a.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=c.random.getBytes(48)}a.expect=x;null!==a.session.clientCertificate&&(a.expect=C);a.process()};h.handleCertificateRequest=function(a,c,b){if(3>b)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:h.Alert.Level.fatal,
589
-description:h.Alert.Description.illegal_parameter}});c=c.fragment;c={certificate_types:f(c,1),certificate_authorities:f(c,2)};a.session.certificateRequest=c;a.expect=r;a.process()};h.handleCertificateVerify=function(a,b,d){if(2>d)return a.error(a,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.illegal_parameter}});d=b.fragment;d.read-=4;b=d.bytes();d.read+=4;d=f(d,2).getBytes();var e=c.util.createBuffer();e.putBuffer(a.session.md5.digest());
590
-e.putBuffer(a.session.sha1.digest());e=e.getBytes();try{if(!a.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");a.session.md5.update(b);a.session.sha1.update(b)}catch(g){return a.error(a,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.handshake_failure}})}a.expect=x;a.process()};h.handleServerHelloDone=function(a,b,d){if(0<d)return a.error(a,{message:"Invalid ServerHelloDone message. Invalid length.",
591
-send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.record_overflow}});if(null===a.serverCertificate&&(b={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.insufficient_security}},d=a.verify(a,b.alert.description,0,[]),!0!==d)){if(d||0===d)"object"!==typeof d||c.util.isArray(d)?"number"===typeof d&&(b.alert.description=d):(d.message&&(b.message=d.message),d.alert&&(b.alert.description=d.alert));
592
-return a.error(a,b)}null!==a.session.certificateRequest&&(b=h.createRecord(a,{type:h.ContentType.handshake,data:h.createCertificate(a)}),h.queue(a,b));b=h.createRecord(a,{type:h.ContentType.handshake,data:h.createClientKeyExchange(a)});h.queue(a,b);a.expect=A;b=function(a,c){null!==a.session.certificateRequest&&null!==a.session.clientCertificate&&h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createCertificateVerify(a,c)}));h.queue(a,h.createRecord(a,{type:h.ContentType.change_cipher_spec,
593
-data:h.createChangeCipherSpec()}));a.state.pending=h.createConnectionState(a);a.state.current.write=a.state.pending.write;h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createFinished(a)}));a.expect=w;h.flush(a);a.process()};if(null===a.session.certificateRequest||null===a.session.clientCertificate)return b(a,null);h.getClientSignature(a,b)};h.handleChangeCipherSpec=function(a,c){if(1!==c.fragment.getByte())return a.error(a,{message:"Invalid ChangeCipherSpec message received.",send:!0,
594
-alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.illegal_parameter}});var b=a.entity===h.ConnectionEnd.client;if(a.session.resuming&&b||!a.session.resuming&&!b)a.state.pending=h.createConnectionState(a);a.state.current.read=a.state.pending.read;if(!a.session.resuming&&b||a.session.resuming&&!b)a.state.pending=null;a.expect=b?y:I;a.process()};h.handleFinished=function(a,d,e){e=d.fragment;e.read-=4;var g=e.bytes();e.read+=4;d=d.fragment.getBytes();e=c.util.createBuffer();e.putBuffer(a.session.md5.digest());
595
-e.putBuffer(a.session.sha1.digest());var f=a.entity===h.ConnectionEnd.client;e=b(a.session.sp.master_secret,f?"server finished":"client finished",e.getBytes(),12);if(e.getBytes()!==d)return a.error(a,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.decrypt_error}});a.session.md5.update(g);a.session.sha1.update(g);if(a.session.resuming&&f||!a.session.resuming&&!f)h.queue(a,h.createRecord(a,{type:h.ContentType.change_cipher_spec,
596
-data:h.createChangeCipherSpec()})),a.state.current.write=a.state.pending.write,a.state.pending=null,h.queue(a,h.createRecord(a,{type:h.ContentType.handshake,data:h.createFinished(a)}));a.expect=f?D:X;a.handshaking=!1;++a.handshakes;a.peerCertificate=f?a.session.serverCertificate:a.session.clientCertificate;h.flush(a);a.isConnected=!0;a.connected(a);a.process()};h.handleAlert=function(a,c){var b=c.fragment,b={level:b.getByte(),description:b.getByte()},d;switch(b.description){case h.Alert.Description.close_notify:d=
597
-"Connection closed.";break;case h.Alert.Description.unexpected_message:d="Unexpected message.";break;case h.Alert.Description.bad_record_mac:d="Bad record MAC.";break;case h.Alert.Description.decryption_failed:d="Decryption failed.";break;case h.Alert.Description.record_overflow:d="Record overflow.";break;case h.Alert.Description.decompression_failure:d="Decompression failed.";break;case h.Alert.Description.handshake_failure:d="Handshake failure.";break;case h.Alert.Description.bad_certificate:d=
598
-"Bad certificate.";break;case h.Alert.Description.unsupported_certificate:d="Unsupported certificate.";break;case h.Alert.Description.certificate_revoked:d="Certificate revoked.";break;case h.Alert.Description.certificate_expired:d="Certificate expired.";break;case h.Alert.Description.certificate_unknown:d="Certificate unknown.";break;case h.Alert.Description.illegal_parameter:d="Illegal parameter.";break;case h.Alert.Description.unknown_ca:d="Unknown certificate authority.";break;case h.Alert.Description.access_denied:d=
599
-"Access denied.";break;case h.Alert.Description.decode_error:d="Decode error.";break;case h.Alert.Description.decrypt_error:d="Decrypt error.";break;case h.Alert.Description.export_restriction:d="Export restriction.";break;case h.Alert.Description.protocol_version:d="Unsupported protocol version.";break;case h.Alert.Description.insufficient_security:d="Insufficient security.";break;case h.Alert.Description.internal_error:d="Internal error.";break;case h.Alert.Description.user_canceled:d="User canceled.";
600
-break;case h.Alert.Description.no_renegotiation:d="Renegotiation not supported.";break;default:d="Unknown error."}if(b.description===h.Alert.Description.close_notify)return a.close();a.error(a,{message:d,send:!1,origin:a.entity===h.ConnectionEnd.client?"server":"client",alert:b});a.process()};h.handleHandshake=function(a,b){var d=b.fragment,e=d.getByte(),g=d.getInt24();if(g>d.length())return a.fragmented=b,b.fragment=c.util.createBuffer(),d.read-=4,a.process();a.fragmented=null;d.read-=4;var f=d.bytes(g+
601
-4);d.read+=4;e in T[a.entity][a.expect]?(a.entity!==h.ConnectionEnd.server||a.open||a.fail||(a.handshaking=!0,a.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:c.md.md5.create(),sha1:c.md.sha1.create()}),e!==h.HandshakeType.hello_request&&e!==h.HandshakeType.certificate_verify&&e!==h.HandshakeType.finished&&(a.session.md5.update(f),a.session.sha1.update(f)),T[a.entity][a.expect][e](a,b,g)):
602
-h.handleUnexpected(a,b)};h.handleApplicationData=function(a,c){a.data.putBuffer(c.fragment);a.dataReady(a);a.process()};h.handleHeartbeat=function(a,b){var d=b.fragment,e=d.getByte(),g=d.getInt16(),d=d.getBytes(g);if(e===h.HeartbeatMessageType.heartbeat_request){if(a.handshaking||g>d.length)return a.process();h.queue(a,h.createRecord(a,{type:h.ContentType.heartbeat,data:h.createHeartbeat(h.HeartbeatMessageType.heartbeat_response,d)}));h.flush(a)}else if(e===h.HeartbeatMessageType.heartbeat_response){if(d!==
603
-a.expectedHeartbeatPayload)return a.process();a.heartbeatReceived&&a.heartbeatReceived(a,c.util.createBuffer(d))}a.process()};var g=1,p=2,n=3,r=4,w=5,y=6,D=7,A=8,L=1,z=2,C=3,x=4,I=5,X=6,q=h.handleUnexpected,O=h.handleChangeCipherSpec,M=h.handleAlert,J=h.handleHandshake,S=h.handleApplicationData,K=h.handleHeartbeat,W=[];W[h.ConnectionEnd.client]=[[q,M,J,q,K],[q,M,J,q,K],[q,M,J,q,K],[q,M,J,q,K],[q,M,J,q,K],[O,M,q,q,K],[q,M,J,q,K],[q,M,J,S,K],[q,M,J,q,K]];W[h.ConnectionEnd.server]=[[q,M,J,q,K],[q,M,
604
-J,q,K],[q,M,J,q,K],[q,M,J,q,K],[O,M,q,q,K],[q,M,J,q,K],[q,M,J,S,K],[q,M,J,q,K]];var O=h.handleHelloRequest,M=h.handleCertificate,J=h.handleServerKeyExchange,S=h.handleCertificateRequest,K=h.handleServerHelloDone,U=h.handleFinished,T=[];T[h.ConnectionEnd.client]=[[q,q,h.handleServerHello,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,M,J,S,K,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,q,J,S,K,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,q,q,S,K,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,q,q,q,K,q,q,q,q,q,q],
605
-[O,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,U],[O,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[O,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];T[h.ConnectionEnd.server]=[[q,h.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,M,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,h.handleClientKeyExchange,q,q,q,q],[q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,h.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,q,q,q,
606
-q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,U],[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]];h.generateKeys=function(a,c){var d=c.client_random+c.server_random;a.session.resuming||(c.master_secret=b(c.pre_master_secret,"master secret",d,48).bytes(),c.pre_master_secret=null);var d=c.server_random+c.client_random,e=2*c.mac_key_length+2*c.enc_key_length,g=a.version.major===h.Versions.TLS_1_0.major&&a.version.minor===h.Versions.TLS_1_0.minor;g&&(e+=2*c.fixed_iv_length);d=
607
-b(c.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(c.mac_key_length),server_write_MAC_key:d.getBytes(c.mac_key_length),client_write_key:d.getBytes(c.enc_key_length),server_write_key:d.getBytes(c.enc_key_length)};g&&(e.client_write_IV=d.getBytes(c.fixed_iv_length),e.server_write_IV=d.getBytes(c.fixed_iv_length));return e};h.createConnectionState=function(a){var c=a.entity===h.ConnectionEnd.client,b=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,
608
-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:b(),write:b()};g.read.update=function(a,c){g.read.cipherFunction(c,g.read)?g.read.compressFunction(a,c,g.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.decompression_failure}}):
609
-a.error(a,{message:"Could not decrypt record or bad MAC.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.bad_record_mac}});return!a.fail};g.write.update=function(a,c){g.write.compressFunction(a,c,g.write)?g.write.cipherFunction(c,g.write)||a.error(a,{message:"Could not encrypt record.",send:!1,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}}):a.error(a,{message:"Could not compress record.",send:!1,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}});
610
-return!a.fail};if(a.session)switch(b=a.session.sp,a.session.cipherSuite.initSecurityParameters(b),b.keys=h.generateKeys(a,b),g.read.macKey=c?b.keys.server_write_MAC_key:b.keys.client_write_MAC_key,g.write.macKey=c?b.keys.client_write_MAC_key:b.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(g,a,b),b.compression_algorithm){case h.CompressionMethod.none:break;case h.CompressionMethod.deflate:g.read.compressFunction=e;g.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm.");
611
-}return g};h.createRandom=function(){var a=new Date,a=+a+6E4*a.getTimezoneOffset(),b=c.util.createBuffer();b.putInt32(a);b.putBytes(c.random.getBytes(28));return b};h.createRecord=function(a,c){return c.data?{type:c.type,version:{major:a.version.major,minor:a.version.minor},length:c.data.length(),fragment:c.data}:null};h.createAlert=function(a,b){var d=c.util.createBuffer();d.putByte(b.level);d.putByte(b.description);return h.createRecord(a,{type:h.ContentType.alert,data:d})};h.createClientHello=
612
-function(a){a.session.clientHelloVersion={major:a.version.major,minor:a.version.minor};for(var b=c.util.createBuffer(),d=0;d<a.cipherSuites.length;++d){var e=a.cipherSuites[d];b.putByte(e.id[0]);b.putByte(e.id[1])}var g=b.length(),d=c.util.createBuffer();d.putByte(h.CompressionMethod.none);var f=d.length(),e=c.util.createBuffer();if(a.virtualHost){var k=c.util.createBuffer();k.putByte(0);k.putByte(0);var n=c.util.createBuffer();n.putByte(0);m(n,2,c.util.createBuffer(a.virtualHost));var p=c.util.createBuffer();
613
-m(p,2,n);m(k,2,p);e.putBuffer(k)}k=e.length();0<k&&(k+=2);n=a.session.id;g=n.length+1+2+4+28+2+g+1+f+k;f=c.util.createBuffer();f.putByte(h.HandshakeType.client_hello);f.putInt24(g);f.putByte(a.version.major);f.putByte(a.version.minor);f.putBytes(a.session.sp.client_random);m(f,1,c.util.createBuffer(n));m(f,2,b);m(f,1,d);0<k&&m(f,2,e);return f};h.createServerHello=function(a){var b=a.session.id,d=b.length+1+2+4+28+2+1,e=c.util.createBuffer();e.putByte(h.HandshakeType.server_hello);e.putInt24(d);e.putByte(a.version.major);
614
-e.putByte(a.version.minor);e.putBytes(a.session.sp.server_random);m(e,1,c.util.createBuffer(b));e.putByte(a.session.cipherSuite.id[0]);e.putByte(a.session.cipherSuite.id[1]);e.putByte(a.session.compressionMethod);return e};h.createCertificate=function(a){var b=a.entity===h.ConnectionEnd.client,d=null;a.getCertificate&&(d=a.getCertificate(a,b?a.session.certificateRequest:a.session.extensions.server_name.serverNameList));var e=c.util.createBuffer();if(null!==d)try{c.util.isArray(d)||(d=[d]);for(var g=
615
-null,f=0;f<d.length;++f){var k=c.pem.decode(d[f])[0];if("CERTIFICATE"!==k.type&&"X509 CERTIFICATE"!==k.type&&"TRUSTED CERTIFICATE"!==k.type){var n=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');n.headerType=k.type;throw n;}if(k.procType&&"ENCRYPTED"===k.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var p=c.util.createBuffer(k.body);null===g&&(g=c.asn1.fromDer(p.bytes(),!1));
616
-var q=c.util.createBuffer();m(q,3,p);e.putBuffer(q)}d=c.pki.certificateFromAsn1(g);b?a.session.clientCertificate=d:a.session.serverCertificate=d}catch(u){return a.error(a,{message:"Could not send certificate list.",cause:u,send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.bad_certificate}})}a=3+e.length();b=c.util.createBuffer();b.putByte(h.HandshakeType.certificate);b.putInt24(a);m(b,3,e);return b};h.createClientKeyExchange=function(a){var b=c.util.createBuffer();b.putByte(a.session.clientHelloVersion.major);
617
-b.putByte(a.session.clientHelloVersion.minor);b.putBytes(c.random.getBytes(46));var d=a.session.sp;d.pre_master_secret=b.getBytes();b=a.session.serverCertificate.publicKey.encrypt(d.pre_master_secret);a=b.length+2;d=c.util.createBuffer();d.putByte(h.HandshakeType.client_key_exchange);d.putInt24(a);d.putInt16(b.length);d.putBytes(b);return d};h.createServerKeyExchange=function(a){return c.util.createBuffer()};h.getClientSignature=function(a,b){var d=c.util.createBuffer();d.putBuffer(a.session.md5.digest());
618
-d.putBuffer(a.session.sha1.digest());d=d.getBytes();a.getSignature=a.getSignature||function(a,b,d){var e=null;if(a.getPrivateKey)try{e=a.getPrivateKey(a,a.session.clientCertificate),e=c.pki.privateKeyFromPem(e)}catch(g){a.error(a,{message:"Could not get private key.",cause:g,send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}})}null===e?a.error(a,{message:"No private key set.",send:!0,alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.internal_error}}):
619
-b=e.sign(b,null);d(a,b)};a.getSignature(a,d,b)};h.createCertificateVerify=function(a,b){var d=b.length+2,e=c.util.createBuffer();e.putByte(h.HandshakeType.certificate_verify);e.putInt24(d);e.putInt16(b.length);e.putBytes(b);return e};h.createCertificateRequest=function(a){var b=c.util.createBuffer();b.putByte(1);var d=c.util.createBuffer(),e;for(e in a.caStore.certs){var g=c.pki.distinguishedNameToAsn1(a.caStore.certs[e].subject);d.putBuffer(c.asn1.toDer(g))}a=1+b.length()+2+d.length();e=c.util.createBuffer();
620
-e.putByte(h.HandshakeType.certificate_request);e.putInt24(a);m(e,1,b);m(e,2,d);return e};h.createServerHelloDone=function(a){a=c.util.createBuffer();a.putByte(h.HandshakeType.server_hello_done);a.putInt24(0);return a};h.createChangeCipherSpec=function(){var a=c.util.createBuffer();a.putByte(1);return a};h.createFinished=function(a){var d=c.util.createBuffer();d.putBuffer(a.session.md5.digest());d.putBuffer(a.session.sha1.digest());d=b(a.session.sp.master_secret,a.entity===h.ConnectionEnd.client?"client finished":
621
-"server finished",d.getBytes(),12);a=c.util.createBuffer();a.putByte(h.HandshakeType.finished);a.putInt24(d.length());a.putBuffer(d);return a};h.createHeartbeat=function(a,b,d){"undefined"===typeof d&&(d=b.length);var e=c.util.createBuffer();e.putByte(a);e.putInt16(d);e.putBytes(b);a=e.length();e.putBytes(c.random.getBytes(Math.max(16,a-d-3)));return e};h.queue=function(a,b){if(b){if(b.type===h.ContentType.handshake){var d=b.fragment.bytes();a.session.md5.update(d);a.session.sha1.update(d)}if(b.fragment.length()<=
622
-h.MaxFragment)d=[b];else{for(var d=[],e=b.fragment.bytes();e.length>h.MaxFragment;)d.push(h.createRecord(a,{type:b.type,data:c.util.createBuffer(e.slice(0,h.MaxFragment))})),e=e.slice(h.MaxFragment);0<e.length&&d.push(h.createRecord(a,{type:b.type,data:c.util.createBuffer(e)}))}for(e=0;e<d.length&&!a.fail;++e){var g=d[e];a.state.current.write.update(a,g)&&a.records.push(g)}}};h.flush=function(a){for(var c=0;c<a.records.length;++c){var b=a.records[c];a.tlsData.putByte(b.type);a.tlsData.putByte(b.version.major);
623
-a.tlsData.putByte(b.version.minor);a.tlsData.putInt16(b.fragment.length());a.tlsData.putBuffer(a.records[c].fragment)}a.records=[];return a.tlsDataReady(a)};var R=function(a){switch(a){case !0:return!0;case c.pki.certificateError.bad_certificate:return h.Alert.Description.bad_certificate;case c.pki.certificateError.unsupported_certificate:return h.Alert.Description.unsupported_certificate;case c.pki.certificateError.certificate_revoked:return h.Alert.Description.certificate_revoked;case c.pki.certificateError.certificate_expired:return h.Alert.Description.certificate_expired;
624
-case c.pki.certificateError.certificate_unknown:return h.Alert.Description.certificate_unknown;case c.pki.certificateError.unknown_ca:return h.Alert.Description.unknown_ca;default:return h.Alert.Description.bad_certificate}},V=function(a){switch(a){case !0:return!0;case h.Alert.Description.bad_certificate:return c.pki.certificateError.bad_certificate;case h.Alert.Description.unsupported_certificate:return c.pki.certificateError.unsupported_certificate;case h.Alert.Description.certificate_revoked:return c.pki.certificateError.certificate_revoked;
625
-case h.Alert.Description.certificate_expired:return c.pki.certificateError.certificate_expired;case h.Alert.Description.certificate_unknown:return c.pki.certificateError.certificate_unknown;case h.Alert.Description.unknown_ca:return c.pki.certificateError.unknown_ca;default:return c.pki.certificateError.bad_certificate}};h.verifyCertificateChain=function(a,b){try{c.pki.verifyCertificateChain(a.caStore,b,function(b,d,e){R(b);d=a.verify(a,b,d,e);if(!0!==d){if("object"===typeof d&&!c.util.isArray(d))throw b=
626
-Error("The application rejected the certificate."),b.send=!0,b.alert={level:h.Alert.Level.fatal,description:h.Alert.Description.bad_certificate},d.message&&(b.message=d.message),d.alert&&(b.alert.description=d.alert),b;d!==b&&(d=V(d))}return d})}catch(d){var e=d;if("object"!==typeof e||c.util.isArray(e))e={send:!0,alert:{level:h.Alert.Level.fatal,description:R(d)}};"send"in e||(e.send=!0);"alert"in e||(e.alert={level:h.Alert.Level.fatal,description:R(e.error)});a.error(a,e)}return!a.fail};h.createSessionCache=
627
-function(a,b){var d=null;if(a&&a.getSession&&a.setSession&&a.order)d=a;else{d={};d.cache=a||{};d.capacity=Math.max(b||100,1);d.order=[];for(var e in a)d.order.length<=b?d.order.push(e):delete a[e];d.getSession=function(a){var b=null,e=null;a?e=c.util.bytesToHex(a):0<d.order.length&&(e=d.order[0]);if(null!==e&&e in d.cache){b=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 b};d.setSession=function(a,b){if(d.order.length===d.capacity){var e=d.order.shift();
628
-delete d.cache[e]}e=c.util.bytesToHex(a);d.order.push(e);d.cache[e]=b}}return d};h.createConnection=function(a){var b=null,b=a.caStore?c.util.isArray(a.caStore)?c.pki.createCaStore(a.caStore):a.caStore:c.pki.createCaStore(),d=a.cipherSuites||null;if(null===d){var d=[],e;for(e in h.CipherSuites)d.push(h.CipherSuites[e])}e=a.server?h.ConnectionEnd.server:h.ConnectionEnd.client;var g=a.sessionCache?h.createSessionCache(a.sessionCache):null,f={version:{major:h.Version.major,minor:h.Version.minor},entity:e,
629
-sessionId:a.sessionId,caStore:b,sessionCache:g,cipherSuites:d,connected:a.connected,virtualHost:a.virtualHost||null,verifyClient:a.verifyClient||!1,verify:a.verify||function(a,c,b,d){return c},getCertificate:a.getCertificate||null,getPrivateKey:a.getPrivateKey||null,getSignature:a.getSignature||null,input:c.util.createBuffer(),tlsData:c.util.createBuffer(),data:c.util.createBuffer(),tlsDataReady:a.tlsDataReady,dataReady:a.dataReady,heartbeatReceived:a.heartbeatReceived,closed:a.closed,error:function(c,
630
-b){b.origin=b.origin||(c.entity===h.ConnectionEnd.client?"client":"server");b.send&&(h.queue(c,h.createAlert(c,b.alert)),h.flush(c));var d=!1!==b.fatal;d&&(c.fail=!0);a.error(c,b);d&&c.close(!1)},deflate:a.deflate||null,inflate:a.inflate||null,reset:function(a){f.version={major:h.Version.major,minor:h.Version.minor};f.record=null;f.session=null;f.peerCertificate=null;f.state={pending:null,current:null};f.expect=0;f.fragmented=null;f.records=[];f.open=!1;f.handshakes=0;f.handshaking=!1;f.isConnected=
631
-!1;f.fail=!(a||"undefined"===typeof a);f.input.clear();f.tlsData.clear();f.data.clear();f.state.current=h.createConnectionState(f)}};f.reset();f.handshake=function(a){if(f.entity!==h.ConnectionEnd.client)f.error(f,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(f.handshaking)f.error(f,{message:"Handshake already in progress.",fatal:!1});else{f.fail&&!f.open&&0===f.handshakes&&(f.fail=!1);f.handshaking=!0;a=a||"";var b=null;0<a.length&&(f.sessionCache&&(b=f.sessionCache.getSession(a)),
632
-null===b&&(a=""));0===a.length&&f.sessionCache&&(b=f.sessionCache.getSession(),null!==b&&(a=b.id));f.session={id:a,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:c.md.md5.create(),sha1:c.md.sha1.create()};b&&(f.version=b.version,f.session.sp=b.sp);f.session.sp.client_random=h.createRandom().getBytes();f.open=!0;h.queue(f,h.createRecord(f,{type:h.ContentType.handshake,data:h.createClientHello(f)}));h.flush(f)}};f.process=
633
-function(a){var b=0;a&&f.input.putBytes(a);if(!f.fail){null!==f.record&&f.record.ready&&f.record.fragment.isEmpty()&&(f.record=null);if(null===f.record){b=0;a=f.input;var d=a.length();5>d?b=5-d:(f.record={type:a.getByte(),version:{major:a.getByte(),minor:a.getByte()},length:a.getInt16(),fragment:c.util.createBuffer(),ready:!1},(a=f.record.version.major===f.version.major)&&f.session&&f.session.version&&(a=f.record.version.minor===f.version.minor),a||f.error(f,{message:"Incompatible TLS version.",send:!0,
634
-alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.protocol_version}}))}if(!f.fail&&null!==f.record&&!f.record.ready){b=f;a=0;var d=b.input,e=d.length();e<b.record.length?a=b.record.length-e:(b.record.fragment.putBytes(d.getBytes(b.record.length)),d.compact(),b.state.current.read.update(b,b.record)&&(null!==b.fragmented&&(b.fragmented.type===b.record.type?(b.fragmented.fragment.putBuffer(b.record.fragment),b.record=b.fragmented):b.error(b,{message:"Invalid fragmented record.",send:!0,
635
-alert:{level:h.Alert.Level.fatal,description:h.Alert.Description.unexpected_message}})),b.record.ready=!0));b=a}if(!f.fail&&null!==f.record&&f.record.ready)if(a=f.record,d=a.type-h.ContentType.change_cipher_spec,e=W[f.entity][f.expect],d in e)e[d](f,a);else h.handleUnexpected(f,a)}return b};f.prepare=function(a){h.queue(f,h.createRecord(f,{type:h.ContentType.application_data,data:c.util.createBuffer(a)}));return h.flush(f)};f.prepareHeartbeatRequest=function(a,b){a instanceof c.util.ByteBuffer&&(a=
636
-a.bytes());"undefined"===typeof b&&(b=a.length);f.expectedHeartbeatPayload=a;h.queue(f,h.createRecord(f,{type:h.ContentType.heartbeat,data:h.createHeartbeat(h.HeartbeatMessageType.heartbeat_request,a,b)}));return h.flush(f)};f.close=function(a){if(!f.fail&&f.sessionCache&&f.session){var c={id:f.session.id,version:f.session.version,sp:f.session.sp};c.sp.keys=null;f.sessionCache.setSession(c.id,c)}if(f.open){f.open=!1;f.input.clear();if(f.isConnected||f.handshaking)f.isConnected=f.handshaking=!1,h.queue(f,
637
-h.createAlert(f,{level:h.Alert.Level.warning,description:h.Alert.Description.close_notify})),h.flush(f);f.closed(f)}f.reset(a)};return f};c.tls=c.tls||{};for(var P in h)"function"!==typeof h[P]&&(c.tls[P]=h[P]);c.tls.prf_tls1=b;c.tls.hmac_sha1=function(a,b,d){var e=c.hmac.create();e.start("SHA1",a);a=c.util.createBuffer();a.putInt32(b[0]);a.putInt32(b[1]);a.putByte(d.type);a.putByte(d.version.major);a.putByte(d.version.minor);a.putInt16(d.length);a.putBytes(d.fragment.bytes());e.update(a.getBytes());
638
-return e.digest().getBytes()};c.tls.createSessionCache=h.createSessionCache;c.tls.createConnection=h.createConnection}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.tls)return b.tls;b.defined.tls=!0;for(var f=0;f<e.length;++f)e[f](b);return b.tls}},
639
-r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/tls","require module ./asn1 ./hmac ./md ./pem ./pki ./random ./util".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,e,g){e=e.entity===c.tls.ConnectionEnd.client;a.read.cipherState={init:!1,cipher:c.cipher.createDecipher("AES-CBC",
640
-e?g.keys.server_write_key:g.keys.client_write_key),iv:e?g.keys.server_write_IV:g.keys.client_write_IV};a.write.cipherState={init:!1,cipher:c.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};a.read.cipherFunction=m;a.write.cipherFunction=d;a.read.macLength=a.write.macLength=g.mac_length;a.read.macFunction=a.write.macFunction=h.hmac_sha1}function d(a,b){var g=!1,f=b.macFunction(b.macKey,b.sequenceNumber,a);a.fragment.putBytes(f);
641
-b.updateSequenceNumber();f=a.version.minor===h.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:c.random.getBytesSync(16);b.cipherState.init=!0;var k=b.cipherState.cipher;k.start({iv:f});a.version.minor>=h.Versions.TLS_1_1.minor&&k.output.putBytes(f);k.update(a.fragment);k.finish(e)&&(a.fragment=k.output,a.length=a.fragment.length(),g=!0);return g}function e(a,c,b){b||(a-=c.length()%a,c.fillWithByte(a-1,a));return!0}function f(a,c,b){a=!0;if(b){b=c.length();for(var d=c.last(),e=b-1-
642
-d;e<b-1;++e)a=a&&c.at(e)==d;a&&c.truncate(d+1)}return a}function m(a,b){var d=!1;++g;d=a.version.minor===h.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:a.fragment.getBytes(16);b.cipherState.init=!0;var e=b.cipherState.cipher;e.start({iv:d});e.update(a.fragment);var d=e.finish(f),k=b.macLength,p=c.random.getBytesSync(k),v=e.output.length();v>=k?(a.fragment=e.output.getBytes(v-k),p=e.output.getBytes(k)):a.fragment=e.output.getBytes();a.fragment=c.util.createBuffer(a.fragment);a.length=
643
-a.fragment.length();k=b.macFunction(b.macKey,b.sequenceNumber,a);b.updateSequenceNumber();e=b.macKey;v=c.hmac.create();v.start("SHA1",e);v.update(p);p=v.digest().getBytes();v.start(null,null);v.update(k);k=v.digest().getBytes();return p===k&&d}var h=c.tls;h.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=h.BulkCipherAlgorithm.aes;a.cipher_type=h.CipherType.block;a.enc_key_length=16;a.block_length=16;
644
-a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=h.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=20},initConnectionState:b};h.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=h.BulkCipherAlgorithm.aes;a.cipher_type=h.CipherType.block;a.enc_key_length=32;a.block_length=16;a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=h.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=
645
-20},initConnectionState:b};var g=0}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.aesCipherSuites)return b.aesCipherSuites;b.defined.aesCipherSuites=!0;for(var f=0;f<e.length;++f)e[f](b);return b.aesCipherSuites}},r=c;c=function(a,b){m="string"===
646
-typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/aesCipherSuites",["require","module","./aes","./tls"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.debug=c.debug||{};c.debug.storage={};c.debug.get=function(a,b){var d;"undefined"===typeof a?d=c.debug.storage:a in c.debug.storage&&(d="undefined"===typeof b?c.debug.storage[a]:
647
-c.debug.storage[a][b]);return d};c.debug.set=function(a,b,d){a in c.debug.storage||(c.debug.storage[a]={});c.debug.storage[a][b]=d};c.debug.clear=function(a,b){"undefined"===typeof a?c.debug.storage={}:a in c.debug.storage&&("undefined"===typeof b?delete c.debug.storage[a]:delete c.debug.storage[a][b])}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=
648
-function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.debug)return b.debug;b.defined.debug=!0;for(var f=0;f<e.length;++f)e[f](b);return b.debug}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/debug",["require","module"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();
649
-(function(){function a(c){function b(a,d,f,h){a.generate=function(a,b){for(var e=new c.util.ByteBuffer,k=Math.ceil(b/h)+f,m=new c.util.ByteBuffer,p=f;p<k;++p){m.putInt32(p);d.start();d.update(a+m.getBytes());var v=d.digest();e.putBytes(v.getBytes(h))}e.truncate(e.length()-b);return e.getBytes()}}c.kem=c.kem||{};var d=c.jsbn.BigInteger;c.kem.rsa={};c.kem.rsa.create=function(a,b){b=b||{};var f=b.prng||c.random;return{encrypt:function(b,g){var k=Math.ceil(b.n.bitLength()/8),n;do n=(new d(c.util.bytesToHex(f.getBytesSync(k)),
650
-16)).mod(b.n);while(n.equals(d.ZERO));n=c.util.hexToBytes(n.toString(16));k-=n.length;0<k&&(n=c.util.fillString(String.fromCharCode(0),k)+n);k=b.encrypt(n,"NONE");n=a.generate(n,g);return{encapsulation:k,key:n}},decrypt:function(c,b,d){c=c.decrypt(b,"NONE");return a.generate(c,d)}}};c.kem.kdf1=function(a,c){b(this,a,0,c||a.digestLength)};c.kem.kdf2=function(a,c){b(this,a,1,c||a.digestLength)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===
651
-typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.kem)return b.kem;b.defined.kem=!0;for(var f=0;f<e.length;++f)e[f](b);return b.kem}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/kem",["require","module","./util","./random",
652
-"./jsbn"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.log=c.log||{};c.log.levels="none error warning info debug verbose max".split(" ");var b={},d=[],e=null;c.log.LEVEL_LOCKED=2;c.log.NO_LEVEL_CHECK=4;c.log.INTERPOLATE=8;for(var f=0;f<c.log.levels.length;++f){var m=c.log.levels[f];b[m]={index:f,name:m.toUpperCase()}}c.log.logMessage=function(a){for(var e=b[a.level].index,f=0;f<d.length;++f){var h=d[f];h.flags&c.log.NO_LEVEL_CHECK?h.f(a):e<=b[h.level].index&&
653
-h.f(h,a)}};c.log.prepareStandard=function(a){"standard"in a||(a.standard=b[a.level].name+" ["+a.category+"] "+a.message)};c.log.prepareFull=function(a){if(!("full"in a)){var b=[a.message],b=b.concat([]);a.full=c.util.format.apply(this,b)}};c.log.prepareStandardFull=function(a){"standardFull"in a||(c.log.prepareStandard(a),a.standardFull=a.standard)};m=["error","warning","info","debug","verbose"];for(f=0;f<m.length;++f)(function(a){c.log[a]=function(b,d){var e=Array.prototype.slice.call(arguments).slice(2);
654
-c.log.logMessage({timestamp:new Date,level:a,category:b,message:d,arguments:e})}})(m[f]);c.log.makeLogger=function(a){a={flags:0,f:a};c.log.setLevel(a,"none");return a};c.log.setLevel=function(a,b){var d=!1;if(a&&!(a.flags&c.log.LEVEL_LOCKED))for(var e=0;e<c.log.levels.length;++e)if(b==c.log.levels[e]){a.level=b;d=!0;break}return d};c.log.lock=function(a,b){a.flags="undefined"===typeof b||b?a.flags|c.log.LEVEL_LOCKED:a.flags&~c.log.LEVEL_LOCKED};c.log.addLogger=function(a){d.push(a)};if("undefined"!==
655
-typeof console&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug)var h={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},e=function(a,b){c.log.prepareStandard(b);var d=h[b.level],e=[b.standard],e=e.concat(b.arguments.slice());d.apply(console,e)};else e=function(a,b){c.log.prepareStandardFull(b);console.log(b.standardFull)};e=c.log.makeLogger(e);c.log.setLevel(e,"debug");c.log.addLogger(e)}else console={log:function(){}};
656
-null!==e&&(f=c.util.getQueryVariables(),"console.level"in f&&c.log.setLevel(e,f["console.level"].slice(-1)[0]),"console.lock"in f&&"true"==f["console.lock"].slice(-1)[0]&&c.log.lock(e));c.log.consoleLogger=e}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.log)return b.log;
657
-b.defined.log=!0;for(var f=0;f<e.length;++f)e[f](b);return b.log}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/log",["require","module","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){var d={},e=[];if(!n.validate(a,r.asn1.recipientInfoValidator,d,e))throw a=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."),
658
-a.errors=e,a;return{version:d.version.charCodeAt(0),issuer:c.pki.RDNAttributesAsArray(d.issuer),serialNumber:c.util.createBuffer(d.serial).toHex(),encryptedContent:{algorithm:n.derToOid(d.encAlgorithm),parameter:d.encParameter.value,content:d.encKey}}}function d(a){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(a.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[c.pki.distinguishedNameToAsn1({attributes:a.issuer}),
659
-n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.encryptedContent.algorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]),n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,a.encryptedContent.content)])}function e(a){for(var c=[],b=0;b<a.length;++b)c.push(d(a[b]));return c}function f(a){var b=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,
660
-n.Type.INTEGER,!1,n.integerToDer(a.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[c.pki.distinguishedNameToAsn1({attributes:a.issuer}),n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber))]),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.digestAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")])]);a.authenticatedAttributesAsn1&&b.value.push(a.authenticatedAttributesAsn1);b.value.push(n.create(n.Class.UNIVERSAL,
661
-n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.signatureAlgorithm).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.NULL,!1,"")]));b.value.push(n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,a.signature));if(0<a.unauthenticatedAttributes.length){for(var d=n.create(n.Class.CONTEXT_SPECIFIC,1,!0,[]),e=0;e<a.unauthenticatedAttributes.length;++e)d.values.push(m(a.unauthenticatedAttributes[e]));b.value.push(d)}return b}function m(a){var b;if(a.type===c.pki.oids.contentType)b=
662
-n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.value).getBytes());else if(a.type===c.pki.oids.messageDigest)b=n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,a.value.bytes());else if(a.type===c.pki.oids.signingTime){b=new Date("Jan 1, 1950 00:00:00Z");var d=new Date("Jan 1, 2050 00:00:00Z"),e=a.value;if("string"===typeof e)var f=Date.parse(e),e=isNaN(f)?13===e.length?n.utcTimeToDate(e):n.generalizedTimeToDate(e):new Date(f);b=e>=b&&e<d?n.create(n.Class.UNIVERSAL,n.Type.UTCTIME,!1,n.dateToUtcTime(e)):
663
-n.create(n.Class.UNIVERSAL,n.Type.GENERALIZEDTIME,!1,n.dateToGeneralizedTime(e))}return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.type).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[b])])}function h(a){return[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(c.pki.oids.data).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.algorithm).getBytes()),n.create(n.Class.UNIVERSAL,
664
-n.Type.OCTETSTRING,!1,a.parameter.getBytes())]),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,a.content.getBytes())])]}function g(a,b,d){var e={};if(!n.validate(b,d,e,[]))throw a=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."),a.errors=a,a;if(n.derToOid(e.contentType)!==c.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(e.encryptedContent){b="";if(c.util.isArray(e.encryptedContent))for(d=
665
-0;d<e.encryptedContent.length;++d){if(e.encryptedContent[d].type!==n.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");b+=e.encryptedContent[d].value}else b=e.encryptedContent;a.encryptedContent={algorithm:n.derToOid(e.encAlgorithm),parameter:c.util.createBuffer(e.encParameter.value),content:c.util.createBuffer(b)}}if(e.content){b="";if(c.util.isArray(e.content))for(d=0;d<e.content.length;++d){if(e.content[d].type!==n.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");
666
-b+=e.content[d].value}else b=e.content;a.content=c.util.createBuffer(b)}a.version=e.version.charCodeAt(0);return a.rawCapture=e}function p(a){if(void 0===a.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===a.content){var b;switch(a.encryptedContent.algorithm){case c.pki.oids["aes128-CBC"]:case c.pki.oids["aes192-CBC"]:case c.pki.oids["aes256-CBC"]:b=c.aes.createDecryptionCipher(a.encryptedContent.key);break;case c.pki.oids.desCBC:case c.pki.oids["des-EDE3-CBC"]:b=c.des.createDecryptionCipher(a.encryptedContent.key);
667
-break;default:throw Error("Unsupported symmetric cipher, OID "+a.encryptedContent.algorithm);}b.start(a.encryptedContent.parameter);b.update(a.encryptedContent.content);if(!b.finish())throw Error("Symmetric decryption failed.");a.content=b.output}}var n=c.asn1,r=c.pkcs7=c.pkcs7||{};r.messageFromPem=function(a){a=c.pem.decode(a)[0];if("PKCS7"!==a.type){var b=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');b.headerType=a.type;throw b;}if(a.procType&&"ENCRYPTED"===
668
-a.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");a=n.fromDer(a.body);return r.messageFromAsn1(a)};r.messageToPem=function(a,b){var d={type:"PKCS7",body:n.toDer(a.toAsn1()).getBytes()};return c.pem.encode(d,{maxline:b})};r.messageFromAsn1=function(a){var b={},d=[];if(!n.validate(a,r.asn1.contentInfoValidator,b,d))throw b=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."),b.errors=d,b;d=n.derToOid(b.contentType);switch(d){case c.pki.oids.envelopedData:d=
669
-r.createEnvelopedData();break;case c.pki.oids.encryptedData:d=r.createEncryptedData();break;case c.pki.oids.signedData:d=r.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+d+" is not (yet) supported.");}d.fromAsn1(b.content.value[0]);return d};r.createSignedData=function(){var a=null;return a={type:c.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(b){g(a,
670
-b,r.asn1.signedDataValidator);a.certificates=[];a.crls=[];a.digestAlgorithmIdentifiers=[];a.contentInfo=null;a.signerInfos=[];b=a.rawCapture.certificates.value;for(var d=0;d<b.length;++d)a.certificates.push(c.pki.certificateFromAsn1(b[d]))},toAsn1:function(){a.contentInfo||a.sign();for(var b=[],d=0;d<a.certificates.length;++d)b.push(c.pki.certificateToAsn1(a.certificates[d]));var d=[],e=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,
671
-n.Type.INTEGER,!1,n.integerToDer(a.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,a.digestAlgorithmIdentifiers),a.contentInfo])]);0<b.length&&e.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,0,!0,b));0<d.length&&e.value[0].value.push(n.create(n.Class.CONTEXT_SPECIFIC,1,!0,d));e.value[0].value.push(n.create(n.Class.UNIVERSAL,n.Type.SET,!0,a.signerInfos));return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.type).getBytes()),
672
-e])},addSigner:function(b){var d=b.issuer,e=b.serialNumber;b.certificate&&(e=b.certificate,"string"===typeof e&&(e=c.pki.certificateFromPem(e)),d=e.issuer.attributes,e=e.serialNumber);var f=b.key;if(!f)throw Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof f&&(f=c.pki.privateKeyFromPem(f));var g=b.digestAlgorithm||c.pki.oids.sha1;switch(g){case c.pki.oids.sha1:case c.pki.oids.sha256:case c.pki.oids.sha384:case c.pki.oids.sha512:case c.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+
673
-g);}b=b.authenticatedAttributes||[];if(0<b.length){for(var h=!1,k=!1,n=0;n<b.length;++n){var m=b[n];if(!h&&m.type===c.pki.oids.contentType){if(h=!0,k)break}else if(!k&&m.type===c.pki.oids.messageDigest&&(k=!0,h))break}if(!h||!k)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.");}a.signers.push({key:f,version:1,issuer:d,serialNumber:e,digestAlgorithm:g,
674
-signatureAlgorithm:c.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:b,unauthenticatedAttributes:[]})},sign:function(){if("object"!==typeof a.content||null===a.contentInfo)if(a.contentInfo=n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(c.pki.oids.data).getBytes())]),"content"in a){var b;a.content instanceof c.util.ByteBuffer?b=a.content.bytes():"string"===typeof a.content&&(b=c.util.encodeUtf8(a.content));a.contentInfo.value.push(n.create(n.Class.CONTEXT_SPECIFIC,
675
-0,!0,[n.create(n.Class.UNIVERSAL,n.Type.OCTETSTRING,!1,b)]))}if(0!==a.signers.length){b={};for(var d=0;d<a.signers.length;++d){var e=a.signers[d],g=e.digestAlgorithm;g in b||(b[g]=c.md[c.pki.oids[g]].create());e.md=0===e.authenticatedAttributes.length?b[g]:c.md[c.pki.oids[g]].create()}a.digestAlgorithmIdentifiers=[];for(g in b)a.digestAlgorithmIdentifiers.push(n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(g).getBytes()),n.create(n.Class.UNIVERSAL,
676
-n.Type.NULL,!1,"")]));if(2>a.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var g=n.derToOid(a.contentInfo.value[0].value),d=a.contentInfo.value[1],d=d.value[0],h=n.toDer(d);h.getByte();n.getBerValueLength(h);var h=h.getBytes(),k;for(k in b)b[k].start().update(h);k=new Date;for(d=0;d<a.signers.length;++d){e=a.signers[d];if(0===e.authenticatedAttributes.length){if(g!==c.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
677
-}else{e.authenticatedAttributesAsn1=n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var h=n.create(n.Class.UNIVERSAL,n.Type.SET,!0,[]),p=0;p<e.authenticatedAttributes.length;++p){var r=e.authenticatedAttributes[p];r.type===c.pki.oids.messageDigest?r.value=b[e.digestAlgorithm].digest():r.type!==c.pki.oids.signingTime||r.value||(r.value=k);h.value.push(m(r));e.authenticatedAttributesAsn1.value.push(m(r))}h=n.toDer(h).getBytes();e.md.start().update(h)}e.signature=e.key.sign(e.md,"RSASSA-PKCS1-V1_5")}b=
678
-a;g=a.signers;k=[];for(d=0;d<g.length;++d)k.push(f(g[d]));b.signerInfos=k}},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.");},addCertificate:function(b){"string"===typeof b&&(b=c.pki.certificateFromPem(b));a.certificates.push(b)},addCertificateRevokationList:function(a){throw Error("PKCS#7 CRL support not yet implemented.");}}};r.createEncryptedData=function(){var a=null;return a={type:c.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:c.pki.oids["aes256-CBC"]},
679
-fromAsn1:function(c){g(a,c,r.asn1.encryptedDataValidator)},decrypt:function(c){void 0!==c&&(a.encryptedContent.key=c);p(a)}}};r.createEnvelopedData=function(){var a=null;return a={type:c.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:c.pki.oids["aes256-CBC"]},fromAsn1:function(c){var d=g(a,c,r.asn1.envelopedDataValidator);c=a;for(var d=d.recipientInfos.value,e=[],f=0;f<d.length;++f)e.push(b(d[f]));c.recipients=e},toAsn1:function(){return n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,
680
-!0,[n.create(n.Class.UNIVERSAL,n.Type.OID,!1,n.oidToDer(a.type).getBytes()),n.create(n.Class.CONTEXT_SPECIFIC,0,!0,[n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,[n.create(n.Class.UNIVERSAL,n.Type.INTEGER,!1,n.integerToDer(a.version).getBytes()),n.create(n.Class.UNIVERSAL,n.Type.SET,!0,e(a.recipients)),n.create(n.Class.UNIVERSAL,n.Type.SEQUENCE,!0,h(a.encryptedContent))])])])},findRecipient:function(c){for(var b=c.issuer.attributes,d=0;d<a.recipients.length;++d){var e=a.recipients[d],f=e.issuer;if(e.serialNumber===
681
-c.serialNumber&&f.length===b.length){for(var g=!0,h=0;h<b.length;++h)if(f[h].type!==b[h].type||f[h].value!==b[h].value){g=!1;break}if(g)return e}}return null},decrypt:function(b,d){if(void 0===a.encryptedContent.key&&void 0!==b&&void 0!==d)switch(b.encryptedContent.algorithm){case c.pki.oids.rsaEncryption:case c.pki.oids.desCBC:var e=d.decrypt(b.encryptedContent.content);a.encryptedContent.key=c.util.createBuffer(e);break;default:throw Error("Unsupported asymmetric cipher, OID "+b.encryptedContent.algorithm);
682
-}p(a)},addRecipient:function(b){a.recipients.push({version:0,issuer:b.issuer.attributes,serialNumber:b.serialNumber,encryptedContent:{algorithm:c.pki.oids.rsaEncryption,key:b.publicKey}})},encrypt:function(b,d){if(void 0===a.encryptedContent.content){d=d||a.encryptedContent.algorithm;b=b||a.encryptedContent.key;var e,f,g;switch(d){case c.pki.oids["aes128-CBC"]:f=e=16;g=c.aes.createEncryptionCipher;break;case c.pki.oids["aes192-CBC"]:e=24;f=16;g=c.aes.createEncryptionCipher;break;case c.pki.oids["aes256-CBC"]:e=
683
-32;f=16;g=c.aes.createEncryptionCipher;break;case c.pki.oids["des-EDE3-CBC"]:e=24;f=8;g=c.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+d);}if(void 0===b)b=c.util.createBuffer(c.random.getBytes(e));else if(b.length()!=e)throw Error("Symmetric key has wrong length; got "+b.length()+" bytes, expected "+e+".");a.encryptedContent.algorithm=d;a.encryptedContent.key=b;a.encryptedContent.parameter=c.util.createBuffer(c.random.getBytes(f));e=g(b);e.start(a.encryptedContent.parameter.copy());
684
-e.update(a.content);if(!e.finish())throw Error("Symmetric encryption failed.");a.encryptedContent.content=e.output}for(e=0;e<a.recipients.length;++e)if(f=a.recipients[e],void 0===f.encryptedContent.content)switch(f.encryptedContent.algorithm){case c.pki.oids.rsaEncryption:f.encryptedContent.content=f.encryptedContent.key.encrypt(a.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+f.encryptedContent.algorithm);}}}}}if("function"!==typeof c)if("object"===typeof module&&
685
-module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs7)return b.pkcs7;b.defined.pkcs7=!0;for(var f=0;f<e.length;++f)e[f](b);return b.pkcs7}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,
686
-Array.prototype.slice.call(arguments,0))};c("js/pkcs7","require module ./aes ./asn1 ./des ./oids ./pem ./pkcs7asn1 ./random ./util ./x509".split(" "),function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d){var e=d.toString(16);"8"<=e[0]&&(e="00"+e);e=c.util.hexToBytes(e);a.putInt32(e.length);a.putBytes(e)}function d(a,c){a.putInt32(c.length);a.putString(c)}function e(){for(var a=c.md.sha1.create(),b=arguments.length,d=0;d<b;++d)a.update(arguments[d]);
687
-return a.digest()}var f=c.ssh=c.ssh||{};f.privateKeyToPutty=function(a,f,g){g=g||"";f=f||"";var m=""===f?"none":"aes256-cbc",n;n="PuTTY-User-Key-File-2: ssh-rsa\r\n"+("Encryption: "+m+"\r\n")+("Comment: "+g+"\r\n");var p=c.util.createBuffer();d(p,"ssh-rsa");b(p,a.e);b(p,a.n);var r=c.util.encode64(p.bytes(),64),u=Math.floor(r.length/66)+1;n+="Public-Lines: "+u+"\r\n";n+=r;r=c.util.createBuffer();b(r,a.d);b(r,a.p);b(r,a.q);b(r,a.qInv);f?(u=r.length()+16-1,u-=u%16,a=e(r.bytes()),a.truncate(a.length()-
688
-u+r.length()),r.putBuffer(a),u=c.util.createBuffer(),u.putBuffer(e("\x00\x00\x00\x00",f)),u.putBuffer(e("\x00\x00\x00\u0001",f)),u=c.aes.createEncryptionCipher(u.truncate(8),"CBC"),u.start(c.util.createBuffer().fillWithByte(0,16)),u.update(r.copy()),u.finish(),u=u.output,u.truncate(16),a=c.util.encode64(u.bytes(),64)):a=c.util.encode64(r.bytes(),64);u=Math.floor(a.length/66)+1;n+="\r\nPrivate-Lines: "+u+"\r\n";n+=a;f=e("putty-private-key-file-mac-key",f);u=c.util.createBuffer();d(u,"ssh-rsa");d(u,
689
-m);d(u,g);u.putInt32(p.length());u.putBuffer(p);u.putInt32(r.length());u.putBuffer(r);g=c.hmac.create();g.start("sha1",f);g.update(u.bytes());return n+="\r\nPrivate-MAC: "+g.digest().toHex()+"\r\n"};f.publicKeyToOpenSSH=function(a,e){e=e||"";var f=c.util.createBuffer();d(f,"ssh-rsa");b(f,a.e);b(f,a.n);return"ssh-rsa "+c.util.encode64(f.bytes())+" "+e};f.privateKeyToOpenSSH=function(a,b){return b?c.pki.encryptRsaPrivateKey(a,b,{legacy:!0,algorithm:"aes128"}):c.pki.privateKeyToPem(a)};f.getPublicKeyFingerprint=
690
-function(a,e){e=e||{};var f=e.md||c.md.md5.create(),m=c.util.createBuffer();d(m,"ssh-rsa");b(m,a.e);b(m,a.n);f.start();f.update(m.getBytes());f=f.digest();if("hex"===e.encoding)return f=f.toHex(),e.delimiter?f.match(/.{2}/g).join(e.delimiter):f;if("binary"===e.encoding)return f.getBytes();if(e.encoding)throw Error('Unknown encoding "'+e.encoding+'".');return f}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&
691
-(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.ssh)return b.ssh;b.defined.ssh=!0;for(var f=0;f<e.length;++f)e[f](b);return b.ssh}},r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/ssh","require module ./aes ./hmac ./md5 ./sha1 ./util".split(" "),
692
-function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b={},d=0;c.debug.set("forge.task","tasks",b);var e={};c.debug.set("forge.task","queues",e);var f={ready:{}};f.ready.stop="ready";f.ready.start="running";f.ready.cancel="done";f.ready.fail="error";f.running={};f.running.stop="ready";f.running.start="running";f.running.block="blocked";f.running.unblock="running";f.running.sleep="sleeping";f.running.wakeup="running";f.running.cancel="done";f.running.fail=
693
-"error";f.blocked={};f.blocked.stop="blocked";f.blocked.start="blocked";f.blocked.block="blocked";f.blocked.unblock="blocked";f.blocked.sleep="blocked";f.blocked.wakeup="blocked";f.blocked.cancel="done";f.blocked.fail="error";f.sleeping={};f.sleeping.stop="sleeping";f.sleeping.start="sleeping";f.sleeping.block="sleeping";f.sleeping.unblock="sleeping";f.sleeping.sleep="sleeping";f.sleeping.wakeup="sleeping";f.sleeping.cancel="done";f.sleeping.fail="error";f.done={};f.done.stop="done";f.done.start=
694
-"done";f.done.block="done";f.done.unblock="done";f.done.sleep="done";f.done.wakeup="done";f.done.cancel="done";f.done.fail="error";f.error={};f.error.stop="error";f.error.start="error";f.error.block="error";f.error.unblock="error";f.error.sleep="error";f.error.wakeup="error";f.error.cancel="error";f.error.fail="error";var m=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=
695
-this.timeoutId=null;this.id=d++;b[this.id]=this};m.prototype.debug=function(a){c.log.debug("forge.task",a||"","[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",e)};m.prototype.next=function(a,c){"function"===typeof a&&(c=a,a=this.name);var b=new m({run:c,name:a,parent:this});b.state="running";b.type=this.type;b.successCallback=this.successCallback||null;b.failureCallback=this.failureCallback||null;this.subtasks.push(b);return this};m.prototype.parallel=function(a,b){c.util.isArray(a)&&
696
-(b=a,a=this.name);return this.next(a,function(d){d.block(b.length);for(var e=function(a,e){c.task.start({type:a,run:function(a){b[e](a)},success:function(a){d.unblock()},failure:function(a){d.unblock()}})},f=0;f<b.length;f++)e(a+"__parallel-"+d.id+"-"+f,f)})};m.prototype.stop=function(){this.state=f[this.state].stop};m.prototype.start=function(){this.error=!1;this.state=f[this.state].start;"running"===this.state&&(this.start=new Date,this.run(this),g(this,0))};m.prototype.block=function(a){this.blocks+=
697
-"undefined"===typeof a?1:a;0<this.blocks&&(this.state=f[this.state].block)};m.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};m.prototype.sleep=function(a){this.state=f[this.state].sleep;var c=this;this.timeoutId=setTimeout(function(){c.timeoutId=null;c.state="running";g(c,0)},"undefined"===typeof a?0:a)};m.prototype.wait=function(a){a.wait(this)};m.prototype.wakeup=function(){"sleeping"===
698
-this.state&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state="running",g(this,0))};m.prototype.cancel=function(){this.state=f[this.state].cancel;this.permitsNeeded=0;null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null);this.subtasks=[]};m.prototype.fail=function(a){this.error=!0;p(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,
699
-a.userData=this.userData,a=a.parent;p(a,!0)}this.failureCallback&&this.failureCallback(this)}};var h=function(a){a.error=!1;a.state=f[a.state].start;setTimeout(function(){"running"===a.state&&(a.swapTime=+new Date,a.run(a),g(a,0))},0)},g=function(a,c){var b=30<c||20<+new Date-a.swapTime,d=function(c){c++;if("running"===a.state)if(b&&(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,c)}else p(a),a.error||
700
-null===a.parent||(a.parent.error=a.error,a.parent.swapTime=a.swapTime,a.parent.userData=a.userData,g(a.parent,c))};b?setTimeout(d,0):d(c)},p=function(a,d){a.state="done";delete b[a.id];null===a.parent&&(a.type in e?0===e[a.type].length?c.log.error("forge.task","[%s][%s] task queue empty [%s]",a.id,a.name,a.type):e[a.type][0]!==a?c.log.error("forge.task","[%s][%s] task not first in queue [%s]",a.id,a.name,a.type):(e[a.type].shift(),0===e[a.type].length?delete e[a.type]:e[a.type][0].start()):c.log.error("forge.task",
701
-"[%s][%s] task queue missing [%s]",a.id,a.name,a.type),d||(a.error&&a.failureCallback?a.failureCallback(a):!a.error&&a.successCallback&&a.successCallback(a)))};c.task=c.task||{};c.task.start=function(a){var c=new m({run:a.run,name:a.name||"?"});c.type=a.type;c.successCallback=a.success||null;c.failureCallback=a.failure||null;c.type in e?e[a.type].push(c):(e[c.type]=[c],h(c))};c.task.cancel=function(a){a in e&&(e[a]=[e[a][0]])};c.task.createCondition=function(){var a={tasks:{},wait:function(c){c.id in
702
-a.tasks||(c.block(),a.tasks[c.id]=c)},notify:function(){var c=a.tasks;a.tasks={};for(var b in c)c[b].unblock()}};return a}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var f=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var m,p=function(c,b){b.exports=function(b){var e=m.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.task)return b.task;b.defined.task=!0;for(var f=0;f<e.length;++f)e[f](b);return b.task}},
703
-r=c;c=function(a,b){m="string"===typeof a?b.slice(2):a.slice(2);if(f)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/task",["require","module","./debug","./log","./util"],function(){p.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){if("function"!==typeof c)if("object"===typeof module&&module.exports){var a=!0;c=function(a,c){c(b,module)}}else{"undefined"===typeof forge&&(forge={disableNativeCode:!1});
704
-return}var f,m=function(a,c){c.exports=function(c){var b=f.map(function(c){return a(c)});c=c||{};c.defined=c.defined||{};if(c.defined.forge)return c.forge;c.defined.forge=!0;for(var d=0;d<b.length;++d)b[d](c);return c};c.exports.disableNativeCode=!0;c.exports(c.exports)},p=c;c=function(b,l){f="string"===typeof b?l.slice(2):b.slice(2);if(a)return delete c,p.apply(null,Array.prototype.slice.call(arguments,0));c=p;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("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(" "),
705
-function(){m.apply(null,Array.prototype.slice.call(arguments,0))})})();return b("js/forge")});function amtcert_linkCertPrivateKey(a,b){for(var c in a){var d=a[c];try{if(0==xxCertPrivateKeys.length)break;for(var f=forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(d.X509Certificate)).publicKey).substring(60).replace(/(\r\n|\n|\r)/gm,""),m=0;m<b.length;m++)f===b[m].DERKey+"-----END PUBLIC KEY-----"&&(b[m].XCert=d,d.XPrivateKey=b[m])}catch(p){console.log(p)}}}
706
-function amtcert_loadP12File(a,b,c){try{var d=window.forge.util.decode64(btoa(a)),f=window.forge.asn1.fromDer(d),m=window.forge.pkcs12.pkcs12FromAsn1(f,b),p=m.getBags({bagType:window.forge.pki.oids.pkcs8ShroudedKeyBag});console.assert(p[window.forge.pki.oids.pkcs8ShroudedKeyBag]&&0<p[window.forge.pki.oids.pkcs8ShroudedKeyBag].length);var r=p[window.forge.pki.oids.pkcs8ShroudedKeyBag][0].key,l=window.forge.pki.privateKeyToAsn1(r),k=window.forge.pki.wrapRsaPrivateKey(l);window.forge.asn1.toDer(k).getBytes();
707
-var v=m.getBags({bagType:window.forge.pki.oids.certBag})[window.forge.pki.oids.certBag][0].cert.subject.attributes,e=m.getBags({bagType:forge.pki.oids.certBag})[forge.pki.oids.certBag][0].cert;c(r,v,e);return!0}catch(u){}return!1}function amtcert_signWithCaKey(a,b,c,d,f){b&&null!=b||(b=amtcert_createCertificate(d).key);return amtcert_createCertificate(c,b,a,d,f)}
708
-function amtcert_createCertificate(a,b,c,d,f){var m,p=forge.pki.createCertificate();c?p.publicKey=forge.pki.publicKeyFromPem("-----BEGIN PUBLIC KEY-----"+c+"-----END PUBLIC KEY-----"):(m=forge.pki.rsa.generateKeyPair(2048),p.publicKey=m.publicKey);p.serialNumber=""+Math.floor(1E5*Math.random()+1);p.validity.notBefore=new Date;p.validity.notBefore.setFullYear(p.validity.notBefore.getFullYear()-1);p.validity.notAfter=new Date;p.validity.notAfter.setFullYear(p.validity.notAfter.getFullYear()+30);var r=
709
-[];a.CN&&r.push({name:"commonName",value:a.CN});a.C&&r.push({name:"countryName",value:a.C});a.ST&&r.push({shortName:"ST",value:a.ST});a.O&&r.push({name:"organizationName",value:a.O});p.setSubject(r);b?(a=[],d.CN&&a.push({name:"commonName",value:d.CN}),d.C&&a.push({name:"countryName",value:d.C}),d.ST&&a.push({shortName:"ST",value:d.ST}),d.O&&a.push({name:"organizationName",value:d.O}),p.setIssuer(a)):p.setIssuer(r);void 0==b?p.setExtensions([{name:"basicConstraints",cA:!0},{name:"nsCertType",sslCA:!0,
710
-emailCA:!0,objCA:!0},{name:"subjectKeyIdentifier"}]):(null==f?f={name:"extKeyUsage",serverAuth:!0}:f.name="extKeyUsage",p.setExtensions([{name:"basicConstraints"},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},f,{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0},{name:"subjectKeyIdentifier"}]));b?p.sign(b,forge.md.sha256.create()):p.sign(m.privateKey,forge.md.sha256.create());return c?p:{cert:p,key:m.privateKey}}
711
-function _stringToArrayBuffer(a){for(var b=new ArrayBuffer(a.length),c=new Uint8Array(b),d=0,f=a.length;d<f;d++)c[d]=a.charCodeAt(d);return b}function _arrayBufferToString(a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,d=0;d<c;d++)b+=String.fromCharCode(a[d]);return b}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(" ");
505
+a.subject.attributes=c;delete a.subject.uniqueId;b&&(a.subject.uniqueId=b);a.subject.hash=null};a.setIssuer=function(c,b){e(c);a.issuer.attributes=c;delete a.issuer.uniqueId;b&&(a.issuer.uniqueId=b);a.issuer.hash=null};a.setExtensions=function(c){for(var b=0;b<c.length;++b)g(c[b],{cert:a});a.extensions=c};a.getExtension=function(c){"string"===typeof c&&(c={name:c});for(var b=null,d,e=0;null===b&&e<a.extensions.length;++e)d=a.extensions[e],c.id&&d.id===c.id?b=d:c.name&&d.name===c.name&&(b=d);return b};
506
+a.sign=function(b,d){a.md=d||c.md.sha1.create();var e=p[a.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certificate digest. Unknown message digest algorithm OID."),e.algorithm=a.md.algorithm,e;a.signatureOid=a.siginfo.algorithmOid=e;a.tbsCertificate=r.getTBSCertificate(a);e=h.toDer(a.tbsCertificate);a.md.update(e.getBytes());a.signature=b.sign(a.md)};a.verify=function(b){var d=!1;if(!a.issued(b)){var d=a.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.");
507
+e.expectedIssuer=b.issuer.attributes;e.actualIssuer=d.attributes;throw e;}e=b.md;if(null===e){if(b.signatureOid in p)switch(p[b.signatureOid]){case "sha1WithRSAEncryption":e=c.md.sha1.create();break;case "md5WithRSAEncryption":e=c.md.md5.create();break;case "sha256WithRSAEncryption":e=c.md.sha256.create();break;case "sha512WithRSAEncryption":e=c.md.sha512.create();break;case "RSASSA-PSS":e=c.md.sha256.create()}if(null===e)throw e=Error("Could not compute certificate digest. Unknown signature OID."),
508
+e.signatureOid=b.signatureOid,e;var k=b.tbsCertificate||r.getTBSCertificate(b),k=h.toDer(k);e.update(k.getBytes())}if(null!==e){var g;switch(b.signatureOid){case p.sha1WithRSAEncryption:g=void 0;break;case p["RSASSA-PSS"]:d=p[b.signatureParameters.mgf.hash.algorithmOid];if(void 0===d||void 0===c.md[d])throw e=Error("Unsupported MGF hash function."),e.oid=b.signatureParameters.mgf.hash.algorithmOid,e.name=d,e;g=p[b.signatureParameters.mgf.algorithmOid];if(void 0===g||void 0===c.mgf[g])throw e=Error("Unsupported MGF function."),
509
+e.oid=b.signatureParameters.mgf.algorithmOid,e.name=g,e;g=c.mgf[g].create(c.md[d].create());d=p[b.signatureParameters.hash.algorithmOid];if(void 0===d||void 0===c.md[d])throw{message:"Unsupported RSASSA-PSS hash function.",oid:b.signatureParameters.hash.algorithmOid,name:d};g=c.pss.create(c.md[d].create(),g,b.signatureParameters.saltLength)}d=a.publicKey.verify(e.digest().getBytes(),b.signature,g)}return d};a.isIssuer=function(c){var b=!1,d=a.issuer;c=c.subject;if(d.hash&&c.hash)b=d.hash===c.hash;
510
+else if(d.attributes.length===c.attributes.length)for(var b=!0,e,h,k=0;b&&k<d.attributes.length;++k)if(e=d.attributes[k],h=c.attributes[k],e.type!==h.type||e.value!==h.value)b=!1;return b};a.issued=function(c){return c.isIssuer(a)};a.generateSubjectKeyIdentifier=function(){return r.getPublicKeyFingerprint(a.publicKey,{type:"RSAPublicKey"})};a.verifySubjectKeyIdentifier=function(){for(var b=p.subjectKeyIdentifier,d=0;d<a.extensions.length;++d){var e=a.extensions[d];if(e.id===b)return b=a.generateSubjectKeyIdentifier().getBytes(),
511
+c.util.hexToBytes(e.subjectKeyIdentifier)===b}return!1};return a};r.certificateFromAsn1=function(a,d){var k={},g=[];if(!h.validate(a,z,k,g))throw k=Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."),k.errors=g,k;if("string"!==typeof k.certSignature){for(var g="\x00",n=0;n<k.certSignature.length;++n)g+=h.toDer(k.certSignature[n]).getBytes();k.certSignature=g}g=h.derToOid(k.publicKeyOid);if(g!==r.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");
512
+var q=r.createCertificate();q.version=k.certVersion?k.certVersion.charCodeAt(0):0;g=c.util.createBuffer(k.certSerialNumber);q.serialNumber=g.toHex();q.signatureOid=c.asn1.derToOid(k.certSignatureOid);q.signatureParameters=N(q.signatureOid,k.certSignatureParams,!0);q.siginfo.algorithmOid=c.asn1.derToOid(k.certinfoSignatureOid);q.siginfo.parameters=N(q.siginfo.algorithmOid,k.certinfoSignatureParams,!1);g=c.util.createBuffer(k.certSignature);++g.read;q.signature=g.getBytes();g=[];void 0!==k.certValidity1UTCTime&&
513
+g.push(h.utcTimeToDate(k.certValidity1UTCTime));void 0!==k.certValidity2GeneralizedTime&&g.push(h.generalizedTimeToDate(k.certValidity2GeneralizedTime));void 0!==k.certValidity3UTCTime&&g.push(h.utcTimeToDate(k.certValidity3UTCTime));void 0!==k.certValidity4GeneralizedTime&&g.push(h.generalizedTimeToDate(k.certValidity4GeneralizedTime));if(2<g.length)throw Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(2>g.length)throw Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");
514
+q.validity.notBefore=g[0];q.validity.notAfter=g[1];q.tbsCertificate=k.tbsCertificate;if(d){q.md=null;if(q.signatureOid in p)switch(g=p[q.signatureOid],g){case "sha1WithRSAEncryption":q.md=c.md.sha1.create();break;case "md5WithRSAEncryption":q.md=c.md.md5.create();break;case "sha256WithRSAEncryption":q.md=c.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=c.md.sha512.create();break;case "RSASSA-PSS":q.md=c.md.sha256.create()}if(null===q.md)throw k=Error("Could not compute certificate digest. Unknown signature OID."),
515
+k.signatureOid=q.signatureOid,k;g=h.toDer(q.tbsCertificate);q.md.update(g.getBytes())}g=c.md.sha1.create();q.issuer.getField=function(a){return b(q.issuer,a)};q.issuer.addField=function(a){e([a]);q.issuer.attributes.push(a)};q.issuer.attributes=r.RDNAttributesAsArray(k.certIssuer,g);k.certIssuerUniqueId&&(q.issuer.uniqueId=k.certIssuerUniqueId);q.issuer.hash=g.digest().toHex();g=c.md.sha1.create();q.subject.getField=function(a){return b(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};
516
+q.subject.attributes=r.RDNAttributesAsArray(k.certSubject,g);k.certSubjectUniqueId&&(q.subject.uniqueId=k.certSubjectUniqueId);q.subject.hash=g.digest().toHex();q.extensions=k.certExtensions?r.certificateExtensionsFromAsn1(k.certExtensions):[];q.publicKey=r.publicKeyFromAsn1(k.subjectPublicKeyInfo);return q};r.certificateExtensionsFromAsn1=function(a){for(var c=[],b=0;b<a.value.length;++b)for(var d=a.value[b],e=0;e<d.value.length;++e)c.push(r.certificateExtensionFromAsn1(d.value[e]));return c};r.certificateExtensionFromAsn1=
517
+function(a){var b={};b.id=h.derToOid(a.value[0].value);b.critical=!1;a.value[1].type===h.Type.BOOLEAN?(b.critical=0!==a.value[1].value.charCodeAt(0),b.value=a.value[2].value):b.value=a.value[1].value;if(b.id in p)if(b.name=p[b.id],"keyUsage"===b.name){a=h.fromDer(b.value);var d=0,e=0;1<a.value.length&&(d=a.value.charCodeAt(1),e=2<a.value.length?a.value.charCodeAt(2):0);b.digitalSignature=128===(d&128);b.nonRepudiation=64===(d&64);b.keyEncipherment=32===(d&32);b.dataEncipherment=16===(d&16);b.keyAgreement=
518
+8===(d&8);b.keyCertSign=4===(d&4);b.cRLSign=2===(d&2);b.encipherOnly=1===(d&1);b.decipherOnly=128===(e&128)}else if("basicConstraints"===b.name)a=h.fromDer(b.value),b.cA=0<a.value.length&&a.value[0].type===h.Type.BOOLEAN?0!==a.value[0].value.charCodeAt(0):!1,d=null,0<a.value.length&&a.value[0].type===h.Type.INTEGER?d=a.value[0].value:1<a.value.length&&(d=a.value[1].value),null!==d&&(b.pathLenConstraint=h.derToInteger(d));else if("extKeyUsage"===b.name)for(a=h.fromDer(b.value),d=0;d<a.value.length;++d)e=
519
+h.derToOid(a.value[d].value),e in p?b[p[e]]=!0:b[e]=!0;else if("nsCertType"===b.name)a=h.fromDer(b.value),d=0,1<a.value.length&&(d=a.value.charCodeAt(1)),b.client=128===(d&128),b.server=64===(d&64),b.email=32===(d&32),b.objsign=16===(d&16),b.reserved=8===(d&8),b.sslCA=4===(d&4),b.emailCA=2===(d&2),b.objCA=1===(d&1);else if("subjectAltName"===b.name||"issuerAltName"===b.name)for(b.altNames=[],a=h.fromDer(b.value),e=0;e<a.value.length;++e){var d=a.value[e],k={type:d.type,value:d.value};b.altNames.push(k);
520
+switch(d.type){case 7:k.ip=c.util.bytesToIP(d.value);break;case 8:k.oid=h.derToOid(d.value)}}else"subjectKeyIdentifier"===b.name&&(a=h.fromDer(b.value),b.subjectKeyIdentifier=c.util.bytesToHex(a.value));return b};r.certificationRequestFromAsn1=function(a,d){var k={},g=[];if(!h.validate(a,D,k,g))throw k=Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."),k.errors=g,k;if("string"!==typeof k.csrSignature){for(var g="\x00",n=0;n<k.csrSignature.length;++n)g+=
521
+h.toDer(k.csrSignature[n]).getBytes();k.csrSignature=g}g=h.derToOid(k.publicKeyOid);if(g!==r.oids.rsaEncryption)throw Error("Cannot read public key. OID is not RSA.");var q=r.createCertificationRequest();q.version=k.csrVersion?k.csrVersion.charCodeAt(0):0;q.signatureOid=c.asn1.derToOid(k.csrSignatureOid);q.signatureParameters=N(q.signatureOid,k.csrSignatureParams,!0);q.siginfo.algorithmOid=c.asn1.derToOid(k.csrSignatureOid);q.siginfo.parameters=N(q.siginfo.algorithmOid,k.csrSignatureParams,!1);g=
522
+c.util.createBuffer(k.csrSignature);++g.read;q.signature=g.getBytes();q.certificationRequestInfo=k.certificationRequestInfo;if(d){q.md=null;if(q.signatureOid in p)switch(g=p[q.signatureOid],g){case "sha1WithRSAEncryption":q.md=c.md.sha1.create();break;case "md5WithRSAEncryption":q.md=c.md.md5.create();break;case "sha256WithRSAEncryption":q.md=c.md.sha256.create();break;case "sha512WithRSAEncryption":q.md=c.md.sha512.create();break;case "RSASSA-PSS":q.md=c.md.sha256.create()}if(null===q.md)throw k=
523
+Error("Could not compute certification request digest. Unknown signature OID."),k.signatureOid=q.signatureOid,k;g=h.toDer(q.certificationRequestInfo);q.md.update(g.getBytes())}g=c.md.sha1.create();q.subject.getField=function(a){return b(q.subject,a)};q.subject.addField=function(a){e([a]);q.subject.attributes.push(a)};q.subject.attributes=r.RDNAttributesAsArray(k.certificationRequestInfoSubject,g);q.subject.hash=g.digest().toHex();q.publicKey=r.publicKeyFromAsn1(k.subjectPublicKeyInfo);q.getAttribute=
524
+function(a){return b(q,a)};q.addAttribute=function(a){e([a]);q.attributes.push(a)};q.attributes=r.CRIAttributesAsArray(k.certificationRequestInfoAttributes||[]);return q};r.createCertificationRequest=function(){var a={version:0,signatureOid:null,signature:null,siginfo:{}};a.siginfo.algorithmOid=null;a.subject={};a.subject.getField=function(c){return b(a.subject,c)};a.subject.addField=function(c){e([c]);a.subject.attributes.push(c)};a.subject.attributes=[];a.subject.hash=null;a.publicKey=null;a.attributes=
525
+[];a.getAttribute=function(c){return b(a,c)};a.addAttribute=function(c){e([c]);a.attributes.push(c)};a.md=null;a.setSubject=function(c){e(c);a.subject.attributes=c;a.subject.hash=null};a.setAttributes=function(c){e(c);a.attributes=c};a.sign=function(b,d){a.md=d||c.md.sha1.create();var e=p[a.md.algorithm+"WithRSAEncryption"];if(!e)throw e=Error("Could not compute certification request digest. Unknown message digest algorithm OID."),e.algorithm=a.md.algorithm,e;a.signatureOid=a.siginfo.algorithmOid=
526
+e;a.certificationRequestInfo=r.getCertificationRequestInfo(a);e=h.toDer(a.certificationRequestInfo);a.md.update(e.getBytes());a.signature=b.sign(a.md)};a.verify=function(){var b=!1,d=a.md;if(null===d){if(a.signatureOid in p)switch(p[a.signatureOid]){case "sha1WithRSAEncryption":d=c.md.sha1.create();break;case "md5WithRSAEncryption":d=c.md.md5.create();break;case "sha256WithRSAEncryption":d=c.md.sha256.create();break;case "sha512WithRSAEncryption":d=c.md.sha512.create();break;case "RSASSA-PSS":d=c.md.sha256.create()}if(null===
527
+d)throw d=Error("Could not compute certification request digest. Unknown signature OID."),d.signatureOid=a.signatureOid,d;var e=a.certificationRequestInfo||r.getCertificationRequestInfo(a),e=h.toDer(e);d.update(e.getBytes())}if(null!==d){var k;switch(a.signatureOid){case p["RSASSA-PSS"]:b=p[a.signatureParameters.mgf.hash.algorithmOid];if(void 0===b||void 0===c.md[b])throw d=Error("Unsupported MGF hash function."),d.oid=a.signatureParameters.mgf.hash.algorithmOid,d.name=b,d;k=p[a.signatureParameters.mgf.algorithmOid];
528
+if(void 0===k||void 0===c.mgf[k])throw d=Error("Unsupported MGF function."),d.oid=a.signatureParameters.mgf.algorithmOid,d.name=k,d;k=c.mgf[k].create(c.md[b].create());b=p[a.signatureParameters.hash.algorithmOid];if(void 0===b||void 0===c.md[b])throw d=Error("Unsupported RSASSA-PSS hash function."),d.oid=a.signatureParameters.hash.algorithmOid,d.name=b,d;k=c.pss.create(c.md[b].create(),k,a.signatureParameters.saltLength)}b=a.publicKey.verify(d.digest().getBytes(),a.signature,k)}return b};return a};
529
+r.getTBSCertificate=function(a){var b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.CONTEXT_SPECIFIC,0,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(a.version).getBytes())]),h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber)),h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.siginfo.algorithmOid).getBytes()),n(a.siginfo.algorithmOid,a.siginfo.parameters)]),d(a.issuer),h.create(h.Class.UNIVERSAL,
530
+h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(a.validity.notBefore)),h.create(h.Class.UNIVERSAL,h.Type.UTCTIME,!1,h.dateToUtcTime(a.validity.notAfter))]),d(a.subject),r.publicKeyToAsn1(a.publicKey)]);a.issuer.uniqueId&&b.value.push(h.create(h.Class.CONTEXT_SPECIFIC,1,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,String.fromCharCode(0)+a.issuer.uniqueId)]));a.subject.uniqueId&&b.value.push(h.create(h.Class.CONTEXT_SPECIFIC,2,!0,[h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,
531
+!1,String.fromCharCode(0)+a.subject.uniqueId)]));0<a.extensions.length&&b.value.push(r.certificateExtensionsToAsn1(a.extensions));return b};r.getCertificationRequestInfo=function(a){return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.INTEGER,!1,h.integerToDer(a.version).getBytes()),d(a.subject),r.publicKeyToAsn1(a.publicKey),k(a)])};r.distinguishedNameToAsn1=function(a){return d(a)};r.certificateToAsn1=function(a){var c=a.tbsCertificate||r.getTBSCertificate(a);
532
+return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[c,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.signatureOid).getBytes()),n(a.signatureOid,a.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};r.certificateExtensionsToAsn1=function(a){var c=h.create(h.Class.CONTEXT_SPECIFIC,3,!0,[]),b=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);c.value.push(b);for(var d=0;d<a.length;++d)b.value.push(r.certificateExtensionToAsn1(a[d]));
533
+return c};r.certificateExtensionToAsn1=function(a){var c=h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[]);c.value.push(h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.id).getBytes()));a.critical&&c.value.push(h.create(h.Class.UNIVERSAL,h.Type.BOOLEAN,!1,String.fromCharCode(255)));var b=a.value;"string"!==typeof a.value&&(b=h.toDer(b).getBytes());c.value.push(h.create(h.Class.UNIVERSAL,h.Type.OCTETSTRING,!1,b));return c};r.certificationRequestToAsn1=function(a){var c=a.certificationRequestInfo||
534
+r.getCertificationRequestInfo(a);return h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[c,h.create(h.Class.UNIVERSAL,h.Type.SEQUENCE,!0,[h.create(h.Class.UNIVERSAL,h.Type.OID,!1,h.oidToDer(a.signatureOid).getBytes()),n(a.signatureOid,a.signatureParameters)]),h.create(h.Class.UNIVERSAL,h.Type.BITSTRING,!1,String.fromCharCode(0)+a.signature)])};r.createCaStore=function(a){function b(a){if(!a.hash){var h=c.md.sha1.create();a.attributes=r.RDNAttributesAsArray(d(a),h);a.hash=h.digest().toHex()}return e.certs[a.hash]||
535
+null}var e={certs:{},getIssuer:function(a){return b(a.issuer)},addCertificate:function(a){"string"===typeof a&&(a=c.pki.certificateFromPem(a));if(!a.subject.hash){var b=c.md.sha1.create();a.subject.attributes=r.RDNAttributesAsArray(d(a.subject),b);a.subject.hash=b.digest().toHex()}a.subject.hash in e.certs?(b=e.certs[a.subject.hash],c.util.isArray(b)||(b=[b]),b.push(a)):e.certs[a.subject.hash]=a},hasCertificate:function(a){var d=b(a.subject);if(!d)return!1;c.util.isArray(d)||(d=[d]);a=h.toDer(r.certificateToAsn1(a)).getBytes();
536
+for(var e=0;e<d.length;++e){var k=h.toDer(r.certificateToAsn1(d[e])).getBytes();if(a===k)return!0}return!1}};if(a)for(var k=0;k<a.length;++k)e.addCertificate(a[k]);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"};
537
+r.verifyCertificateChain=function(a,b,d){b=b.slice(0);var e=b.slice(0),h=new Date,k=!0,g=null,l=0;do{var p=b.shift(),n=null,v=!1;if(h<p.validity.notBefore||h>p.validity.notAfter)g={message:"Certificate is not valid yet or has expired.",error:r.certificateError.certificate_expired,notBefore:p.validity.notBefore,notAfter:p.validity.notAfter,now:h};if(null===g){n=b[0]||a.getIssuer(p);null===n&&p.isIssuer(p)&&(v=!0,n=p);if(n){var w=n;c.util.isArray(w)||(w=[w]);for(var u=!1;!u&&0<w.length;){n=w.shift();
538
+try{u=n.verify(p)}catch(y){}}u||(g={message:"Certificate signature is invalid.",error:r.certificateError.bad_certificate})}null!==g||n&&!v||a.hasCertificate(p)||(g={message:"Certificate is not trusted.",error:r.certificateError.unknown_ca})}null===g&&n&&!p.isIssuer(n)&&(g={message:"Certificate issuer is invalid.",error:r.certificateError.bad_certificate});if(null===g)for(w={keyUsage:!0,basicConstraints:!0},u=0;null===g&&u<p.extensions.length;++u){var z=p.extensions[u];!z.critical||z.name in w||(g=
539
+{message:"Certificate has an unsupported critical extension.",error:r.certificateError.unsupported_certificate})}null!==g||k&&(0!==b.length||n&&!v)||(k=p.getExtension("basicConstraints"),p=p.getExtension("keyUsage"),null!==p&&(p.keyCertSign&&null!==k||(g={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})),
540
+null!==g||null===k||k.cA||(g={message:"Certificate basicConstraints indicates the certificate is not a CA.",error:r.certificateError.bad_certificate}),null===g&&null!==p&&"pathLenConstraint"in k&&l-1>k.pathLenConstraint&&(g={message:"Certificate basicConstraints pathLenConstraint violated.",error:r.certificateError.bad_certificate}));p=null===g?!0:g.error;k=d?d(p,l,e):p;if(!0===k)g=null;else{!0===p&&(g={message:"The application rejected the certificate.",error:r.certificateError.bad_certificate});
541
+if(k||0===k)"object"!==typeof k||c.util.isArray(k)?"string"===typeof k&&(g.error=k):(k.message&&(g.message=k.message),k.error&&(g.error=k.error));throw g;}k=!1;++l}while(0<b.length);return!0}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.x509)return b.x509;
542
+b.defined.x509=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pki}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/x509","require module ./aes ./asn1 ./des ./md ./mgf ./oids ./pem ./pss ./rsa ./util".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,c,d,e){for(var h=
543
+[],k=0;k<a.length;k++)for(var g=0;g<a[k].safeBags.length;g++){var m=a[k].safeBags[g];if(void 0===e||m.type===e)null===c?h.push(m):void 0!==m.attributes[c]&&0<=m.attributes[c].indexOf(d)&&h.push(m)}return h}function d(a){if(a.composed||a.constructed){for(var b=c.util.createBuffer(),e=0;e<a.value.length;++e)b.putBytes(a.value[e].value);a.composed=a.constructed=!1;a.value=b.getBytes()}return a}function e(a,b,e,l){b=k.fromDer(b,e);if(b.tagClass!==k.Class.UNIVERSAL||b.type!==k.Type.SEQUENCE||!0!==b.constructed)throw Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");
544
+for(var n=0;n<b.value.length;n++){var r={},u=[];if(!k.validate(b.value[n],p,r,u))throw a=Error("Cannot read ContentInfo."),a.errors=u,a;var u={encrypted:!1},q=null,q=r.content.value[0];switch(k.derToOid(r.contentType)){case h.oids.data:if(q.tagClass!==k.Class.UNIVERSAL||q.type!==k.Type.OCTETSTRING)throw Error("PKCS#12 SafeContents Data is not an OCTET STRING.");q=d(q).value;break;case h.oids.encryptedData:var y=l,r={},z=[];if(!k.validate(q,c.pkcs7.asn1.encryptedDataValidator,r,z))throw a=Error("Cannot read EncryptedContentInfo."),
545
+a.errors=z,a;q=k.derToOid(r.contentType);if(q!==h.oids.data)throw a=Error("PKCS#12 EncryptedContentInfo ContentType is not Data."),a.oid=q,a;q=k.derToOid(r.encAlgorithm);q=h.pbe.getCipher(q,r.encParameter,y);r=d(r.encryptedContentAsn1);r=c.util.createBuffer(r.value);q.update(r);if(!q.finish())throw Error("Failed to decrypt PKCS#12 SafeContents.");q=q.output.getBytes();u.encrypted=!0;break;default:throw a=Error("Unsupported PKCS#12 contentType."),a.contentType=k.derToOid(r.contentType),a;}u.safeBags=
546
+g(q,e,l);a.safeContents.push(u)}}function g(a,c,b){if(!c&&0===a.length)return[];a=k.fromDer(a,c);if(a.tagClass!==k.Class.UNIVERSAL||a.type!==k.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 m={},l=[];if(!k.validate(a.value[e],y,m,l))throw a=Error("Cannot read SafeBag."),a.errors=l,a;var p={type:k.derToOid(m.bagId),attributes:n(m.bagAttributes)};d.push(p);var v,w,r=m.bagValue.value[0];switch(p.type){case h.oids.pkcs8ShroudedKeyBag:if(r=
547
+h.decryptPrivateKeyInfo(r,b),null===r)throw Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");case h.oids.keyBag:try{p.key=h.privateKeyFromAsn1(r)}catch(u){p.key=null,p.asn1=r}continue;case h.oids.certBag:v=A;w=function(){if(k.derToOid(m.certId)!==h.oids.x509Certificate){var a=Error("Unsupported certificate type, only X.509 supported.");a.oid=k.derToOid(m.certId);throw a;}a=k.fromDer(m.cert,c);try{p.cert=h.certificateFromAsn1(a,!0)}catch(b){p.cert=null,p.asn1=a}};break;default:throw a=
548
+Error("Unsupported PKCS#12 SafeBag type."),a.oid=p.type,a;}if(void 0!==v&&!k.validate(r,v,m,l))throw a=Error("Cannot read PKCS#12 "+v.name),a.errors=l,a;w()}return d}function n(a){var c={};if(void 0!==a)for(var b=0;b<a.length;++b){var d={},e=[];if(!k.validate(a[b],z,d,e))throw a=Error("Cannot read PKCS#12 BagAttribute."),a.errors=e,a;e=k.derToOid(d.oid);if(void 0!==h.oids[e]){c[h.oids[e]]=[];for(var g=0;g<d.values.length;++g)c[h.oids[e]].push(d.values[g].value)}}return c}var k=c.asn1,h=c.pki,r=c.pkcs12=
549
+c.pkcs12||{},p={name:"ContentInfo",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:k.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,capture:"version"},
550
+p,{name:"PFX.macData",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",
551
+tagClass:k.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:k.Class.UNIVERSAL,type:k.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:k.Class.UNIVERSAL,type:k.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:k.Class.UNIVERSAL,type:k.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},y={name:"SafeBag",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,
552
+value:[{name:"SafeBag.bagId",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:k.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:k.Class.UNIVERSAL,type:k.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},z={name:"Attribute",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,
553
+capture:"oid"},{name:"Attribute.attrValues",tagClass:k.Class.UNIVERSAL,type:k.Type.SET,constructed:!0,capture:"values"}]},A={name:"CertBag",tagClass:k.Class.UNIVERSAL,type:k.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:k.Class.UNIVERSAL,type:k.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:k.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:k.Class.UNIVERSAL,type:k.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};
554
+r.pkcs12FromAsn1=function(a,g,p){"string"===typeof g?(p=g,g=!0):void 0===g&&(g=!0);var n={};if(!k.validate(a,u,n,[]))throw g=Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."),g.errors=g,g;var v={version:n.version.charCodeAt(0),safeContents:[],getBags:function(a){var d={},e;"localKeyId"in a?e=a.localKeyId:"localKeyIdHex"in a&&(e=c.util.hexToBytes(a.localKeyIdHex));void 0===e&&!("friendlyName"in a)&&"bagType"in a&&(d[a.bagType]=b(v.safeContents,null,null,a.bagType));void 0!==e&&
555
+(d.localKeyId=b(v.safeContents,"localKeyId",e,a.bagType));"friendlyName"in a&&(d.friendlyName=b(v.safeContents,"friendlyName",a.friendlyName,a.bagType));return d},getBagsByFriendlyName:function(a,c){return b(v.safeContents,"friendlyName",a,c)},getBagsByLocalKeyId:function(a,c){return b(v.safeContents,"localKeyId",a,c)}};if(3!==n.version.charCodeAt(0))throw g=Error("PKCS#12 PFX of version other than 3 not supported."),g.version=n.version.charCodeAt(0),g;if(k.derToOid(n.contentType)!==h.oids.data)throw g=
556
+Error("Only PKCS#12 PFX in password integrity mode supported."),g.oid=k.derToOid(n.contentType),g;a=n.content.value[0];if(a.tagClass!==k.Class.UNIVERSAL||a.type!==k.Type.OCTETSTRING)throw Error("PKCS#12 authSafe content data is not an OCTET STRING.");a=d(a);if(n.mac){var y=null,z=0,q=k.derToOid(n.macAlgorithm);switch(q){case h.oids.sha1:y=c.md.sha1.create();z=20;break;case h.oids.sha256:y=c.md.sha256.create();z=32;break;case h.oids.sha384:y=c.md.sha384.create();z=48;break;case h.oids.sha512:y=c.md.sha512.create();
557
+z=64;break;case h.oids.md5:y=c.md.md5.create(),z=16}if(null===y)throw Error("PKCS#12 uses unsupported MAC algorithm: "+q);var q=new c.util.ByteBuffer(n.macSalt),A="macIterations"in n?parseInt(c.util.bytesToHex(n.macIterations),16):1,z=r.generateKey(p,q,3,A,z,y),q=c.hmac.create();q.start(y,z);q.update(a.value);if(q.getMac().getBytes()!==n.macDigest)throw Error("PKCS#12 MAC could not be verified. Invalid password?");}e(v,a.value,g,p);return v};r.toPkcs12Asn1=function(a,b,d,e){e=e||{};e.saltSize=e.saltSize||
558
+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 g=e.localKeyId,l;if(null!==g)g=c.util.hexToBytes(g);else if(e.generateLocalKeyId)if(b){var p=c.util.isArray(b)?b[0]:b;"string"===typeof p&&(p=h.certificateFromPem(p));g=c.md.sha1.create();g.update(k.toDer(h.certificateToAsn1(p)).getBytes());g=g.digest().getBytes()}else g=c.random.getBytes(20);p=[];null!==
559
+g&&p.push(k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.localKeyId).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,g)])]));"friendlyName"in e&&p.push(k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.friendlyName).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SET,!0,[k.create(k.Class.UNIVERSAL,k.Type.BMPSTRING,!1,e.friendlyName)])]));
560
+0<p.length&&(l=k.create(k.Class.UNIVERSAL,k.Type.SET,!0,p));g=[];p=[];null!==b&&(p=c.util.isArray(b)?b:[b]);for(var n=[],v=0;v<p.length;++v){b=p[v];"string"===typeof b&&(b=h.certificateFromPem(b));var w=0===v?l:void 0;b=h.certificateToAsn1(b);b=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.certBag).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.x509Certificate).getBytes()),
561
+k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,k.toDer(b).getBytes())])])]),w]);n.push(b)}0<n.length&&(b=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,n),b=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.data).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,k.toDer(b).getBytes())])]),g.push(b));b=null;null!==a&&(a=h.wrapRsaPrivateKey(h.privateKeyToAsn1(a)),
562
+b=null===d?k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.keyBag).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[a]),l]):k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.pkcs8ShroudedKeyBag).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[h.encryptPrivateKeyInfo(a,d,e)]),l]),a=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[b]),a=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,
563
+[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.data).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,k.toDer(a).getBytes())])]),g.push(a));l=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,g);var u;e.useMac&&(g=c.md.sha1.create(),u=new c.util.ByteBuffer(c.random.getBytes(e.saltSize)),e=e.count,a=r.generateKey(d,u,3,e,20),d=c.hmac.create(),d.start(g,a),d.update(k.toDer(l).getBytes()),d=d.getMac(),u=k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,
564
+!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.sha1).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.NULL,!1,"")]),k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,d.getBytes())]),k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,u.getBytes()),k.create(k.Class.UNIVERSAL,k.Type.INTEGER,!1,k.integerToDer(e).getBytes())]));return k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,
565
+k.Type.INTEGER,!1,k.integerToDer(3).getBytes()),k.create(k.Class.UNIVERSAL,k.Type.SEQUENCE,!0,[k.create(k.Class.UNIVERSAL,k.Type.OID,!1,k.oidToDer(h.oids.data).getBytes()),k.create(k.Class.CONTEXT_SPECIFIC,0,!0,[k.create(k.Class.UNIVERSAL,k.Type.OCTETSTRING,!1,k.toDer(l).getBytes())])]),u])};r.generateKey=c.pbe.generatePkcs12Key}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,
566
+r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs12)return b.pkcs12;b.defined.pkcs12=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pkcs12}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/pkcs12","require module ./asn1 ./hmac ./oids ./pkcs7asn1 ./pbe ./random ./rsa ./sha1 ./util ./x509".split(" "),
567
+function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=c.asn1,d=c.pki=c.pki||{};d.pemToDer=function(a){a=c.pem.decode(a)[0];if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert PEM to DER; PEM is encrypted.");return c.util.createBuffer(a.body)};d.privateKeyFromPem=function(a){a=c.pem.decode(a)[0];if("PRIVATE KEY"!==a.type&&"RSA PRIVATE KEY"!==a.type){var g=Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');
568
+g.headerType=a.type;throw g;}if(a.procType&&"ENCRYPTED"===a.procType.type)throw Error("Could not convert private key from PEM; PEM is encrypted.");a=b.fromDer(a.body);return d.privateKeyFromAsn1(a)};d.privateKeyToPem=function(a,g){var n={type:"RSA PRIVATE KEY",body:b.toDer(d.privateKeyToAsn1(a)).getBytes()};return c.pem.encode(n,{maxline:g})};d.privateKeyInfoToPem=function(a,d){var g={type:"PRIVATE KEY",body:b.toDer(a).getBytes()};return c.pem.encode(g,{maxline:d})}}if("function"!==typeof c)if("object"===
569
+typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pki)return b.pki;b.defined.pki=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pki}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,
570
+Array.prototype.slice.call(arguments,0))};c("js/pki","require module ./asn1 ./oids ./pbe ./pem ./pbkdf2 ./pkcs12 ./pss ./rsa ./util ./x509".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b=function(a,b,d,e){var h=c.util.createBuffer(),k=a.length>>1,g=k+(a.length&1),l=a.substr(0,g),g=a.substr(k,g);a=c.util.createBuffer();k=c.hmac.create();d=b+d;var p=Math.ceil(e/16);b=Math.ceil(e/20);k.start("MD5",l);l=c.util.createBuffer();a.putBytes(d);
571
+for(var n=0;n<p;++n)k.start(null,null),k.update(a.getBytes()),a.putBuffer(k.digest()),k.start(null,null),k.update(a.bytes()+d),l.putBuffer(k.digest());k.start("SHA1",g);g=c.util.createBuffer();a.clear();a.putBytes(d);for(n=0;n<b;++n)k.start(null,null),k.update(a.getBytes()),a.putBuffer(k.digest()),k.start(null,null),k.update(a.bytes()+d),g.putBuffer(k.digest());h.putBytes(c.util.xorBytes(l.getBytes(),g.getBytes(),e));return h},d=function(a,b,d){d=!1;try{var e=a.deflate(b.fragment.getBytes());b.fragment=
572
+c.util.createBuffer(e);b.length=e.length;d=!0}catch(h){}return d},e=function(a,b,d){d=!1;try{var e=a.inflate(b.fragment.getBytes());b.fragment=c.util.createBuffer(e);b.length=e.length;d=!0}catch(h){}return d},g=function(a,b){var d=0;switch(b){case 1:d=a.getByte();break;case 2:d=a.getInt16();break;case 3:d=a.getInt24();break;case 4:d=a.getInt32()}return c.util.createBuffer(a.getBytes(d))},n=function(a,c,b){a.putInt(b.length(),c<<3);a.putBuffer(b)},k={Versions:{TLS_1_0:{major:3,minor:1},TLS_1_1:{major:3,
573
+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,
574
+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,
575
+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 c=null,b;for(b in k.CipherSuites){var d=k.CipherSuites[b];if(d.id[0]===a.charCodeAt(0)&&d.id[1]===a.charCodeAt(1)){c=d;break}}return c};
576
+k.handleUnexpected=function(a,c){(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,c,b){!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(a,b,d){var e=null,h=a.entity===
577
+k.ConnectionEnd.client;if(38>d)a.error(a,{message:h?"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{b=b.fragment;var l=b.length(),e={version:{major:b.getByte(),minor:b.getByte()},random:c.util.createBuffer(b.getBytes(32)),session_id:g(b,1),extensions:[]};h?(e.cipher_suite=b.getBytes(2),e.compression_method=b.getByte()):(e.cipher_suites=g(b,2),e.compression_methods=
578
+g(b,1));l=d-(l-b.length());if(0<l){for(d=g(b,2);0<d.length();)e.extensions.push({type:[d.getByte(),d.getByte()],data:g(d,2)});if(!h)for(d=0;d<e.extensions.length;++d)if(b=e.extensions[d],0===b.type[0]&&0===b.type[1])for(b=g(b.data,2);0<b.length()&&0===b.getByte();)a.session.extensions.server_name.serverNameList.push(g(b,2).getBytes())}if(a.session.version&&(e.version.major!==a.session.version.major||e.version.minor!==a.session.version.minor))return a.error(a,{message:"TLS version change is disallowed during renegotiation.",
579
+send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.protocol_version}});if(h)a.session.cipherSuite=k.getCipherSuite(e.cipher_suite);else for(d=c.util.createBuffer(e.cipher_suites.bytes());0<d.length()&&(a.session.cipherSuite=k.getCipherSuite(d.getBytes(2)),null===a.session.cipherSuite););if(null===a.session.cipherSuite)return a.error(a,{message:"No cipher suites in common.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.handshake_failure},cipherSuite:c.util.bytesToHex(e.cipher_suite)});
580
+a.session.compressionMethod=h?e.compression_method:k.CompressionMethod.none}return e};k.createSecurityParameters=function(a,c){var b=a.entity===k.ConnectionEnd.client,d=c.random.bytes(),e=b?a.session.sp.client_random:d,b=b?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,
581
+compression_algorithm:a.session.compressionMethod,pre_master_secret:null,master_secret:null,client_random:e,server_random:b}};k.handleServerHello=function(a,c,b){c=k.parseHelloMessage(a,c,b);if(!a.fail){if(c.version.minor<=a.version.minor)a.version.minor=c.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;b=c.session_id.bytes();0<b.length&&b===a.session.id?
582
+(a.expect=y,a.session.resuming=!0,a.session.sp.server_random=c.random.bytes()):(a.expect=h,a.session.resuming=!1,k.createSecurityParameters(a,c));a.session.id=b;a.process()}};k.handleClientHello=function(a,b,d){b=k.parseHelloMessage(a,b,d);if(!a.fail){var e=b.session_id.bytes();d=null;if(a.sessionCache)if(d=a.sessionCache.getSession(e),null===d)e="";else if(d.version.major!==b.version.major||d.version.minor>b.version.minor)d=null,e="";0===e.length&&(e=c.random.getBytes(32));a.session.id=e;a.session.clientHelloVersion=
583
+b.version;a.session.sp={};if(d)a.version=a.session.version=d.version,a.session.sp=d.sp;else{for(var h,e=1;e<k.SupportedVersions.length&&!(h=k.SupportedVersions[e],h.minor<=b.version.minor);++e);a.version={major:h.major,minor:h.minor};a.session.version=a.version}null!==d?(a.expect=B,a.session.resuming=!0,a.session.sp.client_random=b.random.bytes()):(a.expect=!1!==a.verifyClient?N:x,a.session.resuming=!1,k.createSecurityParameters(a,b));a.open=!0;k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,
584
+data:k.createServerHello(a)}));a.session.resuming?(k.queue(a,k.createRecord(a,{type:k.ContentType.change_cipher_spec,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)}))):(k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createCertificate(a)})),a.fail||(k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createServerKeyExchange(a)})),
585
+!1!==a.verifyClient&&k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createCertificateRequest(a)})),k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createServerHelloDone(a)}))));k.flush(a);a.process()}};k.handleCertificate=function(a,b,d){if(3>d)return a.error(a,{message:"Invalid Certificate message. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=g(b.fragment,3);var e,h;b=[];try{for(;0<d.length();)e=
586
+g(d,3),h=c.asn1.fromDer(e),e=c.pki.certificateFromAsn1(h,!0),b.push(e)}catch(l){return a.error(a,{message:"Could not parse certificate list.",cause:l,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate}})}e=a.entity===k.ConnectionEnd.client;!e&&!0!==a.verifyClient||0!==b.length?0===b.length?a.expect=e?r:x:(e?a.session.serverCertificate=b[0]:a.session.clientCertificate=b[0],k.verifyCertificateChain(a,b)&&(a.expect=e?r:x)):a.error(a,{message:e?"No server certificate provided.":
587
+"No client certificate provided.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});a.process()};k.handleServerKeyExchange=function(a,c,b){if(0<b)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=p;a.process()};k.handleClientKeyExchange=function(a,b,d){if(48>d)return a.error(a,{message:"Invalid key parameters. Only RSA is supported.",
588
+send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unsupported_certificate}});b=g(b.fragment,2).getBytes();d=null;if(a.getPrivateKey)try{d=a.getPrivateKey(a,a.session.serverCertificate),d=c.pki.privateKeyFromPem(d)}catch(e){a.error(a,{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 a.error(a,{message:"No private key set.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}});
589
+try{var h=a.session.sp;h.pre_master_secret=d.decrypt(b);var l=a.session.clientHelloVersion;if(l.major!==h.pre_master_secret.charCodeAt(0)||l.minor!==h.pre_master_secret.charCodeAt(1))throw Error("TLS version rollback attack detected.");}catch(e){h.pre_master_secret=c.random.getBytes(48)}a.expect=B;null!==a.session.clientCertificate&&(a.expect=G);a.process()};k.handleCertificateRequest=function(a,c,b){if(3>b)return a.error(a,{message:"Invalid CertificateRequest. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,
590
+description:k.Alert.Description.illegal_parameter}});c=c.fragment;c={certificate_types:g(c,1),certificate_authorities:g(c,2)};a.session.certificateRequest=c;a.expect=u;a.process()};k.handleCertificateVerify=function(a,b,d){if(2>d)return a.error(a,{message:"Invalid CertificateVerify. Message too short.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});d=b.fragment;d.read-=4;b=d.bytes();d.read+=4;d=g(d,2).getBytes();var e=c.util.createBuffer();e.putBuffer(a.session.md5.digest());
591
+e.putBuffer(a.session.sha1.digest());e=e.getBytes();try{if(!a.session.clientCertificate.publicKey.verify(e,d,"NONE"))throw Error("CertificateVerify signature does not match.");a.session.md5.update(b);a.session.sha1.update(b)}catch(h){return a.error(a,{message:"Bad signature in CertificateVerify.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.handshake_failure}})}a.expect=B;a.process()};k.handleServerHelloDone=function(a,b,d){if(0<d)return a.error(a,{message:"Invalid ServerHelloDone message. Invalid length.",
592
+send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.record_overflow}});if(null===a.serverCertificate&&(b={message:"No server certificate provided. Not enough security.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.insufficient_security}},d=a.verify(a,b.alert.description,0,[]),!0!==d)){if(d||0===d)"object"!==typeof d||c.util.isArray(d)?"number"===typeof d&&(b.alert.description=d):(d.message&&(b.message=d.message),d.alert&&(b.alert.description=d.alert));
593
+return a.error(a,b)}null!==a.session.certificateRequest&&(b=k.createRecord(a,{type:k.ContentType.handshake,data:k.createCertificate(a)}),k.queue(a,b));b=k.createRecord(a,{type:k.ContentType.handshake,data:k.createClientKeyExchange(a)});k.queue(a,b);a.expect=D;b=function(a,c){null!==a.session.certificateRequest&&null!==a.session.clientCertificate&&k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createCertificateVerify(a,c)}));k.queue(a,k.createRecord(a,{type:k.ContentType.change_cipher_spec,
594
+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=y;k.flush(a);a.process()};if(null===a.session.certificateRequest||null===a.session.clientCertificate)return b(a,null);k.getClientSignature(a,b)};k.handleChangeCipherSpec=function(a,c){if(1!==c.fragment.getByte())return a.error(a,{message:"Invalid ChangeCipherSpec message received.",send:!0,
595
+alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.illegal_parameter}});var b=a.entity===k.ConnectionEnd.client;if(a.session.resuming&&b||!a.session.resuming&&!b)a.state.pending=k.createConnectionState(a);a.state.current.read=a.state.pending.read;if(!a.session.resuming&&b||a.session.resuming&&!b)a.state.pending=null;a.expect=b?z:H;a.process()};k.handleFinished=function(a,d,e){e=d.fragment;e.read-=4;var h=e.bytes();e.read+=4;d=d.fragment.getBytes();e=c.util.createBuffer();e.putBuffer(a.session.md5.digest());
596
+e.putBuffer(a.session.sha1.digest());var g=a.entity===k.ConnectionEnd.client;e=b(a.session.sp.master_secret,g?"server finished":"client finished",e.getBytes(),12);if(e.getBytes()!==d)return a.error(a,{message:"Invalid verify_data in Finished message.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.decrypt_error}});a.session.md5.update(h);a.session.sha1.update(h);if(a.session.resuming&&g||!a.session.resuming&&!g)k.queue(a,k.createRecord(a,{type:k.ContentType.change_cipher_spec,
597
+data:k.createChangeCipherSpec()})),a.state.current.write=a.state.pending.write,a.state.pending=null,k.queue(a,k.createRecord(a,{type:k.ContentType.handshake,data:k.createFinished(a)}));a.expect=g?A:aa;a.handshaking=!1;++a.handshakes;a.peerCertificate=g?a.session.serverCertificate:a.session.clientCertificate;k.flush(a);a.isConnected=!0;a.connected(a);a.process()};k.handleAlert=function(a,c){var b=c.fragment,b={level:b.getByte(),description:b.getByte()},d;switch(b.description){case k.Alert.Description.close_notify:d=
598
+"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=
599
+"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=
600
+"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.";
601
+break;case k.Alert.Description.no_renegotiation:d="Renegotiation not supported.";break;default:d="Unknown error."}if(b.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:b});a.process()};k.handleHandshake=function(a,b){var d=b.fragment,e=d.getByte(),h=d.getInt24();if(h>d.length())return a.fragmented=b,b.fragment=c.util.createBuffer(),d.read-=4,a.process();a.fragmented=null;d.read-=4;var g=d.bytes(h+
602
+4);d.read+=4;e in V[a.entity][a.expect]?(a.entity!==k.ConnectionEnd.server||a.open||a.fail||(a.handshaking=!0,a.session={version:null,extensions:{server_name:{serverNameList:[]}},cipherSuite:null,compressionMethod:null,serverCertificate:null,clientCertificate:null,md5:c.md.md5.create(),sha1:c.md.sha1.create()}),e!==k.HandshakeType.hello_request&&e!==k.HandshakeType.certificate_verify&&e!==k.HandshakeType.finished&&(a.session.md5.update(g),a.session.sha1.update(g)),V[a.entity][a.expect][e](a,b,h)):
603
+k.handleUnexpected(a,b)};k.handleApplicationData=function(a,c){a.data.putBuffer(c.fragment);a.dataReady(a);a.process()};k.handleHeartbeat=function(a,b){var d=b.fragment,e=d.getByte(),h=d.getInt16(),d=d.getBytes(h);if(e===k.HeartbeatMessageType.heartbeat_request){if(a.handshaking||h>d.length)return a.process();k.queue(a,k.createRecord(a,{type:k.ContentType.heartbeat,data:k.createHeartbeat(k.HeartbeatMessageType.heartbeat_response,d)}));k.flush(a)}else if(e===k.HeartbeatMessageType.heartbeat_response){if(d!==
604
+a.expectedHeartbeatPayload)return a.process();a.heartbeatReceived&&a.heartbeatReceived(a,c.util.createBuffer(d))}a.process()};var h=1,r=2,p=3,u=4,y=5,z=6,A=7,D=8,N=1,x=2,G=3,B=4,H=5,aa=6,q=k.handleUnexpected,P=k.handleChangeCipherSpec,M=k.handleAlert,K=k.handleHandshake,S=k.handleApplicationData,L=k.handleHeartbeat,R=[];R[k.ConnectionEnd.client]=[[q,M,K,q,L],[q,M,K,q,L],[q,M,K,q,L],[q,M,K,q,L],[q,M,K,q,L],[P,M,q,q,L],[q,M,K,q,L],[q,M,K,S,L],[q,M,K,q,L]];R[k.ConnectionEnd.server]=[[q,M,K,q,L],[q,M,
605
+K,q,L],[q,M,K,q,L],[q,M,K,q,L],[P,M,q,q,L],[q,M,K,q,L],[q,M,K,S,L],[q,M,K,q,L]];var P=k.handleHelloRequest,M=k.handleCertificate,K=k.handleServerKeyExchange,S=k.handleCertificateRequest,L=k.handleServerHelloDone,W=k.handleFinished,V=[];V[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],[P,q,q,q,q,q,q,q,q,q,q,M,K,S,L,q,q,q,q,q,q],[P,q,q,q,q,q,q,q,q,q,q,q,K,S,L,q,q,q,q,q,q],[P,q,q,q,q,q,q,q,q,q,q,q,q,S,L,q,q,q,q,q,q],[P,q,q,q,q,q,q,q,q,q,q,q,q,q,L,q,q,q,q,q,q],
606
+[P,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[P,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,W],[P,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q],[P,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q,q]];V[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,M,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,q,q,q,
607
+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,c){var d=c.client_random+c.server_random;a.session.resuming||(c.master_secret=b(c.pre_master_secret,"master secret",d,48).bytes(),c.pre_master_secret=null);var d=c.server_random+c.client_random,e=2*c.mac_key_length+2*c.enc_key_length,h=a.version.major===k.Versions.TLS_1_0.major&&a.version.minor===k.Versions.TLS_1_0.minor;h&&(e+=2*c.fixed_iv_length);d=
608
+b(c.master_secret,"key expansion",d,e);e={client_write_MAC_key:d.getBytes(c.mac_key_length),server_write_MAC_key:d.getBytes(c.mac_key_length),client_write_key:d.getBytes(c.enc_key_length),server_write_key:d.getBytes(c.enc_key_length)};h&&(e.client_write_IV=d.getBytes(c.fixed_iv_length),e.server_write_IV=d.getBytes(c.fixed_iv_length));return e};k.createConnectionState=function(a){var c=a.entity===k.ConnectionEnd.client,b=function(){var a={sequenceNumber:[0,0],macKey:null,macLength:0,macFunction:null,
609
+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},h={read:b(),write:b()};h.read.update=function(a,c){h.read.cipherFunction(c,h.read)?h.read.compressFunction(a,c,h.read)||a.error(a,{message:"Could not decompress record.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.decompression_failure}}):
610
+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};h.write.update=function(a,c){h.write.compressFunction(a,c,h.write)?h.write.cipherFunction(c,h.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}});
611
+return!a.fail};if(a.session)switch(b=a.session.sp,a.session.cipherSuite.initSecurityParameters(b),b.keys=k.generateKeys(a,b),h.read.macKey=c?b.keys.server_write_MAC_key:b.keys.client_write_MAC_key,h.write.macKey=c?b.keys.client_write_MAC_key:b.keys.server_write_MAC_key,a.session.cipherSuite.initConnectionState(h,a,b),b.compression_algorithm){case k.CompressionMethod.none:break;case k.CompressionMethod.deflate:h.read.compressFunction=e;h.write.compressFunction=d;break;default:throw Error("Unsupported compression algorithm.");
612
+}return h};k.createRandom=function(){var a=new Date,a=+a+6E4*a.getTimezoneOffset(),b=c.util.createBuffer();b.putInt32(a);b.putBytes(c.random.getBytes(28));return b};k.createRecord=function(a,c){return c.data?{type:c.type,version:{major:a.version.major,minor:a.version.minor},length:c.data.length(),fragment:c.data}:null};k.createAlert=function(a,b){var d=c.util.createBuffer();d.putByte(b.level);d.putByte(b.description);return k.createRecord(a,{type:k.ContentType.alert,data:d})};k.createClientHello=
613
+function(a){a.session.clientHelloVersion={major:a.version.major,minor:a.version.minor};for(var b=c.util.createBuffer(),d=0;d<a.cipherSuites.length;++d){var e=a.cipherSuites[d];b.putByte(e.id[0]);b.putByte(e.id[1])}var h=b.length(),d=c.util.createBuffer();d.putByte(k.CompressionMethod.none);var g=d.length(),e=c.util.createBuffer();if(a.virtualHost){var l=c.util.createBuffer();l.putByte(0);l.putByte(0);var p=c.util.createBuffer();p.putByte(0);n(p,2,c.util.createBuffer(a.virtualHost));var q=c.util.createBuffer();
614
+n(q,2,p);n(l,2,q);e.putBuffer(l)}l=e.length();0<l&&(l+=2);p=a.session.id;h=p.length+1+2+4+28+2+h+1+g+l;g=c.util.createBuffer();g.putByte(k.HandshakeType.client_hello);g.putInt24(h);g.putByte(a.version.major);g.putByte(a.version.minor);g.putBytes(a.session.sp.client_random);n(g,1,c.util.createBuffer(p));n(g,2,b);n(g,1,d);0<l&&n(g,2,e);return g};k.createServerHello=function(a){var b=a.session.id,d=b.length+1+2+4+28+2+1,e=c.util.createBuffer();e.putByte(k.HandshakeType.server_hello);e.putInt24(d);e.putByte(a.version.major);
615
+e.putByte(a.version.minor);e.putBytes(a.session.sp.server_random);n(e,1,c.util.createBuffer(b));e.putByte(a.session.cipherSuite.id[0]);e.putByte(a.session.cipherSuite.id[1]);e.putByte(a.session.compressionMethod);return e};k.createCertificate=function(a){var b=a.entity===k.ConnectionEnd.client,d=null;a.getCertificate&&(d=a.getCertificate(a,b?a.session.certificateRequest:a.session.extensions.server_name.serverNameList));var e=c.util.createBuffer();if(null!==d)try{c.util.isArray(d)||(d=[d]);for(var h=
616
+null,g=0;g<d.length;++g){var l=c.pem.decode(d[g])[0];if("CERTIFICATE"!==l.type&&"X509 CERTIFICATE"!==l.type&&"TRUSTED CERTIFICATE"!==l.type){var p=Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');p.headerType=l.type;throw p;}if(l.procType&&"ENCRYPTED"===l.procType.type)throw Error("Could not convert certificate from PEM; PEM is encrypted.");var q=c.util.createBuffer(l.body);null===h&&(h=c.asn1.fromDer(q.bytes(),!1));
617
+var r=c.util.createBuffer();n(r,3,q);e.putBuffer(r)}d=c.pki.certificateFromAsn1(h);b?a.session.clientCertificate=d:a.session.serverCertificate=d}catch(v){return a.error(a,{message:"Could not send certificate list.",cause:v,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate}})}a=3+e.length();b=c.util.createBuffer();b.putByte(k.HandshakeType.certificate);b.putInt24(a);n(b,3,e);return b};k.createClientKeyExchange=function(a){var b=c.util.createBuffer();b.putByte(a.session.clientHelloVersion.major);
618
+b.putByte(a.session.clientHelloVersion.minor);b.putBytes(c.random.getBytes(46));var d=a.session.sp;d.pre_master_secret=b.getBytes();b=a.session.serverCertificate.publicKey.encrypt(d.pre_master_secret);a=b.length+2;d=c.util.createBuffer();d.putByte(k.HandshakeType.client_key_exchange);d.putInt24(a);d.putInt16(b.length);d.putBytes(b);return d};k.createServerKeyExchange=function(a){return c.util.createBuffer()};k.getClientSignature=function(a,b){var d=c.util.createBuffer();d.putBuffer(a.session.md5.digest());
619
+d.putBuffer(a.session.sha1.digest());d=d.getBytes();a.getSignature=a.getSignature||function(a,b,d){var e=null;if(a.getPrivateKey)try{e=a.getPrivateKey(a,a.session.clientCertificate),e=c.pki.privateKeyFromPem(e)}catch(h){a.error(a,{message:"Could not get private key.",cause:h,send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}})}null===e?a.error(a,{message:"No private key set.",send:!0,alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.internal_error}}):
620
+b=e.sign(b,null);d(a,b)};a.getSignature(a,d,b)};k.createCertificateVerify=function(a,b){var d=b.length+2,e=c.util.createBuffer();e.putByte(k.HandshakeType.certificate_verify);e.putInt24(d);e.putInt16(b.length);e.putBytes(b);return e};k.createCertificateRequest=function(a){var b=c.util.createBuffer();b.putByte(1);var d=c.util.createBuffer(),e;for(e in a.caStore.certs){var h=c.pki.distinguishedNameToAsn1(a.caStore.certs[e].subject);d.putBuffer(c.asn1.toDer(h))}a=1+b.length()+2+d.length();e=c.util.createBuffer();
621
+e.putByte(k.HandshakeType.certificate_request);e.putInt24(a);n(e,1,b);n(e,2,d);return e};k.createServerHelloDone=function(a){a=c.util.createBuffer();a.putByte(k.HandshakeType.server_hello_done);a.putInt24(0);return a};k.createChangeCipherSpec=function(){var a=c.util.createBuffer();a.putByte(1);return a};k.createFinished=function(a){var d=c.util.createBuffer();d.putBuffer(a.session.md5.digest());d.putBuffer(a.session.sha1.digest());d=b(a.session.sp.master_secret,a.entity===k.ConnectionEnd.client?"client finished":
622
+"server finished",d.getBytes(),12);a=c.util.createBuffer();a.putByte(k.HandshakeType.finished);a.putInt24(d.length());a.putBuffer(d);return a};k.createHeartbeat=function(a,b,d){"undefined"===typeof d&&(d=b.length);var e=c.util.createBuffer();e.putByte(a);e.putInt16(d);e.putBytes(b);a=e.length();e.putBytes(c.random.getBytes(Math.max(16,a-d-3)));return e};k.queue=function(a,b){if(b){if(b.type===k.ContentType.handshake){var d=b.fragment.bytes();a.session.md5.update(d);a.session.sha1.update(d)}if(b.fragment.length()<=
623
+k.MaxFragment)d=[b];else{for(var d=[],e=b.fragment.bytes();e.length>k.MaxFragment;)d.push(k.createRecord(a,{type:b.type,data:c.util.createBuffer(e.slice(0,k.MaxFragment))})),e=e.slice(k.MaxFragment);0<e.length&&d.push(k.createRecord(a,{type:b.type,data:c.util.createBuffer(e)}))}for(e=0;e<d.length&&!a.fail;++e){var h=d[e];a.state.current.write.update(a,h)&&a.records.push(h)}}};k.flush=function(a){for(var c=0;c<a.records.length;++c){var b=a.records[c];a.tlsData.putByte(b.type);a.tlsData.putByte(b.version.major);
624
+a.tlsData.putByte(b.version.minor);a.tlsData.putInt16(b.fragment.length());a.tlsData.putBuffer(a.records[c].fragment)}a.records=[];return a.tlsDataReady(a)};var U=function(a){switch(a){case !0:return!0;case c.pki.certificateError.bad_certificate:return k.Alert.Description.bad_certificate;case c.pki.certificateError.unsupported_certificate:return k.Alert.Description.unsupported_certificate;case c.pki.certificateError.certificate_revoked:return k.Alert.Description.certificate_revoked;case c.pki.certificateError.certificate_expired:return k.Alert.Description.certificate_expired;
625
+case c.pki.certificateError.certificate_unknown:return k.Alert.Description.certificate_unknown;case c.pki.certificateError.unknown_ca:return k.Alert.Description.unknown_ca;default:return k.Alert.Description.bad_certificate}},X=function(a){switch(a){case !0:return!0;case k.Alert.Description.bad_certificate:return c.pki.certificateError.bad_certificate;case k.Alert.Description.unsupported_certificate:return c.pki.certificateError.unsupported_certificate;case k.Alert.Description.certificate_revoked:return c.pki.certificateError.certificate_revoked;
626
+case k.Alert.Description.certificate_expired:return c.pki.certificateError.certificate_expired;case k.Alert.Description.certificate_unknown:return c.pki.certificateError.certificate_unknown;case k.Alert.Description.unknown_ca:return c.pki.certificateError.unknown_ca;default:return c.pki.certificateError.bad_certificate}};k.verifyCertificateChain=function(a,b){try{c.pki.verifyCertificateChain(a.caStore,b,function(b,d,e){U(b);d=a.verify(a,b,d,e);if(!0!==d){if("object"===typeof d&&!c.util.isArray(d))throw b=
627
+Error("The application rejected the certificate."),b.send=!0,b.alert={level:k.Alert.Level.fatal,description:k.Alert.Description.bad_certificate},d.message&&(b.message=d.message),d.alert&&(b.alert.description=d.alert),b;d!==b&&(d=X(d))}return d})}catch(d){var e=d;if("object"!==typeof e||c.util.isArray(e))e={send:!0,alert:{level:k.Alert.Level.fatal,description:U(d)}};"send"in e||(e.send=!0);"alert"in e||(e.alert={level:k.Alert.Level.fatal,description:U(e.error)});a.error(a,e)}return!a.fail};k.createSessionCache=
628
+function(a,b){var d=null;if(a&&a.getSession&&a.setSession&&a.order)d=a;else{d={};d.cache=a||{};d.capacity=Math.max(b||100,1);d.order=[];for(var e in a)d.order.length<=b?d.order.push(e):delete a[e];d.getSession=function(a){var b=null,e=null;a?e=c.util.bytesToHex(a):0<d.order.length&&(e=d.order[0]);if(null!==e&&e in d.cache){b=d.cache[e];delete d.cache[e];for(var h in d.order)if(d.order[h]===e){d.order.splice(h,1);break}}return b};d.setSession=function(a,b){if(d.order.length===d.capacity){var e=d.order.shift();
629
+delete d.cache[e]}e=c.util.bytesToHex(a);d.order.push(e);d.cache[e]=b}}return d};k.createConnection=function(a){var b=null,b=a.caStore?c.util.isArray(a.caStore)?c.pki.createCaStore(a.caStore):a.caStore:c.pki.createCaStore(),d=a.cipherSuites||null;if(null===d){var d=[],e;for(e in k.CipherSuites)d.push(k.CipherSuites[e])}e=a.server?k.ConnectionEnd.server:k.ConnectionEnd.client;var h=a.sessionCache?k.createSessionCache(a.sessionCache):null,g={version:{major:k.Version.major,minor:k.Version.minor},entity:e,
630
+sessionId:a.sessionId,caStore:b,sessionCache:h,cipherSuites:d,connected:a.connected,virtualHost:a.virtualHost||null,verifyClient:a.verifyClient||!1,verify:a.verify||function(a,c,b,d){return c},getCertificate:a.getCertificate||null,getPrivateKey:a.getPrivateKey||null,getSignature:a.getSignature||null,input:c.util.createBuffer(),tlsData:c.util.createBuffer(),data:c.util.createBuffer(),tlsDataReady:a.tlsDataReady,dataReady:a.dataReady,heartbeatReceived:a.heartbeatReceived,closed:a.closed,error:function(c,
631
+b){b.origin=b.origin||(c.entity===k.ConnectionEnd.client?"client":"server");b.send&&(k.queue(c,k.createAlert(c,b.alert)),k.flush(c));var d=!1!==b.fatal;d&&(c.fail=!0);a.error(c,b);d&&c.close(!1)},deflate:a.deflate||null,inflate:a.inflate||null,reset:function(a){g.version={major:k.Version.major,minor:k.Version.minor};g.record=null;g.session=null;g.peerCertificate=null;g.state={pending:null,current:null};g.expect=0;g.fragmented=null;g.records=[];g.open=!1;g.handshakes=0;g.handshaking=!1;g.isConnected=
632
+!1;g.fail=!(a||"undefined"===typeof a);g.input.clear();g.tlsData.clear();g.data.clear();g.state.current=k.createConnectionState(g)}};g.reset();g.handshake=function(a){if(g.entity!==k.ConnectionEnd.client)g.error(g,{message:"Cannot initiate handshake as a server.",fatal:!1});else if(g.handshaking)g.error(g,{message:"Handshake already in progress.",fatal:!1});else{g.fail&&!g.open&&0===g.handshakes&&(g.fail=!1);g.handshaking=!0;a=a||"";var b=null;0<a.length&&(g.sessionCache&&(b=g.sessionCache.getSession(a)),
633
+null===b&&(a=""));0===a.length&&g.sessionCache&&(b=g.sessionCache.getSession(),null!==b&&(a=b.id));g.session={id:a,version:null,cipherSuite:null,compressionMethod:null,serverCertificate:null,certificateRequest:null,clientCertificate:null,sp:{},md5:c.md.md5.create(),sha1:c.md.sha1.create()};b&&(g.version=b.version,g.session.sp=b.sp);g.session.sp.client_random=k.createRandom().getBytes();g.open=!0;k.queue(g,k.createRecord(g,{type:k.ContentType.handshake,data:k.createClientHello(g)}));k.flush(g)}};g.process=
634
+function(a){var b=0;a&&g.input.putBytes(a);if(!g.fail){null!==g.record&&g.record.ready&&g.record.fragment.isEmpty()&&(g.record=null);if(null===g.record){b=0;a=g.input;var d=a.length();5>d?b=5-d:(g.record={type:a.getByte(),version:{major:a.getByte(),minor:a.getByte()},length:a.getInt16(),fragment:c.util.createBuffer(),ready:!1},(a=g.record.version.major===g.version.major)&&g.session&&g.session.version&&(a=g.record.version.minor===g.version.minor),a||g.error(g,{message:"Incompatible TLS version.",send:!0,
635
+alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.protocol_version}}))}if(!g.fail&&null!==g.record&&!g.record.ready){b=g;a=0;var d=b.input,e=d.length();e<b.record.length?a=b.record.length-e:(b.record.fragment.putBytes(d.getBytes(b.record.length)),d.compact(),b.state.current.read.update(b,b.record)&&(null!==b.fragmented&&(b.fragmented.type===b.record.type?(b.fragmented.fragment.putBuffer(b.record.fragment),b.record=b.fragmented):b.error(b,{message:"Invalid fragmented record.",send:!0,
636
+alert:{level:k.Alert.Level.fatal,description:k.Alert.Description.unexpected_message}})),b.record.ready=!0));b=a}if(!g.fail&&null!==g.record&&g.record.ready)if(a=g.record,d=a.type-k.ContentType.change_cipher_spec,e=R[g.entity][g.expect],d in e)e[d](g,a);else k.handleUnexpected(g,a)}return b};g.prepare=function(a){k.queue(g,k.createRecord(g,{type:k.ContentType.application_data,data:c.util.createBuffer(a)}));return k.flush(g)};g.prepareHeartbeatRequest=function(a,b){a instanceof c.util.ByteBuffer&&(a=
637
+a.bytes());"undefined"===typeof b&&(b=a.length);g.expectedHeartbeatPayload=a;k.queue(g,k.createRecord(g,{type:k.ContentType.heartbeat,data:k.createHeartbeat(k.HeartbeatMessageType.heartbeat_request,a,b)}));return k.flush(g)};g.close=function(a){if(!g.fail&&g.sessionCache&&g.session){var c={id:g.session.id,version:g.session.version,sp:g.session.sp};c.sp.keys=null;g.sessionCache.setSession(c.id,c)}if(g.open){g.open=!1;g.input.clear();if(g.isConnected||g.handshaking)g.isConnected=g.handshaking=!1,k.queue(g,
638
+k.createAlert(g,{level:k.Alert.Level.warning,description:k.Alert.Description.close_notify})),k.flush(g);g.closed(g)}g.reset(a)};return g};c.tls=c.tls||{};for(var T in k)"function"!==typeof k[T]&&(c.tls[T]=k[T]);c.tls.prf_tls1=b;c.tls.hmac_sha1=function(a,b,d){var e=c.hmac.create();e.start("SHA1",a);a=c.util.createBuffer();a.putInt32(b[0]);a.putInt32(b[1]);a.putByte(d.type);a.putByte(d.version.major);a.putByte(d.version.minor);a.putInt16(d.length);a.putBytes(d.fragment.bytes());e.update(a.getBytes());
639
+return e.digest().getBytes()};c.tls.createSessionCache=k.createSessionCache;c.tls.createConnection=k.createConnection}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.tls)return b.tls;b.defined.tls=!0;for(var g=0;g<e.length;++g)e[g](b);return b.tls}},
640
+u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/tls","require module ./asn1 ./hmac ./md ./pem ./pki ./random ./util".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,e,h){e=e.entity===c.tls.ConnectionEnd.client;a.read.cipherState={init:!1,cipher:c.cipher.createDecipher("AES-CBC",
641
+e?h.keys.server_write_key:h.keys.client_write_key),iv:e?h.keys.server_write_IV:h.keys.client_write_IV};a.write.cipherState={init:!1,cipher:c.cipher.createCipher("AES-CBC",e?h.keys.client_write_key:h.keys.server_write_key),iv:e?h.keys.client_write_IV:h.keys.server_write_IV};a.read.cipherFunction=n;a.write.cipherFunction=d;a.read.macLength=a.write.macLength=h.mac_length;a.read.macFunction=a.write.macFunction=k.hmac_sha1}function d(a,b){var h=!1,g=b.macFunction(b.macKey,b.sequenceNumber,a);a.fragment.putBytes(g);
642
+b.updateSequenceNumber();g=a.version.minor===k.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:c.random.getBytesSync(16);b.cipherState.init=!0;var l=b.cipherState.cipher;l.start({iv:g});a.version.minor>=k.Versions.TLS_1_1.minor&&l.output.putBytes(g);l.update(a.fragment);l.finish(e)&&(a.fragment=l.output,a.length=a.fragment.length(),h=!0);return h}function e(a,c,b){b||(a-=c.length()%a,c.fillWithByte(a-1,a));return!0}function g(a,c,b){a=!0;if(b){b=c.length();for(var d=c.last(),e=b-1-
643
+d;e<b-1;++e)a=a&&c.at(e)==d;a&&c.truncate(d+1)}return a}function n(a,b){var d=!1;++h;d=a.version.minor===k.Versions.TLS_1_0.minor?b.cipherState.init?null:b.cipherState.iv:a.fragment.getBytes(16);b.cipherState.init=!0;var e=b.cipherState.cipher;e.start({iv:d});e.update(a.fragment);var d=e.finish(g),l=b.macLength,r=c.random.getBytesSync(l),w=e.output.length();w>=l?(a.fragment=e.output.getBytes(w-l),r=e.output.getBytes(l)):a.fragment=e.output.getBytes();a.fragment=c.util.createBuffer(a.fragment);a.length=
644
+a.fragment.length();l=b.macFunction(b.macKey,b.sequenceNumber,a);b.updateSequenceNumber();e=b.macKey;w=c.hmac.create();w.start("SHA1",e);w.update(r);r=w.digest().getBytes();w.start(null,null);w.update(l);l=w.digest().getBytes();return r===l&&d}var k=c.tls;k.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=k.BulkCipherAlgorithm.aes;a.cipher_type=k.CipherType.block;a.enc_key_length=16;a.block_length=16;
645
+a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=k.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=20},initConnectionState:b};k.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=k.BulkCipherAlgorithm.aes;a.cipher_type=k.CipherType.block;a.enc_key_length=32;a.block_length=16;a.fixed_iv_length=16;a.record_iv_length=16;a.mac_algorithm=k.MACAlgorithm.hmac_sha1;a.mac_length=20;a.mac_key_length=
646
+20},initConnectionState:b};var h=0}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.aesCipherSuites)return b.aesCipherSuites;b.defined.aesCipherSuites=!0;for(var g=0;g<e.length;++g)e[g](b);return b.aesCipherSuites}},u=c;c=function(a,b){n="string"===
647
+typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/aesCipherSuites",["require","module","./aes","./tls"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.debug=c.debug||{};c.debug.storage={};c.debug.get=function(a,b){var d;"undefined"===typeof a?d=c.debug.storage:a in c.debug.storage&&(d="undefined"===typeof b?c.debug.storage[a]:
648
+c.debug.storage[a][b]);return d};c.debug.set=function(a,b,d){a in c.debug.storage||(c.debug.storage[a]={});c.debug.storage[a][b]=d};c.debug.clear=function(a,b){"undefined"===typeof a?c.debug.storage={}:a in c.debug.storage&&("undefined"===typeof b?delete c.debug.storage[a]:delete c.debug.storage[a][b])}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=
649
+function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.debug)return b.debug;b.defined.debug=!0;for(var g=0;g<e.length;++g)e[g](b);return b.debug}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/debug",["require","module"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();
650
+(function(){function a(c){function b(a,d,g,k){a.generate=function(a,b){for(var e=new c.util.ByteBuffer,l=Math.ceil(b/k)+g,n=new c.util.ByteBuffer,r=g;r<l;++r){n.putInt32(r);d.start();d.update(a+n.getBytes());var w=d.digest();e.putBytes(w.getBytes(k))}e.truncate(e.length()-b);return e.getBytes()}}c.kem=c.kem||{};var d=c.jsbn.BigInteger;c.kem.rsa={};c.kem.rsa.create=function(a,b){b=b||{};var g=b.prng||c.random;return{encrypt:function(b,h){var l=Math.ceil(b.n.bitLength()/8),p;do p=(new d(c.util.bytesToHex(g.getBytesSync(l)),
651
+16)).mod(b.n);while(p.equals(d.ZERO));p=c.util.hexToBytes(p.toString(16));l-=p.length;0<l&&(p=c.util.fillString(String.fromCharCode(0),l)+p);l=b.encrypt(p,"NONE");p=a.generate(p,h);return{encapsulation:l,key:p}},decrypt:function(c,b,d){c=c.decrypt(b,"NONE");return a.generate(c,d)}}};c.kem.kdf1=function(a,c){b(this,a,0,c||a.digestLength)};c.kem.kdf2=function(a,c){b(this,a,1,c||a.digestLength)}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===
652
+typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.kem)return b.kem;b.defined.kem=!0;for(var g=0;g<e.length;++g)e[g](b);return b.kem}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/kem",["require","module","./util","./random",
653
+"./jsbn"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){c.log=c.log||{};c.log.levels="none error warning info debug verbose max".split(" ");var b={},d=[],e=null;c.log.LEVEL_LOCKED=2;c.log.NO_LEVEL_CHECK=4;c.log.INTERPOLATE=8;for(var g=0;g<c.log.levels.length;++g){var n=c.log.levels[g];b[n]={index:g,name:n.toUpperCase()}}c.log.logMessage=function(a){for(var e=b[a.level].index,g=0;g<d.length;++g){var k=d[g];k.flags&c.log.NO_LEVEL_CHECK?k.f(a):e<=b[k.level].index&&
654
+k.f(k,a)}};c.log.prepareStandard=function(a){"standard"in a||(a.standard=b[a.level].name+" ["+a.category+"] "+a.message)};c.log.prepareFull=function(a){if(!("full"in a)){var b=[a.message],b=b.concat([]);a.full=c.util.format.apply(this,b)}};c.log.prepareStandardFull=function(a){"standardFull"in a||(c.log.prepareStandard(a),a.standardFull=a.standard)};n=["error","warning","info","debug","verbose"];for(g=0;g<n.length;++g)(function(a){c.log[a]=function(b,d){var e=Array.prototype.slice.call(arguments).slice(2);
655
+c.log.logMessage({timestamp:new Date,level:a,category:b,message:d,arguments:e})}})(n[g]);c.log.makeLogger=function(a){a={flags:0,f:a};c.log.setLevel(a,"none");return a};c.log.setLevel=function(a,b){var d=!1;if(a&&!(a.flags&c.log.LEVEL_LOCKED))for(var e=0;e<c.log.levels.length;++e)if(b==c.log.levels[e]){a.level=b;d=!0;break}return d};c.log.lock=function(a,b){a.flags="undefined"===typeof b||b?a.flags|c.log.LEVEL_LOCKED:a.flags&~c.log.LEVEL_LOCKED};c.log.addLogger=function(a){d.push(a)};if("undefined"!==
656
+typeof console&&"log"in console){if(console.error&&console.warn&&console.info&&console.debug)var k={error:console.error,warning:console.warn,info:console.info,debug:console.debug,verbose:console.debug},e=function(a,b){c.log.prepareStandard(b);var d=k[b.level],e=[b.standard],e=e.concat(b.arguments.slice());d.apply(console,e)};else e=function(a,b){c.log.prepareStandardFull(b);console.log(b.standardFull)};e=c.log.makeLogger(e);c.log.setLevel(e,"debug");c.log.addLogger(e)}else console={log:function(){}};
657
+null!==e&&(g=c.util.getQueryVariables(),"console.level"in g&&c.log.setLevel(e,g["console.level"].slice(-1)[0]),"console.lock"in g&&"true"==g["console.lock"].slice(-1)[0]&&c.log.lock(e));c.log.consoleLogger=e}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.log)return b.log;
658
+b.defined.log=!0;for(var g=0;g<e.length;++g)e[g](b);return b.log}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/log",["require","module","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a){var d={},e=[];if(!p.validate(a,u.asn1.recipientInfoValidator,d,e))throw a=Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."),
659
+a.errors=e,a;return{version:d.version.charCodeAt(0),issuer:c.pki.RDNAttributesAsArray(d.issuer),serialNumber:c.util.createBuffer(d.serial).toHex(),encryptedContent:{algorithm:p.derToOid(d.encAlgorithm),parameter:d.encParameter.value,content:d.encKey}}}function d(a){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(a.version).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[c.pki.distinguishedNameToAsn1({attributes:a.issuer}),
660
+p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber))]),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.encryptedContent.algorithm).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]),p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,a.encryptedContent.content)])}function e(a){for(var c=[],b=0;b<a.length;++b)c.push(d(a[b]));return c}function g(a){var b=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,
661
+p.Type.INTEGER,!1,p.integerToDer(a.version).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[c.pki.distinguishedNameToAsn1({attributes:a.issuer}),p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,c.util.hexToBytes(a.serialNumber))]),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.digestAlgorithm).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")])]);a.authenticatedAttributesAsn1&&b.value.push(a.authenticatedAttributesAsn1);b.value.push(p.create(p.Class.UNIVERSAL,
662
+p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.signatureAlgorithm).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.NULL,!1,"")]));b.value.push(p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,a.signature));if(0<a.unauthenticatedAttributes.length){for(var d=p.create(p.Class.CONTEXT_SPECIFIC,1,!0,[]),e=0;e<a.unauthenticatedAttributes.length;++e)d.values.push(n(a.unauthenticatedAttributes[e]));b.value.push(d)}return b}function n(a){var b;if(a.type===c.pki.oids.contentType)b=
663
+p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.value).getBytes());else if(a.type===c.pki.oids.messageDigest)b=p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,a.value.bytes());else if(a.type===c.pki.oids.signingTime){b=new Date("Jan 1, 1950 00:00:00Z");var d=new Date("Jan 1, 2050 00:00:00Z"),e=a.value;if("string"===typeof e)var g=Date.parse(e),e=isNaN(g)?13===e.length?p.utcTimeToDate(e):p.generalizedTimeToDate(e):new Date(g);b=e>=b&&e<d?p.create(p.Class.UNIVERSAL,p.Type.UTCTIME,!1,p.dateToUtcTime(e)):
664
+p.create(p.Class.UNIVERSAL,p.Type.GENERALIZEDTIME,!1,p.dateToGeneralizedTime(e))}return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.type).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SET,!0,[b])])}function k(a){return[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(c.pki.oids.data).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.algorithm).getBytes()),p.create(p.Class.UNIVERSAL,
665
+p.Type.OCTETSTRING,!1,a.parameter.getBytes())]),p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,a.content.getBytes())])]}function h(a,b,d){var e={};if(!p.validate(b,d,e,[]))throw a=Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."),a.errors=a,a;if(p.derToOid(e.contentType)!==c.pki.oids.data)throw Error("Unsupported PKCS#7 message. Only wrapped ContentType Data supported.");if(e.encryptedContent){b="";if(c.util.isArray(e.encryptedContent))for(d=
666
+0;d<e.encryptedContent.length;++d){if(e.encryptedContent[d].type!==p.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting encrypted content constructed of only OCTET STRING objects.");b+=e.encryptedContent[d].value}else b=e.encryptedContent;a.encryptedContent={algorithm:p.derToOid(e.encAlgorithm),parameter:c.util.createBuffer(e.encParameter.value),content:c.util.createBuffer(b)}}if(e.content){b="";if(c.util.isArray(e.content))for(d=0;d<e.content.length;++d){if(e.content[d].type!==p.Type.OCTETSTRING)throw Error("Malformed PKCS#7 message, expecting content constructed of only OCTET STRING objects.");
667
+b+=e.content[d].value}else b=e.content;a.content=c.util.createBuffer(b)}a.version=e.version.charCodeAt(0);return a.rawCapture=e}function r(a){if(void 0===a.encryptedContent.key)throw Error("Symmetric key not available.");if(void 0===a.content){var b;switch(a.encryptedContent.algorithm){case c.pki.oids["aes128-CBC"]:case c.pki.oids["aes192-CBC"]:case c.pki.oids["aes256-CBC"]:b=c.aes.createDecryptionCipher(a.encryptedContent.key);break;case c.pki.oids.desCBC:case c.pki.oids["des-EDE3-CBC"]:b=c.des.createDecryptionCipher(a.encryptedContent.key);
668
+break;default:throw Error("Unsupported symmetric cipher, OID "+a.encryptedContent.algorithm);}b.start(a.encryptedContent.parameter);b.update(a.encryptedContent.content);if(!b.finish())throw Error("Symmetric decryption failed.");a.content=b.output}}var p=c.asn1,u=c.pkcs7=c.pkcs7||{};u.messageFromPem=function(a){a=c.pem.decode(a)[0];if("PKCS7"!==a.type){var b=Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".');b.headerType=a.type;throw b;}if(a.procType&&"ENCRYPTED"===
669
+a.procType.type)throw Error("Could not convert PKCS#7 message from PEM; PEM is encrypted.");a=p.fromDer(a.body);return u.messageFromAsn1(a)};u.messageToPem=function(a,b){var d={type:"PKCS7",body:p.toDer(a.toAsn1()).getBytes()};return c.pem.encode(d,{maxline:b})};u.messageFromAsn1=function(a){var b={},d=[];if(!p.validate(a,u.asn1.contentInfoValidator,b,d))throw b=Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."),b.errors=d,b;d=p.derToOid(b.contentType);switch(d){case c.pki.oids.envelopedData:d=
670
+u.createEnvelopedData();break;case c.pki.oids.encryptedData:d=u.createEncryptedData();break;case c.pki.oids.signedData:d=u.createSignedData();break;default:throw Error("Cannot read PKCS#7 message. ContentType with OID "+d+" is not (yet) supported.");}d.fromAsn1(b.content.value[0]);return d};u.createSignedData=function(){var a=null;return a={type:c.pki.oids.signedData,version:1,certificates:[],crls:[],signers:[],digestAlgorithmIdentifiers:[],contentInfo:null,signerInfos:[],fromAsn1:function(b){h(a,
671
+b,u.asn1.signedDataValidator);a.certificates=[];a.crls=[];a.digestAlgorithmIdentifiers=[];a.contentInfo=null;a.signerInfos=[];b=a.rawCapture.certificates.value;for(var d=0;d<b.length;++d)a.certificates.push(c.pki.certificateFromAsn1(b[d]))},toAsn1:function(){a.contentInfo||a.sign();for(var b=[],d=0;d<a.certificates.length;++d)b.push(c.pki.certificateToAsn1(a.certificates[d]));var d=[],e=p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,
672
+p.Type.INTEGER,!1,p.integerToDer(a.version).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SET,!0,a.digestAlgorithmIdentifiers),a.contentInfo])]);0<b.length&&e.value[0].value.push(p.create(p.Class.CONTEXT_SPECIFIC,0,!0,b));0<d.length&&e.value[0].value.push(p.create(p.Class.CONTEXT_SPECIFIC,1,!0,d));e.value[0].value.push(p.create(p.Class.UNIVERSAL,p.Type.SET,!0,a.signerInfos));return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.type).getBytes()),
673
+e])},addSigner:function(b){var d=b.issuer,e=b.serialNumber;b.certificate&&(e=b.certificate,"string"===typeof e&&(e=c.pki.certificateFromPem(e)),d=e.issuer.attributes,e=e.serialNumber);var g=b.key;if(!g)throw Error("Could not add PKCS#7 signer; no private key specified.");"string"===typeof g&&(g=c.pki.privateKeyFromPem(g));var h=b.digestAlgorithm||c.pki.oids.sha1;switch(h){case c.pki.oids.sha1:case c.pki.oids.sha256:case c.pki.oids.sha384:case c.pki.oids.sha512:case c.pki.oids.md5:break;default:throw Error("Could not add PKCS#7 signer; unknown message digest algorithm: "+
674
+h);}b=b.authenticatedAttributes||[];if(0<b.length){for(var k=!1,l=!1,p=0;p<b.length;++p){var n=b[p];if(!k&&n.type===c.pki.oids.contentType){if(k=!0,l)break}else if(!l&&n.type===c.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.");}a.signers.push({key:g,version:1,issuer:d,serialNumber:e,digestAlgorithm:h,
675
+signatureAlgorithm:c.pki.oids.rsaEncryption,signature:null,authenticatedAttributes:b,unauthenticatedAttributes:[]})},sign:function(){if("object"!==typeof a.content||null===a.contentInfo)if(a.contentInfo=p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(c.pki.oids.data).getBytes())]),"content"in a){var b;a.content instanceof c.util.ByteBuffer?b=a.content.bytes():"string"===typeof a.content&&(b=c.util.encodeUtf8(a.content));a.contentInfo.value.push(p.create(p.Class.CONTEXT_SPECIFIC,
676
+0,!0,[p.create(p.Class.UNIVERSAL,p.Type.OCTETSTRING,!1,b)]))}if(0!==a.signers.length){b={};for(var d=0;d<a.signers.length;++d){var e=a.signers[d],h=e.digestAlgorithm;h in b||(b[h]=c.md[c.pki.oids[h]].create());e.md=0===e.authenticatedAttributes.length?b[h]:c.md[c.pki.oids[h]].create()}a.digestAlgorithmIdentifiers=[];for(h in b)a.digestAlgorithmIdentifiers.push(p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(h).getBytes()),p.create(p.Class.UNIVERSAL,
677
+p.Type.NULL,!1,"")]));if(2>a.contentInfo.value.length)throw Error("Could not sign PKCS#7 message; there is no content to sign.");var h=p.derToOid(a.contentInfo.value[0].value),d=a.contentInfo.value[1],d=d.value[0],k=p.toDer(d);k.getByte();p.getBerValueLength(k);var k=k.getBytes(),l;for(l in b)b[l].start().update(k);l=new Date;for(d=0;d<a.signers.length;++d){e=a.signers[d];if(0===e.authenticatedAttributes.length){if(h!==c.pki.oids.data)throw Error("Invalid signer; authenticatedAttributes must be present when the ContentInfo content type is not PKCS#7 Data.");
678
+}else{e.authenticatedAttributesAsn1=p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[]);for(var k=p.create(p.Class.UNIVERSAL,p.Type.SET,!0,[]),r=0;r<e.authenticatedAttributes.length;++r){var w=e.authenticatedAttributes[r];w.type===c.pki.oids.messageDigest?w.value=b[e.digestAlgorithm].digest():w.type!==c.pki.oids.signingTime||w.value||(w.value=l);k.value.push(n(w));e.authenticatedAttributesAsn1.value.push(n(w))}k=p.toDer(k).getBytes();e.md.start().update(k)}e.signature=e.key.sign(e.md,"RSASSA-PKCS1-V1_5")}b=
679
+a;h=a.signers;l=[];for(d=0;d<h.length;++d)l.push(g(h[d]));b.signerInfos=l}},verify:function(){throw Error("PKCS#7 signature verification not yet implemented.");},addCertificate:function(b){"string"===typeof b&&(b=c.pki.certificateFromPem(b));a.certificates.push(b)},addCertificateRevokationList:function(a){throw Error("PKCS#7 CRL support not yet implemented.");}}};u.createEncryptedData=function(){var a=null;return a={type:c.pki.oids.encryptedData,version:0,encryptedContent:{algorithm:c.pki.oids["aes256-CBC"]},
680
+fromAsn1:function(c){h(a,c,u.asn1.encryptedDataValidator)},decrypt:function(c){void 0!==c&&(a.encryptedContent.key=c);r(a)}}};u.createEnvelopedData=function(){var a=null;return a={type:c.pki.oids.envelopedData,version:0,recipients:[],encryptedContent:{algorithm:c.pki.oids["aes256-CBC"]},fromAsn1:function(c){var d=h(a,c,u.asn1.envelopedDataValidator);c=a;for(var d=d.recipientInfos.value,e=[],g=0;g<d.length;++g)e.push(b(d[g]));c.recipients=e},toAsn1:function(){return p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,
681
+!0,[p.create(p.Class.UNIVERSAL,p.Type.OID,!1,p.oidToDer(a.type).getBytes()),p.create(p.Class.CONTEXT_SPECIFIC,0,!0,[p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,[p.create(p.Class.UNIVERSAL,p.Type.INTEGER,!1,p.integerToDer(a.version).getBytes()),p.create(p.Class.UNIVERSAL,p.Type.SET,!0,e(a.recipients)),p.create(p.Class.UNIVERSAL,p.Type.SEQUENCE,!0,k(a.encryptedContent))])])])},findRecipient:function(c){for(var b=c.issuer.attributes,d=0;d<a.recipients.length;++d){var e=a.recipients[d],g=e.issuer;if(e.serialNumber===
682
+c.serialNumber&&g.length===b.length){for(var h=!0,k=0;k<b.length;++k)if(g[k].type!==b[k].type||g[k].value!==b[k].value){h=!1;break}if(h)return e}}return null},decrypt:function(b,d){if(void 0===a.encryptedContent.key&&void 0!==b&&void 0!==d)switch(b.encryptedContent.algorithm){case c.pki.oids.rsaEncryption:case c.pki.oids.desCBC:var e=d.decrypt(b.encryptedContent.content);a.encryptedContent.key=c.util.createBuffer(e);break;default:throw Error("Unsupported asymmetric cipher, OID "+b.encryptedContent.algorithm);
683
+}r(a)},addRecipient:function(b){a.recipients.push({version:0,issuer:b.issuer.attributes,serialNumber:b.serialNumber,encryptedContent:{algorithm:c.pki.oids.rsaEncryption,key:b.publicKey}})},encrypt:function(b,d){if(void 0===a.encryptedContent.content){d=d||a.encryptedContent.algorithm;b=b||a.encryptedContent.key;var e,g,h;switch(d){case c.pki.oids["aes128-CBC"]:g=e=16;h=c.aes.createEncryptionCipher;break;case c.pki.oids["aes192-CBC"]:e=24;g=16;h=c.aes.createEncryptionCipher;break;case c.pki.oids["aes256-CBC"]:e=
684
+32;g=16;h=c.aes.createEncryptionCipher;break;case c.pki.oids["des-EDE3-CBC"]:e=24;g=8;h=c.des.createEncryptionCipher;break;default:throw Error("Unsupported symmetric cipher, OID "+d);}if(void 0===b)b=c.util.createBuffer(c.random.getBytes(e));else if(b.length()!=e)throw Error("Symmetric key has wrong length; got "+b.length()+" bytes, expected "+e+".");a.encryptedContent.algorithm=d;a.encryptedContent.key=b;a.encryptedContent.parameter=c.util.createBuffer(c.random.getBytes(g));e=h(b);e.start(a.encryptedContent.parameter.copy());
685
+e.update(a.content);if(!e.finish())throw Error("Symmetric encryption failed.");a.encryptedContent.content=e.output}for(e=0;e<a.recipients.length;++e)if(g=a.recipients[e],void 0===g.encryptedContent.content)switch(g.encryptedContent.algorithm){case c.pki.oids.rsaEncryption:g.encryptedContent.content=g.encryptedContent.key.encrypt(a.encryptedContent.key.data);break;default:throw Error("Unsupported asymmetric cipher, OID "+g.encryptedContent.algorithm);}}}}}if("function"!==typeof c)if("object"===typeof module&&
686
+module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.pkcs7)return b.pkcs7;b.defined.pkcs7=!0;for(var g=0;g<e.length;++g)e[g](b);return b.pkcs7}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,
687
+Array.prototype.slice.call(arguments,0))};c("js/pkcs7","require module ./aes ./asn1 ./des ./oids ./pem ./pkcs7asn1 ./random ./util ./x509".split(" "),function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){function b(a,d){var e=d.toString(16);"8"<=e[0]&&(e="00"+e);e=c.util.hexToBytes(e);a.putInt32(e.length);a.putBytes(e)}function d(a,c){a.putInt32(c.length);a.putString(c)}function e(){for(var a=c.md.sha1.create(),b=arguments.length,d=0;d<b;++d)a.update(arguments[d]);
688
+return a.digest()}var g=c.ssh=c.ssh||{};g.privateKeyToPutty=function(a,g,h){h=h||"";g=g||"";var n=""===g?"none":"aes256-cbc",p;p="PuTTY-User-Key-File-2: ssh-rsa\r\n"+("Encryption: "+n+"\r\n")+("Comment: "+h+"\r\n");var r=c.util.createBuffer();d(r,"ssh-rsa");b(r,a.e);b(r,a.n);var v=c.util.encode64(r.bytes(),64),u=Math.floor(v.length/66)+1;p+="Public-Lines: "+u+"\r\n";p+=v;v=c.util.createBuffer();b(v,a.d);b(v,a.p);b(v,a.q);b(v,a.qInv);g?(u=v.length()+16-1,u-=u%16,a=e(v.bytes()),a.truncate(a.length()-
689
+u+v.length()),v.putBuffer(a),u=c.util.createBuffer(),u.putBuffer(e("\x00\x00\x00\x00",g)),u.putBuffer(e("\x00\x00\x00\u0001",g)),u=c.aes.createEncryptionCipher(u.truncate(8),"CBC"),u.start(c.util.createBuffer().fillWithByte(0,16)),u.update(v.copy()),u.finish(),u=u.output,u.truncate(16),a=c.util.encode64(u.bytes(),64)):a=c.util.encode64(v.bytes(),64);u=Math.floor(a.length/66)+1;p+="\r\nPrivate-Lines: "+u+"\r\n";p+=a;g=e("putty-private-key-file-mac-key",g);u=c.util.createBuffer();d(u,"ssh-rsa");d(u,
690
+n);d(u,h);u.putInt32(r.length());u.putBuffer(r);u.putInt32(v.length());u.putBuffer(v);h=c.hmac.create();h.start("sha1",g);h.update(u.bytes());return p+="\r\nPrivate-MAC: "+h.digest().toHex()+"\r\n"};g.publicKeyToOpenSSH=function(a,e){e=e||"";var g=c.util.createBuffer();d(g,"ssh-rsa");b(g,a.e);b(g,a.n);return"ssh-rsa "+c.util.encode64(g.bytes())+" "+e};g.privateKeyToOpenSSH=function(a,b){return b?c.pki.encryptRsaPrivateKey(a,b,{legacy:!0,algorithm:"aes128"}):c.pki.privateKeyToPem(a)};g.getPublicKeyFingerprint=
691
+function(a,e){e=e||{};var g=e.md||c.md.md5.create(),n=c.util.createBuffer();d(n,"ssh-rsa");b(n,a.e);b(n,a.n);g.start();g.update(n.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 c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&
692
+(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.ssh)return b.ssh;b.defined.ssh=!0;for(var g=0;g<e.length;++g)e[g](b);return b.ssh}},u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/ssh","require module ./aes ./hmac ./md5 ./sha1 ./util".split(" "),
693
+function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){function a(c){var b={},d=0;c.debug.set("forge.task","tasks",b);var e={};c.debug.set("forge.task","queues",e);var g={ready:{}};g.ready.stop="ready";g.ready.start="running";g.ready.cancel="done";g.ready.fail="error";g.running={};g.running.stop="ready";g.running.start="running";g.running.block="blocked";g.running.unblock="running";g.running.sleep="sleeping";g.running.wakeup="running";g.running.cancel="done";g.running.fail=
694
+"error";g.blocked={};g.blocked.stop="blocked";g.blocked.start="blocked";g.blocked.block="blocked";g.blocked.unblock="blocked";g.blocked.sleep="blocked";g.blocked.wakeup="blocked";g.blocked.cancel="done";g.blocked.fail="error";g.sleeping={};g.sleeping.stop="sleeping";g.sleeping.start="sleeping";g.sleeping.block="sleeping";g.sleeping.unblock="sleeping";g.sleeping.sleep="sleeping";g.sleeping.wakeup="sleeping";g.sleeping.cancel="done";g.sleeping.fail="error";g.done={};g.done.stop="done";g.done.start=
695
+"done";g.done.block="done";g.done.unblock="done";g.done.sleep="done";g.done.wakeup="done";g.done.cancel="done";g.done.fail="error";g.error={};g.error.stop="error";g.error.start="error";g.error.block="error";g.error.unblock="error";g.error.sleep="error";g.error.wakeup="error";g.error.cancel="error";g.error.fail="error";var n=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=
696
+this.timeoutId=null;this.id=d++;b[this.id]=this};n.prototype.debug=function(a){c.log.debug("forge.task",a||"","[%s][%s] task:",this.id,this.name,this,"subtasks:",this.subtasks.length,"queue:",e)};n.prototype.next=function(a,c){"function"===typeof a&&(c=a,a=this.name);var b=new n({run:c,name:a,parent:this});b.state="running";b.type=this.type;b.successCallback=this.successCallback||null;b.failureCallback=this.failureCallback||null;this.subtasks.push(b);return this};n.prototype.parallel=function(a,b){c.util.isArray(a)&&
697
+(b=a,a=this.name);return this.next(a,function(d){d.block(b.length);for(var e=function(a,e){c.task.start({type:a,run:function(a){b[e](a)},success:function(a){d.unblock()},failure:function(a){d.unblock()}})},g=0;g<b.length;g++)e(a+"__parallel-"+d.id+"-"+g,g)})};n.prototype.stop=function(){this.state=g[this.state].stop};n.prototype.start=function(){this.error=!1;this.state=g[this.state].start;"running"===this.state&&(this.start=new Date,this.run(this),h(this,0))};n.prototype.block=function(a){this.blocks+=
698
+"undefined"===typeof a?1:a;0<this.blocks&&(this.state=g[this.state].block)};n.prototype.unblock=function(a){this.blocks-="undefined"===typeof a?1:a;0===this.blocks&&"done"!==this.state&&(this.state="running",h(this,0));return this.blocks};n.prototype.sleep=function(a){this.state=g[this.state].sleep;var c=this;this.timeoutId=setTimeout(function(){c.timeoutId=null;c.state="running";h(c,0)},"undefined"===typeof a?0:a)};n.prototype.wait=function(a){a.wait(this)};n.prototype.wakeup=function(){"sleeping"===
699
+this.state&&(cancelTimeout(this.timeoutId),this.timeoutId=null,this.state="running",h(this,0))};n.prototype.cancel=function(){this.state=g[this.state].cancel;this.permitsNeeded=0;null!==this.timeoutId&&(cancelTimeout(this.timeoutId),this.timeoutId=null);this.subtasks=[]};n.prototype.fail=function(a){this.error=!0;r(this,!0);if(a)a.error=this.error,a.swapTime=this.swapTime,a.userData=this.userData,h(a,0);else{if(null!==this.parent){for(a=this.parent;null!==a.parent;)a.error=this.error,a.swapTime=this.swapTime,
700
+a.userData=this.userData,a=a.parent;r(a,!0)}this.failureCallback&&this.failureCallback(this)}};var k=function(a){a.error=!1;a.state=g[a.state].start;setTimeout(function(){"running"===a.state&&(a.swapTime=+new Date,a.run(a),h(a,0))},0)},h=function(a,c){var b=30<c||20<+new Date-a.swapTime,d=function(c){c++;if("running"===a.state)if(b&&(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||h(d,c)}else r(a),a.error||
701
+null===a.parent||(a.parent.error=a.error,a.parent.swapTime=a.swapTime,a.parent.userData=a.userData,h(a.parent,c))};b?setTimeout(d,0):d(c)},r=function(a,d){a.state="done";delete b[a.id];null===a.parent&&(a.type in e?0===e[a.type].length?c.log.error("forge.task","[%s][%s] task queue empty [%s]",a.id,a.name,a.type):e[a.type][0]!==a?c.log.error("forge.task","[%s][%s] task not first in queue [%s]",a.id,a.name,a.type):(e[a.type].shift(),0===e[a.type].length?delete e[a.type]:e[a.type][0].start()):c.log.error("forge.task",
702
+"[%s][%s] task queue missing [%s]",a.id,a.name,a.type),d||(a.error&&a.failureCallback?a.failureCallback(a):!a.error&&a.successCallback&&a.successCallback(a)))};c.task=c.task||{};c.task.start=function(a){var c=new n({run:a.run,name:a.name||"?"});c.type=a.type;c.successCallback=a.success||null;c.failureCallback=a.failure||null;c.type in e?e[a.type].push(c):(e[c.type]=[c],k(c))};c.task.cancel=function(a){a in e&&(e[a]=[e[a][0]])};c.task.createCondition=function(){var a={tasks:{},wait:function(c){c.id in
703
+a.tasks||(c.block(),a.tasks[c.id]=c)},notify:function(){var c=a.tasks;a.tasks={};for(var b in c)c[b].unblock()}};return a}}if("function"!==typeof c)if("object"===typeof module&&module.exports){var g=!0;c=function(a,c){c(b,module)}}else return"undefined"===typeof forge&&(forge={}),a(forge);var n,r=function(c,b){b.exports=function(b){var e=n.map(function(a){return c(a)}).concat(a);b=b||{};b.defined=b.defined||{};if(b.defined.task)return b.task;b.defined.task=!0;for(var g=0;g<e.length;++g)e[g](b);return b.task}},
704
+u=c;c=function(a,b){n="string"===typeof a?b.slice(2):a.slice(2);if(g)return delete c,u.apply(null,Array.prototype.slice.call(arguments,0));c=u;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("js/task",["require","module","./debug","./log","./util"],function(){r.apply(null,Array.prototype.slice.call(arguments,0))})})();(function(){if("function"!==typeof c)if("object"===typeof module&&module.exports){var a=!0;c=function(a,c){c(b,module)}}else{"undefined"===typeof forge&&(forge={disableNativeCode:!1});
705
+return}var g,n=function(a,c){c.exports=function(c){var b=g.map(function(c){return a(c)});c=c||{};c.defined=c.defined||{};if(c.defined.forge)return c.forge;c.defined.forge=!0;for(var d=0;d<b.length;++d)b[d](c);return c};c.exports.disableNativeCode=!0;c.exports(c.exports)},r=c;c=function(b,m){g="string"===typeof b?m.slice(2):b.slice(2);if(a)return delete c,r.apply(null,Array.prototype.slice.call(arguments,0));c=r;return c.apply(null,Array.prototype.slice.call(arguments,0))};c("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(" "),
706
+function(){n.apply(null,Array.prototype.slice.call(arguments,0))})})();return b("js/forge")});function amtcert_linkCertPrivateKey(a,b){for(var c in a){var d=a[c];try{if(0==xxCertPrivateKeys.length)break;for(var g=forge.pki.publicKeyToPem(forge.pki.certificateFromAsn1(forge.asn1.fromDer(d.X509Certificate)).publicKey).substring(60).replace(/(\r\n|\n|\r)/gm,""),n=0;n<b.length;n++)g===b[n].DERKey+"-----END PUBLIC KEY-----"&&(b[n].XCert=d,d.XPrivateKey=b[n])}catch(r){console.log(r)}}}
707
+function amtcert_loadP12File(a,b,c){try{var d=window.forge.util.decode64(btoa(a)),g=window.forge.asn1.fromDer(d),n=window.forge.pkcs12.pkcs12FromAsn1(g,b),r=n.getBags({bagType:window.forge.pki.oids.pkcs8ShroudedKeyBag});console.assert(r[window.forge.pki.oids.pkcs8ShroudedKeyBag]&&0<r[window.forge.pki.oids.pkcs8ShroudedKeyBag].length);var u=r[window.forge.pki.oids.pkcs8ShroudedKeyBag][0].key,m=window.forge.pki.privateKeyToAsn1(u),l=window.forge.pki.wrapRsaPrivateKey(m);window.forge.asn1.toDer(l).getBytes();
708
+var w=n.getBags({bagType:window.forge.pki.oids.certBag})[window.forge.pki.oids.certBag][0].cert.subject.attributes,e=n.getBags({bagType:forge.pki.oids.certBag})[forge.pki.oids.certBag][0].cert;c(u,w,e);return!0}catch(v){}return!1}function amtcert_signWithCaKey(a,b,c,d,g){b&&null!=b||(b=amtcert_createCertificate(d).key);return amtcert_createCertificate(c,b,a,d,g)}
709
+function amtcert_createCertificate(a,b,c,d,g){var n,r=forge.pki.createCertificate();c?r.publicKey=forge.pki.publicKeyFromPem("-----BEGIN PUBLIC KEY-----"+c+"-----END PUBLIC KEY-----"):(n=forge.pki.rsa.generateKeyPair(2048),r.publicKey=n.publicKey);r.serialNumber=""+Math.floor(1E5*Math.random()+1);r.validity.notBefore=new Date;r.validity.notBefore.setFullYear(r.validity.notBefore.getFullYear()-1);r.validity.notAfter=new Date;r.validity.notAfter.setFullYear(r.validity.notAfter.getFullYear()+30);var u=
710
+[];a.CN&&u.push({name:"commonName",value:a.CN});a.C&&u.push({name:"countryName",value:a.C});a.ST&&u.push({shortName:"ST",value:a.ST});a.O&&u.push({name:"organizationName",value:a.O});r.setSubject(u);b?(a=[],d.CN&&a.push({name:"commonName",value:d.CN}),d.C&&a.push({name:"countryName",value:d.C}),d.ST&&a.push({shortName:"ST",value:d.ST}),d.O&&a.push({name:"organizationName",value:d.O}),r.setIssuer(a)):r.setIssuer(u);void 0==b?r.setExtensions([{name:"basicConstraints",cA:!0},{name:"nsCertType",sslCA:!0,
711
+emailCA:!0,objCA:!0},{name:"subjectKeyIdentifier"}]):(null==g?g={name:"extKeyUsage",serverAuth:!0}:g.name="extKeyUsage",r.setExtensions([{name:"basicConstraints"},{name:"keyUsage",keyCertSign:!0,digitalSignature:!0,nonRepudiation:!0,keyEncipherment:!0,dataEncipherment:!0},g,{name:"nsCertType",client:!0,server:!0,email:!0,objsign:!0},{name:"subjectKeyIdentifier"}]));b?r.sign(b,forge.md.sha256.create()):r.sign(n.privateKey,forge.md.sha256.create());return c?r:{cert:r,key:n.privateKey}}
712
+function _stringToArrayBuffer(a){for(var b=new ArrayBuffer(a.length),c=new Uint8Array(b),d=0,g=a.length;d<g;d++)c[d]=a.charCodeAt(d);return b}function _arrayBufferToString(a){var b="";a=new Uint8Array(a);for(var c=a.byteLength,d=0;d<c;d++)b+=String.fromCharCode(a[d]);return b}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(" ");
713
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(" ");
714
script_functionTableX3=[PullSystemStatus,PullEventLog,PullAuditLog,PullCertificates,PullWatchdog,PullSystemDefense,PullHardware,PullUserInfo,PullRemoteAccess,script_HighlightBlock,,function(a,b){return GetSidString(b)},function(a,b){return GetSidByteArray(b)},PullEventSubscriptions];
715
function script_setup(a,b){var c={startvars:b};if(6>a.length)return console.error("Invalid script length"),null;if(612182341!=ReadInt(a,0))return console.error("Invalid binary script"),null;if(1<ReadShort(a,4))return console.error("Unsupported script version"),null;c.script=a.substring(6);c.reset=function(a){c.stop();c.ip=0;c.variables=b;c.state=1};c.start=function(a){c.stop();c.stepspeed=a;0<a&&(c.timer=setInterval(function(){c.step()},a))};c.stop=function(){null!=c.timer&&clearInterval(c.timer);
715
-c.timer=null;c.stepspeed=0};c.getVar=function(a){return void 0==a?void 0:c.getVarEx(a.split("."),c.variables)};c.getVarEx=function(a,b){try{return void 0==a?void 0:0==a.length?b:c.getVarEx(a.slice(1),b[a[0]])}catch(m){return null}};c.setVar=function(a,b){c.setVarEx(a.split("."),c.variables,b)};c.setVarEx=function(a,b,m){1==a.length?b[a[0]]=m:c.setVarEx(a.slice(1),b[a[0]],m)};c.step=function(){if(1==c.state){if(c.ip<c.script.length){var a=ReadShort(c.script,c.ip),b=ReadShort(c.script,c.ip+2),m=ReadShort(c.script,
716
-c.ip+4),p=c.ip+6,r=[],l;for(l in c.variables)l.startsWith("__")&&delete c.variables[l];for(l=0;l<m;l++){var k=ReadShort(c.script,p),v=c.script.substring(p+2,p+2+k),e=v.charCodeAt(0),v=v.substring(1);if(2>e){for(;1<v.split("{").length;)var u=v.split("{").pop().split("}").shift(),v=v.replace("{"+u+"}",c.getVar(u));1==e&&(c.variables["__"+l]=decodeURI(v),v="__"+l);r.push(v)}if(2==e||3==e)c.variables["__"+l]=ReadSInt(v,0),r.push("__"+l);p+=2+k}c.ip+=b;b=[];for(l=0;10>l;l++)b.push(c.getVar(r[l]));var B;
717
-try{if(1E4>a)switch(a){case 0:break;case 1:if(b[2]){if("<"==b[2]&&b[1]<b[3]||"<="==b[2]&&b[1]<=b[3]||"!="==b[2]&&b[1]!=b[3]||"="==b[2]&&b[1]==b[3]||">="==b[2]&&b[1]>=b[3]||">"==b[2]&&b[1]>b[3])c.ip=b[0]}else c.ip=b[0];break;case 2:void 0==r[1]?delete c.variables[r[0]]:c.setVar(r[0],b[1]);break;case 3:if(c.onConsole)c.onConsole(c.toString(b[0]),c);else console.log(c.toString(b[0]));break;case 4:c.state=2;c.dialog=!0;setDialogMode(11,b[0],b[2],c.xxStepDialogOk,b[1],c);break;case 5:for(l in b[1])b[1][l][b[2]]==
718
-b[3]&&(B=l);break;case 6:B=b[1].substr(b[2],b[3]);break;case 7:B=b[1].indexOf(b[2]);break;case 8:B=b[1].split(b[2]);break;case 9:B=b[1].join(b[2]);break;case 10:B=b[1].length;break;case 11:B=JSON.parse(b[1]);break;case 12:B=JSON.stringify(b[1]);break;case 13:B=b[1]+b[2];break;case 14:B=b[1]-b[2];break;case 15:B=parseInt(b[1]);break;case 16:c.state=2;c.amtstack.BatchEnum(b[0],b[1],c.xxWsmanReturn,c);break;case 17:c.state=2;c.amtstack.Put(b[0],b[1],c.xxWsmanReturn,c);break;case 18:c.state=2;c.amtstack.Create(b[0],
716
+c.timer=null;c.stepspeed=0};c.getVar=function(a){return void 0==a?void 0:c.getVarEx(a.split("."),c.variables)};c.getVarEx=function(a,b){try{return void 0==a?void 0:0==a.length?b:c.getVarEx(a.slice(1),b[a[0]])}catch(n){return null}};c.setVar=function(a,b){c.setVarEx(a.split("."),c.variables,b)};c.setVarEx=function(a,b,n){1==a.length?b[a[0]]=n:c.setVarEx(a.slice(1),b[a[0]],n)};c.step=function(){if(1==c.state){if(c.ip<c.script.length){var a=ReadShort(c.script,c.ip),b=ReadShort(c.script,c.ip+2),n=ReadShort(c.script,
717
+c.ip+4),r=c.ip+6,u=[],m;for(m in c.variables)m.startsWith("__")&&delete c.variables[m];for(m=0;m<n;m++){var l=ReadShort(c.script,r),w=c.script.substring(r+2,r+2+l),e=w.charCodeAt(0),w=w.substring(1);if(2>e){for(;1<w.split("{").length;)var v=w.split("{").pop().split("}").shift(),w=w.replace("{"+v+"}",c.getVar(v));1==e&&(c.variables["__"+m]=decodeURI(w),w="__"+m);u.push(w)}if(2==e||3==e)c.variables["__"+m]=ReadSInt(w,0),u.push("__"+m);r+=2+l}c.ip+=b;b=[];for(m=0;10>m;m++)b.push(c.getVar(u[m]));var E;
718
+try{if(1E4>a)switch(a){case 0:break;case 1:if(b[2]){if("<"==b[2]&&b[1]<b[3]||"<="==b[2]&&b[1]<=b[3]||"!="==b[2]&&b[1]!=b[3]||"="==b[2]&&b[1]==b[3]||">="==b[2]&&b[1]>=b[3]||">"==b[2]&&b[1]>b[3])c.ip=b[0]}else c.ip=b[0];break;case 2:void 0==u[1]?delete c.variables[u[0]]:c.setVar(u[0],b[1]);break;case 3:if(c.onConsole)c.onConsole(c.toString(b[0]),c);else console.log(c.toString(b[0]));break;case 4:c.state=2;c.dialog=!0;setDialogMode(11,b[0],b[2],c.xxStepDialogOk,b[1],c);break;case 5:for(m in b[1])b[1][m][b[2]]==
719
+b[3]&&(E=m);break;case 6:E=b[1].substr(b[2],b[3]);break;case 7:E=b[1].indexOf(b[2]);break;case 8:E=b[1].split(b[2]);break;case 9:E=b[1].join(b[2]);break;case 10:E=b[1].length;break;case 11:E=JSON.parse(b[1]);break;case 12:E=JSON.stringify(b[1]);break;case 13:E=b[1]+b[2];break;case 14:E=b[1]-b[2];break;case 15:E=parseInt(b[1]);break;case 16:c.state=2;c.amtstack.BatchEnum(b[0],b[1],c.xxWsmanReturn,c);break;case 17:c.state=2;c.amtstack.Put(b[0],b[1],c.xxWsmanReturn,c);break;case 18:c.state=2;c.amtstack.Create(b[0],
720
b[1],c.xxWsmanReturn,c);break;case 19:c.state=2;c.amtstack.Delete(b[0],b[1],c.xxWsmanReturn,c);break;case 20:c.state=2;c.amtstack.Exec(b[0],b[1],b[2],c.xxWsmanReturn,c,0,b[3]);break;case 21:c.stepspeed=b[0];null!=c.timer&&(clearInterval(c.timer),c.timer=setInterval(function(){c.step()},c.stepspeed));break;case 22:c.state=2;c.amtstack.Subscribe(b[0],b[1],b[2],c.xxWsmanReturn,c,0,b[3],b[4],b[5],b[6]);break;case 23:c.state=2;c.amtstack.UnSubscribe(b[0],c.xxWsmanReturn,c,0,b[1]);break;case 24:console.log(b[1],
720
-b[2],b[1].charCodeAt(b[2]));B=b[1].charCodeAt(b[2]);break;case 25:c.state=2;amtcert_signWithCaKey(b[0],null,b[1],{CN:"Untrusted Root Certificate"},c.xxSignWithDummyCaReturn);break;default:c.state=9,console.error("Script Error, unknown command: "+a)}else 2E4>a?B=script_functionTableX2[a-1E4](b[1],b[2],b[3],b[4],b[5],b[6]):script_functionTableX3&&script_functionTableX3[a-2E4]&&(B=script_functionTableX3[a-2E4](c,b[1],b[2],b[3],b[4],b[5],b[6]));void 0!=B&&c.setVar(r[0],B)}catch(h){"object"==typeof h&&
721
-(h=h.message),c.setVar("_exception",h)}}1==c.state&&c.ip>=c.script.length&&(c.state=0,c.stop());if(c.onStep)c.onStep(c);return c}};c.xxStepDialogOk=function(a){c.variables.DialogSelect=a;c.state=1;c.dialog=!1;if(c.onStep)c.onStep(c)};c.xxWsmanReturn=function(a,b,m,p){c.setVar(b,m);c.setVar("wsman_result",p);c.setVar("wsman_result_str",httpErrorTable[p]?httpErrorTable[p]:"Error #"+p);c.state=1;if(c.onStep)c.onStep(c)};c.xxSignWithDummyCaReturn=function(a){c.setVar("signed_cert",btoa(_arrayBufferToString(a)));
721
+b[2],b[1].charCodeAt(b[2]));E=b[1].charCodeAt(b[2]);break;case 25:c.state=2;amtcert_signWithCaKey(b[0],null,b[1],{CN:"Untrusted Root Certificate"},c.xxSignWithDummyCaReturn);break;default:c.state=9,console.error("Script Error, unknown command: "+a)}else 2E4>a?E=script_functionTableX2[a-1E4](b[1],b[2],b[3],b[4],b[5],b[6]):script_functionTableX3&&script_functionTableX3[a-2E4]&&(E=script_functionTableX3[a-2E4](c,b[1],b[2],b[3],b[4],b[5],b[6]));void 0!=E&&c.setVar(u[0],E)}catch(k){"object"==typeof k&&
722
+(k=k.message),c.setVar("_exception",k)}}1==c.state&&c.ip>=c.script.length&&(c.state=0,c.stop());if(c.onStep)c.onStep(c);return c}};c.xxStepDialogOk=function(a){c.variables.DialogSelect=a;c.state=1;c.dialog=!1;if(c.onStep)c.onStep(c)};c.xxWsmanReturn=function(a,b,n,r){c.setVar(b,n);c.setVar("wsman_result",r);c.setVar("wsman_result_str",httpErrorTable[r]?httpErrorTable[r]:"Error #"+r);c.state=1;if(c.onStep)c.onStep(c)};c.xxSignWithDummyCaReturn=function(a){c.setVar("signed_cert",btoa(_arrayBufferToString(a)));
723
c.state=1;if(c.onStep)c.onStep(c)};c.toString=function(a){return"object"==typeof a?JSON.stringify(a):a};c.reset();return c}
723
-function script_compile(a,b){var c="",d=a.split("\n"),f={},m=[],p=[],r;for(r in d){var l=d[r];if(l.startsWith("##SWAP ")){var k=l.split(" ");3==k.length&&(p[k[1]]=k[2])}if("#"!=l[0]&&0!=l.length){for(k in p)l=l.split(k).join(p[k]);var v=l.match(/"[^"]*"|[^\s"]+/g);if(0!=v.length)if(":"==l[0])f[v[0].toUpperCase()]=c.length;else{l=script_functionTable1.indexOf(v[0].toLowerCase());-1==l&&(l=script_functionTable2.indexOf(v[0].toLowerCase()),0<=l&&(l+=1E4));-1==l&&(l=script_functionTable3.indexOf(v[0].toLowerCase()),
724
-0<=l&&(l+=2E4));if(-1==l)return b&&b("Unabled to compile, unknown command: "+v[0]),"";var e=ShortToStr(v.length-1),u;for(u in v)if(0!=u)if(":"==v[u][0])m.push([v[u],c.length+e.length+7]),e+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var B=parseInt(v[u]),e=B==v[u]?e+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(B)):'"'==v[u][0]&&'"'==v[u][v[u].length-1]?e+(ShortToStr(v[u].length-1)+String.fromCharCode(1)+v[u].substring(1,v[u].length-1)):e+(ShortToStr(v[u].length+1)+String.fromCharCode(0)+
725
-v[u]);e=ShortToStr(l)+ShortToStr(e.length+4)+e;c+=e}}}for(r in m){d=m[r][0].toUpperCase();p=m[r][1];k=f[d];if(void 0==k)return b&&b("Unabled to compile, unknown label: "+d),"";c=c.substr(0,p)+IntToStr(k)+c.substr(p+4)}return IntToStr(612182341)+ShortToStr(1)+c}
726
-function script_decompile(a,b){var c="",d=6,f={};if(0<=b)d=b;else{if(6>a.length)return"# Invalid script length";var m=ReadInt(a,0),p=ReadShort(a,4);if(612182341!=m)return"# Invalid binary script: "+m;if(1!=p)return"# Invalid script version"}for(;d<a.length;){var m=ReadShort(a,d),p=ReadShort(a,d+2),r=ReadShort(a,d+4),l=d+6,k="";0<=b||(c+=":label"+(d-6)+"\n");for(var v=0;v<r;v++){var e=ReadShort(a,l),u=a.substring(l+2,l+2+e),B=u.charCodeAt(0);0==B?k+=" "+u.substring(1):1==B?k+=' "'+u.substring(1)+'"':
727
-2==B?k+=" "+ReadInt(u,1):3==B&&(u=ReadInt(u,1),B=f[u],B||(B=":label"+u,f[B]=u),k+=" "+B);l+=2+e}c=1E4>m?c+(script_functionTable1[m]+k+"\n"):2E4<=m?c+(script_functionTable3[m-2E4]+k+"\n"):c+(script_functionTable2[m-1E4]+k+"\n");d+=p;if(0<=b)return c}d=c.split("\n");c="";for(v in d)m=d[v],":"!=m[0]?c+=m+"\n":f[m]&&(c+=m+"\n");return c}
728
-var saveAs=saveAs||function(a){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var b=a.document.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in b,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),f=a.webkitRequestFileSystem,m=a.requestFileSystem||f||a.mozRequestFileSystem,p=function(b){(a.setImmediate||a.setTimeout)(function(){throw b;},0)},r=0,l=function(b){var c=function(){"string"===typeof b?(a.URL||a.webkitURL||a).revokeObjectURL(b):b.remove()};
729
-a.chrome?c():setTimeout(c,500)},k=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(f){p(f)}}},v=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},e=function(e,h,g){g||(e=v(e));var p=this;g=e.type;var n=!1,u,w,y=function(){k(p,["writestart","progress","write","writeend"])},D=function(){if(w&&d&&"undefined"!==typeof FileReader){var b=
730
-new FileReader;b.onloadend=function(){var a=b.result;w.location.href="data:attachment/file"+a.slice(a.search(/[,;]/));p.readyState=p.DONE;y()};b.readAsDataURL(e);p.readyState=p.INIT}else{if(n||!u)u=(a.URL||a.webkitURL||a).createObjectURL(e);w?w.location.href=u:void 0==a.open(u,"_blank")&&d&&(a.location.href=u);p.readyState=p.DONE;y();l(u)}},A=function(a){return function(){if(p.readyState!==p.DONE)return a.apply(this,arguments)}},L={create:!0,exclusive:!1},z;p.readyState=p.INIT;h||(h="download");if(c)u=
731
-(a.URL||a.webkitURL||a).createObjectURL(e),b.href=u,b.download=h,setTimeout(function(){var a=new MouseEvent("click");b.dispatchEvent(a);y();l(u);p.readyState=p.DONE});else{a.chrome&&g&&"application/octet-stream"!==g&&(z=e.slice||e.webkitSlice,e=z.call(e,0,e.size,"application/octet-stream"),n=!0);f&&"download"!==h&&(h+=".download");if("application/octet-stream"===g||f)w=a;m?(r+=e.size,m(a.TEMPORARY,r,A(function(a){a.root.getDirectory("saved",L,A(function(a){var b=function(){a.getFile(h,L,A(function(a){a.createWriter(A(function(b){b.onwriteend=
732
-function(b){w.location.href=a.toURL();p.readyState=p.DONE;k(p,"writeend",b);l(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&D()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=p["on"+a]});b.write(e);p.abort=function(){b.abort();p.readyState=p.DONE};p.readyState=p.WRITING}),D)}),D)};a.getFile(h,{create:!1},A(function(a){a.remove();b()}),A(function(a){a.code===a.NOT_FOUND_ERR?b():D()}))}),D)}),D)):D()}},u=e.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a,
733
-b,c){c||(a=v(a));return navigator.msSaveOrOpenBlob(a,b||"download")};u.abort=function(){this.readyState=this.DONE;k(this,"abort")};u.readyState=u.INIT=0;u.WRITING=1;u.DONE=2;u.error=u.onwritestart=u.onprogress=u.onwrite=u.onabort=u.onerror=u.onwriteend=null;return function(a,b,c){return new e(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content);
724
+function script_compile(a,b){var c="",d=a.split("\n"),g={},n=[],r=[],u;for(u in d){var m=d[u];if(m.startsWith("##SWAP ")){var l=m.split(" ");3==l.length&&(r[l[1]]=l[2])}if("#"!=m[0]&&0!=m.length){for(l in r)m=m.split(l).join(r[l]);var w=m.match(/"[^"]*"|[^\s"]+/g);if(0!=w.length)if(":"==m[0])g[w[0].toUpperCase()]=c.length;else{m=script_functionTable1.indexOf(w[0].toLowerCase());-1==m&&(m=script_functionTable2.indexOf(w[0].toLowerCase()),0<=m&&(m+=1E4));-1==m&&(m=script_functionTable3.indexOf(w[0].toLowerCase()),
725
+0<=m&&(m+=2E4));if(-1==m)return b&&b("Unabled to compile, unknown command: "+w[0]),"";var e=ShortToStr(w.length-1),v;for(v in w)if(0!=v)if(":"==w[v][0])n.push([w[v],c.length+e.length+7]),e+=ShortToStr(5)+String.fromCharCode(3)+IntToStr(4294967295);else var E=parseInt(w[v]),e=E==w[v]?e+(ShortToStr(5)+String.fromCharCode(2)+IntToStr(E)):'"'==w[v][0]&&'"'==w[v][w[v].length-1]?e+(ShortToStr(w[v].length-1)+String.fromCharCode(1)+w[v].substring(1,w[v].length-1)):e+(ShortToStr(w[v].length+1)+String.fromCharCode(0)+
726
+w[v]);e=ShortToStr(m)+ShortToStr(e.length+4)+e;c+=e}}}for(u in n){d=n[u][0].toUpperCase();r=n[u][1];l=g[d];if(void 0==l)return b&&b("Unabled to compile, unknown label: "+d),"";c=c.substr(0,r)+IntToStr(l)+c.substr(r+4)}return IntToStr(612182341)+ShortToStr(1)+c}
727
+function script_decompile(a,b){var c="",d=6,g={};if(0<=b)d=b;else{if(6>a.length)return"# Invalid script length";var n=ReadInt(a,0),r=ReadShort(a,4);if(612182341!=n)return"# Invalid binary script: "+n;if(1!=r)return"# Invalid script version"}for(;d<a.length;){var n=ReadShort(a,d),r=ReadShort(a,d+2),u=ReadShort(a,d+4),m=d+6,l="";0<=b||(c+=":label"+(d-6)+"\n");for(var w=0;w<u;w++){var e=ReadShort(a,m),v=a.substring(m+2,m+2+e),E=v.charCodeAt(0);0==E?l+=" "+v.substring(1):1==E?l+=' "'+v.substring(1)+'"':
728
+2==E?l+=" "+ReadInt(v,1):3==E&&(v=ReadInt(v,1),E=g[v],E||(E=":label"+v,g[E]=v),l+=" "+E);m+=2+e}c=1E4>n?c+(script_functionTable1[n]+l+"\n"):2E4<=n?c+(script_functionTable3[n-2E4]+l+"\n"):c+(script_functionTable2[n-1E4]+l+"\n");d+=r;if(0<=b)return c}d=c.split("\n");c="";for(w in d)n=d[w],":"!=n[0]?c+=n+"\n":g[n]&&(c+=n+"\n");return c}
729
+var saveAs=saveAs||function(a){if("undefined"===typeof navigator||!/MSIE [1-9]\./.test(navigator.userAgent)){var b=a.document.createElementNS("http://www.w3.org/1999/xhtml","a"),c="download"in b,d=/Version\/[\d\.]+.*Safari/.test(navigator.userAgent),g=a.webkitRequestFileSystem,n=a.requestFileSystem||g||a.mozRequestFileSystem,r=function(b){(a.setImmediate||a.setTimeout)(function(){throw b;},0)},u=0,m=function(b){var c=function(){"string"===typeof b?(a.URL||a.webkitURL||a).revokeObjectURL(b):b.remove()};
730
+a.chrome?c():setTimeout(c,500)},l=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(g){r(g)}}},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},e=function(e,k,h){h||(e=w(e));var r=this;h=e.type;var p=!1,v,y,z=function(){l(r,["writestart","progress","write","writeend"])},A=function(){if(y&&d&&"undefined"!==typeof FileReader){var b=
731
+new FileReader;b.onloadend=function(){var a=b.result;y.location.href="data:attachment/file"+a.slice(a.search(/[,;]/));r.readyState=r.DONE;z()};b.readAsDataURL(e);r.readyState=r.INIT}else{if(p||!v)v=(a.URL||a.webkitURL||a).createObjectURL(e);y?y.location.href=v:void 0==a.open(v,"_blank")&&d&&(a.location.href=v);r.readyState=r.DONE;z();m(v)}},D=function(a){return function(){if(r.readyState!==r.DONE)return a.apply(this,arguments)}},N={create:!0,exclusive:!1},x;r.readyState=r.INIT;k||(k="download");if(c)v=
732
+(a.URL||a.webkitURL||a).createObjectURL(e),b.href=v,b.download=k,setTimeout(function(){var a=new MouseEvent("click");b.dispatchEvent(a);z();m(v);r.readyState=r.DONE});else{a.chrome&&h&&"application/octet-stream"!==h&&(x=e.slice||e.webkitSlice,e=x.call(e,0,e.size,"application/octet-stream"),p=!0);g&&"download"!==k&&(k+=".download");if("application/octet-stream"===h||g)y=a;n?(u+=e.size,n(a.TEMPORARY,u,D(function(a){a.root.getDirectory("saved",N,D(function(a){var b=function(){a.getFile(k,N,D(function(a){a.createWriter(D(function(b){b.onwriteend=
733
+function(b){y.location.href=a.toURL();r.readyState=r.DONE;l(r,"writeend",b);m(a)};b.onerror=function(){var a=b.error;a.code!==a.ABORT_ERR&&A()};["writestart","progress","write","abort"].forEach(function(a){b["on"+a]=r["on"+a]});b.write(e);r.abort=function(){b.abort();r.readyState=r.DONE};r.readyState=r.WRITING}),A)}),A)};a.getFile(k,{create:!1},D(function(a){a.remove();b()}),D(function(a){a.code===a.NOT_FOUND_ERR?b():A()}))}),A)}),A)):A()}},v=e.prototype;if("undefined"!==typeof navigator&&navigator.msSaveOrOpenBlob)return function(a,
734
+b,c){c||(a=w(a));return navigator.msSaveOrOpenBlob(a,b||"download")};v.abort=function(){this.readyState=this.DONE;l(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 e(a,b,c)}}}("undefined"!==typeof self&&self||"undefined"!==typeof window&&window||this.content);
735
"undefined"!==typeof module&&module.exports?module.exports.saveAs=saveAs:"undefined"!==typeof define&&null!==define&&null!=define.amd&&define([],function(){return saveAs});
735
-var version="0.7.3",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=
736
+var version="0.7.4",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=
737
null,currentView=0,LoadingHtml="<div style=text-align:center;padding-top:20px>Loading...<div>",amtversion=0,amtversionmin=0,amtFirstPull=0,amtwirelessif=-1,currentMeshNode=null,webcompilerfeatures="AgentPresence Alarms AuditLog Certificates ComputerSelectorToolbar EventLog EventSubscriptions FileSaver HardwareInfo Look-MeshCentral Mode-MeshCentral2 NetworkSettings PowerControl PowerControl-Advanced RemoteAccess Scripting Scripting-Editor Storage SystemDefense VersionWarning Wireless WsmanBrowser".split(" "),
738
StatusStrs=["Disconnected","Connecting...","Setup...","Connected"],scriptstate,t,t2,rsepass=null;
739
function startup(){var a=document.getElementsByTagName("input");for(t=0;t<a.length;t++)a[t].id&&(window[a[t].id]=a[t]);urlvars=getUrlVars();for(var b in AllWsman)a=document.createElement("option"),a.text=AllWsman[b],a.id="WSB-"+AllWsman[b],Q(22).add(a);document.addEventListener("dragover",haltEvent,!1);document.addEventListener("dragleave",haltEvent,!1);document.addEventListener("drop",documentFileSelectHandler,!1);Q("p16").addEventListener("dragover",haltEvent,!1);Q("p16").addEventListener("dragleave",
@@ -740,7 +741,7 @@ haltEvent,!1);Q("p16").addEventListener("drop",cert_FileSelectHandler,!1);docume
741
function documentFileSelectHandler(a){haltEvent(a);if(null!=a.dataTransfer&&1==a.dataTransfer.files.length){var b=null,c=a.dataTransfer.files[0].name.toLowerCase();21==currentView?UploadToStorage(a.dataTransfer.files[0],c):(null!=wsstack&&(c.endsWith(".mescript")||c.endsWith(".meblocks"))&&(b=script_onScriptRead),null!=b&&(c=new FileReader,c.onload=b,c.readAsBinaryString(a.dataTransfer.files[0])))}}
742
function connectButtonfunction(){wsstack&&0!=wsstack.socketState?disconnect():meshcentral2credCallback()}function connectButtonfunctionEx(){currentMeshNode=parent.getCurrentNode();connect(currentMeshNode._id,16992,null,null,0);Q("xconnectbutton1").value="Disconnect"}function getCurrentMeshNode(){return currentMeshNode}function setConnectionState(a){QE("xconnectbutton1",a);0==a&&disconnect()}function setFrameHeight(a){}function setAuthCallback(a){meshcentral2credCallback=a}function cleanup(){}
743
function handleKeyUp(a){}function handleKeyDown(a){}function handleKeyPress(a){}var connectFunc=null,connectFuncTag=null;
743
-function connect(a,b,c,d,f,m,p){go(0);fullscreenonly=!1;connectFunc=m;connectFuncTag=p;wsstack=WsmanStackCreateService(a,b,c,d,f);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(a=2;25>a;a++)QV("go"+a,!1);QV("go8",!0);QV("go12",!0);QV("go20",!0);amtversion=amtversionmin=amtFirstPull=0;amtsysstate=amtdeltatime=amtlogicalelements=HardwareInventory=void 0;amtPowerBootCapabilities=null;xxAccountFetch=999;QH(15,LoadingHtml);QH(19,
744
+function connect(a,b,c,d,g,n,r){go(0);fullscreenonly=!1;connectFunc=n;connectFuncTag=r;wsstack=WsmanStackCreateService(a,b,c,d,g);amtstack=AmtStackCreateService(wsstack);amtstack.onProcessChanged=onProcessChanged;for(a=2;25>a;a++)QV("go"+a,!1);QV("go8",!0);QV("go12",!0);QV("go20",!0);amtversion=amtversionmin=amtFirstPull=0;amtsysstate=amtdeltatime=amtlogicalelements=HardwareInventory=void 0;amtPowerBootCapabilities=null;xxAccountFetch=999;QH(15,LoadingHtml);QH(19,
745
LoadingHtml);amtwirelessif=-1;xxWireless=void 0;QH(20,"");QH(16,LoadingHtml);xxAccountAdminName=null;xxAccountRealmInfo={};QH(21,LoadingHtml);eventmessages=null;QH(17,"");QH(18,LoadingHtml);auditLog=null;QH(25,"");QH(26,LoadingHtml);xxCertificates=null;QH(27,LoadingHtml);QH(24,"");xxPolicies=xxMPSUserPass=xxRemoteAccessCredentiaLinks=xxUserInitiatedCira=xxCiraServers=
746
xxEnvironementDetection=xxRemoteAccess=null;QH(28,LoadingHtml);QH(30,LoadingHtml);xxSystemDefense=null;xxSystemDefenceLinkedPolicy={};xxUpdatingDefenseStats=!1;xxFilterStatistics=[{},{}];xxFilterStatisticsTimer=null;xxFilterStatisticsTimerActive=!1;QH(29,LoadingHtml);amtstack.BatchEnum("",["CIM_SoftwareIdentity","*AMT_SetupAndConfigurationService"],processSystemVersion);QV(11,!1);fupdatescript()}
747
function disconnect(){StopDefenseStatsTimer();script_Stop();breakScriptButton();dialogclose(0);amtstack&&(amtstack.onProcessChanged=null,amtstack.CancelAllQueries(999),amtstack=null);cleanup();wsstack=null;delete amtstack;onProcessChanged(0,1);go(101);Q("xconnectbutton1").value="Connect";QH(5,"Disconnected");go(100)}
@@ -752,22 +753,22 @@ function refreshButtons(a){if(refreshButtonsState!=a){refreshButtonsState=a;for(
753
function PullSystemStatus(a){refreshButtons(!1);amtstack.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch(processSystemTime);var b=["CIM_ServiceAvailableToElement","*AMT_GeneralSettings","AMT_EthernetPortSettings","*AMT_RedirectionService","CIM_ElementSettingData"];5<amtversion&&b.push("IPS_IPv6PortSettings","*CIM_KVMRedirectionSAP","*IPS_OptInService","*IPS_KVMRedirectionSettingData");9<amtversion&&b.push("*IPS_ScreenConfigurationService");amtstack.BatchEnum("",b,processSystemStatus,!0);1==
754
a&&PullWireless()}function processSystemTime(a,b,c,d){errcheck(d,a)||200!=d||(a=new Date,b=new Date,a.setTime(1E3*c.Body.Ta0+6E4*a.getTimezoneOffset()),amtdeltatime=a-b,updateSystemStatus())}var amtdeltatime,amtsysstate,amtlogicalelements,amtfeatures={};
755
function processSystemStatus(a,b,c,d){if(void 0==c.IPS_ScreenConfigurationService||400==c.IPS_ScreenConfigurationService.status)c.IPS_ScreenConfigurationService=null;if(void 0==c.IPS_KVMRedirectionSettingData||400==c.IPS_KVMRedirectionSettingData.status)c.IPS_KVMRedirectionSettingData=null;if(void 0==c.CIM_KVMRedirectionSAP||400==c.CIM_KVMRedirectionSAP.status)c.CIM_KVMRedirectionSAP=null;if(void 0==c.IPS_OptInService||400==c.IPS_OptInService.status)c.IPS_OptInService=null;void 0!=c.AMT_RedirectionService&&
755
-200==c.AMT_RedirectionService.status&&QV("go13",!0);d=0;for(var f in c)null!=c[f]&&c[f].status>d&&(d=c[f].status);400!=d&&errcheck(d,a)||(amtsysstate=c,updateSystemStatus())}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(";");
756
-function updateSystemStatus(){if(amtsysstate&&!(99<currentView)){var a=0,b,c,d=TableStart(),f="",m=amtsysstate.AMT_GeneralSettings.response;t="Unknown";null!=amtsysstate.CIM_ServiceAvailableToElement&&(t=DMTFPowerStates[amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState]);m.PowerSource&&(t+=[", Plugged-in",", On Battery"][m.PowerSource]);d+=TableEntry("Power",addLink(t,"showPowerActionDlg()"));b=m.HostName;c=m.DomainName;null!=c&&0<c.length&&(b+="."+c);b=0==b.length?"<i>None</i>":EscapeHtml(b);
757
-d+=TableEntry("Name & Domain",addLinkConditional(b,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));if(amtlogicalelements){var p="",r=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==r.ProvisioningState&&5<amtversion&&(p=" activated in Admin Control Mode (ACM)",4==r.ProvisioningMode&&(p=" activated in Client Control Mode (CCM)",a=9));
758
-d+=TableEntry("Intel® ME","v"+getItem(amtlogicalelements,"InstanceID","AMT").VersionString+p)}if(200==amtsysstate.AMT_RedirectionService.status){var p=amtfeatures[0]=1==amtsysstate.AMT_RedirectionService.response.ListenerEnabled,r=amtfeatures[1]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&2),l=amtfeatures[2]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&1),k=amtfeatures[3]=void 0;5<amtversion&&null!=amtsysstate.CIM_KVMRedirectionSAP&&(k=amtfeatures[3]=6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState&&
759
-2==amtsysstate.CIM_KVMRedirectionSAP.response.RequestedState||2==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState||6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState);p&&(f+=", Redirection Port");r&&(f+=", Serial-over-LAN");l&&(f+=", IDE-Redirect");k&&(f+=", KVM");""==f&&(f=" None");d+=TableEntry("Active Features",addLinkConditional(f.substring(2),"showFeaturesDlg()",xxAccountAdminName))}null!=amtsysstate.IPS_KVMRedirectionSettingData&&amtsysstate.IPS_KVMRedirectionSettingData.response&&
760
-(p=amtsysstate.IPS_KVMRedirectionSettingData.response,f="Primary display",7<amtversion&&void 0!==p.DefaultScreen&&255>p.DefaultScreen&&(f=["Primary display","Secondary display","3rd display"][p.DefaultScreen]),f='<span title="The default remote display is the '+f.toLowerCase()+'">'+f+"</span>",1==p.Is5900PortEnabled&&(f+=", Port 5900 enabled"),1==p.OptInPolicy&&(f+=", "+p.OptInPolicyTimeout+" second"+(0<p.OptInPolicyTimeout?"s":"")+" opt-in"),f+=", "+p.SessionTimeout+" minute"+(0<p.SessionTimeout?
761
-"s":"")+" session timeout",9<amtversion&&null!=amtsysstate.IPS_ScreenConfigurationService&&0!=(amtsysstate.IPS_ScreenConfigurationService.response.EnabledState&1)&&(f+=", Blanking Allowed"),d+=TableEntry("Remote Desktop",f));5<amtversion&&null!=amtsysstate.IPS_OptInService&&void 0!=amtsysstate.IPS_OptInService.response&&(f="Unknown state",p=amtsysstate.IPS_OptInService.response.OptInRequired,0==p&&(f="Not Required"),1==p&&(f="Required for KVM only"),4294967295==p&&(f="Always Required"),1==amtsysstate.IPS_OptInService.response.CanModifyOptInPolicy&&
762
-(f=addLinkConditional(f,"showConsentDlg()",xxAccountAdminName)),d+=TableEntry("User Consent",f));if(null!=AmtSystemPowerSchemes)for(f=amtsysstate.CIM_ElementSettingData.responses,p=0;p<f.length;p++)if(f[p].SettingData&&1==f[p].IsCurrent&&"http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SystemPowerScheme"==f[p].SettingData.ReferenceParameters.ResourceURI)for(r=f[p].SettingData.ReferenceParameters.SelectorSet.Selector[1].Value,l=0;l<AmtSystemPowerSchemes.length;l++)AmtSystemPowerSchemes[l].SchemeGUID==
763
-r&&(d+=TableEntry("Power Policy",addLinkConditional(AmtSystemPowerSchemes[l].Description.split(":")[1],'showPowerPolicyDlg("'+r+'")',xxAccountAdminName)));amtdeltatime&&(d+=TableEntry("Date & Time",(new Date((new Date).getTime()+amtdeltatime)).toLocaleString()));f=AddRefreshButton("PullSystemStatus()")+" ";f+=AddButton("Power Actions...","showPowerActionDlg()")+" ";f+=AddButton("Save State...","saveEntireAmtState()")+" ";f+=AddButton("Run Script...","script_runScriptDlg()")+" ";d+=TableEnd(f);QH(15,
764
-d);d="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>"+TableEnd("<div> "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"<br><h2>General Settings</h2>"+TableStart();f="";"<i>None</i>"!=b&&(1==m.SharedFQDN&&(f=", shared with OS"),0==m.SharedFQDN&&(f=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(b+f,"showEditNameDlg(1)",xxAccountAdminName));b="Disabled";1==m.DDNSUpdateEnabled?
765
-b="Enabled each "+m.DDNSPeriodicUpdateInterval+" minutes, TTL is "+m.DDNSTTL+" minutes":1==m.DDNSUpdateByDHCPServerEnabled&&(b="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(b,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(c in amtsysstate.AMT_EthernetPortSettings.responses){b=amtsysstate.AMT_EthernetPortSettings.responses[c];if(b.WLANLinkProtectionLevel||1==c)amtwirelessif=c;if(0!=c||amtwirelessif==c||"00-00-00-00-00-00"!=b.MACAddress){0==c&&a++;d+="<br><h2>"+
756
+200==c.AMT_RedirectionService.status&&QV("go13",!0);d=0;for(var g in c)null!=c[g]&&c[g].status>d&&(d=c[g].status);400!=d&&errcheck(d,a)||(amtsysstate=c,updateSystemStatus())}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(";");
757
+function updateSystemStatus(){if(amtsysstate&&!(99<currentView)){var a=0,b,c,d=TableStart(),g="",n=amtsysstate.AMT_GeneralSettings.response;t="Unknown";null!=amtsysstate.CIM_ServiceAvailableToElement&&(t=DMTFPowerStates[amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState]);n.PowerSource&&(t+=[", Plugged-in",", On Battery"][n.PowerSource]);d+=TableEntry("Power",addLink(t,"showPowerActionDlg()"));b=n.HostName;c=n.DomainName;null!=c&&0<c.length&&(b+="."+c);b=0==b.length?"<i>None</i>":EscapeHtml(b);
758
+d+=TableEntry("Name & Domain",addLinkConditional(b,"showEditNameDlg()",xxAccountAdminName));HardwareInventory&&(d+=TableEntry("System ID",guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));if(amtlogicalelements){var r="",u=getItem(amtlogicalelements,"CreationClassName","AMT_SetupAndConfigurationService");2==u.ProvisioningState&&5<amtversion&&(r=" activated in Admin Control Mode (ACM)",4==u.ProvisioningMode&&(r=" activated in Client Control Mode (CCM)",a=9));
759
+d+=TableEntry("Intel® ME","v"+getItem(amtlogicalelements,"InstanceID","AMT").VersionString+r)}if(200==amtsysstate.AMT_RedirectionService.status){var r=amtfeatures[0]=1==amtsysstate.AMT_RedirectionService.response.ListenerEnabled,u=amtfeatures[1]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&2),m=amtfeatures[2]=0!=(amtsysstate.AMT_RedirectionService.response.EnabledState&1),l=amtfeatures[3]=void 0;5<amtversion&&null!=amtsysstate.CIM_KVMRedirectionSAP&&(l=amtfeatures[3]=6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState&&
760
+2==amtsysstate.CIM_KVMRedirectionSAP.response.RequestedState||2==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState||6==amtsysstate.CIM_KVMRedirectionSAP.response.EnabledState);r&&(g+=", Redirection Port");u&&(g+=", Serial-over-LAN");m&&(g+=", IDE-Redirect");l&&(g+=", KVM");""==g&&(g=" None");d+=TableEntry("Active Features",addLinkConditional(g.substring(2),"showFeaturesDlg()",xxAccountAdminName))}null!=amtsysstate.IPS_KVMRedirectionSettingData&&amtsysstate.IPS_KVMRedirectionSettingData.response&&
761
+(r=amtsysstate.IPS_KVMRedirectionSettingData.response,g="Primary display",7<amtversion&&void 0!==r.DefaultScreen&&255>r.DefaultScreen&&(g=["Primary display","Secondary display","3rd display"][r.DefaultScreen]),g='<span title="The default remote display is the '+g.toLowerCase()+'">'+g+"</span>",1==r.Is5900PortEnabled&&(g+=", Port 5900 enabled"),1==r.OptInPolicy&&(g+=", "+r.OptInPolicyTimeout+" second"+(0<r.OptInPolicyTimeout?"s":"")+" opt-in"),g+=", "+r.SessionTimeout+" minute"+(0<r.SessionTimeout?
762
+"s":"")+" session timeout",9<amtversion&&null!=amtsysstate.IPS_ScreenConfigurationService&&0!=(amtsysstate.IPS_ScreenConfigurationService.response.EnabledState&1)&&(g+=", Blanking Allowed"),d+=TableEntry("Remote Desktop",g));5<amtversion&&null!=amtsysstate.IPS_OptInService&&void 0!=amtsysstate.IPS_OptInService.response&&(g="Unknown state",r=amtsysstate.IPS_OptInService.response.OptInRequired,0==r&&(g="Not Required"),1==r&&(g="Required for KVM only"),4294967295==r&&(g="Always Required"),1==amtsysstate.IPS_OptInService.response.CanModifyOptInPolicy&&
763
+(g=addLinkConditional(g,"showConsentDlg()",xxAccountAdminName)),d+=TableEntry("User Consent",g));if(null!=AmtSystemPowerSchemes)for(g=amtsysstate.CIM_ElementSettingData.responses,r=0;r<g.length;r++)if(g[r].SettingData&&1==g[r].IsCurrent&&"http://intel.com/wbem/wscim/1/amt-schema/1/AMT_SystemPowerScheme"==g[r].SettingData.ReferenceParameters.ResourceURI)for(u=g[r].SettingData.ReferenceParameters.SelectorSet.Selector[1].Value,m=0;m<AmtSystemPowerSchemes.length;m++)AmtSystemPowerSchemes[m].SchemeGUID==
764
+u&&(d+=TableEntry("Power Policy",addLinkConditional(AmtSystemPowerSchemes[m].Description.split(":")[1],'showPowerPolicyDlg("'+u+'")',xxAccountAdminName)));amtdeltatime&&(d+=TableEntry("Date & Time",(new Date((new Date).getTime()+amtdeltatime)).toLocaleString()));g=AddRefreshButton("PullSystemStatus()")+" ";g+=AddButton("Power Actions...","showPowerActionDlg()")+" ";g+=AddButton("Save State...","saveEntireAmtState()")+" ";g+=AddButton("Run Script...","script_runScriptDlg()")+" ";d+=TableEnd(g);QH(15,
765
+d);d="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>"+TableEnd("<div> "+AddRefreshButton("PullSystemStatus(1)")+" Changing network settings may cause this page to becaume unavailable.");d=d+"<br><h2>General Settings</h2>"+TableStart();g="";"<i>None</i>"!=b&&(1==n.SharedFQDN&&(g=", shared with OS"),0==n.SharedFQDN&&(g=", different from OS"));d+=TableEntry("Name & Domain",addLinkConditional(b+g,"showEditNameDlg(1)",xxAccountAdminName));b="Disabled";1==n.DDNSUpdateEnabled?
766
+b="Enabled each "+n.DDNSPeriodicUpdateInterval+" minutes, TTL is "+n.DDNSTTL+" minutes":1==n.DDNSUpdateByDHCPServerEnabled&&(b="Update by DHCP server");d+=TableEntry("Dynamic DNS",addLinkConditional(b,"showEditDnsDlg()",xxAccountAdminName));d+=TableEnd();for(c in amtsysstate.AMT_EthernetPortSettings.responses){b=amtsysstate.AMT_EthernetPortSettings.responses[c];if(b.WLANLinkProtectionLevel||1==c)amtwirelessif=c;if(0!=c||amtwirelessif==c||"00-00-00-00-00-00"!=b.MACAddress){0==c&&a++;d+="<br><h2>"+
767
(amtwirelessif==c?"Wireless":"Wired")+" Interface</h2>";d+=TableStart();d+=TableEntry("Link state",1==b.LinkIsUp?"Link is up":"Link is down");"00-00-00-00-00-00"!=b.MACAddress&&(d+=TableEntry("MAC address",b.MACAddress));amtwirelessif==c&&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",
767
-xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"<i>None</i>")));amtwirelessif!=c&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][m.PingResponseEnabled+(m.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),d+=TableEntry("IPv4 state",addLinkConditional(1==b.DHCPEnabled?"Automatic using DHCP server":"Static IP address","showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",
768
-isIpAddress(b.IPAddress,"None"));isIpAddress(b.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",b.DefaultGateway+" / "+isIpAddress(b.SubnetMask,"None")));f=b.PrimaryDNS;isIpAddress(f)&&(b.SecondaryDNS&&(f+=" / "+b.SecondaryDNS),d+=TableEntry("IPv4 domain name server",f));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5<amtversion){b=amtsysstate.IPS_IPv6PortSettings.responses[c];for(var r="Disabled",v,f=amtsysstate.CIM_ElementSettingData.responses,p=0;p<f.length;p++)f[p].SettingData&&f[p].SettingData.ReferenceParameters.SelectorSet.Selector.Value==
769
-"Intel(r) IPS IPv6 Settings "+c&&(v=1==f[p].IsCurrent);1==v&&(f=isIpAddress(b.IPv6Address)||isIpAddress(b.DefaultRouter)||isIpAddress(b.PrimaryDNS)||isIpAddress(b.SecondaryDNS),r="Enabled, Automatic "+(f?"& manual":"")+" addresses");d+=TableEntry("IPv6 state",addLinkConditional(r,"showIPv6StateDlg("+c+","+v+")",xxAccountAdminName));if(1==v){if(b.CurrentAddressInfo&&0<b.CurrentAddressInfo.length){b.CurrentAddressInfo=MakeToArray(b.CurrentAddressInfo);ipv6addr="";for(p=0;p<b.CurrentAddressInfo.length;p++)0<
770
-ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=b.CurrentAddressInfo[p].split(",")[0];d+=TableEntry("IPv6 address",addLink(ipv6addr,"showIPv6AddrDlg("+c+',"'+b.CurrentAddressInfo+'")'))}else d+=TableEntry("IPv6 address","None");isIpAddress(b.CurrentDefaultRouter)&&(d+=TableEntry("IPv6 default router",b.CurrentDefaultRouter));isIpAddress(b.CurrentPrimaryDNS)&&(f=b.CurrentPrimaryDNS,isIpAddress(b.CurrentSecondaryDNS)&&(f+=" / "+b.CurrentSecondaryDNS),d+=TableEntry("IPv6 domain name server",f))}}d+=TableEnd()}}1!=
768
+xxRadioState[xxWireless.CIM_WiFiEndpoint.response.EnabledState]+", SSID: "+(s?s:"<i>None</i>")));amtwirelessif!=c&&(d+=TableEntry("Respond to ping",addLinkConditional(["Disabled","ICMP response","RMCP response","ICMP & RMCP response"][n.PingResponseEnabled+(n.RmcpPingResponseEnabled<<1)],"showPingActionDlg()",xxAccountAdminName)),d+=TableEntry("IPv4 state",addLinkConditional(1==b.DHCPEnabled?"Automatic using DHCP server":"Static IP address","showIPSetupDlg()",xxAccountAdminName)));d+=TableEntry("IPv4 address",
769
+isIpAddress(b.IPAddress,"None"));isIpAddress(b.DefaultGateway)&&(d+=TableEntry("IPv4 gateway / Mask",b.DefaultGateway+" / "+isIpAddress(b.SubnetMask,"None")));g=b.PrimaryDNS;isIpAddress(g)&&(b.SecondaryDNS&&(g+=" / "+b.SecondaryDNS),d+=TableEntry("IPv4 domain name server",g));if(200==amtsysstate.IPS_IPv6PortSettings.status&&5<amtversion){b=amtsysstate.IPS_IPv6PortSettings.responses[c];for(var u="Disabled",w,g=amtsysstate.CIM_ElementSettingData.responses,r=0;r<g.length;r++)g[r].SettingData&&g[r].SettingData.ReferenceParameters.SelectorSet.Selector.Value==
770
+"Intel(r) IPS IPv6 Settings "+c&&(w=1==g[r].IsCurrent);1==w&&(g=isIpAddress(b.IPv6Address)||isIpAddress(b.DefaultRouter)||isIpAddress(b.PrimaryDNS)||isIpAddress(b.SecondaryDNS),u="Enabled, Automatic "+(g?"& manual":"")+" addresses");d+=TableEntry("IPv6 state",addLinkConditional(u,"showIPv6StateDlg("+c+","+w+")",xxAccountAdminName));if(1==w){if(b.CurrentAddressInfo&&0<b.CurrentAddressInfo.length){b.CurrentAddressInfo=MakeToArray(b.CurrentAddressInfo);ipv6addr="";for(r=0;r<b.CurrentAddressInfo.length;r++)0<
771
+ipv6addr.length&&(ipv6addr+=", "),ipv6addr+=b.CurrentAddressInfo[r].split(",")[0];d+=TableEntry("IPv6 address",addLink(ipv6addr,"showIPv6AddrDlg("+c+',"'+b.CurrentAddressInfo+'")'))}else d+=TableEntry("IPv6 address","None");isIpAddress(b.CurrentDefaultRouter)&&(d+=TableEntry("IPv6 default router",b.CurrentDefaultRouter));isIpAddress(b.CurrentPrimaryDNS)&&(g=b.CurrentPrimaryDNS,isIpAddress(b.CurrentSecondaryDNS)&&(g+=" / "+b.CurrentSecondaryDNS),d+=TableEntry("IPv6 domain name server",g))}}d+=TableEnd()}}1!=
772
urlvars.kvmonly&&0==fullscreenonly&&(-1!=amtwirelessif&&0==(amtFirstPull&2)&&PullWireless(),QH(19,d),1==a&&0==(amtFirstPull&4)&&PullSystemDefense(),0==(amtFirstPull&8)&&(11<amtversion||11==amtversion&&5<amtversionmin)&&PullStorage());0==currentView&&go(1,1)}}function isIpAddress(a,b){return a&&null!=a&&0<a.length&&"::"!=a&&"::0"!=a?a:b}var IntelAmtEntireState,IntelAmtEntireStateCalls;
773
function saveEntireAmtState(){if(!xxdialogMode){var a="",b=new Date;amtsysstate&&(a="-"+amtsysstate.AMT_GeneralSettings.response.HostName);a+="-"+b.getFullYear()+"-"+("0"+(b.getMonth()+1)).slice(-2)+"-"+("0"+b.getDate()).slice(-2)+"-"+("0"+b.getHours()).slice(-2)+"-"+("0"+b.getMinutes()).slice(-2);c18.value="amtstate"+a+".json";setDialogMode(19,"Save Entire Intel® AMT State",3,saveEntireAmtStateOk)}}
774
function saveEntireAmtStateOk(){IntelAmtEntireState={webappversion:version,localtime:Date(),utctime:(new Date).toUTCString(),isotime:(new Date).toISOString()};QH(36,"Fetching entire state, please wait...");setDialogMode(1,"Save Entire Intel® AMT State",0,null);IntelAmtEntireStateCalls=3;amtstack.BatchEnum(null,AllWsman,saveEntireAmtStateOk2,null,!0);amtstack.GetAuditLog(saveEntireAmtStateOk3);amtstack.GetMessageLog(saveEntireAmtStateOk4)}
@@ -775,16 +776,16 @@ function saveEntireAmtStateOk2(a,b,c,d){IntelAmtEntireState.wsmanenums=c;saveEnt
776
function PullEventLog(a){1==a&&xxdialogMode||(amtFirstPull|=16,amtstack.Enum("AMT_MessageLog",processMessageLog0),amtstack.GetMessageLog(processMessageLog1))}var processMessageLog0responses=null;
777
function processMessageLog0(a,b,c,d){200==d&&(d&&QV("go6",!0),c&&(processMessageLog0responses=c),a="",b="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>",null!=processMessageLog0responses&&(a=1==processMessageLog0responses[0].IsFrozen?AddButton("Un-freeze Log","FreezeLog(0)"):AddButton("Freeze Log","FreezeLog(1)")),b+=TableEnd("<div style=float:right><input id=eventFilter placeholder=Filter style=margin:4px onkeyup=eventFilter()> </div><div> "+AddRefreshButton("PullEventLog(1)")+
778
AddButton("Clear Log","ClearLog()")+AddButton("Save...","SaveEventLog()")+a),QH(17,b+"<br>"))}function SaveEventLog(){xxdialogMode||null==eventmessages||SaveJsonFile("IntelAmtEventlog","events","Intel AMT Event Log",eventmessages)}var eventmessages=null;
778
-function processMessageLog1(a,b){eventmessages=b;var c,d=0,f;f="<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(c in b){d++;var m=1,p=b[c];8<=p.EventSeverity&&(m=2);16<=p.EventSeverity&&(m=3);f+="<tr id=xamtevent"+c+" class=r3 onclick=showEventDetails("+
779
-c+")><td class=r1><p><div class=icon"+m+" style=display:block;float:left;margin-left:5px;margin-right:5px></div>"+(parseInt(c)+1)+"<td class=r1 title='"+p.Time.toLocaleString()+"'>"+p.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br>"+p.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+p.EntityStr.replace("(r)","®")+"<td class=r1>"+p.Desc}f+=TableEnd(0==d?" ":"");QH(18,f+"<br>");processMessageLog0()}
779
+function processMessageLog1(a,b){eventmessages=b;var c,d=0,g;g="<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(c in b){d++;var n=1,r=b[c];8<=r.EventSeverity&&(n=2);16<=r.EventSeverity&&(n=3);g+="<tr id=xamtevent"+c+" class=r3 onclick=showEventDetails("+
780
+c+")><td class=r1><p><div class=icon"+n+" style=display:block;float:left;margin-left:5px;margin-right:5px></div>"+(parseInt(c)+1)+"<td class=r1 title='"+r.Time.toLocaleString()+"'>"+r.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br>"+r.Time.toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+r.EntityStr.replace("(r)","®")+"<td class=r1>"+r.Desc}g+=TableEnd(0==d?" ":"");QH(18,g+"<br>");processMessageLog0()}
781
function FreezeLog(a){xxdialogMode||amtstack.AMT_MessageLog_FreezeLog(a,function(){amtstack.Enum("AMT_MessageLog",processMessageLog0)})}function ClearLog(a){xxdialogMode||(QH(36,"Clear event log?"),setDialogMode(1,"Event Log",3,ClearLogEx))}function ClearLogEx(){amtstack.AMT_MessageLog_ClearLog(function(a,b,c,d){200!=d?messagebox("Event Log","Unable to clear, Error: "+d):PullEventLog()})}
781
-function showEventDetails(a){if(!xxdialogMode){var b=eventmessages[a],c;c="<div style=text-align:left>"+addHtmlValue("Time",b.Time.toLocaleString());c+=addHtmlValue("Source",b.EntityStr.replace("(r)","®"));c+=addHtmlValue("Description",b.Desc);c+=MoreStart();c+=addHtmlValue("Device Address",b.DeviceAddress);c+=addHtmlValue("Entity",b.Entity);c+=addHtmlValue("Entity Instance",b.EntityInstance);var d="",f;for(f in b.EventData)0<d.length&&(d+=","),d+=b.EventData[f];c+=addHtmlValue("Data",d);c+=addHtmlValue("Offset",
782
+function showEventDetails(a){if(!xxdialogMode){var b=eventmessages[a],c;c="<div style=text-align:left>"+addHtmlValue("Time",b.Time.toLocaleString());c+=addHtmlValue("Source",b.EntityStr.replace("(r)","®"));c+=addHtmlValue("Description",b.Desc);c+=MoreStart();c+=addHtmlValue("Device Address",b.DeviceAddress);c+=addHtmlValue("Entity",b.Entity);c+=addHtmlValue("Entity Instance",b.EntityInstance);var d="",g;for(g in b.EventData)0<d.length&&(d+=","),d+=b.EventData[g];c+=addHtmlValue("Data",d);c+=addHtmlValue("Offset",
783
b.EventOffset);c+=addHtmlValue("Sensor Type",b.EventSensorType);c+=addHtmlValue("Severity",b.EventSeverity);c+=addHtmlValue("Source Type",b.EventSourceType);c+=addHtmlValue("Type",b.EventType);c+=addHtmlValue("Sensor Number",b.SensorNumber);c+=MoreEnd();messagebox("Event #"+(a+1)+" Details",c+"</div>")}}
784
function eventFilter(){var a=Q("eventFilter").value.toLowerCase(),b;for(b in eventmessages)QV("xamtevent"+b,""==a||0<=eventmessages[b].Desc.toLowerCase().indexOf(a)||0<=eventmessages[b].EntityStr.toLowerCase().indexOf(a))}var subscriptionsFilters=null,subscriptionsListeners=null;
785
function PullEventSubscriptions(){null==subscriptionsFilters&&amtstack.Enum("CIM_FilterCollection",processEventSubscriptions0);amtstack.BatchEnum(null,["CIM_ListenerDestination","CIM_FilterCollectionSubscription"],processEventSubscriptions1)}function processEventSubscriptions0(a,b,c,d){408!=d&&400!=d&&(d&&errcheck(d,a)||(subscriptionsFilters=c))}
785
-function processEventSubscriptions1(a,b,c,d){if(!(408==d||400==d||d&&errcheck(d,a))){d&&QV("go22",!0);c&&(subscriptionsListeners=c);b=0;a=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage event subscribers.<br><br>";for(var f in subscriptionsListeners.CIM_ListenerDestination.responses)c=subscriptionsListeners.CIM_FilterCollectionSubscription.responses[f].Filter.ReferenceParameters.SelectorSet.Selector.Value.replace("(r)","®"),d=subscriptionsListeners.CIM_ListenerDestination.responses[f],
786
-a+="<div class=itemBar onclick='showSubscriptionDetails("+f+")'><div style=float:right></div><div style=padding-top:3px;overflow-x:hidden title='"+c+" - "+d.Destination+"'><b>"+c+"</b> - "+d.Destination+"</div><div style=padding-top:3px></div></div>",b++;0==b&&(a+="<div style=padding-left:15px><br><i>No subscriptions found.</i></div><br>");f="<div> "+AddRefreshButton("PullEventSubscriptions()");xxAccountAdminName&&(f+=AddButton("New Subscription","newSubscriptionButton()"));a+="<br><td class=r1>"+
787
-TableEnd(f+"</div>");QH(32,a)}}var subscriptionDeliveryModes={2:"Push",3:"Push with ACK",4:"Events",5:"Pull"};
786
+function processEventSubscriptions1(a,b,c,d){if(!(408==d||400==d||d&&errcheck(d,a))){d&&QV("go22",!0);c&&(subscriptionsListeners=c);b=0;a=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage event subscribers.<br><br>";for(var g in subscriptionsListeners.CIM_ListenerDestination.responses)c=subscriptionsListeners.CIM_FilterCollectionSubscription.responses[g].Filter.ReferenceParameters.SelectorSet.Selector.Value.replace("(r)","®"),d=subscriptionsListeners.CIM_ListenerDestination.responses[g],
787
+a+="<div class=itemBar onclick='showSubscriptionDetails("+g+")'><div style=float:right></div><div style=padding-top:3px;overflow-x:hidden title='"+c+" - "+d.Destination+"'><b>"+c+"</b> - "+d.Destination+"</div><div style=padding-top:3px></div></div>",b++;0==b&&(a+="<div style=padding-left:15px><br><i>No subscriptions found.</i></div><br>");g="<div> "+AddRefreshButton("PullEventSubscriptions()");xxAccountAdminName&&(g+=AddButton("New Subscription","newSubscriptionButton()"));a+="<br><td class=r1>"+
788
+TableEnd(g+"</div>");QH(32,a)}}var subscriptionDeliveryModes={2:"Push",3:"Push with ACK",4:"Events",5:"Pull"};
789
function showSubscriptionDetails(a){if(!xxdialogMode){var b=subscriptionsListeners.CIM_FilterCollectionSubscription.responses[a].Filter.ReferenceParameters.SelectorSet.Selector.Value.replace("(r)","®"),c=subscriptionsListeners.CIM_ListenerDestination.responses[a],d;d="<div style=text-align:left>"+addHtmlValue("Destination",c.Destination);d+=addHtmlValue("Filter",b);d+=addHtmlValue("Delivery Mode",subscriptionDeliveryModes[c.DeliveryMode]);setDialogMode(11,"Subscription "+(a+1),xxAccountAdminName?
790
5:1,deleteSubscriptionButton,d+"</div>",a)}}
791
function deleteSubscriptionButton(a,b){2==a&&amtstack.UnSubscribe("CIM_FilterCollectionSubscription",PullEventSubscriptions,null,1,{Filter:'<a:EndpointReference><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_FilterCollection</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">'+subscriptionsListeners.CIM_FilterCollectionSubscription.responses[b].Filter.ReferenceParameters.SelectorSet.Selector.Value+"</w:Selector></w:SelectorSet></a:ReferenceParameters></a:EndpointReference>",
@@ -796,15 +797,15 @@ setDialogMode(11,"Add Event Subscription",3,newSubscriptionButtonOk,a);newSubscr
797
function newSubscriptionButtonOk(){var a=0==Q("subuser").value.length?void 0:Q("subuser").value,b=0==Q("subpass").value.length?void 0:Q("subpass").value;amtstack.Subscribe("CIM_FilterCollection",Q("subtype").value,Q("suburl").value,newSubscriptionButtonOk2,null,1,{InstanceID:Q("subfilter").value},0<Q("subargs").value.length?Q("subargs").value:null,a,b)}function newSubscriptionButtonOk2(a,b,c,d){200==d&&PullEventSubscriptions()}
798
function PullAuditLog(a){1==a&&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(";");
799
function processAuditLog0(a,b,c,d){200==d&&(QV("go15",!0),b=c[0].AuditState,a=b&1?"Disabled":"Enabled",b&2&&(a+=", Locked"),b&4&&(a+=", Almost Full"),b&8&&(a+=", Full"),b&16&&(a+=", NoKey"),b="<h1>Audit Log Settings</h1>"+TableStart(),b+=TableEntry("State",a),b+=TableEntry("Storage",c[0].CurrentNumberOfRecords+" record(s), "+c[0].PercentageFree+"% free"),b+=TableEntry("Overwrite policy",2==c[0].OverwritePolicy?"Wraps when full":"Never overwrites"),b+=TableEnd(),QH(25,b),amtstack.GetAuditLog(processAuditLog1))}
799
-function processAuditLog1(a,b){auditLog=b;var c,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==b.length)d="No audit log events found.";else{var f=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>";
800
-for(c in b){var m=b[c],p=m.AuditApp,r=m.Initiator;f++;var l="";0<m.NetAddress.length&&(l=m.NetAddress.replace("0000:0000:0000:0000:0000:0000:0000:0001","::1"));m.Event&&(p+=", "+m.Event);null!=m.ExStr&&(p+=", "+m.ExStr);""!=r&&""!=l&&(r+=", ");d+="<tr id=xamtaudit"+c+" class=r3 onclick=showAuditDetails("+c+")><td class=r1 title='"+m.Time.toLocaleString()+"'> "+m.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br> "+m.Time.toLocaleTimeString("en",
801
-{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+r+l+"<td class=r1>"+p}d+=TableEnd(0==f?" ":"")+"<br>"}QH(26,d)}function auditFilter(){var a=Q("auditFilter").value.toLowerCase(),b;for(b in auditLog)QV("xamtaudit"+b,""==a||0<=JSON.stringify(auditLog[b]).toLowerCase().indexOf(a))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)}
800
+function processAuditLog1(a,b){auditLog=b;var c,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==b.length)d="No audit log events found.";else{var g=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>";
801
+for(c in b){var n=b[c],r=n.AuditApp,u=n.Initiator;g++;var m="";0<n.NetAddress.length&&(m=n.NetAddress.replace("0000:0000:0000:0000:0000:0000:0000:0001","::1"));n.Event&&(r+=", "+n.Event);null!=n.ExStr&&(r+=", "+n.ExStr);""!=u&&""!=m&&(u+=", ");d+="<tr id=xamtaudit"+c+" class=r3 onclick=showAuditDetails("+c+")><td class=r1 title='"+n.Time.toLocaleString()+"'> "+n.Time.toLocaleDateString("en",{year:"numeric",month:"2-digit",day:"numeric"})+"<br> "+n.Time.toLocaleTimeString("en",
802
+{hour:"2-digit",minute:"2-digit",second:"2-digit"})+"<td class=r1>"+u+m+"<td class=r1>"+r}d+=TableEnd(0==g?" ":"")+"<br>"}QH(26,d)}function auditFilter(){var a=Q("auditFilter").value.toLowerCase(),b;for(b in auditLog)QV("xamtaudit"+b,""==a||0<=JSON.stringify(auditLog[b]).toLowerCase().indexOf(a))}function SaveAuditLog(){xxdialogMode||null==auditLog||SaveJsonFile("IntelAmtAuditlog","auditevents","Intel AMT Audit Log",auditLog)}
803
function ClearAuditLog(a){QH(36,"Clear audit log?");setDialogMode(1,"Audit Log",3,ClearAuditLogEx)}function ClearAuditLogEx(){var a=amtstack.AMT_AuditLog_SetAuditLock(1,0,a,function(){amtstack.AMT_AuditLog_ClearLog(function(){amtstack.AMT_AuditLog_SetAuditLock(0,2,a,function(){setTimeout(PullAuditLog,1E3)})})})}function ShowAuditLogSettings(){xxdialogMode||amtstack.AMT_AuditLog_RequestStateChange(2,0,AuditLogSettingsCompleted)}
804
function AuditLogSettingsCompleted(a,b,c,d){200==d?PullAuditLog():messagebox("Audit Log","Error: "+d)}
804
-function showAuditDetails(a){if(!xxdialogMode){var b,c=auditLog[a],d;d="<div style=text-align:left>"+addHtmlValue("Time",c.Time.toLocaleString());""!=c.Initiator&&(d+=addHtmlValue("Initiator",c.Initiator));""!=c.NetAddress&&(d+=addHtmlValue("Address",c.NetAddress));d+=addHtmlValue("Application",c.AuditApp);d+=addHtmlValue("Event",c.Event);if(null!=c.ExStr)d+=addHtmlValue("Extended Data",c.ExStr);else if(0<c.Ex.length){var f="";for(b in c.Ex)0<f.length&&(f+=","),f+=c.Ex.charCodeAt(b);""!=f&&(d+=addHtmlValue("Data Values",
805
-f));2<c.Ex.length&&ReadShort(c.Ex,0)==c.Ex.length-2&&(d+=addHtmlValue("Data String",c.Ex.substring(2)))}messagebox("Audit Event #"+(a+1)+" Details",d+"</div>")}}var xxCertificates=null,xxCertPrivateKeys=null,xxTlsSettings=null,xxTlsCurrentCert=null,xxTLSCredentialContext=null,xxCaPrivateKey=null,xxCaSubjectAttributes=null;function PullCertificates(){amtstack.BatchEnum(null,["AMT_PublicKeyCertificate","AMT_PublicPrivateKeyPair","AMT_TLSSettingData","AMT_TLSCredentialContext"],processCerts1)}
806
-function processCerts1(a,b,c,d){if(400!=d&&!errcheck(d,a)){QV("go16",!0);xxCertificates=c.AMT_PublicKeyCertificate.responses;xxCertPrivateKeys=c.AMT_PublicPrivateKeyPair.responses;xxTlsSettings=c.AMT_TLSSettingData.responses;xxTLSCredentialContext=c.AMT_TLSCredentialContext.responses;xxTlsCurrentCert=null;if(0<xxTLSCredentialContext.length){a=xxTLSCredentialContext[0].ElementInContext.ReferenceParameters.SelectorSet.Selector.Value;for(var f in xxCertificates)xxCertificates[f].InstanceID==a&&(xxTlsCurrentCert=
807
-f)}for(f in xxCertificates)xxCertificates[f].TrustedRootCertficate=1==xxCertificates[f].TrustedRootCertficate,xxCertificates[f].X509Certificate=window.atob(xxCertificates[f].X509Certificate),xxCertificates[f].XIssuer=parseCertName(xxCertificates[f].Issuer),xxCertificates[f].XSubject=parseCertName(xxCertificates[f].Subject);amtcert_linkCertPrivateKey(xxCertificates,xxCertPrivateKeys);updateCertificates()}}
805
+function showAuditDetails(a){if(!xxdialogMode){var b,c=auditLog[a],d;d="<div style=text-align:left>"+addHtmlValue("Time",c.Time.toLocaleString());""!=c.Initiator&&(d+=addHtmlValue("Initiator",c.Initiator));""!=c.NetAddress&&(d+=addHtmlValue("Address",c.NetAddress));d+=addHtmlValue("Application",c.AuditApp);d+=addHtmlValue("Event",c.Event);if(null!=c.ExStr)d+=addHtmlValue("Extended Data",c.ExStr);else if(0<c.Ex.length){var g="";for(b in c.Ex)0<g.length&&(g+=","),g+=c.Ex.charCodeAt(b);""!=g&&(d+=addHtmlValue("Data Values",
806
+g));2<c.Ex.length&&ReadShort(c.Ex,0)==c.Ex.length-2&&(d+=addHtmlValue("Data String",c.Ex.substring(2)))}messagebox("Audit Event #"+(a+1)+" Details",d+"</div>")}}var xxCertificates=null,xxCertPrivateKeys=null,xxTlsSettings=null,xxTlsCurrentCert=null,xxTLSCredentialContext=null,xxCaPrivateKey=null,xxCaSubjectAttributes=null;function PullCertificates(){amtstack.BatchEnum(null,["AMT_PublicKeyCertificate","AMT_PublicPrivateKeyPair","AMT_TLSSettingData","AMT_TLSCredentialContext"],processCerts1)}
807
+function processCerts1(a,b,c,d){if(400!=d&&!errcheck(d,a)){QV("go16",!0);xxCertificates=c.AMT_PublicKeyCertificate.responses;xxCertPrivateKeys=c.AMT_PublicPrivateKeyPair.responses;xxTlsSettings=c.AMT_TLSSettingData.responses;xxTLSCredentialContext=c.AMT_TLSCredentialContext.responses;xxTlsCurrentCert=null;if(0<xxTLSCredentialContext.length){a=xxTLSCredentialContext[0].ElementInContext.ReferenceParameters.SelectorSet.Selector.Value;for(var g in xxCertificates)xxCertificates[g].InstanceID==a&&(xxTlsCurrentCert=
808
+g)}for(g in xxCertificates)xxCertificates[g].TrustedRootCertficate=1==xxCertificates[g].TrustedRootCertficate,xxCertificates[g].X509Certificate=window.atob(xxCertificates[g].X509Certificate),xxCertificates[g].XIssuer=parseCertName(xxCertificates[g].Issuer),xxCertificates[g].XSubject=parseCertName(xxCertificates[g].Subject);amtcert_linkCertPrivateKey(xxCertificates,xxCertPrivateKeys);updateCertificates()}}
809
function parseCertName(a){var b={},c=a.split(","),d;for(d in c)a=c[d].indexOf("="),b[c[d].substring(0,a)]=c[d].substring(a+1);return b}
810
function getTlsSecurityState(a){if(0==xxTlsSettings[a].Enabled)return"Disabled";var b=(1==xxTlsSettings[a].MutualAuthentication?"Mutual-auth TLS":"Server-auth TLS")+(1==xxTlsSettings[a].AcceptNonSecureConnections?" and non-TLS":"");1==xxTlsSettings[a].MutualAuthentication&&xxTlsSettings[a].TrustedCN&&(a=MakeToArray(xxTlsSettings[a].TrustedCN),0<a.length&&(b+=", Trusted name"+(1<a.length?"s":"")+": "+a.join(", ")+"."));return b}
811
function updateCertificates(){if(null!=xxCertificates){var a="Intel(r) AMT LMS TLS Settings"==xxTlsSettings[0].InstanceID?0:1,b=1-a,c=TableStart(),c=c+TableEntry("Remote TLS security",addLinkConditional(getTlsSecurityState(b),"showSetTlsSecurityDlg()",xxAccountAdminName)),c=c+TableEntry("Local TLS security",addLinkConditional(getTlsSecurityState(a),"showSetTlsSecurityDlg()",xxAccountAdminName)),c=c+TableEnd(),c=c+("<br>"+TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT certificates for this computer.<br><br>");
@@ -825,8 +826,8 @@ function issueCertButtonUpdate(){var a=getInputElement("certopen");QE("certopenp
826
function issueCertButtonOk(){var a=getInputElement("certopen"),b=xxDragDropCertFiles;a&&(b=a.files);b&&1==b.length?(a=new FileReader,a.onload=issueCertButtonOk2,a.readAsBinaryString(b[0])):issueCertButtonOk3(null)}function issueCertButtonOk2(a){0==amtcert_loadP12File(a.target.result,Q("certopenpass").value,issueCertButtonOk3)&&messagebox("Issue Certificate","Unable to decrypt/decode certificate.")}
827
function issueCertButtonOk3(a,b,c){xxCaPrivateKey=a;xxCaSubjectAttributes=b;amtstack.AMT_PublicKeyManagementService_GenerateKeyPair(0,2048,GenerateKeyPairResponse)}
828
function GenerateKeyPairResponse(a,b,c,d){200!=d?messagebox("Issue Certificate","Failed to generate key pair. Status: "+d):0!=c.Body.ReturnValue?messagebox("Issue Certificate","Failed to generate key pair, "+c.Body.ReturnValueStr):amtstack.Enum("AMT_PublicPrivateKeyPair",GenerateKeyPairResponse2,c.Body.KeyPair.ReferenceParameters.SelectorSet.Selector.Value)}
828
-function GenerateKeyPairResponse2(a,b,c,d,f){if(200!=d)messagebox("Issue Certificate","Failed to generate key pair. Status: "+d);else{a=null;for(var m in c)c[m].InstanceID==f&&(a=c[m].DERKey);c={CN:getInputElement("certcn").value,O:getInputElement("certo").value,ST:getInputElement("certst").value,C:getInputElement("certc").value};f={CN:"Untrusted Root Certificate"};if(null!=xxCaPrivateKey&&xxCaSubjectAttributes)for(m in f={},xxCaSubjectAttributes)f[xxCaSubjectAttributes[m].shortName]=xxCaSubjectAttributes[m].value;
829
-m={name:"extKeyUsage"};Q("d11_cu4").checked&&(m.serverAuth=!0);Q("d11_cu5").checked&&(m.clientAuth=!0);Q("d11_cu6").checked&&(m.emailProtection=!0);Q("d11_cu7").checked&&(m.codeSigning=!0);Q("d11_cu8").checked&&(m.timeStamping=!0);m=amtcert_signWithCaKey(a,xxCaPrivateKey,c,f,m);null==m?messagebox("Issue Certificate","Unable to sign certificate."):(m=forge.pki.certificateToPem(m).replace(/(\r\n|\n|\r)/gm,""),amtstack.AMT_PublicKeyManagementService_AddCertificate(m.substring(27,m.length-25),GenerateKeyPairResponse4))}}
829
+function GenerateKeyPairResponse2(a,b,c,d,g){if(200!=d)messagebox("Issue Certificate","Failed to generate key pair. Status: "+d);else{a=null;for(var n in c)c[n].InstanceID==g&&(a=c[n].DERKey);c={CN:getInputElement("certcn").value,O:getInputElement("certo").value,ST:getInputElement("certst").value,C:getInputElement("certc").value};g={CN:"Untrusted Root Certificate"};if(null!=xxCaPrivateKey&&xxCaSubjectAttributes)for(n in g={},xxCaSubjectAttributes)g[xxCaSubjectAttributes[n].shortName]=xxCaSubjectAttributes[n].value;
830
+n={name:"extKeyUsage"};Q("d11_cu4").checked&&(n.serverAuth=!0);Q("d11_cu5").checked&&(n.clientAuth=!0);Q("d11_cu6").checked&&(n.emailProtection=!0);Q("d11_cu7").checked&&(n.codeSigning=!0);Q("d11_cu8").checked&&(n.timeStamping=!0);n=amtcert_signWithCaKey(a,xxCaPrivateKey,c,g,n);null==n?messagebox("Issue Certificate","Unable to sign certificate."):(n=forge.pki.certificateToPem(n).replace(/(\r\n|\n|\r)/gm,""),amtstack.AMT_PublicKeyManagementService_AddCertificate(n.substring(27,n.length-25),GenerateKeyPairResponse4))}}
831
function GenerateKeyPairResponse4(a,b,c,d){200!=d?messagebox("Issue Certificate","Failed to generate key pair. Status: "+d):PullCertificates()}function certificateAdded(a,b,c,d){200!=d||0!=c.Body.ReturnValue?messagebox("Add Certificate","Unable to add certificate, error "+(200!=d?d:c.Body.ReturnValueStr)):PullCertificates()}function certificateRemoved(a,b,c,d){200!=d?messagebox("Remove Certificate","Unable to remove certificate, error "+d):PullCertificates()}
832
function getInputElement(a){var b=document.getElementsByTagName("input");for(t=0;t<b.length;t++)if(b[t].id==a)return b[t]}function getSelectElement(a){var b=document.getElementsByTagName("select");for(t=0;t<b.length;t++)if(b[t].id==a)return b[t]}
833
function showSetTlsSecurityDlg(a){if(!xxdialogMode){a="<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 b in xxCertificates)0!=xxCertificates[b].TrustedRootCertficate||!xxCertificates[b].XPrivateKey||null!=xxTlsCurrentCert&&xxTlsCurrentCert!=b||(a+="<option value="+b+">"+xxCertificates[b].XSubject.CN+"</option>");a+="</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>";
@@ -835,41 +836,41 @@ function showSetTlsSecurityDlg(a){if(!xxdialogMode){a="<div style=height:26px;ma
836
2:0)+(1==xxTlsSettings[b].AcceptNonSecureConnections?1:0);xxTlsSettings[b].TrustedCN&&(Q("d11_rcn").value=MakeToArray(xxTlsSettings[b].TrustedCN).join(", "));showSetTlsSecurityDlgUpdate()}}function showSetTlsSecurityDlgUpdate(){var a=getSelectElement("tlscert").value;QE("tlsremote",-1!=a);QV("d11rcn",-1!=a&&1<getSelectElement("tlsremote").value);a=!0;1<getSelectElement("tlsremote").value&&!splitDomains(Q("d11_rcn").value)&&(a=!1);QE("c37",a)}var setTlsSecurityPendingCalls,setTlsSecurityDeleteCredentialContext;
837
function showSetTlsSecurityDlgOk(){var a=getSelectElement("tlscert").value,b=getSelectElement("tlsremote").value,c=Clone(xxTlsSettings);setTlsSecurityPendingCalls=0;setTlsSecurityDeleteCredentialContext=null;if(-1!=a){if(0<xxTLSCredentialContext.length){var d=Clone(xxTLSCredentialContext[0]);d.ElementInContext.ReferenceParameters.SelectorSet.Selector.Value=xxCertificates[a].InstanceID;amtstack.Put("AMT_TLSCredentialContext",d,setTlsSecurityResponse,0,1)}else amtstack.Create("AMT_TLSCredentialContext",
838
{ElementInContext:"<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+amtstack.CompleteName("AMT_PublicKeyCertificate")+'</w:ResourceURI><w:SelectorSet><w:Selector Name="InstanceID">'+xxCertificates[a].InstanceID+"</w:Selector></w:SelectorSet></a:ReferenceParameters>",ElementProvidingContext:"<a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+amtstack.CompleteName("AMT_TLSProtocolEndpointCollection")+'</w:ResourceURI><w:SelectorSet><w:Selector Name="ElementName">TLSProtocolEndpointInstances Collection</w:Selector></w:SelectorSet></a:ReferenceParameters>'},
838
-setTlsSecurityResponse);setTlsSecurityPendingCalls++}else 0<xxTLSCredentialContext.length&&(setTlsSecurityDeleteCredentialContext=Clone(xxTLSCredentialContext[0]));var d="Intel(r) AMT LMS TLS Settings"==xxTlsSettings[0].InstanceID?0:1,f=1-d;c[f].Enabled=-1!=a;c[f].MutualAuthentication=2<=b;c[f].AcceptNonSecureConnections=1==b%2;c[f].TrustedCN=splitDomains(Q("d11_rcn").value);c[d].Enabled=-1!=a;amtstack.Put("AMT_TLSSettingData",c[0],setTlsSecurityResponse,0,1,c[0]);amtstack.Put("AMT_TLSSettingData",
839
+setTlsSecurityResponse);setTlsSecurityPendingCalls++}else 0<xxTLSCredentialContext.length&&(setTlsSecurityDeleteCredentialContext=Clone(xxTLSCredentialContext[0]));var d="Intel(r) AMT LMS TLS Settings"==xxTlsSettings[0].InstanceID?0:1,g=1-d;c[g].Enabled=-1!=a;c[g].MutualAuthentication=2<=b;c[g].AcceptNonSecureConnections=1==b%2;c[g].TrustedCN=splitDomains(Q("d11_rcn").value);c[d].Enabled=-1!=a;amtstack.Put("AMT_TLSSettingData",c[0],setTlsSecurityResponse,0,1,c[0]);amtstack.Put("AMT_TLSSettingData",
840
c[1],setTlsSecurityResponse,0,1,c[1]);setTlsSecurityPendingCalls+=2;statusbox("TLS Settings","Applying new security settings...")}function splitDomains(a){a=a.split(",");if(0!=a.length){for(var b in a)if(a[b]=a[b].trim(),0<=a[b].indexOf(" ")||0==a[b].length)return;if(!(4<a.length))return a}}
840
-function setTlsSecurityResponse(a,b,c,d,f){200!=d?messagebox("","Failed to set TLS security, status = "+d):c.Body.ReturnValueStr&&!methodcheck(c)||0!=--setTlsSecurityPendingCalls||amtstack.AMT_SetupAndConfigurationService_CommitChanges(null,setTlsSecurityResponse2)}function setTlsSecurityResponse2(a,b,c,d){200!=d?messagebox("","Failed to set TLS security, status = "+d):setTimeout(setTlsSecurityResponse3,2E3)}
841
+function setTlsSecurityResponse(a,b,c,d,g){200!=d?messagebox("","Failed to set TLS security, status = "+d):c.Body.ReturnValueStr&&!methodcheck(c)||0!=--setTlsSecurityPendingCalls||amtstack.AMT_SetupAndConfigurationService_CommitChanges(null,setTlsSecurityResponse2)}function setTlsSecurityResponse2(a,b,c,d){200!=d?messagebox("","Failed to set TLS security, status = "+d):setTimeout(setTlsSecurityResponse3,2E3)}
842
function setTlsSecurityResponse3(){null!=setTlsSecurityDeleteCredentialContext&&amtstack.Delete("AMT_TLSCredentialContext",setTlsSecurityDeleteCredentialContext,function(){});PullCertificates();setDialogMode()}var xxWatchdog=null;function PullWatchdog(){amtstack.BatchEnum(null,["*AMT_AgentPresenceCapabilities","AMT_AgentPresenceWatchdog","AMT_AgentPresenceWatchdogAction","AMT_StateTransitionCondition","CIM_ConcreteDependency"],PullWatchdogResponse)}
842
-function PullWatchdogResponse(a,b,c,d){if(200==d&&200==c.AMT_AgentPresenceCapabilities.status){xxWatchdog=c;for(var f in xxWatchdog.CIM_ConcreteDependency.responses)a=xxWatchdog.CIM_ConcreteDependency.responses[f],(b=getItem(a.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","CreationClassName"))&&"AMT_AgentPresenceWatchdog"==b.Value&&(d=getItem(a.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","DeviceID").Value,c=getItem(a.Dependent.ReferenceParameters.SelectorSet.Selector,
843
+function PullWatchdogResponse(a,b,c,d){if(200==d&&200==c.AMT_AgentPresenceCapabilities.status){xxWatchdog=c;for(var g in xxWatchdog.CIM_ConcreteDependency.responses)a=xxWatchdog.CIM_ConcreteDependency.responses[g],(b=getItem(a.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","CreationClassName"))&&"AMT_AgentPresenceWatchdog"==b.Value&&(d=getItem(a.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","DeviceID").Value,c=getItem(a.Dependent.ReferenceParameters.SelectorSet.Selector,
844
"@Name","PolicyConditionName").Value,d=getItem(xxWatchdog.AMT_AgentPresenceWatchdog.responses,"DeviceID",d),c=getItem(xxWatchdog.AMT_StateTransitionCondition.responses,"PolicyConditionName",c),d.transitions||(d.transitions=[]),d.transitions.push(c)),b&&"AMT_StateTransitionCondition"==b.Value&&(c=getItem(a.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","PolicyConditionName").Value,a=getItem(a.Dependent.ReferenceParameters.SelectorSet.Selector,"@Name","PolicyActionName").Value,c=getItem(xxWatchdog.AMT_StateTransitionCondition.responses,
845
"PolicyConditionName",c),a=getItem(xxWatchdog.AMT_AgentPresenceWatchdogAction.responses,"PolicyActionName",a),c.actions||(c.actions=[]),c.actions.push(a));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(";");
846
function updateWatchdog(){if(null!=xxWatchdog){var a;a=""+TableStart();a+=TableEntry("Maximum Watchdogs",xxWatchdog.AMT_AgentPresenceCapabilities.response.MaxTotalAgents+" watchdogs");a+=TableEntry("Maximum Total Actions",xxWatchdog.AMT_AgentPresenceCapabilities.response.MaxTotalActions+" actions");a+=TableEnd()+"<br>";a+=TableStart2();a+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT agent presence watchdogs.<br><br>";if(null==xxWatchdog.AMT_AgentPresenceWatchdog.responses||
847
0==xxWatchdog.AMT_AgentPresenceWatchdog.responses.length)a+="<div style=padding-left:15px><i>No agent presence watchdog found.</i></div><br>";else for(var b in xxWatchdog.AMT_AgentPresenceWatchdog.responses){var c=xxWatchdog.AMT_AgentPresenceWatchdog.responses[b],d=guidToStr(rstr2hex(atob(c.DeviceID)));c.MonitoredEntityDescription&&""!=c.MonitoredEntityDescription&&(d=EscapeHtml(c.MonitoredEntityDescription));a+="<div class=itemBar onclick=showWatchdogDetails("+b+")><input type=button style=float:right value='Add Action...' onclick=addWatchdogAction(event,"+
847
-b+")>";c.transitions&&(a+="<input type=button style=float:right value='Delete Actions...' onclick=deleteWatchdogActions(event,"+b+")>");a+="<div style=padding-top:3px><b>"+d+"</b>, "+amtstack.WatchdogCurrentStates[c.CurrentState]+"</div>";var d="",f;for(f in c.transitions){var m=c.transitions[f];""!=d&&(d+="<br>");d+=getWatchdogTransitionStr(m.OldState)+" → "+getWatchdogTransitionStr(m.NewState);m.actions&&1==m.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(a+="<div style=padding:12px>"+
848
+b+")>";c.transitions&&(a+="<input type=button style=float:right value='Delete Actions...' onclick=deleteWatchdogActions(event,"+b+")>");a+="<div style=padding-top:3px><b>"+d+"</b>, "+amtstack.WatchdogCurrentStates[c.CurrentState]+"</div>";var d="",g;for(g in c.transitions){var n=c.transitions[g];""!=d&&(d+="<br>");d+=getWatchdogTransitionStr(n.OldState)+" → "+getWatchdogTransitionStr(n.NewState);n.actions&&1==n.actions[0].EventOnTransition&&(d+=" : Event to log")}""!=d&&(a+="<div style=padding:12px>"+
849
d+"</div>");a+="</div>"}a=a+"<br>"+TableEnd(AddRefreshButton("PullWatchdog()")+AddButton("Add Watchdog...","AddWatchdog()"));a+="<br>";QH(30,a)}}function getWatchdogTransitionStr(a){if(31==a)return"Any State";var b="",c;for(c in amtstack.WatchdogCurrentStates)0!=(a&c)&&(b+=", "+amtstack.WatchdogCurrentStates[c]);return b.substring(2)}
850
function showWatchdogDetails(a){a=xxWatchdog.AMT_AgentPresenceWatchdog.responses[a];var b="";a.MonitoredEntityDescription&&""!=a.MonitoredEntityDescription&&(b+=addHtmlValue("Description",EscapeHtml(a.MonitoredEntityDescription)));b+=addHtmlValue("Monitored Entity",watchdogMonitoredEntity[a.MonitoredEntity]);b+=addHtmlValue("Current State",amtstack.WatchdogCurrentStates[a.CurrentState]);b+=addHtmlValue("Enabled State",watchdogEnabledStates[a.EnabledState]);b+=addHtmlValue("Startup Interval",a.StartupInterval+
851
" second(s)");b+=addHtmlValue("Timeout Interval",a.TimeoutInterval+" second(s)");setDialogMode(11,"Watchdog "+guidToStr(rstr2hex(atob(a.DeviceID))),5,showWatchdogDetailsOk,b,a)}function showWatchdogDetailsOk(a,b){2==a&&amtstack.Delete("AMT_AgentPresenceWatchdog",{DeviceID:b.DeviceID},PullWatchdog)}
852
function AddWatchdog(){var a;a="<div style=height:26px;margin-top:4px><input id=wgname style=float:right;width:240px maxlength=16 onkeyup=AddWatchdogUpdate()><div style=padding-top:4px>Name</div></div>"+("<div style=height:26px;margin-top:4px><input id=wgguid style=float:right;width:240px maxlength=36 onkeyup=AddWatchdogUpdate()><div style=padding-top:4px title='Generate random DeviceID'>"+addLink("DeviceID","GenerateWatchdogGuid()")+"</div></div>");a+="<div style=height:26px;margin-top:4px><input id=wgstart style=float:right;width:240px maxlength=8 placeholder=3600 onkeyup=AddWatchdogUpdate()><div style=padding-top:4px>Startup (seconds)</div></div>";
853
a+="<div style=height:26px;margin-top:4px><input id=wgtimeout style=float:right;width:240px maxlength=8 placeholder=60 onkeyup=AddWatchdogUpdate()><div style=padding-top:4px>Timeout (seconds)</div></div>";setDialogMode(11,"Add Watchdog",3,AddWatchdogOk,a);AddWatchdogUpdate()}function GenerateWatchdogGuid(){var a,b="";for(a=0;16>a;a++)b+=String.fromCharCode(random(255));Q("wgguid").value=guidToStr(rstr2hex(b));AddWatchdogUpdate()}
853
-function AddWatchdogUpdate(){for(var a=(""==Q("wgstart").value||0<parseInt(Q("wgstart").value))&&(""==Q("wgtimeout").value||0<parseInt(Q("wgtimeout").value)),b=0,c=Q("wgguid").value.toLowerCase(),d=0;d<c.length;d++){var f=c.charCodeAt(d);45!=f&&(48<=f&&57>=f||97<=f&&102>=f?b++:a=!1)}32!=b&&(a=!1);QE("dlgOkButton",a)}
854
+function AddWatchdogUpdate(){for(var a=(""==Q("wgstart").value||0<parseInt(Q("wgstart").value))&&(""==Q("wgtimeout").value||0<parseInt(Q("wgtimeout").value)),b=0,c=Q("wgguid").value.toLowerCase(),d=0;d<c.length;d++){var g=c.charCodeAt(d);45!=g&&(48<=g&&57>=g||97<=g&&102>=g?b++:a=!1)}32!=b&&(a=!1);QE("dlgOkButton",a)}
855
function AddWatchdogOk(){var a=Q("wgtimeout").value,b=Q("wgstart").value;""==a&&(a=60);""==b&&(b=3600);a={CreationClassName:0,DeviceID:btoa(hex2rstr(guidToStr(Q("wgguid").value.replace(/-/g,"")).replace(/-/g,""))),StartupInterval:b,SystemCreationClassName:0,SystemName:0,TimeoutInterval:a,MonitoredEntityDescription:Q("wgname").value};amtstack.Create("AMT_AgentPresenceWatchdog",a,AddWatchdogOk2)}
856
function AddWatchdogOk2(a,b,c,d){200!=d?messagebox("Watchdog","Unable to add watchdog, error #"+d):PullWatchdog()}
857
function addWatchdogAction(a,b){var c=xxWatchdog.AMT_AgentPresenceWatchdog.responses[b],d;d="<table><td style=width:180px>From<br>";for(b in amtstack.WatchdogCurrentStates)d+="<input id=wgsa"+b+" type=checkbox onclick=addWatchdogActionUpdate()> "+amtstack.WatchdogCurrentStates[b]+"<br />";d+="<td>To<br>";for(b in amtstack.WatchdogCurrentStates)d+="<input id=wgsb"+b+" type=checkbox onclick=addWatchdogActionUpdate()> "+amtstack.WatchdogCurrentStates[b]+"<br />";setDialogMode(11,"Add Watchdog Action",
858
3,addWatchdogActionOk,d+"</table><br>Perform Action<br><input id=wgsevent type=checkbox checked onclick=addWatchdogActionUpdate()>Write to event log<br />",c);addWatchdogActionUpdate();haltEvent(a)}function addWatchdogActionUpdate(){var a=0,b=0,c;for(c in amtstack.WatchdogCurrentStates)1==Q("wgsa"+c).checked&&(a+=parseInt(c)),1==Q("wgsb"+c).checked&&(b+=parseInt(c));QE("dlgOkButton",0<a&&0<b&&1==Q("wgsevent").checked)}
858
-function addWatchdogActionOk(a,b){var c=0,d=0,f;for(f in amtstack.WatchdogCurrentStates)1==Q("wgsa"+f).checked&&(c+=parseInt(f)),1==Q("wgsb"+f).checked&&(d+=parseInt(f));amtstack.AMT_AgentPresenceWatchdog_AddAction(c,d,Q("wgsevent").checked,null,null,AddWatchdogActionResponse,null,0,{DeviceID:b.DeviceID})}function AddWatchdogActionResponse(a,b,c,d){200!=d?messagebox("Watchdog Action","Unable to add watchdog action, error #"+d):PullWatchdog()}
859
+function addWatchdogActionOk(a,b){var c=0,d=0,g;for(g in amtstack.WatchdogCurrentStates)1==Q("wgsa"+g).checked&&(c+=parseInt(g)),1==Q("wgsb"+g).checked&&(d+=parseInt(g));amtstack.AMT_AgentPresenceWatchdog_AddAction(c,d,Q("wgsevent").checked,null,null,AddWatchdogActionResponse,null,0,{DeviceID:b.DeviceID})}function AddWatchdogActionResponse(a,b,c,d){200!=d?messagebox("Watchdog Action","Unable to add watchdog action, error #"+d):PullWatchdog()}
860
function deleteWatchdogActions(a,b){setDialogMode(11,"Delete Watchdog Actions",3,deleteWatchdogActionsOk,"Delete all actions for this watchdog?",xxWatchdog.AMT_AgentPresenceWatchdog.responses[b]);haltEvent(a)}function deleteWatchdogActionsOk(a,b){amtstack.AMT_AgentPresenceWatchdog_DeleteAllActions(deleteWatchdogActionResponse,null,0,{DeviceID:b.DeviceID})}
861
function deleteWatchdogActionResponse(a,b,c,d){200!=d?messagebox("Watchdog Action","Unable to remove watchdog actions, error #"+d):PullWatchdog()}
862
var xxSystemDefense=null,xxSystemDefenceLinkedPolicy={},xxUpdatingDefenseStats=!1,xxFilterStatistics=[{},{}],xxFilterStatisticsTimer=null,xxFilterStatisticsTimerActive=!1,xxSystemDefenceFilterEthernetTypes={2048:"All IP Packets",2054:"All ARP Packets"},xxSystemDefenceFilterIPTypes={4:"IPv4",6:"IPv6"},xxSystemDefenceFilterDesc={0:"Allow, Count",1:"Drop, Count",2:"Rate limit",3:"Allow",4:"Drop"},xxSystemDefenceFilters={HdrProtocolID:1,HdrDestAddress:2,HdrDestMask:2,HdrSrcAddress:2,HdrSrcMask:2,HdrSrcPortStart:1,
863
HdrSrcPortEnd:1,HdrDestPortStart:1,HdrDestPortEnd:1,HdrSrcAddressEndOfRange:2,"HdrDestAddressEndOfRange ":2,TCPFlagsOn:3,TCPFlagsOff:3};function PullSystemDefense(){amtFirstPull|=4;amtstack.BatchEnum(null,["AMT_SystemDefensePolicy","AMT_NetworkPortSystemDefensePolicy","AMT_Hdr8021Filter","AMT_IPHeadersFilter","AMT_NetworkFilter"],PullSystemDefenseResponse)}function PullSystemDefenseResponse(a,b,c,d){200==d&&(xxSystemDefense=c,updateSystemDefense(),QV("go18",!0))}
864
function updateSystemDefense(){if(null!=xxSystemDefense){var a="";xxSystemDefenceLinkedPolicy={};for(var b in xxSystemDefense.AMT_NetworkPortSystemDefensePolicy.responses){var c=xxSystemDefense.AMT_NetworkPortSystemDefensePolicy.responses[b],d=+getItem(c.Antecedent.ReferenceParameters.SelectorSet.Selector,"@Name","DeviceID").Value.substring(27),c=getItem(xxSystemDefense.AMT_SystemDefensePolicy.responses,"InstanceID",c.Dependent.ReferenceParameters.SelectorSet.Selector.Value);xxSystemDefenceLinkedPolicy[d]=
864
-c}a+=TableStart();b="<i>None</i>";xxSystemDefenceLinkedPolicy[0]&&(b=xxSystemDefenceLinkedPolicy[0].PolicyName);a+=TableEntry("Default Wired Policy",addLink(b,"changeDefaultPolicy(0)"));for(b=0;2>b;b++){var c=xxFilterStatistics[b],f;for(f in c)d=c[f],d=1==d?d+" packet":d+" packets",a+=TableEntry((0==b?"Wired ":"Wireless ")+f,d)}a+=TableEnd();a=a+"<br>"+TableStart2();a+="<tr><td class=r1 style=padding-left:15px;border:0><br>Manage Intel® AMT system defense policies.<br><br>";if(0==xxSystemDefense.AMT_SystemDefensePolicy.responses.length)a+=
865
+c}a+=TableStart();b="<i>None</i>";xxSystemDefenceLinkedPolicy[0]&&(b=xxSystemDefenceLinkedPolicy[0].PolicyName);a+=TableEntry("Default Wired Policy",addLink(b,"changeDefaultPolicy(0)"));for(b=0;2>b;b++){var c=xxFilterStatistics[b],g;for(g in c)d=c[g],d=1==d?d+" packet":d+" packets",a+=TableEntry((0==b?"Wired ":"Wireless ")+g,d)}a+=TableEnd();a=a+"<br>"+TableStart2();a+="<tr><td class=r1 style=padding-left:15px;border:0><br>Manage Intel® AMT system defense policies.<br><br>";if(0==xxSystemDefense.AMT_SystemDefensePolicy.responses.length)a+=
866
"<div style=padding-left:15px><i>No system defense policies found.</i></div><br>";else for(b in xxSystemDefense.AMT_SystemDefensePolicy.responses)c=xxSystemDefense.AMT_SystemDefensePolicy.responses[b],d="",c.FilterCreationHandles&&(c.FilterCreationHandles=MakeToArray(c.FilterCreationHandles),d=c.FilterCreationHandles.length,d=", "+d+" filter"+(1<d?"s":"")),a+="<div class=itemBar onclick=showPolicyDetails("+b+")><div style=padding-top:3px><b>"+EscapeHtml(c.PolicyName)+"</b>"+d+"</div></div>";a+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT system defense filters.<br><br>";
867
if(0==xxSystemDefense.AMT_Hdr8021Filter.responses.length&&0==xxSystemDefense.AMT_IPHeadersFilter.responses.length)a+="<div style=padding-left:15px><i>No system defense filters found.</i></div><br>";else{for(b in xxSystemDefense.AMT_Hdr8021Filter.responses)c=xxSystemDefense.AMT_Hdr8021Filter.responses[b],(d=xxSystemDefenceFilterEthernetTypes[c.HdrProtocolID8021])||(d="All Ethernet Protocol "+c.HdrProtocolID8021),d+=", "+xxSystemDefenceFilterDesc[c.FilterProfile],2==c.FilterProfile&&(d+=" at "+c.FilterProfileData+
868
" packet / sec"),1==c.ActionEventOnMatch&&(d+=", Event on match"),a+="<div class=itemBar onclick=showFilterDetails(0,"+b+")><div style=padding-top:3px><b>"+(0==c.FilterDirection?"← ":"→ ")+EscapeHtml(c.Name)+"</b>, "+d+"</div></div>";for(b in xxSystemDefense.AMT_IPHeadersFilter.responses){c=xxSystemDefense.AMT_IPHeadersFilter.responses[b];(d=xxSystemDefenceFilterIPTypes[c.HdrIPVersion])||(d="All Ethernet Protocol "+c.HdrIPVersion);d+=", "+xxSystemDefenceFilterDesc[c.FilterProfile];2==
868
-c.FilterProfile&&(d+=" at "+c.FilterProfileData+" packet / sec");1==c.ActionEventOnMatch&&(d+=", Event on match");var m=0;for(f in xxSystemDefenceFilters)c[f]&&m++;0<m&&(d+=", "+m+" filter"+(1<m?"s":""));a+="<div class=itemBar onclick=showFilterDetails(1,"+b+")><div style=padding-top:3px><b>"+(0==c.FilterDirection?"← ":"→ ")+EscapeHtml(c.Name)+"</b>, "+d+"</div></div>"}}a+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+
869
+c.FilterProfile&&(d+=" at "+c.FilterProfileData+" packet / sec");1==c.ActionEventOnMatch&&(d+=", Event on match");var n=0;for(g in xxSystemDefenceFilters)c[g]&&n++;0<n&&(d+=", "+n+" filter"+(1<n?"s":""));a+="<div class=itemBar onclick=showFilterDetails(1,"+b+")><div style=padding-top:3px><b>"+(0==c.FilterDirection?"← ":"→ ")+EscapeHtml(c.Name)+"</b>, "+d+"</div></div>"}}a+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullSystemDefense()")+AddButton("Add Filter...","AddDefenseFilter()")+
870
AddButton("Add Policy...","AddDefensePolicy()"));QH(29,a);null==xxFilterStatisticsTimer&&(UpdateDefenseStats(),xxFilterStatisticsTimerActive=!1,urlvars.norefresh||(xxFilterStatisticsTimer=setInterval(UpdateDefenseStats,5E3)))}}function StopDefenseStatsTimer(){null!=xxFilterStatisticsTimer&&(clearInterval(xxFilterStatisticsTimer),xxFilterStatisticsTimer=null);xxFilterStatisticsTimerActive=!1}
871
function UpdateDefenseStats(a){if(a||1!=xxFilterStatisticsTimerActive)xxFilterStatisticsTimerActive=!0,a=a?a:0,xxSystemDefenceLinkedPolicy[a]?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 '+a+"</w:Selector></w:SelectorSet></a:ReferenceParameters>",!1,UpdateDefenseStats2,a,0,{InstanceID:xxSystemDefenceLinkedPolicy[a].InstanceID}):
871
-(xxFilterStatistics[a]={},updateSystemDefense(),StopDefenseStatsTimer())}function UpdateDefenseStats2(a,b,c,d,f){200==d?amtstack.Enum("AMT_ActiveFilterStatistics",UpdateDefenseStats3,f):StopDefenseStatsTimer()}
872
-function UpdateDefenseStats3(a,b,c,d,f){a=0;if(200==d){xxFilterStatistics[f]={};for(var m in c)d=c[m].ReadCount,b=getItem(c[m].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[f][b]=d,a++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==a&&StopDefenseStatsTimer()}
872
+(xxFilterStatistics[a]={},updateSystemDefense(),StopDefenseStatsTimer())}function UpdateDefenseStats2(a,b,c,d,g){200==d?amtstack.Enum("AMT_ActiveFilterStatistics",UpdateDefenseStats3,g):StopDefenseStatsTimer()}
873
+function UpdateDefenseStats3(a,b,c,d,g){a=0;if(200==d){xxFilterStatistics[g]={};for(var n in c)d=c[n].ReadCount,b=getItem(c[n].Dependent.ReferenceParameters.SelectorSet.Selector[1].Value.EndpointReference.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value,xxFilterStatistics[g][b]=d,a++;updateSystemDefense()}xxFilterStatisticsTimerActive=!1;0==a&&StopDefenseStatsTimer()}
874
function changeDefaultPolicy(a){if(!xxdialogMode){var b;b="<div style=height:26px;margin-top:4px><select id=policySelection style=float:right;width:266px><option value=-1>None";for(var c in xxSystemDefense.AMT_SystemDefensePolicy.responses)b+="<option value="+c+(xxSystemDefenceLinkedPolicy[a]&&xxSystemDefense.AMT_SystemDefensePolicy.responses[c].InstanceID==xxSystemDefenceLinkedPolicy[a].InstanceID?" selected":"")+">"+xxSystemDefense.AMT_SystemDefensePolicy.responses[c].PolicyName;setDialogMode(11,
875
"Default System Defense Policy",3,changeDefaultPolicyOk,b+"</select><div style=padding-top:4px>Default Policy</div></div>",a)}}
876
function changeDefaultPolicyOk(a,b){var c=Q("policySelection").value,d=xxSystemDefenceLinkedPolicy[b];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 '+b+
@@ -882,12 +883,12 @@ function AddDefenseFilter(){if(!xxdialogMode){var a;a="<div style=height:26px;ma
883
a+="<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>";a+="<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",
884
3,AddDefenseFilterOk,a);AddDefenseFilterUpdate()}}
885
function AddDefenseFilterOk(){if(1>=Q("filtertype").value){var a=0==Q("filtertype").value?2048:2054,b={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrProtocolID8021:a,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value};2==Q("filterprofile").value&&(b.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_Hdr8021Filter",b,AddDefenseFilterOk2)}else{var a=2==Q("filtertype").value?
885
-4:6,b={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:a,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},c=Q("ipfilter").value.split(","),d;for(d in c){var f=c[d].indexOf("="),m=c[d].substring(0,f),f=c[d].substring(f+1),p=xxSystemDefenceFilters[m];p||(m="Hdr"+m,p=xxSystemDefenceFilters[m]);p&&(2==p&&4==a?(f=f.split("."),4==f.length&&(b[m]=rstr2hex(String.fromCharCode(parseInt(f[0]),
886
-parseInt(f[1]),parseInt(f[2]),parseInt(f[3]))))):b[m]=f)}2==Q("filterprofile").value&&(b.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",b,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var a=0<Q("filtername").value.length;a&&2==Q("filterprofile").value&&(a=parseInt(Q("filterdata").value),a=0<a&&4294967295>a);QE("c37",a);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)}
886
+4:6,b={"InstanceID ":0,Name:Q("filtername").value,CreationClassName:0,SystemName:0,SystemCreationClassName:0,HdrIPVersion:a,FilterProfile:Q("filterprofile").value,FilterDirection:Q("filterdir").value,ActionEventOnMatch:Q("filteraction").value},c=Q("ipfilter").value.split(","),d;for(d in c){var g=c[d].indexOf("="),n=c[d].substring(0,g),g=c[d].substring(g+1),r=xxSystemDefenceFilters[n];r||(n="Hdr"+n,r=xxSystemDefenceFilters[n]);r&&(2==r&&4==a?(g=g.split("."),4==g.length&&(b[n]=rstr2hex(String.fromCharCode(parseInt(g[0]),
887
+parseInt(g[1]),parseInt(g[2]),parseInt(g[3]))))):b[n]=g)}2==Q("filterprofile").value&&(b.FilterProfileData=Q("filterdata").value);amtstack.Create("AMT_IPHeadersFilter",b,AddDefenseFilterOk2)}}function AddDefenseFilterUpdate(){var a=0<Q("filtername").value.length;a&&2==Q("filterprofile").value&&(a=parseInt(Q("filterdata").value),a=0<a&&4294967295>a);QE("c37",a);QV("filterdatadiv",2==Q("filterprofile").value);QV("ipfilterdiv",2<=Q("filtertype").value)}
888
function AddDefenseFilterOk2(a,b,c,d){200!=d?messagebox("Add System Defense Filter","Unable to add filter, error #"+d):PullSystemDefense()}
888
-function showFilterDetails(a,b){if(!xxdialogMode){var c,d,f,m;0==a?(m="AMT_Hdr8021Filter",f="Ethernet Traffic",d=xxSystemDefense[m].responses[b],(c=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(c="All Ethernet Protocol "+d.HdrProtocolID8021)):(m="AMT_IPHeadersFilter",f="IP Traffic",d=xxSystemDefense[m].responses[b],(c=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(c="All IP Protocol "+d.HdrIPVersion));var p;p=""+addHtmlValue("Name",EscapeHtml(d.Name));p+=addHtmlValue("Type",f);p+=addHtmlValue("Matching Traffic",
889
-c);p+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==a)for(var r in xxSystemDefenceFilters)d[r]&&(c=r,f=d[r],a=xxSystemDefenceFilters[r],2==a&&4==f.length&&(f=hex2rstr(f),f=f.charCodeAt(0)+"."+f.charCodeAt(1)+"."+f.charCodeAt(2)+"."+f.charCodeAt(3)),c.startsWith("Hdr")&&(c=c.substring(3)),p+=addHtmlValue("Filter "+c,f));p+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk,
890
-p,[m,d])}}function showFilterDetailsOk(a,b){2==a&&amtstack.Delete(b[0],b[1],deleteDefenseFilter)}function deleteDefenseFilter(a,b,c,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters;
889
+function showFilterDetails(a,b){if(!xxdialogMode){var c,d,g,n;0==a?(n="AMT_Hdr8021Filter",g="Ethernet Traffic",d=xxSystemDefense[n].responses[b],(c=xxSystemDefenceFilterEthernetTypes[d.HdrProtocolID8021])||(c="All Ethernet Protocol "+d.HdrProtocolID8021)):(n="AMT_IPHeadersFilter",g="IP Traffic",d=xxSystemDefense[n].responses[b],(c=xxSystemDefenceFilterIPTypes[d.HdrIPVersion])||(c="All IP Protocol "+d.HdrIPVersion));var r;r=""+addHtmlValue("Name",EscapeHtml(d.Name));r+=addHtmlValue("Type",g);r+=addHtmlValue("Matching Traffic",
890
+c);r+=addHtmlValue("Direction",0==d.FilterDirection?"Outbound / Transmit":"Inbound / Receive");if(1==a)for(var u in xxSystemDefenceFilters)d[u]&&(c=u,g=d[u],a=xxSystemDefenceFilters[u],2==a&&4==g.length&&(g=hex2rstr(g),g=g.charCodeAt(0)+"."+g.charCodeAt(1)+"."+g.charCodeAt(2)+"."+g.charCodeAt(3)),c.startsWith("Hdr")&&(c=c.substring(3)),r+=addHtmlValue("Filter "+c,g));r+=addHtmlValue("Event on match",1==d.ActionEventOnMatch?"Yes":"No");setDialogMode(11,"Ethernet Filter #"+d.InstanceID,5,showFilterDetailsOk,
891
+r,[n,d])}}function showFilterDetailsOk(a,b){2==a&&amtstack.Delete(b[0],b[1],deleteDefenseFilter)}function deleteDefenseFilter(a,b,c,d){200!=d?messagebox("Remove Filter","Unable to remove filter, make sure it's not in use."):PullSystemDefense()}var xxAddDefensePolicyFilters;
892
function AddDefensePolicy(){if(!xxdialogMode){xxAddDefensePolicyFilters=[];var a;a="<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>";a+=
893
"<div id=policyFilters></div>";if(0<xxSystemDefense.AMT_Hdr8021Filter.responses.length||0<xxSystemDefense.AMT_IPHeadersFilter.responses.length){a+="<div style=height:26px;margin-top:4px><div style=float:right><select id=xfilter style=width:186px>";for(var b in xxSystemDefense.AMT_Hdr8021Filter.responses){var c=xxSystemDefense.AMT_Hdr8021Filter.responses[b];a+="<option value="+c.InstanceID+">"+c.Name}for(b in xxSystemDefense.AMT_IPHeadersFilter.responses)c=xxSystemDefense.AMT_IPHeadersFilter.responses[b],
894
a+="<option value="+c.InstanceID+">"+c.Name;a+="</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,a);AddDefensePolicyUpdate()}}function addFilterButton(){0<=xxAddDefensePolicyFilters.indexOf(Q("xfilter").value)||(xxAddDefensePolicyFilters.push(Q("xfilter").value),AddDefensePolicyUpdate())}
@@ -900,13 +901,13 @@ function showPolicyDetails(a){if(!xxdialogMode){var b=xxSystemDefense.AMT_System
901
c+=addHtmlValue("Default RX Action",d);if(b.FilterCreationHandles)for(a in b.FilterCreationHandles)c+=addHtmlValue("Filter #"+(+a+1),GetFilterById(b.FilterCreationHandles[a]).Name);setDialogMode(11,"Policy #"+b.InstanceID.substring(20),5,showPolicyDetailsOk,c,b)}}function showPolicyDetailsOk(a,b){2==a&&amtstack.Delete("AMT_SystemDefensePolicy",b,deleteDefensePolicy)}
902
function deleteDefensePolicy(a,b,c,d){200!=d?messagebox("Remove Policy","Unable to remove policy, make sure it's not in use."):PullSystemDefense()}var xxWireless;function PullWireless(){amtFirstPull|=2;-1!=amtwirelessif&&amtstack.BatchEnum("",["*CIM_WiFiPortCapabilities","*CIM_WiFiPort","*CIM_WiFiEndpoint","CIM_WiFiEndpointSettings"],processWireless)}function wifiRefresh(){xxdialogMode||PullWireless()}
903
var xxWifiState={3:"Disabled",32768:"Enabled in S0",32769:"Enabled in S0, Sx/AC"},xxRadioState={2:"On, Connected",3:"Off",6:"On, Disconnected"},xxWifiAuthenticationMethod={1:"Other",2:"Open",3:"Shared Key",4:"WPA PSK",5:"WPA IEEE 802.1x",6:"WPA2 PSK",7:"WPA2 IEEE 802.1x"},xxWifiEncryptionMethod={1:"Other",2:"WEP",3:"TKIP-RC4",4:"CCMP-AES",5:"None"};function processWireless(a,b,c,d){xxWireless=200==d?c:void 0;updateSystemStatus();showWirelessInfo()}
903
-function showWirelessInfo(){if(xxWireless){var a,b,c="",d,f;if(xxWireless.CIM_WiFiPortCapabilities.response){f="<br><h2>Wireless Profiles</h2>"+TableStart2();f+="<tr><td class=r2 style=padding-left:15px><br>Wireless profiles that Intel® AMT will use for network connectivity.<br><br>";for(a=c=0;256>a;a++)for(b in xxWireless.CIM_WiFiEndpointSettings.responses)d=xxWireless.CIM_WiFiEndpointSettings.responses[b],1!=d.AuthenticationMethod&&d.Priority==a&&(f+="<div class=itemBar onclick=showWifiDetails("+
904
-b+")><div style=float:right>"+EscapeHtml(d.SSID)+", "+xxWifiAuthenticationMethod[d.AuthenticationMethod]+", "+xxWifiEncryptionMethod[d.EncryptionMethod]+" ",xxAccountAdminName&&(f+=AddButton2("Remove",'wifiRemoveButton("'+b+'")')),f+="</div><div style=padding-top:3px><b>"+EscapeHtml(d.ElementName)+"</b></div></div>",c++);0==c&&(f+="<i>No Wireless Profiles Present</i><br>");f+="<br><td class=r2>";f=xxAccountAdminName?f+TableEnd(AddButton("New Profile","showWifiNewProfile()")):f+TableEnd("");
905
-QH(20,f+"<br>")}}}function showWifiStateDlg(){if(!xxdialogMode){var a="",b;for(b in xxWifiState)a+="<input type=radio name=d11 id=wl"+b+" value="+b+" "+(xxWireless.CIM_WiFiPort.response.EnabledState==b?"checked":"")+">"+xxWifiState[b]+"<br>";setDialogMode(11,"Wireless State",3,wifiStateDlg,a)}}
904
+function showWirelessInfo(){if(xxWireless){var a,b,c="",d,g;if(xxWireless.CIM_WiFiPortCapabilities.response){g="<br><h2>Wireless Profiles</h2>"+TableStart2();g+="<tr><td class=r2 style=padding-left:15px><br>Wireless profiles that Intel® AMT will use for network connectivity.<br><br>";for(a=c=0;256>a;a++)for(b in xxWireless.CIM_WiFiEndpointSettings.responses)d=xxWireless.CIM_WiFiEndpointSettings.responses[b],1!=d.AuthenticationMethod&&d.Priority==a&&(g+="<div class=itemBar onclick=showWifiDetails("+
905
+b+")><div style=float:right>"+EscapeHtml(d.SSID)+", "+xxWifiAuthenticationMethod[d.AuthenticationMethod]+", "+xxWifiEncryptionMethod[d.EncryptionMethod]+" ",xxAccountAdminName&&(g+=AddButton2("Remove",'wifiRemoveButton("'+b+'")')),g+="</div><div style=padding-top:3px><b>"+EscapeHtml(d.ElementName)+"</b></div></div>",c++);0==c&&(g+="<i>No Wireless Profiles Present</i><br>");g+="<br><td class=r2>";g=xxAccountAdminName?g+TableEnd(AddButton("New Profile","showWifiNewProfile()")):g+TableEnd("");
906
+QH(20,g+"<br>")}}}function showWifiStateDlg(){if(!xxdialogMode){var a="",b;for(b in xxWifiState)a+="<input type=radio name=d11 id=wl"+b+" value="+b+" "+(xxWireless.CIM_WiFiPort.response.EnabledState==b?"checked":"")+">"+xxWifiState[b]+"<br>";setDialogMode(11,"Wireless State",3,wifiStateDlg,a)}}
907
function wifiStateDlg(){amtstack.CIM_WiFiPort_RequestStateChange(document.querySelector("input[name=d11]:checked").value,null,function(){amtstack.Get("CIM_WiFiPort",function(a,b,c,d){200==d&&(xxWireless.CIM_WiFiPort.response=c.Body,showWirelessInfo())})})}
908
function showWifiDetails(a){if(!xxdialogMode){a=xxWireless.CIM_WiFiEndpointSettings.responses[a];var b;b="<div style=text-align:left>"+addHtmlValue("Profile Name",EscapeHtml(a.ElementName));b+=addHtmlValue("SSID",a.SSID);b+=addHtmlValue("Authentication",xxWifiAuthenticationMethod[a.AuthenticationMethod]);b+=addHtmlValue("Encryption",xxWifiEncryptionMethod[a.EncryptionMethod]);b+=addHtmlValue("Priority",a.Priority);messagebox("Wireless Profile",b+"</div>")}}
909
function wifiRemoveButton(a){xxdialogMode||(QH(36,'Remove wireless profile "'+xxWireless.CIM_WiFiEndpointSettings.responses[a].ElementName+'"?'),setDialogMode(1,"Wireless Profile",3,function(){removeWifiButtonEx(a)}))}function removeWifiButtonEx(a){amtstack.Delete("CIM_WiFiEndpointSettings",{InstanceID:xxWireless.CIM_WiFiEndpointSettings.responses[a].InstanceID},removeWifiEntryResponse,0,1)}
909
-function removeWifiEntryResponse(a,b,c,d,f){methodcheck(c)||amtstack.Enum("CIM_WiFiEndpointSettings",function(a,b,c,d){200==d&&(xxWireless.CIM_WiFiEndpointSettings.responses=c,showWirelessInfo())})}
910
+function removeWifiEntryResponse(a,b,c,d,g){methodcheck(c)||amtstack.Enum("CIM_WiFiEndpointSettings",function(a,b,c,d){200==d&&(xxWireless.CIM_WiFiEndpointSettings.responses=c,showWirelessInfo())})}
911
function showWifiNewProfile(){if(!xxdialogMode){var a="";for(i=1;256>i;i++){var b=1;for(j in xxWireless.CIM_WiFiEndpointSettings.responses)xxWireless.CIM_WiFiEndpointSettings.responses[j].Priority==i&&(b=0);b&&(a+="<option value="+i+">"+i)}QH("c13",a);c14.value=6;c15.value=4;c11.value=c12.value=c16.value=c17.value="";setDialogMode(12,"Add Wireless Profile",3,function(){addWifiProfile()});updateWifiDialog()}}
912
function addWifiProfile(){amtstack.AMT_WiFiPortConfigurationService_AddWiFiSettings({__parameterType:"reference",__resourceUri:amtstack.CompleteName("CIM_WiFiEndpoint"),Name:"WiFi Endpoint 0"},{__parameterType:"instance",__namespace:amtstack.CompleteName("CIM_WiFiEndpointSettings"),ElementName:c11.value,InstanceID:"Intel(r) AMT:WiFi Endpoint Settings "+c11.value,AuthenticationMethod:c14.value,EncryptionMethod:c15.value,SSID:c12.value,Priority:c13.value,
913
PSKPassPhrase:c16.value},null,null,null,removeWifiEntryResponse)}
@@ -914,52 +915,52 @@ function updateWifiDialog(){var a=!0,b=c14.value,c=c15.value;QV(42,4>b);QV(41,3<
915
c17.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}
916
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",
917
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;
917
-function processHardware(a,b,c,d){if(200==d){var f;a="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>";HardwareInventory=c;QV("go2",!0);a+=TableEnd("<div> "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");b=c.CIM_Chassis.response;d=c.CIM_Card.response;var m=c.CIM_BIOSElement.response.SoftwareElementID;a=a+"<br><h2>Platform</h2>"+FullTable({"Computer model":b.Model,Manufacturer:b.Manufacturer,
918
-Version:b.Version,"Serial number":b.SerialNumber,"System ID":guidToStr(c.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");a+="<br><h2>Baseboard</h2>";a+=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"},"");a+="<br><h2>BIOS</h2>";a+=FullTable({Vendor:c.CIM_BIOSElement.response.Manufacturer,Version:m,"Release date":(new Date(c.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en",
919
-{timeZone:"UTC"})},"");a+="<br>";for(f in c.CIM_Processor.responses)b=c.CIM_Processor.responses[f],d=c.CIM_Chip.responses[f],a+="<h2>Processor "+(parseInt(f)+1)+"</h2>",a+=FullTable({Manufacturer:trademarks(d.Manufacturer),Family:DMTFProcFamilly[b.Family],Version:trademarks(d.Version),"Maximum socket speed":b.MaxClockSpeed+" MHz",Status:DMTFCPUStatus[b.CPUStatus]},"");a+="<br>";for(f in c.CIM_PhysicalMemory.responses)b=c.CIM_PhysicalMemory.responses[f],a+="<h2>Memory Module "+(+f+1)+"</h2>",a+=FullTable({"Bank Label":b.BankLabel,
920
-Manufacturer:b.Manufacturer,"Serial Number":b.SerialNumber,Size:parseInt(b.Capacity/1048576)+" MB","Form factor":DMTFMemFormFactor[b.FormFactor],Type:DMTFMemType[b.MemoryType],"Asset tag":b.Tag,"Part number":b.PartNumber},"");a+="<br>";for(f in c.CIM_MediaAccessDevice.responses)b=c.CIM_MediaAccessDevice.responses[f],d=c.CIM_PhysicalPackage.responses[+f+1],a+="<h2>Storage Media "+(parseInt(f)+1)+"</h2>",a+=FullTable({Model:d.Model,"Serial number":""==d.SerialNumber?"Unknown":d.SerialNumber,Size:parseInt(Math.round(1E3*
918
+function processHardware(a,b,c,d){if(200==d){var g;a="<table class=log1 cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px>";HardwareInventory=c;QV("go2",!0);a+=TableEnd("<div> "+AddRefreshButton("PullHardware(1)")+AddButton("Save...","SaveHardwareLog()")+" Hardware information is gathered at system boot time.");b=c.CIM_Chassis.response;d=c.CIM_Card.response;var n=c.CIM_BIOSElement.response.SoftwareElementID;a=a+"<br><h2>Platform</h2>"+FullTable({"Computer model":b.Model,Manufacturer:b.Manufacturer,
919
+Version:b.Version,"Serial number":b.SerialNumber,"System ID":guidToStr(c.CIM_SystemPackaging.responses[0].PlatformGUID).toLowerCase()},"");a+="<br><h2>Baseboard</h2>";a+=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"},"");a+="<br><h2>BIOS</h2>";a+=FullTable({Vendor:c.CIM_BIOSElement.response.Manufacturer,Version:n,"Release date":(new Date(c.CIM_BIOSElement.response.ReleaseDate.Datetime)).toLocaleDateString("en",
920
+{timeZone:"UTC"})},"");a+="<br>";for(g in c.CIM_Processor.responses)b=c.CIM_Processor.responses[g],d=c.CIM_Chip.responses[g],a+="<h2>Processor "+(parseInt(g)+1)+"</h2>",a+=FullTable({Manufacturer:trademarks(d.Manufacturer),Family:DMTFProcFamilly[b.Family],Version:trademarks(d.Version),"Maximum socket speed":b.MaxClockSpeed+" MHz",Status:DMTFCPUStatus[b.CPUStatus]},"");a+="<br>";for(g in c.CIM_PhysicalMemory.responses)b=c.CIM_PhysicalMemory.responses[g],a+="<h2>Memory Module "+(+g+1)+"</h2>",a+=FullTable({"Bank Label":b.BankLabel,
921
+Manufacturer:b.Manufacturer,"Serial Number":b.SerialNumber,Size:parseInt(b.Capacity/1048576)+" MB","Form factor":DMTFMemFormFactor[b.FormFactor],Type:DMTFMemType[b.MemoryType],"Asset tag":b.Tag,"Part number":b.PartNumber},"");a+="<br>";for(g in c.CIM_MediaAccessDevice.responses)b=c.CIM_MediaAccessDevice.responses[g],d=c.CIM_PhysicalPackage.responses[+g+1],a+="<h2>Storage Media "+(parseInt(g)+1)+"</h2>",a+=FullTable({Model:d.Model,"Serial number":""==d.SerialNumber?"Unknown":d.SerialNumber,Size:parseInt(Math.round(1E3*
922
b.MaxMediaSize/1048576))+" MB"},"");a+="<br>";QH(16,a);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(a,b,c,d){AmtSystemPowerSchemes=c;updateSystemStatus()}
923
function showPowerPolicyDlg(a){if(!xxdialogMode){for(var b="",c=0;c<AmtSystemPowerSchemes.length;c++)b+='<input type=radio name=powerpolicy value="'+AmtSystemPowerSchemes[c].InstanceID+'" '+(AmtSystemPowerSchemes[c].SchemeGUID==a?" checked":"")+">"+AmtSystemPowerSchemes[c].Description+"<br>";setDialogMode(11,"Intel® AMT Power Policy",3,showPowerPolicyDlgOk,b)}}
924
function showPowerPolicyDlgOk(){for(var a=null,b=0,c=document.getElementsByTagName("input");b<c.length;b++)"powerpolicy"==c[b].name&&c[b].checked&&(a=c[b].value);amtstack.AMT_SystemPowerScheme_SetPowerScheme(showPowerPolicyDlgOkDone,a)}function showPowerPolicyDlgOkDone(a,b,c,d){200==d&&PullSystemStatus()}var xxAccountAdminName,xxAccountRealmInfo,xxAccountEnabledInfo={},xxAccountFetch,showHiddenAccounts=!1;
925
function PullUserInfo(){xxAccountFetch=1;delete xxAccountAdminName;xxAccountRealmInfo={};amtstack.AMT_AuthorizationService_GetAdminAclEntry(getAdminAclEntryResponse);amtstack.AMT_AuthorizationService_EnumerateUserAclEntries(1,enumerateUserAclEntriesResponse)}function getAdminAclEntryResponse(a,b,c,d){200==d&&(xxAccountRealmInfo[-1]={AccessPermission:999,DigestUsername:c.Body.Username,Realms:null},xxAccountAdminName=c.Body.Username,updateAccounts())}
925
-function enumerateUserAclEntriesResponse(a,b,c,d){if(200==d){methodcheck(c);QV("go11",!0);xxAccountFetch=c.Body.Handles.length;for(var f in c.Body.Handles)a=c.Body.Handles[f],amtstack.AMT_AuthorizationService_GetAclEnabledState(a,getAclEnabledStateResponse,a),amtstack.AMT_AuthorizationService_GetUserAclEntryEx(a,getUserAclEntryExResponse,a);updateAccounts()}}
926
-function getUserAclEntryExResponse(a,b,c,d,f){xxAccountFetch--;200==d&&(c.Body.Handle=f,c.Body.Realms?Array.isArray(c.Body.Realms)||(c.Body.Realms=[c.Body.Realms]):c.Body.Realms=[],xxAccountRealmInfo[f]=c.Body,updateAccounts())}function getAclEnabledStateResponse(a,b,c,d,f){200==d&&(xxAccountEnabledInfo[f]=c.Body,updateAccounts())}function setAclEnabledStateResponse(a,b,c,d,f){errcheck(d,a)||(methodcheck(c),amtstack.AMT_AuthorizationService_GetAclEnabledState(f,getAclEnabledStateResponse,f))}
927
-function updateAccounts(){if(!(0<xxAccountFetch)){var a=TableStart2(),a=a+"<tr><td class=r1 style=padding-left:15px><br>Manage the Intel® AMT user accounts for this computer.<br><br>",b;for(b in xxAccountRealmInfo){var c=xxAccountRealmInfo[b],d,f=!1,m=0;c.DigestUsername?(d=c.DigestUsername,f="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(c.KerberosUserSid));xxAccountEnabledInfo[b]&&"$$OsAdmin"!=d&&(m=1==xxAccountEnabledInfo[b].Enabled?1:2);if(showHiddenAccounts||!f){var p="";if(999!=c.AccessPermission){2==
928
-m&&(p+="Disabled, ");var r=0;for(b in c.Realms)""!=amtstack.RealmNames[c.Realms[b]]&&r++;0<=c.Realms.indexOf(20)&&(p+="Auditor, ");p=0<=c.Realms.indexOf(3)?p+"Administrator":1==r?p+"1 realm":p+(r+" realms")}else p+="Administrator",c.Handle=-1;a+="<div class=itemBar onclick=showUserDetails("+c.Handle+")><div style=float:right>";0<m&&xxAccountAdminName&&(a+=" "+AddButton2(1==m?"Disable":"Enable","changeAccountStateButton(event,"+c.Handle+","+m+")"));!f&&xxAccountAdminName&&(a+=" "+AddButton2("Edit...",
929
-"changeAccountButton(event,"+c.Handle+")"));a+="</div><div style=padding-top:3px;width:330px;float:left;overflow-x:hidden title='"+d+"'><b>"+d+"</b></div><div style=padding-top:3px>"+p+"</div></div>"}}b="<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&&(b+=AddButton("New Account",
930
-"newAccountButton()"));a+="<br><td class=r1>"+TableEnd(b+"</div>");QH(21,a)}}function toggleAccountButton(){showHiddenAccounts=!showHiddenAccounts;updateAccounts()}function removeUserAclEntryResponse(a,b,c,d,f){methodcheck(c)||PullUserInfo()}function changeAccountStateButton(a,b,c){haltEvent(a);xxdialogMode||amtstack.AMT_AuthorizationService_SetAclEnabledState(b,1==c?!1:!0,setAclEnabledStateResponse,b)}
926
+function enumerateUserAclEntriesResponse(a,b,c,d){if(200==d){methodcheck(c);QV("go11",!0);xxAccountFetch=c.Body.Handles.length;for(var g in c.Body.Handles)a=c.Body.Handles[g],amtstack.AMT_AuthorizationService_GetAclEnabledState(a,getAclEnabledStateResponse,a),amtstack.AMT_AuthorizationService_GetUserAclEntryEx(a,getUserAclEntryExResponse,a);updateAccounts()}}
927
+function getUserAclEntryExResponse(a,b,c,d,g){xxAccountFetch--;200==d&&(c.Body.Handle=g,c.Body.Realms?Array.isArray(c.Body.Realms)||(c.Body.Realms=[c.Body.Realms]):c.Body.Realms=[],xxAccountRealmInfo[g]=c.Body,updateAccounts())}function getAclEnabledStateResponse(a,b,c,d,g){200==d&&(xxAccountEnabledInfo[g]=c.Body,updateAccounts())}function setAclEnabledStateResponse(a,b,c,d,g){errcheck(d,a)||(methodcheck(c),amtstack.AMT_AuthorizationService_GetAclEnabledState(g,getAclEnabledStateResponse,g))}
928
+function updateAccounts(){if(!(0<xxAccountFetch)){var a=TableStart2(),a=a+"<tr><td class=r1 style=padding-left:15px><br>Manage the Intel® AMT user accounts for this computer.<br><br>",b;for(b in xxAccountRealmInfo){var c=xxAccountRealmInfo[b],d,g=!1,n=0;c.DigestUsername?(d=c.DigestUsername,g="$"==d[0]&&"$"==d[1]):d=GetSidString(atob(c.KerberosUserSid));xxAccountEnabledInfo[b]&&"$$OsAdmin"!=d&&(n=1==xxAccountEnabledInfo[b].Enabled?1:2);if(showHiddenAccounts||!g){var r="";if(999!=c.AccessPermission){2==
929
+n&&(r+="Disabled, ");var u=0;for(b in c.Realms)""!=amtstack.RealmNames[c.Realms[b]]&&u++;0<=c.Realms.indexOf(20)&&(r+="Auditor, ");r=0<=c.Realms.indexOf(3)?r+"Administrator":1==u?r+"1 realm":r+(u+" realms")}else r+="Administrator",c.Handle=-1;a+="<div class=itemBar onclick=showUserDetails("+c.Handle+")><div style=float:right>";0<n&&xxAccountAdminName&&(a+=" "+AddButton2(1==n?"Disable":"Enable","changeAccountStateButton(event,"+c.Handle+","+n+")"));!g&&xxAccountAdminName&&(a+=" "+AddButton2("Edit...",
930
+"changeAccountButton(event,"+c.Handle+")"));a+="</div><div style=padding-top:3px;width:330px;float:left;overflow-x:hidden title='"+d+"'><b>"+d+"</b></div><div style=padding-top:3px>"+r+"</div></div>"}}b="<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&&(b+=AddButton("New Account",
931
+"newAccountButton()"));a+="<br><td class=r1>"+TableEnd(b+"</div>");QH(21,a)}}function toggleAccountButton(){showHiddenAccounts=!showHiddenAccounts;updateAccounts()}function removeUserAclEntryResponse(a,b,c,d,g){methodcheck(c)||PullUserInfo()}function changeAccountStateButton(a,b,c){haltEvent(a);xxdialogMode||amtstack.AMT_AuthorizationService_SetAclEnabledState(b,1==c?!1:!0,setAclEnabledStateResponse,b)}
932
function changeAccountButton(a,b){haltEvent(a);xxdialogMode||(updateRealms(xxAccountRealmInfo[b].Realms),d2username.value=xxAccountRealmInfo[b].DigestUsername?xxAccountRealmInfo[b].DigestUsername:GetSidString(atob(xxAccountRealmInfo[b].KerberosUserSid)),d2password1.value=d2password2.value="",d2permission.value=xxAccountRealmInfo[b].AccessPermission,setDialogMode(2,"Edit Account",-1==b?3:7,function(a){changeAccountButtonEx(b,a)}),updateAccountDialog())}
933
function newAccountButton(){xxdialogMode||(updateRealms([]),d2username.value=d2password1.value=d2password2.value="",d2permission.value=2,setDialogMode(2,"New Account",3,function(){changeAccountButtonEx(null,1)}),updateAccountDialog())}
933
-function changeAccountButtonEx(a,b){if(1==b){var c=[],d=d2username.value,f=d2permission.value,m=d2password1.value,p=GetSidByteArray(Q("d2username").value),r=null;if(0==d.length||m!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==p?r=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+m)):(d=null,p=btoa(p));if(-1!=a)for(var l in amtstack.RealmNames)(amtstack.RealmNames[l]||3==l)&&Q("rx"+l).checked&&c.push(l);null==a?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d,
934
-r,p,f,c,userAclEntryExResponse):-1==a?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,r,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(a,d,r,p,f,c,userAclEntryExResponse)}2==b&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(a,removeUserAclEntryResponse)}function userAclEntryExResponse(a,b,c,d,f){methodcheck(c)||PullUserInfo()}
934
+function changeAccountButtonEx(a,b){if(1==b){var c=[],d=d2username.value,g=d2permission.value,n=d2password1.value,r=GetSidByteArray(Q("d2username").value),u=null;if(0==d.length||n!=d2password2.value){messagebox("Account Error","Invalid Parameters");return}null==r?u=window.btoa(rstr_md5(d+":"+amtsysstate.AMT_GeneralSettings.response.DigestRealm+":"+n)):(d=null,r=btoa(r));if(-1!=a)for(var m in amtstack.RealmNames)(amtstack.RealmNames[m]||3==m)&&Q("rx"+m).checked&&c.push(m);null==a?amtstack.AMT_AuthorizationService_AddUserAclEntryEx(d,
935
+u,r,g,c,userAclEntryExResponse):-1==a?amtstack.AMT_AuthorizationService_SetAdminAclEntryEx(d,u,userAclEntryExResponse):amtstack.AMT_AuthorizationService_UpdateUserAclEntryEx(a,d,u,r,g,c,userAclEntryExResponse)}2==b&&amtstack.AMT_AuthorizationService_RemoveUserAclEntry(a,removeUserAclEntryResponse)}function userAclEntryExResponse(a,b,c,d,g){methodcheck(c)||PullUserInfo()}
936
function updateRealms(a){QV(37,null!=a);if(null!=a){var b="<li><label><input type=checkbox onchange=updateAccountDialog() id=rx3"+(0<=a.indexOf(3)?" checked":"")+">Administrator</label></li><hr />",c;for(c in amtstack.RealmNames){var d="";0<=a.indexOf(parseInt(c))&&(d=" checked");amtstack.RealmNames[c]&&(b+="<li><label><input type=checkbox onchange=updateAccountDialog() id=rx"+c+d+">"+amtstack.RealmNames[c]+"</label></li>")}QH(38,b)}}
937
function updateAccountDialog(){var a=!1,b;for(b in amtstack.RealmNames)(amtstack.RealmNames[b]||3==b)&&Q("rx"+b).checked&&(a=!0);a&=0<d2username.value.length&&passwordcheck(d2password1.value)&&d2password1.value==d2password2.value;QE("c37",a)}var xxUserPermissions=["Local only","Network only","All (Local & Network)"];
937
-function showUserDetails(a){if(!xxdialogMode){var b=xxAccountRealmInfo[a],c="<div style=text-align:left>",d,f=b.DigestUsername;f||(f=GetSidString(atob(b.KerberosUserSid)));c+=addHtmlValue("Name",f);xxAccountEnabledInfo[a]&&(c+=addHtmlValue("State",1==xxAccountEnabledInfo[a].Enabled?"Enabled":"Disabled"));if(f==xxAccountAdminName)c+=addHtmlValue("Permission","Administrator");else{var c=c+addHtmlValue("Permission",xxUserPermissions[b.AccessPermission]),m="";if(0<=b.Realms.indexOf(3))m="Administrator",
938
-0<=b.Realms.indexOf(20)&&(m+=", Auditor");else for(d in xxAccountRealmInfo[a].Realms)""!=amtstack.RealmNames[b.Realms[d]]&&(0<m.length&&(m+=", "),m+=amtstack.RealmNames[b.Realms[d]]);0==m.length&&(m="None");c+=addHtmlValue("Realms","")+"<b>"+m+"</b>"}messagebox("Account "+f,c+"</div>")}}
938
+function showUserDetails(a){if(!xxdialogMode){var b=xxAccountRealmInfo[a],c="<div style=text-align:left>",d,g=b.DigestUsername;g||(g=GetSidString(atob(b.KerberosUserSid)));c+=addHtmlValue("Name",g);xxAccountEnabledInfo[a]&&(c+=addHtmlValue("State",1==xxAccountEnabledInfo[a].Enabled?"Enabled":"Disabled"));if(g==xxAccountAdminName)c+=addHtmlValue("Permission","Administrator");else{var c=c+addHtmlValue("Permission",xxUserPermissions[b.AccessPermission]),n="";if(0<=b.Realms.indexOf(3))n="Administrator",
939
+0<=b.Realms.indexOf(20)&&(n+=", Auditor");else for(d in xxAccountRealmInfo[a].Realms)""!=amtstack.RealmNames[b.Realms[d]]&&(0<n.length&&(n+=", "),n+=amtstack.RealmNames[b.Realms[d]]);0==n.length&&(n="None");c+=addHtmlValue("Realms","")+"<b>"+n+"</b>"}messagebox("Account "+g,c+"</div>")}}
940
function wsmanQuery(){QH(24,"");var a=getSelectedOptions(Q(22)),b=[],c;for(c in a)""==QS("WSB-"+a[c]).display&&b.push(a[c]);0!=b.length&&(QE(23,!1),b&&0<b.length&&amtstack.BatchEnum("Browser",b,browserResponse,null,!0))}
940
-function browserResponse(a,b,c,d){QE(23,!0);a="";for(var f in c)b=c[f],a+="<h2>"+f+"</h2><div style=margin-left:20px>",a=200==b.status?0==b.responses.length?a+"<br>(Empty)":a+ObjectToString(b.responses).replace(/Intel\(r\)/g,"Intel®"):a+("<br><div style=color:red>Error #"+b.status+"</div>"),a+="</div><br>";QH(24,a)}
941
+function browserResponse(a,b,c,d){QE(23,!0);a="";for(var g in c)b=c[g],a+="<h2>"+g+"</h2><div style=margin-left:20px>",a=200==b.status?0==b.responses.length?a+"<br>(Empty)":a+ObjectToString(b.responses).replace(/Intel\(r\)/g,"Intel®"):a+("<br><div style=color:red>Error #"+b.status+"</div>"),a+="</div><br>";QH(24,a)}
942
function wsmanFilter(){var a=c0.value.toLowerCase(),b;for(b in AllWsman)QV("WSB-"+AllWsman[b],""==a||0<=AllWsman[b].toLowerCase().indexOf(a))}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;
943
function PullRemoteAccess(){var a="*AMT_EnvironmentDetectionSettingData AMT_ManagementPresenceRemoteSAP AMT_RemoteAccessCredentialContext AMT_RemoteAccessPolicyAppliesToMPS AMT_RemoteAccessPolicyRule *AMT_UserInitiatedConnectionService AMT_MPSUsernamePassword".split(" ");11<amtversion&&a.push("*IPS_HTTPProxyService","IPS_HTTPProxyAccessPoint");amtstack.BatchEnum(null,a,processRemote1)}
944
function processRemote1(a,b,c,d){if(400!=d&&!errcheck(d,a)&&void 0!=c.AMT_UserInitiatedConnectionService&&void 0!=c.AMT_UserInitiatedConnectionService.response){QV("go17",!0);xxRemoteAccess=c;xxEnvironementDetection=c.AMT_EnvironmentDetectionSettingData.response;xxEnvironementDetection.DetectionStrings=MakeToArray(xxEnvironementDetection.DetectionStrings);xxCiraServers=c.AMT_ManagementPresenceRemoteSAP.responses;xxUserInitiatedCira=c.AMT_UserInitiatedConnectionService.response;xxRemoteAccessCredentiaLinks=
944
-c.AMT_RemoteAccessCredentialContext.responses;xxMPSUserPass=c.AMT_MPSUsernamePassword.responses;xxPolicies={User:[],Alert:[],Periodic:[]};for(var f in c.AMT_RemoteAccessPolicyAppliesToMPS.responses)b=c.AMT_RemoteAccessPolicyAppliesToMPS.responses[f],a=Clone(getItem(xxCiraServers,"Name",getItem(b.ManagedElement.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value)),a.MpsType=b.MpsType,b=getItem(b.PolicySet.ReferenceParameters.SelectorSet.Selector,"@Name","PolicyRuleName").Value.split(" ")[0],
945
+c.AMT_RemoteAccessCredentialContext.responses;xxMPSUserPass=c.AMT_MPSUsernamePassword.responses;xxPolicies={User:[],Alert:[],Periodic:[]};for(var g in c.AMT_RemoteAccessPolicyAppliesToMPS.responses)b=c.AMT_RemoteAccessPolicyAppliesToMPS.responses[g],a=Clone(getItem(xxCiraServers,"Name",getItem(b.ManagedElement.ReferenceParameters.SelectorSet.Selector,"@Name","Name").Value)),a.MpsType=b.MpsType,b=getItem(b.PolicySet.ReferenceParameters.SelectorSet.Selector,"@Name","PolicyRuleName").Value.split(" ")[0],
946
xxPolicies[b].push(a);updateRemoteAccess()}}
947
function updateRemoteAccess(){if(null!=xxEnvironementDetection){var a,b="Disabled",c=xxRemoteAccess.IPS_HTTPProxyService&&xxRemoteAccess.IPS_HTTPProxyAccessPoint;xxEnvironementDetection.DetectionStrings&&0<xxEnvironementDetection.DetectionStrings.length&&(b="Enabled, "+xxEnvironementDetection.DetectionStrings.length+" domain"+(1<xxEnvironementDetection.DetectionStrings.length?"s":""));a=""+TableStart();a+=TableEntry("Environment detection",addLink(b,"editEnvironmentDetection()"));a+=TableEntry("User initiation options",
948
addLinkConditional(xxUserInitiatedEnabledState[xxUserInitiatedCira.EnabledState],"editUserInitiatedCira()",xxAccountAdminName));b="<i>None</i>";if(0<xxPolicies.User.length){var b="",d;for(d in xxPolicies.User)0<b.length&&(b+=", "),b+=xxPolicies.User[d].AccessInfo,1==xxPolicies.User[d].MpsType&&(b+=" (CILA)")}a+=TableEntry("User initiated connection",addLinkConditional(b,'editMpsPolicy("User")',xxAccountAdminName));b="<i>None</i>";if(0<xxPolicies.Alert.length)for(d in b="",xxPolicies.Alert)0<b.length&&
948
-(b+=", "),b+=xxPolicies.Alert[d].AccessInfo,1==xxPolicies.Alert[d].MpsType&&(b+=" (CILA)");a+=TableEntry("Alert initiated connection",addLinkConditional(b,'editMpsPolicy("Alert")',xxAccountAdminName));b="<i>None</i>";if(0<xxPolicies.Periodic.length)for(d in b="",xxPolicies.Periodic)0<b.length&&(b+=", "),b+=xxPolicies.Periodic[d].AccessInfo,1==xxPolicies.Periodic[d].MpsType&&(b+=" (CILA)");var f=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName","Periodic");if(f){var m=atob(f.ExtendedData);
949
-0==ReadInt(m,0)&&(b+=", each "+ReadInt(m,4)+" seconds");1==ReadInt(m,0)&&(f=ReadInt(m,4),m=ReadInt(m,8),10>m&&(m="0"+m),b+=", at "+f+":"+m+" daily")}a+=TableEntry("Periodic connection",addLinkConditional(b,'editMpsPolicy("Periodic")',xxAccountAdminName));a+=TableEnd();a=a+"<br>"+TableStart2();a+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT remote management servers.<br><br>";if(0==xxCiraServers.length)a+="<div style=padding-left:15px><br><i>No remote servers found.</i></div><br>";
949
+(b+=", "),b+=xxPolicies.Alert[d].AccessInfo,1==xxPolicies.Alert[d].MpsType&&(b+=" (CILA)");a+=TableEntry("Alert initiated connection",addLinkConditional(b,'editMpsPolicy("Alert")',xxAccountAdminName));b="<i>None</i>";if(0<xxPolicies.Periodic.length)for(d in b="",xxPolicies.Periodic)0<b.length&&(b+=", "),b+=xxPolicies.Periodic[d].AccessInfo,1==xxPolicies.Periodic[d].MpsType&&(b+=" (CILA)");var g=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName","Periodic");if(g){var n=atob(g.ExtendedData);
950
+0==ReadInt(n,0)&&(b+=", each "+ReadInt(n,4)+" seconds");1==ReadInt(n,0)&&(g=ReadInt(n,4),n=ReadInt(n,8),10>n&&(n="0"+n),b+=", at "+g+":"+n+" daily")}a+=TableEntry("Periodic connection",addLinkConditional(b,'editMpsPolicy("Periodic")',xxAccountAdminName));a+=TableEnd();a=a+"<br>"+TableStart2();a+="<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT remote management servers.<br><br>";if(0==xxCiraServers.length)a+="<div style=padding-left:15px><br><i>No remote servers found.</i></div><br>";
951
else for(d in xxCiraServers)b=":"+xxCiraServers[d].Port,xxCiraServers[d].CN&&(b+=", "+xxCiraServers[d].CN),a+="<div class=itemBar onclick=showServerDetails("+d+")><div style=padding-top:3px><b>"+xxCiraServers[d].AccessInfo+"</b>"+EscapeHtml(b)+"</div></div>";if(c)if(a+="<br>Manage HTTP proxies used for management connections.<br><br>",b=xxRemoteAccess.IPS_HTTPProxyAccessPoint.responses,0==b.length)a+="<div style=padding-left:15px><br><i>No proxies configured.</i></div><br>";else for(d in b)a+="<div class=itemBar onclick=showProxyDetails("+
952
d+")><div style=padding-top:3px><b>"+EscapeHtml(b[d].AccessInfo)+":"+b[d].Port+"</b> / "+EscapeHtml(b[d].NetworkDnsSuffix)+"</div></div>";d="";xxAccountAdminName&&(d=AddButton("Add Server...","AddRemoteAccessServer()"),c&&(d+=AddButton("Add Proxy...","AddRemoteAccessProxy()")));a+="<br><td class=r1>"+TableEnd(AddRefreshButton("PullRemoteAccess()")+d);QH(28,a)}}var xxEditMpsPolicyType;
952
-function editMpsPolicy(a){var b="",c=11<amtversion||11==amtversion&&6<=amtversion,d=xxEditMpsPolicyType=a;"User"==d&&(d="User Initiated");var d=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName",d),b=b+"<div style=height:26px><select id=d2server1 style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=-1>(None)",f;for(f in xxCiraServers)b+="<option value="+f+""+(xxPolicies[a][0]&&xxPolicies[a][0].Name==xxCiraServers[f].Name?" selected":"")+">"+xxCiraServers[f].AccessInfo;
953
+function editMpsPolicy(a){var b="",c=11<amtversion||11==amtversion&&6<=amtversion,d=xxEditMpsPolicyType=a;"User"==d&&(d="User Initiated");var d=getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName",d),b=b+"<div style=height:26px><select id=d2server1 style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=-1>(None)",g;for(g in xxCiraServers)b+="<option value="+g+""+(xxPolicies[a][0]&&xxPolicies[a][0].Name==xxCiraServers[g].Name?" selected":"")+">"+xxCiraServers[g].AccessInfo;
954
b+="</select><div>Primary server</div></div>";c&&(b+="<div style=height:26px><select id=d2server1cira style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=0>CIRA - External<option value=1"+(xxPolicies[a][0]&&1==xxPolicies[a][0].MpsType?" selected":"")+">CILA - Internal</select><div>Primary MPS Type</div></div>");if(1<xxCiraServers.length){b+="<div style=height:26px><select id=d2server2 style=float:right;width:206px onchange=editMpsPolicyUpdate()>";b+="<option value=-1>(None)";
954
-for(f in xxCiraServers)b+="<option value="+f+""+(xxPolicies[a][1]&&xxPolicies[a][1].Name==xxCiraServers[f].Name?" selected":"")+">"+xxCiraServers[f].AccessInfo;b+="</select><div>Secondary server</div></div>";c&&(b+="<div style=height:26px><select id=d2server2cira style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=0>CIRA - External<option value=1"+(xxPolicies[a][1]&&1==xxPolicies[a][1].MpsType?" selected":"")+">CILA - Internal</select><div>Secondary MPS Type</div></div>")}f=
955
-0;d&&(f=d.TunnelLifeTime);b+="<div style=height:26px><input id=d2lifetime style=float:right;width:200px onchange=editMpsPolicyUpdate() value="+f+">";b+="<div>Tunnel lifetime (Seconds)</div></div>";"Periodic"==a&&(c=0,f=3600,d&&(d=atob(d.ExtendedData),c=ReadInt(d,0),f=ReadInt(d,4),1==c&&(d=ReadInt(d,8),10>d&&(d="0"+d),f+=":"+d)),b+="<div style=height:26px><select id=d2ttype style=float:right;width:206px onchange=editMpsPolicyUpdate()>",b+="<option value=0"+(0==c?" selected":"")+">Periodic, time interval<option value=1"+
956
-(1==c?" selected":"")+">Time of day, once a day",b+="</select><div>Trigger type</div></div><div style=height:26px><input id=d2timer style=float:right;width:200px onkeyup=editMpsPolicyUpdate() value="+f+"><div id=ttypelabel></div></div>");setDialogMode(11,a+" Connection",3,editMpsPolicyOk,b);editMpsPolicyUpdate()}
955
+for(g in xxCiraServers)b+="<option value="+g+""+(xxPolicies[a][1]&&xxPolicies[a][1].Name==xxCiraServers[g].Name?" selected":"")+">"+xxCiraServers[g].AccessInfo;b+="</select><div>Secondary server</div></div>";c&&(b+="<div style=height:26px><select id=d2server2cira style=float:right;width:206px onchange=editMpsPolicyUpdate()><option value=0>CIRA - External<option value=1"+(xxPolicies[a][1]&&1==xxPolicies[a][1].MpsType?" selected":"")+">CILA - Internal</select><div>Secondary MPS Type</div></div>")}g=
956
+0;d&&(g=d.TunnelLifeTime);b+="<div style=height:26px><input id=d2lifetime style=float:right;width:200px onchange=editMpsPolicyUpdate() value="+g+">";b+="<div>Tunnel lifetime (Seconds)</div></div>";"Periodic"==a&&(c=0,g=3600,d&&(d=atob(d.ExtendedData),c=ReadInt(d,0),g=ReadInt(d,4),1==c&&(d=ReadInt(d,8),10>d&&(d="0"+d),g+=":"+d)),b+="<div style=height:26px><select id=d2ttype style=float:right;width:206px onchange=editMpsPolicyUpdate()>",b+="<option value=0"+(0==c?" selected":"")+">Periodic, time interval<option value=1"+
957
+(1==c?" selected":"")+">Time of day, once a day",b+="</select><div>Trigger type</div></div><div style=height:26px><input id=d2timer style=float:right;width:200px onkeyup=editMpsPolicyUpdate() value="+g+"><div id=ttypelabel></div></div>");setDialogMode(11,a+" Connection",3,editMpsPolicyOk,b);editMpsPolicyUpdate()}
958
function editMpsPolicyUpdate(){var a=11<amtversion||11==amtversion&&6<=amtversion,b=1>=xxCiraServers.length||-1==Q("d2server1").value||Q("d2server1").value!=Q("d2server2").value;if(1==b&&"Periodic"==xxEditMpsPolicyType&&1==Q("d2ttype").value){var c=Q("d2timer").value.split(":");if(2!=c.length)b=!1;else{var d=parseInt(c[0]),c=parseInt(c[1]);if(0>d||23<d||0>c||59<c)b=!1}}QE("c37",b);1<xxCiraServers.length&&QE("d2server2",-1!=Q("d2server1").value);"Periodic"==xxEditMpsPolicyType&&(QE("d2timer",
959
-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);a&&(QE("d2server1cira",-1<Q("d2server1").value),1<xxCiraServers.length&&QE("d2server2cira",-1<Q("d2server1").value&&-1<Q("d2server2").value))}
960
function editMpsPolicyOk(){var a=xxEditMpsPolicyType;"User"==a&&(a="User Initiated");getItem(xxRemoteAccess.AMT_RemoteAccessPolicyRule.responses,"PolicyRuleName",a)?amtstack.Delete("AMT_RemoteAccessPolicyRule",{PolicyRuleName:a},editMpsPolicyOk2):editMpsPolicyOk2()}
960
-function editMpsPolicyOk2(a,b,c,d){a=11<amtversion||11==amtversion&&6<=amtversion;if(-1==Q("d2server1").value)PullRemoteAccess();else{b=0;"Alert"==xxEditMpsPolicyType&&(b=1);"Periodic"==xxEditMpsPolicyType&&(b=2);c=null;2==b&&(c=Q("d2ttype").value,d=IntToStr(Q("d2timer").value),1==c&&(d=Q("d2timer").value.split(":"),d=IntToStr(parseInt(d[0]))+IntToStr(parseInt(d[1]))),c=btoa(IntToStr(c)+d));var f,m;0<=Q("d2server1").value&&(f='<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">'+
961
-xxCiraServers[Q("d2server1").value].Name+"</Selector></SelectorSet></ReferenceParameters>");0<=Q("d2server1").value&&1<xxCiraServers.length&&0<=Q("d2server2").value&&(m='<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">'+
962
-xxCiraServers[Q("d2server2").value].Name+"</Selector></SelectorSet></ReferenceParameters>");d=[];var p=[];a?f&&(0==Q("d2server1cira").value?d.push(f):p.push(f),m&&(0==Q("d2server2cira").value?d.push(m):p.push(m))):f&&(d.push(f),m&&d.push(m));amtstack.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(b,Q("d2lifetime").value,c,d,p,PullRemoteAccess)}}var editEnvironmentDetectionTmp;
961
+function editMpsPolicyOk2(a,b,c,d){a=11<amtversion||11==amtversion&&6<=amtversion;if(-1==Q("d2server1").value)PullRemoteAccess();else{b=0;"Alert"==xxEditMpsPolicyType&&(b=1);"Periodic"==xxEditMpsPolicyType&&(b=2);c=null;2==b&&(c=Q("d2ttype").value,d=IntToStr(Q("d2timer").value),1==c&&(d=Q("d2timer").value.split(":"),d=IntToStr(parseInt(d[0]))+IntToStr(parseInt(d[1]))),c=btoa(IntToStr(c)+d));var g,n;0<=Q("d2server1").value&&(g='<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">'+
962
+xxCiraServers[Q("d2server1").value].Name+"</Selector></SelectorSet></ReferenceParameters>");0<=Q("d2server1").value&&1<xxCiraServers.length&&0<=Q("d2server2").value&&(n='<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">'+
963
+xxCiraServers[Q("d2server2").value].Name+"</Selector></SelectorSet></ReferenceParameters>");d=[];var r=[];a?g&&(0==Q("d2server1cira").value?d.push(g):r.push(g),n&&(0==Q("d2server2cira").value?d.push(n):r.push(n))):g&&(d.push(g),n&&d.push(n));amtstack.AMT_RemoteAccessService_AddRemoteAccessPolicyRule(b,Q("d2lifetime").value,c,d,r,PullRemoteAccess)}}var editEnvironmentDetectionTmp;
964
function editEnvironmentDetection(a){1!=a&&(editEnvironmentDetectionTmp=xxEnvironementDetection.DetectionStrings?Clone(xxEnvironementDetection.DetectionStrings):[]);var b="";xxAccountAdminName&&(b+="Enter up to 4 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&&(b+="<i>No intranet domains, Environemnt detection disabled.</i><br>");for(var c in editEnvironmentDetectionTmp)b+=
965
"<div class=itemBar style=margin-right:0><div style=float:right>"+AddButton2("Remove","editEnvironmentDetectionRemove("+c+")")+"</div><div style=padding-top:3px;max-width:260px;overflow:hidden title='"+editEnvironmentDetectionTmp[c]+"'><b>"+editEnvironmentDetectionTmp[c]+"</b></div></div>";xxAccountAdminName&&4>editEnvironmentDetectionTmp.length&&(b+="<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()>");
966
1==a?QH(39,b):setDialogMode(11,"Environment Detection",xxAccountAdminName?3:1,editEnvironmentDetectionDlg,b);edInputChg()}function editEnvironmentDetectionDlg(){if(xxAccountAdminName){var a=Clone(xxEnvironementDetection);a.DetectionStrings=editEnvironmentDetectionTmp;amtstack.Put("AMT_EnvironmentDetectionSettingData",a,editEnvironmentDetectionDlg2,0,1)}}
@@ -990,8 +991,8 @@ function showEditNameDlg(a){if(!xxdialogMode){var b=amtsysstate.AMT_GeneralSetti
991
function computerNameGet(a,b,c,d){200==d&&(amtsysstate.AMT_GeneralSettings.response=c.Body,updateSystemStatus())}function showEditDnsDlg(){if(!xxdialogMode){var a=amtsysstate.AMT_GeneralSettings.response,b=0;1==a.DDNSUpdateByDHCPServerEnabled&&(b=1);1==a.DDNSUpdateEnabled&&(b=2);c24.value=b;c25.value=a.DDNSPeriodicUpdateInterval;c26.value=a.DDNSTTL;showEditDnsDlgChange();setDialogMode(23,"Dynamic DNS client",3,showEditDnsDlgOk)}}
992
function showEditDnsDlgOk(){var a=Clone(amtsysstate.AMT_GeneralSettings.response);a.DDNSUpdateEnabled=2==c24.value?!0:!1;a.DDNSUpdateByDHCPServerEnabled=1==c24.value?!0:!1;2==c24.value&&(a.DDNSPeriodicUpdateInterval=c25.value,a.DDNSTTL=c26.value);amtstack.Put("AMT_GeneralSettings",a,function(){amtstack.Get("AMT_GeneralSettings",computerNameGet,0,1)},0,1)}
993
function showEditDnsDlgChange(){QE("c25",2==c24.value);QE("c26",2==c24.value)}function showFeaturesDlg(){!xxdialogMode&&xxAccountAdminName&&(c3.checked=amtfeatures[0],c5.checked=amtfeatures[3],c6.checked=amtfeatures[2],c7.checked=amtfeatures[1],QV("c4",void 0!=amtfeatures[3]),setDialogMode(9,"Intel® AMT Features",3,featuresDlgOk))}
993
-function featuresDlgOk(){var a=amtsysstate.AMT_RedirectionService.response;a.ListenerEnabled=c3.checked;a.EnabledState=32768+((c6.checked?1:0)+(c7.checked?2:0));amtstack.AMT_RedirectionService_RequestStateChange(a.EnabledState,function(b,c,d,f){200!=f?messagebox("Error","RedirectionService, RequestStateChange Error "+f):amtstack.CIM_KVMRedirectionSAP_RequestStateChange(c5.checked?2:3,0,function(b,c,d,f){200!=f?messagebox("Error","KVMRedirectionSAP, RequestStateChange Error "+
994
-f):amtstack.Put("AMT_RedirectionService",a,function(a,b,c,d){200!=d?messagebox("Error","RedirectionService PUT Error "+d):(amtstack.Get("AMT_RedirectionService",featuresDlgGet1,0,1),amtstack.Get("CIM_KVMRedirectionSAP",featuresDlgGet2,0,1))},0,1)})})}function featuresDlgGet1(a,b,c,d){200==d&&(amtsysstate.AMT_RedirectionService.response=c.Body,updateSystemStatus())}function featuresDlgGet2(a,b,c,d){200==d&&(amtsysstate.CIM_KVMRedirectionSAP.response=c.Body,updateSystemStatus())}
994
+function featuresDlgOk(){var a=amtsysstate.AMT_RedirectionService.response;a.ListenerEnabled=c3.checked;a.EnabledState=32768+((c6.checked?1:0)+(c7.checked?2:0));amtstack.AMT_RedirectionService_RequestStateChange(a.EnabledState,function(b,c,d,g){200!=g?messagebox("Error","RedirectionService, RequestStateChange Error "+g):amtstack.CIM_KVMRedirectionSAP_RequestStateChange(c5.checked?2:3,0,function(b,c,d,g){200!=g?messagebox("Error","KVMRedirectionSAP, RequestStateChange Error "+
995
+g):amtstack.Put("AMT_RedirectionService",a,function(a,b,c,d){200!=d?messagebox("Error","RedirectionService PUT Error "+d):(amtstack.Get("AMT_RedirectionService",featuresDlgGet1,0,1),amtstack.Get("CIM_KVMRedirectionSAP",featuresDlgGet2,0,1))},0,1)})})}function featuresDlgGet1(a,b,c,d){200==d&&(amtsysstate.AMT_RedirectionService.response=c.Body,updateSystemStatus())}function featuresDlgGet2(a,b,c,d){200==d&&(amtsysstate.CIM_KVMRedirectionSAP.response=c.Body,updateSystemStatus())}
996
function showConsentDlg(){if(!xxdialogMode){var a=amtsysstate.IPS_OptInService.response.OptInRequired;c8.checked=0==a;c9.checked=1==a;c10.checked=4294967295==a;setDialogMode(10,"User Consent",3,consentDlgOk)}}function consentDlgOk(){amtsysstate.IPS_OptInService.response.OptInRequired=document.querySelector("input[name=d10]:checked").value;amtstack.Put("IPS_OptInService",amtsysstate.IPS_OptInService.response,function(){amtstack.Get("IPS_OptInService",consentGet,0,1)},0,1)}
997
function consentGet(a,b,c,d){200==d&&PullSystemStatus()}var ipv6addrtype="Link local address;Network local address;Global address;User configured;Not allowed;DAD in progress;valid;deprecated;preferred/deprecated;expired;collision;not allowed".split(";");
998
function showIPv6AddrDlg(a,b){if(!xxdialogMode){var c=TableStart();t=b.split(",");for(var d=0;d<t.length;d+=3)c+=TableEntry("<b>"+t[d]+"</b><br><span style=font-size:10px>"+ipv6addrtype[t[d+1]]+", "+ipv6addrtype[+t[d+2]+5]+"</span>","");setDialogMode(11,"IPv6 addresses for "+(0==a?"wired":"wireless")+" interface",1,null,c+TableEnd())}}
@@ -1010,22 +1011,22 @@ function powerActionResponse00(a,b,c,d){200==d?(amtPowerBootCapabilities=c.Body,
1011
"Custom action...",999),5<amtversion&&addOption("d5actionSelect","User consent...",998),setDialogMode(5,"Power Actions",3,powerActionDlgCheck)):messagebox("Power Action","Unable to get system capabilities, error "+d)}
1012
function powerActionDlgCheck(){var a=d5actionSelect.value;104==a||105==a?(a="Confirm execution of Intel® Remote Secure Erase?<br>Enter Secure Erase password if required.<br><br><div style=height:16px><input type=password id=rsepass maxlength=32 style=float:right;width:240px><div>Password</div></div><br><div style=color:red><b>WARNING:</b> This will wipe data on the remote system.</div>",rsepass=1,setDialogMode(11,"Power Actions",3,powerActionDlg,a)):powerActionDlg()}
1013
function powerActionDlg(){var a=d5actionSelect.value;if(999==a)showAdvPowerDlg();else if(998==a)amtstack.Get("IPS_OptInService",powerActionResponse0,0,1);else{statusbox("Power Action","Checking state...");null!=rsepass&&1===rsepass&&(rsepass=Q("rsepass").value);var b=!0;6>amtversion&&(b=!1);13==currentView&&8==a&&(b=!1);13!=currentView&&10>=a&&(b=!1);b?amtstack.Get("IPS_OptInService",powerActionResponse0,0,1):amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1)}}var AvdPowerDlg;
1013
-function showAdvPowerDlg(){QV("d24dBiosPause",1==amtPowerBootCapabilities.BIOSPause);QV("d24dReflashBios",1==amtPowerBootCapabilities.BIOSReflash);QV("d24dBiosSetup",1==amtPowerBootCapabilities.BIOSSetup);QV("d24dForceProgressEvents",1==amtPowerBootCapabilities.ForcedProgressEvents);QV("d24dUseIDER",1==amtPowerBootCapabilities.IDER);QV("d24dLockKeyboard",1==amtPowerBootCapabilities.KeyboardLock);QV("d24dLockPowerButton",1==amtPowerBootCapabilities.PowerButtonLock);QV("d24dLockResetButton",1==amtPowerBootCapabilities.ResetButtonLock);
1014
-QV("d24dSerialOverLan",1==amtPowerBootCapabilities.SOL);QV("d24dSecureErase",1==amtPowerBootCapabilities.SecureErase);QV("d24dLockSleepButton",1==amtPowerBootCapabilities.SleepButtonLock);QV("d24dUserPasswordBypass",1==amtPowerBootCapabilities.UserPasswordBypass);QV("c33",1==amtPowerBootCapabilities.VerbosityQuiet);QV("c34",1==amtPowerBootCapabilities.VerbosityVerbose);QV("c35",1==amtPowerBootCapabilities.VerbosityScreenBlank);setDialogMode(24,"Custom Power Action",
1015
-3,showAdvPowerDlgOk);showAdvPowerDlgChange()}
1016
-function showAdvPowerDlgChange(){QV("idd_d24IDERBootDevice",Q("d24UseIDER").checked);QV("idd_d24RSEPass",Q("d24SecureErase")?Q("d24SecureErase").checked:!1);var a="d24BiosPause d24BiosSetup d24ForceProgressEvents d24LockPowerButton d24LockResetButton d24LockSleepButton d24LockKeyboard d24UserPasswordBypass d24ReflashBios d24SafeMode d24UseIDER d24SerialOverLan d24SecureErase".split(" ");if(0<c29.value)for(var b in a)Q(a[b]).checked=!1;for(b in a)QE(a[b],0==c29.value)}
1017
-function showAdvPowerDlgOk(){AvdPowerDlg={};AvdPowerDlg.Action=Q("c27").value;AvdPowerDlg.BIOSPause=Q("d24BiosPause").checked;AvdPowerDlg.BIOSSetup=Q("d24BiosSetup").checked;AvdPowerDlg.BootMediaIndex=Q("c30").value;AvdPowerDlg.FirmwareVerbosity=Q("c32").value;AvdPowerDlg.ForcedProgressEvents=Q("d24ForceProgressEvents").checked;AvdPowerDlg.IDERBootDevice=Q("c31").value;AvdPowerDlg.LockKeyboard=Q("d24LockKeyboard").checked;AvdPowerDlg.LockPowerButton=
1018
-Q("d24LockPowerButton").checked;AvdPowerDlg.LockResetButton=Q("d24LockResetButton").checked;AvdPowerDlg.LockSleepButton=Q("d24LockSleepButton").checked;AvdPowerDlg.ReflashBIOS=Q("d24ReflashBios").checked;AvdPowerDlg.UseIDER=Q("d24UseIDER").checked;AvdPowerDlg.UseSOL=Q("d24SerialOverLan").checked;AvdPowerDlg.UseSafeMode=Q("d24SafeMode").checked;AvdPowerDlg.UserPasswordBypass=Q("d24UserPasswordBypass").checked;AvdPowerDlg.SecureErase=Q("d24SecureErase").checked;!0===AvdPowerDlg.SecureErase&&0<Q("d24rsepass").value.length&&
1019
-(AvdPowerDlg.RSEPassword=Q("d24rsepass").value);statusbox("Power Action","Checking state...");amtstack.Get("IPS_OptInService",powerActionResponse0,0,1)}
1014
+function showAdvPowerDlg(){QV("d24dBiosPause",1==amtPowerBootCapabilities.BIOSPause);QV("d24dBiosSecureBoot",1==amtPowerBootCapabilities.BIOSSecureBoot);QV("d24dReflashBios",1==amtPowerBootCapabilities.BIOSReflash);QV("d24dBiosSetup",1==amtPowerBootCapabilities.BIOSSetup);QV("d24dForceProgressEvents",1==amtPowerBootCapabilities.ForcedProgressEvents);QV("d24dUseIDER",1==amtPowerBootCapabilities.IDER);QV("d24dLockKeyboard",1==amtPowerBootCapabilities.KeyboardLock);QV("d24dLockPowerButton",1==amtPowerBootCapabilities.PowerButtonLock);
1015
+QV("d24dLockResetButton",1==amtPowerBootCapabilities.ResetButtonLock);QV("d24dSerialOverLan",1==amtPowerBootCapabilities.SOL);QV("d24dSecureErase",1==amtPowerBootCapabilities.SecureErase);QV("d24dLockSleepButton",1==amtPowerBootCapabilities.SleepButtonLock);QV("d24dUserPasswordBypass",1==amtPowerBootCapabilities.UserPasswordBypass);QV("c33",1==amtPowerBootCapabilities.VerbosityQuiet);QV("c34",1==amtPowerBootCapabilities.VerbosityVerbose);QV("c35",1==amtPowerBootCapabilities.VerbosityScreenBlank);
1016
+setDialogMode(24,"Custom Power Action",3,showAdvPowerDlgOk);showAdvPowerDlgChange()}
1017
+function showAdvPowerDlgChange(){QV("idd_d24IDERBootDevice",Q("d24UseIDER").checked);QV("idd_d24RSEPass",Q("d24SecureErase")?Q("d24SecureErase").checked:!1);var a="d24BiosPause d24BiosSecureBoot d24BiosSetup d24ForceProgressEvents d24LockPowerButton d24LockResetButton d24LockSleepButton d24LockKeyboard d24UserPasswordBypass d24ReflashBios d24SafeMode d24UseIDER d24SerialOverLan d24SecureErase".split(" ");if(0<c29.value)for(var b in a)Q(a[b]).checked=!1;for(b in a)QE(a[b],0==c29.value)}
1018
+function showAdvPowerDlgOk(){AvdPowerDlg={};AvdPowerDlg.Action=Q("c27").value;AvdPowerDlg.BIOSPause=Q("d24BiosPause").checked;AvdPowerDlg.BIOSSecureBoot=Q("d24BiosSecureBoot").checked;AvdPowerDlg.BIOSSetup=Q("d24BiosSetup").checked;AvdPowerDlg.BootMediaIndex=Q("c30").value;AvdPowerDlg.FirmwareVerbosity=Q("c32").value;AvdPowerDlg.ForcedProgressEvents=Q("d24ForceProgressEvents").checked;AvdPowerDlg.IDERBootDevice=Q("c31").value;AvdPowerDlg.LockKeyboard=
1019
+Q("d24LockKeyboard").checked;AvdPowerDlg.LockPowerButton=Q("d24LockPowerButton").checked;AvdPowerDlg.LockResetButton=Q("d24LockResetButton").checked;AvdPowerDlg.LockSleepButton=Q("d24LockSleepButton").checked;AvdPowerDlg.ReflashBIOS=Q("d24ReflashBios").checked;AvdPowerDlg.UseIDER=Q("d24UseIDER").checked;AvdPowerDlg.UseSOL=Q("d24SerialOverLan").checked;AvdPowerDlg.UseSafeMode=Q("d24SafeMode").checked;AvdPowerDlg.UserPasswordBypass=Q("d24UserPasswordBypass").checked;AvdPowerDlg.SecureErase=Q("d24SecureErase").checked;
1020
+!0===AvdPowerDlg.SecureErase&&0<Q("d24rsepass").value.length&&(AvdPowerDlg.RSEPassword=Q("d24rsepass").value);statusbox("Power Action","Checking state...");amtstack.Get("IPS_OptInService",powerActionResponse0,0,1)}
1021
function powerActionResponse0(a,b,c,d){200!=d?messagebox("Power Action","Error #"+d):4294967295==c.Body.OptInRequired&&3!=c.Body.OptInState&&4!=c.Body.OptInState?2==c.Body.OptInState?(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged()):(statusbox("Power Action","Starting opt-in..."),amtstack.IPS_OptInService_StartOptIn(powerActionResponseC1,0,1)):998==d5actionSelect.value?messagebox("User Consent","User consent not needed."):(statusbox("Power Action",
1022
"Getting Boot Settings..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
1023
function powerActionResponseC1(a,b,c,d){200!=d?messagebox("Power Action","Error #"+d):0!=c.Body.ReturnValue?messagebox("User Consent Error",c.Body.ReturnValueStr.replace(/_/g," ")):(d6ConsentText.value="",setDialogMode(6,"User Consent",11,powerActionSendConsent),checkConsentDisplay(),consentChanged(),amtstack.Enum("CIM_ServiceAvailableToElement",function(a,b,c,d){errcheck(d,a)||(amtsysstate.CIM_ServiceAvailableToElement.responses=c,updateSystemStatus(),2!=amtsysstate.CIM_ServiceAvailableToElement.responses[0].PowerState&&
1024
amtstack.RequestPowerStateChange(2,function(a,b,c,d){}))}))}function powerActionSendConsent(a){0==a?amtstack.IPS_OptInService_CancelOptIn(function(){}):(statusbox("Power Action","Sending user consent..."),amtstack.IPS_OptInService_SendOptInCode(d6ConsentText.value,powerActionResponseC2,0,1))}
1025
function powerActionResponseC2(a,b,c,d){200!=d?messagebox("Power Action","Error #"+d):0!=c.Body.ReturnValue?amtstack.Get("IPS_OptInService",powerActionResponse0,0,1):998==d5actionSelect.value?messagebox("User Consent","User consent succesful."):(statusbox("Power Action","Checking state..."),amtstack.Get("AMT_BootSettingData",powerActionResponse1,0,1))}
1025
-function powerActionResponse1(a,b,c,d){200!=d?messagebox("Power Action","Error #"+d):(a=d5actionSelect.value,c=c.Body,c.ConfigurationDataReset=!1,999==a?(c.BIOSPause=AvdPowerDlg.BIOSPause,c.BIOSSetup=AvdPowerDlg.BIOSSetup,c.BootMediaIndex=AvdPowerDlg.BootMediaIndex,c.FirmwareVerbosity=AvdPowerDlg.FirmwareVerbosity,c.ForcedProgressEvents=AvdPowerDlg.ForcedProgressEvents,c.IDERBootDevice=AvdPowerDlg.IDERBootDevice,c.LockKeyboard=AvdPowerDlg.LockKeyboard,c.LockPowerButton=AvdPowerDlg.LockPowerButton,
1026
-c.LockResetButton=AvdPowerDlg.LockResetButton,c.LockSleepButton=AvdPowerDlg.LockSleepButton,c.ReflashBIOS=AvdPowerDlg.ReflashBIOS,c.UseIDER=AvdPowerDlg.UseIDER,c.UseSOL=AvdPowerDlg.UseSOL,c.UseSafeMode=AvdPowerDlg.UseSafeMode,c.UserPasswordBypass=AvdPowerDlg.UserPasswordBypass,null!=c.SecureErase&&(c.SecureErase=AvdPowerDlg.SecureErase&&1==amtPowerBootCapabilities.SecureErase,1==c.SecureErase&&AvdPowerDlg.RSEPassword&&(c.RSEPassword=AvdPowerDlg.RSEPassword))):(c.BIOSPause=!1,c.BIOSSetup=99<a&&104>
1027
-a,c.BootMediaIndex=0,c.FirmwareVerbosity=0,c.ForcedProgressEvents=!1,c.IDERBootDevice=202==a||203==a?1:0,c.LockKeyboard=!1,c.LockPowerButton=!1,c.LockResetButton=!1,c.LockSleepButton=!1,c.ReflashBIOS=!1,c.UseIDER=199<a&&300>a,c.UseSOL=13==currentView&&8!=a&&300>a,c.UseSafeMode=!1,c.UserPasswordBypass=!1,null!=c.SecureErase&&(c.SecureErase=(104==a||105==a)&&1==amtPowerBootCapabilities.SecureErase,!0===c.SecureErase&&0<rsepass.length&&(c.RSEPassword=rsepass)),rsepass=null),console.log("Boot Action: "+
1028
-a),console.log("Setting Boot Settings: "+ObjectToString2(c)),statusbox("Power Action","Setting boot settings..."),amtstack.Put("AMT_BootSettingData",c,powerActionResponse2,c,1))}function powerActionResponse2(a,b,c,d,f){200!=d?(messagebox("Power Action","PUT AMT_BootSettingData, Error #"+d),console.log(f)):(statusbox("Power Action","Setting next boot..."),amtstack.SetBootConfigRole(1,powerActionResponse3x,0,1))}
1026
+function powerActionResponse1(a,b,c,d){200!=d?messagebox("Power Action","Error #"+d):(a=d5actionSelect.value,c=c.Body,c.ConfigurationDataReset=!1,999==a?(c.BIOSPause=AvdPowerDlg.BIOSPause,c.EnforceSecureBoot=AvdPowerDlg.BIOSSecureBoot,c.BIOSSetup=AvdPowerDlg.BIOSSetup,c.BootMediaIndex=AvdPowerDlg.BootMediaIndex,c.FirmwareVerbosity=AvdPowerDlg.FirmwareVerbosity,c.ForcedProgressEvents=AvdPowerDlg.ForcedProgressEvents,c.IDERBootDevice=AvdPowerDlg.IDERBootDevice,c.LockKeyboard=AvdPowerDlg.LockKeyboard,
1027
+c.LockPowerButton=AvdPowerDlg.LockPowerButton,c.LockResetButton=AvdPowerDlg.LockResetButton,c.LockSleepButton=AvdPowerDlg.LockSleepButton,c.ReflashBIOS=AvdPowerDlg.ReflashBIOS,c.UseIDER=AvdPowerDlg.UseIDER,c.UseSOL=AvdPowerDlg.UseSOL,c.UseSafeMode=AvdPowerDlg.UseSafeMode,c.UserPasswordBypass=AvdPowerDlg.UserPasswordBypass,null!=c.SecureErase&&(c.SecureErase=AvdPowerDlg.SecureErase&&1==amtPowerBootCapabilities.SecureErase,1==c.SecureErase&&AvdPowerDlg.RSEPassword&&(c.RSEPassword=AvdPowerDlg.RSEPassword))):
1028
+(c.BIOSPause=!1,c.EnforceSecureBoot=!1,c.BIOSSetup=99<a&&104>a,c.BootMediaIndex=0,c.FirmwareVerbosity=0,c.ForcedProgressEvents=!1,c.IDERBootDevice=202==a||203==a?1:0,c.LockKeyboard=!1,c.LockPowerButton=!1,c.LockResetButton=!1,c.LockSleepButton=!1,c.ReflashBIOS=!1,c.UseIDER=199<a&&300>a,c.UseSOL=13==currentView&&8!=a&&300>a,c.UseSafeMode=!1,c.UserPasswordBypass=!1,null!=c.SecureErase&&(c.SecureErase=(104==a||105==a)&&1==amtPowerBootCapabilities.SecureErase,!0===c.SecureErase&&0<rsepass.length&&(c.RSEPassword=
1029
+rsepass)),rsepass=null),console.log("Boot Action: "+a),console.log("Setting Boot Settings: "+ObjectToString2(c)),statusbox("Power Action","Setting boot settings..."),amtstack.Put("AMT_BootSettingData",c,powerActionResponse2,c,1))}function powerActionResponse2(a,b,c,d,g){200!=d?(messagebox("Power Action","PUT AMT_BootSettingData, Error #"+d),console.log(g)):(statusbox("Power Action","Setting next boot..."),amtstack.SetBootConfigRole(1,powerActionResponse3x,0,1))}
1030
function powerActionResponse3x(a,b,c,d){a=d5actionSelect.value;b=null;if(999==a)0<c29.value&&(b=["Force CD/DVD Boot","Force PXE Boot","Force Hard-drive Boot","Force Diagnostic Boot"][c29.value-1]);else{if(300==a||301==a)b="Force Diagnostic Boot";if(400==a||401==a)b="Force PXE Boot"}console.log("ChangeBootOrder: "+b);amtstack.CIM_BootConfigSetting_ChangeBootOrder(null==b?b:'<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_BootSourceSetting</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="InstanceID">Intel(r) AMT: '+
1031
b+"</Selector></SelectorSet></ReferenceParameters>",powerActionResponse3)}var targetPowerAction=0;
1032
function powerActionResponse3(a,b,c,d){console.log("powerActionResponse3("+b+","+c+","+d+")");if(!errcheck(d,a)){statusbox("Power Action","Performing power action...");a=d5actionSelect.value;if(100==a||201==a||203==a||300==a||401==a)a=2;if(101==a||200==a||202==a||301==a||400==a)a=10;104==a&&(a=2);105==a&&(a=10);999==a&&(a=AvdPowerDlg.Action);targetPowerAction=a;11==a&&(a=10);999>a?(console.log("RequestPowerStateChange("+a+")"),amtstack.RequestPowerStateChange(a,powerActionResponse4)):messagebox("Power Action",
@@ -1033,11 +1034,11 @@ function powerActionResponse3(a,b,c,d){console.log("powerActionResponse3("+b+","
1034
function checkConsentDisplay(){amtstack.Get("IPS_SecIOService",checkConsentDisplayResponse1)}var xxchangeConsentDisplay=!1;
1035
function checkConsentDisplayResponse1(a,b,c,d){200==d&&(c.Body.DefaultScreen&&(c.Body.DefaultScreen=parseInt(c.Body.DefaultScreen)),c.Body.NumberOfScreens&&(c.Body.NumberOfScreens=parseInt(c.Body.NumberOfScreens)),1==xxchangeConsentDisplay?(xxchangeConsentDisplay=!1,c.Body.DefaultScreen=d6Display.value,amtstack.Put("IPS_SecIOService",c.Body,checkConsentDisplayResponse1)):(d6Display.value=c.Body.DefaultScreen,QV("d6ThirdDisplay",2<c.Body.NumberOfScreens)))}
1036
var xxStorage=null,xxStorageVendors=[],xxStorageApplications=[];function PullStorage(){amtFirstPull|=8;wsstack.comm.PerformAjax("",PullStorageResponse,null,0,"/amt-storage/","GET")}
1036
-function PullStorageResponse(a,b,c){0==amtstack.PendingBatchOperations&&refreshButtons(!0);if(200==b){QV("go21",!0);for(b=0;32>b;b++){do c=a.length,a=a.replace(String.fromCharCode(b),"");while(c>a.length)}try{xxStorage=JSON.parse(a)}catch(u){return}xxStorageVendors=[];xxStorageApplications=[];a=xxStorage.content;if(Array.isArray(a)){c={};for(b in a){var d=a[b].vendor?a[b].vendor:"";c[d]||(c[d]={});var f=a[b].app?a[b].app:"";c[d][f]||(c[d][f]={});a[b].name&&(c[d][f][a[b].name]=a[b])}xxStorage.content=
1037
-a=c}else{if(a["index.htm"]||a["logon.htm"])a[""]={"":{}};a["index.htm"]&&(a[""][""]["index.htm"]=a["index.htm"],delete a["index.htm"]);a["logon.htm"]&&(a[""][""]["logon.htm"]=a["logon.htm"],delete a["logon.htm"])}c=0;var d=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT storage for this computer.<br><br>",m,p,f="";for(b in a){var r=0,l;for(l in a[b]){r++;var k=0,v;for(v in a[b][l]){k++;if(b!=m||l!=p)""!=f&&(d+=f,f="<br>"),m=b,p=l,f=""!=b?f+EscapeHtml(b+" / "+l):f+
1038
-"Root";var e='"'+b+(""!=b?"/":"")+l+(""!=l?"/":"")+v+'"',f=f+('<div class=itemBar onclick=showStorageDetails("'+b+'","'+l+'","'+v+'",'+e+")><div style=float:right>"),f=f+(" "+AddButton2("Download","DownloadFromStorage("+e+',"'+v+'",event)')),f=f+("</div><div style=padding-top:3px><b>"+EscapeHtml(v)+"</b>, <i>"+a[b][l][v].size+" bytes</i></div></div>");c++;-1==xxStorageVendors.indexOf(b)&&xxStorageVendors.push(b);-1==xxStorageApplications.indexOf(l)&&xxStorageApplications.push(l)}0==k&&wsstack.comm.PerformAjax("",
1039
-function(){},null,0,"/amt-storage/"+b+"/"+l,"DELETE")}0==r&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+b,"DELETE")}""!=f&&(d+=f);0==c&&(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(31,d)}else QH(31,"Unable to load storage data...<br/>"+AddButton("Refresh","PullStorage()"))}
1040
-function showStorageDetails(a,b,c,d){if(!xxdialogMode){var f="",m=xxStorage.content[a][b][c];""!=a&&(f+=addHtmlValue("Vendor",a));""!=b&&(f+=addHtmlValue("Application",b));f+=addHtmlValue("Name",c);f+=addHtmlValue("Size",m.size+" bytes");m.link&&(f+=addHtmlValue("Link",m.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,f,d)}}function showStorageDetailsEx(a,b){2==a&&wsstack.comm.PerformAjax("",storageDeleteResponse,null,0,"/amt-storage/"+b,"DELETE")}
1037
+function PullStorageResponse(a,b,c){0==amtstack.PendingBatchOperations&&refreshButtons(!0);if(200==b){QV("go21",!0);for(b=0;32>b;b++){do c=a.length,a=a.replace(String.fromCharCode(b),"");while(c>a.length)}try{xxStorage=JSON.parse(a)}catch(v){return}xxStorageVendors=[];xxStorageApplications=[];a=xxStorage.content;if(Array.isArray(a)){c={};for(b in a){var d=a[b].vendor?a[b].vendor:"";c[d]||(c[d]={});var g=a[b].app?a[b].app:"";c[d][g]||(c[d][g]={});a[b].name&&(c[d][g][a[b].name]=a[b])}xxStorage.content=
1038
+a=c}else{if(a["index.htm"]||a["logon.htm"])a[""]={"":{}};a["index.htm"]&&(a[""][""]["index.htm"]=a["index.htm"],delete a["index.htm"]);a["logon.htm"]&&(a[""][""]["logon.htm"]=a["logon.htm"],delete a["logon.htm"])}c=0;var d=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage Intel® AMT storage for this computer.<br><br>",n,r,g="";for(b in a){var u=0,m;for(m in a[b]){u++;var l=0,w;for(w in a[b][m]){l++;if(b!=n||m!=r)""!=g&&(d+=g,g="<br>"),n=b,r=m,g=""!=b?g+EscapeHtml(b+" / "+m):g+
1039
+"Root";var e='"'+b+(""!=b?"/":"")+m+(""!=m?"/":"")+w+'"',g=g+('<div class=itemBar onclick=showStorageDetails("'+b+'","'+m+'","'+w+'",'+e+")><div style=float:right>"),g=g+(" "+AddButton2("Download","DownloadFromStorage("+e+',"'+w+'",event)')),g=g+("</div><div style=padding-top:3px><b>"+EscapeHtml(w)+"</b>, <i>"+a[b][m][w].size+" bytes</i></div></div>");c++;-1==xxStorageVendors.indexOf(b)&&xxStorageVendors.push(b);-1==xxStorageApplications.indexOf(m)&&xxStorageApplications.push(m)}0==l&&wsstack.comm.PerformAjax("",
1040
+function(){},null,0,"/amt-storage/"+b+"/"+m,"DELETE")}0==u&&wsstack.comm.PerformAjax("",function(){},null,0,"/amt-storage/"+b,"DELETE")}""!=g&&(d+=g);0==c&&(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(31,d)}else QH(31,"Unable to load storage data...<br/>"+AddButton("Refresh","PullStorage()"))}
1041
+function showStorageDetails(a,b,c,d){if(!xxdialogMode){var g="",n=xxStorage.content[a][b][c];""!=a&&(g+=addHtmlValue("Vendor",a));""!=b&&(g+=addHtmlValue("Application",b));g+=addHtmlValue("Name",c);g+=addHtmlValue("Size",n.size+" bytes");n.link&&(g+=addHtmlValue("Link",n.link));setDialogMode(11,"Storage Item",5,showStorageDetailsEx,g,d)}}function showStorageDetailsEx(a,b){2==a&&wsstack.comm.PerformAjax("",storageDeleteResponse,null,0,"/amt-storage/"+b,"DELETE")}
1042
function storageDeleteResponse(a,b){200!=b?messagebox("Storage","Unable to delete file (ERR"+b+"), check that the computer is powered on."):PullStorage()}function DownloadFromStorage(a,b,c){xxdialogMode||(haltEvent(c),wsstack.comm.PerformAjax("",DownloadFromStorageEx,b,0,"/amt-storage/"+a,"GET"))}function DownloadFromStorageEx(a,b,c){200!=b||null==a?console.log(b,"Data = null"):saveAs(data2blob(a),c)}
1043
function OpenFromStorage(a,b){if(!xxdialogMode){haltEvent(b);var c=window.open("http://"+wsstack.comm.host+":"+wsstack.comm.port+"/amt-storage/"+a,"_blank");c.opener=null;c.focus()}}function PushToStorage(a,b,c){var d=null;7E3<b.length&&(d=[a,b.substring(7E3)],b=b.substring(0,7E3));wsstack.comm.PerformAjax(b,PushToStorageResponse,d,0,"/amt-storage/"+a+(1==c?"?append=":""),"PUT")}
1044
function PushToStorageResponse(a,b,c){200!=b?messagebox("Storage","Unable to push file (ERR"+b+"), check that the computer is powered on."):null!=c?PushToStorage(c[0],c[1],!0):PullStorage()}
@@ -1047,23 +1048,23 @@ c+='<br><div style=height:16px><input id=mstoragelink style=float:right;width:24
1048
setDialogMode(11,"Storage Upload",3,UploadToStorageEx,c,a);a&&SetStorageName(b)}}function UploadToStorageEx(a,b){if(b)d=new FileReader,d.onload=UploadToStorageEx2,d.filename=Q("mstoragefile").value,d.readAsBinaryString(b);else{var c=Q("mstoragefile");if(1==c.files.length){var d=new FileReader;d.onload=UploadToStorageEx2;d.filename=c.files[0].name;d.readAsBinaryString(c.files[0])}}}
1049
function SetStorageName(a){a||(a=Q("mstoragefile"),a=1==a.files.length?a.files[0].name:"");a=a.split(" ").join("");var b=a.split("-");3==b.length&&12>b[0].length&&12>b[1].length&&(Q("mstoragevendor").value=b[0],Q("mstorageapplication").value=b[1],a=b[2]);a=a.split("-").join("");a.endsWith(".gz")&&(a=a.substring(0,a.length-3));a.endsWith(".htm")||a.endsWith(".html")?Q("mstoragetype").value="text/html":a.endsWith(".txt")&&(Q("mstoragetype").value="text/plain");11<a.length&&(a=a.substring(0,11));Q("mstoragefilename").value=
1050
a}
1050
-function UploadToStorageEx2(a){var b;b=Q("mstoragevendor").value;var c=Q("mstorageapplication").value,d=Q("mstoragefilename").value;""==d&&(d="Filename");var f=Q("mstoragetype").value;""==f&&(f="application/octet-stream");var m=Q("mstoragelink").value;""!=b||""!=c||"logon.htm"!=d.toLowerCase()&&"index.htm"!=d.toLowerCase()?(""==b&&(b="Vendor"),""==c&&(c="App"),b=b+"/"+c+"/"+d):b=d.toLowerCase();c="<metadata><headers>";d=a.target.filename;d||(d=Q("mstoragefile").files[0].name);d.endsWith(".gz")&&(c+=
1051
-"<h>Content-Encoding: gzip</h>");c+="<h>Content-Type: "+f+"</h></headers>";""!=m&&(c+="<link>"+m+"</link>");c+="</metadata>"+a.target.result;PushToStorage(b,c)}function _fmtdatetime(a){return a.replace("T"," ").replace("Z","")}
1051
+function UploadToStorageEx2(a){var b;b=Q("mstoragevendor").value;var c=Q("mstorageapplication").value,d=Q("mstoragefilename").value;""==d&&(d="Filename");var g=Q("mstoragetype").value;""==g&&(g="application/octet-stream");var n=Q("mstoragelink").value;""!=b||""!=c||"logon.htm"!=d.toLowerCase()&&"index.htm"!=d.toLowerCase()?(""==b&&(b="Vendor"),""==c&&(c="App"),b=b+"/"+c+"/"+d):b=d.toLowerCase();c="<metadata><headers>";d=a.target.filename;d||(d=Q("mstoragefile").files[0].name);d.endsWith(".gz")&&(c+=
1052
+"<h>Content-Encoding: gzip</h>");c+="<h>Content-Type: "+g+"</h></headers>";""!=n&&(c+="<link>"+n+"</link>");c+="</metadata>"+a.target.result;PushToStorage(b,c)}function _fmtdatetime(a){return a.replace("T"," ").replace("Z","")}
1053
function _fmtinterval(a){a=a.replace("T","").substring(a.indexOf("P")+1);a=" "+a.replace("D"," days ").replace("H"," hours ").replace("M"," minutes ");a=a.replace(" 1 days "," 1 day ").replace(" 1 hours "," 1 hour ").replace(" 1 minutes "," 1 minute ");return a.substring(0,a.length-1)}function _fmttimepad(a){for(a=""+a;2>a.length;)a="0"+a;return a}var xxAlarms=null;
1053
-function PullAlarms(){var a=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage wake alarms.<br><br>";amtstack.Enum("IPS_AlarmClockOccurrence",function(b,c,d,f){if(200==f){QV("go23",!0);if(0<d.length)for(xxAlarms=d,b=0;b<d.length;b++)c="<b>"+d[b].ElementName+"</b>, wake on "+(new Date(d[b].StartTime.Datetime)).toLocaleString().replace(", "," at "),void 0!=d[b].Interval&&(c+=" and each"+_fmtinterval(d[b].Interval.Interval)),1==d[b].DeleteOnCompletion&&(c+=", delete when done"),a+="<div class=itemBar onclick=showAlertDetails("+
1054
+function PullAlarms(){var a=TableStart2()+"<tr><td class=r1 style=padding-left:15px><br>Manage wake alarms.<br><br>";amtstack.Enum("IPS_AlarmClockOccurrence",function(b,c,d,g){if(200==g){QV("go23",!0);if(0<d.length)for(xxAlarms=d,b=0;b<d.length;b++)c="<b>"+d[b].ElementName+"</b>, wake on "+(new Date(d[b].StartTime.Datetime)).toLocaleString().replace(", "," at "),void 0!=d[b].Interval&&(c+=" and each"+_fmtinterval(d[b].Interval.Interval)),1==d[b].DeleteOnCompletion&&(c+=", delete when done"),a+="<div class=itemBar onclick=showAlertDetails("+
1055
b+")><div style=float:right>",xxAccountAdminName&&(a+=" "+AddButton2("Edit...","showAddAlarm("+b+")")),a+="</div><div style=padding-top:3px;width:auto;float:left;overflow-x:hidden>"+c+"</div></div>";else xxAlarms=null,a+="<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()"));a+="<br><td class=r1>"+TableEnd(d+"</div>");
1056
QH(33,a)}},null,!0)}
1056
-function prepareAlarmOccurenceTemplate(a,b,c,d,f){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>'+a+'</s:InstanceID><s:StartTime><p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+c+'</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>"+f+
1057
-"</s:DeleteOnCompletion></d:AlarmTemplate>"}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var a=xxAlarms.length,b;for(b in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[b],function(b,d,f,m){0==--a&&PullAlarms()})}
1057
+function prepareAlarmOccurenceTemplate(a,b,c,d,g){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>'+a+'</s:InstanceID><s:StartTime><p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+c+'</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>"+g+
1058
+"</s:DeleteOnCompletion></d:AlarmTemplate>"}function RemoveAllAlarms(){setDialogMode(1,"Remove all wake alarms",3,RemoveAllAlarmsEx,"Confirm removal of all wake alarms?")}function RemoveAllAlarmsEx(){var a=xxAlarms.length,b;for(b in xxAlarms)amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[b],function(b,d,g,n){0==--a&&PullAlarms()})}
1059
function showAddAlarm(a){if(!xxdialogMode){QE("d25alarm_name",!a);if(void 0!=a){var b=xxAlarms[a],c=new Date(b.StartTime.Datetime);Q("d25alarm_name").value=b.ElementName;Q("d25alarm_sdate").value=c.getFullYear()+"-"+_fmttimepad(c.getMonth()+1)+"-"+_fmttimepad(c.getDate());Q("d25alarm_stime").value=c.getHours()+":"+_fmttimepad(c.getMinutes())+":"+_fmttimepad(c.getSeconds());if(b.Interval){var c=b.Interval.Interval.replace("P","").replace("T","").replace("D","D,").replace("H","H,").replace("M","M,").split(","),
1059
-d=[0,0,0],f;for(f in c){var m=c[f].length-1;"D"==c[f][m]&&(d[0]=parseInt(c[f].substring(0,m)));"H"==c[f][m]&&(d[1]=parseInt(c[f].substring(0,m)));"M"==c[f][m]&&(d[2]=parseInt(c[f].substring(0,m)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==b.DeleteOnCompletion?1:0}else b=new Date,b.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=b.getFullYear()+"-"+_fmttimepad(b.getMonth()+1)+"-"+_fmttimepad(b.getDate()),
1060
+d=[0,0,0],g;for(g in c){var n=c[g].length-1;"D"==c[g][n]&&(d[0]=parseInt(c[g].substring(0,n)));"H"==c[g][n]&&(d[1]=parseInt(c[g].substring(0,n)));"M"==c[g][n]&&(d[2]=parseInt(c[g].substring(0,n)))}Q("d25alarm_interval").value=d.join("-")}else Q("d25alarm_interval").value="";Q("d25alarm_doc").value=1==b.DeleteOnCompletion?1:0}else b=new Date,b.setDate((new Date).getDate()+1),Q("d25alarm_name").value="",Q("d25alarm_sdate").value=b.getFullYear()+"-"+_fmttimepad(b.getMonth()+1)+"-"+_fmttimepad(b.getDate()),
1061
Q("d25alarm_stime").value=b.getHours()+":"+_fmttimepad(b.getMinutes())+":00",Q("d25alarm_interval").value="",Q("d25alarm_doc").value=0;setDialogMode(25,"Add new alarm",void 0!=a?7:3,showAddAlarmOk,"",a);alertDialogUpdate()}}function alertDialogUpdate(){var a=Q("d25alarm_interval").value.split("-").length,a=0<Q("d25alarm_name").value.length&&3==Q("d25alarm_sdate").value.split("-").length&&3==Q("d25alarm_stime").value.split(":").length&&(1==a||3==a);QE("c37",a)}
1061
-function showAddAlarmOk(a,b){if(2==a)showAlertDetailsDelete(a,b);else{var c=Q("d25alarm_name").value,d=Q("d25alarm_sdate").value.split("-"),f=Q("d25alarm_stime").value.split(":"),d=new Date(d[0],d[1]-1,d[2],f[0],f[1],f[2],0),d=_fmttimepad(d.getUTCFullYear())+"-"+_fmttimepad(d.getUTCMonth()+1)+"-"+_fmttimepad(d.getUTCDate())+"T"+_fmttimepad(d.getUTCHours())+":"+_fmttimepad(d.getUTCMinutes())+":"+_fmttimepad(d.getUTCSeconds())+"Z",f=Q("d25alarm_interval").value.split("-");3!=f.length&&(f=[0,0,0]);var f=
1062
-"P"+f[0]+"DT"+f[1]+"H"+f[2]+"M",m=1==Q("d25alarm_doc").value,c=prepareAlarmOccurenceTemplate(c,c,d,f,m);void 0==b?wsstack.ExecMethodXml(amtstack.CompleteName("AMT_AlarmClockService"),"AddAlarm",c,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()}):(c=Clone(xxAlarms[b]),
1063
-c.StartTime='<p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+d+"</p:Datetime>",c.Interval='<p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+f+"</p:Interval>",c.DeleteOnCompletion=m,amtstack.Put("IPS_AlarmClockOccurrence",c,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:c.InstanceID}))}}
1062
+function showAddAlarmOk(a,b){if(2==a)showAlertDetailsDelete(a,b);else{var c=Q("d25alarm_name").value,d=Q("d25alarm_sdate").value.split("-"),g=Q("d25alarm_stime").value.split(":"),d=new Date(d[0],d[1]-1,d[2],g[0],g[1],g[2],0),d=_fmttimepad(d.getUTCFullYear())+"-"+_fmttimepad(d.getUTCMonth()+1)+"-"+_fmttimepad(d.getUTCDate())+"T"+_fmttimepad(d.getUTCHours())+":"+_fmttimepad(d.getUTCMinutes())+":"+_fmttimepad(d.getUTCSeconds())+"Z",g=Q("d25alarm_interval").value.split("-");3!=g.length&&(g=[0,0,0]);var g=
1063
+"P"+g[0]+"DT"+g[1]+"H"+g[2]+"M",n=1==Q("d25alarm_doc").value,c=prepareAlarmOccurenceTemplate(c,c,d,g,n);void 0==b?wsstack.ExecMethodXml(amtstack.CompleteName("AMT_AlarmClockService"),"AddAlarm",c,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()}):(c=Clone(xxAlarms[b]),
1064
+c.StartTime='<p:Datetime xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+d+"</p:Datetime>",c.Interval='<p:Interval xmlns:p="http://schemas.dmtf.org/wbem/wscim/1/common">'+g+"</p:Interval>",c.DeleteOnCompletion=n,amtstack.Put("IPS_AlarmClockOccurrence",c,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:c.InstanceID}))}}
1065
function showAlertDetails(a){if(!xxdialogMode){var b=xxAlarms[a],c=new Date(b.StartTime.Datetime),c="<div style=text-align:left>"+addHtmlValue("Name",b.ElementName)+addHtmlValue("Wake time",c.toLocaleString().replace(", "," at "));void 0!=b.Interval&&(c+=addHtmlValue("Internal",_fmtinterval(b.Interval.Interval)));c+=addHtmlValue("After wake",1==b.DeleteOnCompletion?"Delete Alarm":"Keep Alarm")+"</div>";messagebox("Alarm "+b.ElementName,c);setDialogMode(11,"Alarm "+b.ElementName,5,showAlertDetailsDelete,
1065
-c,a)}}function showAlertDetailsDelete(a,b){2==a&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[b],function(a,b,f,m){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(a){if(1==a&&(a=Q("scriptopen"),1==a.files.length)){var b=new FileReader;b.onload=script_onScriptRead;b.readAsBinaryString(a.files[0])}}
1066
-function script_onScriptRead(a){var b;try{b=JSON.parse(a.target.result)}catch(f){}if(20==currentView){b.scriptText&&(Q("scriptarea").value=b.scriptText);b.mescript&&(Q("compiledarea").value=rstr2hex(atob(b.mescript)));b.blocks?(script_setBuildBlocks(b.blocks),scriptViewButton(1)):(script_setBuildBlocks(),scriptViewButton(0));b.scriptBlocks?script_BlockScript=b.scriptBlocks:script_BuildingBlocks||(script_BlockScript=[]);for(var c in script_BlockScript)if(b=script_BlockScript[c],a=script_BuildingBlocks[b.xname]){a=
1066
+c,a)}}function showAlertDetailsDelete(a,b){2==a&&amtstack.Delete("IPS_AlarmClockOccurrence",xxAlarms[b],function(a,b,g,n){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(a){if(1==a&&(a=Q("scriptopen"),1==a.files.length)){var b=new FileReader;b.onload=script_onScriptRead;b.readAsBinaryString(a.files[0])}}
1067
+function script_onScriptRead(a){var b;try{b=JSON.parse(a.target.result)}catch(g){}if(20==currentView){b.scriptText&&(Q("scriptarea").value=b.scriptText);b.mescript&&(Q("compiledarea").value=rstr2hex(atob(b.mescript)));b.blocks?(script_setBuildBlocks(b.blocks),scriptViewButton(1)):(script_setBuildBlocks(),scriptViewButton(0));b.scriptBlocks?script_BlockScript=b.scriptBlocks:script_BuildingBlocks||(script_BlockScript=[]);for(var c in script_BlockScript)if(b=script_BlockScript[c],a=script_BuildingBlocks[b.xname]){a=
1068
Clone(a);a.id=b.id;a.xname=b.xname;for(var d in a.vars)b.vars[d]&&(a.vars[d].value=b.vars[d].value);script_BlockScript[c]=a}fupdatescript();delete scriptstate;resetScriptButton()}else c={_interactive:1,_certificates:1,_mode:"Firmware"},b&&b.mescript&&(scriptstate=script_setup(atob(b.mescript),c)),scriptstate?(scriptstate.wsstack=wsstack,scriptstate.amtstack=amtstack,scriptstate.onStep=script_updateScriptState,scriptstate.onConsole=script_console,scriptstate.start(100)):messagebox("Run Script","Invalid script file.")}
1069
function script_updateScriptState(){scriptstate&&(QV(9,0<scriptstate.state),center(),0==scriptstate.state&&(scriptstate=void 0))}function script_console(a){0==a.indexOf("INFO: ")&&(a=a.substring(6));0==a.indexOf("SUCCESS: ")&&(a=a.substring(9));0==a.indexOf("ERROR: ")&&(a=a.substring(7));QH(10,", "+a)}function script_Stop(){scriptstate&&(1==scriptstate.dialog&&setDialogMode(0),scriptstate.stop(),scriptstate.state=0,script_updateScriptState())}
1070
var script_BuildingBlocks,script_StartingBuildingBlocks,script_BlockScript=[],script_BlockScriptSelectedId=null,script_BuilderView=0,editscriptstate;
@@ -1071,24 +1072,24 @@ function scriptLoadStartingBlocks(){var a=new XMLHttpRequest;a.onload=function()
1072
function scriptViewButton(a){script_BuilderView=a;QV("scripteditor",0==a);QV("scriptbuilder",1==a);QV("viewEditorButton",script_BuildingBlocks&&1==a);QV("viewBuilderButton",script_BuildingBlocks&&0==a)}
1073
function script_setBuildBlocks(a){script_BuildingBlocks=a;var b="";if(a)for(var c in a)95!=c.charCodeAt(0)&&(b+="<div id=sblock_"+c+' style=cursor:pointer;background-color:#ccc;width:auto;padding:5px;margin:2px ondblclick=script_faddblock("'+c+'") draggable=true ondragstart=script_fondragstart(event,this) ondragend=script_fondragend(event,this) title="'+a[c].desc+'"',b+=">"+a[c].name+"</div>");QH("blocks",b);script_fonfilterchanged();scriptViewButton(script_BuildingBlocks?1:0)}
1074
function script_faddblock(a){var b=Clone(script_BuildingBlocks[a]);b.id=Math.random();b.xname=a;script_BlockScript.push(b);script_BlockScriptSelectedId=script_BlockScript.length-1;fupdatescript()}function script_feditblock(a){xxdialogMode||setDialogMode(11,"Edit "+script_BuildingBlocks[a].name,3,script_feditblockEx,"Edit this block? This operation will reset the block editor and load the block code into the code editor.",a)}
1074
-function script_feditblockEx(a,b){script_newScriptDlgOk();scriptViewButton(0);var c,d=script_BuildingBlocks[b];c=""+("##!BLOCK!##\r\n#id="+b+"\r\n#name="+d.name+"\r\n#desc="+d.desc+"\r\n##!BLOCK!##\r\n");for(var f in d.vars){var m=d.vars[f];c+="##!VAR!##\r\n#id="+f+"\r\n#name="+m.name+"\r\n#desc="+m.desc+"\r\n#type="+m.type+"\r\n";m.maxlength&&(c+="#maxlength="+m.maxlength+"\r\n");if(m.values)for(var p in m.values)c+="#values-"+p+"="+m.values[p]+"\r\n";c+="#value="+m.value+"\r\n##SWAP %%%"+f+"%%% "+
1075
-m.value+"\r\n"}c+="##!VAR!##\r\n##SWAP %%%~%%% 0\r\n\r\n##!BLOCK!##\r\n"+d.code+"\r\n##!BLOCK!##\r\n";Q("scriptarea").value=c}
1076
-function script_fConvertScriptToJsonBlock(a){var b={};a=a.split("##!BLOCK!##\n");var c=a[1].split("\n"),d;for(d in c){var f=c[d].split("=");2==f.length&&(b[f[0].substring(1)]=f[1])}b.vars={};scriptvariables=a[2].split("##!VAR!##\n");for(d in scriptvariables){var c=scriptvariables[d].split("\n"),m={},p={},r=0,l;for(l in c)f=c[l].split("="),2==f.length&&f[1]&&f[0]&&0<f[0].length&&("#values-"==f[0].substring(0,8)?(p[f[0].substring(8)]=f[1],r++):m[f[0].substring(1)]=f[1]);m.id&&(0<r&&(m.values=p),c=m.id,
1077
-delete m.id,b.vars[c]=m)}b.code=a[3];c=b.id;delete b.id;d={};d[c]=b;return JSON.stringify(d,null," ")}function script_fonfilterchanged(){var a=Q("blockfilter").value.toLowerCase(),b;for(b in script_BuildingBlocks)95!=b.charCodeAt(0)&&QV("sblock_"+b,0<=script_BuildingBlocks[b].name.toLowerCase().indexOf(a)||0<=script_BuildingBlocks[b].desc.toLowerCase().indexOf(a))}var script_fonclickDblClickDetectIndex=null,script_fonclickDblClickDetectTime=null;
1075
+function script_feditblockEx(a,b){script_newScriptDlgOk();scriptViewButton(0);var c,d=script_BuildingBlocks[b];c=""+("##!BLOCK!##\r\n#id="+b+"\r\n#name="+d.name+"\r\n#desc="+d.desc+"\r\n##!BLOCK!##\r\n");for(var g in d.vars){var n=d.vars[g];c+="##!VAR!##\r\n#id="+g+"\r\n#name="+n.name+"\r\n#desc="+n.desc+"\r\n#type="+n.type+"\r\n";n.maxlength&&(c+="#maxlength="+n.maxlength+"\r\n");if(n.values)for(var r in n.values)c+="#values-"+r+"="+n.values[r]+"\r\n";c+="#value="+n.value+"\r\n##SWAP %%%"+g+"%%% "+
1076
+n.value+"\r\n"}c+="##!VAR!##\r\n##SWAP %%%~%%% 0\r\n\r\n##!BLOCK!##\r\n"+d.code+"\r\n##!BLOCK!##\r\n";Q("scriptarea").value=c}
1077
+function script_fConvertScriptToJsonBlock(a){var b={};a=a.split("##!BLOCK!##\n");var c=a[1].split("\n"),d;for(d in c){var g=c[d].split("=");2==g.length&&(b[g[0].substring(1)]=g[1])}b.vars={};scriptvariables=a[2].split("##!VAR!##\n");for(d in scriptvariables){var c=scriptvariables[d].split("\n"),n={},r={},u=0,m;for(m in c)g=c[m].split("="),2==g.length&&g[1]&&g[0]&&0<g[0].length&&("#values-"==g[0].substring(0,8)?(r[g[0].substring(8)]=g[1],u++):n[g[0].substring(1)]=g[1]);n.id&&(0<u&&(n.values=r),c=n.id,
1078
+delete n.id,b.vars[c]=n)}b.code=a[3];c=b.id;delete b.id;d={};d[c]=b;return JSON.stringify(d,null," ")}function script_fonfilterchanged(){var a=Q("blockfilter").value.toLowerCase(),b;for(b in script_BuildingBlocks)95!=b.charCodeAt(0)&&QV("sblock_"+b,0<=script_BuildingBlocks[b].name.toLowerCase().indexOf(a)||0<=script_BuildingBlocks[b].desc.toLowerCase().indexOf(a))}var script_fonclickDblClickDetectIndex=null,script_fonclickDblClickDetectTime=null;
1079
function script_fonclick(a,b){if(!xxdialogMode){script_BlockScriptSelectedId=null;b&&(b=fgetParentWithId(b),b.id.startsWith("xblock_")&&(script_BlockScriptSelectedId=b.id.substring(7)));fupdatescript();haltEvent(a);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()}}
1080
function script_fondragstart(a,b){xxdialogMode||(b=fgetParentWithId(b),b.style.opacity="0.4",a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("scriptbuilder/block",b.id))}function script_fondragend(a,b){xxdialogMode||(b=fgetParentWithId(b),b.style.opacity="1.0")}function script_fondragenter(a,b){xxdialogMode||(fgetParentWithId(b).style["border-top"]="solid 2px black")}
1081
function script_fondragleave(a,b){if(!xxdialogMode){a=a.originalEvent||a;var c=document.elementFromPoint(a.pageX,a.pageY);b.contains(c)||(fgetParentWithId(b).style["border-top"]="none")}}
1081
-function script_fondrop(a,b){if(!xxdialogMode){b=fgetParentWithId(b);var c,d=a.dataTransfer.getData("scriptbuilder/block"),f=parseInt(b.id.substring(7));""==d?documentFileSelectHandler(a):(d.startsWith("sblock_")?(c=Clone(script_BuildingBlocks[d.substring(7)]),c.id=Math.random(),c.xname=d.substring(7)):(d=parseInt(d.substring(7)),c=script_BlockScript[d],script_BlockScript.splice(d,1),f>d&&f--),"scriptblocks"==b.id?(c&&script_BlockScript.push(c),script_BlockScriptSelectedId=script_BlockScript.length-
1082
-1):(script_BlockScript.splice(f,0,c),script_BlockScriptSelectedId=f),fupdatescript(),haltEvent(a))}}
1083
-function script_foneditclick(a){if(!xxdialogMode){var b=script_BlockScript[a];script_BlockScriptSelectedId=a;fupdatescript();if(null!=b){var c=b.vars?7:5,d=b.desc+"<br><br>";if(b.vars)for(var f in b.vars){var m=b.vars[f].value,p="";b.vars[f].maxlength&&(p+=" maxlength="+b.vars[f].maxlength);2==b.vars[f].type&&(p+=" onkeypress='return numbersOnly(event)'");if(1==b.vars[f].type||2==b.vars[f].type)m="<input title='"+b.vars[f].desc+"' id=scriptXvalue_"+f+" value='"+b.vars[f].value+"' "+p+" style=width:100%></input>";
1084
-if(3==b.vars[f].type){var m="<select title='"+b.vars[f].desc+"' id=scriptXvalue_"+f+" style=width:100%;padding:0;margin:0>",r;for(r in b.vars[f].values)m+="<option value="+r+(r==b.vars[f].value?" selected":"")+">"+b.vars[f].values[r]+"</option>";m+="</select>"}4==b.vars[f].type&&(m="<input type=password autocomplete=off title='"+b.vars[f].desc+"' id=scriptXvalue_"+f+" value='"+b.vars[f].value+"' "+p+" style=width:100%></input>");5==b.vars[f].type&&(m="");6==b.vars[f].type&&(m="<input type=file title='"+
1085
-b.vars[f].desc+"' id=scriptXvalue_"+f+" "+p+" style=width:100%></input>");d+='<table style=width:100% title="'+b.vars[f].desc+'"><td style=width:120px>'+b.vars[f].name+"<td><b>"+m+"</b></table>";if(5==b.vars[f].type){var d=d+("<ul id=scriptXvalue_"+f+' 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">'),l;for(l in b.vars[f].values)m="",0<=b.vars[f].value.indexOf(l)&&(m=" checked"),d+="<li><label><input type=checkbox id=scriptXvaluex_"+
1086
-f+"-"+l+""+m+">"+b.vars[f].values[l]+"</label></li>";d+="</ul>"}}}setDialogMode(11,b.name,c,script_foneditclickEx,d,a)}}
1087
-function script_foneditclickEx(a,b){if(!xxdialogMode){if(2==a)script_BlockScript.splice(b,1),script_BlockScriptSelectedId==b&&(script_BlockScriptSelectedId=null);else{var c=script_BlockScript[b];if(c.vars)for(var d in c.vars)if(5==c.vars[d].type){c.vars[d].value=[];for(var f in c.vars[d].values)Q("scriptXvaluex_"+d+"-"+f).checked&&c.vars[d].value.push(f)}else if(6==c.vars[d].type){var m=Q("scriptXvalue_"+d);if(1==m.files.length){var p=new FileReader;p.onload=function(a){c.vars[d].value=btoa(a.target.result);
1088
-fupdatescript()};p.readAsBinaryString(m.files[0])}}else c.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(a){for(;!a.id;)a=a.parentElement;return a}
1082
+function script_fondrop(a,b){if(!xxdialogMode){b=fgetParentWithId(b);var c,d=a.dataTransfer.getData("scriptbuilder/block"),g=parseInt(b.id.substring(7));""==d?documentFileSelectHandler(a):(d.startsWith("sblock_")?(c=Clone(script_BuildingBlocks[d.substring(7)]),c.id=Math.random(),c.xname=d.substring(7)):(d=parseInt(d.substring(7)),c=script_BlockScript[d],script_BlockScript.splice(d,1),g>d&&g--),"scriptblocks"==b.id?(c&&script_BlockScript.push(c),script_BlockScriptSelectedId=script_BlockScript.length-
1083
+1):(script_BlockScript.splice(g,0,c),script_BlockScriptSelectedId=g),fupdatescript(),haltEvent(a))}}
1084
+function script_foneditclick(a){if(!xxdialogMode){var b=script_BlockScript[a];script_BlockScriptSelectedId=a;fupdatescript();if(null!=b){var c=b.vars?7:5,d=b.desc+"<br><br>";if(b.vars)for(var g in b.vars){var n=b.vars[g].value,r="";b.vars[g].maxlength&&(r+=" maxlength="+b.vars[g].maxlength);2==b.vars[g].type&&(r+=" onkeypress='return numbersOnly(event)'");if(1==b.vars[g].type||2==b.vars[g].type)n="<input title='"+b.vars[g].desc+"' id=scriptXvalue_"+g+" value='"+b.vars[g].value+"' "+r+" style=width:100%></input>";
1085
+if(3==b.vars[g].type){var n="<select title='"+b.vars[g].desc+"' id=scriptXvalue_"+g+" style=width:100%;padding:0;margin:0>",u;for(u in b.vars[g].values)n+="<option value="+u+(u==b.vars[g].value?" selected":"")+">"+b.vars[g].values[u]+"</option>";n+="</select>"}4==b.vars[g].type&&(n="<input type=password autocomplete=off title='"+b.vars[g].desc+"' id=scriptXvalue_"+g+" value='"+b.vars[g].value+"' "+r+" style=width:100%></input>");5==b.vars[g].type&&(n="");6==b.vars[g].type&&(n="<input type=file title='"+
1086
+b.vars[g].desc+"' id=scriptXvalue_"+g+" "+r+" style=width:100%></input>");d+='<table style=width:100% title="'+b.vars[g].desc+'"><td style=width:120px>'+b.vars[g].name+"<td><b>"+n+"</b></table>";if(5==b.vars[g].type){var d=d+("<ul id=scriptXvalue_"+g+' 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">'),m;for(m in b.vars[g].values)n="",0<=b.vars[g].value.indexOf(m)&&(n=" checked"),d+="<li><label><input type=checkbox id=scriptXvaluex_"+
1087
+g+"-"+m+""+n+">"+b.vars[g].values[m]+"</label></li>";d+="</ul>"}}}setDialogMode(11,b.name,c,script_foneditclickEx,d,a)}}
1088
+function script_foneditclickEx(a,b){if(!xxdialogMode){if(2==a)script_BlockScript.splice(b,1),script_BlockScriptSelectedId==b&&(script_BlockScriptSelectedId=null);else{var c=script_BlockScript[b];if(c.vars)for(var d in c.vars)if(5==c.vars[d].type){c.vars[d].value=[];for(var g in c.vars[d].values)Q("scriptXvaluex_"+d+"-"+g).checked&&c.vars[d].value.push(g)}else if(6==c.vars[d].type){var n=Q("scriptXvalue_"+d);if(1==n.files.length){var r=new FileReader;r.onload=function(a){c.vars[d].value=btoa(a.target.result);
1089
+fupdatescript()};r.readAsBinaryString(n.files[0])}}else c.vars[d].value=Q("scriptXvalue_"+d).value}fupdatescript()}}function fgetParentWithId(a){for(;!a.id;)a=a.parentElement;return a}
1090
function fupdatescript(){var a="",b;for(b in script_BlockScript){a+="<div id=xblock_"+b+" style=cursor:pointer;min-height:24px;background-color:#"+(script_BlockScriptSelectedId==b?"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[b].desc+
1090
-'"';a+="><input style=float:right type=button value=Edit... onclick=script_foneditclick("+b+")><div style=font-size:16px><b>"+script_BlockScript[b].name+"</b>";if(script_BlockScript[b].vars){var c=0,a=a+"<table class='scriptBlockVar us' cellpadding=0 cellspacing=0 style=width:100%;border-radius:5px;margin-top:8px>",d;for(d in script_BlockScript[b].vars){var f=script_BlockScript[b].vars[d].value;4==script_BlockScript[b].vars[d].type&&0<script_BlockScript[b].vars[d].value.length&&(f="*****");3==script_BlockScript[b].vars[d].type&&
1091
-(f=script_BlockScript[b].vars[d].values[script_BlockScript[b].vars[d].value]);6==script_BlockScript[b].vars[d].type&&(f=script_BlockScript[b].vars[d].value?"Binary file, "+script_BlockScript[b].vars[d].value.length+" bytes":"Not set");a+="<tr title='"+script_BlockScript[b].vars[d].desc+"'><td width=200px style='"+(0<c?"border-top:1px solid #a810a8":"")+"'><p>"+script_BlockScript[b].vars[d].name+"<td style='"+(0<c?"border-top:1px solid #a810a8":"")+"'>"+f;c++}a+="<tr><td style=height:3px></table>"}a+=
1091
+'"';a+="><input style=float:right type=button value=Edit... onclick=script_foneditclick("+b+")><div style=font-size:16px><b>"+script_BlockScript[b].name+"</b>";if(script_BlockScript[b].vars){var c=0,a=a+"<table class='scriptBlockVar us' cellpadding=0 cellspacing=0 style=width:100%;border-radius:5px;margin-top:8px>",d;for(d in script_BlockScript[b].vars){var g=script_BlockScript[b].vars[d].value;4==script_BlockScript[b].vars[d].type&&0<script_BlockScript[b].vars[d].value.length&&(g="*****");3==script_BlockScript[b].vars[d].type&&
1092
+(g=script_BlockScript[b].vars[d].values[script_BlockScript[b].vars[d].value]);6==script_BlockScript[b].vars[d].type&&(g=script_BlockScript[b].vars[d].value?"Binary file, "+script_BlockScript[b].vars[d].value.length+" bytes":"Not set");a+="<tr title='"+script_BlockScript[b].vars[d].desc+"'><td width=200px style='"+(0<c?"border-top:1px solid #a810a8":"")+"'><p>"+script_BlockScript[b].vars[d].name+"<td style='"+(0<c?"border-top:1px solid #a810a8":"")+"'>"+g;c++}a+="<tr><td style=height:3px></table>"}a+=
1093
"</div></div>"}""==a&&(a='<div style="padding:15px;color:gray">Start your script by drag & dropping blocks from the left side into this scripting box.<div>');QH("scriptblocks",a+"<div style=height:80px></div>");for(b in script_BlockScript)QS("xblock_"+b).borderLeft=script_CurrentHighlightBlock==b?"3px solid black":"";script_blocksToScript()}
1094
function script_blocksToScript(){var a="";if(script_BuildingBlocks){script_BuildingBlocks._start&&(a+="##### Starting Block #####\r\n"+script_BuildingBlocks._start.code+"\r\n\r\n");for(var b in script_BlockScript){var c=script_BlockScript[b].code,c=c.split("%%%~%%%").join(b),d;for(d in script_BlockScript[b].vars)c=c.split("%%%"+d+"%%%").join(script_BlockScript[b].vars[d].value);a+="##### Block: "+script_BlockScript[b].name+" #####\r\nHighlightBlock __t "+b+"\r\n"+c+"\r\n\r\n"}script_BuildingBlocks._end&&
1095
(a+="##### Ending Block #####\r\n"+script_BuildingBlocks._end.code+"\r\nHighlightBlock\r\n")}Q("scriptarea").value=a}var script_CurrentHighlightBlock;function script_HighlightBlock(a,b){if(a==editscriptstate){script_CurrentHighlightBlock=b;for(var c in script_BlockScript)QS("xblock_"+c).borderLeft=script_CurrentHighlightBlock==c?"3px solid black":""}}function script_newScriptDlg(){xxdialogMode||setDialogMode(11,"New Script",3,script_newScriptDlgOk,"<br>Reset & clear the script editor?")}
@@ -1100,18 +1101,18 @@ function editscript_updateScriptState(a){var b="";if(a&&null!=a){var c=[],d;for(
1101
50)+"...");QH("EditScriptStatus",b)}function script_toString(a){return"object"==typeof a?JSON.stringify(a):a}
1102
function script_saveScript(a){xxdialogMode||scriptstate||(a&&1==a.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 >"))}
1103
function script_saveScriptOk(){if(!xxdialogMode){var a=JSON.stringify({scriptText:Q("scriptarea").value,mescript:btoa(script_compile(Q("scriptarea").value)),blocks:script_StartingBuildingBlocks,scriptBlocks:script_BlockScript},null," ");saveAs(data2blob(a),Q("scriptsavename").value)}}var xxdialogMode,xxdialogFunc,xxdialogButtons,xxdialogTag;
1103
-function setDialogMode(a,b,c,d,f,m){xxdialogMode=a;xxdialogFunc=d;xxdialogButtons=c;xxdialogTag=m;QE("c37",!0);QV("c37",c&1);QV("c36",c&2);QV(34,c&2);QV("c38",c&4);b&&QH(35,b);for(b=1;26>b;b++)QV("dialog"+b,b==a);QV("dialog",a);f&&(11==a?QH(39,f):QH(36,f))}function dialogclose(a){var b=xxdialogFunc,c=xxdialogButtons,d=xxdialogTag;setDialogMode();(c&8||a)&&b&&b(a,d)}
1104
+function setDialogMode(a,b,c,d,g,n){xxdialogMode=a;xxdialogFunc=d;xxdialogButtons=c;xxdialogTag=n;QE("c37",!0);QV("c37",c&1);QV("c36",c&2);QV(34,c&2);QV("c38",c&4);b&&QH(35,b);for(b=1;26>b;b++)QV("dialog"+b,b==a);QV("dialog",a);g&&(11==a?QH(39,g):QH(36,g))}function dialogclose(a){var b=xxdialogFunc,c=xxdialogButtons,d=xxdialogTag;setDialogMode();(c&8||a)&&b&&b(a,d)}
1105
function center(){QS("dialog").left=(getDocWidth()-400)/2+"px"}function messagebox(a,b){QH(36,b);setDialogMode(1,a,1)}function statusbox(a,b){QH(36,b);setDialogMode(1,a)}
1105
-function SaveJsonFile(a,b,c,d){var f="",m={},p=new Date;amtsysstate&&(f="-"+amtsysstate.AMT_GeneralSettings.response.HostName,m={webappversion:version,description:c,hostname:amtsysstate.AMT_GeneralSettings.response.HostName,localtime:Date(),utctime:(new Date).toUTCString(),isotime:(new Date).toISOString()},HardwareInventory&&(m.systemid=guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));f+="-"+p.getFullYear()+"-"+("0"+(p.getMonth()+1)).slice(-2)+"-"+("0"+
1106
-p.getDate()).slice(-2)+"-"+("0"+p.getHours()).slice(-2)+"-"+("0"+p.getMinutes()).slice(-2);m[b]=d;saveAs(data2blob(JSON.stringify(m,null," ").replace(/\n/g,"\r\n")),a+f+".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"};
1106
+function SaveJsonFile(a,b,c,d){var g="",n={},r=new Date;amtsysstate&&(g="-"+amtsysstate.AMT_GeneralSettings.response.HostName,n={webappversion:version,description:c,hostname:amtsysstate.AMT_GeneralSettings.response.HostName,localtime:Date(),utctime:(new Date).toUTCString(),isotime:(new Date).toISOString()},HardwareInventory&&(n.systemid=guidToStr(HardwareInventory.CIM_ComputerSystemPackage.response.PlatformGUID.toLowerCase())));g+="-"+r.getFullYear()+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+("0"+
1107
+r.getDate()).slice(-2)+"-"+("0"+r.getHours()).slice(-2)+"-"+("0"+r.getMinutes()).slice(-2);n[b]=d;saveAs(data2blob(JSON.stringify(n,null," ").replace(/\n/g,"\r\n")),a+g+".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"};
1108
function errcheck(a,b){if(null==wsstack||amtstack!=b)return!0;200!=a&&9!=a&&(setDialogMode(),wsstack.comm.FailAllError=999,amtstack.CancelAllQueries(999),QH(5,httpErrorTable[a]?httpErrorTable[a]:"Error #"+a),401==a&&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!=a}
1109
function goiFrame(a,b,c){if(!xxdialogMode){go(b);if(1==a.shiftKey||0==Q(13).src.endsWith(c))Q(13).src=c;QV(14,!1);QV(12,!0)}}function go(a,b){if(!xxdialogMode||1==b){QV(12,!1);QV(14,!0);QV(4,100==a);QV(6,100>a);for(var c=0;80>c;c++){QV("p"+c,c==a);var d=QS("go"+c);d&&(d["background-color"]=c==a?"#abcae1":"");d&&(d["background-color"]=c==a?"gray":"")}currentView=a}}
1109
-function portsFromHost(a,b){var c=decodeURIComponent(a).split(":"),d=0==b?16992:16993,f=0==b?16994:16995;1<c.length&&(d=parseInt(c[1]));2<c.length&&(f=parseInt(c[2]));return{host:c[0],http:d,redir:f}}function addLink(a,b){return"<a style=cursor:pointer;color:blue onclick='"+b+"'>♦ "+a+"</a>"}function addLinkConditional(a,b,c){return c?addLink(a,b):a}function haltEvent(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}
1110
-function addOption(a,b,c){var d=document.createElement("option");d.text=b;d.value=c;Q(a).add(d)}function addDisabledOption(a,b,c){var d=document.createElement("option");d.text=b;d.value=c;d.disabled=1;Q(a).add(d)}function passwordcheck(a){if(8>a.length)return!1;var b=0,c=0,d=0,f=0,m;for(m in a){var p=a.charCodeAt(m);64<p&&91>p?b=1:96<p&&123>p?c=1:47<p&&58>p?d=1:f=1}return 4==b+c+d+f}
1110
+function portsFromHost(a,b){var c=decodeURIComponent(a).split(":"),d=0==b?16992:16993,g=0==b?16994:16995;1<c.length&&(d=parseInt(c[1]));2<c.length&&(g=parseInt(c[2]));return{host:c[0],http:d,redir:g}}function addLink(a,b){return"<a style=cursor:pointer;color:blue onclick='"+b+"'>♦ "+a+"</a>"}function addLinkConditional(a,b,c){return c?addLink(a,b):a}function haltEvent(a){a.preventDefault&&a.preventDefault();a.stopPropagation&&a.stopPropagation();return!1}
1111
+function addOption(a,b,c){var d=document.createElement("option");d.text=b;d.value=c;Q(a).add(d)}function addDisabledOption(a,b,c){var d=document.createElement("option");d.text=b;d.value=c;d.disabled=1;Q(a).add(d)}function passwordcheck(a){if(8>a.length)return!1;var b=0,c=0,d=0,g=0,n;for(n in a){var r=a.charCodeAt(n);64<r&&91>r?b=1:96<r&&123>r?c=1:47<r&&58>r?d=1:g=1}return 4==b+c+d+g}
1112
function methodcheck(a){return a&&null!=a&&a.Body&&0!=a.Body.ReturnValue?(messagebox("Call Error",a.Header.Method+": "+(a.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>"}
1113
function TableEntry(a,b){return"<tr><td class=r1><p>"+a+"<td class=r1>"+b}function FullTable(a,b){var c=TableStart();for(i in a)i&&a[i]&&(c+=TableEntry(i,a[i]));return c+TableEnd(b)}function TableEnd(a){return"<tr><td colspan=2><p>"+(a?a:"")+"</table>"}function AddButton(a,b){return"<input type=button value='"+a+"' onclick='"+b+"' style=margin:4px>"}function AddButton2(a,b,c){return"<input type=button value='"+a+"' onclick='"+b+"' "+c+">"}
1114
function AddRefreshButton(a){return"<input type=button name=refreshbtn value=Refresh onclick='refreshButtons(false);"+a+"' 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>'}
1114
-function MoreEnd(){return'<a style=cursor:pointer;color:blue onclick=QV("morexxx2",false);QV("morexxx1",true)>▲ Less</a></div>'}function getSelectedOptions(a){for(var b=[],c,d=0,f=a.options.length;d<f;d++)c=a.options[d],c.selected&&b.push(c.value);return b}function getInstance(a,b){for(var c in a)if(a[c].InstanceID==b)return a[c];return null}function getItem(a,b,c){for(var d in a)if(a[d][b]==c)return a[d];return null}
1115
+function MoreEnd(){return'<a style=cursor:pointer;color:blue onclick=QV("morexxx2",false);QV("morexxx1",true)>▲ Less</a></div>'}function getSelectedOptions(a){for(var b=[],c,d=0,g=a.options.length;d<g;d++)c=a.options[d],c.selected&&b.push(c.value);return b}function getInstance(a,b){for(var c in a)if(a[c].InstanceID==b)return a[c];return null}function getItem(a,b,c){for(var d in a)if(a[d][b]==c)return a[d];return null}
1116
function guidToStr(a){return a.substring(6,8)+a.substring(4,6)+a.substring(2,4)+a.substring(0,2)+"-"+a.substring(10,12)+a.substring(8,10)+"-"+a.substring(14,16)+a.substring(12,14)+"-"+a.substring(16,20)+"-"+a.substring(20)}function getUrlVars(){for(var a,b=[],c=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),d=0;d<c.length;d++)a=c[d].indexOf("="),0<a&&(b[c[d].substring(0,a)]=c[d].substring(a+1,c[d].length));return b}
1117
function getDocWidth(){return window.innerWidth?window.innerWidth:document.documentElement&&document.documentElement.clientWidth&&0!=document.documentElement.clientWidth?document.documentElement.clientWidth:document.getElementsByTagName("body")[0].clientWidth}
1118
function getDocHeight(){return window.innerHeight?window.innerHeight:document.documentElement&&document.documentElement.clientHeight&&0!=document.documentElement.clientHeight?document.documentElement.clientHeight:document.getElementsByTagName("body")[0].clientHeight}function addHtmlValue(a,b){return'<div style=height:20px><div style=float:right;width:220px;overflow:hidden><b title="'+b+'">'+b+"</b></div><div>"+a+"</div></div>"}
views/default-min.handlebars
+1
-1
@@ -1 +1 @@
1
-<!DOCTYPE html> <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="format-detection" content="telephone=no"> <style>body{margin:0;padding:0;border:0;color:black;font-size:13px;font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;background-color:#d3d9d6;}#container{background-color:#fff;width:960px;min-width:960px;margin:0 auto;border-top:0;border-right:1px solid #b7b7b7;border-bottom:0;border-left:1px solid #b7b7b7;padding:0;}#masthead{width:auto;margin:0;padding:0;overflow:auto;text-align:right;background-color:#036;width:960px;}#column_l{position:relative;float:left;width:930px;margin:0;padding:0 15px;background-color:#fff;}#footer{clear:both;overflow:auto;width:100%;text-align:center;background-color:#113962;padding-top:5px;padding-bottom:5px;}#masthead img{float:left;}#masthead p{font-size:11px;color:#fff;margin:10px 10px 0;}#footer a{color:#fff;text-decoration:underline;}#footer a:hover{color:#fff;text-decoration:none;}a{color:#036;text-decoration:underline;}.i1{background:url(../images/icons50.png) 0px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i2{background:url(../images/icons50.png) -50px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i3{background:url(../images/icons50.png) -100px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i4{background:url(../images/icons50.png) -150px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i5{background:url(../images/icons50.png) -200px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i6{background:url(../images/icons50.png) -250px 0px;height:50px;width:50px;cursor:pointer;border:none;}.j1{background:url(../images/icons16.png) 0px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j2{background:url(../images/icons16.png) -16px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j3{background:url(../images/icons16.png) -32px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j4{background:url(../images/icons16.png) -48px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j5{background:url(../images/icons16.png) -64px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j6{background:url(../images/icons16.png) -80px 0px;height:16px;width:16px;cursor:pointer;border:none;}.lbbutton{width:74px;height:74px;border-radius:5px;background-color:white;margin-left:8px;margin-top:8px;position:relative;cursor:pointer;opacity:0.5;}.lbbutton:hover{opacity:1;}.lbbuttonsel{opacity:0.9;}.lbbuttonsel2{width:82px;border-radius:5px 0px 0px 5px;opacity:1;}.lb1{background:url(../images/leftbar-62.jpg) -0px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb2{background:url(../images/leftbar-62.jpg) -75px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb3{background:url(../images/leftbar-62.jpg) -150px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb4{background:url(../images/leftbar-62.jpg) -225px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb5{background:url(../images/leftbar-62.jpg) -294px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb6{background:url(../images/leftbar-62.jpg) -360px 0px;height:62px;width:62px;cursor:pointer;border:none;}.m0{background :url(../images/images16.png) -32px 0px;height :16px;width :16px;border:none;float:left }.m1{background :url(../images/images16.png) -16px 0px;height :16px;width :16px;border:none;float:left }.m2{background :url(../images/images16.png) -96px 0px;height :16px;width :16px;border:none;float:left }.m3{background :url(../images/images16.png) -112px 0px;height :16px;width :16px;border:none;float:left }.si0{background :url(../images/icons16.png) 0px 0px;height :16px;width :16px;border:none;float:left }.si1{background :url(../images/icons16.png) -16px 0px;height :16px;width :16px;border:none;float:left }.si2{background :url(../images/icons16.png) -32px 0px;height :16px;width :16px;border:none;float:left }.si3{background :url(../images/icons16.png) -48px 0px;height :16px;width :16px;border:none;float:left }.si4{background :url(../images/icons16.png) -64px 0px;height :16px;width :16px;border:none;float:left }.mi{background :url(../images/meshicon50.png) 0px 0px;height:50px;width:50px;cursor:pointer;border:none }#floatframe{position:fixed;top:200px;height:300px;z-index:200;display:none;}.style1{text-align:center;}.style2{text-align:center;background-color:#808080;font-weight:bold;}.style3{text-align:center;color:white;background-color:#808080;font-weight:bold;}.style3x{text-align:center;color:white;background-color:#808080;font-weight:bold;}.style3x:hover{background-color:#606060;}.style3sel{text-align:center;color:white;background-color:#003366;font-weight:bold;}.style4{color:white;text-decoration:none;}.style5{text-align:center;background-color:#808080;font-weight:normal;}.style6{text-align:center;background-color:#D3D9D6;}.style7{font-size:large;background-color:#FFFFFF;}.style10{background-color:#C9C9C9;}.style11{font-size:large;background-color:#C9C9C9;}.style14{text-align:left;background-color:#D3D9D6;}.auto-style1{text-align:right;background-color:#D3D9D6;}.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;}.fileIcon4{background:url(../images/meshicon16.png);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;}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.fsize{float:right;text-align:right;width:180px;}.g1{background-position:0% 0%;width:14px;height:100%;float:left; background-image:linear-gradient(to right, #ffffff 0%, #c9c9c9 100%);background-color:#c9c9c9;background-repeat:repeat;background-attachment:scroll;}.g1s{background-image:linear-gradient(to right, #ffffff 0%, #b9b9b9 100%);}.g2{background-position:0% 0%;width:14px;height:100%;float:right; background-image:linear-gradient(to right, #c9c9c9 0%, #ffffff 100%);background-color:#c9c9c9;background-repeat:repeat;background-attachment:scroll;}.g2s{background-image:linear-gradient(to right, #b9b9b9 0%, #ffffff 100%);}.h1{background-position:0% 0%;width:14px;height:100%; background-image:linear-gradient(to right, #ffffff 0%, #d3d9d6 100%);background-color:#d3d9d6;background-repeat:repeat;background-attachment:scroll;}.h2{background-position:0% 0%;width:14px;height:100%; background-image:linear-gradient(to right, #d3d9d6 0%, #ffffff 100%);background-color:#d3d9d6;background-repeat:repeat;background-attachment:scroll;}.e1{font-size:large;margin-top:4px;margin-bottom:3px;overflow:hidden;word-wrap:hyphenate;white-space:nowrap;text-overflow:ellipsis;}.e2{float:left;height:100%;background-color:#c9c9c9;}.e2s{background-color:#b9b9b9;}.bar{font-size:large;background-color:#C9C9C9;height:24px;float:left;margin-bottom:2px;}.bar2{font-size:large;height:24px;float:left;margin-bottom:2px;}.bar18{font-size:large;background-color:#C9C9C9;height:18px;float:left;margin-bottom:2px;}.bar182{font-size:large;height:18px;float:left;margin-bottom:2px;}.devHeaderx{color:lightgray;}.DevSt{border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#DDDDDD;}.contextMenu{background:#F9F9F9;box-shadow:0 0 12px rgba( 0, 0, 0, .3 );border:1px solid #ccc; display:none;position:absolute;top:0;left:0;list-style:none;margin:0;padding:5px;min-width:100px;max-width:150px;z-index:500;}.cmtext{color:#444;display:inline-block;padding-left:8px;padding-right:8px;padding-top:5px;padding-bottom:5px;text-decoration:none;width:85%;cursor:default;overflow:hidden;position:relative;}.cmtext:hover{color:#f9f9f9;background:#444;}.gray{ filter:gray; -webkit-filter:grayscale(100%) opacity(60%); }.unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.notifiyBox{position:absolute;z-index:1000;top:50px;right:26px;width:300px;text-align:left;background-color:#F0ECCD;border:4px solid #666;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;-webkit-box-shadow:2px 2px 4px #888;-moz-box-shadow:2px 2px 4px #888;box-shadow:2px 2px 4px #888;max-height:200px;}.notifiyBox:before{content:' ';position:absolute;width:0;height:0;right:5px;top:-30px;border:15px solid;border-color:transparent #666 #666 transparent;}.notifiyBox:after{content:' ';position:absolute;width:0;height:0;right:7px;top:-24px;border:12px solid;border-color:transparent #F0ECCD #F0ECCD transparent;}.notification{width:100%;min-height:30px;}.notification:hover{background-color:#EFE8B6;}.deskToolsBar{padding:3px;}.deskToolsBar:hover{background-color:#EFE8B6;}.userTableHeader{border-bottom:1pt solid lightgray;padding-top:4px;padding-bottom:4px;}.viewSelector{width:32px;height:32px;background-color:#DDD;border-radius:3px;float:left;margin-left:5px;cursor:pointer;opacity:0.3;}.viewSelectorSel{background-color:#BBB;opacity:0.8;}.viewSelector:hover{opacity:0.5;background-color:#AAA;}.viewSelector1{margin-left:2px;margin-top:2px;background:url(../images/views.png) -0px 0px;height:28px;width:28px;}.viewSelector2{margin-left:2px;margin-top:2px;background:url(../images/views.png) -28px 0px;height:28px;width:28px;}.viewSelector3{margin-left:2px;margin-top:2px;background:url(../images/views.png) -56px 0px;height:28px;width:28px;}.viewSelector4{margin-left:2px;margin-top:2px;background:url(../images/views.png) -84px 0px;height:28px;width:28px;}.viewSelector5{margin-left:2px;margin-top:2px;background:url(../images/views.png) -112px 0px;height:28px;width:28px;}.backButtonEx{margin-left:2px;margin-top:2px;background:url(../images/views.png) -140px 0px;height:28px;width:28px;}.backButton{width:32px;height:32px;background-color:#DDD;border-radius:3px;float:left;margin-right:5px;cursor:pointer;opacity:0.3;}.backButton:hover{opacity:0.5;background-color:#AAA;}.hoverButton{opacity:0.5;}.hoverButton:hover{opacity:1;}</style> <style>.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f;}.ol-mouse-position{top:8px;right:8px;position:absolute;}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute;}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;}.ol-overlay-container{will-change:left,right,top,bottom;}.ol-unsupported{display:none;}.ol-unselectable, .ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing;}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px;}.ol-control:hover{background-color:rgba(255,255,255,.6);}.ol-zoom{top:.5em;right:.5em;}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear;}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s;}.ol-zoom-extent{top:4.643em;left:.5em;}.ol-full-screen{right:.5em;top:.5em;}@media print{.ol-control{display:none;}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px;}.ol-control button::-moz-focus-inner{border:none;padding:0;}.ol-zoom-extent button{line-height:1.4em;}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform;}.ol-touch .ol-control button{font-size:1.5em;}.ol-touch .ol-zoom-extent{top:5.5em;}.ol-control button:focus, .ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7);}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0;}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px;}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff;}.ol-attribution li{display:inline;list-style:none;line-height:inherit;}.ol-attribution li:not(:last-child):after{content:" ";}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle;}.ol-attribution button, .ol-attribution ul{display:inline-block;}.ol-attribution.ol-collapsed ul{display:none;}.ol-attribution.ol-logo-only ul{display:block;}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8);}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em;}.ol-attribution.ol-logo-only{background:0 0;bottom:.4em;height:1.1em;line-height:1em;}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em;}.ol-attribution.ol-logo-only button, .ol-attribution.ol-uncollapsible button{display:none;}.ol-zoomslider{top:4.5em;left:.5em;height:200px;}.ol-zoomslider button{position:relative;height:10px;}.ol-touch .ol-zoomslider{top:5.5em;}.ol-overviewmap{left:.5em;bottom:.5em;}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0;}.ol-overviewmap .ol-overviewmap-map, .ol-overviewmap button{display:inline-block;}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px;}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute;}.ol-overviewmap.ol-collapsed .ol-overviewmap-map, .ol-overviewmap.ol-uncollapsible button{display:none;}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8);}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7);}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move;}</style> <style> .ol-ctx-menu-container{position:absolute;padding:8px;background:#fff;color:#222;font-size:13px;border-radius:5px;box-shadow:3px 3px 5px rgba(0,0,0,.2);box-sizing:border-box}.ol-ctx-menu-container a,.ol-ctx-menu-container div,.ol-ctx-menu-container img,.ol-ctx-menu-container li,.ol-ctx-menu-container span,.ol-ctx-menu-container ul{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}.ol-ctx-menu-container a img{border:none}.ol-ctx-menu-container *,.ol-ctx-menu-container :after,.ol-ctx-menu-container :before{box-sizing:inherit}.ol-ctx-menu-container.ol-ctx-menu-hidden{opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .3s,opacity .3s;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container ul{list-style:none}.ol-ctx-menu-container li{position:relative;line-height:20px;padding:2px 5px}.ol-ctx-menu-container li:not(.ol-ctx-menu-separator):hover{cursor:pointer;background-color:#333;color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-submenu .ol-ctx-menu-container{border:1px solid #eee;padding:8px;top:0;opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .3s,opacity .3s;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover .ol-ctx-menu-container{opacity:1;visibility:visible;-webkit-transition-delay:0s;transition-delay:0s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:after{position:absolute;top:7px;right:10px;content:"";display:inline-block;width:.6em;height:.6em;border-right:.3em solid #222;border-top:.3em solid #222;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover:after{border-color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-separator{padding:0}.ol-ctx-menu-container li.ol-ctx-menu-separator hr{border:0;height:1px;background-image:-webkit-linear-gradient(right,transparent,rgba(0,0,0,.75),transparent);background-image:linear-gradient(270deg,transparent,rgba(0,0,0,.75),transparent)}.ol-ctx-menu-icon{text-indent:20px;background-size:20px auto;background-repeat:no-repeat;background-position:0}.ol-ctx-menu-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABaUlEQVQ4T72U7VHCQBCGn90GtAMuNGCswFiBWIFQgWMFxg6wArECsQKhArEBiB1Qwa1zgQn5IAYcxv13k71n3919L8KJQ07M47+BzgG9TRfZ/JBuWhS6BJFHRJICYrZGZIz3z5Ct2+B7gG6I6kt+wewdkQVwjtkAkR5mC8yu26A1oItR/cTsOweQBdgutD8G7jGm2PJ2n8oqUKIpIjd4HxTM8gvaT/F+AlmWnyWaIXKF95eNguFzTYFhNsdWu9kFgFlaFMANUH3D8wDLoLgSTSD2il8NCe2ZXQBxWDGwxmyUzzOMBZ7wy7Qb2K0wQfXjMOBuhlFpZtNty5sFaTQBuTusZdymeqs1SpYKcO9HkE3KbTd9WFijMHJQ5hBNEAYNq5Qd0dhyke0GiE4QzjqfW23mHT8Hl4DG4Lce3FPE7AtbBSdsbNqpoJLgYkRnNeUV+xwJDHTnUEkxHGbhBXUs5TjJjew/KPy94g+NRaIVRYmMXwAAAABJRU5ErkJggg==")}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABc0lEQVQ4T71U21ECQRDsJgGdvQDECMQIxAjECMQILCPwzAAjECIQI0AiEDPQAPaWCBhrcKHuCUcV5f7dY3v6tUscefHIePhfwBBCF8CZqRCReRs1tQxDCH1VfQLQz4EsSY4AvIjIsgm8AhhCGKrqa9zwrqoLAKckB5HtguR1E2gBMITQU9VPAD8GICIGtl3e+xHJBwBT59xtHcsCYJZlUwA3kcGHbfDep51OZywi3/acZZm9vyJ5WR5o38uACmDunNt6ZwAkUxFZDwghDFT1jeSjiJinhVUBVNVJkiTDKO8CQA+AsbNQ7s1Ps0VVn5MkSfcCtmBoDZi1Bdx4eJ7zbBolrwPy3o9J3rWSHPs3A1BbjVKlYBaIyDgvu9LDXDU2RTZmXVW1oKyLxRD+OrkOrJLy5mVM0iaftDhuhVbsvBzMglzKUNW6IV/OOWtCM8MmVvEkmbwt83LaB19fdgOtVquUZJeknaDdobTwbOcvBzPcN/AXH1DFFWP7u9oAAAAASUVORK5CYII=")}.ol-ctx-menu-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABU0lEQVQ4T72U7VECMRRFz3sNaAdkacC1AtcKxApcKnCsQOwAK3CtQKxAqEBsANYOqCDPyTIC+8WCw5jfybn33dxEOPGSE/P4b6BzQG89RT47ZJoWhy5B5BGRZAMxWyEyxvtnyFdt8AagS1F9KQ6YvSMyB84xGyDSw2yO2XUbtAJ0MaqfmH0XAPIA2y7tj4F7jAm2uG1yWQZKNEHkBu+Dg2njWBJNEbnC+8uaIFRuWfuG2QxbbrOrUd0A1Tc8D7AIjkur7DAAsVf8MiWMZ3ZR2m02LPIMscATfjHqBnY7TFD9OAy4zTCCPG/MUKMM5O6wkXFr9dZq7FQqqHk/hDzbFa73cFONTZFDdRyiCcKg5rrSiLaXkiI6RjjrfG6VzDs+B5eAxuDXeYpmNRGzL2wZ/wof+du4GNFpBVqqz5HA4MM5VEYYDrOs+1I6Q9u/4Q8O9wN/AGgWjBVqQjjgAAAAAElFTkSuQmCC")}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABYklEQVQ4T72U4VHCQBCF36tA91KAWIFYgViBWIFYgWMFYgdYgVCBWAFSgdiBFpAsFWSdxcDkQoBkhnF/ZjbfvX377ogjF4/Mw/8CVbUD4MynEJF5k2lqFapqz8yeAPRKkCXJEYAXEVnugm8BVXVgZq/FD+9mtgBwSrJfqF2QvN4FjYCq2jWzTwA/DhARh20qTdMRyQcA0xDCbZ3KCJhl2RTATaHgo+6HLMv8+xXJy+qB3l8FGoB5CKHsXcRV1b6ZvZF8FBH3NKotoJlNkiQZFONdlLtJ3rufbouZPSdJMjwIbKDQEzBrClx7eC4i33Uepmk6JnnXaOQifzMAtdGoRApugYiMI1uqKkrRWAfZo9MxM1+UZzFewl8mN4nYdVM83L7BkwbXLUrF3sfBLQDQBbDy08x8vOohXyEE71lVq9emuEk+3gZa3XYroCvwFyjP8yHJDsnxwaU08GxvS2uFhw78BbzWrxXgMbsHAAAAAElFTkSuQmCC")}</style> <script type="text/javascript" src="scripts/charts.js"></script> <script type="text/javascript" src="scripts/filesaver.1.1.20151003.js"></script> <script type="text/javascript" src="scripts/ol.js"></script> <script type="text/javascript" src="scripts/ol3-contextmenu.js"></script> <title>MeshCentral</title> </head> <body id="body" onload="if (typeof(startup) !== 'undefined') startup();" oncontextmenu="handleContextMenu(event)" style="display:none"> <div id="contextMenu" class="contextMenu noselect" style="display:none"> <div id="cxinfo" class="cmtext" onclick="cmaction(1,event)"><b>Information</b></div> <div id="cxdesktop" class="cmtext" onclick="cmaction(3,event)">Desktop</div> <div id="cxterminal" class="cmtext" onclick="cmaction(2,event)">Terminal</div> <div id="cxfiles" class="cmtext" onclick="cmaction(4,event)">Files</div> <div id="cxevents" class="cmtext" onclick="cmaction(5,event)">Events</div> <div id="cxconsole" class="cmtext" onclick="cmaction(6,event)">Console</div> <hr id="cxmgroupsplit"> <div id="cxmdesktop" class="cmtext" onclick="cmaction(7,event)" style="display:none">Multi-Desktop</div> </div> <div id="meshContextMenu" class="contextMenu,noselect" style="display:none;min-width:0px"> <div id="cxselectall" class="cmtext" onclick="cmmeshaction(1,event)">Select All</div> <div id="cxselectnone" class="cmtext" onclick="cmmeshaction(2,event)">Select None</div> <hr id="cxmgroupsplit2" style="display:none"> <div id="cxmmdesktop" class="cmtext" style="display:none" onclick="cmmeshaction(3,event)">Multi-Desktop</div> </div> <div id="container" style="max-height:100vh;position:relative"> <div id="notifiyBox" class="notifiyBox" style="display:none"></div> <div id="mastheadx"></div> <div id="masthead" class="noselect" style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden"> <div style="float:left;height:66px;color:#c8c8c8;padding-left:20px;padding-top:8px"> <strong><font style="font-size:46px;font-family:Arial,Helvetica,sans-serif">{{{title}}}</font></strong> </div> <div style="float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:14px"> <strong><font style="font-size:14px;font-family:Arial,Helvetica,sans-serif">{{{title2}}}</font></strong> </div> <div style="float:right"> <div id="notificationCount" onclick="clickNotificationIcon()" class="unselectable" style="display:none;min-width:28px;font-size:20px;border-radius:5px;background-color:lightblue;text-align:center;margin:8px;cursor:pointer;padding:4px" title="Click to view current notifications">0</div> </div> <p id="logoutControl">{{{logoutControl}}}</p> </div> <div id="page_leftbar" style="height:calc(100vh - 66px);width:90px;position:absolute;z-index:1000;background:#113962;background:linear-gradient(to bottom, #104893 0%,#113962 100%);color:white;display:none"> <div style="height:16px"></div> <div id="LeftMenuMyDevices" class="lbbutton lbbuttonsel" title="My Devices" onclick="go(1)"> <div class="lb2" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyAccount" class="lbbutton" title="My Account" onclick="go(2)"> <div class="lb1" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyEvents" class="lbbutton" title="My Events" onclick="go(3)"> <div class="lb3" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyFiles" class="lbbutton" title="My Files" onclick="go(5)"> <div class="lb4" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyUsers" class="lbbutton" title="My Users" onclick="go(4)"> <div class="lb5" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyServer" class="lbbutton" title="My Server" onclick="go(6)" style="display:none"> <div class="lb6" style="position:absolute;top:6px;left:6px"></div> </div> </div> <div id="page_content" style="max-height:calc(100vh - 130px)"> <div id="topbarmaster"> <div id="topbar" class="noselect"> <div> <div style="position:relative"> <div style="position:absolute;top:3px;right:6px"> <span title="Toggle full width" style="cursor:pointer;color:white" onclick="toggleFullScreen(1)">↔</span> </div> <table id="MainMenuSpan" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MainMenuMyDevices" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(1)">My Devices</td> <td id="MainMenuMyAccount" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(2)">My Account</td> <td id="MainMenuMyEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(3)">My Events</td> <td id="MainMenuMyFiles" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(5)">My Files</td> <td id="MainMenuMyUsers" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(4)">My Users</td> <td id="MainMenuMyServer" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(6)">My Server</td> <td class="style3" style="text-align:right;height:24px"> </td> </tr> </table> <div id="MainSubMenuSpan" style="display:none"> <table id="MainSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MainDev" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(10)">General</td> <td id="MainDevDesktop" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(11)">Desktop</td> <td id="MainDevTerminal" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(12)">Terminal</td> <td id="MainDevFiles" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(13)">Files</td> <td id="MainDevEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(16)">Events</td> <td id="MainDevAmt" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(14)">Intel® AMT</td> <td id="MainDevConsole" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(15)">Console</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="MeshSubMenuSpan" style="display:none"> <table id="MeshSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MeshGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(20)">General</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="UserSubMenuSpan" style="display:none"> <table id="UserSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="UserGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(30)">General</td> <td id="UserEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(31)">Events</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="ServerSubMenuSpan" style="display:none"> <table id="ServerSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="ServerGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(6)">General</td> <td id="ServerConsole" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(115)">Console</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="UserDummyMenuSpan"> <table id="UserDummyMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr><td class="style3" style="text-align:right;height:24px"> </td></tr> </table> </div> </div> </div> </div> </div> <div id="column_l"> <div id="p0" style="display:none"> <div id="p0message" style="margin:50px;text-align:center"><span id="p0span">Server disconnected</span>, <href onclick="reload()" style="cursor:pointer"><u>click to reconnect</u></href>.</div> </div> <div id="p1" style="display:none"> <div style="float:right;display:none" id="devListToolbarViewIcons"> <div id="devViewButton1" class="viewSelector" onclick="onDeviceViewChange(1)" title="Columns"><div class="viewSelector2"></div></div> <div id="devViewButton2" class="viewSelector" onclick="onDeviceViewChange(2)" title="List"><div class="viewSelector1"></div></div> <div id="devViewButton3" class="viewSelector" onclick="onDeviceViewChange(3)" title="Desktops"><div class="viewSelector3"></div></div> <div id="devViewButton4" class="viewSelector" onclick="onDeviceViewChange(4)" title="Map"><div class="viewSelector4"></div></div> </div><div><h1>My Devices</h1></div> <table class="noselect" style="width:100%;height:24px;background-color:#d3d9d6;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td id="devListToolbar" class="style14" style="display:none"> <input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All"> <input type="button" id="GroupActionButton" disabled="disabled" value="Group Action" onclick="groupActionFunction()"> <input id="SearchInput" type="text" style="width:120px" placeholder="Filter" onchange="masterUpdate(5)" onkeyup="masterUpdate(5)" autocomplete="off" onfocus="onSearchFocus(1)" onblur="onSearchFocus(0)"> <label><input type="checkbox" id="RealNameCheckBox" onclick="onRealNameCheckBox()"><span title="Show devices operating system name">OS Name</span></label> </td> <td id="kvmListToolbar" class="style14" style="height:100%;display:none"> <input type="button" onclick="connectAllKvmFunction()" value="Connect All"> <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All"> <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect">Auto </label> <input type="button" onclick="showMultiDesktopSettings()" value="Settings"> </td> <td id="devMapToolbar" class="style14" style="height:100%;display:none"> <input type="text" id="mapSearchLocation" placeholder="Search Location" onfocus="onMapSearchFocus(1)" onblur="onMapSearchFocus(0)"> <input type="button" value="Search" title="Search for location" onclick="getSearchLocation()"> <input type="button" id="refreshmap" title="Reset map view" value="Reset" style="margin-left:5px" onclick="refreshMap(false,true)"> </td> <td class="auto-style1" style="height:100%"> <div style="float:right;display:none" id="devListToolbarView"> View <select id="viewselect" onchange="onDeviceViewChange()"> <option value="1">Columns <option value="2">List <option value="3">Desktops <option id="viewselectmapoption" value="4">Map </select> </div> <div style="float:right;display:none" id="devListToolbarSort"> Sort <select id="sortselect" onchange="masterUpdate(6)"> <option>Group <option>Power <option>Device <option>Tags </select> </div> <div style="float:right;display:none" id="devListToolbarSize"> Size <select id="sizeselect" onchange="onDeviceViewChange()"> <option value="0">Small <option value="1">Medium <option value="2">Large </select> </div> </td> <td class="h2"></td> </tr> </table> <div id="NoMeshesPanel" style="display:none"> <table style="width:100%;padding:20px"> <tr> <td valign="top" style="width:50px"> <img src="images/info.png" height="48" width="47"> </td> <td> To get started, <a onclick="account_createMesh()" style="cursor:pointer"><strong>click here to create a device group</strong></a>. </td> </tr> </table> </div> <div id="xdevices" class="noselect" style="max-height:calc(100vh - 239px);overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;display:none"></div> <div id="xdevicesmap" style="height:calc(100vh - 239px);width:100%;overflow:hidden;position:relative;display:none"> <div id="xmapSearchResultsDlg" style="position:absolute;display:none;max-height:280px;left:5px;top:5px;max-width:250px;z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666"> <div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"> <div id="xmapSearchClose" style="float:right;padding:5px;cursor:pointer" onclick="mapCloseSearchWindow()"><b>X</b></div> <div style="padding:5px">Location Results</div> <div style="width:100%;margin:6px"></div> </div> <div id="xmapSearchResults" style="margin:6px"></div> </div> </div> <div id="xmap-info-window" style="text-shadow:0px 0px 15px #FFF"></div> </div> <div id="p2" style="display:none"> <h1>My Account</h1> <img alt="" width="150" height="103" src="images/mainaccount.jpg" style="margin-bottom:10px;margin-right:20px;float:right"> <div id="p2AccountSecurity" style="display:none"> <p><strong>Account security</strong></p> <div style="margin-left:25px"> <div id="manageAuthApp"><div style="width:15px;display:inline-block"><span id="authAppSetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageAuthApp()" style="cursor:pointer">Manage authenticator app</a><br></span></div> <div id="manageHardwareOtp"><div style="width:15px;display:inline-block"><span id="authKeySetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageHardwareOtp(0)" style="cursor:pointer">Manage security keys</a><br></span></div> <div id="manageOtp"><div style="width:15px;display:inline-block"><span id="authCodesSetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageOtp(0)" style="cursor:pointer">Manage backup codes</a><br></span></div> </div> </div> <div id="p2AccountActions"> <p><strong>Account actions</strong></p> <p style="margin-left:40px"> <span id="verifyEmailId" style="display:none"><a onclick="account_showVerifyEmail()" style="cursor:pointer">Verify email</a><br></span> <a onclick="account_showChangeEmail()" style="cursor:pointer">Change email address</a><br> <a onclick="account_showChangePassword()" style="cursor:pointer">Change password</a><br> <a onclick="account_showDeleteAccount()" style="cursor:pointer">Delete account</a><br> </p> <br style="clear:both"> </div> <strong>Device Groups</strong> ( <a onclick="account_createMesh()" style="cursor:pointer"><img height="12" src="images/icon-addnew.png" width="12" border="0"> New</a> ) <br><br> <div id="p2meshes"></div> <div id="p2noMeshFound" style="margin-left:40px;display:none">No device groups. <a onclick="account_createMesh()" style="cursor:pointer"><strong>Get started here!</strong></a></div> <br style="clear:both"> </div> <div id="p3" style="display:none"> <h1>My Events</h1> <table style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td> <input id="p2deleteall" type="button" onclick="showDeleteAllEventsDialog()" style="display:none" value="Delete All..."></td> <td class="auto-style1"> Show <select id="p3limitdropdown" onchange="refreshEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> </td> <td class="h2"></td> </tr> </table> <div id="p3events" style="height:calc(100vh - 243px);overflow-y:scroll"></div> </div> <div id="p4" style="display:none"> <h1>My Users</h1> <table style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td class="style14"> <div style="float:right"> <input type="button" onclick="showUserBroadcastDialog()" value="Broadcast"> </div> <div> <input type="button" onclick="showCreateNewAccountDialog()" value="New Account..."> <input id="UserSearchInput" type="text" style="width:120px" placeholder="Filter" onchange="onUserSearchInputChanged()" onkeyup="onUserSearchInputChanged()" autocomplete="off" onfocus="onUserSearchFocus(1)" onblur="onUserSearchFocus(0)"> </div> </td> <td class="h2"></td> </tr> </table> <div id="p3users" style="max-height:calc(100vh - 243px);overflow-y:auto"></div> </div> <div id="p5" style="display:none"> <h1>My Files</h1> <table id="p5toolbar" style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:100%;background-color:#d3d9d6;text-align:left;padding:4px" valign="bottom"> <div id="p5rightOfButtons" style="float:right;margin-top:3px"></div> <div> <input type="button" id="p5FolderUp" disabled="disabled" onclick="p5folderup();" value="Up"> <input type="button" id="p5SelectAllButton" disabled="disabled" onclick="p5selectallfile();" value="Select All" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5RenameFileButton" disabled="disabled" value="Rename" onclick="p5renamefile();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5DeleteFileButton" disabled="disabled" value="Delete" onclick="p5deletefile();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5NewFolderButton" disabled="disabled" value="New Folder" onclick="p5createfolder();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5UploadButton" disabled="disabled" value="Upload" onclick="p5uploadFile()" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5CutButton" disabled="disabled" value="Cut" onclick="p5copyFile(1)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p5CopyButton" disabled="disabled" value="Copy" onclick="p5copyFile(0)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p5PasteButton" disabled="disabled" value="Paste" onclick="p5pasteFile()" onkeypress="return false" onkeydown="return false"> </div> </td> </tr> <tr> <td style="background-color:#E4E9E7;height:28px"> <div style="float:right"> <select id="p5sortdropdown" onchange="updateFiles()"> <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="p5currentpath"></span></div> </td> </tr> </table> <div id="p5filetable" style="width:100%;height:calc(100vh - 294px);overflow:auto;-webkit-user-select:none;position:relative"> <div id="p5PublicShare" style="display:none;width:100%;overflow:auto;-webkit-user-select:none;background-color:lightsteelblue"><div style="padding:4px">These files are shared publicly, click "link" to get public url.</div></div> <div id="bigok" style="width:256px;overflow:hidden;position:absolute;left:337px;top:20px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✓</b></div> <div id="bigfail" style="width:256px;overflow:hidden;position:absolute;left:337px;top:20px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✗</b></div> <span id="p5files"></span> </div> <table id="p5toolbarBottom" style="width:100%" cellpadding="0" cellspacing="0"> <tr><td class="style6" style="text-align:left;padding:3px"> <span id="p5bottomstatus"></span></td></tr> </table> </div> <div id="p6" style="display:none"> <img id="MainMeshImage" src="serverpic.ashx" style="border-width:0px;height:200px;width:200px;float:right"> <h1>My Server</h1> <p id="p2ServerActions"><strong>Server actions</strong></p> <p style="margin-left:40px"> <div id="p2ServerActionsBackup" style="margin-left:40px"><a href="/backup.zip" rel="noreferrer noopener" target="_blank" style="cursor:pointer">Download server backup</a></div> <div id="p2ServerActionsRestore" style="margin-left:40px"><a onclick="server_showRestoreDlg()" style="cursor:pointer">Restore server with backup</a></div> <div id="p2ServerActionsVersion" style="margin-left:40px"><a onclick="server_showVersionDlg()" style="cursor:pointer">Check server version</a></div> <div id="p2ServerActionsErrors" style="margin-left:40px"><a onclick="server_showErrorsDlg()" style="cursor:pointer">Show server error log</a></div> </p> <br><strong>Server Statistics</strong><br><br> <div id="serverStats" style="margin-left:40px"> <div id="serverCpuChartView" style="display:none"> <div style="width:60px;display:inline-block"><canvas id="serverCpuChart" style="width:60px;height:60px"></canvas></div> <div style="width:160px;display:inline-block" id="serverCpuChartText"></div> </div> <div id="serverMemoryChartView" style="display:none"> <div style="width:60px;display:inline-block"><canvas id="serverMemoryChart" style="width:60px;height:60px"></canvas></div> <div style="width:160px;display:inline-block" id="serverMemoryChartText"></div> </div><br><br> <div id="serverStatsTable"></div> </div> </div> <div id="p10" style="display:none"> <table style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:auto" valign="top"> <div id="p10title"> <div id="p10BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p10deviceName"></span></h1> </div> <div id="p10html"></div> </td> <td style="width:20px"></td> <td style="width:200px"> <a style="cursor:pointer" onclick="p10showiconselector()"><img id="MainComputerImage" style="border-width:0px;height:200px;width:200px"></a> <div style="width:100%;text-align:center"><strong><span id="MainComputerState"></span></strong></div> </td> </tr> </table><br> <div id="p10html2"></div> <div id="p10html3"></div> </div> <div id="p11" class="noselect" style="display:none"> <div id="p11title"> <div id="p11deviceNameHeader"> <div id="p11BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <div style="float:right" id="devListToolbarViewIcons"><div class="viewSelector" onclick="deskToggleFull(event)" title="Full Screen. Hold shift to browser full screen."><div class="viewSelector5"></div></div></div> <h1>Desktop - <span id="p11deviceName"></span></h1> </div> </div> <div id="p14warning" 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="p14warninga">, click here to enable it.</span></div> </div> <div id="p14warning2" 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 id="deskarea0" cellpadding="0" cellspacing="0" style="width:100%;padding:0px;padding:0px;margin-top:0px"> <tr id="deskarea1"> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <span id="p14power"></span> <div style='cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px' title="Rotate Left" onclick="drotate(-1)">↺</div> <div style='cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px' title="Rotate Right" onclick="drotate(1)">↻</div> <input id="deskFocusBtn" type="button" title="Toggle focus mode, when active only the region around the mouse is updated" onkeypress="return false" onkeydown="return false" value="Focus All" onclick="deskToggleFocus()" style="margin-right:3px;display:none"> <input id="deskSaveBtn" 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 id="deskActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> <input id="deskActionsSettings" type="button" value="Settings..." title="Edit remote desktop settings" onkeypress="return false" onkeydown="return false" onclick="showDesktopSettings()" 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;display:none"> </div> <div> <div id="idx_deskFullBtn2" onclick="deskToggleFull(event)" style="float:left;font-size:large;cursor:pointer;display:none"> ✖</div> <input type="button" id="autoconnectbutton1" value="AutoConnect" onclick="autoConnectDesktop(event)" onkeypress="return false" onkeydown="return false" style="display:none"> <span id="connectbutton1span"> <input type="button" id="connectbutton1" value="Connect" onclick="connectDesktop(event,1)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="connectbutton1hspan"> <input type="button" id="connectbutton1h" value="HW Connect" onclick="connectDesktop(event,2)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="disconnectbutton1span"> <input type="button" id="disconnectbutton1" value="Disconnect" onclick="connectDesktop(event,0)" onkeypress="return false" onkeydown="return false"></span> <span id="deskstatus">Disconnected</span> </div> </td> </tr> <tr id="deskarea2"> <td> <div style="background-color:gray"><div id="progressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr id="deskarea3"> <td id="deskarea3x" style="background:black;text-align:center;position:relative;overflow:hidden"> <div id="DeskFocus" style="overflow:hidden;color:transparent;border:3px dotted rgba(255,0,0,.2);position:absolute;border-radius:5px" oncontextmenu="return false" onmousedown="dmousedown(event)" onmouseup="dmouseup(event)" onmousemove="dmousemove(event)"></div> <div id="DeskParent" style="overflow:hidden"> <canvas id="Desk" width="640" height="480" style="overflow:hidden;width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown="dmousedown(event)" onmouseup="dmouseup(event)" onmousemove="dmousemove(event)" onmousewheel="dmousewheel(event)"></canvas> </div> <div id="DeskTools" style="position:absolute;width:400px;height:100%;background-color:gray;top:0;right:0;border-left:2px solid lightgray;display:none"> <a id="DeskToolsRefreshButton" style="float:right;padding:3px;cursor:pointer" onclick="refreshDeskTools()">Refresh</a> <div id="DeskToolsBar" style="position:absolute;padding:3px;border-radius:3px 3px 0px 0px;top:5px;left:4px;bottom:26px;background-color:lightgray;cursor:pointer">Processes</div> <div style="position:absolute;top:26px;left:4px;right:4px;bottom:4px;background-color:lightgray;text-align:left"> <div style="border-bottom:1px solid darkgray;padding:3px"><a style="width:50px;padding-right:5px;float:left;cursor:pointer" title="Sort by process id" onclick="sortProcess(0)">PID</a><a style="cursor:pointer" title="Sort by name" onclick="sortProcess(1)">Name</a></div> <div id="DeskToolsProcesses" style="overflow-y:scroll;position:absolute;top:24px;bottom:0px;width:100%"></div> </div> </div> </td> </tr> <tr id="deskarea4"> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <select id="termdisplays" style="display:none" onchange="deskSetDisplay(event)" onclick="deskGetDisplayNumbers(event)"></select> <input id="DeskToolsButton" type="button" value="Tools" title="Toggle tools view" onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()"> <span id="DeskChatButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Open chat window to this computer"><img src='images/icon-chat.png' onclick="deviceChat()" height="16" width="16" style="padding-top:2px"></span> <span id="DeskNotifyButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Display a notification on the remote computer"><img src='images/icon-notify.png' onclick="deviceToastFunction()" height="16" width="16" style="padding-top:2px"></span> <span id="DeskOpenWebButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Open a web address on remote computer"><img src='images/icon-url2.png' onclick="deviceUrlFunction()" height="16" width="16" style="padding-top:2px"></span> </div> <div> <select style="margin-left:6px" id="deskkeys"> <option value="5">Win <option value="0">Win+Down <option value="1">Win+Up <option value="2">Win+L <option value="3">Win+M <option value="4">Shift+Win+M <option value="6">Win+R </select> <input id="DeskWD" type="button" value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()"> <input id="DeskClip" style="margin-left:6px;display:none" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()"> <input id="DeskCAD" type="button" value="Ctrl-Alt-Del" onkeypress="return false" onkeydown="return false" onclick="sendCAD()"> <label><span id="DeskControlSpan" style="margin-left:6px" title="Toggle mouse and keyboard input"><input id="DeskControl" type="checkbox" onkeypress="return false" onkeydown="return false" onclick="toggleKvmControl()">Input</span></label> </div> </td> </tr> </table> </div> <div id="p12" style="display:none"> <div id="p12title"> <div id="p12BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Terminal - <span id="p12deviceName"></span></h1> </div> <div id="p12warning" 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="p14warninga">, click here to enable it.</span></div> </div> <div id="p12warning2" 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:#C0C0C0"> <div style="float:right;text-align:right"> <input id="termActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> </div> <div> <input type="button" id="autoconnectbutton2" value="AutoConnect" onclick="autoConnectTerminal(event)" onkeypress="return false" onkeydown="return false" style="display:none"> <span id="connectbutton2span"> <input type="button" id="connectbutton2" value="Connect" onclick="connectTerminal(event,1)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="connectbutton2hspan"> <input type="button" id="connectbutton2h" value="HW Connect" onclick="connectTerminal(event,2)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="disconnectbutton2span"> <input type="button" id="disconnectbutton2" value="Disconnect" onclick="connectTerminal(event,0)" onkeypress="return false" onkeydown="return false"></span> <span id="termstatus">Disconnected</span> </div> </td> </tr> <tr> <td> <div style="background-color:gray"><div id="termprogressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr> <td style="background:black;text-align:center;height:500px;position:relative"> <pre id="Term" style="background:black;margin:0;padding:0"></pre> </td> </tr> <tr> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <span id="terminalSettingsButtons" style="display:none"> <input id="id_tcrbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="CR+LF" title="Toggle what the return key will send" onclick="termToggleCr()"> <input id="id_tfxkeysbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Intel (F10 = ESC+[OM)" title="Toggle F1 to F10 keys emulation type" onclick="termToggleFx()"> <input id="id_ttypebutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Extended Ascii" title="Toggle terminal emulation type" onclick="termToggleType()"> </span> <select id="specialkeylist" onkeypress="return false" style="margin-left:5px"></select> <input id="specialkeylistinput" type="button" onkeypress="return false" class="bottombutton" value="Send" title="Send the selected special key" onclick="sendSpecialKey()"> </div> <div> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlcbutton" value="Ctl-C" onclick="termSendKey(3,'ctrlcbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlxbutton" value="Ctl-X" onclick="termSendKey(24,'ctrlxbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="escbutton" value="ESC" onclick="termSendKey(27,'escbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="bsbutton" value="Backspace" onclick="termSendKey(8,'bsbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="pastebutton" value="Paste" title="Paste text into the terminal" onclick="showTermPasteDialog()"> </div> </td> </tr> </table> </div> <div id="p13" style="display:none"> <div id="p13title"> <div id="p13BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Files - <span id="p13deviceName"></span></h1> </div> <table id="p13toolbar" style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="background-color:#C0C0C0;border-bottom:2px solid black;padding:2px"> <div style="float:right;text-align:right"> <input id="filesActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> </div> <div> <input id="p13AutoConnect" value="AutoConnect" onclick="autoConnectFiles(event)" onkeypress="return false" onkeydown="return false" type="button" style="display:none"> <input id="p13Connect" value="Connect" onclick="connectFiles(event)" onkeypress="return false" onkeydown="return false" type="button"> <span id="p13Status">Disconnected</span> </div> </td> </tr> <tr> <td style="width:100%;background-color:#d3d9d6;text-align:left;padding:4px" valign="bottom"> <div id="p13rightOfButtons" style="float:right;margin-top:3px"></div> <div> <input type="button" id="p13FolderUp" disabled="disabled" onclick="p13folderup()" value="Up"> <input type="button" id="p13SelectAllButton" disabled="disabled" onclick="p13selectallfile()" value="Select All" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13RenameFileButton" disabled="disabled" value="Rename" onclick="p13renamefile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13DeleteFileButton" disabled="disabled" value="Delete" onclick="p13deletefile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13NewFolderButton" disabled="disabled" value="New Folder" onclick="p13createfolder()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13UploadButton" disabled="disabled" value="Upload" onclick="p13uploadFile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13CutButton" disabled="disabled" value="Cut" onclick="p13copyFile(1)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13CopyButton" disabled="disabled" value="Copy" onclick="p13copyFile(0)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13PasteButton" disabled="disabled" value="Paste" onclick="p13pasteFile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13RefreshButton" disabled="disabled" value="Refresh" onclick="p13folderup(9999)" onkeypress="return false" onkeydown="return false"> </div> </td> </tr> <tr> <td style="background-color:#E4E9E7;height:28px"> <div style="float:right"> <select id="p13sortdropdown" onchange="p13updateFiles()"> <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="p13currentpath"></span></div> </td> </tr> </table> <div id="p13filetable" style="width:100%;height:calc(100vh - 346px);overflow:auto;-webkit-user-select:none"> <div id="p13bigok" style="width:256px;overflow:hidden;position:absolute;left:337px;top:200px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✓</b></div> <div id="p13bigfail" style="width:256px;overflow:hidden;position:absolute;left:337px;top:200px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✗</b></div> <span id="p13files"></span> </div> <table id="p13toolbarBottom" style="width:100%" cellpadding="0" cellspacing="0"> <tr><td class="style6" style="text-align:left;padding:3px"> <span id="p13bottomstatus"></span></td></tr> </table> </div> <div id="p14" style="display:none"> <div id="p14title"> <div id="p14BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Intel® AMT - <span id="p14deviceName"></span></h1> </div> <iframe id="p14iframe" style="width:100%;height:calc(100vh - 242px);border:0;overflow:hidden" src="/commander.htm"></iframe> </div> <div id="p15" style="display:none"> <div id="p15title"> <div id="p15BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1><span id="p15deviceName"></span></h1> </div> <table cellpadding="0" cellspacing="0" style="width:100%;padding:0px;padding:0px;margin-top:0px"> <tr> <td style="background:#C0C0C0"> <div style="float:right;padding-right:4px"> <div style="padding:4px;display:inline-block" id="p15coreName" title="Information about current core running on this agent"></div> <input type="button" id="p15uploadCore" value="Agent Action" onclick="p15uploadCore(event)" title="Change the agent Java Script code module"> </div> <div id="p15statetext" style="padding:4px"></div> </td> </tr> <tr> <td> <div style="background-color:gray"><div id="consoleprogressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr> <td id="p15agentConsole" style="background:black;margin:0;padding:0;color:lightgray;width:100%;height:calc(100vh - 296px);max-height:500px;position:relative"> <pre id="p15agentConsoleText" style="position:absolute;margin:0;padding:0;top:0;bottom:0;left:0;right:0;overflow-y:scroll;overflow-x:auto"></pre> </td> </tr> <tr> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <table style="width:100%"> <tr> <td style="width:99%"> <input id="p15consoleText" style="width:100%" onkeyup="p15consoleSend(event)" onfocus="onConsoleFocus(1)" onblur="onConsoleFocus(0)"> </td> <td> </td> <td style="width:1%"><input id="id_p15consoleClear" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Clear" onclick="p15consoleClear()"></td> </tr> </table> </td> </tr> </table> </div> <div id="p16" style="display:none"> <div id="p16title"> <div id="p16BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Events - <span id="p16deviceName"></span></h1> </div> <div style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px"> <div class="style7" style="width:16px;height:100%;float:left"> </div> <div class="h1" style="height:100%;float:left"> </div> <div class="style14" style="height:100%;float:left"> <input type="button" value="Refresh" onclick="refreshDeviceEvents()"> </div> <div class="auto-style1" style="height:100%;float:right"> Show <select id="p16limitdropdown" onchange="refreshDeviceEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> <div style="height:100%;width:20px;float:right;background-color:#ffffff"></div> <div class="h2" style="height:100%;float:right"> </div> </div> </div> <div id="p16events" style="max-height:calc(100vh - 267px);overflow-y:auto"></div> </div> <div id="p20" style="display:none"> <picture id="MainMeshImage" style="border-width:0px;height:200px;width:200px;float:right"> <source type="image/webp" width="200" height="200" srcset="images/webp/mesh-200.webp"> <img alt="" width="200" height="200" src="images/mesh-200.jpg"> </source></picture> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p20meshName"></span></h1> <p id="p20info"> </div> <div id="p30" style="display:none"> <table style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:auto" valign="top"> <div id="p30title"> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p30userName"></span></h1> </div> <div id="p30html"></div> </td> <td style="width:20px"></td> <td style="width:200px"> <picture id="MainUserImage" style="border-width:0px;height:200px;width:200px;float:right"> <source type="image/webp" width="200" height="200" srcset="images/webp/user-200.webp"> <img alt="" width="200" height="200" src="images/user-200.jpg"> </source></picture> <div style="width:100%;text-align:center"><strong><span id="MainUserState"></span></strong></div> </td> </tr> </table><br> <div id="p30html2"></div> <div id="p30html3"></div> </div> <div id="p31" style="display:none"> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Events - <span id="p31userName"></span></h1> <div style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px"> <div class="style7" style="width:16px;height:100%;float:left"> </div> <div class="h1" style="height:100%;float:left"> </div> <div class="style14" style="height:100%;float:left"> <input type="button" value="Refresh" onclick="refreshUsersEvents()"> </div> <div class="auto-style1" style="height:100%;float:right"> Show <select id="p31limitdropdown" onchange="refreshUsersEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> <div style="height:100%;width:20px;float:right;background-color:#ffffff"></div> <div class="h2" style="height:100%;float:right;"> </div> </div> </div> <div id="p31events" style="max-height:calc(100vh - 267px);overflow-y:scroll"></div> </div> <br id="column_l_bottomgap"> </div> <div id="footer" class="noselect"> <table cellpadding="0" cellspacing="10" style="width:100%"> <tr> <td style="text-align:left;color:white"> {{{footer}}} </td> <td style="text-align:right"> <a id="verifyEmailId2" style="color:yellow;margin-left:3px;cursor:pointer;display:none" onclick="account_showVerifyEmail()">Verify Email</a> <a style="margin-left:3px" href="terms">Terms & Privacy</a> </td> </tr> </table> </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;top:160px;width:400px;left:calc((100% / 2) - 200px);display:none"> <div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"> <div id="id_dialogclose" style="float:right;padding:3px;margin-right:3px;cursor:pointer" onclick="setDialogMode()">✖</div> <div id="id_dialogtitle" 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="id_dialogMessage" style="padding:10px"></div> </div> <div id="dialog2" style="margin:auto;margin:3px"> <div id="id_dialogOptions"></div> </div> <div id="dialog3" style="margin:auto;margin:3px"> <div style="height:26px"> <select id="d3uploadMode" style="float:right;width:260px" onchange="d3modechange()"> <option value="1">Local file upload <option value="2">Server file selection </select> <div>File Selection</div> </div> <div id="d3localmode" style="height:26px;display:none"> <form id="d3localmodeform" method="post" enctype="multipart/form-data" action="uploadfile.ashx" target="fileUploadFrame"> <input type="text" id="d3attrib" name="attrib" style="display:none"> <input type="file" id="d3localFile" name="files" style="float:right;width:260px" onchange="d3setActions()"> <input type="submit" id="d3submit" style="display:none"> </form> <div>Upload File</div> </div> <div id="d3servermode"> <div style="width:100%;background-color:#d3d9d6;text-align:left;padding:3px" valign="bottom"> <input type="button" id="p3FolderUp" disabled="disabled" onclick="d3folderup()" value="Up"> </div> <div id="d3serverfiles" style="width:100%;height:150px;background-color:white;padding:2px;border:1px solid gray;overflow-y:scroll"></div> </div> </div> <div id="dialog7" style="margin:auto;margin:3px"> <div id="d7meshkvm"> <h4 style="width:100%;border-bottom:1px solid gray">Agent Remote Desktop</h4> <div style="margin:3px 0 3px 0"> <select id="d7bitmapquality" style="float:right;width:200px;height:20px" dir="rtl"></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 style="margin:3px 0 3px 0"> <select id="d7framelimiter" style="float:right;width:200px;height:20px" dir="rtl"> <option selected="selected" value="50">Fast <option value="100">Medium <option value="400">Slow <option value="1000">Very slow </select> <div style="height:20px">Frame rate</div> </div> </div> <div id="d7amtkvm"> <h4 style="width:100%;border-bottom:1px solid gray">Intel® AMT Hardware KVM</h4> <div style='height:26px'> <select id="d7desktopmode" style="float:right;width:200px"> <option value="1">RLE8, Fastest <option value="2">RLE16, Recommended <option value="3">RAW8, Slow <option value="4">RAW16, Very Slow </select> <div>Image Encoding</div> </div> <div style="height:60px"> <div style="float:right;border:1px solid #666;width:200px;height:60px;overflow-y:scroll;background-color:white"> <label><input type="checkbox" id='d7showfocus'>Show Focus Tool<br></label> <label><input type="checkbox" id='d7showcursor'>Show Local Mouse Cursor<br></label> </div> <div>Other Settings</div> </div> </div> </div> </div> <div id="idx_dlgButtonBar" style="padding:10px;margin-bottom:4px"> <input id="idx_dlgCancelButton" type="button" value="Cancel" style="float:right;width:80px;margin-left:5px" onclick="dialogclose(0)"> <input id="idx_dlgOkButton" type="button" value="OK" style="float:right;width:80px" onclick="dialogclose(1)"> <div style="height:25px"><input id="idx_dlgDeleteButton" type="button" value="Delete" style="width:80px;display:none" onclick="dialogclose(2)"></div> </div> </div> <iframe name="fileUploadFrame" style="display:none"></iframe> <form style="display:none" method="post" action="uploadfile.ashx" enctype="multipart/form-data" target="fileUploadFrame"><input id="p5fileDragName" name="name"><input id="p5fileDragSize" name="size"><input id="p5fileDragType" name="type"><input id="p5fileDragData" name="data"><input id="p5fileDragLink" name="link"><input type="submit" id="p5loginSubmit2" style="display:none"></form> <form style="display:none" method="post" action="uploadnodefile.ashx" enctype="multipart/form-data" target="fileUploadFrame"><input id="p13fileDragName" name="name"><input id="p13fileDragSize" name="size"><input id="p13fileDragType" name="type"><input id="p13fileDragData" name="data"><input id="p13fileDragLink" name="link"><input type="submit" id="p13loginSubmit2" style="display:none"></form> <audio id="chimes"><source src="sounds/chimes.mp3" type="audio/mp3"></source></audio> </div> </div> <script>if(!String.prototype.startsWith){String.prototype.startsWith=function(a){return this.lastIndexOf(a,0)===0}}if(!String.prototype.endsWith){String.prototype.endsWith=function(a){return this.indexOf(a,this.length-a.length)!==-1}}function Q(a){return document.getElementById(a)}function QS(a){try{return Q(a).style}catch(a){}}function QE(a,b){try{Q(a).disabled=!b}catch(a){}}function QV(a,b){try{QS(a).display=(b?"":"none")}catch(a){}}function QA(a,b){Q(a).innerHTML+=b}function QH(a,b){Q(a).innerHTML=b}function inputBoxFocus(b){Q(b).focus();var a=Q(b).value;Q(b).value="";Q(b).value=a}function ReadShort(b,a){return(b.charCodeAt(a)<<8)+b.charCodeAt(a+1)}function ReadShortX(b,a){return(b.charCodeAt(a+1)<<8)+b.charCodeAt(a)}function ReadInt(b,a){return(b.charCodeAt(a)*16777216)+(b.charCodeAt(a+1)<<16)+(b.charCodeAt(a+2)<<8)+b.charCodeAt(a+3)}function ReadSInt(b,a){return(b.charCodeAt(a)<<24)+(b.charCodeAt(a+1)<<16)+(b.charCodeAt(a+2)<<8)+b.charCodeAt(a+3)}function ReadIntX(b,a){return(b.charCodeAt(a+3)*16777216)+(b.charCodeAt(a+2)<<16)+(b.charCodeAt(a+1)<<8)+b.charCodeAt(a)}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}function MakeToArray(a){if(!a||a==null||typeof a=="object"){return a}return[a]}function SplitArray(a){return a.split(",")}function Clone(a){return JSON.parse(JSON.stringify(a))}function EscapeHtml(a){if(typeof a=="string"){return a.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'")}if(typeof a=="boolean"){return a}if(typeof a=="number"){return a}}function EscapeHtmlBreaks(a){if(typeof a=="string"){return a.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g,"<br />").replace(/\n/g,"").replace(/\t/g," ")}if(typeof a=="boolean"){return a}if(typeof a=="number"){return a}}function ArrayElementMove(a,b,c){a.splice(c,0,a.splice(b,1)[0])}function ObjectToStringEx(e,a){var d="";if(e!=0&&(!e||e==null)){return"(Null)"}if(e instanceof Array){for(var b in e){d+="<br />"+gap(a)+"Item #"+b+": "+ObjectToStringEx(e[b],a+1)}}else{if(e instanceof Object){for(var b in e){d+="<br />"+gap(a)+b+" = "+ObjectToStringEx(e[b],a+1)}}else{d+=EscapeHtml(e)}}return d}function ObjectToStringEx2(e,a){var d="";if(e!=0&&(!e||e==null)){return"(Null)"}if(e instanceof Array){for(var b in e){d+="\r\n"+gap2(a)+"Item #"+b+": "+ObjectToStringEx2(e[b],a+1)}}else{if(e instanceof Object){for(var b in e){d+="\r\n"+gap2(a)+b+" = "+ObjectToStringEx2(e[b],a+1)}}else{d+=EscapeHtml(e)}}return d}function gap(a){var d="";for(var b=0;b<(a*4);b++){d+=" "}return d}function gap2(a){var d="";for(var b=0;b<(a*4);b++){d+=" "}return d}function ObjectToString(a){return ObjectToStringEx(a,0)}function ObjectToString2(a){return ObjectToStringEx2(a,0)}function hex2rstr(a){if(typeof a!="string"||a.length==0){return""}var c="",b=(""+a).match(/../g),e;while(e=b.shift()){c+=String.fromCharCode("0x"+e)}return c}function char2hex(a){return(a+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(a){return unescape(encodeURIComponent(a))}function decode_utf8(a){return decodeURIComponent(escape(a))}function data2blob(c){var b=new Array(c.length);for(var d=0;d<c.length;d++){b[d]=c.charCodeAt(d)}var a=new Blob([new Uint8Array(b)]);return a}function random(a){return Math.floor(Math.random()*a)}function trademarks(a){return a.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}var MeshServerCreateControl=function(b,a){var c={};c.State=0;c.connectstate=0;c.pingTimer=null;c.authCookie=a;c.xxStateChange=function(e,d){if(c.State==e){return}var g=c.State;c.State=e;if(c.onStateChanged){c.onStateChanged(c,c.State,g,d)}};c.Start=function(){if(c.connectstate!=0){return}c.connectstate=0;var d=window.location.protocol.replace("http","ws")+"//"+window.location.host+b+"control.ashx";if(c.authCookie&&(c.authCookie!="")){d+="?auth="+c.authCookie}c.socket=new WebSocket(d);c.socket.onopen=function(g){c.connectstate=1};c.socket.onmessage=c.xxOnMessage;c.socket.onclose=function(g){c.Stop(g.code)};c.xxStateChange(1,0);if(c.pingTimer!=null){clearInterval(c.pingTimer)}c.pingTimer=setInterval(function(){c.send({action:"ping"})},29000)};c.Stop=function(d){c.connectstate=0;if(c.socket){c.socket.close();delete c.socket}if(c.pingTimer!=null){clearInterval(c.pingTimer);c.pingTimer=null}c.xxStateChange(0,d)};c.xxOnMessage=function(d){if(c.State==1){c.xxStateChange(2)}var g;try{g=JSON.parse(d.data)}catch(d){return}if((typeof g!="object")||(g.action=="pong")){return}if(g.action=="close"){if(g.msg){console.log(g.msg)}c.Stop(g.cause);return}if(c.onMessage){c.onMessage(c,g)}};c.send=function(d){if(c.socket!=null&&c.connectstate==1){c.socket.send(JSON.stringify(d))}};return c};function AmtStackCreateService(t){var s=new Object();s.wsman=t;s.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/"];s.PendingEnums=[];s.PendingBatchOperations=0;s.ActiveEnumsCount=0;s.MaxActiveEnumsCount=1;s.onProcessChanged=null;var n=0;var m=0;s.GetPendingActions=function(){return(s.PendingEnums.length*2)+(s.ActiveEnumsCount)+s.wsman.comm.PendingAjax.length+s.wsman.comm.ActiveAjaxCount+s.PendingBatchOperations};function r(){var u=s.GetPendingActions();if(n<u){n=u}if(s.onProcessChanged!=null&&m!=u){m=u;s.onProcessChanged(u,n)}if(u==0){n=0}}s.Subscribe=function(w,v,C,u,B,z,A,x,D,y){s.wsman.ExecSubscribe(s.CompleteName(w),v,C,function(G,F,E,H){r();u(s,w,E,H,B)},0,z,A,x,D,y);r()};s.UnSubscribe=function(v,u,y,w,x){s.wsman.ExecUnSubscribe(s.CompleteName(v),function(B,A,z,C){r();u(s,v,z,C,y)},0,w,x);r()};s.Get=function(v,u,x,w){s.wsman.ExecGet(s.CompleteName(v),function(A,z,y,B){r();u(s,v,y,B,x)},0,w);r()};s.Put=function(v,x,u,z,w,y){s.wsman.ExecPut(s.CompleteName(v),x,function(C,B,A,D){r();u(s,v,A,D,z)},0,w,y);r()};s.Create=function(v,x,u,y,w){s.wsman.ExecCreate(s.CompleteName(v),x,function(B,A,z,C){r();u(s,v,z,C,y)},0,w);r()};s.Delete=function(v,x,u,y,w){s.wsman.ExecDelete(s.CompleteName(v),x,function(B,A,z,C){r();u(s,v,z,C,y)},0,w);r()};s.Exec=function(x,w,u,v,A,y,z){s.wsman.ExecMethod(s.CompleteName(x),w,u,function(D,C,B,E){r();v(s,x,s.CompleteExecResponse(B),E,A)},0,y,z);r()};s.ExecWithXml=function(x,w,u,v,A,y,z){s.wsman.ExecMethodXml(s.CompleteName(x),w,execArgumentsToXml(u),function(D,C,B,E){r();v(s,x,s.CompleteExecResponse(B),E,A)},0,y,z);r()};s.Enum=function(v,u,x,w){if(s.ActiveEnumsCount<s.MaxActiveEnumsCount){s.ActiveEnumsCount++;s.wsman.ExecEnum(s.CompleteName(v),function(B,z,y,C,A){r();d(v,y,u,z,C,A)},x,w)}else{s.PendingEnums.push([v,u,x,w])}r()};function d(w,y,u,z,A,B,x){if(A!=200){u(s,w,null,A,B);c(1);return}if(y==null||y.Header.Method!="EnumerateResponse"||!y.Body.EnumerationContext){u(s,w,null,603,B);c(1);return}var v=y.Body.EnumerationContext;s.wsman.ExecPull(z,v,function(E,D,C,F){b(w,C,u,D,[],F,B,x)})}function b(z,B,u,C,x,D,E,A){if(D!=200){u(s,z,null,D,E);c(1);return}if(B==null||B.Header.Method!="PullResponse"){u(s,z,null,604,E);c(1);return}for(var w in B.Body.Items){if(B.Body.Items[w] instanceof Array){for(var y in B.Body.Items[w]){x.push(B.Body.Items[w][y])}}else{x.push(B.Body.Items[w])}}if(B.Body.EnumerationContext){var v=B.Body.EnumerationContext;s.wsman.ExecPull(C,v,function(H,G,F,I){b(z,F,u,G,x,I,E,1)})}else{c(1);u(s,z,x,D,E);r()}}function c(u){s.ActiveEnumsCount-=u;if(s.ActiveEnumsCount>=s.MaxActiveEnumsCount||s.PendingEnums.length==0){return}var v=s.PendingEnums.shift();s.Enum(v[0],v[1],v[2]);c(0)}s.BatchEnum=function(u,x,v,z,w,y){s.PendingBatchOperations+=(x.length*2);a(u,Clone(x),v,z,{},w,y);r()};function a(u,z,v,C,B,w,A){s.PendingBatchOperations-=2;var y=z.shift(),x=s.Enum;if(y[0]=="*"){x=s.Get;y=y.substring(1)}x(y,function(F,D,E,G,H){H[2][D]={response:(E==null?null:E.Body),responses:E,status:G};if(H[1].length==0||G==401||(w!=true&&G!=200&&G!=400)){s.PendingBatchOperations-=(z.length*2);r();v(s,u,H[2],G,C)}else{r();a(u,z,v,C,H[2],A)}},[u,z,B],A);r()}s.BatchGet=function(u,w,v,y,x){h({name:u,names:w,callback:v,current:0,responses:{},tag:y,pri:x});r()};function h(u){if(u.names.length<=u.current){u.callback(s,u.name,u.responses,200,u.tag)}else{s.wsman.ExecGet(s.CompleteName(u.names[u.current]),function(x,w,v,y){g(u,v,y)},u.pri);u.current++}r()}function g(u,v,w){if(v==null||w!=200){u.callback(s,u.name,null,w,u.tag)}else{u.responses[v.Header.Method]=v;h(u)}}s.CompleteName=function(u){if(u.indexOf("AMT_")==0){return s.pfx[0]+u}if(u.indexOf("CIM_")==0){return s.pfx[1]+u}if(u.indexOf("IPS_")==0){return s.pfx[2]+u}};s.CompleteExecResponse=function(u){if(u&&u!=null&&u.Body&&u.Body.ReturnValue){u.Body.ReturnValueStr=s.AmtStatusToStr(u.Body.ReturnValue)}return u};s.RequestPowerStateChange=function(v,u){s.CIM_PowerManagementService_RequestPowerStateChange(v,'<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>',null,null,u)};s.SetBootConfigRole=function(v,u){s.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>',v,u)};s.CancelAllQueries=function(u){s.wsman.CancelAllQueries(u)};s.AMT_AgentPresenceWatchdog_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdog_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AddAction=function(z,y,x,v,u,w,C,A,B){s.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w,C,A,B)};s.AMT_AgentPresenceWatchdog_DeleteAllActions=function(u,x,v,w){s.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},u,x,v,w)};s.AMT_AgentPresenceWatchdogAction_GetActionEac=function(u){s.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},u)};s.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdogVA_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AddAction=function(z,y,x,v,u,w){s.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w)};s.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(u,v){s.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:u},v)};s.AMT_AuditLog_ClearLog=function(u){s.Exec("AMT_AuditLog","ClearLog",{},u)};s.AMT_AuditLog_RequestStateChange=function(v,w,u){s.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_AuditLog_ReadRecords=function(v,u,w){s.Exec("AMT_AuditLog","ReadRecords",{StartIndex:v},u,w)};s.AMT_AuditLog_SetAuditLock=function(x,v,w,u){s.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:x,Flag:v,Handle:w},u)};s.AMT_AuditLog_ExportAuditLogSignature=function(v,u){s.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:v},u)};s.AMT_AuditLog_SetSigningKeyMaterial=function(y,x,w,v,u){s.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:y,SigningKey:x,LengthOfCertificates:w,Certificates:v},u)};s.AMT_AuditPolicyRule_SetAuditPolicy=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuthorizationService_AddUserAclEntryEx=function(x,w,y,u,z,v){s.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:x,DigestPassword:w,KerberosUserSid:y,AccessPermission:u,Realms:z},v)};s.AMT_AuthorizationService_EnumerateUserAclEntries=function(v,u){s.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:v},u)};s.AMT_AuthorizationService_GetUserAclEntryEx=function(v,u,w){s.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:v},u,w)};s.AMT_AuthorizationService_UpdateUserAclEntryEx=function(y,x,w,z,u,A,v){s.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:y,DigestUsername:x,DigestPassword:w,KerberosUserSid:z,AccessPermission:u,Realms:A},v)};s.AMT_AuthorizationService_RemoveUserAclEntry=function(v,u){s.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:v},u)};s.AMT_AuthorizationService_SetAdminAclEntryEx=function(w,v,u){s.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:w,DigestPassword:v},u)};s.AMT_AuthorizationService_GetAdminAclEntry=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},u)};s.AMT_AuthorizationService_GetAdminAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},u)};s.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},u)};s.AMT_AuthorizationService_SetAclEnabledState=function(w,v,u,x){s.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:w,Enabled:v},u,x)};s.AMT_AuthorizationService_GetAclEnabledState=function(v,u,w){s.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:v},u,w)};s.AMT_EndpointAccessControlService_RequestStateChange=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_EndpointAccessControlService_GetPosture=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:v},u)};s.AMT_EndpointAccessControlService_GetPostureHash=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:v},u)};s.AMT_EndpointAccessControlService_UpdatePostureState=function(v,u){s.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:v},u)};s.AMT_EndpointAccessControlService_GetEacOptions=function(u){s.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},u)};s.AMT_EndpointAccessControlService_SetEacOptions=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:v,PostureHashAlgorithm:w},u)};s.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:v},u)};s.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:v},u)};s.AMT_EthernetPortSettings_SetLinkPreference=function(v,w,u){s.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:v,Timeout:w},u)};s.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(v,u){s.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:v},u)};s.AMT_KerberosSettingData_GetCredentialCacheState=function(u){s.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},u)};s.AMT_KerberosSettingData_SetCredentialCacheState=function(v,u){s.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:v},u)};s.AMT_MessageLog_CancelIteration=function(v,u){s.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:v},u)};s.AMT_MessageLog_RequestStateChange=function(v,w,u){s.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_MessageLog_ClearLog=function(u){s.Exec("AMT_MessageLog","ClearLog",{},u)};s.AMT_MessageLog_GetRecords=function(v,w,u,x){s.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:v,MaxReadRecords:w},u,x)};s.AMT_MessageLog_GetRecord=function(v,w,u){s.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:v,PositionToNext:w},u)};s.AMT_MessageLog_PositionAtRecord=function(v,w,x,u){s.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:v,MoveAbsolute:w,RecordNumber:x},u)};s.AMT_MessageLog_PositionToFirstRecord=function(u,v){s.Exec("AMT_MessageLog","PositionToFirstRecord",{},u,v)};s.AMT_MessageLog_FreezeLog=function(v,u){s.Exec("AMT_MessageLog","FreezeLog",{Freeze:v},u)};s.AMT_PublicKeyManagementService_AddCRL=function(w,v,u){s.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:w,SerialNumbers:v},u)};s.AMT_PublicKeyManagementService_ResetCRLList=function(u,v){s.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:u},v)};s.AMT_PublicKeyManagementService_AddCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddKey=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:v},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(w,v,x,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:w,DNName:v,Usage:x},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(v,x,w,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:v,SigningAlgorithm:x,NullSignedCertificateRequest:w},u)};s.AMT_PublicKeyManagementService_GenerateKeyPair=function(v,w,u){s.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:v,KeyLength:w},u)};s.AMT_RedirectionService_RequestStateChange=function(v,u){s.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:v},u)};s.AMT_RedirectionService_TerminateSession=function(v,u){s.Exec("AMT_RedirectionService","TerminateSession",{SessionType:v},u)};s.AMT_RemoteAccessService_AddMpServer=function(u,z,B,v,x,C,A,y,w){s.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:u,InfoFormat:z,Port:B,AuthMethod:v,Certificate:x,Username:C,Password:A,CN:y},w)};s.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(x,y,v,w,u){s.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:x,TunnelLifeTime:y,ExtendedData:v,MpServer:w},u)};s.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(u,v){s.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_CommitChanges=function(u,v){s.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_Unprovision=function(v,u){s.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:v},u)};s.AMT_SetupAndConfigurationService_PartialUnprovision=function(u,v){s.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(u,v){s.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(v,u){s.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:v},u)};s.AMT_SetupAndConfigurationService_SetMEBxPassword=function(v,u){s.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:v},u)};s.AMT_SetupAndConfigurationService_SetTLSPSK=function(v,w,u){s.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:v,PPS:w},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},u)};s.AMT_SetupAndConfigurationService_GetUuid=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUuid",{},u)};s.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},u)};s.AMT_SystemDefensePolicy_GetTimeout=function(u){s.Exec("AMT_SystemDefensePolicy","GetTimeout",{},u)};s.AMT_SystemDefensePolicy_SetTimeout=function(v,u){s.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:v},u)};s.AMT_SystemDefensePolicy_UpdateStatistics=function(v,x,u,z,w,y){s.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:v,ResetOnRead:x},u,z,w,y)};s.AMT_SystemPowerScheme_SetPowerScheme=function(u,v,w){s.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},u,w,0,{InstanceID:v})};s.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(u,v){s.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},u,v)};s.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(v,x,y,u,w){s.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:v,Tm1:x,Tm2:y},u,w)};s.AMT_UserInitiatedConnectionService_RequestStateChange=function(v,w,u){s.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WebUIService_RequestStateChange=function(v,w,u){s.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:u},v)};s.CIM_Account_RequestStateChange=function(v,w,u){s.Exec("CIM_Account","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_AccountManagementService_CreateAccount=function(w,u,v){s.Exec("CIM_AccountManagementService","CreateAccount",{System:w,AccountTemplate:u},v)};s.CIM_BootConfigSetting_ChangeBootOrder=function(v,u){s.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:v},u)};s.CIM_BootService_SetBootConfigRole=function(u,w,v){s.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:u,Role:w},v,0,1)};s.CIM_Card_ConnectorPower=function(v,w,u){s.Exec("CIM_Card","ConnectorPower",{Connector:v,PoweredOn:w},u)};s.CIM_Card_IsCompatible=function(v,u){s.Exec("CIM_Card","IsCompatible",{ElementToCheck:v},u)};s.CIM_Chassis_IsCompatible=function(v,u){s.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:v},u)};s.CIM_Fan_SetSpeed=function(v,u){s.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:v},u)};s.CIM_KVMRedirectionSAP_RequestStateChange=function(v,w,u){s.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:v},u)};s.CIM_MediaAccessDevice_LockMedia=function(v,u){s.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:v},u)};s.CIM_MediaAccessDevice_SetPowerState=function(v,w,u){s.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_MediaAccessDevice_Reset=function(u){s.Exec("CIM_MediaAccessDevice","Reset",{},u)};s.CIM_MediaAccessDevice_EnableDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:v},u)};s.CIM_MediaAccessDevice_OnlineDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:v},u)};s.CIM_MediaAccessDevice_QuiesceDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:v},u)};s.CIM_MediaAccessDevice_SaveProperties=function(u){s.Exec("CIM_MediaAccessDevice","SaveProperties",{},u)};s.CIM_MediaAccessDevice_RestoreProperties=function(u){s.Exec("CIM_MediaAccessDevice","RestoreProperties",{},u)};s.CIM_MediaAccessDevice_RequestStateChange=function(v,w,u){s.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_PhysicalFrame_IsCompatible=function(v,u){s.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:v},u)};s.CIM_PhysicalPackage_IsCompatible=function(v,u){s.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:v},u)};s.CIM_PowerManagementService_RequestPowerStateChange=function(w,v,x,y,u){s.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:w,ManagedElement:v,Time:x,TimeoutPeriod:y},u,0,1)};s.CIM_PowerSupply_SetPowerState=function(v,w,u){s.Exec("CIM_PowerSupply","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_PowerSupply_Reset=function(u){s.Exec("CIM_PowerSupply","Reset",{},u)};s.CIM_PowerSupply_EnableDevice=function(v,u){s.Exec("CIM_PowerSupply","EnableDevice",{Enabled:v},u)};s.CIM_PowerSupply_OnlineDevice=function(v,u){s.Exec("CIM_PowerSupply","OnlineDevice",{Online:v},u)};s.CIM_PowerSupply_QuiesceDevice=function(v,u){s.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:v},u)};s.CIM_PowerSupply_SaveProperties=function(u){s.Exec("CIM_PowerSupply","SaveProperties",{},u)};s.CIM_PowerSupply_RestoreProperties=function(u){s.Exec("CIM_PowerSupply","RestoreProperties",{},u)};s.CIM_PowerSupply_RequestStateChange=function(v,w,u){s.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Processor_SetPowerState=function(v,w,u){s.Exec("CIM_Processor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Processor_Reset=function(u){s.Exec("CIM_Processor","Reset",{},u)};s.CIM_Processor_EnableDevice=function(v,u){s.Exec("CIM_Processor","EnableDevice",{Enabled:v},u)};s.CIM_Processor_OnlineDevice=function(v,u){s.Exec("CIM_Processor","OnlineDevice",{Online:v},u)};s.CIM_Processor_QuiesceDevice=function(v,u){s.Exec("CIM_Processor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Processor_SaveProperties=function(u){s.Exec("CIM_Processor","SaveProperties",{},u)};s.CIM_Processor_RestoreProperties=function(u){s.Exec("CIM_Processor","RestoreProperties",{},u)};s.CIM_Processor_RequestStateChange=function(v,w,u){s.Exec("CIM_Processor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RecordLog_ClearLog=function(u){s.Exec("CIM_RecordLog","ClearLog",{},u)};s.CIM_RecordLog_RequestStateChange=function(v,w,u){s.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RedirectionService_RequestStateChange=function(v,w,u){s.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Sensor_SetPowerState=function(v,w,u){s.Exec("CIM_Sensor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Sensor_Reset=function(u){s.Exec("CIM_Sensor","Reset",{},u)};s.CIM_Sensor_EnableDevice=function(v,u){s.Exec("CIM_Sensor","EnableDevice",{Enabled:v},u)};s.CIM_Sensor_OnlineDevice=function(v,u){s.Exec("CIM_Sensor","OnlineDevice",{Online:v},u)};s.CIM_Sensor_QuiesceDevice=function(v,u){s.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Sensor_SaveProperties=function(u){s.Exec("CIM_Sensor","SaveProperties",{},u)};s.CIM_Sensor_RestoreProperties=function(u){s.Exec("CIM_Sensor","RestoreProperties",{},u)};s.CIM_Sensor_RequestStateChange=function(v,w,u){s.Exec("CIM_Sensor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_StatisticalData_ResetSelectedStats=function(v,u){s.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:v},u)};s.CIM_Watchdog_KeepAlive=function(u){s.Exec("CIM_Watchdog","KeepAlive",{},u)};s.CIM_Watchdog_SetPowerState=function(v,w,u){s.Exec("CIM_Watchdog","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Watchdog_Reset=function(u){s.Exec("CIM_Watchdog","Reset",{},u)};s.CIM_Watchdog_EnableDevice=function(v,u){s.Exec("CIM_Watchdog","EnableDevice",{Enabled:v},u)};s.CIM_Watchdog_OnlineDevice=function(v,u){s.Exec("CIM_Watchdog","OnlineDevice",{Online:v},u)};s.CIM_Watchdog_QuiesceDevice=function(v,u){s.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:v},u)};s.CIM_Watchdog_SaveProperties=function(u){s.Exec("CIM_Watchdog","SaveProperties",{},u)};s.CIM_Watchdog_RestoreProperties=function(u){s.Exec("CIM_Watchdog","RestoreProperties",{},u)};s.CIM_Watchdog_RequestStateChange=function(v,w,u){s.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_WiFiPort_SetPowerState=function(v,w,u){s.Exec("CIM_WiFiPort","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_WiFiPort_Reset=function(u){s.Exec("CIM_WiFiPort","Reset",{},u)};s.CIM_WiFiPort_EnableDevice=function(v,u){s.Exec("CIM_WiFiPort","EnableDevice",{Enabled:v},u)};s.CIM_WiFiPort_OnlineDevice=function(v,u){s.Exec("CIM_WiFiPort","OnlineDevice",{Online:v},u)};s.CIM_WiFiPort_QuiesceDevice=function(v,u){s.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:v},u)};s.CIM_WiFiPort_SaveProperties=function(u){s.Exec("CIM_WiFiPort","SaveProperties",{},u)};s.CIM_WiFiPort_RestoreProperties=function(u){s.Exec("CIM_WiFiPort","RestoreProperties",{},u)};s.CIM_WiFiPort_RequestStateChange=function(v,w,u){s.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_HostBasedSetupService_Setup=function(y,z,x,v,A,w,u){s.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:y,NetworkAdminPassword:z,McNonce:x,Certificate:v,SigningAlgorithm:A,DigitalSignature:w},u)};s.IPS_HostBasedSetupService_AddNextCertInChain=function(x,v,w,u){s.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:x,IsLeafCertificate:v,IsRootCertificate:w},u)};s.IPS_HostBasedSetupService_AdminSetup=function(x,y,w,z,v,u){s.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:x,NetworkAdminPassword:y,McNonce:w,SigningAlgorithm:z,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(w,x,v,u){s.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:w,SigningAlgorithm:x,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_DisableClientControlMode=function(u,v){s.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:u},v)};s.IPS_KVMRedirectionSettingData_TerminateSession=function(u){s.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},u)};s.IPS_OptInService_StartOptIn=function(u){s.Exec("IPS_OptInService","StartOptIn",{},u)};s.IPS_OptInService_CancelOptIn=function(u){s.Exec("IPS_OptInService","CancelOptIn",{},u)};s.IPS_OptInService_SendOptInCode=function(v,u){s.Exec("IPS_OptInService","SendOptInCode",{OptInCode:v},u)};s.IPS_OptInService_StartService=function(u){s.Exec("IPS_OptInService","StartService",{},u)};s.IPS_OptInService_StopService=function(u){s.Exec("IPS_OptInService","StopService",{},u)};s.IPS_OptInService_RequestStateChange=function(v,w,u){s.Exec("IPS_OptInService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_RequestStateChange=function(v,w,u){s.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_ClearLog=function(u,v){s.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:u},v)};s.IPS_SecIOService_RequestStateChange=function(v,w,u){s.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AmtStatusToStr=function(u){if(s.AmtStatusCodes[u]){return s.AmtStatusCodes[u]}else{return"UNKNOWN_ERROR"}};s.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",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",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",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",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"};s.GetMessageLog=function(u,v){s.AMT_MessageLog_PositionToFirstRecord(k,[u,v,[]])};function k(w,u,v,x,y){if(x!=200||v.Body.ReturnValue!="0"){y[0](s,null,y[2]);return}s.AMT_MessageLog_GetRecords(v.Body.IterationIdentifier,390,l,y)}function l(D,A,C,E,G){if(E!=200||C.Body.ReturnValue!="0"){G[0](s,null,G[2]);return}var y,z,I,v,u=G[2],F=new Date(),H,B=C.Body.RecordArray;if(typeof B==="string"){C.Body.RecordArray=[C.Body.RecordArray]}for(y in B){v=null;try{v=window.atob(B[y])}catch(w){}if(v!=null){H=ReadIntX(v,0);if((H>0)&&(H<4294967295)){I={DeviceAddress:v.charCodeAt(4),EventSensorType:v.charCodeAt(5),EventType:v.charCodeAt(6),EventOffset:v.charCodeAt(7),EventSourceType:v.charCodeAt(8),EventSeverity:v.charCodeAt(9),SensorNumber:v.charCodeAt(10),Entity:v.charCodeAt(11),EntityInstance:v.charCodeAt(12),EventData:[],Time:new Date((H+(F.getTimezoneOffset()*60))*1000)};for(z=13;z<21;z++){I.EventData.push(v.charCodeAt(z))}I.EntityStr=o[I.Entity];I.Desc=j(I.EventSensorType,I.EventOffset,I.EventData,I.Entity);if(!I.EntityStr){I.EntityStr="Unknown"}u.push(I)}}}if(C.Body.NoMoreRecords!=true){s.AMT_MessageLog_GetRecords(C.Body.IterationIdentifier,390,l,[G[0],u,G[2]])}else{G[0](s,u,G[2])}}var e="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="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("|");var q="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("|");var o="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("|");s.RealmNames="||Redirection|PT Administration|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("|");s.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(x,w,v,u){if(x==15){if(v[0]==235){return"Invalid Data"}if(w==0){return p[v[1]]}return q[v[1]]}if(x==18&&v[0]==170){return"Agent watchdog "+char2hex(v[4])+char2hex(v[3])+char2hex(v[2])+char2hex(v[1])+"-"+char2hex(v[6])+char2hex(v[5])+"-... changed to "+s.WatchdogCurrentStates[v[7]]}if(x==6){return"Authentication failed "+(v[1]+(v[2]<<8))+" times. The system may be under attack."}if(x==30){return"No bootable media"}if(x==32){return"Operating system lockup or power interrupt"}if(x==35){return"System boot failure"}if(x==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+x}return s}var md5_k=[];for(var i=0;i<64;){md5_k[i]=0|(Math.abs(Math.sin(++i))*4294967296)}function hex_md5(p){var g,k,l,o,r=[],q=unescape(encodeURI(p)),e=q.length,m=[g=1732584193,k=-271733879,~g,~k],n=0;for(;n<=e;){r[n>>2]|=(q.charCodeAt(n)||128)<<8*(n++%4)}r[p=(e+8>>6)*16+14]=e*8;n=0;for(;n<p;n+=16){e=m;o=0;for(;o<64;){e=[l=e[3],((g=e[1]|0)+((l=((e[0]+[g&(k=e[2])|~g&l,l&g|~l&k,g^k^l,k^(g|~l)][e=o>>4])+(md5_k[o]+(r[[o,5*o+1,3*o+5,7*o][e]%16+n]|0))))<<(e=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*e+o++%4])|l>>>32-e)),g,k]}for(o=4;o;){m[--o]=m[o]+e[o]}}p="";for(;o<32;){p+=((m[o>>3]>>((1^o++&7)*4))&15).toString(16)}return p}function rstr_md5(a){return hex2rstr(hex_md5(a))}function execArgumentsToXml(c){if(c===undefined||c===null){return null}var d="";for(var b in c){var a=c[b];if(!a){continue}if(a.__parameterType==="reference"){d+=referenceToXml(b,a)}else{d+=instanceToXml(b,a)}}return d}function instanceToXml(d,c){if(c===undefined||c===null){return null}var b=!!c.__namespace;var j=b?"<q:":"<";var a=b?"</q:":"</";var e=b?(' xmlns:q="'+c.__namespace+'"'):"";var h="<r:"+d+e+">";for(var g in c){if(!c.hasOwnProperty(g)||g.indexOf("__")===0){continue}if(typeof c[g]==="function"||Array.isArray(c[g])){continue}if(typeof c[g]==="object"){console.error("only convert one level down...")}else{h+=j+g+">"+c[g].toString()+a+g+">"}}h+="</r:"+d+">";return h}function referenceToXml(b,a){if(a===undefined||a===null){return null}var c="<r:"+b+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+a.__resourceUri+"</w:ResourceURI><w:SelectorSet>";for(var d in a){if(!a.hasOwnProperty(d)||d.indexOf("__")===0){continue}if(typeof a[d]==="function"||typeof a[d]==="object"||Array.isArray(a[d])){continue}c+='<w:Selector Name="'+d+'">'+a[d].toString()+"</w:Selector>"}c+="</w:SelectorSet></a:ReferenceParameters></r:"+b+">";return c}function GetSidString(c){var b="S-"+c.charCodeAt(0)+"-"+c.charCodeAt(7);for(var a=2;a<(c.length/4);a++){b+="-"+ReadIntX(c,a*4)}return b}function GetSidByteArray(d){if(!d||d==null){return null}var c=d.split("-");if(c.length<4||(c[0]!="s"&&c[0]!="S")){return null}for(var a=1;a<c.length;a++){var e=parseInt(c[a]);if(e!=c[a]){return null}c[a]=e}var b=String.fromCharCode(c[1])+String.fromCharCode(c.length-3)+ShortToStr(Math.floor(c[2]/Math.pow(2,32)))+IntToStr((c[2])&65535);for(var a=3;a<c.length;a++){b+=IntToStrX(c[a])}return b}var WsmanStackCreateService=function(h,l,n,k,m,g){var j={};j.NextMessageId=1;j.Address="/wsman";j.comm=CreateWsmanComm(h,l,n,k,m,g);j.PerformAjax=function(q,o,s,r,p){if(p==undefined){p=""}j.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" '+p+"><Header><a:Action>"+q,function(t,u,v){if(u!=200){o(j,null,{Header:{HttpError:u}},u,v);return}var w=j.ParseWsman(t);if(!w||w==null){o(j,null,{Header:{HttpError:u}},601,v)}else{o(j,w.Header.ResourceURI,w,200,v)}},s,r)};j.CancelAllQueries=function(o){j.comm.CancelAllQueries(o)};j.GetNameFromUrl=function(o){var p=o.lastIndexOf("/");return(p==-1)?o:o.substring(p+1)};j.ExecSubscribe=function(w,q,z,o,y,v,x,t,A,u){var r="",s="";if(A!=undefined&&u!=undefined){r="<t:IssuedTokens><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>"+A+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+u+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>";s='<Auth Profile="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/secprofile/http/digest"/>'}if(t!=undefined&&t!=null){t="<a:ReferenceParameters>"+t+"</a:ReferenceParameters>"}else{t=""}var p="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+w+"</w:ResourceURI><a:MessageID>"+(j.NextMessageId++)+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(x)+r+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.dmtf.org/wbem/wsman/1/wsman/'+q+'"><e:NotifyTo><a:Address>'+z+"</a:Address></e:NotifyTo>"+s+"</e:Delivery><e:Expires>PT0.000000S</e:Expires></e:Subscribe>";j.PerformAjax(p+"</Body></Envelope>",o,y,v,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" 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" xmlns:m="http://x.com"')};j.ExecUnSubscribe=function(r,o,t,q,s){var p="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+r+"</w:ResourceURI><a:MessageID>"+(j.NextMessageId++)+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(s)+"</Header><Body><e:Unsubscribe/>";j.PerformAjax(p+"</Body></Envelope>",o,t,q,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};j.ExecPut=function(s,r,o,u,q,t){var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(t)+"</Header><Body>"+c(s,r);j.PerformAjax(p+"</Body></Envelope>",o,u,q)};j.ExecCreate=function(u,t,o,w,s,v){var r=j.GetNameFromUrl(u);var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+u+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(v)+"</Header><Body><g:"+r+' xmlns:g="'+u+'">';for(var q in t){p+="<g:"+q+">"+t[q]+"</g:"+q+">"}j.PerformAjax(p+"</g:"+r+"></Body></Envelope>",o,w,s)};j.ExecCreateXml=function(s,o,p,u,r){var q=j.GetNameFromUrl(s),t="";j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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></Header><Body><r:"+q+' xmlns:r="'+s+'">'+o+"</r:"+q+"></Body></Envelope>",p,u,r)};j.ExecDelete=function(s,r,o,t,q){var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(r)+"</Header><Body /></Envelope>";j.PerformAjax(p,o,t,q)};j.ExecGet=function(q,o,r,p){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+q+"</w:ResourceURI><a:MessageID>"+(j.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>",o,r,p)};j.ExecMethod=function(u,s,o,q,w,t,v){var p="";for(var r in o){if(o[r]!=null){if(Array.isArray(o[r])){for(var y in o[r]){p+="<r:"+r+">"+o[r][y]+"</r:"+r+">"}}else{p+="<r:"+r+">"+o[r]+"</r:"+r+">"}}}j.ExecMethodXml(u,s,p,q,w,t,v)};j.ExecMethodXml=function(s,q,o,p,u,r,t){j.PerformAjax(s+"/"+q+"</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(t)+"</Header><Body><r:"+q+'_INPUT xmlns:r="'+s+'">'+o+"</r:"+q+"_INPUT></Body></Envelope>",p,u,r)};j.ExecEnum=function(q,o,r,p){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+q+"</w:ResourceURI><a:MessageID>"+(j.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>',o,r,p)};j.ExecPull=function(r,p,o,s,q){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+r+"</w:ResourceURI><a:MessageID>"+(j.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>'+p+"</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>",o,s,q)};j.ParseWsman=function(x){try{if(!x.childNodes){x=e(x)}var v={Header:{}},s=x.getElementsByTagName("Header")[0],w;if(!s){s=x.getElementsByTagName("a:Header")[0]}if(!s){return null}for(var u=0;u<s.childNodes.length;u++){var p=s.childNodes[u];v.Header[p.localName]=p.textContent}var o=x.getElementsByTagName("Body")[0];if(!o){o=x.getElementsByTagName("a:Body")[0]}if(!o){return null}if(o.childNodes.length>0){w=o.childNodes[0].localName;if(w.indexOf("_OUTPUT")==w.length-7){w=w.substring(0,w.length-7)}v.Header.Method=w;v.Body=b(o.childNodes[0])}return v}catch(q){console.log("Unable to parse XML: "+x);return null}};function b(u){var q,v={};for(var s=0;s<u.childNodes.length;s++){var o=u.childNodes[s];if(o.childElementCount==0){q=o.textContent}else{q=b(o)}if(q=="true"){q=true}if(q=="false"){q=false}var p=q;if(o.attributes.length>0){p={Value:q};for(var t=0;t<o.attributes.length;t++){p["@"+o.attributes[t].name]=o.attributes[t].value}}if(v[o.localName] instanceof Array){v[o.localName].push(p)}else{if(v[o.localName]==undefined){v[o.localName]=p}else{v[o.localName]=[v[o.localName],p]}}}return v}function c(t,r){if(!t||r===undefined||r===null){return""}var p=j.GetNameFromUrl(t);var s="<r:"+p+' xmlns:r="'+t+'">';for(var q in r){if(!r.hasOwnProperty(q)||q.indexOf("__")===0||q.indexOf("@")===0){continue}if(r[q]===undefined||r[q]===null||typeof r[q]==="function"){continue}if(typeof r[q]==="object"&&r[q]["ReferenceParameters"]){s+="<r:"+q+"><a:Address>"+r[q].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+r[q]["ReferenceParameters"]["ResourceURI"]+"</w:ResourceURI><w:SelectorSet>";var u=r[q]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var o=0;o<u.length;o++){s+="<w:Selector"+a(u[o])+">"+u[o]["Value"]+"</w:Selector>"}}else{s+="<w:Selector"+a(u)+">"+u.Value+"</w:Selector>"}s+="</w:SelectorSet></a:ReferenceParameters></r:"+q+">"}else{if(Array.isArray(r[q])){for(var o=0;o<r[q].length;o++){s+="<r:"+q+">"+r[q][o].toString()+"</r:"+q+">"}}else{s+="<r:"+q+">"+r[q].toString()+"</r:"+q+">"}}}s+="</r:"+p+">";return s}function a(o){if(!o){return""}var q=" ";for(var p in o){if(!o.hasOwnProperty(p)||p.indexOf("@")!==0){continue}q+=p.substring(1)+'="'+o[p]+'" '}return q}function d(s){if(!s){return""}if(typeof s=="string"){return s}if(s.InstanceID){return'<w:SelectorSet><w:Selector Name="InstanceID">'+s.InstanceID+"</w:Selector></w:SelectorSet>"}var q="<w:SelectorSet>";for(var p in s){if(!s.hasOwnProperty(p)){continue}q+='<w:Selector Name="'+p+'">';if(s[p]["ReferenceParameters"]){q+="<a:EndpointReference>";q+="<a:Address>"+s[p]["Address"]+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+s[p]["ReferenceParameters"]["ResourceURI"]+"</w:ResourceURI><w:SelectorSet>";var r=s[p]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(r)){for(var o=0;o<r.length;o++){q+="<w:Selector"+a(r[o])+">"+r[o]["Value"]+"</w:Selector>"}}else{q+="<w:Selector"+a(r)+">"+r.Value+"</w:Selector>"}q+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else{q+=s[p]}q+="</w:Selector>"}q+="</w:SelectorSet>";return q}function e(o){if(window.DOMParser){return new DOMParser().parseFromString(o,"text/xml")}else{var p=new ActiveXObject("Microsoft.XMLDOM");p.async=false;p.loadXML(o);return p}}return j};var CreateAmtRemoteDesktop=function(m,p){var o={};o.canvasid=m;o.CanvasId=Q(m);o.scrolldiv=p;o.canvas=Q(m).getContext("2d");o.protocol=2;o.state=0;o.acc="";o.ScreenWidth=960;o.ScreenHeight=700;o.width=0;o.height=0;o.rwidth=0;o.rheight=0;o.bpp=2;o.useZRLE=true;o.showmouse=true;o.buttonmask=0;o.spare=null;o.sparew=0;o.spareh=0;o.sparew2=0;o.spareh2=0;o.sparecache={};o.ZRLEfirst=1;o.onScreenSizeChange=null;o.frameRateDelay=0;o.kvmDataSupported=false;o.onKvmData=null;o.onKvmDataPending=[];o.onKvmDataAck=-1;o.holding=false;o.lastKeepAlive=Date.now();o.Debug=function(q){console.log(q)};o.xxStateChange=function(q){if(q==0){o.canvas.fillStyle="#000000";o.canvas.fillRect(0,0,o.width,o.height);o.canvas.canvas.width=o.rwidth=o.width=640;o.canvas.canvas.height=o.rheight=o.height=400;QS(o.canvasid).cursor="default"}else{QS(o.canvasid).cursor=o.showmouse?"default":"none"}};o.ProcessData=function(t){if(!t){return}o.acc+=t;while(o.acc.length>0){var q=0;if(o.state==0&&o.acc.length>=12){q=12;o.state=1;o.send("RFB 003.008\n")}else{if(o.state==1&&o.acc.length>=1){q=o.acc.charCodeAt(0)+1;o.send(String.fromCharCode(1));o.state=2}else{if(o.state==2&&o.acc.length>=4){q=4;if(ReadInt(o.acc,0)!=0){return o.Stop()}o.send(String.fromCharCode(1));o.state=3}else{if(o.state==3&&o.acc.length>=24){var D=ReadInt(o.acc,20);if(o.acc.length<24+D){return}q=24+D;o.canvas.canvas.width=o.rwidth=o.width=o.ScreenWidth=ReadShort(o.acc,0);o.canvas.canvas.height=o.rheight=o.height=o.ScreenHeight=ReadShort(o.acc,2);var G="";if(o.useZRLE){G+=IntToStr(16)}G+=IntToStr(0);G+=IntToStr(1092);o.send(String.fromCharCode(2,0)+ShortToStr((G.length/4)+1)+G+IntToStr(-223));if(o.bpp==1){o.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))}o.state=4;o.parent.xxStateChange(3);h();if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(o.state==4){switch(o.acc.charCodeAt(0)){case 0:if(o.acc.length<4){return}o.state=100+ReadShort(o.acc,2);q=4;break;case 2:q=1;break;case 3:if(o.acc.length<8){return}var C=ReadInt(o.acc,4)+8;if(o.acc.length<C){return}q=n(o.acc);break}}else{if(o.state>100&&o.acc.length>=12){var I=ReadShort(o.acc,0),K=ReadShort(o.acc,2),H=ReadShort(o.acc,4),A=ReadShort(o.acc,6),F=H*A,z=ReadInt(o.acc,8);if(z<17){if(H<1||H>64||A<1||A>64){console.log("Invalid tile size ("+H+","+A+"), disconnecting.");return o.Stop()}if(o.sparew!=H||o.spareh!=A){o.sparew=o.sparew2=H;o.spareh=o.spareh2=A;var J=o.sparew2+"x"+o.spareh2;o.spare=o.sparecache[J];if(!o.spare){o.sparecache[J]=o.spare=o.canvas.createImageData(o.sparew2,o.spareh2)}}}if(z==4294967073){o.canvas.canvas.width=o.rwidth=o.width=H;o.canvas.canvas.height=o.rheight=o.height=A;o.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height));q=12;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(z==0){var E=12,r=12+(F*o.bpp);if(o.acc.length<r){return}q=r;for(var B=0;B<F;B++){j(o.acc.charCodeAt(E++)+((o.bpp==2)?(o.acc.charCodeAt(E++)<<8):0),B)}g(o.spare,I,K)}else{if(z==16){if(o.acc.length<16){return}var u=ReadInt(o.acc,12);if(o.acc.length<(16+u)){return}var E=16,v=5,w=0;if(u>5&&o.acc.charCodeAt(E)==0&&ReadShortX(o.acc,E+1)==(u-v)){a(o.acc,E+5,I,K,H,A,F,u)}q=16+u}else{o.Debug("Unknown Encoding: "+z);return o.Stop()}}}if(--o.state==100){o.state=4;if(o.frameRateDelay==0){h()}else{setTimeout(h,o.frameRateDelay)}}}}}}}}if(q==0){return}o.acc=o.acc.substring(q)}};function a(t,C,K,L,J,w,G,u){var H=t.charCodeAt(C++),A,I,F,B={},D=0,E=0,z;if(H==0){for(z=0;z<G;z++){j(t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0),z)}g(o.spare,K,L)}else{if(H==1){I=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0);o.canvas.fillStyle="rgb("+((o.bpp==1)?((I&224)+","+((I&28)<<3)+","+b((I&3)<<6)):(((I>>8)&248)+","+((I>>3)&252)+","+((I&31)<<3)))+")";o.canvas.fillRect(K,L,J,w)}else{if(H>1&&H<17){var r=4,q=15;for(z=0;z<H;z++){B[z]=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0)}if(H==2){r=1;q=1}else{if(H<=4){r=2;q=3}}while(D<G&&C<t.length){I=t.charCodeAt(C++);for(z=(8-r);z>=0;z-=r){j(B[(I>>z)&q],D++)}}g(o.spare,K,L)}else{if(H==128){while(D<G&&C<t.length){I=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0);E=1;do{E+=(F=t.charCodeAt(C++))}while(F==255);while(--E>=0){j(I,D++)}}g(o.spare,K,L)}else{if(H>129){for(z=0;z<(H-128);z++){B[z]=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0)}while(D<G&&C<t.length){E=1;A=t.charCodeAt(C++);I=B[A%128];if(A>127){do{E+=(F=t.charCodeAt(C++))}while(F==255)}while(--E>=0){j(I,D++)}}g(o.spare,K,L)}}}}}}o.hold=function(q){if(o.holding==q){return}o.holding=q;o.canvas.fillStyle="#000000";o.canvas.fillRect(0,0,o.width,o.height);if(o.holding==false){if((o.canvas.canvas.width!=o.width)||(o.canvas.canvas.height!=o.height)){o.canvas.canvas.width=o.width;o.canvas.canvas.height=o.height;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}o.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height))}else{o.UnGrabMouseInput();o.UnGrabKeyInput()}};function g(q,r,s){if(o.holding==true){return}o.canvas.putImageData(q,r,s)}function j(s,q){var r=q*4;if(o.bpp==1){o.spare.data[r++]=s&224;o.spare.data[r++]=(s&28)<<3;o.spare.data[r++]=b((s&3)<<6)}else{o.spare.data[r++]=(s>>8)&248;o.spare.data[r++]=(s>>3)&252;o.spare.data[r++]=(s&31)<<3}o.spare.data[r]=255}function b(q){return(q>127)?(q+32):q}function h(){if(o.holding==true){return}o.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(o.rwidth)+ShortToStr(o.rheight))}o.Start=function(){o.state=0;o.acc="";o.ZRLEfirst=1;o.onKvmDataPending=[];o.onKvmDataAck=-1;o.kvmDataSupported=false;for(var q in o.sparecache){delete o.sparecache[q]}};o.Stop=function(){o.UnGrabMouseInput();o.UnGrabKeyInput();o.parent.Stop()};o.send=function(q){o.parent.send(q)};var l={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,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};function k(q){if(q.code.startsWith("Key")&&q.code.length==4){return q.code.charCodeAt(3)+((q.shiftKey==false)?32:0)}if(q.code.startsWith("Digit")&&q.code.length==6){return q.code.charCodeAt(5)}if(q.code.startsWith("Numpad")&&q.code.length==7){return q.code.charCodeAt(6)}return l[q.code]}function c(q,r){if(!r){r=window.event}if(r.code){var s=k(r);if(s!=null){o.sendkey(s,q)}}else{var s=r.keyCode,t=s;if(r.shiftKey==false&&s>=65&&s<=90){t=s+32}if(s>=112&&s<=124){t=s+65358}if(s==8){t=65288}if(s==9){t=65289}if(s==13){t=65293}if(s==16){t=65505}if(s==17){t=65507}if(s==18){t=65513}if(s==27){t=65307}if(s==33){t=65365}if(s==34){t=65366}if(s==35){t=65367}if(s==36){t=65360}if(s==37){t=65361}if(s==38){t=65362}if(s==39){t=65363}if(s==40){t=65364}if(s==45){t=65379}if(s==46){t=65535}if(s>=96&&s<=105){t=s-48}if(s==106){t=42}if(s==107){t=43}if(s==109){t=45}if(s==110){t=46}if(s==111){t=47}if(s==186){t=59}if(s==187){t=61}if(s==188){t=44}if(s==189){t=45}if(s==190){t=46}if(s==191){t=47}if(s==192){t=96}if(s==219){t=91}if(s==220){t=92}if(s==221){t=93}if(s==222){t=39}o.sendkey(t,q)}return o.haltEvent(r)}o.sendkey=function(s,q){if(typeof s=="object"){for(var r in s){o.sendkey(s[r][0],s[r][1])}}else{o.send(String.fromCharCode(4,q,0,0)+IntToStr(s))}};function n(q){if(q.length<8){return 0}var s=ReadInt(o.acc,4)+8;if(q.length<s){return 0}if(o.onKvmData!=null){var r=q.substring(8,s);if((r.length>=16)&&(r.substring(0,15)=="\0KvmDataChannel")){if(o.kvmDataSupported==false){o.kvmDataSupported=true;console.log("KVM Data Channel Supported.")}if(((o.onKvmDataAck==-1)&&(r.length==16))||(r.charCodeAt(15)!=0)){o.onKvmDataAck=true}if(r.length>=16){o.onKvmData(r.substring(16))}if((o.onKvmDataAck==true)&&(o.onKvmDataPending.length>0)){o.sendKvmData(o.onKvmDataPending.shift())}}}return s}o.sendKvmData=function(q){if(o.onKvmDataAck!==true){o.onKvmDataPending.push(q)}else{q="\0KvmDataChannel\0"+q;o.send(String.fromCharCode(6,0,0,0)+IntToStr(q.length)+q);o.onKvmDataAck=false}};o.sendKeepAlive=function(){if(o.lastKeepAlive<Date.now()-5000){o.lastKeepAlive=Date.now();o.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0")}};o.SendCtrlAltDelMsg=function(){o.sendcad()};o.sendcad=function(){o.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])};var e=false;var d=false;o.GrabMouseInput=function(){if(e==true){return}var q=o.canvas.canvas;q.onmouseup=o.mouseup;q.onmousedown=o.mousedown;q.onmousemove=o.mousemove;e=true};o.UnGrabMouseInput=function(){if(e==false){return}var q=o.canvas.canvas;q.onmousemove=null;q.onmouseup=null;q.onmousedown=null;e=false};o.GrabKeyInput=function(){if(d==true){return}document.onkeyup=o.handleKeyUp;document.onkeydown=o.handleKeyDown;document.onkeypress=o.handleKeys;d=true};o.UnGrabKeyInput=function(){if(d==false){return}document.onkeyup=null;document.onkeydown=null;document.onkeypress=null;d=false};o.handleKeys=function(q){return o.haltEvent(q)};o.handleKeyUp=function(q){return c(0,q)};o.handleKeyDown=function(q){return c(1,q)};o.haltEvent=function(q){if(q.preventDefault){q.preventDefault()}if(q.stopPropagation){q.stopPropagation()}return false};o.mousedblclick=function(q){};o.mousedown=function(q){o.buttonmask|=(1<<q.button);return o.mousemove(q)};o.mouseup=function(q){o.buttonmask&=(65535-(1<<q.button));return o.mousemove(q)};o.mousemove=function(q){if(o.state!=4){return true}var r=o.getPositionOfControl(Q(o.canvasid));o.mx=(q.pageX-r[0])*(o.canvas.canvas.height/Q(o.canvasid).offsetHeight);o.my=((q.pageY-r[1]+(p?p.scrollTop:0))*(o.canvas.canvas.width/Q(o.canvasid).offsetWidth));o.send(String.fromCharCode(5,o.buttonmask)+ShortToStr(o.mx)+ShortToStr(o.my));return o.haltEvent(q)};o.getPositionOfControl=function(q){var r=Array(2);r[0]=r[1]=0;while(q){r[0]+=q.offsetLeft;r[1]+=q.offsetTop;q=q.offsetParent}return r};return o};var CreateAmtRemoteTerminal=function(B){var C={};C.DivId=B;C.DivElement=document.getElementById(B);C.protocol=1;C.fxEmulation=0;C.lineFeed="\r\n";C.debugmode=0;C.width=80;C.height=25;var r=21;var s=13;var m=["000000","BB0000","00BB00","BBBB00","0000BB","BB00BB","00BBBB","BBBBBB","555555","FF5555","55FF55","FFFF55","5555FF","FF55FF","55FFFF","FFFFFF"];var p=0;var o=7;var n=0;var t=true;var w=0;var x=0;var v=0;var d=[];var e=0;var l=[];var y=[];var A=1;var z=2;C.Start=function(){};C.Init=function(E,D){C.width=E?E:80;C.height=D?D:25;for(var G=0;G<C.height;G++){y[G]=[];l[G]=[];for(var F=0;F<C.width;F++){y[G][F]=" ";l[G][F]=(7<<6)}}C.TermInit();C.TermDraw()};C.xxStateChange=function(D){};C.ProcessData=function(D){if(C.debugmode==2){console.log("TRecv("+D.length+"): "+rstr2hex(D))}if(C.capture!=null){C.capture+=D}k(D);C.TermDraw()};function k(E){for(var D=0;D<E.length;D++){j(String.fromCharCode(E.charCodeAt(D)),E.charCodeAt(D))}}function j(D,E){switch(v){case 0:switch(E){case 27:v=1;break;default:h(D);break}break;case 1:switch(D){case"[":e=0;d=[];v=2;break;case"(":v=4;break;case")":v=5;break;default:v=0;break}break;case 2:if(D>="0"&&D<="9"){if(!d[e]){d[e]=(D-"0")}else{d[e]=((d[e]*10)+(D-"0"))}break}else{if(D==";"){e++;break}else{if(!d[0]){d[0]=0}g(D,d,e+1);v=0}}break;case 4:v=0;break;case 5:v=0;break}}function g(G,D,E){var H;switch(G){case"c":C.TermResetScreen();break;case"A":if(E==1){x-=D[0];if(x<0){x=0}}break;case"B":if(E==1){x+=D[0];if(x>C.height){x=C.height}}break;case"C":if(E==1){w+=D[0];if(w>C.width){w=C.width}}break;case"D":if(E==1){w-=D[0];if(w<0){w=0}}break;case"d":if(E==1){x=D[0]-1;if(x>C.height){x=C.height}if(x<0){x=0}}break;case"G":if(E==1){w=D[0]-1;if(w<0){w=0}if(w>79){w=79}}break;case"J":if(E==1&&D[0]==2){C.TermClear((n<<12)+(o<<6));w=0;x=0}else{if(E==0||E==1&&D[0]==0){b();for(H=x+1;H<C.height;H++){c(H)}}else{if(E==1&&D[0]==1){b();for(H=0;H<x-1;H++){c(H)}}}}break;case"H":if(E==2){if(D[0]<1){D[0]=1}if(D[1]<1){D[1]=1}if(D[0]>C.height){D[0]=C.height}if(D[1]>C.width){D[1]=C.width}x=D[0]-1;w=D[1]-1}else{x=0;w=0}break;case"m":for(H=0;H<E;H++){if(!D[H]||D[H]==0){n=0;o=7;p=0}else{if(D[H]==1){if(o<8){o+=8}}else{if(D[H]==2||D[H]==22){if(o>=8){o-=8}}else{if(D[H]==7){p=2}else{if(D[H]==27){p=0}else{if(D[H]>=30&&D[H]<=37){var F=(o>=8);o=(D[H]-30);if(F&&o<=8){o+=8}}else{if(D[H]>=40&&D[H]<=47){n=(D[H]-40)}else{if(D[H]>=90&&D[H]<=99){o=(D[H]-82)}else{if(D[H]>=100&&D[H]<=109){n=(D[H]-92)}}}}}}}}}}break;case"K":if(E==0||(E==1&&(!D[0]||D[0]==0))){b()}else{if(E==1){if(D[0]==1){a()}else{if(D[0]==2){c(x)}}}}break;case"h":t=true;break;case"l":t=false;break;default:break}}C.ProcessVt100String=function(E){for(var D=0;D<E.length;D++){h(String.fromCharCode(E.charCodeAt(D)))}};function h(D){if(D=="\0"||D.charCodeAt()==7){return}var E=D.charCodeAt();switch(E){case 16:D=" ";break;case 24:D="?";break;case 25:D="?";break}if(w>C.width){w=C.width}if(x>(C.height-1)){x=(C.height-1)}switch(D){case"\b":if(w>0){w=w-1;q(" ")}break;case"\t":var F=8-(w%8);for(var G=0;G<F;G++){h(" ")}break;case"\n":x++;if(x>(C.height-1)){u(1);x=(C.height-1)}if(C.lineFeed="\n"){w=0}break;case"\r":w=0;break;default:if(w>=C.width){w=0;if(t){x++}if(x>=(C.height-1)){u(1);x=(C.height-1)}}q(D);w++;break}}function q(D){y[x][w]=D;l[x][w]=(o<<6)+(n<<12)+p}C.TermClear=function(D){for(var F=0;F<C.height;F++){for(var E=0;E<C.width;E++){y[F][E]=" ";l[F][E]=D}}};C.TermResetScreen=function(){p=0;o=7;n=0;t=true;w=0;x=0;C.TermClear(7<<6)};function b(){var D=(n<<12);for(var E=w;E<C.width;E++){y[x][E]=" ";l[x][E]=D}}function a(){var D=(n<<12);for(var E=0;E<w;E++){y[x][E]=" ";l[x][E]=D}}function c(D){var E=(n<<12);for(var F=0;F<C.width;F++){y[D][F]=" ";l[D][F]=E}}C.TermSendKeys=function(D){if(C.debugmode==2){if(C.debugmode==2){console.log("TSend("+D.length+"): "+rstr2hex(D))}}C.parent.send(D)};C.TermSendKey=function(D){if(C.debugmode==2){if(C.debugmode==2){console.log("TSend(1): "+rstr2hex(String.fromCharCode(D)))}}C.parent.send(String.fromCharCode(D))};function u(D){var E,F;for(F=0;F<C.height-D;F++){y[F]=y[F+D];l[F]=l[F+D]}for(F=C.height-D;F<C.height;F++){y[F]=[];l[F]=[];for(E=0;E<C.width;E++){y[F][E]=" ";l[F][E]=(7<<6)}}}C.TermHandleKeys=function(D){if(!D.ctrlKey){if(D.which==127){C.TermSendKey(8)}else{if(D.which==13){C.TermSendKeys(C.lineFeed)}else{if(D.which!=0){C.TermSendKey(D.which)}}}return false}if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}};C.TermHandleKeyUp=function(D){if((D.which!=8)&&(D.which!=32)&&(D.which!=9)){return true}if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return false};C.TermHandleKeyDown=function(D){if((D.which>=65)&&(D.which<=90)&&(D.ctrlKey==true)){C.TermSendKey(D.which-64);if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return}if(D.which==27){C.TermSendKeys(String.fromCharCode(27));return true}if(D.which==37){C.TermSendKeys(String.fromCharCode(27,91,68));return true}if(D.which==38){C.TermSendKeys(String.fromCharCode(27,91,65));return true}if(D.which==39){C.TermSendKeys(String.fromCharCode(27,91,67));return true}if(D.which==40){C.TermSendKeys(String.fromCharCode(27,91,66));return true}if(D.which==9){C.TermSendKeys("\t");if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return true}if(D.which!=8&&D.which!=32&&D.which!=9){return true}C.TermSendKey(D.which);if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return false};C.TermDraw=function(){var E,D="",F="",G,H=1,J,K;for(var L=0;L<C.height;++L){for(var I=0;I<C.width;++I){G=l[L][I];if(w==I&&x==L){G|=z}if(G!=H){D+=F;F="";J=6;K=12;if(G&z){J=12;K=6}D+='<span style="color:#'+m[(G>>J)&63]+";background-color:#"+m[(G>>K)&63];if(G&A){D+=";text-decoration:underline"}D+=';">';F="</span>"+F;H=G}E=y[L][I];switch(E){case"&":D+="&";break;case"<":D+="<";break;case">":D+=">";break;case" ":D+=" ";break;default:D+=E;break}}if(L!=(C.height-1)){D+="<br>"}}C.DivElement.innerHTML="<font size='4'><b>"+D+F+"</b></font>"};C.TermInit=function(){C.TermResetScreen()};C.Init();return C};var ZLIB=(ZLIB||{});if(typeof ZLIB.common_initialized==="undefined"){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.next_in=0;this.avail_in=0;this.total_in=0;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg=null;this.state=null;this.data_type=0;this.adler=0;this.input_data="";this.output_data="";this.error=0;this.checksum_function=null};ZLIB.gz_header=function(){this.text=0;this.time=0;this.xflags=0;this.os=255;this.extra=null;this.extra_len=0;this.extra_max=0;this.name=null;this.name_max=0;this.comment=null;this.comm_max=0;this.hcrc=0;this.done=0};ZLIB.common_initialized=true}if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js")}(function(){var o=15;var G=0;var D=1;var am=2;var af=3;var A=4;var B=5;var ac=6;var j=7;var F=8;var q=9;var p=10;var an=11;var ao=12;var aj=13;var l=14;var k=15;var al=16;var W=17;var g=18;var S=19;var R=20;var T=21;var r=22;var s=23;var aa=24;var Y=25;var d=26;var V=27;var v=28;var a=29;var ab=30;var ak=31;var z=852;var y=592;var x=(z+y);var h=0;var X=1;var u=2;var N=[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];var O=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69];var L=[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];var M=[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 ";function K(aR,aV){var aM=15;var aU=aR.next;var at=(aV==u?aR.distbits:aR.lenbits);var aX=aR.work;var aH=aR.lens;var aI=(aV==u?aR.nlen:0);var aS=aR.codes;var au;if(aV==X){au=aR.nlen}else{if(aV==u){au=aR.ndist}else{au=19}}var aG;var aT;var aN,aL;var aQ;var aw;var ax;var aF;var aW;var aD;var aE;var aB;var aJ;var aK;var aC;var aO;var aq;var ar;var az;var aA;var ay;var av=new Array(aM+1);var aP=new Array(aM+1);for(aG=0;aG<=aM;aG++){av[aG]=0}for(aT=0;aT<au;aT++){av[aH[aI+aT]]++}aQ=at;for(aL=aM;aL>=1;aL--){if(av[aL]!=0){break}}if(aQ>aL){aQ=aL}if(aL==0){aC={op:64,bits:1,val:0};aS[aU++]=aC;aS[aU++]=aC;if(aV==u){aR.distbits=1}else{aR.lenbits=1}aR.next=aU;return 0}for(aN=1;aN<aL;aN++){if(av[aN]!=0){break}}if(aQ<aN){aQ=aN}aF=1;for(aG=1;aG<=aM;aG++){aF<<=1;aF-=av[aG];if(aF<0){return -1}}if(aF>0&&(aV==h||aL!=1)){aR.next=aU;return -1}aP[1]=0;for(aG=1;aG<aM;aG++){aP[aG+1]=aP[aG]+av[aG]}for(aT=0;aT<au;aT++){if(aH[aI+aT]!=0){aX[aP[aH[aI+aT]]++]=aT}}switch(aV){case h:aq=az=aX;ar=0;aA=0;ay=19;break;case X:aq=N;ar=-257;az=O;aA=-257;ay=256;break;default:aq=L;az=M;ar=0;aA=0;ay=-1}aD=0;aT=0;aG=aN;aO=aU;aw=aQ;ax=0;aJ=-1;aW=1<<aQ;aK=aW-1;if((aV==X&&aW>=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}for(;;){aC={op:0,bits:aG-ax,val:0};if(aX[aT]<ay){aC.val=aX[aT]}else{if(aX[aT]>ay){aC.op=az[aA+aX[aT]];aC.val=aq[ar+aX[aT]]}else{aC.op=32+64}}aE=1<<(aG-ax);aB=1<<aw;aN=aB;do{aB-=aE;aS[aO+(aD>>>ax)+aB]=aC}while(aB!=0);aE=1<<(aG-1);while(aD&aE){aE>>>=1}if(aE!=0){aD&=aE-1;aD+=aE}else{aD=0}aT++;if(--(av[aG])==0){if(aG==aL){break}aG=aH[aI+aX[aT]]}if(aG>aQ&&(aD&aK)!=aJ){if(ax==0){ax=aQ}aO+=aN;aw=aG-ax;aF=(1<<aw);while(aw+ax<aL){aF-=av[aw+ax];if(aF<=0){break}aw++;aF<<=1}aW+=1<<aw;if((aV==X&&aW>=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}aJ=aD&aK;aS[aU+aJ]={op:aw,bits:aQ,val:aO-aU}}}if(aD!=0){aS[aO+aD]={op:64,bits:aG-ax,val:0}}aR.next=aU+aW;if(aV==u){aR.distbits=aQ}else{aR.lenbits=aQ}return 0}function H(aN,aL){var aM;var aC;var aI;var aD;var aK;var aq;var ax;var aR;var aO;var aQ;var aP;var aB;var ar;var at;var aE;var au;var aH;var aw;var aA;var aJ;var aF;var av;var az=-1;var ay=-1;aM=aN.state;aC=aN.input_data;aI=aN.next_in;aD=aI+aN.avail_in-5;aK=aN.next_out;aq=aK-(aL-aN.avail_out);ax=aK+(aN.avail_out-257);aR=aM.wsize;aO=aM.whave;aQ=aM.wnext;aP=aM.window;aB=aM.hold;ar=aM.bits;at=aM.codes;aE=aM.lencode;au=aM.distcode;aH=(1<<aM.lenbits)-1;aw=(1<<aM.distbits)-1;loop:do{if(ar<15){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aA=at[aE+(aB&aH)];dolen:while(true){aJ=aA.bits;aB>>>=aJ;ar-=aJ;aJ=aA.op;if(aJ==0){aN.output_data+=String.fromCharCode(aA.val);aK++}else{if(aJ&16){aF=aA.val;aJ&=15;if(aJ){if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aF+=aB&((1<<aJ)-1);aB>>>=aJ;ar-=aJ}if(ar<15){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aA=at[au+(aB&aw)];dodist:while(true){aJ=aA.bits;aB>>>=aJ;ar-=aJ;aJ=aA.op;if(aJ&16){av=aA.val;aJ&=15;if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}}av+=aB&((1<<aJ)-1);aB>>>=aJ;ar-=aJ;aJ=aK-aq;if(av>aJ){aJ=av-aJ;if(aJ>aO){if(aM.sane){aN.msg="invalid distance too far back";aM.mode=a;break loop}}az=0;ay=-1;if(aQ==0){az+=aR-aJ;if(aJ<aF){aF-=aJ;aN.output_data+=aP.substring(az,az+aJ);aK+=aJ;aJ=0;az=-1;ay=aK-av}}else{az+=aQ-aJ;if(aJ<aF){aF-=aJ;aN.output_data+=aP.substring(az,az+aJ);aK+=aJ;az=-1;ay=aK-av}}}else{az=-1;ay=aK-av}if(az>=0){aN.output_data+=aP.substring(az,az+aF);aK+=aF;az+=aF}else{var aG=aF;if(aG>aK-ay){aG=aK-ay}aN.output_data+=aN.output_data.substring(ay,ay+aG);aK+=aG;aF-=aG;ay+=aG;aK+=aF;while(aF>2){aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aF-=3}if(aF){aN.output_data+=aN.output_data.charAt(ay++);if(aF>1){aN.output_data+=aN.output_data.charAt(ay++)}}}}else{if((aJ&64)==0){aA=at[au+(aA.val+(aB&((1<<aJ)-1)))];continue dodist}else{aN.msg="invalid distance code";aM.mode=a;break loop}}break dodist}}else{if((aJ&64)==0){aA=at[aE+(aA.val+(aB&((1<<aJ)-1)))];continue dolen}else{if(aJ&32){aM.mode=an;break loop}else{aN.msg="invalid literal/length code";aM.mode=a;break loop}}}}break dolen}}while(aI<aD&&aK<ax);aF=ar>>>3;aI-=aF;ar-=aF<<3;aB&=(1<<ar)-1;aN.next_in=aI;aN.next_out=aK;aN.avail_in=(aI<aD?5+(aD-aI):5-(aI-aD));aN.avail_out=(aK<ax?257+(ax-aK):257-(aK-ax));aM.hold=aB;aM.bits=ar}function ae(at){var ar;var aq=new Array(at);for(ar=0;ar<at;ar++){aq[ar]=0}return aq}function E(at,ar,aq){return(at&&(ar in at))?at[ar]:aq}function e(){return 0}function J(){var ar;this.mode=0;this.last=0;this.wrap=0;this.havedict=0;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=0;this.distcode=0;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=0;this.lens=ae(320);this.work=ae(288);this.codes=new Array(x);var aq={op:0,bits:0,val:0};for(ar=0;ar<x;ar++){this.codes[ar]=aq}this.sane=0;this.back=0;this.was=0}ZLIB.inflateResetKeep=function(ar){var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;ar.total_in=ar.total_out=aq.total=0;ar.msg=null;if(aq.wrap){ar.adler=aq.wrap&1}aq.mode=G;aq.last=0;aq.havedict=0;aq.dmax=32768;aq.head=null;aq.hold=0;aq.bits=0;aq.lencode=0;aq.distcode=0;aq.next=0;aq.sane=1;aq.back=-1;return ZLIB.Z_OK};ZLIB.inflateReset=function(ar,at){var au;var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;if(typeof at==="undefined"){at=o}if(at<0){au=0;at=-at}else{au=(at>>>4)+1;if(at<48){at&=15}}if(au==1&&(typeof ZLIB.adler32==="function")){ar.checksum_function=ZLIB.adler32}else{if(au==2&&(typeof ZLIB.crc32==="function")){ar.checksum_function=ZLIB.crc32}else{ar.checksum_function=e}}if(at&&(at<8||at>15)){return ZLIB.Z_STREAM_ERROR}if(aq.window&&aq.wbits!=at){aq.window=null}aq.wrap=au;aq.wbits=at;aq.wsize=0;aq.whave=0;aq.wnext=0;return ZLIB.inflateResetKeep(ar)};ZLIB.inflateInit=function(ar){var aq=new ZLIB.z_stream();aq.state=new J();ZLIB.inflateReset(aq,ar);return aq};ZLIB.inflatePrime=function(at,aq,au){var ar;if(!at||!at.state){return ZLIB.Z_STREAM_ERROR}ar=at.state;if(aq<0){ar.hold=0;ar.bits=0;return ZLIB.Z_OK}if(aq>16||ar.bits+aq>32){return ZLIB.Z_STREAM_ERROR}au&=(1<<aq)-1;ar.hold+=au<<ar.bits;ar.bits+=aq;return ZLIB.Z_OK};var U=null;var t=null;function C(ar){var aq;if(!U){U=[{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}]}if(!t){t=[{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}]}ar.lencode=0;ar.distcode=512;for(aq=0;aq<512;aq++){ar.codes[aq]=U[aq]}for(aq=0;aq<32;aq++){ar.codes[aq+512]=t[aq]}ar.lenbits=9;ar.distbits=5}function ap(at){var ar=at.state;var aq=at.output_data.length;if(ar.window===null){ar.window=""}if(ar.wsize==0){ar.wsize=1<<ar.wbits}if(aq>=ar.wsize){ar.window=at.output_data.substring(aq-ar.wsize)}else{if(ar.whave+aq<ar.wsize){ar.window+=at.output_data}else{ar.window=ar.window.substring(ar.whave-(ar.wsize-aq))+at.output_data}}ar.whave=ar.window.length;if(ar.whave<ar.wsize){ar.wnext=ar.whave}else{ar.wnext=0}return 0}function m(ar,at){var aq=[at&255,(at>>>8)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,2)}function n(ar,at){var aq=[at&255,(at>>>8)&255,(at>>>16)&255,(at>>>24)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,4)}function Z(ar,aq){aq.strm=ar;aq.left=ar.avail_out;aq.next=ar.next_in;aq.have=ar.avail_in;aq.hold=ar.state.hold;aq.bits=ar.state.bits;return aq}function ah(aq){var ar=aq.strm;ar.next_in=aq.next;ar.avail_out=aq.left;ar.avail_in=aq.have;ar.state.hold=aq.hold;ar.state.bits=aq.bits}function P(aq){aq.hold=0;aq.bits=0}function ag(aq){if(aq.have==0){return false}aq.have--;aq.hold+=(aq.strm.input_data.charCodeAt(aq.next++)&255)<<aq.bits;aq.bits+=8;return true}function ad(ar,aq){while(ar.bits<aq){if(!ag(ar)){return false}}return true}function b(ar,aq){return ar.hold&((1<<aq)-1)}function w(ar,aq){ar.hold>>>=aq;ar.bits-=aq}function c(aq){aq.hold>>>=aq.bits&7;aq.bits-=aq.bits&7}function ai(aq){return((aq>>>24)&255)+((aq>>>8)&65280)+((aq&65280)<<8)+((aq&255)<<24)}var I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(aD,at){var aC;var aB;var aq,az;var ar;var av=-1;var au=-1;var aw;var ax;var ay;var aA;if(!aD||!aD.state||(!aD.input_data&&aD.avail_in!=0)){return ZLIB.Z_STREAM_ERROR}aC=aD.state;if(aC.mode==an){aC.mode=ao}aB={};Z(aD,aB);aq=aB.have;az=aB.left;aA=ZLIB.Z_OK;inf_leave:for(;;){switch(aC.mode){case G:if(aC.wrap==0){aC.mode=ao;break}if(!ad(aB,16)){break inf_leave}if((aC.wrap&2)&&aB.hold==35615){aC.check=aD.checksum_function(0,null,0,0);m(aD,aB.hold);P(aB);aC.mode=D;break}aC.flags=0;if(aC.head!==null){aC.head.done=-1}if(!(aC.wrap&1)||((b(aB,8)<<8)+(aB.hold>>>8))%31){aD.msg="incorrect header check";aC.mode=a;break}if(b(aB,4)!=ZLIB.Z_DEFLATED){aD.msg="unknown compression method";aC.mode=a;break}w(aB,4);ay=b(aB,4)+8;if(aC.wbits==0){aC.wbits=ay}else{if(ay>aC.wbits){aD.msg="invalid window size";aC.mode=a;break}}aC.dmax=1<<ay;aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=aB.hold&512?q:an;P(aB);break;case D:if(!ad(aB,16)){break inf_leave}aC.flags=aB.hold;if((aC.flags&255)!=ZLIB.Z_DEFLATED){aD.msg="unknown compression method";aC.mode=a;break}if(aC.flags&57344){aD.msg="unknown header flags set";aC.mode=a;break}if(aC.head!==null){aC.head.text=(aB.hold>>>8)&1}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=am;case am:if(!ad(aB,32)){break inf_leave}if(aC.head!==null){aC.head.time=aB.hold}if(aC.flags&512){n(aD,aB.hold)}P(aB);aC.mode=af;case af:if(!ad(aB,16)){break inf_leave}if(aC.head!==null){aC.head.xflags=aB.hold&255;aC.head.os=aB.hold>>>8}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=A;case A:if(aC.flags&1024){if(!ad(aB,16)){break inf_leave}aC.length=aB.hold;if(aC.head!==null){aC.head.extra_len=aB.hold}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.head.extra=""}else{if(aC.head!==null){aC.head.extra=null}}aC.mode=B;case B:if(aC.flags&1024){ar=aC.length;if(ar>aB.have){ar=aB.have}if(ar){if(aC.head!==null&&aC.head.extra!==null){ay=aC.head.extra_len-aC.length;aC.head.extra+=aD.input_data.substring(aB.next,aB.next+(ay+ar>aC.head.extra_max?aC.head.extra_max-ay:ar))}if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;aC.length-=ar}if(aC.length){break inf_leave}}aC.length=0;aC.mode=ac;case ac:if(aC.flags&2048){if(aB.have==0){break inf_leave}if(aC.head!==null&&aC.head.name===null){aC.head.name=""}ar=0;do{ay=aD.input_data.charAt(aB.next+ar);ar++;if(ay==="\0"){break}if(aC.head!==null&&aC.length<aC.head.name_max){aC.head.name+=ay;aC.length++}}while(ar<aB.have);if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;if(ay!=="\0"){break inf_leave}}else{if(aC.head!==null){aC.head.name=null}}aC.length=0;aC.mode=j;case j:if(aC.flags&4096){if(aB.have==0){break inf_leave}ar=0;if(aC.head!==null&&aC.head.comment===null){aC.head.comment=""}do{ay=aD.input_data.charAt(aB.next+ar);ar++;if(ay==="\0"){break}if(aC.head!==null&&aC.length<aC.head.comm_max){aC.head.comment+=ay;aC.length++}}while(ar<aB.have);if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;if(ay!=="\0"){break inf_leave}}else{if(aC.head!==null){aC.head.comment=null}}aC.mode=F;case F:if(aC.flags&512){if(!ad(aB,16)){break inf_leave}if(aB.hold!=(aC.check&65535)){aD.msg="header crc mismatch";aC.mode=a;break}P(aB)}if(aC.head!==null){aC.head.hcrc=(aC.flags>>>9)&1;aC.head.done=1}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;break;case q:if(!ad(aB,32)){break inf_leave}aD.adler=aC.check=ai(aB.hold);P(aB);aC.mode=p;case p:if(aC.havedict==0){ah(aB);return ZLIB.Z_NEED_DICT}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;case an:if(at==ZLIB.Z_BLOCK||at==ZLIB.Z_TREES){break inf_leave}case ao:if(aC.last){c(aB);aC.mode=d;break}if(!ad(aB,3)){break inf_leave}aC.last=b(aB,1);w(aB,1);switch(b(aB,2)){case 0:aC.mode=aj;break;case 1:C(aC);aC.mode=S;if(at==ZLIB.Z_TREES){w(aB,2);break inf_leave}break;case 2:aC.mode=al;break;case 3:aD.msg="invalid block type";aC.mode=a}w(aB,2);break;case aj:c(aB);if(!ad(aB,32)){break inf_leave}if((aB.hold&65535)!=(((aB.hold>>>16)&65535)^65535)){aD.msg="invalid stored block lengths";aC.mode=a;break}aC.length=aB.hold&65535;P(aB);aC.mode=l;if(at==ZLIB.Z_TREES){break inf_leave}case l:aC.mode=k;case k:ar=aC.length;if(ar){if(ar>aB.have){ar=aB.have}if(ar>aB.left){ar=aB.left}if(ar==0){break inf_leave}aD.output_data+=aD.input_data.substring(aB.next,aB.next+ar);aD.next_out+=ar;aB.have-=ar;aB.next+=ar;aB.left-=ar;aC.length-=ar;break}aC.mode=an;break;case al:if(!ad(aB,14)){break inf_leave}aC.nlen=b(aB,5)+257;w(aB,5);aC.ndist=b(aB,5)+1;w(aB,5);aC.ncode=b(aB,4)+4;w(aB,4);if(aC.nlen>286||aC.ndist>30){aD.msg="too many length or distance symbols";aC.mode=a;break}aC.have=0;aC.mode=W;case W:while(aC.have<aC.ncode){if(!ad(aB,3)){break inf_leave}var aE=b(aB,3);aC.lens[I[aC.have++]]=aE;w(aB,3)}while(aC.have<19){aC.lens[I[aC.have++]]=0}aC.next=0;aC.lencode=0;aC.lenbits=7;aA=K(aC,h);if(aA){aD.msg="invalid code lengths set";aC.mode=a;break}aC.have=0;aC.mode=g;case g:while(aC.have<aC.nlen+aC.ndist){for(;;){aw=aC.codes[aC.lencode+b(aB,aC.lenbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if(aw.val<16){w(aB,aw.bits);aC.lens[aC.have++]=aw.val}else{if(aw.val==16){if(!ad(aB,aw.bits+2)){break inf_leave}w(aB,aw.bits);if(aC.have==0){aD.msg="invalid bit length repeat";aC.mode=a;break}ay=aC.lens[aC.have-1];ar=3+b(aB,2);w(aB,2)}else{if(aw.val==17){if(!ad(aB,aw.bits+3)){break inf_leave}w(aB,aw.bits);ay=0;ar=3+b(aB,3);w(aB,3)}else{if(!ad(aB,aw.bits+7)){break inf_leave}w(aB,aw.bits);ay=0;ar=11+b(aB,7);w(aB,7)}}if(aC.have+ar>aC.nlen+aC.ndist){aD.msg="invalid bit length repeat";aC.mode=a;break}while(ar--){aC.lens[aC.have++]=ay}}}if(aC.mode==a){break}if(aC.lens[256]==0){aD.msg="invalid code -- missing end-of-block";aC.mode=a;break}aC.next=0;aC.lencode=aC.next;aC.lenbits=9;aA=K(aC,X);if(aA){aD.msg="invalid literal/lengths set";aC.mode=a;break}aC.distcode=aC.next;aC.distbits=6;aA=K(aC,u);if(aA){aD.msg="invalid distances set";aC.mode=a;break}aC.mode=S;if(at==ZLIB.Z_TREES){break inf_leave}case S:aC.mode=R;case R:if(aB.have>=6&&aB.left>=258){ah(aB);H(aD,az);Z(aD,aB);if(aC.mode==an){aC.back=-1}break}aC.back=0;for(;;){aw=aC.codes[aC.lencode+b(aB,aC.lenbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if(aw.op&&(aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.lencode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if(ax.bits+aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;aC.length=aw.val;if(aw.op==0){aC.mode=Y;break}if(aw.op&32){aC.back=-1;aC.mode=an;break}if(aw.op&64){aD.msg="invalid literal/length code";aC.mode=a;break}aC.extra=aw.op&15;aC.mode=T;case T:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.length+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.was=aC.length;aC.mode=r;case r:for(;;){aw=aC.codes[aC.distcode+b(aB,aC.distbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if((aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.distcode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if((ax.bits+aw.bits)<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;if(aw.op&64){aD.msg="invalid distance code";aC.mode=a;break}aC.offset=aw.val;aC.extra=aw.op&15;aC.mode=s;case s:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.offset+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.mode=aa;case aa:if(aB.left==0){break inf_leave}ar=az-aB.left;if(aC.offset>ar){ar=aC.offset-ar;if(ar>aC.whave){if(aC.sane){aD.msg="invalid distance too far back";aC.mode=a;break}}if(ar>aC.wnext){ar-=aC.wnext;av=aC.wsize-ar;au=-1}else{av=aC.wnext-ar;au=-1}if(ar>aC.length){ar=aC.length}}else{av=-1;au=aD.next_out-aC.offset;ar=aC.length}if(ar>aB.left){ar=aB.left}aB.left-=ar;aC.length-=ar;if(av>=0){aD.output_data+=aC.window.substring(av,av+ar);aD.next_out+=ar;ar=0}else{aD.next_out+=ar;do{aD.output_data+=aD.output_data.charAt(au++)}while(--ar)}if(aC.length==0){aC.mode=R}break;case Y:if(aB.left==0){break inf_leave}aD.output_data+=String.fromCharCode(aC.length);aD.next_out++;aB.left--;aC.mode=R;break;case d:if(aC.wrap){if(!ad(aB,32)){break inf_leave}az-=aB.left;aD.total_out+=az;aC.total+=az;if(az){aD.adler=aC.check=aD.checksum_function(aC.check,aD.output_data,aD.output_data.length-az,az)}az=aB.left;if((aC.flags?aB.hold:ai(aB.hold))!=aC.check){aD.msg="incorrect data check";aC.mode=a;break}P(aB)}aC.mode=V;case V:if(aC.wrap&&aC.flags){if(!ad(aB,32)){break inf_leave}if(aB.hold!=(aC.total&4294967295)){aD.msg="incorrect length check";aC.mode=a;break}P(aB)}aC.mode=v;case v:aA=ZLIB.Z_STREAM_END;break inf_leave;case a:aA=ZLIB.Z_DATA_ERROR;break inf_leave;case ab:return ZLIB.Z_MEM_ERROR;case ak:default:return ZLIB.Z_STREAM_ERROR}}inf_leave:ah(aB);if(aC.wsize||(az!=aD.avail_out&&aC.mode<a&&(aC.mode<d||at!=ZLIB.Z_FINISH))){if(ap(aD)){aC.mode=ab;return ZLIB.Z_MEM_ERROR}}aq-=aD.avail_in;az-=aD.avail_out;aD.total_in+=aq;aD.total_out+=az;aC.total+=az;if(aC.wrap&&az){aD.adler=aC.check=aD.checksum_function(aC.check,aD.output_data,0,aD.output_data.length)}aD.data_type=aC.bits+(aC.last?64:0)+(aC.mode==an?128:0)+(aC.mode==S||aC.mode==l?256:0);if(((aq==0&&az==0)||at==ZLIB.Z_FINISH)&&aA==ZLIB.Z_OK){aA=ZLIB.Z_BUF_ERROR}return aA};ZLIB.inflateEnd=function(ar){var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;aq.window=null;ar.state=null;return ZLIB.Z_OK};ZLIB.z_stream.prototype.inflate=function(au,av){var at;var aq;var ar=16384;this.input_data=au;this.next_in=E(av,"next_in",0);this.avail_in=E(av,"avail_in",au.length-this.next_in);at=E(av,"flush",ZLIB.Z_SYNC_FLUSH);aq=E(av,"avail_out",-1);var aw="";do{this.avail_out=(aq>=0?aq:ar);this.output_data="";this.next_out=0;this.error=ZLIB.inflate(this,at);if(aq>=0){return this.output_data}aw+=this.output_data;if(this.avail_out>0){break}}while(this.error==ZLIB.Z_OK);return aw};ZLIB.z_stream.prototype.inflateReset=function(aq){return ZLIB.inflateReset(this,aq)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js")}(function(){var c=65521;var d=5552;function b(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g.charCodeAt(k)&255;if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g.charCodeAt(k++)&255;l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(h--){e+=g.charCodeAt(k++)&255;l+=e}e%=c;l%=c}return e|(l<<16)}function a(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g[k];if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g[k++];l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(h--){e+=g[k++];l+=e}e%=c;l%=c}return e|(l<<16)}ZLIB.adler32=function(e,g,j,h){if(typeof g==="string"){return b(e,g,j,h)}else{return a(e,g,j,h)}};ZLIB.adler32_combine=function(e,g,h){var k;var l;var j;if(h<0){return 4294967295}h%=c;j=h;k=e&65535;l=j*k;l%=c;k+=(g&65535)+c-1;l+=((e>>16)&65535)+((g>>16)&65535)+c-j;if(k>=c){k-=c}if(k>=c){k-=c}if(l>=(c<<1)){l-=(c<<1)}if(l>=c){l-=c}return k|(l<<16)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js")}(function(){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,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,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,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,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,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function c(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h.charCodeAt(l++))&255]^(j>>>8)}while(--k)}return j^4294967295}function b(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h[l++])&255]^(j>>>8)}while(--k)}return j^4294967295}ZLIB.crc32=function(j,h,l,k){if(typeof h==="string"){return c(j,h,l,k)}else{return b(j,h,l,k)}};var d=32;function g(h,l){var k;var j=0;k=0;while(l){if(l&1){k^=h[j]}l>>=1;j++}return k}function e(k,h){var j;for(j=0;j<d;j++){k[j]=g(h,h[j])}}ZLIB.crc32_combine=function(h,j,l){var m;var p;var k;var o;if(l<=0){return h}k=new Array(d);o=new Array(d);o[0]=3988292384;p=1;for(m=1;m<d;m++){o[m]=p;p<<=1}e(k,o);e(o,k);do{e(k,o);if(l&1){h=g(k,h)}l>>=1;if(l==0){break}e(o,k);if(l&1){h=g(o,h)}l>>=1}while(l!=0);h^=j;return h}}());var CreateAmtRedirect=function(e,a){var g={};g.m=e;e.parent=g;g.authCookie=a;g.State=0;g.socket=null;g.host=null;g.port=0;g.user=null;g.pass=null;g.authuri="/RedirectionService";g.tlsv1only=0;g.inDataCount=0;g.connectstate=0;g.protocol=e.protocol;g.debugmode=0;g.amtaccumulator="";g.amtsequence=1;g.amtkeepalivetimer=null;g.onStateChanged=null;g.Start=function(h,k,n,j,l){g.host=h;g.port=k;g.user=n;g.pass=j;g.connectstate=0;g.inDataCount=0;var m=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+h+"&port="+k+"&tls="+l+((n=="*")?"&serverauth=1":"")+((typeof j==="undefined")?("&serverauth=1&user="+n):"");if((a!=null)&&(a!="")){m+="&auth="+a}g.socket=new WebSocket(m);g.socket.onopen=g.xxOnSocketConnected;g.socket.onmessage=g.xxOnMessage;g.socket.onclose=g.xxOnSocketClosed;g.xxStateChange(1)};g.xxOnSocketConnected=function(){if(g.debugmode==1){console.log("onSocketConnected")}g.xxStateChange(2);if(g.protocol==1){g.xxSend(g.RedirectStartSol)}if(g.protocol==2){g.xxSend(g.RedirectStartKvm)}if(g.protocol==3){g.xxSend(g.RedirectStartIder)}};var b=new FileReader();var d=false,c=[];if(b.readAsBinaryString){b.onload=function(h){g.xxOnSocketData(h.target.result);if(c.length==0){d=false}else{b.readAsBinaryString(new Blob([c.shift()]))}}}else{if(b.readAsArrayBuffer){b.onloadend=function(h){g.xxOnSocketData(h.target.result);if(c.length==0){d=false}else{b.readAsArrayBuffer(c.shift())}}}}g.xxOnMessage=function(k){g.inDataCount++;if(typeof k.data=="object"){if(d==true){c.push(k.data);return}if(b.readAsBinaryString){d=true;b.readAsBinaryString(new Blob([k.data]))}else{if(f.readAsArrayBuffer){d=true;b.readAsArrayBuffer(k.data)}else{var h="",j=new Uint8Array(k.data),m=j.byteLength;for(var l=0;l<m;l++){h+=String.fromCharCode(j[l])}g.xxOnSocketData(h)}}}else{g.xxOnSocketData(k.data)}};g.xxOnSocketData=function(t){if(!t||g.connectstate==-1){return}if(typeof t==="object"){var m="";var o=new Uint8Array(t);var y=o.byteLength;for(var x=0;x<y;x++){m+=String.fromCharCode(o[x])}t=m}else{if(typeof t!=="string"){return}}if((g.protocol==2||g.protocol==3)&&g.connectstate==1){return g.m.ProcessData(t)}g.amtaccumulator+=t;while(g.amtaccumulator.length>=1){var p=0;switch(g.amtaccumulator.charCodeAt(0)){case 17:if(g.amtaccumulator.length<4){return}var L=g.amtaccumulator.charCodeAt(1);switch(L){case 0:if(g.amtaccumulator.length<13){return}var C=g.amtaccumulator.charCodeAt(12);if(g.amtaccumulator.length<13+C){return}g.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));p=(13+C);break;default:g.Stop(1);break}break;case 20:if(g.amtaccumulator.length<9){return}var k=ReadIntX(g.amtaccumulator,5);if(g.amtaccumulator.length<9+k){return}var K=g.amtaccumulator.charCodeAt(1);var l=g.amtaccumulator.charCodeAt(4);var h=[];for(x=0;x<k;x++){h.push(g.amtaccumulator.charCodeAt(9+x))}var j=g.amtaccumulator.substring(9,9+k);p=9+k;if(l==0){if(h.indexOf(4)>=0){g.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(g.user.length+g.authuri.length+8)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0,0))}else{if(h.indexOf(3)>=0){g.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(g.user.length+g.authuri.length+7)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0))}else{if(h.indexOf(1)>=0){g.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(g.user.length+g.pass.length+2)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(g.pass.length)+g.pass)}else{g.Stop(2)}}}}else{if((l==3||l==4)&&K==1){var s=0;var G=j.charCodeAt(s);var F=j.substring(s+1,s+1+G);s+=(G+1);var B=j.charCodeAt(s);var A=j.substring(s+1,s+1+B);s+=(B+1);var E=0;var D=null;var q=g.xxRandomNonce(32);var J="00000002";var v="";if(l==4){E=j.charCodeAt(s);D=j.substring(s+1,s+1+E);s+=(E+1);v=J+":"+q+":"+D+":"}var u=hex_md5(hex_md5(g.user+":"+F+":"+g.pass)+":"+A+":"+v+hex_md5("POST:"+g.authuri));var M=g.user.length+F.length+A.length+g.authuri.length+q.length+J.length+u.length+7;if(l==4){M+=(D.length+1)}var n=String.fromCharCode(19,0,0,0,l)+IntToStrX(M)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(F.length)+F+String.fromCharCode(A.length)+A+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(q.length)+q+String.fromCharCode(J.length)+J+String.fromCharCode(u.length)+u;if(l==4){n+=(String.fromCharCode(D.length)+D)}g.xxSend(n)}else{if(K==0){if(g.protocol==1){var z=10000;var O=100;var N=0;var I=10000;var H=100;var w=0;g.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(g.amtsequence++)+ShortToStrX(z)+ShortToStrX(O)+ShortToStrX(N)+ShortToStrX(I)+ShortToStrX(H)+ShortToStrX(w)+IntToStrX(0))}if(g.protocol==2){g.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0))}if(g.protocol==3){g.connectstate=1;g.xxStateChange(3)}}else{g.Stop(3)}}}break;case 33:if(g.amtaccumulator.length<23){break}p=23;g.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(g.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));if(g.protocol==1){g.amtkeepalivetimer=setInterval(g.xxSendAmtKeepAlive,2000)}g.connectstate=1;g.xxStateChange(3);break;case 41:if(g.amtaccumulator.length<10){break}p=10;break;case 42:if(g.amtaccumulator.length<10){break}var r=(10+((g.amtaccumulator.charCodeAt(9)&255)<<8)+(g.amtaccumulator.charCodeAt(8)&255));if(g.amtaccumulator.length<r){break}g.m.ProcessData(g.amtaccumulator.substring(10,r));p=r;break;case 43:if(g.amtaccumulator.length<8){break}p=8;break;case 65:if(g.amtaccumulator.length<8){break}g.connectstate=1;g.m.Start();if(g.amtaccumulator.length>8){g.m.ProcessData(g.amtaccumulator.substring(8))}p=g.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+g.amtaccumulator.charCodeAt(0)+" acclen="+g.amtaccumulator.length);g.Stop(4);return}if(p==0){return}g.amtaccumulator=g.amtaccumulator.substring(p)}};g.xxSend=function(k){if(g.socket!=null&&g.socket.readyState==WebSocket.OPEN){if(g.debugmode==1){console.log("Send",k)}var h=new Uint8Array(k.length);for(var j=0;j<k.length;++j){h[j]=k.charCodeAt(j)}g.socket.send(h.buffer)}};g.send=function(h){if(g.socket==null||g.connectstate!=1){return}if(g.protocol==1){g.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(g.amtsequence++)+ShortToStrX(h.length)+h)}else{g.xxSend(h)}};g.xxSendAmtKeepAlive=function(){if(g.socket==null){return}g.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(g.amtsequence++))};g.xxRandomNonceX="abcdef0123456789";g.xxRandomNonce=function(j){var k="";for(var h=0;h<j;h++){k+=g.xxRandomNonceX.charAt(Math.floor(Math.random()*g.xxRandomNonceX.length))}return k};g.xxOnSocketClosed=function(){if(g.debugmode==1){console.log("onSocketClosed")}if((g.inDataCount==0)&&(g.tlsv1only==0)){g.tlsv1only=1;g.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="+g.host+"&port="+g.port+"&tls="+g.tls+"&tls1only=1"+((g.user=="*")?"&serverauth=1":"")+((typeof pass==="undefined")?("&serverauth=1&user="+g.user):""));g.socket.onopen=g.xxOnSocketConnected;g.socket.onmessage=g.xxOnMessage;g.socket.onclose=g.xxOnSocketClosed}else{g.Stop(5)}};g.xxStateChange=function(h){if(g.State==h){return}g.State=h;g.m.xxStateChange(g.State);if(g.onStateChanged!=null){g.onStateChanged(g,g.State)}};g.Stop=function(h){if(g.debugmode==1){console.log("onSocketStop",h)}g.xxStateChange(0);g.connectstate=-1;g.amtaccumulator="";if(g.socket!=null){g.socket.close();g.socket=null}if(g.amtkeepalivetimer!=null){clearInterval(g.amtkeepalivetimer);g.amtkeepalivetimer=null}};g.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32);g.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82);g.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return g};var CreateWsmanComm=function(l,o,q,n,p){var m={};m.PendingAjax=[];m.ActiveAjaxCount=0;m.MaxActiveAjaxCount=1;m.FailAllError=0;m.challengeParams=null;m.noncecounter=1;m.authcounter=0;m.socket=null;m.socketState=0;m.host=l;m.port=o;m.user=q;m.pass=n;m.tls=p;m.tlsv1only=1;m.cnonce=Math.random().toString(36).substring(7);m.PerformAjax=function(t,s,v,u,w,r){if(m.ActiveAjaxCount<m.MaxActiveAjaxCount&&m.PendingAjax.length==0){m.PerformAjaxEx(t,s,v,w,r)}else{if(u==1){m.PendingAjax.unshift([t,s,v,w,r])}else{m.PendingAjax.push([t,s,v,w,r])}}};m.PerformNextAjax=function(){if(m.ActiveAjaxCount>=m.MaxActiveAjaxCount||m.PendingAjax.length==0){return}var r=m.PendingAjax.shift();m.PerformAjaxEx(r[0],r[1],r[2],r[3],r[4]);m.PerformNextAjax()};m.PerformAjaxEx=function(t,s,u,v,r){if(m.FailAllError!=0){m.gotNextMessagesError({status:m.FailAllError},"error",null,[t,s,u,v,r]);return}if(!t){t=""}m.ActiveAjaxCount++;return m.PerformAjaxExNodeJS(t,s,u,v,r)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(t,s,u,v,r){m.PerformAjaxExNodeJS2(t,s,u,v,r,3)};m.PerformAjaxExNodeJS2=function(t,s,v,w,r,u){if(u<=0||m.FailAllError!=0){m.ActiveAjaxCount--;if(m.FailAllError!=999){m.gotNextMessages(null,"error",{status:((m.FailAllError==0)?408:m.FailAllError)},[t,s,v,w,r])}m.PerformNextAjax();return}m.pendingAjaxCall.push([t,s,v,w,r,u]);if(m.socketState==0){m.xxConnectHttpSocket()}else{if(m.socketState==2){m.sendRequest(t,w,r)}}};m.sendRequest=function(t,v,r){v=v?v:"/wsman";r=r?r:"POST";var s=r+" "+v+" HTTP/1.1\r\n";if(m.challengeParams!=null){var u=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(r+":"+v));s+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:v,qop:m.challengeParams.qop,response:u,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}s+="Host: "+m.host+":"+m.port+"\r\nTransfer-Encoding: chunked\r\n\r\n"+t.length.toString(16).toUpperCase()+"\r\n"+t+"\r\n0\r\n\r\n";g(s)};m.parseDigest=function(r){var s=r.substring(7).split(",");for(i in s){s[i]=s[i].trim()}return s.reduce(function(t,v){var u=v.split("=");t[u[0]]=u[1].replace(/"/g,"");return t},{})};m.renderDigest=function(r){var s=[];for(i in r){s.push(i)}return"Digest "+s.reduce(function(u,t){return u+","+t+'="'+r[t]+'"'},"").substring(1)};m.xxConnectHttpSocket=function(){m.socketParseState=0;m.socketAccumulator="";m.socketHeader=null;m.socketData="";m.socketState=1;console.log(m.tlsv1only);m.socket=new WebSocket(window.location.protocol.replace("http","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+"&tlsv1only="+m.tlsv1only+((q=="*")?"&serverauth=1":"")+((typeof n==="undefined")?("&serverauth=1&user="+q):""));m.socket.onopen=c;m.socket.onmessage=a;m.socket.onclose=b};function c(){m.socketState=2;for(i in m.pendingAjaxCall){m.sendRequest(m.pendingAjaxCall[i][0],m.pendingAjaxCall[i][3],m.pendingAjaxCall[i][4])}}var h=new FileReader();var k=false,j=[];if(h.readAsBinaryString){h.onload=function(r){d(r.target.result);if(j.length==0){k=false}else{h.readAsBinaryString(new Blob([j.shift()]))}}}else{if(h.readAsArrayBuffer){h.onloadend=function(r){d(r.target.result);if(j.length==0){k=false}else{h.readAsArrayBuffer(j.shift())}}}}function a(t){if(typeof t.data=="object"){if(k==true){j.push(t.data);return}if(h.readAsBinaryString){k=true;h.readAsBinaryString(new Blob([t.data]))}else{if(h.readAsArrayBuffer){k=true;h.readAsArrayBuffer(t.data)}else{var r="",s=new Uint8Array(t.data),v=s.byteLength;for(var u=0;u<v;u++){r+=String.fromCharCode(s[u])}d(r)}}}else{d(t.data)}}function d(v){if(typeof v==="object"){var r="",s=new Uint8Array(v),y=s.byteLength;for(var x=0;x<y;x++){r+=String.fromCharCode(s[x])}v=r}else{if(typeof v!=="string"){return}}m.socketAccumulator+=v;while(true){if(m.socketParseState==0){var w=m.socketAccumulator.indexOf("\r\n\r\n");if(w<0){return}m.socketHeader=m.socketAccumulator.substring(0,w).split("\r\n");m.socketAccumulator=m.socketAccumulator.substring(w+4);m.socketParseState=1;m.socketData="";m.socketXHeader={Directive:m.socketHeader[0].split(" ")};for(x in m.socketHeader){if(x!=0){var z=m.socketHeader[x].indexOf(":");m.socketXHeader[m.socketHeader[x].substring(0,z).toLowerCase()]=m.socketHeader[x].substring(z+2)}}}if(m.socketParseState==1){var u=-1;if((m.socketXHeader.connection!=undefined)&&(m.socketXHeader.connection.toLowerCase()=="close")&&((m.socketXHeader["transfer-encoding"]==undefined)||(m.socketXHeader["transfer-encoding"].toLowerCase()!="chunked"))){u=0}else{if(m.socketXHeader["content-length"]!=undefined){u=parseInt(m.socketXHeader["content-length"]);if(m.socketAccumulator.length<u){return}var v=m.socketAccumulator.substring(0,u);m.socketAccumulator=m.socketAccumulator.substring(u);m.socketData=v;u=0}else{var t=m.socketAccumulator.indexOf("\r\n");if(t<0){return}u=parseInt(m.socketAccumulator.substring(0,t),16);if(isNaN(u)){if(m.websocket){m.websocket.close()}return}if(m.socketAccumulator.length<t+2+u+2){return}var v=m.socketAccumulator.substring(t+2,t+2+u);m.socketAccumulator=m.socketAccumulator.substring(t+2+u+2);m.socketData+=v}}if(u==0){e(m.socketXHeader,m.socketData);m.socketParseState=0;m.socketHeader=null}}}}function e(u,t){var w=parseInt(u.Directive[1]);if(isNaN(w)){w=602}if(w==401&&++(m.authcounter)<3){m.challengeParams=m.parseDigest(u["www-authenticate"])}else{var v=m.pendingAjaxCall.shift();m.authcounter=0;m.ActiveAjaxCount--;m.gotNextMessages(t,"success",{status:w},v);m.PerformNextAjax()}}function b(s){m.socketState=0;if(m.socket!=null){m.socket.close();m.socket=null}if(m.pendingAjaxCall.length>0){var t=m.pendingAjaxCall.shift();var u=t[5];m.PerformAjaxExNodeJS2(t[0],t[1],t[2],t[3],t[4],--u)}}function g(u){if(m.socketState==2&&m.socket!=null&&m.socket.readyState==WebSocket.OPEN){var r=new Uint8Array(u.length);for(var t=0;t<u.length;++t){r[t]=u.charCodeAt(t)}try{m.socket.send(r.buffer)}catch(s){}}}m.gotNextMessages=function(s,u,t,r){if(m.FailAllError==999){return}if(m.FailAllError!=0){r[1](null,m.FailAllError,r[2]);return}if(t.status!=200){r[1](null,t.status,r[2]);return}r[1](s,200,r[2])};m.gotNextMessagesError=function(t,u,s,r){if(m.FailAllError==999){return}if(m.FailAllError!=0){r[1](null,m.FailAllError,r[2]);return}r[1](m,null,{Header:{HttpError:t.status}},t.status,r[2])};m.CancelAllQueries=function(r){while(m.PendingAjax.length>0){var t=m.PendingAjax.shift();t[1](null,r,t[2])}if(m.websocket!=null){m.websocket.close();m.websocket=null;m.socketState=0}};return m};var CreateAgentRedirect=function(e,g,k,a){var h={};h.m=g;g.parent=h;h.meshserver=e;h.authCookie=a;h.State=0;h.nodeid=null;h.socket=null;h.connectstate=-1;h.tunnelid=Math.random().toString(36).substring(2);h.protocol=g.protocol;h.onStateChanged=null;h.ctrlMsgAllowed=true;h.attemptWebRTC=false;h.webRtcActive=false;h.webSwitchOk=false;h.webchannel=null;h.webrtc=null;h.debugmode=0;h.Start=function(l){var n,m=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/meshrelay.ashx?id="+h.tunnelid;if((a!=null)&&(a!="")){m+="&auth="+a}h.nodeid=l;h.connectstate=0;h.socket=new WebSocket(m);h.socket.onopen=h.xxOnSocketConnected;h.socket.onmessage=h.xxOnMessage;h.socket.onerror=function(o){};h.socket.onclose=h.xxOnSocketClosed;h.xxStateChange(1);h.meshserver.send({action:"msg",type:"tunnel",nodeid:h.nodeid,value:"*/meshrelay.ashx?id="+h.tunnelid})};h.xxOnSocketConnected=function(){if(h.debugmode==1){console.log("onSocketConnected")}h.xxStateChange(2)};h.xxOnControlCommand=function(n){var l;try{l=JSON.parse(n)}catch(m){return}if(l.ctrlChannel!="102938"){h.xxOnSocketData(n);return}if(h.webrtc!=null){if(l.type=="answer"){h.webrtc.setRemoteDescription(new RTCSessionDescription(l),function(){},h.xxCloseWebRTC)}else{if(l.type=="webrtc0"){h.webSwitchOk=true;j()}else{if(l.type=="webrtc1"){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc2"}')}else{if(l.type=="webrtc2"){}}}}}};h.sendCtrlMsg=function(m){if(h.ctrlMsgAllowed==true){if((typeof args!="undefined")&&args.redirtrace){console.log("RedirSend",typeof m,m)}try{h.socket.send(m)}catch(l){}}};function j(){if((h.webSwitchOk==true)&&(h.webRtcActive==true)){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc0"}');h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc1"}');if(h.onStateChanged!=null){h.onStateChanged(h,h.State)}}}h.xxOnMessage=function(o){if(h.State<3){if(o.data=="c"){try{h.socket.send(h.protocol)}catch(p){}h.xxStateChange(3);if(h.attemptWebRTC==true){var n=null;if(typeof RTCPeerConnection!=="undefined"){h.webrtc=new RTCPeerConnection(n)}else{if(typeof webkitRTCPeerConnection!=="undefined"){h.webrtc=new webkitRTCPeerConnection(n)}}if(h.webrtc!=null){h.webchannel=h.webrtc.createDataChannel("DataChannel",{});h.webchannel.onmessage=h.xxOnMessage;h.webchannel.onopen=function(){h.webRtcActive=true;j()};h.webchannel.onclose=function(s){if(h.webRtcActive){h.Stop()}};h.webrtc.onicecandidate=function(s){if(s.candidate==null){try{h.socket.send(JSON.stringify(h.webrtcoffer))}catch(t){}}else{h.webrtcoffer.sdp+=("a="+s.candidate.candidate+"\r\n")}};h.webrtc.oniceconnectionstatechange=function(){if(h.webrtc!=null){if(h.webrtc.iceConnectionState=="disconnected"){if(h.webRtcActive==true){h.Stop()}else{h.xxCloseWebRTC()}}else{if(h.webrtc.iceConnectionState=="failed"){h.xxCloseWebRTC()}}}};h.webrtc.createOffer(function(s){h.webrtcoffer=s;h.webrtc.setLocalDescription(s,function(){},h.xxCloseWebRTC)},h.xxCloseWebRTC,{mandatory:{OfferToReceiveAudio:false,OfferToReceiveVideo:false}})}}return}}if(typeof o.data=="string"){h.xxOnControlCommand(o.data);return}if(typeof o.data=="object"){if(d==true){c.push(o.data);return}if(b.readAsBinaryString){d=true;b.readAsBinaryString(new Blob([o.data]))}else{if(b.readAsArrayBuffer){d=true;b.readAsArrayBuffer(o.data)}else{var l="",m=new Uint8Array(o.data),r=m.byteLength;for(var q=0;q<r;q++){l+=String.fromCharCode(m[q])}h.xxOnSocketData(l)}}}else{h.xxOnSocketData(o.data)}};var b=new FileReader();var d=false,c=[];if(b.readAsBinaryString){b.onload=function(l){h.xxOnSocketData(l.target.result);if(c.length==0){d=false}else{b.readAsBinaryString(new Blob([c.shift()]))}}}else{if(b.readAsArrayBuffer){b.onloadend=function(l){h.xxOnSocketData(l.target.result);if(c.length==0){d=false}else{b.readAsArrayBuffer(c.shift())}}}}h.xxOnSocketData=function(n){if(!n||h.connectstate==-1){return}if(typeof n==="object"){var l="",m=new Uint8Array(n),p=m.byteLength;for(var o=0;o<p;o++){l+=String.fromCharCode(m[o])}n=l}else{if(typeof n!=="string"){return}}if((typeof args!="undefined")&&args.redirtrace){console.log("RedirRecv",typeof n,n.length,n)}return h.m.ProcessData(n)};h.sendText=function(l){if(typeof l!="string"){l=JSON.stringify(l)}h.send(encode_utf8(l))};h.send=function(p){if((typeof args!="undefined")&&args.redirtrace){console.log("RedirSend",typeof p,p.length,p)}try{if(h.socket!=null&&h.socket.readyState==WebSocket.OPEN){if(typeof p=="string"){if(h.debugmode==1){var l=new Uint8Array(p.length),m=[];for(var o=0;o<p.length;++o){l[o]=p.charCodeAt(o);m.push(p.charCodeAt(o))}if(h.webRtcActive==true){h.webchannel.send(l.buffer)}else{h.socket.send(l.buffer)}}else{var l=new Uint8Array(p.length);for(var o=0;o<p.length;++o){l[o]=p.charCodeAt(o)}if(h.webRtcActive==true){h.webchannel.send(l.buffer)}else{h.socket.send(l.buffer)}}}else{if(h.webRtcActive==true){h.webchannel.send(p)}else{h.socket.send(p)}}}}catch(n){}};h.xxOnSocketClosed=function(){h.Stop(1)};h.xxStateChange=function(l){if(h.State==l){return}h.State=l;h.m.xxStateChange(h.State);if(h.onStateChanged!=null){h.onStateChanged(h,h.State)}};h.xxCloseWebRTC=function(){if(h.webchannel!=null){try{h.webchannel.close()}catch(l){}h.webchannel=null}if(h.webrtc!=null){try{h.webrtc.close()}catch(l){}h.webrtc=null}h.webRtcActive=false};h.Stop=function(m){if(h.debugmode==1){console.log("stop",m)}h.xxCloseWebRTC();h.connectstate=-1;if(h.socket!=null){try{if(h.socket.readyState==1){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}');h.socket.close()}}catch(l){}h.socket=null}h.xxStateChange(0)};return h};var CreateKvmDataChannel=function(h,e,d){var g={};g.m=e;e.parent=g;g.webchannel=h;g.State=0;g.protocol=e.protocol;g.onStateChanged=null;g.onControlMsg=null;g.debugmode=0;g.keepalive=d;g.rtcKeepAlive=null;g.Start=function(){if(g.debugmode==1){console.log("start")}g.xxStateChange(3);g.webchannel.onmessage=g.xxOnMessage;g.rtcKeepAlive=setInterval(g.xxSendRtcKeepAlive,30000)};var a=new FileReader();var c=false,b=[];if(a.readAsBinaryString){a.onload=function(j){g.xxOnSocketData(j.target.result);if(b.length==0){c=false}else{a.readAsBinaryString(new Blob([b.shift()]))}}}else{if(a.readAsArrayBuffer){a.onloadend=function(j){g.xxOnSocketData(j.target.result);if(b.length==0){c=false}else{a.readAsArrayBuffer(b.shift())}}}}g.xxOnMessage=function(l){if(typeof l.data=="string"){if(g.onControlMsg!=null){g.onControlMsg(l.data)}return}if(typeof l.data=="object"){if(c==true){b.push(l.data);return}if(a.readAsBinaryString){c=true;a.readAsBinaryString(new Blob([l.data]))}else{if(f.readAsArrayBuffer){c=true;a.readAsArrayBuffer(l.data)}else{var j="",k=new Uint8Array(l.data),n=k.byteLength;for(var m=0;m<n;m++){j+=String.fromCharCode(k[m])}g.xxOnSocketData(j)}}}else{g.xxOnSocketData(l.data)}};g.xxOnSocketData=function(l){if(!l){return}if(typeof l==="object"){var j="",k=new Uint8Array(l),n=k.byteLength;for(var m=0;m<n;m++){j+=String.fromCharCode(k[m])}l=j}else{if(typeof l!=="string"){return}}return g.m.ProcessData(l)};g.sendCtrlMsg=function(j){if(typeof j=="string"){g.webchannel.send(j);if(g.keepalive!=null){g.keepalive.sendKeepAlive()}}};g.send=function(l){if(typeof l=="string"){var j=new Uint8Array(l.length);for(var k=0;k<l.length;++k){j[k]=l.charCodeAt(k)}l=j}g.webchannel.send(l)};g.xxStateChange=function(j){if(g.State==j){return}g.State=j;g.m.xxStateChange(g.State);if(g.onStateChanged!=null){g.onStateChanged(g,g.State)}};g.Stop=function(){if(g.debugmode==1){console.log("stop")}if(g.rtcKeepAlive!=null){clearInterval(g.rtcKeepAlive);g.rtcKeepAlive=null}g.xxStateChange(0)};g.xxSendRtcKeepAlive=function(){g.sendCtrlMsg(JSON.stringify({action:"ping"}))};return g};var CreateAgentRemoteDesktop=function(a,e){var d={};d.CanvasId=a;if(typeof a==="string"){d.CanvasId=Q(a)}d.Canvas=d.CanvasId.getContext("2d");d.scrolldiv=e;d.State=0;d.PendingOperations=[];d.tilesReceived=0;d.TilesDrawn=0;d.KillDraw=0;d.ipad=false;d.tabletKeyboardVisible=false;d.LastX=0;d.LastY=0;d.touchenabled=0;d.submenuoffset=0;d.touchtimer=null;d.TouchArray={};d.connectmode=0;d.connectioncount=0;d.rotation=0;d.protocol=2;d.debugmode=0;d.firstUpKeys=[];d.stopInput=false;d.sessionid=0;d.username;d.oldie=false;d.CompressionLevel=50;d.ScalingLevel=1024;d.FrameRateTimer=50;d.FirstDraw=false;d.ScreenWidth=960;d.ScreenHeight=700;d.width=960;d.height=960;d.onScreenSizeChange=null;d.onMessage=null;d.onConnectCountChanged=null;d.onDebugMessage=null;d.onTouchEnabledChanged=null;d.onDisplayinfo=null;d.accumulator=null;d.Start=function(){d.State=0;d.accumulator=null};d.Stop=function(){d.setRotation(0);d.UnGrabKeyInput();d.UnGrabMouseInput();d.touchenabled=0;if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}d.Canvas.clearRect(0,0,d.CanvasId.width,d.CanvasId.height)};d.xxStateChange=function(g){if(d.State==g){return}d.State=g;d.CanvasId.style.cursor="default";switch(g){case 0:d.Stop();break;case 3:break}};d.send=function(g){if(d.debugmode>1){console.log("KSend("+g.length+"): "+rstr2hex(g))}d.parent.send(g)};d.ProcessPictureMsg=function(h,k,l){var j=new Image();j.xcount=d.tilesReceived++;var g=d.tilesReceived;j.src="data:image/jpeg;base64,"+btoa(h.substring(4,h.length));j.onload=function(){if(d.Canvas!=null&&d.KillDraw<g&&d.State!=0){d.PendingOperations.push([g,2,j,k,l]);while(d.DoPendingOperations()){}}};j.error=function(){console.log("DecodeTileError")}};d.DoPendingOperations=function(){if(d.PendingOperations.length==0){return false}for(var g=0;g<d.PendingOperations.length;g++){var h=d.PendingOperations[g];if(h[0]==(d.TilesDrawn+1)){if(h[1]==1){d.ProcessCopyRectMsg(h[2])}else{if(h[1]==2){d.Canvas.drawImage(h[2],d.rotX(h[3],h[4]),d.rotY(h[3],h[4]));delete h[2]}}d.PendingOperations.splice(g,1);delete h;d.TilesDrawn++;if(d.TilesDrawn==d.tilesReceived&&d.KillDraw<d.TilesDrawn){d.KillDraw=d.TilesDrawn=d.tilesReceived=0}return true}}if(d.oldie&&d.PendingOperations.length>0){d.TilesDrawn++}return false};d.ProcessCopyRectMsg=function(k){var l=((k.charCodeAt(0)&255)<<8)+(k.charCodeAt(1)&255);var m=((k.charCodeAt(2)&255)<<8)+(k.charCodeAt(3)&255);var g=((k.charCodeAt(4)&255)<<8)+(k.charCodeAt(5)&255);var h=((k.charCodeAt(6)&255)<<8)+(k.charCodeAt(7)&255);var n=((k.charCodeAt(8)&255)<<8)+(k.charCodeAt(9)&255);var j=((k.charCodeAt(10)&255)<<8)+(k.charCodeAt(11)&255);d.Canvas.drawImage(Canvas.canvas,l,m,n,j,g,h,n,j)};d.SendUnPause=function(){d.send(String.fromCharCode(0,8,0,5,0))};d.SendPause=function(){d.send(String.fromCharCode(0,8,0,5,1))};d.SendCompressionLevel=function(k,h,j,g){if(h){d.CompressionLevel=h}if(j){d.ScalingLevel=j}if(g){d.FrameRateTimer=g}d.send(String.fromCharCode(0,5,0,10,k,d.CompressionLevel)+d.shortToStr(d.ScalingLevel)+d.shortToStr(d.FrameRateTimer))};d.SendRefresh=function(){d.send(String.fromCharCode(0,6,0,4))};d.ProcessScreenMsg=function(h,g){if(d.debugmode>0){console.log("ScreenSize: "+h+" x "+g)}d.Canvas.setTransform(1,0,0,1,0,0);d.rotation=0;d.FirstDraw=true;d.ScreenWidth=d.width=h;d.ScreenHeight=d.height=g;d.KillDraw=d.tilesReceived;while(d.PendingOperations.length>0){d.PendingOperations.shift()}d.SendCompressionLevel(1);d.SendUnPause();if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}};d.ProcessData=function(h){var g=0;while(g<h.length){g+=d.ProcessDataEx(h.substring(g))}};d.ProcessDataEx=function(r){if(d.accumulator!=null){r=d.accumulator+r;console.log("KVM using accumulated data, total size is now "+r.length+" bytes.");d.accumulator=null}if(d.debugmode>1){console.log("KRecv("+r.length+"): "+rstr2hex(r.substring(0,Math.min(r.length,40))))}if(r.length<4){return}var g=null,s=0,t=0,j=ReadShort(r,0),h=ReadShort(r,2),n=0;if((j==27)&&(h==8)){if(r.length<12){return}j=ReadShort(r,8);h=ReadInt(r,4);if((h+8)>r.length){console.log("KVM accumulator set to "+r.length+" bytes, need "+h+" bytes.");d.accumulator=r;return}r=r.substring(8);n=8}if((h!=r.length)&&(d.debugmode>0)){console.log(h,r.length,h==r.length)}if((j>=18)&&(j!=65)){console.error("Invalid KVM command "+j+" of size "+h);console.log("Invalid KVM data",r.length,rstr2hex(r.substring(0,40))+"...");return}if(h>r.length){console.log("KVM accumulator set to "+r.length+" bytes, need "+h+" bytes.");d.accumulator=r;return}if(j==3||j==4||j==7){g=r.substring(4,h);s=((g.charCodeAt(0)&255)<<8)+(g.charCodeAt(1)&255);t=((g.charCodeAt(2)&255)<<8)+(g.charCodeAt(3)&255);if(d.debugmode>0){console.log("CMD"+j+" at X="+s+" Y="+t)}}switch(j){case 3:if(d.FirstDraw){d.onResize()}d.ProcessPictureMsg(g,s,t);break;case 4:if(d.FirstDraw){d.onResize()}if(d.TilesDrawn==d.tilesReceived){d.ProcessCopyRectMsg(g)}else{d.PendingOperations.push([++tilesReceived,1,g])}break;case 7:d.ProcessScreenMsg(s,t);d.SendKeyMsgKC(d.KeyAction.UP,16);d.SendKeyMsgKC(d.KeyAction.UP,17);d.SendKeyMsgKC(d.KeyAction.UP,18);d.SendKeyMsgKC(d.KeyAction.UP,91);d.SendKeyMsgKC(d.KeyAction.UP,92);d.SendKeyMsgKC(d.KeyAction.UP,16);d.send(String.fromCharCode(0,14,0,4));break;case 11:var o=[],k=((r.charCodeAt(4)&255)<<8)+(r.charCodeAt(5)&255);if(k>0){var q=0,p=((r.charCodeAt(6+(k*2))&255)<<8)+(r.charCodeAt(7+(k*2))&255);for(var m=0;m<k;m++){var l=((r.charCodeAt(6+(m*2))&255)<<8)+(r.charCodeAt(7+(m*2))&255);if(l==65535){o.push("All Displays")}else{o.push("Display "+l)}if(l==p){q=m}}}if(d.onDisplayinfo!=null){d.onDisplayinfo(d,o,q)}break;case 12:break;case 14:d.touchenabled=1;d.TouchArray={};if(d.onTouchEnabledChanged!=null){d.onTouchEnabledChanged(d.touchenabled)}break;case 15:d.TouchArray={};break;case 16:d.connectioncount=ReadInt(r,4);if(d.onConnectCountChanged!=null){d.onConnectCountChanged(d.connectioncount,d)}break;case 17:if(d.onMessage!=null){d.onMessage(r.substring(4,h),d)}break;case 65:r=r.substring(4);if(r[0]!="."){console.log(r);alert("KVM: "+r)}else{console.log("KVM: "+r.substring(1))}break}return h+n};d.MouseButton={NONE:0,LEFT:2,RIGHT:8,MIDDLE:32};d.KeyAction={NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5,DBLCLICK:6};d.InputType={KEY:1,MOUSE:2,CTRLALTDEL:10,TOUCH:15};d.Alternate=0;var c={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,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};function b(g){if(g.code.startsWith("Key")&&g.code.length==4){return g.code.charCodeAt(3)}if(g.code.startsWith("Digit")&&g.code.length==6){return g.code.charCodeAt(5)}if(g.code.startsWith("Numpad")&&g.code.length==7){return g.code.charCodeAt(6)+48}return c[g.code]}d.SendKeyMsg=function(g,h){if(g==null){return}if(!h){h=window.event}if(h.code){var j=b(h);if(j!=null){d.SendKeyMsgKC(g,j)}}else{var j=h.keyCode;if(j==59){j=186}d.SendKeyMsgKC(g,j)}};d.SendMessage=function(g){if(d.State==3){d.send(String.fromCharCode(0,17)+d.shortToStr(4+g.length)+g)}};d.SendKeyMsgKC=function(g,j){if(d.State!=3){return}if(typeof g=="object"){for(var h in g){d.SendKeyMsgKC(g[h][0],g[h][1])}}else{d.send(String.fromCharCode(0,d.InputType.KEY,0,6,(g-1),j))}};d.sendcad=function(){d.SendCtrlAltDelMsg()};d.SendCtrlAltDelMsg=function(){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.CTRLALTDEL,0,4))}};d.SendEscKey=function(){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.KEY,0,6,0,27,0,d.InputType.KEY,0,6,1,27))}};d.SendStartMsg=function(){d.SendKeyMsgKC(d.KeyAction.EXDOWN,91);d.SendKeyMsgKC(d.KeyAction.EXUP,91)};d.SendCharmsMsg=function(){d.SendKeyMsgKC(d.KeyAction.EXDOWN,91);d.SendKeyMsgKC(d.KeyAction.DOWN,67);d.SendKeyMsgKC(d.KeyAction.UP,67);d.SendKeyMsgKC(d.KeyAction.EXUP,91)};d.SendTouchMsg1=function(h,g,j,k){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.TOUCH)+d.shortToStr(14)+String.fromCharCode(1,h)+d.intToStr(g)+d.shortToStr(j)+d.shortToStr(k))}};d.SendTouchMsg2=function(j,g){var m="";var h;var n="TOUCHSEND: ";for(var l in d.TouchArray){if(l==j){h=g}else{if(d.TouchArray[l].f==1){h=65536|2|4;d.TouchArray[l].f=3;n+="START"+l}else{if(d.TouchArray[l].f==2){h=262144;n+="STOP"+l}else{h=2|4|131072}}}m+=String.fromCharCode(l)+d.intToStr(h)+d.shortToStr(d.TouchArray[l].x)+d.shortToStr(d.TouchArray[l].y);if(d.TouchArray[l].f==2){delete d.TouchArray[l]}}if(d.State==3){d.send(String.fromCharCode(0,d.InputType.TOUCH)+d.shortToStr(5+m.length)+String.fromCharCode(2)+m)}if(Object.keys(d.TouchArray).length==0&&d.touchtimer!=null){clearInterval(d.touchtimer);d.touchtimer=null}};d.SendMouseMsg=function(g,k){if(d.State!=3){return}if(g!=null&&d.Canvas!=null){if(!k){var k=window.event}var n=(d.Canvas.canvas.height/d.CanvasId.clientHeight);var o=(d.Canvas.canvas.width/d.CanvasId.clientWidth);var m=d.GetPositionOfControl(d.Canvas.canvas);var p=((k.pageX-m[0])*o);var q=((k.pageY-m[1])*n);if(p>=0&&p<=d.Canvas.canvas.width&&q>=0&&q<=d.Canvas.canvas.height){var h=0;var j=0;if(g==d.KeyAction.UP||g==d.KeyAction.DOWN){if(k.which){((k.which==1)?(h=d.MouseButton.LEFT):((k.which==2)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}else{if(k.button){((k.button==0)?(h=d.MouseButton.LEFT):((k.button==1)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}}}else{if(g==d.KeyAction.SCROLL){if(k.detail){j=(-1*(k.detail*120))}else{if(k.wheelDelta){j=(k.wheelDelta*3)}}}}var l="";if(g==d.KeyAction.DBLCLICK){l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,136,((p/256)&255),(p&255),((q/256)&255),(q&255))}else{if(g==d.KeyAction.SCROLL){l=String.fromCharCode(0,d.InputType.MOUSE,0,12,0,0,((p/256)&255),(p&255),((q/256)&255),(q&255),((j/256)&255),(j&255))}else{l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,((g==d.KeyAction.DOWN)?h:((h*2)&255)),((p/256)&255),(p&255),((q/256)&255),(q&255))}}if(d.Action==d.KeyAction.NONE){if(d.Alternate==0||d.ipad){d.send(l);d.Alternate=1}else{d.Alternate=0}}else{d.send(l)}}}};d.GetDisplayNumbers=function(){d.send(String.fromCharCode(0,11,0,4))};d.SetDisplay=function(g){d.send(String.fromCharCode(0,12,0,6,g>>8,g&255))};d.intToStr=function(g){return String.fromCharCode((g>>24)&255,(g>>16)&255,(g>>8)&255,g&255)};d.shortToStr=function(g){return String.fromCharCode((g>>8)&255,g&255)};d.onResize=function(){if(d.ScreenWidth==0||d.ScreenHeight==0){return}if(d.Canvas.canvas.width==d.ScreenWidth&&d.Canvas.canvas.height==d.ScreenHeight){return}if(d.FirstDraw){d.Canvas.canvas.width=d.ScreenWidth;d.Canvas.canvas.height=d.ScreenHeight;d.Canvas.fillRect(0,0,d.ScreenWidth,d.ScreenHeight);if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}}d.FirstDraw=false};d.xxMouseInputGrab=false;d.xxKeyInputGrab=false;d.xxMouseMove=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.NONE,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseUp=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDown=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDblClick=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DBLCLICK,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxDOMMouseScroll=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxMouseWheel=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxKeyUp=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyDown=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyPress=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.handleKeys=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyPress(g)};d.handleKeyUp=function(g){if(d.stopInput==true||desktop.State!=3){return false}if(d.firstUpKeys.length<5){d.firstUpKeys.push(g.keyCode);if((d.firstUpKeys.length==5)){var h=d.firstUpKeys.join(",");if((h=="16,17,91,91,16")||(h=="16,17,18,91,92")){d.stopInput=true}}}return d.xxKeyUp(g)};d.handleKeyDown=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyDown(g)};d.mousedblclick=function(g){if(d.stopInput==true){return false}return d.xxMouseDblClick(g)};d.mousedown=function(g){if(d.stopInput==true){return false}return d.xxMouseDown(g)};d.mouseup=function(g){if(d.stopInput==true){return false}return d.xxMouseUp(g)};d.mousemove=function(g){if(d.stopInput==true){return false}return d.xxMouseMove(g)};d.mousewheel=function(g){if(d.stopInput==true){return false}return d.xxMouseWheel(g)};d.xxMsTouchEvent=function(g){if(g.originalEvent.pointerType==4){return}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}if(g.type=="MSPointerDown"||g.type=="MSPointerMove"||g.type=="MSPointerUp"){var h=0;var j=g.originalEvent.pointerId%256;var k=g.offsetX*(Canvas.canvas.width/d.CanvasId.clientWidth);var l=g.offsetY*(Canvas.canvas.height/d.CanvasId.clientHeight);if(g.type=="MSPointerDown"){h=65536|2|4}else{if(g.type=="MSPointerMove"){h=131072|2|4}else{if(g.type=="MSPointerUp"){h=262144}}}if(!d.TouchArray[j]){d.TouchArray[j]={x:k,y:l}}d.SendTouchMsg2(j,h);if(g.type=="MSPointerUp"){delete d.TouchArray[j]}}else{alert(g.type)}return true};d.xxTouchStart=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(KeyAction.DOWN,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(!d.TouchArray[j]){d.TouchArray[j]={x:(g.originalEvent.touches[h].pageX-k[0])*(Canvas.canvas.width/d.CanvasId.clientWidth),y:(g.originalEvent.touches[h].pageY-k[1])*(Canvas.canvas.height/d.CanvasId.clientHeight),f:1}}}if(Object.keys(d.TouchArray).length>0&&touchtimer==null){d.touchtimer=setInterval(function(){d.SendTouchMsg2(256,0)},50)}}};d.xxTouchMove=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(d.KeyAction.NONE,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].x=(g.originalEvent.touches[h].pageX-k[0])*(d.Canvas.canvas.width/d.CanvasId.clientWidth);d.TouchArray[j].y=(g.originalEvent.touches[h].pageY-k[1])*(d.Canvas.canvas.height/d.CanvasId.clientHeight)}}}};d.xxTouchEnd=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}g.which=1;g.pageX=LastX;g.pageY=LastY;d.SendMouseMsg(KeyAction.UP,g)}else{for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].f=2}}}};d.GrabMouseInput=function(){if(d.xxMouseInputGrab==true){return}var g=d.CanvasId;g.onmousemove=d.xxMouseMove;g.onmouseup=d.xxMouseUp;g.onmousedown=d.xxMouseDown;g.touchstart=d.xxTouchStart;g.touchmove=d.xxTouchMove;g.touchend=d.xxTouchEnd;g.MSPointerDown=d.xxMsTouchEvent;g.MSPointerMove=d.xxMsTouchEvent;g.MSPointerUp=d.xxMsTouchEvent;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=d.xxDOMMouseScroll}else{g.onmousewheel=d.xxMouseWheel}d.xxMouseInputGrab=true};d.UnGrabMouseInput=function(){if(d.xxMouseInputGrab==false){return}var g=d.CanvasId;g.onmousemove=null;g.onmouseup=null;g.onmousedown=null;g.touchstart=null;g.touchmove=null;g.touchend=null;g.MSPointerDown=null;g.MSPointerMove=null;g.MSPointerUp=null;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=null}else{g.onmousewheel=null}d.xxMouseInputGrab=false};d.GrabKeyInput=function(){if(d.xxKeyInputGrab==true){return}document.onkeyup=d.xxKeyUp;document.onkeydown=d.xxKeyDown;document.onkeypress=d.xxKeyPress;d.xxKeyInputGrab=true};d.UnGrabKeyInput=function(){if(d.xxKeyInputGrab==false){return}document.onkeyup=null;document.onkeydown=null;document.onkeypress=null;d.xxKeyInputGrab=false};d.GetPositionOfControl=function(g){var h=Array(2);h[0]=h[1]=0;while(g){h[0]+=g.offsetLeft;h[1]+=g.offsetTop;g=g.offsetParent}return h};d.crotX=function(g,h){if(d.rotation==0){return g}if(d.rotation==1){return h}if(d.rotation==2){return d.Canvas.canvas.width-g}if(d.rotation==3){return d.Canvas.canvas.height-h}};d.crotY=function(g,h){if(d.rotation==0){return h}if(d.rotation==1){return d.Canvas.canvas.width-g}if(d.rotation==2){return d.Canvas.canvas.height-h}if(d.rotation==3){return g}};d.rotX=function(g,h){if(d.rotation==0||d.rotation==1){return g}if(d.rotation==2){return g-d.Canvas.canvas.width}if(d.rotation==3){return g-d.Canvas.canvas.height}};d.rotY=function(g,h){if(d.rotation==0||d.rotation==3){return h}if(d.rotation==1){return h-d.Canvas.canvas.width}if(d.rotation==2){return h-d.Canvas.canvas.height}};d.tcanvas=null;d.setRotation=function(l){while(l<0){l+=4}var g=l%4;if(g==d.rotation){return true}var j=d.Canvas.canvas.width;var h=d.Canvas.canvas.height;if(d.rotation==1||d.rotation==3){j=d.Canvas.canvas.height;h=d.Canvas.canvas.width}if(d.tcanvas==null){d.tcanvas=document.createElement("canvas")}var k=d.tcanvas.getContext("2d");k.setTransform(1,0,0,1,0,0);k.canvas.width=j;k.canvas.height=h;k.rotate((d.rotation*-90)*Math.PI/180);if(d.rotation==0){k.drawImage(d.Canvas.canvas,0,0)}if(d.rotation==1){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,0)}if(d.rotation==2){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,-d.Canvas.canvas.height)}if(d.rotation==3){k.drawImage(d.Canvas.canvas,0,-d.Canvas.canvas.height)}if(d.rotation==0||d.rotation==2){d.Canvas.canvas.height=j;d.Canvas.canvas.width=h}if(d.rotation==1||d.rotation==3){d.Canvas.canvas.height=h;d.Canvas.canvas.width=j}d.Canvas.setTransform(1,0,0,1,0,0);d.Canvas.rotate((g*90)*Math.PI/180);d.rotation=g;d.Canvas.drawImage(d.tcanvas,d.rotX(0,0),d.rotY(0,0));d.ScreenWidth=d.Canvas.canvas.width;d.ScreenHeight=d.Canvas.canvas.height;if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}return true};d.MuchTheSame=function(g,h){return(Math.abs(g-h)<4)};d.Debug=function(g){console.log(g)};d.getIEVersion=function(){var g=-1;if(navigator.appName=="Microsoft Internet Explorer"){var j=navigator.userAgent;var h=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(h.exec(j)!=null){g=parseFloat(RegExp.$1)}}return g};d.haltEvent=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};return d};var QRCode;!function(){function t(c){this.mode=v.MODE_8BIT_BYTE,this.data=c,this.parsedData=[];for(var g=[],h=0,j=this.data.length;j>h;h++){var k=this.data.charCodeAt(h);k>65536?(g[0]=240|(1835008&k)>>>18,g[1]=128|(258048&k)>>>12,g[2]=128|(4032&k)>>>6,g[3]=128|63&k):k>2048?(g[0]=224|(61440&k)>>>12,g[1]=128|(4032&k)>>>6,g[2]=128|63&k):k>128?(g[0]=192|(1984&k)>>>6,g[1]=128|63&k):g[0]=k,this.parsedData=this.parsedData.concat(g)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function u(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function B(e,g){if(void 0==e.length){throw new Error(e.length+"/"+g)}for(var h=0;h<e.length&&0==e[h];){h++}this.num=new Array(e.length-h+g);for(var j=0;j<e.length-h;j++){this.num[j]=e[j+h]}}function C(c,d){this.totalCount=c,this.dataCount=d}function D(){this.buffer=[],this.length=0}function F(){return"undefined"!=typeof CanvasRenderingContext2D}function G(){var c=!1,d=navigator.userAgent;return/android/i.test(d)&&(c=!0,aMat=d.toString().match(/android ([0-9]\.[0-9])/i),aMat&&aMat[1]&&(c=parseFloat(aMat[1]))),c}function K(d,j){for(var k=1,l=L(d),m=0,n=E.length;n>=m;m++){var o=0;switch(j){case w.L:o=E[m][0];break;case w.M:o=E[m][1];break;case w.Q:o=E[m][2];break;case w.H:o=E[m][3]}if(o>=l){break}k++}if(k>E.length){throw new Error("Too long data")}return k}function L(c){var d=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=c?3:0)}t.prototype={getLength:function(){return this.parsedData.length},write:function(d){for(var e=0,g=this.parsedData.length;g>e;e++){d.put(this.parsedData[e],8)}}},u.prototype={addData:function(a){var d=new t(a);this.dataList.push(d),this.dataCache=null},isDark:function(c,d){if(0>c||this.moduleCount<=c||0>d||this.moduleCount<=d){throw new Error(c+","+d)}return this.modules[c][d]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(b,g){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var h=0;h<this.moduleCount;h++){this.modules[h]=new Array(this.moduleCount);for(var j=0;j<this.moduleCount;j++){this.modules[h][j]=null}}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(b,g),this.typeNumber>=7&&this.setupTypeNumber(b),null==this.dataCache&&(this.dataCache=u.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,g)},setupPositionProbePattern:function(e,g){for(var h=-1;7>=h;h++){if(!(-1>=e+h||this.moduleCount<=e+h)){for(var j=-1;7>=j;j++){-1>=g+j||this.moduleCount<=g+j||(this.modules[e+h][g+j]=h>=0&&6>=h&&(0==j||6==j)||j>=0&&6>=j&&(0==h||6==h)||h>=2&&4>=h&&j>=2&&4>=j?!0:!1)}}}},getBestMaskPattern:function(){for(var e=0,g=0,h=0;8>h;h++){this.makeImpl(!0,h);var j=y.getLostPoint(this);(0==h||e>j)&&(e=j,g=h)}return g},createMovieClip:function(k,l,m){var n=k.createEmptyMovieClip(l,m),o=1;this.make();for(var p=0;p<this.modules.length;p++){for(var q=p*o,r=0;r<this.modules[p].length;r++){var s=r*o,M=this.modules[p][r];M&&(n.beginFill(0,100),n.moveTo(s,q),n.lineTo(s+o,q),n.lineTo(s+o,q+o),n.lineTo(s,q+o),n.endFill())}}return n},setupTimingPattern:function(){for(var c=8;c<this.moduleCount-8;c++){null==this.modules[c][6]&&(this.modules[c][6]=0==c%2)}for(var d=8;d<this.moduleCount-8;d++){null==this.modules[6][d]&&(this.modules[6][d]=0==d%2)}},setupPositionAdjustPattern:function(){for(var j=y.getPatternPosition(this.typeNumber),k=0;k<j.length;k++){for(var l=0;l<j.length;l++){var m=j[k],n=j[l];if(null==this.modules[m][n]){for(var o=-2;2>=o;o++){for(var p=-2;2>=p;p++){this.modules[m+o][n+p]=-2==o||2==o||-2==p||2==p||0==o&&0==p?!0:!1}}}}}},setupTypeNumber:function(e){for(var g=y.getBCHTypeNumber(this.typeNumber),h=0;18>h;h++){var j=!e&&1==(1&g>>h);this.modules[Math.floor(h/3)][h%3+this.moduleCount-8-3]=j}for(var h=0;18>h;h++){var j=!e&&1==(1&g>>h);this.modules[h%3+this.moduleCount-8-3][Math.floor(h/3)]=j}},setupTypeInfo:function(h,j){for(var k=this.errorCorrectLevel<<3|j,l=y.getBCHTypeInfo(k),m=0;15>m;m++){var n=!h&&1==(1&l>>m);6>m?this.modules[m][8]=n:8>m?this.modules[m+1][8]=n:this.modules[this.moduleCount-15+m][8]=n}for(var m=0;15>m;m++){var n=!h&&1==(1&l>>m);8>m?this.modules[8][this.moduleCount-m-1]=n:9>m?this.modules[8][15-m-1+1]=n:this.modules[8][15-m-1]=n}this.modules[this.moduleCount-8][8]=!h},mapData:function(l,m){for(var n=-1,o=this.moduleCount-1,p=7,q=0,r=this.moduleCount-1;r>0;r-=2){for(6==r&&r--;;){for(var s=0;2>s;s++){if(null==this.modules[o][r-s]){var M=!1;q<l.length&&(M=1==(1&l[q]>>>p));var N=y.getMask(m,o,r-s);N&&(M=!M),this.modules[o][r-s]=M,p--,-1==p&&(q++,p=7)}}if(o+=n,0>o||this.moduleCount<=o){o-=n,n=-n;break}}}}},u.PAD0=236,u.PAD1=17,u.createData=function(b,j,k){for(var m=C.getRSBlocks(b,j),n=new D,o=0;o<k.length;o++){var p=k[o];n.put(p.mode,4),n.put(p.getLength(),y.getLengthInBits(p.mode,b)),p.write(n)}for(var q=0,o=0;o<m.length;o++){q+=m[o].dataCount}if(n.getLengthInBits()>8*q){throw new Error("code length overflow. ("+n.getLengthInBits()+">"+8*q+")")}for(n.getLengthInBits()+4<=8*q&&n.put(0,4);0!=n.getLengthInBits()%8;){n.putBit(!1)}for(;;){if(n.getLengthInBits()>=8*q){break}if(n.put(u.PAD0,8),n.getLengthInBits()>=8*q){break}n.put(u.PAD1,8)}return u.createBytes(n,m)},u.createBytes=function(M,N){for(var O=0,P=0,R=0,S=new Array(N.length),T=new Array(N.length),U=0;U<N.length;U++){var V=N[U].dataCount,W=N[U].totalCount-V;P=Math.max(P,V),R=Math.max(R,W),S[U]=new Array(V);for(var X=0;X<S[U].length;X++){S[U][X]=255&M.buffer[X+O]}O+=V;var Y=y.getErrorCorrectPolynomial(W),Z=new B(S[U],Y.getLength()-1),aa=Z.mod(Y);T[U]=new Array(Y.getLength()-1);for(var X=0;X<T[U].length;X++){var ab=X+aa.getLength()-T[U].length;T[U][X]=ab>=0?aa.get(ab):0}}for(var ac=0,X=0;X<N.length;X++){ac+=N[X].totalCount}for(var ad=new Array(ac),ae=0,X=0;P>X;X++){for(var U=0;U<N.length;U++){X<S[U].length&&(ad[ae++]=S[U][X])}}for(var X=0;R>X;X++){for(var U=0;U<N.length;U++){X<T[U].length&&(ad[ae++]=T[U][X])}}return ad};for(var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},w={L:1,M:0,Q:3,H:2},x={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},y={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(c){for(var d=c<<10;y.getBCHDigit(d)-y.getBCHDigit(y.G15)>=0;){d^=y.G15<<y.getBCHDigit(d)-y.getBCHDigit(y.G15)}return(c<<10|d)^y.G15_MASK},getBCHTypeNumber:function(c){for(var d=c<<12;y.getBCHDigit(d)-y.getBCHDigit(y.G18)>=0;){d^=y.G18<<y.getBCHDigit(d)-y.getBCHDigit(y.G18)}return c<<12|d},getBCHDigit:function(c){for(var d=0;0!=c;){d++,c>>>=1}return d},getPatternPosition:function(b){return y.PATTERN_POSITION_TABLE[b-1]},getMask:function(d,e,g){switch(d){case x.PATTERN000:return 0==(e+g)%2;case x.PATTERN001:return 0==e%2;case x.PATTERN010:return 0==g%3;case x.PATTERN011:return 0==(e+g)%3;case x.PATTERN100:return 0==(Math.floor(e/2)+Math.floor(g/3))%2;case x.PATTERN101:return 0==e*g%2+e*g%3;case x.PATTERN110:return 0==(e*g%2+e*g%3)%2;case x.PATTERN111:return 0==(e*g%3+(e+g)%2)%2;default:throw new Error("bad maskPattern:"+d)}},getErrorCorrectPolynomial:function(d){for(var e=new B([1],0),g=0;d>g;g++){e=e.multiply(new B([1,z.gexp(g)],0))}return e},getLengthInBits:function(c,d){if(d>=1&&10>d){switch(c){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:return 8;case v.MODE_KANJI:return 8;default:throw new Error("mode:"+c)}}else{if(27>d){switch(c){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw new Error("mode:"+c)}}else{if(!(41>d)){throw new Error("type:"+d)}switch(c){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw new Error("mode:"+c)}}}},getLostPoint:function(m){for(var n=m.getModuleCount(),o=0,p=0;n>p;p++){for(var q=0;n>q;q++){for(var r=0,s=m.isDark(p,q),M=-1;1>=M;M++){if(!(0>p+M||p+M>=n)){for(var N=-1;1>=N;N++){0>q+N||q+N>=n||(0!=M||0!=N)&&s==m.isDark(p+M,q+N)&&r++}}}r>5&&(o+=3+r-5)}}for(var p=0;n-1>p;p++){for(var q=0;n-1>q;q++){var O=0;m.isDark(p,q)&&O++,m.isDark(p+1,q)&&O++,m.isDark(p,q+1)&&O++,m.isDark(p+1,q+1)&&O++,(0==O||4==O)&&(o+=3)}}for(var p=0;n>p;p++){for(var q=0;n-6>q;q++){m.isDark(p,q)&&!m.isDark(p,q+1)&&m.isDark(p,q+2)&&m.isDark(p,q+3)&&m.isDark(p,q+4)&&!m.isDark(p,q+5)&&m.isDark(p,q+6)&&(o+=40)}}for(var q=0;n>q;q++){for(var p=0;n-6>p;p++){m.isDark(p,q)&&!m.isDark(p+1,q)&&m.isDark(p+2,q)&&m.isDark(p+3,q)&&m.isDark(p+4,q)&&!m.isDark(p+5,q)&&m.isDark(p+6,q)&&(o+=40)}}for(var P=0,q=0;n>q;q++){for(var p=0;n>p;p++){m.isDark(p,q)&&P++}}var R=Math.abs(100*P/n/n-50)/5;return o+=10*R}},z={glog:function(b){if(1>b){throw new Error("glog("+b+")")}return z.LOG_TABLE[b]},gexp:function(b){for(;0>b;){b+=255}for(;b>=256;){b-=255}return z.EXP_TABLE[b]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},A=0;8>A;A++){z.EXP_TABLE[A]=1<<A}for(var A=8;256>A;A++){z.EXP_TABLE[A]=z.EXP_TABLE[A-4]^z.EXP_TABLE[A-5]^z.EXP_TABLE[A-6]^z.EXP_TABLE[A-8]}for(var A=0;255>A;A++){z.LOG_TABLE[z.EXP_TABLE[A]]=A}B.prototype={get:function(b){return this.num[b]},getLength:function(){return this.num.length},multiply:function(e){for(var g=new Array(this.getLength()+e.getLength()-1),h=0;h<this.getLength();h++){for(var j=0;j<e.getLength();j++){g[h+j]^=z.gexp(z.glog(this.get(h))+z.glog(e.get(j)))}}return new B(g,0)},mod:function(e){if(this.getLength()-e.getLength()<0){return this}for(var g=z.glog(this.get(0))-z.glog(e.get(0)),h=new Array(this.getLength()),j=0;j<this.getLength();j++){h[j]=this.get(j)}for(var j=0;j<e.getLength();j++){h[j]^=z.gexp(z.glog(e.get(j))+g)}return new B(h,0).mod(e)}},C.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],C.getRSBlocks=function(j,l){var m=C.getRsBlockTable(j,l);if(void 0==m){throw new Error("bad rs block @ typeNumber:"+j+"/errorCorrectLevel:"+l)}for(var n=m.length/3,o=[],p=0;n>p;p++){for(var q=m[3*p+0],r=m[3*p+1],s=m[3*p+2],M=0;q>M;M++){o.push(new C(r,s))}}return o},C.getRsBlockTable=function(c,d){switch(d){case w.L:return C.RS_BLOCK_TABLE[4*(c-1)+0];case w.M:return C.RS_BLOCK_TABLE[4*(c-1)+1];case w.Q:return C.RS_BLOCK_TABLE[4*(c-1)+2];case w.H:return C.RS_BLOCK_TABLE[4*(c-1)+3];default:return void 0}},D.prototype={get:function(c){var d=Math.floor(c/8);return 1==(1&this.buffer[d]>>>7-c%8)},put:function(d,e){for(var g=0;e>g;g++){this.putBit(1==(1&d>>>e-g-1))}},getLengthInBits:function(){return this.length},putBit:function(c){var d=Math.floor(this.length/8);this.buffer.length<=d&&this.buffer.push(0),c&&(this.buffer[d]|=128>>>this.length%8),this.length++}};var E=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],H=function(){var b=function(c,d){this._el=c,this._htOption=d};return b.prototype.draw=function(e){function o(g,h){var j=document.createElementNS("http://www.w3.org/2000/svg",g);for(var k in h){h.hasOwnProperty(k)&&j.setAttribute(k,h[k])}return j}var l=this._htOption,m=this._el,n=e.getModuleCount();Math.floor(l.width/n),Math.floor(l.height/n),this.clear();var p=o("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:l.colorLight});p.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),m.appendChild(p),p.appendChild(o("rect",{fill:l.colorDark,width:"1",height:"1",id:"template"}));for(var q=0;n>q;q++){for(var r=0;n>r;r++){if(e.isDark(q,r)){var s=o("use",{x:String(q),y:String(r)});s.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),p.appendChild(s)}}}},b.prototype.clear=function(){for(;this._el.hasChildNodes();){this._el.removeChild(this._el.lastChild)}},b}(),I="svg"===document.documentElement.tagName.toLowerCase(),J=I?H:F()?function(){function g(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function k(m,n){var o=this;if(o._fFail=n,o._fSuccess=m,null===o._bSupportDataURI){var p=document.createElement("img"),q=function(){o._bSupportDataURI=!1,o._fFail&&_fFail.call(o)},r=function(){o._bSupportDataURI=!0,o._fSuccess&&o._fSuccess.call(o)};return p.onabort=q,p.onerror=q,p.onload=r,p.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",void 0}o._bSupportDataURI===!0&&o._fSuccess?o._fSuccess.call(o):o._bSupportDataURI===!1&&o._fFail&&o._fFail.call(o)}if(this._android&&this._android<=2.1){var h=1/window.devicePixelRatio,j=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(b,c,m,n,o,p,q,r){if("nodeName" in b&&/img/i.test(b.nodeName)){for(var s=arguments.length-1;s>=1;s--){arguments[s]=arguments[s]*h}}else{"undefined"==typeof r&&(arguments[1]*=h,arguments[2]*=h,arguments[3]*=h,arguments[4]*=h)}j.apply(this,arguments)}}var l=function(c,d){this._bIsPainted=!1,this._android=G(),this._htOption=d,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=d.width,this._elCanvas.height=d.height,c.appendChild(this._elCanvas),this._el=c,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return l.prototype.draw=function(o){var p=this._elImage,q=this._oContext,r=this._htOption,s=o.getModuleCount(),M=r.width/s,N=r.height/s,O=Math.round(M),P=Math.round(N);p.style.display="none",this.clear();for(var R=0;s>R;R++){for(var S=0;s>S;S++){var T=o.isDark(R,S),U=S*M,V=R*N;q.strokeStyle=T?r.colorDark:r.colorLight,q.lineWidth=1,q.fillStyle=T?r.colorDark:r.colorLight,q.fillRect(U,V,M,N),q.strokeRect(Math.floor(U)+0.5,Math.floor(V)+0.5,O,P),q.strokeRect(Math.ceil(U)-0.5,Math.ceil(V)-0.5,O,P)}}this._bIsPainted=!0},l.prototype.makeImage=function(){this._bIsPainted&&k.call(this,g)},l.prototype.isPainted=function(){return this._bIsPainted},l.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},l.prototype.round=function(b){return b?Math.floor(1000*b)/1000:b},l}():function(){var b=function(c,d){this._el=c,this._htOption=d};return b.prototype.draw=function(m){for(var n=this._htOption,o=this._el,p=m.getModuleCount(),q=Math.floor(n.width/p),r=Math.floor(n.height/p),s=['<table style="border:0;border-collapse:collapse;">'],M=0;p>M;M++){s.push("<tr>");for(var N=0;p>N;N++){s.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+q+"px;height:"+r+"px;background-color:"+(m.isDark(M,N)?n.colorDark:n.colorLight)+';"></td>')}s.push("</tr>")}s.push("</table>"),o.innerHTML=s.join("");var O=o.childNodes[0],P=(n.width-O.offsetWidth)/2,R=(n.height-O.offsetHeight)/2;P>0&&R>0&&(O.style.margin=R+"px "+P+"px")},b.prototype.clear=function(){this._el.innerHTML=""},b}();QRCode=function(d,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:w.H},"string"==typeof e&&(e={text:e}),e){for(var g in e){this._htOption[g]=e[g]}}"string"==typeof d&&(d=document.getElementById(d)),this._android=G(),this._el=d,this._oQRCode=null,this._oDrawing=new J(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(b){this._oQRCode=new u(K(b,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(b),this._oQRCode.make(),this._el.title=b,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=w}();"use strict";if(!window.u2f){var u2f=u2f||{};var js_api_version;u2f.EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd";u2f.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"};u2f.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5};u2f.U2fRequest;u2f.U2fResponse;u2f.Error;u2f.Transport;u2f.Transports;u2f.SignRequest;u2f.SignResponse;u2f.RegisterRequest;u2f.RegisterResponse;u2f.RegisteredKey;u2f.GetJsApiVersionResponse;u2f.getMessagePort=function(a){if(typeof chrome!="undefined"&&chrome.runtime){var b={type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]};chrome.runtime.sendMessage(u2f.EXTENSION_ID,b,function(){if(!chrome.runtime.lastError){u2f.getChromeRuntimePort_(a)}else{u2f.getIframePort_(a)}})}else{if(u2f.isAndroidChrome_()){u2f.getAuthenticatorPort_(a)}else{if(u2f.isIosChrome_()){u2f.getIosPort_(a)}else{u2f.getIframePort_(a)}}}};u2f.isAndroidChrome_=function(){var a=navigator.userAgent;return a.indexOf("Chrome")!=-1&&a.indexOf("Android")!=-1};u2f.isIosChrome_=function(){var b=["iPhone","iPad","iPod"];for(var a in b){if(navigator.platform==b[a]){return true}}return false};u2f.getChromeRuntimePort_=function(a){var b=chrome.runtime.connect(u2f.EXTENSION_ID,{includeTlsChannelId:true});setTimeout(function(){a(new u2f.WrappedChromeRuntimePort_(b))},0)};u2f.getAuthenticatorPort_=function(a){setTimeout(function(){a(new u2f.WrappedAuthenticatorPort_())},0)};u2f.getIosPort_=function(a){setTimeout(function(){a(new u2f.WrappedIosPort_())},0)};u2f.WrappedChromeRuntimePort_=function(a){this.port_=a};u2f.formatSignRequest_=function(a,b,d,h,e){if(js_api_version===undefined||js_api_version<1.1){var g=[];for(var c=0;c<d.length;c++){g[c]={version:d[c].version,challenge:b,keyHandle:d[c].keyHandle,appId:a}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:g,timeoutSeconds:h,requestId:e}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:a,challenge:b,registeredKeys:d,timeoutSeconds:h,requestId:e}};u2f.formatRegisterRequest_=function(a,c,d,h,e){if(js_api_version===undefined||js_api_version<1.1){for(var b=0;b<d.length;b++){d[b].appId=a}var g=[];for(var b=0;b<c.length;b++){g[b]={version:c[b].version,challenge:d[0],keyHandle:c[b].keyHandle,appId:a}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:g,registerRequests:d,timeoutSeconds:h,requestId:e}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:a,registerRequests:d,registeredKeys:c,timeoutSeconds:h,requestId:e}};u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(a){this.port_.postMessage(a)};u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c=="message"||c=="onmessage"){this.port_.onMessage.addListener(function(d){b({data:d})})}else{console.error("WrappedChromeRuntimePort only supports onMessage")}};u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1;this.requestObject_=null};u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(b){var a=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(b))+";end";document.location=a};u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"};u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c=="message"){var d=this;window.addEventListener("message",d.onRequestUpdate_.bind(d,b),false)}else{console.error("WrappedAuthenticatorPort only supports message")}};u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(a,d){var e=JSON.parse(d.data);var c=e.intentURL;var b=e.errorCode;var g=null;if(e.hasOwnProperty("data")){g=(JSON.parse(e.data))}a({data:g})};u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE";u2f.WrappedIosPort_=function(){};u2f.WrappedIosPort_.prototype.postMessage=function(a){var b=JSON.stringify(a);var c="u2f://auth?"+encodeURI(b);location.replace(c)};u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"};u2f.WrappedIosPort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c!=="message"){console.error("WrappedIosPort only supports message")}};u2f.getIframePort_=function(a){var d="chrome-extension://"+u2f.EXTENSION_ID;var c=document.createElement("iframe");c.src=d+"/u2f-comms.html";c.setAttribute("style","display:none");document.body.appendChild(c);var b=new MessageChannel();var e=function(g){if(g.data=="ready"){b.port1.removeEventListener("message",e);a(b.port1)}else{console.error('First event on iframe port was not "ready"')}};b.port1.addEventListener("message",e);b.port1.start();c.addEventListener("load",function(){c.contentWindow.postMessage("init",d,[b.port2])})};u2f.EXTENSION_TIMEOUT_SEC=30;u2f.port_=null;u2f.waitingForPort_=[];u2f.reqCounter_=0;u2f.callbackMap_={};u2f.getPortSingleton_=function(a){if(u2f.port_){a(u2f.port_)}else{if(u2f.waitingForPort_.length==0){u2f.getMessagePort(function(b){u2f.port_=b;u2f.port_.addEventListener("message",(u2f.responseHandler_));while(u2f.waitingForPort_.length){u2f.waitingForPort_.shift()(u2f.port_)}})}u2f.waitingForPort_.push(a)}};u2f.responseHandler_=function(b){var d=b.data;var c=d.requestId;if(!c||!u2f.callbackMap_[c]){console.error("Unknown or missing requestId in response.");return}var a=u2f.callbackMap_[c];delete u2f.callbackMap_[c];a(d.responseData)};u2f.sign=function(a,c,e,b,d){if(js_api_version===undefined){u2f.getApiVersion(function(g){js_api_version=g.js_api_version===undefined?0:g.js_api_version;u2f.sendSignRequest(a,c,e,b,d)})}else{u2f.sendSignRequest(a,c,e,b,d)}};u2f.sendSignRequest=function(a,c,e,b,d){u2f.getPortSingleton_(function(g){var j=++u2f.reqCounter_;u2f.callbackMap_[j]=b;var k=(typeof d!=="undefined"?d:u2f.EXTENSION_TIMEOUT_SEC);var h=u2f.formatSignRequest_(a,c,e,k,j);g.postMessage(h)})};u2f.register=function(a,e,d,b,c){if(js_api_version===undefined){u2f.getApiVersion(function(g){js_api_version=g.js_api_version===undefined?0:g.js_api_version;u2f.sendRegisterRequest(a,e,d,b,c)})}else{u2f.sendRegisterRequest(a,e,d,b,c)}};u2f.sendRegisterRequest=function(a,e,d,b,c){u2f.getPortSingleton_(function(g){var j=++u2f.reqCounter_;u2f.callbackMap_[j]=b;var k=(typeof c!=="undefined"?c:u2f.EXTENSION_TIMEOUT_SEC);var h=u2f.formatRegisterRequest_(a,d,e,k,j);g.postMessage(h)})};u2f.getApiVersion=function(a,b){u2f.getPortSingleton_(function(d){if(d.getPortType){var c;switch(d.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":c=1.1;break;default:c=0;break}a({js_api_version:c});return}var g=++u2f.reqCounter_;u2f.callbackMap_[g]=a;var e={type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:(typeof b!=="undefined"?b:u2f.EXTENSION_TIMEOUT_SEC),requestId:g};d.postMessage(e)})}}"use strict";var args;var autoReconnect=true;var powerStatetable=["","Powered","Sleep","Sleep","Sleep","Hibernating","Power off","Present"];var StatusStrs=["Disconnected","Connecting...","Setup...","Connected","Intel® AMT Connected"];var sort=0;var searchFocus=0;var mapSearchFocus=0;var userSearchFocus=0;var consoleFocus=0;var showRealNames=false;var meshserver=null;var meshes={};var meshcount=0;var nodes=null;var filetree={};var userinfo=null;var serverinfo=null;var events=[];var users=null;var wssessions=null;var nodeShortIdent=0;var desktop;var desktopsettings={encoding:2,showfocus:false,showmouse:true,showcad:true,quality:40,scaling:1024,framerate:50};var multidesktopsettings={quality:20,scaling:128,framerate:1000};var terminal;var files;var debugLevel=parseInt("{{{debuglevel}}}");var features=parseInt("{{{features}}}");var sessionTime=parseInt("{{{sessiontime}}}");var domain="{{{domain}}}";var domainUrl="{{{domainurl}}}";var authCookie="{{{authCookie}}}";var authCookieRenewTimer=null;var multiDesktop={};var multiDesktopFilter=null;var serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}";var amtScanResults=null;var debugmode=0;var clickOnce=(((features&256)!=0)&&detectClickOnce());var attemptWebRTC=((features&128)!=0);var webPageFullScreen=getstore("webPageFullScreen",true);if(webPageFullScreen=="false"){webPageFullScreen=false}if(webPageFullScreen=="true"){webPageFullScreen=true}var passRequirements="{{{passRequirements}}}";if(passRequirements!=""){passRequirements=JSON.parse(decodeURIComponent(passRequirements))}function startup(){if((features&32)==0){var h=null;try{h=top.location.toString().toLowerCase()}catch(b){}if(top!=self&&(h==null||top.active==false)){top.location=self.location;return}}args=parseUriArgs();debugmode=args.debug;if(args.webrtc!=null){attemptWebRTC=(args.webrtc==1)}QV("p13AutoConnect",debugmode);QV("autoconnectbutton2",debugmode);QV("autoconnectbutton1",debugmode);QV("DeskClip",debugmode);toggleFullScreen();if(args.hide){var d=parseInt(args.hide);QV("masthead",!(d&1));QV("topbarmaster",!(d&2));QV("footer",!(d&4));QV("p10title",!(d&8));QV("p11title",!(d&8));QV("p12title",!(d&8));QV("p13title",!(d&8));QV("p14title",!(d&8));QV("p15title",!(d&8));QV("p16title",!(d&8));if(d&16){QV("page_leftbar",false);QS("page_content").left="0px"}}if("{{currentNode}}"!=""){QV("p10BackButton",false);QV("p11BackButton",false);QV("p12BackButton",false);QV("p13BackButton",false);QV("p14BackButton",false);QV("p15BackButton",false);QV("p16BackButton",false)}p1updateInfo();document.onclick=function(c){hideContextMenu()};document.onkeypress=ondockeypress;document.onkeydown=ondockeydown;document.onkeyup=ondockeyup;window.onresize=function(){masterUpdate(512)};masterUpdate(512);meshserver=MeshServerCreateControl(domainUrl,authCookie);meshserver.onStateChanged=onStateChanged;meshserver.onMessage=onMessage;meshserver.Start();Q("sortselect").selectedIndex=sort=getstore("sort",0);Q("sizeselect").selectedIndex=getstore("viewsize",1);Q("SearchInput").value=getstore("search","");showRealNames=(getstore("showRealNames",0)==1);Q("RealNameCheckBox").checked=showRealNames;Q("viewselect").value=getstore("deviceView",1);Q("DeskControl").checked=(getstore("DeskControl",1)==1);masterUpdate(3);for(var g=1;g<5;g++){Q("devViewButton"+g).classList.remove("viewSelectorSel")}Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel");Q("p5filetable").addEventListener("drop",p5fileDragDrop,false);Q("p5filetable").addEventListener("dragover",p5fileDragOver,false);Q("p5filetable").addEventListener("dragleave",p5fileDragLeave,false);Q("p13filetable").addEventListener("drop",p13fileDragDrop,false);Q("p13filetable").addEventListener("dragover",p13fileDragOver,false);Q("p13filetable").addEventListener("dragleave",p13fileDragLeave,false);setInterval(updateDeviceTimeline,120000);var k=localStorage.getItem("desktopsettings");if(k!=null){desktopsettings=JSON.parse(k)}k=localStorage.getItem("multidesktopsettings");if(k!=null){multidesktopsettings=JSON.parse(k)}applyDesktopSettings();var l="";for(var a=1;a<27;a++){l+="<option value='"+a+"'>Ctrl-"+String.fromCharCode(64+a)+" ("+a+")</option>"}QH("specialkeylist",l);setupServerStats()}function toggleFullScreen(b){if(b===1){webPageFullScreen=!webPageFullScreen;putstore("webPageFullScreen",webPageFullScreen)}var a=0;if(args.hide){a=parseInt(args.hide)}if(webPageFullScreen==false){QS("container").width="960px";QS("container")["border-right"]="1px solid #b7b7b7";QS("container")["border-left"]="1px solid #b7b7b7";QS("container")["min-width"]="960px";QS("container")["overflow"]="";QS("column_l").width="930px";QS("column_l").height="";QS("column_l")["margin-left"]="";QS("column_l")["overflow-y"]="";QS("column_l")["max-height"]=(xxcurrentView>=10)?"calc(100vh - 159px)":"calc(100vh - 135px)";QS("container").position="";QS("page_content").position="";QV("MainMenuSpan",true);QV("UserDummyMenuSpan",false);QV("page_leftbar",false)}else{QS("container").position="absolute";QS("container").width="100%";QS("container").top="0px";QS("container").bottom="0px";QS("container")["border-right"]="0";QS("container")["border-left"]="0";QS("container")["min-width"]="700px";QS("container")["overflow"]="hidden";QS("page_content").position="absolute";QS("page_content").top="66px";QS("page_content").left=(a&16)?"0px":"90px";QS("page_content").right="0px";QS("page_content").bottom="0px";QS("column_l").height="calc(100vh - 135px)";QS("column_l").width="calc(100% - 30px)";QS("column_l")["overflow-y"]="auto";QS("column_l")["max-height"]="calc(100vh - 135px)";QV("MainMenuSpan",false);QV("UserDummyMenuSpan",(xxcurrentView<10)&&webPageFullScreen);QV("page_leftbar",!(a&16))}masterUpdate(512);QV("body",true)}function getNodeFromId(b){if(nodes!=null){for(var a in nodes){if(nodes[a]._id==b){return nodes[a]}}}return null}function reload(){window.location.href=window.location.href}function onStateChanged(c,d,b,a){if(d==0){setDialogMode(0);go(0);powerTimeline=null;powerTimelineReq=null;powerTimelineNode=null;powerTimelineUpdate=null;deleteAllNotifications();hideContextMenu();QV("verifyEmailId2",false);QV("logoutControl",false);if(a=="noauth"){QH("p0span","Unable to perform authentication");return}if(b==2){if(autoReconnect){setTimeout(serverPoll,5000)}}else{QH("p0span","Unable to connect web socket")}if(authCookieRenewTimer!=null){clearInterval(authCookieRenewTimer);authCookieRenewTimer=null}}else{if(d==2){meshserver.send({action:"meshes"});meshserver.send({action:"nodes",id:"{{currentNode}}"});if("{{currentNode}}"==""){meshserver.send({action:"files"})}go(1);authCookieRenewTimer=setInterval(function(){meshserver.send({action:"authcookie"})},1800000)}}}function serverPoll(){var b=null;try{b=new XDomainRequest()}catch(a){}if(!b){b=new XMLHttpRequest()}b.open("HEAD",window.location.href);b.timeout=15000;b.onload=function(){reload()};b.onerror=b.ontimeout=function(){setTimeout(serverPoll,10000)};b.send()}function detectClickOnce(){for(var a in window.navigator.mimeTypes){if(window.navigator.mimeTypes[a].type=="application/x-ms-application"){return true}}var b=window.navigator.userAgent.toUpperCase();return(b.indexOf(".NET CLR 3.5")>=0)||(b.indexOf("(WINDOWS NT ")>=0)}function updateSiteAdmin(){var a="{{{noServerBackup}}}";var b=userinfo.siteadmin;if(a==1){b&=4294967290}QV("p2AccountActions",((features&4)==0)&&(serverinfo.domainauth==false));QV("p2AccountSecurity",((features&4)==0)&&(serverinfo.domainauth==false)&&((features&4096)!=0));QV("p2ServerActions",b&21);QV("LeftMenuMyServer",b&21);QV("MainMenuMyServer",b&21);QV("p2ServerActionsBackup",b&1);QV("p2ServerActionsRestore",b&4);QV("p2ServerActionsVersion",b&16);QV("MainMenuMyFiles",b&8);QV("LeftMenuMyFiles",b&8);if(((b&8)==0)&&(xxcurrentView==5)){setDialogMode(0);go(1)}if(currentNode!=null){gotoDevice(currentNode._id,xxcurrentView,true)}if((userinfo.siteadmin&2)!=0){if(users==null){meshserver.send({action:"users"})}if(wssessions==null){meshserver.send({action:"wssessioncount"})}}else{users=null;wssessions=null;updateUsers();if(xxcurrentView==4||((xxcurrentView>=30)&&(xxcurrentView<40))){setDialogMode(0);go(1);currentUser=null}}meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)});QV("p2deleteall",userinfo.siteadmin==4294967295);QV("ServerConsole",userinfo.siteadmin===4294967295);if((xxcurrentView==115)&&(userinfo.siteadmin!=4294967295)){go(6)}if((xxcurrentView==6)&&((userinfo.siteadmin&21)==0)){go(1)}if((b&21)!=0){meshserver.send({action:"serverstats",interval:10000})}}var updateNaggleTimer=null;var updateNaggleFlags=0;function masterUpdate(a){updateNaggleFlags|=a;if(updateNaggleTimer==null){updateNaggleTimer=setTimeout(function(){if(updateNaggleFlags&512){center()}if(updateNaggleFlags&1){onSearchInputChanged()}if(updateNaggleFlags&2){onSortSelectChange(true)}if(updateNaggleFlags&128){updateMeshes()}if(updateNaggleFlags&4){updateDevices()}if(updateNaggleFlags&8){drawNotifications()}if(updateNaggleFlags&16){updateMapMarkers()}if(updateNaggleFlags&32){eventsUpdate()}if(updateNaggleFlags&64){refreshMap(false,true)}if(updateNaggleFlags&256){drawDeviceTimeline()}if(updateNaggleFlags&1024){deviceEventsUpdate()}if(updateNaggleFlags&2048){userEventsUpdate()}updateNaggleTimer=null;updateNaggleFlags=0},150)}}function updateSelf(){QV("verifyEmailId",(userinfo.emailVerified!==true)&&(userinfo.email!=null)&&(serverinfo.emailcheck==true));QV("verifyEmailId2",(userinfo.emailVerified!==true)&&(userinfo.email!=null)&&(serverinfo.emailcheck==true));QV("manageOtp",(userinfo.otpsecret==1)||(userinfo.otphkeys>0));QV("authAppSetupCheck",userinfo.otpsecret==1);QV("authKeySetupCheck",userinfo.otphkeys>0);QV("authCodesSetupCheck",userinfo.otpkeys>0)}function onMessage(D,l){switch(l.action){case"serverstats":updateServerStats(l);break;case"authcookie":authCookie=l.cookie;break;case"serverinfo":serverinfo=l.serverinfo;break;case"userinfo":userinfo=l.userinfo;updateSiteAdmin();updateSelf();break;case"users":users={};for(var k in l.users){users[l.users[k]._id]=l.users[k]}updateUsers();break;case"wssessioncount":wssessions=l.wssessions;updateUsers();break;case"meshes":meshes={};for(var k in l.meshes){meshes[l.meshes[k]._id]=l.meshes[k]}masterUpdate(4+128);break;case"files":filetree=setupBackPointers(l.filetree);updateFiles();d3updatefiles();break;case"nodes":nodes=[];for(var k in l.nodes){if(!meshes[k]){console.log("Invalid mesh (1): "+k);continue}for(var o in l.nodes[k]){if(l.nodes[k][o]._id==null){console.log("Invalid node ("+o+"): "+JSON.stringify(l.nodes));continue}l.nodes[k][o].namel=l.nodes[k][o].name.toLowerCase();if(l.nodes[k][o].rname){l.nodes[k][o].rnamel=l.nodes[k][o].rname.toLowerCase()}else{l.nodes[k][o].rnamel=l.nodes[k][o].namel}l.nodes[k][o].meshnamel=meshes[k].name.toLowerCase();l.nodes[k][o].meshid=k;l.nodes[k][o].state=(l.nodes[k][o].state)?(l.nodes[k][o].state):0;l.nodes[k][o].desc=l.nodes[k][o].desc;if(!l.nodes[k][o].icon){l.nodes[k][o].icon=1}l.nodes[k][o].ident=++nodeShortIdent;nodes.push(l.nodes[k][o])}}masterUpdate(1|2|4|64);if(xxcurrentView==0){if("{{viewmode}}"!=""){go(parseInt("{{viewmode}}"))}else{setDialogMode(0);go(1)}}if("{{currentNode}}"!=""){gotoDevice("{{currentNode}}",parseInt("{{viewmode}}"))}break;case"powertimeline":if(l.nodeid!=powerTimelineReq){break}powerTimelineNode=l.nodeid;powerTimeline=l.timeline;powerTimelineUpdate=Date.now()+300000;if(currentNode._id==l.nodeid){masterUpdate(256)}break;case"lastconnect":var v=getNodeFromId(l.nodeid);if(v!=null){v.lastconnect=l.time;v.lastaddr=l.addr;if((currentNode._id==v._id)&&(Q("MainComputerState").innerHTML=="")){QH("MainComputerState","<span style=font-size:12px>Last seen:<br />"+new Date(v.lastconnect).toLocaleDateString()+", "+new Date(v.lastconnect).toLocaleTimeString()+"</span>")}}break;case"msg":if(l.nodeid!=null){var e=-1;if(nodes!=null){for(var d in nodes){if(nodes[d]._id==l.nodeid){e=d;break}}}if(e!=-1){if(l.type=="console"){p15consoleReceive(nodes[e],l.value)}else{if(l.type=="notify"){var o={text:l.value};if(l.nodeid!=null){o.nodeid=l.nodeid}if(l.tag!=null){o.tag=l.tag}if(l.username!=null){o.username=l.username}addNotification(o)}else{if(l.type=="ps"){showDeskToolsProcesses(l)}else{if((l.type=="getclip")&&(xxdialogTag=="clipboard")&&(currentNode!=null)&&(currentNode._id==l.nodeid)){Q("d2clipText").value=l.data}else{if((l.type=="setclip")&&(xxdialogTag=="clipboard")&&(currentNode!=null)&&(currentNode._id==l.nodeid)){QH("dlgClipStatus",l.success?"<span style=color:green>Success</span>":"<span style=color:red>Failed</span>");setTimeout(function(){try{QH("dlgClipStatus","")}catch(j){}},2000)}}}}}}}else{if(l.type=="notify"){var o={text:l.value};if(l.tag!=null){o.tag=l.tag}if(l.username!=null){o.username=l.username}addNotification(o)}}break;case"getnetworkinfo":if((currentNode._id==l.nodeid)&&(xxdialogMode==2)&&(xxdialogTag=="if"+l.nodeid)){if(l.netif==null){QH("d2netinfo","No network interface information available for this device.")}else{var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>";if(currentNode.lastconnect){I+=addHtmlValue2("Last agent connection",new Date(currentNode.lastconnect).toLocaleString())}if(currentNode.lastaddr){if(isPrivateIP(currentNode.lastaddr)){I+=addHtmlValue2("Last agent address",currentNode.lastaddr.split(":")[0])}else{I+=addHtmlValue2("Last agent address",'<a href="https://iplocation.com/?ip='+currentNode.lastaddr.split(":")[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+currentNode.lastaddr.split(":")[0]+"</a>")}}I+=addHtmlValue2("Last interfaces update",new Date(l.updateTime).toLocaleString());for(var d in l.netif){var q=l.netif[d];I+="<hr />";if(q.name){I+=addHtmlValue2("Name","<b>"+EscapeHtml(q.name)+"</b>")}if(q.desc){I+=addHtmlValue2("Description",EscapeHtml(q.desc).replace("(R)","®").replace("(r)","®"))}if(q.dnssuffix){I+=addHtmlValue2("DNS suffix",EscapeHtml(q.dnssuffix))}if(q.mac){I+=addHtmlValue2("MAC address",'<a href="https://dnslytics.com/mac-address-lookup/'+q.mac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(q.mac.toLowerCase())+"</a>")}if(q.v4addr){I+=addHtmlValue2("IPv4 address",EscapeHtml(q.v4addr))}if(q.v4mask){I+=addHtmlValue2("IPv4 mask",EscapeHtml(q.v4mask))}if(q.v4gateway){I+=addHtmlValue2("IPv4 gateway",EscapeHtml(q.v4gateway))}if(q.gatewaymac){I+=addHtmlValue2("Gateway MAC",'<a href="https://dnslytics.com/mac-address-lookup/'+q.gatewaymac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(q.gatewaymac.toLowerCase())+"</a>")}}I+="</div>";QH("d2netinfo",I)}}break;case"serverversion":if((xxdialogMode==2)&&(xxdialogTag=="MeshCentralServerUpdate")){var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>";if(!l.current){l.current="Unknown"}if(!l.latest){l.latest="Unknown"}I+=addHtmlValue2("Current Version","<b>"+EscapeHtml(l.current)+"</b>");I+=addHtmlValue2("Latest Version","<b>"+EscapeHtml(l.latest)+"</b>");I+="</div>";if((l.latest.indexOf(".")==-1)||(l.current==l.latest)||((features&2048)==0)){setDialogMode(2,"MeshCentral Version",1,null,I)}else{setDialogMode(2,"MeshCentral Version",3,server_showVersionDlgEx,I+"<br /><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> Check and click OK to start server self-update.</label>");server_showVersionDlgUpdate()}}break;case"servererrors":if((xxdialogMode==2)&&(xxdialogTag=="MeshCentralServerErrors")){if(l.data==null){setDialogMode(2,"MeshCentral Server Errors",1,null,"Server has no error log.")}else{var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow:auto;line-height:160%;font-size:10px><pre>"+l.data+"<pre></div>";setDialogMode(2,"MeshCentral Server Errors",3,server_showErrorsDlgEx,I+"<br /><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> Check and click OK to clear error log.</label>");server_showVersionDlgUpdate()}}break;case"serverconsole":p15consoleReceive("serverconsole",l.value);break;case"events":if((l.nodeid!=null)&&(l.nodeid==currentNode._id)){currentDeviceEvents=l.events;masterUpdate(1024)}else{if((l.user!=null)&&(l.user==currentUser.name)){currentUserEvents=l.events;masterUpdate(2048)}else{events=l.events;masterUpdate(32)}}break;case"getcookie":if(l.tag=="clickonce"){var a="{{{serverRedirPort}}}"==""?"{{{serverPublicPort}}}":"{{{serverRedirPort}}}";var A="http://"+window.location.hostname+":"+a+"/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F"+window.location.hostname+"%2Fmeshrelay.ashx%3Fauth="+l.cookie+"&CH={{{webcerthash}}}&AP="+l.protocol+((debugmode==1)?"":"&HOL=1");var u=window.open(A,"_blank");u.opener=null}break;case"getNotes":var o=Q("d2devNotes");if(o&&(l.id==decodeURIComponent(o.attributes.noteid.value))){if(l.notes){QH("d2devNotes",decodeURIComponent(l.notes))}else{QH("d2devNotes","")}var B=o.attributes.ro.value=="true";if(B==false){o.removeAttribute("readonly");QE("idx_dlgOkButton",true);QV("idx_dlgOkButton",true);focusTextBox("d2devNotes")}}break;case"otpauth-request":if((xxdialogMode==2)&&(xxdialogTag=="otpauth-request")){var C=l.secret;if(C.length==52){C=C.split(/(.............)/).filter(Boolean).join(" ")}else{if(C.length==32){C=C.split(/(....)/).filter(Boolean).join(" ");C=C.substring(0,20)+"<br/>"+C.substring(20)}}QH("d2optinfo",'<table style=width:380px><tr><td style=vertical-align:top>Install <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" rel="noreferrer noopener" target=_blank>Google Authenticator</a> or a compatible application and scan the barcode, use <a href="'+l.url+'" rel="noreferrer noopener" target=_blank> this link</a> or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login.<br /><br />Secret<br /><tt id=d2optsecret secret="'+l.secret+'" style=font-size:12px>'+C+'</tt><br /><br /></td><td style=width:1px;vertical-align:top><a href="'+l.url+'" rel="noreferrer noopener" target=_blank><div id="qrcode"></div></a></td><tr><td colspan=2 style="text-align:center;border-top:1px solid black"><br />Enter the token here for 2-step login: <input type=text onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" onkeyup=account_addOtpCheck(event) onkeydown=account_addOtpCheck() maxlength=6 id=d2otpauthinput type=text></td></table>');new QRCode(Q("qrcode"),{text:l.url,width:128,height:128,colorDark:"#000000",colorLight:"#EEE",correctLevel:QRCode.CorrectLevel.H});QV("idx_dlgOkButton",true);QE("idx_dlgOkButton",false);Q("d2otpauthinput").focus()}break;case"otpauth-setup":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,l.success?"<b style=color:green>Authenticator app activation successful</b>. You will now need a valid token to login again.":"<b style=color:red>2-step login activation failed</b>. Clear the secret from the application and try again. You only have a few minutes to enter the proper code.");break;case"otpauth-clear":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,l.success?"<b>Authenticator application removed</b>. You can reactivate this feature at any time.":"<b style=color:red>2-step login activation removal failed</b>. Try again.");break;case"otpauth-getpasswords":if(xxdialogMode){return}var I="One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place.";I+="<div style='border-radius:6px;border: 2px dashed #888;width:100%;margin-top:8px'><div style='padding:8px;font-family:Arial, Helvetica, sans-serif;font-size:20px;font-weight:bold'><table style=width:100%;text-align:center>";if(l.passwords){var g=0;for(var d in l.passwords){if(++g%2){I+="<tr>"}var y=""+l.passwords[d].p;while(y.length<8){y="0"+y}if(l.passwords[d].u===true){I+="<td>"+y.substring(0,4)+" "+y.substring(4)}else{I+="<td><strike style=color:#BBB>"+y.substring(0,4)+" "+y.substring(4);+"</strike>"}}}else{I+="<tr><td>No Active Tokens"}I+="</table></div></div><br />";I+="<div><input type=button value='Close' onclick=setDialogMode(0) style=float:right></input>";I+="<input type=button value='Generate New Tokens' onclick='account_manageOtp(1);'></input>";if(l.passwords!=null){I+="<input type=button value='Clear Tokens' onclick='account_manageOtp(2);'></input>"}I+="</div><br />";setDialogMode(2,"Manage Backup Codes",8,null,I,"otpauth-manage");break;case"otp-hkey-get":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}var F="<div style='border-radius:6px;border:2px solid #CCC;background-color:#BBB;width:100%;box-sizing:border-box;margin-bottom:6px'><div style='margin:3px;font-family:Arial, Helvetica, sans-serif;font-size:16px;font-weight:bold'><table style=width:100%;text-align:left>";var b="</table></div></div>";var I="<a href='https://www.yubico.com/' rel='noreferrer noopener' target='_blank'>Hardware keys</a> are used as secondary login authentication.";I+="<div style='max-height:150px;overflow-y:auto;overflow-x:hidden;margin-top:6px;margin-bottom:6px'>";if(l.keys&&l.keys.length>0){for(var d in l.keys){var h=l.keys[d],H=(h.type==1)?"U2F":"OTP";I+=F+'<tr style=margin:5px><td style=width:30px><img width=24 height=18 src="images/hardware-key-'+H+'-24.png" style=margin-top:4px><td style=width:250px>'+h.name+"<td><input type=button value='Remove' onclick=account_removehkey("+h.i+")></input>"+b}}else{I+=F+"<tr style=text-align:center><td>No Keys Configured"+b}I+="</div>";I+="<div><input type=button value='Close' onclick=setDialogMode(0) style=float:right></input>";I+="<input id=d2addkey1 type=button value='Add U2F Key' onclick='account_addhkey(1);'></input>";if((features&16384)!=0){I+="<input id=d2addkey2 type=button value='Add OTP Key' onclick='account_addhkey(2);'></input>"}I+="</div><br />";setDialogMode(2,"Manage Security Keys",8,null,I,"otpauth-hardware-manage");if(u2fSupported()==false){QE("d2addkey1",false)}break;case"otp-hkey-yubikey-add":if(l.result){meshserver.send({action:"otp-hkey-get"})}else{setDialogMode(2,"Add Security Key",1,null,"<br />Error, Unable to add key.<br /><br />")}break;case"otp-hkey-setup-request":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}var I="Press the key button now.<br /><br /><div style=width:100%;text-align:center><img width=120 height=117 src='images/hardware-keypress-120.png' /></div><input id=dp1keyname style=display:none value="+l.name+" />";setDialogMode(2,"Add Security Key",2,null,I);window.u2f.register(l.request.appId,l.request.registerRequests,l.request.registeredKeys,function(m){if(m.registrationData){meshserver.send({action:"otp-hkey-setup-response",response:m,name:Q("dp1keyname").value});setDialogMode(2,"Add Security Key",0,null,"<br />Checking...<br /><br /><br />","otpauth-hardware-manage")}else{var j=["","Unknown error","Bad request","Unsupported configuration","This key was already registered","Timeout"];setDialogMode(2,"Add Security Key",1,null,"<br />"+j[m.errorCode]+".<br /><br />")}},l.request.timeoutSeconds);break;case"otp-hkey-setup-response":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}if(l.result==true){meshserver.send({action:"otp-hkey-get"})}else{setDialogMode(2,"Add Security Key",1,null,"<br />ERROR: Unable to add key.<br /><br />","otpauth-hardware-manage")}break;case"event":if(!l.event.nolog){events.unshift(l.event);var c=parseInt(p3limitdropdown.value);while(events.length>c){events.pop()}masterUpdate(32)}switch(l.event.action){case"accountcreate":case"accountchange":if(userinfo.name==l.event.account.name){var t=l.event.account.siteadmin?l.event.account.siteadmin:0;var w=userinfo.siteadmin?userinfo.siteadmin:0;if((l.event.account.quota!=userinfo.quota)||(((userinfo.siteadmin&8)==0)&&((l.event.account.siteadmin&8)!=0))){meshserver.send({action:"files"})}userinfo=l.event.account;if(w!=t){updateSiteAdmin()}updateSelf()}if(users==null){break}users[l.event.account._id]=l.event.account;updateUsers();break;case"accountremove":if(users==null){break}delete users["user/"+domain+"/"+l.event.username.toLowerCase()];updateUsers();break;case"createmesh":if(l.event.links["user/"+domain+"/"+userinfo.name.toLowerCase()]!=null){meshes[l.event.meshid]={_id:l.event.meshid,name:l.event.name,mtype:l.event.mtype,desc:l.event.desc,links:l.event.links};masterUpdate(4+128);meshserver.send({action:"files"})}break;case"meshchange":if(meshes[l.event.meshid]==null){meshes[l.event.meshid]={_id:l.event.meshid,name:l.event.name,mtype:l.event.mtype,desc:l.event.desc,links:l.event.links};meshserver.send({action:"nodes"})}else{if(l.event.name){meshes[l.event.meshid].name=l.event.name}if(l.event.desc){meshes[l.event.meshid].desc=l.event.desc}if(l.event.flags){meshes[l.event.meshid].flags=l.event.flags}if(l.event.links){meshes[l.event.meshid].links=l.event.links}if(l.event.amt){meshes[l.event.meshid].amt=l.event.amt}if(meshes[l.event.meshid].links["user/"+domain+"/"+userinfo.name.toLowerCase()]==null){if((xxcurrentView==20)&&(currentMesh==meshes[l.event.meshid])){go(2)}delete meshes[l.event.meshid];var s=[];for(var d in nodes){if(nodes[d].meshid!=l.event.meshid){s.push(nodes[d])}}nodes=s;if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==l.event.meshid){setDialogMode(0);go(1)}}}masterUpdate(4+128);if(xxcurrentView==20&¤tMesh._id==l.event.meshid){p20updateMesh()}break;case"deletemesh":if(meshes[l.event.meshid]){delete meshes[l.event.meshid];masterUpdate(128);meshserver.send({action:"files"})}var s=[];if(nodes!=null){for(var d in nodes){if(nodes[d].meshid!=l.event.meshid){s.push(nodes[d])}}}nodes=s;masterUpdate(4);if(xxcurrentView>=20&&xxcurrentView<30&¤tMesh._id==l.event.meshid){setDialogMode(0);go(2)}if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==l.event.meshid){setDialogMode(0);go(1)}break;case"addnode":var v=l.event.node;if(!meshes[v.meshid]){break}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}v.meshnamel=meshes[v.meshid].name.toLowerCase();v.state=0;if(!v.icon){v.icon=1}v.ident=++nodeShortIdent;if(nodes==null){}nodes.push(v);masterUpdate(1|2|4|16);break;case"removenode":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];if(currentNode==v){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(1)}currentNode=null}nodes.splice(e,1);masterUpdate(4|16)}break;case"changenode":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];v.name=l.event.node.name;v.rname=l.event.node.rname;v.users=l.event.node.users;v.host=l.event.node.host;v.desc=l.event.node.desc;v.osdesc=l.event.node.osdesc;v.publicip=l.event.node.publicip;v.iploc=l.event.node.iploc;v.wifiloc=l.event.node.wifiloc;v.gpsloc=l.event.node.gpsloc;v.tags=l.event.node.tags;v.userloc=l.event.node.userloc;if(l.event.node.agent!=null){if(v.agent==null){v.agent={}}if(l.event.node.agent.ver!=null){v.agent.ver=l.event.node.agent.ver}if(l.event.node.agent.id!=null){v.agent.id=l.event.node.agent.id}if(l.event.node.agent.caps!=null){v.agent.caps=l.event.node.agent.caps}if(l.event.node.agent.core!=null){v.agent.core=l.event.node.agent.core}else{if(v.agent.core){delete v.agent.core}}v.agent.tag=l.event.node.agent.tag}if(l.event.node.intelamt!=null){if(v.intelamt==null){v.intelamt={}}if(l.event.node.intelamt.host!=null){v.intelamt.user=l.event.node.intelamt.host}if(l.event.node.intelamt.user!=null){v.intelamt.user=l.event.node.intelamt.user}if(l.event.node.intelamt.tls!=null){v.intelamt.tls=l.event.node.intelamt.tls}if(l.event.node.intelamt.ver!=null){v.intelamt.ver=l.event.node.intelamt.ver}if(l.event.node.intelamt.state!=null){v.intelamt.state=l.event.node.intelamt.state}}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}if(l.event.node.icon){v.icon=l.event.node.icon}masterUpdate(2|4|8|16);refreshDevice(v._id);if((currentNode==v)&&(xxdialogMode!=null)&&(xxdialogTag=="@xxmap")){p10showNodeLocationDialog()}}break;case"nodemeshchange":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];if(meshes[l.event.newMeshId]==null){if(currentNode==v){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(1)}currentNode=null}nodes.splice(e,1);masterUpdate(4|16)}else{v.meshid=l.event.newMeshId;v.meshnamel=meshes[l.event.newMeshId].name.toLowerCase();masterUpdate(1|2|4)}refreshDevice(l.event.nodeid)}else{var v=l.event.node;if(!meshes[v.meshid]){break}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}v.meshnamel=meshes[v.meshid].name.toLowerCase();v.state=0;if(!v.icon){v.icon=1}v.ident=++nodeShortIdent;if(nodes==null){}nodes.push(v);masterUpdate(1|2|4|16)}break;case"nodeconnect":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];v.conn=l.event.conn;v.pwr=l.event.pwr;masterUpdate(4|16);refreshDevice(v._id)}break;case"wssessioncount":if(wssessions!=null){if(l.event.count==0&&wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]){delete wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]}else{wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]=l.event.count}updateUsers()}break;case"clearevents":events=[];masterUpdate(32);break;case"login":if(users!=null&&users["user/"+domain+"/"+l.event.username.toLowerCase()]){users["user/"+domain+"/"+l.event.username.toLowerCase()].login=Math.floor(l.event.time/1000)}break;case"scanamtdevice":if((xxdialogMode==null)||(!Q("dp1range"))||(Q("dp1range").value!=l.event.range)){return}var I="";if(l.event.results==null){I="<div style=width:100%;text-align:center;margin-top:12px>Unable to scan this address range.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>"}else{amtScanResults=l.event.results;for(var d in l.event.results){var z=l.event.results[d],E=z.hostname;if(E.length>20){E=E.substring(0,20)+"..."}var G='<b title="'+EscapeHtml(z.hostname)+'">'+EscapeHtml(E)+"</b> - v"+z.ver;if(z.state==2){if(z.tls==1){G+=" with TLS."}else{G+=" without TLS."}}else{G+=" not activated."}I+='<div style=width:100%;margin-bottom:2px;background-color:lightgray><div style=padding:4px><div style=display:inline-block;margin-right:5px><input class=DevScanCheckbox name=dp1checkbox tag="'+EscapeHtml(d)+'" type=checkbox onclick=addAmtScanToMeshCheckbox() /></div><div class=j1 style=display:inline-block></div><div style=display:inline-block;margin-left:5px;overflow-x:auto;white-space:nowrap>'+G+"</div></div></div>"}if(I==""){I="<div style=width:100%;text-align:center;margin-top:12px>Scan returned no results.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>"}}QH("dp1results",I);QE("dp1range",true);QE("dp1rangebutton",true);break;case"notify":var o={text:l.event.value};if(l.event.tag!=null){o.tag=l.event.tag}addNotification(o);break;case"stopped":break;default:break}break;case"stopped":autoReconnect=false;QH("p0span",l.msg);break;default:console.log("Unknown message.action",l.action);break}}function onRealNameCheckBox(){showRealNames=Q("RealNameCheckBox").checked;putstore("showRealNames",showRealNames?1:0);masterUpdate(6);return}function onDeviceViewChange(a){if(a!=null){Q("viewselect").value=a}for(var b=1;b<5;b++){Q("devViewButton"+b).classList.remove("viewSelectorSel")}Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel");putstore("deviceView",Q("viewselect").value);putstore("viewsize",Q("sizeselect").value);masterUpdate(4)}function ondockeypress(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeys(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeys(a)}if(!xxdialogMode&&((xxcurrentView==15)||(xxcurrentView==115))){return agentConsoleHandleKeys(a)}if(!xxdialogMode&&xxcurrentView==4){if(a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}var b=0;if(a.key){if(a.key.length===1&&userSearchFocus==0){Q("UserSearchInput").value=((Q("UserSearchInput").value+a.key));b=1}if(a.keyCode==8&&userSearchFocus==0){var c=Q("UserSearchInput").value;Q("UserSearchInput").value=c.substring(0,c.length-1);b=1}if(a.keyCode==27){Q("UserSearchInput").value="";b=1}}else{if(a.charCode!=0&&userSearchFocus==0){Q("UserSearchInput").value=((Q("UserSearchInput").value+String.fromCharCode(a.charCode)));b=1}}if(b>0){if(b==1){onUserSearchInputChanged()}return haltEvent(a)}}if(xxdialogMode||xxcurrentView!=1){return}if(a.ctrlKey==true&&a.charCode==96){showRealNames=!showRealNames;Q("RealNameCheckBox").value=showRealNames;putstore("showRealNames",showRealNames?1:0);masterUpdate(6);return}if(a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}if(Q("viewselect").value<3){var b=0;if(a.key){if(a.key.length===1&&searchFocus==0){Q("SearchInput").value=((Q("SearchInput").value+a.key));b=1}if(a.keyCode==8&&searchFocus==0){var c=Q("SearchInput").value;Q("SearchInput").value=c.substring(0,c.length-1);b=1}if(a.keyCode==27){Q("SearchInput").value="";b=1}}else{if(a.charCode!=0&&searchFocus==0){Q("SearchInput").value=((Q("SearchInput").value+String.fromCharCode(a.charCode)));b=1}}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(Q("viewselect").value==3){if(a.key){if(a.key.length===1&&mapSearchFocus==0){Q("mapSearchLocation").value=((Q("mapSearchLocation").value+a.key));b=1}if(a.keyCode==27){Q("mapSearchLocation").value="";mapCloseSearchWindow();b=1}if(a.keyCode==13){getSearchLocation()}}else{if(a.charCode!=0&&mapSearchFocus==0){Q("mapSearchLocation").value=((Q("mapSearchLocation").value+String.fromCharCode(a.charCode)));b=1}}}}function ondockeydown(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeyDown(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeyDown(a)}if(!xxdialogMode&&xxcurrentView==13&&a.keyCode==116&&p13filetree!=null){haltEvent(a);return false}if(!xxdialogMode&&((xxcurrentView==15)||(xxcurrentView==115))){return agentConsoleHandleKeys(a)}if(!xxdialogMode&&xxcurrentView==4){if(a.keyCode===8&&userSearchFocus==0){var c=Q("UserSearchInput").value;Q("UserSearchInput").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("UserSearchInput").value="";b=1}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(xxdialogMode||xxcurrentView!=1||a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}var b=0;if(Q("viewselect").value<3){if(a.keyCode===8&&searchFocus==0){var c=Q("SearchInput").value;Q("SearchInput").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("SearchInput").value="";b=1}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(Q("viewselect").value==3){if(a.keyCode===8&&mapSearchFocus==0){var c=Q("mapSearchLocation").value;Q("mapSearchLocation").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("mapSearchLocation").value="";mapCloseSearchWindow();b=1}}}function ondockeyup(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeyUp(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeyUp(a)}if(!xxdialogMode&&xxcurrentView==13&&a.keyCode==116&&p13filetree!=null){p13folderup(9999);haltEvent(a);return false}if(!xxdialogMode&&xxcurrentView==4){if((a.keyCode===8&&searchFocus==0)||a.keyCode===27){return haltEvent(a)}}if(xxdialogMode&&a.keyCode==27){dialogclose(0)}if(xxdialogMode||xxcurrentView!=0||a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}if(Q("viewselect").value<3){if((a.keyCode===8&&searchFocus==0)||a.keyCode===27){return haltEvent(a)}}if(Q("viewselect").value==3){if((a.keyCode===8&&mapSearchFocus==0)||a.keyCode===27){return haltEvent(a)}}}function devMouseHover(b,c){var d=Q("viewselect").value;if(d==1){var a=b.children[1].children[1];a.children[0].classList.remove("g1s");a.children[1].classList.remove("e2s");a.children[2].classList.remove("g2s");if(c==1){a.children[0].classList.add("g1s");a.children[1].classList.add("e2s");a.children[2].classList.add("g2s")}}else{if(d==2){var a=b;a.children[2].classList.remove("g1s");a.children[4].classList.remove("e2s");a.children[3].classList.remove("g2s");if(c==1){a.children[2].classList.add("g1s");a.children[4].classList.add("e2s");a.children[3].classList.add("g2s")}}}}var deviceHeaderId=0;var deviceHeaderTotal=0;var deviceHeadersTitles={};var deviceHeaderCount;var deviceHeaders={};var oldviewmode=0;function updateDevices(){if(nodes==null){return}var H="",a=0,g=null,e=0,l={},O=Q("viewselect").value,s={},p={};QV("xdevices",O<4);QV("xdevicesmap",O==4);QV("devListToolbar",O<3);QV("kvmListToolbar",O==3);QV("devMapToolbar",O==4);QV("devListToolbarSize",O==3);QV("NoMeshesPanel",meshcount==0);QV("devListToolbarViewIcons",(meshcount!=0)&&(nodes.length>0));QV("devListToolbarSort",(meshcount!=0)&&(nodes.length>0)&&(O<4));if((meshcount==0)||(nodes.length==0)){O=1;sort=0}if(O==4){setTimeout(function(){if(xxmap.map!=null){xxmap.map.updateSize()}},200)}else{deviceHeaderId=0;deviceHeaderCount={};deviceHeaderTotal=0;deviceHeaders={};deviceHeadersTitles={};var x=[];if(sort==0){nodes.sort(meshSort)}else{if(sort==1){nodes.sort(powerSort)}else{if(sort==2){if(showRealNames==true){nodes.sort(deviceHostSort)}else{nodes.sort(deviceSort)}}}}var d=[],m=document.getElementsByClassName("DeviceCheckbox"),b=0;for(var t=0;t<m.length;t++){if(m[t].checked){d.push(m[t].value)}}if((oldviewmode<3)&&(O==3)){multiDesktopFilter=d}else{if((oldviewmode==3)&&(O<3)){d=multiDesktopFilter}}var M=Q("column_l").clientWidth-60;var k=Math.floor(M/301);k=301+Math.floor((M-(k*301))/k);for(var t in nodes){if(nodes[t].v==false){continue}var z=meshes[nodes[t].meshid],B=z.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(B==null){continue}var C=B.rights;if((O==3)&&(z.mtype==1)){continue}if(sort==0){if(nodes[t].meshid!=g){deviceHeaderSet();var o="";if(meshes[nodes[t].meshid].mtype==1){o="<span class=devHeaderx>, Intel® AMT only</span>"}if((O==1)&&(g!=null)){if(a==2){H+="<td><div style=width:301px></div></td>"}if(H!=""){H+="</tr></table>"}}H+="<div class=DevSt style=width:100%;padding-top:4px><span style=float:right>";H+=getMeshActions(z,C);H+='</span><span id=MxMESH style=cursor:pointer onclick=gotoMesh("'+nodes[t].meshid+'")>'+EscapeHtml(meshes[nodes[t].meshid].name)+"</span>"+o+"<span id=DevxHeader"+deviceHeaderId+" class=devHeaderx></span></div>";g=nodes[t].meshid;l[g]=1;a=0}}else{if(sort==1){var G=nodes[t].pwr?nodes[t].pwr:0;if(G!==g){deviceHeaderSet();if((O==1)&&(g!==null)){if(a==2){H+="<td><div style=width:301px></div></td>"}if(H!=""){H+="</tr></table>"}}H+="<div class=DevSt style=width:100%;padding-top:4px><span>"+PowerStateStr2(nodes[t].pwr)+"</span><span id=DevxHeader"+deviceHeaderId+' class="devHeaderx"></span></div>';g=G;a=0}}else{if(sort==2){if(g==null){g="1"}}}}e++;var L=EscapeHtml(nodes[t].name);if(L.length==0){L="<i>None</i>"}if((nodes[t].rname!=null)&&(nodes[t].rname.length>0)){L+=" / "+EscapeHtml(nodes[t].rname)}var D=EscapeHtml(nodes[t].name);if(showRealNames==true&&nodes[t].rname!=null){D=EscapeHtml(nodes[t].rname)}if(D.length==0){D="<i>None</i>"}var u=nodes[t].icon;var F=NodeStateStr(nodes[t]);if((!nodes[t].conn)||(nodes[t].conn==0)){u+=" gray"}if(O==1){H+="<div id=devs onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:"+k+'px;height:50px;padding-top:1px;padding-bottom:1px><div style=width:22px;height:50%;float:left;padding-top:12px><input class="'+nodes[t].meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+nodes[t]._id+" type=checkbox></div><div style=height:100%;cursor:pointer onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><div class=\"i"+u+'" style=width:50px;float:left></div><div style=height:100%><div class=g1></div><div class=e2><div class=e1 style=width:'+(k-100)+'px title="'+L+'">'+D+"</div><div>"+F+"</div></div><div class=g2></div></div></div></div>"}else{if(O==2){H+="<tr><td><div id=devs class=bar18 onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=height:18px;width:100%;font-size:medium>";H+='<div style=width:22px;float:left;background-color:white><input class="'+nodes[t].meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+nodes[t]._id+" type=checkbox></div>";H+="<div style=float:left;height:18px;width:18px;background-color:white onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><div class=j"+u+" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>";H+="<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>";H+='<div style=cursor:pointer;font-size:14px title="'+L+"\" onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><span style=float:right>"+F+"</span><span style=width:300px>"+D+"</span></div></div></td></tr>"}else{if((O==3)&&(nodes[t].conn&1)&&(((C&8)||(C&256))!=0)&&((nodes[t].agent.caps&1)!=0)){if((multiDesktopFilter.length==0)||(multiDesktopFilter.indexOf("devid_"+nodes[t]._id)>=0)){H+="<div id=devs style=display:inline-block;margin:1px;background-color:lightgray;border-radius:5px;position:relative><div style=padding:3px;cursor:pointer onclick=gotoDevice('"+nodes[t]._id+"',11,null,event)>";H+='<div class="j'+u+'" style=width:16px;float:left></div> '+D+"</div>";H+="<span onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)></span><div id=xkvmid_"+nodes[t]._id.split("/")[2]+"><div id=skvmid_"+nodes[t]._id.split("/")[2]+' style="position:absolute;color:white;left:5px;top:27px;text-shadow:0px 0px 5px #000;z-index:1000;cursor:default" onclick=toggleKvmDevice(\''+nodes[t]._id+"')>Disconnected</div></div>";H+="</div>";x.push(nodes[t]._id)}}}}if((sort==3)&&(H!="")){if(nodes[t].tags){for(var w in nodes[t].tags){var K=nodes[t].tags[w];if(s[K]==null){s[K]=H;p[K]=1}else{s[K]+=H;p[K]+=1}if(O==3){break}}}H=""}deviceHeaderTotal++;if(typeof deviceHeaderCount[nodes[t].state]=="undefined"){deviceHeaderCount[nodes[t].state]=1}else{deviceHeaderCount[nodes[t].state]++}}if(sort==3){var q=[];for(var t in s){q.push(t)}q.sort(function(c,j){return c.toLowerCase().localeCompare(j.toLowerCase())});for(var w in q){var t=q[w];H+="<div class=DevSt style=width:100%;padding-top:4px><span>"+t+'</span><span class="devHeaderx">, '+p[t]+" device"+((p[t]>1)?"s":"")+"</span></div>"+s[t]}}if((H=="")&&(meshcount>0)&&(Q("SearchInput").value!="")){if(sort==3){H='<div style="margin:30px">No devices are included in any groups, click on a device\'s "Groups" to add to a group.</div>'}else{H='<div style="margin:30px">No devices matching this search.</div>'}}if((O==1)&&(a==2)){H+="<td><div style=width:301px></div></td>"}if((sort==0)&&(Q("SearchInput").value=="")&&(O<3)){for(var t in meshes){var y=meshes[t],A=y.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(A!=null){var C=A.rights;if(l[y._id]==null){if((g!="")&&(H!="")){H+="</tr></table>"}H+="<table style=width:100%;padding-top:4px cellpadding=0 cellspacing=0><tr><td colspan=3 class=DevSt><span style=float:right>";H+=getMeshActions(y,C);H+='</span><span id=MxMESH style=cursor:pointer onclick=gotoMesh("'+y._id+'")>'+EscapeHtml(y.name)+"</span></td></tr><tr>";if(y.mtype==1){H+="<td><div style=padding:10px><i>No Intel® AMT devices in this mesh";if((C&4)!=0){H+=', <a style=cursor:pointer onclick=addDeviceToMesh("'+y._id+'")>add one</a>'}}if(y.mtype==2){H+="<td><div style=padding:10px><i>No devices in this mesh";if((C&4)!=0){H+=', <a style=cursor:pointer onclick=addAgentToMesh("'+y._id+'")>add one</a>'}}H+=".</i></div></td>";g=y._id;e++}}}}H+="</tr></table><div style=height:1px></div>";H+="<div style=border-top-style:solid;border-top-width:1px;border-top-color:#DDDDDD;cursor:pointer;font-size:10px>";if((O<3)&&(sort==0)&&(meshcount>0)){H+='<a onclick=account_createMesh() title="Create a new group of devices." style=cursor:pointer>Add Device Group</a> '}H+='<a onclick=p10showMeshCmdDialog(0) style=cursor:pointer title="Download MeshCmd, a command line tool that performs many functions.">MeshCmd</a></div>';H+="</div><br/>";QH("xdevices",H);deviceHeaderSet();var m=document.getElementsByClassName("DeviceCheckbox"),b=0;for(var t=0;t<m.length;t++){m[t].checked=(d.indexOf(m[t].value)>=0)}for(var t in deviceHeaders){QH(t,deviceHeaders[t])}for(var t in deviceHeadersTitles){Q(t).title=deviceHeadersTitles[t]}p1updateInfo();if(O==3){var P=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex];var I=P.x+2,N=M-5,R=Math.floor(N/I);R=I+Math.floor((N-(R*I))/R);P.y=P.y*(R/P.x);P.x=R;for(var t in multiDesktop){multiDesktop[t].xxdelete=true}for(var t in x){var v=x[t],J=v.split("/")[2],h=multiDesktop[v];if(h!=null){h.m.CanvasId.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");Q("xkvmid_"+J).appendChild(h.m.CanvasId);delete h.xxdelete;QH("skvmid_"+J,["Disconnected","Connecting...","Setup...","",""][((h.m.State==null)?h.m.state:h.m.State)])}else{var E=getNodeFromId(v);if((desktopNode==E)&&(desktop!=null)){var a=desktop.m.CanvasId;a.setAttribute("id","kvmid_"+J);a.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");a.setAttribute("onclick","toggleKvmDevice('"+v+"')");a.removeAttribute("onmousedown");a.removeAttribute("onmouseup");a.removeAttribute("onmousemove");Q("xkvmid_"+J).appendChild(a);QH("skvmid_"+J,["Disconnected","Connecting...","Setup...","",""][((desktop.m.State==null)?desktop.m.state:desktop.m.State)]);if(desktop.m.SendCompressionLevel){desktop.m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate)}desktop.shortid=J;desktop.onStateChanged=onMultiDesktopStateChange;multiDesktop[v]=desktop;desktop=desktopNode=currentNode=null;QH("DeskParent",'<canvas id="Desk" width="640" height="480" style="width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>')}else{var a=document.createElement("canvas");a.setAttribute("id","kvmid_"+J);a.setAttribute("width",640);a.setAttribute("height",480);a.setAttribute("oncontextmenu","return false");a.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");a.setAttribute("onclick","toggleKvmDevice('"+v+"')");try{Q("xkvmid_"+J).appendChild(a)}catch(n){}if(Q("autoConnectDesktopCheckbox").checked==true){setTimeout(function(){connectMultiDesktop(E,1)},100)}}}}for(var t in multiDesktop){if(multiDesktop[t].xxdelete==true){multiDesktop[t].Stop();delete multiDesktop[t]}else{if(debugmode&&multiDesktop[t].m&&multiDesktop[t].m.onScreenSizeChange){mdeskAdjust(multiDesktop[t].m,multiDesktop[t].m.ScreenWidth,multiDesktop[t].m.ScreenHeight,multiDesktop[t].m.CanvasId)}}}deskAdjust()}else{disconnectAllKvmFunction();Q("autoConnectDesktopCheckbox").checked=false}}oldviewmode=O}function toggleKvmDevice(d){var c=getNodeFromId(d),a=meshes[c.meshid],b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&8)||(b&256)){if(c.conn&1){connectMultiDesktop(c,1)}}}function autoConnectDesktops(){if(Q("autoConnectDesktopCheckbox").checked==true){connectAllKvmFunction()}}function connectAllKvmFunction(){for(var a in nodes){if(multiDesktop[nodes[a]._id]==null){toggleKvmDevice(nodes[a]._id)}}}function disconnectAllKvmFunction(){for(var a in multiDesktop){multiDesktop[a].Stop()}multiDesktop={}}function onMultiDesktopStateChange(a,c){try{QH("skvmid_"+a.shortid,["Disconnected","Connecting...","Setup...","",""][c])}catch(b){}}function showMultiDesktopSettings(){QV("d7amtkvm",false);QV("d7meshkvm",true);d7bitmapquality.value=multidesktopsettings.quality;d7bitmapscaling.value=multidesktopsettings.scaling;if(multidesktopsettings.framerate){d7framelimiter.value=multidesktopsettings.framerate}else{d7framelimiter.value=1000}setDialogMode(7,"Remote Desktop Settings",3,showMultiDesktopSettingsChanged)}function showMultiDesktopSettingsChanged(){multidesktopsettings.quality=d7bitmapquality.value;multidesktopsettings.scaling=d7bitmapscaling.value;multidesktopsettings.framerate=d7framelimiter.value;localStorage.setItem("multidesktopsettings",JSON.stringify(multidesktopsettings));for(var a in multiDesktop){multiDesktop[a].m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate)}}function connectMultiDesktop(c,a){var d=c._id,e=d.split("/")[2];var b=multiDesktop[d];if(b==null){if(Q("kvmid_"+e)==null){return}if(a==2){if((c.intelamt.user==null)||(c.intelamt.user=="")){return}b=CreateAmtRedirect(CreateAmtRemoteDesktop("kvmid_"+e),authCookie);b.shortid=e;b.onStateChanged=onMultiDesktopStateChange;b.m.bpp=1;b.m.useZRLE=true;b.m.showmouse=true;b.m.onKvmData=function(g){console.log("KVM Data received in multi-desktop mode, this is not supported.")};if(debugmode>0){b.m.onScreenSizeChange=mdeskAdjust}b.Start(d,16994,"*","*",0);b.contype=2;multiDesktop[d]=b}else{if(a==1){b=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("kvmid_"+e),serverPublicNamePort,authCookie);b.shortid=e;b.attemptWebRTC=attemptWebRTC;b.onStateChanged=onMultiDesktopStateChange;b.m.CompressionLevel=multidesktopsettings.quality;b.m.ScalingLevel=multidesktopsettings.scaling;b.m.FrameRateTimer=multidesktopsettings.framerate;if(debugmode>0){b.m.onScreenSizeChange=mdeskAdjust}b.Start(d);b.contype=1;multiDesktop[d]=b}}}else{b.Stop();delete multiDesktop[d]}}function getMeshActions(a,b){if((b&4)==0){return""}var c="";if((features&1024)==0){c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer that is located on the internet." onclick=addCiraDeviceToMesh("'+a._id+'")>Add CIRA</a>'}if(a.mtype==1){if((features&1)==0){c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer that is located on the local network." onclick=addDeviceToMesh("'+a._id+'")>Add Local</a>';c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer by scanning the local network." onclick=addAmtScanToMesh("'+a._id+'")>Scan Network</a>'}}if(a.mtype==2){c+=' <a style=cursor:pointer;font-size:10px title="Add a new computer to this mesh by installing the mesh agent." onclick=addAgentToMesh("'+a._id+'")>Add Agent</a>';if(features&64){c+=' <a style=cursor:pointer;font-size:10px title="Invite someone to install the mesh agent on this mesh." onclick=inviteAgentToMesh("'+a._id+'")>Invite</a>'}}return c}function addDeviceToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c='Add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'".<br /><br />';c+=addHtmlValue("Device Name","<input id=dp1devicename style=width:230px maxlength=32 autocomplete=off onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />");c+=addHtmlValue("Hostname",'<input id=dp1hostname style=width:230px maxlength=32 autocomplete=off placeholder="Same as device name" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');c+=addHtmlValue("Username",'<input id=dp1username style=width:230px maxlength=32 autocomplete=off placeholder="admin" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');c+=addHtmlValue("Password","<input id=dp1password type=password style=width:230px autocomplete=off maxlength=32 onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />");c+=addHtmlValue("Security","<select id=dp1tls style=width:236px><option value=0>No TLS security</option><option value=1>TLS security required</option></select>");setDialogMode(2,"Add Intel® AMT device",3,addDeviceToMeshEx,c,b);validateDeviceToMesh();Q("dp1devicename").focus()}function addAmtScanToMesh(a){if(xxdialogMode){return}var b="Enter a range of IP addresses to scan for Intel AMT devices.<br /><br />";b+=addHtmlValue("IP Range",'<input id=dp1range style=width:184px value="192.168.1.0/24" onkeyup=addAmtScanToMeshKeyUp(event) /><input id=dp1rangebutton type=button value=Scan onclick=addAmtScanToMeshButton()></input>');b+='<div id=dp1results style="width:100%;height:200px;background-color:white;border:1px gray solid;overflow-y:scroll"></div>';setDialogMode(2,"Scan for Intel® AMT devices",3,addAmtScanToMeshEx,b,a);QE("idx_dlgOkButton",false);QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>");focusTextBox("dp1range")}function addAmtScanToMeshKeyUp(a){if(a.keyCode==13){haltEvent(a);addAmtScanToMeshButton()}}function addAmtScanToMeshEx(b,h){var d=document.getElementsByClassName("DevScanCheckbox"),c=0;for(var e=0;e<d.length;e++){if(d[e].checked){var g=d[e].getAttribute("tag");var a=amtScanResults[g];meshserver.send({action:"addamtdevice",meshid:h,devicename:g,hostname:a.hostname,amtusername:"",amtpassword:"",amttls:a.tls})}}}function addAmtScanToMeshButton(){QE("dp1range",false);QE("dp1rangebutton",false);QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px>Scanning...</div>");meshserver.send({action:"scanamtdevice",range:Q("dp1range").value})}function addAmtScanToMeshCheckbox(){var b=document.getElementsByClassName("DevScanCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked){a++}}QE("idx_dlgOkButton",a>0)}function addCiraDeviceToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c=b.split("/")[2].replace(/\@/g,"X").replace(/\$/g,"X");var e="<select id=dlgAddCiraSel onclick=dlgAddCiraSelClick() style=width:230px><option value=0>MeshCommander Script</option><option value=1>Manual Username/Password</option>";if((features&16)==0){e+="<option value=2>Manual Certificate</option></select>"}var d="";d+=addHtmlValue("Setup Method",e);d+="<hr>";d+='<div id=dlgAddCira0>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+"\" with CIRA, download the following script files and use <a href='http://meshcommander.com' rel='noreferrer noopener' target='_blank'>MeshCommander</a> to run the script to configure computers.<br /><br />";d+=addHtmlValue("Setup CIRA",'<a style=cursor:pointer onclick=fileDownload("mescript.ashx?type=1&meshid='+c.substring(0,16)+'","cira_setup.mescript")>cira_setup.mescript</a>');d+=addHtmlValue("Cleanup CIRA",'<a style=cursor:pointer onclick=fileDownload("mescript.ashx?type=2","cira_clean.mescript")>cira_clean.mescript</a>');d+="</div>";d+='<div id=dlgAddCira1 style=display:none>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'" with CIRA, load the following certificate as trusted root within Intel AMT';if(serverinfo.mpspass){d+=" and authenticate to the server using this username and password.<br /><br />"}else{d+=" and authenticate to the server using this username and any password.<br /><br />"}d+=addHtmlValue("Root Certificate",'<a style=cursor:pointer onclick=fileDownload("MeshServerRootCert.cer","MeshServerRootCert.cer")>Root Certificate File</a>');d+=addHtmlValue("Username",'<input style=width:230px readonly value="'+c.substring(0,16)+'" />');if(serverinfo.mpspass){d+=addHtmlValue("Password",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpspass)+'" />')}if(serverinfo!=null){d+=addHtmlValue("MPS Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')}d+="</div>";if((features&16)==0){d+='<div id=dlgAddCira2 style=display:none>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'" with CIRA, load the following certificate as trusted root within Intel AMT, authenticate using a client certificate with the following common name and connect to the following server.<br /><br />';d+=addHtmlValue("Root Certificate",'<a style=cursor:pointer onclick=fileDownload("MeshServerRootCert.cer","MeshServerRootCert.cer")>Root Certificate File</a>');d+=addHtmlValue("Organization",'<input style=width:230px readonly value="'+c+'" />');if(serverinfo!=null){d+=addHtmlValue("MPS Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')}d+="</div>"}setDialogMode(2,"Add Intel® AMT CIRA device",2,null,d,"fileDownload")}function dlgAddCiraSelClick(){var a=Q("dlgAddCiraSel").value;QV("dlgAddCira0",a==0);QV("dlgAddCira1",a==1);QV("dlgAddCira2",a==2)}function checkEmail(c){var d=c.split("@");var b=((d.length==2)&&(d[0].length>0)&&(d[1].split(".").length>1)&&(d[1].length>2));if(b==true){var e=d[1].split(".");for(var a in e){if(e[a].length==0){b=false}}}return b}function inviteAgentToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c="Invite someone to install the mesh agent. An email with be sent with the link to the mesh agent installation for "+EscapeHtml(a.name)+".<br /><br />";c+=addHtmlValue("Name (optional)",'<input id=agentInviteName value="" style=width:230px maxlength=64 />');c+=addHtmlValue("Email",'<input id=agentInviteEmail style=width:230px placeholder="example@email.com" onkeyup=validateAgentInvite()></input>');c+=addHtmlValue("Operating System","<select id=agentInviteNameOs style=width:236px><option value=0>Any supported</option><option value=1>Windows only</option><option value=3>Apple OSX only</option><option value=2>Linux only</option></select>");c+=addHtmlValue("Installation Type","<select id=agentInviteType style=width:236px><option value=0>Background and interactive</option><option value=2>Background only</option><option value=1>Interactive only</option></select>");c+=addHtmlValue("Message<br />(optional)",'<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>');setDialogMode(2,"Invite",3,performAgentInvite,c,b);validateAgentInvite()}function validateAgentInvite(){QE("idx_dlgOkButton",checkEmail(Q("agentInviteEmail").value))}function performAgentInvite(a,b){meshserver.send({action:"inviteAgent",meshid:b,email:Q("agentInviteEmail").value,name:Q("agentInviteName").value,os:Q("agentInviteNameOs").value,flags:Q("agentInviteType").value,msg:Q("agentInviteMessage").value})}function addAgentToMesh(c){if(xxdialogMode){return}var b=meshes[c],h="",a=0;h+=addHtmlValue("Operating System","<select id=aginsSelect onchange=addAgentToMeshClick() style=width:236px><option value=0>Windows</option><option value=1>Linux</option><option value=2>Apple OSX</option><option value=3>Windows (UnInstall)</option><option value=4>Linux (UnInstall)</option></select>");h+="<div id=aginsTypeDiv>";h+=addHtmlValue("Installation Type","<select id=aginsType onchange=addAgentToMeshClick() style=width:236px><option value=0>Background & interactive</option><option value=2>Background only</option><option value=1>Interactive only</option></select>");h+="</div><hr>";h+='<div id=agins_windows>To add a new computer to device group "'+EscapeHtml(b.name)+'", download the mesh agent and install it the computer to manage. This agent has server and mesh information embedded within it.<br /><br />';h+=addHtmlValue("Mesh Agent",'<a id=aginsw32lnk style=cursor:pointer onclick=fileDownload("meshagents?id=3&meshid='+c.split("/")[2]+'&installflags=","MeshAgent.exe",1) title="32bit version of the MeshAgent">Windows (.exe)</a>');h+=addHtmlValue("Mesh Agent",'<a id=aginsw64lnk style=cursor:pointer onclick=fileDownload("meshagents?id=4&meshid='+c.split("/")[2]+'&installflags=","MeshAgent.exe",1) title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');if(debugmode>0){h+=addHtmlValue("Settings File",'<a id=aginswmshlnk href="meshsettings?id='+c.split("/")[2]+'&installflags=0" rel="noreferrer noopener" target="_blank">'+EscapeHtml(b.name)+" settings (.msh)</a>")}h+="</div>";h+="<div id=agins_linux style=display:none>To add a computer to "+EscapeHtml(b.name)+" run the following command. Root credentials will be needed.<br />";h+="<textarea id=agins_linux_area rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>";h+="</div>";h+='<div id=agins_osx style=display:none>To add a new computer to device group "'+EscapeHtml(b.name)+'", download the mesh agent and install it the computer to manage. This agent installer has server and mesh information embedded within it.<br /><br />';h+=addHtmlValue("Mesh Agent",'<a href="meshosxagent?id=16&meshid='+c.split("/")[2]+'" rel="noreferrer noopener" target="_blank" title="64bit version of OSX Mesh Agent">OSX Agent (64bit)</a>');h+="</div>";h+='<div id=agins_windows_un style=display:none>To remove a mesh agent, download the file below, run it and click "uninstall".<br /><br />';h+=addHtmlValue("Mesh Agent",'<a style=cursor:pointer onclick=fileDownload("meshagents?id=3","MeshAgent.exe") title="32bit version of the MeshAgent">Windows (.exe)</a>');h+=addHtmlValue("Mesh Agent",'<a style=cursor:pointer onclick=fileDownload("meshagents?id=4","MeshAgent.exe") title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');h+="</div>";h+="<div id=agins_linux_un style=display:none>To remove a mesh agent, run the following command. Root credentials will be needed.<br />";h+="<textarea id=agins_linux_area_un rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>";h+="</div>";setDialogMode(2,"Add Mesh Agent",2,null,h,"fileDownload");var g=serverinfo.name;if((g=="un-configured")||((features&2)!=0)){g=window.location.hostname}var d=((features&8192)!=0)?"--no-proxy ":"";if(serverinfo.https==true){var e=(serverinfo.port==443)?"":(":"+serverinfo.port);Q("agins_linux_area").value="wget https://"+g+e+"/meshagents?script=1 "+d+"--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://"+g+e+" '"+c.split("/")[2]+"'\r\n";Q("agins_linux_area_un").value="wget https://"+g+e+"/meshagents?script=1 "+d+"--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"}else{var e=(serverinfo.port==80)?"":(":"+serverinfo.port);Q("agins_linux_area").value="wget http://"+g+e+"/meshagents?script=1 "+d+"-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://"+g+e+" '"+c.split("/")[2]+"'\r\n";Q("agins_linux_area_un").value="wget http://"+g+e+"/meshagents?script=1 "+d+"-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"}Q("aginsSelect").focus();addAgentToMeshClick()}function fileDownload(g,d,a){var h=null,c="";if(a==1){c=Q("aginsType").value}else{if(a==2){c=Q("aginsSelect").value;if(parseInt(c)>=5){d=d.toLowerCase()}else{d+=".exe"}}}try{h=new XDomainRequest()}catch(b){}if(!h){h=new XMLHttpRequest()}h.open("GET",window.location.href+g+c);h.timeout=15000;h.responseType="blob";h.onprogress=function(e){console.log(e)};h.onload=function(j){saveAs(new Blob([j.target.response],{type:"application/octet-stream"}),d);if(xxdialogTag=="fileDownload"){setDialogMode(0)}};h.onerror=function(){if(xxdialogTag=="fileDownload"){setDialogMode(0)}alert("Agent downloads timeout.")};h.ontimeout=function(){if(xxdialogTag=="fileDownload"){setDialogMode(0)}alert("Unable to download agent.")};h.send()}function addAgentToMeshClick(){var a=Q("aginsSelect").value;QV("agins_windows",a==0);QV("agins_linux",a==1);QV("agins_osx",a==2);QV("agins_windows_un",a==3);QV("agins_linux_un",a==4);QV("aginsTypeDiv",a==0);if(debugmode>0){Q("aginswmshlnk").href=(Q("aginswmshlnk").href.split("installflags=")[0])+"installflags="+Q("aginsType").value}}function validateDeviceToMesh(){QE("idx_dlgOkButton",(Q("dp1devicename").value.length>0)&&(passwordcheck(Q("dp1password").value)))}function addDeviceToMeshEx(b,d){var a=Q("dp1username").value;if(a==""){a="admin"}var c=Q("dp1hostname").value;if(c==""){c=Q("dp1devicename").value}meshserver.send({action:"addamtdevice",meshid:d,devicename:Q("dp1devicename").value,hostname:c,amtusername:a,amtpassword:Q("dp1password").value,amttls:Q("dp1tls").value})}function deviceHeaderSet(){if(deviceHeaderId==0){deviceHeaderId=1;return}deviceHeaders["DevxHeader"+deviceHeaderId]=", "+deviceHeaderTotal+((deviceHeaderTotal==1)?" node":" nodes");deviceHeaderId++;deviceHeaderCount={};deviceHeaderTotal=0}var powerStateStrings=["",'<span title="Device is powered on.">Powered</span>','<span title="Device is in sleep state (S1).">Sleeping</span>','<span title="Device is in sleep state (S2).">Sleeping</span>','<span title="Device is in deep sleep state (S3).">Deep Sleep</span>','<span title="Device is in hibernating state (S4).">Hibernating</span>','<span title="Device is in powered off state (S5).">Soft-Off</span>','<span title="Device is detected but power state could not be obtained.">Present</span>'];var powerStateStrings2=["","Device is powered","Device is in sleep state (S1)","Device is in sleep state (S2)","Device is in deep sleep state (S3)","Device is hibernating (S4)","Device is in soft-off state (S5)","Device is present, but power state cannot be determined"];var powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];function NodeStateStr(a){var b=[];if(a.state>0&&a.state<powerStatetable.length){state.push(powerStatetable[a.state])}if(a.conn){if((a.conn&1)!=0){b.push('<span title="Mesh agent is connected and ready for use.">Agent</span>')}if((a.conn&2)!=0){b.push('<span title="Intel® AMT CIRA is connected and ready for use.">CIRA</span>')}if((a.conn&4)!=0){b.push('<span title="Intel® AMT is routable.">Intel® AMT</span>')}if((a.conn&8)!=0){b.push('<span title="Mesh agent is reachable using another agent as relay.">Relay</span>')}}if((a.pwr!=null)&&(a.pwr!=0)){b.push(powerStateStrings[a.pwr])}return b.join(", ")}function PowerStateStr(a){if(a<powerStatetable.length){return powerStatetable[a]}return""}function PowerStateStr2(a){if((a!=0)&&(a<powerStatetable.length)){return powerStatetable[a]}return"Unknown"}function selectallButtonFunction(){var b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked===true){a++}}for(var c=0;c<b.length;c++){b[c].checked=(a==0)}p1updateInfo()}function p1updateInfo(){var b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked===true){a++}}if(a>0){QE("GroupActionButton",true);Q("SelectAllButton").value="Select None";QV("cxmgroupsplit",true);QV("cxmdesktop",true)}else{QE("GroupActionButton",false);Q("SelectAllButton").value="Select All";QV("cxmgroupsplit",false);QV("cxmdesktop",false)}}function groupActionFunction(){var a="Select an operation to perform on all selected devices. Actions will be performed only with proper rights.<br /><br />";a+=addHtmlValue("Operation","<select id=d2groupop style=float:right;width:250px><option value=100>Wake-up devices</option><option value=4>Sleep devices</option><option value=3>Reset devices</option><option value=2>Power off devices</option><option value=102>Move to device group</option><option value=101>Delete devices</option></select>");setDialogMode(2,"Group Action",3,groupActionFunctionEx,a)}function getCheckedDevices(){var e=[],b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked){if(b[c].value){var d=b[c].value.substring(6);if(e.indexOf(d)==-1){e.push(d)}}}}return e}function groupActionFunctionEx(){var a=Q("d2groupop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:getCheckedDevices()})}else{if(a==101){var b="Confirm delete selected devices(s)?<br /><br />";b+="<label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelEx() />Confirm</label>";setDialogMode(2,"Delete Nodes",3,groupActionFunctionDelEx,b);QE("idx_dlgOkButton",false)}else{if(a==102){p10showChangeGroupDialog(getCheckedDevices())}else{meshserver.send({action:"poweraction",nodeids:getCheckedDevices(),actiontype:a})}}}}function d2groupActionFunctionDelEx(){QE("idx_dlgOkButton",Q("d2check").checked)}function groupActionFunctionDelEx(){meshserver.send({action:"removedevices",nodeids:getCheckedDevices()})}function onSortSelectChange(a){sort=document.getElementById("sortselect").selectedIndex;if(!a){putstore("sort",sort)}}function meshSort(c,d){if(c.meshnamel>d.meshnamel){return 1}if(c.meshnamel<d.meshnamel){return -1}if(c.meshid==d.meshid){if(showRealNames==true){if(c.rnamel>d.rnamel){return 1}if(c.rnamel<d.rnamel){return -1}return 0}else{if(c.namel>d.namel){return 1}if(c.namel<d.namel){return -1}return 0}}return 0}function powerSort(c,e){var d=c.pwr?c.pwr:0;var g=e.pwr?e.pwr:0;if(d>g){return -1}if(d<g){return 1}if(d==g){if(showRealNames==true){if(c.rnamel>e.rnamel){return 1}if(c.rnamel<e.rnamel){return -1}return 0}else{if(c.namel>e.namel){return 1}if(c.namel<e.namel){return -1}return 0}}return 0}function deviceSort(c,d){if(c.namel>d.namel){return 1}if(c.namel<d.namel){return -1}return 0}function deviceHostSort(c,d){if(c.rnamel>d.rnamel){return 1}if(c.rnamel<d.rnamel){return -1}return 0}function onSearchFocus(a){searchFocus=a}function onMapSearchFocus(a){mapSearchFocus=a}function onUserSearchFocus(a){userSearchFocus=a}function onConsoleFocus(a){consoleFocus=a}function onSearchInputChanged(){var h=Q("SearchInput").value.toLowerCase().trim();putstore("search",h);if(h==""){for(var a in nodes){nodes[a].v=true}}else{try{var c=h.split(/\s+/).join("|"),e=new RegExp(c);for(var a in nodes){nodes[a].v=(e.test(nodes[a].name.toLowerCase()))||(nodes[a].rnamel!=null&&e.test(nodes[a].rnamel.toLowerCase()));if((nodes[a].v==false)&&nodes[a].tags){for(var g in nodes[a].tags){if(e.test(nodes[a].tags[g].toLowerCase())){nodes[a].v=true;break}else{nodes[a].v=false}}}}}catch(b){for(var a in nodes){nodes[a].v=true}}}}var contextelement=null;function handleContextMenu(d){hideContextMenu();var l=(window.pageXOffset!==null)?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;var m=(window.pageYOffset!==null)?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;var c=document.elementFromPoint(d.pageX-l,d.pageY-m);if(c&&c!=null&&c.id=="MxMESH"){contextelement=c;var b=document.getElementById("meshContextMenu");b.style.left=d.pageX+"px";b.style.top=d.pageY+"px";b.style.display="block"}else{while(c&&c!=null&&c.id!="devs"){c=c.parentElement}if(!c||c==null){return true}contextelement=c;var b=document.getElementById("contextMenu");b.style.left=d.pageX+"px";b.style.top=d.pageY+"px";b.style.display="block"}var k=contextelement.children[1].attributes.onclick.value;var j=getNodeFromId(k.substring(12,k.length-18));var e=meshes[j.meshid];var g=e.links["user/"+domain+"/"+userinfo.name.toLowerCase()];var h=g.rights;var a=((h&16)!=0);QV("cxdesktop",((e.mtype==1)||(j.agent==null)||(j.agent.caps==null)||((j.agent.caps&1)!=0)||(j.intelamt&&(j.intelamt.state==2)))&&((h&8)||(h&256)));QV("cxterminal",((e.mtype==1)||(j.agent==null)||(j.agent.caps==null)||((j.agent.caps&2)!=0)||(j.intelamt&&(j.intelamt.state==2)))&&(h&8));QV("cxfiles",((e.mtype==2)&&((j.agent==null)||(j.agent.caps==null)||((j.agent.caps&4)!=0)))&&(h&8));QV("cxevents",(j.intelamt!=null)&&((j.intelamt.state==2)||(j.conn&2))&&(h&8));QV("cxconsole",(a&&(e.mtype==2)&&((j.agent==null)||(j.agent.caps==null)||((j.agent.caps&8)!=0)))&&(h&8));return haltEvent(d)}function cmaction(a,b){var c=contextelement.children[1].attributes.onclick.value;c=c.substring(12,c.length-18);if(a==7){Q("viewselect").value=3;Q("viewselect").onchange();Q("autoConnectDesktopCheckbox").checked=true;Q("autoConnectDesktopCheckbox").onclick()}if((a>0)&&(a<7)){var d=[0,10,12,11,13,16,15][a];if(b&&(b.shiftKey==true)){window.open(window.location.origin+"?node="+c.split("/")[2]+"&viewmode="+d+"&hide=16","meshcentral:"+c)}else{gotoDevice(c,d)}}}function cmmeshaction(a){var d=contextelement.attributes.onclick.value.substring(32,(32+69));var b=document.getElementsByClassName("DeviceCheckbox");if(a==1){for(var c=0;c<b.length;c++){if((b[c].attributes)&&(b[c].attributes["class"]["value"].substring(0,69)==d)){b[c].checked=true}}}if(a==2){for(var c=0;c<b.length;c++){if((b[c].attributes)&&(b[c].attributes["class"]["value"].substring(0,69)==d)){b[c].checked=false}}}p1updateInfo()}function hideContextMenu(){QV("contextMenu",false);QV("meshContextMenu",false);contextelement=null}var xxmap={map:null,contextmenu:null,activeInteractions:[],showindex:0,markersSource:null,markersLayer:null,mapLayer:null,mapView:null,};function updateMapMarkers(j){if((xxmap!=null)&&(xxmap.map==null)){try{loadmap()}catch(b){console.error("loadmap() exception",b)}}if(xxmap==null){return}var a=null;for(var d in nodes){try{var g=map_parseNodeLoc(nodes[d]),c=xxmap.markersSource.getFeatureById(nodes[d]._id);if((g!=null)&&((nodes[d].meshid==j)||(j==null))){var e=g[0],h=g[1],k=g[2];if(a==null){a=[e,h,e,h,0]}else{if(e<a[0]){a[0]=e}if(h<a[1]){a[1]=h}if(e>a[2]){a[2]=e}if(h>a[3]){a[3]=h}}if(c==null){addFeature(nodes[d]);a[4]=1}else{updateFeature(nodes[d],c);c.setStyle(markerStyle(nodes[d],g[2]))}}else{if(c){xxmap.markersSource.removeFeature(c)}}}catch(b){console.error("updateMapMarkers() exception",b,JSON.stringify(nodes[d]))}}return a}var map_cm_popup=new ol.Overlay({element:Q("xmap-info-window"),positioning:"bottom-center",stopEvent:false});var map_cm_editMarker={text:"Modify node location",callback:function(a){modifyMarkerloc(a.data)}};var map_cm_clearMarker={text:"Remove node location",callback:function(a){meshserver.send({action:"changedevice",nodeid:a.data.a,userloc:[]})}};var map_cm_saveMarker={text:"Save node location",callback:function(a){saveMarkerloc(a.data)}};var map_cm_nodemenu_items=[{text:"General information",callback:function(a){if(a.data!=null){gotoDevice(a.data,10)}}},{text:"Desktop",callback:function(a){if(a.data!=null){gotoDevice(a.data,11)}}},{text:"Terminal",callback:function(a){if(a.data!=null){gotoDevice(a.data,12)}}},{text:"Intel® AMT",callback:function(a){if(a.data!=null){gotoDevice(a.data,14)}}},"-",{text:"Zoom-in to extent",callback:function(b){var a=b.data.getGeometry().getCoordinates();zoomToLocation(a,19)}},{text:"Zoom-out to extent",callback:function(b){var a=b.data.getGeometry().getCoordinates();zoomToLocation(a,2)}}];var contextmenu_items=[{text:"Refresh",callback:function(){refreshMap(true,true)}},{text:"Zoom to fit extent",callback:function(){zoomToFitExtent()}},{text:"Center map here",callback:function(a){xxmap.mapView.animate({center:a.coordinate})}},{text:"Place node here",callback:function(a){placeNode(a.coordinate)}}];function stringToIntHash(c){var a=0,b;for(b=0;b<c.length;b++){a=((a<<5)-a)+c.charCodeAt(b);a|=0}return a}function map_parseNodeLoc(b){var a=null,c=0;if(b.iploc){a=b.iploc;c=1}if(b.wifiloc){a=b.wifiloc;c=2}if(b.gpsloc){a=b.gpsloc;c=3}if(b.userloc){a=b.userloc;c=4}if((a==null)||(typeof a!="string")){return null}a=a.split(",");if(c==1){return[parseFloat(a[0])+(stringToIntHash(b._id.substring(0,20))/100000000000),parseFloat(a[1])+(stringToIntHash(b._id.substring(20))/100000000000),c]}else{return[parseFloat(a[0]),parseFloat(a[1]),c]}}function loadmap(){if(xxmap==null){return}try{xxmap.markersSource=new ol.source.Vector();xxmap.markersLayer=new ol.layer.Vector({source:xxmap.markersSource});xxmap.mapLayer=new ol.layer.Tile({source:new ol.source.OSM()});xxmap.mapView=new ol.View({center:ol.proj.transform([0,0],"EPSG:4326","EPSG:3857"),zoom:2,minZoom:2,maxZoom:20,extent:ol.proj.transformExtent([-100000,-69.55,100000,69.55],"EPSG:4326","EPSG:3857")});xxmap.map=new ol.Map({target:"xdevicesmap",layers:[xxmap.mapLayer,xxmap.markersLayer],view:xxmap.mapView});xxmap.map.addOverlay(map_cm_popup);xxmap.map.on("click",function(c){var d=xxmap.map.forEachFeatureAtPixel(c.pixel,function(h,j){return h});if(d){var g=d.getId();if(g!=null){gotoDevice(g,10)}else{var e=getCorrespondingFeature(d);gotoDevice(e.getId(),10)}}});xxmap.map.on("pointermove",function(d){var g=xxmap.map.forEachFeatureAtPixel(d.pixel,function(j,k){return j});if(g){xxmap.map.getTargetElement().style.cursor="pointer";var c=g.getGeometry().getCoordinates();map_cm_popup.setPosition(c);var e=g.getId();if(e){QH("xmap-info-window",g.get("name"))}else{var h=getCorrespondingFeature(g);QH("xmap-info-window",h.get("name"))}}else{xxmap.map.getTargetElement().style.cursor="";QH("xmap-info-window","")}});var a=new ContextMenu({width:160,defaultItems:false,items:contextmenu_items});a.on("open",function(c){var e=xxmap.map.forEachFeatureAtPixel(c.pixel,function(h,j){return h});xxmap.contextmenu.clear();if(e){var d=e.getId();if(d){addContextMenuItems(e)}else{var g=getCorrespondingFeature(e);if(g){addContextMenuItems(g)}else{xxmap.contextmenu.extend(contextmenu_items)}}}else{xxmap.contextmenu.extend(contextmenu_items)}});if(xxmap.contextmenu==null){xxmap.contextmenu=a}xxmap.map.addControl(xxmap.contextmenu)}catch(b){console.log(b);QV("viewselectmapoption",false);QV("devViewButton4",false);xxmap=null}}function addFeature(g,c,e){var a=getModifiedFeature(g._id);if(a){xxmap.markersSource.addFeature(a)}else{if(!c&&!e){var d=map_parseNodeLoc(g);c=d[0];e=d[1]}if(e>180){e=180-e;meshserver.send({action:"changedevice",nodeid:g._id,userloc:[c,e]})}if((c<90)&&(c>-90)&&(e<180)&&(e>-180)){var b=new ol.Feature({geometry:new ol.geom.Point(ol.proj.transform([e,c],"EPSG:4326","EPSG:3857")),name:g.name,status:g.conn,lat:c,lon:e});b.setId(g._id);b.setStyle(markerStyle(g));xxmap.markersSource.addFeature(b)}}}function removeFeature(b){var a=xxmap.markersSource.getFeatureById(b._id);if(a){xxmap.markersSource.removeFeature(a)}}function updateFeature(g,a){if(g.conn!=a.get("status")){a.set("status",g.conn);a.setStyle(markerStyle(g))}var c=map_parseNodeLoc(g);if(c!=null){var b=c[0],d=c[1];if((b!=a.get("lat"))||(d!=a.get("lon"))){a.set("lat",b);a.set("lon",d);var e=ol.proj.transform([parseFloat(d),parseFloat(b)],"EPSG:4326","EPSG:3857");a.getGeometry().setCoordinates(e)}}if(g.name!=a.get("name")){a.set("name",g.name)}}function modifyMarkerloc(c){var b=c.getId();if(b){c.setStyle(markerStyle(getNodeFromId(c.a),4));if(!getActiveInteractions(c)){var a=new ol.interaction.Modify({features:new ol.Collection([c]),pixelTolerance:10});xxmap.activeInteractions.push({featureid:b,feature:c,interaction:a});xxmap.map.addInteraction(a)}}}function saveMarkerloc(d){var c=d.getId();if(c){var a=getActiveInteractions(d);if(a){xxmap.map.removeInteraction(a);removeInteraction(c);var b=d.getGeometry().getCoordinates();var e=ol.proj.transform(b,"EPSG:3857","EPSG:4326");if(e[0]>180){e[0]=180-e[0]}var g=[e[1],e[0]];meshserver.send({action:"changedevice",nodeid:c,userloc:g})}}}function markerStyle(b,d){if(d==null){d=0;if(b.iploc){d=1}if(b.wifiloc){d=2}if(b.gpsloc){d=3}if(b.userloc){d=4}}var e=["","-ip","-wifi","-gps","-user"];var a=connStateColor(b);var c=new ol.style.Style({image:new ol.style.Icon({color:a,anchor:[0.5,1],src:"images/mapmarker"+e[d]+".png"})});return[c]}function connStateColor(a){if(a.conn==1||a.conn==3||a.conn==5){return"#00ffdd"}return"#C70039"}function addContextMenuItems(a){if(getActiveInteractions(a)){map_cm_saveMarker.data=a;xxmap.contextmenu.push(map_cm_saveMarker)}else{map_cm_editMarker.data=a;xxmap.contextmenu.push(map_cm_editMarker);var b=getNodeFromId(a.a);if(b.userloc){map_cm_clearMarker.data=a;xxmap.contextmenu.push(map_cm_clearMarker)}}map_cm_nodemenu_items.forEach(function(c){if(c.text=="Zoom-in to extent"||c.text=="Zoom-out to extent"){c.data=a}else{if(c!="-"){c.data=a.getId()}}});xxmap.contextmenu.extend(map_cm_nodemenu_items)}function getActiveInteractions(b){var a=b.getId();for(var c=0;c<xxmap.activeInteractions.length;c++){if(xxmap.activeInteractions[c].featureid==a){return xxmap.activeInteractions[c].interaction}}return false}function getModifiedFeature(a){if(a){for(var b=0;b<xxmap.activeInteractions.length;b++){if(xxmap.activeInteractions[b].featureid==a){return xxmap.activeInteractions[b].feature}}}return null}function removeInteraction(a){var c=-1;for(var b=0;b<xxmap.activeInteractions.length;b++){if(xxmap.activeInteractions[b].featureid===a){c=b;break}}if(c>=0){xxmap.activeInteractions.splice(c,1)}}function getCorrespondingFeature(e){var d=e.getGeometry().getCoordinates();for(var b=0;b<xxmap.activeInteractions.length;b++){var c=xxmap.activeInteractions[b].feature;var a=c.getGeometry().getCoordinates();if(a[0].toFixed(5)==d[0].toFixed(5)&&a[1].toFixed(5)==d[1].toFixed(5)){return c}}return null}function refreshMap(k,h){if(k){xxmap.map.setTarget(null);xxmap.map=null;xxmap.markersSource=null;xxmap.mapView=null;xxmap.mapLayer=null;xxmap.activeInteractions=[]}var a=updateMapMarkers();if((a!=null)&&(h||(a[4]==1))){var b=(a[0]+a[2])/2;var c=(a[1]+a[3])/2;var d=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]));var l=xxmap.map.getView();l.setCenter(ol.proj.transform([c,b],"EPSG:4326","EPSG:3857"));var e=360,g=-2;while(e>d){g++;e=e/2}l.setZoom(g)}}function placeNode(a){if(xxdialogMode){return}var c='<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="Device name" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>No devices found.</div>';for(var b in nodes){c+="<div class=noselect id="+nodes[b]._id+"-rowid onclick=selectNodeToPlace(event,'"+nodes[b]._id+"') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id="+nodes[b]._id+"-checkid type=checkbox style=width:16px;display:inline />";c+="<div class=j"+nodes[b].icon+" style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>"+nodes[b].name+"</div></div>"}setDialogMode(2,"Select a node to place",3,placeNodeEx,c+"</div>",a);onPlaceNodeInputChange()}function placeNodeEx(b,c){var d=document.getElementsByName("PlaceMapDeviceCheckbox");for(var g in d){if(d[g].checked){var h=getNodeFromId(d[g].id.substring(0,d[g].id.length-8));if(h){var e=xxmap.markersSource.getFeatureById(g);var j=ol.proj.transform(c,"EPSG:3857","EPSG:4326");var k=[j[1],j[0]];if(e){e.getGeometry().setCoordinates(c);var a=getActiveInteractions(e);if(a){saveMarkerloc(e)}else{meshserver.send({action:"changedevice",nodeid:h._id,userloc:k})}}else{meshserver.send({action:"changedevice",nodeid:h._id,userloc:k})}}}}}function onPlaceNodeInputChange(){updatePlaceNodeTable(Q("selectnode-search").value.trim().toLowerCase())}function updatePlaceNodeTable(d){var b=document.getElementsByName("PlaceMapDeviceCheckbox"),a=0;for(var c in nodes){var e=((nodes[c].namel.indexOf(d)>=0||d=="")||(nodes[c].rnamel!=null&&nodes[c].rnamel.indexOf(d)>=0));if(e){a++}QV(nodes[c]._id+"-rowid",e)}QV("noNodesMapPlace",a==0)}function selectNodeToPlace(b,g){if(b.target.name!="PlaceMapDeviceCheckbox"){var h=Q(g+"-checkid");h.checked=!h.checked}var c=document.getElementsByName("PlaceMapDeviceCheckbox"),a=0;for(var d in c){if(c[d].checked){a++}}QE("idx_dlgOkButton",a>0)}function addMeshOptions(a,b){}function meshOptionRmvMod(a,b){}function meshExists(){for(var a in meshes){if(meshes[a]){return true}}return false}function setMeshView(a){var c=Q("select-mesh");var b=c.selectedIndex;if(c[b].value==a){c[0].selected=true;onSelectMeshChange()}}function clearMeshOptions(){}function getSearchLocation(){try{var b=Q("mapSearchLocation").value.trim();if(b.length>0){var c=new XMLHttpRequest();c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){formatSearchData(c.responseText)}};c.open("GET","https://nominatim.openstreetmap.org/search?q="+b+"&format=json",true);c.send()}}catch(a){}}function formatSearchData(c){try{QH("xmapSearchResults","");var d=JSON.parse(c),b=0,k='<div style="overflow-y:auto;width:100%;max-height:240px">';for(var j=0;j<d.length;j++){if(d[j].display_name&&d[j].boundingbox[0]&&d[j].boundingbox[1]&&d[j].boundingbox[2]&&d[j].boundingbox[3]){b++;var a=(j%2==0)?"F5F5F5":"EBEBEB";k+="<div style=cursor:pointer;padding:5px;background-color:#"+a+" onclick=mapGotoSelectedLocation(this)><div>"+d[j].display_name+"</div><div style=display:none>"+d[j].boundingbox[0]+"!#!"+d[j].boundingbox[1]+"!#!"+d[j].boundingbox[2]+"!#!"+d[j].boundingbox[3]+"</div></div>"}}k+="</div>";if(b==1){var h=[parseFloat(d[0].boundingbox[2]),parseFloat(d[0].boundingbox[0]),parseFloat(d[0].boundingbox[3]),parseFloat(d[0].boundingbox[1])];zoomToExtent(h)}else{if(b==0){k="<div style=width:200px>No location found.<div>"}QV("xmapSearchResultsDlg",true)}QH("xmapSearchResults",k)}catch(g){}}function mapGotoSelectedLocation(c){var d=c.children;var a=d[1].innerHTML.split("!#!");var b=[parseFloat(a[2]),parseFloat(a[0]),parseFloat(a[3]),parseFloat(a[1])];zoomToExtent(b);mapCloseSearchWindow()}function mapCloseSearchWindow(){QH("xmapSearchResults","");QV("xmapSearchResultsDlg",false)}function zoomToLocation(a,c){var b=xxmap.map.getView();b.setCenter(a);b.setZoom(c)}function zoomToFitExtent(){var b=xxmap.markersSource.getFeatures();if(b.length>0){var a=xxmap.markersSource.getExtent();xxmap.map.getView().fit(a,xxmap.map.getSize())}}function zoomToExtent(b){var a=ol.proj.transformExtent(b,ol.proj.get("EPSG:4326"),ol.proj.get("EPSG:3857"));xxmap.map.getView().fit(a,xxmap.map.getSize())}function refreshDevice(a){if(!currentNode||currentNode._id!=a){return}gotoDevice(a,xxcurrentView,true)}function getNodeRights(c){var b=getNodeFromId(c),a=meshes[b.meshid];return a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights}var currentNode;var powerTimelineNode=null;var powerTimelineReq=null;var powerTimelineUpdate=null;var powerTimeline=null;function getCurrentNode(){return currentNode}function gotoDevice(p,r,u,h){if((userinfo.emailVerified!==true)&&(serverinfo.emailcheck==true)&&(userinfo.siteadmin!=4294967295)){setDialogMode(2,"New Device Group",1,null,'Unable to create a new device group until a email address is verified. This is required for password recovery. Go to the "My Account" tab to change and verify an email address.');return}if(h&&(h.shiftKey==true)){window.open(window.location.origin+"?node="+p.split("/")[2]+"&viewmode=10&hide=16","meshcentral:"+p);return}var o=getNodeFromId(p);var l=meshes[o.meshid];var m=l.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if(!currentNode||currentNode._id!=o._id||u==true){currentNode=o;var n=EscapeHtml(o.name);if(n.length==0){n="<i>None</i>"}if((m&4)!=0){n='<span title="Click here to edit the server-side device name" onclick=showEditNodeValueDialog(0) style=cursor:pointer>'+n+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>'}QH("p10deviceName",n);QH("p11deviceName",n);QH("p12deviceName",n);QH("p13deviceName",n);QH("p14deviceName",n);QH("p15deviceName","Console - "+n);QH("p16deviceName",n);var y="<table style=width:100%>";y+=addDeviceAttribute('<span title="The name of the device group this computer belong to.">Group</span>','<a title="The name of the device group this computer belong to" onclick=gotoMesh("'+o.meshid+'") style=cursor:pointer>'+EscapeHtml(meshes[o.meshid].name)+"</a>");if((o.rname!=null)&&(o.name!=o.rname)){y+=addDeviceAttribute('<span title="The name of this computer as set in the operating system">Name</span>','<span title="The name of this computer as set in the operating system">'+EscapeHtml(o.rname)+"</span>")}if((features&1)==0){if((m&4)!=0){if(o.host){y+=addDeviceAttribute("Hostname","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>"+EscapeHtml(o.host)+"</span>")}else{y+=addDeviceAttribute("Hostname","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer><i>None</i></span>")}}else{y+=addDeviceAttribute("Hostname",EscapeHtml(o.host))}}var g=o.desc?EscapeHtml(o.desc):"<i>None</i>";if((m&4)!=0){y+=addDeviceAttribute("Description","<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>"+g+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>')}else{y+=addDeviceAttribute("Description",g)}var a=["Unknown","Windows 32bit console","Windows 64bit console","Windows 32bit service","Windows 64bit service","Linux 32bit","Linux 64bit","MIPS","XENx86","Android ARM","Linux ARM","OSX 32bit","Android x86","PogoPlug ARM","Android APK","Linux Poky x86-32bit","OSX 64bit","ChromeOS","Linux Poky x86-64bit","Linux NoKVM x86-32bit","Linux NoKVM x86-64bit","Windows MinCore console","Windows MinCore service","NodeJS","ARM-Linaro","ARMv6l / ARMv7l"];if((o.agent!=null)&&(o.agent.id!=null)&&(o.agent.ver!=null)){var v="";if(o.agent.id<=a.length){v=a[o.agent.id]}else{v=a[0]}if(o.agent.ver!=0){v+=" v"+o.agent.ver}y+=addDeviceAttribute("Mesh Agent",v)}if(o.intelamt!=null){var v="";var t={0:"Not Activated (Pre)",1:"Not Activated (In)",2:"Activated"};if(o.intelamt.ver!=null&&o.intelamt.state==null){v+="<i>Unknown State</i>, v"+o.intelamt.ver}else{if((o.intelamt.ver==null)&&(o.intelamt.state==2)){v+="<i>Activated</i>"}else{if((o.intelamt.ver==null)||(o.intelamt.state==null)){v+="<i>Unknown Version & State</i>"}else{v+=t[o.intelamt.state];if(o.intelamt.flags){if(o.intelamt.flags&2){v+=' <span title="Intel AMT is activated in Client Control Mode">CCM</span>'}else{if(o.intelamt.flags&4){v+=' <span title="Intel AMT is activated in Admin Control Mode">ACM</span>'}}}v+=(", v"+o.intelamt.ver)}}}if(o.intelamt.tls==1){v+=', <span title="Intel AMT is setup with TLS network security">TLS</span>'}if(o.intelamt.state==2){if(o.intelamt.user==null||o.intelamt.user==""){if((m&4)!=0){v+=', <i style=color:#FF0000;cursor:pointer title="Edit Intel® AMT credentials" onclick=editDeviceAmtSettings("'+o._id+'")>No Credentials</i>'}else{v+=", <i style=color:#FF0000>No Credentials</i>"}}v+=" ";if((m&4)!=0){v+='<img src=images/link4.png height=10 width=10 title="Edit Intel® AMT credentials" style=cursor:pointer onclick=editDeviceAmtSettings("'+o._id+'")>'}}y+=addDeviceAttribute("Intel® AMT",v)}if((o.agent!=null)&&(o.agent.tag!=null)&&(o.agent.tag!="mailto:")){var w=EscapeHtml(o.agent.tag);if(w.startsWith("mailto:")){w='<a href="'+w+'">'+w.substring(7)+"</a>"}y+=addDeviceAttribute("Agent Tag",w)}if(o.osdesc){y+=addDeviceAttribute("Operating System",o.osdesc)}if(o.users&&o.conn&&(o.users.length>0)&&(o.conn&1)){y+=addDeviceAttribute("Active User"+((o.users.length>1)?"s":""),o.users.join(", "))}var c=o.conn;if(c&&c>1){var e=[];if((o.conn&1)!=0){e.push('<span title="Mesh agent is connected and ready for use.">Mesh Agent</span>')}if((o.conn&2)!=0){e.push('<span title="Intel® AMT CIRA is connected and ready for use.">Intel® AMT CIRA</span>')}if((o.conn&4)!=0){e.push('<span title="Intel® AMT is routable and ready for use.">Intel® AMT</span>')}if((o.conn&8)!=0){e.push('<span title="Mesh agent is reachable using another agent as relay.">Mesh Relay</span>')}y+=addDeviceAttribute("Connectivity",e.join(", "))}var j="<i>None</i>";if(o.tags!=null){j="";for(var k in o.tags){j+='<span style="background-color:lightgray;padding:3px;margin-right:4px;border-radius:5px">'+o.tags[k]+"</span>"}}y+=addDeviceAttribute("Tags","<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>"+j+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>');y+="</table><br />";if((m&76)!=0){y+='<input type=button value=Actions title="Perform power actions on the device" onclick=deviceActionFunction() />'}y+='<input type=button value=Notes title="View notes about this device" onclick=showNotes('+((m&128)==0)+',"'+encodeURIComponent(o._id)+'") />';QH("p10html",y);masterUpdate(256);y="<div style=float:right;font-size:x-small>";if((m&4)!=0){y+=' <a style=cursor:pointer onclick=p10showChangeGroupDialog(["'+o._id+'"]) title="Move this device to a different device group">Change Group</a>';y+=' <a style=cursor:pointer onclick=p10showDeleteNodeDialog("'+o._id+'") title="Remove this device">Delete Device</a>'}y+="</div><div style=font-size:x-small>";if(l.mtype==2){y+='<a style=cursor:pointer onclick=p10showNodeNetInfoDialog("'+o._id+'") title="Show device network interface information">Interfaces</a> '}if(xxmap!=null){y+='<a style=cursor:pointer onclick=p10showNodeLocationDialog("'+o._id+'") title="Show device locations information">Location</a> '}if(((m&8)!=0)&&(l.mtype==2)){y+='<a style=cursor:pointer onclick=p10showMeshCmdDialog(1,"'+o._id+'") title="Traffic router used to connect to a device thru this server.">Router</a> '}if(((c&1)!=0)&&(clickOnce==true)&&(l.mtype==2)&&((m&8)!=0)){if((o.agent.id>0)&&(o.agent.id<5)){y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","RDP2",3389) title="Requires Microsoft ClickOnce support in your browser.">RDP</a> '}if(o.agent.id>4){y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","PSSH",22) title="Requires Microsoft ClickOnce support in your browser.">Putty</a> ';y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","WSCP",22) title="Requires Microsoft ClickOnce support in your browser.">WinSCP</a> '}}y+="</div><br>";QH("p10html3",y);var s=PowerStateStr(o.state);if((c&1)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Agent connected">Agent connected</span>'}if((c&2)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Intel® AMT connected">Intel® AMT connected</span>'}if((c&4)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Intel® AMT detected">Intel® AMT detected</span>'}if((s=="")&&o.lastconnect){s="<span style=font-size:12px>Last seen:<br />"+new Date(o.lastconnect).toLocaleDateString()+", "+new Date(o.lastconnect).toLocaleTimeString()+"</span>"}QH("MainComputerState",s);Q("MainComputerImage").setAttribute("src","images/icons200-"+o.icon+"-1.jpg");Q("MainComputerImage").className=((!o.conn)||(o.conn==0)?"gray":"");setupTerminal();setupFiles();var d=((m&16)!=0);if(d){setupConsole()}else{if(r==15){r=10}}QV("MainDevDesktop",((l.mtype==1)||(o.agent==null)||(o.agent.caps==null)||((o.agent.caps&1)!=0)||(o.intelamt&&(o.intelamt.state==2)))&&((m&8)||(m&256)));QV("MainDevTerminal",((l.mtype==1)||(o.agent==null)||(o.agent.caps==null)||((o.agent.caps&2)!=0)||(o.intelamt&&(o.intelamt.state==2)))&&(m&8));QV("MainDevFiles",((l.mtype==2)&&((o.agent==null)||(o.agent.caps==null)||((o.agent.caps&4)!=0)))&&(m&8));QV("MainDevAmt",(o.intelamt!=null)&&((o.intelamt.state==2)||(o.conn&2))&&(m&8));QV("MainDevConsole",(d&&(l.mtype==2)&&((o.agent==null)||(o.agent.caps==null)||((o.agent.caps&8)!=0)))&&(m&8));QV("p15uploadCore",(o.agent!=null)&&(o.agent.caps!=null)&&((o.agent.caps&16)!=0));QH("p15coreName",((o.agent!=null)&&(o.agent.core!=null))?o.agent.core:"");var b=Q("p14iframe").contentWindow.getCurrentMeshNode();if((b!=null)&&(b._id!=currentNode._id)){Q("p14iframe").contentWindow.disconnect()}var q=((o.conn&6)!=0)?true:false;Q("p14iframe").contentWindow.setConnectionState(q);Q("p14iframe").contentWindow.setFrameHeight("650px");Q("p14iframe").contentWindow.setAuthCallback(updateAmtCredentials);QV("deskActionsBtn",(m&72)!=0);QV("termActionsBtn",(m&72)!=0);QV("filesActionsBtn",(m&72)!=0);if((powerTimelineNode!=currentNode._id)&&(powerTimelineReq!=currentNode._id)){QH("p10html2","");powerTimelineReq=currentNode._id;meshserver.send({action:"powertimeline",nodeid:currentNode._id});meshserver.send({action:"lastconnect",nodeid:currentNode._id})}QV("DeskTools",false);showDeskToolsProcesses();refreshDeviceEvents();if((currentNode)&&(xxcurrentView>=10)&&(xxcurrentView<20)){document.title="MeshCentral - "+currentNode.name}else{document.title="MeshCentral"}}setupDesktop();if(!r){r=10}go(r)}function showNotes(b,a){if(xxdialogMode){return}setDialogMode(2,"Notes",2,showNotesEx,"<textarea id=d2devNotes ro="+b+" noteid="+a+" readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>Notes can be viewed and changed by other administrators.<span>",a);meshserver.send({action:"getNotes",id:decodeURIComponent(a)})}function showNotesEx(a,b){meshserver.send({action:"setNotes",id:decodeURIComponent(b),notes:encodeURIComponent(Q("d2devNotes").value)})}function deviceChat(){if(xxdialogMode){return}var a="/messenger?id=meshmessenger/"+encodeURIComponent(currentNode._id)+"/"+encodeURIComponent(userinfo._id)+"&title="+currentNode.name;if((authCookie!=null)&&(authCookie!="")){a+="&auth="+authCookie}window.open(a,"meshmessenger:"+currentNode._id);meshserver.send({action:"meshmessenger",nodeid:decodeURIComponent(currentNode._id)})}function deviceUrlFunction(){if(xxdialogMode){return}setDialogMode(2,"Open Page on Device",3,deviceUrlFunctionEx,'<input id=d2devurl placeholder="http://server.com" style=width:100%;overflow-y:scroll></input>')}function deviceUrlFunctionEx(){meshserver.send({action:"msg",type:"openUrl",nodeid:currentNode._id,url:Q("d2devurl").value})}function deviceToastFunction(){if(xxdialogMode){return}setDialogMode(2,"Device Notification",3,deviceToastFunctionEx,"<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function deviceActionFunction(){if(xxdialogMode){return}var a=meshes[currentNode.meshid].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;var b="Select an operation to perform on this device.<br /><br />";var c="<select id=d2deviceop style=float:right;width:250px>";if((a&64)!=0){c+="<option value=100>Wake-up</option>"}if((a&8)!=0){c+="<option value=4>Sleep</option><option value=3>Reset</option><option value=2>Power off</option>"}c+="</select>";b+=addHtmlValue("Operation",c);setDialogMode(2,"Device Action",3,deviceActionFunctionEx,b)}function deviceActionFunctionEx(){var a=Q("d2deviceop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:[currentNode._id]})}else{meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:a})}}function updateAmtCredentials(a){var b=getNodeFromId(currentNode._id);if((a==true)||(b.intelamt.user==null)||(b.intelamt.user=="")){editDeviceAmtSettings(currentNode._id,updateAmtCredentialsEx)}else{Q("p14iframe").contentWindow.connectButtonfunctionEx()}}function updateAmtCredentialsEx(a,b){Q("p14iframe").contentWindow.connectButtonfunctionEx()}function updateDeviceTimeline(){if((meshserver.State!=2)||(powerTimelineNode==null)||(powerTimelineUpdate==null)||(currentNode==null)){return}if((powerTimelineNode==powerTimelineReq)&&(currentNode._id==powerTimelineNode)&&(powerTimelineUpdate<Date.now())){powerTimelineUpdate=null;meshserver.send({action:"powertimeline",nodeid:currentNode._id});meshserver.send({action:"lastconnect",nodeid:currentNode._id})}}function drawDeviceTimeline(){if((currentNode==null)||(xxcurrentView<10)||(xxcurrentView>19)){return}var s=null,o=Date.now();if(currentNode._id==powerTimelineNode){s=powerTimeline}var e=new Date();e.setHours(0,0,0,0);e=new Date(e.getTime()-(1000*60*60*24*6));var u=e.getTime();var t=[];if(s!=null&&s.length>1){t.push([0,s[1],s[0]]);var c=s[1];for(var m=2;m<s.length;m+=2){var p=s[m],k=o;if(s.length>(m+1)){k=s[m+1]}t.push([c,c+k,p]);c=c+k}}var A="",b=1,h=new Date();var w=Q("masthead").offsetWidth-(160+9+9+14);h.setHours(0,0,0,0);for(var m=0;m<7;m++){var g="",q=h.getTime(),l=q+(1000*60*60*24);for(var n in t){var a=t[n];if(isTimeBlockInside(q,l,a[0],a[1])==true){var y=Math.max(q,a[0]);var r=Math.min(Math.min(l,a[1]),o);var z=Math.round(((r-y)*w)/86400000);if(z>0){var v=powerStateStrings2[a[2]]+" from "+new Date(y).toLocaleTimeString()+" to "+new Date(r).toLocaleTimeString()+".";g+='<div title="'+v+'" style=display:table-cell;width:'+z+"px;background-color:"+powerColor(a[2])+";height:16px></div>"}}}A+="<tr style="+(((b%2)==0)?"background-color:#DDD":"")+"><td><div> "+h.toLocaleDateString()+"<div></div></div></td><td><div>"+g+"</div></td></tr>";++b;h=new Date(h.getTime()-(1000*60*60*24))}QH("p10html2",'<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center>7 Day Power State</th></tr>'+A+"</tbody></table>")}function powerColor(a){if(a<powerColorTable.length){return powerColorTable[a]}return"yellow"}function isTimeBlockInside(d,c,b,a){if((b<d)&&(a>c)){return true}if((b>d)&&(b<c)){return true}if((a>d)&&(a<c)){return true}return false}function addDeviceAttribute(a,b){return"<tr><td class=style7 style=width:180px>"+a+"</td><td class=style9 style=max-width:400px;overflow:hidden>"+b+"</td></tr>"}function editDeviceAmtSettings(e,b){if(xxdialogMode){return}var g="",d=getNodeFromId(e),a=3,c=getNodeRights(e);if((c&4)==0){return}g+=addHtmlValue("Username",'<input id=dp10username style=width:230px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />');g+=addHtmlValue("Password","<input id=dp10password type=password style=width:230px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />");g+=addHtmlValue("Security","<select id=dp10tls style=width:236px><option value=0>No TLS security</option><option value=1>TLS security required</option></select>");if((d.intelamt.user!=null)&&(d.intelamt.user!="")){a=7}setDialogMode(2,"Edit Intel® AMT credentials",a,editDeviceAmtSettingsEx,g,{node:d,func:b});if((d.intelamt.user!=null)&&(d.intelamt.user!="")){Q("dp10username").value=d.intelamt.user}else{Q("dp10username").value="admin"}Q("dp10tls").value=d.intelamt.tls;validateDeviceAmtSettings()}function validateDeviceAmtSettings(){QE("idx_dlgOkButton",passwordcheck(Q("dp10password").value))}function editDeviceAmtSettingsEx(c,d){if(c==2){meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:"",pass:""}})}else{var b=Q("dp10username").value;if(b==""){b="admin"}var a=Q("dp10password").value;if(a==""){b=""}meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:b,pass:a,tls:Q("dp10tls").value}});d.node.intelamt.user=b;d.node.intelamt.tls=Q("dp10tls").value;if(d.func){setTimeout(d.func,300)}}}function p10showChangeGroupDialog(e){if(xxdialogMode){return}var g=null;if(e.length==1){try{g=meshes[getNodeFromId(e[0])]._id}catch(b){}}var j="<select id=p10newGroup style=width:236px>",a=0;for(var c in meshes){var d=meshes[c].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((meshes[c]._id!=g)&&(d&4)){a++;j+="<option value='"+meshes[c]._id+"'>"+meshes[c].name+"</option>"}}j+="</select>";if(a>0){var h=(e.length==1)?"Select a new group for this device<br /><br />":"Select a new group for selected devices<br /><br />";h+=addHtmlValue("New Device Group",j);setDialogMode(2,"Change Group",3,p10showChangeGroupDialogEx,h,e)}else{setDialogMode(2,"Change Group",1,null,"No other device group of same type exists.")}}function p10showChangeGroupDialogEx(a,c){meshserver.send({action:"changeDeviceMesh",nodeids:c,meshid:Q("p10newGroup").value})}function p10showDeleteNodeDialog(a){if(xxdialogMode){return}var b='Are you sure you want to delete node "'+EscapeHtml(currentNode.name)+'"?<br /><br />';b+="<label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />Confirm</label>";setDialogMode(2,"Delete Node",3,p10showDeleteNodeDialogEx,b,a);p10validateDeleteNodeDialog()}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(a,b){meshserver.send({action:"removedevices",nodeids:[b]})}function p10clickOnce(a,c,b){meshserver.send({action:"getcookie",nodeid:a,tcpport:b,tag:"clickonce",protocol:c})}var d2map=null;function p10showNodeLocationDialog(){if((xxdialogMode!=null)&&(xxdialogTag=="@xxmap")){setDialogMode(0)}else{if(xxdialogMode){return}}var m=[],n=["iploc","wifiloc","gpsloc","userloc"],a=null;for(var k in n){if(currentNode[n[k]]!=null){var j=currentNode[n[k]].split(","),h=parseFloat(j[0]),l=parseFloat(j[1]);if((h<90)&&(h>-90)&&(l<180)&&(l>-180)){var e=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([l,h]))});e.setStyle(markerStyle(currentNode,parseInt(k)+1));m.push(e);if(a==null){a=[h,l,h,l,0]}else{if(h<a[0]){a[0]=h}if(l<a[1]){a[1]=l}if(h>a[2]){a[2]=h}if(l>a[3]){a[3]=l}}}}}var p=new ol.source.Vector({features:m});var o=new ol.layer.Vector({source:p});var q="<div id=d2map style=width:100%;height:300px></div>";setDialogMode(2,"Device Location",1,null,q,"@xxmap");var c=0,b=0,r=8;if(a!=null){var b=(a[0]+a[2])/2;var c=(a[1]+a[3])/2;var d=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]));var g=360,r=-2;while(g>d){r++;g=g/2}}if(m.length==1){r=8}d2map=new ol.Map({target:"d2map",interactions:ol.interaction.defaults({dragPan:false,mouseWheelZoom:false}),layers:[new ol.layer.Tile({source:new ol.source.OSM()}),o],view:new ol.View({center:ol.proj.fromLonLat([c,b]),zoom:r})})}function p10showNodeNetInfoDialog(){if(xxdialogMode){return}setDialogMode(2,"Network Interfaces",1,null,"<div id=d2netinfo>Loading...</div>","if"+currentNode._id);meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id})}function p10showMeshCmdDialog(a,b){if(xxdialogMode){return}var d="<select id=aginsSelect onclick=meshCmdOsClick() style=width:236px>";d+="<option value=3>Windows (32bit)</option>";d+="<option value=4>Windows (64bit)</option>";d+="<option value=5>Linux x86 (32bit)</option>";d+="<option value=6>Linux x86 (64bit)</option>";d+="<option value=25>Linux ARM, Raspberry Pi (32bit)</option>";d+="</select>";var c="";if(a==0){c+="<div>MeshCmd is a command line tool that performs lots of different operations. The action file can optionally be downloaded and edited to provide server information and credentials.<br /><br />"}if(a==1){c+='<div>Download "meshcmd" with an action file to route traffic thru this server to this device. Make sure to edit meshaction.txt and add your account password or make any changes needed.<br /><br />'}c+=addHtmlValue("Operating System",d);c+=addHtmlValue("MeshCmd",'<a id=meshcmddownloadid style=cursor:pointer onclick=fileDownload("meshagents?meshcmd=","MeshCmd",2)></a>');if(a==0){c+=addHtmlValue("Action File",'<a style=cursor:pointer onclick=fileDownload("meshagents?meshaction=generic","MeshAction.txt")>MeshAction (.txt)</a>')}if(a==1){c+=addHtmlValue("Action File",'<a style=cursor:pointer onclick=fileDownload("meshagents?meshaction=route&nodeid='+b+'","MeshAction.txt")>MeshAction (.txt)</a>')}c+="</div>";setDialogMode(2,["Download MeshCmd","Network Router"][a],9,null,c,"fileDownload");meshCmdOsClick()}function meshCmdOsClick(){var a=Q("aginsSelect").value,b="";if(a==3){b="MeshCmd (Win32 executable)"}if(a==4){b="MeshCmd (Win64 executable)"}if(a==5){b="MeshCmd (Linux x86, 32bit)"}if(a==6){b="MeshCmd (Linux x86, 64bit)"}if(a==25){b="MeshCmd (Linux ARM, 32bit)"}QH("meshcmddownloadid",b)}function p10showiconselector(){if(xxdialogMode){return}var a=meshes[currentNode.meshid];var b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&4)==0){return}var c="<br><div style=display:inline-block;width:40px></div>";c+="<div style=display:inline-block class=i1 onclick=p10setIcon(1)></div>";c+="<div style=display:inline-block class=i2 onclick=p10setIcon(2)></div>";c+="<div style=display:inline-block class=i3 onclick=p10setIcon(3)></div>";c+="<div style=display:inline-block class=i4 onclick=p10setIcon(4)></div>";c+="<div style=display:inline-block class=i5 onclick=p10setIcon(5)></div>";c+="<div style=display:inline-block class=i6 onclick=p10setIcon(6)></div><br><br>";setDialogMode(2,"Icon Selection",0,null,c);QV("id_dialogclose",true)}function p10setIcon(a){setDialogMode(0);meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:a})}var showEditNodeValueDialog_modes=["Device Name","Hostname","Description","Tags"];var showEditNodeValueDialog_modes2=["name","host","desc","tags"];var showEditNodeValueDialog_modes3=["","","","Tag1, Tag2, Tag3"];function showEditNodeValueDialog(a){if(xxdialogMode){return}var c=addHtmlValue(showEditNodeValueDialog_modes[a],'<input id=dp10devicevalue style=width:230px maxlength=64 placeholder="'+showEditNodeValueDialog_modes3[a]+'" onchange=p10editdevicevalueValidate('+a+",event) onkeyup=p10editdevicevalueValidate("+a+",event) />");setDialogMode(2,"Edit Device",3,showEditNodeValueDialogEx,c,a);var b=currentNode[showEditNodeValueDialog_modes2[a]];if(b==null){b=""}if(Array.isArray(b)){b=b.join(", ")}Q("dp10devicevalue").value=b;p10editdevicevalueValidate();Q("dp10devicevalue").focus()}function showEditNodeValueDialogEx(a,b){var c={action:"changedevice",nodeid:currentNode._id};c[showEditNodeValueDialog_modes2[b]]=Q("dp10devicevalue").value;meshserver.send(c)}function p10editdevicevalueValidate(b,a){var c=((b>1)||(Q("dp10devicevalue").value.length>0));QE("idx_dlgOkButton",c);if((a!=null)&&(c==true)&&(a.keyCode==13)){dialogclose(1)}}var desktopNode;function setupDesktop(){if((desktopNode!=currentNode)&&(desktop!=null)){desktop.Stop();desktopNode=null;desktop=null}if((desktopNode!=currentNode)||(desktop==null)){var b=multiDesktop[currentNode._id];if(b!=null){QH("DeskParent","");var a=b.m.CanvasId;a.setAttribute("id","Desk");a.setAttribute("style","width:100%;-ms-touch-action:none;margin-left:0px");a.setAttribute("onmousedown","dmousedown(event)");a.setAttribute("onmouseup","dmouseup(event)");a.setAttribute("onmousemove","dmousemove(event)");a.removeAttribute("onclick");Q("DeskParent").appendChild(a);desktop=b;if(desktop.m.SendCompressionLevel){desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate)}desktop.onStateChanged=onDesktopStateChange;desktopNode=currentNode;onDesktopStateChange(desktop,desktop.State);delete multiDesktop[currentNode._id]}else{QH("DeskParent",'<canvas id=Desk width=640 height=480 style="width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>');desktopNode=currentNode}Q("Desk").addEventListener("DOMMouseScroll",function(c){return dmousewheel(c)});Q("Desk").addEventListener("mousewheel",function(c){return dmousewheel(c)})}desktopNode=currentNode;updateDesktopButtons();deskAdjust();if(!Q("Desk")["toBlob"]){QV("deskSaveBtn",false)}}function updateDesktopButtons(){var c=meshes[currentNode.meshid];var a=0;if(desktop!=null){a=desktop.State}var d=c.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;QV("disconnectbutton1span",(a!=0));QV("connectbutton1span",(a==0)&&((d&8)||(d&256))&&(c.mtype==2)&&(currentNode.agent.caps&1));QV("connectbutton1hspan",(a==0)&&(d&8)&&((currentNode.intelamt!=null)&&(c.mtype==1||currentNode.intelamt.state==2)&&((currentNode.intelamt.ver!=null)||(c.mtype==1))));QV("d7amtkvm",(currentNode.intelamt!=null&&((currentNode.intelamt.ver!=null)||(c.mtype==1)))&&((a==0)||(desktop.contype==2)));QV("d7meshkvm",(webRtcDesktop)||((c.mtype==2)&&(currentNode.agent.caps&1)&&((a==false)||(desktop.contype==1))));var e=((currentNode.conn&1)!=0);QE("connectbutton1",e);var b=((currentNode.conn&6)!=0);QE("connectbutton1h",b);QE("deskSaveBtn",a==3);QV("deskFocusBtn",(desktop!=null)&&(desktop.contype==2)&&(a!=0)&&(desktopsettings.showfocus));QV("DeskCAD",d&8);QE("DeskCAD",a==3);QE("DeskClip",a==3);QV("DeskWD",(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8));QE("DeskWD",a==3);QV("deskkeys",(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8));QE("deskkeys",a==3);QV("DeskToolsButton",(d&8)&&(c.mtype==2)&&e);QV("DeskChatButton",(browserfullscreen==false)&&(d&8)&&(c.mtype==2)&&e);QV("DeskNotifyButton",(browserfullscreen==false)&&(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8)&&(c.mtype==2)&&e);QV("DeskOpenWebButton",(browserfullscreen==false)&&(d&8)&&(c.mtype==2)&&e);QV("DeskControlSpan",d&8);QV("deskActionsBtn",(browserfullscreen==false));QV("deskActionsSettings",(browserfullscreen==false));if(d&8){Q("DeskControl").checked=(getstore("DeskControl",1)==1)}else{Q("DeskControl").checked=false}if(e==false){QV("DeskTools",false)}}var autoConnectDesktopTimer=null;function autoConnectDesktop(a){if(autoConnectDesktopTimer==null){autoConnectDesktopTimer=setInterval(connectDesktop,100)}else{clearInterval(autoConnectDesktopTimer);autoConnectDesktopTimer=null}}function connectDesktop(b,a){if(desktop==null){desktopNode=currentNode;if(a==2){if((desktopNode.intelamt.user==null)||(desktopNode.intelamt.user=="")){editDeviceAmtSettings(desktopNode._id,connectDesktop);return}desktop=CreateAmtRedirect(CreateAmtRemoteDesktop("Desk"),authCookie);desktop.debugmode=debugmode;desktop.onStateChanged=onDesktopStateChange;desktop.m.bpp=(desktopsettings.encoding==1||desktopsettings.encoding==3)?1:2;desktop.m.useZRLE=(desktopsettings.encoding<3);desktop.m.showmouse=desktopsettings.showmouse;desktop.m.onScreenSizeChange=deskAdjust;desktop.m.onKvmData=function(h){if(h.length==0){if(!desktop.m._sentPresence){desktop.m._sentPresence=true;desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))}return}var d=null;try{d=JSON.parse(h)}catch(g){}if((d!=null)&&(d.action!=null)){if(d.action=="restart"){webRtcDesktopReset();desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))}else{if((d.action=="present")&&(webRtcDesktop==null)){webRtcDesktop={platform:d.platform};var c=null;if(typeof RTCPeerConnection!=="undefined"){webRtcDesktop.webrtc=new RTCPeerConnection(c)}else{if(typeof webkitRTCPeerConnection!=="undefined"){webRtcDesktop.webrtc=new webkitRTCPeerConnection(c)}}webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{});webRtcDesktop.webchannel.onopen=function(){console.log("WebRTC Data Channel Open");Q("deskstatus").textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(true);webRtcDesktop.webRtcActive=true;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",Q("id_mainarea")),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);webRtcDesktop.softdesktop.m.onScreenSizeChange=deskAdjust;if(desktopsettings.quality){webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality}if(desktopsettings.scaling){webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling}webRtcDesktop.softdesktop.Start()};webRtcDesktop.webchannel.onclose=function(e){console.log("WebRTC Data Channel Closed");webRtcDesktopReset()};webRtcDesktop.webrtc.onicecandidate=function(j){if(j.candidate==null){desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp}))}else{webRtcDesktop.webrtcoffer.sdp+=("a="+j.candidate.candidate+"\r\n")}};webRtcDesktop.webrtc.oniceconnectionstatechange=function(){if((webRtcDesktop!=null)&&(webRtcDesktop.webrtc!=null)&&((webRtcDesktop.webrtc.iceConnectionState=="disconnected")||(webRtcDesktop.webrtc.iceConnectionState=="failed"))){webRtcDesktopReset()}};webRtcDesktop.webrtc.createOffer(function(e){webRtcDesktop.webrtcoffer=e;webRtcDesktop.webrtc.setLocalDescription(e,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:false,OfferToReceiveVideo:false}})}else{if((d.action=="answer")&&(webRtcDesktop!=null)){webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:d.sdp}),function(){},webRtcDesktopReset)}}}}};desktop.Start(desktopNode._id,16994,"*","*",0);desktop.contype=2}else{desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie);desktop.debugmode=debugmode;desktop.m.debugmode=debugmode;desktop.attemptWebRTC=attemptWebRTC;desktop.onStateChanged=onDesktopStateChange;desktop.m.CompressionLevel=desktopsettings.quality;desktop.m.ScalingLevel=desktopsettings.scaling;desktop.m.FrameRateTimer=desktopsettings.framerate;desktop.m.onDisplayinfo=deskDisplayInfo;desktop.m.onScreenSizeChange=deskAdjust;desktop.Start(desktopNode._id);desktop.contype=1}}else{desktop.Stop();webRtcDesktopReset();desktopNode=desktop=null}}var webRtcDesktop=null;function webRtcDesktopReset(){if(webRtcDesktop==null){return}if(webRtcDesktop.softdesktop!=null){webRtcDesktop.softdesktop.Stop();webRtcDesktop.softdesktop=null}if(webRtcDesktop.webchannel!=null){try{webRtcDesktop.webchannel.close()}catch(a){}webRtcDesktop.webchannel=null}if(webRtcDesktop.webrtc!=null){try{webRtcDesktop.webrtc.close()}catch(a){}webRtcDesktop.webrtc=null}webRtcDesktop=null;if(desktop&&desktop.m){desktop.m.hold(false);Q("deskstatus").textContent=StatusStrs[desktop.State]}}function onDesktopStateChange(c,a){var d=a;if((d==3)&&(c.contype==2)){d++}var b=StatusStrs[d];if((desktop!=null)&&(desktop.webRtcActive==true)){b+=", WebRTC"}QH("deskstatus",b);switch(a){case 0:desktop.Stop();desktopNode=desktop=null;QV("DeskFocus",false);QV("termdisplays",false);deskFocusBtn.value="All Focus";if(fullscreen==true){deskToggleFull()}webRtcDesktopReset();break;case 2:break;default:break}updateDesktopButtons();deskAdjust();setTimeout(deskAdjust,50)}function showDesktopSettings(){if(xxdialogMode){return}applyDesktopSettings();updateDesktopButtons();setDialogMode(7,"Remote Desktop Settings",3,showDesktopSettingsChanged)}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value;desktopsettings.showfocus=d7showfocus.checked;desktopsettings.showmouse=d7showcursor.checked;desktopsettings.quality=d7bitmapquality.value;desktopsettings.scaling=d7bitmapscaling.value;desktopsettings.framerate=d7framelimiter.value;localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings));applyDesktopSettings();if(desktop){if(desktop.contype==1){if(desktop.State!=0){desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate)}}if(desktop.contype==2){if(desktopsettings.showfocus==false){desktop.m.focusmode=0;deskFocusBtn.value="All Focus"}if(desktop.State!=0){desktop.Stop();setTimeout(function(){connectDesktop(null,2)},50)}}}}function applyDesktopSettings(){var c="",b=(features&512)?[90,80,70,60,50,40,30,20,10,5,1]:[60,50,40,30,20,10,5,1];for(var a in b){c+="<option value="+b[a]+">"+b[a]+"%</option>"}QH("d7bitmapquality",c);d7desktopmode.value=desktopsettings.encoding;d7showfocus.checked=desktopsettings.showfocus;d7showcursor.checked=desktopsettings.showmouse;d7bitmapquality.value=40;if(b.indexOf(parseInt(desktopsettings.quality))>=0){d7bitmapquality.value=desktopsettings.quality}d7bitmapscaling.value=desktopsettings.scaling;if(desktopsettings.framerate){d7framelimiter.value=desktopsettings.framerate}QV("deskFocusBtn",(desktop!=null)&&(desktop.contype==2)&&(desktop.state!=0)&&(desktopsettings.showfocus))}function enterBrowserFullscreen(a){if(a.requestFullscreen){a.requestFullscreen()}else{if(a.msRequestFullscreen){a.msRequestFullscreen()}else{if(a.mozRequestFullScreen){a.mozRequestFullScreen()}else{if(a.webkitRequestFullscreen){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}}}}function exitBrowserFullscreen(){if(document.exitFullscreen){document.exitFullscreen()}else{if(document.msExitFullscreen){document.msExitFullscreen()}else{if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else{if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}}}}function isBrowserFullscreen(){if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement){return false}else{return true}}var fullscreen=false;var browserfullscreen=false;function deskToggleFull(a){fullscreen=!fullscreen;QV("mastheadx",!fullscreen);QV("masthead",!fullscreen);QV("topbar",!fullscreen);QV("p11deviceNameHeader",!fullscreen);QV("footer",!fullscreen);QV("column_l_bottomgap",!fullscreen);QV("idx_deskFullBtn2",fullscreen);QV("deskFullBtn",!fullscreen);QV("page_leftbar",!fullscreen);if(fullscreen){if(a.shiftKey==true){enterBrowserFullscreen(Q("deskarea0"));browserfullscreen=true}QS("column_l").width="930px";QS("column_l").height="";QS("column_l")["margin-left"]="";QS("column_l")["overflow-y"]="";QS("container").position="";QS("page_content").position="";QV("MainMenuSpan",true);QS("container").width="100%";QS("container")["border-right"]="0";QS("container")["border-left"]="0";QS("column_l").padding="0";QS("column_l").width="100%";QS("column_l")["max-height"]=""}else{exitBrowserFullscreen();browserfullscreen=false;QS("container").width="960px";QS("container")["border-right"]="1px solid #b7b7b7";QS("container")["border-left"]="1px solid #b7b7b7";QS("column_l").padding="0 15px";QS("column_l").width="930px";toggleFullScreen()}deskAdjust();deskAdjust();updateDesktopButtons()}function deskToggleFocus(){desktop.m.focusmode=(desktop.m.focusmode+64)%192;Q("deskFocusBtn").value=["All Focus","Small Focus","Large Focus"][desktop.m.focusmode/64]}function deskAdjust(){var c=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(Q("deskarea1").clientHeight+Q("deskarea2").clientHeight+Q("Desk").clientHeight+Q("deskarea4").clientHeight+2))/2;if(fullscreen){document.documentElement.style.overflow="hidden";QS("deskarea3x").height=null;if(c<0){var a=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(Q("deskarea1").clientHeight+Q("deskarea2").clientHeight+Q("deskarea4").clientHeight));var b=9999;if(desktop){b=(desktop.m.width/desktop.m.height)*a}if(webRtcDesktop&&webRtcDesktop.softdesktop){b=(webRtcDesktop.softdesktop.m.width/webRtcDesktop.softdesktop.m.height)*a}QS("Desk")["max-height"]=a+"px";QS("Desk")["max-width"]=b+"px";c=0}else{QS("Desk")["max-height"]=null;QS("Desk")["max-width"]=null}QS("Desk")["margin-top"]=c+"px";QS("Desk")["margin-bottom"]=c+"px"}else{var b=9999,a=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(webPageFullScreen?276:290));if(desktop){b=(desktop.m.width/desktop.m.height)*a}if(webRtcDesktop&&webRtcDesktop.softdesktop){b=(webRtcDesktop.softdesktop.m.width/webRtcDesktop.softdesktop.m.height)*a}document.documentElement.style.overflow="auto";QS("Desk")["max-height"]=a+"px";QS("Desk")["max-width"]=b+"px";QS("Desk")["margin-top"]="0";QS("Desk")["margin-bottom"]="0"}}function mdeskAdjust(c,h,g,a){if(!c||!h||!g||!a){return}if(a.id=="Desk"){deskAdjust();return}var k=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex];var e=k.x+2,j=Q("xdevices").clientWidth-30,l=Math.floor(j/e);l=e+Math.floor((j-(l*e))/l);k.y=k.y*(l/k.x);k.x=l;var b=k.y,d=k.x;if(c.State!=0){b=k.y;d=(h/g)*k.y}QS(a.id)["max-height"]=b+"px";QS(a.id)["max-width"]=d+"px";QS(a.id)["margin-top"]="0";QS(a.id)["margin-bottom"]="0"}function deskSendKeys(){if(xxdialogMode||desktop==null||desktop.State!=3){return}var a=Q("deskkeys").value;if(a==0){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65364,1],[65364,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,40],[desktop.m.KeyAction.UP,40],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==1){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65362,1],[65362,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,38],[desktop.m.KeyAction.UP,38],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==2){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[108,1],[108,0],[65511,0]])}else{desktop.sendCtrlMsg('{"action":"lock"}')}}else{if(a==3){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[109,1],[109,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==4){if(desktop.contype==2){desktop.m.sendkey([[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.DOWN,16],[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91],[desktop.m.KeyAction.UP,16]])}}else{if(a==5){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==6){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[114,1],[114,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,82],[desktop.m.KeyAction.UP,82],[desktop.m.KeyAction.EXUP,91]])}}}}}}}}}function showDeskClip(){if(xxdialogMode||desktop==null||desktop.State!=3){return}Q("DeskClip").blur();var a='<input id=dlgClipGet type=button value="Get Clipboard" style=width:120px onclick=showDeskClipGet()>';a+='<input id=dlgClipSet type=button value="Set Clipboard" style=width:120px onclick=showDeskClipSet()>';a+='<div id=dlgClipStatus style="display:inline-block;margin-left:8px" ></div>';a+='<textarea id=d2clipText style="width:100%;height:184px;resize:none" maxlength=65535></textarea>';a+='<input type=button value="Close" style=width:80px;float:right onclick=dialogclose(0)><div style=height:26px> </div>';setDialogMode(2,"Remote Clipboard",8,null,a,"clipboard");Q("d2clipText").focus()}function showDeskClipGet(){if(desktop==null||desktop.State!=3){return}meshserver.send({action:"msg",type:"getclip",nodeid:currentNode._id})}function showDeskClipSet(){if(desktop==null||desktop.State!=3){return}meshserver.send({action:"msg",type:"setclip",nodeid:currentNode._id,data:Q("d2clipText").value})}function sendCAD(){if(xxdialogMode||desktop==null||desktop.State!=3){return}desktop.m.sendcad()}function toggleDeskTools(){if(xxdialogMode){return}if(QS("DeskTools").display=="none"){QV("DeskTools",true);Q("DeskTools").nodeid=currentNode._id;refreshDeskTools()}else{QV("DeskTools",false)}}function refreshDeskTools(){QV("DeskToolsRefreshButton",false);setTimeout(refreshDeskToolsEx,500);meshserver.send({action:"msg",type:"ps",nodeid:currentNode._id})}function refreshDeskToolsEx(){QV("DeskToolsRefreshButton",true)}var deskTools={sort:1,msg:null};function sortProcess(a){deskTools.sort=a;showDeskToolsProcesses(deskTools.msg)}function sortProcessPid(c,d){if(c.p>d.p){return 1}if(c.p<d.p){return(-1)}return 0}function sortProcessName(c,d){if(c.d>d.d){return 1}if(c.d<d.d){return(-1)}return 0}function showDeskToolsProcesses(c){deskTools.msg=c;if(c==null){QH("DeskToolsProcesses","");return}if(Q("DeskTools").nodeid!=c.nodeid){return}var d=[],h=null;try{h=JSON.parse(c.value)}catch(a){}if(h!=null){for(var g in h){d.push({p:parseInt(g),c:h[g].cmd,d:h[g].cmd.toLowerCase(),u:h[g].user})}if(deskTools.sort==0){d.sort(sortProcessPid)}else{if(deskTools.sort==1){d.sort(sortProcessName)}}var j="";for(var b in d){if(d[b].p!=0){j+="<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>"+d[b].p+'</div><a style=float:right;padding-right:5px;cursor:pointer title="Stop process" onclick=stopProcess('+d[b].p+',"'+d[b].c+'")><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>'+(d[b].u?d[b].u:"")+"</div><div>"+d[b].c+"</div></div>"}}QH("DeskToolsProcesses",j)}}function toggleKvmControl(){putstore("DeskControl",(Q("DeskControl").checked?1:0))}function deskSaveImage(){if(xxdialogMode||desktop==null||desktop.State!=3){return}var a=new Date(),b="Desktop-"+currentNode.name+"-"+a.getFullYear()+"-"+("0"+(a.getMonth()+1)).slice(-2)+"-"+("0"+a.getDate()).slice(-2)+"-"+("0"+a.getHours()).slice(-2)+"-"+("0"+a.getMinutes()).slice(-2);Q("Desk")["toBlob"](function(c){saveAs(c,b+".jpg")})}function deskDisplayInfo(e,a,c,d){var g=Q("termdisplays").value;if(a.length>0){var b="";for(var h in a){b+="<option"+((g==a[h])?" selected":"")+">"+a[h]+"</option>"}QH("termdisplays",b)}QV("termdisplays",a.length>0)}function deskGetDisplayNumbers(a){desktop.m.GetDisplayNumbers()}function deskSetDisplay(b){var a=0,c=Q("termdisplays").value;if(c=="All Displays"){a=65535}else{a=parseInt(c.substring(8))}desktop.m.SetDisplay(a)}var dblClickDetectArgs={t:0,x:0,y:0};function dblClickDetect(a){if(a.buttons!=1){return}var b=Date.now();if(((b-dblClickDetectArgs.t)<250)&&(Math.abs(a.clientX-dblClickDetectArgs.x)<2)&&(Math.abs(a.clientY-dblClickDetectArgs.y)<2)){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousedblclick(a);desktop.m.sendKeepAlive()}else{desktop.m.mousedblclick(a)}}}dblClickDetectArgs.t=b;dblClickDetectArgs.x=a.clientX;dblClickDetectArgs.y=a.clientY}function dmousedown(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousedown(a);desktop.m.sendKeepAlive()}else{desktop.m.mousedown(a)}}dblClickDetect(a)}function dmouseup(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mouseup(a);desktop.m.sendKeepAlive()}else{desktop.m.mouseup(a)}}}function dmousemove(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousemove(a);desktop.m.sendKeepAlive()}else{desktop.m.mousemove(a)}}}function dmousewheel(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousewheel(a);desktop.m.sendKeepAlive()}else{if(desktop.m.mousewheel){desktop.m.mousewheel(a)}}haltEvent(a);return true}return false}function drotate(a){if(!xxdialogMode&&desktop!=null){desktop.m.setRotation(desktop.m.rotation+a);deskAdjust();deskAdjust()}}function stopProcess(a,b){setDialogMode(2,"Process Control",3,stopProcessEx,"Stop process #"+a+' "'+b+'"?',a)}function stopProcessEx(a,b){meshserver.send({action:"msg",type:"pskill",nodeid:currentNode._id,value:b});setTimeout(refreshDeskTools,300)}var terminalNode;function setupTerminal(){if((terminalNode!=currentNode)&&(terminal!=null)){terminal.Stop();terminal=null}terminalNode=currentNode;updateTerminalButtons()}function updateTerminalButtons(){var b=meshes[terminalNode.meshid];var d=((terminal!=null)&&(terminal.state!=0));QV("disconnectbutton2span",(d==true));QV("connectbutton2span",(d==false)&&(b.mtype==2)&&(currentNode.agent.caps&2));QV("connectbutton2hspan",(d==false)&&((terminalNode.intelamt!=null)&&(b.mtype==1||terminalNode.intelamt.state==2)&&((terminalNode.intelamt.ver!=null)||(b.mtype==1))));var c=((terminalNode.conn&1)!=0);QE("connectbutton2",c);var a=((terminalNode.conn&6)!=0);QE("connectbutton2h",a);QE("ctrlcbutton",d);QE("ctrlxbutton",d);QE("escbutton",d);QE("bsbutton",d);QE("pastebutton",d);QE("specialkeylist",d);QE("specialkeylistinput",d);QV("terminalSettingsButtons",(terminal)&&(terminal.contype==2));if(terminal){Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation];Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation];Q("id_tcrbutton").value=(terminal.m.lineFeed=="\r\n")?"CR+LF":"LF"}}function onTerminalStateChange(d,a){var c=a;if((c==3)&&(d.contype==2)){c++}var b=StatusStrs[c];if(terminal.webRtcActive==true){b+=", WebRTC"}QH("termstatus",b);switch(a){case 0:d.m.TermResetScreen();d.m.TermDraw();if(terminal!=null){terminal.Stop();terminal=null}break;case 3:break;default:break}updateTerminalButtons()}var autoConnectTerminalTimer=null;function autoConnectTerminal(a){if(autoConnectTerminalTimer==null){autoConnectTerminalTimer=setInterval(connectTerminal,100)}else{clearInterval(autoConnectTerminalTimer);autoConnectTerminalTimer=null}}function connectTerminal(b,a){if(!terminal){if(a==2){if((terminalNode.intelamt.user==null)||(terminalNode.intelamt.user=="")){editDeviceAmtSettings(terminalNode._id,connectTerminal);return}terminal=CreateAmtRedirect(CreateAmtRemoteTerminal("Term"),authCookie);terminal.debugmode=debugmode;terminal.m.debugmode=debugmode;terminal.onStateChanged=onTerminalStateChange;terminal.Start(terminalNode._id,16994,"*","*",0);terminal.contype=2;Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation]}else{terminal=CreateAgentRedirect(meshserver,CreateAmtRemoteTerminal("Term"),serverPublicNamePort,authCookie);terminal.debugmode=debugmode;terminal.m.debugmode=debugmode;terminal.m.lineFeed=([1,2,3,4,21,22].indexOf(currentNode.agent.id)>=0)?"\r\n":"\n";terminal.attemptWebRTC=attemptWebRTC;terminal.onStateChanged=onTerminalStateChange;terminal.Start(terminalNode._id);terminal.contype=1;terminal.m.terminalEmulation=0;terminal.m.fxEmulation=0;Q("id_ttypebutton").value=terminalEmulations[0]}}else{terminal.Stop();terminal=null}Q("connectbutton2").blur()}var terminalEmulations=["UTF8 Terminal","Extended ASCII","Intel ASCII"];function termToggleType(){if(!terminal||xxdialogMode){return}terminal.m.terminalEmulation=(terminal.m.terminalEmulation+1)%3;Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation];Q("id_ttypebutton").blur()}var fxEmulations=["Intel (F10 = ESC+[OM)","Alternate (F10 = ESC+0)","VT100+ (F10 = ESC+[OY)"];function termToggleFx(){if(!terminal||xxdialogMode){return}terminal.m.fxEmulation=(terminal.m.fxEmulation+1)%3;Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation];Q("id_tfxkeysbutton").blur()}function termToggleCr(){if(!terminal||xxdialogMode){return}if(terminal.m.lineFeed=="\n"){terminal.m.lineFeed="\r\n"}else{terminal.m.lineFeed="\n"}Q("id_tcrbutton").value=(terminal.m.lineFeed=="\r\n")?"CR+LF":"LF"}function termSendKey(b,a){if(!terminal||xxdialogMode){return}terminal.m.TermSendKey(b);Q(a).blur()}function showTermPasteDialog(){if(!terminal||xxdialogMode){return}Q("pastebutton").blur();setDialogMode(2,"Paste",3,showTermPasteDialogEx,'<textarea id=d2pasteText style="width:100%;height:184px;resize:none"></textarea>');Q("d2pasteText").focus()}function showTermPasteDialogEx(){if(!terminal){return}terminal.m.TermSendKeys(Q("d2pasteText").value)}function sendSpecialKey(){terminal.m.TermSendKey(Q("specialkeylist").value);Q("specialkeylist").blur();Q("specialkeylistinput").blur()}var filesNode;function setupFiles(){var b=(filesNode==currentNode);filesNode=currentNode;var a=((filesNode.conn&1)!=0)?true:false;QE("p13Connect",a);if(((b==false)||(a==false))&&files){files.Stop();files=null}}function onFilesStateChange(c,a){p13Connect.value=(a==0)?"Connect":"Disconnect";var b=StatusStrs[a];if(files.webRtcActive==true){b+=", WebRTC"}Q("p13Status").textContent=b;switch(a){case 0:QH("p13files","");p13filetree=null;p13filetreelocation=[];QH("p13currentpath","");QE("p13FolderUp",false);p13setActions();if(files!=null){files.Stop();files=null}break;case 3:p13targetpath="";files.sendText({action:"ls",reqid:1,path:""});break;default:break}}function CreateRemoteFiles(b){var a={protocol:5};a.onFileUpdate=b;a.xxStateChange=function(c){};a.ProcessData=function(c){a.onFileUpdate(c)};return a}var autoConnectFilesTimer=null;function autoConnectFiles(a){if(autoConnectFilesTimer==null){autoConnectFilesTimer=setInterval(connectFiles,100)}else{clearInterval(autoConnectFilesTimer);autoConnectFilesTimer=null}}function connectFiles(a){if(!files){files=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie);files.attemptWebRTC=attemptWebRTC;files.onStateChanged=onFilesStateChange;files.Start(filesNode._id)}else{files.Stop();files=null}p13clipboard=p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}var p13filetree=null;var p13targetpath=null;var p13filetreelocation=[];function p13gotFiles(b){if((b.length>0)&&(b.charCodeAt(0)!=123)){p13gotDownloadBinaryData(b);return}b=JSON.parse(decode_utf8(b));if(b.action=="download"){p13gotDownloadCommand(b);return}b.path=b.path.replace(/\//g,"\\");if((p13filetree!=null)&&(b.path==p13filetree.path)){var a=p13getCheckedNames();p13filetree=b;p13updateFiles(a)}else{var c=b.path.replace(/\//g,"\\"),d=p13targetpath.replace(/\//g,"\\");while((c.length>0)&&(c[0]=="\\")){c=c.substring(1)}while((d.length>0)&&(d[0]=="\\")){d=d.substring(1)}if((c==d)||((b.path=="\\")&&(p13targetpath==""))){p13filetree=b;p13updateFiles()}}}function p13getCheckedNames(){var b=[],a=document.getElementsByName("fd");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(p13filetree.dir[a[c].value].n)}}return b}function p13updateFiles(b){var n="",o="",c="<a style=cursor:pointer onclick=p13folderup(0)>Root</a>",l="Root";var w=p13filetree.path.split("\\");p13filetreelocation=[];for(var p in w){if(w[p]!=""){p13filetreelocation.push(w[p])}}for(var p in p13filetreelocation){c+=" / <a style=cursor:pointer onclick=p13folderup("+(parseInt(p)+1)+")>"+p13filetreelocation[p]+"</a>"}var s=p13filetreelocation.join("/");var j=p13sort_files(p13filetree.dir);for(var p in j){var d=j[p],r=d.n,u;u=r;if(r.length>70){u='<span title="'+EscapeHtml(r)+'">'+EscapeHtml(r.substring(0,70))+"...</span>"}else{u=EscapeHtml(r)}r=EscapeHtml(r);var g="";if(d.d!=null){var e=new Date(d.d),g=(e.getMonth()+1)+"/"+(e.getDate())+"/"+e.getFullYear()+" "+e.toLocaleTimeString()+" "}var k="";if(d.s!=null){k=getFileSizeStr(d.s)}var m="";if(d.t<3){var t="",v="";m="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'> <span style=float:right title=\""+v+'">'+t+"</span><span><div class=fileIcon"+d.t+' onclick=p13folderset("'+encodeURIComponent(d.nx)+'")></div><a style=cursor:pointer onclick=p13folderset("'+encodeURIComponent(d.nx)+'")>'+u+"</a></span></div>"}else{var q=u;if(d.s>0){q='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p13downloadfile(\''+encodeURIComponent(s+"/"+r)+"','"+encodeURIComponent(r)+"',"+d.s+')">'+u+"</a>"}m="<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'> <span class=fsize>"+g+"</span><span style=float:right>"+k+"</span><span><div class=fileIcon"+d.t+"></div>"+q+"</span></div>"}if(d.t<3){n+=m}else{o+=m}}QH("p13files",n+o);QH("p13currentpath",c);QE("p13FolderUp",p13filetreelocation.length!=0);if(b!=null){var a=document.getElementsByName("fd");for(var p=0;p<a.length;p++){if(b.indexOf(p13filetree.dir[a[p].value].n)>=0){a[p].checked=true}}}p13setActions()}function p13folderset(a){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[a].n).split("\\").join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}function p13folderup(a){if(a==null){p13filetreelocation.pop()}else{while(p13filetreelocation.length>a){p13filetreelocation.pop()}}p13targetpath=p13filetreelocation.join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}var p13sortorder;function p13sort_filename(c,d){if(c.ln>d.ln){return(1*p13sortorder)}if(c.ln<d.ln){return(-1*p13sortorder)}return 0}function p13sort_timestamp(c,d){if(c.d>d.d){return(1*p13sortorder)}if(c.d<d.d){return(-1*p13sortorder)}return 0}function p13sort_bysize(c,d){if(c.s==d.s){return p13sort_filename(c,d)}return(((c.s-d.s))*p13sortorder)}function p13sort_files(a){var c=[],d=Q("p13sortdropdown").value;for(var b in a){a[b].nx=b;if(a[b].s==null){a[b].s=0}if(a[b].n==null){a[b].n=b}a[b].ln=a[b].n.toLowerCase();c.push(a[b])}p13sortorder=1;if(d>3){p13sortorder=-1;d-=3}if(d==1){c.sort(p13sort_filename)}else{if(d==2){c.sort(p13sort_bysize)}else{if(d==3){c.sort(p13sort_timestamp)}}}return c}function p13setActions(){if(p13filetree==null){QE("p13DeleteFileButton",false);QE("p13NewFolderButton",false);QE("p13UploadButton",false);QE("p13RenameFileButton",false);QE("p13SelectAllButton",false);Q("p13SelectAllButton").value="Select All";QE("p13RefreshButton",false);QE("p13CutButton",false);QE("p13CopyButton",false);QE("p13PasteButton",false)}else{var a=p13getFileSelCount(),c=p13getFileCount(),b=p13getFileSelCount(false);var d=((currentNode.agent.id>0)&&(currentNode.agent.id<5));QE("p13DeleteFileButton",(a>0)&&((p13filetreelocation.length>0)||(d==false)));QE("p13NewFolderButton",((p13filetreelocation.length>0)||(d==false)));QE("p13UploadButton",((p13filetreelocation.length>0)||(d==false)));QE("p13RenameFileButton",(a==1)&&((p13filetreelocation.length>0)||(d==false)));QE("p13SelectAllButton",c>0);Q("p13SelectAllButton").value=(a>0?"Select None":"Select All");QE("p13RefreshButton",true);QE("p13CutButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13CopyButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13PasteButton",((p13filetreelocation.length>0)||(d==false))&&((p13clipboard!=null)&&(p13clipboard.length>0)))}}function p13getFileSelCount(d){var a=0;var b=document.getElementsByName("fd");for(var c=0;c<b.length;c++){if((b[c].checked)&&((d!=false)||(b[c].attributes.file.value=="3"))){a++}}return a}function p13getFileSelDirCount(){var a=0,b=document.getElementsByName("fd");for(var c=0;c<b.length;c++){if((b[c].checked)&&(b[c].attributes.file.value=="999")){a++}}return a}function p13getFileCount(){var a=0;var b=document.getElementsByName("fd");return b.length}function p13selectallfile(){var c=(p13getFileSelCount()==0),a=document.getElementsByName("fd");for(var b=0;b<a.length;b++){a[b].checked=c}p13setActions()}function p13createfolder(){setDialogMode(2,"New Folder",3,p13createfolderEx,"<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% />");focusTextBox("p13renameinput");p13fileNameCheck()}function p13createfolderEx(){files.sendText({action:"mkdir",reqid:1,path:p13filetreelocation.join("/")+"/"+Q("p13renameinput").value});p13folderup(999)}function p13deletefile(){var a=p13getFileSelCount(),b=(p13getFileSelDirCount()>0)?"<br /><br /><input type=checkbox id=p13recdeleteinput>Recursive delete<br>":"<input type=checkbox id=p13recdeleteinput style='display:none'>";setDialogMode(2,"Delete",3,p13deletefileEx,(a>1)?("Delete "+a+" selected items?"+b):("Delete selected item?"+b))}function p13deletefileEx(){var b=[],a=document.getElementsByName("fd");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(p13filetree.dir[a[c].value].n)}}files.sendText({action:"rm",reqid:1,path:p13filetreelocation.join("/"),delfiles:b,rec:Q("p13recdeleteinput").checked});p13folderup(999)}function p13renamefile(){var c,a=document.getElementsByName("fd");for(var b=0;b<a.length;b++){if(a[b].checked){c=p13filetree.dir[a[b].value].n}}setDialogMode(2,"Rename",3,p13renamefileEx,'<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% value="'+c+'" />',{action:"rename",path:p13filetreelocation.join("/"),oldname:c});focusTextBox("p13renameinput");p13fileNameCheck()}function p13renamefileEx(a,c){c.newname=Q("p13renameinput").value;files.sendText(c);p13folderup(999)}function p13fileNameCheck(a){var b=isFilenameValid(Q("p13renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a!=null)&&(a.keyCode==13)){dialogclose(1)}}function p13uploadFile(){setDialogMode(2,"Upload File",3,p13uploadFileEx,"<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange=\"updateUploadDialogOk('p13uploadinput')\" />");updateUploadDialogOk("p13uploadinput")}function p13uploadFileEx(){p13doUploadFiles(Q("p13uploadinput").files)}var p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;function p13copyFile(b){var a=document.getElementsByName("fd");p13clipboard=[];p13clipboardCut=b,p13clipboardFolder=p13targetpath;for(var c=0;c<a.length;c++){if((a[c].checked)&&(a[c].attributes.file.value=="3")){p13clipboard.push(p13filetree.dir[a[c].value].n)}}p13updateClipview()}function p13pasteFile(){var a="";if((p13clipboard!=null)&&(p13clipboard.length>0)){a="Confim "+(p13clipboardCut==0?"copy":"move")+" of "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p13pasteFileEx,a)}function p13pasteFileEx(){files.sendText({action:(p13clipboardCut==0?"copy":"move"),reqid:1,scpath:p13clipboardFolder,dspath:p13targetpath,names:p13clipboard});p13folderup(999);if(p13clipboardCut==1){p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;p13updateClipview()}}function p13updateClipview(){var a="";if((p13clipboard!=null)&&(p13clipboard.length>0)){a="Holding "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" for "+(p13clipboardCut==0?"copy":"move")+", <a onclick=p13clearClip() style=cursor:pointer>Clear</a>."}QH("p13bottomstatus",a);p13setActions()}function p13clearClip(){p13clipboard=null;p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}function p13fileDragDrop(a){haltEvent(a);QV("p13bigfail",false);QV("p13bigok",false);if(a.dataTransfer==null||a.dataTransfer.files.length==0||p13filetree==null){return}p13doUploadFiles(a.dataTransfer.files)}var p13dragtimer=null;function p13fileDragOver(b){haltEvent(b);if(p13dragtimer!=null){clearTimeout(p13dragtimer);p13dragtimer=null}var a=(p13filetree!=null);QV("p13bigok",a);QV("p13bigfail",!a)}function p13fileDragLeave(a){haltEvent(a);if(a.target.id!="p13filetable"){QV("p13bigfail",false);QV("p13bigok",false)}else{p13dragtimer=setTimeout(function(){QV("p13bigfail",false);QV("p13bigok",false);p13dragtimer=null},10)}}var downloadFile;function p13downloadfile(a,b,c){if(xxdialogMode||downloadFile||!files){return}downloadFile={path:decodeURIComponent(a),file:decodeURIComponent(b),size:c,tsize:0,data:"",state:0,id:Math.random()};files.sendText({action:"download",sub:"start",id:downloadFile.id,path:downloadFile.path});setDialogMode(2,"Download File",10,p13downloadFileCancel,"<div>"+downloadFile.file+"</div><br /><progress id=d2progressBar style=width:100% value=0 max="+c+" />")}function p13downloadFileCancel(){setDialogMode(0);files.sendText({action:"download",sub:"cancel",id:downloadFile.id});downloadFile=null}function p13gotDownloadCommand(a){if((downloadFile==null)||(a.id!=downloadFile.id)){return}if(a.sub=="start"){downloadFile.state=1;files.sendText({action:"download",sub:"startack",id:downloadFile.id})}else{if(a.sub=="cancel"){downloadFile=null;setDialogMode(0)}}}function p13gotDownloadBinaryData(a){if(!downloadFile||downloadFile.state==0){return}if(a.length>4){downloadFile.tsize+=(a.length-4);downloadFile.data+=a.substring(4);Q("d2progressBar").value=downloadFile.tsize}if((ReadInt(a,0)&1)!=0){saveAs(data2blob(downloadFile.data),downloadFile.file);downloadFile=null;setDialogMode(0)}else{files.sendText({action:"download",sub:"ack",id:downloadFile.id})}}var uploadFile;function p13doUploadFiles(a){if(xxdialogMode){return}uploadFile={};uploadFile.xpath=p13filetreelocation.join("/");uploadFile.xfiles=a;uploadFile.xfilePtr=-1;setDialogMode(2,"Upload File",10,p13uploadFileCancel,"<div id=p13dfileName>Connecting...</div><br /><progress id=d2progressBar style=width:100% value=0 max=0 />");p13uploadReconnect()}function onFileUploadStateChange(b,a){switch(a){case 0:p13folderup(9999);break;case 3:p13uploadNextFile();break;default:console.log("Unknown onFileUploadStateChange state",a);break}}function p13uploadReconnect(){uploadFile.ws=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotUploadData),serverPublicNamePort,authCookie);uploadFile.ws.attemptWebRTC=false;uploadFile.ws.ctrlMsgAllowed=false;uploadFile.ws.onStateChanged=onFileUploadStateChange;uploadFile.ws.Start(filesNode._id)}function p13uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var a=uploadFile.xfiles[uploadFile.xfilePtr];QH("p13dfileName",a.name);Q("d2progressBar").max=a.size;Q("d2progressBar").value=0;uploadFile.xreader=new FileReader();uploadFile.xreader.onload=function(){uploadFile.xdata=uploadFile.xreader.result;uploadFile.ws.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:a.name,size:uploadFile.xdata.byteLength}))};uploadFile.xreader.readAsArrayBuffer(a)}else{p13uploadFileCancel()}}function p13uploadFileCancel(a,b){if(uploadFile!=null){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}uploadFile=null}setDialogMode(0)}function p13gotUploadData(b){var a=JSON.parse(b);if((uploadFile==null)||(parseInt(uploadFile.xfilePtr)!=parseInt(a.reqid))){return}if(a.action=="uploadstart"){p13uploadNextPart(false);for(var c=0;c<8;c++){p13uploadNextPart(true)}}else{if(a.action=="uploadack"){p13uploadNextPart(false)}else{if(a.action=="uploaderror"){p13uploadFileCancel()}}}}function p13uploadNextPart(c){var a=uploadFile.xdata;var e=uploadFile.xptr;var d=uploadFile.xptr+4096;if(d>a.byteLength){if(c==true){return}d=a.byteLength}if(e==a.byteLength){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}if(uploadFile.xfiles.length>uploadFile.xfilePtr+1){p13uploadReconnect()}else{p13uploadFileCancel()}}else{var b=a.slice(e,d);uploadFile.ws.send(b);uploadFile.xptr=d;Q("d2progressBar").value=d}}var currentDeviceEvents=null;function deviceEventsUpdate(){var h="",a=null;for(var c in currentDeviceEvents){var b=currentDeviceEvents[c];var g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td class=DevSt colspan=4>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");h+="<tr><td style=width:18px><div class="+d+"></div></td><td class=g1 style=float:none> </td><td style=background-color:#C9C9C9>"+g.toLocaleTimeString()+" - "+e+"</td><td class=g2 style=float:none> </td></tr><tr style=height:2px></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p16events",h)}function refreshDeviceEvents(){meshserver.send({action:"events",nodeid:currentNode._id,limit:parseInt(p16limitdropdown.value)})}function agentConsoleHandleKeys(b){var d=0,a=Q("p15consoleText");if(b.key){if(b.keyCode==13&&consoleFocus==0){p15consoleSend(b);d=1}else{if(b.keyCode==8&&consoleFocus==0){var g=a.value;a.value=g.substring(0,g.length-1);d=1}else{if(b.keyCode==27){a.value="";d=1}else{if((b.keyCode==38)||(b.keyCode==40)){var c=consoleHistory.indexOf(a.value);if((b.keyCode==38)&&((consoleHistory.length-1)>c)){a.value=consoleHistory[c+1]}else{if((b.keyCode==40)&&(c>0)){a.value=consoleHistory[c-1]}else{if((b.keyCode==40)&&(c==0)){a.value=""}}}d=1}else{if(b.key.length===1){insertTextAtCursor(a,b.key);d=1}}}}}}else{if(b.charCode!=0&&consoleFocus==0){a.value=((a.value+String.fromCharCode(b.charCode)));d=1}}if(d>0){return haltEvent(b)}}function insertTextAtCursor(a,d){if(document.selection){a.focus();sel=document.selection.createRange();sel.text=d}else{if(a.selectionStart||a.selectionStart=="0"){var c=a.selectionStart,b=a.selectionEnd;a.value=a.value.substring(0,c)+d+a.value.substring(b,a.value.length);a.setSelectionRange(b+1,b+1)}else{a.value+=myValue}}}var consoleNode;var consoleServerText="";function setupConsole(){if(xxcurrentView==115){var d=(consoleNode=="server");consoleNode="server";QH("p15deviceName","My Server Console");QH("p15statetext","");QH("p15coreName","");if(d==false){QH("p15agentConsoleText",consoleServerText);Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}else{var d=(consoleNode==currentNode);consoleNode=currentNode;var a=meshes[consoleNode.meshid];var b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&16)!=0){if(consoleNode.consoleText==null){consoleNode.consoleText=""}if(d==false){QH("p15agentConsoleText",consoleNode.consoleText);Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}var c=((consoleNode.conn&1)!=0)?true:false;QH("p15statetext",c?"Agent is online":"Agent is offline");QE("p15consoleText",c);QE("p15uploadCore",c)}else{QH("p15statetext","Access Denied");QE("p15consoleText",false);QE("p15uploadCore",false)}}}function p15consoleClear(){QH("p15agentConsoleText","");Q("id_p15consoleClear").blur();if(xxcurrentView==115){consoleServerText=""}else{consoleNode.consoleText=""}}var consoleHistory=[];function p15consoleSend(a){if(a&&a.keyCode!=13){return}var d=Q("p15consoleText").value,c="<div style=color:green>> "+EscapeHtml(Q("p15consoleText").value)+"<br/></div>";Q("p15agentConsoleText").innerHTML+=c;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight;Q("p15consoleText").value="";if(xxcurrentView==115){consoleServerText+=c;meshserver.send({action:"serverconsole",value:d})}else{consoleNode.consoleText+=c;meshserver.send({action:"msg",type:"console",nodeid:consoleNode._id,value:d})}if(d.length>0){var b=consoleHistory.indexOf(d);if(b>=0){consoleHistory.splice(b,1)}consoleHistory.unshift(d);consoleHistory.splice(10)}}function p15consoleReceive(b,a){a="<div>"+a+"</div>";if(b==="serverconsole"){consoleServerText+=a;if(consoleNode=="server"){Q("p15agentConsoleText").innerHTML+=a;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}else{if(b.consoleText==null){b.consoleText=a}else{b.consoleText+=a}if(consoleNode==b){Q("p15agentConsoleText").innerHTML+=a;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}}function p15uploadCore(a){if(xxdialogMode){return}if(a.shiftKey==true){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"})}else{if(a.altKey==true){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"})}else{if(a.ctrlKey==true){p15uploadCore2()}else{setDialogMode(2,"Change Mesh Agent Core",3,p15uploadCoreEx,"<select id=d3coreMode style=float:right;width:260px><option value=1>Upload default server core</option><option value=2>Clear the core</option><option value=6>Upload recovery core</option><option value=3>Upload a core file</option><option value=4>Soft disconnect agent</option><option value=5>Hard disconnect agent</option></select><div>Change Core</div>")}}}}function p15uploadCoreEx(){if(Q("d3coreMode").value==1){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"})}else{if(Q("d3coreMode").value==2){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"})}else{if(Q("d3coreMode").value==3){p15uploadCore2()}else{if(Q("d3coreMode").value==4){meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:1})}else{if(Q("d3coreMode").value==5){meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:2})}else{if(Q("d3coreMode").value==6){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"recovery"})}}}}}}}function p15uploadCore2(){if(xxdialogMode){return}Q("d3localmodeform").action="uploadmeshcorefile.ashx";Q("d3attrib").value=currentNode._id;setDialogMode(3,"Upload Mesh Agent Core",3,p15uploadCoreEx2);d3init()}function p15uploadCoreEx2(){var b=Q("d3uploadMode").value;if(b==1){Q("d3submit").click()}else{var a=d3getFileSel();if(a.length==1){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"custom",path:d3filetreelocation.join("/")+"/"+a[0]})}}}function account_manageAuthApp(){if(xxdialogMode||((features&4096)==0)){return}if(userinfo.otpsecret==1){account_removeOtp()}else{account_addOtp()}}function account_addOtp(){if(xxdialogMode||(userinfo.otpsecret==1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"<div id=d2optinfo>Loading...</div>","otpauth-request");meshserver.send({action:"otpauth-request"})}function account_addOtpCheck(a){var b=(Q("d2otpauthinput").value.length==6);QE("idx_dlgOkButton",b);if(a&&(a.keyCode==13)&&b){dialogclose(1)}}function account_removeOtp(){if(xxdialogMode||(userinfo.otpsecret!=1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",3,function(){meshserver.send({action:"otpauth-clear"})},"Confirm removal of authenticator application 2-step login?")}function account_manageOtp(a){if((xxdialogMode==2)&&(xxdialogTag=="otpauth-manage")){dialogclose(0)}if(xxdialogMode||((features&4096)==0)){return}if((userinfo.otpsecret==1)||(userinfo.otphkeys>0)){meshserver.send({action:"otpauth-getpasswords",subaction:a})}}function account_manageHardwareOtp(){if((xxdialogMode==2)&&(xxdialogTag=="otpauth-hardware-manage")){dialogclose(0)}if(xxdialogMode||((features&4096)==0)){return}meshserver.send({action:"otp-hkey-get"})}function account_addhkey(a){if(a==1){var b="Type in the name of the key to add.<br /><br />";b+=addHtmlValue("Key Name",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="MyKey" onkeyup=account_addhkeyValidate(event,2) />')}else{if(a==2){var b="Type in a key name, select the OTP box and press the button on the YubiKey™.<br /><br />";b+=addHtmlValue("Key Name",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="MyKey" onkeyup=account_addhkeyValidate(event,1) />');b+=addHtmlValue("YubiKey™ OTP","<input id=dp1key style=width:230px autocomplete=off onkeyup=account_addhkeyValidate(event,2) />")}}setDialogMode(2,"Add Security Key",3,account_addhkeyEx,b,a);Q("dp1keyname").focus()}function account_addhkeyValidate(b,a){if((b!=null)&&(b.keyCode==13)){if(a==2){dialogclose(1)}else{Q("dp1key").focus()}}}function account_addhkeyEx(a,c){var b=Q("dp1keyname").value;if(b==""){b="MyKey"}if(c==1){meshserver.send({action:"otp-hkey-setup-request",name:b})}else{if(c==2){meshserver.send({action:"otp-hkey-yubikey-add",name:b,otp:Q("dp1key").value});setDialogMode(2,"Add Security Key",0,null,"<br />Checking...<br /><br /><br />","otpauth-hardware-manage")}}}function account_removehkey(a){meshserver.send({action:"otp-hkey-remove",index:a});meshserver.send({action:"otp-hkey-get"})}function account_showVerifyEmail(){if(xxdialogMode||(userinfo.emailVerified==true)||(serverinfo.emailcheck!=true)){return}var a="Click ok to send a verification mail to:<br /><div style=padding:8px><b>"+EscapeHtml(userinfo.email)+"</b></div>Please wait a few minute to receive the verification.";setDialogMode(2,"Email Verification",3,account_showVerifyEmailEx,a)}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){if(xxdialogMode){return}var a="Change your account email address here.<br /><br />";a+=addHtmlValue("Email","<input id=dp2email style=width:230px maxlength=256 onchange=account_validateEmail() onkeyup=account_validateEmail(event) />");setDialogMode(2,"Email Address Change",3,account_changeEmail,a);if(userinfo.email!=null){Q("dp2email").value=userinfo.email}account_validateEmail();Q("dp2email").focus()}function account_validateEmail(a,b){QE("idx_dlgOkButton",validateEmail(Q("dp2email").value)&&(Q("dp2email").value!=userinfo.email));if((a!=null)&&(a.keyCode==13)){dialogclose(1)}}function account_changeEmail(){meshserver.send({action:"changeemail",email:Q("dp2email").value})}function account_showDeleteAccount(){if(xxdialogMode){return}var a="To delete this account, type in the account password in both boxes below and hit ok.<br /><br />";a+="<form action='"+domainUrl+"deleteaccount' method=post><table style=margin-left:80px><tr>";a+="<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";a+="</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";a+="</tr></table><br /><div style=padding:10px;margin-bottom:4px>";a+="<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>";a+='<input id=account_dlgOkButton type=submit value=OK style="float:right;width:80px" onclick=dialogclose(1)>';a+="</div><br /></form>";setDialogMode(2,"Delete Account",0,null,a);account_validateDeleteAccount();Q("apassword1").focus()}function account_showChangePassword(){if(xxdialogMode){return}var c="Change your account password by entering the old password and new password twice in the boxes below. Password hint can be used but is not recommanded.<br /><br />";c+="<table style=margin-left:60px>";c+="<tr><td align=right>Old password:</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b></b></td></tr>";c+="<tr><td align=right>New password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>";c+="<tr><td align=right>New password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";c+="<tr><td align=right>Password hint:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";c+="</table>";if(passRequirements){var b=[];for(var a in passRequirements){b.push(a+":"+passRequirements[a])}c+="<br /><span style=font-size:x-small>Requirements: "+b.join(", ")+".</span>"}c+="<br />";setDialogMode(2,"Change Password",3,account_showChangePasswordEx,c);Q("apassword0").focus();account_validateNewPassword()}function account_showChangePasswordEx(){if(Q("apassword1").value==Q("apassword2").value){meshserver.send({action:"changepassword",oldpass:Q("apassword0").value,newpass:Q("apassword1").value,hint:Q("apasswordhint").value})}}function account_createMesh(){if(xxdialogMode){return}if((userinfo.emailVerified!==true)&&(serverinfo.emailcheck==true)&&(userinfo.siteadmin!=4294967295)){setDialogMode(2,"New Device Group",1,null,'Unable to create a new device group until a email address is verified. This is required for password recovery. Go to the "My Account" tab to change and verify an email address.');return}var a="Create a new device group using the options below.<br /><br />";a+=addHtmlValue("Name","<input id=dp2meshname style=width:230px maxlength=64 onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate() />");a+=addHtmlValue("Type","<div style=width:230px;margin:0;padding:0><select id=dp2meshtype style=width:100% onchange=account_validateMeshCreate() ><option value=2>Manage using a software agent</option><option value=1>Intel® AMT only, no agent</option></select></div>");a+=addHtmlValue("Description","<div style=width:230px;margin:0;padding:0><textarea id=dp2meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>");setDialogMode(2,"New Device Group",3,account_createMeshEx,a);account_validateMeshCreate();Q("dp2meshname").focus()}function account_validateMeshCreate(){QE("idx_dlgOkButton",Q("dp2meshname").value.length>0)}function account_createMeshEx(a,b){meshserver.send({action:"createmesh",meshname:Q("dp2meshname").value,meshtype:Q("dp2meshtype").value,desc:Q("dp2meshdesc").value})}function account_validateDeleteAccount(){QE("account_dlgOkButton",(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value))}function account_validateNewPassword(){var d="",a=(Q("apassword0").value.length>0)&&(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value)&&(Q("apassword0").value!=Q("apassword1").value)&&(Q("apasswordhint").value!=Q("apassword1").value);if(Q("apassword1").value!=""){if(passRequirements==null||passRequirements==""){var c=checkPasswordStrength(Q("apassword1").value);if(c>=80){d="<span style=color:green>Strong<span>"}else{if(c>=60){d="<span style=color:blue>Good<span>"}else{d="<span style=color:red>Weak<span>"}}}else{var b=checkPasswordRequirements(Q("apassword1").value,passRequirements);if(b==false){a=false;d="<span style=color:red>Policy<span>"}}}QH("dxPassWarn",d);QE("idx_dlgOkButton",a)}function checkPasswordStrength(e){var g=0,d={},h=0,j={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e){return 0}for(var b=0;b<e.length;b++){d[e[b]]=(d[e[b]]||0)+1;g+=5/d[e[b]]}for(var a in j){h+=(j[a]==true)?1:0}return parseInt(g+(h-1)*10)}function checkPasswordRequirements(e,g){if((g==null)||(g=="")||(typeof g!="object")){return true}if(g.min){if(e.length<g.min){return false}}if(g.max){if(e.length>g.max){return false}}var d=0,b=0,h=0,c=0;for(var a=0;a<e.length;a++){if(/\d/.test(e[a])){d++}if(/[a-z]/.test(e[a])){b++}if(/[A-Z]/.test(e[a])){h++}if(/\W/.test(e[a])){c++}}if(g.num&&(d<g.num)){return false}if(g.lower&&(b<g.lower)){return false}if(g.upper&&(h<g.upper)){return false}if(g.nonalpha&&(c<g.nonalpha)){return false}return true}function updateMeshes(){var e="";var a=0,b=0;for(i in meshes){if(a>1){e+="</tr><tr>";a=0}a++;b++;var d=0;if(meshes[i].links["user/"+domain+"/"+userinfo.name.toLowerCase()]){d=meshes[i].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights}var g="Partial Rights";if(d==4294967295){g="Full Administrator"}else{if(d==0){g="No Rights"}}e+="<div onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:431px;height:50px;padding-top:1px;padding-bottom:1px;float:left><div style=float:left;width:30px;height:100%></div><div style=height:100%;cursor:pointer onclick=gotoMesh('"+i+"')><div class=mi style=float:left;width:50px;height:50px></div><div style=height:100%><div class=g1></div><div class=e2 style=width:300px><div class=e1>"+EscapeHtml(meshes[i].name)+"</div><div>"+g+"</div></div><div class=g2 style=float:left></div></div></div></div>"}meshcount=b;QH("p2meshes",e);QV("p2noMeshFound",b==0)}function gotoMesh(a){currentMesh=meshes[a];p20updateMesh();go(20)}function server_showRestoreDlg(){if(xxdialogMode){return}var a="Restore the server using a backup, <span style=color:red>this will delete the existing server data</span>. Only do this if you know what you are doing.<br /><br />";a+='<form action="/restoreserver.ashx" enctype="multipart/form-data" method="post"><div>';a+='<input id=account_dlgFileInput type=file name=datafile style=width:100% accept=".zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed" onchange=account_validateServerRestore()>';a+="<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>";a+="<input id=account_dlgOkButton type=submit value=OK style=float:right;width:80px onclick=dialogclose(1)>";a+="</div><br /><br /></form>";setDialogMode(2,"Restore Server",0,null,a);account_validateServerRestore()}function account_validateServerRestore(){QE("account_dlgOkButton",Q("account_dlgFileInput").files.length==1)}function server_showVersionDlg(){if(xxdialogMode){return}setDialogMode(2,"MeshCentral Version",1,null,"Loading...","MeshCentralServerUpdate");meshserver.send({action:"serverversion"})}function server_showVersionDlgUpdate(){QE("idx_dlgOkButton",Q("d2updateCheck").checked)}function server_showVersionDlgEx(){meshserver.send({action:"serverupdate"})}function server_showErrorsDlg(){if(xxdialogMode){return}setDialogMode(2,"MeshCentral Errors",1,null,"Loading...","MeshCentralServerErrors");meshserver.send({action:"servererrors"})}function server_showErrorsDlgUpdate(){QE("idx_dlgOkButton",Q("d2updateCheck").checked)}function server_showErrorsDlgEx(){meshserver.send({action:"serverclearerrorlog"})}var currentMesh;function p20updateMesh(){if(currentMesh==null){return}QH("p20meshName",EscapeHtml(currentMesh.name));var h="Unknown #"+currentMesh.mtype;var g=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if(currentMesh.mtype==1){h="Intel® AMT only, no agent"}if(currentMesh.mtype==2){h="Managed using a software agent"}var n="";n+=addHtmlValue("Name",addLinkConditional(EscapeHtml(currentMesh.name),"p20editmesh(1)",(g&1)!=0));n+=addHtmlValue("Description",addLinkConditional(((currentMesh.desc&¤tMesh.desc!="")?EscapeHtml(currentMesh.desc):"<i>None</i>"),"p20editmesh(2)",(g&1)!=0));var e=[];if(currentMesh.flags){if(currentMesh.flags&1){e.push("Auto-Remove")}}e=e.join(", ");if(e==""){e="<i>None</i>"}n+=addHtmlValue("Features",addLinkConditional(e,"p20editmeshfeatures()",(g&1)!=0));n+=addHtmlValue("Type",h);if(currentMesh.mtype==2){var d="No Policy";if(currentMesh.amt){if(currentMesh.amt.type==1){d="Deactivate Client Control Mode (CCM)"}else{if(currentMesh.amt.type==2){d="Simple Client Control Mode (CCM)";if(currentMesh.amt.cirasetup==2){d+=" + CIRA"}}}}n+=addHtmlValue("Intel® AMT",addLinkConditional(d,"p20editMeshAmt()",(g&4294967295)!=0))}if(g&1){n+='<br><input type=button value=Notes title="View notes about this device group" onclick=showNotes(false,"'+encodeURIComponent(currentMesh._id)+'") />'}n+="<br style=clear:both><br>";var b=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(b&&((b.rights&2)!=0)){n+="<a onclick=p20showAddMeshUserDialog() style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Add User</a>"}if((g&4)!=0){if(currentMesh.mtype==1){n+='<a onclick=addCiraDeviceToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new Intel® AMT computer that is located on the internet."><img src=images/icon-installmesh.png border=0 height=12 width=12> Install CIRA</a>';n+='<a onclick=addDeviceToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new Intel® AMT computer that is located on the local network."><img src=images/icon-installmesh.png border=0 height=12 width=12> Install local</a>'}if(currentMesh.mtype==2){n+='<a onclick=addAgentToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new computer to this mesh by installing the mesh agent."><img src=images/icon-addnew.png border=0 height=12 width=12> Install</a>';if(features&64){n+='<a onclick=inviteAgentToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Invite someone to install the mesh agent on this mesh."><img src=images/icon-addnew.png border=0 height=12 width=12> Invite</a>'}}}n+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>User Authorizations</th><th scope=col style=text-align:left></th></tr>';var a=1,l=[];for(var c in currentMesh.links){l.push({id:c,name:c.split("/")[2],rights:currentMesh.links[c].rights})}l.sort(function(o,p){if(o.name>p.name){return 1}if(o.name<p.name){return -1}return 0});for(var c in l){var m="",k="Partial Rights",j=l[c].rights;if(j==4294967295){k="Full Administrator"}else{if(j==0){k="No Rights"}}if((c!=userinfo._id)&&(g==4294967295||(((g&2)!=0)))){m='<a onclick=p20deleteUser(event,"'+encodeURIComponent(l[c].id)+'") title="Remote user rights to this mesh" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'}n+='<tr onclick=p20viewuser("'+encodeURIComponent(l[c].id)+'") style=cursor:pointer'+(((a%2)==0)?";background-color:#DDD":"")+'><td><div title="User" class=m2></div><div> '+l[c].name+"<div></div></div></td><td><div style=float:right>"+m+"</div><div>"+k+"</div></td></tr>";++a}n+="</tbody></table>";if(g==4294967295){n+="<div style=font-size:x-small;text-align:right><span><a onclick=p20showDeleteMeshDialog() style=cursor:pointer>Delete Group</a></span></div>"}QH("p20info",n)}function p20editMeshAmt(){if(xxdialogMode){return}var a="";a+=addHtmlValue("Type","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>No Policy</option><option value=1>Deactivate Client Control Mode (CCM)</option><option value=2>Simple Client Control Mode (CCM)</option></select>");a+="<div id=dp20amtpolicydiv></div>";setDialogMode(2,"Intel® AMT Policy",3,p20editMeshAmtEx,a);if(currentMesh.amt){Q("dp20amtpolicy").value=currentMesh.amt.type}p20editMeshAmtChange();if(currentMesh.amt&¤tMesh.amt.type==2){Q("dp20amtpolicypass").value=currentMesh.amt.password;Q("dp20amtbadpass").value=currentMesh.amt.badpass;Q("dp20amtcira").value=currentMesh.amt.cirasetup}dp20amtValidatePolicy()}function p20editMeshAmtChange(){var a=Q("dp20amtpolicy").value,b="";if(a==2){b=addHtmlValue("Password*","<input id=dp20amtpolicypass style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() />");b+=addHtmlValue("Password mismatch","<select id=dp20amtbadpass style=width:230px><option value=0>Do nothing</option><option value=1>Reactivate Intel® AMT</option></select>");b+=addHtmlValue('<span title="Client Initiated Remote Access">CIRA</span>',"<select id=dp20amtcira style=width:230px><option value=0>Don't configure</option><option value=1>Don't connect to server</option><option value=2>Connect to server</option></select>");b+='<br/><span style="font-size:10px">* Recommanded, leave blank to assign a random password to each device.</span><br/>';b+='<span style="font-size:10px">This policy will not impact devices with Intel® AMT in ACM mode.</span><br/>';b+='<span style="font-size:10px">This is not a secure policy as agents will be performing activation.</span>'}QH("dp20amtpolicydiv",b)}function dp20amtValidatePolicy(){var a=true,c=Q("dp20amtpolicy").value;if(c==2){var b=Q("dp20amtpolicypass").value;a=(b=="")?true:passwordcheck(b)}QE("idx_dlgOkButton",a)}function p20editMeshAmtEx(){var b=parseInt(Q("dp20amtpolicy").value),a={type:b};if(b==2){a={type:b,password:Q("dp20amtpolicypass").value,badpass:parseInt(Q("dp20amtbadpass").value),cirasetup:parseInt(Q("dp20amtcira").value)}}meshserver.send({action:"meshamtpolicy",meshid:currentMesh._id,amtpolicy:a})}function p20showDeleteMeshDialog(){if(xxdialogMode){return}var a='Are you sure you want to delete group "'+EscapeHtml(currentMesh.name)+'"? Deleting the device group will also delete all information about devices within this group.<br /><br />';a+="<input id=p20check type=checkbox onchange=p20validateDeleteMeshDialog() />Confirm";setDialogMode(2,"Delete Group",3,p20showDeleteMeshDialogEx,a);p20validateDeleteMeshDialog()}function p20validateDeleteMeshDialog(){QE("idx_dlgOkButton",Q("p20check").checked)}function p20showDeleteMeshDialogEx(a,b){meshserver.send({action:"deletemesh",meshid:currentMesh._id,meshname:currentMesh.name})}function p20editmesh(a){if(xxdialogMode){return}var b=addHtmlValue("Name","<input id=dp20meshname style=width:230px maxlength=32 onchange=p20editmeshValidate() onkeyup=p20editmeshValidate() />");b+=addHtmlValue("Description","<div style=width:230px;margin:0;padding:0><textarea id=dp20meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>");setDialogMode(2,"Edit Device Group",3,p20editmeshEx,b);Q("dp20meshname").value=currentMesh.name;if(currentMesh.desc){Q("dp20meshdesc").value=currentMesh.desc}p20editmeshValidate();if(a==2){Q("dp20meshdesc").focus()}else{Q("dp20meshname").focus()}}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(){QE("idx_dlgOkButton",Q("dp20meshname").value.length>0)}function p20editmeshfeatures(){if(xxdialogMode){return}var a=(currentMesh.flags)?currentMesh.flags:0;var b="<div><input type=checkbox id=d20flag1 "+((a&1)?"checked":"")+">Remove device on disconnect<br></div>";setDialogMode(2,"Edit Device Group Features",3,p20editmeshfeaturesEx,b)}function p20editmeshfeaturesEx(){var a=0;if(Q("d20flag1").checked){a+=1}meshserver.send({action:"editmesh",meshid:currentMesh._id,flags:a})}function p20showAddMeshUserDialog(){if(xxdialogMode){return}var a="Allow a user to manage this device group and devices in this group<br /><br />";a+=addHtmlValue("User Name","<input id=dp20username style=width:230px maxlength=32 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() />");a+="<br><div>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>Full Administrator<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editmesh>Edit Device Group<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20manageusers>Manage Device Group Users<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20managecomputers>Manage Device Group Computers<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotecontrol>Remote Control<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshagentconsole>Mesh Agent Console<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshserverfiles>Server Files<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20wakedevices>Wake Devices<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editnotes>Edit Device Notes<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remoteview>Remote View Only<br>";a+="</div>";setDialogMode(2,"Add User to Device Group",3,p20showAddMeshUserDialogEx,a);p20validateAddMeshUserDialog();Q("dp20username").focus()}function p20validateAddMeshUserDialog(){var a=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;QE("idx_dlgOkButton",(Q("dp20username").value.length>0));QE("p20fulladmin",a==4294967295);QE("p20editmesh",(!Q("p20fulladmin").checked)&&(a==4294967295));QE("p20manageusers",!Q("p20fulladmin").checked);QE("p20managecomputers",!Q("p20fulladmin").checked);QE("p20remotecontrol",!Q("p20fulladmin").checked);QE("p20meshagentconsole",!Q("p20fulladmin").checked);QE("p20meshserverfiles",!Q("p20fulladmin").checked);QE("p20wakedevices",!Q("p20fulladmin").checked);QE("p20editnotes",!Q("p20fulladmin").checked);QE("p20remoteview",!Q("p20fulladmin").checked)}function p20showAddMeshUserDialogEx(){var a=0;if(Q("p20fulladmin").checked==true){a=4294967295}else{if(Q("p20editmesh").checked==true){a+=1}if(Q("p20manageusers").checked==true){a+=2}if(Q("p20managecomputers").checked==true){a+=4}if(Q("p20remotecontrol").checked==true){a+=8}if(Q("p20meshagentconsole").checked==true){a+=16}if(Q("p20meshserverfiles").checked==true){a+=32}if(Q("p20wakedevices").checked==true){a+=64}if(Q("p20editnotes").checked==true){a+=128}if(Q("p20remoteview").checked==true){a+=256}}meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,username:Q("dp20username").value,meshadmin:a})}function p20viewuser(e){if(xxdialogMode){return}e=decodeURIComponent(e);var d="",b=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights,c=currentMesh.links[e].rights;if(c==4294967295){d=", Full Administrator (all rights)"}else{if((c&1)!=0){d+=", Edit Device Group"}if((c&2)!=0){d+=", Manage Device Group Users"}if((c&4)!=0){d+=", Manage Device Group Computers"}if((c&8)!=0){d+=", Remote Control"}if((c&16)!=0){d+=", Agent Console"}if((c&32)!=0){d+=", Server Files"}if((c&64)!=0){d+=", Wake Devices"}if((c&128)!=0){d+=", Edit Notes"}if((c&256)!=0){d+=", Remote View Only"}}d=d.substring(2);if(d==""){d="No Rights"}var a=1,g=addHtmlValue("User Name",e.split("/")[2]);g+=addHtmlValue("Permissions",d);if((("user/"+domain+"/"+userinfo.name.toLowerCase())!=e)&&(b==4294967295||(((b&2)!=0)&&(c!=4294967295)))){a+=4}setDialogMode(2,"Device Group User",a,p20viewuserEx,g,e)}function p20viewuserEx(a,b){if(a!=2){return}setDialogMode(2,"Remote Mesh User",3,p20viewuserEx2,"Confirm removal of user "+b.split("/")[2]+"?",b)}function p20deleteUser(a,b){haltEvent(a);p20viewuserEx(2,decodeURIComponent(b))}function p20viewuserEx2(a,b){meshserver.send({action:"removemeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:b})}var filetreelinkpath;var filetreelocation=[];function updateFiles(){QV("MainMenuMyFiles",((features&8)==0));if((features&8)!=0){return}var q="",r="",c="<a style=cursor:pointer onclick=p5folderup(0)>Root</a>",o="Root",y,k=filetree,m=1;var j=[],v=filetreelinkpath,b=[],a=document.getElementsByName("fc");for(var s=0;s<a.length;s++){if(a[s].checked){b.push(a[s].value)}}filetreelinkpath="";for(var s in filetreelocation){if((k.f!=null)&&(k.f[filetreelocation[s]]!=null)){j.push(filetreelocation[s]);o+=" / "+filetreelocation[s];if((m==1)){var B=filetreelocation[s].split("/");y=window.location+B[0]+"files/"+B[2];filetreelinkpath+=filetreelocation[s]}else{if(filetreelinkpath!=""){filetreelinkpath+="/"+filetreelocation[s];if(m>2){y+="/"+filetreelocation[s]}}}k=k.f[filetreelocation[s]];c+=" / <a style=cursor:pointer onclick=p5folderup("+m+")>"+(k.n!=null?k.n:filetreelocation[s])+"</a>";m++}else{break}}filetreelocation=j;var w=o.toLowerCase().startsWith("root / "+userinfo._id+" / public");var l=p5sort_files(k.f);for(var s in l){var d=l[s],u=d.n,A;A=u;if(u.length>70){A='<span title="'+EscapeHtml(u)+'">'+EscapeHtml(u.substring(0,70))+"...</span>"}else{A=EscapeHtml(u)}u=EscapeHtml(u);var g="";if(d.d!=null){var e=new Date(d.d),g=(e.getMonth()+1)+"/"+(e.getDate())+"/"+e.getFullYear()+" "+e.toLocaleTimeString()+" "}var n="";if(d.s!=null){n=getFileSizeStr(d.s)}var p="";if(d.t<3||d.t==4){var z=(d.t==1||d.t==4)?p5getQuotabar(d):"",C="";p="<div class=filelist file=999><input file=999 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+u+"'> <span style=float:right title=\""+C+'">'+z+"</span><span><div class=fileIcon"+d.t+' onclick=p5folderset("'+encodeURIComponent(d.nx)+'")></div><a style=cursor:pointer onclick=p5folderset("'+encodeURIComponent(d.nx)+'")>'+A+"</a></span></div>"}else{var t=A;var x="";if(w){x=' (<a style=cursor:pointer title="Display public link" onclick=\'p5showPublicLink("'+y+"/"+d.nx+"\")'>Link</a>)"}if(d.s>0){t='<a rel="noreferrer noopener" target="_blank" href="downloadfile.ashx?link='+encodeURIComponent(filetreelinkpath+"/"+d.nx)+'">'+A+"</a>"+x}p="<div class=filelist file=3><input file=3 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+d.nx+"'> <span class=fsize>"+g+"</span><span style=float:right>"+n+"</span><span><div class=fileIcon"+d.t+"></div>"+t+"</span></div>"}if(d.t<3){q+=p}else{r+=p}}QH("p5rightOfButtons",p5getQuotabar(k));QH("p5files",q+r);QH("p5currentpath",c);QE("p5FolderUp",filetreelocation.length!=0);QV("p5PublicShare",w);if(v==filetreelinkpath){a=document.getElementsByName("fc");for(var s=0;s<a.length;s++){a[s].checked=(b.indexOf(a[s].value)>=0)}}p5setActions()}function getNiceSize(a){if(a<=0){return"Storage limit exceed"}if(a<2048){return a+" bytes remaining"}if(a<2097152){return Math.round(a/1024)+" kilobytes remaining"}if(a<2147483648){return Math.round(a/1024/1024)+" megabytes remaining"}return Math.round(a/1024/1024/1024)+" gigabytes remaining"}function getNiceSize2(a){if(a<=0){return"None"}if(a<2048){return a+" b"}if(a<2097152){return Math.round(a/1024)+" Kb"}if(a<2147483648){return Math.round(a/1024/1024)+" Mb"}return Math.round(a/1024/1024/1024)+" Gb"}function p5getQuotabar(a){while(a.t>1&&a.t!=4){a=a.parent}if((a.t!=1&&a.t!=4)||(a.maxbytes==null)){return""}var b=Math.floor(a.s/1024),c=(a.maxbytes-a.s);return'<span title="'+b+"k in "+a.c+" file"+(a.c>1?"s":"")+". "+(Math.floor(a.maxbytes/1024/1024))+'k maxinum">'+getNiceSize(c)+" <progress style=height:10px;width:100px value="+a.s+" max="+a.maxbytes+" /></span>"}function p5showPublicLink(a){setDialogMode(2,"Public Link",1,null,'<input type=text style=width:100% value="'+a+'" readonly />')}var sortorder;function p5sort_filename(c,d){if(c.ln>d.ln){return(1*sortorder)}if(c.ln<d.ln){return(-1*sortorder)}return 0}function p5sort_timestamp(c,d){if(c.d>d.d){return(1*sortorder)}if(c.d<d.d){return(-1*sortorder)}return 0}function p5sort_bysize(c,d){if(c.s==d.s){return p5sort_filename(c,d)}return(((c.s-d.s))*sortorder)}function p5sort_files(a){var c=[],d=Q("p5sortdropdown").value;for(var b in a){a[b].nx=b;if(a[b].n==null){a[b].n=b}a[b].ln=a[b].n.toLowerCase();c.push(a[b])}sortorder=1;if(d>3){sortorder=-1;d-=3}if(d==1){c.sort(p5sort_filename)}else{if(d==2){c.sort(p5sort_bysize)}else{if(d==3){c.sort(p5sort_timestamp)}}}return c}function p5setActions(){var a=getFileSelCount(),c=getFileCount(),b=getFileSelCount(false);QE("p5DeleteFileButton",(a>0)&&(filetreelocation.length>0));QE("p5NewFolderButton",filetreelocation.length>0);QE("p5UploadButton",filetreelocation.length>0);QE("p5RenameFileButton",(a==1)&&(filetreelocation.length>0));QE("p5SelectAllButton",c>0);Q("p5SelectAllButton").value=(a>0?"Select None":"Select All");QE("p5CutButton",(b>0)&&(a==b));QE("p5CopyButton",(b>0)&&(a==b));QE("p5PasteButton",(p5clipboard!=null)&&(p5clipboard.length>0)&&(filetreelocation.length>0))}function getFileSelCount(d){var a=0,b=document.getElementsByName("fc");for(var c=0;c<b.length;c++){if((b[c].checked)&&((d!=false)||(b[c].attributes.file.value=="3"))){a++}}return a}function getFileSelDirCount(){var a=0,b=document.getElementsByName("fc");for(var c=0;c<b.length;c++){if((b[c].checked)&&(b[c].attributes.file.value=="999")){a++}}return a}function getFileCount(){var a=0;var b=document.getElementsByName("fc");return b.length}function p5selectallfile(){var c=(getFileSelCount()==0),a=document.getElementsByName("fc");for(var b=0;b<a.length;b++){a[b].checked=c}p5setActions()}function setupBackPointers(d){if(d.f!=null){var b=0,a=0;for(var c in d.f){setupBackPointers(d.f[c]);d.f[c].parent=d;if(d.f[c].s){b+=d.f[c].s}if(d.f[c].c){a+=d.f[c].c}if(d.f[c].t==3){a++}}d.s=b;d.c=a}return d}function getFileSizeStr(a){if(a==1){return"1 byte"}return""+a+" bytes"}function p5folderup(a){if(a==null){filetreelocation.pop()}else{while(filetreelocation.length>a){filetreelocation.pop()}}updateFiles()}function p5folderset(a){filetreelocation.push(decodeURIComponent(a));updateFiles()}function p5createfolder(){setDialogMode(2,"New Folder",3,p5createfolderEx,"<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% />");focusTextBox("p5renameinput");p5fileNameCheck()}function p5createfolderEx(){meshserver.send({action:"fileoperation",fileop:"createfolder",path:filetreelocation,newfolder:Q("p5renameinput").value})}function p5deletefile(){var a=getFileSelCount(),b=(getFileSelDirCount()>0)?"<br /><br /><input type=checkbox id=p5recdeleteinput>Recursive delete<br>":"<input type=checkbox id=p5recdeleteinput style='display:none'>";setDialogMode(2,"Delete",3,p5deletefileEx,(a>1)?("Delete "+a+" selected items?"+b):("Delete selected item?"+b))}function p5deletefileEx(){var b=[],a=document.getElementsByName("fc");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(a[c].value)}}meshserver.send({action:"fileoperation",fileop:"delete",path:filetreelocation,delfiles:b,rec:Q("p5recdeleteinput").checked})}function p5renamefile(){var c,a=document.getElementsByName("fc");for(var b=0;b<a.length;b++){if(a[b].checked){c=a[b].value}}setDialogMode(2,"Rename",3,p5renamefileEx,'<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% value="'+c+'" />',{action:"fileoperation",fileop:"rename",path:filetreelocation,oldname:c});focusTextBox("p5renameinput");p5fileNameCheck()}function p5renamefileEx(a,c){c.newname=Q("p5renameinput").value;meshserver.send(c)}function p5fileNameCheck(a){var b=isFilenameValid(Q("p5renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a&&a.keyCode==13)){dialogclose(1)}}var isFilenameValid=(function(){var b=/^[^\\/:\*\?"<>\|]+$/,c=/^\./,d=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function a(e){return b.test(e)&&!c.test(e)&&!d.test(e)&&(e[0]!=".")}})();function p5uploadFile(){setDialogMode(2,"Upload File",3,p5uploadFileEx,'<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value="'+encodeURIComponent(filetreelinkpath)+'" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=submit id=p5loginSubmit style=display:none /></form>');updateUploadDialogOk("p5uploadinput")}function p5uploadFileEx(){Q("p5loginSubmit").click()}function updateUploadDialogOk(a){QE("idx_dlgOkButton",Q(a).value!="")}var p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;function p5copyFile(b){var a=document.getElementsByName("fc");p5clipboard=[];p5clipboardCut=b,p5clipboardFolder=Clone(filetreelocation);for(var c=0;c<a.length;c++){if((a[c].checked)&&(a[c].attributes.file.value=="3")){p5clipboard.push(a[c].value)}}p5updateClipview()}function p5pasteFile(){var a="";if((p5clipboard!=null)&&(p5clipboard.length>0)){a="Confim "+(p5clipboardCut==0?"copy":"move")+" of "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p5pasteFileEx,a)}function p5pasteFileEx(){meshserver.send({action:"fileoperation",fileop:(p5clipboardCut==0?"copy":"move"),scpath:p5clipboardFolder,path:filetreelocation,names:p5clipboard});p5folderup(999);if(p5clipboardCut==1){p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;p5updateClipview()}}function p5updateClipview(){var a="";if((p5clipboard!=null)&&(p5clipboard.length>0)){a="Holding "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" for "+(p5clipboardCut==0?"copy":"move")+", <a onclick=p5clearClip() style=cursor:pointer>Clear</a>."}QH("p5bottomstatus",a);p5setActions()}function p5clearClip(){p5clipboard=null;p5clipboardFolder=null;p5clipboardCut=0;p5updateClipview()}function p5fileDragDrop(b){if(xxdialogMode){return}haltEvent(b);QV("bigfail",false);QV("bigok",false);var c=0;p5uploadFile();try{Q("p5uploadinput").files=b.dataTransfer.files}catch(d){c=1}if(c==0){p5uploadFileEx()}setDialogMode(0);if(c==1){if(b.dataTransfer==null||b.dataTransfer.files.length==0||filetreelocation.length==0){return}var j=[],m=[],o=[],a=[],l=b.dataTransfer.files.length,n=0;for(var h=0;h<b.dataTransfer.files.length;h++){n+=b.dataTransfer.files[h].size}if(n>1300000){p5uploadFile();return}for(var h=0;h<b.dataTransfer.files.length;h++){var k=new FileReader(),g=b.dataTransfer.files[h];j.push(g.name);m.push(g.size);o.push(g.type);k.onload=function(e){a.push(e.target.result);if(--l==0){Q("p5fileDragName").value=j.join("*");Q("p5fileDragSize").value=m.join("*");Q("p5fileDragType").value=o.join("*");Q("p5fileDragData").value=a.join("*");Q("p5fileDragLink").value=encodeURIComponent(filetreelinkpath);Q("p5loginSubmit2").click()}};k.readAsDataURL(g)}}}var p5dragtimer=null;function p5fileDragOver(b){if(xxdialogMode){return}haltEvent(b);if(p5dragtimer!=null){clearTimeout(p5dragtimer);p5dragtimer=null}var a=true;if(filetreelocation.length==0){a=false}QV("bigok",a);QV("bigfail",!a)}function p5fileDragLeave(a){if(xxdialogMode){return}haltEvent(a);if(a.target.id!="p5filetable"){QV("bigfail",false);QV("bigok",false)}else{p5dragtimer=setTimeout(function(){QV("bigfail",false);QV("bigok",false);p5dragtimer=null},10)}}function eventMouseHover(a,b){a.children[1].classList.remove("g1s");a.children[2].style["background-color"]=((b==0)?"#c9c9c9":"#b9b9b9");a.children[3].classList.remove("g2s");if(b==1){a.children[1].classList.add("g1s");a.children[3].classList.add("g2s")}}function eventsUpdate(){var h="",a=null;for(var c in events){var b=events[c],g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");if(b.username&&b.username!=userinfo.name){e+=": "+b.username}h+="<tr onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+d+"></div></td><td class=g1 style=float:none> </td><td style=background-color:#C9C9C9>"+g.toLocaleTimeString()+" - "+e+"</td><td class=g2 style=float:none> </td></tr><tr style=height:2px></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p3events",h)}function showDeleteAllEventsDialog(){if(xxdialogMode){return}var a="Delete all events in the server event log?<br /><br />";a+="<input id=p3check type=checkbox onchange=validateDeleteAllEventsDialog() />Confirm";setDialogMode(2,"Delete All Events",3,showDeleteAllEventsDialogEx,a);validateDeleteAllEventsDialog()}function validateDeleteAllEventsDialog(){QE("idx_dlgOkButton",Q("p3check").checked)}function showDeleteAllEventsDialogEx(a,b){meshserver.send({action:"clearevents"})}function refreshEvents(){meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)})}function updateUsers(){QV("MainMenuMyUsers",(users!=null)&&((features&4)==0));QV("LeftMenuMyUsers",(users!=null)&&((features&4)==0));if((users==null)||((features&4)!=0)){QH("p3users","");return}var g=[],d=100,b=0;for(var c in users){g.push(c)}g.sort();var j=Q("UserSearchInput").value.toLowerCase();var k="<table style=width:100% cellpadding=0 cellspacing=0>",a=true;for(var c in g){var h=users[g[c]],e=null;if(wssessions!=null){e=wssessions[h._id]}if((e!=null)&&(h.name.toLowerCase().indexOf(j)>=0)){if(d>0){if(a){k+="<tr><td class=userTableHeader>Online Users";a=false}k+=addUserHtml(h,e);d--}else{b++}}}a=true;for(var c in g){var h=users[g[c]],e=null;if(wssessions!=null){e=wssessions[h._id]}if((e==null)&&(h.name.toLowerCase().indexOf(j)>=0)){if(d>0){if(a){k+="<tr><td class=userTableHeader>Offline Users";a=false}k+=addUserHtml(h,e);d--}else{b++}}}k+="</table>";if(b==1){k+="<br />1 more user not shown, use search box to look for users...<br />"}else{if(b>1){k+="<br />"+b+" more users not shown, use search box to look for users...<br />"}}if(d==100){k+="<br />No users found.<br />"}QH("p3users",k);if((currentUser!=null)&&(xxcurrentView==30)){gotoUser(encodeURIComponent(currentUser._id),true)}}function addUserHtml(j,h){var l="",b=" gray",c="m2",d="",e="",g=(j.name!=userinfo.name);if(h!=null){b="";if(g){e='<span style=float:right;margin-top:1px;margin-right:4px title=Chat><a onclick=userChat(event,"'+encodeURIComponent(j._id)+'","'+encodeURIComponent(j.name)+"\")><img src='images/icon-chat.png' height=16 width=16 style=padding-top:2px /></a></span>";e+='<span style=float:right;margin-top:1px;margin-left:4px;margin-right:4px title=Notify><a onclick=showUserAlertDialog(event,"'+encodeURIComponent(j._id)+"\")><img src='images/icon-notify.png' height=16 width=16 style=padding-top:2px /></a></span>"}if(h==1){d+="1 active session"}else{d+=h+" active sessions"}}else{if(j.login){d+='<span title="Last login: '+new Date(j.login*1000).toLocaleString()+'">'+new Date(j.login*1000).toLocaleDateString()+"</span>"}}if(d!=""){d+=", "}if(g){d+='<a onclick=showUserAdminDialog(event,"'+encodeURIComponent(j._id)+'")>'}if((j.siteadmin!=null)&&((j.siteadmin&32)!=0)&&(j.siteadmin!=4294967295)){d+="Locked, "}d+="<span title='Server Permissions'>";if((j.siteadmin==null)||(j.siteadmin==0)||(j.siteadmin==32)){d+="User"}else{if(j.siteadmin==8){d+="User with server files"}else{if(j.siteadmin==4294967295){d+="Administrator"}else{d+="Partial"}}}d+="</span>";if((j.quota!=null)&&((j.siteadmin&8)!=0)){d+=", "+(j.quota/1024)+" k"}if(g){d+="</a>"}var k=EscapeHtml(j.name),a="";if(serverinfo.emailcheck==true){a=((j.emailVerified!=true)?' <b style=color:red title="Email is not verified">🗴</b>':' <b style=color:green title="Email is verified">🗸</b>')}if(j.email!=null){k+=', <a onclick=doemail(event,"'+j.email+'")>'+j.email+"</a>"+a}if((j.otpsecret>0)||(j.otphkeys>0)){k+=' <img src="images/key12.png" height=12 width=11 title="2nd factor authentication enabled" style="margin-top:2px" />'}if((j.siteadmin!=null)&&((j.siteadmin&32)!=0)&&(j.siteadmin!=4294967295)){k+=' <img src="images/padlock12.png" height=12 width=8 title="Account is locked" style="margin-top:2px" />'}l+='<tr onmouseover=userMouseHover(this,1) onmouseout=userMouseHover(this,0)><td style=cursor:pointer onclick=gotoUser("'+encodeURIComponent(j._id)+'")>';l+="<div class=bar style=height:24px;width:100%;font-size:medium>";l+='<div style=float:left;height:24px;width:24px;background-color:white><div class="'+c+b+'" style=width:16px;margin-top:4px;margin-left:2px;height:16px></div></div>';l+="<div class=g1 style=height:24px;float:left></div><div class=g2 style=height:24px;float:right></div>";l+="<div><span>"+k+"</span>"+e+"<span style=float:right>"+d+"</span></div></div>";return l}function userMouseHover(b,c){var a=b.children[0].children[0];a.children[1].classList.remove("g1s");a.children[2].classList.remove("g2s");if(c==1){a.children[1].classList.add("g1s");a.children[2].classList.add("g2s")}b.children[0].children[0].style["background-color"]=((c==0)?"#c9c9c9":"#b9b9b9")}function userChat(a,d,b){haltEvent(a);var c="/messenger?id=meshmessenger/"+d+"/"+encodeURIComponent(userinfo._id)+"&title="+b;if((authCookie!=null)&&(authCookie!="")){c+="&auth="+authCookie}window.open(c,"meshmessenger:"+d);meshserver.send({action:"meshmessenger",userid:decodeURIComponent(d)});return false}function showUserAlertDialog(a,b){if(xxdialogMode){return}haltEvent(a);setDialogMode(2,"Notify "+EscapeHtml(users[decodeURIComponent(b)].name),3,showUserAlertDialogEx,'Send a text notification to this user.<textarea id=d2notifyText maxlength=2048 style="width:100%;height:184px;resize:none"></textarea>',b);Q("d2notifyText").focus();return false}function showUserAlertDialogEx(a,b){meshserver.send({action:"notifyuser",userid:decodeURIComponent(b),msg:Q("d2notifyText").value})}function doemail(b,a){if(xxdialogMode){return}haltEvent(b);window.open("mailto:"+a);return false}function showUserBroadcastDialog(){if(xxdialogMode){return}var a='Broadcast a message to all connected users.<textarea id=broadcastMessage value="" style=width:370px;height:100px;resize:none maxlength=256 /></textarea>';setDialogMode(2,"Broadcast Message",3,showUserBroadcastDialogEx,a);Q("broadcastMessage").focus()}function showUserBroadcastDialogEx(){meshserver.send({action:"userbroadcast",msg:Q("broadcastMessage").value})}function showCreateNewAccountDialog(){if(xxdialogMode){return}var c="";c+=addHtmlValue("Name","<input id=p4name style=width:230px maxlength=64 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Email","<input id=p4email style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Password","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Password","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");if(passRequirements){var b=[];for(var a in passRequirements){b.push(a+":"+passRequirements[a])}c+="<div style=font-size:x-small;padding:6px>Requirements: "+b.join(", ")+".</div>"}setDialogMode(2,"Create Account",3,showCreateNewAccountDialogEx,c);showCreateNewAccountDialogValidate();Q("p4name").focus()}function showCreateNewAccountDialogValidate(b){if((b==null)&&(Q("p4email").value.length>0)&&(validateEmail(Q("p4email").value))==false){QE("idx_dlgOkButton",false);return}var a=(!Q("p4name")||((Q("p4name").value.length>0)&&(Q("p4name").value.indexOf(" ")==-1)))&&Q("p4pass1").value.length>0&&Q("p4pass1").value==Q("p4pass2").value&&checkPasswordRequirements(Q("p4pass1").value,passRequirements);if(a&&passRequirements){if(checkPasswordRequirements(Q("p4pass1").value,passRequirements)==false){a=false}}QE("idx_dlgOkButton",a)}function showCreateNewAccountDialogEx(){meshserver.send({action:"adduser",username:Q("p4name").value,email:Q("p4email").value,pass:Q("p4pass1").value})}function showUserAdminDialog(a,c){if(xxdialogMode){return}haltEvent(a);c=decodeURIComponent(c);var d="<div>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>Server Files, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 style=width:80px;text-align:right id=ua_fileaccessquota>k max, blank for default<br><hr/>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>Full Administrator<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>Server Backup<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>Server Restore<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>Server Updates<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>Manage Users<br>";d+="<hr/><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_lockedaccount>Lock Account<br>";d+="</div>";var b=users[c.toLowerCase()];setDialogMode(2,"Server Permissions",3,showUserAdminDialogEx,d,b);if(b.siteadmin&&b.siteadmin!=0){Q("ua_fulladmin").checked=(b.siteadmin==4294967295);Q("ua_serverbackup").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&1)!=0));Q("ua_manageusers").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&2)!=0));Q("ua_serverrestore").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&4)!=0));Q("ua_fileaccess").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&8)!=0));Q("ua_serverupdate").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&16)!=0));Q("ua_lockedaccount").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&32)!=0))}QE("ua_fulladmin",userinfo.siteadmin==4294967295);QE("ua_serverbackup",userinfo.siteadmin==4294967295);QE("ua_manageusers",userinfo.siteadmin==4294967295);QE("ua_serverrestore",userinfo.siteadmin==4294967295);QE("ua_fileaccess",userinfo.siteadmin==4294967295);QE("ua_serverupdate",userinfo.siteadmin==4294967295);Q("ua_fileaccessquota").value=(b.quota!=null)?(b.quota/1024):"";showUserAdminDialogValidate();return false}function showUserAdminDialogValidate(){if(userinfo.siteadmin==4294967295){QE("ua_serverbackup",!Q("ua_fulladmin").checked);QE("ua_manageusers",!Q("ua_fulladmin").checked);QE("ua_serverrestore",!Q("ua_fulladmin").checked);QE("ua_fileaccess",!Q("ua_fulladmin").checked);QE("ua_serverupdate",!Q("ua_fulladmin").checked);QE("ua_fileaccessquota",Q("ua_fileaccess").checked&&!Q("ua_fulladmin").checked)}}function showUserAdminDialogEx(a,d){var c=0,b=parseInt(Q("ua_fileaccessquota").value);if(Q("ua_fulladmin").checked==true){c=4294967295}else{if(Q("ua_serverbackup").checked==true){c+=1}if(Q("ua_manageusers").checked==true){c+=2}if(Q("ua_serverrestore").checked==true){c+=4}if(Q("ua_fileaccess").checked==true){c+=8}if(Q("ua_serverupdate").checked==true){c+=16}if(Q("ua_lockedaccount").checked==true){c+=32}}var e={action:"edituser",name:d.name,siteadmin:c};if(isNaN(b)==false){e.quota=(b*1024)}meshserver.send(e)}function onUserSearchInputChanged(){updateUsers()}var currentUser=null;function gotoUser(n,g){if(xxdialogMode&&!g){return}var m=currentUser=users[decodeURIComponent(n)];if(m==null){setDialogMode(0);go(4);return}QH("p30userName",m.name);QH("p31userName",m.name);var l=(m.name==userinfo.name),a=0;if(wssessions!=null&&wssessions[m._id]){a=wssessions[m._id]}Q("MainUserImage").classList.remove("gray");if(a==0){Q("MainUserImage").classList.add("gray")}var h="",k="";if((m.siteadmin!=null)&&((m.siteadmin&32)!=0)&&(m.siteadmin!=4294967295)){k='<img src="images/padlock12.png" height=12 width=8 title="Account is locked" style="margin-top:2px" /> ';h+="Locked account, "}if((m.siteadmin==null)||(m.siteadmin==0)||(m.siteadmin==32)){h+="No server rights"}else{if(m.siteadmin==8){h+="Access to server files"}else{if(m.siteadmin==4294967295){h+="Full administrator"}else{h+="Partial rights"}}}var o="<div style=min-height:80px><table style=width:100%>";var c=m.email?EscapeHtml(m.email):"<i>Not set</i>",d="";if(serverinfo.emailcheck){d=((m.emailVerified==true)?'<b style=color:green;cursor:pointer title="Email is verified">🗸</b> ':'<b style=color:red;cursor:pointer title="Email not verified">🗴</b> ')}o+=addDeviceAttribute("Email",d+'<a style=cursor:pointer onclick=p30showUserEmailChangeDialog(event,"'+n+'")>'+c+'</a> <a style=cursor:pointer onclick=doemail(event,"'+m.email+'")><img class=hoverButton width=10 height=10 src="images/link1.png" /></a>');o+=addDeviceAttribute("Server Rights",k+'<a style=cursor:pointer onclick=showUserAdminDialog(event,"'+n+'")>'+h+"</a>");if(m.quota){o+=addDeviceAttribute("Server Quota",EscapeHtml(parseInt(m.quota)/1024)+" k")}o+=addDeviceAttribute("Creation",new Date(m.creation*1000).toLocaleString());if(m.login){o+=addDeviceAttribute("Last Login",new Date(m.login*1000).toLocaleString())}var j=0;if((m.otpsecret>0)||(m.otphkeys>0)){j=1;var e=[];if(m.otpsecret>0){e.push("Authentication App")}if(m.otphkeys>0){e.push("Security Key")}if(m.otpkeys>0){e.push("Backup Codes")}o+=addDeviceAttribute("Security",'<img src="images/key12.png" height=12 width=11 title="2nd factor authentication enabled" style="margin-top:2px" /> '+e.join(", "))}o+="</table></div><br />";o+='<input type=button value=Notes title="View notes about this user" onclick=showNotes(false,"'+n+'") />';if(!l&&(a>0)){o+='<input type=button value=Notify title="Send user notification" onclick=showUserAlertDialog(event,"'+n+'") />'}QH("p30html",o);drawUserTimeline();var b=true;if(m._id==userinfo._id){b=false}if(m.siteadmin&&m.siteadmin>0&&userinfo.siteadmin!=4294967295){b=false}o="<div style=float:right;font-size:x-small>";if(b){o+='<a style=cursor:pointer onclick=p30showDeleteUserDialog() title="Remove this user">Delete User</a>'}o+="</div><div style=font-size:x-small>";if(userinfo.siteadmin==4294967295){o+="<a style=cursor:pointer onclick=p30showUserChangePassDialog("+j+') title="Change the password for this user">Change Password</a>'}o+="</div><br>";QH("p30html3",o);o="";if(a==1){o="1 active session"}else{if(a>1){o=a+" active sessions"}}QH("MainUserState",o);go(30);QH("p31events","");refreshUsersEvents()}function p30showUserEmailChangeDialog(a){if(xxdialogMode){return}var b="";b+=addHtmlValue("Email","<input id=dp30email style=width:230px maxlength=32 onchange=p30validateEmail() onkeyup=p30validateEmail() />");if(serverinfo.emailcheck){b+=addHtmlValue("Status","<select id=dp30verified style=width:230px onchange=p30validateEmail()><option value=0>Not verified</option><option value=1>Verified</option></select>")}setDialogMode(2,"Change Email for "+EscapeHtml(currentUser.name),3,p30showUserEmailChangeDialogEx,b);Q("dp30email").focus();Q("dp30email").value=currentUser.email;if(serverinfo.emailcheck){Q("dp30verified").value=currentUser.emailVerified?1:0}p30validateEmail()}function p30validateEmail(){var a=Q("dp30email").value,b=a.split("@");b=(b.length==2)&&(b[0].length>0)&&(b[1].split(".").length>1)&&(b[1].length>2)&&(a.length<1024)&&((a!=userinfo.email)||((serverinfo.emailcheck==true)&&(Q("dp30verified").value!=(userinfo.emailVerified?1:0))));QE("idx_dlgOkButton",b)}function p30showUserEmailChangeDialogEx(){var a={action:"edituser",name:currentUser.name,email:Q("dp30email").value};if(serverinfo.emailcheck){a.emailVerified=(Q("dp30verified").value==1)}meshserver.send(a)}function p30showUserChangePassDialog(b){if(xxdialogMode){return}var d="";d+=addHtmlValue("Password","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=showCreateNewAccountDialogValidate(1)></input>");d+=addHtmlValue("Password","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=showCreateNewAccountDialogValidate(1)></input>");d+=addHtmlValue("Password hint","<input id=p4hint type=text style=width:230px maxlength=256></input>");if(passRequirements){var c=[];for(var a in passRequirements){c.push(a+":"+passRequirements[a])}d+="<div style=font-size:x-small;padding:6px>Requirements: "+c.join(", ")+".</div>"}if(b==1){d+="<div><input id=p4twoFactorRemove type=checkbox />Remove all 2nd factor authentication.</div>"}setDialogMode(2,"Change Password for "+EscapeHtml(currentUser.name),3,p30showUserChangePassDialogEx,d,b);showCreateNewAccountDialogValidate(1);Q("p4pass1").focus()}function p30showUserChangePassDialogEx(a,d){var c=false;if((d==1)&&(Q("p4twoFactorRemove").checked==true)){c=true}if(Q("p4pass1").value==Q("p4pass2").value){meshserver.send({action:"changeuserpass",user:currentUser.name,pass:Q("p4pass1").value,hint:Q("p4hint").value,removeMultiFactor:c})}}function p30showDeleteUserDialog(){if(xxdialogMode){return}setDialogMode(2,"Delete User "+EscapeHtml(currentUser.name),3,p30showDeleteUserDialogEx,"Confirm deletion of user "+EscapeHtml(currentUser.name)+"?")}function p30showDeleteUserDialogEx(){meshserver.send({action:"deleteuser",userid:currentUser._id,username:currentUser.name})}function drawUserTimeline(){var s=null,o=Date.now();s=[];var e=new Date();e.setHours(0,0,0,0);e=new Date(e.getTime()-(1000*60*60*24*6));var u=e.getTime();var t=[];if(s!=null&&s.length>1){t.push([0,s[1],s[0]]);var c=s[1];for(var m=2;m<s.length;m+=2){var p=s[m],k=o;if(s.length>(m+1)){k=s[m+1]}t.push([c,c+k,p]);c=c+k}}var z="",b=1,h=new Date();h.setHours(0,0,0,0);for(var m=0;m<7;m++){var g="",q=h.getTime(),l=q+(1000*60*60*24);for(var n in t){var a=t[n];if(isTimeBlockInside(q,l,a[0],a[1])==true){var w=Math.max(q,a[0]);var r=Math.min(Math.min(l,a[1]),o);var y=Math.round((r-w)/112794);if(y>0){var v=powerStateStrings2[a[2]]+" from "+new Date(w).toLocaleTimeString()+" to "+new Date(r).toLocaleTimeString()+".";g+='<div title="'+v+'" style=display:table-cell;width:'+y+"px;background-color:"+powerColor(a[2])+";height:16px></div>"}}}z+="<tr style="+(((b%2)==0)?"background-color:#DDD":"")+"><td><div> "+h.toLocaleDateString()+"<div></div></div></td><td><div>"+g+"</div></td></tr>";++b;h=new Date(h.getTime()-(1000*60*60*24))}QH("p30html2",'<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center>7 Day Login State</th></tr>'+z+"</tbody></table>")}var currentUserEvents=null;function userEventsUpdate(){var h="",a=null;for(var c in currentUserEvents){var b=currentUserEvents[c];var g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td class=DevSt>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");if(b.username&&b.username!=userinfo.name){e+=": "+b.username}h+="<tr><td><div class=bar18 style=height:18px;width:100%;font-size:medium>";h+="<div style=float:left;height:18px;width:18px;background-color:white><div class="+d+" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>";h+="<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>";h+="<div style=font-size:14px><span style=width:300px>"+g.toLocaleTimeString()+" - "+e+"</span></div></div></td></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p31events",h)}function refreshUsersEvents(){meshserver.send({action:"events",limit:parseInt(p31limitdropdown.value),user:currentUser.name})}function d3init(){Q("d3localFile").value="";d3modechange()}function d3modechange(){var a=Q("d3uploadMode").value;QV("d3localmode",a==1);QV("d3servermode",a==2);if(a==1){d3setActions()}else{d3updatefiles()}}var d3filetreelinkpath;var d3filetreelocation=[];function d3updatefiles(){if(Q("d3uploadMode").value==1){return}var m="",n="",e=filetree,j=1;var c=[],r=d3filetreelinkpath,b=[],a=document.getElementsByName("fc");for(var o=0;o<a.length;o++){if(a[o].checked){b.push(a[o].value)}}d3filetreelinkpath="";for(var o in d3filetreelocation){if((e.f!=null)&&(e.f[d3filetreelocation[o]]!=null)){c.push(d3filetreelocation[o]);if((j==1)){var t=d3filetreelocation[o].split("/");publicPath=window.location+t[0]+"files/"+t[2];if(d3filetreelocation[o]===userinfo._id){d3filetreelinkpath+="self"}else{d3filetreelinkpath+=(t[0]+"/"+t[2])}}else{if(d3filetreelinkpath!=""){d3filetreelinkpath+="/"+d3filetreelocation[o];if(j>2){publicPath+="/"+d3filetreelocation[o]}}}e=e.f[d3filetreelocation[o]];j++}else{break}}d3filetreelocation=c;var g=p5sort_files(e.f);for(var o in g){var d=g[o],q=d.n,s;s=q;if(q.length>70){s='<span title="'+EscapeHtml(q)+'">'+EscapeHtml(q.substring(0,70))+"...</span>"}else{s=EscapeHtml(q)}q=EscapeHtml(q);var k="";if(d.s!=null){k=getFileSizeStr(d.s)}var l="";if(d.t<3){var u="";l='<div class=filelist file=999><span style=float:right title="'+u+'"></span><span><div class=fileIcon'+d.t+' onclick=d3folderset("'+encodeURIComponent(d.nx)+'")></div> <a style=cursor:pointer onclick=d3folderset("'+encodeURIComponent(d.nx)+'")>'+s+"</a></span></div>"}else{var p=s;l="<div class=filelist file=3><input style=float:left name=fcx class=fcb type=checkbox onchange=d3setActions() value='"+d.nx+"'> <span style=float:right>"+k+"</span><span><div class=fileIcon"+d.t+"></div>"+p+"</span></div>"}if(d.t<3){m+=l}else{n+=l}}QH("d3serverfiles",m+n);QE("p3FolderUp",d3filetreelocation.length>0);d3setActions()}function d3folderset(a){d3filetreelocation.push(decodeURIComponent(a));d3updatefiles()}function d3folderup(a){if(a==null){d3filetreelocation.pop()}else{while(d3filetreelocation.length>a){d3filetreelocation.pop()}}d3updatefiles()}function d3getFileSel(){var a=[];var b=document.getElementsByName("fcx");for(var c=0;c<b.length;c++){if(b[c].checked){a.push(b[c].value)}}return a}function d3setActions(){var a=Q("d3uploadMode").value;if(a==1){QE("idx_dlgOkButton",Q("d3localFile").value.length>0)}else{QE("idx_dlgOkButton",d3getFileSel().length==1)}}var notifications=[];function clickNotificationIcon(a){if(a==true){QV("notifiyBox",true)}else{if(a==false){QV("notifiyBox",false)}else{QV("notifiyBox",QS("notifiyBox")["display"]=="none")}}drawNotifications()}function setNotificationCount(a){if(parseInt(Q("notificationCount").innerHTML)==a){return}QH("notificationCount",a);QS("notificationCount")["background-color"]=(a==0)?"lightblue":"orange";QV("notificationCount",a>0)}function drawNotifications(){var j="";if(notifications.length==0){j="<div style=margin:5px>There are currently no notifications</div>"}else{for(var c in notifications){var g=notifications[c];var k="";var a=new Date(g.time);var e=0;if(g.nodeid!=null){var h=getNodeFromId(g.nodeid);if(h!=null){e=h.icon;k="<b>"+h.name+"</b>: "}}j+='<div title="Occured at '+a.toLocaleString()+'" id="notifyx'+g.id+'" class=notification style="cursor:pointer;border-top:1px solid '+((j=="")?"transparent":"orange")+'"><div class=j'+e+' onclick="notificationSelected('+g.id+')" style=margin:5px;float:left></div><div onclick="notificationDelete('+g.id+')" class=unselectable title="Clear this notification" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected('+g.id+')" style=margin:5px>'+k+g.text+"</div></div>"}}var b="";if(notifications.length>1){b='<div id="notifyRemoveAll" onclick="deleteAllNotifications()" style="cursor:pointer;border-top:1px solid orange;margin:5px;color:orange;text-align:right;padding-right:3px">Clear all</div>'}QH("notifiyBox",'<div class=customScroll style="max-height:170px;overflow-y:auto;margin:5px">'+j+"</div>"+b)}function notificationSelected(b){var c=-1;for(var a in notifications){if(notifications[a].id==b){c=a}}if(c!=-1){var d=notifications[c];if(d.nodeid!=null){if(d.tag=="desktop"){gotoDevice(d.nodeid,12)}else{if(d.tag=="terminal"){gotoDevice(d.nodeid,11)}else{if(d.tag=="files"){gotoDevice(d.nodeid,13)}else{if(d.tag=="intelamt"){gotoDevice(d.nodeid,14)}else{if(d.tag=="console"){gotoDevice(d.nodeid,15)}else{gotoDevice(d.nodeid,10)}}}}}}else{if(d.tag.startsWith("meshmessenger/")){window.open("/messenger?id="+d.tag+"&title="+encodeURIComponent(d.username),d.tag.split("/")[2]);notificationDelete(b)}}}}function notificationDelete(c){var d=-1,a=Q("notifyx"+c);if(a!=null){for(var b in notifications){if(notifications[b].id==c){d=b}}if(d!=-1){notifications.splice(d,1);a.parentNode.removeChild(a);setNotificationCount(notifications.length);if(notifications.length==0){QV("notifiyBox",false)}if(notifications.length==1){QV("notifyRemoveAll",false)}if((notifications.length>0)&&(d==0)){var g=notifications[0];QS("notifyx"+g.id)["border-top"]="1px solid transparent"}}}}function addNotification(a){if(a.time==null){a.time=Date.now()}if(a.id==null){a.id=Math.random()}notifications.unshift(a);setNotificationCount(notifications.length);Q("chimes").play();clickNotificationIcon(true)}function deleteAllNotifications(){notifications=[];setNotificationCount(0);drawNotifications();QV("notifiyBox",false)}function setupServerStats(){window.serverStatCpu=new Chart(document.getElementById("serverCpuChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Used","Free"]},options:{responsive:true,legend:{position:"none",},animation:{animateScale:true,animateRotate:true},width:"60px"}});window.serverStatMemory=new Chart(document.getElementById("serverMemoryChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Used","Free"]},options:{responsive:true,legend:{position:"none",},animation:{animateScale:true,animateRotate:true},width:"60px"}})}var lastServerStats=null;function updateServerStats(d){if(d!=null){lastServerStats=d}else{d=lastServerStats}if(d==null){return}if(typeof d.cpuavg=="object"){var c=Math.min(d.cpuavg[0],1);window.serverStatCpu.config.data.datasets[0].data=[c,1-c];QH("serverCpuChartText",'<div style=margin-bottom:5px>CPU Load</div><div><b title="CPU load in the last minute">'+(Math.round(d.cpuavg[0]*100)/100)+'</b>, <b title="CPU load in the last 5 minutes">'+(Math.round(d.cpuavg[1]*100)/100)+'</b>, <b title="CPU load in the 15 minutes">'+(Math.round(d.cpuavg[2]*100)/100)+"</b></div>");QS("serverCpuChartView")["display"]="inline-block";window.serverStatCpu.update()}if((typeof d.totalmem=="number")&&(typeof d.freemem=="number")){window.serverStatMemory.config.data.datasets[0].data=[d.totalmem-d.freemem,d.freemem];QH("serverMemoryChartText","<div style=margin-bottom:5px>Memory</div><div><b>"+getNiceSize2(d.freemem)+"</b> free, <b>"+getNiceSize2(d.totalmem)+"</b> total</div>");QS("serverMemoryChartView")["display"]="inline-block";window.serverStatMemory.update()}var e="<div style=width:100% cellpadding=0 cellspacing=0>";if(typeof d.values=="object"){for(var a in d.values){e+="<div class=userTableHeader style=margin-bottom:4px;width:200px>"+a+"</div>";for(var b in d.values[a]){e+="<div style=display:inline-block><table style=width:300px;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0><tr><td class=h1></td><td><span>"+b+"</span><span style=float:right>"+d.values[a][b]+"</span></td><td class=h2></td></tr></table></div>"}}}e+="</div>";QH("serverStatsTable",e)}var xxdialogMode;var xxdialogFunc;var xxdialogButtons;var xxdialogTag;var xxcurrentView=-1;function setDialogMode(j,k,a,e,d,h){xxdialogMode=j;xxdialogFunc=e;xxdialogButtons=a;xxdialogTag=h;QE("idx_dlgOkButton",true);QV("idx_dlgOkButton",a&1);QV("idx_dlgCancelButton",a&2);QV("id_dialogclose",(a&2)||(a&8));QV("idx_dlgDeleteButton",a&4);QV("idx_dlgButtonBar",a&7);if(k){QH("id_dialogtitle",k)}for(var g=1;g<24;g++){QV("dialog"+g,g==j)}QV("dialog",j);if(d){if(j==2){QH("id_dialogOptions",d)}else{QH("id_dialogMessage",d)}}}function dialogclose(e){var c=xxdialogFunc,a=xxdialogButtons,d=xxdialogTag;setDialogMode();if(((a&8)||e)&&c){c(e,d)}}function center(){if(xxcurrentView==11){deskAdjust()}else{if(xxcurrentView==10){masterUpdate(256)}else{if(xxcurrentView==1){masterUpdate(4)}}}}function messagebox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b,1)}function statusbox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b)}function goBack(){if(xxdialogMode){return}if((xxcurrentView>=10)&&(xxcurrentView<20)){go(1)}if((xxcurrentView>=20)&&(xxcurrentView<30)){go(2)}if((xxcurrentView>=30)&&(xxcurrentView<40)){go(4)}}function go(d){if(xxdialogMode||xxcurrentView==d){return}for(var a=0;a<32;a++){QV("p"+a,a==d)}xxcurrentView=d;var b=["LeftMenuMyDevices","LeftMenuMyAccount","LeftMenuMyEvents","LeftMenuMyFiles","LeftMenuMyUsers","LeftMenuMyServer"];for(var a in b){Q(b[a]).classList.remove("lbbuttonsel");Q(b[a]).classList.remove("lbbuttonsel2")}QV("topbar",d!=0);if(d>=10&&d<20){QS("MainMenuMyDevices").backgroundColor="#606060"}else{QS("MainMenuMyDevices").backgroundColor=((d==1)?"#003366":"#808080")}if(d==1||(d>=10&&d<20)){Q("LeftMenuMyDevices").classList.add("lbbuttonsel")}if(d==1){Q("LeftMenuMyDevices").classList.add("lbbuttonsel2")}if(d>=20&&d<30){QS("MainMenuMyAccount").backgroundColor="#606060"}else{QS("MainMenuMyAccount").backgroundColor=((d==2)?"#003366":"#808080")}if(d==2||(d>=20&&d<30)){Q("LeftMenuMyAccount").classList.add("lbbuttonsel")}if(d==2){Q("LeftMenuMyAccount").classList.add("lbbuttonsel2")}QS("MainMenuMyEvents").backgroundColor=((d==3)?"#003366":"#808080");if(d==3){Q("LeftMenuMyEvents").classList.add("lbbuttonsel","lbbuttonsel2")}if(d>=30&&d<40){QS("MainMenuMyUsers").backgroundColor="#606060"}else{QS("MainMenuMyUsers").backgroundColor=((d==4)?"#003366":"#808080")}if(d==4||(d>=30&&d<40)){Q("LeftMenuMyUsers").classList.add("lbbuttonsel")}if(d==4){Q("LeftMenuMyUsers").classList.add("lbbuttonsel2")}QS("MainMenuMyFiles").backgroundColor=((d==5)?"#003366":"#808080");if(d==5){Q("LeftMenuMyFiles").classList.add("lbbuttonsel","lbbuttonsel2")}QS("MainMenuMyServer").backgroundColor=(((d==6)||(d==115))?"#003366":"#808080");if(((d==6)||(d==115))){Q("LeftMenuMyServer").classList.add("lbbuttonsel","lbbuttonsel2")}if(webPageFullScreen){QS("column_l")["max-height"]="calc(100vh - 135px)"}else{QS("column_l")["max-height"]=(d>=10)?"calc(100vh - 159px)":"calc(100vh - 135px)"}if((d==0)&&(webPageFullScreen)){QS("page_content").position="";QV("page_leftbar",false);QS("column_l").height="calc(100vh - 110px)";QS("column_l")["max-height"]=""}QV("MainSubMenuSpan",d>=10&&d<20);QV("UserDummyMenuSpan",(d<10)&&(d!=6)&&webPageFullScreen);QV("MeshSubMenuSpan",d>=20&&d<30);QV("UserSubMenuSpan",d>=30&&d<40);QV("ServerSubMenuSpan",d==6||d==115);var c={10:"MainDev",11:"MainDevDesktop",12:"MainDevTerminal",13:"MainDevFiles",14:"MainDevAmt",15:"MainDevConsole",20:"MeshGeneral",30:"UserGeneral",31:"UserEvents",6:"ServerGeneral",115:"ServerConsole"};for(var a in c){Q(c[a]).classList.remove("style3x");Q(c[a]).classList.remove("style3sel");Q(c[a]).classList.add((d==a)?"style3sel":"style3x")}if(d==115){QV("p15",true)}QV("p15uploadCore",d!=115);QV("p15BackButton",d!=115);if((d==15)||(d==115)){setupConsole()}if(d==1){masterUpdate(4)}if((currentNode)&&(d>=10)&&(d<20)){document.title="MeshCentral - "+currentNode.name}else{document.title="MeshCentral"}}function joinPaths(){var c=[];for(var a in arguments){var b=arguments[a];if((b!=null)&&(b!="")){while(b.endsWith("/")||b.endsWith("\\")){b=b.substring(0,b.length-1)}while(b.startsWith("/")||b.startsWith("\\")){b=b.substring(1)}c.push(b)}}return c.join("/")}function putstore(b,c){try{if(typeof(localStorage)==="undefined"){return}localStorage.setItem(b,c)}catch(a){}}function getstore(b,d){try{if(typeof(localStorage)==="undefined"){return d}var c=localStorage.getItem(b);if((c==null)||(c==null)){return d}return c}catch(a){return d}}function addLink(b,a){return"<span style=cursor:pointer;text-decoration:none onclick='"+a+"'>"+b+" <img class=hoverButton width=10 height=10 src=images/link5.png></span>"}function addLinkConditional(d,b,a){if(a){return addLink(d,b)}return d}function haltEvent(a){if(a.preventDefault){a.preventDefault()}if(a.stopPropagation){a.stopPropagation()}return false}function addOption(c,d,a){var b=document.createElement("option");b.text=d;b.value=a;Q(c).add(b)}function passwordcheck(a){return(a.length>7)&&(/\d/.test(a))&&(/[a-z]/.test(a))&&(/[A-Z]/.test(a))&&(/\W/.test(a))}function methodcheck(a){if(a&&a!=null&&a.Body&&a.Body.ReturnValueStr!="SUCCESS"){messagebox("Call Error",a.Header.Method+": "+a.Body.ReturnValueStr.replace("_"," "));return true}return false}function TableStart(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=200px><p><td>"}function TableStart2(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><p><td>"}function TableEntry(a,b){return"<tr><td><p>"+a+"<td>"+b}function FullTable(c,a){var b=TableStart();for(i in c){if(i&&c[i]){b+=TableEntry(i,c[i])}}return b+TableEnd(a)}function TableEnd(a){return"<tr><td colspan=2><p>"+(a?a:"")+"</table>"}function AddButton(b,a){return"<input type=button value='"+b+"' onclick='"+a+"' style=margin:4px>"}function AddButton2(b,a){return"<input type=button value='"+b+"' onclick='"+a+"'>"}function AddRefreshButton(a){return"<input type=button name=refreshbtn value=Refresh onclick='refreshButtons(false);"+a+"' style=margin:4px "+(refreshButtonsState==false?"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>'}function MoreEnd(){return'<a style=cursor:pointer;color:blue onclick=QV("morexxx2",false);QV("morexxx1",true)>▲ Less</a></div>'}function getSelectedOptions(e){var d=[],c;for(var a=0,b=e.options.length;a<b;a++){c=e.options[a];if(c.selected){d.push(c.value)}}return d}function getInstance(b,c){for(var a in b){if(b[a]["InstanceID"]==c){return b[a]}}return null}function getItem(b,c,d){for(var a in b){if(b[a][c]==d){return b[a]}}return null}function guidToStr(a){return a.substring(6,8)+a.substring(4,6)+a.substring(2,4)+a.substring(0,2)+"-"+a.substring(10,12)+a.substring(8,10)+"-"+a.substring(14,16)+a.substring(12,14)+"-"+a.substring(16,20)+"-"+a.substring(20)}function getUrlVars(){var d,a,e=[],b=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var c=0;c<b.length;c++){d=b[c].indexOf("=");if(d>0){e[b[c].substring(0,d)]=b[c].substring(d+1,b[c].length)}}return e}function addHtmlValue(a,b){return"<table><td style=width:120px>"+a+"<td><b>"+b+"</b></table>"}function addHtmlValue2(a,b){return"<div><div style=display:inline-block;float:right>"+b+"</div><div style=display:inline-block>"+a+"</div></div>"}function parseUriArgs(){var a,c={},b=window.document.location.href.split(/[\?&|\=]/);b.splice(0,1);for(d in b){switch(d%2){case 0:a=decodeURIComponent(b[d]);break;case 1:c[a]=decodeURIComponent(b[d]);var d=parseInt(c[a]);if(d==c[a]){c[a]=d}break;default:break}}return c}function focusTextBox(a){setTimeout(function(){Q(a).selectionStart=Q(a).selectionEnd=65535;Q(a).focus()},0)}function validateEmail(b){var a=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return a.test(b)}function isPrivateIP(b){return(b.startsWith("10.")||b.startsWith("172.16.")||b.startsWith("192.168."))}function u2fSupported(){return(window.u2f&&((navigator.userAgent.indexOf("Chrome/")>0)||(navigator.userAgent.indexOf("Firefox/")>0)||(navigator.userAgent.indexOf("Opera/")>0)||(navigator.userAgent.indexOf("Safari/")>0)))};</script></body></html>
\ No newline at end of file
1
+<!DOCTYPE html> <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="text/html;charset=utf-8" http-equiv="Content-Type"> <meta name="viewport" content="user-scalable=1.0,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="format-detection" content="telephone=no"> <style>body{margin:0;padding:0;border:0;color:black;font-size:13px;font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;background-color:#d3d9d6;}#container{background-color:#fff;width:960px;min-width:960px;margin:0 auto;border-top:0;border-right:1px solid #b7b7b7;border-bottom:0;border-left:1px solid #b7b7b7;padding:0;}#masthead{width:auto;margin:0;padding:0;overflow:auto;text-align:right;background-color:#036;width:960px;}#column_l{position:relative;float:left;width:930px;margin:0;padding:0 15px;background-color:#fff;}#footer{clear:both;overflow:auto;width:100%;text-align:center;background-color:#113962;padding-top:5px;padding-bottom:5px;}#masthead img{float:left;}#masthead p{font-size:11px;color:#fff;margin:10px 10px 0;}#footer a{color:#fff;text-decoration:underline;}#footer a:hover{color:#fff;text-decoration:none;}a{color:#036;text-decoration:underline;}.i1{background:url(../images/icons50.png) 0px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i2{background:url(../images/icons50.png) -50px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i3{background:url(../images/icons50.png) -100px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i4{background:url(../images/icons50.png) -150px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i5{background:url(../images/icons50.png) -200px 0px;height:50px;width:50px;cursor:pointer;border:none;}.i6{background:url(../images/icons50.png) -250px 0px;height:50px;width:50px;cursor:pointer;border:none;}.j1{background:url(../images/icons16.png) 0px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j2{background:url(../images/icons16.png) -16px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j3{background:url(../images/icons16.png) -32px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j4{background:url(../images/icons16.png) -48px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j5{background:url(../images/icons16.png) -64px 0px;height:16px;width:16px;cursor:pointer;border:none;}.j6{background:url(../images/icons16.png) -80px 0px;height:16px;width:16px;cursor:pointer;border:none;}.lbbutton{width:74px;height:74px;border-radius:5px;background-color:white;margin-left:8px;margin-top:8px;position:relative;cursor:pointer;opacity:0.5;}.lbbutton:hover{opacity:1;}.lbbuttonsel{opacity:0.9;}.lbbuttonsel2{width:82px;border-radius:5px 0px 0px 5px;opacity:1;}.lb1{background:url(../images/leftbar-62.jpg) -0px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb2{background:url(../images/leftbar-62.jpg) -75px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb3{background:url(../images/leftbar-62.jpg) -150px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb4{background:url(../images/leftbar-62.jpg) -225px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb5{background:url(../images/leftbar-62.jpg) -294px 0px;height:62px;width:62px;cursor:pointer;border:none;}.lb6{background:url(../images/leftbar-62.jpg) -360px 0px;height:62px;width:62px;cursor:pointer;border:none;}.m0{background :url(../images/images16.png) -32px 0px;height :16px;width :16px;border:none;float:left }.m1{background :url(../images/images16.png) -16px 0px;height :16px;width :16px;border:none;float:left }.m2{background :url(../images/images16.png) -96px 0px;height :16px;width :16px;border:none;float:left }.m3{background :url(../images/images16.png) -112px 0px;height :16px;width :16px;border:none;float:left }.si0{background :url(../images/icons16.png) 0px 0px;height :16px;width :16px;border:none;float:left }.si1{background :url(../images/icons16.png) -16px 0px;height :16px;width :16px;border:none;float:left }.si2{background :url(../images/icons16.png) -32px 0px;height :16px;width :16px;border:none;float:left }.si3{background :url(../images/icons16.png) -48px 0px;height :16px;width :16px;border:none;float:left }.si4{background :url(../images/icons16.png) -64px 0px;height :16px;width :16px;border:none;float:left }.mi{background :url(../images/meshicon50.png) 0px 0px;height:50px;width:50px;cursor:pointer;border:none }#floatframe{position:fixed;top:200px;height:300px;z-index:200;display:none;}.style1{text-align:center;}.style2{text-align:center;background-color:#808080;font-weight:bold;}.style3{text-align:center;color:white;background-color:#808080;font-weight:bold;}.style3x{text-align:center;color:white;background-color:#808080;font-weight:bold;}.style3x:hover{background-color:#606060;}.style3sel{text-align:center;color:white;background-color:#003366;font-weight:bold;}.style4{color:white;text-decoration:none;}.style5{text-align:center;background-color:#808080;font-weight:normal;}.style6{text-align:center;background-color:#D3D9D6;}.style7{font-size:large;background-color:#FFFFFF;}.style10{background-color:#C9C9C9;}.style11{font-size:large;background-color:#C9C9C9;}.style14{text-align:left;background-color:#D3D9D6;}.auto-style1{text-align:right;background-color:#D3D9D6;}.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;}.fileIcon4{background:url(../images/meshicon16.png);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;}.noselect{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.fsize{float:right;text-align:right;width:180px;}.g1{background-position:0% 0%;width:14px;height:100%;float:left; background-image:linear-gradient(to right, #ffffff 0%, #c9c9c9 100%);background-color:#c9c9c9;background-repeat:repeat;background-attachment:scroll;}.g1s{background-image:linear-gradient(to right, #ffffff 0%, #b9b9b9 100%);}.g2{background-position:0% 0%;width:14px;height:100%;float:right; background-image:linear-gradient(to right, #c9c9c9 0%, #ffffff 100%);background-color:#c9c9c9;background-repeat:repeat;background-attachment:scroll;}.g2s{background-image:linear-gradient(to right, #b9b9b9 0%, #ffffff 100%);}.h1{background-position:0% 0%;width:14px;height:100%; background-image:linear-gradient(to right, #ffffff 0%, #d3d9d6 100%);background-color:#d3d9d6;background-repeat:repeat;background-attachment:scroll;}.h2{background-position:0% 0%;width:14px;height:100%; background-image:linear-gradient(to right, #d3d9d6 0%, #ffffff 100%);background-color:#d3d9d6;background-repeat:repeat;background-attachment:scroll;}.e1{font-size:large;margin-top:4px;margin-bottom:3px;overflow:hidden;word-wrap:hyphenate;white-space:nowrap;text-overflow:ellipsis;}.e2{float:left;height:100%;background-color:#c9c9c9;}.e2s{background-color:#b9b9b9;}.bar{font-size:large;background-color:#C9C9C9;height:24px;float:left;margin-bottom:2px;}.bar2{font-size:large;height:24px;float:left;margin-bottom:2px;}.bar18{font-size:large;background-color:#C9C9C9;height:18px;float:left;margin-bottom:2px;}.bar182{font-size:large;height:18px;float:left;margin-bottom:2px;}.devHeaderx{color:lightgray;}.DevSt{border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:#DDDDDD;}.contextMenu{background:#F9F9F9;box-shadow:0 0 12px rgba( 0, 0, 0, .3 );border:1px solid #ccc; display:none;position:absolute;top:0;left:0;list-style:none;margin:0;padding:5px;min-width:100px;max-width:150px;z-index:500;}.cmtext{color:#444;display:inline-block;padding-left:8px;padding-right:8px;padding-top:5px;padding-bottom:5px;text-decoration:none;width:85%;cursor:default;overflow:hidden;position:relative;}.cmtext:hover{color:#f9f9f9;background:#444;}.gray{ filter:gray; -webkit-filter:grayscale(100%) opacity(60%); }.unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.notifiyBox{position:absolute;z-index:1000;top:50px;right:26px;width:300px;text-align:left;background-color:#F0ECCD;border:4px solid #666;-webkit-border-radius:10px;-moz-border-radius:10px;border-radius:10px;-webkit-box-shadow:2px 2px 4px #888;-moz-box-shadow:2px 2px 4px #888;box-shadow:2px 2px 4px #888;max-height:200px;}.notifiyBox:before{content:' ';position:absolute;width:0;height:0;right:5px;top:-30px;border:15px solid;border-color:transparent #666 #666 transparent;}.notifiyBox:after{content:' ';position:absolute;width:0;height:0;right:7px;top:-24px;border:12px solid;border-color:transparent #F0ECCD #F0ECCD transparent;}.notification{width:100%;min-height:30px;}.notification:hover{background-color:#EFE8B6;}.deskToolsBar{padding:3px;}.deskToolsBar:hover{background-color:#EFE8B6;}.userTableHeader{border-bottom:1pt solid lightgray;padding-top:4px;padding-bottom:4px;}.viewSelector{width:32px;height:32px;background-color:#DDD;border-radius:3px;float:left;margin-left:5px;cursor:pointer;opacity:0.3;}.viewSelectorSel{background-color:#BBB;opacity:0.8;}.viewSelector:hover{opacity:0.5;background-color:#AAA;}.viewSelector1{margin-left:2px;margin-top:2px;background:url(../images/views.png) -0px 0px;height:28px;width:28px;}.viewSelector2{margin-left:2px;margin-top:2px;background:url(../images/views.png) -28px 0px;height:28px;width:28px;}.viewSelector3{margin-left:2px;margin-top:2px;background:url(../images/views.png) -56px 0px;height:28px;width:28px;}.viewSelector4{margin-left:2px;margin-top:2px;background:url(../images/views.png) -84px 0px;height:28px;width:28px;}.viewSelector5{margin-left:2px;margin-top:2px;background:url(../images/views.png) -112px 0px;height:28px;width:28px;}.backButtonEx{margin-left:2px;margin-top:2px;background:url(../images/views.png) -140px 0px;height:28px;width:28px;}.backButton{width:32px;height:32px;background-color:#DDD;border-radius:3px;float:left;margin-right:5px;cursor:pointer;opacity:0.3;}.backButton:hover{opacity:0.5;background-color:#AAA;}.hoverButton{opacity:0.5;}.hoverButton:hover{opacity:1;}</style> <style>.ol-box{box-sizing:border-box;border-radius:2px;border:2px solid #00f;}.ol-mouse-position{top:8px;right:8px;position:absolute;}.ol-scale-line{background:rgba(0,60,136,.3);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute;}.ol-scale-line-inner{border:1px solid #eee;border-top:none;color:#eee;font-size:10px;text-align:center;margin:1px;will-change:contents,width;}.ol-overlay-container{will-change:left,right,top,bottom;}.ol-unsupported{display:none;}.ol-unselectable, .ol-viewport{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto;}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing;}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;}.ol-control{position:absolute;background-color:rgba(255,255,255,.4);border-radius:4px;padding:2px;}.ol-control:hover{background-color:rgba(255,255,255,.6);}.ol-zoom{top:.5em;right:.5em;}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear;}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s;}.ol-zoom-extent{top:4.643em;left:.5em;}.ol-full-screen{right:.5em;top:.5em;}@media print{.ol-control{display:none;}}.ol-control button{display:block;margin:1px;padding:0;color:#fff;font-size:1.14em;font-weight:700;text-decoration:none;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:rgba(0,60,136,.5);border:none;border-radius:2px;}.ol-control button::-moz-focus-inner{border:none;padding:0;}.ol-zoom-extent button{line-height:1.4em;}.ol-compass{display:block;font-weight:400;font-size:1.2em;will-change:transform;}.ol-touch .ol-control button{font-size:1.5em;}.ol-touch .ol-zoom-extent{top:5.5em;}.ol-control button:focus, .ol-control button:hover{text-decoration:none;background-color:rgba(0,60,136,.7);}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0;}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px;}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);}.ol-attribution ul{margin:0;padding:0 .5em;font-size:.7rem;line-height:1.375em;color:#000;text-shadow:0 0 2px #fff;}.ol-attribution li{display:inline;list-style:none;line-height:inherit;}.ol-attribution li:not(:last-child):after{content:" ";}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle;}.ol-attribution button, .ol-attribution ul{display:inline-block;}.ol-attribution.ol-collapsed ul{display:none;}.ol-attribution.ol-logo-only ul{display:block;}.ol-attribution:not(.ol-collapsed){background:rgba(255,255,255,.8);}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0;height:1.1em;line-height:1em;}.ol-attribution.ol-logo-only{background:0 0;bottom:.4em;height:1.1em;line-height:1em;}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em;}.ol-attribution.ol-logo-only button, .ol-attribution.ol-uncollapsible button{display:none;}.ol-zoomslider{top:4.5em;left:.5em;height:200px;}.ol-zoomslider button{position:relative;height:10px;}.ol-touch .ol-zoomslider{top:5.5em;}.ol-overviewmap{left:.5em;bottom:.5em;}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0;}.ol-overviewmap .ol-overviewmap-map, .ol-overviewmap button{display:inline-block;}.ol-overviewmap .ol-overviewmap-map{border:1px solid #7b98bc;height:150px;margin:2px;width:150px;}.ol-overviewmap:not(.ol-collapsed) button{bottom:1px;left:2px;position:absolute;}.ol-overviewmap.ol-collapsed .ol-overviewmap-map, .ol-overviewmap.ol-uncollapsible button{display:none;}.ol-overviewmap:not(.ol-collapsed){background:rgba(255,255,255,.8);}.ol-overviewmap-box{border:2px dotted rgba(0,60,136,.7);}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move;}</style> <style> .ol-ctx-menu-container{position:absolute;padding:8px;background:#fff;color:#222;font-size:13px;border-radius:5px;box-shadow:3px 3px 5px rgba(0,0,0,.2);box-sizing:border-box}.ol-ctx-menu-container a,.ol-ctx-menu-container div,.ol-ctx-menu-container img,.ol-ctx-menu-container li,.ol-ctx-menu-container span,.ol-ctx-menu-container ul{margin:0;padding:0;border:0;font:inherit;font-size:100%;vertical-align:baseline}.ol-ctx-menu-container a img{border:none}.ol-ctx-menu-container *,.ol-ctx-menu-container :after,.ol-ctx-menu-container :before{box-sizing:inherit}.ol-ctx-menu-container.ol-ctx-menu-hidden{opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .3s,opacity .3s;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container ul{list-style:none}.ol-ctx-menu-container li{position:relative;line-height:20px;padding:2px 5px}.ol-ctx-menu-container li:not(.ol-ctx-menu-separator):hover{cursor:pointer;background-color:#333;color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-submenu .ol-ctx-menu-container{border:1px solid #eee;padding:8px;top:0;opacity:0;visibility:hidden;-webkit-transition:visibility 0s linear .3s,opacity .3s;transition:visibility 0s linear .3s,opacity .3s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover .ol-ctx-menu-container{opacity:1;visibility:visible;-webkit-transition-delay:0s;transition-delay:0s}.ol-ctx-menu-container li.ol-ctx-menu-submenu:after{position:absolute;top:7px;right:10px;content:"";display:inline-block;width:.6em;height:.6em;border-right:.3em solid #222;border-top:.3em solid #222;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.ol-ctx-menu-container li.ol-ctx-menu-submenu:hover:after{border-color:#eee}.ol-ctx-menu-container li.ol-ctx-menu-separator{padding:0}.ol-ctx-menu-container li.ol-ctx-menu-separator hr{border:0;height:1px;background-image:-webkit-linear-gradient(right,transparent,rgba(0,0,0,.75),transparent);background-image:linear-gradient(270deg,transparent,rgba(0,0,0,.75),transparent)}.ol-ctx-menu-icon{text-indent:20px;background-size:20px auto;background-repeat:no-repeat;background-position:0}.ol-ctx-menu-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABaUlEQVQ4T72U7VHCQBCGn90GtAMuNGCswFiBWIFQgWMFxg6wArECsQKhArEBiB1Qwa1zgQn5IAYcxv13k71n3919L8KJQ07M47+BzgG9TRfZ/JBuWhS6BJFHRJICYrZGZIz3z5Ct2+B7gG6I6kt+wewdkQVwjtkAkR5mC8yu26A1oItR/cTsOweQBdgutD8G7jGm2PJ2n8oqUKIpIjd4HxTM8gvaT/F+AlmWnyWaIXKF95eNguFzTYFhNsdWu9kFgFlaFMANUH3D8wDLoLgSTSD2il8NCe2ZXQBxWDGwxmyUzzOMBZ7wy7Qb2K0wQfXjMOBuhlFpZtNty5sFaTQBuTusZdymeqs1SpYKcO9HkE3KbTd9WFijMHJQ5hBNEAYNq5Qd0dhyke0GiE4QzjqfW23mHT8Hl4DG4Lce3FPE7AtbBSdsbNqpoJLgYkRnNeUV+xwJDHTnUEkxHGbhBXUs5TjJjew/KPy94g+NRaIVRYmMXwAAAABJRU5ErkJggg==")}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-in{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABc0lEQVQ4T71U21ECQRDsJgGdvQDECMQIxAjECMQILCPwzAAjECIQI0AiEDPQAPaWCBhrcKHuCUcV5f7dY3v6tUscefHIePhfwBBCF8CZqRCReRs1tQxDCH1VfQLQz4EsSY4AvIjIsgm8AhhCGKrqa9zwrqoLAKckB5HtguR1E2gBMITQU9VPAD8GICIGtl3e+xHJBwBT59xtHcsCYJZlUwA3kcGHbfDep51OZywi3/acZZm9vyJ5WR5o38uACmDunNt6ZwAkUxFZDwghDFT1jeSjiJinhVUBVNVJkiTDKO8CQA+AsbNQ7s1Ps0VVn5MkSfcCtmBoDZi1Bdx4eJ7zbBolrwPy3o9J3rWSHPs3A1BbjVKlYBaIyDgvu9LDXDU2RTZmXVW1oKyLxRD+OrkOrJLy5mVM0iaftDhuhVbsvBzMglzKUNW6IV/OOWtCM8MmVvEkmbwt83LaB19fdgOtVquUZJeknaDdobTwbOcvBzPcN/AXH1DFFWP7u9oAAAAASUVORK5CYII=")}.ol-ctx-menu-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABU0lEQVQ4T72U7VECMRRFz3sNaAdkacC1AtcKxApcKnCsQOwAK3CtQKxAqEBsANYOqCDPyTIC+8WCw5jfybn33dxEOPGSE/P4b6BzQG89RT47ZJoWhy5B5BGRZAMxWyEyxvtnyFdt8AagS1F9KQ6YvSMyB84xGyDSw2yO2XUbtAJ0MaqfmH0XAPIA2y7tj4F7jAm2uG1yWQZKNEHkBu+Dg2njWBJNEbnC+8uaIFRuWfuG2QxbbrOrUd0A1Tc8D7AIjkur7DAAsVf8MiWMZ3ZR2m02LPIMscATfjHqBnY7TFD9OAy4zTCCPG/MUKMM5O6wkXFr9dZq7FQqqHk/hDzbFa73cFONTZFDdRyiCcKg5rrSiLaXkiI6RjjrfG6VzDs+B5eAxuDXeYpmNRGzL2wZ/wof+du4GNFpBVqqz5HA4MM5VEYYDrOs+1I6Q9u/4Q8O9wN/AGgWjBVqQjjgAAAAAElFTkSuQmCC")}.ol-ctx-menu-container li:hover.ol-ctx-menu-zoom-out{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABYklEQVQ4T72U4VHCQBCF36tA91KAWIFYgViBWIFYgWMFYgdYgVCBWAFSgdiBFpAsFWSdxcDkQoBkhnF/ZjbfvX377ogjF4/Mw/8CVbUD4MynEJF5k2lqFapqz8yeAPRKkCXJEYAXEVnugm8BVXVgZq/FD+9mtgBwSrJfqF2QvN4FjYCq2jWzTwA/DhARh20qTdMRyQcA0xDCbZ3KCJhl2RTATaHgo+6HLMv8+xXJy+qB3l8FGoB5CKHsXcRV1b6ZvZF8FBH3NKotoJlNkiQZFONdlLtJ3rufbouZPSdJMjwIbKDQEzBrClx7eC4i33Uepmk6JnnXaOQifzMAtdGoRApugYiMI1uqKkrRWAfZo9MxM1+UZzFewl8mN4nYdVM83L7BkwbXLUrF3sfBLQDQBbDy08x8vOohXyEE71lVq9emuEk+3gZa3XYroCvwFyjP8yHJDsnxwaU08GxvS2uFhw78BbzWrxXgMbsHAAAAAElFTkSuQmCC")}</style> <script type="text/javascript" src="scripts/charts.js"></script> <script type="text/javascript" src="scripts/filesaver.1.1.20151003.js"></script> <script type="text/javascript" src="scripts/ol.js"></script> <script type="text/javascript" src="scripts/ol3-contextmenu.js"></script> <title>MeshCentral</title> </head> <body id="body" onload="if (typeof(startup) !== 'undefined') startup();" oncontextmenu="handleContextMenu(event)" style="display:none"> <div id="contextMenu" class="contextMenu noselect" style="display:none"> <div id="cxinfo" class="cmtext" onclick="cmaction(1,event)"><b>Information</b></div> <div id="cxdesktop" class="cmtext" onclick="cmaction(3,event)">Desktop</div> <div id="cxterminal" class="cmtext" onclick="cmaction(2,event)">Terminal</div> <div id="cxfiles" class="cmtext" onclick="cmaction(4,event)">Files</div> <div id="cxevents" class="cmtext" onclick="cmaction(5,event)">Events</div> <div id="cxconsole" class="cmtext" onclick="cmaction(6,event)">Console</div> <hr id="cxmgroupsplit"> <div id="cxmdesktop" class="cmtext" onclick="cmaction(7,event)" style="display:none">Multi-Desktop</div> </div> <div id="meshContextMenu" class="contextMenu,noselect" style="display:none;min-width:0px"> <div id="cxselectall" class="cmtext" onclick="cmmeshaction(1,event)">Select All</div> <div id="cxselectnone" class="cmtext" onclick="cmmeshaction(2,event)">Select None</div> <hr id="cxmgroupsplit2" style="display:none"> <div id="cxmmdesktop" class="cmtext" style="display:none" onclick="cmmeshaction(3,event)">Multi-Desktop</div> </div> <div id="container" style="max-height:100vh;position:relative"> <div id="notifiyBox" class="notifiyBox" style="display:none"></div> <div id="mastheadx"></div> <div id="masthead" class="noselect" style="background:url(logo.png) 0px 0px;background-color:#036;background-repeat:no-repeat;height:66px;width:100%;overflow:hidden"> <div style="float:left;height:66px;color:#c8c8c8;padding-left:20px;padding-top:8px"> <strong><font style="font-size:46px;font-family:Arial,Helvetica,sans-serif">{{{title}}}</font></strong> </div> <div style="float:left;height:66px;color:#c8c8c8;padding-left:5px;padding-top:14px"> <strong><font style="font-size:14px;font-family:Arial,Helvetica,sans-serif">{{{title2}}}</font></strong> </div> <div style="float:right"> <div id="notificationCount" onclick="clickNotificationIcon()" class="unselectable" style="display:none;min-width:28px;font-size:20px;border-radius:5px;background-color:lightblue;text-align:center;margin:8px;cursor:pointer;padding:4px" title="Click to view current notifications">0</div> </div> <p id="logoutControl">{{{logoutControl}}}</p> </div> <div id="page_leftbar" style="height:calc(100vh - 66px);width:90px;position:absolute;z-index:1000;background:#113962;background:linear-gradient(to bottom, #104893 0%,#113962 100%);color:white;display:none"> <div style="height:16px"></div> <div id="LeftMenuMyDevices" class="lbbutton lbbuttonsel" title="My Devices" onclick="go(1)"> <div class="lb2" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyAccount" class="lbbutton" title="My Account" onclick="go(2)"> <div class="lb1" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyEvents" class="lbbutton" title="My Events" onclick="go(3)"> <div class="lb3" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyFiles" class="lbbutton" title="My Files" onclick="go(5)"> <div class="lb4" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyUsers" class="lbbutton" title="My Users" onclick="go(4)"> <div class="lb5" style="position:absolute;top:6px;left:6px"></div> </div> <div id="LeftMenuMyServer" class="lbbutton" title="My Server" onclick="go(6)" style="display:none"> <div class="lb6" style="position:absolute;top:6px;left:6px"></div> </div> </div> <div id="page_content" style="max-height:calc(100vh - 130px)"> <div id="topbarmaster"> <div id="topbar" class="noselect"> <div> <div style="position:relative"> <div style="position:absolute;top:3px;right:6px"> <span title="Toggle full width" style="cursor:pointer;color:white" onclick="toggleFullScreen(1)">↔</span> </div> <table id="MainMenuSpan" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MainMenuMyDevices" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(1)">My Devices</td> <td id="MainMenuMyAccount" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(2)">My Account</td> <td id="MainMenuMyEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(3)">My Events</td> <td id="MainMenuMyFiles" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(5)">My Files</td> <td id="MainMenuMyUsers" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(4)">My Users</td> <td id="MainMenuMyServer" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(6)">My Server</td> <td class="style3" style="text-align:right;height:24px"> </td> </tr> </table> <div id="MainSubMenuSpan" style="display:none"> <table id="MainSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MainDev" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(10)">General</td> <td id="MainDevDesktop" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(11)">Desktop</td> <td id="MainDevTerminal" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(12)">Terminal</td> <td id="MainDevFiles" style="width:100px;height:24px;cursor:pointer;display:none" class="style3x" onclick="go(13)">Files</td> <td id="MainDevEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(16)">Events</td> <td id="MainDevAmt" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(14)">Intel® AMT</td> <td id="MainDevConsole" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(15)">Console</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="MeshSubMenuSpan" style="display:none"> <table id="MeshSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="MeshGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(20)">General</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="UserSubMenuSpan" style="display:none"> <table id="UserSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="UserGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(30)">General</td> <td id="UserEvents" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(31)">Events</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="ServerSubMenuSpan" style="display:none"> <table id="ServerSubMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr> <td id="ServerGeneral" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(6)">General</td> <td id="ServerConsole" style="width:100px;height:24px;cursor:pointer" class="style3x" onclick="go(115)">Console</td> <td class="style3" style="height:24px"> </td> </tr> </table> </div> <div id="UserDummyMenuSpan"> <table id="UserDummyMenu" style="width:100%;height:22px" cellpadding="0" cellspacing="0" class="style1"> <tr><td class="style3" style="text-align:right;height:24px"> </td></tr> </table> </div> </div> </div> </div> </div> <div id="column_l"> <div id="p0" style="display:none"> <div id="p0message" style="margin:50px;text-align:center"><span id="p0span">Server disconnected</span>, <href onclick="reload()" style="cursor:pointer"><u>click to reconnect</u></href>.</div> </div> <div id="p1" style="display:none"> <div style="float:right;display:none" id="devListToolbarViewIcons"> <div id="devViewButton1" class="viewSelector" onclick="onDeviceViewChange(1)" title="Columns"><div class="viewSelector2"></div></div> <div id="devViewButton2" class="viewSelector" onclick="onDeviceViewChange(2)" title="List"><div class="viewSelector1"></div></div> <div id="devViewButton3" class="viewSelector" onclick="onDeviceViewChange(3)" title="Desktops"><div class="viewSelector3"></div></div> <div id="devViewButton4" class="viewSelector" onclick="onDeviceViewChange(4)" title="Map"><div class="viewSelector4"></div></div> </div><div><h1>My Devices</h1></div> <table class="noselect" style="width:100%;height:24px;background-color:#d3d9d6;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td id="devListToolbar" class="style14" style="display:none"> <input type="button" id="SelectAllButton" onclick="selectallButtonFunction();" value="Select All"> <input type="button" id="GroupActionButton" disabled="disabled" value="Group Action" onclick="groupActionFunction()"> <input id="SearchInput" type="text" style="width:120px" placeholder="Filter" onchange="masterUpdate(5)" onkeyup="masterUpdate(5)" autocomplete="off" onfocus="onSearchFocus(1)" onblur="onSearchFocus(0)"> <label><input type="checkbox" id="RealNameCheckBox" onclick="onRealNameCheckBox()"><span title="Show devices operating system name">OS Name</span></label> </td> <td id="kvmListToolbar" class="style14" style="height:100%;display:none"> <input type="button" onclick="connectAllKvmFunction()" value="Connect All"> <input type="button" onclick="disconnectAllKvmFunction()" value="Disconnect All"> <label><input type="checkbox" id="autoConnectDesktopCheckbox" onclick="autoConnectDesktops(event)" title="Automatic connect">Auto </label> <input type="button" onclick="showMultiDesktopSettings()" value="Settings"> </td> <td id="devMapToolbar" class="style14" style="height:100%;display:none"> <input type="text" id="mapSearchLocation" placeholder="Search Location" onfocus="onMapSearchFocus(1)" onblur="onMapSearchFocus(0)"> <input type="button" value="Search" title="Search for location" onclick="getSearchLocation()"> <input type="button" id="refreshmap" title="Reset map view" value="Reset" style="margin-left:5px" onclick="refreshMap(false,true)"> </td> <td class="auto-style1" style="height:100%"> <div style="float:right;display:none" id="devListToolbarView"> View <select id="viewselect" onchange="onDeviceViewChange()"> <option value="1">Columns <option value="2">List <option value="3">Desktops <option id="viewselectmapoption" value="4">Map </select> </div> <div style="float:right;display:none" id="devListToolbarSort"> Sort <select id="sortselect" onchange="masterUpdate(6)"> <option>Group <option>Power <option>Device <option>Tags </select> </div> <div style="float:right;display:none" id="devListToolbarSize"> Size <select id="sizeselect" onchange="onDeviceViewChange()"> <option value="0">Small <option value="1">Medium <option value="2">Large </select> </div> </td> <td class="h2"></td> </tr> </table> <div id="NoMeshesPanel" style="display:none"> <table style="width:100%;padding:20px"> <tr> <td valign="top" style="width:50px"> <img src="images/info.png" height="48" width="47"> </td> <td> To get started, <a onclick="account_createMesh()" style="cursor:pointer"><strong>click here to create a device group</strong></a>. </td> </tr> </table> </div> <div id="xdevices" class="noselect" style="max-height:calc(100vh - 239px);overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;display:none"></div> <div id="xdevicesmap" style="height:calc(100vh - 239px);width:100%;overflow:hidden;position:relative;display:none"> <div id="xmapSearchResultsDlg" style="position:absolute;display:none;max-height:280px;left:5px;top:5px;max-width:250px;z-index:1000;background-color:#EEE;box-shadow:0px 0px 15px #666"> <div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"> <div id="xmapSearchClose" style="float:right;padding:5px;cursor:pointer" onclick="mapCloseSearchWindow()"><b>X</b></div> <div style="padding:5px">Location Results</div> <div style="width:100%;margin:6px"></div> </div> <div id="xmapSearchResults" style="margin:6px"></div> </div> </div> <div id="xmap-info-window" style="text-shadow:0px 0px 15px #FFF"></div> </div> <div id="p2" style="display:none"> <h1>My Account</h1> <img id="p2AccountImage" alt="" width="150" height="103" src="images/mainaccount.jpg" style="margin-bottom:10px;margin-right:20px;float:right"> <div id="p2AccountSecurity" style="display:none"> <p><strong>Account security</strong></p> <div style="margin-left:25px"> <div id="manageAuthApp"><div style="width:15px;display:inline-block"><span id="authAppSetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageAuthApp()" style="cursor:pointer">Manage authenticator app</a><br></span></div> <div id="manageHardwareOtp"><div style="width:15px;display:inline-block"><span id="authKeySetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageHardwareOtp(0)" style="cursor:pointer">Manage security keys</a><br></span></div> <div id="manageOtp"><div style="width:15px;display:inline-block"><span id="authCodesSetupCheck" style="color:green;font-size:10px"><strong>✓</strong></span></div><span><a onclick="account_manageOtp(0)" style="cursor:pointer">Manage backup codes</a><br></span></div> </div> </div> <div id="p2AccountActions"> <p><strong>Account actions</strong></p> <p style="margin-left:40px"> <span id="verifyEmailId" style="display:none"><a onclick="account_showVerifyEmail()" style="cursor:pointer">Verify email</a><br></span> <a onclick="account_showChangeEmail()" style="cursor:pointer">Change email address</a><br> <a onclick="account_showChangePassword()" style="cursor:pointer">Change password</a><br> <a onclick="account_showDeleteAccount()" style="cursor:pointer">Delete account</a><br> </p> <br style="clear:both"> </div> <strong>Device Groups</strong> ( <a onclick="account_createMesh()" style="cursor:pointer"><img height="12" src="images/icon-addnew.png" width="12" border="0"> New</a> ) <br><br> <div id="p2meshes"></div> <div id="p2noMeshFound" style="margin-left:40px;display:none">No device groups. <a onclick="account_createMesh()" style="cursor:pointer"><strong>Get started here!</strong></a></div> <br style="clear:both"> </div> <div id="p3" style="display:none"> <h1>My Events</h1> <table style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td> <input id="p2deleteall" type="button" onclick="showDeleteAllEventsDialog()" style="display:none" value="Delete All..."></td> <td class="auto-style1"> Show <select id="p3limitdropdown" onchange="refreshEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> </td> <td class="h2"></td> </tr> </table> <div id="p3events" style="height:calc(100vh - 243px);overflow-y:scroll"></div> </div> <div id="p4" style="display:none"> <h1>My Users</h1> <table style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0"> <tr> <td class="h1"></td> <td class="style14"> <div style="float:right"> <input type="button" onclick="showUserBroadcastDialog()" value="Broadcast"> </div> <div> <input type="button" onclick="showCreateNewAccountDialog()" value="New Account..."> <input id="UserSearchInput" type="text" style="width:120px" placeholder="Filter" onchange="onUserSearchInputChanged()" onkeyup="onUserSearchInputChanged()" autocomplete="off" onfocus="onUserSearchFocus(1)" onblur="onUserSearchFocus(0)"> </div> </td> <td class="h2"></td> </tr> </table> <div id="p3users" style="max-height:calc(100vh - 243px);overflow-y:auto"></div> </div> <div id="p5" style="display:none"> <h1>My Files</h1> <table id="p5toolbar" style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:100%;background-color:#d3d9d6;text-align:left;padding:4px" valign="bottom"> <div id="p5rightOfButtons" style="float:right;margin-top:3px"></div> <div> <input type="button" id="p5FolderUp" disabled="disabled" onclick="p5folderup();" value="Up"> <input type="button" id="p5SelectAllButton" disabled="disabled" onclick="p5selectallfile();" value="Select All" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5RenameFileButton" disabled="disabled" value="Rename" onclick="p5renamefile();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5DeleteFileButton" disabled="disabled" value="Delete" onclick="p5deletefile();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5NewFolderButton" disabled="disabled" value="New Folder" onclick="p5createfolder();" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5UploadButton" disabled="disabled" value="Upload" onclick="p5uploadFile()" onkeypress="return false;" onkeydown="return false;"> <input type="button" id="p5CutButton" disabled="disabled" value="Cut" onclick="p5copyFile(1)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p5CopyButton" disabled="disabled" value="Copy" onclick="p5copyFile(0)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p5PasteButton" disabled="disabled" value="Paste" onclick="p5pasteFile()" onkeypress="return false" onkeydown="return false"> </div> </td> </tr> <tr> <td style="background-color:#E4E9E7;height:28px"> <div style="float:right"> <select id="p5sortdropdown" onchange="updateFiles()"> <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="p5currentpath"></span></div> </td> </tr> </table> <div id="p5filetable" style="width:100%;height:calc(100vh - 294px);overflow:auto;-webkit-user-select:none;position:relative"> <div id="p5PublicShare" style="display:none;width:100%;overflow:auto;-webkit-user-select:none;background-color:lightsteelblue"><div style="padding:4px">These files are shared publicly, click "link" to get public url.</div></div> <div id="bigok" style="width:256px;overflow:hidden;position:absolute;left:337px;top:20px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✓</b></div> <div id="bigfail" style="width:256px;overflow:hidden;position:absolute;left:337px;top:20px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✗</b></div> <span id="p5files"></span> </div> <table id="p5toolbarBottom" style="width:100%" cellpadding="0" cellspacing="0"> <tr><td class="style6" style="text-align:left;padding:3px"> <span id="p5bottomstatus"></span></td></tr> </table> </div> <div id="p6" style="display:none"> <img id="MainMeshImage" src="serverpic.ashx" style="border-width:0px;height:200px;width:200px;float:right"> <h1>My Server</h1> <p id="p2ServerActions"><strong>Server actions</strong></p> <p style="margin-left:40px"> <div id="p2ServerActionsBackup" style="margin-left:40px"><a href="/backup.zip" rel="noreferrer noopener" target="_blank" style="cursor:pointer">Download server backup</a></div> <div id="p2ServerActionsRestore" style="margin-left:40px"><a onclick="server_showRestoreDlg()" style="cursor:pointer">Restore server with backup</a></div> <div id="p2ServerActionsVersion" style="margin-left:40px"><a onclick="server_showVersionDlg()" style="cursor:pointer">Check server version</a></div> <div id="p2ServerActionsErrors" style="margin-left:40px"><a onclick="server_showErrorsDlg()" style="cursor:pointer">Show server error log</a></div> </p> <br><strong>Server Statistics</strong><br><br> <div id="serverStats" style="margin-left:40px"> <div id="serverCpuChartView" style="display:none"> <div style="width:60px;display:inline-block"><canvas id="serverCpuChart" style="width:60px;height:60px"></canvas></div> <div style="width:160px;display:inline-block" id="serverCpuChartText"></div> </div> <div id="serverMemoryChartView" style="display:none"> <div style="width:60px;display:inline-block"><canvas id="serverMemoryChart" style="width:60px;height:60px"></canvas></div> <div style="width:160px;display:inline-block" id="serverMemoryChartText"></div> </div><br><br> <div id="serverStatsTable"></div> </div> </div> <div id="p10" style="display:none"> <table style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:auto" valign="top"> <div id="p10title"> <div id="p10BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p10deviceName"></span></h1> </div> <div id="p10html"></div> </td> <td style="width:20px"></td> <td style="width:200px"> <a style="cursor:pointer" onclick="p10showiconselector()"><img id="MainComputerImage" style="border-width:0px;height:200px;width:200px"></a> <div style="width:100%;text-align:center"><strong><span id="MainComputerState"></span></strong></div> </td> </tr> </table><br> <div id="p10html2"></div> <div id="p10html3"></div> </div> <div id="p11" class="noselect" style="display:none"> <div id="p11title"> <div id="p11deviceNameHeader"> <div id="p11BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <div style="float:right" id="devListToolbarViewIcons"><div class="viewSelector" onclick="deskToggleFull(event)" title="Full Screen. Hold shift to browser full screen."><div class="viewSelector5"></div></div></div> <h1>Desktop - <span id="p11deviceName"></span></h1> </div> </div> <div id="p14warning" 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="p14warninga">, click here to enable it.</span></div> </div> <div id="p14warning2" 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 id="deskarea0" cellpadding="0" cellspacing="0" style="width:100%;padding:0px;padding:0px;margin-top:0px"> <tr id="deskarea1"> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <span id="p14power"></span> <div style='cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px' title="Rotate Left" onclick="drotate(-1)">↺</div> <div style='cursor:pointer;border:none;float:right;font-size:130%;margin-right:4px' title="Rotate Right" onclick="drotate(1)">↻</div> <input id="deskFocusBtn" type="button" title="Toggle focus mode, when active only the region around the mouse is updated" onkeypress="return false" onkeydown="return false" value="Focus All" onclick="deskToggleFocus()" style="margin-right:3px;display:none"> <input id="deskSaveBtn" 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 id="deskActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> <input id="deskActionsSettings" type="button" value="Settings..." title="Edit remote desktop settings" onkeypress="return false" onkeydown="return false" onclick="showDesktopSettings()" 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;display:none"> </div> <div> <div id="idx_deskFullBtn2" onclick="deskToggleFull(event)" style="float:left;font-size:large;cursor:pointer;display:none"> ✖</div> <input type="button" id="autoconnectbutton1" value="AutoConnect" onclick="autoConnectDesktop(event)" onkeypress="return false" onkeydown="return false" style="display:none"> <span id="connectbutton1span"> <input type="button" id="connectbutton1" value="Connect" onclick="connectDesktop(event,1)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="connectbutton1hspan"> <input type="button" id="connectbutton1h" value="HW Connect" onclick="connectDesktop(event,2)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="disconnectbutton1span"> <input type="button" id="disconnectbutton1" value="Disconnect" onclick="connectDesktop(event,0)" onkeypress="return false" onkeydown="return false"></span> <span id="deskstatus">Disconnected</span> </div> </td> </tr> <tr id="deskarea2"> <td> <div style="background-color:gray"><div id="progressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr id="deskarea3"> <td id="deskarea3x" style="background:black;text-align:center;position:relative;overflow:hidden"> <div id="DeskFocus" style="overflow:hidden;color:transparent;border:3px dotted rgba(255,0,0,.2);position:absolute;border-radius:5px" oncontextmenu="return false" onmousedown="dmousedown(event)" onmouseup="dmouseup(event)" onmousemove="dmousemove(event)"></div> <div id="DeskParent" style="overflow:hidden"> <canvas id="Desk" width="640" height="480" style="overflow:hidden;width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown="dmousedown(event)" onmouseup="dmouseup(event)" onmousemove="dmousemove(event)" onmousewheel="dmousewheel(event)"></canvas> </div> <div id="DeskTools" style="position:absolute;width:400px;height:100%;background-color:gray;top:0;right:0;border-left:2px solid lightgray;display:none"> <a id="DeskToolsRefreshButton" style="float:right;padding:3px;cursor:pointer" onclick="refreshDeskTools()">Refresh</a> <div id="DeskToolsBar" style="position:absolute;padding:3px;border-radius:3px 3px 0px 0px;top:5px;left:4px;bottom:26px;background-color:lightgray;cursor:pointer">Processes</div> <div style="position:absolute;top:26px;left:4px;right:4px;bottom:4px;background-color:lightgray;text-align:left"> <div style="border-bottom:1px solid darkgray;padding:3px"><a style="width:50px;padding-right:5px;float:left;cursor:pointer" title="Sort by process id" onclick="sortProcess(0)">PID</a><a style="cursor:pointer" title="Sort by name" onclick="sortProcess(1)">Name</a></div> <div id="DeskToolsProcesses" style="overflow-y:scroll;position:absolute;top:24px;bottom:0px;width:100%"></div> </div> </div> </td> </tr> <tr id="deskarea4"> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <select id="termdisplays" style="display:none" onchange="deskSetDisplay(event)" onclick="deskGetDisplayNumbers(event)"></select> <input id="DeskToolsButton" type="button" value="Tools" title="Toggle tools view" onkeypress="return false" onkeydown="return false" onclick="toggleDeskTools()"> <span id="DeskChatButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Open chat window to this computer"><img src='images/icon-chat.png' onclick="deviceChat()" height="16" width="16" style="padding-top:2px"></span> <span id="DeskNotifyButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Display a notification on the remote computer"><img src='images/icon-notify.png' onclick="deviceToastFunction()" height="16" width="16" style="padding-top:2px"></span> <span id="DeskOpenWebButton" style="float:right;margin-top:1px;margin-right:4px;cursor:pointer" title="Open a web address on remote computer"><img src='images/icon-url2.png' onclick="deviceUrlFunction()" height="16" width="16" style="padding-top:2px"></span> </div> <div> <select style="margin-left:6px" id="deskkeys"> <option value="5">Win <option value="0">Win+Down <option value="1">Win+Up <option value="2">Win+L <option value="3">Win+M <option value="4">Shift+Win+M <option value="6">Win+R </select> <input id="DeskWD" type="button" value="Send" onkeypress="return false" onkeydown="return false" onclick="deskSendKeys()"> <input id="DeskClip" style="margin-left:6px;display:none" type="button" value="Clipboard" onkeypress="return false" onkeydown="return false" onclick="showDeskClip()"> <input id="DeskCAD" type="button" value="Ctrl-Alt-Del" onkeypress="return false" onkeydown="return false" onclick="sendCAD()"> <label><span id="DeskControlSpan" style="margin-left:6px" title="Toggle mouse and keyboard input"><input id="DeskControl" type="checkbox" onkeypress="return false" onkeydown="return false" onclick="toggleKvmControl()">Input</span></label> </div> </td> </tr> </table> </div> <div id="p12" style="display:none"> <div id="p12title"> <div id="p12BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Terminal - <span id="p12deviceName"></span></h1> </div> <div id="p12warning" 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="p14warninga">, click here to enable it.</span></div> </div> <div id="p12warning2" 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:#C0C0C0"> <div style="float:right;text-align:right"> <input id="termActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> </div> <div> <input type="button" id="autoconnectbutton2" value="AutoConnect" onclick="autoConnectTerminal(event)" onkeypress="return false" onkeydown="return false" style="display:none"> <span id="connectbutton2span"> <input type="button" id="connectbutton2" value="Connect" onclick="connectTerminal(event,1)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="connectbutton2hspan"> <input type="button" id="connectbutton2h" value="HW Connect" onclick="connectTerminal(event,2)" onkeypress="return false" onkeydown="return false" disabled="disabled"></span> <span id="disconnectbutton2span"> <input type="button" id="disconnectbutton2" value="Disconnect" onclick="connectTerminal(event,0)" onkeypress="return false" onkeydown="return false"></span> <span id="termstatus">Disconnected</span> </div> </td> </tr> <tr> <td> <div style="background-color:gray"><div id="termprogressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr> <td style="background:black;text-align:center;height:500px;position:relative"> <pre id="Term" style="background:black;margin:0;padding:0"></pre> </td> </tr> <tr> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <div style="float:right;text-align:right"> <span id="terminalSettingsButtons" style="display:none"> <input id="id_tcrbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="CR+LF" title="Toggle what the return key will send" onclick="termToggleCr()"> <input id="id_tfxkeysbutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Intel (F10 = ESC+[OM)" title="Toggle F1 to F10 keys emulation type" onclick="termToggleFx()"> <input id="id_ttypebutton" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Extended Ascii" title="Toggle terminal emulation type" onclick="termToggleType()"> </span> <select id="specialkeylist" onkeypress="return false" style="margin-left:5px"></select> <input id="specialkeylistinput" type="button" onkeypress="return false" class="bottombutton" value="Send" title="Send the selected special key" onclick="sendSpecialKey()"> </div> <div> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlcbutton" value="Ctl-C" onclick="termSendKey(3,'ctrlcbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="ctrlxbutton" value="Ctl-X" onclick="termSendKey(24,'ctrlxbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="escbutton" value="ESC" onclick="termSendKey(27,'escbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="bsbutton" value="Backspace" onclick="termSendKey(8,'bsbutton')"> <input type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" id="pastebutton" value="Paste" title="Paste text into the terminal" onclick="showTermPasteDialog()"> </div> </td> </tr> </table> </div> <div id="p13" style="display:none"> <div id="p13title"> <div id="p13BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Files - <span id="p13deviceName"></span></h1> </div> <table id="p13toolbar" style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="background-color:#C0C0C0;border-bottom:2px solid black;padding:2px"> <div style="float:right;text-align:right"> <input id="filesActionsBtn" type="button" title="Perform power actions on the device" onkeypress="return false" onkeydown="return false" value="Actions" onclick="deviceActionFunction()" style="margin-right:3px"> </div> <div> <input id="p13AutoConnect" value="AutoConnect" onclick="autoConnectFiles(event)" onkeypress="return false" onkeydown="return false" type="button" style="display:none"> <input id="p13Connect" value="Connect" onclick="connectFiles(event)" onkeypress="return false" onkeydown="return false" type="button"> <span id="p13Status">Disconnected</span> </div> </td> </tr> <tr> <td style="width:100%;background-color:#d3d9d6;text-align:left;padding:4px" valign="bottom"> <div id="p13rightOfButtons" style="float:right;margin-top:3px"></div> <div> <input type="button" id="p13FolderUp" disabled="disabled" onclick="p13folderup()" value="Up"> <input type="button" id="p13SelectAllButton" disabled="disabled" onclick="p13selectallfile()" value="Select All" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13RenameFileButton" disabled="disabled" value="Rename" onclick="p13renamefile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13DeleteFileButton" disabled="disabled" value="Delete" onclick="p13deletefile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13NewFolderButton" disabled="disabled" value="New Folder" onclick="p13createfolder()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13UploadButton" disabled="disabled" value="Upload" onclick="p13uploadFile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13CutButton" disabled="disabled" value="Cut" onclick="p13copyFile(1)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13CopyButton" disabled="disabled" value="Copy" onclick="p13copyFile(0)" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13PasteButton" disabled="disabled" value="Paste" onclick="p13pasteFile()" onkeypress="return false" onkeydown="return false"> <input type="button" id="p13RefreshButton" disabled="disabled" value="Refresh" onclick="p13folderup(9999)" onkeypress="return false" onkeydown="return false"> </div> </td> </tr> <tr> <td style="background-color:#E4E9E7;height:28px"> <div style="float:right"> <select id="p13sortdropdown" onchange="p13updateFiles()"> <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="p13currentpath"></span></div> </td> </tr> </table> <div id="p13filetable" style="width:100%;height:calc(100vh - 346px);overflow:auto;-webkit-user-select:none"> <div id="p13bigok" style="width:256px;overflow:hidden;position:absolute;left:337px;top:200px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✓</b></div> <div id="p13bigfail" style="width:256px;overflow:hidden;position:absolute;left:337px;top:200px;text-align:center;font-size:1600%;color:#AAAAAA;display:none"><b>✗</b></div> <span id="p13files"></span> </div> <table id="p13toolbarBottom" style="width:100%" cellpadding="0" cellspacing="0"> <tr><td class="style6" style="text-align:left;padding:3px"> <span id="p13bottomstatus"></span></td></tr> </table> </div> <div id="p14" style="display:none"> <div id="p14title"> <div id="p14BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Intel® AMT - <span id="p14deviceName"></span></h1> </div> <iframe id="p14iframe" style="width:100%;height:calc(100vh - 242px);border:0;overflow:hidden" src="/commander.htm"></iframe> </div> <div id="p15" style="display:none"> <div id="p15title"> <div id="p15BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1><span id="p15deviceName"></span></h1> </div> <table cellpadding="0" cellspacing="0" style="width:100%;padding:0px;padding:0px;margin-top:0px"> <tr> <td style="background:#C0C0C0"> <div style="float:right;padding-right:4px"> <div style="padding:4px;display:inline-block" id="p15coreName" title="Information about current core running on this agent"></div> <input type="button" id="p15uploadCore" value="Agent Action" onclick="p15uploadCore(event)" title="Change the agent Java Script code module"> </div> <div id="p15statetext" style="padding:4px"></div> </td> </tr> <tr> <td> <div style="background-color:gray"><div id="consoleprogressbar" style="height:2px;width:0%;background-color:red"></div></div> </td> </tr> <tr> <td id="p15agentConsole" style="background:black;margin:0;padding:0;color:lightgray;width:100%;height:calc(100vh - 296px);max-height:500px;position:relative"> <pre id="p15agentConsoleText" style="position:absolute;margin:0;padding:0;top:0;bottom:0;left:0;right:0;overflow-y:scroll;overflow-x:auto"></pre> </td> </tr> <tr> <td style="padding-top:2px;padding-bottom:2px;background:#C0C0C0"> <table style="width:100%"> <tr> <td style="width:99%"> <input id="p15consoleText" style="width:100%" onkeyup="p15consoleSend(event)" onfocus="onConsoleFocus(1)" onblur="onConsoleFocus(0)"> </td> <td> </td> <td style="width:1%"><input id="id_p15consoleClear" type="button" onkeypress="return false" onkeydown="return false" class="bottombutton" value="Clear" onclick="p15consoleClear()"></td> </tr> </table> </td> </tr> </table> </div> <div id="p16" style="display:none"> <div id="p16title"> <div id="p16BackButton" style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Events - <span id="p16deviceName"></span></h1> </div> <div style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px"> <div class="style7" style="width:16px;height:100%;float:left"> </div> <div class="h1" style="height:100%;float:left"> </div> <div class="style14" style="height:100%;float:left"> <input type="button" value="Refresh" onclick="refreshDeviceEvents()"> </div> <div class="auto-style1" style="height:100%;float:right"> Show <select id="p16limitdropdown" onchange="refreshDeviceEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> <div style="height:100%;width:20px;float:right;background-color:#ffffff"></div> <div class="h2" style="height:100%;float:right"> </div> </div> </div> <div id="p16events" style="max-height:calc(100vh - 267px);overflow-y:auto"></div> </div> <div id="p20" style="display:none"> <picture id="MainMeshImage" style="border-width:0px;height:200px;width:200px;float:right"> <source type="image/webp" width="200" height="200" srcset="images/webp/mesh-200.webp"> <img alt="" width="200" height="200" src="images/mesh-200.jpg"> </source></picture> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p20meshName"></span></h1> <p id="p20info"> </div> <div id="p30" style="display:none"> <table style="width:100%" cellpadding="0" cellspacing="0"> <tr> <td style="width:auto" valign="top"> <div id="p30title"> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>General - <span id="p30userName"></span></h1> </div> <div id="p30html"></div> </td> <td style="width:20px"></td> <td style="width:200px"> <picture id="MainUserImage" style="border-width:0px;height:200px;width:200px;float:right"> <source type="image/webp" width="200" height="200" srcset="images/webp/user-200.webp"> <img alt="" width="200" height="200" src="images/user-200.jpg"> </source></picture> <div style="width:100%;text-align:center"><strong><span id="MainUserState"></span></strong></div> </td> </tr> </table><br> <div id="p30html2"></div> <div id="p30html3"></div> </div> <div id="p31" style="display:none"> <div style="float:left"><div class="backButton" onclick="goBack()" title="Back"><div class="backButtonEx"></div></div></div> <h1>Events - <span id="p31userName"></span></h1> <div style="width:100%;height:24px;background-color:#d3d9d6;margin-bottom:4px"> <div class="style7" style="width:16px;height:100%;float:left"> </div> <div class="h1" style="height:100%;float:left"> </div> <div class="style14" style="height:100%;float:left"> <input type="button" value="Refresh" onclick="refreshUsersEvents()"> </div> <div class="auto-style1" style="height:100%;float:right"> Show <select id="p31limitdropdown" onchange="refreshUsersEvents()"> <option value="60">Last 60 <option value="120">Last 120 <option value="250">Last 250 <option value="500">Last 500 <option value="1000">Last 1000 </select> <div style="height:100%;width:20px;float:right;background-color:#ffffff"></div> <div class="h2" style="height:100%;float:right;"> </div> </div> </div> <div id="p31events" style="max-height:calc(100vh - 267px);overflow-y:scroll"></div> </div> <br id="column_l_bottomgap"> </div> <div id="footer" class="noselect"> <table cellpadding="0" cellspacing="10" style="width:100%"> <tr> <td style="text-align:left;color:white"> {{{footer}}} </td> <td style="text-align:right"> <a id="verifyEmailId2" style="color:yellow;margin-left:3px;cursor:pointer;display:none" onclick="account_showVerifyEmail()">Verify Email</a> <a style="margin-left:3px" href="terms">Terms & Privacy</a> </td> </tr> </table> </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;top:160px;width:400px;left:calc((100% / 2) - 200px);display:none"> <div style="width:100%;background-color:#003366;color:#FFF;border-radius:5px 5px 0 0"> <div id="id_dialogclose" style="float:right;padding:3px;margin-right:3px;cursor:pointer" onclick="setDialogMode()">✖</div> <div id="id_dialogtitle" 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="id_dialogMessage" style="padding:10px"></div> </div> <div id="dialog2" style="margin:auto;margin:3px"> <div id="id_dialogOptions"></div> </div> <div id="dialog3" style="margin:auto;margin:3px"> <div style="height:26px"> <select id="d3uploadMode" style="float:right;width:260px" onchange="d3modechange()"> <option value="1">Local file upload <option value="2">Server file selection </select> <div>File Selection</div> </div> <div id="d3localmode" style="height:26px;display:none"> <form id="d3localmodeform" method="post" enctype="multipart/form-data" action="uploadfile.ashx" target="fileUploadFrame"> <input type="text" id="d3attrib" name="attrib" style="display:none"> <input type="file" id="d3localFile" name="files" style="float:right;width:260px" onchange="d3setActions()"> <input type="submit" id="d3submit" style="display:none"> </form> <div>Upload File</div> </div> <div id="d3servermode"> <div style="width:100%;background-color:#d3d9d6;text-align:left;padding:3px" valign="bottom"> <input type="button" id="p3FolderUp" disabled="disabled" onclick="d3folderup()" value="Up"> </div> <div id="d3serverfiles" style="width:100%;height:150px;background-color:white;padding:2px;border:1px solid gray;overflow-y:scroll"></div> </div> </div> <div id="dialog7" style="margin:auto;margin:3px"> <div id="d7meshkvm"> <h4 style="width:100%;border-bottom:1px solid gray">Agent Remote Desktop</h4> <div style="margin:3px 0 3px 0"> <select id="d7bitmapquality" style="float:right;width:200px;height:20px" dir="rtl"></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 style="margin:3px 0 3px 0"> <select id="d7framelimiter" style="float:right;width:200px;height:20px" dir="rtl"> <option selected="selected" value="50">Fast <option value="100">Medium <option value="400">Slow <option value="1000">Very slow </select> <div style="height:20px">Frame rate</div> </div> </div> <div id="d7amtkvm"> <h4 style="width:100%;border-bottom:1px solid gray">Intel® AMT Hardware KVM</h4> <div style='height:26px'> <select id="d7desktopmode" style="float:right;width:200px"> <option value="1">RLE8, Fastest <option value="2">RLE16, Recommended <option value="3">RAW8, Slow <option value="4">RAW16, Very Slow </select> <div>Image Encoding</div> </div> <div style="height:60px"> <div style="float:right;border:1px solid #666;width:200px;height:60px;overflow-y:scroll;background-color:white"> <label><input type="checkbox" id='d7showfocus'>Show Focus Tool<br></label> <label><input type="checkbox" id='d7showcursor'>Show Local Mouse Cursor<br></label> </div> <div>Other Settings</div> </div> </div> </div> </div> <div id="idx_dlgButtonBar" style="padding:10px;margin-bottom:4px"> <input id="idx_dlgCancelButton" type="button" value="Cancel" style="float:right;width:80px;margin-left:5px" onclick="dialogclose(0)"> <input id="idx_dlgOkButton" type="button" value="OK" style="float:right;width:80px" onclick="dialogclose(1)"> <div style="height:25px"><input id="idx_dlgDeleteButton" type="button" value="Delete" style="width:80px;display:none" onclick="dialogclose(2)"></div> </div> </div> <iframe name="fileUploadFrame" style="display:none"></iframe> <form style="display:none" method="post" action="uploadfile.ashx" enctype="multipart/form-data" target="fileUploadFrame"><input id="p5fileDragName" name="name"><input id="p5fileDragSize" name="size"><input id="p5fileDragType" name="type"><input id="p5fileDragData" name="data"><input id="p5fileDragLink" name="link"><input type="submit" id="p5loginSubmit2" style="display:none"></form> <form style="display:none" method="post" action="uploadnodefile.ashx" enctype="multipart/form-data" target="fileUploadFrame"><input id="p13fileDragName" name="name"><input id="p13fileDragSize" name="size"><input id="p13fileDragType" name="type"><input id="p13fileDragData" name="data"><input id="p13fileDragLink" name="link"><input type="submit" id="p13loginSubmit2" style="display:none"></form> <audio id="chimes"><source src="sounds/chimes.mp3" type="audio/mp3"></source></audio> </div> </div> <script>if(!String.prototype.startsWith){String.prototype.startsWith=function(a){return this.lastIndexOf(a,0)===0}}if(!String.prototype.endsWith){String.prototype.endsWith=function(a){return this.indexOf(a,this.length-a.length)!==-1}}function Q(a){return document.getElementById(a)}function QS(a){try{return Q(a).style}catch(a){}}function QE(a,b){try{Q(a).disabled=!b}catch(a){}}function QV(a,b){try{QS(a).display=(b?"":"none")}catch(a){}}function QA(a,b){Q(a).innerHTML+=b}function QH(a,b){Q(a).innerHTML=b}function inputBoxFocus(b){Q(b).focus();var a=Q(b).value;Q(b).value="";Q(b).value=a}function ReadShort(b,a){return(b.charCodeAt(a)<<8)+b.charCodeAt(a+1)}function ReadShortX(b,a){return(b.charCodeAt(a+1)<<8)+b.charCodeAt(a)}function ReadInt(b,a){return(b.charCodeAt(a)*16777216)+(b.charCodeAt(a+1)<<16)+(b.charCodeAt(a+2)<<8)+b.charCodeAt(a+3)}function ReadSInt(b,a){return(b.charCodeAt(a)<<24)+(b.charCodeAt(a+1)<<16)+(b.charCodeAt(a+2)<<8)+b.charCodeAt(a+3)}function ReadIntX(b,a){return(b.charCodeAt(a+3)*16777216)+(b.charCodeAt(a+2)<<16)+(b.charCodeAt(a+1)<<8)+b.charCodeAt(a)}function ShortToStr(a){return String.fromCharCode((a>>8)&255,a&255)}function ShortToStrX(a){return String.fromCharCode(a&255,(a>>8)&255)}function IntToStr(a){return String.fromCharCode((a>>24)&255,(a>>16)&255,(a>>8)&255,a&255)}function IntToStrX(a){return String.fromCharCode(a&255,(a>>8)&255,(a>>16)&255,(a>>24)&255)}function MakeToArray(a){if(!a||a==null||typeof a=="object"){return a}return[a]}function SplitArray(a){return a.split(",")}function Clone(a){return JSON.parse(JSON.stringify(a))}function EscapeHtml(a){if(typeof a=="string"){return a.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'")}if(typeof a=="boolean"){return a}if(typeof a=="number"){return a}}function EscapeHtmlBreaks(a){if(typeof a=="string"){return a.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/"/g,""").replace(/'/g,"'").replace(/\r/g,"<br />").replace(/\n/g,"").replace(/\t/g," ")}if(typeof a=="boolean"){return a}if(typeof a=="number"){return a}}function ArrayElementMove(a,b,c){a.splice(c,0,a.splice(b,1)[0])}function ObjectToStringEx(e,a){var d="";if(e!=0&&(!e||e==null)){return"(Null)"}if(e instanceof Array){for(var b in e){d+="<br />"+gap(a)+"Item #"+b+": "+ObjectToStringEx(e[b],a+1)}}else{if(e instanceof Object){for(var b in e){d+="<br />"+gap(a)+b+" = "+ObjectToStringEx(e[b],a+1)}}else{d+=EscapeHtml(e)}}return d}function ObjectToStringEx2(e,a){var d="";if(e!=0&&(!e||e==null)){return"(Null)"}if(e instanceof Array){for(var b in e){d+="\r\n"+gap2(a)+"Item #"+b+": "+ObjectToStringEx2(e[b],a+1)}}else{if(e instanceof Object){for(var b in e){d+="\r\n"+gap2(a)+b+" = "+ObjectToStringEx2(e[b],a+1)}}else{d+=EscapeHtml(e)}}return d}function gap(a){var d="";for(var b=0;b<(a*4);b++){d+=" "}return d}function gap2(a){var d="";for(var b=0;b<(a*4);b++){d+=" "}return d}function ObjectToString(a){return ObjectToStringEx(a,0)}function ObjectToString2(a){return ObjectToStringEx2(a,0)}function hex2rstr(a){if(typeof a!="string"||a.length==0){return""}var c="",b=(""+a).match(/../g),e;while(e=b.shift()){c+=String.fromCharCode("0x"+e)}return c}function char2hex(a){return(a+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(a){return unescape(encodeURIComponent(a))}function decode_utf8(a){return decodeURIComponent(escape(a))}function data2blob(c){var b=new Array(c.length);for(var d=0;d<c.length;d++){b[d]=c.charCodeAt(d)}var a=new Blob([new Uint8Array(b)]);return a}function random(a){return Math.floor(Math.random()*a)}function trademarks(a){return a.replace(/\(R\)/g,"®").replace(/\(TM\)/g,"™")}var MeshServerCreateControl=function(b,a){var c={};c.State=0;c.connectstate=0;c.pingTimer=null;c.authCookie=a;c.xxStateChange=function(e,d){if(c.State==e){return}var g=c.State;c.State=e;if(c.onStateChanged){c.onStateChanged(c,c.State,g,d)}};c.Start=function(){if(c.connectstate!=0){return}c.connectstate=0;var d=window.location.protocol.replace("http","ws")+"//"+window.location.host+b+"control.ashx";if(c.authCookie&&(c.authCookie!="")){d+="?auth="+c.authCookie}c.socket=new WebSocket(d);c.socket.onopen=function(g){c.connectstate=1};c.socket.onmessage=c.xxOnMessage;c.socket.onclose=function(g){c.Stop(g.code)};c.xxStateChange(1,0);if(c.pingTimer!=null){clearInterval(c.pingTimer)}c.pingTimer=setInterval(function(){c.send({action:"ping"})},29000)};c.Stop=function(d){c.connectstate=0;if(c.socket){c.socket.close();delete c.socket}if(c.pingTimer!=null){clearInterval(c.pingTimer);c.pingTimer=null}c.xxStateChange(0,d)};c.xxOnMessage=function(d){if(c.State==1){c.xxStateChange(2)}var g;try{g=JSON.parse(d.data)}catch(d){return}if((typeof g!="object")||(g.action=="pong")){return}if(g.action=="close"){if(g.msg){console.log(g.msg)}c.Stop(g.cause);return}if(c.onMessage){c.onMessage(c,g)}};c.send=function(d){if(c.socket!=null&&c.connectstate==1){c.socket.send(JSON.stringify(d))}};return c};function AmtStackCreateService(t){var s=new Object();s.wsman=t;s.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/"];s.PendingEnums=[];s.PendingBatchOperations=0;s.ActiveEnumsCount=0;s.MaxActiveEnumsCount=1;s.onProcessChanged=null;var n=0;var m=0;s.GetPendingActions=function(){return(s.PendingEnums.length*2)+(s.ActiveEnumsCount)+s.wsman.comm.PendingAjax.length+s.wsman.comm.ActiveAjaxCount+s.PendingBatchOperations};function r(){var u=s.GetPendingActions();if(n<u){n=u}if(s.onProcessChanged!=null&&m!=u){m=u;s.onProcessChanged(u,n)}if(u==0){n=0}}s.Subscribe=function(w,v,C,u,B,z,A,x,D,y){s.wsman.ExecSubscribe(s.CompleteName(w),v,C,function(G,F,E,H){r();u(s,w,E,H,B)},0,z,A,x,D,y);r()};s.UnSubscribe=function(v,u,y,w,x){s.wsman.ExecUnSubscribe(s.CompleteName(v),function(B,A,z,C){r();u(s,v,z,C,y)},0,w,x);r()};s.Get=function(v,u,x,w){s.wsman.ExecGet(s.CompleteName(v),function(A,z,y,B){r();u(s,v,y,B,x)},0,w);r()};s.Put=function(v,x,u,z,w,y){s.wsman.ExecPut(s.CompleteName(v),x,function(C,B,A,D){r();u(s,v,A,D,z)},0,w,y);r()};s.Create=function(v,x,u,y,w){s.wsman.ExecCreate(s.CompleteName(v),x,function(B,A,z,C){r();u(s,v,z,C,y)},0,w);r()};s.Delete=function(v,x,u,y,w){s.wsman.ExecDelete(s.CompleteName(v),x,function(B,A,z,C){r();u(s,v,z,C,y)},0,w);r()};s.Exec=function(x,w,u,v,A,y,z){s.wsman.ExecMethod(s.CompleteName(x),w,u,function(D,C,B,E){r();v(s,x,s.CompleteExecResponse(B),E,A)},0,y,z);r()};s.ExecWithXml=function(x,w,u,v,A,y,z){s.wsman.ExecMethodXml(s.CompleteName(x),w,execArgumentsToXml(u),function(D,C,B,E){r();v(s,x,s.CompleteExecResponse(B),E,A)},0,y,z);r()};s.Enum=function(v,u,x,w){if(s.ActiveEnumsCount<s.MaxActiveEnumsCount){s.ActiveEnumsCount++;s.wsman.ExecEnum(s.CompleteName(v),function(B,z,y,C,A){r();d(v,y,u,z,C,A)},x,w)}else{s.PendingEnums.push([v,u,x,w])}r()};function d(w,y,u,z,A,B,x){if(A!=200){u(s,w,null,A,B);c(1);return}if(y==null||y.Header.Method!="EnumerateResponse"||!y.Body.EnumerationContext){u(s,w,null,603,B);c(1);return}var v=y.Body.EnumerationContext;s.wsman.ExecPull(z,v,function(E,D,C,F){b(w,C,u,D,[],F,B,x)})}function b(z,B,u,C,x,D,E,A){if(D!=200){u(s,z,null,D,E);c(1);return}if(B==null||B.Header.Method!="PullResponse"){u(s,z,null,604,E);c(1);return}for(var w in B.Body.Items){if(B.Body.Items[w] instanceof Array){for(var y in B.Body.Items[w]){x.push(B.Body.Items[w][y])}}else{x.push(B.Body.Items[w])}}if(B.Body.EnumerationContext){var v=B.Body.EnumerationContext;s.wsman.ExecPull(C,v,function(H,G,F,I){b(z,F,u,G,x,I,E,1)})}else{c(1);u(s,z,x,D,E);r()}}function c(u){s.ActiveEnumsCount-=u;if(s.ActiveEnumsCount>=s.MaxActiveEnumsCount||s.PendingEnums.length==0){return}var v=s.PendingEnums.shift();s.Enum(v[0],v[1],v[2]);c(0)}s.BatchEnum=function(u,x,v,z,w,y){s.PendingBatchOperations+=(x.length*2);a(u,Clone(x),v,z,{},w,y);r()};function a(u,z,v,C,B,w,A){s.PendingBatchOperations-=2;var y=z.shift(),x=s.Enum;if(y[0]=="*"){x=s.Get;y=y.substring(1)}x(y,function(F,D,E,G,H){H[2][D]={response:(E==null?null:E.Body),responses:E,status:G};if(H[1].length==0||G==401||(w!=true&&G!=200&&G!=400)){s.PendingBatchOperations-=(z.length*2);r();v(s,u,H[2],G,C)}else{r();a(u,z,v,C,H[2],A)}},[u,z,B],A);r()}s.BatchGet=function(u,w,v,y,x){h({name:u,names:w,callback:v,current:0,responses:{},tag:y,pri:x});r()};function h(u){if(u.names.length<=u.current){u.callback(s,u.name,u.responses,200,u.tag)}else{s.wsman.ExecGet(s.CompleteName(u.names[u.current]),function(x,w,v,y){g(u,v,y)},u.pri);u.current++}r()}function g(u,v,w){if(v==null||w!=200){u.callback(s,u.name,null,w,u.tag)}else{u.responses[v.Header.Method]=v;h(u)}}s.CompleteName=function(u){if(u.indexOf("AMT_")==0){return s.pfx[0]+u}if(u.indexOf("CIM_")==0){return s.pfx[1]+u}if(u.indexOf("IPS_")==0){return s.pfx[2]+u}};s.CompleteExecResponse=function(u){if(u&&u!=null&&u.Body&&u.Body.ReturnValue){u.Body.ReturnValueStr=s.AmtStatusToStr(u.Body.ReturnValue)}return u};s.RequestPowerStateChange=function(v,u){s.CIM_PowerManagementService_RequestPowerStateChange(v,'<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>',null,null,u)};s.SetBootConfigRole=function(v,u){s.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>',v,u)};s.CancelAllQueries=function(u){s.wsman.CancelAllQueries(u)};s.AMT_AgentPresenceWatchdog_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdog","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdog_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdog","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdog_AddAction=function(z,y,x,v,u,w,C,A,B){s.Exec("AMT_AgentPresenceWatchdog","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w,C,A,B)};s.AMT_AgentPresenceWatchdog_DeleteAllActions=function(u,x,v,w){s.Exec("AMT_AgentPresenceWatchdog","DeleteAllActions",{},u,x,v,w)};s.AMT_AgentPresenceWatchdogAction_GetActionEac=function(u){s.Exec("AMT_AgentPresenceWatchdogAction","GetActionEac",{},u)};s.AMT_AgentPresenceWatchdogVA_RegisterAgent=function(u){s.Exec("AMT_AgentPresenceWatchdogVA","RegisterAgent",{},u)};s.AMT_AgentPresenceWatchdogVA_AssertPresence=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertPresence",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AssertShutdown=function(v,u){s.Exec("AMT_AgentPresenceWatchdogVA","AssertShutdown",{SequenceNumber:v},u)};s.AMT_AgentPresenceWatchdogVA_AddAction=function(z,y,x,v,u,w){s.Exec("AMT_AgentPresenceWatchdogVA","AddAction",{OldState:z,NewState:y,EventOnTransition:x,ActionSd:v,ActionEac:u},w)};s.AMT_AgentPresenceWatchdogVA_DeleteAllActions=function(u,v){s.Exec("AMT_AgentPresenceWatchdogVA","DeleteAllActions",{_method_dummy:u},v)};s.AMT_AuditLog_ClearLog=function(u){s.Exec("AMT_AuditLog","ClearLog",{},u)};s.AMT_AuditLog_RequestStateChange=function(v,w,u){s.Exec("AMT_AuditLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_AuditLog_ReadRecords=function(v,u,w){s.Exec("AMT_AuditLog","ReadRecords",{StartIndex:v},u,w)};s.AMT_AuditLog_SetAuditLock=function(x,v,w,u){s.Exec("AMT_AuditLog","SetAuditLock",{LockTimeoutInSeconds:x,Flag:v,Handle:w},u)};s.AMT_AuditLog_ExportAuditLogSignature=function(v,u){s.Exec("AMT_AuditLog","ExportAuditLogSignature",{SigningMechanism:v},u)};s.AMT_AuditLog_SetSigningKeyMaterial=function(y,x,w,v,u){s.Exec("AMT_AuditLog","SetSigningKeyMaterial",{SigningMechanismType:y,SigningKey:x,LengthOfCertificates:w,Certificates:v},u)};s.AMT_AuditPolicyRule_SetAuditPolicy=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicy",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuditPolicyRule_SetAuditPolicyBulk=function(w,u,x,y,v){s.Exec("AMT_AuditPolicyRule","SetAuditPolicyBulk",{Enable:w,AuditedAppID:u,EventID:x,PolicyType:y},v)};s.AMT_AuthorizationService_AddUserAclEntryEx=function(x,w,y,u,z,v){s.Exec("AMT_AuthorizationService","AddUserAclEntryEx",{DigestUsername:x,DigestPassword:w,KerberosUserSid:y,AccessPermission:u,Realms:z},v)};s.AMT_AuthorizationService_EnumerateUserAclEntries=function(v,u){s.Exec("AMT_AuthorizationService","EnumerateUserAclEntries",{StartIndex:v},u)};s.AMT_AuthorizationService_GetUserAclEntryEx=function(v,u,w){s.Exec("AMT_AuthorizationService","GetUserAclEntryEx",{Handle:v},u,w)};s.AMT_AuthorizationService_UpdateUserAclEntryEx=function(y,x,w,z,u,A,v){s.Exec("AMT_AuthorizationService","UpdateUserAclEntryEx",{Handle:y,DigestUsername:x,DigestPassword:w,KerberosUserSid:z,AccessPermission:u,Realms:A},v)};s.AMT_AuthorizationService_RemoveUserAclEntry=function(v,u){s.Exec("AMT_AuthorizationService","RemoveUserAclEntry",{Handle:v},u)};s.AMT_AuthorizationService_SetAdminAclEntryEx=function(w,v,u){s.Exec("AMT_AuthorizationService","SetAdminAclEntryEx",{Username:w,DigestPassword:v},u)};s.AMT_AuthorizationService_GetAdminAclEntry=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntry",{},u)};s.AMT_AuthorizationService_GetAdminAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminAclEntryStatus",{},u)};s.AMT_AuthorizationService_GetAdminNetAclEntryStatus=function(u){s.Exec("AMT_AuthorizationService","GetAdminNetAclEntryStatus",{},u)};s.AMT_AuthorizationService_SetAclEnabledState=function(w,v,u,x){s.Exec("AMT_AuthorizationService","SetAclEnabledState",{Handle:w,Enabled:v},u,x)};s.AMT_AuthorizationService_GetAclEnabledState=function(v,u,w){s.Exec("AMT_AuthorizationService","GetAclEnabledState",{Handle:v},u,w)};s.AMT_EndpointAccessControlService_RequestStateChange=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_EndpointAccessControlService_GetPosture=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPosture",{PostureType:v},u)};s.AMT_EndpointAccessControlService_GetPostureHash=function(v,u){s.Exec("AMT_EndpointAccessControlService","GetPostureHash",{PostureType:v},u)};s.AMT_EndpointAccessControlService_UpdatePostureState=function(v,u){s.Exec("AMT_EndpointAccessControlService","UpdatePostureState",{UpdateType:v},u)};s.AMT_EndpointAccessControlService_GetEacOptions=function(u){s.Exec("AMT_EndpointAccessControlService","GetEacOptions",{},u)};s.AMT_EndpointAccessControlService_SetEacOptions=function(v,w,u){s.Exec("AMT_EndpointAccessControlService","SetEacOptions",{EacVendors:v,PostureHashAlgorithm:w},u)};s.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","SetSystemDefensePolicy",{Policy:v},u)};s.AMT_EnvironmentDetectionSettingData_EnableVpnRouting=function(v,u){s.Exec("AMT_EnvironmentDetectionSettingData","EnableVpnRouting",{Enable:v},u)};s.AMT_EthernetPortSettings_SetLinkPreference=function(v,w,u){s.Exec("AMT_EthernetPortSettings","SetLinkPreference",{LinkPreference:v,Timeout:w},u)};s.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats=function(v,u){s.Exec("AMT_HeuristicPacketFilterStatistics","ResetSelectedStats",{SelectedStatistics:v},u)};s.AMT_KerberosSettingData_GetCredentialCacheState=function(u){s.Exec("AMT_KerberosSettingData","GetCredentialCacheState",{},u)};s.AMT_KerberosSettingData_SetCredentialCacheState=function(v,u){s.Exec("AMT_KerberosSettingData","SetCredentialCacheState",{Enable:v},u)};s.AMT_MessageLog_CancelIteration=function(v,u){s.Exec("AMT_MessageLog","CancelIteration",{IterationIdentifier:v},u)};s.AMT_MessageLog_RequestStateChange=function(v,w,u){s.Exec("AMT_MessageLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_MessageLog_ClearLog=function(u){s.Exec("AMT_MessageLog","ClearLog",{},u)};s.AMT_MessageLog_GetRecords=function(v,w,u,x){s.Exec("AMT_MessageLog","GetRecords",{IterationIdentifier:v,MaxReadRecords:w},u,x)};s.AMT_MessageLog_GetRecord=function(v,w,u){s.Exec("AMT_MessageLog","GetRecord",{IterationIdentifier:v,PositionToNext:w},u)};s.AMT_MessageLog_PositionAtRecord=function(v,w,x,u){s.Exec("AMT_MessageLog","PositionAtRecord",{IterationIdentifier:v,MoveAbsolute:w,RecordNumber:x},u)};s.AMT_MessageLog_PositionToFirstRecord=function(u,v){s.Exec("AMT_MessageLog","PositionToFirstRecord",{},u,v)};s.AMT_MessageLog_FreezeLog=function(v,u){s.Exec("AMT_MessageLog","FreezeLog",{Freeze:v},u)};s.AMT_PublicKeyManagementService_AddCRL=function(w,v,u){s.Exec("AMT_PublicKeyManagementService","AddCRL",{Url:w,SerialNumbers:v},u)};s.AMT_PublicKeyManagementService_ResetCRLList=function(u,v){s.Exec("AMT_PublicKeyManagementService","ResetCRLList",{_method_dummy:u},v)};s.AMT_PublicKeyManagementService_AddCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddTrustedRootCertificate=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddTrustedRootCertificate",{CertificateBlob:v},u)};s.AMT_PublicKeyManagementService_AddKey=function(v,u){s.Exec("AMT_PublicKeyManagementService","AddKey",{KeyBlob:v},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10Request=function(w,v,x,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10Request",{KeyPair:w,DNName:v,Usage:x},u)};s.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx=function(v,x,w,u){s.Exec("AMT_PublicKeyManagementService","GeneratePKCS10RequestEx",{KeyPair:v,SigningAlgorithm:x,NullSignedCertificateRequest:w},u)};s.AMT_PublicKeyManagementService_GenerateKeyPair=function(v,w,u){s.Exec("AMT_PublicKeyManagementService","GenerateKeyPair",{KeyAlgorithm:v,KeyLength:w},u)};s.AMT_RedirectionService_RequestStateChange=function(v,u){s.Exec("AMT_RedirectionService","RequestStateChange",{RequestedState:v},u)};s.AMT_RedirectionService_TerminateSession=function(v,u){s.Exec("AMT_RedirectionService","TerminateSession",{SessionType:v},u)};s.AMT_RemoteAccessService_AddMpServer=function(u,z,B,v,x,C,A,y,w){s.Exec("AMT_RemoteAccessService","AddMpServer",{AccessInfo:u,InfoFormat:z,Port:B,AuthMethod:v,Certificate:x,Username:C,Password:A,CN:y},w)};s.AMT_RemoteAccessService_AddRemoteAccessPolicyRule=function(x,y,v,w,u){s.Exec("AMT_RemoteAccessService","AddRemoteAccessPolicyRule",{Trigger:x,TunnelLifeTime:y,ExtendedData:v,MpServer:w},u)};s.AMT_RemoteAccessService_CloseRemoteAccessConnection=function(u,v){s.Exec("AMT_RemoteAccessService","CloseRemoteAccessConnection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_CommitChanges=function(u,v){s.Exec("AMT_SetupAndConfigurationService","CommitChanges",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_Unprovision=function(v,u){s.Exec("AMT_SetupAndConfigurationService","Unprovision",{ProvisioningMode:v},u)};s.AMT_SetupAndConfigurationService_PartialUnprovision=function(u,v){s.Exec("AMT_SetupAndConfigurationService","PartialUnprovision",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection=function(u,v){s.Exec("AMT_SetupAndConfigurationService","ResetFlashWearOutProtection",{_method_dummy:u},v)};s.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod=function(v,u){s.Exec("AMT_SetupAndConfigurationService","ExtendProvisioningPeriod",{Duration:v},u)};s.AMT_SetupAndConfigurationService_SetMEBxPassword=function(v,u){s.Exec("AMT_SetupAndConfigurationService","SetMEBxPassword",{Password:v},u)};s.AMT_SetupAndConfigurationService_SetTLSPSK=function(v,w,u){s.Exec("AMT_SetupAndConfigurationService","SetTLSPSK",{PID:v,PPS:w},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecord",{},u)};s.AMT_SetupAndConfigurationService_GetUuid=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUuid",{},u)};s.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents=function(u){s.Exec("AMT_SetupAndConfigurationService","GetUnprovisionBlockingComponents",{},u)};s.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2=function(u){s.Exec("AMT_SetupAndConfigurationService","GetProvisioningAuditRecordV2",{},u)};s.AMT_SystemDefensePolicy_GetTimeout=function(u){s.Exec("AMT_SystemDefensePolicy","GetTimeout",{},u)};s.AMT_SystemDefensePolicy_SetTimeout=function(v,u){s.Exec("AMT_SystemDefensePolicy","SetTimeout",{Timeout:v},u)};s.AMT_SystemDefensePolicy_UpdateStatistics=function(v,x,u,z,w,y){s.Exec("AMT_SystemDefensePolicy","UpdateStatistics",{NetworkInterface:v,ResetOnRead:x},u,z,w,y)};s.AMT_SystemPowerScheme_SetPowerScheme=function(u,v,w){s.Exec("AMT_SystemPowerScheme","SetPowerScheme",{},u,w,0,{InstanceID:v})};s.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch=function(u,v){s.Exec("AMT_TimeSynchronizationService","GetLowAccuracyTimeSynch",{},u,v)};s.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch=function(v,x,y,u,w){s.Exec("AMT_TimeSynchronizationService","SetHighAccuracyTimeSynch",{Ta0:v,Tm1:x,Tm2:y},u,w)};s.AMT_UserInitiatedConnectionService_RequestStateChange=function(v,w,u){s.Exec("AMT_UserInitiatedConnectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WebUIService_RequestStateChange=function(v,w,u){s.Exec("AMT_WebUIService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AMT_WiFiPortConfigurationService_AddWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","AddWiFiSettings",{WiFiEndpoint:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_UpdateWiFiSettings=function(y,z,x,w,u,v){s.ExecWithXml("AMT_WiFiPortConfigurationService","UpdateWiFiSettings",{WiFiEndpointSettings:y,WiFiEndpointSettingsInput:z,IEEE8021xSettingsInput:x,ClientCredential:w,CACredential:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllITProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllITProfiles",{_method_dummy:u},v)};s.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles=function(u,v){s.Exec("AMT_WiFiPortConfigurationService","DeleteAllUserProfiles",{_method_dummy:u},v)};s.CIM_Account_RequestStateChange=function(v,w,u){s.Exec("CIM_Account","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_AccountManagementService_CreateAccount=function(w,u,v){s.Exec("CIM_AccountManagementService","CreateAccount",{System:w,AccountTemplate:u},v)};s.CIM_BootConfigSetting_ChangeBootOrder=function(v,u){s.Exec("CIM_BootConfigSetting","ChangeBootOrder",{Source:v},u)};s.CIM_BootService_SetBootConfigRole=function(u,w,v){s.Exec("CIM_BootService","SetBootConfigRole",{BootConfigSetting:u,Role:w},v,0,1)};s.CIM_Card_ConnectorPower=function(v,w,u){s.Exec("CIM_Card","ConnectorPower",{Connector:v,PoweredOn:w},u)};s.CIM_Card_IsCompatible=function(v,u){s.Exec("CIM_Card","IsCompatible",{ElementToCheck:v},u)};s.CIM_Chassis_IsCompatible=function(v,u){s.Exec("CIM_Chassis","IsCompatible",{ElementToCheck:v},u)};s.CIM_Fan_SetSpeed=function(v,u){s.Exec("CIM_Fan","SetSpeed",{DesiredSpeed:v},u)};s.CIM_KVMRedirectionSAP_RequestStateChange=function(v,w,u){s.Exec("CIM_KVMRedirectionSAP","RequestStateChange",{RequestedState:v},u)};s.CIM_MediaAccessDevice_LockMedia=function(v,u){s.Exec("CIM_MediaAccessDevice","LockMedia",{Lock:v},u)};s.CIM_MediaAccessDevice_SetPowerState=function(v,w,u){s.Exec("CIM_MediaAccessDevice","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_MediaAccessDevice_Reset=function(u){s.Exec("CIM_MediaAccessDevice","Reset",{},u)};s.CIM_MediaAccessDevice_EnableDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","EnableDevice",{Enabled:v},u)};s.CIM_MediaAccessDevice_OnlineDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","OnlineDevice",{Online:v},u)};s.CIM_MediaAccessDevice_QuiesceDevice=function(v,u){s.Exec("CIM_MediaAccessDevice","QuiesceDevice",{Quiesce:v},u)};s.CIM_MediaAccessDevice_SaveProperties=function(u){s.Exec("CIM_MediaAccessDevice","SaveProperties",{},u)};s.CIM_MediaAccessDevice_RestoreProperties=function(u){s.Exec("CIM_MediaAccessDevice","RestoreProperties",{},u)};s.CIM_MediaAccessDevice_RequestStateChange=function(v,w,u){s.Exec("CIM_MediaAccessDevice","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_PhysicalFrame_IsCompatible=function(v,u){s.Exec("CIM_PhysicalFrame","IsCompatible",{ElementToCheck:v},u)};s.CIM_PhysicalPackage_IsCompatible=function(v,u){s.Exec("CIM_PhysicalPackage","IsCompatible",{ElementToCheck:v},u)};s.CIM_PowerManagementService_RequestPowerStateChange=function(w,v,x,y,u){s.Exec("CIM_PowerManagementService","RequestPowerStateChange",{PowerState:w,ManagedElement:v,Time:x,TimeoutPeriod:y},u,0,1)};s.CIM_PowerSupply_SetPowerState=function(v,w,u){s.Exec("CIM_PowerSupply","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_PowerSupply_Reset=function(u){s.Exec("CIM_PowerSupply","Reset",{},u)};s.CIM_PowerSupply_EnableDevice=function(v,u){s.Exec("CIM_PowerSupply","EnableDevice",{Enabled:v},u)};s.CIM_PowerSupply_OnlineDevice=function(v,u){s.Exec("CIM_PowerSupply","OnlineDevice",{Online:v},u)};s.CIM_PowerSupply_QuiesceDevice=function(v,u){s.Exec("CIM_PowerSupply","QuiesceDevice",{Quiesce:v},u)};s.CIM_PowerSupply_SaveProperties=function(u){s.Exec("CIM_PowerSupply","SaveProperties",{},u)};s.CIM_PowerSupply_RestoreProperties=function(u){s.Exec("CIM_PowerSupply","RestoreProperties",{},u)};s.CIM_PowerSupply_RequestStateChange=function(v,w,u){s.Exec("CIM_PowerSupply","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Processor_SetPowerState=function(v,w,u){s.Exec("CIM_Processor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Processor_Reset=function(u){s.Exec("CIM_Processor","Reset",{},u)};s.CIM_Processor_EnableDevice=function(v,u){s.Exec("CIM_Processor","EnableDevice",{Enabled:v},u)};s.CIM_Processor_OnlineDevice=function(v,u){s.Exec("CIM_Processor","OnlineDevice",{Online:v},u)};s.CIM_Processor_QuiesceDevice=function(v,u){s.Exec("CIM_Processor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Processor_SaveProperties=function(u){s.Exec("CIM_Processor","SaveProperties",{},u)};s.CIM_Processor_RestoreProperties=function(u){s.Exec("CIM_Processor","RestoreProperties",{},u)};s.CIM_Processor_RequestStateChange=function(v,w,u){s.Exec("CIM_Processor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RecordLog_ClearLog=function(u){s.Exec("CIM_RecordLog","ClearLog",{},u)};s.CIM_RecordLog_RequestStateChange=function(v,w,u){s.Exec("CIM_RecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_RedirectionService_RequestStateChange=function(v,w,u){s.Exec("CIM_RedirectionService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_Sensor_SetPowerState=function(v,w,u){s.Exec("CIM_Sensor","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Sensor_Reset=function(u){s.Exec("CIM_Sensor","Reset",{},u)};s.CIM_Sensor_EnableDevice=function(v,u){s.Exec("CIM_Sensor","EnableDevice",{Enabled:v},u)};s.CIM_Sensor_OnlineDevice=function(v,u){s.Exec("CIM_Sensor","OnlineDevice",{Online:v},u)};s.CIM_Sensor_QuiesceDevice=function(v,u){s.Exec("CIM_Sensor","QuiesceDevice",{Quiesce:v},u)};s.CIM_Sensor_SaveProperties=function(u){s.Exec("CIM_Sensor","SaveProperties",{},u)};s.CIM_Sensor_RestoreProperties=function(u){s.Exec("CIM_Sensor","RestoreProperties",{},u)};s.CIM_Sensor_RequestStateChange=function(v,w,u){s.Exec("CIM_Sensor","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_StatisticalData_ResetSelectedStats=function(v,u){s.Exec("CIM_StatisticalData","ResetSelectedStats",{SelectedStatistics:v},u)};s.CIM_Watchdog_KeepAlive=function(u){s.Exec("CIM_Watchdog","KeepAlive",{},u)};s.CIM_Watchdog_SetPowerState=function(v,w,u){s.Exec("CIM_Watchdog","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_Watchdog_Reset=function(u){s.Exec("CIM_Watchdog","Reset",{},u)};s.CIM_Watchdog_EnableDevice=function(v,u){s.Exec("CIM_Watchdog","EnableDevice",{Enabled:v},u)};s.CIM_Watchdog_OnlineDevice=function(v,u){s.Exec("CIM_Watchdog","OnlineDevice",{Online:v},u)};s.CIM_Watchdog_QuiesceDevice=function(v,u){s.Exec("CIM_Watchdog","QuiesceDevice",{Quiesce:v},u)};s.CIM_Watchdog_SaveProperties=function(u){s.Exec("CIM_Watchdog","SaveProperties",{},u)};s.CIM_Watchdog_RestoreProperties=function(u){s.Exec("CIM_Watchdog","RestoreProperties",{},u)};s.CIM_Watchdog_RequestStateChange=function(v,w,u){s.Exec("CIM_Watchdog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.CIM_WiFiPort_SetPowerState=function(v,w,u){s.Exec("CIM_WiFiPort","SetPowerState",{PowerState:v,Time:w},u)};s.CIM_WiFiPort_Reset=function(u){s.Exec("CIM_WiFiPort","Reset",{},u)};s.CIM_WiFiPort_EnableDevice=function(v,u){s.Exec("CIM_WiFiPort","EnableDevice",{Enabled:v},u)};s.CIM_WiFiPort_OnlineDevice=function(v,u){s.Exec("CIM_WiFiPort","OnlineDevice",{Online:v},u)};s.CIM_WiFiPort_QuiesceDevice=function(v,u){s.Exec("CIM_WiFiPort","QuiesceDevice",{Quiesce:v},u)};s.CIM_WiFiPort_SaveProperties=function(u){s.Exec("CIM_WiFiPort","SaveProperties",{},u)};s.CIM_WiFiPort_RestoreProperties=function(u){s.Exec("CIM_WiFiPort","RestoreProperties",{},u)};s.CIM_WiFiPort_RequestStateChange=function(v,w,u){s.Exec("CIM_WiFiPort","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_HostBasedSetupService_Setup=function(y,z,x,v,A,w,u){s.Exec("IPS_HostBasedSetupService","Setup",{NetAdminPassEncryptionType:y,NetworkAdminPassword:z,McNonce:x,Certificate:v,SigningAlgorithm:A,DigitalSignature:w},u)};s.IPS_HostBasedSetupService_AddNextCertInChain=function(x,v,w,u){s.Exec("IPS_HostBasedSetupService","AddNextCertInChain",{NextCertificate:x,IsLeafCertificate:v,IsRootCertificate:w},u)};s.IPS_HostBasedSetupService_AdminSetup=function(x,y,w,z,v,u){s.Exec("IPS_HostBasedSetupService","AdminSetup",{NetAdminPassEncryptionType:x,NetworkAdminPassword:y,McNonce:w,SigningAlgorithm:z,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_UpgradeClientToAdmin=function(w,x,v,u){s.Exec("IPS_HostBasedSetupService","UpgradeClientToAdmin",{McNonce:w,SigningAlgorithm:x,DigitalSignature:v},u)};s.IPS_HostBasedSetupService_DisableClientControlMode=function(u,v){s.Exec("IPS_HostBasedSetupService","DisableClientControlMode",{_method_dummy:u},v)};s.IPS_KVMRedirectionSettingData_TerminateSession=function(u){s.Exec("IPS_KVMRedirectionSettingData","TerminateSession",{},u)};s.IPS_OptInService_StartOptIn=function(u){s.Exec("IPS_OptInService","StartOptIn",{},u)};s.IPS_OptInService_CancelOptIn=function(u){s.Exec("IPS_OptInService","CancelOptIn",{},u)};s.IPS_OptInService_SendOptInCode=function(v,u){s.Exec("IPS_OptInService","SendOptInCode",{OptInCode:v},u)};s.IPS_OptInService_StartService=function(u){s.Exec("IPS_OptInService","StartService",{},u)};s.IPS_OptInService_StopService=function(u){s.Exec("IPS_OptInService","StopService",{},u)};s.IPS_OptInService_RequestStateChange=function(v,w,u){s.Exec("IPS_OptInService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_RequestStateChange=function(v,w,u){s.Exec("IPS_ProvisioningRecordLog","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.IPS_ProvisioningRecordLog_ClearLog=function(u,v){s.Exec("IPS_ProvisioningRecordLog","ClearLog",{_method_dummy:u},v)};s.IPS_SecIOService_RequestStateChange=function(v,w,u){s.Exec("IPS_SecIOService","RequestStateChange",{RequestedState:v,TimeoutPeriod:w},u)};s.AmtStatusToStr=function(u){if(s.AmtStatusCodes[u]){return s.AmtStatusCodes[u]}else{return"UNKNOWN_ERROR"}};s.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",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",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",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",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"};s.GetMessageLog=function(u,v){s.AMT_MessageLog_PositionToFirstRecord(k,[u,v,[]])};function k(w,u,v,x,y){if(x!=200||v.Body.ReturnValue!="0"){y[0](s,null,y[2]);return}s.AMT_MessageLog_GetRecords(v.Body.IterationIdentifier,390,l,y)}function l(D,A,C,E,G){if(E!=200||C.Body.ReturnValue!="0"){G[0](s,null,G[2]);return}var y,z,I,v,u=G[2],F=new Date(),H,B=C.Body.RecordArray;if(typeof B==="string"){C.Body.RecordArray=[C.Body.RecordArray]}for(y in B){v=null;try{v=window.atob(B[y])}catch(w){}if(v!=null){H=ReadIntX(v,0);if((H>0)&&(H<4294967295)){I={DeviceAddress:v.charCodeAt(4),EventSensorType:v.charCodeAt(5),EventType:v.charCodeAt(6),EventOffset:v.charCodeAt(7),EventSourceType:v.charCodeAt(8),EventSeverity:v.charCodeAt(9),SensorNumber:v.charCodeAt(10),Entity:v.charCodeAt(11),EntityInstance:v.charCodeAt(12),EventData:[],Time:new Date((H+(F.getTimezoneOffset()*60))*1000)};for(z=13;z<21;z++){I.EventData.push(v.charCodeAt(z))}I.EntityStr=o[I.Entity];I.Desc=j(I.EventSensorType,I.EventOffset,I.EventData,I.Entity);if(!I.EntityStr){I.EntityStr="Unknown"}u.push(I)}}}if(C.Body.NoMoreRecords!=true){s.AMT_MessageLog_GetRecords(C.Body.IterationIdentifier,390,l,[G[0],u,G[2]])}else{G[0](s,u,G[2])}}var e="Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split("|");var p="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("|");var q="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("|");var o="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("|");s.RealmNames="||Redirection|PT Administration|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("|");s.WatchdogCurrentStates={1:"Not Started",2:"Stopped",4:"Running",8:"Expired",16:"Suspended"};function j(x,w,v,u){if(x==15){if(v[0]==235){return"Invalid Data"}if(w==0){return p[v[1]]}return q[v[1]]}if(x==18&&v[0]==170){return"Agent watchdog "+char2hex(v[4])+char2hex(v[3])+char2hex(v[2])+char2hex(v[1])+"-"+char2hex(v[6])+char2hex(v[5])+"-... changed to "+s.WatchdogCurrentStates[v[7]]}if(x==6){return"Authentication failed "+(v[1]+(v[2]<<8))+" times. The system may be under attack."}if(x==30){return"No bootable media"}if(x==32){return"Operating system lockup or power interrupt"}if(x==35){return"System boot failure"}if(x==37){return"System firmware started (at least one CPU is properly executing)."}return"Unknown Sensor Type #"+x}return s}var md5_k=[];for(var i=0;i<64;){md5_k[i]=0|(Math.abs(Math.sin(++i))*4294967296)}function hex_md5(p){var g,k,l,o,r=[],q=unescape(encodeURI(p)),e=q.length,m=[g=1732584193,k=-271733879,~g,~k],n=0;for(;n<=e;){r[n>>2]|=(q.charCodeAt(n)||128)<<8*(n++%4)}r[p=(e+8>>6)*16+14]=e*8;n=0;for(;n<p;n+=16){e=m;o=0;for(;o<64;){e=[l=e[3],((g=e[1]|0)+((l=((e[0]+[g&(k=e[2])|~g&l,l&g|~l&k,g^k^l,k^(g|~l)][e=o>>4])+(md5_k[o]+(r[[o,5*o+1,3*o+5,7*o][e]%16+n]|0))))<<(e=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*e+o++%4])|l>>>32-e)),g,k]}for(o=4;o;){m[--o]=m[o]+e[o]}}p="";for(;o<32;){p+=((m[o>>3]>>((1^o++&7)*4))&15).toString(16)}return p}function rstr_md5(a){return hex2rstr(hex_md5(a))}function execArgumentsToXml(c){if(c===undefined||c===null){return null}var d="";for(var b in c){var a=c[b];if(!a){continue}if(a.__parameterType==="reference"){d+=referenceToXml(b,a)}else{d+=instanceToXml(b,a)}}return d}function instanceToXml(d,c){if(c===undefined||c===null){return null}var b=!!c.__namespace;var j=b?"<q:":"<";var a=b?"</q:":"</";var e=b?(' xmlns:q="'+c.__namespace+'"'):"";var h="<r:"+d+e+">";for(var g in c){if(!c.hasOwnProperty(g)||g.indexOf("__")===0){continue}if(typeof c[g]==="function"||Array.isArray(c[g])){continue}if(typeof c[g]==="object"){console.error("only convert one level down...")}else{h+=j+g+">"+c[g].toString()+a+g+">"}}h+="</r:"+d+">";return h}function referenceToXml(b,a){if(a===undefined||a===null){return null}var c="<r:"+b+"><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>"+a.__resourceUri+"</w:ResourceURI><w:SelectorSet>";for(var d in a){if(!a.hasOwnProperty(d)||d.indexOf("__")===0){continue}if(typeof a[d]==="function"||typeof a[d]==="object"||Array.isArray(a[d])){continue}c+='<w:Selector Name="'+d+'">'+a[d].toString()+"</w:Selector>"}c+="</w:SelectorSet></a:ReferenceParameters></r:"+b+">";return c}function GetSidString(c){var b="S-"+c.charCodeAt(0)+"-"+c.charCodeAt(7);for(var a=2;a<(c.length/4);a++){b+="-"+ReadIntX(c,a*4)}return b}function GetSidByteArray(d){if(!d||d==null){return null}var c=d.split("-");if(c.length<4||(c[0]!="s"&&c[0]!="S")){return null}for(var a=1;a<c.length;a++){var e=parseInt(c[a]);if(e!=c[a]){return null}c[a]=e}var b=String.fromCharCode(c[1])+String.fromCharCode(c.length-3)+ShortToStr(Math.floor(c[2]/Math.pow(2,32)))+IntToStr((c[2])&65535);for(var a=3;a<c.length;a++){b+=IntToStrX(c[a])}return b}var WsmanStackCreateService=function(h,l,n,k,m,g){var j={};j.NextMessageId=1;j.Address="/wsman";j.comm=CreateWsmanComm(h,l,n,k,m,g);j.PerformAjax=function(q,o,s,r,p){if(p==undefined){p=""}j.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" '+p+"><Header><a:Action>"+q,function(t,u,v){if(u!=200){o(j,null,{Header:{HttpError:u}},u,v);return}var w=j.ParseWsman(t);if(!w||w==null){o(j,null,{Header:{HttpError:u}},601,v)}else{o(j,w.Header.ResourceURI,w,200,v)}},s,r)};j.CancelAllQueries=function(o){j.comm.CancelAllQueries(o)};j.GetNameFromUrl=function(o){var p=o.lastIndexOf("/");return(p==-1)?o:o.substring(p+1)};j.ExecSubscribe=function(w,q,z,o,y,v,x,t,A,u){var r="",s="";if(A!=undefined&&u!=undefined){r="<t:IssuedTokens><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>"+A+'</se:Username><se:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd#PasswordText">'+u+"</se:Password></se:UsernameToken></t:RequestedSecurityToken></t:RequestSecurityTokenResponse></t:IssuedTokens>";s='<Auth Profile="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryModes/secprofile/http/digest"/>'}if(t!=undefined&&t!=null){t="<a:ReferenceParameters>"+t+"</a:ReferenceParameters>"}else{t=""}var p="http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+w+"</w:ResourceURI><a:MessageID>"+(j.NextMessageId++)+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(x)+r+'</Header><Body><e:Subscribe><e:Delivery Mode="http://schemas.dmtf.org/wbem/wsman/1/wsman/'+q+'"><e:NotifyTo><a:Address>'+z+"</a:Address></e:NotifyTo>"+s+"</e:Delivery><e:Expires>PT0.000000S</e:Expires></e:Subscribe>";j.PerformAjax(p+"</Body></Envelope>",o,y,v,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" 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" xmlns:m="http://x.com"')};j.ExecUnSubscribe=function(r,o,t,q,s){var p="http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+r+"</w:ResourceURI><a:MessageID>"+(j.NextMessageId++)+"</a:MessageID><a:ReplyTo><a:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:Address></a:ReplyTo>"+d(s)+"</Header><Body><e:Unsubscribe/>";j.PerformAjax(p+"</Body></Envelope>",o,t,q,'xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing"')};j.ExecPut=function(s,r,o,u,q,t){var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Put</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(t)+"</Header><Body>"+c(s,r);j.PerformAjax(p+"</Body></Envelope>",o,u,q)};j.ExecCreate=function(u,t,o,w,s,v){var r=j.GetNameFromUrl(u);var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+u+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(v)+"</Header><Body><g:"+r+' xmlns:g="'+u+'">';for(var q in t){p+="<g:"+q+">"+t[q]+"</g:"+q+">"}j.PerformAjax(p+"</g:"+r+"></Body></Envelope>",o,w,s)};j.ExecCreateXml=function(s,o,p,u,r){var q=j.GetNameFromUrl(s),t="";j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Create</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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></Header><Body><r:"+q+' xmlns:r="'+s+'">'+o+"</r:"+q+"></Body></Envelope>",p,u,r)};j.ExecDelete=function(s,r,o,t,q){var p="http://schemas.xmlsoap.org/ws/2004/09/transfer/Delete</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(r)+"</Header><Body /></Envelope>";j.PerformAjax(p,o,t,q)};j.ExecGet=function(q,o,r,p){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/transfer/Get</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+q+"</w:ResourceURI><a:MessageID>"+(j.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>",o,r,p)};j.ExecMethod=function(u,s,o,q,w,t,v){var p="";for(var r in o){if(o[r]!=null){if(Array.isArray(o[r])){for(var y in o[r]){p+="<r:"+r+">"+o[r][y]+"</r:"+r+">"}}else{p+="<r:"+r+">"+o[r]+"</r:"+r+">"}}}j.ExecMethodXml(u,s,p,q,w,t,v)};j.ExecMethodXml=function(s,q,o,p,u,r,t){j.PerformAjax(s+"/"+q+"</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+s+"</w:ResourceURI><a:MessageID>"+(j.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>"+d(t)+"</Header><Body><r:"+q+'_INPUT xmlns:r="'+s+'">'+o+"</r:"+q+"_INPUT></Body></Envelope>",p,u,r)};j.ExecEnum=function(q,o,r,p){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Enumerate</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+q+"</w:ResourceURI><a:MessageID>"+(j.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>',o,r,p)};j.ExecPull=function(r,p,o,s,q){j.PerformAjax("http://schemas.xmlsoap.org/ws/2004/09/enumeration/Pull</a:Action><a:To>"+j.Address+"</a:To><w:ResourceURI>"+r+"</w:ResourceURI><a:MessageID>"+(j.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>'+p+"</EnumerationContext><MaxElements>999</MaxElements><MaxCharacters>99999</MaxCharacters></Pull></Body></Envelope>",o,s,q)};j.ParseWsman=function(x){try{if(!x.childNodes){x=e(x)}var v={Header:{}},s=x.getElementsByTagName("Header")[0],w;if(!s){s=x.getElementsByTagName("a:Header")[0]}if(!s){return null}for(var u=0;u<s.childNodes.length;u++){var p=s.childNodes[u];v.Header[p.localName]=p.textContent}var o=x.getElementsByTagName("Body")[0];if(!o){o=x.getElementsByTagName("a:Body")[0]}if(!o){return null}if(o.childNodes.length>0){w=o.childNodes[0].localName;if(w.indexOf("_OUTPUT")==w.length-7){w=w.substring(0,w.length-7)}v.Header.Method=w;v.Body=b(o.childNodes[0])}return v}catch(q){console.log("Unable to parse XML: "+x);return null}};function b(u){var q,v={};for(var s=0;s<u.childNodes.length;s++){var o=u.childNodes[s];if(o.childElementCount==0){q=o.textContent}else{q=b(o)}if(q=="true"){q=true}if(q=="false"){q=false}var p=q;if(o.attributes.length>0){p={Value:q};for(var t=0;t<o.attributes.length;t++){p["@"+o.attributes[t].name]=o.attributes[t].value}}if(v[o.localName] instanceof Array){v[o.localName].push(p)}else{if(v[o.localName]==undefined){v[o.localName]=p}else{v[o.localName]=[v[o.localName],p]}}}return v}function c(t,r){if(!t||r===undefined||r===null){return""}var p=j.GetNameFromUrl(t);var s="<r:"+p+' xmlns:r="'+t+'">';for(var q in r){if(!r.hasOwnProperty(q)||q.indexOf("__")===0||q.indexOf("@")===0){continue}if(r[q]===undefined||r[q]===null||typeof r[q]==="function"){continue}if(typeof r[q]==="object"&&r[q]["ReferenceParameters"]){s+="<r:"+q+"><a:Address>"+r[q].Address+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+r[q]["ReferenceParameters"]["ResourceURI"]+"</w:ResourceURI><w:SelectorSet>";var u=r[q]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(u)){for(var o=0;o<u.length;o++){s+="<w:Selector"+a(u[o])+">"+u[o]["Value"]+"</w:Selector>"}}else{s+="<w:Selector"+a(u)+">"+u.Value+"</w:Selector>"}s+="</w:SelectorSet></a:ReferenceParameters></r:"+q+">"}else{if(Array.isArray(r[q])){for(var o=0;o<r[q].length;o++){s+="<r:"+q+">"+r[q][o].toString()+"</r:"+q+">"}}else{s+="<r:"+q+">"+r[q].toString()+"</r:"+q+">"}}}s+="</r:"+p+">";return s}function a(o){if(!o){return""}var q=" ";for(var p in o){if(!o.hasOwnProperty(p)||p.indexOf("@")!==0){continue}q+=p.substring(1)+'="'+o[p]+'" '}return q}function d(s){if(!s){return""}if(typeof s=="string"){return s}if(s.InstanceID){return'<w:SelectorSet><w:Selector Name="InstanceID">'+s.InstanceID+"</w:Selector></w:SelectorSet>"}var q="<w:SelectorSet>";for(var p in s){if(!s.hasOwnProperty(p)){continue}q+='<w:Selector Name="'+p+'">';if(s[p]["ReferenceParameters"]){q+="<a:EndpointReference>";q+="<a:Address>"+s[p]["Address"]+"</a:Address><a:ReferenceParameters><w:ResourceURI>"+s[p]["ReferenceParameters"]["ResourceURI"]+"</w:ResourceURI><w:SelectorSet>";var r=s[p]["ReferenceParameters"]["SelectorSet"]["Selector"];if(Array.isArray(r)){for(var o=0;o<r.length;o++){q+="<w:Selector"+a(r[o])+">"+r[o]["Value"]+"</w:Selector>"}}else{q+="<w:Selector"+a(r)+">"+r.Value+"</w:Selector>"}q+="</w:SelectorSet></a:ReferenceParameters></a:EndpointReference>"}else{q+=s[p]}q+="</w:Selector>"}q+="</w:SelectorSet>";return q}function e(o){if(window.DOMParser){return new DOMParser().parseFromString(o,"text/xml")}else{var p=new ActiveXObject("Microsoft.XMLDOM");p.async=false;p.loadXML(o);return p}}return j};var CreateAmtRemoteDesktop=function(m,p){var o={};o.canvasid=m;o.CanvasId=Q(m);o.scrolldiv=p;o.canvas=Q(m).getContext("2d");o.protocol=2;o.state=0;o.acc="";o.ScreenWidth=960;o.ScreenHeight=700;o.width=0;o.height=0;o.rwidth=0;o.rheight=0;o.bpp=2;o.useZRLE=true;o.showmouse=true;o.buttonmask=0;o.spare=null;o.sparew=0;o.spareh=0;o.sparew2=0;o.spareh2=0;o.sparecache={};o.ZRLEfirst=1;o.onScreenSizeChange=null;o.frameRateDelay=0;o.kvmDataSupported=false;o.onKvmData=null;o.onKvmDataPending=[];o.onKvmDataAck=-1;o.holding=false;o.lastKeepAlive=Date.now();o.Debug=function(q){console.log(q)};o.xxStateChange=function(q){if(q==0){o.canvas.fillStyle="#000000";o.canvas.fillRect(0,0,o.width,o.height);o.canvas.canvas.width=o.rwidth=o.width=640;o.canvas.canvas.height=o.rheight=o.height=400;QS(o.canvasid).cursor="default"}else{QS(o.canvasid).cursor=o.showmouse?"default":"none"}};o.ProcessData=function(t){if(!t){return}o.acc+=t;while(o.acc.length>0){var q=0;if(o.state==0&&o.acc.length>=12){q=12;o.state=1;o.send("RFB 003.008\n")}else{if(o.state==1&&o.acc.length>=1){q=o.acc.charCodeAt(0)+1;o.send(String.fromCharCode(1));o.state=2}else{if(o.state==2&&o.acc.length>=4){q=4;if(ReadInt(o.acc,0)!=0){return o.Stop()}o.send(String.fromCharCode(1));o.state=3}else{if(o.state==3&&o.acc.length>=24){var D=ReadInt(o.acc,20);if(o.acc.length<24+D){return}q=24+D;o.canvas.canvas.width=o.rwidth=o.width=o.ScreenWidth=ReadShort(o.acc,0);o.canvas.canvas.height=o.rheight=o.height=o.ScreenHeight=ReadShort(o.acc,2);var G="";if(o.useZRLE){G+=IntToStr(16)}G+=IntToStr(0);G+=IntToStr(1092);o.send(String.fromCharCode(2,0)+ShortToStr((G.length/4)+1)+G+IntToStr(-223));if(o.bpp==1){o.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))}o.state=4;o.parent.xxStateChange(3);h();if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(o.state==4){switch(o.acc.charCodeAt(0)){case 0:if(o.acc.length<4){return}o.state=100+ReadShort(o.acc,2);q=4;break;case 2:q=1;break;case 3:if(o.acc.length<8){return}var C=ReadInt(o.acc,4)+8;if(o.acc.length<C){return}q=n(o.acc);break}}else{if(o.state>100&&o.acc.length>=12){var I=ReadShort(o.acc,0),K=ReadShort(o.acc,2),H=ReadShort(o.acc,4),A=ReadShort(o.acc,6),F=H*A,z=ReadInt(o.acc,8);if(z<17){if(H<1||H>64||A<1||A>64){console.log("Invalid tile size ("+H+","+A+"), disconnecting.");return o.Stop()}if(o.sparew!=H||o.spareh!=A){o.sparew=o.sparew2=H;o.spareh=o.spareh2=A;var J=o.sparew2+"x"+o.spareh2;o.spare=o.sparecache[J];if(!o.spare){o.sparecache[J]=o.spare=o.canvas.createImageData(o.sparew2,o.spareh2)}}}if(z==4294967073){o.canvas.canvas.width=o.rwidth=o.width=H;o.canvas.canvas.height=o.rheight=o.height=A;o.send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height));q=12;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}else{if(z==0){var E=12,r=12+(F*o.bpp);if(o.acc.length<r){return}q=r;for(var B=0;B<F;B++){j(o.acc.charCodeAt(E++)+((o.bpp==2)?(o.acc.charCodeAt(E++)<<8):0),B)}g(o.spare,I,K)}else{if(z==16){if(o.acc.length<16){return}var u=ReadInt(o.acc,12);if(o.acc.length<(16+u)){return}var E=16,v=5,w=0;if(u>5&&o.acc.charCodeAt(E)==0&&ReadShortX(o.acc,E+1)==(u-v)){a(o.acc,E+5,I,K,H,A,F,u)}q=16+u}else{o.Debug("Unknown Encoding: "+z);return o.Stop()}}}if(--o.state==100){o.state=4;if(o.frameRateDelay==0){h()}else{setTimeout(h,o.frameRateDelay)}}}}}}}}if(q==0){return}o.acc=o.acc.substring(q)}};function a(t,C,K,L,J,w,G,u){var H=t.charCodeAt(C++),A,I,F,B={},D=0,E=0,z;if(H==0){for(z=0;z<G;z++){j(t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0),z)}g(o.spare,K,L)}else{if(H==1){I=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0);o.canvas.fillStyle="rgb("+((o.bpp==1)?((I&224)+","+((I&28)<<3)+","+b((I&3)<<6)):(((I>>8)&248)+","+((I>>3)&252)+","+((I&31)<<3)))+")";o.canvas.fillRect(K,L,J,w)}else{if(H>1&&H<17){var r=4,q=15;for(z=0;z<H;z++){B[z]=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0)}if(H==2){r=1;q=1}else{if(H<=4){r=2;q=3}}while(D<G&&C<t.length){I=t.charCodeAt(C++);for(z=(8-r);z>=0;z-=r){j(B[(I>>z)&q],D++)}}g(o.spare,K,L)}else{if(H==128){while(D<G&&C<t.length){I=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0);E=1;do{E+=(F=t.charCodeAt(C++))}while(F==255);while(--E>=0){j(I,D++)}}g(o.spare,K,L)}else{if(H>129){for(z=0;z<(H-128);z++){B[z]=t.charCodeAt(C++)+((o.bpp==2)?(t.charCodeAt(C++)<<8):0)}while(D<G&&C<t.length){E=1;A=t.charCodeAt(C++);I=B[A%128];if(A>127){do{E+=(F=t.charCodeAt(C++))}while(F==255)}while(--E>=0){j(I,D++)}}g(o.spare,K,L)}}}}}}o.hold=function(q){if(o.holding==q){return}o.holding=q;o.canvas.fillStyle="#000000";o.canvas.fillRect(0,0,o.width,o.height);if(o.holding==false){if((o.canvas.canvas.width!=o.width)||(o.canvas.canvas.height!=o.height)){o.canvas.canvas.width=o.width;o.canvas.canvas.height=o.height;if(o.onScreenSizeChange!=null){o.onScreenSizeChange(o,o.ScreenWidth,o.ScreenHeight)}}o.Send(String.fromCharCode(3,0,0,0,0,0)+ShortToStr(o.width)+ShortToStr(o.height))}else{o.UnGrabMouseInput();o.UnGrabKeyInput()}};function g(q,r,s){if(o.holding==true){return}o.canvas.putImageData(q,r,s)}function j(s,q){var r=q*4;if(o.bpp==1){o.spare.data[r++]=s&224;o.spare.data[r++]=(s&28)<<3;o.spare.data[r++]=b((s&3)<<6)}else{o.spare.data[r++]=(s>>8)&248;o.spare.data[r++]=(s>>3)&252;o.spare.data[r++]=(s&31)<<3}o.spare.data[r]=255}function b(q){return(q>127)?(q+32):q}function h(){if(o.holding==true){return}o.send(String.fromCharCode(3,1,0,0,0,0)+ShortToStr(o.rwidth)+ShortToStr(o.rheight))}o.Start=function(){o.state=0;o.acc="";o.ZRLEfirst=1;o.onKvmDataPending=[];o.onKvmDataAck=-1;o.kvmDataSupported=false;for(var q in o.sparecache){delete o.sparecache[q]}};o.Stop=function(){o.UnGrabMouseInput();o.UnGrabKeyInput();o.parent.Stop()};o.send=function(q){o.parent.send(q)};var l={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,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};function k(q){if(q.code.startsWith("Key")&&q.code.length==4){return q.code.charCodeAt(3)+((q.shiftKey==false)?32:0)}if(q.code.startsWith("Digit")&&q.code.length==6){return q.code.charCodeAt(5)}if(q.code.startsWith("Numpad")&&q.code.length==7){return q.code.charCodeAt(6)}return l[q.code]}function c(q,r){if(!r){r=window.event}if(r.code){var s=k(r);if(s!=null){o.sendkey(s,q)}}else{var s=r.keyCode,t=s;if(r.shiftKey==false&&s>=65&&s<=90){t=s+32}if(s>=112&&s<=124){t=s+65358}if(s==8){t=65288}if(s==9){t=65289}if(s==13){t=65293}if(s==16){t=65505}if(s==17){t=65507}if(s==18){t=65513}if(s==27){t=65307}if(s==33){t=65365}if(s==34){t=65366}if(s==35){t=65367}if(s==36){t=65360}if(s==37){t=65361}if(s==38){t=65362}if(s==39){t=65363}if(s==40){t=65364}if(s==45){t=65379}if(s==46){t=65535}if(s>=96&&s<=105){t=s-48}if(s==106){t=42}if(s==107){t=43}if(s==109){t=45}if(s==110){t=46}if(s==111){t=47}if(s==186){t=59}if(s==187){t=61}if(s==188){t=44}if(s==189){t=45}if(s==190){t=46}if(s==191){t=47}if(s==192){t=96}if(s==219){t=91}if(s==220){t=92}if(s==221){t=93}if(s==222){t=39}o.sendkey(t,q)}return o.haltEvent(r)}o.sendkey=function(s,q){if(typeof s=="object"){for(var r in s){o.sendkey(s[r][0],s[r][1])}}else{o.send(String.fromCharCode(4,q,0,0)+IntToStr(s))}};function n(q){if(q.length<8){return 0}var s=ReadInt(o.acc,4)+8;if(q.length<s){return 0}if(o.onKvmData!=null){var r=q.substring(8,s);if((r.length>=16)&&(r.substring(0,15)=="\0KvmDataChannel")){if(o.kvmDataSupported==false){o.kvmDataSupported=true;console.log("KVM Data Channel Supported.")}if(((o.onKvmDataAck==-1)&&(r.length==16))||(r.charCodeAt(15)!=0)){o.onKvmDataAck=true}if(r.length>=16){o.onKvmData(r.substring(16))}if((o.onKvmDataAck==true)&&(o.onKvmDataPending.length>0)){o.sendKvmData(o.onKvmDataPending.shift())}}}return s}o.sendKvmData=function(q){if(o.onKvmDataAck!==true){o.onKvmDataPending.push(q)}else{q="\0KvmDataChannel\0"+q;o.send(String.fromCharCode(6,0,0,0)+IntToStr(q.length)+q);o.onKvmDataAck=false}};o.sendKeepAlive=function(){if(o.lastKeepAlive<Date.now()-5000){o.lastKeepAlive=Date.now();o.send(String.fromCharCode(6,0,0,0)+IntToStr(16)+"\0KvmDataChannel\0")}};o.SendCtrlAltDelMsg=function(){o.sendcad()};o.sendcad=function(){o.sendkey([[65507,1],[65513,1],[65535,1],[65535,0],[65513,0],[65507,0]])};var e=false;var d=false;o.GrabMouseInput=function(){if(e==true){return}var q=o.canvas.canvas;q.onmouseup=o.mouseup;q.onmousedown=o.mousedown;q.onmousemove=o.mousemove;e=true};o.UnGrabMouseInput=function(){if(e==false){return}var q=o.canvas.canvas;q.onmousemove=null;q.onmouseup=null;q.onmousedown=null;e=false};o.GrabKeyInput=function(){if(d==true){return}document.onkeyup=o.handleKeyUp;document.onkeydown=o.handleKeyDown;document.onkeypress=o.handleKeys;d=true};o.UnGrabKeyInput=function(){if(d==false){return}document.onkeyup=null;document.onkeydown=null;document.onkeypress=null;d=false};o.handleKeys=function(q){return o.haltEvent(q)};o.handleKeyUp=function(q){return c(0,q)};o.handleKeyDown=function(q){return c(1,q)};o.haltEvent=function(q){if(q.preventDefault){q.preventDefault()}if(q.stopPropagation){q.stopPropagation()}return false};o.mousedblclick=function(q){};o.mousedown=function(q){o.buttonmask|=(1<<q.button);return o.mousemove(q)};o.mouseup=function(q){o.buttonmask&=(65535-(1<<q.button));return o.mousemove(q)};o.mousemove=function(q){if(o.state!=4){return true}var r=o.getPositionOfControl(Q(o.canvasid));o.mx=(q.pageX-r[0])*(o.canvas.canvas.height/Q(o.canvasid).offsetHeight);o.my=((q.pageY-r[1]+(p?p.scrollTop:0))*(o.canvas.canvas.width/Q(o.canvasid).offsetWidth));o.send(String.fromCharCode(5,o.buttonmask)+ShortToStr(o.mx)+ShortToStr(o.my));return o.haltEvent(q)};o.getPositionOfControl=function(q){var r=Array(2);r[0]=r[1]=0;while(q){r[0]+=q.offsetLeft;r[1]+=q.offsetTop;q=q.offsetParent}return r};return o};var CreateAmtRemoteTerminal=function(B){var C={};C.DivId=B;C.DivElement=document.getElementById(B);C.protocol=1;C.fxEmulation=0;C.lineFeed="\r\n";C.debugmode=0;C.width=80;C.height=25;var r=21;var s=13;var m=["000000","BB0000","00BB00","BBBB00","0000BB","BB00BB","00BBBB","BBBBBB","555555","FF5555","55FF55","FFFF55","5555FF","FF55FF","55FFFF","FFFFFF"];var p=0;var o=7;var n=0;var t=true;var w=0;var x=0;var v=0;var d=[];var e=0;var l=[];var y=[];var A=1;var z=2;C.Start=function(){};C.Init=function(E,D){C.width=E?E:80;C.height=D?D:25;for(var G=0;G<C.height;G++){y[G]=[];l[G]=[];for(var F=0;F<C.width;F++){y[G][F]=" ";l[G][F]=(7<<6)}}C.TermInit();C.TermDraw()};C.xxStateChange=function(D){};C.ProcessData=function(D){if(C.debugmode==2){console.log("TRecv("+D.length+"): "+rstr2hex(D))}if(C.capture!=null){C.capture+=D}k(D);C.TermDraw()};function k(E){for(var D=0;D<E.length;D++){j(String.fromCharCode(E.charCodeAt(D)),E.charCodeAt(D))}}function j(D,E){switch(v){case 0:switch(E){case 27:v=1;break;default:h(D);break}break;case 1:switch(D){case"[":e=0;d=[];v=2;break;case"(":v=4;break;case")":v=5;break;default:v=0;break}break;case 2:if(D>="0"&&D<="9"){if(!d[e]){d[e]=(D-"0")}else{d[e]=((d[e]*10)+(D-"0"))}break}else{if(D==";"){e++;break}else{if(!d[0]){d[0]=0}g(D,d,e+1);v=0}}break;case 4:v=0;break;case 5:v=0;break}}function g(G,D,E){var H;switch(G){case"c":C.TermResetScreen();break;case"A":if(E==1){x-=D[0];if(x<0){x=0}}break;case"B":if(E==1){x+=D[0];if(x>C.height){x=C.height}}break;case"C":if(E==1){w+=D[0];if(w>C.width){w=C.width}}break;case"D":if(E==1){w-=D[0];if(w<0){w=0}}break;case"d":if(E==1){x=D[0]-1;if(x>C.height){x=C.height}if(x<0){x=0}}break;case"G":if(E==1){w=D[0]-1;if(w<0){w=0}if(w>79){w=79}}break;case"J":if(E==1&&D[0]==2){C.TermClear((n<<12)+(o<<6));w=0;x=0}else{if(E==0||E==1&&D[0]==0){b();for(H=x+1;H<C.height;H++){c(H)}}else{if(E==1&&D[0]==1){b();for(H=0;H<x-1;H++){c(H)}}}}break;case"H":if(E==2){if(D[0]<1){D[0]=1}if(D[1]<1){D[1]=1}if(D[0]>C.height){D[0]=C.height}if(D[1]>C.width){D[1]=C.width}x=D[0]-1;w=D[1]-1}else{x=0;w=0}break;case"m":for(H=0;H<E;H++){if(!D[H]||D[H]==0){n=0;o=7;p=0}else{if(D[H]==1){if(o<8){o+=8}}else{if(D[H]==2||D[H]==22){if(o>=8){o-=8}}else{if(D[H]==7){p=2}else{if(D[H]==27){p=0}else{if(D[H]>=30&&D[H]<=37){var F=(o>=8);o=(D[H]-30);if(F&&o<=8){o+=8}}else{if(D[H]>=40&&D[H]<=47){n=(D[H]-40)}else{if(D[H]>=90&&D[H]<=99){o=(D[H]-82)}else{if(D[H]>=100&&D[H]<=109){n=(D[H]-92)}}}}}}}}}}break;case"K":if(E==0||(E==1&&(!D[0]||D[0]==0))){b()}else{if(E==1){if(D[0]==1){a()}else{if(D[0]==2){c(x)}}}}break;case"h":t=true;break;case"l":t=false;break;default:break}}C.ProcessVt100String=function(E){for(var D=0;D<E.length;D++){h(String.fromCharCode(E.charCodeAt(D)))}};function h(D){if(D=="\0"||D.charCodeAt()==7){return}var E=D.charCodeAt();switch(E){case 16:D=" ";break;case 24:D="?";break;case 25:D="?";break}if(w>C.width){w=C.width}if(x>(C.height-1)){x=(C.height-1)}switch(D){case"\b":if(w>0){w=w-1;q(" ")}break;case"\t":var F=8-(w%8);for(var G=0;G<F;G++){h(" ")}break;case"\n":x++;if(x>(C.height-1)){u(1);x=(C.height-1)}if(C.lineFeed="\n"){w=0}break;case"\r":w=0;break;default:if(w>=C.width){w=0;if(t){x++}if(x>=(C.height-1)){u(1);x=(C.height-1)}}q(D);w++;break}}function q(D){y[x][w]=D;l[x][w]=(o<<6)+(n<<12)+p}C.TermClear=function(D){for(var F=0;F<C.height;F++){for(var E=0;E<C.width;E++){y[F][E]=" ";l[F][E]=D}}};C.TermResetScreen=function(){p=0;o=7;n=0;t=true;w=0;x=0;C.TermClear(7<<6)};function b(){var D=(n<<12);for(var E=w;E<C.width;E++){y[x][E]=" ";l[x][E]=D}}function a(){var D=(n<<12);for(var E=0;E<w;E++){y[x][E]=" ";l[x][E]=D}}function c(D){var E=(n<<12);for(var F=0;F<C.width;F++){y[D][F]=" ";l[D][F]=E}}C.TermSendKeys=function(D){if(C.debugmode==2){if(C.debugmode==2){console.log("TSend("+D.length+"): "+rstr2hex(D))}}C.parent.send(D)};C.TermSendKey=function(D){if(C.debugmode==2){if(C.debugmode==2){console.log("TSend(1): "+rstr2hex(String.fromCharCode(D)))}}C.parent.send(String.fromCharCode(D))};function u(D){var E,F;for(F=0;F<C.height-D;F++){y[F]=y[F+D];l[F]=l[F+D]}for(F=C.height-D;F<C.height;F++){y[F]=[];l[F]=[];for(E=0;E<C.width;E++){y[F][E]=" ";l[F][E]=(7<<6)}}}C.TermHandleKeys=function(D){if(!D.ctrlKey){if(D.which==127){C.TermSendKey(8)}else{if(D.which==13){C.TermSendKeys(C.lineFeed)}else{if(D.which!=0){C.TermSendKey(D.which)}}}return false}if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}};C.TermHandleKeyUp=function(D){if((D.which!=8)&&(D.which!=32)&&(D.which!=9)){return true}if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return false};C.TermHandleKeyDown=function(D){if((D.which>=65)&&(D.which<=90)&&(D.ctrlKey==true)){C.TermSendKey(D.which-64);if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return}if(D.which==27){C.TermSendKeys(String.fromCharCode(27));return true}if(D.which==37){C.TermSendKeys(String.fromCharCode(27,91,68));return true}if(D.which==38){C.TermSendKeys(String.fromCharCode(27,91,65));return true}if(D.which==39){C.TermSendKeys(String.fromCharCode(27,91,67));return true}if(D.which==40){C.TermSendKeys(String.fromCharCode(27,91,66));return true}if(D.which==9){C.TermSendKeys("\t");if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return true}if(D.which!=8&&D.which!=32&&D.which!=9){return true}C.TermSendKey(D.which);if(D.preventDefault){D.preventDefault()}if(D.stopPropagation){D.stopPropagation()}return false};C.TermDraw=function(){var E,D="",F="",G,H=1,J,K;for(var L=0;L<C.height;++L){for(var I=0;I<C.width;++I){G=l[L][I];if(w==I&&x==L){G|=z}if(G!=H){D+=F;F="";J=6;K=12;if(G&z){J=12;K=6}D+='<span style="color:#'+m[(G>>J)&63]+";background-color:#"+m[(G>>K)&63];if(G&A){D+=";text-decoration:underline"}D+=';">';F="</span>"+F;H=G}E=y[L][I];switch(E){case"&":D+="&";break;case"<":D+="<";break;case">":D+=">";break;case" ":D+=" ";break;default:D+=E;break}}if(L!=(C.height-1)){D+="<br>"}}C.DivElement.innerHTML="<font size='4'><b>"+D+F+"</b></font>"};C.TermInit=function(){C.TermResetScreen()};C.Init();return C};var ZLIB=(ZLIB||{});if(typeof ZLIB.common_initialized==="undefined"){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.next_in=0;this.avail_in=0;this.total_in=0;this.next_out=0;this.avail_out=0;this.total_out=0;this.msg=null;this.state=null;this.data_type=0;this.adler=0;this.input_data="";this.output_data="";this.error=0;this.checksum_function=null};ZLIB.gz_header=function(){this.text=0;this.time=0;this.xflags=0;this.os=255;this.extra=null;this.extra_len=0;this.extra_max=0;this.name=null;this.name_max=0;this.comment=null;this.comm_max=0;this.hcrc=0;this.done=0};ZLIB.common_initialized=true}if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-inflate.js")}(function(){var o=15;var G=0;var D=1;var am=2;var af=3;var A=4;var B=5;var ac=6;var j=7;var F=8;var q=9;var p=10;var an=11;var ao=12;var aj=13;var l=14;var k=15;var al=16;var W=17;var g=18;var S=19;var R=20;var T=21;var r=22;var s=23;var aa=24;var Y=25;var d=26;var V=27;var v=28;var a=29;var ab=30;var ak=31;var z=852;var y=592;var x=(z+y);var h=0;var X=1;var u=2;var N=[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];var O=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,203,69];var L=[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];var M=[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 ";function K(aR,aV){var aM=15;var aU=aR.next;var at=(aV==u?aR.distbits:aR.lenbits);var aX=aR.work;var aH=aR.lens;var aI=(aV==u?aR.nlen:0);var aS=aR.codes;var au;if(aV==X){au=aR.nlen}else{if(aV==u){au=aR.ndist}else{au=19}}var aG;var aT;var aN,aL;var aQ;var aw;var ax;var aF;var aW;var aD;var aE;var aB;var aJ;var aK;var aC;var aO;var aq;var ar;var az;var aA;var ay;var av=new Array(aM+1);var aP=new Array(aM+1);for(aG=0;aG<=aM;aG++){av[aG]=0}for(aT=0;aT<au;aT++){av[aH[aI+aT]]++}aQ=at;for(aL=aM;aL>=1;aL--){if(av[aL]!=0){break}}if(aQ>aL){aQ=aL}if(aL==0){aC={op:64,bits:1,val:0};aS[aU++]=aC;aS[aU++]=aC;if(aV==u){aR.distbits=1}else{aR.lenbits=1}aR.next=aU;return 0}for(aN=1;aN<aL;aN++){if(av[aN]!=0){break}}if(aQ<aN){aQ=aN}aF=1;for(aG=1;aG<=aM;aG++){aF<<=1;aF-=av[aG];if(aF<0){return -1}}if(aF>0&&(aV==h||aL!=1)){aR.next=aU;return -1}aP[1]=0;for(aG=1;aG<aM;aG++){aP[aG+1]=aP[aG]+av[aG]}for(aT=0;aT<au;aT++){if(aH[aI+aT]!=0){aX[aP[aH[aI+aT]]++]=aT}}switch(aV){case h:aq=az=aX;ar=0;aA=0;ay=19;break;case X:aq=N;ar=-257;az=O;aA=-257;ay=256;break;default:aq=L;az=M;ar=0;aA=0;ay=-1}aD=0;aT=0;aG=aN;aO=aU;aw=aQ;ax=0;aJ=-1;aW=1<<aQ;aK=aW-1;if((aV==X&&aW>=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}for(;;){aC={op:0,bits:aG-ax,val:0};if(aX[aT]<ay){aC.val=aX[aT]}else{if(aX[aT]>ay){aC.op=az[aA+aX[aT]];aC.val=aq[ar+aX[aT]]}else{aC.op=32+64}}aE=1<<(aG-ax);aB=1<<aw;aN=aB;do{aB-=aE;aS[aO+(aD>>>ax)+aB]=aC}while(aB!=0);aE=1<<(aG-1);while(aD&aE){aE>>>=1}if(aE!=0){aD&=aE-1;aD+=aE}else{aD=0}aT++;if(--(av[aG])==0){if(aG==aL){break}aG=aH[aI+aX[aT]]}if(aG>aQ&&(aD&aK)!=aJ){if(ax==0){ax=aQ}aO+=aN;aw=aG-ax;aF=(1<<aw);while(aw+ax<aL){aF-=av[aw+ax];if(aF<=0){break}aw++;aF<<=1}aW+=1<<aw;if((aV==X&&aW>=z)||(aV==u&&aW>=y)){aR.next=aU;return 1}aJ=aD&aK;aS[aU+aJ]={op:aw,bits:aQ,val:aO-aU}}}if(aD!=0){aS[aO+aD]={op:64,bits:aG-ax,val:0}}aR.next=aU+aW;if(aV==u){aR.distbits=aQ}else{aR.lenbits=aQ}return 0}function H(aN,aL){var aM;var aC;var aI;var aD;var aK;var aq;var ax;var aR;var aO;var aQ;var aP;var aB;var ar;var at;var aE;var au;var aH;var aw;var aA;var aJ;var aF;var av;var az=-1;var ay=-1;aM=aN.state;aC=aN.input_data;aI=aN.next_in;aD=aI+aN.avail_in-5;aK=aN.next_out;aq=aK-(aL-aN.avail_out);ax=aK+(aN.avail_out-257);aR=aM.wsize;aO=aM.whave;aQ=aM.wnext;aP=aM.window;aB=aM.hold;ar=aM.bits;at=aM.codes;aE=aM.lencode;au=aM.distcode;aH=(1<<aM.lenbits)-1;aw=(1<<aM.distbits)-1;loop:do{if(ar<15){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aA=at[aE+(aB&aH)];dolen:while(true){aJ=aA.bits;aB>>>=aJ;ar-=aJ;aJ=aA.op;if(aJ==0){aN.output_data+=String.fromCharCode(aA.val);aK++}else{if(aJ&16){aF=aA.val;aJ&=15;if(aJ){if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aF+=aB&((1<<aJ)-1);aB>>>=aJ;ar-=aJ}if(ar<15){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}aA=at[au+(aB&aw)];dodist:while(true){aJ=aA.bits;aB>>>=aJ;ar-=aJ;aJ=aA.op;if(aJ&16){av=aA.val;aJ&=15;if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8;if(ar<aJ){aB+=(aC.charCodeAt(aI++)&255)<<ar;ar+=8}}av+=aB&((1<<aJ)-1);aB>>>=aJ;ar-=aJ;aJ=aK-aq;if(av>aJ){aJ=av-aJ;if(aJ>aO){if(aM.sane){aN.msg="invalid distance too far back";aM.mode=a;break loop}}az=0;ay=-1;if(aQ==0){az+=aR-aJ;if(aJ<aF){aF-=aJ;aN.output_data+=aP.substring(az,az+aJ);aK+=aJ;aJ=0;az=-1;ay=aK-av}}else{az+=aQ-aJ;if(aJ<aF){aF-=aJ;aN.output_data+=aP.substring(az,az+aJ);aK+=aJ;az=-1;ay=aK-av}}}else{az=-1;ay=aK-av}if(az>=0){aN.output_data+=aP.substring(az,az+aF);aK+=aF;az+=aF}else{var aG=aF;if(aG>aK-ay){aG=aK-ay}aN.output_data+=aN.output_data.substring(ay,ay+aG);aK+=aG;aF-=aG;ay+=aG;aK+=aF;while(aF>2){aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aN.output_data+=aN.output_data.charAt(ay++);aF-=3}if(aF){aN.output_data+=aN.output_data.charAt(ay++);if(aF>1){aN.output_data+=aN.output_data.charAt(ay++)}}}}else{if((aJ&64)==0){aA=at[au+(aA.val+(aB&((1<<aJ)-1)))];continue dodist}else{aN.msg="invalid distance code";aM.mode=a;break loop}}break dodist}}else{if((aJ&64)==0){aA=at[aE+(aA.val+(aB&((1<<aJ)-1)))];continue dolen}else{if(aJ&32){aM.mode=an;break loop}else{aN.msg="invalid literal/length code";aM.mode=a;break loop}}}}break dolen}}while(aI<aD&&aK<ax);aF=ar>>>3;aI-=aF;ar-=aF<<3;aB&=(1<<ar)-1;aN.next_in=aI;aN.next_out=aK;aN.avail_in=(aI<aD?5+(aD-aI):5-(aI-aD));aN.avail_out=(aK<ax?257+(ax-aK):257-(aK-ax));aM.hold=aB;aM.bits=ar}function ae(at){var ar;var aq=new Array(at);for(ar=0;ar<at;ar++){aq[ar]=0}return aq}function E(at,ar,aq){return(at&&(ar in at))?at[ar]:aq}function e(){return 0}function J(){var ar;this.mode=0;this.last=0;this.wrap=0;this.havedict=0;this.flags=0;this.dmax=0;this.check=0;this.total=0;this.head=null;this.wbits=0;this.wsize=0;this.whave=0;this.wnext=0;this.window=null;this.hold=0;this.bits=0;this.length=0;this.offset=0;this.extra=0;this.lencode=0;this.distcode=0;this.lenbits=0;this.distbits=0;this.ncode=0;this.nlen=0;this.ndist=0;this.have=0;this.next=0;this.lens=ae(320);this.work=ae(288);this.codes=new Array(x);var aq={op:0,bits:0,val:0};for(ar=0;ar<x;ar++){this.codes[ar]=aq}this.sane=0;this.back=0;this.was=0}ZLIB.inflateResetKeep=function(ar){var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;ar.total_in=ar.total_out=aq.total=0;ar.msg=null;if(aq.wrap){ar.adler=aq.wrap&1}aq.mode=G;aq.last=0;aq.havedict=0;aq.dmax=32768;aq.head=null;aq.hold=0;aq.bits=0;aq.lencode=0;aq.distcode=0;aq.next=0;aq.sane=1;aq.back=-1;return ZLIB.Z_OK};ZLIB.inflateReset=function(ar,at){var au;var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;if(typeof at==="undefined"){at=o}if(at<0){au=0;at=-at}else{au=(at>>>4)+1;if(at<48){at&=15}}if(au==1&&(typeof ZLIB.adler32==="function")){ar.checksum_function=ZLIB.adler32}else{if(au==2&&(typeof ZLIB.crc32==="function")){ar.checksum_function=ZLIB.crc32}else{ar.checksum_function=e}}if(at&&(at<8||at>15)){return ZLIB.Z_STREAM_ERROR}if(aq.window&&aq.wbits!=at){aq.window=null}aq.wrap=au;aq.wbits=at;aq.wsize=0;aq.whave=0;aq.wnext=0;return ZLIB.inflateResetKeep(ar)};ZLIB.inflateInit=function(ar){var aq=new ZLIB.z_stream();aq.state=new J();ZLIB.inflateReset(aq,ar);return aq};ZLIB.inflatePrime=function(at,aq,au){var ar;if(!at||!at.state){return ZLIB.Z_STREAM_ERROR}ar=at.state;if(aq<0){ar.hold=0;ar.bits=0;return ZLIB.Z_OK}if(aq>16||ar.bits+aq>32){return ZLIB.Z_STREAM_ERROR}au&=(1<<aq)-1;ar.hold+=au<<ar.bits;ar.bits+=aq;return ZLIB.Z_OK};var U=null;var t=null;function C(ar){var aq;if(!U){U=[{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}]}if(!t){t=[{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}]}ar.lencode=0;ar.distcode=512;for(aq=0;aq<512;aq++){ar.codes[aq]=U[aq]}for(aq=0;aq<32;aq++){ar.codes[aq+512]=t[aq]}ar.lenbits=9;ar.distbits=5}function ap(at){var ar=at.state;var aq=at.output_data.length;if(ar.window===null){ar.window=""}if(ar.wsize==0){ar.wsize=1<<ar.wbits}if(aq>=ar.wsize){ar.window=at.output_data.substring(aq-ar.wsize)}else{if(ar.whave+aq<ar.wsize){ar.window+=at.output_data}else{ar.window=ar.window.substring(ar.whave-(ar.wsize-aq))+at.output_data}}ar.whave=ar.window.length;if(ar.whave<ar.wsize){ar.wnext=ar.whave}else{ar.wnext=0}return 0}function m(ar,at){var aq=[at&255,(at>>>8)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,2)}function n(ar,at){var aq=[at&255,(at>>>8)&255,(at>>>16)&255,(at>>>24)&255];ar.state.check=ar.checksum_function(ar.state.check,aq,0,4)}function Z(ar,aq){aq.strm=ar;aq.left=ar.avail_out;aq.next=ar.next_in;aq.have=ar.avail_in;aq.hold=ar.state.hold;aq.bits=ar.state.bits;return aq}function ah(aq){var ar=aq.strm;ar.next_in=aq.next;ar.avail_out=aq.left;ar.avail_in=aq.have;ar.state.hold=aq.hold;ar.state.bits=aq.bits}function P(aq){aq.hold=0;aq.bits=0}function ag(aq){if(aq.have==0){return false}aq.have--;aq.hold+=(aq.strm.input_data.charCodeAt(aq.next++)&255)<<aq.bits;aq.bits+=8;return true}function ad(ar,aq){while(ar.bits<aq){if(!ag(ar)){return false}}return true}function b(ar,aq){return ar.hold&((1<<aq)-1)}function w(ar,aq){ar.hold>>>=aq;ar.bits-=aq}function c(aq){aq.hold>>>=aq.bits&7;aq.bits-=aq.bits&7}function ai(aq){return((aq>>>24)&255)+((aq>>>8)&65280)+((aq&65280)<<8)+((aq&255)<<24)}var I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];ZLIB.inflate=function(aD,at){var aC;var aB;var aq,az;var ar;var av=-1;var au=-1;var aw;var ax;var ay;var aA;if(!aD||!aD.state||(!aD.input_data&&aD.avail_in!=0)){return ZLIB.Z_STREAM_ERROR}aC=aD.state;if(aC.mode==an){aC.mode=ao}aB={};Z(aD,aB);aq=aB.have;az=aB.left;aA=ZLIB.Z_OK;inf_leave:for(;;){switch(aC.mode){case G:if(aC.wrap==0){aC.mode=ao;break}if(!ad(aB,16)){break inf_leave}if((aC.wrap&2)&&aB.hold==35615){aC.check=aD.checksum_function(0,null,0,0);m(aD,aB.hold);P(aB);aC.mode=D;break}aC.flags=0;if(aC.head!==null){aC.head.done=-1}if(!(aC.wrap&1)||((b(aB,8)<<8)+(aB.hold>>>8))%31){aD.msg="incorrect header check";aC.mode=a;break}if(b(aB,4)!=ZLIB.Z_DEFLATED){aD.msg="unknown compression method";aC.mode=a;break}w(aB,4);ay=b(aB,4)+8;if(aC.wbits==0){aC.wbits=ay}else{if(ay>aC.wbits){aD.msg="invalid window size";aC.mode=a;break}}aC.dmax=1<<ay;aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=aB.hold&512?q:an;P(aB);break;case D:if(!ad(aB,16)){break inf_leave}aC.flags=aB.hold;if((aC.flags&255)!=ZLIB.Z_DEFLATED){aD.msg="unknown compression method";aC.mode=a;break}if(aC.flags&57344){aD.msg="unknown header flags set";aC.mode=a;break}if(aC.head!==null){aC.head.text=(aB.hold>>>8)&1}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=am;case am:if(!ad(aB,32)){break inf_leave}if(aC.head!==null){aC.head.time=aB.hold}if(aC.flags&512){n(aD,aB.hold)}P(aB);aC.mode=af;case af:if(!ad(aB,16)){break inf_leave}if(aC.head!==null){aC.head.xflags=aB.hold&255;aC.head.os=aB.hold>>>8}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.mode=A;case A:if(aC.flags&1024){if(!ad(aB,16)){break inf_leave}aC.length=aB.hold;if(aC.head!==null){aC.head.extra_len=aB.hold}if(aC.flags&512){m(aD,aB.hold)}P(aB);aC.head.extra=""}else{if(aC.head!==null){aC.head.extra=null}}aC.mode=B;case B:if(aC.flags&1024){ar=aC.length;if(ar>aB.have){ar=aB.have}if(ar){if(aC.head!==null&&aC.head.extra!==null){ay=aC.head.extra_len-aC.length;aC.head.extra+=aD.input_data.substring(aB.next,aB.next+(ay+ar>aC.head.extra_max?aC.head.extra_max-ay:ar))}if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;aC.length-=ar}if(aC.length){break inf_leave}}aC.length=0;aC.mode=ac;case ac:if(aC.flags&2048){if(aB.have==0){break inf_leave}if(aC.head!==null&&aC.head.name===null){aC.head.name=""}ar=0;do{ay=aD.input_data.charAt(aB.next+ar);ar++;if(ay==="\0"){break}if(aC.head!==null&&aC.length<aC.head.name_max){aC.head.name+=ay;aC.length++}}while(ar<aB.have);if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;if(ay!=="\0"){break inf_leave}}else{if(aC.head!==null){aC.head.name=null}}aC.length=0;aC.mode=j;case j:if(aC.flags&4096){if(aB.have==0){break inf_leave}ar=0;if(aC.head!==null&&aC.head.comment===null){aC.head.comment=""}do{ay=aD.input_data.charAt(aB.next+ar);ar++;if(ay==="\0"){break}if(aC.head!==null&&aC.length<aC.head.comm_max){aC.head.comment+=ay;aC.length++}}while(ar<aB.have);if(aC.flags&512){aC.check=aD.checksum_function(aC.check,aD.input_data,aB.next,ar)}aB.have-=ar;aB.next+=ar;if(ay!=="\0"){break inf_leave}}else{if(aC.head!==null){aC.head.comment=null}}aC.mode=F;case F:if(aC.flags&512){if(!ad(aB,16)){break inf_leave}if(aB.hold!=(aC.check&65535)){aD.msg="header crc mismatch";aC.mode=a;break}P(aB)}if(aC.head!==null){aC.head.hcrc=(aC.flags>>>9)&1;aC.head.done=1}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;break;case q:if(!ad(aB,32)){break inf_leave}aD.adler=aC.check=ai(aB.hold);P(aB);aC.mode=p;case p:if(aC.havedict==0){ah(aB);return ZLIB.Z_NEED_DICT}aD.adler=aC.check=aD.checksum_function(0,null,0,0);aC.mode=an;case an:if(at==ZLIB.Z_BLOCK||at==ZLIB.Z_TREES){break inf_leave}case ao:if(aC.last){c(aB);aC.mode=d;break}if(!ad(aB,3)){break inf_leave}aC.last=b(aB,1);w(aB,1);switch(b(aB,2)){case 0:aC.mode=aj;break;case 1:C(aC);aC.mode=S;if(at==ZLIB.Z_TREES){w(aB,2);break inf_leave}break;case 2:aC.mode=al;break;case 3:aD.msg="invalid block type";aC.mode=a}w(aB,2);break;case aj:c(aB);if(!ad(aB,32)){break inf_leave}if((aB.hold&65535)!=(((aB.hold>>>16)&65535)^65535)){aD.msg="invalid stored block lengths";aC.mode=a;break}aC.length=aB.hold&65535;P(aB);aC.mode=l;if(at==ZLIB.Z_TREES){break inf_leave}case l:aC.mode=k;case k:ar=aC.length;if(ar){if(ar>aB.have){ar=aB.have}if(ar>aB.left){ar=aB.left}if(ar==0){break inf_leave}aD.output_data+=aD.input_data.substring(aB.next,aB.next+ar);aD.next_out+=ar;aB.have-=ar;aB.next+=ar;aB.left-=ar;aC.length-=ar;break}aC.mode=an;break;case al:if(!ad(aB,14)){break inf_leave}aC.nlen=b(aB,5)+257;w(aB,5);aC.ndist=b(aB,5)+1;w(aB,5);aC.ncode=b(aB,4)+4;w(aB,4);if(aC.nlen>286||aC.ndist>30){aD.msg="too many length or distance symbols";aC.mode=a;break}aC.have=0;aC.mode=W;case W:while(aC.have<aC.ncode){if(!ad(aB,3)){break inf_leave}var aE=b(aB,3);aC.lens[I[aC.have++]]=aE;w(aB,3)}while(aC.have<19){aC.lens[I[aC.have++]]=0}aC.next=0;aC.lencode=0;aC.lenbits=7;aA=K(aC,h);if(aA){aD.msg="invalid code lengths set";aC.mode=a;break}aC.have=0;aC.mode=g;case g:while(aC.have<aC.nlen+aC.ndist){for(;;){aw=aC.codes[aC.lencode+b(aB,aC.lenbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if(aw.val<16){w(aB,aw.bits);aC.lens[aC.have++]=aw.val}else{if(aw.val==16){if(!ad(aB,aw.bits+2)){break inf_leave}w(aB,aw.bits);if(aC.have==0){aD.msg="invalid bit length repeat";aC.mode=a;break}ay=aC.lens[aC.have-1];ar=3+b(aB,2);w(aB,2)}else{if(aw.val==17){if(!ad(aB,aw.bits+3)){break inf_leave}w(aB,aw.bits);ay=0;ar=3+b(aB,3);w(aB,3)}else{if(!ad(aB,aw.bits+7)){break inf_leave}w(aB,aw.bits);ay=0;ar=11+b(aB,7);w(aB,7)}}if(aC.have+ar>aC.nlen+aC.ndist){aD.msg="invalid bit length repeat";aC.mode=a;break}while(ar--){aC.lens[aC.have++]=ay}}}if(aC.mode==a){break}if(aC.lens[256]==0){aD.msg="invalid code -- missing end-of-block";aC.mode=a;break}aC.next=0;aC.lencode=aC.next;aC.lenbits=9;aA=K(aC,X);if(aA){aD.msg="invalid literal/lengths set";aC.mode=a;break}aC.distcode=aC.next;aC.distbits=6;aA=K(aC,u);if(aA){aD.msg="invalid distances set";aC.mode=a;break}aC.mode=S;if(at==ZLIB.Z_TREES){break inf_leave}case S:aC.mode=R;case R:if(aB.have>=6&&aB.left>=258){ah(aB);H(aD,az);Z(aD,aB);if(aC.mode==an){aC.back=-1}break}aC.back=0;for(;;){aw=aC.codes[aC.lencode+b(aB,aC.lenbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if(aw.op&&(aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.lencode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if(ax.bits+aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;aC.length=aw.val;if(aw.op==0){aC.mode=Y;break}if(aw.op&32){aC.back=-1;aC.mode=an;break}if(aw.op&64){aD.msg="invalid literal/length code";aC.mode=a;break}aC.extra=aw.op&15;aC.mode=T;case T:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.length+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.was=aC.length;aC.mode=r;case r:for(;;){aw=aC.codes[aC.distcode+b(aB,aC.distbits)];if(aw.bits<=aB.bits){break}if(!ag(aB)){break inf_leave}}if((aw.op&240)==0){ax=aw;for(;;){aw=aC.codes[aC.distcode+ax.val+(b(aB,ax.bits+ax.op)>>>ax.bits)];if((ax.bits+aw.bits)<=aB.bits){break}if(!ag(aB)){break inf_leave}}w(aB,ax.bits);aC.back+=ax.bits}w(aB,aw.bits);aC.back+=aw.bits;if(aw.op&64){aD.msg="invalid distance code";aC.mode=a;break}aC.offset=aw.val;aC.extra=aw.op&15;aC.mode=s;case s:if(aC.extra){if(!ad(aB,aC.extra)){break inf_leave}aC.offset+=b(aB,aC.extra);w(aB,aC.extra);aC.back+=aC.extra}aC.mode=aa;case aa:if(aB.left==0){break inf_leave}ar=az-aB.left;if(aC.offset>ar){ar=aC.offset-ar;if(ar>aC.whave){if(aC.sane){aD.msg="invalid distance too far back";aC.mode=a;break}}if(ar>aC.wnext){ar-=aC.wnext;av=aC.wsize-ar;au=-1}else{av=aC.wnext-ar;au=-1}if(ar>aC.length){ar=aC.length}}else{av=-1;au=aD.next_out-aC.offset;ar=aC.length}if(ar>aB.left){ar=aB.left}aB.left-=ar;aC.length-=ar;if(av>=0){aD.output_data+=aC.window.substring(av,av+ar);aD.next_out+=ar;ar=0}else{aD.next_out+=ar;do{aD.output_data+=aD.output_data.charAt(au++)}while(--ar)}if(aC.length==0){aC.mode=R}break;case Y:if(aB.left==0){break inf_leave}aD.output_data+=String.fromCharCode(aC.length);aD.next_out++;aB.left--;aC.mode=R;break;case d:if(aC.wrap){if(!ad(aB,32)){break inf_leave}az-=aB.left;aD.total_out+=az;aC.total+=az;if(az){aD.adler=aC.check=aD.checksum_function(aC.check,aD.output_data,aD.output_data.length-az,az)}az=aB.left;if((aC.flags?aB.hold:ai(aB.hold))!=aC.check){aD.msg="incorrect data check";aC.mode=a;break}P(aB)}aC.mode=V;case V:if(aC.wrap&&aC.flags){if(!ad(aB,32)){break inf_leave}if(aB.hold!=(aC.total&4294967295)){aD.msg="incorrect length check";aC.mode=a;break}P(aB)}aC.mode=v;case v:aA=ZLIB.Z_STREAM_END;break inf_leave;case a:aA=ZLIB.Z_DATA_ERROR;break inf_leave;case ab:return ZLIB.Z_MEM_ERROR;case ak:default:return ZLIB.Z_STREAM_ERROR}}inf_leave:ah(aB);if(aC.wsize||(az!=aD.avail_out&&aC.mode<a&&(aC.mode<d||at!=ZLIB.Z_FINISH))){if(ap(aD)){aC.mode=ab;return ZLIB.Z_MEM_ERROR}}aq-=aD.avail_in;az-=aD.avail_out;aD.total_in+=aq;aD.total_out+=az;aC.total+=az;if(aC.wrap&&az){aD.adler=aC.check=aD.checksum_function(aC.check,aD.output_data,0,aD.output_data.length)}aD.data_type=aC.bits+(aC.last?64:0)+(aC.mode==an?128:0)+(aC.mode==S||aC.mode==l?256:0);if(((aq==0&&az==0)||at==ZLIB.Z_FINISH)&&aA==ZLIB.Z_OK){aA=ZLIB.Z_BUF_ERROR}return aA};ZLIB.inflateEnd=function(ar){var aq;if(!ar||!ar.state){return ZLIB.Z_STREAM_ERROR}aq=ar.state;aq.window=null;ar.state=null;return ZLIB.Z_OK};ZLIB.z_stream.prototype.inflate=function(au,av){var at;var aq;var ar=16384;this.input_data=au;this.next_in=E(av,"next_in",0);this.avail_in=E(av,"avail_in",au.length-this.next_in);at=E(av,"flush",ZLIB.Z_SYNC_FLUSH);aq=E(av,"avail_out",-1);var aw="";do{this.avail_out=(aq>=0?aq:ar);this.output_data="";this.next_out=0;this.error=ZLIB.inflate(this,at);if(aq>=0){return this.output_data}aw+=this.output_data;if(this.avail_out>0){break}}while(this.error==ZLIB.Z_OK);return aw};ZLIB.z_stream.prototype.inflateReset=function(aq){return ZLIB.inflateReset(this,aq)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-adler32.js")}(function(){var c=65521;var d=5552;function b(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g.charCodeAt(k)&255;if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g.charCodeAt(k++)&255;l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e;e+=g.charCodeAt(k++)&255;l+=e}while(h--){e+=g.charCodeAt(k++)&255;l+=e}e%=c;l%=c}return e|(l<<16)}function a(e,g,k,h){var l;var j;l=(e>>>16)&65535;e&=65535;if(h==1){e+=g[k];if(e>=c){e-=c}l+=e;if(l>=c){l-=c}return e|(l<<16)}if(g===null){return 1}if(h<16){while(h--){e+=g[k++];l+=e}if(e>=c){e-=c}l%=c;return e|(l<<16)}while(h>=d){h-=d;j=d>>4;do{e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(--j);e%=c;l%=c}if(h){while(h>=16){h-=16;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e;e+=g[k++];l+=e}while(h--){e+=g[k++];l+=e}e%=c;l%=c}return e|(l<<16)}ZLIB.adler32=function(e,g,j,h){if(typeof g==="string"){return b(e,g,j,h)}else{return a(e,g,j,h)}};ZLIB.adler32_combine=function(e,g,h){var k;var l;var j;if(h<0){return 4294967295}h%=c;j=h;k=e&65535;l=j*k;l%=c;k+=(g&65535)+c-1;l+=((e>>16)&65535)+((g>>16)&65535)+c-j;if(k>=c){k-=c}if(k>=c){k-=c}if(l>=(c<<1)){l-=(c<<1)}if(l>=c){l-=c}return k|(l<<16)}}());if(typeof ZLIB==="undefined"){alert("ZLIB is not defined. SRC zlib.js before zlib-crc32.js")}(function(){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,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,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,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,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,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918000,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];function c(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);j=a[(j^h.charCodeAt(l++))&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h.charCodeAt(l++))&255]^(j>>>8)}while(--k)}return j^4294967295}function b(j,h,l,k){if(h==null){return 0}j=j^4294967295;while(k>=8){j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);j=a[(j^h[l++])&255]^(j>>>8);k-=8}if(k){do{j=a[(j^h[l++])&255]^(j>>>8)}while(--k)}return j^4294967295}ZLIB.crc32=function(j,h,l,k){if(typeof h==="string"){return c(j,h,l,k)}else{return b(j,h,l,k)}};var d=32;function g(h,l){var k;var j=0;k=0;while(l){if(l&1){k^=h[j]}l>>=1;j++}return k}function e(k,h){var j;for(j=0;j<d;j++){k[j]=g(h,h[j])}}ZLIB.crc32_combine=function(h,j,l){var m;var p;var k;var o;if(l<=0){return h}k=new Array(d);o=new Array(d);o[0]=3988292384;p=1;for(m=1;m<d;m++){o[m]=p;p<<=1}e(k,o);e(o,k);do{e(k,o);if(l&1){h=g(k,h)}l>>=1;if(l==0){break}e(o,k);if(l&1){h=g(o,h)}l>>=1}while(l!=0);h^=j;return h}}());var CreateAmtRedirect=function(e,a){var g={};g.m=e;e.parent=g;g.authCookie=a;g.State=0;g.socket=null;g.host=null;g.port=0;g.user=null;g.pass=null;g.authuri="/RedirectionService";g.tlsv1only=0;g.inDataCount=0;g.connectstate=0;g.protocol=e.protocol;g.debugmode=0;g.amtaccumulator="";g.amtsequence=1;g.amtkeepalivetimer=null;g.onStateChanged=null;g.Start=function(h,k,n,j,l){g.host=h;g.port=k;g.user=n;g.pass=j;g.connectstate=0;g.inDataCount=0;var m=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/webrelay.ashx?p=2&host="+h+"&port="+k+"&tls="+l+((n=="*")?"&serverauth=1":"")+((typeof j==="undefined")?("&serverauth=1&user="+n):"");if((a!=null)&&(a!="")){m+="&auth="+a}g.socket=new WebSocket(m);g.socket.onopen=g.xxOnSocketConnected;g.socket.onmessage=g.xxOnMessage;g.socket.onclose=g.xxOnSocketClosed;g.xxStateChange(1)};g.xxOnSocketConnected=function(){if(g.debugmode==1){console.log("onSocketConnected")}g.xxStateChange(2);if(g.protocol==1){g.xxSend(g.RedirectStartSol)}if(g.protocol==2){g.xxSend(g.RedirectStartKvm)}if(g.protocol==3){g.xxSend(g.RedirectStartIder)}};var b=new FileReader();var d=false,c=[];if(b.readAsBinaryString){b.onload=function(h){g.xxOnSocketData(h.target.result);if(c.length==0){d=false}else{b.readAsBinaryString(new Blob([c.shift()]))}}}else{if(b.readAsArrayBuffer){b.onloadend=function(h){g.xxOnSocketData(h.target.result);if(c.length==0){d=false}else{b.readAsArrayBuffer(c.shift())}}}}g.xxOnMessage=function(k){g.inDataCount++;if(typeof k.data=="object"){if(d==true){c.push(k.data);return}if(b.readAsBinaryString){d=true;b.readAsBinaryString(new Blob([k.data]))}else{if(f.readAsArrayBuffer){d=true;b.readAsArrayBuffer(k.data)}else{var h="",j=new Uint8Array(k.data),m=j.byteLength;for(var l=0;l<m;l++){h+=String.fromCharCode(j[l])}g.xxOnSocketData(h)}}}else{g.xxOnSocketData(k.data)}};g.xxOnSocketData=function(t){if(!t||g.connectstate==-1){return}if(typeof t==="object"){var m="";var o=new Uint8Array(t);var y=o.byteLength;for(var x=0;x<y;x++){m+=String.fromCharCode(o[x])}t=m}else{if(typeof t!=="string"){return}}if((g.protocol==2||g.protocol==3)&&g.connectstate==1){return g.m.ProcessData(t)}g.amtaccumulator+=t;while(g.amtaccumulator.length>=1){var p=0;switch(g.amtaccumulator.charCodeAt(0)){case 17:if(g.amtaccumulator.length<4){return}var L=g.amtaccumulator.charCodeAt(1);switch(L){case 0:if(g.amtaccumulator.length<13){return}var C=g.amtaccumulator.charCodeAt(12);if(g.amtaccumulator.length<13+C){return}g.xxSend(String.fromCharCode(19,0,0,0,0,0,0,0,0));p=(13+C);break;default:g.Stop(1);break}break;case 20:if(g.amtaccumulator.length<9){return}var k=ReadIntX(g.amtaccumulator,5);if(g.amtaccumulator.length<9+k){return}var K=g.amtaccumulator.charCodeAt(1);var l=g.amtaccumulator.charCodeAt(4);var h=[];for(x=0;x<k;x++){h.push(g.amtaccumulator.charCodeAt(9+x))}var j=g.amtaccumulator.substring(9,9+k);p=9+k;if(l==0){if(h.indexOf(4)>=0){g.xxSend(String.fromCharCode(19,0,0,0,4)+IntToStrX(g.user.length+g.authuri.length+8)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0,0))}else{if(h.indexOf(3)>=0){g.xxSend(String.fromCharCode(19,0,0,0,3)+IntToStrX(g.user.length+g.authuri.length+7)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(0,0)+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(0,0,0))}else{if(h.indexOf(1)>=0){g.xxSend(String.fromCharCode(19,0,0,0,1)+IntToStrX(g.user.length+g.pass.length+2)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(g.pass.length)+g.pass)}else{g.Stop(2)}}}}else{if((l==3||l==4)&&K==1){var s=0;var G=j.charCodeAt(s);var F=j.substring(s+1,s+1+G);s+=(G+1);var B=j.charCodeAt(s);var A=j.substring(s+1,s+1+B);s+=(B+1);var E=0;var D=null;var q=g.xxRandomNonce(32);var J="00000002";var v="";if(l==4){E=j.charCodeAt(s);D=j.substring(s+1,s+1+E);s+=(E+1);v=J+":"+q+":"+D+":"}var u=hex_md5(hex_md5(g.user+":"+F+":"+g.pass)+":"+A+":"+v+hex_md5("POST:"+g.authuri));var M=g.user.length+F.length+A.length+g.authuri.length+q.length+J.length+u.length+7;if(l==4){M+=(D.length+1)}var n=String.fromCharCode(19,0,0,0,l)+IntToStrX(M)+String.fromCharCode(g.user.length)+g.user+String.fromCharCode(F.length)+F+String.fromCharCode(A.length)+A+String.fromCharCode(g.authuri.length)+g.authuri+String.fromCharCode(q.length)+q+String.fromCharCode(J.length)+J+String.fromCharCode(u.length)+u;if(l==4){n+=(String.fromCharCode(D.length)+D)}g.xxSend(n)}else{if(K==0){if(g.protocol==1){var z=10000;var O=100;var N=0;var I=10000;var H=100;var w=0;g.xxSend(String.fromCharCode(32,0,0,0)+IntToStrX(g.amtsequence++)+ShortToStrX(z)+ShortToStrX(O)+ShortToStrX(N)+ShortToStrX(I)+ShortToStrX(H)+ShortToStrX(w)+IntToStrX(0))}if(g.protocol==2){g.xxSend(String.fromCharCode(64,0,0,0,0,0,0,0))}if(g.protocol==3){g.connectstate=1;g.xxStateChange(3)}}else{g.Stop(3)}}}break;case 33:if(g.amtaccumulator.length<23){break}p=23;g.xxSend(String.fromCharCode(39,0,0,0)+IntToStrX(g.amtsequence++)+String.fromCharCode(0,0,27,0,0,0));if(g.protocol==1){g.amtkeepalivetimer=setInterval(g.xxSendAmtKeepAlive,2000)}g.connectstate=1;g.xxStateChange(3);break;case 41:if(g.amtaccumulator.length<10){break}p=10;break;case 42:if(g.amtaccumulator.length<10){break}var r=(10+((g.amtaccumulator.charCodeAt(9)&255)<<8)+(g.amtaccumulator.charCodeAt(8)&255));if(g.amtaccumulator.length<r){break}g.m.ProcessData(g.amtaccumulator.substring(10,r));p=r;break;case 43:if(g.amtaccumulator.length<8){break}p=8;break;case 65:if(g.amtaccumulator.length<8){break}g.connectstate=1;g.m.Start();if(g.amtaccumulator.length>8){g.m.ProcessData(g.amtaccumulator.substring(8))}p=g.amtaccumulator.length;break;default:console.log("Unknown Intel AMT command: "+g.amtaccumulator.charCodeAt(0)+" acclen="+g.amtaccumulator.length);g.Stop(4);return}if(p==0){return}g.amtaccumulator=g.amtaccumulator.substring(p)}};g.xxSend=function(k){if(g.socket!=null&&g.socket.readyState==WebSocket.OPEN){if(g.debugmode==1){console.log("Send",k)}var h=new Uint8Array(k.length);for(var j=0;j<k.length;++j){h[j]=k.charCodeAt(j)}g.socket.send(h.buffer)}};g.send=function(h){if(g.socket==null||g.connectstate!=1){return}if(g.protocol==1){g.xxSend(String.fromCharCode(40,0,0,0)+IntToStrX(g.amtsequence++)+ShortToStrX(h.length)+h)}else{g.xxSend(h)}};g.xxSendAmtKeepAlive=function(){if(g.socket==null){return}g.xxSend(String.fromCharCode(43,0,0,0)+IntToStrX(g.amtsequence++))};g.xxRandomNonceX="abcdef0123456789";g.xxRandomNonce=function(j){var k="";for(var h=0;h<j;h++){k+=g.xxRandomNonceX.charAt(Math.floor(Math.random()*g.xxRandomNonceX.length))}return k};g.xxOnSocketClosed=function(){if(g.debugmode==1){console.log("onSocketClosed")}if((g.inDataCount==0)&&(g.tlsv1only==0)){g.tlsv1only=1;g.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="+g.host+"&port="+g.port+"&tls="+g.tls+"&tls1only=1"+((g.user=="*")?"&serverauth=1":"")+((typeof pass==="undefined")?("&serverauth=1&user="+g.user):""));g.socket.onopen=g.xxOnSocketConnected;g.socket.onmessage=g.xxOnMessage;g.socket.onclose=g.xxOnSocketClosed}else{g.Stop(5)}};g.xxStateChange=function(h){if(g.State==h){return}g.State=h;g.m.xxStateChange(g.State);if(g.onStateChanged!=null){g.onStateChanged(g,g.State)}};g.Stop=function(h){if(g.debugmode==1){console.log("onSocketStop",h)}g.xxStateChange(0);g.connectstate=-1;g.amtaccumulator="";if(g.socket!=null){g.socket.close();g.socket=null}if(g.amtkeepalivetimer!=null){clearInterval(g.amtkeepalivetimer);g.amtkeepalivetimer=null}};g.RedirectStartSol=String.fromCharCode(16,0,0,0,83,79,76,32);g.RedirectStartKvm=String.fromCharCode(16,1,0,0,75,86,77,82);g.RedirectStartIder=String.fromCharCode(16,0,0,0,73,68,69,82);return g};var CreateWsmanComm=function(l,o,q,n,p){var m={};m.PendingAjax=[];m.ActiveAjaxCount=0;m.MaxActiveAjaxCount=1;m.FailAllError=0;m.challengeParams=null;m.noncecounter=1;m.authcounter=0;m.socket=null;m.socketState=0;m.host=l;m.port=o;m.user=q;m.pass=n;m.tls=p;m.tlsv1only=1;m.cnonce=Math.random().toString(36).substring(7);m.PerformAjax=function(t,s,v,u,w,r){if(m.ActiveAjaxCount<m.MaxActiveAjaxCount&&m.PendingAjax.length==0){m.PerformAjaxEx(t,s,v,w,r)}else{if(u==1){m.PendingAjax.unshift([t,s,v,w,r])}else{m.PendingAjax.push([t,s,v,w,r])}}};m.PerformNextAjax=function(){if(m.ActiveAjaxCount>=m.MaxActiveAjaxCount||m.PendingAjax.length==0){return}var r=m.PendingAjax.shift();m.PerformAjaxEx(r[0],r[1],r[2],r[3],r[4]);m.PerformNextAjax()};m.PerformAjaxEx=function(t,s,u,v,r){if(m.FailAllError!=0){m.gotNextMessagesError({status:m.FailAllError},"error",null,[t,s,u,v,r]);return}if(!t){t=""}m.ActiveAjaxCount++;return m.PerformAjaxExNodeJS(t,s,u,v,r)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(t,s,u,v,r){m.PerformAjaxExNodeJS2(t,s,u,v,r,3)};m.PerformAjaxExNodeJS2=function(t,s,v,w,r,u){if(u<=0||m.FailAllError!=0){m.ActiveAjaxCount--;if(m.FailAllError!=999){m.gotNextMessages(null,"error",{status:((m.FailAllError==0)?408:m.FailAllError)},[t,s,v,w,r])}m.PerformNextAjax();return}m.pendingAjaxCall.push([t,s,v,w,r,u]);if(m.socketState==0){m.xxConnectHttpSocket()}else{if(m.socketState==2){m.sendRequest(t,w,r)}}};m.sendRequest=function(t,v,r){v=v?v:"/wsman";r=r?r:"POST";var s=r+" "+v+" HTTP/1.1\r\n";if(m.challengeParams!=null){var u=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(r+":"+v));s+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:v,qop:m.challengeParams.qop,response:u,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}s+="Host: "+m.host+":"+m.port+"\r\nTransfer-Encoding: chunked\r\n\r\n"+t.length.toString(16).toUpperCase()+"\r\n"+t+"\r\n0\r\n\r\n";g(s)};m.parseDigest=function(r){var s=r.substring(7).split(",");for(i in s){s[i]=s[i].trim()}return s.reduce(function(t,v){var u=v.split("=");t[u[0]]=u[1].replace(/"/g,"");return t},{})};m.renderDigest=function(r){var s=[];for(i in r){s.push(i)}return"Digest "+s.reduce(function(u,t){return u+","+t+'="'+r[t]+'"'},"").substring(1)};m.xxConnectHttpSocket=function(){m.socketParseState=0;m.socketAccumulator="";m.socketHeader=null;m.socketData="";m.socketState=1;console.log(m.tlsv1only);m.socket=new WebSocket(window.location.protocol.replace("http","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+"&tlsv1only="+m.tlsv1only+((q=="*")?"&serverauth=1":"")+((typeof n==="undefined")?("&serverauth=1&user="+q):""));m.socket.onopen=c;m.socket.onmessage=a;m.socket.onclose=b};function c(){m.socketState=2;for(i in m.pendingAjaxCall){m.sendRequest(m.pendingAjaxCall[i][0],m.pendingAjaxCall[i][3],m.pendingAjaxCall[i][4])}}var h=new FileReader();var k=false,j=[];if(h.readAsBinaryString){h.onload=function(r){d(r.target.result);if(j.length==0){k=false}else{h.readAsBinaryString(new Blob([j.shift()]))}}}else{if(h.readAsArrayBuffer){h.onloadend=function(r){d(r.target.result);if(j.length==0){k=false}else{h.readAsArrayBuffer(j.shift())}}}}function a(t){if(typeof t.data=="object"){if(k==true){j.push(t.data);return}if(h.readAsBinaryString){k=true;h.readAsBinaryString(new Blob([t.data]))}else{if(h.readAsArrayBuffer){k=true;h.readAsArrayBuffer(t.data)}else{var r="",s=new Uint8Array(t.data),v=s.byteLength;for(var u=0;u<v;u++){r+=String.fromCharCode(s[u])}d(r)}}}else{d(t.data)}}function d(v){if(typeof v==="object"){var r="",s=new Uint8Array(v),y=s.byteLength;for(var x=0;x<y;x++){r+=String.fromCharCode(s[x])}v=r}else{if(typeof v!=="string"){return}}m.socketAccumulator+=v;while(true){if(m.socketParseState==0){var w=m.socketAccumulator.indexOf("\r\n\r\n");if(w<0){return}m.socketHeader=m.socketAccumulator.substring(0,w).split("\r\n");m.socketAccumulator=m.socketAccumulator.substring(w+4);m.socketParseState=1;m.socketData="";m.socketXHeader={Directive:m.socketHeader[0].split(" ")};for(x in m.socketHeader){if(x!=0){var z=m.socketHeader[x].indexOf(":");m.socketXHeader[m.socketHeader[x].substring(0,z).toLowerCase()]=m.socketHeader[x].substring(z+2)}}}if(m.socketParseState==1){var u=-1;if((m.socketXHeader.connection!=undefined)&&(m.socketXHeader.connection.toLowerCase()=="close")&&((m.socketXHeader["transfer-encoding"]==undefined)||(m.socketXHeader["transfer-encoding"].toLowerCase()!="chunked"))){u=0}else{if(m.socketXHeader["content-length"]!=undefined){u=parseInt(m.socketXHeader["content-length"]);if(m.socketAccumulator.length<u){return}var v=m.socketAccumulator.substring(0,u);m.socketAccumulator=m.socketAccumulator.substring(u);m.socketData=v;u=0}else{var t=m.socketAccumulator.indexOf("\r\n");if(t<0){return}u=parseInt(m.socketAccumulator.substring(0,t),16);if(isNaN(u)){if(m.websocket){m.websocket.close()}return}if(m.socketAccumulator.length<t+2+u+2){return}var v=m.socketAccumulator.substring(t+2,t+2+u);m.socketAccumulator=m.socketAccumulator.substring(t+2+u+2);m.socketData+=v}}if(u==0){e(m.socketXHeader,m.socketData);m.socketParseState=0;m.socketHeader=null}}}}function e(u,t){var w=parseInt(u.Directive[1]);if(isNaN(w)){w=602}if(w==401&&++(m.authcounter)<3){m.challengeParams=m.parseDigest(u["www-authenticate"])}else{var v=m.pendingAjaxCall.shift();m.authcounter=0;m.ActiveAjaxCount--;m.gotNextMessages(t,"success",{status:w},v);m.PerformNextAjax()}}function b(s){m.socketState=0;if(m.socket!=null){m.socket.close();m.socket=null}if(m.pendingAjaxCall.length>0){var t=m.pendingAjaxCall.shift();var u=t[5];m.PerformAjaxExNodeJS2(t[0],t[1],t[2],t[3],t[4],--u)}}function g(u){if(m.socketState==2&&m.socket!=null&&m.socket.readyState==WebSocket.OPEN){var r=new Uint8Array(u.length);for(var t=0;t<u.length;++t){r[t]=u.charCodeAt(t)}try{m.socket.send(r.buffer)}catch(s){}}}m.gotNextMessages=function(s,u,t,r){if(m.FailAllError==999){return}if(m.FailAllError!=0){r[1](null,m.FailAllError,r[2]);return}if(t.status!=200){r[1](null,t.status,r[2]);return}r[1](s,200,r[2])};m.gotNextMessagesError=function(t,u,s,r){if(m.FailAllError==999){return}if(m.FailAllError!=0){r[1](null,m.FailAllError,r[2]);return}r[1](m,null,{Header:{HttpError:t.status}},t.status,r[2])};m.CancelAllQueries=function(r){while(m.PendingAjax.length>0){var t=m.PendingAjax.shift();t[1](null,r,t[2])}if(m.websocket!=null){m.websocket.close();m.websocket=null;m.socketState=0}};return m};var CreateAgentRedirect=function(e,g,k,a){var h={};h.m=g;g.parent=h;h.meshserver=e;h.authCookie=a;h.State=0;h.nodeid=null;h.socket=null;h.connectstate=-1;h.tunnelid=Math.random().toString(36).substring(2);h.protocol=g.protocol;h.onStateChanged=null;h.ctrlMsgAllowed=true;h.attemptWebRTC=false;h.webRtcActive=false;h.webSwitchOk=false;h.webchannel=null;h.webrtc=null;h.debugmode=0;h.Start=function(l){var n,m=window.location.protocol.replace("http","ws")+"//"+window.location.host+window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))+"/meshrelay.ashx?id="+h.tunnelid;if((a!=null)&&(a!="")){m+="&auth="+a}h.nodeid=l;h.connectstate=0;h.socket=new WebSocket(m);h.socket.onopen=h.xxOnSocketConnected;h.socket.onmessage=h.xxOnMessage;h.socket.onerror=function(o){};h.socket.onclose=h.xxOnSocketClosed;h.xxStateChange(1);h.meshserver.send({action:"msg",type:"tunnel",nodeid:h.nodeid,value:"*/meshrelay.ashx?id="+h.tunnelid})};h.xxOnSocketConnected=function(){if(h.debugmode==1){console.log("onSocketConnected")}h.xxStateChange(2)};h.xxOnControlCommand=function(n){var l;try{l=JSON.parse(n)}catch(m){return}if(l.ctrlChannel!="102938"){h.xxOnSocketData(n);return}if(h.webrtc!=null){if(l.type=="answer"){h.webrtc.setRemoteDescription(new RTCSessionDescription(l),function(){},h.xxCloseWebRTC)}else{if(l.type=="webrtc0"){h.webSwitchOk=true;j()}else{if(l.type=="webrtc1"){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc2"}')}else{if(l.type=="webrtc2"){}}}}}};h.sendCtrlMsg=function(m){if(h.ctrlMsgAllowed==true){if((typeof args!="undefined")&&args.redirtrace){console.log("RedirSend",typeof m,m)}try{h.socket.send(m)}catch(l){}}};function j(){if((h.webSwitchOk==true)&&(h.webRtcActive==true)){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc0"}');h.sendCtrlMsg('{"ctrlChannel":"102938","type":"webrtc1"}');if(h.onStateChanged!=null){h.onStateChanged(h,h.State)}}}h.xxOnMessage=function(o){if(h.State<3){if(o.data=="c"){try{h.socket.send(h.protocol)}catch(p){}h.xxStateChange(3);if(h.attemptWebRTC==true){var n=null;if(typeof RTCPeerConnection!=="undefined"){h.webrtc=new RTCPeerConnection(n)}else{if(typeof webkitRTCPeerConnection!=="undefined"){h.webrtc=new webkitRTCPeerConnection(n)}}if(h.webrtc!=null){h.webchannel=h.webrtc.createDataChannel("DataChannel",{});h.webchannel.onmessage=h.xxOnMessage;h.webchannel.onopen=function(){h.webRtcActive=true;j()};h.webchannel.onclose=function(s){if(h.webRtcActive){h.Stop()}};h.webrtc.onicecandidate=function(s){if(s.candidate==null){try{h.socket.send(JSON.stringify(h.webrtcoffer))}catch(t){}}else{h.webrtcoffer.sdp+=("a="+s.candidate.candidate+"\r\n")}};h.webrtc.oniceconnectionstatechange=function(){if(h.webrtc!=null){if(h.webrtc.iceConnectionState=="disconnected"){if(h.webRtcActive==true){h.Stop()}else{h.xxCloseWebRTC()}}else{if(h.webrtc.iceConnectionState=="failed"){h.xxCloseWebRTC()}}}};h.webrtc.createOffer(function(s){h.webrtcoffer=s;h.webrtc.setLocalDescription(s,function(){},h.xxCloseWebRTC)},h.xxCloseWebRTC,{mandatory:{OfferToReceiveAudio:false,OfferToReceiveVideo:false}})}}return}}if(typeof o.data=="string"){h.xxOnControlCommand(o.data);return}if(typeof o.data=="object"){if(d==true){c.push(o.data);return}if(b.readAsBinaryString){d=true;b.readAsBinaryString(new Blob([o.data]))}else{if(b.readAsArrayBuffer){d=true;b.readAsArrayBuffer(o.data)}else{var l="",m=new Uint8Array(o.data),r=m.byteLength;for(var q=0;q<r;q++){l+=String.fromCharCode(m[q])}h.xxOnSocketData(l)}}}else{h.xxOnSocketData(o.data)}};var b=new FileReader();var d=false,c=[];if(b.readAsBinaryString){b.onload=function(l){h.xxOnSocketData(l.target.result);if(c.length==0){d=false}else{b.readAsBinaryString(new Blob([c.shift()]))}}}else{if(b.readAsArrayBuffer){b.onloadend=function(l){h.xxOnSocketData(l.target.result);if(c.length==0){d=false}else{b.readAsArrayBuffer(c.shift())}}}}h.xxOnSocketData=function(n){if(!n||h.connectstate==-1){return}if(typeof n==="object"){var l="",m=new Uint8Array(n),p=m.byteLength;for(var o=0;o<p;o++){l+=String.fromCharCode(m[o])}n=l}else{if(typeof n!=="string"){return}}if((typeof args!="undefined")&&args.redirtrace){console.log("RedirRecv",typeof n,n.length,n)}return h.m.ProcessData(n)};h.sendText=function(l){if(typeof l!="string"){l=JSON.stringify(l)}h.send(encode_utf8(l))};h.send=function(p){if((typeof args!="undefined")&&args.redirtrace){console.log("RedirSend",typeof p,p.length,p)}try{if(h.socket!=null&&h.socket.readyState==WebSocket.OPEN){if(typeof p=="string"){if(h.debugmode==1){var l=new Uint8Array(p.length),m=[];for(var o=0;o<p.length;++o){l[o]=p.charCodeAt(o);m.push(p.charCodeAt(o))}if(h.webRtcActive==true){h.webchannel.send(l.buffer)}else{h.socket.send(l.buffer)}}else{var l=new Uint8Array(p.length);for(var o=0;o<p.length;++o){l[o]=p.charCodeAt(o)}if(h.webRtcActive==true){h.webchannel.send(l.buffer)}else{h.socket.send(l.buffer)}}}else{if(h.webRtcActive==true){h.webchannel.send(p)}else{h.socket.send(p)}}}}catch(n){}};h.xxOnSocketClosed=function(){h.Stop(1)};h.xxStateChange=function(l){if(h.State==l){return}h.State=l;h.m.xxStateChange(h.State);if(h.onStateChanged!=null){h.onStateChanged(h,h.State)}};h.xxCloseWebRTC=function(){if(h.webchannel!=null){try{h.webchannel.close()}catch(l){}h.webchannel=null}if(h.webrtc!=null){try{h.webrtc.close()}catch(l){}h.webrtc=null}h.webRtcActive=false};h.Stop=function(m){if(h.debugmode==1){console.log("stop",m)}h.xxCloseWebRTC();h.connectstate=-1;if(h.socket!=null){try{if(h.socket.readyState==1){h.sendCtrlMsg('{"ctrlChannel":"102938","type":"close"}');h.socket.close()}}catch(l){}h.socket=null}h.xxStateChange(0)};return h};var CreateKvmDataChannel=function(h,e,d){var g={};g.m=e;e.parent=g;g.webchannel=h;g.State=0;g.protocol=e.protocol;g.onStateChanged=null;g.onControlMsg=null;g.debugmode=0;g.keepalive=d;g.rtcKeepAlive=null;g.Start=function(){if(g.debugmode==1){console.log("start")}g.xxStateChange(3);g.webchannel.onmessage=g.xxOnMessage;g.rtcKeepAlive=setInterval(g.xxSendRtcKeepAlive,30000)};var a=new FileReader();var c=false,b=[];if(a.readAsBinaryString){a.onload=function(j){g.xxOnSocketData(j.target.result);if(b.length==0){c=false}else{a.readAsBinaryString(new Blob([b.shift()]))}}}else{if(a.readAsArrayBuffer){a.onloadend=function(j){g.xxOnSocketData(j.target.result);if(b.length==0){c=false}else{a.readAsArrayBuffer(b.shift())}}}}g.xxOnMessage=function(l){if(typeof l.data=="string"){if(g.onControlMsg!=null){g.onControlMsg(l.data)}return}if(typeof l.data=="object"){if(c==true){b.push(l.data);return}if(a.readAsBinaryString){c=true;a.readAsBinaryString(new Blob([l.data]))}else{if(f.readAsArrayBuffer){c=true;a.readAsArrayBuffer(l.data)}else{var j="",k=new Uint8Array(l.data),n=k.byteLength;for(var m=0;m<n;m++){j+=String.fromCharCode(k[m])}g.xxOnSocketData(j)}}}else{g.xxOnSocketData(l.data)}};g.xxOnSocketData=function(l){if(!l){return}if(typeof l==="object"){var j="",k=new Uint8Array(l),n=k.byteLength;for(var m=0;m<n;m++){j+=String.fromCharCode(k[m])}l=j}else{if(typeof l!=="string"){return}}return g.m.ProcessData(l)};g.sendCtrlMsg=function(j){if(typeof j=="string"){g.webchannel.send(j);if(g.keepalive!=null){g.keepalive.sendKeepAlive()}}};g.send=function(l){if(typeof l=="string"){var j=new Uint8Array(l.length);for(var k=0;k<l.length;++k){j[k]=l.charCodeAt(k)}l=j}g.webchannel.send(l)};g.xxStateChange=function(j){if(g.State==j){return}g.State=j;g.m.xxStateChange(g.State);if(g.onStateChanged!=null){g.onStateChanged(g,g.State)}};g.Stop=function(){if(g.debugmode==1){console.log("stop")}if(g.rtcKeepAlive!=null){clearInterval(g.rtcKeepAlive);g.rtcKeepAlive=null}g.xxStateChange(0)};g.xxSendRtcKeepAlive=function(){g.sendCtrlMsg(JSON.stringify({action:"ping"}))};return g};var CreateAgentRemoteDesktop=function(a,e){var d={};d.CanvasId=a;if(typeof a==="string"){d.CanvasId=Q(a)}d.Canvas=d.CanvasId.getContext("2d");d.scrolldiv=e;d.State=0;d.PendingOperations=[];d.tilesReceived=0;d.TilesDrawn=0;d.KillDraw=0;d.ipad=false;d.tabletKeyboardVisible=false;d.LastX=0;d.LastY=0;d.touchenabled=0;d.submenuoffset=0;d.touchtimer=null;d.TouchArray={};d.connectmode=0;d.connectioncount=0;d.rotation=0;d.protocol=2;d.debugmode=0;d.firstUpKeys=[];d.stopInput=false;d.sessionid=0;d.username;d.oldie=false;d.CompressionLevel=50;d.ScalingLevel=1024;d.FrameRateTimer=50;d.FirstDraw=false;d.ScreenWidth=960;d.ScreenHeight=700;d.width=960;d.height=960;d.onScreenSizeChange=null;d.onMessage=null;d.onConnectCountChanged=null;d.onDebugMessage=null;d.onTouchEnabledChanged=null;d.onDisplayinfo=null;d.accumulator=null;d.Start=function(){d.State=0;d.accumulator=null};d.Stop=function(){d.setRotation(0);d.UnGrabKeyInput();d.UnGrabMouseInput();d.touchenabled=0;if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}d.Canvas.clearRect(0,0,d.CanvasId.width,d.CanvasId.height)};d.xxStateChange=function(g){if(d.State==g){return}d.State=g;d.CanvasId.style.cursor="default";switch(g){case 0:d.Stop();break;case 3:break}};d.send=function(g){if(d.debugmode>1){console.log("KSend("+g.length+"): "+rstr2hex(g))}d.parent.send(g)};d.ProcessPictureMsg=function(h,k,l){var j=new Image();j.xcount=d.tilesReceived++;var g=d.tilesReceived;j.src="data:image/jpeg;base64,"+btoa(h.substring(4,h.length));j.onload=function(){if(d.Canvas!=null&&d.KillDraw<g&&d.State!=0){d.PendingOperations.push([g,2,j,k,l]);while(d.DoPendingOperations()){}}};j.error=function(){console.log("DecodeTileError")}};d.DoPendingOperations=function(){if(d.PendingOperations.length==0){return false}for(var g=0;g<d.PendingOperations.length;g++){var h=d.PendingOperations[g];if(h[0]==(d.TilesDrawn+1)){if(h[1]==1){d.ProcessCopyRectMsg(h[2])}else{if(h[1]==2){d.Canvas.drawImage(h[2],d.rotX(h[3],h[4]),d.rotY(h[3],h[4]));delete h[2]}}d.PendingOperations.splice(g,1);delete h;d.TilesDrawn++;if(d.TilesDrawn==d.tilesReceived&&d.KillDraw<d.TilesDrawn){d.KillDraw=d.TilesDrawn=d.tilesReceived=0}return true}}if(d.oldie&&d.PendingOperations.length>0){d.TilesDrawn++}return false};d.ProcessCopyRectMsg=function(k){var l=((k.charCodeAt(0)&255)<<8)+(k.charCodeAt(1)&255);var m=((k.charCodeAt(2)&255)<<8)+(k.charCodeAt(3)&255);var g=((k.charCodeAt(4)&255)<<8)+(k.charCodeAt(5)&255);var h=((k.charCodeAt(6)&255)<<8)+(k.charCodeAt(7)&255);var n=((k.charCodeAt(8)&255)<<8)+(k.charCodeAt(9)&255);var j=((k.charCodeAt(10)&255)<<8)+(k.charCodeAt(11)&255);d.Canvas.drawImage(Canvas.canvas,l,m,n,j,g,h,n,j)};d.SendUnPause=function(){d.send(String.fromCharCode(0,8,0,5,0))};d.SendPause=function(){d.send(String.fromCharCode(0,8,0,5,1))};d.SendCompressionLevel=function(k,h,j,g){if(h){d.CompressionLevel=h}if(j){d.ScalingLevel=j}if(g){d.FrameRateTimer=g}d.send(String.fromCharCode(0,5,0,10,k,d.CompressionLevel)+d.shortToStr(d.ScalingLevel)+d.shortToStr(d.FrameRateTimer))};d.SendRefresh=function(){d.send(String.fromCharCode(0,6,0,4))};d.ProcessScreenMsg=function(h,g){if(d.debugmode>0){console.log("ScreenSize: "+h+" x "+g)}d.Canvas.setTransform(1,0,0,1,0,0);d.rotation=0;d.FirstDraw=true;d.ScreenWidth=d.width=h;d.ScreenHeight=d.height=g;d.KillDraw=d.tilesReceived;while(d.PendingOperations.length>0){d.PendingOperations.shift()}d.SendCompressionLevel(1);d.SendUnPause();if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}};d.ProcessData=function(h){var g=0;while(g<h.length){g+=d.ProcessDataEx(h.substring(g))}};d.ProcessDataEx=function(r){if(d.accumulator!=null){r=d.accumulator+r;console.log("KVM using accumulated data, total size is now "+r.length+" bytes.");d.accumulator=null}if(d.debugmode>1){console.log("KRecv("+r.length+"): "+rstr2hex(r.substring(0,Math.min(r.length,40))))}if(r.length<4){return}var g=null,s=0,t=0,j=ReadShort(r,0),h=ReadShort(r,2),n=0;if((j==27)&&(h==8)){if(r.length<12){return}j=ReadShort(r,8);h=ReadInt(r,4);if((h+8)>r.length){console.log("KVM accumulator set to "+r.length+" bytes, need "+h+" bytes.");d.accumulator=r;return}r=r.substring(8);n=8}if((h!=r.length)&&(d.debugmode>0)){console.log(h,r.length,h==r.length)}if((j>=18)&&(j!=65)){console.error("Invalid KVM command "+j+" of size "+h);console.log("Invalid KVM data",r.length,rstr2hex(r.substring(0,40))+"...");return}if(h>r.length){console.log("KVM accumulator set to "+r.length+" bytes, need "+h+" bytes.");d.accumulator=r;return}if(j==3||j==4||j==7){g=r.substring(4,h);s=((g.charCodeAt(0)&255)<<8)+(g.charCodeAt(1)&255);t=((g.charCodeAt(2)&255)<<8)+(g.charCodeAt(3)&255);if(d.debugmode>0){console.log("CMD"+j+" at X="+s+" Y="+t)}}switch(j){case 3:if(d.FirstDraw){d.onResize()}d.ProcessPictureMsg(g,s,t);break;case 4:if(d.FirstDraw){d.onResize()}if(d.TilesDrawn==d.tilesReceived){d.ProcessCopyRectMsg(g)}else{d.PendingOperations.push([++tilesReceived,1,g])}break;case 7:d.ProcessScreenMsg(s,t);d.SendKeyMsgKC(d.KeyAction.UP,16);d.SendKeyMsgKC(d.KeyAction.UP,17);d.SendKeyMsgKC(d.KeyAction.UP,18);d.SendKeyMsgKC(d.KeyAction.UP,91);d.SendKeyMsgKC(d.KeyAction.UP,92);d.SendKeyMsgKC(d.KeyAction.UP,16);d.send(String.fromCharCode(0,14,0,4));break;case 11:var o=[],k=((r.charCodeAt(4)&255)<<8)+(r.charCodeAt(5)&255);if(k>0){var q=0,p=((r.charCodeAt(6+(k*2))&255)<<8)+(r.charCodeAt(7+(k*2))&255);for(var m=0;m<k;m++){var l=((r.charCodeAt(6+(m*2))&255)<<8)+(r.charCodeAt(7+(m*2))&255);if(l==65535){o.push("All Displays")}else{o.push("Display "+l)}if(l==p){q=m}}}if(d.onDisplayinfo!=null){d.onDisplayinfo(d,o,q)}break;case 12:break;case 14:d.touchenabled=1;d.TouchArray={};if(d.onTouchEnabledChanged!=null){d.onTouchEnabledChanged(d.touchenabled)}break;case 15:d.TouchArray={};break;case 16:d.connectioncount=ReadInt(r,4);if(d.onConnectCountChanged!=null){d.onConnectCountChanged(d.connectioncount,d)}break;case 17:if(d.onMessage!=null){d.onMessage(r.substring(4,h),d)}break;case 65:r=r.substring(4);if(r[0]!="."){console.log(r);alert("KVM: "+r)}else{console.log("KVM: "+r.substring(1))}break}return h+n};d.MouseButton={NONE:0,LEFT:2,RIGHT:8,MIDDLE:32};d.KeyAction={NONE:0,DOWN:1,UP:2,SCROLL:3,EXUP:4,EXDOWN:5,DBLCLICK:6};d.InputType={KEY:1,MOUSE:2,CTRLALTDEL:10,TOUCH:15};d.Alternate=0;var c={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,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};function b(g){if(g.code.startsWith("Key")&&g.code.length==4){return g.code.charCodeAt(3)}if(g.code.startsWith("Digit")&&g.code.length==6){return g.code.charCodeAt(5)}if(g.code.startsWith("Numpad")&&g.code.length==7){return g.code.charCodeAt(6)+48}return c[g.code]}d.SendKeyMsg=function(g,h){if(g==null){return}if(!h){h=window.event}if(h.code){var j=b(h);if(j!=null){d.SendKeyMsgKC(g,j)}}else{var j=h.keyCode;if(j==59){j=186}d.SendKeyMsgKC(g,j)}};d.SendMessage=function(g){if(d.State==3){d.send(String.fromCharCode(0,17)+d.shortToStr(4+g.length)+g)}};d.SendKeyMsgKC=function(g,j){if(d.State!=3){return}if(typeof g=="object"){for(var h in g){d.SendKeyMsgKC(g[h][0],g[h][1])}}else{d.send(String.fromCharCode(0,d.InputType.KEY,0,6,(g-1),j))}};d.sendcad=function(){d.SendCtrlAltDelMsg()};d.SendCtrlAltDelMsg=function(){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.CTRLALTDEL,0,4))}};d.SendEscKey=function(){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.KEY,0,6,0,27,0,d.InputType.KEY,0,6,1,27))}};d.SendStartMsg=function(){d.SendKeyMsgKC(d.KeyAction.EXDOWN,91);d.SendKeyMsgKC(d.KeyAction.EXUP,91)};d.SendCharmsMsg=function(){d.SendKeyMsgKC(d.KeyAction.EXDOWN,91);d.SendKeyMsgKC(d.KeyAction.DOWN,67);d.SendKeyMsgKC(d.KeyAction.UP,67);d.SendKeyMsgKC(d.KeyAction.EXUP,91)};d.SendTouchMsg1=function(h,g,j,k){if(d.State==3){d.send(String.fromCharCode(0,d.InputType.TOUCH)+d.shortToStr(14)+String.fromCharCode(1,h)+d.intToStr(g)+d.shortToStr(j)+d.shortToStr(k))}};d.SendTouchMsg2=function(j,g){var m="";var h;var n="TOUCHSEND: ";for(var l in d.TouchArray){if(l==j){h=g}else{if(d.TouchArray[l].f==1){h=65536|2|4;d.TouchArray[l].f=3;n+="START"+l}else{if(d.TouchArray[l].f==2){h=262144;n+="STOP"+l}else{h=2|4|131072}}}m+=String.fromCharCode(l)+d.intToStr(h)+d.shortToStr(d.TouchArray[l].x)+d.shortToStr(d.TouchArray[l].y);if(d.TouchArray[l].f==2){delete d.TouchArray[l]}}if(d.State==3){d.send(String.fromCharCode(0,d.InputType.TOUCH)+d.shortToStr(5+m.length)+String.fromCharCode(2)+m)}if(Object.keys(d.TouchArray).length==0&&d.touchtimer!=null){clearInterval(d.touchtimer);d.touchtimer=null}};d.SendMouseMsg=function(g,k){if(d.State!=3){return}if(g!=null&&d.Canvas!=null){if(!k){var k=window.event}var n=(d.Canvas.canvas.height/d.CanvasId.clientHeight);var o=(d.Canvas.canvas.width/d.CanvasId.clientWidth);var m=d.GetPositionOfControl(d.Canvas.canvas);var p=((k.pageX-m[0])*o);var q=((k.pageY-m[1])*n);if(p>=0&&p<=d.Canvas.canvas.width&&q>=0&&q<=d.Canvas.canvas.height){var h=0;var j=0;if(g==d.KeyAction.UP||g==d.KeyAction.DOWN){if(k.which){((k.which==1)?(h=d.MouseButton.LEFT):((k.which==2)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}else{if(k.button){((k.button==0)?(h=d.MouseButton.LEFT):((k.button==1)?(h=d.MouseButton.MIDDLE):(h=d.MouseButton.RIGHT)))}}}else{if(g==d.KeyAction.SCROLL){if(k.detail){j=(-1*(k.detail*120))}else{if(k.wheelDelta){j=(k.wheelDelta*3)}}}}var l="";if(g==d.KeyAction.DBLCLICK){l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,136,((p/256)&255),(p&255),((q/256)&255),(q&255))}else{if(g==d.KeyAction.SCROLL){l=String.fromCharCode(0,d.InputType.MOUSE,0,12,0,0,((p/256)&255),(p&255),((q/256)&255),(q&255),((j/256)&255),(j&255))}else{l=String.fromCharCode(0,d.InputType.MOUSE,0,10,0,((g==d.KeyAction.DOWN)?h:((h*2)&255)),((p/256)&255),(p&255),((q/256)&255),(q&255))}}if(d.Action==d.KeyAction.NONE){if(d.Alternate==0||d.ipad){d.send(l);d.Alternate=1}else{d.Alternate=0}}else{d.send(l)}}}};d.GetDisplayNumbers=function(){d.send(String.fromCharCode(0,11,0,4))};d.SetDisplay=function(g){d.send(String.fromCharCode(0,12,0,6,g>>8,g&255))};d.intToStr=function(g){return String.fromCharCode((g>>24)&255,(g>>16)&255,(g>>8)&255,g&255)};d.shortToStr=function(g){return String.fromCharCode((g>>8)&255,g&255)};d.onResize=function(){if(d.ScreenWidth==0||d.ScreenHeight==0){return}if(d.Canvas.canvas.width==d.ScreenWidth&&d.Canvas.canvas.height==d.ScreenHeight){return}if(d.FirstDraw){d.Canvas.canvas.width=d.ScreenWidth;d.Canvas.canvas.height=d.ScreenHeight;d.Canvas.fillRect(0,0,d.ScreenWidth,d.ScreenHeight);if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}}d.FirstDraw=false};d.xxMouseInputGrab=false;d.xxKeyInputGrab=false;d.xxMouseMove=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.NONE,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseUp=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDown=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxMouseDblClick=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.DBLCLICK,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxDOMMouseScroll=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxMouseWheel=function(g){if(d.State==3){d.SendMouseMsg(d.KeyAction.SCROLL,g);return false}return true};d.xxKeyUp=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.UP,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyDown=function(g){if(d.State==3){d.SendKeyMsg(d.KeyAction.DOWN,g)}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.xxKeyPress=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};d.handleKeys=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyPress(g)};d.handleKeyUp=function(g){if(d.stopInput==true||desktop.State!=3){return false}if(d.firstUpKeys.length<5){d.firstUpKeys.push(g.keyCode);if((d.firstUpKeys.length==5)){var h=d.firstUpKeys.join(",");if((h=="16,17,91,91,16")||(h=="16,17,18,91,92")){d.stopInput=true}}}return d.xxKeyUp(g)};d.handleKeyDown=function(g){if(d.stopInput==true||desktop.State!=3){return false}return d.xxKeyDown(g)};d.mousedblclick=function(g){if(d.stopInput==true){return false}return d.xxMouseDblClick(g)};d.mousedown=function(g){if(d.stopInput==true){return false}return d.xxMouseDown(g)};d.mouseup=function(g){if(d.stopInput==true){return false}return d.xxMouseUp(g)};d.mousemove=function(g){if(d.stopInput==true){return false}return d.xxMouseMove(g)};d.mousewheel=function(g){if(d.stopInput==true){return false}return d.xxMouseWheel(g)};d.xxMsTouchEvent=function(g){if(g.originalEvent.pointerType==4){return}if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}if(g.type=="MSPointerDown"||g.type=="MSPointerMove"||g.type=="MSPointerUp"){var h=0;var j=g.originalEvent.pointerId%256;var k=g.offsetX*(Canvas.canvas.width/d.CanvasId.clientWidth);var l=g.offsetY*(Canvas.canvas.height/d.CanvasId.clientHeight);if(g.type=="MSPointerDown"){h=65536|2|4}else{if(g.type=="MSPointerMove"){h=131072|2|4}else{if(g.type=="MSPointerUp"){h=262144}}}if(!d.TouchArray[j]){d.TouchArray[j]={x:k,y:l}}d.SendTouchMsg2(j,h);if(g.type=="MSPointerUp"){delete d.TouchArray[j]}}else{alert(g.type)}return true};d.xxTouchStart=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(KeyAction.DOWN,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(!d.TouchArray[j]){d.TouchArray[j]={x:(g.originalEvent.touches[h].pageX-k[0])*(Canvas.canvas.width/d.CanvasId.clientWidth),y:(g.originalEvent.touches[h].pageY-k[1])*(Canvas.canvas.height/d.CanvasId.clientHeight),f:1}}}if(Object.keys(d.TouchArray).length>0&&touchtimer==null){d.touchtimer=setInterval(function(){d.SendTouchMsg2(256,0)},50)}}};d.xxTouchMove=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}var l=g.originalEvent.touches[0];g.which=1;d.LastX=g.pageX=l.pageX;d.LastY=g.pageY=l.pageY;d.SendMouseMsg(d.KeyAction.NONE,g)}else{var k=d.GetPositionOfControl(Canvas.canvas);for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].x=(g.originalEvent.touches[h].pageX-k[0])*(d.Canvas.canvas.width/d.CanvasId.clientWidth);d.TouchArray[j].y=(g.originalEvent.touches[h].pageY-k[1])*(d.Canvas.canvas.height/d.CanvasId.clientHeight)}}}};d.xxTouchEnd=function(g){if(d.State!=3){return}if(g.preventDefault){g.preventDefault()}if(d.touchenabled==0||d.touchenabled==1){if(g.originalEvent.touches.length>1){return}g.which=1;g.pageX=LastX;g.pageY=LastY;d.SendMouseMsg(KeyAction.UP,g)}else{for(var h in g.originalEvent.changedTouches){if(!g.originalEvent.changedTouches[h].identifier){continue}var j=g.originalEvent.changedTouches[h].identifier%256;if(d.TouchArray[j]){d.TouchArray[j].f=2}}}};d.GrabMouseInput=function(){if(d.xxMouseInputGrab==true){return}var g=d.CanvasId;g.onmousemove=d.xxMouseMove;g.onmouseup=d.xxMouseUp;g.onmousedown=d.xxMouseDown;g.touchstart=d.xxTouchStart;g.touchmove=d.xxTouchMove;g.touchend=d.xxTouchEnd;g.MSPointerDown=d.xxMsTouchEvent;g.MSPointerMove=d.xxMsTouchEvent;g.MSPointerUp=d.xxMsTouchEvent;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=d.xxDOMMouseScroll}else{g.onmousewheel=d.xxMouseWheel}d.xxMouseInputGrab=true};d.UnGrabMouseInput=function(){if(d.xxMouseInputGrab==false){return}var g=d.CanvasId;g.onmousemove=null;g.onmouseup=null;g.onmousedown=null;g.touchstart=null;g.touchmove=null;g.touchend=null;g.MSPointerDown=null;g.MSPointerMove=null;g.MSPointerUp=null;if(navigator.userAgent.match(/mozilla/i)){g.DOMMouseScroll=null}else{g.onmousewheel=null}d.xxMouseInputGrab=false};d.GrabKeyInput=function(){if(d.xxKeyInputGrab==true){return}document.onkeyup=d.xxKeyUp;document.onkeydown=d.xxKeyDown;document.onkeypress=d.xxKeyPress;d.xxKeyInputGrab=true};d.UnGrabKeyInput=function(){if(d.xxKeyInputGrab==false){return}document.onkeyup=null;document.onkeydown=null;document.onkeypress=null;d.xxKeyInputGrab=false};d.GetPositionOfControl=function(g){var h=Array(2);h[0]=h[1]=0;while(g){h[0]+=g.offsetLeft;h[1]+=g.offsetTop;g=g.offsetParent}return h};d.crotX=function(g,h){if(d.rotation==0){return g}if(d.rotation==1){return h}if(d.rotation==2){return d.Canvas.canvas.width-g}if(d.rotation==3){return d.Canvas.canvas.height-h}};d.crotY=function(g,h){if(d.rotation==0){return h}if(d.rotation==1){return d.Canvas.canvas.width-g}if(d.rotation==2){return d.Canvas.canvas.height-h}if(d.rotation==3){return g}};d.rotX=function(g,h){if(d.rotation==0||d.rotation==1){return g}if(d.rotation==2){return g-d.Canvas.canvas.width}if(d.rotation==3){return g-d.Canvas.canvas.height}};d.rotY=function(g,h){if(d.rotation==0||d.rotation==3){return h}if(d.rotation==1){return h-d.Canvas.canvas.width}if(d.rotation==2){return h-d.Canvas.canvas.height}};d.tcanvas=null;d.setRotation=function(l){while(l<0){l+=4}var g=l%4;if(g==d.rotation){return true}var j=d.Canvas.canvas.width;var h=d.Canvas.canvas.height;if(d.rotation==1||d.rotation==3){j=d.Canvas.canvas.height;h=d.Canvas.canvas.width}if(d.tcanvas==null){d.tcanvas=document.createElement("canvas")}var k=d.tcanvas.getContext("2d");k.setTransform(1,0,0,1,0,0);k.canvas.width=j;k.canvas.height=h;k.rotate((d.rotation*-90)*Math.PI/180);if(d.rotation==0){k.drawImage(d.Canvas.canvas,0,0)}if(d.rotation==1){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,0)}if(d.rotation==2){k.drawImage(d.Canvas.canvas,-d.Canvas.canvas.width,-d.Canvas.canvas.height)}if(d.rotation==3){k.drawImage(d.Canvas.canvas,0,-d.Canvas.canvas.height)}if(d.rotation==0||d.rotation==2){d.Canvas.canvas.height=j;d.Canvas.canvas.width=h}if(d.rotation==1||d.rotation==3){d.Canvas.canvas.height=h;d.Canvas.canvas.width=j}d.Canvas.setTransform(1,0,0,1,0,0);d.Canvas.rotate((g*90)*Math.PI/180);d.rotation=g;d.Canvas.drawImage(d.tcanvas,d.rotX(0,0),d.rotY(0,0));d.ScreenWidth=d.Canvas.canvas.width;d.ScreenHeight=d.Canvas.canvas.height;if(d.onScreenSizeChange!=null){d.onScreenSizeChange(d,d.ScreenWidth,d.ScreenHeight,d.CanvasId)}return true};d.MuchTheSame=function(g,h){return(Math.abs(g-h)<4)};d.Debug=function(g){console.log(g)};d.getIEVersion=function(){var g=-1;if(navigator.appName=="Microsoft Internet Explorer"){var j=navigator.userAgent;var h=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(h.exec(j)!=null){g=parseFloat(RegExp.$1)}}return g};d.haltEvent=function(g){if(g.preventDefault){g.preventDefault()}if(g.stopPropagation){g.stopPropagation()}return false};return d};var QRCode;!function(){function t(c){this.mode=v.MODE_8BIT_BYTE,this.data=c,this.parsedData=[];for(var g=[],h=0,j=this.data.length;j>h;h++){var k=this.data.charCodeAt(h);k>65536?(g[0]=240|(1835008&k)>>>18,g[1]=128|(258048&k)>>>12,g[2]=128|(4032&k)>>>6,g[3]=128|63&k):k>2048?(g[0]=224|(61440&k)>>>12,g[1]=128|(4032&k)>>>6,g[2]=128|63&k):k>128?(g[0]=192|(1984&k)>>>6,g[1]=128|63&k):g[0]=k,this.parsedData=this.parsedData.concat(g)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function u(c,d){this.typeNumber=c,this.errorCorrectLevel=d,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function B(e,g){if(void 0==e.length){throw new Error(e.length+"/"+g)}for(var h=0;h<e.length&&0==e[h];){h++}this.num=new Array(e.length-h+g);for(var j=0;j<e.length-h;j++){this.num[j]=e[j+h]}}function C(c,d){this.totalCount=c,this.dataCount=d}function D(){this.buffer=[],this.length=0}function F(){return"undefined"!=typeof CanvasRenderingContext2D}function G(){var c=!1,d=navigator.userAgent;return/android/i.test(d)&&(c=!0,aMat=d.toString().match(/android ([0-9]\.[0-9])/i),aMat&&aMat[1]&&(c=parseFloat(aMat[1]))),c}function K(d,j){for(var k=1,l=L(d),m=0,n=E.length;n>=m;m++){var o=0;switch(j){case w.L:o=E[m][0];break;case w.M:o=E[m][1];break;case w.Q:o=E[m][2];break;case w.H:o=E[m][3]}if(o>=l){break}k++}if(k>E.length){throw new Error("Too long data")}return k}function L(c){var d=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return d.length+(d.length!=c?3:0)}t.prototype={getLength:function(){return this.parsedData.length},write:function(d){for(var e=0,g=this.parsedData.length;g>e;e++){d.put(this.parsedData[e],8)}}},u.prototype={addData:function(a){var d=new t(a);this.dataList.push(d),this.dataCache=null},isDark:function(c,d){if(0>c||this.moduleCount<=c||0>d||this.moduleCount<=d){throw new Error(c+","+d)}return this.modules[c][d]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(b,g){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var h=0;h<this.moduleCount;h++){this.modules[h]=new Array(this.moduleCount);for(var j=0;j<this.moduleCount;j++){this.modules[h][j]=null}}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(b,g),this.typeNumber>=7&&this.setupTypeNumber(b),null==this.dataCache&&(this.dataCache=u.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,g)},setupPositionProbePattern:function(e,g){for(var h=-1;7>=h;h++){if(!(-1>=e+h||this.moduleCount<=e+h)){for(var j=-1;7>=j;j++){-1>=g+j||this.moduleCount<=g+j||(this.modules[e+h][g+j]=h>=0&&6>=h&&(0==j||6==j)||j>=0&&6>=j&&(0==h||6==h)||h>=2&&4>=h&&j>=2&&4>=j?!0:!1)}}}},getBestMaskPattern:function(){for(var e=0,g=0,h=0;8>h;h++){this.makeImpl(!0,h);var j=y.getLostPoint(this);(0==h||e>j)&&(e=j,g=h)}return g},createMovieClip:function(k,l,m){var n=k.createEmptyMovieClip(l,m),o=1;this.make();for(var p=0;p<this.modules.length;p++){for(var q=p*o,r=0;r<this.modules[p].length;r++){var s=r*o,M=this.modules[p][r];M&&(n.beginFill(0,100),n.moveTo(s,q),n.lineTo(s+o,q),n.lineTo(s+o,q+o),n.lineTo(s,q+o),n.endFill())}}return n},setupTimingPattern:function(){for(var c=8;c<this.moduleCount-8;c++){null==this.modules[c][6]&&(this.modules[c][6]=0==c%2)}for(var d=8;d<this.moduleCount-8;d++){null==this.modules[6][d]&&(this.modules[6][d]=0==d%2)}},setupPositionAdjustPattern:function(){for(var j=y.getPatternPosition(this.typeNumber),k=0;k<j.length;k++){for(var l=0;l<j.length;l++){var m=j[k],n=j[l];if(null==this.modules[m][n]){for(var o=-2;2>=o;o++){for(var p=-2;2>=p;p++){this.modules[m+o][n+p]=-2==o||2==o||-2==p||2==p||0==o&&0==p?!0:!1}}}}}},setupTypeNumber:function(e){for(var g=y.getBCHTypeNumber(this.typeNumber),h=0;18>h;h++){var j=!e&&1==(1&g>>h);this.modules[Math.floor(h/3)][h%3+this.moduleCount-8-3]=j}for(var h=0;18>h;h++){var j=!e&&1==(1&g>>h);this.modules[h%3+this.moduleCount-8-3][Math.floor(h/3)]=j}},setupTypeInfo:function(h,j){for(var k=this.errorCorrectLevel<<3|j,l=y.getBCHTypeInfo(k),m=0;15>m;m++){var n=!h&&1==(1&l>>m);6>m?this.modules[m][8]=n:8>m?this.modules[m+1][8]=n:this.modules[this.moduleCount-15+m][8]=n}for(var m=0;15>m;m++){var n=!h&&1==(1&l>>m);8>m?this.modules[8][this.moduleCount-m-1]=n:9>m?this.modules[8][15-m-1+1]=n:this.modules[8][15-m-1]=n}this.modules[this.moduleCount-8][8]=!h},mapData:function(l,m){for(var n=-1,o=this.moduleCount-1,p=7,q=0,r=this.moduleCount-1;r>0;r-=2){for(6==r&&r--;;){for(var s=0;2>s;s++){if(null==this.modules[o][r-s]){var M=!1;q<l.length&&(M=1==(1&l[q]>>>p));var N=y.getMask(m,o,r-s);N&&(M=!M),this.modules[o][r-s]=M,p--,-1==p&&(q++,p=7)}}if(o+=n,0>o||this.moduleCount<=o){o-=n,n=-n;break}}}}},u.PAD0=236,u.PAD1=17,u.createData=function(b,j,k){for(var m=C.getRSBlocks(b,j),n=new D,o=0;o<k.length;o++){var p=k[o];n.put(p.mode,4),n.put(p.getLength(),y.getLengthInBits(p.mode,b)),p.write(n)}for(var q=0,o=0;o<m.length;o++){q+=m[o].dataCount}if(n.getLengthInBits()>8*q){throw new Error("code length overflow. ("+n.getLengthInBits()+">"+8*q+")")}for(n.getLengthInBits()+4<=8*q&&n.put(0,4);0!=n.getLengthInBits()%8;){n.putBit(!1)}for(;;){if(n.getLengthInBits()>=8*q){break}if(n.put(u.PAD0,8),n.getLengthInBits()>=8*q){break}n.put(u.PAD1,8)}return u.createBytes(n,m)},u.createBytes=function(M,N){for(var O=0,P=0,R=0,S=new Array(N.length),T=new Array(N.length),U=0;U<N.length;U++){var V=N[U].dataCount,W=N[U].totalCount-V;P=Math.max(P,V),R=Math.max(R,W),S[U]=new Array(V);for(var X=0;X<S[U].length;X++){S[U][X]=255&M.buffer[X+O]}O+=V;var Y=y.getErrorCorrectPolynomial(W),Z=new B(S[U],Y.getLength()-1),aa=Z.mod(Y);T[U]=new Array(Y.getLength()-1);for(var X=0;X<T[U].length;X++){var ab=X+aa.getLength()-T[U].length;T[U][X]=ab>=0?aa.get(ab):0}}for(var ac=0,X=0;X<N.length;X++){ac+=N[X].totalCount}for(var ad=new Array(ac),ae=0,X=0;P>X;X++){for(var U=0;U<N.length;U++){X<S[U].length&&(ad[ae++]=S[U][X])}}for(var X=0;R>X;X++){for(var U=0;U<N.length;U++){X<T[U].length&&(ad[ae++]=T[U][X])}}return ad};for(var v={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},w={L:1,M:0,Q:3,H:2},x={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},y={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(c){for(var d=c<<10;y.getBCHDigit(d)-y.getBCHDigit(y.G15)>=0;){d^=y.G15<<y.getBCHDigit(d)-y.getBCHDigit(y.G15)}return(c<<10|d)^y.G15_MASK},getBCHTypeNumber:function(c){for(var d=c<<12;y.getBCHDigit(d)-y.getBCHDigit(y.G18)>=0;){d^=y.G18<<y.getBCHDigit(d)-y.getBCHDigit(y.G18)}return c<<12|d},getBCHDigit:function(c){for(var d=0;0!=c;){d++,c>>>=1}return d},getPatternPosition:function(b){return y.PATTERN_POSITION_TABLE[b-1]},getMask:function(d,e,g){switch(d){case x.PATTERN000:return 0==(e+g)%2;case x.PATTERN001:return 0==e%2;case x.PATTERN010:return 0==g%3;case x.PATTERN011:return 0==(e+g)%3;case x.PATTERN100:return 0==(Math.floor(e/2)+Math.floor(g/3))%2;case x.PATTERN101:return 0==e*g%2+e*g%3;case x.PATTERN110:return 0==(e*g%2+e*g%3)%2;case x.PATTERN111:return 0==(e*g%3+(e+g)%2)%2;default:throw new Error("bad maskPattern:"+d)}},getErrorCorrectPolynomial:function(d){for(var e=new B([1],0),g=0;d>g;g++){e=e.multiply(new B([1,z.gexp(g)],0))}return e},getLengthInBits:function(c,d){if(d>=1&&10>d){switch(c){case v.MODE_NUMBER:return 10;case v.MODE_ALPHA_NUM:return 9;case v.MODE_8BIT_BYTE:return 8;case v.MODE_KANJI:return 8;default:throw new Error("mode:"+c)}}else{if(27>d){switch(c){case v.MODE_NUMBER:return 12;case v.MODE_ALPHA_NUM:return 11;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 10;default:throw new Error("mode:"+c)}}else{if(!(41>d)){throw new Error("type:"+d)}switch(c){case v.MODE_NUMBER:return 14;case v.MODE_ALPHA_NUM:return 13;case v.MODE_8BIT_BYTE:return 16;case v.MODE_KANJI:return 12;default:throw new Error("mode:"+c)}}}},getLostPoint:function(m){for(var n=m.getModuleCount(),o=0,p=0;n>p;p++){for(var q=0;n>q;q++){for(var r=0,s=m.isDark(p,q),M=-1;1>=M;M++){if(!(0>p+M||p+M>=n)){for(var N=-1;1>=N;N++){0>q+N||q+N>=n||(0!=M||0!=N)&&s==m.isDark(p+M,q+N)&&r++}}}r>5&&(o+=3+r-5)}}for(var p=0;n-1>p;p++){for(var q=0;n-1>q;q++){var O=0;m.isDark(p,q)&&O++,m.isDark(p+1,q)&&O++,m.isDark(p,q+1)&&O++,m.isDark(p+1,q+1)&&O++,(0==O||4==O)&&(o+=3)}}for(var p=0;n>p;p++){for(var q=0;n-6>q;q++){m.isDark(p,q)&&!m.isDark(p,q+1)&&m.isDark(p,q+2)&&m.isDark(p,q+3)&&m.isDark(p,q+4)&&!m.isDark(p,q+5)&&m.isDark(p,q+6)&&(o+=40)}}for(var q=0;n>q;q++){for(var p=0;n-6>p;p++){m.isDark(p,q)&&!m.isDark(p+1,q)&&m.isDark(p+2,q)&&m.isDark(p+3,q)&&m.isDark(p+4,q)&&!m.isDark(p+5,q)&&m.isDark(p+6,q)&&(o+=40)}}for(var P=0,q=0;n>q;q++){for(var p=0;n>p;p++){m.isDark(p,q)&&P++}}var R=Math.abs(100*P/n/n-50)/5;return o+=10*R}},z={glog:function(b){if(1>b){throw new Error("glog("+b+")")}return z.LOG_TABLE[b]},gexp:function(b){for(;0>b;){b+=255}for(;b>=256;){b-=255}return z.EXP_TABLE[b]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},A=0;8>A;A++){z.EXP_TABLE[A]=1<<A}for(var A=8;256>A;A++){z.EXP_TABLE[A]=z.EXP_TABLE[A-4]^z.EXP_TABLE[A-5]^z.EXP_TABLE[A-6]^z.EXP_TABLE[A-8]}for(var A=0;255>A;A++){z.LOG_TABLE[z.EXP_TABLE[A]]=A}B.prototype={get:function(b){return this.num[b]},getLength:function(){return this.num.length},multiply:function(e){for(var g=new Array(this.getLength()+e.getLength()-1),h=0;h<this.getLength();h++){for(var j=0;j<e.getLength();j++){g[h+j]^=z.gexp(z.glog(this.get(h))+z.glog(e.get(j)))}}return new B(g,0)},mod:function(e){if(this.getLength()-e.getLength()<0){return this}for(var g=z.glog(this.get(0))-z.glog(e.get(0)),h=new Array(this.getLength()),j=0;j<this.getLength();j++){h[j]=this.get(j)}for(var j=0;j<e.getLength();j++){h[j]^=z.gexp(z.glog(e.get(j))+g)}return new B(h,0).mod(e)}},C.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],C.getRSBlocks=function(j,l){var m=C.getRsBlockTable(j,l);if(void 0==m){throw new Error("bad rs block @ typeNumber:"+j+"/errorCorrectLevel:"+l)}for(var n=m.length/3,o=[],p=0;n>p;p++){for(var q=m[3*p+0],r=m[3*p+1],s=m[3*p+2],M=0;q>M;M++){o.push(new C(r,s))}}return o},C.getRsBlockTable=function(c,d){switch(d){case w.L:return C.RS_BLOCK_TABLE[4*(c-1)+0];case w.M:return C.RS_BLOCK_TABLE[4*(c-1)+1];case w.Q:return C.RS_BLOCK_TABLE[4*(c-1)+2];case w.H:return C.RS_BLOCK_TABLE[4*(c-1)+3];default:return void 0}},D.prototype={get:function(c){var d=Math.floor(c/8);return 1==(1&this.buffer[d]>>>7-c%8)},put:function(d,e){for(var g=0;e>g;g++){this.putBit(1==(1&d>>>e-g-1))}},getLengthInBits:function(){return this.length},putBit:function(c){var d=Math.floor(this.length/8);this.buffer.length<=d&&this.buffer.push(0),c&&(this.buffer[d]|=128>>>this.length%8),this.length++}};var E=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],H=function(){var b=function(c,d){this._el=c,this._htOption=d};return b.prototype.draw=function(e){function o(g,h){var j=document.createElementNS("http://www.w3.org/2000/svg",g);for(var k in h){h.hasOwnProperty(k)&&j.setAttribute(k,h[k])}return j}var l=this._htOption,m=this._el,n=e.getModuleCount();Math.floor(l.width/n),Math.floor(l.height/n),this.clear();var p=o("svg",{viewBox:"0 0 "+String(n)+" "+String(n),width:"100%",height:"100%",fill:l.colorLight});p.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),m.appendChild(p),p.appendChild(o("rect",{fill:l.colorDark,width:"1",height:"1",id:"template"}));for(var q=0;n>q;q++){for(var r=0;n>r;r++){if(e.isDark(q,r)){var s=o("use",{x:String(q),y:String(r)});s.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),p.appendChild(s)}}}},b.prototype.clear=function(){for(;this._el.hasChildNodes();){this._el.removeChild(this._el.lastChild)}},b}(),I="svg"===document.documentElement.tagName.toLowerCase(),J=I?H:F()?function(){function g(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function k(m,n){var o=this;if(o._fFail=n,o._fSuccess=m,null===o._bSupportDataURI){var p=document.createElement("img"),q=function(){o._bSupportDataURI=!1,o._fFail&&_fFail.call(o)},r=function(){o._bSupportDataURI=!0,o._fSuccess&&o._fSuccess.call(o)};return p.onabort=q,p.onerror=q,p.onload=r,p.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",void 0}o._bSupportDataURI===!0&&o._fSuccess?o._fSuccess.call(o):o._bSupportDataURI===!1&&o._fFail&&o._fFail.call(o)}if(this._android&&this._android<=2.1){var h=1/window.devicePixelRatio,j=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(b,c,m,n,o,p,q,r){if("nodeName" in b&&/img/i.test(b.nodeName)){for(var s=arguments.length-1;s>=1;s--){arguments[s]=arguments[s]*h}}else{"undefined"==typeof r&&(arguments[1]*=h,arguments[2]*=h,arguments[3]*=h,arguments[4]*=h)}j.apply(this,arguments)}}var l=function(c,d){this._bIsPainted=!1,this._android=G(),this._htOption=d,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=d.width,this._elCanvas.height=d.height,c.appendChild(this._elCanvas),this._el=c,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return l.prototype.draw=function(o){var p=this._elImage,q=this._oContext,r=this._htOption,s=o.getModuleCount(),M=r.width/s,N=r.height/s,O=Math.round(M),P=Math.round(N);p.style.display="none",this.clear();for(var R=0;s>R;R++){for(var S=0;s>S;S++){var T=o.isDark(R,S),U=S*M,V=R*N;q.strokeStyle=T?r.colorDark:r.colorLight,q.lineWidth=1,q.fillStyle=T?r.colorDark:r.colorLight,q.fillRect(U,V,M,N),q.strokeRect(Math.floor(U)+0.5,Math.floor(V)+0.5,O,P),q.strokeRect(Math.ceil(U)-0.5,Math.ceil(V)-0.5,O,P)}}this._bIsPainted=!0},l.prototype.makeImage=function(){this._bIsPainted&&k.call(this,g)},l.prototype.isPainted=function(){return this._bIsPainted},l.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},l.prototype.round=function(b){return b?Math.floor(1000*b)/1000:b},l}():function(){var b=function(c,d){this._el=c,this._htOption=d};return b.prototype.draw=function(m){for(var n=this._htOption,o=this._el,p=m.getModuleCount(),q=Math.floor(n.width/p),r=Math.floor(n.height/p),s=['<table style="border:0;border-collapse:collapse;">'],M=0;p>M;M++){s.push("<tr>");for(var N=0;p>N;N++){s.push('<td style="border:0;border-collapse:collapse;padding:0;margin:0;width:'+q+"px;height:"+r+"px;background-color:"+(m.isDark(M,N)?n.colorDark:n.colorLight)+';"></td>')}s.push("</tr>")}s.push("</table>"),o.innerHTML=s.join("");var O=o.childNodes[0],P=(n.width-O.offsetWidth)/2,R=(n.height-O.offsetHeight)/2;P>0&&R>0&&(O.style.margin=R+"px "+P+"px")},b.prototype.clear=function(){this._el.innerHTML=""},b}();QRCode=function(d,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:w.H},"string"==typeof e&&(e={text:e}),e){for(var g in e){this._htOption[g]=e[g]}}"string"==typeof d&&(d=document.getElementById(d)),this._android=G(),this._el=d,this._oQRCode=null,this._oDrawing=new J(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(b){this._oQRCode=new u(K(b,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(b),this._oQRCode.make(),this._el.title=b,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=w}();"use strict";if(!window.u2f){var u2f=u2f||{};var js_api_version;u2f.EXTENSION_ID="kmendfapggjehodndflmmgagdbamhnfd";u2f.MessageTypes={U2F_REGISTER_REQUEST:"u2f_register_request",U2F_REGISTER_RESPONSE:"u2f_register_response",U2F_SIGN_REQUEST:"u2f_sign_request",U2F_SIGN_RESPONSE:"u2f_sign_response",U2F_GET_API_VERSION_REQUEST:"u2f_get_api_version_request",U2F_GET_API_VERSION_RESPONSE:"u2f_get_api_version_response"};u2f.ErrorCodes={OK:0,OTHER_ERROR:1,BAD_REQUEST:2,CONFIGURATION_UNSUPPORTED:3,DEVICE_INELIGIBLE:4,TIMEOUT:5};u2f.U2fRequest;u2f.U2fResponse;u2f.Error;u2f.Transport;u2f.Transports;u2f.SignRequest;u2f.SignResponse;u2f.RegisterRequest;u2f.RegisterResponse;u2f.RegisteredKey;u2f.GetJsApiVersionResponse;u2f.getMessagePort=function(a){if(typeof chrome!="undefined"&&chrome.runtime){var b={type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:[]};chrome.runtime.sendMessage(u2f.EXTENSION_ID,b,function(){if(!chrome.runtime.lastError){u2f.getChromeRuntimePort_(a)}else{u2f.getIframePort_(a)}})}else{if(u2f.isAndroidChrome_()){u2f.getAuthenticatorPort_(a)}else{if(u2f.isIosChrome_()){u2f.getIosPort_(a)}else{u2f.getIframePort_(a)}}}};u2f.isAndroidChrome_=function(){var a=navigator.userAgent;return a.indexOf("Chrome")!=-1&&a.indexOf("Android")!=-1};u2f.isIosChrome_=function(){var b=["iPhone","iPad","iPod"];for(var a in b){if(navigator.platform==b[a]){return true}}return false};u2f.getChromeRuntimePort_=function(a){var b=chrome.runtime.connect(u2f.EXTENSION_ID,{includeTlsChannelId:true});setTimeout(function(){a(new u2f.WrappedChromeRuntimePort_(b))},0)};u2f.getAuthenticatorPort_=function(a){setTimeout(function(){a(new u2f.WrappedAuthenticatorPort_())},0)};u2f.getIosPort_=function(a){setTimeout(function(){a(new u2f.WrappedIosPort_())},0)};u2f.WrappedChromeRuntimePort_=function(a){this.port_=a};u2f.formatSignRequest_=function(a,b,d,h,e){if(js_api_version===undefined||js_api_version<1.1){var g=[];for(var c=0;c<d.length;c++){g[c]={version:d[c].version,challenge:b,keyHandle:d[c].keyHandle,appId:a}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,signRequests:g,timeoutSeconds:h,requestId:e}}return{type:u2f.MessageTypes.U2F_SIGN_REQUEST,appId:a,challenge:b,registeredKeys:d,timeoutSeconds:h,requestId:e}};u2f.formatRegisterRequest_=function(a,c,d,h,e){if(js_api_version===undefined||js_api_version<1.1){for(var b=0;b<d.length;b++){d[b].appId=a}var g=[];for(var b=0;b<c.length;b++){g[b]={version:c[b].version,challenge:d[0],keyHandle:c[b].keyHandle,appId:a}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,signRequests:g,registerRequests:d,timeoutSeconds:h,requestId:e}}return{type:u2f.MessageTypes.U2F_REGISTER_REQUEST,appId:a,registerRequests:d,registeredKeys:c,timeoutSeconds:h,requestId:e}};u2f.WrappedChromeRuntimePort_.prototype.postMessage=function(a){this.port_.postMessage(a)};u2f.WrappedChromeRuntimePort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c=="message"||c=="onmessage"){this.port_.onMessage.addListener(function(d){b({data:d})})}else{console.error("WrappedChromeRuntimePort only supports onMessage")}};u2f.WrappedAuthenticatorPort_=function(){this.requestId_=-1;this.requestObject_=null};u2f.WrappedAuthenticatorPort_.prototype.postMessage=function(b){var a=u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_+";S.request="+encodeURIComponent(JSON.stringify(b))+";end";document.location=a};u2f.WrappedAuthenticatorPort_.prototype.getPortType=function(){return"WrappedAuthenticatorPort_"};u2f.WrappedAuthenticatorPort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c=="message"){var d=this;window.addEventListener("message",d.onRequestUpdate_.bind(d,b),false)}else{console.error("WrappedAuthenticatorPort only supports message")}};u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_=function(a,d){var e=JSON.parse(d.data);var c=e.intentURL;var b=e.errorCode;var g=null;if(e.hasOwnProperty("data")){g=(JSON.parse(e.data))}a({data:g})};u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_="intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE";u2f.WrappedIosPort_=function(){};u2f.WrappedIosPort_.prototype.postMessage=function(a){var b=JSON.stringify(a);var c="u2f://auth?"+encodeURI(b);location.replace(c)};u2f.WrappedIosPort_.prototype.getPortType=function(){return"WrappedIosPort_"};u2f.WrappedIosPort_.prototype.addEventListener=function(a,b){var c=a.toLowerCase();if(c!=="message"){console.error("WrappedIosPort only supports message")}};u2f.getIframePort_=function(a){var d="chrome-extension://"+u2f.EXTENSION_ID;var c=document.createElement("iframe");c.src=d+"/u2f-comms.html";c.setAttribute("style","display:none");document.body.appendChild(c);var b=new MessageChannel();var e=function(g){if(g.data=="ready"){b.port1.removeEventListener("message",e);a(b.port1)}else{console.error('First event on iframe port was not "ready"')}};b.port1.addEventListener("message",e);b.port1.start();c.addEventListener("load",function(){c.contentWindow.postMessage("init",d,[b.port2])})};u2f.EXTENSION_TIMEOUT_SEC=30;u2f.port_=null;u2f.waitingForPort_=[];u2f.reqCounter_=0;u2f.callbackMap_={};u2f.getPortSingleton_=function(a){if(u2f.port_){a(u2f.port_)}else{if(u2f.waitingForPort_.length==0){u2f.getMessagePort(function(b){u2f.port_=b;u2f.port_.addEventListener("message",(u2f.responseHandler_));while(u2f.waitingForPort_.length){u2f.waitingForPort_.shift()(u2f.port_)}})}u2f.waitingForPort_.push(a)}};u2f.responseHandler_=function(b){var d=b.data;var c=d.requestId;if(!c||!u2f.callbackMap_[c]){console.error("Unknown or missing requestId in response.");return}var a=u2f.callbackMap_[c];delete u2f.callbackMap_[c];a(d.responseData)};u2f.sign=function(a,c,e,b,d){if(js_api_version===undefined){u2f.getApiVersion(function(g){js_api_version=g.js_api_version===undefined?0:g.js_api_version;u2f.sendSignRequest(a,c,e,b,d)})}else{u2f.sendSignRequest(a,c,e,b,d)}};u2f.sendSignRequest=function(a,c,e,b,d){u2f.getPortSingleton_(function(g){var j=++u2f.reqCounter_;u2f.callbackMap_[j]=b;var k=(typeof d!=="undefined"?d:u2f.EXTENSION_TIMEOUT_SEC);var h=u2f.formatSignRequest_(a,c,e,k,j);g.postMessage(h)})};u2f.register=function(a,e,d,b,c){if(js_api_version===undefined){u2f.getApiVersion(function(g){js_api_version=g.js_api_version===undefined?0:g.js_api_version;u2f.sendRegisterRequest(a,e,d,b,c)})}else{u2f.sendRegisterRequest(a,e,d,b,c)}};u2f.sendRegisterRequest=function(a,e,d,b,c){u2f.getPortSingleton_(function(g){var j=++u2f.reqCounter_;u2f.callbackMap_[j]=b;var k=(typeof c!=="undefined"?c:u2f.EXTENSION_TIMEOUT_SEC);var h=u2f.formatRegisterRequest_(a,d,e,k,j);g.postMessage(h)})};u2f.getApiVersion=function(a,b){u2f.getPortSingleton_(function(d){if(d.getPortType){var c;switch(d.getPortType()){case"WrappedIosPort_":case"WrappedAuthenticatorPort_":c=1.1;break;default:c=0;break}a({js_api_version:c});return}var g=++u2f.reqCounter_;u2f.callbackMap_[g]=a;var e={type:u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST,timeoutSeconds:(typeof b!=="undefined"?b:u2f.EXTENSION_TIMEOUT_SEC),requestId:g};d.postMessage(e)})}}"use strict";var args;var autoReconnect=true;var powerStatetable=["","Powered","Sleep","Sleep","Sleep","Hibernating","Power off","Present"];var StatusStrs=["Disconnected","Connecting...","Setup...","Connected","Intel® AMT Connected"];var sort=0;var searchFocus=0;var mapSearchFocus=0;var userSearchFocus=0;var consoleFocus=0;var showRealNames=false;var meshserver=null;var meshes={};var meshcount=0;var nodes=null;var filetree={};var userinfo=null;var serverinfo=null;var events=[];var users=null;var wssessions=null;var nodeShortIdent=0;var desktop;var desktopsettings={encoding:2,showfocus:false,showmouse:true,showcad:true,quality:40,scaling:1024,framerate:50};var multidesktopsettings={quality:20,scaling:128,framerate:1000};var terminal;var files;var debugLevel=parseInt("{{{debuglevel}}}");var features=parseInt("{{{features}}}");var sessionTime=parseInt("{{{sessiontime}}}");var domain="{{{domain}}}";var domainUrl="{{{domainurl}}}";var authCookie="{{{authCookie}}}";var authCookieRenewTimer=null;var multiDesktop={};var multiDesktopFilter=null;var serverPublicNamePort="{{{serverDnsName}}}:{{{serverPublicPort}}}";var amtScanResults=null;var debugmode=0;var clickOnce=(((features&256)!=0)&&detectClickOnce());var attemptWebRTC=((features&128)!=0);var webPageFullScreen=getstore("webPageFullScreen",true);if(webPageFullScreen=="false"){webPageFullScreen=false}if(webPageFullScreen=="true"){webPageFullScreen=true}var passRequirements="{{{passRequirements}}}";if(passRequirements!=""){passRequirements=JSON.parse(decodeURIComponent(passRequirements))}function startup(){if((features&32)==0){var h=null;try{h=top.location.toString().toLowerCase()}catch(b){}if(top!=self&&(h==null||top.active==false)){top.location=self.location;return}}args=parseUriArgs();debugmode=args.debug;if(args.webrtc!=null){attemptWebRTC=(args.webrtc==1)}QV("p13AutoConnect",debugmode);QV("autoconnectbutton2",debugmode);QV("autoconnectbutton1",debugmode);QV("DeskClip",debugmode);toggleFullScreen();if(args.hide){var d=parseInt(args.hide);QV("masthead",!(d&1));QV("topbarmaster",!(d&2));QV("footer",!(d&4));QV("p10title",!(d&8));QV("p11title",!(d&8));QV("p12title",!(d&8));QV("p13title",!(d&8));QV("p14title",!(d&8));QV("p15title",!(d&8));QV("p16title",!(d&8));if(d&16){QV("page_leftbar",false);QS("page_content").left="0px"}}if("{{currentNode}}"!=""){QV("p10BackButton",false);QV("p11BackButton",false);QV("p12BackButton",false);QV("p13BackButton",false);QV("p14BackButton",false);QV("p15BackButton",false);QV("p16BackButton",false)}p1updateInfo();document.onclick=function(c){hideContextMenu()};document.onkeypress=ondockeypress;document.onkeydown=ondockeydown;document.onkeyup=ondockeyup;window.onresize=function(){masterUpdate(512)};masterUpdate(512);meshserver=MeshServerCreateControl(domainUrl,authCookie);meshserver.onStateChanged=onStateChanged;meshserver.onMessage=onMessage;meshserver.Start();Q("sortselect").selectedIndex=sort=getstore("sort",0);Q("sizeselect").selectedIndex=getstore("viewsize",1);Q("SearchInput").value=getstore("search","");showRealNames=(getstore("showRealNames",0)==1);Q("RealNameCheckBox").checked=showRealNames;Q("viewselect").value=getstore("deviceView",1);Q("DeskControl").checked=(getstore("DeskControl",1)==1);masterUpdate(3);for(var g=1;g<5;g++){Q("devViewButton"+g).classList.remove("viewSelectorSel")}Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel");Q("p5filetable").addEventListener("drop",p5fileDragDrop,false);Q("p5filetable").addEventListener("dragover",p5fileDragOver,false);Q("p5filetable").addEventListener("dragleave",p5fileDragLeave,false);Q("p13filetable").addEventListener("drop",p13fileDragDrop,false);Q("p13filetable").addEventListener("dragover",p13fileDragOver,false);Q("p13filetable").addEventListener("dragleave",p13fileDragLeave,false);setInterval(updateDeviceTimeline,120000);var k=localStorage.getItem("desktopsettings");if(k!=null){desktopsettings=JSON.parse(k)}k=localStorage.getItem("multidesktopsettings");if(k!=null){multidesktopsettings=JSON.parse(k)}applyDesktopSettings();var l="";for(var a=1;a<27;a++){l+="<option value='"+a+"'>Ctrl-"+String.fromCharCode(64+a)+" ("+a+")</option>"}QH("specialkeylist",l);setupServerStats()}function toggleFullScreen(b){if(b===1){webPageFullScreen=!webPageFullScreen;putstore("webPageFullScreen",webPageFullScreen)}var a=0;if(args.hide){a=parseInt(args.hide)}if(webPageFullScreen==false){QS("container").width="960px";QS("container")["border-right"]="1px solid #b7b7b7";QS("container")["border-left"]="1px solid #b7b7b7";QS("container")["min-width"]="960px";QS("container")["overflow"]="";QS("column_l").width="930px";QS("column_l").height="";QS("column_l")["margin-left"]="";QS("column_l")["overflow-y"]="";QS("column_l")["max-height"]=(xxcurrentView>=10)?"calc(100vh - 159px)":"calc(100vh - 135px)";QS("container").position="";QS("page_content").position="";QV("MainMenuSpan",true);QV("UserDummyMenuSpan",false);QV("page_leftbar",false)}else{QS("container").position="absolute";QS("container").width="100%";QS("container").top="0px";QS("container").bottom="0px";QS("container")["border-right"]="0";QS("container")["border-left"]="0";QS("container")["min-width"]="700px";QS("container")["overflow"]="hidden";QS("page_content").position="absolute";QS("page_content").top="66px";QS("page_content").left=(a&16)?"0px":"90px";QS("page_content").right="0px";QS("page_content").bottom="0px";QS("column_l").height="calc(100vh - 135px)";QS("column_l").width="calc(100% - 30px)";QS("column_l")["overflow-y"]="auto";QS("column_l")["max-height"]="calc(100vh - 135px)";QV("MainMenuSpan",false);QV("UserDummyMenuSpan",(xxcurrentView<10)&&webPageFullScreen);QV("page_leftbar",!(a&16))}masterUpdate(512);QV("body",true)}function getNodeFromId(b){if(nodes!=null){for(var a in nodes){if(nodes[a]._id==b){return nodes[a]}}}return null}function reload(){window.location.href=window.location.href}function onStateChanged(c,d,b,a){if(d==0){setDialogMode(0);go(0);powerTimeline=null;powerTimelineReq=null;powerTimelineNode=null;powerTimelineUpdate=null;deleteAllNotifications();hideContextMenu();QV("verifyEmailId2",false);QV("logoutControl",false);if(a=="noauth"){QH("p0span","Unable to perform authentication");return}if(b==2){if(autoReconnect){setTimeout(serverPoll,5000)}}else{QH("p0span","Unable to connect web socket")}if(authCookieRenewTimer!=null){clearInterval(authCookieRenewTimer);authCookieRenewTimer=null}}else{if(d==2){meshserver.send({action:"meshes"});meshserver.send({action:"nodes",id:"{{currentNode}}"});if("{{currentNode}}"==""){meshserver.send({action:"files"})}go(1);authCookieRenewTimer=setInterval(function(){meshserver.send({action:"authcookie"})},1800000)}}}function serverPoll(){var b=null;try{b=new XDomainRequest()}catch(a){}if(!b){b=new XMLHttpRequest()}b.open("HEAD",window.location.href);b.timeout=15000;b.onload=function(){reload()};b.onerror=b.ontimeout=function(){setTimeout(serverPoll,10000)};b.send()}function detectClickOnce(){for(var a in window.navigator.mimeTypes){if(window.navigator.mimeTypes[a].type=="application/x-ms-application"){return true}}var b=window.navigator.userAgent.toUpperCase();return(b.indexOf(".NET CLR 3.5")>=0)||(b.indexOf("(WINDOWS NT ")>=0)}function updateSiteAdmin(){var a="{{{noServerBackup}}}";var b=userinfo.siteadmin;if(a==1){b&=4294967290}QV("p2AccountSecurity",((features&4)==0)&&(serverinfo.domainauth==false)&&((features&4096)!=0));QV("p2AccountActions",((features&4)==0)&&(serverinfo.domainauth==false));QV("p2AccountImage",((features&4)==0)&&(serverinfo.domainauth==false));QV("p2ServerActions",b&21);QV("LeftMenuMyServer",b&21);QV("MainMenuMyServer",b&21);QV("p2ServerActionsBackup",b&1);QV("p2ServerActionsRestore",b&4);QV("p2ServerActionsVersion",b&16);QV("MainMenuMyFiles",b&8);QV("LeftMenuMyFiles",b&8);if(((b&8)==0)&&(xxcurrentView==5)){setDialogMode(0);go(1)}if(currentNode!=null){gotoDevice(currentNode._id,xxcurrentView,true)}if((userinfo.siteadmin&2)!=0){if(users==null){meshserver.send({action:"users"})}if(wssessions==null){meshserver.send({action:"wssessioncount"})}}else{users=null;wssessions=null;updateUsers();if(xxcurrentView==4||((xxcurrentView>=30)&&(xxcurrentView<40))){setDialogMode(0);go(1);currentUser=null}}meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)});QV("p2deleteall",userinfo.siteadmin==4294967295);QV("ServerConsole",userinfo.siteadmin===4294967295);if((xxcurrentView==115)&&(userinfo.siteadmin!=4294967295)){go(6)}if((xxcurrentView==6)&&((userinfo.siteadmin&21)==0)){go(1)}if((b&21)!=0){meshserver.send({action:"serverstats",interval:10000})}}var updateNaggleTimer=null;var updateNaggleFlags=0;function masterUpdate(a){updateNaggleFlags|=a;if(updateNaggleTimer==null){updateNaggleTimer=setTimeout(function(){if(updateNaggleFlags&512){center()}if(updateNaggleFlags&1){onSearchInputChanged()}if(updateNaggleFlags&2){onSortSelectChange(true)}if(updateNaggleFlags&128){updateMeshes()}if(updateNaggleFlags&4){updateDevices()}if(updateNaggleFlags&8){drawNotifications()}if(updateNaggleFlags&16){updateMapMarkers()}if(updateNaggleFlags&32){eventsUpdate()}if(updateNaggleFlags&64){refreshMap(false,true)}if(updateNaggleFlags&256){drawDeviceTimeline()}if(updateNaggleFlags&1024){deviceEventsUpdate()}if(updateNaggleFlags&2048){userEventsUpdate()}updateNaggleTimer=null;updateNaggleFlags=0},150)}}function updateSelf(){QV("verifyEmailId",(userinfo.emailVerified!==true)&&(userinfo.email!=null)&&(serverinfo.emailcheck==true));QV("verifyEmailId2",(userinfo.emailVerified!==true)&&(userinfo.email!=null)&&(serverinfo.emailcheck==true));QV("manageOtp",(userinfo.otpsecret==1)||(userinfo.otphkeys>0));QV("authAppSetupCheck",userinfo.otpsecret==1);QV("authKeySetupCheck",userinfo.otphkeys>0);QV("authCodesSetupCheck",userinfo.otpkeys>0)}function onMessage(D,l){switch(l.action){case"serverstats":updateServerStats(l);break;case"authcookie":authCookie=l.cookie;break;case"serverinfo":serverinfo=l.serverinfo;break;case"userinfo":userinfo=l.userinfo;updateSiteAdmin();updateSelf();break;case"users":users={};for(var k in l.users){users[l.users[k]._id]=l.users[k]}updateUsers();break;case"wssessioncount":wssessions=l.wssessions;updateUsers();break;case"meshes":meshes={};for(var k in l.meshes){meshes[l.meshes[k]._id]=l.meshes[k]}masterUpdate(4+128);break;case"files":filetree=setupBackPointers(l.filetree);updateFiles();d3updatefiles();break;case"nodes":nodes=[];for(var k in l.nodes){if(!meshes[k]){console.log("Invalid mesh (1): "+k);continue}for(var o in l.nodes[k]){if(l.nodes[k][o]._id==null){console.log("Invalid node ("+o+"): "+JSON.stringify(l.nodes));continue}l.nodes[k][o].namel=l.nodes[k][o].name.toLowerCase();if(l.nodes[k][o].rname){l.nodes[k][o].rnamel=l.nodes[k][o].rname.toLowerCase()}else{l.nodes[k][o].rnamel=l.nodes[k][o].namel}l.nodes[k][o].meshnamel=meshes[k].name.toLowerCase();l.nodes[k][o].meshid=k;l.nodes[k][o].state=(l.nodes[k][o].state)?(l.nodes[k][o].state):0;l.nodes[k][o].desc=l.nodes[k][o].desc;if(!l.nodes[k][o].icon){l.nodes[k][o].icon=1}l.nodes[k][o].ident=++nodeShortIdent;nodes.push(l.nodes[k][o])}}masterUpdate(1|2|4|64);if(xxcurrentView==0){if("{{viewmode}}"!=""){go(parseInt("{{viewmode}}"))}else{setDialogMode(0);go(1)}}if("{{currentNode}}"!=""){gotoDevice("{{currentNode}}",parseInt("{{viewmode}}"))}break;case"powertimeline":if(l.nodeid!=powerTimelineReq){break}powerTimelineNode=l.nodeid;powerTimeline=l.timeline;powerTimelineUpdate=Date.now()+300000;if(currentNode._id==l.nodeid){masterUpdate(256)}break;case"lastconnect":var v=getNodeFromId(l.nodeid);if(v!=null){v.lastconnect=l.time;v.lastaddr=l.addr;if((currentNode._id==v._id)&&(Q("MainComputerState").innerHTML=="")){QH("MainComputerState","<span style=font-size:12px>Last seen:<br />"+new Date(v.lastconnect).toLocaleDateString()+", "+new Date(v.lastconnect).toLocaleTimeString()+"</span>")}}break;case"msg":if(l.nodeid!=null){var e=-1;if(nodes!=null){for(var d in nodes){if(nodes[d]._id==l.nodeid){e=d;break}}}if(e!=-1){if(l.type=="console"){p15consoleReceive(nodes[e],l.value)}else{if(l.type=="notify"){var o={text:l.value};if(l.nodeid!=null){o.nodeid=l.nodeid}if(l.tag!=null){o.tag=l.tag}if(l.username!=null){o.username=l.username}addNotification(o)}else{if(l.type=="ps"){showDeskToolsProcesses(l)}else{if((l.type=="getclip")&&(xxdialogTag=="clipboard")&&(currentNode!=null)&&(currentNode._id==l.nodeid)){Q("d2clipText").value=l.data}else{if((l.type=="setclip")&&(xxdialogTag=="clipboard")&&(currentNode!=null)&&(currentNode._id==l.nodeid)){QH("dlgClipStatus",l.success?"<span style=color:green>Success</span>":"<span style=color:red>Failed</span>");setTimeout(function(){try{QH("dlgClipStatus","")}catch(j){}},2000)}}}}}}}else{if(l.type=="notify"){var o={text:l.value};if(l.tag!=null){o.tag=l.tag}if(l.username!=null){o.username=l.username}addNotification(o)}}break;case"getnetworkinfo":if((currentNode._id==l.nodeid)&&(xxdialogMode==2)&&(xxdialogTag=="if"+l.nodeid)){if(l.netif==null){QH("d2netinfo","No network interface information available for this device.")}else{var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>";if(currentNode.lastconnect){I+=addHtmlValue2("Last agent connection",new Date(currentNode.lastconnect).toLocaleString())}if(currentNode.lastaddr){if(isPrivateIP(currentNode.lastaddr)){I+=addHtmlValue2("Last agent address",currentNode.lastaddr.split(":")[0])}else{I+=addHtmlValue2("Last agent address",'<a href="https://iplocation.com/?ip='+currentNode.lastaddr.split(":")[0]+'" rel="noreferrer noopener" target="MeshIPLoopup">'+currentNode.lastaddr.split(":")[0]+"</a>")}}I+=addHtmlValue2("Last interfaces update",new Date(l.updateTime).toLocaleString());for(var d in l.netif){var q=l.netif[d];I+="<hr />";if(q.name){I+=addHtmlValue2("Name","<b>"+EscapeHtml(q.name)+"</b>")}if(q.desc){I+=addHtmlValue2("Description",EscapeHtml(q.desc).replace("(R)","®").replace("(r)","®"))}if(q.dnssuffix){I+=addHtmlValue2("DNS suffix",EscapeHtml(q.dnssuffix))}if(q.mac){I+=addHtmlValue2("MAC address",'<a href="https://dnslytics.com/mac-address-lookup/'+q.mac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(q.mac.toLowerCase())+"</a>")}if(q.v4addr){I+=addHtmlValue2("IPv4 address",EscapeHtml(q.v4addr))}if(q.v4mask){I+=addHtmlValue2("IPv4 mask",EscapeHtml(q.v4mask))}if(q.v4gateway){I+=addHtmlValue2("IPv4 gateway",EscapeHtml(q.v4gateway))}if(q.gatewaymac){I+=addHtmlValue2("Gateway MAC",'<a href="https://dnslytics.com/mac-address-lookup/'+q.gatewaymac.substring(0,6)+'" rel="noreferrer noopener" target="MeshMACLoopup">'+EscapeHtml(q.gatewaymac.toLowerCase())+"</a>")}}I+="</div>";QH("d2netinfo",I)}}break;case"serverversion":if((xxdialogMode==2)&&(xxdialogTag=="MeshCentralServerUpdate")){var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow-y:auto;line-height:160%>";if(!l.current){l.current="Unknown"}if(!l.latest){l.latest="Unknown"}I+=addHtmlValue2("Current Version","<b>"+EscapeHtml(l.current)+"</b>");I+=addHtmlValue2("Latest Version","<b>"+EscapeHtml(l.latest)+"</b>");I+="</div>";if((l.latest.indexOf(".")==-1)||(l.current==l.latest)||((features&2048)==0)){setDialogMode(2,"MeshCentral Version",1,null,I)}else{setDialogMode(2,"MeshCentral Version",3,server_showVersionDlgEx,I+"<br /><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> Check and click OK to start server self-update.</label>");server_showVersionDlgUpdate()}}break;case"servererrors":if((xxdialogMode==2)&&(xxdialogTag=="MeshCentralServerErrors")){if(l.data==null){setDialogMode(2,"MeshCentral Server Errors",1,null,"Server has no error log.")}else{var I="<div style=width:100%;max-height:260px;overflow-x:hidden;overflow:auto;line-height:160%;font-size:10px><pre>"+l.data+"<pre></div>";setDialogMode(2,"MeshCentral Server Errors",3,server_showErrorsDlgEx,I+"<br /><label><input id=d2updateCheck type=checkbox onclick=server_showVersionDlgUpdate() /> Check and click OK to clear error log.</label>");server_showVersionDlgUpdate()}}break;case"serverconsole":p15consoleReceive("serverconsole",l.value);break;case"events":if((l.nodeid!=null)&&(l.nodeid==currentNode._id)){currentDeviceEvents=l.events;masterUpdate(1024)}else{if((l.user!=null)&&(l.user==currentUser.name)){currentUserEvents=l.events;masterUpdate(2048)}else{events=l.events;masterUpdate(32)}}break;case"getcookie":if(l.tag=="clickonce"){var a="{{{serverRedirPort}}}"==""?"{{{serverPublicPort}}}":"{{{serverRedirPort}}}";var A="http://"+window.location.hostname+":"+a+"/clickonce/minirouter/MeshMiniRouter.application?WS=wss%3A%2F%2F"+window.location.hostname+"%2Fmeshrelay.ashx%3Fauth="+l.cookie+"&CH={{{webcerthash}}}&AP="+l.protocol+((debugmode==1)?"":"&HOL=1");var u=window.open(A,"_blank");u.opener=null}break;case"getNotes":var o=Q("d2devNotes");if(o&&(l.id==decodeURIComponent(o.attributes.noteid.value))){if(l.notes){QH("d2devNotes",decodeURIComponent(l.notes))}else{QH("d2devNotes","")}var B=o.attributes.ro.value=="true";if(B==false){o.removeAttribute("readonly");QE("idx_dlgOkButton",true);QV("idx_dlgOkButton",true);focusTextBox("d2devNotes")}}break;case"otpauth-request":if((xxdialogMode==2)&&(xxdialogTag=="otpauth-request")){var C=l.secret;if(C.length==52){C=C.split(/(.............)/).filter(Boolean).join(" ")}else{if(C.length==32){C=C.split(/(....)/).filter(Boolean).join(" ");C=C.substring(0,20)+"<br/>"+C.substring(20)}}QH("d2optinfo",'<table style=width:380px><tr><td style=vertical-align:top>Install <a href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" rel="noreferrer noopener" target=_blank>Google Authenticator</a> or a compatible application and scan the barcode, use <a href="'+l.url+'" rel="noreferrer noopener" target=_blank> this link</a> or enter the secret. Then, enter the current 6 digit token below to activate 2-Step login.<br /><br />Secret<br /><tt id=d2optsecret secret="'+l.secret+'" style=font-size:12px>'+C+'</tt><br /><br /></td><td style=width:1px;vertical-align:top><a href="'+l.url+'" rel="noreferrer noopener" target=_blank><div id="qrcode"></div></a></td><tr><td colspan=2 style="text-align:center;border-top:1px solid black"><br />Enter the token here for 2-step login: <input type=text onkeypress="return (event.keyCode == 8) || (event.charCode >= 48 && event.charCode <= 57)" onkeyup=account_addOtpCheck(event) onkeydown=account_addOtpCheck() maxlength=6 id=d2otpauthinput type=text></td></table>');new QRCode(Q("qrcode"),{text:l.url,width:128,height:128,colorDark:"#000000",colorLight:"#EEE",correctLevel:QRCode.CorrectLevel.H});QV("idx_dlgOkButton",true);QE("idx_dlgOkButton",false);Q("d2otpauthinput").focus()}break;case"otpauth-setup":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,l.success?"<b style=color:green>Authenticator app activation successful</b>. You will now need a valid token to login again.":"<b style=color:red>2-step login activation failed</b>. Clear the secret from the application and try again. You only have a few minutes to enter the proper code.");break;case"otpauth-clear":if(xxdialogMode){return}setDialogMode(2,"Authenticator App",1,null,l.success?"<b>Authenticator application removed</b>. You can reactivate this feature at any time.":"<b style=color:red>2-step login activation removal failed</b>. Try again.");break;case"otpauth-getpasswords":if(xxdialogMode){return}var I="One time tokens can be used as secondary authentication. Generate a set, print them and keep them in a safe place.";I+="<div style='border-radius:6px;border: 2px dashed #888;width:100%;margin-top:8px'><div style='padding:8px;font-family:Arial, Helvetica, sans-serif;font-size:20px;font-weight:bold'><table style=width:100%;text-align:center>";if(l.passwords){var g=0;for(var d in l.passwords){if(++g%2){I+="<tr>"}var y=""+l.passwords[d].p;while(y.length<8){y="0"+y}if(l.passwords[d].u===true){I+="<td>"+y.substring(0,4)+" "+y.substring(4)}else{I+="<td><strike style=color:#BBB>"+y.substring(0,4)+" "+y.substring(4);+"</strike>"}}}else{I+="<tr><td>No Active Tokens"}I+="</table></div></div><br />";I+="<div><input type=button value='Close' onclick=setDialogMode(0) style=float:right></input>";I+="<input type=button value='Generate New Tokens' onclick='account_manageOtp(1);'></input>";if(l.passwords!=null){I+="<input type=button value='Clear Tokens' onclick='account_manageOtp(2);'></input>"}I+="</div><br />";setDialogMode(2,"Manage Backup Codes",8,null,I,"otpauth-manage");break;case"otp-hkey-get":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}var F="<div style='border-radius:6px;border:2px solid #CCC;background-color:#BBB;width:100%;box-sizing:border-box;margin-bottom:6px'><div style='margin:3px;font-family:Arial, Helvetica, sans-serif;font-size:16px;font-weight:bold'><table style=width:100%;text-align:left>";var b="</table></div></div>";var I="<a href='https://www.yubico.com/' rel='noreferrer noopener' target='_blank'>Hardware keys</a> are used as secondary login authentication.";I+="<div style='max-height:150px;overflow-y:auto;overflow-x:hidden;margin-top:6px;margin-bottom:6px'>";if(l.keys&&l.keys.length>0){for(var d in l.keys){var h=l.keys[d],H=(h.type==1)?"U2F":"OTP";I+=F+'<tr style=margin:5px><td style=width:30px><img width=24 height=18 src="images/hardware-key-'+H+'-24.png" style=margin-top:4px><td style=width:250px>'+h.name+"<td><input type=button value='Remove' onclick=account_removehkey("+h.i+")></input>"+b}}else{I+=F+"<tr style=text-align:center><td>No Keys Configured"+b}I+="</div>";I+="<div><input type=button value='Close' onclick=setDialogMode(0) style=float:right></input>";I+="<input id=d2addkey1 type=button value='Add U2F Key' onclick='account_addhkey(1);'></input>";if((features&16384)!=0){I+="<input id=d2addkey2 type=button value='Add OTP Key' onclick='account_addhkey(2);'></input>"}I+="</div><br />";setDialogMode(2,"Manage Security Keys",8,null,I,"otpauth-hardware-manage");if(u2fSupported()==false){QE("d2addkey1",false)}break;case"otp-hkey-yubikey-add":if(l.result){meshserver.send({action:"otp-hkey-get"})}else{setDialogMode(2,"Add Security Key",1,null,"<br />Error, Unable to add key.<br /><br />")}break;case"otp-hkey-setup-request":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}var I="Press the key button now.<br /><br /><div style=width:100%;text-align:center><img width=120 height=117 src='images/hardware-keypress-120.png' /></div><input id=dp1keyname style=display:none value="+l.name+" />";setDialogMode(2,"Add Security Key",2,null,I);window.u2f.register(l.request.appId,l.request.registerRequests,l.request.registeredKeys,function(m){if(m.registrationData){meshserver.send({action:"otp-hkey-setup-response",response:m,name:Q("dp1keyname").value});setDialogMode(2,"Add Security Key",0,null,"<br />Checking...<br /><br /><br />","otpauth-hardware-manage")}else{var j=["","Unknown error","Bad request","Unsupported configuration","This key was already registered","Timeout"];setDialogMode(2,"Add Security Key",1,null,"<br />"+j[m.errorCode]+".<br /><br />")}},l.request.timeoutSeconds);break;case"otp-hkey-setup-response":if(xxdialogMode&&(xxdialogTag!="otpauth-hardware-manage")){return}if(l.result==true){meshserver.send({action:"otp-hkey-get"})}else{setDialogMode(2,"Add Security Key",1,null,"<br />ERROR: Unable to add key.<br /><br />","otpauth-hardware-manage")}break;case"event":if(!l.event.nolog){events.unshift(l.event);var c=parseInt(p3limitdropdown.value);while(events.length>c){events.pop()}masterUpdate(32)}switch(l.event.action){case"accountcreate":case"accountchange":if(userinfo.name==l.event.account.name){var t=l.event.account.siteadmin?l.event.account.siteadmin:0;var w=userinfo.siteadmin?userinfo.siteadmin:0;if((l.event.account.quota!=userinfo.quota)||(((userinfo.siteadmin&8)==0)&&((l.event.account.siteadmin&8)!=0))){meshserver.send({action:"files"})}userinfo=l.event.account;if(w!=t){updateSiteAdmin()}updateSelf()}if(users==null){break}users[l.event.account._id]=l.event.account;updateUsers();break;case"accountremove":if(users==null){break}delete users["user/"+domain+"/"+l.event.username.toLowerCase()];updateUsers();break;case"createmesh":if(l.event.links["user/"+domain+"/"+userinfo.name.toLowerCase()]!=null){meshes[l.event.meshid]={_id:l.event.meshid,name:l.event.name,mtype:l.event.mtype,desc:l.event.desc,links:l.event.links};masterUpdate(4+128);meshserver.send({action:"files"})}break;case"meshchange":if(meshes[l.event.meshid]==null){meshes[l.event.meshid]={_id:l.event.meshid,name:l.event.name,mtype:l.event.mtype,desc:l.event.desc,links:l.event.links};meshserver.send({action:"nodes"})}else{if(l.event.name){meshes[l.event.meshid].name=l.event.name}if(l.event.desc){meshes[l.event.meshid].desc=l.event.desc}if(l.event.flags){meshes[l.event.meshid].flags=l.event.flags}if(l.event.links){meshes[l.event.meshid].links=l.event.links}if(l.event.amt){meshes[l.event.meshid].amt=l.event.amt}if(meshes[l.event.meshid].links["user/"+domain+"/"+userinfo.name.toLowerCase()]==null){if((xxcurrentView==20)&&(currentMesh==meshes[l.event.meshid])){go(2)}delete meshes[l.event.meshid];var s=[];for(var d in nodes){if(nodes[d].meshid!=l.event.meshid){s.push(nodes[d])}}nodes=s;if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==l.event.meshid){setDialogMode(0);go(1)}}}masterUpdate(4+128);if(xxcurrentView==20&¤tMesh._id==l.event.meshid){p20updateMesh()}break;case"deletemesh":if(meshes[l.event.meshid]){delete meshes[l.event.meshid];masterUpdate(128);meshserver.send({action:"files"})}var s=[];if(nodes!=null){for(var d in nodes){if(nodes[d].meshid!=l.event.meshid){s.push(nodes[d])}}}nodes=s;masterUpdate(4);if(xxcurrentView>=20&&xxcurrentView<30&¤tMesh._id==l.event.meshid){setDialogMode(0);go(2)}if(xxcurrentView>=10&&xxcurrentView<20&¤tNode&¤tNode.meshid==l.event.meshid){setDialogMode(0);go(1)}break;case"addnode":var v=l.event.node;if(!meshes[v.meshid]){break}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}v.meshnamel=meshes[v.meshid].name.toLowerCase();v.state=0;if(!v.icon){v.icon=1}v.ident=++nodeShortIdent;if(nodes==null){}nodes.push(v);masterUpdate(1|2|4|16);break;case"removenode":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];if(currentNode==v){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(1)}currentNode=null}nodes.splice(e,1);masterUpdate(4|16)}break;case"changenode":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];v.name=l.event.node.name;v.rname=l.event.node.rname;v.users=l.event.node.users;v.host=l.event.node.host;v.desc=l.event.node.desc;v.osdesc=l.event.node.osdesc;v.publicip=l.event.node.publicip;v.iploc=l.event.node.iploc;v.wifiloc=l.event.node.wifiloc;v.gpsloc=l.event.node.gpsloc;v.tags=l.event.node.tags;v.userloc=l.event.node.userloc;if(l.event.node.agent!=null){if(v.agent==null){v.agent={}}if(l.event.node.agent.ver!=null){v.agent.ver=l.event.node.agent.ver}if(l.event.node.agent.id!=null){v.agent.id=l.event.node.agent.id}if(l.event.node.agent.caps!=null){v.agent.caps=l.event.node.agent.caps}if(l.event.node.agent.core!=null){v.agent.core=l.event.node.agent.core}else{if(v.agent.core){delete v.agent.core}}v.agent.tag=l.event.node.agent.tag}if(l.event.node.intelamt!=null){if(v.intelamt==null){v.intelamt={}}if(l.event.node.intelamt.host!=null){v.intelamt.user=l.event.node.intelamt.host}if(l.event.node.intelamt.user!=null){v.intelamt.user=l.event.node.intelamt.user}if(l.event.node.intelamt.tls!=null){v.intelamt.tls=l.event.node.intelamt.tls}if(l.event.node.intelamt.ver!=null){v.intelamt.ver=l.event.node.intelamt.ver}if(l.event.node.intelamt.state!=null){v.intelamt.state=l.event.node.intelamt.state}}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}if(l.event.node.icon){v.icon=l.event.node.icon}masterUpdate(2|4|8|16);refreshDevice(v._id);if((currentNode==v)&&(xxdialogMode!=null)&&(xxdialogTag=="@xxmap")){p10showNodeLocationDialog()}}break;case"nodemeshchange":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];if(meshes[l.event.newMeshId]==null){if(currentNode==v){if(xxcurrentView>=10&&xxcurrentView<20){setDialogMode(0);go(1)}currentNode=null}nodes.splice(e,1);masterUpdate(4|16)}else{v.meshid=l.event.newMeshId;v.meshnamel=meshes[l.event.newMeshId].name.toLowerCase();masterUpdate(1|2|4)}refreshDevice(l.event.nodeid)}else{var v=l.event.node;if(!meshes[v.meshid]){break}v.namel=v.name.toLowerCase();if(v.rname){v.rnamel=v.rname.toLowerCase()}else{v.rnamel=v.namel}v.meshnamel=meshes[v.meshid].name.toLowerCase();v.state=0;if(!v.icon){v.icon=1}v.ident=++nodeShortIdent;if(nodes==null){}nodes.push(v);masterUpdate(1|2|4|16)}break;case"nodeconnect":var e=-1;for(var d in nodes){if(nodes[d]._id==l.event.nodeid){e=d;break}}if(e!=-1){var v=nodes[e];v.conn=l.event.conn;v.pwr=l.event.pwr;masterUpdate(4|16);refreshDevice(v._id)}break;case"wssessioncount":if(wssessions!=null){if(l.event.count==0&&wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]){delete wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]}else{wssessions["user/"+domain+"/"+l.event.username.toLowerCase()]=l.event.count}updateUsers()}break;case"clearevents":events=[];masterUpdate(32);break;case"login":if(users!=null&&users["user/"+domain+"/"+l.event.username.toLowerCase()]){users["user/"+domain+"/"+l.event.username.toLowerCase()].login=Math.floor(l.event.time/1000)}break;case"scanamtdevice":if((xxdialogMode==null)||(!Q("dp1range"))||(Q("dp1range").value!=l.event.range)){return}var I="";if(l.event.results==null){I="<div style=width:100%;text-align:center;margin-top:12px>Unable to scan this address range.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>"}else{amtScanResults=l.event.results;for(var d in l.event.results){var z=l.event.results[d],E=z.hostname;if(E.length>20){E=E.substring(0,20)+"..."}var G='<b title="'+EscapeHtml(z.hostname)+'">'+EscapeHtml(E)+"</b> - v"+z.ver;if(z.state==2){if(z.tls==1){G+=" with TLS."}else{G+=" without TLS."}}else{G+=" not activated."}I+='<div style=width:100%;margin-bottom:2px;background-color:lightgray><div style=padding:4px><div style=display:inline-block;margin-right:5px><input class=DevScanCheckbox name=dp1checkbox tag="'+EscapeHtml(d)+'" type=checkbox onclick=addAmtScanToMeshCheckbox() /></div><div class=j1 style=display:inline-block></div><div style=display:inline-block;margin-left:5px;overflow-x:auto;white-space:nowrap>'+G+"</div></div></div>"}if(I==""){I="<div style=width:100%;text-align:center;margin-top:12px>Scan returned no results.</div><div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>"}}QH("dp1results",I);QE("dp1range",true);QE("dp1rangebutton",true);break;case"notify":var o={text:l.event.value};if(l.event.tag!=null){o.tag=l.event.tag}addNotification(o);break;case"stopped":break;default:break}break;case"stopped":autoReconnect=false;QH("p0span",l.msg);break;default:console.log("Unknown message.action",l.action);break}}function onRealNameCheckBox(){showRealNames=Q("RealNameCheckBox").checked;putstore("showRealNames",showRealNames?1:0);masterUpdate(6);return}function onDeviceViewChange(a){if(a!=null){Q("viewselect").value=a}for(var b=1;b<5;b++){Q("devViewButton"+b).classList.remove("viewSelectorSel")}Q("devViewButton"+Q("viewselect").value).classList.add("viewSelectorSel");putstore("deviceView",Q("viewselect").value);putstore("viewsize",Q("sizeselect").value);masterUpdate(4)}function ondockeypress(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeys(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeys(a)}if(!xxdialogMode&&((xxcurrentView==15)||(xxcurrentView==115))){return agentConsoleHandleKeys(a)}if(!xxdialogMode&&xxcurrentView==4){if(a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}var b=0;if(a.key){if(a.key.length===1&&userSearchFocus==0){Q("UserSearchInput").value=((Q("UserSearchInput").value+a.key));b=1}if(a.keyCode==8&&userSearchFocus==0){var c=Q("UserSearchInput").value;Q("UserSearchInput").value=c.substring(0,c.length-1);b=1}if(a.keyCode==27){Q("UserSearchInput").value="";b=1}}else{if(a.charCode!=0&&userSearchFocus==0){Q("UserSearchInput").value=((Q("UserSearchInput").value+String.fromCharCode(a.charCode)));b=1}}if(b>0){if(b==1){onUserSearchInputChanged()}return haltEvent(a)}}if(xxdialogMode||xxcurrentView!=1){return}if(a.ctrlKey==true&&a.charCode==96){showRealNames=!showRealNames;Q("RealNameCheckBox").value=showRealNames;putstore("showRealNames",showRealNames?1:0);masterUpdate(6);return}if(a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}if(Q("viewselect").value<3){var b=0;if(a.key){if(a.key.length===1&&searchFocus==0){Q("SearchInput").value=((Q("SearchInput").value+a.key));b=1}if(a.keyCode==8&&searchFocus==0){var c=Q("SearchInput").value;Q("SearchInput").value=c.substring(0,c.length-1);b=1}if(a.keyCode==27){Q("SearchInput").value="";b=1}}else{if(a.charCode!=0&&searchFocus==0){Q("SearchInput").value=((Q("SearchInput").value+String.fromCharCode(a.charCode)));b=1}}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(Q("viewselect").value==3){if(a.key){if(a.key.length===1&&mapSearchFocus==0){Q("mapSearchLocation").value=((Q("mapSearchLocation").value+a.key));b=1}if(a.keyCode==27){Q("mapSearchLocation").value="";mapCloseSearchWindow();b=1}if(a.keyCode==13){getSearchLocation()}}else{if(a.charCode!=0&&mapSearchFocus==0){Q("mapSearchLocation").value=((Q("mapSearchLocation").value+String.fromCharCode(a.charCode)));b=1}}}}function ondockeydown(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeyDown(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeyDown(a)}if(!xxdialogMode&&xxcurrentView==13&&a.keyCode==116&&p13filetree!=null){haltEvent(a);return false}if(!xxdialogMode&&((xxcurrentView==15)||(xxcurrentView==115))){return agentConsoleHandleKeys(a)}if(!xxdialogMode&&xxcurrentView==4){if(a.keyCode===8&&userSearchFocus==0){var c=Q("UserSearchInput").value;Q("UserSearchInput").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("UserSearchInput").value="";b=1}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(xxdialogMode||xxcurrentView!=1||a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}var b=0;if(Q("viewselect").value<3){if(a.keyCode===8&&searchFocus==0){var c=Q("SearchInput").value;Q("SearchInput").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("SearchInput").value="";b=1}if(b>0){if(b==1){masterUpdate(5)}return haltEvent(a)}}if(Q("viewselect").value==3){if(a.keyCode===8&&mapSearchFocus==0){var c=Q("mapSearchLocation").value;Q("mapSearchLocation").value=(c.substring(0,c.length-1));b=1}if(a.keyCode===27){Q("mapSearchLocation").value="";mapCloseSearchWindow();b=1}}}function ondockeyup(a){if(!xxdialogMode&&xxcurrentView==11&&desktop&&Q("DeskControl").checked){return desktop.m.handleKeyUp(a)}if(!xxdialogMode&&xxcurrentView==12&&terminal&&terminal.State==3){return terminal.m.TermHandleKeyUp(a)}if(!xxdialogMode&&xxcurrentView==13&&a.keyCode==116&&p13filetree!=null){p13folderup(9999);haltEvent(a);return false}if(!xxdialogMode&&xxcurrentView==4){if((a.keyCode===8&&searchFocus==0)||a.keyCode===27){return haltEvent(a)}}if(xxdialogMode&&a.keyCode==27){dialogclose(0)}if(xxdialogMode||xxcurrentView!=0||a.ctrlKey==true||a.altKey==true||a.metaKey==true){return}if(Q("viewselect").value<3){if((a.keyCode===8&&searchFocus==0)||a.keyCode===27){return haltEvent(a)}}if(Q("viewselect").value==3){if((a.keyCode===8&&mapSearchFocus==0)||a.keyCode===27){return haltEvent(a)}}}function devMouseHover(b,c){var d=Q("viewselect").value;if(d==1){var a=b.children[1].children[1];a.children[0].classList.remove("g1s");a.children[1].classList.remove("e2s");a.children[2].classList.remove("g2s");if(c==1){a.children[0].classList.add("g1s");a.children[1].classList.add("e2s");a.children[2].classList.add("g2s")}}else{if(d==2){var a=b;a.children[2].classList.remove("g1s");a.children[4].classList.remove("e2s");a.children[3].classList.remove("g2s");if(c==1){a.children[2].classList.add("g1s");a.children[4].classList.add("e2s");a.children[3].classList.add("g2s")}}}}var deviceHeaderId=0;var deviceHeaderTotal=0;var deviceHeadersTitles={};var deviceHeaderCount;var deviceHeaders={};var oldviewmode=0;function updateDevices(){if(nodes==null){return}var H="",a=0,g=null,e=0,l={},O=Q("viewselect").value,s={},p={};QV("xdevices",O<4);QV("xdevicesmap",O==4);QV("devListToolbar",O<3);QV("kvmListToolbar",O==3);QV("devMapToolbar",O==4);QV("devListToolbarSize",O==3);QV("NoMeshesPanel",meshcount==0);QV("devListToolbarViewIcons",(meshcount!=0)&&(nodes.length>0));QV("devListToolbarSort",(meshcount!=0)&&(nodes.length>0)&&(O<4));if((meshcount==0)||(nodes.length==0)){O=1;sort=0}if(O==4){setTimeout(function(){if(xxmap.map!=null){xxmap.map.updateSize()}},200)}else{deviceHeaderId=0;deviceHeaderCount={};deviceHeaderTotal=0;deviceHeaders={};deviceHeadersTitles={};var x=[];if(sort==0){nodes.sort(meshSort)}else{if(sort==1){nodes.sort(powerSort)}else{if(sort==2){if(showRealNames==true){nodes.sort(deviceHostSort)}else{nodes.sort(deviceSort)}}}}var d=[],m=document.getElementsByClassName("DeviceCheckbox"),b=0;for(var t=0;t<m.length;t++){if(m[t].checked){d.push(m[t].value)}}if((oldviewmode<3)&&(O==3)){multiDesktopFilter=d}else{if((oldviewmode==3)&&(O<3)){d=multiDesktopFilter}}var M=Q("column_l").clientWidth-60;var k=Math.floor(M/301);k=301+Math.floor((M-(k*301))/k);for(var t in nodes){if(nodes[t].v==false){continue}var z=meshes[nodes[t].meshid],B=z.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(B==null){continue}var C=B.rights;if((O==3)&&(z.mtype==1)){continue}if(sort==0){if(nodes[t].meshid!=g){deviceHeaderSet();var o="";if(meshes[nodes[t].meshid].mtype==1){o="<span class=devHeaderx>, Intel® AMT only</span>"}if((O==1)&&(g!=null)){if(a==2){H+="<td><div style=width:301px></div></td>"}if(H!=""){H+="</tr></table>"}}H+="<div class=DevSt style=width:100%;padding-top:4px><span style=float:right>";H+=getMeshActions(z,C);H+='</span><span id=MxMESH style=cursor:pointer onclick=gotoMesh("'+nodes[t].meshid+'")>'+EscapeHtml(meshes[nodes[t].meshid].name)+"</span>"+o+"<span id=DevxHeader"+deviceHeaderId+" class=devHeaderx></span></div>";g=nodes[t].meshid;l[g]=1;a=0}}else{if(sort==1){var G=nodes[t].pwr?nodes[t].pwr:0;if(G!==g){deviceHeaderSet();if((O==1)&&(g!==null)){if(a==2){H+="<td><div style=width:301px></div></td>"}if(H!=""){H+="</tr></table>"}}H+="<div class=DevSt style=width:100%;padding-top:4px><span>"+PowerStateStr2(nodes[t].pwr)+"</span><span id=DevxHeader"+deviceHeaderId+' class="devHeaderx"></span></div>';g=G;a=0}}else{if(sort==2){if(g==null){g="1"}}}}e++;var L=EscapeHtml(nodes[t].name);if(L.length==0){L="<i>None</i>"}if((nodes[t].rname!=null)&&(nodes[t].rname.length>0)){L+=" / "+EscapeHtml(nodes[t].rname)}var D=EscapeHtml(nodes[t].name);if(showRealNames==true&&nodes[t].rname!=null){D=EscapeHtml(nodes[t].rname)}if(D.length==0){D="<i>None</i>"}var u=nodes[t].icon;var F=NodeStateStr(nodes[t]);if((!nodes[t].conn)||(nodes[t].conn==0)){u+=" gray"}if(O==1){H+="<div id=devs onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:"+k+'px;height:50px;padding-top:1px;padding-bottom:1px><div style=width:22px;height:50%;float:left;padding-top:12px><input class="'+nodes[t].meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+nodes[t]._id+" type=checkbox></div><div style=height:100%;cursor:pointer onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><div class=\"i"+u+'" style=width:50px;float:left></div><div style=height:100%><div class=g1></div><div class=e2><div class=e1 style=width:'+(k-100)+'px title="'+L+'">'+D+"</div><div>"+F+"</div></div><div class=g2></div></div></div></div>"}else{if(O==2){H+="<tr><td><div id=devs class=bar18 onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=height:18px;width:100%;font-size:medium>";H+='<div style=width:22px;float:left;background-color:white><input class="'+nodes[t].meshid+' DeviceCheckbox" onclick=p1updateInfo() value=devid_'+nodes[t]._id+" type=checkbox></div>";H+="<div style=float:left;height:18px;width:18px;background-color:white onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><div class=j"+u+" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>";H+="<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>";H+='<div style=cursor:pointer;font-size:14px title="'+L+"\" onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)><span style=float:right>"+F+"</span><span style=width:300px>"+D+"</span></div></div></td></tr>"}else{if((O==3)&&(nodes[t].conn&1)&&(((C&8)||(C&256))!=0)&&((nodes[t].agent.caps&1)!=0)){if((multiDesktopFilter.length==0)||(multiDesktopFilter.indexOf("devid_"+nodes[t]._id)>=0)){H+="<div id=devs style=display:inline-block;margin:1px;background-color:lightgray;border-radius:5px;position:relative><div style=padding:3px;cursor:pointer onclick=gotoDevice('"+nodes[t]._id+"',11,null,event)>";H+='<div class="j'+u+'" style=width:16px;float:left></div> '+D+"</div>";H+="<span onclick=gotoDevice('"+nodes[t]._id+"',null,null,event)></span><div id=xkvmid_"+nodes[t]._id.split("/")[2]+"><div id=skvmid_"+nodes[t]._id.split("/")[2]+' style="position:absolute;color:white;left:5px;top:27px;text-shadow:0px 0px 5px #000;z-index:1000;cursor:default" onclick=toggleKvmDevice(\''+nodes[t]._id+"')>Disconnected</div></div>";H+="</div>";x.push(nodes[t]._id)}}}}if((sort==3)&&(H!="")){if(nodes[t].tags){for(var w in nodes[t].tags){var K=nodes[t].tags[w];if(s[K]==null){s[K]=H;p[K]=1}else{s[K]+=H;p[K]+=1}if(O==3){break}}}H=""}deviceHeaderTotal++;if(typeof deviceHeaderCount[nodes[t].state]=="undefined"){deviceHeaderCount[nodes[t].state]=1}else{deviceHeaderCount[nodes[t].state]++}}if(sort==3){var q=[];for(var t in s){q.push(t)}q.sort(function(c,j){return c.toLowerCase().localeCompare(j.toLowerCase())});for(var w in q){var t=q[w];H+="<div class=DevSt style=width:100%;padding-top:4px><span>"+t+'</span><span class="devHeaderx">, '+p[t]+" device"+((p[t]>1)?"s":"")+"</span></div>"+s[t]}}if((H=="")&&(meshcount>0)&&(Q("SearchInput").value!="")){if(sort==3){H='<div style="margin:30px">No devices are included in any groups, click on a device\'s "Groups" to add to a group.</div>'}else{H='<div style="margin:30px">No devices matching this search.</div>'}}if((O==1)&&(a==2)){H+="<td><div style=width:301px></div></td>"}if((sort==0)&&(Q("SearchInput").value=="")&&(O<3)){for(var t in meshes){var y=meshes[t],A=y.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(A!=null){var C=A.rights;if(l[y._id]==null){if((g!="")&&(H!="")){H+="</tr></table>"}H+="<table style=width:100%;padding-top:4px cellpadding=0 cellspacing=0><tr><td colspan=3 class=DevSt><span style=float:right>";H+=getMeshActions(y,C);H+='</span><span id=MxMESH style=cursor:pointer onclick=gotoMesh("'+y._id+'")>'+EscapeHtml(y.name)+"</span></td></tr><tr>";if(y.mtype==1){H+="<td><div style=padding:10px><i>No Intel® AMT devices in this mesh";if((C&4)!=0){H+=', <a style=cursor:pointer onclick=addDeviceToMesh("'+y._id+'")>add one</a>'}}if(y.mtype==2){H+="<td><div style=padding:10px><i>No devices in this mesh";if((C&4)!=0){H+=', <a style=cursor:pointer onclick=addAgentToMesh("'+y._id+'")>add one</a>'}}H+=".</i></div></td>";g=y._id;e++}}}}H+="</tr></table><div style=height:1px></div>";H+="<div style=border-top-style:solid;border-top-width:1px;border-top-color:#DDDDDD;cursor:pointer;font-size:10px>";if((O<3)&&(sort==0)&&(meshcount>0)){H+='<a onclick=account_createMesh() title="Create a new group of devices." style=cursor:pointer>Add Device Group</a> '}H+='<a onclick=p10showMeshCmdDialog(0) style=cursor:pointer title="Download MeshCmd, a command line tool that performs many functions.">MeshCmd</a></div>';H+="</div><br/>";QH("xdevices",H);deviceHeaderSet();var m=document.getElementsByClassName("DeviceCheckbox"),b=0;for(var t=0;t<m.length;t++){m[t].checked=(d.indexOf(m[t].value)>=0)}for(var t in deviceHeaders){QH(t,deviceHeaders[t])}for(var t in deviceHeadersTitles){Q(t).title=deviceHeadersTitles[t]}p1updateInfo();if(O==3){var P=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex];var I=P.x+2,N=M-5,R=Math.floor(N/I);R=I+Math.floor((N-(R*I))/R);P.y=P.y*(R/P.x);P.x=R;for(var t in multiDesktop){multiDesktop[t].xxdelete=true}for(var t in x){var v=x[t],J=v.split("/")[2],h=multiDesktop[v];if(h!=null){h.m.CanvasId.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");Q("xkvmid_"+J).appendChild(h.m.CanvasId);delete h.xxdelete;QH("skvmid_"+J,["Disconnected","Connecting...","Setup...","",""][((h.m.State==null)?h.m.state:h.m.State)])}else{var E=getNodeFromId(v);if((desktopNode==E)&&(desktop!=null)){var a=desktop.m.CanvasId;a.setAttribute("id","kvmid_"+J);a.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");a.setAttribute("onclick","toggleKvmDevice('"+v+"')");a.removeAttribute("onmousedown");a.removeAttribute("onmouseup");a.removeAttribute("onmousemove");Q("xkvmid_"+J).appendChild(a);QH("skvmid_"+J,["Disconnected","Connecting...","Setup...","",""][((desktop.m.State==null)?desktop.m.state:desktop.m.State)]);if(desktop.m.SendCompressionLevel){desktop.m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate)}desktop.shortid=J;desktop.onStateChanged=onMultiDesktopStateChange;multiDesktop[v]=desktop;desktop=desktopNode=currentNode=null;QH("DeskParent",'<canvas id="Desk" width="640" height="480" style="width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>')}else{var a=document.createElement("canvas");a.setAttribute("id","kvmid_"+J);a.setAttribute("width",640);a.setAttribute("height",480);a.setAttribute("oncontextmenu","return false");a.setAttribute("style","background-color:black;width:"+P.x+"px;height:"+P.y+"px");a.setAttribute("onclick","toggleKvmDevice('"+v+"')");try{Q("xkvmid_"+J).appendChild(a)}catch(n){}if(Q("autoConnectDesktopCheckbox").checked==true){setTimeout(function(){connectMultiDesktop(E,1)},100)}}}}for(var t in multiDesktop){if(multiDesktop[t].xxdelete==true){multiDesktop[t].Stop();delete multiDesktop[t]}else{if(debugmode&&multiDesktop[t].m&&multiDesktop[t].m.onScreenSizeChange){mdeskAdjust(multiDesktop[t].m,multiDesktop[t].m.ScreenWidth,multiDesktop[t].m.ScreenHeight,multiDesktop[t].m.CanvasId)}}}deskAdjust()}else{disconnectAllKvmFunction();Q("autoConnectDesktopCheckbox").checked=false}}oldviewmode=O}function toggleKvmDevice(d){var c=getNodeFromId(d),a=meshes[c.meshid],b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&8)||(b&256)){if(c.conn&1){connectMultiDesktop(c,1)}}}function autoConnectDesktops(){if(Q("autoConnectDesktopCheckbox").checked==true){connectAllKvmFunction()}}function connectAllKvmFunction(){for(var a in nodes){if(multiDesktop[nodes[a]._id]==null){toggleKvmDevice(nodes[a]._id)}}}function disconnectAllKvmFunction(){for(var a in multiDesktop){multiDesktop[a].Stop()}multiDesktop={}}function onMultiDesktopStateChange(a,c){try{QH("skvmid_"+a.shortid,["Disconnected","Connecting...","Setup...","",""][c])}catch(b){}}function showMultiDesktopSettings(){QV("d7amtkvm",false);QV("d7meshkvm",true);d7bitmapquality.value=multidesktopsettings.quality;d7bitmapscaling.value=multidesktopsettings.scaling;if(multidesktopsettings.framerate){d7framelimiter.value=multidesktopsettings.framerate}else{d7framelimiter.value=1000}setDialogMode(7,"Remote Desktop Settings",3,showMultiDesktopSettingsChanged)}function showMultiDesktopSettingsChanged(){multidesktopsettings.quality=d7bitmapquality.value;multidesktopsettings.scaling=d7bitmapscaling.value;multidesktopsettings.framerate=d7framelimiter.value;localStorage.setItem("multidesktopsettings",JSON.stringify(multidesktopsettings));for(var a in multiDesktop){multiDesktop[a].m.SendCompressionLevel(1,multidesktopsettings.quality,multidesktopsettings.scaling,multidesktopsettings.framerate)}}function connectMultiDesktop(c,a){var d=c._id,e=d.split("/")[2];var b=multiDesktop[d];if(b==null){if(Q("kvmid_"+e)==null){return}if(a==2){if((c.intelamt.user==null)||(c.intelamt.user=="")){return}b=CreateAmtRedirect(CreateAmtRemoteDesktop("kvmid_"+e),authCookie);b.shortid=e;b.onStateChanged=onMultiDesktopStateChange;b.m.bpp=1;b.m.useZRLE=true;b.m.showmouse=true;b.m.onKvmData=function(g){console.log("KVM Data received in multi-desktop mode, this is not supported.")};if(debugmode>0){b.m.onScreenSizeChange=mdeskAdjust}b.Start(d,16994,"*","*",0);b.contype=2;multiDesktop[d]=b}else{if(a==1){b=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("kvmid_"+e),serverPublicNamePort,authCookie);b.shortid=e;b.attemptWebRTC=attemptWebRTC;b.onStateChanged=onMultiDesktopStateChange;b.m.CompressionLevel=multidesktopsettings.quality;b.m.ScalingLevel=multidesktopsettings.scaling;b.m.FrameRateTimer=multidesktopsettings.framerate;if(debugmode>0){b.m.onScreenSizeChange=mdeskAdjust}b.Start(d);b.contype=1;multiDesktop[d]=b}}}else{b.Stop();delete multiDesktop[d]}}function getMeshActions(a,b){if((b&4)==0){return""}var c="";if((features&1024)==0){c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer that is located on the internet." onclick=addCiraDeviceToMesh("'+a._id+'")>Add CIRA</a>'}if(a.mtype==1){if((features&1)==0){c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer that is located on the local network." onclick=addDeviceToMesh("'+a._id+'")>Add Local</a>';c+=' <a style=cursor:pointer;font-size:10px title="Add a new Intel® AMT computer by scanning the local network." onclick=addAmtScanToMesh("'+a._id+'")>Scan Network</a>'}}if(a.mtype==2){c+=' <a style=cursor:pointer;font-size:10px title="Add a new computer to this mesh by installing the mesh agent." onclick=addAgentToMesh("'+a._id+'")>Add Agent</a>';if(features&64){c+=' <a style=cursor:pointer;font-size:10px title="Invite someone to install the mesh agent on this mesh." onclick=inviteAgentToMesh("'+a._id+'")>Invite</a>'}}return c}function addDeviceToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c='Add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'".<br /><br />';c+=addHtmlValue("Device Name","<input id=dp1devicename style=width:230px maxlength=32 autocomplete=off onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />");c+=addHtmlValue("Hostname",'<input id=dp1hostname style=width:230px maxlength=32 autocomplete=off placeholder="Same as device name" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');c+=addHtmlValue("Username",'<input id=dp1username style=width:230px maxlength=32 autocomplete=off placeholder="admin" onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />');c+=addHtmlValue("Password","<input id=dp1password type=password style=width:230px autocomplete=off maxlength=32 onchange=validateDeviceToMesh() onkeyup=validateDeviceToMesh() />");c+=addHtmlValue("Security","<select id=dp1tls style=width:236px><option value=0>No TLS security</option><option value=1>TLS security required</option></select>");setDialogMode(2,"Add Intel® AMT device",3,addDeviceToMeshEx,c,b);validateDeviceToMesh();Q("dp1devicename").focus()}function addAmtScanToMesh(a){if(xxdialogMode){return}var b="Enter a range of IP addresses to scan for Intel AMT devices.<br /><br />";b+=addHtmlValue("IP Range",'<input id=dp1range style=width:184px value="192.168.1.0/24" onkeyup=addAmtScanToMeshKeyUp(event) /><input id=dp1rangebutton type=button value=Scan onclick=addAmtScanToMeshButton()></input>');b+='<div id=dp1results style="width:100%;height:200px;background-color:white;border:1px gray solid;overflow-y:scroll"></div>';setDialogMode(2,"Scan for Intel® AMT devices",3,addAmtScanToMeshEx,b,a);QE("idx_dlgOkButton",false);QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px;color:gray;line-height:1.5>Sample IP range values<br />192.168.0.100<br />192.168.1.0/24<br />192.167.0.1-192.168.0.100</div>");focusTextBox("dp1range")}function addAmtScanToMeshKeyUp(a){if(a.keyCode==13){haltEvent(a);addAmtScanToMeshButton()}}function addAmtScanToMeshEx(b,h){var d=document.getElementsByClassName("DevScanCheckbox"),c=0;for(var e=0;e<d.length;e++){if(d[e].checked){var g=d[e].getAttribute("tag");var a=amtScanResults[g];meshserver.send({action:"addamtdevice",meshid:h,devicename:g,hostname:a.hostname,amtusername:"",amtpassword:"",amttls:a.tls})}}}function addAmtScanToMeshButton(){QE("dp1range",false);QE("dp1rangebutton",false);QH("dp1results","<div style=width:100%;text-align:center;margin-top:12px>Scanning...</div>");meshserver.send({action:"scanamtdevice",range:Q("dp1range").value})}function addAmtScanToMeshCheckbox(){var b=document.getElementsByClassName("DevScanCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked){a++}}QE("idx_dlgOkButton",a>0)}function addCiraDeviceToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c=b.split("/")[2].replace(/\@/g,"X").replace(/\$/g,"X");var e="<select id=dlgAddCiraSel onclick=dlgAddCiraSelClick() style=width:230px><option value=0>MeshCommander Script</option><option value=1>Manual Username/Password</option>";if((features&16)==0){e+="<option value=2>Manual Certificate</option></select>"}var d="";d+=addHtmlValue("Setup Method",e);d+="<hr>";d+='<div id=dlgAddCira0>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+"\" with CIRA, download the following script files and use <a href='http://meshcommander.com' rel='noreferrer noopener' target='_blank'>MeshCommander</a> to run the script to configure computers.<br /><br />";d+=addHtmlValue("Setup CIRA",'<a style=cursor:pointer onclick=fileDownload("mescript.ashx?type=1&meshid='+c.substring(0,16)+'","cira_setup.mescript")>cira_setup.mescript</a>');d+=addHtmlValue("Cleanup CIRA",'<a style=cursor:pointer onclick=fileDownload("mescript.ashx?type=2","cira_clean.mescript")>cira_clean.mescript</a>');d+="</div>";d+='<div id=dlgAddCira1 style=display:none>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'" with CIRA, load the following certificate as trusted root within Intel AMT';if(serverinfo.mpspass){d+=" and authenticate to the server using this username and password.<br /><br />"}else{d+=" and authenticate to the server using this username and any password.<br /><br />"}d+=addHtmlValue("Root Certificate",'<a style=cursor:pointer onclick=fileDownload("MeshServerRootCert.cer","MeshServerRootCert.cer")>Root Certificate File</a>');d+=addHtmlValue("Username",'<input style=width:230px readonly value="'+c.substring(0,16)+'" />');if(serverinfo.mpspass){d+=addHtmlValue("Password",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpspass)+'" />')}if(serverinfo!=null){d+=addHtmlValue("MPS Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')}d+="</div>";if((features&16)==0){d+='<div id=dlgAddCira2 style=display:none>To add a new Intel® AMT device to device group "'+EscapeHtml(a.name)+'" with CIRA, load the following certificate as trusted root within Intel AMT, authenticate using a client certificate with the following common name and connect to the following server.<br /><br />';d+=addHtmlValue("Root Certificate",'<a style=cursor:pointer onclick=fileDownload("MeshServerRootCert.cer","MeshServerRootCert.cer")>Root Certificate File</a>');d+=addHtmlValue("Organization",'<input style=width:230px readonly value="'+c+'" />');if(serverinfo!=null){d+=addHtmlValue("MPS Server",'<input style=width:230px readonly value="'+EscapeHtml(serverinfo.mpsname)+":"+serverinfo.mpsport+'" />')}d+="</div>"}setDialogMode(2,"Add Intel® AMT CIRA device",2,null,d,"fileDownload")}function dlgAddCiraSelClick(){var a=Q("dlgAddCiraSel").value;QV("dlgAddCira0",a==0);QV("dlgAddCira1",a==1);QV("dlgAddCira2",a==2)}function checkEmail(c){var d=c.split("@");var b=((d.length==2)&&(d[0].length>0)&&(d[1].split(".").length>1)&&(d[1].length>2));if(b==true){var e=d[1].split(".");for(var a in e){if(e[a].length==0){b=false}}}return b}function inviteAgentToMesh(b){if(xxdialogMode){return}var a=meshes[b];var c="Invite someone to install the mesh agent. An email with be sent with the link to the mesh agent installation for "+EscapeHtml(a.name)+".<br /><br />";c+=addHtmlValue("Name (optional)",'<input id=agentInviteName value="" style=width:230px maxlength=64 />');c+=addHtmlValue("Email",'<input id=agentInviteEmail style=width:230px placeholder="example@email.com" onkeyup=validateAgentInvite()></input>');c+=addHtmlValue("Operating System","<select id=agentInviteNameOs style=width:236px><option value=0>Any supported</option><option value=1>Windows only</option><option value=3>Apple OSX only</option><option value=2>Linux only</option></select>");c+=addHtmlValue("Installation Type","<select id=agentInviteType style=width:236px><option value=0>Background and interactive</option><option value=2>Background only</option><option value=1>Interactive only</option></select>");c+=addHtmlValue("Message<br />(optional)",'<textarea id=agentInviteMessage value="" style=width:230px;height:100px;resize:none maxlength=1024 /></textarea>');setDialogMode(2,"Invite",3,performAgentInvite,c,b);validateAgentInvite()}function validateAgentInvite(){QE("idx_dlgOkButton",checkEmail(Q("agentInviteEmail").value))}function performAgentInvite(a,b){meshserver.send({action:"inviteAgent",meshid:b,email:Q("agentInviteEmail").value,name:Q("agentInviteName").value,os:Q("agentInviteNameOs").value,flags:Q("agentInviteType").value,msg:Q("agentInviteMessage").value})}function addAgentToMesh(c){if(xxdialogMode){return}var b=meshes[c],h="",a=0;h+=addHtmlValue("Operating System","<select id=aginsSelect onchange=addAgentToMeshClick() style=width:236px><option value=0>Windows</option><option value=1>Linux</option><option value=2>Apple OSX</option><option value=3>Windows (UnInstall)</option><option value=4>Linux (UnInstall)</option></select>");h+="<div id=aginsTypeDiv>";h+=addHtmlValue("Installation Type","<select id=aginsType onchange=addAgentToMeshClick() style=width:236px><option value=0>Background & interactive</option><option value=2>Background only</option><option value=1>Interactive only</option></select>");h+="</div><hr>";h+='<div id=agins_windows>To add a new computer to device group "'+EscapeHtml(b.name)+'", download the mesh agent and install it the computer to manage. This agent has server and mesh information embedded within it.<br /><br />';h+=addHtmlValue("Mesh Agent",'<a id=aginsw32lnk style=cursor:pointer onclick=fileDownload("meshagents?id=3&meshid='+c.split("/")[2]+'&installflags=","MeshAgent.exe",1) title="32bit version of the MeshAgent">Windows (.exe)</a>');h+=addHtmlValue("Mesh Agent",'<a id=aginsw64lnk style=cursor:pointer onclick=fileDownload("meshagents?id=4&meshid='+c.split("/")[2]+'&installflags=","MeshAgent.exe",1) title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');if(debugmode>0){h+=addHtmlValue("Settings File",'<a id=aginswmshlnk href="meshsettings?id='+c.split("/")[2]+'&installflags=0" rel="noreferrer noopener" target="_blank">'+EscapeHtml(b.name)+" settings (.msh)</a>")}h+="</div>";h+="<div id=agins_linux style=display:none>To add a computer to "+EscapeHtml(b.name)+" run the following command. Root credentials will be needed.<br />";h+="<textarea id=agins_linux_area rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>";h+="</div>";h+='<div id=agins_osx style=display:none>To add a new computer to device group "'+EscapeHtml(b.name)+'", download the mesh agent and install it the computer to manage. This agent installer has server and mesh information embedded within it.<br /><br />';h+=addHtmlValue("Mesh Agent",'<a href="meshosxagent?id=16&meshid='+c.split("/")[2]+'" rel="noreferrer noopener" target="_blank" title="64bit version of OSX Mesh Agent">OSX Agent (64bit)</a>');h+="</div>";h+='<div id=agins_windows_un style=display:none>To remove a mesh agent, download the file below, run it and click "uninstall".<br /><br />';h+=addHtmlValue("Mesh Agent",'<a style=cursor:pointer onclick=fileDownload("meshagents?id=3","MeshAgent.exe") title="32bit version of the MeshAgent">Windows (.exe)</a>');h+=addHtmlValue("Mesh Agent",'<a style=cursor:pointer onclick=fileDownload("meshagents?id=4","MeshAgent.exe") title="64bit version of the MeshAgent">Windows x64 (.exe)</a>');h+="</div>";h+="<div id=agins_linux_un style=display:none>To remove a mesh agent, run the following command. Root credentials will be needed.<br />";h+="<textarea id=agins_linux_area_un rows=2 cols=20 readonly=readonly style=width:100%;resize:none;height:120px;overflow:scroll;font-size:12px readonly></textarea>";h+="</div>";setDialogMode(2,"Add Mesh Agent",2,null,h,"fileDownload");var g=serverinfo.name;if((g=="un-configured")||((features&2)!=0)){g=window.location.hostname}var d=((features&8192)!=0)?"--no-proxy ":"";if(serverinfo.https==true){var e=(serverinfo.port==443)?"":(":"+serverinfo.port);Q("agins_linux_area").value="wget https://"+g+e+"/meshagents?script=1 "+d+"--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh https://"+g+e+" '"+c.split("/")[2]+"'\r\n";Q("agins_linux_area_un").value="wget https://"+g+e+"/meshagents?script=1 "+d+"--no-check-certificate -O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"}else{var e=(serverinfo.port==80)?"":(":"+serverinfo.port);Q("agins_linux_area").value="wget http://"+g+e+"/meshagents?script=1 "+d+"-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh http://"+g+e+" '"+c.split("/")[2]+"'\r\n";Q("agins_linux_area_un").value="wget http://"+g+e+"/meshagents?script=1 "+d+"-O ./meshinstall.sh && chmod 755 ./meshinstall.sh && sudo ./meshinstall.sh uninstall\r\n"}Q("aginsSelect").focus();addAgentToMeshClick()}function fileDownload(g,d,a){var h=null,c="";if(a==1){c=Q("aginsType").value}else{if(a==2){c=Q("aginsSelect").value;if(parseInt(c)>=5){d=d.toLowerCase()}else{d+=".exe"}}}try{h=new XDomainRequest()}catch(b){}if(!h){h=new XMLHttpRequest()}h.open("GET",window.location.href+g+c);h.timeout=15000;h.responseType="blob";h.onprogress=function(e){console.log(e)};h.onload=function(j){saveAs(new Blob([j.target.response],{type:"application/octet-stream"}),d);if(xxdialogTag=="fileDownload"){setDialogMode(0)}};h.onerror=function(){if(xxdialogTag=="fileDownload"){setDialogMode(0)}alert("Agent downloads timeout.")};h.ontimeout=function(){if(xxdialogTag=="fileDownload"){setDialogMode(0)}alert("Unable to download agent.")};h.send()}function addAgentToMeshClick(){var a=Q("aginsSelect").value;QV("agins_windows",a==0);QV("agins_linux",a==1);QV("agins_osx",a==2);QV("agins_windows_un",a==3);QV("agins_linux_un",a==4);QV("aginsTypeDiv",a==0);if(debugmode>0){Q("aginswmshlnk").href=(Q("aginswmshlnk").href.split("installflags=")[0])+"installflags="+Q("aginsType").value}}function validateDeviceToMesh(){QE("idx_dlgOkButton",(Q("dp1devicename").value.length>0)&&(passwordcheck(Q("dp1password").value)))}function addDeviceToMeshEx(b,d){var a=Q("dp1username").value;if(a==""){a="admin"}var c=Q("dp1hostname").value;if(c==""){c=Q("dp1devicename").value}meshserver.send({action:"addamtdevice",meshid:d,devicename:Q("dp1devicename").value,hostname:c,amtusername:a,amtpassword:Q("dp1password").value,amttls:Q("dp1tls").value})}function deviceHeaderSet(){if(deviceHeaderId==0){deviceHeaderId=1;return}deviceHeaders["DevxHeader"+deviceHeaderId]=", "+deviceHeaderTotal+((deviceHeaderTotal==1)?" node":" nodes");deviceHeaderId++;deviceHeaderCount={};deviceHeaderTotal=0}var powerStateStrings=["",'<span title="Device is powered on.">Powered</span>','<span title="Device is in sleep state (S1).">Sleeping</span>','<span title="Device is in sleep state (S2).">Sleeping</span>','<span title="Device is in deep sleep state (S3).">Deep Sleep</span>','<span title="Device is in hibernating state (S4).">Hibernating</span>','<span title="Device is in powered off state (S5).">Soft-Off</span>','<span title="Device is detected but power state could not be obtained.">Present</span>'];var powerStateStrings2=["","Device is powered","Device is in sleep state (S1)","Device is in sleep state (S2)","Device is in deep sleep state (S3)","Device is hibernating (S4)","Device is in soft-off state (S5)","Device is present, but power state cannot be determined"];var powerColorTable=["#00000000","black","blue","blue","lightblue","blueviolet","darkgreen","lightseagreen","lightseagreen"];function NodeStateStr(a){var b=[];if(a.state>0&&a.state<powerStatetable.length){state.push(powerStatetable[a.state])}if(a.conn){if((a.conn&1)!=0){b.push('<span title="Mesh agent is connected and ready for use.">Agent</span>')}if((a.conn&2)!=0){b.push('<span title="Intel® AMT CIRA is connected and ready for use.">CIRA</span>')}if((a.conn&4)!=0){b.push('<span title="Intel® AMT is routable.">Intel® AMT</span>')}if((a.conn&8)!=0){b.push('<span title="Mesh agent is reachable using another agent as relay.">Relay</span>')}}if((a.pwr!=null)&&(a.pwr!=0)){b.push(powerStateStrings[a.pwr])}return b.join(", ")}function PowerStateStr(a){if(a<powerStatetable.length){return powerStatetable[a]}return""}function PowerStateStr2(a){if((a!=0)&&(a<powerStatetable.length)){return powerStatetable[a]}return"Unknown"}function selectallButtonFunction(){var b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked===true){a++}}for(var c=0;c<b.length;c++){b[c].checked=(a==0)}p1updateInfo()}function p1updateInfo(){var b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked===true){a++}}if(a>0){QE("GroupActionButton",true);Q("SelectAllButton").value="Select None";QV("cxmgroupsplit",true);QV("cxmdesktop",true)}else{QE("GroupActionButton",false);Q("SelectAllButton").value="Select All";QV("cxmgroupsplit",false);QV("cxmdesktop",false)}}function groupActionFunction(){var a="Select an operation to perform on all selected devices. Actions will be performed only with proper rights.<br /><br />";a+=addHtmlValue("Operation","<select id=d2groupop style=float:right;width:250px><option value=100>Wake-up devices</option><option value=4>Sleep devices</option><option value=3>Reset devices</option><option value=2>Power off devices</option><option value=102>Move to device group</option><option value=101>Delete devices</option></select>");setDialogMode(2,"Group Action",3,groupActionFunctionEx,a)}function getCheckedDevices(){var e=[],b=document.getElementsByClassName("DeviceCheckbox"),a=0;for(var c=0;c<b.length;c++){if(b[c].checked){if(b[c].value){var d=b[c].value.substring(6);if(e.indexOf(d)==-1){e.push(d)}}}}return e}function groupActionFunctionEx(){var a=Q("d2groupop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:getCheckedDevices()})}else{if(a==101){var b="Confirm delete selected devices(s)?<br /><br />";b+="<label><input id=d2check type=checkbox onchange=d2groupActionFunctionDelEx() />Confirm</label>";setDialogMode(2,"Delete Nodes",3,groupActionFunctionDelEx,b);QE("idx_dlgOkButton",false)}else{if(a==102){p10showChangeGroupDialog(getCheckedDevices())}else{meshserver.send({action:"poweraction",nodeids:getCheckedDevices(),actiontype:a})}}}}function d2groupActionFunctionDelEx(){QE("idx_dlgOkButton",Q("d2check").checked)}function groupActionFunctionDelEx(){meshserver.send({action:"removedevices",nodeids:getCheckedDevices()})}function onSortSelectChange(a){sort=document.getElementById("sortselect").selectedIndex;if(!a){putstore("sort",sort)}}function meshSort(c,d){if(c.meshnamel>d.meshnamel){return 1}if(c.meshnamel<d.meshnamel){return -1}if(c.meshid==d.meshid){if(showRealNames==true){if(c.rnamel>d.rnamel){return 1}if(c.rnamel<d.rnamel){return -1}return 0}else{if(c.namel>d.namel){return 1}if(c.namel<d.namel){return -1}return 0}}return 0}function powerSort(c,e){var d=c.pwr?c.pwr:0;var g=e.pwr?e.pwr:0;if(d>g){return -1}if(d<g){return 1}if(d==g){if(showRealNames==true){if(c.rnamel>e.rnamel){return 1}if(c.rnamel<e.rnamel){return -1}return 0}else{if(c.namel>e.namel){return 1}if(c.namel<e.namel){return -1}return 0}}return 0}function deviceSort(c,d){if(c.namel>d.namel){return 1}if(c.namel<d.namel){return -1}return 0}function deviceHostSort(c,d){if(c.rnamel>d.rnamel){return 1}if(c.rnamel<d.rnamel){return -1}return 0}function onSearchFocus(a){searchFocus=a}function onMapSearchFocus(a){mapSearchFocus=a}function onUserSearchFocus(a){userSearchFocus=a}function onConsoleFocus(a){consoleFocus=a}function onSearchInputChanged(){var h=Q("SearchInput").value.toLowerCase().trim();putstore("search",h);if(h==""){for(var a in nodes){nodes[a].v=true}}else{try{var c=h.split(/\s+/).join("|"),e=new RegExp(c);for(var a in nodes){nodes[a].v=(e.test(nodes[a].name.toLowerCase()))||(nodes[a].rnamel!=null&&e.test(nodes[a].rnamel.toLowerCase()));if((nodes[a].v==false)&&nodes[a].tags){for(var g in nodes[a].tags){if(e.test(nodes[a].tags[g].toLowerCase())){nodes[a].v=true;break}else{nodes[a].v=false}}}}}catch(b){for(var a in nodes){nodes[a].v=true}}}}var contextelement=null;function handleContextMenu(d){hideContextMenu();var l=(window.pageXOffset!==null)?window.pageXOffset:(document.documentElement||document.body.parentNode||document.body).scrollLeft;var m=(window.pageYOffset!==null)?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;var c=document.elementFromPoint(d.pageX-l,d.pageY-m);if(c&&c!=null&&c.id=="MxMESH"){contextelement=c;var b=document.getElementById("meshContextMenu");b.style.left=d.pageX+"px";b.style.top=d.pageY+"px";b.style.display="block"}else{while(c&&c!=null&&c.id!="devs"){c=c.parentElement}if(!c||c==null){return true}contextelement=c;var b=document.getElementById("contextMenu");b.style.left=d.pageX+"px";b.style.top=d.pageY+"px";b.style.display="block"}var k=contextelement.children[1].attributes.onclick.value;var j=getNodeFromId(k.substring(12,k.length-18));var e=meshes[j.meshid];var g=e.links["user/"+domain+"/"+userinfo.name.toLowerCase()];var h=g.rights;var a=((h&16)!=0);QV("cxdesktop",((e.mtype==1)||(j.agent==null)||(j.agent.caps==null)||((j.agent.caps&1)!=0)||(j.intelamt&&(j.intelamt.state==2)))&&((h&8)||(h&256)));QV("cxterminal",((e.mtype==1)||(j.agent==null)||(j.agent.caps==null)||((j.agent.caps&2)!=0)||(j.intelamt&&(j.intelamt.state==2)))&&(h&8));QV("cxfiles",((e.mtype==2)&&((j.agent==null)||(j.agent.caps==null)||((j.agent.caps&4)!=0)))&&(h&8));QV("cxevents",(j.intelamt!=null)&&((j.intelamt.state==2)||(j.conn&2))&&(h&8));QV("cxconsole",(a&&(e.mtype==2)&&((j.agent==null)||(j.agent.caps==null)||((j.agent.caps&8)!=0)))&&(h&8));return haltEvent(d)}function cmaction(a,b){var c=contextelement.children[1].attributes.onclick.value;c=c.substring(12,c.length-18);if(a==7){Q("viewselect").value=3;Q("viewselect").onchange();Q("autoConnectDesktopCheckbox").checked=true;Q("autoConnectDesktopCheckbox").onclick()}if((a>0)&&(a<7)){var d=[0,10,12,11,13,16,15][a];if(b&&(b.shiftKey==true)){window.open(window.location.origin+"?node="+c.split("/")[2]+"&viewmode="+d+"&hide=16","meshcentral:"+c)}else{gotoDevice(c,d)}}}function cmmeshaction(a){var d=contextelement.attributes.onclick.value.substring(32,(32+69));var b=document.getElementsByClassName("DeviceCheckbox");if(a==1){for(var c=0;c<b.length;c++){if((b[c].attributes)&&(b[c].attributes["class"]["value"].substring(0,69)==d)){b[c].checked=true}}}if(a==2){for(var c=0;c<b.length;c++){if((b[c].attributes)&&(b[c].attributes["class"]["value"].substring(0,69)==d)){b[c].checked=false}}}p1updateInfo()}function hideContextMenu(){QV("contextMenu",false);QV("meshContextMenu",false);contextelement=null}var xxmap={map:null,contextmenu:null,activeInteractions:[],showindex:0,markersSource:null,markersLayer:null,mapLayer:null,mapView:null,};function updateMapMarkers(j){if((xxmap!=null)&&(xxmap.map==null)){try{loadmap()}catch(b){console.error("loadmap() exception",b)}}if(xxmap==null){return}var a=null;for(var d in nodes){try{var g=map_parseNodeLoc(nodes[d]),c=xxmap.markersSource.getFeatureById(nodes[d]._id);if((g!=null)&&((nodes[d].meshid==j)||(j==null))){var e=g[0],h=g[1],k=g[2];if(a==null){a=[e,h,e,h,0]}else{if(e<a[0]){a[0]=e}if(h<a[1]){a[1]=h}if(e>a[2]){a[2]=e}if(h>a[3]){a[3]=h}}if(c==null){addFeature(nodes[d]);a[4]=1}else{updateFeature(nodes[d],c);c.setStyle(markerStyle(nodes[d],g[2]))}}else{if(c){xxmap.markersSource.removeFeature(c)}}}catch(b){console.error("updateMapMarkers() exception",b,JSON.stringify(nodes[d]))}}return a}var map_cm_popup=new ol.Overlay({element:Q("xmap-info-window"),positioning:"bottom-center",stopEvent:false});var map_cm_editMarker={text:"Modify node location",callback:function(a){modifyMarkerloc(a.data)}};var map_cm_clearMarker={text:"Remove node location",callback:function(a){meshserver.send({action:"changedevice",nodeid:a.data.a,userloc:[]})}};var map_cm_saveMarker={text:"Save node location",callback:function(a){saveMarkerloc(a.data)}};var map_cm_nodemenu_items=[{text:"General information",callback:function(a){if(a.data!=null){gotoDevice(a.data,10)}}},{text:"Desktop",callback:function(a){if(a.data!=null){gotoDevice(a.data,11)}}},{text:"Terminal",callback:function(a){if(a.data!=null){gotoDevice(a.data,12)}}},{text:"Intel® AMT",callback:function(a){if(a.data!=null){gotoDevice(a.data,14)}}},"-",{text:"Zoom-in to extent",callback:function(b){var a=b.data.getGeometry().getCoordinates();zoomToLocation(a,19)}},{text:"Zoom-out to extent",callback:function(b){var a=b.data.getGeometry().getCoordinates();zoomToLocation(a,2)}}];var contextmenu_items=[{text:"Refresh",callback:function(){refreshMap(true,true)}},{text:"Zoom to fit extent",callback:function(){zoomToFitExtent()}},{text:"Center map here",callback:function(a){xxmap.mapView.animate({center:a.coordinate})}},{text:"Place node here",callback:function(a){placeNode(a.coordinate)}}];function stringToIntHash(c){var a=0,b;for(b=0;b<c.length;b++){a=((a<<5)-a)+c.charCodeAt(b);a|=0}return a}function map_parseNodeLoc(b){var a=null,c=0;if(b.iploc){a=b.iploc;c=1}if(b.wifiloc){a=b.wifiloc;c=2}if(b.gpsloc){a=b.gpsloc;c=3}if(b.userloc){a=b.userloc;c=4}if((a==null)||(typeof a!="string")){return null}a=a.split(",");if(c==1){return[parseFloat(a[0])+(stringToIntHash(b._id.substring(0,20))/100000000000),parseFloat(a[1])+(stringToIntHash(b._id.substring(20))/100000000000),c]}else{return[parseFloat(a[0]),parseFloat(a[1]),c]}}function loadmap(){if(xxmap==null){return}try{xxmap.markersSource=new ol.source.Vector();xxmap.markersLayer=new ol.layer.Vector({source:xxmap.markersSource});xxmap.mapLayer=new ol.layer.Tile({source:new ol.source.OSM()});xxmap.mapView=new ol.View({center:ol.proj.transform([0,0],"EPSG:4326","EPSG:3857"),zoom:2,minZoom:2,maxZoom:20,extent:ol.proj.transformExtent([-100000,-69.55,100000,69.55],"EPSG:4326","EPSG:3857")});xxmap.map=new ol.Map({target:"xdevicesmap",layers:[xxmap.mapLayer,xxmap.markersLayer],view:xxmap.mapView});xxmap.map.addOverlay(map_cm_popup);xxmap.map.on("click",function(c){var d=xxmap.map.forEachFeatureAtPixel(c.pixel,function(h,j){return h});if(d){var g=d.getId();if(g!=null){gotoDevice(g,10)}else{var e=getCorrespondingFeature(d);gotoDevice(e.getId(),10)}}});xxmap.map.on("pointermove",function(d){var g=xxmap.map.forEachFeatureAtPixel(d.pixel,function(j,k){return j});if(g){xxmap.map.getTargetElement().style.cursor="pointer";var c=g.getGeometry().getCoordinates();map_cm_popup.setPosition(c);var e=g.getId();if(e){QH("xmap-info-window",g.get("name"))}else{var h=getCorrespondingFeature(g);QH("xmap-info-window",h.get("name"))}}else{xxmap.map.getTargetElement().style.cursor="";QH("xmap-info-window","")}});var a=new ContextMenu({width:160,defaultItems:false,items:contextmenu_items});a.on("open",function(c){var e=xxmap.map.forEachFeatureAtPixel(c.pixel,function(h,j){return h});xxmap.contextmenu.clear();if(e){var d=e.getId();if(d){addContextMenuItems(e)}else{var g=getCorrespondingFeature(e);if(g){addContextMenuItems(g)}else{xxmap.contextmenu.extend(contextmenu_items)}}}else{xxmap.contextmenu.extend(contextmenu_items)}});if(xxmap.contextmenu==null){xxmap.contextmenu=a}xxmap.map.addControl(xxmap.contextmenu)}catch(b){console.log(b);QV("viewselectmapoption",false);QV("devViewButton4",false);xxmap=null}}function addFeature(g,c,e){var a=getModifiedFeature(g._id);if(a){xxmap.markersSource.addFeature(a)}else{if(!c&&!e){var d=map_parseNodeLoc(g);c=d[0];e=d[1]}if(e>180){e=180-e;meshserver.send({action:"changedevice",nodeid:g._id,userloc:[c,e]})}if((c<90)&&(c>-90)&&(e<180)&&(e>-180)){var b=new ol.Feature({geometry:new ol.geom.Point(ol.proj.transform([e,c],"EPSG:4326","EPSG:3857")),name:g.name,status:g.conn,lat:c,lon:e});b.setId(g._id);b.setStyle(markerStyle(g));xxmap.markersSource.addFeature(b)}}}function removeFeature(b){var a=xxmap.markersSource.getFeatureById(b._id);if(a){xxmap.markersSource.removeFeature(a)}}function updateFeature(g,a){if(g.conn!=a.get("status")){a.set("status",g.conn);a.setStyle(markerStyle(g))}var c=map_parseNodeLoc(g);if(c!=null){var b=c[0],d=c[1];if((b!=a.get("lat"))||(d!=a.get("lon"))){a.set("lat",b);a.set("lon",d);var e=ol.proj.transform([parseFloat(d),parseFloat(b)],"EPSG:4326","EPSG:3857");a.getGeometry().setCoordinates(e)}}if(g.name!=a.get("name")){a.set("name",g.name)}}function modifyMarkerloc(c){var b=c.getId();if(b){c.setStyle(markerStyle(getNodeFromId(c.a),4));if(!getActiveInteractions(c)){var a=new ol.interaction.Modify({features:new ol.Collection([c]),pixelTolerance:10});xxmap.activeInteractions.push({featureid:b,feature:c,interaction:a});xxmap.map.addInteraction(a)}}}function saveMarkerloc(d){var c=d.getId();if(c){var a=getActiveInteractions(d);if(a){xxmap.map.removeInteraction(a);removeInteraction(c);var b=d.getGeometry().getCoordinates();var e=ol.proj.transform(b,"EPSG:3857","EPSG:4326");if(e[0]>180){e[0]=180-e[0]}var g=[e[1],e[0]];meshserver.send({action:"changedevice",nodeid:c,userloc:g})}}}function markerStyle(b,d){if(d==null){d=0;if(b.iploc){d=1}if(b.wifiloc){d=2}if(b.gpsloc){d=3}if(b.userloc){d=4}}var e=["","-ip","-wifi","-gps","-user"];var a=connStateColor(b);var c=new ol.style.Style({image:new ol.style.Icon({color:a,anchor:[0.5,1],src:"images/mapmarker"+e[d]+".png"})});return[c]}function connStateColor(a){if(a.conn==1||a.conn==3||a.conn==5){return"#00ffdd"}return"#C70039"}function addContextMenuItems(a){if(getActiveInteractions(a)){map_cm_saveMarker.data=a;xxmap.contextmenu.push(map_cm_saveMarker)}else{map_cm_editMarker.data=a;xxmap.contextmenu.push(map_cm_editMarker);var b=getNodeFromId(a.a);if(b.userloc){map_cm_clearMarker.data=a;xxmap.contextmenu.push(map_cm_clearMarker)}}map_cm_nodemenu_items.forEach(function(c){if(c.text=="Zoom-in to extent"||c.text=="Zoom-out to extent"){c.data=a}else{if(c!="-"){c.data=a.getId()}}});xxmap.contextmenu.extend(map_cm_nodemenu_items)}function getActiveInteractions(b){var a=b.getId();for(var c=0;c<xxmap.activeInteractions.length;c++){if(xxmap.activeInteractions[c].featureid==a){return xxmap.activeInteractions[c].interaction}}return false}function getModifiedFeature(a){if(a){for(var b=0;b<xxmap.activeInteractions.length;b++){if(xxmap.activeInteractions[b].featureid==a){return xxmap.activeInteractions[b].feature}}}return null}function removeInteraction(a){var c=-1;for(var b=0;b<xxmap.activeInteractions.length;b++){if(xxmap.activeInteractions[b].featureid===a){c=b;break}}if(c>=0){xxmap.activeInteractions.splice(c,1)}}function getCorrespondingFeature(e){var d=e.getGeometry().getCoordinates();for(var b=0;b<xxmap.activeInteractions.length;b++){var c=xxmap.activeInteractions[b].feature;var a=c.getGeometry().getCoordinates();if(a[0].toFixed(5)==d[0].toFixed(5)&&a[1].toFixed(5)==d[1].toFixed(5)){return c}}return null}function refreshMap(k,h){if(k){xxmap.map.setTarget(null);xxmap.map=null;xxmap.markersSource=null;xxmap.mapView=null;xxmap.mapLayer=null;xxmap.activeInteractions=[]}var a=updateMapMarkers();if((a!=null)&&(h||(a[4]==1))){var b=(a[0]+a[2])/2;var c=(a[1]+a[3])/2;var d=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]));var l=xxmap.map.getView();l.setCenter(ol.proj.transform([c,b],"EPSG:4326","EPSG:3857"));var e=360,g=-2;while(e>d){g++;e=e/2}l.setZoom(g)}}function placeNode(a){if(xxdialogMode){return}var c='<div style=margin-bottom:6px><label for=selectnode-search>Search</label>  <input type=text placeholder="Device name" id="selectnode-search" onchange=onPlaceNodeInputChange() onkeyup=onPlaceNodeInputChange() autocomplete=off style=width:120px></div><div id=placenode style="height:254px;overflow-y:auto;width:100%;margin:12px 1px 4px 1px;"><div id=noNodesMapPlace style=text-align:center;width:100%;display:none>No devices found.</div>';for(var b in nodes){c+="<div class=noselect id="+nodes[b]._id+"-rowid onclick=selectNodeToPlace(event,'"+nodes[b]._id+"') style=background-color:lightgray;margin-bottom:4px;border-radius:2px><input name=PlaceMapDeviceCheckbox id="+nodes[b]._id+"-checkid type=checkbox style=width:16px;display:inline />";c+="<div class=j"+nodes[b].icon+" style=width:16px;height:16px;margin-top:2px;margin-right:4px;display:inline-block></div><div style=width:16px;display:inline>"+nodes[b].name+"</div></div>"}setDialogMode(2,"Select a node to place",3,placeNodeEx,c+"</div>",a);onPlaceNodeInputChange()}function placeNodeEx(b,c){var d=document.getElementsByName("PlaceMapDeviceCheckbox");for(var g in d){if(d[g].checked){var h=getNodeFromId(d[g].id.substring(0,d[g].id.length-8));if(h){var e=xxmap.markersSource.getFeatureById(g);var j=ol.proj.transform(c,"EPSG:3857","EPSG:4326");var k=[j[1],j[0]];if(e){e.getGeometry().setCoordinates(c);var a=getActiveInteractions(e);if(a){saveMarkerloc(e)}else{meshserver.send({action:"changedevice",nodeid:h._id,userloc:k})}}else{meshserver.send({action:"changedevice",nodeid:h._id,userloc:k})}}}}}function onPlaceNodeInputChange(){updatePlaceNodeTable(Q("selectnode-search").value.trim().toLowerCase())}function updatePlaceNodeTable(d){var b=document.getElementsByName("PlaceMapDeviceCheckbox"),a=0;for(var c in nodes){var e=((nodes[c].namel.indexOf(d)>=0||d=="")||(nodes[c].rnamel!=null&&nodes[c].rnamel.indexOf(d)>=0));if(e){a++}QV(nodes[c]._id+"-rowid",e)}QV("noNodesMapPlace",a==0)}function selectNodeToPlace(b,g){if(b.target.name!="PlaceMapDeviceCheckbox"){var h=Q(g+"-checkid");h.checked=!h.checked}var c=document.getElementsByName("PlaceMapDeviceCheckbox"),a=0;for(var d in c){if(c[d].checked){a++}}QE("idx_dlgOkButton",a>0)}function addMeshOptions(a,b){}function meshOptionRmvMod(a,b){}function meshExists(){for(var a in meshes){if(meshes[a]){return true}}return false}function setMeshView(a){var c=Q("select-mesh");var b=c.selectedIndex;if(c[b].value==a){c[0].selected=true;onSelectMeshChange()}}function clearMeshOptions(){}function getSearchLocation(){try{var b=Q("mapSearchLocation").value.trim();if(b.length>0){var c=new XMLHttpRequest();c.onreadystatechange=function(){if(c.readyState==4&&c.status==200){formatSearchData(c.responseText)}};c.open("GET","https://nominatim.openstreetmap.org/search?q="+b+"&format=json",true);c.send()}}catch(a){}}function formatSearchData(c){try{QH("xmapSearchResults","");var d=JSON.parse(c),b=0,k='<div style="overflow-y:auto;width:100%;max-height:240px">';for(var j=0;j<d.length;j++){if(d[j].display_name&&d[j].boundingbox[0]&&d[j].boundingbox[1]&&d[j].boundingbox[2]&&d[j].boundingbox[3]){b++;var a=(j%2==0)?"F5F5F5":"EBEBEB";k+="<div style=cursor:pointer;padding:5px;background-color:#"+a+" onclick=mapGotoSelectedLocation(this)><div>"+d[j].display_name+"</div><div style=display:none>"+d[j].boundingbox[0]+"!#!"+d[j].boundingbox[1]+"!#!"+d[j].boundingbox[2]+"!#!"+d[j].boundingbox[3]+"</div></div>"}}k+="</div>";if(b==1){var h=[parseFloat(d[0].boundingbox[2]),parseFloat(d[0].boundingbox[0]),parseFloat(d[0].boundingbox[3]),parseFloat(d[0].boundingbox[1])];zoomToExtent(h)}else{if(b==0){k="<div style=width:200px>No location found.<div>"}QV("xmapSearchResultsDlg",true)}QH("xmapSearchResults",k)}catch(g){}}function mapGotoSelectedLocation(c){var d=c.children;var a=d[1].innerHTML.split("!#!");var b=[parseFloat(a[2]),parseFloat(a[0]),parseFloat(a[3]),parseFloat(a[1])];zoomToExtent(b);mapCloseSearchWindow()}function mapCloseSearchWindow(){QH("xmapSearchResults","");QV("xmapSearchResultsDlg",false)}function zoomToLocation(a,c){var b=xxmap.map.getView();b.setCenter(a);b.setZoom(c)}function zoomToFitExtent(){var b=xxmap.markersSource.getFeatures();if(b.length>0){var a=xxmap.markersSource.getExtent();xxmap.map.getView().fit(a,xxmap.map.getSize())}}function zoomToExtent(b){var a=ol.proj.transformExtent(b,ol.proj.get("EPSG:4326"),ol.proj.get("EPSG:3857"));xxmap.map.getView().fit(a,xxmap.map.getSize())}function refreshDevice(a){if(!currentNode||currentNode._id!=a){return}gotoDevice(a,xxcurrentView,true)}function getNodeRights(c){var b=getNodeFromId(c),a=meshes[b.meshid];return a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights}var currentNode;var powerTimelineNode=null;var powerTimelineReq=null;var powerTimelineUpdate=null;var powerTimeline=null;function getCurrentNode(){return currentNode}function gotoDevice(p,r,u,h){if((userinfo.emailVerified!==true)&&(serverinfo.emailcheck==true)&&(userinfo.siteadmin!=4294967295)){setDialogMode(2,"New Device Group",1,null,'Unable to create a new device group until a email address is verified. This is required for password recovery. Go to the "My Account" tab to change and verify an email address.');return}if(h&&(h.shiftKey==true)){window.open(window.location.origin+"?node="+p.split("/")[2]+"&viewmode=10&hide=16","meshcentral:"+p);return}var o=getNodeFromId(p);var l=meshes[o.meshid];var m=l.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if(!currentNode||currentNode._id!=o._id||u==true){currentNode=o;var n=EscapeHtml(o.name);if(n.length==0){n="<i>None</i>"}if((m&4)!=0){n='<span title="Click here to edit the server-side device name" onclick=showEditNodeValueDialog(0) style=cursor:pointer>'+n+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>'}QH("p10deviceName",n);QH("p11deviceName",n);QH("p12deviceName",n);QH("p13deviceName",n);QH("p14deviceName",n);QH("p15deviceName","Console - "+n);QH("p16deviceName",n);var y="<table style=width:100%>";y+=addDeviceAttribute('<span title="The name of the device group this computer belong to.">Group</span>','<a title="The name of the device group this computer belong to" onclick=gotoMesh("'+o.meshid+'") style=cursor:pointer>'+EscapeHtml(meshes[o.meshid].name)+"</a>");if((o.rname!=null)&&(o.name!=o.rname)){y+=addDeviceAttribute('<span title="The name of this computer as set in the operating system">Name</span>','<span title="The name of this computer as set in the operating system">'+EscapeHtml(o.rname)+"</span>")}if((features&1)==0){if((m&4)!=0){if(o.host){y+=addDeviceAttribute("Hostname","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer>"+EscapeHtml(o.host)+"</span>")}else{y+=addDeviceAttribute("Hostname","<span onclick=showEditNodeValueDialog(1) style=cursor:pointer><i>None</i></span>")}}else{y+=addDeviceAttribute("Hostname",EscapeHtml(o.host))}}var g=o.desc?EscapeHtml(o.desc):"<i>None</i>";if((m&4)!=0){y+=addDeviceAttribute("Description","<span onclick=showEditNodeValueDialog(2) style=cursor:pointer>"+g+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>')}else{y+=addDeviceAttribute("Description",g)}var a=["Unknown","Windows 32bit console","Windows 64bit console","Windows 32bit service","Windows 64bit service","Linux 32bit","Linux 64bit","MIPS","XENx86","Android ARM","Linux ARM","OSX 32bit","Android x86","PogoPlug ARM","Android APK","Linux Poky x86-32bit","OSX 64bit","ChromeOS","Linux Poky x86-64bit","Linux NoKVM x86-32bit","Linux NoKVM x86-64bit","Windows MinCore console","Windows MinCore service","NodeJS","ARM-Linaro","ARMv6l / ARMv7l"];if((o.agent!=null)&&(o.agent.id!=null)&&(o.agent.ver!=null)){var v="";if(o.agent.id<=a.length){v=a[o.agent.id]}else{v=a[0]}if(o.agent.ver!=0){v+=" v"+o.agent.ver}y+=addDeviceAttribute("Mesh Agent",v)}if(o.intelamt!=null){var v="";var t={0:"Not Activated (Pre)",1:"Not Activated (In)",2:"Activated"};if(o.intelamt.ver!=null&&o.intelamt.state==null){v+="<i>Unknown State</i>, v"+o.intelamt.ver}else{if((o.intelamt.ver==null)&&(o.intelamt.state==2)){v+="<i>Activated</i>"}else{if((o.intelamt.ver==null)||(o.intelamt.state==null)){v+="<i>Unknown Version & State</i>"}else{v+=t[o.intelamt.state];if(o.intelamt.flags){if(o.intelamt.flags&2){v+=' <span title="Intel AMT is activated in Client Control Mode">CCM</span>'}else{if(o.intelamt.flags&4){v+=' <span title="Intel AMT is activated in Admin Control Mode">ACM</span>'}}}v+=(", v"+o.intelamt.ver)}}}if(o.intelamt.tls==1){v+=', <span title="Intel AMT is setup with TLS network security">TLS</span>'}if(o.intelamt.state==2){if(o.intelamt.user==null||o.intelamt.user==""){if((m&4)!=0){v+=', <i style=color:#FF0000;cursor:pointer title="Edit Intel® AMT credentials" onclick=editDeviceAmtSettings("'+o._id+'")>No Credentials</i>'}else{v+=", <i style=color:#FF0000>No Credentials</i>"}}v+=" ";if((m&4)!=0){v+='<img src=images/link4.png height=10 width=10 title="Edit Intel® AMT credentials" style=cursor:pointer onclick=editDeviceAmtSettings("'+o._id+'")>'}}y+=addDeviceAttribute("Intel® AMT",v)}if((o.agent!=null)&&(o.agent.tag!=null)&&(o.agent.tag!="mailto:")){var w=EscapeHtml(o.agent.tag);if(w.startsWith("mailto:")){w='<a href="'+w+'">'+w.substring(7)+"</a>"}y+=addDeviceAttribute("Agent Tag",w)}if(o.osdesc){y+=addDeviceAttribute("Operating System",o.osdesc)}if(o.users&&o.conn&&(o.users.length>0)&&(o.conn&1)){y+=addDeviceAttribute("Active User"+((o.users.length>1)?"s":""),o.users.join(", "))}var c=o.conn;if(c&&c>1){var e=[];if((o.conn&1)!=0){e.push('<span title="Mesh agent is connected and ready for use.">Mesh Agent</span>')}if((o.conn&2)!=0){e.push('<span title="Intel® AMT CIRA is connected and ready for use.">Intel® AMT CIRA</span>')}if((o.conn&4)!=0){e.push('<span title="Intel® AMT is routable and ready for use.">Intel® AMT</span>')}if((o.conn&8)!=0){e.push('<span title="Mesh agent is reachable using another agent as relay.">Mesh Relay</span>')}y+=addDeviceAttribute("Connectivity",e.join(", "))}var j="<i>None</i>";if(o.tags!=null){j="";for(var k in o.tags){j+='<span style="background-color:lightgray;padding:3px;margin-right:4px;border-radius:5px">'+o.tags[k]+"</span>"}}y+=addDeviceAttribute("Tags","<span onclick=showEditNodeValueDialog(3) style=cursor:pointer>"+j+' <img class=hoverButton width=10 height=10 src="images/link5.png" /></span>');y+="</table><br />";if((m&76)!=0){y+='<input type=button value=Actions title="Perform power actions on the device" onclick=deviceActionFunction() />'}y+='<input type=button value=Notes title="View notes about this device" onclick=showNotes('+((m&128)==0)+',"'+encodeURIComponent(o._id)+'") />';QH("p10html",y);masterUpdate(256);y="<div style=float:right;font-size:x-small>";if((m&4)!=0){y+=' <a style=cursor:pointer onclick=p10showChangeGroupDialog(["'+o._id+'"]) title="Move this device to a different device group">Change Group</a>';y+=' <a style=cursor:pointer onclick=p10showDeleteNodeDialog("'+o._id+'") title="Remove this device">Delete Device</a>'}y+="</div><div style=font-size:x-small>";if(l.mtype==2){y+='<a style=cursor:pointer onclick=p10showNodeNetInfoDialog("'+o._id+'") title="Show device network interface information">Interfaces</a> '}if(xxmap!=null){y+='<a style=cursor:pointer onclick=p10showNodeLocationDialog("'+o._id+'") title="Show device locations information">Location</a> '}if(((m&8)!=0)&&(l.mtype==2)){y+='<a style=cursor:pointer onclick=p10showMeshCmdDialog(1,"'+o._id+'") title="Traffic router used to connect to a device thru this server.">Router</a> '}if(((c&1)!=0)&&(clickOnce==true)&&(l.mtype==2)&&((m&8)!=0)){if((o.agent.id>0)&&(o.agent.id<5)){y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","RDP2",3389) title="Requires Microsoft ClickOnce support in your browser.">RDP</a> '}if(o.agent.id>4){y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","PSSH",22) title="Requires Microsoft ClickOnce support in your browser.">Putty</a> ';y+='<a style=cursor:pointer onclick=p10clickOnce("'+o._id+'","WSCP",22) title="Requires Microsoft ClickOnce support in your browser.">WinSCP</a> '}}y+="</div><br>";QH("p10html3",y);var s=PowerStateStr(o.state);if((c&1)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Agent connected">Agent connected</span>'}if((c&2)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Intel® AMT connected">Intel® AMT connected</span>'}if((c&4)!=0){if(s.length>0){s+="<br/>"}s+='<span style=font-size:12px title="Intel® AMT detected">Intel® AMT detected</span>'}if((s=="")&&o.lastconnect){s="<span style=font-size:12px>Last seen:<br />"+new Date(o.lastconnect).toLocaleDateString()+", "+new Date(o.lastconnect).toLocaleTimeString()+"</span>"}QH("MainComputerState",s);Q("MainComputerImage").setAttribute("src","images/icons200-"+o.icon+"-1.jpg");Q("MainComputerImage").className=((!o.conn)||(o.conn==0)?"gray":"");setupTerminal();setupFiles();var d=((m&16)!=0);if(d){setupConsole()}else{if(r==15){r=10}}QV("MainDevDesktop",((l.mtype==1)||(o.agent==null)||(o.agent.caps==null)||((o.agent.caps&1)!=0)||(o.intelamt&&(o.intelamt.state==2)))&&((m&8)||(m&256)));QV("MainDevTerminal",((l.mtype==1)||(o.agent==null)||(o.agent.caps==null)||((o.agent.caps&2)!=0)||(o.intelamt&&(o.intelamt.state==2)))&&(m&8));QV("MainDevFiles",((l.mtype==2)&&((o.agent==null)||(o.agent.caps==null)||((o.agent.caps&4)!=0)))&&(m&8));QV("MainDevAmt",(o.intelamt!=null)&&((o.intelamt.state==2)||(o.conn&2))&&(m&8));QV("MainDevConsole",(d&&(l.mtype==2)&&((o.agent==null)||(o.agent.caps==null)||((o.agent.caps&8)!=0)))&&(m&8));QV("p15uploadCore",(o.agent!=null)&&(o.agent.caps!=null)&&((o.agent.caps&16)!=0));QH("p15coreName",((o.agent!=null)&&(o.agent.core!=null))?o.agent.core:"");var b=Q("p14iframe").contentWindow.getCurrentMeshNode();if((b!=null)&&(b._id!=currentNode._id)){Q("p14iframe").contentWindow.disconnect()}var q=((o.conn&6)!=0)?true:false;Q("p14iframe").contentWindow.setConnectionState(q);Q("p14iframe").contentWindow.setFrameHeight("650px");Q("p14iframe").contentWindow.setAuthCallback(updateAmtCredentials);QV("deskActionsBtn",(m&72)!=0);QV("termActionsBtn",(m&72)!=0);QV("filesActionsBtn",(m&72)!=0);if((powerTimelineNode!=currentNode._id)&&(powerTimelineReq!=currentNode._id)){QH("p10html2","");powerTimelineReq=currentNode._id;meshserver.send({action:"powertimeline",nodeid:currentNode._id});meshserver.send({action:"lastconnect",nodeid:currentNode._id})}QV("DeskTools",false);showDeskToolsProcesses();refreshDeviceEvents();if((currentNode)&&(xxcurrentView>=10)&&(xxcurrentView<20)){document.title="MeshCentral - "+currentNode.name}else{document.title="MeshCentral"}}setupDesktop();if(!r){r=10}go(r)}function showNotes(b,a){if(xxdialogMode){return}setDialogMode(2,"Notes",2,showNotesEx,"<textarea id=d2devNotes ro="+b+" noteid="+a+" readonly style=background-color:#fcf3cf;width:100%;height:200px;resize:none;overflow-y:scroll></textarea><span style=font-size:10px>Notes can be viewed and changed by other administrators.<span>",a);meshserver.send({action:"getNotes",id:decodeURIComponent(a)})}function showNotesEx(a,b){meshserver.send({action:"setNotes",id:decodeURIComponent(b),notes:encodeURIComponent(Q("d2devNotes").value)})}function deviceChat(){if(xxdialogMode){return}var a="/messenger?id=meshmessenger/"+encodeURIComponent(currentNode._id)+"/"+encodeURIComponent(userinfo._id)+"&title="+currentNode.name;if((authCookie!=null)&&(authCookie!="")){a+="&auth="+authCookie}window.open(a,"meshmessenger:"+currentNode._id);meshserver.send({action:"meshmessenger",nodeid:decodeURIComponent(currentNode._id)})}function deviceUrlFunction(){if(xxdialogMode){return}setDialogMode(2,"Open Page on Device",3,deviceUrlFunctionEx,'<input id=d2devurl placeholder="http://server.com" style=width:100%;overflow-y:scroll></input>')}function deviceUrlFunctionEx(){meshserver.send({action:"msg",type:"openUrl",nodeid:currentNode._id,url:Q("d2devurl").value})}function deviceToastFunction(){if(xxdialogMode){return}setDialogMode(2,"Device Notification",3,deviceToastFunctionEx,"<textarea id=d2devToast style=width:100%;height:80px;resize:none;overflow-y:scroll></textarea>")}function deviceToastFunctionEx(){meshserver.send({action:"toast",nodeids:[currentNode._id],title:"MeshCentral",msg:Q("d2devToast").value})}function deviceActionFunction(){if(xxdialogMode){return}var a=meshes[currentNode.meshid].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;var b="Select an operation to perform on this device.<br /><br />";var c="<select id=d2deviceop style=float:right;width:250px>";if((a&64)!=0){c+="<option value=100>Wake-up</option>"}if((a&8)!=0){c+="<option value=4>Sleep</option><option value=3>Reset</option><option value=2>Power off</option>"}c+="</select>";b+=addHtmlValue("Operation",c);setDialogMode(2,"Device Action",3,deviceActionFunctionEx,b)}function deviceActionFunctionEx(){var a=Q("d2deviceop").value;if(a==100){meshserver.send({action:"wakedevices",nodeids:[currentNode._id]})}else{meshserver.send({action:"poweraction",nodeids:[currentNode._id],actiontype:a})}}function updateAmtCredentials(a){var b=getNodeFromId(currentNode._id);if((a==true)||(b.intelamt.user==null)||(b.intelamt.user=="")){editDeviceAmtSettings(currentNode._id,updateAmtCredentialsEx)}else{Q("p14iframe").contentWindow.connectButtonfunctionEx()}}function updateAmtCredentialsEx(a,b){Q("p14iframe").contentWindow.connectButtonfunctionEx()}function updateDeviceTimeline(){if((meshserver.State!=2)||(powerTimelineNode==null)||(powerTimelineUpdate==null)||(currentNode==null)){return}if((powerTimelineNode==powerTimelineReq)&&(currentNode._id==powerTimelineNode)&&(powerTimelineUpdate<Date.now())){powerTimelineUpdate=null;meshserver.send({action:"powertimeline",nodeid:currentNode._id});meshserver.send({action:"lastconnect",nodeid:currentNode._id})}}function drawDeviceTimeline(){if((currentNode==null)||(xxcurrentView<10)||(xxcurrentView>19)){return}var s=null,o=Date.now();if(currentNode._id==powerTimelineNode){s=powerTimeline}var e=new Date();e.setHours(0,0,0,0);e=new Date(e.getTime()-(1000*60*60*24*6));var u=e.getTime();var t=[];if(s!=null&&s.length>1){t.push([0,s[1],s[0]]);var c=s[1];for(var m=2;m<s.length;m+=2){var p=s[m],k=o;if(s.length>(m+1)){k=s[m+1]}t.push([c,c+k,p]);c=c+k}}var A="",b=1,h=new Date();var w=Q("masthead").offsetWidth-(160+9+9+14);h.setHours(0,0,0,0);for(var m=0;m<7;m++){var g="",q=h.getTime(),l=q+(1000*60*60*24);for(var n in t){var a=t[n];if(isTimeBlockInside(q,l,a[0],a[1])==true){var y=Math.max(q,a[0]);var r=Math.min(Math.min(l,a[1]),o);var z=Math.round(((r-y)*w)/86400000);if(z>0){var v=powerStateStrings2[a[2]]+" from "+new Date(y).toLocaleTimeString()+" to "+new Date(r).toLocaleTimeString()+".";g+='<div title="'+v+'" style=display:table-cell;width:'+z+"px;background-color:"+powerColor(a[2])+";height:16px></div>"}}}A+="<tr style="+(((b%2)==0)?"background-color:#DDD":"")+"><td><div> "+h.toLocaleDateString()+"<div></div></div></td><td><div>"+g+"</div></td></tr>";++b;h=new Date(h.getTime()-(1000*60*60*24))}QH("p10html2",'<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center>7 Day Power State</th></tr>'+A+"</tbody></table>")}function powerColor(a){if(a<powerColorTable.length){return powerColorTable[a]}return"yellow"}function isTimeBlockInside(d,c,b,a){if((b<d)&&(a>c)){return true}if((b>d)&&(b<c)){return true}if((a>d)&&(a<c)){return true}return false}function addDeviceAttribute(a,b){return"<tr><td class=style7 style=width:180px>"+a+"</td><td class=style9 style=max-width:400px;overflow:hidden>"+b+"</td></tr>"}function editDeviceAmtSettings(e,b){if(xxdialogMode){return}var g="",d=getNodeFromId(e),a=3,c=getNodeRights(e);if((c&4)==0){return}g+=addHtmlValue("Username",'<input id=dp10username style=width:230px maxlength=32 autocomplete=nope placeholder="admin" onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />');g+=addHtmlValue("Password","<input id=dp10password type=password style=width:230px autocomplete=nope maxlength=32 onchange=validateDeviceAmtSettings() onkeyup=validateDeviceAmtSettings() />");g+=addHtmlValue("Security","<select id=dp10tls style=width:236px><option value=0>No TLS security</option><option value=1>TLS security required</option></select>");if((d.intelamt.user!=null)&&(d.intelamt.user!="")){a=7}setDialogMode(2,"Edit Intel® AMT credentials",a,editDeviceAmtSettingsEx,g,{node:d,func:b});if((d.intelamt.user!=null)&&(d.intelamt.user!="")){Q("dp10username").value=d.intelamt.user}else{Q("dp10username").value="admin"}Q("dp10tls").value=d.intelamt.tls;validateDeviceAmtSettings()}function validateDeviceAmtSettings(){QE("idx_dlgOkButton",passwordcheck(Q("dp10password").value))}function editDeviceAmtSettingsEx(c,d){if(c==2){meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:"",pass:""}})}else{var b=Q("dp10username").value;if(b==""){b="admin"}var a=Q("dp10password").value;if(a==""){b=""}meshserver.send({action:"changedevice",nodeid:d.node._id,intelamt:{user:b,pass:a,tls:Q("dp10tls").value}});d.node.intelamt.user=b;d.node.intelamt.tls=Q("dp10tls").value;if(d.func){setTimeout(d.func,300)}}}function p10showChangeGroupDialog(e){if(xxdialogMode){return}var g=null;if(e.length==1){try{g=meshes[getNodeFromId(e[0])]._id}catch(b){}}var j="<select id=p10newGroup style=width:236px>",a=0;for(var c in meshes){var d=meshes[c].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((meshes[c]._id!=g)&&(d&4)){a++;j+="<option value='"+meshes[c]._id+"'>"+meshes[c].name+"</option>"}}j+="</select>";if(a>0){var h=(e.length==1)?"Select a new group for this device<br /><br />":"Select a new group for selected devices<br /><br />";h+=addHtmlValue("New Device Group",j);setDialogMode(2,"Change Group",3,p10showChangeGroupDialogEx,h,e)}else{setDialogMode(2,"Change Group",1,null,"No other device group of same type exists.")}}function p10showChangeGroupDialogEx(a,c){meshserver.send({action:"changeDeviceMesh",nodeids:c,meshid:Q("p10newGroup").value})}function p10showDeleteNodeDialog(a){if(xxdialogMode){return}var b='Are you sure you want to delete node "'+EscapeHtml(currentNode.name)+'"?<br /><br />';b+="<label><input id=p10check type=checkbox onchange=p10validateDeleteNodeDialog() />Confirm</label>";setDialogMode(2,"Delete Node",3,p10showDeleteNodeDialogEx,b,a);p10validateDeleteNodeDialog()}function p10validateDeleteNodeDialog(){QE("idx_dlgOkButton",Q("p10check").checked)}function p10showDeleteNodeDialogEx(a,b){meshserver.send({action:"removedevices",nodeids:[b]})}function p10clickOnce(a,c,b){meshserver.send({action:"getcookie",nodeid:a,tcpport:b,tag:"clickonce",protocol:c})}var d2map=null;function p10showNodeLocationDialog(){if((xxdialogMode!=null)&&(xxdialogTag=="@xxmap")){setDialogMode(0)}else{if(xxdialogMode){return}}var m=[],n=["iploc","wifiloc","gpsloc","userloc"],a=null;for(var k in n){if(currentNode[n[k]]!=null){var j=currentNode[n[k]].split(","),h=parseFloat(j[0]),l=parseFloat(j[1]);if((h<90)&&(h>-90)&&(l<180)&&(l>-180)){var e=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([l,h]))});e.setStyle(markerStyle(currentNode,parseInt(k)+1));m.push(e);if(a==null){a=[h,l,h,l,0]}else{if(h<a[0]){a[0]=h}if(l<a[1]){a[1]=l}if(h>a[2]){a[2]=h}if(l>a[3]){a[3]=l}}}}}var p=new ol.source.Vector({features:m});var o=new ol.layer.Vector({source:p});var q="<div id=d2map style=width:100%;height:300px></div>";setDialogMode(2,"Device Location",1,null,q,"@xxmap");var c=0,b=0,r=8;if(a!=null){var b=(a[0]+a[2])/2;var c=(a[1]+a[3])/2;var d=Math.max(Math.abs(a[0]-a[2]),Math.abs(a[1]-a[3]));var g=360,r=-2;while(g>d){r++;g=g/2}}if(m.length==1){r=8}d2map=new ol.Map({target:"d2map",interactions:ol.interaction.defaults({dragPan:false,mouseWheelZoom:false}),layers:[new ol.layer.Tile({source:new ol.source.OSM()}),o],view:new ol.View({center:ol.proj.fromLonLat([c,b]),zoom:r})})}function p10showNodeNetInfoDialog(){if(xxdialogMode){return}setDialogMode(2,"Network Interfaces",1,null,"<div id=d2netinfo>Loading...</div>","if"+currentNode._id);meshserver.send({action:"getnetworkinfo",nodeid:currentNode._id})}function p10showMeshCmdDialog(a,b){if(xxdialogMode){return}var d="<select id=aginsSelect onclick=meshCmdOsClick() style=width:236px>";d+="<option value=3>Windows (32bit)</option>";d+="<option value=4>Windows (64bit)</option>";d+="<option value=5>Linux x86 (32bit)</option>";d+="<option value=6>Linux x86 (64bit)</option>";d+="<option value=25>Linux ARM, Raspberry Pi (32bit)</option>";d+="</select>";var c="";if(a==0){c+="<div>MeshCmd is a command line tool that performs lots of different operations. The action file can optionally be downloaded and edited to provide server information and credentials.<br /><br />"}if(a==1){c+='<div>Download "meshcmd" with an action file to route traffic thru this server to this device. Make sure to edit meshaction.txt and add your account password or make any changes needed.<br /><br />'}c+=addHtmlValue("Operating System",d);c+=addHtmlValue("MeshCmd",'<a id=meshcmddownloadid style=cursor:pointer onclick=fileDownload("meshagents?meshcmd=","MeshCmd",2)></a>');if(a==0){c+=addHtmlValue("Action File",'<a style=cursor:pointer onclick=fileDownload("meshagents?meshaction=generic","MeshAction.txt")>MeshAction (.txt)</a>')}if(a==1){c+=addHtmlValue("Action File",'<a style=cursor:pointer onclick=fileDownload("meshagents?meshaction=route&nodeid='+b+'","MeshAction.txt")>MeshAction (.txt)</a>')}c+="</div>";setDialogMode(2,["Download MeshCmd","Network Router"][a],9,null,c,"fileDownload");meshCmdOsClick()}function meshCmdOsClick(){var a=Q("aginsSelect").value,b="";if(a==3){b="MeshCmd (Win32 executable)"}if(a==4){b="MeshCmd (Win64 executable)"}if(a==5){b="MeshCmd (Linux x86, 32bit)"}if(a==6){b="MeshCmd (Linux x86, 64bit)"}if(a==25){b="MeshCmd (Linux ARM, 32bit)"}QH("meshcmddownloadid",b)}function p10showiconselector(){if(xxdialogMode){return}var a=meshes[currentNode.meshid];var b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&4)==0){return}var c="<br><div style=display:inline-block;width:40px></div>";c+="<div style=display:inline-block class=i1 onclick=p10setIcon(1)></div>";c+="<div style=display:inline-block class=i2 onclick=p10setIcon(2)></div>";c+="<div style=display:inline-block class=i3 onclick=p10setIcon(3)></div>";c+="<div style=display:inline-block class=i4 onclick=p10setIcon(4)></div>";c+="<div style=display:inline-block class=i5 onclick=p10setIcon(5)></div>";c+="<div style=display:inline-block class=i6 onclick=p10setIcon(6)></div><br><br>";setDialogMode(2,"Icon Selection",0,null,c);QV("id_dialogclose",true)}function p10setIcon(a){setDialogMode(0);meshserver.send({action:"changedevice",nodeid:currentNode._id,icon:a})}var showEditNodeValueDialog_modes=["Device Name","Hostname","Description","Tags"];var showEditNodeValueDialog_modes2=["name","host","desc","tags"];var showEditNodeValueDialog_modes3=["","","","Tag1, Tag2, Tag3"];function showEditNodeValueDialog(a){if(xxdialogMode){return}var c=addHtmlValue(showEditNodeValueDialog_modes[a],'<input id=dp10devicevalue style=width:230px maxlength=64 placeholder="'+showEditNodeValueDialog_modes3[a]+'" onchange=p10editdevicevalueValidate('+a+",event) onkeyup=p10editdevicevalueValidate("+a+",event) />");setDialogMode(2,"Edit Device",3,showEditNodeValueDialogEx,c,a);var b=currentNode[showEditNodeValueDialog_modes2[a]];if(b==null){b=""}if(Array.isArray(b)){b=b.join(", ")}Q("dp10devicevalue").value=b;p10editdevicevalueValidate();Q("dp10devicevalue").focus()}function showEditNodeValueDialogEx(a,b){var c={action:"changedevice",nodeid:currentNode._id};c[showEditNodeValueDialog_modes2[b]]=Q("dp10devicevalue").value;meshserver.send(c)}function p10editdevicevalueValidate(b,a){var c=((b>1)||(Q("dp10devicevalue").value.length>0));QE("idx_dlgOkButton",c);if((a!=null)&&(c==true)&&(a.keyCode==13)){dialogclose(1)}}var desktopNode;function setupDesktop(){if((desktopNode!=currentNode)&&(desktop!=null)){desktop.Stop();desktopNode=null;desktop=null}if((desktopNode!=currentNode)||(desktop==null)){var b=multiDesktop[currentNode._id];if(b!=null){QH("DeskParent","");var a=b.m.CanvasId;a.setAttribute("id","Desk");a.setAttribute("style","width:100%;-ms-touch-action:none;margin-left:0px");a.setAttribute("onmousedown","dmousedown(event)");a.setAttribute("onmouseup","dmouseup(event)");a.setAttribute("onmousemove","dmousemove(event)");a.removeAttribute("onclick");Q("DeskParent").appendChild(a);desktop=b;if(desktop.m.SendCompressionLevel){desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate)}desktop.onStateChanged=onDesktopStateChange;desktopNode=currentNode;onDesktopStateChange(desktop,desktop.State);delete multiDesktop[currentNode._id]}else{QH("DeskParent",'<canvas id=Desk width=640 height=480 style="width:100%;-ms-touch-action:none;margin-left:0px" oncontextmenu="return false" onmousedown=dmousedown(event) onmouseup=dmouseup(event) onmousemove=dmousemove(event)></canvas>');desktopNode=currentNode}Q("Desk").addEventListener("DOMMouseScroll",function(c){return dmousewheel(c)});Q("Desk").addEventListener("mousewheel",function(c){return dmousewheel(c)})}desktopNode=currentNode;updateDesktopButtons();deskAdjust();if(!Q("Desk")["toBlob"]){QV("deskSaveBtn",false)}}function updateDesktopButtons(){var c=meshes[currentNode.meshid];var a=0;if(desktop!=null){a=desktop.State}var d=c.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;QV("disconnectbutton1span",(a!=0));QV("connectbutton1span",(a==0)&&((d&8)||(d&256))&&(c.mtype==2)&&(currentNode.agent.caps&1));QV("connectbutton1hspan",(a==0)&&(d&8)&&((currentNode.intelamt!=null)&&(c.mtype==1||currentNode.intelamt.state==2)&&((currentNode.intelamt.ver!=null)||(c.mtype==1))));QV("d7amtkvm",(currentNode.intelamt!=null&&((currentNode.intelamt.ver!=null)||(c.mtype==1)))&&((a==0)||(desktop.contype==2)));QV("d7meshkvm",(webRtcDesktop)||((c.mtype==2)&&(currentNode.agent.caps&1)&&((a==false)||(desktop.contype==1))));var e=((currentNode.conn&1)!=0);QE("connectbutton1",e);var b=((currentNode.conn&6)!=0);QE("connectbutton1h",b);QE("deskSaveBtn",a==3);QV("deskFocusBtn",(desktop!=null)&&(desktop.contype==2)&&(a!=0)&&(desktopsettings.showfocus));QV("DeskCAD",d&8);QE("DeskCAD",a==3);QE("DeskClip",a==3);QV("DeskWD",(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8));QE("DeskWD",a==3);QV("deskkeys",(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8));QE("deskkeys",a==3);QV("DeskToolsButton",(d&8)&&(c.mtype==2)&&e);QV("DeskChatButton",(browserfullscreen==false)&&(d&8)&&(c.mtype==2)&&e);QV("DeskNotifyButton",(browserfullscreen==false)&&(currentNode.agent)&&(currentNode.agent.id<5)&&(d&8)&&(c.mtype==2)&&e);QV("DeskOpenWebButton",(browserfullscreen==false)&&(d&8)&&(c.mtype==2)&&e);QV("DeskControlSpan",d&8);QV("deskActionsBtn",(browserfullscreen==false));QV("deskActionsSettings",(browserfullscreen==false));if(d&8){Q("DeskControl").checked=(getstore("DeskControl",1)==1)}else{Q("DeskControl").checked=false}if(e==false){QV("DeskTools",false)}}var autoConnectDesktopTimer=null;function autoConnectDesktop(a){if(autoConnectDesktopTimer==null){autoConnectDesktopTimer=setInterval(connectDesktop,100)}else{clearInterval(autoConnectDesktopTimer);autoConnectDesktopTimer=null}}function connectDesktop(b,a){if(desktop==null){desktopNode=currentNode;if(a==2){if((desktopNode.intelamt.user==null)||(desktopNode.intelamt.user=="")){editDeviceAmtSettings(desktopNode._id,connectDesktop);return}desktop=CreateAmtRedirect(CreateAmtRemoteDesktop("Desk"),authCookie);desktop.debugmode=debugmode;desktop.onStateChanged=onDesktopStateChange;desktop.m.bpp=(desktopsettings.encoding==1||desktopsettings.encoding==3)?1:2;desktop.m.useZRLE=(desktopsettings.encoding<3);desktop.m.showmouse=desktopsettings.showmouse;desktop.m.onScreenSizeChange=deskAdjust;desktop.m.onKvmData=function(h){if(h.length==0){if(!desktop.m._sentPresence){desktop.m._sentPresence=true;desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))}return}var d=null;try{d=JSON.parse(h)}catch(g){}if((d!=null)&&(d.action!=null)){if(d.action=="restart"){webRtcDesktopReset();desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))}else{if((d.action=="present")&&(webRtcDesktop==null)){webRtcDesktop={platform:d.platform};var c=null;if(typeof RTCPeerConnection!=="undefined"){webRtcDesktop.webrtc=new RTCPeerConnection(c)}else{if(typeof webkitRTCPeerConnection!=="undefined"){webRtcDesktop.webrtc=new webkitRTCPeerConnection(c)}}webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{});webRtcDesktop.webchannel.onopen=function(){console.log("WebRTC Data Channel Open");Q("deskstatus").textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(true);webRtcDesktop.webRtcActive=true;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",Q("id_mainarea")),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);webRtcDesktop.softdesktop.m.onScreenSizeChange=deskAdjust;if(desktopsettings.quality){webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality}if(desktopsettings.scaling){webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling}webRtcDesktop.softdesktop.Start()};webRtcDesktop.webchannel.onclose=function(e){console.log("WebRTC Data Channel Closed");webRtcDesktopReset()};webRtcDesktop.webrtc.onicecandidate=function(j){if(j.candidate==null){desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp}))}else{webRtcDesktop.webrtcoffer.sdp+=("a="+j.candidate.candidate+"\r\n")}};webRtcDesktop.webrtc.oniceconnectionstatechange=function(){if((webRtcDesktop!=null)&&(webRtcDesktop.webrtc!=null)&&((webRtcDesktop.webrtc.iceConnectionState=="disconnected")||(webRtcDesktop.webrtc.iceConnectionState=="failed"))){webRtcDesktopReset()}};webRtcDesktop.webrtc.createOffer(function(e){webRtcDesktop.webrtcoffer=e;webRtcDesktop.webrtc.setLocalDescription(e,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:false,OfferToReceiveVideo:false}})}else{if((d.action=="answer")&&(webRtcDesktop!=null)){webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:d.sdp}),function(){},webRtcDesktopReset)}}}}};desktop.Start(desktopNode._id,16994,"*","*",0);desktop.contype=2}else{desktop=CreateAgentRedirect(meshserver,CreateAgentRemoteDesktop("Desk"),serverPublicNamePort,authCookie);desktop.debugmode=debugmode;desktop.m.debugmode=debugmode;desktop.attemptWebRTC=attemptWebRTC;desktop.onStateChanged=onDesktopStateChange;desktop.m.CompressionLevel=desktopsettings.quality;desktop.m.ScalingLevel=desktopsettings.scaling;desktop.m.FrameRateTimer=desktopsettings.framerate;desktop.m.onDisplayinfo=deskDisplayInfo;desktop.m.onScreenSizeChange=deskAdjust;desktop.Start(desktopNode._id);desktop.contype=1}}else{desktop.Stop();webRtcDesktopReset();desktopNode=desktop=null}}var webRtcDesktop=null;function webRtcDesktopReset(){if(webRtcDesktop==null){return}if(webRtcDesktop.softdesktop!=null){webRtcDesktop.softdesktop.Stop();webRtcDesktop.softdesktop=null}if(webRtcDesktop.webchannel!=null){try{webRtcDesktop.webchannel.close()}catch(a){}webRtcDesktop.webchannel=null}if(webRtcDesktop.webrtc!=null){try{webRtcDesktop.webrtc.close()}catch(a){}webRtcDesktop.webrtc=null}webRtcDesktop=null;if(desktop&&desktop.m){desktop.m.hold(false);Q("deskstatus").textContent=StatusStrs[desktop.State]}}function onDesktopStateChange(c,a){var d=a;if((d==3)&&(c.contype==2)){d++}var b=StatusStrs[d];if((desktop!=null)&&(desktop.webRtcActive==true)){b+=", WebRTC"}QH("deskstatus",b);switch(a){case 0:desktop.Stop();desktopNode=desktop=null;QV("DeskFocus",false);QV("termdisplays",false);deskFocusBtn.value="All Focus";if(fullscreen==true){deskToggleFull()}webRtcDesktopReset();break;case 2:break;default:break}updateDesktopButtons();deskAdjust();setTimeout(deskAdjust,50)}function showDesktopSettings(){if(xxdialogMode){return}applyDesktopSettings();updateDesktopButtons();setDialogMode(7,"Remote Desktop Settings",3,showDesktopSettingsChanged)}function showDesktopSettingsChanged(){desktopsettings.encoding=d7desktopmode.value;desktopsettings.showfocus=d7showfocus.checked;desktopsettings.showmouse=d7showcursor.checked;desktopsettings.quality=d7bitmapquality.value;desktopsettings.scaling=d7bitmapscaling.value;desktopsettings.framerate=d7framelimiter.value;localStorage.setItem("desktopsettings",JSON.stringify(desktopsettings));applyDesktopSettings();if(desktop){if(desktop.contype==1){if(desktop.State!=0){desktop.m.SendCompressionLevel(1,desktopsettings.quality,desktopsettings.scaling,desktopsettings.framerate)}}if(desktop.contype==2){if(desktopsettings.showfocus==false){desktop.m.focusmode=0;deskFocusBtn.value="All Focus"}if(desktop.State!=0){desktop.Stop();setTimeout(function(){connectDesktop(null,2)},50)}}}}function applyDesktopSettings(){var c="",b=(features&512)?[90,80,70,60,50,40,30,20,10,5,1]:[60,50,40,30,20,10,5,1];for(var a in b){c+="<option value="+b[a]+">"+b[a]+"%</option>"}QH("d7bitmapquality",c);d7desktopmode.value=desktopsettings.encoding;d7showfocus.checked=desktopsettings.showfocus;d7showcursor.checked=desktopsettings.showmouse;d7bitmapquality.value=40;if(b.indexOf(parseInt(desktopsettings.quality))>=0){d7bitmapquality.value=desktopsettings.quality}d7bitmapscaling.value=desktopsettings.scaling;if(desktopsettings.framerate){d7framelimiter.value=desktopsettings.framerate}QV("deskFocusBtn",(desktop!=null)&&(desktop.contype==2)&&(desktop.state!=0)&&(desktopsettings.showfocus))}function enterBrowserFullscreen(a){if(a.requestFullscreen){a.requestFullscreen()}else{if(a.msRequestFullscreen){a.msRequestFullscreen()}else{if(a.mozRequestFullScreen){a.mozRequestFullScreen()}else{if(a.webkitRequestFullscreen){a.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)}}}}}function exitBrowserFullscreen(){if(document.exitFullscreen){document.exitFullscreen()}else{if(document.msExitFullscreen){document.msExitFullscreen()}else{if(document.mozCancelFullScreen){document.mozCancelFullScreen()}else{if(document.webkitExitFullscreen){document.webkitExitFullscreen()}}}}}function isBrowserFullscreen(){if(!document.fullscreenElement&&!document.mozFullScreenElement&&!document.webkitFullscreenElement&&!document.msFullscreenElement){return false}else{return true}}var fullscreen=false;var browserfullscreen=false;function deskToggleFull(a){fullscreen=!fullscreen;QV("mastheadx",!fullscreen);QV("masthead",!fullscreen);QV("topbar",!fullscreen);QV("p11deviceNameHeader",!fullscreen);QV("footer",!fullscreen);QV("column_l_bottomgap",!fullscreen);QV("idx_deskFullBtn2",fullscreen);QV("deskFullBtn",!fullscreen);QV("page_leftbar",!fullscreen);if(fullscreen){if(a.shiftKey==true){enterBrowserFullscreen(Q("deskarea0"));browserfullscreen=true}QS("column_l").width="930px";QS("column_l").height="";QS("column_l")["margin-left"]="";QS("column_l")["overflow-y"]="";QS("container").position="";QS("page_content").position="";QV("MainMenuSpan",true);QS("container").width="100%";QS("container")["border-right"]="0";QS("container")["border-left"]="0";QS("column_l").padding="0";QS("column_l").width="100%";QS("column_l")["max-height"]=""}else{exitBrowserFullscreen();browserfullscreen=false;QS("container").width="960px";QS("container")["border-right"]="1px solid #b7b7b7";QS("container")["border-left"]="1px solid #b7b7b7";QS("column_l").padding="0 15px";QS("column_l").width="930px";toggleFullScreen()}deskAdjust();deskAdjust();updateDesktopButtons()}function deskToggleFocus(){desktop.m.focusmode=(desktop.m.focusmode+64)%192;Q("deskFocusBtn").value=["All Focus","Small Focus","Large Focus"][desktop.m.focusmode/64]}function deskAdjust(){var c=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(Q("deskarea1").clientHeight+Q("deskarea2").clientHeight+Q("Desk").clientHeight+Q("deskarea4").clientHeight+2))/2;if(fullscreen){document.documentElement.style.overflow="hidden";QS("deskarea3x").height=null;if(c<0){var a=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(Q("deskarea1").clientHeight+Q("deskarea2").clientHeight+Q("deskarea4").clientHeight));var b=9999;if(desktop){b=(desktop.m.width/desktop.m.height)*a}if(webRtcDesktop&&webRtcDesktop.softdesktop){b=(webRtcDesktop.softdesktop.m.width/webRtcDesktop.softdesktop.m.height)*a}QS("Desk")["max-height"]=a+"px";QS("Desk")["max-width"]=b+"px";c=0}else{QS("Desk")["max-height"]=null;QS("Desk")["max-width"]=null}QS("Desk")["margin-top"]=c+"px";QS("Desk")["margin-bottom"]=c+"px"}else{var b=9999,a=(Math.max(document.documentElement.clientHeight,window.innerHeight||0)-(webPageFullScreen?276:290));if(desktop){b=(desktop.m.width/desktop.m.height)*a}if(webRtcDesktop&&webRtcDesktop.softdesktop){b=(webRtcDesktop.softdesktop.m.width/webRtcDesktop.softdesktop.m.height)*a}document.documentElement.style.overflow="auto";QS("Desk")["max-height"]=a+"px";QS("Desk")["max-width"]=b+"px";QS("Desk")["margin-top"]="0";QS("Desk")["margin-bottom"]="0"}}function mdeskAdjust(c,h,g,a){if(!c||!h||!g||!a){return}if(a.id=="Desk"){deskAdjust();return}var k=[{x:180,y:101},{x:302,y:169},{x:454,y:255}][Q("sizeselect").selectedIndex];var e=k.x+2,j=Q("xdevices").clientWidth-30,l=Math.floor(j/e);l=e+Math.floor((j-(l*e))/l);k.y=k.y*(l/k.x);k.x=l;var b=k.y,d=k.x;if(c.State!=0){b=k.y;d=(h/g)*k.y}QS(a.id)["max-height"]=b+"px";QS(a.id)["max-width"]=d+"px";QS(a.id)["margin-top"]="0";QS(a.id)["margin-bottom"]="0"}function deskSendKeys(){if(xxdialogMode||desktop==null||desktop.State!=3){return}var a=Q("deskkeys").value;if(a==0){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65364,1],[65364,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,40],[desktop.m.KeyAction.UP,40],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==1){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65362,1],[65362,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,38],[desktop.m.KeyAction.UP,38],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==2){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[108,1],[108,0],[65511,0]])}else{desktop.sendCtrlMsg('{"action":"lock"}')}}else{if(a==3){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[109,1],[109,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==4){if(desktop.contype==2){desktop.m.sendkey([[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.DOWN,16],[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,77],[desktop.m.KeyAction.UP,77],[desktop.m.KeyAction.EXUP,91],[desktop.m.KeyAction.UP,16]])}}else{if(a==5){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.EXUP,91]])}}else{if(a==6){if(desktop.contype==2){desktop.m.sendkey([[65511,1],[114,1],[114,0],[65511,0]])}else{desktop.m.SendKeyMsgKC([[desktop.m.KeyAction.EXDOWN,91],[desktop.m.KeyAction.DOWN,82],[desktop.m.KeyAction.UP,82],[desktop.m.KeyAction.EXUP,91]])}}}}}}}}}function showDeskClip(){if(xxdialogMode||desktop==null||desktop.State!=3){return}Q("DeskClip").blur();var a='<input id=dlgClipGet type=button value="Get Clipboard" style=width:120px onclick=showDeskClipGet()>';a+='<input id=dlgClipSet type=button value="Set Clipboard" style=width:120px onclick=showDeskClipSet()>';a+='<div id=dlgClipStatus style="display:inline-block;margin-left:8px" ></div>';a+='<textarea id=d2clipText style="width:100%;height:184px;resize:none" maxlength=65535></textarea>';a+='<input type=button value="Close" style=width:80px;float:right onclick=dialogclose(0)><div style=height:26px> </div>';setDialogMode(2,"Remote Clipboard",8,null,a,"clipboard");Q("d2clipText").focus()}function showDeskClipGet(){if(desktop==null||desktop.State!=3){return}meshserver.send({action:"msg",type:"getclip",nodeid:currentNode._id})}function showDeskClipSet(){if(desktop==null||desktop.State!=3){return}meshserver.send({action:"msg",type:"setclip",nodeid:currentNode._id,data:Q("d2clipText").value})}function sendCAD(){if(xxdialogMode||desktop==null||desktop.State!=3){return}desktop.m.sendcad()}function toggleDeskTools(){if(xxdialogMode){return}if(QS("DeskTools").display=="none"){QV("DeskTools",true);Q("DeskTools").nodeid=currentNode._id;refreshDeskTools()}else{QV("DeskTools",false)}}function refreshDeskTools(){QV("DeskToolsRefreshButton",false);setTimeout(refreshDeskToolsEx,500);meshserver.send({action:"msg",type:"ps",nodeid:currentNode._id})}function refreshDeskToolsEx(){QV("DeskToolsRefreshButton",true)}var deskTools={sort:1,msg:null};function sortProcess(a){deskTools.sort=a;showDeskToolsProcesses(deskTools.msg)}function sortProcessPid(c,d){if(c.p>d.p){return 1}if(c.p<d.p){return(-1)}return 0}function sortProcessName(c,d){if(c.d>d.d){return 1}if(c.d<d.d){return(-1)}return 0}function showDeskToolsProcesses(c){deskTools.msg=c;if(c==null){QH("DeskToolsProcesses","");return}if(Q("DeskTools").nodeid!=c.nodeid){return}var d=[],h=null;try{h=JSON.parse(c.value)}catch(a){}if(h!=null){for(var g in h){d.push({p:parseInt(g),c:h[g].cmd,d:h[g].cmd.toLowerCase(),u:h[g].user})}if(deskTools.sort==0){d.sort(sortProcessPid)}else{if(deskTools.sort==1){d.sort(sortProcessName)}}var j="";for(var b in d){if(d[b].p!=0){j+="<div class=deskToolsBar><div style=width:50px;float:left;text-align:right;padding-right:5px>"+d[b].p+'</div><a style=float:right;padding-right:5px;cursor:pointer title="Stop process" onclick=stopProcess('+d[b].p+',"'+d[b].c+'")><img width=10 height=10 src="images/trash.png"></a><div style=float:right;padding-right:5px>'+(d[b].u?d[b].u:"")+"</div><div>"+d[b].c+"</div></div>"}}QH("DeskToolsProcesses",j)}}function toggleKvmControl(){putstore("DeskControl",(Q("DeskControl").checked?1:0))}function deskSaveImage(){if(xxdialogMode||desktop==null||desktop.State!=3){return}var a=new Date(),b="Desktop-"+currentNode.name+"-"+a.getFullYear()+"-"+("0"+(a.getMonth()+1)).slice(-2)+"-"+("0"+a.getDate()).slice(-2)+"-"+("0"+a.getHours()).slice(-2)+"-"+("0"+a.getMinutes()).slice(-2);Q("Desk")["toBlob"](function(c){saveAs(c,b+".jpg")})}function deskDisplayInfo(e,a,c,d){var g=Q("termdisplays").value;if(a.length>0){var b="";for(var h in a){b+="<option"+((g==a[h])?" selected":"")+">"+a[h]+"</option>"}QH("termdisplays",b)}QV("termdisplays",a.length>0)}function deskGetDisplayNumbers(a){desktop.m.GetDisplayNumbers()}function deskSetDisplay(b){var a=0,c=Q("termdisplays").value;if(c=="All Displays"){a=65535}else{a=parseInt(c.substring(8))}desktop.m.SetDisplay(a)}var dblClickDetectArgs={t:0,x:0,y:0};function dblClickDetect(a){if(a.buttons!=1){return}var b=Date.now();if(((b-dblClickDetectArgs.t)<250)&&(Math.abs(a.clientX-dblClickDetectArgs.x)<2)&&(Math.abs(a.clientY-dblClickDetectArgs.y)<2)){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousedblclick(a);desktop.m.sendKeepAlive()}else{desktop.m.mousedblclick(a)}}}dblClickDetectArgs.t=b;dblClickDetectArgs.x=a.clientX;dblClickDetectArgs.y=a.clientY}function dmousedown(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousedown(a);desktop.m.sendKeepAlive()}else{desktop.m.mousedown(a)}}dblClickDetect(a)}function dmouseup(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mouseup(a);desktop.m.sendKeepAlive()}else{desktop.m.mouseup(a)}}}function dmousemove(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousemove(a);desktop.m.sendKeepAlive()}else{desktop.m.mousemove(a)}}}function dmousewheel(a){if(!xxdialogMode&&desktop!=null&&Q("DeskControl").checked){if((webRtcDesktop!=null)&&(webRtcDesktop.softdesktop!=null)){webRtcDesktop.softdesktop.m.mousewheel(a);desktop.m.sendKeepAlive()}else{if(desktop.m.mousewheel){desktop.m.mousewheel(a)}}haltEvent(a);return true}return false}function drotate(a){if(!xxdialogMode&&desktop!=null){desktop.m.setRotation(desktop.m.rotation+a);deskAdjust();deskAdjust()}}function stopProcess(a,b){setDialogMode(2,"Process Control",3,stopProcessEx,"Stop process #"+a+' "'+b+'"?',a)}function stopProcessEx(a,b){meshserver.send({action:"msg",type:"pskill",nodeid:currentNode._id,value:b});setTimeout(refreshDeskTools,300)}var terminalNode;function setupTerminal(){if((terminalNode!=currentNode)&&(terminal!=null)){terminal.Stop();terminal=null}terminalNode=currentNode;updateTerminalButtons()}function updateTerminalButtons(){var b=meshes[terminalNode.meshid];var d=((terminal!=null)&&(terminal.state!=0));QV("disconnectbutton2span",(d==true));QV("connectbutton2span",(d==false)&&(b.mtype==2)&&(currentNode.agent.caps&2));QV("connectbutton2hspan",(d==false)&&((terminalNode.intelamt!=null)&&(b.mtype==1||terminalNode.intelamt.state==2)&&((terminalNode.intelamt.ver!=null)||(b.mtype==1))));var c=((terminalNode.conn&1)!=0);QE("connectbutton2",c);var a=((terminalNode.conn&6)!=0);QE("connectbutton2h",a);QE("ctrlcbutton",d);QE("ctrlxbutton",d);QE("escbutton",d);QE("bsbutton",d);QE("pastebutton",d);QE("specialkeylist",d);QE("specialkeylistinput",d);QV("terminalSettingsButtons",(terminal)&&(terminal.contype==2));if(terminal){Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation];Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation];Q("id_tcrbutton").value=(terminal.m.lineFeed=="\r\n")?"CR+LF":"LF"}}function onTerminalStateChange(d,a){var c=a;if((c==3)&&(d.contype==2)){c++}var b=StatusStrs[c];if(terminal.webRtcActive==true){b+=", WebRTC"}QH("termstatus",b);switch(a){case 0:d.m.TermResetScreen();d.m.TermDraw();if(terminal!=null){terminal.Stop();terminal=null}break;case 3:break;default:break}updateTerminalButtons()}var autoConnectTerminalTimer=null;function autoConnectTerminal(a){if(autoConnectTerminalTimer==null){autoConnectTerminalTimer=setInterval(connectTerminal,100)}else{clearInterval(autoConnectTerminalTimer);autoConnectTerminalTimer=null}}function connectTerminal(b,a){if(!terminal){if(a==2){if((terminalNode.intelamt.user==null)||(terminalNode.intelamt.user=="")){editDeviceAmtSettings(terminalNode._id,connectTerminal);return}terminal=CreateAmtRedirect(CreateAmtRemoteTerminal("Term"),authCookie);terminal.debugmode=debugmode;terminal.m.debugmode=debugmode;terminal.onStateChanged=onTerminalStateChange;terminal.Start(terminalNode._id,16994,"*","*",0);terminal.contype=2;Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation]}else{terminal=CreateAgentRedirect(meshserver,CreateAmtRemoteTerminal("Term"),serverPublicNamePort,authCookie);terminal.debugmode=debugmode;terminal.m.debugmode=debugmode;terminal.m.lineFeed=([1,2,3,4,21,22].indexOf(currentNode.agent.id)>=0)?"\r\n":"\n";terminal.attemptWebRTC=attemptWebRTC;terminal.onStateChanged=onTerminalStateChange;terminal.Start(terminalNode._id);terminal.contype=1;terminal.m.terminalEmulation=0;terminal.m.fxEmulation=0;Q("id_ttypebutton").value=terminalEmulations[0]}}else{terminal.Stop();terminal=null}Q("connectbutton2").blur()}var terminalEmulations=["UTF8 Terminal","Extended ASCII","Intel ASCII"];function termToggleType(){if(!terminal||xxdialogMode){return}terminal.m.terminalEmulation=(terminal.m.terminalEmulation+1)%3;Q("id_ttypebutton").value=terminalEmulations[terminal.m.terminalEmulation];Q("id_ttypebutton").blur()}var fxEmulations=["Intel (F10 = ESC+[OM)","Alternate (F10 = ESC+0)","VT100+ (F10 = ESC+[OY)"];function termToggleFx(){if(!terminal||xxdialogMode){return}terminal.m.fxEmulation=(terminal.m.fxEmulation+1)%3;Q("id_tfxkeysbutton").value=fxEmulations[terminal.m.fxEmulation];Q("id_tfxkeysbutton").blur()}function termToggleCr(){if(!terminal||xxdialogMode){return}if(terminal.m.lineFeed=="\n"){terminal.m.lineFeed="\r\n"}else{terminal.m.lineFeed="\n"}Q("id_tcrbutton").value=(terminal.m.lineFeed=="\r\n")?"CR+LF":"LF"}function termSendKey(b,a){if(!terminal||xxdialogMode){return}terminal.m.TermSendKey(b);Q(a).blur()}function showTermPasteDialog(){if(!terminal||xxdialogMode){return}Q("pastebutton").blur();setDialogMode(2,"Paste",3,showTermPasteDialogEx,'<textarea id=d2pasteText style="width:100%;height:184px;resize:none"></textarea>');Q("d2pasteText").focus()}function showTermPasteDialogEx(){if(!terminal){return}terminal.m.TermSendKeys(Q("d2pasteText").value)}function sendSpecialKey(){terminal.m.TermSendKey(Q("specialkeylist").value);Q("specialkeylist").blur();Q("specialkeylistinput").blur()}var filesNode;function setupFiles(){var b=(filesNode==currentNode);filesNode=currentNode;var a=((filesNode.conn&1)!=0)?true:false;QE("p13Connect",a);if(((b==false)||(a==false))&&files){files.Stop();files=null}}function onFilesStateChange(c,a){p13Connect.value=(a==0)?"Connect":"Disconnect";var b=StatusStrs[a];if(files.webRtcActive==true){b+=", WebRTC"}Q("p13Status").textContent=b;switch(a){case 0:QH("p13files","");p13filetree=null;p13filetreelocation=[];QH("p13currentpath","");QE("p13FolderUp",false);p13setActions();if(files!=null){files.Stop();files=null}break;case 3:p13targetpath="";files.sendText({action:"ls",reqid:1,path:""});break;default:break}}function CreateRemoteFiles(b){var a={protocol:5};a.onFileUpdate=b;a.xxStateChange=function(c){};a.ProcessData=function(c){a.onFileUpdate(c)};return a}var autoConnectFilesTimer=null;function autoConnectFiles(a){if(autoConnectFilesTimer==null){autoConnectFilesTimer=setInterval(connectFiles,100)}else{clearInterval(autoConnectFilesTimer);autoConnectFilesTimer=null}}function connectFiles(a){if(!files){files=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotFiles),serverPublicNamePort,authCookie);files.attemptWebRTC=attemptWebRTC;files.onStateChanged=onFilesStateChange;files.Start(filesNode._id)}else{files.Stop();files=null}p13clipboard=p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}var p13filetree=null;var p13targetpath=null;var p13filetreelocation=[];function p13gotFiles(b){if((b.length>0)&&(b.charCodeAt(0)!=123)){p13gotDownloadBinaryData(b);return}b=JSON.parse(decode_utf8(b));if(b.action=="download"){p13gotDownloadCommand(b);return}b.path=b.path.replace(/\//g,"\\");if((p13filetree!=null)&&(b.path==p13filetree.path)){var a=p13getCheckedNames();p13filetree=b;p13updateFiles(a)}else{var c=b.path.replace(/\//g,"\\"),d=p13targetpath.replace(/\//g,"\\");while((c.length>0)&&(c[0]=="\\")){c=c.substring(1)}while((d.length>0)&&(d[0]=="\\")){d=d.substring(1)}if((c==d)||((b.path=="\\")&&(p13targetpath==""))){p13filetree=b;p13updateFiles()}}}function p13getCheckedNames(){var b=[],a=document.getElementsByName("fd");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(p13filetree.dir[a[c].value].n)}}return b}function p13updateFiles(b){var n="",o="",c="<a style=cursor:pointer onclick=p13folderup(0)>Root</a>",l="Root";var w=p13filetree.path.split("\\");p13filetreelocation=[];for(var p in w){if(w[p]!=""){p13filetreelocation.push(w[p])}}for(var p in p13filetreelocation){c+=" / <a style=cursor:pointer onclick=p13folderup("+(parseInt(p)+1)+")>"+p13filetreelocation[p]+"</a>"}var s=p13filetreelocation.join("/");var j=p13sort_files(p13filetree.dir);for(var p in j){var d=j[p],r=d.n,u;u=r;if(r.length>70){u='<span title="'+EscapeHtml(r)+'">'+EscapeHtml(r.substring(0,70))+"...</span>"}else{u=EscapeHtml(r)}r=EscapeHtml(r);var g="";if(d.d!=null){var e=new Date(d.d),g=(e.getMonth()+1)+"/"+(e.getDate())+"/"+e.getFullYear()+" "+e.toLocaleTimeString()+" "}var k="";if(d.s!=null){k=getFileSizeStr(d.s)}var m="";if(d.t<3){var t="",v="";m="<div class=filelist file=999><input file=999 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'> <span style=float:right title=\""+v+'">'+t+"</span><span><div class=fileIcon"+d.t+' onclick=p13folderset("'+encodeURIComponent(d.nx)+'")></div><a style=cursor:pointer onclick=p13folderset("'+encodeURIComponent(d.nx)+'")>'+u+"</a></span></div>"}else{var q=u;if(d.s>0){q='<a rel="noreferrer noopener" target="_blank" style=cursor:pointer onclick="p13downloadfile(\''+encodeURIComponent(s+"/"+r)+"','"+encodeURIComponent(r)+"',"+d.s+')">'+u+"</a>"}m="<div class=filelist file=3><input file=3 style=float:left name=fd class=fcb type=checkbox onchange=p13setActions() value='"+d.nx+"'> <span class=fsize>"+g+"</span><span style=float:right>"+k+"</span><span><div class=fileIcon"+d.t+"></div>"+q+"</span></div>"}if(d.t<3){n+=m}else{o+=m}}QH("p13files",n+o);QH("p13currentpath",c);QE("p13FolderUp",p13filetreelocation.length!=0);if(b!=null){var a=document.getElementsByName("fd");for(var p=0;p<a.length;p++){if(b.indexOf(p13filetree.dir[a[p].value].n)>=0){a[p].checked=true}}}p13setActions()}function p13folderset(a){p13targetpath=joinPaths(p13filetree.path,p13filetree.dir[a].n).split("\\").join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}function p13folderup(a){if(a==null){p13filetreelocation.pop()}else{while(p13filetreelocation.length>a){p13filetreelocation.pop()}}p13targetpath=p13filetreelocation.join("/");files.sendText({action:"ls",reqid:1,path:p13targetpath})}var p13sortorder;function p13sort_filename(c,d){if(c.ln>d.ln){return(1*p13sortorder)}if(c.ln<d.ln){return(-1*p13sortorder)}return 0}function p13sort_timestamp(c,d){if(c.d>d.d){return(1*p13sortorder)}if(c.d<d.d){return(-1*p13sortorder)}return 0}function p13sort_bysize(c,d){if(c.s==d.s){return p13sort_filename(c,d)}return(((c.s-d.s))*p13sortorder)}function p13sort_files(a){var c=[],d=Q("p13sortdropdown").value;for(var b in a){a[b].nx=b;if(a[b].s==null){a[b].s=0}if(a[b].n==null){a[b].n=b}a[b].ln=a[b].n.toLowerCase();c.push(a[b])}p13sortorder=1;if(d>3){p13sortorder=-1;d-=3}if(d==1){c.sort(p13sort_filename)}else{if(d==2){c.sort(p13sort_bysize)}else{if(d==3){c.sort(p13sort_timestamp)}}}return c}function p13setActions(){if(p13filetree==null){QE("p13DeleteFileButton",false);QE("p13NewFolderButton",false);QE("p13UploadButton",false);QE("p13RenameFileButton",false);QE("p13SelectAllButton",false);Q("p13SelectAllButton").value="Select All";QE("p13RefreshButton",false);QE("p13CutButton",false);QE("p13CopyButton",false);QE("p13PasteButton",false)}else{var a=p13getFileSelCount(),c=p13getFileCount(),b=p13getFileSelCount(false);var d=((currentNode.agent.id>0)&&(currentNode.agent.id<5));QE("p13DeleteFileButton",(a>0)&&((p13filetreelocation.length>0)||(d==false)));QE("p13NewFolderButton",((p13filetreelocation.length>0)||(d==false)));QE("p13UploadButton",((p13filetreelocation.length>0)||(d==false)));QE("p13RenameFileButton",(a==1)&&((p13filetreelocation.length>0)||(d==false)));QE("p13SelectAllButton",c>0);Q("p13SelectAllButton").value=(a>0?"Select None":"Select All");QE("p13RefreshButton",true);QE("p13CutButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13CopyButton",(a>0)&&(a==b)&&((p13filetreelocation.length>0)||(d==false)));QE("p13PasteButton",((p13filetreelocation.length>0)||(d==false))&&((p13clipboard!=null)&&(p13clipboard.length>0)))}}function p13getFileSelCount(d){var a=0;var b=document.getElementsByName("fd");for(var c=0;c<b.length;c++){if((b[c].checked)&&((d!=false)||(b[c].attributes.file.value=="3"))){a++}}return a}function p13getFileSelDirCount(){var a=0,b=document.getElementsByName("fd");for(var c=0;c<b.length;c++){if((b[c].checked)&&(b[c].attributes.file.value=="999")){a++}}return a}function p13getFileCount(){var a=0;var b=document.getElementsByName("fd");return b.length}function p13selectallfile(){var c=(p13getFileSelCount()==0),a=document.getElementsByName("fd");for(var b=0;b<a.length;b++){a[b].checked=c}p13setActions()}function p13createfolder(){setDialogMode(2,"New Folder",3,p13createfolderEx,"<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% />");focusTextBox("p13renameinput");p13fileNameCheck()}function p13createfolderEx(){files.sendText({action:"mkdir",reqid:1,path:p13filetreelocation.join("/")+"/"+Q("p13renameinput").value});p13folderup(999)}function p13deletefile(){var a=p13getFileSelCount(),b=(p13getFileSelDirCount()>0)?"<br /><br /><input type=checkbox id=p13recdeleteinput>Recursive delete<br>":"<input type=checkbox id=p13recdeleteinput style='display:none'>";setDialogMode(2,"Delete",3,p13deletefileEx,(a>1)?("Delete "+a+" selected items?"+b):("Delete selected item?"+b))}function p13deletefileEx(){var b=[],a=document.getElementsByName("fd");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(p13filetree.dir[a[c].value].n)}}files.sendText({action:"rm",reqid:1,path:p13filetreelocation.join("/"),delfiles:b,rec:Q("p13recdeleteinput").checked});p13folderup(999)}function p13renamefile(){var c,a=document.getElementsByName("fd");for(var b=0;b<a.length;b++){if(a[b].checked){c=p13filetree.dir[a[b].value].n}}setDialogMode(2,"Rename",3,p13renamefileEx,'<input type=text id=p13renameinput maxlength=64 onkeyup=p13fileNameCheck(event) style=width:100% value="'+c+'" />',{action:"rename",path:p13filetreelocation.join("/"),oldname:c});focusTextBox("p13renameinput");p13fileNameCheck()}function p13renamefileEx(a,c){c.newname=Q("p13renameinput").value;files.sendText(c);p13folderup(999)}function p13fileNameCheck(a){var b=isFilenameValid(Q("p13renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a!=null)&&(a.keyCode==13)){dialogclose(1)}}function p13uploadFile(){setDialogMode(2,"Upload File",3,p13uploadFileEx,"<input type=file name=files id=p13uploadinput style=width:100% multiple=multiple onchange=\"updateUploadDialogOk('p13uploadinput')\" />");updateUploadDialogOk("p13uploadinput")}function p13uploadFileEx(){p13doUploadFiles(Q("p13uploadinput").files)}var p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;function p13copyFile(b){var a=document.getElementsByName("fd");p13clipboard=[];p13clipboardCut=b,p13clipboardFolder=p13targetpath;for(var c=0;c<a.length;c++){if((a[c].checked)&&(a[c].attributes.file.value=="3")){p13clipboard.push(p13filetree.dir[a[c].value].n)}}p13updateClipview()}function p13pasteFile(){var a="";if((p13clipboard!=null)&&(p13clipboard.length>0)){a="Confim "+(p13clipboardCut==0?"copy":"move")+" of "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p13pasteFileEx,a)}function p13pasteFileEx(){files.sendText({action:(p13clipboardCut==0?"copy":"move"),reqid:1,scpath:p13clipboardFolder,dspath:p13targetpath,names:p13clipboard});p13folderup(999);if(p13clipboardCut==1){p13clipboard=null,p13clipboardFolder=null,p13clipboardCut=0;p13updateClipview()}}function p13updateClipview(){var a="";if((p13clipboard!=null)&&(p13clipboard.length>0)){a="Holding "+p13clipboard.length+" entrie"+((p13clipboard.length>1)?"s":"")+" for "+(p13clipboardCut==0?"copy":"move")+", <a onclick=p13clearClip() style=cursor:pointer>Clear</a>."}QH("p13bottomstatus",a);p13setActions()}function p13clearClip(){p13clipboard=null;p13clipboardFolder=null;p13clipboardCut=0;p13updateClipview()}function p13fileDragDrop(a){haltEvent(a);QV("p13bigfail",false);QV("p13bigok",false);if(a.dataTransfer==null||a.dataTransfer.files.length==0||p13filetree==null){return}p13doUploadFiles(a.dataTransfer.files)}var p13dragtimer=null;function p13fileDragOver(b){haltEvent(b);if(p13dragtimer!=null){clearTimeout(p13dragtimer);p13dragtimer=null}var a=(p13filetree!=null);QV("p13bigok",a);QV("p13bigfail",!a)}function p13fileDragLeave(a){haltEvent(a);if(a.target.id!="p13filetable"){QV("p13bigfail",false);QV("p13bigok",false)}else{p13dragtimer=setTimeout(function(){QV("p13bigfail",false);QV("p13bigok",false);p13dragtimer=null},10)}}var downloadFile;function p13downloadfile(a,b,c){if(xxdialogMode||downloadFile||!files){return}downloadFile={path:decodeURIComponent(a),file:decodeURIComponent(b),size:c,tsize:0,data:"",state:0,id:Math.random()};files.sendText({action:"download",sub:"start",id:downloadFile.id,path:downloadFile.path});setDialogMode(2,"Download File",10,p13downloadFileCancel,"<div>"+downloadFile.file+"</div><br /><progress id=d2progressBar style=width:100% value=0 max="+c+" />")}function p13downloadFileCancel(){setDialogMode(0);files.sendText({action:"download",sub:"cancel",id:downloadFile.id});downloadFile=null}function p13gotDownloadCommand(a){if((downloadFile==null)||(a.id!=downloadFile.id)){return}if(a.sub=="start"){downloadFile.state=1;files.sendText({action:"download",sub:"startack",id:downloadFile.id})}else{if(a.sub=="cancel"){downloadFile=null;setDialogMode(0)}}}function p13gotDownloadBinaryData(a){if(!downloadFile||downloadFile.state==0){return}if(a.length>4){downloadFile.tsize+=(a.length-4);downloadFile.data+=a.substring(4);Q("d2progressBar").value=downloadFile.tsize}if((ReadInt(a,0)&1)!=0){saveAs(data2blob(downloadFile.data),downloadFile.file);downloadFile=null;setDialogMode(0)}else{files.sendText({action:"download",sub:"ack",id:downloadFile.id})}}var uploadFile;function p13doUploadFiles(a){if(xxdialogMode){return}uploadFile={};uploadFile.xpath=p13filetreelocation.join("/");uploadFile.xfiles=a;uploadFile.xfilePtr=-1;setDialogMode(2,"Upload File",10,p13uploadFileCancel,"<div id=p13dfileName>Connecting...</div><br /><progress id=d2progressBar style=width:100% value=0 max=0 />");p13uploadReconnect()}function onFileUploadStateChange(b,a){switch(a){case 0:p13folderup(9999);break;case 3:p13uploadNextFile();break;default:console.log("Unknown onFileUploadStateChange state",a);break}}function p13uploadReconnect(){uploadFile.ws=CreateAgentRedirect(meshserver,CreateRemoteFiles(p13gotUploadData),serverPublicNamePort,authCookie);uploadFile.ws.attemptWebRTC=false;uploadFile.ws.ctrlMsgAllowed=false;uploadFile.ws.onStateChanged=onFileUploadStateChange;uploadFile.ws.Start(filesNode._id)}function p13uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>uploadFile.xfilePtr){uploadFile.xptr=0;var a=uploadFile.xfiles[uploadFile.xfilePtr];QH("p13dfileName",a.name);Q("d2progressBar").max=a.size;Q("d2progressBar").value=0;uploadFile.xreader=new FileReader();uploadFile.xreader.onload=function(){uploadFile.xdata=uploadFile.xreader.result;uploadFile.ws.sendText(JSON.stringify({action:"upload",reqid:uploadFile.xfilePtr,path:uploadFile.xpath,name:a.name,size:uploadFile.xdata.byteLength}))};uploadFile.xreader.readAsArrayBuffer(a)}else{p13uploadFileCancel()}}function p13uploadFileCancel(a,b){if(uploadFile!=null){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}uploadFile=null}setDialogMode(0)}function p13gotUploadData(b){var a=JSON.parse(b);if((uploadFile==null)||(parseInt(uploadFile.xfilePtr)!=parseInt(a.reqid))){return}if(a.action=="uploadstart"){p13uploadNextPart(false);for(var c=0;c<8;c++){p13uploadNextPart(true)}}else{if(a.action=="uploadack"){p13uploadNextPart(false)}else{if(a.action=="uploaderror"){p13uploadFileCancel()}}}}function p13uploadNextPart(c){var a=uploadFile.xdata;var e=uploadFile.xptr;var d=uploadFile.xptr+4096;if(d>a.byteLength){if(c==true){return}d=a.byteLength}if(e==a.byteLength){if(uploadFile.ws!=null){uploadFile.ws.Stop();uploadFile.ws=null}if(uploadFile.xfiles.length>uploadFile.xfilePtr+1){p13uploadReconnect()}else{p13uploadFileCancel()}}else{var b=a.slice(e,d);uploadFile.ws.send(b);uploadFile.xptr=d;Q("d2progressBar").value=d}}var currentDeviceEvents=null;function deviceEventsUpdate(){var h="",a=null;for(var c in currentDeviceEvents){var b=currentDeviceEvents[c];var g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td class=DevSt colspan=4>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");h+="<tr><td style=width:18px><div class="+d+"></div></td><td class=g1 style=float:none> </td><td style=background-color:#C9C9C9>"+g.toLocaleTimeString()+" - "+e+"</td><td class=g2 style=float:none> </td></tr><tr style=height:2px></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p16events",h)}function refreshDeviceEvents(){meshserver.send({action:"events",nodeid:currentNode._id,limit:parseInt(p16limitdropdown.value)})}function agentConsoleHandleKeys(b){var d=0,a=Q("p15consoleText");if(b.key){if(b.keyCode==13&&consoleFocus==0){p15consoleSend(b);d=1}else{if(b.keyCode==8&&consoleFocus==0){var g=a.value;a.value=g.substring(0,g.length-1);d=1}else{if(b.keyCode==27){a.value="";d=1}else{if((b.keyCode==38)||(b.keyCode==40)){var c=consoleHistory.indexOf(a.value);if((b.keyCode==38)&&((consoleHistory.length-1)>c)){a.value=consoleHistory[c+1]}else{if((b.keyCode==40)&&(c>0)){a.value=consoleHistory[c-1]}else{if((b.keyCode==40)&&(c==0)){a.value=""}}}d=1}else{if(b.key.length===1){insertTextAtCursor(a,b.key);d=1}}}}}}else{if(b.charCode!=0&&consoleFocus==0){a.value=((a.value+String.fromCharCode(b.charCode)));d=1}}if(d>0){return haltEvent(b)}}function insertTextAtCursor(a,d){if(document.selection){a.focus();sel=document.selection.createRange();sel.text=d}else{if(a.selectionStart||a.selectionStart=="0"){var c=a.selectionStart,b=a.selectionEnd;a.value=a.value.substring(0,c)+d+a.value.substring(b,a.value.length);a.setSelectionRange(b+1,b+1)}else{a.value+=myValue}}}var consoleNode;var consoleServerText="";function setupConsole(){if(xxcurrentView==115){var d=(consoleNode=="server");consoleNode="server";QH("p15deviceName","My Server Console");QH("p15statetext","");QH("p15coreName","");if(d==false){QH("p15agentConsoleText",consoleServerText);Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}else{var d=(consoleNode==currentNode);consoleNode=currentNode;var a=meshes[consoleNode.meshid];var b=a.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;if((b&16)!=0){if(consoleNode.consoleText==null){consoleNode.consoleText=""}if(d==false){QH("p15agentConsoleText",consoleNode.consoleText);Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}var c=((consoleNode.conn&1)!=0)?true:false;QH("p15statetext",c?"Agent is online":"Agent is offline");QE("p15consoleText",c);QE("p15uploadCore",c)}else{QH("p15statetext","Access Denied");QE("p15consoleText",false);QE("p15uploadCore",false)}}}function p15consoleClear(){QH("p15agentConsoleText","");Q("id_p15consoleClear").blur();if(xxcurrentView==115){consoleServerText=""}else{consoleNode.consoleText=""}}var consoleHistory=[];function p15consoleSend(a){if(a&&a.keyCode!=13){return}var d=Q("p15consoleText").value,c="<div style=color:green>> "+EscapeHtml(Q("p15consoleText").value)+"<br/></div>";Q("p15agentConsoleText").innerHTML+=c;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight;Q("p15consoleText").value="";if(xxcurrentView==115){consoleServerText+=c;meshserver.send({action:"serverconsole",value:d})}else{consoleNode.consoleText+=c;meshserver.send({action:"msg",type:"console",nodeid:consoleNode._id,value:d})}if(d.length>0){var b=consoleHistory.indexOf(d);if(b>=0){consoleHistory.splice(b,1)}consoleHistory.unshift(d);consoleHistory.splice(10)}}function p15consoleReceive(b,a){a="<div>"+a+"</div>";if(b==="serverconsole"){consoleServerText+=a;if(consoleNode=="server"){Q("p15agentConsoleText").innerHTML+=a;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}else{if(b.consoleText==null){b.consoleText=a}else{b.consoleText+=a}if(consoleNode==b){Q("p15agentConsoleText").innerHTML+=a;Q("p15agentConsoleText").scrollTop=Q("p15agentConsoleText").scrollHeight}}}function p15uploadCore(a){if(xxdialogMode){return}if(a.shiftKey==true){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"})}else{if(a.altKey==true){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"})}else{if(a.ctrlKey==true){p15uploadCore2()}else{setDialogMode(2,"Change Mesh Agent Core",3,p15uploadCoreEx,"<select id=d3coreMode style=float:right;width:260px><option value=1>Upload default server core</option><option value=2>Clear the core</option><option value=6>Upload recovery core</option><option value=3>Upload a core file</option><option value=4>Soft disconnect agent</option><option value=5>Hard disconnect agent</option></select><div>Change Core</div>")}}}}function p15uploadCoreEx(){if(Q("d3coreMode").value==1){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"default"})}else{if(Q("d3coreMode").value==2){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"clear"})}else{if(Q("d3coreMode").value==3){p15uploadCore2()}else{if(Q("d3coreMode").value==4){meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:1})}else{if(Q("d3coreMode").value==5){meshserver.send({action:"agentdisconnect",nodeid:consoleNode._id,disconnectMode:2})}else{if(Q("d3coreMode").value==6){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"recovery"})}}}}}}}function p15uploadCore2(){if(xxdialogMode){return}Q("d3localmodeform").action="uploadmeshcorefile.ashx";Q("d3attrib").value=currentNode._id;setDialogMode(3,"Upload Mesh Agent Core",3,p15uploadCoreEx2);d3init()}function p15uploadCoreEx2(){var b=Q("d3uploadMode").value;if(b==1){Q("d3submit").click()}else{var a=d3getFileSel();if(a.length==1){meshserver.send({action:"uploadagentcore",nodeid:consoleNode._id,type:"custom",path:d3filetreelocation.join("/")+"/"+a[0]})}}}function account_manageAuthApp(){if(xxdialogMode||((features&4096)==0)){return}if(userinfo.otpsecret==1){account_removeOtp()}else{account_addOtp()}}function account_addOtp(){if(xxdialogMode||(userinfo.otpsecret==1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",2,function(){meshserver.send({action:"otpauth-setup",secret:Q("d2optsecret").attributes.secret.value,token:Q("d2otpauthinput").value})},"<div id=d2optinfo>Loading...</div>","otpauth-request");meshserver.send({action:"otpauth-request"})}function account_addOtpCheck(a){var b=(Q("d2otpauthinput").value.length==6);QE("idx_dlgOkButton",b);if(a&&(a.keyCode==13)&&b){dialogclose(1)}}function account_removeOtp(){if(xxdialogMode||(userinfo.otpsecret!=1)||((features&4096)==0)){return}setDialogMode(2,"Authenticator App",3,function(){meshserver.send({action:"otpauth-clear"})},"Confirm removal of authenticator application 2-step login?")}function account_manageOtp(a){if((xxdialogMode==2)&&(xxdialogTag=="otpauth-manage")){dialogclose(0)}if(xxdialogMode||((features&4096)==0)){return}if((userinfo.otpsecret==1)||(userinfo.otphkeys>0)){meshserver.send({action:"otpauth-getpasswords",subaction:a})}}function account_manageHardwareOtp(){if((xxdialogMode==2)&&(xxdialogTag=="otpauth-hardware-manage")){dialogclose(0)}if(xxdialogMode||((features&4096)==0)){return}meshserver.send({action:"otp-hkey-get"})}function account_addhkey(a){if(a==1){var b="Type in the name of the key to add.<br /><br />";b+=addHtmlValue("Key Name",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="MyKey" onkeyup=account_addhkeyValidate(event,2) />')}else{if(a==2){var b="Type in a key name, select the OTP box and press the button on the YubiKey™.<br /><br />";b+=addHtmlValue("Key Name",'<input id=dp1keyname style=width:230px maxlength=20 autocomplete=off placeholder="MyKey" onkeyup=account_addhkeyValidate(event,1) />');b+=addHtmlValue("YubiKey™ OTP","<input id=dp1key style=width:230px autocomplete=off onkeyup=account_addhkeyValidate(event,2) />")}}setDialogMode(2,"Add Security Key",3,account_addhkeyEx,b,a);Q("dp1keyname").focus()}function account_addhkeyValidate(b,a){if((b!=null)&&(b.keyCode==13)){if(a==2){dialogclose(1)}else{Q("dp1key").focus()}}}function account_addhkeyEx(a,c){var b=Q("dp1keyname").value;if(b==""){b="MyKey"}if(c==1){meshserver.send({action:"otp-hkey-setup-request",name:b})}else{if(c==2){meshserver.send({action:"otp-hkey-yubikey-add",name:b,otp:Q("dp1key").value});setDialogMode(2,"Add Security Key",0,null,"<br />Checking...<br /><br /><br />","otpauth-hardware-manage")}}}function account_removehkey(a){meshserver.send({action:"otp-hkey-remove",index:a});meshserver.send({action:"otp-hkey-get"})}function account_showVerifyEmail(){if(xxdialogMode||(userinfo.emailVerified==true)||(serverinfo.emailcheck!=true)){return}var a="Click ok to send a verification mail to:<br /><div style=padding:8px><b>"+EscapeHtml(userinfo.email)+"</b></div>Please wait a few minute to receive the verification.";setDialogMode(2,"Email Verification",3,account_showVerifyEmailEx,a)}function account_showVerifyEmailEx(){meshserver.send({action:"verifyemail",email:userinfo.email})}function account_showChangeEmail(){if(xxdialogMode){return}var a="Change your account email address here.<br /><br />";a+=addHtmlValue("Email","<input id=dp2email style=width:230px maxlength=256 onchange=account_validateEmail() onkeyup=account_validateEmail(event) />");setDialogMode(2,"Email Address Change",3,account_changeEmail,a);if(userinfo.email!=null){Q("dp2email").value=userinfo.email}account_validateEmail();Q("dp2email").focus()}function account_validateEmail(a,b){QE("idx_dlgOkButton",validateEmail(Q("dp2email").value)&&(Q("dp2email").value!=userinfo.email));if((a!=null)&&(a.keyCode==13)){dialogclose(1)}}function account_changeEmail(){meshserver.send({action:"changeemail",email:Q("dp2email").value})}function account_showDeleteAccount(){if(xxdialogMode){return}var a="To delete this account, type in the account password in both boxes below and hit ok.<br /><br />";a+="<form action='"+domainUrl+"deleteaccount' method=post><table style=margin-left:80px><tr>";a+="<td align=right>Password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";a+="</tr><tr><td align=right>Password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateDeleteAccount() onkeyup=account_validateDeleteAccount() /></td>";a+="</tr></table><br /><div style=padding:10px;margin-bottom:4px>";a+="<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>";a+='<input id=account_dlgOkButton type=submit value=OK style="float:right;width:80px" onclick=dialogclose(1)>';a+="</div><br /></form>";setDialogMode(2,"Delete Account",0,null,a);account_validateDeleteAccount();Q("apassword1").focus()}function account_showChangePassword(){if(xxdialogMode){return}var c="Change your account password by entering the old password and new password twice in the boxes below. Password hint can be used but is not recommanded.<br /><br />";c+="<table style=margin-left:60px>";c+="<tr><td align=right>Old password:</td><td><input id=apassword0 type=password name=apassword0 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b></b></td></tr>";c+="<tr><td align=right>New password:</td><td><input id=apassword1 type=password name=apassword1 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /> <b><span id=dxPassWarn></span></b></td></tr>";c+="<tr><td align=right>New password:</td><td><input id=apassword2 type=password name=apassword2 autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";c+="<tr><td align=right>Password hint:</td><td><input id=apasswordhint name=apasswordhint maxlength=250 type=text autocomplete=off onchange=account_validateNewPassword() onkeyup=account_validateNewPassword() onkeydown=account_validateNewPassword() /></td></tr>";c+="</table>";if(passRequirements){var b=[];for(var a in passRequirements){b.push(a+":"+passRequirements[a])}c+="<br /><span style=font-size:x-small>Requirements: "+b.join(", ")+".</span>"}c+="<br />";setDialogMode(2,"Change Password",3,account_showChangePasswordEx,c);Q("apassword0").focus();account_validateNewPassword()}function account_showChangePasswordEx(){if(Q("apassword1").value==Q("apassword2").value){meshserver.send({action:"changepassword",oldpass:Q("apassword0").value,newpass:Q("apassword1").value,hint:Q("apasswordhint").value})}}function account_createMesh(){if(xxdialogMode){return}if((userinfo.emailVerified!==true)&&(serverinfo.emailcheck==true)&&(userinfo.siteadmin!=4294967295)){setDialogMode(2,"New Device Group",1,null,'Unable to create a new device group until a email address is verified. This is required for password recovery. Go to the "My Account" tab to change and verify an email address.');return}var a="Create a new device group using the options below.<br /><br />";a+=addHtmlValue("Name","<input id=dp2meshname style=width:230px maxlength=64 onchange=account_validateMeshCreate() onkeyup=account_validateMeshCreate() />");a+=addHtmlValue("Type","<div style=width:230px;margin:0;padding:0><select id=dp2meshtype style=width:100% onchange=account_validateMeshCreate() ><option value=2>Manage using a software agent</option><option value=1>Intel® AMT only, no agent</option></select></div>");a+=addHtmlValue("Description","<div style=width:230px;margin:0;padding:0><textarea id=dp2meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>");setDialogMode(2,"New Device Group",3,account_createMeshEx,a);account_validateMeshCreate();Q("dp2meshname").focus()}function account_validateMeshCreate(){QE("idx_dlgOkButton",Q("dp2meshname").value.length>0)}function account_createMeshEx(a,b){meshserver.send({action:"createmesh",meshname:Q("dp2meshname").value,meshtype:Q("dp2meshtype").value,desc:Q("dp2meshdesc").value})}function account_validateDeleteAccount(){QE("account_dlgOkButton",(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value))}function account_validateNewPassword(){var d="",a=(Q("apassword0").value.length>0)&&(Q("apassword1").value.length>0)&&(Q("apassword1").value==Q("apassword2").value)&&(Q("apassword0").value!=Q("apassword1").value)&&(Q("apasswordhint").value!=Q("apassword1").value);if(Q("apassword1").value!=""){if(passRequirements==null||passRequirements==""){var c=checkPasswordStrength(Q("apassword1").value);if(c>=80){d="<span style=color:green>Strong<span>"}else{if(c>=60){d="<span style=color:blue>Good<span>"}else{d="<span style=color:red>Weak<span>"}}}else{var b=checkPasswordRequirements(Q("apassword1").value,passRequirements);if(b==false){a=false;d="<span style=color:red>Policy<span>"}}}QH("dxPassWarn",d);QE("idx_dlgOkButton",a)}function checkPasswordStrength(e){var g=0,d={},h=0,j={digits:/\d/.test(e),lower:/[a-z]/.test(e),upper:/[A-Z]/.test(e),nonWords:/\W/.test(e)};if(!e){return 0}for(var b=0;b<e.length;b++){d[e[b]]=(d[e[b]]||0)+1;g+=5/d[e[b]]}for(var a in j){h+=(j[a]==true)?1:0}return parseInt(g+(h-1)*10)}function checkPasswordRequirements(e,g){if((g==null)||(g=="")||(typeof g!="object")){return true}if(g.min){if(e.length<g.min){return false}}if(g.max){if(e.length>g.max){return false}}var d=0,b=0,h=0,c=0;for(var a=0;a<e.length;a++){if(/\d/.test(e[a])){d++}if(/[a-z]/.test(e[a])){b++}if(/[A-Z]/.test(e[a])){h++}if(/\W/.test(e[a])){c++}}if(g.num&&(d<g.num)){return false}if(g.lower&&(b<g.lower)){return false}if(g.upper&&(h<g.upper)){return false}if(g.nonalpha&&(c<g.nonalpha)){return false}return true}function updateMeshes(){var e="";var a=0,b=0;for(i in meshes){if(a>1){e+="</tr><tr>";a=0}a++;b++;var d=0;if(meshes[i].links["user/"+domain+"/"+userinfo.name.toLowerCase()]){d=meshes[i].links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights}var g="Partial Rights";if(d==4294967295){g="Full Administrator"}else{if(d==0){g="No Rights"}}e+="<div onmouseover=devMouseHover(this,1) onmouseout=devMouseHover(this,0) style=display:inline-block;width:431px;height:50px;padding-top:1px;padding-bottom:1px;float:left><div style=float:left;width:30px;height:100%></div><div style=height:100%;cursor:pointer onclick=gotoMesh('"+i+"')><div class=mi style=float:left;width:50px;height:50px></div><div style=height:100%><div class=g1></div><div class=e2 style=width:300px><div class=e1>"+EscapeHtml(meshes[i].name)+"</div><div>"+g+"</div></div><div class=g2 style=float:left></div></div></div></div>"}meshcount=b;QH("p2meshes",e);QV("p2noMeshFound",b==0)}function gotoMesh(a){currentMesh=meshes[a];p20updateMesh();go(20)}function server_showRestoreDlg(){if(xxdialogMode){return}var a="Restore the server using a backup, <span style=color:red>this will delete the existing server data</span>. Only do this if you know what you are doing.<br /><br />";a+='<form action="/restoreserver.ashx" enctype="multipart/form-data" method="post"><div>';a+='<input id=account_dlgFileInput type=file name=datafile style=width:100% accept=".zip,application/octet-stream,application/zip,application/x-zip,application/x-zip-compressed" onchange=account_validateServerRestore()>';a+="<input id=account_dlgCancelButton type=button value=Cancel style=float:right;width:80px;margin-left:5px onclick=dialogclose(0)>";a+="<input id=account_dlgOkButton type=submit value=OK style=float:right;width:80px onclick=dialogclose(1)>";a+="</div><br /><br /></form>";setDialogMode(2,"Restore Server",0,null,a);account_validateServerRestore()}function account_validateServerRestore(){QE("account_dlgOkButton",Q("account_dlgFileInput").files.length==1)}function server_showVersionDlg(){if(xxdialogMode){return}setDialogMode(2,"MeshCentral Version",1,null,"Loading...","MeshCentralServerUpdate");meshserver.send({action:"serverversion"})}function server_showVersionDlgUpdate(){QE("idx_dlgOkButton",Q("d2updateCheck").checked)}function server_showVersionDlgEx(){meshserver.send({action:"serverupdate"})}function server_showErrorsDlg(){if(xxdialogMode){return}setDialogMode(2,"MeshCentral Errors",1,null,"Loading...","MeshCentralServerErrors");meshserver.send({action:"servererrors"})}function server_showErrorsDlgUpdate(){QE("idx_dlgOkButton",Q("d2updateCheck").checked)}function server_showErrorsDlgEx(){meshserver.send({action:"serverclearerrorlog"})}var currentMesh;function p20updateMesh(){if(currentMesh==null){return}QH("p20meshName",EscapeHtml(currentMesh.name));var j="Unknown #"+currentMesh.mtype;var h=0;try{h=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights}catch(c){}if(currentMesh.mtype==1){j="Intel® AMT only, no agent"}if(currentMesh.mtype==2){j="Managed using a software agent"}var o="";o+=addHtmlValue("Name",addLinkConditional(EscapeHtml(currentMesh.name),"p20editmesh(1)",(h&1)!=0));o+=addHtmlValue("Description",addLinkConditional(((currentMesh.desc&¤tMesh.desc!="")?EscapeHtml(currentMesh.desc):"<i>None</i>"),"p20editmesh(2)",(h&1)!=0));var g=[];if(currentMesh.flags){if(currentMesh.flags&1){g.push("Auto-Remove")}}g=g.join(", ");if(g==""){g="<i>None</i>"}o+=addHtmlValue("Features",addLinkConditional(g,"p20editmeshfeatures()",(h&1)!=0));o+=addHtmlValue("Type",j);if(currentMesh.mtype==2){var e="No Policy";if(currentMesh.amt){if(currentMesh.amt.type==1){e="Deactivate Client Control Mode (CCM)"}else{if(currentMesh.amt.type==2){e="Simple Client Control Mode (CCM)";if(currentMesh.amt.cirasetup==2){e+=" + CIRA"}}}}o+=addHtmlValue("Intel® AMT",addLinkConditional(e,"p20editMeshAmt()",(h&4294967295)!=0))}if(h&1){o+='<br><input type=button value=Notes title="View notes about this device group" onclick=showNotes(false,"'+encodeURIComponent(currentMesh._id)+'") />'}o+="<br style=clear:both><br>";var b=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()];if(b&&((b.rights&2)!=0)){o+="<a onclick=p20showAddMeshUserDialog() style=cursor:pointer;margin-right:10px><img src=images/icon-addnew.png border=0 height=12 width=12> Add User</a>"}if((h&4)!=0){if(currentMesh.mtype==1){o+='<a onclick=addCiraDeviceToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new Intel® AMT computer that is located on the internet."><img src=images/icon-installmesh.png border=0 height=12 width=12> Install CIRA</a>';o+='<a onclick=addDeviceToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new Intel® AMT computer that is located on the local network."><img src=images/icon-installmesh.png border=0 height=12 width=12> Install local</a>'}if(currentMesh.mtype==2){o+='<a onclick=addAgentToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Add a new computer to this mesh by installing the mesh agent."><img src=images/icon-addnew.png border=0 height=12 width=12> Install</a>';if(features&64){o+='<a onclick=inviteAgentToMesh("'+currentMesh._id+'") style=cursor:pointer;margin-right:10px title="Invite someone to install the mesh agent on this mesh."><img src=images/icon-addnew.png border=0 height=12 width=12> Invite</a>'}}}o+='<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:left;width:430px>User Authorizations</th><th scope=col style=text-align:left></th></tr>';var a=1,m=[];for(var d in currentMesh.links){m.push({id:d,name:d.split("/")[2],rights:currentMesh.links[d].rights})}m.sort(function(p,q){if(p.name>q.name){return 1}if(p.name<q.name){return -1}return 0});for(var d in m){var n="",l="Partial Rights",k=m[d].rights;if(k==4294967295){l="Full Administrator"}else{if(k==0){l="No Rights"}}if((d!=userinfo._id)&&(h==4294967295||(((h&2)!=0)))){n='<a onclick=p20deleteUser(event,"'+encodeURIComponent(m[d].id)+'") title="Remote user rights to this mesh" style=cursor:pointer><img src=images/trash.png border=0 height=10 width=10></a>'}o+='<tr onclick=p20viewuser("'+encodeURIComponent(m[d].id)+'") style=cursor:pointer'+(((a%2)==0)?";background-color:#DDD":"")+'><td><div title="User" class=m2></div><div> '+m[d].name+"<div></div></div></td><td><div style=float:right>"+n+"</div><div>"+l+"</div></td></tr>";++a}o+="</tbody></table>";if(h==4294967295){o+="<div style=font-size:x-small;text-align:right><span><a onclick=p20showDeleteMeshDialog() style=cursor:pointer>Delete Group</a></span></div>"}QH("p20info",o)}function p20editMeshAmt(){if(xxdialogMode){return}var a="";a+=addHtmlValue("Type","<select id=dp20amtpolicy style=width:230px onchange=p20editMeshAmtChange()><option value=0>No Policy</option><option value=1>Deactivate Client Control Mode (CCM)</option><option value=2>Simple Client Control Mode (CCM)</option></select>");a+="<div id=dp20amtpolicydiv></div>";setDialogMode(2,"Intel® AMT Policy",3,p20editMeshAmtEx,a);if(currentMesh.amt){Q("dp20amtpolicy").value=currentMesh.amt.type}p20editMeshAmtChange();if(currentMesh.amt&¤tMesh.amt.type==2){Q("dp20amtpolicypass").value=currentMesh.amt.password;Q("dp20amtbadpass").value=currentMesh.amt.badpass;Q("dp20amtcira").value=currentMesh.amt.cirasetup}dp20amtValidatePolicy()}function p20editMeshAmtChange(){var a=Q("dp20amtpolicy").value,b="";if(a==2){b=addHtmlValue("Password*","<input id=dp20amtpolicypass style=width:230px maxlength=32 onchange=dp20amtValidatePolicy() onkeyup=dp20amtValidatePolicy() />");b+=addHtmlValue("Password mismatch","<select id=dp20amtbadpass style=width:230px><option value=0>Do nothing</option><option value=1>Reactivate Intel® AMT</option></select>");b+=addHtmlValue('<span title="Client Initiated Remote Access">CIRA</span>',"<select id=dp20amtcira style=width:230px><option value=0>Don't configure</option><option value=1>Don't connect to server</option><option value=2>Connect to server</option></select>");b+='<br/><span style="font-size:10px">* Recommanded, leave blank to assign a random password to each device.</span><br/>';b+='<span style="font-size:10px">This policy will not impact devices with Intel® AMT in ACM mode.</span><br/>';b+='<span style="font-size:10px">This is not a secure policy as agents will be performing activation.</span>'}QH("dp20amtpolicydiv",b)}function dp20amtValidatePolicy(){var a=true,c=Q("dp20amtpolicy").value;if(c==2){var b=Q("dp20amtpolicypass").value;a=(b=="")?true:passwordcheck(b)}QE("idx_dlgOkButton",a)}function p20editMeshAmtEx(){var b=parseInt(Q("dp20amtpolicy").value),a={type:b};if(b==2){a={type:b,password:Q("dp20amtpolicypass").value,badpass:parseInt(Q("dp20amtbadpass").value),cirasetup:parseInt(Q("dp20amtcira").value)}}meshserver.send({action:"meshamtpolicy",meshid:currentMesh._id,amtpolicy:a})}function p20showDeleteMeshDialog(){if(xxdialogMode){return}var a='Are you sure you want to delete group "'+EscapeHtml(currentMesh.name)+'"? Deleting the device group will also delete all information about devices within this group.<br /><br />';a+="<input id=p20check type=checkbox onchange=p20validateDeleteMeshDialog() />Confirm";setDialogMode(2,"Delete Group",3,p20showDeleteMeshDialogEx,a);p20validateDeleteMeshDialog()}function p20validateDeleteMeshDialog(){QE("idx_dlgOkButton",Q("p20check").checked)}function p20showDeleteMeshDialogEx(a,b){meshserver.send({action:"deletemesh",meshid:currentMesh._id,meshname:currentMesh.name})}function p20editmesh(a){if(xxdialogMode){return}var b=addHtmlValue("Name","<input id=dp20meshname style=width:230px maxlength=32 onchange=p20editmeshValidate() onkeyup=p20editmeshValidate() />");b+=addHtmlValue("Description","<div style=width:230px;margin:0;padding:0><textarea id=dp20meshdesc maxlength=1024 style=width:100%;resize:none></textarea></div>");setDialogMode(2,"Edit Device Group",3,p20editmeshEx,b);Q("dp20meshname").value=currentMesh.name;if(currentMesh.desc){Q("dp20meshdesc").value=currentMesh.desc}p20editmeshValidate();if(a==2){Q("dp20meshdesc").focus()}else{Q("dp20meshname").focus()}}function p20editmeshEx(){meshserver.send({action:"editmesh",meshid:currentMesh._id,meshname:Q("dp20meshname").value,desc:Q("dp20meshdesc").value})}function p20editmeshValidate(){QE("idx_dlgOkButton",Q("dp20meshname").value.length>0)}function p20editmeshfeatures(){if(xxdialogMode){return}var a=(currentMesh.flags)?currentMesh.flags:0;var b="<div><input type=checkbox id=d20flag1 "+((a&1)?"checked":"")+">Remove device on disconnect<br></div>";setDialogMode(2,"Edit Device Group Features",3,p20editmeshfeaturesEx,b)}function p20editmeshfeaturesEx(){var a=0;if(Q("d20flag1").checked){a+=1}meshserver.send({action:"editmesh",meshid:currentMesh._id,flags:a})}function p20showAddMeshUserDialog(){if(xxdialogMode){return}var a="Allow a user to manage this device group and devices in this group<br /><br />";a+=addHtmlValue("User Name","<input id=dp20username style=width:230px maxlength=32 onchange=p20validateAddMeshUserDialog() onkeyup=p20validateAddMeshUserDialog() />");a+="<br><div>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20fulladmin>Full Administrator<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editmesh>Edit Device Group<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20manageusers>Manage Device Group Users<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20managecomputers>Manage Device Group Computers<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remotecontrol>Remote Control<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshagentconsole>Mesh Agent Console<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20meshserverfiles>Server Files<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20wakedevices>Wake Devices<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20editnotes>Edit Device Notes<br>";a+="<input type=checkbox onchange=p20validateAddMeshUserDialog() id=p20remoteview>Remote View Only<br>";a+="</div>";setDialogMode(2,"Add User to Device Group",3,p20showAddMeshUserDialogEx,a);p20validateAddMeshUserDialog();Q("dp20username").focus()}function p20validateAddMeshUserDialog(){var a=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights;QE("idx_dlgOkButton",(Q("dp20username").value.length>0));QE("p20fulladmin",a==4294967295);QE("p20editmesh",(!Q("p20fulladmin").checked)&&(a==4294967295));QE("p20manageusers",!Q("p20fulladmin").checked);QE("p20managecomputers",!Q("p20fulladmin").checked);QE("p20remotecontrol",!Q("p20fulladmin").checked);QE("p20meshagentconsole",!Q("p20fulladmin").checked);QE("p20meshserverfiles",!Q("p20fulladmin").checked);QE("p20wakedevices",!Q("p20fulladmin").checked);QE("p20editnotes",!Q("p20fulladmin").checked);QE("p20remoteview",!Q("p20fulladmin").checked)}function p20showAddMeshUserDialogEx(){var a=0;if(Q("p20fulladmin").checked==true){a=4294967295}else{if(Q("p20editmesh").checked==true){a+=1}if(Q("p20manageusers").checked==true){a+=2}if(Q("p20managecomputers").checked==true){a+=4}if(Q("p20remotecontrol").checked==true){a+=8}if(Q("p20meshagentconsole").checked==true){a+=16}if(Q("p20meshserverfiles").checked==true){a+=32}if(Q("p20wakedevices").checked==true){a+=64}if(Q("p20editnotes").checked==true){a+=128}if(Q("p20remoteview").checked==true){a+=256}}meshserver.send({action:"addmeshuser",meshid:currentMesh._id,meshname:currentMesh.name,username:Q("dp20username").value,meshadmin:a})}function p20viewuser(e){if(xxdialogMode){return}e=decodeURIComponent(e);var d="",b=currentMesh.links["user/"+domain+"/"+userinfo.name.toLowerCase()].rights,c=currentMesh.links[e].rights;if(c==4294967295){d=", Full Administrator (all rights)"}else{if((c&1)!=0){d+=", Edit Device Group"}if((c&2)!=0){d+=", Manage Device Group Users"}if((c&4)!=0){d+=", Manage Device Group Computers"}if((c&8)!=0){d+=", Remote Control"}if((c&16)!=0){d+=", Agent Console"}if((c&32)!=0){d+=", Server Files"}if((c&64)!=0){d+=", Wake Devices"}if((c&128)!=0){d+=", Edit Notes"}if((c&256)!=0){d+=", Remote View Only"}}d=d.substring(2);if(d==""){d="No Rights"}var a=1,g=addHtmlValue("User Name",e.split("/")[2]);g+=addHtmlValue("Permissions",d);if((("user/"+domain+"/"+userinfo.name.toLowerCase())!=e)&&(b==4294967295||(((b&2)!=0)&&(c!=4294967295)))){a+=4}setDialogMode(2,"Device Group User",a,p20viewuserEx,g,e)}function p20viewuserEx(a,b){if(a!=2){return}setDialogMode(2,"Remote Mesh User",3,p20viewuserEx2,"Confirm removal of user "+b.split("/")[2]+"?",b)}function p20deleteUser(a,b){haltEvent(a);p20viewuserEx(2,decodeURIComponent(b))}function p20viewuserEx2(a,b){meshserver.send({action:"removemeshuser",meshid:currentMesh._id,meshname:currentMesh.name,userid:b})}var filetreelinkpath;var filetreelocation=[];function updateFiles(){QV("MainMenuMyFiles",((features&8)==0));if((features&8)!=0){return}var q="",r="",c="<a style=cursor:pointer onclick=p5folderup(0)>Root</a>",o="Root",y,k=filetree,m=1;var j=[],v=filetreelinkpath,b=[],a=document.getElementsByName("fc");for(var s=0;s<a.length;s++){if(a[s].checked){b.push(a[s].value)}}filetreelinkpath="";for(var s in filetreelocation){if((k.f!=null)&&(k.f[filetreelocation[s]]!=null)){j.push(filetreelocation[s]);o+=" / "+filetreelocation[s];if((m==1)){var B=filetreelocation[s].split("/");y=window.location+B[0]+"files/"+B[2];filetreelinkpath+=filetreelocation[s]}else{if(filetreelinkpath!=""){filetreelinkpath+="/"+filetreelocation[s];if(m>2){y+="/"+filetreelocation[s]}}}k=k.f[filetreelocation[s]];c+=" / <a style=cursor:pointer onclick=p5folderup("+m+")>"+(k.n!=null?k.n:filetreelocation[s])+"</a>";m++}else{break}}filetreelocation=j;var w=o.toLowerCase().startsWith("root / "+userinfo._id+" / public");var l=p5sort_files(k.f);for(var s in l){var d=l[s],u=d.n,A;A=u;if(u.length>70){A='<span title="'+EscapeHtml(u)+'">'+EscapeHtml(u.substring(0,70))+"...</span>"}else{A=EscapeHtml(u)}u=EscapeHtml(u);var g="";if(d.d!=null){var e=new Date(d.d),g=(e.getMonth()+1)+"/"+(e.getDate())+"/"+e.getFullYear()+" "+e.toLocaleTimeString()+" "}var n="";if(d.s!=null){n=getFileSizeStr(d.s)}var p="";if(d.t<3||d.t==4){var z=(d.t==1||d.t==4)?p5getQuotabar(d):"",C="";p="<div class=filelist file=999><input file=999 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+u+"'> <span style=float:right title=\""+C+'">'+z+"</span><span><div class=fileIcon"+d.t+' onclick=p5folderset("'+encodeURIComponent(d.nx)+'")></div><a style=cursor:pointer onclick=p5folderset("'+encodeURIComponent(d.nx)+'")>'+A+"</a></span></div>"}else{var t=A;var x="";if(w){x=' (<a style=cursor:pointer title="Display public link" onclick=\'p5showPublicLink("'+y+"/"+d.nx+"\")'>Link</a>)"}if(d.s>0){t='<a rel="noreferrer noopener" target="_blank" href="downloadfile.ashx?link='+encodeURIComponent(filetreelinkpath+"/"+d.nx)+'">'+A+"</a>"+x}p="<div class=filelist file=3><input file=3 style=float:left name=fc class=fcb type=checkbox onchange=p5setActions() value='"+d.nx+"'> <span class=fsize>"+g+"</span><span style=float:right>"+n+"</span><span><div class=fileIcon"+d.t+"></div>"+t+"</span></div>"}if(d.t<3){q+=p}else{r+=p}}QH("p5rightOfButtons",p5getQuotabar(k));QH("p5files",q+r);QH("p5currentpath",c);QE("p5FolderUp",filetreelocation.length!=0);QV("p5PublicShare",w);if(v==filetreelinkpath){a=document.getElementsByName("fc");for(var s=0;s<a.length;s++){a[s].checked=(b.indexOf(a[s].value)>=0)}}p5setActions()}function getNiceSize(a){if(a<=0){return"Storage limit exceed"}if(a<2048){return a+" bytes remaining"}if(a<2097152){return Math.round(a/1024)+" kilobytes remaining"}if(a<2147483648){return Math.round(a/1024/1024)+" megabytes remaining"}return Math.round(a/1024/1024/1024)+" gigabytes remaining"}function getNiceSize2(a){if(a<=0){return"None"}if(a<2048){return a+" b"}if(a<2097152){return Math.round(a/1024)+" Kb"}if(a<2147483648){return Math.round(a/1024/1024)+" Mb"}return Math.round(a/1024/1024/1024)+" Gb"}function p5getQuotabar(a){while(a.t>1&&a.t!=4){a=a.parent}if((a.t!=1&&a.t!=4)||(a.maxbytes==null)){return""}var b=Math.floor(a.s/1024),c=(a.maxbytes-a.s);return'<span title="'+b+"k in "+a.c+" file"+(a.c>1?"s":"")+". "+(Math.floor(a.maxbytes/1024/1024))+'k maxinum">'+getNiceSize(c)+" <progress style=height:10px;width:100px value="+a.s+" max="+a.maxbytes+" /></span>"}function p5showPublicLink(a){setDialogMode(2,"Public Link",1,null,'<input type=text style=width:100% value="'+a+'" readonly />')}var sortorder;function p5sort_filename(c,d){if(c.ln>d.ln){return(1*sortorder)}if(c.ln<d.ln){return(-1*sortorder)}return 0}function p5sort_timestamp(c,d){if(c.d>d.d){return(1*sortorder)}if(c.d<d.d){return(-1*sortorder)}return 0}function p5sort_bysize(c,d){if(c.s==d.s){return p5sort_filename(c,d)}return(((c.s-d.s))*sortorder)}function p5sort_files(a){var c=[],d=Q("p5sortdropdown").value;for(var b in a){a[b].nx=b;if(a[b].n==null){a[b].n=b}a[b].ln=a[b].n.toLowerCase();c.push(a[b])}sortorder=1;if(d>3){sortorder=-1;d-=3}if(d==1){c.sort(p5sort_filename)}else{if(d==2){c.sort(p5sort_bysize)}else{if(d==3){c.sort(p5sort_timestamp)}}}return c}function p5setActions(){var a=getFileSelCount(),c=getFileCount(),b=getFileSelCount(false);QE("p5DeleteFileButton",(a>0)&&(filetreelocation.length>0));QE("p5NewFolderButton",filetreelocation.length>0);QE("p5UploadButton",filetreelocation.length>0);QE("p5RenameFileButton",(a==1)&&(filetreelocation.length>0));QE("p5SelectAllButton",c>0);Q("p5SelectAllButton").value=(a>0?"Select None":"Select All");QE("p5CutButton",(b>0)&&(a==b));QE("p5CopyButton",(b>0)&&(a==b));QE("p5PasteButton",(p5clipboard!=null)&&(p5clipboard.length>0)&&(filetreelocation.length>0))}function getFileSelCount(d){var a=0,b=document.getElementsByName("fc");for(var c=0;c<b.length;c++){if((b[c].checked)&&((d!=false)||(b[c].attributes.file.value=="3"))){a++}}return a}function getFileSelDirCount(){var a=0,b=document.getElementsByName("fc");for(var c=0;c<b.length;c++){if((b[c].checked)&&(b[c].attributes.file.value=="999")){a++}}return a}function getFileCount(){var a=0;var b=document.getElementsByName("fc");return b.length}function p5selectallfile(){var c=(getFileSelCount()==0),a=document.getElementsByName("fc");for(var b=0;b<a.length;b++){a[b].checked=c}p5setActions()}function setupBackPointers(d){if(d.f!=null){var b=0,a=0;for(var c in d.f){setupBackPointers(d.f[c]);d.f[c].parent=d;if(d.f[c].s){b+=d.f[c].s}if(d.f[c].c){a+=d.f[c].c}if(d.f[c].t==3){a++}}d.s=b;d.c=a}return d}function getFileSizeStr(a){if(a==1){return"1 byte"}return""+a+" bytes"}function p5folderup(a){if(a==null){filetreelocation.pop()}else{while(filetreelocation.length>a){filetreelocation.pop()}}updateFiles()}function p5folderset(a){filetreelocation.push(decodeURIComponent(a));updateFiles()}function p5createfolder(){setDialogMode(2,"New Folder",3,p5createfolderEx,"<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% />");focusTextBox("p5renameinput");p5fileNameCheck()}function p5createfolderEx(){meshserver.send({action:"fileoperation",fileop:"createfolder",path:filetreelocation,newfolder:Q("p5renameinput").value})}function p5deletefile(){var a=getFileSelCount(),b=(getFileSelDirCount()>0)?"<br /><br /><input type=checkbox id=p5recdeleteinput>Recursive delete<br>":"<input type=checkbox id=p5recdeleteinput style='display:none'>";setDialogMode(2,"Delete",3,p5deletefileEx,(a>1)?("Delete "+a+" selected items?"+b):("Delete selected item?"+b))}function p5deletefileEx(){var b=[],a=document.getElementsByName("fc");for(var c=0;c<a.length;c++){if(a[c].checked){b.push(a[c].value)}}meshserver.send({action:"fileoperation",fileop:"delete",path:filetreelocation,delfiles:b,rec:Q("p5recdeleteinput").checked})}function p5renamefile(){var c,a=document.getElementsByName("fc");for(var b=0;b<a.length;b++){if(a[b].checked){c=a[b].value}}setDialogMode(2,"Rename",3,p5renamefileEx,'<input type=text id=p5renameinput maxlength=64 onkeyup=p5fileNameCheck(event) style=width:100% value="'+c+'" />',{action:"fileoperation",fileop:"rename",path:filetreelocation,oldname:c});focusTextBox("p5renameinput");p5fileNameCheck()}function p5renamefileEx(a,c){c.newname=Q("p5renameinput").value;meshserver.send(c)}function p5fileNameCheck(a){var b=isFilenameValid(Q("p5renameinput").value);QE("idx_dlgOkButton",b);if((b==true)&&(a&&a.keyCode==13)){dialogclose(1)}}var isFilenameValid=(function(){var b=/^[^\\/:\*\?"<>\|]+$/,c=/^\./,d=/^(nul|prn|con|lpt[0-9]|com[0-9])(\.|$)/i;return function a(e){return b.test(e)&&!c.test(e)&&!d.test(e)&&(e[0]!=".")}})();function p5uploadFile(){setDialogMode(2,"Upload File",3,p5uploadFileEx,'<form method=post enctype=multipart/form-data action=uploadfile.ashx target=fileUploadFrame><input type=text name=link style=display:none id=p5uploadpath value="'+encodeURIComponent(filetreelinkpath)+'" /><input type=file name=files id=p5uploadinput style=width:100% multiple=multiple onchange="updateUploadDialogOk(\'p5uploadinput\')" /><input type=submit id=p5loginSubmit style=display:none /></form>');updateUploadDialogOk("p5uploadinput")}function p5uploadFileEx(){Q("p5loginSubmit").click()}function updateUploadDialogOk(a){QE("idx_dlgOkButton",Q(a).value!="")}var p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;function p5copyFile(b){var a=document.getElementsByName("fc");p5clipboard=[];p5clipboardCut=b,p5clipboardFolder=Clone(filetreelocation);for(var c=0;c<a.length;c++){if((a[c].checked)&&(a[c].attributes.file.value=="3")){p5clipboard.push(a[c].value)}}p5updateClipview()}function p5pasteFile(){var a="";if((p5clipboard!=null)&&(p5clipboard.length>0)){a="Confim "+(p5clipboardCut==0?"copy":"move")+" of "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" to this location?"}setDialogMode(2,"Paste",3,p5pasteFileEx,a)}function p5pasteFileEx(){meshserver.send({action:"fileoperation",fileop:(p5clipboardCut==0?"copy":"move"),scpath:p5clipboardFolder,path:filetreelocation,names:p5clipboard});p5folderup(999);if(p5clipboardCut==1){p5clipboard=null,p5clipboardFolder=null,p5clipboardCut=0;p5updateClipview()}}function p5updateClipview(){var a="";if((p5clipboard!=null)&&(p5clipboard.length>0)){a="Holding "+p5clipboard.length+" entrie"+((p5clipboard.length>1)?"s":"")+" for "+(p5clipboardCut==0?"copy":"move")+", <a onclick=p5clearClip() style=cursor:pointer>Clear</a>."}QH("p5bottomstatus",a);p5setActions()}function p5clearClip(){p5clipboard=null;p5clipboardFolder=null;p5clipboardCut=0;p5updateClipview()}function p5fileDragDrop(b){if(xxdialogMode){return}haltEvent(b);QV("bigfail",false);QV("bigok",false);var c=0;p5uploadFile();try{Q("p5uploadinput").files=b.dataTransfer.files}catch(d){c=1}if(c==0){p5uploadFileEx()}setDialogMode(0);if(c==1){if(b.dataTransfer==null||b.dataTransfer.files.length==0||filetreelocation.length==0){return}var j=[],m=[],o=[],a=[],l=b.dataTransfer.files.length,n=0;for(var h=0;h<b.dataTransfer.files.length;h++){n+=b.dataTransfer.files[h].size}if(n>1300000){p5uploadFile();return}for(var h=0;h<b.dataTransfer.files.length;h++){var k=new FileReader(),g=b.dataTransfer.files[h];j.push(g.name);m.push(g.size);o.push(g.type);k.onload=function(e){a.push(e.target.result);if(--l==0){Q("p5fileDragName").value=j.join("*");Q("p5fileDragSize").value=m.join("*");Q("p5fileDragType").value=o.join("*");Q("p5fileDragData").value=a.join("*");Q("p5fileDragLink").value=encodeURIComponent(filetreelinkpath);Q("p5loginSubmit2").click()}};k.readAsDataURL(g)}}}var p5dragtimer=null;function p5fileDragOver(b){if(xxdialogMode){return}haltEvent(b);if(p5dragtimer!=null){clearTimeout(p5dragtimer);p5dragtimer=null}var a=true;if(filetreelocation.length==0){a=false}QV("bigok",a);QV("bigfail",!a)}function p5fileDragLeave(a){if(xxdialogMode){return}haltEvent(a);if(a.target.id!="p5filetable"){QV("bigfail",false);QV("bigok",false)}else{p5dragtimer=setTimeout(function(){QV("bigfail",false);QV("bigok",false);p5dragtimer=null},10)}}function eventMouseHover(a,b){a.children[1].classList.remove("g1s");a.children[2].style["background-color"]=((b==0)?"#c9c9c9":"#b9b9b9");a.children[3].classList.remove("g2s");if(b==1){a.children[1].classList.add("g1s");a.children[3].classList.add("g2s")}}function eventsUpdate(){var h="",a=null;for(var c in events){var b=events[c],g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td colspan=4 class=DevSt>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");if(b.username&&b.username!=userinfo.name){e+=": "+b.username}h+="<tr onmouseover=eventMouseHover(this,1) onmouseout=eventMouseHover(this,0) style=cursor:pointer><td style=width:18px><div class="+d+"></div></td><td class=g1 style=float:none> </td><td style=background-color:#C9C9C9>"+g.toLocaleTimeString()+" - "+e+"</td><td class=g2 style=float:none> </td></tr><tr style=height:2px></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p3events",h)}function showDeleteAllEventsDialog(){if(xxdialogMode){return}var a="Delete all events in the server event log?<br /><br />";a+="<input id=p3check type=checkbox onchange=validateDeleteAllEventsDialog() />Confirm";setDialogMode(2,"Delete All Events",3,showDeleteAllEventsDialogEx,a);validateDeleteAllEventsDialog()}function validateDeleteAllEventsDialog(){QE("idx_dlgOkButton",Q("p3check").checked)}function showDeleteAllEventsDialogEx(a,b){meshserver.send({action:"clearevents"})}function refreshEvents(){meshserver.send({action:"events",limit:parseInt(p3limitdropdown.value)})}function updateUsers(){QV("MainMenuMyUsers",(users!=null)&&((features&4)==0));QV("LeftMenuMyUsers",(users!=null)&&((features&4)==0));if((users==null)||((features&4)!=0)){QH("p3users","");return}var g=[],d=100,b=0;for(var c in users){g.push(c)}g.sort();var j=Q("UserSearchInput").value.toLowerCase();var k="<table style=width:100% cellpadding=0 cellspacing=0>",a=true;for(var c in g){var h=users[g[c]],e=null;if(wssessions!=null){e=wssessions[h._id]}if((e!=null)&&(h.name.toLowerCase().indexOf(j)>=0)){if(d>0){if(a){k+="<tr><td class=userTableHeader>Online Users";a=false}k+=addUserHtml(h,e);d--}else{b++}}}a=true;for(var c in g){var h=users[g[c]],e=null;if(wssessions!=null){e=wssessions[h._id]}if((e==null)&&(h.name.toLowerCase().indexOf(j)>=0)){if(d>0){if(a){k+="<tr><td class=userTableHeader>Offline Users";a=false}k+=addUserHtml(h,e);d--}else{b++}}}k+="</table>";if(b==1){k+="<br />1 more user not shown, use search box to look for users...<br />"}else{if(b>1){k+="<br />"+b+" more users not shown, use search box to look for users...<br />"}}if(d==100){k+="<br />No users found.<br />"}QH("p3users",k);if((currentUser!=null)&&(xxcurrentView==30)){gotoUser(encodeURIComponent(currentUser._id),true)}}function addUserHtml(j,h){var l="",b=" gray",c="m2",d="",e="",g=(j.name!=userinfo.name);if(h!=null){b="";if(g){e='<span style=float:right;margin-top:1px;margin-right:4px title=Chat><a onclick=userChat(event,"'+encodeURIComponent(j._id)+'","'+encodeURIComponent(j.name)+"\")><img src='images/icon-chat.png' height=16 width=16 style=padding-top:2px /></a></span>";e+='<span style=float:right;margin-top:1px;margin-left:4px;margin-right:4px title=Notify><a onclick=showUserAlertDialog(event,"'+encodeURIComponent(j._id)+"\")><img src='images/icon-notify.png' height=16 width=16 style=padding-top:2px /></a></span>"}if(h==1){d+="1 active session"}else{d+=h+" active sessions"}}else{if(j.login){d+='<span title="Last login: '+new Date(j.login*1000).toLocaleString()+'">'+new Date(j.login*1000).toLocaleDateString()+"</span>"}}if(d!=""){d+=", "}if(g){d+='<a onclick=showUserAdminDialog(event,"'+encodeURIComponent(j._id)+'")>'}if((j.siteadmin!=null)&&((j.siteadmin&32)!=0)&&(j.siteadmin!=4294967295)){d+="Locked, "}d+="<span title='Server Permissions'>";if((j.siteadmin==null)||(j.siteadmin==0)||(j.siteadmin==32)){d+="User"}else{if(j.siteadmin==8){d+="User with server files"}else{if(j.siteadmin==4294967295){d+="Administrator"}else{d+="Partial"}}}d+="</span>";if((j.quota!=null)&&((j.siteadmin&8)!=0)){d+=", "+(j.quota/1024)+" k"}if(g){d+="</a>"}var k=EscapeHtml(j.name),a="";if(serverinfo.emailcheck==true){a=((j.emailVerified!=true)?' <b style=color:red title="Email is not verified">🗴</b>':' <b style=color:green title="Email is verified">🗸</b>')}if(j.email!=null){k+=', <a onclick=doemail(event,"'+j.email+'")>'+j.email+"</a>"+a}if((j.otpsecret>0)||(j.otphkeys>0)){k+=' <img src="images/key12.png" height=12 width=11 title="2nd factor authentication enabled" style="margin-top:2px" />'}if((j.siteadmin!=null)&&((j.siteadmin&32)!=0)&&(j.siteadmin!=4294967295)){k+=' <img src="images/padlock12.png" height=12 width=8 title="Account is locked" style="margin-top:2px" />'}l+='<tr onmouseover=userMouseHover(this,1) onmouseout=userMouseHover(this,0)><td style=cursor:pointer onclick=gotoUser("'+encodeURIComponent(j._id)+'")>';l+="<div class=bar style=height:24px;width:100%;font-size:medium>";l+='<div style=float:left;height:24px;width:24px;background-color:white><div class="'+c+b+'" style=width:16px;margin-top:4px;margin-left:2px;height:16px></div></div>';l+="<div class=g1 style=height:24px;float:left></div><div class=g2 style=height:24px;float:right></div>";l+="<div><span>"+k+"</span>"+e+"<span style=float:right>"+d+"</span></div></div>";return l}function userMouseHover(b,c){var a=b.children[0].children[0];a.children[1].classList.remove("g1s");a.children[2].classList.remove("g2s");if(c==1){a.children[1].classList.add("g1s");a.children[2].classList.add("g2s")}b.children[0].children[0].style["background-color"]=((c==0)?"#c9c9c9":"#b9b9b9")}function userChat(a,d,b){haltEvent(a);var c="/messenger?id=meshmessenger/"+d+"/"+encodeURIComponent(userinfo._id)+"&title="+b;if((authCookie!=null)&&(authCookie!="")){c+="&auth="+authCookie}window.open(c,"meshmessenger:"+d);meshserver.send({action:"meshmessenger",userid:decodeURIComponent(d)});return false}function showUserAlertDialog(a,b){if(xxdialogMode){return}haltEvent(a);setDialogMode(2,"Notify "+EscapeHtml(users[decodeURIComponent(b)].name),3,showUserAlertDialogEx,'Send a text notification to this user.<textarea id=d2notifyText maxlength=2048 style="width:100%;height:184px;resize:none"></textarea>',b);Q("d2notifyText").focus();return false}function showUserAlertDialogEx(a,b){meshserver.send({action:"notifyuser",userid:decodeURIComponent(b),msg:Q("d2notifyText").value})}function doemail(b,a){if(xxdialogMode){return}haltEvent(b);window.open("mailto:"+a);return false}function showUserBroadcastDialog(){if(xxdialogMode){return}var a='Broadcast a message to all connected users.<textarea id=broadcastMessage value="" style=width:370px;height:100px;resize:none maxlength=256 /></textarea>';setDialogMode(2,"Broadcast Message",3,showUserBroadcastDialogEx,a);Q("broadcastMessage").focus()}function showUserBroadcastDialogEx(){meshserver.send({action:"userbroadcast",msg:Q("broadcastMessage").value})}function showCreateNewAccountDialog(){if(xxdialogMode){return}var c="";c+=addHtmlValue("Name","<input id=p4name style=width:230px maxlength=64 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Email","<input id=p4email style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Password","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");c+=addHtmlValue("Password","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate() onkeyup=showCreateNewAccountDialogValidate() />");if(passRequirements){var b=[];for(var a in passRequirements){b.push(a+":"+passRequirements[a])}c+="<div style=font-size:x-small;padding:6px>Requirements: "+b.join(", ")+".</div>"}setDialogMode(2,"Create Account",3,showCreateNewAccountDialogEx,c);showCreateNewAccountDialogValidate();Q("p4name").focus()}function showCreateNewAccountDialogValidate(b){if((b==null)&&(Q("p4email").value.length>0)&&(validateEmail(Q("p4email").value))==false){QE("idx_dlgOkButton",false);return}var a=(!Q("p4name")||((Q("p4name").value.length>0)&&(Q("p4name").value.indexOf(" ")==-1)))&&Q("p4pass1").value.length>0&&Q("p4pass1").value==Q("p4pass2").value&&checkPasswordRequirements(Q("p4pass1").value,passRequirements);if(a&&passRequirements){if(checkPasswordRequirements(Q("p4pass1").value,passRequirements)==false){a=false}}QE("idx_dlgOkButton",a)}function showCreateNewAccountDialogEx(){meshserver.send({action:"adduser",username:Q("p4name").value,email:Q("p4email").value,pass:Q("p4pass1").value})}function showUserAdminDialog(a,c){if(xxdialogMode){return}haltEvent(a);c=decodeURIComponent(c);var d="<div>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fileaccess>Server Files, <input type=number onchange=showUserAdminDialogValidate() maxlength=10 style=width:80px;text-align:right id=ua_fileaccessquota>k max, blank for default<br><hr/>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_fulladmin>Full Administrator<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverbackup>Server Backup<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverrestore>Server Restore<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_serverupdate>Server Updates<br>";d+="<input type=checkbox onchange=showUserAdminDialogValidate() id=ua_manageusers>Manage Users<br>";d+="<hr/><input type=checkbox onchange=showUserAdminDialogValidate() id=ua_lockedaccount>Lock Account<br>";d+="</div>";var b=users[c.toLowerCase()];setDialogMode(2,"Server Permissions",3,showUserAdminDialogEx,d,b);if(b.siteadmin&&b.siteadmin!=0){Q("ua_fulladmin").checked=(b.siteadmin==4294967295);Q("ua_serverbackup").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&1)!=0));Q("ua_manageusers").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&2)!=0));Q("ua_serverrestore").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&4)!=0));Q("ua_fileaccess").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&8)!=0));Q("ua_serverupdate").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&16)!=0));Q("ua_lockedaccount").checked=((b.siteadmin!=4294967295)&&((b.siteadmin&32)!=0))}QE("ua_fulladmin",userinfo.siteadmin==4294967295);QE("ua_serverbackup",userinfo.siteadmin==4294967295);QE("ua_manageusers",userinfo.siteadmin==4294967295);QE("ua_serverrestore",userinfo.siteadmin==4294967295);QE("ua_fileaccess",userinfo.siteadmin==4294967295);QE("ua_serverupdate",userinfo.siteadmin==4294967295);Q("ua_fileaccessquota").value=(b.quota!=null)?(b.quota/1024):"";showUserAdminDialogValidate();return false}function showUserAdminDialogValidate(){if(userinfo.siteadmin==4294967295){QE("ua_serverbackup",!Q("ua_fulladmin").checked);QE("ua_manageusers",!Q("ua_fulladmin").checked);QE("ua_serverrestore",!Q("ua_fulladmin").checked);QE("ua_fileaccess",!Q("ua_fulladmin").checked);QE("ua_serverupdate",!Q("ua_fulladmin").checked);QE("ua_fileaccessquota",Q("ua_fileaccess").checked&&!Q("ua_fulladmin").checked)}}function showUserAdminDialogEx(a,d){var c=0,b=parseInt(Q("ua_fileaccessquota").value);if(Q("ua_fulladmin").checked==true){c=4294967295}else{if(Q("ua_serverbackup").checked==true){c+=1}if(Q("ua_manageusers").checked==true){c+=2}if(Q("ua_serverrestore").checked==true){c+=4}if(Q("ua_fileaccess").checked==true){c+=8}if(Q("ua_serverupdate").checked==true){c+=16}if(Q("ua_lockedaccount").checked==true){c+=32}}var e={action:"edituser",name:d.name,siteadmin:c};if(isNaN(b)==false){e.quota=(b*1024)}meshserver.send(e)}function onUserSearchInputChanged(){updateUsers()}var currentUser=null;function gotoUser(n,g){if(xxdialogMode&&!g){return}var m=currentUser=users[decodeURIComponent(n)];if(m==null){setDialogMode(0);go(4);return}QH("p30userName",m.name);QH("p31userName",m.name);var l=(m.name==userinfo.name),a=0;if(wssessions!=null&&wssessions[m._id]){a=wssessions[m._id]}Q("MainUserImage").classList.remove("gray");if(a==0){Q("MainUserImage").classList.add("gray")}var h="",k="";if((m.siteadmin!=null)&&((m.siteadmin&32)!=0)&&(m.siteadmin!=4294967295)){k='<img src="images/padlock12.png" height=12 width=8 title="Account is locked" style="margin-top:2px" /> ';h+="Locked account, "}if((m.siteadmin==null)||(m.siteadmin==0)||(m.siteadmin==32)){h+="No server rights"}else{if(m.siteadmin==8){h+="Access to server files"}else{if(m.siteadmin==4294967295){h+="Full administrator"}else{h+="Partial rights"}}}var o="<div style=min-height:80px><table style=width:100%>";var c=m.email?EscapeHtml(m.email):"<i>Not set</i>",d="";if(serverinfo.emailcheck){d=((m.emailVerified==true)?'<b style=color:green;cursor:pointer title="Email is verified">🗸</b> ':'<b style=color:red;cursor:pointer title="Email not verified">🗴</b> ')}o+=addDeviceAttribute("Email",d+'<a style=cursor:pointer onclick=p30showUserEmailChangeDialog(event,"'+n+'")>'+c+'</a> <a style=cursor:pointer onclick=doemail(event,"'+m.email+'")><img class=hoverButton width=10 height=10 src="images/link1.png" /></a>');o+=addDeviceAttribute("Server Rights",k+'<a style=cursor:pointer onclick=showUserAdminDialog(event,"'+n+'")>'+h+"</a>");if(m.quota){o+=addDeviceAttribute("Server Quota",EscapeHtml(parseInt(m.quota)/1024)+" k")}o+=addDeviceAttribute("Creation",new Date(m.creation*1000).toLocaleString());if(m.login){o+=addDeviceAttribute("Last Login",new Date(m.login*1000).toLocaleString())}var j=0;if((m.otpsecret>0)||(m.otphkeys>0)){j=1;var e=[];if(m.otpsecret>0){e.push("Authentication App")}if(m.otphkeys>0){e.push("Security Key")}if(m.otpkeys>0){e.push("Backup Codes")}o+=addDeviceAttribute("Security",'<img src="images/key12.png" height=12 width=11 title="2nd factor authentication enabled" style="margin-top:2px" /> '+e.join(", "))}o+="</table></div><br />";o+='<input type=button value=Notes title="View notes about this user" onclick=showNotes(false,"'+n+'") />';if(!l&&(a>0)){o+='<input type=button value=Notify title="Send user notification" onclick=showUserAlertDialog(event,"'+n+'") />'}QH("p30html",o);drawUserTimeline();var b=true;if(m._id==userinfo._id){b=false}if(m.siteadmin&&m.siteadmin>0&&userinfo.siteadmin!=4294967295){b=false}o="<div style=float:right;font-size:x-small>";if(b){o+='<a style=cursor:pointer onclick=p30showDeleteUserDialog() title="Remove this user">Delete User</a>'}o+="</div><div style=font-size:x-small>";if(userinfo.siteadmin==4294967295){o+="<a style=cursor:pointer onclick=p30showUserChangePassDialog("+j+') title="Change the password for this user">Change Password</a>'}o+="</div><br>";QH("p30html3",o);o="";if(a==1){o="1 active session"}else{if(a>1){o=a+" active sessions"}}QH("MainUserState",o);go(30);QH("p31events","");refreshUsersEvents()}function p30showUserEmailChangeDialog(a){if(xxdialogMode){return}var b="";b+=addHtmlValue("Email","<input id=dp30email style=width:230px maxlength=32 onchange=p30validateEmail() onkeyup=p30validateEmail() />");if(serverinfo.emailcheck){b+=addHtmlValue("Status","<select id=dp30verified style=width:230px onchange=p30validateEmail()><option value=0>Not verified</option><option value=1>Verified</option></select>")}setDialogMode(2,"Change Email for "+EscapeHtml(currentUser.name),3,p30showUserEmailChangeDialogEx,b);Q("dp30email").focus();Q("dp30email").value=currentUser.email;if(serverinfo.emailcheck){Q("dp30verified").value=currentUser.emailVerified?1:0}p30validateEmail()}function p30validateEmail(){var a=Q("dp30email").value,b=a.split("@");b=(b.length==2)&&(b[0].length>0)&&(b[1].split(".").length>1)&&(b[1].length>2)&&(a.length<1024)&&((a!=userinfo.email)||((serverinfo.emailcheck==true)&&(Q("dp30verified").value!=(userinfo.emailVerified?1:0))));QE("idx_dlgOkButton",b)}function p30showUserEmailChangeDialogEx(){var a={action:"edituser",name:currentUser.name,email:Q("dp30email").value};if(serverinfo.emailcheck){a.emailVerified=(Q("dp30verified").value==1)}meshserver.send(a)}function p30showUserChangePassDialog(b){if(xxdialogMode){return}var d="";d+=addHtmlValue("Password","<input id=p4pass1 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=showCreateNewAccountDialogValidate(1)></input>");d+=addHtmlValue("Password","<input id=p4pass2 type=password style=width:230px maxlength=256 onchange=showCreateNewAccountDialogValidate(1) onkeyup=showCreateNewAccountDialogValidate(1)></input>");d+=addHtmlValue("Password hint","<input id=p4hint type=text style=width:230px maxlength=256></input>");if(passRequirements){var c=[];for(var a in passRequirements){c.push(a+":"+passRequirements[a])}d+="<div style=font-size:x-small;padding:6px>Requirements: "+c.join(", ")+".</div>"}if(b==1){d+="<div><input id=p4twoFactorRemove type=checkbox />Remove all 2nd factor authentication.</div>"}setDialogMode(2,"Change Password for "+EscapeHtml(currentUser.name),3,p30showUserChangePassDialogEx,d,b);showCreateNewAccountDialogValidate(1);Q("p4pass1").focus()}function p30showUserChangePassDialogEx(a,d){var c=false;if((d==1)&&(Q("p4twoFactorRemove").checked==true)){c=true}if(Q("p4pass1").value==Q("p4pass2").value){meshserver.send({action:"changeuserpass",user:currentUser.name,pass:Q("p4pass1").value,hint:Q("p4hint").value,removeMultiFactor:c})}}function p30showDeleteUserDialog(){if(xxdialogMode){return}setDialogMode(2,"Delete User "+EscapeHtml(currentUser.name),3,p30showDeleteUserDialogEx,"Confirm deletion of user "+EscapeHtml(currentUser.name)+"?")}function p30showDeleteUserDialogEx(){meshserver.send({action:"deleteuser",userid:currentUser._id,username:currentUser.name})}function drawUserTimeline(){var s=null,o=Date.now();s=[];var e=new Date();e.setHours(0,0,0,0);e=new Date(e.getTime()-(1000*60*60*24*6));var u=e.getTime();var t=[];if(s!=null&&s.length>1){t.push([0,s[1],s[0]]);var c=s[1];for(var m=2;m<s.length;m+=2){var p=s[m],k=o;if(s.length>(m+1)){k=s[m+1]}t.push([c,c+k,p]);c=c+k}}var z="",b=1,h=new Date();h.setHours(0,0,0,0);for(var m=0;m<7;m++){var g="",q=h.getTime(),l=q+(1000*60*60*24);for(var n in t){var a=t[n];if(isTimeBlockInside(q,l,a[0],a[1])==true){var w=Math.max(q,a[0]);var r=Math.min(Math.min(l,a[1]),o);var y=Math.round((r-w)/112794);if(y>0){var v=powerStateStrings2[a[2]]+" from "+new Date(w).toLocaleTimeString()+" to "+new Date(r).toLocaleTimeString()+".";g+='<div title="'+v+'" style=display:table-cell;width:'+y+"px;background-color:"+powerColor(a[2])+";height:16px></div>"}}}z+="<tr style="+(((b%2)==0)?"background-color:#DDD":"")+"><td><div> "+h.toLocaleDateString()+"<div></div></div></td><td><div>"+g+"</div></td></tr>";++b;h=new Date(h.getTime()-(1000*60*60*24))}QH("p30html2",'<table style="color:black;background-color:#EEE;border-color:#AAA;border-width:1px;border-style:solid;border-collapse:collapse" border=0 cellpadding=2 cellspacing=0 width=100%><tbody><tr style=background-color:#AAAAAA;font-weight:bold><th scope=col style=text-align:center;width:150px>Day</th><th scope=col style=text-align:center>7 Day Login State</th></tr>'+z+"</tbody></table>")}var currentUserEvents=null;function userEventsUpdate(){var h="",a=null;for(var c in currentUserEvents){var b=currentUserEvents[c];var g=new Date(b.time);if(g.toLocaleDateString()!=a){if(a!=null){h+="</table>"}h+="<table style=width:100% cellpadding=0 cellspacing=0><tr><td class=DevSt>"+g.toLocaleDateString()+"</td></tr>";a=g.toLocaleDateString()}var d="si3";if(b.etype=="user"){d="m2"}if(b.etype=="server"){d="si3"}var e=b.msg.split("(R)").join("®");if(b.username&&b.username!=userinfo.name){e+=": "+b.username}h+="<tr><td><div class=bar18 style=height:18px;width:100%;font-size:medium>";h+="<div style=float:left;height:18px;width:18px;background-color:white><div class="+d+" style=width:16px;margin-top:1px;margin-left:2px;height:16px></div></div>";h+="<div class=g1 style=height:18px;float:left></div><div class=g2 style=height:18px;float:right></div>";h+="<div style=font-size:14px><span style=width:300px>"+g.toLocaleTimeString()+" - "+e+"</span></div></div></td></tr>"}if(a!=null){h+="</table>"}if(h==""){h="<br><i>No Events Found</i><br><br>"}QH("p31events",h)}function refreshUsersEvents(){meshserver.send({action:"events",limit:parseInt(p31limitdropdown.value),user:currentUser.name})}function d3init(){Q("d3localFile").value="";d3modechange()}function d3modechange(){var a=Q("d3uploadMode").value;QV("d3localmode",a==1);QV("d3servermode",a==2);if(a==1){d3setActions()}else{d3updatefiles()}}var d3filetreelinkpath;var d3filetreelocation=[];function d3updatefiles(){if(Q("d3uploadMode").value==1){return}var m="",n="",e=filetree,j=1;var c=[],r=d3filetreelinkpath,b=[],a=document.getElementsByName("fc");for(var o=0;o<a.length;o++){if(a[o].checked){b.push(a[o].value)}}d3filetreelinkpath="";for(var o in d3filetreelocation){if((e.f!=null)&&(e.f[d3filetreelocation[o]]!=null)){c.push(d3filetreelocation[o]);if((j==1)){var t=d3filetreelocation[o].split("/");publicPath=window.location+t[0]+"files/"+t[2];if(d3filetreelocation[o]===userinfo._id){d3filetreelinkpath+="self"}else{d3filetreelinkpath+=(t[0]+"/"+t[2])}}else{if(d3filetreelinkpath!=""){d3filetreelinkpath+="/"+d3filetreelocation[o];if(j>2){publicPath+="/"+d3filetreelocation[o]}}}e=e.f[d3filetreelocation[o]];j++}else{break}}d3filetreelocation=c;var g=p5sort_files(e.f);for(var o in g){var d=g[o],q=d.n,s;s=q;if(q.length>70){s='<span title="'+EscapeHtml(q)+'">'+EscapeHtml(q.substring(0,70))+"...</span>"}else{s=EscapeHtml(q)}q=EscapeHtml(q);var k="";if(d.s!=null){k=getFileSizeStr(d.s)}var l="";if(d.t<3){var u="";l='<div class=filelist file=999><span style=float:right title="'+u+'"></span><span><div class=fileIcon'+d.t+' onclick=d3folderset("'+encodeURIComponent(d.nx)+'")></div> <a style=cursor:pointer onclick=d3folderset("'+encodeURIComponent(d.nx)+'")>'+s+"</a></span></div>"}else{var p=s;l="<div class=filelist file=3><input style=float:left name=fcx class=fcb type=checkbox onchange=d3setActions() value='"+d.nx+"'> <span style=float:right>"+k+"</span><span><div class=fileIcon"+d.t+"></div>"+p+"</span></div>"}if(d.t<3){m+=l}else{n+=l}}QH("d3serverfiles",m+n);QE("p3FolderUp",d3filetreelocation.length>0);d3setActions()}function d3folderset(a){d3filetreelocation.push(decodeURIComponent(a));d3updatefiles()}function d3folderup(a){if(a==null){d3filetreelocation.pop()}else{while(d3filetreelocation.length>a){d3filetreelocation.pop()}}d3updatefiles()}function d3getFileSel(){var a=[];var b=document.getElementsByName("fcx");for(var c=0;c<b.length;c++){if(b[c].checked){a.push(b[c].value)}}return a}function d3setActions(){var a=Q("d3uploadMode").value;if(a==1){QE("idx_dlgOkButton",Q("d3localFile").value.length>0)}else{QE("idx_dlgOkButton",d3getFileSel().length==1)}}var notifications=[];function clickNotificationIcon(a){if(a==true){QV("notifiyBox",true)}else{if(a==false){QV("notifiyBox",false)}else{QV("notifiyBox",QS("notifiyBox")["display"]=="none")}}drawNotifications()}function setNotificationCount(a){if(parseInt(Q("notificationCount").innerHTML)==a){return}QH("notificationCount",a);QS("notificationCount")["background-color"]=(a==0)?"lightblue":"orange";QV("notificationCount",a>0)}function drawNotifications(){var j="";if(notifications.length==0){j="<div style=margin:5px>There are currently no notifications</div>"}else{for(var c in notifications){var g=notifications[c];var k="";var a=new Date(g.time);var e=0;if(g.nodeid!=null){var h=getNodeFromId(g.nodeid);if(h!=null){e=h.icon;k="<b>"+h.name+"</b>: "}}j+='<div title="Occured at '+a.toLocaleString()+'" id="notifyx'+g.id+'" class=notification style="cursor:pointer;border-top:1px solid '+((j=="")?"transparent":"orange")+'"><div class=j'+e+' onclick="notificationSelected('+g.id+')" style=margin:5px;float:left></div><div onclick="notificationDelete('+g.id+')" class=unselectable title="Clear this notification" style=margin:5px;float:right;color:orange><b>X</b></div><div onclick="notificationSelected('+g.id+')" style=margin:5px>'+k+g.text+"</div></div>"}}var b="";if(notifications.length>1){b='<div id="notifyRemoveAll" onclick="deleteAllNotifications()" style="cursor:pointer;border-top:1px solid orange;margin:5px;color:orange;text-align:right;padding-right:3px">Clear all</div>'}QH("notifiyBox",'<div class=customScroll style="max-height:170px;overflow-y:auto;margin:5px">'+j+"</div>"+b)}function notificationSelected(b){var c=-1;for(var a in notifications){if(notifications[a].id==b){c=a}}if(c!=-1){var d=notifications[c];if(d.nodeid!=null){if(d.tag=="desktop"){gotoDevice(d.nodeid,12)}else{if(d.tag=="terminal"){gotoDevice(d.nodeid,11)}else{if(d.tag=="files"){gotoDevice(d.nodeid,13)}else{if(d.tag=="intelamt"){gotoDevice(d.nodeid,14)}else{if(d.tag=="console"){gotoDevice(d.nodeid,15)}else{gotoDevice(d.nodeid,10)}}}}}}else{if(d.tag.startsWith("meshmessenger/")){window.open("/messenger?id="+d.tag+"&title="+encodeURIComponent(d.username),d.tag.split("/")[2]);notificationDelete(b)}}}}function notificationDelete(c){var d=-1,a=Q("notifyx"+c);if(a!=null){for(var b in notifications){if(notifications[b].id==c){d=b}}if(d!=-1){notifications.splice(d,1);a.parentNode.removeChild(a);setNotificationCount(notifications.length);if(notifications.length==0){QV("notifiyBox",false)}if(notifications.length==1){QV("notifyRemoveAll",false)}if((notifications.length>0)&&(d==0)){var g=notifications[0];QS("notifyx"+g.id)["border-top"]="1px solid transparent"}}}}function addNotification(a){if(a.time==null){a.time=Date.now()}if(a.id==null){a.id=Math.random()}notifications.unshift(a);setNotificationCount(notifications.length);Q("chimes").play();clickNotificationIcon(true)}function deleteAllNotifications(){notifications=[];setNotificationCount(0);drawNotifications();QV("notifiyBox",false)}function setupServerStats(){window.serverStatCpu=new Chart(document.getElementById("serverCpuChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Used","Free"]},options:{responsive:true,legend:{position:"none",},animation:{animateScale:true,animateRotate:true},width:"60px"}});window.serverStatMemory=new Chart(document.getElementById("serverMemoryChart").getContext("2d"),{type:"doughnut",data:{datasets:[{data:[0,0],backgroundColor:["#AAAAAA","#00AA00"]}],labels:["Used","Free"]},options:{responsive:true,legend:{position:"none",},animation:{animateScale:true,animateRotate:true},width:"60px"}})}var lastServerStats=null;function updateServerStats(d){if(d!=null){lastServerStats=d}else{d=lastServerStats}if(d==null){return}if(typeof d.cpuavg=="object"){var c=Math.min(d.cpuavg[0],1);window.serverStatCpu.config.data.datasets[0].data=[c,1-c];QH("serverCpuChartText",'<div style=margin-bottom:5px>CPU Load</div><div><b title="CPU load in the last minute">'+(Math.round(d.cpuavg[0]*100)/100)+'</b>, <b title="CPU load in the last 5 minutes">'+(Math.round(d.cpuavg[1]*100)/100)+'</b>, <b title="CPU load in the 15 minutes">'+(Math.round(d.cpuavg[2]*100)/100)+"</b></div>");QS("serverCpuChartView")["display"]="inline-block";window.serverStatCpu.update()}if((typeof d.totalmem=="number")&&(typeof d.freemem=="number")){window.serverStatMemory.config.data.datasets[0].data=[d.totalmem-d.freemem,d.freemem];QH("serverMemoryChartText","<div style=margin-bottom:5px>Memory</div><div><b>"+getNiceSize2(d.freemem)+"</b> free, <b>"+getNiceSize2(d.totalmem)+"</b> total</div>");QS("serverMemoryChartView")["display"]="inline-block";window.serverStatMemory.update()}var e="<div style=width:100% cellpadding=0 cellspacing=0>";if(typeof d.values=="object"){for(var a in d.values){e+="<div class=userTableHeader style=margin-bottom:4px;width:200px>"+a+"</div>";for(var b in d.values[a]){e+="<div style=display:inline-block><table style=width:300px;height:24px;background-color:#d3d9d6;margin-bottom:4px;vertical-align:middle;border-spacing:0><tr><td class=h1></td><td><span>"+b+"</span><span style=float:right>"+d.values[a][b]+"</span></td><td class=h2></td></tr></table></div>"}}}e+="</div>";QH("serverStatsTable",e)}var xxdialogMode;var xxdialogFunc;var xxdialogButtons;var xxdialogTag;var xxcurrentView=-1;function setDialogMode(j,k,a,e,d,h){xxdialogMode=j;xxdialogFunc=e;xxdialogButtons=a;xxdialogTag=h;QE("idx_dlgOkButton",true);QV("idx_dlgOkButton",a&1);QV("idx_dlgCancelButton",a&2);QV("id_dialogclose",(a&2)||(a&8));QV("idx_dlgDeleteButton",a&4);QV("idx_dlgButtonBar",a&7);if(k){QH("id_dialogtitle",k)}for(var g=1;g<24;g++){QV("dialog"+g,g==j)}QV("dialog",j);if(d){if(j==2){QH("id_dialogOptions",d)}else{QH("id_dialogMessage",d)}}}function dialogclose(e){var c=xxdialogFunc,a=xxdialogButtons,d=xxdialogTag;setDialogMode();if(((a&8)||e)&&c){c(e,d)}}function center(){if(xxcurrentView==11){deskAdjust()}else{if(xxcurrentView==10){masterUpdate(256)}else{if(xxcurrentView==1){masterUpdate(4)}}}}function messagebox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b,1)}function statusbox(b,a){QH("id_dialogMessage",a);setDialogMode(1,b)}function goBack(){if(xxdialogMode){return}if((xxcurrentView>=10)&&(xxcurrentView<20)){go(1)}if((xxcurrentView>=20)&&(xxcurrentView<30)){go(2)}if((xxcurrentView>=30)&&(xxcurrentView<40)){go(4)}}function go(d){if(xxdialogMode||xxcurrentView==d){return}for(var a=0;a<32;a++){QV("p"+a,a==d)}xxcurrentView=d;var b=["LeftMenuMyDevices","LeftMenuMyAccount","LeftMenuMyEvents","LeftMenuMyFiles","LeftMenuMyUsers","LeftMenuMyServer"];for(var a in b){Q(b[a]).classList.remove("lbbuttonsel");Q(b[a]).classList.remove("lbbuttonsel2")}QV("topbar",d!=0);if(d>=10&&d<20){QS("MainMenuMyDevices").backgroundColor="#606060"}else{QS("MainMenuMyDevices").backgroundColor=((d==1)?"#003366":"#808080")}if(d==1||(d>=10&&d<20)){Q("LeftMenuMyDevices").classList.add("lbbuttonsel")}if(d==1){Q("LeftMenuMyDevices").classList.add("lbbuttonsel2")}if(d>=20&&d<30){QS("MainMenuMyAccount").backgroundColor="#606060"}else{QS("MainMenuMyAccount").backgroundColor=((d==2)?"#003366":"#808080")}if(d==2||(d>=20&&d<30)){Q("LeftMenuMyAccount").classList.add("lbbuttonsel")}if(d==2){Q("LeftMenuMyAccount").classList.add("lbbuttonsel2")}QS("MainMenuMyEvents").backgroundColor=((d==3)?"#003366":"#808080");if(d==3){Q("LeftMenuMyEvents").classList.add("lbbuttonsel","lbbuttonsel2")}if(d>=30&&d<40){QS("MainMenuMyUsers").backgroundColor="#606060"}else{QS("MainMenuMyUsers").backgroundColor=((d==4)?"#003366":"#808080")}if(d==4||(d>=30&&d<40)){Q("LeftMenuMyUsers").classList.add("lbbuttonsel")}if(d==4){Q("LeftMenuMyUsers").classList.add("lbbuttonsel2")}QS("MainMenuMyFiles").backgroundColor=((d==5)?"#003366":"#808080");if(d==5){Q("LeftMenuMyFiles").classList.add("lbbuttonsel","lbbuttonsel2")}QS("MainMenuMyServer").backgroundColor=(((d==6)||(d==115))?"#003366":"#808080");if(((d==6)||(d==115))){Q("LeftMenuMyServer").classList.add("lbbuttonsel","lbbuttonsel2")}if(webPageFullScreen){QS("column_l")["max-height"]="calc(100vh - 135px)"}else{QS("column_l")["max-height"]=(d>=10)?"calc(100vh - 159px)":"calc(100vh - 135px)"}if((d==0)&&(webPageFullScreen)){QS("page_content").position="";QV("page_leftbar",false);QS("column_l").height="calc(100vh - 110px)";QS("column_l")["max-height"]=""}QV("MainSubMenuSpan",d>=10&&d<20);QV("UserDummyMenuSpan",(d<10)&&(d!=6)&&webPageFullScreen);QV("MeshSubMenuSpan",d>=20&&d<30);QV("UserSubMenuSpan",d>=30&&d<40);QV("ServerSubMenuSpan",d==6||d==115);var c={10:"MainDev",11:"MainDevDesktop",12:"MainDevTerminal",13:"MainDevFiles",14:"MainDevAmt",15:"MainDevConsole",20:"MeshGeneral",30:"UserGeneral",31:"UserEvents",6:"ServerGeneral",115:"ServerConsole"};for(var a in c){Q(c[a]).classList.remove("style3x");Q(c[a]).classList.remove("style3sel");Q(c[a]).classList.add((d==a)?"style3sel":"style3x")}if(d==115){QV("p15",true)}QV("p15uploadCore",d!=115);QV("p15BackButton",d!=115);if((d==15)||(d==115)){setupConsole()}if(d==1){masterUpdate(4)}if((currentNode)&&(d>=10)&&(d<20)){document.title="MeshCentral - "+currentNode.name}else{document.title="MeshCentral"}}function joinPaths(){var c=[];for(var a in arguments){var b=arguments[a];if((b!=null)&&(b!="")){while(b.endsWith("/")||b.endsWith("\\")){b=b.substring(0,b.length-1)}while(b.startsWith("/")||b.startsWith("\\")){b=b.substring(1)}c.push(b)}}return c.join("/")}function putstore(b,c){try{if(typeof(localStorage)==="undefined"){return}localStorage.setItem(b,c)}catch(a){}}function getstore(b,d){try{if(typeof(localStorage)==="undefined"){return d}var c=localStorage.getItem(b);if((c==null)||(c==null)){return d}return c}catch(a){return d}}function addLink(b,a){return"<span style=cursor:pointer;text-decoration:none onclick='"+a+"'>"+b+" <img class=hoverButton width=10 height=10 src=images/link5.png></span>"}function addLinkConditional(d,b,a){if(a){return addLink(d,b)}return d}function haltEvent(a){if(a.preventDefault){a.preventDefault()}if(a.stopPropagation){a.stopPropagation()}return false}function addOption(c,d,a){var b=document.createElement("option");b.text=d;b.value=a;Q(c).add(b)}function passwordcheck(a){return(a.length>7)&&(/\d/.test(a))&&(/[a-z]/.test(a))&&(/[A-Z]/.test(a))&&(/\W/.test(a))}function methodcheck(a){if(a&&a!=null&&a.Body&&a.Body.ReturnValueStr!="SUCCESS"){messagebox("Call Error",a.Header.Method+": "+a.Body.ReturnValueStr.replace("_"," "));return true}return false}function TableStart(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td width=200px><p><td>"}function TableStart2(){return"<table cellpadding=0 cellspacing=0 style=width:100%;border-radius:8px><tr><td><p><td>"}function TableEntry(a,b){return"<tr><td><p>"+a+"<td>"+b}function FullTable(c,a){var b=TableStart();for(i in c){if(i&&c[i]){b+=TableEntry(i,c[i])}}return b+TableEnd(a)}function TableEnd(a){return"<tr><td colspan=2><p>"+(a?a:"")+"</table>"}function AddButton(b,a){return"<input type=button value='"+b+"' onclick='"+a+"' style=margin:4px>"}function AddButton2(b,a){return"<input type=button value='"+b+"' onclick='"+a+"'>"}function AddRefreshButton(a){return"<input type=button name=refreshbtn value=Refresh onclick='refreshButtons(false);"+a+"' style=margin:4px "+(refreshButtonsState==false?"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>'}function MoreEnd(){return'<a style=cursor:pointer;color:blue onclick=QV("morexxx2",false);QV("morexxx1",true)>▲ Less</a></div>'}function getSelectedOptions(e){var d=[],c;for(var a=0,b=e.options.length;a<b;a++){c=e.options[a];if(c.selected){d.push(c.value)}}return d}function getInstance(b,c){for(var a in b){if(b[a]["InstanceID"]==c){return b[a]}}return null}function getItem(b,c,d){for(var a in b){if(b[a][c]==d){return b[a]}}return null}function guidToStr(a){return a.substring(6,8)+a.substring(4,6)+a.substring(2,4)+a.substring(0,2)+"-"+a.substring(10,12)+a.substring(8,10)+"-"+a.substring(14,16)+a.substring(12,14)+"-"+a.substring(16,20)+"-"+a.substring(20)}function getUrlVars(){var d,a,e=[],b=window.location.href.slice(window.location.href.indexOf("?")+1).split("&");for(var c=0;c<b.length;c++){d=b[c].indexOf("=");if(d>0){e[b[c].substring(0,d)]=b[c].substring(d+1,b[c].length)}}return e}function addHtmlValue(a,b){return"<table><td style=width:120px>"+a+"<td><b>"+b+"</b></table>"}function addHtmlValue2(a,b){return"<div><div style=display:inline-block;float:right>"+b+"</div><div style=display:inline-block>"+a+"</div></div>"}function parseUriArgs(){var a,c={},b=window.document.location.href.split(/[\?&|\=]/);b.splice(0,1);for(d in b){switch(d%2){case 0:a=decodeURIComponent(b[d]);break;case 1:c[a]=decodeURIComponent(b[d]);var d=parseInt(c[a]);if(d==c[a]){c[a]=d}break;default:break}}return c}function focusTextBox(a){setTimeout(function(){Q(a).selectionStart=Q(a).selectionEnd=65535;Q(a).focus()},0)}function validateEmail(b){var a=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return a.test(b)}function isPrivateIP(b){return(b.startsWith("10.")||b.startsWith("172.16.")||b.startsWith("192.168."))}function u2fSupported(){return(window.u2f&&((navigator.userAgent.indexOf("Chrome/")>0)||(navigator.userAgent.indexOf("Firefox/")>0)||(navigator.userAgent.indexOf("Opera/")>0)||(navigator.userAgent.indexOf("Safari/")>0)))};</script></body></html>
\ No newline at end of file
views/default.handlebars
+3
-2
@@ -246,7 +246,7 @@
246
</div>
247
<div id=p2 style="display:none">
248
<h1>My Account</h1>
249
- <img alt="" width=150 height=103 src=images/mainaccount.jpg style=margin-bottom:10px;margin-right:20px;float:right />
249
+ <img id="p2AccountImage" alt="" width=150 height=103 src=images/mainaccount.jpg style=margin-bottom:10px;margin-right:20px;float:right />
250
<div id="p2AccountSecurity" style="display:none">
251
<p><strong>Account security</strong></p>
252
<div style="margin-left:25px">
@@ -1121,8 +1121,9 @@
1121
if (noServerBackup == 1) { siteRights &= 0xFFFFFFFA; } // If not server backups allowed, remove server backup and restore permissions
1122
1123
// Update account actions
1124
- QV('p2AccountActions', ((features & 4) == 0) && (serverinfo.domainauth == false)); // Hide Account Actions if in single user mode or domain authentication
1124
QV('p2AccountSecurity', ((features & 4) == 0) && (serverinfo.domainauth == false) && ((features & 4096) != 0)); // Hide Account Security if in single user mode, domain authentication to 2 factor auth not supported.
1125
+ QV('p2AccountActions', ((features & 4) == 0) && (serverinfo.domainauth == false)); // Hide Account Actions if in single user mode or domain authentication
1126
+ QV('p2AccountImage', ((features & 4) == 0) && (serverinfo.domainauth == false)); // If account actions are not visible, also remove the image on that panel
1127
QV('p2ServerActions', siteRights & 21);
1128
QV('LeftMenuMyServer', siteRights & 21); // 16 + 4 + 1
1129
QV('MainMenuMyServer', siteRights & 21);