orgo-vnc
Version:
Embed cloud desktops in your React app
1 lines • 1.18 MB
Source Map (JSON)
{"version":3,"sources":["../node_modules/@novnc/novnc/lib/util/int.js","../node_modules/@novnc/novnc/lib/util/logging.js","../node_modules/@novnc/novnc/lib/util/strings.js","../node_modules/@novnc/novnc/lib/base64.js","../node_modules/@novnc/novnc/lib/util/browser.js","../node_modules/@novnc/novnc/lib/util/element.js","../node_modules/@novnc/novnc/lib/util/events.js","../node_modules/@novnc/novnc/lib/util/eventtarget.js","../node_modules/@novnc/novnc/lib/display.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/utils/common.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/adler32.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/crc32.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inffast.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inftrees.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/inflate.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/zstream.js","../node_modules/@novnc/novnc/lib/inflator.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/trees.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/messages.js","../node_modules/@novnc/novnc/lib/vendor/pako/lib/zlib/deflate.js","../node_modules/@novnc/novnc/lib/deflator.js","../node_modules/@novnc/novnc/lib/input/keysym.js","../node_modules/@novnc/novnc/lib/input/keysymdef.js","../node_modules/@novnc/novnc/lib/input/vkeys.js","../node_modules/@novnc/novnc/lib/input/fixedkeys.js","../node_modules/@novnc/novnc/lib/input/domkeytable.js","../node_modules/@novnc/novnc/lib/input/util.js","../node_modules/@novnc/novnc/lib/input/keyboard.js","../node_modules/@novnc/novnc/lib/input/gesturehandler.js","../node_modules/@novnc/novnc/lib/util/cursor.js","../node_modules/@novnc/novnc/lib/websock.js","../node_modules/@novnc/novnc/lib/input/xtscancodes.js","../node_modules/@novnc/novnc/lib/encodings.js","../node_modules/@novnc/novnc/lib/crypto/aes.js","../node_modules/@novnc/novnc/lib/crypto/des.js","../node_modules/@novnc/novnc/lib/crypto/bigint.js","../node_modules/@novnc/novnc/lib/crypto/rsa.js","../node_modules/@novnc/novnc/lib/crypto/dh.js","../node_modules/@novnc/novnc/lib/crypto/md5.js","../node_modules/@novnc/novnc/lib/crypto/crypto.js","../node_modules/@novnc/novnc/lib/ra2.js","../node_modules/@novnc/novnc/lib/decoders/raw.js","../node_modules/@novnc/novnc/lib/decoders/copyrect.js","../node_modules/@novnc/novnc/lib/decoders/rre.js","../node_modules/@novnc/novnc/lib/decoders/hextile.js","../node_modules/@novnc/novnc/lib/decoders/zlib.js","../node_modules/@novnc/novnc/lib/decoders/tight.js","../node_modules/@novnc/novnc/lib/decoders/tightpng.js","../node_modules/@novnc/novnc/lib/decoders/zrle.js","../node_modules/@novnc/novnc/lib/decoders/jpeg.js","../node_modules/@novnc/novnc/lib/decoders/h264.js","../node_modules/@novnc/novnc/lib/rfb.js","../src/VNCClient.tsx"],"sourcesContent":["\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.toSigned32bit = toSigned32bit;\nexports.toUnsigned32bit = toUnsigned32bit;\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\nfunction toUnsigned32bit(toConvert) {\n return toConvert >>> 0;\n}\nfunction toSigned32bit(toConvert) {\n return toConvert | 0;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.Warn = exports.Info = exports.Error = exports.Debug = void 0;\nexports.getLogging = getLogging;\nexports.initLogging = initLogging;\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Logging/debug routines\n */\n\nvar _logLevel = 'warn';\nvar Debug = exports.Debug = function Debug() {};\nvar Info = exports.Info = function Info() {};\nvar Warn = exports.Warn = function Warn() {};\nvar Error = exports.Error = function Error() {};\nfunction initLogging(level) {\n if (typeof level === 'undefined') {\n level = _logLevel;\n } else {\n _logLevel = level;\n }\n exports.Debug = Debug = exports.Info = Info = exports.Warn = Warn = exports.Error = Error = function Error() {};\n if (typeof window.console !== \"undefined\") {\n /* eslint-disable no-console, no-fallthrough */\n switch (level) {\n case 'debug':\n exports.Debug = Debug = console.debug.bind(window.console);\n case 'info':\n exports.Info = Info = console.info.bind(window.console);\n case 'warn':\n exports.Warn = Warn = console.warn.bind(window.console);\n case 'error':\n exports.Error = Error = console.error.bind(window.console);\n case 'none':\n break;\n default:\n throw new window.Error(\"invalid logging type '\" + level + \"'\");\n }\n /* eslint-enable no-console, no-fallthrough */\n }\n}\nfunction getLogging() {\n return _logLevel;\n}\n// Initialize logging level\ninitLogging();","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.decodeUTF8 = decodeUTF8;\nexports.encodeUTF8 = encodeUTF8;\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n// Decode from UTF-8\nfunction decodeUTF8(utf8string) {\n var allowLatin1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n try {\n return decodeURIComponent(escape(utf8string));\n } catch (e) {\n if (e instanceof URIError) {\n if (allowLatin1) {\n // If we allow Latin1 we can ignore any decoding fails\n // and in these cases return the original string\n return utf8string;\n }\n }\n throw e;\n }\n}\n\n// Encode to UTF-8\nfunction encodeUTF8(DOMString) {\n return unescape(encodeURIComponent(DOMString));\n}","\"use strict\";\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar Log = _interopRequireWildcard(require(\"./util/logging.js\"));\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\n/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n// From: http://hg.mozilla.org/mozilla-central/raw-file/ec10630b1a54/js/src/devtools/jint/sunspider/string-base64.js\nvar _default = exports[\"default\"] = {\n /* Convert data (an array of integers) to a Base64 string. */\n toBase64Table: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split(''),\n base64Pad: '=',\n encode: function encode(data) {\n \"use strict\";\n\n var result = '';\n var length = data.length;\n var lengthpad = length % 3;\n // Convert every three bytes to 4 ascii characters.\n\n for (var i = 0; i < length - 2; i += 3) {\n result += this.toBase64Table[data[i] >> 2];\n result += this.toBase64Table[((data[i] & 0x03) << 4) + (data[i + 1] >> 4)];\n result += this.toBase64Table[((data[i + 1] & 0x0f) << 2) + (data[i + 2] >> 6)];\n result += this.toBase64Table[data[i + 2] & 0x3f];\n }\n\n // Convert the remaining 1 or 2 bytes, pad out to 4 characters.\n var j = length - lengthpad;\n if (lengthpad === 2) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[((data[j] & 0x03) << 4) + (data[j + 1] >> 4)];\n result += this.toBase64Table[(data[j + 1] & 0x0f) << 2];\n result += this.toBase64Table[64];\n } else if (lengthpad === 1) {\n result += this.toBase64Table[data[j] >> 2];\n result += this.toBase64Table[(data[j] & 0x03) << 4];\n result += this.toBase64Table[64];\n result += this.toBase64Table[64];\n }\n return result;\n },\n /* Convert Base64 data to a string */\n /* eslint-disable comma-spacing */\n toBinaryTable: [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 0, -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, -1, -1, -1, -1, -1],\n /* eslint-enable comma-spacing */decode: function decode(data) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var dataLength = data.indexOf('=') - offset;\n if (dataLength < 0) {\n dataLength = data.length - offset;\n }\n\n /* Every four characters is 3 resulting numbers */\n var resultLength = (dataLength >> 2) * 3 + Math.floor(dataLength % 4 / 1.5);\n var result = new Array(resultLength);\n\n // Convert one by one.\n\n var leftbits = 0; // number of bits decoded, but yet to be appended\n var leftdata = 0; // bits decoded, but yet to be appended\n for (var idx = 0, i = offset; i < data.length; i++) {\n var c = this.toBinaryTable[data.charCodeAt(i) & 0x7f];\n var padding = data.charAt(i) === this.base64Pad;\n // Skip illegal characters and whitespace\n if (c === -1) {\n Log.Error(\"Illegal character code \" + data.charCodeAt(i) + \" at position \" + i);\n continue;\n }\n\n // Collect data into leftdata, update bitcount\n leftdata = leftdata << 6 | c;\n leftbits += 6;\n\n // If we have 8 or more bits, append 8 bits to the result\n if (leftbits >= 8) {\n leftbits -= 8;\n // Append if not padding.\n if (!padding) {\n result[idx++] = leftdata >> leftbits & 0xff;\n }\n leftdata &= (1 << leftbits) - 1;\n }\n }\n\n // If there are any bits left, the base64 string was corrupted\n if (leftbits) {\n var err = new Error('Corrupted base64 string');\n err.name = 'Base64-Error';\n throw err;\n }\n return result;\n }\n};\n/* End of Base64 namespace */","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.hasScrollbarGutter = exports.dragThreshold = void 0;\nexports.isAndroid = isAndroid;\nexports.isBlink = isBlink;\nexports.isChrome = isChrome;\nexports.isChromeOS = isChromeOS;\nexports.isChromium = isChromium;\nexports.isEdge = isEdge;\nexports.isFirefox = isFirefox;\nexports.isGecko = isGecko;\nexports.isIOS = isIOS;\nexports.isMac = isMac;\nexports.isOpera = isOpera;\nexports.isSafari = isSafari;\nexports.isTouchDevice = void 0;\nexports.isWebKit = isWebKit;\nexports.isWindows = isWindows;\nexports.supportsWebCodecsH264Decode = exports.supportsCursorURIs = void 0;\nvar Log = _interopRequireWildcard(require(\"./logging.js\"));\nvar _base = _interopRequireDefault(require(\"../base64.js\"));\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { \"default\": e }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; } /*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n *\n * Browser feature support detection\n */\n// Touch detection\nvar isTouchDevice = exports.isTouchDevice = 'ontouchstart' in document.documentElement ||\n// required for Chrome debugger\ndocument.ontouchstart !== undefined ||\n// required for MS Surface\nnavigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;\nwindow.addEventListener('touchstart', function onFirstTouch() {\n exports.isTouchDevice = isTouchDevice = true;\n window.removeEventListener('touchstart', onFirstTouch, false);\n}, false);\n\n// The goal is to find a certain physical width, the devicePixelRatio\n// brings us a bit closer but is not optimal.\nvar dragThreshold = exports.dragThreshold = 10 * (window.devicePixelRatio || 1);\nvar _supportsCursorURIs = false;\ntry {\n var target = document.createElement('canvas');\n target.style.cursor = 'url(\"data:image/x-icon;base64,AAACAAEACAgAAAIAAgA4AQAAFgAAACgAAAAIAAAAEAAAAAEAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAAAAAAAAAAAAAAAAAAAA==\") 2 2, default';\n if (target.style.cursor.indexOf(\"url\") === 0) {\n Log.Info(\"Data URI scheme cursor supported\");\n _supportsCursorURIs = true;\n } else {\n Log.Warn(\"Data URI scheme cursor not supported\");\n }\n} catch (exc) {\n Log.Error(\"Data URI scheme cursor test exception: \" + exc);\n}\nvar supportsCursorURIs = exports.supportsCursorURIs = _supportsCursorURIs;\nvar _hasScrollbarGutter = true;\ntry {\n // Create invisible container\n var container = document.createElement('div');\n container.style.visibility = 'hidden';\n container.style.overflow = 'scroll'; // forcing scrollbars\n document.body.appendChild(container);\n\n // Create a div and place it in the container\n var child = document.createElement('div');\n container.appendChild(child);\n\n // Calculate the difference between the container's full width\n // and the child's width - the difference is the scrollbars\n var scrollbarWidth = container.offsetWidth - child.offsetWidth;\n\n // Clean up\n container.parentNode.removeChild(container);\n _hasScrollbarGutter = scrollbarWidth != 0;\n} catch (exc) {\n Log.Error(\"Scrollbar test exception: \" + exc);\n}\nvar hasScrollbarGutter = exports.hasScrollbarGutter = _hasScrollbarGutter;\nvar supportsWebCodecsH264Decode = exports.supportsWebCodecsH264Decode = false;\nfunction _checkWebCodecsH264DecodeSupport() {\n return _checkWebCodecsH264DecodeSupport2.apply(this, arguments);\n}\nfunction _checkWebCodecsH264DecodeSupport2() {\n _checkWebCodecsH264DecodeSupport2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var config, support, data, gotframe, _error, decoder, chunk;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if ('VideoDecoder' in window) {\n _context.next = 2;\n break;\n }\n return _context.abrupt(\"return\", false);\n case 2:\n // We'll need to make do with some placeholders here\n config = {\n codec: 'avc1.42401f',\n codedWidth: 1920,\n codedHeight: 1080,\n optimizeForLatency: true\n };\n _context.next = 5;\n return VideoDecoder.isConfigSupported(config);\n case 5:\n support = _context.sent;\n if (support.supported) {\n _context.next = 8;\n break;\n }\n return _context.abrupt(\"return\", false);\n case 8:\n // Firefox incorrectly reports supports for H.264 under some\n // circumstances, so we need to actually test a real frame\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1932392\n data = new Uint8Array(_base[\"default\"].decode('AAAAAWdCwBTZnpuAgICgAAADACAAAAZB4oVNAAAAAWjJYyyAAAABBgX//4Hc' + 'Rem95tlIt5Ys2CDZI+7veDI2NCAtIGNvcmUgMTY0IHIzMTA4IDMxZTE5Zjkg' + 'LSBILjI2NC9NUEVHLTQgQVZDIGNvZGVjIC0gQ29weWxlZnQgMjAwMy0yMDIz' + 'IC0gaHR0cDovL3d3dy52aWRlb2xhbi5vcmcveDI2NC5odG1sIC0gb3B0aW9u' + 'czogY2FiYWM9MCByZWY9NSBkZWJsb2NrPTE6MDowIGFuYWx5c2U9MHgxOjB4' + 'MTExIG1lPWhleCBzdWJtZT04IHBzeT0xIHBzeV9yZD0xLjAwOjAuMDAgbWl4' + 'ZWRfcmVmPTEgbWVfcmFuZ2U9MTYgY2hyb21hX21lPTEgdHJlbGxpcz0yIDh4' + 'OGRjdD0wIGNxbT0wIGRlYWR6b25lPTIxLDExIGZhc3RfcHNraXA9MSBjaHJv' + 'bWFfcXBfb2Zmc2V0PS0yIHRocmVhZHM9MSBsb29rYWhlYWRfdGhyZWFkcz0x' + 'IHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9' + 'MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVz' + 'PTAgd2VpZ2h0cD0wIGtleWludD1pbmZpbml0ZSBrZXlpbnRfbWluPTI1IHNj' + 'ZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NTAgcmM9' + 'YWJyIG1idHJlZT0xIGJpdHJhdGU9NDAwIHJhdGV0b2w9MS4wIHFjb21wPTAu' + 'NjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCBpcF9yYXRpbz0xLjQwIGFx' + 'PTE6MS4wMACAAAABZYiEBrxmKAAPVccAAS044AA5DRJMnkycJk4TPw=='));\n gotframe = false;\n _error = null;\n decoder = new VideoDecoder({\n output: function output(frame) {\n gotframe = true;\n },\n error: function error(e) {\n _error = e;\n }\n });\n chunk = new EncodedVideoChunk({\n timestamp: 0,\n type: 'key',\n data: data\n });\n decoder.configure(config);\n decoder.decode(chunk);\n _context.prev = 15;\n _context.next = 18;\n return decoder.flush();\n case 18:\n _context.next = 23;\n break;\n case 20:\n _context.prev = 20;\n _context.t0 = _context[\"catch\"](15);\n // Firefox incorrectly throws an exception here\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1932566\n _error = _context.t0;\n case 23:\n if (gotframe) {\n _context.next = 25;\n break;\n }\n return _context.abrupt(\"return\", false);\n case 25:\n if (!(_error !== null)) {\n _context.next = 27;\n break;\n }\n return _context.abrupt(\"return\", false);\n case 27:\n return _context.abrupt(\"return\", true);\n case 28:\n case \"end\":\n return _context.stop();\n }\n }, _callee, null, [[15, 20]]);\n }));\n return _checkWebCodecsH264DecodeSupport2.apply(this, arguments);\n}\n_checkWebCodecsH264DecodeSupport().then(function (result) {\n exports.supportsWebCodecsH264Decode = supportsWebCodecsH264Decode = result;\n});\n\n/*\n * The functions for detection of platforms and browsers below are exported\n * but the use of these should be minimized as much as possible.\n *\n * It's better to use feature detection than platform detection.\n */\n\n/* OS */\n\nfunction isMac() {\n return !!/mac/i.exec(navigator.platform);\n}\nfunction isWindows() {\n return !!/win/i.exec(navigator.platform);\n}\nfunction isIOS() {\n return !!/ipad/i.exec(navigator.platform) || !!/iphone/i.exec(navigator.platform) || !!/ipod/i.exec(navigator.platform);\n}\nfunction isAndroid() {\n /* Android sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match('Android ');\n}\nfunction isChromeOS() {\n /* ChromeOS sets navigator.platform to Linux :/ */\n return !!navigator.userAgent.match(' CrOS ');\n}\n\n/* Browser */\n\nfunction isSafari() {\n return !!navigator.userAgent.match('Safari/...') && !navigator.userAgent.match('Chrome/...') && !navigator.userAgent.match('Chromium/...') && !navigator.userAgent.match('Epiphany/...');\n}\nfunction isFirefox() {\n return !!navigator.userAgent.match('Firefox/...') && !navigator.userAgent.match('Seamonkey/...');\n}\nfunction isChrome() {\n return !!navigator.userAgent.match('Chrome/...') && !navigator.userAgent.match('Chromium/...') && !navigator.userAgent.match('Edg/...') && !navigator.userAgent.match('OPR/...');\n}\nfunction isChromium() {\n return !!navigator.userAgent.match('Chromium/...');\n}\nfunction isOpera() {\n return !!navigator.userAgent.match('OPR/...');\n}\nfunction isEdge() {\n return !!navigator.userAgent.match('Edg/...');\n}\n\n/* Engine */\n\nfunction isGecko() {\n return !!navigator.userAgent.match('Gecko/...');\n}\nfunction isWebKit() {\n return !!navigator.userAgent.match('AppleWebKit/...') && !navigator.userAgent.match('Chrome/...');\n}\nfunction isBlink() {\n return !!navigator.userAgent.match('Chrome/...');\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.clientToElement = clientToElement;\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2020 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * HTML element utility functions\n */\n\nfunction clientToElement(x, y, elem) {\n var bounds = elem.getBoundingClientRect();\n var pos = {\n x: 0,\n y: 0\n };\n // Clip to target bounds\n if (x < bounds.left) {\n pos.x = 0;\n } else if (x >= bounds.right) {\n pos.x = bounds.width - 1;\n } else {\n pos.x = x - bounds.left;\n }\n if (y < bounds.top) {\n pos.y = 0;\n } else if (y >= bounds.bottom) {\n pos.y = bounds.height - 1;\n } else {\n pos.y = y - bounds.top;\n }\n return pos;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPointerEvent = getPointerEvent;\nexports.releaseCapture = releaseCapture;\nexports.setCapture = setCapture;\nexports.stopEvent = stopEvent;\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2018 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\n\n/*\n * Cross-browser event and position routines\n */\n\nfunction getPointerEvent(e) {\n return e.changedTouches ? e.changedTouches[0] : e.touches ? e.touches[0] : e;\n}\nfunction stopEvent(e) {\n e.stopPropagation();\n e.preventDefault();\n}\n\n// Emulate Element.setCapture() when not supported\nvar _captureRecursion = false;\nvar _elementForUnflushedEvents = null;\ndocument.captureElement = null;\nfunction _captureProxy(e) {\n // Recursion protection as we'll see our own event\n if (_captureRecursion) return;\n\n // Clone the event as we cannot dispatch an already dispatched event\n var newEv = new e.constructor(e.type, e);\n _captureRecursion = true;\n if (document.captureElement) {\n document.captureElement.dispatchEvent(newEv);\n } else {\n _elementForUnflushedEvents.dispatchEvent(newEv);\n }\n _captureRecursion = false;\n\n // Avoid double events\n e.stopPropagation();\n\n // Respect the wishes of the redirected event handlers\n if (newEv.defaultPrevented) {\n e.preventDefault();\n }\n\n // Implicitly release the capture on button release\n if (e.type === \"mouseup\") {\n releaseCapture();\n }\n}\n\n// Follow cursor style of target element\nfunction _capturedElemChanged() {\n var proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.cursor = window.getComputedStyle(document.captureElement).cursor;\n}\nvar _captureObserver = new MutationObserver(_capturedElemChanged);\nfunction setCapture(target) {\n if (target.setCapture) {\n target.setCapture();\n document.captureElement = target;\n } else {\n // Release any existing capture in case this method is\n // called multiple times without coordination\n releaseCapture();\n var proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n if (proxyElem === null) {\n proxyElem = document.createElement(\"div\");\n proxyElem.id = \"noVNC_mouse_capture_elem\";\n proxyElem.style.position = \"fixed\";\n proxyElem.style.top = \"0px\";\n proxyElem.style.left = \"0px\";\n proxyElem.style.width = \"100%\";\n proxyElem.style.height = \"100%\";\n proxyElem.style.zIndex = 10000;\n proxyElem.style.display = \"none\";\n document.body.appendChild(proxyElem);\n\n // This is to make sure callers don't get confused by having\n // our blocking element as the target\n proxyElem.addEventListener('contextmenu', _captureProxy);\n proxyElem.addEventListener('mousemove', _captureProxy);\n proxyElem.addEventListener('mouseup', _captureProxy);\n }\n document.captureElement = target;\n\n // Track cursor and get initial cursor\n _captureObserver.observe(target, {\n attributes: true\n });\n _capturedElemChanged();\n proxyElem.style.display = \"\";\n\n // We listen to events on window in order to keep tracking if it\n // happens to leave the viewport\n window.addEventListener('mousemove', _captureProxy);\n window.addEventListener('mouseup', _captureProxy);\n }\n}\nfunction releaseCapture() {\n if (document.releaseCapture) {\n document.releaseCapture();\n document.captureElement = null;\n } else {\n if (!document.captureElement) {\n return;\n }\n\n // There might be events already queued. The event proxy needs\n // access to the captured element for these queued events.\n // E.g. contextmenu (right-click) in Microsoft Edge\n //\n // Before removing the capturedElem pointer we save it to a\n // temporary variable that the unflushed events can use.\n _elementForUnflushedEvents = document.captureElement;\n document.captureElement = null;\n _captureObserver.disconnect();\n var proxyElem = document.getElementById(\"noVNC_mouse_capture_elem\");\n proxyElem.style.display = \"none\";\n window.removeEventListener('mousemove', _captureProxy);\n window.removeEventListener('mouseup', _captureProxy);\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n/*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\nvar EventTargetMixin = exports[\"default\"] = /*#__PURE__*/function () {\n function EventTargetMixin() {\n _classCallCheck(this, EventTargetMixin);\n this._listeners = new Map();\n }\n return _createClass(EventTargetMixin, [{\n key: \"addEventListener\",\n value: function addEventListener(type, callback) {\n if (!this._listeners.has(type)) {\n this._listeners.set(type, new Set());\n }\n this._listeners.get(type).add(callback);\n }\n }, {\n key: \"removeEventListener\",\n value: function removeEventListener(type, callback) {\n if (this._listeners.has(type)) {\n this._listeners.get(type)[\"delete\"](callback);\n }\n }\n }, {\n key: \"dispatchEvent\",\n value: function dispatchEvent(event) {\n var _this = this;\n if (!this._listeners.has(event.type)) {\n return true;\n }\n this._listeners.get(event.type).forEach(function (callback) {\n return callback.call(_this, event);\n });\n return !event.defaultPrevented;\n }\n }]);\n}();","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\nvar Log = _interopRequireWildcard(require(\"./util/logging.js\"));\nvar _base = _interopRequireDefault(require(\"./base64.js\"));\nvar _int = require(\"./util/int.js\");\nfunction _interopRequireDefault(e) { return e && e.__esModule ? e : { \"default\": e }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); } /*\n * noVNC: HTML5 VNC client\n * Copyright (C) 2019 The noVNC authors\n * Licensed under MPL 2.0 (see LICENSE.txt)\n *\n * See README.md for usage and integration instructions.\n */\nvar Display = exports[\"default\"] = /*#__PURE__*/function () {\n function Display(target) {\n _classCallCheck(this, Display);\n this._drawCtx = null;\n this._renderQ = []; // queue drawing actions for in-oder rendering\n this._flushPromise = null;\n\n // the full frame buffer (logical canvas) size\n this._fbWidth = 0;\n this._fbHeight = 0;\n this._prevDrawStyle = \"\";\n Log.Debug(\">> Display.constructor\");\n\n // The visible canvas\n this._target = target;\n if (!this._target) {\n throw new Error(\"Target must be set\");\n }\n if (typeof this._target === 'string') {\n throw new Error('target must be a DOM element');\n }\n if (!this._target.getContext) {\n throw new Error(\"no getContext method\");\n }\n this._targetCtx = this._target.getContext('2d');\n\n // the visible canvas viewport (i.e. what actually gets seen)\n this._viewportLoc = {\n 'x': 0,\n 'y': 0,\n 'w': this._target.width,\n 'h': this._target.height\n };\n\n // The hidden canvas, where we do the actual rendering\n this._backbuffer = document.createElement('canvas');\n this._drawCtx = this._backbuffer.getContext('2d');\n this._damageBounds = {\n left: 0,\n top: 0,\n right: this._backbuffer.width,\n bottom: this._backbuffer.height\n };\n Log.Debug(\"User Agent: \" + navigator.userAgent);\n Log.Debug(\"<< Display.constructor\");\n\n // ===== PROPERTIES =====\n\n this._scale = 1.0;\n this._clipViewport = false;\n }\n\n // ===== PROPERTIES =====\n return _createClass(Display, [{\n key: \"scale\",\n get: function get() {\n return this._scale;\n },\n set: function set(scale) {\n this._rescale(scale);\n }\n }, {\n key: \"clipViewport\",\n get: function get() {\n return this._clipViewport;\n },\n set: function set(viewport) {\n this._clipViewport = viewport;\n // May need to readjust the viewport dimensions\n var vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n }, {\n key: \"width\",\n get: function get() {\n return this._fbWidth;\n }\n }, {\n key: \"height\",\n get: function get() {\n return this._fbHeight;\n }\n\n // ===== PUBLIC METHODS =====\n }, {\n key: \"viewportChangePos\",\n value: function viewportChangePos(deltaX, deltaY) {\n var vp = this._viewportLoc;\n deltaX = Math.floor(deltaX);\n deltaY = Math.floor(deltaY);\n if (!this._clipViewport) {\n deltaX = -vp.w; // clamped later of out of bounds\n deltaY = -vp.h;\n }\n var vx2 = vp.x + vp.w - 1;\n var vy2 = vp.y + vp.h - 1;\n\n // Position change\n\n if (deltaX < 0 && vp.x + deltaX < 0) {\n deltaX = -vp.x;\n }\n if (vx2 + deltaX >= this._fbWidth) {\n deltaX -= vx2 + deltaX - this._fbWidth + 1;\n }\n if (vp.y + deltaY < 0) {\n deltaY = -vp.y;\n }\n if (vy2 + deltaY >= this._fbHeight) {\n deltaY -= vy2 + deltaY - this._fbHeight + 1;\n }\n if (deltaX === 0 && deltaY === 0) {\n return;\n }\n Log.Debug(\"viewportChange deltaX: \" + deltaX + \", deltaY: \" + deltaY);\n vp.x += deltaX;\n vp.y += deltaY;\n this._damage(vp.x, vp.y, vp.w, vp.h);\n this.flip();\n }\n }, {\n key: \"viewportChangeSize\",\n value: function viewportChangeSize(width, height) {\n if (!this._clipViewport || typeof width === \"undefined\" || typeof height === \"undefined\") {\n Log.Debug(\"Setting viewport to full display region\");\n width = this._fbWidth;\n height = this._fbHeight;\n }\n width = Math.floor(width);\n height = Math.floor(height);\n if (width > this._fbWidth) {\n width = this._fbWidth;\n }\n if (height > this._fbHeight) {\n height = this._fbHeight;\n }\n var vp = this._viewportLoc;\n if (vp.w !== width || vp.h !== height) {\n vp.w = width;\n vp.h = height;\n var canvas = this._target;\n canvas.width = width;\n canvas.height = height;\n\n // The position might need to be updated if we've grown\n this.viewportChangePos(0, 0);\n this._damage(vp.x, vp.y, vp.w, vp.h);\n this.flip();\n\n // Update the visible size of the target canvas\n this._rescale(this._scale);\n }\n }\n }, {\n key: \"absX\",\n value: function absX(x) {\n if (this._scale === 0) {\n return 0;\n }\n return (0, _int.toSigned32bit)(x / this._scale + this._viewportLoc.x);\n }\n }, {\n key: \"absY\",\n value: function absY(y) {\n if (this._scale === 0) {\n return 0;\n }\n return (0, _int.toSigned32bit)(y / this._scale + this._viewportLoc.y);\n }\n }, {\n key: \"resize\",\n value: function resize(width, height) {\n this._prevDrawStyle = \"\";\n this._fbWidth = width;\n this._fbHeight = height;\n var canvas = this._backbuffer;\n if (canvas.width !== width || canvas.height !== height) {\n // We have to save the canvas data since changing the size will clear it\n var saveImg = null;\n if (canvas.width > 0 && canvas.height > 0) {\n saveImg = this._drawCtx.getImageData(0, 0, canvas.width, canvas.height);\n }\n if (canvas.width !== width) {\n canvas.width = width;\n }\n if (canvas.height !== height) {\n canvas.height = height;\n }\n if (saveImg) {\n this._drawCtx.putImageData(saveImg, 0, 0);\n }\n }\n\n // Readjust the viewport as it may be incorrectly sized\n // and positioned\n var vp = this._viewportLoc;\n this.viewportChangeSize(vp.w, vp.h);\n this.viewportChangePos(0, 0);\n }\n }, {\n key: \"getImageData\",\n value: function getImageData() {\n return this._drawCtx.getImageData(0, 0, this.width, this.height);\n }\n }, {\n key: \"toDataURL\",\n value: function toDataURL(type, encoderOptions) {\n return this._backbuffer.toDataURL(type, encoderOptions);\n }\n }, {\n key: \"toBlob\",\n value: function toBlob(callback, type, quality) {\n return this._backbuffer.toBlob(callback, type, quality);\n }\n\n // Track what parts of the visible canvas that need updating\n }, {\n key: \"_damage\",\n value: function _damage(x, y, w, h) {\n if (x < this._damageBounds.left) {\n this._damageBounds.left = x;\n }\n if (y < this._damageBounds.top) {\n this._damageBounds.top = y;\n }\n if (x + w > this._damageBounds.right) {\n this._damageBounds.right = x + w;\n }\n if (y + h > this._damageBounds.bottom) {\n this._damageBounds.bottom = y + h;\n }\n }\n\n // Update the visible canvas with the contents of the\n // rendering canvas\n }, {\n key: \"flip\",\n value: function flip(fromQueue) {\n if (this._renderQ.length !== 0 && !fromQueue) {\n this._renderQPush({\n 'type': 'flip'\n });\n } else {\n var x = this._damageBounds.left;\n var y = this._damageBounds.top;\n var w = this._damageBounds.right - x;\n var h = this._damageBounds.bottom - y