filecat 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/main.js CHANGED
@@ -1 +1 @@
1
- (()=>{var __webpack_modules__={4321:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,c,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,c)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.Env=void 0;var f=r(5584),p=f.__importDefault(r(9896)),h=f.__importDefault(r(6928)),d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"parseArgs",value:function(){return f.__awaiter(this,void 0,void 0,s().mark((function e(){var t=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){for(var o=process.argv.slice(2),a={},i=0;i<o.length;i++){var c=o[i];if(c.startsWith("--")){var s=c.slice(2),u=!0;if(i+1<o.length&&!o[i+1].startsWith("--")&&(u=o[++i]),"true"===u?u=!0:"false"===u?u=!1:isNaN(u)||(u=Number(u)),a[s]=u,"install"===s)return"linux"!==u&&(console.log("sorry现在只支持linux"),process.exit()),void r(6557)}}for(var l=0,f=Object.keys(a);l<f.length;l++){var p=f[l];t[p]=a[p]}t.env&&t.load(t.env),e(1)})));case 1:case"end":return e.stop()}}),e)})))}},{key:"updateEnv",value:function(e){if(this.env){for(var t=p.default.readFileSync(h.default.join(this.env),"utf8").split(/\r?\n/),r=0;r<t.length;r++){var n,o=t[r],i=a(e);try{for(i.s();!(n=i.n()).done;){var c=n.value;o.includes(c.key)&&(t[r]="".concat(c.key,"=").concat(c.value||""),this[c.key]=c.value)}}catch(e){i.e(e)}finally{i.f()}}p.default.writeFileSync(h.default.join(this.env),t.join("\n"))}}},{key:"isNumeric",value:function(e){return/^-?\d+(\.\d+)?$/.test(e)}},{key:"parseValue",value:function(e){return this.isNumeric(e)?parseFloat(e):"true"===e.toLowerCase()||"false"!==e.toLowerCase()&&e}},{key:"load",value:function(e){var t,r=a(p.default.readFileSync(e,"utf8").split(/\r?\n/));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(""!==n.trim()&&!n.trim().startsWith("#")){var i=o(n.split("="),2),c=i[0],s=i[1];this[c.trim()]=this.parseValue(s.trim())}}}catch(e){r.e(e)}finally{r.f()}}}],(t=null)&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.Env=d,d.port=5567,d.base_folder=process.cwd(),d.username="",d.password="",d.work_dir="".concat(process.cwd(),"/data"),d.env=""},4861:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.FileMenuData=void 0,t.getFileFormat=function(e){var t=c.StringUtil.getFileExtension(e);if("pdf"===t)return s.FileTypeEnum.pdf;if("md"==t)return s.FileTypeEnum.md;if(l.has(t))return s.FileTypeEnum.video;if(f.has(t))return s.FileTypeEnum.uncompress;if(p.has(t))return s.FileTypeEnum.image;if("excalidraw"===t)return s.FileTypeEnum.excalidraw;return s.FileTypeEnum.unknow};var c=r(7285),s=r(8076),u=a((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));t.FileMenuData=u;var l=new Set(["mp4","webm","flv","mov","m4v","mkv","avi","wmv","swf","mod","mpv","mpeg","asf"]),f=new Set(["tar","zip","gz","tgz","rar"]),p=new Set(["jpg","jpeg","png","gif"]);new Set(["txt","ts","js"])},5894:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonUtil=void 0;var serialize=__webpack_require__(8474),JsonUtil=function(){function JsonUtil(){_classCallCheck(this,JsonUtil)}return _createClass(JsonUtil,null,[{key:"getJson",value:function(e){return serialize(e)}},{key:"fromJson",value:function fromJson(str){return eval("(".concat(str,")"))}}])}();exports.JsonUtil=JsonUtil},8932:(e,t)=>{"use strict";function r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getNextByLoop=function(e,t){var r=i(e,t);if(null===r)return null;if(r===e.length-1)return e[0];return e[r+1]},t.getIndexByList=i,t.getByList=function(e,t){var r=i(e,t);if(null===r)return null;return e[r]},t.getNewDeleteByList=function(e,t){var r=e.indexOf(t),o=n(e);return o.splice(r,1),o},t.webPathJoin=function(){for(var e="",t=0;t<arguments.length;t++){var r=t<0||arguments.length<=t?void 0:arguments[t];0===t?("/"!==r[0]&&(r="/"+r),"/"!==r[r.length-1]&&(r+="/")):t===arguments.length-1?"/"!==r[r.list-1]&&-1===r.indexOf(".")&&(r+="/"):("/"===r[0]&&(r=r.slice(1,r.length-1)),"/"!==r[r.length-1]&&(r+="/")),e+=r}return e},t.joinPaths=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t[0],o=1;o<t.length;o++)"/"!==t[o][t[o].length-1]?n+="/"+t[o]:n+=t[o];return n},t.getByIndexs=function(e,t){var n,o=[],a=r(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;o.push(e[i])}}catch(e){a.e(e)}finally{a.f()}return o},t.sort=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return e;for(var n=0;n<e.length;n++)for(var o=e.length-1;o>n;o--){var a=t?t(e[o]):e[o],i=t?t(e[o-1]):e[o-1],c=e[o];a<i?r&&(e[o]=e[o-1],e[o-1]=c):a>i&&(r||(e[o]=e[o-1],e[o-1]=c))}return e},t.getMapByList=function(e,t){var n,o=new Map,a=r(e);try{for(a.s();!(n=a.n()).done;){var i=n.value;o.set(t(i),i)}}catch(e){a.e(e)}finally{a.f()}return o},t.getByListRandom=function e(t,r){if(0===t.length)return null;var n=function(e,t){if(e===t)return-1;return Math.floor(Math.random()*(t-e))+e}(0,t.length);if(r&&n===r)return e(t,r);return t[n]},t.deleteList=function(e,t){if(!t)return;for(var r=0;r<e.length;r++)if(t(e[r]))return e.splice(r,1)[0];return}},5453:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.RCode=void 0,function(e){e[e.Sucess=0]="Sucess",e[e.Fail=1]="Fail",e[e.AuthFail=2]="AuthFail",e[e.DdnsAuthFail=3]="DdnsAuthFail",e[e.File_Max=4]="File_Max",e[e.PreFile=5]="PreFile"}(r||(t.RCode=r={}))},8239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerConfig=void 0,t.routerConfig={file:"file",navindex:"navindex",toolbox:"toolbox",info:"info",ddns:"ddns",net:"net",setting:"setting","/":"/","":""}},7285:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtil=t.Param=void 0,t.getEditModelType=function(e){var t=e.split(".");if(1===t.length)return"";switch(t=t[t.length-1]){case"java":case"javascript":case"css":case"json":case"python":case"text":case"sh":case"lua":case"html":case"xml":case"yaml":case"tsx":case"sql":return t;case"txt":case"ini":case"env":case"bash":case"log":case"config":case"map":case"out":case"gitignore":case"conf":case"mod":return"text";case"js":return"javascript";case"md":return"markdown";case"py":return"python";case"ts":return"typescript";case"yml":return"yaml";case"cpp":case"h":case"c":case"cc":return"c_cpp";case"excalidraw":return"json"}return""},t.join_url=function(e,t){return e.endsWith("/")&&t.startsWith("/")?e.slice(0,-1)+t:e.endsWith("/")||t.startsWith("/")?e+t:e+"/"+t},t.getWebFirstKey=function(e){if(!e)return"";for(var t=1;t<e.length;t++)if("//"===e[t])return e.slice(1,t);return e.slice(1)},t.generateSaltyUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))+"-"};var u=i((function e(){s(this,e)}));t.Param=u;var l=function(){return i((function e(){s(this,e)}),null,[{key:"trim",value:function(e){return e?e.replace(" ",""):""}},{key:"trimList",value:function(e,t){var r=e[t];return this.trim(r)}},{key:"getParam",value:function(){for(var e="?",t=!1,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];if(Array.isArray(o)){var i,c=n(o);try{for(c.s();!(i=c.n()).done;){var s=i.value;s.value&&(t?e+="&".concat(s.key,"=").concat(s.value):(e+="".concat(s.key,"=").concat(s.value),t=!0))}}catch(e){c.e(e)}finally{c.f()}}return e}},{key:"getFileExtension",value:function(e){return e.split(".").pop()}}])}();t.StringUtil=l},7699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShortTime=function(e){t=e,e=t>1e12?e:1e3*e;var t;var s=Date.now(),u=Math.abs(s-e)/c;return u<r?"小于一分钟":u<n?"".concat(u.toFixed(0),"分钟前"):u<o?"".concat((u/n).toFixed(0),"小时前"):u<a?"".concat((u/o).toFixed(0),"天前"):u<i?"".concat((u/a).toFixed(0),"月前"):"".concat((u/i).toFixed(0),"年前")},t.formatFileSize=function(e){return e<s?e+" B":e<u?(e/s).toFixed(2)+" KB":e<l?(e/u).toFixed(2)+" MB":(e/l).toFixed(2)+" GB"};var r=1,n=60*r,o=24*n,a=30*o,i=365*o,c=6e4;var s=1024,u=1048576,l=1073741824},8076:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.base64UploadType=t.FileCompressPojo=t.FileCompressType=t.FileVideoFormatTransPojo=t.FileTypeEnum=void 0,function(e){e.audio="audio",e.blob="blob",e.image="image",e.pdf="pdf",e.text="text",e.video="video",e.invalid_link="invalid_link",e.folder="folder",e.studio_file="studio_file",e.studio_folder="studio_folder",e.unknow="text",e.uncompress="uncompress",e.md="md",e.excalidraw="excalidraw",e.dev="dev"}(c||(t.FileTypeEnum=c={}));var s,u=o((function e(){i(this,e)}));t.FileVideoFormatTransPojo=u,function(e){e.zip="zip",e.tar="tar",e.gzip="gz",e.rar="rar"}(s||(t.FileCompressType=s={}));var l,f=o((function e(){i(this,e)}));t.FileCompressPojo=f,function(e){e[e.all=0]="all",e[e.start=1]="start",e[e.part=2]="part"}(l||(t.base64UploadType=l={}))},8872:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}Object.defineProperty(t,"__esModule",{value:!0}),t.findAvailablePort=function(e,t){return a.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,c;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,new Promise((function(e,r){var n=i.createServer();n.unref(),n.on("error",r),n.listen(t,(function(){n.close((function(){return e(t)}))}))}));case 3:return e.abrupt("return",{v:t});case 6:e.prev=6,e.t0=e.catch(0);case 8:case"end":return e.stop()}}),e,null,[[0,6]])})),c=e;case 2:if(!(c<=t)){r.next=10;break}return r.delegateYield(n(c),"t0",4);case 4:if(!(a=r.t0)){r.next=7;break}return r.abrupt("return",a.v);case 7:c++,r.next=2;break;case 10:return r.abrupt("return",null);case 11:case"end":return r.stop()}}),r)})))};var a=r(5584),i=r(9278)},4988:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.WsData=t.WsConnectType=t.CmdType=t.protocolIsProto2=void 0;var i,c,s=r(5584),u=r(5894),l=s.__importStar(r(8497)),f=s.__importStar(r(3211)),p=r(3211),h=new f.Encoder;t.protocolIsProto2=!0,function(e){e[e.connection=0]="connection",e[e.sys_get=1]="sys_get",e[e.sys_getting=2]="sys_getting",e[e.shell_open=3]="shell_open",e[e.shell_send=4]="shell_send",e[e.shell_getting=5]="shell_getting",e[e.shell_cancel=6]="shell_cancel",e[e.shell_cd=7]="shell_cd",e[e.docker_get=8]="docker_get",e[e.docker_getting=9]="docker_getting",e[e.docker_shell_logs=10]="docker_shell_logs",e[e.docker_shell_logs_getting=11]="docker_shell_logs_getting",e[e.docker_shell_logs_cancel=12]="docker_shell_logs_cancel",e[e.docker_shell_exec_open=13]="docker_shell_exec_open",e[e.docker_shell_exec=14]="docker_shell_exec",e[e.docker_shell_exec_getting=15]="docker_shell_exec_getting",e[e.docker_shell_exec_cancel=16]="docker_shell_exec_cancel",e[e.docker_switch=17]="docker_switch",e[e.docker_del_container=18]="docker_del_container",e[e.process_get=19]="process_get",e[e.process_getting=20]="process_getting",e[e.process_close=21]="process_close",e[e.systemd_inside_get=22]="systemd_inside_get",e[e.systemd_inside_getting=23]="systemd_inside_getting",e[e.systemd_logs_get=24]="systemd_logs_get",e[e.systemd_logs_getting=25]="systemd_logs_getting",e[e.remote_shell_open=26]="remote_shell_open",e[e.remote_shell_send=27]="remote_shell_send",e[e.remote_shell_getting=28]="remote_shell_getting",e[e.remote_shell_cancel=29]="remote_shell_cancel",e[e.remote_shell_cd=30]="remote_shell_cd",e[e.infos=31]="infos",e[e.connect=32]="connect",e[e.rdp_connect=33]="rdp_connect",e[e.rdp_bitmap=34]="rdp_bitmap",e[e.rdp_close=35]="rdp_close",e[e.rdp_error=36]="rdp_error",e[e.mouse=37]="mouse",e[e.wheel=38]="wheel",e[e.scancode=39]="scancode",e[e.unicode=40]="unicode",e[e.rdp_disconnect=41]="rdp_disconnect",e[e.vir_net_serverIno_get=42]="vir_net_serverIno_get",e[e.file_video_trans=43]="file_video_trans",e[e.file_video_trans_progress=44]="file_video_trans_progress",e[e.file_uncompress=45]="file_uncompress",e[e.file_uncompress_progress=46]="file_uncompress_progress",e[e.file_compress=47]="file_compress",e[e.file_compress_progress=48]="file_compress_progress",e[e.rtsp_get=49]="rtsp_get",e[e.rtsp_cancel=50]="rtsp_cancel"}(i||(t.CmdType=i={})),function(e){e[e.data=0]="data",e[e.other=1]="other"}(c||(t.WsConnectType=c={}));var d=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cmdType=t,this.context=r,this.bin_context=n}return r=e,a=[{key:"decode",value:function(t){var r=l.WsMessage.decode(t);return new e(r.code,u.JsonUtil.fromJson(r.context),r.binContext)}}],(n=[{key:"encode",value:function(){if(t.protocolIsProto2)return l.WsMessage.encode(l.WsMessage.create({code:this.cmdType,context:u.JsonUtil.getJson(this.context),binContext:this.bin_context})).finish();var e={type:p.PacketType.EVENT,data:[this.cmdType,this.context]};return h.encode(e)}}])&&o(r.prototype,n),a&&o(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}();t.WsData=d},8411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.otherRouterHandlerMap=t.routerHandlerMap=void 0,t.msg=function(e){return function(n,o,a){var i=r.get(n.name),c=null!=i?i:new n.constructor;a.value,t.routerHandlerMap.set(e,c[o].bind(c))}},t.otherMsg=function(e){return function(n,o,a){var i=r.get(n.name),c=null!=i?i:new n.constructor;a.value,t.otherRouterHandlerMap.set(e,c[o].bind(c))}};var r=new Map;t.routerHandlerMap=new Map,t.otherRouterHandlerMap=new Map},1631:(e,t,r)=>{"use strict";function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(n,i,c,s){var u=h(e[n],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==o(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function a(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(a.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(o(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function c(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.WsServer=t.Wss=void 0;var u=r(5584),l=u.__importDefault(r(5086)),f=r(8411),p=r(4988),h=u.__importStar(r(3211)),d=r(9625),v=r(7016),y=new h.Decoder,m=function(){return c((function e(t){a(this,e),this.dataMap=new Map,this._close=[],this._ws=t,this.id=Date.now().toString()}),[{key:"ws",get:function(){return this._ws}},{key:"sendData",value:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this._ws.send(e[t]);else this._ws.send(e)}},{key:"setClose",value:function(e){this._close.push(e)}}])}();t.Wss=m;var b=function(){return c((function e(){a(this,e)}),[{key:"connection",value:function(e){return u.__awaiter(this,void 0,void 0,n().mark((function t(){var r,o=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("ws客户端连接"),r=new m(e),p.protocolIsProto2||y.on("decoded",(function(e){return u.__awaiter(o,void 0,void 0,n().mark((function t(){var o,a,i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=new p.WsData(e.data[0],e.data[1])).wss=r,!(a=f.routerHandlerMap.get(o.cmdType))){t.next=10;break}return t.next=6,a(o);case 6:i=t.sent,r.sendData(new p.WsData(o.cmdType,i).encode()),t.next=11;break;case 10:console.log("没有匹配到路由");case 11:case"end":return t.stop()}}),t)})))})),r.ws.on("message",(function(e){return u.__awaiter(this,void 0,void 0,n().mark((function t(){var o,a,i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!p.protocolIsProto2){t.next=14;break}if((o=p.WsData.decode(e)).wss=r,!(a=f.routerHandlerMap.get(o.cmdType))){t.next=11;break}return t.next=7,a(o);case 7:i=t.sent,r.sendData(new p.WsData(o.cmdType,i).encode()),t.next=12;break;case 11:console.log("没有匹配到路由");case 12:t.next=15;break;case 14:y.add(e.toString());case 15:case"end":return t.stop()}}),t)})))})),r.ws.on("close",(function(){if(console.log("ws客户端断开"),r._close.length>0)for(;;){var e=r._close.pop();if(!e)break;try{e()}catch(e){console.error("关闭函数",e);break}}}));case 5:case"end":return t.stop()}}),t)})))}}])}();u.__decorate([(0,f.msg)(p.CmdType.connection),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[l.default]),u.__metadata("design:returntype",Promise)],b.prototype,"connection",null);var _=function(){return c((function e(t){a(this,e),this._wss=t}),[{key:"start",value:function(){this._wss.on("connection",(function(e,t){return u.__awaiter(this,void 0,void 0,n().mark((function r(){var o,a,i;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o=v.parse(t.url,!0),a=o.query,r.next=5,d.settingService.check(a.token);case 5:if(r.sent){r.next=9;break}return e.close(),console.log("未验证的ws请求"),r.abrupt("return");case 9:a.type==="".concat(p.WsConnectType.data)?f.routerHandlerMap.get(p.CmdType.connection)(e):a.type==="".concat(p.WsConnectType.other)?(i=f.otherRouterHandlerMap.get(parseInt(a.code)))?i(e,a):console.log("没找到对应路径"):(console.log("ws未找到对应的访问途径"),e.close()),r.next=16;break;case 12:r.prev=12,r.t0=r.catch(0),console.log("ws connection",r.t0),e.close();case 16:case"end":return r.stop()}}),r,null,[[0,12]])})))}))}}])}();t.WsServer=_},648:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequest=void 0;var c=r(5584),s=r(9551),u=r(3480),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"post",value:function(e,t){return c.__awaiter(this,arguments,void 0,(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o().mark((function a(){var i;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s("post",e,t,{json:!r,headers:n});case 2:if(200!==(i=o.sent).statusCode){o.next=7;break}return o.abrupt("return",i.body);case 7:return o.abrupt("return",null);case 8:case"end":return o.stop()}}),a)}))()}))}},{key:"get",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=u.stringify(t),t&&(e="".concat(e,"?").concat(n)),r.next=5,s("get",e);case 5:if(200!==(a=r.sent).statusCode){r.next=8;break}return r.abrupt("return",a.body);case 8:return r.abrupt("return",null);case 11:return r.prev=11,r.t0=r.catch(0),r.abrupt("return",null);case 14:case"end":return r.stop()}}),r,null,[[0,11]])})))}}],(t=null)&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.HttpRequest=l},6557:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=this;function a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}var i=r(5584),c=r(3785),s=r(9896),u=r(5317),l=(u.spawn,u.execSync),f=c.createInterface({input:process.stdin,output:process.stdout}),p={exe_path:process.argv[0].endsWith("node")&&process.argv[1].endsWith("filecat")?"".concat(process.argv[0]," ").concat(process.argv[1]," "):process.argv[0],env_path:"",port:5567,username:"admin",password:"admin",work_dir:"".concat(process.cwd(),"/data"),base_folder:process.cwd()},h=function(e){return new Promise((function(t){return f.question(e,t)}))},d={1:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("1.程序位置-绝对路径(当前-".concat(p.exe_path,"):"));case 2:return(t=e.sent)&&(p.exe_path=t),e.abrupt("return","2");case 5:case"end":return e.stop()}}),e)})))},2:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("2.请输入env文件-绝对路径:");case 2:if(t=e.sent){e.next=7;break}return e.abrupt("return","3");case 7:p.env_path=t;case 8:return e.abrupt("return","");case 9:case"end":return e.stop()}}),e)})))},3:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t,r,n,o,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("3/7.请输入程序端口(默认:5567):");case 2:return(t=e.sent)&&(p.port=parseInt(t)),e.next=6,h("4/7.请输入登录名(默认:admin):");case 6:return(r=e.sent)&&(p.username=r),e.next=10,h("5/7.请输入密码(默认:admin):");case 10:return(n=e.sent)&&(p.password=n),e.next=14,h("6/7.请输入程序缓存数据目录(默认:程序目录下data):");case 14:return(o=e.sent)&&(p.work_dir=o),e.next=18,h("7/7.请输入管理root文件目录(默认:程序目录下):");case 18:return(i=e.sent)&&(p.base_folder=i),e.abrupt("return","");case 21:case"end":return e.stop()}}),e)})))}};i.__awaiter(o,void 0,void 0,a().mark((function e(){var t,r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="1";case 1:return e.next=3,d[t]();case 3:if(r=e.sent){e.next=6;break}return e.abrupt("break",9);case 6:t=r;case 7:e.next=1;break;case 9:f.close(),n=p.env_path?" --env ".concat(p.env_path):" --username ".concat(p.username," --password ").concat(p.password," --port ").concat(p.port," --work_dir ").concat(p.work_dir," --base_folder ").concat(p.base_folder),o="\n[Unit]\nDescription=filecat\nAfter=network.target\n\n[Service]\nExecStart=".concat(p.exe_path," ").concat(n,"\nRestart=always\nUser=root\nGroup=root\nKillMode=process\n[Install]\nWantedBy=multi-user.target\n ");try{s.writeFileSync("/etc/systemd/system/filecat.service",o),l("sudo chmod +x ".concat(p.exe_path)),l("sudo systemctl daemon-reload"),l("sudo systemctl start filecat"),l("sudo systemctl enable filecat")}catch(e){console.error(e)}console.log("安装完成!"),process.exit();case 15:case"end":return e.stop()}}),e)}))).catch((function(e){console.error("出现错误:",e),process.exit()}))},8497:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(6384),a=o.Reader,i=o.Writer,c=o.util,s=o.roots.default||(o.roots.default={});s.WsMessage=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.code=0,e.prototype.context="",e.prototype.binContext=c.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(18).string(e.context),null!=e.binContext&&Object.hasOwnProperty.call(e,"binContext")&&t.uint32(26).bytes(e.binContext),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new s.WsMessage;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.code=e.int32();break;case 2:n.context=e.string();break;case 3:n.binContext=e.bytes();break;default:e.skipType(7&o)}}return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!==n(e)||null===e?"object expected":null!=e.code&&e.hasOwnProperty("code")&&!c.isInteger(e.code)?"code: integer expected":null!=e.context&&e.hasOwnProperty("context")&&!c.isString(e.context)?"context: string expected":null!=e.binContext&&e.hasOwnProperty("binContext")&&!(e.binContext&&"number"==typeof e.binContext.length||c.isString(e.binContext))?"binContext: buffer expected":null},e.fromObject=function(e){if(e instanceof s.WsMessage)return e;var t=new s.WsMessage;return null!=e.code&&(t.code=0|e.code),null!=e.context&&(t.context=String(e.context)),null!=e.binContext&&("string"==typeof e.binContext?c.base64.decode(e.binContext,t.binContext=c.newBuffer(c.base64.length(e.binContext)),0):e.binContext.length>=0&&(t.binContext=e.binContext)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.code=0,r.context="",t.bytes===String?r.binContext="":(r.binContext=[],t.bytes!==Array&&(r.binContext=c.newBuffer(r.binContext)))),null!=e.code&&e.hasOwnProperty("code")&&(r.code=e.code),null!=e.context&&e.hasOwnProperty("context")&&(r.context=e.context),null!=e.binContext&&e.hasOwnProperty("binContext")&&(r.binContext=t.bytes===String?c.base64.encode(e.binContext,0,e.binContext.length):t.bytes===Array?Array.prototype.slice.call(e.binContext):e.binContext),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/WsMessage"},e}(),e.exports=s},9426:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.vg_item=t.pv_item=t.lv_item=void 0;var c=o((function e(){i(this,e)}));t.lv_item=c;var s=o((function e(){i(this,e)}));t.pv_item=s;var u=o((function e(){i(this,e),this.lv_list=[],this.pv_list=[]}));t.vg_item=u},5546:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.self_auth_jscode=t.CustomerApiRouterPojo=void 0;var i=o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));t.CustomerApiRouterPojo=i,t.self_auth_jscode="self_auth_jscode"},7076:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c,s,u;Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsConnection=t.Tengxun=t.Ali=t.DnsPod=t.DdnsIPPojo=t.ip_source_type=t.DdnsType=t.getIpType=void 0,function(e){e[e.www=0]="www",e[e.sys=1]="sys"}(c||(t.getIpType=c={})),function(e){e[e.dnspod=0]="dnspod",e[e.tengxun=1]="tengxun",e[e.ali=2]="ali"}(s||(t.DdnsType=s={})),function(e){e.physics="物理",e.http_get="http_get"}(u||(t.ip_source_type=u={}));var l=o((function e(){i(this,e)}));t.DdnsIPPojo=l;var f=o((function e(){i(this,e)}));t.DnsPod=f;var p=o((function e(){i(this,e)}));t.Ali=p;var h=o((function e(){i(this,e)}));t.Tengxun=h;var d=o((function e(){i(this,e),this.ips=[],this.isOpen=!1}));t.DdnsConnection=d},7228:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.VirNetItem=t.VirClientPojo=t.VirServerPojo=t.VirServerEnum=t.NetPojo=void 0;var c,s=o((function e(){i(this,e)}));t.NetPojo=s,function(e){e[e.tcp=0]="tcp",e[e.udp=1]="udp"}(c||(t.VirServerEnum=c={}));var u=o((function e(){i(this,e),this.open=!1,this.model=c.udp,this.key=""}));t.VirServerPojo=u;var l=o((function e(){i(this,e),this.open=!1,this.key=""}));t.VirClientPojo=l;var f=o((function e(){i(this,e),this.online=!1}));t.VirNetItem=f},2279:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.systemdPojo=t.SysSoftwareItem=t.SysSoftware=t.FileSettingItem=t.TokenSettingReq=t.TokenTimeMode=void 0,function(e){e[e.close=0]="close",e[e.length=1]="length",e[e.forver=2]="forver"}(c||(t.TokenTimeMode=c={}));var s=o((function e(){i(this,e)}));t.TokenSettingReq=s;var u,l=o((function e(){i(this,e),this.default=!1}));t.FileSettingItem=l,function(e){e.ffmpeg="ffmpeg",e.smartmontools="smartmontools",e.ntfs_3g="ntfs_3g"}(u||(t.SysSoftware=u={}));var f=o((function e(){i(this,e)}));t.SysSoftwareItem=f;var p=o((function e(){i(this,e)}));t.systemdPojo=p},6387:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function s(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.SshPojo=t.ShellInitPojo=void 0;var f=s((function e(){l(this,e)}));t.ShellInitPojo=f;var p=function(e){function t(){return l(this,t),n(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(t,e),s(t,null,[{key:"getKey",value:function(e){var t;return null!==(t=e.private_path)&&void 0!==t?t:e.domain+e.port+e.username+e.password}}])}(f);t.SshPojo=p},6406:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.SysCmdExePojo=t.SysCmd=t.DiskCheckInfo=t.diskCheckAttr=t.DiskFilePojo=t.DiskDevicePojo=void 0;var c=o((function e(){i(this,e)}));t.DiskDevicePojo=c;var s=o((function e(){i(this,e)}));t.DiskFilePojo=s;var u=o((function e(){i(this,e)}));t.diskCheckAttr=u;var l,f=o((function e(){i(this,e)}));t.DiskCheckInfo=f,function(e){e[e.mount=0]="mount"}(l||(t.SysCmd=l={}));var p=o((function e(){i(this,e)}));t.SysCmdExePojo=p},4908:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.UserBaseInfo=t.SysEnum=t.UserLogin=void 0;var c,s=o((function e(){i(this,e)}));t.UserLogin=s,function(e){e[e.win=0]="win",e[e.linux=1]="linux"}(c||(t.SysEnum=c={}));var u=o((function e(){i(this,e)}));t.UserBaseInfo=u},9044:(e,t,r)=>{"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.require_c=void 0,t.get_wintun_dll_path=function(){try{var e=s.default.join(p.Env.work_dir,"packges","filecat_dlls");d.default.ensureDirSync(e);var t=f.default.arch();switch(t){case"arm":case"arm64":default:break;case"ia32":t="x86";break;case"x64":t="amd64"}var r="wintun".concat(t?"-".concat(t):"",".dll"),n=s.default.join(e,r);return h.existsSync(n)||function(e,t){s.default.basename(e);if(!h.existsSync(t)){var r=h.readFileSync(e);h.writeFileSync(t,r)}}(s.default.resolve("node_modules/@xiaobaidadada/node-tuntap2-wintun/wintun_dll",r),n),n}catch(e){console.log(e)}},t.getFfmpeg=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.ffmpeg&&r.installed&&r.path&&y.setFfmpegPath(r.path)}}catch(e){t.e(e)}finally{t.f()}return y},t.getSmartctl=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.smartmontools&&r.installed&&r.path&&(m=r.path)}}catch(e){t.e(e)}finally{t.f()}return m},t.get_ntfs_3g=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.ntfs_3g&&r.installed&&r.path&&(b=r.path)}}catch(e){t.e(e)}finally{t.f()}return b},t.getProcessAddon=function(){var e=(0,i.getSys)();if(e===c.SysEnum.linux||e===c.SysEnum.win){return r(4505).node_process_watcher}};var a=r(5584),i=r(5101),c=r(4908),s=a.__importDefault(r(6928)),u=r(9625),l=r(2279),f=a.__importDefault(r(857)),p=r(4321),h=r(9896),d=a.__importDefault(r(4652)),v=r(8995).createRequire;t.require_c=v(__filename);var y=r(1856);var m="smartctl";var b="ntfs-3g"},1668:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.CryptoController=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(3537),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"generate",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,u.Sucess)(l.crypto_service.generate(e.type,e.form)));case 1:case"end":return t.stop()}}),t)})))}},{key:"save_openssh",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.crypto_service.save_openssh(e.name,e.context),t.abrupt("return",(0,u.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CryptoController=f,c.__decorate([(0,s.Post)("/generate"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],f.prototype,"generate",null),c.__decorate([(0,s.Post)("/save_openssh"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],f.prototype,"save_openssh",null),t.CryptoController=f=c.__decorate([(0,s.Controller)("/crypto")],f)},3537:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.crypto_service=t.CryptoService=void 0;var i=r(5584),c=i.__importDefault(r(6928)),s=i.__importDefault(r(9896)),u=i.__importDefault(r(4652)),l=r(5317),f=r(5101),p=r(4908),h=r(6982),d=r(6011),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.home_path=""},(t=[{key:"get_home_path",value:function(){return this.home_path||(this.home_path=c.default.join(process.env.HOME,".ssh")),this.home_path}},{key:"to_openssh_form",value:function(e,t){return{opensshPublicKey:d.parseKey(e).toString("ssh"),opensshPrivateKey:d.parsePrivateKey(t).toString("ssh")}}},{key:"get_RSA",value:function(){var e=h.generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{publicKey:e.publicKey,privateKey:e.privateKey}}},{key:"get_ECDSA",value:function(){var e=h.generateKeyPairSync("ec",{namedCurve:"P-521",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{publicKey:e.publicKey,privateKey:e.privateKey}}},{key:"get_DSA",value:function(){var e=h.generateKeyPairSync("dsa",{modulusLength:2048,publicExponent:65537}),t=e.publicKey,r=e.privateKey;return{publicKey:t=t.export({type:"spki",format:"pem"}),privateKey:r=r.export({type:"pkcs8",format:"pem"})}}},{key:"generate",value:function(e,t){var r,n;switch(e){case"rsa":var o=this.get_RSA(),a=o.publicKey;n=o.privateKey,r=a;break;case"ecdsa":var i=this.get_ECDSA(),c=i.publicKey;n=i.privateKey,r=c;break;case"dsa":var s=this.get_DSA(),u=s.publicKey;n=s.privateKey,r=u}if("pem"!==t&&r&&n){var l=this.to_openssh_form(r,n);return{public_key:l.opensshPublicKey,private_key:l.opensshPrivateKey,home_path:this.get_home_path()}}return{public_key:r,private_key:n}}},{key:"save_openssh",value:function(e,t){u.default.ensureDirSync(this.get_home_path());var r=c.default.join(this.get_home_path(),e);s.default.writeFileSync(r,t),(0,f.getSys)()===p.SysEnum.linux&&(0,l.execSync)("chmod 600 ".concat(r))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CryptoService=v,t.crypto_service=new v},274:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DataUtil=t.file_key=void 0;var i,c=r(5584),s=c.__importDefault(r(6928)),u=c.__importDefault(r(9896)),l=c.__importDefault(r(4652)),f=r(4321);!function(e){e.data="data",e.systemd="systemd"}(i||(t.file_key=i={}));var p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"init",value:function(e){var t=this.data_path_map[e];null==t&&(this.data_path_map[e]=t=s.default.join(f.Env.work_dir,"data.json"),u.default.existsSync(t)?this.data_map[e]=JSON.parse(u.default.readFileSync(t).toString()):(l.default.ensureDirSync(f.Env.work_dir),u.default.writeFileSync(t,"{}"),this.data_map[e]={}))}},{key:"checkFile",value:function(e,t){var r=s.default.join(f.Env.work_dir,t,e);return!!u.default.existsSync(r)||(l.default.ensureDirSync(s.default.join(f.Env.work_dir,t)),u.default.writeFileSync(r,""),!1)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.data;return this.init(t),this.data_map[t][e]}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.data;this.init(r),this.data_map[r][e]=t,u.default.writeFileSync(this.data_path_map[r],JSON.stringify(this.data_map[r]))}},{key:"getFile",value:function(e){var t=s.default.join(f.Env.work_dir,"datafile",e);return this.checkFile(e,"datafile")?u.default.readFileSync(t).toString():""}},{key:"setFile",value:function(e,t){var r=s.default.join(f.Env.work_dir,"datafile",e);this.checkFile(e,"datafile"),u.default.writeFileSync(r,t)}},{key:"writeFileSyncTemp",value:function(e,t,r){var n=s.default.join(f.Env.work_dir,t,e);return this.checkFile(e,t),u.default.writeFileSync(n,r),n}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DataUtil=p,p.data_path_map={},p.data_map={}},4465:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.aliService=t.AliService=t.alidnsEndpoint=t.ddns_ali_key=void 0,t.generateAliSignature=v;var f=r(5584),p=r(603),h=r(648),d=r(6982);function v(e,t){var r=Object.keys(e).sort().map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&"),n="GET&%2F&".concat(encodeURIComponent(r));return d.createHmac("sha1","".concat(t,"&")).update(n).digest("base64")}t.ddns_ali_key="ali_ddns_key",t.alidnsEndpoint="https://alidns.aliyuncs.com/";var y=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,e),n=r,(i=[{key:"getDdnsKey",value:function(){return t.ddns_ali_key}},{key:"update",value:function(e,r,n,a){return f.__awaiter(this,void 0,void 0,o().mark((function i(){var c,s,u,l,f,p;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return c=e.account,(s={Action:"DescribeSubDomainRecords",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",DomainName:r.domain,SubDomain:r.subdomain}).Signature=v(s,c.accesskey_secret),o.next=5,h.HttpRequest.get(t.alidnsEndpoint,s);case 5:if(!((u=o.sent).TotalCount>0)){o.next=14;break}return l=u.DomainRecords.Record[0],(f={Action:"UpdateDomainRecord",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",RecordId:l.RecordID,RR:r.subdomain,Type:a,Value:n}).Signature=v(f,c.accesskey_secret),o.next=12,h.HttpRequest.get(t.alidnsEndpoint,f);case 12:o.next=18;break;case 14:return(p={Action:"AddDomainRecord",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",DomainName:r.domain,RR:r.subdomain,Value:n,Type:a}).Signature=v(p,c.accesskey_secret),o.next=18,h.HttpRequest.get(t.alidnsEndpoint,p);case 18:case"end":return o.stop()}}),i)})))}}])&&a(n.prototype,i),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,s}(p.DdnsPre);t.AliService=y,t.aliService=new y},5740:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsController=void 0;var c=r(5584),s=r(9334),u=r(4233),l=r(7076),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getIps",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",u.ddnsService.getIps(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",u.ddnsService.save(e));case 1:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DdnsController=f,c.__decorate([(0,s.Get)("/ips/:type"),c.__param(0,(0,s.Param)("type")),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[String]),c.__metadata("design:returntype",Promise)],f.prototype,"getIps",null),c.__decorate([(0,s.Post)("/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[l.DdnsConnection]),c.__metadata("design:returntype",Promise)],f.prototype,"save",null),t.DdnsController=f=c.__decorate([(0,s.Controller)("/ddns")],f)},8403:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.dnspodService=t.DnsPodService=t.ddns_dnspod_key=void 0;var h=r(5584),d=r(648),v=r(274),y=r(8932),m=r(2953),b=r(603);t.ddns_dnspod_key="ddns_dnspod";var _=!1,g=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),u(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(r,e),n=r,(a=[{key:"dnspodCreate",value:function(e,t,r,n,o,a){return h.__awaiter(this,void 0,void 0,i().mark((function c(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.Create",{format:"json",login_token:"".concat(t,",").concat(r),record_type:a,sub_domain:n,domain:o,value:e,record_line:"默认"},!0);case 2:case"end":return i.stop()}}),c)})))}},{key:"dnspodUpdate",value:function(e,t,r,n,o,a,c){return h.__awaiter(this,void 0,void 0,i().mark((function s(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.Modify",{format:"json",login_token:"".concat(r,",").concat(n),record_type:c,sub_domain:o,domain:a,value:t,record_id:e,record_line:"默认"},!0);case 2:case"end":return i.stop()}}),s)})))}},{key:"dnspodGet",value:function(e,t,r,n){return h.__awaiter(this,void 0,void 0,i().mark((function o(){var a;return i().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.List",{format:"json",login_token:"".concat(e,",").concat(t),sub_domain:r,domain:n},!0);case 2:return a=o.sent,o.abrupt("return",a);case 4:case"end":return o.stop()}}),o)})))}},{key:"Run",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,a,c,s,u,l,f,p,h,d,b,g,E;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,v.DataUtil.get(t.ddns_dnspod_key);case 3:if(!((n=r.sent)&&n.isOpen&&n.ips&&n.ips.length>0)){r.next=52;break}a=(0,y.getMapByList)(e,(function(e){return e.ifaceOrWww+e.isIPv4})),c=!1,s=o(n.ips),r.prev=8,s.s();case 10:if((u=s.n()).done){r.next=43;break}if(l=u.value,r.prev=12,!(f=a.get(l.ifaceOrWww+l.isIPv4))){r.next=39;break}if(l.ip!==f.ip||!_){r.next=17;break}return r.abrupt("continue",41);case 17:l.ip=f.ip,c=!0,p=l.ddnsHost.split(" "),h=o(p),r.prev=21,h.s();case 23:if((d=h.n()).done){r.next=31;break}return b=d.value,g=l.isIPv4?"A":"AAAA",E=(0,m.parse)(b),r.next=29,this.update(n,E,l.ip,g);case 29:r.next=23;break;case 31:r.next=36;break;case 33:r.prev=33,r.t0=r.catch(21),h.e(r.t0);case 36:return r.prev=36,h.f(),r.finish(36);case 39:return r.prev=39,r.finish(39);case 41:r.next=10;break;case 43:r.next=48;break;case 45:r.prev=45,r.t1=r.catch(8),s.e(r.t1);case 48:return r.prev=48,s.f(),r.finish(48);case 51:c&&(_=!0,v.DataUtil.set(t.ddns_dnspod_key,n));case 52:return r.prev=52,r.finish(52);case 54:case"end":return r.stop()}}),r,this,[[0,,52,54],[8,45,48,51],[12,,39,41],[21,33,36,39]])})))}},{key:"update",value:function(e,t,r,n){return h.__awaiter(this,void 0,void 0,i().mark((function o(){var a,c;return i().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.dnspodGet(e.account.id,e.account.token,t.subdomain,t.domain);case 2:if(!((a=o.sent).records&&a.records.length>0)){o.next=9;break}return c=a.records[0],o.next=7,this.dnspodUpdate(c.id,r,e.account.id,e.account.token,t.subdomain,t.domain,n);case 7:o.next=11;break;case 9:return o.next=11,this.dnspodCreate(r,e.account.id,e.account.token,t.subdomain,t.domain,n);case 11:case"end":return o.stop()}}),o,this)})))}},{key:"getDdnsKey",value:function(){return t.ddns_dnspod_key}}])&&c(n.prototype,a),s&&c(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,s}(b.DdnsPre);t.DnsPodService=g,t.dnspodService=new g},603:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsPre=void 0;var u=r(5584),l=u.__importDefault(r(333)),f=r(7076),p=r(648),h=r(274),d=r(8932),v=r(2953),y="https://4.ipw.cn",m="https://6.ipw.cn",b=null,_=[],g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.async_have=!1},(t=[{key:"getWwwIp4",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.HttpRequest.get(y);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"getWwwIp6",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.HttpRequest.get(m);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"getNowIps",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Date.now(),!(b&&t-b<3e4)){e.next=4;break}e.next=8;break;case 4:if(0!==_.length){e.next=7;break}return e.next=7,this.updateAndGetIps();case 7:this.updateAndGetIps().catch((function(e){console.log("获取ip错误",e)}));case 8:return e.abrupt("return",_);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"updateAndGetIps",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s,u,p,h,d,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b=Date.now(),e.next=3,l.default.networkInterfaces();case 3:t=e.sent,r=[],n=o(Array.isArray(t)?t:[t]);try{for(n.s();!(a=n.n()).done;)(c=a.value).ip4&&((s=new f.DdnsIPPojo).isIPv4=!0,s.ifaceOrWww=c.iface,s.ip=c.ip4,s.source_type=f.ip_source_type.physics,r.push(s)),c.ip6&&((u=new f.DdnsIPPojo).isIPv4=!1,u.ifaceOrWww=c.iface,u.ip=c.ip6,u.source_type=f.ip_source_type.physics,r.push(u))}catch(e){n.e(e)}finally{n.f()}return e.next=9,this.getWwwIp4();case 9:return(p=e.sent)&&((h=new f.DdnsIPPojo).isIPv4=!0,h.ifaceOrWww=y,h.ip=p,h.source_type=f.ip_source_type.http_get,r.push(h)),e.next=13,this.getWwwIp6();case 13:return(d=e.sent)&&((v=new f.DdnsIPPojo).isIPv4=!1,v.ifaceOrWww=m,v.ip=d,v.source_type=f.ip_source_type.http_get,r.push(v)),_=r,e.abrupt("return",r);case 17:case"end":return e.stop()}}),e,this)})))}},{key:"Run",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,a,c,s,u,l,f,p,y,m,b,_;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,h.DataUtil.get(this.getDdnsKey());case 3:if(!((r=t.sent)&&r.isOpen&&r.ips&&r.ips.length>0)){t.next=52;break}n=(0,d.getMapByList)(e,(function(e){return e.ifaceOrWww+e.isIPv4})),a=!1,c=o(r.ips),t.prev=8,c.s();case 10:if((s=c.n()).done){t.next=43;break}if(u=s.value,t.prev=12,!(l=n.get(u.ifaceOrWww+u.isIPv4))){t.next=39;break}if(u.ip!==l.ip||!this.async_have){t.next=17;break}return t.abrupt("continue",41);case 17:u.ip=l.ip,a=!0,f=u.ddnsHost.split(" "),p=o(f),t.prev=21,p.s();case 23:if((y=p.n()).done){t.next=31;break}return m=y.value,b=u.isIPv4?"A":"AAAA",_=(0,v.parse)(m),t.next=29,this.update(r,_,u.ip,b);case 29:t.next=23;break;case 31:t.next=36;break;case 33:t.prev=33,t.t0=t.catch(21),p.e(t.t0);case 36:return t.prev=36,p.f(),t.finish(36);case 39:return t.prev=39,t.finish(39);case 41:t.next=10;break;case 43:t.next=48;break;case 45:t.prev=45,t.t1=t.catch(8),c.e(t.t1);case 48:return t.prev=48,c.f(),t.finish(48);case 51:a&&(this.async_have=!0,h.DataUtil.set(this.getDdnsKey(),r));case 52:t.next=57;break;case 54:t.prev=54,t.t2=t.catch(0),console.log(t.t2);case 57:case"end":return t.stop()}}),t,this,[[0,54],[8,45,48,51],[12,,39,41],[21,33,36,39]])})))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DdnsPre=g},4233:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ddnsService=t.DdnsService=void 0;var h=r(5584),d=r(7076),v=r(648),y=r(5890),m=r(274),b=r(5453),_=r(8932),g=r(8403),E=r(603),w=r(1140),P=r(4465),S=r(7989).dnspod.v20210323.Client,k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,(n=[{key:"ddnsTask",value:function(){var e=this;setInterval((function(){return h.__awaiter(e,void 0,void 0,i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateAndGetIps();case 2:return t=e.sent,e.next=5,g.dnspodService.Run(t);case 5:return e.next=7,w.tengxunService.Run(t);case 7:return e.next=9,P.aliService.Run(t);case 9:case"end":return e.stop()}}),e,this)})))}),6e5)}},{key:"getIps",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,a,c,s,u,l,f,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNowIps();case 2:r=t.sent,n="",t.t0=e,t.next="dnspod"===t.t0?7:"tx"===t.t0?9:"ali"===t.t0?11:13;break;case 7:return n=g.ddns_dnspod_key,t.abrupt("break",13);case 9:return n=w.ddns_tx_key,t.abrupt("break",13);case 11:return n=P.ddns_ali_key,t.abrupt("break",13);case 13:return a=new d.DdnsConnection,t.next=16,m.DataUtil.get(n);case 16:if(c=t.sent,a.ips=r,c&&c.ips&&c.ips.length>0){s=(0,_.getMapByList)(c.ips,(function(e){return e.ifaceOrWww+e.isIPv4})),u=o(a.ips);try{for(u.s();!(l=u.n()).done;)f=l.value,(p=s.get(f.ifaceOrWww+f.isIPv4))&&(f.ddnsHost=p.ddnsHost)}catch(e){u.e(e)}finally{u.f()}}return c&&(a.isOpen=c.isOpen,a.account=c.account),t.abrupt("return",(0,y.Sucess)(a));case 21:case"end":return t.stop()}}),t,this)})))}},{key:"save",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r="",t.t0=e.ddnsType,t.next=t.t0===d.DdnsType.dnspod?4:t.t0===d.DdnsType.tengxun?6:t.t0===d.DdnsType.ali?8:10;break;case 4:return r=g.ddns_dnspod_key,t.abrupt("break",10);case 6:return r=w.ddns_tx_key,t.abrupt("break",10);case 8:return r=P.ddns_ali_key,t.abrupt("break",10);case 10:if(!e.isOpen){t.next=55;break}if(e.ddnsType!==d.DdnsType.dnspod){t.next=26;break}return r=g.ddns_dnspod_key,t.prev=13,t.next=16,v.HttpRequest.post("https://dnsapi.cn/User.Detail",{format:"json",login_token:"".concat(e.account.id,",").concat(e.account.token)},!0);case 16:if(t.sent.status.code+""=="1"){t.next=19;break}return t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 19:t.next=24;break;case 21:return t.prev=21,t.t1=t.catch(13),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 24:case 37:t.next=52;break;case 26:if(e.ddnsType!==d.DdnsType.tengxun){t.next=39;break}return r=w.ddns_tx_key,t.prev=28,n=new S({credential:{secretId:e.account.secretid,secretKey:e.account.secretkey}}),t.next=32,n.DescribeUserDetail();case 32:t.next=37;break;case 34:return t.prev=34,t.t2=t.catch(28),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 39:if(e.ddnsType!==d.DdnsType.ali){t.next=52;break}return r=P.ddns_ali_key,t.prev=41,(o={Action:"DescribeTags",AccessKeyId:e.account.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",ResourceType:"DOMAIN"}).Signature=(0,P.generateAliSignature)(o,e.account.accesskey_secret),t.next=46,v.HttpRequest.get(P.alidnsEndpoint,o);case 46:t.sent,t.next=52;break;case 49:return t.prev=49,t.t3=t.catch(41),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 52:return t.next=54,m.DataUtil.set(r,e);case 54:return t.abrupt("return",(0,y.Sucess)("身份信息正确"));case 55:return t.next=57,m.DataUtil.set(r,e);case 57:return t.abrupt("return",(0,y.Sucess)("保存成功"));case 58:case"end":return t.stop()}}),t,null,[[13,21],[28,34],[41,49]])})))}},{key:"getDdnsKey",value:function(){}},{key:"update",value:function(e,t,r,n){}}])&&c(r.prototype,n),a&&c(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(E.DdnsPre);t.DdnsService=k,t.ddnsService=new k,t.ddnsService.ddnsTask()},1140:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.tengxunService=t.TengxunService=t.ddns_tx_key=void 0;var f=r(5584),p=r(603),h=r(7989).dnspod.v20210323.Client;t.ddns_tx_key="tengxun_ddns_key";var d=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,e),n=r,(i=[{key:"getDdnsKey",value:function(){return t.ddns_tx_key}},{key:"update",value:function(e,t,r,n){return f.__awaiter(this,void 0,void 0,o().mark((function a(){var i,c,s;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=e.account,c=new h({credential:{secretId:i.secretid,secretKey:i.secretkey}}),o.next=4,c.DescribeRecordList({Domain:t.domain,Subdomain:t.subdomain});case 4:if(!((s=o.sent).RecordList&&s.RecordList.length>0)){o.next=10;break}return o.next=8,c.ModifyRecord({RecordType:n,SubDomain:t.subdomain,Domain:t.domain,Value:r,RecordLine:"默认"});case 8:o.next=12;break;case 10:return o.next=12,c.CreateRecord({RecordType:n,SubDomain:t.subdomain,Domain:t.domain,Value:r,RecordLine:"默认"});case 12:case"end":return o.stop()}}),a)})))}}])&&a(n.prototype,i),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,s}(p.DdnsPre);t.TengxunService=d,t.tengxunService=new d},5658:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.FileCompress=void 0;var f=r(5584),p=f.__importDefault(r(6928)),h=r(9896),d=r(2029),v=r(6819),y=(r(3106),r(7172)),m=r(1231),b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"unZip",value:function(e,t,r){var n=h.statSync(e).size,o=0,a=h.createReadStream(e),i=d.Extract({path:t});a.on("data",(function(e){o+=e.length,r(o/n*100)})),a.on("end",(function(){r(100)})),i.on("error",(function(e){r(-1)})),a.pipe(i)}},{key:"unTar",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=h.statSync(e).size,a=0,i=h.createReadStream(e),c=v.x({cwd:t,gzip:n});i.on("data",(function(e){a+=e.length,r(a/o*100)})),i.on("end",(function(){r(100)})),i.on("error",(function(e){r(-1)})),c.on("error",(function(e){r(-1)})),i.pipe(c)}},{key:"unRar",value:function(e,t,r){return f.__awaiter(this,void 0,void 0,o().mark((function n(){var c,s,u,l,f,d,v,y,b,_,g,E,w,P,S,k;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c=Uint8Array.from(h.readFileSync(e)).buffer,n.next=3,m.createExtractorFromData({data:c});case 3:s=n.sent,u=s.extract({}),l=i(u.files),f=[],d=[],v=a(l);try{for(v.s();!(y=v.n()).done;)(b=y.value).fileHeader.flags.directory?f.push(b):d.push(b)}catch(e){v.e(e)}finally{v.f()}for(_=0,r(0),g=0,E=f;g<E.length;g++)w=E[g],h.mkdirSync(p.default.join(t,w.fileHeader.name),{recursive:!0}),_++,r(_/l.length*100);for(P=0,S=d;P<S.length;P++)k=S[P],h.writeFileSync(p.default.join(t,k.fileHeader.name),k.extraction),_++,r(_/l.length*100);r(100);case 15:case"end":return n.stop()}}),n)})))}},{key:"compress",value:function(e,t,r,n,o,a){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=h.createWriteStream(r),s=y(e,{zlib:{level:t},gzip:i});a(0),c.on("close",(function(){a(100)})),s.on("progress",(function(e){var t=e.fs,r=t.totalBytes,n=t.processedBytes;a(n/r*100)})),s.on("error",(function(e){a(-1)})),s.pipe(c),n.forEach((function(e){s.file(e,{name:p.default.basename(e)})})),o.forEach((function(e){s.directory(e,p.default.basename(e))})),s.finalize()}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.FileCompress=b},6182:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.FileController=void 0;var s=r(5584),u=r(9334),l=r(7127),f=r(5890),p=s.__importDefault(r(8461)),h=r(285),d=r(8411),v=r(4988),y=r(9625),m=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRootFile",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.FileServiceImpl.getFile("",e.headers.authorization);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))}},{key:"getFile",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.getFile(t,e.headers.authorization,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))}},{key:"getFileInfo",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=f.Sucess,r.next=3,l.FileServiceImpl.getFileInfo(t.type,t.path,e.headers.authorization);case 3:return r.t1=r.sent,r.abrupt("return",(0,r.t0)(r.t1));case 5:case"end":return r.stop()}}),r)})))}},{key:"uploadFile",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.uploadFile(t,r,e.headers.authorization);case 2:return n.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return n.stop()}}),n)})))}},{key:"deletes",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.deletes(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"save",value:function(e,t,r,n){return s.__awaiter(this,void 0,void 0,o().mark((function a(){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,l.FileServiceImpl.save(e.headers.authorization,null==r?void 0:r.context,t,n);case 2:return o.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return o.stop()}}),a)})))}},{key:"common_base64_save",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.common_base64_save(e.headers.authorization,t,r.base64_context,r.type);case 2:return n.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return n.stop()}}),n)})))}},{key:"cut",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.cut(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"copy",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.copy(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"newFile",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.newFile(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"newDir",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.newDir(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"rename",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.rename(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"switchBasePath",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(n=h.Cache.getTokenMap().get(t.headers.authorization))&&(n.root_index=e.root_index),r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"switchGetBasePath",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(r=h.Cache.getTokenMap().get(e.headers.authorization)).root_index)n=r.root_index;else for(a=y.settingService.getFilesSetting(),i=0;i<a.length;i++)a[i].default&&(n=i);return t.abrupt("return",(0,f.Sucess)(n));case 3:case"end":return t.stop()}}),t)})))}},{key:"file_video_trans",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.file_video_trans(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"uncompress",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.uncompress(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"compress",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.FileCompress(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"studio_get_item",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=f.Sucess,r.next=3,l.FileServiceImpl.studio_get_item(e.path,t.headers.authorization);case 3:return r.t1=r.sent,r.abrupt("return",(0,r.t0)(r.t1));case 5:case"end":return r.stop()}}),r)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.FileController=m,s.__decorate([(0,u.Get)(),s.__param(0,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object]),s.__metadata("design:returntype",Promise)],m.prototype,"getRootFile",null),s.__decorate([(0,u.Get)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.QueryParam)("is_sys_path",{required:!1})),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Number]),s.__metadata("design:returntype",Promise)],m.prototype,"getFile",null),s.__decorate([(0,u.Post)("/file/info"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"getFileInfo",null),s.__decorate([(0,u.Put)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.UploadedFile)("file")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,"function"==typeof(c=void 0!==p.default&&p.default.File)?c:Object]),s.__metadata("design:returntype",Promise)],m.prototype,"uploadFile",null),s.__decorate([(0,u.Delete)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String]),s.__metadata("design:returntype",Promise)],m.prototype,"deletes",null),s.__decorate([(0,u.Post)("/save/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.Body)()),s.__param(3,(0,u.QueryParam)("is_sys_path",{required:!1})),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Object,Number]),s.__metadata("design:returntype",Promise)],m.prototype,"save",null),s.__decorate([(0,u.Post)("/base64/save/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"common_base64_save",null),s.__decorate([(0,u.Post)("/cut"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"cut",null),s.__decorate([(0,u.Post)("/copy"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"copy",null),s.__decorate([(0,u.Post)("/new/file"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"newFile",null),s.__decorate([(0,u.Post)("/new/dir"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"newDir",null),s.__decorate([(0,u.Post)("/rename"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"rename",null),s.__decorate([(0,u.Post)("/base_switch"),s.__param(0,(0,u.Body)()),s.__param(1,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"switchBasePath",null),s.__decorate([(0,u.Post)("/base_switch/get"),s.__param(0,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object]),s.__metadata("design:returntype",Promise)],m.prototype,"switchGetBasePath",null),s.__decorate([(0,d.msg)(v.CmdType.file_video_trans),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"file_video_trans",null),s.__decorate([(0,d.msg)(v.CmdType.file_uncompress),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"uncompress",null),s.__decorate([(0,d.msg)(v.CmdType.file_compress),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"compress",null),s.__decorate([(0,u.Post)("/studio/get/item"),s.__param(0,(0,u.Body)()),s.__param(1,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"studio_get_item",null),t.FileController=m=s.__decorate([(0,u.Controller)("/file")],m)},7127:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceImpl=void 0;var h=r(5584),d=r(8076),v=h.__importDefault(r(9896)),y=h.__importDefault(r(4652)),m=h.__importDefault(r(6928)),b=r(5890),_=r(9485),g=r(7699),E=h.__importStar(r(7075)),w=r(9625),P=r(4988),S=r(5453),k=r(5658),A=r(9044),T=r(4861),O=h.__importDefault(r(333)),L=r(7172),C=r(904),x=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,n=[{key:"getFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var i,c,s,u,l,f,p,h,y,_,E,P,k,A,O,L,C,x;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(u={files:[],folders:[]},l=1===r?"/".concat(decodeURIComponent(e)):m.default.join(w.settingService.getFileRootPath(t),e?decodeURIComponent(e):""),v.default.existsSync(l)){n.next=4;break}return n.abrupt("return",(0,b.Fail)("路径不存在",S.RCode.Fail));case 4:if(!(f=v.default.statSync(l)).isFile()){n.next=15;break}if(!(f.size>20971520)){n.next=8;break}return n.abrupt("return",(0,b.Fail)("超过20MB",S.RCode.File_Max));case 8:return p=m.default.basename(l),h=v.default.readFileSync(l),(y=(0,b.Sucess)(h.toString(),S.RCode.PreFile)).message=p,n.abrupt("return",y);case 15:if(f.isDirectory()){n.next=17;break}return n.abrupt("return",(0,b.Fail)("不是文件",S.RCode.Fail));case 17:_=v.default.readdirSync(l),E=a(_);try{for(E.s();!(P=E.n()).done;){k=P.value,A=m.default.join(l,k),O=null;try{O=v.default.statSync(A)}catch(e){console.log("读取错误",e)}L=O?(0,g.getShortTime)(new Date(O.mtime).getTime()):"",C=O?(0,g.formatFileSize)(O.size):"",O&&O.isFile()?(x=(0,T.getFileFormat)(k),null===(i=u.files)||void 0===i||i.push({type:x,name:k,mtime:L,size:C,isLink:O.isSymbolicLink(),path:"".concat(e,"/").concat(k)})):O&&O.isDirectory()?null===(c=u.folders)||void 0===c||c.push({type:d.FileTypeEnum.folder,name:k,mtime:L,isLink:O.isSymbolicLink(),path:e}):null===(s=u.files)||void 0===s||s.push({type:d.FileTypeEnum.dev,name:k,mtime:L,size:C,path:"".concat(e,"/").concat(k)})}}catch(e){E.e(e)}finally{E.f()}return n.abrupt("return",(0,b.Sucess)(u));case 21:case"end":return n.stop()}}),n)})))}},{key:"getFileInfo",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a={},i=m.default.join(w.settingService.getFileRootPath(r),decodeURIComponent(t)),n.t0=e,n.next=n.t0===d.FileTypeEnum.folder?5:9;break;case 5:return n.next=7,this.getDiskSizeForPath(i);case 7:return a=n.sent,n.abrupt("break",10);case 9:return n.abrupt("break",10);case 10:return n.abrupt("return",a);case 11:case"end":return n.stop()}}),n,this)})))}},{key:"uploadFile",value:function(e,t,r){var n=m.default.join(w.settingService.getFileRootPath(r),e?decodeURIComponent(e):"");t?v.default.writeFileSync(n,t.buffer):v.default.existsSync(n)||v.default.mkdirSync(n,{recursive:!0})}},{key:"deletes",value:function(e,t){if(t){var r=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(t));v.default.statSync(r).isFile()?v.default.unlinkSync(r):(0,_.rimraf)(r)}}},{key:"save",value:function(e,t,r,n){if(null!=t){var o=1===n?"/".concat(decodeURIComponent(r)):m.default.join(w.settingService.getFileRootPath(e),r?decodeURIComponent(r):"");v.default.writeFileSync(o,t)}}},{key:"common_base64_save",value:function(e,t,r,n){var o=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(t)),a=Buffer.from(r,"base64");n===d.base64UploadType.all||n===d.base64UploadType.start?v.default.writeFileSync(o,a):n===d.base64UploadType.part&&v.default.appendFileSync(o,a)}},{key:"cut",value:function(e,t){if(t){var r,n=w.settingService.getFileRootPath(e),o=m.default.join(n),i=m.default.join(n,t.to?decodeURIComponent(t.to):""),c=a(t.files);try{for(c.s();!(r=c.n()).done;){var s=r.value,u=decodeURIComponent(m.default.join(o,s));v.default.renameSync(u,decodeURIComponent(m.default.join(i,m.default.basename(s)))),(0,_.rimraf)(u)}}catch(e){c.e(e)}finally{c.f()}}}},{key:"copy",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,i,c,s,u,l,f;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=2;break}return r.abrupt("return");case 2:n=w.settingService.getFileRootPath(e),i=m.default.join(n),c=m.default.join(n,t.to?decodeURIComponent(t.to):""),s=a(t.files),r.prev=6,s.s();case 8:if((u=s.n()).done){r.next=15;break}return l=u.value,f=decodeURIComponent(m.default.join(i,l)),r.next=13,y.default.copy(f,decodeURIComponent(m.default.join(c,m.default.basename(l))),{overwrite:!0});case 13:r.next=8;break;case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(6),s.e(r.t0);case 20:return r.prev=20,s.f(),r.finish(20);case 23:case"end":return r.stop()}}),r,null,[[6,17,20,23]])})))}},{key:"newFile",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.todoNew(e,2,t);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"newDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.todoNew(e,1,t);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"todoNew",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=r){n.next=2;break}return n.abrupt("return");case 2:if(i=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(r.name)),!v.default.existsSync(i)){n.next=5;break}return n.abrupt("return");case 5:1===t?v.default.mkdirSync(i,{recursive:!0}):v.default.writeFileSync(i,null!==(a=r.context)&&void 0!==a?a:"");case 6:case"end":return n.stop()}}),n)})))}},{key:"rename",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=2;break}return r.abrupt("return");case 2:return n=w.settingService.getFileRootPath(e),a=m.default.join(n,decodeURIComponent(t.name)),i=m.default.join(n,decodeURIComponent(t.newName)),r.next=7,y.default.rename(a,i);case 7:case"end":return r.stop()}}),r)})))}},{key:"download",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s,u,l,f,p,h,d,y,b,_;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=e.request.query.file)&&r.length){t.next=5;break}return e.status=404,e.body="File not found",t.abrupt("return");case 5:return n=e.query.token,t.next=8,w.settingService.check(n);case 8:if(t.sent){t.next=12;break}return e.status=404,e.body="File not found",t.abrupt("return");case 12:if(Array.isArray(r)){f=r,p=L("zip",{zlib:{level:5}}),e.attachment("output.zip"),e.set("Content-Type","application/octet-stream"),h=new E.PassThrough,e.body=h,p.pipe(h),d=a(f);try{for(d.s();!(y=d.n()).done;)b=y.value,_=m.default.join(w.settingService.getFileRootPath(n),decodeURIComponent(b)),v.default.statSync(_).isFile()?p.file(_,{name:m.default.basename(_)}):p.directory(_,m.default.basename(_))}catch(e){d.e(e)}finally{d.f()}p.finalize()}else i=m.default.join(w.settingService.getFileRootPath(n),decodeURIComponent(r)),c=m.default.basename(i),s=v.default.statSync(i),e.set("Content-Type",C.lookup(c)||"application/octet-stream"),c.endsWith(".pdf")||e.attachment(c),s.isFile()?(e.set("Cache-Control","public, max-age=3600"),e.body=v.default.createReadStream(i)):(e.attachment(c+".zip"),u=L("zip",{zlib:{level:5}}),l=new E.PassThrough,e.body=l,u.pipe(l),u.directory(i,m.default.basename(i)),u.finalize());case 13:case"end":return t.stop()}}),t)})))}},{key:"file_video_trans",value:function(e){var t=e.context,r=e.wss,n=w.settingService.getFileRootPath(t.token),o=m.default.join(n,decodeURIComponent(t.source_filename)),a=m.default.join(n,decodeURIComponent(t.to_filename));(0,A.getFfmpeg)()(o).toFormat(t.to_format).on("start",(function(e){var t=new P.WsData(P.CmdType.file_video_trans_progress);t.context=0,r.sendData(t.encode())})).on("progress",(function(e){var t=new P.WsData(P.CmdType.file_video_trans_progress);t.context=e.percent.toFixed(0),r.sendData(t.encode())})).on("error",(function(e,t,n){r.ws.close()})).on("end",(function(){var e=new P.WsData(P.CmdType.file_video_trans_progress);e.context=100,r.sendData(e.encode())})).save(a)}},{key:"uncompress",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i,c,s,u,l,f,p;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.context,a=decodeURIComponent(n.source_file),i=decodeURIComponent(null!==(r=n.tar_dir)&&void 0!==r?r:""),c=m.default.dirname(a),s=w.settingService.getFileRootPath(n.token),u=m.default.join(s,c,i),l=e.wss,i&&v.default.mkdirSync(m.default.join(u),{recursive:!0}),f=m.default.join(s,a),p=function(e){if(-1!==e){var t=new P.WsData(P.CmdType.file_uncompress_progress);t.context=e,l.sendData(t.encode())}else l.ws.close()},n.format!==d.FileCompressType.tar){t.next=14;break}this.unTar(f,u,p),t.next=34;break;case 14:if(n.format!==d.FileCompressType.zip){t.next=18;break}this.unZip(f,u,p),t.next=34;break;case 18:if(n.format!==d.FileCompressType.gzip){t.next=22;break}this.unTar(f,u,p,!0),t.next=34;break;case 22:if(n.format!==d.FileCompressType.rar){t.next=33;break}return t.prev=23,t.next=26,this.unRar(f,u,p);case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(23),l.ws.close();case 31:t.next=34;break;case 33:l.ws.close();case 34:case"end":return t.stop()}}),t,this,[[23,28]])})))}},{key:"FileCompress",value:function(e){var t,r,n=e.context,o=n.filePaths,i=w.settingService.getFileRootPath(n.token),c=e.wss,s=[],u=[],l=a(o);try{for(l.s();!(t=l.n()).done;){var f=t.value,p=m.default.join(i,decodeURIComponent(f));try{v.default.statSync(p).isFile()?s.push(p):u.push(p)}catch(e){}}}catch(e){l.e(e)}finally{l.f()}r=n.format===d.FileCompressType.gzip?d.FileCompressType.tar:n.format;var h=m.default.join(i,decodeURIComponent(n.tar_filename));this.compress(r,n.compress_level,h,s,u,(function(e){if(-1!==e){var t=new P.WsData(P.CmdType.file_compress_progress);t.context=e,c.sendData(t.encode())}else c.ws.close()}),n.format===d.FileCompressType.gzip)}},{key:"getTotalFile",value:function(e,t){try{if(v.default.statSync(t).isFile())return e.total+=1,void e.files.push(t)}catch(e){return}var r,n=a(v.default.readdirSync(t));try{for(n.s();!(r=n.n()).done;){var o=r.value,i=m.default.join(t,o);this.getTotalFile(e,i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"studio_get_item",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,i,c,s,u,l,f,p;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n={list:[]},i=m.default.join(w.settingService.getFileRootPath(t),e?decodeURIComponent(e):""),v.default.existsSync(i)){r.next=4;break}return r.abrupt("return",(0,b.Fail)("路径不存在",S.RCode.Fail));case 4:if(!v.default.statSync(i).isFile()){r.next=7;break}return r.abrupt("return",(0,b.Fail)("是文件",S.RCode.Fail));case 7:c=v.default.readdirSync(i),s=a(c),r.prev=9,s.s();case 11:if((u=s.n()).done){r.next=25;break}l=u.value,f=m.default.join(i,l),p=null,r.prev=15,p=v.default.statSync(f),r.next=22;break;case 19:return r.prev=19,r.t0=r.catch(15),r.abrupt("continue",23);case 22:n.list.push({type:p.isFile()?"file":"folder",name:l});case 23:r.next=11;break;case 25:r.next=30;break;case 27:r.prev=27,r.t1=r.catch(9),s.e(r.t1);case 30:return r.prev=30,s.f(),r.finish(30);case 33:return r.abrupt("return",n);case 34:case"end":return r.stop()}}),r,null,[[9,27,30,33],[15,19]])})))}},{key:"getDiskSizeForPath",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},t.prev=1,t.next=4,O.default.fsSize();case 4:n=t.sent,a=m.default.resolve(e),n.forEach((function(e){if(a.startsWith(e.mount)){if(!i)return void(i=e);e.mount.length>i.mount.length&&(i=e)}})),i&&(r.path=a,r.name=m.default.basename(e),r.total_size=(0,g.formatFileSize)(i.size),r.left_size=(0,g.formatFileSize)(i.available),r.fs_type=i.type),t.next=14;break;case 10:return t.prev=10,t.t0=t.catch(1),console.error("Error fetching disk information:",t.t0),t.abrupt("return",r);case 14:return t.abrupt("return",r);case 15:case"end":return t.stop()}}),t,null,[[1,10]])})))}}],n&&c(r.prototype,n),i&&c(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(k.FileCompress);t.FileServiceImpl=new x},3468:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.NavindexController=void 0;var i=r(5584),c=r(9334),s=r(5890),u=r(5443),l=r(274),f="navindex_key_list",p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"add",value:function(e){var t=l.DataUtil.get(f);return Array.isArray(t)?(t.push(e),l.DataUtil.set(f,t)):l.DataUtil.set(f,[e]),(0,s.Sucess)("ok")}},{key:"save",value:function(e){return l.DataUtil.set(f,e),(0,s.Sucess)("ok")}},{key:"get",value:function(){var e=l.DataUtil.get(f);return(0,s.Sucess)(e||[])}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NavindexController=p,i.__decorate([(0,c.Post)("/add"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Object]),i.__metadata("design:returntype",void 0)],p.prototype,"add",null),i.__decorate([(0,c.Post)("/save"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Array]),i.__metadata("design:returntype",void 0)],p.prototype,"save",null),i.__decorate([(0,c.Get)(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],p.prototype,"get",null),t.NavindexController=p=i.__decorate([(0,u.Service)(),(0,c.Controller)("/navindex")],p)},1076:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.NetController=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(8411),f=r(4988),p=r(7228),h=r(6369),d=r(274),v=r(2904),y="navindex_net_key_list",m="navindex_wol_key",b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",h.netService.start(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.netService.close(e);case 2:return t.abrupt("return",(0,u.Sucess)("1"));case 3:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return d.DataUtil.set(y,e),(0,u.Sucess)("ok")}},{key:"get",value:function(){var e=d.DataUtil.get(y);return(0,u.Sucess)(e||[])}},{key:"saveWolTag",value:function(e){return d.DataUtil.set(m,e),(0,u.Sucess)("ok")}},{key:"getWolTag",value:function(){var e=d.DataUtil.get(m);return(0,u.Sucess)(e||[])}},{key:"wol",value:function(e){return h.netService.wol(e.mac),(0,u.Sucess)("")}},{key:"virServerGet",value:function(){return(0,u.Sucess)(v.virtualService.virServerGet())}},{key:"virServerSave",value:function(e){return v.virtualService.virServerSave(e),(0,u.Sucess)("1")}},{key:"virClientGet",value:function(){return(0,u.Sucess)(v.virtualService.virClientGet())}},{key:"virClientSave",value:function(e){return v.virtualService.virClientSave(e),(0,u.Sucess)("1")}},{key:"getServerInfos",value:function(e){var t=[];return v.virtualService.serverRealMap.forEach((function(e){t.push([e.vir_ip,e.to_address,e.to_address?"在线":"离线"])})),t}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NetController=b,c.__decorate([(0,s.Post)("/start"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.NetPojo]),c.__metadata("design:returntype",Promise)],b.prototype,"start",null),c.__decorate([(0,s.Post)("/close"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.NetPojo]),c.__metadata("design:returntype",Promise)],b.prototype,"close",null),c.__decorate([(0,s.Post)("/tag/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],b.prototype,"save",null),c.__decorate([(0,s.Get)("/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"get",null),c.__decorate([(0,s.Post)("/wol/tag/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],b.prototype,"saveWolTag",null),c.__decorate([(0,s.Get)("/wol/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"getWolTag",null),c.__decorate([(0,s.Post)("/wol/exec"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",void 0)],b.prototype,"wol",null),c.__decorate([(0,s.Get)("/vir/server/get"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"virServerGet",null),c.__decorate([(0,s.Post)("/vir/server/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.VirServerPojo]),c.__metadata("design:returntype",void 0)],b.prototype,"virServerSave",null),c.__decorate([(0,s.Get)("/vir/client/get"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"virClientGet",null),c.__decorate([(0,s.Post)("/vir/client/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.VirClientPojo]),c.__metadata("design:returntype",void 0)],b.prototype,"virClientSave",null),c.__decorate([(0,l.msg)(f.CmdType.vir_net_serverIno_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[f.WsData]),c.__metadata("design:returntype",void 0)],b.prototype,"getServerInfos",null),t.NetController=b=c.__decorate([(0,s.Controller)("/net")],b)},6369:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.netService=t.NetService=void 0;var u=r(5584),l=r(7228),f=r(8872),p=r(5890),h=u.__importDefault(r(3152)),d=r(6101),v=r(5695),y=r(3688),m=r(7194),b=null,_=new Map,g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=_.get(e.targetProxyUrl))){t.next=3;break}return t.abrupt("return",(0,p.Sucess)(r.beforPort));case 3:return n={},_.set(e.targetProxyUrl,n),t.next=7,(0,f.findAvailablePort)(49152,65535);case 7:return i=t.sent,n.beforPort=i,(c=new d).use(v()),n.server=c.listen(i,(function(){console.log("Server is running on port ".concat(i))})),s={target:e.targetProxyUrl,changeOrigin:!0,events:{proxyRes:function(e,t,r){e.headers["X-Frame-Options"]="",e.headers["Content-Security-Policy"]=""}},rewrite:function(e){return n.heartbeat=!0,e}},e.sysProxyPort&&(s.agent=new y("http://127.0.0.1:".concat(e.sysProxyPort))),c.use((0,h.default)(/^.*$/,s)),(new l.NetPojo).proxyPort=i,b||(b=setInterval((function(){var e,t=a(_.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=_.get(r);n.heartbeat?n.heartbeat=!1:(n.server&&n.server.close(),_.delete(r),console.log("超时关闭代理",r))}}catch(e){t.e(e)}finally{t.f()}0===_.size&&(clearInterval(b),b=null)}),6e5)),t.abrupt("return",(0,p.Sucess)(i));case 19:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){if(e.targetProxyUrl){var t=_.get(e.targetProxyUrl);t&&(t.server&&t.server.close(),_.delete(e.targetProxyUrl)),console.log("主动关闭代理",e.targetProxyUrl)}else{var r,n=a(_.keys());try{for(n.s();!(r=n.n()).done;){var o=r.value,i=_.get(o);i.server&&i.server.close(),_.delete(o),i.heartbeat=!1}}catch(e){n.e(e)}finally{n.f()}b&&clearInterval(b)}}},{key:"wol",value:function(e){var t=m.createSocket("udp4");t.bind((function(){t.setBroadcast(!0)}));var r=e.split(":").map((function(e){return parseInt(e,16)})),n=Buffer.concat([Buffer.from([255,255,255,255,255,255]),Buffer.concat(Array(16).fill(Buffer.from(r)))]);t.send(n,9,"127.0.0.1",(function(e){e?console.error("Error sending WOL packet:",e):console.log("WOL packet sent successfully!"),t.close()}))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NetService=g,t.netService=new g},2904:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.virtualService=t.VirtualService=void 0;var d,v=r(5584),y=r(274),m=r(7228),b=r(5101),_=r(3129),g=r(6602),E=r(8872),w=r(3570),P=r(9044),S=r(7194),k=r(9278),A=r(6982),T=r(2710),O=T.LinuxTun,L=(T.LinuxTap,T.Wintun),C=(r(6928),"vir_server_net_data_key"),x="vir_client_net_data_key",I="vir_data_client_hash_key",H="vir_data_server_hash_key";!function(e){e[e.empty=0]="empty",e[e.error=1]="error",e[e.register=2]="register",e[e.connect=3]="connect",e[e.data=4]="data",e[e.heart=5]="heart",e[e.trans_data=6]="trans_data"}(d||(d={}));var N=function(e){function t(){var e;return s(this,t),(e=u(this,t,arguments)).heart=!1,e.starChecktHeart=function(t,r,n){e.close=function(){e.checkUdp(e.udpClient,(function(){e.udpClient.close(),e.udpClient=null})),t.delete(r),clearInterval(e.heartInterval),clearInterval(e.heartCheckInterval),console.log("断开udp连接--",r)},e.heartCheckInterval=setInterval((function(){e.heart||!e.udpClient?e.heart=!1:e.close()}),15e3),e.heartInterval=setInterval((function(){e.udpClient&&e.udpClient.send(n,e.to_port,e.to_address,(function(e){}))}),2e3)},e}return p(t,e),i(t)}(g.UdpUtil),D=function(e){function t(){var e;return s(this,t),(e=u(this,t,arguments)).serverRealMap=new Map,e.serverStatus=!1,e.clientIPAndUdpMap=new Map,e.tun={},e.clientStatus=!1,e.serverTypeIsTcp=!1,e}return p(t,e),i(t,[{key:"virServerGet",value:function(){var e=y.DataUtil.get(C);return e||(e=new m.VirServerPojo,y.DataUtil.set(C,e),e)}},{key:"virClientGet",value:function(){var e=y.DataUtil.get(x);return e||(e=new m.VirClientPojo,y.DataUtil.set(x,e),e)}},{key:"get64Key",value:function(e){var t=A.createHash("sha256");return t.update(e),t.digest("hex")}},{key:"getUdpBuffer",value:function(e,t,r){var n=Buffer.alloc(1);n[0]=e;var o=Buffer.from(r);return Buffer.concat([n,o,t])}},{key:"getUdpData",value:function(e){if(!(e.length<65))return{code:e[0],hashKey:e.toString("utf8",1,65),buffer:e=e.subarray(65)}}},{key:"getTcpBuffer",value:function(e,t){var r=Buffer.alloc(1);return r[0]=e,Buffer.concat([r,t])}},{key:"getTcpData",value:function(e){if(!(e.length<1))return{code:e[0],tcpBuffer:e.subarray(1)}}},{key:"udpServerStart",value:function(e){var t=this;if(!this.udpServer){var r=S.createSocket("udp4");r.bind(e),r.on("message",(function(e,n){try{var o=t.getUdpData(e),a=o.hashKey,i=o.code,c=o.buffer,s=t.getServerHashKey();if(a!==s)return;var u=JSON.parse(c.toString());switch(i){case d.register:console.log("注册更新------来自".concat(n.address,":").concat(n.port));var l=t.serverRealMap.get(u.ip);l||((l=new N).to_address=n.address,l.to_port=n.port,l.heart=!0),t.serverRealMap.set(u.ip,l),r.send(t.getUdpBuffer(d.register,Buffer.alloc(0),s),n.port,n.address,(function(e){})),setTimeout((function(){l.heart=!1}),3e3);break;case d.connect:var f=t.serverRealMap.get(u.ip);if(!f)return void r.send(t.getUdpBuffer(d.error,Buffer.alloc(0),s),n.port,n.address,(function(e){}));r.send(t.getUdpBuffer(d.connect,Buffer.from(JSON.stringify(f)),s),n.port,n.address,(function(e){}));var p=new N;p.vir_ip=u.self_ip,p.to_port=n.port,p.to_address=n.address,r.send(t.getUdpBuffer(d.connect,Buffer.from(JSON.stringify(p)),s),f.to_port,f.to_address,(function(e){}));case d.data:}}catch(e){return}})),this.udpServer=r,console.log("udp服务器运行开始")}}},{key:"getTransBuffer",value:function(e,t){var r=Buffer.from(e),n=Buffer.alloc(1);return n[0]=r.length,Buffer.concat([n,r,t])}},{key:"getTransData",value:function(e){var t=e[0],r=e.subarray(1,t+1);return{data:e.subarray(t+1),vir_ip:r.toString()}}},{key:"tcpServerStart",value:function(e){var t=this;if(!this.tcpServer){var r=k.createServer((function(e){console.log("客户端连接");var r=new w.TcpUtil(e);r.setHead(0);var n="",o=setTimeout((function(){n||e.end()}),3e3),a=new N;r.setOn((function(e,i){var c=t.getTcpData(i),s=c.code,u=c.tcpBuffer;switch(s){case d.register:var l=t.getServerHashKey();clearTimeout(o);var f=JSON.parse(u.toString());if(f.hashKey!==l)return;n=f.ip,a.heart=!0,a.vir_ip=f.ip,a.tcpSocket=r,t.clientIPAndUdpMap.set(f.ip,a),setInterval((function(){a.heart=!1}),6e4);break;case d.trans_data:var p=t.getTransData(u),h=p.data,v=p.vir_ip,y=t.clientIPAndUdpMap.get(v);if(!y||!y.heart)return;y.tcpSocket.sendToSocket(Buffer.alloc(0),t.getTcpBuffer(d.data,h));break;case d.heart:a.heart=!0}})),e.on("data",(function(e){r.handleSocket(e)})),e.on("end",(function(){a.heart=!1,console.log("客户端断开连接")})),e.on("error",(function(e){console.error("Socket 错误:",e),a.heart=!1}))}));r.listen(e,(function(){console.log("tcp服务器运行开始")})),this.tcpServer=r}}},{key:"getClientHashKey",value:function(){return y.DataUtil.get(I)}},{key:"getServerHashKey",value:function(){return y.DataUtil.get(H)}},{key:"getRandomAblePort",value:function(){return v.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,E.findAvailablePort)(49152,65535);case 2:case"end":return e.stop()}}),e)})))}},{key:"udpClientCreateAndGet",value:function(e,t,r){return v.__awaiter(this,void 0,void 0,o().mark((function n(){var a=this;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n){var o=a.clientIPAndUdpMap.get(e);if(-1!==o)if(o)n(o);else{a.clientIPAndUdpMap.set(e,-1);var i=S.createSocket("udp4");i.bind();var c=y.DataUtil.get(x);i.send(a.getUdpBuffer(d.connect,Buffer.from(JSON.stringify({ip:e,self_ip:c.ip})),a.getClientHashKey()),r,t,(function(e){}));var s=setInterval((function(){i.send(a.getUdpBuffer(d.connect,Buffer.from(JSON.stringify({ip:e,self_ip:c.ip})),a.getClientHashKey()),r,t,(function(e){}))}),2500),u=setTimeout((function(){a.clientIPAndUdpMap.delete(e),clearInterval(s),n(null)}),5e3),l=new N;l.udpClient=i,i.on("message",(function(t,r){try{var o=a.getUdpData(t),c=o.hashKey,f=o.code,p=o.buffer,h=a.getClientHashKey();if(c!==h)return;switch(f){case d.error:case d.register:break;case d.connect:clearInterval(s),clearTimeout(u);var v=JSON.parse(p.toString());i.send(a.getUdpBuffer(d.empty,Buffer.alloc(0),h),v.to_port,v.to_address,(function(e){})),l.to_port=v.to_port,l.to_address=v.to_address,l.heart=!0,a.clientIPAndUdpMap.set(e,l),l.starChecktHeart(a.clientIPAndUdpMap,e,a.getUdpBuffer(d.heart,Buffer.alloc(0),a.getClientHashKey())),console.log(e,"的udp创建完成(主动)"),n(l);break;case d.data:a.writeToTun(p);break;case d.heart:l.heart=!0}}catch(t){return void console.log("尝试连接出错",e)}}))}})));case 1:case"end":return n.stop()}}),n)})))}},{key:"init",value:function(){return v.__awaiter(this,void 0,void 0,o().mark((function e(){var t,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=y.DataUtil.get(C))&&(this.serverStatus=t.open,t.open&&(t.model===m.VirServerEnum.udp?this.udpServerStart(t.port):t.model===m.VirServerEnum.tcp&&this.tcpServerStart(t.port))),!(r=y.DataUtil.get(x))){e.next=9;break}if(!r.open){e.next=9;break}return e.next=7,this.getServerType(r.serverIp,r.serverPort);case 7:this.clientStatus=r.open,this.tunStart(r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"virServerSave",value:function(e){y.DataUtil.set(C,e);var t=this.get64Key(e.key);if(y.DataUtil.set(H,t),e.open){if(this.serverStatus)return;e.model===m.VirServerEnum.udp?this.udpServerStart(e.port):e.model===m.VirServerEnum.tcp&&this.tcpServerStart(e.port),this.serverStatus=!0}else{try{this.udpServer&&(this.udpServer.close(),this.udpServer=null,console.log("关闭udp服务器")),this.tcpServer&&(this.tcpServer.close(),this.tcpServer=null,console.log("关闭tcp服务器"))}catch(e){console.log("p2p服务关闭失败")}this.serverStatus=!1}}},{key:"ipToBuffer",value:function(e){var t=e.split(".").map(Number);return Buffer.from(t)}},{key:"ipToInt",value:function(e){return e.readUInt32BE(0)}},{key:"getClientIp",value:function(){var e=this.client_ip_int;if(e)return e;var t=y.DataUtil.get(x);return e=this.ipToInt(this.ipToBuffer(t.ip)),this.client_ip_int=e,e}},{key:"getClientMask",value:function(){var e=this.client_mask_int;if(e)return e;var t=y.DataUtil.get(x);return e=this.ipToInt(this.cidrToBinary(t.mask)),this.client_mask_int=e,e}},{key:"cidrToBinary",value:function(e){var t=4294967295<<32-e>>>0,r=[t>>>24&255,t>>>16&255,t>>>8&255,255&t];return Buffer.from(r)}},{key:"isSameSubnet",value:function(e){var t=this.getClientIp(),r=this.ipToInt(e),n=this.getClientMask();return(t&n)==(r&n)&&r!==t}},{key:"getDestIpByTunPackage",value:function(e){if(4===e[0]>>4){var t=e.subarray(16,20);if(this.isSameSubnet(t))return t.join(".")}}},{key:"handleTunPackage",value:function(e,t,r){return v.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=this.getDestIpByTunPackage(e)){n.next=3;break}return n.abrupt("return");case 3:if(!this.serverTypeIsTcp||!this.tcpReceiveRegisterSocketUtil){n.next=7;break}this.tcpReceiveRegisterSocketUtil.sendToSocket(Buffer.alloc(0),this.getTcpBuffer(d.trans_data,this.getTransBuffer(a,e))),n.next=13;break;case 7:return n.next=9,this.udpClientCreateAndGet(a,t,r);case 9:if(i=n.sent){n.next=12;break}return n.abrupt("return");case 12:i.udpClient.send(this.getUdpBuffer(d.data,e,this.getClientHashKey()),i.to_port,i.to_address,(function(e){}));case 13:case"end":return n.stop()}}),n,this)})))}},{key:"tunStart",value:function(e){var t=this,r=e.ip,n=e.mask;try{if("win"===b.sysType)L.wintunSetPath((0,P.get_wintun_dll_path)()),L.wintunInit(),L.wintunSetIpv4("filecat",r,n),L.wintunUpOn((function(r){t.handleTunPackage(r,e.serverIp,e.serverPort)}));else{var o=new O;o.mtu=4096,o.ipv4="".concat(r,"/").concat(n,"'"),o.on("data",(function(r){t.handleTunPackage(r,e.serverIp,e.serverPort)})),o.isUp=!0,this.tun.linuxTun=o}}catch(e){console.log("error: ",e)}this.serverTypeIsTcp?this.virTcpClientRegister(e.ip,e.serverPort,e.serverIp):this.virUdpClientRegister(e.ip,e.serverPort,e.serverIp),console.log("tun适配器启动---","".concat(r,"/").concat(n))}},{key:"virTcpClientRegister",value:function(e,t,r){var n=this;if(!this.tcpReceiveRegisterSocketUtil){var o=new k.Socket,a=new w.TcpUtil(o);a.setHead(0);var i,c=setTimeout((function(){console.log("重试连接tcp"),n.virTcpClientRegister(e,t,r)}),5e3);o.connect(t,r,(function(){clearTimeout(c),n.tcpReceiveRegisterSocketUtil=a,console.log("连接到tcp服务器"),a.sendToSocket(Buffer.alloc(0),n.getTcpBuffer(d.register,Buffer.from(JSON.stringify({ip:e,hashKey:n.getClientHashKey()})))),a.setOn((function(e,t){var r=n.getTcpData(t),o=r.code,a=r.tcpBuffer;if(o===d.data)n.writeToTun(a)})),i=setInterval((function(){a.sendToSocket(Buffer.alloc(0),n.getTcpBuffer(d.heart,Buffer.alloc(0)))}),2e3)})),o.on("data",(function(e){a.handleSocket(e)})),o.on("close",(function(){console.log("tcp服务器连接已关闭"),n.tcpReceiveRegisterSocketUtil=null,n.virTcpClientRegister(e,t,r),i&&clearInterval(i)})),o.on("error",(function(o){console.error("Socket 错误:",o),n.tcpReceiveRegisterSocketUtil=null,n.virTcpClientRegister(e,t,r),i&&clearInterval(i)}))}}},{key:"virUdpClientRegister",value:function(e,t,r){var n=this;if(!this.udpReceiveRegisterClient){var o=S.createSocket("udp4");o.bind();var a=setInterval((function(){n.checkUdp(o,(function(){o.send(n.getUdpBuffer(d.register,Buffer.from(JSON.stringify({ip:e})),n.getClientHashKey()),t,r,(function(e){}))}),(function(){clearInterval(a)}))}),5e3);this.udpReceiveRegisterClient=o;var i=new N;o.on("message",(function(c,s){try{var u=n.getUdpData(c),l=u.hashKey,f=u.code,p=u.buffer;if(l!==y.DataUtil.get(I))return;switch(f){case d.register:break;case d.connect:var h=JSON.parse(p.toString());o.send(n.getUdpBuffer(d.empty,Buffer.alloc(0),n.getClientHashKey()),h.to_port,h.to_address,(function(e){})),n.clientIPAndUdpMap.set(h.vir_ip,i),i.udpClient=o,i.to_address=h.to_address,i.to_port=h.to_port,i.heart=!0,i.starChecktHeart(n.clientIPAndUdpMap,h.vir_ip,n.getUdpBuffer(d.heart,Buffer.alloc(0),n.getClientHashKey())),n.udpReceiveRegisterClient=null,clearInterval(a),n.virUdpClientRegister(e,t,r),console.log(h.vir_ip,"的udp创建完成(接收)");break;case d.data:n.writeToTun(p);break;case d.heart:i.heart=!0}}catch(e){return}}))}}},{key:"writeToTun",value:function(e){try{if(!this.clientStatus)return;"win"===b.sysType?L.wintunSend(e):this.tun.linuxTun.write(e)}catch(e){console.log("写入网卡失败")}}},{key:"closeTun",value:function(){this.clientStatus&&("win"===b.sysType?L.wintunClose():this.tun.linuxTun.release(),console.log("关闭适配器"))}},{key:"checkTcpServerType",value:function(e,t){return new Promise((function(r,n){var o=new k.Socket;o.setTimeout(3e3),o.on("connect",(function(){o.destroy(),r(!0)})),o.on("timeout",(function(){o.destroy(),r(!1)})),o.on("error",(function(e){r(!1)})),o.connect(t,e)}))}},{key:"getServerType",value:function(e,t){return v.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.checkTcpServerType(e,t);case 2:this.serverTypeIsTcp=r.sent,console.log("服务器类型是",this.serverTypeIsTcp?"tcp":"udp");case 4:case"end":return r.stop()}}),r,this)})))}},{key:"virClientSave",value:function(e){return v.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(y.DataUtil.set(x,e),r=this.get64Key(e.key),y.DataUtil.set(I,r),!e.open){t.next=12;break}if(!this.clientStatus){t.next=6;break}return t.abrupt("return");case 6:return t.next=8,this.getServerType(e.serverIp,e.serverPort);case 8:this.clientStatus=!0,this.tunStart(e),t.next=14;break;case 12:try{this.udpReceiveRegisterClient&&(this.udpReceiveRegisterClient.close(),this.udpReceiveRegisterClient=null),this.clientIPAndUdpMap.forEach((function(e){try{-1!==e&&e.close.bind(e)()}catch(e){console.log(e)}})),this.tcpReceiveRegisterSocketUtil&&this.tcpReceiveRegisterSocketUtil.getSocket().destroy(),this.closeTun()}catch(e){console.log("客户端关闭失败")}this.clientStatus=!1;case 14:case"end":return t.stop()}}),t,this)})))}}])}(g.UdpUtil);t.VirtualService=D,t.virtualService=new D,_.ServerEvent.on("start",(function(e){t.virtualService.init()}))},9643:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.LifecycleRecordService=void 0;var u=r(5584),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dataMap=new Map,this.heatMap=new Map,this.endMap=new Map},t=[{key:"lifeStart",value:function(e,t,r){var n=this;if(t&&this.dataMap.set(e,t),r&&this.endMap.set(e,r),this.heatMap.set(e,Date.now()),!this.timer){var i=Date.now();this.timer=setInterval((function(){return u.__awaiter(n,void 0,void 0,o().mark((function e(){var t,r,n,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==this.heatMap.size){e.next=5;break}return clearInterval(this.timer),this.timer=null,e.abrupt("return");case 5:t=a(this.heatMap.keys()),e.prev=6,t.s();case 8:if((r=t.n()).done){e.next=16;break}if(n=r.value,c=this.heatMap.get(n),!(i-c>3e5)){e.next=14;break}return e.next=14,this.lifeClose(n);case 14:e.next=8;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(6),t.e(e.t0);case 21:return e.prev=21,t.f(),e.finish(21);case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(0),console.log(e.t1);case 29:case"end":return e.stop()}}),e,this,[[0,26],[6,18,21,24]])})))}),3e3)}}},{key:"lifeGetData",value:function(e){return this.dataMap.get(e)}},{key:"lifeHeart",value:function(e){this.heatMap.set(e,Date.now())}},{key:"lifeClose",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=this.endMap.get(e))){t.next=4;break}return t.next=4,r(this.dataMap.get(e));case 4:this.heatMap.delete(e),this.endMap.delete(e),this.dataMap.delete(e);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"asyncExec",value:function(e){return u.__awaiter(this,arguments,void 0,(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,n){var o=setTimeout((function(){r(null)}),t);e((function(e){return clearTimeout(o),r(e)}),n)})));case 1:case"end":return r.stop()}}),r)}))()}))}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.LifecycleRecordService=l},3570:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.TcpUtil=void 0;var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.protocal=Buffer.from([25,152]),this.buffer=Buffer.alloc(0),this.processing=!1,this.socket=t},(t=[{key:"setHead",value:function(e){this.headLength=e}},{key:"setOn",value:function(e){this.onData=e}},{key:"handleSocket",value:function(e){this.buffer=Buffer.concat([this.buffer,e]),this.buffer.length>=this.headLength+3&&!this.processing&&(this.processing=!0,this.handleBuffer())}},{key:"handleBuffer",value:function(){if(this.buffer[0]!==this.protocal[0]||this.buffer[1]!==this.protocal[1])return this.buffer=Buffer.alloc(0),void(this.processing=!1);var e=this.bufferToInt(this.buffer.subarray(2,6)),t=this.buffer.subarray(6,6+this.headLength),r=this.buffer.subarray(6+this.headLength,6+this.headLength+e);this.onData(t,r),this.buffer=this.buffer.subarray(6+this.headLength+e),this.buffer.length>=this.headLength+3&&this.handleBuffer(),this.processing=!1}},{key:"intToBuffer",value:function(e){var t=Buffer.alloc(4);return t.writeUInt32BE(e,0),t}},{key:"bufferToInt",value:function(e){return e.readUInt32BE(0)}},{key:"getPackage",value:function(e,t){return Buffer.concat([this.protocal,this.intToBuffer(t.length),e,t])}},{key:"getSocket",value:function(){return this.socket}},{key:"sendToSocket",value:function(e,t){this.socket.write(this.getPackage(e,t))}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.TcpUtil=a},6602:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.UdpUtil=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"checkUdp",value:function(e,t,r){try{if(!e)return void(r&&r());var n=e.address();n&&n.port&&t&&t()}catch(e){r&&r()}}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.UdpUtil=a},6007:(e,t,r)=>{var n=r(5784).type,o=(r(5784).log,r(5784).error);function a(e){return e.tagNumber>30?new n.Component([new n.UInt8(e.tagClass|e.tagFormat|31),new n.UInt8(e.tagNumber)]):new n.UInt8(e.tagClass|e.tagFormat|31&e.tagNumber)}function i(e){return e>127?new n.Component([new n.UInt8(130),new n.UInt16Be(e)]):new n.UInt8(e)}e.exports={decode:function(e,t){if(!function(e,t){var r=(new n.UInt8).read(e).value;return t.tagNumber>30?nextTagNumber=(new n.UInt8).read(e).value:nextTagNumber=31&r,(224&r)==(t.tagClass|t.tagFormat)&&nextTagNumber===t.tagNumber}(e,t))throw new o.ProtocolError("NODE_RDP_ASN1_BER_INVALID_TAG");var r=function(e){var t=(new n.UInt8).read(e).value;if(128&t)if(1==(t&=-129))t=(new n.UInt8).read(e).value;else{if(2!==t)throw new o.ProtocolError("NODE_RDP_ASN1_BER_INVALID_LENGTH");t=(new n.UInt16Be).read(e).value}return t}(e);return 0===r?new n.Stream(0):new n.BinaryString(null,{readLength:new n.CallableValue(r)}).read(e)},encode:function(e,t){return new n.Component([a(e),i(t.size()),t])}}},5002:(e,t,r)=>{var n=r(6007),o=r(7320),a=r(2715);e.exports={ber:n,univ:o,spec:a}},2715:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(5784).error;function i(e){this.tag=e,this.opt=!1}function c(e,t){i.call(this,e),this.spec=t}i.prototype.implicitTag=function(e){return this.tag=e,this},i.prototype.optional=function(){return this.opt=!0,this},i.prototype.explicitTag=function(e){return new c(e,this)},i.prototype.decode=function(e,t){throw new a.FatalError("NODE_RDP_AS1_SPEC_DECODE_NOT_IMPLEMENTED")},i.prototype.encode=function(e){throw new a.FatalError("NODE_RDP_AS1_SPEC_ENCODE_NOT_IMPLEMENTED")},n(c,i),i.prototype.decode=function(e,t){var r=new o.Stream(t.decode(e,this.tag).value);this.spec.decode(r,t)},e.exports={TagClass:{Universal:0,Application:64,Context:128,Private:192},TagFormat:{Primitive:0,Constructed:32},Asn1Tag:function(e,t,r){this.tagClass=e,this.tagFormat=t,this.tagNumber=r},Asn1Spec:i,Asn1SpecExplicitTag:c}},7320:(e,t,r)=>{var n=r(2715),o=r(5784).type,a=r(5784).error,i=r(9023).inherits,c=1,s=2,u=3,l=4,f=5,p=6,h=10,d=12,v=16,y=17,m=19,b=20,_=22,g=23,E=24,w=28,P=30;function S(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,c)),this.value=e||!1}function k(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,s)),this.value=e||0}function A(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,v)),this.value=e||[]}function T(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,h)),this.value=e||0}function O(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,l)),this.value=e||Buffer.alloc(0)}function L(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,p)),this.value=e||Buffer.alloc(5)}function C(){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,f))}function x(e){n.Asn1Spec.call(this,new n.Asn1Tag),this.value=e}function I(e,t){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,y)),this.factory=e,this.value=t||[]}function H(e,t){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,v)),this.factory=e,this.value=t||[]}function N(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,u)),this.value=[]}function D(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,b)),this.value=e}function R(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,m)),this.value=e}function F(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,w)),this.value=e}function U(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,d)),this.value=e}function j(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,P)),this.value=e}function M(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,_)),this.value=e}function B(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,g)),this.value=e}function G(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,E)),this.value=e}i(S,n.Asn1Spec),S.prototype.decode=function(e,t){return this.value=0!==(new o.UInt8).read(new o.Stream(t.decode(e,this.tag).value)).value,this},S.prototype.encode=function(e){return this.value?e.encode(this.tag,new o.UInt8(255)):e.encode(this.tag,new o.UInt8(0))},i(k,n.Asn1Spec),k.prototype.decode=function(e,t){var r=t.decode(e,this.tag).value;if(r.length<5)for(var n=new o.Stream(r);n.availableLength()>0;)this.value=this.value<<8,this.value|=(new o.UInt8).read(n).value;else this.value=r;return this},k.prototype.encode=function(e){return this.value<=255?e.encode(this.tag,new o.UInt8(this.value)):this.value<=65535?e.encode(this.tag,new o.UInt16Be(this.value)):e.encode(this.tag,new o.UInt32Be(this.value))},i(A,n.Asn1Spec),A.prototype.decode=function(e,t){var r=new o.Stream(t.decode(e,this.tag).value);for(var n in this.value){var i=r.offset;try{this.value[n].decode(r,t)}catch(e){if("NODE_RDP_ASN1_BER_INVALID_TAG"===e.message&&!this.value[n].opt)throw new a.ProtocolError("NODE_RDP_ASN1_UNIV_SEQUENCE_FIELD_NOT_PRESENT");r.offset=i}}return this},A.prototype.encode=function(e){var t=new o.Component([]);for(var r in this.value)t.obj.push(this.value[r].encode(e));return e.encode(this.tag,t)},i(T,n.Asn1Spec),T.prototype.decode=function(e,t){return this.value=(new o.UInt8).read(new o.Stream(t.decode(e,this.tag).value)).value,this},T.prototype.encode=function(e){return e.encode(this.tag,new o.UInt8(this.value))},i(O,n.Asn1Spec),O.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},O.prototype.encode=function(e){return e.encode(this.tag,new o.BinaryString(this.value))},i(L,n.Asn1Spec),L.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(C,n.Asn1Spec),C.prototype.decode=function(e,t){return t.decode(e,this.tag),this},i(x,n.Asn1Spec),x.prototype.decode=function(e,t){for(var r in this.value){var n=e.offset;try{this.value[r].decode(e,t);break}catch(t){e.offset=n}}return this},i(I,n.Asn1Spec),I.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value);r.availableLength()>0;)this.value.push(this.factory().decode(r,t));return this},i(H,n.Asn1Spec),H.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value);r.availableLength()>0;)this.value.push(this.factory().decode(r,t));return this},i(N,n.Asn1Spec),N.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value),n=(new o.UInt8).read(r).value,a=[],i=0;i<n;i++)a.push(0);for(;r.availableLength()>0;){var c=(new o.UInt8).read(r).value,s=0;0===r.availableLength()&&(s=n);for(i=7;i>=s;i--)a.push(c>>i&1?1:0)}return this.value=a,this},N.prototype.toBuffer=function(){for(var e=this.value.length/8,t=new o.Stream(e),r=0;r<e;r++){for(var n=0,a=0;a<8;a++)n|=this.value[8*r+a]<<7-a;new o.UInt8(n).write(t)}return t.buffer},i(D,n.Asn1Spec),D.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(R,n.Asn1Spec),R.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(F,n.Asn1Spec),F.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(U,n.Asn1Spec),U.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(j,n.Asn1Spec),j.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(M,n.Asn1Spec),M.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(B,n.Asn1Spec),B.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(G,n.Asn1Spec),G.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},e.exports={Boolean:S,Integer:k,Sequence:A,Enumerate:T,OctetString:O,ObjectIdentifier:L,Null:C,Choice:x,SequenceOf:H,SetOf:I,BitString:N,T61String:D,PrintableString:R,UniversalString:F,UTF8String:U,BMPString:j,IA5String:M,UTCTime:B,GeneralizedTime:G}},6986:(e,t,r)=>{var n=r(9023).inherits;function o(e,t){Error.captureStackTrace(this),this.message=e||"",this.code=t||"NODE_RDP_CORE_ERROR_NO_ERROR_CODE"}function a(e,t){Error.captureStackTrace(this),this.code=e,this.message=t||""}function i(e,t){Error.captureStackTrace(this),this.code=e,this.message=t||""}n(o,Error),n(a,Error),n(i,Error),e.exports={FatalError:o,ProtocolError:a,ImplementationError:i}},5784:(e,t,r)=>{var n=r(4049),o=r(4534),a=r(5570),i=r(6986),c=r(8397);e.exports={layer:n,type:o,log:a,error:i,rle:c}},4049:(e,t,r)=>{var n=r(9023).inherits,o=r(9896),a=r(4534),i=r(5570),c=r(4756);function s(e){this.secureSocket=null,this.socket=e;var t=this;this.socket.on("data",(function(e){try{t.recv(e)}catch(e){t.socket.destroy(),t.emit("error",e)}})).on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)})),this.buffers=[],this.bufferLength=0,this.expectedSize=0}n(s,r(6261).EventEmitter),s.prototype.recv=function(e){if(0==this.buffers.length&&(this.bufferLength=0),this.buffers[this.buffers.length]=e,this.bufferLength+=e.length,0!=this.expectedSize)for(;this.bufferLength>=this.expectedSize;){for(var t=new a.Stream(this.expectedSize);t.availableLength()>0;){var r=t.availableLength(),n=this.buffers.shift();n.length>t.availableLength()?(this.buffers.unshift(n.slice(r)),new a.BinaryString(n,{readLength:new a.CallableValue(t.availableLength())}).write(t)):new a.BinaryString(n).write(t)}this.bufferLength-=this.expectedSize,t.offset=0,this.emit("data",t)}else console.log("this.expectedSize == 0")},s.prototype.send=function(e){var t=new a.Stream(e.size());e.write(t),this.secureSocket?this.secureSocket.write(t.buffer):this.socket.write(t.buffer)},s.prototype.sendBuffer=function(e){this.secureSocket?this.secureSocket.write(e):this.socket.write(e)},s.prototype.expect=function(e){this.expectedSize=e},s.prototype.startTLS=function(e){var t=this;this.secureSocket=c.connect({socket:this.socket,secureContext:c.createSecureContext(),isServer:!1,requestCert:!1,rejectUnauthorized:!1},(function(t){i.warn(t),e(t)})),this.secureSocket.on("data",(function(e){try{t.recv(e)}catch(e){t.socket.destroy(),t.emit("error",e)}})).on("error",(function(e){t.emit("error",e)}))},s.prototype.listenTLS=function(e,t,r){var n=this;this.secureSocket=c.connect({socket:this.socket,secureContext:c.createSecureContext({key:o.readFileSync(e),cert:o.readFileSync(t)}),isServer:!0,requestCert:!1,rejectUnauthorized:!1},(function(e){i.warn(e),r(e)})),this.secureSocket.on("data",(function(e){try{n.recv(e)}catch(e){n.socket.destroy(),n.emit("error",e)}})).on("error",(function(e){n.emit("error",e)}))},s.prototype.close=function(){this.socket.end()},e.exports={BufferLayer:s}},5570:e=>{var t={DEBUG:1,INFO:2,WARN:3,ERROR:4,NONE:5};e.exports={level:t.INFO,Levels:t,debug:function(e){},info:function(e){},warn:function(e){},error:function(e){}}},8397:function(module,__unused_webpack_exports,__webpack_require__){function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var Module;Module||(Module=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_NODE="object"===("undefined"==typeof process?"undefined":_typeof(process))&&!0,ENVIRONMENT_IS_WEB="object"===("undefined"==typeof window?"undefined":_typeof(window)),ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=__webpack_require__(9896),nodePath=__webpack_require__(6928);Module.read=function(e,t){e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return r||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),r=nodeFS.readFileSync(e)),r&&!t&&(r=r.toString()),r},Module.readBinary=function(e){return Module.read(e,!0)},Module.load=function(e){globalEval(read(e))},Module.arguments=process.argv.slice(2),module.exports=Module}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){return read(e,"binary")},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),this.Module=Module,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined");else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WEB?this.Module=Module:Module.load=importScripts}function globalEval(e){eval.call(null,e)}for(var key in"undefined"==!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},forceAlign:function(e,t){return 1==(t=t||4)?e:isNumber(e)&&isNumber(t)?Math.ceil(e/t)*t:isNumber(t)&&isPowerOfTwo(t)?"((("+e+")+"+(t-1)+")&"+-t+")":"Math.ceil(("+e+")/"+t+")*"+t},isNumberType:function(e){return e in Runtime.INT_TYPES||e in Runtime.FLOAT_TYPES},isPointerType:function(e){return"*"==e[e.length-1]},isStructType:function(e){return!isPointerType(e)&&(!!isArrayType(e)||(!!/<?{ ?[^}]* ?}>?/.test(e)||"%"==e[0]))},INT_TYPES:{i1:0,i8:0,i16:0,i32:0,i64:0},FLOAT_TYPES:{float:0,double:0},or64:function(e,t){return(e|t)+4294967296*(Math.round(e/4294967296)|Math.round(t/4294967296))},and64:function(e,t){return(e&t)+4294967296*(Math.round(e/4294967296)&Math.round(t/4294967296))},xor64:function(e,t){return(e^t)+4294967296*(Math.round(e/4294967296)^Math.round(t/4294967296))},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":case"float":return 4;case"i64":case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},dedup:function(e,t){var r={};return t?e.filter((function(e){return!r[e[t]]&&(r[e[t]]=!0,!0)})):e.filter((function(e){return!r[e]&&(r[e]=!0,!0)}))},set:function(){for(var e="object"===_typeof(arguments[0])?arguments[0]:arguments,t={},r=0;r<e.length;r++)t[e[r]]=0;return t},STACK_ALIGN:8,getAlignSize:function(e,t,r){return r?8:r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},calculateStructAlignment:function(e){e.flatSize=0,e.alignSize=0;var t=[],r=-1;return e.flatIndexes=e.fields.map((function(n){var o,a;Runtime.isNumberType(n)||Runtime.isPointerType(n)?(o=Runtime.getNativeTypeSize(n),a=Runtime.getAlignSize(n,o)):Runtime.isStructType(n)?"0"===n[1]?(o=0,a=Types.types[n]?Runtime.getAlignSize(null,Types.types[n].alignSize):e.alignSize||QUANTUM_SIZE):(o=Types.types[n].flatSize,a=Runtime.getAlignSize(null,Types.types[n].alignSize)):"b"==n[0]?(o=0|n.substr(1),a=1):"<"===n[0]?o=a=Types.types[n].flatSize:"i"===n[0]?assert((o=a=parseInt(n.substr(1))/8)%1==0,"cannot handle non-byte-size field "+n):assert(!1,"invalid type for calculateStructAlignment"),e.packed&&(a=1),e.alignSize=Math.max(e.alignSize,a);var i=Runtime.alignMemory(e.flatSize,a);return e.flatSize=i+o,r>=0&&t.push(i-r),r=i,i})),e.name_&&"["===e.name_[0]&&(e.flatSize=parseInt(e.name_.substr(1))*e.flatSize/2),e.flatSize=Runtime.alignMemory(e.flatSize,e.alignSize),0==t.length?e.flatFactor=e.flatSize:1==Runtime.dedup(t).length&&(e.flatFactor=t[0]),e.needsFlattening=1!=e.flatFactor,e.flatIndexes},generateStructInfo:function(e,t,r){var n;if(t){if(r=r||0,!(o=("undefined"==typeof Types?Runtime.typeInfo:Types.types)[t]))return null;if(o.fields.length!=e.length)return printErr("Number of named fields must match the type for "+t+": possibly duplicate struct names. Cannot return structInfo"),null;n=o.flatIndexes}else{var o={fields:e.map((function(e){return e[0]}))};n=Runtime.calculateStructAlignment(o)}var a={__size__:o.flatSize};return t?e.forEach((function(e,t){if("string"==typeof e)a[e]=n[t]+r;else{var i;for(var c in e)i=c;a[i]=Runtime.generateStructInfo(e[i],o.fields[t],n[t])}})):e.forEach((function(e,t){a[e[1]]=n[t]})),a},dynCall:function(e,t,r){return r&&r.length?(assert(r.length==e.length-1),FUNCTION_TABLE[t].apply(null,r)):(assert(1==e.length),FUNCTION_TABLE[t]())},addFunction:function(e){var t=FUNCTION_TABLE,r=t.length;assert(r%2==0),t.push(e);for(var n=0;n<1;n++)t.push(0);return r},removeFunction:function(e){FUNCTION_TABLE[e]=null},getAsmConst:function getAsmConst(code,numArgs){Runtime.asmConstCache||(Runtime.asmConstCache={});var func=Runtime.asmConstCache[code];if(func)return func;for(var args=[],i=0;i<numArgs;i++)args.push(String.fromCharCode(36)+i);return code=Pointer_stringify(code),'"'===code[0]&&(code.indexOf('"',1)===code.length-1?code=code.substr(1,code.length-2):abort("invalid EM_ASM input |"+code+"|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)")),Runtime.asmConstCache[code]=eval("(function("+args.join(",")+"){ "+code+" })")},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){return assert(t),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]=function(){return Runtime.dynCall(t,e,arguments)}),Runtime.funcWrappers[e]},UTF8Processor:function(){var e=[],t=0;this.processCChar=function(r){if(r&=255,0==e.length)return 128&r?(e.push(r),t=192==(224&r)?1:224==(240&r)?2:3,""):String.fromCharCode(r);if(t&&(e.push(r),--t>0))return"";var n,o=e[0],a=e[1],i=e[2],c=e[3];if(2==e.length)n=String.fromCharCode((31&o)<<6|63&a);else if(3==e.length)n=String.fromCharCode((15&o)<<12|(63&a)<<6|63&i);else{var s=(7&o)<<18|(63&a)<<12|(63&i)<<6|63&c;n=String.fromCharCode(Math.floor((s-65536)/1024)+55296,(s-65536)%1024+56320)}return e.length=0,n},this.processJSString=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return t}},stackAlloc:function(e){var t=STACKTOP;return assert((0|(STACKTOP=(STACKTOP=STACKTOP+e|0)+7&-8))<(0|STACK_MAX)),t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+(assert(!staticSealed),e)|0)+7&-8,t},dynamicAlloc:function(e){var t=DYNAMICTOP;return(DYNAMICTOP=(DYNAMICTOP=DYNAMICTOP+(assert(DYNAMICTOP>0),e)|0)+7&-8)>=TOTAL_MEMORY&&enlargeMemory(),t},alignMemory:function(e,t){return e=Math.ceil(e/(t||8))*(t||8)},makeBigInt:function(e,t,r){return r?(e>>>0)+4294967296*(t>>>0):(e>>>0)+4294967296*(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,setjmpId=1,setjmpLabels={},ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(e,t){e||abort("Assertion failed: "+t)}var globalScope=this;function ccall(e,t,r,n){return ccallFunc(getCFunc(e),t,r,n)}function getCFunc(ident){try{var func=Module["_"+ident];func||(func=eval("_"+ident))}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function ccallFunc(e,t,r,n){var o=0;var a,i,c=0,s=n?n.map((function(e){return function(e,t){if("string"==t){if(null==e||0===e)return 0;e=intArrayFromString(e),t="array"}if("array"==t){o||(o=Runtime.stackSave());var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r}return e}(e,r[c++])})):[],u=(a=e.apply(null,s),"string"==(i=t)?Pointer_stringify(a):(assert("array"!=i),a));return o&&Runtime.stackRestore(o),u}function cwrap(e,t,r){var n=getCFunc(e);return function(){return ccallFunc(n,t,r,Array.prototype.slice.call(arguments))}}function setValue(e,t,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,Math_abs(tempDouble)>=1?tempDouble>0?Math_min(Math_floor(tempDouble/4294967296),4294967295)>>>0:~~Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,t,r,n){var o,a;"number"==typeof e?(o=!0,a=e):(o=!1,a=e.length);var i,c="string"==typeof t?t:null;if(i=r==ALLOC_NONE?n:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(a,c?1:t.length)),o){var s;n=i;for(assert(!(3&i)),s=i+(-4&a);n<s;n+=4)HEAP32[n>>2]=0;for(s=i+a;n<s;)HEAP8[0|n++]=0;return i}if("i8"===c)return e.subarray||e.slice?HEAPU8.set(e,i):HEAPU8.set(new Uint8Array(e),i),i;for(var u,l,f,p=0;p<a;){var h=e[p];"function"==typeof h&&(h=Runtime.getFunctionIndex(h)),0!==(u=c||t[p])?(assert(u,"Must know what type to store in allocate!"),"i64"==u&&(u="i32"),setValue(i+p,h,u),f!==u&&(l=Runtime.getNativeTypeSize(u),f=u),p+=l):p++}return i}function Pointer_stringify(e,t){for(var r,n=!1,o=0;;){if(assert(e+o<TOTAL_MEMORY),(r=HEAPU8[e+o|0])>=128)n=!0;else if(0==r&&!t)break;if(o++,t&&o==t)break}t||(t=o);var a="";if(!n){for(var i,c=1024;t>0;)i=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,c))),a=a?a+i:i,e+=c,t-=c;return a}var s=new Runtime.UTF8Processor;for(o=0;o<t;o++)assert(e+o<TOTAL_MEMORY),r=HEAPU8[e+o|0],a+=s.processCChar(r);return a}function UTF16ToString(e){for(var t=0,r="";;){var n=HEAP16[e+2*t>>1];if(0==n)return r;++t,r+=String.fromCharCode(n)}}function stringToUTF16(e,t){for(var r=0;r<e.length;++r){var n=e.charCodeAt(r);HEAP16[t+2*r>>1]=n}HEAP16[t+2*e.length>>1]=0}function UTF32ToString(e){for(var t=0,r="";;){var n=HEAP32[e+4*t>>2];if(0==n)return r;if(++t,n>=65536){var o=n-65536;r+=String.fromCharCode(55296|o>>10,56320|1023&o)}else r+=String.fromCharCode(n)}}function stringToUTF32(e,t){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);if(o>=55296&&o<=57343)o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n);HEAP32[t+4*r>>2]=o,++r}HEAP32[t+4*r>>2]=0}function demangle(e){try{var t=function(i,c,s){c=c||1/0;var u,l="",f=[];if("N"===e[r]){if(u=function(){r++,"K"===e[r]&&r++;for(var t=[];"E"!==e[r];)if("S"!==e[r])if("C"!==e[r]){var n=parseInt(e.substr(r)),a=n.toString().length;if(!n||!a){r--;break}var i=e.substr(r+a,n);t.push(i),o.push(i),r+=a+n}else t.push(t[t.length-1]),r+=2;else{r++;var c=e.indexOf("_",r),s=e.substring(r,c)||0;t.push(o[s]||"?"),r=c+1}return r++,t}().join("::"),0===--c)return i?[u]:u}else if(("K"===e[r]||a&&"L"===e[r])&&r++,v=parseInt(e.substr(r))){var p=v.toString().length;u=e.substr(r+p,v),r+=p+v}if(a=!1,"I"===e[r]){r++;var h=t(!0);l+=t(!0,1,!0)[0]+" "+u+"<"+h.join(", ")+">"}else l=u;e:for(;r<e.length&&c-- >0;){var d=e[r++];if(d in n)f.push(n[d]);else switch(d){case"P":f.push(t(!0,1,!0)[0]+"*");break;case"R":f.push(t(!0,1,!0)[0]+"&");break;case"L":r++;var v=e.indexOf("E",r)-r;f.push(e.substr(r,v)),r+=v+2;break;case"A":v=parseInt(e.substr(r));if(r+=v.toString().length,"_"!==e[r])throw"?";r++,f.push(t(!0,1,!0)[0]+" ["+v+"]");break;case"E":break e;default:l+="?"+d;break e}}return s||1!==f.length||"void"!==f[0]||(f=[]),i?f:l+"("+f.join(", ")+")"};if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}var r=3,n={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},o=[],a=!0;return t()}catch(t){return e}}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"}))}function stackTrace(){var e=(new Error).stack;return e?demangleAll(e):"(no stack trace available)"}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.Pointer_stringify=Pointer_stringify,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function alignMemoryPage(e){return e+4095&-4096}var STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0;function enlargeMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.")}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,FAST_MEMORY=Module.FAST_MEMORY||2097152;assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"Cannot fallback to non-typed array case: Code is too specialized");var buffer=new ArrayBuffer(TOTAL_MEMORY);function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Runtime.dynCall("v",r):Runtime.dynCall("vi",r,[t.arg]):r(void 0===t.arg?null:t.arg)}else t()}}HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,r){var n=(new Runtime.UTF8Processor).processJSString(e);return r&&(n.length=r),t||n.push(0),n}function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];n>255&&(assert(!1,"Character code "+n+" ("+String.fromCharCode(n)+") at offset "+r+" not in 0x00-0xFF."),n&=255),t.push(String.fromCharCode(n))}return t.join("")}function writeStringToMemory(e,t,r){for(var n=intArrayFromString(e,r),o=0;o<n.length;){var a=n[o];HEAP8[t+o|0]=a,o+=1}}function writeArrayToMemory(e,t){for(var r=0;r<e.length;r++)HEAP8[t+r|0]=e[r]}function writeAsciiToMemory(e,t,r){for(var n=0;n<e.length;n++)assert(e.charCodeAt(n)==e.charCodeAt(n)&255),HEAP8[t+n|0]=e.charCodeAt(n);r||(HEAP8[t+e.length|0]=0)}function unSign(e,t,r,n){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,r,n){if(e<=0)return e;var o=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=o&&(t<=32||e>o)&&(e=-2*o+e),e}Module.addOnPreRun=Module.addOnPreRun=addOnPreRun,Module.addOnInit=Module.addOnInit=addOnInit,Module.addOnPreMain=Module.addOnPreMain=addOnPreMain,Module.addOnExit=Module.addOnExit=addOnExit,Module.addOnPostRun=Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16)*n+r*(t>>>16)<<16)|0}),Math.imul=Math.imul;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval((function(){var e=!1;for(var t in runDependencyTracking)e||(e=!0,Module.printErr("still waiting on run dependencies:")),Module.printErr("dependency: "+t);e&&Module.printErr("(end of list)")}),1e4))):Module.printErr("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):Module.printErr("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null;function runPostSets(){}STATIC_BASE=8,STATICTOP=STATIC_BASE+504,__ATINIT__.push({func:function(){runPostSets()}}),allocate([255,255,255,0,0,0,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _memset(e,t,r){t|=0;var n,o=0,a=0,i=0;if(n=(e|=0)+(r|=0)|0,(0|r)>=20){if(o=(t&=255)|t<<8|t<<16|t<<24,a=-4&n,i=3&e)for(i=e+4-i|0;(0|e)<(0|i);)HEAP8[e]=t,e=e+1|0;for(;(0|e)<(0|a);)HEAP32[e>>2]=o,e=e+4|0}for(;(0|e)<(0|n);)HEAP8[e]=t,e=e+1|0;return e-r|0}assert(tempDoublePtr%8==0);var _llvm_memset_p0i8_i32=_memset;function _memcpy(e,t,r){r|=0;var n;if(n=0|(e|=0),(3&e)==(3&(t|=0))){for(;3&e;){if(!(0|r))return 0|n;HEAP8[e]=HEAP8[t],e=e+1|0,t=t+1|0,r=r-1|0}for(;(0|r)>=4;)HEAP32[e>>2]=HEAP32[t>>2],e=e+4|0,t=t+4|0,r=r-4|0}for(;(0|r)>0;)HEAP8[e]=HEAP8[t],e=e+1|0,t=t+1|0,r=r-1|0;return 0|n}var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;function _abort(){Module.abort()}var ___errno_state=0;function ___setErrNo(e){return HEAP32[___errno_state>>2]=e,e}function ___errno_location(){return ___errno_state}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var r=DYNAMICTOP;return 0!=e&&t.alloc(e),r}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:case 84:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _time(e){var t=Math.floor(Date.now()/1e3);return e&&(HEAP32[e>>2]=t),t}function _strlen(e){var t=0;for(t=e|=0;HEAP8[t];)t=t+1|0;return t-e|0}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(ERRNO_CODES.ENODEV);e.tty=t,e.seekable=!1},close:function(e){e.tty.output.length&&e.tty.ops.put_char(e.tty,10)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(ERRNO_CODES.ENXIO);for(var a=0,i=0;i<n;i++){var c;try{c=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(void 0===c&&0===a)throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);if(null==c)break;a++,t[r+i]=c}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(ERRNO_CODES.ENXIO);for(var a=0;a<n;a++)try{e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(ENVIRONMENT_IS_NODE){if(!(t=process.stdin.read()))return process.stdin._readableState&&process.stdin._readableState.ended?null:void 0}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(Module.print(e.output.join("")),e.output=[]):e.output.push(TTY.utf8.processCChar(t))}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(Module.printErr(e.output.join("")),e.output=[]):e.output.push(TTY.utf8.processCChar(t))}}},MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(ERRNO_CODES.EPERM);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod},"mknod",MEMFS.node_ops.mknod),"rename",MEMFS.node_ops.rename),"unlink",MEMFS.node_ops.unlink),"rmdir",MEMFS.node_ops.rmdir),"readdir",MEMFS.node_ops.readdir),"symlink",MEMFS.node_ops.symlink),stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var o=FS.createNode(e,t,r,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.contents=[],o.contentMode=MEMFS.CONTENT_FLEXIBLE):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o),o},ensureFlexible:function(e){if(e.contentMode!==MEMFS.CONTENT_FLEXIBLE){var t=e.contents;e.contents=Array.prototype.slice.call(t),e.contentMode=MEMFS.CONTENT_FLEXIBLE}},node_ops:{getattr:function(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.contents.length:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){if(void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size){MEMFS.ensureFlexible(e);var r=e.contents;if(t.size<r.length)r.length=t.size;else for(;t.size>r.length;)r.push(0)}},lookup:function(e,t){throw FS.genericErrors[ERRNO_CODES.ENOENT]},mknod:function(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename:function(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete e.parent.contents[e.name],e.name=r,t.contents[r]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.link}},stream_ops:{read:function(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(assert(i>=0),i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var c=0;c<i;c++)t[r+c]=a[o+c];return i},write:function(e,t,r,n,o,a){var i=e.node;i.timestamp=Date.now();var c=i.contents;if(n&&0===c.length&&0===o&&t.subarray)return assert(t.length),a&&0===r?(i.contents=t,i.contentMode=t.buffer===HEAP8.buffer?MEMFS.CONTENT_OWNING:MEMFS.CONTENT_FIXED):(i.contents=new Uint8Array(t.subarray(r,r+n)),i.contentMode=MEMFS.CONTENT_FIXED),n;MEMFS.ensureFlexible(i);for(c=i.contents;c.length<o;)c.push(0);for(var s=0;s<n;s++)c[o+s]=t[r+s];return n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&FS.isFile(e.node.mode)&&(n+=e.node.contents.length),n<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.ungotten=[],e.position=n,n},allocate:function(e,t,r){MEMFS.ensureFlexible(e.node);for(var n=e.node.contents,o=t+r;o>n.length;)n.push(0)},mmap:function(e,t,r,n,o,a,i){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENODEV);var c,s,u=e.node.contents;if(2&i||u.buffer!==t&&u.buffer!==t.buffer){if((o>0||o+n<u.length)&&(u=u.subarray?u.subarray(o,o+n):Array.prototype.slice.call(u,o,o+n)),s=!0,!(c=_malloc(n)))throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);t.set(u,c)}else s=!1,c=u.byteOffset;return{ptr:c,allocated:s}}}},IDBFS={dbs:{},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",mount:function(e){return MEMFS.mount.apply(null,arguments)},syncfs:function(e,t,r){IDBFS.getLocalSet(e,(function(n,o){if(n)return r(n);IDBFS.getRemoteSet(e,(function(e,n){if(e)return r(e);var a=t?n:o,i=t?o:n;IDBFS.reconcile(a,i,r)}))}))},reconcile:function(e,t,r){var n=0,o={};for(var a in e.files)if(e.files.hasOwnProperty(a)){var i=e.files[a];(!(s=t.files[a])||i.timestamp>s.timestamp)&&(o[a]=i,n++)}var c={};for(var a in t.files)if(t.files.hasOwnProperty(a)){var s;i=t.files[a];(s=e.files[a])||(c[a]=i,n++)}if(!n)return r(null);var u=0;function l(e){return e?r(e):++u>=n?r(null):void 0}var f=("remote"===e.type?e.db:t.db).transaction([IDBFS.DB_STORE_NAME],"readwrite");f.onerror=function(){r(this.error)};var p=f.objectStore(IDBFS.DB_STORE_NAME);for(var h in o)if(o.hasOwnProperty(h)){var d=o[h];if("local"===t.type)try{if(FS.isDir(d.mode))FS.mkdir(h,d.mode);else if(FS.isFile(d.mode)){var v=FS.open(h,"w+",438);FS.write(v,d.contents,0,d.contents.length,0,!0),FS.close(v)}l(null)}catch(i){return l(i)}else(y=p.put(d,h)).onsuccess=function(){l(null)},y.onerror=function(){l(this.error)}}for(var h in c)if(c.hasOwnProperty(h)){var y;d=c[h];if("local"===t.type)try{FS.isDir(d.mode)?FS.rmdir(h):FS.isFile(d.mode)&&FS.unlink(h),l(null)}catch(i){return l(i)}else(y=p.delete(h)).onsuccess=function(){l(null)},y.onerror=function(){l(this.error)}}},getLocalSet:function(e,t){var r={};function n(e){return"."!==e&&".."!==e}function o(e){return function(t){return PATH.join2(e,t)}}for(var a=FS.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,c,s=a.pop();try{c=FS.lookupPath(s).node,i=FS.stat(s)}catch(e){return t(e)}if(FS.isDir(i.mode))a.push.apply(a,FS.readdir(s).filter(n).map(o(s))),r[s]={mode:i.mode,timestamp:i.mtime};else{if(!FS.isFile(i.mode))return t(new Error("node type not supported"));r[s]={contents:c.contents,mode:i.mode,timestamp:i.mtime}}}return t(null,{type:"local",files:r})},getDB:function(e,t){var r,n=IDBFS.dbs[e];if(n)return t(null,n);try{r=IDBFS.indexedDB().open(e,IDBFS.DB_VERSION)}catch(e){return onerror(e)}r.onupgradeneeded=function(){(n=r.result).createObjectStore(IDBFS.DB_STORE_NAME)},r.onsuccess=function(){n=r.result,IDBFS.dbs[e]=n,t(null,n)},r.onerror=function(){t(this.error)}},getRemoteSet:function(e,t){var r={};IDBFS.getDB(e.mountpoint,(function(e,n){if(e)return t(e);var o=n.transaction([IDBFS.DB_STORE_NAME],"readonly");o.onerror=function(){t(this.error)},o.objectStore(IDBFS.DB_STORE_NAME).openCursor().onsuccess=function(e){var o=e.target.result;if(!o)return t(null,{type:"remote",db:n,files:r});r[o.key]=o.value,o.continue()}}))}},NODEFS={isWindows:!1,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/)},mount:function(e){return assert(ENVIRONMENT_IS_NODE),NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode:function(e,t,r,n){if(!FS.isDir(r)&&!FS.isFile(r)&&!FS.isLink(r))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var o=FS.createNode(e,t,r);return o.node_ops=NODEFS.node_ops,o.stream_ops=NODEFS.stream_ops,o},getMode:function(e){var t;try{t=fs.lstatSync(e),NODEFS.isWindows&&(t.mode=t.mode|(146&t.mode)>>1)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return t.mode},realPath:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),PATH.join.apply(null,t)},flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function(e){return e in NODEFS.flagsToPermissionStringMap?NODEFS.flagsToPermissionStringMap[e]:e},node_ops:{getattr:function(e){var t,r=NODEFS.realPath(e);try{t=fs.lstatSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return NODEFS.isWindows&&!t.blksize&&(t.blksize=4096),NODEFS.isWindows&&!t.blocks&&(t.blocks=(t.size+t.blksize-1)/t.blksize|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,blksize:t.blksize,blocks:t.blocks}},setattr:function(e,t){var r=NODEFS.realPath(e);try{if(void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.timestamp){var n=new Date(t.timestamp);fs.utimesSync(r,n,n)}void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},lookup:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t),n=NODEFS.getMode(r);return NODEFS.createNode(e,t,n)},mknod:function(e,t,r,n){var o=NODEFS.createNode(e,t,r,n),a=NODEFS.realPath(o);try{FS.isDir(o.mode)?fs.mkdirSync(a,o.mode):fs.writeFileSync(a,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return o},rename:function(e,t,r){var n=NODEFS.realPath(e),o=PATH.join2(NODEFS.realPath(t),r);try{fs.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},unlink:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},rmdir:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readdir:function(e){var t=NODEFS.realPath(e);try{return fs.readdirSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},symlink:function(e,t,r){var n=PATH.join2(NODEFS.realPath(e),t);try{fs.symlinkSync(r,n)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readlink:function(e){var t=NODEFS.realPath(e);try{return fs.readlinkSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}},stream_ops:{open:function(e){var t=NODEFS.realPath(e.node);try{FS.isFile(e.node.mode)&&(e.nfd=fs.openSync(t,NODEFS.flagsToPermissionString(e.flags)))}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},close:function(e){try{FS.isFile(e.node.mode)&&e.nfd&&fs.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},read:function(e,t,r,n,o){var a,i=Buffer.alloc(n);try{a=fs.readSync(e.nfd,i,0,n,o)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(a>0)for(var c=0;c<a;c++)t[r+c]=i[c];return a},write:function(e,t,r,n,o){var a,i=Buffer.alloc(t.subarray(r,r+n));try{a=fs.writeSync(e.nfd,i,0,n,o)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}return a},llseek:function(e,t,r){var n=t;if(1===r)n+=e.position;else if(2===r&&FS.isFile(e.node.mode))try{n+=fs.fstatSync(e.nfd).size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(n<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.position=n,n}}},_stdin=allocate(1,"i32*",ALLOC_STATIC),_stdout=allocate(1,"i32*",ALLOC_STATIC),_stderr=allocate(1,"i32*",ALLOC_STATIC);function _fflush(e){}var FS={root:null,mounts:[],devices:[null],streams:[null],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(e,t){if(e=PATH.resolve(FS.cwd(),e),(t=t||{recurse_count:0}).recurse_count>8)throw new FS.ErrnoError(ERRNO_CODES.ELOOP);for(var r=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),n=FS.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=FS.lookupNode(n,r[a]),o=PATH.join2(o,r[a]),FS.isMountpoint(n)&&(n=n.mount.root),!i||t.follow)for(var c=0;FS.isLink(n.mode);){var s=FS.readlink(o);if(o=PATH.resolve(PATH.dirname(o),s),n=FS.lookupPath(o,{recurse_count:t.recurse_count}).node,c++>40)throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}return{path:o,node:n}},getPath:function(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%FS.nameTable.length},hashAddNode:function(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:function(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r);for(var n=FS.hashName(e.id,t),o=FS.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return FS.lookup(e,t)},createNode:function(e,t,r,n){if(!FS.FSNode){FS.FSNode=function(e,t,r,n){this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.parent=null,this.mount=null,e||(e=this),this.parent=e,this.mount=e.mount,FS.hashAddNode(this)};var o=365,a=146;FS.FSNode.prototype={},Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&o)===o},set:function(e){e?this.mode|=o:this.mode&=-366}},write:{get:function(){return(this.mode&a)===a},set:function(e){e?this.mode|=a:this.mode&=-147}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}return new FS.FSNode(e,t,r,n)},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][2097155&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return FS.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:ERRNO_CODES.EACCES},mayLookup:function(e){return FS.nodePermissions(e,"x")},mayCreate:function(e,t){try{FS.lookupNode(e,t);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(e){return e.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(r){if(!FS.isDir(n.mode))return ERRNO_CODES.ENOTDIR;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return ERRNO_CODES.EBUSY}else if(FS.isDir(n.mode))return ERRNO_CODES.EISDIR;return 0},mayOpen:function(e,t){return e?FS.isLink(e.mode)?ERRNO_CODES.ELOOP:FS.isDir(e.mode)&&(2097155&t||512&t)?ERRNO_CODES.EISDIR:FS.nodePermissions(e,FS.flagsToPermissionString(t)):ERRNO_CODES.ENOENT},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||1,t=t||FS.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(ERRNO_CODES.EMFILE)},getStream:function(e){return FS.streams[e]},createStream:function(e,t,r){if(FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}})),e.__proto__)e.__proto__=FS.FSStream.prototype;else{var n=new FS.FSStream;for(var o in e)n[o]=e[o];e=n}var a=FS.nextfd(t,r);return e.fd=a,FS.streams[a]=e,e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){FS.devices[e]={stream_ops:t}},getDevice:function(e){return FS.devices[e]},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1);var r=0,n=FS.mounts.length;function o(e){if(e)return t(e);++r>=n&&t(null)}for(var a=0;a<FS.mounts.length;a++){var i=FS.mounts[a];i.type.syncfs?i.type.syncfs(i,e,o):o(null)}},mount:function(e,t,r){var n;r&&(r=(n=FS.lookupPath(r,{follow:!1})).path);var o={type:e,opts:t,mountpoint:r,root:null},a=e.mount(o);return a.mount=o,o.root=a,n&&(n.node.mount=o,n.node.mounted=!0,"/"===r&&(FS.root=o.root)),FS.mounts.push(o),a},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=FS.lookupPath(e,{parent:!0}).node,o=PATH.basename(e),a=FS.mayCreate(n,o);if(a)throw new FS.ErrnoError(a);if(!n.node_ops.mknod)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink:function(e,t){var r=FS.lookupPath(t,{parent:!0}).node,n=PATH.basename(t),o=FS.mayCreate(r,n);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.symlink)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=PATH.dirname(e),a=PATH.dirname(t),i=PATH.basename(e),c=PATH.basename(t);try{r=FS.lookupPath(e,{parent:!0}).node,n=FS.lookupPath(t,{parent:!0}).node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(r.mount!==n.mount)throw new FS.ErrnoError(ERRNO_CODES.EXDEV);var s,u=FS.lookupNode(r,i),l=PATH.relative(e,a);if("."!==l.charAt(0))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if("."!==(l=PATH.relative(t,o)).charAt(0))throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);try{s=FS.lookupNode(n,c)}catch(e){}if(u!==s){var f=FS.isDir(u.mode),p=FS.mayDelete(r,i,f);if(p)throw new FS.ErrnoError(p);if(p=s?FS.mayDelete(n,c,f):FS.mayCreate(n,c))throw new FS.ErrnoError(p);if(!r.node_ops.rename)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(u)||s&&FS.isMountpoint(s))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(n!==r&&(p=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(p);FS.hashRemoveNode(u);try{r.node_ops.rename(u,n,c)}catch(e){throw e}finally{FS.hashAddNode(u)}}},rmdir:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!0);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.rmdir)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(n))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);t.node_ops.rmdir(t,r),FS.destroyNode(n)},readdir:function(e){var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);return t.node_ops.readdir(t)},unlink:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!1);if(o)throw o===ERRNO_CODES.EISDIR&&(o=ERRNO_CODES.EPERM),new FS.ErrnoError(o);if(!t.node_ops.unlink)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(n))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);t.node_ops.unlink(t,r),FS.destroyNode(n)},readlink:function(e){var t=FS.lookupPath(e,{follow:!1}).node;if(!t.node_ops.readlink)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return t.node_ops.readlink(t)},stat:function(e,t){var r=FS.lookupPath(e,{follow:!t}).node;if(!r.node_ops.getattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return r.node_ops.getattr(r)},lstat:function(e){return FS.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=FS.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){FS.chmod(e,t,!0)},fchmod:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=FS.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){FS.chown(e,t,r,!0)},fchown:function(e,t,r){var n=FS.getStream(e);if(!n)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var r;"string"==typeof e?r=FS.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isDir(r.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!FS.isFile(r.mode))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var n=FS.nodePermissions(r,"w");if(n)throw new FS.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(!(2097155&r.flags))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);FS.truncate(r.node,t)},utime:function(e,t,r){var n=FS.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS.modeStringToFlags(t):t)?4095&r|32768:0,"object"===_typeof(e))a=e;else{e=PATH.normalize(e);try{a=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}if(64&t)if(a){if(128&t)throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}else a=FS.mknod(e,r,0);if(!a)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);FS.isChrdev(a.mode)&&(t&=-513);var i=FS.mayOpen(a,t);if(i)throw new FS.ErrnoError(i);512&t&&FS.truncate(a,0),t&=-641;var c=FS.createStream({node:a,path:FS.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1,Module.printErr("read file: "+e))),c},close:function(e){try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS.closeStream(e.fd)}},llseek:function(e,t,r){if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);return e.stream_ops.llseek(e,t,r)},read:function(e,t,r,n,o){if(n<0||o<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(1==(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!e.stream_ops.read)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var a=!0;if(void 0===o)o=e.position,a=!1;else if(!e.seekable)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write:function(e,t,r,n,o,a){if(n<0||o<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(!(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!e.stream_ops.write)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var i=!0;if(void 0===o)o=e.position,i=!1;else if(!e.seekable)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);1024&e.flags&&FS.llseek(e,0,2);var c=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=c),c},allocate:function(e,t,r){if(t<0||r<=0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(!(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(!FS.isFile(e.node.mode)&&!FS.isDir(node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENODEV);if(!e.stream_ops.allocate)throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,a,i){if(1==(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EACCES);if(!e.stream_ops.mmap)throw new FS.ErrnoError(ERRNO_CODES.ENODEV);return e.stream_ops.mmap(e,t,r,n,o,a,i)},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){var r;(t=t||{}).flags=t.flags||"r",t.encoding=t.encoding||"binary";var n=FS.open(e,t.flags),o=FS.stat(e).size,a=new Uint8Array(o);if(FS.read(n,a,0,o,0),"utf8"===t.encoding){r="";for(var i=new Runtime.UTF8Processor,c=0;c<o;c++)r+=i.processCChar(a[c])}else{if("binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');r=a}return FS.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||"w",r.encoding=r.encoding||"utf8";var n=FS.open(e,r.flags,r.mode);if("utf8"===r.encoding){var o=new Runtime.UTF8Processor,a=new Uint8Array(o.processJSString(t));FS.write(n,a,0,a.length,0)}else{if("binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');FS.write(n,t,0,t.length,0)}FS.close(n)},cwd:function(){return FS.currentPath},chdir:function(e){var t=FS.lookupPath(e,{follow:!0});if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories:function(){FS.mkdir("/tmp")},createDefaultDevices:function(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:function(){return 0},write:function(){return 0}}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0)),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createStandardStreams:function(){Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr");var e=FS.open("/dev/stdin","r");HEAP32[_stdin>>2]=e.fd,assert(1===e.fd,"invalid handle for stdin ("+e.fd+")");var t=FS.open("/dev/stdout","w");HEAP32[_stdout>>2]=t.fd,assert(2===t.fd,"invalid handle for stdout ("+t.fd+")");var r=FS.open("/dev/stderr","w");HEAP32[_stderr>>2]=r.fd,assert(3===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){FS.ErrnoError||(FS.ErrnoError=function(e){for(var t in this.errno=e,ERRNO_CODES)if(ERRNO_CODES[t]===e){this.code=t;break}this.message=ERRNO_MESSAGES[e],this.stack&&(this.stack=demangleAll(this.stack))},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[ERRNO_CODES.ENOENT].forEach((function(e){FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.root=FS.createNode(null,"/",16895,0),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices()},init:function(e,t,r){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit:function(){FS.init.initialized=!1;for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},joinPath:function(e,t){var r=PATH.join.apply(null,e);return t&&"/"==r[0]&&(r=r.substr(1)),r},absolutePath:function(e,t){return PATH.resolve(t,e)},standardizePath:function(e){return PATH.normalize(e)},findObject:function(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:(___setErrNo(r.error),null)},analyzePath:function(e,t){try{e=(n=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=PATH.basename(e),n=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createFolder:function(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(r,n);return FS.mkdir(o,a)},createPath:function(e,t,r,n){e="string"==typeof e?e:FS.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=PATH.join2(e,a);try{FS.mkdir(i)}catch(e){}e=i}}return i},createFile:function(e,t,r,n,o){var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t),i=FS.getMode(n,o);return FS.create(a,i)},createDataFile:function(e,t,r,n,o,a){var i=t?PATH.join2("string"==typeof e?e:FS.getPath(e),t):e,c=FS.getMode(n,o),s=FS.create(i,c);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}FS.chmod(s,146|c);var p=FS.open(s,"w");FS.write(p,r,0,r.length,0,a),FS.close(p),FS.chmod(s,c)}return s},createDevice:function(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(!!r,!!n);FS.createDevice.major||(FS.createDevice.major=64);var i=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(i,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,a){for(var i=0,c=0;c<o;c++){var s;try{s=r()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(void 0===s&&0===i)throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);if(null==s)break;i++,t[n+c]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return o&&(e.node.timestamp=Date.now()),i}}),FS.mkdev(o,a,i)},createLink:function(e,t,r,n,o){var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t);return FS.symlink(r,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;var t=!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Module.read)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(Module.read(e.url),!0)}catch(e){t=!1}return t||___setErrNo(ERRNO_CODES.EIO),t},createLazyFile:function(e,t,r,n,o){if("undefined"!=typeof XMLHttpRequest){var a=function(){this.lengthKnown=!1,this.chunks=[]};if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=Math.floor(e/this.chunkSize);return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=1048576;o||(a=n);var i=this;i.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===i.chunks[e]&&(i.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):intArrayFromString(o.responseText||"",!0)}(t,o)),void 0===i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),this._length=n,this._chunkSize=a,this.lengthKnown=!0};var i=new a;Object.defineProperty(i,"length",{get:function(){return this.lengthKnown||this.cacheLength(),this._length}}),Object.defineProperty(i,"chunkSize",{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}});var c={isDevice:!1,contents:i}}else c={isDevice:!1,url:r};var s=FS.createFile(e,t,c,n,o);c.contents?s.contents=c.contents:c.url&&(s.contents=null,s.url=c.url);var u={};return Object.keys(s.stream_ops).forEach((function(e){var t=s.stream_ops[e];u[e]=function(){if(!FS.forceLoadFile(s))throw new FS.ErrnoError(ERRNO_CODES.EIO);return t.apply(null,arguments)}})),u.read=function(e,t,r,n,o){if(!FS.forceLoadFile(s))throw new FS.ErrnoError(ERRNO_CODES.EIO);var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(assert(i>=0),a.slice)for(var c=0;c<i;c++)t[r+c]=a[o+c];else for(c=0;c<i;c++)t[r+c]=a.get(o+c);return i},s.stream_ops=u,s},createPreloadedFile:function(e,t,r,n,o,a,i,c,s){Browser.init();var u=t?PATH.resolve(PATH.join2(e,t)):e;function l(r){function l(r){c||FS.createDataFile(e,t,r,n,o,s),a&&a(),removeRunDependency("cp "+u)}var f=!1;Module.preloadPlugins.forEach((function(e){f||e.canHandle(u)&&(e.handle(r,u,l,(function(){i&&i(),removeRunDependency("cp "+u)})),f=!0)})),f||l(r)}addRunDependency("cp "+u),"string"==typeof r?Browser.asyncLoad(r,(function(e){l(e)}),i):l(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=FS.indexedDB();try{var o=n.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){console.log("creating db"),o.result.createObjectStore(FS.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([FS.DB_STORE_NAME],"readwrite"),a=n.objectStore(FS.DB_STORE_NAME),i=0,c=0,s=e.length;function u(){0==c?t():r()}e.forEach((function(e){var t=a.put(FS.analyzePath(e).object.contents,e);t.onsuccess=function(){++i+c==s&&u()},t.onerror=function(){c++,i+c==s&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=FS.indexedDB();try{var o=n.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var i=a.objectStore(FS.DB_STORE_NAME),c=0,s=0,u=e.length;function l(){0==s?t():r()}e.forEach((function(e){var t=i.get(e);t.onsuccess=function(){FS.analyzePath(e).exists&&FS.unlink(e),FS.createDataFile(PATH.dirname(e),PATH.basename(e),t.result,!0,!0,!0),++c+s==u&&l()},t.onerror=function(){s++,c+s==u&&l()}})),a.onerror=r},o.onerror=r}},PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=PATH.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,t){return PATH.normalize(e+"/"+t)},resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH.resolve(e).substr(1),t=PATH.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,c=0;c<a;c++)if(n[c]!==o[c]){i=c;break}var s=[];for(c=i;c<n.length;c++)s.push("..");return(s=s.concat(o.slice(i))).join("/")}},Browser={mainLoop:{scheduler:null,shouldPause:!1,paused:!1,queue:[],pause:function(){Browser.mainLoop.shouldPause=!0},resume:function(){Browser.mainLoop.paused&&(Browser.mainLoop.paused=!1,Browser.mainLoop.scheduler()),Browser.mainLoop.shouldPause=!1},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;t?t<r?Module.setStatus(e+" ("+(r-t)+"/"+r+")"):Module.setStatus(e):Module.setStatus("")}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted&&!ENVIRONMENT_IS_WORKER){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||void 0!==Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var e={canHandle:function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=null;if(Browser.hasBlobConstructor)try{(o=new Blob([e],{type:Browser.getMimetype(t)})).size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!o){var a=new Browser.BlobBuilder;a.append(new Uint8Array(e).buffer),o=a.getBlob()}var i=Browser.URLObject.createObjectURL(o);assert("string"==typeof i,"createObjectURL must return a url as a string");var c=new Image;c.onload=function(){assert(c.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=c.width,n.height=c.height,n.getContext("2d").drawImage(c,0,0),Module.preloadedImages[t]=n,Browser.URLObject.revokeObjectURL(i),r&&r(e)},c.onerror=function(e){console.log("Image "+i+" could not be decoded"),n&&n()},c.src=i}};Module.preloadPlugins.push(e);var t={canHandle:function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function a(n){o||(o=!0,Module.preloadedAudios[t]=n,r&&r(e))}function i(){o||(o=!0,Module.preloadedAudios[t]=new Audio,n&&n())}if(!Browser.hasBlobConstructor)return i();try{var c=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return i()}var s=Browser.URLObject.createObjectURL(c);assert("string"==typeof s,"createObjectURL must return a url as a string");var u=new Audio;u.addEventListener("canplaythrough",(function(){a(u)}),!1),u.onerror=function(r){o||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,a=0;a<e.length;a++)for(n=n<<8|e[a],o+=8;o>=6;){var i=n>>o-6&63;o-=6,r+=t[i]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(u))},u.src=s,Browser.safeSetTimeout((function(){a(u)}),1e4)}};Module.preloadPlugins.push(t);var r=Module.canvas;r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock,r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),Module.elementPointerLock&&r.addEventListener("click",(function(e){!Browser.pointerLock&&r.requestPointerLock&&(r.requestPointerLock(),e.preventDefault())}),!1)}function n(){Browser.pointerLock=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r}},createContext:function(e,t,r,n){var o;try{if(t){var a=function(e){s=e.statusMessage||s},i={antialias:!1,alpha:!1};if(n)for(var c in n)i[c]=n[c];var s="?";e.addEventListener("webglcontextcreationerror",a,!1);try{["experimental-webgl","webgl"].some((function(t){return o=e.getContext(t,i)}))}finally{e.removeEventListener("webglcontextcreationerror",a,!1)}}else o=e.getContext("2d");if(!o)throw":("}catch(e){return Module.print("Could not create canvas: "+[s,e]),null}return t&&(e.style.backgroundColor="black",e.addEventListener("webglcontextlost",(function(e){alert("WebGL context lost. You will need to reload the page.")}),!1)),r&&(GLctx=Module.ctx=o,Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach((function(e){e()})),Browser.init()),o},destroyContext:function(e,t,r){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t){Browser.lockPointer=e,Browser.resizeCanvas=t,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1);var r=Module.canvas;function n(){Browser.isFullScreen=!1,(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement)===r?(r.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen,r.cancelFullScreen=r.cancelFullScreen.bind(document),Browser.lockPointer&&r.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):Browser.resizeCanvas&&Browser.setWindowedCanvasSize(),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen)}Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1)),r.requestFullScreen=r.requestFullScreen||r.mozRequestFullScreen||(r.webkitRequestFullScreen?function(){r.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r.requestFullScreen()},requestAnimationFrame:function(e){"undefined"==typeof window?setTimeout(e,1e3/60):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||window.setTimeout),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame((function(){ABORT||e()}))},safeSetTimeout:function(e,t){return setTimeout((function(){ABORT||e()}),t)},safeSetInterval:function(e,t){return setInterval((function(){ABORT||e()}),t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t,r,n=Module.canvas.getBoundingClientRect(),o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(assert(void 0!==o&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"==e.type||"touchend"==e.type||"touchmove"==e.type){var i=e.touches.item(0);if(!i)return;t=i.pageX-(o+n.left),r=i.pageY-(a+n.top)}else t=e.pageX-(o+n.left),r=e.pageY-(a+n.top);var c=Module.canvas.width,s=Module.canvas.height;t*=c/n.width,r*=s/n.height,Browser.mouseMovementX=t-Browser.mouseX,Browser.mouseMovementY=r-Browser.mouseY,Browser.mouseX=t,Browser.mouseY=r}},xhrLoad:function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)},asyncLoad:function(e,t,r,n){Browser.xhrLoad(e,(function(r){assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n||removeRunDependency("al "+e)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),n||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=Module.canvas;n.width=e,n.height=t,r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){var e=Module.canvas;if(this.windowedWidth=e.width,this.windowedHeight=e.height,e.width=screen.width,e.height=screen.height,"undefined"!=typeof SDL){var t=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];t|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=t}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){var e=Module.canvas;if(e.width=this.windowedWidth,e.height=this.windowedHeight,"undefined"!=typeof SDL){var t=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];t&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=t}Browser.updateResizeListeners()}};if(___errno_state=Runtime.staticAlloc(4),HEAP32[___errno_state>>2]=0,Module.requestFullScreen=function(e,t){Browser.requestFullScreen(e,t)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,r){Browser.setCanvasSize(e,t,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},FS.staticInit(),__ATINIT__.unshift({func:function(){Module.noFSInit||FS.init.initialized||FS.init()}}),__ATMAIN__.push({func:function(){FS.ignorePermissions=!1}}),__ATEXIT__.push({func:function(){FS.quit()}}),Module.FS_createFolder=FS.createFolder,Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createLink=FS.createLink,Module.FS_createDevice=FS.createDevice,__ATINIT__.unshift({func:function(){TTY.init()}}),__ATEXIT__.push({func:function(){TTY.shutdown()}}),TTY.utf8=new Runtime.UTF8Processor,ENVIRONMENT_IS_NODE){var fs=__webpack_require__(9896);NODEFS.staticInit()}STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+5242880,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var FUNCTION_TABLE=[0,0];function _bitmap_decompress_15(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress2(y=_malloc((0|Math_imul(p=n,h=o))<<1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var E=0|Math_imul(b,p),w=-16777216|(255&(255&((0|255*(255&(255&(31&(65535&(g=HEAP16[(y+((E+_|0)<<1)|0)>>1])))))&-1)/31&-1)))<<16|(255&(255&((0|255*(255&(255&(992&(65535&g))>>5))&-1)/31&-1)))<<8|255&(255&((0|255*(255&(255&(31744&(65535&g))>>10))&-1)/31&-1)),P=0|Math_imul(b,l);HEAP32[(u+((P+_|0)<<2)|0)>>2]=w,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress2(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w,P,S,k,A,T,O,L;s=e,l=r,p=(f=n)+o|0,h=0,d=0,_=u=t,g=-1,E=0,w=0,S=0,k=0,T=0,O=-1,L=0,a=2;break;case 2:if(f>>>0<p>>>0){a=3;break}a=346;break;case 3:L=0;var C=f;f=C+1|0;var x=v=(255&(P=HEAP8[C]))>>4;if(12==(0|x)|13==(0|x)|14==(0|x)){a=4;break}if(15==(0|x)){a=5;break}a=9;break;case 4:v=v-6|0,y=15&(255&P),m=16,a=10;break;case 5:if((0|(v=15&(255&P)))<9){a=6;break}a=7;break;case 6:var I=f,H=f=I+1|0;f=H+1|0,y=(y=255&HEAP8[I])|(255&HEAP8[H])<<8,a=8;break;case 7:y=(0|v)<11?8:1,a=8;break;case 8:m=0,a=10;break;case 9:v=v>>1,y=31&(255&P),m=32,a=10;break;case 10:if(!!(0|m)){a=11;break}a=22;break;case 11:if(2==(0|v)){var N=1;a=13;break}a=12;break;case 12:N=7==(0|v);a=13;break;case 13:if(b=1&N,!(0|y)){a=14;break}a=18;break;case 14:if(!!(0|b)){a=15;break}a=16;break;case 15:var D=f;f=D+1|0,y=(255&HEAP8[D])+1|0,a=17;break;case 16:var R=f;f=R+1|0,y=(255&HEAP8[R])+m|0,a=17;break;case 17:case 20:a=21;break;case 18:if(!!(0|b)){a=19;break}a=20;break;case 19:y=y<<3,a=20;break;case 21:a=22;break;case 22:switch(0|v){case 0:a=23;break;case 8:a=28;break;case 3:a=29;break;case 6:case 7:a=30;break;case 9:a=31;break;case 10:a=32;break;default:a=33}break;case 23:if((0|g)==(0|v)){a=24;break}a=27;break;case 24:if((0|_)==(0|u)){a=25;break}a=26;break;case 25:if(!(0|h)){a=27;break}a=26;break;case 26:E=1,a=27;break;case 27:a=33;break;case 28:var F=f,U=f=F+1|0;f=U+1|0,S=65535&(65535&(S=255&HEAP8[F])|(255&HEAP8[U])<<8),a=29;break;case 29:var j=f,M=f=j+1|0;f=M+1|0,k=65535&(65535&(k=255&HEAP8[j])|(255&HEAP8[M])<<8),a=33;break;case 30:var B=f,G=f=B+1|0;f=G+1|0,O=65535&(65535&(O=255&HEAP8[B])|(255&HEAP8[G])<<8),v=v-5|0,a=33;break;case 31:T=3,v=2,L=3,a=33;break;case 32:T=5,v=2,L=5,a=33;break;case 33:g=v,A=0,a=34;break;case 34:if((0|y)>0){a=35;break}a=345;break;case 35:if((0|_)>=(0|u)){a=36;break}a=39;break;case 36:if((0|l)<=0){a=37;break}a=38;break;case 37:case 343:c=0,a=347;break;case 38:_=0,h=d,d=s+((0|Math_imul(l=l-1|0,u))<<1)|0,a=39;break;case 39:switch(0|v){case 3:a=261;break;case 4:a=272;break;case 8:a=283;break;case 13:a=321;break;case 14:a=332;break;case 0:a=40;break;case 1:a=69;break;case 2:a=93;break;default:a=343}break;case 40:if(!!(0|E)){a=41;break}a=45;break;case 41:if(!(0|h)){a=42;break}a=43;break;case 42:var Y=O;HEAP16[(d+(_<<1)|0)>>1]=Y,a=44;break;case 43:var V=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=V,a=44;break;case 44:E=0,y=y-1|0,_=_+1|0,a=45;break;case 45:if(!(0|h)){a=46;break}a=57;break;case 46:a=47;break;case 47:if(!!(0|-8&y)){a=48;break}var z=0;a=49;break;case 48:z=(0|(_+8|0))<(0|u);a=49;break;case 49:if(z){a=50;break}a=51;break;case 50:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=47;break;case 51:a=52;break;case 52:if((0|y)>0){a=53;break}var K=0;a=54;break;case 53:K=(0|_)<(0|u);a=54;break;case 54:if(K){a=55;break}a=56;break;case 55:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=52;break;case 56:case 67:a=68;break;case 57:a=58;break;case 58:if(!!(0|-8&y)){a=59;break}var q=0;a=60;break;case 59:q=(0|(_+8|0))<(0|u);a=60;break;case 60:if(q){a=61;break}a=62;break;case 61:var W=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=W,y=y-1|0;var X=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=X,y=y-1|0;var J=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=J,y=y-1|0;var Q=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Q,y=y-1|0;var Z=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Z,y=y-1|0;var $=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=$,y=y-1|0;var ee=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ee,y=y-1|0;var te=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=te,y=y-1|0,_=_+1|0,a=58;break;case 62:a=63;break;case 63:if((0|y)>0){a=64;break}var re=0;a=65;break;case 64:re=(0|_)<(0|u);a=65;break;case 65:if(re){a=66;break}a=67;break;case 66:var ne=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ne,y=y-1|0,_=_+1|0,a=63;break;case 68:case 92:case 260:case 271:case 282:case 320:case 331:case 342:a=344;break;case 69:if(!(0|h)){a=70;break}a=81;break;case 70:a=71;break;case 71:if(!!(0|-8&y)){a=72;break}var oe=0;a=73;break;case 72:oe=(0|(_+8|0))<(0|u);a=73;break;case 73:if(oe){a=74;break}a=75;break;case 74:var ae=O;HEAP16[(d+(_<<1)|0)>>1]=ae,y=y-1|0;var ie=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ie,y=y-1|0;var ce=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ce,y=y-1|0;var se=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=se,y=y-1|0;var ue=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ue,y=y-1|0;var le=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=le,y=y-1|0;var fe=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=fe,y=y-1|0;var pe=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=pe,y=y-1|0,_=_+1|0,a=71;break;case 75:a=76;break;case 76:if((0|y)>0){a=77;break}var he=0;a=78;break;case 77:he=(0|_)<(0|u);a=78;break;case 78:if(he){a=79;break}a=80;break;case 79:var de=O;HEAP16[(d+(_<<1)|0)>>1]=de,y=y-1|0,_=_+1|0,a=76;break;case 80:case 91:a=92;break;case 81:a=82;break;case 82:if(!!(0|-8&y)){a=83;break}var ve=0;a=84;break;case 83:ve=(0|(_+8|0))<(0|u);a=84;break;case 84:if(ve){a=85;break}a=86;break;case 85:var ye=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ye,y=y-1|0;var me=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=me,y=y-1|0;var be=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=be,y=y-1|0;var _e=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=_e,y=y-1|0;var ge=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ge,y=y-1|0;var Ee=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ee,y=y-1|0;var we=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=we,y=y-1|0;var Pe=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Pe,y=y-1|0,_=_+1|0,a=82;break;case 86:a=87;break;case 87:if((0|y)>0){a=88;break}var Se=0;a=89;break;case 88:Se=(0|_)<(0|u);a=89;break;case 89:if(Se){a=90;break}a=91;break;case 90:var ke=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ke,y=y-1|0,_=_+1|0,a=87;break;case 93:if(!(0|h)){a=94;break}a=177;break;case 94:a=95;break;case 95:if(!!(0|-8&y)){a=96;break}var Ae=0;a=97;break;case 96:Ae=(0|(_+8|0))<(0|u);a=97;break;case 97:if(Ae){a=98;break}a=163;break;case 98:if(!(0|255&(A=255&(255&A)<<1))){a=99;break}a=103;break;case 99:if(!!(0|L)){a=100;break}a=101;break;case 100:var Te=L;a=102;break;case 101:var Oe=f;f=Oe+1|0;Te=255&HEAP8[Oe];a=102;break;case 102:T=255&Te,A=1,a=103;break;case 103:if(!!(0|255&T&(255&A))){a=104;break}a=105;break;case 104:var Le=O;HEAP16[(d+(_<<1)|0)>>1]=Le,a=106;break;case 105:HEAP16[(d+(_<<1)|0)>>1]=0,a=106;break;case 106:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=107;break}a=111;break;case 107:if(!!(0|L)){a=108;break}a=109;break;case 108:var Ce=L;a=110;break;case 109:var xe=f;f=xe+1|0;Ce=255&HEAP8[xe];a=110;break;case 110:T=255&Ce,A=1,a=111;break;case 111:if(!!(0|255&T&(255&A))){a=112;break}a=113;break;case 112:var Ie=O;HEAP16[(d+(_<<1)|0)>>1]=Ie,a=114;break;case 113:HEAP16[(d+(_<<1)|0)>>1]=0,a=114;break;case 114:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=115;break}a=119;break;case 115:if(!!(0|L)){a=116;break}a=117;break;case 116:var He=L;a=118;break;case 117:var Ne=f;f=Ne+1|0;He=255&HEAP8[Ne];a=118;break;case 118:T=255&He,A=1,a=119;break;case 119:if(!!(0|255&T&(255&A))){a=120;break}a=121;break;case 120:var De=O;HEAP16[(d+(_<<1)|0)>>1]=De,a=122;break;case 121:HEAP16[(d+(_<<1)|0)>>1]=0,a=122;break;case 122:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=123;break}a=127;break;case 123:if(!!(0|L)){a=124;break}a=125;break;case 124:var Re=L;a=126;break;case 125:var Fe=f;f=Fe+1|0;Re=255&HEAP8[Fe];a=126;break;case 126:T=255&Re,A=1,a=127;break;case 127:if(!!(0|255&T&(255&A))){a=128;break}a=129;break;case 128:var Ue=O;HEAP16[(d+(_<<1)|0)>>1]=Ue,a=130;break;case 129:HEAP16[(d+(_<<1)|0)>>1]=0,a=130;break;case 130:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=131;break}a=135;break;case 131:if(!!(0|L)){a=132;break}a=133;break;case 132:var je=L;a=134;break;case 133:var Me=f;f=Me+1|0;je=255&HEAP8[Me];a=134;break;case 134:T=255&je,A=1,a=135;break;case 135:if(!!(0|255&T&(255&A))){a=136;break}a=137;break;case 136:var Be=O;HEAP16[(d+(_<<1)|0)>>1]=Be,a=138;break;case 137:HEAP16[(d+(_<<1)|0)>>1]=0,a=138;break;case 138:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=139;break}a=143;break;case 139:if(!!(0|L)){a=140;break}a=141;break;case 140:var Ge=L;a=142;break;case 141:var Ye=f;f=Ye+1|0;Ge=255&HEAP8[Ye];a=142;break;case 142:T=255&Ge,A=1,a=143;break;case 143:if(!!(0|255&T&(255&A))){a=144;break}a=145;break;case 144:var Ve=O;HEAP16[(d+(_<<1)|0)>>1]=Ve,a=146;break;case 145:HEAP16[(d+(_<<1)|0)>>1]=0,a=146;break;case 146:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=147;break}a=151;break;case 147:if(!!(0|L)){a=148;break}a=149;break;case 148:var ze=L;a=150;break;case 149:var Ke=f;f=Ke+1|0;ze=255&HEAP8[Ke];a=150;break;case 150:T=255&ze,A=1,a=151;break;case 151:if(!!(0|255&T&(255&A))){a=152;break}a=153;break;case 152:var qe=O;HEAP16[(d+(_<<1)|0)>>1]=qe,a=154;break;case 153:HEAP16[(d+(_<<1)|0)>>1]=0,a=154;break;case 154:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=155;break}a=159;break;case 155:if(!!(0|L)){a=156;break}a=157;break;case 156:var We=L;a=158;break;case 157:var Xe=f;f=Xe+1|0;We=255&HEAP8[Xe];a=158;break;case 158:T=255&We,A=1,a=159;break;case 159:if(!!(0|255&T&(255&A))){a=160;break}a=161;break;case 160:var Je=O;HEAP16[(d+(_<<1)|0)>>1]=Je,a=162;break;case 161:HEAP16[(d+(_<<1)|0)>>1]=0,a=162;break;case 162:y=y-1|0,_=_+1|0,a=95;break;case 163:a=164;break;case 164:if((0|y)>0){a=165;break}var Qe=0;a=166;break;case 165:Qe=(0|_)<(0|u);a=166;break;case 166:if(Qe){a=167;break}a=176;break;case 167:if(!(0|255&(A=255&(255&A)<<1))){a=168;break}a=172;break;case 168:if(!!(0|L)){a=169;break}a=170;break;case 169:var Ze=L;a=171;break;case 170:var $e=f;f=$e+1|0;Ze=255&HEAP8[$e];a=171;break;case 171:T=255&Ze,A=1,a=172;break;case 172:if(!!(0|255&T&(255&A))){a=173;break}a=174;break;case 173:var et=O;HEAP16[(d+(_<<1)|0)>>1]=et,a=175;break;case 174:HEAP16[(d+(_<<1)|0)>>1]=0,a=175;break;case 175:y=y-1|0,_=_+1|0,a=164;break;case 176:case 259:a=260;break;case 177:a=178;break;case 178:if(!!(0|-8&y)){a=179;break}var tt=0;a=180;break;case 179:tt=(0|(_+8|0))<(0|u);a=180;break;case 180:if(tt){a=181;break}a=246;break;case 181:if(!(0|255&(A=255&(255&A)<<1))){a=182;break}a=186;break;case 182:if(!!(0|L)){a=183;break}a=184;break;case 183:var rt=L;a=185;break;case 184:var nt=f;f=nt+1|0;rt=255&HEAP8[nt];a=185;break;case 185:T=255&rt,A=1,a=186;break;case 186:if(!!(0|255&T&(255&A))){a=187;break}a=188;break;case 187:var ot=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ot,a=189;break;case 188:var at=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=at,a=189;break;case 189:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=190;break}a=194;break;case 190:if(!!(0|L)){a=191;break}a=192;break;case 191:var it=L;a=193;break;case 192:var ct=f;f=ct+1|0;it=255&HEAP8[ct];a=193;break;case 193:T=255&it,A=1,a=194;break;case 194:if(!!(0|255&T&(255&A))){a=195;break}a=196;break;case 195:var st=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=st,a=197;break;case 196:var ut=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ut,a=197;break;case 197:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=198;break}a=202;break;case 198:if(!!(0|L)){a=199;break}a=200;break;case 199:var lt=L;a=201;break;case 200:var ft=f;f=ft+1|0;lt=255&HEAP8[ft];a=201;break;case 201:T=255&lt,A=1,a=202;break;case 202:if(!!(0|255&T&(255&A))){a=203;break}a=204;break;case 203:var pt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=pt,a=205;break;case 204:var ht=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ht,a=205;break;case 205:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=206;break}a=210;break;case 206:if(!!(0|L)){a=207;break}a=208;break;case 207:var dt=L;a=209;break;case 208:var vt=f;f=vt+1|0;dt=255&HEAP8[vt];a=209;break;case 209:T=255&dt,A=1,a=210;break;case 210:if(!!(0|255&T&(255&A))){a=211;break}a=212;break;case 211:var yt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=yt,a=213;break;case 212:var mt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=mt,a=213;break;case 213:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=214;break}a=218;break;case 214:if(!!(0|L)){a=215;break}a=216;break;case 215:var bt=L;a=217;break;case 216:var _t=f;f=_t+1|0;bt=255&HEAP8[_t];a=217;break;case 217:T=255&bt,A=1,a=218;break;case 218:if(!!(0|255&T&(255&A))){a=219;break}a=220;break;case 219:var gt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=gt,a=221;break;case 220:var Et=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Et,a=221;break;case 221:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=222;break}a=226;break;case 222:if(!!(0|L)){a=223;break}a=224;break;case 223:var wt=L;a=225;break;case 224:var Pt=f;f=Pt+1|0;wt=255&HEAP8[Pt];a=225;break;case 225:T=255&wt,A=1,a=226;break;case 226:if(!!(0|255&T&(255&A))){a=227;break}a=228;break;case 227:var St=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=St,a=229;break;case 228:var kt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=kt,a=229;break;case 229:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=230;break}a=234;break;case 230:if(!!(0|L)){a=231;break}a=232;break;case 231:var At=L;a=233;break;case 232:var Tt=f;f=Tt+1|0;At=255&HEAP8[Tt];a=233;break;case 233:T=255&At,A=1,a=234;break;case 234:if(!!(0|255&T&(255&A))){a=235;break}a=236;break;case 235:var Ot=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ot,a=237;break;case 236:var Lt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Lt,a=237;break;case 237:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=238;break}a=242;break;case 238:if(!!(0|L)){a=239;break}a=240;break;case 239:var Ct=L;a=241;break;case 240:var xt=f;f=xt+1|0;Ct=255&HEAP8[xt];a=241;break;case 241:T=255&Ct,A=1,a=242;break;case 242:if(!!(0|255&T&(255&A))){a=243;break}a=244;break;case 243:var It=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=It,a=245;break;case 244:var Ht=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Ht,a=245;break;case 245:y=y-1|0,_=_+1|0,a=178;break;case 246:a=247;break;case 247:if((0|y)>0){a=248;break}var Nt=0;a=249;break;case 248:Nt=(0|_)<(0|u);a=249;break;case 249:if(Nt){a=250;break}a=259;break;case 250:if(!(0|255&(A=255&(255&A)<<1))){a=251;break}a=255;break;case 251:if(!!(0|L)){a=252;break}a=253;break;case 252:var Dt=L;a=254;break;case 253:var Rt=f;f=Rt+1|0;Dt=255&HEAP8[Rt];a=254;break;case 254:T=255&Dt,A=1,a=255;break;case 255:if(!!(0|255&T&(255&A))){a=256;break}a=257;break;case 256:var Ft=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ft,a=258;break;case 257:var Ut=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Ut,a=258;break;case 258:y=y-1|0,_=_+1|0,a=247;break;case 261:a=262;break;case 262:if(!!(0|-8&y)){a=263;break}var jt=0;a=264;break;case 263:jt=(0|(_+8|0))<(0|u);a=264;break;case 264:if(jt){a=265;break}a=266;break;case 265:var Mt=k;HEAP16[(d+(_<<1)|0)>>1]=Mt,y=y-1|0;var Bt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Bt,y=y-1|0;var Gt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Gt,y=y-1|0;var Yt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Yt,y=y-1|0;var Vt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Vt,y=y-1|0;var zt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=zt,y=y-1|0;var Kt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Kt,y=y-1|0;var qt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=qt,y=y-1|0,_=_+1|0,a=262;break;case 266:a=267;break;case 267:if((0|y)>0){a=268;break}var Wt=0;a=269;break;case 268:Wt=(0|_)<(0|u);a=269;break;case 269:if(Wt){a=270;break}a=271;break;case 270:var Xt=k;HEAP16[(d+(_<<1)|0)>>1]=Xt,y=y-1|0,_=_+1|0,a=267;break;case 272:a=273;break;case 273:if(!!(0|-8&y)){a=274;break}var Jt=0;a=275;break;case 274:Jt=(0|(_+8|0))<(0|u);a=275;break;case 275:if(Jt){a=276;break}a=277;break;case 276:var Qt=f;f=Qt+1|0;var Zt=255&HEAP8[Qt];HEAP16[(d+(_<<1)|0)>>1]=Zt;var $t=f;f=$t+1|0;var er=(255&HEAP8[$t])<<8,tr=d+(_<<1)|0,rr=65535&(65535&HEAP16[tr>>1]|er);HEAP16[tr>>1]=rr,y=y-1|0,_=_+1|0;var nr=f;f=nr+1|0;var or=255&HEAP8[nr];HEAP16[(d+(_<<1)|0)>>1]=or;var ar=f;f=ar+1|0;var ir=(255&HEAP8[ar])<<8,cr=d+(_<<1)|0,sr=65535&(65535&HEAP16[cr>>1]|ir);HEAP16[cr>>1]=sr,y=y-1|0,_=_+1|0;var ur=f;f=ur+1|0;var lr=255&HEAP8[ur];HEAP16[(d+(_<<1)|0)>>1]=lr;var fr=f;f=fr+1|0;var pr=(255&HEAP8[fr])<<8,hr=d+(_<<1)|0,dr=65535&(65535&HEAP16[hr>>1]|pr);HEAP16[hr>>1]=dr,y=y-1|0,_=_+1|0;var vr=f;f=vr+1|0;var yr=255&HEAP8[vr];HEAP16[(d+(_<<1)|0)>>1]=yr;var mr=f;f=mr+1|0;var br=(255&HEAP8[mr])<<8,_r=d+(_<<1)|0,gr=65535&(65535&HEAP16[_r>>1]|br);HEAP16[_r>>1]=gr,y=y-1|0,_=_+1|0;var Er=f;f=Er+1|0;var wr=255&HEAP8[Er];HEAP16[(d+(_<<1)|0)>>1]=wr;var Pr=f;f=Pr+1|0;var Sr=(255&HEAP8[Pr])<<8,kr=d+(_<<1)|0,Ar=65535&(65535&HEAP16[kr>>1]|Sr);HEAP16[kr>>1]=Ar,y=y-1|0,_=_+1|0;var Tr=f;f=Tr+1|0;var Or=255&HEAP8[Tr];HEAP16[(d+(_<<1)|0)>>1]=Or;var Lr=f;f=Lr+1|0;var Cr=(255&HEAP8[Lr])<<8,xr=d+(_<<1)|0,Ir=65535&(65535&HEAP16[xr>>1]|Cr);HEAP16[xr>>1]=Ir,y=y-1|0,_=_+1|0;var Hr=f;f=Hr+1|0;var Nr=255&HEAP8[Hr];HEAP16[(d+(_<<1)|0)>>1]=Nr;var Dr=f;f=Dr+1|0;var Rr=(255&HEAP8[Dr])<<8,Fr=d+(_<<1)|0,Ur=65535&(65535&HEAP16[Fr>>1]|Rr);HEAP16[Fr>>1]=Ur,y=y-1|0,_=_+1|0;var jr=f;f=jr+1|0;var Mr=255&HEAP8[jr];HEAP16[(d+(_<<1)|0)>>1]=Mr;var Br=f;f=Br+1|0;var Gr=(255&HEAP8[Br])<<8,Yr=d+(_<<1)|0,Vr=65535&(65535&HEAP16[Yr>>1]|Gr);HEAP16[Yr>>1]=Vr,y=y-1|0,_=_+1|0,a=273;break;case 277:a=278;break;case 278:if((0|y)>0){a=279;break}var zr=0;a=280;break;case 279:zr=(0|_)<(0|u);a=280;break;case 280:if(zr){a=281;break}a=282;break;case 281:var Kr=f;f=Kr+1|0;var qr=255&HEAP8[Kr];HEAP16[(d+(_<<1)|0)>>1]=qr;var Wr=f;f=Wr+1|0;var Xr=(255&HEAP8[Wr])<<8,Jr=d+(_<<1)|0,Qr=65535&(65535&HEAP16[Jr>>1]|Xr);HEAP16[Jr>>1]=Qr,y=y-1|0,_=_+1|0,a=278;break;case 283:a=284;break;case 284:if(!!(0|-8&y)){a=285;break}var Zr=0;a=286;break;case 285:Zr=(0|(_+8|0))<(0|u);a=286;break;case 286:if(Zr){a=287;break}a=312;break;case 287:if(!!(0|w)){a=288;break}a=289;break;case 288:var $r=k;HEAP16[(d+(_<<1)|0)>>1]=$r,w=0,a=290;break;case 289:var en=S;HEAP16[(d+(_<<1)|0)>>1]=en,w=1,y=y+1|0,a=290;break;case 290:if(y=y-1|0,_=_+1|0,!!(0|w)){a=291;break}a=292;break;case 291:var tn=k;HEAP16[(d+(_<<1)|0)>>1]=tn,w=0,a=293;break;case 292:var rn=S;HEAP16[(d+(_<<1)|0)>>1]=rn,w=1,y=y+1|0,a=293;break;case 293:if(y=y-1|0,_=_+1|0,!!(0|w)){a=294;break}a=295;break;case 294:var nn=k;HEAP16[(d+(_<<1)|0)>>1]=nn,w=0,a=296;break;case 295:var on=S;HEAP16[(d+(_<<1)|0)>>1]=on,w=1,y=y+1|0,a=296;break;case 296:if(y=y-1|0,_=_+1|0,!!(0|w)){a=297;break}a=298;break;case 297:var an=k;HEAP16[(d+(_<<1)|0)>>1]=an,w=0,a=299;break;case 298:var cn=S;HEAP16[(d+(_<<1)|0)>>1]=cn,w=1,y=y+1|0,a=299;break;case 299:if(y=y-1|0,_=_+1|0,!!(0|w)){a=300;break}a=301;break;case 300:var sn=k;HEAP16[(d+(_<<1)|0)>>1]=sn,w=0,a=302;break;case 301:var un=S;HEAP16[(d+(_<<1)|0)>>1]=un,w=1,y=y+1|0,a=302;break;case 302:if(y=y-1|0,_=_+1|0,!!(0|w)){a=303;break}a=304;break;case 303:var ln=k;HEAP16[(d+(_<<1)|0)>>1]=ln,w=0,a=305;break;case 304:var fn=S;HEAP16[(d+(_<<1)|0)>>1]=fn,w=1,y=y+1|0,a=305;break;case 305:if(y=y-1|0,_=_+1|0,!!(0|w)){a=306;break}a=307;break;case 306:var pn=k;HEAP16[(d+(_<<1)|0)>>1]=pn,w=0,a=308;break;case 307:var hn=S;HEAP16[(d+(_<<1)|0)>>1]=hn,w=1,y=y+1|0,a=308;break;case 308:if(y=y-1|0,_=_+1|0,!!(0|w)){a=309;break}a=310;break;case 309:var dn=k;HEAP16[(d+(_<<1)|0)>>1]=dn,w=0,a=311;break;case 310:var vn=S;HEAP16[(d+(_<<1)|0)>>1]=vn,w=1,y=y+1|0,a=311;break;case 311:y=y-1|0,_=_+1|0,a=284;break;case 312:a=313;break;case 313:if((0|y)>0){a=314;break}var yn=0;a=315;break;case 314:yn=(0|_)<(0|u);a=315;break;case 315:if(yn){a=316;break}a=320;break;case 316:if(!!(0|w)){a=317;break}a=318;break;case 317:var mn=k;HEAP16[(d+(_<<1)|0)>>1]=mn,w=0,a=319;break;case 318:var bn=S;HEAP16[(d+(_<<1)|0)>>1]=bn,w=1,y=y+1|0,a=319;break;case 319:y=y-1|0,_=_+1|0,a=313;break;case 321:a=322;break;case 322:if(!!(0|-8&y)){a=323;break}var _n=0;a=324;break;case 323:_n=(0|(_+8|0))<(0|u);a=324;break;case 324:if(_n){a=325;break}a=326;break;case 325:HEAP16[(d+(_<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,_=_+1|0,a=322;break;case 326:a=327;break;case 327:if((0|y)>0){a=328;break}var gn=0;a=329;break;case 328:gn=(0|_)<(0|u);a=329;break;case 329:if(gn){a=330;break}a=331;break;case 330:HEAP16[(d+(_<<1)|0)>>1]=-1,y=y-1|0,_=_+1|0,a=327;break;case 332:a=333;break;case 333:if(!!(0|-8&y)){a=334;break}var En=0;a=335;break;case 334:En=(0|(_+8|0))<(0|u);a=335;break;case 335:if(En){a=336;break}a=337;break;case 336:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=333;break;case 337:a=338;break;case 338:if((0|y)>0){a=339;break}var wn=0;a=340;break;case 339:wn=(0|_)<(0|u);a=340;break;case 340:if(wn){a=341;break}a=342;break;case 341:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=338;break;case 344:a=34;break;case 345:a=2;break;case 346:c=1,a=347;break;case 347:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _bitmap_decompress_16(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress2(y=_malloc((0|Math_imul(p=n,h=o))<<1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var E=0|Math_imul(b,p),w=-16777216|(255&(255&((0|255*(255&(255&(31&(65535&(g=HEAP16[(y+((E+_|0)<<1)|0)>>1])))))&-1)/31&-1)))<<16|(255&(255&((0|255*(255&(255&(2016&(65535&g))>>5))&-1)/63&-1)))<<8|255&(255&((0|255*(255&(255&(63488&(65535&g))>>11))&-1)/31&-1)),P=0|Math_imul(b,l);HEAP32[(u+((P+_|0)<<2)|0)>>2]=w,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress_24(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g,E;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress3(y=_malloc(3*(0|Math_imul(p=n,h=o))&-1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var w=0|Math_imul(b,p);g=HEAP8[y+(3*(w+_|0)&-1)|0];var P=0|Math_imul(b,p);E=HEAP8[y+((3*(P+_|0)&-1)+1|0)|0];var S=0|Math_imul(b,p),k=-16777216|(255&HEAP8[y+((3*(S+_|0)&-1)+2|0)|0])<<16|(255&E)<<8|255&g,A=0|Math_imul(b,l);HEAP32[(u+((A+_|0)<<2)|0)>>2]=k,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress3(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|(STACKTOP=STACKTOP+24|0))<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w,P,S,k,A,T=i,O=i+8,L=i+16;s=e,l=r,p=(f=n)+o|0,h=0,d=0,_=u=t,g=-1,E=0,w=0;var C=T;HEAP8[C]=0,HEAP8[C+1|0]=0,HEAP8[C+2|0]=0;var x=O;HEAP8[x]=0,HEAP8[x+1|0]=0,HEAP8[x+2|0]=0,k=0;var I=L;assert(!0),HEAP8[I]=HEAP8[8],HEAP8[I+1|0]=HEAP8[9],HEAP8[I+2|0]=HEAP8[10],A=0,a=2;break;case 2:if(f>>>0<p>>>0){a=3;break}a=346;break;case 3:A=0;var H=f;f=H+1|0;var N=v=(255&(P=HEAP8[H]))>>4;if(12==(0|N)|13==(0|N)|14==(0|N)){a=4;break}if(15==(0|N)){a=5;break}a=9;break;case 4:v=v-6|0,y=15&(255&P),m=16,a=10;break;case 5:if((0|(v=15&(255&P)))<9){a=6;break}a=7;break;case 6:var D=f,R=f=D+1|0;f=R+1|0,y=(y=255&HEAP8[D])|(255&HEAP8[R])<<8,a=8;break;case 7:y=(0|v)<11?8:1,a=8;break;case 8:m=0,a=10;break;case 9:v=v>>1,y=31&(255&P),m=32,a=10;break;case 10:if(!!(0|m)){a=11;break}a=22;break;case 11:if(2==(0|v)){var F=1;a=13;break}a=12;break;case 12:F=7==(0|v);a=13;break;case 13:if(b=1&F,!(0|y)){a=14;break}a=18;break;case 14:if(!!(0|b)){a=15;break}a=16;break;case 15:var U=f;f=U+1|0,y=(255&HEAP8[U])+1|0,a=17;break;case 16:var j=f;f=j+1|0,y=(255&HEAP8[j])+m|0,a=17;break;case 17:case 20:a=21;break;case 18:if(!!(0|b)){a=19;break}a=20;break;case 19:y=y<<3,a=20;break;case 21:a=22;break;case 22:switch(0|v){case 0:a=23;break;case 8:a=28;break;case 3:a=29;break;case 6:case 7:a=30;break;case 9:a=31;break;case 10:a=32;break;default:a=33}break;case 23:if((0|g)==(0|v)){a=24;break}a=27;break;case 24:if((0|_)==(0|u)){a=25;break}a=26;break;case 25:if(!(0|h)){a=27;break}a=26;break;case 26:E=1,a=27;break;case 27:a=33;break;case 28:var M=f;f=M+1|0;var B=HEAP8[M];HEAP8[0|T]=B;var G=f;f=G+1|0;var Y=HEAP8[G];HEAP8[T+1|0]=Y;var V=f;f=V+1|0;var z=HEAP8[V];HEAP8[T+2|0]=z,a=29;break;case 29:var K=f;f=K+1|0;var q=HEAP8[K];HEAP8[0|O]=q;var W=f;f=W+1|0;var X=HEAP8[W];HEAP8[O+1|0]=X;var J=f;f=J+1|0;var Q=HEAP8[J];HEAP8[O+2|0]=Q,a=33;break;case 30:var Z=f;f=Z+1|0;var $=HEAP8[Z];HEAP8[0|L]=$;var ee=f;f=ee+1|0;var te=HEAP8[ee];HEAP8[L+1|0]=te;var re=f;f=re+1|0;var ne=HEAP8[re];HEAP8[L+2|0]=ne,v=v-5|0,a=33;break;case 31:k=3,v=2,A=3,a=33;break;case 32:k=5,v=2,A=5,a=33;break;case 33:g=v,S=0,a=34;break;case 34:if((0|y)>0){a=35;break}a=345;break;case 35:if((0|_)>=(0|u)){a=36;break}a=39;break;case 36:if((0|l)<=0){a=37;break}a=38;break;case 37:case 343:c=0,a=347;break;case 38:_=0,h=d,d=s+(0|Math_imul(l=l-1|0,3*u&-1))|0,a=39;break;case 39:switch(0|v){case 3:a=261;break;case 4:a=272;break;case 8:a=283;break;case 13:a=321;break;case 14:a=332;break;case 0:a=40;break;case 1:a=69;break;case 2:a=93;break;default:a=343}break;case 40:if(!!(0|E)){a=41;break}a=45;break;case 41:if(!(0|h)){a=42;break}a=43;break;case 42:var oe=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=oe;var ae=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ae;var ie=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ie,a=44;break;case 43:var ce=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=ce;var se=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=se;var ue=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=ue,a=44;break;case 44:E=0,y=y-1|0,_=_+1|0,a=45;break;case 45:if(!(0|h)){a=46;break}a=57;break;case 46:a=47;break;case 47:if(!!(0|-8&y)){a=48;break}var le=0;a=49;break;case 48:le=(0|(_+8|0))<(0|u);a=49;break;case 49:if(le){a=50;break}a=51;break;case 50:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=47;break;case 51:a=52;break;case 52:if((0|y)>0){a=53;break}var fe=0;a=54;break;case 53:fe=(0|_)<(0|u);a=54;break;case 54:if(fe){a=55;break}a=56;break;case 55:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=52;break;case 56:case 67:a=68;break;case 57:a=58;break;case 58:if(!!(0|-8&y)){a=59;break}var pe=0;a=60;break;case 59:pe=(0|(_+8|0))<(0|u);a=60;break;case 60:if(pe){a=61;break}a=62;break;case 61:var he=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=he;var de=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=de;var ve=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=ve,y=y-1|0;var ye=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=ye;var me=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=me;var be=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=be,y=y-1|0;var _e=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=_e;var ge=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=ge;var Ee=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ee,y=y-1|0;var we=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=we;var Pe=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Pe;var Se=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Se,y=y-1|0;var ke=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=ke;var Ae=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ae;var Te=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Te,y=y-1|0;var Oe=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=Oe;var Le=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Le;var Ce=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ce,y=y-1|0;var xe=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=xe;var Ie=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ie;var He=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=He,y=y-1|0;var Ne=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=Ne;var De=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=De;var Re=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Re,y=y-1|0,_=_+1|0,a=58;break;case 62:a=63;break;case 63:if((0|y)>0){a=64;break}var Fe=0;a=65;break;case 64:Fe=(0|_)<(0|u);a=65;break;case 65:if(Fe){a=66;break}a=67;break;case 66:var Ue=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Ue;var je=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=je;var Me=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Me,y=y-1|0,_=_+1|0,a=63;break;case 68:case 92:case 260:case 271:case 282:case 320:case 331:case 342:a=344;break;case 69:if(!(0|h)){a=70;break}a=81;break;case 70:a=71;break;case 71:if(!!(0|-8&y)){a=72;break}var Be=0;a=73;break;case 72:Be=(0|(_+8|0))<(0|u);a=73;break;case 73:if(Be){a=74;break}a=75;break;case 74:var Ge=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Ge;var Ye=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ye;var Ve=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ve,y=y-1|0,_=_+1|0;var ze=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ze;var Ke=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ke;var qe=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=qe,y=y-1|0,_=_+1|0;var We=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=We;var Xe=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Xe;var Je=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Je,y=y-1|0,_=_+1|0;var Qe=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Qe;var Ze=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ze;var $e=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=$e,y=y-1|0,_=_+1|0;var et=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=et;var tt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=tt;var rt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=rt,y=y-1|0,_=_+1|0;var nt=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=nt;var ot=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ot;var at=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=at,y=y-1|0,_=_+1|0;var it=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=it;var ct=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ct;var st=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=st,y=y-1|0,_=_+1|0;var ut=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ut;var lt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lt;var ft=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ft,y=y-1|0,_=_+1|0,a=71;break;case 75:a=76;break;case 76:if((0|y)>0){a=77;break}var pt=0;a=78;break;case 77:pt=(0|_)<(0|u);a=78;break;case 78:if(pt){a=79;break}a=80;break;case 79:var ht=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ht;var dt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=dt;var vt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=vt,y=y-1|0,_=_+1|0,a=76;break;case 80:case 91:a=92;break;case 81:a=82;break;case 82:if(!!(0|-8&y)){a=83;break}var yt=0;a=84;break;case 83:yt=(0|(_+8|0))<(0|u);a=84;break;case 84:if(yt){a=85;break}a=86;break;case 85:var mt=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=mt;var bt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=bt;var _t=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=_t,y=y-1|0;var gt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=gt;var Et=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Et;var wt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=wt,y=y-1|0;var Pt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Pt;var St=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=St;var kt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=kt,y=y-1|0;var At=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=At;var Tt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Tt;var Ot=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Ot,y=y-1|0;var Lt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Lt;var Ct=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ct;var xt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=xt,y=y-1|0;var It=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=It;var Ht=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ht;var Nt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Nt,y=y-1|0;var Dt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Dt;var Rt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Rt;var Ft=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Ft,y=y-1|0;var Ut=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Ut;var jt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=jt;var Mt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Mt,y=y-1|0,_=_+1|0,a=82;break;case 86:a=87;break;case 87:if((0|y)>0){a=88;break}var Bt=0;a=89;break;case 88:Bt=(0|_)<(0|u);a=89;break;case 89:if(Bt){a=90;break}a=91;break;case 90:var Gt=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Gt;var Yt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Yt;var Vt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Vt,y=y-1|0,_=_+1|0,a=87;break;case 93:if(!(0|h)){a=94;break}a=177;break;case 94:a=95;break;case 95:if(!!(0|-8&y)){a=96;break}var zt=0;a=97;break;case 96:zt=(0|(_+8|0))<(0|u);a=97;break;case 97:if(zt){a=98;break}a=163;break;case 98:if(!(0|255&(S=255&(255&S)<<1))){a=99;break}a=103;break;case 99:if(!!(0|A)){a=100;break}a=101;break;case 100:var Kt=A;a=102;break;case 101:var qt=f;f=qt+1|0;Kt=255&HEAP8[qt];a=102;break;case 102:k=255&Kt,S=1,a=103;break;case 103:if(!!(0|255&k&(255&S))){a=104;break}a=105;break;case 104:var Wt=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Wt;var Xt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Xt;var Jt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Jt,a=106;break;case 105:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=106;break;case 106:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=107;break}a=111;break;case 107:if(!!(0|A)){a=108;break}a=109;break;case 108:var Qt=A;a=110;break;case 109:var Zt=f;f=Zt+1|0;Qt=255&HEAP8[Zt];a=110;break;case 110:k=255&Qt,S=1,a=111;break;case 111:if(!!(0|255&k&(255&S))){a=112;break}a=113;break;case 112:var $t=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=$t;var er=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=er;var tr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=tr,a=114;break;case 113:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=114;break;case 114:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=115;break}a=119;break;case 115:if(!!(0|A)){a=116;break}a=117;break;case 116:var rr=A;a=118;break;case 117:var nr=f;f=nr+1|0;rr=255&HEAP8[nr];a=118;break;case 118:k=255&rr,S=1,a=119;break;case 119:if(!!(0|255&k&(255&S))){a=120;break}a=121;break;case 120:var or=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=or;var ar=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ar;var ir=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ir,a=122;break;case 121:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=122;break;case 122:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=123;break}a=127;break;case 123:if(!!(0|A)){a=124;break}a=125;break;case 124:var cr=A;a=126;break;case 125:var sr=f;f=sr+1|0;cr=255&HEAP8[sr];a=126;break;case 126:k=255&cr,S=1,a=127;break;case 127:if(!!(0|255&k&(255&S))){a=128;break}a=129;break;case 128:var ur=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ur;var lr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lr;var fr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=fr,a=130;break;case 129:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=130;break;case 130:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=131;break}a=135;break;case 131:if(!!(0|A)){a=132;break}a=133;break;case 132:var pr=A;a=134;break;case 133:var hr=f;f=hr+1|0;pr=255&HEAP8[hr];a=134;break;case 134:k=255&pr,S=1,a=135;break;case 135:if(!!(0|255&k&(255&S))){a=136;break}a=137;break;case 136:var dr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=dr;var vr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=vr;var yr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=yr,a=138;break;case 137:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=138;break;case 138:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=139;break}a=143;break;case 139:if(!!(0|A)){a=140;break}a=141;break;case 140:var mr=A;a=142;break;case 141:var br=f;f=br+1|0;mr=255&HEAP8[br];a=142;break;case 142:k=255&mr,S=1,a=143;break;case 143:if(!!(0|255&k&(255&S))){a=144;break}a=145;break;case 144:var _r=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=_r;var gr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=gr;var Er=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Er,a=146;break;case 145:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=146;break;case 146:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=147;break}a=151;break;case 147:if(!!(0|A)){a=148;break}a=149;break;case 148:var wr=A;a=150;break;case 149:var Pr=f;f=Pr+1|0;wr=255&HEAP8[Pr];a=150;break;case 150:k=255&wr,S=1,a=151;break;case 151:if(!!(0|255&k&(255&S))){a=152;break}a=153;break;case 152:var Sr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Sr;var kr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=kr;var Ar=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ar,a=154;break;case 153:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=154;break;case 154:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=155;break}a=159;break;case 155:if(!!(0|A)){a=156;break}a=157;break;case 156:var Tr=A;a=158;break;case 157:var Or=f;f=Or+1|0;Tr=255&HEAP8[Or];a=158;break;case 158:k=255&Tr,S=1,a=159;break;case 159:if(!!(0|255&k&(255&S))){a=160;break}a=161;break;case 160:var Lr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Lr;var Cr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Cr;var xr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=xr,a=162;break;case 161:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=162;break;case 162:y=y-1|0,_=_+1|0,a=95;break;case 163:a=164;break;case 164:if((0|y)>0){a=165;break}var Ir=0;a=166;break;case 165:Ir=(0|_)<(0|u);a=166;break;case 166:if(Ir){a=167;break}a=176;break;case 167:if(!(0|255&(S=255&(255&S)<<1))){a=168;break}a=172;break;case 168:if(!!(0|A)){a=169;break}a=170;break;case 169:var Hr=A;a=171;break;case 170:var Nr=f;f=Nr+1|0;Hr=255&HEAP8[Nr];a=171;break;case 171:k=255&Hr,S=1,a=172;break;case 172:if(!!(0|255&k&(255&S))){a=173;break}a=174;break;case 173:var Dr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Dr;var Rr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Rr;var Fr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Fr,a=175;break;case 174:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=175;break;case 175:y=y-1|0,_=_+1|0,a=164;break;case 176:case 259:a=260;break;case 177:a=178;break;case 178:if(!!(0|-8&y)){a=179;break}var Ur=0;a=180;break;case 179:Ur=(0|(_+8|0))<(0|u);a=180;break;case 180:if(Ur){a=181;break}a=246;break;case 181:if(!(0|255&(S=255&(255&S)<<1))){a=182;break}a=186;break;case 182:if(!!(0|A)){a=183;break}a=184;break;case 183:var jr=A;a=185;break;case 184:var Mr=f;f=Mr+1|0;jr=255&HEAP8[Mr];a=185;break;case 185:k=255&jr,S=1,a=186;break;case 186:if(!!(0|255&k&(255&S))){a=187;break}a=188;break;case 187:var Br=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Br;var Gr=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Gr;var Yr=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Yr,a=189;break;case 188:var Vr=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Vr;var zr=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=zr;var Kr=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Kr,a=189;break;case 189:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=190;break}a=194;break;case 190:if(!!(0|A)){a=191;break}a=192;break;case 191:var qr=A;a=193;break;case 192:var Wr=f;f=Wr+1|0;qr=255&HEAP8[Wr];a=193;break;case 193:k=255&qr,S=1,a=194;break;case 194:if(!!(0|255&k&(255&S))){a=195;break}a=196;break;case 195:var Xr=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Xr;var Jr=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Jr;var Qr=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Qr,a=197;break;case 196:var Zr=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Zr;var $r=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=$r;var en=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=en,a=197;break;case 197:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=198;break}a=202;break;case 198:if(!!(0|A)){a=199;break}a=200;break;case 199:var tn=A;a=201;break;case 200:var rn=f;f=rn+1|0;tn=255&HEAP8[rn];a=201;break;case 201:k=255&tn,S=1,a=202;break;case 202:if(!!(0|255&k&(255&S))){a=203;break}a=204;break;case 203:var nn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=nn;var on=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=on;var an=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=an,a=205;break;case 204:var cn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=cn;var sn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=sn;var un=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=un,a=205;break;case 205:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=206;break}a=210;break;case 206:if(!!(0|A)){a=207;break}a=208;break;case 207:var ln=A;a=209;break;case 208:var fn=f;f=fn+1|0;ln=255&HEAP8[fn];a=209;break;case 209:k=255&ln,S=1,a=210;break;case 210:if(!!(0|255&k&(255&S))){a=211;break}a=212;break;case 211:var pn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=pn;var hn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=hn;var dn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=dn,a=213;break;case 212:var vn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=vn;var yn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=yn;var mn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=mn,a=213;break;case 213:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=214;break}a=218;break;case 214:if(!!(0|A)){a=215;break}a=216;break;case 215:var bn=A;a=217;break;case 216:var _n=f;f=_n+1|0;bn=255&HEAP8[_n];a=217;break;case 217:k=255&bn,S=1,a=218;break;case 218:if(!!(0|255&k&(255&S))){a=219;break}a=220;break;case 219:var gn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=gn;var En=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=En;var wn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=wn,a=221;break;case 220:var Pn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Pn;var Sn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Sn;var kn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=kn,a=221;break;case 221:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=222;break}a=226;break;case 222:if(!!(0|A)){a=223;break}a=224;break;case 223:var An=A;a=225;break;case 224:var Tn=f;f=Tn+1|0;An=255&HEAP8[Tn];a=225;break;case 225:k=255&An,S=1,a=226;break;case 226:if(!!(0|255&k&(255&S))){a=227;break}a=228;break;case 227:var On=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=On;var Ln=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ln;var Cn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Cn,a=229;break;case 228:var xn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=xn;var In=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=In;var Hn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Hn,a=229;break;case 229:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=230;break}a=234;break;case 230:if(!!(0|A)){a=231;break}a=232;break;case 231:var Nn=A;a=233;break;case 232:var Dn=f;f=Dn+1|0;Nn=255&HEAP8[Dn];a=233;break;case 233:k=255&Nn,S=1,a=234;break;case 234:if(!!(0|255&k&(255&S))){a=235;break}a=236;break;case 235:var Rn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Rn;var Fn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Fn;var Un=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Un,a=237;break;case 236:var jn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=jn;var Mn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Mn;var Bn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Bn,a=237;break;case 237:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=238;break}a=242;break;case 238:if(!!(0|A)){a=239;break}a=240;break;case 239:var Gn=A;a=241;break;case 240:var Yn=f;f=Yn+1|0;Gn=255&HEAP8[Yn];a=241;break;case 241:k=255&Gn,S=1,a=242;break;case 242:if(!!(0|255&k&(255&S))){a=243;break}a=244;break;case 243:var Vn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Vn;var zn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=zn;var Kn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Kn,a=245;break;case 244:var qn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=qn;var Wn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Wn;var Xn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Xn,a=245;break;case 245:y=y-1|0,_=_+1|0,a=178;break;case 246:a=247;break;case 247:if((0|y)>0){a=248;break}var Jn=0;a=249;break;case 248:Jn=(0|_)<(0|u);a=249;break;case 249:if(Jn){a=250;break}a=259;break;case 250:if(!(0|255&(S=255&(255&S)<<1))){a=251;break}a=255;break;case 251:if(!!(0|A)){a=252;break}a=253;break;case 252:var Qn=A;a=254;break;case 253:var Zn=f;f=Zn+1|0;Qn=255&HEAP8[Zn];a=254;break;case 254:k=255&Qn,S=1,a=255;break;case 255:if(!!(0|255&k&(255&S))){a=256;break}a=257;break;case 256:var $n=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=$n;var eo=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=eo;var to=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=to,a=258;break;case 257:var ro=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=ro;var no=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=no;var oo=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=oo,a=258;break;case 258:y=y-1|0,_=_+1|0,a=247;break;case 261:a=262;break;case 262:if(!!(0|-8&y)){a=263;break}var ao=0;a=264;break;case 263:ao=(0|(_+8|0))<(0|u);a=264;break;case 264:if(ao){a=265;break}a=266;break;case 265:var io=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=io;var co=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=co;var so=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=so,y=y-1|0,_=_+1|0;var uo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=uo;var lo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lo;var fo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=fo,y=y-1|0,_=_+1|0;var po=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=po;var ho=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ho;var vo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=vo,y=y-1|0,_=_+1|0;var yo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=yo;var mo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=mo;var bo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=bo,y=y-1|0,_=_+1|0;var _o=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=_o;var go=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=go;var Eo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Eo,y=y-1|0,_=_+1|0;var wo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=wo;var Po=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Po;var So=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=So,y=y-1|0,_=_+1|0;var ko=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=ko;var Ao=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ao;var To=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=To,y=y-1|0,_=_+1|0;var Oo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Oo;var Lo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Lo;var Co=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Co,y=y-1|0,_=_+1|0,a=262;break;case 266:a=267;break;case 267:if((0|y)>0){a=268;break}var xo=0;a=269;break;case 268:xo=(0|_)<(0|u);a=269;break;case 269:if(xo){a=270;break}a=271;break;case 270:var Io=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Io;var Ho=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ho;var No=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=No,y=y-1|0,_=_+1|0,a=267;break;case 272:a=273;break;case 273:if(!!(0|-8&y)){a=274;break}var Do=0;a=275;break;case 274:Do=(0|(_+8|0))<(0|u);a=275;break;case 275:if(Do){a=276;break}a=277;break;case 276:var Ro=f;f=Ro+1|0;var Fo=HEAP8[Ro];HEAP8[d+(3*_&-1)|0]=Fo;var Uo=f;f=Uo+1|0;var jo=HEAP8[Uo];HEAP8[d+((3*_&-1)+1|0)|0]=jo;var Mo=f;f=Mo+1|0;var Bo=HEAP8[Mo];HEAP8[d+((3*_&-1)+2|0)|0]=Bo,y=y-1|0,_=_+1|0;var Go=f;f=Go+1|0;var Yo=HEAP8[Go];HEAP8[d+(3*_&-1)|0]=Yo;var Vo=f;f=Vo+1|0;var zo=HEAP8[Vo];HEAP8[d+((3*_&-1)+1|0)|0]=zo;var Ko=f;f=Ko+1|0;var qo=HEAP8[Ko];HEAP8[d+((3*_&-1)+2|0)|0]=qo,y=y-1|0,_=_+1|0;var Wo=f;f=Wo+1|0;var Xo=HEAP8[Wo];HEAP8[d+(3*_&-1)|0]=Xo;var Jo=f;f=Jo+1|0;var Qo=HEAP8[Jo];HEAP8[d+((3*_&-1)+1|0)|0]=Qo;var Zo=f;f=Zo+1|0;var $o=HEAP8[Zo];HEAP8[d+((3*_&-1)+2|0)|0]=$o,y=y-1|0,_=_+1|0;var ea=f;f=ea+1|0;var ta=HEAP8[ea];HEAP8[d+(3*_&-1)|0]=ta;var ra=f;f=ra+1|0;var na=HEAP8[ra];HEAP8[d+((3*_&-1)+1|0)|0]=na;var oa=f;f=oa+1|0;var aa=HEAP8[oa];HEAP8[d+((3*_&-1)+2|0)|0]=aa,y=y-1|0,_=_+1|0;var ia=f;f=ia+1|0;var ca=HEAP8[ia];HEAP8[d+(3*_&-1)|0]=ca;var sa=f;f=sa+1|0;var ua=HEAP8[sa];HEAP8[d+((3*_&-1)+1|0)|0]=ua;var la=f;f=la+1|0;var fa=HEAP8[la];HEAP8[d+((3*_&-1)+2|0)|0]=fa,y=y-1|0,_=_+1|0;var pa=f;f=pa+1|0;var ha=HEAP8[pa];HEAP8[d+(3*_&-1)|0]=ha;var da=f;f=da+1|0;var va=HEAP8[da];HEAP8[d+((3*_&-1)+1|0)|0]=va;var ya=f;f=ya+1|0;var ma=HEAP8[ya];HEAP8[d+((3*_&-1)+2|0)|0]=ma,y=y-1|0,_=_+1|0;var ba=f;f=ba+1|0;var _a=HEAP8[ba];HEAP8[d+(3*_&-1)|0]=_a;var ga=f;f=ga+1|0;var Ea=HEAP8[ga];HEAP8[d+((3*_&-1)+1|0)|0]=Ea;var wa=f;f=wa+1|0;var Pa=HEAP8[wa];HEAP8[d+((3*_&-1)+2|0)|0]=Pa,y=y-1|0,_=_+1|0;var Sa=f;f=Sa+1|0;var ka=HEAP8[Sa];HEAP8[d+(3*_&-1)|0]=ka;var Aa=f;f=Aa+1|0;var Ta=HEAP8[Aa];HEAP8[d+((3*_&-1)+1|0)|0]=Ta;var Oa=f;f=Oa+1|0;var La=HEAP8[Oa];HEAP8[d+((3*_&-1)+2|0)|0]=La,y=y-1|0,_=_+1|0,a=273;break;case 277:a=278;break;case 278:if((0|y)>0){a=279;break}var Ca=0;a=280;break;case 279:Ca=(0|_)<(0|u);a=280;break;case 280:if(Ca){a=281;break}a=282;break;case 281:var xa=f;f=xa+1|0;var Ia=HEAP8[xa];HEAP8[d+(3*_&-1)|0]=Ia;var Ha=f;f=Ha+1|0;var Na=HEAP8[Ha];HEAP8[d+((3*_&-1)+1|0)|0]=Na;var Da=f;f=Da+1|0;var Ra=HEAP8[Da];HEAP8[d+((3*_&-1)+2|0)|0]=Ra,y=y-1|0,_=_+1|0,a=278;break;case 283:a=284;break;case 284:if(!!(0|-8&y)){a=285;break}var Fa=0;a=286;break;case 285:Fa=(0|(_+8|0))<(0|u);a=286;break;case 286:if(Fa){a=287;break}a=312;break;case 287:if(!!(0|w)){a=288;break}a=289;break;case 288:var Ua=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ua;var ja=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ja;var Ma=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ma,w=0,a=290;break;case 289:var Ba=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Ba;var Ga=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ga;var Ya=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ya,w=1,y=y+1|0,a=290;break;case 290:if(y=y-1|0,_=_+1|0,!!(0|w)){a=291;break}a=292;break;case 291:var Va=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Va;var za=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=za;var Ka=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ka,w=0,a=293;break;case 292:var qa=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=qa;var Wa=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Wa;var Xa=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Xa,w=1,y=y+1|0,a=293;break;case 293:if(y=y-1|0,_=_+1|0,!!(0|w)){a=294;break}a=295;break;case 294:var Ja=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ja;var Qa=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Qa;var Za=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Za,w=0,a=296;break;case 295:var $a=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=$a;var ei=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ei;var ti=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ti,w=1,y=y+1|0,a=296;break;case 296:if(y=y-1|0,_=_+1|0,!!(0|w)){a=297;break}a=298;break;case 297:var ri=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=ri;var ni=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ni;var oi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=oi,w=0,a=299;break;case 298:var ai=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=ai;var ii=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ii;var ci=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ci,w=1,y=y+1|0,a=299;break;case 299:if(y=y-1|0,_=_+1|0,!!(0|w)){a=300;break}a=301;break;case 300:var si=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=si;var ui=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ui;var li=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=li,w=0,a=302;break;case 301:var fi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=fi;var pi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=pi;var hi=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=hi,w=1,y=y+1|0,a=302;break;case 302:if(y=y-1|0,_=_+1|0,!!(0|w)){a=303;break}a=304;break;case 303:var di=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=di;var vi=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=vi;var yi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=yi,w=0,a=305;break;case 304:var mi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=mi;var bi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=bi;var _i=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=_i,w=1,y=y+1|0,a=305;break;case 305:if(y=y-1|0,_=_+1|0,!!(0|w)){a=306;break}a=307;break;case 306:var gi=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=gi;var Ei=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ei;var wi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=wi,w=0,a=308;break;case 307:var Pi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Pi;var Si=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Si;var ki=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ki,w=1,y=y+1|0,a=308;break;case 308:if(y=y-1|0,_=_+1|0,!!(0|w)){a=309;break}a=310;break;case 309:var Ai=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ai;var Ti=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ti;var Oi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Oi,w=0,a=311;break;case 310:var Li=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Li;var Ci=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ci;var xi=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=xi,w=1,y=y+1|0,a=311;break;case 311:y=y-1|0,_=_+1|0,a=284;break;case 312:a=313;break;case 313:if((0|y)>0){a=314;break}var Ii=0;a=315;break;case 314:Ii=(0|_)<(0|u);a=315;break;case 315:if(Ii){a=316;break}a=320;break;case 316:if(!!(0|w)){a=317;break}a=318;break;case 317:var Hi=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Hi;var Ni=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ni;var Di=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Di,w=0,a=319;break;case 318:var Ri=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Ri;var Fi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Fi;var Ui=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ui,w=1,y=y+1|0,a=319;break;case 319:y=y-1|0,_=_+1|0,a=313;break;case 321:a=322;break;case 322:if(!!(0|-8&y)){a=323;break}var ji=0;a=324;break;case 323:ji=(0|(_+8|0))<(0|u);a=324;break;case 324:if(ji){a=325;break}a=326;break;case 325:HEAP8[d+(3*_&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,_=_+1|0,a=322;break;case 326:a=327;break;case 327:if((0|y)>0){a=328;break}var Mi=0;a=329;break;case 328:Mi=(0|_)<(0|u);a=329;break;case 329:if(Mi){a=330;break}a=331;break;case 330:HEAP8[d+(3*_&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,_=_+1|0,a=327;break;case 332:a=333;break;case 333:if(!!(0|-8&y)){a=334;break}var Bi=0;a=335;break;case 334:Bi=(0|(_+8|0))<(0|u);a=335;break;case 335:if(Bi){a=336;break}a=337;break;case 336:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=333;break;case 337:a=338;break;case 338:if((0|y)>0){a=339;break}var Gi=0;a=340;break;case 339:Gi=(0|_)<(0|u);a=340;break;case 340:if(Gi){a=341;break}a=342;break;case 341:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=338;break;case 344:a=34;break;case 345:a=2;break;case 346:c=1,a=347;break;case 347:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _bitmap_decompress_32(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g,E,w;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress4(y=_malloc((0|Math_imul(p=n,h=o))<<2),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var P=0|Math_imul(b,p);g=HEAP8[y+((P+_|0)<<2)|0];var S=0|Math_imul(b,p);E=HEAP8[y+(((S+_|0)<<2)+1|0)|0];var k=0|Math_imul(b,p);w=HEAP8[y+(((k+_|0)<<2)+2|0)|0];var A=0|Math_imul(b,p);HEAP8[y+(((A+_|0)<<2)+3|0)|0];var T=-16777216|(255&g)<<16|(255&E)<<8|255&w,O=0|Math_imul(b,l);HEAP32[(u+((O+_|0)<<2)|0)>>2]=T,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress4(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d;s=e,u=t,l=r,p=o;var v=f=n;if(f=v+1|0,16!=(0|255&HEAP8[v])){a=2;break}a=3;break;case 2:c=0,a=4;break;case 3:c=1&(0|p)==(0|(d=(d=(d=(d=(d=1)+(h=_process_plane(f,u,l,s+3|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,s+2|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,s+1|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,0|s,p-d|0))|0)),a=4;break;case 4:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _process_plane(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w;s=t,u=r,E=c=e,w=l=n,_=0,p=0,a=2;break;case 2:if((0|p)<(0|u)){a=3;break}a=34;break;case 3:if(y=0,g=l=(w+((0|Math_imul(s,u))<<2)|0)+(0|-((0|Math_imul(p+1|0,s))<<2))|0,f=0,!(0|_)){a=4;break}a=17;break;case 4:case 15:a=5;break;case 5:if((0|f)<(0|s)){a=6;break}a=16;break;case 6:var P=c;if(c=P+1|0,(0|(b=(v=15&(h=255&HEAP8[P]))<<4|(d=15&h>>4)))<=47){a=7;break}a=9;break;case 7:if((0|b)>=16){a=8;break}a=9;break;case 8:v=b,d=0,a=9;break;case 9:a=10;break;case 10:if((0|d)>0){a=11;break}a=12;break;case 11:var S=c;c=S+1|0;var k=255&(y=255&HEAP8[S]);HEAP8[l]=k,l=l+4|0,f=f+1|0,d=d-1|0,a=10;break;case 12:a=13;break;case 13:if((0|v)>0){a=14;break}a=15;break;case 14:var A=255&y;HEAP8[l]=A,l=l+4|0,f=f+1|0,v=v-1|0,a=13;break;case 16:case 32:a=33;break;case 17:case 31:a=18;break;case 18:if((0|f)<(0|s)){a=19;break}a=32;break;case 19:var T=c;if(c=T+1|0,(0|(b=(v=15&(h=255&HEAP8[T]))<<4|(d=15&h>>4)))<=47){a=20;break}a=22;break;case 20:if((0|b)>=16){a=21;break}a=22;break;case 21:v=b,d=0,a=22;break;case 22:a=23;break;case 23:if((0|d)>0){a=24;break}a=28;break;case 24:var O=c;if(c=O+1|0,!!(0|1&(m=255&HEAP8[O]))){a=25;break}a=26;break;case 25:y=0|-(m=(m=m>>1)+1|0),a=27;break;case 26:y=m=m>>1,a=27;break;case 27:var L=255&(m=(255&HEAP8[_+(f<<2)|0])+y|0);HEAP8[l]=L,l=l+4|0,f=f+1|0,d=d-1|0,a=23;break;case 28:a=29;break;case 29:if((0|v)>0){a=30;break}a=31;break;case 30:var C=255&(m=(255&HEAP8[_+(f<<2)|0])+y|0);HEAP8[l]=C,l=l+4|0,f=f+1|0,v=v-1|0,a=29;break;case 33:p=p+1|0,_=g,a=2;break;case 34:return STACKTOP=i,c-E|0;default:assert(0,"bad label: "+a)}}function _malloc(e){var t=0;for(t=1;;)switch(t){case 1:if(e>>>0<245){t=2;break}t=78;break;case 2:if(e>>>0<11){var r=16;t=4;break}t=3;break;case 3:r=-8&(e+11|0);t=4;break;case 4:var n=r>>>3,o=HEAP32[10],a=o>>>(n>>>0);if(!(0|3&a)){t=12;break}t=5;break;case 5:var i=(1^1&a)+n|0,c=i<<1,s=80+(c<<2)|0,u=80+((c+2|0)<<2)|0,l=HEAP32[u>>2],f=l+8|0,p=HEAP32[f>>2];if((0|s)==(0|p)){t=6;break}t=7;break;case 6:var h=o&~(1<<i);HEAP32[10]=h,t=11;break;case 7:if(p>>>0<HEAP32[14]>>>0){t=10;break}t=8;break;case 8:var d=p+12|0;if((0|HEAP32[d>>2])==(0|l)){t=9;break}t=10;break;case 9:HEAP32[d>>2]=s,HEAP32[u>>2]=p,t=11;break;case 10:case 19:case 24:case 39:case 46:case 55:case 61:case 65:case 66:case 73:case 76:case 105:case 112:case 121:case 127:case 131:case 132:case 139:case 154:case 157:case 158:case 169:case 244:case 245:case 251:case 258:case 267:case 273:case 277:case 278:case 284:case 299:case 302:case 319:case 334:case 337:throw _abort(),"Reached an unreachable!";case 11:var v=i<<3,y=3|v;HEAP32[(l+4|0)>>2]=y;var m=l+(4|v)|0,b=1|HEAP32[m>>2];HEAP32[m>>2]=b;var _=f;t=341;break;case 12:if(r>>>0>HEAP32[12]>>>0){t=13;break}var g=r;t=160;break;case 13:if(!(0|a)){t=27;break}t=14;break;case 14:var E=2<<n,w=a<<n&(E|(0|-E)),P=(w&(0|-w))-1|0,S=16&P>>>12,k=P>>>(S>>>0),A=8&k>>>5,T=k>>>(A>>>0),O=4&T>>>2,L=T>>>(O>>>0),C=2&L>>>1,x=L>>>(C>>>0),I=1&x>>>1,H=(A|S|O|C|I)+(x>>>(I>>>0))|0,N=H<<1,D=80+(N<<2)|0,R=80+((N+2|0)<<2)|0,F=HEAP32[R>>2],U=F+8|0,j=HEAP32[U>>2];if((0|D)==(0|j)){t=15;break}t=16;break;case 15:var M=o&~(1<<H);HEAP32[10]=M,t=20;break;case 16:if(j>>>0<HEAP32[14]>>>0){t=19;break}t=17;break;case 17:var B=j+12|0;if((0|HEAP32[B>>2])==(0|F)){t=18;break}t=19;break;case 18:HEAP32[B>>2]=D,HEAP32[R>>2]=j,t=20;break;case 20:var G=H<<3,Y=G-r|0,V=3|r;HEAP32[(F+4|0)>>2]=V;var z=F,K=z+r|0,q=1|Y;HEAP32[(z+(4|r)|0)>>2]=q,HEAP32[(z+G|0)>>2]=Y;var W=HEAP32[12];if(!(0|W)){t=26;break}t=21;break;case 21:var X=HEAP32[15],J=W>>>3,Q=J<<1,Z=80+(Q<<2)|0,$=HEAP32[10],ee=1<<J;if(!(0|$&ee)){t=22;break}t=23;break;case 22:var te=$|ee;HEAP32[10]=te;var re=Z,ne=80+((Q+2|0)<<2)|0;t=25;break;case 23:var oe=80+((Q+2|0)<<2)|0,ae=HEAP32[oe>>2];if(ae>>>0<HEAP32[14]>>>0){t=24;break}re=ae,ne=oe;t=25;break;case 25:HEAP32[ne>>2]=X,HEAP32[(re+12|0)>>2]=X,HEAP32[(X+8|0)>>2]=re,HEAP32[(X+12|0)>>2]=Z,t=26;break;case 26:HEAP32[12]=Y,HEAP32[15]=K;_=U;t=341;break;case 27:var ie=HEAP32[11];if(!(0|ie)){g=r;t=160;break}t=28;break;case 28:var ce=(ie&(0|-ie))-1|0,se=16&ce>>>12,ue=ce>>>(se>>>0),le=8&ue>>>5,fe=ue>>>(le>>>0),pe=4&fe>>>2,he=fe>>>(pe>>>0),de=2&he>>>1,ve=he>>>(de>>>0),ye=1&ve>>>1,me=HEAP32[(344+(((le|se|pe|de|ye)+(ve>>>(ye>>>0))|0)<<2)|0)>>2],be=me,_e=me,ge=(-8&HEAP32[(me+4|0)>>2])-r|0;t=29;break;case 29:var Ee=HEAP32[(be+16|0)>>2];if(!(0|Ee)){t=30;break}var we=Ee;t=31;break;case 30:var Pe=HEAP32[(be+20|0)>>2];if(!(0|Pe)){t=32;break}we=Pe;t=31;break;case 31:var Se=(-8&HEAP32[(we+4|0)>>2])-r|0,ke=Se>>>0<ge>>>0;be=we,_e=ke?we:_e,ge=ke?Se:ge;t=29;break;case 32:var Ae=_e,Te=HEAP32[14];if(Ae>>>0<Te>>>0){t=76;break}t=33;break;case 33:var Oe=Ae+r|0,Le=Oe;if(Ae>>>0<Oe>>>0){t=34;break}t=76;break;case 34:var Ce=HEAP32[(_e+24|0)>>2],xe=HEAP32[(_e+12|0)>>2];if((0|xe)==(0|_e)){t=40;break}t=35;break;case 35:var Ie=HEAP32[(_e+8|0)>>2];if(Ie>>>0<Te>>>0){t=39;break}t=36;break;case 36:var He=Ie+12|0;if((0|HEAP32[He>>2])==(0|_e)){t=37;break}t=39;break;case 37:var Ne=xe+8|0;if((0|HEAP32[Ne>>2])==(0|_e)){t=38;break}t=39;break;case 38:HEAP32[He>>2]=xe,HEAP32[Ne>>2]=Ie;var De=xe;t=47;break;case 40:var Re=_e+20|0,Fe=HEAP32[Re>>2];if(!(0|Fe)){t=41;break}var Ue=Fe,je=Re;t=42;break;case 41:var Me=_e+16|0,Be=HEAP32[Me>>2];if(!(0|Be)){De=0;t=47;break}Ue=Be,je=Me;t=42;break;case 42:var Ge=Ue+20|0,Ye=HEAP32[Ge>>2];if(!(0|Ye)){t=43;break}Ue=Ye,je=Ge;t=42;break;case 43:var Ve=Ue+16|0,ze=HEAP32[Ve>>2];if(!(0|ze)){t=44;break}Ue=ze,je=Ve;t=42;break;case 44:if(je>>>0<Te>>>0){t=46;break}t=45;break;case 45:HEAP32[je>>2]=0;De=Ue;t=47;break;case 47:if(!(0|Ce)){t=67;break}t=48;break;case 48:var Ke=_e+28|0,qe=344+(HEAP32[Ke>>2]<<2)|0;if((0|_e)==(0|HEAP32[qe>>2])){t=49;break}t=51;break;case 49:if(HEAP32[qe>>2]=De,!(0|De)){t=50;break}t=57;break;case 50:var We=~(1<<HEAP32[Ke>>2]),Xe=HEAP32[11]&We;HEAP32[11]=Xe,t=67;break;case 51:if(Ce>>>0<HEAP32[14]>>>0){t=55;break}t=52;break;case 52:var Je=Ce+16|0;if((0|HEAP32[Je>>2])==(0|_e)){t=53;break}t=54;break;case 53:HEAP32[Je>>2]=De,t=56;break;case 54:HEAP32[(Ce+20|0)>>2]=De,t=56;break;case 56:if(!(0|De)){t=67;break}t=57;break;case 57:if(De>>>0<HEAP32[14]>>>0){t=66;break}t=58;break;case 58:HEAP32[(De+24|0)>>2]=Ce;var Qe=HEAP32[(_e+16|0)>>2];if(!(0|Qe)){t=62;break}t=59;break;case 59:if(Qe>>>0<HEAP32[14]>>>0){t=61;break}t=60;break;case 60:HEAP32[(De+16|0)>>2]=Qe,HEAP32[(Qe+24|0)>>2]=De,t=62;break;case 62:var Ze=HEAP32[(_e+20|0)>>2];if(!(0|Ze)){t=67;break}t=63;break;case 63:if(Ze>>>0<HEAP32[14]>>>0){t=65;break}t=64;break;case 64:HEAP32[(De+20|0)>>2]=Ze,HEAP32[(Ze+24|0)>>2]=De,t=67;break;case 67:if(ge>>>0<16){t=68;break}t=69;break;case 68:var $e=ge+r|0,et=3|$e;HEAP32[(_e+4|0)>>2]=et;var tt=Ae+($e+4|0)|0,rt=1|HEAP32[tt>>2];HEAP32[tt>>2]=rt,t=77;break;case 69:var nt=3|r;HEAP32[(_e+4|0)>>2]=nt;var ot=1|ge;HEAP32[(Ae+(4|r)|0)>>2]=ot,HEAP32[(Ae+(ge+r|0)|0)>>2]=ge;var at=HEAP32[12];if(!(0|at)){t=75;break}t=70;break;case 70:var it=HEAP32[15],ct=at>>>3,st=ct<<1,ut=80+(st<<2)|0,lt=HEAP32[10],ft=1<<ct;if(!(0|lt&ft)){t=71;break}t=72;break;case 71:var pt=lt|ft;HEAP32[10]=pt;var ht=ut,dt=80+((st+2|0)<<2)|0;t=74;break;case 72:var vt=80+((st+2|0)<<2)|0,yt=HEAP32[vt>>2];if(yt>>>0<HEAP32[14]>>>0){t=73;break}ht=yt,dt=vt;t=74;break;case 74:HEAP32[dt>>2]=it,HEAP32[(ht+12|0)>>2]=it,HEAP32[(it+8|0)>>2]=ht,HEAP32[(it+12|0)>>2]=ut,t=75;break;case 75:HEAP32[12]=ge,HEAP32[15]=Le,t=77;break;case 77:_=_e+8|0;t=341;break;case 78:if(e>>>0>4294967231){g=-1;t=160;break}t=79;break;case 79:var mt=e+11|0,bt=-8&mt,_t=HEAP32[11];if(!(0|_t)){g=bt;t=160;break}t=80;break;case 80:var gt=0|-bt,Et=mt>>>8;if(!(0|Et)){var wt=0;t=83;break}t=81;break;case 81:if(bt>>>0>16777215){wt=31;t=83;break}t=82;break;case 82:var Pt=8&(Et+1048320|0)>>>16,St=Et<<Pt,kt=4&(St+520192|0)>>>16,At=St<<kt,Tt=2&(At+245760|0)>>>16,Ot=(14-(kt|Pt|Tt)|0)+(At<<Tt>>>15)|0;wt=1&bt>>>((Ot+7|0)>>>0)|Ot<<1;t=83;break;case 83:var Lt=HEAP32[(344+(wt<<2)|0)>>2];if(!(0|Lt)){var Ct=0,xt=gt,It=0;t=90;break}t=84;break;case 84:if(31==(0|wt)){var Ht=0;t=86;break}t=85;break;case 85:Ht=25-(wt>>>1)|0;t=86;break;case 86:var Nt=0,Dt=gt,Rt=Lt,Ft=bt<<Ht,Ut=0;t=87;break;case 87:var jt=-8&HEAP32[(Rt+4|0)>>2],Mt=jt-bt|0;if(Mt>>>0<Dt>>>0){t=88;break}var Bt=Nt,Gt=Dt;t=89;break;case 88:if((0|jt)==(0|bt)){Ct=Rt,xt=Mt,It=Rt;t=90;break}Bt=Rt,Gt=Mt;t=89;break;case 89:var Yt=HEAP32[(Rt+20|0)>>2],Vt=HEAP32[(Rt+16+(Ft>>>31<<2)|0)>>2],zt=!(0|Yt)|(0|Yt)==(0|Vt)?Ut:Yt,Kt=Ft<<1;if(!(0|Vt)){Ct=Bt,xt=Gt,It=zt;t=90;break}Nt=Bt,Dt=Gt,Rt=Vt,Ft=Kt,Ut=zt;t=87;break;case 90:if(!(0|It)&!(0|Ct)){t=91;break}var qt=It;t=93;break;case 91:var Wt=2<<wt,Xt=_t&(Wt|(0|-Wt));if(!(0|Xt)){g=bt;t=160;break}t=92;break;case 92:var Jt=(Xt&(0|-Xt))-1|0,Qt=16&Jt>>>12,Zt=Jt>>>(Qt>>>0),$t=8&Zt>>>5,er=Zt>>>($t>>>0),tr=4&er>>>2,rr=er>>>(tr>>>0),nr=2&rr>>>1,or=rr>>>(nr>>>0),ar=1&or>>>1;qt=HEAP32[(344+((($t|Qt|tr|nr|ar)+(or>>>(ar>>>0))|0)<<2)|0)>>2];t=93;break;case 93:if(!(0|qt)){var ir=xt,cr=Ct;t=96;break}var sr=qt,ur=xt,lr=Ct;t=94;break;case 94:var fr=(-8&HEAP32[(sr+4|0)>>2])-bt|0,pr=fr>>>0<ur>>>0,hr=pr?fr:ur,dr=pr?sr:lr,vr=HEAP32[(sr+16|0)>>2];if(!(0|vr)){t=95;break}sr=vr,ur=hr,lr=dr;t=94;break;case 95:var yr=HEAP32[(sr+20|0)>>2];if(!(0|yr)){ir=hr,cr=dr;t=96;break}sr=yr,ur=hr,lr=dr;t=94;break;case 96:if(!(0|cr)){g=bt;t=160;break}t=97;break;case 97:if(ir>>>0<(HEAP32[12]-bt|0)>>>0){t=98;break}g=bt;t=160;break;case 98:var mr=cr,br=HEAP32[14];if(mr>>>0<br>>>0){t=158;break}t=99;break;case 99:var _r=mr+bt|0,gr=_r;if(mr>>>0<_r>>>0){t=100;break}t=158;break;case 100:var Er=HEAP32[(cr+24|0)>>2],wr=HEAP32[(cr+12|0)>>2];if((0|wr)==(0|cr)){t=106;break}t=101;break;case 101:var Pr=HEAP32[(cr+8|0)>>2];if(Pr>>>0<br>>>0){t=105;break}t=102;break;case 102:var Sr=Pr+12|0;if((0|HEAP32[Sr>>2])==(0|cr)){t=103;break}t=105;break;case 103:var kr=wr+8|0;if((0|HEAP32[kr>>2])==(0|cr)){t=104;break}t=105;break;case 104:HEAP32[Sr>>2]=wr,HEAP32[kr>>2]=Pr;var Ar=wr;t=113;break;case 106:var Tr=cr+20|0,Or=HEAP32[Tr>>2];if(!(0|Or)){t=107;break}var Lr=Or,Cr=Tr;t=108;break;case 107:var xr=cr+16|0,Ir=HEAP32[xr>>2];if(!(0|Ir)){Ar=0;t=113;break}Lr=Ir,Cr=xr;t=108;break;case 108:var Hr=Lr+20|0,Nr=HEAP32[Hr>>2];if(!(0|Nr)){t=109;break}Lr=Nr,Cr=Hr;t=108;break;case 109:var Dr=Lr+16|0,Rr=HEAP32[Dr>>2];if(!(0|Rr)){t=110;break}Lr=Rr,Cr=Dr;t=108;break;case 110:if(Cr>>>0<br>>>0){t=112;break}t=111;break;case 111:HEAP32[Cr>>2]=0;Ar=Lr;t=113;break;case 113:if(!(0|Er)){t=133;break}t=114;break;case 114:var Fr=cr+28|0,Ur=344+(HEAP32[Fr>>2]<<2)|0;if((0|cr)==(0|HEAP32[Ur>>2])){t=115;break}t=117;break;case 115:if(HEAP32[Ur>>2]=Ar,!(0|Ar)){t=116;break}t=123;break;case 116:var jr=~(1<<HEAP32[Fr>>2]),Mr=HEAP32[11]&jr;HEAP32[11]=Mr,t=133;break;case 117:if(Er>>>0<HEAP32[14]>>>0){t=121;break}t=118;break;case 118:var Br=Er+16|0;if((0|HEAP32[Br>>2])==(0|cr)){t=119;break}t=120;break;case 119:HEAP32[Br>>2]=Ar,t=122;break;case 120:HEAP32[(Er+20|0)>>2]=Ar,t=122;break;case 122:if(!(0|Ar)){t=133;break}t=123;break;case 123:if(Ar>>>0<HEAP32[14]>>>0){t=132;break}t=124;break;case 124:HEAP32[(Ar+24|0)>>2]=Er;var Gr=HEAP32[(cr+16|0)>>2];if(!(0|Gr)){t=128;break}t=125;break;case 125:if(Gr>>>0<HEAP32[14]>>>0){t=127;break}t=126;break;case 126:HEAP32[(Ar+16|0)>>2]=Gr,HEAP32[(Gr+24|0)>>2]=Ar,t=128;break;case 128:var Yr=HEAP32[(cr+20|0)>>2];if(!(0|Yr)){t=133;break}t=129;break;case 129:if(Yr>>>0<HEAP32[14]>>>0){t=131;break}t=130;break;case 130:HEAP32[(Ar+20|0)>>2]=Yr,HEAP32[(Yr+24|0)>>2]=Ar,t=133;break;case 133:if(ir>>>0<16){t=134;break}t=135;break;case 134:var Vr=ir+bt|0,zr=3|Vr;HEAP32[(cr+4|0)>>2]=zr;var Kr=mr+(Vr+4|0)|0,qr=1|HEAP32[Kr>>2];HEAP32[Kr>>2]=qr,t=159;break;case 135:var Wr=3|bt;HEAP32[(cr+4|0)>>2]=Wr;var Xr=1|ir;HEAP32[(mr+(4|bt)|0)>>2]=Xr,HEAP32[(mr+(ir+bt|0)|0)>>2]=ir;var Jr=ir>>>3;if(ir>>>0<256){t=136;break}t=141;break;case 136:var Qr=Jr<<1,Zr=80+(Qr<<2)|0,$r=HEAP32[10],en=1<<Jr;if(!(0|$r&en)){t=137;break}t=138;break;case 137:var tn=$r|en;HEAP32[10]=tn;var rn=Zr,nn=80+((Qr+2|0)<<2)|0;t=140;break;case 138:var on=80+((Qr+2|0)<<2)|0,an=HEAP32[on>>2];if(an>>>0<HEAP32[14]>>>0){t=139;break}rn=an,nn=on;t=140;break;case 140:HEAP32[nn>>2]=gr,HEAP32[(rn+12|0)>>2]=gr,HEAP32[(mr+(bt+8|0)|0)>>2]=rn,HEAP32[(mr+(bt+12|0)|0)>>2]=Zr,t=159;break;case 141:var cn=_r,sn=ir>>>8;if(!(0|sn)){var un=0;t=144;break}t=142;break;case 142:if(ir>>>0>16777215){un=31;t=144;break}t=143;break;case 143:var ln=8&(sn+1048320|0)>>>16,fn=sn<<ln,pn=4&(fn+520192|0)>>>16,hn=fn<<pn,dn=2&(hn+245760|0)>>>16,vn=(14-(pn|ln|dn)|0)+(hn<<dn>>>15)|0;un=1&ir>>>((vn+7|0)>>>0)|vn<<1;t=144;break;case 144:var yn=344+(un<<2)|0;HEAP32[(mr+(bt+28|0)|0)>>2]=un;var mn=mr+(bt+16|0)|0;HEAP32[(mr+(bt+20|0)|0)>>2]=0,HEAP32[mn>>2]=0;var bn=HEAP32[11],_n=1<<un;if(!(0|bn&_n)){t=145;break}t=146;break;case 145:var gn=bn|_n;HEAP32[11]=gn,HEAP32[yn>>2]=cn;var En=yn;HEAP32[(mr+(bt+24|0)|0)>>2]=En,HEAP32[(mr+(bt+12|0)|0)>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=cn,t=159;break;case 146:var wn=HEAP32[yn>>2];if(31==(0|un)){var Pn=0;t=148;break}t=147;break;case 147:Pn=25-(un>>>1)|0;t=148;break;case 148:if((0|-8&HEAP32[(wn+4|0)>>2])==(0|ir)){var Sn=wn;t=155;break}t=149;break;case 149:var kn=wn,An=ir<<Pn;t=151;break;case 150:var Tn=An<<1;if((0|-8&HEAP32[(Ln+4|0)>>2])==(0|ir)){Sn=Ln;t=155;break}kn=Ln,An=Tn;t=151;break;case 151:var On=kn+16+(An>>>31<<2)|0,Ln=HEAP32[On>>2];if(!(0|Ln)){t=152;break}t=150;break;case 152:if(On>>>0<HEAP32[14]>>>0){t=154;break}t=153;break;case 153:HEAP32[On>>2]=cn,HEAP32[(mr+(bt+24|0)|0)>>2]=kn,HEAP32[(mr+(bt+12|0)|0)>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=cn,t=159;break;case 155:var Cn=Sn+8|0,xn=HEAP32[Cn>>2],In=Sn,Hn=HEAP32[14];if(In>>>0>=Hn>>>0&xn>>>0>=Hn>>>0){t=156;break}t=157;break;case 156:HEAP32[(xn+12|0)>>2]=cn,HEAP32[Cn>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=xn,HEAP32[(mr+(bt+12|0)|0)>>2]=Sn,HEAP32[(mr+(bt+24|0)|0)>>2]=0,t=159;break;case 159:_=cr+8|0;t=341;break;case 160:var Nn=HEAP32[12];if(Nn>>>0<g>>>0){t=165;break}t=161;break;case 161:var Dn=Nn-g|0,Rn=HEAP32[15];if(Dn>>>0>15){t=162;break}t=163;break;case 162:var Fn=Rn,Un=Fn+g|0;HEAP32[15]=Un,HEAP32[12]=Dn;var jn=1|Dn;HEAP32[(Fn+(g+4|0)|0)>>2]=jn,HEAP32[(Fn+Nn|0)>>2]=Dn;var Mn=3|g;HEAP32[(Rn+4|0)>>2]=Mn,t=164;break;case 163:HEAP32[12]=0,HEAP32[15]=0;var Bn=3|Nn;HEAP32[(Rn+4|0)>>2]=Bn;var Gn=Rn+(Nn+4|0)|0,Yn=1|HEAP32[Gn>>2];HEAP32[Gn>>2]=Yn,t=164;break;case 164:_=Rn+8|0;t=341;break;case 165:var Vn=HEAP32[13];if(Vn>>>0>g>>>0){t=166;break}t=167;break;case 166:var zn=Vn-g|0;HEAP32[13]=zn;var Kn=HEAP32[16],qn=Kn,Wn=qn+g|0;HEAP32[16]=Wn;var Xn=1|zn;HEAP32[(qn+(g+4|0)|0)>>2]=Xn;var Jn=3|g;HEAP32[(Kn+4|0)>>2]=Jn;_=Kn+8|0;t=341;break;case 167:if(!(0|HEAP32[4])){t=168;break}t=171;break;case 168:var Qn=_sysconf(30);if(!(0|(Qn-1|0)&Qn)){t=170;break}t=169;break;case 170:HEAP32[6]=Qn,HEAP32[5]=Qn,HEAP32[7]=-1,HEAP32[8]=-1,HEAP32[9]=0,HEAP32[121]=0;var Zn=1431655768^-16&_time(0);HEAP32[4]=Zn,t=171;break;case 171:var $n=g+48|0,eo=HEAP32[6],to=g+47|0,ro=eo+to|0,no=0|-eo,oo=ro&no;if(oo>>>0>g>>>0){t=172;break}_=0;t=341;break;case 172:var ao=HEAP32[120];if(!(0|ao)){t=174;break}t=173;break;case 173:var io=HEAP32[118],co=io+oo|0;if(co>>>0<=io>>>0|co>>>0>ao>>>0){_=0;t=341;break}t=174;break;case 174:if(!(0|4&HEAP32[121])){t=175;break}var so=0;t=198;break;case 175:var uo=HEAP32[16];if(!(0|uo)){t=181;break}t=176;break;case 176:var lo=uo,fo=488;t=177;break;case 177:var po=0|fo,ho=HEAP32[po>>2];if(ho>>>0>lo>>>0){t=179;break}t=178;break;case 178:var vo=fo+4|0;if((ho+HEAP32[vo>>2]|0)>>>0>lo>>>0){t=180;break}t=179;break;case 179:var yo=HEAP32[(fo+8|0)>>2];if(!(0|yo)){t=181;break}fo=yo;t=177;break;case 180:if(!(0|fo)){t=181;break}t=188;break;case 181:var mo=_sbrk(0);if(-1==(0|mo)){var bo=0;t=197;break}t=182;break;case 182:var _o=mo,go=HEAP32[5],Eo=go-1|0;if(!(0|Eo&_o)){var wo=oo;t=184;break}t=183;break;case 183:wo=(oo-_o|0)+((Eo+_o|0)&(0|-go))|0;t=184;break;case 184:var Po=HEAP32[118],So=Po+wo|0;if(wo>>>0>g>>>0&wo>>>0<2147483647){t=185;break}bo=0;t=197;break;case 185:var ko=HEAP32[120];if(!(0|ko)){t=187;break}t=186;break;case 186:if(So>>>0<=Po>>>0|So>>>0>ko>>>0){bo=0;t=197;break}t=187;break;case 187:var Ao=_sbrk(wo);if((0|Ao)==(0|mo)){var To=mo,Oo=wo;t=190;break}var Lo=wo,Co=Ao;t=191;break;case 188:var xo=(ro-HEAP32[13]|0)&no;if(xo>>>0<2147483647){t=189;break}bo=0;t=197;break;case 189:var Io=_sbrk(xo);if((0|Io)==(0|(HEAP32[po>>2]+HEAP32[vo>>2]|0))){To=Io,Oo=xo;t=190;break}Lo=xo,Co=Io;t=191;break;case 190:if(-1==(0|To)){bo=Oo;t=197;break}var Ho=Oo,No=To;t=201;break;case 191:var Do=0|-Lo;if(-1!=(0|Co)&Lo>>>0<2147483647&$n>>>0>Lo>>>0){t=192;break}var Ro=Lo;t=196;break;case 192:var Fo=HEAP32[6],Uo=((to-Lo|0)+Fo|0)&(0|-Fo);if(Uo>>>0<2147483647){t=193;break}Ro=Lo;t=196;break;case 193:if(-1==(0|_sbrk(Uo))){t=195;break}t=194;break;case 194:Ro=Uo+Lo|0;t=196;break;case 195:_sbrk(Do),bo=0;t=197;break;case 196:if(-1==(0|Co)){bo=0;t=197;break}Ho=Ro,No=Co;t=201;break;case 197:var jo=4|HEAP32[121];HEAP32[121]=jo;so=bo;t=198;break;case 198:if(oo>>>0<2147483647){t=199;break}t=340;break;case 199:var Mo=_sbrk(oo),Bo=_sbrk(0);if(-1!=(0|Mo)&-1!=(0|Bo)&Mo>>>0<Bo>>>0){t=200;break}t=340;break;case 200:var Go=Bo-Mo|0,Yo=Go>>>0>(g+40|0)>>>0;if(Yo){Ho=Yo?Go:so,No=Mo;t=201;break}t=340;break;case 201:var Vo=HEAP32[118]+Ho|0;if(HEAP32[118]=Vo,Vo>>>0>HEAP32[119]>>>0){t=202;break}t=203;break;case 202:HEAP32[119]=Vo,t=203;break;case 203:var zo=HEAP32[16];if(!(0|zo)){t=204;break}var Ko=488;t=211;break;case 204:var qo=HEAP32[14];if(!(0|qo)|No>>>0<qo>>>0){t=205;break}t=206;break;case 205:HEAP32[14]=No,t=206;break;case 206:HEAP32[122]=No,HEAP32[123]=Ho,HEAP32[125]=0;var Wo=HEAP32[4];HEAP32[19]=Wo,HEAP32[18]=-1;var Xo=0;t=207;break;case 207:var Jo=Xo<<1,Qo=80+(Jo<<2)|0;HEAP32[(80+((Jo+3|0)<<2)|0)>>2]=Qo,HEAP32[(80+((Jo+2|0)<<2)|0)>>2]=Qo;var Zo=Xo+1|0;if(Zo>>>0<32){Xo=Zo;t=207;break}t=208;break;case 208:var $o=Ho-40|0,ea=No+8|0;if(!(0|7&ea)){var ta=0;t=210;break}t=209;break;case 209:ta=7&(0|-ea);t=210;break;case 210:var ra=No+ta|0,na=$o-ta|0;HEAP32[16]=ra,HEAP32[13]=na;var oa=1|na;HEAP32[(No+(ta+4|0)|0)>>2]=oa,HEAP32[(No+(Ho-36|0)|0)>>2]=40;var aa=HEAP32[8];HEAP32[17]=aa,t=338;break;case 211:var ia=HEAP32[(0|Ko)>>2],ca=Ko+4|0,sa=HEAP32[ca>>2];if((0|No)==(0|(ia+sa|0))){t=213;break}t=212;break;case 212:var ua=HEAP32[(Ko+8|0)>>2];if(!(0|ua)){t=218;break}Ko=ua;t=211;break;case 213:if(!(0|8&HEAP32[(Ko+12|0)>>2])){t=214;break}t=218;break;case 214:if(zo>>>0>=ia>>>0&zo>>>0<No>>>0){t=215;break}t=218;break;case 215:var la=sa+Ho|0;HEAP32[ca>>2]=la;var fa=HEAP32[16],pa=HEAP32[13]+Ho|0,ha=fa,da=fa+8|0;if(!(0|7&da)){var va=0;t=217;break}t=216;break;case 216:va=7&(0|-da);t=217;break;case 217:var ya=ha+va|0,ma=pa-va|0;HEAP32[16]=ya,HEAP32[13]=ma;var ba=1|ma;HEAP32[(ha+(va+4|0)|0)>>2]=ba,HEAP32[(ha+(pa+4|0)|0)>>2]=40;var _a=HEAP32[8];HEAP32[17]=_a,t=338;break;case 218:if(No>>>0<HEAP32[14]>>>0){t=219;break}t=220;break;case 219:HEAP32[14]=No,t=220;break;case 220:var ga=No+Ho|0,Ea=488;t=221;break;case 221:var wa=0|Ea;if((0|HEAP32[wa>>2])==(0|ga)){t=223;break}t=222;break;case 222:var Pa=HEAP32[(Ea+8|0)>>2];if(!(0|Pa)){t=304;break}Ea=Pa;t=221;break;case 223:if(!(0|8&HEAP32[(Ea+12|0)>>2])){t=224;break}t=304;break;case 224:HEAP32[wa>>2]=No;var Sa=Ea+4|0,ka=HEAP32[Sa>>2]+Ho|0;HEAP32[Sa>>2]=ka;var Aa=No+8|0;if(!(0|7&Aa)){var Ta=0;t=226;break}t=225;break;case 225:Ta=7&(0|-Aa);t=226;break;case 226:var Oa=No+Ta|0,La=No+(Ho+8|0)|0;if(!(0|7&La)){var Ca=0;t=228;break}t=227;break;case 227:Ca=7&(0|-La);t=228;break;case 228:var xa=No+(Ca+Ho|0)|0,Ia=xa,Ha=Ta+g|0,Na=No+Ha|0,Da=Na,Ra=(xa-Oa|0)-g|0,Fa=3|g;if(HEAP32[(No+(Ta+4|0)|0)>>2]=Fa,(0|Ia)==(0|HEAP32[16])){t=229;break}t=230;break;case 229:var Ua=HEAP32[13]+Ra|0;HEAP32[13]=Ua,HEAP32[16]=Da;var ja=1|Ua;HEAP32[(No+(Ha+4|0)|0)>>2]=ja,t=303;break;case 230:if((0|Ia)==(0|HEAP32[15])){t=231;break}t=232;break;case 231:var Ma=HEAP32[12]+Ra|0;HEAP32[12]=Ma,HEAP32[15]=Da;var Ba=1|Ma;HEAP32[(No+(Ha+4|0)|0)>>2]=Ba,HEAP32[(No+(Ma+Ha|0)|0)>>2]=Ma,t=303;break;case 232:var Ga=Ho+4|0,Ya=HEAP32[(No+(Ga+Ca|0)|0)>>2];if(1==(0|3&Ya)){t=233;break}var Va=Ia,za=Ra;t=280;break;case 233:var Ka=-8&Ya,qa=Ya>>>3;if(Ya>>>0<256){t=234;break}t=246;break;case 234:var Wa=HEAP32[(No+((8|Ca)+Ho|0)|0)>>2],Xa=HEAP32[(No+((Ho+12|0)+Ca|0)|0)>>2],Ja=80+(qa<<1<<2)|0;if((0|Wa)==(0|Ja)){t=237;break}t=235;break;case 235:if(Wa>>>0<HEAP32[14]>>>0){t=245;break}t=236;break;case 236:if((0|HEAP32[(Wa+12|0)>>2])==(0|Ia)){t=237;break}t=245;break;case 237:if((0|Xa)==(0|Wa)){t=238;break}t=239;break;case 238:var Qa=~(1<<qa),Za=HEAP32[10]&Qa;HEAP32[10]=Za,t=279;break;case 239:if((0|Xa)==(0|Ja)){t=240;break}t=241;break;case 240:var $a=Xa+8|0;t=243;break;case 241:if(Xa>>>0<HEAP32[14]>>>0){t=244;break}t=242;break;case 242:var ei=Xa+8|0;if((0|HEAP32[ei>>2])==(0|Ia)){$a=ei;t=243;break}t=244;break;case 243:HEAP32[(Wa+12|0)>>2]=Xa,HEAP32[$a>>2]=Wa,t=279;break;case 246:var ti=xa,ri=HEAP32[(No+((24|Ca)+Ho|0)|0)>>2],ni=HEAP32[(No+((Ho+12|0)+Ca|0)|0)>>2];if((0|ni)==(0|ti)){t=252;break}t=247;break;case 247:var oi=HEAP32[(No+((8|Ca)+Ho|0)|0)>>2];if(oi>>>0<HEAP32[14]>>>0){t=251;break}t=248;break;case 248:var ai=oi+12|0;if((0|HEAP32[ai>>2])==(0|ti)){t=249;break}t=251;break;case 249:var ii=ni+8|0;if((0|HEAP32[ii>>2])==(0|ti)){t=250;break}t=251;break;case 250:HEAP32[ai>>2]=ni,HEAP32[ii>>2]=oi;var ci=ni;t=259;break;case 252:var si=16|Ca,ui=No+(Ga+si|0)|0,li=HEAP32[ui>>2];if(!(0|li)){t=253;break}var fi=li,pi=ui;t=254;break;case 253:var hi=No+(si+Ho|0)|0,di=HEAP32[hi>>2];if(!(0|di)){ci=0;t=259;break}fi=di,pi=hi;t=254;break;case 254:var vi=fi+20|0,yi=HEAP32[vi>>2];if(!(0|yi)){t=255;break}fi=yi,pi=vi;t=254;break;case 255:var mi=fi+16|0,bi=HEAP32[mi>>2];if(!(0|bi)){t=256;break}fi=bi,pi=mi;t=254;break;case 256:if(pi>>>0<HEAP32[14]>>>0){t=258;break}t=257;break;case 257:HEAP32[pi>>2]=0;ci=fi;t=259;break;case 259:if(!(0|ri)){t=279;break}t=260;break;case 260:var _i=No+((Ho+28|0)+Ca|0)|0,gi=344+(HEAP32[_i>>2]<<2)|0;if((0|ti)==(0|HEAP32[gi>>2])){t=261;break}t=263;break;case 261:if(HEAP32[gi>>2]=ci,!(0|ci)){t=262;break}t=269;break;case 262:var Ei=~(1<<HEAP32[_i>>2]),wi=HEAP32[11]&Ei;HEAP32[11]=wi,t=279;break;case 263:if(ri>>>0<HEAP32[14]>>>0){t=267;break}t=264;break;case 264:var Pi=ri+16|0;if((0|HEAP32[Pi>>2])==(0|ti)){t=265;break}t=266;break;case 265:HEAP32[Pi>>2]=ci,t=268;break;case 266:HEAP32[(ri+20|0)>>2]=ci,t=268;break;case 268:if(!(0|ci)){t=279;break}t=269;break;case 269:if(ci>>>0<HEAP32[14]>>>0){t=278;break}t=270;break;case 270:HEAP32[(ci+24|0)>>2]=ri;var Si=16|Ca,ki=HEAP32[(No+(Si+Ho|0)|0)>>2];if(!(0|ki)){t=274;break}t=271;break;case 271:if(ki>>>0<HEAP32[14]>>>0){t=273;break}t=272;break;case 272:HEAP32[(ci+16|0)>>2]=ki,HEAP32[(ki+24|0)>>2]=ci,t=274;break;case 274:var Ai=HEAP32[(No+(Ga+Si|0)|0)>>2];if(!(0|Ai)){t=279;break}t=275;break;case 275:if(Ai>>>0<HEAP32[14]>>>0){t=277;break}t=276;break;case 276:HEAP32[(ci+20|0)>>2]=Ai,HEAP32[(Ai+24|0)>>2]=ci,t=279;break;case 279:Va=No+((Ka|Ca)+Ho|0)|0,za=Ka+Ra|0;t=280;break;case 280:var Ti=Va+4|0,Oi=-2&HEAP32[Ti>>2];HEAP32[Ti>>2]=Oi;var Li=1|za;HEAP32[(No+(Ha+4|0)|0)>>2]=Li,HEAP32[(No+(za+Ha|0)|0)>>2]=za;var Ci=za>>>3;if(za>>>0<256){t=281;break}t=286;break;case 281:var xi=Ci<<1,Ii=80+(xi<<2)|0,Hi=HEAP32[10],Ni=1<<Ci;if(!(0|Hi&Ni)){t=282;break}t=283;break;case 282:var Di=Hi|Ni;HEAP32[10]=Di;var Ri=Ii,Fi=80+((xi+2|0)<<2)|0;t=285;break;case 283:var Ui=80+((xi+2|0)<<2)|0,ji=HEAP32[Ui>>2];if(ji>>>0<HEAP32[14]>>>0){t=284;break}Ri=ji,Fi=Ui;t=285;break;case 285:HEAP32[Fi>>2]=Da,HEAP32[(Ri+12|0)>>2]=Da,HEAP32[(No+(Ha+8|0)|0)>>2]=Ri,HEAP32[(No+(Ha+12|0)|0)>>2]=Ii,t=303;break;case 286:var Mi=Na,Bi=za>>>8;if(!(0|Bi)){var Gi=0;t=289;break}t=287;break;case 287:if(za>>>0>16777215){Gi=31;t=289;break}t=288;break;case 288:var Yi=8&(Bi+1048320|0)>>>16,Vi=Bi<<Yi,zi=4&(Vi+520192|0)>>>16,Ki=Vi<<zi,qi=2&(Ki+245760|0)>>>16,Wi=(14-(zi|Yi|qi)|0)+(Ki<<qi>>>15)|0;Gi=1&za>>>((Wi+7|0)>>>0)|Wi<<1;t=289;break;case 289:var Xi=344+(Gi<<2)|0;HEAP32[(No+(Ha+28|0)|0)>>2]=Gi;var Ji=No+(Ha+16|0)|0;HEAP32[(No+(Ha+20|0)|0)>>2]=0,HEAP32[Ji>>2]=0;var Qi=HEAP32[11],Zi=1<<Gi;if(!(0|Qi&Zi)){t=290;break}t=291;break;case 290:var $i=Qi|Zi;HEAP32[11]=$i,HEAP32[Xi>>2]=Mi;var ec=Xi;HEAP32[(No+(Ha+24|0)|0)>>2]=ec,HEAP32[(No+(Ha+12|0)|0)>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=Mi,t=303;break;case 291:var tc=HEAP32[Xi>>2];if(31==(0|Gi)){var rc=0;t=293;break}t=292;break;case 292:rc=25-(Gi>>>1)|0;t=293;break;case 293:if((0|-8&HEAP32[(tc+4|0)>>2])==(0|za)){var nc=tc;t=300;break}t=294;break;case 294:var oc=tc,ac=za<<rc;t=296;break;case 295:var ic=ac<<1;if((0|-8&HEAP32[(sc+4|0)>>2])==(0|za)){nc=sc;t=300;break}oc=sc,ac=ic;t=296;break;case 296:var cc=oc+16+(ac>>>31<<2)|0,sc=HEAP32[cc>>2];if(!(0|sc)){t=297;break}t=295;break;case 297:if(cc>>>0<HEAP32[14]>>>0){t=299;break}t=298;break;case 298:HEAP32[cc>>2]=Mi,HEAP32[(No+(Ha+24|0)|0)>>2]=oc,HEAP32[(No+(Ha+12|0)|0)>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=Mi,t=303;break;case 300:var uc=nc+8|0,lc=HEAP32[uc>>2],fc=nc,pc=HEAP32[14];if(fc>>>0>=pc>>>0&lc>>>0>=pc>>>0){t=301;break}t=302;break;case 301:HEAP32[(lc+12|0)>>2]=Mi,HEAP32[uc>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=lc,HEAP32[(No+(Ha+12|0)|0)>>2]=nc,HEAP32[(No+(Ha+24|0)|0)>>2]=0,t=303;break;case 303:_=No+(8|Ta)|0;t=341;break;case 304:var hc=zo,dc=488;t=305;break;case 305:var vc=HEAP32[(0|dc)>>2];if(vc>>>0>hc>>>0){t=307;break}t=306;break;case 306:var yc=HEAP32[(dc+4|0)>>2],mc=vc+yc|0;if(mc>>>0>hc>>>0){t=308;break}t=307;break;case 307:dc=HEAP32[(dc+8|0)>>2];t=305;break;case 308:var bc=yc-47|0,_c=vc+(yc-39|0)|0;if(!(0|7&_c)){var gc=0;t=310;break}t=309;break;case 309:gc=7&(0|-_c);t=310;break;case 310:var Ec=vc+(bc+gc|0)|0,wc=Ec>>>0<(zo+16|0)>>>0?hc:Ec,Pc=wc+8|0,Sc=Pc,kc=Ho-40|0,Ac=No+8|0;if(!(0|7&Ac)){var Tc=0;t=312;break}t=311;break;case 311:Tc=7&(0|-Ac);t=312;break;case 312:var Oc=No+Tc|0,Lc=kc-Tc|0;HEAP32[16]=Oc,HEAP32[13]=Lc;var Cc=1|Lc;HEAP32[(No+(Tc+4|0)|0)>>2]=Cc,HEAP32[(No+(Ho-36|0)|0)>>2]=40;var xc=HEAP32[8];HEAP32[17]=xc,HEAP32[(wc+4|0)>>2]=27,assert(!0),HEAP32[Pc>>2]=HEAP32[122],HEAP32[Pc+4>>2]=HEAP32[123],HEAP32[Pc+8>>2]=HEAP32[124],HEAP32[Pc+12>>2]=HEAP32[125],HEAP32[122]=No,HEAP32[123]=Ho,HEAP32[125]=0,HEAP32[124]=Sc;var Ic=wc+28|0;if(HEAP32[Ic>>2]=7,(wc+32|0)>>>0<mc>>>0){var Hc=Ic;t=313;break}t=314;break;case 313:var Nc=Hc+4|0;if(HEAP32[Nc>>2]=7,(Hc+8|0)>>>0<mc>>>0){Hc=Nc;t=313;break}t=314;break;case 314:if((0|wc)==(0|hc)){t=338;break}t=315;break;case 315:var Dc=wc-zo|0,Rc=hc+Dc|0,Fc=hc+(Dc+4|0)|0,Uc=-2&HEAP32[Fc>>2];HEAP32[Fc>>2]=Uc;var jc=1|Dc;HEAP32[(zo+4|0)>>2]=jc,HEAP32[Rc>>2]=Dc;var Mc=Dc>>>3;if(Dc>>>0<256){t=316;break}t=321;break;case 316:var Bc=Mc<<1,Gc=80+(Bc<<2)|0,Yc=HEAP32[10],Vc=1<<Mc;if(!(0|Yc&Vc)){t=317;break}t=318;break;case 317:var zc=Yc|Vc;HEAP32[10]=zc;var Kc=Gc,qc=80+((Bc+2|0)<<2)|0;t=320;break;case 318:var Wc=80+((Bc+2|0)<<2)|0,Xc=HEAP32[Wc>>2];if(Xc>>>0<HEAP32[14]>>>0){t=319;break}Kc=Xc,qc=Wc;t=320;break;case 320:HEAP32[qc>>2]=zo,HEAP32[(Kc+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=Kc,HEAP32[(zo+12|0)>>2]=Gc,t=338;break;case 321:var Jc=zo,Qc=Dc>>>8;if(!(0|Qc)){var Zc=0;t=324;break}t=322;break;case 322:if(Dc>>>0>16777215){Zc=31;t=324;break}t=323;break;case 323:var $c=8&(Qc+1048320|0)>>>16,es=Qc<<$c,ts=4&(es+520192|0)>>>16,rs=es<<ts,ns=2&(rs+245760|0)>>>16,os=(14-(ts|$c|ns)|0)+(rs<<ns>>>15)|0;Zc=1&Dc>>>((os+7|0)>>>0)|os<<1;t=324;break;case 324:var as=344+(Zc<<2)|0,is=Zc;HEAP32[(zo+28|0)>>2]=is,HEAP32[(zo+20|0)>>2]=0,HEAP32[(zo+16|0)>>2]=0;var cs=HEAP32[11],ss=1<<Zc;if(!(0|cs&ss)){t=325;break}t=326;break;case 325:var us=cs|ss;HEAP32[11]=us,HEAP32[as>>2]=Jc;var ls=as;HEAP32[(zo+24|0)>>2]=ls,HEAP32[(zo+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=zo,t=338;break;case 326:var fs=HEAP32[as>>2];if(31==(0|Zc)){var ps=0;t=328;break}t=327;break;case 327:ps=25-(Zc>>>1)|0;t=328;break;case 328:if((0|-8&HEAP32[(fs+4|0)>>2])==(0|Dc)){var hs=fs;t=335;break}t=329;break;case 329:var ds=fs,vs=Dc<<ps;t=331;break;case 330:var ys=vs<<1;if((0|-8&HEAP32[(bs+4|0)>>2])==(0|Dc)){hs=bs;t=335;break}ds=bs,vs=ys;t=331;break;case 331:var ms=ds+16+(vs>>>31<<2)|0,bs=HEAP32[ms>>2];if(!(0|bs)){t=332;break}t=330;break;case 332:if(ms>>>0<HEAP32[14]>>>0){t=334;break}t=333;break;case 333:HEAP32[ms>>2]=Jc;var _s=ds;HEAP32[(zo+24|0)>>2]=_s,HEAP32[(zo+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=zo,t=338;break;case 335:var gs=hs+8|0,Es=HEAP32[gs>>2],ws=hs,Ps=HEAP32[14];if(ws>>>0>=Ps>>>0&Es>>>0>=Ps>>>0){t=336;break}t=337;break;case 336:HEAP32[(Es+12|0)>>2]=Jc,HEAP32[gs>>2]=Jc;var Ss=Es;HEAP32[(zo+8|0)>>2]=Ss;var ks=hs;HEAP32[(zo+12|0)>>2]=ks,HEAP32[(zo+24|0)>>2]=0,t=338;break;case 338:var As=HEAP32[13];if(As>>>0>g>>>0){t=339;break}t=340;break;case 339:var Ts=As-g|0;HEAP32[13]=Ts;var Os=HEAP32[16],Ls=Os,Cs=Ls+g|0;HEAP32[16]=Cs;var xs=1|Ts;HEAP32[(Ls+(g+4|0)|0)>>2]=xs;var Is=3|g;HEAP32[(Os+4|0)>>2]=Is;_=Os+8|0;t=341;break;case 340:var Hs=___errno_location();HEAP32[Hs>>2]=12;_=0;t=341;break;case 341:return _;default:assert(0,"bad label: "+t)}}function _free(e){var t=0;for(t=1;;)switch(t){case 1:if(!(0|e)){t=140;break}t=2;break;case 2:var r=e-8|0,n=r,o=HEAP32[14];if(r>>>0<o>>>0){t=139;break}t=3;break;case 3:var a=HEAP32[(e-4|0)>>2],i=3&a;if(1==(0|i)){t=139;break}t=4;break;case 4:var c=-8&a,s=e+(c-8|0)|0,u=s;if(!(0|1&a)){t=5;break}var l=n,f=c;t=56;break;case 5:var p=HEAP32[r>>2];if(!(0|i)){t=140;break}t=6;break;case 6:var h=-8-p|0,d=e+h|0,v=d,y=p+c|0;if(d>>>0<o>>>0){t=139;break}t=7;break;case 7:if((0|v)==(0|HEAP32[15])){t=54;break}t=8;break;case 8:var m=p>>>3;if(p>>>0<256){t=9;break}t=21;break;case 9:var b=HEAP32[(e+(h+8|0)|0)>>2],_=HEAP32[(e+(h+12|0)|0)>>2],g=80+(m<<1<<2)|0;if((0|b)==(0|g)){t=12;break}t=10;break;case 10:if(b>>>0<o>>>0){t=20;break}t=11;break;case 11:if((0|HEAP32[(b+12|0)>>2])==(0|v)){t=12;break}t=20;break;case 12:if((0|_)==(0|b)){t=13;break}t=14;break;case 13:var E=~(1<<m),w=HEAP32[10]&E;HEAP32[10]=w;l=v,f=y;t=56;break;case 14:if((0|_)==(0|g)){t=15;break}t=16;break;case 15:var P=_+8|0;t=18;break;case 16:if(_>>>0<o>>>0){t=19;break}t=17;break;case 17:var S=_+8|0;if((0|HEAP32[S>>2])==(0|v)){P=S;t=18;break}t=19;break;case 18:HEAP32[(b+12|0)>>2]=_,HEAP32[P>>2]=b;l=v,f=y;t=56;break;case 19:case 20:case 26:case 33:case 42:case 48:case 52:case 53:case 75:case 76:case 82:case 89:case 98:case 104:case 108:case 109:case 117:case 132:case 135:case 139:throw _abort(),"Reached an unreachable!";case 21:var k=d,A=HEAP32[(e+(h+24|0)|0)>>2],T=HEAP32[(e+(h+12|0)|0)>>2];if((0|T)==(0|k)){t=27;break}t=22;break;case 22:var O=HEAP32[(e+(h+8|0)|0)>>2];if(O>>>0<o>>>0){t=26;break}t=23;break;case 23:var L=O+12|0;if((0|HEAP32[L>>2])==(0|k)){t=24;break}t=26;break;case 24:var C=T+8|0;if((0|HEAP32[C>>2])==(0|k)){t=25;break}t=26;break;case 25:HEAP32[L>>2]=T,HEAP32[C>>2]=O;var x=T;t=34;break;case 27:var I=e+(h+20|0)|0,H=HEAP32[I>>2];if(!(0|H)){t=28;break}var N=H,D=I;t=29;break;case 28:var R=e+(h+16|0)|0,F=HEAP32[R>>2];if(!(0|F)){x=0;t=34;break}N=F,D=R;t=29;break;case 29:var U=N+20|0,j=HEAP32[U>>2];if(!(0|j)){t=30;break}N=j,D=U;t=29;break;case 30:var M=N+16|0,B=HEAP32[M>>2];if(!(0|B)){t=31;break}N=B,D=M;t=29;break;case 31:if(D>>>0<o>>>0){t=33;break}t=32;break;case 32:HEAP32[D>>2]=0;x=N;t=34;break;case 34:if(!(0|A)){l=v,f=y;t=56;break}t=35;break;case 35:var G=e+(h+28|0)|0,Y=344+(HEAP32[G>>2]<<2)|0;if((0|k)==(0|HEAP32[Y>>2])){t=36;break}t=38;break;case 36:if(HEAP32[Y>>2]=x,!(0|x)){t=37;break}t=44;break;case 37:var V=~(1<<HEAP32[G>>2]),z=HEAP32[11]&V;HEAP32[11]=z;l=v,f=y;t=56;break;case 38:if(A>>>0<HEAP32[14]>>>0){t=42;break}t=39;break;case 39:var K=A+16|0;if((0|HEAP32[K>>2])==(0|k)){t=40;break}t=41;break;case 40:HEAP32[K>>2]=x,t=43;break;case 41:HEAP32[(A+20|0)>>2]=x,t=43;break;case 43:if(!(0|x)){l=v,f=y;t=56;break}t=44;break;case 44:if(x>>>0<HEAP32[14]>>>0){t=53;break}t=45;break;case 45:HEAP32[(x+24|0)>>2]=A;var q=HEAP32[(e+(h+16|0)|0)>>2];if(!(0|q)){t=49;break}t=46;break;case 46:if(q>>>0<HEAP32[14]>>>0){t=48;break}t=47;break;case 47:HEAP32[(x+16|0)>>2]=q,HEAP32[(q+24|0)>>2]=x,t=49;break;case 49:var W=HEAP32[(e+(h+20|0)|0)>>2];if(!(0|W)){l=v,f=y;t=56;break}t=50;break;case 50:if(W>>>0<HEAP32[14]>>>0){t=52;break}t=51;break;case 51:HEAP32[(x+20|0)>>2]=W,HEAP32[(W+24|0)>>2]=x;l=v,f=y;t=56;break;case 54:var X=e+(c-4|0)|0;if(3==(0|3&HEAP32[X>>2])){t=55;break}l=v,f=y;t=56;break;case 55:HEAP32[12]=y;var J=-2&HEAP32[X>>2];HEAP32[X>>2]=J;var Q=1|y;HEAP32[(e+(h+4|0)|0)>>2]=Q,HEAP32[s>>2]=y,t=140;break;case 56:var Z=l;if(Z>>>0<s>>>0){t=57;break}t=139;break;case 57:var $=e+(c-4|0)|0,ee=HEAP32[$>>2];if(!(0|1&ee)){t=139;break}t=58;break;case 58:if(!(0|2&ee)){t=59;break}t=112;break;case 59:if((0|u)==(0|HEAP32[16])){t=60;break}t=62;break;case 60:var te=HEAP32[13]+f|0;HEAP32[13]=te,HEAP32[16]=l;var re=1|te;if(HEAP32[(l+4|0)>>2]=re,(0|l)==(0|HEAP32[15])){t=61;break}t=140;break;case 61:HEAP32[15]=0,HEAP32[12]=0,t=140;break;case 62:if((0|u)==(0|HEAP32[15])){t=63;break}t=64;break;case 63:var ne=HEAP32[12]+f|0;HEAP32[12]=ne,HEAP32[15]=l;var oe=1|ne;HEAP32[(l+4|0)>>2]=oe,HEAP32[(Z+ne|0)>>2]=ne,t=140;break;case 64:var ae=(-8&ee)+f|0,ie=ee>>>3;if(ee>>>0<256){t=65;break}t=77;break;case 65:var ce=HEAP32[(e+c|0)>>2],se=HEAP32[(e+(4|c)|0)>>2],ue=80+(ie<<1<<2)|0;if((0|ce)==(0|ue)){t=68;break}t=66;break;case 66:if(ce>>>0<HEAP32[14]>>>0){t=76;break}t=67;break;case 67:if((0|HEAP32[(ce+12|0)>>2])==(0|u)){t=68;break}t=76;break;case 68:if((0|se)==(0|ce)){t=69;break}t=70;break;case 69:var le=~(1<<ie),fe=HEAP32[10]&le;HEAP32[10]=fe,t=110;break;case 70:if((0|se)==(0|ue)){t=71;break}t=72;break;case 71:var pe=se+8|0;t=74;break;case 72:if(se>>>0<HEAP32[14]>>>0){t=75;break}t=73;break;case 73:var he=se+8|0;if((0|HEAP32[he>>2])==(0|u)){pe=he;t=74;break}t=75;break;case 74:HEAP32[(ce+12|0)>>2]=se,HEAP32[pe>>2]=ce,t=110;break;case 77:var de=s,ve=HEAP32[(e+(c+16|0)|0)>>2],ye=HEAP32[(e+(4|c)|0)>>2];if((0|ye)==(0|de)){t=83;break}t=78;break;case 78:var me=HEAP32[(e+c|0)>>2];if(me>>>0<HEAP32[14]>>>0){t=82;break}t=79;break;case 79:var be=me+12|0;if((0|HEAP32[be>>2])==(0|de)){t=80;break}t=82;break;case 80:var _e=ye+8|0;if((0|HEAP32[_e>>2])==(0|de)){t=81;break}t=82;break;case 81:HEAP32[be>>2]=ye,HEAP32[_e>>2]=me;var ge=ye;t=90;break;case 83:var Ee=e+(c+12|0)|0,we=HEAP32[Ee>>2];if(!(0|we)){t=84;break}var Pe=we,Se=Ee;t=85;break;case 84:var ke=e+(c+8|0)|0,Ae=HEAP32[ke>>2];if(!(0|Ae)){ge=0;t=90;break}Pe=Ae,Se=ke;t=85;break;case 85:var Te=Pe+20|0,Oe=HEAP32[Te>>2];if(!(0|Oe)){t=86;break}Pe=Oe,Se=Te;t=85;break;case 86:var Le=Pe+16|0,Ce=HEAP32[Le>>2];if(!(0|Ce)){t=87;break}Pe=Ce,Se=Le;t=85;break;case 87:if(Se>>>0<HEAP32[14]>>>0){t=89;break}t=88;break;case 88:HEAP32[Se>>2]=0;ge=Pe;t=90;break;case 90:if(!(0|ve)){t=110;break}t=91;break;case 91:var xe=e+(c+20|0)|0,Ie=344+(HEAP32[xe>>2]<<2)|0;if((0|de)==(0|HEAP32[Ie>>2])){t=92;break}t=94;break;case 92:if(HEAP32[Ie>>2]=ge,!(0|ge)){t=93;break}t=100;break;case 93:var He=~(1<<HEAP32[xe>>2]),Ne=HEAP32[11]&He;HEAP32[11]=Ne,t=110;break;case 94:if(ve>>>0<HEAP32[14]>>>0){t=98;break}t=95;break;case 95:var De=ve+16|0;if((0|HEAP32[De>>2])==(0|de)){t=96;break}t=97;break;case 96:HEAP32[De>>2]=ge,t=99;break;case 97:HEAP32[(ve+20|0)>>2]=ge,t=99;break;case 99:if(!(0|ge)){t=110;break}t=100;break;case 100:if(ge>>>0<HEAP32[14]>>>0){t=109;break}t=101;break;case 101:HEAP32[(ge+24|0)>>2]=ve;var Re=HEAP32[(e+(c+8|0)|0)>>2];if(!(0|Re)){t=105;break}t=102;break;case 102:if(Re>>>0<HEAP32[14]>>>0){t=104;break}t=103;break;case 103:HEAP32[(ge+16|0)>>2]=Re,HEAP32[(Re+24|0)>>2]=ge,t=105;break;case 105:var Fe=HEAP32[(e+(c+12|0)|0)>>2];if(!(0|Fe)){t=110;break}t=106;break;case 106:if(Fe>>>0<HEAP32[14]>>>0){t=108;break}t=107;break;case 107:HEAP32[(ge+20|0)>>2]=Fe,HEAP32[(Fe+24|0)>>2]=ge,t=110;break;case 110:var Ue=1|ae;if(HEAP32[(l+4|0)>>2]=Ue,HEAP32[(Z+ae|0)>>2]=ae,(0|l)==(0|HEAP32[15])){t=111;break}var je=ae;t=113;break;case 111:HEAP32[12]=ae,t=140;break;case 112:var Me=-2&ee;HEAP32[$>>2]=Me;var Be=1|f;HEAP32[(l+4|0)>>2]=Be,HEAP32[(Z+f|0)>>2]=f;je=f;t=113;break;case 113:var Ge=je>>>3;if(je>>>0<256){t=114;break}t=119;break;case 114:var Ye=Ge<<1,Ve=80+(Ye<<2)|0,ze=HEAP32[10],Ke=1<<Ge;if(!(0|ze&Ke)){t=115;break}t=116;break;case 115:var qe=ze|Ke;HEAP32[10]=qe;var We=Ve,Xe=80+((Ye+2|0)<<2)|0;t=118;break;case 116:var Je=80+((Ye+2|0)<<2)|0,Qe=HEAP32[Je>>2];if(Qe>>>0<HEAP32[14]>>>0){t=117;break}We=Qe,Xe=Je;t=118;break;case 118:HEAP32[Xe>>2]=l,HEAP32[(We+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=We,HEAP32[(l+12|0)>>2]=Ve,t=140;break;case 119:var Ze=l,$e=je>>>8;if(!(0|$e)){var et=0;t=122;break}t=120;break;case 120:if(je>>>0>16777215){et=31;t=122;break}t=121;break;case 121:var tt=8&($e+1048320|0)>>>16,rt=$e<<tt,nt=4&(rt+520192|0)>>>16,ot=rt<<nt,at=2&(ot+245760|0)>>>16,it=(14-(nt|tt|at)|0)+(ot<<at>>>15)|0;et=1&je>>>((it+7|0)>>>0)|it<<1;t=122;break;case 122:var ct=344+(et<<2)|0,st=et;HEAP32[(l+28|0)>>2]=st,HEAP32[(l+20|0)>>2]=0,HEAP32[(l+16|0)>>2]=0;var ut=HEAP32[11],lt=1<<et;if(!(0|ut&lt)){t=123;break}t=124;break;case 123:var ft=ut|lt;HEAP32[11]=ft,HEAP32[ct>>2]=Ze;var pt=ct;HEAP32[(l+24|0)>>2]=pt,HEAP32[(l+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=l,t=136;break;case 124:var ht=HEAP32[ct>>2];if(31==(0|et)){var dt=0;t=126;break}t=125;break;case 125:dt=25-(et>>>1)|0;t=126;break;case 126:if((0|-8&HEAP32[(ht+4|0)>>2])==(0|je)){var vt=ht;t=133;break}t=127;break;case 127:var yt=ht,mt=je<<dt;t=129;break;case 128:var bt=mt<<1;if((0|-8&HEAP32[(gt+4|0)>>2])==(0|je)){vt=gt;t=133;break}yt=gt,mt=bt;t=129;break;case 129:var _t=yt+16+(mt>>>31<<2)|0,gt=HEAP32[_t>>2];if(!(0|gt)){t=130;break}t=128;break;case 130:if(_t>>>0<HEAP32[14]>>>0){t=132;break}t=131;break;case 131:HEAP32[_t>>2]=Ze;var Et=yt;HEAP32[(l+24|0)>>2]=Et,HEAP32[(l+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=l,t=136;break;case 133:var wt=vt+8|0,Pt=HEAP32[wt>>2],St=vt,kt=HEAP32[14];if(St>>>0>=kt>>>0&Pt>>>0>=kt>>>0){t=134;break}t=135;break;case 134:HEAP32[(Pt+12|0)>>2]=Ze,HEAP32[wt>>2]=Ze;var At=Pt;HEAP32[(l+8|0)>>2]=At;var Tt=vt;HEAP32[(l+12|0)>>2]=Tt,HEAP32[(l+24|0)>>2]=0,t=136;break;case 136:var Ot=HEAP32[18]-1|0;if(HEAP32[18]=Ot,!(0|Ot)){var Lt=496;t=137;break}t=140;break;case 137:var Ct=HEAP32[Lt>>2],xt=Ct+8|0;if(!(0|Ct)){t=138;break}Lt=xt;t=137;break;case 138:HEAP32[18]=-1,t=140;break;case 140:return;default:assert(0,"bad label: "+t)}}Module._bitmap_decompress_15=_bitmap_decompress_15,Module._bitmap_decompress_16=_bitmap_decompress_16,Module._bitmap_decompress_24=_bitmap_decompress_24,Module._bitmap_decompress_32=_bitmap_decompress_32,Module._malloc=_malloc,Module._free=_free;var i64Math=null,initialStackTop;if(memoryInitializer){var applyData=function(e){HEAPU8.set(e,STATIC_BASE)};ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL?applyData(Module.readBinary(memoryInitializer)):(addRunDependency("memory initializer"),Browser.asyncLoad(memoryInitializer,(function(e){applyData(e),removeRunDependency("memory initializer")}),(function(e){throw"could not load memory initializer "+memoryInitializer})))}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ensureInitRuntime(),preMain(),Module._main&&shouldRunNow&&Module.callMain(e),postRun())}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0?Module.printErr("run() called, but dependencies remain, so not running"):(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),ABORT||t()}),1)):t()))}function exit(e){throw ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),new ExitStatus(e)}function abort(e){throw e&&(Module.print(e),Module.printErr(e)),ABORT=!0,EXITSTATUS=1,"abort() at "+stackTrace()}if(dependenciesFulfilled=function e(){!Module.calledRun&&shouldRunNow&&run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ENVIRONMENT_IS_WEB&&null!==preloadStartTime&&Module.printErr("preload time: "+(Date.now()-preloadStartTime)+" ms"),ensureInitRuntime();var t=e.length+1;function r(){for(var e=0;e<3;e++)n.push(0)}var n=[allocate(intArrayFromString("/bin/this.program"),"i8",ALLOC_NORMAL)];r();for(var o=0;o<t-1;o+=1)n.push(allocate(intArrayFromString(e[o]),"i8",ALLOC_NORMAL)),r();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL),initialStackTop=STACKTOP;try{var a=Module._main(t,n,0);Module.noExitRuntime||exit(a)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"===_typeof(e)&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit,Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()},4534:(e,t,r)=>{var n=r(9023).inherits,o=r(5570),a=r(6986);function i(e){this.offset=0,e instanceof Buffer?this.buffer=e:this.buffer=Buffer.alloc(e||8192)}function c(e){e&&(this.value=e)}function s(e){c.call(this),this.opt=e||{},this.isReaded=!1,this.isWritten=!1}function u(e,t){s.call(this,t),this.obj=e}function l(e,t,r,n,o){s.call(this,o),this.value=e||0,this.nbBytes=t,this.readBufferCallback=r,this.writeBufferCallback=n}function f(e,t){l.call(this,e,1,Buffer.prototype.readUInt8,Buffer.prototype.writeUInt8,t)}function p(e,t){l.call(this,e,2,Buffer.prototype.readUInt16LE,Buffer.prototype.writeUInt16LE,t)}function h(e,t){l.call(this,e,2,Buffer.prototype.readUInt16BE,Buffer.prototype.writeUInt16BE,t)}function d(e,t){l.call(this,e,4,Buffer.prototype.readUInt32LE,Buffer.prototype.writeUInt32LE,t)}function v(e,t){l.call(this,e,4,Buffer.prototype.readUInt32BE,Buffer.prototype.writeUInt32BE,t)}function y(e,t){s.call(this,t),this.value=e||Buffer.alloc(0)}function m(e,t){s.call(this,t),this.factory=e}i.prototype.availableLength=function(){return this.buffer.length-this.offset},i.prototype.readPadding=function(e){this.offset+=e},i.prototype.getValue=function(){return this.buffer},Object.defineProperty(c.prototype,"value",{get:function(){return this._value()},set:function(e){this._value="function"!=typeof e?function(){return e}:e}}),n(s,c),s.prototype.write=function(e){return this.opt.conditional&&!this.opt.conditional()||(this.isWritten=!0,this.writeValue(e)),this},s.prototype.read=function(e){if(this.opt.conditional&&!this.opt.conditional())return this;if(this.opt.optional&&e.availableLength()<this.size())return this;if(this.isReaded=!0,this.opt.constant){var t=this.value;try{this.readValue(e)}catch(e){if(e instanceof RangeError)throw new a.ProtocolError("NODE_RDP_CORE_TYPE_STREAM_TOO_SMALL");throw e}if(t!==this.value)throw o.error("constant value mismatch "+t+" != "+this.value),new a.ProtocolError("NODE_RDP_CORE_TYPE_CONSTANT_VALUE_MISMATCH, OLD:"+t+", NEW:"+this.value)}else try{this.readValue(e)}catch(e){if(e instanceof RangeError)throw new a.ProtocolError("NODE_RDP_CORE_TYPE_STREAM_TOO_SMALL");throw e}return this},s.prototype.size=function(){return this.opt.conditional&&!this.opt.conditional()?0:this._size_()},s.prototype.toStream=function(){var e=new i(this.size());return this.write(e),e},n(u,s),u.prototype.ignore=function(e){return 0===e.lastIndexOf("__",0)||"function"==typeof this.obj[e]},u.prototype.writeValue=function(e){for(var t in this.obj)if(!this.ignore(t))try{this.obj[t].write(e)}catch(e){throw o.info("during write of field "+t),e}},u.prototype.readValue=function(e){var t=e;for(var r in this.opt.readLength&&(t=new i(e.buffer.slice(e.offset,e.offset+this.opt.readLength.value))),this.obj)if(!this.ignore(r))try{this.obj[r].read(t)}catch(e){throw o.info("during read of field "+r),e}this.opt.readLength&&(e.offset+=this.opt.readLength.value,t.offset<this.opt.readLength.value&&o.debug("still have available data : read it as padding"))},u.prototype._size_=function(){var e=0;for(var t in this.obj)this.ignore(t)||(e+=this.obj[t].size());return e},n(l,s),l.prototype.writeValue=function(e){this.writeBufferCallback.call(e.buffer,this.value,e.offset),e.offset+=this._size_()},l.prototype.readValue=function(e){this.value=this.readBufferCallback.call(e.buffer,e.offset),e.offset+=this._size_()},l.prototype._size_=function(){return this.nbBytes},n(f,l),n(p,l),n(h,l),n(d,l),n(v,l),n(y,s),y.prototype.writeValue=function(e){this.value.copy(e.buffer,e.offset),e.offset+=this._size_()},y.prototype.readValue=function(e){this.opt.readLength?this.value=e.buffer.slice(e.offset,e.offset+this.opt.readLength.value):this.value=e.buffer.slice(e.offset),e.offset+=this._size_()},y.prototype._size_=function(){return this.value.length},n(m,s),m.prototype.writeValue=function(e){this.factory(e)},m.prototype.readValue=function(e){this.factory(e)},m.prototype._size_=function(){throw new a.FatalError("NODE_RDP_CORE_TYPE_FACTORY_TYPE_HAVE_NO_SIZE")},e.exports={Stream:i,Component:u,UInt8:f,UInt16Le:p,UInt16Be:h,UInt32Le:d,UInt32Be:v,BinaryString:y,CallableValue:c,Factory:m}},4490:(e,t,r)=>{var n=r(6939);e.exports={createClient:n.rdp.createClient,createServer:n.rdp.createServer}},8701:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(8597).x509,i=r(8597).rsa,c=r(5002),s={CERT_CHAIN_VERSION_1:1,CERT_CHAIN_VERSION_2:2};function u(e){var t={magic:new n.UInt32Le(826364754,{constant:!0}),keylen:new n.UInt32Le((function(){return t.modulus.size()+t.paddinf.size()})),bitlen:new n.UInt32Le((function(){return 8*(t.keylen.value-8)})),datalen:new n.UInt32Le((function(){return t.bitlen.value/8-1})),pubExp:new n.UInt32Le,modulus:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return t.keylen.value-8}))}),padding:new n.BinaryString(Buffer.from(Array(9).join("\0")),{readLength:new n.CallableValue(8)})};return new n.Component(t,e)}function l(){var e={cbCert:new n.UInt32Le((function(){return e.abCert.size()})),abCert:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return e.cbCert.value}))})};return new n.Component(e)}e.exports={CertificateType:s,certificate:function(){var e={dwVersion:new n.UInt32Le((function(){return e.certData.__TYPE__})),certData:new n.Factory((function(t){switch(2147483647&e.dwVersion.value){case s.CERT_CHAIN_VERSION_1:o.debug("read proprietary certificate"),e.certData=function(){var e={__TYPE__:s.CERT_CHAIN_VERSION_1,dwSigAlgId:new n.UInt32Le(1,{constant:!0}),dwKeyAlgId:new n.UInt32Le(1,{constant:!0}),wPublicKeyBlobType:new n.UInt16Le(6,{constant:!0}),wPublicKeyBlobLen:new n.UInt16Le((function(){return e.PublicKeyBlob.size()})),PublicKeyBlob:u({readLength:new n.CallableValue((function(){return e.wPublicKeyBlobLen.value}))}),wSignatureBlobType:new n.UInt16Le(8,{constant:!0}),wSignatureBlobLen:new n.UInt16Le((function(){return e.SignatureBlob.size()+e.padding.size()})),SignatureBlob:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return e.wSignatureBlobLen.value-e.padding.size}))}),padding:new n.BinaryString(Array(9).join("\0"),{readLength:new n.CallableValue(8)}),getPublicKey:function(){return i.publicKey(e.PublicKeyBlob.obj.modulus.value,e.PublicKeyBlob.obj.pubExp.value)}};return new n.Component(e)}().read(t);break;case s.CERT_CHAIN_VERSION_2:o.debug("read x.509 certificate chain"),e.certData=function(){var e={__TYPE__:s.CERT_CHAIN_VERSION_2,NumCertBlobs:new n.UInt32Le,CertBlobArray:new n.Factory((function(t){e.CertBlobArray=new n.Component([]);for(var r=0;r<e.NumCertBlobs.value;r++)e.CertBlobArray.obj.push(l().read(t))})),padding:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return 8+4*e.NumCertBlobs.value}))}),getPublicKey:function(){var t=a.X509Certificate().decode(new n.Stream(e.CertBlobArray.obj[e.CertBlobArray.obj.length-1].obj.abCert.value),c.ber),r=new n.Stream(t.value.tbsCertificate.value.subjectPublicKeyInfo.value.subjectPublicKey.toBuffer()),o=a.RSAPublicKey().decode(r,c.ber);return i.publicKey(o.value.modulus.value,o.value.publicExponent.value)}};return new n.Component(e)}().read(t);break;default:o.error("unknown cert type "+e.dwVersion.value&2147483647)}}))};return new n.Component(e)}}},6939:(e,t,r)=>{var n=r(2008),o=r(5599),a=r(1018),i=r(4077);e.exports={TPKT:n,x224:o,t125:a,rdp:i}},6626:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(6261),i=r(6982),c=r(2470),s=c.asn1;c.pki;function u(e,t,r,n,o){var a={domain:"",user:"",password:"",response_key_nt:null,response_key_lm:null,negotiate_message:null,exported_session_key:i.randomBytes(16),is_unicode:!1};a.domain=r,a.completedFunc=t,a.user=n,a.password=o,a.response_key_nt=b(a.password,a.user,a.domain),a.response_key_lm=_(a.password,a.user,a.domain),this.ntlm=a,this.state=1,this.transport=e,this.transport.expect(2);var c=this;this.oldDataListeners=this.transport.listeners("data"),this.oldCloseListeners=this.transport.listeners("close"),this.oldErrorListeners=this.transport.listeners("error"),this.transport.removeAllListeners("data"),this.transport.removeAllListeners("close"),this.transport.removeAllListeners("error"),this.transport.once("data",(function(e){c.recvHeader(e)})).on("close",(function(){c.emit("close")})).on("error",(function(e){c.emit("close")}))}n(u,a.EventEmitter),u.prototype.recvHeader=function(e){var t=this,r=((new o.UInt8).read(e).value,(new o.UInt8).read(e).value);t.buffers=[e.buffer],r<128?(this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))):(this.transport.expect(r-128),this.transport.once("data",(function(e){t.recvHeaderSize(e)})))},u.prototype.recvHeaderSize=function(e){var t=this;if(t.buffers.push(e.buffer),1==e.buffer.length){var r=e.buffer.readUInt8(0);this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))}else if(2==e.buffer.length){r=e.buffer.readUInt16BE(0);this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))}},u.prototype.recvData=function(e){var t=this;t.buffers.push(e.buffer);var r=Buffer.concat(t.buffers),n=s.fromDer(r.toString("binary"));if(6==n.value[0].value[0].value.charCodeAt(0))if(1==this.state){var o=Buffer.from(n.value[1].value[0].value[0].value[0].value[0].value,"binary"),a=function(e,t){var r=t.slice(0,8);"4e544c4d53535000"!=r.toString("hex")&&console.log("BAD SIGNATURE");var n=t.readInt32LE(8);2!=n&&console.log("BAD MESSAGE TYPE");var o=t.readInt16LE(12),a=(t.readInt16LE(14),t.readInt32LE(16)),c=t.readInt32LE(20),s=t.slice(24,32),u=t.slice(32,40);"0000000000000000"!=u.toString("hex")&&console.log("BAD RESERVED");var l=t.readInt16LE(40),f=(t.readInt16LE(42),t.readInt32LE(44)),p=(t.slice(a,a+o),t.slice(f,f+l)),h=function(e){var t,r,n={},o=0;for(;0!=(t=e.readInt16LE(o));)r=e.readInt16LE(o+2),n[t]=e.slice(o+4,o+4+r),o+=4+r;return n}(t.slice(f,f+l)),v=h[7];null==v&&console.log("NO TIMESTAMP");var y=i.randomBytes(8),P=b(e.password,e.user,e.domain),S=_(e.password,e.user,e.domain),k=E(P,S,s,y,v,p),A=k[0],T=k[1],L=w(function(e){return e}(k[2]),e.exported_session_key);e.is_unicode=!!(1&c);var C=null,x=null;e.is_unicode?(C=d(e.domain),x=d(e.user)):(C=Buffer.from(e.domain,"utf8"),x=Buffer.from(e.user,"utf8"));var I=O(T,A,C,x,g(0),L,c),H=Buffer.concat([I[0],g(16),I[1]]),N=function(e,t,r,n){return m(e,Buffer.concat([t,r,n]))}(e.exported_session_key,e.negotiate_message,t,H);return Buffer.concat([I[0],N,I[1]])}(this.ntlm,o);t.security_interface=function(e){var t={};if(e){t.signing_key=A(e.exported_session_key,!0),t.verify_key=A(e.exported_session_key,!1);var r=T(e.exported_session_key,!0),n=T(e.exported_session_key,!1);t.encrypt=P(r),t.decrypt=P(n)}return t.seq_num=0,t.gss_wrapex=function(e){var r=t.encrypt.update(e),n=k(t.encrypt,t.signing_key,t.seq_num,e);return t.seq_num++,Buffer.concat([n,r])},t.gss_unwrapex=function(e){e.readInt32LE(0);var r=e.slice(4,12),n=e.readInt32LE(12),o=e.slice(16),a=t.decrypt.update(o),i=t.decrypt.update(r),c=Buffer.alloc(4);c.writeInt32LE(n,0);var s=m(t.verify_key,Buffer.concat([c,a])).slice(0,8);return i.equals(s)||console.log("Invalid checksum on NTLMv2"),a},t}(this.ntlm);var c=this.transport.secureSocket.getPeerCertificate(),u=x(a,t.security_interface.gss_wrapex(c.pubkey.slice(24)));this.ntlm.publicKeyDer=c.pubkey.slice(24),this.send(u),this.state=2}else if(2==this.state){var l,f,p,h=Buffer.from(n.value[1].value[0].value,"binary"),v=t.security_interface.gss_unwrapex(h);if(!this.ntlm.publicKeyDer.slice(1).equals(v.slice(1)))return console.log("RDP man-in-the-middle detected."),void close();delete this.ntlm.publicKeyDer,this.ntlm.is_unicode?(l=d(this.ntlm.domain),f=d(this.ntlm.user),p=d(this.ntlm.password)):(l=Buffer.from(this.ntlm.domain,"utf8"),f=Buffer.from(this.ntlm.user,"utf8"),p=Buffer.from(this.ntlm.password,"utf8"));var y=L(t.security_interface.gss_wrapex(C(l,f,p)));for(var S in this.send(y),this.transport.removeAllListeners("data"),this.transport.removeAllListeners("close"),this.transport.removeAllListeners("error"),this.oldDataListeners)this.transport.once("data",this.oldDataListeners[S]);for(var S in this.oldCloseListeners)this.transport.on("close",this.oldCloseListeners[S]);for(var S in this.oldErrorListeners)this.transport.on("error",this.oldErrorListeners[S]);return this.transport.expect(2),this.state=3,void this.ntlm.completedFunc()}this.transport.expect(2),this.transport.once("data",(function(e){t.recvHeader(e)}))},u.prototype.send=function(e){this.transport.sendBuffer(e)},u.prototype.close=function(){this.transport.close()},u.prototype.sendNegotiateMessage=function(){this.ntlm.negotiate_message=S();var e=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,this.ntlm.negotiate_message.toString("binary"))])])])])]);this.send(Buffer.from(s.toDer(e).data,"binary"))},e.exports=u;var l={NtlmsspNegociate56:2147483648,NtlmsspNegociateKeyExch:1073741824,NtlmsspNegociate128:536870912,NtlmsspNegociateVersion:33554432,NtlmsspNegociateTargetInfo:8388608,NtlmsspRequestNonNTSessionKey:4194304,NtlmsspNegociateIdentify:1048576,NtlmsspNegociateExtendedSessionSecurity:524288,NtlmsspTargetTypeServer:131072,NtlmsspTargetTypeDomain:65536,NtlmsspNegociateAlwaysSign:32768,NtlmsspNegociateOEMWorkstationSupplied:8192,NtlmsspNegociateOEMDomainSupplied:4096,NtlmsspNegociateNTLM:512,NtlmsspNegociateLMKey:128,NtlmsspNegociateDatagram:64,NtlmsspNegociateSeal:32,NtlmsspNegociateSign:16,NtlmsspRequestTarget:4,NtlmNegotiateOEM:2,NtlmsspNegociateUnicode:1},f={WindowsMajorVersion5:5,WindowsMajorVersion6:6},p={WindowsMinorVersion0:0,WindowsMinorVersion1:1,WindowsMinorVersion2:2,WindowsMinorVersion3:3},h={NtlmSspRevisionW2K3:15};function d(e){return Buffer.from(e,"ucs2")}function v(e){try{return i.createHash("md4").update(e).digest()}catch(t){return Buffer.from(r(1890).array(e.toString("binary")))}}function y(e){return i.createHash("md5").update(e).digest()}function m(e,t){return i.createHmac("md5",e).update(t).digest()}function b(e,t,r){return m(v(d(e)),d(t.toUpperCase()+r))}function _(e,t,r){return b(e,t,r)}function g(e){return Buffer.alloc(e)}function E(e,t,r,n,o,a){var i=Buffer.from("01","hex"),c=Buffer.from("01","hex"),s=Buffer.concat([i,c,g(6),o,n,g(4),a]),u=m(e,Buffer.concat([r,s]));return[Buffer.concat([u,s]),Buffer.concat([m(t,Buffer.concat([r,n])),n]),m(e,u)]}function w(e,t){return P(e).update(t)}function P(e){var t={};try{t.n=i.createCipheriv("rc4",e,null),t.update=function(e){return t.n.update(e)}}catch(o){var n=r(4824);t.r=new n(e.toString("binary")),t.update=function(e){return Buffer.from(t.r.encrypt(e.toString("binary")),"hex")}}return t}function S(){return function(e,t,r){var n=e&l.NtlmsspNegociateVersion?40:32,o=Buffer.alloc(n);o.write("4e544c4d53535000",0,8,"hex"),o.writeInt32LE(1,8),o.writeInt32LE(e,12),o.writeInt16LE(t.length,16),o.writeInt16LE(t.length,18),t.length>0&&o.writeInt32LE(n,20);o.writeInt16LE(r.length,24),o.writeInt16LE(r.length,26),r.length>0&&o.writeInt32LE(n+t.length,28);e&l.NtlmsspNegociateVersion&&(o.writeUInt8(f.WindowsMajorVersion6,32),o.writeUInt8(p.WindowsMinorVersion0,33),o.writeInt16LE(6002,34),o.writeUInt8(h.NtlmSspRevisionW2K3,39));return Buffer.concat([o,t,r])}(l.NtlmsspNegociateKeyExch|l.NtlmsspNegociate128|l.NtlmsspNegociateExtendedSessionSecurity|l.NtlmsspNegociateAlwaysSign|l.NtlmsspNegociateNTLM|l.NtlmsspNegociateSeal|l.NtlmsspNegociateSign|l.NtlmsspRequestTarget|l.NtlmsspNegociateUnicode,Buffer.alloc(0),Buffer.alloc(0))}function k(e,t,r,n){var o=Buffer.alloc(4);o.writeInt32LE(r,0);var a=m(t,Buffer.concat([o,n]));return function(e,t){var r=Buffer.alloc(16);r.writeInt32LE(1,0),e&&e.copy(r,4,0,8);t&&r.writeInt32LE(t,12);return r}(e.update(a.slice(0,8)),r)}function A(e,t){return y(t?Buffer.concat([e,Buffer.from("session key to client-to-server signing key magic constant\0")]):Buffer.concat([e,Buffer.from("session key to server-to-client signing key magic constant\0")]))}function T(e,t){return y(t?Buffer.concat([e,Buffer.from("session key to client-to-server sealing key magic constant\0")]):Buffer.concat([e,Buffer.from("session key to server-to-client sealing key magic constant\0")]))}function O(e,t,r,n,o,a,i){var c=Buffer.concat([e,t,r,n,o,a]),s=i&l.NtlmsspNegociateVersion?88:80,u=Buffer.alloc(s-16);return u.write("4e544c4d53535000",0,8,"hex"),u.writeInt32LE(3,8),u.writeInt16LE(e.length,12),u.writeInt16LE(e.length,14),u.writeInt32LE(s,16),u.writeInt16LE(t.length,20),u.writeInt16LE(t.length,22),u.writeInt32LE(s+e.length,24),u.writeInt16LE(r.length,28),u.writeInt16LE(r.length,30),u.writeInt32LE(s+e.length+t.length,32),u.writeInt16LE(n.length,36),u.writeInt16LE(n.length,38),u.writeInt32LE(s+e.length+t.length+r.length,40),u.writeInt16LE(o.length,44),u.writeInt16LE(o.length,46),u.writeInt32LE(s+e.length+t.length+r.length+n.length,48),u.writeInt16LE(a.length,52),u.writeInt16LE(a.length,54),u.writeInt32LE(s+e.length+t.length+r.length+n.length+o.length,56),u.writeInt32LE(i,60),i&l.NtlmsspNegociateVersion&&(u.writeUInt8(f.WindowsMajorVersion6,64),u.writeUInt8(p.WindowsMinorVersion0,65),u.writeInt16LE(6002,66),u.writeUInt8(h.NtlmSspRevisionW2K3,71)),[u,c]}function L(e){return asn1obj=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,2,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))])]),Buffer.from(s.toDer(asn1obj).data,"binary")}function C(e,t,r){var n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.toString("binary"))]),s.create(s.Class.CONTEXT_SPECIFIC,2,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,r.toString("binary"))])]),o=s.toDer(n).data;return n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(1))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,o)])]),Buffer.from(s.toDer(n).data,"binary")}function x(e,t){var r=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))])])])]),s.create(s.Class.CONTEXT_SPECIFIC,3,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.toString("binary"))])]);return Buffer.from(s.toDer(r).data,"binary")}},9790:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(5784).error,i={CAPSTYPE_GENERAL:1,CAPSTYPE_BITMAP:2,CAPSTYPE_ORDER:3,CAPSTYPE_BITMAPCACHE:4,CAPSTYPE_CONTROL:5,CAPSTYPE_ACTIVATION:7,CAPSTYPE_POINTER:8,CAPSTYPE_SHARE:9,CAPSTYPE_COLORCACHE:10,CAPSTYPE_SOUND:12,CAPSTYPE_INPUT:13,CAPSTYPE_FONT:14,CAPSTYPE_BRUSH:15,CAPSTYPE_GLYPHCACHE:16,CAPSTYPE_OFFSCREENCACHE:17,CAPSTYPE_BITMAPCACHE_HOSTSUPPORT:18,CAPSTYPE_BITMAPCACHE_REV2:19,CAPSTYPE_VIRTUALCHANNEL:20,CAPSTYPE_DRAWNINEGRIDCACHE:21,CAPSTYPE_DRAWGDIPLUS:22,CAPSTYPE_RAIL:23,CAPSTYPE_WINDOW:24,CAPSETTYPE_COMPDESK:25,CAPSETTYPE_MULTIFRAGMENTUPDATE:26,CAPSETTYPE_LARGE_POINTER:27,CAPSETTYPE_SURFACE_COMMANDS:28,CAPSETTYPE_BITMAP_CODECS:29,CAPSSETTYPE_FRAME_ACKNOWLEDGE:30},c={NEGOTIATEORDERSUPPORT:2,ZEROBOUNDSDELTASSUPPORT:8,COLORINDEXSUPPORT:32,SOLIDPATTERNBRUSHONLY:64,ORDERFLAGS_EXTRA_FLAGS:128},s={BRUSH_DEFAULT:0,BRUSH_COLOR_8x8:1,BRUSH_COLOR_FULL:2},u={GLYPH_SUPPORT_NONE:0,GLYPH_SUPPORT_PARTIAL:1,GLYPH_SUPPORT_FULL:2,GLYPH_SUPPORT_ENCODE:3},l={FALSE:0,TRUE:1},f={VCCAPS_NO_COMPR:0,VCCAPS_COMPR_SC:1,VCCAPS_COMPR_CS_8K:2},p={NONE:0,SOUND_BEEPS_FLAG:1};function h(e){var t={__TYPE__:i.CAPSTYPE_GENERAL,osMajorType:new n.UInt16Le,osMinorType:new n.UInt16Le,protocolVersion:new n.UInt16Le(512,{constant:!0}),pad2octetsA:new n.UInt16Le,generalCompressionTypes:new n.UInt16Le(0,{constant:!0}),extraFlags:new n.UInt16Le,updateCapabilityFlag:new n.UInt16Le(0,{constant:!0}),remoteUnshareFlag:new n.UInt16Le(0,{constant:!0}),generalCompressionLevel:new n.UInt16Le(0,{constant:!0}),refreshRectSupport:new n.UInt8,suppressOutputSupport:new n.UInt8};return new n.Component(t,e)}function d(e){var t={__TYPE__:i.CAPSTYPE_BITMAP,preferredBitsPerPixel:new n.UInt16Le,receive1BitPerPixel:new n.UInt16Le(1),receive4BitsPerPixel:new n.UInt16Le(1),receive8BitsPerPixel:new n.UInt16Le(1),desktopWidth:new n.UInt16Le,desktopHeight:new n.UInt16Le,pad2octets:new n.UInt16Le,desktopResizeFlag:new n.UInt16Le,bitmapCompressionFlag:new n.UInt16Le(1,{constant:!0}),highColorFlags:new n.UInt8(0),drawingFlags:new n.UInt8,multipleRectangleSupport:new n.UInt16Le(1,{constant:!0}),pad2octetsB:new n.UInt16Le};return new n.Component(t,e)}function v(e,t){if(e&&32!==e.size())throw new a.FatalError("NODE_RDP_PROTOCOL_PDU_CAPS_BAD_ORDERS_SIZE");var r={__TYPE__:i.CAPSTYPE_ORDER,terminalDescriptor:new n.BinaryString(Buffer.from(Array(17).join("\0"),"binary"),{readLength:new n.CallableValue(16)}),pad4octetsA:new n.UInt32Le(0),desktopSaveXGranularity:new n.UInt16Le(1),desktopSaveYGranularity:new n.UInt16Le(20),pad2octetsA:new n.UInt16Le(0),maximumOrderLevel:new n.UInt16Le(1),numberFonts:new n.UInt16Le,orderFlags:new n.UInt16Le(c.NEGOTIATEORDERSUPPORT),orderSupport:e||new n.Factory((function(e){r.orderSupport=new n.BinaryString(null,{readLength:new n.CallableValue(32)}).read(e)})),textFlags:new n.UInt16Le,orderSupportExFlags:new n.UInt16Le,pad4octetsB:new n.UInt32Le,desktopSaveSize:new n.UInt32Le(230400),pad2octetsC:new n.UInt16Le,pad2octetsD:new n.UInt16Le,textANSICodePage:new n.UInt16Le(0),pad2octetsE:new n.UInt16Le};return new n.Component(r,t)}function y(e){var t={__TYPE__:i.CAPSTYPE_BITMAPCACHE,pad1:new n.UInt32Le,pad2:new n.UInt32Le,pad3:new n.UInt32Le,pad4:new n.UInt32Le,pad5:new n.UInt32Le,pad6:new n.UInt32Le,cache0Entries:new n.UInt16Le,cache0MaximumCellSize:new n.UInt16Le,cache1Entries:new n.UInt16Le,cache1MaximumCellSize:new n.UInt16Le,cache2Entries:new n.UInt16Le,cache2MaximumCellSize:new n.UInt16Le};return new n.Component(t,e)}function m(e,t){var r={__TYPE__:i.CAPSTYPE_POINTER,colorPointerFlag:new n.UInt16Le,colorPointerCacheSize:new n.UInt16Le(20),pointerCacheSize:new n.UInt16Le(null,{conditional:function(){return e||!1}})};return new n.Component(r,t)}function b(e){var t={__TYPE__:i.CAPSTYPE_INPUT,inputFlags:new n.UInt16Le,pad2octetsA:new n.UInt16Le,keyboardLayout:new n.UInt32Le,keyboardType:new n.UInt32Le,keyboardSubType:new n.UInt32Le,keyboardFunctionKey:new n.UInt32Le,imeFileName:new n.BinaryString(Buffer.from(Array(65).join("\0"),"binary"),{readLength:new n.CallableValue(64)})};return new n.Component(t,e)}function _(e){var t={__TYPE__:i.CAPSTYPE_BRUSH,brushSupportLevel:new n.UInt32Le(s.BRUSH_DEFAULT)};return new n.Component(t,e)}function g(e){var t={cacheEntries:new n.UInt16Le,cacheMaximumCellSize:new n.UInt16Le};return new n.Component(t,e)}function E(e,t){var r={__TYPE__:i.CAPSTYPE_GLYPHCACHE,glyphCache:e||new n.Factory((function(e){r.glyphCache=new n.Component([]);for(var t=0;t<10;t++)r.glyphCache.obj.push(g().read(e))})),fragCache:new n.UInt32Le,glyphSupportLevel:new n.UInt16Le(u.GLYPH_SUPPORT_NONE),pad2octets:new n.UInt16Le};return new n.Component(r,t)}function w(e){var t={__TYPE__:i.CAPSTYPE_OFFSCREENCACHE,offscreenSupportLevel:new n.UInt32Le(l.FALSE),offscreenCacheSize:new n.UInt16Le,offscreenCacheEntries:new n.UInt16Le};return new n.Component(t,e)}function P(e){var t={__TYPE__:i.CAPSTYPE_VIRTUALCHANNEL,flags:new n.UInt32Le(f.VCCAPS_NO_COMPR),VCChunkSize:new n.UInt32Le(null,{optional:!0})};return new n.Component(t,e)}function S(e){var t={__TYPE__:i.CAPSTYPE_SOUND,soundFlags:new n.UInt16Le(p.NONE),pad2octetsA:new n.UInt16Le};return new n.Component(t,e)}function k(e){var t={__TYPE__:i.CAPSTYPE_CONTROL,controlFlags:new n.UInt16Le,remoteDetachFlag:new n.UInt16Le,controlInterest:new n.UInt16Le(2),detachInterest:new n.UInt16Le(2)};return new n.Component(t,e)}function A(e){var t={__TYPE__:i.CAPSTYPE_ACTIVATION,helpKeyFlag:new n.UInt16Le,helpKeyIndexFlag:new n.UInt16Le,helpExtendedKeyFlag:new n.UInt16Le,windowManagerKeyFlag:new n.UInt16Le};return new n.Component(t,e)}function T(e){var t={__TYPE__:i.CAPSTYPE_FONT,fontSupportFlags:new n.UInt16Le(1),pad2octets:new n.UInt16Le};return new n.Component(t,e)}function O(e){var t={__TYPE__:i.CAPSTYPE_COLORCACHE,colorTableCacheSize:new n.UInt16Le(6),pad2octets:new n.UInt16Le};return new n.Component(t,e)}function L(e){var t={__TYPE__:i.CAPSTYPE_SHARE,nodeId:new n.UInt16Le,pad2octets:new n.UInt16Le};return new n.Component(t,e)}function C(e){var t={__TYPE__:i.CAPSETTYPE_MULTIFRAGMENTUPDATE,MaxRequestSize:new n.UInt32Le(0)};return new n.Component(t,e)}e.exports={CapsType:i,MajorType:{OSMAJORTYPE_UNSPECIFIED:0,OSMAJORTYPE_WINDOWS:1,OSMAJORTYPE_OS2:2,OSMAJORTYPE_MACINTOSH:3,OSMAJORTYPE_UNIX:4,OSMAJORTYPE_IOS:5,OSMAJORTYPE_OSX:6,OSMAJORTYPE_ANDROID:7},MinorType:{OSMINORTYPE_UNSPECIFIED:0,OSMINORTYPE_WINDOWS_31X:1,OSMINORTYPE_WINDOWS_95:2,OSMINORTYPE_WINDOWS_NT:3,OSMINORTYPE_OS2_V21:4,OSMINORTYPE_POWER_PC:5,OSMINORTYPE_MACINTOSH:6,OSMINORTYPE_NATIVE_XSERVER:7,OSMINORTYPE_PSEUDO_XSERVER:8,OSMINORTYPE_WINDOWS_RT:9},GeneralExtraFlag:{FASTPATH_OUTPUT_SUPPORTED:1,NO_BITMAP_COMPRESSION_HDR:1024,LONG_CREDENTIALS_SUPPORTED:4,AUTORECONNECT_SUPPORTED:8,ENC_SALTED_CHECKSUM:16},Boolean:{FALSE:0,TRUE:1},OrderFlag:c,Order:{TS_NEG_DSTBLT_INDEX:0,TS_NEG_PATBLT_INDEX:1,TS_NEG_SCRBLT_INDEX:2,TS_NEG_MEMBLT_INDEX:3,TS_NEG_MEM3BLT_INDEX:4,TS_NEG_DRAWNINEGRID_INDEX:7,TS_NEG_LINETO_INDEX:8,TS_NEG_MULTI_DRAWNINEGRID_INDEX:9,TS_NEG_SAVEBITMAP_INDEX:11,TS_NEG_MULTIDSTBLT_INDEX:15,TS_NEG_MULTIPATBLT_INDEX:16,TS_NEG_MULTISCRBLT_INDEX:17,TS_NEG_MULTIOPAQUERECT_INDEX:18,TS_NEG_FAST_INDEX_INDEX:19,TS_NEG_POLYGON_SC_INDEX:20,TS_NEG_POLYGON_CB_INDEX:21,TS_NEG_POLYLINE_INDEX:22,TS_NEG_FAST_GLYPH_INDEX:24,TS_NEG_ELLIPSE_SC_INDEX:25,TS_NEG_ELLIPSE_CB_INDEX:26,TS_NEG_INDEX_INDEX:27},OrderEx:{ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT:2,ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT:4},InputFlags:{INPUT_FLAG_SCANCODES:1,INPUT_FLAG_MOUSEX:4,INPUT_FLAG_FASTPATH_INPUT:8,INPUT_FLAG_UNICODE:16,INPUT_FLAG_FASTPATH_INPUT2:32,INPUT_FLAG_UNUSED1:64,INPUT_FLAG_UNUSED2:128,TS_INPUT_FLAG_MOUSE_HWHEEL:256},BrushSupport:s,GlyphSupport:u,OffscreenSupportLevel:l,VirtualChannelCompressionFlag:f,SoundFlag:p,generalCapability:h,bitmapCapability:d,orderCapability:v,bitmapCacheCapability:y,pointerCapability:m,inputCapability:b,brushCapability:_,cacheEntry:g,glyphCapability:E,offscreenBitmapCacheCapability:w,virtualChannelCapability:P,soundCapability:S,controlCapability:k,windowActivationCapability:A,fontCapability:T,colorCacheCapability:O,shareCapability:L,multiFragmentUpdate:C,capability:function(e,t){var r={capabilitySetType:new n.UInt16Le((function(){return r.capability.obj.__TYPE__})),lengthCapability:new n.UInt16Le((function(){return new n.Component(r).size()})),capability:e||new n.Factory((function(e){switch(r.capabilitySetType.value){case i.CAPSTYPE_GENERAL:r.capability=h({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BITMAP:r.capability=d({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_ORDER:r.capability=v(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BITMAPCACHE:r.capability=y({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_POINTER:r.capability=m(!1,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_INPUT:r.capability=b({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BRUSH:r.capability=_({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_GLYPHCACHE:r.capability=E(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_OFFSCREENCACHE:r.capability=w({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_VIRTUALCHANNEL:r.capability=P({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_SOUND:r.capability=S({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_CONTROL:r.capability=k({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_ACTIVATION:r.capability=A({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_FONT:r.capability=T({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_COLORCACHE:r.capability=O({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_SHARE:r.capability=L({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSETTYPE_MULTIFRAGMENTUPDATE:r.capability=C({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;default:o.debug("unknown capability "+r.capabilitySetType.value),r.capability=new n.BinaryString(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e)}}))};return new n.Component(r,t)}}},2461:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t,r){return t=l(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var h=r(5784).type,d=r(6261).EventEmitter,v=(r(9790),r(5784).log,r(1467)),y=function(e){function t(e,r){var n;return c(this,t),(n=s(this,t,[e,r])).transport.once("connect",(function(e,t,r){n.connect(e,t,r)})).on("close",(function(){})).on("error",(function(e){})),n.content="",n}return f(t,e),a(t,[{key:"connect",value:function(e,t,r){var n=this;this.gccCore=e,this.userId=t,this.channelId=r,this.transport.once("cliprdr",(function(e){n.recv(e)}))}},{key:"send",value:function(e){this.transport.send("cliprdr",new h.Component([new h.UInt32Le(e.size()),new h.UInt32Le(19),e]))}},{key:"recv",value:function(e){var t=this;e.offset=18;var r=v.clipPDU().read(e),n=v.ClipPDUMsgType;switch(r.obj.header.obj.msgType.value){case n.CB_MONITOR_READY:this.recvMonitorReadyPDU(e);break;case n.CB_FORMAT_LIST:this.recvFormatListPDU(e);break;case n.CB_FORMAT_LIST_RESPONSE:this.recvFormatListResponsePDU(e);break;case n.CB_FORMAT_DATA_REQUEST:this.recvFormatDataRequestPDU(e);break;case n.CB_FORMAT_DATA_RESPONSE:this.recvFormatDataResponsePDU(e);break;case n.CB_TEMP_DIRECTORY:break;case n.CB_CLIP_CAPS:this.recvClipboardCapsPDU(e);case n.CB_FILECONTENTS_REQUEST:}this.transport.once("cliprdr",(function(e){t.recv(e)}))}},{key:"recvClipboardCapsPDU",value:function(e){e.offset=18}},{key:"recvMonitorReadyPDU",value:function(e){e.offset=18,this.sendClipboardCapsPDU(),this.sendFormatListPDU()}},{key:"sendClipboardCapsPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_CLIP_CAPS),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(16),cCapabilitiesSets:new h.UInt16Le(1),pad1:new h.UInt16Le(0),capabilitySetType:new h.UInt16Le(1),lengthCapability:new h.UInt16Le(12),version:new h.UInt32Le(2),capabilityFlags:new h.UInt32Le(2)}))}},{key:"sendClientTemporaryDirectoryPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_TEMP_DIRECTORY),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(520),wszTempDir:new h.BinaryString(Buffer.from("D:\\Vectors"+Array(251).join("\0"),"ucs2"),{readLength:new h.CallableValue(520)})}))}},{key:"sendFormatListPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_LIST),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(36),formatId6:new h.UInt32Le(49156),formatName6:new h.BinaryString(Buffer.from("Native\0","ucs2"),{readLength:new h.CallableValue(14)}),formatId8:new h.UInt32Le(13),formatName8:new h.UInt16Le(0),formatId9:new h.UInt32Le(16),formatName9:new h.UInt16Le(0),formatId0:new h.UInt32Le(1),formatName0:new h.UInt16Le(0),formatId5:new h.UInt32Le(7),formatName5:new h.UInt16Le(0)}))}},{key:"recvFormatListPDU",value:function(e){e.offset=18,this.sendFormatListResponsePDU()}},{key:"sendFormatListResponsePDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_LIST_RESPONSE),msgFlags:new h.UInt16Le(1),dataLen:new h.UInt32Le(0)})),this.sendFormatDataRequestPDU()}},{key:"recvFormatListResponsePDU",value:function(e){e.offset=18}},{key:"sendFormatDataRequestPDU",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13;this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_DATA_REQUEST),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(4),requestedFormatId:new h.UInt32Le(e)}))}},{key:"recvFormatDataRequestPDU",value:function(e){e.offset=18,this.sendFormatDataResponsePDU()}},{key:"sendFormatDataResponsePDU",value:function(){var e=Buffer.from(this.content+"\0","ucs2");this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_DATA_RESPONSE),msgFlags:new h.UInt16Le(1),dataLen:new h.UInt32Le(e.length),requestedFormatData:new h.BinaryString(e,{readLength:new h.CallableValue(e.length)})}))}},{key:"recvFormatDataResponsePDU",value:function(e){e.offset=18;var t=e.buffer.toString("ucs2",26,e.buffer.length-2);this.content=t,this.emit("clipboard",t)}},{key:"setClipboardData",value:function(e){this.content=e,this.sendFormatListPDU()}}])}(function(e){function t(e){var r;return c(this,t),(r=s(this,t)).transport=e,r.userId=0,r.serverCapabilities=[],r.clientCapabilities=[],r}return f(t,e),a(t)}(d));e.exports={Client:y}},1467:(e,t,r)=>{var n=r(9790),o=r(5784).type,a=r(5784).log,i={PDUTYPE_DEMANDACTIVEPDU:17,PDUTYPE_CONFIRMACTIVEPDU:19,PDUTYPE_DEACTIVATEALLPDU:22,PDUTYPE_DATAPDU:23,PDUTYPE_SERVER_REDIR_PKT:26},c={PDUTYPE2_UPDATE:2,PDUTYPE2_CONTROL:20,PDUTYPE2_POINTER:27,PDUTYPE2_INPUT:28,PDUTYPE2_SYNCHRONIZE:31,PDUTYPE2_REFRESH_RECT:33,PDUTYPE2_PLAY_SOUND:34,PDUTYPE2_SUPPRESS_OUTPUT:35,PDUTYPE2_SHUTDOWN_REQUEST:36,PDUTYPE2_SHUTDOWN_DENIED:37,PDUTYPE2_SAVE_SESSION_INFO:38,PDUTYPE2_FONTLIST:39,PDUTYPE2_FONTMAP:40,PDUTYPE2_SET_KEYBOARD_INDICATORS:41,PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST:43,PDUTYPE2_BITMAPCACHE_ERROR_PDU:44,PDUTYPE2_SET_KEYBOARD_IME_STATUS:45,PDUTYPE2_OFFSCRCACHE_ERROR_PDU:46,PDUTYPE2_SET_ERROR_INFO_PDU:47,PDUTYPE2_DRAWNINEGRID_ERROR_PDU:48,PDUTYPE2_DRAWGDIPLUS_ERROR_PDU:49,PDUTYPE2_ARC_STATUS_PDU:50,PDUTYPE2_STATUS_INFO_PDU:54,PDUTYPE2_MONITOR_LAYOUT_PDU:55},s={STREAM_UNDEFINED:0,STREAM_LOW:1,STREAM_MED:2,STREAM_HI:4},u={BITMAP_COMPRESSION:1,NO_BITMAP_COMPRESSION_HDR:1024},l={UPDATETYPE_ORDERS:0,UPDATETYPE_BITMAP:1,UPDATETYPE_PALETTE:2,UPDATETYPE_SYNCHRONIZE:3},f={INPUT_EVENT_SYNC:0,INPUT_EVENT_UNUSED:2,INPUT_EVENT_SCANCODE:4,INPUT_EVENT_UNICODE:5,INPUT_EVENT_MOUSE:32769,INPUT_EVENT_MOUSEX:32770},p={FASTPATH_UPDATETYPE_ORDERS:0,FASTPATH_UPDATETYPE_BITMAP:1,FASTPATH_UPDATETYPE_PALETTE:2,FASTPATH_UPDATETYPE_SYNCHRONIZE:3,FASTPATH_UPDATETYPE_SURFCMDS:4,FASTPATH_UPDATETYPE_PTR_NULL:5,FASTPATH_UPDATETYPE_PTR_DEFAULT:6,FASTPATH_UPDATETYPE_PTR_POSITION:8,FASTPATH_UPDATETYPE_COLOR:9,FASTPATH_UPDATETYPE_CACHED:10,FASTPATH_UPDATETYPE_POINTER:11},h={FASTPATH_OUTPUT_COMPRESSION_USED:2},d={SUPPRESS_DISPLAY_UPDATES:0,ALLOW_DISPLAY_UPDATES:1};function v(e,t,r,n){var a={totalLength:new o.UInt16Le(e),pduType:new o.UInt16Le(t),PDUSource:new o.UInt16Le(r,{optional:!0})};return new o.Component(a,n)}function y(e,t,r,n){var a={shareId:new o.UInt32Le(r),pad1:new o.UInt8,streamId:new o.UInt8(s.STREAM_LOW),uncompressedLength:new o.UInt16Le((function(){return e.value-8})),pduType2:new o.UInt8(t),compressedType:new o.UInt8,compressedLength:new o.UInt16Le};return new o.Component(a,n)}function m(e,t){var r={__PDUTYPE__:i.PDUTYPE_DEMANDACTIVEPDU,shareId:new o.UInt32Le,lengthSourceDescriptor:new o.UInt16Le((function(){return r.sourceDescriptor.size()})),lengthCombinedCapabilities:new o.UInt16Le((function(){return r.numberCapabilities.size()+r.pad2Octets.size()+r.capabilitySets.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("node-rdpjs","binary"),{readLength:new o.CallableValue((function(){return r.lengthSourceDescriptor.value}))}),numberCapabilities:new o.UInt16Le((function(){return r.capabilitySets.obj.length})),pad2Octets:new o.UInt16Le,capabilitySets:e||new o.Factory((function(e){r.capabilitySets=new o.Component([]);for(var t=0;t<r.numberCapabilities.value;t++)r.capabilitySets.obj.push(n.capability().read(e))})),sessionId:new o.UInt32Le};return new o.Component(r,t)}function b(e,t,r){var a={__PDUTYPE__:i.PDUTYPE_CONFIRMACTIVEPDU,shareId:new o.UInt32Le(t),originatorId:new o.UInt16Le(1002,{constant:!0}),lengthSourceDescriptor:new o.UInt16Le((function(){return a.sourceDescriptor.size()})),lengthCombinedCapabilities:new o.UInt16Le((function(){return a.numberCapabilities.size()+a.pad2Octets.size()+a.capabilitySets.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("rdpy","binary"),{readLength:new o.CallableValue((function(){return a.lengthSourceDescriptor.value}))}),numberCapabilities:new o.UInt16Le((function(){return a.capabilitySets.obj.length})),pad2Octets:new o.UInt16Le,capabilitySets:e||new o.Factory((function(e){a.capabilitySets=new o.Component([]);for(var t=0;t<a.numberCapabilities.value;t++)a.capabilitySets.obj.push(n.capability().read(e))}))};return new o.Component(a,r)}function _(e){var t={__PDUTYPE__:i.PDUTYPE_DEACTIVATEALLPDU,shareId:new o.UInt32Le,lengthSourceDescriptor:new o.UInt16Le((function(){return t.sourceDescriptor.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("rdpy","binary"),{readLength:new o.CallableValue((function(){t.lengthSourceDescriptor}))})};return new o.Component(t,e)}function g(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_SYNCHRONIZE,messageType:new o.UInt16Le(1,{constant:!0}),targetUser:new o.UInt16Le(e)};return new o.Component(r,t)}function E(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_CONTROL,action:new o.UInt16Le(e),grantId:new o.UInt16Le,controlId:new o.UInt32Le};return new o.Component(r,t)}function w(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_SET_ERROR_INFO_PDU,errorInfo:new o.UInt32Le(e)};return new o.Component(r,t)}function P(e){var t={__PDUTYPE2__:c.PDUTYPE2_FONTLIST,numberFonts:new o.UInt16Le,totalNumFonts:new o.UInt16Le,listFlags:new o.UInt16Le(3),entrySize:new o.UInt16Le(50)};return new o.Component(t,e)}function S(e){var t={__PDUTYPE2__:c.PDUTYPE2_FONTMAP,numberEntries:new o.UInt16Le,totalNumEntries:new o.UInt16Le,mapFlags:new o.UInt16Le(3),entrySize:new o.UInt16Le(4)};return new o.Component(t,e)}function k(e){var t={key1:new o.UInt32Le,key2:new o.UInt32Le};return new o.Component(t,e)}function A(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST,numEntriesCache0:new o.UInt16Le,numEntriesCache1:new o.UInt16Le,numEntriesCache2:new o.UInt16Le,numEntriesCache3:new o.UInt16Le,numEntriesCache4:new o.UInt16Le,totalEntriesCache0:new o.UInt16Le,totalEntriesCache1:new o.UInt16Le,totalEntriesCache2:new o.UInt16Le,totalEntriesCache3:new o.UInt16Le,totalEntriesCache4:new o.UInt16Le,bitMask:new o.UInt8,pad2:new o.UInt8,pad3:new o.UInt16Le,entries:e||new o.Factory((function(e){var t=r.numEntriesCache0.value+r.numEntriesCache1.value+r.numEntriesCache2.value+r.numEntriesCache3.value+r.numEntriesCache4.value;r.entries=new o.Component([]);for(var n=0;n<t;n++)r.entries.obj.push(k().read(e))}))};return new o.Component(r,t)}function T(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_SYNC,pad2Octets:new o.UInt16Le,toggleFlags:new o.UInt32Le};return new o.Component(t,e)}function O(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_MOUSE,pointerFlags:new o.UInt16Le,xPos:new o.UInt16Le,yPos:new o.UInt16Le};return new o.Component(t,e)}function L(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_SCANCODE,keyboardFlags:new o.UInt16Le,keyCode:new o.UInt16Le,pad2Octets:new o.UInt16Le};return new o.Component(t,e)}function C(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_UNICODE,keyboardFlags:new o.UInt16Le,unicode:new o.UInt16Le,pad2Octets:new o.UInt16Le};return new o.Component(t,e)}function x(e,t){var r={eventTime:new o.UInt32Le,messageType:new o.UInt16Le((function(){return r.slowPathInputData.obj.__INPUT_MESSAGE_TYPE__})),slowPathInputData:e||new o.Factory((function(e){switch(r.messageType.value){case f.INPUT_EVENT_SYNC:r.slowPathInputData=T().read(e);break;case f.INPUT_EVENT_MOUSE:r.slowPathInputData=O().read(e);break;case f.INPUT_EVENT_SCANCODE:r.slowPathInputData=L().read(e);break;case f.INPUT_EVENT_UNICODE:r.slowPathInputData=C().read(e);break;default:a.error("unknown slowPathInputEvent "+r.messageType.value)}}))};return new o.Component(r,t)}function I(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_INPUT,numEvents:new o.UInt16Le((function(){return r.slowPathInputEvents.obj.length})),pad2Octets:new o.UInt16Le,slowPathInputEvents:e||new o.Factory((function(e){r.slowPathInputEvents=new o.Component([]);for(var t=0;t<r.numEvents.value;t++)r.slowPathInputEvents.obj.push(x().read(e))}))};return new o.Component(r,t)}function H(e){var t={__PDUTYPE2__:c.PDUTYPE2_SHUTDOWN_REQUEST};return new o.Component(t,e)}function N(e){var t={__PDUTYPE2__:c.PDUTYPE2_SHUTDOWN_DENIED};return new o.Component(t,e)}function D(e){var t={left:new o.UInt16Le,top:new o.UInt16Le,right:new o.UInt16Le,bottom:new o.UInt16Le};return new o.Component(t,e)}function R(e){var t={__PDUTYPE2__:c.PDUTYPE2_SUPPRESS_OUTPUT,allowDisplayUpdates:new o.UInt8,pad3Octets:new o.Component([new o.UInt8,new o.UInt8,new o.UInt8]),desktopRect:D({conditional:function(){return t.allowDisplayUpdates.value===d.ALLOW_DISPLAY_UPDATES}})};return new o.Component(t,e)}function F(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_REFRESH_RECT,numberOfAreas:UInt8((function(){return r.areasToRefresh.obj.length})),pad3Octets:new o.Component([new o.UInt8,new o.UInt8,new o.UInt8]),areasToRefresh:e||new o.Factory((function(e){r.areasToRefresh=new o.Component([]);for(var t=0;t<r.numberOfAreas.value;t++)r.areasToRefresh.obj.push(D().read(e))}))};return new o.Component(r,t)}function U(e){var t={cbCompFirstRowSize:new o.UInt16Le(0,{constant:!0}),cbCompMainBodySize:new o.UInt16Le,cbScanWidth:new o.UInt16Le,cbUncompressedSize:new o.UInt16Le};return new o.Component(t,e)}function j(e,t){e=e||{};var r={destLeft:new o.UInt16Le(e.destLeft),destTop:new o.UInt16Le(e.destTop),destRight:new o.UInt16Le(e.destRight),destBottom:new o.UInt16Le(e.destBottom),width:new o.UInt16Le(e.width),height:new o.UInt16Le(e.height),bitsPerPixel:new o.UInt16Le(e.bitsPerPixel),flags:new o.UInt16Le,bitmapLength:new o.UInt16Le((function(){return r.bitmapComprHdr.size()+r.bitmapDataStream.size()})),bitmapComprHdr:U({conditional:function(){return r.flags.value&u.BITMAP_COMPRESSION&&!(r.flags.value&u.NO_BITMAP_COMPRESSION_HDR)}}),bitmapDataStream:new o.BinaryString(e.data,{readLength:new o.CallableValue((function(){return!r.flags.value&u.BITMAP_COMPRESSION||r.flags.value&u.NO_BITMAP_COMPRESSION_HDR?r.bitmapLength.value:r.bitmapComprHdr.cbCompMainBodySize.value}))})};return new o.Component(r,t)}function M(e,t){var r={__UPDATE_TYPE__:l.UPDATETYPE_BITMAP,numberRectangles:new o.UInt16Le((function(){return r.rectangles.obj.length})),rectangles:e||new o.Factory((function(e){r.rectangles=new o.Component([]);for(var t=0;t<r.numberRectangles.value;t++)r.rectangles.obj.push(j().read(e))}))};return new o.Component(r,t)}function B(e,t){var r={__PDUTYPE2_:c.PDUTYPE2_UPDATE__,updateType:new o.UInt16Le((function(){return r.updateData.obj.__UPDATE_TYPE__})),updateData:e||new o.Factory((function(e){var n={readLength:new o.CallableValue((function(){return t.readLength.value-2}))};switch(r.updateType.value){case l.UPDATETYPE_BITMAP:r.updateData=M(null,n).read(e);break;case l.UPDATETYPE_SYNCHRONIZE:r.updateData=function(e){var t={pad2Octets:new o.UInt16Le};return new o.Component(t,e)}(null).read(e);break;default:r.updateData=new o.BinaryString(null,n).read(e),a.debug("unknown updateDataPDU "+r.updateType.value)}}))};return new o.Component(r,t)}function G(e,t,r){var n={__PDUTYPE__:i.PDUTYPE_DATAPDU,shareDataHeader:y(new o.CallableValue((function(){return new o.Component(n).size()})),(function(){return n.pduData.obj.__PDUTYPE2__}),t),pduData:e||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return r.readLength.value-n.shareDataHeader.size()}))};switch(n.shareDataHeader.obj.pduType2.value){case c.PDUTYPE2_SYNCHRONIZE:n.pduData=g(null,t).read(e);break;case c.PDUTYPE2_CONTROL:n.pduData=E(null,t).read(e);break;case c.PDUTYPE2_SET_ERROR_INFO_PDU:n.pduData=w(null,t).read(e);break;case c.PDUTYPE2_FONTLIST:n.pduData=P(t).read(e);break;case c.PDUTYPE2_FONTMAP:n.pduData=S(t).read(e);break;case c.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST:n.pduData=A(null,t).read(e);break;case c.PDUTYPE2_INPUT:n.pduData=I(null,t).read(e);break;case c.PDUTYPE2_SHUTDOWN_REQUEST:n.pduData=H(t).read(e);break;case c.PDUTYPE2_SHUTDOWN_DENIED:n.pduData=N(t).read(e);break;case c.PDUTYPE2_SUPPRESS_OUTPUT:n.pduData=R(t).read(e);break;case c.PDUTYPE2_REFRESH_RECT:n.pduData=F(null,t).read(e);break;case c.PDUTYPE2_UPDATE:n.pduData=B(null,t).read(e);break;default:n.pduData=new o.BinaryString(null,t).read(e),a.debug("unknown PDUType2 "+n.shareDataHeader.obj.pduType2.value)}}))};return new o.Component(n,r)}function Y(e){var t={__FASTPATH_UPDATE_TYPE__:p.FASTPATH_UPDATETYPE_BITMAP,header:new o.UInt16Le(p.FASTPATH_UPDATETYPE_BITMAP,{constant:!0}),numberRectangles:new o.UInt16Le((function(){return t.rectangles.obj.length})),rectangles:new o.Factory((function(e){t.rectangles=new o.Component([]);for(var r=0;r<t.numberRectangles.value;r++)t.rectangles.obj.push(j().read(e))}))};return new o.Component(t,e)}var V={903013897:"alias",370524792:"all-scroll",853046751:"cell",2101250798:"col-resize",703681364:"copy",992638936:"crosshair",1539083673:"ew-resize",1919796298:"grab",1010243511:"grabbing",1247283057:"help",1390892051:"none",885751489:"not-allowed",1732952247:"row-resize",747144997:"url",2018345610:"zoom-in",347367048:"zoom-out",1872942890:"default",1737852989:"text",1932827019:"ns-resize",1884471290:"nesw-resize",1204065391:"nwse-resize",2030531519:"progress",1050842114:"pointer",1258195498:"default",219484254:"all-scroll",399295089:"text",1912613597:"wait",864127801:"ew-resize",23245044:"nesw-resize",1966995494:"not-allowed",1873216615:"help",255126408:"nesw-resize",157191894:"ns-resize",1768446509:"pointer",1032011501:"crosshair"};e.exports={PDUType:i,PDUType2:c,StreamId:s,CompressionOrder:{CompressionTypeMask:15,PACKET_COMPRESSED:32,PACKET_AT_FRONT:64,PACKET_FLUSHED:128},CompressionType:{PACKET_COMPR_TYPE_8K:0,PACKET_COMPR_TYPE_64K:1,PACKET_COMPR_TYPE_RDP6:2,PACKET_COMPR_TYPE_RDP61:3},Action:{CTRLACTION_REQUEST_CONTROL:1,CTRLACTION_GRANTED_CONTROL:2,CTRLACTION_DETACH:3,CTRLACTION_COOPERATE:4},PersistentKeyListFlag:{PERSIST_FIRST_PDU:1,PERSIST_LAST_PDU:2},BitmapFlag:u,UpdateType:l,InputMessageType:f,PointerFlag:{PTRFLAGS_HWHEEL:1024,PTRFLAGS_WHEEL:512,PTRFLAGS_WHEEL_NEGATIVE:256,WheelRotationMask:511,PTRFLAGS_MOVE:2048,PTRFLAGS_DOWN:32768,PTRFLAGS_BUTTON1:4096,PTRFLAGS_BUTTON2:8192,PTRFLAGS_BUTTON3:16384},KeyboardFlag:{KBDFLAGS_EXTENDED:256,KBDFLAGS_DOWN:16384,KBDFLAGS_RELEASE:32768},FastPathOutputCompression:h,Display:d,ToogleFlag:{TS_SYNC_SCROLL_LOCK:1,TS_SYNC_NUM_LOCK:2,TS_SYNC_CAPS_LOCK:4,TS_SYNC_KANA_LOCK:8},ErrorInfo:{ERRINFO_RPC_INITIATED_DISCONNECT:1,ERRINFO_RPC_INITIATED_LOGOFF:2,ERRINFO_IDLE_TIMEOUT:3,ERRINFO_LOGON_TIMEOUT:4,ERRINFO_DISCONNECTED_BY_OTHERCONNECTION:5,ERRINFO_OUT_OF_MEMORY:6,ERRINFO_SERVER_DENIED_CONNECTION:7,ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES:9,ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED:10,ERRINFO_RPC_INITIATED_DISCONNECT_BYUSER:11,ERRINFO_LOGOFF_BY_USER:12,ERRINFO_LICENSE_INTERNAL:256,ERRINFO_LICENSE_NO_LICENSE_SERVER:257,ERRINFO_LICENSE_NO_LICENSE:258,ERRINFO_LICENSE_BAD_CLIENT_MSG:259,ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE:260,ERRINFO_LICENSE_BAD_CLIENT_LICENSE:261,ERRINFO_LICENSE_CANT_FINISH_PROTOCOL:262,ERRINFO_LICENSE_CLIENT_ENDED_PROTOCOL:263,ERRINFO_LICENSE_BAD_CLIENT_ENCRYPTION:264,ERRINFO_LICENSE_CANT_UPGRADE_LICENSE:265,ERRINFO_LICENSE_NO_REMOTE_CONNECTIONS:266,ERRINFO_CB_DESTINATION_NOT_FOUND:1024,ERRINFO_CB_LOADING_DESTINATION:1026,ERRINFO_CB_REDIRECTING_TO_DESTINATION:1028,ERRINFO_CB_SESSION_ONLINE_VM_WAKE:1029,ERRINFO_CB_SESSION_ONLINE_VM_BOOT:1030,ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS:1031,ERRINFO_CB_DESTINATION_POOL_NOT_FREE:1032,ERRINFO_CB_CONNECTION_CANCELLED:1033,ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS:1040,ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT:1041,ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED:1042,ERRINFO_UNKNOWNPDUTYPE2:4297,ERRINFO_UNKNOWNPDUTYPE:4298,ERRINFO_DATAPDUSEQUENCE:4299,ERRINFO_CONTROLPDUSEQUENCE:4301,ERRINFO_INVALIDCONTROLPDUACTION:4302,ERRINFO_INVALIDINPUTPDUTYPE:4303,ERRINFO_INVALIDINPUTPDUMOUSE:4304,ERRINFO_INVALIDREFRESHRECTPDU:4305,ERRINFO_CREATEUSERDATAFAILED:4306,ERRINFO_CONNECTFAILED:4307,ERRINFO_CONFIRMACTIVEWRONGSHAREID:4308,ERRINFO_CONFIRMACTIVEWRONGORIGINATOR:4309,ERRINFO_PERSISTENTKEYPDUBADLENGTH:4314,ERRINFO_PERSISTENTKEYPDUILLEGALFIRST:4315,ERRINFO_PERSISTENTKEYPDUTOOMANYTOTALKEYS:4316,ERRINFO_PERSISTENTKEYPDUTOOMANYCACHEKEYS:4317,ERRINFO_INPUTPDUBADLENGTH:4318,ERRINFO_BITMAPCACHEERRORPDUBADLENGTH:4319,ERRINFO_SECURITYDATATOOSHORT:4320,ERRINFO_VCHANNELDATATOOSHORT:4321,ERRINFO_SHAREDATATOOSHORT:4322,ERRINFO_BADSUPRESSOUTPUTPDU:4323,ERRINFO_CONFIRMACTIVEPDUTOOSHORT:4325,ERRINFO_CAPABILITYSETTOOSMALL:4327,ERRINFO_CAPABILITYSETTOOLARGE:4328,ERRINFO_NOCURSORCACHE:4329,ERRINFO_BADCAPABILITIES:4330,ERRINFO_VIRTUALCHANNELDECOMPRESSIONERR:4332,ERRINFO_INVALIDVCCOMPRESSIONTYPE:4333,ERRINFO_INVALIDCHANNELID:4335,ERRINFO_VCHANNELSTOOMANY:4336,ERRINFO_REMOTEAPPSNOTENABLED:4339,ERRINFO_CACHECAPNOTSET:4340,ERRINFO_BITMAPCACHEERRORPDUBADLENGTH2:4341,ERRINFO_OFFSCRCACHEERRORPDUBADLENGTH:4342,ERRINFO_DNGCACHEERRORPDUBADLENGTH:4343,ERRINFO_GDIPLUSPDUBADLENGTH:4344,ERRINFO_SECURITYDATATOOSHORT2:4369,ERRINFO_SECURITYDATATOOSHORT3:4370,ERRINFO_SECURITYDATATOOSHORT4:4371,ERRINFO_SECURITYDATATOOSHORT5:4372,ERRINFO_SECURITYDATATOOSHORT6:4373,ERRINFO_SECURITYDATATOOSHORT7:4374,ERRINFO_SECURITYDATATOOSHORT8:4375,ERRINFO_SECURITYDATATOOSHORT9:4376,ERRINFO_SECURITYDATATOOSHORT10:4377,ERRINFO_SECURITYDATATOOSHORT11:4378,ERRINFO_SECURITYDATATOOSHORT12:4379,ERRINFO_SECURITYDATATOOSHORT13:4380,ERRINFO_SECURITYDATATOOSHORT14:4381,ERRINFO_SECURITYDATATOOSHORT15:4382,ERRINFO_SECURITYDATATOOSHORT16:4383,ERRINFO_SECURITYDATATOOSHORT17:4384,ERRINFO_SECURITYDATATOOSHORT18:4385,ERRINFO_SECURITYDATATOOSHORT19:4386,ERRINFO_SECURITYDATATOOSHORT20:4387,ERRINFO_SECURITYDATATOOSHORT21:4388,ERRINFO_SECURITYDATATOOSHORT22:4389,ERRINFO_SECURITYDATATOOSHORT23:4390,ERRINFO_BADMONITORDATA:4393,ERRINFO_VCDECOMPRESSEDREASSEMBLEFAILED:4394,ERRINFO_VCDATATOOLONG:4395,ERRINFO_BAD_FRAME_ACK_DATA:4396,ERRINFO_GRAPHICSMODENOTSUPPORTED:4397,ERRINFO_GRAPHICSSUBSYSTEMRESETFAILED:4398,ERRINFO_GRAPHICSSUBSYSTEMFAILED:4399,ERRINFO_TIMEZONEKEYNAMELENGTHTOOSHORT:4400,ERRINFO_TIMEZONEKEYNAMELENGTHTOOLONG:4401,ERRINFO_DYNAMICDSTDISABLEDFIELDMISSING:4402,ERRINFO_VCDECODINGERROR:4403,ERRINFO_UPDATESESSIONKEYFAILED:4497,ERRINFO_DECRYPTFAILED:4498,ERRINFO_ENCRYPTFAILED:4499,ERRINFO_ENCPKGMISMATCH:4500,ERRINFO_DECRYPTFAILED2:4501},FastPathUpdateType:p,shareControlHeader:v,shareDataHeader:y,demandActivePDU:m,confirmActivePDU:b,deactiveAllPDU:_,pdu:function(e,t,r){var n={shareControlHeader:v((function(){return new o.Component(n).size()}),(function(){return t.obj.__PDUTYPE__}),e),pduMessage:t||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return n.shareControlHeader.obj.totalLength.value-n.shareControlHeader.size()}))};switch(n.shareControlHeader.obj.pduType.value){case i.PDUTYPE_DEMANDACTIVEPDU:n.pduMessage=m(null,t).read(e);break;case i.PDUTYPE_CONFIRMACTIVEPDU:n.pduMessage=b(null,t).read(e);break;case i.PDUTYPE_DEACTIVATEALLPDU:n.pduMessage=_(t).read(e);break;case i.PDUTYPE_DATAPDU:n.pduMessage=G(null,null,t).read(e);break;default:n.pduMessage=new o.BinaryString(null,t).read(e),a.debug("unknown pdu type "+n.shareControlHeader.obj.pduType.value)}}))};return new o.Component(n,r)},synchronizeDataPDU:g,controlDataPDU:E,errorInfoDataPDU:w,fontListDataPDU:P,fontMapDataPDU:S,persistentListPDU:A,synchronizeEvent:T,pointerEvent:O,scancodeKeyEvent:L,unicodeKeyEvent:C,slowPathInputEvent:x,clientInputEventPDU:I,shutdownRequestPDU:H,shutdownDeniedPDU:N,supressOutputDataPDU:R,refreshRectPDU:F,bitmapData:j,bitmapUpdateDataPDU:M,updateDataPDU:B,dataPDU:G,fastPathBitmapUpdateDataPDU:Y,fastPathUpdatePDU:function(e,t){var n={updateHeader:new o.UInt8((function(){return n.updateData.obj.__FASTPATH_UPDATE_TYPE__})),compressionFlags:new o.UInt8(null,{conditional:function(){return n.updateHeader.value>>4&h.FASTPATH_OUTPUT_COMPRESSION_USED}}),size:new o.UInt16Le((function(){return n.updateData.size()})),updateData:e||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return n.size.value}))};switch(15&n.updateHeader.value){case p.FASTPATH_UPDATETYPE_BITMAP:n.updateData=Y(t).read(e);break;case p.FASTPATH_UPDATETYPE_COLOR:var i=new o.BinaryString(null,t).read(e),c=r(6982).createHash("sha384");c.update(i.value);var s=Math.abs(c.digest().readInt32BE(0)),u=V[s];n.updateData=function(e,t,r){var n={__FASTPATH_UPDATE_TYPE__:p.FASTPATH_UPDATETYPE_COLOR,header:new o.UInt16Le(p.FASTPATH_UPDATETYPE_COLOR,{constant:!0}),cursorId:t,cursorStr:r};return new o.Component(n,e)}(t,s,u);break;default:n.updateData=new o.BinaryString(null,t).read(e),a.debug("unknown fast path pdu type "+(15&n.updateHeader.value))}}))};return new o.Component(n,t)},clipPDU:function(){var e={header:new o.Factory((function(t){e.header=new o.Component({msgType:(new o.UInt16Le).read(t),msgFlags:(new o.UInt16Le).read(t),dataLen:(new o.UInt32Le).read(t)})}))};return new o.Component(e)},ClipPDUMsgType:{CB_MONITOR_READY:1,CB_FORMAT_LIST:2,CB_FORMAT_LIST_RESPONSE:3,CB_FORMAT_DATA_REQUEST:4,CB_FORMAT_DATA_RESPONSE:5,CB_TEMP_DIRECTORY:6,CB_CLIP_CAPS:7,CB_FILECONTENTS_REQUEST:8}}},9272:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(9790),i=r(1467),c=r(5784).type,s=r(5784).log;function u(e,t){this.transport=e,this.fastPathTransport=t,this.userId=0,this.serverCapabilities=[],this.clientCapabilities=[]}function l(e,t){u.call(this,e,t);var r=this;this.transport.once("connect",(function(e,t,n){r.connect(e,t,n)})).on("close",(function(){r.emit("close")})).on("error",(function(e){r.emit("error",e)})),this.fastPathTransport&&this.fastPathTransport.on("fastPathData",(function(e,t){r.recvFastPath(e,t)})),this.clientCapabilities[a.CapsType.CAPSTYPE_GENERAL]=a.generalCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAP]=a.bitmapCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_ORDER]=a.orderCapability(new c.Component([new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0)])),this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAPCACHE]=a.bitmapCacheCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_POINTER]=a.pointerCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_INPUT]=a.inputCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_BRUSH]=a.brushCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_GLYPHCACHE]=a.glyphCapability(new c.Component([a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry()])),this.clientCapabilities[a.CapsType.CAPSTYPE_OFFSCREENCACHE]=a.offscreenBitmapCacheCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_VIRTUALCHANNEL]=a.virtualChannelCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_SOUND]=a.soundCapability(),this.clientCapabilities[a.CapsType.CAPSETTYPE_MULTIFRAGMENTUPDATE]=a.multiFragmentUpdate()}n(u,o.EventEmitter),u.prototype.sendPDU=function(e){this.transport.send(i.pdu(this.userId,e))},u.prototype.sendDataPDU=function(e){this.sendPDU(i.dataPDU(e,this.shareId))},n(l,u),l.prototype.connect=function(e,t,r){this.gccCore=e,this.userId=t,this.channelId=r;var n=this;this.transport.once("data",(function(e){n.recvDemandActivePDU(e)}))},l.prototype.close=function(){this.transport.close()},l.prototype.recvDemandActivePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value===i.PDUType.PDUTYPE_DEMANDACTIVEPDU){for(var r in this.shareId=t.obj.pduMessage.obj.shareId.value,t.obj.pduMessage.obj.capabilitySets.obj){var n=t.obj.pduMessage.obj.capabilitySets.obj[r].obj.capability;n.obj&&(this.serverCapabilities[n.obj.__TYPE__]=n)}this.transport.enableSecureCheckSum=!!(this.serverCapabilities[a.CapsType.CAPSTYPE_GENERAL].obj.extraFlags.value&a.GeneralExtraFlag.ENC_SALTED_CHECKSUM),this.sendConfirmActivePDU(),this.sendClientFinalizeSynchronizePDU();o=this;this.transport.once("data",(function(e){o.recvServerSynchronizePDU(e)}))}else{s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var o=this;this.transport.once("data",(function(e){o.recvDemandActivePDU(e)}))}},l.prototype.recvServerSynchronizePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value===i.PDUType.PDUTYPE_DATAPDU&&t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value===i.PDUType2.PDUTYPE2_SYNCHRONIZE){r=this;this.transport.once("data",(function(e){r.recvServerControlCooperatePDU(e)}))}else{s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerSynchronizePDU(e)}))}},l.prototype.recvServerControlCooperatePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_CONTROL||t.obj.pduMessage.obj.pduData.obj.action.value!==i.Action.CTRLACTION_COOPERATE){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerControlCooperatePDU(e)}))}r=this;this.transport.once("data",(function(e){r.recvServerControlGrantedPDU(e)}))},l.prototype.recvServerControlGrantedPDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_CONTROL||t.obj.pduMessage.obj.pduData.obj.action.value!==i.Action.CTRLACTION_GRANTED_CONTROL){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerControlGrantedPDU(e)}))}r=this;this.transport.once("data",(function(e){r.recvServerFontMapPDU(e)}))},l.prototype.recvServerFontMapPDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_FONTMAP){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerFontMapPDU(e)}))}this.emit("connect");r=this;this.transport.on("data",(function(e){r.recvPDU(e)}))},l.prototype.recvFastPath=function(e,t){for(;t.availableLength()>0;){var r=i.fastPathUpdatePDU().read(t);switch(15&r.obj.updateHeader.value){case i.FastPathUpdateType.FASTPATH_UPDATETYPE_BITMAP:this.emit("bitmap",r.obj.updateData.obj.rectangles.obj);break;case i.FastPathUpdateType.FASTPATH_UPDATETYPE_COLOR:this.emit("pointer",r.obj.updateData.obj.cursorId,r.obj.updateData.obj.cursorStr)}}},l.prototype.recvPDU=function(e){for(;e.availableLength()>0;){var t=i.pdu().read(e);switch(t.obj.shareControlHeader.obj.pduType.value){case i.PDUType.PDUTYPE_DEACTIVATEALLPDU:var r=this;this.transport.removeAllListeners("data"),this.transport.once("data",(function(e){r.recvDemandActivePDU(e)}));break;case i.PDUType.PDUTYPE_DATAPDU:this.readDataPDU(t.obj.pduMessage);break;default:s.debug("ignore pdu type "+t.obj.shareControlHeader.obj.pduType.value)}}},l.prototype.readDataPDU=function(e){switch(e.obj.shareDataHeader.obj.pduType2.value){case i.PDUType2.PDUTYPE2_SET_ERROR_INFO_PDU:break;case i.PDUType2.PDUTYPE2_SHUTDOWN_DENIED:this.transport.close();break;case i.PDUType2.PDUTYPE2_SAVE_SESSION_INFO:this.emit("session");break;case i.PDUType2.PDUTYPE2_UPDATE:this.readUpdateDataPDU(e.obj.pduData)}},l.prototype.readUpdateDataPDU=function(e){if(e.obj.updateType.value===i.UpdateType.UPDATETYPE_BITMAP)this.emit("bitmap",e.obj.updateData.obj.rectangles.obj)},l.prototype.sendConfirmActivePDU=function(){var e=this.clientCapabilities[a.CapsType.CAPSTYPE_GENERAL].obj;e.osMajorType.value=a.MajorType.OSMAJORTYPE_WINDOWS,e.osMinorType.value=a.MinorType.OSMINORTYPE_WINDOWS_NT,e.extraFlags.value=a.GeneralExtraFlag.LONG_CREDENTIALS_SUPPORTED|a.GeneralExtraFlag.NO_BITMAP_COMPRESSION_HDR|a.GeneralExtraFlag.ENC_SALTED_CHECKSUM|a.GeneralExtraFlag.FASTPATH_OUTPUT_SUPPORTED;var t=this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAP].obj;t.preferredBitsPerPixel.value=this.gccCore.highColorDepth.value,t.desktopWidth.value=this.gccCore.desktopWidth.value,t.desktopHeight.value=this.gccCore.desktopHeight.value,this.clientCapabilities[a.CapsType.CAPSTYPE_ORDER].obj.orderFlags.value|=a.OrderFlag.ZEROBOUNDSDELTASSUPPORT;var r=this.clientCapabilities[a.CapsType.CAPSTYPE_INPUT].obj;r.inputFlags.value=a.InputFlags.INPUT_FLAG_SCANCODES|a.InputFlags.INPUT_FLAG_MOUSEX|a.InputFlags.INPUT_FLAG_UNICODE,r.keyboardLayout=this.gccCore.kbdLayout,r.keyboardType=this.gccCore.keyboardType,r.keyboardSubType=this.gccCore.keyboardSubType,r.keyboardrFunctionKey=this.gccCore.keyboardFnKeys,r.imeFileName=this.gccCore.imeFileName;var n=new c.Component([]);for(var o in this.clientCapabilities)n.obj.push(a.capability(this.clientCapabilities[o]));var s=i.confirmActivePDU(n,this.shareId);this.sendPDU(s)},l.prototype.sendClientFinalizeSynchronizePDU=function(){this.sendDataPDU(i.synchronizeDataPDU(this.channelId)),this.sendDataPDU(i.controlDataPDU(i.Action.CTRLACTION_COOPERATE)),this.sendDataPDU(i.controlDataPDU(i.Action.CTRLACTION_REQUEST_CONTROL)),this.sendDataPDU(i.fontListDataPDU())},l.prototype.sendInputEvents=function(e){var t=i.clientInputEventPDU(new c.Component(e.map((function(e){return i.slowPathInputEvent(e)}))));this.sendDataPDU(t)},e.exports={Client:l}},2503:(e,t,r)=>{var n=r(1959),o=r(1562),a=r(9272),i=r(1467),c=r(2461);e.exports={lic:n,sec:o,global:a,data:i,cliprdr:c}},1959:(e,t,r)=>{var n=r(5784).type,o={LICENSE_REQUEST:1,PLATFORM_CHALLENGE:2,NEW_LICENSE:3,UPGRADE_LICENSE:4,LICENSE_INFO:18,NEW_LICENSE_REQUEST:19,PLATFORM_CHALLENGE_RESPONSE:21,ERROR_ALERT:255},a=0,i=1,c=2,s=3,u=13,l=14,f=15,p=16,h=3;function d(e){e=e||a;var t={wBlobType:new n.UInt16Le(e,{constant:e!==a}),wBlobLen:new n.UInt16Le((function(){return t.blobData.size()})),blobData:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return t.wBlobLen.value}))})};return new n.Component(t)}function v(){var e={dwVersion:new n.UInt32Le,cbCompanyName:new n.UInt32Le((function(){return e.pbCompanyName.size()})),pbCompanyName:new n.BinaryString(Buffer.from("Microsoft Corporation","ucs2"),{readLength:new n.CallableValue((function(){return e.cbCompanyName.value}))}),cbProductId:new n.UInt32Le((function(){return e.pbProductId.size()})),pbProductId:new n.BinaryString(Buffer.from("A02","ucs2"),{readLength:new n.CallableValue((function(){return e.cbProductId.value}))})};return new n.Component(e)}function y(){var e={scope:d(l)};return new n.Component(e)}function m(){var e={scopeCount:new n.UInt32Le((function(){return e.scopeArray.length})),scopeArray:new n.Factory((function(t){e.scopeArray=new n.Component([]);for(var r=0;r<e.scopeCount.value;r++)e.scopeArray.obj.push(y().read(t))}))};return new n.Component(e)}function b(e){var t={__TYPE__:o.NEW_LICENSE_REQUEST,preferredKeyExchangeAlg:new n.UInt32Le(1,{constant:!0}),platformId:new n.UInt32Le(67174400),clientRandom:new n.BinaryString(Buffer.from(Array(33).join("\0")),{readLength:new n.CallableValue(32)}),encryptedPreMasterSecret:d(c),ClientUserName:d(f),ClientMachineName:d(p)};return new n.Component(t,e)}function _(e){var t={__TYPE__:o.PLATFORM_CHALLENGE_RESPONSE,encryptedPlatformChallengeResponse:d(i),encryptedHWID:d(i),MACData:new n.BinaryString(Buffer.from(Array(17).join("\0"),"binary"),{readLength:new n.CallableValue(16)})};return new n.Component(t,e)}e.exports={MessageType:o,ErrorCode:{ERR_INVALID_SERVER_CERTIFICATE:1,ERR_NO_LICENSE:2,ERR_INVALID_SCOPE:4,ERR_NO_LICENSE_SERVER:6,STATUS_VALID_CLIENT:7,ERR_INVALID_CLIENT:8,ERR_INVALID_PRODUCTID:11,ERR_INVALID_MESSAGE_LEN:12,ERR_INVALID_MAC:3},StateTransition:{ST_TOTAL_ABORT:1,ST_NO_TRANSITION:2,ST_RESET_PHASE_TO_START:3,ST_RESEND_LAST_MESSAGE:4},licensePacket:function(e){var t={bMsgtype:new n.UInt8((function(){return t.licensingMessage.obj.__TYPE__})),flag:new n.UInt8(h),wMsgSize:new n.UInt16Le((function(){return new n.Component(t).size()})),licensingMessage:e||new n.Factory((function(e){switch(t.bMsgtype.value){case o.ERROR_ALERT:t.licensingMessage=function(e){var t={__TYPE__:o.ERROR_ALERT,dwErrorCode:new n.UInt32Le,dwStateTransition:new n.UInt32Le,blob:d(a)};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.LICENSE_REQUEST:t.licensingMessage=function(e){var t={__TYPE__:o.LICENSE_REQUEST,serverRandom:new n.BinaryString(Buffer.from(Array(33).join("\0")),{readLength:new n.CallableValue(32)}),productInfo:v(),keyExchangeList:d(u),serverCertificate:d(s),scopeList:m()};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.NEW_LICENSE_REQUEST:t.licensingMessage=b({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.PLATFORM_CHALLENGE:t.licensingMessage=function(e){var t={__TYPE__:o.PLATFORM_CHALLENGE,connectFlags:new n.UInt32Le,encryptedPlatformChallenge:d(a),MACData:new n.BinaryString(Buffer.from(Array(17).join("\0")),{readLength:new n.CallableValue(16)})};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.PLATFORM_CHALLENGE_RESPONSE:t.licensingMessage=_({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;default:log.error("unknown license message type "+t.bMsgtype.value)}}))};return new n.Component(t)},clientNewLicenseRequest:b,clientPLatformChallengeResponse:_}},1562:(e,t,r)=>{var n=r(9023).inherits,o=r(6982),a=r(6261),i=r(5784).type,c=r(5784).error,s=r(5784).log,u=r(1381),l=r(1959),f=r(8701),p=r(8597).rsa,h=64,d=128,v={INFO_MOUSE:1,INFO_DISABLECTRLALTDEL:2,INFO_AUTOLOGON:8,INFO_UNICODE:16,INFO_MAXIMIZESHELL:32,INFO_LOGONNOTIFY:64,INFO_COMPRESSION:128,INFO_ENABLEWINDOWSKEY:256,INFO_REMOTECONSOLEAUDIO:8192,INFO_FORCE_ENCRYPTED_CS_PDU:16384,INFO_RAIL:32768,INFO_LOGONERRORS:65536,INFO_MOUSE_HAS_WHEEL:131072,INFO_PASSWORD_IS_SC_PIN:262144,INFO_NOAUDIOPLAYBACK:524288,INFO_USING_SAVED_CREDS:1048576,INFO_AUDIOCAPTURE:2097152,INFO_VIDEO_DISABLE:4194304,INFO_CompressionTypeMask:7680},y=2;function m(e,t,r,n){var a=o.createHash("sha1");a.update(e),a.update(t.slice(0,48)),a.update(r),a.update(n);var i=a.digest(),c=o.createHash("md5");return c.update(t.slice(0,48)),c.update(i),c.digest()}function b(e,t,r){var n=m(Buffer.from("A"),e,t,r),o=m(Buffer.from("BB"),e,t,r),a=m(Buffer.from("CCC"),e,t,r),i=Buffer.alloc(n.length+o.length+a.length);return n.copy(i),o.copy(i,n.length),a.copy(i,n.length+o.length),i}function _(e){var t={clientAddressFamily:new i.UInt16Le(y),cbClientAddress:new i.UInt16Le((function(){return t.clientAddress.size()})),clientAddress:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbClientAddress}))}),cbClientDir:new i.UInt16Le((function(){return t.clientDir.size()})),clientDir:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbClientDir}))}),clientTimeZone:new i.BinaryString(Buffer.from(Array(173).join("\0"))),clientSessionId:new i.UInt32Le,performanceFlags:new i.UInt32Le};return new i.Component(t,e)}function g(e,t){this.transport=e,this.fastPathTransport=t,this.gccClient=null,this.gccServer=null;var r=this;this.infos=function(e){var t={codePage:new i.UInt32Le,flag:new i.UInt32Le(v.INFO_MOUSE|v.INFO_UNICODE|v.INFO_LOGONNOTIFY|v.INFO_LOGONERRORS|v.INFO_DISABLECTRLALTDEL|v.INFO_ENABLEWINDOWSKEY),cbDomain:new i.UInt16Le((function(){return t.domain.size()-2})),cbUserName:new i.UInt16Le((function(){return t.userName.size()-2})),cbPassword:new i.UInt16Le((function(){return t.password.size()-2})),cbAlternateShell:new i.UInt16Le((function(){return t.alternateShell.size()-2})),cbWorkingDir:new i.UInt16Le((function(){return t.workingDir.size()-2})),domain:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbDomain.value+2}))}),userName:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbUserName.value+2}))}),password:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbPassword.value+2}))}),alternateShell:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbAlternateShell.value+2}))}),workingDir:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbWorkingDir.value+2}))}),extendedInfo:_({conditional:e})};return new i.Component(t)}((function(){return r.gccClient.core.rdpVersion.value===u.VERSION.RDP_VERSION_5_PLUS})),this.machineName="",this.enableEncryption=!1,this.fastPathTransport&&this.fastPathTransport.on("fastPathData",(function(e,t){r.recvFastPath(e,t)}))}function E(e,t){g.call(this,e,t),this.enableSecureCheckSum=!1;var r=this;this.transport.on("connect",(function(e,t,n,o){r.connect(e,t,n,o)})).on("close",(function(){r.emit("close")})).on("error",(function(e){r.emit("error",e)}))}function w(e){for(var t=Buffer.alloc(e.length),r=0;r<e.length;r++)t.writeUInt8(e.readUInt8(e.length-1-r),r);return t}n(g,a.EventEmitter),g.prototype.sendFlagged=function(e,t){this.transport.send("global",new i.Component([new i.UInt16Le(e),new i.UInt16Le,t]))},g.prototype.send=function(e){if(this.enableEncryption)throw new c.FatalError("NODE_RDP_PROTOCOL_PDU_SEC_ENCRYPT_NOT_IMPLEMENTED");this.transport.send("global",e)},g.prototype.recv=function(e){if(this.enableEncryption)throw new c.FatalError("NODE_RDP_PROTOCOL_PDU_SEC_ENCRYPT_NOT_IMPLEMENTED");this.emit("data",e)},g.prototype.recvFastPath=function(e,t){this.emit("fastPathData",e,t)},n(E,g),E.prototype.connect=function(e,t,r,n){this.gccClient=e,this.gccServer=t,this.userId=r,this.channelId=n.find((function(e){if("global"===e.name)return!0})).id,this.sendInfoPkt()},E.prototype.close=function(){this.transport.close()},E.prototype.sendInfoPkt=function(){this.sendFlagged(h,this.infos);var e=this;this.transport.once("global",(function(t){e.recvLicense(t)}))},E.prototype.sendClientNewLicenseRequest=function(e){s.debug("new license request");var t,r,n,a,c=e.serverRandom.value,u=new i.Stream(e.serverCertificate.obj.blobData.value),h=f.certificate().read(u).obj.certData.obj.getPublicKey(),v=o.randomBytes(32),y=o.randomBytes(48),m=b(y,v,c),_=b(m,c,v);this.licenseMacSalt=_.slice(0,16),this.licenseKey=(t=_.slice(16,32),r=v,n=c,(a=o.createHash("md5")).update(t),a.update(r),a.update(n),a.digest());var g=l.clientNewLicenseRequest();g.obj.clientRandom.value=v;var E=w(p.encrypt(w(y),h)),P=Buffer.alloc(E.length+8);P.fill(0),E.copy(P),g.obj.encryptedPreMasterSecret.obj.blobData.value=P,g.obj.ClientMachineName.obj.blobData.value=this.infos.obj.userName.value,g.obj.ClientUserName.obj.blobData.value=Buffer.from(this.machineName+"\0"),this.sendFlagged(d,l.licensePacket(g))},E.prototype.sendClientChallengeResponse=function(e){s.debug("challenge license");var t=e.encryptedPlatformChallenge.obj.blobData.value,r=o.createDecipheriv("rc4",this.licenseKey,"").update(t);if("TEST\0"!==r.toString("ucs2"))throw new c.ProtocolError("NODE_RDP_PROTOCOL_PDU_SEC_INVALID_LICENSE_CHALLENGE");var n=new i.Component([new i.UInt32Le(2),new i.BinaryString(o.randomBytes(16))]).toStream().buffer,a=l.clientPLatformChallengeResponse();a.obj.encryptedPlatformChallengeResponse.obj.blobData.value=t,a.obj.encryptedHWID.obj.blobData.value=o.createCipheriv("rc4",this.licenseKey,"").update(n);var u=Buffer.alloc(r.length+n.length);r.copy(u),n.copy(u,r.length),a.obj.MACData.value=function(e,t){var r=Buffer.alloc(40);r.fill(54);var n=Buffer.alloc(48);n.fill(92);var a=new i.UInt32Le(t.length).toStream().buffer,c=o.createHash("sha1");c.update(e),c.update(r),c.update(a),c.update(t);var s=c.digest(),u=o.createHash("md5");return u.update(e),u.update(n),u.update(s),u.digest()}(this.licenseMacSalt,u),this.sendFlagged(d,l.licensePacket(a))},g.prototype.recvLicense=function(e){var t=function(){var e={securityFlag:new i.UInt16Le,securityFlagHi:new i.UInt16Le};return new i.Component(e)}().read(e).obj;if(!(t.securityFlag.value&d))throw new c.ProtocolError("NODE_RDP_PROTOCOL_PDU_SEC_BAD_LICENSE_HEADER");var r=l.licensePacket().read(e).obj;if(r.bMsgtype.value===l.MessageType.NEW_LICENSE||r.bMsgtype.value===l.MessageType.ERROR_ALERT&&r.licensingMessage.obj.dwErrorCode.value===l.ErrorCode.STATUS_VALID_CLIENT&&r.licensingMessage.obj.dwStateTransition.value===l.StateTransition.ST_NO_TRANSITION){this.emit("connect",this.gccClient.core,this.userId,this.channelId);var n=this;this.transport.on("global",(function(e){n.recv(e)}))}else{r.bMsgtype.value===l.MessageType.LICENSE_REQUEST&&this.sendClientNewLicenseRequest(r.licensingMessage.obj),r.bMsgtype.value===l.MessageType.PLATFORM_CHALLENGE&&this.sendClientChallengeResponse(r.licensingMessage.obj);n=this;this.emit("connect",this.gccClient.core),this.transport.once("global",(function(e){n.recvLicense(e)}))}},e.exports={PerfFlag:{PERF_DISABLE_WALLPAPER:1,PERF_DISABLE_FULLWINDOWDRAG:2,PERF_DISABLE_MENUANIMATIONS:4,PERF_DISABLE_THEMING:8,PERF_DISABLE_CURSOR_SHADOW:32,PERF_DISABLE_CURSORSETTINGS:64,PERF_ENABLE_FONT_SMOOTHING:128,PERF_ENABLE_DESKTOP_COMPOSITION:256},InfoFlag:v,Client:E}},4077:(e,t,r)=>{var n=r(9278),o=r(9023).inherits,a=r(6261),i=r(5784).layer,c=r(5784).error,s=r(5784).rle,u=r(5784).log,l=r(2008),f=r(5599),p=r(1018),h=r(2503);function d(e){var t=null;switch(e.bitsPerPixel.value){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var r=new Uint8Array(e.bitmapDataStream.value),n=s._malloc(r.length),o=new Uint8Array(s.HEAPU8.buffer,n,r.length);o.set(r);var a=e.width.value*e.height.value*4,i=s._malloc(a),c=new Uint8Array(s.HEAPU8.buffer,i,a),u=(s.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,e.width.value,e.height.value,e.width.value,e.height.value,o.byteOffset,r.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,a));return s._free(n),s._free(i),u}function v(e){var t=this;if(e=e||{},this.connected=!1,this.bufferLayer=new i.BufferLayer(new n.Socket),this.tpkt=new l(this.bufferLayer),this.x224=new f.Client(this.tpkt,e),this.mcs=new p.mcs.Client(this.x224),this.sec=new h.sec.Client(this.mcs,this.tpkt),this.cliprdr=new h.cliprdr.Client(this.mcs),this.global=new h.global.Client(this.sec,this.sec),u.level=u.Levels[e.logLevel||"INFO"]||u.Levels.INFO,e.domain&&(this.sec.infos.obj.domain.value=Buffer.from(e.domain+"\0","ucs2")),e.userName&&(this.sec.infos.obj.userName.value=Buffer.from(e.userName+"\0","ucs2")),e.password&&(this.sec.infos.obj.password.value=Buffer.from(e.password+"\0","ucs2")),e.workingDir&&(this.sec.infos.obj.workingDir.value=Buffer.from(e.workingDir+"\0","ucs2")),e.alternateShell&&(this.sec.infos.obj.alternateShell.value=Buffer.from(e.alternateShell+"\0","ucs2")),null!=e.perfFlags?this.sec.infos.obj.extendedInfo.obj.performanceFlags.value=e.perfFlags:e.enablePerf&&(this.sec.infos.obj.extendedInfo.obj.performanceFlags.value=h.sec.PerfFlag.PERF_DISABLE_WALLPAPER|h.sec.PerfFlag.PERF_DISABLE_MENUANIMATIONS|h.sec.PerfFlag.PERF_DISABLE_CURSOR_SHADOW|h.sec.PerfFlag.PERF_DISABLE_THEMING|h.sec.PerfFlag.PERF_DISABLE_FULLWINDOWDRAG),e.autoLogin&&(this.sec.infos.obj.flag.value|=h.sec.InfoFlag.INFO_AUTOLOGON),e.screen&&e.screen.width&&e.screen.height&&(this.mcs.clientCoreData.obj.desktopWidth.value=e.screen.width,this.mcs.clientCoreData.obj.desktopHeight.value=e.screen.height),u.debug("screen "+this.mcs.clientCoreData.obj.desktopWidth.value+"x"+this.mcs.clientCoreData.obj.desktopHeight.value),"fr"===e.locale)u.debug("french keyboard layout"),this.mcs.clientCoreData.obj.kbdLayout.value=p.gcc.KeyboardLayout.FRENCH;else u.debug("english keyboard layout"),this.mcs.clientCoreData.obj.kbdLayout.value=p.gcc.KeyboardLayout.US;this.cliprdr.on("clipboard",(function(e){t.emit("clipboard",e)}));var r=this;this.global.on("connect",(function(){r.connected=!0,r.emit("connect")})).on("session",(function(){r.emit("session")})).on("close",(function(){r.connected=!1,r.emit("close")})).on("pointer",(function(e,t){r.emit("pointer",e,t)})).on("bitmap",(function(t){for(var n in t){var o=t[n].obj.bitmapDataStream.value,a=t[n].obj.flags.value&h.data.BitmapFlag.BITMAP_COMPRESSION;a&&e.decompress&&(o=d(t[n].obj),a=!1),r.emit("bitmap",{destTop:t[n].obj.destTop.value,destLeft:t[n].obj.destLeft.value,destBottom:t[n].obj.destBottom.value,destRight:t[n].obj.destRight.value,width:t[n].obj.width.value,height:t[n].obj.height.value,bitsPerPixel:t[n].obj.bitsPerPixel.value,isCompress:a,data:o})}})).on("error",(function(e){if(u.warn(e.code+"("+e.message+")\n"+e.stack),e instanceof c.FatalError)throw e;r.emit("error",e)}))}function y(e,t){if(!e.key||!e.cert)throw new c.FatalError("NODE_RDP_PROTOCOL_RDP_SERVER_CONFIG_MISSING","missing cryptographic tools");this.connected=!1,this.bufferLayer=new i.BufferLayer(t),this.tpkt=new l(this.bufferLayer),this.x224=new f.Server(this.tpkt,e.key,e.cert),this.mcs=new p.mcs.Server(this.x224)}o(v,a.EventEmitter),v.prototype.connect=function(e,t){u.debug("connect to "+e+":"+t);var r=this;return this.bufferLayer.socket.connect(t,e,(function(){r.x224.connect()})),this},v.prototype.close=function(){return this.connected&&this.global.close(),this.connected=!1,this},v.prototype.sendPointerEvent=function(e,t,r,n){if(this.connected){var o=h.data.pointerEvent();switch(n&&(o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_DOWN),r){case 1:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON1;break;case 2:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON2;break;case 3:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON3;break;default:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_MOVE}o.obj.xPos.value=e,o.obj.yPos.value=t,this.global.sendInputEvents([o])}},v.prototype.sendKeyEventScancode=function(e,t,r){if(this.connected){r=r||!1;var n=h.data.scancodeKeyEvent();n.obj.keyCode.value=e,t||(n.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_RELEASE),r&&(n.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_EXTENDED),this.global.sendInputEvents([n])}},v.prototype.sendKeyEventUnicode=function(e,t){if(this.connected){var r=h.data.unicodeKeyEvent();r.obj.unicode.value=e,t||(r.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_RELEASE),this.global.sendInputEvents([r])}},v.prototype.sendWheelEvent=function(e,t,r,n,o){if(this.connected){var a=h.data.pointerEvent();a.obj.pointerFlags.value|=o?h.data.PointerFlag.PTRFLAGS_HWHEEL:h.data.PointerFlag.PTRFLAGS_WHEEL,n&&(a.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_WHEEL_NEGATIVE),a.obj.pointerFlags.value|=r&h.data.PointerFlag.WheelRotationMask,a.obj.xPos.value=e,a.obj.yPos.value=t,this.global.sendInputEvents([a])}},v.prototype.setClipboardData=function(e){this.cliprdr.setClipboardData(e)},o(y,a.EventEmitter),e.exports={createClient:function(e){return new v(e)},createServer:function(e,t){return n.createServer((function(r){t(new y(e,r))}))}}},1381:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(5784).error,i=r(2301),c=[0,0,20,124,0,1],s="Duca",u="McDn",l={SC_CORE:3073,SC_SECURITY:3074,SC_NET:3075,CS_CORE:49153,CS_SECURITY:49154,CS_NET:49155,CS_CLUSTER:49156,CS_MONITOR:49157},f=51713,p=24,h=1,d=2,v=4,y=8,m=1,b={RDP_VERSION_4:524289,RDP_VERSION_5_PLUS:524292},_=43523,g=1,E=2,w=8,P=4,S={ARABIC:1025,BULGARIAN:1026,CHINESE_US_KEYBOARD:1028,CZECH:1029,DANISH:1030,GERMAN:1031,GREEK:1032,US:1033,SPANISH:1034,FINNISH:1035,FRENCH:1036,HEBREW:1037,HUNGARIAN:1038,ICELANDIC:1039,ITALIAN:1040,JAPANESE:1041,KOREAN:1042,DUTCH:1043,NORWEGIAN:1044};function k(e){var t={type:new n.UInt16Le((function(){return t.data.obj.__TYPE__})),length:new n.UInt16Le((function(){return new n.Component(t).size()})),data:e||new n.Factory((function(e){var r={readLength:new n.CallableValue((function(){return t.length.value-4}))};switch(t.type.value){case l.SC_CORE:t.data=T(r).read(e);break;case l.SC_SECURITY:t.data=L(r).read(e);break;case l.SC_NET:t.data=I(null,r).read(e);break;case l.CS_CORE:t.data=A(r).read(e);break;case l.CS_SECURITY:t.data=O(r).read(e);break;case l.CS_NET:t.data=x(null,r).read(e);break;default:o.debug("unknown gcc block type "+t.type.value),t.data=new n.BinaryString(null,r).read(e)}}))};return new n.Component(t)}function A(e){var t={__TYPE__:l.CS_CORE,rdpVersion:new n.UInt32Le(b.RDP_VERSION_5_PLUS),desktopWidth:new n.UInt16Le(1280),desktopHeight:new n.UInt16Le(800),colorDepth:new n.UInt16Le(f),sasSequence:new n.UInt16Le(_),kbdLayout:new n.UInt32Le(S.FRENCH),clientBuild:new n.UInt32Le(3790),clientName:new n.BinaryString(Buffer.from("node-rdpjs\0\0\0\0\0\0","ucs2"),{readLength:new n.CallableValue(32)}),keyboardType:new n.UInt32Le(P),keyboardSubType:new n.UInt32Le(0),keyboardFnKeys:new n.UInt32Le(12),imeFileName:new n.BinaryString(Buffer.from(Array(65).join("\0")),{readLength:new n.CallableValue(64),optional:!0}),postBeta2ColorDepth:new n.UInt16Le(f,{optional:!0}),clientProductId:new n.UInt16Le(1,{optional:!0}),serialNumber:new n.UInt32Le(0,{optional:!0}),highColorDepth:new n.UInt16Le(p,{optional:!0}),supportedColorDepths:new n.UInt16Le(v|d|h|y,{optional:!0}),earlyCapabilityFlags:new n.UInt16Le(m,{optional:!0}),clientDigProductId:new n.BinaryString(Buffer.from(Array(65).join("\0")),{optional:!0,readLength:new n.CallableValue(64)}),connectionType:new n.UInt8(0,{optional:!0}),pad1octet:new n.UInt8(0,{optional:!0}),serverSelectedProtocol:new n.UInt32Le(0,{optional:!0})};return new n.Component(t,e)}function T(e){var t={__TYPE__:l.SC_CORE,rdpVersion:new n.UInt32Le(b.RDP_VERSION_5_PLUS),clientRequestedProtocol:new n.UInt32Le(null,{optional:!0}),earlyCapabilityFlags:new n.UInt32Le(null,{optional:!0})};return new n.Component(t,e)}function O(e){var t={__TYPE__:l.CS_SECURITY,encryptionMethods:new n.UInt32Le(g|w|E),extEncryptionMethods:new n.UInt32Le};return new n.Component(t,e)}function L(e){var t={__TYPE__:l.SC_SECURITY,encryptionMethod:new n.UInt32Le,encryptionLevel:new n.UInt32Le};return new n.Component(t,e)}function C(e){var t={name:new n.BinaryString(null,{readLength:new n.CallableValue(8)}),options:new n.UInt32Le};return new n.Component(t,e)}function x(e,t){var r={__TYPE__:l.CS_NET,channelCount:new n.UInt32Le((function(){return r.channelDefArray.obj.length})),channelDefArray:e||new n.Factory((function(e){r.channelDefArray=new n.Component([]);for(var t=0;t<r.channelCount.value;t++)r.channelDefArray.obj.push(C().read(e))}))};return new n.Component(r,t)}function I(e,t){var r={__TYPE__:l.SC_NET,MCSChannelId:new n.UInt16Le(1003,{constant:!0}),channelCount:new n.UInt16Le((function(){return r.channelIdArray.obj.length})),channelIdArray:e||new n.Factory((function(e){r.channelIdArray=new n.Component([]);for(var t=0;t<r.channelCount.value;t++)r.channelIdArray.obj.push((new n.UInt16Le).read(e))})),pad:new n.UInt16Le(null,{conditional:function(){return r.channelCount.value%2==1}})};return new n.Component(r,t)}function H(e,t){var r={blocks:e||new n.Factory((function(e){for(r.blocks=new n.Component([]);e.availableLength()>0;)r.blocks.obj.push(k().read(e))}))};return new n.Component(r,t)}e.exports={MessageType:l,VERSION:b,KeyboardLayout:S,block:k,clientCoreData:A,clientNetworkData:x,clientSecurityData:O,serverCoreData:T,serverSecurityData:L,serverNetworkData:I,readConferenceCreateResponse:function(e){if(i.readChoice(e),!i.readObjectIdentifier(e,c))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_OBJECT_IDENTIFIER_T124");if(i.readLength(e),i.readChoice(e),i.readInteger16(e,1001),i.readInteger(e),i.readEnumerates(e),i.readNumberOfSet(e),i.readChoice(e),!i.readOctetStream(e,u,4))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_H221_SC_KEY");return length=i.readLength(e),serverSettings=H(null,{readLength:new n.CallableValue(length)}),serverSettings.read(e).obj.blocks.obj.map((function(e){return e.obj.data}))},readConferenceCreateRequest:function(e){if(i.readChoice(e),!i.readObjectIdentifier(e,c))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_H221_SC_KEY");if(i.readLength(e),i.readChoice(e),i.readSelection(e),i.readNumericString(e,1),i.readPadding(e,1),1!==i.readNumberOfSet(e))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_SET");if(192!==i.readChoice(e))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_CHOICE");return i.readOctetStream(e,s,4),length=i.readLength(e),H(null,{readLength:new n.CallableValue(length)}).read(e).obj.blocks.obj.map((function(e){return e.obj.data}))},writeConferenceCreateRequest:function(e){var t=new n.Stream(e.size());return e.write(t),new n.Component([i.writeChoice(0),i.writeObjectIdentifier(c),i.writeLength(e.size()+14),i.writeChoice(0),i.writeSelection(8),i.writeNumericString("1",1),i.writePadding(1),i.writeNumberOfSet(1),i.writeChoice(192),i.writeOctetStream(Buffer.from(s),4),i.writeOctetStream(t.getValue())])},writeConferenceCreateResponse:function(e){var t=new n.Stream(e.size());return e.write(t),new n.Component([i.writeChoice(0),i.writeObjectIdentifier(c),i.writeLength(e.size()+14),i.writeChoice(20),i.writeInteger16(31219,1001),i.writeInteger(1),i.writeEnumerates(0),i.writeNumberOfSet(1),i.writeChoice(192),i.writeOctetStream(Buffer.from(u),4),i.writeOctetStream(t.getValue())])}}},1018:(e,t,r)=>{var n=r(4895),o=r(1381);e.exports={mcs:n,gcc:o}},4895:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(5784).type,i=r(5784).log,c=r(5784).error,s=r(1381),u=r(2301),l=r(5002),f=(r(2461),1),p=8,h=10,d=11,v=14,y=15,m=25,b=26,_=1003,g=1001,E=1005,w=new a.Component({name:new a.BinaryString(Buffer.from("rdpdr\0\0\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(2155872256)}),P=new a.Component({name:new a.BinaryString(Buffer.from("rdpsnd\0\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(3221225472)}),S=new a.Component({name:new a.BinaryString(Buffer.from("cliprdr\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(3231711232)});function k(e,t,r,n,o,a,i,c){return new l.univ.Sequence({maxChannelIds:new l.univ.Integer(e),maxUserIds:new l.univ.Integer(t),maxTokenIds:new l.univ.Integer(r),numPriorities:new l.univ.Integer(n),minThoughput:new l.univ.Integer(o),maxHeight:new l.univ.Integer(a),maxMCSPDUsize:new l.univ.Integer(i),protocolVersion:new l.univ.Integer(c)})}function A(e){return new l.univ.Sequence({callingDomainSelector:new l.univ.OctetString(Buffer.from("","binary")),calledDomainSelector:new l.univ.OctetString(Buffer.from("","binary")),upwardFlag:new l.univ.Boolean(!0),targetParameters:k(34,2,0,1,0,1,65535,2),minimumParameters:k(1,1,1,1,0,1,1056,2),maximumParameters:k(65535,64535,65535,1,0,1,65535,2),userData:new l.univ.OctetString(e)}).implicitTag(new l.spec.Asn1Tag(l.spec.TagClass.Application,l.spec.TagFormat.Constructed,101))}function T(e){return new l.univ.Sequence({result:new l.univ.Enumerate(0),calledConnectId:new l.univ.Integer(0),domainParameters:k(22,3,0,1,0,1,65528,2),userData:new l.univ.OctetString(e)}).implicitTag(new l.spec.Asn1Tag(l.spec.TagClass.Application,l.spec.TagFormat.Constructed,102))}function O(e,t){return t=t||0,new a.UInt8(e<<2|t)}function L(e,t){return e>>2===t}function C(e,t,r){this.transport=e,this.recvOpCode=t,this.sendOpCode=r,this.channels=[{id:_,name:"global"},{id:E,name:"cliprdr"}],this.channels.find=function(e){for(var t in this)if(e(this[t]))return this[t]};var n=this;this.transport.on("close",(function(){n.emit("close")})).on("error",(function(e){n.emit("error",e)}))}function x(e){C.call(this,e,b,m),this.channelsConnected=0,this.clientCoreData=s.clientCoreData(),this.clientNetworkData=s.clientNetworkData(new a.Component([w,S,P])),this.clientSecurityData=s.clientSecurityData(),this.serverCoreData=null,this.serverSecurityData=null,this.serverNetworkData=null;var t=this;this.transport.on("connect",(function(e){t.connect(e)}))}function I(e){C.call(this,e,m,b),this.clientCoreData=null,this.clientNetworkData=null,this.clientSecurityData=null,this.serverCoreData=s.serverCoreData(),this.serverSecurityData=s.serverSecurityData(),this.serverNetworkData=s.serverNetworkData(new a.Component([]));var t=this;this.transport.on("connect",(function(e){t.serverCoreData.obj.clientRequestedProtocol.value=e})).once("data",(function(e){t.recvConnectInitial(e)}))}n(C,o.EventEmitter),C.prototype.send=function(e,t){var r=this.channels.find((function(t){if(t.name===e)return!0})).id;this.transport.send(new a.Component([O(this.sendOpCode),u.writeInteger16(this.userId,g),u.writeInteger16(r),new a.UInt8(112),u.writeLength(t.size()),t]))},C.prototype.recv=function(e){if(opcode=(new a.UInt8).read(e).value,L(opcode,p))return i.info("MCS DISCONNECT_PROVIDER_ULTIMATUM"),void this.transport.close();if(!L(opcode,this.recvOpCode))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_BAD_RECEIVE_OPCODE");u.readInteger16(e,g);var t=u.readInteger16(e);u.readEnumerates(e),u.readLength(e);var r=this.channels.find((function(e){if(e.id===t)return!0})).name;this.emit(r,e)},n(x,C),x.prototype.connect=function(e){this.clientCoreData.obj.serverSelectedProtocol.value=e,this.sendConnectInitial()},x.prototype.close=function(){this.transport.close()},x.prototype.recvConnectResponse=function(e){var t=new a.Stream(T().decode(e,l.ber).value.userData.value),r=s.readConferenceCreateResponse(t);for(var n in r)if(r[n].obj)switch(r[n].obj.__TYPE__){case s.MessageType.SC_CORE:this.serverCoreData=r[n];break;case s.MessageType.SC_SECURITY:this.serverSecurityData=r[n];break;case s.MessageType.SC_NET:this.serverNetworkData=r[n];break;default:i.warn("unhandle server gcc block : "+r[n].obj.__TYPE__)}this.sendErectDomainRequest(),this.sendAttachUserRequest();var o=this;this.transport.once("data",(function(e){o.recvAttachUserConfirm(e)}))},x.prototype.recvAttachUserConfirm=function(e){if(!L((new a.UInt8).read(e).value,d))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_BAD_HEADER");if(0!==u.readEnumerates(e))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_SERVER_REJECT_USER");this.userId=u.readInteger16(e,g),this.channels.push({id:this.userId,name:"user"}),this.connectChannels()},x.prototype.recvChannelJoinConfirm=function(e){if(!L((new a.UInt8).read(e).value,y))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_WAIT_CHANNEL_JOIN_CONFIRM");var t=u.readEnumerates(e),r=u.readInteger16(e,g);if(this.userId!==r)throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_INVALID_USER_ID");var n=u.readInteger16(e);if(0!==t&&(n===E||n===_||n===this.userId))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_SERVER_MUST_CONFIRM_STATIC_CHANNEL");this.connectChannels()},x.prototype.sendConnectInitial=function(){var e=s.writeConferenceCreateRequest(new a.Component([s.block(this.clientCoreData),s.block(this.clientNetworkData),s.block(this.clientSecurityData)])).toStream().getValue();this.transport.send(A(e).encode(l.ber));var t=this;this.transport.once("data",(function(e){t.recvConnectResponse(e)}))},x.prototype.sendErectDomainRequest=function(){this.transport.send(new a.Component([O(f),u.writeInteger(0),u.writeInteger(0)]))},x.prototype.sendAttachUserRequest=function(){this.transport.send(O(h))},x.prototype.sendChannelJoinRequest=function(e){this.transport.send(new a.Component([O(v),u.writeInteger16(this.userId,g),u.writeInteger16(e)]))},x.prototype.connectChannels=function(e){if(this.channelsConnected==this.channels.length){var t=this;return this.transport.on("data",(function(e){t.recv(e)})),void this.emit("connect",{core:this.clientCoreData.obj,security:this.clientSecurityData.obj,net:this.clientNetworkData.obj},{core:this.serverCoreData.obj,security:this.serverSecurityData.obj},this.userId,this.channels)}this.sendChannelJoinRequest(this.channels[this.channelsConnected++].id);t=this;this.transport.once("data",(function(e){t.recvChannelJoinConfirm(e)}))},n(I,C),I.prototype.recvConnectInitial=function(e){var t=new a.Stream(A().decode(e,l.ber).value.userData.value),r=s.readConferenceCreateRequest(t);for(var n in r)if(r[n].obj)switch(r[n].obj.__TYPE__){case s.MessageType.CS_CORE:this.clientCoreData=r[n];break;case s.MessageType.CS_SECURITY:this.clientSecurityData=r[n];break;case s.MessageType.CS_NET:this.clientNetworkData=r[n];for(n=0;n<this.clientNetworkData.obj.channelCount.value;n++)this.serverNetworkData.obj.channelIdArray.obj.push(new a.UInt16Le(n+1+_));break;default:i.debug("unhandle client gcc block : "+r[n].obj.__TYPE__)}this.sendConnectResponse()},I.prototype.sendConnectResponse=function(){var e=s.writeConferenceCreateResponse(new a.Component([s.block(this.serverCoreData),s.block(this.serverSecurityData),s.block(this.serverNetworkData)])).toStream().getValue();this.transport.send(T(e).encode(l.ber))},e.exports={Client:x,Server:I}},2301:(e,t,r)=>{var n=r(5784).type,o=r(5784).error;function a(e){var t=(new n.UInt8).read(e).value,r=0;return 128&t?(r=(t&=-129)<<8,r+=(new n.UInt8).read(e).value):r=t,r}function i(e){return e>127?new n.UInt16Be(32768|e):new n.UInt8(e)}e.exports={readLength:a,writeLength:i,readChoice:function(e){return(new n.UInt8).read(e).value},writeChoice:function(e){return new n.UInt8(e)},readSelection:function(e){return(new n.UInt8).read(e).value},writeSelection:function(e){return new n.UInt8(e)},readNumberOfSet:function(e){return(new n.UInt8).read(e).value},writeNumberOfSet:function(e){return new n.UInt8(e)},readEnumerates:function(e){return(new n.UInt8).read(e).value},writeEnumerates:function(e){return new n.UInt8(e)},readInteger:function(e){var t;switch(a(e)){case 1:t=new n.UInt8;break;case 2:t=new n.UInt16Be;break;case 4:t=new n.UInt32Be;break;default:throw new o.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_PER_BAD_INTEGER_LENGTH")}return t.read(e).value},writeInteger:function(e){return e<=255?new n.Component([i(1),new n.UInt8(e)]):e<65535?new n.Component([i(2),new n.UInt16Be(e)]):new n.Component([i(4),new n.UInt32Be(e)])},readInteger16:function(e,t){return(new n.UInt16Be).read(e).value+(t||0)},writeInteger16:function(e,t){return new n.UInt16Be(e-(t||0))},readObjectIdentifier:function(e,t){if(5!==a(e))return!1;var r=[0,0,0,0,0,0],o=(new n.UInt8).read(e).value;for(var i in r[0]=o>>4,r[1]=15&o,r[2]=(new n.UInt8).read(e).value,r[3]=(new n.UInt8).read(e).value,r[4]=(new n.UInt8).read(e).value,r[5]=(new n.UInt8).read(e).value,t)if(t[i]!==r[i])return!1;return!0},writeObjectIdentifier:function(e){return new n.Component([new n.UInt8(5),new n.UInt8(e[0]<<4&15&e[1]),new n.UInt8(e[2]),new n.UInt8(e[3]),new n.UInt8(e[4]),new n.UInt8(e[5])])},readNumericString:function(e,t){var r=a(e);r=(r+t+1)/2,e.readPadding(r)},writeNumericString:function(e,t){var r=e.length,o=t;r-t>=0&&(o=r-t);for(var a=[],c=0;c<r;c+=2){var s=e.charCodeAt(c),u=0;s=(s-48)%10,u=((u=c+1<r?e.charCodeAt(c+1):48)-48)%10,a[a.length]=new n.UInt8(s<<4|u)}return new n.Component([i(o),new n.Component(a)])},readPadding:function(e,t){e.readPadding(t)},writePadding:function(e){return new n.BinaryString(Buffer.from(Array(e+1).join("\0")))},readOctetStream:function(e,t,r){var o=a(e)+(r||0);if(o!==t.length)return!1;for(var i=0;i<o;i++){var c=(new n.UInt8).read(e);if(t.charCodeAt(i)!==c.value)return!1}return!0},writeOctetStream:function(e,t){t=t||0;var r=e.length,o=t;r-t>=0&&(o=r-t),result=[];for(var a=0;a<r;a++)result[result.length]=new n.UInt8(e[a]);return new n.Component([i(o),new n.Component(result)])}}},2008:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(6261),i=3;function c(e){this.transport=e,this.transport.expect(2);var t=this;this.transport.once("data",(function(e){t.recvHeader(e)})).on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)}))}n(c,a.EventEmitter),c.prototype.recvHeader=function(e){var t=(new o.UInt8).read(e).value,r=this;if(t===i)(new o.UInt8).read(e),this.transport.expect(2),this.transport.once("data",(function(e){r.recvExtendedHeader(e)}));else{this.secFlag=t>>6&3;var n=(new o.UInt8).read(e).value;128&n?(this.transport.expect(1),this.transport.once("data",(function(e){r.recvExtendedFastPathHeader(e,n)}))):(this.transport.expect(n-2),this.transport.once("data",(function(e){r.recvFastPath(e)})))}},c.prototype.recvExtendedHeader=function(e){var t=(new o.UInt16Be).read(e);this.transport.expect(t.value-4);var r=this;this.transport.once("data",(function(e){r.recvData(e)}))},c.prototype.recvData=function(e){this.emit("data",e),this.transport.expect(2);var t=this;this.transport.once("data",(function(e){t.recvHeader(e)}))},c.prototype.recvExtendedFastPathHeader=function(e,t){var r=((-129&t)<<8)+(new o.UInt8).read(e).value,n=this;this.transport.expect(r-3),this.transport.once("data",(function(e){n.recvFastPath(e)}))},c.prototype.recvFastPath=function(e){this.emit("fastPathData",this.secFlag,e);var t=this;this.transport.expect(2),this.transport.once("data",(function(e){t.recvHeader(e)}))},c.prototype.send=function(e){this.transport.send(new o.Component([new o.UInt8(i),new o.UInt8(0),new o.UInt16Be(e.size()+4),e]))},c.prototype.close=function(){this.transport.close()},e.exports=c},5599:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(5784).type,i=r(5784).log,c=(r(5784).error,224),s=208,u=240,l=1,f=2,p=3,h={PROTOCOL_RDP:0,PROTOCOL_SSL:1,PROTOCOL_HYBRID:2,PROTOCOL_HYBRID_EX:8};function d(e){var t={type:new a.UInt8,flag:new a.UInt8,length:new a.UInt16Le(8,{constant:!0}),result:new a.UInt32Le};return new a.Component(t,e)}function v(e,t){var r={len:new a.UInt8((function(){return new a.Component(r).size()-1})),code:new a.UInt8(c,{constant:!0}),padding:new a.Component([new a.UInt16Le,new a.UInt16Le,new a.UInt8]),cookie:t||new a.Factory((function(e){for(var t=0;;){if(2573===e.buffer.readUInt16LE(e.offset+t))return void(r.cookie=new a.BinaryString(null,{readLength:new a.CallableValue(t+2)}).read(e));t+=1}}),{conditional:function(){return r.len.value>14}}),protocolNeg:d({optional:!0})};return new a.Component(r,e)}function y(e){var t={len:new a.UInt8((function(){return new a.Component(t).size()-1})),code:new a.UInt8(s,{constant:!0}),padding:new a.Component([new a.UInt16Le,new a.UInt16Le,new a.UInt8]),protocolNeg:d({optional:!0})};return new a.Component(t,e)}function m(){var e={header:new a.UInt8(2),messageType:new a.UInt8(u,{constant:!0}),separator:new a.UInt8(128,{constant:!0})};return new a.Component(e)}function b(e){this.transport=e,this.requestedProtocol=h.PROTOCOL_SSL|h.PROTOCOL_HYBRID,this.selectedProtocol=h.PROTOCOL_SSL|h.PROTOCOL_HYBRID;var t=this;this.transport.on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)}))}function _(e,t){this.config=t,b.call(this,e)}function g(e,t,r){b.call(this,e),this.keyFilePath=t,this.crtFilePath=r;var n=this;this.transport.once("data",(function(e){n.recvConnectionRequest(e)}))}n(b,o.EventEmitter),b.prototype.recvData=function(e){m().read(e),this.emit("data",e)},b.prototype.send=function(e){this.transport.send(new a.Component([m(),e]))},n(_,b),_.prototype.connect=function(){var e=v(null,new a.BinaryString);e.obj.protocolNeg.obj.type.value=l,e.obj.protocolNeg.obj.result.value=this.requestedProtocol,this.transport.send(e);var t=this;this.transport.once("data",(function(e){t.recvConnectionConfirm(e)}))},_.prototype.close=function(){this.transport.close()},_.prototype.recvConnectionConfirm=function(e){var t=y().read(e);if(t.obj.protocolNeg.obj.type.value!=p)if(t.obj.protocolNeg.obj.type.value==f&&(this.selectedProtocol=t.obj.protocolNeg.obj.result.value),-1===[h.PROTOCOL_HYBRID_EX].indexOf(this.selectedProtocol))if(this.selectedProtocol!=h.PROTOCOL_RDP){if(this.selectedProtocol!=h.PROTOCOL_HYBRID){n=this;return this.transport.on("data",(function(e){n.recvData(e)})),this.selectedProtocol==h.PROTOCOL_SSL?(i.debug("SSL standard security selected"),void this.transport.transport.startTLS((function(){n.emit("connect",n.selectedProtocol)}))):void 0}i.debug("NLA security layer selected");var n=this,o=this.transport.transport;this.transport.transport.startTLS((function(){var e=r(6626);n.nla=new e(o,(function(){n.nlaCompleted()}),n.config.domain,n.config.userName,n.config.password),n.nla.sendNegotiateMessage()}))}else i.debug("RDP standard security selected");else this.emit("error","NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED");else this.emit("error",{err:"NODE_RDP_PROTOCOL_X224_NEG_FAILURE",code:t.obj.protocolNeg.obj.result.value})},_.prototype.nlaCompleted=function(){var e=this;delete e.nla,this.transport.on("data",(function(t){e.recvData(t)})),this.emit("connect",this.selectedProtocol)},n(g,b),g.prototype.recvConnectionRequest=function(e){var t=v().read(e);if(!t.obj.protocolNeg.isReaded)throw new Error("NODE_RDP_PROTOCOL_X224_NO_BASIC_SECURITY_LAYER");if(this.requestedProtocol=t.obj.protocolNeg.obj.result.value,this.selectedProtocol=this.requestedProtocol&h.PROTOCOL_SSL,this.selectedProtocol&h.PROTOCOL_SSL)this.sendConnectionConfirm();else{var r=y();r.obj.protocolNeg.obj.type.value=NegociationType.TYPE_RDP_NEG_FAILURE,r.obj.protocolNeg.obj.result.value=NegotiationFailureCode.SSL_REQUIRED_BY_SERVER,this.transport.send(r),this.close()}},g.prototype.sendConnectionConfirm=function(){var e=y();e.obj.protocolNeg.obj.type.value=f,e.obj.protocolNeg.obj.result.value=this.selectedProtocol,this.transport.send(e);var t=this;this.transport.on("data",(function(e){t.recvData(e)})),this.transport.transport.listenTLS(this.keyFilePath,this.crtFilePath,(function(){i.debug("start SSL connection"),t.emit("connect",t.requestedProtocol)}))},e.exports={Client:_,Server:g}},8597:(e,t,r)=>{var n=r(6429),o=r(3179);e.exports={x509:n,rsa:o}},5802:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(6982);var a=function(e){return"number"==typeof e||function(e){return!!e&&"object"==n(e)}(e)&&"[object Number]"==Object.prototype.toString.call(e)};function i(e,t){null!=e&&("number"==typeof e?this.fromNumber(e,t):Buffer.isBuffer(e)?this.fromBuffer(e):null==t&&"string"!=typeof e?this.fromByteArray(e):this.fromString(e,t))}function c(){return new i(null)}i.prototype.am=function(e,t,r,n,o,a){for(var i=16383&t,c=t>>14;--a>=0;){var s=16383&this[e],u=this[e++]>>14,l=c*s+u*i;o=((s=i*s+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+c*u,r[n++]=268435455&s}return o},i.prototype.DB=28,i.prototype.DM=268435455,i.prototype.DV=1<<28;i.prototype.FV=Math.pow(2,52),i.prototype.F1=24,i.prototype.F2=4;var s,u,l=new Array;for(s="0".charCodeAt(0),u=0;u<=9;++u)l[s++]=u;for(s="a".charCodeAt(0),u=10;u<36;++u)l[s++]=u;for(s="A".charCodeAt(0),u=10;u<36;++u)l[s++]=u;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=c();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function v(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function b(e,t){return e|t}function _(e,t){return e^t}function g(e,t){return e&~t}function E(e){if(0===e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function w(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function P(){}function S(e){return e}function k(e){this.r2=c(),this.q3=c(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=c();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=c();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},P.prototype.convert=S,P.prototype.revert=S,P.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},P.prototype.sqrTo=function(e,t){e.squareTo(t)},k.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=c();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var A=[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,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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],T=(1<<26)/A[A.length-1];i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0},i.prototype.fromString=function(e,t,r){var n;switch(t){case 2:n=1;break;case 4:n=2;break;case 8:n=3;break;case 16:n=4;break;case 32:n=5;break;case 256:n=8;break;default:return void this.fromRadix(e,t)}this.t=0,this.s=0;for(var o=e.length,a=!1,c=0;--o>=0;){var s=8==n?255&e[o]:p(e,o);s<0?"-"==e.charAt(o)&&(a=!0):(a=!1,0===c?this[this.t++]=s:c+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-c)-1)<<c,this[this.t++]=s>>this.DB-c):this[this.t-1]|=s<<c,(c+=n)>=this.DB&&(c-=this.DB))}!r&&8==n&&128&e[0]&&(this.s=-1,c>0&&(this[this.t-1]|=(1<<this.DB-c)-1<<c)),this.clamp(),a&&i.ZERO.subTo(this,this)},i.prototype.fromByteArray=function(e,t){this.fromString(e,256,t)},i.prototype.fromBuffer=function(e){this.fromString(e,256,!0)},i.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},i.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,o=this.DB-n,a=(1<<o)-1,i=Math.floor(e/this.DB),c=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+i+1]=this[r]>>o|c,c=(this[r]&a)<<n;for(r=i-1;r>=0;--r)t[r]=0;t[i]=c,t.t=this.t+i+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var i=r+1;i<this.t;++i)t[i-r-1]|=(this[i]&a)<<o,t[i-r]=this[i]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<o),t.t=this.t-r,t.clamp()}},i.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t[o]=0;for(o=0;o<n.t;++o)t[o+r.t]=r.am(0,n[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&i.ZERO.subTo(t,t)},i.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=c());var a=c(),s=this.s,u=e.s,l=this.DB-d(n[n.t-1]);l>0?(n.lShiftTo(l,a),o.lShiftTo(l,r)):(n.copyTo(a),o.copyTo(r));var f=a.t,p=a[f-1];if(0!==p){var h=p*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),v=this.FV/h,y=(1<<this.F1)/h,m=1<<this.F2,b=r.t,_=b-f,g=null==t?c():t;for(a.dlShiftTo(_,g),r.compareTo(g)>=0&&(r[r.t++]=1,r.subTo(g,r)),i.ONE.dlShiftTo(f,g),g.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--_>=0;){var E=r[--b]==p?this.DM:Math.floor(r[b]*v+(r[b-1]+m)*y);if((r[b]+=a.am(0,E,r,_,0,f))<E)for(a.dlShiftTo(_,g),r.subTo(g,r);r[b]<--E;)r.subTo(g,r)}null!=t&&(r.drShiftTo(f,t),s!=u&&i.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0===(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=c(),n=c(),o=t.convert(this),a=d(e)-1;for(o.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,o,r);else{var s=r;r=n,n=s}return t.revert(r)},i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0===this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),o=c(),a=c(),i="";for(this.divRemTo(n,o,a);o.signum()>0;)i=(r+a.intValue()).toString(e).substr(1)+i,o.divRemTo(n,o,a);return a.intValue().toString(e)+i},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,a=0,c=0,s=0;s<e.length;++s){var u=p(e,s);u<0?"-"==e.charAt(s)&&0===this.signum()&&(o=!0):(c=t*c+u,++a>=r&&(this.dMultiply(n),this.dAddOffset(c,0),a=0,c=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(c,0)),o&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var r=o.randomBytes(1+(e>>3)),n=7&e;n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromByteArray(r)}},i.prototype.bitwiseTo=function(e,t,r){var n,o,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},i.prototype.changeBit=function(e,t){var r=i.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},i.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!==e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,e[o],r,o,0,this.t);for(n=Math.min(e.t,t);o<n;++o)this.am(0,e[o],r,o,0,t-o);r.clamp()},i.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},i.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0===t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>A.length&&(e=A.length);for(var o=c(),a=0;a<e;++a){o.fromInt(A[Math.floor(Math.random()*A.length)]);var s=o.modPow(n,this);if(0!=s.compareTo(i.ONE)&&0!=s.compareTo(t)){for(var u=1;u++<r&&0!=s.compareTo(t);)if(0===(s=s.modPowInt(2,this)).compareTo(i.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,a="",i=this.t,c=this.DB-i*this.DB%t;if(i-- >0)for(c<this.DB&&(r=this[i]>>c)>0&&(o=!0,a=f(r));i>=0;)c<t?(r=(this[i]&(1<<c)-1)<<t-c,r|=this[--i]>>(c+=this.DB-t)):(r=this[i]>>(c-=t)&n,c<=0&&(c+=this.DB,--i)),r>0&&(o=!0),o&&(a+=f(r));return o?a:"0"},i.prototype.negate=function(){var e=c();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=c();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new v(t):new y(t),this.exp(e,r)},i.prototype.clone=function(){var e=c();return this.copyTo(e),e},i.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0===this.t)return-1}else{if(1==this.t)return this[0];if(0===this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},i.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0===o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},i.prototype.toBuffer=function(e){var t=Buffer.from(this.toByteArray());if(!0===e&&0===t[0])t=t.slice(1);else if(a(e)){if(t.length>e){for(var r=0;r<t.length-e;r++)if(0!==t[r])return null;return t.slice(t.length-e)}if(t.length<e){var n=Buffer.alloc(e);return n.fill(0,0,e-t.length),t.copy(n,e-t.length),n}}return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=c();return this.bitwiseTo(e,m,t),t},i.prototype.or=function(e){var t=c();return this.bitwiseTo(e,b,t),t},i.prototype.xor=function(e){var t=c();return this.bitwiseTo(e,_,t),t},i.prototype.andNot=function(e){var t=c();return this.bitwiseTo(e,g,t),t},i.prototype.not=function(){for(var e=c(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},i.prototype.shiftLeft=function(e){var t=c();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},i.prototype.shiftRight=function(e){var t=c();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},i.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+E(this[e]);return this.s<0?this.t*this.DB:-1},i.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=w(this[r]^t);return e},i.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},i.prototype.setBit=function(e){return this.changeBit(e,b)},i.prototype.clearBit=function(e){return this.changeBit(e,g)},i.prototype.flipBit=function(e){return this.changeBit(e,_)},i.prototype.add=function(e){var t=c();return this.addTo(e,t),t},i.prototype.subtract=function(e){var t=c();return this.subTo(e,t),t},i.prototype.multiply=function(e){var t=c();return this.multiplyTo(e,t),t},i.prototype.divide=function(e){var t=c();return this.divRemTo(e,t,null),t},i.prototype.remainder=function(e){var t=c();return this.divRemTo(e,null,t),t},i.prototype.divideAndRemainder=function(e){var t=c(),r=c();return this.divRemTo(e,t,r),new Array(t,r)},i.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),a=h(1);if(o<=0)return a;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new v(t):t.isEven()?new k(t):new y(t);var i=new Array,s=3,u=r-1,l=(1<<r)-1;if(i[1]=n.convert(this),r>1){var f=c();for(n.sqrTo(i[1],f);s<=l;)i[s]=c(),n.mulTo(f,i[s-2],i[s]),s+=2}var p,m,b=e.t-1,_=!0,g=c();for(o=d(e[b])-1;b>=0;){for(o>=u?p=e[b]>>o-u&l:(p=(e[b]&(1<<o+1)-1)<<u-o,b>0&&(p|=e[b-1]>>this.DB+o-u)),s=r;!(1&p);)p>>=1,--s;if((o-=s)<0&&(o+=this.DB,--b),_)i[p].copyTo(a),_=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(m=a,a=g,g=m),n.mulTo(g,i[p],a)}for(;b>=0&&!(e[b]&1<<o);)n.sqrTo(a,g),m=a,a=g,g=m,--o<0&&(o=this.DB-1,--b)}return n.revert(a)},i.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0===e.signum())return i.ZERO;for(var r=e.clone(),n=this.clone(),o=h(1),a=h(0),c=h(0),s=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(c.isEven()&&s.isEven()||(c.addTo(this,c),s.subTo(e,s)),c.rShiftTo(1,c)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(c,o),a.subTo(s,a)):(n.subTo(r,n),t&&c.subTo(o,c),s.subTo(a,s))}return 0!=n.compareTo(i.ONE)?i.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},i.prototype.pow=function(e){return this.exp(e,new P)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(o<a&&(a=o),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(r[0]==A[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<A.length;){for(var n=A[t],o=t+1;o<A.length&&n<T;)n*=A[o++];for(n=r.modInt(n);t<o;)if(n%A[t++]==0)return!1}return r.millerRabin(e)},i.int2char=f,i.ZERO=h(0),i.ONE=h(1),i.prototype.square=function(){var e=c();return this.squareTo(e),e},e.exports=i},1890:(e,t,r)=>{var n;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}e=r.nmd(e),function(){"use strict";var t="object"===("undefined"==typeof window?"undefined":o(window))?window:{};!t.JS_MD4_NO_NODE_JS&&"object"===("undefined"==typeof process?"undefined":o(process))&&process.versions&&process.versions.node&&(t=global);var a,i=!t.JS_MD4_NO_COMMON_JS&&"object"===o(e)&&e.exports,c=r.amdO,s=!t.JS_MD4_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),l=[128,32768,8388608,-2147483648],f=[0,8,16,24],p=["hex","array","digest","buffer","arrayBuffer"],h=[];if(s){var d=new ArrayBuffer(68);a=new Uint8Array(d),h=new Uint32Array(d)}var v=function(e){return function(t){return new y(!0).update(t)[e]()}};function y(e){if(e)h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h,this.buffer8=a;else if(s){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}y.prototype.update=function(e){if(!this.finalized){var t="string"!=typeof e;t&&s&&e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,o=0,a=e.length||0,i=this.blocks,c=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,i[0]=i[16],i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),t)if(s)for(n=this.start;o<a&&n<64;++o)c[n++]=e[o];else for(n=this.start;o<a&&n<64;++o)i[n>>2]|=e[o]<<f[3&n++];else if(s)for(n=this.start;o<a&&n<64;++o)(r=e.charCodeAt(o))<128?c[n++]=r:r<2048?(c[n++]=192|r>>6,c[n++]=128|63&r):r<55296||r>=57344?(c[n++]=224|r>>12,c[n++]=128|r>>6&63,c[n++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),c[n++]=240|r>>18,c[n++]=128|r>>12&63,c[n++]=128|r>>6&63,c[n++]=128|63&r);else for(n=this.start;o<a&&n<64;++o)(r=e.charCodeAt(o))<128?i[n>>2]|=r<<f[3&n++]:r<2048?(i[n>>2]|=(192|r>>6)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]):r<55296||r>=57344?(i[n>>2]|=(224|r>>12)<<f[3&n++],i[n>>2]|=(128|r>>6&63)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),i[n>>2]|=(240|r>>18)<<f[3&n++],i[n>>2]|=(128|r>>12&63)<<f[3&n++],i[n>>2]|=(128|r>>6&63)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=l[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,r,n,o,a,i,c,s=this.blocks;this.first?t=(t=((r=(r=((n=(n=(4023233417&(e=(e=s[0]-1)<<3|e>>>29)|2562383102&~e)+s[1]+271733878)<<7|n>>>25)&e|4023233417&~n)+s[2]-1732584194)<<11|r>>>21)&n|~r&e)+s[3]-271733879)<<19|t>>>13:(e=this.h0,t=this.h1,r=this.h2,n=this.h3,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[0])<<3|e>>>29)&t|~e&r)+s[1])<<7|n>>>25)&e|~n&t)+s[2])<<11|r>>>21)&n|~r&e)+s[3])<<19|t>>>13),t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[4])<<3|e>>>29)&t|~e&r)+s[5])<<7|n>>>25)&e|~n&t)+s[6])<<11|r>>>21)&n|~r&e)+s[7])<<19|t>>>13,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[8])<<3|e>>>29)&t|~e&r)+s[9])<<7|n>>>25)&e|~n&t)+s[10])<<11|r>>>21)&n|~r&e)+s[11])<<19|t>>>13,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[12])<<3|e>>>29)&t|~e&r)+s[13])<<7|n>>>25)&e|~n&t)+s[14])<<11|r>>>21)&n|~r&e)+s[15])<<19|t>>>13,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|r&n)+s[0]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[4]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[8]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[12]+1518500249)<<13|t>>>19,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[1]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[5]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[9]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[13]+1518500249)<<13|t>>>19,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[2]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[6]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[10]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[14]+1518500249)<<13|t>>>19,t=(t+=((r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[3]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[7]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[11]+1518500249)<<9|r>>>23)&n|r&e|c)+s[15]+1518500249)<<13|t>>>19,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[0]+1859775393)<<3|e>>>29))+s[8]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[4]+1859775393)<<11|r>>>21))+s[12]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[2]+1859775393)<<3|e>>>29))+s[10]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[6]+1859775393)<<11|r>>>21))+s[14]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[1]+1859775393)<<3|e>>>29))+s[9]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[5]+1859775393)<<11|r>>>21))+s[13]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[3]+1859775393)<<3|e>>>29))+s[11]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[7]+1859775393)<<11|r>>>21))+s[15]+1859775393)<<15|t>>>17,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15]+u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15]+u[r>>4&15]+u[15&r]+u[r>>12&15]+u[r>>8&15]+u[r>>20&15]+u[r>>16&15]+u[r>>28&15]+u[r>>24&15]+u[n>>4&15]+u[15&n]+u[n>>12&15]+u[n>>8&15]+u[n>>20&15]+u[n>>16&15]+u[n>>28&15]+u[n>>24&15]},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},y.prototype.buffer=y.prototype.arrayBuffer;var m=function(){var e=v("hex");e.create=function(){return new y},e.update=function(t){return e.create().update(t)};for(var t=0;t<p.length;++t){var r=p[t];e[r]=v(r)}return e}();i?e.exports=m:(t.md4=m,c&&(void 0===(n=function(){return m}.call(m,r,m,e))||(e.exports=n)))}()},4824:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==o&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,r){function n(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),n.AsyncIterator=T,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new T(p(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},n}function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e){this.privateKey=function(e){for(var t=n(Array(256).keys()),r=0,o=(e=function(e){for(var t=[],r=0,n=e.length;r<n;r++)t.push(e.charCodeAt(r));return t}(e),0),a=t.length;o<a;o++){var i=[t[r=(r+t[o]+e[o%e.length])%256],t[o]];t[o]=i[0],t[r]=i[1]}return t}(e),this.byteStream=i(this.privateKey.slice(0))}var i=r().mark((function e(t){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,o=0;case 1:return o=(o+t[n=(n+1)%256])%256,a=[t[o],t[n]],t[n]=a[0],t[o]=a[1],e.next=9,t[(t[n]+t[o])%256];case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e)}));a.prototype.encrypt=function(e){for(var t="",r=0,n=e.length;r<n;r++)t+=("00"+(e.charCodeAt(r)^this.byteStream.next().value).toString(16)).substr(-2);return t},a.prototype.decrypt=function(e){for(var t="",r=0,n=(e=e.match(/[a-z0-9]{2}/gi)).length;r<n;r++)t+=String.fromCharCode(parseInt(e[r],16)^byteStream.next().value);return t},e.exports=a},3179:(e,t,r)=>{var n=r(5802);e.exports={publicKey:function(e,t){return{n:e,e:t}},encrypt:function(e,t){return new n(e).modPowInt(t.e,new n(t.n)).toBuffer()}}},6429:(e,t,r)=>{var n=r(5002);function o(){return new n.univ.Choice({teletexString:new n.univ.T61String,printableString:new n.univ.PrintableString,universalString:new n.univ.UniversalString,utf8String:new n.univ.UTF8String,bmpString:new n.univ.BMPString,ia5String:new n.univ.IA5String})}function a(){return new n.univ.Sequence({type:new n.univ.ObjectIdentifier,value:o()})}function i(){return new n.univ.SetOf(a)}function c(){return new n.univ.Choice({rdnSequence:new n.univ.SequenceOf(i)})}function s(){return new n.univ.Sequence({algorithm:new n.univ.ObjectIdentifier,parameters:new n.univ.Null})}function u(){return new n.univ.Sequence({extnID:new n.univ.ObjectIdentifier,critical:new n.univ.Boolean,extnValue:new n.univ.OctetString})}function l(){return new n.univ.Choice({utcTime:new n.univ.UTCTime,generalTime:new n.univ.GeneralizedTime})}function f(){return new n.univ.BitString}e.exports={X509Certificate:function(){return new n.univ.Sequence({tbsCertificate:new n.univ.Sequence({version:(new n.univ.Integer).explicitTag(new n.spec.Asn1Tag(n.spec.TagClass.Context,n.spec.TagFormat.Constructed,0)),serialNumber:new n.univ.Integer,signature:s(),issuer:c(),validity:new n.univ.Sequence({notBefore:l(),notAfter:l()}),subject:c(),subjectPublicKeyInfo:new n.univ.Sequence({algorithm:s(),subjectPublicKey:new n.univ.BitString}),issuerUniqueID:f().implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,1).optional(),subjectUniqueID:f().implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,2).optional(),extensions:new n.univ.SequenceOf(u).implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,3).optional()}),signatureAlgorithm:s(),signatureValue:new n.univ.BitString})},RSAPublicKey:function(){return new n.univ.Sequence({modulus:new n.univ.Integer,publicExponent:new n.univ.Integer})}}},2992:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.RdpController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(9317),f=r(9334),p=r(274),h=r(5890),d="navindex_rdp_tag_key",v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"infos",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.infos(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"mouse",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.mouse(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"wheel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.wheel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"unicode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.unicode(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"scancode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.scancode(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"rdpDisconnect",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.rdpDisconnect(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return p.DataUtil.set(d,e),(0,h.Sucess)("ok")}},{key:"get",value:function(){var e=p.DataUtil.get(d);return(0,h.Sucess)(e||[])}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.RdpController=v,c.__decorate([(0,s.msg)(u.CmdType.infos),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"infos",null),c.__decorate([(0,s.msg)(u.CmdType.mouse),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"mouse",null),c.__decorate([(0,s.msg)(u.CmdType.wheel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"wheel",null),c.__decorate([(0,s.msg)(u.CmdType.unicode),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"unicode",null),c.__decorate([(0,s.msg)(u.CmdType.scancode),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"scancode",null),c.__decorate([(0,s.msg)(u.CmdType.rdp_disconnect),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"rdpDisconnect",null),c.__decorate([(0,f.Post)("/tag/save"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],v.prototype,"save",null),c.__decorate([(0,f.Get)("/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],v.prototype,"get",null),t.RdpController=v=c.__decorate([(0,f.Controller)("/rdp")],v)},9317:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.rdpService=t.RdpService=void 0;var c=r(5584),s=r(4988),u=c.__importDefault(r(4490)),l=r(8411),f="rdpClient",p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"infos",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wss,(n=r.dataMap.get(f))&&n.close(),a=e.context,n=u.default.createClient({domain:a.domain,userName:a.username,password:a.password,enablePerf:!0,autoLogin:!0,screen:a.screen,locale:a.locale,logLevel:process.argv[2]||"INFO"}),r.dataMap.set(f,n),n.on("connect",(function(){var t=new s.WsData(s.CmdType.rdp_connect);t.context="",e.wss.sendData(t.encode())})).on("bitmap",(function(t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:(n=new s.WsData(s.CmdType.rdp_bitmap)).bin_context=t.data,t.data=null,n.context=t,e.wss.ws.send(n.encode());case 5:case"end":return r.stop()}}),r)})))})).on("close",(function(){var t=new s.WsData(s.CmdType.rdp_close);t.context="",e.wss.sendData(t.encode())})).on("error",(function(t){var r=new s.WsData(s.CmdType.rdp_error);r.context=t,e.wss.sendData(r.encode())})).connect(a.ip,3389),e.wss.setClose((function(){n&&(console.log("由于ws断开,rpd关闭"),n.close())})),t.abrupt("return","");case 10:case"end":return t.stop()}}),t)})))}},{key:"mouse",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendPointerEvent(r.x,r.y,r.button,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"wheel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendWheelEvent(r.x,r.y,r.step,r.isNegative,r.isHorizontal);case 5:case"end":return t.stop()}}),t)})))}},{key:"unicode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendKeyEventUnicode(r.code,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"scancode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendKeyEventScancode(r.code,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"rdpDisconnect",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.context,r=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:r.close();case 5:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.RdpService=p,c.__decorate([(0,l.msg)(s.CmdType.rdp_disconnect),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[s.WsData]),c.__metadata("design:returntype",Promise)],p.prototype,"rdpDisconnect",null),t.rdpService=new p},828:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SettingController=void 0;var u=r(5584),l=r(9334),f=r(4908),p=r(5890),h=r(285),d=r(5443),v=r(4321),y=r(274),m=r(9625),b=r(5546),_=r(2279),g=r(5101),E=r(7699),w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.language="user_language",this.start_server_time=Date.now()},(t=[{key:"login",value:function(e){return v.Env.updateEnv([{key:"username"},{key:"password"}]),y.DataUtil.set("username",e.username),y.DataUtil.set("password",e.password),(0,p.Sucess)("ok")}},{key:"getRouter",value:function(){return(0,p.Sucess)(m.settingService.getCustomerRouter())}},{key:"saveRouter",value:function(e){return m.settingService.setCustomerRouter(e),(0,p.Sucess)("1")}},{key:"getApiRouter",value:function(){return(0,p.Sucess)(m.settingService.getCustomerApiRouter())}},{key:"saveApiRouter",value:function(e){return m.settingService.setCustomerApiRouter(e),(0,p.Sucess)("1")}},{key:"getSelfAuth",value:function(){var e=m.settingService.getSelfAuthOpen();return(0,p.Sucess)(null!=e&&e)}},{key:"saveSelfAuth",value:function(e){return m.settingService.setSelfAuthOpen(e),(0,p.Sucess)("1")}},{key:"getSelfAuthJscode",value:function(){var e=y.DataUtil.getFile(b.self_auth_jscode),t=" \n // 必须存在的类\n class Api { \n \n /*\n * 处理并返回结果\n * @params token: token\n */\n async handler(token) { \n return false;\n }\n }\n ";return e||y.DataUtil.setFile(b.self_auth_jscode,t),(0,p.Sucess)(e||t)}},{key:"getJscode",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=m.settingService.routerHandler(e),r=y.DataUtil.getFile(e),n=" \n // 必须存在的类\n class Api { \n \n /*\n * 处理并返回结果\n * @params headers: 请求头对象\n * @params body: 请求体\n */\n async handler(headers,body,ctx) { \n return null;\n }\n }\n ",r||y.DataUtil.setFile(e,n),t.abrupt("return",(0,p.Sucess)(r||n));case 5:case"end":return t.stop()}}),t)})))}},{key:"saveJscode",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y.DataUtil.setFile(m.settingService.routerHandler(e.router),e.context),t.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}},{key:"getToken",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,p.Sucess)(m.settingService.getToken()));case 1:case"end":return e.stop()}}),e)})))}},{key:"saveToken",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m.settingService.saveToken(e.mode,e.length),t.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}},{key:"clearToken",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h.Cache.clear(),e.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return e.stop()}}),e)})))}},{key:"saveFilesSetting",value:function(e,t){return m.settingService.saveFilesSetting(e,t.headers.authorization),(0,p.Sucess)("1")}},{key:"getFilesSetting",value:function(){return(0,p.Sucess)(m.settingService.getFilesSetting())}},{key:"getSoftware",value:function(){return(0,p.Sucess)(m.settingService.getSoftware())}},{key:"setSoftware",value:function(e){return m.settingService.setSoftware(e),(0,p.Sucess)("")}},{key:"languageSetting",value:function(e){return y.DataUtil.set(this.language,e.language),(0,p.Sucess)("1")}},{key:"getLanguage",value:function(){var e,t=new f.UserBaseInfo;t.language=null!==(e=y.DataUtil.get(this.language))&&void 0!==e?e:"zh",t.sys=(0,g.getSys)();var r,n={},a=o(m.settingService.getSoftware());try{for(a.s();!(r=a.n()).done;){var i=r.value;n[i.id]=i}}catch(e){a.e(e)}finally{a.f()}return t.sysSoftWare=n,t.runing_time_length=(0,E.getShortTime)(this.start_server_time),(0,p.Sucess)(t)}},{key:"getEnvPath",value:function(){return(0,p.Sucess)(m.settingService.getEnvPath())}},{key:"setEnvPath",value:function(e){return m.settingService.setEnvPath(e.path),(0,p.Sucess)("1")}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SettingController=w,u.__decorate([(0,l.Post)("/updatePassword"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[f.UserLogin]),u.__metadata("design:returntype",void 0)],w.prototype,"login",null),u.__decorate([(0,l.Get)("/customer_router"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getRouter",null),u.__decorate([(0,l.Post)("/customer_router/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveRouter",null),u.__decorate([(0,l.Get)("/api/customer_router"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getApiRouter",null),u.__decorate([(0,l.Post)("/api/customer_router/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveApiRouter",null),u.__decorate([(0,l.Get)("/self_auth_open"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSelfAuth",null),u.__decorate([(0,l.Post)("/self_auth_open/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveSelfAuth",null),u.__decorate([(0,l.Get)("/self_auth_open/jscode"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSelfAuthJscode",null),u.__decorate([(0,l.Get)("/jscode/:router*"),u.__param(0,(0,l.Param)("router")),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[String]),u.__metadata("design:returntype",Promise)],w.prototype,"getJscode",null),u.__decorate([(0,l.Post)("/jscode/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",Promise)],w.prototype,"saveJscode",null),u.__decorate([(0,l.Get)("/token"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",Promise)],w.prototype,"getToken",null),u.__decorate([(0,l.Post)("/token/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[_.TokenSettingReq]),u.__metadata("design:returntype",Promise)],w.prototype,"saveToken",null),u.__decorate([(0,l.Get)("/token/clear"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",Promise)],w.prototype,"clearToken",null),u.__decorate([(0,l.Post)("/filesSetting/save"),u.__param(0,(0,l.Body)()),u.__param(1,(0,l.Ctx)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object,Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveFilesSetting",null),u.__decorate([(0,l.Get)("/filesSetting"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getFilesSetting",null),u.__decorate([(0,l.Get)("/outside/software/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSoftware",null),u.__decorate([(0,l.Post)("/outside/software/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"setSoftware",null),u.__decorate([(0,l.Post)("/language/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"languageSetting",null),u.__decorate([(0,l.Get)("/userInfo/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getLanguage",null),u.__decorate([(0,l.Get)("/env/path/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getEnvPath",null),u.__decorate([(0,l.Post)("/env/path/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"setEnvPath",null),t.SettingController=w=u.__decorate([(0,d.Service)(),(0,l.Controller)("/setting")],w)},9625:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof m?t:m,i=Object.create(a.prototype),c=new C(n||[]);return o(i,"_invoke",{value:A(e,r,c)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function b(){}function _(){}var g={};u(g,i,(function(){return this}));var E=Object.getPrototypeOf,w=E&&E(E(x([])));w&&w!==r&&n.call(w,i)&&(g=w);var P=_.prototype=m.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,a,i,c){var s=f(e[o],e,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==_typeof(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function A(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?v:h,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(_typeof(t)+" is not iterable")}return b.prototype=_,o(P,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:b,configurable:!0}),b.displayName=u(_,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,s,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},S(k.prototype),u(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new k(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(P),u(P,s,"Generator"),u(P,i,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=x,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){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 a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.settingService=exports.SettingService=void 0;var tslib_1=__webpack_require__(5584),DataUtil_1=__webpack_require__(274),path_1=tslib_1.__importDefault(__webpack_require__(6928)),fs_1=tslib_1.__importDefault(__webpack_require__(9896)),customerRouter_pojo_1=__webpack_require__(5546),cache_1=__webpack_require__(285),Result_1=__webpack_require__(5890),config_1=__webpack_require__(3129),setting_req_1=__webpack_require__(2279),Env_1=__webpack_require__(4321),sys_utl_1=__webpack_require__(9005),needle=__webpack_require__(9551),customer_router_key="customer_router_key",customer_api_router_key="customer_api_router_key",token_setting="token_setting",files_pre_mulu_key="files_pre_mulu_key",SettingService=function(){function SettingService(){_classCallCheck(this,SettingService),this.extra_env_path="extra_env_path"}return _createClass(SettingService,[{key:"getCustomerRouter",value:function(){var e=DataUtil_1.DataUtil.get(customer_router_key);return null!=e?e:[]}},{key:"setCustomerRouter",value:function(e){DataUtil_1.DataUtil.set(customer_router_key,e)}},{key:"intercept",value:function(e){return tslib_1.__awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var r,n,o,a,i,c,s,u,l,f,p,h,d,v,y=this;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.url,e.url.includes("?")&&(r=e.url.split("?")[0]),!((n=DataUtil_1.DataUtil.get(customer_router_key))&&n.length>0)){t.next=37;break}o=_createForOfIteratorHelper(n),t.prev=5,o.s();case 7:if((a=o.n()).done){t.next=29;break}if(i=a.value,i[0]!==r){t.next=27;break}if(!(c=i[1])){t.next=27;break}if(!c.startsWith("http")){t.next=22;break}return t.next=16,needle("get",c,e.headers);case 16:for(u in(s=t.sent).headers)e.set(u,s.headers[u]);e.body=s.body,e.status=s.statusCode,t.next=26;break;case 22:l=path_1.default.join(c),c.includes(".htm")&&(e.type="html"),fs_1.default.accessSync(l,fs_1.default.constants.F_OK),e.body=fs_1.default.createReadStream(l);case 26:return t.abrupt("return",!0);case 27:t.next=7;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(5),o.e(t.t0);case 34:return t.prev=34,o.f(),t.finish(34);case 37:if(!((f=DataUtil_1.DataUtil.get(customer_api_router_key))&&f.length>0)){t.next=58;break}p=_createForOfIteratorHelper(f),t.prev=40,d=_regeneratorRuntime().mark((function t(){var n,o,a,i;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=h.value).router!==r){t.next=24;break}if(!n.needAuth){t.next=9;break}return o=e.headers.authorization,t.next=6,y.check(o);case 6:if(t.sent){t.next=9;break}return e.body=(0,Result_1.AuthFail)("失败"),t.abrupt("return",{v:!0});case 9:return t.prev=9,a=y.getHandlerClass(n.router),i="",e.req.on("data",(function(e){i+=e})),t.next=15,new Promise((function(t){e.req.on("end",t)}));case 15:return t.next=17,a.handler(e.headers,i,e,cache_1.Cache);case 17:e.body=t.sent,t.next=23;break;case 20:t.prev=20,t.t0=t.catch(9),e.body=(0,Result_1.Sucess)(t.t0.toString());case 23:return t.abrupt("return",{v:!0});case 24:case"end":return t.stop()}}),t,null,[[9,20]])})),p.s();case 43:if((h=p.n()).done){t.next=50;break}return t.delegateYield(d(),"t1",45);case 45:if(!(v=t.t1)){t.next=48;break}return t.abrupt("return",v.v);case 48:t.next=43;break;case 50:t.next=55;break;case 52:t.prev=52,t.t2=t.catch(40),p.e(t.t2);case 55:return t.prev=55,p.f(),t.finish(55);case 58:return t.abrupt("return",!1);case 59:case"end":return t.stop()}}),t,null,[[5,31,34,37],[40,52,55,58]])})))}},{key:"getHandlerClass",value:function getHandlerClass(key){var jscode=DataUtil_1.DataUtil.getFile(this.routerHandler(key));if(!jscode)return{};var ApiClass=eval("(() => { ".concat(jscode,"; return Api; })()")),instance=new ApiClass;return instance}},{key:"getCustomerApiRouter",value:function(){var e=DataUtil_1.DataUtil.get(customer_api_router_key);return null!=e?e:[]}},{key:"setCustomerApiRouter",value:function(e){DataUtil_1.DataUtil.set(customer_api_router_key,e)}},{key:"check",value:function(e){return tslib_1.__awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!cache_1.Cache.check(e)){t.next=3;break}return cache_1.Cache.updateTimer(e),t.abrupt("return",!0);case 3:if(!this.getSelfAuthOpen()){t.next=12;break}if(r=this.getHandlerClass(customerRouter_pojo_1.self_auth_jscode)){t.next=7;break}return t.abrupt("return",!1);case 7:return t.next=9,r.handler(e);case 9:if(!t.sent){t.next=12;break}return t.abrupt("return",!0);case 12:return t.abrupt("return",!1);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"routerHandler",value:function(e){for(var t=(e=decodeURIComponent(e)).split(""),r=0;r<t.length;r++)"/"===t[r]&&(t[r]="_");return t.join("")}},{key:"getSelfAuthOpen",value:function(){return DataUtil_1.DataUtil.get(customerRouter_pojo_1.self_auth_jscode)}},{key:"setSelfAuthOpen",value:function(e){return DataUtil_1.DataUtil.set(customerRouter_pojo_1.self_auth_jscode,e.open)}},{key:"getToken",value:function(){return DataUtil_1.DataUtil.get(token_setting)}},{key:"saveToken",value:function(e,t){e===setting_req_1.TokenTimeMode.close?(cache_1.Cache.setIgnore(!1),cache_1.Cache.setIgnoreCheck(!1)):e===setting_req_1.TokenTimeMode.length?(cache_1.Cache.setIgnore(!0),cache_1.Cache.clearTokenTimerMap(),cache_1.Cache.getTokenMap().forEach((function(e){return cache_1.Cache.getTokenTimerMap().set(e,setTimeout((function(){cache_1.Cache.getTokenMap().delete(e),cache_1.Cache.getTokenTimerMap().delete(e)}),1e3*t))}))):e===setting_req_1.TokenTimeMode.forver&&(cache_1.Cache.clearTokenTimerMap(),cache_1.Cache.setIgnore(!0),cache_1.Cache.setIgnoreCheck(!0)),DataUtil_1.DataUtil.set(token_setting,{mode:e,length:t})}},{key:"init",value:function(){var e=DataUtil_1.DataUtil.get(token_setting);e&&e.mode&&this.saveToken(e.mode,e.length)}},{key:"getFilesSetting",value:function(){if(this.update_files_setting)return this.update_files_setting;var e=DataUtil_1.DataUtil.get(files_pre_mulu_key),t=new setting_req_1.FileSettingItem;t.path=Env_1.Env.base_folder,t.note="默认配置路径";var r=null!=e?e:[];return r.find((function(e){return e.default}))||(t.default=!0),this.update_files_setting=[t].concat(_toConsumableArray(r)),this.update_files_setting}},{key:"saveFilesSetting",value:function(e,t){Array.isArray(e)&&0!==e.length&&(e.shift(),DataUtil_1.DataUtil.set(files_pre_mulu_key,e),cache_1.Cache.getTokenMap().get(t).root_index=0,this.update_files_setting=null)}},{key:"getFileRootPath",value:function(e){var t,r=cache_1.Cache.getTokenMap().get(e),n=r&&null!==(t=r.root_index)&&void 0!==t?t:null,o=this.getFilesSetting();if(null!==n)return o[n].path;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var c=a.value;if(c.default)return c.path}}catch(e){i.e(e)}finally{i.f()}}},{key:"getSoftware",value:function(){if(this.cacheSysSoftwareItem)return this.cacheSysSoftwareItem;var e,t=DataUtil_1.DataUtil.get("sys_software"),r=new Map,n=_createForOfIteratorHelper(null!=t?t:[]);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.set(o.id,o)}}catch(e){n.e(e)}finally{n.f()}for(var a=[],i=0,c=Object.keys(setting_req_1.SysSoftware);i<c.length;i++){var s=c[i],u=new setting_req_1.SysSoftwareItem;u.id=setting_req_1.SysSoftware[s];var l=r.get(s);u.path=l?l.path:"",s===setting_req_1.SysSoftware.ffmpeg?u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"ffmpeg"," -version")):s===setting_req_1.SysSoftware.smartmontools?u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"smartctl"," --version")):s===setting_req_1.SysSoftware.ntfs_3g&&(u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"ntfs-3g"," --version"))),a.push(u)}return this.cacheSysSoftwareItem=a,a}},{key:"setSoftware",value:function(e){DataUtil_1.DataUtil.set("sys_software",e),this.cacheSysSoftwareItem=null,this.getFilesSetting()}},{key:"getEnvPath",value:function(){var e;return null!==(e=DataUtil_1.DataUtil.get(this.extra_env_path))&&void 0!==e?e:""}},{key:"setEnvPath",value:function(e){return DataUtil_1.DataUtil.set(this.extra_env_path,e),(0,Result_1.Sucess)("1")}}])}();exports.SettingService=SettingService,exports.settingService=new SettingService,config_1.ServerEvent.on("start",(function(e){exports.settingService.init()}))},72:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.ShellController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(5101),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"open",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.open(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"send",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.send(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.cd(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellLogs(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs_cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.dockerShellLogs_cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecOpen",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellExecOpen(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExec",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellExec(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecCancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.dockerShellExecCancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.ShellController=f,c.__decorate([(0,s.msg)(u.CmdType.shell_open),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"open",null),c.__decorate([(0,s.msg)(u.CmdType.shell_send),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"send",null),c.__decorate([(0,s.msg)(u.CmdType.shell_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"cancel",null),c.__decorate([(0,s.msg)(u.CmdType.shell_cd),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"cd",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_logs),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellLogs",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_logs_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellLogs_cancel",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec_open),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExecOpen",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExec",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExecCancel",null)},5101:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.shellServiceImpl=t.ShellService=t.sysType=void 0,t.getSys=function(){return"win"===t.sysType?h.SysEnum.win:"linux"===t.sysType?h.SysEnum.linux:void 0},t.getShell=b;var c=r(5584),s=r(4988),u=c.__importDefault(r(857)),l=c.__importDefault(r(6928)),f=r(9005),p=r(9625),h=r(4908),d=r(5317),v=d.spawn;d.exec;t.sysType="win32"===u.default.platform()?"win":"linux";var y="\r";var m=null;function b(){return m||(m=function(){if("win"===t.sysType){if(f.SystemUtil.commandIsExist("pwsh"))return"pwsh.exe";if(f.SystemUtil.commandIsExist("powershell"))return"powershell.exe";if(f.SystemUtil.commandIsExist("cmd"))return"cmd.exe";y="\n"}else{if(f.SystemUtil.commandIsExist("bash"))return"bash";if(f.SystemUtil.commandIsExist("sh"))return"sh"}}()),m}var _=r(2511),g=new Map,E=process.env.PATH,w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"open",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,i,c,u;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=e.wss.id,process.env.PATH=E+("win"===t.sysType?";":":")+p.settingService.getEnvPath(),a=e.context,i=_.spawn(b(),[],{name:"xterm-color",cols:a.cols,rows:a.rows,cwd:process.env.HOME,env:process.env,useConpty:void 0}),c=l.default.join(p.settingService.getFileRootPath(a.http_token),null!==a.init_path&&"null"!==a.init_path?a.init_path:""),u="cd '".concat(decodeURIComponent(c),"' ").concat(y),i.write(u),i.onData((function(t){var r=new s.WsData(s.CmdType.shell_getting);r.context=t,e.wss.sendData(r.encode())})),g.set(n,i),e.wss.ws.on("close",(function(){var e=g.get(n);e&&(console.log("意外断开pty"),e.kill(),g.delete(n))}));case 10:case"end":return r.stop()}}),r)})))}},{key:"send",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,(n=g.get(r))?null!==e.context&&"null"!==e.context&&n.write(e.context):((a=new s.WsData(s.CmdType.shell_getting)).context="shell状态错误",e.wss.sendData(a.encode()),e.wss.ws.close());case 3:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){var t=e.wss.id;e.wss.ws.close();var r=g.get(t);r&&(console.log("主动断开pty"),r.kill(),g.delete(t))}},{key:"cd",value:function(e){var t=e.wss.id,r=g.get(t);if(r){var n=l.default.join(p.settingService.getFileRootPath(e.context.http_token),decodeURIComponent(e.context.init_path)),o="cd '".concat(n,"' ").concat(y);r.write(o)}}},{key:"dockerShellLogs",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,n=e.context;try{(a=v("docker",["logs","".concat(n.dockerId),"-f","-n",1e3])).stdout.on("data",(function(t){var r=new s.WsData(s.CmdType.docker_shell_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.stderr.on("data",(function(t){var r=new s.WsData(s.CmdType.docker_shell_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.on("close",(function(t){var n=g.get(r);n&&(console.log("意外断开exec"),n.kill(),g.delete(r)),e.wss.ws.close()})),g.set(r,a),e.wss.ws.on("close",(function(){var t=g.get(r);t&&(console.log("意外断开exec"),t.kill(),g.delete(r)),e.wss.ws.close()}))}catch(t){(i=g.get(r))&&(console.log("意外断开exec"),i.kill(),g.delete(r),e.wss.ws.close())}case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs_cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,e.wss.ws.close(),(n=g.get(r))&&(console.log("主动断开exec"),n.kill(),g.delete(r));case 4:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecOpen",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i,c,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,n=e.context,a="",!f.SystemUtil.commandIsExist("docker exec ".concat(n.dockerId," bash"))){t.next=7;break}a="bash",t.next=16;break;case 7:if(!f.SystemUtil.commandIsExist("docker exec ".concat(n.dockerId," sh"))){t.next=11;break}a="sh",t.next=16;break;case 11:return(i=new s.WsData(s.CmdType.docker_shell_exec_getting)).context="容器内不存在任何shell ",e.wss.sendData(i.encode()),e.wss.ws.close(),t.abrupt("return");case 16:c=_.spawn(b(),[],{name:"xterm-color",cols:n.cols,rows:n.rows,cwd:process.env.HOME,useConpty:void 0}),u="docker exec -it ".concat(n.dockerId," ").concat(a," ").concat(y),c.write(u),c.onData((function(t){var r=new s.WsData(s.CmdType.docker_shell_exec_getting);r.context=t,e.wss.sendData(r.encode())})),g.set(r,c),e.wss.ws.on("close",(function(){var e=g.get(r);e&&(console.log("意外断开pty"),e.kill(),g.delete(r))}));case 22:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExec",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,(n=g.get(r))?null!==e.context&&"null"!==e.context&&n.write(e.context):((a=new s.WsData(s.CmdType.docker_shell_exec_getting)).context="error",e.wss.sendData(a.encode()),e.wss.ws.close());case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecCancel",value:function(e){var t=e.wss.id;e.wss.ws.close();var r=g.get(t);r&&(console.log("主动断开pty"),r.kill(),g.delete(t))}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();t.ShellService=w,t.shellServiceImpl=new w},8972:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.SSHController=void 0;var s=r(5584),u=r(8411),l=r(4988),f=r(2153),p=r(6387),h=r(9334),d=r(5890),v=r(274),y=s.__importDefault(r(8461)),m=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.start(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.close(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"getDir",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.getDir(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"getFileText",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f.sshService.getFileText(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"updateFileText",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.updateFileText(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"create",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.create(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"deletes",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.deletes(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"move",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.move(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"copy",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.copy(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"uploadFile",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f.sshService.uploadFile(e,t);case 2:return r.abrupt("return",(0,d.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"open",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.open(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"send",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.send(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cd",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.cd(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return v.DataUtil.set(f.navindex_remote_ssh_key,e),(0,d.Sucess)("ok")}},{key:"get",value:function(){var e=v.DataUtil.get(f.navindex_remote_ssh_key);return(0,d.Sucess)(e||[])}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SSHController=m,s.__decorate([(0,h.Post)("/start"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"start",null),s.__decorate([(0,h.Post)("/close"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"close",null),s.__decorate([(0,h.Post)("/get/dir"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"getDir",null),s.__decorate([(0,h.Post)("/get/file/text"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"getFileText",null),s.__decorate([(0,h.Post)("/update/file/text"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"updateFileText",null),s.__decorate([(0,h.Post)("/create"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"create",null),s.__decorate([(0,h.Post)("/delete"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"deletes",null),s.__decorate([(0,h.Post)("/move"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"move",null),s.__decorate([(0,h.Post)("/copy"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"copy",null),s.__decorate([(0,h.Put)("/"),s.__param(0,(0,h.Ctx)()),s.__param(1,(0,h.UploadedFile)("file")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,"function"==typeof(c=void 0!==y.default&&y.default.File)?c:Object]),s.__metadata("design:returntype",Promise)],m.prototype,"uploadFile",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_open),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"open",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_send),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"send",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_cancel),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"cancel",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_cd),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"cd",null),s.__decorate([(0,h.Post)("/tag/save"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Array]),s.__metadata("design:returntype",void 0)],m.prototype,"save",null),s.__decorate([(0,h.Get)("/tag"),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[]),s.__metadata("design:returntype",void 0)],m.prototype,"get",null),t.SSHController=m=s.__decorate([(0,h.Controller)("/ssh")],m)},2153:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.sshService=t.SshService=t.navindex_remote_ssh_key=void 0;var f=r(5584),p=r(6387),h=r(4988),d=(r(2203).Readable,r(6261)),v=r(3776),y=f.__importDefault(r(6928)),m=f.__importDefault(r(9896)),b=f.__importDefault(r(7075)),_=r(274),g=r(5890),E=r(5453);t.navindex_remote_ssh_key="navindex_remote_ssh_key";var w=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),r=t,n=[{key:"start",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return",!0);case 3:return t.next=5,this.connect(e);case 5:return r=t.sent,this.lifeStart(p.SshPojo.getKey(e),r,(function(e){return f.__awaiter(n,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{r[v.sftp_client].end(),r.end()}catch(e){console.log("触发",e)}case 1:case"end":return e.stop()}}),e)})))})),t.abrupt("return",!0);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"close",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.lifeGetData(p.SshPojo.getKey(e))&&this.lifeClose(p.SshPojo.getKey(e)),t.abrupt("return",!0);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getDir",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return",[]);case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return",this.sftGetDir(e,r));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getFileText",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.next=6,this.sftGetFileStats(e.file,r);case 6:if(!(t.sent.size>20971520)){t.next=9;break}return t.abrupt("return",(0,g.Fail)("超过20MB",E.RCode.File_Max));case 9:return t.t0=g.Sucess,t.next=12,this.sftGetFileText(e,r);case 12:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"updateFileText",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return",this.sftUpdateFileText(e,r));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"create",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:if(!e.dir){t.next=8;break}return t.next=6,this.sftCreateDir(e,r);case 6:t.next=12;break;case 8:if(!e.file){t.next=12;break}return e.context="",t.next=12,this.sftUpdateFileText(e,r);case 12:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 14:case"end":return t.stop()}}),t,this)})))}},{key:"deletes",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:if(!e.dir){t.next=8;break}return t.next=6,this.sftDelteFolder(e.dir,r);case 6:t.next=11;break;case 8:if(!e.file){t.next=11;break}return t.next=11,this.sftDelteFile(e.file,r);case 11:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 13:case"end":return t.stop()}}),t,this)})))}},{key:"move",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return t.next=5,this.sftMoveFile(e.source,e.target,r);case 5:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 7:case"end":return t.stop()}}),t,this)})))}},{key:"copy",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return t.next=5,this.sftCopyFile(e.source,e.target,r);case 5:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 7:case"end":return t.stop()}}),t,this)})))}},{key:"open",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r=e.context,n=e.wss,a=new d,n.dataMap.set("emitter",a),i=this.lifeGetData(p.SshPojo.getKey(r))){t.next=8;break}return t.abrupt("return","");case 8:i.shell((function(t,o){o.setWindow(r.rows,r.cols),o.write("cd '".concat(r.init_path,"' \r")),o.on("data",(function(t){var r=new h.WsData(h.CmdType.remote_shell_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.on("data",(function(e){o.write(e)})),n.ws.on("close",(function(){o.end("exit\r")}))})),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.log(t.t0);case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{key:"send",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e.context,r=e.wss,(n=r.dataMap.get("emitter"))&&null!==e.context&&"null"!==e.context&&n.emit("data",e.context)}catch(e){console.log(e)}case 1:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){var t=e.wss.dataMap.get("emitter");t&&t.emit("data","exit\r")}},{key:"cd",value:function(e){var t=e.wss.dataMap.get("emitter");t&&e.context&&t.emit("data","cd '".concat(e.context,"' \r"))}},{key:"download",value:function(e){var t=e.request.query.file;if(!t||!t.length)return e.status=404,void(e.body="File not found");e.attachment(t),e.set("Content-Type","application/octet-stream");var r=new b.default.PassThrough;e.body=r;var n=this.lifeGetData(p.SshPojo.getKey(e.request.query));if(!n)return e.body="";this.sftGet(n).createReadStream(t).pipe(r)}},{key:"uploadFile",value:function(e,t){var r=this.lifeGetData(p.SshPojo.getKey(e.request.query)),n=this.sftGet(r),o=e.request.query.target,a=_.DataUtil.writeFileSyncTemp(y.default.basename(o),"tempfile",t.buffer),i=m.default.createReadStream(a),c=n.createWriteStream(o);return i.on("data",(function(e){})),new Promise((function(e,t){i.pipe(c),c.on("close",(function(){e(1),i.close(),m.default.unlinkSync(a)})),c.on("error",(function(e){t(e)}))}))}}],n&&a(r.prototype,n),i&&a(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(v.SshSsh2);t.SshService=w,t.sshService=new w},3776:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SshSsh2=t.sftp_client=void 0;var h=r(5584),d=r(6387),v=r(8076),y=r(7699),m=r(9643),b=(r(6261),r(6804)),_=h.__importDefault(r(9896));t.sftp_client="sftp_client_key";var g=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),u(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(r,e),n=r,a=[{key:"connect",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,o=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={host:e.domain,port:e.port,username:e.username,keepaliveInterval:1e4,keepaliveCountMax:10},e.private_path?n.privateKey=_.default.readFileSync(e.private_path):e.password&&(n.password=e.password),r.abrupt("return",new Promise((function(r,a){var c=new b.Client;c.on("ready",(function(){return h.__awaiter(this,void 0,void 0,i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("连接ssh成功"),e.next=3,new Promise((function(e,t){c.sftp((function(t,r){if(t)throw t;e(r)}))}));case 3:n=e.sent,c[t.sftp_client]=n,r(c);case 6:case"end":return e.stop()}}),e)})))})).connect(n).on("error",(function(e){r(!1)})).on("close",(function(){r(!1),console.log("ssh关闭"),o.lifeClose(d.SshPojo.getKey(e));try{c[t.sftp_client].end()}catch(e){console.log(e)}}))})));case 3:case"end":return r.stop()}}),r)})))}},{key:"sftGet",value:function(e){return e[t.sftp_client]}},{key:"sftGetFileStats",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).stat(e,(function(e,t){r(e?null:t)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftGetDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t),i=e.dir,c={files:[],folders:[]};a.readdir(i,(function(e,t){if(e)throw e;t.forEach((function(e){var t,r,n=16384==(61440&e.attrs.mode),o=40960==(61440&e.attrs.mode),a=e.filename,i=(0,y.formatFileSize)(e.attrs.size),s=e.attrs.mtime,u=(0,y.getShortTime)(new Date(s).getTime());n?null===(r=c.folders)||void 0===r||r.push({type:v.FileTypeEnum.folder,name:a,mtime:u,isLink:o}):null===(t=c.files)||void 0===t||t.push({type:v.FileTypeEnum.text,name:a,mtime:u,size:i,isLink:o})})),r(c)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftGetFileText",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t),i="",c=a.createReadStream(e.file);c.on("data",(function(e){i+=e.toString()})),c.on("end",(function(){r(i)})),c.on("error",(function(e){console.error("Error downloading file:",e),r("")}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftUpdateFileText",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t).createWriteStream(e.file);a.write(e.context,"utf-8"),a.end(),a.on("close",(function(){console.log("File uploaded successfully"),r(!0)})),a.on("error",(function(e){console.error("Error uploading file:",e),r(!1)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftCreateDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).mkdir(e.dir,(function(e){e?console.error("Error creating folder:",e):console.log("Folder created successfully"),r(!0)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDelteFile",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).unlink(e,(function(e){e&&console.error("Error deleting file:",e),r(!0)}))})));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDelteFolder",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,n){t.exec("rm -r ".concat(e),(function(e,t){if(e)throw e;t.on("close",(function(e,t){r(!0)}))}))})));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDeletes",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,a,c,s,u,l,f,p,h,d,v;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=[],a=[],r.next=4,this.sftGetDir(e,t);case 4:(c=r.sent)&&(s=c.files,(u=c.folders)&&(a=u.map((function(e){return e.name}))),s&&(n=s.map((function(e){return e.name})))),l=o(n),r.prev=7,l.s();case 9:if((f=l.n()).done){r.next=15;break}return p=f.value,r.next=13,this.sftDelteFile(p,t);case 13:r.next=9;break;case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(7),l.e(r.t0);case 20:return r.prev=20,l.f(),r.finish(20);case 23:h=o(a),r.prev=24,h.s();case 26:if((d=h.n()).done){r.next=32;break}return v=d.value,r.next=30,this.sftDelteFolder(v,t);case 30:r.next=26;break;case 32:r.next=37;break;case 34:r.prev=34,r.t1=r.catch(24),h.e(r.t1);case 37:return r.prev=37,h.f(),r.finish(37);case 40:case"end":return r.stop()}}),r,this,[[7,17,20,23],[24,34,37,40]])})))}},{key:"sftCopyFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.asyncExec((function(n,o){r.exec("cp -r ".concat(e," ").concat(t),(function(e,t){if(e)throw e;t.on("close",(function(e,t){n(!0)}))}))})));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"sftMoveFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.asyncExec((function(n,o){r.exec("mv ".concat(e," ").concat(t),(function(e,t){if(e)throw e;t.on("close",(function(e,t){n(!0)}))}))})));case 1:case"end":return n.stop()}}),n,this)})))}}],a&&c(n.prototype,a),s&&c(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,s}(m.LifecycleRecordService);t.SshSsh2=g},6820:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(5443),f=r(9334),p=r(6001),h=r(4138),d=r(9546),v=r(5397),y=r(2740),m=r(5890),b=r(6406),_=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"get",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getSysIno());case 1:case"end":return e.stop()}}),e)})))}},{key:"disk",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getDisk());case 1:case"end":return e.stop()}}),e)})))}},{key:"fileDisk",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getFileDisk());case 1:case"end":return e.stop()}}),e)})))}},{key:"sys",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.SysSystemServiceImpl.sys(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"get_all_images",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(v.SysDockerServiceImpl.get_all_images()));case 1:case"end":return e.stop()}}),e)})))}},{key:"delete_image",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.delete_image(e.ids);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"check_image_delete",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,v.SysDockerServiceImpl.check_image_delete(e.ids);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"dockerSwitch",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerSwitch(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerDelContainer",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerDelContainer(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"processGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.SysProcessServiceImpl.processGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"processClose",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.SysProcessServiceImpl.processClose(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"systemdInsideGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.systemdInsideGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"getAllSystemd",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(y.systemd.getAllSystemd()));case 1:case"end":return e.stop()}}),e)})))}},{key:"addAllSystemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.addSystemd(e.unit_name);case 2:return t.abrupt("return",(0,m.Sucess)(y.systemd.getAllInsideSystemd()));case 3:case"end":return t.stop()}}),t)})))}},{key:"getInsideAllSystemd",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(y.systemd.getAllInsideSystemd()));case 1:case"end":return e.stop()}}),e)})))}},{key:"deleteAllSystemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.deleteSystemd(e.unit_name);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"get_systemd_context",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,y.systemd.get_systemd_context(e.unit_name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"delte_systemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,y.systemd.delete_sys_systemd(e.unit_name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"systemd_logs_get",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.systemd_logs_get(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"get_disk_info",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,h.SysSystemServiceImpl.diskSmartctl(e.name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"get_lsblk_info",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(h.SysSystemServiceImpl.get_lsblk_info()));case 1:case"end":return e.stop()}}),e)})))}},{key:"get_lvm_info",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(h.SysSystemServiceImpl.get_lvm_info()));case 1:case"end":return e.stop()}}),e)})))}},{key:"cmd_exe",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.SysSystemServiceImpl.cmd_exe(e);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysController=_,c.__decorate([(0,f.Get)("/base"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get",null),c.__decorate([(0,f.Get)("/disk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"disk",null),c.__decorate([(0,f.Get)("/filedisk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"fileDisk",null),c.__decorate([(0,s.msg)(u.CmdType.sys_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"sys",null),c.__decorate([(0,s.msg)(u.CmdType.docker_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerGet",null),c.__decorate([(0,f.Get)("/docker/images"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_all_images",null),c.__decorate([(0,f.Post)("/docker/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"delete_image",null),c.__decorate([(0,f.Post)("/docker/check/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"check_image_delete",null),c.__decorate([(0,s.msg)(u.CmdType.docker_switch),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerSwitch",null),c.__decorate([(0,s.msg)(u.CmdType.docker_del_container),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerDelContainer",null),c.__decorate([(0,s.msg)(u.CmdType.process_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"processGet",null),c.__decorate([(0,s.msg)(u.CmdType.process_close),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"processClose",null),c.__decorate([(0,s.msg)(u.CmdType.systemd_inside_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"systemdInsideGet",null),c.__decorate([(0,f.Get)("/systemd/allget"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"getAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/add"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"addAllSystemd",null),c.__decorate([(0,f.Get)("/systemd/inside/all"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"getInsideAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"deleteAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/get/context"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"get_systemd_context",null),c.__decorate([(0,f.Post)("/systemd/sys/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"delte_systemd",null),c.__decorate([(0,s.msg)(u.CmdType.systemd_logs_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"systemd_logs_get",null),c.__decorate([(0,f.Post)("/sys/disk/info"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"get_disk_info",null),c.__decorate([(0,f.Get)("/disk/blk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_lsblk_info",null),c.__decorate([(0,f.Get)("/disk/lvm"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_lvm_info",null),c.__decorate([(0,f.Post)("/cmd/exe"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[b.SysCmdExePojo]),c.__metadata("design:returntype",Promise)],_.prototype,"cmd_exe",null),t.SysController=_=c.__decorate([(0,l.Service)(),(0,f.Controller)("/sys")],_)},5397:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,c,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,c)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysDockerServiceImpl=void 0;var f=r(5584),p=r(4988),h=r(5317),d=r(9005),v=r(5101),y=f.__importDefault(r(5086)),m=null,b=null,_=[],g=new Map,E=new Map,w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"pushDockerInfo",value:function(e,t){return f.__awaiter(this,void 0,void 0,s().mark((function r(){var n;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=new p.WsData(p.CmdType.docker_getting)).context=t,e.ws.readyState!==y.default.CLOSED){r.next=4;break}throw"断开连接";case 4:e.sendData(n.encode());case 5:case"end":return r.stop()}}),r)})))}},{key:"openDockerPush",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.getDockerInfo(),t.next=4,this.pushDockerInfo(e,_);case 4:t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(0),E.delete(e.id),t.abrupt("return");case 10:m||(m=setInterval((function(){return f.__awaiter(r,void 0,void 0,s().mark((function e(){var t,r,n,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==E.size){e.next=5;break}return clearInterval(m),m=null,this.killDockerSpwn(),e.abrupt("return");case 5:t=E.keys(),r=a(t),e.prev=7,r.s();case 9:if((n=r.n()).done){e.next=24;break}return o=n.value,i=E.get(o),e.prev=12,e.next=15,this.pushDockerInfo(i,_);case 15:e.next=22;break;case 17:e.prev=17,e.t0=e.catch(12),console.log("docker信息推送失败docker",e.t0),E.delete(o),i&&i.ws.close();case 22:e.next=9;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(7),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[7,26,29,32],[12,17]])})))}),1e3));case 11:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"get_all_images",value:function(){var e=[],t=(0,h.execSync)('docker images --format "{{.ID}};;{{.Repository}}:{{.Tag}};;{{.CreatedAt}};;{{.Size}}"');t=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>0}));for(var r=1;r<t.length;r++){var n=t[r].split(";;").filter((function(e){return e.length>0}));e.push([n[0],n[1],n[2],n[3]])}return e}},{key:"getAllContainer",value:function(){var e=_;_=[];var t=(0,h.execSync)('docker ps -a --no-trunc --format "table {{.ID}};;{{.Names}};;{{.Image}};;{{.Command}};;{{.Status}}"');t=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>0}));for(var r=1;r<t.length;r++){var n=t[r].split(";;").filter((function(e){return e.length>0})),o=g.get(n[0]),a=null!=o?e[o]:void 0;_.push([n[0].slice(0,10),n[1],n[2],n[3],n[4],void 0!==a?a[5]:0,void 0!==a?a[6]:0]),g.set(n[0],r-1)}}},{key:"killDockerSpwn",value:function(){b&&(d.SystemUtil.killProcess(b.pid),b=null)}},{key:"getDockerInfo",value:function(){var e=this;try{if(b)return;this.getAllContainer();var t=(0,h.spawn)('docker stats --no-trunc --format "table {{.ID}};;{{.MemUsage}};;{{.CPUPerc}}"',o(_.map((function(e){return e[0]}))),{shell:(0,v.getShell)()});b=t,t.stdout.on("data",(function(t){if(t||t.toString()){for(var r=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>1})),n=1;n<r.length;n++){var o=r[n].split(";;").filter((function(e){return e.length>0}));if(o.length<3)break;var a=g.get(o[0]);if("number"==typeof a){var i=o[1].split("/")[0];_[a][5]=i,_[a][6]=o[2]}}0===E.size&&e.dockerClear()}})),t.stderr.on("data",(function(r){console.error("stderr: ".concat(r)),t.kill(),e.dockerClear()})),t.on("error",(function(t){console.error("Error:",t),e.dockerClear()}))}catch(e){console.log(e),this.dockerClear()}}},{key:"dockerClear",value:function(){m&&(clearInterval(m),m=null),this.killDockerSpwn(),E.clear()}},{key:"dockerGet",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!E.get(r)){t.next=3;break}return t.abrupt("return");case 3:if(d.SystemUtil.commandIsExist(" docker ps")){t.next=6;break}return e.wss.ws.close(),t.abrupt("return");case 6:return E.set(e.wss.id,e.wss),t.next=9,this.openDockerPush(e.wss);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"dockerSwitch",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("start"!==e.context.type){t.next=5;break}return t.next=3,(0,h.exec)("docker start ".concat(e.context.dockerId));case 3:t.next=8;break;case 5:if("stop"!==e.context.type){t.next=8;break}return t.next=8,(0,h.exec)("docker stop ".concat(e.context.dockerId));case 8:this.getAllContainer();case 9:case"end":return t.stop()}}),t,this)})))}},{key:"dockerDelContainer",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,h.exec)("docker stop ".concat(e.context.dockerId));case 2:return t.next=4,(0,h.exec)("docker rm ".concat(e.context.dockerId));case 4:case"end":return t.stop()}}),t)})))}},{key:"check_image_delete",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r,n,o,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=[],n=a(e);try{for(n.s();!(o=n.n()).done;)i=o.value,(0,h.execSync)("docker ps -a --filter ancestor=".concat(i,' --format "{{.ID}}"')).toString().trim()&&r.push(i)}catch(e){n.e(e)}finally{n.f()}return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))}},{key:"delete_image",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.join(" "),(0,h.execSync)("docker rm ".concat(r));case 2:case"end":return t.stop()}}),t)})))}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysDockerServiceImpl=new w},9546:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysProcessServiceImpl=t.SysProcessService=void 0;var u=r(5584),l=r(4988),f=r(5101),p=r(9005),h=r(5317),d=r(9044),v=r(4908),y=u.__importDefault(r(5086)),m=null,b=(0,d.getProcessAddon)(),_=[],g=new Map,E=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"winAndLinuxGetProcess",value:function(){var e=this;b.on("process",(function(t){if(Array.isArray(t)){var r,n=[],o=a(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.push([i.id,i.name,i.user_name,i.mem,i.cpu?i.cpu.toFixed(2):0])}}catch(e){o.e(e)}finally{o.f()}_=n,0===g.size&&e.clear()}}),[])}},{key:"linuxGetProcess",value:function(){var e=this,t=(0,h.spawn)("top",["-b"],{env:{COLUMNS:"800"}});b=t,t.stdout.on("data",(function(t){if(t||t.toString()){for(var r=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>5})),n=[],o=1;o<r.length;o++){var a=r[o].split(" ").filter((function(e){return e.length>0}));a[0].includes("PID")||n.push([a[0],a[a.length-1],a[1],1024*a[5],a[8]])}_=n,0===g.size&&e.clear()}})),t.stderr.on("data",(function(r){console.error("stderr: ".concat(r.toString())),t.kill(),e.clear()})),t.on("error",(function(t){console.error("Error:",t),e.clear()})),t.on("close",(function(t){e.clear(),console.log("child process exited with code ".concat(t))}))}},{key:"pushProcessInfo",value:function(e,t){return u.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=new l.WsData(l.CmdType.process_getting)).context=t,e.ws.readyState!==y.default.CLOSED){r.next=4;break}throw"断开连接";case 4:e.sendData(n.encode());case 5:case"end":return r.stop()}}),r)})))}},{key:"openProcessPush",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.getProcessInfo(),t.next=4,this.pushProcessInfo(e,_);case 4:t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(0),g.delete(e.id),t.abrupt("return");case 10:m||(m=setInterval((function(){return u.__awaiter(r,void 0,void 0,o().mark((function e(){var t,r,n,i,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==g.size){e.next=5;break}return clearInterval(m),m=null,this.killSpwn(),e.abrupt("return");case 5:t=g.keys(),r=a(t),e.prev=7,r.s();case 9:if((n=r.n()).done){e.next=24;break}return i=n.value,c=g.get(i),e.prev=12,e.next=15,this.pushProcessInfo(c,_);case 15:e.next=22;break;case 17:e.prev=17,e.t0=e.catch(12),console.log(e.t0),console.log("系统信息推送失败进程"),c&&(c.ws.close(),g.delete(i));case 22:e.next=9;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(7),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[7,26,29,32],[12,17]])})))}),1e3));case 11:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"killSpwn",value:function(){var e=(0,f.getSys)();e===v.SysEnum.linux||e==v.SysEnum.win?b.close("process"):(b.kill("SIGTERM"),p.SystemUtil.killProcess(b.pid))}},{key:"getProcessInfo",value:function(){try{var e=(0,f.getSys)();e===v.SysEnum.linux||e==v.SysEnum.win?this.winAndLinuxGetProcess():this.linuxGetProcess()}catch(e){console.log(e),this.clear()}}},{key:"clear",value:function(){m&&(clearInterval(m),m=null),this.killSpwn(),g.clear()}},{key:"processGet",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!g.get(r)){t.next=3;break}return t.abrupt("return");case 3:return g.set(e.wss.id,e.wss),t.next=6,this.openProcessPush(e.wss);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"processClose",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p.SystemUtil.killProcess(e.context.pid);case 1:case"end":return t.stop()}}),t)})))}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysProcessService=E,t.SysProcessServiceImpl=new E},6001:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SyserviceImpl=t.SysService=void 0;var u=r(5584),l=u.__importDefault(r(333)),f=u.__importDefault(r(857)),p=r(5890),h=r(6406),d=r(7699),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getSysIno",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.cpu();case 2:return t=e.sent,r=f.default.totalmem(),e.abrupt("return",(0,p.Sucess)({mem_total:(r/1073741824).toFixed(2),cpu_manufacturer:t.manufacturer,cpu_brand:t.brand,cpu_core_num:t.cores,cpu_phy_core_num:t.physicalCores,cpu_speed_hz:t.speedMax}));case 5:case"end":return e.stop()}}),e)})))}},{key:"getDisk",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.diskLayout();case 2:t=e.sent,r=[],n=o(null!=t?t:[]);try{for(n.s();!(a=n.n()).done;)c=a.value,(s=new h.DiskDevicePojo).name=c.device,s.typeName=c.name,s.total=(0,d.formatFileSize)(c.size),c.type&&(c.type.includes("SD")?s.type="固态":s.type="机械"),r.push(s)}catch(e){n.e(e)}finally{n.f()}return e.abrupt("return",(0,p.Sucess)(r));case 7:case"end":return e.stop()}}),e)})))}},{key:"getFileDisk",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s,u,f,v,y,m,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.fsSize();case 2:return t=e.sent,e.next=5,l.default.blockDevices();case 5:r=e.sent,n=new Map,a=o(null!=t?t:[]);try{for(a.s();!(c=a.n()).done;)s=c.value,n.set(s.mount,s)}catch(e){a.e(e)}finally{a.f()}u=[],f=o(null!=r?r:[]);try{for(f.s();!(v=f.n()).done;)y=v.value,m=new h.DiskFilePojo,b=n.get(y.mount),m.name=y.name,m.fsType=y.fsType,m.mount=y.mount,m.device_name=y.device,b&&(m.total=(0,d.formatFileSize)(b.size),m.available=(0,d.formatFileSize)(b.available)),u.push(m),n.delete(y.mount)}catch(e){f.e(e)}finally{f.f()}return n.size>0&&n.forEach((function(e){var t=new h.DiskFilePojo;t.name=e.fs,t.fsType=e.type,t.mount=e.mount,t.total=(0,d.formatFileSize)(e.size),t.available=(0,d.formatFileSize)(e.available),u.push(t)})),e.abrupt("return",(0,p.Sucess)(u));case 14:case"end":return e.stop()}}),e)})))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysService=v,t.SyserviceImpl=new v},4138:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysSystemServiceImpl=void 0;var u=r(5584),l=r(4988),f=u.__importDefault(r(333)),p=u.__importDefault(r(857)),h=u.__importDefault(r(5086)),d=(r(9896),r(6406)),v=r(5317),y=r(9044),m=r(9426),b=null,_=new Map,g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"openSysPush",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(b){t.next=4;break}b=setInterval((function(){return u.__awaiter(r,void 0,void 0,o().mark((function e(){var t,r,n,i,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==_.size){e.next=4;break}return clearInterval(b),b=null,e.abrupt("return");case 4:t=_.keys(),r=a(t),e.prev=6,r.s();case 8:if((n=r.n()).done){e.next=24;break}return i=n.value,c=_.get(i),e.prev=11,e.next=14,this.pushSysInfo(c);case 14:e.next=22;break;case 16:e.prev=16,e.t0=e.catch(11),console.log("系统信息推送失败sys,原因:",e.t0),clearInterval(b),b=null,c&&_.delete(i);case 22:e.next=8;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(6),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[6,26,29,32],[11,16]])})))}),1e3),t.next=12;break;case 4:return t.prev=4,t.next=7,this.pushSysInfo(e);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),_.delete(e.id);case 12:case"end":return t.stop()}}),t,this,[[4,9]])})))}},{key:"pushSysInfo",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.default.currentLoad();case 2:if(r=t.sent,n=p.default.totalmem(),a=p.default.freemem(),(i=new l.WsData(l.CmdType.sys_getting)).context={memTotal:(n/1073741824).toFixed(2),memLeft:(a/1073741824).toFixed(2),cpu_currentLoad:r.currentLoad.toFixed(2)},e.ws.readyState!==h.default.CLOSED){t.next=9;break}throw"断开连接";case 9:e.sendData(i.encode());case 10:case"end":return t.stop()}}),t)})))}},{key:"sys",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!_.get(r)){t.next=3;break}return t.abrupt("return");case 3:return _.set(e.wss.id,e.wss),t.next=6,this.openSysPush(e.wss);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"diskSmartctl",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s,u,l;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new d.DiskCheckInfo,t.prev=1,i=(0,v.execSync)("".concat((0,y.getSmartctl)()," -a --json ").concat(e)).toString(),n=JSON.parse(i),t.next=13;break;case 6:if(t.prev=6,t.t0=t.catch(1),4!==t.t0.status){t.next=12;break}n=JSON.parse(t.t0.stdout),t.next=13;break;case 12:throw t.t0;case 13:if(r.model_name=n.model_name,r.serial_number=n.serial_number,r.firmware_version=n.firmware_version,r.rotation_rate=n.rotation_rate,n.smart_status&&(r.smart_status=n.smart_status.passed),r.power_cycle_count=n.power_cycle_count,n.power_on_time&&(r.power_on_time_hours=n.power_on_time.hours),n.temperature&&(r.temperature=n.temperature.current),n.device&&(r.device_protocol=n.device.protocol),n.ata_smart_attributes&&n.ata_smart_attributes.table){c=[],s=a(n.ata_smart_attributes.table);try{for(s.s();!(u=s.n()).done;)l=u.value,c.push([l.name,l.value,l.worst,l.thresh])}catch(e){s.e(e)}finally{s.f()}r.ata_smart_attributes=c}return t.abrupt("return",r);case 24:case"end":return t.stop()}}),t,null,[[1,6]])})))}},{key:"get_lsblk_info",value:function(){var e,t,r=(0,v.execSync)(" lsblk --output-all --json").toString(),n=[],o=a(null!==(e=JSON.parse(r).blockdevices)&&void 0!==e?e:[]);try{for(o.s();!(t=o.n()).done;){var i=t.value;"disk"===i.type&&n.push(i)}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"get_lvm_info",value:function(){var e,t=[],r=a(JSON.parse((0,v.execSync)(" vgs --reportformat json").toString()).report[0].vg);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=new m.vg_item;o.name=n.vg_name,o.size=n.vg_size,o.lv_count=n.lv_count,o.pv_cout=n.pv_count,o.free_size=n.vg_free;var i,c=JSON.parse((0,v.execSync)("pvs --select vg_name=".concat(n.vg_name," --reportformat json")).toString()).report[0].pv,s=a(null!=c?c:[]);try{for(s.s();!(i=s.n()).done;){var u=i.value;o.pv_list.push({name:u.pv_name,free_size:u.pv_free,size:u.pv_size})}}catch(e){s.e(e)}finally{s.f()}var l,f=JSON.parse((0,v.execSync)("lvs --select vg_name=".concat(n.vg_name," --reportformat json")).toString()).report[0].lv,p=a(null!=f?f:[]);try{for(p.s();!(l=p.n()).done;){var h=l.value;o.lv_list.push({name:h.lv_name,size:h.lv_size})}}catch(e){p.e(e)}finally{p.f()}t.push(o)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"cmd_exe",value:function(e){e.type===d.SysCmd.mount&&(0,v.execSync)("sudo mount -a")}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysSystemServiceImpl=new g},2740:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.systemd=t.SysSystemdService=void 0;var f=r(5584),p=r(4988),h=r(274),d=r(9044),v=r(8932),y=f.__importDefault(r(9896)),m=r(5317),b=m.spawn,_=m.execSync,g=f.__importDefault(r(5086)),E="systemd_key",w=(0,d.getProcessAddon)(),P=new Set,S=null,k=[],A="",T=new Map,O=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"getAllSystemd",value:function(){var e=_("systemctl list-units --type=service --output=json").toString();return JSON.parse(e)}},{key:"getAllInsideSystemd",value:function(){var e;return null!==(e=h.DataUtil.get(E))&&void 0!==e?e:[]}},{key:"addSystemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[],o=i(n),t.prev=2,o.s();case 4:if((c=o.n()).done){t.next=10;break}if(c.value!==e){t.next=8;break}return t.abrupt("return");case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),o.e(t.t0);case 15:return t.prev=15,o.f(),t.finish(15);case 18:n.push(e),h.DataUtil.set(E,n),A=n.join(" "),this.getSytemdPids(n).then((function(e){var t=e.pids,r=e.pid_name_map;T=r,w.pids("systemd",t)})).catch((function(e){console.log(e)}));case 22:case"end":return t.stop()}}),t,this,[[2,12,15,18]])})))}},{key:"deleteSystemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[],(0,v.deleteList)(n,(function(t){return t===e})),h.DataUtil.set(E,n),A=n.join(" "),this.getSytemdPids(n).then((function(e){var t=e.pids,r=e.pid_name_map;T=r,w.pids("systemd",t)})).catch((function(e){console.log(e)}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getSytemdPids",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Map,n=[],o=[],c=e.map((function(e){return(e=e.trim()).endsWith(".service")?e:e+".service"})).join("|"),_("systemctl list-units --type=service | grep -E '".concat(c,"'")).toString().split("\n").filter((function(e){return e})).forEach((function(t){for(var a,c=t.split(/\s+/),s=0;s<c.length&&!(s>1);s++){var u,l=c[s],f=i(e);try{for(f.s();!(u=f.n()).done;){var p=u.value;if(l.includes(p)){a=l;break}}}catch(e){f.e(e)}finally{f.f()}if(a)break}if(a){var h=_("systemctl show ".concat(a," --property=MainPID")).toString().split("=")[1].trim();if(h&&"0"!==h){var d=parseInt(h);o.push(d),r.set(d,a)}else n.push(a)}})),t.abrupt("return",{pids:o,pid_name_map:r,not_pid_names:n});case 8:case"end":return t.stop()}}),t)})))}},{key:"clear",value:function(){w.close("systemd"),S&&(clearInterval(S),S=null),P.clear()}},{key:"systemdGet",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c,s,u,l=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(P.add(e.wss),!S){t.next=3;break}return t.abrupt("return");case 3:if(0!==(n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[]).length){t.next=6;break}return t.abrupt("return");case 6:return A=n.join(" "),t.next=9,this.getSytemdPids(n);case 9:o=t.sent,c=o.pids,s=o.pid_name_map,u=o.not_pid_names,T=s,w.on("systemd",(function(e){if(Array.isArray(e)){var t,r=[],n=i(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;r.push([o.id,T.get(o.id),o.name,o.user_name,o.mem,o.cpu?o.cpu.toFixed(2):0])}}catch(e){n.e(e)}finally{n.f()}var a,c=i(u);try{for(c.s();!(a=c.n()).done;){var s=a.value;r.push([0,s,"","",0,0])}}catch(e){c.e(e)}finally{c.f()}k=r,0===P.size&&l.clear()}}),c);case 15:case"end":return t.stop()}}),t,this)})))}},{key:"pushInfo",value:function(e,t,r){return f.__awaiter(this,void 0,void 0,a().mark((function n(){var i,c;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=[],t.forEach((function(e,t){if(r[t]){var n=o(e),a=r[t].trim();n.push(a),i.push(n)}})),(c=new p.WsData(p.CmdType.systemd_inside_getting)).context=i,e.ws.readyState!==g.default.CLOSED){n.next=6;break}throw"断开连接";case 6:e.sendData(c.encode());case 7:case"end":return n.stop()}}),n)})))}},{key:"systemdInsideGet",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.systemdGet(e);case 2:if(A){t.next=4;break}return t.abrupt("return");case 4:S||(S=setInterval((function(){return f.__awaiter(r,void 0,void 0,a().mark((function e(){var t,r,n,o,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==P.size){e.next=5;break}return clearInterval(S),S=null,this.clear(),e.abrupt("return");case 5:t=_("systemctl is-active ".concat(A)).toString(),r=t.trim().split("\n"),n=i(P.values()),e.prev=8,n.s();case 10:if((o=n.n()).done){e.next=23;break}return c=o.value,e.prev=12,e.next=15,this.pushInfo(c,k,r);case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(12),console.log("systemd推送失败systemd",e.t0),c&&(c.ws.close(),P.delete(c));case 21:e.next=10;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(8),n.e(e.t1);case 28:return e.prev=28,n.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,this,[[8,25,28,31],[12,17]])})))}),1e3));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"get_systemd_context",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_("systemctl show ".concat(e," --property=FragmentPath")).toString(),n=r.split("=")[1].replaceAll("\n",""),o=y.default.readFileSync(n),t.abrupt("return",{context:o.toString(),path:n});case 4:case"end":return t.stop()}}),t)})))}},{key:"delete_sys_systemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_("systemctl show ".concat(e," --property=FragmentPath")).toString(),n=r.split("=")[1].replaceAll("\n",""),_("sudo systemctl stop ".concat(e)),_("sudo systemctl disable ".concat(e)),_("sudo rm ".concat(n)),_("sudo systemctl daemon-reload"),_("sudo systemctl reset-failed"),t.next=9,this.deleteSystemd(e);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"systemd_logs_get",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.context;try{(n=b("journalctl",["-u","".concat(r.unit_name),"-f","-n",1e3])).stdout.on("data",(function(t){var r=new p.WsData(p.CmdType.systemd_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),n.stderr.on("data",(function(t){var r=new p.WsData(p.CmdType.systemd_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),n.on("close",(function(t){n&&(console.log("意外断开exec systemd"),n.kill()),e.wss.ws.close()})),e.wss.ws.on("close",(function(){n&&(console.log("意外断开exec systemd"),n.kill()),e.wss.ws.close()}))}catch(t){n&&(console.log("意外断开exec systemd"),n.kill(),e.wss.ws.close())}case 2:case"end":return t.stop()}}),t)})))}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysSystemdService=O,t.systemd=new O},9005:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SystemUtil=void 0;var i=r(5317),c=r(5101),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,n=[{key:"commandIsExist",value:function(e){try{return(0,i.execSync)(e,{stdio:"pipe"}),!0}catch(e){return!1}}},{key:"killProcess",value:function(t){"win"===c.sysType?e.commandIsExist("taskkill /pid ".concat(t," /f /t")):e.commandIsExist("kill -9 ".concat(t," "))}}],(r=null)&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();t.SystemUtil=s},788:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.UserController=void 0;var i=r(5584),c=r(9334),s=r(4908),u=r(5890),l=r(285),f=r(5443),p=r(4321),h=r(274),d=r(7285),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"login",value:function(e){var t=h.DataUtil.get("username");if(p.Env.username){if(e.username==="".concat(p.Env.username)&&e.password==="".concat(p.Env.password)){var r=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(r)),(0,u.Sucess)(r)}}else if(t){var n=h.DataUtil.get("password");if(e.username==="".concat(t)&&e.password==="".concat(n)){var o=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(o)),(0,u.Sucess)(o)}}else if("admin"===e.username&&"admin"===e.password){var a=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(a)),(0,u.Sucess)(a)}return(0,u.AuthFail)("密码错误")}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.UserController=v,i.__decorate([(0,c.Post)("/login"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[s.UserLogin]),i.__metadata("design:returntype",void 0)],v.prototype,"login",null),t.UserController=v=i.__decorate([(0,f.Service)(),(0,c.Controller)("/user")],v)},9116:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.VideoController=void 0;var i=r(5584),c=r(8411),s=r(4988),u=i.__importDefault(r(5086)),l=r(3017),f=r(9334),p=r(274),h=r(5890),d="navindex_video_tag_key",v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRtsp",value:function(e,t){l.videoService.getRtsp(decodeURIComponent(t.url),e)}},{key:"save",value:function(e){return p.DataUtil.set(d,e),(0,h.Sucess)("ok")}},{key:"get",value:function(){var e=p.DataUtil.get(d);return(0,h.Sucess)(e||[])}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.VideoController=v,i.__decorate([(0,c.otherMsg)(s.CmdType.rtsp_get),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[u.default,Object]),i.__metadata("design:returntype",void 0)],v.prototype,"getRtsp",null),i.__decorate([(0,f.Post)("/tag/save"),i.__param(0,(0,f.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Array]),i.__metadata("design:returntype",void 0)],v.prototype,"save",null),i.__decorate([(0,f.Get)("/tag"),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],v.prototype,"get",null),t.VideoController=v=i.__decorate([(0,f.Controller)("/video")],v)},3017:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.videoService=t.VideoService=void 0;var i=r(5584),c=i.__importDefault(r(7075)),s=i.__importDefault(r(5086)),u=r(9044),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRtsp",value:function(e,t){var r=new c.default.PassThrough,n=(0,u.getFfmpeg)()(e).inputOptions("-rtsp_transport","tcp").outputFormat("flv").videoCodec("copy").videoCodec("libx264").audioCodec("aac").on("start",(function(e){console.log("Spawned FFmpeg with command: "+e)})).on("error",(function(r){console.error("rtsp错误 ",e,r.message),t.close()})).on("end",(function(){console.error("rtsp结束",e),t.close()})).pipe(r);r.on("data",(function(e){t.readyState===s.default.OPEN?t.send(e):n.end()})),t.on("close",(function(){n.end()}))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.VideoService=l,t.videoService=new l},5890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sucess=function(e){return{code:arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.RCode.Sucess,data:e}},t.Fail=function(e){return{code:arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.RCode.Fail,message:e}},t.AuthFail=function(e){return{code:n.RCode.AuthFail,message:e}};var n=r(5453)},285:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"setToken",value:function(e){var t=this;this.token.set(e,{}),this.ignore_check||this.timerMap.set(e,setTimeout((function(){t.token.delete(e),t.timerMap.delete(e)}),36e5))}},{key:"updateTimer",value:function(e){var t=this;if(!this.ignore_update){var r=this.timerMap.get(e);r&&(clearTimeout(r),this.timerMap.set(e,setTimeout((function(){t.token.delete(e),t.timerMap.delete(e)}),36e5)))}}},{key:"getTokenMap",value:function(){return this.token}},{key:"getTokenTimerMap",value:function(){return this.timerMap}},{key:"setIgnore",value:function(e){this.ignore_update=e}},{key:"setIgnoreCheck",value:function(e){this.ignore_check=e}},{key:"clearTokenTimerMap",value:function(){this.timerMap.forEach((function(e){return clearTimeout(e)})),this.timerMap.clear()}},{key:"clear",value:function(){this.timerMap.clear(),this.token.clear()}},{key:"check",value:function(e){return this.token.has(e)}}],(t=null)&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.Cache=a,a.token=new Map,a.timerMap=new Map,a.ignore_update=!1,a.ignore_check=!1},3129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerEvent=void 0;var n=r(6261);t.ServerEvent=new n},1132:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.AuthMiddleware=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(7127),f=r(9625),p=r(2153),h=/^(?!.*\/api).*$/,d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.url.startsWith("/download")){r.next=3;break}return l.FileServiceImpl.download(e),r.abrupt("return");case 3:if(!e.url.startsWith("/ssh/download")){r.next=6;break}return p.sshService.download(e),r.abrupt("return");case 6:return r.next=8,f.settingService.intercept(e);case 8:if(!r.sent){r.next=10;break}return r.abrupt("return");case 10:if(-1===e.url.indexOf("/api/user/login")&&!h.test(e.url)){r.next=12;break}return r.abrupt("return",t());case 12:return n=e.headers.authorization,r.next=15,f.settingService.check(n);case 15:if(!r.sent){r.next=17;break}return r.abrupt("return",t());case 17:e.body=(0,u.AuthFail)("失败");case 18:case"end":return r.stop()}}),r)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.AuthMiddleware=d,t.AuthMiddleware=d=c.__decorate([(0,s.Middleware)({type:"before"})],d)},5515:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalErrorHandler=void 0;var c=r(5584),s=r(9334),u=r(5890),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t();case 3:r.next=9;break;case 5:r.prev=5,r.t0=r.catch(0),console.log("全局异常拦截",r.t0),e.body=JSON.stringify((0,u.Fail)(JSON.stringify(r.t0)));case 9:case"end":return r.stop()}}),r,null,[[0,5]])})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.GlobalErrorHandler=l,t.GlobalErrorHandler=l=c.__decorate([(0,s.Middleware)({type:"after"})],l)},2426:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.CheckTokenMiddleware=void 0;var i=r(5584),c=r(9334),s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return t()}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CheckTokenMiddleware=s,t.CheckTokenMiddleware=s=i.__decorate([(0,c.Middleware)({type:"after"})],s)},2511:e=>{"use strict";e.exports=require("@homebridge/node-pty-prebuilt-multiarch")},5695:e=>{"use strict";e.exports=require("@koa/cors")},2710:e=>{"use strict";e.exports=require("@xiaobaidadada/node-tuntap2-wintun")},7172:e=>{"use strict";e.exports=require("archiver")},1158:e=>{"use strict";e.exports=require("buffer")},6261:e=>{"use strict";e.exports=require("events")},1856:e=>{"use strict";e.exports=require("fluent-ffmpeg")},4652:e=>{"use strict";e.exports=require("fs-extra")},3688:e=>{"use strict";e.exports=require("https-proxy-agent")},6101:e=>{"use strict";e.exports=require("koa")},3152:e=>{"use strict";e.exports=require("koa-proxies")},904:e=>{"use strict";e.exports=require("mime-types")},8461:e=>{"use strict";e.exports=require("multer")},9551:e=>{"use strict";e.exports=require("needle")},2470:e=>{"use strict";e.exports=require("node-forge")},4505:e=>{"use strict";e.exports=require("node-process-watcher")},1231:e=>{"use strict";e.exports=require("node-unrar-js")},6384:e=>{"use strict";e.exports=require("protobufjs/minimal")},1321:e=>{"use strict";e.exports=require("reflect-metadata")},9485:e=>{"use strict";e.exports=require("rimraf")},9334:e=>{"use strict";e.exports=require("routing-controllers")},8474:e=>{"use strict";e.exports=require("serialize-javascript")},3211:e=>{"use strict";e.exports=require("socket.io-parser")},6804:e=>{"use strict";e.exports=require("ssh2")},6011:e=>{"use strict";e.exports=require("sshpk")},333:e=>{"use strict";e.exports=require("systeminformation")},6819:e=>{"use strict";e.exports=require("tar")},7989:e=>{"use strict";e.exports=require("tencentcloud-sdk-nodejs")},2953:e=>{"use strict";e.exports=require("tldts")},5584:e=>{"use strict";e.exports=require("tslib")},5443:e=>{"use strict";e.exports=require("typedi")},2029:e=>{"use strict";e.exports=require("unzipper")},5086:e=>{"use strict";e.exports=require("ws")},5317:e=>{"use strict";e.exports=require("child_process")},6982:e=>{"use strict";e.exports=require("crypto")},7194:e=>{"use strict";e.exports=require("dgram")},9896:e=>{"use strict";e.exports=require("fs")},9278:e=>{"use strict";e.exports=require("net")},8995:e=>{"use strict";e.exports=require("node:module")},7075:e=>{"use strict";e.exports=require("node:stream")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},3480:e=>{"use strict";e.exports=require("querystring")},3785:e=>{"use strict";e.exports=require("readline")},2203:e=>{"use strict";e.exports=require("stream")},4756:e=>{"use strict";e.exports=require("tls")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},3106:e=>{"use strict";e.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==o&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(t,r){function n(o,i,c,s){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function O(e,t,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(e,t,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,L(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,b;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),n.AsyncIterator=T,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new T(p(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=H,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return c.type="throw",c.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:H(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}},n}var r=__webpack_require__(5584);__webpack_require__(1321);var n=__webpack_require__(9334),o=__webpack_require__(1631),a=__webpack_require__(788),i=__webpack_require__(6820),c=__webpack_require__(72),s=__webpack_require__(6182),u=__webpack_require__(1132),l=__webpack_require__(5515),f=__webpack_require__(2426),p=r.__importDefault(__webpack_require__(6928)),h=r.__importDefault(__webpack_require__(9896)),d=__webpack_require__(5740),v=__webpack_require__(1076),y=(r.__importDefault(__webpack_require__(3152)),__webpack_require__(3468)),m=__webpack_require__(4321),b=__webpack_require__(828),_=__webpack_require__(8972),g=__webpack_require__(2992),E=__webpack_require__(3129),w=__webpack_require__(9116),P=__webpack_require__(8239),S=__webpack_require__(7285),k=__webpack_require__(1668),A=__webpack_require__(5086);!function(){r.__awaiter(this,void 0,void 0,t().mark((function e(){var T,O,L,C,x,I,H=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.Env.parseArgs();case 2:for(T=(0,n.createKoaServer)({cors:!0,routePrefix:"/api",classTransformer:!0,controllers:[a.UserController,i.SysController,c.ShellController,s.FileController,d.DdnsController,v.NetController,y.NavindexController,b.SettingController,_.SSHController,g.RdpController,w.VideoController,k.CryptoController],middlewares:[u.AuthMiddleware,l.GlobalErrorHandler,f.CheckTokenMiddleware]}),O=new A.Server({noServer:!0}),new o.WsServer(O).start(),L=new Set,C=0,x=Object.values(P.routerConfig);C<x.length;C++)I=x[C],L.add("/".concat(I)),L.add("".concat(I));T.use((function(e,n){return r.__awaiter(H,void 0,void 0,t().mark((function r(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.url.includes("/api/")){t.next=3;break}return n(),t.abrupt("return");case 3:if(t.prev=3,!L.has((0,S.getWebFirstKey)(e.url))){t.next=6;break}throw"";case 6:e.url.includes("excalidraw-assets")?(e.url=e.url.slice(1),o=p.default.join(__dirname,"dist",e.url)):o=p.default.join(__dirname,"dist",p.default.basename(e.url)),h.default.accessSync(o,h.default.constants.F_OK),e.body=h.default.createReadStream(o),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(3),e.type="html",e.body=h.default.createReadStream(p.default.join(__dirname,"dist","index.html"));case 15:case"end":return t.stop()}}),r,null,[[3,11]])})))})),T.listen(m.Env.port,(function(){var e="http://localhost:".concat(m.Env.port,"/");console.log("服务器正在运行 click ]8;;".concat(e,"\\").concat(e,"]8;;\\"))})).on("upgrade",(function(e,t,r){O.handleUpgrade(e,t,r,(function(t){O.emit("connection",t,e)}))})),E.ServerEvent.emit("start"),process.on("uncaughtException",(function(e){console.error("未捕获的异常:",e)}));case 10:case"end":return e.stop()}}),e)})))}()})()})();
1
+ (()=>{var __webpack_modules__={4321:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],s=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);s=!0);}catch(e){u=!0,o=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,c,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,c)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.Env=void 0;var f=r(5584),p=f.__importDefault(r(9896)),h=f.__importDefault(r(6928)),d=f.__importDefault(r(857)),v=r(5317).execSync,y=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},n=[{key:"parseArgs",value:function(){return f.__awaiter(this,void 0,void 0,s().mark((function e(){var t=this;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){for(var o=process.argv.slice(2),a={},i=0;i<o.length;i++){var c=o[i];if(c.startsWith("--")){var s=c.slice(2),u=!0;if(i+1<o.length&&!o[i+1].startsWith("--")&&(u=o[++i]),"true"===u?u=!0:"false"===u?u=!1:isNaN(u)||(u=Number(u)),a[s]=u,"install"===s)return"linux"!==d.default.platform()&&(console.log("sorry现在只支持linux"),process.exit()),void r(6557);"version"===s?(console.log("1.0.6"),process.exit()):"update"===s?(v("npm install -g filecat"),process.exit()):"help"===s?(console.log("\n1. update 升级(npm方式升级)\n2. remove 移除(从npm)\n3. version 版本\n4. help 帮助信息\n5. install 安装到systemd(只支持linux)\n6. uninstall 从systemd卸载(只支持linux)\n7 restart 重启systemd服务(只支持linux)\n8. port 输入端口\n9. env 输入环境配置文件\n10. work_dir 工作目录,软件执行需要生成一些数据,会放到这个目录下,默认是启动软件所在的目录下的data文件夹\n11. base_folder 软件管理的文件夹默认根路径,默认是启动软件所在的目录\n12. username 登录账号 默认是admin (截止到1.0.5目前没有权限功能)\n13. password 登录密码 默认是admin\n"),process.exit()):"stop"===s?("linux"!==d.default.platform()&&(console.log("sorry现在只支持linux"),process.exit()),v("sudo systemctl stop filecat"),process.exit()):"restart"===s?("linux"!==d.default.platform()&&(console.log("sorry现在只支持linux"),process.exit()),v("sudo systemctl daemon-reload"),v("sudo systemctl restart filecat"),process.exit()):"uninstall"===s&&("linux"!==d.default.platform()&&(console.log("sorry现在只支持linux"),process.exit()),v("sudo systemctl stop filecat"),v("sudo systemctl disable filecat"),v("sudo rm /etc/systemd/system/filecat.service"),v("sudo systemctl daemon-reload"),console.log("卸载完成"),process.exit())}}for(var l=0,f=Object.keys(a);l<f.length;l++){var p=f[l];t[p]=a[p]}t.env&&t.load(t.env),e(1)})));case 1:case"end":return e.stop()}}),e)})))}},{key:"updateEnv",value:function(e){if(this.env){for(var t=p.default.readFileSync(h.default.join(this.env),"utf8").split(/\r?\n/),r=0;r<t.length;r++){var n,o=t[r],i=a(e);try{for(i.s();!(n=i.n()).done;){var c=n.value;o.includes(c.key)&&(t[r]="".concat(c.key,"=").concat(c.value||""),this[c.key]=c.value)}}catch(e){i.e(e)}finally{i.f()}}p.default.writeFileSync(h.default.join(this.env),t.join("\n"))}}},{key:"isNumeric",value:function(e){return/^-?\d+(\.\d+)?$/.test(e)}},{key:"parseValue",value:function(e){return this.isNumeric(e)?parseFloat(e):"true"===e.toLowerCase()||"false"!==e.toLowerCase()&&e}},{key:"load",value:function(e){var t,r=a(p.default.readFileSync(e,"utf8").split(/\r?\n/));try{for(r.s();!(t=r.n()).done;){var n=t.value;if(""!==n.trim()&&!n.trim().startsWith("#")){var i=o(n.split("="),2),c=i[0],s=i[1];this[c.trim()]=this.parseValue(s.trim())}}}catch(e){r.e(e)}finally{r.f()}}}],(t=null)&&u(e.prototype,t),n&&u(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();t.Env=y,y.port=5567,y.base_folder=process.cwd(),y.username="",y.password="",y.work_dir="".concat(process.cwd(),"/data"),y.env=""},4861:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.FileMenuData=void 0,t.getFileFormat=function(e){var t=c.StringUtil.getFileExtension(e);if("pdf"===t)return s.FileTypeEnum.pdf;if("md"==t)return s.FileTypeEnum.md;if(l.has(t))return s.FileTypeEnum.video;if(f.has(t))return s.FileTypeEnum.uncompress;if(p.has(t))return s.FileTypeEnum.image;if("excalidraw"===t)return s.FileTypeEnum.excalidraw;return s.FileTypeEnum.unknow};var c=r(7285),s=r(8076),u=a((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));t.FileMenuData=u;var l=new Set(["mp4","webm","flv","mov","m4v","mkv","avi","wmv","swf","mod","mpv","mpeg","asf"]),f=new Set(["tar","zip","gz","tgz","rar"]),p=new Set(["jpg","jpeg","png","gif"]);new Set(["txt","ts","js"])},5894:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.JsonUtil=void 0;var serialize=__webpack_require__(8474),JsonUtil=function(){function JsonUtil(){_classCallCheck(this,JsonUtil)}return _createClass(JsonUtil,null,[{key:"getJson",value:function(e){return serialize(e)}},{key:"fromJson",value:function fromJson(str){return eval("(".concat(str,")"))}}])}();exports.JsonUtil=JsonUtil},8932:(e,t)=>{"use strict";function r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=o(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function n(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return r;return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getNextByLoop=function(e,t){var r=i(e,t);if(null===r)return null;if(r===e.length-1)return e[0];return e[r+1]},t.getIndexByList=i,t.getByList=function(e,t){var r=i(e,t);if(null===r)return null;return e[r]},t.getNewDeleteByList=function(e,t){var r=e.indexOf(t),o=n(e);return o.splice(r,1),o},t.webPathJoin=function(){for(var e="",t=0;t<arguments.length;t++){var r=t<0||arguments.length<=t?void 0:arguments[t];0===t?("/"!==r[0]&&(r="/"+r),"/"!==r[r.length-1]&&(r+="/")):t===arguments.length-1?"/"!==r[r.list-1]&&-1===r.indexOf(".")&&(r+="/"):("/"===r[0]&&(r=r.slice(1,r.length-1)),"/"!==r[r.length-1]&&(r+="/")),e+=r}return e},t.joinPaths=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t[0],o=1;o<t.length;o++)"/"!==t[o][t[o].length-1]?n+="/"+t[o]:n+=t[o];return n},t.getByIndexs=function(e,t){var n,o=[],a=r(t);try{for(a.s();!(n=a.n()).done;){var i=n.value;o.push(e[i])}}catch(e){a.e(e)}finally{a.f()}return o},t.sort=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||0===e.length)return e;for(var n=0;n<e.length;n++)for(var o=e.length-1;o>n;o--){var a=t?t(e[o]):e[o],i=t?t(e[o-1]):e[o-1],c=e[o];a<i?r&&(e[o]=e[o-1],e[o-1]=c):a>i&&(r||(e[o]=e[o-1],e[o-1]=c))}return e},t.getMapByList=function(e,t){var n,o=new Map,a=r(e);try{for(a.s();!(n=a.n()).done;){var i=n.value;o.set(t(i),i)}}catch(e){a.e(e)}finally{a.f()}return o},t.getByListRandom=function e(t,r){if(0===t.length)return null;var n=function(e,t){if(e===t)return-1;return Math.floor(Math.random()*(t-e))+e}(0,t.length);if(r&&n===r)return e(t,r);return t[n]},t.deleteList=function(e,t){if(!t)return;for(var r=0;r<e.length;r++)if(t(e[r]))return e.splice(r,1)[0];return}},5453:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.RCode=void 0,function(e){e[e.Sucess=0]="Sucess",e[e.Fail=1]="Fail",e[e.AuthFail=2]="AuthFail",e[e.DdnsAuthFail=3]="DdnsAuthFail",e[e.File_Max=4]="File_Max",e[e.PreFile=5]="PreFile",e[e.PROTECT_FILE=6]="PROTECT_FILE"}(r||(t.RCode=r={}))},8239:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.routerConfig=void 0,t.routerConfig={file:"file",navindex:"navindex",toolbox:"toolbox",info:"info",ddns:"ddns",net:"net",setting:"setting","/":"/","":""}},7285:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtil=t.Param=void 0,t.getEditModelType=function(e){var t=e.split(".");if(1===t.length)return"";switch(t=t[t.length-1]){case"java":case"javascript":case"css":case"json":case"python":case"text":case"sh":case"lua":case"html":case"xml":case"yaml":case"tsx":case"sql":return t;case"txt":case"ini":case"env":case"bash":case"log":case"config":case"map":case"out":case"gitignore":case"conf":case"mod":return"text";case"js":return"javascript";case"md":return"markdown";case"py":return"python";case"ts":return"typescript";case"yml":return"yaml";case"cpp":case"h":case"c":case"cc":return"c_cpp";case"excalidraw":return"json"}return""},t.join_url=function(e,t){return e.endsWith("/")&&t.startsWith("/")?e.slice(0,-1)+t:e.endsWith("/")||t.startsWith("/")?e+t:e+"/"+t},t.getWebFirstKey=function(e){if(!e)return"";for(var t=1;t<e.length;t++)if("//"===e[t])return e.slice(1,t);return e.slice(1)},t.generateSaltyUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))+"-"};var u=i((function e(){s(this,e)}));t.Param=u;var l=function(){return i((function e(){s(this,e)}),null,[{key:"trim",value:function(e){return e?e.replace(" ",""):""}},{key:"trimList",value:function(e,t){var r=e[t];return this.trim(r)}},{key:"getParam",value:function(){for(var e="?",t=!1,r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];if(Array.isArray(o)){var i,c=n(o);try{for(c.s();!(i=c.n()).done;){var s=i.value;s.value&&(t?e+="&".concat(s.key,"=").concat(s.value):(e+="".concat(s.key,"=").concat(s.value),t=!0))}}catch(e){c.e(e)}finally{c.f()}}return e}},{key:"getFileExtension",value:function(e){return e.split(".").pop()}}])}();t.StringUtil=l},7699:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getShortTime=function(e){t=e,e=t>1e12?e:1e3*e;var t;var s=Date.now(),u=Math.abs(s-e)/c;return u<r?"小于一分钟":u<n?"".concat(u.toFixed(0),"分钟前"):u<o?"".concat((u/n).toFixed(0),"小时前"):u<a?"".concat((u/o).toFixed(0),"天前"):u<i?"".concat((u/a).toFixed(0),"月前"):"".concat((u/i).toFixed(0),"年前")},t.formatFileSize=function(e){return e<s?e+" B":e<u?(e/s).toFixed(2)+" KB":e<l?(e/u).toFixed(2)+" MB":(e/l).toFixed(2)+" GB"};var r=1,n=60*r,o=24*n,a=30*o,i=365*o,c=6e4;var s=1024,u=1048576,l=1073741824},8076:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.base64UploadType=t.FileCompressPojo=t.FileCompressType=t.FileVideoFormatTransPojo=t.FileTypeEnum=void 0,function(e){e.audio="audio",e.blob="blob",e.image="image",e.pdf="pdf",e.text="text",e.video="video",e.invalid_link="invalid_link",e.folder="folder",e.studio_file="studio_file",e.studio_folder="studio_folder",e.unknow="text",e.uncompress="uncompress",e.md="md",e.excalidraw="excalidraw",e.dev="dev"}(c||(t.FileTypeEnum=c={}));var s,u=o((function e(){i(this,e)}));t.FileVideoFormatTransPojo=u,function(e){e.zip="zip",e.tar="tar",e.gzip="gz",e.rar="rar"}(s||(t.FileCompressType=s={}));var l,f=o((function e(){i(this,e)}));t.FileCompressPojo=f,function(e){e[e.all=0]="all",e[e.start=1]="start",e[e.part=2]="part"}(l||(t.base64UploadType=l={}))},8872:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}Object.defineProperty(t,"__esModule",{value:!0}),t.findAvailablePort=function(e,t){return a.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,c;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=o().mark((function e(t){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,new Promise((function(e,r){var n=i.createServer();n.unref(),n.on("error",r),n.listen(t,(function(){n.close((function(){return e(t)}))}))}));case 3:return e.abrupt("return",{v:t});case 6:e.prev=6,e.t0=e.catch(0);case 8:case"end":return e.stop()}}),e,null,[[0,6]])})),c=e;case 2:if(!(c<=t)){r.next=10;break}return r.delegateYield(n(c),"t0",4);case 4:if(!(a=r.t0)){r.next=7;break}return r.abrupt("return",a.v);case 7:c++,r.next=2;break;case 10:return r.abrupt("return",null);case 11:case"end":return r.stop()}}),r)})))};var a=r(5584),i=r(9278)},4988:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.WsData=t.WsConnectType=t.CmdType=t.protocolIsProto2=void 0;var i,c,s=r(5584),u=r(5894),l=s.__importStar(r(8497)),f=s.__importStar(r(3211)),p=r(3211),h=new f.Encoder;t.protocolIsProto2=!0,function(e){e[e.connection=0]="connection",e[e.sys_get=1]="sys_get",e[e.sys_getting=2]="sys_getting",e[e.shell_open=3]="shell_open",e[e.shell_send=4]="shell_send",e[e.shell_getting=5]="shell_getting",e[e.shell_cancel=6]="shell_cancel",e[e.shell_cd=7]="shell_cd",e[e.docker_get=8]="docker_get",e[e.docker_getting=9]="docker_getting",e[e.docker_shell_logs=10]="docker_shell_logs",e[e.docker_shell_logs_getting=11]="docker_shell_logs_getting",e[e.docker_shell_logs_cancel=12]="docker_shell_logs_cancel",e[e.docker_shell_exec_open=13]="docker_shell_exec_open",e[e.docker_shell_exec=14]="docker_shell_exec",e[e.docker_shell_exec_getting=15]="docker_shell_exec_getting",e[e.docker_shell_exec_cancel=16]="docker_shell_exec_cancel",e[e.docker_switch=17]="docker_switch",e[e.docker_del_container=18]="docker_del_container",e[e.process_get=19]="process_get",e[e.process_getting=20]="process_getting",e[e.process_close=21]="process_close",e[e.systemd_inside_get=22]="systemd_inside_get",e[e.systemd_inside_getting=23]="systemd_inside_getting",e[e.systemd_logs_get=24]="systemd_logs_get",e[e.systemd_logs_getting=25]="systemd_logs_getting",e[e.remote_shell_open=26]="remote_shell_open",e[e.remote_shell_send=27]="remote_shell_send",e[e.remote_shell_getting=28]="remote_shell_getting",e[e.remote_shell_cancel=29]="remote_shell_cancel",e[e.remote_shell_cd=30]="remote_shell_cd",e[e.infos=31]="infos",e[e.connect=32]="connect",e[e.rdp_connect=33]="rdp_connect",e[e.rdp_bitmap=34]="rdp_bitmap",e[e.rdp_close=35]="rdp_close",e[e.rdp_error=36]="rdp_error",e[e.mouse=37]="mouse",e[e.wheel=38]="wheel",e[e.scancode=39]="scancode",e[e.unicode=40]="unicode",e[e.rdp_disconnect=41]="rdp_disconnect",e[e.vir_net_serverIno_get=42]="vir_net_serverIno_get",e[e.file_video_trans=43]="file_video_trans",e[e.file_video_trans_progress=44]="file_video_trans_progress",e[e.file_uncompress=45]="file_uncompress",e[e.file_uncompress_progress=46]="file_uncompress_progress",e[e.file_compress=47]="file_compress",e[e.file_compress_progress=48]="file_compress_progress",e[e.rtsp_get=49]="rtsp_get",e[e.rtsp_cancel=50]="rtsp_cancel"}(i||(t.CmdType=i={})),function(e){e[e.data=0]="data",e[e.other=1]="other"}(c||(t.WsConnectType=c={}));var d=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cmdType=t,this.context=r,this.bin_context=n}return r=e,a=[{key:"decode",value:function(t){var r=l.WsMessage.decode(t);return new e(r.code,u.JsonUtil.fromJson(r.context),r.binContext)}}],(n=[{key:"encode",value:function(){if(t.protocolIsProto2)return l.WsMessage.encode(l.WsMessage.create({code:this.cmdType,context:u.JsonUtil.getJson(this.context),binContext:this.bin_context})).finish();var e={type:p.PacketType.EVENT,data:[this.cmdType,this.context]};return h.encode(e)}}])&&o(r.prototype,n),a&&o(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}();t.WsData=d},8411:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.otherRouterHandlerMap=t.routerHandlerMap=void 0,t.msg=function(e){return function(n,o,a){var i=r.get(n.name),c=null!=i?i:new n.constructor;a.value,t.routerHandlerMap.set(e,c[o].bind(c))}},t.otherMsg=function(e){return function(n,o,a){var i=r.get(n.name),c=null!=i?i:new n.constructor;a.value,t.otherRouterHandlerMap.set(e,c[o].bind(c))}};var r=new Map;t.routerHandlerMap=new Map,t.otherRouterHandlerMap=new Map},1631:(e,t,r)=>{"use strict";function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */n=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(n,i,c,s){var u=h(e[n],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==o(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var n;i(this,"_invoke",{value:function(e,o){function a(){return new t((function(t,n){r(e,o,t,n)}))}return n=n?n.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function r(){for(;++n<t.length;)if(a.call(t,n))return r.value=t[n],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(o(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function c(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.WsServer=t.Wss=void 0;var u=r(5584),l=u.__importDefault(r(5086)),f=r(8411),p=r(4988),h=u.__importStar(r(3211)),d=r(9625),v=r(7016),y=new h.Decoder,m=function(){return c((function e(t){a(this,e),this.dataMap=new Map,this._close=[],this._ws=t,this.id=Date.now().toString()}),[{key:"ws",get:function(){return this._ws}},{key:"sendData",value:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this._ws.send(e[t]);else this._ws.send(e)}},{key:"setClose",value:function(e){this._close.push(e)}}])}();t.Wss=m;var b=function(){return c((function e(){a(this,e)}),[{key:"connection",value:function(e){return u.__awaiter(this,void 0,void 0,n().mark((function t(){var r,o=this;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:console.log("ws客户端连接"),r=new m(e),p.protocolIsProto2||y.on("decoded",(function(e){return u.__awaiter(o,void 0,void 0,n().mark((function t(){var o,a,i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((o=new p.WsData(e.data[0],e.data[1])).wss=r,!(a=f.routerHandlerMap.get(o.cmdType))){t.next=10;break}return t.next=6,a(o);case 6:i=t.sent,r.sendData(new p.WsData(o.cmdType,i).encode()),t.next=11;break;case 10:console.log("没有匹配到路由");case 11:case"end":return t.stop()}}),t)})))})),r.ws.on("message",(function(e){return u.__awaiter(this,void 0,void 0,n().mark((function t(){var o,a,i;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!p.protocolIsProto2){t.next=14;break}if((o=p.WsData.decode(e)).wss=r,!(a=f.routerHandlerMap.get(o.cmdType))){t.next=11;break}return t.next=7,a(o);case 7:i=t.sent,r.sendData(new p.WsData(o.cmdType,i).encode()),t.next=12;break;case 11:console.log("没有匹配到路由");case 12:t.next=15;break;case 14:y.add(e.toString());case 15:case"end":return t.stop()}}),t)})))})),r.ws.on("close",(function(){if(console.log("ws客户端断开"),r._close.length>0)for(;;){var e=r._close.pop();if(!e)break;try{e()}catch(e){console.error("关闭函数",e);break}}}));case 5:case"end":return t.stop()}}),t)})))}}])}();u.__decorate([(0,f.msg)(p.CmdType.connection),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[l.default]),u.__metadata("design:returntype",Promise)],b.prototype,"connection",null);var _=function(){return c((function e(t){a(this,e),this._wss=t}),[{key:"start",value:function(){this._wss.on("connection",(function(e,t){return u.__awaiter(this,void 0,void 0,n().mark((function r(){var o,a,i;return n().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o=v.parse(t.url,!0),a=o.query,r.next=5,d.settingService.check(a.token);case 5:if(r.sent){r.next=9;break}return e.close(),console.log("未验证的ws请求"),r.abrupt("return");case 9:a.type==="".concat(p.WsConnectType.data)?f.routerHandlerMap.get(p.CmdType.connection)(e):a.type==="".concat(p.WsConnectType.other)?(i=f.otherRouterHandlerMap.get(parseInt(a.code)))?i(e,a):console.log("没找到对应路径"):(console.log("ws未找到对应的访问途径"),e.close()),r.next=16;break;case 12:r.prev=12,r.t0=r.catch(0),console.log("ws connection",r.t0),e.close();case 16:case"end":return r.stop()}}),r,null,[[0,12]])})))}))}}])}();t.WsServer=_},648:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequest=void 0;var c=r(5584),s=r(9551),u=r(3480),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"post",value:function(e,t){return c.__awaiter(this,arguments,void 0,(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return o().mark((function a(){var i;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,s("post",e,t,{json:!r,headers:n});case 2:if(200!==(i=o.sent).statusCode){o.next=7;break}return o.abrupt("return",i.body);case 7:return o.abrupt("return",null);case 8:case"end":return o.stop()}}),a)}))()}))}},{key:"get",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,n=u.stringify(t),t&&(e="".concat(e,"?").concat(n)),r.next=5,s("get",e);case 5:if(200!==(a=r.sent).statusCode){r.next=8;break}return r.abrupt("return",a.body);case 8:return r.abrupt("return",null);case 11:return r.prev=11,r.t0=r.catch(0),r.abrupt("return",null);case 14:case"end":return r.stop()}}),r,null,[[0,11]])})))}}],(t=null)&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.HttpRequest=l},6557:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=this;function a(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}var i=r(5584),c=r(3785),s=r(9896),u=r(5317),l=(u.spawn,u.execSync),f=c.createInterface({input:process.stdin,output:process.stdout}),p={exe_path:process.argv[0].endsWith("node")&&process.argv[1].endsWith("filecat")?"".concat(process.argv[0]," ").concat(process.argv[1]," "):process.argv[0],env_path:"",port:5567,username:"admin",password:"admin",work_dir:"".concat(process.cwd(),"/data"),base_folder:process.cwd(),Group:"root",User:"root"},h=function(e){return new Promise((function(t){return f.question(e,t)}))},d={1:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t,r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("1.程序位置-绝对路径(当前-".concat(p.exe_path,"):"));case 2:return(t=e.sent)&&(p.exe_path=t),e.next=6,h("5/7.请输入用户账号(默认:root):");case 6:if(!(r=e.sent)){e.next=13;break}return p.User=r,e.next=11,h("5/7.请输入用户所属组(默认:".concat(r,"):"));case 11:(n=e.sent)&&(p.Group=n);case 13:return e.abrupt("return","2");case 14:case"end":return e.stop()}}),e)})))},2:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("2.请输入env文件-绝对路径:");case 2:if(t=e.sent){e.next=7;break}return e.abrupt("return","3");case 7:p.env_path=t;case 8:return e.abrupt("return","");case 9:case"end":return e.stop()}}),e)})))},3:function(){return i.__awaiter(o,void 0,void 0,a().mark((function e(){var t,r,n,o,i;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,h("3/7.请输入程序端口(默认:5567):");case 2:return(t=e.sent)&&(p.port=parseInt(t)),e.next=6,h("4/7.请输入登录名(默认:admin):");case 6:return(r=e.sent)&&(p.username=r),e.next=10,h("5/7.请输入密码(默认:admin):");case 10:return(n=e.sent)&&(p.password=n),e.next=14,h("6/7.请输入程序缓存数据目录(默认:程序目录下data):");case 14:return(o=e.sent)&&(p.work_dir=o),e.next=18,h("7/7.请输入管理root文件目录(默认:程序目录下):");case 18:return(i=e.sent)&&(p.base_folder=i),e.abrupt("return","");case 21:case"end":return e.stop()}}),e)})))}};i.__awaiter(o,void 0,void 0,a().mark((function e(){var t,r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t="1";case 1:return e.next=3,d[t]();case 3:if(r=e.sent){e.next=6;break}return e.abrupt("break",9);case 6:t=r;case 7:e.next=1;break;case 9:f.close(),n=p.env_path?" --env ".concat(p.env_path):" --username ".concat(p.username," --password ").concat(p.password," --port ").concat(p.port," --work_dir ").concat(p.work_dir," --base_folder ").concat(p.base_folder),o="\n[Unit]\nDescription=filecat\nAfter=network.target\n\n[Service]\nExecStart=".concat(p.exe_path," ").concat(n,"\nRestart=always\nUser=").concat(p.User,"\nGroup=").concat(p.Group,"\nKillMode=process\n[Install]\nWantedBy=multi-user.target\n ");try{s.writeFileSync("/etc/systemd/system/filecat.service",o),l("sudo chmod +x ".concat(p.exe_path)),l("sudo systemctl daemon-reload"),l("sudo systemctl start filecat"),l("sudo systemctl enable filecat")}catch(e){console.error(e)}console.log("安装完成!"),process.exit();case 15:case"end":return e.stop()}}),e)}))).catch((function(e){console.error("出现错误:",e),process.exit()}))},8497:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(6384),a=o.Reader,i=o.Writer,c=o.util,s=o.roots.default||(o.roots.default={});s.WsMessage=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)null!=e[t[r]]&&(this[t[r]]=e[t[r]])}return e.prototype.code=0,e.prototype.context="",e.prototype.binContext=c.newBuffer([]),e.create=function(t){return new e(t)},e.encode=function(e,t){return t||(t=i.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).int32(e.code),null!=e.context&&Object.hasOwnProperty.call(e,"context")&&t.uint32(18).string(e.context),null!=e.binContext&&Object.hasOwnProperty.call(e,"binContext")&&t.uint32(26).bytes(e.binContext),t},e.encodeDelimited=function(e,t){return this.encode(e,t).ldelim()},e.decode=function(e,t){e instanceof a||(e=a.create(e));for(var r=void 0===t?e.len:e.pos+t,n=new s.WsMessage;e.pos<r;){var o=e.uint32();switch(o>>>3){case 1:n.code=e.int32();break;case 2:n.context=e.string();break;case 3:n.binContext=e.bytes();break;default:e.skipType(7&o)}}return n},e.decodeDelimited=function(e){return e instanceof a||(e=new a(e)),this.decode(e,e.uint32())},e.verify=function(e){return"object"!==n(e)||null===e?"object expected":null!=e.code&&e.hasOwnProperty("code")&&!c.isInteger(e.code)?"code: integer expected":null!=e.context&&e.hasOwnProperty("context")&&!c.isString(e.context)?"context: string expected":null!=e.binContext&&e.hasOwnProperty("binContext")&&!(e.binContext&&"number"==typeof e.binContext.length||c.isString(e.binContext))?"binContext: buffer expected":null},e.fromObject=function(e){if(e instanceof s.WsMessage)return e;var t=new s.WsMessage;return null!=e.code&&(t.code=0|e.code),null!=e.context&&(t.context=String(e.context)),null!=e.binContext&&("string"==typeof e.binContext?c.base64.decode(e.binContext,t.binContext=c.newBuffer(c.base64.length(e.binContext)),0):e.binContext.length>=0&&(t.binContext=e.binContext)),t},e.toObject=function(e,t){t||(t={});var r={};return t.defaults&&(r.code=0,r.context="",t.bytes===String?r.binContext="":(r.binContext=[],t.bytes!==Array&&(r.binContext=c.newBuffer(r.binContext)))),null!=e.code&&e.hasOwnProperty("code")&&(r.code=e.code),null!=e.context&&e.hasOwnProperty("context")&&(r.context=e.context),null!=e.binContext&&e.hasOwnProperty("binContext")&&(r.binContext=t.bytes===String?c.base64.encode(e.binContext,0,e.binContext.length):t.bytes===Array?Array.prototype.slice.call(e.binContext):e.binContext),r},e.prototype.toJSON=function(){return this.constructor.toObject(this,o.util.toJSONOptions)},e.getTypeUrl=function(e){return void 0===e&&(e="type.googleapis.com"),e+"/WsMessage"},e}(),e.exports=s},9426:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.vg_item=t.pv_item=t.lv_item=void 0;var c=o((function e(){i(this,e)}));t.lv_item=c;var s=o((function e(){i(this,e)}));t.pv_item=s;var u=o((function e(){i(this,e),this.lv_list=[],this.pv_list=[]}));t.vg_item=u},5546:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.self_auth_jscode=t.CustomerApiRouterPojo=void 0;var i=o((function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}));t.CustomerApiRouterPojo=i,t.self_auth_jscode="self_auth_jscode"},7076:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c,s,u;Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsConnection=t.Tengxun=t.Ali=t.DnsPod=t.DdnsIPPojo=t.ip_source_type=t.DdnsType=t.getIpType=void 0,function(e){e[e.www=0]="www",e[e.sys=1]="sys"}(c||(t.getIpType=c={})),function(e){e[e.dnspod=0]="dnspod",e[e.tengxun=1]="tengxun",e[e.ali=2]="ali"}(s||(t.DdnsType=s={})),function(e){e.physics="物理",e.http_get="http_get"}(u||(t.ip_source_type=u={}));var l=o((function e(){i(this,e)}));t.DdnsIPPojo=l;var f=o((function e(){i(this,e)}));t.DnsPod=f;var p=o((function e(){i(this,e)}));t.Ali=p;var h=o((function e(){i(this,e)}));t.Tengxun=h;var d=o((function e(){i(this,e),this.ips=[],this.isOpen=!1}));t.DdnsConnection=d},7228:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.VirNetItem=t.VirClientPojo=t.VirServerPojo=t.VirServerEnum=t.NetPojo=void 0;var c,s=o((function e(){i(this,e)}));t.NetPojo=s,function(e){e[e.tcp=0]="tcp",e[e.udp=1]="udp"}(c||(t.VirServerEnum=c={}));var u=o((function e(){i(this,e),this.open=!1,this.model=c.udp,this.key=""}));t.VirServerPojo=u;var l=o((function e(){i(this,e),this.open=!1,this.key=""}));t.VirClientPojo=l;var f=o((function e(){i(this,e),this.online=!1}));t.VirNetItem=f},2279:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.systemdPojo=t.SysSoftwareItem=t.SysSoftware=t.FileSettingItem=t.TokenSettingReq=t.TokenTimeMode=void 0,function(e){e[e.close=0]="close",e[e.length=1]="length",e[e.forver=2]="forver"}(c||(t.TokenTimeMode=c={}));var s=o((function e(){i(this,e)}));t.TokenSettingReq=s;var u,l=o((function e(){i(this,e),this.default=!1}));t.FileSettingItem=l,function(e){e.ffmpeg="ffmpeg",e.smartmontools="smartmontools",e.ntfs_3g="ntfs_3g"}(u||(t.SysSoftware=u={}));var f=o((function e(){i(this,e)}));t.SysSoftwareItem=f;var p=o((function e(){i(this,e)}));t.systemdPojo=p},6387:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t,n){return t=a(t),function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,o()?Reflect.construct(t,n||[],a(e).constructor):t.apply(e,n))}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(o=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function s(e,t,r){return t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.SshPojo=t.ShellInitPojo=void 0;var f=s((function e(){l(this,e)}));t.ShellInitPojo=f;var p=function(e){function t(){return l(this,t),n(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(t,e),s(t,null,[{key:"getKey",value:function(e){var t;return null!==(t=e.private_path)&&void 0!==t?t:e.domain+e.port+e.username+e.password}}])}(f);t.SshPojo=p},6406:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.SysCmdExePojo=t.SysCmd=t.DiskCheckInfo=t.diskCheckAttr=t.DiskFilePojo=t.DiskDevicePojo=void 0;var c=o((function e(){i(this,e)}));t.DiskDevicePojo=c;var s=o((function e(){i(this,e)}));t.DiskFilePojo=s;var u=o((function e(){i(this,e)}));t.diskCheckAttr=u;var l,f=o((function e(){i(this,e)}));t.DiskCheckInfo=f,function(e){e[e.mount=0]="mount"}(l||(t.SysCmd=l={}));var p=o((function e(){i(this,e)}));t.SysCmdExePojo=p},4908:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function o(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.UserBaseInfo=t.SysEnum=t.UserLogin=void 0;var c,s=o((function e(){i(this,e)}));t.UserLogin=s,function(e){e[e.win=0]="win",e[e.linux=1]="linux"}(c||(t.SysEnum=c={}));var u=o((function e(){i(this,e)}));t.UserBaseInfo=u},9044:(e,t,r)=>{"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}Object.defineProperty(t,"__esModule",{value:!0}),t.require_c=void 0,t.get_wintun_dll_path=function(){try{var e=s.default.join(p.Env.work_dir,"packges","filecat_dlls");d.default.ensureDirSync(e);var t=f.default.arch();switch(t){case"arm":case"arm64":default:break;case"ia32":t="x86";break;case"x64":t="amd64"}var r="wintun".concat(t?"-".concat(t):"",".dll"),n=s.default.join(e,r);return h.existsSync(n)||function(e,t){s.default.basename(e);if(!h.existsSync(t)){var r=h.readFileSync(e);h.writeFileSync(t,r)}}(s.default.resolve("node_modules/@xiaobaidadada/node-tuntap2-wintun/wintun_dll",r),n),n}catch(e){console.log(e)}},t.getFfmpeg=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.ffmpeg&&r.installed&&r.path&&y.setFfmpegPath(r.path)}}catch(e){t.e(e)}finally{t.f()}return y},t.getSmartctl=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.smartmontools&&r.installed&&r.path&&(m=r.path)}}catch(e){t.e(e)}finally{t.f()}return m},t.get_ntfs_3g=function(){var e,t=n(u.settingService.getSoftware());try{for(t.s();!(e=t.n()).done;){var r=e.value;r.id===l.SysSoftware.ntfs_3g&&r.installed&&r.path&&(b=r.path)}}catch(e){t.e(e)}finally{t.f()}return b},t.getProcessAddon=function(){var e=(0,i.getSys)();if(e===c.SysEnum.linux||e===c.SysEnum.win){return r(4505).node_process_watcher}};var a=r(5584),i=r(5101),c=r(4908),s=a.__importDefault(r(6928)),u=r(9625),l=r(2279),f=a.__importDefault(r(857)),p=r(4321),h=r(9896),d=a.__importDefault(r(4652)),v=r(8995).createRequire;t.require_c=v(__filename);var y=r(1856);var m="smartctl";var b="ntfs-3g"},1668:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.CryptoController=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(3537),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"generate",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,u.Sucess)(l.crypto_service.generate(e.type,e.form)));case 1:case"end":return t.stop()}}),t)})))}},{key:"save_openssh",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.crypto_service.save_openssh(e.name,e.context),t.abrupt("return",(0,u.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CryptoController=f,c.__decorate([(0,s.Post)("/generate"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],f.prototype,"generate",null),c.__decorate([(0,s.Post)("/save_openssh"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],f.prototype,"save_openssh",null),t.CryptoController=f=c.__decorate([(0,s.Controller)("/crypto")],f)},3537:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.crypto_service=t.CryptoService=void 0;var i=r(5584),c=i.__importDefault(r(6928)),s=i.__importDefault(r(9896)),u=i.__importDefault(r(4652)),l=r(5317),f=r(5101),p=r(4908),h=r(6982),d=r(6011),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.home_path=""},(t=[{key:"get_home_path",value:function(){return this.home_path||(this.home_path=c.default.join(process.env.HOME,".ssh")),this.home_path}},{key:"to_openssh_form",value:function(e,t){return{opensshPublicKey:d.parseKey(e).toString("ssh"),opensshPrivateKey:d.parsePrivateKey(t).toString("ssh")}}},{key:"get_RSA",value:function(){var e=h.generateKeyPairSync("rsa",{modulusLength:2048,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{publicKey:e.publicKey,privateKey:e.privateKey}}},{key:"get_ECDSA",value:function(){var e=h.generateKeyPairSync("ec",{namedCurve:"P-521",publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{publicKey:e.publicKey,privateKey:e.privateKey}}},{key:"get_DSA",value:function(){var e=h.generateKeyPairSync("dsa",{modulusLength:2048,publicExponent:65537}),t=e.publicKey,r=e.privateKey;return{publicKey:t=t.export({type:"spki",format:"pem"}),privateKey:r=r.export({type:"pkcs8",format:"pem"})}}},{key:"generate",value:function(e,t){var r,n;switch(e){case"rsa":var o=this.get_RSA(),a=o.publicKey;n=o.privateKey,r=a;break;case"ecdsa":var i=this.get_ECDSA(),c=i.publicKey;n=i.privateKey,r=c;break;case"dsa":var s=this.get_DSA(),u=s.publicKey;n=s.privateKey,r=u}if("pem"!==t&&r&&n){var l=this.to_openssh_form(r,n);return{public_key:l.opensshPublicKey,private_key:l.opensshPrivateKey,home_path:this.get_home_path()}}return{public_key:r,private_key:n}}},{key:"save_openssh",value:function(e,t){u.default.ensureDirSync(this.get_home_path());var r=c.default.join(this.get_home_path(),e);s.default.writeFileSync(r,t),(0,f.getSys)()===p.SysEnum.linux&&(0,l.execSync)("chmod 600 ".concat(r))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CryptoService=v,t.crypto_service=new v},274:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DataUtil=t.file_key=void 0;var i,c=r(5584),s=c.__importDefault(r(6928)),u=c.__importDefault(r(9896)),l=c.__importDefault(r(4652)),f=r(4321);!function(e){e.data="data",e.systemd="systemd"}(i||(t.file_key=i={}));var p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"init",value:function(e){var t=this.data_path_map[e];null==t&&(this.data_path_map[e]=t=s.default.join(f.Env.work_dir,"data.json"),u.default.existsSync(t)?this.data_map[e]=JSON.parse(u.default.readFileSync(t).toString()):(l.default.ensureDirSync(f.Env.work_dir),u.default.writeFileSync(t,"{}"),this.data_map[e]={}))}},{key:"checkFile",value:function(e,t){var r=s.default.join(f.Env.work_dir,t,e);return!!u.default.existsSync(r)||(l.default.ensureDirSync(s.default.join(f.Env.work_dir,t)),u.default.writeFileSync(r,""),!1)}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i.data;return this.init(t),this.data_map[t][e]}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.data;this.init(r),this.data_map[r][e]=t,u.default.writeFileSync(this.data_path_map[r],JSON.stringify(this.data_map[r]))}},{key:"getFile",value:function(e){var t=s.default.join(f.Env.work_dir,"datafile",e);return this.checkFile(e,"datafile")?u.default.readFileSync(t).toString():""}},{key:"setFile",value:function(e,t){var r=s.default.join(f.Env.work_dir,"datafile",e);this.checkFile(e,"datafile"),u.default.writeFileSync(r,t)}},{key:"writeFileSyncTemp",value:function(e,t,r){var n=s.default.join(f.Env.work_dir,t,e);return this.checkFile(e,t),u.default.writeFileSync(n,r),n}}],(t=null)&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DataUtil=p,p.data_path_map={},p.data_map={}},4465:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.aliService=t.AliService=t.alidnsEndpoint=t.ddns_ali_key=void 0,t.generateAliSignature=v;var f=r(5584),p=r(603),h=r(648),d=r(6982);function v(e,t){var r=Object.keys(e).sort().map((function(t){return"".concat(encodeURIComponent(t),"=").concat(encodeURIComponent(e[t]))})).join("&"),n="GET&%2F&".concat(encodeURIComponent(r));return d.createHmac("sha1","".concat(t,"&")).update(n).digest("base64")}t.ddns_ali_key="ali_ddns_key",t.alidnsEndpoint="https://alidns.aliyuncs.com/";var y=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,e),n=r,(i=[{key:"getDdnsKey",value:function(){return t.ddns_ali_key}},{key:"update",value:function(e,r,n,a){return f.__awaiter(this,void 0,void 0,o().mark((function i(){var c,s,u,l,f,p;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return c=e.account,(s={Action:"DescribeSubDomainRecords",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",DomainName:r.domain,SubDomain:r.subdomain}).Signature=v(s,c.accesskey_secret),o.next=5,h.HttpRequest.get(t.alidnsEndpoint,s);case 5:if(!((u=o.sent).TotalCount>0)){o.next=14;break}return l=u.DomainRecords.Record[0],(f={Action:"UpdateDomainRecord",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",RecordId:l.RecordID,RR:r.subdomain,Type:a,Value:n}).Signature=v(f,c.accesskey_secret),o.next=12,h.HttpRequest.get(t.alidnsEndpoint,f);case 12:o.next=18;break;case 14:return(p={Action:"AddDomainRecord",AccessKeyId:c.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",DomainName:r.domain,RR:r.subdomain,Value:n,Type:a}).Signature=v(p,c.accesskey_secret),o.next=18,h.HttpRequest.get(t.alidnsEndpoint,p);case 18:case"end":return o.stop()}}),i)})))}}])&&a(n.prototype,i),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,s}(p.DdnsPre);t.AliService=y,t.aliService=new y},5740:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsController=void 0;var c=r(5584),s=r(9334),u=r(4233),l=r(7076),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getIps",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",u.ddnsService.getIps(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",u.ddnsService.save(e));case 1:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DdnsController=f,c.__decorate([(0,s.Get)("/ips/:type"),c.__param(0,(0,s.Param)("type")),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[String]),c.__metadata("design:returntype",Promise)],f.prototype,"getIps",null),c.__decorate([(0,s.Post)("/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[l.DdnsConnection]),c.__metadata("design:returntype",Promise)],f.prototype,"save",null),t.DdnsController=f=c.__decorate([(0,s.Controller)("/ddns")],f)},8403:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.dnspodService=t.DnsPodService=t.ddns_dnspod_key=void 0;var h=r(5584),d=r(648),v=r(274),y=r(8932),m=r(2953),b=r(603);t.ddns_dnspod_key="ddns_dnspod";var _=!1,g=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),u(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(r,e),n=r,(a=[{key:"dnspodCreate",value:function(e,t,r,n,o,a){return h.__awaiter(this,void 0,void 0,i().mark((function c(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.Create",{format:"json",login_token:"".concat(t,",").concat(r),record_type:a,sub_domain:n,domain:o,value:e,record_line:"默认"},!0);case 2:case"end":return i.stop()}}),c)})))}},{key:"dnspodUpdate",value:function(e,t,r,n,o,a,c){return h.__awaiter(this,void 0,void 0,i().mark((function s(){return i().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.Modify",{format:"json",login_token:"".concat(r,",").concat(n),record_type:c,sub_domain:o,domain:a,value:t,record_id:e,record_line:"默认"},!0);case 2:case"end":return i.stop()}}),s)})))}},{key:"dnspodGet",value:function(e,t,r,n){return h.__awaiter(this,void 0,void 0,i().mark((function o(){var a;return i().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,d.HttpRequest.post("https://dnsapi.cn/Record.List",{format:"json",login_token:"".concat(e,",").concat(t),sub_domain:r,domain:n},!0);case 2:return a=o.sent,o.abrupt("return",a);case 4:case"end":return o.stop()}}),o)})))}},{key:"Run",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,a,c,s,u,l,f,p,h,d,b,g,E;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,v.DataUtil.get(t.ddns_dnspod_key);case 3:if(!((n=r.sent)&&n.isOpen&&n.ips&&n.ips.length>0)){r.next=52;break}a=(0,y.getMapByList)(e,(function(e){return e.ifaceOrWww+e.isIPv4})),c=!1,s=o(n.ips),r.prev=8,s.s();case 10:if((u=s.n()).done){r.next=43;break}if(l=u.value,r.prev=12,!(f=a.get(l.ifaceOrWww+l.isIPv4))){r.next=39;break}if(l.ip!==f.ip||!_){r.next=17;break}return r.abrupt("continue",41);case 17:l.ip=f.ip,c=!0,p=l.ddnsHost.split(" "),h=o(p),r.prev=21,h.s();case 23:if((d=h.n()).done){r.next=31;break}return b=d.value,g=l.isIPv4?"A":"AAAA",E=(0,m.parse)(b),r.next=29,this.update(n,E,l.ip,g);case 29:r.next=23;break;case 31:r.next=36;break;case 33:r.prev=33,r.t0=r.catch(21),h.e(r.t0);case 36:return r.prev=36,h.f(),r.finish(36);case 39:return r.prev=39,r.finish(39);case 41:r.next=10;break;case 43:r.next=48;break;case 45:r.prev=45,r.t1=r.catch(8),s.e(r.t1);case 48:return r.prev=48,s.f(),r.finish(48);case 51:c&&(_=!0,v.DataUtil.set(t.ddns_dnspod_key,n));case 52:return r.prev=52,r.finish(52);case 54:case"end":return r.stop()}}),r,this,[[0,,52,54],[8,45,48,51],[12,,39,41],[21,33,36,39]])})))}},{key:"update",value:function(e,t,r,n){return h.__awaiter(this,void 0,void 0,i().mark((function o(){var a,c;return i().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.dnspodGet(e.account.id,e.account.token,t.subdomain,t.domain);case 2:if(!((a=o.sent).records&&a.records.length>0)){o.next=9;break}return c=a.records[0],o.next=7,this.dnspodUpdate(c.id,r,e.account.id,e.account.token,t.subdomain,t.domain,n);case 7:o.next=11;break;case 9:return o.next=11,this.dnspodCreate(r,e.account.id,e.account.token,t.subdomain,t.domain,n);case 11:case"end":return o.stop()}}),o,this)})))}},{key:"getDdnsKey",value:function(){return t.ddns_dnspod_key}}])&&c(n.prototype,a),s&&c(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,s}(b.DdnsPre);t.DnsPodService=g,t.dnspodService=new g},603:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.DdnsPre=void 0;var u=r(5584),l=u.__importDefault(r(333)),f=r(7076),p=r(648),h=r(274),d=r(8932),v=r(2953),y="https://4.ipw.cn",m="https://6.ipw.cn",b=null,_=[],g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.async_have=!1},(t=[{key:"getWwwIp4",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.HttpRequest.get(y);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"getWwwIp6",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.HttpRequest.get(m);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"getNowIps",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Date.now(),!(b&&t-b<3e4)){e.next=4;break}e.next=8;break;case 4:if(0!==_.length){e.next=7;break}return e.next=7,this.updateAndGetIps();case 7:this.updateAndGetIps().catch((function(e){console.log("获取ip错误",e)}));case 8:return e.abrupt("return",_);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"updateAndGetIps",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s,u,p,h,d,v;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return b=Date.now(),e.next=3,l.default.networkInterfaces();case 3:t=e.sent,r=[],n=o(Array.isArray(t)?t:[t]);try{for(n.s();!(a=n.n()).done;)(c=a.value).ip4&&((s=new f.DdnsIPPojo).isIPv4=!0,s.ifaceOrWww=c.iface,s.ip=c.ip4,s.source_type=f.ip_source_type.physics,r.push(s)),c.ip6&&((u=new f.DdnsIPPojo).isIPv4=!1,u.ifaceOrWww=c.iface,u.ip=c.ip6,u.source_type=f.ip_source_type.physics,r.push(u))}catch(e){n.e(e)}finally{n.f()}return e.next=9,this.getWwwIp4();case 9:return(p=e.sent)&&((h=new f.DdnsIPPojo).isIPv4=!0,h.ifaceOrWww=y,h.ip=p,h.source_type=f.ip_source_type.http_get,r.push(h)),e.next=13,this.getWwwIp6();case 13:return(d=e.sent)&&((v=new f.DdnsIPPojo).isIPv4=!1,v.ifaceOrWww=m,v.ip=d,v.source_type=f.ip_source_type.http_get,r.push(v)),_=r,e.abrupt("return",r);case 17:case"end":return e.stop()}}),e,this)})))}},{key:"Run",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,a,c,s,u,l,f,p,y,m,b,_;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,h.DataUtil.get(this.getDdnsKey());case 3:if(!((r=t.sent)&&r.isOpen&&r.ips&&r.ips.length>0)){t.next=52;break}n=(0,d.getMapByList)(e,(function(e){return e.ifaceOrWww+e.isIPv4})),a=!1,c=o(r.ips),t.prev=8,c.s();case 10:if((s=c.n()).done){t.next=43;break}if(u=s.value,t.prev=12,!(l=n.get(u.ifaceOrWww+u.isIPv4))){t.next=39;break}if(u.ip!==l.ip||!this.async_have){t.next=17;break}return t.abrupt("continue",41);case 17:u.ip=l.ip,a=!0,f=u.ddnsHost.split(" "),p=o(f),t.prev=21,p.s();case 23:if((y=p.n()).done){t.next=31;break}return m=y.value,b=u.isIPv4?"A":"AAAA",_=(0,v.parse)(m),t.next=29,this.update(r,_,u.ip,b);case 29:t.next=23;break;case 31:t.next=36;break;case 33:t.prev=33,t.t0=t.catch(21),p.e(t.t0);case 36:return t.prev=36,p.f(),t.finish(36);case 39:return t.prev=39,t.finish(39);case 41:t.next=10;break;case 43:t.next=48;break;case 45:t.prev=45,t.t1=t.catch(8),c.e(t.t1);case 48:return t.prev=48,c.f(),t.finish(48);case 51:a&&(this.async_have=!0,h.DataUtil.set(this.getDdnsKey(),r));case 52:t.next=57;break;case 54:t.prev=54,t.t2=t.catch(0),console.log(t.t2);case 57:case"end":return t.stop()}}),t,this,[[0,54],[8,45,48,51],[12,,39,41],[21,33,36,39]])})))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.DdnsPre=g},4233:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.ddnsService=t.DdnsService=void 0;var h=r(5584),d=r(7076),v=r(648),y=r(5890),m=r(274),b=r(5453),_=r(8932),g=r(8403),E=r(603),w=r(1140),P=r(4465),S=r(7989).dnspod.v20210323.Client,k=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,(n=[{key:"ddnsTask",value:function(){var e=this;setInterval((function(){return h.__awaiter(e,void 0,void 0,i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.updateAndGetIps();case 2:return t=e.sent,e.next=5,g.dnspodService.Run(t);case 5:return e.next=7,w.tengxunService.Run(t);case 7:return e.next=9,P.aliService.Run(t);case 9:case"end":return e.stop()}}),e,this)})))}),6e5)}},{key:"getIps",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,a,c,s,u,l,f,p;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNowIps();case 2:r=t.sent,n="",t.t0=e,t.next="dnspod"===t.t0?7:"tx"===t.t0?9:"ali"===t.t0?11:13;break;case 7:return n=g.ddns_dnspod_key,t.abrupt("break",13);case 9:return n=w.ddns_tx_key,t.abrupt("break",13);case 11:return n=P.ddns_ali_key,t.abrupt("break",13);case 13:return a=new d.DdnsConnection,t.next=16,m.DataUtil.get(n);case 16:if(c=t.sent,a.ips=r,c&&c.ips&&c.ips.length>0){s=(0,_.getMapByList)(c.ips,(function(e){return e.ifaceOrWww+e.isIPv4})),u=o(a.ips);try{for(u.s();!(l=u.n()).done;)f=l.value,(p=s.get(f.ifaceOrWww+f.isIPv4))&&(f.ddnsHost=p.ddnsHost)}catch(e){u.e(e)}finally{u.f()}}return c&&(a.isOpen=c.isOpen,a.account=c.account),t.abrupt("return",(0,y.Sucess)(a));case 21:case"end":return t.stop()}}),t,this)})))}},{key:"save",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n,o;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r="",t.t0=e.ddnsType,t.next=t.t0===d.DdnsType.dnspod?4:t.t0===d.DdnsType.tengxun?6:t.t0===d.DdnsType.ali?8:10;break;case 4:return r=g.ddns_dnspod_key,t.abrupt("break",10);case 6:return r=w.ddns_tx_key,t.abrupt("break",10);case 8:return r=P.ddns_ali_key,t.abrupt("break",10);case 10:if(!e.isOpen){t.next=55;break}if(e.ddnsType!==d.DdnsType.dnspod){t.next=26;break}return r=g.ddns_dnspod_key,t.prev=13,t.next=16,v.HttpRequest.post("https://dnsapi.cn/User.Detail",{format:"json",login_token:"".concat(e.account.id,",").concat(e.account.token)},!0);case 16:if(t.sent.status.code+""=="1"){t.next=19;break}return t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 19:t.next=24;break;case 21:return t.prev=21,t.t1=t.catch(13),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 24:case 37:t.next=52;break;case 26:if(e.ddnsType!==d.DdnsType.tengxun){t.next=39;break}return r=w.ddns_tx_key,t.prev=28,n=new S({credential:{secretId:e.account.secretid,secretKey:e.account.secretkey}}),t.next=32,n.DescribeUserDetail();case 32:t.next=37;break;case 34:return t.prev=34,t.t2=t.catch(28),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 39:if(e.ddnsType!==d.DdnsType.ali){t.next=52;break}return r=P.ddns_ali_key,t.prev=41,(o={Action:"DescribeTags",AccessKeyId:e.account.accesskey_id,SignatureMethod:"HMAC-SHA1",SignatureNonce:Math.random().toString(),Timestamp:(new Date).toISOString(),Format:"JSON",SignatureVersion:"1.0",Version:"2015-01-09",ResourceType:"DOMAIN"}).Signature=(0,P.generateAliSignature)(o,e.account.accesskey_secret),t.next=46,v.HttpRequest.get(P.alidnsEndpoint,o);case 46:t.sent,t.next=52;break;case 49:return t.prev=49,t.t3=t.catch(41),t.abrupt("return",(0,y.Sucess)("身份验证失败",b.RCode.DdnsAuthFail));case 52:return t.next=54,m.DataUtil.set(r,e);case 54:return t.abrupt("return",(0,y.Sucess)("身份信息正确"));case 55:return t.next=57,m.DataUtil.set(r,e);case 57:return t.abrupt("return",(0,y.Sucess)("保存成功"));case 58:case"end":return t.stop()}}),t,null,[[13,21],[28,34],[41,49]])})))}},{key:"getDdnsKey",value:function(){}},{key:"update",value:function(e,t,r,n){}}])&&c(r.prototype,n),a&&c(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,a}(E.DdnsPre);t.DdnsService=k,t.ddnsService=new k,t.ddnsService.ddnsTask()},1140:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.tengxunService=t.TengxunService=t.ddns_tx_key=void 0;var f=r(5584),p=r(603),h=r(7989).dnspod.v20210323.Client;t.ddns_tx_key="tengxun_ddns_key";var d=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),c(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,e),n=r,(i=[{key:"getDdnsKey",value:function(){return t.ddns_tx_key}},{key:"update",value:function(e,t,r,n){return f.__awaiter(this,void 0,void 0,o().mark((function a(){var i,c,s;return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=e.account,c=new h({credential:{secretId:i.secretid,secretKey:i.secretkey}}),o.next=4,c.DescribeRecordList({Domain:t.domain,Subdomain:t.subdomain});case 4:if(!((s=o.sent).RecordList&&s.RecordList.length>0)){o.next=10;break}return o.next=8,c.ModifyRecord({RecordType:n,SubDomain:t.subdomain,Domain:t.domain,Value:r,RecordLine:"默认"});case 8:o.next=12;break;case 10:return o.next=12,c.CreateRecord({RecordType:n,SubDomain:t.subdomain,Domain:t.domain,Value:r,RecordLine:"默认"});case 12:case"end":return o.stop()}}),a)})))}}])&&a(n.prototype,i),s&&a(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,i,s}(p.DdnsPre);t.TengxunService=d,t.tengxunService=new d},5658:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.FileCompress=void 0;var f=r(5584),p=f.__importDefault(r(6928)),h=r(9896),d=r(2029),v=r(6819),y=(r(3106),r(7172)),m=r(1231),b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"unZip",value:function(e,t,r){var n=h.statSync(e).size,o=0,a=h.createReadStream(e),i=d.Extract({path:t});a.on("data",(function(e){o+=e.length,r(o/n*100)})),a.on("end",(function(){r(100)})),i.on("error",(function(e){r(-1)})),a.pipe(i)}},{key:"unTar",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=h.statSync(e).size,a=0,i=h.createReadStream(e),c=v.x({cwd:t,gzip:n});i.on("data",(function(e){a+=e.length,r(a/o*100)})),i.on("end",(function(){r(100)})),i.on("error",(function(e){r(-1)})),c.on("error",(function(e){r(-1)})),i.pipe(c)}},{key:"unRar",value:function(e,t,r){return f.__awaiter(this,void 0,void 0,o().mark((function n(){var c,s,u,l,f,d,v,y,b,_,g,E,w,P,S,k;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return c=Uint8Array.from(h.readFileSync(e)).buffer,n.next=3,m.createExtractorFromData({data:c});case 3:s=n.sent,u=s.extract({}),l=i(u.files),f=[],d=[],v=a(l);try{for(v.s();!(y=v.n()).done;)(b=y.value).fileHeader.flags.directory?f.push(b):d.push(b)}catch(e){v.e(e)}finally{v.f()}for(_=0,r(0),g=0,E=f;g<E.length;g++)w=E[g],h.mkdirSync(p.default.join(t,w.fileHeader.name),{recursive:!0}),_++,r(_/l.length*100);for(P=0,S=d;P<S.length;P++)k=S[P],h.writeFileSync(p.default.join(t,k.fileHeader.name),k.extraction),_++,r(_/l.length*100);r(100);case 15:case"end":return n.stop()}}),n)})))}},{key:"compress",value:function(e,t,r,n,o,a){var i=arguments.length>6&&void 0!==arguments[6]&&arguments[6],c=h.createWriteStream(r),s=y(e,{zlib:{level:t},gzip:i});a(0),c.on("close",(function(){a(100)})),s.on("progress",(function(e){var t=e.fs,r=t.totalBytes,n=t.processedBytes;a(n/r*100)})),s.on("error",(function(e){a(-1)})),s.pipe(c),n.forEach((function(e){s.file(e,{name:p.default.basename(e)})})),o.forEach((function(e){s.directory(e,p.default.basename(e))})),s.finalize()}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.FileCompress=b},6182:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.FileController=void 0;var s=r(5584),u=r(9334),l=r(7127),f=r(5890),p=s.__importDefault(r(8461)),h=r(285),d=r(8411),v=r(4988),y=r(9625),m=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRootFile",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.FileServiceImpl.getFile("",e.headers.authorization);case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})))}},{key:"getFile",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.getFile(t,e.headers.authorization,r);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})))}},{key:"getFileInfo",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=f.Sucess,r.next=3,l.FileServiceImpl.getFileInfo(t.type,t.path,e.headers.authorization);case 3:return r.t1=r.sent,r.abrupt("return",(0,r.t0)(r.t1));case 5:case"end":return r.stop()}}),r)})))}},{key:"uploadFile",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.uploadFile(t,r,e.headers.authorization);case 2:return n.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return n.stop()}}),n)})))}},{key:"deletes",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.deletes(e.headers.authorization,t);case 2:return r.abrupt("return",r.sent);case 3:case"end":return r.stop()}}),r)})))}},{key:"save",value:function(e,t,r,n){return s.__awaiter(this,void 0,void 0,o().mark((function a(){return o().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,l.FileServiceImpl.save(e.headers.authorization,null==r?void 0:r.context,t,n);case 2:return o.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return o.stop()}}),a)})))}},{key:"common_base64_save",value:function(e,t,r){return s.__awaiter(this,void 0,void 0,o().mark((function n(){return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,l.FileServiceImpl.common_base64_save(e.headers.authorization,t,r.base64_context,r.type);case 2:return n.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return n.stop()}}),n)})))}},{key:"cut",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.cut(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"copy",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.copy(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"newFile",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.newFile(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"newDir",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.newDir(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"rename",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,l.FileServiceImpl.rename(e.headers.authorization,t);case 2:return r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"switchBasePath",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(n=h.Cache.getTokenMap().get(t.headers.authorization))&&(n.root_index=e.root_index),r.abrupt("return",(0,f.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"switchGetBasePath",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(r=h.Cache.getTokenMap().get(e.headers.authorization)).root_index)n=r.root_index;else for(a=y.settingService.getFilesSetting(),i=0;i<a.length;i++)a[i].default&&(n=i);return t.abrupt("return",(0,f.Sucess)(n));case 3:case"end":return t.stop()}}),t)})))}},{key:"file_video_trans",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.file_video_trans(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"uncompress",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.uncompress(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"compress",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.FileServiceImpl.FileCompress(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"studio_get_item",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=f.Sucess,r.next=3,l.FileServiceImpl.studio_get_item(e.path,t.headers.authorization);case 3:return r.t1=r.sent,r.abrupt("return",(0,r.t0)(r.t1));case 5:case"end":return r.stop()}}),r)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.FileController=m,s.__decorate([(0,u.Get)(),s.__param(0,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object]),s.__metadata("design:returntype",Promise)],m.prototype,"getRootFile",null),s.__decorate([(0,u.Get)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.QueryParam)("is_sys_path",{required:!1})),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Number]),s.__metadata("design:returntype",Promise)],m.prototype,"getFile",null),s.__decorate([(0,u.Post)("/file/info"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"getFileInfo",null),s.__decorate([(0,u.Put)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.UploadedFile)("file")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,"function"==typeof(c=void 0!==p.default&&p.default.File)?c:Object]),s.__metadata("design:returntype",Promise)],m.prototype,"uploadFile",null),s.__decorate([(0,u.Delete)("/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String]),s.__metadata("design:returntype",Promise)],m.prototype,"deletes",null),s.__decorate([(0,u.Post)("/save/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.Body)()),s.__param(3,(0,u.QueryParam)("is_sys_path",{required:!1})),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Object,Number]),s.__metadata("design:returntype",Promise)],m.prototype,"save",null),s.__decorate([(0,u.Post)("/base64/save/:path*"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Param)("path")),s.__param(2,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,String,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"common_base64_save",null),s.__decorate([(0,u.Post)("/cut"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"cut",null),s.__decorate([(0,u.Post)("/copy"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"copy",null),s.__decorate([(0,u.Post)("/new/file"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"newFile",null),s.__decorate([(0,u.Post)("/new/dir"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"newDir",null),s.__decorate([(0,u.Post)("/rename"),s.__param(0,(0,u.Ctx)()),s.__param(1,(0,u.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"rename",null),s.__decorate([(0,u.Post)("/base_switch"),s.__param(0,(0,u.Body)()),s.__param(1,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"switchBasePath",null),s.__decorate([(0,u.Post)("/base_switch/get"),s.__param(0,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object]),s.__metadata("design:returntype",Promise)],m.prototype,"switchGetBasePath",null),s.__decorate([(0,d.msg)(v.CmdType.file_video_trans),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"file_video_trans",null),s.__decorate([(0,d.msg)(v.CmdType.file_uncompress),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"uncompress",null),s.__decorate([(0,d.msg)(v.CmdType.file_compress),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[v.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"compress",null),s.__decorate([(0,u.Post)("/studio/get/item"),s.__param(0,(0,u.Body)()),s.__param(1,(0,u.Ctx)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,Object]),s.__metadata("design:returntype",Promise)],m.prototype,"studio_get_item",null),t.FileController=m=s.__decorate([(0,u.Controller)("/file")],m)},7127:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.FileServiceImpl=void 0;var h=r(5584),d=r(8076),v=h.__importDefault(r(9896)),y=h.__importDefault(r(4652)),m=h.__importDefault(r(6928)),b=r(5890),_=r(9485),g=r(7699),E=h.__importStar(r(7075)),w=r(9625),P=r(4988),S=r(5453),k=r(5658),A=r(9044),T=r(4861),O=h.__importDefault(r(333)),L=r(7172),C=r(904),x=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),u(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(t,e),r=t,n=[{key:"getFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var i,c,s,u,l,f,p,h,y,_,E,P,k,A,O,L,C,x;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(u={files:[],folders:[]},l=1===r?"/".concat(decodeURIComponent(e)):m.default.join(w.settingService.getFileRootPath(t),e?decodeURIComponent(e):""),v.default.existsSync(l)){n.next=4;break}return n.abrupt("return",(0,b.Fail)("路径不存在",S.RCode.Fail));case 4:if(!(f=v.default.statSync(l)).isFile()){n.next=15;break}if(!(f.size>20971520)){n.next=8;break}return n.abrupt("return",(0,b.Fail)("超过20MB",S.RCode.File_Max));case 8:return p=m.default.basename(l),h=v.default.readFileSync(l),(y=(0,b.Sucess)(h.toString(),S.RCode.PreFile)).message=p,n.abrupt("return",y);case 15:if(f.isDirectory()){n.next=17;break}return n.abrupt("return",(0,b.Fail)("不是文件",S.RCode.Fail));case 17:_=v.default.readdirSync(l),E=a(_);try{for(E.s();!(P=E.n()).done;){k=P.value,A=m.default.join(l,k),O=null;try{O=v.default.statSync(A)}catch(e){console.log("读取错误",e)}L=O?(0,g.getShortTime)(new Date(O.mtime).getTime()):"",C=O?(0,g.formatFileSize)(O.size):"",O&&O.isFile()?(x=(0,T.getFileFormat)(k),null===(i=u.files)||void 0===i||i.push({type:x,name:k,mtime:L,size:C,isLink:O.isSymbolicLink(),path:"".concat(e,"/").concat(k)})):O&&O.isDirectory()?null===(c=u.folders)||void 0===c||c.push({type:d.FileTypeEnum.folder,name:k,mtime:L,isLink:O.isSymbolicLink(),path:e}):null===(s=u.files)||void 0===s||s.push({type:d.FileTypeEnum.dev,name:k,mtime:L,size:C,path:"".concat(e,"/").concat(k)})}}catch(e){E.e(e)}finally{E.f()}return n.abrupt("return",(0,b.Sucess)(u));case 21:case"end":return n.stop()}}),n)})))}},{key:"getFileInfo",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a={},i=m.default.join(w.settingService.getFileRootPath(r),decodeURIComponent(t)),n.t0=e,n.next=n.t0===d.FileTypeEnum.folder?5:9;break;case 5:return n.next=7,this.getDiskSizeForPath(i);case 7:return a=n.sent,n.abrupt("break",10);case 9:return n.abrupt("break",10);case 10:return n.abrupt("return",a);case 11:case"end":return n.stop()}}),n,this)})))}},{key:"uploadFile",value:function(e,t,r){var n=m.default.join(w.settingService.getFileRootPath(r),e?decodeURIComponent(e):"");t?v.default.writeFileSync(n,t.buffer):v.default.existsSync(n)||v.default.mkdirSync(n,{recursive:!0})}},{key:"deletes",value:function(e,t){if(!t)return(0,b.Sucess)("1");var r=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(t));return w.settingService.protectionCheck(r)?(0,b.Fail)("1",S.RCode.PROTECT_FILE):(v.default.statSync(r).isFile()?v.default.unlinkSync(r):(0,_.rimraf)(r),(0,b.Sucess)("1"))}},{key:"save",value:function(e,t,r,n){if(null!=t){var o=1===n?"/".concat(decodeURIComponent(r)):m.default.join(w.settingService.getFileRootPath(e),r?decodeURIComponent(r):"");v.default.writeFileSync(o,t)}}},{key:"common_base64_save",value:function(e,t,r,n){var o=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(t)),a=Buffer.from(r,"base64");n===d.base64UploadType.all||n===d.base64UploadType.start?v.default.writeFileSync(o,a):n===d.base64UploadType.part&&v.default.appendFileSync(o,a)}},{key:"cut",value:function(e,t){if(t){var r,n=w.settingService.getFileRootPath(e),o=m.default.join(n),i=m.default.join(n,t.to?decodeURIComponent(t.to):""),c=a(t.files);try{for(c.s();!(r=c.n()).done;){var s=r.value,u=decodeURIComponent(m.default.join(o,s));v.default.renameSync(u,decodeURIComponent(m.default.join(i,m.default.basename(s)))),(0,_.rimraf)(u)}}catch(e){c.e(e)}finally{c.f()}}}},{key:"copy",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,i,c,s,u,l,f;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=2;break}return r.abrupt("return");case 2:n=w.settingService.getFileRootPath(e),i=m.default.join(n),c=m.default.join(n,t.to?decodeURIComponent(t.to):""),s=a(t.files),r.prev=6,s.s();case 8:if((u=s.n()).done){r.next=15;break}return l=u.value,f=decodeURIComponent(m.default.join(i,l)),r.next=13,y.default.copy(f,decodeURIComponent(m.default.join(c,m.default.basename(l))),{overwrite:!0});case 13:r.next=8;break;case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(6),s.e(r.t0);case 20:return r.prev=20,s.f(),r.finish(20);case 23:case"end":return r.stop()}}),r,null,[[6,17,20,23]])})))}},{key:"newFile",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.todoNew(e,2,t);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"newDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.todoNew(e,1,t);case 2:case"end":return r.stop()}}),r,this)})))}},{key:"todoNew",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(null!=r){n.next=2;break}return n.abrupt("return");case 2:if(i=m.default.join(w.settingService.getFileRootPath(e),decodeURIComponent(r.name)),!v.default.existsSync(i)){n.next=5;break}return n.abrupt("return");case 5:1===t?v.default.mkdirSync(i,{recursive:!0}):v.default.writeFileSync(i,null!==(a=r.context)&&void 0!==a?a:"");case 6:case"end":return n.stop()}}),n)})))}},{key:"rename",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,i;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(t){r.next=2;break}return r.abrupt("return");case 2:return n=w.settingService.getFileRootPath(e),a=m.default.join(n,decodeURIComponent(t.name)),i=m.default.join(n,decodeURIComponent(t.newName)),r.next=7,y.default.rename(a,i);case 7:case"end":return r.stop()}}),r)})))}},{key:"download",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s,u,l,f,p,h,d,y,b,_;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((r=e.request.query.file)&&r.length){t.next=5;break}return e.status=404,e.body="File not found",t.abrupt("return");case 5:return n=e.query.token,t.next=8,w.settingService.check(n);case 8:if(t.sent){t.next=12;break}return e.status=404,e.body="File not found",t.abrupt("return");case 12:if(Array.isArray(r)){f=r,p=L("zip",{zlib:{level:5}}),e.attachment("output.zip"),e.set("Content-Type","application/octet-stream"),h=new E.PassThrough,e.body=h,p.pipe(h),d=a(f);try{for(d.s();!(y=d.n()).done;)b=y.value,_=m.default.join(w.settingService.getFileRootPath(n),decodeURIComponent(b)),v.default.statSync(_).isFile()?p.file(_,{name:m.default.basename(_)}):p.directory(_,m.default.basename(_))}catch(e){d.e(e)}finally{d.f()}p.finalize()}else i=m.default.join(w.settingService.getFileRootPath(n),decodeURIComponent(r)),c=m.default.basename(i),s=v.default.statSync(i),e.set("Content-Type",C.lookup(c)||"application/octet-stream"),c.endsWith(".pdf")||e.attachment(c),s.isFile()?(e.set("Cache-Control","public, max-age=3600"),e.body=v.default.createReadStream(i)):(e.attachment(c+".zip"),u=L("zip",{zlib:{level:5}}),l=new E.PassThrough,e.body=l,u.pipe(l),u.directory(i,m.default.basename(i)),u.finalize());case 13:case"end":return t.stop()}}),t)})))}},{key:"file_video_trans",value:function(e){var t=e.context,r=e.wss,n=w.settingService.getFileRootPath(t.token),o=m.default.join(n,decodeURIComponent(t.source_filename)),a=m.default.join(n,decodeURIComponent(t.to_filename));(0,A.getFfmpeg)()(o).toFormat(t.to_format).on("start",(function(e){var t=new P.WsData(P.CmdType.file_video_trans_progress);t.context=0,r.sendData(t.encode())})).on("progress",(function(e){var t=new P.WsData(P.CmdType.file_video_trans_progress);t.context=e.percent.toFixed(0),r.sendData(t.encode())})).on("error",(function(e,t,n){r.ws.close()})).on("end",(function(){var e=new P.WsData(P.CmdType.file_video_trans_progress);e.context=100,r.sendData(e.encode())})).save(a)}},{key:"uncompress",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i,c,s,u,l,f,p;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.context,a=decodeURIComponent(n.source_file),i=decodeURIComponent(null!==(r=n.tar_dir)&&void 0!==r?r:""),c=m.default.dirname(a),s=w.settingService.getFileRootPath(n.token),u=m.default.join(s,c,i),l=e.wss,i&&v.default.mkdirSync(m.default.join(u),{recursive:!0}),f=m.default.join(s,a),p=function(e){if(-1!==e){var t=new P.WsData(P.CmdType.file_uncompress_progress);t.context=e,l.sendData(t.encode())}else l.ws.close()},n.format!==d.FileCompressType.tar){t.next=14;break}this.unTar(f,u,p),t.next=34;break;case 14:if(n.format!==d.FileCompressType.zip){t.next=18;break}this.unZip(f,u,p),t.next=34;break;case 18:if(n.format!==d.FileCompressType.gzip){t.next=22;break}this.unTar(f,u,p,!0),t.next=34;break;case 22:if(n.format!==d.FileCompressType.rar){t.next=33;break}return t.prev=23,t.next=26,this.unRar(f,u,p);case 26:t.next=31;break;case 28:t.prev=28,t.t0=t.catch(23),l.ws.close();case 31:t.next=34;break;case 33:l.ws.close();case 34:case"end":return t.stop()}}),t,this,[[23,28]])})))}},{key:"FileCompress",value:function(e){var t,r,n=e.context,o=n.filePaths,i=w.settingService.getFileRootPath(n.token),c=e.wss,s=[],u=[],l=a(o);try{for(l.s();!(t=l.n()).done;){var f=t.value,p=m.default.join(i,decodeURIComponent(f));try{v.default.statSync(p).isFile()?s.push(p):u.push(p)}catch(e){}}}catch(e){l.e(e)}finally{l.f()}r=n.format===d.FileCompressType.gzip?d.FileCompressType.tar:n.format;var h=m.default.join(i,decodeURIComponent(n.tar_filename));this.compress(r,n.compress_level,h,s,u,(function(e){if(-1!==e){var t=new P.WsData(P.CmdType.file_compress_progress);t.context=e,c.sendData(t.encode())}else c.ws.close()}),n.format===d.FileCompressType.gzip)}},{key:"getTotalFile",value:function(e,t){try{if(v.default.statSync(t).isFile())return e.total+=1,void e.files.push(t)}catch(e){return}var r,n=a(v.default.readdirSync(t));try{for(n.s();!(r=n.n()).done;){var o=r.value,i=m.default.join(t,o);this.getTotalFile(e,i)}}catch(e){n.e(e)}finally{n.f()}}},{key:"studio_get_item",value:function(e,t){return h.__awaiter(this,void 0,void 0,o().mark((function r(){var n,i,c,s,u,l,f,p;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n={list:[]},i=m.default.join(w.settingService.getFileRootPath(t),e?decodeURIComponent(e):""),v.default.existsSync(i)){r.next=4;break}return r.abrupt("return",(0,b.Fail)("路径不存在",S.RCode.Fail));case 4:if(!v.default.statSync(i).isFile()){r.next=7;break}return r.abrupt("return",(0,b.Fail)("是文件",S.RCode.Fail));case 7:c=v.default.readdirSync(i),s=a(c),r.prev=9,s.s();case 11:if((u=s.n()).done){r.next=25;break}l=u.value,f=m.default.join(i,l),p=null,r.prev=15,p=v.default.statSync(f),r.next=22;break;case 19:return r.prev=19,r.t0=r.catch(15),r.abrupt("continue",23);case 22:n.list.push({type:p.isFile()?"file":"folder",name:l});case 23:r.next=11;break;case 25:r.next=30;break;case 27:r.prev=27,r.t1=r.catch(9),s.e(r.t1);case 30:return r.prev=30,s.f(),r.finish(30);case 33:return r.abrupt("return",n);case 34:case"end":return r.stop()}}),r,null,[[9,27,30,33],[15,19]])})))}},{key:"getDiskSizeForPath",value:function(e){return h.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},t.prev=1,t.next=4,O.default.fsSize();case 4:n=t.sent,a=m.default.resolve(e),n.forEach((function(e){if(a.startsWith(e.mount)){if(!i)return void(i=e);e.mount.length>i.mount.length&&(i=e)}})),i&&(r.path=a,r.name=m.default.basename(e),r.total_size=(0,g.formatFileSize)(i.size),r.left_size=(0,g.formatFileSize)(i.available),r.fs_type=i.type),t.next=14;break;case 10:return t.prev=10,t.t0=t.catch(1),console.error("Error fetching disk information:",t.t0),t.abrupt("return",r);case 14:return t.abrupt("return",r);case 15:case"end":return t.stop()}}),t,null,[[1,10]])})))}}],n&&c(r.prototype,n),i&&c(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(k.FileCompress);t.FileServiceImpl=new x},3468:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.NavindexController=void 0;var i=r(5584),c=r(9334),s=r(5890),u=r(5443),l=r(274),f="navindex_key_list",p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"add",value:function(e){var t=l.DataUtil.get(f);return Array.isArray(t)?(t.push(e),l.DataUtil.set(f,t)):l.DataUtil.set(f,[e]),(0,s.Sucess)("ok")}},{key:"save",value:function(e){return l.DataUtil.set(f,e),(0,s.Sucess)("ok")}},{key:"get",value:function(){var e=l.DataUtil.get(f);return(0,s.Sucess)(e||[])}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NavindexController=p,i.__decorate([(0,c.Post)("/add"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Object]),i.__metadata("design:returntype",void 0)],p.prototype,"add",null),i.__decorate([(0,c.Post)("/save"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Array]),i.__metadata("design:returntype",void 0)],p.prototype,"save",null),i.__decorate([(0,c.Get)(),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],p.prototype,"get",null),t.NavindexController=p=i.__decorate([(0,u.Service)(),(0,c.Controller)("/navindex")],p)},1076:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.NetController=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(8411),f=r(4988),p=r(7228),h=r(6369),d=r(274),v=r(2904),y="navindex_net_key_list",m="navindex_wol_key",b=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",h.netService.start(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.netService.close(e);case 2:return t.abrupt("return",(0,u.Sucess)("1"));case 3:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return d.DataUtil.set(y,e),(0,u.Sucess)("ok")}},{key:"get",value:function(){var e=d.DataUtil.get(y);return(0,u.Sucess)(e||[])}},{key:"saveWolTag",value:function(e){return d.DataUtil.set(m,e),(0,u.Sucess)("ok")}},{key:"getWolTag",value:function(){var e=d.DataUtil.get(m);return(0,u.Sucess)(e||[])}},{key:"wol",value:function(e){return h.netService.wol(e.mac),(0,u.Sucess)("")}},{key:"virServerGet",value:function(){return(0,u.Sucess)(v.virtualService.virServerGet())}},{key:"virServerSave",value:function(e){return v.virtualService.virServerSave(e),(0,u.Sucess)("1")}},{key:"virClientGet",value:function(){return(0,u.Sucess)(v.virtualService.virClientGet())}},{key:"virClientSave",value:function(e){return v.virtualService.virClientSave(e),(0,u.Sucess)("1")}},{key:"getServerInfos",value:function(e){var t=[];return v.virtualService.serverRealMap.forEach((function(e){t.push([e.vir_ip,e.to_address,e.to_address?"在线":"离线"])})),t}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NetController=b,c.__decorate([(0,s.Post)("/start"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.NetPojo]),c.__metadata("design:returntype",Promise)],b.prototype,"start",null),c.__decorate([(0,s.Post)("/close"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.NetPojo]),c.__metadata("design:returntype",Promise)],b.prototype,"close",null),c.__decorate([(0,s.Post)("/tag/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],b.prototype,"save",null),c.__decorate([(0,s.Get)("/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"get",null),c.__decorate([(0,s.Post)("/wol/tag/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],b.prototype,"saveWolTag",null),c.__decorate([(0,s.Get)("/wol/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"getWolTag",null),c.__decorate([(0,s.Post)("/wol/exec"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",void 0)],b.prototype,"wol",null),c.__decorate([(0,s.Get)("/vir/server/get"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"virServerGet",null),c.__decorate([(0,s.Post)("/vir/server/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.VirServerPojo]),c.__metadata("design:returntype",void 0)],b.prototype,"virServerSave",null),c.__decorate([(0,s.Get)("/vir/client/get"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],b.prototype,"virClientGet",null),c.__decorate([(0,s.Post)("/vir/client/save"),c.__param(0,(0,s.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[p.VirClientPojo]),c.__metadata("design:returntype",void 0)],b.prototype,"virClientSave",null),c.__decorate([(0,l.msg)(f.CmdType.vir_net_serverIno_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[f.WsData]),c.__metadata("design:returntype",void 0)],b.prototype,"getServerInfos",null),t.NetController=b=c.__decorate([(0,s.Controller)("/net")],b)},6369:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.netService=t.NetService=void 0;var u=r(5584),l=r(7228),f=r(8872),p=r(5890),h=u.__importDefault(r(3152)),d=r(6101),v=r(5695),y=r(3688),m=r(7194),b=null,_=new Map,g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=_.get(e.targetProxyUrl))){t.next=3;break}return t.abrupt("return",(0,p.Sucess)(r.beforPort));case 3:return n={},_.set(e.targetProxyUrl,n),t.next=7,(0,f.findAvailablePort)(49152,65535);case 7:return i=t.sent,n.beforPort=i,(c=new d).use(v()),n.server=c.listen(i,(function(){console.log("Server is running on port ".concat(i))})),s={target:e.targetProxyUrl,changeOrigin:!0,events:{proxyRes:function(e,t,r){e.headers["X-Frame-Options"]="",e.headers["Content-Security-Policy"]=""}},rewrite:function(e){return n.heartbeat=!0,e}},e.sysProxyPort&&(s.agent=new y("http://127.0.0.1:".concat(e.sysProxyPort))),c.use((0,h.default)(/^.*$/,s)),(new l.NetPojo).proxyPort=i,b||(b=setInterval((function(){var e,t=a(_.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value,n=_.get(r);n.heartbeat?n.heartbeat=!1:(n.server&&n.server.close(),_.delete(r),console.log("超时关闭代理",r))}}catch(e){t.e(e)}finally{t.f()}0===_.size&&(clearInterval(b),b=null)}),6e5)),t.abrupt("return",(0,p.Sucess)(i));case 19:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){if(e.targetProxyUrl){var t=_.get(e.targetProxyUrl);t&&(t.server&&t.server.close(),_.delete(e.targetProxyUrl)),console.log("主动关闭代理",e.targetProxyUrl)}else{var r,n=a(_.keys());try{for(n.s();!(r=n.n()).done;){var o=r.value,i=_.get(o);i.server&&i.server.close(),_.delete(o),i.heartbeat=!1}}catch(e){n.e(e)}finally{n.f()}b&&clearInterval(b)}}},{key:"wol",value:function(e){var t=m.createSocket("udp4");t.bind((function(){t.setBroadcast(!0)}));var r=e.split(":").map((function(e){return parseInt(e,16)})),n=Buffer.concat([Buffer.from([255,255,255,255,255,255]),Buffer.concat(Array(16).fill(Buffer.from(r)))]);t.send(n,9,"127.0.0.1",(function(e){e?console.error("Error sending WOL packet:",e):console.log("WOL packet sent successfully!"),t.close()}))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.NetService=g,t.netService=new g},2904:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,c(n.key),n)}}function i(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}function h(e,t){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},h(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.virtualService=t.VirtualService=void 0;var d,v=r(5584),y=r(274),m=r(7228),b=r(5101),_=r(3129),g=r(6602),E=r(8872),w=r(3570),P=r(9044),S=r(7194),k=r(9278),A=r(6982),T=r(2710),O=T.LinuxTun,L=(T.LinuxTap,T.Wintun),C=(r(6928),"vir_server_net_data_key"),x="vir_client_net_data_key",I="vir_data_client_hash_key",H="vir_data_server_hash_key";!function(e){e[e.empty=0]="empty",e[e.error=1]="error",e[e.register=2]="register",e[e.connect=3]="connect",e[e.data=4]="data",e[e.heart=5]="heart",e[e.trans_data=6]="trans_data"}(d||(d={}));var N=function(e){function t(){var e;return s(this,t),(e=u(this,t,arguments)).heart=!1,e.starChecktHeart=function(t,r,n){e.close=function(){e.checkUdp(e.udpClient,(function(){e.udpClient.close(),e.udpClient=null})),t.delete(r),clearInterval(e.heartInterval),clearInterval(e.heartCheckInterval),console.log("断开udp连接--",r)},e.heartCheckInterval=setInterval((function(){e.heart||!e.udpClient?e.heart=!1:e.close()}),15e3),e.heartInterval=setInterval((function(){e.udpClient&&e.udpClient.send(n,e.to_port,e.to_address,(function(e){}))}),2e3)},e}return p(t,e),i(t)}(g.UdpUtil),D=function(e){function t(){var e;return s(this,t),(e=u(this,t,arguments)).serverRealMap=new Map,e.serverStatus=!1,e.clientIPAndUdpMap=new Map,e.tun={},e.clientStatus=!1,e.serverTypeIsTcp=!1,e}return p(t,e),i(t,[{key:"virServerGet",value:function(){var e=y.DataUtil.get(C);return e||(e=new m.VirServerPojo,y.DataUtil.set(C,e),e)}},{key:"virClientGet",value:function(){var e=y.DataUtil.get(x);return e||(e=new m.VirClientPojo,y.DataUtil.set(x,e),e)}},{key:"get64Key",value:function(e){var t=A.createHash("sha256");return t.update(e),t.digest("hex")}},{key:"getUdpBuffer",value:function(e,t,r){var n=Buffer.alloc(1);n[0]=e;var o=Buffer.from(r);return Buffer.concat([n,o,t])}},{key:"getUdpData",value:function(e){if(!(e.length<65))return{code:e[0],hashKey:e.toString("utf8",1,65),buffer:e=e.subarray(65)}}},{key:"getTcpBuffer",value:function(e,t){var r=Buffer.alloc(1);return r[0]=e,Buffer.concat([r,t])}},{key:"getTcpData",value:function(e){if(!(e.length<1))return{code:e[0],tcpBuffer:e.subarray(1)}}},{key:"udpServerStart",value:function(e){var t=this;if(!this.udpServer){var r=S.createSocket("udp4");r.bind(e),r.on("message",(function(e,n){try{var o=t.getUdpData(e),a=o.hashKey,i=o.code,c=o.buffer,s=t.getServerHashKey();if(a!==s)return;var u=JSON.parse(c.toString());switch(i){case d.register:console.log("注册更新------来自".concat(n.address,":").concat(n.port));var l=t.serverRealMap.get(u.ip);l||((l=new N).to_address=n.address,l.to_port=n.port,l.heart=!0),t.serverRealMap.set(u.ip,l),r.send(t.getUdpBuffer(d.register,Buffer.alloc(0),s),n.port,n.address,(function(e){})),setTimeout((function(){l.heart=!1}),3e3);break;case d.connect:var f=t.serverRealMap.get(u.ip);if(!f)return void r.send(t.getUdpBuffer(d.error,Buffer.alloc(0),s),n.port,n.address,(function(e){}));r.send(t.getUdpBuffer(d.connect,Buffer.from(JSON.stringify(f)),s),n.port,n.address,(function(e){}));var p=new N;p.vir_ip=u.self_ip,p.to_port=n.port,p.to_address=n.address,r.send(t.getUdpBuffer(d.connect,Buffer.from(JSON.stringify(p)),s),f.to_port,f.to_address,(function(e){}));case d.data:}}catch(e){return}})),this.udpServer=r,console.log("udp服务器运行开始")}}},{key:"getTransBuffer",value:function(e,t){var r=Buffer.from(e),n=Buffer.alloc(1);return n[0]=r.length,Buffer.concat([n,r,t])}},{key:"getTransData",value:function(e){var t=e[0],r=e.subarray(1,t+1);return{data:e.subarray(t+1),vir_ip:r.toString()}}},{key:"tcpServerStart",value:function(e){var t=this;if(!this.tcpServer){var r=k.createServer((function(e){console.log("客户端连接");var r=new w.TcpUtil(e);r.setHead(0);var n="",o=setTimeout((function(){n||e.end()}),3e3),a=new N;r.setOn((function(e,i){var c=t.getTcpData(i),s=c.code,u=c.tcpBuffer;switch(s){case d.register:var l=t.getServerHashKey();clearTimeout(o);var f=JSON.parse(u.toString());if(f.hashKey!==l)return;n=f.ip,a.heart=!0,a.vir_ip=f.ip,a.tcpSocket=r,t.clientIPAndUdpMap.set(f.ip,a),setInterval((function(){a.heart=!1}),6e4);break;case d.trans_data:var p=t.getTransData(u),h=p.data,v=p.vir_ip,y=t.clientIPAndUdpMap.get(v);if(!y||!y.heart)return;y.tcpSocket.sendToSocket(Buffer.alloc(0),t.getTcpBuffer(d.data,h));break;case d.heart:a.heart=!0}})),e.on("data",(function(e){r.handleSocket(e)})),e.on("end",(function(){a.heart=!1,console.log("客户端断开连接")})),e.on("error",(function(e){console.error("Socket 错误:",e),a.heart=!1}))}));r.listen(e,(function(){console.log("tcp服务器运行开始")})),this.tcpServer=r}}},{key:"getClientHashKey",value:function(){return y.DataUtil.get(I)}},{key:"getServerHashKey",value:function(){return y.DataUtil.get(H)}},{key:"getRandomAblePort",value:function(){return v.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,E.findAvailablePort)(49152,65535);case 2:case"end":return e.stop()}}),e)})))}},{key:"udpClientCreateAndGet",value:function(e,t,r){return v.__awaiter(this,void 0,void 0,o().mark((function n(){var a=this;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise((function(n){var o=a.clientIPAndUdpMap.get(e);if(-1!==o)if(o)n(o);else{a.clientIPAndUdpMap.set(e,-1);var i=S.createSocket("udp4");i.bind();var c=y.DataUtil.get(x);i.send(a.getUdpBuffer(d.connect,Buffer.from(JSON.stringify({ip:e,self_ip:c.ip})),a.getClientHashKey()),r,t,(function(e){}));var s=setInterval((function(){i.send(a.getUdpBuffer(d.connect,Buffer.from(JSON.stringify({ip:e,self_ip:c.ip})),a.getClientHashKey()),r,t,(function(e){}))}),2500),u=setTimeout((function(){a.clientIPAndUdpMap.delete(e),clearInterval(s),n(null)}),5e3),l=new N;l.udpClient=i,i.on("message",(function(t,r){try{var o=a.getUdpData(t),c=o.hashKey,f=o.code,p=o.buffer,h=a.getClientHashKey();if(c!==h)return;switch(f){case d.error:case d.register:break;case d.connect:clearInterval(s),clearTimeout(u);var v=JSON.parse(p.toString());i.send(a.getUdpBuffer(d.empty,Buffer.alloc(0),h),v.to_port,v.to_address,(function(e){})),l.to_port=v.to_port,l.to_address=v.to_address,l.heart=!0,a.clientIPAndUdpMap.set(e,l),l.starChecktHeart(a.clientIPAndUdpMap,e,a.getUdpBuffer(d.heart,Buffer.alloc(0),a.getClientHashKey())),console.log(e,"的udp创建完成(主动)"),n(l);break;case d.data:a.writeToTun(p);break;case d.heart:l.heart=!0}}catch(t){return void console.log("尝试连接出错",e)}}))}})));case 1:case"end":return n.stop()}}),n)})))}},{key:"init",value:function(){return v.__awaiter(this,void 0,void 0,o().mark((function e(){var t,r;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((t=y.DataUtil.get(C))&&(this.serverStatus=t.open,t.open&&(t.model===m.VirServerEnum.udp?this.udpServerStart(t.port):t.model===m.VirServerEnum.tcp&&this.tcpServerStart(t.port))),!(r=y.DataUtil.get(x))){e.next=9;break}if(!r.open){e.next=9;break}return e.next=7,this.getServerType(r.serverIp,r.serverPort);case 7:this.clientStatus=r.open,this.tunStart(r);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"virServerSave",value:function(e){y.DataUtil.set(C,e);var t=this.get64Key(e.key);if(y.DataUtil.set(H,t),e.open){if(this.serverStatus)return;e.model===m.VirServerEnum.udp?this.udpServerStart(e.port):e.model===m.VirServerEnum.tcp&&this.tcpServerStart(e.port),this.serverStatus=!0}else{try{this.udpServer&&(this.udpServer.close(),this.udpServer=null,console.log("关闭udp服务器")),this.tcpServer&&(this.tcpServer.close(),this.tcpServer=null,console.log("关闭tcp服务器"))}catch(e){console.log("p2p服务关闭失败")}this.serverStatus=!1}}},{key:"ipToBuffer",value:function(e){var t=e.split(".").map(Number);return Buffer.from(t)}},{key:"ipToInt",value:function(e){return e.readUInt32BE(0)}},{key:"getClientIp",value:function(){var e=this.client_ip_int;if(e)return e;var t=y.DataUtil.get(x);return e=this.ipToInt(this.ipToBuffer(t.ip)),this.client_ip_int=e,e}},{key:"getClientMask",value:function(){var e=this.client_mask_int;if(e)return e;var t=y.DataUtil.get(x);return e=this.ipToInt(this.cidrToBinary(t.mask)),this.client_mask_int=e,e}},{key:"cidrToBinary",value:function(e){var t=4294967295<<32-e>>>0,r=[t>>>24&255,t>>>16&255,t>>>8&255,255&t];return Buffer.from(r)}},{key:"isSameSubnet",value:function(e){var t=this.getClientIp(),r=this.ipToInt(e),n=this.getClientMask();return(t&n)==(r&n)&&r!==t}},{key:"getDestIpByTunPackage",value:function(e){if(4===e[0]>>4){var t=e.subarray(16,20);if(this.isSameSubnet(t))return t.join(".")}}},{key:"handleTunPackage",value:function(e,t,r){return v.__awaiter(this,void 0,void 0,o().mark((function n(){var a,i;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=this.getDestIpByTunPackage(e)){n.next=3;break}return n.abrupt("return");case 3:if(!this.serverTypeIsTcp||!this.tcpReceiveRegisterSocketUtil){n.next=7;break}this.tcpReceiveRegisterSocketUtil.sendToSocket(Buffer.alloc(0),this.getTcpBuffer(d.trans_data,this.getTransBuffer(a,e))),n.next=13;break;case 7:return n.next=9,this.udpClientCreateAndGet(a,t,r);case 9:if(i=n.sent){n.next=12;break}return n.abrupt("return");case 12:i.udpClient.send(this.getUdpBuffer(d.data,e,this.getClientHashKey()),i.to_port,i.to_address,(function(e){}));case 13:case"end":return n.stop()}}),n,this)})))}},{key:"tunStart",value:function(e){var t=this,r=e.ip,n=e.mask;try{if("win"===b.sysType)L.wintunSetPath((0,P.get_wintun_dll_path)()),L.wintunInit(),L.wintunSetIpv4("filecat",r,n),L.wintunUpOn((function(r){t.handleTunPackage(r,e.serverIp,e.serverPort)}));else{var o=new O;o.mtu=4096,o.ipv4="".concat(r,"/").concat(n,"'"),o.on("data",(function(r){t.handleTunPackage(r,e.serverIp,e.serverPort)})),o.isUp=!0,this.tun.linuxTun=o}}catch(e){console.log("error: ",e)}this.serverTypeIsTcp?this.virTcpClientRegister(e.ip,e.serverPort,e.serverIp):this.virUdpClientRegister(e.ip,e.serverPort,e.serverIp),console.log("tun适配器启动---","".concat(r,"/").concat(n))}},{key:"virTcpClientRegister",value:function(e,t,r){var n=this;if(!this.tcpReceiveRegisterSocketUtil){var o=new k.Socket,a=new w.TcpUtil(o);a.setHead(0);var i,c=setTimeout((function(){console.log("重试连接tcp"),n.virTcpClientRegister(e,t,r)}),5e3);o.connect(t,r,(function(){clearTimeout(c),n.tcpReceiveRegisterSocketUtil=a,console.log("连接到tcp服务器"),a.sendToSocket(Buffer.alloc(0),n.getTcpBuffer(d.register,Buffer.from(JSON.stringify({ip:e,hashKey:n.getClientHashKey()})))),a.setOn((function(e,t){var r=n.getTcpData(t),o=r.code,a=r.tcpBuffer;if(o===d.data)n.writeToTun(a)})),i=setInterval((function(){a.sendToSocket(Buffer.alloc(0),n.getTcpBuffer(d.heart,Buffer.alloc(0)))}),2e3)})),o.on("data",(function(e){a.handleSocket(e)})),o.on("close",(function(){console.log("tcp服务器连接已关闭"),n.tcpReceiveRegisterSocketUtil=null,n.virTcpClientRegister(e,t,r),i&&clearInterval(i)})),o.on("error",(function(o){console.error("Socket 错误:",o),n.tcpReceiveRegisterSocketUtil=null,n.virTcpClientRegister(e,t,r),i&&clearInterval(i)}))}}},{key:"virUdpClientRegister",value:function(e,t,r){var n=this;if(!this.udpReceiveRegisterClient){var o=S.createSocket("udp4");o.bind();var a=setInterval((function(){n.checkUdp(o,(function(){o.send(n.getUdpBuffer(d.register,Buffer.from(JSON.stringify({ip:e})),n.getClientHashKey()),t,r,(function(e){}))}),(function(){clearInterval(a)}))}),5e3);this.udpReceiveRegisterClient=o;var i=new N;o.on("message",(function(c,s){try{var u=n.getUdpData(c),l=u.hashKey,f=u.code,p=u.buffer;if(l!==y.DataUtil.get(I))return;switch(f){case d.register:break;case d.connect:var h=JSON.parse(p.toString());o.send(n.getUdpBuffer(d.empty,Buffer.alloc(0),n.getClientHashKey()),h.to_port,h.to_address,(function(e){})),n.clientIPAndUdpMap.set(h.vir_ip,i),i.udpClient=o,i.to_address=h.to_address,i.to_port=h.to_port,i.heart=!0,i.starChecktHeart(n.clientIPAndUdpMap,h.vir_ip,n.getUdpBuffer(d.heart,Buffer.alloc(0),n.getClientHashKey())),n.udpReceiveRegisterClient=null,clearInterval(a),n.virUdpClientRegister(e,t,r),console.log(h.vir_ip,"的udp创建完成(接收)");break;case d.data:n.writeToTun(p);break;case d.heart:i.heart=!0}}catch(e){return}}))}}},{key:"writeToTun",value:function(e){try{if(!this.clientStatus)return;"win"===b.sysType?L.wintunSend(e):this.tun.linuxTun.write(e)}catch(e){console.log("写入网卡失败")}}},{key:"closeTun",value:function(){this.clientStatus&&("win"===b.sysType?L.wintunClose():this.tun.linuxTun.release(),console.log("关闭适配器"))}},{key:"checkTcpServerType",value:function(e,t){return new Promise((function(r,n){var o=new k.Socket;o.setTimeout(3e3),o.on("connect",(function(){o.destroy(),r(!0)})),o.on("timeout",(function(){o.destroy(),r(!1)})),o.on("error",(function(e){r(!1)})),o.connect(t,e)}))}},{key:"getServerType",value:function(e,t){return v.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.checkTcpServerType(e,t);case 2:this.serverTypeIsTcp=r.sent,console.log("服务器类型是",this.serverTypeIsTcp?"tcp":"udp");case 4:case"end":return r.stop()}}),r,this)})))}},{key:"virClientSave",value:function(e){return v.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(y.DataUtil.set(x,e),r=this.get64Key(e.key),y.DataUtil.set(I,r),!e.open){t.next=12;break}if(!this.clientStatus){t.next=6;break}return t.abrupt("return");case 6:return t.next=8,this.getServerType(e.serverIp,e.serverPort);case 8:this.clientStatus=!0,this.tunStart(e),t.next=14;break;case 12:try{this.udpReceiveRegisterClient&&(this.udpReceiveRegisterClient.close(),this.udpReceiveRegisterClient=null),this.clientIPAndUdpMap.forEach((function(e){try{-1!==e&&e.close.bind(e)()}catch(e){console.log(e)}})),this.tcpReceiveRegisterSocketUtil&&this.tcpReceiveRegisterSocketUtil.getSocket().destroy(),this.closeTun()}catch(e){console.log("客户端关闭失败")}this.clientStatus=!1;case 14:case"end":return t.stop()}}),t,this)})))}}])}(g.UdpUtil);t.VirtualService=D,t.virtualService=new D,_.ServerEvent.on("start",(function(e){t.virtualService.init()}))},9643:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.LifecycleRecordService=void 0;var u=r(5584),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.dataMap=new Map,this.heatMap=new Map,this.endMap=new Map},t=[{key:"lifeStart",value:function(e,t,r){var n=this;if(t&&this.dataMap.set(e,t),r&&this.endMap.set(e,r),this.heatMap.set(e,Date.now()),!this.timer){var i=Date.now();this.timer=setInterval((function(){return u.__awaiter(n,void 0,void 0,o().mark((function e(){var t,r,n,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,0!==this.heatMap.size){e.next=5;break}return clearInterval(this.timer),this.timer=null,e.abrupt("return");case 5:t=a(this.heatMap.keys()),e.prev=6,t.s();case 8:if((r=t.n()).done){e.next=16;break}if(n=r.value,c=this.heatMap.get(n),!(i-c>3e5)){e.next=14;break}return e.next=14,this.lifeClose(n);case 14:e.next=8;break;case 16:e.next=21;break;case 18:e.prev=18,e.t0=e.catch(6),t.e(e.t0);case 21:return e.prev=21,t.f(),e.finish(21);case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(0),console.log(e.t1);case 29:case"end":return e.stop()}}),e,this,[[0,26],[6,18,21,24]])})))}),3e3)}}},{key:"lifeGetData",value:function(e){return this.dataMap.get(e)}},{key:"lifeHeart",value:function(e){this.heatMap.set(e,Date.now())}},{key:"lifeClose",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=this.endMap.get(e))){t.next=4;break}return t.next=4,r(this.dataMap.get(e));case 4:this.heatMap.delete(e),this.endMap.delete(e),this.dataMap.delete(e);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"asyncExec",value:function(e){return u.__awaiter(this,arguments,void 0,(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e3;return o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise((function(r,n){var o=setTimeout((function(){r(null)}),t);e((function(e){return clearTimeout(o),r(e)}),n)})));case 1:case"end":return r.stop()}}),r)}))()}))}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.LifecycleRecordService=l},3570:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.TcpUtil=void 0;var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.protocal=Buffer.from([25,152]),this.buffer=Buffer.alloc(0),this.processing=!1,this.socket=t},(t=[{key:"setHead",value:function(e){this.headLength=e}},{key:"setOn",value:function(e){this.onData=e}},{key:"handleSocket",value:function(e){this.buffer=Buffer.concat([this.buffer,e]),this.buffer.length>=this.headLength+3&&!this.processing&&(this.processing=!0,this.handleBuffer())}},{key:"handleBuffer",value:function(){if(this.buffer[0]!==this.protocal[0]||this.buffer[1]!==this.protocal[1])return this.buffer=Buffer.alloc(0),void(this.processing=!1);var e=this.bufferToInt(this.buffer.subarray(2,6)),t=this.buffer.subarray(6,6+this.headLength),r=this.buffer.subarray(6+this.headLength,6+this.headLength+e);this.onData(t,r),this.buffer=this.buffer.subarray(6+this.headLength+e),this.buffer.length>=this.headLength+3&&this.handleBuffer(),this.processing=!1}},{key:"intToBuffer",value:function(e){var t=Buffer.alloc(4);return t.writeUInt32BE(e,0),t}},{key:"bufferToInt",value:function(e){return e.readUInt32BE(0)}},{key:"getPackage",value:function(e,t){return Buffer.concat([this.protocal,this.intToBuffer(t.length),e,t])}},{key:"getSocket",value:function(){return this.socket}},{key:"sendToSocket",value:function(e,t){this.socket.write(this.getPackage(e,t))}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.TcpUtil=a},6602:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.UdpUtil=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"checkUdp",value:function(e,t,r){try{if(!e)return void(r&&r());var n=e.address();n&&n.port&&t&&t()}catch(e){r&&r()}}}])&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.UdpUtil=a},6007:(e,t,r)=>{var n=r(5784).type,o=(r(5784).log,r(5784).error);function a(e){return e.tagNumber>30?new n.Component([new n.UInt8(e.tagClass|e.tagFormat|31),new n.UInt8(e.tagNumber)]):new n.UInt8(e.tagClass|e.tagFormat|31&e.tagNumber)}function i(e){return e>127?new n.Component([new n.UInt8(130),new n.UInt16Be(e)]):new n.UInt8(e)}e.exports={decode:function(e,t){if(!function(e,t){var r=(new n.UInt8).read(e).value;return t.tagNumber>30?nextTagNumber=(new n.UInt8).read(e).value:nextTagNumber=31&r,(224&r)==(t.tagClass|t.tagFormat)&&nextTagNumber===t.tagNumber}(e,t))throw new o.ProtocolError("NODE_RDP_ASN1_BER_INVALID_TAG");var r=function(e){var t=(new n.UInt8).read(e).value;if(128&t)if(1==(t&=-129))t=(new n.UInt8).read(e).value;else{if(2!==t)throw new o.ProtocolError("NODE_RDP_ASN1_BER_INVALID_LENGTH");t=(new n.UInt16Be).read(e).value}return t}(e);return 0===r?new n.Stream(0):new n.BinaryString(null,{readLength:new n.CallableValue(r)}).read(e)},encode:function(e,t){return new n.Component([a(e),i(t.size()),t])}}},5002:(e,t,r)=>{var n=r(6007),o=r(7320),a=r(2715);e.exports={ber:n,univ:o,spec:a}},2715:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(5784).error;function i(e){this.tag=e,this.opt=!1}function c(e,t){i.call(this,e),this.spec=t}i.prototype.implicitTag=function(e){return this.tag=e,this},i.prototype.optional=function(){return this.opt=!0,this},i.prototype.explicitTag=function(e){return new c(e,this)},i.prototype.decode=function(e,t){throw new a.FatalError("NODE_RDP_AS1_SPEC_DECODE_NOT_IMPLEMENTED")},i.prototype.encode=function(e){throw new a.FatalError("NODE_RDP_AS1_SPEC_ENCODE_NOT_IMPLEMENTED")},n(c,i),i.prototype.decode=function(e,t){var r=new o.Stream(t.decode(e,this.tag).value);this.spec.decode(r,t)},e.exports={TagClass:{Universal:0,Application:64,Context:128,Private:192},TagFormat:{Primitive:0,Constructed:32},Asn1Tag:function(e,t,r){this.tagClass=e,this.tagFormat=t,this.tagNumber=r},Asn1Spec:i,Asn1SpecExplicitTag:c}},7320:(e,t,r)=>{var n=r(2715),o=r(5784).type,a=r(5784).error,i=r(9023).inherits,c=1,s=2,u=3,l=4,f=5,p=6,h=10,d=12,v=16,y=17,m=19,b=20,_=22,g=23,E=24,w=28,P=30;function S(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,c)),this.value=e||!1}function k(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,s)),this.value=e||0}function A(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,v)),this.value=e||[]}function T(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,h)),this.value=e||0}function O(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,l)),this.value=e||Buffer.alloc(0)}function L(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,p)),this.value=e||Buffer.alloc(5)}function C(){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,f))}function x(e){n.Asn1Spec.call(this,new n.Asn1Tag),this.value=e}function I(e,t){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,y)),this.factory=e,this.value=t||[]}function H(e,t){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Constructed,v)),this.factory=e,this.value=t||[]}function N(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,u)),this.value=[]}function D(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,b)),this.value=e}function R(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,m)),this.value=e}function F(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,w)),this.value=e}function U(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,d)),this.value=e}function j(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,P)),this.value=e}function M(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,_)),this.value=e}function B(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,g)),this.value=e}function G(e){n.Asn1Spec.call(this,new n.Asn1Tag(n.TagClass.Universal,n.TagFormat.Primitive,E)),this.value=e}i(S,n.Asn1Spec),S.prototype.decode=function(e,t){return this.value=0!==(new o.UInt8).read(new o.Stream(t.decode(e,this.tag).value)).value,this},S.prototype.encode=function(e){return this.value?e.encode(this.tag,new o.UInt8(255)):e.encode(this.tag,new o.UInt8(0))},i(k,n.Asn1Spec),k.prototype.decode=function(e,t){var r=t.decode(e,this.tag).value;if(r.length<5)for(var n=new o.Stream(r);n.availableLength()>0;)this.value=this.value<<8,this.value|=(new o.UInt8).read(n).value;else this.value=r;return this},k.prototype.encode=function(e){return this.value<=255?e.encode(this.tag,new o.UInt8(this.value)):this.value<=65535?e.encode(this.tag,new o.UInt16Be(this.value)):e.encode(this.tag,new o.UInt32Be(this.value))},i(A,n.Asn1Spec),A.prototype.decode=function(e,t){var r=new o.Stream(t.decode(e,this.tag).value);for(var n in this.value){var i=r.offset;try{this.value[n].decode(r,t)}catch(e){if("NODE_RDP_ASN1_BER_INVALID_TAG"===e.message&&!this.value[n].opt)throw new a.ProtocolError("NODE_RDP_ASN1_UNIV_SEQUENCE_FIELD_NOT_PRESENT");r.offset=i}}return this},A.prototype.encode=function(e){var t=new o.Component([]);for(var r in this.value)t.obj.push(this.value[r].encode(e));return e.encode(this.tag,t)},i(T,n.Asn1Spec),T.prototype.decode=function(e,t){return this.value=(new o.UInt8).read(new o.Stream(t.decode(e,this.tag).value)).value,this},T.prototype.encode=function(e){return e.encode(this.tag,new o.UInt8(this.value))},i(O,n.Asn1Spec),O.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},O.prototype.encode=function(e){return e.encode(this.tag,new o.BinaryString(this.value))},i(L,n.Asn1Spec),L.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(C,n.Asn1Spec),C.prototype.decode=function(e,t){return t.decode(e,this.tag),this},i(x,n.Asn1Spec),x.prototype.decode=function(e,t){for(var r in this.value){var n=e.offset;try{this.value[r].decode(e,t);break}catch(t){e.offset=n}}return this},i(I,n.Asn1Spec),I.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value);r.availableLength()>0;)this.value.push(this.factory().decode(r,t));return this},i(H,n.Asn1Spec),H.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value);r.availableLength()>0;)this.value.push(this.factory().decode(r,t));return this},i(N,n.Asn1Spec),N.prototype.decode=function(e,t){for(var r=new o.Stream(t.decode(e,this.tag).value),n=(new o.UInt8).read(r).value,a=[],i=0;i<n;i++)a.push(0);for(;r.availableLength()>0;){var c=(new o.UInt8).read(r).value,s=0;0===r.availableLength()&&(s=n);for(i=7;i>=s;i--)a.push(c>>i&1?1:0)}return this.value=a,this},N.prototype.toBuffer=function(){for(var e=this.value.length/8,t=new o.Stream(e),r=0;r<e;r++){for(var n=0,a=0;a<8;a++)n|=this.value[8*r+a]<<7-a;new o.UInt8(n).write(t)}return t.buffer},i(D,n.Asn1Spec),D.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(R,n.Asn1Spec),R.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(F,n.Asn1Spec),F.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(U,n.Asn1Spec),U.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(j,n.Asn1Spec),j.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(M,n.Asn1Spec),M.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(B,n.Asn1Spec),B.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},i(G,n.Asn1Spec),G.prototype.decode=function(e,t){return this.value=t.decode(e,this.tag).value,this},e.exports={Boolean:S,Integer:k,Sequence:A,Enumerate:T,OctetString:O,ObjectIdentifier:L,Null:C,Choice:x,SequenceOf:H,SetOf:I,BitString:N,T61String:D,PrintableString:R,UniversalString:F,UTF8String:U,BMPString:j,IA5String:M,UTCTime:B,GeneralizedTime:G}},6986:(e,t,r)=>{var n=r(9023).inherits;function o(e,t){Error.captureStackTrace(this),this.message=e||"",this.code=t||"NODE_RDP_CORE_ERROR_NO_ERROR_CODE"}function a(e,t){Error.captureStackTrace(this),this.code=e,this.message=t||""}function i(e,t){Error.captureStackTrace(this),this.code=e,this.message=t||""}n(o,Error),n(a,Error),n(i,Error),e.exports={FatalError:o,ProtocolError:a,ImplementationError:i}},5784:(e,t,r)=>{var n=r(4049),o=r(4534),a=r(5570),i=r(6986),c=r(8397);e.exports={layer:n,type:o,log:a,error:i,rle:c}},4049:(e,t,r)=>{var n=r(9023).inherits,o=r(9896),a=r(4534),i=r(5570),c=r(4756);function s(e){this.secureSocket=null,this.socket=e;var t=this;this.socket.on("data",(function(e){try{t.recv(e)}catch(e){t.socket.destroy(),t.emit("error",e)}})).on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)})),this.buffers=[],this.bufferLength=0,this.expectedSize=0}n(s,r(6261).EventEmitter),s.prototype.recv=function(e){if(0==this.buffers.length&&(this.bufferLength=0),this.buffers[this.buffers.length]=e,this.bufferLength+=e.length,0!=this.expectedSize)for(;this.bufferLength>=this.expectedSize;){for(var t=new a.Stream(this.expectedSize);t.availableLength()>0;){var r=t.availableLength(),n=this.buffers.shift();n.length>t.availableLength()?(this.buffers.unshift(n.slice(r)),new a.BinaryString(n,{readLength:new a.CallableValue(t.availableLength())}).write(t)):new a.BinaryString(n).write(t)}this.bufferLength-=this.expectedSize,t.offset=0,this.emit("data",t)}else console.log("this.expectedSize == 0")},s.prototype.send=function(e){var t=new a.Stream(e.size());e.write(t),this.secureSocket?this.secureSocket.write(t.buffer):this.socket.write(t.buffer)},s.prototype.sendBuffer=function(e){this.secureSocket?this.secureSocket.write(e):this.socket.write(e)},s.prototype.expect=function(e){this.expectedSize=e},s.prototype.startTLS=function(e){var t=this;this.secureSocket=c.connect({socket:this.socket,secureContext:c.createSecureContext(),isServer:!1,requestCert:!1,rejectUnauthorized:!1},(function(t){i.warn(t),e(t)})),this.secureSocket.on("data",(function(e){try{t.recv(e)}catch(e){t.socket.destroy(),t.emit("error",e)}})).on("error",(function(e){t.emit("error",e)}))},s.prototype.listenTLS=function(e,t,r){var n=this;this.secureSocket=c.connect({socket:this.socket,secureContext:c.createSecureContext({key:o.readFileSync(e),cert:o.readFileSync(t)}),isServer:!0,requestCert:!1,rejectUnauthorized:!1},(function(e){i.warn(e),r(e)})),this.secureSocket.on("data",(function(e){try{n.recv(e)}catch(e){n.socket.destroy(),n.emit("error",e)}})).on("error",(function(e){n.emit("error",e)}))},s.prototype.close=function(){this.socket.end()},e.exports={BufferLayer:s}},5570:e=>{var t={DEBUG:1,INFO:2,WARN:3,ERROR:4,NONE:5};e.exports={level:t.INFO,Levels:t,debug:function(e){},info:function(e){},warn:function(e){},error:function(e){}}},8397:function(module,__unused_webpack_exports,__webpack_require__){function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var Module;Module||(Module=eval("(function() { try { return Module || {} } catch(e) { return {} } })()"));var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_NODE="object"===("undefined"==typeof process?"undefined":_typeof(process))&&!0,ENVIRONMENT_IS_WEB="object"===("undefined"==typeof window?"undefined":_typeof(window)),ENVIRONMENT_IS_WORKER="function"==typeof importScripts,ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){Module.print||(Module.print=function(e){process.stdout.write(e+"\n")}),Module.printErr||(Module.printErr=function(e){process.stderr.write(e+"\n")});var nodeFS=__webpack_require__(9896),nodePath=__webpack_require__(6928);Module.read=function(e,t){e=nodePath.normalize(e);var r=nodeFS.readFileSync(e);return r||e==nodePath.resolve(e)||(e=path.join(__dirname,"..","src",e),r=nodeFS.readFileSync(e)),r&&!t&&(r=r.toString()),r},Module.readBinary=function(e){return Module.read(e,!0)},Module.load=function(e){globalEval(read(e))},Module.arguments=process.argv.slice(2),module.exports=Module}else if(ENVIRONMENT_IS_SHELL)Module.print||(Module.print=print),"undefined"!=typeof printErr&&(Module.printErr=printErr),"undefined"!=typeof read?Module.read=read:Module.read=function(){throw"no read() available (jsc?)"},Module.readBinary=function(e){return read(e,"binary")},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),this.Module=Module,eval("if (typeof gc === 'function' && gc.toString().indexOf('[native code]') > 0) var gc = undefined");else{if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}ENVIRONMENT_IS_WEB?this.Module=Module:Module.load=importScripts}function globalEval(e){eval.call(null,e)}for(var key in"undefined"==!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},forceAlign:function(e,t){return 1==(t=t||4)?e:isNumber(e)&&isNumber(t)?Math.ceil(e/t)*t:isNumber(t)&&isPowerOfTwo(t)?"((("+e+")+"+(t-1)+")&"+-t+")":"Math.ceil(("+e+")/"+t+")*"+t},isNumberType:function(e){return e in Runtime.INT_TYPES||e in Runtime.FLOAT_TYPES},isPointerType:function(e){return"*"==e[e.length-1]},isStructType:function(e){return!isPointerType(e)&&(!!isArrayType(e)||(!!/<?{ ?[^}]* ?}>?/.test(e)||"%"==e[0]))},INT_TYPES:{i1:0,i8:0,i16:0,i32:0,i64:0},FLOAT_TYPES:{float:0,double:0},or64:function(e,t){return(e|t)+4294967296*(Math.round(e/4294967296)|Math.round(t/4294967296))},and64:function(e,t){return(e&t)+4294967296*(Math.round(e/4294967296)&Math.round(t/4294967296))},xor64:function(e,t){return(e^t)+4294967296*(Math.round(e/4294967296)^Math.round(t/4294967296))},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":case"float":return 4;case"i64":case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0),t/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},dedup:function(e,t){var r={};return t?e.filter((function(e){return!r[e[t]]&&(r[e[t]]=!0,!0)})):e.filter((function(e){return!r[e]&&(r[e]=!0,!0)}))},set:function(){for(var e="object"===_typeof(arguments[0])?arguments[0]:arguments,t={},r=0;r<e.length;r++)t[e[r]]=0;return t},STACK_ALIGN:8,getAlignSize:function(e,t,r){return r?8:r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(t,8):8},calculateStructAlignment:function(e){e.flatSize=0,e.alignSize=0;var t=[],r=-1;return e.flatIndexes=e.fields.map((function(n){var o,a;Runtime.isNumberType(n)||Runtime.isPointerType(n)?(o=Runtime.getNativeTypeSize(n),a=Runtime.getAlignSize(n,o)):Runtime.isStructType(n)?"0"===n[1]?(o=0,a=Types.types[n]?Runtime.getAlignSize(null,Types.types[n].alignSize):e.alignSize||QUANTUM_SIZE):(o=Types.types[n].flatSize,a=Runtime.getAlignSize(null,Types.types[n].alignSize)):"b"==n[0]?(o=0|n.substr(1),a=1):"<"===n[0]?o=a=Types.types[n].flatSize:"i"===n[0]?assert((o=a=parseInt(n.substr(1))/8)%1==0,"cannot handle non-byte-size field "+n):assert(!1,"invalid type for calculateStructAlignment"),e.packed&&(a=1),e.alignSize=Math.max(e.alignSize,a);var i=Runtime.alignMemory(e.flatSize,a);return e.flatSize=i+o,r>=0&&t.push(i-r),r=i,i})),e.name_&&"["===e.name_[0]&&(e.flatSize=parseInt(e.name_.substr(1))*e.flatSize/2),e.flatSize=Runtime.alignMemory(e.flatSize,e.alignSize),0==t.length?e.flatFactor=e.flatSize:1==Runtime.dedup(t).length&&(e.flatFactor=t[0]),e.needsFlattening=1!=e.flatFactor,e.flatIndexes},generateStructInfo:function(e,t,r){var n;if(t){if(r=r||0,!(o=("undefined"==typeof Types?Runtime.typeInfo:Types.types)[t]))return null;if(o.fields.length!=e.length)return printErr("Number of named fields must match the type for "+t+": possibly duplicate struct names. Cannot return structInfo"),null;n=o.flatIndexes}else{var o={fields:e.map((function(e){return e[0]}))};n=Runtime.calculateStructAlignment(o)}var a={__size__:o.flatSize};return t?e.forEach((function(e,t){if("string"==typeof e)a[e]=n[t]+r;else{var i;for(var c in e)i=c;a[i]=Runtime.generateStructInfo(e[i],o.fields[t],n[t])}})):e.forEach((function(e,t){a[e[1]]=n[t]})),a},dynCall:function(e,t,r){return r&&r.length?(assert(r.length==e.length-1),FUNCTION_TABLE[t].apply(null,r)):(assert(1==e.length),FUNCTION_TABLE[t]())},addFunction:function(e){var t=FUNCTION_TABLE,r=t.length;assert(r%2==0),t.push(e);for(var n=0;n<1;n++)t.push(0);return r},removeFunction:function(e){FUNCTION_TABLE[e]=null},getAsmConst:function getAsmConst(code,numArgs){Runtime.asmConstCache||(Runtime.asmConstCache={});var func=Runtime.asmConstCache[code];if(func)return func;for(var args=[],i=0;i<numArgs;i++)args.push(String.fromCharCode(36)+i);return code=Pointer_stringify(code),'"'===code[0]&&(code.indexOf('"',1)===code.length-1?code=code.substr(1,code.length-2):abort("invalid EM_ASM input |"+code+"|. Please use EM_ASM(..code..) (no quotes) or EM_ASM({ ..code($0).. }, input) (to input values)")),Runtime.asmConstCache[code]=eval("(function("+args.join(",")+"){ "+code+" })")},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,t){return assert(t),Runtime.funcWrappers[e]||(Runtime.funcWrappers[e]=function(){return Runtime.dynCall(t,e,arguments)}),Runtime.funcWrappers[e]},UTF8Processor:function(){var e=[],t=0;this.processCChar=function(r){if(r&=255,0==e.length)return 128&r?(e.push(r),t=192==(224&r)?1:224==(240&r)?2:3,""):String.fromCharCode(r);if(t&&(e.push(r),--t>0))return"";var n,o=e[0],a=e[1],i=e[2],c=e[3];if(2==e.length)n=String.fromCharCode((31&o)<<6|63&a);else if(3==e.length)n=String.fromCharCode((15&o)<<12|(63&a)<<6|63&i);else{var s=(7&o)<<18|(63&a)<<12|(63&i)<<6|63&c;n=String.fromCharCode(Math.floor((s-65536)/1024)+55296,(s-65536)%1024+56320)}return e.length=0,n},this.processJSString=function(e){e=unescape(encodeURIComponent(e));for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return t}},stackAlloc:function(e){var t=STACKTOP;return assert((0|(STACKTOP=(STACKTOP=STACKTOP+e|0)+7&-8))<(0|STACK_MAX)),t},staticAlloc:function(e){var t=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+(assert(!staticSealed),e)|0)+7&-8,t},dynamicAlloc:function(e){var t=DYNAMICTOP;return(DYNAMICTOP=(DYNAMICTOP=DYNAMICTOP+(assert(DYNAMICTOP>0),e)|0)+7&-8)>=TOTAL_MEMORY&&enlargeMemory(),t},alignMemory:function(e,t){return e=Math.ceil(e/(t||8))*(t||8)},makeBigInt:function(e,t,r){return r?(e>>>0)+4294967296*(t>>>0):(e>>>0)+4294967296*(0|t)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,setjmpId=1,setjmpLabels={},ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(e,t){e||abort("Assertion failed: "+t)}var globalScope=this;function ccall(e,t,r,n){return ccallFunc(getCFunc(e),t,r,n)}function getCFunc(ident){try{var func=Module["_"+ident];func||(func=eval("_"+ident))}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function ccallFunc(e,t,r,n){var o=0;var a,i,c=0,s=n?n.map((function(e){return function(e,t){if("string"==t){if(null==e||0===e)return 0;e=intArrayFromString(e),t="array"}if("array"==t){o||(o=Runtime.stackSave());var r=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,r),r}return e}(e,r[c++])})):[],u=(a=e.apply(null,s),"string"==(i=t)?Pointer_stringify(a):(assert("array"!=i),a));return o&&Runtime.stackRestore(o),u}function cwrap(e,t,r){var n=getCFunc(e);return function(){return ccallFunc(n,t,r,Array.prototype.slice.call(arguments))}}function setValue(e,t,r,n){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e]=t;break;case"i16":HEAP16[e>>1]=t;break;case"i32":HEAP32[e>>2]=t;break;case"i64":tempI64=[t>>>0,(tempDouble=t,Math_abs(tempDouble)>=1?tempDouble>0?Math_min(Math_floor(tempDouble/4294967296),4294967295)>>>0:~~Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=t;break;case"double":HEAPF64[e>>3]=t;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return HEAP8[e];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+t)}return null}Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,t,r,n){var o,a;"number"==typeof e?(o=!0,a=e):(o=!1,a=e.length);var i,c="string"==typeof t?t:null;if(i=r==ALLOC_NONE?n:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(a,c?1:t.length)),o){var s;n=i;for(assert(!(3&i)),s=i+(-4&a);n<s;n+=4)HEAP32[n>>2]=0;for(s=i+a;n<s;)HEAP8[0|n++]=0;return i}if("i8"===c)return e.subarray||e.slice?HEAPU8.set(e,i):HEAPU8.set(new Uint8Array(e),i),i;for(var u,l,f,p=0;p<a;){var h=e[p];"function"==typeof h&&(h=Runtime.getFunctionIndex(h)),0!==(u=c||t[p])?(assert(u,"Must know what type to store in allocate!"),"i64"==u&&(u="i32"),setValue(i+p,h,u),f!==u&&(l=Runtime.getNativeTypeSize(u),f=u),p+=l):p++}return i}function Pointer_stringify(e,t){for(var r,n=!1,o=0;;){if(assert(e+o<TOTAL_MEMORY),(r=HEAPU8[e+o|0])>=128)n=!0;else if(0==r&&!t)break;if(o++,t&&o==t)break}t||(t=o);var a="";if(!n){for(var i,c=1024;t>0;)i=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(t,c))),a=a?a+i:i,e+=c,t-=c;return a}var s=new Runtime.UTF8Processor;for(o=0;o<t;o++)assert(e+o<TOTAL_MEMORY),r=HEAPU8[e+o|0],a+=s.processCChar(r);return a}function UTF16ToString(e){for(var t=0,r="";;){var n=HEAP16[e+2*t>>1];if(0==n)return r;++t,r+=String.fromCharCode(n)}}function stringToUTF16(e,t){for(var r=0;r<e.length;++r){var n=e.charCodeAt(r);HEAP16[t+2*r>>1]=n}HEAP16[t+2*e.length>>1]=0}function UTF32ToString(e){for(var t=0,r="";;){var n=HEAP32[e+4*t>>2];if(0==n)return r;if(++t,n>=65536){var o=n-65536;r+=String.fromCharCode(55296|o>>10,56320|1023&o)}else r+=String.fromCharCode(n)}}function stringToUTF32(e,t){for(var r=0,n=0;n<e.length;++n){var o=e.charCodeAt(n);if(o>=55296&&o<=57343)o=65536+((1023&o)<<10)|1023&e.charCodeAt(++n);HEAP32[t+4*r>>2]=o,++r}HEAP32[t+4*r>>2]=0}function demangle(e){try{var t=function(i,c,s){c=c||1/0;var u,l="",f=[];if("N"===e[r]){if(u=function(){r++,"K"===e[r]&&r++;for(var t=[];"E"!==e[r];)if("S"!==e[r])if("C"!==e[r]){var n=parseInt(e.substr(r)),a=n.toString().length;if(!n||!a){r--;break}var i=e.substr(r+a,n);t.push(i),o.push(i),r+=a+n}else t.push(t[t.length-1]),r+=2;else{r++;var c=e.indexOf("_",r),s=e.substring(r,c)||0;t.push(o[s]||"?"),r=c+1}return r++,t}().join("::"),0===--c)return i?[u]:u}else if(("K"===e[r]||a&&"L"===e[r])&&r++,v=parseInt(e.substr(r))){var p=v.toString().length;u=e.substr(r+p,v),r+=p+v}if(a=!1,"I"===e[r]){r++;var h=t(!0);l+=t(!0,1,!0)[0]+" "+u+"<"+h.join(", ")+">"}else l=u;e:for(;r<e.length&&c-- >0;){var d=e[r++];if(d in n)f.push(n[d]);else switch(d){case"P":f.push(t(!0,1,!0)[0]+"*");break;case"R":f.push(t(!0,1,!0)[0]+"&");break;case"L":r++;var v=e.indexOf("E",r)-r;f.push(e.substr(r,v)),r+=v+2;break;case"A":v=parseInt(e.substr(r));if(r+=v.toString().length,"_"!==e[r])throw"?";r++,f.push(t(!0,1,!0)[0]+" ["+v+"]");break;case"E":break e;default:l+="?"+d;break e}}return s||1!==f.length||"void"!==f[0]||(f=[]),i?f:l+"("+f.join(", ")+")"};if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}var r=3,n={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},o=[],a=!0;return t()}catch(t){return e}}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,(function(e){var t=demangle(e);return e===t?e:e+" ["+t+"]"}))}function stackTrace(){var e=(new Error).stack;return e?demangleAll(e):"(no stack trace available)"}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.Pointer_stringify=Pointer_stringify,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function alignMemoryPage(e){return e+4095&-4096}var STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0;function enlargeMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with ALLOW_MEMORY_GROWTH which adjusts the size at runtime but prevents some optimizations, or (3) set Module.TOTAL_MEMORY before the program runs.")}var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||16777216,FAST_MEMORY=Module.FAST_MEMORY||2097152;assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"Cannot fallback to non-typed array case: Code is too specialized");var buffer=new ArrayBuffer(TOTAL_MEMORY);function callRuntimeCallbacks(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?Runtime.dynCall("v",r):Runtime.dynCall("vi",r,[t.arg]):r(void 0===t.arg?null:t.arg)}else t()}}HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__)}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,t,r){var n=(new Runtime.UTF8Processor).processJSString(e);return r&&(n.length=r),t||n.push(0),n}function intArrayToString(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];n>255&&(assert(!1,"Character code "+n+" ("+String.fromCharCode(n)+") at offset "+r+" not in 0x00-0xFF."),n&=255),t.push(String.fromCharCode(n))}return t.join("")}function writeStringToMemory(e,t,r){for(var n=intArrayFromString(e,r),o=0;o<n.length;){var a=n[o];HEAP8[t+o|0]=a,o+=1}}function writeArrayToMemory(e,t){for(var r=0;r<e.length;r++)HEAP8[t+r|0]=e[r]}function writeAsciiToMemory(e,t,r){for(var n=0;n<e.length;n++)assert(e.charCodeAt(n)==e.charCodeAt(n)&255),HEAP8[t+n|0]=e.charCodeAt(n);r||(HEAP8[t+e.length|0]=0)}function unSign(e,t,r,n){return e>=0?e:t<=32?2*Math.abs(1<<t-1)+e:Math.pow(2,t)+e}function reSign(e,t,r,n){if(e<=0)return e;var o=t<=32?Math.abs(1<<t-1):Math.pow(2,t-1);return e>=o&&(t<=32||e>o)&&(e=-2*o+e),e}Module.addOnPreRun=Module.addOnPreRun=addOnPreRun,Module.addOnInit=Module.addOnInit=addOnInit,Module.addOnPreMain=Module.addOnPreMain=addOnPreMain,Module.addOnExit=Module.addOnExit=addOnExit,Module.addOnPostRun=Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16)*n+r*(t>>>16)<<16)|0}),Math.imul=Math.imul;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null,runDependencyTracking={};function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(!runDependencyTracking[e]),runDependencyTracking[e]=1,null===runDependencyWatcher&&"undefined"!=typeof setInterval&&(runDependencyWatcher=setInterval((function(){var e=!1;for(var t in runDependencyTracking)e||(e=!0,Module.printErr("still waiting on run dependencies:")),Module.printErr("dependency: "+t);e&&Module.printErr("(end of list)")}),1e4))):Module.printErr("warning: run dependency added without ID")}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),e?(assert(runDependencyTracking[e]),delete runDependencyTracking[e]):Module.printErr("warning: run dependency removed without ID"),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null;function runPostSets(){}STATIC_BASE=8,STATICTOP=STATIC_BASE+504,__ATINIT__.push({func:function(){runPostSets()}}),allocate([255,255,255,0,0,0,0,0],"i8",ALLOC_NONE,Runtime.GLOBAL_BASE);var tempDoublePtr=Runtime.alignMemory(allocate(12,"i8",ALLOC_STATIC),8);function copyTempFloat(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3]}function copyTempDouble(e){HEAP8[tempDoublePtr]=HEAP8[e],HEAP8[tempDoublePtr+1]=HEAP8[e+1],HEAP8[tempDoublePtr+2]=HEAP8[e+2],HEAP8[tempDoublePtr+3]=HEAP8[e+3],HEAP8[tempDoublePtr+4]=HEAP8[e+4],HEAP8[tempDoublePtr+5]=HEAP8[e+5],HEAP8[tempDoublePtr+6]=HEAP8[e+6],HEAP8[tempDoublePtr+7]=HEAP8[e+7]}function _memset(e,t,r){t|=0;var n,o=0,a=0,i=0;if(n=(e|=0)+(r|=0)|0,(0|r)>=20){if(o=(t&=255)|t<<8|t<<16|t<<24,a=-4&n,i=3&e)for(i=e+4-i|0;(0|e)<(0|i);)HEAP8[e]=t,e=e+1|0;for(;(0|e)<(0|a);)HEAP32[e>>2]=o,e=e+4|0}for(;(0|e)<(0|n);)HEAP8[e]=t,e=e+1|0;return e-r|0}assert(tempDoublePtr%8==0);var _llvm_memset_p0i8_i32=_memset;function _memcpy(e,t,r){r|=0;var n;if(n=0|(e|=0),(3&e)==(3&(t|=0))){for(;3&e;){if(!(0|r))return 0|n;HEAP8[e]=HEAP8[t],e=e+1|0,t=t+1|0,r=r-1|0}for(;(0|r)>=4;)HEAP32[e>>2]=HEAP32[t>>2],e=e+4|0,t=t+4|0,r=r-4|0}for(;(0|r)>0;)HEAP8[e]=HEAP8[t],e=e+1|0,t=t+1|0,r=r-1|0;return 0|n}var _llvm_memcpy_p0i8_p0i8_i32=_memcpy;function _abort(){Module.abort()}var ___errno_state=0;function ___setErrNo(e){return HEAP32[___errno_state>>2]=e,e}function ___errno_location(){return ___errno_state}function _sbrk(e){var t=_sbrk;t.called||(DYNAMICTOP=alignMemoryPage(DYNAMICTOP),t.called=!0,assert(Runtime.dynamicAlloc),t.alloc=Runtime.dynamicAlloc,Runtime.dynamicAlloc=function(){abort("cannot dynamically allocate, sbrk now has control")});var r=DYNAMICTOP;return 0!=e&&t.alloc(e),r}var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _sysconf(e){switch(e){case 30:return PAGE_SIZE;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 79:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:case 84:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4}return ___setErrNo(ERRNO_CODES.EINVAL),-1}function _time(e){var t=Math.floor(Date.now()/1e3);return e&&(HEAP32[e>>2]=t),t}function _strlen(e){var t=0;for(t=e|=0;HEAP8[t];)t=t+1|0;return t-e|0}var ERRNO_MESSAGES={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"},TTY={ttys:[],init:function(){},shutdown:function(){},register:function(e,t){TTY.ttys[e]={input:[],output:[],ops:t},FS.registerDevice(e,TTY.stream_ops)},stream_ops:{open:function(e){var t=TTY.ttys[e.node.rdev];if(!t)throw new FS.ErrnoError(ERRNO_CODES.ENODEV);e.tty=t,e.seekable=!1},close:function(e){e.tty.output.length&&e.tty.ops.put_char(e.tty,10)},read:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.get_char)throw new FS.ErrnoError(ERRNO_CODES.ENXIO);for(var a=0,i=0;i<n;i++){var c;try{c=e.tty.ops.get_char(e.tty)}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(void 0===c&&0===a)throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);if(null==c)break;a++,t[r+i]=c}return a&&(e.node.timestamp=Date.now()),a},write:function(e,t,r,n,o){if(!e.tty||!e.tty.ops.put_char)throw new FS.ErrnoError(ERRNO_CODES.ENXIO);for(var a=0;a<n;a++)try{e.tty.ops.put_char(e.tty,t[r+a])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return n&&(e.node.timestamp=Date.now()),a}},default_tty_ops:{get_char:function(e){if(!e.input.length){var t=null;if(ENVIRONMENT_IS_NODE){if(!(t=process.stdin.read()))return process.stdin._readableState&&process.stdin._readableState.ended?null:void 0}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=intArrayFromString(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(Module.print(e.output.join("")),e.output=[]):e.output.push(TTY.utf8.processCChar(t))}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(Module.printErr(e.output.join("")),e.output=[]):e.output.push(TTY.utf8.processCChar(t))}}},MEMFS={ops_table:null,CONTENT_OWNING:1,CONTENT_FLEXIBLE:2,CONTENT_FIXED:3,mount:function(e){return MEMFS.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(FS.isBlkdev(r)||FS.isFIFO(r))throw new FS.ErrnoError(ERRNO_CODES.EPERM);MEMFS.ops_table||(MEMFS.ops_table={dir:{node:_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,lookup:MEMFS.node_ops.lookup,mknod:MEMFS.node_ops.mknod},"mknod",MEMFS.node_ops.mknod),"rename",MEMFS.node_ops.rename),"unlink",MEMFS.node_ops.unlink),"rmdir",MEMFS.node_ops.rmdir),"readdir",MEMFS.node_ops.readdir),"symlink",MEMFS.node_ops.symlink),stream:{llseek:MEMFS.stream_ops.llseek}},file:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:{llseek:MEMFS.stream_ops.llseek,read:MEMFS.stream_ops.read,write:MEMFS.stream_ops.write,allocate:MEMFS.stream_ops.allocate,mmap:MEMFS.stream_ops.mmap}},link:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr,readlink:MEMFS.node_ops.readlink},stream:{}},chrdev:{node:{getattr:MEMFS.node_ops.getattr,setattr:MEMFS.node_ops.setattr},stream:FS.chrdev_stream_ops}});var o=FS.createNode(e,t,r,n);return FS.isDir(o.mode)?(o.node_ops=MEMFS.ops_table.dir.node,o.stream_ops=MEMFS.ops_table.dir.stream,o.contents={}):FS.isFile(o.mode)?(o.node_ops=MEMFS.ops_table.file.node,o.stream_ops=MEMFS.ops_table.file.stream,o.contents=[],o.contentMode=MEMFS.CONTENT_FLEXIBLE):FS.isLink(o.mode)?(o.node_ops=MEMFS.ops_table.link.node,o.stream_ops=MEMFS.ops_table.link.stream):FS.isChrdev(o.mode)&&(o.node_ops=MEMFS.ops_table.chrdev.node,o.stream_ops=MEMFS.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o),o},ensureFlexible:function(e){if(e.contentMode!==MEMFS.CONTENT_FLEXIBLE){var t=e.contents;e.contents=Array.prototype.slice.call(t),e.contentMode=MEMFS.CONTENT_FLEXIBLE}},node_ops:{getattr:function(e){var t={};return t.dev=FS.isChrdev(e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,FS.isDir(e.mode)?t.size=4096:FS.isFile(e.mode)?t.size=e.contents.length:FS.isLink(e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){if(void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size){MEMFS.ensureFlexible(e);var r=e.contents;if(t.size<r.length)r.length=t.size;else for(;t.size>r.length;)r.push(0)}},lookup:function(e,t){throw FS.genericErrors[ERRNO_CODES.ENOENT]},mknod:function(e,t,r,n){return MEMFS.createNode(e,t,r,n)},rename:function(e,t,r){if(FS.isDir(e.mode)){var n;try{n=FS.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY)}delete e.parent.contents[e.name],e.name=r,t.contents[r]=e,e.parent=t},unlink:function(e,t){delete e.contents[t]},rmdir:function(e,t){var r=FS.lookupNode(e,t);for(var n in r.contents)throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);delete e.contents[t]},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=MEMFS.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!FS.isLink(e.mode))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.link}},stream_ops:{read:function(e,t,r,n,o){var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(assert(i>=0),i>8&&a.subarray)t.set(a.subarray(o,o+i),r);else for(var c=0;c<i;c++)t[r+c]=a[o+c];return i},write:function(e,t,r,n,o,a){var i=e.node;i.timestamp=Date.now();var c=i.contents;if(n&&0===c.length&&0===o&&t.subarray)return assert(t.length),a&&0===r?(i.contents=t,i.contentMode=t.buffer===HEAP8.buffer?MEMFS.CONTENT_OWNING:MEMFS.CONTENT_FIXED):(i.contents=new Uint8Array(t.subarray(r,r+n)),i.contentMode=MEMFS.CONTENT_FIXED),n;MEMFS.ensureFlexible(i);for(c=i.contents;c.length<o;)c.push(0);for(var s=0;s<n;s++)c[o+s]=t[r+s];return n},llseek:function(e,t,r){var n=t;if(1===r?n+=e.position:2===r&&FS.isFile(e.node.mode)&&(n+=e.node.contents.length),n<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.ungotten=[],e.position=n,n},allocate:function(e,t,r){MEMFS.ensureFlexible(e.node);for(var n=e.node.contents,o=t+r;o>n.length;)n.push(0)},mmap:function(e,t,r,n,o,a,i){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENODEV);var c,s,u=e.node.contents;if(2&i||u.buffer!==t&&u.buffer!==t.buffer){if((o>0||o+n<u.length)&&(u=u.subarray?u.subarray(o,o+n):Array.prototype.slice.call(u,o,o+n)),s=!0,!(c=_malloc(n)))throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);t.set(u,c)}else s=!1,c=u.byteOffset;return{ptr:c,allocated:s}}}},IDBFS={dbs:{},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",mount:function(e){return MEMFS.mount.apply(null,arguments)},syncfs:function(e,t,r){IDBFS.getLocalSet(e,(function(n,o){if(n)return r(n);IDBFS.getRemoteSet(e,(function(e,n){if(e)return r(e);var a=t?n:o,i=t?o:n;IDBFS.reconcile(a,i,r)}))}))},reconcile:function(e,t,r){var n=0,o={};for(var a in e.files)if(e.files.hasOwnProperty(a)){var i=e.files[a];(!(s=t.files[a])||i.timestamp>s.timestamp)&&(o[a]=i,n++)}var c={};for(var a in t.files)if(t.files.hasOwnProperty(a)){var s;i=t.files[a];(s=e.files[a])||(c[a]=i,n++)}if(!n)return r(null);var u=0;function l(e){return e?r(e):++u>=n?r(null):void 0}var f=("remote"===e.type?e.db:t.db).transaction([IDBFS.DB_STORE_NAME],"readwrite");f.onerror=function(){r(this.error)};var p=f.objectStore(IDBFS.DB_STORE_NAME);for(var h in o)if(o.hasOwnProperty(h)){var d=o[h];if("local"===t.type)try{if(FS.isDir(d.mode))FS.mkdir(h,d.mode);else if(FS.isFile(d.mode)){var v=FS.open(h,"w+",438);FS.write(v,d.contents,0,d.contents.length,0,!0),FS.close(v)}l(null)}catch(i){return l(i)}else(y=p.put(d,h)).onsuccess=function(){l(null)},y.onerror=function(){l(this.error)}}for(var h in c)if(c.hasOwnProperty(h)){var y;d=c[h];if("local"===t.type)try{FS.isDir(d.mode)?FS.rmdir(h):FS.isFile(d.mode)&&FS.unlink(h),l(null)}catch(i){return l(i)}else(y=p.delete(h)).onsuccess=function(){l(null)},y.onerror=function(){l(this.error)}}},getLocalSet:function(e,t){var r={};function n(e){return"."!==e&&".."!==e}function o(e){return function(t){return PATH.join2(e,t)}}for(var a=FS.readdir(e.mountpoint).filter(n).map(o(e.mountpoint));a.length;){var i,c,s=a.pop();try{c=FS.lookupPath(s).node,i=FS.stat(s)}catch(e){return t(e)}if(FS.isDir(i.mode))a.push.apply(a,FS.readdir(s).filter(n).map(o(s))),r[s]={mode:i.mode,timestamp:i.mtime};else{if(!FS.isFile(i.mode))return t(new Error("node type not supported"));r[s]={contents:c.contents,mode:i.mode,timestamp:i.mtime}}}return t(null,{type:"local",files:r})},getDB:function(e,t){var r,n=IDBFS.dbs[e];if(n)return t(null,n);try{r=IDBFS.indexedDB().open(e,IDBFS.DB_VERSION)}catch(e){return onerror(e)}r.onupgradeneeded=function(){(n=r.result).createObjectStore(IDBFS.DB_STORE_NAME)},r.onsuccess=function(){n=r.result,IDBFS.dbs[e]=n,t(null,n)},r.onerror=function(){t(this.error)}},getRemoteSet:function(e,t){var r={};IDBFS.getDB(e.mountpoint,(function(e,n){if(e)return t(e);var o=n.transaction([IDBFS.DB_STORE_NAME],"readonly");o.onerror=function(){t(this.error)},o.objectStore(IDBFS.DB_STORE_NAME).openCursor().onsuccess=function(e){var o=e.target.result;if(!o)return t(null,{type:"remote",db:n,files:r});r[o.key]=o.value,o.continue()}}))}},NODEFS={isWindows:!1,staticInit:function(){NODEFS.isWindows=!!process.platform.match(/^win/)},mount:function(e){return assert(ENVIRONMENT_IS_NODE),NODEFS.createNode(null,"/",NODEFS.getMode(e.opts.root),0)},createNode:function(e,t,r,n){if(!FS.isDir(r)&&!FS.isFile(r)&&!FS.isLink(r))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var o=FS.createNode(e,t,r);return o.node_ops=NODEFS.node_ops,o.stream_ops=NODEFS.stream_ops,o},getMode:function(e){var t;try{t=fs.lstatSync(e),NODEFS.isWindows&&(t.mode=t.mode|(146&t.mode)>>1)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return t.mode},realPath:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.mount.opts.root),t.reverse(),PATH.join.apply(null,t)},flagsToPermissionStringMap:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},flagsToPermissionString:function(e){return e in NODEFS.flagsToPermissionStringMap?NODEFS.flagsToPermissionStringMap[e]:e},node_ops:{getattr:function(e){var t,r=NODEFS.realPath(e);try{t=fs.lstatSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return NODEFS.isWindows&&!t.blksize&&(t.blksize=4096),NODEFS.isWindows&&!t.blocks&&(t.blocks=(t.size+t.blksize-1)/t.blksize|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,blksize:t.blksize,blocks:t.blocks}},setattr:function(e,t){var r=NODEFS.realPath(e);try{if(void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.timestamp){var n=new Date(t.timestamp);fs.utimesSync(r,n,n)}void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},lookup:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t),n=NODEFS.getMode(r);return NODEFS.createNode(e,t,n)},mknod:function(e,t,r,n){var o=NODEFS.createNode(e,t,r,n),a=NODEFS.realPath(o);try{FS.isDir(o.mode)?fs.mkdirSync(a,o.mode):fs.writeFileSync(a,"",{mode:o.mode})}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}return o},rename:function(e,t,r){var n=NODEFS.realPath(e),o=PATH.join2(NODEFS.realPath(t),r);try{fs.renameSync(n,o)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},unlink:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},rmdir:function(e,t){var r=PATH.join2(NODEFS.realPath(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readdir:function(e){var t=NODEFS.realPath(e);try{return fs.readdirSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},symlink:function(e,t,r){var n=PATH.join2(NODEFS.realPath(e),t);try{fs.symlinkSync(r,n)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},readlink:function(e){var t=NODEFS.realPath(e);try{return fs.readlinkSync(t)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}}},stream_ops:{open:function(e){var t=NODEFS.realPath(e.node);try{FS.isFile(e.node.mode)&&(e.nfd=fs.openSync(t,NODEFS.flagsToPermissionString(e.flags)))}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},close:function(e){try{FS.isFile(e.node.mode)&&e.nfd&&fs.closeSync(e.nfd)}catch(e){if(!e.code)throw e;throw new FS.ErrnoError(ERRNO_CODES[e.code])}},read:function(e,t,r,n,o){var a,i=Buffer.alloc(n);try{a=fs.readSync(e.nfd,i,0,n,o)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(a>0)for(var c=0;c<a;c++)t[r+c]=i[c];return a},write:function(e,t,r,n,o){var a,i=Buffer.alloc(t.subarray(r,r+n));try{a=fs.writeSync(e.nfd,i,0,n,o)}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}return a},llseek:function(e,t,r){var n=t;if(1===r)n+=e.position;else if(2===r&&FS.isFile(e.node.mode))try{n+=fs.fstatSync(e.nfd).size}catch(e){throw new FS.ErrnoError(ERRNO_CODES[e.code])}if(n<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return e.position=n,n}}},_stdin=allocate(1,"i32*",ALLOC_STATIC),_stdout=allocate(1,"i32*",ALLOC_STATIC),_stderr=allocate(1,"i32*",ALLOC_STATIC);function _fflush(e){}var FS={root:null,mounts:[],devices:[null],streams:[null],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,ErrnoError:null,genericErrors:{},handleFSError:function(e){if(!(e instanceof FS.ErrnoError))throw e+" : "+stackTrace();return ___setErrNo(e.errno)},lookupPath:function(e,t){if(e=PATH.resolve(FS.cwd(),e),(t=t||{recurse_count:0}).recurse_count>8)throw new FS.ErrnoError(ERRNO_CODES.ELOOP);for(var r=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),n=FS.root,o="/",a=0;a<r.length;a++){var i=a===r.length-1;if(i&&t.parent)break;if(n=FS.lookupNode(n,r[a]),o=PATH.join2(o,r[a]),FS.isMountpoint(n)&&(n=n.mount.root),!i||t.follow)for(var c=0;FS.isLink(n.mode);){var s=FS.readlink(o);if(o=PATH.resolve(PATH.dirname(o),s),n=FS.lookupPath(o,{recurse_count:t.recurse_count}).node,c++>40)throw new FS.ErrnoError(ERRNO_CODES.ELOOP)}}return{path:o,node:n}},getPath:function(e){for(var t;;){if(FS.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%FS.nameTable.length},hashAddNode:function(e){var t=FS.hashName(e.parent.id,e.name);e.name_next=FS.nameTable[t],FS.nameTable[t]=e},hashRemoveNode:function(e){var t=FS.hashName(e.parent.id,e.name);if(FS.nameTable[t]===e)FS.nameTable[t]=e.name_next;else for(var r=FS.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=FS.mayLookup(e);if(r)throw new FS.ErrnoError(r);for(var n=FS.hashName(e.id,t),o=FS.nameTable[n];o;o=o.name_next){var a=o.name;if(o.parent.id===e.id&&a===t)return o}return FS.lookup(e,t)},createNode:function(e,t,r,n){if(!FS.FSNode){FS.FSNode=function(e,t,r,n){this.id=FS.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n,this.parent=null,this.mount=null,e||(e=this),this.parent=e,this.mount=e.mount,FS.hashAddNode(this)};var o=365,a=146;FS.FSNode.prototype={},Object.defineProperties(FS.FSNode.prototype,{read:{get:function(){return(this.mode&o)===o},set:function(e){e?this.mode|=o:this.mode&=-366}},write:{get:function(){return(this.mode&a)===a},set:function(e){e?this.mode|=a:this.mode&=-147}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}})}return new FS.FSNode(e,t,r,n)},destroyNode:function(e){FS.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return!(49152&~e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var t=FS.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][2097155&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return FS.ignorePermissions||(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:ERRNO_CODES.EACCES},mayLookup:function(e){return FS.nodePermissions(e,"x")},mayCreate:function(e,t){try{FS.lookupNode(e,t);return ERRNO_CODES.EEXIST}catch(e){}return FS.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=FS.lookupNode(e,t)}catch(e){return e.errno}var o=FS.nodePermissions(e,"wx");if(o)return o;if(r){if(!FS.isDir(n.mode))return ERRNO_CODES.ENOTDIR;if(FS.isRoot(n)||FS.getPath(n)===FS.cwd())return ERRNO_CODES.EBUSY}else if(FS.isDir(n.mode))return ERRNO_CODES.EISDIR;return 0},mayOpen:function(e,t){return e?FS.isLink(e.mode)?ERRNO_CODES.ELOOP:FS.isDir(e.mode)&&(2097155&t||512&t)?ERRNO_CODES.EISDIR:FS.nodePermissions(e,FS.flagsToPermissionString(t)):ERRNO_CODES.ENOENT},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||1,t=t||FS.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!FS.streams[r])return r;throw new FS.ErrnoError(ERRNO_CODES.EMFILE)},getStream:function(e){return FS.streams[e]},createStream:function(e,t,r){if(FS.FSStream||(FS.FSStream=function(){},FS.FSStream.prototype={},Object.defineProperties(FS.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return!!(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}})),e.__proto__)e.__proto__=FS.FSStream.prototype;else{var n=new FS.FSStream;for(var o in e)n[o]=e[o];e=n}var a=FS.nextfd(t,r);return e.fd=a,FS.streams[a]=e,e},closeStream:function(e){FS.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=FS.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new FS.ErrnoError(ERRNO_CODES.ESPIPE)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){FS.devices[e]={stream_ops:t}},getDevice:function(e){return FS.devices[e]},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1);var r=0,n=FS.mounts.length;function o(e){if(e)return t(e);++r>=n&&t(null)}for(var a=0;a<FS.mounts.length;a++){var i=FS.mounts[a];i.type.syncfs?i.type.syncfs(i,e,o):o(null)}},mount:function(e,t,r){var n;r&&(r=(n=FS.lookupPath(r,{follow:!1})).path);var o={type:e,opts:t,mountpoint:r,root:null},a=e.mount(o);return a.mount=o,o.root=a,n&&(n.node.mount=o,n.node.mounted=!0,"/"===r&&(FS.root=o.root)),FS.mounts.push(o),a},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=FS.lookupPath(e,{parent:!0}).node,o=PATH.basename(e),a=FS.mayCreate(n,o);if(a)throw new FS.ErrnoError(a);if(!n.node_ops.mknod)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,FS.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,FS.mknod(e,t,0)},mkdev:function(e,t,r){return void 0===r&&(r=t,t=438),t|=8192,FS.mknod(e,t,r)},symlink:function(e,t){var r=FS.lookupPath(t,{parent:!0}).node,n=PATH.basename(t),o=FS.mayCreate(r,n);if(o)throw new FS.ErrnoError(o);if(!r.node_ops.symlink)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return r.node_ops.symlink(r,n,e)},rename:function(e,t){var r,n,o=PATH.dirname(e),a=PATH.dirname(t),i=PATH.basename(e),c=PATH.basename(t);try{r=FS.lookupPath(e,{parent:!0}).node,n=FS.lookupPath(t,{parent:!0}).node}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EBUSY)}if(r.mount!==n.mount)throw new FS.ErrnoError(ERRNO_CODES.EXDEV);var s,u=FS.lookupNode(r,i),l=PATH.relative(e,a);if("."!==l.charAt(0))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if("."!==(l=PATH.relative(t,o)).charAt(0))throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);try{s=FS.lookupNode(n,c)}catch(e){}if(u!==s){var f=FS.isDir(u.mode),p=FS.mayDelete(r,i,f);if(p)throw new FS.ErrnoError(p);if(p=s?FS.mayDelete(n,c,f):FS.mayCreate(n,c))throw new FS.ErrnoError(p);if(!r.node_ops.rename)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(u)||s&&FS.isMountpoint(s))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);if(n!==r&&(p=FS.nodePermissions(r,"w")))throw new FS.ErrnoError(p);FS.hashRemoveNode(u);try{r.node_ops.rename(u,n,c)}catch(e){throw e}finally{FS.hashAddNode(u)}}},rmdir:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!0);if(o)throw new FS.ErrnoError(o);if(!t.node_ops.rmdir)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(n))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);t.node_ops.rmdir(t,r),FS.destroyNode(n)},readdir:function(e){var t=FS.lookupPath(e,{follow:!0}).node;if(!t.node_ops.readdir)throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);return t.node_ops.readdir(t)},unlink:function(e){var t=FS.lookupPath(e,{parent:!0}).node,r=PATH.basename(e),n=FS.lookupNode(t,r),o=FS.mayDelete(t,r,!1);if(o)throw o===ERRNO_CODES.EISDIR&&(o=ERRNO_CODES.EPERM),new FS.ErrnoError(o);if(!t.node_ops.unlink)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isMountpoint(n))throw new FS.ErrnoError(ERRNO_CODES.EBUSY);t.node_ops.unlink(t,r),FS.destroyNode(n)},readlink:function(e){var t=FS.lookupPath(e,{follow:!1}).node;if(!t.node_ops.readlink)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);return t.node_ops.readlink(t)},stat:function(e,t){var r=FS.lookupPath(e,{follow:!t}).node;if(!r.node_ops.getattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);return r.node_ops.getattr(r)},lstat:function(e){return FS.stat(e,!0)},chmod:function(e,t,r){var n;"string"==typeof e?n=FS.lookupPath(e,{follow:!r}).node:n=e;if(!n.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);n.node_ops.setattr(n,{mode:4095&t|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,t){FS.chmod(e,t,!0)},fchmod:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chmod(r.node,t)},chown:function(e,t,r,n){var o;"string"==typeof e?o=FS.lookupPath(e,{follow:!n}).node:o=e;if(!o.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);o.node_ops.setattr(o,{timestamp:Date.now()})},lchown:function(e,t,r){FS.chown(e,t,r,!0)},fchown:function(e,t,r){var n=FS.getStream(e);if(!n)throw new FS.ErrnoError(ERRNO_CODES.EBADF);FS.chown(n.node,t,r)},truncate:function(e,t){if(t<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var r;"string"==typeof e?r=FS.lookupPath(e,{follow:!0}).node:r=e;if(!r.node_ops.setattr)throw new FS.ErrnoError(ERRNO_CODES.EPERM);if(FS.isDir(r.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!FS.isFile(r.mode))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var n=FS.nodePermissions(r,"w");if(n)throw new FS.ErrnoError(n);r.node_ops.setattr(r,{size:t,timestamp:Date.now()})},ftruncate:function(e,t){var r=FS.getStream(e);if(!r)throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(!(2097155&r.flags))throw new FS.ErrnoError(ERRNO_CODES.EINVAL);FS.truncate(r.node,t)},utime:function(e,t,r){var n=FS.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(t,r)})},open:function(e,t,r,n,o){var a;if(r=void 0===r?438:r,r=64&(t="string"==typeof t?FS.modeStringToFlags(t):t)?4095&r|32768:0,"object"===_typeof(e))a=e;else{e=PATH.normalize(e);try{a=FS.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}if(64&t)if(a){if(128&t)throw new FS.ErrnoError(ERRNO_CODES.EEXIST)}else a=FS.mknod(e,r,0);if(!a)throw new FS.ErrnoError(ERRNO_CODES.ENOENT);FS.isChrdev(a.mode)&&(t&=-513);var i=FS.mayOpen(a,t);if(i)throw new FS.ErrnoError(i);512&t&&FS.truncate(a,0),t&=-641;var c=FS.createStream({node:a,path:FS.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},n,o);return c.stream_ops.open&&c.stream_ops.open(c),!Module.logReadFiles||1&t||(FS.readFiles||(FS.readFiles={}),e in FS.readFiles||(FS.readFiles[e]=1,Module.printErr("read file: "+e))),c},close:function(e){try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{FS.closeStream(e.fd)}},llseek:function(e,t,r){if(!e.seekable||!e.stream_ops.llseek)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);return e.stream_ops.llseek(e,t,r)},read:function(e,t,r,n,o){if(n<0||o<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(1==(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!e.stream_ops.read)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var a=!0;if(void 0===o)o=e.position,a=!1;else if(!e.seekable)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);var i=e.stream_ops.read(e,t,r,n,o);return a||(e.position+=i),i},write:function(e,t,r,n,o,a){if(n<0||o<0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(!(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(FS.isDir(e.node.mode))throw new FS.ErrnoError(ERRNO_CODES.EISDIR);if(!e.stream_ops.write)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);var i=!0;if(void 0===o)o=e.position,i=!1;else if(!e.seekable)throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);1024&e.flags&&FS.llseek(e,0,2);var c=e.stream_ops.write(e,t,r,n,o,a);return i||(e.position+=c),c},allocate:function(e,t,r){if(t<0||r<=0)throw new FS.ErrnoError(ERRNO_CODES.EINVAL);if(!(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EBADF);if(!FS.isFile(e.node.mode)&&!FS.isDir(node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENODEV);if(!e.stream_ops.allocate)throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);e.stream_ops.allocate(e,t,r)},mmap:function(e,t,r,n,o,a,i){if(1==(2097155&e.flags))throw new FS.ErrnoError(ERRNO_CODES.EACCES);if(!e.stream_ops.mmap)throw new FS.ErrnoError(ERRNO_CODES.ENODEV);return e.stream_ops.mmap(e,t,r,n,o,a,i)},ioctl:function(e,t,r){if(!e.stream_ops.ioctl)throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);return e.stream_ops.ioctl(e,t,r)},readFile:function(e,t){var r;(t=t||{}).flags=t.flags||"r",t.encoding=t.encoding||"binary";var n=FS.open(e,t.flags),o=FS.stat(e).size,a=new Uint8Array(o);if(FS.read(n,a,0,o,0),"utf8"===t.encoding){r="";for(var i=new Runtime.UTF8Processor,c=0;c<o;c++)r+=i.processCChar(a[c])}else{if("binary"!==t.encoding)throw new Error('Invalid encoding type "'+t.encoding+'"');r=a}return FS.close(n),r},writeFile:function(e,t,r){(r=r||{}).flags=r.flags||"w",r.encoding=r.encoding||"utf8";var n=FS.open(e,r.flags,r.mode);if("utf8"===r.encoding){var o=new Runtime.UTF8Processor,a=new Uint8Array(o.processJSString(t));FS.write(n,a,0,a.length,0)}else{if("binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');FS.write(n,t,0,t.length,0)}FS.close(n)},cwd:function(){return FS.currentPath},chdir:function(e){var t=FS.lookupPath(e,{follow:!0});if(!FS.isDir(t.node.mode))throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);var r=FS.nodePermissions(t.node,"x");if(r)throw new FS.ErrnoError(r);FS.currentPath=t.path},createDefaultDirectories:function(){FS.mkdir("/tmp")},createDefaultDevices:function(){FS.mkdir("/dev"),FS.registerDevice(FS.makedev(1,3),{read:function(){return 0},write:function(){return 0}}),FS.mkdev("/dev/null",FS.makedev(1,3)),TTY.register(FS.makedev(5,0),TTY.default_tty_ops),TTY.register(FS.makedev(6,0),TTY.default_tty1_ops),FS.mkdev("/dev/tty",FS.makedev(5,0)),FS.mkdev("/dev/tty1",FS.makedev(6,0)),FS.mkdir("/dev/shm"),FS.mkdir("/dev/shm/tmp")},createStandardStreams:function(){Module.stdin?FS.createDevice("/dev","stdin",Module.stdin):FS.symlink("/dev/tty","/dev/stdin"),Module.stdout?FS.createDevice("/dev","stdout",null,Module.stdout):FS.symlink("/dev/tty","/dev/stdout"),Module.stderr?FS.createDevice("/dev","stderr",null,Module.stderr):FS.symlink("/dev/tty1","/dev/stderr");var e=FS.open("/dev/stdin","r");HEAP32[_stdin>>2]=e.fd,assert(1===e.fd,"invalid handle for stdin ("+e.fd+")");var t=FS.open("/dev/stdout","w");HEAP32[_stdout>>2]=t.fd,assert(2===t.fd,"invalid handle for stdout ("+t.fd+")");var r=FS.open("/dev/stderr","w");HEAP32[_stderr>>2]=r.fd,assert(3===r.fd,"invalid handle for stderr ("+r.fd+")")},ensureErrnoError:function(){FS.ErrnoError||(FS.ErrnoError=function(e){for(var t in this.errno=e,ERRNO_CODES)if(ERRNO_CODES[t]===e){this.code=t;break}this.message=ERRNO_MESSAGES[e],this.stack&&(this.stack=demangleAll(this.stack))},FS.ErrnoError.prototype=new Error,FS.ErrnoError.prototype.constructor=FS.ErrnoError,[ERRNO_CODES.ENOENT].forEach((function(e){FS.genericErrors[e]=new FS.ErrnoError(e),FS.genericErrors[e].stack="<generic error, no stack>"})))},staticInit:function(){FS.ensureErrnoError(),FS.nameTable=new Array(4096),FS.root=FS.createNode(null,"/",16895,0),FS.mount(MEMFS,{},"/"),FS.createDefaultDirectories(),FS.createDefaultDevices()},init:function(e,t,r){assert(!FS.init.initialized,"FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"),FS.init.initialized=!0,FS.ensureErrnoError(),Module.stdin=e||Module.stdin,Module.stdout=t||Module.stdout,Module.stderr=r||Module.stderr,FS.createStandardStreams()},quit:function(){FS.init.initialized=!1;for(var e=0;e<FS.streams.length;e++){var t=FS.streams[e];t&&FS.close(t)}},getMode:function(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r},joinPath:function(e,t){var r=PATH.join.apply(null,e);return t&&"/"==r[0]&&(r=r.substr(1)),r},absolutePath:function(e,t){return PATH.resolve(t,e)},standardizePath:function(e){return PATH.normalize(e)},findObject:function(e,t){var r=FS.analyzePath(e,t);return r.exists?r.object:(___setErrNo(r.error),null)},analyzePath:function(e,t){try{e=(n=FS.lookupPath(e,{follow:!t})).path}catch(e){}var r={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var n=FS.lookupPath(e,{parent:!0});r.parentExists=!0,r.parentPath=n.path,r.parentObject=n.node,r.name=PATH.basename(e),n=FS.lookupPath(e,{follow:!t}),r.exists=!0,r.path=n.path,r.object=n.node,r.name=n.node.name,r.isRoot="/"===n.path}catch(e){r.error=e.errno}return r},createFolder:function(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(r,n);return FS.mkdir(o,a)},createPath:function(e,t,r,n){e="string"==typeof e?e:FS.getPath(e);for(var o=t.split("/").reverse();o.length;){var a=o.pop();if(a){var i=PATH.join2(e,a);try{FS.mkdir(i)}catch(e){}e=i}}return i},createFile:function(e,t,r,n,o){var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t),i=FS.getMode(n,o);return FS.create(a,i)},createDataFile:function(e,t,r,n,o,a){var i=t?PATH.join2("string"==typeof e?e:FS.getPath(e),t):e,c=FS.getMode(n,o),s=FS.create(i,c);if(r){if("string"==typeof r){for(var u=new Array(r.length),l=0,f=r.length;l<f;++l)u[l]=r.charCodeAt(l);r=u}FS.chmod(s,146|c);var p=FS.open(s,"w");FS.write(p,r,0,r.length,0,a),FS.close(p),FS.chmod(s,c)}return s},createDevice:function(e,t,r,n){var o=PATH.join2("string"==typeof e?e:FS.getPath(e),t),a=FS.getMode(!!r,!!n);FS.createDevice.major||(FS.createDevice.major=64);var i=FS.makedev(FS.createDevice.major++,0);return FS.registerDevice(i,{open:function(e){e.seekable=!1},close:function(e){n&&n.buffer&&n.buffer.length&&n(10)},read:function(e,t,n,o,a){for(var i=0,c=0;c<o;c++){var s;try{s=r()}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}if(void 0===s&&0===i)throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);if(null==s)break;i++,t[n+c]=s}return i&&(e.node.timestamp=Date.now()),i},write:function(e,t,r,o,a){for(var i=0;i<o;i++)try{n(t[r+i])}catch(e){throw new FS.ErrnoError(ERRNO_CODES.EIO)}return o&&(e.node.timestamp=Date.now()),i}}),FS.mkdev(o,a,i)},createLink:function(e,t,r,n,o){var a=PATH.join2("string"==typeof e?e:FS.getPath(e),t);return FS.symlink(r,a)},forceLoadFile:function(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;var t=!0;if("undefined"!=typeof XMLHttpRequest)throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");if(!Module.read)throw new Error("Cannot load without read() or XMLHttpRequest.");try{e.contents=intArrayFromString(Module.read(e.url),!0)}catch(e){t=!1}return t||___setErrNo(ERRNO_CODES.EIO),t},createLazyFile:function(e,t,r,n,o){if("undefined"!=typeof XMLHttpRequest){var a=function(){this.lengthKnown=!1,this.chunks=[]};if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";a.prototype.get=function(e){if(!(e>this.length-1||e<0)){var t=e%this.chunkSize,r=Math.floor(e/this.chunkSize);return this.getter(r)[t]}},a.prototype.setDataGetter=function(e){this.getter=e},a.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,a=1048576;o||(a=n);var i=this;i.setDataGetter((function(e){var t=e*a,o=(e+1)*a-1;if(o=Math.min(o,n-1),void 0===i.chunks[e]&&(i.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==a&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):intArrayFromString(o.responseText||"",!0)}(t,o)),void 0===i.chunks[e])throw new Error("doXHR failed!");return i.chunks[e]})),this._length=n,this._chunkSize=a,this.lengthKnown=!0};var i=new a;Object.defineProperty(i,"length",{get:function(){return this.lengthKnown||this.cacheLength(),this._length}}),Object.defineProperty(i,"chunkSize",{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}});var c={isDevice:!1,contents:i}}else c={isDevice:!1,url:r};var s=FS.createFile(e,t,c,n,o);c.contents?s.contents=c.contents:c.url&&(s.contents=null,s.url=c.url);var u={};return Object.keys(s.stream_ops).forEach((function(e){var t=s.stream_ops[e];u[e]=function(){if(!FS.forceLoadFile(s))throw new FS.ErrnoError(ERRNO_CODES.EIO);return t.apply(null,arguments)}})),u.read=function(e,t,r,n,o){if(!FS.forceLoadFile(s))throw new FS.ErrnoError(ERRNO_CODES.EIO);var a=e.node.contents;if(o>=a.length)return 0;var i=Math.min(a.length-o,n);if(assert(i>=0),a.slice)for(var c=0;c<i;c++)t[r+c]=a[o+c];else for(c=0;c<i;c++)t[r+c]=a.get(o+c);return i},s.stream_ops=u,s},createPreloadedFile:function(e,t,r,n,o,a,i,c,s){Browser.init();var u=t?PATH.resolve(PATH.join2(e,t)):e;function l(r){function l(r){c||FS.createDataFile(e,t,r,n,o,s),a&&a(),removeRunDependency("cp "+u)}var f=!1;Module.preloadPlugins.forEach((function(e){f||e.canHandle(u)&&(e.handle(r,u,l,(function(){i&&i(),removeRunDependency("cp "+u)})),f=!0)})),f||l(r)}addRunDependency("cp "+u),"string"==typeof r?Browser.asyncLoad(r,(function(e){l(e)}),i):l(r)},indexedDB:function(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB},DB_NAME:function(){return"EM_FS_"+window.location.pathname},DB_VERSION:20,DB_STORE_NAME:"FILE_DATA",saveFilesToDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=FS.indexedDB();try{var o=n.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=function(){console.log("creating db"),o.result.createObjectStore(FS.DB_STORE_NAME)},o.onsuccess=function(){var n=o.result.transaction([FS.DB_STORE_NAME],"readwrite"),a=n.objectStore(FS.DB_STORE_NAME),i=0,c=0,s=e.length;function u(){0==c?t():r()}e.forEach((function(e){var t=a.put(FS.analyzePath(e).object.contents,e);t.onsuccess=function(){++i+c==s&&u()},t.onerror=function(){c++,i+c==s&&u()}})),n.onerror=r},o.onerror=r},loadFilesFromDB:function(e,t,r){t=t||function(){},r=r||function(){};var n=FS.indexedDB();try{var o=n.open(FS.DB_NAME(),FS.DB_VERSION)}catch(e){return r(e)}o.onupgradeneeded=r,o.onsuccess=function(){var n=o.result;try{var a=n.transaction([FS.DB_STORE_NAME],"readonly")}catch(e){return void r(e)}var i=a.objectStore(FS.DB_STORE_NAME),c=0,s=0,u=e.length;function l(){0==s?t():r()}e.forEach((function(e){var t=i.get(e);t.onsuccess=function(){FS.analyzePath(e).exists&&FS.unlink(e),FS.createDataFile(PATH.dirname(e),PATH.basename(e),t.result,!0,!0,!0),++c+s==u&&l()},t.onerror=function(){s++,c+s==u&&l()}})),a.onerror=r},o.onerror=r}},PATH={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=PATH.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return PATH.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return PATH.normalize(e.join("/"))},join2:function(e,t){return PATH.normalize(e+"/"+t)},resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:FS.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=PATH.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var r=e.length-1;r>=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=PATH.resolve(e).substr(1),t=PATH.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),a=Math.min(n.length,o.length),i=a,c=0;c<a;c++)if(n[c]!==o[c]){i=c;break}var s=[];for(c=i;c<n.length;c++)s.push("..");return(s=s.concat(o.slice(i))).join("/")}},Browser={mainLoop:{scheduler:null,shouldPause:!1,paused:!1,queue:[],pause:function(){Browser.mainLoop.shouldPause=!0},resume:function(){Browser.mainLoop.paused&&(Browser.mainLoop.paused=!1,Browser.mainLoop.scheduler()),Browser.mainLoop.shouldPause=!1},updateStatus:function(){if(Module.setStatus){var e=Module.statusMessage||"Please wait...",t=Browser.mainLoop.remainingBlockers,r=Browser.mainLoop.expectedBlockers;t?t<r?Module.setStatus(e+" ("+(r-t)+"/"+r+")"):Module.setStatus(e):Module.setStatus("")}}},isFullScreen:!1,pointerLock:!1,moduleContextCreatedCallbacks:[],workers:[],init:function(){if(Module.preloadPlugins||(Module.preloadPlugins=[]),!Browser.initted&&!ENVIRONMENT_IS_WORKER){Browser.initted=!0;try{new Blob,Browser.hasBlobConstructor=!0}catch(e){Browser.hasBlobConstructor=!1,console.log("warning: no blob constructor, cannot create blobs with mimetypes")}Browser.BlobBuilder="undefined"!=typeof MozBlobBuilder?MozBlobBuilder:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:Browser.hasBlobConstructor?null:console.log("warning: no BlobBuilder"),Browser.URLObject="undefined"!=typeof window?window.URL?window.URL:window.webkitURL:void 0,Module.noImageDecoding||void 0!==Browser.URLObject||(console.log("warning: Browser does not support creating object URLs. Built-in browser image decoding will not be available."),Module.noImageDecoding=!0);var e={canHandle:function(e){return!Module.noImageDecoding&&/\.(jpg|jpeg|png|bmp)$/i.test(e)},handle:function(e,t,r,n){var o=null;if(Browser.hasBlobConstructor)try{(o=new Blob([e],{type:Browser.getMimetype(t)})).size!==e.length&&(o=new Blob([new Uint8Array(e).buffer],{type:Browser.getMimetype(t)}))}catch(e){Runtime.warnOnce("Blob constructor present but fails: "+e+"; falling back to blob builder")}if(!o){var a=new Browser.BlobBuilder;a.append(new Uint8Array(e).buffer),o=a.getBlob()}var i=Browser.URLObject.createObjectURL(o);assert("string"==typeof i,"createObjectURL must return a url as a string");var c=new Image;c.onload=function(){assert(c.complete,"Image "+t+" could not be decoded");var n=document.createElement("canvas");n.width=c.width,n.height=c.height,n.getContext("2d").drawImage(c,0,0),Module.preloadedImages[t]=n,Browser.URLObject.revokeObjectURL(i),r&&r(e)},c.onerror=function(e){console.log("Image "+i+" could not be decoded"),n&&n()},c.src=i}};Module.preloadPlugins.push(e);var t={canHandle:function(e){return!Module.noAudioDecoding&&e.substr(-4)in{".ogg":1,".wav":1,".mp3":1}},handle:function(e,t,r,n){var o=!1;function a(n){o||(o=!0,Module.preloadedAudios[t]=n,r&&r(e))}function i(){o||(o=!0,Module.preloadedAudios[t]=new Audio,n&&n())}if(!Browser.hasBlobConstructor)return i();try{var c=new Blob([e],{type:Browser.getMimetype(t)})}catch(e){return i()}var s=Browser.URLObject.createObjectURL(c);assert("string"==typeof s,"createObjectURL must return a url as a string");var u=new Audio;u.addEventListener("canplaythrough",(function(){a(u)}),!1),u.onerror=function(r){o||(console.log("warning: browser could not fully decode audio "+t+", trying slower base64 approach"),u.src="data:audio/x-"+t.substr(-3)+";base64,"+function(e){for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",n=0,o=0,a=0;a<e.length;a++)for(n=n<<8|e[a],o+=8;o>=6;){var i=n>>o-6&63;o-=6,r+=t[i]}return 2==o?(r+=t[(3&n)<<4],r+="=="):4==o&&(r+=t[(15&n)<<2],r+="="),r}(e),a(u))},u.src=s,Browser.safeSetTimeout((function(){a(u)}),1e4)}};Module.preloadPlugins.push(t);var r=Module.canvas;r.requestPointerLock=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock,r.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||function(){},r.exitPointerLock=r.exitPointerLock.bind(document),document.addEventListener("pointerlockchange",n,!1),document.addEventListener("mozpointerlockchange",n,!1),document.addEventListener("webkitpointerlockchange",n,!1),Module.elementPointerLock&&r.addEventListener("click",(function(e){!Browser.pointerLock&&r.requestPointerLock&&(r.requestPointerLock(),e.preventDefault())}),!1)}function n(){Browser.pointerLock=document.pointerLockElement===r||document.mozPointerLockElement===r||document.webkitPointerLockElement===r}},createContext:function(e,t,r,n){var o;try{if(t){var a=function(e){s=e.statusMessage||s},i={antialias:!1,alpha:!1};if(n)for(var c in n)i[c]=n[c];var s="?";e.addEventListener("webglcontextcreationerror",a,!1);try{["experimental-webgl","webgl"].some((function(t){return o=e.getContext(t,i)}))}finally{e.removeEventListener("webglcontextcreationerror",a,!1)}}else o=e.getContext("2d");if(!o)throw":("}catch(e){return Module.print("Could not create canvas: "+[s,e]),null}return t&&(e.style.backgroundColor="black",e.addEventListener("webglcontextlost",(function(e){alert("WebGL context lost. You will need to reload the page.")}),!1)),r&&(GLctx=Module.ctx=o,Module.useWebGL=t,Browser.moduleContextCreatedCallbacks.forEach((function(e){e()})),Browser.init()),o},destroyContext:function(e,t,r){},fullScreenHandlersInstalled:!1,lockPointer:void 0,resizeCanvas:void 0,requestFullScreen:function(e,t){Browser.lockPointer=e,Browser.resizeCanvas=t,void 0===Browser.lockPointer&&(Browser.lockPointer=!0),void 0===Browser.resizeCanvas&&(Browser.resizeCanvas=!1);var r=Module.canvas;function n(){Browser.isFullScreen=!1,(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement)===r?(r.cancelFullScreen=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen,r.cancelFullScreen=r.cancelFullScreen.bind(document),Browser.lockPointer&&r.requestPointerLock(),Browser.isFullScreen=!0,Browser.resizeCanvas&&Browser.setFullScreenCanvasSize()):Browser.resizeCanvas&&Browser.setWindowedCanvasSize(),Module.onFullScreen&&Module.onFullScreen(Browser.isFullScreen)}Browser.fullScreenHandlersInstalled||(Browser.fullScreenHandlersInstalled=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1)),r.requestFullScreen=r.requestFullScreen||r.mozRequestFullScreen||(r.webkitRequestFullScreen?function(){r.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),r.requestFullScreen()},requestAnimationFrame:function(e){"undefined"==typeof window?setTimeout(e,1e3/60):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||window.setTimeout),window.requestAnimationFrame(e))},safeCallback:function(e){return function(){if(!ABORT)return e.apply(null,arguments)}},safeRequestAnimationFrame:function(e){return Browser.requestAnimationFrame((function(){ABORT||e()}))},safeSetTimeout:function(e,t){return setTimeout((function(){ABORT||e()}),t)},safeSetInterval:function(e,t){return setInterval((function(){ABORT||e()}),t)},getMimetype:function(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]},getUserMedia:function(e){window.getUserMedia||(window.getUserMedia=navigator.getUserMedia||navigator.mozGetUserMedia),window.getUserMedia(e)},getMovementX:function(e){return e.movementX||e.mozMovementX||e.webkitMovementX||0},getMovementY:function(e){return e.movementY||e.mozMovementY||e.webkitMovementY||0},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,calculateMouseEvent:function(e){if(Browser.pointerLock)"mousemove"!=e.type&&"mozMovementX"in e?Browser.mouseMovementX=Browser.mouseMovementY=0:(Browser.mouseMovementX=Browser.getMovementX(e),Browser.mouseMovementY=Browser.getMovementY(e)),"undefined"!=typeof SDL?(Browser.mouseX=SDL.mouseX+Browser.mouseMovementX,Browser.mouseY=SDL.mouseY+Browser.mouseMovementY):(Browser.mouseX+=Browser.mouseMovementX,Browser.mouseY+=Browser.mouseMovementY);else{var t,r,n=Module.canvas.getBoundingClientRect(),o=void 0!==window.scrollX?window.scrollX:window.pageXOffset,a=void 0!==window.scrollY?window.scrollY:window.pageYOffset;if(assert(void 0!==o&&void 0!==a,"Unable to retrieve scroll position, mouse positions likely broken."),"touchstart"==e.type||"touchend"==e.type||"touchmove"==e.type){var i=e.touches.item(0);if(!i)return;t=i.pageX-(o+n.left),r=i.pageY-(a+n.top)}else t=e.pageX-(o+n.left),r=e.pageY-(a+n.top);var c=Module.canvas.width,s=Module.canvas.height;t*=c/n.width,r*=s/n.height,Browser.mouseMovementX=t-Browser.mouseX,Browser.mouseMovementY=r-Browser.mouseY,Browser.mouseX=t,Browser.mouseY=r}},xhrLoad:function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)},asyncLoad:function(e,t,r,n){Browser.xhrLoad(e,(function(r){assert(r,'Loading data file "'+e+'" failed (no arrayBuffer).'),t(new Uint8Array(r)),n||removeRunDependency("al "+e)}),(function(t){if(!r)throw'Loading data file "'+e+'" failed.';r()})),n||addRunDependency("al "+e)},resizeListeners:[],updateResizeListeners:function(){var e=Module.canvas;Browser.resizeListeners.forEach((function(t){t(e.width,e.height)}))},setCanvasSize:function(e,t,r){var n=Module.canvas;n.width=e,n.height=t,r||Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullScreenCanvasSize:function(){var e=Module.canvas;if(this.windowedWidth=e.width,this.windowedHeight=e.height,e.width=screen.width,e.height=screen.height,"undefined"!=typeof SDL){var t=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];t|=8388608,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=t}Browser.updateResizeListeners()},setWindowedCanvasSize:function(){var e=Module.canvas;if(e.width=this.windowedWidth,e.height=this.windowedHeight,"undefined"!=typeof SDL){var t=HEAPU32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2];t&=-8388609,HEAP32[SDL.screen+0*Runtime.QUANTUM_SIZE>>2]=t}Browser.updateResizeListeners()}};if(___errno_state=Runtime.staticAlloc(4),HEAP32[___errno_state>>2]=0,Module.requestFullScreen=function(e,t){Browser.requestFullScreen(e,t)},Module.requestAnimationFrame=function(e){Browser.requestAnimationFrame(e)},Module.setCanvasSize=function(e,t,r){Browser.setCanvasSize(e,t,r)},Module.pauseMainLoop=function(){Browser.mainLoop.pause()},Module.resumeMainLoop=function(){Browser.mainLoop.resume()},Module.getUserMedia=function(){Browser.getUserMedia()},FS.staticInit(),__ATINIT__.unshift({func:function(){Module.noFSInit||FS.init.initialized||FS.init()}}),__ATMAIN__.push({func:function(){FS.ignorePermissions=!1}}),__ATEXIT__.push({func:function(){FS.quit()}}),Module.FS_createFolder=FS.createFolder,Module.FS_createPath=FS.createPath,Module.FS_createDataFile=FS.createDataFile,Module.FS_createPreloadedFile=FS.createPreloadedFile,Module.FS_createLazyFile=FS.createLazyFile,Module.FS_createLink=FS.createLink,Module.FS_createDevice=FS.createDevice,__ATINIT__.unshift({func:function(){TTY.init()}}),__ATEXIT__.push({func:function(){TTY.shutdown()}}),TTY.utf8=new Runtime.UTF8Processor,ENVIRONMENT_IS_NODE){var fs=__webpack_require__(9896);NODEFS.staticInit()}STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP),staticSealed=!0,STACK_MAX=STACK_BASE+5242880,DYNAMIC_BASE=DYNAMICTOP=Runtime.alignMemory(STACK_MAX),assert(DYNAMIC_BASE<TOTAL_MEMORY,"TOTAL_MEMORY not big enough for stack");var FUNCTION_TABLE=[0,0];function _bitmap_decompress_15(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress2(y=_malloc((0|Math_imul(p=n,h=o))<<1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var E=0|Math_imul(b,p),w=-16777216|(255&(255&((0|255*(255&(255&(31&(65535&(g=HEAP16[(y+((E+_|0)<<1)|0)>>1])))))&-1)/31&-1)))<<16|(255&(255&((0|255*(255&(255&(992&(65535&g))>>5))&-1)/31&-1)))<<8|255&(255&((0|255*(255&(255&(31744&(65535&g))>>10))&-1)/31&-1)),P=0|Math_imul(b,l);HEAP32[(u+((P+_|0)<<2)|0)>>2]=w,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress2(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w,P,S,k,A,T,O,L;s=e,l=r,p=(f=n)+o|0,h=0,d=0,_=u=t,g=-1,E=0,w=0,S=0,k=0,T=0,O=-1,L=0,a=2;break;case 2:if(f>>>0<p>>>0){a=3;break}a=346;break;case 3:L=0;var C=f;f=C+1|0;var x=v=(255&(P=HEAP8[C]))>>4;if(12==(0|x)|13==(0|x)|14==(0|x)){a=4;break}if(15==(0|x)){a=5;break}a=9;break;case 4:v=v-6|0,y=15&(255&P),m=16,a=10;break;case 5:if((0|(v=15&(255&P)))<9){a=6;break}a=7;break;case 6:var I=f,H=f=I+1|0;f=H+1|0,y=(y=255&HEAP8[I])|(255&HEAP8[H])<<8,a=8;break;case 7:y=(0|v)<11?8:1,a=8;break;case 8:m=0,a=10;break;case 9:v=v>>1,y=31&(255&P),m=32,a=10;break;case 10:if(!!(0|m)){a=11;break}a=22;break;case 11:if(2==(0|v)){var N=1;a=13;break}a=12;break;case 12:N=7==(0|v);a=13;break;case 13:if(b=1&N,!(0|y)){a=14;break}a=18;break;case 14:if(!!(0|b)){a=15;break}a=16;break;case 15:var D=f;f=D+1|0,y=(255&HEAP8[D])+1|0,a=17;break;case 16:var R=f;f=R+1|0,y=(255&HEAP8[R])+m|0,a=17;break;case 17:case 20:a=21;break;case 18:if(!!(0|b)){a=19;break}a=20;break;case 19:y=y<<3,a=20;break;case 21:a=22;break;case 22:switch(0|v){case 0:a=23;break;case 8:a=28;break;case 3:a=29;break;case 6:case 7:a=30;break;case 9:a=31;break;case 10:a=32;break;default:a=33}break;case 23:if((0|g)==(0|v)){a=24;break}a=27;break;case 24:if((0|_)==(0|u)){a=25;break}a=26;break;case 25:if(!(0|h)){a=27;break}a=26;break;case 26:E=1,a=27;break;case 27:a=33;break;case 28:var F=f,U=f=F+1|0;f=U+1|0,S=65535&(65535&(S=255&HEAP8[F])|(255&HEAP8[U])<<8),a=29;break;case 29:var j=f,M=f=j+1|0;f=M+1|0,k=65535&(65535&(k=255&HEAP8[j])|(255&HEAP8[M])<<8),a=33;break;case 30:var B=f,G=f=B+1|0;f=G+1|0,O=65535&(65535&(O=255&HEAP8[B])|(255&HEAP8[G])<<8),v=v-5|0,a=33;break;case 31:T=3,v=2,L=3,a=33;break;case 32:T=5,v=2,L=5,a=33;break;case 33:g=v,A=0,a=34;break;case 34:if((0|y)>0){a=35;break}a=345;break;case 35:if((0|_)>=(0|u)){a=36;break}a=39;break;case 36:if((0|l)<=0){a=37;break}a=38;break;case 37:case 343:c=0,a=347;break;case 38:_=0,h=d,d=s+((0|Math_imul(l=l-1|0,u))<<1)|0,a=39;break;case 39:switch(0|v){case 3:a=261;break;case 4:a=272;break;case 8:a=283;break;case 13:a=321;break;case 14:a=332;break;case 0:a=40;break;case 1:a=69;break;case 2:a=93;break;default:a=343}break;case 40:if(!!(0|E)){a=41;break}a=45;break;case 41:if(!(0|h)){a=42;break}a=43;break;case 42:var Y=O;HEAP16[(d+(_<<1)|0)>>1]=Y,a=44;break;case 43:var V=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=V,a=44;break;case 44:E=0,y=y-1|0,_=_+1|0,a=45;break;case 45:if(!(0|h)){a=46;break}a=57;break;case 46:a=47;break;case 47:if(!!(0|-8&y)){a=48;break}var z=0;a=49;break;case 48:z=(0|(_+8|0))<(0|u);a=49;break;case 49:if(z){a=50;break}a=51;break;case 50:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=47;break;case 51:a=52;break;case 52:if((0|y)>0){a=53;break}var K=0;a=54;break;case 53:K=(0|_)<(0|u);a=54;break;case 54:if(K){a=55;break}a=56;break;case 55:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=52;break;case 56:case 67:a=68;break;case 57:a=58;break;case 58:if(!!(0|-8&y)){a=59;break}var q=0;a=60;break;case 59:q=(0|(_+8|0))<(0|u);a=60;break;case 60:if(q){a=61;break}a=62;break;case 61:var W=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=W,y=y-1|0;var X=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=X,y=y-1|0;var J=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=J,y=y-1|0;var Q=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Q,y=y-1|0;var Z=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Z,y=y-1|0;var $=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=$,y=y-1|0;var ee=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ee,y=y-1|0;var te=HEAP16[(h+((_=_+1|0)<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=te,y=y-1|0,_=_+1|0,a=58;break;case 62:a=63;break;case 63:if((0|y)>0){a=64;break}var re=0;a=65;break;case 64:re=(0|_)<(0|u);a=65;break;case 65:if(re){a=66;break}a=67;break;case 66:var ne=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ne,y=y-1|0,_=_+1|0,a=63;break;case 68:case 92:case 260:case 271:case 282:case 320:case 331:case 342:a=344;break;case 69:if(!(0|h)){a=70;break}a=81;break;case 70:a=71;break;case 71:if(!!(0|-8&y)){a=72;break}var oe=0;a=73;break;case 72:oe=(0|(_+8|0))<(0|u);a=73;break;case 73:if(oe){a=74;break}a=75;break;case 74:var ae=O;HEAP16[(d+(_<<1)|0)>>1]=ae,y=y-1|0;var ie=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ie,y=y-1|0;var ce=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ce,y=y-1|0;var se=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=se,y=y-1|0;var ue=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=ue,y=y-1|0;var le=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=le,y=y-1|0;var fe=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=fe,y=y-1|0;var pe=O;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=pe,y=y-1|0,_=_+1|0,a=71;break;case 75:a=76;break;case 76:if((0|y)>0){a=77;break}var he=0;a=78;break;case 77:he=(0|_)<(0|u);a=78;break;case 78:if(he){a=79;break}a=80;break;case 79:var de=O;HEAP16[(d+(_<<1)|0)>>1]=de,y=y-1|0,_=_+1|0,a=76;break;case 80:case 91:a=92;break;case 81:a=82;break;case 82:if(!!(0|-8&y)){a=83;break}var ve=0;a=84;break;case 83:ve=(0|(_+8|0))<(0|u);a=84;break;case 84:if(ve){a=85;break}a=86;break;case 85:var ye=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ye,y=y-1|0;var me=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=me,y=y-1|0;var be=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=be,y=y-1|0;var _e=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=_e,y=y-1|0;var ge=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ge,y=y-1|0;var Ee=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ee,y=y-1|0;var we=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=we,y=y-1|0;var Pe=65535&(65535&HEAP16[(h+((_=_+1|0)<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Pe,y=y-1|0,_=_+1|0,a=82;break;case 86:a=87;break;case 87:if((0|y)>0){a=88;break}var Se=0;a=89;break;case 88:Se=(0|_)<(0|u);a=89;break;case 89:if(Se){a=90;break}a=91;break;case 90:var ke=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ke,y=y-1|0,_=_+1|0,a=87;break;case 93:if(!(0|h)){a=94;break}a=177;break;case 94:a=95;break;case 95:if(!!(0|-8&y)){a=96;break}var Ae=0;a=97;break;case 96:Ae=(0|(_+8|0))<(0|u);a=97;break;case 97:if(Ae){a=98;break}a=163;break;case 98:if(!(0|255&(A=255&(255&A)<<1))){a=99;break}a=103;break;case 99:if(!!(0|L)){a=100;break}a=101;break;case 100:var Te=L;a=102;break;case 101:var Oe=f;f=Oe+1|0;Te=255&HEAP8[Oe];a=102;break;case 102:T=255&Te,A=1,a=103;break;case 103:if(!!(0|255&T&(255&A))){a=104;break}a=105;break;case 104:var Le=O;HEAP16[(d+(_<<1)|0)>>1]=Le,a=106;break;case 105:HEAP16[(d+(_<<1)|0)>>1]=0,a=106;break;case 106:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=107;break}a=111;break;case 107:if(!!(0|L)){a=108;break}a=109;break;case 108:var Ce=L;a=110;break;case 109:var xe=f;f=xe+1|0;Ce=255&HEAP8[xe];a=110;break;case 110:T=255&Ce,A=1,a=111;break;case 111:if(!!(0|255&T&(255&A))){a=112;break}a=113;break;case 112:var Ie=O;HEAP16[(d+(_<<1)|0)>>1]=Ie,a=114;break;case 113:HEAP16[(d+(_<<1)|0)>>1]=0,a=114;break;case 114:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=115;break}a=119;break;case 115:if(!!(0|L)){a=116;break}a=117;break;case 116:var He=L;a=118;break;case 117:var Ne=f;f=Ne+1|0;He=255&HEAP8[Ne];a=118;break;case 118:T=255&He,A=1,a=119;break;case 119:if(!!(0|255&T&(255&A))){a=120;break}a=121;break;case 120:var De=O;HEAP16[(d+(_<<1)|0)>>1]=De,a=122;break;case 121:HEAP16[(d+(_<<1)|0)>>1]=0,a=122;break;case 122:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=123;break}a=127;break;case 123:if(!!(0|L)){a=124;break}a=125;break;case 124:var Re=L;a=126;break;case 125:var Fe=f;f=Fe+1|0;Re=255&HEAP8[Fe];a=126;break;case 126:T=255&Re,A=1,a=127;break;case 127:if(!!(0|255&T&(255&A))){a=128;break}a=129;break;case 128:var Ue=O;HEAP16[(d+(_<<1)|0)>>1]=Ue,a=130;break;case 129:HEAP16[(d+(_<<1)|0)>>1]=0,a=130;break;case 130:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=131;break}a=135;break;case 131:if(!!(0|L)){a=132;break}a=133;break;case 132:var je=L;a=134;break;case 133:var Me=f;f=Me+1|0;je=255&HEAP8[Me];a=134;break;case 134:T=255&je,A=1,a=135;break;case 135:if(!!(0|255&T&(255&A))){a=136;break}a=137;break;case 136:var Be=O;HEAP16[(d+(_<<1)|0)>>1]=Be,a=138;break;case 137:HEAP16[(d+(_<<1)|0)>>1]=0,a=138;break;case 138:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=139;break}a=143;break;case 139:if(!!(0|L)){a=140;break}a=141;break;case 140:var Ge=L;a=142;break;case 141:var Ye=f;f=Ye+1|0;Ge=255&HEAP8[Ye];a=142;break;case 142:T=255&Ge,A=1,a=143;break;case 143:if(!!(0|255&T&(255&A))){a=144;break}a=145;break;case 144:var Ve=O;HEAP16[(d+(_<<1)|0)>>1]=Ve,a=146;break;case 145:HEAP16[(d+(_<<1)|0)>>1]=0,a=146;break;case 146:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=147;break}a=151;break;case 147:if(!!(0|L)){a=148;break}a=149;break;case 148:var ze=L;a=150;break;case 149:var Ke=f;f=Ke+1|0;ze=255&HEAP8[Ke];a=150;break;case 150:T=255&ze,A=1,a=151;break;case 151:if(!!(0|255&T&(255&A))){a=152;break}a=153;break;case 152:var qe=O;HEAP16[(d+(_<<1)|0)>>1]=qe,a=154;break;case 153:HEAP16[(d+(_<<1)|0)>>1]=0,a=154;break;case 154:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=155;break}a=159;break;case 155:if(!!(0|L)){a=156;break}a=157;break;case 156:var We=L;a=158;break;case 157:var Xe=f;f=Xe+1|0;We=255&HEAP8[Xe];a=158;break;case 158:T=255&We,A=1,a=159;break;case 159:if(!!(0|255&T&(255&A))){a=160;break}a=161;break;case 160:var Je=O;HEAP16[(d+(_<<1)|0)>>1]=Je,a=162;break;case 161:HEAP16[(d+(_<<1)|0)>>1]=0,a=162;break;case 162:y=y-1|0,_=_+1|0,a=95;break;case 163:a=164;break;case 164:if((0|y)>0){a=165;break}var Qe=0;a=166;break;case 165:Qe=(0|_)<(0|u);a=166;break;case 166:if(Qe){a=167;break}a=176;break;case 167:if(!(0|255&(A=255&(255&A)<<1))){a=168;break}a=172;break;case 168:if(!!(0|L)){a=169;break}a=170;break;case 169:var Ze=L;a=171;break;case 170:var $e=f;f=$e+1|0;Ze=255&HEAP8[$e];a=171;break;case 171:T=255&Ze,A=1,a=172;break;case 172:if(!!(0|255&T&(255&A))){a=173;break}a=174;break;case 173:var et=O;HEAP16[(d+(_<<1)|0)>>1]=et,a=175;break;case 174:HEAP16[(d+(_<<1)|0)>>1]=0,a=175;break;case 175:y=y-1|0,_=_+1|0,a=164;break;case 176:case 259:a=260;break;case 177:a=178;break;case 178:if(!!(0|-8&y)){a=179;break}var tt=0;a=180;break;case 179:tt=(0|(_+8|0))<(0|u);a=180;break;case 180:if(tt){a=181;break}a=246;break;case 181:if(!(0|255&(A=255&(255&A)<<1))){a=182;break}a=186;break;case 182:if(!!(0|L)){a=183;break}a=184;break;case 183:var rt=L;a=185;break;case 184:var nt=f;f=nt+1|0;rt=255&HEAP8[nt];a=185;break;case 185:T=255&rt,A=1,a=186;break;case 186:if(!!(0|255&T&(255&A))){a=187;break}a=188;break;case 187:var ot=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=ot,a=189;break;case 188:var at=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=at,a=189;break;case 189:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=190;break}a=194;break;case 190:if(!!(0|L)){a=191;break}a=192;break;case 191:var it=L;a=193;break;case 192:var ct=f;f=ct+1|0;it=255&HEAP8[ct];a=193;break;case 193:T=255&it,A=1,a=194;break;case 194:if(!!(0|255&T&(255&A))){a=195;break}a=196;break;case 195:var st=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=st,a=197;break;case 196:var ut=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ut,a=197;break;case 197:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=198;break}a=202;break;case 198:if(!!(0|L)){a=199;break}a=200;break;case 199:var lt=L;a=201;break;case 200:var ft=f;f=ft+1|0;lt=255&HEAP8[ft];a=201;break;case 201:T=255&lt,A=1,a=202;break;case 202:if(!!(0|255&T&(255&A))){a=203;break}a=204;break;case 203:var pt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=pt,a=205;break;case 204:var ht=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=ht,a=205;break;case 205:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=206;break}a=210;break;case 206:if(!!(0|L)){a=207;break}a=208;break;case 207:var dt=L;a=209;break;case 208:var vt=f;f=vt+1|0;dt=255&HEAP8[vt];a=209;break;case 209:T=255&dt,A=1,a=210;break;case 210:if(!!(0|255&T&(255&A))){a=211;break}a=212;break;case 211:var yt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=yt,a=213;break;case 212:var mt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=mt,a=213;break;case 213:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=214;break}a=218;break;case 214:if(!!(0|L)){a=215;break}a=216;break;case 215:var bt=L;a=217;break;case 216:var _t=f;f=_t+1|0;bt=255&HEAP8[_t];a=217;break;case 217:T=255&bt,A=1,a=218;break;case 218:if(!!(0|255&T&(255&A))){a=219;break}a=220;break;case 219:var gt=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=gt,a=221;break;case 220:var Et=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Et,a=221;break;case 221:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=222;break}a=226;break;case 222:if(!!(0|L)){a=223;break}a=224;break;case 223:var wt=L;a=225;break;case 224:var Pt=f;f=Pt+1|0;wt=255&HEAP8[Pt];a=225;break;case 225:T=255&wt,A=1,a=226;break;case 226:if(!!(0|255&T&(255&A))){a=227;break}a=228;break;case 227:var St=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=St,a=229;break;case 228:var kt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=kt,a=229;break;case 229:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=230;break}a=234;break;case 230:if(!!(0|L)){a=231;break}a=232;break;case 231:var At=L;a=233;break;case 232:var Tt=f;f=Tt+1|0;At=255&HEAP8[Tt];a=233;break;case 233:T=255&At,A=1,a=234;break;case 234:if(!!(0|255&T&(255&A))){a=235;break}a=236;break;case 235:var Ot=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ot,a=237;break;case 236:var Lt=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Lt,a=237;break;case 237:if(y=y-1|0,_=_+1|0,!(0|255&(A=255&(255&A)<<1))){a=238;break}a=242;break;case 238:if(!!(0|L)){a=239;break}a=240;break;case 239:var Ct=L;a=241;break;case 240:var xt=f;f=xt+1|0;Ct=255&HEAP8[xt];a=241;break;case 241:T=255&Ct,A=1,a=242;break;case 242:if(!!(0|255&T&(255&A))){a=243;break}a=244;break;case 243:var It=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=It,a=245;break;case 244:var Ht=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Ht,a=245;break;case 245:y=y-1|0,_=_+1|0,a=178;break;case 246:a=247;break;case 247:if((0|y)>0){a=248;break}var Nt=0;a=249;break;case 248:Nt=(0|_)<(0|u);a=249;break;case 249:if(Nt){a=250;break}a=259;break;case 250:if(!(0|255&(A=255&(255&A)<<1))){a=251;break}a=255;break;case 251:if(!!(0|L)){a=252;break}a=253;break;case 252:var Dt=L;a=254;break;case 253:var Rt=f;f=Rt+1|0;Dt=255&HEAP8[Rt];a=254;break;case 254:T=255&Dt,A=1,a=255;break;case 255:if(!!(0|255&T&(255&A))){a=256;break}a=257;break;case 256:var Ft=65535&(65535&HEAP16[(h+(_<<1)|0)>>1]^65535&O);HEAP16[(d+(_<<1)|0)>>1]=Ft,a=258;break;case 257:var Ut=HEAP16[(h+(_<<1)|0)>>1];HEAP16[(d+(_<<1)|0)>>1]=Ut,a=258;break;case 258:y=y-1|0,_=_+1|0,a=247;break;case 261:a=262;break;case 262:if(!!(0|-8&y)){a=263;break}var jt=0;a=264;break;case 263:jt=(0|(_+8|0))<(0|u);a=264;break;case 264:if(jt){a=265;break}a=266;break;case 265:var Mt=k;HEAP16[(d+(_<<1)|0)>>1]=Mt,y=y-1|0;var Bt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Bt,y=y-1|0;var Gt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Gt,y=y-1|0;var Yt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Yt,y=y-1|0;var Vt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Vt,y=y-1|0;var zt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=zt,y=y-1|0;var Kt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=Kt,y=y-1|0;var qt=k;HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=qt,y=y-1|0,_=_+1|0,a=262;break;case 266:a=267;break;case 267:if((0|y)>0){a=268;break}var Wt=0;a=269;break;case 268:Wt=(0|_)<(0|u);a=269;break;case 269:if(Wt){a=270;break}a=271;break;case 270:var Xt=k;HEAP16[(d+(_<<1)|0)>>1]=Xt,y=y-1|0,_=_+1|0,a=267;break;case 272:a=273;break;case 273:if(!!(0|-8&y)){a=274;break}var Jt=0;a=275;break;case 274:Jt=(0|(_+8|0))<(0|u);a=275;break;case 275:if(Jt){a=276;break}a=277;break;case 276:var Qt=f;f=Qt+1|0;var Zt=255&HEAP8[Qt];HEAP16[(d+(_<<1)|0)>>1]=Zt;var $t=f;f=$t+1|0;var er=(255&HEAP8[$t])<<8,tr=d+(_<<1)|0,rr=65535&(65535&HEAP16[tr>>1]|er);HEAP16[tr>>1]=rr,y=y-1|0,_=_+1|0;var nr=f;f=nr+1|0;var or=255&HEAP8[nr];HEAP16[(d+(_<<1)|0)>>1]=or;var ar=f;f=ar+1|0;var ir=(255&HEAP8[ar])<<8,cr=d+(_<<1)|0,sr=65535&(65535&HEAP16[cr>>1]|ir);HEAP16[cr>>1]=sr,y=y-1|0,_=_+1|0;var ur=f;f=ur+1|0;var lr=255&HEAP8[ur];HEAP16[(d+(_<<1)|0)>>1]=lr;var fr=f;f=fr+1|0;var pr=(255&HEAP8[fr])<<8,hr=d+(_<<1)|0,dr=65535&(65535&HEAP16[hr>>1]|pr);HEAP16[hr>>1]=dr,y=y-1|0,_=_+1|0;var vr=f;f=vr+1|0;var yr=255&HEAP8[vr];HEAP16[(d+(_<<1)|0)>>1]=yr;var mr=f;f=mr+1|0;var br=(255&HEAP8[mr])<<8,_r=d+(_<<1)|0,gr=65535&(65535&HEAP16[_r>>1]|br);HEAP16[_r>>1]=gr,y=y-1|0,_=_+1|0;var Er=f;f=Er+1|0;var wr=255&HEAP8[Er];HEAP16[(d+(_<<1)|0)>>1]=wr;var Pr=f;f=Pr+1|0;var Sr=(255&HEAP8[Pr])<<8,kr=d+(_<<1)|0,Ar=65535&(65535&HEAP16[kr>>1]|Sr);HEAP16[kr>>1]=Ar,y=y-1|0,_=_+1|0;var Tr=f;f=Tr+1|0;var Or=255&HEAP8[Tr];HEAP16[(d+(_<<1)|0)>>1]=Or;var Lr=f;f=Lr+1|0;var Cr=(255&HEAP8[Lr])<<8,xr=d+(_<<1)|0,Ir=65535&(65535&HEAP16[xr>>1]|Cr);HEAP16[xr>>1]=Ir,y=y-1|0,_=_+1|0;var Hr=f;f=Hr+1|0;var Nr=255&HEAP8[Hr];HEAP16[(d+(_<<1)|0)>>1]=Nr;var Dr=f;f=Dr+1|0;var Rr=(255&HEAP8[Dr])<<8,Fr=d+(_<<1)|0,Ur=65535&(65535&HEAP16[Fr>>1]|Rr);HEAP16[Fr>>1]=Ur,y=y-1|0,_=_+1|0;var jr=f;f=jr+1|0;var Mr=255&HEAP8[jr];HEAP16[(d+(_<<1)|0)>>1]=Mr;var Br=f;f=Br+1|0;var Gr=(255&HEAP8[Br])<<8,Yr=d+(_<<1)|0,Vr=65535&(65535&HEAP16[Yr>>1]|Gr);HEAP16[Yr>>1]=Vr,y=y-1|0,_=_+1|0,a=273;break;case 277:a=278;break;case 278:if((0|y)>0){a=279;break}var zr=0;a=280;break;case 279:zr=(0|_)<(0|u);a=280;break;case 280:if(zr){a=281;break}a=282;break;case 281:var Kr=f;f=Kr+1|0;var qr=255&HEAP8[Kr];HEAP16[(d+(_<<1)|0)>>1]=qr;var Wr=f;f=Wr+1|0;var Xr=(255&HEAP8[Wr])<<8,Jr=d+(_<<1)|0,Qr=65535&(65535&HEAP16[Jr>>1]|Xr);HEAP16[Jr>>1]=Qr,y=y-1|0,_=_+1|0,a=278;break;case 283:a=284;break;case 284:if(!!(0|-8&y)){a=285;break}var Zr=0;a=286;break;case 285:Zr=(0|(_+8|0))<(0|u);a=286;break;case 286:if(Zr){a=287;break}a=312;break;case 287:if(!!(0|w)){a=288;break}a=289;break;case 288:var $r=k;HEAP16[(d+(_<<1)|0)>>1]=$r,w=0,a=290;break;case 289:var en=S;HEAP16[(d+(_<<1)|0)>>1]=en,w=1,y=y+1|0,a=290;break;case 290:if(y=y-1|0,_=_+1|0,!!(0|w)){a=291;break}a=292;break;case 291:var tn=k;HEAP16[(d+(_<<1)|0)>>1]=tn,w=0,a=293;break;case 292:var rn=S;HEAP16[(d+(_<<1)|0)>>1]=rn,w=1,y=y+1|0,a=293;break;case 293:if(y=y-1|0,_=_+1|0,!!(0|w)){a=294;break}a=295;break;case 294:var nn=k;HEAP16[(d+(_<<1)|0)>>1]=nn,w=0,a=296;break;case 295:var on=S;HEAP16[(d+(_<<1)|0)>>1]=on,w=1,y=y+1|0,a=296;break;case 296:if(y=y-1|0,_=_+1|0,!!(0|w)){a=297;break}a=298;break;case 297:var an=k;HEAP16[(d+(_<<1)|0)>>1]=an,w=0,a=299;break;case 298:var cn=S;HEAP16[(d+(_<<1)|0)>>1]=cn,w=1,y=y+1|0,a=299;break;case 299:if(y=y-1|0,_=_+1|0,!!(0|w)){a=300;break}a=301;break;case 300:var sn=k;HEAP16[(d+(_<<1)|0)>>1]=sn,w=0,a=302;break;case 301:var un=S;HEAP16[(d+(_<<1)|0)>>1]=un,w=1,y=y+1|0,a=302;break;case 302:if(y=y-1|0,_=_+1|0,!!(0|w)){a=303;break}a=304;break;case 303:var ln=k;HEAP16[(d+(_<<1)|0)>>1]=ln,w=0,a=305;break;case 304:var fn=S;HEAP16[(d+(_<<1)|0)>>1]=fn,w=1,y=y+1|0,a=305;break;case 305:if(y=y-1|0,_=_+1|0,!!(0|w)){a=306;break}a=307;break;case 306:var pn=k;HEAP16[(d+(_<<1)|0)>>1]=pn,w=0,a=308;break;case 307:var hn=S;HEAP16[(d+(_<<1)|0)>>1]=hn,w=1,y=y+1|0,a=308;break;case 308:if(y=y-1|0,_=_+1|0,!!(0|w)){a=309;break}a=310;break;case 309:var dn=k;HEAP16[(d+(_<<1)|0)>>1]=dn,w=0,a=311;break;case 310:var vn=S;HEAP16[(d+(_<<1)|0)>>1]=vn,w=1,y=y+1|0,a=311;break;case 311:y=y-1|0,_=_+1|0,a=284;break;case 312:a=313;break;case 313:if((0|y)>0){a=314;break}var yn=0;a=315;break;case 314:yn=(0|_)<(0|u);a=315;break;case 315:if(yn){a=316;break}a=320;break;case 316:if(!!(0|w)){a=317;break}a=318;break;case 317:var mn=k;HEAP16[(d+(_<<1)|0)>>1]=mn,w=0,a=319;break;case 318:var bn=S;HEAP16[(d+(_<<1)|0)>>1]=bn,w=1,y=y+1|0,a=319;break;case 319:y=y-1|0,_=_+1|0,a=313;break;case 321:a=322;break;case 322:if(!!(0|-8&y)){a=323;break}var _n=0;a=324;break;case 323:_n=(0|(_+8|0))<(0|u);a=324;break;case 324:if(_n){a=325;break}a=326;break;case 325:HEAP16[(d+(_<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=-1,y=y-1|0,_=_+1|0,a=322;break;case 326:a=327;break;case 327:if((0|y)>0){a=328;break}var gn=0;a=329;break;case 328:gn=(0|_)<(0|u);a=329;break;case 329:if(gn){a=330;break}a=331;break;case 330:HEAP16[(d+(_<<1)|0)>>1]=-1,y=y-1|0,_=_+1|0,a=327;break;case 332:a=333;break;case 333:if(!!(0|-8&y)){a=334;break}var En=0;a=335;break;case 334:En=(0|(_+8|0))<(0|u);a=335;break;case 335:if(En){a=336;break}a=337;break;case 336:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,HEAP16[(d+((_=_+1|0)<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=333;break;case 337:a=338;break;case 338:if((0|y)>0){a=339;break}var wn=0;a=340;break;case 339:wn=(0|_)<(0|u);a=340;break;case 340:if(wn){a=341;break}a=342;break;case 341:HEAP16[(d+(_<<1)|0)>>1]=0,y=y-1|0,_=_+1|0,a=338;break;case 344:a=34;break;case 345:a=2;break;case 346:c=1,a=347;break;case 347:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _bitmap_decompress_16(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress2(y=_malloc((0|Math_imul(p=n,h=o))<<1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var E=0|Math_imul(b,p),w=-16777216|(255&(255&((0|255*(255&(255&(31&(65535&(g=HEAP16[(y+((E+_|0)<<1)|0)>>1])))))&-1)/31&-1)))<<16|(255&(255&((0|255*(255&(255&(2016&(65535&g))>>5))&-1)/63&-1)))<<8|255&(255&((0|255*(255&(255&(63488&(65535&g))>>11))&-1)/31&-1)),P=0|Math_imul(b,l);HEAP32[(u+((P+_|0)<<2)|0)>>2]=w,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress_24(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g,E;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress3(y=_malloc(3*(0|Math_imul(p=n,h=o))&-1),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var w=0|Math_imul(b,p);g=HEAP8[y+(3*(w+_|0)&-1)|0];var P=0|Math_imul(b,p);E=HEAP8[y+((3*(P+_|0)&-1)+1|0)|0];var S=0|Math_imul(b,p),k=-16777216|(255&HEAP8[y+((3*(S+_|0)&-1)+2|0)|0])<<16|(255&E)<<8|255&g,A=0|Math_imul(b,l);HEAP32[(u+((A+_|0)<<2)|0)>>2]=k,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress3(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|(STACKTOP=STACKTOP+24|0))<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w,P,S,k,A,T=i,O=i+8,L=i+16;s=e,l=r,p=(f=n)+o|0,h=0,d=0,_=u=t,g=-1,E=0,w=0;var C=T;HEAP8[C]=0,HEAP8[C+1|0]=0,HEAP8[C+2|0]=0;var x=O;HEAP8[x]=0,HEAP8[x+1|0]=0,HEAP8[x+2|0]=0,k=0;var I=L;assert(!0),HEAP8[I]=HEAP8[8],HEAP8[I+1|0]=HEAP8[9],HEAP8[I+2|0]=HEAP8[10],A=0,a=2;break;case 2:if(f>>>0<p>>>0){a=3;break}a=346;break;case 3:A=0;var H=f;f=H+1|0;var N=v=(255&(P=HEAP8[H]))>>4;if(12==(0|N)|13==(0|N)|14==(0|N)){a=4;break}if(15==(0|N)){a=5;break}a=9;break;case 4:v=v-6|0,y=15&(255&P),m=16,a=10;break;case 5:if((0|(v=15&(255&P)))<9){a=6;break}a=7;break;case 6:var D=f,R=f=D+1|0;f=R+1|0,y=(y=255&HEAP8[D])|(255&HEAP8[R])<<8,a=8;break;case 7:y=(0|v)<11?8:1,a=8;break;case 8:m=0,a=10;break;case 9:v=v>>1,y=31&(255&P),m=32,a=10;break;case 10:if(!!(0|m)){a=11;break}a=22;break;case 11:if(2==(0|v)){var F=1;a=13;break}a=12;break;case 12:F=7==(0|v);a=13;break;case 13:if(b=1&F,!(0|y)){a=14;break}a=18;break;case 14:if(!!(0|b)){a=15;break}a=16;break;case 15:var U=f;f=U+1|0,y=(255&HEAP8[U])+1|0,a=17;break;case 16:var j=f;f=j+1|0,y=(255&HEAP8[j])+m|0,a=17;break;case 17:case 20:a=21;break;case 18:if(!!(0|b)){a=19;break}a=20;break;case 19:y=y<<3,a=20;break;case 21:a=22;break;case 22:switch(0|v){case 0:a=23;break;case 8:a=28;break;case 3:a=29;break;case 6:case 7:a=30;break;case 9:a=31;break;case 10:a=32;break;default:a=33}break;case 23:if((0|g)==(0|v)){a=24;break}a=27;break;case 24:if((0|_)==(0|u)){a=25;break}a=26;break;case 25:if(!(0|h)){a=27;break}a=26;break;case 26:E=1,a=27;break;case 27:a=33;break;case 28:var M=f;f=M+1|0;var B=HEAP8[M];HEAP8[0|T]=B;var G=f;f=G+1|0;var Y=HEAP8[G];HEAP8[T+1|0]=Y;var V=f;f=V+1|0;var z=HEAP8[V];HEAP8[T+2|0]=z,a=29;break;case 29:var K=f;f=K+1|0;var q=HEAP8[K];HEAP8[0|O]=q;var W=f;f=W+1|0;var X=HEAP8[W];HEAP8[O+1|0]=X;var J=f;f=J+1|0;var Q=HEAP8[J];HEAP8[O+2|0]=Q,a=33;break;case 30:var Z=f;f=Z+1|0;var $=HEAP8[Z];HEAP8[0|L]=$;var ee=f;f=ee+1|0;var te=HEAP8[ee];HEAP8[L+1|0]=te;var re=f;f=re+1|0;var ne=HEAP8[re];HEAP8[L+2|0]=ne,v=v-5|0,a=33;break;case 31:k=3,v=2,A=3,a=33;break;case 32:k=5,v=2,A=5,a=33;break;case 33:g=v,S=0,a=34;break;case 34:if((0|y)>0){a=35;break}a=345;break;case 35:if((0|_)>=(0|u)){a=36;break}a=39;break;case 36:if((0|l)<=0){a=37;break}a=38;break;case 37:case 343:c=0,a=347;break;case 38:_=0,h=d,d=s+(0|Math_imul(l=l-1|0,3*u&-1))|0,a=39;break;case 39:switch(0|v){case 3:a=261;break;case 4:a=272;break;case 8:a=283;break;case 13:a=321;break;case 14:a=332;break;case 0:a=40;break;case 1:a=69;break;case 2:a=93;break;default:a=343}break;case 40:if(!!(0|E)){a=41;break}a=45;break;case 41:if(!(0|h)){a=42;break}a=43;break;case 42:var oe=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=oe;var ae=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ae;var ie=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ie,a=44;break;case 43:var ce=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=ce;var se=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=se;var ue=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=ue,a=44;break;case 44:E=0,y=y-1|0,_=_+1|0,a=45;break;case 45:if(!(0|h)){a=46;break}a=57;break;case 46:a=47;break;case 47:if(!!(0|-8&y)){a=48;break}var le=0;a=49;break;case 48:le=(0|(_+8|0))<(0|u);a=49;break;case 49:if(le){a=50;break}a=51;break;case 50:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=47;break;case 51:a=52;break;case 52:if((0|y)>0){a=53;break}var fe=0;a=54;break;case 53:fe=(0|_)<(0|u);a=54;break;case 54:if(fe){a=55;break}a=56;break;case 55:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=52;break;case 56:case 67:a=68;break;case 57:a=58;break;case 58:if(!!(0|-8&y)){a=59;break}var pe=0;a=60;break;case 59:pe=(0|(_+8|0))<(0|u);a=60;break;case 60:if(pe){a=61;break}a=62;break;case 61:var he=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=he;var de=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=de;var ve=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=ve,y=y-1|0;var ye=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=ye;var me=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=me;var be=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=be,y=y-1|0;var _e=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=_e;var ge=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=ge;var Ee=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ee,y=y-1|0;var we=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=we;var Pe=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Pe;var Se=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Se,y=y-1|0;var ke=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=ke;var Ae=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ae;var Te=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Te,y=y-1|0;var Oe=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=Oe;var Le=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Le;var Ce=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ce,y=y-1|0;var xe=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=xe;var Ie=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ie;var He=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=He,y=y-1|0;var Ne=HEAP8[h+(3*(_=_+1|0)&-1)|0];HEAP8[d+(3*_&-1)|0]=Ne;var De=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=De;var Re=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Re,y=y-1|0,_=_+1|0,a=58;break;case 62:a=63;break;case 63:if((0|y)>0){a=64;break}var Fe=0;a=65;break;case 64:Fe=(0|_)<(0|u);a=65;break;case 65:if(Fe){a=66;break}a=67;break;case 66:var Ue=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Ue;var je=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=je;var Me=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Me,y=y-1|0,_=_+1|0,a=63;break;case 68:case 92:case 260:case 271:case 282:case 320:case 331:case 342:a=344;break;case 69:if(!(0|h)){a=70;break}a=81;break;case 70:a=71;break;case 71:if(!!(0|-8&y)){a=72;break}var Be=0;a=73;break;case 72:Be=(0|(_+8|0))<(0|u);a=73;break;case 73:if(Be){a=74;break}a=75;break;case 74:var Ge=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Ge;var Ye=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ye;var Ve=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ve,y=y-1|0,_=_+1|0;var ze=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ze;var Ke=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ke;var qe=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=qe,y=y-1|0,_=_+1|0;var We=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=We;var Xe=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Xe;var Je=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Je,y=y-1|0,_=_+1|0;var Qe=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Qe;var Ze=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ze;var $e=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=$e,y=y-1|0,_=_+1|0;var et=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=et;var tt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=tt;var rt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=rt,y=y-1|0,_=_+1|0;var nt=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=nt;var ot=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ot;var at=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=at,y=y-1|0,_=_+1|0;var it=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=it;var ct=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ct;var st=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=st,y=y-1|0,_=_+1|0;var ut=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ut;var lt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lt;var ft=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ft,y=y-1|0,_=_+1|0,a=71;break;case 75:a=76;break;case 76:if((0|y)>0){a=77;break}var pt=0;a=78;break;case 77:pt=(0|_)<(0|u);a=78;break;case 78:if(pt){a=79;break}a=80;break;case 79:var ht=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ht;var dt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=dt;var vt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=vt,y=y-1|0,_=_+1|0,a=76;break;case 80:case 91:a=92;break;case 81:a=82;break;case 82:if(!!(0|-8&y)){a=83;break}var yt=0;a=84;break;case 83:yt=(0|(_+8|0))<(0|u);a=84;break;case 84:if(yt){a=85;break}a=86;break;case 85:var mt=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=mt;var bt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=bt;var _t=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=_t,y=y-1|0;var gt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=gt;var Et=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Et;var wt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=wt,y=y-1|0;var Pt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Pt;var St=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=St;var kt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=kt,y=y-1|0;var At=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=At;var Tt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Tt;var Ot=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Ot,y=y-1|0;var Lt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Lt;var Ct=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ct;var xt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=xt,y=y-1|0;var It=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=It;var Ht=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ht;var Nt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Nt,y=y-1|0;var Dt=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Dt;var Rt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Rt;var Ft=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Ft,y=y-1|0;var Ut=255&(255&HEAP8[h+(3*(_=_+1|0)&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Ut;var jt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=jt;var Mt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Mt,y=y-1|0,_=_+1|0,a=82;break;case 86:a=87;break;case 87:if((0|y)>0){a=88;break}var Bt=0;a=89;break;case 88:Bt=(0|_)<(0|u);a=89;break;case 89:if(Bt){a=90;break}a=91;break;case 90:var Gt=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Gt;var Yt=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Yt;var Vt=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Vt,y=y-1|0,_=_+1|0,a=87;break;case 93:if(!(0|h)){a=94;break}a=177;break;case 94:a=95;break;case 95:if(!!(0|-8&y)){a=96;break}var zt=0;a=97;break;case 96:zt=(0|(_+8|0))<(0|u);a=97;break;case 97:if(zt){a=98;break}a=163;break;case 98:if(!(0|255&(S=255&(255&S)<<1))){a=99;break}a=103;break;case 99:if(!!(0|A)){a=100;break}a=101;break;case 100:var Kt=A;a=102;break;case 101:var qt=f;f=qt+1|0;Kt=255&HEAP8[qt];a=102;break;case 102:k=255&Kt,S=1,a=103;break;case 103:if(!!(0|255&k&(255&S))){a=104;break}a=105;break;case 104:var Wt=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Wt;var Xt=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Xt;var Jt=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Jt,a=106;break;case 105:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=106;break;case 106:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=107;break}a=111;break;case 107:if(!!(0|A)){a=108;break}a=109;break;case 108:var Qt=A;a=110;break;case 109:var Zt=f;f=Zt+1|0;Qt=255&HEAP8[Zt];a=110;break;case 110:k=255&Qt,S=1,a=111;break;case 111:if(!!(0|255&k&(255&S))){a=112;break}a=113;break;case 112:var $t=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=$t;var er=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=er;var tr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=tr,a=114;break;case 113:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=114;break;case 114:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=115;break}a=119;break;case 115:if(!!(0|A)){a=116;break}a=117;break;case 116:var rr=A;a=118;break;case 117:var nr=f;f=nr+1|0;rr=255&HEAP8[nr];a=118;break;case 118:k=255&rr,S=1,a=119;break;case 119:if(!!(0|255&k&(255&S))){a=120;break}a=121;break;case 120:var or=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=or;var ar=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ar;var ir=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ir,a=122;break;case 121:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=122;break;case 122:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=123;break}a=127;break;case 123:if(!!(0|A)){a=124;break}a=125;break;case 124:var cr=A;a=126;break;case 125:var sr=f;f=sr+1|0;cr=255&HEAP8[sr];a=126;break;case 126:k=255&cr,S=1,a=127;break;case 127:if(!!(0|255&k&(255&S))){a=128;break}a=129;break;case 128:var ur=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=ur;var lr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lr;var fr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=fr,a=130;break;case 129:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=130;break;case 130:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=131;break}a=135;break;case 131:if(!!(0|A)){a=132;break}a=133;break;case 132:var pr=A;a=134;break;case 133:var hr=f;f=hr+1|0;pr=255&HEAP8[hr];a=134;break;case 134:k=255&pr,S=1,a=135;break;case 135:if(!!(0|255&k&(255&S))){a=136;break}a=137;break;case 136:var dr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=dr;var vr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=vr;var yr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=yr,a=138;break;case 137:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=138;break;case 138:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=139;break}a=143;break;case 139:if(!!(0|A)){a=140;break}a=141;break;case 140:var mr=A;a=142;break;case 141:var br=f;f=br+1|0;mr=255&HEAP8[br];a=142;break;case 142:k=255&mr,S=1,a=143;break;case 143:if(!!(0|255&k&(255&S))){a=144;break}a=145;break;case 144:var _r=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=_r;var gr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=gr;var Er=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Er,a=146;break;case 145:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=146;break;case 146:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=147;break}a=151;break;case 147:if(!!(0|A)){a=148;break}a=149;break;case 148:var wr=A;a=150;break;case 149:var Pr=f;f=Pr+1|0;wr=255&HEAP8[Pr];a=150;break;case 150:k=255&wr,S=1,a=151;break;case 151:if(!!(0|255&k&(255&S))){a=152;break}a=153;break;case 152:var Sr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Sr;var kr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=kr;var Ar=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ar,a=154;break;case 153:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=154;break;case 154:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=155;break}a=159;break;case 155:if(!!(0|A)){a=156;break}a=157;break;case 156:var Tr=A;a=158;break;case 157:var Or=f;f=Or+1|0;Tr=255&HEAP8[Or];a=158;break;case 158:k=255&Tr,S=1,a=159;break;case 159:if(!!(0|255&k&(255&S))){a=160;break}a=161;break;case 160:var Lr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Lr;var Cr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Cr;var xr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=xr,a=162;break;case 161:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=162;break;case 162:y=y-1|0,_=_+1|0,a=95;break;case 163:a=164;break;case 164:if((0|y)>0){a=165;break}var Ir=0;a=166;break;case 165:Ir=(0|_)<(0|u);a=166;break;case 166:if(Ir){a=167;break}a=176;break;case 167:if(!(0|255&(S=255&(255&S)<<1))){a=168;break}a=172;break;case 168:if(!!(0|A)){a=169;break}a=170;break;case 169:var Hr=A;a=171;break;case 170:var Nr=f;f=Nr+1|0;Hr=255&HEAP8[Nr];a=171;break;case 171:k=255&Hr,S=1,a=172;break;case 172:if(!!(0|255&k&(255&S))){a=173;break}a=174;break;case 173:var Dr=HEAP8[0|L];HEAP8[d+(3*_&-1)|0]=Dr;var Rr=HEAP8[L+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Rr;var Fr=HEAP8[L+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Fr,a=175;break;case 174:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,a=175;break;case 175:y=y-1|0,_=_+1|0,a=164;break;case 176:case 259:a=260;break;case 177:a=178;break;case 178:if(!!(0|-8&y)){a=179;break}var Ur=0;a=180;break;case 179:Ur=(0|(_+8|0))<(0|u);a=180;break;case 180:if(Ur){a=181;break}a=246;break;case 181:if(!(0|255&(S=255&(255&S)<<1))){a=182;break}a=186;break;case 182:if(!!(0|A)){a=183;break}a=184;break;case 183:var jr=A;a=185;break;case 184:var Mr=f;f=Mr+1|0;jr=255&HEAP8[Mr];a=185;break;case 185:k=255&jr,S=1,a=186;break;case 186:if(!!(0|255&k&(255&S))){a=187;break}a=188;break;case 187:var Br=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Br;var Gr=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Gr;var Yr=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Yr,a=189;break;case 188:var Vr=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Vr;var zr=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=zr;var Kr=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Kr,a=189;break;case 189:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=190;break}a=194;break;case 190:if(!!(0|A)){a=191;break}a=192;break;case 191:var qr=A;a=193;break;case 192:var Wr=f;f=Wr+1|0;qr=255&HEAP8[Wr];a=193;break;case 193:k=255&qr,S=1,a=194;break;case 194:if(!!(0|255&k&(255&S))){a=195;break}a=196;break;case 195:var Xr=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Xr;var Jr=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Jr;var Qr=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Qr,a=197;break;case 196:var Zr=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Zr;var $r=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=$r;var en=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=en,a=197;break;case 197:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=198;break}a=202;break;case 198:if(!!(0|A)){a=199;break}a=200;break;case 199:var tn=A;a=201;break;case 200:var rn=f;f=rn+1|0;tn=255&HEAP8[rn];a=201;break;case 201:k=255&tn,S=1,a=202;break;case 202:if(!!(0|255&k&(255&S))){a=203;break}a=204;break;case 203:var nn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=nn;var on=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=on;var an=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=an,a=205;break;case 204:var cn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=cn;var sn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=sn;var un=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=un,a=205;break;case 205:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=206;break}a=210;break;case 206:if(!!(0|A)){a=207;break}a=208;break;case 207:var ln=A;a=209;break;case 208:var fn=f;f=fn+1|0;ln=255&HEAP8[fn];a=209;break;case 209:k=255&ln,S=1,a=210;break;case 210:if(!!(0|255&k&(255&S))){a=211;break}a=212;break;case 211:var pn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=pn;var hn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=hn;var dn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=dn,a=213;break;case 212:var vn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=vn;var yn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=yn;var mn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=mn,a=213;break;case 213:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=214;break}a=218;break;case 214:if(!!(0|A)){a=215;break}a=216;break;case 215:var bn=A;a=217;break;case 216:var _n=f;f=_n+1|0;bn=255&HEAP8[_n];a=217;break;case 217:k=255&bn,S=1,a=218;break;case 218:if(!!(0|255&k&(255&S))){a=219;break}a=220;break;case 219:var gn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=gn;var En=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=En;var wn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=wn,a=221;break;case 220:var Pn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=Pn;var Sn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Sn;var kn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=kn,a=221;break;case 221:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=222;break}a=226;break;case 222:if(!!(0|A)){a=223;break}a=224;break;case 223:var An=A;a=225;break;case 224:var Tn=f;f=Tn+1|0;An=255&HEAP8[Tn];a=225;break;case 225:k=255&An,S=1,a=226;break;case 226:if(!!(0|255&k&(255&S))){a=227;break}a=228;break;case 227:var On=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=On;var Ln=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Ln;var Cn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Cn,a=229;break;case 228:var xn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=xn;var In=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=In;var Hn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Hn,a=229;break;case 229:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=230;break}a=234;break;case 230:if(!!(0|A)){a=231;break}a=232;break;case 231:var Nn=A;a=233;break;case 232:var Dn=f;f=Dn+1|0;Nn=255&HEAP8[Dn];a=233;break;case 233:k=255&Nn,S=1,a=234;break;case 234:if(!!(0|255&k&(255&S))){a=235;break}a=236;break;case 235:var Rn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Rn;var Fn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=Fn;var Un=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Un,a=237;break;case 236:var jn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=jn;var Mn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Mn;var Bn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Bn,a=237;break;case 237:if(y=y-1|0,_=_+1|0,!(0|255&(S=255&(255&S)<<1))){a=238;break}a=242;break;case 238:if(!!(0|A)){a=239;break}a=240;break;case 239:var Gn=A;a=241;break;case 240:var Yn=f;f=Yn+1|0;Gn=255&HEAP8[Yn];a=241;break;case 241:k=255&Gn,S=1,a=242;break;case 242:if(!!(0|255&k&(255&S))){a=243;break}a=244;break;case 243:var Vn=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=Vn;var zn=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=zn;var Kn=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=Kn,a=245;break;case 244:var qn=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=qn;var Wn=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=Wn;var Xn=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=Xn,a=245;break;case 245:y=y-1|0,_=_+1|0,a=178;break;case 246:a=247;break;case 247:if((0|y)>0){a=248;break}var Jn=0;a=249;break;case 248:Jn=(0|_)<(0|u);a=249;break;case 249:if(Jn){a=250;break}a=259;break;case 250:if(!(0|255&(S=255&(255&S)<<1))){a=251;break}a=255;break;case 251:if(!!(0|A)){a=252;break}a=253;break;case 252:var Qn=A;a=254;break;case 253:var Zn=f;f=Zn+1|0;Qn=255&HEAP8[Zn];a=254;break;case 254:k=255&Qn,S=1,a=255;break;case 255:if(!!(0|255&k&(255&S))){a=256;break}a=257;break;case 256:var $n=255&(255&HEAP8[h+(3*_&-1)|0]^255&HEAP8[0|L]);HEAP8[d+(3*_&-1)|0]=$n;var eo=255&(255&HEAP8[h+((3*_&-1)+1|0)|0]^255&HEAP8[L+1|0]);HEAP8[d+((3*_&-1)+1|0)|0]=eo;var to=255&(255&HEAP8[h+((3*_&-1)+2|0)|0]^255&HEAP8[L+2|0]);HEAP8[d+((3*_&-1)+2|0)|0]=to,a=258;break;case 257:var ro=HEAP8[h+(3*_&-1)|0];HEAP8[d+(3*_&-1)|0]=ro;var no=HEAP8[h+((3*_&-1)+1|0)|0];HEAP8[d+((3*_&-1)+1|0)|0]=no;var oo=HEAP8[h+((3*_&-1)+2|0)|0];HEAP8[d+((3*_&-1)+2|0)|0]=oo,a=258;break;case 258:y=y-1|0,_=_+1|0,a=247;break;case 261:a=262;break;case 262:if(!!(0|-8&y)){a=263;break}var ao=0;a=264;break;case 263:ao=(0|(_+8|0))<(0|u);a=264;break;case 264:if(ao){a=265;break}a=266;break;case 265:var io=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=io;var co=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=co;var so=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=so,y=y-1|0,_=_+1|0;var uo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=uo;var lo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=lo;var fo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=fo,y=y-1|0,_=_+1|0;var po=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=po;var ho=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ho;var vo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=vo,y=y-1|0,_=_+1|0;var yo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=yo;var mo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=mo;var bo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=bo,y=y-1|0,_=_+1|0;var _o=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=_o;var go=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=go;var Eo=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Eo,y=y-1|0,_=_+1|0;var wo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=wo;var Po=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Po;var So=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=So,y=y-1|0,_=_+1|0;var ko=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=ko;var Ao=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ao;var To=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=To,y=y-1|0,_=_+1|0;var Oo=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Oo;var Lo=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Lo;var Co=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Co,y=y-1|0,_=_+1|0,a=262;break;case 266:a=267;break;case 267:if((0|y)>0){a=268;break}var xo=0;a=269;break;case 268:xo=(0|_)<(0|u);a=269;break;case 269:if(xo){a=270;break}a=271;break;case 270:var Io=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Io;var Ho=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ho;var No=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=No,y=y-1|0,_=_+1|0,a=267;break;case 272:a=273;break;case 273:if(!!(0|-8&y)){a=274;break}var Do=0;a=275;break;case 274:Do=(0|(_+8|0))<(0|u);a=275;break;case 275:if(Do){a=276;break}a=277;break;case 276:var Ro=f;f=Ro+1|0;var Fo=HEAP8[Ro];HEAP8[d+(3*_&-1)|0]=Fo;var Uo=f;f=Uo+1|0;var jo=HEAP8[Uo];HEAP8[d+((3*_&-1)+1|0)|0]=jo;var Mo=f;f=Mo+1|0;var Bo=HEAP8[Mo];HEAP8[d+((3*_&-1)+2|0)|0]=Bo,y=y-1|0,_=_+1|0;var Go=f;f=Go+1|0;var Yo=HEAP8[Go];HEAP8[d+(3*_&-1)|0]=Yo;var Vo=f;f=Vo+1|0;var zo=HEAP8[Vo];HEAP8[d+((3*_&-1)+1|0)|0]=zo;var Ko=f;f=Ko+1|0;var qo=HEAP8[Ko];HEAP8[d+((3*_&-1)+2|0)|0]=qo,y=y-1|0,_=_+1|0;var Wo=f;f=Wo+1|0;var Xo=HEAP8[Wo];HEAP8[d+(3*_&-1)|0]=Xo;var Jo=f;f=Jo+1|0;var Qo=HEAP8[Jo];HEAP8[d+((3*_&-1)+1|0)|0]=Qo;var Zo=f;f=Zo+1|0;var $o=HEAP8[Zo];HEAP8[d+((3*_&-1)+2|0)|0]=$o,y=y-1|0,_=_+1|0;var ea=f;f=ea+1|0;var ta=HEAP8[ea];HEAP8[d+(3*_&-1)|0]=ta;var ra=f;f=ra+1|0;var na=HEAP8[ra];HEAP8[d+((3*_&-1)+1|0)|0]=na;var oa=f;f=oa+1|0;var aa=HEAP8[oa];HEAP8[d+((3*_&-1)+2|0)|0]=aa,y=y-1|0,_=_+1|0;var ia=f;f=ia+1|0;var ca=HEAP8[ia];HEAP8[d+(3*_&-1)|0]=ca;var sa=f;f=sa+1|0;var ua=HEAP8[sa];HEAP8[d+((3*_&-1)+1|0)|0]=ua;var la=f;f=la+1|0;var fa=HEAP8[la];HEAP8[d+((3*_&-1)+2|0)|0]=fa,y=y-1|0,_=_+1|0;var pa=f;f=pa+1|0;var ha=HEAP8[pa];HEAP8[d+(3*_&-1)|0]=ha;var da=f;f=da+1|0;var va=HEAP8[da];HEAP8[d+((3*_&-1)+1|0)|0]=va;var ya=f;f=ya+1|0;var ma=HEAP8[ya];HEAP8[d+((3*_&-1)+2|0)|0]=ma,y=y-1|0,_=_+1|0;var ba=f;f=ba+1|0;var _a=HEAP8[ba];HEAP8[d+(3*_&-1)|0]=_a;var ga=f;f=ga+1|0;var Ea=HEAP8[ga];HEAP8[d+((3*_&-1)+1|0)|0]=Ea;var wa=f;f=wa+1|0;var Pa=HEAP8[wa];HEAP8[d+((3*_&-1)+2|0)|0]=Pa,y=y-1|0,_=_+1|0;var Sa=f;f=Sa+1|0;var ka=HEAP8[Sa];HEAP8[d+(3*_&-1)|0]=ka;var Aa=f;f=Aa+1|0;var Ta=HEAP8[Aa];HEAP8[d+((3*_&-1)+1|0)|0]=Ta;var Oa=f;f=Oa+1|0;var La=HEAP8[Oa];HEAP8[d+((3*_&-1)+2|0)|0]=La,y=y-1|0,_=_+1|0,a=273;break;case 277:a=278;break;case 278:if((0|y)>0){a=279;break}var Ca=0;a=280;break;case 279:Ca=(0|_)<(0|u);a=280;break;case 280:if(Ca){a=281;break}a=282;break;case 281:var xa=f;f=xa+1|0;var Ia=HEAP8[xa];HEAP8[d+(3*_&-1)|0]=Ia;var Ha=f;f=Ha+1|0;var Na=HEAP8[Ha];HEAP8[d+((3*_&-1)+1|0)|0]=Na;var Da=f;f=Da+1|0;var Ra=HEAP8[Da];HEAP8[d+((3*_&-1)+2|0)|0]=Ra,y=y-1|0,_=_+1|0,a=278;break;case 283:a=284;break;case 284:if(!!(0|-8&y)){a=285;break}var Fa=0;a=286;break;case 285:Fa=(0|(_+8|0))<(0|u);a=286;break;case 286:if(Fa){a=287;break}a=312;break;case 287:if(!!(0|w)){a=288;break}a=289;break;case 288:var Ua=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ua;var ja=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ja;var Ma=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ma,w=0,a=290;break;case 289:var Ba=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Ba;var Ga=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ga;var Ya=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ya,w=1,y=y+1|0,a=290;break;case 290:if(y=y-1|0,_=_+1|0,!!(0|w)){a=291;break}a=292;break;case 291:var Va=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Va;var za=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=za;var Ka=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ka,w=0,a=293;break;case 292:var qa=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=qa;var Wa=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Wa;var Xa=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Xa,w=1,y=y+1|0,a=293;break;case 293:if(y=y-1|0,_=_+1|0,!!(0|w)){a=294;break}a=295;break;case 294:var Ja=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ja;var Qa=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Qa;var Za=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Za,w=0,a=296;break;case 295:var $a=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=$a;var ei=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ei;var ti=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ti,w=1,y=y+1|0,a=296;break;case 296:if(y=y-1|0,_=_+1|0,!!(0|w)){a=297;break}a=298;break;case 297:var ri=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=ri;var ni=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ni;var oi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=oi,w=0,a=299;break;case 298:var ai=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=ai;var ii=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ii;var ci=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ci,w=1,y=y+1|0,a=299;break;case 299:if(y=y-1|0,_=_+1|0,!!(0|w)){a=300;break}a=301;break;case 300:var si=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=si;var ui=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=ui;var li=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=li,w=0,a=302;break;case 301:var fi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=fi;var pi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=pi;var hi=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=hi,w=1,y=y+1|0,a=302;break;case 302:if(y=y-1|0,_=_+1|0,!!(0|w)){a=303;break}a=304;break;case 303:var di=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=di;var vi=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=vi;var yi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=yi,w=0,a=305;break;case 304:var mi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=mi;var bi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=bi;var _i=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=_i,w=1,y=y+1|0,a=305;break;case 305:if(y=y-1|0,_=_+1|0,!!(0|w)){a=306;break}a=307;break;case 306:var gi=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=gi;var Ei=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ei;var wi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=wi,w=0,a=308;break;case 307:var Pi=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Pi;var Si=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Si;var ki=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=ki,w=1,y=y+1|0,a=308;break;case 308:if(y=y-1|0,_=_+1|0,!!(0|w)){a=309;break}a=310;break;case 309:var Ai=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Ai;var Ti=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ti;var Oi=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Oi,w=0,a=311;break;case 310:var Li=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Li;var Ci=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ci;var xi=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=xi,w=1,y=y+1|0,a=311;break;case 311:y=y-1|0,_=_+1|0,a=284;break;case 312:a=313;break;case 313:if((0|y)>0){a=314;break}var Ii=0;a=315;break;case 314:Ii=(0|_)<(0|u);a=315;break;case 315:if(Ii){a=316;break}a=320;break;case 316:if(!!(0|w)){a=317;break}a=318;break;case 317:var Hi=HEAP8[0|O];HEAP8[d+(3*_&-1)|0]=Hi;var Ni=HEAP8[O+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Ni;var Di=HEAP8[O+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Di,w=0,a=319;break;case 318:var Ri=HEAP8[0|T];HEAP8[d+(3*_&-1)|0]=Ri;var Fi=HEAP8[T+1|0];HEAP8[d+((3*_&-1)+1|0)|0]=Fi;var Ui=HEAP8[T+2|0];HEAP8[d+((3*_&-1)+2|0)|0]=Ui,w=1,y=y+1|0,a=319;break;case 319:y=y-1|0,_=_+1|0,a=313;break;case 321:a=322;break;case 322:if(!!(0|-8&y)){a=323;break}var ji=0;a=324;break;case 323:ji=(0|(_+8|0))<(0|u);a=324;break;case 324:if(ji){a=325;break}a=326;break;case 325:HEAP8[d+(3*_&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,_=_+1|0,a=322;break;case 326:a=327;break;case 327:if((0|y)>0){a=328;break}var Mi=0;a=329;break;case 328:Mi=(0|_)<(0|u);a=329;break;case 329:if(Mi){a=330;break}a=331;break;case 330:HEAP8[d+(3*_&-1)|0]=-1,HEAP8[d+((3*_&-1)+1|0)|0]=-1,HEAP8[d+((3*_&-1)+2|0)|0]=-1,y=y-1|0,_=_+1|0,a=327;break;case 332:a=333;break;case 333:if(!!(0|-8&y)){a=334;break}var Bi=0;a=335;break;case 334:Bi=(0|(_+8|0))<(0|u);a=335;break;case 335:if(Bi){a=336;break}a=337;break;case 336:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,HEAP8[d+(3*(_=_+1|0)&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=333;break;case 337:a=338;break;case 338:if((0|y)>0){a=339;break}var Gi=0;a=340;break;case 339:Gi=(0|_)<(0|u);a=340;break;case 340:if(Gi){a=341;break}a=342;break;case 341:HEAP8[d+(3*_&-1)|0]=0,HEAP8[d+((3*_&-1)+1|0)|0]=0,HEAP8[d+((3*_&-1)+2|0)|0]=0,y=y-1|0,_=_+1|0,a=338;break;case 344:a=34;break;case 345:a=2;break;case 346:c=1,a=347;break;case 347:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _bitmap_decompress_32(e,t,r,n,o,a,i){var c=0,s=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),c=1;;)switch(c){case 1:var u,l,f,p,h,d,v,y,m,b,_,g,E,w;u=e,l=t,f=r,d=a,v=i,m=_bitmap_decompress4(y=_malloc((0|Math_imul(p=n,h=o))<<2),p,h,d,v),b=0,c=2;break;case 2:if((0|b)<(0|f)){c=3;break}c=9;break;case 3:_=0,c=4;break;case 4:if((0|_)<(0|l)){c=5;break}c=7;break;case 5:var P=0|Math_imul(b,p);g=HEAP8[y+((P+_|0)<<2)|0];var S=0|Math_imul(b,p);E=HEAP8[y+(((S+_|0)<<2)+1|0)|0];var k=0|Math_imul(b,p);w=HEAP8[y+(((k+_|0)<<2)+2|0)|0];var A=0|Math_imul(b,p);HEAP8[y+(((A+_|0)<<2)+3|0)|0];var T=-16777216|(255&g)<<16|(255&E)<<8|255&w,O=0|Math_imul(b,l);HEAP32[(u+((O+_|0)<<2)|0)>>2]=T,c=6;break;case 6:_=_+1|0,c=4;break;case 7:c=8;break;case 8:b=b+1|0,c=2;break;case 9:return _free(y),STACKTOP=s,m;default:assert(0,"bad label: "+c)}}function _bitmap_decompress4(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d;s=e,u=t,l=r,p=o;var v=f=n;if(f=v+1|0,16!=(0|255&HEAP8[v])){a=2;break}a=3;break;case 2:c=0,a=4;break;case 3:c=1&(0|p)==(0|(d=(d=(d=(d=(d=1)+(h=_process_plane(f,u,l,s+3|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,s+2|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,s+1|0,p-d|0))|0)+(h=_process_plane(f=f+h|0,u,l,0|s,p-d|0))|0)),a=4;break;case 4:return STACKTOP=i,c;default:assert(0,"bad label: "+a)}}function _process_plane(e,t,r,n,o){var a=0,i=STACKTOP;for(assert((0|STACKTOP)<(0|STACK_MAX)),a=1;;)switch(a){case 1:var c,s,u,l,f,p,h,d,v,y,m,b,_,g,E,w;s=t,u=r,E=c=e,w=l=n,_=0,p=0,a=2;break;case 2:if((0|p)<(0|u)){a=3;break}a=34;break;case 3:if(y=0,g=l=(w+((0|Math_imul(s,u))<<2)|0)+(0|-((0|Math_imul(p+1|0,s))<<2))|0,f=0,!(0|_)){a=4;break}a=17;break;case 4:case 15:a=5;break;case 5:if((0|f)<(0|s)){a=6;break}a=16;break;case 6:var P=c;if(c=P+1|0,(0|(b=(v=15&(h=255&HEAP8[P]))<<4|(d=15&h>>4)))<=47){a=7;break}a=9;break;case 7:if((0|b)>=16){a=8;break}a=9;break;case 8:v=b,d=0,a=9;break;case 9:a=10;break;case 10:if((0|d)>0){a=11;break}a=12;break;case 11:var S=c;c=S+1|0;var k=255&(y=255&HEAP8[S]);HEAP8[l]=k,l=l+4|0,f=f+1|0,d=d-1|0,a=10;break;case 12:a=13;break;case 13:if((0|v)>0){a=14;break}a=15;break;case 14:var A=255&y;HEAP8[l]=A,l=l+4|0,f=f+1|0,v=v-1|0,a=13;break;case 16:case 32:a=33;break;case 17:case 31:a=18;break;case 18:if((0|f)<(0|s)){a=19;break}a=32;break;case 19:var T=c;if(c=T+1|0,(0|(b=(v=15&(h=255&HEAP8[T]))<<4|(d=15&h>>4)))<=47){a=20;break}a=22;break;case 20:if((0|b)>=16){a=21;break}a=22;break;case 21:v=b,d=0,a=22;break;case 22:a=23;break;case 23:if((0|d)>0){a=24;break}a=28;break;case 24:var O=c;if(c=O+1|0,!!(0|1&(m=255&HEAP8[O]))){a=25;break}a=26;break;case 25:y=0|-(m=(m=m>>1)+1|0),a=27;break;case 26:y=m=m>>1,a=27;break;case 27:var L=255&(m=(255&HEAP8[_+(f<<2)|0])+y|0);HEAP8[l]=L,l=l+4|0,f=f+1|0,d=d-1|0,a=23;break;case 28:a=29;break;case 29:if((0|v)>0){a=30;break}a=31;break;case 30:var C=255&(m=(255&HEAP8[_+(f<<2)|0])+y|0);HEAP8[l]=C,l=l+4|0,f=f+1|0,v=v-1|0,a=29;break;case 33:p=p+1|0,_=g,a=2;break;case 34:return STACKTOP=i,c-E|0;default:assert(0,"bad label: "+a)}}function _malloc(e){var t=0;for(t=1;;)switch(t){case 1:if(e>>>0<245){t=2;break}t=78;break;case 2:if(e>>>0<11){var r=16;t=4;break}t=3;break;case 3:r=-8&(e+11|0);t=4;break;case 4:var n=r>>>3,o=HEAP32[10],a=o>>>(n>>>0);if(!(0|3&a)){t=12;break}t=5;break;case 5:var i=(1^1&a)+n|0,c=i<<1,s=80+(c<<2)|0,u=80+((c+2|0)<<2)|0,l=HEAP32[u>>2],f=l+8|0,p=HEAP32[f>>2];if((0|s)==(0|p)){t=6;break}t=7;break;case 6:var h=o&~(1<<i);HEAP32[10]=h,t=11;break;case 7:if(p>>>0<HEAP32[14]>>>0){t=10;break}t=8;break;case 8:var d=p+12|0;if((0|HEAP32[d>>2])==(0|l)){t=9;break}t=10;break;case 9:HEAP32[d>>2]=s,HEAP32[u>>2]=p,t=11;break;case 10:case 19:case 24:case 39:case 46:case 55:case 61:case 65:case 66:case 73:case 76:case 105:case 112:case 121:case 127:case 131:case 132:case 139:case 154:case 157:case 158:case 169:case 244:case 245:case 251:case 258:case 267:case 273:case 277:case 278:case 284:case 299:case 302:case 319:case 334:case 337:throw _abort(),"Reached an unreachable!";case 11:var v=i<<3,y=3|v;HEAP32[(l+4|0)>>2]=y;var m=l+(4|v)|0,b=1|HEAP32[m>>2];HEAP32[m>>2]=b;var _=f;t=341;break;case 12:if(r>>>0>HEAP32[12]>>>0){t=13;break}var g=r;t=160;break;case 13:if(!(0|a)){t=27;break}t=14;break;case 14:var E=2<<n,w=a<<n&(E|(0|-E)),P=(w&(0|-w))-1|0,S=16&P>>>12,k=P>>>(S>>>0),A=8&k>>>5,T=k>>>(A>>>0),O=4&T>>>2,L=T>>>(O>>>0),C=2&L>>>1,x=L>>>(C>>>0),I=1&x>>>1,H=(A|S|O|C|I)+(x>>>(I>>>0))|0,N=H<<1,D=80+(N<<2)|0,R=80+((N+2|0)<<2)|0,F=HEAP32[R>>2],U=F+8|0,j=HEAP32[U>>2];if((0|D)==(0|j)){t=15;break}t=16;break;case 15:var M=o&~(1<<H);HEAP32[10]=M,t=20;break;case 16:if(j>>>0<HEAP32[14]>>>0){t=19;break}t=17;break;case 17:var B=j+12|0;if((0|HEAP32[B>>2])==(0|F)){t=18;break}t=19;break;case 18:HEAP32[B>>2]=D,HEAP32[R>>2]=j,t=20;break;case 20:var G=H<<3,Y=G-r|0,V=3|r;HEAP32[(F+4|0)>>2]=V;var z=F,K=z+r|0,q=1|Y;HEAP32[(z+(4|r)|0)>>2]=q,HEAP32[(z+G|0)>>2]=Y;var W=HEAP32[12];if(!(0|W)){t=26;break}t=21;break;case 21:var X=HEAP32[15],J=W>>>3,Q=J<<1,Z=80+(Q<<2)|0,$=HEAP32[10],ee=1<<J;if(!(0|$&ee)){t=22;break}t=23;break;case 22:var te=$|ee;HEAP32[10]=te;var re=Z,ne=80+((Q+2|0)<<2)|0;t=25;break;case 23:var oe=80+((Q+2|0)<<2)|0,ae=HEAP32[oe>>2];if(ae>>>0<HEAP32[14]>>>0){t=24;break}re=ae,ne=oe;t=25;break;case 25:HEAP32[ne>>2]=X,HEAP32[(re+12|0)>>2]=X,HEAP32[(X+8|0)>>2]=re,HEAP32[(X+12|0)>>2]=Z,t=26;break;case 26:HEAP32[12]=Y,HEAP32[15]=K;_=U;t=341;break;case 27:var ie=HEAP32[11];if(!(0|ie)){g=r;t=160;break}t=28;break;case 28:var ce=(ie&(0|-ie))-1|0,se=16&ce>>>12,ue=ce>>>(se>>>0),le=8&ue>>>5,fe=ue>>>(le>>>0),pe=4&fe>>>2,he=fe>>>(pe>>>0),de=2&he>>>1,ve=he>>>(de>>>0),ye=1&ve>>>1,me=HEAP32[(344+(((le|se|pe|de|ye)+(ve>>>(ye>>>0))|0)<<2)|0)>>2],be=me,_e=me,ge=(-8&HEAP32[(me+4|0)>>2])-r|0;t=29;break;case 29:var Ee=HEAP32[(be+16|0)>>2];if(!(0|Ee)){t=30;break}var we=Ee;t=31;break;case 30:var Pe=HEAP32[(be+20|0)>>2];if(!(0|Pe)){t=32;break}we=Pe;t=31;break;case 31:var Se=(-8&HEAP32[(we+4|0)>>2])-r|0,ke=Se>>>0<ge>>>0;be=we,_e=ke?we:_e,ge=ke?Se:ge;t=29;break;case 32:var Ae=_e,Te=HEAP32[14];if(Ae>>>0<Te>>>0){t=76;break}t=33;break;case 33:var Oe=Ae+r|0,Le=Oe;if(Ae>>>0<Oe>>>0){t=34;break}t=76;break;case 34:var Ce=HEAP32[(_e+24|0)>>2],xe=HEAP32[(_e+12|0)>>2];if((0|xe)==(0|_e)){t=40;break}t=35;break;case 35:var Ie=HEAP32[(_e+8|0)>>2];if(Ie>>>0<Te>>>0){t=39;break}t=36;break;case 36:var He=Ie+12|0;if((0|HEAP32[He>>2])==(0|_e)){t=37;break}t=39;break;case 37:var Ne=xe+8|0;if((0|HEAP32[Ne>>2])==(0|_e)){t=38;break}t=39;break;case 38:HEAP32[He>>2]=xe,HEAP32[Ne>>2]=Ie;var De=xe;t=47;break;case 40:var Re=_e+20|0,Fe=HEAP32[Re>>2];if(!(0|Fe)){t=41;break}var Ue=Fe,je=Re;t=42;break;case 41:var Me=_e+16|0,Be=HEAP32[Me>>2];if(!(0|Be)){De=0;t=47;break}Ue=Be,je=Me;t=42;break;case 42:var Ge=Ue+20|0,Ye=HEAP32[Ge>>2];if(!(0|Ye)){t=43;break}Ue=Ye,je=Ge;t=42;break;case 43:var Ve=Ue+16|0,ze=HEAP32[Ve>>2];if(!(0|ze)){t=44;break}Ue=ze,je=Ve;t=42;break;case 44:if(je>>>0<Te>>>0){t=46;break}t=45;break;case 45:HEAP32[je>>2]=0;De=Ue;t=47;break;case 47:if(!(0|Ce)){t=67;break}t=48;break;case 48:var Ke=_e+28|0,qe=344+(HEAP32[Ke>>2]<<2)|0;if((0|_e)==(0|HEAP32[qe>>2])){t=49;break}t=51;break;case 49:if(HEAP32[qe>>2]=De,!(0|De)){t=50;break}t=57;break;case 50:var We=~(1<<HEAP32[Ke>>2]),Xe=HEAP32[11]&We;HEAP32[11]=Xe,t=67;break;case 51:if(Ce>>>0<HEAP32[14]>>>0){t=55;break}t=52;break;case 52:var Je=Ce+16|0;if((0|HEAP32[Je>>2])==(0|_e)){t=53;break}t=54;break;case 53:HEAP32[Je>>2]=De,t=56;break;case 54:HEAP32[(Ce+20|0)>>2]=De,t=56;break;case 56:if(!(0|De)){t=67;break}t=57;break;case 57:if(De>>>0<HEAP32[14]>>>0){t=66;break}t=58;break;case 58:HEAP32[(De+24|0)>>2]=Ce;var Qe=HEAP32[(_e+16|0)>>2];if(!(0|Qe)){t=62;break}t=59;break;case 59:if(Qe>>>0<HEAP32[14]>>>0){t=61;break}t=60;break;case 60:HEAP32[(De+16|0)>>2]=Qe,HEAP32[(Qe+24|0)>>2]=De,t=62;break;case 62:var Ze=HEAP32[(_e+20|0)>>2];if(!(0|Ze)){t=67;break}t=63;break;case 63:if(Ze>>>0<HEAP32[14]>>>0){t=65;break}t=64;break;case 64:HEAP32[(De+20|0)>>2]=Ze,HEAP32[(Ze+24|0)>>2]=De,t=67;break;case 67:if(ge>>>0<16){t=68;break}t=69;break;case 68:var $e=ge+r|0,et=3|$e;HEAP32[(_e+4|0)>>2]=et;var tt=Ae+($e+4|0)|0,rt=1|HEAP32[tt>>2];HEAP32[tt>>2]=rt,t=77;break;case 69:var nt=3|r;HEAP32[(_e+4|0)>>2]=nt;var ot=1|ge;HEAP32[(Ae+(4|r)|0)>>2]=ot,HEAP32[(Ae+(ge+r|0)|0)>>2]=ge;var at=HEAP32[12];if(!(0|at)){t=75;break}t=70;break;case 70:var it=HEAP32[15],ct=at>>>3,st=ct<<1,ut=80+(st<<2)|0,lt=HEAP32[10],ft=1<<ct;if(!(0|lt&ft)){t=71;break}t=72;break;case 71:var pt=lt|ft;HEAP32[10]=pt;var ht=ut,dt=80+((st+2|0)<<2)|0;t=74;break;case 72:var vt=80+((st+2|0)<<2)|0,yt=HEAP32[vt>>2];if(yt>>>0<HEAP32[14]>>>0){t=73;break}ht=yt,dt=vt;t=74;break;case 74:HEAP32[dt>>2]=it,HEAP32[(ht+12|0)>>2]=it,HEAP32[(it+8|0)>>2]=ht,HEAP32[(it+12|0)>>2]=ut,t=75;break;case 75:HEAP32[12]=ge,HEAP32[15]=Le,t=77;break;case 77:_=_e+8|0;t=341;break;case 78:if(e>>>0>4294967231){g=-1;t=160;break}t=79;break;case 79:var mt=e+11|0,bt=-8&mt,_t=HEAP32[11];if(!(0|_t)){g=bt;t=160;break}t=80;break;case 80:var gt=0|-bt,Et=mt>>>8;if(!(0|Et)){var wt=0;t=83;break}t=81;break;case 81:if(bt>>>0>16777215){wt=31;t=83;break}t=82;break;case 82:var Pt=8&(Et+1048320|0)>>>16,St=Et<<Pt,kt=4&(St+520192|0)>>>16,At=St<<kt,Tt=2&(At+245760|0)>>>16,Ot=(14-(kt|Pt|Tt)|0)+(At<<Tt>>>15)|0;wt=1&bt>>>((Ot+7|0)>>>0)|Ot<<1;t=83;break;case 83:var Lt=HEAP32[(344+(wt<<2)|0)>>2];if(!(0|Lt)){var Ct=0,xt=gt,It=0;t=90;break}t=84;break;case 84:if(31==(0|wt)){var Ht=0;t=86;break}t=85;break;case 85:Ht=25-(wt>>>1)|0;t=86;break;case 86:var Nt=0,Dt=gt,Rt=Lt,Ft=bt<<Ht,Ut=0;t=87;break;case 87:var jt=-8&HEAP32[(Rt+4|0)>>2],Mt=jt-bt|0;if(Mt>>>0<Dt>>>0){t=88;break}var Bt=Nt,Gt=Dt;t=89;break;case 88:if((0|jt)==(0|bt)){Ct=Rt,xt=Mt,It=Rt;t=90;break}Bt=Rt,Gt=Mt;t=89;break;case 89:var Yt=HEAP32[(Rt+20|0)>>2],Vt=HEAP32[(Rt+16+(Ft>>>31<<2)|0)>>2],zt=!(0|Yt)|(0|Yt)==(0|Vt)?Ut:Yt,Kt=Ft<<1;if(!(0|Vt)){Ct=Bt,xt=Gt,It=zt;t=90;break}Nt=Bt,Dt=Gt,Rt=Vt,Ft=Kt,Ut=zt;t=87;break;case 90:if(!(0|It)&!(0|Ct)){t=91;break}var qt=It;t=93;break;case 91:var Wt=2<<wt,Xt=_t&(Wt|(0|-Wt));if(!(0|Xt)){g=bt;t=160;break}t=92;break;case 92:var Jt=(Xt&(0|-Xt))-1|0,Qt=16&Jt>>>12,Zt=Jt>>>(Qt>>>0),$t=8&Zt>>>5,er=Zt>>>($t>>>0),tr=4&er>>>2,rr=er>>>(tr>>>0),nr=2&rr>>>1,or=rr>>>(nr>>>0),ar=1&or>>>1;qt=HEAP32[(344+((($t|Qt|tr|nr|ar)+(or>>>(ar>>>0))|0)<<2)|0)>>2];t=93;break;case 93:if(!(0|qt)){var ir=xt,cr=Ct;t=96;break}var sr=qt,ur=xt,lr=Ct;t=94;break;case 94:var fr=(-8&HEAP32[(sr+4|0)>>2])-bt|0,pr=fr>>>0<ur>>>0,hr=pr?fr:ur,dr=pr?sr:lr,vr=HEAP32[(sr+16|0)>>2];if(!(0|vr)){t=95;break}sr=vr,ur=hr,lr=dr;t=94;break;case 95:var yr=HEAP32[(sr+20|0)>>2];if(!(0|yr)){ir=hr,cr=dr;t=96;break}sr=yr,ur=hr,lr=dr;t=94;break;case 96:if(!(0|cr)){g=bt;t=160;break}t=97;break;case 97:if(ir>>>0<(HEAP32[12]-bt|0)>>>0){t=98;break}g=bt;t=160;break;case 98:var mr=cr,br=HEAP32[14];if(mr>>>0<br>>>0){t=158;break}t=99;break;case 99:var _r=mr+bt|0,gr=_r;if(mr>>>0<_r>>>0){t=100;break}t=158;break;case 100:var Er=HEAP32[(cr+24|0)>>2],wr=HEAP32[(cr+12|0)>>2];if((0|wr)==(0|cr)){t=106;break}t=101;break;case 101:var Pr=HEAP32[(cr+8|0)>>2];if(Pr>>>0<br>>>0){t=105;break}t=102;break;case 102:var Sr=Pr+12|0;if((0|HEAP32[Sr>>2])==(0|cr)){t=103;break}t=105;break;case 103:var kr=wr+8|0;if((0|HEAP32[kr>>2])==(0|cr)){t=104;break}t=105;break;case 104:HEAP32[Sr>>2]=wr,HEAP32[kr>>2]=Pr;var Ar=wr;t=113;break;case 106:var Tr=cr+20|0,Or=HEAP32[Tr>>2];if(!(0|Or)){t=107;break}var Lr=Or,Cr=Tr;t=108;break;case 107:var xr=cr+16|0,Ir=HEAP32[xr>>2];if(!(0|Ir)){Ar=0;t=113;break}Lr=Ir,Cr=xr;t=108;break;case 108:var Hr=Lr+20|0,Nr=HEAP32[Hr>>2];if(!(0|Nr)){t=109;break}Lr=Nr,Cr=Hr;t=108;break;case 109:var Dr=Lr+16|0,Rr=HEAP32[Dr>>2];if(!(0|Rr)){t=110;break}Lr=Rr,Cr=Dr;t=108;break;case 110:if(Cr>>>0<br>>>0){t=112;break}t=111;break;case 111:HEAP32[Cr>>2]=0;Ar=Lr;t=113;break;case 113:if(!(0|Er)){t=133;break}t=114;break;case 114:var Fr=cr+28|0,Ur=344+(HEAP32[Fr>>2]<<2)|0;if((0|cr)==(0|HEAP32[Ur>>2])){t=115;break}t=117;break;case 115:if(HEAP32[Ur>>2]=Ar,!(0|Ar)){t=116;break}t=123;break;case 116:var jr=~(1<<HEAP32[Fr>>2]),Mr=HEAP32[11]&jr;HEAP32[11]=Mr,t=133;break;case 117:if(Er>>>0<HEAP32[14]>>>0){t=121;break}t=118;break;case 118:var Br=Er+16|0;if((0|HEAP32[Br>>2])==(0|cr)){t=119;break}t=120;break;case 119:HEAP32[Br>>2]=Ar,t=122;break;case 120:HEAP32[(Er+20|0)>>2]=Ar,t=122;break;case 122:if(!(0|Ar)){t=133;break}t=123;break;case 123:if(Ar>>>0<HEAP32[14]>>>0){t=132;break}t=124;break;case 124:HEAP32[(Ar+24|0)>>2]=Er;var Gr=HEAP32[(cr+16|0)>>2];if(!(0|Gr)){t=128;break}t=125;break;case 125:if(Gr>>>0<HEAP32[14]>>>0){t=127;break}t=126;break;case 126:HEAP32[(Ar+16|0)>>2]=Gr,HEAP32[(Gr+24|0)>>2]=Ar,t=128;break;case 128:var Yr=HEAP32[(cr+20|0)>>2];if(!(0|Yr)){t=133;break}t=129;break;case 129:if(Yr>>>0<HEAP32[14]>>>0){t=131;break}t=130;break;case 130:HEAP32[(Ar+20|0)>>2]=Yr,HEAP32[(Yr+24|0)>>2]=Ar,t=133;break;case 133:if(ir>>>0<16){t=134;break}t=135;break;case 134:var Vr=ir+bt|0,zr=3|Vr;HEAP32[(cr+4|0)>>2]=zr;var Kr=mr+(Vr+4|0)|0,qr=1|HEAP32[Kr>>2];HEAP32[Kr>>2]=qr,t=159;break;case 135:var Wr=3|bt;HEAP32[(cr+4|0)>>2]=Wr;var Xr=1|ir;HEAP32[(mr+(4|bt)|0)>>2]=Xr,HEAP32[(mr+(ir+bt|0)|0)>>2]=ir;var Jr=ir>>>3;if(ir>>>0<256){t=136;break}t=141;break;case 136:var Qr=Jr<<1,Zr=80+(Qr<<2)|0,$r=HEAP32[10],en=1<<Jr;if(!(0|$r&en)){t=137;break}t=138;break;case 137:var tn=$r|en;HEAP32[10]=tn;var rn=Zr,nn=80+((Qr+2|0)<<2)|0;t=140;break;case 138:var on=80+((Qr+2|0)<<2)|0,an=HEAP32[on>>2];if(an>>>0<HEAP32[14]>>>0){t=139;break}rn=an,nn=on;t=140;break;case 140:HEAP32[nn>>2]=gr,HEAP32[(rn+12|0)>>2]=gr,HEAP32[(mr+(bt+8|0)|0)>>2]=rn,HEAP32[(mr+(bt+12|0)|0)>>2]=Zr,t=159;break;case 141:var cn=_r,sn=ir>>>8;if(!(0|sn)){var un=0;t=144;break}t=142;break;case 142:if(ir>>>0>16777215){un=31;t=144;break}t=143;break;case 143:var ln=8&(sn+1048320|0)>>>16,fn=sn<<ln,pn=4&(fn+520192|0)>>>16,hn=fn<<pn,dn=2&(hn+245760|0)>>>16,vn=(14-(pn|ln|dn)|0)+(hn<<dn>>>15)|0;un=1&ir>>>((vn+7|0)>>>0)|vn<<1;t=144;break;case 144:var yn=344+(un<<2)|0;HEAP32[(mr+(bt+28|0)|0)>>2]=un;var mn=mr+(bt+16|0)|0;HEAP32[(mr+(bt+20|0)|0)>>2]=0,HEAP32[mn>>2]=0;var bn=HEAP32[11],_n=1<<un;if(!(0|bn&_n)){t=145;break}t=146;break;case 145:var gn=bn|_n;HEAP32[11]=gn,HEAP32[yn>>2]=cn;var En=yn;HEAP32[(mr+(bt+24|0)|0)>>2]=En,HEAP32[(mr+(bt+12|0)|0)>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=cn,t=159;break;case 146:var wn=HEAP32[yn>>2];if(31==(0|un)){var Pn=0;t=148;break}t=147;break;case 147:Pn=25-(un>>>1)|0;t=148;break;case 148:if((0|-8&HEAP32[(wn+4|0)>>2])==(0|ir)){var Sn=wn;t=155;break}t=149;break;case 149:var kn=wn,An=ir<<Pn;t=151;break;case 150:var Tn=An<<1;if((0|-8&HEAP32[(Ln+4|0)>>2])==(0|ir)){Sn=Ln;t=155;break}kn=Ln,An=Tn;t=151;break;case 151:var On=kn+16+(An>>>31<<2)|0,Ln=HEAP32[On>>2];if(!(0|Ln)){t=152;break}t=150;break;case 152:if(On>>>0<HEAP32[14]>>>0){t=154;break}t=153;break;case 153:HEAP32[On>>2]=cn,HEAP32[(mr+(bt+24|0)|0)>>2]=kn,HEAP32[(mr+(bt+12|0)|0)>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=cn,t=159;break;case 155:var Cn=Sn+8|0,xn=HEAP32[Cn>>2],In=Sn,Hn=HEAP32[14];if(In>>>0>=Hn>>>0&xn>>>0>=Hn>>>0){t=156;break}t=157;break;case 156:HEAP32[(xn+12|0)>>2]=cn,HEAP32[Cn>>2]=cn,HEAP32[(mr+(bt+8|0)|0)>>2]=xn,HEAP32[(mr+(bt+12|0)|0)>>2]=Sn,HEAP32[(mr+(bt+24|0)|0)>>2]=0,t=159;break;case 159:_=cr+8|0;t=341;break;case 160:var Nn=HEAP32[12];if(Nn>>>0<g>>>0){t=165;break}t=161;break;case 161:var Dn=Nn-g|0,Rn=HEAP32[15];if(Dn>>>0>15){t=162;break}t=163;break;case 162:var Fn=Rn,Un=Fn+g|0;HEAP32[15]=Un,HEAP32[12]=Dn;var jn=1|Dn;HEAP32[(Fn+(g+4|0)|0)>>2]=jn,HEAP32[(Fn+Nn|0)>>2]=Dn;var Mn=3|g;HEAP32[(Rn+4|0)>>2]=Mn,t=164;break;case 163:HEAP32[12]=0,HEAP32[15]=0;var Bn=3|Nn;HEAP32[(Rn+4|0)>>2]=Bn;var Gn=Rn+(Nn+4|0)|0,Yn=1|HEAP32[Gn>>2];HEAP32[Gn>>2]=Yn,t=164;break;case 164:_=Rn+8|0;t=341;break;case 165:var Vn=HEAP32[13];if(Vn>>>0>g>>>0){t=166;break}t=167;break;case 166:var zn=Vn-g|0;HEAP32[13]=zn;var Kn=HEAP32[16],qn=Kn,Wn=qn+g|0;HEAP32[16]=Wn;var Xn=1|zn;HEAP32[(qn+(g+4|0)|0)>>2]=Xn;var Jn=3|g;HEAP32[(Kn+4|0)>>2]=Jn;_=Kn+8|0;t=341;break;case 167:if(!(0|HEAP32[4])){t=168;break}t=171;break;case 168:var Qn=_sysconf(30);if(!(0|(Qn-1|0)&Qn)){t=170;break}t=169;break;case 170:HEAP32[6]=Qn,HEAP32[5]=Qn,HEAP32[7]=-1,HEAP32[8]=-1,HEAP32[9]=0,HEAP32[121]=0;var Zn=1431655768^-16&_time(0);HEAP32[4]=Zn,t=171;break;case 171:var $n=g+48|0,eo=HEAP32[6],to=g+47|0,ro=eo+to|0,no=0|-eo,oo=ro&no;if(oo>>>0>g>>>0){t=172;break}_=0;t=341;break;case 172:var ao=HEAP32[120];if(!(0|ao)){t=174;break}t=173;break;case 173:var io=HEAP32[118],co=io+oo|0;if(co>>>0<=io>>>0|co>>>0>ao>>>0){_=0;t=341;break}t=174;break;case 174:if(!(0|4&HEAP32[121])){t=175;break}var so=0;t=198;break;case 175:var uo=HEAP32[16];if(!(0|uo)){t=181;break}t=176;break;case 176:var lo=uo,fo=488;t=177;break;case 177:var po=0|fo,ho=HEAP32[po>>2];if(ho>>>0>lo>>>0){t=179;break}t=178;break;case 178:var vo=fo+4|0;if((ho+HEAP32[vo>>2]|0)>>>0>lo>>>0){t=180;break}t=179;break;case 179:var yo=HEAP32[(fo+8|0)>>2];if(!(0|yo)){t=181;break}fo=yo;t=177;break;case 180:if(!(0|fo)){t=181;break}t=188;break;case 181:var mo=_sbrk(0);if(-1==(0|mo)){var bo=0;t=197;break}t=182;break;case 182:var _o=mo,go=HEAP32[5],Eo=go-1|0;if(!(0|Eo&_o)){var wo=oo;t=184;break}t=183;break;case 183:wo=(oo-_o|0)+((Eo+_o|0)&(0|-go))|0;t=184;break;case 184:var Po=HEAP32[118],So=Po+wo|0;if(wo>>>0>g>>>0&wo>>>0<2147483647){t=185;break}bo=0;t=197;break;case 185:var ko=HEAP32[120];if(!(0|ko)){t=187;break}t=186;break;case 186:if(So>>>0<=Po>>>0|So>>>0>ko>>>0){bo=0;t=197;break}t=187;break;case 187:var Ao=_sbrk(wo);if((0|Ao)==(0|mo)){var To=mo,Oo=wo;t=190;break}var Lo=wo,Co=Ao;t=191;break;case 188:var xo=(ro-HEAP32[13]|0)&no;if(xo>>>0<2147483647){t=189;break}bo=0;t=197;break;case 189:var Io=_sbrk(xo);if((0|Io)==(0|(HEAP32[po>>2]+HEAP32[vo>>2]|0))){To=Io,Oo=xo;t=190;break}Lo=xo,Co=Io;t=191;break;case 190:if(-1==(0|To)){bo=Oo;t=197;break}var Ho=Oo,No=To;t=201;break;case 191:var Do=0|-Lo;if(-1!=(0|Co)&Lo>>>0<2147483647&$n>>>0>Lo>>>0){t=192;break}var Ro=Lo;t=196;break;case 192:var Fo=HEAP32[6],Uo=((to-Lo|0)+Fo|0)&(0|-Fo);if(Uo>>>0<2147483647){t=193;break}Ro=Lo;t=196;break;case 193:if(-1==(0|_sbrk(Uo))){t=195;break}t=194;break;case 194:Ro=Uo+Lo|0;t=196;break;case 195:_sbrk(Do),bo=0;t=197;break;case 196:if(-1==(0|Co)){bo=0;t=197;break}Ho=Ro,No=Co;t=201;break;case 197:var jo=4|HEAP32[121];HEAP32[121]=jo;so=bo;t=198;break;case 198:if(oo>>>0<2147483647){t=199;break}t=340;break;case 199:var Mo=_sbrk(oo),Bo=_sbrk(0);if(-1!=(0|Mo)&-1!=(0|Bo)&Mo>>>0<Bo>>>0){t=200;break}t=340;break;case 200:var Go=Bo-Mo|0,Yo=Go>>>0>(g+40|0)>>>0;if(Yo){Ho=Yo?Go:so,No=Mo;t=201;break}t=340;break;case 201:var Vo=HEAP32[118]+Ho|0;if(HEAP32[118]=Vo,Vo>>>0>HEAP32[119]>>>0){t=202;break}t=203;break;case 202:HEAP32[119]=Vo,t=203;break;case 203:var zo=HEAP32[16];if(!(0|zo)){t=204;break}var Ko=488;t=211;break;case 204:var qo=HEAP32[14];if(!(0|qo)|No>>>0<qo>>>0){t=205;break}t=206;break;case 205:HEAP32[14]=No,t=206;break;case 206:HEAP32[122]=No,HEAP32[123]=Ho,HEAP32[125]=0;var Wo=HEAP32[4];HEAP32[19]=Wo,HEAP32[18]=-1;var Xo=0;t=207;break;case 207:var Jo=Xo<<1,Qo=80+(Jo<<2)|0;HEAP32[(80+((Jo+3|0)<<2)|0)>>2]=Qo,HEAP32[(80+((Jo+2|0)<<2)|0)>>2]=Qo;var Zo=Xo+1|0;if(Zo>>>0<32){Xo=Zo;t=207;break}t=208;break;case 208:var $o=Ho-40|0,ea=No+8|0;if(!(0|7&ea)){var ta=0;t=210;break}t=209;break;case 209:ta=7&(0|-ea);t=210;break;case 210:var ra=No+ta|0,na=$o-ta|0;HEAP32[16]=ra,HEAP32[13]=na;var oa=1|na;HEAP32[(No+(ta+4|0)|0)>>2]=oa,HEAP32[(No+(Ho-36|0)|0)>>2]=40;var aa=HEAP32[8];HEAP32[17]=aa,t=338;break;case 211:var ia=HEAP32[(0|Ko)>>2],ca=Ko+4|0,sa=HEAP32[ca>>2];if((0|No)==(0|(ia+sa|0))){t=213;break}t=212;break;case 212:var ua=HEAP32[(Ko+8|0)>>2];if(!(0|ua)){t=218;break}Ko=ua;t=211;break;case 213:if(!(0|8&HEAP32[(Ko+12|0)>>2])){t=214;break}t=218;break;case 214:if(zo>>>0>=ia>>>0&zo>>>0<No>>>0){t=215;break}t=218;break;case 215:var la=sa+Ho|0;HEAP32[ca>>2]=la;var fa=HEAP32[16],pa=HEAP32[13]+Ho|0,ha=fa,da=fa+8|0;if(!(0|7&da)){var va=0;t=217;break}t=216;break;case 216:va=7&(0|-da);t=217;break;case 217:var ya=ha+va|0,ma=pa-va|0;HEAP32[16]=ya,HEAP32[13]=ma;var ba=1|ma;HEAP32[(ha+(va+4|0)|0)>>2]=ba,HEAP32[(ha+(pa+4|0)|0)>>2]=40;var _a=HEAP32[8];HEAP32[17]=_a,t=338;break;case 218:if(No>>>0<HEAP32[14]>>>0){t=219;break}t=220;break;case 219:HEAP32[14]=No,t=220;break;case 220:var ga=No+Ho|0,Ea=488;t=221;break;case 221:var wa=0|Ea;if((0|HEAP32[wa>>2])==(0|ga)){t=223;break}t=222;break;case 222:var Pa=HEAP32[(Ea+8|0)>>2];if(!(0|Pa)){t=304;break}Ea=Pa;t=221;break;case 223:if(!(0|8&HEAP32[(Ea+12|0)>>2])){t=224;break}t=304;break;case 224:HEAP32[wa>>2]=No;var Sa=Ea+4|0,ka=HEAP32[Sa>>2]+Ho|0;HEAP32[Sa>>2]=ka;var Aa=No+8|0;if(!(0|7&Aa)){var Ta=0;t=226;break}t=225;break;case 225:Ta=7&(0|-Aa);t=226;break;case 226:var Oa=No+Ta|0,La=No+(Ho+8|0)|0;if(!(0|7&La)){var Ca=0;t=228;break}t=227;break;case 227:Ca=7&(0|-La);t=228;break;case 228:var xa=No+(Ca+Ho|0)|0,Ia=xa,Ha=Ta+g|0,Na=No+Ha|0,Da=Na,Ra=(xa-Oa|0)-g|0,Fa=3|g;if(HEAP32[(No+(Ta+4|0)|0)>>2]=Fa,(0|Ia)==(0|HEAP32[16])){t=229;break}t=230;break;case 229:var Ua=HEAP32[13]+Ra|0;HEAP32[13]=Ua,HEAP32[16]=Da;var ja=1|Ua;HEAP32[(No+(Ha+4|0)|0)>>2]=ja,t=303;break;case 230:if((0|Ia)==(0|HEAP32[15])){t=231;break}t=232;break;case 231:var Ma=HEAP32[12]+Ra|0;HEAP32[12]=Ma,HEAP32[15]=Da;var Ba=1|Ma;HEAP32[(No+(Ha+4|0)|0)>>2]=Ba,HEAP32[(No+(Ma+Ha|0)|0)>>2]=Ma,t=303;break;case 232:var Ga=Ho+4|0,Ya=HEAP32[(No+(Ga+Ca|0)|0)>>2];if(1==(0|3&Ya)){t=233;break}var Va=Ia,za=Ra;t=280;break;case 233:var Ka=-8&Ya,qa=Ya>>>3;if(Ya>>>0<256){t=234;break}t=246;break;case 234:var Wa=HEAP32[(No+((8|Ca)+Ho|0)|0)>>2],Xa=HEAP32[(No+((Ho+12|0)+Ca|0)|0)>>2],Ja=80+(qa<<1<<2)|0;if((0|Wa)==(0|Ja)){t=237;break}t=235;break;case 235:if(Wa>>>0<HEAP32[14]>>>0){t=245;break}t=236;break;case 236:if((0|HEAP32[(Wa+12|0)>>2])==(0|Ia)){t=237;break}t=245;break;case 237:if((0|Xa)==(0|Wa)){t=238;break}t=239;break;case 238:var Qa=~(1<<qa),Za=HEAP32[10]&Qa;HEAP32[10]=Za,t=279;break;case 239:if((0|Xa)==(0|Ja)){t=240;break}t=241;break;case 240:var $a=Xa+8|0;t=243;break;case 241:if(Xa>>>0<HEAP32[14]>>>0){t=244;break}t=242;break;case 242:var ei=Xa+8|0;if((0|HEAP32[ei>>2])==(0|Ia)){$a=ei;t=243;break}t=244;break;case 243:HEAP32[(Wa+12|0)>>2]=Xa,HEAP32[$a>>2]=Wa,t=279;break;case 246:var ti=xa,ri=HEAP32[(No+((24|Ca)+Ho|0)|0)>>2],ni=HEAP32[(No+((Ho+12|0)+Ca|0)|0)>>2];if((0|ni)==(0|ti)){t=252;break}t=247;break;case 247:var oi=HEAP32[(No+((8|Ca)+Ho|0)|0)>>2];if(oi>>>0<HEAP32[14]>>>0){t=251;break}t=248;break;case 248:var ai=oi+12|0;if((0|HEAP32[ai>>2])==(0|ti)){t=249;break}t=251;break;case 249:var ii=ni+8|0;if((0|HEAP32[ii>>2])==(0|ti)){t=250;break}t=251;break;case 250:HEAP32[ai>>2]=ni,HEAP32[ii>>2]=oi;var ci=ni;t=259;break;case 252:var si=16|Ca,ui=No+(Ga+si|0)|0,li=HEAP32[ui>>2];if(!(0|li)){t=253;break}var fi=li,pi=ui;t=254;break;case 253:var hi=No+(si+Ho|0)|0,di=HEAP32[hi>>2];if(!(0|di)){ci=0;t=259;break}fi=di,pi=hi;t=254;break;case 254:var vi=fi+20|0,yi=HEAP32[vi>>2];if(!(0|yi)){t=255;break}fi=yi,pi=vi;t=254;break;case 255:var mi=fi+16|0,bi=HEAP32[mi>>2];if(!(0|bi)){t=256;break}fi=bi,pi=mi;t=254;break;case 256:if(pi>>>0<HEAP32[14]>>>0){t=258;break}t=257;break;case 257:HEAP32[pi>>2]=0;ci=fi;t=259;break;case 259:if(!(0|ri)){t=279;break}t=260;break;case 260:var _i=No+((Ho+28|0)+Ca|0)|0,gi=344+(HEAP32[_i>>2]<<2)|0;if((0|ti)==(0|HEAP32[gi>>2])){t=261;break}t=263;break;case 261:if(HEAP32[gi>>2]=ci,!(0|ci)){t=262;break}t=269;break;case 262:var Ei=~(1<<HEAP32[_i>>2]),wi=HEAP32[11]&Ei;HEAP32[11]=wi,t=279;break;case 263:if(ri>>>0<HEAP32[14]>>>0){t=267;break}t=264;break;case 264:var Pi=ri+16|0;if((0|HEAP32[Pi>>2])==(0|ti)){t=265;break}t=266;break;case 265:HEAP32[Pi>>2]=ci,t=268;break;case 266:HEAP32[(ri+20|0)>>2]=ci,t=268;break;case 268:if(!(0|ci)){t=279;break}t=269;break;case 269:if(ci>>>0<HEAP32[14]>>>0){t=278;break}t=270;break;case 270:HEAP32[(ci+24|0)>>2]=ri;var Si=16|Ca,ki=HEAP32[(No+(Si+Ho|0)|0)>>2];if(!(0|ki)){t=274;break}t=271;break;case 271:if(ki>>>0<HEAP32[14]>>>0){t=273;break}t=272;break;case 272:HEAP32[(ci+16|0)>>2]=ki,HEAP32[(ki+24|0)>>2]=ci,t=274;break;case 274:var Ai=HEAP32[(No+(Ga+Si|0)|0)>>2];if(!(0|Ai)){t=279;break}t=275;break;case 275:if(Ai>>>0<HEAP32[14]>>>0){t=277;break}t=276;break;case 276:HEAP32[(ci+20|0)>>2]=Ai,HEAP32[(Ai+24|0)>>2]=ci,t=279;break;case 279:Va=No+((Ka|Ca)+Ho|0)|0,za=Ka+Ra|0;t=280;break;case 280:var Ti=Va+4|0,Oi=-2&HEAP32[Ti>>2];HEAP32[Ti>>2]=Oi;var Li=1|za;HEAP32[(No+(Ha+4|0)|0)>>2]=Li,HEAP32[(No+(za+Ha|0)|0)>>2]=za;var Ci=za>>>3;if(za>>>0<256){t=281;break}t=286;break;case 281:var xi=Ci<<1,Ii=80+(xi<<2)|0,Hi=HEAP32[10],Ni=1<<Ci;if(!(0|Hi&Ni)){t=282;break}t=283;break;case 282:var Di=Hi|Ni;HEAP32[10]=Di;var Ri=Ii,Fi=80+((xi+2|0)<<2)|0;t=285;break;case 283:var Ui=80+((xi+2|0)<<2)|0,ji=HEAP32[Ui>>2];if(ji>>>0<HEAP32[14]>>>0){t=284;break}Ri=ji,Fi=Ui;t=285;break;case 285:HEAP32[Fi>>2]=Da,HEAP32[(Ri+12|0)>>2]=Da,HEAP32[(No+(Ha+8|0)|0)>>2]=Ri,HEAP32[(No+(Ha+12|0)|0)>>2]=Ii,t=303;break;case 286:var Mi=Na,Bi=za>>>8;if(!(0|Bi)){var Gi=0;t=289;break}t=287;break;case 287:if(za>>>0>16777215){Gi=31;t=289;break}t=288;break;case 288:var Yi=8&(Bi+1048320|0)>>>16,Vi=Bi<<Yi,zi=4&(Vi+520192|0)>>>16,Ki=Vi<<zi,qi=2&(Ki+245760|0)>>>16,Wi=(14-(zi|Yi|qi)|0)+(Ki<<qi>>>15)|0;Gi=1&za>>>((Wi+7|0)>>>0)|Wi<<1;t=289;break;case 289:var Xi=344+(Gi<<2)|0;HEAP32[(No+(Ha+28|0)|0)>>2]=Gi;var Ji=No+(Ha+16|0)|0;HEAP32[(No+(Ha+20|0)|0)>>2]=0,HEAP32[Ji>>2]=0;var Qi=HEAP32[11],Zi=1<<Gi;if(!(0|Qi&Zi)){t=290;break}t=291;break;case 290:var $i=Qi|Zi;HEAP32[11]=$i,HEAP32[Xi>>2]=Mi;var ec=Xi;HEAP32[(No+(Ha+24|0)|0)>>2]=ec,HEAP32[(No+(Ha+12|0)|0)>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=Mi,t=303;break;case 291:var tc=HEAP32[Xi>>2];if(31==(0|Gi)){var rc=0;t=293;break}t=292;break;case 292:rc=25-(Gi>>>1)|0;t=293;break;case 293:if((0|-8&HEAP32[(tc+4|0)>>2])==(0|za)){var nc=tc;t=300;break}t=294;break;case 294:var oc=tc,ac=za<<rc;t=296;break;case 295:var ic=ac<<1;if((0|-8&HEAP32[(sc+4|0)>>2])==(0|za)){nc=sc;t=300;break}oc=sc,ac=ic;t=296;break;case 296:var cc=oc+16+(ac>>>31<<2)|0,sc=HEAP32[cc>>2];if(!(0|sc)){t=297;break}t=295;break;case 297:if(cc>>>0<HEAP32[14]>>>0){t=299;break}t=298;break;case 298:HEAP32[cc>>2]=Mi,HEAP32[(No+(Ha+24|0)|0)>>2]=oc,HEAP32[(No+(Ha+12|0)|0)>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=Mi,t=303;break;case 300:var uc=nc+8|0,lc=HEAP32[uc>>2],fc=nc,pc=HEAP32[14];if(fc>>>0>=pc>>>0&lc>>>0>=pc>>>0){t=301;break}t=302;break;case 301:HEAP32[(lc+12|0)>>2]=Mi,HEAP32[uc>>2]=Mi,HEAP32[(No+(Ha+8|0)|0)>>2]=lc,HEAP32[(No+(Ha+12|0)|0)>>2]=nc,HEAP32[(No+(Ha+24|0)|0)>>2]=0,t=303;break;case 303:_=No+(8|Ta)|0;t=341;break;case 304:var hc=zo,dc=488;t=305;break;case 305:var vc=HEAP32[(0|dc)>>2];if(vc>>>0>hc>>>0){t=307;break}t=306;break;case 306:var yc=HEAP32[(dc+4|0)>>2],mc=vc+yc|0;if(mc>>>0>hc>>>0){t=308;break}t=307;break;case 307:dc=HEAP32[(dc+8|0)>>2];t=305;break;case 308:var bc=yc-47|0,_c=vc+(yc-39|0)|0;if(!(0|7&_c)){var gc=0;t=310;break}t=309;break;case 309:gc=7&(0|-_c);t=310;break;case 310:var Ec=vc+(bc+gc|0)|0,wc=Ec>>>0<(zo+16|0)>>>0?hc:Ec,Pc=wc+8|0,Sc=Pc,kc=Ho-40|0,Ac=No+8|0;if(!(0|7&Ac)){var Tc=0;t=312;break}t=311;break;case 311:Tc=7&(0|-Ac);t=312;break;case 312:var Oc=No+Tc|0,Lc=kc-Tc|0;HEAP32[16]=Oc,HEAP32[13]=Lc;var Cc=1|Lc;HEAP32[(No+(Tc+4|0)|0)>>2]=Cc,HEAP32[(No+(Ho-36|0)|0)>>2]=40;var xc=HEAP32[8];HEAP32[17]=xc,HEAP32[(wc+4|0)>>2]=27,assert(!0),HEAP32[Pc>>2]=HEAP32[122],HEAP32[Pc+4>>2]=HEAP32[123],HEAP32[Pc+8>>2]=HEAP32[124],HEAP32[Pc+12>>2]=HEAP32[125],HEAP32[122]=No,HEAP32[123]=Ho,HEAP32[125]=0,HEAP32[124]=Sc;var Ic=wc+28|0;if(HEAP32[Ic>>2]=7,(wc+32|0)>>>0<mc>>>0){var Hc=Ic;t=313;break}t=314;break;case 313:var Nc=Hc+4|0;if(HEAP32[Nc>>2]=7,(Hc+8|0)>>>0<mc>>>0){Hc=Nc;t=313;break}t=314;break;case 314:if((0|wc)==(0|hc)){t=338;break}t=315;break;case 315:var Dc=wc-zo|0,Rc=hc+Dc|0,Fc=hc+(Dc+4|0)|0,Uc=-2&HEAP32[Fc>>2];HEAP32[Fc>>2]=Uc;var jc=1|Dc;HEAP32[(zo+4|0)>>2]=jc,HEAP32[Rc>>2]=Dc;var Mc=Dc>>>3;if(Dc>>>0<256){t=316;break}t=321;break;case 316:var Bc=Mc<<1,Gc=80+(Bc<<2)|0,Yc=HEAP32[10],Vc=1<<Mc;if(!(0|Yc&Vc)){t=317;break}t=318;break;case 317:var zc=Yc|Vc;HEAP32[10]=zc;var Kc=Gc,qc=80+((Bc+2|0)<<2)|0;t=320;break;case 318:var Wc=80+((Bc+2|0)<<2)|0,Xc=HEAP32[Wc>>2];if(Xc>>>0<HEAP32[14]>>>0){t=319;break}Kc=Xc,qc=Wc;t=320;break;case 320:HEAP32[qc>>2]=zo,HEAP32[(Kc+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=Kc,HEAP32[(zo+12|0)>>2]=Gc,t=338;break;case 321:var Jc=zo,Qc=Dc>>>8;if(!(0|Qc)){var Zc=0;t=324;break}t=322;break;case 322:if(Dc>>>0>16777215){Zc=31;t=324;break}t=323;break;case 323:var $c=8&(Qc+1048320|0)>>>16,es=Qc<<$c,ts=4&(es+520192|0)>>>16,rs=es<<ts,ns=2&(rs+245760|0)>>>16,os=(14-(ts|$c|ns)|0)+(rs<<ns>>>15)|0;Zc=1&Dc>>>((os+7|0)>>>0)|os<<1;t=324;break;case 324:var as=344+(Zc<<2)|0,is=Zc;HEAP32[(zo+28|0)>>2]=is,HEAP32[(zo+20|0)>>2]=0,HEAP32[(zo+16|0)>>2]=0;var cs=HEAP32[11],ss=1<<Zc;if(!(0|cs&ss)){t=325;break}t=326;break;case 325:var us=cs|ss;HEAP32[11]=us,HEAP32[as>>2]=Jc;var ls=as;HEAP32[(zo+24|0)>>2]=ls,HEAP32[(zo+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=zo,t=338;break;case 326:var fs=HEAP32[as>>2];if(31==(0|Zc)){var ps=0;t=328;break}t=327;break;case 327:ps=25-(Zc>>>1)|0;t=328;break;case 328:if((0|-8&HEAP32[(fs+4|0)>>2])==(0|Dc)){var hs=fs;t=335;break}t=329;break;case 329:var ds=fs,vs=Dc<<ps;t=331;break;case 330:var ys=vs<<1;if((0|-8&HEAP32[(bs+4|0)>>2])==(0|Dc)){hs=bs;t=335;break}ds=bs,vs=ys;t=331;break;case 331:var ms=ds+16+(vs>>>31<<2)|0,bs=HEAP32[ms>>2];if(!(0|bs)){t=332;break}t=330;break;case 332:if(ms>>>0<HEAP32[14]>>>0){t=334;break}t=333;break;case 333:HEAP32[ms>>2]=Jc;var _s=ds;HEAP32[(zo+24|0)>>2]=_s,HEAP32[(zo+12|0)>>2]=zo,HEAP32[(zo+8|0)>>2]=zo,t=338;break;case 335:var gs=hs+8|0,Es=HEAP32[gs>>2],ws=hs,Ps=HEAP32[14];if(ws>>>0>=Ps>>>0&Es>>>0>=Ps>>>0){t=336;break}t=337;break;case 336:HEAP32[(Es+12|0)>>2]=Jc,HEAP32[gs>>2]=Jc;var Ss=Es;HEAP32[(zo+8|0)>>2]=Ss;var ks=hs;HEAP32[(zo+12|0)>>2]=ks,HEAP32[(zo+24|0)>>2]=0,t=338;break;case 338:var As=HEAP32[13];if(As>>>0>g>>>0){t=339;break}t=340;break;case 339:var Ts=As-g|0;HEAP32[13]=Ts;var Os=HEAP32[16],Ls=Os,Cs=Ls+g|0;HEAP32[16]=Cs;var xs=1|Ts;HEAP32[(Ls+(g+4|0)|0)>>2]=xs;var Is=3|g;HEAP32[(Os+4|0)>>2]=Is;_=Os+8|0;t=341;break;case 340:var Hs=___errno_location();HEAP32[Hs>>2]=12;_=0;t=341;break;case 341:return _;default:assert(0,"bad label: "+t)}}function _free(e){var t=0;for(t=1;;)switch(t){case 1:if(!(0|e)){t=140;break}t=2;break;case 2:var r=e-8|0,n=r,o=HEAP32[14];if(r>>>0<o>>>0){t=139;break}t=3;break;case 3:var a=HEAP32[(e-4|0)>>2],i=3&a;if(1==(0|i)){t=139;break}t=4;break;case 4:var c=-8&a,s=e+(c-8|0)|0,u=s;if(!(0|1&a)){t=5;break}var l=n,f=c;t=56;break;case 5:var p=HEAP32[r>>2];if(!(0|i)){t=140;break}t=6;break;case 6:var h=-8-p|0,d=e+h|0,v=d,y=p+c|0;if(d>>>0<o>>>0){t=139;break}t=7;break;case 7:if((0|v)==(0|HEAP32[15])){t=54;break}t=8;break;case 8:var m=p>>>3;if(p>>>0<256){t=9;break}t=21;break;case 9:var b=HEAP32[(e+(h+8|0)|0)>>2],_=HEAP32[(e+(h+12|0)|0)>>2],g=80+(m<<1<<2)|0;if((0|b)==(0|g)){t=12;break}t=10;break;case 10:if(b>>>0<o>>>0){t=20;break}t=11;break;case 11:if((0|HEAP32[(b+12|0)>>2])==(0|v)){t=12;break}t=20;break;case 12:if((0|_)==(0|b)){t=13;break}t=14;break;case 13:var E=~(1<<m),w=HEAP32[10]&E;HEAP32[10]=w;l=v,f=y;t=56;break;case 14:if((0|_)==(0|g)){t=15;break}t=16;break;case 15:var P=_+8|0;t=18;break;case 16:if(_>>>0<o>>>0){t=19;break}t=17;break;case 17:var S=_+8|0;if((0|HEAP32[S>>2])==(0|v)){P=S;t=18;break}t=19;break;case 18:HEAP32[(b+12|0)>>2]=_,HEAP32[P>>2]=b;l=v,f=y;t=56;break;case 19:case 20:case 26:case 33:case 42:case 48:case 52:case 53:case 75:case 76:case 82:case 89:case 98:case 104:case 108:case 109:case 117:case 132:case 135:case 139:throw _abort(),"Reached an unreachable!";case 21:var k=d,A=HEAP32[(e+(h+24|0)|0)>>2],T=HEAP32[(e+(h+12|0)|0)>>2];if((0|T)==(0|k)){t=27;break}t=22;break;case 22:var O=HEAP32[(e+(h+8|0)|0)>>2];if(O>>>0<o>>>0){t=26;break}t=23;break;case 23:var L=O+12|0;if((0|HEAP32[L>>2])==(0|k)){t=24;break}t=26;break;case 24:var C=T+8|0;if((0|HEAP32[C>>2])==(0|k)){t=25;break}t=26;break;case 25:HEAP32[L>>2]=T,HEAP32[C>>2]=O;var x=T;t=34;break;case 27:var I=e+(h+20|0)|0,H=HEAP32[I>>2];if(!(0|H)){t=28;break}var N=H,D=I;t=29;break;case 28:var R=e+(h+16|0)|0,F=HEAP32[R>>2];if(!(0|F)){x=0;t=34;break}N=F,D=R;t=29;break;case 29:var U=N+20|0,j=HEAP32[U>>2];if(!(0|j)){t=30;break}N=j,D=U;t=29;break;case 30:var M=N+16|0,B=HEAP32[M>>2];if(!(0|B)){t=31;break}N=B,D=M;t=29;break;case 31:if(D>>>0<o>>>0){t=33;break}t=32;break;case 32:HEAP32[D>>2]=0;x=N;t=34;break;case 34:if(!(0|A)){l=v,f=y;t=56;break}t=35;break;case 35:var G=e+(h+28|0)|0,Y=344+(HEAP32[G>>2]<<2)|0;if((0|k)==(0|HEAP32[Y>>2])){t=36;break}t=38;break;case 36:if(HEAP32[Y>>2]=x,!(0|x)){t=37;break}t=44;break;case 37:var V=~(1<<HEAP32[G>>2]),z=HEAP32[11]&V;HEAP32[11]=z;l=v,f=y;t=56;break;case 38:if(A>>>0<HEAP32[14]>>>0){t=42;break}t=39;break;case 39:var K=A+16|0;if((0|HEAP32[K>>2])==(0|k)){t=40;break}t=41;break;case 40:HEAP32[K>>2]=x,t=43;break;case 41:HEAP32[(A+20|0)>>2]=x,t=43;break;case 43:if(!(0|x)){l=v,f=y;t=56;break}t=44;break;case 44:if(x>>>0<HEAP32[14]>>>0){t=53;break}t=45;break;case 45:HEAP32[(x+24|0)>>2]=A;var q=HEAP32[(e+(h+16|0)|0)>>2];if(!(0|q)){t=49;break}t=46;break;case 46:if(q>>>0<HEAP32[14]>>>0){t=48;break}t=47;break;case 47:HEAP32[(x+16|0)>>2]=q,HEAP32[(q+24|0)>>2]=x,t=49;break;case 49:var W=HEAP32[(e+(h+20|0)|0)>>2];if(!(0|W)){l=v,f=y;t=56;break}t=50;break;case 50:if(W>>>0<HEAP32[14]>>>0){t=52;break}t=51;break;case 51:HEAP32[(x+20|0)>>2]=W,HEAP32[(W+24|0)>>2]=x;l=v,f=y;t=56;break;case 54:var X=e+(c-4|0)|0;if(3==(0|3&HEAP32[X>>2])){t=55;break}l=v,f=y;t=56;break;case 55:HEAP32[12]=y;var J=-2&HEAP32[X>>2];HEAP32[X>>2]=J;var Q=1|y;HEAP32[(e+(h+4|0)|0)>>2]=Q,HEAP32[s>>2]=y,t=140;break;case 56:var Z=l;if(Z>>>0<s>>>0){t=57;break}t=139;break;case 57:var $=e+(c-4|0)|0,ee=HEAP32[$>>2];if(!(0|1&ee)){t=139;break}t=58;break;case 58:if(!(0|2&ee)){t=59;break}t=112;break;case 59:if((0|u)==(0|HEAP32[16])){t=60;break}t=62;break;case 60:var te=HEAP32[13]+f|0;HEAP32[13]=te,HEAP32[16]=l;var re=1|te;if(HEAP32[(l+4|0)>>2]=re,(0|l)==(0|HEAP32[15])){t=61;break}t=140;break;case 61:HEAP32[15]=0,HEAP32[12]=0,t=140;break;case 62:if((0|u)==(0|HEAP32[15])){t=63;break}t=64;break;case 63:var ne=HEAP32[12]+f|0;HEAP32[12]=ne,HEAP32[15]=l;var oe=1|ne;HEAP32[(l+4|0)>>2]=oe,HEAP32[(Z+ne|0)>>2]=ne,t=140;break;case 64:var ae=(-8&ee)+f|0,ie=ee>>>3;if(ee>>>0<256){t=65;break}t=77;break;case 65:var ce=HEAP32[(e+c|0)>>2],se=HEAP32[(e+(4|c)|0)>>2],ue=80+(ie<<1<<2)|0;if((0|ce)==(0|ue)){t=68;break}t=66;break;case 66:if(ce>>>0<HEAP32[14]>>>0){t=76;break}t=67;break;case 67:if((0|HEAP32[(ce+12|0)>>2])==(0|u)){t=68;break}t=76;break;case 68:if((0|se)==(0|ce)){t=69;break}t=70;break;case 69:var le=~(1<<ie),fe=HEAP32[10]&le;HEAP32[10]=fe,t=110;break;case 70:if((0|se)==(0|ue)){t=71;break}t=72;break;case 71:var pe=se+8|0;t=74;break;case 72:if(se>>>0<HEAP32[14]>>>0){t=75;break}t=73;break;case 73:var he=se+8|0;if((0|HEAP32[he>>2])==(0|u)){pe=he;t=74;break}t=75;break;case 74:HEAP32[(ce+12|0)>>2]=se,HEAP32[pe>>2]=ce,t=110;break;case 77:var de=s,ve=HEAP32[(e+(c+16|0)|0)>>2],ye=HEAP32[(e+(4|c)|0)>>2];if((0|ye)==(0|de)){t=83;break}t=78;break;case 78:var me=HEAP32[(e+c|0)>>2];if(me>>>0<HEAP32[14]>>>0){t=82;break}t=79;break;case 79:var be=me+12|0;if((0|HEAP32[be>>2])==(0|de)){t=80;break}t=82;break;case 80:var _e=ye+8|0;if((0|HEAP32[_e>>2])==(0|de)){t=81;break}t=82;break;case 81:HEAP32[be>>2]=ye,HEAP32[_e>>2]=me;var ge=ye;t=90;break;case 83:var Ee=e+(c+12|0)|0,we=HEAP32[Ee>>2];if(!(0|we)){t=84;break}var Pe=we,Se=Ee;t=85;break;case 84:var ke=e+(c+8|0)|0,Ae=HEAP32[ke>>2];if(!(0|Ae)){ge=0;t=90;break}Pe=Ae,Se=ke;t=85;break;case 85:var Te=Pe+20|0,Oe=HEAP32[Te>>2];if(!(0|Oe)){t=86;break}Pe=Oe,Se=Te;t=85;break;case 86:var Le=Pe+16|0,Ce=HEAP32[Le>>2];if(!(0|Ce)){t=87;break}Pe=Ce,Se=Le;t=85;break;case 87:if(Se>>>0<HEAP32[14]>>>0){t=89;break}t=88;break;case 88:HEAP32[Se>>2]=0;ge=Pe;t=90;break;case 90:if(!(0|ve)){t=110;break}t=91;break;case 91:var xe=e+(c+20|0)|0,Ie=344+(HEAP32[xe>>2]<<2)|0;if((0|de)==(0|HEAP32[Ie>>2])){t=92;break}t=94;break;case 92:if(HEAP32[Ie>>2]=ge,!(0|ge)){t=93;break}t=100;break;case 93:var He=~(1<<HEAP32[xe>>2]),Ne=HEAP32[11]&He;HEAP32[11]=Ne,t=110;break;case 94:if(ve>>>0<HEAP32[14]>>>0){t=98;break}t=95;break;case 95:var De=ve+16|0;if((0|HEAP32[De>>2])==(0|de)){t=96;break}t=97;break;case 96:HEAP32[De>>2]=ge,t=99;break;case 97:HEAP32[(ve+20|0)>>2]=ge,t=99;break;case 99:if(!(0|ge)){t=110;break}t=100;break;case 100:if(ge>>>0<HEAP32[14]>>>0){t=109;break}t=101;break;case 101:HEAP32[(ge+24|0)>>2]=ve;var Re=HEAP32[(e+(c+8|0)|0)>>2];if(!(0|Re)){t=105;break}t=102;break;case 102:if(Re>>>0<HEAP32[14]>>>0){t=104;break}t=103;break;case 103:HEAP32[(ge+16|0)>>2]=Re,HEAP32[(Re+24|0)>>2]=ge,t=105;break;case 105:var Fe=HEAP32[(e+(c+12|0)|0)>>2];if(!(0|Fe)){t=110;break}t=106;break;case 106:if(Fe>>>0<HEAP32[14]>>>0){t=108;break}t=107;break;case 107:HEAP32[(ge+20|0)>>2]=Fe,HEAP32[(Fe+24|0)>>2]=ge,t=110;break;case 110:var Ue=1|ae;if(HEAP32[(l+4|0)>>2]=Ue,HEAP32[(Z+ae|0)>>2]=ae,(0|l)==(0|HEAP32[15])){t=111;break}var je=ae;t=113;break;case 111:HEAP32[12]=ae,t=140;break;case 112:var Me=-2&ee;HEAP32[$>>2]=Me;var Be=1|f;HEAP32[(l+4|0)>>2]=Be,HEAP32[(Z+f|0)>>2]=f;je=f;t=113;break;case 113:var Ge=je>>>3;if(je>>>0<256){t=114;break}t=119;break;case 114:var Ye=Ge<<1,Ve=80+(Ye<<2)|0,ze=HEAP32[10],Ke=1<<Ge;if(!(0|ze&Ke)){t=115;break}t=116;break;case 115:var qe=ze|Ke;HEAP32[10]=qe;var We=Ve,Xe=80+((Ye+2|0)<<2)|0;t=118;break;case 116:var Je=80+((Ye+2|0)<<2)|0,Qe=HEAP32[Je>>2];if(Qe>>>0<HEAP32[14]>>>0){t=117;break}We=Qe,Xe=Je;t=118;break;case 118:HEAP32[Xe>>2]=l,HEAP32[(We+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=We,HEAP32[(l+12|0)>>2]=Ve,t=140;break;case 119:var Ze=l,$e=je>>>8;if(!(0|$e)){var et=0;t=122;break}t=120;break;case 120:if(je>>>0>16777215){et=31;t=122;break}t=121;break;case 121:var tt=8&($e+1048320|0)>>>16,rt=$e<<tt,nt=4&(rt+520192|0)>>>16,ot=rt<<nt,at=2&(ot+245760|0)>>>16,it=(14-(nt|tt|at)|0)+(ot<<at>>>15)|0;et=1&je>>>((it+7|0)>>>0)|it<<1;t=122;break;case 122:var ct=344+(et<<2)|0,st=et;HEAP32[(l+28|0)>>2]=st,HEAP32[(l+20|0)>>2]=0,HEAP32[(l+16|0)>>2]=0;var ut=HEAP32[11],lt=1<<et;if(!(0|ut&lt)){t=123;break}t=124;break;case 123:var ft=ut|lt;HEAP32[11]=ft,HEAP32[ct>>2]=Ze;var pt=ct;HEAP32[(l+24|0)>>2]=pt,HEAP32[(l+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=l,t=136;break;case 124:var ht=HEAP32[ct>>2];if(31==(0|et)){var dt=0;t=126;break}t=125;break;case 125:dt=25-(et>>>1)|0;t=126;break;case 126:if((0|-8&HEAP32[(ht+4|0)>>2])==(0|je)){var vt=ht;t=133;break}t=127;break;case 127:var yt=ht,mt=je<<dt;t=129;break;case 128:var bt=mt<<1;if((0|-8&HEAP32[(gt+4|0)>>2])==(0|je)){vt=gt;t=133;break}yt=gt,mt=bt;t=129;break;case 129:var _t=yt+16+(mt>>>31<<2)|0,gt=HEAP32[_t>>2];if(!(0|gt)){t=130;break}t=128;break;case 130:if(_t>>>0<HEAP32[14]>>>0){t=132;break}t=131;break;case 131:HEAP32[_t>>2]=Ze;var Et=yt;HEAP32[(l+24|0)>>2]=Et,HEAP32[(l+12|0)>>2]=l,HEAP32[(l+8|0)>>2]=l,t=136;break;case 133:var wt=vt+8|0,Pt=HEAP32[wt>>2],St=vt,kt=HEAP32[14];if(St>>>0>=kt>>>0&Pt>>>0>=kt>>>0){t=134;break}t=135;break;case 134:HEAP32[(Pt+12|0)>>2]=Ze,HEAP32[wt>>2]=Ze;var At=Pt;HEAP32[(l+8|0)>>2]=At;var Tt=vt;HEAP32[(l+12|0)>>2]=Tt,HEAP32[(l+24|0)>>2]=0,t=136;break;case 136:var Ot=HEAP32[18]-1|0;if(HEAP32[18]=Ot,!(0|Ot)){var Lt=496;t=137;break}t=140;break;case 137:var Ct=HEAP32[Lt>>2],xt=Ct+8|0;if(!(0|Ct)){t=138;break}Lt=xt;t=137;break;case 138:HEAP32[18]=-1,t=140;break;case 140:return;default:assert(0,"bad label: "+t)}}Module._bitmap_decompress_15=_bitmap_decompress_15,Module._bitmap_decompress_16=_bitmap_decompress_16,Module._bitmap_decompress_24=_bitmap_decompress_24,Module._bitmap_decompress_32=_bitmap_decompress_32,Module._malloc=_malloc,Module._free=_free;var i64Math=null,initialStackTop;if(memoryInitializer){var applyData=function(e){HEAPU8.set(e,STATIC_BASE)};ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL?applyData(Module.readBinary(memoryInitializer)):(addRunDependency("memory initializer"),Browser.asyncLoad(memoryInitializer,(function(e){applyData(e),removeRunDependency("memory initializer")}),(function(e){throw"could not load memory initializer "+memoryInitializer})))}function ExitStatus(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}ExitStatus.prototype=new Error,ExitStatus.prototype.constructor=ExitStatus;var preloadStartTime=null,calledMain=!1;function run(e){function t(){Module.calledRun||(Module.calledRun=!0,ensureInitRuntime(),preMain(),Module._main&&shouldRunNow&&Module.callMain(e),postRun())}e=e||Module.arguments,null===preloadStartTime&&(preloadStartTime=Date.now()),runDependencies>0?Module.printErr("run() called, but dependencies remain, so not running"):(preRun(),runDependencies>0||Module.calledRun||(Module.setStatus?(Module.setStatus("Running..."),setTimeout((function(){setTimeout((function(){Module.setStatus("")}),1),ABORT||t()}),1)):t()))}function exit(e){throw ABORT=!0,EXITSTATUS=e,STACKTOP=initialStackTop,exitRuntime(),new ExitStatus(e)}function abort(e){throw e&&(Module.print(e),Module.printErr(e)),ABORT=!0,EXITSTATUS=1,"abort() at "+stackTrace()}if(dependenciesFulfilled=function e(){!Module.calledRun&&shouldRunNow&&run(),Module.calledRun||(dependenciesFulfilled=e)},Module.callMain=Module.callMain=function(e){assert(0==runDependencies,"cannot call main when async dependencies remain! (listen on __ATMAIN__)"),assert(0==__ATPRERUN__.length,"cannot call main when preRun functions remain to be called"),e=e||[],ENVIRONMENT_IS_WEB&&null!==preloadStartTime&&Module.printErr("preload time: "+(Date.now()-preloadStartTime)+" ms"),ensureInitRuntime();var t=e.length+1;function r(){for(var e=0;e<3;e++)n.push(0)}var n=[allocate(intArrayFromString("/bin/this.program"),"i8",ALLOC_NORMAL)];r();for(var o=0;o<t-1;o+=1)n.push(allocate(intArrayFromString(e[o]),"i8",ALLOC_NORMAL)),r();n.push(0),n=allocate(n,"i32",ALLOC_NORMAL),initialStackTop=STACKTOP;try{var a=Module._main(t,n,0);Module.noExitRuntime||exit(a)}catch(e){if(e instanceof ExitStatus)return;if("SimulateInfiniteLoop"==e)return void(Module.noExitRuntime=!0);throw e&&"object"===_typeof(e)&&e.stack&&Module.printErr("exception thrown: "+[e,e.stack]),e}finally{calledMain=!0}},Module.run=Module.run=run,Module.exit=Module.exit=exit,Module.abort=Module.abort=abort,Module.preInit)for("function"==typeof Module.preInit&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run()},4534:(e,t,r)=>{var n=r(9023).inherits,o=r(5570),a=r(6986);function i(e){this.offset=0,e instanceof Buffer?this.buffer=e:this.buffer=Buffer.alloc(e||8192)}function c(e){e&&(this.value=e)}function s(e){c.call(this),this.opt=e||{},this.isReaded=!1,this.isWritten=!1}function u(e,t){s.call(this,t),this.obj=e}function l(e,t,r,n,o){s.call(this,o),this.value=e||0,this.nbBytes=t,this.readBufferCallback=r,this.writeBufferCallback=n}function f(e,t){l.call(this,e,1,Buffer.prototype.readUInt8,Buffer.prototype.writeUInt8,t)}function p(e,t){l.call(this,e,2,Buffer.prototype.readUInt16LE,Buffer.prototype.writeUInt16LE,t)}function h(e,t){l.call(this,e,2,Buffer.prototype.readUInt16BE,Buffer.prototype.writeUInt16BE,t)}function d(e,t){l.call(this,e,4,Buffer.prototype.readUInt32LE,Buffer.prototype.writeUInt32LE,t)}function v(e,t){l.call(this,e,4,Buffer.prototype.readUInt32BE,Buffer.prototype.writeUInt32BE,t)}function y(e,t){s.call(this,t),this.value=e||Buffer.alloc(0)}function m(e,t){s.call(this,t),this.factory=e}i.prototype.availableLength=function(){return this.buffer.length-this.offset},i.prototype.readPadding=function(e){this.offset+=e},i.prototype.getValue=function(){return this.buffer},Object.defineProperty(c.prototype,"value",{get:function(){return this._value()},set:function(e){this._value="function"!=typeof e?function(){return e}:e}}),n(s,c),s.prototype.write=function(e){return this.opt.conditional&&!this.opt.conditional()||(this.isWritten=!0,this.writeValue(e)),this},s.prototype.read=function(e){if(this.opt.conditional&&!this.opt.conditional())return this;if(this.opt.optional&&e.availableLength()<this.size())return this;if(this.isReaded=!0,this.opt.constant){var t=this.value;try{this.readValue(e)}catch(e){if(e instanceof RangeError)throw new a.ProtocolError("NODE_RDP_CORE_TYPE_STREAM_TOO_SMALL");throw e}if(t!==this.value)throw o.error("constant value mismatch "+t+" != "+this.value),new a.ProtocolError("NODE_RDP_CORE_TYPE_CONSTANT_VALUE_MISMATCH, OLD:"+t+", NEW:"+this.value)}else try{this.readValue(e)}catch(e){if(e instanceof RangeError)throw new a.ProtocolError("NODE_RDP_CORE_TYPE_STREAM_TOO_SMALL");throw e}return this},s.prototype.size=function(){return this.opt.conditional&&!this.opt.conditional()?0:this._size_()},s.prototype.toStream=function(){var e=new i(this.size());return this.write(e),e},n(u,s),u.prototype.ignore=function(e){return 0===e.lastIndexOf("__",0)||"function"==typeof this.obj[e]},u.prototype.writeValue=function(e){for(var t in this.obj)if(!this.ignore(t))try{this.obj[t].write(e)}catch(e){throw o.info("during write of field "+t),e}},u.prototype.readValue=function(e){var t=e;for(var r in this.opt.readLength&&(t=new i(e.buffer.slice(e.offset,e.offset+this.opt.readLength.value))),this.obj)if(!this.ignore(r))try{this.obj[r].read(t)}catch(e){throw o.info("during read of field "+r),e}this.opt.readLength&&(e.offset+=this.opt.readLength.value,t.offset<this.opt.readLength.value&&o.debug("still have available data : read it as padding"))},u.prototype._size_=function(){var e=0;for(var t in this.obj)this.ignore(t)||(e+=this.obj[t].size());return e},n(l,s),l.prototype.writeValue=function(e){this.writeBufferCallback.call(e.buffer,this.value,e.offset),e.offset+=this._size_()},l.prototype.readValue=function(e){this.value=this.readBufferCallback.call(e.buffer,e.offset),e.offset+=this._size_()},l.prototype._size_=function(){return this.nbBytes},n(f,l),n(p,l),n(h,l),n(d,l),n(v,l),n(y,s),y.prototype.writeValue=function(e){this.value.copy(e.buffer,e.offset),e.offset+=this._size_()},y.prototype.readValue=function(e){this.opt.readLength?this.value=e.buffer.slice(e.offset,e.offset+this.opt.readLength.value):this.value=e.buffer.slice(e.offset),e.offset+=this._size_()},y.prototype._size_=function(){return this.value.length},n(m,s),m.prototype.writeValue=function(e){this.factory(e)},m.prototype.readValue=function(e){this.factory(e)},m.prototype._size_=function(){throw new a.FatalError("NODE_RDP_CORE_TYPE_FACTORY_TYPE_HAVE_NO_SIZE")},e.exports={Stream:i,Component:u,UInt8:f,UInt16Le:p,UInt16Be:h,UInt32Le:d,UInt32Be:v,BinaryString:y,CallableValue:c,Factory:m}},4490:(e,t,r)=>{var n=r(6939);e.exports={createClient:n.rdp.createClient,createServer:n.rdp.createServer}},8701:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(8597).x509,i=r(8597).rsa,c=r(5002),s={CERT_CHAIN_VERSION_1:1,CERT_CHAIN_VERSION_2:2};function u(e){var t={magic:new n.UInt32Le(826364754,{constant:!0}),keylen:new n.UInt32Le((function(){return t.modulus.size()+t.paddinf.size()})),bitlen:new n.UInt32Le((function(){return 8*(t.keylen.value-8)})),datalen:new n.UInt32Le((function(){return t.bitlen.value/8-1})),pubExp:new n.UInt32Le,modulus:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return t.keylen.value-8}))}),padding:new n.BinaryString(Buffer.from(Array(9).join("\0")),{readLength:new n.CallableValue(8)})};return new n.Component(t,e)}function l(){var e={cbCert:new n.UInt32Le((function(){return e.abCert.size()})),abCert:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return e.cbCert.value}))})};return new n.Component(e)}e.exports={CertificateType:s,certificate:function(){var e={dwVersion:new n.UInt32Le((function(){return e.certData.__TYPE__})),certData:new n.Factory((function(t){switch(2147483647&e.dwVersion.value){case s.CERT_CHAIN_VERSION_1:o.debug("read proprietary certificate"),e.certData=function(){var e={__TYPE__:s.CERT_CHAIN_VERSION_1,dwSigAlgId:new n.UInt32Le(1,{constant:!0}),dwKeyAlgId:new n.UInt32Le(1,{constant:!0}),wPublicKeyBlobType:new n.UInt16Le(6,{constant:!0}),wPublicKeyBlobLen:new n.UInt16Le((function(){return e.PublicKeyBlob.size()})),PublicKeyBlob:u({readLength:new n.CallableValue((function(){return e.wPublicKeyBlobLen.value}))}),wSignatureBlobType:new n.UInt16Le(8,{constant:!0}),wSignatureBlobLen:new n.UInt16Le((function(){return e.SignatureBlob.size()+e.padding.size()})),SignatureBlob:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return e.wSignatureBlobLen.value-e.padding.size}))}),padding:new n.BinaryString(Array(9).join("\0"),{readLength:new n.CallableValue(8)}),getPublicKey:function(){return i.publicKey(e.PublicKeyBlob.obj.modulus.value,e.PublicKeyBlob.obj.pubExp.value)}};return new n.Component(e)}().read(t);break;case s.CERT_CHAIN_VERSION_2:o.debug("read x.509 certificate chain"),e.certData=function(){var e={__TYPE__:s.CERT_CHAIN_VERSION_2,NumCertBlobs:new n.UInt32Le,CertBlobArray:new n.Factory((function(t){e.CertBlobArray=new n.Component([]);for(var r=0;r<e.NumCertBlobs.value;r++)e.CertBlobArray.obj.push(l().read(t))})),padding:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return 8+4*e.NumCertBlobs.value}))}),getPublicKey:function(){var t=a.X509Certificate().decode(new n.Stream(e.CertBlobArray.obj[e.CertBlobArray.obj.length-1].obj.abCert.value),c.ber),r=new n.Stream(t.value.tbsCertificate.value.subjectPublicKeyInfo.value.subjectPublicKey.toBuffer()),o=a.RSAPublicKey().decode(r,c.ber);return i.publicKey(o.value.modulus.value,o.value.publicExponent.value)}};return new n.Component(e)}().read(t);break;default:o.error("unknown cert type "+e.dwVersion.value&2147483647)}}))};return new n.Component(e)}}},6939:(e,t,r)=>{var n=r(2008),o=r(5599),a=r(1018),i=r(4077);e.exports={TPKT:n,x224:o,t125:a,rdp:i}},6626:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(6261),i=r(6982),c=r(2470),s=c.asn1;c.pki;function u(e,t,r,n,o){var a={domain:"",user:"",password:"",response_key_nt:null,response_key_lm:null,negotiate_message:null,exported_session_key:i.randomBytes(16),is_unicode:!1};a.domain=r,a.completedFunc=t,a.user=n,a.password=o,a.response_key_nt=b(a.password,a.user,a.domain),a.response_key_lm=_(a.password,a.user,a.domain),this.ntlm=a,this.state=1,this.transport=e,this.transport.expect(2);var c=this;this.oldDataListeners=this.transport.listeners("data"),this.oldCloseListeners=this.transport.listeners("close"),this.oldErrorListeners=this.transport.listeners("error"),this.transport.removeAllListeners("data"),this.transport.removeAllListeners("close"),this.transport.removeAllListeners("error"),this.transport.once("data",(function(e){c.recvHeader(e)})).on("close",(function(){c.emit("close")})).on("error",(function(e){c.emit("close")}))}n(u,a.EventEmitter),u.prototype.recvHeader=function(e){var t=this,r=((new o.UInt8).read(e).value,(new o.UInt8).read(e).value);t.buffers=[e.buffer],r<128?(this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))):(this.transport.expect(r-128),this.transport.once("data",(function(e){t.recvHeaderSize(e)})))},u.prototype.recvHeaderSize=function(e){var t=this;if(t.buffers.push(e.buffer),1==e.buffer.length){var r=e.buffer.readUInt8(0);this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))}else if(2==e.buffer.length){r=e.buffer.readUInt16BE(0);this.transport.expect(r),this.transport.once("data",(function(e){t.recvData(e)}))}},u.prototype.recvData=function(e){var t=this;t.buffers.push(e.buffer);var r=Buffer.concat(t.buffers),n=s.fromDer(r.toString("binary"));if(6==n.value[0].value[0].value.charCodeAt(0))if(1==this.state){var o=Buffer.from(n.value[1].value[0].value[0].value[0].value[0].value,"binary"),a=function(e,t){var r=t.slice(0,8);"4e544c4d53535000"!=r.toString("hex")&&console.log("BAD SIGNATURE");var n=t.readInt32LE(8);2!=n&&console.log("BAD MESSAGE TYPE");var o=t.readInt16LE(12),a=(t.readInt16LE(14),t.readInt32LE(16)),c=t.readInt32LE(20),s=t.slice(24,32),u=t.slice(32,40);"0000000000000000"!=u.toString("hex")&&console.log("BAD RESERVED");var l=t.readInt16LE(40),f=(t.readInt16LE(42),t.readInt32LE(44)),p=(t.slice(a,a+o),t.slice(f,f+l)),h=function(e){var t,r,n={},o=0;for(;0!=(t=e.readInt16LE(o));)r=e.readInt16LE(o+2),n[t]=e.slice(o+4,o+4+r),o+=4+r;return n}(t.slice(f,f+l)),v=h[7];null==v&&console.log("NO TIMESTAMP");var y=i.randomBytes(8),P=b(e.password,e.user,e.domain),S=_(e.password,e.user,e.domain),k=E(P,S,s,y,v,p),A=k[0],T=k[1],L=w(function(e){return e}(k[2]),e.exported_session_key);e.is_unicode=!!(1&c);var C=null,x=null;e.is_unicode?(C=d(e.domain),x=d(e.user)):(C=Buffer.from(e.domain,"utf8"),x=Buffer.from(e.user,"utf8"));var I=O(T,A,C,x,g(0),L,c),H=Buffer.concat([I[0],g(16),I[1]]),N=function(e,t,r,n){return m(e,Buffer.concat([t,r,n]))}(e.exported_session_key,e.negotiate_message,t,H);return Buffer.concat([I[0],N,I[1]])}(this.ntlm,o);t.security_interface=function(e){var t={};if(e){t.signing_key=A(e.exported_session_key,!0),t.verify_key=A(e.exported_session_key,!1);var r=T(e.exported_session_key,!0),n=T(e.exported_session_key,!1);t.encrypt=P(r),t.decrypt=P(n)}return t.seq_num=0,t.gss_wrapex=function(e){var r=t.encrypt.update(e),n=k(t.encrypt,t.signing_key,t.seq_num,e);return t.seq_num++,Buffer.concat([n,r])},t.gss_unwrapex=function(e){e.readInt32LE(0);var r=e.slice(4,12),n=e.readInt32LE(12),o=e.slice(16),a=t.decrypt.update(o),i=t.decrypt.update(r),c=Buffer.alloc(4);c.writeInt32LE(n,0);var s=m(t.verify_key,Buffer.concat([c,a])).slice(0,8);return i.equals(s)||console.log("Invalid checksum on NTLMv2"),a},t}(this.ntlm);var c=this.transport.secureSocket.getPeerCertificate(),u=x(a,t.security_interface.gss_wrapex(c.pubkey.slice(24)));this.ntlm.publicKeyDer=c.pubkey.slice(24),this.send(u),this.state=2}else if(2==this.state){var l,f,p,h=Buffer.from(n.value[1].value[0].value,"binary"),v=t.security_interface.gss_unwrapex(h);if(!this.ntlm.publicKeyDer.slice(1).equals(v.slice(1)))return console.log("RDP man-in-the-middle detected."),void close();delete this.ntlm.publicKeyDer,this.ntlm.is_unicode?(l=d(this.ntlm.domain),f=d(this.ntlm.user),p=d(this.ntlm.password)):(l=Buffer.from(this.ntlm.domain,"utf8"),f=Buffer.from(this.ntlm.user,"utf8"),p=Buffer.from(this.ntlm.password,"utf8"));var y=L(t.security_interface.gss_wrapex(C(l,f,p)));for(var S in this.send(y),this.transport.removeAllListeners("data"),this.transport.removeAllListeners("close"),this.transport.removeAllListeners("error"),this.oldDataListeners)this.transport.once("data",this.oldDataListeners[S]);for(var S in this.oldCloseListeners)this.transport.on("close",this.oldCloseListeners[S]);for(var S in this.oldErrorListeners)this.transport.on("error",this.oldErrorListeners[S]);return this.transport.expect(2),this.state=3,void this.ntlm.completedFunc()}this.transport.expect(2),this.transport.once("data",(function(e){t.recvHeader(e)}))},u.prototype.send=function(e){this.transport.sendBuffer(e)},u.prototype.close=function(){this.transport.close()},u.prototype.sendNegotiateMessage=function(){this.ntlm.negotiate_message=S();var e=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,this.ntlm.negotiate_message.toString("binary"))])])])])]);this.send(Buffer.from(s.toDer(e).data,"binary"))},e.exports=u;var l={NtlmsspNegociate56:2147483648,NtlmsspNegociateKeyExch:1073741824,NtlmsspNegociate128:536870912,NtlmsspNegociateVersion:33554432,NtlmsspNegociateTargetInfo:8388608,NtlmsspRequestNonNTSessionKey:4194304,NtlmsspNegociateIdentify:1048576,NtlmsspNegociateExtendedSessionSecurity:524288,NtlmsspTargetTypeServer:131072,NtlmsspTargetTypeDomain:65536,NtlmsspNegociateAlwaysSign:32768,NtlmsspNegociateOEMWorkstationSupplied:8192,NtlmsspNegociateOEMDomainSupplied:4096,NtlmsspNegociateNTLM:512,NtlmsspNegociateLMKey:128,NtlmsspNegociateDatagram:64,NtlmsspNegociateSeal:32,NtlmsspNegociateSign:16,NtlmsspRequestTarget:4,NtlmNegotiateOEM:2,NtlmsspNegociateUnicode:1},f={WindowsMajorVersion5:5,WindowsMajorVersion6:6},p={WindowsMinorVersion0:0,WindowsMinorVersion1:1,WindowsMinorVersion2:2,WindowsMinorVersion3:3},h={NtlmSspRevisionW2K3:15};function d(e){return Buffer.from(e,"ucs2")}function v(e){try{return i.createHash("md4").update(e).digest()}catch(t){return Buffer.from(r(1890).array(e.toString("binary")))}}function y(e){return i.createHash("md5").update(e).digest()}function m(e,t){return i.createHmac("md5",e).update(t).digest()}function b(e,t,r){return m(v(d(e)),d(t.toUpperCase()+r))}function _(e,t,r){return b(e,t,r)}function g(e){return Buffer.alloc(e)}function E(e,t,r,n,o,a){var i=Buffer.from("01","hex"),c=Buffer.from("01","hex"),s=Buffer.concat([i,c,g(6),o,n,g(4),a]),u=m(e,Buffer.concat([r,s]));return[Buffer.concat([u,s]),Buffer.concat([m(t,Buffer.concat([r,n])),n]),m(e,u)]}function w(e,t){return P(e).update(t)}function P(e){var t={};try{t.n=i.createCipheriv("rc4",e,null),t.update=function(e){return t.n.update(e)}}catch(o){var n=r(4824);t.r=new n(e.toString("binary")),t.update=function(e){return Buffer.from(t.r.encrypt(e.toString("binary")),"hex")}}return t}function S(){return function(e,t,r){var n=e&l.NtlmsspNegociateVersion?40:32,o=Buffer.alloc(n);o.write("4e544c4d53535000",0,8,"hex"),o.writeInt32LE(1,8),o.writeInt32LE(e,12),o.writeInt16LE(t.length,16),o.writeInt16LE(t.length,18),t.length>0&&o.writeInt32LE(n,20);o.writeInt16LE(r.length,24),o.writeInt16LE(r.length,26),r.length>0&&o.writeInt32LE(n+t.length,28);e&l.NtlmsspNegociateVersion&&(o.writeUInt8(f.WindowsMajorVersion6,32),o.writeUInt8(p.WindowsMinorVersion0,33),o.writeInt16LE(6002,34),o.writeUInt8(h.NtlmSspRevisionW2K3,39));return Buffer.concat([o,t,r])}(l.NtlmsspNegociateKeyExch|l.NtlmsspNegociate128|l.NtlmsspNegociateExtendedSessionSecurity|l.NtlmsspNegociateAlwaysSign|l.NtlmsspNegociateNTLM|l.NtlmsspNegociateSeal|l.NtlmsspNegociateSign|l.NtlmsspRequestTarget|l.NtlmsspNegociateUnicode,Buffer.alloc(0),Buffer.alloc(0))}function k(e,t,r,n){var o=Buffer.alloc(4);o.writeInt32LE(r,0);var a=m(t,Buffer.concat([o,n]));return function(e,t){var r=Buffer.alloc(16);r.writeInt32LE(1,0),e&&e.copy(r,4,0,8);t&&r.writeInt32LE(t,12);return r}(e.update(a.slice(0,8)),r)}function A(e,t){return y(t?Buffer.concat([e,Buffer.from("session key to client-to-server signing key magic constant\0")]):Buffer.concat([e,Buffer.from("session key to server-to-client signing key magic constant\0")]))}function T(e,t){return y(t?Buffer.concat([e,Buffer.from("session key to client-to-server sealing key magic constant\0")]):Buffer.concat([e,Buffer.from("session key to server-to-client sealing key magic constant\0")]))}function O(e,t,r,n,o,a,i){var c=Buffer.concat([e,t,r,n,o,a]),s=i&l.NtlmsspNegociateVersion?88:80,u=Buffer.alloc(s-16);return u.write("4e544c4d53535000",0,8,"hex"),u.writeInt32LE(3,8),u.writeInt16LE(e.length,12),u.writeInt16LE(e.length,14),u.writeInt32LE(s,16),u.writeInt16LE(t.length,20),u.writeInt16LE(t.length,22),u.writeInt32LE(s+e.length,24),u.writeInt16LE(r.length,28),u.writeInt16LE(r.length,30),u.writeInt32LE(s+e.length+t.length,32),u.writeInt16LE(n.length,36),u.writeInt16LE(n.length,38),u.writeInt32LE(s+e.length+t.length+r.length,40),u.writeInt16LE(o.length,44),u.writeInt16LE(o.length,46),u.writeInt32LE(s+e.length+t.length+r.length+n.length,48),u.writeInt16LE(a.length,52),u.writeInt16LE(a.length,54),u.writeInt32LE(s+e.length+t.length+r.length+n.length+o.length,56),u.writeInt32LE(i,60),i&l.NtlmsspNegociateVersion&&(u.writeUInt8(f.WindowsMajorVersion6,64),u.writeUInt8(p.WindowsMinorVersion0,65),u.writeInt16LE(6002,66),u.writeUInt8(h.NtlmSspRevisionW2K3,71)),[u,c]}function L(e){return asn1obj=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,2,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))])]),Buffer.from(s.toDer(asn1obj).data,"binary")}function C(e,t,r){var n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.toString("binary"))]),s.create(s.Class.CONTEXT_SPECIFIC,2,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,r.toString("binary"))])]),o=s.toDer(n).data;return n=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(1))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,o)])]),Buffer.from(s.toDer(n).data,"binary")}function x(e,t){var r=s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.INTEGER,!1,s.integerToDer(2))]),s.create(s.Class.CONTEXT_SPECIFIC,1,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.UNIVERSAL,s.Type.SEQUENCE,!0,[s.create(s.Class.CONTEXT_SPECIFIC,0,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,e.toString("binary"))])])])]),s.create(s.Class.CONTEXT_SPECIFIC,3,!0,[s.create(s.Class.UNIVERSAL,s.Type.OCTETSTRING,!1,t.toString("binary"))])]);return Buffer.from(s.toDer(r).data,"binary")}},9790:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(5784).error,i={CAPSTYPE_GENERAL:1,CAPSTYPE_BITMAP:2,CAPSTYPE_ORDER:3,CAPSTYPE_BITMAPCACHE:4,CAPSTYPE_CONTROL:5,CAPSTYPE_ACTIVATION:7,CAPSTYPE_POINTER:8,CAPSTYPE_SHARE:9,CAPSTYPE_COLORCACHE:10,CAPSTYPE_SOUND:12,CAPSTYPE_INPUT:13,CAPSTYPE_FONT:14,CAPSTYPE_BRUSH:15,CAPSTYPE_GLYPHCACHE:16,CAPSTYPE_OFFSCREENCACHE:17,CAPSTYPE_BITMAPCACHE_HOSTSUPPORT:18,CAPSTYPE_BITMAPCACHE_REV2:19,CAPSTYPE_VIRTUALCHANNEL:20,CAPSTYPE_DRAWNINEGRIDCACHE:21,CAPSTYPE_DRAWGDIPLUS:22,CAPSTYPE_RAIL:23,CAPSTYPE_WINDOW:24,CAPSETTYPE_COMPDESK:25,CAPSETTYPE_MULTIFRAGMENTUPDATE:26,CAPSETTYPE_LARGE_POINTER:27,CAPSETTYPE_SURFACE_COMMANDS:28,CAPSETTYPE_BITMAP_CODECS:29,CAPSSETTYPE_FRAME_ACKNOWLEDGE:30},c={NEGOTIATEORDERSUPPORT:2,ZEROBOUNDSDELTASSUPPORT:8,COLORINDEXSUPPORT:32,SOLIDPATTERNBRUSHONLY:64,ORDERFLAGS_EXTRA_FLAGS:128},s={BRUSH_DEFAULT:0,BRUSH_COLOR_8x8:1,BRUSH_COLOR_FULL:2},u={GLYPH_SUPPORT_NONE:0,GLYPH_SUPPORT_PARTIAL:1,GLYPH_SUPPORT_FULL:2,GLYPH_SUPPORT_ENCODE:3},l={FALSE:0,TRUE:1},f={VCCAPS_NO_COMPR:0,VCCAPS_COMPR_SC:1,VCCAPS_COMPR_CS_8K:2},p={NONE:0,SOUND_BEEPS_FLAG:1};function h(e){var t={__TYPE__:i.CAPSTYPE_GENERAL,osMajorType:new n.UInt16Le,osMinorType:new n.UInt16Le,protocolVersion:new n.UInt16Le(512,{constant:!0}),pad2octetsA:new n.UInt16Le,generalCompressionTypes:new n.UInt16Le(0,{constant:!0}),extraFlags:new n.UInt16Le,updateCapabilityFlag:new n.UInt16Le(0,{constant:!0}),remoteUnshareFlag:new n.UInt16Le(0,{constant:!0}),generalCompressionLevel:new n.UInt16Le(0,{constant:!0}),refreshRectSupport:new n.UInt8,suppressOutputSupport:new n.UInt8};return new n.Component(t,e)}function d(e){var t={__TYPE__:i.CAPSTYPE_BITMAP,preferredBitsPerPixel:new n.UInt16Le,receive1BitPerPixel:new n.UInt16Le(1),receive4BitsPerPixel:new n.UInt16Le(1),receive8BitsPerPixel:new n.UInt16Le(1),desktopWidth:new n.UInt16Le,desktopHeight:new n.UInt16Le,pad2octets:new n.UInt16Le,desktopResizeFlag:new n.UInt16Le,bitmapCompressionFlag:new n.UInt16Le(1,{constant:!0}),highColorFlags:new n.UInt8(0),drawingFlags:new n.UInt8,multipleRectangleSupport:new n.UInt16Le(1,{constant:!0}),pad2octetsB:new n.UInt16Le};return new n.Component(t,e)}function v(e,t){if(e&&32!==e.size())throw new a.FatalError("NODE_RDP_PROTOCOL_PDU_CAPS_BAD_ORDERS_SIZE");var r={__TYPE__:i.CAPSTYPE_ORDER,terminalDescriptor:new n.BinaryString(Buffer.from(Array(17).join("\0"),"binary"),{readLength:new n.CallableValue(16)}),pad4octetsA:new n.UInt32Le(0),desktopSaveXGranularity:new n.UInt16Le(1),desktopSaveYGranularity:new n.UInt16Le(20),pad2octetsA:new n.UInt16Le(0),maximumOrderLevel:new n.UInt16Le(1),numberFonts:new n.UInt16Le,orderFlags:new n.UInt16Le(c.NEGOTIATEORDERSUPPORT),orderSupport:e||new n.Factory((function(e){r.orderSupport=new n.BinaryString(null,{readLength:new n.CallableValue(32)}).read(e)})),textFlags:new n.UInt16Le,orderSupportExFlags:new n.UInt16Le,pad4octetsB:new n.UInt32Le,desktopSaveSize:new n.UInt32Le(230400),pad2octetsC:new n.UInt16Le,pad2octetsD:new n.UInt16Le,textANSICodePage:new n.UInt16Le(0),pad2octetsE:new n.UInt16Le};return new n.Component(r,t)}function y(e){var t={__TYPE__:i.CAPSTYPE_BITMAPCACHE,pad1:new n.UInt32Le,pad2:new n.UInt32Le,pad3:new n.UInt32Le,pad4:new n.UInt32Le,pad5:new n.UInt32Le,pad6:new n.UInt32Le,cache0Entries:new n.UInt16Le,cache0MaximumCellSize:new n.UInt16Le,cache1Entries:new n.UInt16Le,cache1MaximumCellSize:new n.UInt16Le,cache2Entries:new n.UInt16Le,cache2MaximumCellSize:new n.UInt16Le};return new n.Component(t,e)}function m(e,t){var r={__TYPE__:i.CAPSTYPE_POINTER,colorPointerFlag:new n.UInt16Le,colorPointerCacheSize:new n.UInt16Le(20),pointerCacheSize:new n.UInt16Le(null,{conditional:function(){return e||!1}})};return new n.Component(r,t)}function b(e){var t={__TYPE__:i.CAPSTYPE_INPUT,inputFlags:new n.UInt16Le,pad2octetsA:new n.UInt16Le,keyboardLayout:new n.UInt32Le,keyboardType:new n.UInt32Le,keyboardSubType:new n.UInt32Le,keyboardFunctionKey:new n.UInt32Le,imeFileName:new n.BinaryString(Buffer.from(Array(65).join("\0"),"binary"),{readLength:new n.CallableValue(64)})};return new n.Component(t,e)}function _(e){var t={__TYPE__:i.CAPSTYPE_BRUSH,brushSupportLevel:new n.UInt32Le(s.BRUSH_DEFAULT)};return new n.Component(t,e)}function g(e){var t={cacheEntries:new n.UInt16Le,cacheMaximumCellSize:new n.UInt16Le};return new n.Component(t,e)}function E(e,t){var r={__TYPE__:i.CAPSTYPE_GLYPHCACHE,glyphCache:e||new n.Factory((function(e){r.glyphCache=new n.Component([]);for(var t=0;t<10;t++)r.glyphCache.obj.push(g().read(e))})),fragCache:new n.UInt32Le,glyphSupportLevel:new n.UInt16Le(u.GLYPH_SUPPORT_NONE),pad2octets:new n.UInt16Le};return new n.Component(r,t)}function w(e){var t={__TYPE__:i.CAPSTYPE_OFFSCREENCACHE,offscreenSupportLevel:new n.UInt32Le(l.FALSE),offscreenCacheSize:new n.UInt16Le,offscreenCacheEntries:new n.UInt16Le};return new n.Component(t,e)}function P(e){var t={__TYPE__:i.CAPSTYPE_VIRTUALCHANNEL,flags:new n.UInt32Le(f.VCCAPS_NO_COMPR),VCChunkSize:new n.UInt32Le(null,{optional:!0})};return new n.Component(t,e)}function S(e){var t={__TYPE__:i.CAPSTYPE_SOUND,soundFlags:new n.UInt16Le(p.NONE),pad2octetsA:new n.UInt16Le};return new n.Component(t,e)}function k(e){var t={__TYPE__:i.CAPSTYPE_CONTROL,controlFlags:new n.UInt16Le,remoteDetachFlag:new n.UInt16Le,controlInterest:new n.UInt16Le(2),detachInterest:new n.UInt16Le(2)};return new n.Component(t,e)}function A(e){var t={__TYPE__:i.CAPSTYPE_ACTIVATION,helpKeyFlag:new n.UInt16Le,helpKeyIndexFlag:new n.UInt16Le,helpExtendedKeyFlag:new n.UInt16Le,windowManagerKeyFlag:new n.UInt16Le};return new n.Component(t,e)}function T(e){var t={__TYPE__:i.CAPSTYPE_FONT,fontSupportFlags:new n.UInt16Le(1),pad2octets:new n.UInt16Le};return new n.Component(t,e)}function O(e){var t={__TYPE__:i.CAPSTYPE_COLORCACHE,colorTableCacheSize:new n.UInt16Le(6),pad2octets:new n.UInt16Le};return new n.Component(t,e)}function L(e){var t={__TYPE__:i.CAPSTYPE_SHARE,nodeId:new n.UInt16Le,pad2octets:new n.UInt16Le};return new n.Component(t,e)}function C(e){var t={__TYPE__:i.CAPSETTYPE_MULTIFRAGMENTUPDATE,MaxRequestSize:new n.UInt32Le(0)};return new n.Component(t,e)}e.exports={CapsType:i,MajorType:{OSMAJORTYPE_UNSPECIFIED:0,OSMAJORTYPE_WINDOWS:1,OSMAJORTYPE_OS2:2,OSMAJORTYPE_MACINTOSH:3,OSMAJORTYPE_UNIX:4,OSMAJORTYPE_IOS:5,OSMAJORTYPE_OSX:6,OSMAJORTYPE_ANDROID:7},MinorType:{OSMINORTYPE_UNSPECIFIED:0,OSMINORTYPE_WINDOWS_31X:1,OSMINORTYPE_WINDOWS_95:2,OSMINORTYPE_WINDOWS_NT:3,OSMINORTYPE_OS2_V21:4,OSMINORTYPE_POWER_PC:5,OSMINORTYPE_MACINTOSH:6,OSMINORTYPE_NATIVE_XSERVER:7,OSMINORTYPE_PSEUDO_XSERVER:8,OSMINORTYPE_WINDOWS_RT:9},GeneralExtraFlag:{FASTPATH_OUTPUT_SUPPORTED:1,NO_BITMAP_COMPRESSION_HDR:1024,LONG_CREDENTIALS_SUPPORTED:4,AUTORECONNECT_SUPPORTED:8,ENC_SALTED_CHECKSUM:16},Boolean:{FALSE:0,TRUE:1},OrderFlag:c,Order:{TS_NEG_DSTBLT_INDEX:0,TS_NEG_PATBLT_INDEX:1,TS_NEG_SCRBLT_INDEX:2,TS_NEG_MEMBLT_INDEX:3,TS_NEG_MEM3BLT_INDEX:4,TS_NEG_DRAWNINEGRID_INDEX:7,TS_NEG_LINETO_INDEX:8,TS_NEG_MULTI_DRAWNINEGRID_INDEX:9,TS_NEG_SAVEBITMAP_INDEX:11,TS_NEG_MULTIDSTBLT_INDEX:15,TS_NEG_MULTIPATBLT_INDEX:16,TS_NEG_MULTISCRBLT_INDEX:17,TS_NEG_MULTIOPAQUERECT_INDEX:18,TS_NEG_FAST_INDEX_INDEX:19,TS_NEG_POLYGON_SC_INDEX:20,TS_NEG_POLYGON_CB_INDEX:21,TS_NEG_POLYLINE_INDEX:22,TS_NEG_FAST_GLYPH_INDEX:24,TS_NEG_ELLIPSE_SC_INDEX:25,TS_NEG_ELLIPSE_CB_INDEX:26,TS_NEG_INDEX_INDEX:27},OrderEx:{ORDERFLAGS_EX_CACHE_BITMAP_REV3_SUPPORT:2,ORDERFLAGS_EX_ALTSEC_FRAME_MARKER_SUPPORT:4},InputFlags:{INPUT_FLAG_SCANCODES:1,INPUT_FLAG_MOUSEX:4,INPUT_FLAG_FASTPATH_INPUT:8,INPUT_FLAG_UNICODE:16,INPUT_FLAG_FASTPATH_INPUT2:32,INPUT_FLAG_UNUSED1:64,INPUT_FLAG_UNUSED2:128,TS_INPUT_FLAG_MOUSE_HWHEEL:256},BrushSupport:s,GlyphSupport:u,OffscreenSupportLevel:l,VirtualChannelCompressionFlag:f,SoundFlag:p,generalCapability:h,bitmapCapability:d,orderCapability:v,bitmapCacheCapability:y,pointerCapability:m,inputCapability:b,brushCapability:_,cacheEntry:g,glyphCapability:E,offscreenBitmapCacheCapability:w,virtualChannelCapability:P,soundCapability:S,controlCapability:k,windowActivationCapability:A,fontCapability:T,colorCacheCapability:O,shareCapability:L,multiFragmentUpdate:C,capability:function(e,t){var r={capabilitySetType:new n.UInt16Le((function(){return r.capability.obj.__TYPE__})),lengthCapability:new n.UInt16Le((function(){return new n.Component(r).size()})),capability:e||new n.Factory((function(e){switch(r.capabilitySetType.value){case i.CAPSTYPE_GENERAL:r.capability=h({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BITMAP:r.capability=d({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_ORDER:r.capability=v(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BITMAPCACHE:r.capability=y({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_POINTER:r.capability=m(!1,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_INPUT:r.capability=b({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_BRUSH:r.capability=_({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_GLYPHCACHE:r.capability=E(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_OFFSCREENCACHE:r.capability=w({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_VIRTUALCHANNEL:r.capability=P({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_SOUND:r.capability=S({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_CONTROL:r.capability=k({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_ACTIVATION:r.capability=A({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_FONT:r.capability=T({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_COLORCACHE:r.capability=O({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSTYPE_SHARE:r.capability=L({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;case i.CAPSETTYPE_MULTIFRAGMENTUPDATE:r.capability=C({readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e);break;default:o.debug("unknown capability "+r.capabilitySetType.value),r.capability=new n.BinaryString(null,{readLength:new n.CallableValue((function(){return r.lengthCapability.value-4}))}).read(e)}}))};return new n.Component(r,t)}}},2461:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function a(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t,r){return t=l(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,u()?Reflect.construct(t,r||[],l(e).constructor):t.apply(e,r))}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(u=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function f(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}var h=r(5784).type,d=r(6261).EventEmitter,v=(r(9790),r(5784).log,r(1467)),y=function(e){function t(e,r){var n;return c(this,t),(n=s(this,t,[e,r])).transport.once("connect",(function(e,t,r){n.connect(e,t,r)})).on("close",(function(){})).on("error",(function(e){})),n.content="",n}return f(t,e),a(t,[{key:"connect",value:function(e,t,r){var n=this;this.gccCore=e,this.userId=t,this.channelId=r,this.transport.once("cliprdr",(function(e){n.recv(e)}))}},{key:"send",value:function(e){this.transport.send("cliprdr",new h.Component([new h.UInt32Le(e.size()),new h.UInt32Le(19),e]))}},{key:"recv",value:function(e){var t=this;e.offset=18;var r=v.clipPDU().read(e),n=v.ClipPDUMsgType;switch(r.obj.header.obj.msgType.value){case n.CB_MONITOR_READY:this.recvMonitorReadyPDU(e);break;case n.CB_FORMAT_LIST:this.recvFormatListPDU(e);break;case n.CB_FORMAT_LIST_RESPONSE:this.recvFormatListResponsePDU(e);break;case n.CB_FORMAT_DATA_REQUEST:this.recvFormatDataRequestPDU(e);break;case n.CB_FORMAT_DATA_RESPONSE:this.recvFormatDataResponsePDU(e);break;case n.CB_TEMP_DIRECTORY:break;case n.CB_CLIP_CAPS:this.recvClipboardCapsPDU(e);case n.CB_FILECONTENTS_REQUEST:}this.transport.once("cliprdr",(function(e){t.recv(e)}))}},{key:"recvClipboardCapsPDU",value:function(e){e.offset=18}},{key:"recvMonitorReadyPDU",value:function(e){e.offset=18,this.sendClipboardCapsPDU(),this.sendFormatListPDU()}},{key:"sendClipboardCapsPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_CLIP_CAPS),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(16),cCapabilitiesSets:new h.UInt16Le(1),pad1:new h.UInt16Le(0),capabilitySetType:new h.UInt16Le(1),lengthCapability:new h.UInt16Le(12),version:new h.UInt32Le(2),capabilityFlags:new h.UInt32Le(2)}))}},{key:"sendClientTemporaryDirectoryPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_TEMP_DIRECTORY),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(520),wszTempDir:new h.BinaryString(Buffer.from("D:\\Vectors"+Array(251).join("\0"),"ucs2"),{readLength:new h.CallableValue(520)})}))}},{key:"sendFormatListPDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_LIST),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(36),formatId6:new h.UInt32Le(49156),formatName6:new h.BinaryString(Buffer.from("Native\0","ucs2"),{readLength:new h.CallableValue(14)}),formatId8:new h.UInt32Le(13),formatName8:new h.UInt16Le(0),formatId9:new h.UInt32Le(16),formatName9:new h.UInt16Le(0),formatId0:new h.UInt32Le(1),formatName0:new h.UInt16Le(0),formatId5:new h.UInt32Le(7),formatName5:new h.UInt16Le(0)}))}},{key:"recvFormatListPDU",value:function(e){e.offset=18,this.sendFormatListResponsePDU()}},{key:"sendFormatListResponsePDU",value:function(){this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_LIST_RESPONSE),msgFlags:new h.UInt16Le(1),dataLen:new h.UInt32Le(0)})),this.sendFormatDataRequestPDU()}},{key:"recvFormatListResponsePDU",value:function(e){e.offset=18}},{key:"sendFormatDataRequestPDU",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:13;this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_DATA_REQUEST),msgFlags:new h.UInt16Le(0),dataLen:new h.UInt32Le(4),requestedFormatId:new h.UInt32Le(e)}))}},{key:"recvFormatDataRequestPDU",value:function(e){e.offset=18,this.sendFormatDataResponsePDU()}},{key:"sendFormatDataResponsePDU",value:function(){var e=Buffer.from(this.content+"\0","ucs2");this.send(new h.Component({msgType:new h.UInt16Le(v.ClipPDUMsgType.CB_FORMAT_DATA_RESPONSE),msgFlags:new h.UInt16Le(1),dataLen:new h.UInt32Le(e.length),requestedFormatData:new h.BinaryString(e,{readLength:new h.CallableValue(e.length)})}))}},{key:"recvFormatDataResponsePDU",value:function(e){e.offset=18;var t=e.buffer.toString("ucs2",26,e.buffer.length-2);this.content=t,this.emit("clipboard",t)}},{key:"setClipboardData",value:function(e){this.content=e,this.sendFormatListPDU()}}])}(function(e){function t(e){var r;return c(this,t),(r=s(this,t)).transport=e,r.userId=0,r.serverCapabilities=[],r.clientCapabilities=[],r}return f(t,e),a(t)}(d));e.exports={Client:y}},1467:(e,t,r)=>{var n=r(9790),o=r(5784).type,a=r(5784).log,i={PDUTYPE_DEMANDACTIVEPDU:17,PDUTYPE_CONFIRMACTIVEPDU:19,PDUTYPE_DEACTIVATEALLPDU:22,PDUTYPE_DATAPDU:23,PDUTYPE_SERVER_REDIR_PKT:26},c={PDUTYPE2_UPDATE:2,PDUTYPE2_CONTROL:20,PDUTYPE2_POINTER:27,PDUTYPE2_INPUT:28,PDUTYPE2_SYNCHRONIZE:31,PDUTYPE2_REFRESH_RECT:33,PDUTYPE2_PLAY_SOUND:34,PDUTYPE2_SUPPRESS_OUTPUT:35,PDUTYPE2_SHUTDOWN_REQUEST:36,PDUTYPE2_SHUTDOWN_DENIED:37,PDUTYPE2_SAVE_SESSION_INFO:38,PDUTYPE2_FONTLIST:39,PDUTYPE2_FONTMAP:40,PDUTYPE2_SET_KEYBOARD_INDICATORS:41,PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST:43,PDUTYPE2_BITMAPCACHE_ERROR_PDU:44,PDUTYPE2_SET_KEYBOARD_IME_STATUS:45,PDUTYPE2_OFFSCRCACHE_ERROR_PDU:46,PDUTYPE2_SET_ERROR_INFO_PDU:47,PDUTYPE2_DRAWNINEGRID_ERROR_PDU:48,PDUTYPE2_DRAWGDIPLUS_ERROR_PDU:49,PDUTYPE2_ARC_STATUS_PDU:50,PDUTYPE2_STATUS_INFO_PDU:54,PDUTYPE2_MONITOR_LAYOUT_PDU:55},s={STREAM_UNDEFINED:0,STREAM_LOW:1,STREAM_MED:2,STREAM_HI:4},u={BITMAP_COMPRESSION:1,NO_BITMAP_COMPRESSION_HDR:1024},l={UPDATETYPE_ORDERS:0,UPDATETYPE_BITMAP:1,UPDATETYPE_PALETTE:2,UPDATETYPE_SYNCHRONIZE:3},f={INPUT_EVENT_SYNC:0,INPUT_EVENT_UNUSED:2,INPUT_EVENT_SCANCODE:4,INPUT_EVENT_UNICODE:5,INPUT_EVENT_MOUSE:32769,INPUT_EVENT_MOUSEX:32770},p={FASTPATH_UPDATETYPE_ORDERS:0,FASTPATH_UPDATETYPE_BITMAP:1,FASTPATH_UPDATETYPE_PALETTE:2,FASTPATH_UPDATETYPE_SYNCHRONIZE:3,FASTPATH_UPDATETYPE_SURFCMDS:4,FASTPATH_UPDATETYPE_PTR_NULL:5,FASTPATH_UPDATETYPE_PTR_DEFAULT:6,FASTPATH_UPDATETYPE_PTR_POSITION:8,FASTPATH_UPDATETYPE_COLOR:9,FASTPATH_UPDATETYPE_CACHED:10,FASTPATH_UPDATETYPE_POINTER:11},h={FASTPATH_OUTPUT_COMPRESSION_USED:2},d={SUPPRESS_DISPLAY_UPDATES:0,ALLOW_DISPLAY_UPDATES:1};function v(e,t,r,n){var a={totalLength:new o.UInt16Le(e),pduType:new o.UInt16Le(t),PDUSource:new o.UInt16Le(r,{optional:!0})};return new o.Component(a,n)}function y(e,t,r,n){var a={shareId:new o.UInt32Le(r),pad1:new o.UInt8,streamId:new o.UInt8(s.STREAM_LOW),uncompressedLength:new o.UInt16Le((function(){return e.value-8})),pduType2:new o.UInt8(t),compressedType:new o.UInt8,compressedLength:new o.UInt16Le};return new o.Component(a,n)}function m(e,t){var r={__PDUTYPE__:i.PDUTYPE_DEMANDACTIVEPDU,shareId:new o.UInt32Le,lengthSourceDescriptor:new o.UInt16Le((function(){return r.sourceDescriptor.size()})),lengthCombinedCapabilities:new o.UInt16Le((function(){return r.numberCapabilities.size()+r.pad2Octets.size()+r.capabilitySets.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("node-rdpjs","binary"),{readLength:new o.CallableValue((function(){return r.lengthSourceDescriptor.value}))}),numberCapabilities:new o.UInt16Le((function(){return r.capabilitySets.obj.length})),pad2Octets:new o.UInt16Le,capabilitySets:e||new o.Factory((function(e){r.capabilitySets=new o.Component([]);for(var t=0;t<r.numberCapabilities.value;t++)r.capabilitySets.obj.push(n.capability().read(e))})),sessionId:new o.UInt32Le};return new o.Component(r,t)}function b(e,t,r){var a={__PDUTYPE__:i.PDUTYPE_CONFIRMACTIVEPDU,shareId:new o.UInt32Le(t),originatorId:new o.UInt16Le(1002,{constant:!0}),lengthSourceDescriptor:new o.UInt16Le((function(){return a.sourceDescriptor.size()})),lengthCombinedCapabilities:new o.UInt16Le((function(){return a.numberCapabilities.size()+a.pad2Octets.size()+a.capabilitySets.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("rdpy","binary"),{readLength:new o.CallableValue((function(){return a.lengthSourceDescriptor.value}))}),numberCapabilities:new o.UInt16Le((function(){return a.capabilitySets.obj.length})),pad2Octets:new o.UInt16Le,capabilitySets:e||new o.Factory((function(e){a.capabilitySets=new o.Component([]);for(var t=0;t<a.numberCapabilities.value;t++)a.capabilitySets.obj.push(n.capability().read(e))}))};return new o.Component(a,r)}function _(e){var t={__PDUTYPE__:i.PDUTYPE_DEACTIVATEALLPDU,shareId:new o.UInt32Le,lengthSourceDescriptor:new o.UInt16Le((function(){return t.sourceDescriptor.size()})),sourceDescriptor:new o.BinaryString(Buffer.from("rdpy","binary"),{readLength:new o.CallableValue((function(){t.lengthSourceDescriptor}))})};return new o.Component(t,e)}function g(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_SYNCHRONIZE,messageType:new o.UInt16Le(1,{constant:!0}),targetUser:new o.UInt16Le(e)};return new o.Component(r,t)}function E(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_CONTROL,action:new o.UInt16Le(e),grantId:new o.UInt16Le,controlId:new o.UInt32Le};return new o.Component(r,t)}function w(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_SET_ERROR_INFO_PDU,errorInfo:new o.UInt32Le(e)};return new o.Component(r,t)}function P(e){var t={__PDUTYPE2__:c.PDUTYPE2_FONTLIST,numberFonts:new o.UInt16Le,totalNumFonts:new o.UInt16Le,listFlags:new o.UInt16Le(3),entrySize:new o.UInt16Le(50)};return new o.Component(t,e)}function S(e){var t={__PDUTYPE2__:c.PDUTYPE2_FONTMAP,numberEntries:new o.UInt16Le,totalNumEntries:new o.UInt16Le,mapFlags:new o.UInt16Le(3),entrySize:new o.UInt16Le(4)};return new o.Component(t,e)}function k(e){var t={key1:new o.UInt32Le,key2:new o.UInt32Le};return new o.Component(t,e)}function A(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST,numEntriesCache0:new o.UInt16Le,numEntriesCache1:new o.UInt16Le,numEntriesCache2:new o.UInt16Le,numEntriesCache3:new o.UInt16Le,numEntriesCache4:new o.UInt16Le,totalEntriesCache0:new o.UInt16Le,totalEntriesCache1:new o.UInt16Le,totalEntriesCache2:new o.UInt16Le,totalEntriesCache3:new o.UInt16Le,totalEntriesCache4:new o.UInt16Le,bitMask:new o.UInt8,pad2:new o.UInt8,pad3:new o.UInt16Le,entries:e||new o.Factory((function(e){var t=r.numEntriesCache0.value+r.numEntriesCache1.value+r.numEntriesCache2.value+r.numEntriesCache3.value+r.numEntriesCache4.value;r.entries=new o.Component([]);for(var n=0;n<t;n++)r.entries.obj.push(k().read(e))}))};return new o.Component(r,t)}function T(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_SYNC,pad2Octets:new o.UInt16Le,toggleFlags:new o.UInt32Le};return new o.Component(t,e)}function O(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_MOUSE,pointerFlags:new o.UInt16Le,xPos:new o.UInt16Le,yPos:new o.UInt16Le};return new o.Component(t,e)}function L(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_SCANCODE,keyboardFlags:new o.UInt16Le,keyCode:new o.UInt16Le,pad2Octets:new o.UInt16Le};return new o.Component(t,e)}function C(e){var t={__INPUT_MESSAGE_TYPE__:f.INPUT_EVENT_UNICODE,keyboardFlags:new o.UInt16Le,unicode:new o.UInt16Le,pad2Octets:new o.UInt16Le};return new o.Component(t,e)}function x(e,t){var r={eventTime:new o.UInt32Le,messageType:new o.UInt16Le((function(){return r.slowPathInputData.obj.__INPUT_MESSAGE_TYPE__})),slowPathInputData:e||new o.Factory((function(e){switch(r.messageType.value){case f.INPUT_EVENT_SYNC:r.slowPathInputData=T().read(e);break;case f.INPUT_EVENT_MOUSE:r.slowPathInputData=O().read(e);break;case f.INPUT_EVENT_SCANCODE:r.slowPathInputData=L().read(e);break;case f.INPUT_EVENT_UNICODE:r.slowPathInputData=C().read(e);break;default:a.error("unknown slowPathInputEvent "+r.messageType.value)}}))};return new o.Component(r,t)}function I(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_INPUT,numEvents:new o.UInt16Le((function(){return r.slowPathInputEvents.obj.length})),pad2Octets:new o.UInt16Le,slowPathInputEvents:e||new o.Factory((function(e){r.slowPathInputEvents=new o.Component([]);for(var t=0;t<r.numEvents.value;t++)r.slowPathInputEvents.obj.push(x().read(e))}))};return new o.Component(r,t)}function H(e){var t={__PDUTYPE2__:c.PDUTYPE2_SHUTDOWN_REQUEST};return new o.Component(t,e)}function N(e){var t={__PDUTYPE2__:c.PDUTYPE2_SHUTDOWN_DENIED};return new o.Component(t,e)}function D(e){var t={left:new o.UInt16Le,top:new o.UInt16Le,right:new o.UInt16Le,bottom:new o.UInt16Le};return new o.Component(t,e)}function R(e){var t={__PDUTYPE2__:c.PDUTYPE2_SUPPRESS_OUTPUT,allowDisplayUpdates:new o.UInt8,pad3Octets:new o.Component([new o.UInt8,new o.UInt8,new o.UInt8]),desktopRect:D({conditional:function(){return t.allowDisplayUpdates.value===d.ALLOW_DISPLAY_UPDATES}})};return new o.Component(t,e)}function F(e,t){var r={__PDUTYPE2__:c.PDUTYPE2_REFRESH_RECT,numberOfAreas:UInt8((function(){return r.areasToRefresh.obj.length})),pad3Octets:new o.Component([new o.UInt8,new o.UInt8,new o.UInt8]),areasToRefresh:e||new o.Factory((function(e){r.areasToRefresh=new o.Component([]);for(var t=0;t<r.numberOfAreas.value;t++)r.areasToRefresh.obj.push(D().read(e))}))};return new o.Component(r,t)}function U(e){var t={cbCompFirstRowSize:new o.UInt16Le(0,{constant:!0}),cbCompMainBodySize:new o.UInt16Le,cbScanWidth:new o.UInt16Le,cbUncompressedSize:new o.UInt16Le};return new o.Component(t,e)}function j(e,t){e=e||{};var r={destLeft:new o.UInt16Le(e.destLeft),destTop:new o.UInt16Le(e.destTop),destRight:new o.UInt16Le(e.destRight),destBottom:new o.UInt16Le(e.destBottom),width:new o.UInt16Le(e.width),height:new o.UInt16Le(e.height),bitsPerPixel:new o.UInt16Le(e.bitsPerPixel),flags:new o.UInt16Le,bitmapLength:new o.UInt16Le((function(){return r.bitmapComprHdr.size()+r.bitmapDataStream.size()})),bitmapComprHdr:U({conditional:function(){return r.flags.value&u.BITMAP_COMPRESSION&&!(r.flags.value&u.NO_BITMAP_COMPRESSION_HDR)}}),bitmapDataStream:new o.BinaryString(e.data,{readLength:new o.CallableValue((function(){return!r.flags.value&u.BITMAP_COMPRESSION||r.flags.value&u.NO_BITMAP_COMPRESSION_HDR?r.bitmapLength.value:r.bitmapComprHdr.cbCompMainBodySize.value}))})};return new o.Component(r,t)}function M(e,t){var r={__UPDATE_TYPE__:l.UPDATETYPE_BITMAP,numberRectangles:new o.UInt16Le((function(){return r.rectangles.obj.length})),rectangles:e||new o.Factory((function(e){r.rectangles=new o.Component([]);for(var t=0;t<r.numberRectangles.value;t++)r.rectangles.obj.push(j().read(e))}))};return new o.Component(r,t)}function B(e,t){var r={__PDUTYPE2_:c.PDUTYPE2_UPDATE__,updateType:new o.UInt16Le((function(){return r.updateData.obj.__UPDATE_TYPE__})),updateData:e||new o.Factory((function(e){var n={readLength:new o.CallableValue((function(){return t.readLength.value-2}))};switch(r.updateType.value){case l.UPDATETYPE_BITMAP:r.updateData=M(null,n).read(e);break;case l.UPDATETYPE_SYNCHRONIZE:r.updateData=function(e){var t={pad2Octets:new o.UInt16Le};return new o.Component(t,e)}(null).read(e);break;default:r.updateData=new o.BinaryString(null,n).read(e),a.debug("unknown updateDataPDU "+r.updateType.value)}}))};return new o.Component(r,t)}function G(e,t,r){var n={__PDUTYPE__:i.PDUTYPE_DATAPDU,shareDataHeader:y(new o.CallableValue((function(){return new o.Component(n).size()})),(function(){return n.pduData.obj.__PDUTYPE2__}),t),pduData:e||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return r.readLength.value-n.shareDataHeader.size()}))};switch(n.shareDataHeader.obj.pduType2.value){case c.PDUTYPE2_SYNCHRONIZE:n.pduData=g(null,t).read(e);break;case c.PDUTYPE2_CONTROL:n.pduData=E(null,t).read(e);break;case c.PDUTYPE2_SET_ERROR_INFO_PDU:n.pduData=w(null,t).read(e);break;case c.PDUTYPE2_FONTLIST:n.pduData=P(t).read(e);break;case c.PDUTYPE2_FONTMAP:n.pduData=S(t).read(e);break;case c.PDUTYPE2_BITMAPCACHE_PERSISTENT_LIST:n.pduData=A(null,t).read(e);break;case c.PDUTYPE2_INPUT:n.pduData=I(null,t).read(e);break;case c.PDUTYPE2_SHUTDOWN_REQUEST:n.pduData=H(t).read(e);break;case c.PDUTYPE2_SHUTDOWN_DENIED:n.pduData=N(t).read(e);break;case c.PDUTYPE2_SUPPRESS_OUTPUT:n.pduData=R(t).read(e);break;case c.PDUTYPE2_REFRESH_RECT:n.pduData=F(null,t).read(e);break;case c.PDUTYPE2_UPDATE:n.pduData=B(null,t).read(e);break;default:n.pduData=new o.BinaryString(null,t).read(e),a.debug("unknown PDUType2 "+n.shareDataHeader.obj.pduType2.value)}}))};return new o.Component(n,r)}function Y(e){var t={__FASTPATH_UPDATE_TYPE__:p.FASTPATH_UPDATETYPE_BITMAP,header:new o.UInt16Le(p.FASTPATH_UPDATETYPE_BITMAP,{constant:!0}),numberRectangles:new o.UInt16Le((function(){return t.rectangles.obj.length})),rectangles:new o.Factory((function(e){t.rectangles=new o.Component([]);for(var r=0;r<t.numberRectangles.value;r++)t.rectangles.obj.push(j().read(e))}))};return new o.Component(t,e)}var V={903013897:"alias",370524792:"all-scroll",853046751:"cell",2101250798:"col-resize",703681364:"copy",992638936:"crosshair",1539083673:"ew-resize",1919796298:"grab",1010243511:"grabbing",1247283057:"help",1390892051:"none",885751489:"not-allowed",1732952247:"row-resize",747144997:"url",2018345610:"zoom-in",347367048:"zoom-out",1872942890:"default",1737852989:"text",1932827019:"ns-resize",1884471290:"nesw-resize",1204065391:"nwse-resize",2030531519:"progress",1050842114:"pointer",1258195498:"default",219484254:"all-scroll",399295089:"text",1912613597:"wait",864127801:"ew-resize",23245044:"nesw-resize",1966995494:"not-allowed",1873216615:"help",255126408:"nesw-resize",157191894:"ns-resize",1768446509:"pointer",1032011501:"crosshair"};e.exports={PDUType:i,PDUType2:c,StreamId:s,CompressionOrder:{CompressionTypeMask:15,PACKET_COMPRESSED:32,PACKET_AT_FRONT:64,PACKET_FLUSHED:128},CompressionType:{PACKET_COMPR_TYPE_8K:0,PACKET_COMPR_TYPE_64K:1,PACKET_COMPR_TYPE_RDP6:2,PACKET_COMPR_TYPE_RDP61:3},Action:{CTRLACTION_REQUEST_CONTROL:1,CTRLACTION_GRANTED_CONTROL:2,CTRLACTION_DETACH:3,CTRLACTION_COOPERATE:4},PersistentKeyListFlag:{PERSIST_FIRST_PDU:1,PERSIST_LAST_PDU:2},BitmapFlag:u,UpdateType:l,InputMessageType:f,PointerFlag:{PTRFLAGS_HWHEEL:1024,PTRFLAGS_WHEEL:512,PTRFLAGS_WHEEL_NEGATIVE:256,WheelRotationMask:511,PTRFLAGS_MOVE:2048,PTRFLAGS_DOWN:32768,PTRFLAGS_BUTTON1:4096,PTRFLAGS_BUTTON2:8192,PTRFLAGS_BUTTON3:16384},KeyboardFlag:{KBDFLAGS_EXTENDED:256,KBDFLAGS_DOWN:16384,KBDFLAGS_RELEASE:32768},FastPathOutputCompression:h,Display:d,ToogleFlag:{TS_SYNC_SCROLL_LOCK:1,TS_SYNC_NUM_LOCK:2,TS_SYNC_CAPS_LOCK:4,TS_SYNC_KANA_LOCK:8},ErrorInfo:{ERRINFO_RPC_INITIATED_DISCONNECT:1,ERRINFO_RPC_INITIATED_LOGOFF:2,ERRINFO_IDLE_TIMEOUT:3,ERRINFO_LOGON_TIMEOUT:4,ERRINFO_DISCONNECTED_BY_OTHERCONNECTION:5,ERRINFO_OUT_OF_MEMORY:6,ERRINFO_SERVER_DENIED_CONNECTION:7,ERRINFO_SERVER_INSUFFICIENT_PRIVILEGES:9,ERRINFO_SERVER_FRESH_CREDENTIALS_REQUIRED:10,ERRINFO_RPC_INITIATED_DISCONNECT_BYUSER:11,ERRINFO_LOGOFF_BY_USER:12,ERRINFO_LICENSE_INTERNAL:256,ERRINFO_LICENSE_NO_LICENSE_SERVER:257,ERRINFO_LICENSE_NO_LICENSE:258,ERRINFO_LICENSE_BAD_CLIENT_MSG:259,ERRINFO_LICENSE_HWID_DOESNT_MATCH_LICENSE:260,ERRINFO_LICENSE_BAD_CLIENT_LICENSE:261,ERRINFO_LICENSE_CANT_FINISH_PROTOCOL:262,ERRINFO_LICENSE_CLIENT_ENDED_PROTOCOL:263,ERRINFO_LICENSE_BAD_CLIENT_ENCRYPTION:264,ERRINFO_LICENSE_CANT_UPGRADE_LICENSE:265,ERRINFO_LICENSE_NO_REMOTE_CONNECTIONS:266,ERRINFO_CB_DESTINATION_NOT_FOUND:1024,ERRINFO_CB_LOADING_DESTINATION:1026,ERRINFO_CB_REDIRECTING_TO_DESTINATION:1028,ERRINFO_CB_SESSION_ONLINE_VM_WAKE:1029,ERRINFO_CB_SESSION_ONLINE_VM_BOOT:1030,ERRINFO_CB_SESSION_ONLINE_VM_NO_DNS:1031,ERRINFO_CB_DESTINATION_POOL_NOT_FREE:1032,ERRINFO_CB_CONNECTION_CANCELLED:1033,ERRINFO_CB_CONNECTION_ERROR_INVALID_SETTINGS:1040,ERRINFO_CB_SESSION_ONLINE_VM_BOOT_TIMEOUT:1041,ERRINFO_CB_SESSION_ONLINE_VM_SESSMON_FAILED:1042,ERRINFO_UNKNOWNPDUTYPE2:4297,ERRINFO_UNKNOWNPDUTYPE:4298,ERRINFO_DATAPDUSEQUENCE:4299,ERRINFO_CONTROLPDUSEQUENCE:4301,ERRINFO_INVALIDCONTROLPDUACTION:4302,ERRINFO_INVALIDINPUTPDUTYPE:4303,ERRINFO_INVALIDINPUTPDUMOUSE:4304,ERRINFO_INVALIDREFRESHRECTPDU:4305,ERRINFO_CREATEUSERDATAFAILED:4306,ERRINFO_CONNECTFAILED:4307,ERRINFO_CONFIRMACTIVEWRONGSHAREID:4308,ERRINFO_CONFIRMACTIVEWRONGORIGINATOR:4309,ERRINFO_PERSISTENTKEYPDUBADLENGTH:4314,ERRINFO_PERSISTENTKEYPDUILLEGALFIRST:4315,ERRINFO_PERSISTENTKEYPDUTOOMANYTOTALKEYS:4316,ERRINFO_PERSISTENTKEYPDUTOOMANYCACHEKEYS:4317,ERRINFO_INPUTPDUBADLENGTH:4318,ERRINFO_BITMAPCACHEERRORPDUBADLENGTH:4319,ERRINFO_SECURITYDATATOOSHORT:4320,ERRINFO_VCHANNELDATATOOSHORT:4321,ERRINFO_SHAREDATATOOSHORT:4322,ERRINFO_BADSUPRESSOUTPUTPDU:4323,ERRINFO_CONFIRMACTIVEPDUTOOSHORT:4325,ERRINFO_CAPABILITYSETTOOSMALL:4327,ERRINFO_CAPABILITYSETTOOLARGE:4328,ERRINFO_NOCURSORCACHE:4329,ERRINFO_BADCAPABILITIES:4330,ERRINFO_VIRTUALCHANNELDECOMPRESSIONERR:4332,ERRINFO_INVALIDVCCOMPRESSIONTYPE:4333,ERRINFO_INVALIDCHANNELID:4335,ERRINFO_VCHANNELSTOOMANY:4336,ERRINFO_REMOTEAPPSNOTENABLED:4339,ERRINFO_CACHECAPNOTSET:4340,ERRINFO_BITMAPCACHEERRORPDUBADLENGTH2:4341,ERRINFO_OFFSCRCACHEERRORPDUBADLENGTH:4342,ERRINFO_DNGCACHEERRORPDUBADLENGTH:4343,ERRINFO_GDIPLUSPDUBADLENGTH:4344,ERRINFO_SECURITYDATATOOSHORT2:4369,ERRINFO_SECURITYDATATOOSHORT3:4370,ERRINFO_SECURITYDATATOOSHORT4:4371,ERRINFO_SECURITYDATATOOSHORT5:4372,ERRINFO_SECURITYDATATOOSHORT6:4373,ERRINFO_SECURITYDATATOOSHORT7:4374,ERRINFO_SECURITYDATATOOSHORT8:4375,ERRINFO_SECURITYDATATOOSHORT9:4376,ERRINFO_SECURITYDATATOOSHORT10:4377,ERRINFO_SECURITYDATATOOSHORT11:4378,ERRINFO_SECURITYDATATOOSHORT12:4379,ERRINFO_SECURITYDATATOOSHORT13:4380,ERRINFO_SECURITYDATATOOSHORT14:4381,ERRINFO_SECURITYDATATOOSHORT15:4382,ERRINFO_SECURITYDATATOOSHORT16:4383,ERRINFO_SECURITYDATATOOSHORT17:4384,ERRINFO_SECURITYDATATOOSHORT18:4385,ERRINFO_SECURITYDATATOOSHORT19:4386,ERRINFO_SECURITYDATATOOSHORT20:4387,ERRINFO_SECURITYDATATOOSHORT21:4388,ERRINFO_SECURITYDATATOOSHORT22:4389,ERRINFO_SECURITYDATATOOSHORT23:4390,ERRINFO_BADMONITORDATA:4393,ERRINFO_VCDECOMPRESSEDREASSEMBLEFAILED:4394,ERRINFO_VCDATATOOLONG:4395,ERRINFO_BAD_FRAME_ACK_DATA:4396,ERRINFO_GRAPHICSMODENOTSUPPORTED:4397,ERRINFO_GRAPHICSSUBSYSTEMRESETFAILED:4398,ERRINFO_GRAPHICSSUBSYSTEMFAILED:4399,ERRINFO_TIMEZONEKEYNAMELENGTHTOOSHORT:4400,ERRINFO_TIMEZONEKEYNAMELENGTHTOOLONG:4401,ERRINFO_DYNAMICDSTDISABLEDFIELDMISSING:4402,ERRINFO_VCDECODINGERROR:4403,ERRINFO_UPDATESESSIONKEYFAILED:4497,ERRINFO_DECRYPTFAILED:4498,ERRINFO_ENCRYPTFAILED:4499,ERRINFO_ENCPKGMISMATCH:4500,ERRINFO_DECRYPTFAILED2:4501},FastPathUpdateType:p,shareControlHeader:v,shareDataHeader:y,demandActivePDU:m,confirmActivePDU:b,deactiveAllPDU:_,pdu:function(e,t,r){var n={shareControlHeader:v((function(){return new o.Component(n).size()}),(function(){return t.obj.__PDUTYPE__}),e),pduMessage:t||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return n.shareControlHeader.obj.totalLength.value-n.shareControlHeader.size()}))};switch(n.shareControlHeader.obj.pduType.value){case i.PDUTYPE_DEMANDACTIVEPDU:n.pduMessage=m(null,t).read(e);break;case i.PDUTYPE_CONFIRMACTIVEPDU:n.pduMessage=b(null,t).read(e);break;case i.PDUTYPE_DEACTIVATEALLPDU:n.pduMessage=_(t).read(e);break;case i.PDUTYPE_DATAPDU:n.pduMessage=G(null,null,t).read(e);break;default:n.pduMessage=new o.BinaryString(null,t).read(e),a.debug("unknown pdu type "+n.shareControlHeader.obj.pduType.value)}}))};return new o.Component(n,r)},synchronizeDataPDU:g,controlDataPDU:E,errorInfoDataPDU:w,fontListDataPDU:P,fontMapDataPDU:S,persistentListPDU:A,synchronizeEvent:T,pointerEvent:O,scancodeKeyEvent:L,unicodeKeyEvent:C,slowPathInputEvent:x,clientInputEventPDU:I,shutdownRequestPDU:H,shutdownDeniedPDU:N,supressOutputDataPDU:R,refreshRectPDU:F,bitmapData:j,bitmapUpdateDataPDU:M,updateDataPDU:B,dataPDU:G,fastPathBitmapUpdateDataPDU:Y,fastPathUpdatePDU:function(e,t){var n={updateHeader:new o.UInt8((function(){return n.updateData.obj.__FASTPATH_UPDATE_TYPE__})),compressionFlags:new o.UInt8(null,{conditional:function(){return n.updateHeader.value>>4&h.FASTPATH_OUTPUT_COMPRESSION_USED}}),size:new o.UInt16Le((function(){return n.updateData.size()})),updateData:e||new o.Factory((function(e){var t={readLength:new o.CallableValue((function(){return n.size.value}))};switch(15&n.updateHeader.value){case p.FASTPATH_UPDATETYPE_BITMAP:n.updateData=Y(t).read(e);break;case p.FASTPATH_UPDATETYPE_COLOR:var i=new o.BinaryString(null,t).read(e),c=r(6982).createHash("sha384");c.update(i.value);var s=Math.abs(c.digest().readInt32BE(0)),u=V[s];n.updateData=function(e,t,r){var n={__FASTPATH_UPDATE_TYPE__:p.FASTPATH_UPDATETYPE_COLOR,header:new o.UInt16Le(p.FASTPATH_UPDATETYPE_COLOR,{constant:!0}),cursorId:t,cursorStr:r};return new o.Component(n,e)}(t,s,u);break;default:n.updateData=new o.BinaryString(null,t).read(e),a.debug("unknown fast path pdu type "+(15&n.updateHeader.value))}}))};return new o.Component(n,t)},clipPDU:function(){var e={header:new o.Factory((function(t){e.header=new o.Component({msgType:(new o.UInt16Le).read(t),msgFlags:(new o.UInt16Le).read(t),dataLen:(new o.UInt32Le).read(t)})}))};return new o.Component(e)},ClipPDUMsgType:{CB_MONITOR_READY:1,CB_FORMAT_LIST:2,CB_FORMAT_LIST_RESPONSE:3,CB_FORMAT_DATA_REQUEST:4,CB_FORMAT_DATA_RESPONSE:5,CB_TEMP_DIRECTORY:6,CB_CLIP_CAPS:7,CB_FILECONTENTS_REQUEST:8}}},9272:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(9790),i=r(1467),c=r(5784).type,s=r(5784).log;function u(e,t){this.transport=e,this.fastPathTransport=t,this.userId=0,this.serverCapabilities=[],this.clientCapabilities=[]}function l(e,t){u.call(this,e,t);var r=this;this.transport.once("connect",(function(e,t,n){r.connect(e,t,n)})).on("close",(function(){r.emit("close")})).on("error",(function(e){r.emit("error",e)})),this.fastPathTransport&&this.fastPathTransport.on("fastPathData",(function(e,t){r.recvFastPath(e,t)})),this.clientCapabilities[a.CapsType.CAPSTYPE_GENERAL]=a.generalCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAP]=a.bitmapCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_ORDER]=a.orderCapability(new c.Component([new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0),new c.UInt8(0)])),this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAPCACHE]=a.bitmapCacheCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_POINTER]=a.pointerCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_INPUT]=a.inputCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_BRUSH]=a.brushCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_GLYPHCACHE]=a.glyphCapability(new c.Component([a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry(),a.cacheEntry()])),this.clientCapabilities[a.CapsType.CAPSTYPE_OFFSCREENCACHE]=a.offscreenBitmapCacheCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_VIRTUALCHANNEL]=a.virtualChannelCapability(),this.clientCapabilities[a.CapsType.CAPSTYPE_SOUND]=a.soundCapability(),this.clientCapabilities[a.CapsType.CAPSETTYPE_MULTIFRAGMENTUPDATE]=a.multiFragmentUpdate()}n(u,o.EventEmitter),u.prototype.sendPDU=function(e){this.transport.send(i.pdu(this.userId,e))},u.prototype.sendDataPDU=function(e){this.sendPDU(i.dataPDU(e,this.shareId))},n(l,u),l.prototype.connect=function(e,t,r){this.gccCore=e,this.userId=t,this.channelId=r;var n=this;this.transport.once("data",(function(e){n.recvDemandActivePDU(e)}))},l.prototype.close=function(){this.transport.close()},l.prototype.recvDemandActivePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value===i.PDUType.PDUTYPE_DEMANDACTIVEPDU){for(var r in this.shareId=t.obj.pduMessage.obj.shareId.value,t.obj.pduMessage.obj.capabilitySets.obj){var n=t.obj.pduMessage.obj.capabilitySets.obj[r].obj.capability;n.obj&&(this.serverCapabilities[n.obj.__TYPE__]=n)}this.transport.enableSecureCheckSum=!!(this.serverCapabilities[a.CapsType.CAPSTYPE_GENERAL].obj.extraFlags.value&a.GeneralExtraFlag.ENC_SALTED_CHECKSUM),this.sendConfirmActivePDU(),this.sendClientFinalizeSynchronizePDU();o=this;this.transport.once("data",(function(e){o.recvServerSynchronizePDU(e)}))}else{s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var o=this;this.transport.once("data",(function(e){o.recvDemandActivePDU(e)}))}},l.prototype.recvServerSynchronizePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value===i.PDUType.PDUTYPE_DATAPDU&&t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value===i.PDUType2.PDUTYPE2_SYNCHRONIZE){r=this;this.transport.once("data",(function(e){r.recvServerControlCooperatePDU(e)}))}else{s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerSynchronizePDU(e)}))}},l.prototype.recvServerControlCooperatePDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_CONTROL||t.obj.pduMessage.obj.pduData.obj.action.value!==i.Action.CTRLACTION_COOPERATE){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerControlCooperatePDU(e)}))}r=this;this.transport.once("data",(function(e){r.recvServerControlGrantedPDU(e)}))},l.prototype.recvServerControlGrantedPDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_CONTROL||t.obj.pduMessage.obj.pduData.obj.action.value!==i.Action.CTRLACTION_GRANTED_CONTROL){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerControlGrantedPDU(e)}))}r=this;this.transport.once("data",(function(e){r.recvServerFontMapPDU(e)}))},l.prototype.recvServerFontMapPDU=function(e){var t=i.pdu().read(e);if(t.obj.shareControlHeader.obj.pduType.value!==i.PDUType.PDUTYPE_DATAPDU||t.obj.pduMessage.obj.shareDataHeader.obj.pduType2.value!==i.PDUType2.PDUTYPE2_FONTMAP){s.debug("ignore message type "+t.obj.shareControlHeader.obj.pduType.value+" during connection sequence");var r=this;this.transport.once("data",(function(e){r.recvServerFontMapPDU(e)}))}this.emit("connect");r=this;this.transport.on("data",(function(e){r.recvPDU(e)}))},l.prototype.recvFastPath=function(e,t){for(;t.availableLength()>0;){var r=i.fastPathUpdatePDU().read(t);switch(15&r.obj.updateHeader.value){case i.FastPathUpdateType.FASTPATH_UPDATETYPE_BITMAP:this.emit("bitmap",r.obj.updateData.obj.rectangles.obj);break;case i.FastPathUpdateType.FASTPATH_UPDATETYPE_COLOR:this.emit("pointer",r.obj.updateData.obj.cursorId,r.obj.updateData.obj.cursorStr)}}},l.prototype.recvPDU=function(e){for(;e.availableLength()>0;){var t=i.pdu().read(e);switch(t.obj.shareControlHeader.obj.pduType.value){case i.PDUType.PDUTYPE_DEACTIVATEALLPDU:var r=this;this.transport.removeAllListeners("data"),this.transport.once("data",(function(e){r.recvDemandActivePDU(e)}));break;case i.PDUType.PDUTYPE_DATAPDU:this.readDataPDU(t.obj.pduMessage);break;default:s.debug("ignore pdu type "+t.obj.shareControlHeader.obj.pduType.value)}}},l.prototype.readDataPDU=function(e){switch(e.obj.shareDataHeader.obj.pduType2.value){case i.PDUType2.PDUTYPE2_SET_ERROR_INFO_PDU:break;case i.PDUType2.PDUTYPE2_SHUTDOWN_DENIED:this.transport.close();break;case i.PDUType2.PDUTYPE2_SAVE_SESSION_INFO:this.emit("session");break;case i.PDUType2.PDUTYPE2_UPDATE:this.readUpdateDataPDU(e.obj.pduData)}},l.prototype.readUpdateDataPDU=function(e){if(e.obj.updateType.value===i.UpdateType.UPDATETYPE_BITMAP)this.emit("bitmap",e.obj.updateData.obj.rectangles.obj)},l.prototype.sendConfirmActivePDU=function(){var e=this.clientCapabilities[a.CapsType.CAPSTYPE_GENERAL].obj;e.osMajorType.value=a.MajorType.OSMAJORTYPE_WINDOWS,e.osMinorType.value=a.MinorType.OSMINORTYPE_WINDOWS_NT,e.extraFlags.value=a.GeneralExtraFlag.LONG_CREDENTIALS_SUPPORTED|a.GeneralExtraFlag.NO_BITMAP_COMPRESSION_HDR|a.GeneralExtraFlag.ENC_SALTED_CHECKSUM|a.GeneralExtraFlag.FASTPATH_OUTPUT_SUPPORTED;var t=this.clientCapabilities[a.CapsType.CAPSTYPE_BITMAP].obj;t.preferredBitsPerPixel.value=this.gccCore.highColorDepth.value,t.desktopWidth.value=this.gccCore.desktopWidth.value,t.desktopHeight.value=this.gccCore.desktopHeight.value,this.clientCapabilities[a.CapsType.CAPSTYPE_ORDER].obj.orderFlags.value|=a.OrderFlag.ZEROBOUNDSDELTASSUPPORT;var r=this.clientCapabilities[a.CapsType.CAPSTYPE_INPUT].obj;r.inputFlags.value=a.InputFlags.INPUT_FLAG_SCANCODES|a.InputFlags.INPUT_FLAG_MOUSEX|a.InputFlags.INPUT_FLAG_UNICODE,r.keyboardLayout=this.gccCore.kbdLayout,r.keyboardType=this.gccCore.keyboardType,r.keyboardSubType=this.gccCore.keyboardSubType,r.keyboardrFunctionKey=this.gccCore.keyboardFnKeys,r.imeFileName=this.gccCore.imeFileName;var n=new c.Component([]);for(var o in this.clientCapabilities)n.obj.push(a.capability(this.clientCapabilities[o]));var s=i.confirmActivePDU(n,this.shareId);this.sendPDU(s)},l.prototype.sendClientFinalizeSynchronizePDU=function(){this.sendDataPDU(i.synchronizeDataPDU(this.channelId)),this.sendDataPDU(i.controlDataPDU(i.Action.CTRLACTION_COOPERATE)),this.sendDataPDU(i.controlDataPDU(i.Action.CTRLACTION_REQUEST_CONTROL)),this.sendDataPDU(i.fontListDataPDU())},l.prototype.sendInputEvents=function(e){var t=i.clientInputEventPDU(new c.Component(e.map((function(e){return i.slowPathInputEvent(e)}))));this.sendDataPDU(t)},e.exports={Client:l}},2503:(e,t,r)=>{var n=r(1959),o=r(1562),a=r(9272),i=r(1467),c=r(2461);e.exports={lic:n,sec:o,global:a,data:i,cliprdr:c}},1959:(e,t,r)=>{var n=r(5784).type,o={LICENSE_REQUEST:1,PLATFORM_CHALLENGE:2,NEW_LICENSE:3,UPGRADE_LICENSE:4,LICENSE_INFO:18,NEW_LICENSE_REQUEST:19,PLATFORM_CHALLENGE_RESPONSE:21,ERROR_ALERT:255},a=0,i=1,c=2,s=3,u=13,l=14,f=15,p=16,h=3;function d(e){e=e||a;var t={wBlobType:new n.UInt16Le(e,{constant:e!==a}),wBlobLen:new n.UInt16Le((function(){return t.blobData.size()})),blobData:new n.BinaryString(null,{readLength:new n.CallableValue((function(){return t.wBlobLen.value}))})};return new n.Component(t)}function v(){var e={dwVersion:new n.UInt32Le,cbCompanyName:new n.UInt32Le((function(){return e.pbCompanyName.size()})),pbCompanyName:new n.BinaryString(Buffer.from("Microsoft Corporation","ucs2"),{readLength:new n.CallableValue((function(){return e.cbCompanyName.value}))}),cbProductId:new n.UInt32Le((function(){return e.pbProductId.size()})),pbProductId:new n.BinaryString(Buffer.from("A02","ucs2"),{readLength:new n.CallableValue((function(){return e.cbProductId.value}))})};return new n.Component(e)}function y(){var e={scope:d(l)};return new n.Component(e)}function m(){var e={scopeCount:new n.UInt32Le((function(){return e.scopeArray.length})),scopeArray:new n.Factory((function(t){e.scopeArray=new n.Component([]);for(var r=0;r<e.scopeCount.value;r++)e.scopeArray.obj.push(y().read(t))}))};return new n.Component(e)}function b(e){var t={__TYPE__:o.NEW_LICENSE_REQUEST,preferredKeyExchangeAlg:new n.UInt32Le(1,{constant:!0}),platformId:new n.UInt32Le(67174400),clientRandom:new n.BinaryString(Buffer.from(Array(33).join("\0")),{readLength:new n.CallableValue(32)}),encryptedPreMasterSecret:d(c),ClientUserName:d(f),ClientMachineName:d(p)};return new n.Component(t,e)}function _(e){var t={__TYPE__:o.PLATFORM_CHALLENGE_RESPONSE,encryptedPlatformChallengeResponse:d(i),encryptedHWID:d(i),MACData:new n.BinaryString(Buffer.from(Array(17).join("\0"),"binary"),{readLength:new n.CallableValue(16)})};return new n.Component(t,e)}e.exports={MessageType:o,ErrorCode:{ERR_INVALID_SERVER_CERTIFICATE:1,ERR_NO_LICENSE:2,ERR_INVALID_SCOPE:4,ERR_NO_LICENSE_SERVER:6,STATUS_VALID_CLIENT:7,ERR_INVALID_CLIENT:8,ERR_INVALID_PRODUCTID:11,ERR_INVALID_MESSAGE_LEN:12,ERR_INVALID_MAC:3},StateTransition:{ST_TOTAL_ABORT:1,ST_NO_TRANSITION:2,ST_RESET_PHASE_TO_START:3,ST_RESEND_LAST_MESSAGE:4},licensePacket:function(e){var t={bMsgtype:new n.UInt8((function(){return t.licensingMessage.obj.__TYPE__})),flag:new n.UInt8(h),wMsgSize:new n.UInt16Le((function(){return new n.Component(t).size()})),licensingMessage:e||new n.Factory((function(e){switch(t.bMsgtype.value){case o.ERROR_ALERT:t.licensingMessage=function(e){var t={__TYPE__:o.ERROR_ALERT,dwErrorCode:new n.UInt32Le,dwStateTransition:new n.UInt32Le,blob:d(a)};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.LICENSE_REQUEST:t.licensingMessage=function(e){var t={__TYPE__:o.LICENSE_REQUEST,serverRandom:new n.BinaryString(Buffer.from(Array(33).join("\0")),{readLength:new n.CallableValue(32)}),productInfo:v(),keyExchangeList:d(u),serverCertificate:d(s),scopeList:m()};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.NEW_LICENSE_REQUEST:t.licensingMessage=b({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.PLATFORM_CHALLENGE:t.licensingMessage=function(e){var t={__TYPE__:o.PLATFORM_CHALLENGE,connectFlags:new n.UInt32Le,encryptedPlatformChallenge:d(a),MACData:new n.BinaryString(Buffer.from(Array(17).join("\0")),{readLength:new n.CallableValue(16)})};return new n.Component(t,e)}({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;case o.PLATFORM_CHALLENGE_RESPONSE:t.licensingMessage=_({readLength:new n.CallableValue((function(){return t.wMsgSize.value-4}))}).read(e);break;default:log.error("unknown license message type "+t.bMsgtype.value)}}))};return new n.Component(t)},clientNewLicenseRequest:b,clientPLatformChallengeResponse:_}},1562:(e,t,r)=>{var n=r(9023).inherits,o=r(6982),a=r(6261),i=r(5784).type,c=r(5784).error,s=r(5784).log,u=r(1381),l=r(1959),f=r(8701),p=r(8597).rsa,h=64,d=128,v={INFO_MOUSE:1,INFO_DISABLECTRLALTDEL:2,INFO_AUTOLOGON:8,INFO_UNICODE:16,INFO_MAXIMIZESHELL:32,INFO_LOGONNOTIFY:64,INFO_COMPRESSION:128,INFO_ENABLEWINDOWSKEY:256,INFO_REMOTECONSOLEAUDIO:8192,INFO_FORCE_ENCRYPTED_CS_PDU:16384,INFO_RAIL:32768,INFO_LOGONERRORS:65536,INFO_MOUSE_HAS_WHEEL:131072,INFO_PASSWORD_IS_SC_PIN:262144,INFO_NOAUDIOPLAYBACK:524288,INFO_USING_SAVED_CREDS:1048576,INFO_AUDIOCAPTURE:2097152,INFO_VIDEO_DISABLE:4194304,INFO_CompressionTypeMask:7680},y=2;function m(e,t,r,n){var a=o.createHash("sha1");a.update(e),a.update(t.slice(0,48)),a.update(r),a.update(n);var i=a.digest(),c=o.createHash("md5");return c.update(t.slice(0,48)),c.update(i),c.digest()}function b(e,t,r){var n=m(Buffer.from("A"),e,t,r),o=m(Buffer.from("BB"),e,t,r),a=m(Buffer.from("CCC"),e,t,r),i=Buffer.alloc(n.length+o.length+a.length);return n.copy(i),o.copy(i,n.length),a.copy(i,n.length+o.length),i}function _(e){var t={clientAddressFamily:new i.UInt16Le(y),cbClientAddress:new i.UInt16Le((function(){return t.clientAddress.size()})),clientAddress:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbClientAddress}))}),cbClientDir:new i.UInt16Le((function(){return t.clientDir.size()})),clientDir:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbClientDir}))}),clientTimeZone:new i.BinaryString(Buffer.from(Array(173).join("\0"))),clientSessionId:new i.UInt32Le,performanceFlags:new i.UInt32Le};return new i.Component(t,e)}function g(e,t){this.transport=e,this.fastPathTransport=t,this.gccClient=null,this.gccServer=null;var r=this;this.infos=function(e){var t={codePage:new i.UInt32Le,flag:new i.UInt32Le(v.INFO_MOUSE|v.INFO_UNICODE|v.INFO_LOGONNOTIFY|v.INFO_LOGONERRORS|v.INFO_DISABLECTRLALTDEL|v.INFO_ENABLEWINDOWSKEY),cbDomain:new i.UInt16Le((function(){return t.domain.size()-2})),cbUserName:new i.UInt16Le((function(){return t.userName.size()-2})),cbPassword:new i.UInt16Le((function(){return t.password.size()-2})),cbAlternateShell:new i.UInt16Le((function(){return t.alternateShell.size()-2})),cbWorkingDir:new i.UInt16Le((function(){return t.workingDir.size()-2})),domain:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbDomain.value+2}))}),userName:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbUserName.value+2}))}),password:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbPassword.value+2}))}),alternateShell:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbAlternateShell.value+2}))}),workingDir:new i.BinaryString(Buffer.from("\0","ucs2"),{readLength:new i.CallableValue((function(){return t.cbWorkingDir.value+2}))}),extendedInfo:_({conditional:e})};return new i.Component(t)}((function(){return r.gccClient.core.rdpVersion.value===u.VERSION.RDP_VERSION_5_PLUS})),this.machineName="",this.enableEncryption=!1,this.fastPathTransport&&this.fastPathTransport.on("fastPathData",(function(e,t){r.recvFastPath(e,t)}))}function E(e,t){g.call(this,e,t),this.enableSecureCheckSum=!1;var r=this;this.transport.on("connect",(function(e,t,n,o){r.connect(e,t,n,o)})).on("close",(function(){r.emit("close")})).on("error",(function(e){r.emit("error",e)}))}function w(e){for(var t=Buffer.alloc(e.length),r=0;r<e.length;r++)t.writeUInt8(e.readUInt8(e.length-1-r),r);return t}n(g,a.EventEmitter),g.prototype.sendFlagged=function(e,t){this.transport.send("global",new i.Component([new i.UInt16Le(e),new i.UInt16Le,t]))},g.prototype.send=function(e){if(this.enableEncryption)throw new c.FatalError("NODE_RDP_PROTOCOL_PDU_SEC_ENCRYPT_NOT_IMPLEMENTED");this.transport.send("global",e)},g.prototype.recv=function(e){if(this.enableEncryption)throw new c.FatalError("NODE_RDP_PROTOCOL_PDU_SEC_ENCRYPT_NOT_IMPLEMENTED");this.emit("data",e)},g.prototype.recvFastPath=function(e,t){this.emit("fastPathData",e,t)},n(E,g),E.prototype.connect=function(e,t,r,n){this.gccClient=e,this.gccServer=t,this.userId=r,this.channelId=n.find((function(e){if("global"===e.name)return!0})).id,this.sendInfoPkt()},E.prototype.close=function(){this.transport.close()},E.prototype.sendInfoPkt=function(){this.sendFlagged(h,this.infos);var e=this;this.transport.once("global",(function(t){e.recvLicense(t)}))},E.prototype.sendClientNewLicenseRequest=function(e){s.debug("new license request");var t,r,n,a,c=e.serverRandom.value,u=new i.Stream(e.serverCertificate.obj.blobData.value),h=f.certificate().read(u).obj.certData.obj.getPublicKey(),v=o.randomBytes(32),y=o.randomBytes(48),m=b(y,v,c),_=b(m,c,v);this.licenseMacSalt=_.slice(0,16),this.licenseKey=(t=_.slice(16,32),r=v,n=c,(a=o.createHash("md5")).update(t),a.update(r),a.update(n),a.digest());var g=l.clientNewLicenseRequest();g.obj.clientRandom.value=v;var E=w(p.encrypt(w(y),h)),P=Buffer.alloc(E.length+8);P.fill(0),E.copy(P),g.obj.encryptedPreMasterSecret.obj.blobData.value=P,g.obj.ClientMachineName.obj.blobData.value=this.infos.obj.userName.value,g.obj.ClientUserName.obj.blobData.value=Buffer.from(this.machineName+"\0"),this.sendFlagged(d,l.licensePacket(g))},E.prototype.sendClientChallengeResponse=function(e){s.debug("challenge license");var t=e.encryptedPlatformChallenge.obj.blobData.value,r=o.createDecipheriv("rc4",this.licenseKey,"").update(t);if("TEST\0"!==r.toString("ucs2"))throw new c.ProtocolError("NODE_RDP_PROTOCOL_PDU_SEC_INVALID_LICENSE_CHALLENGE");var n=new i.Component([new i.UInt32Le(2),new i.BinaryString(o.randomBytes(16))]).toStream().buffer,a=l.clientPLatformChallengeResponse();a.obj.encryptedPlatformChallengeResponse.obj.blobData.value=t,a.obj.encryptedHWID.obj.blobData.value=o.createCipheriv("rc4",this.licenseKey,"").update(n);var u=Buffer.alloc(r.length+n.length);r.copy(u),n.copy(u,r.length),a.obj.MACData.value=function(e,t){var r=Buffer.alloc(40);r.fill(54);var n=Buffer.alloc(48);n.fill(92);var a=new i.UInt32Le(t.length).toStream().buffer,c=o.createHash("sha1");c.update(e),c.update(r),c.update(a),c.update(t);var s=c.digest(),u=o.createHash("md5");return u.update(e),u.update(n),u.update(s),u.digest()}(this.licenseMacSalt,u),this.sendFlagged(d,l.licensePacket(a))},g.prototype.recvLicense=function(e){var t=function(){var e={securityFlag:new i.UInt16Le,securityFlagHi:new i.UInt16Le};return new i.Component(e)}().read(e).obj;if(!(t.securityFlag.value&d))throw new c.ProtocolError("NODE_RDP_PROTOCOL_PDU_SEC_BAD_LICENSE_HEADER");var r=l.licensePacket().read(e).obj;if(r.bMsgtype.value===l.MessageType.NEW_LICENSE||r.bMsgtype.value===l.MessageType.ERROR_ALERT&&r.licensingMessage.obj.dwErrorCode.value===l.ErrorCode.STATUS_VALID_CLIENT&&r.licensingMessage.obj.dwStateTransition.value===l.StateTransition.ST_NO_TRANSITION){this.emit("connect",this.gccClient.core,this.userId,this.channelId);var n=this;this.transport.on("global",(function(e){n.recv(e)}))}else{r.bMsgtype.value===l.MessageType.LICENSE_REQUEST&&this.sendClientNewLicenseRequest(r.licensingMessage.obj),r.bMsgtype.value===l.MessageType.PLATFORM_CHALLENGE&&this.sendClientChallengeResponse(r.licensingMessage.obj);n=this;this.emit("connect",this.gccClient.core),this.transport.once("global",(function(e){n.recvLicense(e)}))}},e.exports={PerfFlag:{PERF_DISABLE_WALLPAPER:1,PERF_DISABLE_FULLWINDOWDRAG:2,PERF_DISABLE_MENUANIMATIONS:4,PERF_DISABLE_THEMING:8,PERF_DISABLE_CURSOR_SHADOW:32,PERF_DISABLE_CURSORSETTINGS:64,PERF_ENABLE_FONT_SMOOTHING:128,PERF_ENABLE_DESKTOP_COMPOSITION:256},InfoFlag:v,Client:E}},4077:(e,t,r)=>{var n=r(9278),o=r(9023).inherits,a=r(6261),i=r(5784).layer,c=r(5784).error,s=r(5784).rle,u=r(5784).log,l=r(2008),f=r(5599),p=r(1018),h=r(2503);function d(e){var t=null;switch(e.bitsPerPixel.value){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var r=new Uint8Array(e.bitmapDataStream.value),n=s._malloc(r.length),o=new Uint8Array(s.HEAPU8.buffer,n,r.length);o.set(r);var a=e.width.value*e.height.value*4,i=s._malloc(a),c=new Uint8Array(s.HEAPU8.buffer,i,a),u=(s.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,e.width.value,e.height.value,e.width.value,e.height.value,o.byteOffset,r.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,a));return s._free(n),s._free(i),u}function v(e){var t=this;if(e=e||{},this.connected=!1,this.bufferLayer=new i.BufferLayer(new n.Socket),this.tpkt=new l(this.bufferLayer),this.x224=new f.Client(this.tpkt,e),this.mcs=new p.mcs.Client(this.x224),this.sec=new h.sec.Client(this.mcs,this.tpkt),this.cliprdr=new h.cliprdr.Client(this.mcs),this.global=new h.global.Client(this.sec,this.sec),u.level=u.Levels[e.logLevel||"INFO"]||u.Levels.INFO,e.domain&&(this.sec.infos.obj.domain.value=Buffer.from(e.domain+"\0","ucs2")),e.userName&&(this.sec.infos.obj.userName.value=Buffer.from(e.userName+"\0","ucs2")),e.password&&(this.sec.infos.obj.password.value=Buffer.from(e.password+"\0","ucs2")),e.workingDir&&(this.sec.infos.obj.workingDir.value=Buffer.from(e.workingDir+"\0","ucs2")),e.alternateShell&&(this.sec.infos.obj.alternateShell.value=Buffer.from(e.alternateShell+"\0","ucs2")),null!=e.perfFlags?this.sec.infos.obj.extendedInfo.obj.performanceFlags.value=e.perfFlags:e.enablePerf&&(this.sec.infos.obj.extendedInfo.obj.performanceFlags.value=h.sec.PerfFlag.PERF_DISABLE_WALLPAPER|h.sec.PerfFlag.PERF_DISABLE_MENUANIMATIONS|h.sec.PerfFlag.PERF_DISABLE_CURSOR_SHADOW|h.sec.PerfFlag.PERF_DISABLE_THEMING|h.sec.PerfFlag.PERF_DISABLE_FULLWINDOWDRAG),e.autoLogin&&(this.sec.infos.obj.flag.value|=h.sec.InfoFlag.INFO_AUTOLOGON),e.screen&&e.screen.width&&e.screen.height&&(this.mcs.clientCoreData.obj.desktopWidth.value=e.screen.width,this.mcs.clientCoreData.obj.desktopHeight.value=e.screen.height),u.debug("screen "+this.mcs.clientCoreData.obj.desktopWidth.value+"x"+this.mcs.clientCoreData.obj.desktopHeight.value),"fr"===e.locale)u.debug("french keyboard layout"),this.mcs.clientCoreData.obj.kbdLayout.value=p.gcc.KeyboardLayout.FRENCH;else u.debug("english keyboard layout"),this.mcs.clientCoreData.obj.kbdLayout.value=p.gcc.KeyboardLayout.US;this.cliprdr.on("clipboard",(function(e){t.emit("clipboard",e)}));var r=this;this.global.on("connect",(function(){r.connected=!0,r.emit("connect")})).on("session",(function(){r.emit("session")})).on("close",(function(){r.connected=!1,r.emit("close")})).on("pointer",(function(e,t){r.emit("pointer",e,t)})).on("bitmap",(function(t){for(var n in t){var o=t[n].obj.bitmapDataStream.value,a=t[n].obj.flags.value&h.data.BitmapFlag.BITMAP_COMPRESSION;a&&e.decompress&&(o=d(t[n].obj),a=!1),r.emit("bitmap",{destTop:t[n].obj.destTop.value,destLeft:t[n].obj.destLeft.value,destBottom:t[n].obj.destBottom.value,destRight:t[n].obj.destRight.value,width:t[n].obj.width.value,height:t[n].obj.height.value,bitsPerPixel:t[n].obj.bitsPerPixel.value,isCompress:a,data:o})}})).on("error",(function(e){if(u.warn(e.code+"("+e.message+")\n"+e.stack),e instanceof c.FatalError)throw e;r.emit("error",e)}))}function y(e,t){if(!e.key||!e.cert)throw new c.FatalError("NODE_RDP_PROTOCOL_RDP_SERVER_CONFIG_MISSING","missing cryptographic tools");this.connected=!1,this.bufferLayer=new i.BufferLayer(t),this.tpkt=new l(this.bufferLayer),this.x224=new f.Server(this.tpkt,e.key,e.cert),this.mcs=new p.mcs.Server(this.x224)}o(v,a.EventEmitter),v.prototype.connect=function(e,t){u.debug("connect to "+e+":"+t);var r=this;return this.bufferLayer.socket.connect(t,e,(function(){r.x224.connect()})),this},v.prototype.close=function(){return this.connected&&this.global.close(),this.connected=!1,this},v.prototype.sendPointerEvent=function(e,t,r,n){if(this.connected){var o=h.data.pointerEvent();switch(n&&(o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_DOWN),r){case 1:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON1;break;case 2:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON2;break;case 3:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_BUTTON3;break;default:o.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_MOVE}o.obj.xPos.value=e,o.obj.yPos.value=t,this.global.sendInputEvents([o])}},v.prototype.sendKeyEventScancode=function(e,t,r){if(this.connected){r=r||!1;var n=h.data.scancodeKeyEvent();n.obj.keyCode.value=e,t||(n.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_RELEASE),r&&(n.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_EXTENDED),this.global.sendInputEvents([n])}},v.prototype.sendKeyEventUnicode=function(e,t){if(this.connected){var r=h.data.unicodeKeyEvent();r.obj.unicode.value=e,t||(r.obj.keyboardFlags.value|=h.data.KeyboardFlag.KBDFLAGS_RELEASE),this.global.sendInputEvents([r])}},v.prototype.sendWheelEvent=function(e,t,r,n,o){if(this.connected){var a=h.data.pointerEvent();a.obj.pointerFlags.value|=o?h.data.PointerFlag.PTRFLAGS_HWHEEL:h.data.PointerFlag.PTRFLAGS_WHEEL,n&&(a.obj.pointerFlags.value|=h.data.PointerFlag.PTRFLAGS_WHEEL_NEGATIVE),a.obj.pointerFlags.value|=r&h.data.PointerFlag.WheelRotationMask,a.obj.xPos.value=e,a.obj.yPos.value=t,this.global.sendInputEvents([a])}},v.prototype.setClipboardData=function(e){this.cliprdr.setClipboardData(e)},o(y,a.EventEmitter),e.exports={createClient:function(e){return new v(e)},createServer:function(e,t){return n.createServer((function(r){t(new y(e,r))}))}}},1381:(e,t,r)=>{var n=r(5784).type,o=r(5784).log,a=r(5784).error,i=r(2301),c=[0,0,20,124,0,1],s="Duca",u="McDn",l={SC_CORE:3073,SC_SECURITY:3074,SC_NET:3075,CS_CORE:49153,CS_SECURITY:49154,CS_NET:49155,CS_CLUSTER:49156,CS_MONITOR:49157},f=51713,p=24,h=1,d=2,v=4,y=8,m=1,b={RDP_VERSION_4:524289,RDP_VERSION_5_PLUS:524292},_=43523,g=1,E=2,w=8,P=4,S={ARABIC:1025,BULGARIAN:1026,CHINESE_US_KEYBOARD:1028,CZECH:1029,DANISH:1030,GERMAN:1031,GREEK:1032,US:1033,SPANISH:1034,FINNISH:1035,FRENCH:1036,HEBREW:1037,HUNGARIAN:1038,ICELANDIC:1039,ITALIAN:1040,JAPANESE:1041,KOREAN:1042,DUTCH:1043,NORWEGIAN:1044};function k(e){var t={type:new n.UInt16Le((function(){return t.data.obj.__TYPE__})),length:new n.UInt16Le((function(){return new n.Component(t).size()})),data:e||new n.Factory((function(e){var r={readLength:new n.CallableValue((function(){return t.length.value-4}))};switch(t.type.value){case l.SC_CORE:t.data=T(r).read(e);break;case l.SC_SECURITY:t.data=L(r).read(e);break;case l.SC_NET:t.data=I(null,r).read(e);break;case l.CS_CORE:t.data=A(r).read(e);break;case l.CS_SECURITY:t.data=O(r).read(e);break;case l.CS_NET:t.data=x(null,r).read(e);break;default:o.debug("unknown gcc block type "+t.type.value),t.data=new n.BinaryString(null,r).read(e)}}))};return new n.Component(t)}function A(e){var t={__TYPE__:l.CS_CORE,rdpVersion:new n.UInt32Le(b.RDP_VERSION_5_PLUS),desktopWidth:new n.UInt16Le(1280),desktopHeight:new n.UInt16Le(800),colorDepth:new n.UInt16Le(f),sasSequence:new n.UInt16Le(_),kbdLayout:new n.UInt32Le(S.FRENCH),clientBuild:new n.UInt32Le(3790),clientName:new n.BinaryString(Buffer.from("node-rdpjs\0\0\0\0\0\0","ucs2"),{readLength:new n.CallableValue(32)}),keyboardType:new n.UInt32Le(P),keyboardSubType:new n.UInt32Le(0),keyboardFnKeys:new n.UInt32Le(12),imeFileName:new n.BinaryString(Buffer.from(Array(65).join("\0")),{readLength:new n.CallableValue(64),optional:!0}),postBeta2ColorDepth:new n.UInt16Le(f,{optional:!0}),clientProductId:new n.UInt16Le(1,{optional:!0}),serialNumber:new n.UInt32Le(0,{optional:!0}),highColorDepth:new n.UInt16Le(p,{optional:!0}),supportedColorDepths:new n.UInt16Le(v|d|h|y,{optional:!0}),earlyCapabilityFlags:new n.UInt16Le(m,{optional:!0}),clientDigProductId:new n.BinaryString(Buffer.from(Array(65).join("\0")),{optional:!0,readLength:new n.CallableValue(64)}),connectionType:new n.UInt8(0,{optional:!0}),pad1octet:new n.UInt8(0,{optional:!0}),serverSelectedProtocol:new n.UInt32Le(0,{optional:!0})};return new n.Component(t,e)}function T(e){var t={__TYPE__:l.SC_CORE,rdpVersion:new n.UInt32Le(b.RDP_VERSION_5_PLUS),clientRequestedProtocol:new n.UInt32Le(null,{optional:!0}),earlyCapabilityFlags:new n.UInt32Le(null,{optional:!0})};return new n.Component(t,e)}function O(e){var t={__TYPE__:l.CS_SECURITY,encryptionMethods:new n.UInt32Le(g|w|E),extEncryptionMethods:new n.UInt32Le};return new n.Component(t,e)}function L(e){var t={__TYPE__:l.SC_SECURITY,encryptionMethod:new n.UInt32Le,encryptionLevel:new n.UInt32Le};return new n.Component(t,e)}function C(e){var t={name:new n.BinaryString(null,{readLength:new n.CallableValue(8)}),options:new n.UInt32Le};return new n.Component(t,e)}function x(e,t){var r={__TYPE__:l.CS_NET,channelCount:new n.UInt32Le((function(){return r.channelDefArray.obj.length})),channelDefArray:e||new n.Factory((function(e){r.channelDefArray=new n.Component([]);for(var t=0;t<r.channelCount.value;t++)r.channelDefArray.obj.push(C().read(e))}))};return new n.Component(r,t)}function I(e,t){var r={__TYPE__:l.SC_NET,MCSChannelId:new n.UInt16Le(1003,{constant:!0}),channelCount:new n.UInt16Le((function(){return r.channelIdArray.obj.length})),channelIdArray:e||new n.Factory((function(e){r.channelIdArray=new n.Component([]);for(var t=0;t<r.channelCount.value;t++)r.channelIdArray.obj.push((new n.UInt16Le).read(e))})),pad:new n.UInt16Le(null,{conditional:function(){return r.channelCount.value%2==1}})};return new n.Component(r,t)}function H(e,t){var r={blocks:e||new n.Factory((function(e){for(r.blocks=new n.Component([]);e.availableLength()>0;)r.blocks.obj.push(k().read(e))}))};return new n.Component(r,t)}e.exports={MessageType:l,VERSION:b,KeyboardLayout:S,block:k,clientCoreData:A,clientNetworkData:x,clientSecurityData:O,serverCoreData:T,serverSecurityData:L,serverNetworkData:I,readConferenceCreateResponse:function(e){if(i.readChoice(e),!i.readObjectIdentifier(e,c))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_OBJECT_IDENTIFIER_T124");if(i.readLength(e),i.readChoice(e),i.readInteger16(e,1001),i.readInteger(e),i.readEnumerates(e),i.readNumberOfSet(e),i.readChoice(e),!i.readOctetStream(e,u,4))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_H221_SC_KEY");return length=i.readLength(e),serverSettings=H(null,{readLength:new n.CallableValue(length)}),serverSettings.read(e).obj.blocks.obj.map((function(e){return e.obj.data}))},readConferenceCreateRequest:function(e){if(i.readChoice(e),!i.readObjectIdentifier(e,c))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_H221_SC_KEY");if(i.readLength(e),i.readChoice(e),i.readSelection(e),i.readNumericString(e,1),i.readPadding(e,1),1!==i.readNumberOfSet(e))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_SET");if(192!==i.readChoice(e))throw new a.ProtocolError("NODE_RDP_PROTOCOL_T125_GCC_BAD_CHOICE");return i.readOctetStream(e,s,4),length=i.readLength(e),H(null,{readLength:new n.CallableValue(length)}).read(e).obj.blocks.obj.map((function(e){return e.obj.data}))},writeConferenceCreateRequest:function(e){var t=new n.Stream(e.size());return e.write(t),new n.Component([i.writeChoice(0),i.writeObjectIdentifier(c),i.writeLength(e.size()+14),i.writeChoice(0),i.writeSelection(8),i.writeNumericString("1",1),i.writePadding(1),i.writeNumberOfSet(1),i.writeChoice(192),i.writeOctetStream(Buffer.from(s),4),i.writeOctetStream(t.getValue())])},writeConferenceCreateResponse:function(e){var t=new n.Stream(e.size());return e.write(t),new n.Component([i.writeChoice(0),i.writeObjectIdentifier(c),i.writeLength(e.size()+14),i.writeChoice(20),i.writeInteger16(31219,1001),i.writeInteger(1),i.writeEnumerates(0),i.writeNumberOfSet(1),i.writeChoice(192),i.writeOctetStream(Buffer.from(u),4),i.writeOctetStream(t.getValue())])}}},1018:(e,t,r)=>{var n=r(4895),o=r(1381);e.exports={mcs:n,gcc:o}},4895:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(5784).type,i=r(5784).log,c=r(5784).error,s=r(1381),u=r(2301),l=r(5002),f=(r(2461),1),p=8,h=10,d=11,v=14,y=15,m=25,b=26,_=1003,g=1001,E=1005,w=new a.Component({name:new a.BinaryString(Buffer.from("rdpdr\0\0\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(2155872256)}),P=new a.Component({name:new a.BinaryString(Buffer.from("rdpsnd\0\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(3221225472)}),S=new a.Component({name:new a.BinaryString(Buffer.from("cliprdr\0","binary"),{readLength:new a.CallableValue(8)}),options:new a.UInt32Le(3231711232)});function k(e,t,r,n,o,a,i,c){return new l.univ.Sequence({maxChannelIds:new l.univ.Integer(e),maxUserIds:new l.univ.Integer(t),maxTokenIds:new l.univ.Integer(r),numPriorities:new l.univ.Integer(n),minThoughput:new l.univ.Integer(o),maxHeight:new l.univ.Integer(a),maxMCSPDUsize:new l.univ.Integer(i),protocolVersion:new l.univ.Integer(c)})}function A(e){return new l.univ.Sequence({callingDomainSelector:new l.univ.OctetString(Buffer.from("","binary")),calledDomainSelector:new l.univ.OctetString(Buffer.from("","binary")),upwardFlag:new l.univ.Boolean(!0),targetParameters:k(34,2,0,1,0,1,65535,2),minimumParameters:k(1,1,1,1,0,1,1056,2),maximumParameters:k(65535,64535,65535,1,0,1,65535,2),userData:new l.univ.OctetString(e)}).implicitTag(new l.spec.Asn1Tag(l.spec.TagClass.Application,l.spec.TagFormat.Constructed,101))}function T(e){return new l.univ.Sequence({result:new l.univ.Enumerate(0),calledConnectId:new l.univ.Integer(0),domainParameters:k(22,3,0,1,0,1,65528,2),userData:new l.univ.OctetString(e)}).implicitTag(new l.spec.Asn1Tag(l.spec.TagClass.Application,l.spec.TagFormat.Constructed,102))}function O(e,t){return t=t||0,new a.UInt8(e<<2|t)}function L(e,t){return e>>2===t}function C(e,t,r){this.transport=e,this.recvOpCode=t,this.sendOpCode=r,this.channels=[{id:_,name:"global"},{id:E,name:"cliprdr"}],this.channels.find=function(e){for(var t in this)if(e(this[t]))return this[t]};var n=this;this.transport.on("close",(function(){n.emit("close")})).on("error",(function(e){n.emit("error",e)}))}function x(e){C.call(this,e,b,m),this.channelsConnected=0,this.clientCoreData=s.clientCoreData(),this.clientNetworkData=s.clientNetworkData(new a.Component([w,S,P])),this.clientSecurityData=s.clientSecurityData(),this.serverCoreData=null,this.serverSecurityData=null,this.serverNetworkData=null;var t=this;this.transport.on("connect",(function(e){t.connect(e)}))}function I(e){C.call(this,e,m,b),this.clientCoreData=null,this.clientNetworkData=null,this.clientSecurityData=null,this.serverCoreData=s.serverCoreData(),this.serverSecurityData=s.serverSecurityData(),this.serverNetworkData=s.serverNetworkData(new a.Component([]));var t=this;this.transport.on("connect",(function(e){t.serverCoreData.obj.clientRequestedProtocol.value=e})).once("data",(function(e){t.recvConnectInitial(e)}))}n(C,o.EventEmitter),C.prototype.send=function(e,t){var r=this.channels.find((function(t){if(t.name===e)return!0})).id;this.transport.send(new a.Component([O(this.sendOpCode),u.writeInteger16(this.userId,g),u.writeInteger16(r),new a.UInt8(112),u.writeLength(t.size()),t]))},C.prototype.recv=function(e){if(opcode=(new a.UInt8).read(e).value,L(opcode,p))return i.info("MCS DISCONNECT_PROVIDER_ULTIMATUM"),void this.transport.close();if(!L(opcode,this.recvOpCode))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_BAD_RECEIVE_OPCODE");u.readInteger16(e,g);var t=u.readInteger16(e);u.readEnumerates(e),u.readLength(e);var r=this.channels.find((function(e){if(e.id===t)return!0})).name;this.emit(r,e)},n(x,C),x.prototype.connect=function(e){this.clientCoreData.obj.serverSelectedProtocol.value=e,this.sendConnectInitial()},x.prototype.close=function(){this.transport.close()},x.prototype.recvConnectResponse=function(e){var t=new a.Stream(T().decode(e,l.ber).value.userData.value),r=s.readConferenceCreateResponse(t);for(var n in r)if(r[n].obj)switch(r[n].obj.__TYPE__){case s.MessageType.SC_CORE:this.serverCoreData=r[n];break;case s.MessageType.SC_SECURITY:this.serverSecurityData=r[n];break;case s.MessageType.SC_NET:this.serverNetworkData=r[n];break;default:i.warn("unhandle server gcc block : "+r[n].obj.__TYPE__)}this.sendErectDomainRequest(),this.sendAttachUserRequest();var o=this;this.transport.once("data",(function(e){o.recvAttachUserConfirm(e)}))},x.prototype.recvAttachUserConfirm=function(e){if(!L((new a.UInt8).read(e).value,d))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_BAD_HEADER");if(0!==u.readEnumerates(e))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_SERVER_REJECT_USER");this.userId=u.readInteger16(e,g),this.channels.push({id:this.userId,name:"user"}),this.connectChannels()},x.prototype.recvChannelJoinConfirm=function(e){if(!L((new a.UInt8).read(e).value,y))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_WAIT_CHANNEL_JOIN_CONFIRM");var t=u.readEnumerates(e),r=u.readInteger16(e,g);if(this.userId!==r)throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_INVALID_USER_ID");var n=u.readInteger16(e);if(0!==t&&(n===E||n===_||n===this.userId))throw new c.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_MCS_SERVER_MUST_CONFIRM_STATIC_CHANNEL");this.connectChannels()},x.prototype.sendConnectInitial=function(){var e=s.writeConferenceCreateRequest(new a.Component([s.block(this.clientCoreData),s.block(this.clientNetworkData),s.block(this.clientSecurityData)])).toStream().getValue();this.transport.send(A(e).encode(l.ber));var t=this;this.transport.once("data",(function(e){t.recvConnectResponse(e)}))},x.prototype.sendErectDomainRequest=function(){this.transport.send(new a.Component([O(f),u.writeInteger(0),u.writeInteger(0)]))},x.prototype.sendAttachUserRequest=function(){this.transport.send(O(h))},x.prototype.sendChannelJoinRequest=function(e){this.transport.send(new a.Component([O(v),u.writeInteger16(this.userId,g),u.writeInteger16(e)]))},x.prototype.connectChannels=function(e){if(this.channelsConnected==this.channels.length){var t=this;return this.transport.on("data",(function(e){t.recv(e)})),void this.emit("connect",{core:this.clientCoreData.obj,security:this.clientSecurityData.obj,net:this.clientNetworkData.obj},{core:this.serverCoreData.obj,security:this.serverSecurityData.obj},this.userId,this.channels)}this.sendChannelJoinRequest(this.channels[this.channelsConnected++].id);t=this;this.transport.once("data",(function(e){t.recvChannelJoinConfirm(e)}))},n(I,C),I.prototype.recvConnectInitial=function(e){var t=new a.Stream(A().decode(e,l.ber).value.userData.value),r=s.readConferenceCreateRequest(t);for(var n in r)if(r[n].obj)switch(r[n].obj.__TYPE__){case s.MessageType.CS_CORE:this.clientCoreData=r[n];break;case s.MessageType.CS_SECURITY:this.clientSecurityData=r[n];break;case s.MessageType.CS_NET:this.clientNetworkData=r[n];for(n=0;n<this.clientNetworkData.obj.channelCount.value;n++)this.serverNetworkData.obj.channelIdArray.obj.push(new a.UInt16Le(n+1+_));break;default:i.debug("unhandle client gcc block : "+r[n].obj.__TYPE__)}this.sendConnectResponse()},I.prototype.sendConnectResponse=function(){var e=s.writeConferenceCreateResponse(new a.Component([s.block(this.serverCoreData),s.block(this.serverSecurityData),s.block(this.serverNetworkData)])).toStream().getValue();this.transport.send(T(e).encode(l.ber))},e.exports={Client:x,Server:I}},2301:(e,t,r)=>{var n=r(5784).type,o=r(5784).error;function a(e){var t=(new n.UInt8).read(e).value,r=0;return 128&t?(r=(t&=-129)<<8,r+=(new n.UInt8).read(e).value):r=t,r}function i(e){return e>127?new n.UInt16Be(32768|e):new n.UInt8(e)}e.exports={readLength:a,writeLength:i,readChoice:function(e){return(new n.UInt8).read(e).value},writeChoice:function(e){return new n.UInt8(e)},readSelection:function(e){return(new n.UInt8).read(e).value},writeSelection:function(e){return new n.UInt8(e)},readNumberOfSet:function(e){return(new n.UInt8).read(e).value},writeNumberOfSet:function(e){return new n.UInt8(e)},readEnumerates:function(e){return(new n.UInt8).read(e).value},writeEnumerates:function(e){return new n.UInt8(e)},readInteger:function(e){var t;switch(a(e)){case 1:t=new n.UInt8;break;case 2:t=new n.UInt16Be;break;case 4:t=new n.UInt32Be;break;default:throw new o.UnexpectedFatalError("NODE_RDP_PROTOCOL_T125_PER_BAD_INTEGER_LENGTH")}return t.read(e).value},writeInteger:function(e){return e<=255?new n.Component([i(1),new n.UInt8(e)]):e<65535?new n.Component([i(2),new n.UInt16Be(e)]):new n.Component([i(4),new n.UInt32Be(e)])},readInteger16:function(e,t){return(new n.UInt16Be).read(e).value+(t||0)},writeInteger16:function(e,t){return new n.UInt16Be(e-(t||0))},readObjectIdentifier:function(e,t){if(5!==a(e))return!1;var r=[0,0,0,0,0,0],o=(new n.UInt8).read(e).value;for(var i in r[0]=o>>4,r[1]=15&o,r[2]=(new n.UInt8).read(e).value,r[3]=(new n.UInt8).read(e).value,r[4]=(new n.UInt8).read(e).value,r[5]=(new n.UInt8).read(e).value,t)if(t[i]!==r[i])return!1;return!0},writeObjectIdentifier:function(e){return new n.Component([new n.UInt8(5),new n.UInt8(e[0]<<4&15&e[1]),new n.UInt8(e[2]),new n.UInt8(e[3]),new n.UInt8(e[4]),new n.UInt8(e[5])])},readNumericString:function(e,t){var r=a(e);r=(r+t+1)/2,e.readPadding(r)},writeNumericString:function(e,t){var r=e.length,o=t;r-t>=0&&(o=r-t);for(var a=[],c=0;c<r;c+=2){var s=e.charCodeAt(c),u=0;s=(s-48)%10,u=((u=c+1<r?e.charCodeAt(c+1):48)-48)%10,a[a.length]=new n.UInt8(s<<4|u)}return new n.Component([i(o),new n.Component(a)])},readPadding:function(e,t){e.readPadding(t)},writePadding:function(e){return new n.BinaryString(Buffer.from(Array(e+1).join("\0")))},readOctetStream:function(e,t,r){var o=a(e)+(r||0);if(o!==t.length)return!1;for(var i=0;i<o;i++){var c=(new n.UInt8).read(e);if(t.charCodeAt(i)!==c.value)return!1}return!0},writeOctetStream:function(e,t){t=t||0;var r=e.length,o=t;r-t>=0&&(o=r-t),result=[];for(var a=0;a<r;a++)result[result.length]=new n.UInt8(e[a]);return new n.Component([i(o),new n.Component(result)])}}},2008:(e,t,r)=>{var n=r(9023).inherits,o=r(5784).type,a=r(6261),i=3;function c(e){this.transport=e,this.transport.expect(2);var t=this;this.transport.once("data",(function(e){t.recvHeader(e)})).on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)}))}n(c,a.EventEmitter),c.prototype.recvHeader=function(e){var t=(new o.UInt8).read(e).value,r=this;if(t===i)(new o.UInt8).read(e),this.transport.expect(2),this.transport.once("data",(function(e){r.recvExtendedHeader(e)}));else{this.secFlag=t>>6&3;var n=(new o.UInt8).read(e).value;128&n?(this.transport.expect(1),this.transport.once("data",(function(e){r.recvExtendedFastPathHeader(e,n)}))):(this.transport.expect(n-2),this.transport.once("data",(function(e){r.recvFastPath(e)})))}},c.prototype.recvExtendedHeader=function(e){var t=(new o.UInt16Be).read(e);this.transport.expect(t.value-4);var r=this;this.transport.once("data",(function(e){r.recvData(e)}))},c.prototype.recvData=function(e){this.emit("data",e),this.transport.expect(2);var t=this;this.transport.once("data",(function(e){t.recvHeader(e)}))},c.prototype.recvExtendedFastPathHeader=function(e,t){var r=((-129&t)<<8)+(new o.UInt8).read(e).value,n=this;this.transport.expect(r-3),this.transport.once("data",(function(e){n.recvFastPath(e)}))},c.prototype.recvFastPath=function(e){this.emit("fastPathData",this.secFlag,e);var t=this;this.transport.expect(2),this.transport.once("data",(function(e){t.recvHeader(e)}))},c.prototype.send=function(e){this.transport.send(new o.Component([new o.UInt8(i),new o.UInt8(0),new o.UInt16Be(e.size()+4),e]))},c.prototype.close=function(){this.transport.close()},e.exports=c},5599:(e,t,r)=>{var n=r(9023).inherits,o=r(6261),a=r(5784).type,i=r(5784).log,c=(r(5784).error,224),s=208,u=240,l=1,f=2,p=3,h={PROTOCOL_RDP:0,PROTOCOL_SSL:1,PROTOCOL_HYBRID:2,PROTOCOL_HYBRID_EX:8};function d(e){var t={type:new a.UInt8,flag:new a.UInt8,length:new a.UInt16Le(8,{constant:!0}),result:new a.UInt32Le};return new a.Component(t,e)}function v(e,t){var r={len:new a.UInt8((function(){return new a.Component(r).size()-1})),code:new a.UInt8(c,{constant:!0}),padding:new a.Component([new a.UInt16Le,new a.UInt16Le,new a.UInt8]),cookie:t||new a.Factory((function(e){for(var t=0;;){if(2573===e.buffer.readUInt16LE(e.offset+t))return void(r.cookie=new a.BinaryString(null,{readLength:new a.CallableValue(t+2)}).read(e));t+=1}}),{conditional:function(){return r.len.value>14}}),protocolNeg:d({optional:!0})};return new a.Component(r,e)}function y(e){var t={len:new a.UInt8((function(){return new a.Component(t).size()-1})),code:new a.UInt8(s,{constant:!0}),padding:new a.Component([new a.UInt16Le,new a.UInt16Le,new a.UInt8]),protocolNeg:d({optional:!0})};return new a.Component(t,e)}function m(){var e={header:new a.UInt8(2),messageType:new a.UInt8(u,{constant:!0}),separator:new a.UInt8(128,{constant:!0})};return new a.Component(e)}function b(e){this.transport=e,this.requestedProtocol=h.PROTOCOL_SSL|h.PROTOCOL_HYBRID,this.selectedProtocol=h.PROTOCOL_SSL|h.PROTOCOL_HYBRID;var t=this;this.transport.on("close",(function(){t.emit("close")})).on("error",(function(e){t.emit("error",e)}))}function _(e,t){this.config=t,b.call(this,e)}function g(e,t,r){b.call(this,e),this.keyFilePath=t,this.crtFilePath=r;var n=this;this.transport.once("data",(function(e){n.recvConnectionRequest(e)}))}n(b,o.EventEmitter),b.prototype.recvData=function(e){m().read(e),this.emit("data",e)},b.prototype.send=function(e){this.transport.send(new a.Component([m(),e]))},n(_,b),_.prototype.connect=function(){var e=v(null,new a.BinaryString);e.obj.protocolNeg.obj.type.value=l,e.obj.protocolNeg.obj.result.value=this.requestedProtocol,this.transport.send(e);var t=this;this.transport.once("data",(function(e){t.recvConnectionConfirm(e)}))},_.prototype.close=function(){this.transport.close()},_.prototype.recvConnectionConfirm=function(e){var t=y().read(e);if(t.obj.protocolNeg.obj.type.value!=p)if(t.obj.protocolNeg.obj.type.value==f&&(this.selectedProtocol=t.obj.protocolNeg.obj.result.value),-1===[h.PROTOCOL_HYBRID_EX].indexOf(this.selectedProtocol))if(this.selectedProtocol!=h.PROTOCOL_RDP){if(this.selectedProtocol!=h.PROTOCOL_HYBRID){n=this;return this.transport.on("data",(function(e){n.recvData(e)})),this.selectedProtocol==h.PROTOCOL_SSL?(i.debug("SSL standard security selected"),void this.transport.transport.startTLS((function(){n.emit("connect",n.selectedProtocol)}))):void 0}i.debug("NLA security layer selected");var n=this,o=this.transport.transport;this.transport.transport.startTLS((function(){var e=r(6626);n.nla=new e(o,(function(){n.nlaCompleted()}),n.config.domain,n.config.userName,n.config.password),n.nla.sendNegotiateMessage()}))}else i.debug("RDP standard security selected");else this.emit("error","NODE_RDP_PROTOCOL_X224_NLA_NOT_SUPPORTED");else this.emit("error",{err:"NODE_RDP_PROTOCOL_X224_NEG_FAILURE",code:t.obj.protocolNeg.obj.result.value})},_.prototype.nlaCompleted=function(){var e=this;delete e.nla,this.transport.on("data",(function(t){e.recvData(t)})),this.emit("connect",this.selectedProtocol)},n(g,b),g.prototype.recvConnectionRequest=function(e){var t=v().read(e);if(!t.obj.protocolNeg.isReaded)throw new Error("NODE_RDP_PROTOCOL_X224_NO_BASIC_SECURITY_LAYER");if(this.requestedProtocol=t.obj.protocolNeg.obj.result.value,this.selectedProtocol=this.requestedProtocol&h.PROTOCOL_SSL,this.selectedProtocol&h.PROTOCOL_SSL)this.sendConnectionConfirm();else{var r=y();r.obj.protocolNeg.obj.type.value=NegociationType.TYPE_RDP_NEG_FAILURE,r.obj.protocolNeg.obj.result.value=NegotiationFailureCode.SSL_REQUIRED_BY_SERVER,this.transport.send(r),this.close()}},g.prototype.sendConnectionConfirm=function(){var e=y();e.obj.protocolNeg.obj.type.value=f,e.obj.protocolNeg.obj.result.value=this.selectedProtocol,this.transport.send(e);var t=this;this.transport.on("data",(function(e){t.recvData(e)})),this.transport.transport.listenTLS(this.keyFilePath,this.crtFilePath,(function(){i.debug("start SSL connection"),t.emit("connect",t.requestedProtocol)}))},e.exports={Client:_,Server:g}},8597:(e,t,r)=>{var n=r(6429),o=r(3179);e.exports={x509:n,rsa:o}},5802:(e,t,r)=>{function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var o=r(6982);var a=function(e){return"number"==typeof e||function(e){return!!e&&"object"==n(e)}(e)&&"[object Number]"==Object.prototype.toString.call(e)};function i(e,t){null!=e&&("number"==typeof e?this.fromNumber(e,t):Buffer.isBuffer(e)?this.fromBuffer(e):null==t&&"string"!=typeof e?this.fromByteArray(e):this.fromString(e,t))}function c(){return new i(null)}i.prototype.am=function(e,t,r,n,o,a){for(var i=16383&t,c=t>>14;--a>=0;){var s=16383&this[e],u=this[e++]>>14,l=c*s+u*i;o=((s=i*s+((16383&l)<<14)+r[n]+o)>>28)+(l>>14)+c*u,r[n++]=268435455&s}return o},i.prototype.DB=28,i.prototype.DM=268435455,i.prototype.DV=1<<28;i.prototype.FV=Math.pow(2,52),i.prototype.F1=24,i.prototype.F2=4;var s,u,l=new Array;for(s="0".charCodeAt(0),u=0;u<=9;++u)l[s++]=u;for(s="a".charCodeAt(0),u=10;u<36;++u)l[s++]=u;for(s="A".charCodeAt(0),u=10;u<36;++u)l[s++]=u;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function p(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function h(e){var t=c();return t.fromInt(e),t}function d(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function v(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function m(e,t){return e&t}function b(e,t){return e|t}function _(e,t){return e^t}function g(e,t){return e&~t}function E(e){if(0===e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function w(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function P(){}function S(e){return e}function k(e){this.r2=c(),this.q3=c(),i.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},y.prototype.convert=function(e){var t=c();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(i.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=c();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},P.prototype.convert=S,P.prototype.revert=S,P.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},P.prototype.sqrTo=function(e,t){e.squareTo(t)},k.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=c();return e.copyTo(t),this.reduce(t),t},k.prototype.revert=function(e){return e},k.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},k.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},k.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var A=[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,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,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],T=(1<<26)/A[A.length-1];i.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},i.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+DV:this.t=0},i.prototype.fromString=function(e,t,r){var n;switch(t){case 2:n=1;break;case 4:n=2;break;case 8:n=3;break;case 16:n=4;break;case 32:n=5;break;case 256:n=8;break;default:return void this.fromRadix(e,t)}this.t=0,this.s=0;for(var o=e.length,a=!1,c=0;--o>=0;){var s=8==n?255&e[o]:p(e,o);s<0?"-"==e.charAt(o)&&(a=!0):(a=!1,0===c?this[this.t++]=s:c+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-c)-1)<<c,this[this.t++]=s>>this.DB-c):this[this.t-1]|=s<<c,(c+=n)>=this.DB&&(c-=this.DB))}!r&&8==n&&128&e[0]&&(this.s=-1,c>0&&(this[this.t-1]|=(1<<this.DB-c)-1<<c)),this.clamp(),a&&i.ZERO.subTo(this,this)},i.prototype.fromByteArray=function(e,t){this.fromString(e,256,t)},i.prototype.fromBuffer=function(e){this.fromString(e,256,!0)},i.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},i.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},i.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},i.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,o=this.DB-n,a=(1<<o)-1,i=Math.floor(e/this.DB),c=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t[r+i+1]=this[r]>>o|c,c=(this[r]&a)<<n;for(r=i-1;r>=0;--r)t[r]=0;t[i]=c,t.t=this.t+i+1,t.s=this.s,t.clamp()},i.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,o=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var i=r+1;i<this.t;++i)t[i-r-1]|=(this[i]&a)<<o,t[i-r]=this[i]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<o),t.t=this.t-r,t.clamp()}},i.prototype.subTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},i.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),o=r.t;for(t.t=o+n.t;--o>=0;)t[o]=0;for(o=0;o<n.t;++o)t[o+r.t]=r.am(0,n[o],t,o,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&i.ZERO.subTo(t,t)},i.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},i.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var o=this.abs();if(o.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=c());var a=c(),s=this.s,u=e.s,l=this.DB-d(n[n.t-1]);l>0?(n.lShiftTo(l,a),o.lShiftTo(l,r)):(n.copyTo(a),o.copyTo(r));var f=a.t,p=a[f-1];if(0!==p){var h=p*(1<<this.F1)+(f>1?a[f-2]>>this.F2:0),v=this.FV/h,y=(1<<this.F1)/h,m=1<<this.F2,b=r.t,_=b-f,g=null==t?c():t;for(a.dlShiftTo(_,g),r.compareTo(g)>=0&&(r[r.t++]=1,r.subTo(g,r)),i.ONE.dlShiftTo(f,g),g.subTo(a,a);a.t<f;)a[a.t++]=0;for(;--_>=0;){var E=r[--b]==p?this.DM:Math.floor(r[b]*v+(r[b-1]+m)*y);if((r[b]+=a.am(0,E,r,_,0,f))<E)for(a.dlShiftTo(_,g),r.subTo(g,r);r[b]<--E;)r.subTo(g,r)}null!=t&&(r.drShiftTo(f,t),s!=u&&i.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),s<0&&i.ZERO.subTo(r,r)}}},i.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},i.prototype.isEven=function(){return 0===(this.t>0?1&this[0]:this.s)},i.prototype.exp=function(e,t){if(e>4294967295||e<1)return i.ONE;var r=c(),n=c(),o=t.convert(this),a=d(e)-1;for(o.copyTo(r);--a>=0;)if(t.sqrTo(r,n),(e&1<<a)>0)t.mulTo(n,o,r);else{var s=r;r=n,n=s}return t.revert(r)},i.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},i.prototype.toRadix=function(e){if(null==e&&(e=10),0===this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=h(r),o=c(),a=c(),i="";for(this.divRemTo(n,o,a);o.signum()>0;)i=(r+a.intValue()).toString(e).substr(1)+i,o.divRemTo(n,o,a);return a.intValue().toString(e)+i},i.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),o=!1,a=0,c=0,s=0;s<e.length;++s){var u=p(e,s);u<0?"-"==e.charAt(s)&&0===this.signum()&&(o=!0):(c=t*c+u,++a>=r&&(this.dMultiply(n),this.dAddOffset(c,0),a=0,c=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(c,0)),o&&i.ZERO.subTo(this,this)},i.prototype.fromNumber=function(e,t){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e),this.testBit(e-1)||this.bitwiseTo(i.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(i.ONE.shiftLeft(e-1),this);else{var r=o.randomBytes(1+(e>>3)),n=7&e;n>0?r[0]&=(1<<n)-1:r[0]=0,this.fromByteArray(r)}},i.prototype.bitwiseTo=function(e,t,r){var n,o,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(o=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],o);r.t=this.t}else{for(o=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(o,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},i.prototype.changeBit=function(e,t){var r=i.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},i.prototype.addTo=function(e,t){for(var r=0,n=0,o=Math.min(e.t,this.t);r<o;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},i.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},i.prototype.dAddOffset=function(e,t){if(0!==e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},i.prototype.multiplyLowerTo=function(e,t,r){var n,o=Math.min(this.t+e.t,t);for(r.s=0,r.t=o;o>0;)r[--o]=0;for(n=r.t-this.t;o<n;++o)r[o+this.t]=this.am(0,e[o],r,o,0,this.t);for(n=Math.min(e.t,t);o<n;++o)this.am(0,e[o],r,o,0,t-o);r.clamp()},i.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},i.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0===t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},i.prototype.millerRabin=function(e){var t=this.subtract(i.ONE),r=t.getLowestSetBit();if(r<=0)return!1;var n=t.shiftRight(r);(e=e+1>>1)>A.length&&(e=A.length);for(var o=c(),a=0;a<e;++a){o.fromInt(A[Math.floor(Math.random()*A.length)]);var s=o.modPow(n,this);if(0!=s.compareTo(i.ONE)&&0!=s.compareTo(t)){for(var u=1;u++<r&&0!=s.compareTo(t);)if(0===(s=s.modPowInt(2,this)).compareTo(i.ONE))return!1;if(0!=s.compareTo(t))return!1}}return!0},i.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,o=!1,a="",i=this.t,c=this.DB-i*this.DB%t;if(i-- >0)for(c<this.DB&&(r=this[i]>>c)>0&&(o=!0,a=f(r));i>=0;)c<t?(r=(this[i]&(1<<c)-1)<<t-c,r|=this[--i]>>(c+=this.DB-t)):(r=this[i]>>(c-=t)&n,c<=0&&(c+=this.DB,--i)),r>0&&(o=!0),o&&(a+=f(r));return o?a:"0"},i.prototype.negate=function(){var e=c();return i.ZERO.subTo(this,e),e},i.prototype.abs=function(){return this.s<0?this.negate():this},i.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},i.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+d(this[this.t-1]^this.s&this.DM)},i.prototype.mod=function(e){var t=c();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(i.ZERO)>0&&e.subTo(t,t),t},i.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new v(t):new y(t),this.exp(e,r)},i.prototype.clone=function(){var e=c();return this.copyTo(e),e},i.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0===this.t)return-1}else{if(1==this.t)return this[0];if(0===this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},i.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},i.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},i.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},i.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,o=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[o++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0===o&&(128&this.s)!=(128&r)&&++o,(o>0||r!=this.s)&&(t[o++]=r);return t},i.prototype.toBuffer=function(e){var t=Buffer.from(this.toByteArray());if(!0===e&&0===t[0])t=t.slice(1);else if(a(e)){if(t.length>e){for(var r=0;r<t.length-e;r++)if(0!==t[r])return null;return t.slice(t.length-e)}if(t.length<e){var n=Buffer.alloc(e);return n.fill(0,0,e-t.length),t.copy(n,e-t.length),n}}return t},i.prototype.equals=function(e){return 0==this.compareTo(e)},i.prototype.min=function(e){return this.compareTo(e)<0?this:e},i.prototype.max=function(e){return this.compareTo(e)>0?this:e},i.prototype.and=function(e){var t=c();return this.bitwiseTo(e,m,t),t},i.prototype.or=function(e){var t=c();return this.bitwiseTo(e,b,t),t},i.prototype.xor=function(e){var t=c();return this.bitwiseTo(e,_,t),t},i.prototype.andNot=function(e){var t=c();return this.bitwiseTo(e,g,t),t},i.prototype.not=function(){for(var e=c(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},i.prototype.shiftLeft=function(e){var t=c();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},i.prototype.shiftRight=function(e){var t=c();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},i.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+E(this[e]);return this.s<0?this.t*this.DB:-1},i.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=w(this[r]^t);return e},i.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},i.prototype.setBit=function(e){return this.changeBit(e,b)},i.prototype.clearBit=function(e){return this.changeBit(e,g)},i.prototype.flipBit=function(e){return this.changeBit(e,_)},i.prototype.add=function(e){var t=c();return this.addTo(e,t),t},i.prototype.subtract=function(e){var t=c();return this.subTo(e,t),t},i.prototype.multiply=function(e){var t=c();return this.multiplyTo(e,t),t},i.prototype.divide=function(e){var t=c();return this.divRemTo(e,t,null),t},i.prototype.remainder=function(e){var t=c();return this.divRemTo(e,null,t),t},i.prototype.divideAndRemainder=function(e){var t=c(),r=c();return this.divRemTo(e,t,r),new Array(t,r)},i.prototype.modPow=function(e,t){var r,n,o=e.bitLength(),a=h(1);if(o<=0)return a;r=o<18?1:o<48?3:o<144?4:o<768?5:6,n=o<8?new v(t):t.isEven()?new k(t):new y(t);var i=new Array,s=3,u=r-1,l=(1<<r)-1;if(i[1]=n.convert(this),r>1){var f=c();for(n.sqrTo(i[1],f);s<=l;)i[s]=c(),n.mulTo(f,i[s-2],i[s]),s+=2}var p,m,b=e.t-1,_=!0,g=c();for(o=d(e[b])-1;b>=0;){for(o>=u?p=e[b]>>o-u&l:(p=(e[b]&(1<<o+1)-1)<<u-o,b>0&&(p|=e[b-1]>>this.DB+o-u)),s=r;!(1&p);)p>>=1,--s;if((o-=s)<0&&(o+=this.DB,--b),_)i[p].copyTo(a),_=!1;else{for(;s>1;)n.sqrTo(a,g),n.sqrTo(g,a),s-=2;s>0?n.sqrTo(a,g):(m=a,a=g,g=m),n.mulTo(g,i[p],a)}for(;b>=0&&!(e[b]&1<<o);)n.sqrTo(a,g),m=a,a=g,g=m,--o<0&&(o=this.DB-1,--b)}return n.revert(a)},i.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0===e.signum())return i.ZERO;for(var r=e.clone(),n=this.clone(),o=h(1),a=h(0),c=h(0),s=h(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(c.isEven()&&s.isEven()||(c.addTo(this,c),s.subTo(e,s)),c.rShiftTo(1,c)):s.isEven()||s.subTo(e,s),s.rShiftTo(1,s);r.compareTo(n)>=0?(r.subTo(n,r),t&&o.subTo(c,o),a.subTo(s,a)):(n.subTo(r,n),t&&c.subTo(o,c),s.subTo(a,s))}return 0!=n.compareTo(i.ONE)?i.ZERO:s.compareTo(e)>=0?s.subtract(e):s.signum()<0?(s.addTo(e,s),s.signum()<0?s.add(e):s):s},i.prototype.pow=function(e){return this.exp(e,new P)},i.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var o=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(o<a&&(a=o),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(o=t.getLowestSetBit())>0&&t.rShiftTo(o,t),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},i.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(r[0]==A[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<A.length;){for(var n=A[t],o=t+1;o<A.length&&n<T;)n*=A[o++];for(n=r.modInt(n);t<o;)if(n%A[t++]==0)return!1}return r.millerRabin(e)},i.int2char=f,i.ZERO=h(0),i.ONE=h(1),i.prototype.square=function(){var e=c();return this.squareTo(e),e},e.exports=i},1890:(e,t,r)=>{var n;function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}e=r.nmd(e),function(){"use strict";var t="object"===("undefined"==typeof window?"undefined":o(window))?window:{};!t.JS_MD4_NO_NODE_JS&&"object"===("undefined"==typeof process?"undefined":o(process))&&process.versions&&process.versions.node&&(t=global);var a,i=!t.JS_MD4_NO_COMMON_JS&&"object"===o(e)&&e.exports,c=r.amdO,s=!t.JS_MD4_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),l=[128,32768,8388608,-2147483648],f=[0,8,16,24],p=["hex","array","digest","buffer","arrayBuffer"],h=[];if(s){var d=new ArrayBuffer(68);a=new Uint8Array(d),h=new Uint32Array(d)}var v=function(e){return function(t){return new y(!0).update(t)[e]()}};function y(e){if(e)h[0]=h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0,this.blocks=h,this.buffer8=a;else if(s){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0}y.prototype.update=function(e){if(!this.finalized){var t="string"!=typeof e;t&&s&&e instanceof ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,o=0,a=e.length||0,i=this.blocks,c=this.buffer8;o<a;){if(this.hashed&&(this.hashed=!1,i[0]=i[16],i[16]=i[1]=i[2]=i[3]=i[4]=i[5]=i[6]=i[7]=i[8]=i[9]=i[10]=i[11]=i[12]=i[13]=i[14]=i[15]=0),t)if(s)for(n=this.start;o<a&&n<64;++o)c[n++]=e[o];else for(n=this.start;o<a&&n<64;++o)i[n>>2]|=e[o]<<f[3&n++];else if(s)for(n=this.start;o<a&&n<64;++o)(r=e.charCodeAt(o))<128?c[n++]=r:r<2048?(c[n++]=192|r>>6,c[n++]=128|63&r):r<55296||r>=57344?(c[n++]=224|r>>12,c[n++]=128|r>>6&63,c[n++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),c[n++]=240|r>>18,c[n++]=128|r>>12&63,c[n++]=128|r>>6&63,c[n++]=128|63&r);else for(n=this.start;o<a&&n<64;++o)(r=e.charCodeAt(o))<128?i[n>>2]|=r<<f[3&n++]:r<2048?(i[n>>2]|=(192|r>>6)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]):r<55296||r>=57344?(i[n>>2]|=(224|r>>12)<<f[3&n++],i[n>>2]|=(128|r>>6&63)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++o)),i[n>>2]|=(240|r>>18)<<f[3&n++],i[n>>2]|=(128|r>>12&63)<<f[3&n++],i[n>>2]|=(128|r>>6&63)<<f[3&n++],i[n>>2]|=(128|63&r)<<f[3&n++]);this.lastByteIndex=n,this.bytes+=n-this.start,n>=64?(this.start=n-64,this.hash(),this.hashed=!0):this.start=n}return this}},y.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=l[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,this.hash()}},y.prototype.hash=function(){var e,t,r,n,o,a,i,c,s=this.blocks;this.first?t=(t=((r=(r=((n=(n=(4023233417&(e=(e=s[0]-1)<<3|e>>>29)|2562383102&~e)+s[1]+271733878)<<7|n>>>25)&e|4023233417&~n)+s[2]-1732584194)<<11|r>>>21)&n|~r&e)+s[3]-271733879)<<19|t>>>13:(e=this.h0,t=this.h1,r=this.h2,n=this.h3,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[0])<<3|e>>>29)&t|~e&r)+s[1])<<7|n>>>25)&e|~n&t)+s[2])<<11|r>>>21)&n|~r&e)+s[3])<<19|t>>>13),t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[4])<<3|e>>>29)&t|~e&r)+s[5])<<7|n>>>25)&e|~n&t)+s[6])<<11|r>>>21)&n|~r&e)+s[7])<<19|t>>>13,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[8])<<3|e>>>29)&t|~e&r)+s[9])<<7|n>>>25)&e|~n&t)+s[10])<<11|r>>>21)&n|~r&e)+s[11])<<19|t>>>13,t=(t+=((r=(r+=((n=(n+=((e=(e+=(t&r|~t&n)+s[12])<<3|e>>>29)&t|~e&r)+s[13])<<7|n>>>25)&e|~n&t)+s[14])<<11|r>>>21)&n|~r&e)+s[15])<<19|t>>>13,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|r&n)+s[0]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[4]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[8]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[12]+1518500249)<<13|t>>>19,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[1]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[5]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[9]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[13]+1518500249)<<13|t>>>19,t=(t+=((i=(r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[2]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[6]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[10]+1518500249)<<9|r>>>23)&n)|r&e|c)+s[14]+1518500249)<<13|t>>>19,t=(t+=((r=(r+=((c=(n=(n+=((o=(e=(e+=((a=t&r)|t&n|i)+s[3]+1518500249)<<3|e>>>29)&t)|e&r|a)+s[7]+1518500249)<<5|n>>>27)&e)|n&t|o)+s[11]+1518500249)<<9|r>>>23)&n|r&e|c)+s[15]+1518500249)<<13|t>>>19,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[0]+1859775393)<<3|e>>>29))+s[8]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[4]+1859775393)<<11|r>>>21))+s[12]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[2]+1859775393)<<3|e>>>29))+s[10]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[6]+1859775393)<<11|r>>>21))+s[14]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[1]+1859775393)<<3|e>>>29))+s[9]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[5]+1859775393)<<11|r>>>21))+s[13]+1859775393)<<15|t>>>17,t=(t+=((c=(n=(n+=((a=t^r)^(e=(e+=(a^n)+s[3]+1859775393)<<3|e>>>29))+s[11]+1859775393)<<9|n>>>23)^e)^(r=(r+=(c^t)+s[7]+1859775393)<<11|r>>>21))+s[15]+1859775393)<<15|t>>>17,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},y.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15]+u[t>>4&15]+u[15&t]+u[t>>12&15]+u[t>>8&15]+u[t>>20&15]+u[t>>16&15]+u[t>>28&15]+u[t>>24&15]+u[r>>4&15]+u[15&r]+u[r>>12&15]+u[r>>8&15]+u[r>>20&15]+u[r>>16&15]+u[r>>28&15]+u[r>>24&15]+u[n>>4&15]+u[15&n]+u[n>>12&15]+u[n>>8&15]+u[n>>20&15]+u[n>>16&15]+u[n>>28&15]+u[n>>24&15]},y.prototype.toString=y.prototype.hex,y.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},y.prototype.array=y.prototype.digest,y.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},y.prototype.buffer=y.prototype.arrayBuffer;var m=function(){var e=v("hex");e.create=function(){return new y},e.update=function(t){return e.create().update(t)};for(var t=0;t<p.length;++t){var r=p[t];e[r]=v(r)}return e}();i?e.exports=m:(t.md4=m,c&&(void 0===(n=function(){return m}.call(m,r,m,e))||(e.exports=n)))}()},4824:e=>{function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==o&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,r){function n(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==t(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(r){if(r||""===r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var o=-1,i=function t(){for(;++o<r.length;)if(a.call(r,o))return t.value=r[o],t.done=!1,t;return t.value=e,t.done=!0,t};return i.next=i}}throw new TypeError(t(r)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),n.AsyncIterator=T,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new T(p(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},n}function n(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e){this.privateKey=function(e){for(var t=n(Array(256).keys()),r=0,o=(e=function(e){for(var t=[],r=0,n=e.length;r<n;r++)t.push(e.charCodeAt(r));return t}(e),0),a=t.length;o<a;o++){var i=[t[r=(r+t[o]+e[o%e.length])%256],t[o]];t[o]=i[0],t[r]=i[1]}return t}(e),this.byteStream=i(this.privateKey.slice(0))}var i=r().mark((function e(t){var n,o,a;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=0,o=0;case 1:return o=(o+t[n=(n+1)%256])%256,a=[t[o],t[n]],t[n]=a[0],t[o]=a[1],e.next=9,t[(t[n]+t[o])%256];case 9:e.next=1;break;case 11:case"end":return e.stop()}}),e)}));a.prototype.encrypt=function(e){for(var t="",r=0,n=e.length;r<n;r++)t+=("00"+(e.charCodeAt(r)^this.byteStream.next().value).toString(16)).substr(-2);return t},a.prototype.decrypt=function(e){for(var t="",r=0,n=(e=e.match(/[a-z0-9]{2}/gi)).length;r<n;r++)t+=String.fromCharCode(parseInt(e[r],16)^byteStream.next().value);return t},e.exports=a},3179:(e,t,r)=>{var n=r(5802);e.exports={publicKey:function(e,t){return{n:e,e:t}},encrypt:function(e,t){return new n(e).modPowInt(t.e,new n(t.n)).toBuffer()}}},6429:(e,t,r)=>{var n=r(5002);function o(){return new n.univ.Choice({teletexString:new n.univ.T61String,printableString:new n.univ.PrintableString,universalString:new n.univ.UniversalString,utf8String:new n.univ.UTF8String,bmpString:new n.univ.BMPString,ia5String:new n.univ.IA5String})}function a(){return new n.univ.Sequence({type:new n.univ.ObjectIdentifier,value:o()})}function i(){return new n.univ.SetOf(a)}function c(){return new n.univ.Choice({rdnSequence:new n.univ.SequenceOf(i)})}function s(){return new n.univ.Sequence({algorithm:new n.univ.ObjectIdentifier,parameters:new n.univ.Null})}function u(){return new n.univ.Sequence({extnID:new n.univ.ObjectIdentifier,critical:new n.univ.Boolean,extnValue:new n.univ.OctetString})}function l(){return new n.univ.Choice({utcTime:new n.univ.UTCTime,generalTime:new n.univ.GeneralizedTime})}function f(){return new n.univ.BitString}e.exports={X509Certificate:function(){return new n.univ.Sequence({tbsCertificate:new n.univ.Sequence({version:(new n.univ.Integer).explicitTag(new n.spec.Asn1Tag(n.spec.TagClass.Context,n.spec.TagFormat.Constructed,0)),serialNumber:new n.univ.Integer,signature:s(),issuer:c(),validity:new n.univ.Sequence({notBefore:l(),notAfter:l()}),subject:c(),subjectPublicKeyInfo:new n.univ.Sequence({algorithm:s(),subjectPublicKey:new n.univ.BitString}),issuerUniqueID:f().implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,1).optional(),subjectUniqueID:f().implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,2).optional(),extensions:new n.univ.SequenceOf(u).implicitTag(n.spec.TagClass.Context,n.spec.TagFormat.Primitive,3).optional()}),signatureAlgorithm:s(),signatureValue:new n.univ.BitString})},RSAPublicKey:function(){return new n.univ.Sequence({modulus:new n.univ.Integer,publicExponent:new n.univ.Integer})}}},2992:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.RdpController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(9317),f=r(9334),p=r(274),h=r(5890),d="navindex_rdp_tag_key",v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"infos",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.infos(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"mouse",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.mouse(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"wheel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.wheel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"unicode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.unicode(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"scancode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.scancode(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"rdpDisconnect",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.rdpService.rdpDisconnect(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return p.DataUtil.set(d,e),(0,h.Sucess)("ok")}},{key:"get",value:function(){var e=p.DataUtil.get(d);return(0,h.Sucess)(e||[])}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.RdpController=v,c.__decorate([(0,s.msg)(u.CmdType.infos),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"infos",null),c.__decorate([(0,s.msg)(u.CmdType.mouse),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"mouse",null),c.__decorate([(0,s.msg)(u.CmdType.wheel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"wheel",null),c.__decorate([(0,s.msg)(u.CmdType.unicode),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"unicode",null),c.__decorate([(0,s.msg)(u.CmdType.scancode),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"scancode",null),c.__decorate([(0,s.msg)(u.CmdType.rdp_disconnect),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],v.prototype,"rdpDisconnect",null),c.__decorate([(0,f.Post)("/tag/save"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Array]),c.__metadata("design:returntype",void 0)],v.prototype,"save",null),c.__decorate([(0,f.Get)("/tag"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",void 0)],v.prototype,"get",null),t.RdpController=v=c.__decorate([(0,f.Controller)("/rdp")],v)},9317:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.rdpService=t.RdpService=void 0;var c=r(5584),s=r(4988),u=c.__importDefault(r(4490)),l=r(8411),f="rdpClient",p=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"infos",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.wss,(n=r.dataMap.get(f))&&n.close(),a=e.context,n=u.default.createClient({domain:a.domain,userName:a.username,password:a.password,enablePerf:!0,autoLogin:!0,screen:a.screen,locale:a.locale,logLevel:process.argv[2]||"INFO"}),r.dataMap.set(f,n),n.on("connect",(function(){var t=new s.WsData(s.CmdType.rdp_connect);t.context="",e.wss.sendData(t.encode())})).on("bitmap",(function(t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:(n=new s.WsData(s.CmdType.rdp_bitmap)).bin_context=t.data,t.data=null,n.context=t,e.wss.ws.send(n.encode());case 5:case"end":return r.stop()}}),r)})))})).on("close",(function(){var t=new s.WsData(s.CmdType.rdp_close);t.context="",e.wss.sendData(t.encode())})).on("error",(function(t){var r=new s.WsData(s.CmdType.rdp_error);r.context=t,e.wss.sendData(r.encode())})).connect(a.ip,3389),e.wss.setClose((function(){n&&(console.log("由于ws断开,rpd关闭"),n.close())})),t.abrupt("return","");case 10:case"end":return t.stop()}}),t)})))}},{key:"mouse",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendPointerEvent(r.x,r.y,r.button,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"wheel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendWheelEvent(r.x,r.y,r.step,r.isNegative,r.isHorizontal);case 5:case"end":return t.stop()}}),t)})))}},{key:"unicode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendKeyEventUnicode(r.code,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"scancode",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.context,n=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:n.sendKeyEventScancode(r.code,r.isPressed);case 5:case"end":return t.stop()}}),t)})))}},{key:"rdpDisconnect",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.context,r=e.wss.dataMap.get(f)){t.next=4;break}return t.abrupt("return");case 4:r.close();case 5:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.RdpService=p,c.__decorate([(0,l.msg)(s.CmdType.rdp_disconnect),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[s.WsData]),c.__metadata("design:returntype",Promise)],p.prototype,"rdpDisconnect",null),t.rdpService=new p},828:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SettingController=void 0;var u=r(5584),l=r(9334),f=r(4908),p=r(5890),h=r(285),d=r(5443),v=r(4321),y=r(274),m=r(9625),b=r(5546),_=r(2279),g=r(5101),E=r(7699),w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.language="user_language",this.start_server_time=Date.now()},(t=[{key:"login",value:function(e){return v.Env.updateEnv([{key:"username"},{key:"password"}]),y.DataUtil.set("username",e.username),y.DataUtil.set("password",e.password),(0,p.Sucess)("ok")}},{key:"getRouter",value:function(){return(0,p.Sucess)(m.settingService.getCustomerRouter())}},{key:"saveRouter",value:function(e){return m.settingService.setCustomerRouter(e),(0,p.Sucess)("1")}},{key:"getApiRouter",value:function(){return(0,p.Sucess)(m.settingService.getCustomerApiRouter())}},{key:"saveApiRouter",value:function(e){return m.settingService.setCustomerApiRouter(e),(0,p.Sucess)("1")}},{key:"getSelfAuth",value:function(){var e=m.settingService.getSelfAuthOpen();return(0,p.Sucess)(null!=e&&e)}},{key:"saveSelfAuth",value:function(e){return m.settingService.setSelfAuthOpen(e),(0,p.Sucess)("1")}},{key:"getSelfAuthJscode",value:function(){var e=y.DataUtil.getFile(b.self_auth_jscode),t=" \n // 必须存在的类\n class Api { \n \n /*\n * 处理并返回结果\n * @params token: token\n */\n async handler(token) { \n return false;\n }\n }\n ";return e||y.DataUtil.setFile(b.self_auth_jscode,t),(0,p.Sucess)(e||t)}},{key:"getJscode",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){var r,n;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=m.settingService.routerHandler(e),r=y.DataUtil.getFile(e),n=" \n // 必须存在的类\n class Api { \n \n /*\n * 处理并返回结果\n * @params headers: 请求头对象\n * @params body: 请求体\n */\n async handler(headers,body,ctx) { \n return null;\n }\n }\n ",r||y.DataUtil.setFile(e,n),t.abrupt("return",(0,p.Sucess)(r||n));case 5:case"end":return t.stop()}}),t)})))}},{key:"saveJscode",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y.DataUtil.setFile(m.settingService.routerHandler(e.router),e.context),t.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}},{key:"getToken",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,p.Sucess)(m.settingService.getToken()));case 1:case"end":return e.stop()}}),e)})))}},{key:"saveToken",value:function(e){return u.__awaiter(this,void 0,void 0,i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m.settingService.saveToken(e.mode,e.length),t.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return t.stop()}}),t)})))}},{key:"clearToken",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h.Cache.clear(),e.abrupt("return",(0,p.Sucess)("1"));case 2:case"end":return e.stop()}}),e)})))}},{key:"saveFilesSetting",value:function(e,t){return m.settingService.saveFilesSetting(e,t.headers.authorization),(0,p.Sucess)("1")}},{key:"getFilesSetting",value:function(){return(0,p.Sucess)(m.settingService.getFilesSetting())}},{key:"getSoftware",value:function(){return(0,p.Sucess)(m.settingService.getSoftware())}},{key:"setSoftware",value:function(e){return m.settingService.setSoftware(e),(0,p.Sucess)("")}},{key:"languageSetting",value:function(e){return y.DataUtil.set(this.language,e.language),(0,p.Sucess)("1")}},{key:"getLanguage",value:function(){var e,t=new f.UserBaseInfo;t.language=null!==(e=y.DataUtil.get(this.language))&&void 0!==e?e:"zh",t.sys=(0,g.getSys)();var r,n={},a=o(m.settingService.getSoftware());try{for(a.s();!(r=a.n()).done;){var i=r.value;n[i.id]=i}}catch(e){a.e(e)}finally{a.f()}return t.sysSoftWare=n,t.runing_time_length=(0,E.getShortTime)(this.start_server_time),(0,p.Sucess)(t)}},{key:"getEnvPath",value:function(){return(0,p.Sucess)(m.settingService.getEnvPath())}},{key:"setEnvPath",value:function(e){return m.settingService.setEnvPath(e.path),(0,p.Sucess)("1")}},{key:"protectionDirGet",value:function(){return(0,p.Sucess)(m.settingService.protectionDirGet())}},{key:"protectionDirSave",value:function(e){return m.settingService.protectionDirSave(e),(0,p.Sucess)("1")}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SettingController=w,u.__decorate([(0,l.Post)("/updatePassword"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[f.UserLogin]),u.__metadata("design:returntype",void 0)],w.prototype,"login",null),u.__decorate([(0,l.Get)("/customer_router"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getRouter",null),u.__decorate([(0,l.Post)("/customer_router/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveRouter",null),u.__decorate([(0,l.Get)("/api/customer_router"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getApiRouter",null),u.__decorate([(0,l.Post)("/api/customer_router/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveApiRouter",null),u.__decorate([(0,l.Get)("/self_auth_open"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSelfAuth",null),u.__decorate([(0,l.Post)("/self_auth_open/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveSelfAuth",null),u.__decorate([(0,l.Get)("/self_auth_open/jscode"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSelfAuthJscode",null),u.__decorate([(0,l.Get)("/jscode/:router*"),u.__param(0,(0,l.Param)("router")),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[String]),u.__metadata("design:returntype",Promise)],w.prototype,"getJscode",null),u.__decorate([(0,l.Post)("/jscode/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",Promise)],w.prototype,"saveJscode",null),u.__decorate([(0,l.Get)("/token"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",Promise)],w.prototype,"getToken",null),u.__decorate([(0,l.Post)("/token/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[_.TokenSettingReq]),u.__metadata("design:returntype",Promise)],w.prototype,"saveToken",null),u.__decorate([(0,l.Get)("/token/clear"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",Promise)],w.prototype,"clearToken",null),u.__decorate([(0,l.Post)("/filesSetting/save"),u.__param(0,(0,l.Body)()),u.__param(1,(0,l.Ctx)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object,Object]),u.__metadata("design:returntype",void 0)],w.prototype,"saveFilesSetting",null),u.__decorate([(0,l.Get)("/filesSetting"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getFilesSetting",null),u.__decorate([(0,l.Get)("/outside/software/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getSoftware",null),u.__decorate([(0,l.Post)("/outside/software/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"setSoftware",null),u.__decorate([(0,l.Post)("/language/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"languageSetting",null),u.__decorate([(0,l.Get)("/userInfo/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getLanguage",null),u.__decorate([(0,l.Get)("/env/path/get"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"getEnvPath",null),u.__decorate([(0,l.Post)("/env/path/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"setEnvPath",null),u.__decorate([(0,l.Get)("/protection_dir"),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[]),u.__metadata("design:returntype",void 0)],w.prototype,"protectionDirGet",null),u.__decorate([(0,l.Post)("/protection_dir/save"),u.__param(0,(0,l.Body)()),u.__metadata("design:type",Function),u.__metadata("design:paramtypes",[Object]),u.__metadata("design:returntype",void 0)],w.prototype,"protectionDirSave",null),t.SettingController=w=u.__decorate([(0,d.Service)(),(0,l.Controller)("/setting")],w)},9625:(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _regeneratorRuntime(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var a=t&&t.prototype instanceof m?t:m,i=Object.create(a.prototype),c=new C(n||[]);return o(i,"_invoke",{value:A(e,r,c)}),i}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",v="completed",y={};function m(){}function b(){}function _(){}var g={};u(g,i,(function(){return this}));var E=Object.getPrototypeOf,w=E&&E(E(x([])));w&&w!==r&&n.call(w,i)&&(g=w);var P=_.prototype=m.prototype=Object.create(g);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,a,i,c){var s=f(e[o],e,a);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==_typeof(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):t.resolve(l).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var a;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function A(t,r,n){var o=p;return function(a,i){if(o===d)throw Error("Generator is already running");if(o===v){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=T(c,n);if(s){if(s===y)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var u=f(t,r,n);if("normal"===u.type){if(o=n.done?v:h,u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=v,n.method="throw",n.arg=u.arg)}}}function T(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,T(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function x(t){if(t||""===t){var r=t[i];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function r(){for(;++o<t.length;)if(n.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return a.next=a}}throw new TypeError(_typeof(t)+" is not iterable")}return b.prototype=_,o(P,"constructor",{value:_,configurable:!0}),o(_,"constructor",{value:b,configurable:!0}),b.displayName=u(_,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,u(e,s,"GeneratorFunction")),e.prototype=Object.create(P),e},t.awrap=function(e){return{__await:e}},S(k.prototype),u(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new k(l(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},S(P),u(P,s,"Generator"),u(P,i,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=x,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(L),!t)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){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 a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:x(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==_typeof(t)?t:t+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=_typeof(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.settingService=exports.SettingService=void 0;var tslib_1=__webpack_require__(5584),DataUtil_1=__webpack_require__(274),path_1=tslib_1.__importDefault(__webpack_require__(6928)),fs_1=tslib_1.__importDefault(__webpack_require__(9896)),customerRouter_pojo_1=__webpack_require__(5546),cache_1=__webpack_require__(285),Result_1=__webpack_require__(5890),config_1=__webpack_require__(3129),setting_req_1=__webpack_require__(2279),Env_1=__webpack_require__(4321),sys_utl_1=__webpack_require__(9005),needle=__webpack_require__(9551),customer_router_key="customer_router_key",customer_api_router_key="customer_api_router_key",token_setting="token_setting",files_pre_mulu_key="files_pre_mulu_key",SettingService=function(){function SettingService(){_classCallCheck(this,SettingService),this.extra_env_path="extra_env_path",this.protection_directory="sys_protection_directory"}return _createClass(SettingService,[{key:"getCustomerRouter",value:function(){var e=DataUtil_1.DataUtil.get(customer_router_key);return null!=e?e:[]}},{key:"setCustomerRouter",value:function(e){DataUtil_1.DataUtil.set(customer_router_key,e)}},{key:"intercept",value:function(e){return tslib_1.__awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var r,n,o,a,i,c,s,u,l,f,p,h,d,v,y=this;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.url,e.url.includes("?")&&(r=e.url.split("?")[0]),!((n=DataUtil_1.DataUtil.get(customer_router_key))&&n.length>0)){t.next=37;break}o=_createForOfIteratorHelper(n),t.prev=5,o.s();case 7:if((a=o.n()).done){t.next=29;break}if(i=a.value,i[0]!==r){t.next=27;break}if(!(c=i[1])){t.next=27;break}if(!c.startsWith("http")){t.next=22;break}return t.next=16,needle("get",c,e.headers);case 16:for(u in(s=t.sent).headers)e.set(u,s.headers[u]);e.body=s.body,e.status=s.statusCode,t.next=26;break;case 22:l=path_1.default.join(c),c.includes(".htm")&&(e.type="html"),fs_1.default.accessSync(l,fs_1.default.constants.F_OK),e.body=fs_1.default.createReadStream(l);case 26:return t.abrupt("return",!0);case 27:t.next=7;break;case 29:t.next=34;break;case 31:t.prev=31,t.t0=t.catch(5),o.e(t.t0);case 34:return t.prev=34,o.f(),t.finish(34);case 37:if(!((f=DataUtil_1.DataUtil.get(customer_api_router_key))&&f.length>0)){t.next=58;break}p=_createForOfIteratorHelper(f),t.prev=40,d=_regeneratorRuntime().mark((function t(){var n,o,a,i;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=h.value).router!==r){t.next=24;break}if(!n.needAuth){t.next=9;break}return o=e.headers.authorization,t.next=6,y.check(o);case 6:if(t.sent){t.next=9;break}return e.body=(0,Result_1.AuthFail)("失败"),t.abrupt("return",{v:!0});case 9:return t.prev=9,a=y.getHandlerClass(n.router),i="",e.req.on("data",(function(e){i+=e})),t.next=15,new Promise((function(t){e.req.on("end",t)}));case 15:return t.next=17,a.handler(e.headers,i,e,cache_1.Cache);case 17:e.body=t.sent,t.next=23;break;case 20:t.prev=20,t.t0=t.catch(9),e.body=(0,Result_1.Sucess)(t.t0.toString());case 23:return t.abrupt("return",{v:!0});case 24:case"end":return t.stop()}}),t,null,[[9,20]])})),p.s();case 43:if((h=p.n()).done){t.next=50;break}return t.delegateYield(d(),"t1",45);case 45:if(!(v=t.t1)){t.next=48;break}return t.abrupt("return",v.v);case 48:t.next=43;break;case 50:t.next=55;break;case 52:t.prev=52,t.t2=t.catch(40),p.e(t.t2);case 55:return t.prev=55,p.f(),t.finish(55);case 58:return t.abrupt("return",!1);case 59:case"end":return t.stop()}}),t,null,[[5,31,34,37],[40,52,55,58]])})))}},{key:"getHandlerClass",value:function getHandlerClass(key){var jscode=DataUtil_1.DataUtil.getFile(this.routerHandler(key));if(!jscode)return{};var ApiClass=eval("(() => {\n ".concat(jscode,";\n return Api;\n })()")),instance=new ApiClass;return instance}},{key:"getCustomerApiRouter",value:function(){var e=DataUtil_1.DataUtil.get(customer_api_router_key);return null!=e?e:[]}},{key:"setCustomerApiRouter",value:function(e){DataUtil_1.DataUtil.set(customer_api_router_key,e)}},{key:"check",value:function(e){return tslib_1.__awaiter(this,void 0,void 0,_regeneratorRuntime().mark((function t(){var r;return _regeneratorRuntime().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!cache_1.Cache.check(e)){t.next=3;break}return cache_1.Cache.updateTimer(e),t.abrupt("return",!0);case 3:if(!this.getSelfAuthOpen()){t.next=12;break}if(r=this.getHandlerClass(customerRouter_pojo_1.self_auth_jscode)){t.next=7;break}return t.abrupt("return",!1);case 7:return t.next=9,r.handler(e);case 9:if(!t.sent){t.next=12;break}return t.abrupt("return",!0);case 12:return t.abrupt("return",!1);case 13:case"end":return t.stop()}}),t,this)})))}},{key:"routerHandler",value:function(e){for(var t=(e=decodeURIComponent(e)).split(""),r=0;r<t.length;r++)"/"===t[r]&&(t[r]="_");return t.join("")}},{key:"getSelfAuthOpen",value:function(){return DataUtil_1.DataUtil.get(customerRouter_pojo_1.self_auth_jscode)}},{key:"setSelfAuthOpen",value:function(e){return DataUtil_1.DataUtil.set(customerRouter_pojo_1.self_auth_jscode,e.open)}},{key:"getToken",value:function(){return DataUtil_1.DataUtil.get(token_setting)}},{key:"saveToken",value:function(e,t){e===setting_req_1.TokenTimeMode.close?(cache_1.Cache.setIgnore(!1),cache_1.Cache.setIgnoreCheck(!1)):e===setting_req_1.TokenTimeMode.length?(cache_1.Cache.setIgnore(!0),cache_1.Cache.clearTokenTimerMap(),cache_1.Cache.getTokenMap().forEach((function(e){return cache_1.Cache.getTokenTimerMap().set(e,setTimeout((function(){cache_1.Cache.getTokenMap().delete(e),cache_1.Cache.getTokenTimerMap().delete(e)}),1e3*t))}))):e===setting_req_1.TokenTimeMode.forver&&(cache_1.Cache.clearTokenTimerMap(),cache_1.Cache.setIgnore(!0),cache_1.Cache.setIgnoreCheck(!0)),DataUtil_1.DataUtil.set(token_setting,{mode:e,length:t})}},{key:"init",value:function(){var e=DataUtil_1.DataUtil.get(token_setting);e&&e.mode&&this.saveToken(e.mode,e.length)}},{key:"getFilesSetting",value:function(){if(this.update_files_setting)return this.update_files_setting;var e=DataUtil_1.DataUtil.get(files_pre_mulu_key),t=new setting_req_1.FileSettingItem;t.path=Env_1.Env.base_folder,t.note="默认配置路径";var r=null!=e?e:[];return r.find((function(e){return e.default}))||(t.default=!0),this.update_files_setting=[t].concat(_toConsumableArray(r)),this.update_files_setting}},{key:"saveFilesSetting",value:function(e,t){Array.isArray(e)&&0!==e.length&&(e.shift(),DataUtil_1.DataUtil.set(files_pre_mulu_key,e),cache_1.Cache.getTokenMap().get(t).root_index=0,this.update_files_setting=null)}},{key:"getFileRootPath",value:function(e){var t,r=cache_1.Cache.getTokenMap().get(e),n=r&&null!==(t=r.root_index)&&void 0!==t?t:null,o=this.getFilesSetting();if(null!==n)return o[n].path;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var c=a.value;if(c.default)return c.path}}catch(e){i.e(e)}finally{i.f()}}},{key:"getSoftware",value:function(){if(this.cacheSysSoftwareItem)return this.cacheSysSoftwareItem;var e,t=DataUtil_1.DataUtil.get("sys_software"),r=new Map,n=_createForOfIteratorHelper(null!=t?t:[]);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.set(o.id,o)}}catch(e){n.e(e)}finally{n.f()}for(var a=[],i=0,c=Object.keys(setting_req_1.SysSoftware);i<c.length;i++){var s=c[i],u=new setting_req_1.SysSoftwareItem;u.id=setting_req_1.SysSoftware[s];var l=r.get(s);u.path=l?l.path:"",s===setting_req_1.SysSoftware.ffmpeg?u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"ffmpeg"," -version")):s===setting_req_1.SysSoftware.smartmontools?u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"smartctl"," --version")):s===setting_req_1.SysSoftware.ntfs_3g&&(u.installed=sys_utl_1.SystemUtil.commandIsExist("".concat(l&&l.path?l.path:"ntfs-3g"," --version"))),a.push(u)}return this.cacheSysSoftwareItem=a,a}},{key:"setSoftware",value:function(e){DataUtil_1.DataUtil.set("sys_software",e),this.cacheSysSoftwareItem=null,this.getFilesSetting()}},{key:"getEnvPath",value:function(){var e;return null!==(e=DataUtil_1.DataUtil.get(this.extra_env_path))&&void 0!==e?e:""}},{key:"setEnvPath",value:function(e){return DataUtil_1.DataUtil.set(this.extra_env_path,e),(0,Result_1.Sucess)("1")}},{key:"protectionDirGet",value:function(){var e;return null!==(e=DataUtil_1.DataUtil.get(this.protection_directory))&&void 0!==e?e:[]}},{key:"protectionDirSave",value:function(e){DataUtil_1.DataUtil.set(this.protection_directory,e),this.protectionInit()}},{key:"protectionInit",value:function(){try{var e=this.protectionDirGet();this.protection_directory_set?this.protection_directory_set.clear():this.protection_directory_set=new Set;var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;if(n.path.endsWith("*"))try{var o,a=path_1.default.dirname(n.path),i=_createForOfIteratorHelper(fs_1.default.readdirSync(a));try{for(i.s();!(o=i.n()).done;){var c=o.value,s=path_1.default.join(a,c);this.protection_directory_set.add(s)}}catch(e){i.e(e)}finally{i.f()}}catch(e){console.error("处理保护目录",n,e)}else this.protection_directory_set.add(n.path)}}catch(e){r.e(e)}finally{r.f()}}catch(e){console.log("保护目录初始化错误",e)}}},{key:"protectionCheck",value:function(e){return this.protection_directory_set.has(e)}}])}();exports.SettingService=SettingService,exports.settingService=new SettingService,config_1.ServerEvent.on("start",(function(e){exports.settingService.init(),exports.settingService.protectionInit()}))},72:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.ShellController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(5101),f=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"open",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.open(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"send",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.send(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.cd(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellLogs(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs_cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.dockerShellLogs_cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecOpen",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellExecOpen(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExec",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l.shellServiceImpl.dockerShellExec(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecCancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l.shellServiceImpl.dockerShellExecCancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.ShellController=f,c.__decorate([(0,s.msg)(u.CmdType.shell_open),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"open",null),c.__decorate([(0,s.msg)(u.CmdType.shell_send),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"send",null),c.__decorate([(0,s.msg)(u.CmdType.shell_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"cancel",null),c.__decorate([(0,s.msg)(u.CmdType.shell_cd),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"cd",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_logs),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellLogs",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_logs_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellLogs_cancel",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec_open),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExecOpen",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExec",null),c.__decorate([(0,s.msg)(u.CmdType.docker_shell_exec_cancel),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],f.prototype,"dockerShellExecCancel",null)},5101:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.shellServiceImpl=t.ShellService=t.sysType=void 0,t.getSys=function(){return"win"===t.sysType?h.SysEnum.win:"linux"===t.sysType?h.SysEnum.linux:void 0},t.getShell=b;var c=r(5584),s=r(4988),u=c.__importDefault(r(857)),l=c.__importDefault(r(6928)),f=r(9005),p=r(9625),h=r(4908),d=r(5317),v=d.spawn;d.exec;t.sysType="win32"===u.default.platform()?"win":"linux";var y="\r";var m=null;function b(){return m||(m=function(){if("win"===t.sysType){if(f.SystemUtil.commandIsExist("pwsh"))return"pwsh.exe";if(f.SystemUtil.commandIsExist("powershell"))return"powershell.exe";if(f.SystemUtil.commandIsExist("cmd"))return"cmd.exe";y="\n"}else{if(f.SystemUtil.commandIsExist("bash"))return"bash";if(f.SystemUtil.commandIsExist("sh"))return"sh"}}()),m}var _=r(2511),g=new Map,E=process.env.PATH,w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"open",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n,a,i,c,u;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:n=e.wss.id,process.env.PATH=E+("win"===t.sysType?";":":")+p.settingService.getEnvPath(),a=e.context,i=_.spawn(b(),[],{name:"xterm-color",cols:a.cols,rows:a.rows,cwd:process.env.HOME,env:process.env,useConpty:void 0}),c=l.default.join(p.settingService.getFileRootPath(a.http_token),null!==a.init_path&&"null"!==a.init_path?a.init_path:""),u="cd '".concat(decodeURIComponent(c),"' ").concat(y),i.write(u),i.onData((function(t){var r=new s.WsData(s.CmdType.shell_getting);r.context=t,e.wss.sendData(r.encode())})),g.set(n,i),e.wss.ws.on("close",(function(){var e=g.get(n);e&&(console.log("意外断开pty"),e.kill(),g.delete(n))}));case 10:case"end":return r.stop()}}),r)})))}},{key:"send",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,(n=g.get(r))?null!==e.context&&"null"!==e.context&&n.write(e.context):((a=new s.WsData(s.CmdType.shell_getting)).context="shell状态错误",e.wss.sendData(a.encode()),e.wss.ws.close());case 3:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){var t=e.wss.id;e.wss.ws.close();var r=g.get(t);r&&(console.log("主动断开pty"),r.kill(),g.delete(t))}},{key:"cd",value:function(e){var t=e.wss.id,r=g.get(t);if(r){var n=l.default.join(p.settingService.getFileRootPath(e.context.http_token),decodeURIComponent(e.context.init_path)),o="cd '".concat(n,"' ").concat(y);r.write(o)}}},{key:"dockerShellLogs",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,n=e.context;try{(a=v("docker",["logs","".concat(n.dockerId),"-f","-n",1e3])).stdout.on("data",(function(t){var r=new s.WsData(s.CmdType.docker_shell_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.stderr.on("data",(function(t){var r=new s.WsData(s.CmdType.docker_shell_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.on("close",(function(t){var n=g.get(r);n&&(console.log("意外断开exec"),n.kill(),g.delete(r)),e.wss.ws.close()})),g.set(r,a),e.wss.ws.on("close",(function(){var t=g.get(r);t&&(console.log("意外断开exec"),t.kill(),g.delete(r)),e.wss.ws.close()}))}catch(t){(i=g.get(r))&&(console.log("意外断开exec"),i.kill(),g.delete(r),e.wss.ws.close())}case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellLogs_cancel",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,e.wss.ws.close(),(n=g.get(r))&&(console.log("主动断开exec"),n.kill(),g.delete(r));case 4:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecOpen",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i,c,u;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,n=e.context,a="",!f.SystemUtil.commandIsExist("docker exec ".concat(n.dockerId," bash"))){t.next=7;break}a="bash",t.next=16;break;case 7:if(!f.SystemUtil.commandIsExist("docker exec ".concat(n.dockerId," sh"))){t.next=11;break}a="sh",t.next=16;break;case 11:return(i=new s.WsData(s.CmdType.docker_shell_exec_getting)).context="容器内不存在任何shell ",e.wss.sendData(i.encode()),e.wss.ws.close(),t.abrupt("return");case 16:c=_.spawn(b(),[],{name:"xterm-color",cols:n.cols,rows:n.rows,cwd:process.env.HOME,useConpty:void 0}),u="docker exec -it ".concat(n.dockerId," ").concat(a," ").concat(y),c.write(u),c.onData((function(t){var r=new s.WsData(s.CmdType.docker_shell_exec_getting);r.context=t,e.wss.sendData(r.encode())})),g.set(r,c),e.wss.ws.on("close",(function(){var e=g.get(r);e&&(console.log("意外断开pty"),e.kill(),g.delete(r))}));case 22:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExec",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.wss.id,(n=g.get(r))?null!==e.context&&"null"!==e.context&&n.write(e.context):((a=new s.WsData(s.CmdType.docker_shell_exec_getting)).context="error",e.wss.sendData(a.encode()),e.wss.ws.close());case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerShellExecCancel",value:function(e){var t=e.wss.id;e.wss.ws.close();var r=g.get(t);r&&(console.log("主动断开pty"),r.kill(),g.delete(t))}}],r&&a(e.prototype,r),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();t.ShellService=w,t.shellServiceImpl=new w},8972:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}var c;Object.defineProperty(t,"__esModule",{value:!0}),t.SSHController=void 0;var s=r(5584),u=r(8411),l=r(4988),f=r(2153),p=r(6387),h=r(9334),d=r(5890),v=r(274),y=s.__importDefault(r(8461)),m=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"start",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.start(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"close",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.close(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"getDir",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.getDir(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"getFileText",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",f.sshService.getFileText(e));case 1:case"end":return t.stop()}}),t)})))}},{key:"updateFileText",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.updateFileText(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"create",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=d.Sucess,t.next=3,f.sshService.create(e);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"deletes",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.deletes(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"move",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.move(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"copy",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.sshService.copy(e);case 2:return t.abrupt("return",(0,d.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"uploadFile",value:function(e,t){return s.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,f.sshService.uploadFile(e,t);case 2:return r.abrupt("return",(0,d.Sucess)("1"));case 3:case"end":return r.stop()}}),r)})))}},{key:"open",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.open(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"send",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.send(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.cancel(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"cd",value:function(e){return s.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f.sshService.cd(e),t.abrupt("return","");case 2:case"end":return t.stop()}}),t)})))}},{key:"save",value:function(e){return v.DataUtil.set(f.navindex_remote_ssh_key,e),(0,d.Sucess)("ok")}},{key:"get",value:function(){var e=v.DataUtil.get(f.navindex_remote_ssh_key);return(0,d.Sucess)(e||[])}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SSHController=m,s.__decorate([(0,h.Post)("/start"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"start",null),s.__decorate([(0,h.Post)("/close"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"close",null),s.__decorate([(0,h.Post)("/get/dir"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"getDir",null),s.__decorate([(0,h.Post)("/get/file/text"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"getFileText",null),s.__decorate([(0,h.Post)("/update/file/text"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"updateFileText",null),s.__decorate([(0,h.Post)("/create"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"create",null),s.__decorate([(0,h.Post)("/delete"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"deletes",null),s.__decorate([(0,h.Post)("/move"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"move",null),s.__decorate([(0,h.Post)("/copy"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[p.SshPojo]),s.__metadata("design:returntype",Promise)],m.prototype,"copy",null),s.__decorate([(0,h.Put)("/"),s.__param(0,(0,h.Ctx)()),s.__param(1,(0,h.UploadedFile)("file")),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Object,"function"==typeof(c=void 0!==y.default&&y.default.File)?c:Object]),s.__metadata("design:returntype",Promise)],m.prototype,"uploadFile",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_open),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"open",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_send),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"send",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_cancel),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"cancel",null),s.__decorate([(0,u.msg)(l.CmdType.remote_shell_cd),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[l.WsData]),s.__metadata("design:returntype",Promise)],m.prototype,"cd",null),s.__decorate([(0,h.Post)("/tag/save"),s.__param(0,(0,h.Body)()),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[Array]),s.__metadata("design:returntype",void 0)],m.prototype,"save",null),s.__decorate([(0,h.Get)("/tag"),s.__metadata("design:type",Function),s.__metadata("design:paramtypes",[]),s.__metadata("design:returntype",void 0)],m.prototype,"get",null),t.SSHController=m=s.__decorate([(0,h.Controller)("/ssh")],m)},2153:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function c(e,t,r){return t=u(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,s()?Reflect.construct(t,r||[],u(e).constructor):t.apply(e,r))}function s(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(s=function(){return!!e})()}function u(e){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},u(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.sshService=t.SshService=t.navindex_remote_ssh_key=void 0;var f=r(5584),p=r(6387),h=r(4988),d=(r(2203).Readable,r(6261)),v=r(3776),y=f.__importDefault(r(6928)),m=f.__importDefault(r(9896)),b=f.__importDefault(r(7075)),_=r(274),g=r(5890),E=r(5453);t.navindex_remote_ssh_key="navindex_remote_ssh_key";var w=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),c(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(t,e),r=t,n=[{key:"start",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return",!0);case 3:return t.next=5,this.connect(e);case 5:return r=t.sent,this.lifeStart(p.SshPojo.getKey(e),r,(function(e){return f.__awaiter(n,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{r[v.sftp_client].end(),r.end()}catch(e){console.log("触发",e)}case 1:case"end":return e.stop()}}),e)})))})),t.abrupt("return",!0);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"close",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.lifeGetData(p.SshPojo.getKey(e))&&this.lifeClose(p.SshPojo.getKey(e)),t.abrupt("return",!0);case 3:case"end":return t.stop()}}),t,this)})))}},{key:"getDir",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return",[]);case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return",this.sftGetDir(e,r));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getFileText",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.next=6,this.sftGetFileStats(e.file,r);case 6:if(!(t.sent.size>20971520)){t.next=9;break}return t.abrupt("return",(0,g.Fail)("超过20MB",E.RCode.File_Max));case 9:return t.t0=g.Sucess,t.next=12,this.sftGetFileText(e,r);case 12:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"updateFileText",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return",this.sftUpdateFileText(e,r));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"create",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:if(!e.dir){t.next=8;break}return t.next=6,this.sftCreateDir(e,r);case 6:t.next=12;break;case 8:if(!e.file){t.next=12;break}return e.context="",t.next=12,this.sftUpdateFileText(e,r);case 12:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 14:case"end":return t.stop()}}),t,this)})))}},{key:"deletes",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:if(!e.dir){t.next=8;break}return t.next=6,this.sftDelteFolder(e.dir,r);case 6:t.next=11;break;case 8:if(!e.file){t.next=11;break}return t.next=11,this.sftDelteFile(e.file,r);case 11:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 13:case"end":return t.stop()}}),t,this)})))}},{key:"move",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return t.next=5,this.sftMoveFile(e.source,e.target,r);case 5:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 7:case"end":return t.stop()}}),t,this)})))}},{key:"copy",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.lifeGetData(p.SshPojo.getKey(e))){t.next=3;break}return t.abrupt("return","");case 3:return t.next=5,this.sftCopyFile(e.source,e.target,r);case 5:return this.lifeHeart(p.SshPojo.getKey(e)),t.abrupt("return");case 7:case"end":return t.stop()}}),t,this)})))}},{key:"open",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,r=e.context,n=e.wss,a=new d,n.dataMap.set("emitter",a),i=this.lifeGetData(p.SshPojo.getKey(r))){t.next=8;break}return t.abrupt("return","");case 8:i.shell((function(t,o){o.setWindow(r.rows,r.cols),o.write("cd '".concat(r.init_path,"' \r")),o.on("data",(function(t){var r=new h.WsData(h.CmdType.remote_shell_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),a.on("data",(function(e){o.write(e)})),n.ws.on("close",(function(){o.end("exit\r")}))})),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.log(t.t0);case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{key:"send",value:function(e){return f.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:try{e.context,r=e.wss,(n=r.dataMap.get("emitter"))&&null!==e.context&&"null"!==e.context&&n.emit("data",e.context)}catch(e){console.log(e)}case 1:case"end":return t.stop()}}),t)})))}},{key:"cancel",value:function(e){var t=e.wss.dataMap.get("emitter");t&&t.emit("data","exit\r")}},{key:"cd",value:function(e){var t=e.wss.dataMap.get("emitter");t&&e.context&&t.emit("data","cd '".concat(e.context,"' \r"))}},{key:"download",value:function(e){var t=e.request.query.file;if(!t||!t.length)return e.status=404,void(e.body="File not found");e.attachment(t),e.set("Content-Type","application/octet-stream");var r=new b.default.PassThrough;e.body=r;var n=this.lifeGetData(p.SshPojo.getKey(e.request.query));if(!n)return e.body="";this.sftGet(n).createReadStream(t).pipe(r)}},{key:"uploadFile",value:function(e,t){var r=this.lifeGetData(p.SshPojo.getKey(e.request.query)),n=this.sftGet(r),o=e.request.query.target,a=_.DataUtil.writeFileSyncTemp(y.default.basename(o),"tempfile",t.buffer),i=m.default.createReadStream(a),c=n.createWriteStream(o);return i.on("data",(function(e){})),new Promise((function(e,t){i.pipe(c),c.on("close",(function(){e(1),i.close(),m.default.unlinkSync(a)})),c.on("error",(function(e){t(e)}))}))}}],n&&a(r.prototype,n),i&&a(r,i),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n,i}(v.SshSsh2);t.SshService=w,t.sshService=new w},3776:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}function u(e,t,r){return t=f(t),function(e,t){if(t&&("object"==n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,r||[],f(e).constructor):t.apply(e,r))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(l=function(){return!!e})()}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},p(e,t)}Object.defineProperty(t,"__esModule",{value:!0}),t.SshSsh2=t.sftp_client=void 0;var h=r(5584),d=r(6387),v=r(8076),y=r(7699),m=r(9643),b=(r(6261),r(6804)),_=h.__importDefault(r(9896));t.sftp_client="sftp_client_key";var g=function(e){function r(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),u(this,r,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&p(e,t)}(r,e),n=r,a=[{key:"connect",value:function(e){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,o=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={host:e.domain,port:e.port,username:e.username,keepaliveInterval:1e4,keepaliveCountMax:10},e.private_path?n.privateKey=_.default.readFileSync(e.private_path):e.password&&(n.password=e.password),r.abrupt("return",new Promise((function(r,a){var c=new b.Client;c.on("ready",(function(){return h.__awaiter(this,void 0,void 0,i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("连接ssh成功"),e.next=3,new Promise((function(e,t){c.sftp((function(t,r){if(t)throw t;e(r)}))}));case 3:n=e.sent,c[t.sftp_client]=n,r(c);case 6:case"end":return e.stop()}}),e)})))})).connect(n).on("error",(function(e){r(!1)})).on("close",(function(){r(!1),console.log("ssh关闭"),o.lifeClose(d.SshPojo.getKey(e));try{c[t.sftp_client].end()}catch(e){console.log(e)}}))})));case 3:case"end":return r.stop()}}),r)})))}},{key:"sftGet",value:function(e){return e[t.sftp_client]}},{key:"sftGetFileStats",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).stat(e,(function(e,t){r(e?null:t)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftGetDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t),i=e.dir,c={files:[],folders:[]};a.readdir(i,(function(e,t){if(e)throw e;t.forEach((function(e){var t,r,n=16384==(61440&e.attrs.mode),o=40960==(61440&e.attrs.mode),a=e.filename,i=(0,y.formatFileSize)(e.attrs.size),s=e.attrs.mtime,u=(0,y.getShortTime)(new Date(s).getTime());n?null===(r=c.folders)||void 0===r||r.push({type:v.FileTypeEnum.folder,name:a,mtime:u,isLink:o}):null===(t=c.files)||void 0===t||t.push({type:v.FileTypeEnum.text,name:a,mtime:u,size:i,isLink:o})})),r(c)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftGetFileText",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t),i="",c=a.createReadStream(e.file);c.on("data",(function(e){i+=e.toString()})),c.on("end",(function(){r(i)})),c.on("error",(function(e){console.error("Error downloading file:",e),r("")}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftUpdateFileText",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){var a=n.sftGet(t).createWriteStream(e.file);a.write(e.context,"utf-8"),a.end(),a.on("close",(function(){console.log("File uploaded successfully"),r(!0)})),a.on("error",(function(e){console.error("Error uploading file:",e),r(!1)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftCreateDir",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).mkdir(e.dir,(function(e){e?console.error("Error creating folder:",e):console.log("Folder created successfully"),r(!0)}))}),3e4));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDelteFile",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n=this;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,o){n.sftGet(t).unlink(e,(function(e){e&&console.error("Error deleting file:",e),r(!0)}))})));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDelteFolder",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.asyncExec((function(r,n){t.exec("rm -r ".concat(e),(function(e,t){if(e)throw e;t.on("close",(function(e,t){r(!0)}))}))})));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"sftDeletes",value:function(e,t){return h.__awaiter(this,void 0,void 0,i().mark((function r(){var n,a,c,s,u,l,f,p,h,d,v;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=[],a=[],r.next=4,this.sftGetDir(e,t);case 4:(c=r.sent)&&(s=c.files,(u=c.folders)&&(a=u.map((function(e){return e.name}))),s&&(n=s.map((function(e){return e.name})))),l=o(n),r.prev=7,l.s();case 9:if((f=l.n()).done){r.next=15;break}return p=f.value,r.next=13,this.sftDelteFile(p,t);case 13:r.next=9;break;case 15:r.next=20;break;case 17:r.prev=17,r.t0=r.catch(7),l.e(r.t0);case 20:return r.prev=20,l.f(),r.finish(20);case 23:h=o(a),r.prev=24,h.s();case 26:if((d=h.n()).done){r.next=32;break}return v=d.value,r.next=30,this.sftDelteFolder(v,t);case 30:r.next=26;break;case 32:r.next=37;break;case 34:r.prev=34,r.t1=r.catch(24),h.e(r.t1);case 37:return r.prev=37,h.f(),r.finish(37);case 40:case"end":return r.stop()}}),r,this,[[7,17,20,23],[24,34,37,40]])})))}},{key:"sftCopyFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.asyncExec((function(n,o){r.exec("cp -r ".concat(e," ").concat(t),(function(e,t){if(e)throw e;t.on("close",(function(e,t){n(!0)}))}))})));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"sftMoveFile",value:function(e,t,r){return h.__awaiter(this,void 0,void 0,i().mark((function n(){return i().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.asyncExec((function(n,o){r.exec("mv ".concat(e," ").concat(t),(function(e,t){if(e)throw e;t.on("close",(function(e,t){n(!0)}))}))})));case 1:case"end":return n.stop()}}),n,this)})))}}],a&&c(n.prototype,a),s&&c(n,s),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,s}(m.LifecycleRecordService);t.SshSsh2=g},6820:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysController=void 0;var c=r(5584),s=r(8411),u=r(4988),l=r(5443),f=r(9334),p=r(6001),h=r(4138),d=r(9546),v=r(5397),y=r(2740),m=r(5890),b=r(6406),_=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"get",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getSysIno());case 1:case"end":return e.stop()}}),e)})))}},{key:"disk",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getDisk());case 1:case"end":return e.stop()}}),e)})))}},{key:"fileDisk",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",p.SyserviceImpl.getFileDisk());case 1:case"end":return e.stop()}}),e)})))}},{key:"sys",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.SysSystemServiceImpl.sys(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"get_all_images",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(v.SysDockerServiceImpl.get_all_images()));case 1:case"end":return e.stop()}}),e)})))}},{key:"delete_image",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.delete_image(e.ids);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"check_image_delete",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,v.SysDockerServiceImpl.check_image_delete(e.ids);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"dockerSwitch",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerSwitch(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"dockerDelContainer",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,v.SysDockerServiceImpl.dockerDelContainer(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"processGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.SysProcessServiceImpl.processGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"processClose",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.SysProcessServiceImpl.processClose(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"systemdInsideGet",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.systemdInsideGet(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"getAllSystemd",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(y.systemd.getAllSystemd()));case 1:case"end":return e.stop()}}),e)})))}},{key:"addAllSystemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.addSystemd(e.unit_name);case 2:return t.abrupt("return",(0,m.Sucess)(y.systemd.getAllInsideSystemd()));case 3:case"end":return t.stop()}}),t)})))}},{key:"getInsideAllSystemd",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(y.systemd.getAllInsideSystemd()));case 1:case"end":return e.stop()}}),e)})))}},{key:"deleteAllSystemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.deleteSystemd(e.unit_name);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}},{key:"get_systemd_context",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,y.systemd.get_systemd_context(e.unit_name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"delte_systemd",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,y.systemd.delete_sys_systemd(e.unit_name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"systemd_logs_get",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y.systemd.systemd_logs_get(e);case 2:return t.abrupt("return","");case 3:case"end":return t.stop()}}),t)})))}},{key:"get_disk_info",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=m.Sucess,t.next=3,h.SysSystemServiceImpl.diskSmartctl(e.name);case 3:return t.t1=t.sent,t.abrupt("return",(0,t.t0)(t.t1));case 5:case"end":return t.stop()}}),t)})))}},{key:"get_lsblk_info",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(h.SysSystemServiceImpl.get_lsblk_info()));case 1:case"end":return e.stop()}}),e)})))}},{key:"get_lvm_info",value:function(){return c.__awaiter(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,m.Sucess)(h.SysSystemServiceImpl.get_lvm_info()));case 1:case"end":return e.stop()}}),e)})))}},{key:"cmd_exe",value:function(e){return c.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.SysSystemServiceImpl.cmd_exe(e);case 2:return t.abrupt("return",(0,m.Sucess)(""));case 3:case"end":return t.stop()}}),t)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysController=_,c.__decorate([(0,f.Get)("/base"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get",null),c.__decorate([(0,f.Get)("/disk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"disk",null),c.__decorate([(0,f.Get)("/filedisk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"fileDisk",null),c.__decorate([(0,s.msg)(u.CmdType.sys_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"sys",null),c.__decorate([(0,s.msg)(u.CmdType.docker_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerGet",null),c.__decorate([(0,f.Get)("/docker/images"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_all_images",null),c.__decorate([(0,f.Post)("/docker/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"delete_image",null),c.__decorate([(0,f.Post)("/docker/check/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"check_image_delete",null),c.__decorate([(0,s.msg)(u.CmdType.docker_switch),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerSwitch",null),c.__decorate([(0,s.msg)(u.CmdType.docker_del_container),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"dockerDelContainer",null),c.__decorate([(0,s.msg)(u.CmdType.process_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"processGet",null),c.__decorate([(0,s.msg)(u.CmdType.process_close),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"processClose",null),c.__decorate([(0,s.msg)(u.CmdType.systemd_inside_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"systemdInsideGet",null),c.__decorate([(0,f.Get)("/systemd/allget"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"getAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/add"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"addAllSystemd",null),c.__decorate([(0,f.Get)("/systemd/inside/all"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"getInsideAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"deleteAllSystemd",null),c.__decorate([(0,f.Post)("/systemd/get/context"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"get_systemd_context",null),c.__decorate([(0,f.Post)("/systemd/sys/delete"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"delte_systemd",null),c.__decorate([(0,s.msg)(u.CmdType.systemd_logs_get),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[u.WsData]),c.__metadata("design:returntype",Promise)],_.prototype,"systemd_logs_get",null),c.__decorate([(0,f.Post)("/sys/disk/info"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[Object]),c.__metadata("design:returntype",Promise)],_.prototype,"get_disk_info",null),c.__decorate([(0,f.Get)("/disk/blk"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_lsblk_info",null),c.__decorate([(0,f.Get)("/disk/lvm"),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[]),c.__metadata("design:returntype",Promise)],_.prototype,"get_lvm_info",null),c.__decorate([(0,f.Post)("/cmd/exe"),c.__param(0,(0,f.Body)()),c.__metadata("design:type",Function),c.__metadata("design:paramtypes",[b.SysCmdExePojo]),c.__metadata("design:returntype",Promise)],_.prototype,"cmd_exe",null),t.SysController=_=c.__decorate([(0,l.Service)(),(0,f.Controller)("/sys")],_)},5397:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||i(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){if(e){if("string"==typeof e)return c(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},c=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,c,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,c)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysDockerServiceImpl=void 0;var f=r(5584),p=r(4988),h=r(5317),d=r(9005),v=r(5101),y=f.__importDefault(r(5086)),m=null,b=null,_=[],g=new Map,E=new Map,w=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"pushDockerInfo",value:function(e,t){return f.__awaiter(this,void 0,void 0,s().mark((function r(){var n;return s().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=new p.WsData(p.CmdType.docker_getting)).context=t,e.ws.readyState!==y.default.CLOSED){r.next=4;break}throw"断开连接";case 4:e.sendData(n.encode());case 5:case"end":return r.stop()}}),r)})))}},{key:"openDockerPush",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r=this;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.getDockerInfo(),t.next=4,this.pushDockerInfo(e,_);case 4:t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(0),E.delete(e.id),t.abrupt("return");case 10:m||(m=setInterval((function(){return f.__awaiter(r,void 0,void 0,s().mark((function e(){var t,r,n,o,i;return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==E.size){e.next=5;break}return clearInterval(m),m=null,this.killDockerSpwn(),e.abrupt("return");case 5:t=E.keys(),r=a(t),e.prev=7,r.s();case 9:if((n=r.n()).done){e.next=24;break}return o=n.value,i=E.get(o),e.prev=12,e.next=15,this.pushDockerInfo(i,_);case 15:e.next=22;break;case 17:e.prev=17,e.t0=e.catch(12),console.log("docker信息推送失败docker",e.t0),E.delete(o),i&&i.ws.close();case 22:e.next=9;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(7),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[7,26,29,32],[12,17]])})))}),1e3));case 11:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"get_all_images",value:function(){var e=[],t=(0,h.execSync)('docker images --format "{{.ID}};;{{.Repository}}:{{.Tag}};;{{.CreatedAt}};;{{.Size}}"');t=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>0}));for(var r=1;r<t.length;r++){var n=t[r].split(";;").filter((function(e){return e.length>0}));e.push([n[0],n[1],n[2],n[3]])}return e}},{key:"getAllContainer",value:function(){var e=_;_=[];var t=(0,h.execSync)('docker ps -a --no-trunc --format "table {{.ID}};;{{.Names}};;{{.Image}};;{{.Command}};;{{.Status}}"');t=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>0}));for(var r=1;r<t.length;r++){var n=t[r].split(";;").filter((function(e){return e.length>0})),o=g.get(n[0]),a=null!=o?e[o]:void 0;_.push([n[0].slice(0,10),n[1],n[2],n[3],n[4],void 0!==a?a[5]:0,void 0!==a?a[6]:0]),g.set(n[0],r-1)}}},{key:"killDockerSpwn",value:function(){b&&(d.SystemUtil.killProcess(b.pid),b=null)}},{key:"getDockerInfo",value:function(){var e=this;try{if(b)return;this.getAllContainer();var t=(0,h.spawn)('docker stats --no-trunc --format "table {{.ID}};;{{.MemUsage}};;{{.CPUPerc}}"',o(_.map((function(e){return e[0]}))),{shell:(0,v.getShell)()});b=t,t.stdout.on("data",(function(t){if(t||t.toString()){for(var r=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>1})),n=1;n<r.length;n++){var o=r[n].split(";;").filter((function(e){return e.length>0}));if(o.length<3)break;var a=g.get(o[0]);if("number"==typeof a){var i=o[1].split("/")[0];_[a][5]=i,_[a][6]=o[2]}}0===E.size&&e.dockerClear()}})),t.stderr.on("data",(function(r){console.error("stderr: ".concat(r)),t.kill(),e.dockerClear()})),t.on("error",(function(t){console.error("Error:",t),e.dockerClear()}))}catch(e){console.log(e),this.dockerClear()}}},{key:"dockerClear",value:function(){m&&(clearInterval(m),m=null),this.killDockerSpwn(),E.clear()}},{key:"dockerGet",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!E.get(r)){t.next=3;break}return t.abrupt("return");case 3:if(d.SystemUtil.commandIsExist(" docker ps")){t.next=6;break}return e.wss.ws.close(),t.abrupt("return");case 6:return E.set(e.wss.id,e.wss),t.next=9,this.openDockerPush(e.wss);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"dockerSwitch",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("start"!==e.context.type){t.next=5;break}return t.next=3,(0,h.exec)("docker start ".concat(e.context.dockerId));case 3:t.next=8;break;case 5:if("stop"!==e.context.type){t.next=8;break}return t.next=8,(0,h.exec)("docker stop ".concat(e.context.dockerId));case 8:this.getAllContainer();case 9:case"end":return t.stop()}}),t,this)})))}},{key:"dockerDelContainer",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,h.exec)("docker stop ".concat(e.context.dockerId));case 2:return t.next=4,(0,h.exec)("docker rm ".concat(e.context.dockerId));case 4:case"end":return t.stop()}}),t)})))}},{key:"check_image_delete",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r,n,o,i;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=[],n=a(e);try{for(n.s();!(o=n.n()).done;)i=o.value,(0,h.execSync)("docker ps -a --filter ancestor=".concat(i,' --format "{{.ID}}"')).toString().trim()&&r.push(i)}catch(e){n.e(e)}finally{n.f()}return t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))}},{key:"delete_image",value:function(e){return f.__awaiter(this,void 0,void 0,s().mark((function t(){var r;return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.join(" "),(0,h.execSync)("docker rm ".concat(r));case 2:case"end":return t.stop()}}),t)})))}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysDockerServiceImpl=new w},9546:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysProcessServiceImpl=t.SysProcessService=void 0;var u=r(5584),l=r(4988),f=r(5101),p=r(9005),h=r(5317),d=r(9044),v=r(4908),y=u.__importDefault(r(5086)),m=null,b=(0,d.getProcessAddon)(),_=[],g=new Map,E=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"winAndLinuxGetProcess",value:function(){var e=this;b.on("process",(function(t){if(Array.isArray(t)){var r,n=[],o=a(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.push([i.id,i.name,i.user_name,i.mem,i.cpu?i.cpu.toFixed(2):0])}}catch(e){o.e(e)}finally{o.f()}_=n,0===g.size&&e.clear()}}),[])}},{key:"linuxGetProcess",value:function(){var e=this,t=(0,h.spawn)("top",["-b"],{env:{COLUMNS:"800"}});b=t,t.stdout.on("data",(function(t){if(t||t.toString()){for(var r=t.toString().split(/\n|\r\n/).filter((function(e){return e.length>5})),n=[],o=1;o<r.length;o++){var a=r[o].split(" ").filter((function(e){return e.length>0}));a[0].includes("PID")||n.push([a[0],a[a.length-1],a[1],1024*a[5],a[8]])}_=n,0===g.size&&e.clear()}})),t.stderr.on("data",(function(r){console.error("stderr: ".concat(r.toString())),t.kill(),e.clear()})),t.on("error",(function(t){console.error("Error:",t),e.clear()})),t.on("close",(function(t){e.clear(),console.log("child process exited with code ".concat(t))}))}},{key:"pushProcessInfo",value:function(e,t){return u.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((n=new l.WsData(l.CmdType.process_getting)).context=t,e.ws.readyState!==y.default.CLOSED){r.next=4;break}throw"断开连接";case 4:e.sendData(n.encode());case 5:case"end":return r.stop()}}),r)})))}},{key:"openProcessPush",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.getProcessInfo(),t.next=4,this.pushProcessInfo(e,_);case 4:t.next=10;break;case 6:return t.prev=6,t.t0=t.catch(0),g.delete(e.id),t.abrupt("return");case 10:m||(m=setInterval((function(){return u.__awaiter(r,void 0,void 0,o().mark((function e(){var t,r,n,i,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==g.size){e.next=5;break}return clearInterval(m),m=null,this.killSpwn(),e.abrupt("return");case 5:t=g.keys(),r=a(t),e.prev=7,r.s();case 9:if((n=r.n()).done){e.next=24;break}return i=n.value,c=g.get(i),e.prev=12,e.next=15,this.pushProcessInfo(c,_);case 15:e.next=22;break;case 17:e.prev=17,e.t0=e.catch(12),console.log(e.t0),console.log("系统信息推送失败进程"),c&&(c.ws.close(),g.delete(i));case 22:e.next=9;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(7),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[7,26,29,32],[12,17]])})))}),1e3));case 11:case"end":return t.stop()}}),t,this,[[0,6]])})))}},{key:"killSpwn",value:function(){var e=(0,f.getSys)();e===v.SysEnum.linux||e==v.SysEnum.win?b.close("process"):(b.kill("SIGTERM"),p.SystemUtil.killProcess(b.pid))}},{key:"getProcessInfo",value:function(){try{var e=(0,f.getSys)();e===v.SysEnum.linux||e==v.SysEnum.win?this.winAndLinuxGetProcess():this.linuxGetProcess()}catch(e){console.log(e),this.clear()}}},{key:"clear",value:function(){m&&(clearInterval(m),m=null),this.killSpwn(),g.clear()}},{key:"processGet",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!g.get(r)){t.next=3;break}return t.abrupt("return");case 3:return g.set(e.wss.id,e.wss),t.next=6,this.openProcessPush(e.wss);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"processClose",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:p.SystemUtil.killProcess(e.context.pid);case 1:case"end":return t.stop()}}),t)})))}}],t&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysProcessService=E,t.SysProcessServiceImpl=new E},6001:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,i=Object.create(o.prototype),c=new I(n||[]);return a(i,"_invoke",{value:O(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,a(k,"constructor",{value:E,configurable:!0}),a(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SyserviceImpl=t.SysService=void 0;var u=r(5584),l=u.__importDefault(r(333)),f=u.__importDefault(r(857)),p=r(5890),h=r(6406),d=r(7699),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getSysIno",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.cpu();case 2:return t=e.sent,r=f.default.totalmem(),e.abrupt("return",(0,p.Sucess)({mem_total:(r/1073741824).toFixed(2),cpu_manufacturer:t.manufacturer,cpu_brand:t.brand,cpu_core_num:t.cores,cpu_phy_core_num:t.physicalCores,cpu_speed_hz:t.speedMax}));case 5:case"end":return e.stop()}}),e)})))}},{key:"getDisk",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.diskLayout();case 2:t=e.sent,r=[],n=o(null!=t?t:[]);try{for(n.s();!(a=n.n()).done;)c=a.value,(s=new h.DiskDevicePojo).name=c.device,s.typeName=c.name,s.total=(0,d.formatFileSize)(c.size),c.type&&(c.type.includes("SD")?s.type="固态":s.type="机械"),r.push(s)}catch(e){n.e(e)}finally{n.f()}return e.abrupt("return",(0,p.Sucess)(r));case 7:case"end":return e.stop()}}),e)})))}},{key:"getFileDisk",value:function(){return u.__awaiter(this,void 0,void 0,i().mark((function e(){var t,r,n,a,c,s,u,f,v,y,m,b;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.default.fsSize();case 2:return t=e.sent,e.next=5,l.default.blockDevices();case 5:r=e.sent,n=new Map,a=o(null!=t?t:[]);try{for(a.s();!(c=a.n()).done;)s=c.value,n.set(s.mount,s)}catch(e){a.e(e)}finally{a.f()}u=[],f=o(null!=r?r:[]);try{for(f.s();!(v=f.n()).done;)y=v.value,m=new h.DiskFilePojo,b=n.get(y.mount),m.name=y.name,m.fsType=y.fsType,m.mount=y.mount,m.device_name=y.device,b&&(m.total=(0,d.formatFileSize)(b.size),m.available=(0,d.formatFileSize)(b.available)),u.push(m),n.delete(y.mount)}catch(e){f.e(e)}finally{f.f()}return n.size>0&&n.forEach((function(e){var t=new h.DiskFilePojo;t.name=e.fs,t.fsType=e.type,t.mount=e.mount,t.total=(0,d.formatFileSize)(e.size),t.available=(0,d.formatFileSize)(e.available),u.push(t)})),e.abrupt("return",(0,p.Sucess)(u));case 14:case"end":return e.stop()}}),e)})))}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysService=v,t.SyserviceImpl=new v},4138:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){s=!0,a=e},f:function(){try{c||null==r.return||r.return()}finally{if(s)throw a}}}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SysSystemServiceImpl=void 0;var u=r(5584),l=r(4988),f=u.__importDefault(r(333)),p=u.__importDefault(r(857)),h=u.__importDefault(r(5086)),d=(r(9896),r(6406)),v=r(5317),y=r(9044),m=r(9426),b=null,_=new Map,g=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"openSysPush",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r=this;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(b){t.next=4;break}b=setInterval((function(){return u.__awaiter(r,void 0,void 0,o().mark((function e(){var t,r,n,i,c;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==_.size){e.next=4;break}return clearInterval(b),b=null,e.abrupt("return");case 4:t=_.keys(),r=a(t),e.prev=6,r.s();case 8:if((n=r.n()).done){e.next=24;break}return i=n.value,c=_.get(i),e.prev=11,e.next=14,this.pushSysInfo(c);case 14:e.next=22;break;case 16:e.prev=16,e.t0=e.catch(11),console.log("系统信息推送失败sys,原因:",e.t0),clearInterval(b),b=null,c&&_.delete(i);case 22:e.next=8;break;case 24:e.next=29;break;case 26:e.prev=26,e.t1=e.catch(6),r.e(e.t1);case 29:return e.prev=29,r.f(),e.finish(29);case 32:case"end":return e.stop()}}),e,this,[[6,26,29,32],[11,16]])})))}),1e3),t.next=12;break;case 4:return t.prev=4,t.next=7,this.pushSysInfo(e);case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),_.delete(e.id);case 12:case"end":return t.stop()}}),t,this,[[4,9]])})))}},{key:"pushSysInfo",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,a,i;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.default.currentLoad();case 2:if(r=t.sent,n=p.default.totalmem(),a=p.default.freemem(),(i=new l.WsData(l.CmdType.sys_getting)).context={memTotal:(n/1073741824).toFixed(2),memLeft:(a/1073741824).toFixed(2),cpu_currentLoad:r.currentLoad.toFixed(2)},e.ws.readyState!==h.default.CLOSED){t.next=9;break}throw"断开连接";case 9:e.sendData(i.encode());case 10:case"end":return t.stop()}}),t)})))}},{key:"sys",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.wss.id,!_.get(r)){t.next=3;break}return t.abrupt("return");case 3:return _.set(e.wss.id,e.wss),t.next=6,this.openSysPush(e.wss);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"diskSmartctl",value:function(e){return u.__awaiter(this,void 0,void 0,o().mark((function t(){var r,n,i,c,s,u,l;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new d.DiskCheckInfo,t.prev=1,i=(0,v.execSync)("".concat((0,y.getSmartctl)()," -a --json ").concat(e)).toString(),n=JSON.parse(i),t.next=13;break;case 6:if(t.prev=6,t.t0=t.catch(1),4!==t.t0.status){t.next=12;break}n=JSON.parse(t.t0.stdout),t.next=13;break;case 12:throw t.t0;case 13:if(r.model_name=n.model_name,r.serial_number=n.serial_number,r.firmware_version=n.firmware_version,r.rotation_rate=n.rotation_rate,n.smart_status&&(r.smart_status=n.smart_status.passed),r.power_cycle_count=n.power_cycle_count,n.power_on_time&&(r.power_on_time_hours=n.power_on_time.hours),n.temperature&&(r.temperature=n.temperature.current),n.device&&(r.device_protocol=n.device.protocol),n.ata_smart_attributes&&n.ata_smart_attributes.table){c=[],s=a(n.ata_smart_attributes.table);try{for(s.s();!(u=s.n()).done;)l=u.value,c.push([l.name,l.value,l.worst,l.thresh])}catch(e){s.e(e)}finally{s.f()}r.ata_smart_attributes=c}return t.abrupt("return",r);case 24:case"end":return t.stop()}}),t,null,[[1,6]])})))}},{key:"get_lsblk_info",value:function(){var e,t,r=(0,v.execSync)(" lsblk --output-all --json").toString(),n=[],o=a(null!==(e=JSON.parse(r).blockdevices)&&void 0!==e?e:[]);try{for(o.s();!(t=o.n()).done;){var i=t.value;"disk"===i.type&&n.push(i)}}catch(e){o.e(e)}finally{o.f()}return n}},{key:"get_lvm_info",value:function(){var e,t=[],r=a(JSON.parse((0,v.execSync)(" vgs --reportformat json").toString()).report[0].vg);try{for(r.s();!(e=r.n()).done;){var n=e.value,o=new m.vg_item;o.name=n.vg_name,o.size=n.vg_size,o.lv_count=n.lv_count,o.pv_cout=n.pv_count,o.free_size=n.vg_free;var i,c=JSON.parse((0,v.execSync)("pvs --select vg_name=".concat(n.vg_name," --reportformat json")).toString()).report[0].pv,s=a(null!=c?c:[]);try{for(s.s();!(i=s.n()).done;){var u=i.value;o.pv_list.push({name:u.pv_name,free_size:u.pv_free,size:u.pv_size})}}catch(e){s.e(e)}finally{s.f()}var l,f=JSON.parse((0,v.execSync)("lvs --select vg_name=".concat(n.vg_name," --reportformat json")).toString()).report[0].lv,p=a(null!=f?f:[]);try{for(p.s();!(l=p.n()).done;){var h=l.value;o.lv_list.push({name:h.lv_name,size:h.lv_size})}}catch(e){p.e(e)}finally{p.f()}t.push(o)}}catch(e){r.e(e)}finally{r.f()}return t}},{key:"cmd_exe",value:function(e){e.type===d.SysCmd.mount&&(0,v.execSync)("sudo mount -a")}}])&&c(e.prototype,t),r&&c(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysSystemServiceImpl=new g},2740:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */a=function(){return t};var e,t={},r=Object.prototype,o=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&o.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(a,i,c,s){var u=h(e[a],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return a=a?a.then(o,o):o()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,i=function r(){for(;++a<t.length;)if(o.call(t,a))return r.value=t[a],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function l(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.systemd=t.SysSystemdService=void 0;var f=r(5584),p=r(4988),h=r(274),d=r(9044),v=r(8932),y=f.__importDefault(r(9896)),m=r(5317),b=m.spawn,_=m.execSync,g=f.__importDefault(r(5086)),E="systemd_key",w=(0,d.getProcessAddon)(),P=new Set,S=null,k=[],A="",T=new Map,O=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t=[{key:"getAllSystemd",value:function(){var e=_("systemctl list-units --type=service --output=json").toString();return JSON.parse(e)}},{key:"getAllInsideSystemd",value:function(){var e;return null!==(e=h.DataUtil.get(E))&&void 0!==e?e:[]}},{key:"addSystemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[],o=i(n),t.prev=2,o.s();case 4:if((c=o.n()).done){t.next=10;break}if(c.value!==e){t.next=8;break}return t.abrupt("return");case 8:t.next=4;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(2),o.e(t.t0);case 15:return t.prev=15,o.f(),t.finish(15);case 18:n.push(e),h.DataUtil.set(E,n),A=n.join(" "),this.getSytemdPids(n).then((function(e){var t=e.pids,r=e.pid_name_map;T=r,w.pids("systemd",t)})).catch((function(e){console.log(e)}));case 22:case"end":return t.stop()}}),t,this,[[2,12,15,18]])})))}},{key:"deleteSystemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[],(0,v.deleteList)(n,(function(t){return t===e})),h.DataUtil.set(E,n),A=n.join(" "),this.getSytemdPids(n).then((function(e){var t=e.pids,r=e.pid_name_map;T=r,w.pids("systemd",t)})).catch((function(e){console.log(e)}));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"getSytemdPids",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=new Map,n=[],o=[],c=e.map((function(e){return(e=e.trim()).endsWith(".service")?e:e+".service"})).join("|"),_("systemctl list-units --type=service | grep -E '".concat(c,"'")).toString().split("\n").filter((function(e){return e})).forEach((function(t){for(var a,c=t.split(/\s+/),s=0;s<c.length&&!(s>1);s++){var u,l=c[s],f=i(e);try{for(f.s();!(u=f.n()).done;){var p=u.value;if(l.includes(p)){a=l;break}}}catch(e){f.e(e)}finally{f.f()}if(a)break}if(a){var h=_("systemctl show ".concat(a," --property=MainPID")).toString().split("=")[1].trim();if(h&&"0"!==h){var d=parseInt(h);o.push(d),r.set(d,a)}else n.push(a)}})),t.abrupt("return",{pids:o,pid_name_map:r,not_pid_names:n});case 8:case"end":return t.stop()}}),t)})))}},{key:"clear",value:function(){w.close("systemd"),S&&(clearInterval(S),S=null),P.clear()}},{key:"systemdGet",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o,c,s,u,l=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(P.add(e.wss),!S){t.next=3;break}return t.abrupt("return");case 3:if(0!==(n=null!==(r=h.DataUtil.get(E))&&void 0!==r?r:[]).length){t.next=6;break}return t.abrupt("return");case 6:return A=n.join(" "),t.next=9,this.getSytemdPids(n);case 9:o=t.sent,c=o.pids,s=o.pid_name_map,u=o.not_pid_names,T=s,w.on("systemd",(function(e){if(Array.isArray(e)){var t,r=[],n=i(e);try{for(n.s();!(t=n.n()).done;){var o=t.value;r.push([o.id,T.get(o.id),o.name,o.user_name,o.mem,o.cpu?o.cpu.toFixed(2):0])}}catch(e){n.e(e)}finally{n.f()}var a,c=i(u);try{for(c.s();!(a=c.n()).done;){var s=a.value;r.push([0,s,"","",0,0])}}catch(e){c.e(e)}finally{c.f()}k=r,0===P.size&&l.clear()}}),c);case 15:case"end":return t.stop()}}),t,this)})))}},{key:"pushInfo",value:function(e,t,r){return f.__awaiter(this,void 0,void 0,a().mark((function n(){var i,c;return a().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=[],t.forEach((function(e,t){if(r[t]){var n=o(e),a=r[t].trim();n.push(a),i.push(n)}})),(c=new p.WsData(p.CmdType.systemd_inside_getting)).context=i,e.ws.readyState!==g.default.CLOSED){n.next=6;break}throw"断开连接";case 6:e.sendData(c.encode());case 7:case"end":return n.stop()}}),n)})))}},{key:"systemdInsideGet",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.systemdGet(e);case 2:if(A){t.next=4;break}return t.abrupt("return");case 4:S||(S=setInterval((function(){return f.__awaiter(r,void 0,void 0,a().mark((function e(){var t,r,n,o,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==P.size){e.next=5;break}return clearInterval(S),S=null,this.clear(),e.abrupt("return");case 5:t=_("systemctl is-active ".concat(A)).toString(),r=t.trim().split("\n"),n=i(P.values()),e.prev=8,n.s();case 10:if((o=n.n()).done){e.next=23;break}return c=o.value,e.prev=12,e.next=15,this.pushInfo(c,k,r);case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(12),console.log("systemd推送失败systemd",e.t0),c&&(c.ws.close(),P.delete(c));case 21:e.next=10;break;case 23:e.next=28;break;case 25:e.prev=25,e.t1=e.catch(8),n.e(e.t1);case 28:return e.prev=28,n.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,this,[[8,25,28,31],[12,17]])})))}),1e3));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"get_systemd_context",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_("systemctl show ".concat(e," --property=FragmentPath")).toString(),n=r.split("=")[1].replaceAll("\n",""),o=y.default.readFileSync(n),t.abrupt("return",{context:o.toString(),path:n});case 4:case"end":return t.stop()}}),t)})))}},{key:"delete_sys_systemd",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=_("systemctl show ".concat(e," --property=FragmentPath")).toString(),n=r.split("=")[1].replaceAll("\n",""),_("sudo systemctl stop ".concat(e)),_("sudo systemctl disable ".concat(e)),_("sudo rm ".concat(n)),_("sudo systemctl daemon-reload"),_("sudo systemctl reset-failed"),t.next=9,this.deleteSystemd(e);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"systemd_logs_get",value:function(e){return f.__awaiter(this,void 0,void 0,a().mark((function t(){var r,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e.context;try{(n=b("journalctl",["-u","".concat(r.unit_name),"-f","-n",1e3])).stdout.on("data",(function(t){var r=new p.WsData(p.CmdType.systemd_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),n.stderr.on("data",(function(t){var r=new p.WsData(p.CmdType.systemd_logs_getting);r.context=t.toString(),e.wss.sendData(r.encode())})),n.on("close",(function(t){n&&(console.log("意外断开exec systemd"),n.kill()),e.wss.ws.close()})),e.wss.ws.on("close",(function(){n&&(console.log("意外断开exec systemd"),n.kill()),e.wss.ws.close()}))}catch(t){n&&(console.log("意外断开exec systemd"),n.kill(),e.wss.ws.close())}case 2:case"end":return t.stop()}}),t)})))}}],t&&u(e.prototype,t),r&&u(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.SysSystemdService=O,t.systemd=new O},9005:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.SystemUtil=void 0;var i=r(5317),c=r(5101),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return t=e,n=[{key:"commandIsExist",value:function(e){try{return(0,i.execSync)(e,{stdio:"pipe"}),!0}catch(e){return!1}}},{key:"killProcess",value:function(t){"win"===c.sysType?e.commandIsExist("taskkill /pid ".concat(t," /f /t")):e.commandIsExist("kill -9 ".concat(t," "))}}],(r=null)&&o(t.prototype,r),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,r,n}();t.SystemUtil=s},788:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.UserController=void 0;var i=r(5584),c=r(9334),s=r(4908),u=r(5890),l=r(285),f=r(5443),p=r(4321),h=r(274),d=r(7285),v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"login",value:function(e){var t=h.DataUtil.get("username");if(p.Env.username){if(e.username==="".concat(p.Env.username)&&e.password==="".concat(p.Env.password)){var r=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(r)),(0,u.Sucess)(r)}}else if(t){var n=h.DataUtil.get("password");if(e.username==="".concat(t)&&e.password==="".concat(n)){var o=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(o)),(0,u.Sucess)(o)}}else if("admin"===e.username&&"admin"===e.password){var a=(0,d.generateSaltyUUID)();return l.Cache.setToken("".concat(a)),(0,u.Sucess)(a)}return(0,u.AuthFail)("密码错误")}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.UserController=v,i.__decorate([(0,c.Post)("/login"),i.__param(0,(0,c.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[s.UserLogin]),i.__metadata("design:returntype",void 0)],v.prototype,"login",null),t.UserController=v=i.__decorate([(0,f.Service)(),(0,c.Controller)("/user")],v)},9116:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.VideoController=void 0;var i=r(5584),c=r(8411),s=r(4988),u=i.__importDefault(r(5086)),l=r(3017),f=r(9334),p=r(274),h=r(5890),d="navindex_video_tag_key",v=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRtsp",value:function(e,t){l.videoService.getRtsp(decodeURIComponent(t.url),e)}},{key:"save",value:function(e){return p.DataUtil.set(d,e),(0,h.Sucess)("ok")}},{key:"get",value:function(){var e=p.DataUtil.get(d);return(0,h.Sucess)(e||[])}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.VideoController=v,i.__decorate([(0,c.otherMsg)(s.CmdType.rtsp_get),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[u.default,Object]),i.__metadata("design:returntype",void 0)],v.prototype,"getRtsp",null),i.__decorate([(0,f.Post)("/tag/save"),i.__param(0,(0,f.Body)()),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[Array]),i.__metadata("design:returntype",void 0)],v.prototype,"save",null),i.__decorate([(0,f.Get)("/tag"),i.__metadata("design:type",Function),i.__metadata("design:paramtypes",[]),i.__metadata("design:returntype",void 0)],v.prototype,"get",null),t.VideoController=v=i.__decorate([(0,f.Controller)("/video")],v)},3017:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.videoService=t.VideoService=void 0;var i=r(5584),c=i.__importDefault(r(7075)),s=i.__importDefault(r(5086)),u=r(9044),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"getRtsp",value:function(e,t){var r=new c.default.PassThrough,n=(0,u.getFfmpeg)()(e).inputOptions("-rtsp_transport","tcp").outputFormat("flv").videoCodec("copy").videoCodec("libx264").audioCodec("aac").on("start",(function(e){console.log("Spawned FFmpeg with command: "+e)})).on("error",(function(r){console.error("rtsp错误 ",e,r.message),t.close()})).on("end",(function(){console.error("rtsp结束",e),t.close()})).pipe(r);r.on("data",(function(e){t.readyState===s.default.OPEN?t.send(e):n.end()})),t.on("close",(function(){n.end()}))}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.VideoService=l,t.videoService=new l},5890:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Sucess=function(e){return{code:arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.RCode.Sucess,data:e}},t.Fail=function(e){return{code:arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.RCode.Fail,message:e}},t.AuthFail=function(e){return{code:n.RCode.AuthFail,message:e}};var n=r(5453)},285:(e,t)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function o(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.Cache=void 0;var a=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},r=[{key:"setToken",value:function(e){var t=this;this.token.set(e,{}),this.ignore_check||this.timerMap.set(e,setTimeout((function(){t.token.delete(e),t.timerMap.delete(e)}),36e5))}},{key:"updateTimer",value:function(e){var t=this;if(!this.ignore_update){var r=this.timerMap.get(e);r&&(clearTimeout(r),this.timerMap.set(e,setTimeout((function(){t.token.delete(e),t.timerMap.delete(e)}),36e5)))}}},{key:"getTokenMap",value:function(){return this.token}},{key:"getTokenTimerMap",value:function(){return this.timerMap}},{key:"setIgnore",value:function(e){this.ignore_update=e}},{key:"setIgnoreCheck",value:function(e){this.ignore_check=e}},{key:"clearTokenTimerMap",value:function(){this.timerMap.forEach((function(e){return clearTimeout(e)})),this.timerMap.clear()}},{key:"clear",value:function(){this.timerMap.clear(),this.token.clear()}},{key:"check",value:function(e){return this.token.has(e)}}],(t=null)&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.Cache=a,a.token=new Map,a.timerMap=new Map,a.ignore_update=!1,a.ignore_check=!1},3129:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerEvent=void 0;var n=r(6261);t.ServerEvent=new n},1132:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.AuthMiddleware=void 0;var c=r(5584),s=r(9334),u=r(5890),l=r(7127),f=r(9625),p=r(2153),h=/^(?!.*\/api).*$/,d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){var n;return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.url.startsWith("/download")){r.next=3;break}return l.FileServiceImpl.download(e),r.abrupt("return");case 3:if(!e.url.startsWith("/ssh/download")){r.next=6;break}return p.sshService.download(e),r.abrupt("return");case 6:return r.next=8,f.settingService.intercept(e);case 8:if(!r.sent){r.next=10;break}return r.abrupt("return");case 10:if(-1===e.url.indexOf("/api/user/login")&&!h.test(e.url)){r.next=12;break}return r.abrupt("return",t());case 12:return n=e.headers.authorization,r.next=15,f.settingService.check(n);case 15:if(!r.sent){r.next=17;break}return r.abrupt("return",t());case 17:e.body=(0,u.AuthFail)("失败");case 18:case"end":return r.stop()}}),r)})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.AuthMiddleware=d,t.AuthMiddleware=d=c.__decorate([(0,s.Middleware)({type:"before"})],d)},5515:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var e,t={},r=Object.prototype,a=r.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==r&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,c,s){var u=h(e[o],e,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,c,s)}),(function(e){r("throw",e,c,s)})):t.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return r("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,n){function a(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(a,a):a()}})}function O(t,r,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(t,r,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,L(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var r=t[s];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o<t.length;)if(a.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=e,r.done=!0,r};return i.next=i}}throw new TypeError(n(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),t.AsyncIterator=T,t.async=function(e,r,n,o,a){void 0===a&&(a=Promise);var i=new T(p(e,r,n,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=H,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,o){return c.type="throw",c.arg=t,r.next=n,o&&(r.method="next",r.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:H(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},t}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.GlobalErrorHandler=void 0;var c=r(5584),s=r(9334),u=r(5890),l=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return c.__awaiter(this,void 0,void 0,o().mark((function r(){return o().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t();case 3:r.next=9;break;case 5:r.prev=5,r.t0=r.catch(0),console.log("全局异常拦截",r.t0),e.body=JSON.stringify((0,u.Fail)(JSON.stringify(r.t0)));case 9:case"end":return r.stop()}}),r,null,[[0,5]])})))}}])&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.GlobalErrorHandler=l,t.GlobalErrorHandler=l=c.__decorate([(0,s.Middleware)({type:"after"})],l)},2426:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==n(t)?t:t+""}Object.defineProperty(t,"__esModule",{value:!0}),t.CheckTokenMiddleware=void 0;var i=r(5584),c=r(9334),s=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},(t=[{key:"use",value:function(e,t){return t()}}])&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r}();t.CheckTokenMiddleware=s,t.CheckTokenMiddleware=s=i.__decorate([(0,c.Middleware)({type:"after"})],s)},2511:e=>{"use strict";e.exports=require("@homebridge/node-pty-prebuilt-multiarch")},5695:e=>{"use strict";e.exports=require("@koa/cors")},2710:e=>{"use strict";e.exports=require("@xiaobaidadada/node-tuntap2-wintun")},7172:e=>{"use strict";e.exports=require("archiver")},1158:e=>{"use strict";e.exports=require("buffer")},6261:e=>{"use strict";e.exports=require("events")},1856:e=>{"use strict";e.exports=require("fluent-ffmpeg")},4652:e=>{"use strict";e.exports=require("fs-extra")},3688:e=>{"use strict";e.exports=require("https-proxy-agent")},6101:e=>{"use strict";e.exports=require("koa")},3152:e=>{"use strict";e.exports=require("koa-proxies")},904:e=>{"use strict";e.exports=require("mime-types")},8461:e=>{"use strict";e.exports=require("multer")},9551:e=>{"use strict";e.exports=require("needle")},2470:e=>{"use strict";e.exports=require("node-forge")},4505:e=>{"use strict";e.exports=require("node-process-watcher")},1231:e=>{"use strict";e.exports=require("node-unrar-js")},6384:e=>{"use strict";e.exports=require("protobufjs/minimal")},1321:e=>{"use strict";e.exports=require("reflect-metadata")},9485:e=>{"use strict";e.exports=require("rimraf")},9334:e=>{"use strict";e.exports=require("routing-controllers")},8474:e=>{"use strict";e.exports=require("serialize-javascript")},3211:e=>{"use strict";e.exports=require("socket.io-parser")},6804:e=>{"use strict";e.exports=require("ssh2")},6011:e=>{"use strict";e.exports=require("sshpk")},333:e=>{"use strict";e.exports=require("systeminformation")},6819:e=>{"use strict";e.exports=require("tar")},7989:e=>{"use strict";e.exports=require("tencentcloud-sdk-nodejs")},2953:e=>{"use strict";e.exports=require("tldts")},5584:e=>{"use strict";e.exports=require("tslib")},5443:e=>{"use strict";e.exports=require("typedi")},2029:e=>{"use strict";e.exports=require("unzipper")},5086:e=>{"use strict";e.exports=require("ws")},5317:e=>{"use strict";e.exports=require("child_process")},6982:e=>{"use strict";e.exports=require("crypto")},7194:e=>{"use strict";e.exports=require("dgram")},9896:e=>{"use strict";e.exports=require("fs")},9278:e=>{"use strict";e.exports=require("net")},8995:e=>{"use strict";e.exports=require("node:module")},7075:e=>{"use strict";e.exports=require("node:stream")},857:e=>{"use strict";e.exports=require("os")},6928:e=>{"use strict";e.exports=require("path")},3480:e=>{"use strict";e.exports=require("querystring")},3785:e=>{"use strict";e.exports=require("readline")},2203:e=>{"use strict";e.exports=require("stream")},4756:e=>{"use strict";e.exports=require("tls")},7016:e=>{"use strict";e.exports=require("url")},9023:e=>{"use strict";e.exports=require("util")},3106:e=>{"use strict";e.exports=require("zlib")}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.amdO={},__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},s=c.iterator||"@@iterator",u=c.asyncIterator||"@@asyncIterator",l=c.toStringTag||"@@toStringTag";function f(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(r){f=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof _?t:_,a=Object.create(o.prototype),c=new I(n||[]);return i(a,"_invoke",{value:O(e,r,c)}),a}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=p;var d="suspendedStart",v="suspendedYield",y="executing",m="completed",b={};function _(){}function g(){}function E(){}var w={};f(w,s,(function(){return this}));var P=Object.getPrototypeOf,S=P&&P(P(H([])));S&&S!==o&&a.call(S,s)&&(w=S);var k=E.prototype=_.prototype=Object.create(w);function A(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function T(t,r){function n(o,i,c,s){var u=h(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==e(f)&&a.call(f,"__await")?r.resolve(f.__await).then((function(e){n("next",e,c,s)}),(function(e){n("throw",e,c,s)})):r.resolve(f).then((function(e){l.value=e,c(l)}),(function(e){return n("throw",e,c,s)}))}s(u.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function O(e,t,n){var o=d;return function(a,i){if(o===y)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var s=L(c,n);if(s){if(s===b)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var u=h(e,t,n);if("normal"===u.type){if(o=n.done?m:v,u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,L(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=h(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,b;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,b):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function I(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function H(t){if(t||""===t){var n=t[s];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(a.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=r,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return g.prototype=E,i(k,"constructor",{value:E,configurable:!0}),i(E,"constructor",{value:g,configurable:!0}),g.displayName=f(E,l,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},n.awrap=function(e){return{__await:e}},A(T.prototype),f(T.prototype,u,(function(){return this})),n.AsyncIterator=T,n.async=function(e,t,r,o,a){void 0===a&&(a=Promise);var i=new T(p(e,t,r,o),a);return n.isGeneratorFunction(t)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},A(k),f(k,l,"Generator"),f(k,s,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},n.values=H,I.prototype={constructor:I,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(x),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return c.type="throw",c.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),u=a.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),b},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),x(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;x(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:H(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),b}},n}var r=__webpack_require__(5584);__webpack_require__(1321);var n=__webpack_require__(9334),o=__webpack_require__(1631),a=__webpack_require__(788),i=__webpack_require__(6820),c=__webpack_require__(72),s=__webpack_require__(6182),u=__webpack_require__(1132),l=__webpack_require__(5515),f=__webpack_require__(2426),p=r.__importDefault(__webpack_require__(6928)),h=r.__importDefault(__webpack_require__(9896)),d=__webpack_require__(5740),v=__webpack_require__(1076),y=(r.__importDefault(__webpack_require__(3152)),__webpack_require__(3468)),m=__webpack_require__(4321),b=__webpack_require__(828),_=__webpack_require__(8972),g=__webpack_require__(2992),E=__webpack_require__(3129),w=__webpack_require__(9116),P=__webpack_require__(8239),S=__webpack_require__(7285),k=__webpack_require__(1668),A=__webpack_require__(5086);!function(){r.__awaiter(this,void 0,void 0,t().mark((function e(){var T,O,L,C,x,I,H=this;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,m.Env.parseArgs();case 2:for(T=(0,n.createKoaServer)({cors:!0,routePrefix:"/api",classTransformer:!0,controllers:[a.UserController,i.SysController,c.ShellController,s.FileController,d.DdnsController,v.NetController,y.NavindexController,b.SettingController,_.SSHController,g.RdpController,w.VideoController,k.CryptoController],middlewares:[u.AuthMiddleware,l.GlobalErrorHandler,f.CheckTokenMiddleware]}),O=new A.Server({noServer:!0}),new o.WsServer(O).start(),L=new Set,C=0,x=Object.values(P.routerConfig);C<x.length;C++)I=x[C],L.add("/".concat(I)),L.add("".concat(I));T.use((function(e,n){return r.__awaiter(H,void 0,void 0,t().mark((function r(){var o;return t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.url.includes("/api/")){t.next=3;break}return n(),t.abrupt("return");case 3:if(t.prev=3,!L.has((0,S.getWebFirstKey)(e.url))){t.next=6;break}throw"";case 6:e.url.includes("excalidraw-assets")?(e.url=e.url.slice(1),o=p.default.join(__dirname,"dist",e.url)):o=p.default.join(__dirname,"dist",p.default.basename(e.url)),h.default.accessSync(o,h.default.constants.F_OK),e.body=h.default.createReadStream(o),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(3),e.type="html",e.body=h.default.createReadStream(p.default.join(__dirname,"dist","index.html"));case 15:case"end":return t.stop()}}),r,null,[[3,11]])})))})),T.listen(m.Env.port,(function(){var e="http://localhost:".concat(m.Env.port,"/");console.log("服务器正在运行 click ]8;;".concat(e,"\\").concat(e,"]8;;\\"))})).on("upgrade",(function(e,t,r){O.handleUpgrade(e,t,r,(function(t){O.emit("connection",t,e)}))})),E.ServerEvent.emit("start"),process.on("uncaughtException",(function(e){console.error("未捕获的异常:",e)}));case 10:case"end":return e.stop()}}),e)})))}()})()})();