webpackJsonp([4],{"+HRN":function(t,e,n){"use strict";var r=n("kkc6").Buffer,i=n(2);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,i=a,e.copy(n,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},"+Skr":function(t,e,n){"use strict";var r=n("r+oh"),i=n("h+QR"),o=Math.max;t.exports=function(t,e){var n,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(r){try{t[r]=e[r]}catch(t){n||(n=t)}},s=1;s=55296&&_<=56319&&(S+=t[++n]),S=k?f.call(k,E,S,b):S,e?(p.value=S,d(g,b,p)):g[b]=S,++b;y=b}if(void 0===y)for(y=s(t.length),e&&(g=new e(y)),n=0;n-1?setImmediate:i.nextTick;y.WritableState=g;var u=Object.create(n("jOgh"));u.inherits=n("LC74");var c={deprecate:n("iP15")},l=n("L5oL"),h=n("wAG3").Buffer,f=r.Uint8Array||function(){};var p,d=n("s5W+");function b(){}function g(t,e){s=s||n("WXiP"),t=t||{};var r=e instanceof s;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var u=t.highWaterMark,c=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,o=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,o){--e.pendingcb,n?(i.nextTick(o,r),i.nextTick(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(o(r),t._writableState.errorEmitted=!0,t.emit("error",r),k(t,e))}(t,n,r,e,o);else{var s=w(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||v(t,n),r?a(m,t,n,s,o):m(t,n,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(t){if(s=s||n("WXiP"),!(p.call(y,this)||this instanceof s))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function _(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function m(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),k(t,e)}function v(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),s=e.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)i[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;i.allBuffers=u,_(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(_(t,e,!1,e.objectMode?1:c.length,c,l,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function w(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var n=w(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,i.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}u.inherits(y,l),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===y&&(t&&t._writableState instanceof g)}})):p=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=t,h.isBuffer(r)||r instanceof f);return a&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=b),o.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),i.nextTick(e,n)}(this,n):(a||function(t,e,n,r){var o=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(r,s),o=!1),o}(this,o,t,n))&&(o.pendingcb++,s=function(t,e,n,r,i,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n));return e}(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,k(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=d.destroy,y.prototype._undestroy=d.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n("W2nU"),n("DuR2"))},"1nuA":function(t,e,n){"use strict";e.decode=e.parse=n("kMPS"),e.encode=e.stringify=n("xaZU")},"1u0Y":function(t,e,n){"use strict";var r,i,o,s,a=n("f2YR"),u=n("h+QR"),c=Object.prototype.isPrototypeOf,l=Object.defineProperty,h={configurable:!0,enumerable:!1,writable:!0,value:void 0};r=function(t,e){if(u(t),null===e||a(e))return t;throw new TypeError("Prototype must be null or an object")},t.exports=(i=function(){var t,e=Object.create(null),n={},r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(r){try{(t=r.set).call(e,n)}catch(t){}if(Object.getPrototypeOf(e)===n)return{set:t,level:2}}return e.__proto__=n,Object.getPrototypeOf(e)===n?{level:2}:((e={}).__proto__=n,Object.getPrototypeOf(e)===n&&{level:1})}())?(2===i.level?i.set?(s=i.set,o=function(t,e){return s.call(r(t,e),e),t}):o=function(t,e){return r(t,e).__proto__=e,t}:o=function t(e,n){var i;return r(e,n),(i=c.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===n&&(n=t.nullPolyfill),e.__proto__=n,i&&l(t.nullPolyfill,"__proto__",h),e},Object.defineProperty(o,"level",{configurable:!1,enumerable:!1,writable:!1,value:i.level})):null,n("7DUC")},2:function(t,e){},"4ORP":function(t,e,n){"use strict";var r=n(8);t.exports=function(t,e){var n;function i(r){e.rejectUnauthorized&&t.emit("error",r),n.end()}return e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=!1!==e.rejectUnauthorized,delete e.path,(n=r.connect(e)).on("secureConnect",function(){e.rejectUnauthorized&&!n.authorized?n.emit("error",new Error("TLS not authorized")):n.removeListener("error",i)}),n.on("error",i),n}},5:function(t,e){},6:function(t,e){},"6kAM":function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||r.call(t)===i)||!1}},7:function(t,e){},"7+S+":function(t,e,n){"use strict";var r,i=n("GxN+"),o=n("XUym"),s=n("pUTq"),a=n("pqtO"),u=n("wZrd"),c=Object.defineProperty;r=t.exports=function(t,e){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",c(this,"__kind__",s("",e))},i&&i(r,u),delete r.prototype.constructor,r.prototype=Object.create(u.prototype,{_resolve:s(function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t})}),c(r.prototype,a.toStringTag,s("c","Array Iterator"))},"7DUC":function(t,e,n){"use strict";var r,i,o,s,a=Object.create;n("Gsbh")()||(r=n("1u0Y")),t.exports=r?1!==r.level?a:(i={},o={},s={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach(function(t){o[t]="__proto__"!==t?s:{configurable:!0,enumerable:!1,writable:!0,value:void 0}}),Object.defineProperties(i,o),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:i}),function(t,e){return a(null===t?i:t,e)}):a},"7dSG":function(t,e,n){"use strict";(function(e,r){var i=n("ypnx");function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=y;var s,a=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?setImmediate:i.nextTick;y.WritableState=g;var u=n("jOgh");u.inherits=n("LC74");var c={deprecate:n("iP15")},l=n("UcPO"),h=n("kkc6").Buffer,f=r.Uint8Array||function(){};var p,d=n("x0Ha");function b(){}function g(t,e){s=s||n("DsFX"),t=t||{};var r=e instanceof s;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var u=t.highWaterMark,c=t.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:r&&(c||0===c)?c:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,o=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,o){--e.pendingcb,n?(i.nextTick(o,r),i.nextTick(k,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(o(r),t._writableState.errorEmitted=!0,t.emit("error",r),k(t,e))}(t,n,r,e,o);else{var s=w(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||v(t,n),r?a(m,t,n,s,o):m(t,n,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function y(t){if(s=s||n("DsFX"),!(p.call(y,this)||this instanceof s))return new y(t);this._writableState=new g(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),l.call(this)}function _(t,e,n,r,i,o,s){e.writelen=r,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function m(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),k(t,e)}function v(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),s=e.corkedRequestsFree;s.entry=n;for(var a=0,u=!0;n;)i[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;i.allBuffers=u,_(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,l=n.encoding,h=n.callback;if(_(t,e,!1,e.objectMode?1:c.length,c,l,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function w(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),k(t,e)})}function k(t,e){var n=w(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,i.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}u.inherits(y,l),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===y&&(t&&t._writableState instanceof g)}})):p=function(t){return t instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(t,e,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=t,h.isBuffer(r)||r instanceof f);return a&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=b),o.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),i.nextTick(e,n)}(this,n):(a||function(t,e,n,r){var o=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(r,s),o=!1),o}(this,o,t,n))&&(o.pendingcb++,s=function(t,e,n,r,i,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,n));return e}(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,n){var r=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,k(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=d.destroy,y.prototype._undestroy=d.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(e,n("W2nU"),n("DuR2"))},"7qQr":function(t,e,n){"use strict";var r=n("9++m")();t.exports=function(t){return t!==r&&null!==t}},"7suT":function(t,e,n){var r=n("G0LE");function i(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},n=t.name||"Function wrapped with `once`";return e.onceError=n+" shouldn't be called more than once",e.called=!1,e}t.exports=r(i),t.exports.strict=r(o),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})})},8:function(t,e){},"9++m":function(t,e,n){"use strict";t.exports=function(){}},"97+M":function(t,e,n){"use strict";var r=n("X3l8").Buffer,i=t.exports;for(var o in i.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"reserved"},i.codes={},i.types){var s=i.types[o];i.codes[s]=o}function a(t){return[0,1,2].map(function(e){return[0,1].map(function(n){return[0,1].map(function(o){var s=new r(1);return s.writeUInt8(i.codes[t]<0?r-4:r,h=0;h>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;sa?a:s+16383));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},EuP9:function(t,e,n){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var r=n("EKta"),i=n("ujcs"),o=n("sOR5");function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return N(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(t).length;default:if(r)return N(t).length;e=(""+e).toLowerCase(),r=!0}}function b(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function g(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var h=!0,f=0;fi&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function x(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(l=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var n="",r=0;for(;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,n);case"utf8":case"utf-8":return x(this,e,n);case"ascii":return T(this,e,n);case"latin1":case"binary":return R(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,r>>>=0,i>>>=0,this===t)return 0;for(var o=i-r,s=n-e,a=Math.min(o,s),c=this.slice(r,i),l=t.slice(e,n),h=0;hi)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return _(this,t,e,n);case"utf8":case"utf-8":return m(this,t,e,n);case"ascii":return v(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return S(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function T(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,n,r,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function P(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function L(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(t,e,n,r,o){return o||L(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||L(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||A(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):P(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);A(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):C(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):C(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):P(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):P(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return q(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return q(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function W(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(e,n("DuR2"))},EzHP:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("fZjL"),i=n.n(r),o=n("Y81h"),s=n.n(o),a=n("Cg+j"),u=n.n(a),c=n("CqLJ"),l=n.n(c),h=n("zL8q"),f={client:{},options:{host:"",port:8083,username:"",isSSL:!1,password:"",keepalive:60,clean:!0,clientId:"",subQos:0,publishQos:0,publishMessage:'{ "msg": "Hello, World!" }',subTopic:"testtopic/#",publishTopic:"testtopic",publishRetain:!1,receivedMessages:[],publishedMessages:[],subscriptions:[]}},p={name:"websocket-view",components:{"el-input":h.Input,"el-checkbox":h.Checkbox,"el-select":h.Select,"el-option":h.Option,"el-button":h.Button,"el-table":h.Table,"el-table-column":h.TableColumn,"el-row":h.Row,"el-col":h.Col,"el-card":h.Card,"el-form":h.Form,"el-form-item":h.FormItem},data:function(){return{retryTimes:0,loading:!1,sending:!1,host:window.location.hostname,port:8083,path:"/mqtt",username:"",isSSL:!1,password:"",keepalive:60,clean:!0,clientId:"mqttjs_"+Math.random().toString(16).substr(2,10),subQos:0,publishQos:0,publishMessage:'{ "msg": "Hello, World!" }',subTopic:"testtopic/#",publishTopic:"testtopic",publishRetain:!1,receivedMessages:[],publishedMessages:[],subscriptions:[],client:{}}},computed:{getStatus:function(){return this.client.connected?this.$t("websocket.connected"):this.loading?this.$t("websocket.connecting"):this.$t("websocket.disconnected")},connectURL:function(){var t=this.path&&this.path.startsWith("/")?this.path:"/"+this.path;return(this.isSSL?"wss":"ws")+"://"+this.host+":"+this.port+t}},methods:{handleSSL:function(){this.port=this.isSSL?8084:8083},now:function(){return l()(new Date,"yyyy-mm-dd HH:MM:ss")},disconnectSwitch:function(){this.loading&&!this.client.connected?(this.loading=!1,s.a.done(),this.client.end(),this.client={}):this.mqttDisconnect()},mqttConnect:function(){var t=this;if(window.WebSocket){if(!this.client.connected&&!this.loading){s.a.start(),this.loading=!0,this.retryTimes=0;var e={keepalive:this.keepalive,username:this.username,password:this.password,clientId:this.clientId,clean:this.clean,connectTimeout:1e4};try{this.client=u.a.connect(this.connectURL,e),this.client.on("connect",function(){t.loading=!1,s.a.done()}),this.client.on("reconnect",this.handleReconnect),this.client.on("error",function(e){t.$message.error(e.toString()||t.$t("error.networkError")),t.retryTimes=0,t.client.end(),t.sending=!1,t.loading=!1,s.a.done()}),this.client.on("message",function(e,n,r){t.receivedMessages.unshift({topic:e,message:n.toString(),qos:r.qos,time:t.now()})})}catch(t){this.loading=!1,s.a.done(),this.$message.error(t.toString())}}}else this.$message.error(this.$t("websocket.notSupport"))},mqttDisconnect:function(){var t=this;this.client.connected?(s.a.start(),this.client.end(),this.client.on("close",function(){t.loading=!1,t.reset(),t.client={},s.a.done()})):this.$message.error(this.$t("websocket.connectLeave"))},mqttSubscribe:function(){var t=this;this.client.connected?(this.subscriptions.forEach(function(e,n){e.topic===t.subTopic&&t.subscriptions.splice(n,n+1)}),s.a.start(),this.client.subscribe(this.subTopic,{qos:this.subQos},function(e,n){e||n[0]&&![0,1,2].includes(n[0].qos)?(s.a.done(),t.$message.error(e?e.message:t.$t("websocket.subscribeFailure"))):(t.subscriptions.unshift({topic:t.subTopic,qos:t.subQos,time:t.now()}),t.$message.success(t.$t("websocket.subscribeSuccess")),s.a.done())})):this.$message.error(this.$t("websocket.connectLeave"))},mqttPublish:function(){var t=this;if(this.client.connected){s.a.start();var e={qos:this.publishQos,retain:this.publishRetain};this.sending=!0,this.client.publish(this.publishTopic,this.publishMessage,e,function(e){e?(s.a.done(),t.$message.error(e.toString())):(t.publishedMessages.unshift({message:t.publishMessage,topic:t.publishTopic,qos:t.publishQos,time:t.now()}),t.$message.success(t.$t("websocket.messageSendOut")),s.a.done())})}else this.$message.error(this.$t("websocket.connectLeave"))},mqttCacheScuscribe:function(t){var e=this;this.client.connected?this.client.unsubscribe(t,function(n){n?e.$message.error(e.$t("websocket.unsubscribeFailure")+" "+n.toString()+"!"):e.subscriptions.forEach(function(n,r){n.topic===t&&e.subscriptions.splice(r,1)})}):this.$message.error(this.$t("websocket.connectLeave"))},handleReconnect:function(){if(this.retryTimes>1){try{this.sending?this.$message.error(this.$t("websocket.connectError")):this.$message.error(this.$t("websocket.connectFailure")+" "+this.host+":"+this.port)}catch(t){this.retryTimes=0,this.sending=!1,this.loading=!1,s.a.done(),this.client.end(),this.client={}}return this.retryTimes=0,this.sending=!1,this.loading=!1,s.a.done(),this.client.end(),void(this.client={})}this.sending&&this.$message.error(this.$t("websocket.connectError")),this.retryTimes+=1},reset:function(){this.subscriptions=[],this.receivedMessages=[],this.publishedMessages=[],this.publishMessage='{ "msg": "Hello, World!" }',this.subTopic="testtopic/#",this.publishTopic="testtopic"},clearMessage:function(){!(arguments.length>0&&void 0!==arguments[0])||arguments[0]?this.receivedMessages=[]:this.publishedMessages=[]},loadConnect:function(){var t=this;f.client&&f.client.connected&&(this.client=f.client,i()(f.options).forEach(function(e){t[e]=f.options[e]}))},stashConnect:function(){var t=this;f.client=this.client,i()(f.options).forEach(function(e){f.options[e]=t[e]})},setSSL:function(){"https:"===window.location.protocol&&(this.isSSL=!0,this.port=8084)}},created:function(){this.setSSL(),this.loadConnect()},beforeRouteLeave:function(t,e,n){this.client.connected&&this.stashConnect(),n()}},d={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"websocket-view"},[n("div",{staticClass:"page-title"},[t._v(t._s(t.$t("leftbar.websocket")))]),t._v(" "),n("el-card",{staticClass:"el-card--self",nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttConnect(e)}}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[t._v(t._s(t.$t("websocket.connect")))])]),t._v(" "),n("el-form",{attrs:{size:"medium"}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.host")}},[n("el-input",{model:{value:t.host,callback:function(e){t.host=e},expression:"host"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.port")}},[n("el-input",{model:{value:t.port,callback:function(e){t.port=t._n(e)},expression:"port"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:"Path"}},[n("el-input",{model:{value:t.path,callback:function(e){t.path=e},expression:"path"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.clientID")}},[n("el-input",{model:{value:t.clientId,callback:function(e){t.clientId=e},expression:"clientId"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.username")}},[n("el-input",{model:{value:t.username,callback:function(e){t.username=e},expression:"username"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.password")}},[n("el-input",{model:{value:t.password,callback:function(e){t.password=e},expression:"password"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:8}},[n("el-form-item",{attrs:{label:t.$t("websocket.keepAlive")}},[n("el-input",{model:{value:t.keepalive,callback:function(e){t.keepalive=t._n(e)},expression:"keepalive"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:24}},[n("el-form-item",{staticClass:"check-area"},[n("el-checkbox",{model:{value:t.clean,callback:function(e){t.clean=e},expression:"clean"}},[t._v("\n "+t._s(t.$t("websocket.cleanSession"))+"\n ")]),t._v(" "),n("el-checkbox",{staticStyle:{"margin-left":"50px"},on:{change:t.handleSSL},model:{value:t.isSSL,callback:function(e){t.isSSL=e},expression:"isSSL"}},[t._v("\n SSL\n ")]),t._v(" "),n("span",{staticStyle:{margin:"5px 0 20px 50px",color:"#42d885"}},[t._v(t._s(t.connectURL))])],1)],1)],1)],1),t._v(" "),n("div",{staticClass:"operation-area"},[n("el-button",{staticClass:"confirm-btn",attrs:{type:"success",disabled:t.loading||t.client.connected},on:{click:t.mqttConnect},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttConnect(e)}}},[t._v("\n "+t._s(t.$t("websocket.connect"))+"\n ")]),t._v(" "),n("el-button",{staticStyle:{"margin-left":"20px"},attrs:{type:"danger",loading:t.loading&&t.client.connected,disabled:!t.loading&&!t.client.connected},on:{click:t.disconnectSwitch},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.disconnectSwitch(e)}}},[t._v("\n "+t._s(t.$t("websocket.disconnect"))+"\n ")]),t._v(" "),n("div",{staticClass:"connect-state"},[t._v("\n "+t._s(t.$t("websocket.currentState"))+":\n "),n("span",{style:t.client.connected?"color: #42d885":"color: #ff6d6d"},[t._v("\n "+t._s(t.getStatus)+"\n ")])])],1)],1),t._v(" "),n("el-card",{staticClass:"el-card--self",staticStyle:{"max-height":"450px"}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[t._v(t._s(t.$t("websocket.subscribe")))])]),t._v(" "),n("el-form",{attrs:{size:"medium"}},[n("el-row",{attrs:{gutter:20},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttSubscribe(e)}}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:t.$t("websocket.topic")}},[n("el-input",{model:{value:t.subTopic,callback:function(e){t.subTopic=e},expression:"subTopic"}})],1),t._v(" "),n("el-form-item",{attrs:{label:t.$t("websocket.qoS")}},[n("el-select",{model:{value:t.subQos,callback:function(e){t.subQos=t._n(e)},expression:"subQos"}},[n("el-option",{attrs:{value:0}}),t._v(" "),n("el-option",{attrs:{value:1}}),t._v(" "),n("el-option",{attrs:{value:2}})],1)],1),t._v(" "),n("div",{staticClass:"operation-area"},[n("el-button",{staticClass:"confirm-btn",attrs:{type:"success"},on:{click:t.mqttSubscribe},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttSubscribe(e)}}},[t._v("\n "+t._s(t.$t("websocket.subscribe"))+"\n ")])],1)],1),t._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:t.$t("websocket.subscribe")}},[n("el-table",{attrs:{data:t.subscriptions,"max-height":320}},[n("el-table-column",{attrs:{prop:"topic","min-width":"150",label:t.$t("websocket.topic")}}),t._v(" "),n("el-table-column",{attrs:{prop:"qos","min-width":"120",label:t.$t("websocket.qoS")}}),t._v(" "),n("el-table-column",{attrs:{prop:"time","min-width":"180",label:t.$t("websocket.time")}}),t._v(" "),n("el-table-column",{attrs:{width:"90",label:t.$t("websocket.oper")},scopedSlots:t._u([{key:"default",fn:function(e){return[n("i",{staticClass:"unsubscribe el-icon-close",attrs:{title:"Unsubscribe"},on:{click:function(n){return t.mqttCacheScuscribe(e.row.topic)}}})]}}])})],1)],1)],1)],1)],1)],1),t._v(" "),n("el-card",{staticClass:"el-card--self",staticStyle:{"max-height":"800px","padding-bottom":"20px"}},[n("div",{attrs:{slot:"header"},slot:"header"},[n("span",[t._v(t._s(t.$t("websocket.messages")))])]),t._v(" "),n("el-form",{attrs:{size:"medium"}},[n("el-row",{attrs:{gutter:20},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttPublish(e)}}},[n("el-col",{attrs:{span:6}},[n("el-form-item",{attrs:{label:t.$t("websocket.topic")}},[n("el-input",{model:{value:t.publishTopic,callback:function(e){t.publishTopic=e},expression:"publishTopic"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:6}},[n("el-form-item",{attrs:{label:t.$t("websocket.messages")}},[n("el-input",{model:{value:t.publishMessage,callback:function(e){t.publishMessage=e},expression:"publishMessage"}})],1)],1),t._v(" "),n("el-col",{attrs:{span:6}},[n("el-form-item",{attrs:{label:t.$t("websocket.qoS")}},[n("el-select",{model:{value:t.publishQos,callback:function(e){t.publishQos=t._n(e)},expression:"publishQos"}},[n("el-option",{attrs:{value:0}}),t._v(" "),n("el-option",{attrs:{value:1}}),t._v(" "),n("el-option",{attrs:{value:2}})],1)],1)],1),t._v(" "),n("el-col",{staticStyle:{"margin-top":"33px"},attrs:{span:6}},[n("el-form-item",[n("el-checkbox",{model:{value:t.publishRetain,callback:function(e){t.publishRetain=e},expression:"publishRetain"}},[t._v("\n "+t._s(t.$t("websocket.retained"))+"\n ")]),t._v(" "),n("el-button",{staticClass:"confirm-btn",staticStyle:{float:"right","margin-top":"4px"},attrs:{type:"success"},on:{click:t.mqttPublish},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.mqttPublish(e)}}},[t._v("\n "+t._s(t.$t("websocket.send"))+"\n ")])],1)],1)],1)],1),t._v(" "),n("el-form",{staticStyle:{"margin-top":"20px"},attrs:{size:"medium"}},[n("el-row",{attrs:{gutter:20}},[n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:t.$t("websocket.messagesAlreadySent")}},[n("i",{staticClass:"fa fa-refresh refresh-btn",attrs:{title:"clear message"},on:{click:function(e){return t.clearMessage(!1)}}}),t._v(" "),n("el-table",{attrs:{border:"",data:t.publishedMessages,"max-height":600}},[n("el-table-column",{attrs:{prop:"message","min-width":"100",label:t.$t("websocket.messages")}}),t._v(" "),n("el-table-column",{attrs:{prop:"topic",label:t.$t("websocket.topic")}}),t._v(" "),n("el-table-column",{attrs:{prop:"qos","min-width":"120",label:t.$t("websocket.qoS")}}),t._v(" "),n("el-table-column",{attrs:{prop:"time","min-width":"180",label:t.$t("websocket.time")}})],1)],1)],1),t._v(" "),n("el-col",{attrs:{span:12}},[n("el-form-item",{attrs:{label:t.$t("websocket.messagesReceived")}},[n("i",{staticClass:"fa fa-refresh refresh-btn",attrs:{title:"clear message"},on:{click:t.clearMessage}}),t._v(" "),n("el-table",{attrs:{border:"",data:t.receivedMessages,"max-height":600}},[n("el-table-column",{attrs:{prop:"message","min-width":"100",label:t.$t("websocket.messages")}}),t._v(" "),n("el-table-column",{attrs:{prop:"topic",label:t.$t("websocket.topic")}}),t._v(" "),n("el-table-column",{attrs:{prop:"qos","min-width":"120",label:t.$t("websocket.qoS")}}),t._v(" "),n("el-table-column",{attrs:{prop:"time",width:"180",label:t.$t("websocket.time")}})],1)],1)],1)],1)],1)],1)],1)},staticRenderFns:[]};var b=n("VU/8")(p,d,!1,function(t){n("qxkv")},null,null);e.default=b.exports},FunP:function(t,e,n){var r=n("sNTc"),i=n("OMJi"),o=n("X3l8").Buffer;function s(t){if(!(this instanceof s))return new s(t);if(this._bufs=[],this.length=0,"function"==typeof t){this._callback=t;var e=function(t){this._callback&&(this._callback(t),this._callback=null)}.bind(this);this.on("pipe",function(t){t.on("error",e)}),this.on("unpipe",function(t){t.removeListener("error",e)})}else this.append(t);r.call(this)}i.inherits(s,r),s.prototype._offset=function(t){var e,n=0,r=0;if(0===t)return[0,0];for(;rthis.length)&&(r=this.length),n>=this.length)return t||o.alloc(0);if(r<=0)return t||o.alloc(0);var i,s,a=!!t,u=this._offset(n),c=r-n,l=c,h=a&&e||0,f=u[1];if(0===n&&r==this.length){if(!a)return 1===this._bufs.length?this._bufs[0]:o.concat(this._bufs,this.length);for(s=0;s(i=this._bufs[s].length-f))){this._bufs[s].copy(t,h,f,f+l);break}this._bufs[s].copy(t,h,f),h+=i,l-=i,f&&(f=0)}return t},s.prototype.shallowSlice=function(t,e){t=t||0,e=e||this.length,t<0&&(t+=this.length),e<0&&(e+=this.length);var n=this._offset(t),r=this._offset(e),i=this._bufs.slice(n[0],r[0]+1);return 0==r[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,r[1]),0!=n[1]&&(i[0]=i[0].slice(n[1])),new s(i)},s.prototype.toString=function(t,e,n){return this.slice(e,n).toString(t)},s.prototype.consume=function(t){for(;this._bufs.length;){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){for(var t=0,e=new s;t=55296&&g<=56319&&(b+=t[++p]),u.call(e,y,b,h),!f);++p);else c.call(t,function(t){return u.call(e,y,t,h),f})}},JNhS:function(t,e,n){"use strict";(function(e,r){var i=n("vzCy"),o=n("dcD+"),s=n("zXBm"),a=n("pBXs"),u=n("cSWu").Writable,c=n("LC74"),l=n("Ms2V"),h=n("BKrL"),f=n("q+vg"),p=e.setImmediate||function(t){r.nextTick(t)},d={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0};function b(t,e,n){t.emit("packetsend",e),!a.writeToStream(e,t.stream)&&n?t.stream.once("drain",n):n&&n()}function g(t,e,n){t.outgoingStore.put(e,function(r){if(r)return n&&n(r);b(t,e,n)})}function y(){}function _(t,e){var n,r=this;if(!(this instanceof _))return new _(t,e);for(n in this.options=e||{},d)void 0===this.options[n]?this.options[n]=d[n]:this.options[n]=e[n];this.options.clientId="string"==typeof this.options.clientId?this.options.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),this.streamBuilder=t,this.outgoingStore=this.options.outgoingStore||new o,this.incomingStore=this.options.incomingStore||new o,this.queueQoSZero=void 0===this.options.queueQoSZero||this.options.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this.on("connect",function(){if(!this.disconnected){this.connected=!0;var t=this.outgoingStore.createStream();this.once("close",e),t.on("end",function(){r.removeListener("close",e)}),t.on("error",function(t){r.removeListener("close",e),r.emit("error",t)}),function e(){if(t){var n,i=t.read(1);i?r.disconnecting||r.reconnectTimer?t.destroy&&t.destroy():(n=r.outgoing[i.messageId],r.outgoing[i.messageId]=function(t,r){n&&n(t,r),e()},r._sendPacket(i)):t.once("readable",e)}}()}function e(){t.destroy(),t=null}}),this.on("close",function(){this.connected=!1,clearTimeout(this.connackTimer)}),this.on("connect",this._setupPingTimer),this.on("connect",function(){var t=this.queue;!function e(){var n,i=t.shift();i&&(n=i.packet,r._sendPacket(n,function(t){i.cb&&i.cb(t),e()}))}()});var s=!0;this.on("connect",function(){!s&&this.options.clean&&Object.keys(this._resubscribeTopics).length>0&&(this.options.resubscribe?(this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)):this._resubscribeTopics={}),s=!1}),this.on("close",function(){null!==r.pingTimer&&(r.pingTimer.clear(),r.pingTimer=null)}),this.on("close",this._setupReconnect),i.EventEmitter.call(this),this._setupStream()}c(_,i.EventEmitter),_.prototype._setupStream=function(){var t,e=this,n=new u,i=a.parser(this.options),o=null,c=[];function l(){r.nextTick(h)}function h(){var t=c.shift(),n=o;t?e._handlePacket(t,l):(o=null,n())}this._clearReconnect(),this.stream=this.streamBuilder(this),i.on("packet",function(t){c.push(t)}),n._write=function(t,e,n){o=n,i.parse(t),h()},this.stream.pipe(n),this.stream.on("error",y),s(this.stream,this.emit.bind(this,"close")),(t=Object.create(this.options)).cmd="connect",b(this,t),i.on("error",this.emit.bind(this,"error")),this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){e._cleanUp(!0)},this.options.connectTimeout)},_.prototype._handlePacket=function(t,e){switch(this.emit("packetreceive",t),t.cmd){case"publish":this._handlePublish(t,e);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(t),e();break;case"pubrel":this._handlePubrel(t,e);break;case"connack":this._handleConnack(t),e();break;case"pingresp":this._handlePingresp(t),e()}},_.prototype._checkDisconnecting=function(t){return this.disconnecting&&(t?t(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},_.prototype.publish=function(t,e,n,r){var i;"function"==typeof n&&(r=n,n=null);if(n=f({qos:0,retain:!1,dup:!1},n),this._checkDisconnecting(r))return this;switch(i={cmd:"publish",topic:t,payload:e,qos:n.qos,retain:n.retain,messageId:this._nextId(),dup:n.dup},n.qos){case 1:case 2:this.outgoing[i.messageId]=r||y,this._sendPacket(i);break;default:this._sendPacket(i,r)}return this},_.prototype.subscribe=function(){var t,e,n=Array.prototype.slice.call(arguments),r=[],i=n.shift(),o=i.resubscribe,s=n.pop()||y,a=n.pop(),u=this;if(delete i.resubscribe,"string"==typeof i&&(i=[i]),"function"!=typeof s&&(a=s,s=y),null!==(e=h.validateTopics(i)))return p(s,new Error("Invalid topic "+e)),this;if(this._checkDisconnecting(s))return this;if(a=f({qos:0},a),Array.isArray(i)?i.forEach(function(t){(u._resubscribeTopics[t]0&&(u._resubscribeTopics[t.topic]=t.qos,c.push(t.topic))}),u.messageIdToTopic[t.messageId]=c}return this.outgoing[t.messageId]=function(t,e){if(!t)for(var n=e.granted,i=0;i0?this.once("outgoingEmpty",setTimeout.bind(null,i,10)):i(),this)},_.prototype.removeOutgoingMessage=function(t){var e=this.outgoing[t];return delete this.outgoing[t],this.outgoingStore.del({messageId:t},function(){e(new Error("Message removed"))}),this},_.prototype.reconnect=function(t){var e=this,n=function(){t?(e.options.incomingStore=t.incomingStore,e.options.outgoingStore=t.outgoingStore):(e.options.incomingStore=null,e.options.outgoingStore=null),e.incomingStore=e.options.incomingStore||new o,e.outgoingStore=e.options.outgoingStore||new o,e.disconnecting=!1,e.disconnected=!1,e._deferredReconnect=null,e._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=n:n(),this},_.prototype._reconnect=function(){this.emit("reconnect"),this._setupStream()},_.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0&&(this.reconnecting||(this.emit("offline"),this.reconnecting=!0),t.reconnectTimer=setInterval(function(){t._reconnect()},t.options.reconnectPeriod))},_.prototype._clearReconnect=function(){this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},_.prototype._cleanUp=function(t,e){var n;e&&this.stream.on("close",e),t?(0===this.options.reconnectPeriod&&this.options.clean&&(n=this.outgoing)&&Object.keys(n).forEach(function(t){"function"==typeof n[t]&&(n[t](new Error("Connection closed")),delete n[t])}),this.stream.destroy()):this._sendPacket({cmd:"disconnect"},p.bind(null,this.stream.end.bind(this.stream))),this.disconnecting||(this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(this.stream.removeListener("close",e),e())},_.prototype._sendPacket=function(t,e){if(this.connected){switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void g(this,t,e);default:return void b(this,t,e)}switch(t.qos){case 2:case 1:g(this,t,e);break;case 0:default:b(this,t,e)}}else 0===(t.qos||0)&&this.queueQoSZero||"publish"!==t.cmd?this.queue.push({packet:t,cb:e}):t.qos>0?(e=this.outgoing[t.messageId],this.outgoingStore.put(t,function(t){if(t)return e&&e(t)})):e&&e(new Error("No connection to broker"))},_.prototype._setupPingTimer=function(){var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=l(function(){t._checkPing()},1e3*this.options.keepalive))},_.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},_.prototype._checkPing=function(){this.pingResp?(this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):this._cleanUp(!0)},_.prototype._handlePingresp=function(){this.pingResp=!0},_.prototype._handleConnack=function(t){var e=t.returnCode;if(clearTimeout(this.connackTimer),0===e)this.reconnecting=!1,this.emit("connect",t);else if(e>0){var n=new Error("Connection refused: "+["","Unacceptable protocol version","Identifier rejected","Server unavailable","Bad username or password","Not authorized"][e]);n.code=e,this.emit("error",n)}},_.prototype._handlePublish=function(t,e){e=void 0!==e?e:y;var n=t.topic.toString(),r=t.payload,i=t.qos,o=t.messageId,s=this;switch(i){case 2:this.incomingStore.put(t,function(t){if(t)return e(t);s._sendPacket({cmd:"pubrec",messageId:o},e)});break;case 1:this.emit("message",n,r,t),this.handleMessage(t,function(t){if(t)return e(t);s._sendPacket({cmd:"puback",messageId:o},e)});break;case 0:this.emit("message",n,r,t),this.handleMessage(t,e)}},_.prototype.handleMessage=function(t,e){e()},_.prototype._handleAck=function(t){var e=t.messageId,n=t.cmd,r=null,i=this.outgoing[e],o=this;if(i){switch(n){case"pubcomp":case"puback":delete this.outgoing[e],this.outgoingStore.del(t,i);break;case"pubrec":r={cmd:"pubrel",qos:2,messageId:e},this._sendPacket(r);break;case"suback":if(delete this.outgoing[e],1===t.granted.length&&0!=(128&t.granted[0])){var s=this.messageIdToTopic[e];s&&s.forEach(function(t){delete o._resubscribeTopics[t]})}i(null,t);break;case"unsuback":delete this.outgoing[e],i(null);break;default:o.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}},_.prototype._handlePubrel=function(t,e){e=void 0!==e?e:y;var n=this,r={cmd:"pubcomp",messageId:t.messageId};n.incomingStore.get(t,function(i,o){i||"pubrel"===o.cmd?n._sendPacket(r,e):(n.emit("message",o.topic,o.payload,o),n.incomingStore.put(t,function(t){if(t)return e(t);n.handleMessage(o,function(t){if(t)return e(t);n._sendPacket(r,e)})}))})},_.prototype._nextId=function(){var t=this.nextId++;return 65536===this.nextId&&(this.nextId=1),t},_.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},t.exports=_}).call(e,n("DuR2"),n("W2nU"))},JUqv:function(t,e,n){"use strict";t.exports=n("KHvW")()?Number.isNaN:n("u1vs")},KHvW:function(t,e,n){"use strict";t.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},Kqp3:function(t,e,n){"use strict";t.exports=function(t){return"function"==typeof t}},L0Xt:function(t,e,n){"use strict";var r=n("97+M"),i=n("X3l8").Buffer,o=i.allocUnsafe(0),s=i.from([0]),a=n("jyB8"),u=n("ypnx").nextTick,c=a.cache,l=a.generateNumber,h=a.generateCache,f=m,p=!0;function d(t,e){switch(e.cork&&(e.cork(),u(b,e)),p&&(p=!1,h()),t.cmd){case"connect":return function(t,e){var n=t||{},o=n.protocolId||"MQTT",s=n.protocolVersion||4,a=n.will,u=n.clean,c=n.keepalive||0,l=n.clientId||"",h=n.username,p=n.password;void 0===u&&(u=!0);var d=0;if(!o||"string"!=typeof o&&!i.isBuffer(o))return e.emit("error",new Error("Invalid protocolId")),!1;d+=o.length+2;if(3!==s&&4!==s)return e.emit("error",new Error("Invalid protocol version")),!1;d+=1;if("string"!=typeof l&&!i.isBuffer(l)||!l&&4!==s||!l&&!u){if(s<4)return e.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*u==0)return e.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else d+=l.length+2;if("number"!=typeof c||c<0||c>65535||c%1!=0)return e.emit("error",new Error("Invalid keepalive")),!1;d+=2;if(d+=1,a){if("object"!=typeof a)return e.emit("error",new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return e.emit("error",new Error("Invalid will topic")),!1;if(d+=i.byteLength(a.topic)+2,a.payload&&a.payload){if(!(a.payload.length>=0))return e.emit("error",new Error("Invalid will payload")),!1;"string"==typeof a.payload?d+=i.byteLength(a.payload)+2:d+=a.payload.length+2}else d+=2}var b=!1;if(null!=h){if(!k(h))return e.emit("error",new Error("Invalid username")),!1;b=!0,d+=i.byteLength(h)+2}if(null!=p){if(!b)return e.emit("error",new Error("Username is required to use password")),!1;if(!k(p))return e.emit("error",new Error("Invalid password")),!1;d+=S(p)+2}e.write(r.CONNECT_HEADER),y(e,d),w(e,o),e.write(4===s?r.VERSION4:r.VERSION3);var g=0;g|=null!=h?r.USERNAME_MASK:0,g|=null!=p?r.PASSWORD_MASK:0,g|=a&&a.retain?r.WILL_RETAIN_MASK:0,g|=a&&a.qos?a.qos<0&&f(e,l);return e.write(c)}(t,e);case"puback":case"pubrec":case"pubrel":case"pubcomp":case"unsuback":return function(t,e){var n=t||{},i=n.cmd||"puback",o=n.messageId,s=n.dup&&"pubrel"===i?r.DUP_MASK:0,a=0;"pubrel"===i&&(a=1);if("number"!=typeof o)return e.emit("error",new Error("Invalid messageId")),!1;return e.write(r.ACKS[i][a][s][0]),y(e,2),f(e,o)}(t,e);case"subscribe":return function(t,e){var n=t||{},o=n.dup?r.DUP_MASK:0,s=n.messageId,a=n.subscriptions,u=0;if("number"!=typeof s)return e.emit("error",new Error("Invalid messageId")),!1;u+=2;if("object"!=typeof a||!a.length)return e.emit("error",new Error("Invalid subscriptions")),!1;for(var c=0;c=0&&t<128?1:t>=128&&t<16384?2:t>=16384&&t<2097152?3:t>=2097152&&t<268435456?4:0}(t));do{e=t%128|0,(t=t/128|0)>0&&(e|=128),r.writeUInt8(e,n++)}while(t>0);return r}(e),e<16384&&(g[e]=n)),t.write(n)}function _(t,e){var n=i.byteLength(e);f(t,n),t.write(e,"utf8")}function m(t,e){return t.write(c[e])}function v(t,e){return t.write(l(e))}function w(t,e){"string"==typeof e?_(t,e):e?(f(t,e.length),t.write(e)):f(t,0)}function S(t){return t?t instanceof i?t.length:i.byteLength(t):0}function k(t){return"string"==typeof t||t instanceof i}t.exports=d},L5oL:function(t,e,n){t.exports=n("vzCy").EventEmitter},LC74:function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},LTTu:function(t,e,n){"use strict";var r=n("h+QR");t.exports=function(){return r(this).length=0,this}},"MNB/":function(t,e,n){"use strict";var r,i=n("GxN+"),o=n("pUTq"),s=n("wZrd"),a=n("pqtO").toStringTag,u=n("NM2q"),c=Object.defineProperties,l=s.prototype._unBind;r=t.exports=function(t,e){if(!(this instanceof r))return new r(t,e);s.call(this,t.__mapKeysData__,t),e&&u[e]||(e="key+value"),c(this,{__kind__:o("",e),__values__:o("w",t.__mapValuesData__)})},i&&i(r,s),r.prototype=Object.create(s.prototype,{constructor:o(r),_resolve:o(function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]}),_unBind:o(function(){this.__values__=null,l.call(this)}),toString:o(function(){return"[object Map Iterator]"})}),Object.defineProperty(r.prototype,a,o("c","Map Iterator"))},MPhG:function(t,e,n){"use strict";t.exports=n("sqO9")()?Array.from:n("/G7b")},Ms2V:function(t,e,n){"use strict";t.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-l,S=Math.floor,k=String.fromCharCode;function E(t){throw new RangeError(v[t])}function x(t,e){for(var n=t.length,r=[];n--;)r[n]=e(t[n]);return r}function O(t,e){var n=t.split("@"),r="";return n.length>1&&(r=n[0]+"@",t=n[1]),r+x((t=t.replace(m,".")).split("."),e).join(".")}function T(t){for(var e,n,r=[],i=0,o=t.length;i=55296&&e<=56319&&i65535&&(e+=k((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=k(t)}).join("")}function M(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function j(t,e,n){var r=0;for(t=n?S(t/p):t>>1,t+=S(t/e);t>w*h>>1;r+=c)t=S(t/w);return S(r+(w+1)*t/(t+f))}function I(t){var e,n,r,i,o,s,a,f,p,y,_,m=[],v=t.length,w=0,k=b,x=d;for((n=t.lastIndexOf(g))<0&&(n=0),r=0;r=128&&E("not-basic"),m.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=v&&E("invalid-input"),((f=(_=t.charCodeAt(i++))-48<10?_-22:_-65<26?_-65:_-97<26?_-97:c)>=c||f>S((u-w)/s))&&E("overflow"),w+=f*s,!(f<(p=a<=x?l:a>=x+h?h:a-x));a+=c)s>S(u/(y=c-p))&&E("overflow"),s*=y;x=j(w-o,e=m.length+1,0==o),S(w/e)>u-k&&E("overflow"),k+=S(w/e),w%=e,m.splice(w++,0,k)}return R(m)}function A(t){var e,n,r,i,o,s,a,f,p,y,_,m,v,w,x,O=[];for(m=(t=T(t)).length,e=b,n=0,o=d,s=0;s=e&&_S((u-n)/(v=r+1))&&E("overflow"),n+=(a-e)*v,e=a,s=0;su&&E("overflow"),_==e){for(f=n,p=c;!(f<(y=p<=o?l:p>=o+h?h:p-o));p+=c)x=f-y,w=c-y,O.push(k(M(y+x%w,0))),f=S(x/w);O.push(k(M(f,0))),o=j(n,v,r==i),n=0,++r}++n,++e}return O.join("")}a={version:"1.4.1",ucs2:{decode:T,encode:R},decode:I,encode:A,toASCII:function(t){return O(t,function(t){return _.test(t)?"xn--"+A(t):t})},toUnicode:function(t){return O(t,function(t){return y.test(t)?I(t.slice(4).toLowerCase()):t})}},void 0===(i=function(){return a}.call(e,n,e,t))||(t.exports=i)}()}).call(e,n("3IRH")(t),n("DuR2"))},NM2q:function(t,e,n){"use strict";t.exports=n("wYTC")("key","value","key+value")},NQh1:function(t,e){var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:"undefined"!=typeof window&&(n=window.WebSocket||window.MozWebSocket),t.exports=n},NguZ:function(t,e,n){"use strict";var r=n("wAG3").Buffer,i=n(6);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var e,n,i,o=r.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,i=a,e.copy(n,i),a+=s.data.length,s=s.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},OMJi:function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&e._extend(r,n),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),l(r,t,r.depth)}function u(t,e){var n=a.styles[e];return n?"["+a.colors[n][0]+"m"+t+"["+a.colors[n][1]+"m":t}function c(t,e){return t}function l(t,n,r){if(t.customInspect&&n&&k(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return y(i)||(i=l(t,i,r)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(y(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(g(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(b(e))return t.stylize("null","null")}(t,n);if(o)return o;var s=Object.keys(n),a=function(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),S(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(n);if(0===s.length){if(k(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(m(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return t.stylize(Date.prototype.toString.call(n),"date");if(S(n))return h(n)}var c,v="",E=!1,x=["{","}"];(p(n)&&(E=!0,x=["[","]"]),k(n))&&(v=" [Function"+(n.name?": "+n.name:"")+"]");return m(n)&&(v=" "+RegExp.prototype.toString.call(n)),w(n)&&(v=" "+Date.prototype.toUTCString.call(n)),S(n)&&(v=" "+h(n)),0!==s.length||E&&0!=n.length?r<0?m(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=E?function(t,e,n,r,i){for(var o=[],s=0,a=e.length;s=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(c,v,x)):x[0]+v+x[1]}function h(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),T(r,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(n)?l(t,u.value,null):l(t,u.value,n-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+a.split("\n").map(function(t){return" "+t}).join("\n")):a=t.stylize("[Circular]","special")),_(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function b(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function _(t){return void 0===t}function m(t){return v(t)&&"[object RegExp]"===E(t)}function v(t){return"object"==typeof t&&null!==t}function w(t){return v(t)&&"[object Date]"===E(t)}function S(t){return v(t)&&("[object Error]"===E(t)||t instanceof Error)}function k(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(_(o)&&(o=Object({NODE_ENV:"production"}).NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=t.pid;s[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else s[n]=function(){};return s[n]},e.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=p,e.isBoolean=d,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=y,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=_,e.isRegExp=m,e.isObject=v,e.isDate=w,e.isError=S,e.isFunction=k,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=n("fC4T");var O=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,n;console.log("%s - %s",(t=new Date,n=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":"),[t.getDate(),O[t.getMonth()],n].join(" ")),e.format.apply(e,arguments))},e.inherits=n("ONRY"),e._extend=function(t,e){if(!e||!v(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function M(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise(function(t,r){e=t,n=r}),i=[],o=0;o0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(t,s,e,!1):O(t,s)):w(t,s,e,!1))):r||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(x,t):x(t))}function x(t){p("emit readable"),t.emit("readable"),j(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(T,t,e))}function T(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function A(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(C,e,t))}function C(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?A(this):E(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&A(this),null;var r,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&A(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:m;function c(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",y),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",b),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){p("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",c);var h=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,j(t))}}(n);t.on("drain",h);var f=!1;var d=!1;function b(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(e){p("onerror",e),m(),t.removeListener("error",g),0===a(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",_),m()}function _(){p("onfinish"),t.removeListener("close",y),m()}function m(){p("unpipe"),n.unpipe(t)}return n.on("data",b),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",y),t.once("finish",_),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=n("1nuA");function m(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}o.prototype.parse=function(t,e,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?C+="x":C+=A[P];if(!C.match(p)){var q=j.slice(0,T),U=j.slice(T+1),D=A.match(d);D&&(q.push(D[1]),U.unshift(D[2])),U.length&&(m="/"+U.join(".")+m),this.hostname=q.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=r.toASCII(this.hostname));var B=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+B,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!b[S])for(T=0,I=l.length;T0)&&n.host.split("@"))&&(n.auth=M.shift(),n.host=n.hostname=M.shift());return n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var x=k.slice(-1)[0],O=(n.host||t.host||k.length>1)&&("."===x||".."===x)||""===x,T=0,R=k.length;R>=0;R--)"."===(x=k[R])?k.splice(R,1):".."===x?(k.splice(R,1),T++):T&&(k.splice(R,1),T--);if(!w&&!S)for(;T--;T)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),O&&"/"!==k.join("/").substr(-1)&&k.push("");var M,j=""===k[0]||k[0]&&"/"===k[0].charAt(0);E&&(n.hostname=n.host=j?"":k.length?k.shift():"",(M=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=M.shift(),n.host=n.hostname=M.shift()));return(w=w||n.host&&k.length)&&!j&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},UcPO:function(t,e,n){t.exports=n("vzCy").EventEmitter},Un6J:function(t,e,n){"use strict";t.exports=n("jI27")()?Math.sign:n("pdyO")},VqMg:function(t,e,n){"use strict";var r,i,o,s,a=n("pUTq"),u=n("/HOs"),c=Object.create,l=Object.defineProperties,h=Object.defineProperty,f=Object.prototype,p=c(null);if("function"==typeof Symbol){r=Symbol;try{String(r()),s=!0}catch(t){}}var d,b=(d=c(null),function(t){for(var e,n,r=0;d[t+(r||"")];)++r;return d[t+=r||""]=!0,h(f,e="@@"+t,a.gs(null,function(t){n||(n=!0,h(this,e,a(t)),n=!1)})),e});o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},t.exports=i=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?r(e):(n=c(o.prototype),e=void 0===e?"":String(e),l(n,{__description__:a("",e),__name__:a("",b(e))}))},l(i,{for:a(function(t){return p[t]?p[t]:p[t]=i(String(t))}),keyFor:a(function(t){var e;for(e in u(t),p)if(p[e]===t)return e}),hasInstance:a("",r&&r.hasInstance||i("hasInstance")),isConcatSpreadable:a("",r&&r.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",r&&r.iterator||i("iterator")),match:a("",r&&r.match||i("match")),replace:a("",r&&r.replace||i("replace")),search:a("",r&&r.search||i("search")),species:a("",r&&r.species||i("species")),split:a("",r&&r.split||i("split")),toPrimitive:a("",r&&r.toPrimitive||i("toPrimitive")),toStringTag:a("",r&&r.toStringTag||i("toStringTag")),unscopables:a("",r&&r.unscopables||i("unscopables"))}),l(o.prototype,{constructor:a(i),toString:a("",function(){return this.__name__})}),l(i.prototype,{toString:a(function(){return"Symbol ("+u(this).__description__+")"}),valueOf:a(function(){return u(this)})}),h(i.prototype,i.toPrimitive,a("",function(){var t=u(this);return"symbol"==typeof t?t:t.toString()})),h(i.prototype,i.toStringTag,a("c","Symbol")),h(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),h(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},WXiP:function(t,e,n){"use strict";var r=n("ypnx"),i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=h;var o=Object.create(n("jOgh"));o.inherits=n("LC74");var s=n("pnTe"),a=n("1dDJ");o.inherits(h,s);for(var u=i(a.prototype),c=0;c>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function l(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function f(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(t.lastNeed=i-1),i;if(--r=0)return i>0&&(t.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},XUym:function(t,e,n){"use strict";t.exports=n("+Zc3")()?String.prototype.contains:n("usXS")},XzfY:function(t,e){t.exports=function(t){var e=t._readableState;return e?e.objectMode?t.read():t.read((n=e,n.buffer.length?n.buffer.head?n.buffer.head.data.length:n.buffer[0].length:n.length)):null;var n}},Y7BN:function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},cSWu:function(t,e,n){(e=t.exports=n("Rt1F")).Stream=e,e.Readable=e,e.Writable=n("7dSG"),e.Duplex=n("DsFX"),e.Transform=n("D1Va"),e.PassThrough=n("f48b")},"dcD+":function(t,e,n){"use strict";(function(e){var r=n("q+vg"),i=n("cSWu").Readable,o={objectMode:!0},s={clean:!0},a=n("eDZ4");function u(t){if(!(this instanceof u))return new u(t);this.options=t||{},this.options=r(s,t),this._inflights=new a}u.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this},u.prototype.createStream=function(){var t=new i(o),n=!1,r=[],s=0;return this._inflights.forEach(function(t,e){r.push(t)}),t._read=function(){!n&&s>8,0),e.writeUInt8(255&t,1),e}t.exports={cache:o,generateCache:function(){for(var t=0;t0&&c>u&&(c=u);for(var l=0;l=0?(h=b.substr(0,g),f=b.substr(g+1)):(h=b,f=""),p=decodeURIComponent(h),d=decodeURIComponent(f),r(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},kkc6:function(t,e,n){var r=n("EuP9"),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=s),o(i,s),s.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},s.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},ls4g:function(t,e,n){"use strict";var r=n("FunP"),i=n("LC74"),o=n("vzCy").EventEmitter,s=n("xP0J"),a=n("97+M");function u(){if(!(this instanceof u))return new u;this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState()}i(u,o),u.prototype._resetState=function(){this.packet=new s,this.error=null,this._list=r(),this._stateCounter=0},u.prototype.parse=function(t){for(this.error&&this._resetState(),this._list.append(t);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,this._stateCounter>=this._states.length&&(this._stateCounter=0);return this._list.length},u.prototype._parseHeader=function(){var t=this._list.readUInt8(0);return this.packet.cmd=a.types[t>>a.CMD_SHIFT],this.packet.retain=0!=(t&a.RETAIN_MASK),this.packet.qos=t>>a.QOS_SHIFT&a.QOS_MASK,this.packet.dup=0!=(t&a.DUP_MASK),this._list.consume(1),!0},u.prototype._parseLength=function(){for(var t,e=0,n=1,r=0,i=!0;e<5&&(r+=n*((t=this._list.readUInt8(e++))&a.LENGTH_MASK),n*=128,0!=(t&a.LENGTH_FIN_MASK));)if(this._list.length<=e){i=!1;break}return i&&(this.packet.length=r,this._list.consume(e)),i},u.prototype._parsePayload=function(){var t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseMessageId();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":case"disconnect":break;default:this._emitError(new Error("Not supported"))}t=!0}return t},u.prototype._parseConnect=function(){var t,e,n,r,i,o,s={},u=this.packet;if(null===(t=this._parseString()))return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==t&&"MQIsdp"!==t)return this._emitError(new Error("Invalid protocolId"));if(u.protocolId=t,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(u.protocolVersion=this._list.readUInt8(this._pos),3!==u.protocolVersion&&4!==u.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK,s.will&&(u.will={},u.will.retain=0!=(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),u.will.qos=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT),u.clean=0!=(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK),this._pos++,u.keepalive=this._parseNum(),-1===u.keepalive)return this._emitError(new Error("Packet too short"));if(null===(e=this._parseString()))return this._emitError(new Error("Packet too short"));if(u.clientId=e,s.will){if(null===(n=this._parseString()))return this._emitError(new Error("Cannot parse will topic"));if(u.will.topic=n,null===(r=this._parseBuffer()))return this._emitError(new Error("Cannot parse will payload"));u.will.payload=r}if(s.username){if(null===(o=this._parseString()))return this._emitError(new Error("Cannot parse username"));u.username=o}if(s.password){if(null===(i=this._parseBuffer()))return this._emitError(new Error("Cannot parse password"));u.password=i}return u},u.prototype._parseConnack=function(){var t=this.packet;return this._list.length<2?null:(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&a.SESSIONPRESENT_MASK),t.returnCode=this._list.readUInt8(this._pos),-1===t.returnCode?this._emitError(new Error("Cannot parse return code")):void 0)},u.prototype._parsePublish=function(){var t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(new Error("Cannot parse topic"));t.qos>0&&!this._parseMessageId()||(t.payload=this._list.slice(this._pos,t.length))},u.prototype._parseSubscribe=function(){var t,e,n=this.packet;if(1!==n.qos)return this._emitError(new Error("Wrong subscribe header"));if(n.subscriptions=[],this._parseMessageId())for(;this._pos=n.length)return this._emitError(new Error("Malformed Subscribe Payload"));e=this._list.readUInt8(this._pos++),n.subscriptions.push({topic:t,qos:e})}},u.prototype._parseSuback=function(){if(this.packet.granted=[],this._parseMessageId())for(;this._posthis._list.length||r>this.packet.length?null:(e=this._list.toString("utf8",this._pos,r),this._pos+=n,e)},u.prototype._parseBuffer=function(){var t,e=this._parseNum(),n=e+this._pos;return-1===e||n>this._list.length||n>this.packet.length?null:(t=this._list.slice(this._pos,n),this._pos+=e,t)},u.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var t=this._list.readUInt16BE(this._pos);return this._pos+=2,t},u.prototype._newPacket=function(){return this.packet&&(this._list.consume(this.packet.length),this.emit("packet",this.packet)),this.packet=new s,!0},u.prototype._emitError=function(t){this.error=t,this.emit("error",t)},t.exports=u},ngph:function(t,e,n){"use strict";t.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},oHQg:function(t,e,n){"use strict";var r=n("JUqv"),i=n("9SgR"),o=n("h+QR"),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;t.exports=function(t){var e,n,l,h;if(!r(t))return s.apply(this,arguments);for(n=i(o(this).length),l=arguments[1],e=l=isNaN(l)?0:l>=0?c(l):i(this.length)-c(u(l));e=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n})}),u(r.prototype,s.toStringTag,o("c","String Iterator"))},pBXs:function(t,e,n){"use strict";e.parser=n("ls4g"),e.generate=n("w5pw"),e.writeToStream=n("L0Xt")},pUTq:function(t,e,n){"use strict";var r=n("RDPa"),i=n("0eJ/"),o=n("Kqp3"),s=n("XUym");(t.exports=function(t,e){var n,o,a,u,c;return arguments.length<2||"string"!=typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(n=a=!0,o=!1):(n=s.call(t,"c"),o=s.call(t,"e"),a=s.call(t,"w")),c={value:e,configurable:n,enumerable:o,writable:a},u?r(i(u),c):c}).gs=function(t,e,n){var a,u,c,l;return"string"!=typeof t?(c=n,n=e,e=t,t=null):c=arguments[3],null==e?e=void 0:o(e)?null==n?n=void 0:o(n)||(c=n,n=void 0):(c=e,e=n=void 0),null==t?(a=!0,u=!1):(a=s.call(t,"c"),u=s.call(t,"e")),l={get:e,set:n,configurable:a,enumerable:u},c?r(i(c),l):l}},pdyO:function(t,e,n){"use strict";t.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},pnTe:function(t,e,n){"use strict";(function(e,r){var i=n("ypnx");t.exports=m;var o,s=n("sOR5");m.ReadableState=_;n("vzCy").EventEmitter;var a=function(t,e){return t.listeners(e).length},u=n("L5oL"),c=n("wAG3").Buffer,l=e.Uint8Array||function(){};var h=Object.create(n("jOgh"));h.inherits=n("LC74");var f=n(5),p=void 0;p=f&&f.debuglog?f.debuglog("stream"):function(){};var d,b=n("NguZ"),g=n("s5W+");h.inherits(m,u);var y=["error","close","destroy","pause","resume"];function _(t,e){o=o||n("WXiP"),t=t||{};var r=e instanceof o;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n("X4X3").StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function m(t){if(o=o||n("WXiP"),!(this instanceof m))return new m(t);this._readableState=new _(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function v(t,e,n,r,i){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,E(t)}(t,s)):(i||(o=function(t,e){var n;r=e,c.isBuffer(r)||r instanceof l||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=function(t){return c.from(t)}(e)),r?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(t,s,e,!1):O(t,s)):w(t,s,e,!1))):r||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=S?t=S:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function E(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(x,t):x(t))}function x(t){p("emit readable"),t.emit("readable"),j(t)}function O(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(T,t,e))}function T(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var r;to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),0===(t-=s)){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}(t,e):function(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;for(;r=r.next;){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}(t,e);return r}(t,e.buffer,e.decoder),n);var n}function A(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(C,e,t))}function C(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function P(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?A(this):E(this),null;if(0===(t=k(t,e))&&e.ended)return 0===e.length&&A(this),null;var r,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t0?I(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&A(this)),null!==r&&this.emit("data",r),r},m.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},m.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:m;function c(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",y),t.removeListener("finish",_),t.removeListener("drain",h),t.removeListener("error",g),t.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",m),n.removeListener("data",b),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function l(){p("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",c);var h=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,j(t))}}(n);t.on("drain",h);var f=!1;var d=!1;function b(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==P(o.pipes,t))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(e){p("onerror",e),m(),t.removeListener("error",g),0===a(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",_),m()}function _(){p("onfinish"),t.removeListener("close",y),m()}function m(){p("unpipe"),n.unpipe(t)}return n.on("data",b),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",g),t.once("close",y),t.once("finish",_),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},m.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;ob)return void setTimeout(t,g,e,n,r);y&&"string"==typeof e&&(e=a.from(e,"utf8"));try{l.send(e)}catch(t){return r(t)}r()}:function(t,e,n){if(l.readyState!==l.OPEN)return void n();y&&"string"==typeof t&&(t=a.from(t,"utf8"));l.send(t,n)};n&&!Array.isArray(n)&&"object"==typeof n&&(u=n,n=null,("string"==typeof u.protocol||Array.isArray(u.protocol))&&(n=u.protocol));u||(u={});void 0===u.objectMode&&(u.objectMode=!(!0===u.binary||void 0===u.binary));var d=function(t,e,n){var r=new i({objectMode:t.objectMode});return r._write=e,r._flush=n,r}(u,p,function(t){l.close(),t()});u.objectMode||(d._writev=_);var b=u.browserBufferSize||524288,g=u.browserBufferTimeout||1e3;"object"==typeof t?l=t:(l=f&&h?new s(t,n):new s(t,n,u)).binaryType="arraybuffer";l.readyState===l.OPEN?c=d:(c=c=o(void 0,void 0,u),u.objectMode||(c._writev=_),l.onopen=function(){c.setReadable(d),c.setWritable(d),c.emit("connect")});c.socket=l,l.onclose=function(){c.end(),c.destroy()},l.onerror=function(t){c.destroy(t)},l.onmessage=function(t){var e=t.data;e=e instanceof ArrayBuffer?a.from(e):a.from(e,"utf8");d.push(e)},d.on("close",function(){l.close()});var y=!u.objectMode;function _(t,e){for(var n=new Array(t.length),r=0;r>1,l=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=r;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},e.write=function(t,e,n,r,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*u-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[n+p]=255&s,p+=d,s/=256,c-=8);t[n+p-d]|=128*b}},usXS:function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},"vU9/":function(t,e,n){"use strict";var r=!1,i=[];function o(t){r?wx.sendSocketMessage({data:t.buffer||t}):i.push(t)}var s=n("ty6G");function a(t,e){var n="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";!function(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}(e);var a=function(t,e){var n="wxs"===t.protocol?"wss":"ws",r=n+"://"+t.hostname+t.path;return t.port&&80!==t.port&&443!==t.port&&(r=n+"://"+t.hostname+":"+t.port+t.path),"function"==typeof t.transformWsUrl&&(r=t.transformWsUrl(r,t,e)),r}(e,t);return s(function(t,e){var n={OPEN:1,CLOSING:2,CLOSED:3,readyState:r?1:0,send:o,close:wx.closeSocket,onopen:null,onmessage:null,onclose:null,onerror:null};return wx.connectSocket({url:t,protocols:e}),wx.onSocketOpen(function(t){n.readyState=n.OPEN,r=!0;for(var e=0;e0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function h(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var c=u.length,l=d(u,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},w3jH:function(t,e,n){"use strict";(function(e){var r=n("ty6G"),i=n("UZ5h"),o=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],s="browser"===e.title;function a(t,e){var n="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";!function(t){t.hostname||(t.hostname="localhost"),t.port||("wss"===t.protocol?t.port=443:t.port=80),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={}),s||"wss"!==t.protocol||o.forEach(function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])})}(e);var i=function(t,e){var n=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"==typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,e)),n}(e,t);return r(i,[n],e.wsOptions)}t.exports=s?function(t,e){if(e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");var n=i.parse(document.URL);e.hostname=n.hostname,e.port||(e.port=n.port)}return a(t,e)}:function(t,e){return a(t,e)}}).call(e,n("W2nU"))},w5pw:function(t,e,n){"use strict";var r=n("X3l8").Buffer,i=n("L0Xt"),o=n("vzCy").EventEmitter;function s(){this._array=new Array(20),this._i=0}n("LC74")(s,o),s.prototype.write=function(t){return this._array[this._i++]=t,!0},s.prototype.concat=function(){var t,e,n=0,i=new Array(this._array.length),o=this._array,s=0;for(t=0;t=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,n){e>=t&&(this.__redo__[n]=++e)},this),this.__redo__.push(t)):h(this,"__redo__",u("c",[t])))}),_onDelete:u(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,n){e>t&&(this.__redo__[n]=--e)},this)))}),_onClear:u(function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0})}))),h(r.prototype,l.iterator,u(function(){return this}))},x0Ha:function(t,e,n){"use strict";var r=n("ypnx");function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(r.nextTick(i,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},xP0J:function(t,e){t.exports=function(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}},xaZU:function(t,e,n){"use strict";var r=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,n,a){return e=e||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?o(s(t),function(s){var a=encodeURIComponent(r(s))+n;return i(t[s])?o(t[s],function(t){return a+encodeURIComponent(r(t))}).join(e):a+encodeURIComponent(r(t[s]))}).join(e):a?encodeURIComponent(r(a))+n+encodeURIComponent(r(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var n=[],r=0;r