kevoree-group-remotews
Version:
A Kevoree group that uses an external remote WebSocket broadcast server to share models.<br/>The attribute <strong>answerPull</strong> specifies whether the fragments must send their model back on pull requests.
1 lines • 38.8 kB
JavaScript
!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=16)}([function(t,e,n){"use strict";function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(t){if(f===setTimeout)return setTimeout(t,0);if((f===r||!f)&&setTimeout)return f=setTimeout,setTimeout(t,0);try{return f(t,0)}catch(e){try{return f.call(null,t,0)}catch(e){return f.call(this,t,0)}}}function s(t){if(p===clearTimeout)return clearTimeout(t);if((p===o||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function u(){m&&y&&(m=!1,y.length?h=y.concat(h):v=-1,h.length&&c())}function c(){if(!m){var t=i(u);m=!0;for(var e=h.length;e;){for(y=h,h=[];++v<e;)y&&y[v].run();v=-1,e=h.length}y=null,m=!1,s(t)}}function a(t,e){this.fun=t,this.array=e}function l(){}var f,p,d=t.exports={};!function(){try{f="function"==typeof setTimeout?setTimeout:r}catch(t){f=r}try{p="function"==typeof clearTimeout?clearTimeout:o}catch(t){p=o}}();var y,h=[],m=!1,v=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];h.push(new a(t,e)),1!==h.length||m||i(c)},a.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=l,d.addListener=l,d.once=l,d.off=l,d.removeListener=l,d.removeAllListeners=l,d.emit=l,d.prependListener=l,d.prependOnceListener=l,d.listeners=function(t){return[]},d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";function r(t){return null!=t&&i(t.length)&&!o(t)}var o=n(28),i=n(13);t.exports=r},function(t,e,n){"use strict";function r(t){return null==t?void 0===t?c:u:a&&a in Object(t)?i(t):s(t)}var o=n(9),i=n(29),s=n(30),u="[object Null]",c="[object Undefined]",a=o?o.toStringTag:void 0;t.exports=r},function(t,e,n){"use strict";var r,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":o(window))&&(r=window)}t.exports=r},function(t,e,n){"use strict";function r(t,e){e|=0;for(var n=Math.max(t.length-e,0),r=Array(n),o=0;o<n;o++)r[o]=t[e+o];return r}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,n){"use strict";function r(t){return null!=t&&"object"==(void 0===t?"undefined":o(t))}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=r},function(t,e){t.exports=KevoreeLibrary},function(t,e,n){"use strict";function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function o(t){return"function"==typeof t}function i(t){return"number"==typeof t}function s(t){return"object"===(void 0===t?"undefined":c(t))&&null!==t}function u(t){return void 0===t}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,n,r,i,c,a;if(this._events||(this._events={}),"error"===t&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var l=new Error('Uncaught, unspecified "error" event. ('+e+")");throw l.context=e,l}if(n=this._events[t],u(n))return!1;if(o(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),n.apply(this,i)}else if(s(n))for(i=Array.prototype.slice.call(arguments,1),a=n.slice(),r=a.length,c=0;c<r;c++)a[c].apply(this,i);return!0},r.prototype.addListener=function(t,e){var n;if(!o(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,o(e.listener)?e.listener:e),this._events[t]?s(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,s(this._events[t])&&!this._events[t].warned&&(n=u(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!o(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,i,u;if(!o(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],i=n.length,r=-1,n===e||o(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(s(n)){for(u=i;u-- >0;)if(n[u]===e||n[u].listener&&n[u].listener===e){r=u;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],o(n))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?o(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(o(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";function r(){}t.exports=r},function(t,e,n){"use strict";var r=n(10),o=r.Symbol;t.exports=o},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(11),i="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,s=o||i||Function("return this")();t.exports=s},function(t,e,n){"use strict";(function(e){var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r="object"==(void 0===e?"undefined":n(e))&&e&&e.Object===Object&&e;t.exports=r}).call(e,n(3))},function(t,e,n){"use strict";function r(t){var e=void 0===t?"undefined":o(t);return null!=t&&("object"==e||"function"==e)}var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=r},function(t,e,n){"use strict";function r(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}var o=9007199254740991;t.exports=r},function(t,e,n){"use strict";function r(t){return u&&"AsyncFunction"===t[Symbol.toStringTag]}function o(t){return r(t)?(0,s.default)(t):t}Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=void 0;var i=n(31),s=function(t){return t&&t.__esModule?t:{default:t}}(i),u="function"==typeof Symbol;e.default=o,e.isAsync=r},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var r=n(17),o=n(18),i=n(19);r.register(o.name,o.version,i)},function(t,e){t.exports=KevoreeModuleLoader},function(t,e){t.exports={name:"kevoree-group-remotews",version:"5.3.15",main:"./lib/RemoteWSGroup.js",description:"A Kevoree group that uses an external remote WebSocket broadcast server to share models.<br/>The attribute <strong>answerPull</strong> specifies whether the fragments must send their model back on pull requests.",kevoree:{namespace:"kevoree",browser:"lib/browser.js"},scripts:{prestart:"npm run build",pretest:"npm run build",prepublishOnly:"npm run test",start:"kevoree-scripts start",build:"kevoree-scripts build",test:"mocha test","kev:publish":"kevoree-scripts publish",postpublish:"npm run kev:publish"},keywords:["kevoree-std-lib","kevoree","library","group"],author:"Maxime Tricoire <max.tricoire@gmail.com>",contributors:[],license:"LGPL-3.0",browser:{ws:"./ws-shim.js"},dependencies:{"kevoree-entities":"^9.2.4","kevoree-library":"^5.0.13","smart-socket":"^0.5.0"},devDependencies:{eslint:"^4.3.0","eslint-config-kevoree":"^1.0.1",expect:"^1.20.2","kevoree-scripts":"^1.1.2",mocha:"^3.4.2"},homepage:"https://github.com/kevoree/kevoree-js",repository:{type:"git",url:"https://github.com/kevoree/kevoree-js-group-remotews.git"},bugs:{url:"https://github.com/kevoree/kevoree-js-group-remotews/issues"}}},function(t,e,n){"use strict";var r=n(20),o=n(24),i=n(6),s=r.extend({toString:"RemoteWSGroup",tdef_version:1,dic_host:{optional:!1},dic_port:{optional:!0,defaultValue:80},dic_path:{optional:!0,defaultValue:"/"},dic_answerPull:{optional:!1,fragmentDependant:!0,defaultValue:!0},start:function(t){var e=this,n=this.dictionary.getString("host"),r=this.dictionary.getNumber("port",80),s=this.dictionary.getString("path","");if(!n)return void t(new Error('"host" attribute is not specified'));"/"===s.substr(0,1)&&(s=s.substr(1,s.length-1));var u=n+":"+r+"/"+s;this.ss=new o({addresses:[u],loopBreak:5e3}),this.ss.on("open",function(t){e.log.info("connected to "+u),e.getKevoreeCore().on("deployed",e.deployedHandler(t))}),this.ss.on("message",function(t,n){n.type&&(n=n.data);try{var r=new i.factory.DefaultKevoreeFactory;if(n.startsWith("push/")){e.log.info("received a push request");var o=r.createJSONLoader().loadModelFromString(n.substr("push/".length,n.length-1)).get(0);e.lock=!0;var s=function(){e.lock=!1};e.getKevoreeCore().deploy(o).then(s,s)}else if("pull"===n)if(e.dictionary.getBoolean("answerPull",e.dic_answerPull.defaultValue)){e.log.info("received a pull request");var u=r.createJSONSerializer(),c=u.serialize(e.getKevoreeCore().getCurrentModel());t.send(c)}else e.log.info("received a pull request, but 'answerPull' mode is false");else n.toString().length>30&&(n=n.toString().substr(0,30)+"..."),e.log.debug("unknown incoming message ("+n+")")}catch(t){n.toString().length>30&&(n=n.toString().substr(0,30)+"..."),e.log.warn("unable to process incoming message ("+n+")"),e.log.error(t.stack)}}),this.ss.on("close",function(){e.log.info("connection lost with "+u+" (will retry every 5000ms until reconnected)")}),this.ss.on("error",function(){e.log.info("connection problem with "+u+" (will retry every 5000ms until connected)")}),this.ss.start(),t()},stop:function(t){this.getKevoreeCore().off("deployed",this.deployedHandler()),this.ss&&this.ss.close(!0),t()},update:function(t){var e=this;this.stop(function(){e.start(t)})},deployedHandler:function(t){var e=this,n=this.getKevoreeCore();return function(){if(!e.lock&&t&&1===t.readyState){var r=new i.factory.DefaultKevoreeFactory,o=r.createJSONSerializer(),s=o.serialize(n.getCurrentModel());t.send("push/"+s)}}}});t.exports=s},function(t,e,n){"use strict";var r=n(21),o=r.extend({toString:"AbstractGroup",updateModel:function(t){this.kCore.deploy(t)}});t.exports=o},function(t,e,n){"use strict";var r=n(22),o=n(23),i=r({toString:"KevoreeEntity",construct:function(t,e,n){this.kCore=t,this.nodeName=n,this.name=e.name,this.path=e.path(),this.started=!1,this.dictionary=new o(this),this.log=this.kCore.getLoggerFactory().create(e.typeDefinition.name,e.name)},start:function(t){t()},stop:function(t){t()},update:function(t){t()},__start__:function(t){this.started=!0,this.start(t)},__stop__:function(t){this.started=!1,this.stop(t)},__update__:function(t){this.update(t)},__destruct__:function(){this.kCore.getLoggerFactory().delete(this.log)},getKevoreeCore:function(){return this.kCore},getDictionary:function(){return this.dictionary},getName:function(){return this.name},getNodeName:function(){return this.nodeName},getPath:function(){return this.path},getModelEntity:function(){var t=this.kCore.getDeployModel();return t||(t=this.kCore.getCurrentModel()),t.findByPath(this.path)},getNetworkInfos:function(t){var e=this.kCore.getDeployModel();e||this.kCore.getCurrentModel();var n=e.findNodesByID(t);return n?n.networkInformation.iterator():null},isStarted:function(){return this.started},submitScript:function(t,e){this.getKevoreeCore().submitScript(t,e)}});i.DIC="dic_",t.exports=i},function(t,e,n){"use strict";!function(e){function n(){var t,e,n,r,o;for(n=arguments,t=0,e=n.length;t<e;t++){r=n[t];for(o in r)this[o]=r[o]}return this}function r(t){return function(){return this[t].apply(this,arguments)}}function o(t,e){var o,i,s,u,c,a;t.properties=e,c={},o=t;do{if(o.properties)for(s in o.properties)a=c[s]||(c[s]=[]),a.unshift(o.properties[s]);o=o.superConstructor}while(o);u={};for(s in c)i=u[s]=n.apply({},c[s]),"string"==typeof i.set&&(i.set=r(i.set)),"string"==typeof i.get&&(i.get=r(i.get));t.properties=u}var i=function(){},s=/xyz/.test(function(){return"xyz"})?/\._super\b/:{test:function(){return!0}},u=function(t,e,n){return function(){var r=this._super;this._super=n[t];var o=e.apply(this,arguments);return this._super=r,o}},c=function(t,e,n){var r=n[t];return function(){return this._super=r,e.apply(this,arguments)}},a=function(t,e){e=e||this.constructor&&this.constructor.prototype;for(var n in t){var r=t[n];if("construct"!==n&&"destruct"!==n){e&&"function"==typeof r&&"function"==typeof e[n]&&s.test(r)?this.hasOwnProperty(n)?this[n]=c(n,r,this):this[n]=u(n,r,e):this[n]=r}}},l=function t(e){return e&&e.extend?e.extend.extend(e):t.extend(e)};l.prototype.mixin=a,l.extend=function t(e){function n(){if(this instanceof n==!1)throw new Error("Cannot create instance without new operator");var t=n.properties;t&&Object.defineProperties(this,t),this.construct.apply(this,arguments),this.init()}var r=this,s=this.prototype;n.superConstructor=r,n.extend=t;var u=n.prototype=Object.create(s);if(u.constructor=n,u.superPrototype=s,e){var c=e.properties;if(delete e.properties,a.call(u,e,s),Array.isArray(e.mixins))for(var l=0,f=e.mixins.length;l<f;l++)a.call(u,e.mixins[l],u);if(o(n,c),e.construct){var p=e.construct;s.construct?u.construct=function(){s.construct.apply(this,arguments),p.apply(this,arguments)}:u.construct=p}if(e.destruct){var d=e.destruct;s.destruct?u.destruct=function(){d.apply(this,arguments),s.destruct.apply(this,arguments)}:u.destruct=d}if("string"==typeof e.toString){var y=e.toString;u.toString=function(){return y}}}return"function"!=typeof u.construct&&(u.construct=i),"function"!=typeof u.init&&(u.init=i),n},void 0!==t&&t.exports?t.exports=l:"function"==typeof e.define?function(t){t(function(){return l})}(e.define):(e.PseudoClass=l,e.Class||(e.Class=l))}(void 0)},function(t,e,n){"use strict";function r(t){this.entity=t,this.emitter=new i.EventEmitter,this.map={}}var o=n(6),i=n(7);r.prototype={on:function(t,e){this.emitter.addListener(t,e.bind(this.entity))},off:function(t,e){this.emitter.removeListener(t,e)},getValue:function(t){return this.map[t]},getBoolean:function(t,e){var n=this.map[t];return"true"===n||"false"===n?"true"===n:(void 0===e&&(e=!1),e)},getString:function(t,e){var n=this.map[t];return"string"==typeof n?n:("string"!=typeof e&&(e=null),e)},getNumber:function(t,e){var n=void 0;return n=this.map[t]&&0===this.map[t].length?null:+this.map[t],isNaN(n)?"number"!=typeof e?null:e:n},setValue:function(t,e){var n=new o.factory.DefaultKevoreeFactory,r=this.entity.getModelEntity();r.dictionary||(r.dictionary=n.createDictionary()),e=r.dictionary.findValuesByID(t),e||(e=n.createDictionaryValue(),e.name=t,r.dictionary.addValues(e)),e.value=e,this.setEntry(t,e)},setEntry:function(t,e){var n=this.map[t];this.map[t]=e,this.entity.isStarted()&&this.emitter.emit(t,e,n)},setMap:function(t){var e=void 0;if(Object.keys(this.map).length>0)for(var n in t){var r=!1;for(e in this.map)if(n===e){var o=this.map[e];o!==t[e]&&(this.map[e]=t[e],this.emitter.emit(e,this.map[e],o)),r=!0}r||(this.map[n]=t[n])}else this.map=t},getMap:function(){return this.map},cloneMap:function(){var t={};for(var e in this.map)t[e]=this.map[e];return t},toString:function(){return"Dictionary"}},t.exports=r},function(t,e,n){"use strict";(function(e){var r=n(25),o=n(26),i=n(62),s=n(7).EventEmitter,u=function(){},c=function(t){this.stopped=!1,this.id=null,this.wsConn=null;var e=t.handlers||{};this.onopen=e.onopen||u,this.onclose=e.onclose||u,this.onerror=e.onerror||u,this.onmessage=e.onmessage||u,this.addresses=t.addresses||[],this.timeout=t.timeout||1e4,this.loopBreak=t.loopBreak||2e3,this.debug=t.debug||!1,this.on("error",u)};i.inherits(c,s),c.prototype.start=function(){function t(){n.emit("loopStart"),o(i,function(e){if(e)return n.wsConn=e,void n.emit("loopEnd");n.stopped||(n.debug&&console.log("Retry in "+n.loopBreak+"ms"),setTimeout(t,n.loopBreak),n.emit("loopIn",n.loopBreak))})}var n=this,i=[];i=this.addresses.map(function(e){return function(o){n.debug&&console.log("Trying to connect to ws://"+e);var i=new r("ws://"+e),s=setTimeout(function(){try{n.debug&&console.log("Closing ws://"+e+" connection attempt (smart-socket timeout)"),i.close()}catch(t){}},n.timeout);i.wasOpen=!1,i.onopen=function(t){clearTimeout(s),n.debug&&console.log("Connection to "+e+" established."),i.wasOpen=!0,n.onopen.apply(i,[i,t]),n.emit("open",i,t),o(i)},i.onerror=function(t){clearTimeout(s),n.debug&&console.log("Error: "+e,t.message),n.onerror.apply(i,[i,t]),n.emit("error",i,t),o(null)},i.onclose=function(r){clearTimeout(s),n.debug&&console.log("Close: "+e,r),n.onclose.apply(i,[i,r]),n.emit("close",i,r),i.wasOpen&&!n.stopped&&t()},i.onmessage=function(t){n.debug&&console.log("Message: "+e,t.data),n.onmessage.apply(i,[i,t]),n.emit("message",i,t)}}}),e.nextTick(t)},c.prototype.stop=function(){this.stopped=!0,clearTimeout(this.id),this.id=null,this.debug&&console.log("SmartSocket loop stopped")},c.prototype.close=function(t){void 0===t&&(t=!0),t&&this.stop(),this.wsConn&&1===this.wsConn.readyState&&this.wsConn.close()},t.exports=c}).call(e,n(0))},function(t,e,n){"use strict";function r(){throw new Error("WebSocketServer are not supported in browser environment.")}WebSocket.prototype.on=function(t,e){this["on"+t]=e},WebSocket.prototype.off=function(t,e){"function"==typeof e&&this["on"+t]===e&&delete this["on"+t]},t.exports=WebSocket,t.exports.Server=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){(0,s.default)(c.default,t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var i=n(27),s=r(i),u=n(36),c=r(u);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){n=n||s.default;var r=(0,c.default)(e)?[]:{};t(e,function(t,e,n){(0,p.default)(t)(function(t,o){arguments.length>2&&(o=(0,l.default)(arguments,1)),r[e]=o,n(t)})},function(t){n(t,r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var i=n(8),s=r(i),u=n(1),c=r(u),a=n(4),l=r(a),f=n(14),p=r(f);t.exports=e.default},function(t,e,n){"use strict";function r(t){if(!i(t))return!1;var e=o(t);return e==u||e==c||e==s||e==a}var o=n(2),i=n(12),s="[object AsyncFunction]",u="[object Function]",c="[object GeneratorFunction]",a="[object Proxy]";t.exports=r},function(t,e,n){"use strict";function r(t){var e=s.call(t,c),n=t[c];try{t[c]=void 0;var r=!0}catch(t){}var o=u.call(t);return r&&(e?t[c]=n:delete t[c]),o}var o=n(9),i=Object.prototype,s=i.hasOwnProperty,u=i.toString,c=o?o.toStringTag:void 0;t.exports=r},function(t,e,n){"use strict";function r(t){return i.call(t)}var o=Object.prototype,i=o.toString;t.exports=r},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return(0,l.default)(function(e,n){var r;try{r=t.apply(this,e)}catch(t){return n(t)}(0,c.default)(r)&&"function"==typeof r.then?r.then(function(t){i(n,null,t)},function(t){i(n,t.message?t:new Error(t))}):n(null,r)})}function i(t,e,n){try{t(e,n)}catch(t){(0,p.default)(s,t)}}function s(t){throw t}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var u=n(12),c=r(u),a=n(32),l=r(a),f=n(33),p=r(f);t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){var e=(0,o.default)(arguments),n=e.pop();t.call(this,e,n)}};var r=n(4),o=function(t){return t&&t.__esModule?t:{default:t}}(r);t.exports=e.default},function(t,e,n){"use strict";(function(t,r){function o(t){setTimeout(t,0)}function i(t){return function(e){var n=(0,a.default)(arguments,1);t(function(){e.apply(null,n)})}}var s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Object.defineProperty(e,"__esModule",{value:!0}),e.hasNextTick=e.hasSetImmediate=void 0,e.fallback=o,e.wrap=i;var u,c=n(4),a=function(t){return t&&t.__esModule?t:{default:t}}(c),l=e.hasSetImmediate="function"==typeof t&&t,f=e.hasNextTick="object"===(void 0===r?"undefined":s(r))&&"function"==typeof r.nextTick;u=l?t:f?r.nextTick:o,e.default=i(u)}).call(e,n(34).setImmediate,n(0))},function(t,e,n){"use strict";function r(t,e){this._id=t,this._clearFn=e}var o=Function.prototype.apply;e.setTimeout=function(){return new r(o.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(35),e.setImmediate=setImmediate,e.clearImmediate=clearImmediate},function(t,e,n){"use strict";(function(t,e){!function(t,n){function r(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return a[c]=r,u(c),c++}function o(t){delete a[t]}function i(t){var e=t.callback,r=t.args;switch(r.length){case 0:e();break;case 1:e(r[0]);break;case 2:e(r[0],r[1]);break;case 3:e(r[0],r[1],r[2]);break;default:e.apply(n,r)}}function s(t){if(l)setTimeout(s,0,t);else{var e=a[t];if(e){l=!0;try{i(e)}finally{o(t),l=!1}}}}if(!t.setImmediate){var u,c=1,a={},l=!1,f=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?function(){u=function(t){e.nextTick(function(){s(t)})}}():function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&s(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),u=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){s(t.data)},u=function(e){t.port2.postMessage(e)}}():f&&"onreadystatechange"in f.createElement("script")?function(){var t=f.documentElement;u=function(e){var n=f.createElement("script");n.onreadystatechange=function(){s(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():function(){u=function(t){setTimeout(s,0,t)}}(),p.setImmediate=r,p.clearImmediate=o}}("undefined"==typeof self?void 0===t?void 0:t:self)}).call(e,n(3),n(0))},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(37),i=r(o),s=n(61),u=r(s);e.default=(0,u.default)(i.default,1),t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n,r){(0,s.default)(e)(t,(0,c.default)(n),r)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var i=n(38),s=r(i),u=n(14),c=r(u);t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){return function(e,n,r){function o(t,e){if(f-=1,t)a=!0,r(t);else{if(e===y.default||a&&f<=0)return a=!0,r(null);i()}}function i(){for(;f<t&&!a;){var e=u();if(null===e)return a=!0,void(f<=0&&r(null));f+=1,n(e.value,e.key,(0,p.default)(o))}}if(r=(0,c.default)(r||s.default),t<=0||!e)return r(null);var u=(0,l.default)(e),a=!1,f=0;i()}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o;var i=n(8),s=r(i),u=n(39),c=r(u),a=n(40),l=r(a),f=n(59),p=r(f),d=n(60),y=r(d);t.exports=e.default},function(t,e,n){"use strict";function r(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t){var e=-1,n=t.length;return function(){return++e<n?{value:t[e],key:e}:null}}function i(t){var e=-1;return function(){var n=t.next();return n.done?null:(e++,{value:n.value,key:e})}}function s(t){var e=(0,d.default)(t),n=-1,r=e.length;return function(){var o=e[++n];return n<r?{value:t[o],key:o}:null}}function u(t){if((0,a.default)(t))return o(t);var e=(0,f.default)(t);return e?i(e):s(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=u;var c=n(1),a=r(c),l=n(41),f=r(l),p=n(42),d=r(p);t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return r&&t[r]&&t[r]()};var r="function"==typeof Symbol&&Symbol.iterator;t.exports=e.default},function(t,e,n){"use strict";function r(t){return s(t)?o(t):i(t)}var o=n(43),i=n(55),s=n(1);t.exports=r},function(t,e,n){"use strict";function r(t,e){var n=s(t),r=!n&&i(t),l=!n&&!r&&u(t),p=!n&&!r&&!l&&a(t),d=n||r||l||p,y=d?o(t.length,String):[],h=y.length;for(var m in t)!e&&!f.call(t,m)||d&&("length"==m||l&&("offset"==m||"parent"==m)||p&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||c(m,h))||y.push(m);return y}var o=n(44),i=n(45),s=n(47),u=n(48),c=n(50),a=n(51),l=Object.prototype,f=l.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";function r(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}t.exports=r},function(t,e,n){"use strict";var r=n(46),o=n(5),i=Object.prototype,s=i.hasOwnProperty,u=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(t){return o(t)&&s.call(t,"callee")&&!u.call(t,"callee")};t.exports=c},function(t,e,n){"use strict";function r(t){return i(t)&&o(t)==s}var o=n(2),i=n(5),s="[object Arguments]";t.exports=r},function(t,e,n){"use strict";var r=Array.isArray;t.exports=r},function(t,e,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(10),i=n(49),s="object"==r(e)&&e&&!e.nodeType&&e,u=s&&"object"==r(t)&&t&&!t.nodeType&&t,c=u&&u.exports===s,a=c?o.Buffer:void 0,l=a?a.isBuffer:void 0,f=l||i;t.exports=f}).call(e,n(15)(t))},function(t,e,n){"use strict";function r(){return!1}t.exports=r},function(t,e,n){"use strict";function r(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||i.test(t))&&t>-1&&t%1==0&&t<e}var o=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=r},function(t,e,n){"use strict";var r=n(52),o=n(53),i=n(54),s=i&&i.isTypedArray,u=s?o(s):r;t.exports=u},function(t,e,n){"use strict";function r(t){return s(t)&&i(t.length)&&!!u[o(t)]}var o=n(2),i=n(13),s=n(5),u={};u["[object Float32Array]"]=u["[object Float64Array]"]=u["[object Int8Array]"]=u["[object Int16Array]"]=u["[object Int32Array]"]=u["[object Uint8Array]"]=u["[object Uint8ClampedArray]"]=u["[object Uint16Array]"]=u["[object Uint32Array]"]=!0,u["[object Arguments]"]=u["[object Array]"]=u["[object ArrayBuffer]"]=u["[object Boolean]"]=u["[object DataView]"]=u["[object Date]"]=u["[object Error]"]=u["[object Function]"]=u["[object Map]"]=u["[object Number]"]=u["[object Object]"]=u["[object RegExp]"]=u["[object Set]"]=u["[object String]"]=u["[object WeakMap]"]=!1,t.exports=r},function(t,e,n){"use strict";function r(t){return function(e){return t(e)}}t.exports=r},function(t,e,n){"use strict";(function(t){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=n(11),i="object"==r(e)&&e&&!e.nodeType&&e,s=i&&"object"==r(t)&&t&&!t.nodeType&&t,u=s&&s.exports===i,c=u&&o.process,a=function(){try{return c&&c.binding&&c.binding("util")}catch(t){}}();t.exports=a}).call(e,n(15)(t))},function(t,e,n){"use strict";function r(t){if(!o(t))return i(t);var e=[];for(var n in Object(t))u.call(t,n)&&"constructor"!=n&&e.push(n);return e}var o=n(56),i=n(57),s=Object.prototype,u=s.hasOwnProperty;t.exports=r},function(t,e,n){"use strict";function r(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||o)}var o=Object.prototype;t.exports=r},function(t,e,n){"use strict";var r=n(58),o=r(Object.keys,Object);t.exports=o},function(t,e,n){"use strict";function r(t,e){return function(n){return t(e(n))}}t.exports=r},function(t,e,n){"use strict";function r(t){return function(){if(null===t)throw new Error("Callback was already called.");var e=t;t=null,e.apply(this,arguments)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={},t.exports=e.default},function(t,e,n){"use strict";function r(t,e){return function(n,r,o){return t(n,e,r,o)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r,t.exports=e.default},function(t,e,n){"use strict";(function(t,r){function o(t,n){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h(n)?r.showHidden=n:n&&e._extend(r,n),S(r.showHidden)&&(r.showHidden=!1),S(r.depth)&&(r.depth=2),S(r.colors)&&(r.colors=!1),S(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=i),c(r,t,r.depth)}function i(t,e){var n=o.styles[e];return n?"["+o.colors[n][0]+"m"+t+"["+o.colors[n][1]+"m":t}function s(t,e){return t}function u(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function c(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,t);return g(o)||(o=c(t,o,r)),o}var i=a(t,n);if(i)return i;var s=Object.keys(n),h=u(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(n)),k(n)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(n);if(0===s.length){if(O(n)){var m=n.name?": "+n.name:"";return t.stylize("[Function"+m+"]","special")}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(j(n))return t.stylize(Date.prototype.toString.call(n),"date");if(k(n))return l(n)}var v="",b=!1,_=["{","}"];if(y(n)&&(b=!0,_=["[","]"]),O(n)){v=" [Function"+(n.name?": "+n.name:"")+"]"}if(w(n)&&(v=" "+RegExp.prototype.toString.call(n)),j(n)&&(v=" "+Date.prototype.toUTCString.call(n)),k(n)&&(v=" "+l(n)),0===s.length&&(!b||0==n.length))return _[0]+v+_[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var S;return S=b?f(t,n,r,h,s):s.map(function(e){return p(t,n,r,h,e,b)}),t.seen.pop(),d(S,v,_)}function a(t,e){if(S(e))return t.stylize("undefined","undefined");if(g(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return b(e)?t.stylize(""+e,"number"):h(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,o){for(var i=[],s=0,u=e.length;s<u;++s)L(e,String(s))?i.push(p(t,e,n,r,String(s),!0)):i.push("");return o.forEach(function(o){o.match(/^\d+$/)||i.push(p(t,e,n,r,o,!0))}),i}function p(t,e,n,r,o,i){var s,u,a;if(a=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]},a.get?u=a.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):a.set&&(u=t.stylize("[Setter]","special")),L(r,o)||(s="["+o+"]"),u||(t.seen.indexOf(a.value)<0?(u=m(n)?c(t,a.value,null):c(t,a.value,n-1),u.indexOf("\n")>-1&&(u=i?u.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return" "+t}).join("\n"))):u=t.stylize("[Circular]","special")),S(s)){if(i&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.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+": "+u}function d(t,e,n){var r=0;return t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function y(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return null==t}function b(t){return"number"==typeof t}function g(t){return"string"==typeof t}function _(t){return"symbol"===(void 0===t?"undefined":P(t))}function S(t){return void 0===t}function w(t){return x(t)&&"[object RegExp]"===M(t)}function x(t){return"object"===(void 0===t?"undefined":P(t))&&null!==t}function j(t){return x(t)&&"[object Date]"===M(t)}function k(t){return x(t)&&("[object Error]"===M(t)||t instanceof Error)}function O(t){return"function"==typeof t}function T(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"===(void 0===t?"undefined":P(t))||void 0===t}function M(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function L(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A=/%[sdj%]/g;e.format=function(t){if(!g(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(o(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,i=r.length,s=String(t).replace(A,function(t){if("%%"===t)return"%";if(n>=i)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<i;u=r[++n])m(u)||!x(u)?s+=" "+u:s+=" "+o(u);return s},e.deprecate=function(n,o){function i(){if(!s){if(r.throwDeprecation)throw new Error(o);r.traceDeprecation?console.trace(o):console.error(o),s=!0}return n.apply(this,arguments)}if(S(t.process))return function(){return e.deprecate(n,o).apply(this,arguments)};if(!0===r.noDeprecation)return n;var s=!1;return i};var I,D={};e.debuglog=function(t){if(S(I)&&(I=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!D[t])if(new RegExp("\\b"+t+"\\b","i").test(I)){var n=r.pid;D[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else D[t]=function(){};return D[t]},e.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=y,e.isBoolean=h,e.isNull=m,e.isNullOrUndefined=v,e.isNumber=b,e.isString=g,e.isSymbol=_,e.isUndefined=S,e.isRegExp=w,e.isObject=x,e.isDate=j,e.isError=k,e.isFunction=O,e.isPrimitive=T,e.isBuffer=n(63);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",C(),e.format.apply(e,arguments))},e.inherits=n(64),e._extend=function(t,e){if(!e||!x(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(e,n(3),n(0))},function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){return t&&"object"===(void 0===t?"undefined":r(t))&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,n){"use strict";"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}]);