Created
January 30, 2020 16:07
-
-
Save tetratorus/f30e7c3136ca796cb4583ea94b187e9a to your computer and use it in GitHub Desktop.
embed.min.js
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({"/Users/lentan/repo/torus/torus-embed/dist/PopupHandler.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _events=require("events");function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),e}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}var PopupHandler=function(e){function PopupHandler(e){var t,o=e.url,r=e.target,n=e.features;return _classCallCheck(this,PopupHandler),(t=_possibleConstructorReturn(this,_getPrototypeOf(PopupHandler).call(this))).url=o,t.target=r||"_blank",t.features=n||"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200",t.window=void 0,t.windowTimer={},t.iClosedWindow=!1,t._setupTimer(),t}return _inherits(PopupHandler,_events.EventEmitter),_createClass(PopupHandler,[{key:"_setupTimer",value:function _setupTimer(){var e=this;this.windowTimer=setInterval(function(){e.window&&e.window.closed&&(clearInterval(e.windowTimer),e.iClosedWindow||e.emit("close"),e.iClosedWindow=!1,e.window=void 0),void 0===e.window&&clearInterval(e.windowTimer)},500)}},{key:"open",value:function open(){this.window=window.open(this.url,this.target,this.features)}},{key:"close",value:function close(){this.iClosedWindow=!0,this.window&&this.window.close()}}]),PopupHandler}(),_default=PopupHandler;exports.default=_default; | |
},{"events":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js"}],"/Users/lentan/repo/torus/torus-embed/dist/config.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var enums={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord"},verifierList=Object.values(enums),_default={networkList:["mainnet","rinkeby","ropsten","kovan","goerli","localhost","matic"],enums:enums,verifierList:verifierList,supportedVerifierList:[enums.GOOGLE,enums.REDDIT,enums.DISCORD]};exports.default=_default; | |
},{}],"/Users/lentan/repo/torus/torus-embed/dist/createErrorMiddleware.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _RPC_ERRORS,_loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var RPC_ERRORS=(_defineProperty(_RPC_ERRORS={1:"An unauthorized action was attempted.",2:"A disallowed action was attempted.",3:"An execution error occurred."},-32600,"The JSON sent is not a valid Request object."),_defineProperty(_RPC_ERRORS,-32601,"The method does not exist / is not available."),_defineProperty(_RPC_ERRORS,-32602,"Invalid method parameter(s)."),_defineProperty(_RPC_ERRORS,-32603,"Internal JSON-RPC error."),_defineProperty(_RPC_ERRORS,-32700,"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."),_defineProperty(_RPC_ERRORS,"internal","Internal server error."),_defineProperty(_RPC_ERRORS,"unknown","Unknown JSON-RPC error."),_RPC_ERRORS);function sanitizeRPCError(e,r){if(e.message&&!r)return e;var t=e.code>-31099&&e.code<-32100?RPC_ERRORS.internal:RPC_ERRORS[e.code];e.message=t||RPC_ERRORS.unknown}function createErrorMiddleware(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).override;return function(e,r,t){t(function(e){var t=r.error;if(!t)return e();sanitizeRPCError(t),_loglevel.default.error("Torus - RPC Error: ".concat(t.message),t),e()})}}var _default=createErrorMiddleware;exports.default=_default; | |
},{"loglevel":"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js"}],"/Users/lentan/repo/torus/torus-embed/dist/createTransformEthAddressMiddleware.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _embedUtils=require("./embedUtils");function CreateTransformEthAddressMiddleware(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).override;return function(e,t,r,d){r(function(r){"eth_accounts"===e.method&&(t.result=(0,_embedUtils.transformEthAddress)(t.result)),r()})}}var _default=CreateTransformEthAddressMiddleware;exports.default=_default; | |
},{"./embedUtils":"/Users/lentan/repo/torus/torus-embed/dist/embedUtils.js"}],"/Users/lentan/repo/torus/torus-embed/dist/embed.js":[function(require,module,exports){ | |
(function (global){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _defaultVerifiers,_sriToolbox=_interopRequireDefault(require("sri-toolbox")),_loglevel=_interopRequireDefault(require("loglevel")),_postMessageStream=_interopRequireDefault(require("post-message-stream")),_web=_interopRequireDefault(require("web3")),_randomId=_interopRequireDefault(require("random-id")),_fetchNodeDetails=_interopRequireDefault(require("@toruslabs/fetch-node-details")),_torus=_interopRequireDefault(require("@toruslabs/torus.js")),_inpageProvider=_interopRequireDefault(require("./inpage-provider")),_streamUtils=require("./stream-utils"),_embedUtils=require("./embedUtils"),_config=_interopRequireDefault(require("./config")),_PopupHandler=_interopRequireDefault(require("./PopupHandler"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,o)}return i}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(i),!0).forEach(function(t){_defineProperty(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ownKeys(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _defineProperty(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var _configuration$enums=_config.default.enums,GOOGLE=_configuration$enums.GOOGLE,FACEBOOK=_configuration$enums.FACEBOOK,REDDIT=_configuration$enums.REDDIT,TWITCH=_configuration$enums.TWITCH,DISCORD=_configuration$enums.DISCORD,defaultVerifiers=(_defineProperty(_defaultVerifiers={},GOOGLE,!0),_defineProperty(_defaultVerifiers,FACEBOOK,!0),_defineProperty(_defaultVerifiers,REDDIT,!0),_defineProperty(_defaultVerifiers,TWITCH,!0),_defineProperty(_defaultVerifiers,DISCORD,!0),_defaultVerifiers);cleanContextForImports();var iframeIntegrity="sha384-4mM3V5uRfIXCgqK2qIIhI90gyQRT5CVRZFjtbDBP6tEvBnb2UBcx8tCsRkDgDEUo",expectedCacheControlHeader="max-age=3600";restoreContextAfterImports();var thirdPartyCookiesSupported=!0,receiveMessage=function receiveMessage(e){"torus:3PCunsupported"===e.data?(_loglevel.default.info("unsupported 3rd party cookies"),thirdPartyCookiesSupported=!1,window.removeEventListener("message",receiveMessage)):"torus:3PCsupported"===e.data&&(_loglevel.default.info("supported 3rd party cookies"),thirdPartyCookiesSupported=!0,window.removeEventListener("message",receiveMessage))};window.addEventListener("message",receiveMessage,!1);var __define,Torus=function(){function Torus(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).buttonPosition,t=void 0===e?"bottom-left":e;_classCallCheck(this,Torus),this.buttonPosition=t,this.torusWidget={},this.torusMenuBtn={},this.torusLogin={},this.torusLoadingBtn={},this.torusUrl="",this.torusIframe={},this.torusLoginModal={},this.torusSpeedDial={},this.keyBtn={},this.styleLink={},this.isRehydrated=!1,this.isLoggedIn=!1,this.isInitalized=!1,this.torusButtonVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.enabledVerifiers={},this.Web3=_web.default,this.torusAlert={},this.nodeDetailManager=new _fetchNodeDetails.default,this.torusJs=new _torus.default}return _createClass(Torus,[{key:"init",value:function init(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.buildEnv,o=void 0===i?"production":i,n=t.enableLogging,r=void 0!==n&&n,s=t.enabledVerifiers,a=void 0===s?defaultVerifiers:s,d=t.network,l=void 0===d?{host:"mainnet",chainId:1,networkName:"mainnet"}:d,u=t.showTorusButton,c=void 0===u||u;return new Promise(function(t,i){var n,s;switch(e.isInitalized&&i(new Error("Already initialized")),o){case"staging":n="https://staging.tor.us/v0.2.12",s="info";break;case"testing":n="https://testing.tor.us",s="debug";break;case"development":n="https://localhost:3000",s="debug";break;default:n="https://app.tor.us/v0.2.12",s="error"}e.torusUrl=n,e.enabledVerifiers=_objectSpread({},defaultVerifiers,{},a),_loglevel.default.setDefaultLevel(s),r?_loglevel.default.enableAll():_loglevel.default.disableAll(),e.torusButtonVisibility=c,e._createWidget(n);var d=function attachIFrame(){window.document.body.appendChild(e.torusIframe)};"production"===o?fetch(n+"/popup",{cache:"reload"}).then(function(e){if(e.headers.get("Cache-Control")!==expectedCacheControlHeader)throw new Error("Unexpected Cache-Control headers, got "+e.headers.get("Cache-Control"));return e.text()}).then(function(o){var n=_sriToolbox.default.generate({algorithms:["sha384"]},o);if(_loglevel.default.info(n,"integrity"),n===iframeIntegrity)(0,_embedUtils.runOnLoad)(d.bind(e)),(0,_embedUtils.runOnLoad)(function(){return e._setupWeb3()}),(0,_embedUtils.runOnLoad)(function(){return e._setProvider(l).then(function(){e.isInitalized=!0,t()}).catch(function(e){return i(e)})});else try{e._cleanUp()}catch(e){i(e)}finally{i(new Error("Integrity check failed"))}}):((0,_embedUtils.runOnLoad)(d.bind(e)),(0,_embedUtils.runOnLoad)(function(){return e._setupWeb3()}),(0,_embedUtils.runOnLoad)(function(){return e._setProvider(l).then(function(){e.isInitalized=!0,t()}).catch(function(e){return i(e)})}))})}},{key:"_checkThirdPartyCookies",value:function _checkThirdPartyCookies(){if(!thirdPartyCookiesSupported)throw this._createAlert(),new Error("Third party cookies not supported")}},{key:"login",value:function login(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).verifier;if(!this.isInitalized)throw new Error("Call init() first");if(this.isLoggedIn)throw new Error("User has already logged in");if(e&&!this.enabledVerifiers[e])throw new Error("Given verifier is not enabled");if(e){if(_config.default.verifierList.includes(e))return this.requestedVerifier=e,this.ethereum.enable();throw new Error("Unsupported verifier")}return this.requestedVerifier="",this.ethereum.enable()}},{key:"logout",value:function logout(){var e=this;return new Promise(function(t,i){if(e.isLoggedIn){e.communicationMux.getStream("logout").write({name:"logOut"});var o=e.communicationMux.getStream("status");(0,_embedUtils.handleStream)(o,"data",function statusStreamHandler(o){o.loggedIn?i(new Error("Some Error Occured")):(e.isLoggedIn=!1,e.isRehydrated=!1,e.currentVerifier="",e.requestedVerifier="",t())})}else i(new Error("User has not logged in yet"))})}},{key:"cleanUp",value:function cleanUp(){var e=this;return new Promise(function(t,i){if(e.isLoggedIn)e.logout().then(function(){e._cleanUp(),t()}).catch(function(e){return i(e)});else try{e._cleanUp(),t()}catch(e){i(e)}})}},{key:"_cleanUp",value:function _cleanUp(){function isElement(e){return e instanceof Element||e instanceof HTMLDocument}isElement(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink={}),isElement(this.torusWidget)&&window.document.body.contains(this.torusWidget)&&(this.torusWidget.remove(),this.torusWidget={},this.torusLogin={},this.torusMenuBtn={},this.torusLoadingBtn={},this.torusLoginModal={}),isElement(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe={}),isElement(this.torusAlert)&&window.document.body.contains(this.torusAlert)&&(this.torusAlert.remove(),this.torusAlert={})}},{key:"_createAlert",value:function _createAlert(){var e=this;this.torusAlert=(0,_embedUtils.htmlToElement)('<div id="torusAlert" class="torus-alert"><h1>Cookies Required</h1><p>Please enable cookies in your browser preferences to access Torus.</p></div>');var t=(0,_embedUtils.htmlToElement)('<span id="torusAlert__close">x<span>');this.torusAlert.appendChild(t);(0,_embedUtils.runOnLoad)(function attachOnLoad(){window.document.body.appendChild(e.torusAlert)}.bind(this)),(0,_embedUtils.runOnLoad)(function bindOnLoad(){t.addEventListener("click",function(){e.torusAlert.remove()})}.bind(this))}},{key:"_createPopupBlockAlert",value:function _createPopupBlockAlert(e){var t=this,i=(0,_embedUtils.htmlToElement)('<div id="torusAlert"><h1 id="torusAlert__title">Action Required</h1><p id="torusAlert__desc">You have a pending action that needs to be completed in a pop-up window </p></div>'),o=(0,_embedUtils.htmlToElement)('<div><button id="torusAlert__btn">Confirm</button></div>');i.appendChild(o);(0,_embedUtils.runOnLoad)(function attachOnLoad(){window.document.body.appendChild(i)}.bind(this)),(0,_embedUtils.runOnLoad)(function bindOnLoad(){o.addEventListener("click",function(){t._handleWindow(e,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=500"}),i.remove()})}.bind(this))}},{key:"_createWidget",value:function _createWidget(e){var t=this,i=window.document.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e+"/css/widget.css"),this.styleLink=i,this.torusWidget=(0,_embedUtils.htmlToElement)('<div id="torusWidget" class="widget"></div>');var o=(0,_embedUtils.htmlToElement)('<div id="torusSpinner"><div class="torusSpinner__beat beat-odd"></div><div class="torusSpinner__beat beat-even"></div><div class="torusSpinner__beat beat-odd"></div></div>');this.torusLoadingBtn=(0,_embedUtils.htmlToElement)('<button disabled class="torus-btn torus-btn--loading"></button>'),this.torusButtonVisibility||(this.torusLoadingBtn.style.display="none"),this.torusLoadingBtn.appendChild(o),this.torusWidget.appendChild(this.torusLoadingBtn),this.torusLogin=(0,_embedUtils.htmlToElement)('<button id="torusLogin" class="torus-btn torus-btn--login"></button>'),this.torusButtonVisibility||(this.torusLogin.style.display="none"),this.torusWidget.appendChild(this.torusLogin),this.torusMenuBtn=(0,_embedUtils.htmlToElement)('<button id="torusMenuBtn" class="torus-btn torus-btn--main" />'),this.torusButtonVisibility||(this.torusMenuBtn.style.display="none"),this.torusWidget.appendChild(this.torusMenuBtn),this.torusSpeedDial=(0,_embedUtils.htmlToElement)('<ul id="torusWidget__speed-dial-list" style="transition-delay: 0.05s">'),this.torusSpeedDial.style.opacity="0";var n=(0,_embedUtils.htmlToElement)('<li><button class="torus-btn torus-btn--home" title="Wallet Home Page"></button></li>'),r=(0,_embedUtils.htmlToElement)('<div class="torus-tooltip-text torus-tooltip-note">Copy public address to clipboard</div>'),s=(0,_embedUtils.htmlToElement)('<div class="torus-tooltip-text torus-tooltip-copied">Copied!</div>');this.keyBtn=(0,_embedUtils.htmlToElement)('<button class="torus-btn torus-btn--text">0xe5..</button>');var a=(0,_embedUtils.htmlToElement)('<li class="torus-tooltip"></li>');a.appendChild(this.keyBtn),a.appendChild(r),a.appendChild(s);var d=(0,_embedUtils.htmlToElement)('<li><button class="torus-btn torus-btn--transfer" title="Wallet Transfer Page"></button></li>');this.torusSpeedDial.appendChild(n),this.torusSpeedDial.appendChild(a),this.torusSpeedDial.appendChild(d),this.torusWidget.prepend(this.torusSpeedDial),this.torusLoginModal=(0,_embedUtils.htmlToElement)('<div id="torus-login-modal"></div>'),this.torusLoginModal.style.display="none";var l=(0,_embedUtils.htmlToElement)('<div id="torus-login-modal__modal-container"><div id="torus-login-modal__close-container"><span id="torus-login-modal__close">×</span></div></div>'),u=(0,_embedUtils.htmlToElement)('<div id="torus-login-modal__modal-content"><div id="torus-login-modal__header-container"><img src="'+e+'/images/torus-logo-blue.svg"><div id="torus-login-modal__login-header">Login</div></div></div>'),c=(0,_embedUtils.htmlToElement)('<div id="torus-login-modal__form-container"><p id="torus-login-modal__login-subtitle">You are just one step away from your digital wallet</p></div>');this.googleLogin=(0,_embedUtils.htmlToElement)('<button id="torus-login-modal__login-google"><img src="'+e+'/img/icons/google.svg">Sign in with Google</button>');var h=(0,_embedUtils.htmlToElement)('<ul id="torus-login-modal__login-list"></ul>');this.facebookLogin=(0,_embedUtils.htmlToElement)('<li><button id="torus-login-modal__login-btn--facebook" title="Login with Facebook"><img src="'+e+'/img/icons/facebook.svg"></button></li>'),this.twitchLogin=(0,_embedUtils.htmlToElement)('<li><button id="torus-login-modal__login-btn--twitch" title="Login with Twitch"><img src="'+e+'/img/icons/twitch.svg"></button></li>'),this.redditLogin=(0,_embedUtils.htmlToElement)('<li><button id="torus-login-modal__login-btn--reddit" title="Login with Reddit"><img src="'+e+'/img/icons/reddit.svg"></button></li>'),this.discordLogin=(0,_embedUtils.htmlToElement)('<li><button id="torus-login-modal__login-btn--discord" title="Login with Discord"><img src="'+e+'/img/icons/discord.svg"></button></li>'),this.enabledVerifiers[FACEBOOK]&&h.appendChild(this.facebookLogin),this.enabledVerifiers[REDDIT]&&h.appendChild(this.redditLogin),this.enabledVerifiers[TWITCH]&&h.appendChild(this.twitchLogin),this.enabledVerifiers[DISCORD]&&h.appendChild(this.discordLogin),this.enabledVerifiers[GOOGLE]&&c.appendChild(this.googleLogin),c.appendChild(h);var g=(0,_embedUtils.htmlToElement)('<div id="torus-login-modal__login-note">By logging in, you accept Torus\' <a href="https://docs.tor.us/legal/terms-and-conditions" target="_blank">Terms and Conditions</a></div>');c.appendChild(g),u.appendChild(c),l.appendChild(u),this.torusLoginModal.appendChild(l),this.torusWidget.appendChild(this.torusLoginModal),this.torusIframe=(0,_embedUtils.htmlToElement)('<iframe id="torusIframe" frameBorder="0" src="'+e+'/popup"></iframe>');switch((0,_embedUtils.runOnLoad)(function attachOnLoad(){window.document.head.appendChild(i),window.document.body.appendChild(t.torusWidget)}.bind(this)),(0,_embedUtils.runOnLoad)(function bindOnLoad(){t.torusLogin.addEventListener("click",function(){t._showLoginPopup(!1)}),n.addEventListener("click",function(){t.showWallet(),t._toggleSpeedDial()}),d.addEventListener("click",function(){t.showWallet("transfer"),t._toggleSpeedDial()}),t.keyBtn.addEventListener("click",function(){var e=(0,_embedUtils.htmlToElement)('<input type="text" value="'+t.ethereum.selectedAddress+'">');t.torusWidget.prepend(e),e.select(),e.setSelectionRange(0,99999),document.execCommand("copy"),t.torusWidget.removeChild(e),s.classList.add("active"),r.classList.add("active");var i=t;setTimeout(function(){s.classList.remove("active"),r.classList.remove("active"),i._toggleSpeedDial()},1e3)}),t.torusMenuBtn.addEventListener("click",function(){t._toggleSpeedDial()}),l.querySelector("#torus-login-modal__close").addEventListener("click",function(){t.torusLoginModal.style.display="none",t.modalCloseHandler&&t.modalCloseHandler(),delete t.modalCloseHandler})}.bind(this)),this.buttonPosition){case"top-left":this.torusWidget.style.top="34px",this.torusWidget.style.left="34px";break;case"top-right":this.torusWidget.style.top="34px",this.torusWidget.style.right="34px";break;case"bottom-right":this.torusWidget.style.bottom="34px",this.torusWidget.style.right="34px";break;case"bottom-left":default:this.torusWidget.style.bottom="34px",this.torusWidget.style.left="34px"}}},{key:"_updateKeyBtnAddress",value:function _updateKeyBtnAddress(e){this.keyBtn.innerText=e&&e.slice(0,4)+".."}},{key:"_showLoggedOut",value:function _showLoggedOut(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display=this.torusButtonVisibility?"block":"none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"_showLoggingIn",value:function _showLoggingIn(){this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLoginModal.style.display=""===this.requestedVerifier?"block":"none"}},{key:"_showLoggedIn",value:function _showLoggedIn(){this.torusMenuBtn.style.display=this.torusButtonVisibility?"block":"none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusLoginModal.style.display="none"}},{key:"hideTorusButton",value:function hideTorusButton(){this.torusButtonVisibility=!1,this.torusMenuBtn.style.display="none",this.torusLogin.style.display="none",this.torusLoadingBtn.style.display="none",this.torusSpeedDial.style.opacity="0"}},{key:"showTorusButton",value:function showTorusButton(){this.torusButtonVisibility=!0,this.isLoggedIn?this._showLoggedIn():this._showLoggedOut()}},{key:"_setupWeb3",value:function _setupWeb3(){var e=this;_loglevel.default.info("setupWeb3 running"),this.metamaskStream=new _postMessageStream.default({name:"embed_metamask",target:"iframe_metamask",targetWindow:this.torusIframe.contentWindow}),this.metamaskStream.setMaxListeners(100),this.communicationStream=new _postMessageStream.default({name:"embed_comm",target:"iframe_comm",targetWindow:this.torusIframe.contentWindow}),this.communicationStream.setMaxListeners(100);var t=new _inpageProvider.default(this.metamaskStream),i=function detectAccountRequestPrototypeModifier(i){var o=t[i],n=e;t[i]=function(e){return"eth_requestAccounts"===e.method?n.ethereum.enable():o.apply(this,arguments)}};i("send"),i("sendAsync"),t.setMaxListeners(100),t.enable=function(){return e._checkThirdPartyCookies(),e._showLoggingIn(),new Promise(function(t,i){e.web3.eth.getAccounts(function(e,o){var n=this,r=this;if(e)setTimeout(function(){r._showLoggedOut(),i(e)},50);else if(Array.isArray(o)&&o.length>0){var s=function handleRehydration(){if(n.isLoggedIn=!0,""!==n.requestedVerifier&&n.currentVerifier!==n.requestedVerifier){var e=n.requestedVerifier;n.logout().then(function(o){n.requestedVerifier=e,n._showLoginPopup(!0,t,i)}).catch(function(e){return i(e)})}else r._showLoggedIn(),t(o)};this.isRehydrated?s():this.isRehydratedCallback=s}else this._showLoginPopup(!0,t,i)}.bind(e))})};var o=new Proxy(t,{deleteProperty:function deleteProperty(){return!0}});this.ethereum=o;var n=(0,_streamUtils.setupMultiplex)(this.communicationStream);n.setMaxListeners(20),this.communicationMux=n,n.getStream("window").on("data",function(t){"create_window"===t.name&&e._createPopupBlockAlert(t.data.preopenInstanceId)}),n.getStream("status").on("data",function(t){t.rehydrate&&t.loggedIn?(e.isRehydrated=t.rehydrate,e.currentVerifier=t.verifier,e.isRehydratedCallback&&(e.isRehydratedCallback(),delete e.isRehydratedCallback)):t.loggedIn?(e.isLoggedIn=t.loggedIn,e.currentVerifier=t.verifier,e._showLoggedIn()):e._showLoggedOut()}),this.provider=t,this.web3=new _web.default(t),this.web3.setProvider=function(){_loglevel.default.debug("Torus - overrode web3.setProvider")},this.web3.currentProvider.isMetamask=!0,this.web3.currentProvider.isTorus=!0,t.init({ethereum:this.ethereum,web3:this.web3}),t.publicConfigStore.subscribe(function(e){this._updateKeyBtnAddress(e.selectedAddress)}.bind(this)),_loglevel.default.debug("Torus - injected web3")}},{key:"_showLoginPopup",value:function _showLoginPopup(e,t,i){var o=this;if(this._showLoggingIn(),void 0===this.requestedVerifier||""===this.requestedVerifier){this.modalCloseHandler=function(){o._showLoggedOut(),i&&i(new Error("Modal has been closed"))};var n=function _loginHandler(n){o.requestedVerifier=n,o._showLoginPopup(e,t,i)};Object.keys(this.enabledVerifiers).forEach(function(e){o.enabledVerifiers[e]&&(0,_embedUtils.handleEvent)(o["".concat(e,"Login")],"click",n,[e])})}else{var r=this.communicationMux.getStream("oauth"),s=this;(0,_embedUtils.handleStream)(r,"data",function loginHandler(e){var o=e.err,n=e.selectedAddress;o?(_loglevel.default.error(o),s._showLoggedOut(),i&&i(o)):(t&&t([(0,_embedUtils.transformEthAddress)(n)]),s._showLoggedIn())});var a=(0,_randomId.default)();this._handleWindow(a),r.write({name:"oauth",data:{calledFromEmbed:e,verifier:this.requestedVerifier,preopenInstanceId:a}})}}},{key:"setProvider",value:function setProvider(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.host,o=void 0===i?"mainnet":i,n=t.chainId,r=void 0===n?1:n,s=t.networkName,a=void 0===s?"mainnet":s;return new Promise(function(t,i){var n=e.communicationMux.getStream("provider_change");(0,_embedUtils.handleStream)(n,"data",function handler(e){var o=e.data,n=o.err,r=o.success;_loglevel.default.info(e),n?i(n):r?t():i(new Error("some error occured"))});var s=(0,_randomId.default)();e._handleWindow(s,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=600,width=500"}),n.write({name:"show_provider_change",data:{network:{host:o,chainId:r,networkName:a},type:_config.default.networkList.includes(o)?void 0:"rpc",preopenInstanceId:s,override:!1}})})}},{key:"_setProvider",value:function _setProvider(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.host,o=void 0===i?"mainnet":i,n=t.chainId,r=void 0===n?1:n,s=t.networkName,a=void 0===s?"mainnet":s;return new Promise(function(t,i){if(e.isInitalized)i(new Error("Already initialized"));else{var n=e.communicationMux.getStream("provider_change");(0,_embedUtils.handleStream)(n,"data",function handler(e){_loglevel.default.info(e);var o=e.data,n=o.err,r=o.success;n?i(n):r?t():i(new Error("some error occured"))}),n.write({name:"show_provider_change",data:{network:{host:o,chainId:r,networkName:a},type:_config.default.networkList.includes(o)?void 0:"rpc",override:!0}})}})}},{key:"showWallet",value:function showWallet(e){var t=this,i=this.communicationMux.getStream("show_wallet"),o=e?"/".concat(e):"";i.write({name:"show_wallet",data:{path:o}});(0,_embedUtils.handleStream)(i,"data",function showWalletHandler(e){if("show_wallet_instance"===e.name){var i=e.data.instanceId,n="".concat(t.torusUrl,"/wallet").concat(o,"?integrity=true&instanceId=").concat(i);new _PopupHandler.default({url:n}).open()}})}},{key:"_toggleSpeedDial",value:function _toggleSpeedDial(){this.torusMenuBtn.classList.toggle("active");var e=this.torusMenuBtn.classList.contains("active"),t=this.torusSpeedDial;t.style.opacity="0"===t.style.opacity?"1":"0",t.classList.toggle("active");var i=e?.05:1.2;t.style.transitionDelay=i+"s",setTimeout(function(){var i=e?.05:.15;Object.values(t.children).forEach(function(t){t.style.transitionDelay=i+"s",i+=e?.05:-.05})},200)}},{key:"getPublicAddress",value:function getPublicAddress(e){var t=this,i=e.verifier,o=e.verifierId;return new Promise(function(e,n){_config.default.supportedVerifierList.includes(i)||n(new Error("Unsupported verifier")),t.nodeDetailManager.getNodeDetails().then(function(e){return t.torusJs.getPublicAddress(e.torusNodeEndpoints,e.torusNodePub,{verifier:i,verifierId:o})}).then(function(t){return e(t)}).catch(function(e){return n(e)})})}},{key:"getUserInfo",value:function getUserInfo(e){var t=this;return new Promise(function(i,o){if(t.isLoggedIn){var n=t.communicationMux.getStream("user_info_access");n.write({name:"user_info_access_request"});(0,_embedUtils.handleStream)(n,"data",function userInfoAccessHandler(n){var r=n.name,s=n.data,a=s.approved,d=s.payload,l=s.rejected,u=s.newRequest;if("user_info_access_response"===r)if(a)i(d);else if(l)o(new Error("User rejected the request"));else if(u){var c=t.communicationMux.getStream("user_info");(0,_embedUtils.handleStream)(c,"data",function userInfoHandler(e){"user_info_response"===e.name&&(e.data.approved?i(e.data.payload):o(new Error("User rejected the request")))});var h=(0,_randomId.default)();t._handleWindow(h,{target:"_blank",features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=600,width=500"}),c.write({name:"user_info_request",data:{message:e,preopenInstanceId:h}})}})}else o(new Error("User has not logged in yet"))})}},{key:"_handleWindow",value:function _handleWindow(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.target,o=t.features,n=this.communicationMux.getStream("window"),r=this.torusUrl+"/redirect?preopenInstanceId=".concat(e),s=new _PopupHandler.default({url:r,target:i,features:o});s.open(),n.write({name:"opened_window",data:{preopenInstanceId:e}});n.on("data",function closeHandler(t){var i=t.preopenInstanceId,o=t.close;i===e&&o&&(s.close(),n.removeListener("data",closeHandler))}),s.once("close",function(){n.write({data:{preopenInstanceId:e,closed:!0}})})}},{key:"initiateTopup",value:function initiateTopup(e,t){var i=this;return new Promise(function(o,n){if(i.isLoggedIn){var r=i.communicationMux.getStream("topup");(0,_embedUtils.handleStream)(r,"data",function topupHandler(e){"topup_response"===e.name&&(e.data.success?o(e.data.success):n(new Error(e.data.error)))});var s=(0,_randomId.default)();i._handleWindow(s),r.write({name:"topup_request",data:{provider:e,params:t,preopenInstanceId:s}})}else n(new Error("User has not logged in yet"))})}}]),Torus}();function cleanContextForImports(){try{__define=global.define,global.define=void 0}catch(e){_loglevel.default.warn("Torus - global.define could not be deleted.")}}function restoreContextAfterImports(){try{global.define=__define}catch(e){_loglevel.default.warn("Torus - global.define could not be overwritten.")}}var _default=Torus;exports.default=_default; | |
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"./PopupHandler":"/Users/lentan/repo/torus/torus-embed/dist/PopupHandler.js","./config":"/Users/lentan/repo/torus/torus-embed/dist/config.js","./embedUtils":"/Users/lentan/repo/torus/torus-embed/dist/embedUtils.js","./inpage-provider":"/Users/lentan/repo/torus/torus-embed/dist/inpage-provider.js","./stream-utils":"/Users/lentan/repo/torus/torus-embed/dist/stream-utils.js","@toruslabs/fetch-node-details":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/index.js","@toruslabs/torus.js":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/index.js","loglevel":"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js","post-message-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/post-message-stream/index.js","random-id":"/Users/lentan/repo/torus/torus-embed/node_modules/random-id/index.js","sri-toolbox":"/Users/lentan/repo/torus/torus-embed/node_modules/sri-toolbox/main.js","web3":"/Users/lentan/repo/torus/torus-embed/node_modules/web3/index.js"}],"/Users/lentan/repo/torus/torus-embed/dist/embedUtils.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.handleStream=exports.handleEvent=exports.transformEthAddress=exports.htmlToElement=exports.runOnComplete=exports.runOnLoad=void 0;var _this=void 0,runOnLoad=function runOnLoad(e){null!=window.document.body?e():window.document.addEventListener("DOMContentLoaded",e)};exports.runOnLoad=runOnLoad;var runOnComplete=function runOnComplete(e){var n=window.setInterval(function(){"complete"===window.document.readyState&&(window.clearInterval(n),e())},300)};exports.runOnComplete=runOnComplete;var htmlToElement=function htmlToElement(e){var n=window.document.createElement("template"),t=e.trim();return n.innerHTML=t,n.content.firstChild};exports.htmlToElement=htmlToElement;var transformEthAddress=function transformEthAddress(e){if(Array.isArray(e))return e.map(function(e){return"string"==typeof e?e.toLowerCase():e});if("string"==typeof e)return e.toLowerCase();throw new Error("Unexpected Ethereum address format")};exports.transformEthAddress=transformEthAddress;var handleEvent=function handleEvent(e,n,t,r){e.addEventListener(n,function handlerWrapper(){t.apply(_this,r),e.removeEventListener(n,handlerWrapper)})};exports.handleEvent=handleEvent;var handleStream=function handleStream(e,n,t){e.on(n,function handlerWrapper(r){t(r),e.removeListener(n,handlerWrapper)})};exports.handleStream=handleStream; | |
},{}],"/Users/lentan/repo/torus/torus-embed/dist/inpage-provider.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _createErrorMiddleware=_interopRequireDefault(require("./createErrorMiddleware")),_createTransformEthAddressMiddleware=_interopRequireDefault(require("./createTransformEthAddressMiddleware")),_streamUtils=require("./stream-utils.js"),_readableStream=require("readable-stream"),_embedUtils=require("./embedUtils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(e,t){return e.__proto__=t,e})(e,t)}var pump=require("pump"),RpcEngine=require("json-rpc-engine"),createIdRemapMiddleware=require("json-rpc-engine/src/idRemapMiddleware"),createJsonRpcStream=require("json-rpc-middleware-stream"),SafeEventEmitter=require("safe-event-emitter"),log=require("loglevel"),ObservableStore=require("obs-store"),LocalStorageStream=function(e){function LocalStorageStream(e,t){var r;return _classCallCheck(this,LocalStorageStream),(r=_possibleConstructorReturn(this,_getPrototypeOf(LocalStorageStream).call(this,{objectMode:!0}))).ethereum=e,r.web3=t,r}return _inherits(LocalStorageStream,_readableStream.Duplex),_createClass(LocalStorageStream,[{key:"_read",value:function _read(e,t,r){log.info("reading from LocalStorageStore")}},{key:"_onMessage",value:function _onMessage(e){log.info("LocalStorageStore",e)}},{key:"_write",value:function _write(e,t,r){var n=JSON.parse(e);for(var o in log.info("WRITING TO LOCALSTORAGESTREAM, CHUNK:",e),n)if("selectedAddress"===o)if(""!==n[o]&&null!==n[o]&&void 0!==n[o]){var s=window.sessionStorage.getItem("selectedAddress"),i=(0,_embedUtils.transformEthAddress)(n[o]);this.web3.eth.defaultAccount=i,this.ethereum.selectedAddress=i,this.ethereum.publicConfigStore.updateState({selectedAddress:i}),window.sessionStorage.setItem("selectedAddress",i),s!==i&&this.emit("accountsChanged",[i])}else delete this.web3.eth.defaultAccount,delete this.ethereum.selectedAddress,window.sessionStorage.removeItem("selectedAddress");else"networkVersion"===o?(window.sessionStorage.setItem(o,n[o]),this.ethereum.networkVersion!==n[o].toString()&&(this.ethereum.publicConfigStore.updateState({networkVersion:n[o].toString()}),this.ethereum.networkVersion=n[o].toString())):window.sessionStorage.setItem(o,n[o]);r()}}]),LocalStorageStream}(),MetamaskInpageProvider=function(e){function MetamaskInpageProvider(e){var t;_classCallCheck(this,MetamaskInpageProvider),(t=_possibleConstructorReturn(this,_getPrototypeOf(MetamaskInpageProvider).call(this))).connectionStream=e;var r=_assertThisInitialized(t);return r.isMetaMask=!0,SafeEventEmitter.call(r),t}return _inherits(MetamaskInpageProvider,SafeEventEmitter),_createClass(MetamaskInpageProvider,[{key:"init",value:function init(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this,r=(0,_streamUtils.setupMultiplex)(this.connectionStream),n=r.createStream("publicConfig");Object.defineProperty(t,"mux",{value:r,writable:!0,enumerable:!1}),e.skipStatic||(t.publicConfigStore=new ObservableStore({}),t.publicConfigStore.updateState=function(e){if(e&&e instanceof Object){var t=this.getState(),r=Object.assign({},t,e);this.putState(r)}else this.putState(e)},t.publicConfigStore.subscribe(function(t){e.web3.eth.defaultAccount=t.selectedAddress})),Object.defineProperty(t,"lss",{value:new LocalStorageStream(e.ethereum,e.web3),writable:!0,enumerable:!1}),pump(n,t.lss),r.ignoreStream("phishing");var o=createJsonRpcStream();pump(o.stream,r.getStream("provider"),o.stream,logStreamDisconnectWarning.bind(this,"MetaMask RpcProvider"));var s=new RpcEngine;s.push(createIdRemapMiddleware()),s.push((0,_createErrorMiddleware.default)()),s.push((0,_createTransformEthAddressMiddleware.default)()),s.push(o.middleware),t.rpcEngine=s,o.events.on("notification",function(e){t.emit("data",null,e)}),t.send=t.send.bind(t),t.sendAsync=t.sendAsync.bind(t)}},{key:"send",value:function send(e,t){if(!t)return this._sendSync(e);this.sendAsync(e,t)}},{key:"sendAsync",value:function sendAsync(e,t){log.info("ASYNC REQUEST",e);if(void 0===t)return this.rpcEngine.handle(e,noop),this._sendSync(e);this.rpcEngine.handle(e,t)}},{key:"_sendSync",value:function _sendSync(e){var t,r=null;switch(e.method){case"eth_accounts":r=(t=window.sessionStorage.getItem("selectedAddress"))?[t]:[];break;case"eth_coinbase":r=(t=window.sessionStorage.getItem("selectedAddress"))||null;break;case"eth_uninstallFilter":this.sendAsync(e,noop),r=!0;break;case"net_version":log.info("NET VERSION REQUESTED"),r=window.sessionStorage.getItem("networkVersion")||null;break;default:var n="The Torus Web3 object does not support synchronous methods like ".concat(e.method," without a callback parameter. See ").concat("https://github.com/MetaMask/faq/blob/master/DEVELOPERS.md#dizzy-all-async---think-of-metamask-as-a-light-client"," for details.");throw new Error(n)}return{id:e.id,jsonrpc:e.jsonrpc,result:r}}},{key:"isConnected",value:function isConnected(){return!0}}]),MetamaskInpageProvider}();function logStreamDisconnectWarning(e,t){var r="MetamaskInpageProvider - lost connection to ".concat(e);t&&(r+="\n"+t.stack),log.warn(r),this.listenerCount("error")>0&&this.emit("error",r)}function noop(){}var _default=MetamaskInpageProvider;exports.default=_default; | |
},{"./createErrorMiddleware":"/Users/lentan/repo/torus/torus-embed/dist/createErrorMiddleware.js","./createTransformEthAddressMiddleware":"/Users/lentan/repo/torus/torus-embed/dist/createTransformEthAddressMiddleware.js","./embedUtils":"/Users/lentan/repo/torus/torus-embed/dist/embedUtils.js","./stream-utils.js":"/Users/lentan/repo/torus/torus-embed/dist/stream-utils.js","json-rpc-engine":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/index.js","json-rpc-engine/src/idRemapMiddleware":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/idRemapMiddleware.js","json-rpc-middleware-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/index.js","loglevel":"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js","obs-store":"/Users/lentan/repo/torus/torus-embed/node_modules/obs-store/index.js","pump":"/Users/lentan/repo/torus/torus-embed/node_modules/pump/index.js","readable-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/readable-stream/readable-browser.js","safe-event-emitter":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-event-emitter/index.js"}],"/Users/lentan/repo/torus/torus-embed/dist/stream-utils.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setupMultiplex=exports.jsonStringifyStream=exports.jsonParseStream=void 0;var _through=_interopRequireDefault(require("through2")),_objMultiplex=_interopRequireDefault(require("obj-multiplex")),_pump=_interopRequireDefault(require("pump"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var jsonParseStream=function jsonParseStream(){return _through.default.obj(function(e,t,r){this.push(JSON.parse(e)),r()})};exports.jsonParseStream=jsonParseStream;var jsonStringifyStream=function jsonStringifyStream(){return _through.default.obj(function(e,t,r){this.push(JSON.stringify(e)),r()})};exports.jsonStringifyStream=jsonStringifyStream;var setupMultiplex=function setupMultiplex(e){var t=new _objMultiplex.default;return t.getStream=function(e){return this._substreams[e]?this._substreams[e]:this.createStream(e)},(0,_pump.default)(e,t,e,function(e){e&&console.error(e)}),t};exports.setupMultiplex=setupMultiplex; | |
},{"obj-multiplex":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/index.js","pump":"/Users/lentan/repo/torus/torus-embed/node_modules/pump/index.js","through2":"/Users/lentan/repo/torus/torus-embed/node_modules/through2/through2.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/classCallCheck.js":[function(require,module,exports){ | |
function _classCallCheck(a,l){if(!(a instanceof l))throw new TypeError("Cannot call a class as a function")}module.exports=_classCallCheck; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/createClass.js":[function(require,module,exports){ | |
function _defineProperties(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e}module.exports=_createClass; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/defineProperty.js":[function(require,module,exports){ | |
function _defineProperty(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}module.exports=_defineProperty; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/interopRequireDefault.js":[function(require,module,exports){ | |
function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}module.exports=_interopRequireDefault; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/dist/abi.json":[function(require,module,exports){ | |
module.exports={ | |
"abi": [ | |
{ | |
"constant": true, | |
"inputs": [], | |
"name": "currentEpoch", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "epoch", | |
"type": "uint256" | |
} | |
], | |
"name": "getEpochInfo", | |
"outputs": [ | |
{ | |
"internalType": "uint256", | |
"name": "id", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "n", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "k", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "t", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "address[]", | |
"name": "nodeList", | |
"type": "address[]" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "prevEpoch", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "nextEpoch", | |
"type": "uint256" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
}, | |
{ | |
"constant": true, | |
"inputs": [ | |
{ | |
"internalType": "address", | |
"name": "nodeAddress", | |
"type": "address" | |
} | |
], | |
"name": "getNodeDetails", | |
"outputs": [ | |
{ | |
"internalType": "string", | |
"name": "declaredIp", | |
"type": "string" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "position", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "pubKx", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "uint256", | |
"name": "pubKy", | |
"type": "uint256" | |
}, | |
{ | |
"internalType": "string", | |
"name": "tmP2PListenAddress", | |
"type": "string" | |
}, | |
{ | |
"internalType": "string", | |
"name": "p2pListenAddress", | |
"type": "string" | |
} | |
], | |
"payable": false, | |
"stateMutability": "view", | |
"type": "function" | |
} | |
] | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/dist/nodeDetailManager.js":[function(require,module,exports){ | |
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")),_createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass")),_defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty")),_web3EthContract=_interopRequireDefault(require("web3-eth-contract")),_web3Utils=require("web3-utils"),_abi=require("./abi.json"),NodeDetailManager=function(){function NodeDetailManager(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.network,a=void 0===r?"mainnet":r,o=t.proxyAddress,n=void 0===o?"0x638646503746d5456209e33a2ff5e3226d698bea":o;(0,_classCallCheck2.default)(this,NodeDetailManager),(0,_defineProperty2.default)(this,"_currentEpoch","13"),(0,_defineProperty2.default)(this,"_torusNodeEndpoints",["https://binance-main-13.torusnode.com/jrpc","https://waseda-main-13.torusnode.com/jrpc","https://vgr-main-13.torusnode.com/jrpc","https://torus-main-13.torusnode.com/jrpc","https://etc-main-13.torusnode.com/jrpc"]),(0,_defineProperty2.default)(this,"_torusNodePub",[{X:"801e99d5c6befe4286de6f22b086508c02ae5730afabf15f316242238fa8c832",Y:"a4791de3ebd17197d09d7a52d417994e7fdab17f8de002fc139c90dfdebfe7e1"},{X:"f4034ed9b11a3573d496b09823f69efed1213bc903f0b520652cb1b80f72e5c3",Y:"c1619b0d594db4bb289b2ec18c029e777b1e04aa0493f7318d14a68e89ff0005"},{X:"10aeb138801ef2e189e21a016e913fc2c2d40463e90e09687c6cef011e64048d",Y:"1dbc9e567db833376cac16ad07b402d44458befb26125e98446270d41e759a99"},{X:"1a864642b3e612615c0db4999cc89e123b7ab6bafe58b1692d46b64ba27508f6",Y:"92919c5269b22818a9e62d246df282b7847782e46f94d775d8d20fe967fb5cab"},{X:"9b64f7f8db105bb5a9301ac7ab20958e6d71f4a231f0d29b431712dd61d767a7",Y:"ee7de7de555aea2e586c9b40e68fab778742c0a8871e8b8f88a97063822764b4"}]),(0,_defineProperty2.default)(this,"_torusIndexes",[1,2,3,4,5]);try{e=new URL(a).href}catch(t){e="https://api.infura.io/v1/jsonrpc/".concat(a)}try{_web3EthContract.default.setProvider(e),this.nodeListContract=new _web3EthContract.default(_abi.abi,n),this.nodeListAddress=n,this.updated=!1}catch(e){throw new Error(e)}}return(0,_createClass2.default)(NodeDetailManager,[{key:"getCurrentEpoch",value:function getCurrentEpoch(){return this.nodeListContract.methods.currentEpoch().call()}},{key:"getEpochInfo",value:function getEpochInfo(e){return this.nodeListContract.methods.getEpochInfo(e).call()}},{key:"getNodeEndpoint",value:function getNodeEndpoint(e){return this.nodeListContract.methods.getNodeDetails(e).call()}},{key:"getNodeDetails",value:function getNodeDetails(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(r,a){return t?r(e._nodeDetails):e.updated?r(e._nodeDetails):void e.getCurrentEpoch().then(function(t){return e._currentEpoch=t,e.getEpochInfo(t)}).then(function(t){var r=[],a=t.nodeList.map(function(e,t){return t+1});return e._torusIndexes=a,t.nodeList.map(function(t){r.push(e.getNodeEndpoint(t).catch(function(e){}))}),Promise.all(r)}).then(function(t){for(var a=[],o=[],n=0;n<t.length;n++){var d=t[n],i="https://".concat(d.declaredIp.split(":")[0],"/jrpc");a.push(i),o.push({X:(0,_web3Utils.toHex)(d.pubKx).replace("0x",""),Y:(0,_web3Utils.toHex)(d.pubKy).replace("0x","")})}e._torusNodeEndpoints=a,e._torusNodePub=o,e.updated=!0,r(e._nodeDetails)}).catch(function(t){return r(e._nodeDetails)})})}},{key:"_nodeDetails",get:function get(){return{currentEpoch:this._currentEpoch,nodeListAddress:this.nodeListAddress,torusNodeEndpoints:this._torusNodeEndpoints,torusNodePub:this._torusNodePub,torusIndexes:this._torusIndexes,updated:this.updated}}}]),NodeDetailManager}(),_default=NodeDetailManager;exports.default=_default; | |
},{"./abi.json":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/dist/abi.json","@babel/runtime/helpers/classCallCheck":"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/classCallCheck.js","@babel/runtime/helpers/createClass":"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/createClass.js","@babel/runtime/helpers/defineProperty":"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/defineProperty.js","@babel/runtime/helpers/interopRequireDefault":"/Users/lentan/repo/torus/torus-embed/node_modules/@babel/runtime/helpers/interopRequireDefault.js","web3-eth-contract":"/Users/lentan/repo/torus/torus-embed/node_modules/web3-eth-contract/src/index.js","web3-utils":"/Users/lentan/repo/torus/torus-embed/node_modules/web3-utils/src/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/index.js":[function(require,module,exports){ | |
const NodeDetailManager=require("./dist/nodeDetailManager");module.exports=NodeDetailManager; | |
},{"./dist/nodeDetailManager":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/fetch-node-details/dist/nodeDetailManager.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/httpHelpers.js":[function(require,module,exports){ | |
"use strict";function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,o)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(exports,"__esModule",{value:!0}),exports.generateJsonRPCObject=exports.post=exports.promiseTimeout=void 0;var promiseTimeout=function promiseTimeout(e,t){var r=new Promise(function(t,r){var o=setTimeout(function(){clearTimeout(o),r(new Error("Timed out in "+e+"ms"))},e)});return Promise.race([t,r])};exports.promiseTimeout=promiseTimeout;var post=function post(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=_objectSpread({},{mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify(t)},{},r,{},{method:"POST"});return promiseTimeout(12e3,fetch(e,o).then(function(e){if(e.ok)return e.json();throw new Error("Could not connect",e)}))};exports.post=post;var generateJsonRPCObject=function generateJsonRPCObject(e,t){return{jsonrpc:"2.0",method:e,id:10,params:t}};exports.generateJsonRPCObject=generateJsonRPCObject; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/some.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Some=void 0;var _loglevel=_interopRequireDefault(require("loglevel"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var Some=function Some(e,n){return new Promise(function(o,t){var l=0,r=!1,u=new Array(e.length).fill(void 0);e.forEach(function(i,f){i.then(function(e){u[f]=e}).catch(function(e){return _loglevel.default.debug("some result",e)}).finally(function(){r||n(u.slice(0)).then(function(e){r=!0,o(e)}).catch(function(e){return _loglevel.default.debug("predicate",e)}).finally(function(n){_loglevel.default.debug("finally"),++l===e.length&&t(new Error("Unable to resolve enough promises, responses: "+JSON.stringify(u)))})})})})};exports.Some=Some; | |
},{"loglevel":"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/torus.js":[function(require,module,exports){ | |
(function (Buffer){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _elliptic=require("elliptic"),_eccrypto=_interopRequireDefault(require("eccrypto")),_web3Utils=require("web3-utils"),_bn=_interopRequireDefault(require("bn.js")),_loglevel=_interopRequireDefault(require("loglevel")),_httpHelpers=require("./httpHelpers"),_some=require("./some"),_utils=require("./utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function asyncGeneratorStep(e,r,t,n,u,o,i){try{var l=e[o](i),a=l.value}catch(e){return void t(e)}l.done?r(a):Promise.resolve(a).then(n,u)}function _asyncToGenerator(e){return function(){var r=this,t=arguments;return new Promise(function(n,u){var o=e.apply(r,t);function _next(e){asyncGeneratorStep(o,n,u,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,n,u,_next,_throw,"throw",e)}_next(void 0)})}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e}var Torus=function(){function Torus(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).enableLogging,r=void 0!==e&&e;_classCallCheck(this,Torus),this.ec=(0,_elliptic.ec)("secp256k1"),_loglevel.default.setDefaultLevel("DEBUG"),r||_loglevel.default.disableAll()}return _createClass(Torus,[{key:"retrieveShares",value:function retrieveShares(e,r,t,n,u){var o=this;return new Promise(function(i,l){for(var a=[],s=_eccrypto.default.generatePrivate(),c=_eccrypto.default.getPublic(s).toString("hex"),f=c.slice(2,66),d=c.slice(66),p=(0,_web3Utils.keccak256)(u),h=0;h<e.length;h++){var v=(0,_httpHelpers.post)(e[h],(0,_httpHelpers.generateJsonRPCObject)("CommitmentRequest",{messageprefix:"mug00",tokencommitment:p.slice(2),temppubx:f,temppuby:d,timestamp:(Date.now()-2e3).toString().slice(0,10),verifieridentifier:t})).catch(function(e){return _loglevel.default.debug("commitment",e)});a.push(v)}(0,_some.Some)(a,function(r){return r.filter(function(e){return e}).length>=3*~~(e.length/4)+1?Promise.resolve(r):Promise.reject(new Error("invalid"))}).then(function(i){for(var l=[],a=[],c=0;c<i.length;c++)i[c]&&a.push(i[c].result);for(var f=0;f<e.length;f++){var d=(0,_httpHelpers.post)(e[f],(0,_httpHelpers.generateJsonRPCObject)("ShareRequest",{encrypted:"yes",item:[_objectSpread({},n,{idtoken:u,nodesignatures:a,verifieridentifier:t})]})).catch(function(e){return _loglevel.default.debug("share req",e)});l.push(d)}return(0,_some.Some)(l,function(){var t=_asyncToGenerator(regeneratorRuntime.mark(function _callee(t){var n,u,i,l,a,c,f,d,p,h,v,m,_;return regeneratorRuntime.wrap(function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(n=t.filter(function(e){return e}),u=(0,_utils.thresholdSame)(t.map(function(e){return e&&e.result&&e.result.keys[0].PublicKey}),1+~~(e.length/2)),!(n.length>=1+~~(e.length/2)&&u)){b.next=24;break}for(i=[],l=[],a=0;a<t.length;a++)t[a]&&t[a].result&&t[a].result.keys&&t[a].result.keys.length>0?(t[a].result.keys.sort(function(e,r){return new _bn.default(e.Index,16).cmp(new _bn.default(r.Index,16))}),t[a].result.keys[0].Metadata?(c={ephemPublicKey:Buffer.from(t[a].result.keys[0].Metadata.ephemPublicKey,"hex"),iv:Buffer.from(t[a].result.keys[0].Metadata.iv,"hex"),mac:Buffer.from(t[a].result.keys[0].Metadata.mac,"hex"),mode:Buffer.from(t[a].result.keys[0].Metadata.mode,"hex")},i.push(_eccrypto.default.decrypt(s,_objectSpread({},c,{ciphertext:Buffer.from(atob(t[a].result.keys[0].Share).padStart(64,"0"),"hex")})).catch(function(e){return _loglevel.default.debug("share decryption",e)}))):i.push(Promise.resolve(Buffer.from(t[a].result.keys[0].Share.padStart(64,"0"),"hex")))):i.push(Promise.resolve(void 0)),l.push(new _bn.default(r[a],16));return b.next=8,Promise.all(i);case 8:f=b.sent,d=f.reduce(function(e,r,t){return r&&e.push({index:l[t],value:new _bn.default(r)}),e},[]),p=(0,_utils.kCombinations)(d.length,1+~~(e.length/2)),v=function _loop(e){var r=p[e],t=d.filter(function(e,t){return r.includes(t)}),n=t.map(function(e){return e.value}),i=t.map(function(e){return e.index}),l=o.lagrangeInterpolation(n,i),a=_eccrypto.default.getPublic(Buffer.from(l.toString(16,64),"hex")).toString("hex"),s=a.slice(2,66),c=a.slice(66);if(0===new _bn.default(s,16).cmp(new _bn.default(u.X,16))&&0===new _bn.default(c,16).cmp(new _bn.default(u.Y,16)))return h=l,"break"},m=0;case 13:if(!(m<p.length)){b.next=20;break}if("break"!==v(m)){b.next=17;break}return b.abrupt("break",20);case 17:m++,b.next=13;break;case 20:if(void 0!==h){b.next=22;break}throw new Error("could not derive private key");case 22:return _=o.generateAddressFromPrivKey(h),b.abrupt("return",{ethAddress:_,privKey:h.toString("hex",64)});case 24:throw new Error("invalid");case 25:case"end":return b.stop()}},_callee)}));return function(e){return t.apply(this,arguments)}}())}).then(function(e){i(e)}).catch(function(e){l(e)})})}},{key:"lagrangeInterpolation",value:function lagrangeInterpolation(e,r){if(e.length!==r.length)return null;for(var t=new _bn.default(0),n=0;n<e.length;n++){for(var u=new _bn.default(1),o=new _bn.default(1),i=0;i<e.length;i++)if(n!==i){u=(u=u.mul(r[i].neg())).umod(this.ec.curve.n);var l=r[n].sub(r[i]);l=l.umod(this.ec.curve.n),o=o.mul(l).umod(this.ec.curve.n)}var a=u.mul(o.invm(this.ec.curve.n)).umod(this.ec.curve.n);a=a.mul(e[n]).umod(this.ec.curve.n),t=t.add(a)}return t.umod(this.ec.curve.n)}},{key:"generateAddressFromPrivKey",value:function generateAddressFromPrivKey(e){var r=this.ec.keyFromPrivate(e.toString("hex",64),"hex").getPublic().encode("hex").slice(2),t="0x"+(0,_web3Utils.keccak256)(Buffer.from(r,"hex")).slice(26);return(0,_web3Utils.toChecksumAddress)(t)}},{key:"getPublicAddress",value:function getPublicAddress(e,r,t){var n=t.verifier,u=t.verifierId;return new Promise(function(t,o){(0,_utils.keyLookup)(e,n,u).then(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.keyResult;return t.errorResult?(0,_utils.keyAssign)(e,r,void 0,void 0,n,u).then(function(r){return(0,_utils.keyLookup)(e,n,u)}):i?Promise.resolve({keyResult:i}):o(new Error("node results do not match"))}).then(function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).keyResult;if(e){var r=e.keys[0].address;t(r)}else o(new Error("node results do not match"))}).catch(function(e){return o(e)})})}}]),Torus}(),_default=Torus;exports.default=_default; | |
}).call(this,require("buffer").Buffer) | |
},{"./httpHelpers":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/httpHelpers.js","./some":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/some.js","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/node_modules/bn.js/lib/bn.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","eccrypto":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/browser.js","elliptic":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic.js","loglevel":"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js","web3-utils":"/Users/lentan/repo/torus/torus-embed/node_modules/web3-utils/src/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/utils.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.keyAssign=exports.keyLookup=exports.thresholdSame=exports.kCombinations=void 0;var _jsonStableStringify=_interopRequireDefault(require("json-stable-stringify")),_httpHelpers=require("./httpHelpers"),_some=require("./some");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function _iterableToArray(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e)){for(var r=0,t=new Array(e.length);r<e.length;r++)t[r]=e[r];return t}}var kCombinations=function kCombinations(e,r){var t=e;if("number"==typeof t&&(t=Array.from({length:t},function(e,r){return r})),r>t.length||r<=0)return[];if(r===t.length)return[t];if(1===r)return t.reduce(function(e,r){return[].concat(_toConsumableArray(e),[[r]])},[]);for(var n=[],o=[],i=0;i<=t.length-r+1;i++){o=kCombinations(t.slice(i+1),r-1);for(var a=0;a<o.length;a++)n.push([t[i]].concat(_toConsumableArray(o[a])))}return n};exports.kCombinations=kCombinations;var thresholdSame=function thresholdSame(e,r){for(var t={},n=0;n<e.length;n++){var o=(0,_jsonStableStringify.default)(e[n]);if(t[o]=t[o]?t[o]+1:1,t[o]===r)return e[n]}};exports.thresholdSame=thresholdSame;var keyLookup=function keyLookup(e,r,t){var n=e.map(function(e){return(0,_httpHelpers.post)(e,(0,_httpHelpers.generateJsonRPCObject)("VerifierLookupRequest",{verifier:r,verifier_id:t.toString().toLowerCase()})).catch(function(e){})});return(0,_some.Some)(n,function(r){var t=r.filter(function(e){return e}),n=thresholdSame(t.map(function(e){return e&&e.error}),1+~~(e.length/2)),o=thresholdSame(t.map(function(e){return e&&e.result}),1+~~(e.length/2));return o||n?Promise.resolve({keyResult:o,errorResult:n}):Promise.reject(new Error("invalid"))}).catch(function(e){})};exports.keyLookup=keyLookup;var keyAssign=function keyAssign(e,r,t,n,o,i){var a,s;if(void 0===t?(a=Math.floor(Math.random()*e.length),s=a):a=t%e.length,a===n)throw new Error("Looped through all");void 0!==n&&(s=n);var u=(0,_httpHelpers.generateJsonRPCObject)("KeyAssign",{verifier:o,verifier_id:i.toString().toLowerCase()});return(0,_httpHelpers.post)("https://signer.tor.us/api/sign",u,{headers:{pubKeyX:r[a].X,pubKeyY:r[a].Y}}).then(function(t){return(0,_httpHelpers.post)(e[a],_objectSpread({},u,{},t),{headers:{"Content-Type":"application/json; charset=utf-8"}}).catch(function(t){return keyAssign(e,r,a+1,s,o,i)})})};exports.keyAssign=keyAssign; | |
},{"./httpHelpers":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/httpHelpers.js","./some":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/some.js","json-stable-stringify":"/Users/lentan/repo/torus/torus-embed/node_modules/json-stable-stringify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/index.js":[function(require,module,exports){ | |
const Torus=require("./dist/torus");module.exports=Torus; | |
},{"./dist/torus":"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/dist/torus.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@toruslabs/torus.js/node_modules/bn.js/lib/bn.js":[function(require,module,exports){ | |
!function(t,i){"use strict";function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i,r){if(BN.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var r;"object"==typeof t?t.exports=BN:i.BN=BN,BN.BN=BN,BN.wordSize=26;try{r=require("buffer").Buffer}catch(t){}function parseHex(t,i,r){for(var e=0,n=Math.min(t.length,r),h=0,s=i;s<n;s++){var o,u=t.charCodeAt(s)-48;e<<=4,e|=o=u>=49&&u<=54?u-49+10:u>=17&&u<=22?u-17+10:u,h|=o}return assert(!(240&h),"Invalid character in "+t),e}function parseBase(t,i,r,e){for(var n=0,h=0,s=Math.min(t.length,r),o=i;o<s;o++){var u=t.charCodeAt(o)-48;n*=e,h=u>=49?u-49+10:u>=17?u-17+10:u,assert(u>=0&&h<e,"Invalid character"),n+=h}return n}function move(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}BN.isBN=function isBN(t){return t instanceof BN||null!==t&&"object"==typeof t&&t.constructor.wordSize===BN.wordSize&&Array.isArray(t.words)},BN.max=function max(t,i){return t.cmp(i)>0?t:i},BN.min=function min(t,i){return t.cmp(i)<0?t:i},BN.prototype._init=function init(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),assert(i===(0|i)&&i>=2&&i<=36);var e=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&e++,16===i?this._parseHex(t,e):this._parseBase(t,i,e),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initNumber=function _initNumber(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(assert(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initArray=function _initArray(t,i,r){if(assert("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h,s=0;if("be"===r)for(e=t.length-1,n=0;e>=0;e-=3)h=t[e]|t[e-1]<<8|t[e-2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(e=0,n=0;e<t.length;e+=3)h=t[e]|t[e+1]<<8|t[e+2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this._strip()},BN.prototype._parseHex=function _parseHex(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var e,n,h=0;for(r=t.length-6,e=0;r>=i;r-=6)n=parseHex(t,r,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303,(h+=24)>=26&&(h-=26,e++);r+6!==i&&(n=parseHex(t,i,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303),this._strip()},BN.prototype._parseBase=function _parseBase(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,s=h%e,o=Math.min(h,h-s)+r,u=0,a=r;a<o;a+=e)u=parseBase(t,a,a+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=parseBase(t,a,t.length,i),a=0;a<s;a++)l*=i;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},BN.prototype.copy=function copy(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},BN.prototype._move=function _move(t){move(t,this)},BN.prototype.clone=function clone(){var t=new BN(null);return this.copy(t),t},BN.prototype._expand=function _expand(t){for(;this.length<t;)this.words[this.length++]=0;return this},BN.prototype._strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for?BN.prototype[Symbol.for("nodejs.util.inspect.custom")]=inspect:BN.prototype.inspect=inspect;var e=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],n=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var s=0,o=0,u=0;u<this.length;u++){var a=this.words[u],l=(16777215&(a<<s|o)).toString(16);r=0!==(o=a>>>24-s&16777215)||u!==this.length-1?e[6-l.length]+l+r:l+r,(s+=2)>=26&&(s-=26,u--)}for(0!==o&&(r=o.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var m=n[t],f=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modrn(f).toString(t);r=(d=d.idivn(f)).isZero()?p+r:e[m-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},BN.prototype.toJSON=function toJSON(){return this.toString(16,2)},r&&(BN.prototype.toBuffer=function toBuffer(t,i){return this.toArrayLike(r,t,i)}),BN.prototype.toArray=function toArray(t,i){return this.toArrayLike(Array,t,i)};function smallMulTo(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],s=n*h,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(s=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&s}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}BN.prototype.toArrayLike=function toArrayLike(t,i,r){this._strip();var e=this.byteLength(),n=r||Math.max(1,e);assert(e<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0");var h=function allocate(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,n);return this["_toArrayLike"+("le"===i?"LE":"BE")](h,e),h},BN.prototype._toArrayLikeLE=function _toArrayLikeLE(t,i){for(var r=0,e=0,n=0,h=0;n<this.length;n++){var s=this.words[n]<<h|e;t[r++]=255&s,r<t.length&&(t[r++]=s>>8&255),r<t.length&&(t[r++]=s>>16&255),6===h?(r<t.length&&(t[r++]=s>>24&255),e=0,h=0):(e=s>>>24,h+=2)}if(r<t.length)for(t[r++]=e;r<t.length;)t[r++]=0},BN.prototype._toArrayLikeBE=function _toArrayLikeBE(t,i){for(var r=t.length-1,e=0,n=0,h=0;n<this.length;n++){var s=this.words[n]<<h|e;t[r--]=255&s,r>=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===h?(r>=0&&(t[r--]=s>>24&255),e=0,h=0):(e=s>>>24,h+=2)}if(r>=0)for(t[r--]=e;r>=0;)t[r--]=0},Math.clz32?BN.prototype._countBits=function _countBits(t){return 32-Math.clz32(t)}:BN.prototype._countBits=function _countBits(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},BN.prototype._zeroBits=function _zeroBits(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},BN.prototype.bitLength=function bitLength(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},BN.prototype.ior=function ior(t){return assert(0==(this.negative|t.negative)),this.iuor(t)},BN.prototype.or=function or(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},BN.prototype.uor=function uor(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},BN.prototype.iuand=function iuand(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this._strip()},BN.prototype.iand=function iand(t){return assert(0==(this.negative|t.negative)),this.iuand(t)},BN.prototype.and=function and(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},BN.prototype.uand=function uand(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},BN.prototype.iuxor=function iuxor(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this._strip()},BN.prototype.ixor=function ixor(t){return assert(0==(this.negative|t.negative)),this.iuxor(t)},BN.prototype.xor=function xor(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},BN.prototype.uxor=function uxor(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},BN.prototype.inotn=function inotn(t){assert("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var e=0;e<i;e++)this.words[e]=67108863&~this.words[e];return r>0&&(this.words[e]=~this.words[e]&67108863>>26-r),this._strip()},BN.prototype.notn=function notn(t){return this.clone().inotn(t)},BN.prototype.setn=function setn(t,i){assert("number"==typeof t&&t>=0);var r=t/26|0,e=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<e:this.words[r]&~(1<<e),this._strip()},BN.prototype.iadd=function iadd(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},BN.prototype.add=function add(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function isub(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,s=0;s<e.length;s++)h=(i=(0|r.words[s])-(0|e.words[s])+h)>>26,this.words[s]=67108863&i;for(;0!==h&&s<r.length;s++)h=(i=(0|r.words[s])+h)>>26,this.words[s]=67108863&i;if(0===h&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},BN.prototype.sub=function sub(t){return this.clone().isub(t)};var s=function comb10MulTo(t,i,r){var e,n,h,s=t.words,o=i.words,u=r.words,a=0,l=0|s[0],m=8191&l,f=l>>>13,d=0|s[1],p=8191&d,M=d>>>13,v=0|s[2],g=8191&v,c=v>>>13,w=0|s[3],y=8191&w,B=w>>>13,N=0|s[4],b=8191&N,_=N>>>13,R=0|s[5],A=8191&R,k=R>>>13,S=0|s[6],x=8191&S,T=S>>>13,q=0|s[7],P=8191&q,F=q>>>13,L=0|s[8],Z=8191&L,I=L>>>13,E=0|s[9],z=8191&E,K=E>>>13,j=0|o[0],O=8191&j,H=j>>>13,D=0|o[1],U=8191&D,C=D>>>13,J=0|o[2],G=8191&J,Q=J>>>13,V=0|o[3],W=8191&V,X=V>>>13,Y=0|o[4],$=8191&Y,tt=Y>>>13,it=0|o[5],rt=8191&it,et=it>>>13,nt=0|o[6],ht=8191&nt,st=nt>>>13,ot=0|o[7],ut=8191&ot,at=ot>>>13,lt=0|o[8],mt=8191<,ft=lt>>>13,dt=0|o[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(m,O))|0)+((8191&(n=(n=Math.imul(m,H))+Math.imul(f,O)|0))<<13)|0;a=((h=Math.imul(f,H))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(p,O),n=(n=Math.imul(p,H))+Math.imul(M,O)|0,h=Math.imul(M,H);var gt=(a+(e=e+Math.imul(m,U)|0)|0)+((8191&(n=(n=n+Math.imul(m,C)|0)+Math.imul(f,U)|0))<<13)|0;a=((h=h+Math.imul(f,C)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,O),n=(n=Math.imul(g,H))+Math.imul(c,O)|0,h=Math.imul(c,H),e=e+Math.imul(p,U)|0,n=(n=n+Math.imul(p,C)|0)+Math.imul(M,U)|0,h=h+Math.imul(M,C)|0;var ct=(a+(e=e+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((h=h+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(y,O),n=(n=Math.imul(y,H))+Math.imul(B,O)|0,h=Math.imul(B,H),e=e+Math.imul(g,U)|0,n=(n=n+Math.imul(g,C)|0)+Math.imul(c,U)|0,h=h+Math.imul(c,C)|0,e=e+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,h=h+Math.imul(M,Q)|0;var wt=(a+(e=e+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(b,O),n=(n=Math.imul(b,H))+Math.imul(_,O)|0,h=Math.imul(_,H),e=e+Math.imul(y,U)|0,n=(n=n+Math.imul(y,C)|0)+Math.imul(B,U)|0,h=h+Math.imul(B,C)|0,e=e+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,h=h+Math.imul(c,Q)|0,e=e+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,h=h+Math.imul(M,X)|0;var yt=(a+(e=e+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(A,O),n=(n=Math.imul(A,H))+Math.imul(k,O)|0,h=Math.imul(k,H),e=e+Math.imul(b,U)|0,n=(n=n+Math.imul(b,C)|0)+Math.imul(_,U)|0,h=h+Math.imul(_,C)|0,e=e+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(B,G)|0,h=h+Math.imul(B,Q)|0,e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,h=h+Math.imul(c,X)|0,e=e+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,h=h+Math.imul(M,tt)|0;var Bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(x,O),n=(n=Math.imul(x,H))+Math.imul(T,O)|0,h=Math.imul(T,H),e=e+Math.imul(A,U)|0,n=(n=n+Math.imul(A,C)|0)+Math.imul(k,U)|0,h=h+Math.imul(k,C)|0,e=e+Math.imul(b,G)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(_,G)|0,h=h+Math.imul(_,Q)|0,e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(B,W)|0,h=h+Math.imul(B,X)|0,e=e+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,h=h+Math.imul(c,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(M,rt)|0,h=h+Math.imul(M,et)|0;var Nt=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,st)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(P,O),n=(n=Math.imul(P,H))+Math.imul(F,O)|0,h=Math.imul(F,H),e=e+Math.imul(x,U)|0,n=(n=n+Math.imul(x,C)|0)+Math.imul(T,U)|0,h=h+Math.imul(T,C)|0,e=e+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(k,G)|0,h=h+Math.imul(k,Q)|0,e=e+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(_,W)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(B,$)|0,h=h+Math.imul(B,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(c,rt)|0,h=h+Math.imul(c,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(M,ht)|0,h=h+Math.imul(M,st)|0;var bt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(Z,O),n=(n=Math.imul(Z,H))+Math.imul(I,O)|0,h=Math.imul(I,H),e=e+Math.imul(P,U)|0,n=(n=n+Math.imul(P,C)|0)+Math.imul(F,U)|0,h=h+Math.imul(F,C)|0,e=e+Math.imul(x,G)|0,n=(n=n+Math.imul(x,Q)|0)+Math.imul(T,G)|0,h=h+Math.imul(T,Q)|0,e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(k,W)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(_,$)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(B,rt)|0,h=h+Math.imul(B,et)|0,e=e+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(c,ht)|0,h=h+Math.imul(c,st)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,h=h+Math.imul(M,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(z,O),n=(n=Math.imul(z,H))+Math.imul(K,O)|0,h=Math.imul(K,H),e=e+Math.imul(Z,U)|0,n=(n=n+Math.imul(Z,C)|0)+Math.imul(I,U)|0,h=h+Math.imul(I,C)|0,e=e+Math.imul(P,G)|0,n=(n=n+Math.imul(P,Q)|0)+Math.imul(F,G)|0,h=h+Math.imul(F,Q)|0,e=e+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(T,W)|0,h=h+Math.imul(T,X)|0,e=e+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(k,$)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(B,ht)|0,h=h+Math.imul(B,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,h=h+Math.imul(c,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,h=h+Math.imul(M,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(z,U),n=(n=Math.imul(z,C))+Math.imul(K,U)|0,h=Math.imul(K,C),e=e+Math.imul(Z,G)|0,n=(n=n+Math.imul(Z,Q)|0)+Math.imul(I,G)|0,h=h+Math.imul(I,Q)|0,e=e+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(F,W)|0,h=h+Math.imul(F,X)|0,e=e+Math.imul(x,$)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(T,$)|0,h=h+Math.imul(T,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(B,ut)|0,h=h+Math.imul(B,at)|0,e=e+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,h=h+Math.imul(c,ft)|0;var At=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((h=h+Math.imul(M,Mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(z,G),n=(n=Math.imul(z,Q))+Math.imul(K,G)|0,h=Math.imul(K,Q),e=e+Math.imul(Z,W)|0,n=(n=n+Math.imul(Z,X)|0)+Math.imul(I,W)|0,h=h+Math.imul(I,X)|0,e=e+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(F,$)|0,h=h+Math.imul(F,tt)|0,e=e+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,et)|0)+Math.imul(T,rt)|0,h=h+Math.imul(T,et)|0,e=e+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,st)|0,e=e+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(B,mt)|0,h=h+Math.imul(B,ft)|0;var kt=(a+(e=e+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((h=h+Math.imul(c,Mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(z,W),n=(n=Math.imul(z,X))+Math.imul(K,W)|0,h=Math.imul(K,X),e=e+Math.imul(Z,$)|0,n=(n=n+Math.imul(Z,tt)|0)+Math.imul(I,$)|0,h=h+Math.imul(I,tt)|0,e=e+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,et)|0)+Math.imul(F,rt)|0,h=h+Math.imul(F,et)|0,e=e+Math.imul(x,ht)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(T,ht)|0,h=h+Math.imul(T,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(b,mt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var St=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((h=h+Math.imul(B,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(z,$),n=(n=Math.imul(z,tt))+Math.imul(K,$)|0,h=Math.imul(K,tt),e=e+Math.imul(Z,rt)|0,n=(n=n+Math.imul(Z,et)|0)+Math.imul(I,rt)|0,h=h+Math.imul(I,et)|0,e=e+Math.imul(P,ht)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(F,ht)|0,h=h+Math.imul(F,st)|0,e=e+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,at)|0)+Math.imul(T,ut)|0,h=h+Math.imul(T,at)|0,e=e+Math.imul(A,mt)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var xt=(a+(e=e+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,Mt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(z,rt),n=(n=Math.imul(z,et))+Math.imul(K,rt)|0,h=Math.imul(K,et),e=e+Math.imul(Z,ht)|0,n=(n=n+Math.imul(Z,st)|0)+Math.imul(I,ht)|0,h=h+Math.imul(I,st)|0,e=e+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(F,ut)|0,h=h+Math.imul(F,at)|0,e=e+Math.imul(x,mt)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(T,mt)|0,h=h+Math.imul(T,ft)|0;var Tt=(a+(e=e+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,Mt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,Mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(z,ht),n=(n=Math.imul(z,st))+Math.imul(K,ht)|0,h=Math.imul(K,st),e=e+Math.imul(Z,ut)|0,n=(n=n+Math.imul(Z,at)|0)+Math.imul(I,ut)|0,h=h+Math.imul(I,at)|0,e=e+Math.imul(P,mt)|0,n=(n=n+Math.imul(P,ft)|0)+Math.imul(F,mt)|0,h=h+Math.imul(F,ft)|0;var qt=(a+(e=e+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((h=h+Math.imul(T,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(z,ut),n=(n=Math.imul(z,at))+Math.imul(K,ut)|0,h=Math.imul(K,at),e=e+Math.imul(Z,mt)|0,n=(n=n+Math.imul(Z,ft)|0)+Math.imul(I,mt)|0,h=h+Math.imul(I,ft)|0;var Pt=(a+(e=e+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,Mt)|0)+Math.imul(F,pt)|0))<<13)|0;a=((h=h+Math.imul(F,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,e=Math.imul(z,mt),n=(n=Math.imul(z,ft))+Math.imul(K,mt)|0,h=Math.imul(K,ft);var Ft=(a+(e=e+Math.imul(Z,pt)|0)|0)+((8191&(n=(n=n+Math.imul(Z,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((h=h+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863;var Lt=(a+(e=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,Mt))+Math.imul(K,pt)|0))<<13)|0;return a=((h=Math.imul(K,Mt))+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=Bt,u[6]=Nt,u[7]=bt,u[8]=_t,u[9]=Rt,u[10]=At,u[11]=kt,u[12]=St,u[13]=xt,u[14]=Tt,u[15]=qt,u[16]=Pt,u[17]=Ft,u[18]=Lt,0!==a&&(u[19]=a,r.length++),r};function bigMulTo(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var s=n;n=0;for(var o=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;o=67108863&(f=f+o|0),n+=(s=(s=s+(m/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[h]=o,e=s,s=n}return 0!==e?r.words[h]=e:r.length--,r._strip()}function jumboMulTo(t,i,r){return bigMulTo(t,i,r)}function FFTM(t,i){this.x=t,this.y=i}Math.imul||(s=smallMulTo),BN.prototype.mulTo=function mulTo(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?s(this,t,i):r<63?smallMulTo(this,t,i):r<1024?bigMulTo(this,t,i):jumboMulTo(this,t,i)},FFTM.prototype.makeRBT=function makeRBT(t){for(var i=new Array(t),r=BN.prototype._countBits(t)-1,e=0;e<t;e++)i[e]=this.revBin(e,r,t);return i},FFTM.prototype.revBin=function revBin(t,i,r){if(0===t||t===r-1)return t;for(var e=0,n=0;n<i;n++)e|=(1&t)<<i-n-1,t>>=1;return e},FFTM.prototype.permute=function permute(t,i,r,e,n,h){for(var s=0;s<h;s++)e[s]=i[t[s]],n[s]=r[t[s]]},FFTM.prototype.transform=function transform(t,i,r,e,n,h){this.permute(h,t,i,r,e,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),a=Math.sin(2*Math.PI/o),l=0;l<n;l+=o)for(var m=u,f=a,d=0;d<s;d++){var p=r[l+d],M=e[l+d],v=r[l+d+s],g=e[l+d+s],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,e[l+d]=M+g,r[l+d+s]=p-v,e[l+d+s]=M-g,d!==o&&(c=u*m-a*f,f=u*f+a*m,m=c)}},FFTM.prototype.guessLen13b=function guessLen13b(t,i){var r=1|Math.max(i,t),e=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+e},FFTM.prototype.conjugate=function conjugate(t,i,r){if(!(r<=1))for(var e=0;e<r/2;e++){var n=t[e];t[e]=t[r-e-1],t[r-e-1]=n,n=i[e],i[e]=-i[r-e-1],i[r-e-1]=-n}},FFTM.prototype.normalize13b=function normalize13b(t,i){for(var r=0,e=0;e<i/2;e++){var n=8192*Math.round(t[2*e+1]/i)+Math.round(t[2*e]/i)+r;t[e]=67108863&n,r=n<67108864?0:n/67108864|0}return t},FFTM.prototype.convert13b=function convert13b(t,i,r,e){for(var n=0,h=0;h<i;h++)n+=0|t[h],r[2*h]=8191&n,n>>>=13,r[2*h+1]=8191&n,n>>>=13;for(h=2*i;h<e;++h)r[h]=0;assert(0===n),assert(0==(-8192&n))},FFTM.prototype.stub=function stub(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},FFTM.prototype.mulp=function mulp(t,i,r){var e=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(e),h=this.stub(e),s=new Array(e),o=new Array(e),u=new Array(e),a=new Array(e),l=new Array(e),m=new Array(e),f=r.words;f.length=e,this.convert13b(t.words,t.length,s,e),this.convert13b(i.words,i.length,a,e),this.transform(s,h,o,u,e,n),this.transform(a,h,l,m,e,n);for(var d=0;d<e;d++){var p=o[d]*l[d]-u[d]*m[d];u[d]=o[d]*m[d]+u[d]*l[d],o[d]=p}return this.conjugate(o,u,e),this.transform(o,u,f,h,e,n),this.conjugate(f,h,e),this.normalize13b(f,e),r.negative=t.negative^i.negative,r.length=t.length+i.length,r._strip()},BN.prototype.mul=function mul(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.mulf=function mulf(t){var i=new BN(null);return i.words=new Array(this.length+t.length),jumboMulTo(this,t,i)},BN.prototype.imul=function imul(t){return this.clone().mulTo(t,this)},BN.prototype.imuln=function imuln(t){var i=t<0;i&&(t=-t),assert("number"==typeof t),assert(t<67108864);for(var r=0,e=0;e<this.length;e++){var n=(0|this.words[e])*t,h=(67108863&n)+(67108863&r);r>>=26,r+=n/67108864|0,r+=h>>>26,this.words[e]=67108863&h}return 0!==r&&(this.words[e]=r,this.length++),i?this.ineg():this},BN.prototype.muln=function muln(t){return this.clone().imuln(t)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(t){var i=function toBitArray(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=t.words[e]>>>n&1}return i}(t);if(0===i.length)return new BN(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},BN.prototype.iushln=function iushln(t){assert("number"==typeof t&&t>=0);var i,r=t%26,e=(t-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var h=0;for(i=0;i<this.length;i++){var s=this.words[i]&n,o=(0|this.words[i])-s<<r;this.words[i]=o|h,h=s>>>26-r}h&&(this.words[i]=h,this.length++)}if(0!==e){for(i=this.length-1;i>=0;i--)this.words[i+e]=this.words[i];for(i=0;i<e;i++)this.words[i]=0;this.length+=e}return this._strip()},BN.prototype.ishln=function ishln(t){return assert(0===this.negative),this.iushln(t)},BN.prototype.iushrn=function iushrn(t,i,r){var e;assert("number"==typeof t&&t>=0),e=i?(i-i%26)/26:0;var n=t%26,h=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,o=r;if(e-=h,e=Math.max(0,e),o){for(var u=0;u<h;u++)o.words[u]=this.words[u];o.length=h}if(0===h);else if(this.length>h)for(this.length-=h,u=0;u<this.length;u++)this.words[u]=this.words[u+h];else this.words[0]=0,this.length=1;var a=0;for(u=this.length-1;u>=0&&(0!==a||u>=e);u--){var l=0|this.words[u];this.words[u]=a<<26-n|l>>>n,a=l&s}return o&&0!==a&&(o.words[o.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},BN.prototype.ishrn=function ishrn(t,i,r){return assert(0===this.negative),this.iushrn(t,i,r)},BN.prototype.shln=function shln(t){return this.clone().ishln(t)},BN.prototype.ushln=function ushln(t){return this.clone().iushln(t)},BN.prototype.shrn=function shrn(t){return this.clone().ishrn(t)},BN.prototype.ushrn=function ushrn(t){return this.clone().iushrn(t)},BN.prototype.testn=function testn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,e=1<<i;return!(this.length<=r)&&!!(this.words[r]&e)},BN.prototype.imaskn=function imaskn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var e=67108863^67108863>>>i<<i;this.words[this.length-1]&=e}return this._strip()},BN.prototype.maskn=function maskn(t){return this.clone().imaskn(t)},BN.prototype.iaddn=function iaddn(t){return assert("number"==typeof t),assert(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},BN.prototype._iaddn=function _iaddn(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function isubn(t){if(assert("number"==typeof t),assert(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},BN.prototype.addn=function addn(t){return this.clone().iaddn(t)},BN.prototype.subn=function subn(t){return this.clone().isubn(t)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(t,i,r){var e,n,h=t.length+r;this._expand(h);var s=0;for(e=0;e<t.length;e++){n=(0|this.words[e+r])+s;var o=(0|t.words[e])*i;s=((n-=67108863&o)>>26)-(o/67108864|0),this.words[e+r]=67108863&n}for(;e<this.length-r;e++)s=(n=(0|this.words[e+r])+s)>>26,this.words[e+r]=67108863&n;if(0===s)return this._strip();for(assert(-1===s),s=0,e=0;e<this.length;e++)s=(n=-(0|this.words[e])+s)>>26,this.words[e]=67108863&n;return this.negative=1,this._strip()},BN.prototype._wordDiv=function _wordDiv(t,i){var r=(this.length,t.length),e=this.clone(),n=t,h=0|n.words[n.length-1];0!==(r=26-this._countBits(h))&&(n=n.ushln(r),e.iushln(r),h=0|n.words[n.length-1]);var s,o=e.length-n.length;if("mod"!==i){(s=new BN(null)).length=o+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var a=e.clone()._ishlnsubmul(n,1,o);0===a.negative&&(e=a,s&&(s.words[o]=1));for(var l=o-1;l>=0;l--){var m=67108864*(0|e.words[n.length+l])+(0|e.words[n.length+l-1]);for(m=Math.min(m/h|0,67108863),e._ishlnsubmul(n,m,l);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,l),e.isZero()||(e.negative^=1);s&&(s.words[l]=m)}return s&&s._strip(),e._strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},BN.prototype.divmod=function divmod(t,i,r){return assert(!t.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(e=h.div.neg()),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.iadd(t)),{div:e,mod:n}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(e=h.div.neg()),{div:e,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.isub(t)),{div:h.div,mod:n}):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modrn(t.words[0]))}:this._wordDiv(t,i);var e,n,h},BN.prototype.div=function div(t){return this.divmod(t,"div",!1).div},BN.prototype.mod=function mod(t){return this.divmod(t,"mod",!1).mod},BN.prototype.umod=function umod(t){return this.divmod(t,"mod",!0).mod},BN.prototype.divRound=function divRound(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modrn=function modrn(t){var i=t<0;i&&(t=-t),assert(t<=67108863);for(var r=(1<<26)%t,e=0,n=this.length-1;n>=0;n--)e=(r*e+(0|this.words[n]))%t;return i?-e:e},BN.prototype.modn=function modn(t){return this.modrn(t)},BN.prototype.idivn=function idivn(t){var i=t<0;i&&(t=-t),assert(t<=67108863);for(var r=0,e=this.length-1;e>=0;e--){var n=(0|this.words[e])+67108864*r;this.words[e]=n/t|0,r=n%t}return this._strip(),i?this.ineg():this},BN.prototype.divn=function divn(t){return this.clone().idivn(t)},BN.prototype.egcd=function egcd(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new BN(1),n=new BN(0),h=new BN(0),s=new BN(1),o=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++o;for(var u=r.clone(),a=i.clone();!i.isZero();){for(var l=0,m=1;0==(i.words[0]&m)&&l<26;++l,m<<=1);if(l>0)for(i.iushrn(l);l-- >0;)(e.isOdd()||n.isOdd())&&(e.iadd(u),n.isub(a)),e.iushrn(1),n.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(h.isOdd()||s.isOdd())&&(h.iadd(u),s.isub(a)),h.iushrn(1),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),e.isub(h),n.isub(s)):(r.isub(i),h.isub(e),s.isub(n))}return{a:h,b:s,gcd:r.iushln(o)}},BN.prototype._invmp=function _invmp(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,n=new BN(1),h=new BN(0),s=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var o=0,u=1;0==(i.words[0]&u)&&o<26;++o,u<<=1);if(o>0)for(i.iushrn(o);o-- >0;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var a=0,l=1;0==(r.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(r.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(s),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h)):(r.isub(i),h.isub(n))}return(e=0===i.cmpn(1)?n:h).cmpn(0)<0&&e.iadd(t),e},BN.prototype.gcd=function gcd(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},BN.prototype.invm=function invm(t){return this.egcd(t).a.umod(t)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(t){return this.words[0]&t},BN.prototype.bincn=function bincn(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,e=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=e,this;for(var n=e,h=r;0!==n&&h<this.length;h++){var s=0|this.words[h];n=(s+=n)>>>26,s&=67108863,this.words[h]=s}return 0!==n&&(this.words[h]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)i=1;else{r&&(t=-t),assert(t<=67108863,"Number is too big");var e=0|this.words[0];i=e===t?0:e<t?-1:1}return 0!==this.negative?0|-i:i},BN.prototype.cmp=function cmp(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},BN.prototype.ucmp=function ucmp(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},BN.prototype.gtn=function gtn(t){return 1===this.cmpn(t)},BN.prototype.gt=function gt(t){return 1===this.cmp(t)},BN.prototype.gten=function gten(t){return this.cmpn(t)>=0},BN.prototype.gte=function gte(t){return this.cmp(t)>=0},BN.prototype.ltn=function ltn(t){return-1===this.cmpn(t)},BN.prototype.lt=function lt(t){return-1===this.cmp(t)},BN.prototype.lten=function lten(t){return this.cmpn(t)<=0},BN.prototype.lte=function lte(t){return this.cmp(t)<=0},BN.prototype.eqn=function eqn(t){return 0===this.cmpn(t)},BN.prototype.eq=function eq(t){return 0===this.cmp(t)},BN.red=function red(t){return new Red(t)},BN.prototype.toRed=function toRed(t){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(t){return this.red=t,this},BN.prototype.forceRed=function forceRed(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function redAdd(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function redIAdd(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function redSub(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function redISub(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function redShl(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function redMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function redIMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var o={k256:null,p224:null,p192:null,p25519:null};function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else assert(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function ireduce(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):r._strip(),r},MPrime.prototype.split=function split(t,i){t.iushrn(this.n,0,i)},MPrime.prototype.imulK=function imulK(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(t,i){for(var r=Math.min(t.length,9),e=0;e<r;e++)i.words[e]=t.words[e];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(i.words[i.length++]=4194303&n,e=10;e<t.length;e++){var h=0|t.words[e];t.words[e-10]=(4194303&h)<<4|n>>>22,n=h}n>>>=22,t.words[e-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},K256.prototype.imulK=function imulK(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function prime(t){if(o[t])return o[t];var prime;if("k256"===t)prime=new K256;else if("p224"===t)prime=new P224;else if("p192"===t)prime=new P192;else{if("p25519"!==t)throw new Error("Unknown prime "+t);prime=new P25519}return o[t]=prime,prime},Red.prototype._verify1=function _verify1(t){assert(0===t.negative,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(t,i){assert(0==(t.negative|i.negative),"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function imod(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(move(t,t.umod(this.m)._forceRed(this)),t)},Red.prototype.neg=function neg(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Red.prototype.add=function add(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},Red.prototype.iadd=function iadd(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},Red.prototype.sub=function sub(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},Red.prototype.isub=function isub(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function shl(t,i){return this._verify1(t),this.imod(t.ushln(i))},Red.prototype.imul=function imul(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function mul(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function isqr(t){return this.imul(t,t.clone())},Red.prototype.sqr=function sqr(t){return this.mul(t,t)},Red.prototype.sqrt=function sqrt(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(assert(i%2==1),3===i){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(t,r)}for(var e=this.m.subn(1),n=0;!e.isZero()&&0===e.andln(1);)n++,e.iushrn(1);assert(!e.isZero());var h=new BN(1).toRed(this),s=h.redNeg(),o=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new BN(2*u*u).toRed(this);0!==this.pow(u,o).cmp(s);)u.redIAdd(s);for(var a=this.pow(u,e),l=this.pow(t,e.addn(1).iushrn(1)),m=this.pow(t,e),f=n;0!==m.cmp(h);){for(var d=m,p=0;0!==d.cmp(h);p++)d=d.redSqr();assert(p<f);var M=this.pow(a,new BN(1).iushln(f-p-1));l=l.redMul(M),a=M.redSqr(),m=m.redMul(a),f=p}return l},Red.prototype.invm=function invm(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function pow(t,i){if(i.isZero())return new BN(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new BN(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],h=0,s=0,o=i.bitLength()%26;for(0===o&&(o=26),e=i.length-1;e>=0;e--){for(var u=i.words[e],a=o-1;a>=0;a--){var l=u>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==h?(h<<=1,h|=l,(4===++s||0===e&&0===a)&&(n=this.mul(n,r[h]),s=0,h=0)):s=0}o=26}return n},Red.prototype.convertTo=function convertTo(t){var i=t.umod(this.m);return i===t?i.clone():i},Red.prototype.convertFrom=function convertFrom(t){var i=t.clone();return i.red=null,i},BN.mont=function mont(t){return new Mont(t)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(t){return this.imod(t.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},Mont.prototype.imul=function imul(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.mul=function mul(t,i){if(t.isZero()||i.isZero())return new BN(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.invm=function invm(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@web3-js/websocket/lib/browser.js":[function(require,module,exports){ | |
var _globalThis;try{_globalThis=require("es5-ext/global")}catch(e){}finally{if(_globalThis||"undefined"==typeof window||(_globalThis=window),!_globalThis)throw new Error("Could not determine global this")}var NativeWebSocket=_globalThis.WebSocket||_globalThis.MozWebSocket,websocket_version=require("./version");function W3CWebSocket(e,o){return o?new NativeWebSocket(e,o):new NativeWebSocket(e)}NativeWebSocket&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(W3CWebSocket,e,{get:function(){return NativeWebSocket[e]}})}),module.exports={w3cwebsocket:NativeWebSocket?W3CWebSocket:null,version:websocket_version}; | |
},{"./version":"/Users/lentan/repo/torus/torus-embed/node_modules/@web3-js/websocket/lib/version.js","es5-ext/global":"/Users/lentan/repo/torus/torus-embed/node_modules/es5-ext/global.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@web3-js/websocket/lib/version.js":[function(require,module,exports){ | |
module.exports=require("../package.json").version; | |
},{"../package.json":"/Users/lentan/repo/torus/torus-embed/node_modules/@web3-js/websocket/package.json"}],"/Users/lentan/repo/torus/torus-embed/node_modules/@web3-js/websocket/package.json":[function(require,module,exports){ | |
module.exports={ | |
"_args": [ | |
[ | |
"@web3-js/[email protected]", | |
"/Users/lentan/repo/torus/torus-embed" | |
] | |
], | |
"_from": "@web3-js/[email protected]", | |
"_id": "@web3-js/[email protected]", | |
"_inBundle": false, | |
"_integrity": "sha512-fDwrD47MiDrzcJdSeTLF75aCcxVVt8B1N74rA+vh2XCAvFy4tEWJjtnUtj2QG7/zlQ6g9cQ88bZFBxwd9/FmtA==", | |
"_location": "/@web3-js/websocket", | |
"_phantomChildren": {}, | |
"_requested": { | |
"type": "version", | |
"registry": true, | |
"raw": "@web3-js/[email protected]", | |
"name": "@web3-js/websocket", | |
"escapedName": "@web3-js%2fwebsocket", | |
"scope": "@web3-js", | |
"rawSpec": "1.0.30", | |
"saveSpec": null, | |
"fetchSpec": "1.0.30" | |
}, | |
"_requiredBy": [ | |
"/web3-providers-ws" | |
], | |
"_resolved": "https://registry.npmjs.org/@web3-js/websocket/-/websocket-1.0.30.tgz", | |
"_spec": "1.0.30", | |
"_where": "/Users/lentan/repo/torus/torus-embed", | |
"author": { | |
"name": "Brian McKelvey", | |
"email": "[email protected]", | |
"url": "https://github.com/theturtle32" | |
}, | |
"browser": "lib/browser.js", | |
"bugs": { | |
"url": "https://github.com/web3-js/WebSocket-Node/issues" | |
}, | |
"config": { | |
"verbose": false | |
}, | |
"contributors": [ | |
{ | |
"name": "Iñaki Baz Castillo", | |
"email": "[email protected]", | |
"url": "http://dev.sipdoc.net" | |
} | |
], | |
"dependencies": { | |
"debug": "^2.2.0", | |
"es5-ext": "^0.10.50", | |
"nan": "^2.14.0", | |
"typedarray-to-buffer": "^3.1.5", | |
"yaeti": "^0.0.6" | |
}, | |
"description": "Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.", | |
"devDependencies": { | |
"buffer-equal": "^1.0.0", | |
"faucet": "^0.0.1", | |
"gulp": "^4.0.2", | |
"gulp-jshint": "^2.0.4", | |
"jshint": "^2.0.0", | |
"jshint-stylish": "^2.2.1", | |
"tape": "^4.9.1" | |
}, | |
"directories": { | |
"lib": "./lib" | |
}, | |
"engines": { | |
"node": ">=0.10.0" | |
}, | |
"homepage": "https://github.com/web3-js/WebSocket-Node", | |
"keywords": [ | |
"websocket", | |
"websockets", | |
"socket", | |
"networking", | |
"comet", | |
"push", | |
"RFC-6455", | |
"realtime", | |
"server", | |
"client" | |
], | |
"license": "Apache-2.0", | |
"main": "index", | |
"name": "@web3-js/websocket", | |
"repository": { | |
"type": "git", | |
"url": "git+https://github.com/web3-js/WebSocket-Node.git" | |
}, | |
"scripts": { | |
"gulp": "gulp", | |
"install": "(node-gyp rebuild 2> builderror.log) || (exit 0)", | |
"test": "faucet test/unit" | |
}, | |
"version": "1.0.30" | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/any-promise/index.js":[function(require,module,exports){ | |
module.exports=require("./register")().Promise; | |
},{"./register":"/Users/lentan/repo/torus/torus-embed/node_modules/any-promise/register-shim.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/any-promise/loader.js":[function(require,module,exports){ | |
"use strict";var REGISTRATION_KEY="@@any-promise/REGISTRATION",registered=null;module.exports=function(e,r){return function register(n,i){n=n||null;var t=!1!==(i=i||{}).global;if(null===registered&&t&&(registered=e[REGISTRATION_KEY]||null),null!==registered&&null!==n&®istered.implementation!==n)throw new Error('any-promise already defined as "'+registered.implementation+'". You can only register an implementation before the first call to require("any-promise") and an implementation cannot be changed');return null===registered&&(registered=null!==n&&void 0!==i.Promise?{Promise:i.Promise,implementation:n}:r(n),t&&(e[REGISTRATION_KEY]=registered)),registered}}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/any-promise/register-shim.js":[function(require,module,exports){ | |
"use strict";function loadImplementation(){if(void 0===window.Promise)throw new Error("any-promise browser requires a polyfill or explicit registration e.g: require('any-promise/register/bluebird')");return{Promise:window.Promise,implementation:"window.Promise"}}module.exports=require("./loader")(window,loadImplementation); | |
},{"./loader":"/Users/lentan/repo/torus/torus-embed/node_modules/any-promise/loader.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1.js":[function(require,module,exports){ | |
var asn1=exports;asn1.bignum=require("bn.js"),asn1.define=require("./asn1/api").define,asn1.base=require("./asn1/base"),asn1.constants=require("./asn1/constants"),asn1.decoders=require("./asn1/decoders"),asn1.encoders=require("./asn1/encoders"); | |
},{"./asn1/api":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/api.js","./asn1/base":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/index.js","./asn1/constants":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/constants/index.js","./asn1/decoders":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/index.js","./asn1/encoders":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/index.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/api.js":[function(require,module,exports){ | |
var asn1=require("../asn1"),inherits=require("inherits"),api=exports;function Entity(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}api.define=function define(e,t){return new Entity(e,t)},Entity.prototype._createNamed=function createNamed(e){var t;try{t=require("vm").runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(e){t=function(e){this._initNamed(e)}}return inherits(t,e),t.prototype._initNamed=function initnamed(t){e.call(this,t)},new t(this)},Entity.prototype._getDecoder=function _getDecoder(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(asn1.decoders[e])),this.decoders[e]},Entity.prototype.decode=function decode(e,t,n){return this._getDecoder(t).decode(e,n)},Entity.prototype._getEncoder=function _getEncoder(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(asn1.encoders[e])),this.encoders[e]},Entity.prototype.encode=function encode(e,t,n){return this._getEncoder(t).encode(e,n)}; | |
},{"../asn1":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","vm":"/Users/lentan/repo/torus/torus-embed/node_modules/vm-browserify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/buffer.js":[function(require,module,exports){ | |
var inherits=require("inherits"),Reporter=require("../base").Reporter,Buffer=require("buffer").Buffer;function DecoderBuffer(e,t){Reporter.call(this,t),Buffer.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function EncoderBuffer(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof EncoderBuffer||(e=new EncoderBuffer(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=Buffer.byteLength(e);else{if(!Buffer.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}inherits(DecoderBuffer,Reporter),exports.DecoderBuffer=DecoderBuffer,DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:Reporter.prototype.save.call(this)}},DecoderBuffer.prototype.restore=function restore(e){var t=new DecoderBuffer(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Reporter.prototype.restore.call(this,e.reporter),t},DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length},DecoderBuffer.prototype.readUInt8=function readUInt8(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)},exports.EncoderBuffer=EncoderBuffer,EncoderBuffer.prototype.join=function join(e,t){return e||(e=new Buffer(this.length)),t||(t=0),0===this.length?e:(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):Buffer.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length),e)}; | |
},{"../base":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/index.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/index.js":[function(require,module,exports){ | |
var base=exports;base.Reporter=require("./reporter").Reporter,base.DecoderBuffer=require("./buffer").DecoderBuffer,base.EncoderBuffer=require("./buffer").EncoderBuffer,base.Node=require("./node"); | |
},{"./buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/buffer.js","./node":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/node.js","./reporter":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/reporter.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/node.js":[function(require,module,exports){ | |
var Reporter=require("../base").Reporter,EncoderBuffer=require("../base").EncoderBuffer,DecoderBuffer=require("../base").DecoderBuffer,assert=require("minimalistic-assert"),tags=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],methods=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(tags),overrided=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}module.exports=Node;var stateProps=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){var e=this._baseState,t={};stateProps.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},Node.prototype._wrap=function wrap(){var e=this._baseState;methods.forEach(function(t){this[t]=function _wrappedMethod(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},Node.prototype._init=function init(e){var t=this._baseState;assert(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),assert.equal(t.children.length,1,"Root node can have only one child")},Node.prototype._useArgs=function useArgs(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(assert(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(assert(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0);var i=e[r];t[i]=r}),t}))},overrided.forEach(function(e){Node.prototype[e]=function _overrided(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}}),tags.forEach(function(e){Node.prototype[e]=function _tagMethod(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return assert(null===t.tag),t.tag=e,this._useArgs(r),this}}),Node.prototype.use=function use(e){assert(e);var t=this._baseState;return assert(null===t.use),t.use=e,this},Node.prototype.optional=function optional(){return this._baseState.optional=!0,this},Node.prototype.def=function def(e){var t=this._baseState;return assert(null===t.default),t.default=e,t.optional=!0,this},Node.prototype.explicit=function explicit(e){var t=this._baseState;return assert(null===t.explicit&&null===t.implicit),t.explicit=e,this},Node.prototype.implicit=function implicit(e){var t=this._baseState;return assert(null===t.explicit&&null===t.implicit),t.implicit=e,this},Node.prototype.obj=function obj(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},Node.prototype.key=function key(e){var t=this._baseState;return assert(null===t.key),t.key=e,this},Node.prototype.any=function any(){return this._baseState.any=!0,this},Node.prototype.choice=function choice(e){var t=this._baseState;return assert(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},Node.prototype.contains=function contains(e){var t=this._baseState;return assert(null===t.use),t.contains=e,this},Node.prototype._decode=function decode(e,t){var r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));var i,o=r.default,n=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){var a=null;if(null!==r.explicit?a=r.explicit:null!==r.implicit?a=r.implicit:null!==r.tag&&(a=r.tag),null!==a||r.any){if(n=this._peekTag(e,a,r.any),e.isError(n))return n}else{var c=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),n=!0}catch(e){n=!1}e.restore(c)}}if(r.obj&&n&&(i=e.enterObject()),n){if(null!==r.explicit){var l=this._decodeTag(e,r.explicit);if(e.isError(l))return l;e=l}var u=e.offset;if(null===r.use&&null===r.choice){if(r.any)c=e.save();var d=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(d))return d;r.any?o=e.raw(c):e=d}if(t&&t.track&&null!==r.tag&&t.track(e.path(),u,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),o=r.any?o:null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),e.isError(o))return o;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function decodeChildren(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var h=new DecoderBuffer(o);o=this._getUse(r.contains,e._reporterState.obj)._decode(h,t)}}return r.obj&&n&&(o=e.leaveObject(i)),null===r.key||null===o&&!0!==n?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,o),o},Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){var i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],r):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},Node.prototype._getUse=function _getUse(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),assert(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},Node.prototype._decodeChoice=function decodeChoice(e,t){var r=this._baseState,i=null,o=!1;return Object.keys(r.choice).some(function(n){var s=e.save(),a=r.choice[n];try{var c=a._decode(e,t);if(e.isError(c))return!1;i={type:n,value:c},o=!0}catch(t){return e.restore(s),!1}return!0},this),o?i:e.error("Choice not matched")},Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new EncoderBuffer(e,this.reporter)},Node.prototype._encode=function encode(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var o=this._encodeValue(e,t,r);if(void 0!==o&&!this._skipDefault(o,t,r))return o}},Node.prototype._encodeValue=function encode(e,t,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new Reporter);var o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}var n=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)n=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)n=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var o=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),o},this).filter(function(e){return e}),n=this._createEncoderBuffer(n);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var a=this.clone();a._baseState.implicit=null,n=this._createEncoderBuffer(e.map(function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)},a))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(n=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,l=null===i.implicit?"universal":"context";null===c?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,s,l,n))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},Node.prototype._encodeChoice=function encodeChoice(e,t){var r=this._baseState,i=r.choice[e.type];return i||assert(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},Node.prototype._encodePrimitive=function encodePrimitive(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)},Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}; | |
},{"../base":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/index.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/base/reporter.js":[function(require,module,exports){ | |
var inherits=require("inherits");function Reporter(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}function ReporterError(r,t){this.path=r,this.rethrow(t)}exports.Reporter=Reporter,Reporter.prototype.isError=function isError(r){return r instanceof ReporterError},Reporter.prototype.save=function save(){var r=this._reporterState;return{obj:r.obj,pathLen:r.path.length}},Reporter.prototype.restore=function restore(r){var t=this._reporterState;t.obj=r.obj,t.path=t.path.slice(0,r.pathLen)},Reporter.prototype.enterKey=function enterKey(r){return this._reporterState.path.push(r)},Reporter.prototype.exitKey=function exitKey(r){var t=this._reporterState;t.path=t.path.slice(0,r-1)},Reporter.prototype.leaveKey=function leaveKey(r,t,e){var o=this._reporterState;this.exitKey(r),null!==o.obj&&(o.obj[t]=e)},Reporter.prototype.path=function path(){return this._reporterState.path.join("/")},Reporter.prototype.enterObject=function enterObject(){var r=this._reporterState,t=r.obj;return r.obj={},t},Reporter.prototype.leaveObject=function leaveObject(r){var t=this._reporterState,e=t.obj;return t.obj=r,e},Reporter.prototype.error=function error(r){var t,e=this._reporterState,o=r instanceof ReporterError;if(t=o?r:new ReporterError(e.path.map(function(r){return"["+JSON.stringify(r)+"]"}).join(""),r.message||r,r.stack),!e.options.partial)throw t;return o||e.errors.push(t),t},Reporter.prototype.wrapResult=function wrapResult(r){var t=this._reporterState;return t.options.partial?{result:this.isError(r)?null:r,errors:t.errors}:r},inherits(ReporterError,Error),ReporterError.prototype.rethrow=function rethrow(r){if(this.message=r+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,ReporterError),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this}; | |
},{"inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/constants/der.js":[function(require,module,exports){ | |
var constants=require("../constants");exports.tagClass={0:"universal",1:"application",2:"context",3:"private"},exports.tagClassByName=constants._reverse(exports.tagClass),exports.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},exports.tagByName=constants._reverse(exports.tag); | |
},{"../constants":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/constants/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/constants/index.js":[function(require,module,exports){ | |
var constants=exports;constants._reverse=function reverse(r){var e={};return Object.keys(r).forEach(function(n){(0|n)==n&&(n|=0);var t=r[n];e[t]=n}),e},constants.der=require("./der"); | |
},{"./der":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/constants/der.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/der.js":[function(require,module,exports){ | |
var inherits=require("inherits"),asn1=require("../../asn1"),base=asn1.base,bignum=asn1.bignum,der=asn1.constants.der;function DERDecoder(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new DERNode,this.tree._init(r.body)}function DERNode(r){base.Node.call(this,"der",r)}function derDecodeTag(r,e){var t=r.readUInt8(e);if(r.isError(t))return t;var i=der.tagClass[t>>6],o=0==(32&t);if(31==(31&t)){var n=t;for(t=0;128==(128&n);){if(n=r.readUInt8(e),r.isError(n))return n;t<<=7,t|=127&n}}else t&=31;return{cls:i,primitive:o,tag:t,tagStr:der.tag[t]}}function derDecodeLen(r,e,t){var i=r.readUInt8(t);if(r.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var o=127&i;if(o>4)return r.error("length octect is too long");i=0;for(var n=0;n<o;n++){i<<=8;var d=r.readUInt8(t);if(r.isError(d))return d;i|=d}return i}module.exports=DERDecoder,DERDecoder.prototype.decode=function decode(r,e){return r instanceof base.DecoderBuffer||(r=new base.DecoderBuffer(r,e)),this.tree._decode(r,e)},inherits(DERNode,base.Node),DERNode.prototype._peekTag=function peekTag(r,e,t){if(r.isEmpty())return!1;var i=r.save(),o=derDecodeTag(r,'Failed to peek tag: "'+e+'"');return r.isError(o)?o:(r.restore(i),o.tag===e||o.tagStr===e||o.tagStr+"of"===e||t)},DERNode.prototype._decodeTag=function decodeTag(r,e,t){var i=derDecodeTag(r,'Failed to decode tag of "'+e+'"');if(r.isError(i))return i;var o=derDecodeLen(r,i.primitive,'Failed to get length of "'+e+'"');if(r.isError(o))return o;if(!t&&i.tag!==e&&i.tagStr!==e&&i.tagStr+"of"!==e)return r.error('Failed to match tag: "'+e+'"');if(i.primitive||null!==o)return r.skip(o,'Failed to match body of: "'+e+'"');var n=r.save(),d=this._skipUntilEnd(r,'Failed to skip indefinite length body: "'+this.tag+'"');return r.isError(d)?d:(o=r.offset-n.offset,r.restore(n),r.skip(o,'Failed to match body of: "'+e+'"'))},DERNode.prototype._skipUntilEnd=function skipUntilEnd(r,e){for(;;){var t=derDecodeTag(r,e);if(r.isError(t))return t;var i,o=derDecodeLen(r,t.primitive,e);if(r.isError(o))return o;if(i=t.primitive||null!==o?r.skip(o):this._skipUntilEnd(r,e),r.isError(i))return i;if("end"===t.tagStr)break}},DERNode.prototype._decodeList=function decodeList(r,e,t,i){for(var o=[];!r.isEmpty();){var n=this._peekTag(r,"end");if(r.isError(n))return n;var d=t.decode(r,"der",i);if(r.isError(d)&&n)break;o.push(d)}return o},DERNode.prototype._decodeStr=function decodeStr(r,e){if("bitstr"===e){var t=r.readUInt8();return r.isError(t)?t:{unused:t,data:r.raw()}}if("bmpstr"===e){var i=r.raw();if(i.length%2==1)return r.error("Decoding of string type: bmpstr length mismatch");for(var o="",n=0;n<i.length/2;n++)o+=String.fromCharCode(i.readUInt16BE(2*n));return o}if("numstr"===e){var d=r.raw().toString("ascii");return this._isNumstr(d)?d:r.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return r.raw();if("objDesc"===e)return r.raw();if("printstr"===e){var s=r.raw().toString("ascii");return this._isPrintstr(s)?s:r.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?r.raw().toString():r.error("Decoding of string type: "+e+" unsupported")},DERNode.prototype._decodeObjid=function decodeObjid(r,e,t){for(var i,o=[],n=0;!r.isEmpty();){var d=r.readUInt8();n<<=7,n|=127&d,0==(128&d)&&(o.push(n),n=0)}128&d&&o.push(n);var s=o[0]/40|0,a=o[0]%40;if(i=t?o:[s,a].concat(o.slice(1)),e){var c=e[i.join(" ")];void 0===c&&(c=e[i.join(".")]),void 0!==c&&(i=c)}return i},DERNode.prototype._decodeTime=function decodeTime(r,e){var t=r.raw().toString();if("gentime"===e)var i=0|t.slice(0,4),o=0|t.slice(4,6),n=0|t.slice(6,8),d=0|t.slice(8,10),s=0|t.slice(10,12),a=0|t.slice(12,14);else{if("utctime"!==e)return r.error("Decoding "+e+" time is not supported yet");i=0|t.slice(0,2),o=0|t.slice(2,4),n=0|t.slice(4,6),d=0|t.slice(6,8),s=0|t.slice(8,10),a=0|t.slice(10,12);i=i<70?2e3+i:1900+i}return Date.UTC(i,o-1,n,d,s,a,0)},DERNode.prototype._decodeNull=function decodeNull(r){return null},DERNode.prototype._decodeBool=function decodeBool(r){var e=r.readUInt8();return r.isError(e)?e:0!==e},DERNode.prototype._decodeInt=function decodeInt(r,e){var t=r.raw(),i=new bignum(t);return e&&(i=e[i.toString(10)]||i),i},DERNode.prototype._use=function use(r,e){return"function"==typeof r&&(r=r(e)),r._getDecoder("der").tree}; | |
},{"../../asn1":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/index.js":[function(require,module,exports){ | |
var decoders=exports;decoders.der=require("./der"),decoders.pem=require("./pem"); | |
},{"./der":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/der.js","./pem":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/pem.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/pem.js":[function(require,module,exports){ | |
var inherits=require("inherits"),Buffer=require("buffer").Buffer,DERDecoder=require("./der");function PEMDecoder(e){DERDecoder.call(this,e),this.enc="pem"}inherits(PEMDecoder,DERDecoder),module.exports=PEMDecoder,PEMDecoder.prototype.decode=function decode(e,r){for(var o=e.toString().split(/[\r\n]+/g),i=r.label.toUpperCase(),t=/^-----(BEGIN|END) ([^-]+)-----$/,c=-1,n=-1,f=0;f<o.length;f++){var d=o[f].match(t);if(null!==d&&d[2]===i){if(-1!==c){if("END"!==d[1])break;n=f;break}if("BEGIN"!==d[1])break;c=f}}if(-1===c||-1===n)throw new Error("PEM section not found for: "+i);var a=o.slice(c+1,n).join("");a.replace(/[^a-z0-9\+\/=]+/gi,"");var D=new Buffer(a,"base64");return DERDecoder.prototype.decode.call(this,D,r)}; | |
},{"./der":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/decoders/der.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/der.js":[function(require,module,exports){ | |
var inherits=require("inherits"),Buffer=require("buffer").Buffer,asn1=require("../../asn1"),base=asn1.base,der=asn1.constants.der;function DEREncoder(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new DERNode,this.tree._init(e.body)}function DERNode(e){base.Node.call(this,"der",e)}function two(e){return e<10?"0"+e:e}function encodeTag(e,r,t,n){var o;if("seqof"===e?e="seq":"setof"===e&&(e="set"),der.tagByName.hasOwnProperty(e))o=der.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);o=e}return o>=31?n.error("Multi-octet tag encoding unsupported"):(r||(o|=32),o|=der.tagClassByName[t||"universal"]<<6)}module.exports=DEREncoder,DEREncoder.prototype.encode=function encode(e,r){return this.tree._encode(e,r).join()},inherits(DERNode,base.Node),DERNode.prototype._encodeComposite=function encodeComposite(e,r,t,n){var o,i=encodeTag(e,r,t,this.reporter);if(n.length<128)return(o=new Buffer(2))[0]=i,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var f=1,s=n.length;s>=256;s>>=8)f++;(o=new Buffer(2+f))[0]=i,o[1]=128|f;s=1+f;for(var u=n.length;u>0;s--,u>>=8)o[s]=255&u;return this._createEncoderBuffer([o,n])},DERNode.prototype._encodeStr=function encodeStr(e,r){if("bitstr"===r)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===r){for(var t=new Buffer(2*e.length),n=0;n<e.length;n++)t.writeUInt16BE(e.charCodeAt(n),2*n);return this._createEncoderBuffer(t)}return"numstr"===r?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===r?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(r)?this._createEncoderBuffer(e):"objDesc"===r?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+r+" unsupported")},DERNode.prototype._encodeObjid=function encodeObjid(e,r,t){if("string"==typeof e){if(!r)return this.reporter.error("string objid given, but no values map found");if(!r.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=r[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!t){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n<e.length;n++){var i=e[n];for(o++;i>=128;i>>=7)o++}var f=new Buffer(o),s=f.length-1;for(n=e.length-1;n>=0;n--){i=e[n];for(f[s--]=127&i;(i>>=7)>0;)f[s--]=128|127&i}return this._createEncoderBuffer(f)},DERNode.prototype._encodeTime=function encodeTime(e,r){var t,n=new Date(e);return"gentime"===r?t=[two(n.getFullYear()),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join(""):"utctime"===r?t=[two(n.getFullYear()%100),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+r+" time is not supported yet"),this._encodeStr(t,"octstr")},DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")},DERNode.prototype._encodeInt=function encodeInt(e,r){if("string"==typeof e){if(!r)return this.reporter.error("String int or enum given, but no values map");if(!r.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=r[e]}if("number"!=typeof e&&!Buffer.isBuffer(e)){var t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=new Buffer(t)}if(Buffer.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new Buffer(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var i=e;i>=256;i>>=8)n++;for(i=(o=new Array(n)).length-1;i>=0;i--)o[i]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new Buffer(o))},DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)},DERNode.prototype._use=function use(e,r){return"function"==typeof e&&(e=e(r)),e._getEncoder("der").tree},DERNode.prototype._skipDefault=function skipDefault(e,r,t){var n,o=this._baseState;if(null===o.default)return!1;var i=e.join();if(void 0===o.defaultBuffer&&(o.defaultBuffer=this._encodeValue(o.default,r,t).join()),i.length!==o.defaultBuffer.length)return!1;for(n=0;n<i.length;n++)if(i[n]!==o.defaultBuffer[n])return!1;return!0}; | |
},{"../../asn1":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/index.js":[function(require,module,exports){ | |
var encoders=exports;encoders.der=require("./der"),encoders.pem=require("./pem"); | |
},{"./der":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/der.js","./pem":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/pem.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/pem.js":[function(require,module,exports){ | |
var inherits=require("inherits"),DEREncoder=require("./der");function PEMEncoder(e){DEREncoder.call(this,e),this.enc="pem"}inherits(PEMEncoder,DEREncoder),module.exports=PEMEncoder,PEMEncoder.prototype.encode=function encode(e,r){for(var n=DEREncoder.prototype.encode.call(this,e).toString("base64"),o=["-----BEGIN "+r.label+"-----"],E=0;E<n.length;E+=64)o.push(n.slice(E,E+64));return o.push("-----END "+r.label+"-----"),o.join("\n")}; | |
},{"./der":"/Users/lentan/repo/torus/torus-embed/node_modules/asn1.js/lib/asn1/encoders/der.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/async/dist/async.js":[function(require,module,exports){ | |
(function (process,global,setImmediate){ | |
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(e.async=e.async||{})}(this,function(e){"use strict";function slice(e,n){n|=0;for(var t=Math.max(e.length-n,0),r=Array(t),i=0;i<t;i++)r[i]=e[n+i];return r}var n=function(e){var n=slice(arguments,1);return function(){var t=slice(arguments);return e.apply(null,n.concat(t))}},t=function(e){return function(){var n=slice(arguments),t=n.pop();e.call(this,n,t)}};function isObject(e){var n=typeof e;return null!=e&&("object"==n||"function"==n)}var r="function"==typeof setImmediate&&setImmediate,i="object"==typeof process&&"function"==typeof process.nextTick;function fallback(e){setTimeout(e,0)}function wrap(e){return function(n){var t=slice(arguments,1);e(function(){n.apply(null,t)})}}var o=wrap(r?setImmediate:i?process.nextTick:fallback);function asyncify(e){return t(function(n,t){var r;try{r=e.apply(this,n)}catch(e){return t(e)}isObject(r)&&"function"==typeof r.then?r.then(function(e){invokeCallback(t,null,e)},function(e){invokeCallback(t,e.message?e:new Error(e))}):t(null,r)})}function invokeCallback(e,n,t){try{e(n,t)}catch(e){o(rethrow,e)}}function rethrow(e){throw e}var a="function"==typeof Symbol;function isAsync(e){return a&&"AsyncFunction"===e[Symbol.toStringTag]}function wrapAsync(e){return isAsync(e)?asyncify(e):e}function applyEach$1(e){return function(n){var r=slice(arguments,1),i=t(function(t,r){var i=this;return e(n,function(e,n){wrapAsync(e).apply(i,t.concat(n))},r)});return r.length?i.apply(this,r):i}}var c="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,l=c||u||Function("return this")(),f=l.Symbol,s=Object.prototype,p=s.hasOwnProperty,y=s.toString,h=f?f.toStringTag:void 0;var m=Object.prototype.toString;var d="[object Null]",v="[object Undefined]",b=f?f.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?v:d:b&&b in Object(e)?function getRawTag(e){var n=p.call(e,h),t=e[h];try{e[h]=void 0;var r=!0}catch(e){}var i=y.call(e);return r&&(n?e[h]=t:delete e[h]),i}(e):function objectToString(e){return m.call(e)}(e)}var g="[object AsyncFunction]",L="[object Function]",A="[object GeneratorFunction]",k="[object Proxy]";var w=9007199254740991;function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=w}function isArrayLike(e){return null!=e&&isLength(e.length)&&!function isFunction(e){if(!isObject(e))return!1;var n=baseGetTag(e);return n==L||n==A||n==g||n==k}(e)}var j={};function noop(){}function once(e){return function(){if(null!==e){var n=e;e=null,n.apply(this,arguments)}}}var O="function"==typeof Symbol&&Symbol.iterator,x=function(e){return O&&e[O]&&e[O]()};function isObjectLike(e){return null!=e&&"object"==typeof e}var S="[object Arguments]";function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==S}var T=Object.prototype,E=T.hasOwnProperty,I=T.propertyIsEnumerable,_=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&E.call(e,"callee")&&!I.call(e,"callee")},F=Array.isArray;var P="object"==typeof e&&e&&!e.nodeType&&e,D=P&&"object"==typeof module&&module&&!module.nodeType&&module,$=D&&D.exports===P?l.Buffer:void 0,B=($?$.isBuffer:void 0)||function stubFalse(){return!1},q=9007199254740991,M=/^(?:0|[1-9]\d*)$/;function isIndex(e,n){var t=typeof e;return!!(n=null==n?q:n)&&("number"==t||"symbol"!=t&&M.test(e))&&e>-1&&e%1==0&&e<n}var R={};R["[object Float32Array]"]=R["[object Float64Array]"]=R["[object Int8Array]"]=R["[object Int16Array]"]=R["[object Int32Array]"]=R["[object Uint8Array]"]=R["[object Uint8ClampedArray]"]=R["[object Uint16Array]"]=R["[object Uint32Array]"]=!0,R["[object Arguments]"]=R["[object Array]"]=R["[object ArrayBuffer]"]=R["[object Boolean]"]=R["[object DataView]"]=R["[object Date]"]=R["[object Error]"]=R["[object Function]"]=R["[object Map]"]=R["[object Number]"]=R["[object Object]"]=R["[object RegExp]"]=R["[object Set]"]=R["[object String]"]=R["[object WeakMap]"]=!1;var z="object"==typeof e&&e&&!e.nodeType&&e,C=z&&"object"==typeof module&&module&&!module.nodeType&&module,U=C&&C.exports===z&&c.process,V=function(){try{var e=C&&C.require&&C.require("util").types;return e||U&&U.binding&&U.binding("util")}catch(e){}}(),G=V&&V.isTypedArray,W=G?function baseUnary(e){return function(n){return e(n)}}(G):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!R[baseGetTag(e)]},N=Object.prototype.hasOwnProperty;function arrayLikeKeys(e,n){var t=F(e),r=!t&&_(e),i=!t&&!r&&B(e),o=!t&&!r&&!i&&W(e),a=t||r||i||o,c=a?function baseTimes(e,n){for(var t=-1,r=Array(e);++t<e;)r[t]=n(t);return r}(e.length,String):[],u=c.length;for(var l in e)!n&&!N.call(e,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,u))||c.push(l);return c}var Q=Object.prototype;var K=function overArg(e,n){return function(t){return e(n(t))}}(Object.keys,Object),H=Object.prototype.hasOwnProperty;function baseKeys(e){if(!function isPrototype(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||Q)}(e))return K(e);var n=[];for(var t in Object(e))H.call(e,t)&&"constructor"!=t&&n.push(t);return n}function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function iterator(e){if(isArrayLike(e))return function createArrayIterator(e){var n=-1,t=e.length;return function next(){return++n<t?{value:e[n],key:n}:null}}(e);var n=x(e);return n?function createES2015Iterator(e){var n=-1;return function next(){var t=e.next();return t.done?null:(n++,{value:t.value,key:n})}}(n):function createObjectIterator(e){var n=keys(e),t=-1,r=n.length;return function next(){var i=n[++t];return t<r?{value:e[i],key:i}:null}}(e)}function onlyOnce(e){return function(){if(null===e)throw new Error("Callback was already called.");var n=e;e=null,n.apply(this,arguments)}}function _eachOfLimit(e){return function(n,t,r){if(r=once(r||noop),e<=0||!n)return r(null);var i=iterator(n),o=!1,a=0,c=!1;function iterateeCallback(e,n){if(a-=1,e)o=!0,r(e);else{if(n===j||o&&a<=0)return o=!0,r(null);c||replenish()}}function replenish(){for(c=!0;a<e&&!o;){var n=i();if(null===n)return o=!0,void(a<=0&&r(null));a+=1,t(n.value,n.key,onlyOnce(iterateeCallback))}c=!1}replenish()}}function eachOfLimit(e,n,t,r){_eachOfLimit(n)(e,wrapAsync(t),r)}function doLimit(e,n){return function(t,r,i){return e(t,n,r,i)}}function eachOfArrayLike(e,n,t){t=once(t||noop);var r=0,i=0,o=e.length;function iteratorCallback(e,n){e?t(e):++i!==o&&n!==j||t(null)}for(0===o&&t(null);r<o;r++)n(e[r],r,onlyOnce(iteratorCallback))}var J=doLimit(eachOfLimit,1/0),X=function(e,n,t){(isArrayLike(e)?eachOfArrayLike:J)(e,wrapAsync(n),t)};function doParallel(e){return function(n,t,r){return e(X,n,wrapAsync(t),r)}}function _asyncMap(e,n,t,r){r=r||noop,n=n||[];var i=[],o=0,a=wrapAsync(t);e(n,function(e,n,t){var r=o++;a(e,function(e,n){i[r]=n,t(e)})},function(e){r(e,i)})}var Y=doParallel(_asyncMap),Z=applyEach$1(Y);function doParallelLimit(e){return function(n,t,r,i){return e(_eachOfLimit(t),n,wrapAsync(r),i)}}var ee=doParallelLimit(_asyncMap),ne=doLimit(ee,1),te=applyEach$1(ne);function arrayEach(e,n){for(var t=-1,r=null==e?0:e.length;++t<r&&!1!==n(e[t],t,e););return e}var re=function createBaseFor(e){return function(n,t,r){for(var i=-1,o=Object(n),a=r(n),c=a.length;c--;){var u=a[e?c:++i];if(!1===t(o[u],u,o))break}return n}}();function baseForOwn(e,n){return e&&re(e,n,keys)}function baseIsNaN(e){return e!=e}function baseIndexOf(e,n,t){return n==n?function strictIndexOf(e,n,t){for(var r=t-1,i=e.length;++r<i;)if(e[r]===n)return r;return-1}(e,n,t):function baseFindIndex(e,n,t,r){for(var i=e.length,o=t+(r?1:-1);r?o--:++o<i;)if(n(e[o],o,e))return o;return-1}(e,baseIsNaN,t)}var ie=function(e,n,t){"function"==typeof n&&(t=n,n=null),t=once(t||noop);var r=keys(e).length;if(!r)return t(null);n||(n=r);var i={},o=0,a=!1,c=Object.create(null),u=[],l=[],f={};function enqueueTask(e,n){u.push(function(){!function runTask(e,n){if(a)return;var r=onlyOnce(function(n,r){if(o--,arguments.length>2&&(r=slice(arguments,1)),n){var u={};baseForOwn(i,function(e,n){u[n]=e}),u[e]=r,a=!0,c=Object.create(null),t(n,u)}else i[e]=r,function taskComplete(e){arrayEach(c[e]||[],function(e){e()}),processQueue()}(e)});o++;var u=wrapAsync(n[n.length-1]);n.length>1?u(i,r):u(r)}(e,n)})}function processQueue(){if(0===u.length&&0===o)return t(null,i);for(;u.length&&o<n;){u.shift()()}}function getDependents(n){var t=[];return baseForOwn(e,function(e,r){F(e)&&baseIndexOf(e,n,0)>=0&&t.push(r)}),t}baseForOwn(e,function(n,t){if(!F(n))return enqueueTask(t,[n]),void l.push(t);var r=n.slice(0,n.length-1),i=r.length;if(0===i)return enqueueTask(t,n),void l.push(t);f[t]=i,arrayEach(r,function(o){if(!e[o])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+o+"` in "+r.join(", "));!function addListener(e,n){var t=c[e];t||(t=c[e]=[]);t.push(n)}(o,function(){0===--i&&enqueueTask(t,n)})})}),function checkForDeadlocks(){var e,n=0;for(;l.length;)e=l.pop(),n++,arrayEach(getDependents(e),function(e){0==--f[e]&&l.push(e)});if(n!==r)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),processQueue()};function arrayMap(e,n){for(var t=-1,r=null==e?0:e.length,i=Array(r);++t<r;)i[t]=n(e[t],t,e);return i}var oe="[object Symbol]";var ae=1/0,ce=f?f.prototype:void 0,ue=ce?ce.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(F(e))return arrayMap(e,baseToString)+"";if(function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==oe}(e))return ue?ue.call(e):"";var n=e+"";return"0"==n&&1/e==-ae?"-0":n}function castSlice(e,n,t){var r=e.length;return t=void 0===t?r:t,!n&&t>=r?e:function baseSlice(e,n,t){var r=-1,i=e.length;n<0&&(n=-n>i?0:i+n),(t=t>i?i:t)<0&&(t+=i),i=n>t?0:t-n>>>0,n>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+n];return o}(e,n,t)}var le=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");var fe="[\\ud800-\\udfff]",se="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pe="\\ud83c[\\udffb-\\udfff]",ye="[^\\ud800-\\udfff]",he="(?:\\ud83c[\\udde6-\\uddff]){2}",me="[\\ud800-\\udbff][\\udc00-\\udfff]",de="(?:"+se+"|"+pe+")"+"?",ve="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[ye,he,me].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),be="(?:"+[ye+se+"?",se,he,me,fe].join("|")+")",ge=RegExp(pe+"(?="+pe+")|"+be+ve,"g");function stringToArray(e){return function hasUnicode(e){return le.test(e)}(e)?function unicodeToArray(e){return e.match(ge)||[]}(e):function asciiToArray(e){return e.split("")}(e)}var Le=/^\s+|\s+$/g;function trim(e,n,t){if((e=function toString(e){return null==e?"":baseToString(e)}(e))&&(t||void 0===n))return e.replace(Le,"");if(!e||!(n=baseToString(n)))return e;var r=stringToArray(e),i=stringToArray(n);return castSlice(r,function charsStartIndex(e,n){for(var t=-1,r=e.length;++t<r&&baseIndexOf(n,e[t],0)>-1;);return t}(r,i),function charsEndIndex(e,n){for(var t=e.length;t--&&baseIndexOf(n,e[t],0)>-1;);return t}(r,i)+1).join("")}var Ae=/^(?:async\s+)?(function)?\s*[^\(]*\(\s*([^\)]*)\)/m,ke=/,/,we=/(=.+)?(\s*)$/,je=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;function autoInject(e,n){var t={};baseForOwn(e,function(e,n){var r,i=isAsync(e),o=!i&&1===e.length||i&&0===e.length;if(F(e))r=e.slice(0,-1),e=e[e.length-1],t[n]=r.concat(r.length>0?newTask:e);else if(o)t[n]=e;else{if(r=function parseParams(e){return e=(e=(e=(e=e.toString().replace(je,"")).match(Ae)[2].replace(" ",""))?e.split(ke):[]).map(function(e){return trim(e.replace(we,""))})}(e),0===e.length&&!i&&0===r.length)throw new Error("autoInject task functions require explicit parameters.");i||r.pop(),t[n]=r.concat(newTask)}function newTask(n,t){var i=arrayMap(r,function(e){return n[e]});i.push(t),wrapAsync(e).apply(null,i)}}),ie(t,n)}function DLL(){this.head=this.tail=null,this.length=0}function setInitial(e,n){e.length=1,e.head=e.tail=n}function queue(e,n,t){if(null==n)n=1;else if(0===n)throw new Error("Concurrency must not be zero");var r=wrapAsync(e),i=0,a=[],c=!1;function _insert(e,n,t){if(null!=t&&"function"!=typeof t)throw new Error("task callback must be a function");if(l.started=!0,F(e)||(e=[e]),0===e.length&&l.idle())return o(function(){l.drain()});for(var r=0,i=e.length;r<i;r++){var a={data:e[r],callback:t||noop};n?l._tasks.unshift(a):l._tasks.push(a)}c||(c=!0,o(function(){c=!1,l.process()}))}function _next(e){return function(n){i-=1;for(var t=0,r=e.length;t<r;t++){var o=e[t],c=baseIndexOf(a,o,0);0===c?a.shift():c>0&&a.splice(c,1),o.callback.apply(o,arguments),null!=n&&l.error(n,o.data)}i<=l.concurrency-l.buffer&&l.unsaturated(),l.idle()&&l.drain(),l.process()}}var u=!1,l={_tasks:new DLL,concurrency:n,payload:t,saturated:noop,unsaturated:noop,buffer:n/4,empty:noop,drain:noop,error:noop,started:!1,paused:!1,push:function(e,n){_insert(e,!1,n)},kill:function(){l.drain=noop,l._tasks.empty()},unshift:function(e,n){_insert(e,!0,n)},remove:function(e){l._tasks.remove(e)},process:function(){if(!u){for(u=!0;!l.paused&&i<l.concurrency&&l._tasks.length;){var e=[],n=[],t=l._tasks.length;l.payload&&(t=Math.min(t,l.payload));for(var o=0;o<t;o++){var c=l._tasks.shift();e.push(c),a.push(c),n.push(c.data)}i+=1,0===l._tasks.length&&l.empty(),i===l.concurrency&&l.saturated();var f=onlyOnce(_next(e));r(n,f)}u=!1}},length:function(){return l._tasks.length},running:function(){return i},workersList:function(){return a},idle:function(){return l._tasks.length+i===0},pause:function(){l.paused=!0},resume:function(){!1!==l.paused&&(l.paused=!1,o(l.process))}};return l}function cargo(e,n){return queue(e,1,n)}DLL.prototype.removeLink=function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e},DLL.prototype.empty=function(){for(;this.head;)this.shift();return this},DLL.prototype.insertAfter=function(e,n){n.prev=e,n.next=e.next,e.next?e.next.prev=n:this.tail=n,e.next=n,this.length+=1},DLL.prototype.insertBefore=function(e,n){n.prev=e.prev,n.next=e,e.prev?e.prev.next=n:this.head=n,e.prev=n,this.length+=1},DLL.prototype.unshift=function(e){this.head?this.insertBefore(this.head,e):setInitial(this,e)},DLL.prototype.push=function(e){this.tail?this.insertAfter(this.tail,e):setInitial(this,e)},DLL.prototype.shift=function(){return this.head&&this.removeLink(this.head)},DLL.prototype.pop=function(){return this.tail&&this.removeLink(this.tail)},DLL.prototype.toArray=function(){for(var e=Array(this.length),n=this.head,t=0;t<this.length;t++)e[t]=n.data,n=n.next;return e},DLL.prototype.remove=function(e){for(var n=this.head;n;){var t=n.next;e(n)&&this.removeLink(n),n=t}return this};var Oe=doLimit(eachOfLimit,1);function reduce(e,n,t,r){r=once(r||noop);var i=wrapAsync(t);Oe(e,function(e,t,r){i(n,e,function(e,t){n=t,r(e)})},function(e){r(e,n)})}function seq(){var e=arrayMap(arguments,wrapAsync);return function(){var n=slice(arguments),t=this,r=n[n.length-1];"function"==typeof r?n.pop():r=noop,reduce(e,n,function(e,n,r){n.apply(t,e.concat(function(e){var n=slice(arguments,1);r(e,n)}))},function(e,n){r.apply(t,[e].concat(n))})}}var xe=function(){return seq.apply(null,slice(arguments).reverse())},Se=Array.prototype.concat,Te=function(e,n,t,r){r=r||noop;var i=wrapAsync(t);ee(e,n,function(e,n){i(e,function(e){return e?n(e):n(null,slice(arguments,1))})},function(e,n){for(var t=[],i=0;i<n.length;i++)n[i]&&(t=Se.apply(t,n[i]));return r(e,t)})},Ee=doLimit(Te,1/0),Ie=doLimit(Te,1),_e=function(){var e=slice(arguments),n=[null].concat(e);return function(){return arguments[arguments.length-1].apply(this,n)}};function identity(e){return e}function _createTester(e,n){return function(t,r,i,o){o=o||noop;var a,c=!1;t(r,function(t,r,o){i(t,function(r,i){r?o(r):e(i)&&!a?(c=!0,a=n(!0,t),o(null,j)):o()})},function(e){e?o(e):o(null,c?a:n(!1))})}}function _findGetResult(e,n){return n}var Fe=doParallel(_createTester(identity,_findGetResult)),Pe=doParallelLimit(_createTester(identity,_findGetResult)),De=doLimit(Pe,1);function consoleFunc(e){return function(n){var t=slice(arguments,1);t.push(function(n){var t=slice(arguments,1);"object"==typeof console&&(n?console.error&&console.error(n):console[e]&&arrayEach(t,function(n){console[e](n)}))}),wrapAsync(n).apply(null,t)}}var $e=consoleFunc("dir");function doDuring(e,n,t){t=onlyOnce(t||noop);var r=wrapAsync(e),i=wrapAsync(n);function next(e){if(e)return t(e);var n=slice(arguments,1);n.push(check),i.apply(this,n)}function check(e,n){return e?t(e):n?void r(next):t(null)}check(null,!0)}function doWhilst(e,n,t){t=onlyOnce(t||noop);var r=wrapAsync(e),i=function(e){if(e)return t(e);var o=slice(arguments,1);if(n.apply(this,o))return r(i);t.apply(null,[null].concat(o))};r(i)}function doUntil(e,n,t){doWhilst(e,function(){return!n.apply(this,arguments)},t)}function during(e,n,t){t=onlyOnce(t||noop);var r=wrapAsync(n),i=wrapAsync(e);function next(e){if(e)return t(e);i(check)}function check(e,n){return e?t(e):n?void r(next):t(null)}i(check)}function _withoutIndex(e){return function(n,t,r){return e(n,r)}}function eachLimit(e,n,t){X(e,_withoutIndex(wrapAsync(n)),t)}function eachLimit$1(e,n,t,r){_eachOfLimit(n)(e,_withoutIndex(wrapAsync(t)),r)}var Be=doLimit(eachLimit$1,1);function ensureAsync(e){return isAsync(e)?e:t(function(n,t){var r=!0;n.push(function(){var e=arguments;r?o(function(){t.apply(null,e)}):t.apply(null,e)}),e.apply(this,n),r=!1})}function notId(e){return!e}var qe=doParallel(_createTester(notId,notId)),Me=doParallelLimit(_createTester(notId,notId)),Re=doLimit(Me,1);function baseProperty(e){return function(n){return null==n?void 0:n[e]}}function filterArray(e,n,t,r){var i=new Array(n.length);e(n,function(e,n,r){t(e,function(e,t){i[n]=!!t,r(e)})},function(e){if(e)return r(e);for(var t=[],o=0;o<n.length;o++)i[o]&&t.push(n[o]);r(null,t)})}function filterGeneric(e,n,t,r){var i=[];e(n,function(e,n,r){t(e,function(t,o){t?r(t):(o&&i.push({index:n,value:e}),r())})},function(e){e?r(e):r(null,arrayMap(i.sort(function(e,n){return e.index-n.index}),baseProperty("value")))})}function _filter(e,n,t,r){(isArrayLike(n)?filterArray:filterGeneric)(e,n,wrapAsync(t),r||noop)}var ze=doParallel(_filter),Ce=doParallelLimit(_filter),Ue=doLimit(Ce,1);function forever(e,n){var t=onlyOnce(n||noop),r=wrapAsync(ensureAsync(e));!function next(e){if(e)return t(e);r(next)}()}var Ve=function(e,n,t,r){r=r||noop;var i=wrapAsync(t);ee(e,n,function(e,n){i(e,function(t,r){return t?n(t):n(null,{key:r,val:e})})},function(e,n){for(var t={},i=Object.prototype.hasOwnProperty,o=0;o<n.length;o++)if(n[o]){var a=n[o].key,c=n[o].val;i.call(t,a)?t[a].push(c):t[a]=[c]}return r(e,t)})},Ge=doLimit(Ve,1/0),We=doLimit(Ve,1),Ne=consoleFunc("log");function mapValuesLimit(e,n,t,r){r=once(r||noop);var i={},o=wrapAsync(t);eachOfLimit(e,n,function(e,n,t){o(e,n,function(e,r){if(e)return t(e);i[n]=r,t()})},function(e){r(e,i)})}var Qe=doLimit(mapValuesLimit,1/0),Ke=doLimit(mapValuesLimit,1);function has(e,n){return n in e}function memoize(e,n){var r=Object.create(null),i=Object.create(null);n=n||identity;var a=wrapAsync(e),c=t(function memoized(e,t){var c=n.apply(null,e);has(r,c)?o(function(){t.apply(null,r[c])}):has(i,c)?i[c].push(t):(i[c]=[t],a.apply(null,e.concat(function(){var e=slice(arguments);r[c]=e;var n=i[c];delete i[c];for(var t=0,o=n.length;t<o;t++)n[t].apply(null,e)})))});return c.memo=r,c.unmemoized=e,c}var He=wrap(i?process.nextTick:r?setImmediate:fallback);function _parallel(e,n,t){t=t||noop;var r=isArrayLike(n)?[]:{};e(n,function(e,n,t){wrapAsync(e)(function(e,i){arguments.length>2&&(i=slice(arguments,1)),r[n]=i,t(e)})},function(e){t(e,r)})}function parallelLimit(e,n){_parallel(X,e,n)}function parallelLimit$1(e,n,t){_parallel(_eachOfLimit(n),e,t)}var Je=function(e,n){var t=wrapAsync(e);return queue(function(e,n){t(e[0],n)},n,1)},Xe=function(e,n){var t=Je(e,n);return t.push=function(e,n,r){if(null==r&&(r=noop),"function"!=typeof r)throw new Error("task callback must be a function");if(t.started=!0,F(e)||(e=[e]),0===e.length)return o(function(){t.drain()});n=n||0;for(var i=t._tasks.head;i&&n>=i.priority;)i=i.next;for(var a=0,c=e.length;a<c;a++){var u={data:e[a],priority:n,callback:r};i?t._tasks.insertBefore(i,u):t._tasks.push(u)}o(t.process)},delete t.unshift,t};function race(e,n){if(n=once(n||noop),!F(e))return n(new TypeError("First argument to race must be an array of functions"));if(!e.length)return n();for(var t=0,r=e.length;t<r;t++)wrapAsync(e[t])(n)}function reduceRight(e,n,t,r){reduce(slice(e).reverse(),n,t,r)}function reflect(e){var n=wrapAsync(e);return t(function reflectOn(e,t){return e.push(function callback(e,n){var r;e?t(null,{error:e}):(r=arguments.length<=2?n:slice(arguments,1),t(null,{value:r}))}),n.apply(this,e)})}function reflectAll(e){var n;return F(e)?n=arrayMap(e,reflect):(n={},baseForOwn(e,function(e,t){n[t]=reflect.call(this,e)})),n}function reject$1(e,n,t,r){_filter(e,n,function(e,n){t(e,function(e,t){n(e,!t)})},r)}var Ye=doParallel(reject$1),Ze=doParallelLimit(reject$1),en=doLimit(Ze,1);function constant$1(e){return function(){return e}}function retry(e,n,t){var r=5,i=0,o={times:r,intervalFunc:constant$1(i)};if(arguments.length<3&&"function"==typeof e?(t=n||noop,n=e):(!function parseTimes(e,n){if("object"==typeof n)e.times=+n.times||r,e.intervalFunc="function"==typeof n.interval?n.interval:constant$1(+n.interval||i),e.errorFilter=n.errorFilter;else{if("number"!=typeof n&&"string"!=typeof n)throw new Error("Invalid arguments for async.retry");e.times=+n||r}}(o,e),t=t||noop),"function"!=typeof n)throw new Error("Invalid arguments for async.retry");var a=wrapAsync(n),c=1;!function retryAttempt(){a(function(e){e&&c++<o.times&&("function"!=typeof o.errorFilter||o.errorFilter(e))?setTimeout(retryAttempt,o.intervalFunc(c)):t.apply(null,arguments)})}()}var nn=function(e,n){n||(n=e,e=null);var r=wrapAsync(n);return t(function(n,t){function taskFn(e){r.apply(null,n.concat(e))}e?retry(e,taskFn,t):retry(taskFn,t)})};function series(e,n){_parallel(Oe,e,n)}var tn=doParallel(_createTester(Boolean,identity)),rn=doParallelLimit(_createTester(Boolean,identity)),on=doLimit(rn,1);function sortBy(e,n,t){var r=wrapAsync(n);function comparator(e,n){var t=e.criteria,r=n.criteria;return t<r?-1:t>r?1:0}Y(e,function(e,n){r(e,function(t,r){if(t)return n(t);n(null,{value:e,criteria:r})})},function(e,n){if(e)return t(e);t(null,arrayMap(n.sort(comparator),baseProperty("value")))})}function timeout(e,n,r){var i=wrapAsync(e);return t(function(t,o){var a,c=!1;t.push(function(){c||(o.apply(null,arguments),clearTimeout(a))}),a=setTimeout(function timeoutCallback(){var n=e.name||"anonymous",t=new Error('Callback function "'+n+'" timed out.');t.code="ETIMEDOUT",r&&(t.info=r),c=!0,o(t)},n),i.apply(null,t)})}var an=Math.ceil,cn=Math.max;function timeLimit(e,n,t,r){var i=wrapAsync(t);ee(function baseRange(e,n,t,r){for(var i=-1,o=cn(an((n-e)/(t||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=t;return a}(0,e,1),n,i,r)}var un=doLimit(timeLimit,1/0),ln=doLimit(timeLimit,1);function transform(e,n,t,r){arguments.length<=3&&(r=t,t=n,n=F(e)?[]:{}),r=once(r||noop);var i=wrapAsync(t);X(e,function(e,t,r){i(n,e,t,r)},function(e){r(e,n)})}function tryEach(e,n){var t,r=null;n=n||noop,Be(e,function(e,n){wrapAsync(e)(function(e,i){t=arguments.length>2?slice(arguments,1):i,r=e,n(!e)})},function(){n(r,t)})}function unmemoize(e){return function(){return(e.unmemoized||e).apply(null,arguments)}}function whilst(e,n,t){t=onlyOnce(t||noop);var r=wrapAsync(n);if(!e())return t(null);var i=function(n){if(n)return t(n);if(e())return r(i);var o=slice(arguments,1);t.apply(null,[null].concat(o))};r(i)}function until(e,n,t){whilst(function(){return!e.apply(this,arguments)},n,t)}var fn=function(e,n){if(n=once(n||noop),!F(e))return n(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return n();var t=0;function nextTask(n){var r=wrapAsync(e[t++]);n.push(onlyOnce(next)),r.apply(null,n)}function next(r){if(r||t===e.length)return n.apply(null,arguments);nextTask(slice(arguments,1))}nextTask([])},sn={apply:n,applyEach:Z,applyEachSeries:te,asyncify:asyncify,auto:ie,autoInject:autoInject,cargo:cargo,compose:xe,concat:Ee,concatLimit:Te,concatSeries:Ie,constant:_e,detect:Fe,detectLimit:Pe,detectSeries:De,dir:$e,doDuring:doDuring,doUntil:doUntil,doWhilst:doWhilst,during:during,each:eachLimit,eachLimit:eachLimit$1,eachOf:X,eachOfLimit:eachOfLimit,eachOfSeries:Oe,eachSeries:Be,ensureAsync:ensureAsync,every:qe,everyLimit:Me,everySeries:Re,filter:ze,filterLimit:Ce,filterSeries:Ue,forever:forever,groupBy:Ge,groupByLimit:Ve,groupBySeries:We,log:Ne,map:Y,mapLimit:ee,mapSeries:ne,mapValues:Qe,mapValuesLimit:mapValuesLimit,mapValuesSeries:Ke,memoize:memoize,nextTick:He,parallel:parallelLimit,parallelLimit:parallelLimit$1,priorityQueue:Xe,queue:Je,race:race,reduce:reduce,reduceRight:reduceRight,reflect:reflect,reflectAll:reflectAll,reject:Ye,rejectLimit:Ze,rejectSeries:en,retry:retry,retryable:nn,seq:seq,series:series,setImmediate:o,some:tn,someLimit:rn,someSeries:on,sortBy:sortBy,timeout:timeout,times:un,timesLimit:timeLimit,timesSeries:ln,transform:transform,tryEach:tryEach,unmemoize:unmemoize,until:until,waterfall:fn,whilst:whilst,all:qe,allLimit:Me,allSeries:Re,any:tn,anyLimit:rn,anySeries:on,find:Fe,findLimit:Pe,findSeries:De,forEach:eachLimit,forEachSeries:Be,forEachLimit:eachLimit$1,forEachOf:X,forEachOfSeries:Oe,forEachOfLimit:eachOfLimit,inject:reduce,foldl:reduce,foldr:reduceRight,select:ze,selectLimit:Ce,selectSeries:Ue,wrapSync:asyncify};e.default=sn,e.apply=n,e.applyEach=Z,e.applyEachSeries=te,e.asyncify=asyncify,e.auto=ie,e.autoInject=autoInject,e.cargo=cargo,e.compose=xe,e.concat=Ee,e.concatLimit=Te,e.concatSeries=Ie,e.constant=_e,e.detect=Fe,e.detectLimit=Pe,e.detectSeries=De,e.dir=$e,e.doDuring=doDuring,e.doUntil=doUntil,e.doWhilst=doWhilst,e.during=during,e.each=eachLimit,e.eachLimit=eachLimit$1,e.eachOf=X,e.eachOfLimit=eachOfLimit,e.eachOfSeries=Oe,e.eachSeries=Be,e.ensureAsync=ensureAsync,e.every=qe,e.everyLimit=Me,e.everySeries=Re,e.filter=ze,e.filterLimit=Ce,e.filterSeries=Ue,e.forever=forever,e.groupBy=Ge,e.groupByLimit=Ve,e.groupBySeries=We,e.log=Ne,e.map=Y,e.mapLimit=ee,e.mapSeries=ne,e.mapValues=Qe,e.mapValuesLimit=mapValuesLimit,e.mapValuesSeries=Ke,e.memoize=memoize,e.nextTick=He,e.parallel=parallelLimit,e.parallelLimit=parallelLimit$1,e.priorityQueue=Xe,e.queue=Je,e.race=race,e.reduce=reduce,e.reduceRight=reduceRight,e.reflect=reflect,e.reflectAll=reflectAll,e.reject=Ye,e.rejectLimit=Ze,e.rejectSeries=en,e.retry=retry,e.retryable=nn,e.seq=seq,e.series=series,e.setImmediate=o,e.some=tn,e.someLimit=rn,e.someSeries=on,e.sortBy=sortBy,e.timeout=timeout,e.times=un,e.timesLimit=timeLimit,e.timesSeries=ln,e.transform=transform,e.tryEach=tryEach,e.unmemoize=unmemoize,e.until=until,e.waterfall=fn,e.whilst=whilst,e.all=qe,e.allLimit=Me,e.allSeries=Re,e.any=tn,e.anyLimit=rn,e.anySeries=on,e.find=Fe,e.findLimit=Pe,e.findSeries=De,e.forEach=eachLimit,e.forEachSeries=Be,e.forEachLimit=eachLimit$1,e.forEachOf=X,e.forEachOfSeries=Oe,e.forEachOfLimit=eachOfLimit,e.inject=reduce,e.foldl=reduce,e.foldr=reduceRight,e.select=ze,e.selectLimit=Ce,e.selectSeries=Ue,e.wrapSync=asyncify,Object.defineProperty(e,"__esModule",{value:!0})}); | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) | |
},{"_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","timers":"/Users/lentan/repo/torus/torus-embed/node_modules/timers-browserify/main.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/base64-js/index.js":[function(require,module,exports){ | |
"use strict";exports.byteLength=byteLength,exports.toByteArray=toByteArray,exports.fromByteArray=fromByteArray;for(var lookup=[],revLookup=[],Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;function getLens(o){var r=o.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=o.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function byteLength(o){var r=getLens(o),e=r[0],t=r[1];return 3*(e+t)/4-t}function _byteLength(o,r,e){return 3*(r+e)/4-e}function toByteArray(o){var r,e,t=getLens(o),n=t[0],u=t[1],p=new Arr(_byteLength(o,n,u)),a=0,h=u>0?n-4:n;for(e=0;e<h;e+=4)r=revLookup[o.charCodeAt(e)]<<18|revLookup[o.charCodeAt(e+1)]<<12|revLookup[o.charCodeAt(e+2)]<<6|revLookup[o.charCodeAt(e+3)],p[a++]=r>>16&255,p[a++]=r>>8&255,p[a++]=255&r;return 2===u&&(r=revLookup[o.charCodeAt(e)]<<2|revLookup[o.charCodeAt(e+1)]>>4,p[a++]=255&r),1===u&&(r=revLookup[o.charCodeAt(e)]<<10|revLookup[o.charCodeAt(e+1)]<<4|revLookup[o.charCodeAt(e+2)]>>2,p[a++]=r>>8&255,p[a++]=255&r),p}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[63&o]}function encodeChunk(o,r,e){for(var t,n=[],u=r;u<e;u+=3)t=(o[u]<<16&16711680)+(o[u+1]<<8&65280)+(255&o[u+2]),n.push(tripletToBase64(t));return n.join("")}function fromByteArray(o){for(var r,e=o.length,t=e%3,n=[],u=0,p=e-t;u<p;u+=16383)n.push(encodeChunk(o,u,u+16383>p?p:u+16383));return 1===t?(r=o[e-1],n.push(lookup[r>>2]+lookup[r<<4&63]+"==")):2===t&&(r=(o[e-2]<<8)+o[e-1],n.push(lookup[r>>10]+lookup[r>>4&63]+lookup[r<<2&63]+"=")),n.join("")}revLookup["-".charCodeAt(0)]=62,revLookup["_".charCodeAt(0)]=63; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js":[function(require,module,exports){ | |
!function(t,i){"use strict";function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i,r){if(BN.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var r;"object"==typeof t?t.exports=BN:i.BN=BN,BN.BN=BN,BN.wordSize=26;try{r=require("buffer").Buffer}catch(t){}function parseHex(t,i,r){for(var e=0,n=Math.min(t.length,r),h=i;h<n;h++){var s=t.charCodeAt(h)-48;e<<=4,e|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return e}function parseBase(t,i,r,e){for(var n=0,h=Math.min(t.length,r),s=i;s<h;s++){var o=t.charCodeAt(s)-48;n*=e,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}BN.isBN=function isBN(t){return t instanceof BN||null!==t&&"object"==typeof t&&t.constructor.wordSize===BN.wordSize&&Array.isArray(t.words)},BN.max=function max(t,i){return t.cmp(i)>0?t:i},BN.min=function min(t,i){return t.cmp(i)<0?t:i},BN.prototype._init=function init(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),assert(i===(0|i)&&i>=2&&i<=36);var e=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&e++,16===i?this._parseHex(t,e):this._parseBase(t,i,e),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initNumber=function _initNumber(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(assert(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initArray=function _initArray(t,i,r){if(assert("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h,s=0;if("be"===r)for(e=t.length-1,n=0;e>=0;e-=3)h=t[e]|t[e-1]<<8|t[e-2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(e=0,n=0;e<t.length;e+=3)h=t[e]|t[e+1]<<8|t[e+2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var e,n,h=0;for(r=t.length-6,e=0;r>=i;r-=6)n=parseHex(t,r,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303,(h+=24)>=26&&(h-=26,e++);r+6!==i&&(n=parseHex(t,i,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303),this.strip()},BN.prototype._parseBase=function _parseBase(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,s=h%e,o=Math.min(h,h-s)+r,u=0,a=r;a<o;a+=e)u=parseBase(t,a,a+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=parseBase(t,a,t.length,i),a=0;a<s;a++)l*=i;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},BN.prototype.copy=function copy(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},BN.prototype.clone=function clone(){var t=new BN(null);return this.copy(t),t},BN.prototype._expand=function _expand(t){for(;this.length<t;)this.words[this.length++]=0;return this},BN.prototype.strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var e=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],n=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],s=n*h,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(s=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&s}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}BN.prototype.toString=function toString(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var s=0,o=0,u=0;u<this.length;u++){var a=this.words[u],l=(16777215&(a<<s|o)).toString(16);r=0!==(o=a>>>24-s&16777215)||u!==this.length-1?e[6-l.length]+l+r:l+r,(s+=2)>=26&&(s-=26,u--)}for(0!==o&&(r=o.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var m=n[t],f=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(f).toString(t);r=(d=d.idivn(f)).isZero()?p+r:e[m-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(t,i){return assert(void 0!==r),this.toArrayLike(r,t,i)},BN.prototype.toArray=function toArray(t,i){return this.toArrayLike(Array,t,i)},BN.prototype.toArrayLike=function toArrayLike(t,i,r){var e=this.byteLength(),n=r||Math.max(1,e);assert(e<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var h,s,o="le"===i,u=new t(n),a=this.clone();if(o){for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[s]=h;for(;s<n;s++)u[s]=0}else{for(s=0;s<n-e;s++)u[s]=0;for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[n-s-1]=h}return u},Math.clz32?BN.prototype._countBits=function _countBits(t){return 32-Math.clz32(t)}:BN.prototype._countBits=function _countBits(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},BN.prototype._zeroBits=function _zeroBits(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},BN.prototype.bitLength=function bitLength(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this.strip()},BN.prototype.ior=function ior(t){return assert(0==(this.negative|t.negative)),this.iuor(t)},BN.prototype.or=function or(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},BN.prototype.uor=function uor(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},BN.prototype.iuand=function iuand(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this.strip()},BN.prototype.iand=function iand(t){return assert(0==(this.negative|t.negative)),this.iuand(t)},BN.prototype.and=function and(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},BN.prototype.uand=function uand(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},BN.prototype.iuxor=function iuxor(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this.strip()},BN.prototype.ixor=function ixor(t){return assert(0==(this.negative|t.negative)),this.iuxor(t)},BN.prototype.xor=function xor(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},BN.prototype.uxor=function uxor(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},BN.prototype.inotn=function inotn(t){assert("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var e=0;e<i;e++)this.words[e]=67108863&~this.words[e];return r>0&&(this.words[e]=~this.words[e]&67108863>>26-r),this.strip()},BN.prototype.notn=function notn(t){return this.clone().inotn(t)},BN.prototype.setn=function setn(t,i){assert("number"==typeof t&&t>=0);var r=t/26|0,e=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<e:this.words[r]&~(1<<e),this.strip()},BN.prototype.iadd=function iadd(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},BN.prototype.add=function add(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function isub(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,s=0;s<e.length;s++)h=(i=(0|r.words[s])-(0|e.words[s])+h)>>26,this.words[s]=67108863&i;for(;0!==h&&s<r.length;s++)h=(i=(0|r.words[s])+h)>>26,this.words[s]=67108863&i;if(0===h&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function sub(t){return this.clone().isub(t)};var s=function comb10MulTo(t,i,r){var e,n,h,s=t.words,o=i.words,u=r.words,a=0,l=0|s[0],m=8191&l,f=l>>>13,d=0|s[1],p=8191&d,M=d>>>13,v=0|s[2],g=8191&v,c=v>>>13,w=0|s[3],y=8191&w,B=w>>>13,N=0|s[4],b=8191&N,_=N>>>13,R=0|s[5],A=8191&R,k=R>>>13,x=0|s[6],S=8191&x,T=x>>>13,q=0|s[7],F=8191&q,P=q>>>13,Z=0|s[8],L=8191&Z,I=Z>>>13,z=0|s[9],K=8191&z,j=z>>>13,E=0|o[0],O=8191&E,H=E>>>13,D=0|o[1],C=8191&D,J=D>>>13,U=0|o[2],G=8191&U,Q=U>>>13,V=0|o[3],W=8191&V,X=V>>>13,Y=0|o[4],$=8191&Y,tt=Y>>>13,it=0|o[5],rt=8191&it,et=it>>>13,nt=0|o[6],ht=8191&nt,st=nt>>>13,ot=0|o[7],ut=8191&ot,at=ot>>>13,lt=0|o[8],mt=8191<,ft=lt>>>13,dt=0|o[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(m,O))|0)+((8191&(n=(n=Math.imul(m,H))+Math.imul(f,O)|0))<<13)|0;a=((h=Math.imul(f,H))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(p,O),n=(n=Math.imul(p,H))+Math.imul(M,O)|0,h=Math.imul(M,H);var gt=(a+(e=e+Math.imul(m,C)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,C)|0))<<13)|0;a=((h=h+Math.imul(f,J)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,O),n=(n=Math.imul(g,H))+Math.imul(c,O)|0,h=Math.imul(c,H),e=e+Math.imul(p,C)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,C)|0,h=h+Math.imul(M,J)|0;var ct=(a+(e=e+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((h=h+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(y,O),n=(n=Math.imul(y,H))+Math.imul(B,O)|0,h=Math.imul(B,H),e=e+Math.imul(g,C)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,C)|0,h=h+Math.imul(c,J)|0,e=e+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,h=h+Math.imul(M,Q)|0;var wt=(a+(e=e+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(b,O),n=(n=Math.imul(b,H))+Math.imul(_,O)|0,h=Math.imul(_,H),e=e+Math.imul(y,C)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(B,C)|0,h=h+Math.imul(B,J)|0,e=e+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,h=h+Math.imul(c,Q)|0,e=e+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,h=h+Math.imul(M,X)|0;var yt=(a+(e=e+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(A,O),n=(n=Math.imul(A,H))+Math.imul(k,O)|0,h=Math.imul(k,H),e=e+Math.imul(b,C)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(_,C)|0,h=h+Math.imul(_,J)|0,e=e+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(B,G)|0,h=h+Math.imul(B,Q)|0,e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,h=h+Math.imul(c,X)|0,e=e+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,h=h+Math.imul(M,tt)|0;var Bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(S,O),n=(n=Math.imul(S,H))+Math.imul(T,O)|0,h=Math.imul(T,H),e=e+Math.imul(A,C)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(k,C)|0,h=h+Math.imul(k,J)|0,e=e+Math.imul(b,G)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(_,G)|0,h=h+Math.imul(_,Q)|0,e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(B,W)|0,h=h+Math.imul(B,X)|0,e=e+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,h=h+Math.imul(c,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(M,rt)|0,h=h+Math.imul(M,et)|0;var Nt=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,st)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(F,O),n=(n=Math.imul(F,H))+Math.imul(P,O)|0,h=Math.imul(P,H),e=e+Math.imul(S,C)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(T,C)|0,h=h+Math.imul(T,J)|0,e=e+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(k,G)|0,h=h+Math.imul(k,Q)|0,e=e+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(_,W)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(B,$)|0,h=h+Math.imul(B,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(c,rt)|0,h=h+Math.imul(c,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(M,ht)|0,h=h+Math.imul(M,st)|0;var bt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(L,O),n=(n=Math.imul(L,H))+Math.imul(I,O)|0,h=Math.imul(I,H),e=e+Math.imul(F,C)|0,n=(n=n+Math.imul(F,J)|0)+Math.imul(P,C)|0,h=h+Math.imul(P,J)|0,e=e+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(T,G)|0,h=h+Math.imul(T,Q)|0,e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(k,W)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(_,$)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(B,rt)|0,h=h+Math.imul(B,et)|0,e=e+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(c,ht)|0,h=h+Math.imul(c,st)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,h=h+Math.imul(M,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(K,O),n=(n=Math.imul(K,H))+Math.imul(j,O)|0,h=Math.imul(j,H),e=e+Math.imul(L,C)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(I,C)|0,h=h+Math.imul(I,J)|0,e=e+Math.imul(F,G)|0,n=(n=n+Math.imul(F,Q)|0)+Math.imul(P,G)|0,h=h+Math.imul(P,Q)|0,e=e+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(T,W)|0,h=h+Math.imul(T,X)|0,e=e+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(k,$)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(B,ht)|0,h=h+Math.imul(B,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,h=h+Math.imul(c,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,h=h+Math.imul(M,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(K,C),n=(n=Math.imul(K,J))+Math.imul(j,C)|0,h=Math.imul(j,J),e=e+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(I,G)|0,h=h+Math.imul(I,Q)|0,e=e+Math.imul(F,W)|0,n=(n=n+Math.imul(F,X)|0)+Math.imul(P,W)|0,h=h+Math.imul(P,X)|0,e=e+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,$)|0,h=h+Math.imul(T,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(B,ut)|0,h=h+Math.imul(B,at)|0,e=e+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,h=h+Math.imul(c,ft)|0;var At=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((h=h+Math.imul(M,Mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(K,G),n=(n=Math.imul(K,Q))+Math.imul(j,G)|0,h=Math.imul(j,Q),e=e+Math.imul(L,W)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(I,W)|0,h=h+Math.imul(I,X)|0,e=e+Math.imul(F,$)|0,n=(n=n+Math.imul(F,tt)|0)+Math.imul(P,$)|0,h=h+Math.imul(P,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(T,rt)|0,h=h+Math.imul(T,et)|0,e=e+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,st)|0,e=e+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(B,mt)|0,h=h+Math.imul(B,ft)|0;var kt=(a+(e=e+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((h=h+Math.imul(c,Mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(K,W),n=(n=Math.imul(K,X))+Math.imul(j,W)|0,h=Math.imul(j,X),e=e+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(I,$)|0,h=h+Math.imul(I,tt)|0,e=e+Math.imul(F,rt)|0,n=(n=n+Math.imul(F,et)|0)+Math.imul(P,rt)|0,h=h+Math.imul(P,et)|0,e=e+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(T,ht)|0,h=h+Math.imul(T,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(b,mt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var xt=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((h=h+Math.imul(B,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(K,$),n=(n=Math.imul(K,tt))+Math.imul(j,$)|0,h=Math.imul(j,tt),e=e+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(I,rt)|0,h=h+Math.imul(I,et)|0,e=e+Math.imul(F,ht)|0,n=(n=n+Math.imul(F,st)|0)+Math.imul(P,ht)|0,h=h+Math.imul(P,st)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(T,ut)|0,h=h+Math.imul(T,at)|0,e=e+Math.imul(A,mt)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var St=(a+(e=e+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,Mt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(K,rt),n=(n=Math.imul(K,et))+Math.imul(j,rt)|0,h=Math.imul(j,et),e=e+Math.imul(L,ht)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(I,ht)|0,h=h+Math.imul(I,st)|0,e=e+Math.imul(F,ut)|0,n=(n=n+Math.imul(F,at)|0)+Math.imul(P,ut)|0,h=h+Math.imul(P,at)|0,e=e+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(T,mt)|0,h=h+Math.imul(T,ft)|0;var Tt=(a+(e=e+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,Mt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,Mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(K,ht),n=(n=Math.imul(K,st))+Math.imul(j,ht)|0,h=Math.imul(j,st),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(I,ut)|0,h=h+Math.imul(I,at)|0,e=e+Math.imul(F,mt)|0,n=(n=n+Math.imul(F,ft)|0)+Math.imul(P,mt)|0,h=h+Math.imul(P,ft)|0;var qt=(a+(e=e+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((h=h+Math.imul(T,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(K,ut),n=(n=Math.imul(K,at))+Math.imul(j,ut)|0,h=Math.imul(j,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,h=h+Math.imul(I,ft)|0;var Ft=(a+(e=e+Math.imul(F,pt)|0)|0)+((8191&(n=(n=n+Math.imul(F,Mt)|0)+Math.imul(P,pt)|0))<<13)|0;a=((h=h+Math.imul(P,Mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,e=Math.imul(K,mt),n=(n=Math.imul(K,ft))+Math.imul(j,mt)|0,h=Math.imul(j,ft);var Pt=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((h=h+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Zt=(a+(e=Math.imul(K,pt))|0)+((8191&(n=(n=Math.imul(K,Mt))+Math.imul(j,pt)|0))<<13)|0;return a=((h=Math.imul(j,Mt))+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=Bt,u[6]=Nt,u[7]=bt,u[8]=_t,u[9]=Rt,u[10]=At,u[11]=kt,u[12]=xt,u[13]=St,u[14]=Tt,u[15]=qt,u[16]=Ft,u[17]=Pt,u[18]=Zt,0!==a&&(u[19]=a,r.length++),r};function jumboMulTo(t,i,r){return(new FFTM).mulp(t,i,r)}function FFTM(t,i){this.x=t,this.y=i}Math.imul||(s=smallMulTo),BN.prototype.mulTo=function mulTo(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?s(this,t,i):r<63?smallMulTo(this,t,i):r<1024?function bigMulTo(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var s=n;n=0;for(var o=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;o=67108863&(f=f+o|0),n+=(s=(s=s+(m/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[h]=o,e=s,s=n}return 0!==e?r.words[h]=e:r.length--,r.strip()}(this,t,i):jumboMulTo(this,t,i)},FFTM.prototype.makeRBT=function makeRBT(t){for(var i=new Array(t),r=BN.prototype._countBits(t)-1,e=0;e<t;e++)i[e]=this.revBin(e,r,t);return i},FFTM.prototype.revBin=function revBin(t,i,r){if(0===t||t===r-1)return t;for(var e=0,n=0;n<i;n++)e|=(1&t)<<i-n-1,t>>=1;return e},FFTM.prototype.permute=function permute(t,i,r,e,n,h){for(var s=0;s<h;s++)e[s]=i[t[s]],n[s]=r[t[s]]},FFTM.prototype.transform=function transform(t,i,r,e,n,h){this.permute(h,t,i,r,e,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),a=Math.sin(2*Math.PI/o),l=0;l<n;l+=o)for(var m=u,f=a,d=0;d<s;d++){var p=r[l+d],M=e[l+d],v=r[l+d+s],g=e[l+d+s],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,e[l+d]=M+g,r[l+d+s]=p-v,e[l+d+s]=M-g,d!==o&&(c=u*m-a*f,f=u*f+a*m,m=c)}},FFTM.prototype.guessLen13b=function guessLen13b(t,i){var r=1|Math.max(i,t),e=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+e},FFTM.prototype.conjugate=function conjugate(t,i,r){if(!(r<=1))for(var e=0;e<r/2;e++){var n=t[e];t[e]=t[r-e-1],t[r-e-1]=n,n=i[e],i[e]=-i[r-e-1],i[r-e-1]=-n}},FFTM.prototype.normalize13b=function normalize13b(t,i){for(var r=0,e=0;e<i/2;e++){var n=8192*Math.round(t[2*e+1]/i)+Math.round(t[2*e]/i)+r;t[e]=67108863&n,r=n<67108864?0:n/67108864|0}return t},FFTM.prototype.convert13b=function convert13b(t,i,r,e){for(var n=0,h=0;h<i;h++)n+=0|t[h],r[2*h]=8191&n,n>>>=13,r[2*h+1]=8191&n,n>>>=13;for(h=2*i;h<e;++h)r[h]=0;assert(0===n),assert(0==(-8192&n))},FFTM.prototype.stub=function stub(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},FFTM.prototype.mulp=function mulp(t,i,r){var e=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(e),h=this.stub(e),s=new Array(e),o=new Array(e),u=new Array(e),a=new Array(e),l=new Array(e),m=new Array(e),f=r.words;f.length=e,this.convert13b(t.words,t.length,s,e),this.convert13b(i.words,i.length,a,e),this.transform(s,h,o,u,e,n),this.transform(a,h,l,m,e,n);for(var d=0;d<e;d++){var p=o[d]*l[d]-u[d]*m[d];u[d]=o[d]*m[d]+u[d]*l[d],o[d]=p}return this.conjugate(o,u,e),this.transform(o,u,f,h,e,n),this.conjugate(f,h,e),this.normalize13b(f,e),r.negative=t.negative^i.negative,r.length=t.length+i.length,r.strip()},BN.prototype.mul=function mul(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.mulf=function mulf(t){var i=new BN(null);return i.words=new Array(this.length+t.length),jumboMulTo(this,t,i)},BN.prototype.imul=function imul(t){return this.clone().mulTo(t,this)},BN.prototype.imuln=function imuln(t){assert("number"==typeof t),assert(t<67108864);for(var i=0,r=0;r<this.length;r++){var e=(0|this.words[r])*t,n=(67108863&e)+(67108863&i);i>>=26,i+=e/67108864|0,i+=n>>>26,this.words[r]=67108863&n}return 0!==i&&(this.words[r]=i,this.length++),this},BN.prototype.muln=function muln(t){return this.clone().imuln(t)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(t){var i=function toBitArray(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=(t.words[e]&1<<n)>>>n}return i}(t);if(0===i.length)return new BN(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},BN.prototype.iushln=function iushln(t){assert("number"==typeof t&&t>=0);var i,r=t%26,e=(t-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var h=0;for(i=0;i<this.length;i++){var s=this.words[i]&n,o=(0|this.words[i])-s<<r;this.words[i]=o|h,h=s>>>26-r}h&&(this.words[i]=h,this.length++)}if(0!==e){for(i=this.length-1;i>=0;i--)this.words[i+e]=this.words[i];for(i=0;i<e;i++)this.words[i]=0;this.length+=e}return this.strip()},BN.prototype.ishln=function ishln(t){return assert(0===this.negative),this.iushln(t)},BN.prototype.iushrn=function iushrn(t,i,r){var e;assert("number"==typeof t&&t>=0),e=i?(i-i%26)/26:0;var n=t%26,h=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,o=r;if(e-=h,e=Math.max(0,e),o){for(var u=0;u<h;u++)o.words[u]=this.words[u];o.length=h}if(0===h);else if(this.length>h)for(this.length-=h,u=0;u<this.length;u++)this.words[u]=this.words[u+h];else this.words[0]=0,this.length=1;var a=0;for(u=this.length-1;u>=0&&(0!==a||u>=e);u--){var l=0|this.words[u];this.words[u]=a<<26-n|l>>>n,a=l&s}return o&&0!==a&&(o.words[o.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(t,i,r){return assert(0===this.negative),this.iushrn(t,i,r)},BN.prototype.shln=function shln(t){return this.clone().ishln(t)},BN.prototype.ushln=function ushln(t){return this.clone().iushln(t)},BN.prototype.shrn=function shrn(t){return this.clone().ishrn(t)},BN.prototype.ushrn=function ushrn(t){return this.clone().iushrn(t)},BN.prototype.testn=function testn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,e=1<<i;return!(this.length<=r)&&!!(this.words[r]&e)},BN.prototype.imaskn=function imaskn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var e=67108863^67108863>>>i<<i;this.words[this.length-1]&=e}return this.strip()},BN.prototype.maskn=function maskn(t){return this.clone().imaskn(t)},BN.prototype.iaddn=function iaddn(t){return assert("number"==typeof t),assert(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},BN.prototype._iaddn=function _iaddn(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function isubn(t){if(assert("number"==typeof t),assert(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},BN.prototype.addn=function addn(t){return this.clone().iaddn(t)},BN.prototype.subn=function subn(t){return this.clone().isubn(t)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(t,i,r){var e,n,h=t.length+r;this._expand(h);var s=0;for(e=0;e<t.length;e++){n=(0|this.words[e+r])+s;var o=(0|t.words[e])*i;s=((n-=67108863&o)>>26)-(o/67108864|0),this.words[e+r]=67108863&n}for(;e<this.length-r;e++)s=(n=(0|this.words[e+r])+s)>>26,this.words[e+r]=67108863&n;if(0===s)return this.strip();for(assert(-1===s),s=0,e=0;e<this.length;e++)s=(n=-(0|this.words[e])+s)>>26,this.words[e]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(t,i){var r=(this.length,t.length),e=this.clone(),n=t,h=0|n.words[n.length-1];0!==(r=26-this._countBits(h))&&(n=n.ushln(r),e.iushln(r),h=0|n.words[n.length-1]);var s,o=e.length-n.length;if("mod"!==i){(s=new BN(null)).length=o+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var a=e.clone()._ishlnsubmul(n,1,o);0===a.negative&&(e=a,s&&(s.words[o]=1));for(var l=o-1;l>=0;l--){var m=67108864*(0|e.words[n.length+l])+(0|e.words[n.length+l-1]);for(m=Math.min(m/h|0,67108863),e._ishlnsubmul(n,m,l);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,l),e.isZero()||(e.negative^=1);s&&(s.words[l]=m)}return s&&s.strip(),e.strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},BN.prototype.divmod=function divmod(t,i,r){return assert(!t.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(e=h.div.neg()),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.iadd(t)),{div:e,mod:n}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(e=h.div.neg()),{div:e,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.isub(t)),{div:h.div,mod:n}):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,i);var e,n,h},BN.prototype.div=function div(t){return this.divmod(t,"div",!1).div},BN.prototype.mod=function mod(t){return this.divmod(t,"mod",!1).mod},BN.prototype.umod=function umod(t){return this.divmod(t,"mod",!0).mod},BN.prototype.divRound=function divRound(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modn=function modn(t){assert(t<=67108863);for(var i=(1<<26)%t,r=0,e=this.length-1;e>=0;e--)r=(i*r+(0|this.words[e]))%t;return r},BN.prototype.idivn=function idivn(t){assert(t<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var e=(0|this.words[r])+67108864*i;this.words[r]=e/t|0,i=e%t}return this.strip()},BN.prototype.divn=function divn(t){return this.clone().idivn(t)},BN.prototype.egcd=function egcd(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new BN(1),n=new BN(0),h=new BN(0),s=new BN(1),o=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++o;for(var u=r.clone(),a=i.clone();!i.isZero();){for(var l=0,m=1;0==(i.words[0]&m)&&l<26;++l,m<<=1);if(l>0)for(i.iushrn(l);l-- >0;)(e.isOdd()||n.isOdd())&&(e.iadd(u),n.isub(a)),e.iushrn(1),n.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(h.isOdd()||s.isOdd())&&(h.iadd(u),s.isub(a)),h.iushrn(1),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),e.isub(h),n.isub(s)):(r.isub(i),h.isub(e),s.isub(n))}return{a:h,b:s,gcd:r.iushln(o)}},BN.prototype._invmp=function _invmp(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,n=new BN(1),h=new BN(0),s=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var o=0,u=1;0==(i.words[0]&u)&&o<26;++o,u<<=1);if(o>0)for(i.iushrn(o);o-- >0;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var a=0,l=1;0==(r.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(r.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(s),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h)):(r.isub(i),h.isub(n))}return(e=0===i.cmpn(1)?n:h).cmpn(0)<0&&e.iadd(t),e},BN.prototype.gcd=function gcd(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},BN.prototype.invm=function invm(t){return this.egcd(t).a.umod(t)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(t){return this.words[0]&t},BN.prototype.bincn=function bincn(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,e=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=e,this;for(var n=e,h=r;0!==n&&h<this.length;h++){var s=0|this.words[h];n=(s+=n)>>>26,s&=67108863,this.words[h]=s}return 0!==n&&(this.words[h]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)i=1;else{r&&(t=-t),assert(t<=67108863,"Number is too big");var e=0|this.words[0];i=e===t?0:e<t?-1:1}return 0!==this.negative?0|-i:i},BN.prototype.cmp=function cmp(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},BN.prototype.ucmp=function ucmp(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},BN.prototype.gtn=function gtn(t){return 1===this.cmpn(t)},BN.prototype.gt=function gt(t){return 1===this.cmp(t)},BN.prototype.gten=function gten(t){return this.cmpn(t)>=0},BN.prototype.gte=function gte(t){return this.cmp(t)>=0},BN.prototype.ltn=function ltn(t){return-1===this.cmpn(t)},BN.prototype.lt=function lt(t){return-1===this.cmp(t)},BN.prototype.lten=function lten(t){return this.cmpn(t)<=0},BN.prototype.lte=function lte(t){return this.cmp(t)<=0},BN.prototype.eqn=function eqn(t){return 0===this.cmpn(t)},BN.prototype.eq=function eq(t){return 0===this.cmp(t)},BN.red=function red(t){return new Red(t)},BN.prototype.toRed=function toRed(t){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(t){return this.red=t,this},BN.prototype.forceRed=function forceRed(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function redAdd(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function redIAdd(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function redSub(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function redISub(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function redShl(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function redMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function redIMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var o={k256:null,p224:null,p192:null,p25519:null};function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else assert(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function ireduce(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function split(t,i){t.iushrn(this.n,0,i)},MPrime.prototype.imulK=function imulK(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(t,i){for(var r=Math.min(t.length,9),e=0;e<r;e++)i.words[e]=t.words[e];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(i.words[i.length++]=4194303&n,e=10;e<t.length;e++){var h=0|t.words[e];t.words[e-10]=(4194303&h)<<4|n>>>22,n=h}n>>>=22,t.words[e-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},K256.prototype.imulK=function imulK(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function prime(t){if(o[t])return o[t];var prime;if("k256"===t)prime=new K256;else if("p224"===t)prime=new P224;else if("p192"===t)prime=new P192;else{if("p25519"!==t)throw new Error("Unknown prime "+t);prime=new P25519}return o[t]=prime,prime},Red.prototype._verify1=function _verify1(t){assert(0===t.negative,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(t,i){assert(0==(t.negative|i.negative),"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function imod(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Red.prototype.add=function add(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},Red.prototype.iadd=function iadd(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},Red.prototype.sub=function sub(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},Red.prototype.isub=function isub(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function shl(t,i){return this._verify1(t),this.imod(t.ushln(i))},Red.prototype.imul=function imul(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function mul(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function isqr(t){return this.imul(t,t.clone())},Red.prototype.sqr=function sqr(t){return this.mul(t,t)},Red.prototype.sqrt=function sqrt(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(assert(i%2==1),3===i){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(t,r)}for(var e=this.m.subn(1),n=0;!e.isZero()&&0===e.andln(1);)n++,e.iushrn(1);assert(!e.isZero());var h=new BN(1).toRed(this),s=h.redNeg(),o=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new BN(2*u*u).toRed(this);0!==this.pow(u,o).cmp(s);)u.redIAdd(s);for(var a=this.pow(u,e),l=this.pow(t,e.addn(1).iushrn(1)),m=this.pow(t,e),f=n;0!==m.cmp(h);){for(var d=m,p=0;0!==d.cmp(h);p++)d=d.redSqr();assert(p<f);var M=this.pow(a,new BN(1).iushln(f-p-1));l=l.redMul(M),a=M.redSqr(),m=m.redMul(a),f=p}return l},Red.prototype.invm=function invm(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function pow(t,i){if(i.isZero())return new BN(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new BN(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],h=0,s=0,o=i.bitLength()%26;for(0===o&&(o=26),e=i.length-1;e>=0;e--){for(var u=i.words[e],a=o-1;a>=0;a--){var l=u>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==h?(h<<=1,h|=l,(4===++s||0===e&&0===a)&&(n=this.mul(n,r[h]),s=0,h=0)):s=0}o=26}return n},Red.prototype.convertTo=function convertTo(t){var i=t.umod(this.m);return i===t?i.clone():i},Red.prototype.convertFrom=function convertFrom(t){var i=t.clone();return i.red=null,i},BN.mont=function mont(t){return new Mont(t)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(t){return this.imod(t.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},Mont.prototype.imul=function imul(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.mul=function mul(t,i){if(t.isZero()||i.isZero())return new BN(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.invm=function invm(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js":[function(require,module,exports){ | |
var r;function Rand(r){this.rand=r}if(module.exports=function rand(t){return r||(r=new Rand(null)),r.generate(t)},module.exports.Rand=Rand,Rand.prototype.generate=function generate(r){return this._rand(r)},Rand.prototype._rand=function _rand(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),n=0;n<t.length;n++)t[n]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?Rand.prototype._rand=function _rand(r){var t=new Uint8Array(r);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?Rand.prototype._rand=function _rand(r){var t=new Uint8Array(r);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(Rand.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var crypto=require("crypto");if("function"!=typeof crypto.randomBytes)throw new Error("Not supported");Rand.prototype._rand=function _rand(r){return crypto.randomBytes(r)}}catch(r){} | |
},{"crypto":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js":[function(require,module,exports){ | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/aes.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer;function asUInt32Array(r){Buffer.isBuffer(r)||(r=Buffer.from(r));for(var e=r.length/4|0,t=new Array(e),n=0;n<e;n++)t[n]=r.readUInt32BE(4*n);return t}function scrubVec(r){for(;0<r.length;r++)r[0]=0}function cryptBlock(r,e,t,n,o){for(var S,B,c,i,u=t[0],f=t[1],a=t[2],s=t[3],y=r[0]^e[0],_=r[1]^e[1],I=r[2]^e[2],l=r[3]^e[3],X=4,h=1;h<o;h++)S=u[y>>>24]^f[_>>>16&255]^a[I>>>8&255]^s[255&l]^e[X++],B=u[_>>>24]^f[I>>>16&255]^a[l>>>8&255]^s[255&y]^e[X++],c=u[I>>>24]^f[l>>>16&255]^a[y>>>8&255]^s[255&_]^e[X++],i=u[l>>>24]^f[y>>>16&255]^a[_>>>8&255]^s[255&I]^e[X++],y=S,_=B,I=c,l=i;return S=(n[y>>>24]<<24|n[_>>>16&255]<<16|n[I>>>8&255]<<8|n[255&l])^e[X++],B=(n[_>>>24]<<24|n[I>>>16&255]<<16|n[l>>>8&255]<<8|n[255&y])^e[X++],c=(n[I>>>24]<<24|n[l>>>16&255]<<16|n[y>>>8&255]<<8|n[255&_])^e[X++],i=(n[l>>>24]<<24|n[y>>>16&255]<<16|n[_>>>8&255]<<8|n[255&I])^e[X++],[S>>>=0,B>>>=0,c>>>=0,i>>>=0]}var RCON=[0,1,2,4,8,16,32,64,128,27,54],G=function(){for(var r=new Array(256),e=0;e<256;e++)r[e]=e<128?e<<1:e<<1^283;for(var t=[],n=[],o=[[],[],[],[]],S=[[],[],[],[]],B=0,c=0,i=0;i<256;++i){var u=c^c<<1^c<<2^c<<3^c<<4;u=u>>>8^255&u^99,t[B]=u,n[u]=B;var f=r[B],a=r[f],s=r[a],y=257*r[u]^16843008*u;o[0][B]=y<<24|y>>>8,o[1][B]=y<<16|y>>>16,o[2][B]=y<<8|y>>>24,o[3][B]=y,y=16843009*s^65537*a^257*f^16843008*B,S[0][u]=y<<24|y>>>8,S[1][u]=y<<16|y>>>16,S[2][u]=y<<8|y>>>24,S[3][u]=y,0===B?B=c=1:(B=f^r[r[r[s^f]]],c^=r[r[c]])}return{SBOX:t,INV_SBOX:n,SUB_MIX:o,INV_SUB_MIX:S}}();function AES(r){this._key=asUInt32Array(r),this._reset()}AES.blockSize=16,AES.keySize=32,AES.prototype.blockSize=AES.blockSize,AES.prototype.keySize=AES.keySize,AES.prototype._reset=function(){for(var r=this._key,e=r.length,t=e+6,n=4*(t+1),o=[],S=0;S<e;S++)o[S]=r[S];for(S=e;S<n;S++){var B=o[S-1];S%e==0?(B=B<<8|B>>>24,B=G.SBOX[B>>>24]<<24|G.SBOX[B>>>16&255]<<16|G.SBOX[B>>>8&255]<<8|G.SBOX[255&B],B^=RCON[S/e|0]<<24):e>6&&S%e==4&&(B=G.SBOX[B>>>24]<<24|G.SBOX[B>>>16&255]<<16|G.SBOX[B>>>8&255]<<8|G.SBOX[255&B]),o[S]=o[S-e]^B}for(var c=[],i=0;i<n;i++){var u=n-i,f=o[u-(i%4?0:4)];c[i]=i<4||u<=4?f:G.INV_SUB_MIX[0][G.SBOX[f>>>24]]^G.INV_SUB_MIX[1][G.SBOX[f>>>16&255]]^G.INV_SUB_MIX[2][G.SBOX[f>>>8&255]]^G.INV_SUB_MIX[3][G.SBOX[255&f]]}this._nRounds=t,this._keySchedule=o,this._invKeySchedule=c},AES.prototype.encryptBlockRaw=function(r){return cryptBlock(r=asUInt32Array(r),this._keySchedule,G.SUB_MIX,G.SBOX,this._nRounds)},AES.prototype.encryptBlock=function(r){var e=this.encryptBlockRaw(r),t=Buffer.allocUnsafe(16);return t.writeUInt32BE(e[0],0),t.writeUInt32BE(e[1],4),t.writeUInt32BE(e[2],8),t.writeUInt32BE(e[3],12),t},AES.prototype.decryptBlock=function(r){var e=(r=asUInt32Array(r))[1];r[1]=r[3],r[3]=e;var t=cryptBlock(r,this._invKeySchedule,G.INV_SUB_MIX,G.INV_SBOX,this._nRounds),n=Buffer.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[3],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[1],12),n},AES.prototype.scrub=function(){scrubVec(this._keySchedule),scrubVec(this._invKeySchedule),scrubVec(this._key)},module.exports.AES=AES; | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/authCipher.js":[function(require,module,exports){ | |
var aes=require("./aes"),Buffer=require("safe-buffer").Buffer,Transform=require("cipher-base"),inherits=require("inherits"),GHASH=require("./ghash"),xor=require("buffer-xor"),incr32=require("./incr32");function xorTest(t,e){var r=0;t.length!==e.length&&r++;for(var a=Math.min(t.length,e.length),h=0;h<a;++h)r+=t[h]^e[h];return r}function calcIv(t,e,r){if(12===e.length)return t._finID=Buffer.concat([e,Buffer.from([0,0,0,1])]),Buffer.concat([e,Buffer.from([0,0,0,2])]);var a=new GHASH(r),h=e.length,i=h%16;a.update(e),i&&(i=16-i,a.update(Buffer.alloc(i,0))),a.update(Buffer.alloc(8,0));var s=8*h,n=Buffer.alloc(8);n.writeUIntBE(s,0,8),a.update(n),t._finID=a.state;var u=Buffer.from(t._finID);return incr32(u),u}function StreamCipher(t,e,r,a){Transform.call(this);var h=Buffer.alloc(4,0);this._cipher=new aes.AES(e);var i=this._cipher.encryptBlock(h);this._ghash=new GHASH(i),r=calcIv(this,r,i),this._prev=Buffer.from(r),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=t,this._authTag=null,this._called=!1}inherits(StreamCipher,Transform),StreamCipher.prototype._update=function(t){if(!this._called&&this._alen){var e=16-this._alen%16;e<16&&(e=Buffer.alloc(e,0),this._ghash.update(e))}this._called=!0;var r=this._mode.encrypt(this,t);return this._decrypt?this._ghash.update(t):this._ghash.update(r),this._len+=t.length,r},StreamCipher.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var t=xor(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&xorTest(t,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=t,this._cipher.scrub()},StreamCipher.prototype.getAuthTag=function getAuthTag(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},StreamCipher.prototype.setAuthTag=function setAuthTag(t){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=t},StreamCipher.prototype.setAAD=function setAAD(t){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(t),this._alen+=t.length},module.exports=StreamCipher; | |
},{"./aes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/aes.js","./ghash":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/ghash.js","./incr32":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/incr32.js","buffer-xor":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js","cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/browser.js":[function(require,module,exports){ | |
var ciphers=require("./encrypter"),deciphers=require("./decrypter"),modes=require("./modes/list.json");function getCiphers(){return Object.keys(modes)}exports.createCipher=exports.Cipher=ciphers.createCipher,exports.createCipheriv=exports.Cipheriv=ciphers.createCipheriv,exports.createDecipher=exports.Decipher=deciphers.createDecipher,exports.createDecipheriv=exports.Decipheriv=deciphers.createDecipheriv,exports.listCiphers=exports.getCiphers=getCiphers; | |
},{"./decrypter":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/decrypter.js","./encrypter":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/encrypter.js","./modes/list.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/list.json"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/decrypter.js":[function(require,module,exports){ | |
var AuthCipher=require("./authCipher"),Buffer=require("safe-buffer").Buffer,MODES=require("./modes"),StreamCipher=require("./streamCipher"),Transform=require("cipher-base"),aes=require("./aes"),ebtk=require("evp_bytestokey"),inherits=require("inherits");function Decipher(e,r,t){Transform.call(this),this._cache=new Splitter,this._last=void 0,this._cipher=new aes.AES(r),this._prev=Buffer.from(t),this._mode=e,this._autopadding=!0}function Splitter(){this.cache=Buffer.allocUnsafe(0)}function unpad(e){var r=e[15];if(r<1||r>16)throw new Error("unable to decrypt data");for(var t=-1;++t<r;)if(e[t+(16-r)]!==r)throw new Error("unable to decrypt data");if(16!==r)return e.slice(0,16-r)}function createDecipheriv(e,r,t){var i=MODES[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=Buffer.from(t)),"GCM"!==i.mode&&t.length!==i.iv)throw new TypeError("invalid iv length "+t.length);if("string"==typeof r&&(r=Buffer.from(r)),r.length!==i.key/8)throw new TypeError("invalid key length "+r.length);return"stream"===i.type?new StreamCipher(i.module,r,t,!0):"auth"===i.type?new AuthCipher(i.module,r,t,!0):new Decipher(i.module,r,t)}function createDecipher(e,r){var t=MODES[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var i=ebtk(r,!1,t.key,t.iv);return createDecipheriv(e,i.key,i.iv)}inherits(Decipher,Transform),Decipher.prototype._update=function(e){var r,t;this._cache.add(e);for(var i=[];r=this._cache.get(this._autopadding);)t=this._mode.decrypt(this,r),i.push(t);return Buffer.concat(i)},Decipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return unpad(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},Decipher.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},Splitter.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},Splitter.prototype.get=function(e){var r;if(e){if(this.cache.length>16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r}else if(this.cache.length>=16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r;return null},Splitter.prototype.flush=function(){if(this.cache.length)return this.cache},exports.createDecipher=createDecipher,exports.createDecipheriv=createDecipheriv; | |
},{"./aes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/aes.js","./authCipher":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/authCipher.js","./modes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/index.js","./streamCipher":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/streamCipher.js","cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","evp_bytestokey":"/Users/lentan/repo/torus/torus-embed/node_modules/evp_bytestokey/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/encrypter.js":[function(require,module,exports){ | |
var MODES=require("./modes"),AuthCipher=require("./authCipher"),Buffer=require("safe-buffer").Buffer,StreamCipher=require("./streamCipher"),Transform=require("cipher-base"),aes=require("./aes"),ebtk=require("evp_bytestokey"),inherits=require("inherits");function Cipher(e,r,t){Transform.call(this),this._cache=new Splitter,this._cipher=new aes.AES(r),this._prev=Buffer.from(t),this._mode=e,this._autopadding=!0}inherits(Cipher,Transform),Cipher.prototype._update=function(e){var r,t;this._cache.add(e);for(var i=[];r=this._cache.get();)t=this._mode.encrypt(this,r),i.push(t);return Buffer.concat(i)};var PADDING=Buffer.alloc(16,16);function Splitter(){this.cache=Buffer.allocUnsafe(0)}function createCipheriv(e,r,t){var i=MODES[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=Buffer.from(r)),r.length!==i.key/8)throw new TypeError("invalid key length "+r.length);if("string"==typeof t&&(t=Buffer.from(t)),"GCM"!==i.mode&&t.length!==i.iv)throw new TypeError("invalid iv length "+t.length);return"stream"===i.type?new StreamCipher(i.module,r,t):"auth"===i.type?new AuthCipher(i.module,r,t):new Cipher(i.module,r,t)}function createCipher(e,r){var t=MODES[e.toLowerCase()];if(!t)throw new TypeError("invalid suite type");var i=ebtk(r,!1,t.key,t.iv);return createCipheriv(e,i.key,i.iv)}Cipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(PADDING))throw this._cipher.scrub(),new Error("data not multiple of block length")},Cipher.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},Splitter.prototype.add=function(e){this.cache=Buffer.concat([this.cache,e])},Splitter.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},Splitter.prototype.flush=function(){for(var e=16-this.cache.length,r=Buffer.allocUnsafe(e),t=-1;++t<e;)r.writeUInt8(e,t);return Buffer.concat([this.cache,r])},exports.createCipheriv=createCipheriv,exports.createCipher=createCipher; | |
},{"./aes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/aes.js","./authCipher":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/authCipher.js","./modes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/index.js","./streamCipher":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/streamCipher.js","cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","evp_bytestokey":"/Users/lentan/repo/torus/torus-embed/node_modules/evp_bytestokey/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/ghash.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer,ZEROES=Buffer.alloc(16,0);function toArray(t){return[t.readUInt32BE(0),t.readUInt32BE(4),t.readUInt32BE(8),t.readUInt32BE(12)]}function fromArray(t){var r=Buffer.allocUnsafe(16);return r.writeUInt32BE(t[0]>>>0,0),r.writeUInt32BE(t[1]>>>0,4),r.writeUInt32BE(t[2]>>>0,8),r.writeUInt32BE(t[3]>>>0,12),r}function GHASH(t){this.h=t,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}GHASH.prototype.ghash=function(t){for(var r=-1;++r<t.length;)this.state[r]^=t[r];this._multiply()},GHASH.prototype._multiply=function(){for(var t,r,e=toArray(this.h),a=[0,0,0,0],h=-1;++h<128;){for(0!=(this.state[~~(h/8)]&1<<7-h%8)&&(a[0]^=e[0],a[1]^=e[1],a[2]^=e[2],a[3]^=e[3]),r=0!=(1&e[3]),t=3;t>0;t--)e[t]=e[t]>>>1|(1&e[t-1])<<31;e[0]=e[0]>>>1,r&&(e[0]=e[0]^225<<24)}this.state=fromArray(a)},GHASH.prototype.update=function(t){var r;for(this.cache=Buffer.concat([this.cache,t]);this.cache.length>=16;)r=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(r)},GHASH.prototype.final=function(t,r){return this.cache.length&&this.ghash(Buffer.concat([this.cache,ZEROES],16)),this.ghash(fromArray([0,t,0,r])),this.state},module.exports=GHASH; | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/incr32.js":[function(require,module,exports){ | |
function incr32(r){for(var n,t=r.length;t--;){if(255!==(n=r.readUInt8(t))){n++,r.writeUInt8(n,t);break}r.writeUInt8(0,t)}}module.exports=incr32; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cbc.js":[function(require,module,exports){ | |
var xor=require("buffer-xor");exports.encrypt=function(r,e){var p=xor(e,r._prev);return r._prev=r._cipher.encryptBlock(p),r._prev},exports.decrypt=function(r,e){var p=r._prev;r._prev=e;var c=r._cipher.decryptBlock(e);return xor(c,p)}; | |
},{"buffer-xor":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer,xor=require("buffer-xor");function encryptStart(e,r,c){var f=r.length,t=xor(r,e._cache);return e._cache=e._cache.slice(f),e._prev=Buffer.concat([e._prev,c?r:t]),t}exports.encrypt=function(e,r,c){for(var f,t=Buffer.allocUnsafe(0);r.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=Buffer.allocUnsafe(0)),!(e._cache.length<=r.length)){t=Buffer.concat([t,encryptStart(e,r,c)]);break}f=e._cache.length,t=Buffer.concat([t,encryptStart(e,r.slice(0,f),c)]),r=r.slice(f)}return t}; | |
},{"buffer-xor":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb1.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer;function encryptByte(r,e,f){for(var n,t,u=-1,c=0;++u<8;)n=e&1<<7-u?128:0,c+=(128&(t=r._cipher.encryptBlock(r._prev)[0]^n))>>u%8,r._prev=shiftIn(r._prev,f?n:t);return c}function shiftIn(r,e){var f=r.length,n=-1,t=Buffer.allocUnsafe(r.length);for(r=Buffer.concat([r,Buffer.from([e])]);++n<f;)t[n]=r[n]<<1|r[n+1]>>7;return t}exports.encrypt=function(r,e,f){for(var n=e.length,t=Buffer.allocUnsafe(n),u=-1;++u<n;)t[u]=encryptByte(r,e[u],f);return t}; | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb8.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer;function encryptByte(r,e,f){var n=r._cipher.encryptBlock(r._prev)[0]^e;return r._prev=Buffer.concat([r._prev.slice(1),Buffer.from([f?e:n])]),n}exports.encrypt=function(r,e,f){for(var n=e.length,t=Buffer.allocUnsafe(n),c=-1;++c<n;)t[c]=encryptByte(r,e[c],f);return t}; | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ctr.js":[function(require,module,exports){ | |
var xor=require("buffer-xor"),Buffer=require("safe-buffer").Buffer,incr32=require("../incr32");function getBlock(e){var c=e._cipher.encryptBlockRaw(e._prev);return incr32(e._prev),c}var blockSize=16;exports.encrypt=function(e,c){var r=Math.ceil(c.length/blockSize),a=e._cache.length;e._cache=Buffer.concat([e._cache,Buffer.allocUnsafe(r*blockSize)]);for(var t=0;t<r;t++){var n=getBlock(e),i=a+t*blockSize;e._cache.writeUInt32BE(n[0],i+0),e._cache.writeUInt32BE(n[1],i+4),e._cache.writeUInt32BE(n[2],i+8),e._cache.writeUInt32BE(n[3],i+12)}var f=e._cache.slice(0,c.length);return e._cache=e._cache.slice(c.length),xor(c,f)}; | |
},{"../incr32":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/incr32.js","buffer-xor":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ecb.js":[function(require,module,exports){ | |
exports.encrypt=function(r,c){return r._cipher.encryptBlock(c)},exports.decrypt=function(r,c){return r._cipher.decryptBlock(c)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/index.js":[function(require,module,exports){ | |
var modeModules={ECB:require("./ecb"),CBC:require("./cbc"),CFB:require("./cfb"),CFB8:require("./cfb8"),CFB1:require("./cfb1"),OFB:require("./ofb"),CTR:require("./ctr"),GCM:require("./ctr")},modes=require("./list.json");for(var key in modes)modes[key].module=modeModules[modes[key].mode];module.exports=modes; | |
},{"./cbc":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cbc.js","./cfb":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb.js","./cfb1":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb1.js","./cfb8":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/cfb8.js","./ctr":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ctr.js","./ecb":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ecb.js","./list.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/list.json","./ofb":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ofb.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/list.json":[function(require,module,exports){ | |
module.exports={ | |
"aes-128-ecb": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 0, | |
"mode": "ECB", | |
"type": "block" | |
}, | |
"aes-192-ecb": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 0, | |
"mode": "ECB", | |
"type": "block" | |
}, | |
"aes-256-ecb": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 0, | |
"mode": "ECB", | |
"type": "block" | |
}, | |
"aes-128-cbc": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes-192-cbc": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes-256-cbc": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes128": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes192": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes256": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CBC", | |
"type": "block" | |
}, | |
"aes-128-cfb": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CFB", | |
"type": "stream" | |
}, | |
"aes-192-cfb": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CFB", | |
"type": "stream" | |
}, | |
"aes-256-cfb": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CFB", | |
"type": "stream" | |
}, | |
"aes-128-cfb8": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CFB8", | |
"type": "stream" | |
}, | |
"aes-192-cfb8": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CFB8", | |
"type": "stream" | |
}, | |
"aes-256-cfb8": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CFB8", | |
"type": "stream" | |
}, | |
"aes-128-cfb1": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CFB1", | |
"type": "stream" | |
}, | |
"aes-192-cfb1": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CFB1", | |
"type": "stream" | |
}, | |
"aes-256-cfb1": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CFB1", | |
"type": "stream" | |
}, | |
"aes-128-ofb": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "OFB", | |
"type": "stream" | |
}, | |
"aes-192-ofb": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "OFB", | |
"type": "stream" | |
}, | |
"aes-256-ofb": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "OFB", | |
"type": "stream" | |
}, | |
"aes-128-ctr": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 16, | |
"mode": "CTR", | |
"type": "stream" | |
}, | |
"aes-192-ctr": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 16, | |
"mode": "CTR", | |
"type": "stream" | |
}, | |
"aes-256-ctr": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 16, | |
"mode": "CTR", | |
"type": "stream" | |
}, | |
"aes-128-gcm": { | |
"cipher": "AES", | |
"key": 128, | |
"iv": 12, | |
"mode": "GCM", | |
"type": "auth" | |
}, | |
"aes-192-gcm": { | |
"cipher": "AES", | |
"key": 192, | |
"iv": 12, | |
"mode": "GCM", | |
"type": "auth" | |
}, | |
"aes-256-gcm": { | |
"cipher": "AES", | |
"key": 256, | |
"iv": 12, | |
"mode": "GCM", | |
"type": "auth" | |
} | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/ofb.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var xor=require("buffer-xor");function getBlock(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}exports.encrypt=function(e,c){for(;e._cache.length<c.length;)e._cache=Buffer.concat([e._cache,getBlock(e)]);var r=e._cache.slice(0,c.length);return e._cache=e._cache.slice(c.length),xor(c,r)}; | |
}).call(this,require("buffer").Buffer) | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","buffer-xor":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/streamCipher.js":[function(require,module,exports){ | |
var aes=require("./aes"),Buffer=require("safe-buffer").Buffer,Transform=require("cipher-base"),inherits=require("inherits");function StreamCipher(e,r,i,t){Transform.call(this),this._cipher=new aes.AES(r),this._prev=Buffer.from(i),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=t,this._mode=e}inherits(StreamCipher,Transform),StreamCipher.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},StreamCipher.prototype._final=function(){this._cipher.scrub()},module.exports=StreamCipher; | |
},{"./aes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/aes.js","cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-cipher/browser.js":[function(require,module,exports){ | |
var DES=require("browserify-des"),aes=require("browserify-aes/browser"),aesModes=require("browserify-aes/modes"),desModes=require("browserify-des/modes"),ebtk=require("evp_bytestokey");function createCipher(e,r){var s,i;if(e=e.toLowerCase(),aesModes[e])s=aesModes[e].key,i=aesModes[e].iv;else{if(!desModes[e])throw new TypeError("invalid suite type");s=8*desModes[e].key,i=desModes[e].iv}var t=ebtk(r,!1,s,i);return createCipheriv(e,t.key,t.iv)}function createDecipher(e,r){var s,i;if(e=e.toLowerCase(),aesModes[e])s=aesModes[e].key,i=aesModes[e].iv;else{if(!desModes[e])throw new TypeError("invalid suite type");s=8*desModes[e].key,i=desModes[e].iv}var t=ebtk(r,!1,s,i);return createDecipheriv(e,t.key,t.iv)}function createCipheriv(e,r,s){if(e=e.toLowerCase(),aesModes[e])return aes.createCipheriv(e,r,s);if(desModes[e])return new DES({key:r,iv:s,mode:e});throw new TypeError("invalid suite type")}function createDecipheriv(e,r,s){if(e=e.toLowerCase(),aesModes[e])return aes.createDecipheriv(e,r,s);if(desModes[e])return new DES({key:r,iv:s,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function getCiphers(){return Object.keys(desModes).concat(aes.getCiphers())}exports.createCipher=exports.Cipher=createCipher,exports.createCipheriv=exports.Cipheriv=createCipheriv,exports.createDecipher=exports.Decipher=createDecipher,exports.createDecipheriv=exports.Decipheriv=createDecipheriv,exports.listCiphers=exports.getCiphers=getCiphers; | |
},{"browserify-aes/browser":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/browser.js","browserify-aes/modes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-aes/modes/index.js","browserify-des":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-des/index.js","browserify-des/modes":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-des/modes.js","evp_bytestokey":"/Users/lentan/repo/torus/torus-embed/node_modules/evp_bytestokey/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-des/index.js":[function(require,module,exports){ | |
var CipherBase=require("cipher-base"),des=require("des.js"),inherits=require("inherits"),Buffer=require("safe-buffer").Buffer,modes={"des-ede3-cbc":des.CBC.instantiate(des.EDE),"des-ede3":des.EDE,"des-ede-cbc":des.CBC.instantiate(des.EDE),"des-ede":des.EDE,"des-cbc":des.CBC.instantiate(des.DES),"des-ecb":des.DES};function DES(e){CipherBase.call(this);var s,r=e.mode.toLowerCase(),d=modes[r];s=e.decrypt?"decrypt":"encrypt";var t=e.key;Buffer.isBuffer(t)||(t=Buffer.from(t)),"des-ede"!==r&&"des-ede-cbc"!==r||(t=Buffer.concat([t,t.slice(0,8)]));var f=e.iv;Buffer.isBuffer(f)||(f=Buffer.from(f)),this._des=d.create({key:t,iv:f,type:s})}modes.des=modes["des-cbc"],modes.des3=modes["des-ede3-cbc"],module.exports=DES,inherits(DES,CipherBase),DES.prototype._update=function(e){return Buffer.from(this._des.update(e))},DES.prototype._final=function(){return Buffer.from(this._des.final())}; | |
},{"cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","des.js":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-des/modes.js":[function(require,module,exports){ | |
exports["des-ecb"]={key:8,iv:0},exports["des-cbc"]=exports.des={key:8,iv:8},exports["des-ede3-cbc"]=exports.des3={key:24,iv:8},exports["des-ede3"]={key:24,iv:0},exports["des-ede-cbc"]={key:16,iv:8},exports["des-ede"]={key:16,iv:0}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-rsa/index.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var bn=require("bn.js"),randomBytes=require("randombytes");function blind(e){var n=getr(e);return{blinder:n.toRed(bn.mont(e.modulus)).redPow(new bn(e.publicExponent)).fromRed(),unblinder:n.invm(e.modulus)}}function crt(e,n){var r=blind(n),o=n.modulus.byteLength(),u=(bn.mont(n.modulus),new bn(e).mul(r.blinder).umod(n.modulus)),m=u.toRed(bn.mont(n.prime1)),d=u.toRed(bn.mont(n.prime2)),t=n.coefficient,i=n.prime1,b=n.prime2,l=m.redPow(n.exponent1),s=d.redPow(n.exponent2);l=l.fromRed(),s=s.fromRed();var p=l.isub(s).imul(t).umod(i);return p.imul(b),s.iadd(p),new Buffer(s.imul(r.unblinder).umod(n.modulus).toArray(!1,o))}function getr(e){for(var n=e.modulus.byteLength(),r=new bn(randomBytes(n));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new bn(randomBytes(n));return r}module.exports=crt,crt.getr=getr; | |
}).call(this,require("buffer").Buffer) | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","randombytes":"/Users/lentan/repo/torus/torus-embed/node_modules/randombytes/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/algos.js":[function(require,module,exports){ | |
module.exports=require("./browser/algorithms.json"); | |
},{"./browser/algorithms.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/algorithms.json"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/algorithms.json":[function(require,module,exports){ | |
module.exports={ | |
"sha224WithRSAEncryption": { | |
"sign": "rsa", | |
"hash": "sha224", | |
"id": "302d300d06096086480165030402040500041c" | |
}, | |
"RSA-SHA224": { | |
"sign": "ecdsa/rsa", | |
"hash": "sha224", | |
"id": "302d300d06096086480165030402040500041c" | |
}, | |
"sha256WithRSAEncryption": { | |
"sign": "rsa", | |
"hash": "sha256", | |
"id": "3031300d060960864801650304020105000420" | |
}, | |
"RSA-SHA256": { | |
"sign": "ecdsa/rsa", | |
"hash": "sha256", | |
"id": "3031300d060960864801650304020105000420" | |
}, | |
"sha384WithRSAEncryption": { | |
"sign": "rsa", | |
"hash": "sha384", | |
"id": "3041300d060960864801650304020205000430" | |
}, | |
"RSA-SHA384": { | |
"sign": "ecdsa/rsa", | |
"hash": "sha384", | |
"id": "3041300d060960864801650304020205000430" | |
}, | |
"sha512WithRSAEncryption": { | |
"sign": "rsa", | |
"hash": "sha512", | |
"id": "3051300d060960864801650304020305000440" | |
}, | |
"RSA-SHA512": { | |
"sign": "ecdsa/rsa", | |
"hash": "sha512", | |
"id": "3051300d060960864801650304020305000440" | |
}, | |
"RSA-SHA1": { | |
"sign": "rsa", | |
"hash": "sha1", | |
"id": "3021300906052b0e03021a05000414" | |
}, | |
"ecdsa-with-SHA1": { | |
"sign": "ecdsa", | |
"hash": "sha1", | |
"id": "" | |
}, | |
"sha256": { | |
"sign": "ecdsa", | |
"hash": "sha256", | |
"id": "" | |
}, | |
"sha224": { | |
"sign": "ecdsa", | |
"hash": "sha224", | |
"id": "" | |
}, | |
"sha384": { | |
"sign": "ecdsa", | |
"hash": "sha384", | |
"id": "" | |
}, | |
"sha512": { | |
"sign": "ecdsa", | |
"hash": "sha512", | |
"id": "" | |
}, | |
"DSA-SHA": { | |
"sign": "dsa", | |
"hash": "sha1", | |
"id": "" | |
}, | |
"DSA-SHA1": { | |
"sign": "dsa", | |
"hash": "sha1", | |
"id": "" | |
}, | |
"DSA": { | |
"sign": "dsa", | |
"hash": "sha1", | |
"id": "" | |
}, | |
"DSA-WITH-SHA224": { | |
"sign": "dsa", | |
"hash": "sha224", | |
"id": "" | |
}, | |
"DSA-SHA224": { | |
"sign": "dsa", | |
"hash": "sha224", | |
"id": "" | |
}, | |
"DSA-WITH-SHA256": { | |
"sign": "dsa", | |
"hash": "sha256", | |
"id": "" | |
}, | |
"DSA-SHA256": { | |
"sign": "dsa", | |
"hash": "sha256", | |
"id": "" | |
}, | |
"DSA-WITH-SHA384": { | |
"sign": "dsa", | |
"hash": "sha384", | |
"id": "" | |
}, | |
"DSA-SHA384": { | |
"sign": "dsa", | |
"hash": "sha384", | |
"id": "" | |
}, | |
"DSA-WITH-SHA512": { | |
"sign": "dsa", | |
"hash": "sha512", | |
"id": "" | |
}, | |
"DSA-SHA512": { | |
"sign": "dsa", | |
"hash": "sha512", | |
"id": "" | |
}, | |
"DSA-RIPEMD160": { | |
"sign": "dsa", | |
"hash": "rmd160", | |
"id": "" | |
}, | |
"ripemd160WithRSA": { | |
"sign": "rsa", | |
"hash": "rmd160", | |
"id": "3021300906052b2403020105000414" | |
}, | |
"RSA-RIPEMD160": { | |
"sign": "rsa", | |
"hash": "rmd160", | |
"id": "3021300906052b2403020105000414" | |
}, | |
"md5WithRSAEncryption": { | |
"sign": "rsa", | |
"hash": "md5", | |
"id": "3020300c06082a864886f70d020505000410" | |
}, | |
"RSA-MD5": { | |
"sign": "rsa", | |
"hash": "md5", | |
"id": "3020300c06082a864886f70d020505000410" | |
} | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/curves.json":[function(require,module,exports){ | |
module.exports={ | |
"1.3.132.0.10": "secp256k1", | |
"1.3.132.0.33": "p224", | |
"1.2.840.10045.3.1.1": "p192", | |
"1.2.840.10045.3.1.7": "p256", | |
"1.3.132.0.34": "p384", | |
"1.3.132.0.35": "p521" | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/index.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var createHash=require("create-hash"),stream=require("stream"),inherits=require("inherits"),sign=require("./sign"),verify=require("./verify"),algorithms=require("./algorithms.json");function Sign(e){stream.Writable.call(this);var t=algorithms[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=createHash(t.hash),this._tag=t.id,this._signType=t.sign}function Verify(e){stream.Writable.call(this);var t=algorithms[e];if(!t)throw new Error("Unknown message digest");this._hash=createHash(t.hash),this._tag=t.id,this._signType=t.sign}function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}Object.keys(algorithms).forEach(function(e){algorithms[e].id=new Buffer(algorithms[e].id,"hex"),algorithms[e.toLowerCase()]=algorithms[e]}),inherits(Sign,stream.Writable),Sign.prototype._write=function _write(e,t,i){this._hash.update(e),i()},Sign.prototype.update=function update(e,t){return"string"==typeof e&&(e=new Buffer(e,t)),this._hash.update(e),this},Sign.prototype.sign=function signMethod(e,t){this.end();var i=this._hash.digest(),r=sign(i,e,this._hashType,this._signType,this._tag);return t?r.toString(t):r},inherits(Verify,stream.Writable),Verify.prototype._write=function _write(e,t,i){this._hash.update(e),i()},Verify.prototype.update=function update(e,t){return"string"==typeof e&&(e=new Buffer(e,t)),this._hash.update(e),this},Verify.prototype.verify=function verifyMethod(e,t,i){"string"==typeof t&&(t=new Buffer(t,i)),this.end();var r=this._hash.digest();return verify(t,r,e,this._signType,this._tag)},module.exports={Sign:createSign,Verify:createVerify,createSign:createSign,createVerify:createVerify}; | |
}).call(this,require("buffer").Buffer) | |
},{"./algorithms.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/algorithms.json","./sign":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/sign.js","./verify":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/verify.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","create-hash":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hash/browser.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","stream":"/Users/lentan/repo/torus/torus-embed/node_modules/stream-browserify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/sign.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var createHmac=require("create-hmac"),crt=require("browserify-rsa"),EC=require("elliptic").ec,BN=require("bn.js"),parseKeys=require("parse-asn1"),curves=require("./curves.json");function sign(e,r,t,n,a){var u=parseKeys(r);if(u.curve){if("ecdsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");return ecSign(e,u)}if("dsa"===u.type){if("dsa"!==n)throw new Error("wrong private key type");return dsaSign(e,u,t)}if("rsa"!==n&&"ecdsa/rsa"!==n)throw new Error("wrong private key type");e=Buffer.concat([a,e]);for(var i=u.modulus.byteLength(),o=[0,1];e.length+o.length+1<i;)o.push(255);o.push(0);for(var c=-1;++c<e.length;)o.push(e[c]);return crt(o,u)}function ecSign(e,r){var t=curves[r.curve.join(".")];if(!t)throw new Error("unknown curve "+r.curve.join("."));var n=new EC(t).keyFromPrivate(r.privateKey).sign(e);return new Buffer(n.toDER())}function dsaSign(e,r,t){for(var n,a=r.params.priv_key,u=r.params.p,i=r.params.q,o=r.params.g,c=new BN(0),f=bits2int(e,i).mod(i),s=!1,g=getKey(a,i,e,t);!1===s;)c=makeR(o,n=makeKey(i,g,t),u,i),0===(s=n.invm(i).imul(f.add(a.mul(c))).mod(i)).cmpn(0)&&(s=!1,c=new BN(0));return toDER(c,s)}function toDER(e,r){e=e.toArray(),r=r.toArray(),128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r));var t=[48,e.length+r.length+4,2,e.length];return t=t.concat(e,[2,r.length],r),new Buffer(t)}function getKey(e,r,t,n){if((e=new Buffer(e.toArray())).length<r.byteLength()){var a=new Buffer(r.byteLength()-e.length);a.fill(0),e=Buffer.concat([a,e])}var u=t.length,i=bits2octets(t,r),o=new Buffer(u);o.fill(1);var c=new Buffer(u);return c.fill(0),c=createHmac(n,c).update(o).update(new Buffer([0])).update(e).update(i).digest(),o=createHmac(n,c).update(o).digest(),{k:c=createHmac(n,c).update(o).update(new Buffer([1])).update(e).update(i).digest(),v:o=createHmac(n,c).update(o).digest()}}function bits2int(e,r){var t=new BN(e),n=(e.length<<3)-r.bitLength();return n>0&&t.ishrn(n),t}function bits2octets(e,r){e=(e=bits2int(e,r)).mod(r);var t=new Buffer(e.toArray());if(t.length<r.byteLength()){var n=new Buffer(r.byteLength()-t.length);n.fill(0),t=Buffer.concat([n,t])}return t}function makeKey(e,r,t){var n,a;do{for(n=new Buffer(0);8*n.length<e.bitLength();)r.v=createHmac(t,r.k).update(r.v).digest(),n=Buffer.concat([n,r.v]);a=bits2int(n,e),r.k=createHmac(t,r.k).update(r.v).update(new Buffer([0])).digest(),r.v=createHmac(t,r.k).update(r.v).digest()}while(-1!==a.cmp(e));return a}function makeR(e,r,t,n){return e.toRed(BN.mont(t)).redPow(r).fromRed().mod(n)}module.exports=sign,module.exports.getKey=getKey,module.exports.makeKey=makeKey; | |
}).call(this,require("buffer").Buffer) | |
},{"./curves.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/curves.json","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","browserify-rsa":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-rsa/index.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","create-hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hmac/browser.js","elliptic":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic.js","parse-asn1":"/Users/lentan/repo/torus/torus-embed/node_modules/parse-asn1/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/verify.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var BN=require("bn.js"),EC=require("elliptic").ec,parseKeys=require("parse-asn1"),curves=require("./curves.json");function verify(e,r,n,a,t){var o=parseKeys(n);if("ec"===o.type){if("ecdsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong public key type");return ecVerify(e,r,o)}if("dsa"===o.type){if("dsa"!==a)throw new Error("wrong public key type");return dsaVerify(e,r,o)}if("rsa"!==a&&"ecdsa/rsa"!==a)throw new Error("wrong public key type");r=Buffer.concat([t,r]);for(var u=o.modulus.byteLength(),i=[1],d=0;r.length+i.length+2<u;)i.push(255),d++;i.push(0);for(var c=-1;++c<r.length;)i.push(r[c]);i=new Buffer(i);var s=BN.mont(o.modulus);e=(e=new BN(e).toRed(s)).redPow(new BN(o.publicExponent)),e=new Buffer(e.fromRed().toArray());var f=d<8?1:0;for(u=Math.min(e.length,i.length),e.length!==i.length&&(f=1),c=-1;++c<u;)f|=e[c]^i[c];return 0===f}function ecVerify(e,r,n){var a=curves[n.data.algorithm.curve.join(".")];if(!a)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var t=new EC(a),o=n.data.subjectPrivateKey.data;return t.verify(r,e,o)}function dsaVerify(e,r,n){var a=n.data.p,t=n.data.q,o=n.data.g,u=n.data.pub_key,i=parseKeys.signature.decode(e,"der"),d=i.s,c=i.r;checkValue(d,t),checkValue(c,t);var s=BN.mont(a),f=d.invm(t);return 0===o.toRed(s).redPow(new BN(r).mul(f).mod(t)).fromRed().mul(u.toRed(s).redPow(c.mul(f).mod(t)).fromRed()).mod(a).mod(t).cmp(c)}function checkValue(e,r){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(r)>=r)throw new Error("invalid sig")}module.exports=verify; | |
}).call(this,require("buffer").Buffer) | |
},{"./curves.json":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/curves.json","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","elliptic":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic.js","parse-asn1":"/Users/lentan/repo/torus/torus-embed/node_modules/parse-asn1/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js":[function(require,module,exports){ | |
var objectCreate=Object.create||objectCreatePolyfill,objectKeys=Object.keys||objectKeysPolyfill,bind=Function.prototype.bind||functionBindPolyfill;function EventEmitter(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=objectCreate(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0;var hasDefineProperty,defaultMaxListeners=10;try{var o={};Object.defineProperty&&Object.defineProperty(o,"x",{value:0}),hasDefineProperty=0===o.x}catch(e){hasDefineProperty=!1}function $getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function emitNone(e,t,n){if(t)e.call(n);else for(var r=e.length,i=arrayClone(e,r),s=0;s<r;++s)i[s].call(n)}function emitOne(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,s=arrayClone(e,i),o=0;o<i;++o)s[o].call(n,r)}function emitTwo(e,t,n,r,i){if(t)e.call(n,r,i);else for(var s=e.length,o=arrayClone(e,s),a=0;a<s;++a)o[a].call(n,r,i)}function emitThree(e,t,n,r,i,s){if(t)e.call(n,r,i,s);else for(var o=e.length,a=arrayClone(e,o),l=0;l<o;++l)a[l].call(n,r,i,s)}function emitMany(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,s=arrayClone(e,i),o=0;o<i;++o)s[o].apply(n,r)}function _addListener(e,t,n,r){var i,s,o;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((s=e._events)?(s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]):(s=e._events=objectCreate(null),e._eventsCount=0),o){if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),!o.warned&&(i=$getMaxListeners(e))&&i>0&&o.length>i){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",a.name,a.message)}}else o=s[t]=n,++e._eventsCount;return e}function onceWrapper(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function _onceWrap(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=bind.call(onceWrapper,r);return i.listener=n,r.wrapFn=i,i}function _listeners(e,t,n){var r=e._events;if(!r)return[];var i=r[t];return i?"function"==typeof i?n?[i.listener||i]:[i]:n?unwrapListeners(i):arrayClone(i,i.length):[]}function listenerCount(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}function arrayClone(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function objectCreatePolyfill(e){var t=function(){};return t.prototype=e,new t}function objectKeysPolyfill(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n}function functionBindPolyfill(e){var t=this;return function(){return t.apply(e,arguments)}}hasDefineProperty?Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');defaultMaxListeners=e}}):EventEmitter.defaultMaxListeners=defaultMaxListeners,EventEmitter.prototype.setMaxListeners=function setMaxListeners(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return $getMaxListeners(this)},EventEmitter.prototype.emit=function emit(e){var t,n,r,i,s,o,a="error"===e;if(o=this._events)a=a&&null==o.error;else if(!a)return!1;if(a){if(arguments.length>1&&(t=arguments[1]),t instanceof Error)throw t;var l=new Error('Unhandled "error" event. ('+t+")");throw l.context=t,l}if(!(n=o[e]))return!1;var u="function"==typeof n;switch(r=arguments.length){case 1:emitNone(n,u,this);break;case 2:emitOne(n,u,this,arguments[1]);break;case 3:emitTwo(n,u,this,arguments[1],arguments[2]);break;case 4:emitThree(n,u,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),s=1;s<r;s++)i[s-1]=arguments[s];emitMany(n,u,this,i)}return!0},EventEmitter.prototype.addListener=function addListener(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function once(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function removeListener(e,t){var n,r,i,s,o;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=objectCreate(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():spliceOne(n,i),1===n.length&&(r[e]=n[0]),r.removeListener&&this.emit("removeListener",e,o||t)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,n,r;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=objectCreate(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=objectCreate(null):delete n[e]),this;if(0===arguments.length){var i,s=objectKeys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=objectCreate(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function listeners(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function rawListeners(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ | |
var cachedSetTimeout,cachedClearTimeout,process=module.exports={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}function runClearTimeout(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{return cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/util/node_modules/inherits/inherits_browser.js":[function(require,module,exports){ | |
"function"==typeof Object.create?module.exports=function inherits(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:module.exports=function inherits(t,e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/util/support/isBufferBrowser.js":[function(require,module,exports){ | |
module.exports=function isBuffer(o){return o&&"object"==typeof o&&"function"==typeof o.copy&&"function"==typeof o.fill&&"function"==typeof o.readUInt8}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/util/util.js":[function(require,module,exports){ | |
(function (process,global){ | |
var formatRegExp=/%[sdj%]/g;exports.format=function(e){if(!isString(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(inspect(arguments[t]));return r.join(" ")}t=1;for(var n=arguments,i=n.length,o=String(e).replace(formatRegExp,function(e){if("%%"===e)return"%";if(t>=i)return e;switch(e){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch(e){return"[Circular]"}default:return e}}),s=n[t];t<i;s=n[++t])isNull(s)||!isObject(s)?o+=" "+s:o+=" "+inspect(s);return o},exports.deprecate=function(e,r){if(isUndefined(global.process))return function(){return exports.deprecate(e,r).apply(this,arguments)};if(!0===process.noDeprecation)return e;var t=!1;return function deprecated(){if(!t){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}};var debugEnviron,debugs={};function inspect(e,r){var t={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),isBoolean(r)?t.showHidden=r:r&&exports._extend(t,r),isUndefined(t.showHidden)&&(t.showHidden=!1),isUndefined(t.depth)&&(t.depth=2),isUndefined(t.colors)&&(t.colors=!1),isUndefined(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=stylizeWithColor),formatValue(t,e,t.depth)}function stylizeWithColor(e,r){var t=inspect.styles[r];return t?"["+inspect.colors[t][0]+"m"+e+"["+inspect.colors[t][1]+"m":e}function stylizeNoColor(e,r){return e}function arrayToHash(e){var r={};return e.forEach(function(e,t){r[e]=!0}),r}function formatValue(e,r,t){if(e.customInspect&&r&&isFunction(r.inspect)&&r.inspect!==exports.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(t,e);return isString(n)||(n=formatValue(e,n,t)),n}var i=formatPrimitive(e,r);if(i)return i;var o=Object.keys(r),s=arrayToHash(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),isError(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(r);if(0===o.length){if(isFunction(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(isRegExp(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(isDate(r))return e.stylize(Date.prototype.toString.call(r),"date");if(isError(r))return formatError(r)}var c,a="",l=!1,p=["{","}"];(isArray(r)&&(l=!0,p=["[","]"]),isFunction(r))&&(a=" [Function"+(r.name?": "+r.name:"")+"]");return isRegExp(r)&&(a=" "+RegExp.prototype.toString.call(r)),isDate(r)&&(a=" "+Date.prototype.toUTCString.call(r)),isError(r)&&(a=" "+formatError(r)),0!==o.length||l&&0!=r.length?t<0?isRegExp(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=l?formatArray(e,r,t,s,o):o.map(function(n){return formatProperty(e,r,t,s,n,l)}),e.seen.pop(),reduceToSingleString(c,a,p)):p[0]+a+p[1]}function formatPrimitive(e,r){if(isUndefined(r))return e.stylize("undefined","undefined");if(isString(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return isNumber(r)?e.stylize(""+r,"number"):isBoolean(r)?e.stylize(""+r,"boolean"):isNull(r)?e.stylize("null","null"):void 0}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(e,r,t,n,i){for(var o=[],s=0,u=r.length;s<u;++s)hasOwnProperty(r,String(s))?o.push(formatProperty(e,r,t,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(formatProperty(e,r,t,n,i,!0))}),o}function formatProperty(e,r,t,n,i,o){var s,u,c;if((c=Object.getOwnPropertyDescriptor(r,i)||{value:r[i]}).get?u=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(u=e.stylize("[Setter]","special")),hasOwnProperty(n,i)||(s="["+i+"]"),u||(e.seen.indexOf(c.value)<0?(u=isNull(t)?formatValue(e,c.value,null):formatValue(e,c.value,t-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+u.split("\n").map(function(e){return" "+e}).join("\n")):u=e.stylize("[Circular]","special")),isUndefined(s)){if(o&&i.match(/^\d+$/))return u;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+u}function reduceToSingleString(e,r,t){return e.reduce(function(e,r){return 0,r.indexOf("\n")>=0&&0,e+r.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?t[0]+(""===r?"":r+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function isArray(e){return Array.isArray(e)}function isBoolean(e){return"boolean"==typeof e}function isNull(e){return null===e}function isNullOrUndefined(e){return null==e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function isSymbol(e){return"symbol"==typeof e}function isUndefined(e){return void 0===e}function isRegExp(e){return isObject(e)&&"[object RegExp]"===objectToString(e)}function isObject(e){return"object"==typeof e&&null!==e}function isDate(e){return isObject(e)&&"[object Date]"===objectToString(e)}function isError(e){return isObject(e)&&("[object Error]"===objectToString(e)||e instanceof Error)}function isFunction(e){return"function"==typeof e}function isPrimitive(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function objectToString(e){return Object.prototype.toString.call(e)}function pad(e){return e<10?"0"+e.toString(10):e.toString(10)}exports.debuglog=function(e){if(isUndefined(debugEnviron)&&(debugEnviron=process.env.NODE_DEBUG||""),e=e.toUpperCase(),!debugs[e])if(new RegExp("\\b"+e+"\\b","i").test(debugEnviron)){var r=process.pid;debugs[e]=function(){var t=exports.format.apply(exports,arguments);console.error("%s %d: %s",e,r,t)}}else debugs[e]=function(){};return debugs[e]},exports.inspect=inspect,inspect.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]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=require("./support/isBuffer");var months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function timestamp(){var e=new Date,r=[pad(e.getHours()),pad(e.getMinutes()),pad(e.getSeconds())].join(":");return[e.getDate(),months[e.getMonth()],r].join(" ")}function hasOwnProperty(e,r){return Object.prototype.hasOwnProperty.call(e,r)}exports.log=function(){console.log("%s - %s",timestamp(),exports.format.apply(exports,arguments))},exports.inherits=require("inherits"),exports._extend=function(e,r){if(!r||!isObject(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}; | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"./support/isBuffer":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/util/support/isBufferBrowser.js","_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/util/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/buffer-xor/index.js":[function(require,module,exports){ | |
(function (Buffer){ | |
module.exports=function xor(e,n){for(var r=Math.min(e.length,n.length),t=new Buffer(r),o=0;o<r;++o)t[o]=e[o]^n[o];return t}; | |
}).call(this,require("buffer").Buffer) | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js":[function(require,module,exports){ | |
(function (Buffer){ | |
"use strict";var base64=require("base64-js"),ieee754=require("ieee754"),customInspectSymbol="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;exports.Buffer=Buffer,exports.SlowBuffer=SlowBuffer,exports.INSPECT_MAX_BYTES=50;var K_MAX_LENGTH=2147483647;function typedArraySupport(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function createBuffer(e){if(e>K_MAX_LENGTH)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(e)}return from(e,t,r)}function from(e,t,r){if("string"==typeof e)return fromString(e,t);if(ArrayBuffer.isView(e))return fromArrayLike(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(isInstance(e,ArrayBuffer)||e&&isInstance(e.buffer,ArrayBuffer))return fromArrayBuffer(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return Buffer.from(n,t,r);var f=fromObject(e);if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return Buffer.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function assertSize(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function alloc(e,t,r){return assertSize(e),e<=0?createBuffer(e):void 0!==t?"string"==typeof r?createBuffer(e).fill(t,r):createBuffer(e).fill(t):createBuffer(e)}function allocUnsafe(e){return assertSize(e),createBuffer(e<0?0:0|checked(e))}function fromString(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!Buffer.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|byteLength(e,t),n=createBuffer(r),f=n.write(e,t);return f!==r&&(n=n.slice(0,f)),n}function fromArrayLike(e){for(var t=e.length<0?0:0|checked(e.length),r=createBuffer(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function fromArrayBuffer(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,Buffer.prototype),n}function fromObject(e){if(Buffer.isBuffer(e)){var t=0|checked(e.length),r=createBuffer(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}return void 0!==e.length?"number"!=typeof e.length||numberIsNaN(e.length)?createBuffer(0):fromArrayLike(e):"Buffer"===e.type&&Array.isArray(e.data)?fromArrayLike(e.data):void 0}function checked(e){if(e>=K_MAX_LENGTH)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+K_MAX_LENGTH.toString(16)+" bytes");return 0|e}function SlowBuffer(e){return+e!=e&&(e=0),Buffer.alloc(+e)}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||isInstance(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var f=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(f)return n?-1:utf8ToBytes(e).length;t=(""+t).toLowerCase(),f=!0}}function slowToString(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function bidirectionalIndexOf(e,t,r,n,f){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),numberIsNaN(r=+r)&&(r=f?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(f)return-1;r=e.length-1}else if(r<0){if(!f)return-1;r=0}if("string"==typeof t&&(t=Buffer.from(t,n)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,r,n,f);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?f?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):arrayIndexOf(e,[t],r,n,f);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,f){var i,o=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,u/=2,s/=2,r/=2}function read(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(f){var a=-1;for(i=r;i<u;i++)if(read(e,i)===read(t,-1===a?0:i-a)){if(-1===a&&(a=i),i-a+1===s)return a*o}else-1!==a&&(i-=i-a),a=-1}else for(r+s>u&&(r=u-s),i=r;i>=0;i--){for(var h=!0,c=0;c<s;c++)if(read(e,i+c)!==read(t,c)){h=!1;break}if(h)return i}return-1}function hexWrite(e,t,r,n){r=Number(r)||0;var f=e.length-r;n?(n=Number(n))>f&&(n=f):n=f;var i=t.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var u=parseInt(t.substr(2*o,2),16);if(numberIsNaN(u))return o;e[r+o]=u}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}function base64Slice(e,t,r){return 0===t&&r===e.length?base64.fromByteArray(e):base64.fromByteArray(e.slice(t,r))}function utf8Slice(e,t,r){r=Math.min(e.length,r);for(var n=[],f=t;f<r;){var i,o,u,s,a=e[f],h=null,c=a>239?4:a>223?3:a>191?2:1;if(f+c<=r)switch(c){case 1:a<128&&(h=a);break;case 2:128==(192&(i=e[f+1]))&&(s=(31&a)<<6|63&i)>127&&(h=s);break;case 3:i=e[f+1],o=e[f+2],128==(192&i)&&128==(192&o)&&(s=(15&a)<<12|(63&i)<<6|63&o)>2047&&(s<55296||s>57343)&&(h=s);break;case 4:i=e[f+1],o=e[f+2],u=e[f+3],128==(192&i)&&128==(192&o)&&128==(192&u)&&(s=(15&a)<<18|(63&i)<<12|(63&o)<<6|63&u)>65535&&s<1114112&&(h=s)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),f+=c}return decodeCodePointsArray(n)}exports.kMaxLength=K_MAX_LENGTH,Buffer.TYPED_ARRAY_SUPPORT=typedArraySupport(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(Buffer.prototype,"parent",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.buffer}}),Object.defineProperty(Buffer.prototype,"offset",{enumerable:!0,get:function(){if(Buffer.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(e,t,r){return from(e,t,r)},Object.setPrototypeOf(Buffer.prototype,Uint8Array.prototype),Object.setPrototypeOf(Buffer,Uint8Array),Buffer.alloc=function(e,t,r){return alloc(e,t,r)},Buffer.allocUnsafe=function(e){return allocUnsafe(e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(e)},Buffer.isBuffer=function isBuffer(e){return null!=e&&!0===e._isBuffer&&e!==Buffer.prototype},Buffer.compare=function compare(e,t){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),isInstance(t,Uint8Array)&&(t=Buffer.from(t,t.offset,t.byteLength)),!Buffer.isBuffer(e)||!Buffer.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,f=0,i=Math.min(r,n);f<i;++f)if(e[f]!==t[f]){r=e[f],n=t[f];break}return r<n?-1:n<r?1:0},Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function concat(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Buffer.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Buffer.allocUnsafe(t),f=0;for(r=0;r<e.length;++r){var i=e[r];if(isInstance(i,Uint8Array)&&(i=Buffer.from(i)),!Buffer.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,f),f+=i.length}return n},Buffer.byteLength=byteLength,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)swap(this,t,t+1);return this},Buffer.prototype.swap32=function swap32(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)swap(this,t,t+3),swap(this,t+1,t+2);return this},Buffer.prototype.swap64=function swap64(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)swap(this,t,t+7),swap(this,t+1,t+6),swap(this,t+2,t+5),swap(this,t+3,t+4);return this},Buffer.prototype.toString=function toString(){var e=this.length;return 0===e?"":0===arguments.length?utf8Slice(this,0,e):slowToString.apply(this,arguments)},Buffer.prototype.toLocaleString=Buffer.prototype.toString,Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Buffer.compare(this,e)},Buffer.prototype.inspect=function inspect(){var e="",t=exports.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},customInspectSymbol&&(Buffer.prototype[customInspectSymbol]=Buffer.prototype.inspect),Buffer.prototype.compare=function compare(e,t,r,n,f){if(isInstance(e,Uint8Array)&&(e=Buffer.from(e,e.offset,e.byteLength)),!Buffer.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===f&&(f=this.length),t<0||r>e.length||n<0||f>this.length)throw new RangeError("out of range index");if(n>=f&&t>=r)return 0;if(n>=f)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(f>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),u=Math.min(i,o),s=this.slice(n,f),a=e.slice(t,r),h=0;h<u;++h)if(s[h]!==a[h]){i=s[h],o=a[h];break}return i<o?-1:o<i?1:0},Buffer.prototype.includes=function includes(e,t,r){return-1!==this.indexOf(e,t,r)},Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!0)},Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,!1)},Buffer.prototype.write=function write(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH));return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(127&e[f]);return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var f=t;f<r;++f)n+=String.fromCharCode(e[f]);return n}function hexSlice(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var f="",i=t;i<r;++i)f+=hexSliceLookupTable[e[i]];return f}function utf16leSlice(e,t,r){for(var n=e.slice(t,r),f="",i=0;i<n.length;i+=2)f+=String.fromCharCode(n[i]+256*n[i+1]);return f}function checkOffset(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,r,n,f,i){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>f||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function checkIEEE754(e,t,r,n,f,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38),ieee754.write(e,t,r,n,23,4),r+4}function writeDouble(e,t,r,n,f){return t=+t,r>>>=0,f||checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308),ieee754.write(e,t,r,n,52,8),r+8}Buffer.prototype.slice=function slice(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,Buffer.prototype),n},Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n},Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e+--t],f=1;t>0&&(f*=256);)n+=this[e+--t]*f;return n},Buffer.prototype.readUInt8=function readUInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){return e>>>=0,t||checkOffset(e,2,this.length),this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=this[e],f=1,i=0;++i<t&&(f*=256);)n+=this[e+i]*f;return n>=(f*=128)&&(n-=Math.pow(2,8*t)),n},Buffer.prototype.readIntBE=function readIntBE(e,t,r){e>>>=0,t>>>=0,r||checkOffset(e,t,this.length);for(var n=t,f=1,i=this[e+--n];n>0&&(f*=256);)i+=this[e+--n]*f;return i>=(f*=128)&&(i-=Math.pow(2,8*t)),i},Buffer.prototype.readInt8=function readInt8(e,t){return e>>>=0,t||checkOffset(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Buffer.prototype.readInt16LE=function readInt16LE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt16BE=function readInt16BE(e,t){e>>>=0,t||checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Buffer.prototype.readInt32LE=function readInt32LE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!0,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){return e>>>=0,t||checkOffset(e,4,this.length),ieee754.read(this,e,!1,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!0,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){return e>>>=0,t||checkOffset(e,8,this.length),ieee754.read(this,e,!1,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=1,i=0;for(this[t]=255&e;++i<r&&(f*=256);)this[t+i]=e/f&255;return t+r},Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){(e=+e,t>>>=0,r>>>=0,n)||checkInt(this,e,t,r,Math.pow(2,8*r)-1,0);var f=r-1,i=1;for(this[t+f]=255&e;--f>=0&&(i*=256);)this[t+f]=e/i&255;return t+r},Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,255,0),this[t]=255&e,t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=0,o=1,u=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===u&&0!==this[t+i-1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){if(e=+e,t>>>=0,!n){var f=Math.pow(2,8*r-1);checkInt(this,e,t,r,f-1,-f)}var i=r-1,o=1,u=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===u&&0!==this[t+i+1]&&(u=1),this[t+i]=(e/o>>0)-u&255;return t+r},Buffer.prototype.writeInt8=function writeInt8(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){return e=+e,t>>>=0,r||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,!0,r)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,!1,r)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,!0,r)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,!1,r)},Buffer.prototype.copy=function copy(e,t,r,n){if(!Buffer.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var f=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var i=f-1;i>=0;--i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return f},Buffer.prototype.fill=function fill(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Buffer.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var f=e.charCodeAt(0);("utf8"===n&&f<128||"latin1"===n)&&(e=f)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var o=Buffer.isBuffer(e)?e:Buffer.from(e,n),u=o.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%u]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){if((e=(e=e.split("=")[0]).trim().replace(INVALID_BASE64_RE,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function utf8ToBytes(e,t){var r;t=t||1/0;for(var n=e.length,f=null,i=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!f){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&i.push(239,191,189);continue}f=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),f=r;continue}r=65536+(f-55296<<10|r-56320)}else f&&(t-=3)>-1&&i.push(239,191,189);if(f=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function asciiToBytes(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function utf16leToBytes(e,t){for(var r,n,f,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,f=r%256,i.push(f),i.push(n);return i}function base64ToBytes(e){return base64.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var f=0;f<n&&!(f+r>=t.length||f>=e.length);++f)t[f+r]=e[f];return f}function isInstance(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function numberIsNaN(e){return e!=e}var hexSliceLookupTable=function(){for(var e=new Array(256),t=0;t<16;++t)for(var r=16*t,n=0;n<16;++n)e[r+n]="0123456789abcdef"[t]+"0123456789abcdef"[n];return e}(); | |
}).call(this,require("buffer").Buffer) | |
},{"base64-js":"/Users/lentan/repo/torus/torus-embed/node_modules/base64-js/index.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","ieee754":"/Users/lentan/repo/torus/torus-embed/node_modules/ieee754/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/builtin-status-codes/browser.js":[function(require,module,exports){ | |
module.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer,Transform=require("stream").Transform,StringDecoder=require("string_decoder").StringDecoder,inherits=require("inherits");function CipherBase(t){Transform.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}inherits(CipherBase,Transform),CipherBase.prototype.update=function(t,e,r){"string"==typeof t&&(t=Buffer.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},CipherBase.prototype.setAutoPadding=function(){},CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},CipherBase.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){i=t}finally{r(i)}},CipherBase.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},CipherBase.prototype._finalOrDigest=function(t){var e=this.__final()||Buffer.alloc(0);return t&&(e=this._toString(e,t,!0)),e},CipherBase.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new StringDecoder(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},module.exports=CipherBase; | |
},{"inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js","stream":"/Users/lentan/repo/torus/torus-embed/node_modules/stream-browserify/index.js","string_decoder":"/Users/lentan/repo/torus/torus-embed/node_modules/string_decoder/lib/string_decoder.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/cookiejar/cookiejar.js":[function(require,module,exports){ | |
!function(){"use strict";function CookieAccessInfo(t,e,i,o){return this instanceof CookieAccessInfo?(this.domain=t||void 0,this.path=e||"/",this.secure=!!i,this.script=!!o,this):new CookieAccessInfo(t,e,i,o)}function Cookie(t,e,i){return t instanceof Cookie?t:this instanceof Cookie?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(i||"/"),this.explicit_path=!1,this.domain=e||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,t&&this.parse(t,e,i),this):new Cookie(t,e,i)}CookieAccessInfo.All=Object.freeze(Object.create(null)),exports.CookieAccessInfo=CookieAccessInfo,exports.Cookie=Cookie,Cookie.prototype.toString=function toString(){var t=[this.name+"="+this.value];return this.expiration_date!==1/0&&t.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&t.push("domain="+this.domain),this.path&&t.push("path="+this.path),this.secure&&t.push("secure"),this.noscript&&t.push("httponly"),t.join("; ")},Cookie.prototype.toValueString=function toValueString(){return this.name+"="+this.value};var t=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function CookieJar(){var t,e;return this instanceof CookieJar?(t=Object.create(null),this.setCookie=function setCookie(i,o,n){var r,s;if(r=(i=new Cookie(i,o,n)).expiration_date<=Date.now(),void 0!==t[i.name]){for(e=t[i.name],s=0;s<e.length;s+=1)if(e[s].collidesWith(i))return r?(e.splice(s,1),0===e.length&&delete t[i.name],!1):(e[s]=i,i);return!r&&(e.push(i),i)}return!r&&(t[i.name]=[i],t[i.name])},this.getCookie=function getCookie(i,o){var n,r;if(e=t[i])for(r=0;r<e.length;r+=1)if((n=e[r]).expiration_date<=Date.now())0===e.length&&delete t[n.name];else if(n.matches(o))return n},this.getCookies=function getCookies(e){var i,o,n=[];for(i in t)(o=this.getCookie(i,e))&&n.push(o);return n.toString=function toString(){return n.join(":")},n.toValueString=function toValueString(){return n.map(function(t){return t.toValueString()}).join(";")},n},this):new CookieJar}Cookie.prototype.parse=function parse(t,e,i){if(this instanceof Cookie){var o,n=t.split(";").filter(function(t){return!!t}),r=n[0].match(/([^=]+)=([\s\S]*)/);if(!r)return void console.warn("Invalid cookie header encountered. Header: '"+t+"'");var s=r[1],a=r[2];if("string"!=typeof s||0===s.length||"string"!=typeof a)return void console.warn("Unable to extract values from cookie header. Cookie: '"+t+"'");for(this.name=s,this.value=a,o=1;o<n.length;o+=1)switch(s=(r=n[o].match(/([^=]+)(?:=([\s\S]*))?/))[1].trim().toLowerCase(),a=r[2],s){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=a?Number(Date.parse(a)):1/0;break;case"path":this.path=a?a.trim():"",this.explicit_path=!0;break;case"domain":this.domain=a?a.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}return this.explicit_path||(this.path=i||"/"),this.explicit_domain||(this.domain=e),this}return(new Cookie).parse(t,e,i)},Cookie.prototype.matches=function matches(t){return t===CookieAccessInfo.All||!(this.noscript&&t.script||this.secure&&!t.secure||!this.collidesWith(t))},Cookie.prototype.collidesWith=function collidesWith(t){if(this.path&&!t.path||this.domain&&!t.domain)return!1;if(this.path&&0!==t.path.indexOf(this.path))return!1;if(this.explicit_path&&0!==t.path.indexOf(this.path))return!1;var e=t.domain&&t.domain.replace(/^[\.]/,""),i=this.domain&&this.domain.replace(/^[\.]/,"");if(i===e)return!0;if(i){if(!this.explicit_domain)return!1;var o=e.indexOf(i);return-1!==o&&o===e.length-i.length}return!0},exports.CookieJar=CookieJar,CookieJar.prototype.setCookies=function setCookies(e,i,o){var n,r,s=[];for(e=(e=Array.isArray(e)?e:e.split(t)).map(function(t){return new Cookie(t,i,o)}),n=0;n<e.length;n+=1)r=e[n],this.setCookie(r,i,o)&&s.push(r);return s}}(); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js":[function(require,module,exports){ | |
(function (Buffer){ | |
function isArray(r){return Array.isArray?Array.isArray(r):"[object Array]"===objectToString(r)}function isBoolean(r){return"boolean"==typeof r}function isNull(r){return null===r}function isNullOrUndefined(r){return null==r}function isNumber(r){return"number"==typeof r}function isString(r){return"string"==typeof r}function isSymbol(r){return"symbol"==typeof r}function isUndefined(r){return void 0===r}function isRegExp(r){return"[object RegExp]"===objectToString(r)}function isObject(r){return"object"==typeof r&&null!==r}function isDate(r){return"[object Date]"===objectToString(r)}function isError(r){return"[object Error]"===objectToString(r)||r instanceof Error}function isFunction(r){return"function"==typeof r}function isPrimitive(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function objectToString(r){return Object.prototype.toString.call(r)}exports.isArray=isArray,exports.isBoolean=isBoolean,exports.isNull=isNull,exports.isNullOrUndefined=isNullOrUndefined,exports.isNumber=isNumber,exports.isString=isString,exports.isSymbol=isSymbol,exports.isUndefined=isUndefined,exports.isRegExp=isRegExp,exports.isObject=isObject,exports.isDate=isDate,exports.isError=isError,exports.isFunction=isFunction,exports.isPrimitive=isPrimitive,exports.isBuffer=Buffer.isBuffer; | |
}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) | |
},{"../../is-buffer/index.js":"/Users/lentan/repo/torus/torus-embed/node_modules/is-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/create-ecdh/browser.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var elliptic=require("elliptic"),BN=require("bn.js");module.exports=function createECDH(e){return new ECDH(e)};var aliases={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function ECDH(e){this.curveType=aliases[e],this.curveType||(this.curveType={name:e}),this.curve=new elliptic.ec(this.curveType.name),this.keys=void 0}function formatReturnValue(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new Buffer(e);if(r&&i.length<r){var s=new Buffer(r-i.length);s.fill(0),i=Buffer.concat([s,i])}return t?i.toString(t):i}aliases.p224=aliases.secp224r1,aliases.p256=aliases.secp256r1=aliases.prime256v1,aliases.p192=aliases.secp192r1=aliases.prime192v1,aliases.p384=aliases.secp384r1,aliases.p521=aliases.secp521r1,ECDH.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},ECDH.prototype.computeSecret=function(e,t,r){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),formatReturnValue(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),r,this.curveType.byteLength)},ECDH.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[r.length-1]%2?r[0]=7:r[0]=6),formatReturnValue(r,e)},ECDH.prototype.getPrivateKey=function(e){return formatReturnValue(this.keys.getPrivate(),e)},ECDH.prototype.setPublicKey=function(e,t){return t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t)),this.keys._importPublic(e),this},ECDH.prototype.setPrivateKey=function(e,t){t=t||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,t));var r=new BN(e);return r=r.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(r),this}; | |
}).call(this,require("buffer").Buffer) | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","elliptic":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/create-hash/browser.js":[function(require,module,exports){ | |
"use strict";var inherits=require("inherits"),MD5=require("md5.js"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),Base=require("cipher-base");function Hash(e){Base.call(this,"digest"),this._hash=e}inherits(Hash,Base),Hash.prototype._update=function(e){this._hash.update(e)},Hash.prototype._final=function(){return this._hash.digest()},module.exports=function createHash(e){return"md5"===(e=e.toLowerCase())?new MD5:"rmd160"===e||"ripemd160"===e?new RIPEMD160:new Hash(sha(e))}; | |
},{"cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","md5.js":"/Users/lentan/repo/torus/torus-embed/node_modules/md5.js/index.js","ripemd160":"/Users/lentan/repo/torus/torus-embed/node_modules/ripemd160/index.js","sha.js":"/Users/lentan/repo/torus/torus-embed/node_modules/sha.js/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/create-hash/md5.js":[function(require,module,exports){ | |
var MD5=require("md5.js");module.exports=function(e){return(new MD5).update(e).digest()}; | |
},{"md5.js":"/Users/lentan/repo/torus/torus-embed/node_modules/md5.js/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/create-hmac/browser.js":[function(require,module,exports){ | |
"use strict";var inherits=require("inherits"),Legacy=require("./legacy"),Base=require("cipher-base"),Buffer=require("safe-buffer").Buffer,md5=require("create-hash/md5"),RIPEMD160=require("ripemd160"),sha=require("sha.js"),ZEROS=Buffer.alloc(128);function Hmac(e,a){Base.call(this,"digest"),"string"==typeof a&&(a=Buffer.from(a));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=a,a.length>r)?a=("rmd160"===e?new RIPEMD160:sha(e)).update(a).digest():a.length<r&&(a=Buffer.concat([a,ZEROS],r));for(var t=this._ipad=Buffer.allocUnsafe(r),s=this._opad=Buffer.allocUnsafe(r),i=0;i<r;i++)t[i]=54^a[i],s[i]=92^a[i];this._hash="rmd160"===e?new RIPEMD160:sha(e),this._hash.update(t)}inherits(Hmac,Base),Hmac.prototype._update=function(e){this._hash.update(e)},Hmac.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new RIPEMD160:sha(this._alg)).update(this._opad).update(e).digest()},module.exports=function createHmac(e,a){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new Hmac("rmd160",a):"md5"===e?new Legacy(md5,a):new Hmac(e,a)}; | |
},{"./legacy":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hmac/legacy.js","cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","create-hash/md5":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hash/md5.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","ripemd160":"/Users/lentan/repo/torus/torus-embed/node_modules/ripemd160/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js","sha.js":"/Users/lentan/repo/torus/torus-embed/node_modules/sha.js/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/create-hmac/legacy.js":[function(require,module,exports){ | |
"use strict";var inherits=require("inherits"),Buffer=require("safe-buffer").Buffer,Base=require("cipher-base"),ZEROS=Buffer.alloc(128),blocksize=64;function Hmac(e,s){Base.call(this,"digest"),"string"==typeof s&&(s=Buffer.from(s)),this._alg=e,this._key=s,s.length>blocksize?s=e(s):s.length<blocksize&&(s=Buffer.concat([s,ZEROS],blocksize));for(var i=this._ipad=Buffer.allocUnsafe(blocksize),t=this._opad=Buffer.allocUnsafe(blocksize),a=0;a<blocksize;a++)i[a]=54^s[a],t[a]=92^s[a];this._hash=[i]}inherits(Hmac,Base),Hmac.prototype._update=function(e){this._hash.push(e)},Hmac.prototype._final=function(){var e=this._alg(Buffer.concat(this._hash));return this._alg(Buffer.concat([this._opad,e]))},module.exports=Hmac; | |
},{"cipher-base":"/Users/lentan/repo/torus/torus-embed/node_modules/cipher-base/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-browserify/index.js":[function(require,module,exports){ | |
"use strict";exports.randomBytes=exports.rng=exports.pseudoRandomBytes=exports.prng=require("randombytes"),exports.createHash=exports.Hash=require("create-hash"),exports.createHmac=exports.Hmac=require("create-hmac");var algos=require("browserify-sign/algos"),algoKeys=Object.keys(algos),hashes=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(algoKeys);exports.getHashes=function(){return hashes};var p=require("pbkdf2");exports.pbkdf2=p.pbkdf2,exports.pbkdf2Sync=p.pbkdf2Sync;var aes=require("browserify-cipher");exports.Cipher=aes.Cipher,exports.createCipher=aes.createCipher,exports.Cipheriv=aes.Cipheriv,exports.createCipheriv=aes.createCipheriv,exports.Decipher=aes.Decipher,exports.createDecipher=aes.createDecipher,exports.Decipheriv=aes.Decipheriv,exports.createDecipheriv=aes.createDecipheriv,exports.getCiphers=aes.getCiphers,exports.listCiphers=aes.listCiphers;var dh=require("diffie-hellman");exports.DiffieHellmanGroup=dh.DiffieHellmanGroup,exports.createDiffieHellmanGroup=dh.createDiffieHellmanGroup,exports.getDiffieHellman=dh.getDiffieHellman,exports.createDiffieHellman=dh.createDiffieHellman,exports.DiffieHellman=dh.DiffieHellman;var sign=require("browserify-sign");exports.createSign=sign.createSign,exports.Sign=sign.Sign,exports.createVerify=sign.createVerify,exports.Verify=sign.Verify,exports.createECDH=require("create-ecdh");var publicEncrypt=require("public-encrypt");exports.publicEncrypt=publicEncrypt.publicEncrypt,exports.privateEncrypt=publicEncrypt.privateEncrypt,exports.publicDecrypt=publicEncrypt.publicDecrypt,exports.privateDecrypt=publicEncrypt.privateDecrypt;var rf=require("randomfill");exports.randomFill=rf.randomFill,exports.randomFillSync=rf.randomFillSync,exports.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},exports.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}; | |
},{"browserify-cipher":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-cipher/browser.js","browserify-sign":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/browser/index.js","browserify-sign/algos":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify-sign/algos.js","create-ecdh":"/Users/lentan/repo/torus/torus-embed/node_modules/create-ecdh/browser.js","create-hash":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hash/browser.js","create-hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/create-hmac/browser.js","diffie-hellman":"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/browser.js","pbkdf2":"/Users/lentan/repo/torus/torus-embed/node_modules/pbkdf2/browser.js","public-encrypt":"/Users/lentan/repo/torus/torus-embed/node_modules/public-encrypt/browser.js","randombytes":"/Users/lentan/repo/torus/torus-embed/node_modules/randombytes/browser.js","randomfill":"/Users/lentan/repo/torus/torus-embed/node_modules/randomfill/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/aes.js":[function(require,module,exports){ | |
!function(e,r,i){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return function(){var r=e,i=r.lib.BlockCipher,o=r.algo,t=[],n=[],c=[],s=[],f=[],d=[],u=[],h=[],y=[],a=[];!function(){for(var e=[],r=0;r<256;r++)e[r]=r<128?r<<1:r<<1^283;var i=0,o=0;for(r=0;r<256;r++){var p=o^o<<1^o<<2^o<<3^o<<4;p=p>>>8^255&p^99,t[i]=p,n[p]=i;var l=e[i],v=e[l],_=e[v],k=257*e[p]^16843008*p;c[i]=k<<24|k>>>8,s[i]=k<<16|k>>>16,f[i]=k<<8|k>>>24,d[i]=k;k=16843009*_^65537*v^257*l^16843008*i;u[p]=k<<24|k>>>8,h[p]=k<<16|k>>>16,y[p]=k<<8|k>>>24,a[p]=k,i?(i=l^e[e[e[_^l]]],o^=e[e[o]]):i=o=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],l=o.AES=i.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,i=e.sigBytes/4,o=4*((this._nRounds=i+6)+1),n=this._keySchedule=[],c=0;c<o;c++)if(c<i)n[c]=r[c];else{var s=n[c-1];c%i?i>6&&c%i==4&&(s=t[s>>>24]<<24|t[s>>>16&255]<<16|t[s>>>8&255]<<8|t[255&s]):(s=t[(s=s<<8|s>>>24)>>>24]<<24|t[s>>>16&255]<<16|t[s>>>8&255]<<8|t[255&s],s^=p[c/i|0]<<24),n[c]=n[c-i]^s}for(var f=this._invKeySchedule=[],d=0;d<o;d++){c=o-d;if(d%4)s=n[c];else s=n[c-4];f[d]=d<4||c<=4?s:u[t[s>>>24]]^h[t[s>>>16&255]]^y[t[s>>>8&255]]^a[t[255&s]]}}},encryptBlock:function(e,r){this._doCryptBlock(e,r,this._keySchedule,c,s,f,d,t)},decryptBlock:function(e,r){var i=e[r+1];e[r+1]=e[r+3],e[r+3]=i,this._doCryptBlock(e,r,this._invKeySchedule,u,h,y,a,n);i=e[r+1];e[r+1]=e[r+3],e[r+3]=i},_doCryptBlock:function(e,r,i,o,t,n,c,s){for(var f=this._nRounds,d=e[r]^i[0],u=e[r+1]^i[1],h=e[r+2]^i[2],y=e[r+3]^i[3],a=4,p=1;p<f;p++){var l=o[d>>>24]^t[u>>>16&255]^n[h>>>8&255]^c[255&y]^i[a++],v=o[u>>>24]^t[h>>>16&255]^n[y>>>8&255]^c[255&d]^i[a++],_=o[h>>>24]^t[y>>>16&255]^n[d>>>8&255]^c[255&u]^i[a++],k=o[y>>>24]^t[d>>>16&255]^n[u>>>8&255]^c[255&h]^i[a++];d=l,u=v,h=_,y=k}l=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[h>>>8&255]<<8|s[255&y])^i[a++],v=(s[u>>>24]<<24|s[h>>>16&255]<<16|s[y>>>8&255]<<8|s[255&d])^i[a++],_=(s[h>>>24]<<24|s[y>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^i[a++],k=(s[y>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&h])^i[a++];e[r]=l,e[r+1]=v,e[r+2]=_,e[r+3]=k},keySize:8});r.AES=i._createHelper(l)}(),e.AES}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js":[function(require,module,exports){ | |
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof define&&define.amd?define(["./core"],t):t(e.CryptoJS)}(this,function(e){e.lib.Cipher||function(t){var r=e,i=r.lib,c=i.Base,n=i.WordArray,o=i.BufferedBlockAlgorithm,s=r.enc,a=(s.Utf8,s.Base64),f=r.algo.EvpKDF,p=i.Cipher=o.extend({cfg:c.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function selectCipherStrategy(e){return"string"==typeof e?g:v}return function(e){return{encrypt:function(t,r,i){return selectCipherStrategy(r).encrypt(e,t,r,i)},decrypt:function(t,r,i){return selectCipherStrategy(r).decrypt(e,t,r,i)}}}}()}),h=(i.StreamCipher=p.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),r.mode={}),d=i.BlockCipherMode=c.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),u=h.CBC=function(){var e=d.extend();function xorBlock(e,r,i){var c=this._iv;if(c){var n=c;this._iv=t}else n=this._prevBlock;for(var o=0;o<i;o++)e[r+o]^=n[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;xorBlock.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,c=e.slice(t,t+i);r.decryptBlock(e,t),xorBlock.call(this,e,t,i),this._prevBlock=c}}),e}(),l=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,i=r-e.sigBytes%r,c=i<<24|i<<16|i<<8|i,o=[],s=0;s<i;s+=4)o.push(c);var a=n.create(o,i);e.concat(a)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},_=(i.BlockCipher=p.extend({cfg:p.cfg.extend({mode:u,padding:l}),reset:function(){p.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var i=r.createEncryptor;else{i=r.createDecryptor;this._minBufferSize=1}this._mode=i.call(r,this,t&&t.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{t=this._process(!0);e.unpad(t)}return t},blockSize:4}),i.CipherParams=c.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}})),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var i=n.create([1398893684,1701076831]).concat(r).concat(t);else i=t;return i.toString(a)},parse:function(e){var t=a.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var i=n.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return _.create({ciphertext:t,salt:i})}},v=i.SerializableCipher=c.extend({cfg:c.extend({format:y}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var c=e.createEncryptor(r,i),n=c.finalize(t),o=c.cfg;return _.create({ciphertext:n,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),x=(r.kdf={}).OpenSSL={execute:function(e,t,r,i){i||(i=n.random(8));var c=f.create({keySize:t+r}).compute(e,i),o=n.create(c.words.slice(t),4*r);return c.sigBytes=4*t,_.create({key:c,iv:o,salt:i})}},g=i.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:x}),encrypt:function(e,t,r,i){var c=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize);i.iv=c.iv;var n=v.encrypt.call(this,e,t,c.key,i);return n.mixIn(c),n},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);var c=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=c.iv,v.decrypt.call(this,e,t,c.key,i)}})}()}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js":[function(require,module,exports){ | |
!function(t,n){"object"==typeof exports?module.exports=exports=n():"function"==typeof define&&define.amd?define([],n):t.CryptoJS=n()}(this,function(){var t=t||function(t,n){var i=Object.create||function(){function F(){}return function(t){var n;return F.prototype=t,n=new F,F.prototype=null,n}}(),e={},r=e.lib={},o=r.Base={extend:function(t){var n=i(this);return t&&n.mixIn(t),n.hasOwnProperty("init")&&this.init!==n.init||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=r.WordArray=o.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=null!=n?n:4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var n=this.words,i=t.words,e=this.sigBytes,r=t.sigBytes;if(this.clamp(),e%4)for(var o=0;o<r;o++){var s=i[o>>>2]>>>24-o%4*8&255;n[e+o>>>2]|=s<<24-(e+o)%4*8}else for(o=0;o<r;o+=4)n[e+o>>>2]=i[o>>>2];return this.sigBytes+=r,this},clamp:function(){var n=this.words,i=this.sigBytes;n[i>>>2]&=4294967295<<32-i%4*8,n.length=t.ceil(i/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(n){for(var i,e=[],r=function(n){n=n;var i=987654321,e=4294967295;return function(){var r=((i=36969*(65535&i)+(i>>16)&e)<<16)+(n=18e3*(65535&n)+(n>>16)&e)&e;return r/=4294967296,(r+=.5)*(t.random()>.5?1:-1)}},o=0;o<n;o+=4){var a=r(4294967296*(i||t.random()));i=987654071*a(),e.push(4294967296*a()|0)}return new s.init(e,n)}}),a=e.enc={},c=a.Hex={stringify:function(t){for(var n=t.words,i=t.sigBytes,e=[],r=0;r<i;r++){var o=n[r>>>2]>>>24-r%4*8&255;e.push((o>>>4).toString(16)),e.push((15&o).toString(16))}return e.join("")},parse:function(t){for(var n=t.length,i=[],e=0;e<n;e+=2)i[e>>>3]|=parseInt(t.substr(e,2),16)<<24-e%8*4;return new s.init(i,n/2)}},u=a.Latin1={stringify:function(t){for(var n=t.words,i=t.sigBytes,e=[],r=0;r<i;r++){var o=n[r>>>2]>>>24-r%4*8&255;e.push(String.fromCharCode(o))}return e.join("")},parse:function(t){for(var n=t.length,i=[],e=0;e<n;e++)i[e>>>2]|=(255&t.charCodeAt(e))<<24-e%4*8;return new s.init(i,n)}},f=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},h=r.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(n){var i=this._data,e=i.words,r=i.sigBytes,o=this.blockSize,a=r/(4*o),c=(a=n?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*o,u=t.min(4*c,r);if(c){for(var f=0;f<c;f+=o)this._doProcessBlock(e,f);var h=e.splice(0,c);i.sigBytes-=u}return new s.init(h,u)},clone:function(){var t=o.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),p=(r.Hasher=h.extend({cfg:o.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(n,i){return new t.init(i).finalize(n)}},_createHmacHelper:function(t){return function(n,i){return new p.HMAC.init(t,i).finalize(n)}}}),e.algo={});return e}(Math);return t}); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js":[function(require,module,exports){ | |
!function(r,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(r.CryptoJS)}(this,function(r){return function(){var e=r,t=e.lib.WordArray;e.enc.Base64={stringify:function(r){var e=r.words,t=r.sigBytes,a=this._map;r.clamp();for(var o=[],n=0;n<t;n+=3)for(var i=(e[n>>>2]>>>24-n%4*8&255)<<16|(e[n+1>>>2]>>>24-(n+1)%4*8&255)<<8|e[n+2>>>2]>>>24-(n+2)%4*8&255,f=0;f<4&&n+.75*f<t;f++)o.push(a.charAt(i>>>6*(3-f)&63));var c=a.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(r){var e=r.length,a=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var n=0;n<a.length;n++)o[a.charCodeAt(n)]=n}var i=a.charAt(64);if(i){var f=r.indexOf(i);-1!==f&&(e=f)}return function parseLoop(r,e,a){for(var o=[],n=0,i=0;i<e;i++)if(i%4){var f=a[r.charCodeAt(i-1)]<<i%4*2,c=a[r.charCodeAt(i)]>>>6-i%4*2;o[n>>>2]|=(f|c)<<24-n%4*8,n++}return t.create(o,n)}(r,e,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),r.enc.Base64}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-utf16.js":[function(require,module,exports){ | |
!function(r,n){"object"==typeof exports?module.exports=exports=n(require("./core")):"function"==typeof define&&define.amd?define(["./core"],n):n(r.CryptoJS)}(this,function(r){return function(){var n=r,e=n.lib.WordArray,t=n.enc;t.Utf16=t.Utf16BE={stringify:function(r){for(var n=r.words,e=r.sigBytes,t=[],o=0;o<e;o+=2){var i=n[o>>>2]>>>16-o%4*8&65535;t.push(String.fromCharCode(i))}return t.join("")},parse:function(r){for(var n=r.length,t=[],o=0;o<n;o++)t[o>>>1]|=r.charCodeAt(o)<<16-o%2*16;return e.create(t,2*n)}};function swapEndian(r){return r<<8&4278255360|r>>>8&16711935}t.Utf16LE={stringify:function(r){for(var n=r.words,e=r.sigBytes,t=[],o=0;o<e;o+=2){var i=swapEndian(n[o>>>2]>>>16-o%4*8&65535);t.push(String.fromCharCode(i))}return t.join("")},parse:function(r){for(var n=r.length,t=[],o=0;o<n;o++)t[o>>>1]|=swapEndian(r.charCodeAt(o)<<16-o%2*16);return e.create(t,2*n)}}}(),r.enc.Utf16}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js":[function(require,module,exports){ | |
!function(e,t,r){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./sha1"),require("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],t):t(e.CryptoJS)}(this,function(e){var t,r,i,n,o,a,c;return r=(t=e).lib,i=r.Base,n=r.WordArray,o=t.algo,a=o.MD5,c=o.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,i=r.hasher.create(),o=n.create(),a=o.words,c=r.keySize,f=r.iterations;a.length<c;){s&&i.update(s);var s=i.update(e).finalize(t);i.reset();for(var u=1;u<f;u++)s=i.finalize(s),i.reset();o.concat(s)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,r){return c.create(r).compute(e,t)},e.EvpKDF}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/hmac.js","./sha1":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha1.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/format-hex.js":[function(require,module,exports){ | |
!function(e,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){var r,t,i;return t=(r=e).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var r=i.parse(e);return t.create({ciphertext:r})}},e.format.Hex}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/hmac.js":[function(require,module,exports){ | |
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof define&&define.amd?define(["./core"],t):t(e.CryptoJS)}(this,function(e){var t,i,n;i=(t=e).lib.Base,n=t.enc.Utf8,t.algo.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var i=e.blockSize,s=4*i;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var r=this._oKey=t.clone(),o=this._iKey=t.clone(),a=r.words,f=o.words,h=0;h<i;h++)a[h]^=1549556828,f[h]^=909522486;r.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,i=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(i))}})}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/index.js":[function(require,module,exports){ | |
!function(e,r,i){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./x64-core"),require("./lib-typedarrays"),require("./enc-utf16"),require("./enc-base64"),require("./md5"),require("./sha1"),require("./sha256"),require("./sha224"),require("./sha512"),require("./sha384"),require("./sha3"),require("./ripemd160"),require("./hmac"),require("./pbkdf2"),require("./evpkdf"),require("./cipher-core"),require("./mode-cfb"),require("./mode-ctr"),require("./mode-ctr-gladman"),require("./mode-ofb"),require("./mode-ecb"),require("./pad-ansix923"),require("./pad-iso10126"),require("./pad-iso97971"),require("./pad-zeropadding"),require("./pad-nopadding"),require("./format-hex"),require("./aes"),require("./tripledes"),require("./rc4"),require("./rabbit"),require("./rabbit-legacy")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],r):e.CryptoJS=r(e.CryptoJS)}(this,function(e){return e}); | |
},{"./aes":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/aes.js","./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./enc-utf16":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-utf16.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./format-hex":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/format-hex.js","./hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/hmac.js","./lib-typedarrays":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/lib-typedarrays.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js","./mode-cfb":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-cfb.js","./mode-ctr":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ctr.js","./mode-ctr-gladman":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ctr-gladman.js","./mode-ecb":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ecb.js","./mode-ofb":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ofb.js","./pad-ansix923":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-ansix923.js","./pad-iso10126":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-iso10126.js","./pad-iso97971":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-iso97971.js","./pad-nopadding":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-nopadding.js","./pad-zeropadding":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-zeropadding.js","./pbkdf2":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pbkdf2.js","./rabbit":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rabbit.js","./rabbit-legacy":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rabbit-legacy.js","./rc4":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rc4.js","./ripemd160":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/ripemd160.js","./sha1":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha1.js","./sha224":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha224.js","./sha256":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha256.js","./sha3":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha3.js","./sha384":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha384.js","./sha512":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha512.js","./tripledes":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/tripledes.js","./x64-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/x64-core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/lib-typedarrays.js":[function(require,module,exports){ | |
!function(n,r){"object"==typeof exports?module.exports=exports=r(require("./core")):"function"==typeof define&&define.amd?define(["./core"],r):r(n.CryptoJS)}(this,function(n){return function(){if("function"==typeof ArrayBuffer){var r=n.lib.WordArray,t=r.init;(r.init=function(n){if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),(n instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),n instanceof Uint8Array){for(var r=n.byteLength,e=[],i=0;i<r;i++)e[i>>>2]|=n[i]<<24-i%4*8;t.call(this,e,r)}else t.apply(this,arguments)}).prototype=r}}(),n.lib.WordArray}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js":[function(require,module,exports){ | |
!function(r,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(r.CryptoJS)}(this,function(r){return function(e){var t=r,n=t.lib,o=n.WordArray,H=n.Hasher,a=t.algo,F=[];!function(){for(var r=0;r<64;r++)F[r]=4294967296*e.abs(e.sin(r+1))|0}();var i=a.MD5=H.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var n=e+t,o=r[n];r[n]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}var H=this._hash.words,a=r[e+0],i=r[e+1],G=r[e+2],I=r[e+3],s=r[e+4],c=r[e+5],f=r[e+6],h=r[e+7],u=r[e+8],v=r[e+9],d=r[e+10],l=r[e+11],_=r[e+12],p=r[e+13],y=r[e+14],D=r[e+15],M=H[0],g=H[1],m=H[2],w=H[3];M=FF(M,g,m,w,a,7,F[0]),w=FF(w,M,g,m,i,12,F[1]),m=FF(m,w,M,g,G,17,F[2]),g=FF(g,m,w,M,I,22,F[3]),M=FF(M,g,m,w,s,7,F[4]),w=FF(w,M,g,m,c,12,F[5]),m=FF(m,w,M,g,f,17,F[6]),g=FF(g,m,w,M,h,22,F[7]),M=FF(M,g,m,w,u,7,F[8]),w=FF(w,M,g,m,v,12,F[9]),m=FF(m,w,M,g,d,17,F[10]),g=FF(g,m,w,M,l,22,F[11]),M=FF(M,g,m,w,_,7,F[12]),w=FF(w,M,g,m,p,12,F[13]),m=FF(m,w,M,g,y,17,F[14]),M=GG(M,g=FF(g,m,w,M,D,22,F[15]),m,w,i,5,F[16]),w=GG(w,M,g,m,f,9,F[17]),m=GG(m,w,M,g,l,14,F[18]),g=GG(g,m,w,M,a,20,F[19]),M=GG(M,g,m,w,c,5,F[20]),w=GG(w,M,g,m,d,9,F[21]),m=GG(m,w,M,g,D,14,F[22]),g=GG(g,m,w,M,s,20,F[23]),M=GG(M,g,m,w,v,5,F[24]),w=GG(w,M,g,m,y,9,F[25]),m=GG(m,w,M,g,I,14,F[26]),g=GG(g,m,w,M,u,20,F[27]),M=GG(M,g,m,w,p,5,F[28]),w=GG(w,M,g,m,G,9,F[29]),m=GG(m,w,M,g,h,14,F[30]),M=HH(M,g=GG(g,m,w,M,_,20,F[31]),m,w,c,4,F[32]),w=HH(w,M,g,m,u,11,F[33]),m=HH(m,w,M,g,l,16,F[34]),g=HH(g,m,w,M,y,23,F[35]),M=HH(M,g,m,w,i,4,F[36]),w=HH(w,M,g,m,s,11,F[37]),m=HH(m,w,M,g,h,16,F[38]),g=HH(g,m,w,M,d,23,F[39]),M=HH(M,g,m,w,p,4,F[40]),w=HH(w,M,g,m,a,11,F[41]),m=HH(m,w,M,g,I,16,F[42]),g=HH(g,m,w,M,f,23,F[43]),M=HH(M,g,m,w,v,4,F[44]),w=HH(w,M,g,m,_,11,F[45]),m=HH(m,w,M,g,D,16,F[46]),M=II(M,g=HH(g,m,w,M,G,23,F[47]),m,w,a,6,F[48]),w=II(w,M,g,m,h,10,F[49]),m=II(m,w,M,g,y,15,F[50]),g=II(g,m,w,M,c,21,F[51]),M=II(M,g,m,w,_,6,F[52]),w=II(w,M,g,m,I,10,F[53]),m=II(m,w,M,g,d,15,F[54]),g=II(g,m,w,M,i,21,F[55]),M=II(M,g,m,w,u,6,F[56]),w=II(w,M,g,m,D,10,F[57]),m=II(m,w,M,g,f,15,F[58]),g=II(g,m,w,M,p,21,F[59]),M=II(M,g,m,w,s,6,F[60]),w=II(w,M,g,m,l,10,F[61]),m=II(m,w,M,g,G,15,F[62]),g=II(g,m,w,M,v,21,F[63]),H[0]=H[0]+M|0,H[1]=H[1]+g|0,H[2]=H[2]+m|0,H[3]=H[3]+w|0},_doFinalize:function(){var r=this._data,t=r.words,n=8*this._nDataBytes,o=8*r.sigBytes;t[o>>>5]|=128<<24-o%32;var H=e.floor(n/4294967296),a=n;t[15+(o+64>>>9<<4)]=16711935&(H<<8|H>>>24)|4278255360&(H<<24|H>>>8),t[14+(o+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r.sigBytes=4*(t.length+1),this._process();for(var F=this._hash,i=F.words,G=0;G<4;G++){var I=i[G];i[G]=16711935&(I<<8|I>>>24)|4278255360&(I<<24|I>>>8)}return F},clone:function(){var r=H.clone.call(this);return r._hash=this._hash.clone(),r}});function FF(r,e,t,n,o,H,a){var F=r+(e&t|~e&n)+o+a;return(F<<H|F>>>32-H)+e}function GG(r,e,t,n,o,H,a){var F=r+(e&n|t&~n)+o+a;return(F<<H|F>>>32-H)+e}function HH(r,e,t,n,o,H,a){var F=r+(e^t^n)+o+a;return(F<<H|F>>>32-H)+e}function II(r,e,t,n,o,H,a){var F=r+(t^(e|~n))+o+a;return(F<<H|F>>>32-H)+e}t.MD5=H._createHelper(i),t.HmacMD5=H._createHmacHelper(i)}(Math),r.MD5}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-cfb.js":[function(require,module,exports){ | |
!function(e,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.mode.CFB=function(){var r=e.lib.BlockCipherMode.extend();function generateKeystreamAndEncrypt(e,r,t,c){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;c.encryptBlock(o,0);for(var n=0;n<t;n++)e[r+n]^=o[n]}return r.Encryptor=r.extend({processBlock:function(e,r){var t=this._cipher,c=t.blockSize;generateKeystreamAndEncrypt.call(this,e,r,c,t),this._prevBlock=e.slice(r,r+c)}}),r.Decryptor=r.extend({processBlock:function(e,r){var t=this._cipher,c=t.blockSize,i=e.slice(r,r+c);generateKeystreamAndEncrypt.call(this,e,r,c,t),this._prevBlock=i}}),r}(),e.mode.CFB}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ctr-gladman.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.mode.CTRGladman=function(){var r=e.lib.BlockCipherMode.extend();function incWord(e){if(255==(e>>24&255)){var r=e>>16&255,o=e>>8&255,i=255&e;255===r?(r=0,255===o?(o=0,255===i?i=0:++i):++o):++r,e=0,e+=r<<16,e+=o<<8,e+=i}else e+=1<<24;return e}var o=r.Encryptor=r.extend({processBlock:function(e,r){var o=this._cipher,i=o.blockSize,n=this._iv,t=this._counter;n&&(t=this._counter=n.slice(0),this._iv=void 0),function incCounter(e){return 0===(e[0]=incWord(e[0]))&&(e[1]=incWord(e[1])),e}(t);var c=t.slice(0);o.encryptBlock(c,0);for(var u=0;u<i;u++)e[r+u]^=c[u]}});return r.Decryptor=o,r}(),e.mode.CTRGladman}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ctr.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){var r,o;return e.mode.CTR=(r=e.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(e,r){var o=this._cipher,i=o.blockSize,t=this._iv,c=this._counter;t&&(c=this._counter=t.slice(0),this._iv=void 0);var n=c.slice(0);o.encryptBlock(n,0),c[i-1]=c[i-1]+1|0;for(var p=0;p<i;p++)e[r+p]^=n[p]}}),r.Decryptor=o,r),e.mode.CTR}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ecb.js":[function(require,module,exports){ | |
!function(e,o,r){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(e.CryptoJS)}(this,function(e){var o;return e.mode.ECB=((o=e.lib.BlockCipherMode.extend()).Encryptor=o.extend({processBlock:function(e,o){this._cipher.encryptBlock(e,o)}}),o.Decryptor=o.extend({processBlock:function(e,o){this._cipher.decryptBlock(e,o)}}),o),e.mode.ECB}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/mode-ofb.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){var r,o;return e.mode.OFB=(r=e.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(e,r){var o=this._cipher,i=o.blockSize,t=this._iv,c=this._keystream;t&&(c=this._keystream=t.slice(0),this._iv=void 0),o.encryptBlock(c,0);for(var n=0;n<i;n++)e[r+n]^=c[n]}}),r.Decryptor=o,r),e.mode.OFB}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-ansix923.js":[function(require,module,exports){ | |
!function(e,r,i){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.pad.AnsiX923={pad:function(e,r){var i=e.sigBytes,o=4*r,t=o-i%o,n=i+t-1;e.clamp(),e.words[n>>>2]|=t<<24-n%4*8,e.sigBytes+=t},unpad:function(e){var r=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=r}},e.pad.Ansix923}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-iso10126.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.pad.Iso10126={pad:function(r,o){var t=4*o,i=t-r.sigBytes%t;r.concat(e.lib.WordArray.random(i-1)).concat(e.lib.WordArray.create([i<<24],1))},unpad:function(e){var r=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=r}},e.pad.Iso10126}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-iso97971.js":[function(require,module,exports){ | |
!function(e,o,r){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(e.CryptoJS)}(this,function(e){return e.pad.Iso97971={pad:function(o,r){o.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(o,r)},unpad:function(o){e.pad.ZeroPadding.unpad(o),o.sigBytes--}},e.pad.Iso97971}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-nopadding.js":[function(require,module,exports){ | |
!function(e,o,n){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(e.CryptoJS)}(this,function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pad-zeropadding.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return e.pad.ZeroPadding={pad:function(e,r){var o=4*r;e.clamp(),e.sigBytes+=o-(e.sigBytes%o||o)},unpad:function(e){for(var r=e.words,o=e.sigBytes-1;!(r[o>>>2]>>>24-o%4*8&255);)o--;e.sigBytes=o+1}},e.pad.ZeroPadding}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/pbkdf2.js":[function(require,module,exports){ | |
!function(e,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./sha1"),require("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],r):r(e.CryptoJS)}(this,function(e){var r,t,i,o,n,a,c,s;return t=(r=e).lib,i=t.Base,o=t.WordArray,n=r.algo,a=n.SHA1,c=n.HMAC,s=n.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:a,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,r){for(var t=this.cfg,i=c.create(t.hasher,e),n=o.create(),a=o.create([1]),s=n.words,f=a.words,u=t.keySize,d=t.iterations;s.length<u;){var h=i.update(r).finalize(a);i.reset();for(var p=h.words,g=p.length,l=h,y=1;y<d;y++){l=i.finalize(l),i.reset();for(var m=l.words,x=0;x<g;x++)p[x]^=m[x]}n.concat(h),f[0]++}return n.sigBytes=4*u,n}}),r.PBKDF2=function(e,r,t){return s.create(t).compute(e,r)},e.PBKDF2}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/hmac.js","./sha1":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha1.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rabbit-legacy.js":[function(require,module,exports){ | |
!function(e,t,r){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib.StreamCipher,i=t.algo,o=[],a=[],c=[],n=i.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var o=0;o<4;o++)nextState.call(this);for(o=0;o<8;o++)i[o]^=r[o+4&7];if(t){var a=t.words,c=a[0],n=a[1],s=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),f=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),h=s>>>16|4294901760&f,b=f<<16|65535&s;i[0]^=s,i[1]^=h,i[2]^=f,i[3]^=b,i[4]^=s,i[5]^=h,i[6]^=f,i[7]^=b;for(o=0;o<4;o++)nextState.call(this)}},_doProcessBlock:function(e,t){var r=this._X;nextState.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function nextState(){for(var e=this._X,t=this._C,r=0;r<8;r++)a[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<a[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<a[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<a[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<a[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<a[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<a[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<a[6]>>>0?1:0)|0,this._b=t[7]>>>0<a[7]>>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],o=65535&i,n=i>>>16,s=((o*o>>>17)+o*n>>>15)+n*n,f=((4294901760&i)*i|0)+((65535&i)*i|0);c[r]=s^f}e[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,e[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,e[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,e[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,e[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,e[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,e[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,e[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}t.RabbitLegacy=r._createHelper(n)}(),e.RabbitLegacy}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rabbit.js":[function(require,module,exports){ | |
!function(e,t,r){"object"==typeof exports?module.exports=exports=t(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],t):t(e.CryptoJS)}(this,function(e){return function(){var t=e,r=t.lib.StreamCipher,i=t.algo,o=[],n=[],a=[],c=i.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],o=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(r=0;r<4;r++)nextState.call(this);for(r=0;r<8;r++)o[r]^=i[r+4&7];if(t){var n=t.words,a=n[0],c=n[1],s=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),h=s>>>16|4294901760&f,b=f<<16|65535&s;o[0]^=s,o[1]^=h,o[2]^=f,o[3]^=b,o[4]^=s,o[5]^=h,o[6]^=f,o[7]^=b;for(r=0;r<4;r++)nextState.call(this)}},_doProcessBlock:function(e,t){var r=this._X;nextState.call(this),o[0]=r[0]^r[5]>>>16^r[3]<<16,o[1]=r[2]^r[7]>>>16^r[5]<<16,o[2]=r[4]^r[1]>>>16^r[7]<<16,o[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)o[i]=16711935&(o[i]<<8|o[i]>>>24)|4278255360&(o[i]<<24|o[i]>>>8),e[t+i]^=o[i]},blockSize:4,ivSize:2});function nextState(){for(var e=this._X,t=this._C,r=0;r<8;r++)n[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<n[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<n[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<n[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<n[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<n[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<n[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<n[6]>>>0?1:0)|0,this._b=t[7]>>>0<n[7]>>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],o=65535&i,c=i>>>16,s=((o*o>>>17)+o*c>>>15)+c*c,f=((4294901760&i)*i|0)+((65535&i)*i|0);a[r]=s^f}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}t.Rabbit=r._createHelper(c)}(),e.Rabbit}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/rc4.js":[function(require,module,exports){ | |
!function(e,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],r):r(e.CryptoJS)}(this,function(e){return function(){var r=e,t=r.lib.StreamCipher,i=r.algo,o=i.RC4=t.extend({_doReset:function(){for(var e=this._key,r=e.words,t=e.sigBytes,i=this._S=[],o=0;o<256;o++)i[o]=o;o=0;for(var s=0;o<256;o++){var n=o%t,c=r[n>>>2]>>>24-n%4*8&255;s=(s+i[o]+c)%256;var a=i[o];i[o]=i[s],i[s]=a}this._i=this._j=0},_doProcessBlock:function(e,r){e[r]^=generateKeystreamWord.call(this)},keySize:8,ivSize:0});function generateKeystreamWord(){for(var e=this._S,r=this._i,t=this._j,i=0,o=0;o<4;o++){t=(t+e[r=(r+1)%256])%256;var s=e[r];e[r]=e[t],e[t]=s,i|=e[(e[r]+e[t])%256]<<24-8*o}return this._i=r,this._j=t,i}r.RC4=t._createHelper(o);var s=i.RC4Drop=o.extend({cfg:o.cfg.extend({drop:192}),_doReset:function(){o._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)generateKeystreamWord.call(this)}});r.RC4Drop=t._createHelper(s)}(),e.RC4}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/ripemd160.js":[function(require,module,exports){ | |
!function(r,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(r.CryptoJS)}(this,function(r){return function(e){var t=r,o=t.lib,n=o.WordArray,f=o.Hasher,s=t.algo,a=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),i=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=n.create([0,1518500249,1859775393,2400959708,2840853838]),d=n.create([1352829926,1548603684,1836072691,2053994217,0]),l=s.RIPEMD160=f.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(r,e){for(var t=0;t<16;t++){var o=e+t,n=r[o];r[o]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var f,s,l,_,p,w,v,y,D,H,M,P=this._hash.words,R=h.words,g=d.words,m=a.words,x=c.words,B=i.words,E=u.words;w=f=P[0],v=s=P[1],y=l=P[2],D=_=P[3],H=p=P[4];for(t=0;t<80;t+=1)M=f+r[e+m[t]]|0,M+=t<16?f1(s,l,_)+R[0]:t<32?f2(s,l,_)+R[1]:t<48?f3(s,l,_)+R[2]:t<64?f4(s,l,_)+R[3]:f5(s,l,_)+R[4],M=(M=rotl(M|=0,B[t]))+p|0,f=p,p=_,_=rotl(l,10),l=s,s=M,M=w+r[e+x[t]]|0,M+=t<16?f5(v,y,D)+g[0]:t<32?f4(v,y,D)+g[1]:t<48?f3(v,y,D)+g[2]:t<64?f2(v,y,D)+g[3]:f1(v,y,D)+g[4],M=(M=rotl(M|=0,E[t]))+H|0,w=H,H=D,D=rotl(y,10),y=v,v=M;M=P[1]+l+D|0,P[1]=P[2]+_+H|0,P[2]=P[3]+p+w|0,P[3]=P[4]+f+v|0,P[4]=P[0]+s+y|0,P[0]=M},_doFinalize:function(){var r=this._data,e=r.words,t=8*this._nDataBytes,o=8*r.sigBytes;e[o>>>5]|=128<<24-o%32,e[14+(o+64>>>9<<4)]=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),r.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,f=n.words,s=0;s<5;s++){var a=f[s];f[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return n},clone:function(){var r=f.clone.call(this);return r._hash=this._hash.clone(),r}});function f1(r,e,t){return r^e^t}function f2(r,e,t){return r&e|~r&t}function f3(r,e,t){return(r|~e)^t}function f4(r,e,t){return r&t|e&~t}function f5(r,e,t){return r^(e|~t)}function rotl(r,e){return r<<e|r>>>32-e}t.RIPEMD160=f._createHelper(l),t.HmacRIPEMD160=f._createHmacHelper(l)}(Math),r.RIPEMD160}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha1.js":[function(require,module,exports){ | |
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof define&&define.amd?define(["./core"],t):t(e.CryptoJS)}(this,function(e){var t,r,o,s,n,i,a;return r=(t=e).lib,o=r.WordArray,s=r.Hasher,n=t.algo,i=[],a=n.SHA1=s.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,o=r[0],s=r[1],n=r[2],a=r[3],h=r[4],c=0;c<80;c++){if(c<16)i[c]=0|e[t+c];else{var f=i[c-3]^i[c-8]^i[c-14]^i[c-16];i[c]=f<<1|f>>>31}var l=(o<<5|o>>>27)+h+i[c];l+=c<20?1518500249+(s&n|~s&a):c<40?1859775393+(s^n^a):c<60?(s&n|s&a|n&a)-1894007588:(s^n^a)-899497514,h=a,a=n,n=s<<30|s>>>2,s=o,o=l}r[0]=r[0]+o|0,r[1]=r[1]+s|0,r[2]=r[2]+n|0,r[3]=r[3]+a|0,r[4]=r[4]+h|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(o+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=s._createHelper(a),t.HmacSHA1=s._createHmacHelper(a),e.SHA1}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha224.js":[function(require,module,exports){ | |
!function(e,r,t){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],r):r(e.CryptoJS)}(this,function(e){var r,t,i,n,o;return t=(r=e).lib.WordArray,i=r.algo,n=i.SHA256,o=i.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=n._createHelper(o),r.HmacSHA224=n._createHmacHelper(o),e.SHA224}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./sha256":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha256.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha256.js":[function(require,module,exports){ | |
!function(e,t){"object"==typeof exports?module.exports=exports=t(require("./core")):"function"==typeof define&&define.amd?define(["./core"],t):t(e.CryptoJS)}(this,function(e){return function(t){var r=e,i=r.lib,o=i.WordArray,n=i.Hasher,s=r.algo,a=[],c=[];!function(){function isPrime(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function getFractionalBits(e){return 4294967296*(e-(0|e))|0}for(var e=2,r=0;r<64;)isPrime(e)&&(r<8&&(a[r]=getFractionalBits(t.pow(e,.5))),c[r]=getFractionalBits(t.pow(e,1/3)),r++),e++}();var f=[],h=s.SHA256=n.extend({_doReset:function(){this._hash=new o.init(a.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],o=r[1],n=r[2],s=r[3],a=r[4],h=r[5],l=r[6],u=r[7],d=0;d<64;d++){if(d<16)f[d]=0|e[t+d];else{var _=f[d-15],p=(_<<25|_>>>7)^(_<<14|_>>>18)^_>>>3,v=f[d-2],H=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;f[d]=p+f[d-7]+H+f[d-16]}var g=i&o^i&n^o&n,y=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),B=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&h^~a&l)+c[d]+f[d];u=l,l=h,h=a,a=s+B|0,s=n,n=o,o=i,i=B+(y+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+o|0,r[2]=r[2]+n|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+h|0,r[6]=r[6]+l|0,r[7]=r[7]+u|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,o=8*e.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=t.floor(i/4294967296),r[15+(o+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=n._createHelper(h),r.HmacSHA256=n._createHmacHelper(h)}(Math),e.SHA256}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha3.js":[function(require,module,exports){ | |
!function(r,o,e){"object"==typeof exports?module.exports=exports=o(require("./core"),require("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],o):o(r.CryptoJS)}(this,function(r){return function(o){var e=r,t=e.lib,i=t.WordArray,h=t.Hasher,a=e.x64.Word,n=e.algo,f=[],s=[],c=[];!function(){for(var r=1,o=0,e=0;e<24;e++){f[r+5*o]=(e+1)*(e+2)/2%64;var t=(2*r+3*o)%5;r=o%5,o=t}for(r=0;r<5;r++)for(o=0;o<5;o++)s[r+5*o]=o+(2*r+3*o)%5*5;for(var i=1,h=0;h<24;h++){for(var n=0,l=0,g=0;g<7;g++){if(1&i){var v=(1<<g)-1;v<32?l^=1<<v:n^=1<<v-32}128&i?i=i<<1^113:i<<=1}c[h]=a.create(n,l)}}();var l=[];!function(){for(var r=0;r<25;r++)l[r]=a.create()}();var g=n.SHA3=h.extend({cfg:h.cfg.extend({outputLength:512}),_doReset:function(){for(var r=this._state=[],o=0;o<25;o++)r[o]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(r,o){for(var e=this._state,t=this.blockSize/2,i=0;i<t;i++){var h=r[o+2*i],a=r[o+2*i+1];h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=e[i]).high^=a,B.low^=h}for(var n=0;n<24;n++){for(var g=0;g<5;g++){for(var v=0,u=0,w=0;w<5;w++){v^=(B=e[g+5*w]).high,u^=B.low}var d=l[g];d.high=v,d.low=u}for(g=0;g<5;g++){var p=l[(g+4)%5],_=l[(g+1)%5],H=_.high,x=_.low;for(v=p.high^(H<<1|x>>>31),u=p.low^(x<<1|H>>>31),w=0;w<5;w++){(B=e[g+5*w]).high^=v,B.low^=u}}for(var S=1;S<25;S++){var y=(B=e[S]).high,b=B.low,A=f[S];if(A<32)v=y<<A|b>>>32-A,u=b<<A|y>>>32-A;else v=b<<A-32|y>>>64-A,u=y<<A-32|b>>>64-A;var k=l[s[S]];k.high=v,k.low=u}var m=l[0],z=e[0];m.high=z.high,m.low=z.low;for(g=0;g<5;g++)for(w=0;w<5;w++){var B=e[S=g+5*w],L=l[S],q=l[(g+1)%5+5*w],W=l[(g+2)%5+5*w];B.high=L.high^~q.high&W.high,B.low=L.low^~q.low&W.low}B=e[0];var j=c[n];B.high^=j.high,B.low^=j.low}},_doFinalize:function(){var r=this._data,e=r.words,t=(this._nDataBytes,8*r.sigBytes),h=32*this.blockSize;e[t>>>5]|=1<<24-t%32,e[(o.ceil((t+1)/h)*h>>>5)-1]|=128,r.sigBytes=4*e.length,this._process();for(var a=this._state,n=this.cfg.outputLength/8,f=n/8,s=[],c=0;c<f;c++){var l=a[c],g=l.high,v=l.low;g=16711935&(g<<8|g>>>24)|4278255360&(g<<24|g>>>8),v=16711935&(v<<8|v>>>24)|4278255360&(v<<24|v>>>8),s.push(v),s.push(g)}return new i.init(s,n)},clone:function(){for(var r=h.clone.call(this),o=r._state=this._state.slice(0),e=0;e<25;e++)o[e]=o[e].clone();return r}});e.SHA3=h._createHelper(g),e.HmacSHA3=h._createHmacHelper(g)}(Math),r.SHA3}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./x64-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/x64-core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha384.js":[function(require,module,exports){ | |
!function(e,i,n){"object"==typeof exports?module.exports=exports=i(require("./core"),require("./x64-core"),require("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],i):i(e.CryptoJS)}(this,function(e){var i,n,t,r,o,a,c;return n=(i=e).x64,t=n.Word,r=n.WordArray,o=i.algo,a=o.SHA512,c=o.SHA384=a.extend({_doReset:function(){this._hash=new r.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=16,e}}),i.SHA384=a._createHelper(c),i.HmacSHA384=a._createHmacHelper(c),e.SHA384}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./sha512":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha512.js","./x64-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/x64-core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/sha512.js":[function(require,module,exports){ | |
!function(e,r,o){"object"==typeof exports?module.exports=exports=r(require("./core"),require("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],r):r(e.CryptoJS)}(this,function(e){return function(){var r=e,o=r.lib.Hasher,t=r.x64,a=t.Word,c=t.WordArray,d=r.algo;function X64Word_create(){return a.create.apply(a,arguments)}var _=[X64Word_create(1116352408,3609767458),X64Word_create(1899447441,602891725),X64Word_create(3049323471,3964484399),X64Word_create(3921009573,2173295548),X64Word_create(961987163,4081628472),X64Word_create(1508970993,3053834265),X64Word_create(2453635748,2937671579),X64Word_create(2870763221,3664609560),X64Word_create(3624381080,2734883394),X64Word_create(310598401,1164996542),X64Word_create(607225278,1323610764),X64Word_create(1426881987,3590304994),X64Word_create(1925078388,4068182383),X64Word_create(2162078206,991336113),X64Word_create(2614888103,633803317),X64Word_create(3248222580,3479774868),X64Word_create(3835390401,2666613458),X64Word_create(4022224774,944711139),X64Word_create(264347078,2341262773),X64Word_create(604807628,2007800933),X64Word_create(770255983,1495990901),X64Word_create(1249150122,1856431235),X64Word_create(1555081692,3175218132),X64Word_create(1996064986,2198950837),X64Word_create(2554220882,3999719339),X64Word_create(2821834349,766784016),X64Word_create(2952996808,2566594879),X64Word_create(3210313671,3203337956),X64Word_create(3336571891,1034457026),X64Word_create(3584528711,2466948901),X64Word_create(113926993,3758326383),X64Word_create(338241895,168717936),X64Word_create(666307205,1188179964),X64Word_create(773529912,1546045734),X64Word_create(1294757372,1522805485),X64Word_create(1396182291,2643833823),X64Word_create(1695183700,2343527390),X64Word_create(1986661051,1014477480),X64Word_create(2177026350,1206759142),X64Word_create(2456956037,344077627),X64Word_create(2730485921,1290863460),X64Word_create(2820302411,3158454273),X64Word_create(3259730800,3505952657),X64Word_create(3345764771,106217008),X64Word_create(3516065817,3606008344),X64Word_create(3600352804,1432725776),X64Word_create(4094571909,1467031594),X64Word_create(275423344,851169720),X64Word_create(430227734,3100823752),X64Word_create(506948616,1363258195),X64Word_create(659060556,3750685593),X64Word_create(883997877,3785050280),X64Word_create(958139571,3318307427),X64Word_create(1322822218,3812723403),X64Word_create(1537002063,2003034995),X64Word_create(1747873779,3602036899),X64Word_create(1955562222,1575990012),X64Word_create(2024104815,1125592928),X64Word_create(2227730452,2716904306),X64Word_create(2361852424,442776044),X64Word_create(2428436474,593698344),X64Word_create(2756734187,3733110249),X64Word_create(3204031479,2999351573),X64Word_create(3329325298,3815920427),X64Word_create(3391569614,3928383900),X64Word_create(3515267271,566280711),X64Word_create(3940187606,3454069534),X64Word_create(4118630271,4000239992),X64Word_create(116418474,1914138554),X64Word_create(174292421,2731055270),X64Word_create(289380356,3203993006),X64Word_create(460393269,320620315),X64Word_create(685471733,587496836),X64Word_create(852142971,1086792851),X64Word_create(1017036298,365543100),X64Word_create(1126000580,2618297676),X64Word_create(1288033470,3409855158),X64Word_create(1501505948,4234509866),X64Word_create(1607167915,987167468),X64Word_create(1816402316,1246189591)],W=[];!function(){for(var e=0;e<80;e++)W[e]=X64Word_create()}();var X=d.SHA512=o.extend({_doReset:function(){this._hash=new c.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(e,r){for(var o=this._hash.words,t=o[0],a=o[1],c=o[2],d=o[3],X=o[4],i=o[5],h=o[6],n=o[7],l=t.high,w=t.low,s=a.high,g=a.low,f=c.high,u=c.low,p=d.high,v=d.low,H=X.high,y=X.low,x=i.high,S=i.low,A=h.high,m=h.low,B=n.high,b=n.low,k=l,q=w,z=s,j=g,C=f,D=u,F=p,J=v,M=H,P=y,R=x,E=S,G=A,I=m,K=B,L=b,N=0;N<80;N++){var O=W[N];if(N<16)var Q=O.high=0|e[r+2*N],T=O.low=0|e[r+2*N+1];else{var U=W[N-15],V=U.high,Y=U.low,Z=(V>>>1|Y<<31)^(V>>>8|Y<<24)^V>>>7,$=(Y>>>1|V<<31)^(Y>>>8|V<<24)^(Y>>>7|V<<25),ee=W[N-2],re=ee.high,oe=ee.low,te=(re>>>19|oe<<13)^(re<<3|oe>>>29)^re>>>6,ae=(oe>>>19|re<<13)^(oe<<3|re>>>29)^(oe>>>6|re<<26),ce=W[N-7],de=ce.high,_e=ce.low,We=W[N-16],Xe=We.high,ie=We.low;Q=(Q=(Q=Z+de+((T=$+_e)>>>0<$>>>0?1:0))+te+((T=T+ae)>>>0<ae>>>0?1:0))+Xe+((T=T+ie)>>>0<ie>>>0?1:0);O.high=Q,O.low=T}var he,ne=M&R^~M&G,le=P&E^~P&I,we=k&z^k&C^z&C,se=q&j^q&D^j&D,ge=(k>>>28|q<<4)^(k<<30|q>>>2)^(k<<25|q>>>7),fe=(q>>>28|k<<4)^(q<<30|k>>>2)^(q<<25|k>>>7),ue=(M>>>14|P<<18)^(M>>>18|P<<14)^(M<<23|P>>>9),pe=(P>>>14|M<<18)^(P>>>18|M<<14)^(P<<23|M>>>9),ve=_[N],He=ve.high,ye=ve.low,xe=K+ue+((he=L+pe)>>>0<L>>>0?1:0),Se=fe+se;K=G,L=I,G=R,I=E,R=M,E=P,M=F+(xe=(xe=(xe=xe+ne+((he=he+le)>>>0<le>>>0?1:0))+He+((he=he+ye)>>>0<ye>>>0?1:0))+Q+((he=he+T)>>>0<T>>>0?1:0))+((P=J+he|0)>>>0<J>>>0?1:0)|0,F=C,J=D,C=z,D=j,z=k,j=q,k=xe+(ge+we+(Se>>>0<fe>>>0?1:0))+((q=he+Se|0)>>>0<he>>>0?1:0)|0}w=t.low=w+q,t.high=l+k+(w>>>0<q>>>0?1:0),g=a.low=g+j,a.high=s+z+(g>>>0<j>>>0?1:0),u=c.low=u+D,c.high=f+C+(u>>>0<D>>>0?1:0),v=d.low=v+J,d.high=p+F+(v>>>0<J>>>0?1:0),y=X.low=y+P,X.high=H+M+(y>>>0<P>>>0?1:0),S=i.low=S+E,i.high=x+R+(S>>>0<E>>>0?1:0),m=h.low=m+I,h.high=A+G+(m>>>0<I>>>0?1:0),b=n.low=b+L,n.high=B+K+(b>>>0<L>>>0?1:0)},_doFinalize:function(){var e=this._data,r=e.words,o=8*this._nDataBytes,t=8*e.sigBytes;return r[t>>>5]|=128<<24-t%32,r[30+(t+128>>>10<<5)]=Math.floor(o/4294967296),r[31+(t+128>>>10<<5)]=o,e.sigBytes=4*r.length,this._process(),this._hash.toX32()},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});r.SHA512=o._createHelper(X),r.HmacSHA512=o._createHmacHelper(X)}(),e.SHA512}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./x64-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/x64-core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/tripledes.js":[function(require,module,exports){ | |
!function(e,c,t){"object"==typeof exports?module.exports=exports=c(require("./core"),require("./enc-base64"),require("./md5"),require("./evpkdf"),require("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],c):c(e.CryptoJS)}(this,function(e){return function(){var c=e,t=c.lib,r=t.WordArray,i=t.BlockCipher,o=c.algo,l=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],n=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],a=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],k=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,c=[],t=0;t<56;t++){var r=l[t]-1;c[t]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var n=i[o]=[],a=h[o];for(t=0;t<24;t++)n[t/6|0]|=c[(s[t]-1+a)%28]<<31-t%6,n[4+(t/6|0)]|=c[28+(s[t+24]-1+a)%28]<<31-t%6;n[0]=n[0]<<1|n[0]>>>31;for(t=1;t<7;t++)n[t]=n[t]>>>4*(t-1)+3;n[7]=n[7]<<5|n[7]>>>27}var k=this._invSubKeys=[];for(t=0;t<16;t++)k[t]=i[15-t]},encryptBlock:function(e,c){this._doCryptBlock(e,c,this._subKeys)},decryptBlock:function(e,c){this._doCryptBlock(e,c,this._invSubKeys)},_doCryptBlock:function(e,c,t){this._lBlock=e[c],this._rBlock=e[c+1],exchangeLR.call(this,4,252645135),exchangeLR.call(this,16,65535),exchangeRL.call(this,2,858993459),exchangeRL.call(this,8,16711935),exchangeLR.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=t[r],o=this._lBlock,l=this._rBlock,s=0,h=0;h<8;h++)s|=n[h][((l^i[h])&a[h])>>>0];this._lBlock=l,this._rBlock=o^s}var k=this._lBlock;this._lBlock=this._rBlock,this._rBlock=k,exchangeLR.call(this,1,1431655765),exchangeRL.call(this,8,16711935),exchangeRL.call(this,2,858993459),exchangeLR.call(this,16,65535),exchangeLR.call(this,4,252645135),e[c]=this._lBlock,e[c+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function exchangeLR(e,c){var t=(this._lBlock>>>e^this._rBlock)&c;this._rBlock^=t,this._lBlock^=t<<e}function exchangeRL(e,c){var t=(this._rBlock>>>e^this._lBlock)&c;this._lBlock^=t,this._rBlock^=t<<e}c.DES=i._createHelper(k);var _=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=k.createEncryptor(r.create(e.slice(0,2))),this._des2=k.createEncryptor(r.create(e.slice(2,4))),this._des3=k.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,c){this._des1.encryptBlock(e,c),this._des2.decryptBlock(e,c),this._des3.encryptBlock(e,c)},decryptBlock:function(e,c){this._des3.decryptBlock(e,c),this._des2.encryptBlock(e,c),this._des1.decryptBlock(e,c)},keySize:6,ivSize:2,blockSize:2});c.TripleDES=i._createHelper(_)}(),e.TripleDES}); | |
},{"./cipher-core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/cipher-core.js","./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js","./enc-base64":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/enc-base64.js","./evpkdf":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/evpkdf.js","./md5":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/md5.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/x64-core.js":[function(require,module,exports){ | |
!function(t,e){"object"==typeof exports?module.exports=exports=e(require("./core")):"function"==typeof define&&define.amd?define(["./core"],e):e(t.CryptoJS)}(this,function(t){var e,o,r,n,i;return o=(e=t).lib,r=o.Base,n=o.WordArray,(i=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),i.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,o=[],r=0;r<e;r++){var i=t[r];o.push(i.high),o.push(i.low)}return n.create(o,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),o=e.length,n=0;n<o;n++)e[n]=e[n].clone();return t}}),t}); | |
},{"./core":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-js/core.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des.js":[function(require,module,exports){ | |
"use strict";exports.utils=require("./des/utils"),exports.Cipher=require("./des/cipher"),exports.DES=require("./des/des"),exports.CBC=require("./des/cbc"),exports.EDE=require("./des/ede"); | |
},{"./des/cbc":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cbc.js","./des/cipher":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cipher.js","./des/des":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/des.js","./des/ede":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/ede.js","./des/utils":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cbc.js":[function(require,module,exports){ | |
"use strict";var assert=require("minimalistic-assert"),inherits=require("inherits"),proto={};function CBCState(t){assert.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var i=0;i<this.iv.length;i++)this.iv[i]=t[i]}function instantiate(t){function CBC(i){t.call(this,i),this._cbcInit()}inherits(CBC,t);for(var i=Object.keys(proto),e=0;e<i.length;e++){var r=i[e];CBC.prototype[r]=proto[r]}return CBC.create=function create(t){return new CBC(t)},CBC}exports.instantiate=instantiate,proto._cbcInit=function _cbcInit(){var t=new CBCState(this.options.iv);this._cbcState=t},proto._update=function _update(t,i,e,r){var n=this._cbcState,s=this.constructor.super_.prototype,o=n.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=t[i+a];s._update.call(this,o,0,e,r);for(a=0;a<this.blockSize;a++)o[a]=e[r+a]}else{s._update.call(this,t,i,e,r);for(a=0;a<this.blockSize;a++)e[r+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=t[i+a]}}; | |
},{"inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cipher.js":[function(require,module,exports){ | |
"use strict";var assert=require("minimalistic-assert");function Cipher(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}module.exports=Cipher,Cipher.prototype._init=function _init(){},Cipher.prototype.update=function update(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},Cipher.prototype._buffer=function _buffer(t,e){for(var r=Math.min(this.buffer.length-this.bufferOff,t.length-e),f=0;f<r;f++)this.buffer[this.bufferOff+f]=t[e+f];return this.bufferOff+=r,r},Cipher.prototype._flushBuffer=function _flushBuffer(t,e){return this._update(this.buffer,0,t,e),this.bufferOff=0,this.blockSize},Cipher.prototype._updateEncrypt=function _updateEncrypt(t){var e=0,r=0,f=(this.bufferOff+t.length)/this.blockSize|0,i=new Array(f*this.blockSize);0!==this.bufferOff&&(e+=this._buffer(t,e),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(i,r)));for(var h=t.length-(t.length-e)%this.blockSize;e<h;e+=this.blockSize)this._update(t,e,i,r),r+=this.blockSize;for(;e<t.length;e++,this.bufferOff++)this.buffer[this.bufferOff]=t[e];return i},Cipher.prototype._updateDecrypt=function _updateDecrypt(t){for(var e=0,r=0,f=Math.ceil((this.bufferOff+t.length)/this.blockSize)-1,i=new Array(f*this.blockSize);f>0;f--)e+=this._buffer(t,e),r+=this._flushBuffer(i,r);return e+=this._buffer(t,e),i},Cipher.prototype.final=function final(t){var e,r;return t&&(e=this.update(t)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(r):r},Cipher.prototype._pad=function _pad(t,e){if(0===e)return!1;for(;e<t.length;)t[e++]=0;return!0},Cipher.prototype._finalEncrypt=function _finalEncrypt(){if(!this._pad(this.buffer,this.bufferOff))return[];var t=new Array(this.blockSize);return this._update(this.buffer,0,t,0),t},Cipher.prototype._unpad=function _unpad(t){return t},Cipher.prototype._finalDecrypt=function _finalDecrypt(){assert.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var t=new Array(this.blockSize);return this._flushBuffer(t,0),this._unpad(t)}; | |
},{"minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/des.js":[function(require,module,exports){ | |
"use strict";var assert=require("minimalistic-assert"),inherits=require("inherits"),utils=require("./utils"),Cipher=require("./cipher");function DESState(){this.tmp=new Array(2),this.keys=null}function DES(t){Cipher.call(this,t);var e=new DESState;this._desState=e,this.deriveKeys(e,t.key)}inherits(DES,Cipher),module.exports=DES,DES.create=function create(t){return new DES(t)};var shiftTable=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES.prototype.deriveKeys=function deriveKeys(t,e){t.keys=new Array(32),assert.equal(e.length,this.blockSize,"Invalid key length");var r=utils.readUInt32BE(e,0),i=utils.readUInt32BE(e,4);utils.pc1(r,i,t.tmp,0),r=t.tmp[0],i=t.tmp[1];for(var s=0;s<t.keys.length;s+=2){var p=shiftTable[s>>>1];r=utils.r28shl(r,p),i=utils.r28shl(i,p),utils.pc2(r,i,t.keys,s)}},DES.prototype._update=function _update(t,e,r,i){var s=this._desState,p=utils.readUInt32BE(t,e),n=utils.readUInt32BE(t,e+4);utils.ip(p,n,s.tmp,0),p=s.tmp[0],n=s.tmp[1],"encrypt"===this.type?this._encrypt(s,p,n,s.tmp,0):this._decrypt(s,p,n,s.tmp,0),p=s.tmp[0],n=s.tmp[1],utils.writeUInt32BE(r,p,i),utils.writeUInt32BE(r,n,i+4)},DES.prototype._pad=function _pad(t,e){for(var r=t.length-e,i=e;i<t.length;i++)t[i]=r;return!0},DES.prototype._unpad=function _unpad(t){for(var e=t[t.length-1],r=t.length-e;r<t.length;r++)assert.equal(t[r],e);return t.slice(0,t.length-e)},DES.prototype._encrypt=function _encrypt(t,e,r,i,s){for(var p=e,n=r,u=0;u<t.keys.length;u+=2){var l=t.keys[u],a=t.keys[u+1];utils.expand(n,t.tmp,0),l^=t.tmp[0],a^=t.tmp[1];var h=utils.substitute(l,a),y=n;n=(p^utils.permute(h))>>>0,p=y}utils.rip(n,p,i,s)},DES.prototype._decrypt=function _decrypt(t,e,r,i,s){for(var p=r,n=e,u=t.keys.length-2;u>=0;u-=2){var l=t.keys[u],a=t.keys[u+1];utils.expand(p,t.tmp,0),l^=t.tmp[0],a^=t.tmp[1];var h=utils.substitute(l,a),y=p;p=(n^utils.permute(h))>>>0,n=y}utils.rip(p,n,i,s)}; | |
},{"./cipher":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cipher.js","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/utils.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/ede.js":[function(require,module,exports){ | |
"use strict";var assert=require("minimalistic-assert"),inherits=require("inherits"),Cipher=require("./cipher"),DES=require("./des");function EDEState(e,t){assert.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),p=t.slice(8,16),i=t.slice(16,24);this.ciphers="encrypt"===e?[DES.create({type:"encrypt",key:r}),DES.create({type:"decrypt",key:p}),DES.create({type:"encrypt",key:i})]:[DES.create({type:"decrypt",key:i}),DES.create({type:"encrypt",key:p}),DES.create({type:"decrypt",key:r})]}function EDE(e){Cipher.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}inherits(EDE,Cipher),module.exports=EDE,EDE.create=function create(e){return new EDE(e)},EDE.prototype._update=function _update(e,t,r,p){var i=this._edeState;i.ciphers[0]._update(e,t,r,p),i.ciphers[1]._update(r,p,r,p),i.ciphers[2]._update(r,p,r,p)},EDE.prototype._pad=DES.prototype._pad,EDE.prototype._unpad=DES.prototype._unpad; | |
},{"./cipher":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/cipher.js","./des":"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/des.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/des.js/lib/des/utils.js":[function(require,module,exports){ | |
"use strict";exports.readUInt32BE=function readUInt32BE(r,t){return(r[0+t]<<24|r[1+t]<<16|r[2+t]<<8|r[3+t])>>>0},exports.writeUInt32BE=function writeUInt32BE(r,t,e){r[0+e]=t>>>24,r[1+e]=t>>>16&255,r[2+e]=t>>>8&255,r[3+e]=255&t},exports.ip=function ip(r,t,e,o){for(var n=0,f=0,p=6;p>=0;p-=2){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>>a+p&1;for(a=0;a<=24;a+=8)n<<=1,n|=r>>>a+p&1}for(p=6;p>=0;p-=2){for(a=1;a<=25;a+=8)f<<=1,f|=t>>>a+p&1;for(a=1;a<=25;a+=8)f<<=1,f|=r>>>a+p&1}e[o+0]=n>>>0,e[o+1]=f>>>0},exports.rip=function rip(r,t,e,o){for(var n=0,f=0,p=0;p<4;p++)for(var a=24;a>=0;a-=8)n<<=1,n|=t>>>a+p&1,n<<=1,n|=r>>>a+p&1;for(p=4;p<8;p++)for(a=24;a>=0;a-=8)f<<=1,f|=t>>>a+p&1,f<<=1,f|=r>>>a+p&1;e[o+0]=n>>>0,e[o+1]=f>>>0},exports.pc1=function pc1(r,t,e,o){for(var n=0,f=0,p=7;p>=5;p--){for(var a=0;a<=24;a+=8)n<<=1,n|=t>>a+p&1;for(a=0;a<=24;a+=8)n<<=1,n|=r>>a+p&1}for(a=0;a<=24;a+=8)n<<=1,n|=t>>a+p&1;for(p=1;p<=3;p++){for(a=0;a<=24;a+=8)f<<=1,f|=t>>a+p&1;for(a=0;a<=24;a+=8)f<<=1,f|=r>>a+p&1}for(a=0;a<=24;a+=8)f<<=1,f|=r>>a+p&1;e[o+0]=n>>>0,e[o+1]=f>>>0},exports.r28shl=function r28shl(r,t){return r<<t&268435455|r>>>28-t};var pc2table=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];exports.pc2=function pc2(r,t,e,o){for(var n=0,f=0,p=pc2table.length>>>1,a=0;a<p;a++)n<<=1,n|=r>>>pc2table[a]&1;for(a=p;a<pc2table.length;a++)f<<=1,f|=t>>>pc2table[a]&1;e[o+0]=n>>>0,e[o+1]=f>>>0},exports.expand=function expand(r,t,e){var o=0,n=0;o=(1&r)<<5|r>>>27;for(var f=23;f>=15;f-=4)o<<=6,o|=r>>>f&63;for(f=11;f>=3;f-=4)n|=r>>>f&63,n<<=6;n|=(31&r)<<1|r>>>31,t[e+0]=o>>>0,t[e+1]=n>>>0};var sTable=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];exports.substitute=function substitute(r,t){for(var e=0,o=0;o<4;o++){e<<=4,e|=sTable[64*o+(r>>>18-6*o&63)]}for(o=0;o<4;o++){e<<=4,e|=sTable[256+64*o+(t>>>18-6*o&63)]}return e>>>0};var permuteTable=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];exports.permute=function permute(r){for(var t=0,e=0;e<permuteTable.length;e++)t<<=1,t|=r>>>permuteTable[e]&1;return t>>>0},exports.padSplit=function padSplit(r,t,e){for(var o=r.toString(2);o.length<t;)o="0"+o;for(var n=[],f=0;f<t;f+=e)n.push(o.slice(f,f+e));return n.join(" ")}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/browser.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var generatePrime=require("./lib/generatePrime"),primes=require("./lib/primes.json"),DH=require("./lib/dh");function getDiffieHellman(e){var r=new Buffer(primes[e].prime,"hex"),f=new Buffer(primes[e].gen,"hex");return new DH(r,f)}var ENCODINGS={binary:!0,hex:!0,base64:!0};function createDiffieHellman(e,r,f,i){return Buffer.isBuffer(r)||void 0===ENCODINGS[r]?createDiffieHellman(e,"binary",r,f):(r=r||"binary",i=i||"binary",f=f||new Buffer([2]),Buffer.isBuffer(f)||(f=new Buffer(f,i)),"number"==typeof e?new DH(generatePrime(e,f),f,!0):(Buffer.isBuffer(e)||(e=new Buffer(e,r)),new DH(e,f,!0)))}exports.DiffieHellmanGroup=exports.createDiffieHellmanGroup=exports.getDiffieHellman=getDiffieHellman,exports.createDiffieHellman=exports.DiffieHellman=createDiffieHellman; | |
}).call(this,require("buffer").Buffer) | |
},{"./lib/dh":"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/dh.js","./lib/generatePrime":"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/generatePrime.js","./lib/primes.json":"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/primes.json","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/dh.js":[function(require,module,exports){ | |
(function (Buffer){ | |
var BN=require("bn.js"),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,TWENTYFOUR=new BN(24),ELEVEN=new BN(11),TEN=new BN(10),THREE=new BN(3),SEVEN=new BN(7),primes=require("./generatePrime"),randomBytes=require("randombytes");function setPublicKey(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this._pub=new BN(e),this}function setPrivateKey(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this._priv=new BN(e),this}module.exports=DH;var primeCache={};function checkPrime(e,r){var t=r.toString("hex"),i=[t,e.toString(16)].join("_");if(i in primeCache)return primeCache[i];var n,u=0;if(e.isEven()||!primes.simpleSieve||!primes.fermatTest(e)||!millerRabin.test(e))return u+=1,u+="02"===t||"05"===t?8:4,primeCache[i]=u,u;switch(millerRabin.test(e.shrn(1))||(u+=2),t){case"02":e.mod(TWENTYFOUR).cmp(ELEVEN)&&(u+=8);break;case"05":(n=e.mod(TEN)).cmp(THREE)&&n.cmp(SEVEN)&&(u+=8);break;default:u+=4}return primeCache[i]=u,u}function DH(e,r,t){this.setGenerator(r),this.__prime=new BN(e),this._prime=BN.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,t?(this.setPublicKey=setPublicKey,this.setPrivateKey=setPrivateKey):this._primeCode=8}function formatReturnValue(e,r){var t=new Buffer(e.toArray());return r?t.toString(r):t}Object.defineProperty(DH.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=checkPrime(this.__prime,this.__gen)),this._primeCode}}),DH.prototype.generateKeys=function(){return this._priv||(this._priv=new BN(randomBytes(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},DH.prototype.computeSecret=function(e){var r=(e=(e=new BN(e)).toRed(this._prime)).redPow(this._priv).fromRed(),t=new Buffer(r.toArray()),i=this.getPrime();if(t.length<i.length){var n=new Buffer(i.length-t.length);n.fill(0),t=Buffer.concat([n,t])}return t},DH.prototype.getPublicKey=function getPublicKey(e){return formatReturnValue(this._pub,e)},DH.prototype.getPrivateKey=function getPrivateKey(e){return formatReturnValue(this._priv,e)},DH.prototype.getPrime=function(e){return formatReturnValue(this.__prime,e)},DH.prototype.getGenerator=function(e){return formatReturnValue(this._gen,e)},DH.prototype.setGenerator=function(e,r){return r=r||"utf8",Buffer.isBuffer(e)||(e=new Buffer(e,r)),this.__gen=e,this._gen=new BN(e),this}; | |
}).call(this,require("buffer").Buffer) | |
},{"./generatePrime":"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/generatePrime.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","miller-rabin":"/Users/lentan/repo/torus/torus-embed/node_modules/miller-rabin/lib/mr.js","randombytes":"/Users/lentan/repo/torus/torus-embed/node_modules/randombytes/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/generatePrime.js":[function(require,module,exports){ | |
var randomBytes=require("randombytes");module.exports=findPrime,findPrime.simpleSieve=simpleSieve,findPrime.fermatTest=fermatTest;var BN=require("bn.js"),TWENTYFOUR=new BN(24),MillerRabin=require("miller-rabin"),millerRabin=new MillerRabin,ONE=new BN(1),TWO=new BN(2),FIVE=new BN(5),SIXTEEN=new BN(16),EIGHT=new BN(8),TEN=new BN(10),THREE=new BN(3),SEVEN=new BN(7),ELEVEN=new BN(11),FOUR=new BN(4),TWELVE=new BN(12),primes=null;function _getPrimes(){if(null!==primes)return primes;var e=[];e[0]=2;for(var r=1,i=3;i<1048576;i+=2){for(var n=Math.ceil(Math.sqrt(i)),t=0;t<r&&e[t]<=n&&i%e[t]!=0;t++);r!==t&&e[t]<=n||(e[r++]=i)}return primes=e,e}function simpleSieve(e){for(var r=_getPrimes(),i=0;i<r.length;i++)if(0===e.modn(r[i]))return 0===e.cmpn(r[i]);return!0}function fermatTest(e){var r=BN.mont(e);return 0===TWO.toRed(r).redPow(e.subn(1)).fromRed().cmpn(1)}function findPrime(e,r){if(e<16)return new BN(2===r||5===r?[140,123]:[140,39]);var i,n;for(r=new BN(r);;){for(i=new BN(randomBytes(Math.ceil(e/8)));i.bitLength()>e;)i.ishrn(1);if(i.isEven()&&i.iadd(ONE),i.testn(1)||i.iadd(TWO),r.cmp(TWO)){if(!r.cmp(FIVE))for(;i.mod(TEN).cmp(THREE);)i.iadd(FOUR)}else for(;i.mod(TWENTYFOUR).cmp(ELEVEN);)i.iadd(FOUR);if(simpleSieve(n=i.shrn(1))&&simpleSieve(i)&&fermatTest(n)&&fermatTest(i)&&millerRabin.test(n)&&millerRabin.test(i))return i}} | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","miller-rabin":"/Users/lentan/repo/torus/torus-embed/node_modules/miller-rabin/lib/mr.js","randombytes":"/Users/lentan/repo/torus/torus-embed/node_modules/randombytes/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/diffie-hellman/lib/primes.json":[function(require,module,exports){ | |
module.exports={ | |
"modp1": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff" | |
}, | |
"modp2": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff" | |
}, | |
"modp5": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff" | |
}, | |
"modp14": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff" | |
}, | |
"modp15": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff" | |
}, | |
"modp16": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff" | |
}, | |
"modp17": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff" | |
}, | |
"modp18": { | |
"gen": "02", | |
"prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" | |
} | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/browser.js":[function(require,module,exports){ | |
(function (global,Buffer){ | |
"use strict";var EC=require("elliptic").ec,ec=new EC("secp256k1"),browserCrypto=global.crypto||global.msCrypto||{},subtle=browserCrypto.subtle||browserCrypto.webkitSubtle,nodeCrypto=require("crypto");const EC_GROUP_ORDER=Buffer.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),ZERO32=Buffer.alloc(32,0);function assert(e,r){if(!e)throw new Error(r||"Assertion failed")}function isScalar(e){return Buffer.isBuffer(e)&&32===e.length}function isValidPrivateKey(e){return!!isScalar(e)&&(e.compare(ZERO32)>0&&e.compare(EC_GROUP_ORDER)<0)}function equalConstTime(e,r){if(e.length!==r.length)return!1;for(var t=0,n=0;n<e.length;n++)t|=e[n]^r[n];return 0===t}function randomBytes(e){var r=new Uint8Array(e);return void 0===browserCrypto.getRandomValues?Buffer.from(nodeCrypto.randomBytes(e)):(browserCrypto.getRandomValues(r),Buffer.from(r))}function sha512(e){return new Promise(function(r){var t=nodeCrypto.createHash("sha512").update(e).digest();r(new Uint8Array(t))})}function getAes(e){return function(r,t,n){return new Promise(function(a){if(subtle){return subtle.importKey("raw",t,{name:"AES-CBC"},!1,[e]).then(function(t){var a={name:"AES-CBC",iv:r};return subtle[e](a,t,n)}).then(function(e){a(Buffer.from(new Uint8Array(e)))})}if("encrypt"===e){var i=nodeCrypto.createCipheriv("aes-256-cbc",t,r);i.update(n),a(i.final())}else if("decrypt"===e){var s=nodeCrypto.createDecipheriv("aes-256-cbc",t,r);s.update(n),a(s.final())}})}}var aesCbcEncrypt=getAes("encrypt"),aesCbcDecrypt=getAes("decrypt");function hmacSha256Sign(e,r){return new Promise(function(t){var n=nodeCrypto.createHmac("sha256",Buffer.from(e));n.update(r),t(n.digest())})}function hmacSha256Verify(e,r,t){return new Promise(function(n){var a=nodeCrypto.createHmac("sha256",Buffer.from(e));a.update(r),n(equalConstTime(a.digest(),t))})}exports.generatePrivate=function(){for(var e=randomBytes(32);!isValidPrivateKey(e);)e=randomBytes(32);return e};var getPublic=exports.getPublic=function(e){return assert(32===e.length,"Bad private key"),assert(isValidPrivateKey(e),"Bad private key"),Buffer.from(ec.keyFromPrivate(e).getPublic("arr"))},getPublicCompressed=exports.getPublicCompressed=function(e){assert(32===e.length,"Bad private key"),assert(isValidPrivateKey(e),"Bad private key");return Buffer.from(ec.keyFromPrivate(e).getPublic(!0,"arr"))};exports.sign=function(e,r){return new Promise(function(t){assert(32===e.length,"Bad private key"),assert(isValidPrivateKey(e),"Bad private key"),assert(r.length>0,"Message should not be empty"),assert(r.length<=32,"Message is too long"),t(Buffer.from(ec.sign(r,e,{canonical:!0}).toDER()))})},exports.verify=function(e,r,t){return new Promise(function(n,a){assert(65===e.length||33===e.length,"Bad public key"),65===e.length&&assert(4===e[0],"Bad public key"),33===e.length&&assert(2===e[0]||3===e[0],"Bad public key"),assert(r.length>0,"Message should not be empty"),assert(r.length<=32,"Message is too long"),ec.verify(r,t,e)?n(null):a(new Error("Bad signature"))})};var derive=exports.derive=function(e,r){return new Promise(function(t){assert(Buffer.isBuffer(e),"Bad private key"),assert(Buffer.isBuffer(r),"Bad public key"),assert(32===e.length,"Bad private key"),assert(isValidPrivateKey(e),"Bad private key"),assert(65===r.length||33===r.length,"Bad public key"),65===r.length&&assert(4===r[0],"Bad public key"),33===r.length&&assert(2===r[0]||3===r[0],"Bad public key");var n=ec.keyFromPrivate(e),a=ec.keyFromPublic(r),i=n.derive(a.getPublic());t(Buffer.from(i.toArray()))})};exports.encrypt=function(e,r,t){var n,a,i,s;return t=t||{},new Promise(function(r){for(var n=t.ephemPrivateKey||randomBytes(32);!isValidPrivateKey(n);)n=t.ephemPrivateKey||randomBytes(32);a=getPublic(n),r(derive(n,e))}).then(function(e){return sha512(e)}).then(function(e){n=t.iv||randomBytes(16);var a=e.slice(0,32);return s=e.slice(32),aesCbcEncrypt(n,a,r)}).then(function(e){i=e;var r=Buffer.concat([n,a,i]);return hmacSha256Sign(s,r)}).then(function(e){return{iv:n,ephemPublicKey:a,ciphertext:i,mac:e}})},exports.decrypt=function(e,r){var t;return derive(e,r.ephemPublicKey).then(function(e){return sha512(e)}).then(function(e){return t=e.slice(0,32),hmacSha256Verify(e.slice(32),Buffer.concat([r.iv,r.ephemPublicKey,r.ciphertext]),r.mac)}).then(function(e){return assert(e,"Bad MAC"),aesCbcDecrypt(r.iv,t,r.ciphertext)}).then(function(e){return Buffer.from(new Uint8Array(e))})}; | |
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js","crypto":"/Users/lentan/repo/torus/torus-embed/node_modules/crypto-browserify/index.js","elliptic":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic.js":[function(require,module,exports){ | |
"use strict";var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("brorand"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec"),elliptic.eddsa=require("./elliptic/eddsa"); | |
},{"../package.json":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/package.json","./elliptic/curve":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/index.js","./elliptic/curves":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curves.js","./elliptic/ec":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/index.js","./elliptic/eddsa":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/index.js","./elliptic/utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","brorand":"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/base.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;function BaseCurve(t,e){this.type=t,this.p=new BN(e.p,16),this.red=e.prime?BN.red(e.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=e.n&&new BN(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}module.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(t,e){assert(t.precomputed);var n=t._getDoubles(),r=getNAF(e,1),o=(1<<n.step+1)-(n.step%2==0?2:1);o/=3;for(var i=[],s=0;s<r.length;s+=n.step){var a=0;for(e=s+n.step-1;e>=s;e--)a=(a<<1)+r[e];i.push(a)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=o;p>0;p--){for(s=0;s<i.length;s++){(a=i[s])===p?d=d.mixedAdd(n.points[s]):a===-p&&(d=d.mixedAdd(n.points[s].neg()))}u=u.add(d)}return u.toP()},BaseCurve.prototype._wnafMul=function _wnafMul(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var o=r.points,i=getNAF(e,n),s=this.jpoint(null,null,null),a=i.length-1;a>=0;a--){for(e=0;a>=0&&0===i[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),a<0)break;var u=i[a];assert(0!==u),s="affine"===t.type?u>0?s.mixedAdd(o[u-1>>1]):s.mixedAdd(o[-u-1>>1].neg()):u>0?s.add(o[u-1>>1]):s.add(o[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(t,e,n,r,o){for(var i=this._wnafT1,s=this._wnafT2,a=this._wnafT3,u=0,d=0;d<r;d++){var p=(b=e[d])._getNAFPoints(t);i[d]=p.wnd,s[d]=p.points}for(d=r-1;d>=1;d-=2){var l=d-1,h=d;if(1===i[l]&&1===i[h]){var f=[e[l],null,null,e[h]];0===e[l].y.cmp(e[h].y)?(f[1]=e[l].add(e[h]),f[2]=e[l].toJ().mixedAdd(e[h].neg())):0===e[l].y.cmp(e[h].y.redNeg())?(f[1]=e[l].toJ().mixedAdd(e[h]),f[2]=e[l].add(e[h].neg())):(f[1]=e[l].toJ().mixedAdd(e[h]),f[2]=e[l].toJ().mixedAdd(e[h].neg()));var c=[-3,-1,-5,-7,0,7,5,1,3],g=getJSF(n[l],n[h]);u=Math.max(g[0].length,u),a[l]=new Array(u),a[h]=new Array(u);for(var v=0;v<u;v++){var m=0|g[0][v],w=0|g[1][v];a[l][v]=c[3*(m+1)+(w+1)],a[h][v]=0,s[l]=f}}else a[l]=getNAF(n[l],i[l]),a[h]=getNAF(n[h],i[h]),u=Math.max(a[l].length,u),u=Math.max(a[h].length,u)}var y=this.jpoint(null,null,null),B=this._wnafT4;for(d=u;d>=0;d--){for(var _=0;d>=0;){var A=!0;for(v=0;v<r;v++)B[v]=0|a[v][d],0!==B[v]&&(A=!1);if(!A)break;_++,d--}if(d>=0&&_++,y=y.dblp(_),d<0)break;for(v=0;v<r;v++){var b,N=B[v];0!==N&&(N>0?b=s[v][N-1>>1]:N<0&&(b=s[v][-N-1>>1].neg()),y="affine"===b.type?y.mixedAdd(b):y.add(b))}}for(d=0;d<r;d++)s[d]=null;return o?y:y.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function eq(){throw new Error("Not implemented")},BasePoint.prototype.validate=function validate(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function decodePoint(t,e){t=utils.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?assert(t[t.length-1]%2==0):7===t[0]&&assert(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function encodeCompressed(t){return this.encode(t,!0)},BasePoint.prototype._encode=function _encode(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},BasePoint.prototype.encode=function encode(t,e){return utils.encode(this._encode(e),t)},BasePoint.prototype.precompute=function precompute(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},BasePoint.prototype._hasDoubles=function _hasDoubles(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},BasePoint.prototype._getDoubles=function _getDoubles(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,o=0;o<e;o+=t){for(var i=0;i<t;i++)r=r.dbl();n.push(r)}return{step:t,points:n}},BasePoint.prototype._getNAFPoints=function _getNAFPoints(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),o=1;o<n;o++)e[o]=e[o-1].add(r);return{wnd:t,points:e}},BasePoint.prototype._getBeta=function _getBeta(){return null},BasePoint.prototype.dblp=function dblp(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/edwards.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),assert=utils.assert;function EdwardsCurve(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Base.call(this,"edwards",t),this.a=new BN(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function Point(t,r,e,i,d){Base.BasePoint.call(this,t,"projective"),null===r&&null===e&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN(r,16),this.y=new BN(e,16),this.z=i?new BN(i,16):this.curve.one,this.t=d&&new BN(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(EdwardsCurve,Base),module.exports=EdwardsCurve,EdwardsCurve.prototype._mulA=function _mulA(t){return this.mOneA?t.redNeg():this.a.redMul(t)},EdwardsCurve.prototype._mulC=function _mulC(t){return this.oneC?t:this.c.redMul(t)},EdwardsCurve.prototype.jpoint=function jpoint(t,r,e,i){return this.point(t,r,e,i)},EdwardsCurve.prototype.pointFromX=function pointFromX(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=this.c2.redSub(this.a.redMul(e)),d=this.one.redSub(this.c2.redMul(this.d).redMul(e)),s=i.redMul(d.redInvm()),u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var n=u.fromRed().isOdd();return(r&&!n||!r&&n)&&(u=u.redNeg()),this.point(t,u)},EdwardsCurve.prototype.pointFromY=function pointFromY(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=e.redSub(this.c2),d=e.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(d.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,t)},EdwardsCurve.prototype.validate=function validate(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),e=t.y.redSqr(),i=r.redMul(this.a).redAdd(e),d=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(e)));return 0===i.cmp(d)},inherits(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function pointFromJSON(t){return Point.fromJSON(this,t)},EdwardsCurve.prototype.point=function point(t,r,e,i){return new Point(this,t,r,e,i)},Point.fromJSON=function fromJSON(t,r){return new Point(t,r[0],r[1],r[2])},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function _extDbl(){var t=this.x.redSqr(),r=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var i=this.curve._mulA(t),d=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),s=i.redAdd(r),u=s.redSub(e),n=i.redSub(r),o=d.redMul(u),h=s.redMul(n),l=d.redMul(n),p=u.redMul(s);return this.curve.point(o,h,p,l)},Point.prototype._projDbl=function _projDbl(){var t,r,e,i=this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var u=(h=this.curve._mulA(d)).redAdd(s);if(this.zOne)t=i.redSub(d).redSub(s).redMul(u.redSub(this.curve.two)),r=u.redMul(h.redSub(s)),e=u.redSqr().redSub(u).redSub(u);else{var n=this.z.redSqr(),o=u.redSub(n).redISub(n);t=i.redSub(d).redISub(s).redMul(o),r=u.redMul(h.redSub(s)),e=u.redMul(o)}}else{var h=d.redAdd(s);n=this.curve._mulC(this.z).redSqr(),o=h.redSub(n).redSub(n);t=this.curve._mulC(i.redISub(h)).redMul(o),r=this.curve._mulC(h).redMul(d.redISub(s)),e=h.redMul(o)}return this.curve.point(t,r,e)},Point.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function _extAdd(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),e=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),d=this.z.redMul(t.z.redAdd(t.z)),s=e.redSub(r),u=d.redSub(i),n=d.redAdd(i),o=e.redAdd(r),h=s.redMul(u),l=n.redMul(o),p=s.redMul(o),c=u.redMul(n);return this.curve.point(h,l,c,p)},Point.prototype._projAdd=function _projAdd(t){var r,e,i=this.z.redMul(t.z),d=i.redSqr(),s=this.x.redMul(t.x),u=this.y.redMul(t.y),n=this.curve.d.redMul(s).redMul(u),o=d.redSub(n),h=d.redAdd(n),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(u),p=i.redMul(o).redMul(l);return this.curve.twisted?(r=i.redMul(h).redMul(u.redSub(this.curve._mulA(s))),e=o.redMul(h)):(r=i.redMul(h).redMul(u.redSub(s)),e=this.curve._mulC(o).redMul(h)),this.curve.point(p,r,e)},Point.prototype.add=function add(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Point.prototype.mul=function mul(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function mulAdd(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!1)},Point.prototype.jmulAdd=function jmulAdd(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!0)},Point.prototype.normalize=function normalize(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function getY(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function eq(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Point.prototype.eqXToP=function eqXToP(t){var r=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var e=t.clone(),i=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/index.js":[function(require,module,exports){ | |
"use strict";var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards"); | |
},{"./base":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/base.js","./edwards":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/edwards.js","./mont":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/mont.js","./short":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/short.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/mont.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),utils=require("../utils");function MontCurve(t){Base.call(this,"mont",t),this.a=new BN(t.a,16).toRed(this.red),this.b=new BN(t.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(t,e,r){Base.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(e,16),this.z=new BN(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function validate(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function decodePoint(t,e){return this.point(utils.toArray(t,e),1)},MontCurve.prototype.point=function point(t,e){return new Point(this,t,e)},MontCurve.prototype.pointFromJSON=function pointFromJSON(t){return Point.fromJSON(this,t)},Point.prototype.precompute=function precompute(){},Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function fromJSON(t,e){return new Point(t,e[0],e[1]||t.one)},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function dbl(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),o=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,o)},Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function diffAdd(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),n=t.x.redSub(t.z).redMul(r),d=o.redMul(i),u=e.z.redMul(n.redAdd(d).redSqr()),s=e.x.redMul(n.redISub(d).redSqr());return this.curve.point(u,s)},Point.prototype.mul=function mul(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),o=[];0!==e.cmpn(0);e.iushrn(1))o.push(e.andln(1));for(var n=o.length-1;n>=0;n--)0===o[n]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function eq(t){return 0===this.getX().cmp(t.getX())},Point.prototype.normalize=function normalize(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/short.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),assert=utils.assert;function ShortCurve(r){Base.call(this,"short",r),this.a=new BN(r.a,16).toRed(this.red),this.b=new BN(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(r,e,t,d){Base.BasePoint.call(this,r,"affine"),null===e&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(e,16),this.y=new BN(t,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(r,e,t,d){Base.BasePoint.call(this,r,"jacobian"),null===e&&null===t&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(e,16),this.y=new BN(t,16),this.z=new BN(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function _getEndomorphism(r){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,t;if(r.beta)e=new BN(r.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);e=(e=d[0].cmp(d[1])<0?d[0]:d[1]).toRed(this.red)}if(r.lambda)t=new BN(r.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?t=i[0]:(t=i[1],assert(0===this.g.mul(t).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:t,basis:r.basis?r.basis.map(function(r){return{a:new BN(r.a,16),b:new BN(r.b,16)}}):this._getEndoBasis(t)}}},ShortCurve.prototype._getEndoRoots=function _getEndoRoots(r){var e=r===this.p?this.red:BN.mont(r),t=new BN(2).toRed(e).redInvm(),d=t.redNeg(),i=new BN(3).toRed(e).redNeg().redSqrt().redMul(t);return[d.redAdd(i).fromRed(),d.redSub(i).fromRed()]},ShortCurve.prototype._getEndoBasis=function _getEndoBasis(r){for(var e,t,d,i,n,u,s,o,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=r,a=this.n.clone(),f=new BN(1),c=new BN(0),S=new BN(0),v=new BN(1),b=0;0!==p.cmpn(0);){var I=a.div(p);o=a.sub(I.mul(p)),h=S.sub(I.mul(f));var y=v.sub(I.mul(c));if(!d&&o.cmp(l)<0)e=s.neg(),t=f,d=o.neg(),i=h;else if(d&&2==++b)break;s=o,a=p,p=o,S=f,f=h,v=c,c=y}n=o.neg(),u=h;var A=d.sqr().add(i.sqr());return n.sqr().add(u.sqr()).cmp(A)>=0&&(n=e,u=t),d.negative&&(d=d.neg(),i=i.neg()),n.negative&&(n=n.neg(),u=u.neg()),[{a:d,b:i},{a:n,b:u}]},ShortCurve.prototype._endoSplit=function _endoSplit(r){var e=this.endo.basis,t=e[0],d=e[1],i=d.b.mul(r).divRound(this.n),n=t.b.neg().mul(r).divRound(this.n),u=i.mul(t.a),s=n.mul(d.a),o=i.mul(t.b),h=n.mul(d.b);return{k1:r.sub(u).sub(s),k2:o.add(h).neg()}},ShortCurve.prototype.pointFromX=function pointFromX(r,e){(r=new BN(r,16)).red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),d=t.redSqrt();if(0!==d.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var i=d.fromRed().isOdd();return(e&&!i||!e&&i)&&(d=d.redNeg()),this.point(r,d)},ShortCurve.prototype.validate=function validate(r){if(r.inf)return!0;var e=r.x,t=r.y,d=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(d).redIAdd(this.b);return 0===t.redSqr().redISub(i).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(r,e,t){for(var d=this._endoWnafT1,i=this._endoWnafT2,n=0;n<r.length;n++){var u=this._endoSplit(e[n]),s=r[n],o=s._getBeta();u.k1.negative&&(u.k1.ineg(),s=s.neg(!0)),u.k2.negative&&(u.k2.ineg(),o=o.neg(!0)),d[2*n]=s,d[2*n+1]=o,i[2*n]=u.k1,i[2*n+1]=u.k2}for(var h=this._wnafMulAdd(1,d,i,2*n,t),l=0;l<2*n;l++)d[l]=null,i[l]=null;return h},inherits(Point,Base.BasePoint),ShortCurve.prototype.point=function point(r,e,t){return new Point(this,r,e,t)},ShortCurve.prototype.pointFromJSON=function pointFromJSON(r,e){return Point.fromJSON(this,r,e)},Point.prototype._getBeta=function _getBeta(){if(this.curve.endo){var r=this.precomputed;if(r&&r.beta)return r.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var t=this.curve,d=function(r){return t.point(r.x.redMul(t.endo.beta),r.y)};r.beta=e,e.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(d)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(d)}}}return e}},Point.prototype.toJSON=function toJSON(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function fromJSON(r,e,t){"string"==typeof e&&(e=JSON.parse(e));var d=r.point(e[0],e[1],t);if(!e[2])return d;function obj2point(e){return r.point(e[0],e[1],t)}var i=e[2];return d.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[d].concat(i.doubles.points.map(obj2point))},naf:i.naf&&{wnd:i.naf.wnd,points:[d].concat(i.naf.points.map(obj2point))}},d},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return this.inf},Point.prototype.add=function add(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(0===this.x.cmp(r.x))return this.curve.point(null,null);var e=this.y.redSub(r.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),d=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,d)},Point.prototype.dbl=function dbl(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(0===r.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),d=r.redInvm(),i=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(d),n=i.redSqr().redISub(this.x.redAdd(this.x)),u=i.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,u)},Point.prototype.getX=function getX(){return this.x.fromRed()},Point.prototype.getY=function getY(){return this.y.fromRed()},Point.prototype.mul=function mul(r){return r=new BN(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},Point.prototype.mulAdd=function mulAdd(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i):this.curve._wnafMulAdd(1,d,i,2)},Point.prototype.jmulAdd=function jmulAdd(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i,!0):this.curve._wnafMulAdd(1,d,i,2,!0)},Point.prototype.eq=function eq(r){return this===r||this.inf===r.inf&&(this.inf||0===this.x.cmp(r.x)&&0===this.y.cmp(r.y))},Point.prototype.neg=function neg(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,d=function(r){return r.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return e},Point.prototype.toJ=function toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function jpoint(r,e,t){return new JPoint(this,r,e,t)},JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),d=this.y.redMul(e).redMul(r);return this.curve.point(t,d)},JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function add(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),d=this.x.redMul(e),i=r.x.redMul(t),n=this.y.redMul(e.redMul(r.z)),u=r.y.redMul(t.redMul(this.z)),s=d.redSub(i),o=n.redSub(u);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),l=h.redMul(s),p=d.redMul(h),a=o.redSqr().redIAdd(l).redISub(p).redISub(p),f=o.redMul(p.redISub(a)).redISub(n.redMul(l)),c=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(a,f,c)},JPoint.prototype.mixedAdd=function mixedAdd(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,d=r.x.redMul(e),i=this.y,n=r.y.redMul(e).redMul(this.z),u=t.redSub(d),s=i.redSub(n);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=u.redSqr(),h=o.redMul(u),l=t.redMul(o),p=s.redSqr().redIAdd(h).redISub(l).redISub(l),a=s.redMul(l.redISub(p)).redISub(i.redMul(h)),f=this.z.redMul(u);return this.curve.jpoint(p,a,f)},JPoint.prototype.dblp=function dblp(r){if(0===r)return this;if(this.isInfinity())return this;if(!r)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,t=0;t<r;t++)e=e.dbl();return e}var d=this.curve.a,i=this.curve.tinv,n=this.x,u=this.y,s=this.z,o=s.redSqr().redSqr(),h=u.redAdd(u);for(t=0;t<r;t++){var l=n.redSqr(),p=h.redSqr(),a=p.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(d.redMul(o)),c=n.redMul(p),S=f.redSqr().redISub(c.redAdd(c)),v=c.redISub(S),b=f.redMul(v);b=b.redIAdd(b).redISub(a);var I=h.redMul(s);t+1<r&&(o=o.redMul(a)),n=S,s=I,h=b}return this.curve.jpoint(n,h.redMul(i),s)},JPoint.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function _zeroDbl(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d),o=s.redSqr().redISub(u).redISub(u),h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),r=o,e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),p=this.y.redSqr(),a=p.redSqr(),f=this.x.redAdd(p).redSqr().redISub(l).redISub(a);f=f.redIAdd(f);var c=l.redAdd(l).redIAdd(l),S=c.redSqr(),v=a.redIAdd(a);v=(v=v.redIAdd(v)).redIAdd(v),r=S.redISub(f).redISub(f),e=c.redMul(f.redISub(r)).redISub(v),t=(t=this.y.redMul(this.z)).redIAdd(t)}return this.curve.jpoint(r,e,t)},JPoint.prototype._threeDbl=function _threeDbl(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),o=s.redSqr().redISub(u).redISub(u);r=o;var h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),p=this.y.redSqr(),a=this.x.redMul(p),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var c=a.redIAdd(a),S=(c=c.redIAdd(c)).redAdd(c);r=f.redSqr().redISub(S),t=this.y.redAdd(this.z).redSqr().redISub(p).redISub(l);var v=p.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),e=f.redMul(c.redISub(r)).redISub(v)}return this.curve.jpoint(r,e,t)},JPoint.prototype._dbl=function _dbl(){var r=this.curve.a,e=this.x,t=this.y,d=this.z,i=d.redSqr().redSqr(),n=e.redSqr(),u=t.redSqr(),s=n.redAdd(n).redIAdd(n).redIAdd(r.redMul(i)),o=e.redAdd(e),h=(o=o.redIAdd(o)).redMul(u),l=s.redSqr().redISub(h.redAdd(h)),p=h.redISub(l),a=u.redSqr();a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var f=s.redMul(p).redISub(a),c=t.redAdd(t).redMul(d);return this.curve.jpoint(l,f,c)},JPoint.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),e=this.y.redSqr(),t=this.z.redSqr(),d=e.redSqr(),i=r.redAdd(r).redIAdd(r),n=i.redSqr(),u=this.x.redAdd(e).redSqr().redISub(r).redISub(d),s=(u=(u=(u=u.redIAdd(u)).redAdd(u).redIAdd(u)).redISub(n)).redSqr(),o=d.redIAdd(d);o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);var h=i.redIAdd(u).redSqr().redISub(n).redISub(s).redISub(o),l=e.redMul(h);l=(l=l.redIAdd(l)).redIAdd(l);var p=this.x.redMul(s).redISub(l);p=(p=p.redIAdd(p)).redIAdd(p);var a=this.y.redMul(h.redMul(o.redISub(h)).redISub(u.redMul(s)));a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var f=this.z.redAdd(u).redSqr().redISub(t).redISub(s);return this.curve.jpoint(p,a,f)},JPoint.prototype.mul=function mul(r,e){return r=new BN(r,e),this.curve._wnafMul(this,r)},JPoint.prototype.eq=function eq(r){if("affine"===r.type)return this.eq(r.toJ());if(this===r)return!0;var e=this.z.redSqr(),t=r.z.redSqr();if(0!==this.x.redMul(t).redISub(r.x.redMul(e)).cmpn(0))return!1;var d=e.redMul(this.z),i=t.redMul(r.z);return 0===this.y.redMul(i).redISub(r.y.redMul(d)).cmpn(0)},JPoint.prototype.eqXToP=function eqXToP(r){var e=this.z.redSqr(),t=r.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(t))return!0;for(var d=r.clone(),i=this.curve.redN.redMul(e);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},JPoint.prototype.inspect=function inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curves.js":[function(require,module,exports){ | |
"use strict";var pre,curves=exports,hash=require("hash.js"),curve=require("./curve"),utils=require("./utils"),assert=utils.assert;function PresetCurve(f){"short"===f.type?this.curve=new curve.short(f):"edwards"===f.type?this.curve=new curve.edwards(f):this.curve=new curve.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(f,e){Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(e);return Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,value:a}),a}})}curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{pre=require("./precomputed/secp256k1")}catch(f){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]}); | |
},{"./curve":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curve/index.js","./precomputed/secp256k1":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","hash.js":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/index.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),HmacDRBG=require("hmac-drbg"),utils=require("../utils"),curves=require("../curves"),rand=require("brorand"),assert=utils.assert,KeyPair=require("./key"),Signature=require("./signature");function EC(r){if(!(this instanceof EC))return new EC(r);"string"==typeof r&&(assert(curves.hasOwnProperty(r),"Unknown curve "+r),r=curves[r]),r instanceof curves.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}module.exports=EC,EC.prototype.keyPair=function keyPair(r){return new KeyPair(this,r)},EC.prototype.keyFromPrivate=function keyFromPrivate(r,e){return KeyPair.fromPrivate(this,r,e)},EC.prototype.keyFromPublic=function keyFromPublic(r,e){return KeyPair.fromPublic(this,r,e)},EC.prototype.genKeyPair=function genKeyPair(r){r||(r={});for(var e=new HmacDRBG({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||rand(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),n=this.n.sub(new BN(2));;){var i=new BN(e.generate(t));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},EC.prototype._truncateToN=function truncateToN(r,e){var t=8*r.byteLength()-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},EC.prototype.sign=function sign(r,e,t,n){"object"==typeof t&&(n=t,t=null),n||(n={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new BN(r,16));for(var i=this.n.byteLength(),s=e.getPrivate().toArray("be",i),u=r.toArray("be",i),o=new HmacDRBG({hash:this.hash,entropy:s,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),a=this.n.sub(new BN(1)),c=0;;c++){var h=n.k?n.k(c):new BN(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(a)>=0)){var m=this.g.mul(h);if(!m.isInfinity()){var v=m.getX(),y=v.umod(this.n);if(0!==y.cmpn(0)){var p=h.invm(this.n).mul(y.mul(e.getPrivate()).iadd(r));if(0!==(p=p.umod(this.n)).cmpn(0)){var f=(m.getY().isOdd()?1:0)|(0!==v.cmp(y)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),f^=1),new Signature({r:y,s:p,recoveryParam:f})}}}}}},EC.prototype.verify=function verify(r,e,t,n){r=this._truncateToN(new BN(r,16)),t=this.keyFromPublic(t,n);var i=(e=new Signature(e,"hex")).r,s=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var u,o=s.invm(this.n),a=o.mul(r).umod(this.n),c=o.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(a,t.getPublic(),c)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(a,t.getPublic(),c)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},EC.prototype.recoverPubKey=function(r,e,t,n){assert((3&t)===t,"The recovery param is more than two bits"),e=new Signature(e,n);var i=this.n,s=new BN(r),u=e.r,o=e.s,a=1&t,c=t>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");u=c?this.curve.pointFromX(u.add(this.curve.n),a):this.curve.pointFromX(u,a);var h=e.r.invm(i),m=i.sub(s).mul(h).umod(i),v=o.mul(h).umod(i);return this.g.mulAdd(m,u,v)},EC.prototype.getKeyRecoveryParam=function(r,e,t,n){if(null!==(e=new Signature(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(r){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}; | |
},{"../curves":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curves.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","./key":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/key.js","./signature":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/signature.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","brorand":"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js","hmac-drbg":"/Users/lentan/repo/torus/torus-embed/node_modules/hmac-drbg/lib/hmac-drbg.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/key.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert;function KeyPair(i,t){this.ec=i,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}module.exports=KeyPair,KeyPair.fromPublic=function fromPublic(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{pub:t,pubEnc:e})},KeyPair.fromPrivate=function fromPrivate(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{priv:t,privEnc:e})},KeyPair.prototype.validate=function validate(){var i=this.getPublic();return i.isInfinity()?{result:!1,reason:"Invalid public key"}:i.validate()?i.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function getPublic(i,t){return"string"==typeof i&&(t=i,i=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,i):this.pub},KeyPair.prototype.getPrivate=function getPrivate(i){return"hex"===i?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function _importPrivate(i,t){this.priv=new BN(i,t||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function _importPublic(i,t){if(i.x||i.y)return"mont"===this.ec.curve.type?assert(i.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(i.x&&i.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(i.x,i.y));this.pub=this.ec.curve.decodePoint(i,t)},KeyPair.prototype.derive=function derive(i){return i.mul(this.priv).getX()},KeyPair.prototype.sign=function sign(i,t,e){return this.ec.sign(i,this,t,e)},KeyPair.prototype.verify=function verify(i,t){return this.ec.verify(i,t,this)},KeyPair.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/ec/signature.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert;function Signature(t,r){if(t instanceof Signature)return t;this._importDER(t,r)||(assert(t.r&&t.s,"Signature without r or s"),this.r=new BN(t.r,16),this.s=new BN(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function Position(){this.place=0}function getLength(t,r){var e=t[r.place++];if(!(128&e))return e;for(var n=15&e,a=0,i=0,c=r.place;i<n;i++,c++)a<<=8,a|=t[c];return r.place=c,a}function rmPadding(t){for(var r=0,e=t.length-1;!t[r]&&!(128&t[r+1])&&r<e;)r++;return 0===r?t:t.slice(r)}function constructLength(t,r){if(r<128)t.push(r);else{var e=1+(Math.log(r)/Math.LN2>>>3);for(t.push(128|e);--e;)t.push(r>>>(e<<3)&255);t.push(r)}}module.exports=Signature,Signature.prototype._importDER=function _importDER(t,r){t=utils.toArray(t,r);var e=new Position;if(48!==t[e.place++])return!1;if(getLength(t,e)+e.place!==t.length)return!1;if(2!==t[e.place++])return!1;var n=getLength(t,e),a=t.slice(e.place,n+e.place);if(e.place+=n,2!==t[e.place++])return!1;var i=getLength(t,e);if(t.length!==i+e.place)return!1;var c=t.slice(e.place,i+e.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new BN(a),this.s=new BN(c),this.recoveryParam=null,!0},Signature.prototype.toDER=function toDER(t){var r=this.r.toArray(),e=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&e[0]&&(e=[0].concat(e)),r=rmPadding(r),e=rmPadding(e);!(e[0]||128&e[1]);)e=e.slice(1);var n=[2];constructLength(n,r.length),(n=n.concat(r)).push(2),constructLength(n,e.length);var a=n.concat(e),i=[48];return constructLength(i,a.length),i=i.concat(a),utils.encode(i,t)}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/index.js":[function(require,module,exports){ | |
"use strict";var hash=require("hash.js"),curves=require("../curves"),utils=require("../utils"),assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=require("./key"),Signature=require("./signature");function EDDSA(t){if(assert("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(t);t=curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hash.sha512}module.exports=EDDSA,EDDSA.prototype.sign=function sign(t,e){t=parseBytes(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),s=this.encodePoint(i),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),u=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:s})},EDDSA.prototype.verify=function verify(t,e,r){t=parseBytes(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(s)},EDDSA.prototype.hashInt=function hashInt(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return utils.intFromLE(t.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function keyFromPublic(t){return KeyPair.fromPublic(this,t)},EDDSA.prototype.keyFromSecret=function keyFromSecret(t){return KeyPair.fromSecret(this,t)},EDDSA.prototype.makeSignature=function makeSignature(t){return t instanceof Signature?t:new Signature(this,t)},EDDSA.prototype.encodePoint=function encodePoint(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},EDDSA.prototype.decodePoint=function decodePoint(t){var e=(t=utils.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=utils.intFromLE(r);return this.curve.pointFromY(i,n)},EDDSA.prototype.encodeInt=function encodeInt(t){return t.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function decodeInt(t){return utils.intFromLE(t)},EDDSA.prototype.isPoint=function isPoint(t){return t instanceof this.pointClass}; | |
},{"../curves":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/curves.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","./key":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/key.js","./signature":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/signature.js","hash.js":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/key.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),assert=utils.assert,parseBytes=utils.parseBytes,cachedProperty=utils.cachedProperty;function KeyPair(e,t){this.eddsa=e,this._secret=parseBytes(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=parseBytes(t.pub)}KeyPair.fromPublic=function fromPublic(e,t){return t instanceof KeyPair?t:new KeyPair(e,{pub:t})},KeyPair.fromSecret=function fromSecret(e,t){return t instanceof KeyPair?t:new KeyPair(e,{secret:t})},KeyPair.prototype.secret=function secret(){return this._secret},cachedProperty(KeyPair,"pubBytes",function pubBytes(){return this.eddsa.encodePoint(this.pub())}),cachedProperty(KeyPair,"pub",function pub(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty(KeyPair,"privBytes",function privBytes(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),cachedProperty(KeyPair,"priv",function priv(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty(KeyPair,"hash",function hash(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty(KeyPair,"messagePrefix",function messagePrefix(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair.prototype.sign=function sign(e){return assert(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair.prototype.verify=function verify(e,t){return this.eddsa.verify(e,t,this)},KeyPair.prototype.getSecret=function getSecret(e){return assert(this._secret,"KeyPair is public only"),utils.encode(this.secret(),e)},KeyPair.prototype.getPublic=function getPublic(e){return utils.encode(this.pubBytes(),e)},module.exports=KeyPair; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/eddsa/signature.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert,cachedProperty=utils.cachedProperty,parseBytes=utils.parseBytes;function Signature(e,t){this.eddsa=e,"object"!=typeof t&&(t=parseBytes(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),assert(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof BN&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}cachedProperty(Signature,"S",function S(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature,"R",function R(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature,"Rencoded",function Rencoded(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature,"Sencoded",function Sencoded(){return this.eddsa.encodeInt(this.S())}),Signature.prototype.toBytes=function toBytes(){return this.Rencoded().concat(this.Sencoded())},Signature.prototype.toHex=function toHex(){return utils.encode(this.toBytes(),"hex").toUpperCase()},module.exports=Signature; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js":[function(require,module,exports){ | |
module.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/lib/elliptic/utils.js":[function(require,module,exports){ | |
"use strict";var utils=exports,BN=require("bn.js"),minAssert=require("minimalistic-assert"),minUtils=require("minimalistic-crypto-utils");function getNAF(t,r){for(var e=[],i=1<<r+1,n=t.clone();n.cmpn(1)>=0;){var s;if(n.isOdd()){var u=n.andln(i-1);s=u>(i>>1)-1?(i>>1)-u:u,n.isubn(s)}else s=0;e.push(s);for(var l=0!==n.cmpn(0)&&0===n.andln(i-1)?r+1:1,o=1;o<l;o++)e.push(0);n.iushrn(l)}return e}function getJSF(t,r){var e=[[],[]];t=t.clone(),r=r.clone();for(var i=0,n=0;t.cmpn(-i)>0||r.cmpn(-n)>0;){var s,u,l,o=t.andln(3)+i&3,a=r.andln(3)+n&3;if(3===o&&(o=-1),3===a&&(a=-1),0==(1&o))s=0;else s=3!==(l=t.andln(7)+i&7)&&5!==l||2!==a?o:-o;if(e[0].push(s),0==(1&a))u=0;else u=3!==(l=r.andln(7)+n&7)&&5!==l||2!==o?a:-a;e[1].push(u),2*i===s+1&&(i=1-i),2*n===u+1&&(n=1-n),t.iushrn(1),r.iushrn(1)}return e}function cachedProperty(t,r,e){var i="_"+r;t.prototype[r]=function cachedProperty(){return void 0!==this[i]?this[i]:this[i]=e.call(this)}}function parseBytes(t){return"string"==typeof t?utils.toArray(t,"hex"):t}function intFromLE(t){return new BN(t,"hex","le")}utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE; | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js","minimalistic-crypto-utils":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-crypto-utils/lib/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eccrypto/node_modules/elliptic/package.json":[function(require,module,exports){ | |
module.exports={ | |
"_args": [ | |
[ | |
"[email protected]", | |
"/Users/lentan/repo/torus/torus-embed" | |
] | |
], | |
"_from": "[email protected]", | |
"_id": "[email protected]", | |
"_inBundle": false, | |
"_integrity": "sha512-xvJINNLbTeWQjrl6X+7eQCrIy/YPv5XCpKW6kB5mKvtnGILoLDcySuwomfdzt0BMdLNVnuRNTuzKNHj0bva1Cg==", | |
"_location": "/eccrypto/elliptic", | |
"_phantomChildren": {}, | |
"_requested": { | |
"type": "version", | |
"registry": true, | |
"raw": "[email protected]", | |
"name": "elliptic", | |
"escapedName": "elliptic", | |
"rawSpec": "6.5.1", | |
"saveSpec": null, | |
"fetchSpec": "6.5.1" | |
}, | |
"_requiredBy": [ | |
"/eccrypto" | |
], | |
"_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.1.tgz", | |
"_spec": "6.5.1", | |
"_where": "/Users/lentan/repo/torus/torus-embed", | |
"author": { | |
"name": "Fedor Indutny", | |
"email": "[email protected]" | |
}, | |
"bugs": { | |
"url": "https://github.com/indutny/elliptic/issues" | |
}, | |
"dependencies": { | |
"bn.js": "^4.4.0", | |
"brorand": "^1.0.1", | |
"hash.js": "^1.0.0", | |
"hmac-drbg": "^1.0.0", | |
"inherits": "^2.0.1", | |
"minimalistic-assert": "^1.0.0", | |
"minimalistic-crypto-utils": "^1.0.0" | |
}, | |
"description": "EC cryptography", | |
"devDependencies": { | |
"brfs": "^1.4.3", | |
"coveralls": "^3.0.4", | |
"grunt": "^1.0.4", | |
"grunt-browserify": "^5.0.0", | |
"grunt-cli": "^1.2.0", | |
"grunt-contrib-connect": "^1.0.0", | |
"grunt-contrib-copy": "^1.0.0", | |
"grunt-contrib-uglify": "^1.0.1", | |
"grunt-mocha-istanbul": "^3.0.1", | |
"grunt-saucelabs": "^9.0.1", | |
"istanbul": "^0.4.2", | |
"jscs": "^3.0.7", | |
"jshint": "^2.6.0", | |
"mocha": "^6.1.4" | |
}, | |
"files": [ | |
"lib" | |
], | |
"homepage": "https://github.com/indutny/elliptic", | |
"keywords": [ | |
"EC", | |
"Elliptic", | |
"curve", | |
"Cryptography" | |
], | |
"license": "MIT", | |
"main": "lib/elliptic.js", | |
"name": "elliptic", | |
"repository": { | |
"type": "git", | |
"url": "git+ssh://[email protected]/indutny/elliptic.git" | |
}, | |
"scripts": { | |
"jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", | |
"jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", | |
"lint": "npm run jscs && npm run jshint", | |
"test": "npm run lint && npm run unit", | |
"unit": "istanbul test _mocha --reporter=spec test/index.js", | |
"version": "grunt dist && git add dist/" | |
}, | |
"version": "6.5.1" | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic.js":[function(require,module,exports){ | |
"use strict";var elliptic=exports;elliptic.version=require("../package.json").version,elliptic.utils=require("./elliptic/utils"),elliptic.rand=require("brorand"),elliptic.curve=require("./elliptic/curve"),elliptic.curves=require("./elliptic/curves"),elliptic.ec=require("./elliptic/ec"),elliptic.eddsa=require("./elliptic/eddsa"); | |
},{"../package.json":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/package.json","./elliptic/curve":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/index.js","./elliptic/curves":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curves.js","./elliptic/ec":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/index.js","./elliptic/eddsa":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/index.js","./elliptic/utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","brorand":"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/base.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),getNAF=utils.getNAF,getJSF=utils.getJSF,assert=utils.assert;function BaseCurve(t,e){this.type=t,this.p=new BN(e.p,16),this.red=e.prime?BN.red(e.prime):BN.mont(this.p),this.zero=new BN(0).toRed(this.red),this.one=new BN(1).toRed(this.red),this.two=new BN(2).toRed(this.red),this.n=e.n&&new BN(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function BasePoint(t,e){this.curve=t,this.type=e,this.precomputed=null}module.exports=BaseCurve,BaseCurve.prototype.point=function point(){throw new Error("Not implemented")},BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")},BaseCurve.prototype._fixedNafMul=function _fixedNafMul(t,e){assert(t.precomputed);var n=t._getDoubles(),r=getNAF(e,1,this._bitLength),i=(1<<n.step+1)-(n.step%2==0?2:1);i/=3;for(var o=[],s=0;s<r.length;s+=n.step){var a=0;for(e=s+n.step-1;e>=s;e--)a=(a<<1)+r[e];o.push(a)}for(var u=this.jpoint(null,null,null),d=this.jpoint(null,null,null),p=i;p>0;p--){for(s=0;s<o.length;s++){(a=o[s])===p?d=d.mixedAdd(n.points[s]):a===-p&&(d=d.mixedAdd(n.points[s].neg()))}u=u.add(d)}return u.toP()},BaseCurve.prototype._wnafMul=function _wnafMul(t,e){var n=4,r=t._getNAFPoints(n);n=r.wnd;for(var i=r.points,o=getNAF(e,n,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(e=0;a>=0&&0===o[a];a--)e++;if(a>=0&&e++,s=s.dblp(e),a<0)break;var u=o[a];assert(0!==u),s="affine"===t.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===t.type?s.toP():s},BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(t,e,n,r,i){for(var o=this._wnafT1,s=this._wnafT2,a=this._wnafT3,u=0,d=0;d<r;d++){var p=(A=e[d])._getNAFPoints(t);o[d]=p.wnd,s[d]=p.points}for(d=r-1;d>=1;d-=2){var h=d-1,l=d;if(1===o[h]&&1===o[l]){var f=[e[h],null,null,e[l]];0===e[h].y.cmp(e[l].y)?(f[1]=e[h].add(e[l]),f[2]=e[h].toJ().mixedAdd(e[l].neg())):0===e[h].y.cmp(e[l].y.redNeg())?(f[1]=e[h].toJ().mixedAdd(e[l]),f[2]=e[h].add(e[l].neg())):(f[1]=e[h].toJ().mixedAdd(e[l]),f[2]=e[h].toJ().mixedAdd(e[l].neg()));var c=[-3,-1,-5,-7,0,7,5,1,3],g=getJSF(n[h],n[l]);u=Math.max(g[0].length,u),a[h]=new Array(u),a[l]=new Array(u);for(var v=0;v<u;v++){var m=0|g[0][v],w=0|g[1][v];a[h][v]=c[3*(m+1)+(w+1)],a[l][v]=0,s[h]=f}}else a[h]=getNAF(n[h],o[h],this._bitLength),a[l]=getNAF(n[l],o[l],this._bitLength),u=Math.max(a[h].length,u),u=Math.max(a[l].length,u)}var y=this.jpoint(null,null,null),_=this._wnafT4;for(d=u;d>=0;d--){for(var b=0;d>=0;){var B=!0;for(v=0;v<r;v++)_[v]=0|a[v][d],0!==_[v]&&(B=!1);if(!B)break;b++,d--}if(d>=0&&b++,y=y.dblp(b),d<0)break;for(v=0;v<r;v++){var A,N=_[v];0!==N&&(N>0?A=s[v][N-1>>1]:N<0&&(A=s[v][-N-1>>1].neg()),y="affine"===A.type?y.mixedAdd(A):y.add(A))}}for(d=0;d<r;d++)s[d]=null;return i?y:y.toP()},BaseCurve.BasePoint=BasePoint,BasePoint.prototype.eq=function eq(){throw new Error("Not implemented")},BasePoint.prototype.validate=function validate(){return this.curve.validate(this)},BaseCurve.prototype.decodePoint=function decodePoint(t,e){t=utils.toArray(t,e);var n=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*n)return 6===t[0]?assert(t[t.length-1]%2==0):7===t[0]&&assert(t[t.length-1]%2==1),this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));if((2===t[0]||3===t[0])&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),3===t[0]);throw new Error("Unknown point format")},BasePoint.prototype.encodeCompressed=function encodeCompressed(t){return this.encode(t,!0)},BasePoint.prototype._encode=function _encode(t){var e=this.curve.p.byteLength(),n=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",e))},BasePoint.prototype.encode=function encode(t,e){return utils.encode(this._encode(e),t)},BasePoint.prototype.precompute=function precompute(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},BasePoint.prototype._hasDoubles=function _hasDoubles(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},BasePoint.prototype._getDoubles=function _getDoubles(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)r=r.dbl();n.push(r)}return{step:t,points:n}},BasePoint.prototype._getNAFPoints=function _getNAFPoints(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],n=(1<<t)-1,r=1===n?null:this.dbl(),i=1;i<n;i++)e[i]=e[i-1].add(r);return{wnd:t,points:e}},BasePoint.prototype._getBeta=function _getBeta(){return null},BasePoint.prototype.dblp=function dblp(t){for(var e=this,n=0;n<t;n++)e=e.dbl();return e}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/edwards.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),assert=utils.assert;function EdwardsCurve(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,Base.call(this,"edwards",t),this.a=new BN(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function Point(t,r,e,i,d){Base.BasePoint.call(this,t,"projective"),null===r&&null===e&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN(r,16),this.y=new BN(e,16),this.z=i?new BN(i,16):this.curve.one,this.t=d&&new BN(d,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(EdwardsCurve,Base),module.exports=EdwardsCurve,EdwardsCurve.prototype._mulA=function _mulA(t){return this.mOneA?t.redNeg():this.a.redMul(t)},EdwardsCurve.prototype._mulC=function _mulC(t){return this.oneC?t:this.c.redMul(t)},EdwardsCurve.prototype.jpoint=function jpoint(t,r,e,i){return this.point(t,r,e,i)},EdwardsCurve.prototype.pointFromX=function pointFromX(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=this.c2.redSub(this.a.redMul(e)),d=this.one.redSub(this.c2.redMul(this.d).redMul(e)),s=i.redMul(d.redInvm()),u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var n=u.fromRed().isOdd();return(r&&!n||!r&&n)&&(u=u.redNeg()),this.point(t,u)},EdwardsCurve.prototype.pointFromY=function pointFromY(t,r){(t=new BN(t,16)).red||(t=t.toRed(this.red));var e=t.redSqr(),i=e.redSub(this.c2),d=e.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(d.redInvm());if(0===s.cmp(this.zero)){if(r)throw new Error("invalid point");return this.point(this.zero,t)}var u=s.redSqrt();if(0!==u.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,t)},EdwardsCurve.prototype.validate=function validate(t){if(t.isInfinity())return!0;t.normalize();var r=t.x.redSqr(),e=t.y.redSqr(),i=r.redMul(this.a).redAdd(e),d=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(e)));return 0===i.cmp(d)},inherits(Point,Base.BasePoint),EdwardsCurve.prototype.pointFromJSON=function pointFromJSON(t){return Point.fromJSON(this,t)},EdwardsCurve.prototype.point=function point(t,r,e,i){return new Point(this,t,r,e,i)},Point.fromJSON=function fromJSON(t,r){return new Point(t,r[0],r[1],r[2])},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},Point.prototype._extDbl=function _extDbl(){var t=this.x.redSqr(),r=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var i=this.curve._mulA(t),d=this.x.redAdd(this.y).redSqr().redISub(t).redISub(r),s=i.redAdd(r),u=s.redSub(e),n=i.redSub(r),o=d.redMul(u),h=s.redMul(n),l=d.redMul(n),p=u.redMul(s);return this.curve.point(o,h,p,l)},Point.prototype._projDbl=function _projDbl(){var t,r,e,i=this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var u=(h=this.curve._mulA(d)).redAdd(s);if(this.zOne)t=i.redSub(d).redSub(s).redMul(u.redSub(this.curve.two)),r=u.redMul(h.redSub(s)),e=u.redSqr().redSub(u).redSub(u);else{var n=this.z.redSqr(),o=u.redSub(n).redISub(n);t=i.redSub(d).redISub(s).redMul(o),r=u.redMul(h.redSub(s)),e=u.redMul(o)}}else{var h=d.redAdd(s);n=this.curve._mulC(this.z).redSqr(),o=h.redSub(n).redSub(n);t=this.curve._mulC(i.redISub(h)).redMul(o),r=this.curve._mulC(h).redMul(d.redISub(s)),e=h.redMul(o)}return this.curve.point(t,r,e)},Point.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function _extAdd(t){var r=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),e=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),i=this.t.redMul(this.curve.dd).redMul(t.t),d=this.z.redMul(t.z.redAdd(t.z)),s=e.redSub(r),u=d.redSub(i),n=d.redAdd(i),o=e.redAdd(r),h=s.redMul(u),l=n.redMul(o),p=s.redMul(o),c=u.redMul(n);return this.curve.point(h,l,c,p)},Point.prototype._projAdd=function _projAdd(t){var r,e,i=this.z.redMul(t.z),d=i.redSqr(),s=this.x.redMul(t.x),u=this.y.redMul(t.y),n=this.curve.d.redMul(s).redMul(u),o=d.redSub(n),h=d.redAdd(n),l=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(s).redISub(u),p=i.redMul(o).redMul(l);return this.curve.twisted?(r=i.redMul(h).redMul(u.redSub(this.curve._mulA(s))),e=o.redMul(h)):(r=i.redMul(h).redMul(u.redSub(s)),e=this.curve._mulC(o).redMul(h)),this.curve.point(p,r,e)},Point.prototype.add=function add(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},Point.prototype.mul=function mul(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},Point.prototype.mulAdd=function mulAdd(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!1)},Point.prototype.jmulAdd=function jmulAdd(t,r,e){return this.curve._wnafMulAdd(1,[this,r],[t,e],2,!0)},Point.prototype.normalize=function normalize(){if(this.zOne)return this;var t=this.z.redInvm();return this.x=this.x.redMul(t),this.y=this.y.redMul(t),this.t&&(this.t=this.t.redMul(t)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function getY(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function eq(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},Point.prototype.eqXToP=function eqXToP(t){var r=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(r))return!0;for(var e=t.clone(),i=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/index.js":[function(require,module,exports){ | |
"use strict";var curve=exports;curve.base=require("./base"),curve.short=require("./short"),curve.mont=require("./mont"),curve.edwards=require("./edwards"); | |
},{"./base":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/base.js","./edwards":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/edwards.js","./mont":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/mont.js","./short":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/short.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/mont.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),utils=require("../utils");function MontCurve(t){Base.call(this,"mont",t),this.a=new BN(t.a,16).toRed(this.red),this.b=new BN(t.b,16).toRed(this.red),this.i4=new BN(4).toRed(this.red).redInvm(),this.two=new BN(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(t,e,r){Base.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN(e,16),this.z=new BN(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits(MontCurve,Base),module.exports=MontCurve,MontCurve.prototype.validate=function validate(t){var e=t.normalize().x,r=e.redSqr(),i=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===i.redSqrt().redSqr().cmp(i)},inherits(Point,Base.BasePoint),MontCurve.prototype.decodePoint=function decodePoint(t,e){return this.point(utils.toArray(t,e),1)},MontCurve.prototype.point=function point(t,e){return new Point(this,t,e)},MontCurve.prototype.pointFromJSON=function pointFromJSON(t){return Point.fromJSON(this,t)},Point.prototype.precompute=function precompute(){},Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function fromJSON(t,e){return new Point(t,e[0],e[1]||t.one)},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function dbl(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),i=t.redMul(e),o=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,o)},Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function diffAdd(t,e){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),o=t.x.redAdd(t.z),n=t.x.redSub(t.z).redMul(r),d=o.redMul(i),u=e.z.redMul(n.redAdd(d).redSqr()),s=e.x.redMul(n.redISub(d).redSqr());return this.curve.point(u,s)},Point.prototype.mul=function mul(t){for(var e=t.clone(),r=this,i=this.curve.point(null,null),o=[];0!==e.cmpn(0);e.iushrn(1))o.push(e.andln(1));for(var n=o.length-1;n>=0;n--)0===o[n]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function eq(t){return 0===this.getX().cmp(t.getX())},Point.prototype.normalize=function normalize(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function getX(){return this.normalize(),this.x.fromRed()}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/short.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),BN=require("bn.js"),inherits=require("inherits"),Base=require("./base"),assert=utils.assert;function ShortCurve(r){Base.call(this,"short",r),this.a=new BN(r.a,16).toRed(this.red),this.b=new BN(r.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(r),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(r,e,t,d){Base.BasePoint.call(this,r,"affine"),null===e&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new BN(e,16),this.y=new BN(t,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function JPoint(r,e,t,d){Base.BasePoint.call(this,r,"jacobian"),null===e&&null===t&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN(0)):(this.x=new BN(e,16),this.y=new BN(t,16),this.z=new BN(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits(ShortCurve,Base),module.exports=ShortCurve,ShortCurve.prototype._getEndomorphism=function _getEndomorphism(r){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,t;if(r.beta)e=new BN(r.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);e=(e=d[0].cmp(d[1])<0?d[0]:d[1]).toRed(this.red)}if(r.lambda)t=new BN(r.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(e))?t=i[0]:(t=i[1],assert(0===this.g.mul(t).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:t,basis:r.basis?r.basis.map(function(r){return{a:new BN(r.a,16),b:new BN(r.b,16)}}):this._getEndoBasis(t)}}},ShortCurve.prototype._getEndoRoots=function _getEndoRoots(r){var e=r===this.p?this.red:BN.mont(r),t=new BN(2).toRed(e).redInvm(),d=t.redNeg(),i=new BN(3).toRed(e).redNeg().redSqrt().redMul(t);return[d.redAdd(i).fromRed(),d.redSub(i).fromRed()]},ShortCurve.prototype._getEndoBasis=function _getEndoBasis(r){for(var e,t,d,i,n,u,s,o,h,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=r,a=this.n.clone(),f=new BN(1),c=new BN(0),S=new BN(0),v=new BN(1),b=0;0!==p.cmpn(0);){var I=a.div(p);o=a.sub(I.mul(p)),h=S.sub(I.mul(f));var y=v.sub(I.mul(c));if(!d&&o.cmp(l)<0)e=s.neg(),t=f,d=o.neg(),i=h;else if(d&&2==++b)break;s=o,a=p,p=o,S=f,f=h,v=c,c=y}n=o.neg(),u=h;var A=d.sqr().add(i.sqr());return n.sqr().add(u.sqr()).cmp(A)>=0&&(n=e,u=t),d.negative&&(d=d.neg(),i=i.neg()),n.negative&&(n=n.neg(),u=u.neg()),[{a:d,b:i},{a:n,b:u}]},ShortCurve.prototype._endoSplit=function _endoSplit(r){var e=this.endo.basis,t=e[0],d=e[1],i=d.b.mul(r).divRound(this.n),n=t.b.neg().mul(r).divRound(this.n),u=i.mul(t.a),s=n.mul(d.a),o=i.mul(t.b),h=n.mul(d.b);return{k1:r.sub(u).sub(s),k2:o.add(h).neg()}},ShortCurve.prototype.pointFromX=function pointFromX(r,e){(r=new BN(r,16)).red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),d=t.redSqrt();if(0!==d.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var i=d.fromRed().isOdd();return(e&&!i||!e&&i)&&(d=d.redNeg()),this.point(r,d)},ShortCurve.prototype.validate=function validate(r){if(r.inf)return!0;var e=r.x,t=r.y,d=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(d).redIAdd(this.b);return 0===t.redSqr().redISub(i).cmpn(0)},ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(r,e,t){for(var d=this._endoWnafT1,i=this._endoWnafT2,n=0;n<r.length;n++){var u=this._endoSplit(e[n]),s=r[n],o=s._getBeta();u.k1.negative&&(u.k1.ineg(),s=s.neg(!0)),u.k2.negative&&(u.k2.ineg(),o=o.neg(!0)),d[2*n]=s,d[2*n+1]=o,i[2*n]=u.k1,i[2*n+1]=u.k2}for(var h=this._wnafMulAdd(1,d,i,2*n,t),l=0;l<2*n;l++)d[l]=null,i[l]=null;return h},inherits(Point,Base.BasePoint),ShortCurve.prototype.point=function point(r,e,t){return new Point(this,r,e,t)},ShortCurve.prototype.pointFromJSON=function pointFromJSON(r,e){return Point.fromJSON(this,r,e)},Point.prototype._getBeta=function _getBeta(){if(this.curve.endo){var r=this.precomputed;if(r&&r.beta)return r.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(r){var t=this.curve,d=function(r){return t.point(r.x.redMul(t.endo.beta),r.y)};r.beta=e,e.precomputed={beta:null,naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(d)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(d)}}}return e}},Point.prototype.toJSON=function toJSON(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function fromJSON(r,e,t){"string"==typeof e&&(e=JSON.parse(e));var d=r.point(e[0],e[1],t);if(!e[2])return d;function obj2point(e){return r.point(e[0],e[1],t)}var i=e[2];return d.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[d].concat(i.doubles.points.map(obj2point))},naf:i.naf&&{wnd:i.naf.wnd,points:[d].concat(i.naf.points.map(obj2point))}},d},Point.prototype.inspect=function inspect(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function isInfinity(){return this.inf},Point.prototype.add=function add(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(0===this.x.cmp(r.x))return this.curve.point(null,null);var e=this.y.redSub(r.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),d=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,d)},Point.prototype.dbl=function dbl(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(0===r.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),d=r.redInvm(),i=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(d),n=i.redSqr().redISub(this.x.redAdd(this.x)),u=i.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,u)},Point.prototype.getX=function getX(){return this.x.fromRed()},Point.prototype.getY=function getY(){return this.y.fromRed()},Point.prototype.mul=function mul(r){return r=new BN(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},Point.prototype.mulAdd=function mulAdd(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i):this.curve._wnafMulAdd(1,d,i,2)},Point.prototype.jmulAdd=function jmulAdd(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i,!0):this.curve._wnafMulAdd(1,d,i,2,!0)},Point.prototype.eq=function eq(r){return this===r||this.inf===r.inf&&(this.inf||0===this.x.cmp(r.x)&&0===this.y.cmp(r.y))},Point.prototype.neg=function neg(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,d=function(r){return r.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return e},Point.prototype.toJ=function toJ(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},inherits(JPoint,Base.BasePoint),ShortCurve.prototype.jpoint=function jpoint(r,e,t){return new JPoint(this,r,e,t)},JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),d=this.y.redMul(e).redMul(r);return this.curve.point(t,d)},JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},JPoint.prototype.add=function add(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),d=this.x.redMul(e),i=r.x.redMul(t),n=this.y.redMul(e.redMul(r.z)),u=r.y.redMul(t.redMul(this.z)),s=d.redSub(i),o=n.redSub(u);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),l=h.redMul(s),p=d.redMul(h),a=o.redSqr().redIAdd(l).redISub(p).redISub(p),f=o.redMul(p.redISub(a)).redISub(n.redMul(l)),c=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(a,f,c)},JPoint.prototype.mixedAdd=function mixedAdd(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,d=r.x.redMul(e),i=this.y,n=r.y.redMul(e).redMul(this.z),u=t.redSub(d),s=i.redSub(n);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=u.redSqr(),h=o.redMul(u),l=t.redMul(o),p=s.redSqr().redIAdd(h).redISub(l).redISub(l),a=s.redMul(l.redISub(p)).redISub(i.redMul(h)),f=this.z.redMul(u);return this.curve.jpoint(p,a,f)},JPoint.prototype.dblp=function dblp(r){if(0===r)return this;if(this.isInfinity())return this;if(!r)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,t=0;t<r;t++)e=e.dbl();return e}var d=this.curve.a,i=this.curve.tinv,n=this.x,u=this.y,s=this.z,o=s.redSqr().redSqr(),h=u.redAdd(u);for(t=0;t<r;t++){var l=n.redSqr(),p=h.redSqr(),a=p.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(d.redMul(o)),c=n.redMul(p),S=f.redSqr().redISub(c.redAdd(c)),v=c.redISub(S),b=f.redMul(v);b=b.redIAdd(b).redISub(a);var I=h.redMul(s);t+1<r&&(o=o.redMul(a)),n=S,s=I,h=b}return this.curve.jpoint(n,h.redMul(i),s)},JPoint.prototype.dbl=function dbl(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},JPoint.prototype._zeroDbl=function _zeroDbl(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d),o=s.redSqr().redISub(u).redISub(u),h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),r=o,e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),p=this.y.redSqr(),a=p.redSqr(),f=this.x.redAdd(p).redSqr().redISub(l).redISub(a);f=f.redIAdd(f);var c=l.redAdd(l).redIAdd(l),S=c.redSqr(),v=a.redIAdd(a);v=(v=v.redIAdd(v)).redIAdd(v),r=S.redISub(f).redISub(f),e=c.redMul(f.redISub(r)).redISub(v),t=(t=this.y.redMul(this.z)).redIAdd(t)}return this.curve.jpoint(r,e,t)},JPoint.prototype._threeDbl=function _threeDbl(){var r,e,t;if(this.zOne){var d=this.x.redSqr(),i=this.y.redSqr(),n=i.redSqr(),u=this.x.redAdd(i).redSqr().redISub(d).redISub(n);u=u.redIAdd(u);var s=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),o=s.redSqr().redISub(u).redISub(u);r=o;var h=n.redIAdd(n);h=(h=h.redIAdd(h)).redIAdd(h),e=s.redMul(u.redISub(o)).redISub(h),t=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),p=this.y.redSqr(),a=this.x.redMul(p),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var c=a.redIAdd(a),S=(c=c.redIAdd(c)).redAdd(c);r=f.redSqr().redISub(S),t=this.y.redAdd(this.z).redSqr().redISub(p).redISub(l);var v=p.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),e=f.redMul(c.redISub(r)).redISub(v)}return this.curve.jpoint(r,e,t)},JPoint.prototype._dbl=function _dbl(){var r=this.curve.a,e=this.x,t=this.y,d=this.z,i=d.redSqr().redSqr(),n=e.redSqr(),u=t.redSqr(),s=n.redAdd(n).redIAdd(n).redIAdd(r.redMul(i)),o=e.redAdd(e),h=(o=o.redIAdd(o)).redMul(u),l=s.redSqr().redISub(h.redAdd(h)),p=h.redISub(l),a=u.redSqr();a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var f=s.redMul(p).redISub(a),c=t.redAdd(t).redMul(d);return this.curve.jpoint(l,f,c)},JPoint.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var r=this.x.redSqr(),e=this.y.redSqr(),t=this.z.redSqr(),d=e.redSqr(),i=r.redAdd(r).redIAdd(r),n=i.redSqr(),u=this.x.redAdd(e).redSqr().redISub(r).redISub(d),s=(u=(u=(u=u.redIAdd(u)).redAdd(u).redIAdd(u)).redISub(n)).redSqr(),o=d.redIAdd(d);o=(o=(o=o.redIAdd(o)).redIAdd(o)).redIAdd(o);var h=i.redIAdd(u).redSqr().redISub(n).redISub(s).redISub(o),l=e.redMul(h);l=(l=l.redIAdd(l)).redIAdd(l);var p=this.x.redMul(s).redISub(l);p=(p=p.redIAdd(p)).redIAdd(p);var a=this.y.redMul(h.redMul(o.redISub(h)).redISub(u.redMul(s)));a=(a=(a=a.redIAdd(a)).redIAdd(a)).redIAdd(a);var f=this.z.redAdd(u).redSqr().redISub(t).redISub(s);return this.curve.jpoint(p,a,f)},JPoint.prototype.mul=function mul(r,e){return r=new BN(r,e),this.curve._wnafMul(this,r)},JPoint.prototype.eq=function eq(r){if("affine"===r.type)return this.eq(r.toJ());if(this===r)return!0;var e=this.z.redSqr(),t=r.z.redSqr();if(0!==this.x.redMul(t).redISub(r.x.redMul(e)).cmpn(0))return!1;var d=e.redMul(this.z),i=t.redMul(r.z);return 0===this.y.redMul(i).redISub(r.y.redMul(d)).cmpn(0)},JPoint.prototype.eqXToP=function eqXToP(r){var e=this.z.redSqr(),t=r.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(t))return!0;for(var d=r.clone(),i=this.curve.redN.redMul(e);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},JPoint.prototype.inspect=function inspect(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},JPoint.prototype.isInfinity=function isInfinity(){return 0===this.z.cmpn(0)}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","./base":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/base.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curves.js":[function(require,module,exports){ | |
"use strict";var pre,curves=exports,hash=require("hash.js"),curve=require("./curve"),utils=require("./utils"),assert=utils.assert;function PresetCurve(f){"short"===f.type?this.curve=new curve.short(f):"edwards"===f.type?this.curve=new curve.edwards(f):this.curve=new curve.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,assert(this.g.validate(),"Invalid curve"),assert(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function defineCurve(f,e){Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,get:function(){var a=new PresetCurve(e);return Object.defineProperty(curves,f,{configurable:!0,enumerable:!0,value:a}),a}})}curves.PresetCurve=PresetCurve,defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["9"]}),defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{pre=require("./precomputed/secp256k1")}catch(f){pre=void 0}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",pre]}); | |
},{"./curve":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curve/index.js","./precomputed/secp256k1":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","hash.js":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/index.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),HmacDRBG=require("hmac-drbg"),utils=require("../utils"),curves=require("../curves"),rand=require("brorand"),assert=utils.assert,KeyPair=require("./key"),Signature=require("./signature");function EC(r){if(!(this instanceof EC))return new EC(r);"string"==typeof r&&(assert(curves.hasOwnProperty(r),"Unknown curve "+r),r=curves[r]),r instanceof curves.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}module.exports=EC,EC.prototype.keyPair=function keyPair(r){return new KeyPair(this,r)},EC.prototype.keyFromPrivate=function keyFromPrivate(r,e){return KeyPair.fromPrivate(this,r,e)},EC.prototype.keyFromPublic=function keyFromPublic(r,e){return KeyPair.fromPublic(this,r,e)},EC.prototype.genKeyPair=function genKeyPair(r){r||(r={});for(var e=new HmacDRBG({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||rand(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),n=this.n.sub(new BN(2));;){var i=new BN(e.generate(t));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},EC.prototype._truncateToN=function truncateToN(r,e){var t=8*r.byteLength()-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},EC.prototype.sign=function sign(r,e,t,n){"object"==typeof t&&(n=t,t=null),n||(n={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new BN(r,16));for(var i=this.n.byteLength(),s=e.getPrivate().toArray("be",i),u=r.toArray("be",i),o=new HmacDRBG({hash:this.hash,entropy:s,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),a=this.n.sub(new BN(1)),c=0;;c++){var h=n.k?n.k(c):new BN(o.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(a)>=0)){var m=this.g.mul(h);if(!m.isInfinity()){var v=m.getX(),y=v.umod(this.n);if(0!==y.cmpn(0)){var p=h.invm(this.n).mul(y.mul(e.getPrivate()).iadd(r));if(0!==(p=p.umod(this.n)).cmpn(0)){var f=(m.getY().isOdd()?1:0)|(0!==v.cmp(y)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),f^=1),new Signature({r:y,s:p,recoveryParam:f})}}}}}},EC.prototype.verify=function verify(r,e,t,n){r=this._truncateToN(new BN(r,16)),t=this.keyFromPublic(t,n);var i=(e=new Signature(e,"hex")).r,s=e.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var u,o=s.invm(this.n),a=o.mul(r).umod(this.n),c=o.mul(i).umod(this.n);return this.curve._maxwellTrick?!(u=this.g.jmulAdd(a,t.getPublic(),c)).isInfinity()&&u.eqXToP(i):!(u=this.g.mulAdd(a,t.getPublic(),c)).isInfinity()&&0===u.getX().umod(this.n).cmp(i)},EC.prototype.recoverPubKey=function(r,e,t,n){assert((3&t)===t,"The recovery param is more than two bits"),e=new Signature(e,n);var i=this.n,s=new BN(r),u=e.r,o=e.s,a=1&t,c=t>>1;if(u.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");u=c?this.curve.pointFromX(u.add(this.curve.n),a):this.curve.pointFromX(u,a);var h=e.r.invm(i),m=i.sub(s).mul(h).umod(i),v=o.mul(h).umod(i);return this.g.mulAdd(m,u,v)},EC.prototype.getKeyRecoveryParam=function(r,e,t,n){if(null!==(e=new Signature(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var s;try{s=this.recoverPubKey(r,e,i)}catch(r){continue}if(s.eq(t))return i}throw new Error("Unable to find valid recovery factor")}; | |
},{"../curves":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curves.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","./key":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/key.js","./signature":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/signature.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","brorand":"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js","hmac-drbg":"/Users/lentan/repo/torus/torus-embed/node_modules/hmac-drbg/lib/hmac-drbg.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/key.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert;function KeyPair(i,t){this.ec=i,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}module.exports=KeyPair,KeyPair.fromPublic=function fromPublic(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{pub:t,pubEnc:e})},KeyPair.fromPrivate=function fromPrivate(i,t,e){return t instanceof KeyPair?t:new KeyPair(i,{priv:t,privEnc:e})},KeyPair.prototype.validate=function validate(){var i=this.getPublic();return i.isInfinity()?{result:!1,reason:"Invalid public key"}:i.validate()?i.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},KeyPair.prototype.getPublic=function getPublic(i,t){return"string"==typeof i&&(t=i,i=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,i):this.pub},KeyPair.prototype.getPrivate=function getPrivate(i){return"hex"===i?this.priv.toString(16,2):this.priv},KeyPair.prototype._importPrivate=function _importPrivate(i,t){this.priv=new BN(i,t||16),this.priv=this.priv.umod(this.ec.curve.n)},KeyPair.prototype._importPublic=function _importPublic(i,t){if(i.x||i.y)return"mont"===this.ec.curve.type?assert(i.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||assert(i.x&&i.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(i.x,i.y));this.pub=this.ec.curve.decodePoint(i,t)},KeyPair.prototype.derive=function derive(i){return i.mul(this.priv).getX()},KeyPair.prototype.sign=function sign(i,t,e){return this.ec.sign(i,this,t,e)},KeyPair.prototype.verify=function verify(i,t){return this.ec.verify(i,t,this)},KeyPair.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/ec/signature.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert;function Signature(t,r){if(t instanceof Signature)return t;this._importDER(t,r)||(assert(t.r&&t.s,"Signature without r or s"),this.r=new BN(t.r,16),this.s=new BN(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function Position(){this.place=0}function getLength(t,r){var e=t[r.place++];if(!(128&e))return e;for(var n=15&e,a=0,i=0,c=r.place;i<n;i++,c++)a<<=8,a|=t[c];return r.place=c,a}function rmPadding(t){for(var r=0,e=t.length-1;!t[r]&&!(128&t[r+1])&&r<e;)r++;return 0===r?t:t.slice(r)}function constructLength(t,r){if(r<128)t.push(r);else{var e=1+(Math.log(r)/Math.LN2>>>3);for(t.push(128|e);--e;)t.push(r>>>(e<<3)&255);t.push(r)}}module.exports=Signature,Signature.prototype._importDER=function _importDER(t,r){t=utils.toArray(t,r);var e=new Position;if(48!==t[e.place++])return!1;if(getLength(t,e)+e.place!==t.length)return!1;if(2!==t[e.place++])return!1;var n=getLength(t,e),a=t.slice(e.place,n+e.place);if(e.place+=n,2!==t[e.place++])return!1;var i=getLength(t,e);if(t.length!==i+e.place)return!1;var c=t.slice(e.place,i+e.place);return 0===a[0]&&128&a[1]&&(a=a.slice(1)),0===c[0]&&128&c[1]&&(c=c.slice(1)),this.r=new BN(a),this.s=new BN(c),this.recoveryParam=null,!0},Signature.prototype.toDER=function toDER(t){var r=this.r.toArray(),e=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&e[0]&&(e=[0].concat(e)),r=rmPadding(r),e=rmPadding(e);!(e[0]||128&e[1]);)e=e.slice(1);var n=[2];constructLength(n,r.length),(n=n.concat(r)).push(2),constructLength(n,e.length);var a=n.concat(e),i=[48];return constructLength(i,a.length),i=i.concat(a),utils.encode(i,t)}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/index.js":[function(require,module,exports){ | |
"use strict";var hash=require("hash.js"),curves=require("../curves"),utils=require("../utils"),assert=utils.assert,parseBytes=utils.parseBytes,KeyPair=require("./key"),Signature=require("./signature");function EDDSA(t){if(assert("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(t);t=curves[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=hash.sha512}module.exports=EDDSA,EDDSA.prototype.sign=function sign(t,e){t=parseBytes(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),s=this.encodePoint(i),o=this.hashInt(s,r.pubBytes(),t).mul(r.priv()),u=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:s})},EDDSA.prototype.verify=function verify(t,e,r){t=parseBytes(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),s=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(s)},EDDSA.prototype.hashInt=function hashInt(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return utils.intFromLE(t.digest()).umod(this.curve.n)},EDDSA.prototype.keyFromPublic=function keyFromPublic(t){return KeyPair.fromPublic(this,t)},EDDSA.prototype.keyFromSecret=function keyFromSecret(t){return KeyPair.fromSecret(this,t)},EDDSA.prototype.makeSignature=function makeSignature(t){return t instanceof Signature?t:new Signature(this,t)},EDDSA.prototype.encodePoint=function encodePoint(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},EDDSA.prototype.decodePoint=function decodePoint(t){var e=(t=utils.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=utils.intFromLE(r);return this.curve.pointFromY(i,n)},EDDSA.prototype.encodeInt=function encodeInt(t){return t.toArray("le",this.encodingLength)},EDDSA.prototype.decodeInt=function decodeInt(t){return utils.intFromLE(t)},EDDSA.prototype.isPoint=function isPoint(t){return t instanceof this.pointClass}; | |
},{"../curves":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/curves.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","./key":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/key.js","./signature":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/signature.js","hash.js":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/key.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),assert=utils.assert,parseBytes=utils.parseBytes,cachedProperty=utils.cachedProperty;function KeyPair(e,t){this.eddsa=e,this._secret=parseBytes(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=parseBytes(t.pub)}KeyPair.fromPublic=function fromPublic(e,t){return t instanceof KeyPair?t:new KeyPair(e,{pub:t})},KeyPair.fromSecret=function fromSecret(e,t){return t instanceof KeyPair?t:new KeyPair(e,{secret:t})},KeyPair.prototype.secret=function secret(){return this._secret},cachedProperty(KeyPair,"pubBytes",function pubBytes(){return this.eddsa.encodePoint(this.pub())}),cachedProperty(KeyPair,"pub",function pub(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),cachedProperty(KeyPair,"privBytes",function privBytes(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),cachedProperty(KeyPair,"priv",function priv(){return this.eddsa.decodeInt(this.privBytes())}),cachedProperty(KeyPair,"hash",function hash(){return this.eddsa.hash().update(this.secret()).digest()}),cachedProperty(KeyPair,"messagePrefix",function messagePrefix(){return this.hash().slice(this.eddsa.encodingLength)}),KeyPair.prototype.sign=function sign(e){return assert(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},KeyPair.prototype.verify=function verify(e,t){return this.eddsa.verify(e,t,this)},KeyPair.prototype.getSecret=function getSecret(e){return assert(this._secret,"KeyPair is public only"),utils.encode(this.secret(),e)},KeyPair.prototype.getPublic=function getPublic(e){return utils.encode(this.pubBytes(),e)},module.exports=KeyPair; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/eddsa/signature.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),utils=require("../utils"),assert=utils.assert,cachedProperty=utils.cachedProperty,parseBytes=utils.parseBytes;function Signature(e,t){this.eddsa=e,"object"!=typeof t&&(t=parseBytes(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),assert(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof BN&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}cachedProperty(Signature,"S",function S(){return this.eddsa.decodeInt(this.Sencoded())}),cachedProperty(Signature,"R",function R(){return this.eddsa.decodePoint(this.Rencoded())}),cachedProperty(Signature,"Rencoded",function Rencoded(){return this.eddsa.encodePoint(this.R())}),cachedProperty(Signature,"Sencoded",function Sencoded(){return this.eddsa.encodeInt(this.S())}),Signature.prototype.toBytes=function toBytes(){return this.Rencoded().concat(this.Sencoded())},Signature.prototype.toHex=function toHex(){return utils.encode(this.toBytes(),"hex").toUpperCase()},module.exports=Signature; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js":[function(require,module,exports){ | |
module.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/lib/elliptic/utils.js":[function(require,module,exports){ | |
"use strict";var utils=exports,BN=require("bn.js"),minAssert=require("minimalistic-assert"),minUtils=require("minimalistic-crypto-utils");function getNAF(t,r,e){var i=new Array(Math.max(t.bitLength(),e)+1);i.fill(0);for(var n=1<<r+1,s=t.clone(),l=0;l<i.length;l++){var u,o=s.andln(n-1);s.isOdd()?(u=o>(n>>1)-1?(n>>1)-o:o,s.isubn(u)):u=0,i[l]=u,s.iushrn(1)}return i}function getJSF(t,r){var e=[[],[]];t=t.clone(),r=r.clone();for(var i=0,n=0;t.cmpn(-i)>0||r.cmpn(-n)>0;){var s,l,u,o=t.andln(3)+i&3,a=r.andln(3)+n&3;if(3===o&&(o=-1),3===a&&(a=-1),0==(1&o))s=0;else s=3!==(u=t.andln(7)+i&7)&&5!==u||2!==a?o:-o;if(e[0].push(s),0==(1&a))l=0;else l=3!==(u=r.andln(7)+n&7)&&5!==u||2!==o?a:-a;e[1].push(l),2*i===s+1&&(i=1-i),2*n===l+1&&(n=1-n),t.iushrn(1),r.iushrn(1)}return e}function cachedProperty(t,r,e){var i="_"+r;t.prototype[r]=function cachedProperty(){return void 0!==this[i]?this[i]:this[i]=e.call(this)}}function parseBytes(t){return"string"==typeof t?utils.toArray(t,"hex"):t}function intFromLE(t){return new BN(t,"hex","le")}utils.assert=minAssert,utils.toArray=minUtils.toArray,utils.zero2=minUtils.zero2,utils.toHex=minUtils.toHex,utils.encode=minUtils.encode,utils.getNAF=getNAF,utils.getJSF=getJSF,utils.cachedProperty=cachedProperty,utils.parseBytes=parseBytes,utils.intFromLE=intFromLE; | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js","minimalistic-crypto-utils":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-crypto-utils/lib/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/elliptic/package.json":[function(require,module,exports){ | |
module.exports={ | |
"_args": [ | |
[ | |
"[email protected]", | |
"/Users/lentan/repo/torus/torus-embed" | |
] | |
], | |
"_from": "[email protected]", | |
"_id": "[email protected]", | |
"_inBundle": false, | |
"_integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", | |
"_location": "/elliptic", | |
"_phantomChildren": {}, | |
"_requested": { | |
"type": "version", | |
"registry": true, | |
"raw": "[email protected]", | |
"name": "elliptic", | |
"escapedName": "elliptic", | |
"rawSpec": "6.5.2", | |
"saveSpec": null, | |
"fetchSpec": "6.5.2" | |
}, | |
"_requiredBy": [ | |
"/@toruslabs/torus.js", | |
"/browserify-sign", | |
"/create-ecdh", | |
"/eth-lib", | |
"/secp256k1" | |
], | |
"_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", | |
"_spec": "6.5.2", | |
"_where": "/Users/lentan/repo/torus/torus-embed", | |
"author": { | |
"name": "Fedor Indutny", | |
"email": "[email protected]" | |
}, | |
"bugs": { | |
"url": "https://github.com/indutny/elliptic/issues" | |
}, | |
"dependencies": { | |
"bn.js": "^4.4.0", | |
"brorand": "^1.0.1", | |
"hash.js": "^1.0.0", | |
"hmac-drbg": "^1.0.0", | |
"inherits": "^2.0.1", | |
"minimalistic-assert": "^1.0.0", | |
"minimalistic-crypto-utils": "^1.0.0" | |
}, | |
"description": "EC cryptography", | |
"devDependencies": { | |
"brfs": "^1.4.3", | |
"coveralls": "^3.0.8", | |
"grunt": "^1.0.4", | |
"grunt-browserify": "^5.0.0", | |
"grunt-cli": "^1.2.0", | |
"grunt-contrib-connect": "^1.0.0", | |
"grunt-contrib-copy": "^1.0.0", | |
"grunt-contrib-uglify": "^1.0.1", | |
"grunt-mocha-istanbul": "^3.0.1", | |
"grunt-saucelabs": "^9.0.1", | |
"istanbul": "^0.4.2", | |
"jscs": "^3.0.7", | |
"jshint": "^2.10.3", | |
"mocha": "^6.2.2" | |
}, | |
"files": [ | |
"lib" | |
], | |
"homepage": "https://github.com/indutny/elliptic", | |
"keywords": [ | |
"EC", | |
"Elliptic", | |
"curve", | |
"Cryptography" | |
], | |
"license": "MIT", | |
"main": "lib/elliptic.js", | |
"name": "elliptic", | |
"repository": { | |
"type": "git", | |
"url": "git+ssh://[email protected]/indutny/elliptic.git" | |
}, | |
"scripts": { | |
"jscs": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", | |
"jshint": "jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js", | |
"lint": "npm run jscs && npm run jshint", | |
"test": "npm run lint && npm run unit", | |
"unit": "istanbul test _mocha --reporter=spec test/index.js", | |
"version": "grunt dist && git add dist/" | |
}, | |
"version": "6.5.2" | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/end-of-stream/index.js":[function(require,module,exports){ | |
(function (process){ | |
var once=require("once"),noop=function(){},isRequest=function(e){return e.setHeader&&"function"==typeof e.abort},isChildProcess=function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length},eos=function(e,r,n){if("function"==typeof r)return eos(e,null,r);r||(r={}),n=once(n||noop);var o=e._writableState,t=e._readableState,i=r.readable||!1!==r.readable&&e.readable,s=r.writable||!1!==r.writable&&e.writable,c=!1,l=function(){e.writable||a()},a=function(){s=!1,i||n.call(e)},u=function(){i=!1,s||n.call(e)},d=function(r){n.call(e,r?new Error("exited with error code: "+r):null)},f=function(r){n.call(e,r)},m=function(){process.nextTick(v)},v=function(){if(!c)return(!i||t&&t.ended&&!t.destroyed)&&(!s||o&&o.ended&&!o.destroyed)?void 0:n.call(e,new Error("premature close"))},b=function(){e.req.on("finish",a)};return isRequest(e)?(e.on("complete",a),e.on("abort",m),e.req?b():e.on("request",b)):s&&!o&&(e.on("end",l),e.on("close",l)),isChildProcess(e)&&e.on("exit",d),e.on("end",u),e.on("finish",a),!1!==r.error&&e.on("error",f),e.on("close",m),function(){c=!0,e.removeListener("complete",a),e.removeListener("abort",m),e.removeListener("request",b),e.req&&e.req.removeListener("finish",a),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",a),e.removeListener("exit",d),e.removeListener("end",u),e.removeListener("error",f),e.removeListener("close",m)}};module.exports=eos; | |
}).call(this,require('_process')) | |
},{"_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","once":"/Users/lentan/repo/torus/torus-embed/node_modules/once/once.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/es5-ext/global.js":[function(require,module,exports){ | |
var naiveFallback=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};module.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return naiveFallback()}try{return __global__||naiveFallback()}finally{delete Object.prototype.__global__}}(); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/index.js":[function(require,module,exports){ | |
const{EthereumRpcError:EthereumRpcError,EthereumProviderError:EthereumProviderError}=require("./src/classes"),{serializeError:serializeError,getMessageFromCode:getMessageFromCode}=require("./src/utils"),ethErrors=require("./src/errors"),ERROR_CODES=require("./src/errorCodes.json");module.exports={ethErrors:ethErrors,EthereumRpcError:EthereumRpcError,EthereumProviderError:EthereumProviderError,serializeError:serializeError,getMessageFromCode:getMessageFromCode,ERROR_CODES:ERROR_CODES}; | |
},{"./src/classes":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/classes.js","./src/errorCodes.json":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorCodes.json","./src/errors":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errors.js","./src/utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/classes.js":[function(require,module,exports){ | |
const safeStringify=require("fast-safe-stringify");class EthereumRpcError extends Error{constructor(r,e,t){if(!Number.isInteger(r))throw new Error('"code" must be an integer.');if(!e||"string"!=typeof e)throw new Error('"message" must be a nonempty string.');super(e),this.code=r,void 0!==t&&(this.data=t)}serialize(){const r={code:this.code,message:this.message};return void 0!==this.data&&(r.data=this.data),this.stack&&(r.stack=this.stack),r}toString(){return safeStringify(this.serialize(),stringifyReplacer,2)}}class EthereumProviderError extends EthereumRpcError{constructor(r,e,t){if(!isValidEthProviderCode(r))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(r,e,t)}}function isValidEthProviderCode(r){return Number.isInteger(r)&&r>=1e3&&r<=4999}function stringifyReplacer(r,e){if("[Circular]"!==e)return e}module.exports={EthereumRpcError:EthereumRpcError,EthereumProviderError:EthereumProviderError}; | |
},{"fast-safe-stringify":"/Users/lentan/repo/torus/torus-embed/node_modules/fast-safe-stringify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorCodes.json":[function(require,module,exports){ | |
module.exports={ | |
"rpc": { | |
"invalidInput": -32000, | |
"resourceNotFound": -32001, | |
"resourceUnavailable": -32002, | |
"transactionRejected": -32003, | |
"methodNotSupported": -32004, | |
"parse": -32700, | |
"invalidRequest": -32600, | |
"methodNotFound": -32601, | |
"invalidParams": -32602, | |
"internal": -32603 | |
}, | |
"provider": { | |
"userRejectedRequest": 4001, | |
"unauthorized": 4100, | |
"unsupportedMethod": 4200 | |
} | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorValues.json":[function(require,module,exports){ | |
module.exports={ | |
"-32700": { | |
"standard": "JSON RPC 2.0", | |
"message": "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text." | |
}, | |
"-32600": { | |
"standard": "JSON RPC 2.0", | |
"message": "The JSON sent is not a valid Request object." | |
}, | |
"-32601": { | |
"standard": "JSON RPC 2.0", | |
"message": "The method does not exist / is not available." | |
}, | |
"-32602": { | |
"standard": "JSON RPC 2.0", | |
"message": "Invalid method parameter(s)." | |
}, | |
"-32603": { | |
"standard": "JSON RPC 2.0", | |
"message": "Internal JSON-RPC error." | |
}, | |
"-32000": { | |
"standard": "EIP 1474", | |
"message": "Invalid input." | |
}, | |
"-32001": { | |
"standard": "EIP 1474", | |
"message": "Resource not found." | |
}, | |
"-32002": { | |
"standard": "EIP 1474", | |
"message": "Resource unavailable." | |
}, | |
"-32003": { | |
"standard": "EIP 1474", | |
"message": "Transaction rejected." | |
}, | |
"-32004": { | |
"standard": "EIP 1474", | |
"message": "Method not supported." | |
}, | |
"4001": { | |
"standard": "EIP 1193", | |
"message": "User rejected the request." | |
}, | |
"4100": { | |
"standard": "EIP 1193", | |
"message": "The requested account and/or method has not been authorized by the user." | |
}, | |
"4200": { | |
"standard": "EIP 1193", | |
"message": "The requested method is not supported by this Ethereum provider." | |
} | |
} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errors.js":[function(require,module,exports){ | |
const{EthereumRpcError:EthereumRpcError,EthereumProviderError:EthereumProviderError}=require("./classes"),{getMessageFromCode:getMessageFromCode}=require("./utils"),ERROR_CODES=require("./errorCodes.json");function getEthJsonRpcError(r,e){const[t,o]=validateOpts(e);return new EthereumRpcError(r,t||getMessageFromCode(r),o)}function getEthProviderError(r,e){const[t,o]=validateOpts(e);return new EthereumProviderError(r,t||getMessageFromCode(r),o)}function validateOpts(r){let e,t;return r&&("string"==typeof r?e=r:r&&"object"==typeof r&&!Array.isArray(r)&&(e=r.message,t=r.data)),[e,t]}module.exports={rpc:{parse:r=>getEthJsonRpcError(ERROR_CODES.rpc.parse,r),invalidRequest:r=>getEthJsonRpcError(ERROR_CODES.rpc.invalidRequest,r),invalidParams:r=>getEthJsonRpcError(ERROR_CODES.rpc.invalidParams,r),methodNotFound:r=>getEthJsonRpcError(ERROR_CODES.rpc.methodNotFound,r),internal:r=>getEthJsonRpcError(ERROR_CODES.rpc.internal,r),server:r=>{if("object"!=typeof r||Array.isArray(r))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=r;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return getEthJsonRpcError(e,r)},invalidInput:r=>getEthJsonRpcError(ERROR_CODES.rpc.invalidInput,r),resourceNotFound:r=>getEthJsonRpcError(ERROR_CODES.rpc.resourceNotFound,r),resourceUnavailable:r=>getEthJsonRpcError(ERROR_CODES.rpc.resourceUnavailable,r),transactionRejected:r=>getEthJsonRpcError(ERROR_CODES.rpc.transactionRejected,r),methodNotSupported:r=>getEthJsonRpcError(ERROR_CODES.rpc.methodNotSupported,r)},provider:{userRejectedRequest:r=>getEthProviderError(ERROR_CODES.provider.userRejectedRequest,r),unauthorized:r=>getEthProviderError(ERROR_CODES.provider.unauthorized,r),unsupportedMethod:r=>getEthProviderError(ERROR_CODES.provider.unsupportedMethod,r),custom:r=>{if("object"!=typeof r||Array.isArray(r))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:o}=r;if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string');return new EthereumProviderError(e,t,o)}}}; | |
},{"./classes":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/classes.js","./errorCodes.json":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorCodes.json","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/utils.js":[function(require,module,exports){ | |
const errorValues=require("./errorValues.json"),FALLBACK_ERROR_CODE=require("./errorCodes.json").rpc.internal,{EthereumRpcError:EthereumRpcError}=require("./classes"),JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",FALLBACK_MESSAGE="Unspecified error message. This is a bug, please report it.",FALLBACK_ERROR={code:FALLBACK_ERROR_CODE,message:getMessageFromCode(FALLBACK_ERROR_CODE)};function getMessageFromCode(e,r=FALLBACK_MESSAGE){if(Number.isInteger(e)){const r=e.toString();if(errorValues[r])return errorValues[r].message;if(isJsonRpcServerError(e))return JSON_RPC_SERVER_ERROR_MESSAGE}return r}function isValidCode(e){if(!Number.isInteger(e))return!1;const r=e.toString();return!!errorValues[r]||!!isJsonRpcServerError(e)}function serializeError(e,r=FALLBACK_ERROR){if(!r||!Number.isInteger(r.code)||"string"!=typeof r.message)throw new Error("fallbackError must contain integer number code and string message.");if("object"==typeof e&&e instanceof EthereumRpcError)return e.serialize();const s={};return e&&isValidCode(e.code)?(s.code=e.code,e.message&&"string"==typeof e.message?(s.message=e.message,e.hasOwnProperty("data")&&(s.data=e.data)):(s.message=getMessageFromCode(s.code),s.data={originalError:assignOriginalError(e)})):(s.code=r.code,s.message=e&&e.message?e.message:r.message,s.data={originalError:assignOriginalError(e)}),e&&e.stack&&(s.stack=e.stack),s}function isJsonRpcServerError(e){return e>=-32099&&e<=-32e3}function assignOriginalError(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}module.exports={getMessageFromCode:getMessageFromCode,isValidCode:isValidCode,serializeError:serializeError,JSON_RPC_SERVER_ERROR_MESSAGE:JSON_RPC_SERVER_ERROR_MESSAGE}; | |
},{"./classes":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/classes.js","./errorCodes.json":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorCodes.json","./errorValues.json":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/src/errorValues.json"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eth-lib/lib/hash.js":[function(require,module,exports){ | |
var HEX_CHARS="0123456789abcdef".split(""),KECCAK_PADDING=[1,256,65536,16777216],SHIFT=[0,8,16,24],RC=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Keccak=function Keccak(e){return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t},update=function update(e,t){for(var c,r=t.length,o=e.blocks,a=e.blockCount<<2,k=e.blockCount,s=e.outputBlocks,H=e.s,n=0;n<r;){if(e.reset)for(e.reset=!1,o[0]=e.block,C=1;C<k+1;++C)o[C]=0;if("string"!=typeof t)for(C=e.start;n<r&&C<a;++n)o[C>>2]|=t[n]<<SHIFT[3&C++];else for(C=e.start;n<r&&C<a;++n)(c=t.charCodeAt(n))<128?o[C>>2]|=c<<SHIFT[3&C++]:c<2048?(o[C>>2]|=(192|c>>6)<<SHIFT[3&C++],o[C>>2]|=(128|63&c)<<SHIFT[3&C++]):c<55296||c>=57344?(o[C>>2]|=(224|c>>12)<<SHIFT[3&C++],o[C>>2]|=(128|c>>6&63)<<SHIFT[3&C++],o[C>>2]|=(128|63&c)<<SHIFT[3&C++]):(c=65536+((1023&c)<<10|1023&t.charCodeAt(++n)),o[C>>2]|=(240|c>>18)<<SHIFT[3&C++],o[C>>2]|=(128|c>>12&63)<<SHIFT[3&C++],o[C>>2]|=(128|c>>6&63)<<SHIFT[3&C++],o[C>>2]|=(128|63&c)<<SHIFT[3&C++]);if(e.lastByteIndex=C,C>=a){for(e.start=C-a,e.block=o[k],C=0;C<k;++C)H[C]^=o[C];f(H),e.reset=!0}else e.start=C}if(o[(C=e.lastByteIndex)>>2]|=KECCAK_PADDING[3&C],e.lastByteIndex===a)for(o[0]=o[k],C=1;C<k+1;++C)o[C]=0;for(o[k-1]|=2147483648,C=0;C<k;++C)H[C]^=o[C];f(H);for(var l,u="",C=0,S=0;S<s;){for(C=0;C<k&&S<s;++C,++S)l=H[C],u+=HEX_CHARS[l>>4&15]+HEX_CHARS[15&l]+HEX_CHARS[l>>12&15]+HEX_CHARS[l>>8&15]+HEX_CHARS[l>>20&15]+HEX_CHARS[l>>16&15]+HEX_CHARS[l>>28&15]+HEX_CHARS[l>>24&15];S%k==0&&(f(H),C=0)}return"0x"+u},f=function f(e){var t,c,r,o,a,k,s,H,n,l,u,C,S,I,A,i,F,R,T,E,_,d,p,b,X,v,K,x,h,B,y,D,g,G,N,P,m,j,q,w,z,J,L,M,O,Q,U,V,W,Y,Z,$,ee,te,ce,re,oe,ae,ke,se,He,fe,ne;for(r=0;r<48;r+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],k=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],H=e[4]^e[14]^e[24]^e[34]^e[44],n=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],t=(C=e[8]^e[18]^e[28]^e[38]^e[48])^(k<<1|s>>>31),c=(S=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|k>>>31),e[0]^=t,e[1]^=c,e[10]^=t,e[11]^=c,e[20]^=t,e[21]^=c,e[30]^=t,e[31]^=c,e[40]^=t,e[41]^=c,t=o^(H<<1|n>>>31),c=a^(n<<1|H>>>31),e[2]^=t,e[3]^=c,e[12]^=t,e[13]^=c,e[22]^=t,e[23]^=c,e[32]^=t,e[33]^=c,e[42]^=t,e[43]^=c,t=k^(l<<1|u>>>31),c=s^(u<<1|l>>>31),e[4]^=t,e[5]^=c,e[14]^=t,e[15]^=c,e[24]^=t,e[25]^=c,e[34]^=t,e[35]^=c,e[44]^=t,e[45]^=c,t=H^(C<<1|S>>>31),c=n^(S<<1|C>>>31),e[6]^=t,e[7]^=c,e[16]^=t,e[17]^=c,e[26]^=t,e[27]^=c,e[36]^=t,e[37]^=c,e[46]^=t,e[47]^=c,t=l^(o<<1|a>>>31),c=u^(a<<1|o>>>31),e[8]^=t,e[9]^=c,e[18]^=t,e[19]^=c,e[28]^=t,e[29]^=c,e[38]^=t,e[39]^=c,e[48]^=t,e[49]^=c,I=e[0],A=e[1],Q=e[11]<<4|e[10]>>>28,U=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,h=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,He=e[30]<<9|e[31]>>>23,J=e[40]<<18|e[41]>>>14,L=e[41]<<18|e[40]>>>14,G=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,i=e[13]<<12|e[12]>>>20,F=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,W=e[23]<<10|e[22]>>>22,B=e[33]<<13|e[32]>>>19,y=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ne=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ce=e[4]<<30|e[5]>>>2,P=e[14]<<6|e[15]>>>26,m=e[15]<<6|e[14]>>>26,R=e[25]<<11|e[24]>>>21,T=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,D=e[45]<<29|e[44]>>>3,g=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,X=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,oe=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,q=e[27]<<25|e[26]>>>7,E=e[36]<<21|e[37]>>>11,_=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,M=e[8]<<27|e[9]>>>5,O=e[9]<<27|e[8]>>>5,v=e[18]<<20|e[19]>>>12,K=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,ke=e[28]<<7|e[29]>>>25,w=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,d=e[48]<<14|e[49]>>>18,p=e[49]<<14|e[48]>>>18,e[0]=I^~i&R,e[1]=A^~F&T,e[10]=b^~v&x,e[11]=X^~K&h,e[20]=G^~P&j,e[21]=N^~m&q,e[30]=M^~Q&V,e[31]=O^~U&W,e[40]=te^~re&ae,e[41]=ce^~oe&ke,e[2]=i^~R&E,e[3]=F^~T&_,e[12]=v^~x&B,e[13]=K^~h&y,e[22]=P^~j&w,e[23]=m^~q&z,e[32]=Q^~V&Y,e[33]=U^~W&Z,e[42]=re^~ae&se,e[43]=oe^~ke&He,e[4]=R^~E&d,e[5]=T^~_&p,e[14]=x^~B&D,e[15]=h^~y&g,e[24]=j^~w&J,e[25]=q^~z&L,e[34]=V^~Y&$,e[35]=W^~Z&ee,e[44]=ae^~se&fe,e[45]=ke^~He&ne,e[6]=E^~d&I,e[7]=_^~p&A,e[16]=B^~D&b,e[17]=y^~g&X,e[26]=w^~J&G,e[27]=z^~L&N,e[36]=Y^~$&M,e[37]=Z^~ee&O,e[46]=se^~fe&te,e[47]=He^~ne&ce,e[8]=d^~I&i,e[9]=p^~A&F,e[18]=D^~b&v,e[19]=g^~X&K,e[28]=J^~G&P,e[29]=L^~N&m,e[38]=$^~M&Q,e[39]=ee^~O&U,e[48]=fe^~te&re,e[49]=ne^~ce&oe,e[0]^=RC[r],e[1]^=RC[r+1]},keccak=function keccak(e){return function(t){var c;if("0x"===t.slice(0,2)){c=[];for(var r=2,o=t.length;r<o;r+=2)c.push(parseInt(t.slice(r,r+2),16))}else c=t;return update(Keccak(e,e),c)}};module.exports={keccak256:keccak(256),keccak512:keccak(512),keccak256s:keccak(256),keccak512s:keccak(512)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethereum-bloom-filters/dist/index.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const utils_1=require("./utils");function isBloom(o){return"string"==typeof o&&(!!/^(0x)?[0-9a-f]{512}$/i.test(o)&&!(!/^(0x)?[0-9a-f]{512}$/.test(o)&&!/^(0x)?[0-9A-F]{512}$/.test(o)))}function isInBloom(o,r){"object"==typeof r&&r.constructor===Uint8Array&&(r=utils_1.bytesToHex(r));const t=utils_1.keccak256(r).replace("0x","");for(let r=0;r<12;r+=4){const s=(parseInt(t.substr(r,2),16)<<8)+parseInt(t.substr(r+2,2),16)&2047,e=1<<s%4;if((codePointToInt(o.charCodeAt(o.length-1-Math.floor(s/4)))&e)!==e)return!1}return!0}function codePointToInt(o){if(o>=48&&o<=57)return o-48;if(o>=65&&o<=70)return o-55;if(o>=97&&o<=102)return o-87;throw new Error("invalid bloom")}function isUserEthereumAddressInBloom(o,r){if(!isBloom(o))throw new Error("Invalid bloom given");if(!isAddress(r))throw new Error(`Invalid ethereum address given: "${r}"`);return isInBloom(o,utils_1.padLeft(r,64))}function isContractAddressInBloom(o,r){if(!isBloom(o))throw new Error("Invalid bloom given");if(!isAddress(r))throw new Error(`Invalid contract address given: "${r}"`);return isInBloom(o,r)}function isTopicInBloom(o,r){if(!isBloom(o))throw new Error("Invalid bloom given");if(!isTopic(r))throw new Error("Invalid topic");return isInBloom(o,r)}function isTopic(o){return"string"==typeof o&&(!!/^(0x)?[0-9a-f]{64}$/i.test(o)&&!(!/^(0x)?[0-9a-f]{64}$/.test(o)&&!/^(0x)?[0-9A-F]{64}$/.test(o)))}function isAddress(o){return"string"==typeof o&&(!!o.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!o.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}exports.isBloom=isBloom,exports.isInBloom=isInBloom,exports.isUserEthereumAddressInBloom=isUserEthereumAddressInBloom,exports.isContractAddressInBloom=isContractAddressInBloom,exports.isTopicInBloom=isTopicInBloom,exports.isTopic=isTopic,exports.isAddress=isAddress; | |
},{"./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/ethereum-bloom-filters/dist/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethereum-bloom-filters/dist/utils.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sha3=require("js-sha3");function keccak256(r){return"0x"+sha3.keccak_256(toByteArray(r))}function bytesToHex(r){let t=[];for(let e=0;e<r.length;e++)t.push((r[e]>>>4).toString(16)),t.push((15&r[e]).toString(16));return`0x${t.join("").replace(/^0+/,"")}`}function toByteArray(r){if(null==r)throw new Error("cannot convert null value to array");if("string"==typeof r){let t=r.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(r=r.substring(2)).length%2&&(r="0"+r);const e=[];for(let t=0;t<r.length;t+=2)e.push(parseInt(r.substr(t,2),16));return addSlice(new Uint8Array(e))}if(isByteArray(r))return addSlice(new Uint8Array(r));throw new Error("invalid arrayify value")}function isByteArray(r){if(!r||parseInt(String(r.length))!=r.length||"string"==typeof r)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(e<0||e>=256||parseInt(String(e))!=e)return!1}return!0}function addSlice(r){return r.slice?r:(r.slice=function(){const t=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(r,t)))},r)}exports.keccak256=keccak256,exports.padLeft=((r,t)=>{const e=/^0x/i.test(r)||"number"==typeof r,n=t-(r=r.toString().replace(/^0x/i,"")).length+1>=0?t-r.length+1:0;return(e?"0x":"")+new Array(n).join("0")+r}),exports.bytesToHex=bytesToHex,exports.toByteArray=toByteArray; | |
},{"js-sha3":"/Users/lentan/repo/torus/torus-embed/node_modules/js-sha3/src/sha3.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/node_modules/js-sha3/src/sha3.js":[function(require,module,exports){ | |
(function (process,global){ | |
!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=global);for(var e=!t.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,r="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],i=[224,256,384,512],n=["hex","buffer","arrayBuffer","array"],a=function(t,e,r){return function(o){return new Keccak(t,e,t).update(o)[r]()}},c=function(t,e,r){return function(o,s){return new Keccak(t,e,s).update(o)[r]()}},u=function(t,e){var r=a(t,e,"hex");r.create=function(){return new Keccak(t,e,t)},r.update=function(t){return r.create().update(t)};for(var o=0;o<n.length;++o){var s=n[o];r[s]=a(t,e,s)}return r},h=[{name:"keccak",padding:[1,256,65536,16777216],bits:i,createMethod:u},{name:"sha3",padding:[6,1536,393216,100663296],bits:i,createMethod:u},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new Keccak(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var o=0;o<n.length;++o){var s=n[o];r[s]=c(t,e,s)}return r}}],f={},p=[],l=0;l<h.length;++l)for(var d=h[l],k=d.bits,y=0;y<k.length;++y){var b=d.name+"_"+k[y];p.push(b),f[b]=d.createMethod(k[y],d.padding)}function Keccak(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var o=0;o<50;++o)this.s[o]=0}Keccak.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,s,i=t.length,n=this.blocks,a=this.byteCount,c=this.blockCount,u=0,h=this.s;u<i;){if(this.reset)for(this.reset=!1,n[0]=this.block,r=1;r<c+1;++r)n[r]=0;if(e)for(r=this.start;u<i&&r<a;++u)n[r>>2]|=t[u]<<o[3&r++];else for(r=this.start;u<i&&r<a;++u)(s=t.charCodeAt(u))<128?n[r>>2]|=s<<o[3&r++]:s<2048?(n[r>>2]|=(192|s>>6)<<o[3&r++],n[r>>2]|=(128|63&s)<<o[3&r++]):s<55296||s>=57344?(n[r>>2]|=(224|s>>12)<<o[3&r++],n[r>>2]|=(128|s>>6&63)<<o[3&r++],n[r>>2]|=(128|63&s)<<o[3&r++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++u)),n[r>>2]|=(240|s>>18)<<o[3&r++],n[r>>2]|=(128|s>>12&63)<<o[3&r++],n[r>>2]|=(128|s>>6&63)<<o[3&r++],n[r>>2]|=(128|63&s)<<o[3&r++]);if(this.lastByteIndex=r,r>=a){for(this.start=r-a,this.block=n[c],r=0;r<c;++r)h[r]^=n[r];v(h),this.reset=!0}else this.start=r}return this},Keccak.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,o=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)o[e]^=t[e];v(o)},Keccak.prototype.toString=Keccak.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,o=this.s,s=this.outputBlocks,i=this.extraBytes,n=0,a=0,c="";a<s;){for(n=0;n<e&&a<s;++n,++a)t=o[n],c+=r[t>>4&15]+r[15&t]+r[t>>12&15]+r[t>>8&15]+r[t>>20&15]+r[t>>16&15]+r[t>>28&15]+r[t>>24&15];a%e==0&&(v(o),n=0)}return i&&(t=o[n],i>0&&(c+=r[t>>4&15]+r[15&t]),i>1&&(c+=r[t>>12&15]+r[t>>8&15]),i>2&&(c+=r[t>>20&15]+r[t>>16&15])),c},Keccak.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,o=this.outputBlocks,s=this.extraBytes,i=0,n=0,a=this.outputBits>>3;t=s?new ArrayBuffer(o+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(t);n<o;){for(i=0;i<e&&n<o;++i,++n)c[n]=r[i];n%e==0&&v(r)}return s&&(c[i]=r[i],t=t.slice(0,a)),t},Keccak.prototype.buffer=Keccak.prototype.arrayBuffer,Keccak.prototype.digest=Keccak.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,o=this.s,s=this.outputBlocks,i=this.extraBytes,n=0,a=0,c=[];a<s;){for(n=0;n<r&&a<s;++n,++a)t=a<<2,e=o[n],c[t]=255&e,c[t+1]=e>>8&255,c[t+2]=e>>16&255,c[t+3]=e>>24&255;a%r==0&&v(o)}return i&&(t=a<<2,e=o[n],i>0&&(c[t]=255&e),i>1&&(c[t+1]=e>>8&255),i>2&&(c[t+2]=e>>16&255)),c};var v=function(t){var e,r,o,i,n,a,c,u,h,f,p,l,d,k,y,b,v,B,g,K,x,C,w,A,_,m,S,M,O,z,J,N,j,I,H,U,D,E,q,F,G,L,P,Q,R,T,V,W,X,Y,Z,$,tt,et,rt,ot,st,it,nt,at,ct,ut,ht;for(o=0;o<48;o+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],c=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],f=t[6]^t[16]^t[26]^t[36]^t[46],p=t[7]^t[17]^t[27]^t[37]^t[47],e=(l=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|c>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(c<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|h>>>31),r=n^(h<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(f<<1|p>>>31),r=c^(p<<1|f>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(l<<1|d>>>31),r=h^(d<<1|l>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=f^(i<<1|n>>>31),r=p^(n<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,k=t[0],y=t[1],T=t[11]<<4|t[10]>>>28,V=t[10]<<4|t[11]>>>28,M=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ct=t[30]<<9|t[31]>>>23,L=t[40]<<18|t[41]>>>14,P=t[41]<<18|t[40]>>>14,I=t[2]<<1|t[3]>>>31,H=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,v=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,z=t[33]<<13|t[32]>>>19,J=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,D=t[15]<<6|t[14]>>>26,B=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,Y=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,N=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,A=t[6]<<28|t[7]>>>4,_=t[7]<<28|t[6]>>>4,ot=t[17]<<23|t[16]>>>9,st=t[16]<<23|t[17]>>>9,E=t[26]<<25|t[27]>>>7,q=t[27]<<25|t[26]>>>7,K=t[36]<<21|t[37]>>>11,x=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Q=t[8]<<27|t[9]>>>5,R=t[9]<<27|t[8]>>>5,m=t[18]<<20|t[19]>>>12,S=t[19]<<20|t[18]>>>12,it=t[29]<<7|t[28]>>>25,nt=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,G=t[39]<<8|t[38]>>>24,C=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=k^~b&B,t[1]=y^~v&g,t[10]=A^~m&M,t[11]=_^~S&O,t[20]=I^~U&E,t[21]=H^~D&q,t[30]=Q^~T&W,t[31]=R^~V&X,t[40]=et^~ot&it,t[41]=rt^~st&nt,t[2]=b^~B&K,t[3]=v^~g&x,t[12]=m^~M&z,t[13]=S^~O&J,t[22]=U^~E&F,t[23]=D^~q&G,t[32]=T^~W&Y,t[33]=V^~X&Z,t[42]=ot^~it&at,t[43]=st^~nt&ct,t[4]=B^~K&C,t[5]=g^~x&w,t[14]=M^~z&N,t[15]=O^~J&j,t[24]=E^~F&L,t[25]=q^~G&P,t[34]=W^~Y&$,t[35]=X^~Z&tt,t[44]=it^~at&ut,t[45]=nt^~ct&ht,t[6]=K^~C&k,t[7]=x^~w&y,t[16]=z^~N&A,t[17]=J^~j&_,t[26]=F^~L&I,t[27]=G^~P&H,t[36]=Y^~$&Q,t[37]=Z^~tt&R,t[46]=at^~ut&et,t[47]=ct^~ht&rt,t[8]=C^~k&b,t[9]=w^~y&v,t[18]=N^~A&m,t[19]=j^~_&S,t[28]=L^~I&U,t[29]=P^~H&D,t[38]=$^~Q&T,t[39]=tt^~R&V,t[48]=ut^~et&ot,t[49]=ht^~rt&st,t[0]^=s[o],t[1]^=s[o+1]};if(e)module.exports=f;else for(l=0;l<p.length;++l)t[p[l]]=f[p[l]]}(); | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/abi-coder.js":[function(require,module,exports){ | |
"use strict";var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])};return function(r,t){function __(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r};Object.defineProperty(exports,"__esModule",{value:!0});var address_1=require("./address"),bignumber_1=require("./bignumber"),bytes_1=require("./bytes"),utf8_1=require("./utf8"),properties_1=require("./properties"),errors=__importStar(require("./errors")),paramTypeBytes=new RegExp(/^bytes([0-9]*)$/),paramTypeNumber=new RegExp(/^(u?int)([0-9]*)$/),paramTypeArray=new RegExp(/^(.*)\[([0-9]*)\]$/);exports.defaultCoerceFunc=function(e,r){var t=e.match(paramTypeNumber);return t&&parseInt(t[2])<=48?r.toNumber():r};var regexParen=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),regexIdentifier=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function verifyType(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}function parseParam(e,r){function throwError(r){throw new Error('unexpected character "'+e[r]+'" at position '+r+' in "'+e+'"')}for(var t={type:"",name:"",state:{allowType:!0}},n=t,o=0;o<e.length;o++){var a=e[o];switch(a){case"(":n.state.allowParams||throwError(o),n.state.allowType=!1,n.type=verifyType(n.type),n.components=[{type:"",name:"",parent:n,state:{allowType:!0}}],n=n.components[0];break;case")":delete n.state,r&&"indexed"===n.name&&(n.indexed=!0,n.name=""),n.type=verifyType(n.type);var i=n;(n=n.parent)||throwError(o),delete i.parent,n.state.allowParams=!1,n.state.allowName=!0,n.state.allowArray=!0;break;case",":delete n.state,r&&"indexed"===n.name&&(n.indexed=!0,n.name=""),n.type=verifyType(n.type);var s={type:"",name:"",parent:n.parent,state:{allowType:!0}};n.parent.components.push(s),delete n.parent,n=s;break;case" ":n.state.allowType&&""!==n.type&&(n.type=verifyType(n.type),delete n.state.allowType,n.state.allowName=!0,n.state.allowParams=!0),n.state.allowName&&""!==n.name&&(r&&"indexed"===n.name?(n.indexed=!0,n.name=""):n.state.allowName=!1);break;case"[":n.state.allowArray||throwError(o),n.type+=a,n.state.allowArray=!1,n.state.allowName=!1,n.state.readArray=!0;break;case"]":n.state.readArray||throwError(o),n.type+=a,n.state.readArray=!1,n.state.allowArray=!0,n.state.allowName=!0;break;default:n.state.allowType?(n.type+=a,n.state.allowParams=!0,n.state.allowArray=!0):n.state.allowName?(n.name+=a,delete n.state.allowArray):n.state.readArray?n.type+=a:throwError(o)}}if(n.parent)throw new Error("unexpected eof");return delete t.state,r&&"indexed"===n.name&&(n.indexed=!0,n.name=""),t.type=verifyType(t.type),t}function parseSignatureEvent(e){var r={anonymous:!1,inputs:[],name:"",type:"event"},t=e.match(regexParen);if(!t)throw new Error("invalid event: "+e);if(r.name=t[1].trim(),splitNesting(t[2]).forEach(function(e){(e=parseParam(e,!0)).indexed=!!e.indexed,r.inputs.push(e)}),t[3].split(" ").forEach(function(e){switch(e){case"anonymous":r.anonymous=!0;break;case"":break;default:console.log("unknown modifier: "+e)}}),r.name&&!r.name.match(regexIdentifier))throw new Error('invalid identifier: "'+r.name+'"');return r}function parseSignatureFunction(e){var r={constant:!1,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},t=e.split(" returns "),n=t[0].match(regexParen);if(!n)throw new Error("invalid signature");if(r.name=n[1].trim(),!r.name.match(regexIdentifier))throw new Error('invalid identifier: "'+n[1]+'"');if(splitNesting(n[2]).forEach(function(e){r.inputs.push(parseParam(e))}),n[3].split(" ").forEach(function(e){switch(e){case"constant":r.constant=!0;break;case"payable":r.payable=!0;break;case"pure":r.constant=!0,r.stateMutability="pure";break;case"view":r.constant=!0,r.stateMutability="view";break;case"":break;default:console.log("unknown modifier: "+e)}}),t.length>1){var o=t[1].match(regexParen);if(""!=o[1].trim()||""!=o[3].trim())throw new Error("unexpected tokens");splitNesting(o[2]).forEach(function(e){r.outputs.push(parseParam(e))})}return r}function parseParamType(e){return parseParam(e,!0)}function formatParamType(e){return getParamCoder(exports.defaultCoerceFunc,e).type}function formatSignature(e){return e.name+"("+e.inputs.map(function(e){return formatParamType(e)}).join(",")+")"}function parseSignature(e){if("string"==typeof e)return"event "===(e=(e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?parseSignatureEvent(e.substring(6).trim()):("function "===e.substring(0,9)&&(e=e.substring(9)),parseSignatureFunction(e.trim()));throw new Error("unknown signature")}exports.parseParamType=parseParamType,exports.formatParamType=formatParamType,exports.formatSignature=formatSignature,exports.parseSignature=parseSignature;var Coder=function(){return function Coder(e,r,t,n,o){this.coerceFunc=e,this.name=r,this.type=t,this.localName=n,this.dynamic=o}}(),CoderAnonymous=function(e){function CoderAnonymous(r){var t=e.call(this,r.coerceFunc,r.name,r.type,void 0,r.dynamic)||this;return properties_1.defineReadOnly(t,"coder",r),t}return __extends(CoderAnonymous,e),CoderAnonymous.prototype.encode=function(e){return this.coder.encode(e)},CoderAnonymous.prototype.decode=function(e,r){return this.coder.decode(e,r)},CoderAnonymous}(Coder),CoderNull=function(e){function CoderNull(r,t){return e.call(this,r,"null","",t,!1)||this}return __extends(CoderNull,e),CoderNull.prototype.encode=function(e){return bytes_1.arrayify([])},CoderNull.prototype.decode=function(e,r){if(r>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},CoderNull}(Coder),CoderNumber=function(e){function CoderNumber(r,t,n,o){var a=this,i=(n?"int":"uint")+8*t;return(a=e.call(this,r,i,i,o,!1)||this).size=t,a.signed=n,a}return __extends(CoderNumber,e),CoderNumber.prototype.encode=function(e){try{var r=bignumber_1.bigNumberify(e);return r=r.toTwos(8*this.size).maskn(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(256)),bytes_1.padZeros(bytes_1.arrayify(r),32)}catch(r){errors.throwError("invalid number value",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},CoderNumber.prototype.decode=function(e,r){e.length<r+32&&errors.throwError("insufficient data for "+this.name+" type",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:bytes_1.hexlify(e.slice(r,r+32))});var t=32-this.size,n=bignumber_1.bigNumberify(e.slice(r+t,r+32));return n=this.signed?n.fromTwos(8*this.size):n.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,n)}},CoderNumber}(Coder),uint256Coder=new CoderNumber(function(e,r){return r},32,!1,"none"),CoderBoolean=function(e){function CoderBoolean(r,t){return e.call(this,r,"bool","bool",t,!1)||this}return __extends(CoderBoolean,e),CoderBoolean.prototype.encode=function(e){return uint256Coder.encode(e?1:0)},CoderBoolean.prototype.decode=function(e,r){try{var t=uint256Coder.decode(e,r)}catch(e){throw"insufficient data for uint256 type"===e.reason&&errors.throwError("insufficient data for boolean type",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:e.value}),e}return{consumed:t.consumed,value:this.coerceFunc("bool",!t.value.isZero())}},CoderBoolean}(Coder),CoderFixedBytes=function(e){function CoderFixedBytes(r,t,n){var o=this,a="bytes"+t;return(o=e.call(this,r,a,a,n,!1)||this).length=t,o}return __extends(CoderFixedBytes,e),CoderFixedBytes.prototype.encode=function(e){var r=new Uint8Array(32);try{var t=bytes_1.arrayify(e);if(t.length>32)throw new Error;r.set(t)}catch(r){errors.throwError("invalid "+this.name+" value",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:r.value||e})}return r},CoderFixedBytes.prototype.decode=function(e,r){return e.length<r+32&&errors.throwError("insufficient data for "+name+" type",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:bytes_1.hexlify(e.slice(r,r+32))}),{consumed:32,value:this.coerceFunc(this.name,bytes_1.hexlify(e.slice(r,r+this.length)))}},CoderFixedBytes}(Coder),CoderAddress=function(e){function CoderAddress(r,t){return e.call(this,r,"address","address",t,!1)||this}return __extends(CoderAddress,e),CoderAddress.prototype.encode=function(e){var r=new Uint8Array(32);try{r.set(bytes_1.arrayify(address_1.getAddress(e)),12)}catch(r){errors.throwError("invalid address",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:e})}return r},CoderAddress.prototype.decode=function(e,r){return e.length<r+32&&errors.throwError("insufficuent data for address type",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:bytes_1.hexlify(e.slice(r,r+32))}),{consumed:32,value:this.coerceFunc("address",address_1.getAddress(bytes_1.hexlify(e.slice(r+12,r+32))))}},CoderAddress}(Coder);function _encodeDynamicBytes(e){var r=32*Math.ceil(e.length/32),t=new Uint8Array(r-e.length);return bytes_1.concat([uint256Coder.encode(e.length),e,t])}function _decodeDynamicBytes(e,r,t){e.length<r+32&&errors.throwError("insufficient data for dynamicBytes length",errors.INVALID_ARGUMENT,{arg:t,coderType:"dynamicBytes",value:bytes_1.hexlify(e.slice(r,r+32))});var n=uint256Coder.decode(e,r).value;try{n=n.toNumber()}catch(e){errors.throwError("dynamic bytes count too large",errors.INVALID_ARGUMENT,{arg:t,coderType:"dynamicBytes",value:n.toString()})}return e.length<r+32+n&&errors.throwError("insufficient data for dynamicBytes type",errors.INVALID_ARGUMENT,{arg:t,coderType:"dynamicBytes",value:bytes_1.hexlify(e.slice(r,r+32+n))}),{consumed:32+32*Math.ceil(n/32),value:e.slice(r+32,r+32+n)}}var CoderDynamicBytes=function(e){function CoderDynamicBytes(r,t){return e.call(this,r,"bytes","bytes",t,!0)||this}return __extends(CoderDynamicBytes,e),CoderDynamicBytes.prototype.encode=function(e){try{return _encodeDynamicBytes(bytes_1.arrayify(e))}catch(e){errors.throwError("invalid bytes value",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:e.value})}return null},CoderDynamicBytes.prototype.decode=function(e,r){var t=_decodeDynamicBytes(e,r,this.localName);return t.value=this.coerceFunc("bytes",bytes_1.hexlify(t.value)),t},CoderDynamicBytes}(Coder),CoderString=function(e){function CoderString(r,t){return e.call(this,r,"string","string",t,!0)||this}return __extends(CoderString,e),CoderString.prototype.encode=function(e){return"string"!=typeof e&&errors.throwError("invalid string value",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:e}),_encodeDynamicBytes(utf8_1.toUtf8Bytes(e))},CoderString.prototype.decode=function(e,r){var t=_decodeDynamicBytes(e,r,this.localName);return t.value=this.coerceFunc("string",utf8_1.toUtf8String(t.value)),t},CoderString}(Coder);function alignSize(e){return 32*Math.ceil(e/32)}function pack(e,r){if(Array.isArray(r));else if(r&&"object"==typeof r){var t=[];e.forEach(function(e){t.push(r[e.localName])}),r=t}else errors.throwError("invalid tuple value",errors.INVALID_ARGUMENT,{coderType:"tuple",value:r});e.length!==r.length&&errors.throwError("types/value length mismatch",errors.INVALID_ARGUMENT,{coderType:"tuple",value:r});var n=[];e.forEach(function(e,t){n.push({dynamic:e.dynamic,value:e.encode(r[t])})});var o=0,a=0;n.forEach(function(e){e.dynamic?(o+=32,a+=alignSize(e.value.length)):o+=alignSize(e.value.length)});var i=0,s=o,u=new Uint8Array(o+a);return n.forEach(function(e){e.dynamic?(u.set(uint256Coder.encode(s),i),i+=32,u.set(e.value,s),s+=alignSize(e.value.length)):(u.set(e.value,i),i+=alignSize(e.value.length))}),u}function unpack(e,r,t){var n=t,o=0,a=[];return e.forEach(function(e){if(e.dynamic){var i=uint256Coder.decode(r,t);(s=e.decode(r,n+i.value.toNumber())).consumed=i.consumed}else var s=e.decode(r,t);null!=s.value&&a.push(s.value),t+=s.consumed,o+=s.consumed}),e.forEach(function(e,r){var t=e.localName;t&&("length"===t&&(t="_length"),null==a[t]&&(a[t]=a[r]))}),{value:a,consumed:o}}var CoderArray=function(e){function CoderArray(r,t,n,o){var a=this,i=t.type+"["+(n>=0?n:"")+"]",s=-1===n||t.dynamic;return(a=e.call(this,r,"array",i,o,s)||this).coder=t,a.length=n,a}return __extends(CoderArray,e),CoderArray.prototype.encode=function(e){Array.isArray(e)||errors.throwError("expected array value",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var r=this.length,t=new Uint8Array(0);-1===r&&(r=e.length,t=uint256Coder.encode(r)),errors.checkArgumentCount(r,e.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],o=0;o<e.length;o++)n.push(this.coder);return bytes_1.concat([t,pack(n,e)])},CoderArray.prototype.decode=function(e,r){var t=0,n=this.length;if(-1===n){try{var o=uint256Coder.decode(e,r)}catch(e){errors.throwError("insufficient data for dynamic array length",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e.value})}try{n=o.value.toNumber()}catch(e){errors.throwError("array count too large",errors.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:o.value.toString()})}t+=o.consumed,r+=o.consumed}for(var a=[],i=0;i<n;i++)a.push(new CoderAnonymous(this.coder));var s=unpack(a,e,r);return s.consumed+=t,s.value=this.coerceFunc(this.type,s.value),s},CoderArray}(Coder),CoderTuple=function(e){function CoderTuple(r,t,n){var o=this,a=!1,i=[];t.forEach(function(e){e.dynamic&&(a=!0),i.push(e.type)});var s="tuple("+i.join(",")+")";return(o=e.call(this,r,"tuple",s,n,a)||this).coders=t,o}return __extends(CoderTuple,e),CoderTuple.prototype.encode=function(e){return pack(this.coders,e)},CoderTuple.prototype.decode=function(e,r){var t=unpack(this.coders,e,r);return t.value=this.coerceFunc(this.type,t.value),t},CoderTuple}(Coder);function splitNesting(e){for(var r=[],t="",n=0,o=0;o<e.length;o++){var a=e[o];if(","===a&&0===n)r.push(t),t="";else if(t+=a,"("===a)n++;else if(")"===a&&-1===--n)throw new Error("unbalanced parenthsis")}return r.push(t),r}var paramTypeSimple={address:CoderAddress,bool:CoderBoolean,string:CoderString,bytes:CoderDynamicBytes};function getTupleParamCoder(e,r,t){r||(r=[]);var n=[];return r.forEach(function(r){n.push(getParamCoder(e,r))}),new CoderTuple(e,n,t)}function getParamCoder(e,r){var t,n=paramTypeSimple[r.type];if(n)return new n(e,r.name);if(t=r.type.match(paramTypeNumber))return(0===(o=parseInt(t[2]||"256"))||o>256||o%8!=0)&&errors.throwError("invalid "+t[1]+" bit length",errors.INVALID_ARGUMENT,{arg:"param",value:r}),new CoderNumber(e,o/8,"int"===t[1],r.name);if(t=r.type.match(paramTypeBytes))return(0===(o=parseInt(t[1]))||o>32)&&errors.throwError("invalid bytes length",errors.INVALID_ARGUMENT,{arg:"param",value:r}),new CoderFixedBytes(e,o,r.name);if(t=r.type.match(paramTypeArray)){var o=parseInt(t[2]||"-1");return(r=properties_1.jsonCopy(r)).type=t[1],new CoderArray(e,getParamCoder(e,r),o,r.name)}return"tuple"===r.type.substring(0,5)?getTupleParamCoder(e,r.components,r.name):""===r.type?new CoderNull(e,r.name):(errors.throwError("invalid type",errors.INVALID_ARGUMENT,{arg:"type",value:r.type}),null)}var AbiCoder=function(){function AbiCoder(e){errors.checkNew(this,AbiCoder),e||(e=exports.defaultCoerceFunc),properties_1.defineReadOnly(this,"coerceFunc",e)}return AbiCoder.prototype.encode=function(e,r){e.length!==r.length&&errors.throwError("types/values length mismatch",errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});var t=[];return e.forEach(function(e){var r=null;r="string"==typeof e?parseParam(e):e,t.push(getParamCoder(this.coerceFunc,r))},this),bytes_1.hexlify(new CoderTuple(this.coerceFunc,t,"_").encode(r))},AbiCoder.prototype.decode=function(e,r){var t=[];return e.forEach(function(e){var r=null;r="string"==typeof e?parseParam(e):properties_1.jsonCopy(e),t.push(getParamCoder(this.coerceFunc,r))},this),new CoderTuple(this.coerceFunc,t,"_").decode(bytes_1.arrayify(r),0).value},AbiCoder}();exports.AbiCoder=AbiCoder,exports.defaultAbiCoder=new AbiCoder; | |
},{"./address":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/address.js","./bignumber":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bignumber.js","./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js","./errors":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/errors.js","./properties":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/properties.js","./utf8":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/utf8.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/address.js":[function(require,module,exports){ | |
"use strict";var __importDefault=this&&this.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(exports,"__esModule",{value:!0});var bn_js_1=__importDefault(require("bn.js")),bytes_1=require("./bytes"),keccak256_1=require("./keccak256"),rlp_1=require("./rlp"),errors=require("./errors");function getChecksumAddress(r){"string"==typeof r&&r.match(/^0x[0-9A-Fa-f]{40}$/)||errors.throwError("invalid address",errors.INVALID_ARGUMENT,{arg:"address",value:r});for(var e=(r=r.toLowerCase()).substring(2).split(""),s=new Uint8Array(40),t=0;t<40;t++)s[t]=e[t].charCodeAt(0);s=bytes_1.arrayify(keccak256_1.keccak256(s));for(var a=0;a<40;a+=2)s[a>>1]>>4>=8&&(e[a]=e[a].toUpperCase()),(15&s[a>>1])>=8&&(e[a+1]=e[a+1].toUpperCase());return"0x"+e.join("")}var MAX_SAFE_INTEGER=9007199254740991;function log10(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}for(var ibanLookup={},i=0;i<10;i++)ibanLookup[String(i)]=String(i);for(i=0;i<26;i++)ibanLookup[String.fromCharCode(65+i)]=String(10+i);var safeDigits=Math.floor(log10(MAX_SAFE_INTEGER));function ibanChecksum(r){r=(r=r.toUpperCase()).substring(4)+r.substring(0,2)+"00";var e="";for(r.split("").forEach(function(r){e+=ibanLookup[r]});e.length>=safeDigits;){var s=e.substring(0,safeDigits);e=parseInt(s,10)%97+e.substring(s.length)}for(var t=String(98-parseInt(e,10)%97);t.length<2;)t="0"+t;return t}function getAddress(r){var e=null;if("string"!=typeof r&&errors.throwError("invalid address",errors.INVALID_ARGUMENT,{arg:"address",value:r}),r.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==r.substring(0,2)&&(r="0x"+r),e=getChecksumAddress(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&errors.throwError("bad address checksum",errors.INVALID_ARGUMENT,{arg:"address",value:r});else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==ibanChecksum(r)&&errors.throwError("bad icap checksum",errors.INVALID_ARGUMENT,{arg:"address",value:r}),e=new bn_js_1.default.BN(r.substring(4),36).toString(16);e.length<40;)e="0"+e;e=getChecksumAddress("0x"+e)}else errors.throwError("invalid address",errors.INVALID_ARGUMENT,{arg:"address",value:r});return e}function getIcapAddress(r){for(var e=new bn_js_1.default.BN(getAddress(r).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+ibanChecksum("XE00"+e)+e}function getContractAddress(r){if(!r.from)throw new Error("missing from address");var e=r.nonce;return getAddress("0x"+keccak256_1.keccak256(rlp_1.encode([getAddress(r.from),bytes_1.stripZeros(bytes_1.hexlify(e))])).substring(26))}exports.getAddress=getAddress,exports.getIcapAddress=getIcapAddress,exports.getContractAddress=getContractAddress; | |
},{"./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js","./errors":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/errors.js","./keccak256":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/keccak256.js","./rlp":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/rlp.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bignumber.js":[function(require,module,exports){ | |
"use strict";var __extends=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)r.hasOwnProperty(t)&&(e[t]=r[t])};return function(r,t){function __(){this.constructor=r}e(r,t),r.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}}(),__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)Object.hasOwnProperty.call(e,t)&&(r[t]=e[t]);return r.default=e,r};Object.defineProperty(exports,"__esModule",{value:!0});var bn_js_1=__importDefault(require("bn.js")),bytes_1=require("./bytes"),properties_1=require("./properties"),types_1=require("./types"),errors=__importStar(require("./errors")),BN_1=new bn_js_1.default.BN(-1);function toHex(e){var r=e.toString(16);return"-"===r[0]?r.length%2==0?"-0x0"+r.substring(1):"-0x"+r.substring(1):r.length%2==1?"0x0"+r:"0x"+r}function toBN(e){return bigNumberify(e)._bn}function toBigNumber(e){return new BigNumber(toHex(e))}var BigNumber=function(e){function BigNumber(r){var t=e.call(this)||this;if(errors.checkNew(t,BigNumber),"string"==typeof r)bytes_1.isHexString(r)?("0x"==r&&(r="0x0"),properties_1.defineReadOnly(t,"_hex",r)):"-"===r[0]&&bytes_1.isHexString(r.substring(1))?properties_1.defineReadOnly(t,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),properties_1.defineReadOnly(t,"_hex",toHex(new bn_js_1.default.BN(r)))):errors.throwError("invalid BigNumber string value",errors.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&errors.throwError("underflow",errors.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{properties_1.defineReadOnly(t,"_hex",toHex(new bn_js_1.default.BN(r)))}catch(e){errors.throwError("overflow",errors.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else r instanceof BigNumber?properties_1.defineReadOnly(t,"_hex",r._hex):r.toHexString?properties_1.defineReadOnly(t,"_hex",toHex(toBN(r.toHexString()))):bytes_1.isArrayish(r)?properties_1.defineReadOnly(t,"_hex",toHex(new bn_js_1.default.BN(bytes_1.hexlify(r).substring(2),16))):errors.throwError("invalid BigNumber value",errors.INVALID_ARGUMENT,{arg:"value",value:r});return t}return __extends(BigNumber,e),Object.defineProperty(BigNumber.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new bn_js_1.default.BN(this._hex.substring(3),16).mul(BN_1):new bn_js_1.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),BigNumber.prototype.fromTwos=function(e){return toBigNumber(this._bn.fromTwos(e))},BigNumber.prototype.toTwos=function(e){return toBigNumber(this._bn.toTwos(e))},BigNumber.prototype.add=function(e){return toBigNumber(this._bn.add(toBN(e)))},BigNumber.prototype.sub=function(e){return toBigNumber(this._bn.sub(toBN(e)))},BigNumber.prototype.div=function(e){return bigNumberify(e).isZero()&&errors.throwError("division by zero",errors.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),toBigNumber(this._bn.div(toBN(e)))},BigNumber.prototype.mul=function(e){return toBigNumber(this._bn.mul(toBN(e)))},BigNumber.prototype.mod=function(e){return toBigNumber(this._bn.mod(toBN(e)))},BigNumber.prototype.pow=function(e){return toBigNumber(this._bn.pow(toBN(e)))},BigNumber.prototype.maskn=function(e){return toBigNumber(this._bn.maskn(e))},BigNumber.prototype.eq=function(e){return this._bn.eq(toBN(e))},BigNumber.prototype.lt=function(e){return this._bn.lt(toBN(e))},BigNumber.prototype.lte=function(e){return this._bn.lte(toBN(e))},BigNumber.prototype.gt=function(e){return this._bn.gt(toBN(e))},BigNumber.prototype.gte=function(e){return this._bn.gte(toBN(e))},BigNumber.prototype.isZero=function(){return this._bn.isZero()},BigNumber.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(e){errors.throwError("overflow",errors.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},BigNumber.prototype.toString=function(){return this._bn.toString(10)},BigNumber.prototype.toHexString=function(){return this._hex},BigNumber}(types_1.BigNumber);function bigNumberify(e){return e instanceof BigNumber?e:new BigNumber(e)}exports.bigNumberify=bigNumberify,exports.ConstantNegativeOne=bigNumberify(-1),exports.ConstantZero=bigNumberify(0),exports.ConstantOne=bigNumberify(1),exports.ConstantTwo=bigNumberify(2),exports.ConstantWeiPerEther=bigNumberify("1000000000000000000"); | |
},{"./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js","./errors":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/errors.js","./properties":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/properties.js","./types":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/types.js","bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var types_1=require("./types"),errors=require("./errors");function isBigNumber(r){return r instanceof types_1.BigNumber}function addSlice(r){return r.slice?r:(r.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(r,e))},r)}function isArrayish(r){if(!r||parseInt(String(r.length))!=r.length||"string"==typeof r)return!1;for(var e=0;e<r.length;e++){var t=r[e];if(t<0||t>=256||parseInt(String(t))!=t)return!1}return!0}function arrayify(r){if(null==r&&errors.throwError("cannot convert null value to array",errors.INVALID_ARGUMENT,{arg:"value",value:r}),isBigNumber(r)&&(r=r.toHexString()),"string"==typeof r){var e=r.match(/^(0x)?[0-9a-fA-F]*$/);e||errors.throwError("invalid hexidecimal string",errors.INVALID_ARGUMENT,{arg:"value",value:r}),"0x"!==e[1]&&errors.throwError("hex string must have 0x prefix",errors.INVALID_ARGUMENT,{arg:"value",value:r}),(r=r.substring(2)).length%2&&(r="0"+r);for(var t=[],a=0;a<r.length;a+=2)t.push(parseInt(r.substr(a,2),16));return addSlice(new Uint8Array(t))}return isArrayish(r)?addSlice(new Uint8Array(r)):(errors.throwError("invalid arrayify value",null,{arg:"value",value:r,type:typeof r}),null)}function concat(r){for(var e=[],t=0,a=0;a<r.length;a++){var n=arrayify(r[a]);e.push(n),t+=n.length}var i=new Uint8Array(t),o=0;for(a=0;a<e.length;a++)i.set(e[a],o),o+=e[a].length;return addSlice(i)}function stripZeros(r){var e=arrayify(r);if(0===e.length)return e;for(var t=0;0===e[t];)t++;return t&&(e=e.slice(t)),e}function padZeros(r,e){if(e<(r=arrayify(r)).length)throw new Error("cannot pad");var t=new Uint8Array(e);return t.set(r,e-r.length),addSlice(t)}function isHexString(r,e){return!("string"!=typeof r||!r.match(/^0x[0-9A-Fa-f]*$/))&&(!e||r.length===2+2*e)}exports.AddressZero="0x0000000000000000000000000000000000000000",exports.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",exports.isArrayish=isArrayish,exports.arrayify=arrayify,exports.concat=concat,exports.stripZeros=stripZeros,exports.padZeros=padZeros,exports.isHexString=isHexString;var HexCharacters="0123456789abcdef";function hexlify(r){if(isBigNumber(r))return r.toHexString();if("number"==typeof r){r<0&&errors.throwError("cannot hexlify negative value",errors.INVALID_ARGUMENT,{arg:"value",value:r});for(var e="";r;)e=HexCharacters[15&r]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof r){var t=r.match(/^(0x)?[0-9a-fA-F]*$/);return t||errors.throwError("invalid hexidecimal string",errors.INVALID_ARGUMENT,{arg:"value",value:r}),"0x"!==t[1]&&errors.throwError("hex string must have 0x prefix",errors.INVALID_ARGUMENT,{arg:"value",value:r}),r.length%2&&(r="0x0"+r.substring(2)),r}if(isArrayish(r)){for(var a=[],n=0;n<r.length;n++){var i=r[n];a.push(HexCharacters[(240&i)>>4]+HexCharacters[15&i])}return"0x"+a.join("")}return errors.throwError("invalid hexlify value",null,{arg:"value",value:r}),"never"}function hexDataLength(r){return isHexString(r)&&r.length%2==0?(r.length-2)/2:null}function hexDataSlice(r,e,t){return isHexString(r)||errors.throwError("invalid hex data",errors.INVALID_ARGUMENT,{arg:"value",value:r}),r.length%2!=0&&errors.throwError("hex data length must be even",errors.INVALID_ARGUMENT,{arg:"value",value:r}),e=2+2*e,null!=t?"0x"+r.substring(e,e+2*t):"0x"+r.substring(e)}function hexStripZeros(r){for(isHexString(r)||errors.throwError("invalid hex string",errors.INVALID_ARGUMENT,{arg:"value",value:r});r.length>3&&"0x0"===r.substring(0,3);)r="0x"+r.substring(3);return r}function hexZeroPad(r,e){for(isHexString(r)||errors.throwError("invalid hex string",errors.INVALID_ARGUMENT,{arg:"value",value:r});r.length<2*e+2;)r="0x0"+r.substring(2);return r}function isSignature(r){return r&&null!=r.r&&null!=r.s}function splitSignature(r){var e=0,t="0x",a="0x";if(isSignature(r)){null==r.v&&null==r.recoveryParam&&errors.throwError("at least on of recoveryParam or v must be specified",errors.INVALID_ARGUMENT,{argument:"signature",value:r}),t=hexZeroPad(r.r,32),a=hexZeroPad(r.s,32),"string"==typeof(e=r.v)&&(e=parseInt(e,16));var n=r.recoveryParam;null==n&&null!=r.v&&(n=1-e%2),e=27+n}else{var i=arrayify(r);if(65!==i.length)throw new Error("invalid signature");t=hexlify(i.slice(0,32)),a=hexlify(i.slice(32,64)),27!==(e=i[64])&&28!==e&&(e=27+e%2)}return{r:t,s:a,recoveryParam:e-27,v:e}}function joinSignature(r){return hexlify(concat([(r=splitSignature(r)).r,r.s,r.recoveryParam?"0x1c":"0x1b"]))}exports.hexlify=hexlify,exports.hexDataLength=hexDataLength,exports.hexDataSlice=hexDataSlice,exports.hexStripZeros=hexStripZeros,exports.hexZeroPad=hexZeroPad,exports.splitSignature=splitSignature,exports.joinSignature=joinSignature; | |
},{"./errors":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/errors.js","./types":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/types.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/errors.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UNKNOWN_ERROR="UNKNOWN_ERROR",exports.NOT_IMPLEMENTED="NOT_IMPLEMENTED",exports.MISSING_NEW="MISSING_NEW",exports.CALL_EXCEPTION="CALL_EXCEPTION",exports.INVALID_ARGUMENT="INVALID_ARGUMENT",exports.MISSING_ARGUMENT="MISSING_ARGUMENT",exports.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",exports.NUMERIC_FAULT="NUMERIC_FAULT",exports.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var _permanentCensorErrors=!1,_censorErrors=!1;function throwError(r,e,o){if(_censorErrors)throw new Error("unknown error");e||(e=exports.UNKNOWN_ERROR),o||(o={});var t=[];Object.keys(o).forEach(function(r){try{t.push(r+"="+JSON.stringify(o[r]))}catch(e){t.push(r+"="+JSON.stringify(o[r].toString()))}});var n=r;t.length&&(r+=" ("+t.join(", ")+")");var s=new Error(r);throw s.reason=n,s.code=e,Object.keys(o).forEach(function(r){s[r]=o[r]}),s}function checkNew(r,e){r instanceof e||throwError("missing new",exports.MISSING_NEW,{name:e.name})}function checkArgumentCount(r,e,o){o||(o=""),r<e&&throwError("missing argument"+o,exports.MISSING_ARGUMENT,{count:r,expectedCount:e}),r>e&&throwError("too many arguments"+o,exports.UNEXPECTED_ARGUMENT,{count:r,expectedCount:e})}function setCensorship(r,e){_permanentCensorErrors&&throwError("error censorship permanent",exports.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),_censorErrors=!!r,_permanentCensorErrors=!!e}exports.throwError=throwError,exports.checkNew=checkNew,exports.checkArgumentCount=checkArgumentCount,exports.setCensorship=setCensorship; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/keccak256.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var sha3=require("js-sha3"),bytes_1=require("./bytes");function keccak256(e){return"0x"+sha3.keccak_256(bytes_1.arrayify(e))}exports.keccak256=keccak256; | |
},{"./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js","js-sha3":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/node_modules/js-sha3/src/sha3.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/properties.js":[function(require,module,exports){ | |
"use strict";function defineReadOnly(e,r,n){Object.defineProperty(e,r,{enumerable:!0,value:n,writable:!1})}function defineFrozen(e,r,n){var o=JSON.stringify(n);Object.defineProperty(e,r,{enumerable:!0,get:function(){return JSON.parse(o)}})}function resolveProperties(e){var r={},n=[];return Object.keys(e).forEach(function(o){var t=e[o];t instanceof Promise?n.push(t.then(function(e){return r[o]=e,null})):r[o]=t}),Promise.all(n).then(function(){return r})}function shallowCopy(e){var r={};for(var n in e)r[n]=e[n];return r}function jsonCopy(e){return JSON.parse(JSON.stringify(e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.defineReadOnly=defineReadOnly,exports.defineFrozen=defineFrozen,exports.resolveProperties=resolveProperties,exports.shallowCopy=shallowCopy,exports.jsonCopy=jsonCopy; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/rlp.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var bytes_1=require("./bytes");function arrayifyInteger(r){for(var e=[];r;)e.unshift(255&r),r>>=8;return e}function unarrayifyInteger(r,e,n){for(var t=0,o=0;o<n;o++)t=256*t+r[e+o];return t}function _encode(r){if(Array.isArray(r)){var e=[];return r.forEach(function(r){e=e.concat(_encode(r))}),e.length<=55?(e.unshift(192+e.length),e):((n=arrayifyInteger(e.length)).unshift(247+n.length),n.concat(e))}var n,t=Array.prototype.slice.call(bytes_1.arrayify(r));return 1===t.length&&t[0]<=127?t:t.length<=55?(t.unshift(128+t.length),t):((n=arrayifyInteger(t.length)).unshift(183+n.length),n.concat(t))}function encode(r){return bytes_1.hexlify(_encode(r))}function _decodeChildren(r,e,n,t){for(var o=[];n<e+1+t;){var i=_decode(r,n);if(o.push(i.result),(n+=i.consumed)>e+1+t)throw new Error("invalid rlp")}return{consumed:1+t,result:o}}function _decode(r,e){if(0===r.length)throw new Error("invalid rlp data");if(r[e]>=248){if(e+1+(n=r[e]-247)>r.length)throw new Error("too short");if(e+1+n+(t=unarrayifyInteger(r,e+1,n))>r.length)throw new Error("to short");return _decodeChildren(r,e,e+1+n,n+t)}if(r[e]>=192){if(e+1+(t=r[e]-192)>r.length)throw new Error("invalid rlp data");return _decodeChildren(r,e,e+1,t)}if(r[e]>=184){var n;if(e+1+(n=r[e]-183)>r.length)throw new Error("invalid rlp data");if(e+1+n+(t=unarrayifyInteger(r,e+1,n))>r.length)throw new Error("invalid rlp data");return{consumed:1+n+t,result:bytes_1.hexlify(r.slice(e+1+n,e+1+n+t))}}if(r[e]>=128){var t;if(e+1+(t=r[e]-128)>r.length)throw new Error("invlaid rlp data");return{consumed:1+t,result:bytes_1.hexlify(r.slice(e+1,e+1+t))}}return{consumed:1,result:bytes_1.hexlify(r[e])}}function decode(r){var e=bytes_1.arrayify(r),n=_decode(e,0);if(n.consumed!==e.length)throw new Error("invalid rlp data");return n.result}exports.encode=encode,exports.decode=decode; | |
},{"./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/types.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var BigNumber=function(){return function BigNumber(){}}();exports.BigNumber=BigNumber;var Indexed=function(){return function Indexed(){}}();exports.Indexed=Indexed;var MinimalProvider=function(){return function MinimalProvider(){}}();exports.MinimalProvider=MinimalProvider;var Signer=function(){return function Signer(){}}();exports.Signer=Signer;var HDNode=function(){return function HDNode(){}}();exports.HDNode=HDNode; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/utf8.js":[function(require,module,exports){ | |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var UnicodeNormalizationForm,bytes_1=require("./bytes");function toUtf8Bytes(r,e){void 0===e&&(e=UnicodeNormalizationForm.current),e!=UnicodeNormalizationForm.current&&(r=r.normalize(e));for(var t=[],o=0,i=0;i<r.length;i++){var n=r.charCodeAt(i);n<128?t[o++]=n:n<2048?(t[o++]=n>>6|192,t[o++]=63&n|128):55296==(64512&n)&&i+1<r.length&&56320==(64512&r.charCodeAt(i+1))?(n=65536+((1023&n)<<10)+(1023&r.charCodeAt(++i)),t[o++]=n>>18|240,t[o++]=n>>12&63|128,t[o++]=n>>6&63|128,t[o++]=63&n|128):(t[o++]=n>>12|224,t[o++]=n>>6&63|128,t[o++]=63&n|128)}return bytes_1.arrayify(t)}function toUtf8String(r){r=bytes_1.arrayify(r);for(var e="",t=0;t<r.length;){var o=r[t++];if(o>>7!=0){if(o>>6!=2){var i=null;if(o>>5==6)i=1;else if(o>>4==14)i=2;else if(o>>3==30)i=3;else if(o>>2==62)i=4;else{if(o>>1!=126)continue;i=5}if(t+i>r.length){for(;t<r.length&&r[t]>>6==2;t++);if(t!=r.length)continue;return e}var n,a=o&(1<<8-i-1)-1;for(n=0;n<i;n++){var f=r[t++];if(f>>6!=2)break;a=a<<6|63&f}n==i?a<=65535?e+=String.fromCharCode(a):(a-=65536,e+=String.fromCharCode(55296+(a>>10&1023),56320+(1023&a))):t--}}else e+=String.fromCharCode(o)}return e}!function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"}(UnicodeNormalizationForm=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})),exports.toUtf8Bytes=toUtf8Bytes,exports.toUtf8String=toUtf8String; | |
},{"./bytes":"/Users/lentan/repo/torus/torus-embed/node_modules/ethers/utils/bytes.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethjs-unit/lib/index.js":[function(require,module,exports){ | |
"use strict";var BN=require("bn.js"),numberToBN=require("number-to-bn"),zero=new BN(0),negative1=new BN(-1),unitMap={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function getValueOfUnit(e){var t=e?e.toLowerCase():"ether",n=unitMap[t];if("string"!=typeof n)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(unitMap,null,2));return new BN(n,10)}function numberToString(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return String(e);if("object"==typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}function fromWei(e,t,n){var r=numberToBN(e),i=r.lt(zero),o=getValueOfUnit(t),u=unitMap[t].length-1||1,a=n||{};i&&(r=r.mul(negative1));for(var g=r.mod(o).toString(10);g.length<u;)g="0"+g;a.pad||(g=g.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var l=r.div(o).toString(10);a.commify&&(l=l.replace(/\B(?=(\d{3})+(?!\d))/g,","));var h=l+("0"==g?"":"."+g);return i&&(h="-"+h),h}function toWei(e,t){var n=numberToString(e),r=getValueOfUnit(t),i=unitMap[t].length-1||1,o="-"===n.substring(0,1);if(o&&(n=n.substring(1)),"."===n)throw new Error("[ethjs-unit] while converting number "+e+" to wei, invalid value");var u=n.split(".");if(u.length>2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var a=u[0],g=u[1];if(a||(a="0"),g||(g="0"),g.length>i)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;g.length<i;)g+="0";a=new BN(a),g=new BN(g);var l=a.mul(r).add(g);return o&&(l=l.mul(negative1)),new BN(l.toString(10),10)}module.exports={unitMap:unitMap,numberToString:numberToString,getValueOfUnit:getValueOfUnit,fromWei:fromWei,toWei:toWei}; | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js","number-to-bn":"/Users/lentan/repo/torus/torus-embed/node_modules/number-to-bn/src/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ethjs-unit/node_modules/bn.js/lib/bn.js":[function(require,module,exports){ | |
!function(t,i){"use strict";function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i,r){if(BN.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var r;"object"==typeof t?t.exports=BN:i.BN=BN,BN.BN=BN,BN.wordSize=26;try{r=require("buffer").Buffer}catch(t){}function parseHex(t,i,r){for(var e=0,n=Math.min(t.length,r),h=i;h<n;h++){var s=t.charCodeAt(h)-48;e<<=4,e|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return e}function parseBase(t,i,r,e){for(var n=0,h=Math.min(t.length,r),s=i;s<h;s++){var o=t.charCodeAt(s)-48;n*=e,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}BN.isBN=function isBN(t){return t instanceof BN||null!==t&&"object"==typeof t&&t.constructor.wordSize===BN.wordSize&&Array.isArray(t.words)},BN.max=function max(t,i){return t.cmp(i)>0?t:i},BN.min=function min(t,i){return t.cmp(i)<0?t:i},BN.prototype._init=function init(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),assert(i===(0|i)&&i>=2&&i<=36);var e=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&e++,16===i?this._parseHex(t,e):this._parseBase(t,i,e),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initNumber=function _initNumber(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(assert(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initArray=function _initArray(t,i,r){if(assert("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h,s=0;if("be"===r)for(e=t.length-1,n=0;e>=0;e-=3)h=t[e]|t[e-1]<<8|t[e-2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(e=0,n=0;e<t.length;e+=3)h=t[e]|t[e+1]<<8|t[e+2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var e,n,h=0;for(r=t.length-6,e=0;r>=i;r-=6)n=parseHex(t,r,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303,(h+=24)>=26&&(h-=26,e++);r+6!==i&&(n=parseHex(t,i,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303),this.strip()},BN.prototype._parseBase=function _parseBase(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,s=h%e,o=Math.min(h,h-s)+r,u=0,a=r;a<o;a+=e)u=parseBase(t,a,a+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=parseBase(t,a,t.length,i),a=0;a<s;a++)l*=i;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},BN.prototype.copy=function copy(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},BN.prototype.clone=function clone(){var t=new BN(null);return this.copy(t),t},BN.prototype._expand=function _expand(t){for(;this.length<t;)this.words[this.length++]=0;return this},BN.prototype.strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var e=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],n=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],s=n*h,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(s=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&s}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}BN.prototype.toString=function toString(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var s=0,o=0,u=0;u<this.length;u++){var a=this.words[u],l=(16777215&(a<<s|o)).toString(16);r=0!==(o=a>>>24-s&16777215)||u!==this.length-1?e[6-l.length]+l+r:l+r,(s+=2)>=26&&(s-=26,u--)}for(0!==o&&(r=o.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var m=n[t],f=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(f).toString(t);r=(d=d.idivn(f)).isZero()?p+r:e[m-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(t,i){return assert(void 0!==r),this.toArrayLike(r,t,i)},BN.prototype.toArray=function toArray(t,i){return this.toArrayLike(Array,t,i)},BN.prototype.toArrayLike=function toArrayLike(t,i,r){var e=this.byteLength(),n=r||Math.max(1,e);assert(e<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var h,s,o="le"===i,u=new t(n),a=this.clone();if(o){for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[s]=h;for(;s<n;s++)u[s]=0}else{for(s=0;s<n-e;s++)u[s]=0;for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[n-s-1]=h}return u},Math.clz32?BN.prototype._countBits=function _countBits(t){return 32-Math.clz32(t)}:BN.prototype._countBits=function _countBits(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},BN.prototype._zeroBits=function _zeroBits(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},BN.prototype.bitLength=function bitLength(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this.strip()},BN.prototype.ior=function ior(t){return assert(0==(this.negative|t.negative)),this.iuor(t)},BN.prototype.or=function or(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},BN.prototype.uor=function uor(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},BN.prototype.iuand=function iuand(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this.strip()},BN.prototype.iand=function iand(t){return assert(0==(this.negative|t.negative)),this.iuand(t)},BN.prototype.and=function and(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},BN.prototype.uand=function uand(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},BN.prototype.iuxor=function iuxor(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this.strip()},BN.prototype.ixor=function ixor(t){return assert(0==(this.negative|t.negative)),this.iuxor(t)},BN.prototype.xor=function xor(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},BN.prototype.uxor=function uxor(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},BN.prototype.inotn=function inotn(t){assert("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var e=0;e<i;e++)this.words[e]=67108863&~this.words[e];return r>0&&(this.words[e]=~this.words[e]&67108863>>26-r),this.strip()},BN.prototype.notn=function notn(t){return this.clone().inotn(t)},BN.prototype.setn=function setn(t,i){assert("number"==typeof t&&t>=0);var r=t/26|0,e=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<e:this.words[r]&~(1<<e),this.strip()},BN.prototype.iadd=function iadd(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},BN.prototype.add=function add(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function isub(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,s=0;s<e.length;s++)h=(i=(0|r.words[s])-(0|e.words[s])+h)>>26,this.words[s]=67108863&i;for(;0!==h&&s<r.length;s++)h=(i=(0|r.words[s])+h)>>26,this.words[s]=67108863&i;if(0===h&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function sub(t){return this.clone().isub(t)};var s=function comb10MulTo(t,i,r){var e,n,h,s=t.words,o=i.words,u=r.words,a=0,l=0|s[0],m=8191&l,f=l>>>13,d=0|s[1],p=8191&d,M=d>>>13,v=0|s[2],g=8191&v,c=v>>>13,w=0|s[3],y=8191&w,B=w>>>13,N=0|s[4],b=8191&N,_=N>>>13,R=0|s[5],A=8191&R,k=R>>>13,x=0|s[6],S=8191&x,T=x>>>13,q=0|s[7],F=8191&q,P=q>>>13,Z=0|s[8],L=8191&Z,I=Z>>>13,z=0|s[9],K=8191&z,j=z>>>13,E=0|o[0],O=8191&E,H=E>>>13,D=0|o[1],C=8191&D,J=D>>>13,U=0|o[2],G=8191&U,Q=U>>>13,V=0|o[3],W=8191&V,X=V>>>13,Y=0|o[4],$=8191&Y,tt=Y>>>13,it=0|o[5],rt=8191&it,et=it>>>13,nt=0|o[6],ht=8191&nt,st=nt>>>13,ot=0|o[7],ut=8191&ot,at=ot>>>13,lt=0|o[8],mt=8191<,ft=lt>>>13,dt=0|o[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(m,O))|0)+((8191&(n=(n=Math.imul(m,H))+Math.imul(f,O)|0))<<13)|0;a=((h=Math.imul(f,H))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(p,O),n=(n=Math.imul(p,H))+Math.imul(M,O)|0,h=Math.imul(M,H);var gt=(a+(e=e+Math.imul(m,C)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,C)|0))<<13)|0;a=((h=h+Math.imul(f,J)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,O),n=(n=Math.imul(g,H))+Math.imul(c,O)|0,h=Math.imul(c,H),e=e+Math.imul(p,C)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,C)|0,h=h+Math.imul(M,J)|0;var ct=(a+(e=e+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((h=h+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(y,O),n=(n=Math.imul(y,H))+Math.imul(B,O)|0,h=Math.imul(B,H),e=e+Math.imul(g,C)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,C)|0,h=h+Math.imul(c,J)|0,e=e+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,h=h+Math.imul(M,Q)|0;var wt=(a+(e=e+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(b,O),n=(n=Math.imul(b,H))+Math.imul(_,O)|0,h=Math.imul(_,H),e=e+Math.imul(y,C)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(B,C)|0,h=h+Math.imul(B,J)|0,e=e+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,h=h+Math.imul(c,Q)|0,e=e+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,h=h+Math.imul(M,X)|0;var yt=(a+(e=e+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(A,O),n=(n=Math.imul(A,H))+Math.imul(k,O)|0,h=Math.imul(k,H),e=e+Math.imul(b,C)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(_,C)|0,h=h+Math.imul(_,J)|0,e=e+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(B,G)|0,h=h+Math.imul(B,Q)|0,e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,h=h+Math.imul(c,X)|0,e=e+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,h=h+Math.imul(M,tt)|0;var Bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(S,O),n=(n=Math.imul(S,H))+Math.imul(T,O)|0,h=Math.imul(T,H),e=e+Math.imul(A,C)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(k,C)|0,h=h+Math.imul(k,J)|0,e=e+Math.imul(b,G)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(_,G)|0,h=h+Math.imul(_,Q)|0,e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(B,W)|0,h=h+Math.imul(B,X)|0,e=e+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,h=h+Math.imul(c,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(M,rt)|0,h=h+Math.imul(M,et)|0;var Nt=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,st)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(F,O),n=(n=Math.imul(F,H))+Math.imul(P,O)|0,h=Math.imul(P,H),e=e+Math.imul(S,C)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(T,C)|0,h=h+Math.imul(T,J)|0,e=e+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(k,G)|0,h=h+Math.imul(k,Q)|0,e=e+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(_,W)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(B,$)|0,h=h+Math.imul(B,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(c,rt)|0,h=h+Math.imul(c,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(M,ht)|0,h=h+Math.imul(M,st)|0;var bt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(L,O),n=(n=Math.imul(L,H))+Math.imul(I,O)|0,h=Math.imul(I,H),e=e+Math.imul(F,C)|0,n=(n=n+Math.imul(F,J)|0)+Math.imul(P,C)|0,h=h+Math.imul(P,J)|0,e=e+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(T,G)|0,h=h+Math.imul(T,Q)|0,e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(k,W)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(_,$)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(B,rt)|0,h=h+Math.imul(B,et)|0,e=e+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(c,ht)|0,h=h+Math.imul(c,st)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,h=h+Math.imul(M,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(K,O),n=(n=Math.imul(K,H))+Math.imul(j,O)|0,h=Math.imul(j,H),e=e+Math.imul(L,C)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(I,C)|0,h=h+Math.imul(I,J)|0,e=e+Math.imul(F,G)|0,n=(n=n+Math.imul(F,Q)|0)+Math.imul(P,G)|0,h=h+Math.imul(P,Q)|0,e=e+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(T,W)|0,h=h+Math.imul(T,X)|0,e=e+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(k,$)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(B,ht)|0,h=h+Math.imul(B,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,h=h+Math.imul(c,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,h=h+Math.imul(M,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(K,C),n=(n=Math.imul(K,J))+Math.imul(j,C)|0,h=Math.imul(j,J),e=e+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(I,G)|0,h=h+Math.imul(I,Q)|0,e=e+Math.imul(F,W)|0,n=(n=n+Math.imul(F,X)|0)+Math.imul(P,W)|0,h=h+Math.imul(P,X)|0,e=e+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,$)|0,h=h+Math.imul(T,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(B,ut)|0,h=h+Math.imul(B,at)|0,e=e+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,h=h+Math.imul(c,ft)|0;var At=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((h=h+Math.imul(M,Mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(K,G),n=(n=Math.imul(K,Q))+Math.imul(j,G)|0,h=Math.imul(j,Q),e=e+Math.imul(L,W)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(I,W)|0,h=h+Math.imul(I,X)|0,e=e+Math.imul(F,$)|0,n=(n=n+Math.imul(F,tt)|0)+Math.imul(P,$)|0,h=h+Math.imul(P,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(T,rt)|0,h=h+Math.imul(T,et)|0,e=e+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,st)|0,e=e+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(B,mt)|0,h=h+Math.imul(B,ft)|0;var kt=(a+(e=e+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((h=h+Math.imul(c,Mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(K,W),n=(n=Math.imul(K,X))+Math.imul(j,W)|0,h=Math.imul(j,X),e=e+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(I,$)|0,h=h+Math.imul(I,tt)|0,e=e+Math.imul(F,rt)|0,n=(n=n+Math.imul(F,et)|0)+Math.imul(P,rt)|0,h=h+Math.imul(P,et)|0,e=e+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(T,ht)|0,h=h+Math.imul(T,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(b,mt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var xt=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((h=h+Math.imul(B,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(K,$),n=(n=Math.imul(K,tt))+Math.imul(j,$)|0,h=Math.imul(j,tt),e=e+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(I,rt)|0,h=h+Math.imul(I,et)|0,e=e+Math.imul(F,ht)|0,n=(n=n+Math.imul(F,st)|0)+Math.imul(P,ht)|0,h=h+Math.imul(P,st)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(T,ut)|0,h=h+Math.imul(T,at)|0,e=e+Math.imul(A,mt)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var St=(a+(e=e+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,Mt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(K,rt),n=(n=Math.imul(K,et))+Math.imul(j,rt)|0,h=Math.imul(j,et),e=e+Math.imul(L,ht)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(I,ht)|0,h=h+Math.imul(I,st)|0,e=e+Math.imul(F,ut)|0,n=(n=n+Math.imul(F,at)|0)+Math.imul(P,ut)|0,h=h+Math.imul(P,at)|0,e=e+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(T,mt)|0,h=h+Math.imul(T,ft)|0;var Tt=(a+(e=e+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,Mt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,Mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(K,ht),n=(n=Math.imul(K,st))+Math.imul(j,ht)|0,h=Math.imul(j,st),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(I,ut)|0,h=h+Math.imul(I,at)|0,e=e+Math.imul(F,mt)|0,n=(n=n+Math.imul(F,ft)|0)+Math.imul(P,mt)|0,h=h+Math.imul(P,ft)|0;var qt=(a+(e=e+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((h=h+Math.imul(T,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(K,ut),n=(n=Math.imul(K,at))+Math.imul(j,ut)|0,h=Math.imul(j,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,h=h+Math.imul(I,ft)|0;var Ft=(a+(e=e+Math.imul(F,pt)|0)|0)+((8191&(n=(n=n+Math.imul(F,Mt)|0)+Math.imul(P,pt)|0))<<13)|0;a=((h=h+Math.imul(P,Mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,e=Math.imul(K,mt),n=(n=Math.imul(K,ft))+Math.imul(j,mt)|0,h=Math.imul(j,ft);var Pt=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((h=h+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Zt=(a+(e=Math.imul(K,pt))|0)+((8191&(n=(n=Math.imul(K,Mt))+Math.imul(j,pt)|0))<<13)|0;return a=((h=Math.imul(j,Mt))+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=Bt,u[6]=Nt,u[7]=bt,u[8]=_t,u[9]=Rt,u[10]=At,u[11]=kt,u[12]=xt,u[13]=St,u[14]=Tt,u[15]=qt,u[16]=Ft,u[17]=Pt,u[18]=Zt,0!==a&&(u[19]=a,r.length++),r};function jumboMulTo(t,i,r){return(new FFTM).mulp(t,i,r)}function FFTM(t,i){this.x=t,this.y=i}Math.imul||(s=smallMulTo),BN.prototype.mulTo=function mulTo(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?s(this,t,i):r<63?smallMulTo(this,t,i):r<1024?function bigMulTo(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var s=n;n=0;for(var o=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;o=67108863&(f=f+o|0),n+=(s=(s=s+(m/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[h]=o,e=s,s=n}return 0!==e?r.words[h]=e:r.length--,r.strip()}(this,t,i):jumboMulTo(this,t,i)},FFTM.prototype.makeRBT=function makeRBT(t){for(var i=new Array(t),r=BN.prototype._countBits(t)-1,e=0;e<t;e++)i[e]=this.revBin(e,r,t);return i},FFTM.prototype.revBin=function revBin(t,i,r){if(0===t||t===r-1)return t;for(var e=0,n=0;n<i;n++)e|=(1&t)<<i-n-1,t>>=1;return e},FFTM.prototype.permute=function permute(t,i,r,e,n,h){for(var s=0;s<h;s++)e[s]=i[t[s]],n[s]=r[t[s]]},FFTM.prototype.transform=function transform(t,i,r,e,n,h){this.permute(h,t,i,r,e,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),a=Math.sin(2*Math.PI/o),l=0;l<n;l+=o)for(var m=u,f=a,d=0;d<s;d++){var p=r[l+d],M=e[l+d],v=r[l+d+s],g=e[l+d+s],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,e[l+d]=M+g,r[l+d+s]=p-v,e[l+d+s]=M-g,d!==o&&(c=u*m-a*f,f=u*f+a*m,m=c)}},FFTM.prototype.guessLen13b=function guessLen13b(t,i){var r=1|Math.max(i,t),e=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+e},FFTM.prototype.conjugate=function conjugate(t,i,r){if(!(r<=1))for(var e=0;e<r/2;e++){var n=t[e];t[e]=t[r-e-1],t[r-e-1]=n,n=i[e],i[e]=-i[r-e-1],i[r-e-1]=-n}},FFTM.prototype.normalize13b=function normalize13b(t,i){for(var r=0,e=0;e<i/2;e++){var n=8192*Math.round(t[2*e+1]/i)+Math.round(t[2*e]/i)+r;t[e]=67108863&n,r=n<67108864?0:n/67108864|0}return t},FFTM.prototype.convert13b=function convert13b(t,i,r,e){for(var n=0,h=0;h<i;h++)n+=0|t[h],r[2*h]=8191&n,n>>>=13,r[2*h+1]=8191&n,n>>>=13;for(h=2*i;h<e;++h)r[h]=0;assert(0===n),assert(0==(-8192&n))},FFTM.prototype.stub=function stub(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},FFTM.prototype.mulp=function mulp(t,i,r){var e=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(e),h=this.stub(e),s=new Array(e),o=new Array(e),u=new Array(e),a=new Array(e),l=new Array(e),m=new Array(e),f=r.words;f.length=e,this.convert13b(t.words,t.length,s,e),this.convert13b(i.words,i.length,a,e),this.transform(s,h,o,u,e,n),this.transform(a,h,l,m,e,n);for(var d=0;d<e;d++){var p=o[d]*l[d]-u[d]*m[d];u[d]=o[d]*m[d]+u[d]*l[d],o[d]=p}return this.conjugate(o,u,e),this.transform(o,u,f,h,e,n),this.conjugate(f,h,e),this.normalize13b(f,e),r.negative=t.negative^i.negative,r.length=t.length+i.length,r.strip()},BN.prototype.mul=function mul(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.mulf=function mulf(t){var i=new BN(null);return i.words=new Array(this.length+t.length),jumboMulTo(this,t,i)},BN.prototype.imul=function imul(t){return this.clone().mulTo(t,this)},BN.prototype.imuln=function imuln(t){assert("number"==typeof t),assert(t<67108864);for(var i=0,r=0;r<this.length;r++){var e=(0|this.words[r])*t,n=(67108863&e)+(67108863&i);i>>=26,i+=e/67108864|0,i+=n>>>26,this.words[r]=67108863&n}return 0!==i&&(this.words[r]=i,this.length++),this},BN.prototype.muln=function muln(t){return this.clone().imuln(t)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(t){var i=function toBitArray(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=(t.words[e]&1<<n)>>>n}return i}(t);if(0===i.length)return new BN(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},BN.prototype.iushln=function iushln(t){assert("number"==typeof t&&t>=0);var i,r=t%26,e=(t-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var h=0;for(i=0;i<this.length;i++){var s=this.words[i]&n,o=(0|this.words[i])-s<<r;this.words[i]=o|h,h=s>>>26-r}h&&(this.words[i]=h,this.length++)}if(0!==e){for(i=this.length-1;i>=0;i--)this.words[i+e]=this.words[i];for(i=0;i<e;i++)this.words[i]=0;this.length+=e}return this.strip()},BN.prototype.ishln=function ishln(t){return assert(0===this.negative),this.iushln(t)},BN.prototype.iushrn=function iushrn(t,i,r){var e;assert("number"==typeof t&&t>=0),e=i?(i-i%26)/26:0;var n=t%26,h=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,o=r;if(e-=h,e=Math.max(0,e),o){for(var u=0;u<h;u++)o.words[u]=this.words[u];o.length=h}if(0===h);else if(this.length>h)for(this.length-=h,u=0;u<this.length;u++)this.words[u]=this.words[u+h];else this.words[0]=0,this.length=1;var a=0;for(u=this.length-1;u>=0&&(0!==a||u>=e);u--){var l=0|this.words[u];this.words[u]=a<<26-n|l>>>n,a=l&s}return o&&0!==a&&(o.words[o.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(t,i,r){return assert(0===this.negative),this.iushrn(t,i,r)},BN.prototype.shln=function shln(t){return this.clone().ishln(t)},BN.prototype.ushln=function ushln(t){return this.clone().iushln(t)},BN.prototype.shrn=function shrn(t){return this.clone().ishrn(t)},BN.prototype.ushrn=function ushrn(t){return this.clone().iushrn(t)},BN.prototype.testn=function testn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,e=1<<i;return!(this.length<=r)&&!!(this.words[r]&e)},BN.prototype.imaskn=function imaskn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var e=67108863^67108863>>>i<<i;this.words[this.length-1]&=e}return this.strip()},BN.prototype.maskn=function maskn(t){return this.clone().imaskn(t)},BN.prototype.iaddn=function iaddn(t){return assert("number"==typeof t),assert(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},BN.prototype._iaddn=function _iaddn(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function isubn(t){if(assert("number"==typeof t),assert(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},BN.prototype.addn=function addn(t){return this.clone().iaddn(t)},BN.prototype.subn=function subn(t){return this.clone().isubn(t)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(t,i,r){var e,n,h=t.length+r;this._expand(h);var s=0;for(e=0;e<t.length;e++){n=(0|this.words[e+r])+s;var o=(0|t.words[e])*i;s=((n-=67108863&o)>>26)-(o/67108864|0),this.words[e+r]=67108863&n}for(;e<this.length-r;e++)s=(n=(0|this.words[e+r])+s)>>26,this.words[e+r]=67108863&n;if(0===s)return this.strip();for(assert(-1===s),s=0,e=0;e<this.length;e++)s=(n=-(0|this.words[e])+s)>>26,this.words[e]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(t,i){var r=(this.length,t.length),e=this.clone(),n=t,h=0|n.words[n.length-1];0!==(r=26-this._countBits(h))&&(n=n.ushln(r),e.iushln(r),h=0|n.words[n.length-1]);var s,o=e.length-n.length;if("mod"!==i){(s=new BN(null)).length=o+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var a=e.clone()._ishlnsubmul(n,1,o);0===a.negative&&(e=a,s&&(s.words[o]=1));for(var l=o-1;l>=0;l--){var m=67108864*(0|e.words[n.length+l])+(0|e.words[n.length+l-1]);for(m=Math.min(m/h|0,67108863),e._ishlnsubmul(n,m,l);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,l),e.isZero()||(e.negative^=1);s&&(s.words[l]=m)}return s&&s.strip(),e.strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},BN.prototype.divmod=function divmod(t,i,r){return assert(!t.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(e=h.div.neg()),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.iadd(t)),{div:e,mod:n}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(e=h.div.neg()),{div:e,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.isub(t)),{div:h.div,mod:n}):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,i);var e,n,h},BN.prototype.div=function div(t){return this.divmod(t,"div",!1).div},BN.prototype.mod=function mod(t){return this.divmod(t,"mod",!1).mod},BN.prototype.umod=function umod(t){return this.divmod(t,"mod",!0).mod},BN.prototype.divRound=function divRound(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modn=function modn(t){assert(t<=67108863);for(var i=(1<<26)%t,r=0,e=this.length-1;e>=0;e--)r=(i*r+(0|this.words[e]))%t;return r},BN.prototype.idivn=function idivn(t){assert(t<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var e=(0|this.words[r])+67108864*i;this.words[r]=e/t|0,i=e%t}return this.strip()},BN.prototype.divn=function divn(t){return this.clone().idivn(t)},BN.prototype.egcd=function egcd(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new BN(1),n=new BN(0),h=new BN(0),s=new BN(1),o=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++o;for(var u=r.clone(),a=i.clone();!i.isZero();){for(var l=0,m=1;0==(i.words[0]&m)&&l<26;++l,m<<=1);if(l>0)for(i.iushrn(l);l-- >0;)(e.isOdd()||n.isOdd())&&(e.iadd(u),n.isub(a)),e.iushrn(1),n.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(h.isOdd()||s.isOdd())&&(h.iadd(u),s.isub(a)),h.iushrn(1),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),e.isub(h),n.isub(s)):(r.isub(i),h.isub(e),s.isub(n))}return{a:h,b:s,gcd:r.iushln(o)}},BN.prototype._invmp=function _invmp(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,n=new BN(1),h=new BN(0),s=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var o=0,u=1;0==(i.words[0]&u)&&o<26;++o,u<<=1);if(o>0)for(i.iushrn(o);o-- >0;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var a=0,l=1;0==(r.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(r.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(s),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h)):(r.isub(i),h.isub(n))}return(e=0===i.cmpn(1)?n:h).cmpn(0)<0&&e.iadd(t),e},BN.prototype.gcd=function gcd(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},BN.prototype.invm=function invm(t){return this.egcd(t).a.umod(t)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(t){return this.words[0]&t},BN.prototype.bincn=function bincn(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,e=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=e,this;for(var n=e,h=r;0!==n&&h<this.length;h++){var s=0|this.words[h];n=(s+=n)>>>26,s&=67108863,this.words[h]=s}return 0!==n&&(this.words[h]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)i=1;else{r&&(t=-t),assert(t<=67108863,"Number is too big");var e=0|this.words[0];i=e===t?0:e<t?-1:1}return 0!==this.negative?0|-i:i},BN.prototype.cmp=function cmp(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},BN.prototype.ucmp=function ucmp(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},BN.prototype.gtn=function gtn(t){return 1===this.cmpn(t)},BN.prototype.gt=function gt(t){return 1===this.cmp(t)},BN.prototype.gten=function gten(t){return this.cmpn(t)>=0},BN.prototype.gte=function gte(t){return this.cmp(t)>=0},BN.prototype.ltn=function ltn(t){return-1===this.cmpn(t)},BN.prototype.lt=function lt(t){return-1===this.cmp(t)},BN.prototype.lten=function lten(t){return this.cmpn(t)<=0},BN.prototype.lte=function lte(t){return this.cmp(t)<=0},BN.prototype.eqn=function eqn(t){return 0===this.cmpn(t)},BN.prototype.eq=function eq(t){return 0===this.cmp(t)},BN.red=function red(t){return new Red(t)},BN.prototype.toRed=function toRed(t){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(t){return this.red=t,this},BN.prototype.forceRed=function forceRed(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function redAdd(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function redIAdd(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function redSub(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function redISub(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function redShl(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function redMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function redIMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var o={k256:null,p224:null,p192:null,p25519:null};function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else assert(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function ireduce(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function split(t,i){t.iushrn(this.n,0,i)},MPrime.prototype.imulK=function imulK(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(t,i){for(var r=Math.min(t.length,9),e=0;e<r;e++)i.words[e]=t.words[e];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(i.words[i.length++]=4194303&n,e=10;e<t.length;e++){var h=0|t.words[e];t.words[e-10]=(4194303&h)<<4|n>>>22,n=h}n>>>=22,t.words[e-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},K256.prototype.imulK=function imulK(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function prime(t){if(o[t])return o[t];var prime;if("k256"===t)prime=new K256;else if("p224"===t)prime=new P224;else if("p192"===t)prime=new P192;else{if("p25519"!==t)throw new Error("Unknown prime "+t);prime=new P25519}return o[t]=prime,prime},Red.prototype._verify1=function _verify1(t){assert(0===t.negative,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(t,i){assert(0==(t.negative|i.negative),"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function imod(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Red.prototype.add=function add(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},Red.prototype.iadd=function iadd(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},Red.prototype.sub=function sub(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},Red.prototype.isub=function isub(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function shl(t,i){return this._verify1(t),this.imod(t.ushln(i))},Red.prototype.imul=function imul(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function mul(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function isqr(t){return this.imul(t,t.clone())},Red.prototype.sqr=function sqr(t){return this.mul(t,t)},Red.prototype.sqrt=function sqrt(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(assert(i%2==1),3===i){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(t,r)}for(var e=this.m.subn(1),n=0;!e.isZero()&&0===e.andln(1);)n++,e.iushrn(1);assert(!e.isZero());var h=new BN(1).toRed(this),s=h.redNeg(),o=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new BN(2*u*u).toRed(this);0!==this.pow(u,o).cmp(s);)u.redIAdd(s);for(var a=this.pow(u,e),l=this.pow(t,e.addn(1).iushrn(1)),m=this.pow(t,e),f=n;0!==m.cmp(h);){for(var d=m,p=0;0!==d.cmp(h);p++)d=d.redSqr();assert(p<f);var M=this.pow(a,new BN(1).iushln(f-p-1));l=l.redMul(M),a=M.redSqr(),m=m.redMul(a),f=p}return l},Red.prototype.invm=function invm(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function pow(t,i){if(i.isZero())return new BN(1);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new BN(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],h=0,s=0,o=i.bitLength()%26;for(0===o&&(o=26),e=i.length-1;e>=0;e--){for(var u=i.words[e],a=o-1;a>=0;a--){var l=u>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==h?(h<<=1,h|=l,(4===++s||0===e&&0===a)&&(n=this.mul(n,r[h]),s=0,h=0)):s=0}o=26}return n},Red.prototype.convertTo=function convertTo(t){var i=t.umod(this.m);return i===t?i.clone():i},Red.prototype.convertFrom=function convertFrom(t){var i=t.clone();return i.red=null,i},BN.mont=function mont(t){return new Mont(t)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(t){return this.imod(t.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},Mont.prototype.imul=function imul(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.mul=function mul(t,i){if(t.isZero()||i.isZero())return new BN(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.invm=function invm(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/eventemitter3/index.js":[function(require,module,exports){ | |
"use strict";var has=Object.prototype.hasOwnProperty,prefix="~";function Events(){}function EE(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function addListener(e,t,n,r,i){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new EE(n,r||e,i),o=prefix?prefix+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],s]:e._events[o].push(s):(e._events[o]=s,e._eventsCount++),e}function clearEvent(e,t){0==--e._eventsCount?e._events=new Events:delete e._events[t]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(prefix=!1)),EventEmitter.prototype.eventNames=function eventNames(){var e,t,n=[];if(0===this._eventsCount)return n;for(t in e=this._events)has.call(e,t)&&n.push(prefix?t.slice(1):t);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},EventEmitter.prototype.listeners=function listeners(e){var t=prefix?prefix+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,i=n.length,s=new Array(i);r<i;r++)s[r]=n[r].fn;return s},EventEmitter.prototype.listenerCount=function listenerCount(e){var t=prefix?prefix+e:e,n=this._events[t];return n?n.fn?1:n.length:0},EventEmitter.prototype.emit=function emit(e,t,n,r,i,s){var o=prefix?prefix+e:e;if(!this._events[o])return!1;var f,v,c=this._events[o],a=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),a){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,i),!0;case 6:return c.fn.call(c.context,t,n,r,i,s),!0}for(v=1,f=new Array(a-1);v<a;v++)f[v-1]=arguments[v];c.fn.apply(c.context,f)}else{var p,l=c.length;for(v=0;v<l;v++)switch(c[v].once&&this.removeListener(e,c[v].fn,void 0,!0),a){case 1:c[v].fn.call(c[v].context);break;case 2:c[v].fn.call(c[v].context,t);break;case 3:c[v].fn.call(c[v].context,t,n);break;case 4:c[v].fn.call(c[v].context,t,n,r);break;default:if(!f)for(p=1,f=new Array(a-1);p<a;p++)f[p-1]=arguments[p];c[v].fn.apply(c[v].context,f)}}return!0},EventEmitter.prototype.on=function on(e,t,n){return addListener(this,e,t,n,!1)},EventEmitter.prototype.once=function once(e,t,n){return addListener(this,e,t,n,!0)},EventEmitter.prototype.removeListener=function removeListener(e,t,n,r){var i=prefix?prefix+e:e;if(!this._events[i])return this;if(!t)return clearEvent(this,i),this;var s=this._events[i];if(s.fn)s.fn!==t||r&&!s.once||n&&s.context!==n||clearEvent(this,i);else{for(var o=0,f=[],v=s.length;o<v;o++)(s[o].fn!==t||r&&!s[o].once||n&&s[o].context!==n)&&f.push(s[o]);f.length?this._events[i]=1===f.length?f[0]:f:clearEvent(this,i)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t;return e?(t=prefix?prefix+e:e,this._events[t]&&clearEvent(this,t)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=prefix,EventEmitter.EventEmitter=EventEmitter,"undefined"!=typeof module&&(module.exports=EventEmitter); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/events/events.js":[function(require,module,exports){ | |
"use strict";var ReflectOwnKeys,R="object"==typeof Reflect?Reflect:null,ReflectApply=R&&"function"==typeof R.apply?R.apply:function ReflectApply(e,t,n){return Function.prototype.apply.call(e,t,n)};function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}ReflectOwnKeys=R&&"function"==typeof R.ownKeys?R.ownKeys:Object.getOwnPropertySymbols?function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function ReflectOwnKeys(e){return Object.getOwnPropertyNames(e)};var NumberIsNaN=Number.isNaN||function NumberIsNaN(e){return e!=e};function EventEmitter(){EventEmitter.init.call(this)}module.exports=EventEmitter,EventEmitter.EventEmitter=EventEmitter,EventEmitter.prototype._events=void 0,EventEmitter.prototype._eventsCount=0,EventEmitter.prototype._maxListeners=void 0;var defaultMaxListeners=10;function checkListener(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function _getMaxListeners(e){return void 0===e._maxListeners?EventEmitter.defaultMaxListeners:e._maxListeners}function _addListener(e,t,n,r){var i,s,o;if(checkListener(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=_getMaxListeners(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,ProcessEmitWarning(u)}return e}function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=onceWrapper.bind(r);return i.listener=n,r.wrapFn=i,i}function _listeners(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?unwrapListeners(i):arrayClone(i,i.length)}function listenerCount(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function arrayClone(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function spliceOne(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function unwrapListeners(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}Object.defineProperty(EventEmitter,"defaultMaxListeners",{enumerable:!0,get:function(){return defaultMaxListeners},set:function(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");defaultMaxListeners=e}}),EventEmitter.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function setMaxListeners(e){if("number"!=typeof e||e<0||NumberIsNaN(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},EventEmitter.prototype.getMaxListeners=function getMaxListeners(){return _getMaxListeners(this)},EventEmitter.prototype.emit=function emit(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)ReflectApply(u,this,t);else{var a=u.length,v=arrayClone(u,a);for(n=0;n<a;++n)ReflectApply(v[n],this,t)}return!0},EventEmitter.prototype.addListener=function addListener(e,t){return _addListener(this,e,t,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function prependListener(e,t){return _addListener(this,e,t,!0)},EventEmitter.prototype.once=function once(e,t){return checkListener(t),this.on(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.prependOnceListener=function prependOnceListener(e,t){return checkListener(t),this.prependListener(e,_onceWrap(this,e,t)),this},EventEmitter.prototype.removeListener=function removeListener(e,t){var n,r,i,s,o;if(checkListener(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():spliceOne(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},EventEmitter.prototype.listeners=function listeners(e){return _listeners(this,e,!0)},EventEmitter.prototype.rawListeners=function rawListeners(e){return _listeners(this,e,!1)},EventEmitter.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):listenerCount.call(e,t)},EventEmitter.prototype.listenerCount=listenerCount,EventEmitter.prototype.eventNames=function eventNames(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/evp_bytestokey/index.js":[function(require,module,exports){ | |
var Buffer=require("safe-buffer").Buffer,MD5=require("md5.js");function EVP_BytesToKey(e,f,r,t){if(Buffer.isBuffer(e)||(e=Buffer.from(e,"binary")),f&&(Buffer.isBuffer(f)||(f=Buffer.from(f,"binary")),8!==f.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var u=r/8,a=Buffer.alloc(u),l=Buffer.alloc(t||0),n=Buffer.alloc(0);u>0||t>0;){var i=new MD5;i.update(n),i.update(e),f&&i.update(f),n=i.digest();var o=0;if(u>0){var B=a.length-u;o=Math.min(u,n.length),n.copy(a,B,0,o),u-=o}if(o<n.length&&t>0){var h=l.length-t,s=Math.min(t,n.length-o);n.copy(l,h,o,o+s),t-=s}}return n.fill(0),{key:a,iv:l}}module.exports=EVP_BytesToKey; | |
},{"md5.js":"/Users/lentan/repo/torus/torus-embed/node_modules/md5.js/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/fast-safe-stringify/index.js":[function(require,module,exports){ | |
module.exports=stringify,stringify.default=stringify,stringify.stable=deterministicStringify,stringify.stableStringify=deterministicStringify;var arr=[],replacerStack=[];function stringify(r,e,t){var i;for(decirc(r,"",[],void 0),i=0===replacerStack.length?JSON.stringify(r,e,t):JSON.stringify(r,replaceGetterValues(e),t);0!==arr.length;){var c=arr.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return i}function decirc(r,e,t,i){var c;if("object"==typeof r&&null!==r){for(c=0;c<t.length;c++)if(t[c]===r){var n=Object.getOwnPropertyDescriptor(i,e);return void(void 0!==n.get?n.configurable?(Object.defineProperty(i,e,{value:"[Circular]"}),arr.push([i,e,r,n])):replacerStack.push([r,e]):(i[e]="[Circular]",arr.push([i,e,r])))}if(t.push(r),Array.isArray(r))for(c=0;c<r.length;c++)decirc(r[c],c,t,r);else{var a=Object.keys(r);for(c=0;c<a.length;c++){var o=a[c];decirc(r[o],o,t,r)}}t.pop()}}function compareFunction(r,e){return r<e?-1:r>e?1:0}function deterministicStringify(r,e,t){var i,c=deterministicDecirc(r,"",[],void 0)||r;for(i=0===replacerStack.length?JSON.stringify(c,e,t):JSON.stringify(c,replaceGetterValues(e),t);0!==arr.length;){var n=arr.pop();4===n.length?Object.defineProperty(n[0],n[1],n[3]):n[0][n[1]]=n[2]}return i}function deterministicDecirc(r,e,t,i){var c;if("object"==typeof r&&null!==r){for(c=0;c<t.length;c++)if(t[c]===r){var n=Object.getOwnPropertyDescriptor(i,e);return void(void 0!==n.get?n.configurable?(Object.defineProperty(i,e,{value:"[Circular]"}),arr.push([i,e,r,n])):replacerStack.push([r,e]):(i[e]="[Circular]",arr.push([i,e,r])))}if("function"==typeof r.toJSON)return;if(t.push(r),Array.isArray(r))for(c=0;c<r.length;c++)deterministicDecirc(r[c],c,t,r);else{var a={},o=Object.keys(r).sort(compareFunction);for(c=0;c<o.length;c++){var f=o[c];deterministicDecirc(r[f],f,t,r),a[f]=r[f]}if(void 0===i)return a;arr.push([i,e,r]),i[e]=a}t.pop()}}function replaceGetterValues(r){return r=void 0!==r?r:function(r,e){return e},function(e,t){if(replacerStack.length>0)for(var i=0;i<replacerStack.length;i++){var c=replacerStack[i];if(c[1]===e&&c[0]===t){t="[Circular]",replacerStack.splice(i,1);break}}return r.call(this,e,t)}} | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash-base/index.js":[function(require,module,exports){ | |
"use strict";var Buffer=require("safe-buffer").Buffer,Transform=require("stream").Transform,inherits=require("inherits");function throwIfNotStringOrBuffer(t,e){if(!Buffer.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}function HashBase(t){Transform.call(this),this._block=Buffer.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}inherits(HashBase,Transform),HashBase.prototype._transform=function(t,e,r){var s=null;try{this.update(t,e)}catch(t){s=t}r(s)},HashBase.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},HashBase.prototype.update=function(t,e){if(throwIfNotStringOrBuffer(t,"Data"),this._finalized)throw new Error("Digest already called");Buffer.isBuffer(t)||(t=Buffer.from(t,e));for(var r=this._block,s=0;this._blockOffset+t.length-s>=this._blockSize;){for(var i=this._blockOffset;i<this._blockSize;)r[i++]=t[s++];this._update(),this._blockOffset=0}for(;s<t.length;)r[this._blockOffset++]=t[s++];for(var f=0,o=8*t.length;o>0;++f)this._length[f]+=o,(o=this._length[f]/4294967296|0)>0&&(this._length[f]-=4294967296*o);return this},HashBase.prototype._update=function(){throw new Error("_update is not implemented")},HashBase.prototype.digest=function(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")},module.exports=HashBase; | |
},{"inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js","stream":"/Users/lentan/repo/torus/torus-embed/node_modules/stream-browserify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js":[function(require,module,exports){ | |
var hash=exports;hash.utils=require("./hash/utils"),hash.common=require("./hash/common"),hash.sha=require("./hash/sha"),hash.ripemd=require("./hash/ripemd"),hash.hmac=require("./hash/hmac"),hash.sha1=hash.sha.sha1,hash.sha256=hash.sha.sha256,hash.sha224=hash.sha.sha224,hash.sha384=hash.sha.sha384,hash.sha512=hash.sha.sha512,hash.ripemd160=hash.ripemd.ripemd160; | |
},{"./hash/common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js","./hash/hmac":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/hmac.js","./hash/ripemd":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/ripemd.js","./hash/sha":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha.js","./hash/utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js":[function(require,module,exports){ | |
"use strict";var utils=require("./utils"),assert=require("minimalistic-assert");function BlockHash(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}exports.BlockHash=BlockHash,BlockHash.prototype.update=function update(t,i){if(t=utils.toArray(t,i),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var e=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-e,t.length),0===this.pending.length&&(this.pending=null),t=utils.join32(t,0,t.length-e,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},BlockHash.prototype.digest=function digest(t){return this.update(this._pad()),assert(null===this.pending),this._digest(t)},BlockHash.prototype._pad=function pad(){var t=this.pendingTotal,i=this._delta8,e=i-(t+this.padLength)%i,n=new Array(e+this.padLength);n[0]=128;for(var s=1;s<e;s++)n[s]=0;if(t<<=3,"big"===this.endian){for(var h=8;h<this.padLength;h++)n[s++]=0;n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=t>>>24&255,n[s++]=t>>>16&255,n[s++]=t>>>8&255,n[s++]=255&t}else for(n[s++]=255&t,n[s++]=t>>>8&255,n[s++]=t>>>16&255,n[s++]=t>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,h=8;h<this.padLength;h++)n[s++]=0;return n}; | |
},{"./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/hmac.js":[function(require,module,exports){ | |
"use strict";var utils=require("./utils"),assert=require("minimalistic-assert");function Hmac(t,i,e){if(!(this instanceof Hmac))return new Hmac(t,i,e);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(utils.toArray(i,e))}module.exports=Hmac,Hmac.prototype._init=function init(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),assert(t.length<=this.blockSize);for(var i=t.length;i<this.blockSize;i++)t.push(0);for(i=0;i<t.length;i++)t[i]^=54;for(this.inner=(new this.Hash).update(t),i=0;i<t.length;i++)t[i]^=106;this.outer=(new this.Hash).update(t)},Hmac.prototype.update=function update(t,i){return this.inner.update(t,i),this},Hmac.prototype.digest=function digest(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}; | |
},{"./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/ripemd.js":[function(require,module,exports){ | |
"use strict";var utils=require("./utils"),common=require("./common"),rotl32=utils.rotl32,sum32=utils.sum32,sum32_3=utils.sum32_3,sum32_4=utils.sum32_4,BlockHash=common.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(t,s,h,i){return t<=15?s^h^i:t<=31?s&h|~s&i:t<=47?(s|~h)^i:t<=63?s&i|h&~i:s^(h|~i)}function K(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Kh(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}utils.inherits(RIPEMD160,BlockHash),exports.ripemd160=RIPEMD160,RIPEMD160.blockSize=512,RIPEMD160.outSize=160,RIPEMD160.hmacStrength=192,RIPEMD160.padLength=64,RIPEMD160.prototype._update=function update(t,h){for(var i=this.h[0],u=this.h[1],o=this.h[2],e=this.h[3],l=this.h[4],n=i,m=u,c=o,a=e,_=l,D=0;D<80;D++){var E=sum32(rotl32(sum32_4(i,f(D,u,o,e),t[r[D]+h],K(D)),s[D]),l);i=l,l=e,e=rotl32(o,10),o=u,u=E,E=sum32(rotl32(sum32_4(n,f(79-D,m,c,a),t[rh[D]+h],Kh(D)),sh[D]),_),n=_,_=a,a=rotl32(c,10),c=m,m=E}E=sum32_3(this.h[1],o,a),this.h[1]=sum32_3(this.h[2],e,_),this.h[2]=sum32_3(this.h[3],l,n),this.h[3]=sum32_3(this.h[4],i,m),this.h[4]=sum32_3(this.h[0],u,c),this.h[0]=E},RIPEMD160.prototype._digest=function digest(t){return"hex"===t?utils.toHex32(this.h,"little"):utils.split32(this.h,"little")};var r=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],rh=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],s=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],sh=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]; | |
},{"./common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js","./utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha.js":[function(require,module,exports){ | |
"use strict";exports.sha1=require("./sha/1"),exports.sha224=require("./sha/224"),exports.sha256=require("./sha/256"),exports.sha384=require("./sha/384"),exports.sha512=require("./sha/512"); | |
},{"./sha/1":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/1.js","./sha/224":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/224.js","./sha/256":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/256.js","./sha/384":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/384.js","./sha/512":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/512.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/1.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),common=require("../common"),shaCommon=require("./common"),rotl32=utils.rotl32,sum32=utils.sum32,sum32_5=utils.sum32_5,ft_1=shaCommon.ft_1,BlockHash=common.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils.inherits(SHA1,BlockHash),module.exports=SHA1,SHA1.blockSize=512,SHA1.outSize=160,SHA1.hmacStrength=80,SHA1.padLength=64,SHA1.prototype._update=function _update(t,s){for(var h=this.W,i=0;i<16;i++)h[i]=t[s+i];for(;i<h.length;i++)h[i]=rotl32(h[i-3]^h[i-8]^h[i-14]^h[i-16],1);var o=this.h[0],u=this.h[1],r=this.h[2],e=this.h[3],l=this.h[4];for(i=0;i<h.length;i++){var m=~~(i/20),n=sum32_5(rotl32(o,5),ft_1(m,u,r,e),l,h[i],sha1_K[m]);l=e,e=r,r=rotl32(u,30),u=o,o=n}this.h[0]=sum32(this.h[0],o),this.h[1]=sum32(this.h[1],u),this.h[2]=sum32(this.h[2],r),this.h[3]=sum32(this.h[3],e),this.h[4]=sum32(this.h[4],l)},SHA1.prototype._digest=function digest(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}; | |
},{"../common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","./common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/common.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/224.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),SHA256=require("./256");function SHA224(){if(!(this instanceof SHA224))return new SHA224;SHA256.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}utils.inherits(SHA224,SHA256),module.exports=SHA224,SHA224.blockSize=512,SHA224.outSize=224,SHA224.hmacStrength=192,SHA224.padLength=64,SHA224.prototype._digest=function digest(t){return"hex"===t?utils.toHex32(this.h.slice(0,7),"big"):utils.split32(this.h.slice(0,7),"big")}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","./256":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/256.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/256.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),common=require("../common"),shaCommon=require("./common"),assert=require("minimalistic-assert"),sum32=utils.sum32,sum32_4=utils.sum32_4,sum32_5=utils.sum32_5,ch32=shaCommon.ch32,maj32=shaCommon.maj32,s0_256=shaCommon.s0_256,s1_256=shaCommon.s1_256,g0_256=shaCommon.g0_256,g1_256=shaCommon.g1_256,BlockHash=common.BlockHash,sha256_K=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function SHA256(){if(!(this instanceof SHA256))return new SHA256;BlockHash.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=sha256_K,this.W=new Array(64)}utils.inherits(SHA256,BlockHash),module.exports=SHA256,SHA256.blockSize=512,SHA256.outSize=256,SHA256.hmacStrength=192,SHA256.padLength=64,SHA256.prototype._update=function _update(s,h){for(var t=this.W,i=0;i<16;i++)t[i]=s[h+i];for(;i<t.length;i++)t[i]=sum32_4(g1_256(t[i-2]),t[i-7],g0_256(t[i-15]),t[i-16]);var m=this.h[0],o=this.h[1],u=this.h[2],e=this.h[3],a=this.h[4],n=this.h[5],r=this.h[6],_=this.h[7];for(assert(this.k.length===t.length),i=0;i<t.length;i++){var l=sum32_5(_,s1_256(a),ch32(a,n,r),this.k[i],t[i]),c=sum32(s0_256(m),maj32(m,o,u));_=r,r=n,n=a,a=sum32(e,l),e=u,u=o,o=m,m=sum32(l,c)}this.h[0]=sum32(this.h[0],m),this.h[1]=sum32(this.h[1],o),this.h[2]=sum32(this.h[2],u),this.h[3]=sum32(this.h[3],e),this.h[4]=sum32(this.h[4],a),this.h[5]=sum32(this.h[5],n),this.h[6]=sum32(this.h[6],r),this.h[7]=sum32(this.h[7],_)},SHA256.prototype._digest=function digest(s){return"hex"===s?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}; | |
},{"../common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","./common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/common.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/384.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),SHA512=require("./512");function SHA384(){if(!(this instanceof SHA384))return new SHA384;SHA512.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}utils.inherits(SHA384,SHA512),module.exports=SHA384,SHA384.blockSize=1024,SHA384.outSize=384,SHA384.hmacStrength=192,SHA384.padLength=128,SHA384.prototype._digest=function digest(t){return"hex"===t?utils.toHex32(this.h.slice(0,12),"big"):utils.split32(this.h.slice(0,12),"big")}; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","./512":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/512.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/512.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),common=require("../common"),assert=require("minimalistic-assert"),rotr64_hi=utils.rotr64_hi,rotr64_lo=utils.rotr64_lo,shr64_hi=utils.shr64_hi,shr64_lo=utils.shr64_lo,sum64=utils.sum64,sum64_hi=utils.sum64_hi,sum64_lo=utils.sum64_lo,sum64_4_hi=utils.sum64_4_hi,sum64_4_lo=utils.sum64_4_lo,sum64_5_hi=utils.sum64_5_hi,sum64_5_lo=utils.sum64_5_lo,BlockHash=common.BlockHash,sha512_K=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function SHA512(){if(!(this instanceof SHA512))return new SHA512;BlockHash.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=sha512_K,this.W=new Array(160)}function ch64_hi(t,h,r,i,s){var _=t&r^~t&s;return _<0&&(_+=4294967296),_}function ch64_lo(t,h,r,i,s,_){var o=h&i^~h&_;return o<0&&(o+=4294967296),o}function maj64_hi(t,h,r,i,s){var _=t&r^t&s^r&s;return _<0&&(_+=4294967296),_}function maj64_lo(t,h,r,i,s,_){var o=h&i^h&_^i&_;return o<0&&(o+=4294967296),o}function s0_512_hi(t,h){var r=rotr64_hi(t,h,28)^rotr64_hi(h,t,2)^rotr64_hi(h,t,7);return r<0&&(r+=4294967296),r}function s0_512_lo(t,h){var r=rotr64_lo(t,h,28)^rotr64_lo(h,t,2)^rotr64_lo(h,t,7);return r<0&&(r+=4294967296),r}function s1_512_hi(t,h){var r=rotr64_hi(t,h,14)^rotr64_hi(t,h,18)^rotr64_hi(h,t,9);return r<0&&(r+=4294967296),r}function s1_512_lo(t,h){var r=rotr64_lo(t,h,14)^rotr64_lo(t,h,18)^rotr64_lo(h,t,9);return r<0&&(r+=4294967296),r}function g0_512_hi(t,h){var r=rotr64_hi(t,h,1)^rotr64_hi(t,h,8)^shr64_hi(t,h,7);return r<0&&(r+=4294967296),r}function g0_512_lo(t,h){var r=rotr64_lo(t,h,1)^rotr64_lo(t,h,8)^shr64_lo(t,h,7);return r<0&&(r+=4294967296),r}function g1_512_hi(t,h){var r=rotr64_hi(t,h,19)^rotr64_hi(h,t,29)^shr64_hi(t,h,6);return r<0&&(r+=4294967296),r}function g1_512_lo(t,h){var r=rotr64_lo(t,h,19)^rotr64_lo(h,t,29)^shr64_lo(t,h,6);return r<0&&(r+=4294967296),r}utils.inherits(SHA512,BlockHash),module.exports=SHA512,SHA512.blockSize=1024,SHA512.outSize=512,SHA512.hmacStrength=192,SHA512.padLength=128,SHA512.prototype._prepareBlock=function _prepareBlock(t,h){for(var r=this.W,i=0;i<32;i++)r[i]=t[h+i];for(;i<r.length;i+=2){var s=g1_512_hi(r[i-4],r[i-3]),_=g1_512_lo(r[i-4],r[i-3]),o=r[i-14],u=r[i-13],l=g0_512_hi(r[i-30],r[i-29]),n=g0_512_lo(r[i-30],r[i-29]),e=r[i-32],m=r[i-31];r[i]=sum64_4_hi(s,_,o,u,l,n,e,m),r[i+1]=sum64_4_lo(s,_,o,u,l,n,e,m)}},SHA512.prototype._update=function _update(t,h){this._prepareBlock(t,h);var r=this.W,i=this.h[0],s=this.h[1],_=this.h[2],o=this.h[3],u=this.h[4],l=this.h[5],n=this.h[6],e=this.h[7],m=this.h[8],a=this.h[9],c=this.h[10],f=this.h[11],v=this.h[12],g=this.h[13],p=this.h[14],H=this.h[15];assert(this.k.length===r.length);for(var S=0;S<r.length;S+=2){var A=p,k=H,B=s1_512_hi(m,a),d=s1_512_lo(m,a),j=ch64_hi(m,a,c,f,v,g),y=ch64_lo(m,a,c,f,v,g),b=this.k[S],q=this.k[S+1],x=r[S],W=r[S+1],w=sum64_5_hi(A,k,B,d,j,y,b,q,x,W),z=sum64_5_lo(A,k,B,d,j,y,b,q,x,W);A=s0_512_hi(i,s),k=s0_512_lo(i,s),B=maj64_hi(i,s,_,o,u,l),d=maj64_lo(i,s,_,o,u,l);var K=sum64_hi(A,k,B,d),L=sum64_lo(A,k,B,d);p=v,H=g,v=c,g=f,c=m,f=a,m=sum64_hi(n,e,w,z),a=sum64_lo(e,e,w,z),n=u,e=l,u=_,l=o,_=i,o=s,i=sum64_hi(w,z,K,L),s=sum64_lo(w,z,K,L)}sum64(this.h,0,i,s),sum64(this.h,2,_,o),sum64(this.h,4,u,l),sum64(this.h,6,n,e),sum64(this.h,8,m,a),sum64(this.h,10,c,f),sum64(this.h,12,v,g),sum64(this.h,14,p,H)},SHA512.prototype._digest=function digest(t){return"hex"===t?utils.toHex32(this.h,"big"):utils.split32(this.h,"big")}; | |
},{"../common":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/common.js","../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/sha/common.js":[function(require,module,exports){ | |
"use strict";var utils=require("../utils"),rotr32=utils.rotr32;function ft_1(r,t,o,n){return 0===r?ch32(t,o,n):1===r||3===r?p32(t,o,n):2===r?maj32(t,o,n):void 0}function ch32(r,t,o){return r&t^~r&o}function maj32(r,t,o){return r&t^r&o^t&o}function p32(r,t,o){return r^t^o}function s0_256(r){return rotr32(r,2)^rotr32(r,13)^rotr32(r,22)}function s1_256(r){return rotr32(r,6)^rotr32(r,11)^rotr32(r,25)}function g0_256(r){return rotr32(r,7)^rotr32(r,18)^r>>>3}function g1_256(r){return rotr32(r,17)^rotr32(r,19)^r>>>10}exports.ft_1=ft_1,exports.ch32=ch32,exports.maj32=maj32,exports.p32=p32,exports.s0_256=s0_256,exports.s1_256=s1_256,exports.g0_256=g0_256,exports.g1_256=g1_256; | |
},{"../utils":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash/utils.js":[function(require,module,exports){ | |
"use strict";var assert=require("minimalistic-assert"),inherits=require("inherits");function isSurrogatePair(r,t){return 55296==(64512&r.charCodeAt(t))&&(!(t<0||t+1>=r.length)&&56320==(64512&r.charCodeAt(t+1)))}function toArray(r,t){if(Array.isArray(r))return r.slice();if(!r)return[];var o=[];if("string"==typeof r)if(t){if("hex"===t)for((r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r),n=0;n<r.length;n+=2)o.push(parseInt(r[n]+r[n+1],16))}else for(var e=0,n=0;n<r.length;n++){var u=r.charCodeAt(n);u<128?o[e++]=u:u<2048?(o[e++]=u>>6|192,o[e++]=63&u|128):isSurrogatePair(r,n)?(u=65536+((1023&u)<<10)+(1023&r.charCodeAt(++n)),o[e++]=u>>18|240,o[e++]=u>>12&63|128,o[e++]=u>>6&63|128,o[e++]=63&u|128):(o[e++]=u>>12|224,o[e++]=u>>6&63|128,o[e++]=63&u|128)}else for(n=0;n<r.length;n++)o[n]=0|r[n];return o}function toHex(r){for(var t="",o=0;o<r.length;o++)t+=zero2(r[o].toString(16));return t}function htonl(r){return(r>>>24|r>>>8&65280|r<<8&16711680|(255&r)<<24)>>>0}function toHex32(r,t){for(var o="",e=0;e<r.length;e++){var n=r[e];"little"===t&&(n=htonl(n)),o+=zero8(n.toString(16))}return o}function zero2(r){return 1===r.length?"0"+r:r}function zero8(r){return 7===r.length?"0"+r:6===r.length?"00"+r:5===r.length?"000"+r:4===r.length?"0000"+r:3===r.length?"00000"+r:2===r.length?"000000"+r:1===r.length?"0000000"+r:r}function join32(r,t,o,e){var n=o-t;assert(n%4==0);for(var u=new Array(n/4),s=0,i=t;s<u.length;s++,i+=4){var h;h="big"===e?r[i]<<24|r[i+1]<<16|r[i+2]<<8|r[i+3]:r[i+3]<<24|r[i+2]<<16|r[i+1]<<8|r[i],u[s]=h>>>0}return u}function split32(r,t){for(var o=new Array(4*r.length),e=0,n=0;e<r.length;e++,n+=4){var u=r[e];"big"===t?(o[n]=u>>>24,o[n+1]=u>>>16&255,o[n+2]=u>>>8&255,o[n+3]=255&u):(o[n+3]=u>>>24,o[n+2]=u>>>16&255,o[n+1]=u>>>8&255,o[n]=255&u)}return o}function rotr32(r,t){return r>>>t|r<<32-t}function rotl32(r,t){return r<<t|r>>>32-t}function sum32(r,t){return r+t>>>0}function sum32_3(r,t,o){return r+t+o>>>0}function sum32_4(r,t,o,e){return r+t+o+e>>>0}function sum32_5(r,t,o,e,n){return r+t+o+e+n>>>0}function sum64(r,t,o,e){var n=r[t],u=e+r[t+1]>>>0,s=(u<e?1:0)+o+n;r[t]=s>>>0,r[t+1]=u}function sum64_hi(r,t,o,e){return(t+e>>>0<t?1:0)+r+o>>>0}function sum64_lo(r,t,o,e){return t+e>>>0}function sum64_4_hi(r,t,o,e,n,u,s,i){var h=0,_=t;return h+=(_=_+e>>>0)<t?1:0,h+=(_=_+u>>>0)<u?1:0,r+o+n+s+(h+=(_=_+i>>>0)<i?1:0)>>>0}function sum64_4_lo(r,t,o,e,n,u,s,i){return t+e+u+i>>>0}function sum64_5_hi(r,t,o,e,n,u,s,i,h,_){var l=0,f=t;return l+=(f=f+e>>>0)<t?1:0,l+=(f=f+u>>>0)<u?1:0,l+=(f=f+i>>>0)<i?1:0,r+o+n+s+h+(l+=(f=f+_>>>0)<_?1:0)>>>0}function sum64_5_lo(r,t,o,e,n,u,s,i,h,_){return t+e+u+i+_>>>0}function rotr64_hi(r,t,o){return(t<<32-o|r>>>o)>>>0}function rotr64_lo(r,t,o){return(r<<32-o|t>>>o)>>>0}function shr64_hi(r,t,o){return r>>>o}function shr64_lo(r,t,o){return(r<<32-o|t>>>o)>>>0}exports.inherits=inherits,exports.toArray=toArray,exports.toHex=toHex,exports.htonl=htonl,exports.toHex32=toHex32,exports.zero2=zero2,exports.zero8=zero8,exports.join32=join32,exports.split32=split32,exports.rotr32=rotr32,exports.rotl32=rotl32,exports.sum32=sum32,exports.sum32_3=sum32_3,exports.sum32_4=sum32_4,exports.sum32_5=sum32_5,exports.sum64=sum64,exports.sum64_hi=sum64_hi,exports.sum64_lo=sum64_lo,exports.sum64_4_hi=sum64_4_hi,exports.sum64_4_lo=sum64_4_lo,exports.sum64_5_hi=sum64_5_hi,exports.sum64_5_lo=sum64_5_lo,exports.rotr64_hi=rotr64_hi,exports.rotr64_lo=rotr64_lo,exports.shr64_hi=shr64_hi,exports.shr64_lo=shr64_lo; | |
},{"inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/hmac-drbg/lib/hmac-drbg.js":[function(require,module,exports){ | |
"use strict";var hash=require("hash.js"),utils=require("minimalistic-crypto-utils"),assert=require("minimalistic-assert");function HmacDRBG(t){if(!(this instanceof HmacDRBG))return new HmacDRBG(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=utils.toArray(t.entropy,t.entropyEnc||"hex"),i=utils.toArray(t.nonce,t.nonceEnc||"hex"),s=utils.toArray(t.pers,t.persEnc||"hex");assert(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,s)}module.exports=HmacDRBG,HmacDRBG.prototype._init=function init(t,e,i){var s=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h<this.V.length;h++)this.K[h]=0,this.V[h]=1;this._update(s),this._reseed=1,this.reseedInterval=281474976710656},HmacDRBG.prototype._hmac=function hmac(){return new hash.hmac(this.hash,this.K)},HmacDRBG.prototype._update=function update(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},HmacDRBG.prototype.reseed=function reseed(t,e,i,s){"string"!=typeof e&&(s=i,i=e,e=null),t=utils.toArray(t,e),i=utils.toArray(i,s),assert(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1},HmacDRBG.prototype.generate=function generate(t,e,i,s){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(s=i,i=e,e=null),i&&(i=utils.toArray(i,s||"hex"),this._update(i));for(var h=[];h.length<t;)this.V=this._hmac().update(this.V).digest(),h=h.concat(this.V);var r=h.slice(0,t);return this._update(i),this._reseed++,utils.encode(r,e)}; | |
},{"hash.js":"/Users/lentan/repo/torus/torus-embed/node_modules/hash.js/lib/hash.js","minimalistic-assert":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js","minimalistic-crypto-utils":"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-crypto-utils/lib/utils.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/https-browserify/index.js":[function(require,module,exports){ | |
var http=require("http"),url=require("url"),https=module.exports;for(var key in http)http.hasOwnProperty(key)&&(https[key]=http[key]);function validateParams(t){if("string"==typeof t&&(t=url.parse(t)),t.protocol||(t.protocol="https:"),"https:"!==t.protocol)throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}https.request=function(t,r){return t=validateParams(t),http.request.call(this,t,r)},https.get=function(t,r){return t=validateParams(t),http.get.call(this,t,r)}; | |
},{"http":"/Users/lentan/repo/torus/torus-embed/node_modules/stream-http/index.js","url":"/Users/lentan/repo/torus/torus-embed/node_modules/url/url.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/ieee754/index.js":[function(require,module,exports){ | |
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js":[function(require,module,exports){ | |
"function"==typeof Object.create?module.exports=function inherits(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:module.exports=function inherits(t,e){if(e){t.super_=e;var o=function(){};o.prototype=e.prototype,t.prototype=new o,t.prototype.constructor=t}}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/is-buffer/index.js":[function(require,module,exports){ | |
function isBuffer(f){return!!f.constructor&&"function"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}function isSlowBuffer(f){return"function"==typeof f.readFloatLE&&"function"==typeof f.slice&&isBuffer(f.slice(0,0))}module.exports=function(f){return null!=f&&(isBuffer(f)||isSlowBuffer(f)||!!f._isBuffer)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/is-hex-prefixed/src/index.js":[function(require,module,exports){ | |
module.exports=function isHexPrefixed(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/isarray/index.js":[function(require,module,exports){ | |
var toString={}.toString;module.exports=Array.isArray||function(r){return"[object Array]"==toString.call(r)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/js-sha3/src/sha3.js":[function(require,module,exports){ | |
(function (process,global){ | |
!function(){"use strict";var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var n=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=global:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&"object"==typeof module&&module.exports,o="function"==typeof define&&define.amd,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],f=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],h=[224,256,384,512],p=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],l={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!a||!r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var y=function(t,e,r){return function(n){return new Keccak(t,e,t).update(n)[r]()}},k=function(t,e,r){return function(n,i){return new Keccak(t,e,i).update(n)[r]()}},b=function(t,e,r){return function(e,n,i,o){return g["cshake"+t].update(e,n,i,o)[r]()}},A=function(t,e,r){return function(e,n,i,o){return g["kmac"+t].update(e,n,i,o)[r]()}},w=function(t,e,r,n){for(var i=0;i<d.length;++i){var o=d[i];t[o]=e(r,n,o)}return t},v=function(t,e){var r=y(t,e,"hex");return r.create=function(){return new Keccak(t,e,t)},r.update=function(t){return r.create().update(t)},w(r,y,t,e)},B=[{name:"keccak",padding:[1,256,65536,16777216],bits:h,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:h,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:p,createMethod:function(t,e){var r=k(t,e,"hex");return r.create=function(r){return new Keccak(t,e,r)},r.update=function(t,e){return r.create(e).update(t)},w(r,k,t,e)}},{name:"cshake",padding:s,bits:p,createMethod:function(t,e){var r=l[t],n=b(t,0,"hex");return n.create=function(n,i,o){return i||o?new Keccak(t,e,n).bytepad([i,o],r):g["shake"+t].create(n)},n.update=function(t,e,r,i){return n.create(e,r,i).update(t)},w(n,b,t,e)}},{name:"kmac",padding:s,bits:p,createMethod:function(t,e){var r=l[t],n=A(t,0,"hex");return n.create=function(n,i,o){return new Kmac(t,e,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(t,e,r,i){return n.create(t,r,i).update(e)},w(n,A,t,e)}}],g={},K=[],_=0;_<B.length;++_)for(var S=B[_],m=S.bits,C=0;C<m.length;++C){var x=S.name+"_"+m[C];if(K.push(x),g[x]=S.createMethod(m[C],S.padding),"sha3"!==S.name){var E=S.name+m[C];K.push(E),g[E]=g[x]}}function Keccak(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function Kmac(t,e,r){Keccak.call(this,t,e,r)}Keccak.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}for(var i,o,c=this.blocks,s=this.byteCount,f=e.length,h=this.blockCount,p=0,d=this.s;p<f;){if(this.reset)for(this.reset=!1,c[0]=this.block,i=1;i<h+1;++i)c[i]=0;if(r)for(i=this.start;p<f&&i<s;++p)c[i>>2]|=e[p]<<u[3&i++];else for(i=this.start;p<f&&i<s;++p)(o=e.charCodeAt(p))<128?c[i>>2]|=o<<u[3&i++]:o<2048?(c[i>>2]|=(192|o>>6)<<u[3&i++],c[i>>2]|=(128|63&o)<<u[3&i++]):o<55296||o>=57344?(c[i>>2]|=(224|o>>12)<<u[3&i++],c[i>>2]|=(128|o>>6&63)<<u[3&i++],c[i>>2]|=(128|63&o)<<u[3&i++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++p)),c[i>>2]|=(240|o>>18)<<u[3&i++],c[i>>2]|=(128|o>>12&63)<<u[3&i++],c[i>>2]|=(128|o>>6&63)<<u[3&i++],c[i>>2]|=(128|63&o)<<u[3&i++]);if(this.lastByteIndex=i,i>=s){for(this.start=i-s,this.block=c[h],i=0;i<h;++i)d[i]^=c[i];O(d),this.reset=!0}else this.start=i}return this},Keccak.prototype.encode=function(t,e){var r=255&t,n=1,i=[r];for(r=255&(t>>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},Keccak.prototype.encodeString=function(e){var r,n=typeof e;if("string"!==n){if("object"!==n)throw new Error(t);if(null===e)throw new Error(t);if(a&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||a&&ArrayBuffer.isView(e)))throw new Error(t);r=!0}var i=0,o=e.length;if(r)i=o;else for(var c=0;c<e.length;++c){var s=e.charCodeAt(c);s<128?i+=1:s<2048?i+=2:s<55296||s>=57344?i+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++c)),i+=4)}return i+=this.encode(8*i),this.update(e),i},Keccak.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n<t.length;++n)r+=this.encodeString(t[n]);var i=e-r%e,o=[];return o.length=i,this.update(o),this},Keccak.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,n=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)n[e]^=t[e];O(n)}},Keccak.prototype.toString=Keccak.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<e&&a<n;++o,++a)t=r[o],s+=c[t>>4&15]+c[15&t]+c[t>>12&15]+c[t>>8&15]+c[t>>20&15]+c[t>>16&15]+c[t>>28&15]+c[t>>24&15];a%e==0&&(O(r),o=0)}return i&&(t=r[o],s+=c[t>>4&15]+c[15&t],i>1&&(s+=c[t>>12&15]+c[t>>8&15]),i>2&&(s+=c[t>>20&15]+c[t>>16&15])),s},Keccak.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,c=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(c);for(var s=new Uint32Array(t);a<n;){for(o=0;o<e&&a<n;++o,++a)s[a]=r[o];a%e==0&&O(r)}return i&&(s[o]=r[o],t=t.slice(0,c)),t},Keccak.prototype.buffer=Keccak.prototype.arrayBuffer,Keccak.prototype.digest=Keccak.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,c=0,s=[];c<i;){for(a=0;a<r&&c<i;++a,++c)t=c<<2,e=n[a],s[t]=255&e,s[t+1]=e>>8&255,s[t+2]=e>>16&255,s[t+3]=e>>24&255;c%r==0&&O(n)}return o&&(t=c<<2,e=n[a],s[t]=255&e,o>1&&(s[t+1]=e>>8&255),o>2&&(s[t+2]=e>>16&255)),s},Kmac.prototype=new Keccak,Kmac.prototype.finalize=function(){return this.encode(this.outputBits,!0),Keccak.prototype.finalize.call(this)};var O=function(t){var e,r,n,i,o,a,c,s,u,h,p,d,l,y,k,b,A,w,v,B,g,K,_,S,m,C,x,E,O,z,N,j,J,M,H,I,R,U,V,F,D,W,Y,q,G,L,P,Q,T,X,Z,$,tt,et,rt,nt,it,ot,at,ct,st,ut,ft;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],c=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],u=t[5]^t[15]^t[25]^t[35]^t[45],h=t[6]^t[16]^t[26]^t[36]^t[46],p=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|c>>>31),r=(l=t[9]^t[19]^t[29]^t[39]^t[49])^(c<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(s<<1|u>>>31),r=o^(u<<1|s>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(h<<1|p>>>31),r=c^(p<<1|h>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=s^(d<<1|l>>>31),r=u^(l<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=h^(i<<1|o>>>31),r=p^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,y=t[0],k=t[1],L=t[11]<<4|t[10]>>>28,P=t[10]<<4|t[11]>>>28,E=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ct=t[31]<<9|t[30]>>>23,st=t[30]<<9|t[31]>>>23,W=t[40]<<18|t[41]>>>14,Y=t[41]<<18|t[40]>>>14,M=t[2]<<1|t[3]>>>31,H=t[3]<<1|t[2]>>>31,b=t[13]<<12|t[12]>>>20,A=t[12]<<12|t[13]>>>20,Q=t[22]<<10|t[23]>>>22,T=t[23]<<10|t[22]>>>22,z=t[33]<<13|t[32]>>>19,N=t[32]<<13|t[33]>>>19,ut=t[42]<<2|t[43]>>>30,ft=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,I=t[14]<<6|t[15]>>>26,R=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,v=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,j=t[45]<<29|t[44]>>>3,J=t[44]<<29|t[45]>>>3,S=t[6]<<28|t[7]>>>4,m=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,U=t[26]<<25|t[27]>>>7,V=t[27]<<25|t[26]>>>7,B=t[36]<<21|t[37]>>>11,g=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,G=t[9]<<27|t[8]>>>5,C=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,at=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,D=t[39]<<8|t[38]>>>24,K=t[48]<<14|t[49]>>>18,_=t[49]<<14|t[48]>>>18,t[0]=y^~b&w,t[1]=k^~A&v,t[10]=S^~C&E,t[11]=m^~x&O,t[20]=M^~I&U,t[21]=H^~R&V,t[30]=q^~L&Q,t[31]=G^~P&T,t[40]=et^~nt&ot,t[41]=rt^~it&at,t[2]=b^~w&B,t[3]=A^~v&g,t[12]=C^~E&z,t[13]=x^~O&N,t[22]=I^~U&F,t[23]=R^~V&D,t[32]=L^~Q&X,t[33]=P^~T&Z,t[42]=nt^~ot&ct,t[43]=it^~at&st,t[4]=w^~B&K,t[5]=v^~g&_,t[14]=E^~z&j,t[15]=O^~N&J,t[24]=U^~F&W,t[25]=V^~D&Y,t[34]=Q^~X&$,t[35]=T^~Z&tt,t[44]=ot^~ct&ut,t[45]=at^~st&ft,t[6]=B^~K&y,t[7]=g^~_&k,t[16]=z^~j&S,t[17]=N^~J&m,t[26]=F^~W&M,t[27]=D^~Y&H,t[36]=X^~$&q,t[37]=Z^~tt&G,t[46]=ct^~ut&et,t[47]=st^~ft&rt,t[8]=K^~y&b,t[9]=_^~k&A,t[18]=j^~S&C,t[19]=J^~m&x,t[28]=W^~M&I,t[29]=Y^~H&R,t[38]=$^~q&L,t[39]=tt^~G&P,t[48]=ut^~et&nt,t[49]=ft^~rt&it,t[0]^=f[n],t[1]^=f[n+1]};if(i)module.exports=g;else{for(_=0;_<K.length;++_)r[K[_]]=g[K[_]];o&&define(function(){return g})}}(); | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/getUniqueId.js":[function(require,module,exports){ | |
const MAX=4294967295;let idCounter=Math.floor(Math.random()*MAX);function getUniqueId(){return idCounter=(idCounter+1)%MAX}module.exports=getUniqueId; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/idRemapMiddleware.js":[function(require,module,exports){ | |
const getUniqueId=require("./getUniqueId");function createIdRemapMiddleware(){return(e,d,i,t)=>{const r=e.id,n=getUniqueId();e.id=n,d.id=n,i(i=>{e.id=r,d.id=r,i()})}}module.exports=createIdRemapMiddleware; | |
},{"./getUniqueId":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/getUniqueId.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-engine/src/index.js":[function(require,module,exports){ | |
"use strict";const async=require("async"),SafeEventEmitter=require("safe-event-emitter"),{serializeError:serializeError,EthereumRpcError:EthereumRpcError,ERROR_CODES:ERROR_CODES}=require("eth-json-rpc-errors");class RpcEngine extends SafeEventEmitter{constructor(){super(),this._middleware=[]}push(r){this._middleware.push(r)}handle(r,e){Array.isArray(r)?this._handleBatch(r,e):this._handle(r,e)}async _handleBatch(r,e){try{e(null,await Promise.all(r.map(this._promiseHandle.bind(this))))}catch(r){e(r)}}_promiseHandle(r){return new Promise((e,n)=>{this._handle(r,(r,t)=>{t?e(t):n(r||new EthereumRpcError(ERROR_CODES.rpc.internal,"JsonRpcEngine: Request handler returned neither error nor response."))})})}_handle(r,e){const n=Object.assign({},r),t={id:n.id,jsonrpc:n.jsonrpc};this._runMiddleware(n,t,r=>{const n=t._originalError;if(delete t._originalError,n)return delete t.result,e(n,t);e(r,t)})}_runMiddleware(r,e,n){async.waterfall([n=>this._runMiddlewareDown(r,e,n),function checkForCompletion({isComplete:n,returnHandlers:t},i){if(!("result"in e||"error"in e)){const e=JSON.stringify(r,null,2),n="JsonRpcEngine: Response has no error or result for request:\n"+e;return i(new EthereumRpcError(ERROR_CODES.rpc.internal,n,r))}if(!n){const e=JSON.stringify(r,null,2),n="JsonRpcEngine: Nothing ended request:\n"+e;return i(new EthereumRpcError(ERROR_CODES.rpc.internal,n,r))}return i(null,t)},(r,e)=>this._runReturnHandlersUp(r,e)],n)}_runMiddlewareDown(r,e,n){let t=[],i=!1;async.mapSeries(this._middleware,function eachMiddleware(n,s){if(i)return s();function end(r){const n=r||e&&e.error;n&&(e.error=serializeError(n),e._originalError=n),i=!0,s()}n(r,e,function next(r){e.error?end(e.error):(t.push(r),s())},end)},function completeRequest(r){if(r)return e.error=serializeError(r),delete e.result,n(r,e);const s=t.filter(Boolean).reverse();n(null,{isComplete:i,returnHandlers:s})})}_runReturnHandlersUp(r,e){async.eachSeries(r,(r,e)=>r(e),e)}}module.exports=RpcEngine; | |
},{"async":"/Users/lentan/repo/torus/torus-embed/node_modules/async/dist/async.js","eth-json-rpc-errors":"/Users/lentan/repo/torus/torus-embed/node_modules/eth-json-rpc-errors/index.js","safe-event-emitter":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-event-emitter/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/index.js":[function(require,module,exports){ | |
const SafeEventEmitter=require("safe-event-emitter"),DuplexStream=require("readable-stream").Duplex;function createStreamMiddleware(){const e={},t=new DuplexStream({objectMode:!0,read:function readNoop(){return!1},write:function processMessage(t,n,i){let o;try{const n=!t.id;n?function processNotification(e){r.emit("notification",e)}(t):function processResponse(t){const r=e[t.id];if(!r)throw new Error(`StreamMiddleware - Unknown response id ${t.id}`);delete e[t.id],Object.assign(r.res,t),setTimeout(r.end)}(t)}catch(e){o=e}i(o)}}),r=new SafeEventEmitter;return{events:r,middleware:(r,n,i,o)=>{t.push(r),e[r.id]={req:r,res:n,next:i,end:o}},stream:t}}module.exports=createStreamMiddleware; | |
},{"readable-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/readable-browser.js","safe-event-emitter":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-event-emitter/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js":[function(require,module,exports){ | |
"use strict";var pna=require("process-nextick-args"),objectKeys=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};module.exports=Duplex;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Duplex.prototype._destroy=function(e,t){this.push(null),this.end(),pna.nextTick(t,e)}; | |
},{"./_stream_readable":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_readable.js","./_stream_writable":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_writable.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_passthrough.js":[function(require,module,exports){ | |
"use strict";module.exports=PassThrough;var Transform=require("./_stream_transform"),util=Object.create(require("core-util-is"));function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);Transform.call(this,r)}util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,t){t(null,r)}; | |
},{"./_stream_transform":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_transform.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_readable.js":[function(require,module,exports){ | |
(function (process,global){ | |
"use strict";var pna=require("process-nextick-args");module.exports=Readable;var Duplex,isArray=require("isarray");Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(e,t){return e.listeners(t).length},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var debugUtil=require("util"),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=require("./internal/streams/BufferList"),destroyImpl=require("./internal/streams/destroy");util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function ReadableState(e,t){e=e||{};var n=t instanceof(Duplex=Duplex||require("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,a=e.readableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(a||0===a)?a:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),Stream.call(this)}function readableAddChunk(e,t,n,r,a){var i,d=e._readableState;null===t?(d.reading=!1,onEofChunk(e,d)):(a||(i=chunkInvalid(d,t)),i?e.emit("error",i):d.objectMode||t&&t.length>0?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===Buffer.prototype||(t=_uint8ArrayToBuffer(t)),r?d.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):addChunk(e,d,t,!0):d.ended?e.emit("error",new Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||0!==t.length?addChunk(e,d,t,!1):maybeReadMore(e,d)):addChunk(e,d,t,!1))):r||(d.reading=!1));return needMoreData(d)}function addChunk(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&emitReadable(e)),maybeReadMore(e,t)}function chunkInvalid(e,t){var n;return _isUint8Array(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(e,t){this.push(null),t(e)},Readable.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=Buffer.from(e,t),t=""),n=!0),readableAddChunk(this,e,t,!1,n)},Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(e){return StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?pna.nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,pna.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&EElistenerCount(e,"data")&&(t.flowing=!0,flow(e))}}function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,pna.nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=fromListPartial(e,t.buffer,t.decoder),n);var n}function fromListPartial(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?copyFromBufferString(e,t):copyFromBuffer(e,t),r}function copyFromBufferString(e,t){var n=t.head,r=1,a=n.data;for(e-=a.length;n=n.next;){var i=n.data,d=e>i.length?i.length:e;if(d===i.length?a+=i:a+=i.slice(0,e),0===(e-=d)){d===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(d));break}++r}return t.length-=r,a}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e),r=t.head,a=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var i=r.data,d=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,d),0===(e-=d)){d===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(d));break}++a}return t.length-=a,n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,pna.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function indexOf(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var r,a=t.needReadable;return debug("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&debug("length less than watermark",a=!0),t.ended||t.reading?debug("reading or ended",a=!1):a&&(debug("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(n,t))),null===(r=e>0?fromList(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&endReadable(this)),null!==r&&this.emit("data",r),r},Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,debug("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?onend:unpipe;function onunpipe(t,a){debug("onunpipe"),t===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,function cleanup(){debug("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",i),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),n.removeListener("end",onend),n.removeListener("end",unpipe),n.removeListener("data",ondata),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||i()}())}function onend(){debug("onend"),e.end()}r.endEmitted?pna.nextTick(a):n.once("end",a),e.on("unpipe",onunpipe);var i=pipeOnDrain(n);e.on("drain",i);var d=!1;var o=!1;function ondata(t){debug("ondata"),o=!1,!1!==e.write(t)||o||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==indexOf(r.pipes,e))&&!d&&(debug("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,o=!0),n.pause())}function onerror(t){debug("onerror",t),unpipe(),e.removeListener("error",onerror),0===EElistenerCount(e,"error")&&e.emit("error",t)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),n.unpipe(e)}return n.on("data",ondata),prependListener(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",n),r.flowing||(debug("pipe resume"),n.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)r[i].emit("unpipe",this,n);return this}var d=indexOf(t.pipes,e);return-1===d?this:(t.pipes.splice(d,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},Readable.prototype.on=function(e,t){var n=Stream.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return n},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",function(){if(debug("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){(debug("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a)||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<kProxyEvents.length;i++)e.on(kProxyEvents[i],this.emit.bind(this,kProxyEvents[i]));return this._read=function(t){debug("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList; | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js","./internal/streams/BufferList":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js","./internal/streams/destroy":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/destroy.js","./internal/streams/stream":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js","_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","events":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","isarray":"/Users/lentan/repo/torus/torus-embed/node_modules/isarray/index.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js","string_decoder/":"/Users/lentan/repo/torus/torus-embed/node_modules/string_decoder/lib/string_decoder.js","util":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_transform.js":[function(require,module,exports){ | |
"use strict";module.exports=Transform;var Duplex=require("./_stream_duplex"),util=Object.create(require("core-util-is"));function afterTransform(r,t){var e=this._transformState;e.transforming=!1;var n=e.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));e.writechunk=null,e.writecb=null,null!=t&&this.push(t),n(r);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Transform(r){if(!(this instanceof Transform))return new Transform(r);Duplex.call(this,r),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&("function"==typeof r.transform&&(this._transform=r.transform),"function"==typeof r.flush&&(this._flush=r.flush)),this.on("prefinish",prefinish)}function prefinish(){var r=this;"function"==typeof this._flush?this._flush(function(t,e){done(r,t,e)}):done(this,null,null)}function done(r,t,e){if(t)return r.emit("error",t);if(null!=e&&r.push(e),r._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(r._transformState.transforming)throw new Error("Calling transform done when still transforming");return r.push(null)}util.inherits=require("inherits"),util.inherits(Transform,Duplex),Transform.prototype.push=function(r,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,r,t)},Transform.prototype._transform=function(r,t,e){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(r,t,e){var n=this._transformState;if(n.writecb=e,n.writechunk=r,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(r){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Transform.prototype._destroy=function(r,t){var e=this;Duplex.prototype._destroy.call(this,r,function(r){t(r),e.emit("close")})}; | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_writable.js":[function(require,module,exports){ | |
(function (process,global,setImmediate){ | |
"use strict";var pna=require("process-nextick-args");function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(t,e)}}module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var realHasInstance,destroyImpl=require("./internal/streams/destroy");function nop(){}function WritableState(e,t){Duplex=Duplex||require("./_stream_duplex"),e=e||{};var r=t instanceof Duplex;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(n||0===n)?n:o,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 a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},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 CorkedRequest(this)}function Writable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),Stream.call(this)}function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r),pna.nextTick(t,r)}function validChunk(e,t,r,i){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),pna.nextTick(i,o),n=!1),n}function decodeChunk(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r)),t}function writeOrBuffer(e,t,r,i,n,o){if(!r){var a=decodeChunk(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,s,i,n,o);return f}function doWrite(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function onwriteError(e,t,r,i,n){--t.pendingcb,r?(pna.nextTick(n,i),pna.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),finishMaybe(e,t))}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,i,t,n);else{var o=needFinish(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),i?asyncWrite(afterWrite,e,r,o,n):afterWrite(e,r,o,n)}}function afterWrite(e,t,r,i){r||onwriteDrain(e,t),t.pendingcb--,i(),finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,doWrite(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,u=r.encoding,l=r.callback;if(doWrite(e,t,!1,t.objectMode?1:f.length,f,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),finishMaybe(e,t)})}function prefinish(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,pna.nextTick(callFinal,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function finishMaybe(e,t){var r=needFinish(t);return r&&(prefinish(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?pna.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function onCorkedFinish(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function getBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(e){return!!realHasInstance.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):realHasInstance=function(e){return e instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&_isUint8Array(e);return o&&!Buffer.isBuffer(e)&&(e=_uint8ArrayToBuffer(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=nop),i.ended?writeAfterEnd(this,r):(o||validChunk(this,i,e,r))&&(i.pendingcb++,n=writeOrBuffer(this,i,o,e,t,r)),n},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||endWritable(this,i,r)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(e,t){this.end(),t(e)}; | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js","./internal/streams/destroy":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/destroy.js","./internal/streams/stream":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js","_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js","timers":"/Users/lentan/repo/torus/torus-embed/node_modules/timers-browserify/main.js","util-deprecate":"/Users/lentan/repo/torus/torus-embed/node_modules/util-deprecate/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/BufferList.js":[function(require,module,exports){ | |
"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Buffer=require("safe-buffer").Buffer,util=require("util");function copyBuffer(t,e,i){t.copy(e,i)}module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function push(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},BufferList.prototype.unshift=function unshift(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},BufferList.prototype.shift=function shift(){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}},BufferList.prototype.clear=function clear(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function join(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},BufferList.prototype.concat=function concat(t){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var e=Buffer.allocUnsafe(t>>>0),i=this.head,n=0;i;)copyBuffer(i.data,e,n),n+=i.data.length,i=i.next;return e},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var t=util.inspect({length:this.length});return this.constructor.name+" "+t}); | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js","util":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/destroy.js":[function(require,module,exports){ | |
"use strict";var pna=require("process-nextick-args");function destroy(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return a||i?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(pna.nextTick(emitErrorNT,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function undestroy(){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)}function emitErrorNT(t,e){t.emit("error",e)}module.exports={destroy:destroy,undestroy:undestroy}; | |
},{"process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/internal/streams/stream-browser.js":[function(require,module,exports){ | |
module.exports=require("events").EventEmitter; | |
},{"events":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/readable-browser.js":[function(require,module,exports){ | |
exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js"); | |
},{"./lib/_stream_duplex.js":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_duplex.js","./lib/_stream_passthrough.js":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_passthrough.js","./lib/_stream_readable.js":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_readable.js","./lib/_stream_transform.js":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_transform.js","./lib/_stream_writable.js":"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/readable-stream/lib/_stream_writable.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-rpc-middleware-stream/node_modules/safe-buffer/index.js":[function(require,module,exports){ | |
var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,r){for(var e in f)r[e]=f[e]}function SafeBuffer(f,r,e){return Buffer(f,r,e)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,r,e){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,r,e)},SafeBuffer.alloc=function(f,r,e){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==r?"string"==typeof e?u.fill(r,e):u.fill(r):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)}; | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/json-stable-stringify/index.js":[function(require,module,exports){ | |
var json="undefined"!=typeof JSON?JSON:require("jsonify");module.exports=function(r,n){n||(n={}),"function"==typeof n&&(n={cmp:n});var t=n.space||"";"number"==typeof t&&(t=Array(t+1).join(" "));var e,o="boolean"==typeof n.cycles&&n.cycles,i=n.replacer||function(r,n){return n},f=n.cmp&&(e=n.cmp,function(r){return function(n,t){var o={key:n,value:r[n]},i={key:t,value:r[t]};return e(o,i)}}),u=[];return function stringify(r,n,e,c){var y=t?"\n"+new Array(c+1).join(t):"",s=t?": ":":";if(e&&e.toJSON&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0!==(e=i.call(r,n,e))){if("object"!=typeof e||null===e)return json.stringify(e);if(isArray(e)){for(var a=[],l=0;l<e.length;l++){var p=stringify(e,l,e[l],c+1)||json.stringify(null);a.push(y+t+p)}return"["+a.join(",")+y+"]"}if(-1!==u.indexOf(e)){if(o)return json.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}u.push(e);var v=objectKeys(e).sort(f&&f(e));for(a=[],l=0;l<v.length;l++){var j=stringify(e,n=v[l],e[n],c+1);if(j){var g=json.stringify(n)+s+j;a.push(y+t+g)}}return u.splice(u.indexOf(e),1),"{"+a.join(",")+y+"}"}}({"":r},"",r,0)};var isArray=Array.isArray||function(r){return"[object Array]"==={}.toString.call(r)},objectKeys=Object.keys||function(r){var n=Object.prototype.hasOwnProperty||function(){return!0},t=[];for(var e in r)n.call(r,e)&&t.push(e);return t}; | |
},{"jsonify":"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/index.js":[function(require,module,exports){ | |
exports.parse=require("./lib/parse"),exports.stringify=require("./lib/stringify"); | |
},{"./lib/parse":"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/lib/parse.js","./lib/stringify":"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/lib/stringify.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/lib/parse.js":[function(require,module,exports){ | |
var at,ch,text,value,escapee={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},error=function(e){throw{name:"SyntaxError",message:e,at:at,text:text}},next=function(e){return e&&e!==ch&&error("Expected '"+e+"' instead of '"+ch+"'"),ch=text.charAt(at),at+=1,ch},number=function(){var e,t="";for("-"===ch&&(t="-",next("-"));ch>="0"&&ch<="9";)t+=ch,next();if("."===ch)for(t+=".";next()&&ch>="0"&&ch<="9";)t+=ch;if("e"===ch||"E"===ch)for(t+=ch,next(),"-"!==ch&&"+"!==ch||(t+=ch,next());ch>="0"&&ch<="9";)t+=ch,next();if(e=+t,isFinite(e))return e;error("Bad number")},string=function(){var e,t,r,n="";if('"'===ch)for(;next();){if('"'===ch)return next(),n;if("\\"===ch)if(next(),"u"===ch){for(r=0,t=0;t<4&&(e=parseInt(next(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof escapee[ch])break;n+=escapee[ch]}else n+=ch}error("Bad string")},white=function(){for(;ch&&ch<=" ";)next()},word=function(){switch(ch){case"t":return next("t"),next("r"),next("u"),next("e"),!0;case"f":return next("f"),next("a"),next("l"),next("s"),next("e"),!1;case"n":return next("n"),next("u"),next("l"),next("l"),null}error("Unexpected '"+ch+"'")},array=function(){var e=[];if("["===ch){if(next("["),white(),"]"===ch)return next("]"),e;for(;ch;){if(e.push(value()),white(),"]"===ch)return next("]"),e;next(","),white()}}error("Bad array")},object=function(){var e,t={};if("{"===ch){if(next("{"),white(),"}"===ch)return next("}"),t;for(;ch;){if(e=string(),white(),next(":"),Object.hasOwnProperty.call(t,e)&&error('Duplicate key "'+e+'"'),t[e]=value(),white(),"}"===ch)return next("}"),t;next(","),white()}}error("Bad object")};value=function(){switch(white(),ch){case"{":return object();case"[":return array();case'"':return string();case"-":return number();default:return ch>="0"&&ch<="9"?number():word()}},module.exports=function(e,t){var r;return text=e,at=0,ch=" ",r=value(),white(),ch&&error("Syntax error"),"function"==typeof t?function walk(e,r){var n,c,h=e[r];if(h&&"object"==typeof h)for(n in h)Object.prototype.hasOwnProperty.call(h,n)&&(void 0!==(c=walk(h,n))?h[n]=c:delete h[n]);return t.call(e,r,h)}({"":r},""):r}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/jsonify/lib/stringify.js":[function(require,module,exports){ | |
var gap,indent,rep,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,f,u,o,p=gap,a=t[e];switch(a&&"object"==typeof a&&"function"==typeof a.toJSON&&(a=a.toJSON(e)),"function"==typeof rep&&(a=rep.call(t,e,a)),typeof a){case"string":return quote(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(a)){for(u=a.length,n=0;n<u;n+=1)o[n]=str(n,a)||"null";return f=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+p+"]":"["+o.join(",")+"]",gap=p,f}if(rep&&"object"==typeof rep)for(u=rep.length,n=0;n<u;n+=1)"string"==typeof(r=rep[n])&&(f=str(r,a))&&o.push(quote(r)+(gap?": ":":")+f);else for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(f=str(r,a))&&o.push(quote(r)+(gap?": ":":")+f);return f=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+p+"}":"{"+o.join(",")+"}",gap=p,f}}module.exports=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;r<n;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/loglevel/lib/loglevel.js":[function(require,module,exports){ | |
!function(e,o){"use strict";"function"==typeof define&&define.amd?define(o):"object"==typeof module&&module.exports?module.exports=o():e.log=o()}(this,function(){"use strict";var e=function(){},o="undefined",t=typeof window!==o&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function bindMethod(e,o){var t=e[o];if("function"==typeof t.bind)return t.bind(e);try{return Function.prototype.bind.call(t,e)}catch(o){return function(){return Function.prototype.apply.apply(t,[e,arguments])}}}function traceForIE(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function replaceLoggingMethods(o,t){for(var l=0;l<n.length;l++){var r=n[l];this[r]=l<o?e:this.methodFactory(r,o,t)}this.log=this.debug}function defaultMethodFactory(n,l,r){return function realMethod(n){return"debug"===n&&(n="log"),typeof console!==o&&("trace"===n&&t?traceForIE:void 0!==console[n]?bindMethod(console,n):void 0!==console.log?bindMethod(console,"log"):e)}(n)||function enableLoggingWhenConsoleArrives(e,t,n){return function(){typeof console!==o&&(replaceLoggingMethods.call(this,t,n),this[e].apply(this,arguments))}}.apply(this,arguments)}function Logger(e,t,l){var r,i=this,c="loglevel";function getPersistedLevel(){var e;if(typeof window!==o){try{e=window.localStorage[c]}catch(e){}if(typeof e===o)try{var t=window.document.cookie,n=t.indexOf(encodeURIComponent(c)+"=");-1!==n&&(e=/^([^;]+)/.exec(t.slice(n))[1])}catch(e){}return void 0===i.levels[e]&&(e=void 0),e}}e&&(c+=":"+e),i.name=e,i.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},i.methodFactory=l||defaultMethodFactory,i.getLevel=function(){return r},i.setLevel=function(t,l){if("string"==typeof t&&void 0!==i.levels[t.toUpperCase()]&&(t=i.levels[t.toUpperCase()]),!("number"==typeof t&&t>=0&&t<=i.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(r=t,!1!==l&&function persistLevelIfPossible(e){var t=(n[e]||"silent").toUpperCase();if(typeof window!==o){try{return void(window.localStorage[c]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+t+";"}catch(e){}}}(t),replaceLoggingMethods.call(i,t,e),typeof console===o&&t<i.levels.SILENT)return"No console available for logging"},i.setDefaultLevel=function(e){getPersistedLevel()||i.setLevel(e,!1)},i.enableAll=function(e){i.setLevel(i.levels.TRACE,e)},i.disableAll=function(e){i.setLevel(i.levels.SILENT,e)};var s=getPersistedLevel();null==s&&(s=null==t?"WARN":t),i.setLevel(s,!1)}var l=new Logger,r={};l.getLogger=function getLogger(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var o=r[e];return o||(o=r[e]=new Logger(e,l.getLevel(),l.methodFactory)),o};var i=typeof window!==o?window.log:void 0;return l.noConflict=function(){return typeof window!==o&&window.log===l&&(window.log=i),l},l.getLoggers=function getLoggers(){return r},l}); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/md5.js/index.js":[function(require,module,exports){ | |
"use strict";var inherits=require("inherits"),HashBase=require("hash-base"),Buffer=require("safe-buffer").Buffer,ARRAY16=new Array(16);function MD5(){HashBase.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function rotl(n,f){return n<<f|n>>>32-f}function fnF(n,f,t,i,s,e,r){return rotl(n+(f&t|~f&i)+s+e|0,r)+f|0}function fnG(n,f,t,i,s,e,r){return rotl(n+(f&i|t&~i)+s+e|0,r)+f|0}function fnH(n,f,t,i,s,e,r){return rotl(n+(f^t^i)+s+e|0,r)+f|0}function fnI(n,f,t,i,s,e,r){return rotl(n+(t^(f|~i))+s+e|0,r)+f|0}inherits(MD5,HashBase),MD5.prototype._update=function(){for(var n=ARRAY16,f=0;f<16;++f)n[f]=this._block.readInt32LE(4*f);var t=this._a,i=this._b,s=this._c,e=this._d;t=fnF(t,i,s,e,n[0],3614090360,7),e=fnF(e,t,i,s,n[1],3905402710,12),s=fnF(s,e,t,i,n[2],606105819,17),i=fnF(i,s,e,t,n[3],3250441966,22),t=fnF(t,i,s,e,n[4],4118548399,7),e=fnF(e,t,i,s,n[5],1200080426,12),s=fnF(s,e,t,i,n[6],2821735955,17),i=fnF(i,s,e,t,n[7],4249261313,22),t=fnF(t,i,s,e,n[8],1770035416,7),e=fnF(e,t,i,s,n[9],2336552879,12),s=fnF(s,e,t,i,n[10],4294925233,17),i=fnF(i,s,e,t,n[11],2304563134,22),t=fnF(t,i,s,e,n[12],1804603682,7),e=fnF(e,t,i,s,n[13],4254626195,12),s=fnF(s,e,t,i,n[14],2792965006,17),t=fnG(t,i=fnF(i,s,e,t,n[15],1236535329,22),s,e,n[1],4129170786,5),e=fnG(e,t,i,s,n[6],3225465664,9),s=fnG(s,e,t,i,n[11],643717713,14),i=fnG(i,s,e,t,n[0],3921069994,20),t=fnG(t,i,s,e,n[5],3593408605,5),e=fnG(e,t,i,s,n[10],38016083,9),s=fnG(s,e,t,i,n[15],3634488961,14),i=fnG(i,s,e,t,n[4],3889429448,20),t=fnG(t,i,s,e,n[9],568446438,5),e=fnG(e,t,i,s,n[14],3275163606,9),s=fnG(s,e,t,i,n[3],4107603335,14),i=fnG(i,s,e,t,n[8],1163531501,20),t=fnG(t,i,s,e,n[13],2850285829,5),e=fnG(e,t,i,s,n[2],4243563512,9),s=fnG(s,e,t,i,n[7],1735328473,14),t=fnH(t,i=fnG(i,s,e,t,n[12],2368359562,20),s,e,n[5],4294588738,4),e=fnH(e,t,i,s,n[8],2272392833,11),s=fnH(s,e,t,i,n[11],1839030562,16),i=fnH(i,s,e,t,n[14],4259657740,23),t=fnH(t,i,s,e,n[1],2763975236,4),e=fnH(e,t,i,s,n[4],1272893353,11),s=fnH(s,e,t,i,n[7],4139469664,16),i=fnH(i,s,e,t,n[10],3200236656,23),t=fnH(t,i,s,e,n[13],681279174,4),e=fnH(e,t,i,s,n[0],3936430074,11),s=fnH(s,e,t,i,n[3],3572445317,16),i=fnH(i,s,e,t,n[6],76029189,23),t=fnH(t,i,s,e,n[9],3654602809,4),e=fnH(e,t,i,s,n[12],3873151461,11),s=fnH(s,e,t,i,n[15],530742520,16),t=fnI(t,i=fnH(i,s,e,t,n[2],3299628645,23),s,e,n[0],4096336452,6),e=fnI(e,t,i,s,n[7],1126891415,10),s=fnI(s,e,t,i,n[14],2878612391,15),i=fnI(i,s,e,t,n[5],4237533241,21),t=fnI(t,i,s,e,n[12],1700485571,6),e=fnI(e,t,i,s,n[3],2399980690,10),s=fnI(s,e,t,i,n[10],4293915773,15),i=fnI(i,s,e,t,n[1],2240044497,21),t=fnI(t,i,s,e,n[8],1873313359,6),e=fnI(e,t,i,s,n[15],4264355552,10),s=fnI(s,e,t,i,n[6],2734768916,15),i=fnI(i,s,e,t,n[13],1309151649,21),t=fnI(t,i,s,e,n[4],4149444226,6),e=fnI(e,t,i,s,n[11],3174756917,10),s=fnI(s,e,t,i,n[2],718787259,15),i=fnI(i,s,e,t,n[9],3951481745,21),this._a=this._a+t|0,this._b=this._b+i|0,this._c=this._c+s|0,this._d=this._d+e|0},MD5.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var n=Buffer.allocUnsafe(16);return n.writeInt32LE(this._a,0),n.writeInt32LE(this._b,4),n.writeInt32LE(this._c,8),n.writeInt32LE(this._d,12),n},module.exports=MD5; | |
},{"hash-base":"/Users/lentan/repo/torus/torus-embed/node_modules/hash-base/index.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/miller-rabin/lib/mr.js":[function(require,module,exports){ | |
var bn=require("bn.js"),brorand=require("brorand");function MillerRabin(r){this.rand=r||new brorand.Rand}module.exports=MillerRabin,MillerRabin.create=function create(r){return new MillerRabin(r)},MillerRabin.prototype._randbelow=function _randbelow(r){var n=r.bitLength(),e=Math.ceil(n/8);do{var t=new bn(this.rand.generate(e))}while(t.cmp(r)>=0);return t},MillerRabin.prototype._randrange=function _randrange(r,n){var e=n.sub(r);return r.add(this._randbelow(e))},MillerRabin.prototype.test=function test(r,n,e){var t=r.bitLength(),a=bn.mont(r),i=new bn(1).toRed(a);n||(n=Math.max(1,t/48|0));for(var o=r.subn(1),b=0;!o.testn(b);b++);for(var d=r.shrn(b),u=o.toRed(a);n>0;n--){var f=this._randrange(new bn(2),o);e&&e(f);var c=f.toRed(a).redPow(d);if(0!==c.cmp(i)&&0!==c.cmp(u)){for(var l=1;l<b;l++){if(0===(c=c.redSqr()).cmp(i))return!1;if(0===c.cmp(u))break}if(l===b)return!1}}return!0},MillerRabin.prototype.getDivisor=function getDivisor(r,n){var e=r.bitLength(),t=bn.mont(r),a=new bn(1).toRed(t);n||(n=Math.max(1,e/48|0));for(var i=r.subn(1),o=0;!i.testn(o);o++);for(var b=r.shrn(o),d=i.toRed(t);n>0;n--){var u=this._randrange(new bn(2),i),f=r.gcd(u);if(0!==f.cmpn(1))return f;var c=u.toRed(t).redPow(b);if(0!==c.cmp(a)&&0!==c.cmp(d)){for(var l=1;l<o;l++){if(0===(c=c.redSqr()).cmp(a))return c.fromRed().subn(1).gcd(r);if(0===c.cmp(d))break}if(l===o)return(c=c.redSqr()).fromRed().subn(1).gcd(r)}}return!1}; | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/bn.js/lib/bn.js","brorand":"/Users/lentan/repo/torus/torus-embed/node_modules/brorand/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-assert/index.js":[function(require,module,exports){ | |
function assert(r,e){if(!r)throw new Error(e||"Assertion failed")}module.exports=assert,assert.equal=function assertEqual(r,e,s){if(r!=e)throw new Error(s||"Assertion failed: "+r+" != "+e)}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/minimalistic-crypto-utils/lib/utils.js":[function(require,module,exports){ | |
"use strict";var utils=exports;function toArray(r,t){if(Array.isArray(r))return r.slice();if(!r)return[];var e=[];if("string"!=typeof r){for(var n=0;n<r.length;n++)e[n]=0|r[n];return e}if("hex"===t){(r=r.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(r="0"+r);for(n=0;n<r.length;n+=2)e.push(parseInt(r[n]+r[n+1],16))}else for(n=0;n<r.length;n++){var o=r.charCodeAt(n),u=o>>8,i=255&o;u?e.push(u,i):e.push(i)}return e}function zero2(r){return 1===r.length?"0"+r:r}function toHex(r){for(var t="",e=0;e<r.length;e++)t+=zero2(r[e].toString(16));return t}utils.toArray=toArray,utils.zero2=zero2,utils.toHex=toHex,utils.encode=function encode(r,t){return"hex"===t?toHex(r):r}; | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js":[function(require,module,exports){ | |
!function(t,i){"use strict";function assert(t,i){if(!t)throw new Error(i||"Assertion failed")}function inherits(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function BN(t,i,r){if(BN.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var r;"object"==typeof t?t.exports=BN:i.BN=BN,BN.BN=BN,BN.wordSize=26;try{r=require("buffer").Buffer}catch(t){}function parseHex(t,i,r){for(var e=0,n=Math.min(t.length,r),h=i;h<n;h++){var s=t.charCodeAt(h)-48;e<<=4,e|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return e}function parseBase(t,i,r,e){for(var n=0,h=Math.min(t.length,r),s=i;s<h;s++){var o=t.charCodeAt(s)-48;n*=e,n+=o>=49?o-49+10:o>=17?o-17+10:o}return n}BN.isBN=function isBN(t){return t instanceof BN||null!==t&&"object"==typeof t&&t.constructor.wordSize===BN.wordSize&&Array.isArray(t.words)},BN.max=function max(t,i){return t.cmp(i)>0?t:i},BN.min=function min(t,i){return t.cmp(i)<0?t:i},BN.prototype._init=function init(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),assert(i===(0|i)&&i>=2&&i<=36);var e=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&e++,16===i?this._parseHex(t,e):this._parseBase(t,i,e),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initNumber=function _initNumber(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(assert(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},BN.prototype._initArray=function _initArray(t,i,r){if(assert("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h,s=0;if("be"===r)for(e=t.length-1,n=0;e>=0;e-=3)h=t[e]|t[e-1]<<8|t[e-2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);else if("le"===r)for(e=0,n=0;e<t.length;e+=3)h=t[e]|t[e+1]<<8|t[e+2]<<16,this.words[n]|=h<<s&67108863,this.words[n+1]=h>>>26-s&67108863,(s+=24)>=26&&(s-=26,n++);return this.strip()},BN.prototype._parseHex=function _parseHex(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var e,n,h=0;for(r=t.length-6,e=0;r>=i;r-=6)n=parseHex(t,r,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303,(h+=24)>=26&&(h-=26,e++);r+6!==i&&(n=parseHex(t,i,r+6),this.words[e]|=n<<h&67108863,this.words[e+1]|=n>>>26-h&4194303),this.strip()},BN.prototype._parseBase=function _parseBase(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,s=h%e,o=Math.min(h,h-s)+r,u=0,a=r;a<o;a+=e)u=parseBase(t,a,a+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var l=1;for(u=parseBase(t,a,t.length,i),a=0;a<s;a++)l*=i;this.imuln(l),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}},BN.prototype.copy=function copy(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},BN.prototype.clone=function clone(){var t=new BN(null);return this.copy(t),t},BN.prototype._expand=function _expand(t){for(;this.length<t;)this.words[this.length++]=0;return this},BN.prototype.strip=function strip(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},BN.prototype._normSign=function _normSign(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var e=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],n=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function smallMulTo(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],s=n*h,o=67108863&s,u=s/67108864|0;r.words[0]=o;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(s=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&s}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}BN.prototype.toString=function toString(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var s=0,o=0,u=0;u<this.length;u++){var a=this.words[u],l=(16777215&(a<<s|o)).toString(16);r=0!==(o=a>>>24-s&16777215)||u!==this.length-1?e[6-l.length]+l+r:l+r,(s+=2)>=26&&(s-=26,u--)}for(0!==o&&(r=o.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var m=n[t],f=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(f).toString(t);r=(d=d.idivn(f)).isZero()?p+r:e[m-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}assert(!1,"Base should be between 2 and 36")},BN.prototype.toNumber=function toNumber(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&assert(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},BN.prototype.toJSON=function toJSON(){return this.toString(16)},BN.prototype.toBuffer=function toBuffer(t,i){return assert(void 0!==r),this.toArrayLike(r,t,i)},BN.prototype.toArray=function toArray(t,i){return this.toArrayLike(Array,t,i)},BN.prototype.toArrayLike=function toArrayLike(t,i,r){var e=this.byteLength(),n=r||Math.max(1,e);assert(e<=n,"byte array longer than desired length"),assert(n>0,"Requested array length <= 0"),this.strip();var h,s,o="le"===i,u=new t(n),a=this.clone();if(o){for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[s]=h;for(;s<n;s++)u[s]=0}else{for(s=0;s<n-e;s++)u[s]=0;for(s=0;!a.isZero();s++)h=a.andln(255),a.iushrn(8),u[n-s-1]=h}return u},Math.clz32?BN.prototype._countBits=function _countBits(t){return 32-Math.clz32(t)}:BN.prototype._countBits=function _countBits(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},BN.prototype._zeroBits=function _zeroBits(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},BN.prototype.bitLength=function bitLength(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)},BN.prototype.toTwos=function toTwos(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},BN.prototype.fromTwos=function fromTwos(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},BN.prototype.isNeg=function isNeg(){return 0!==this.negative},BN.prototype.neg=function neg(){return this.clone().ineg()},BN.prototype.ineg=function ineg(){return this.isZero()||(this.negative^=1),this},BN.prototype.iuor=function iuor(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this.strip()},BN.prototype.ior=function ior(t){return assert(0==(this.negative|t.negative)),this.iuor(t)},BN.prototype.or=function or(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},BN.prototype.uor=function uor(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},BN.prototype.iuand=function iuand(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this.strip()},BN.prototype.iand=function iand(t){return assert(0==(this.negative|t.negative)),this.iuand(t)},BN.prototype.and=function and(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},BN.prototype.uand=function uand(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},BN.prototype.iuxor=function iuxor(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this.strip()},BN.prototype.ixor=function ixor(t){return assert(0==(this.negative|t.negative)),this.iuxor(t)},BN.prototype.xor=function xor(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},BN.prototype.uxor=function uxor(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},BN.prototype.inotn=function inotn(t){assert("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var e=0;e<i;e++)this.words[e]=67108863&~this.words[e];return r>0&&(this.words[e]=~this.words[e]&67108863>>26-r),this.strip()},BN.prototype.notn=function notn(t){return this.clone().inotn(t)},BN.prototype.setn=function setn(t,i){assert("number"==typeof t&&t>=0);var r=t/26|0,e=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<e:this.words[r]&~(1<<e),this.strip()},BN.prototype.iadd=function iadd(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},BN.prototype.add=function add(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},BN.prototype.isub=function isub(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,s=0;s<e.length;s++)h=(i=(0|r.words[s])-(0|e.words[s])+h)>>26,this.words[s]=67108863&i;for(;0!==h&&s<r.length;s++)h=(i=(0|r.words[s])+h)>>26,this.words[s]=67108863&i;if(0===h&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},BN.prototype.sub=function sub(t){return this.clone().isub(t)};var s=function comb10MulTo(t,i,r){var e,n,h,s=t.words,o=i.words,u=r.words,a=0,l=0|s[0],m=8191&l,f=l>>>13,d=0|s[1],p=8191&d,M=d>>>13,v=0|s[2],g=8191&v,c=v>>>13,w=0|s[3],y=8191&w,B=w>>>13,N=0|s[4],b=8191&N,_=N>>>13,R=0|s[5],A=8191&R,k=R>>>13,x=0|s[6],S=8191&x,T=x>>>13,q=0|s[7],F=8191&q,P=q>>>13,Z=0|s[8],L=8191&Z,I=Z>>>13,z=0|s[9],K=8191&z,j=z>>>13,E=0|o[0],O=8191&E,H=E>>>13,D=0|o[1],C=8191&D,J=D>>>13,U=0|o[2],G=8191&U,Q=U>>>13,V=0|o[3],W=8191&V,X=V>>>13,Y=0|o[4],$=8191&Y,tt=Y>>>13,it=0|o[5],rt=8191&it,et=it>>>13,nt=0|o[6],ht=8191&nt,st=nt>>>13,ot=0|o[7],ut=8191&ot,at=ot>>>13,lt=0|o[8],mt=8191<,ft=lt>>>13,dt=0|o[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(e=Math.imul(m,O))|0)+((8191&(n=(n=Math.imul(m,H))+Math.imul(f,O)|0))<<13)|0;a=((h=Math.imul(f,H))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(p,O),n=(n=Math.imul(p,H))+Math.imul(M,O)|0,h=Math.imul(M,H);var gt=(a+(e=e+Math.imul(m,C)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,C)|0))<<13)|0;a=((h=h+Math.imul(f,J)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,e=Math.imul(g,O),n=(n=Math.imul(g,H))+Math.imul(c,O)|0,h=Math.imul(c,H),e=e+Math.imul(p,C)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,C)|0,h=h+Math.imul(M,J)|0;var ct=(a+(e=e+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;a=((h=h+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(y,O),n=(n=Math.imul(y,H))+Math.imul(B,O)|0,h=Math.imul(B,H),e=e+Math.imul(g,C)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,C)|0,h=h+Math.imul(c,J)|0,e=e+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,h=h+Math.imul(M,Q)|0;var wt=(a+(e=e+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(b,O),n=(n=Math.imul(b,H))+Math.imul(_,O)|0,h=Math.imul(_,H),e=e+Math.imul(y,C)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(B,C)|0,h=h+Math.imul(B,J)|0,e=e+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,h=h+Math.imul(c,Q)|0,e=e+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,h=h+Math.imul(M,X)|0;var yt=(a+(e=e+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(A,O),n=(n=Math.imul(A,H))+Math.imul(k,O)|0,h=Math.imul(k,H),e=e+Math.imul(b,C)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(_,C)|0,h=h+Math.imul(_,J)|0,e=e+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(B,G)|0,h=h+Math.imul(B,Q)|0,e=e+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,h=h+Math.imul(c,X)|0,e=e+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,h=h+Math.imul(M,tt)|0;var Bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,e=Math.imul(S,O),n=(n=Math.imul(S,H))+Math.imul(T,O)|0,h=Math.imul(T,H),e=e+Math.imul(A,C)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(k,C)|0,h=h+Math.imul(k,J)|0,e=e+Math.imul(b,G)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(_,G)|0,h=h+Math.imul(_,Q)|0,e=e+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(B,W)|0,h=h+Math.imul(B,X)|0,e=e+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,h=h+Math.imul(c,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(M,rt)|0,h=h+Math.imul(M,et)|0;var Nt=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,st)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(F,O),n=(n=Math.imul(F,H))+Math.imul(P,O)|0,h=Math.imul(P,H),e=e+Math.imul(S,C)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(T,C)|0,h=h+Math.imul(T,J)|0,e=e+Math.imul(A,G)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(k,G)|0,h=h+Math.imul(k,Q)|0,e=e+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(_,W)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(B,$)|0,h=h+Math.imul(B,tt)|0,e=e+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,et)|0)+Math.imul(c,rt)|0,h=h+Math.imul(c,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(M,ht)|0,h=h+Math.imul(M,st)|0;var bt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(L,O),n=(n=Math.imul(L,H))+Math.imul(I,O)|0,h=Math.imul(I,H),e=e+Math.imul(F,C)|0,n=(n=n+Math.imul(F,J)|0)+Math.imul(P,C)|0,h=h+Math.imul(P,J)|0,e=e+Math.imul(S,G)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(T,G)|0,h=h+Math.imul(T,Q)|0,e=e+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(k,W)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(_,$)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(B,rt)|0,h=h+Math.imul(B,et)|0,e=e+Math.imul(g,ht)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(c,ht)|0,h=h+Math.imul(c,st)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,h=h+Math.imul(M,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(K,O),n=(n=Math.imul(K,H))+Math.imul(j,O)|0,h=Math.imul(j,H),e=e+Math.imul(L,C)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(I,C)|0,h=h+Math.imul(I,J)|0,e=e+Math.imul(F,G)|0,n=(n=n+Math.imul(F,Q)|0)+Math.imul(P,G)|0,h=h+Math.imul(P,Q)|0,e=e+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(T,W)|0,h=h+Math.imul(T,X)|0,e=e+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(k,$)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(B,ht)|0,h=h+Math.imul(B,st)|0,e=e+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,h=h+Math.imul(c,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,h=h+Math.imul(M,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(K,C),n=(n=Math.imul(K,J))+Math.imul(j,C)|0,h=Math.imul(j,J),e=e+Math.imul(L,G)|0,n=(n=n+Math.imul(L,Q)|0)+Math.imul(I,G)|0,h=h+Math.imul(I,Q)|0,e=e+Math.imul(F,W)|0,n=(n=n+Math.imul(F,X)|0)+Math.imul(P,W)|0,h=h+Math.imul(P,X)|0,e=e+Math.imul(S,$)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(T,$)|0,h=h+Math.imul(T,tt)|0,e=e+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(b,ht)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,st)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(B,ut)|0,h=h+Math.imul(B,at)|0,e=e+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,h=h+Math.imul(c,ft)|0;var At=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((h=h+Math.imul(M,Mt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(K,G),n=(n=Math.imul(K,Q))+Math.imul(j,G)|0,h=Math.imul(j,Q),e=e+Math.imul(L,W)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(I,W)|0,h=h+Math.imul(I,X)|0,e=e+Math.imul(F,$)|0,n=(n=n+Math.imul(F,tt)|0)+Math.imul(P,$)|0,h=h+Math.imul(P,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(T,rt)|0,h=h+Math.imul(T,et)|0,e=e+Math.imul(A,ht)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,st)|0,e=e+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(B,mt)|0,h=h+Math.imul(B,ft)|0;var kt=(a+(e=e+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((h=h+Math.imul(c,Mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,e=Math.imul(K,W),n=(n=Math.imul(K,X))+Math.imul(j,W)|0,h=Math.imul(j,X),e=e+Math.imul(L,$)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(I,$)|0,h=h+Math.imul(I,tt)|0,e=e+Math.imul(F,rt)|0,n=(n=n+Math.imul(F,et)|0)+Math.imul(P,rt)|0,h=h+Math.imul(P,et)|0,e=e+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(T,ht)|0,h=h+Math.imul(T,st)|0,e=e+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(b,mt)|0,n=(n=n+Math.imul(b,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var xt=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((h=h+Math.imul(B,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,e=Math.imul(K,$),n=(n=Math.imul(K,tt))+Math.imul(j,$)|0,h=Math.imul(j,tt),e=e+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(I,rt)|0,h=h+Math.imul(I,et)|0,e=e+Math.imul(F,ht)|0,n=(n=n+Math.imul(F,st)|0)+Math.imul(P,ht)|0,h=h+Math.imul(P,st)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(T,ut)|0,h=h+Math.imul(T,at)|0,e=e+Math.imul(A,mt)|0,n=(n=n+Math.imul(A,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var St=(a+(e=e+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,Mt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(K,rt),n=(n=Math.imul(K,et))+Math.imul(j,rt)|0,h=Math.imul(j,et),e=e+Math.imul(L,ht)|0,n=(n=n+Math.imul(L,st)|0)+Math.imul(I,ht)|0,h=h+Math.imul(I,st)|0,e=e+Math.imul(F,ut)|0,n=(n=n+Math.imul(F,at)|0)+Math.imul(P,ut)|0,h=h+Math.imul(P,at)|0,e=e+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(T,mt)|0,h=h+Math.imul(T,ft)|0;var Tt=(a+(e=e+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,Mt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,Mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(K,ht),n=(n=Math.imul(K,st))+Math.imul(j,ht)|0,h=Math.imul(j,st),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(I,ut)|0,h=h+Math.imul(I,at)|0,e=e+Math.imul(F,mt)|0,n=(n=n+Math.imul(F,ft)|0)+Math.imul(P,mt)|0,h=h+Math.imul(P,ft)|0;var qt=(a+(e=e+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((h=h+Math.imul(T,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,e=Math.imul(K,ut),n=(n=Math.imul(K,at))+Math.imul(j,ut)|0,h=Math.imul(j,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(I,mt)|0,h=h+Math.imul(I,ft)|0;var Ft=(a+(e=e+Math.imul(F,pt)|0)|0)+((8191&(n=(n=n+Math.imul(F,Mt)|0)+Math.imul(P,pt)|0))<<13)|0;a=((h=h+Math.imul(P,Mt)|0)+(n>>>13)|0)+(Ft>>>26)|0,Ft&=67108863,e=Math.imul(K,mt),n=(n=Math.imul(K,ft))+Math.imul(j,mt)|0,h=Math.imul(j,ft);var Pt=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(I,pt)|0))<<13)|0;a=((h=h+Math.imul(I,Mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Zt=(a+(e=Math.imul(K,pt))|0)+((8191&(n=(n=Math.imul(K,Mt))+Math.imul(j,pt)|0))<<13)|0;return a=((h=Math.imul(j,Mt))+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=Bt,u[6]=Nt,u[7]=bt,u[8]=_t,u[9]=Rt,u[10]=At,u[11]=kt,u[12]=xt,u[13]=St,u[14]=Tt,u[15]=qt,u[16]=Ft,u[17]=Pt,u[18]=Zt,0!==a&&(u[19]=a,r.length++),r};function jumboMulTo(t,i,r){return(new FFTM).mulp(t,i,r)}function FFTM(t,i){this.x=t,this.y=i}Math.imul||(s=smallMulTo),BN.prototype.mulTo=function mulTo(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?s(this,t,i):r<63?smallMulTo(this,t,i):r<1024?function bigMulTo(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var s=n;n=0;for(var o=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;o=67108863&(f=f+o|0),n+=(s=(s=s+(m/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[h]=o,e=s,s=n}return 0!==e?r.words[h]=e:r.length--,r.strip()}(this,t,i):jumboMulTo(this,t,i)},FFTM.prototype.makeRBT=function makeRBT(t){for(var i=new Array(t),r=BN.prototype._countBits(t)-1,e=0;e<t;e++)i[e]=this.revBin(e,r,t);return i},FFTM.prototype.revBin=function revBin(t,i,r){if(0===t||t===r-1)return t;for(var e=0,n=0;n<i;n++)e|=(1&t)<<i-n-1,t>>=1;return e},FFTM.prototype.permute=function permute(t,i,r,e,n,h){for(var s=0;s<h;s++)e[s]=i[t[s]],n[s]=r[t[s]]},FFTM.prototype.transform=function transform(t,i,r,e,n,h){this.permute(h,t,i,r,e,n);for(var s=1;s<n;s<<=1)for(var o=s<<1,u=Math.cos(2*Math.PI/o),a=Math.sin(2*Math.PI/o),l=0;l<n;l+=o)for(var m=u,f=a,d=0;d<s;d++){var p=r[l+d],M=e[l+d],v=r[l+d+s],g=e[l+d+s],c=m*v-f*g;g=m*g+f*v,v=c,r[l+d]=p+v,e[l+d]=M+g,r[l+d+s]=p-v,e[l+d+s]=M-g,d!==o&&(c=u*m-a*f,f=u*f+a*m,m=c)}},FFTM.prototype.guessLen13b=function guessLen13b(t,i){var r=1|Math.max(i,t),e=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+e},FFTM.prototype.conjugate=function conjugate(t,i,r){if(!(r<=1))for(var e=0;e<r/2;e++){var n=t[e];t[e]=t[r-e-1],t[r-e-1]=n,n=i[e],i[e]=-i[r-e-1],i[r-e-1]=-n}},FFTM.prototype.normalize13b=function normalize13b(t,i){for(var r=0,e=0;e<i/2;e++){var n=8192*Math.round(t[2*e+1]/i)+Math.round(t[2*e]/i)+r;t[e]=67108863&n,r=n<67108864?0:n/67108864|0}return t},FFTM.prototype.convert13b=function convert13b(t,i,r,e){for(var n=0,h=0;h<i;h++)n+=0|t[h],r[2*h]=8191&n,n>>>=13,r[2*h+1]=8191&n,n>>>=13;for(h=2*i;h<e;++h)r[h]=0;assert(0===n),assert(0==(-8192&n))},FFTM.prototype.stub=function stub(t){for(var i=new Array(t),r=0;r<t;r++)i[r]=0;return i},FFTM.prototype.mulp=function mulp(t,i,r){var e=2*this.guessLen13b(t.length,i.length),n=this.makeRBT(e),h=this.stub(e),s=new Array(e),o=new Array(e),u=new Array(e),a=new Array(e),l=new Array(e),m=new Array(e),f=r.words;f.length=e,this.convert13b(t.words,t.length,s,e),this.convert13b(i.words,i.length,a,e),this.transform(s,h,o,u,e,n),this.transform(a,h,l,m,e,n);for(var d=0;d<e;d++){var p=o[d]*l[d]-u[d]*m[d];u[d]=o[d]*m[d]+u[d]*l[d],o[d]=p}return this.conjugate(o,u,e),this.transform(o,u,f,h,e,n),this.conjugate(f,h,e),this.normalize13b(f,e),r.negative=t.negative^i.negative,r.length=t.length+i.length,r.strip()},BN.prototype.mul=function mul(t){var i=new BN(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},BN.prototype.mulf=function mulf(t){var i=new BN(null);return i.words=new Array(this.length+t.length),jumboMulTo(this,t,i)},BN.prototype.imul=function imul(t){return this.clone().mulTo(t,this)},BN.prototype.imuln=function imuln(t){assert("number"==typeof t),assert(t<67108864);for(var i=0,r=0;r<this.length;r++){var e=(0|this.words[r])*t,n=(67108863&e)+(67108863&i);i>>=26,i+=e/67108864|0,i+=n>>>26,this.words[r]=67108863&n}return 0!==i&&(this.words[r]=i,this.length++),this},BN.prototype.muln=function muln(t){return this.clone().imuln(t)},BN.prototype.sqr=function sqr(){return this.mul(this)},BN.prototype.isqr=function isqr(){return this.imul(this.clone())},BN.prototype.pow=function pow(t){var i=function toBitArray(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=(t.words[e]&1<<n)>>>n}return i}(t);if(0===i.length)return new BN(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},BN.prototype.iushln=function iushln(t){assert("number"==typeof t&&t>=0);var i,r=t%26,e=(t-r)/26,n=67108863>>>26-r<<26-r;if(0!==r){var h=0;for(i=0;i<this.length;i++){var s=this.words[i]&n,o=(0|this.words[i])-s<<r;this.words[i]=o|h,h=s>>>26-r}h&&(this.words[i]=h,this.length++)}if(0!==e){for(i=this.length-1;i>=0;i--)this.words[i+e]=this.words[i];for(i=0;i<e;i++)this.words[i]=0;this.length+=e}return this.strip()},BN.prototype.ishln=function ishln(t){return assert(0===this.negative),this.iushln(t)},BN.prototype.iushrn=function iushrn(t,i,r){var e;assert("number"==typeof t&&t>=0),e=i?(i-i%26)/26:0;var n=t%26,h=Math.min((t-n)/26,this.length),s=67108863^67108863>>>n<<n,o=r;if(e-=h,e=Math.max(0,e),o){for(var u=0;u<h;u++)o.words[u]=this.words[u];o.length=h}if(0===h);else if(this.length>h)for(this.length-=h,u=0;u<this.length;u++)this.words[u]=this.words[u+h];else this.words[0]=0,this.length=1;var a=0;for(u=this.length-1;u>=0&&(0!==a||u>=e);u--){var l=0|this.words[u];this.words[u]=a<<26-n|l>>>n,a=l&s}return o&&0!==a&&(o.words[o.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},BN.prototype.ishrn=function ishrn(t,i,r){return assert(0===this.negative),this.iushrn(t,i,r)},BN.prototype.shln=function shln(t){return this.clone().ishln(t)},BN.prototype.ushln=function ushln(t){return this.clone().iushln(t)},BN.prototype.shrn=function shrn(t){return this.clone().ishrn(t)},BN.prototype.ushrn=function ushrn(t){return this.clone().iushrn(t)},BN.prototype.testn=function testn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,e=1<<i;return!(this.length<=r)&&!!(this.words[r]&e)},BN.prototype.imaskn=function imaskn(t){assert("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(assert(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var e=67108863^67108863>>>i<<i;this.words[this.length-1]&=e}return this.strip()},BN.prototype.maskn=function maskn(t){return this.clone().imaskn(t)},BN.prototype.iaddn=function iaddn(t){return assert("number"==typeof t),assert(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},BN.prototype._iaddn=function _iaddn(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},BN.prototype.isubn=function isubn(t){if(assert("number"==typeof t),assert(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this.strip()},BN.prototype.addn=function addn(t){return this.clone().iaddn(t)},BN.prototype.subn=function subn(t){return this.clone().isubn(t)},BN.prototype.iabs=function iabs(){return this.negative=0,this},BN.prototype.abs=function abs(){return this.clone().iabs()},BN.prototype._ishlnsubmul=function _ishlnsubmul(t,i,r){var e,n,h=t.length+r;this._expand(h);var s=0;for(e=0;e<t.length;e++){n=(0|this.words[e+r])+s;var o=(0|t.words[e])*i;s=((n-=67108863&o)>>26)-(o/67108864|0),this.words[e+r]=67108863&n}for(;e<this.length-r;e++)s=(n=(0|this.words[e+r])+s)>>26,this.words[e+r]=67108863&n;if(0===s)return this.strip();for(assert(-1===s),s=0,e=0;e<this.length;e++)s=(n=-(0|this.words[e])+s)>>26,this.words[e]=67108863&n;return this.negative=1,this.strip()},BN.prototype._wordDiv=function _wordDiv(t,i){var r=(this.length,t.length),e=this.clone(),n=t,h=0|n.words[n.length-1];0!==(r=26-this._countBits(h))&&(n=n.ushln(r),e.iushln(r),h=0|n.words[n.length-1]);var s,o=e.length-n.length;if("mod"!==i){(s=new BN(null)).length=o+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var a=e.clone()._ishlnsubmul(n,1,o);0===a.negative&&(e=a,s&&(s.words[o]=1));for(var l=o-1;l>=0;l--){var m=67108864*(0|e.words[n.length+l])+(0|e.words[n.length+l-1]);for(m=Math.min(m/h|0,67108863),e._ishlnsubmul(n,m,l);0!==e.negative;)m--,e.negative=0,e._ishlnsubmul(n,1,l),e.isZero()||(e.negative^=1);s&&(s.words[l]=m)}return s&&s.strip(),e.strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},BN.prototype.divmod=function divmod(t,i,r){return assert(!t.isZero()),this.isZero()?{div:new BN(0),mod:new BN(0)}:0!==this.negative&&0===t.negative?(h=this.neg().divmod(t,i),"mod"!==i&&(e=h.div.neg()),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.iadd(t)),{div:e,mod:n}):0===this.negative&&0!==t.negative?(h=this.divmod(t.neg(),i),"mod"!==i&&(e=h.div.neg()),{div:e,mod:h.mod}):0!=(this.negative&t.negative)?(h=this.neg().divmod(t.neg(),i),"div"!==i&&(n=h.mod.neg(),r&&0!==n.negative&&n.isub(t)),{div:h.div,mod:n}):t.length>this.length||this.cmp(t)<0?{div:new BN(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new BN(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new BN(this.modn(t.words[0]))}:this._wordDiv(t,i);var e,n,h},BN.prototype.div=function div(t){return this.divmod(t,"div",!1).div},BN.prototype.mod=function mod(t){return this.divmod(t,"mod",!1).mod},BN.prototype.umod=function umod(t){return this.divmod(t,"mod",!0).mod},BN.prototype.divRound=function divRound(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},BN.prototype.modn=function modn(t){assert(t<=67108863);for(var i=(1<<26)%t,r=0,e=this.length-1;e>=0;e--)r=(i*r+(0|this.words[e]))%t;return r},BN.prototype.idivn=function idivn(t){assert(t<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var e=(0|this.words[r])+67108864*i;this.words[r]=e/t|0,i=e%t}return this.strip()},BN.prototype.divn=function divn(t){return this.clone().idivn(t)},BN.prototype.egcd=function egcd(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e=new BN(1),n=new BN(0),h=new BN(0),s=new BN(1),o=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++o;for(var u=r.clone(),a=i.clone();!i.isZero();){for(var l=0,m=1;0==(i.words[0]&m)&&l<26;++l,m<<=1);if(l>0)for(i.iushrn(l);l-- >0;)(e.isOdd()||n.isOdd())&&(e.iadd(u),n.isub(a)),e.iushrn(1),n.iushrn(1);for(var f=0,d=1;0==(r.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(h.isOdd()||s.isOdd())&&(h.iadd(u),s.isub(a)),h.iushrn(1),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),e.isub(h),n.isub(s)):(r.isub(i),h.isub(e),s.isub(n))}return{a:h,b:s,gcd:r.iushln(o)}},BN.prototype._invmp=function _invmp(t){assert(0===t.negative),assert(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var e,n=new BN(1),h=new BN(0),s=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var o=0,u=1;0==(i.words[0]&u)&&o<26;++o,u<<=1);if(o>0)for(i.iushrn(o);o-- >0;)n.isOdd()&&n.iadd(s),n.iushrn(1);for(var a=0,l=1;0==(r.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(r.iushrn(a);a-- >0;)h.isOdd()&&h.iadd(s),h.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(h)):(r.isub(i),h.isub(n))}return(e=0===i.cmpn(1)?n:h).cmpn(0)<0&&e.iadd(t),e},BN.prototype.gcd=function gcd(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},BN.prototype.invm=function invm(t){return this.egcd(t).a.umod(t)},BN.prototype.isEven=function isEven(){return 0==(1&this.words[0])},BN.prototype.isOdd=function isOdd(){return 1==(1&this.words[0])},BN.prototype.andln=function andln(t){return this.words[0]&t},BN.prototype.bincn=function bincn(t){assert("number"==typeof t);var i=t%26,r=(t-i)/26,e=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=e,this;for(var n=e,h=r;0!==n&&h<this.length;h++){var s=0|this.words[h];n=(s+=n)>>>26,s&=67108863,this.words[h]=s}return 0!==n&&(this.words[h]=n,this.length++),this},BN.prototype.isZero=function isZero(){return 1===this.length&&0===this.words[0]},BN.prototype.cmpn=function cmpn(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)i=1;else{r&&(t=-t),assert(t<=67108863,"Number is too big");var e=0|this.words[0];i=e===t?0:e<t?-1:1}return 0!==this.negative?0|-i:i},BN.prototype.cmp=function cmp(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},BN.prototype.ucmp=function ucmp(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},BN.prototype.gtn=function gtn(t){return 1===this.cmpn(t)},BN.prototype.gt=function gt(t){return 1===this.cmp(t)},BN.prototype.gten=function gten(t){return this.cmpn(t)>=0},BN.prototype.gte=function gte(t){return this.cmp(t)>=0},BN.prototype.ltn=function ltn(t){return-1===this.cmpn(t)},BN.prototype.lt=function lt(t){return-1===this.cmp(t)},BN.prototype.lten=function lten(t){return this.cmpn(t)<=0},BN.prototype.lte=function lte(t){return this.cmp(t)<=0},BN.prototype.eqn=function eqn(t){return 0===this.cmpn(t)},BN.prototype.eq=function eq(t){return 0===this.cmp(t)},BN.red=function red(t){return new Red(t)},BN.prototype.toRed=function toRed(t){return assert(!this.red,"Already a number in reduction context"),assert(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},BN.prototype.fromRed=function fromRed(){return assert(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},BN.prototype._forceRed=function _forceRed(t){return this.red=t,this},BN.prototype.forceRed=function forceRed(t){return assert(!this.red,"Already a number in reduction context"),this._forceRed(t)},BN.prototype.redAdd=function redAdd(t){return assert(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},BN.prototype.redIAdd=function redIAdd(t){return assert(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},BN.prototype.redSub=function redSub(t){return assert(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},BN.prototype.redISub=function redISub(t){return assert(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},BN.prototype.redShl=function redShl(t){return assert(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},BN.prototype.redMul=function redMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},BN.prototype.redIMul=function redIMul(t){return assert(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},BN.prototype.redSqr=function redSqr(){return assert(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},BN.prototype.redISqr=function redISqr(){return assert(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},BN.prototype.redSqrt=function redSqrt(){return assert(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},BN.prototype.redInvm=function redInvm(){return assert(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},BN.prototype.redNeg=function redNeg(){return assert(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},BN.prototype.redPow=function redPow(t){return assert(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var o={k256:null,p224:null,p192:null,p25519:null};function MPrime(t,i){this.name=t,this.p=new BN(i,16),this.n=this.p.bitLength(),this.k=new BN(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function Red(t){if("string"==typeof t){var i=BN._prime(t);this.m=i.p,this.prime=i}else assert(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function Mont(t){Red.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new BN(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}MPrime.prototype._tmp=function _tmp(){var t=new BN(null);return t.words=new Array(Math.ceil(this.n/13)),t},MPrime.prototype.ireduce=function ireduce(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):r.strip(),r},MPrime.prototype.split=function split(t,i){t.iushrn(this.n,0,i)},MPrime.prototype.imulK=function imulK(t){return t.imul(this.k)},inherits(K256,MPrime),K256.prototype.split=function split(t,i){for(var r=Math.min(t.length,9),e=0;e<r;e++)i.words[e]=t.words[e];if(i.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(i.words[i.length++]=4194303&n,e=10;e<t.length;e++){var h=0|t.words[e];t.words[e-10]=(4194303&h)<<4|n>>>22,n=h}n>>>=22,t.words[e-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},K256.prototype.imulK=function imulK(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},inherits(P224,MPrime),inherits(P192,MPrime),inherits(P25519,MPrime),P25519.prototype.imulK=function imulK(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},BN._prime=function prime(t){if(o[t])return o[t];var prime;if("k256"===t)prime=new K256;else if("p224"===t)prime=new P224;else if("p192"===t)prime=new P192;else{if("p25519"!==t)throw new Error("Unknown prime "+t);prime=new P25519}return o[t]=prime,prime},Red.prototype._verify1=function _verify1(t){assert(0===t.negative,"red works only with positives"),assert(t.red,"red works only with red numbers")},Red.prototype._verify2=function _verify2(t,i){assert(0==(t.negative|i.negative),"red works only with positives"),assert(t.red&&t.red===i.red,"red works only with red numbers")},Red.prototype.imod=function imod(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},Red.prototype.neg=function neg(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},Red.prototype.add=function add(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},Red.prototype.iadd=function iadd(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},Red.prototype.sub=function sub(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},Red.prototype.isub=function isub(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},Red.prototype.shl=function shl(t,i){return this._verify1(t),this.imod(t.ushln(i))},Red.prototype.imul=function imul(t,i){return this._verify2(t,i),this.imod(t.imul(i))},Red.prototype.mul=function mul(t,i){return this._verify2(t,i),this.imod(t.mul(i))},Red.prototype.isqr=function isqr(t){return this.imul(t,t.clone())},Red.prototype.sqr=function sqr(t){return this.mul(t,t)},Red.prototype.sqrt=function sqrt(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(assert(i%2==1),3===i){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(t,r)}for(var e=this.m.subn(1),n=0;!e.isZero()&&0===e.andln(1);)n++,e.iushrn(1);assert(!e.isZero());var h=new BN(1).toRed(this),s=h.redNeg(),o=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new BN(2*u*u).toRed(this);0!==this.pow(u,o).cmp(s);)u.redIAdd(s);for(var a=this.pow(u,e),l=this.pow(t,e.addn(1).iushrn(1)),m=this.pow(t,e),f=n;0!==m.cmp(h);){for(var d=m,p=0;0!==d.cmp(h);p++)d=d.redSqr();assert(p<f);var M=this.pow(a,new BN(1).iushln(f-p-1));l=l.redMul(M),a=M.redSqr(),m=m.redMul(a),f=p}return l},Red.prototype.invm=function invm(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},Red.prototype.pow=function pow(t,i){if(i.isZero())return new BN(1);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new BN(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],h=0,s=0,o=i.bitLength()%26;for(0===o&&(o=26),e=i.length-1;e>=0;e--){for(var u=i.words[e],a=o-1;a>=0;a--){var l=u>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==l||0!==h?(h<<=1,h|=l,(4===++s||0===e&&0===a)&&(n=this.mul(n,r[h]),s=0,h=0)):s=0}o=26}return n},Red.prototype.convertTo=function convertTo(t){var i=t.umod(this.m);return i===t?i.clone():i},Red.prototype.convertFrom=function convertFrom(t){var i=t.clone();return i.red=null,i},BN.mont=function mont(t){return new Mont(t)},inherits(Mont,Red),Mont.prototype.convertTo=function convertTo(t){return this.imod(t.ushln(this.shift))},Mont.prototype.convertFrom=function convertFrom(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},Mont.prototype.imul=function imul(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.mul=function mul(t,i){if(t.isZero()||i.isZero())return new BN(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},Mont.prototype.invm=function invm(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}("undefined"==typeof module||module,this); | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/number-to-bn/src/index.js":[function(require,module,exports){ | |
var BN=require("bn.js"),stripHexPrefix=require("strip-hex-prefix");module.exports=function numberToBN(e){if("string"==typeof e||"number"==typeof e){var r=new BN(1),t=String(e).toLowerCase().trim(),i="0x"===t.substr(0,2)||"-0x"===t.substr(0,3),n=stripHexPrefix(t);if("-"===n.substr(0,1)&&(n=stripHexPrefix(n.slice(1)),r=new BN(-1,10)),!(n=""===n?"0":n).match(/^-?[0-9]+$/)&&n.match(/^[0-9A-Fa-f]+$/)||n.match(/^[a-fA-F]+$/)||!0===i&&n.match(/^[0-9A-Fa-f]+$/))return new BN(n,16).mul(r);if((n.match(/^-?[0-9]+$/)||""===n)&&!1===i)return new BN(n,10).mul(r)}else if("object"==typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new BN(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}; | |
},{"bn.js":"/Users/lentan/repo/torus/torus-embed/node_modules/number-to-bn/node_modules/bn.js/lib/bn.js","strip-hex-prefix":"/Users/lentan/repo/torus/torus-embed/node_modules/strip-hex-prefix/src/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/index.js":[function(require,module,exports){ | |
const{Duplex:Duplex}=require("readable-stream"),endOfStream=require("end-of-stream"),once=require("once"),noop=()=>{},IGNORE_SUBSTREAM={};class ObjectMultiplex extends Duplex{constructor(e={}){super(Object.assign({},e,{objectMode:!0})),this._substreams={}}createStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');const t=new Substream({parent:this,name:e});return this._substreams[e]=t,anyStreamEnd(this,e=>{t.destroy(e)}),t}ignoreStream(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error('ObjectMultiplex - Substream for name "${name}" already exists');this._substreams[e]=IGNORE_SUBSTREAM}_read(){}_write(e,t,r){const s=e.name,a=e.data;if(!s)return console.warn(`ObjectMultiplex - malformed chunk without name "${e}"`),r();const n=this._substreams[s];if(!n)return console.warn(`ObjectMultiplex - orphaned data for stream "${s}"`),r();n!==IGNORE_SUBSTREAM&&n.push(a),r()}}class Substream extends Duplex{constructor({parent:e,name:t}){super({objectMode:!0}),this._parent=e,this._name=t}_read(){}_write(e,t,r){this._parent.push({name:this._name,data:e}),r()}}function anyStreamEnd(e,t){const r=once(t);endOfStream(e,{readable:!1},r),endOfStream(e,{writable:!1},r)}module.exports=ObjectMultiplex; | |
},{"end-of-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/end-of-stream/index.js","once":"/Users/lentan/repo/torus/torus-embed/node_modules/once/once.js","readable-stream":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/readable-browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_duplex.js":[function(require,module,exports){ | |
"use strict";var pna=require("process-nextick-args"),objectKeys=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};module.exports=Duplex;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var Readable=require("./_stream_readable"),Writable=require("./_stream_writable");util.inherits(Duplex,Readable);for(var keys=objectKeys(Writable.prototype),v=0;v<keys.length;v++){var method=keys[v];Duplex.prototype[method]||(Duplex.prototype[method]=Writable.prototype[method])}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);Readable.call(this,e),Writable.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",onend)}function onend(){this.allowHalfOpen||this._writableState.ended||pna.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),Duplex.prototype._destroy=function(e,t){this.push(null),this.end(),pna.nextTick(t,e)}; | |
},{"./_stream_readable":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_readable.js","./_stream_writable":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_writable.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_passthrough.js":[function(require,module,exports){ | |
"use strict";module.exports=PassThrough;var Transform=require("./_stream_transform"),util=Object.create(require("core-util-is"));function PassThrough(r){if(!(this instanceof PassThrough))return new PassThrough(r);Transform.call(this,r)}util.inherits=require("inherits"),util.inherits(PassThrough,Transform),PassThrough.prototype._transform=function(r,s,t){t(null,r)}; | |
},{"./_stream_transform":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_transform.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_readable.js":[function(require,module,exports){ | |
(function (process,global){ | |
"use strict";var pna=require("process-nextick-args");module.exports=Readable;var Duplex,isArray=require("isarray");Readable.ReadableState=ReadableState;var EE=require("events").EventEmitter,EElistenerCount=function(e,t){return e.listeners(t).length},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var debugUtil=require("util"),debug=void 0;debug=debugUtil&&debugUtil.debuglog?debugUtil.debuglog("stream"):function(){};var StringDecoder,BufferList=require("./internal/streams/BufferList"),destroyImpl=require("./internal/streams/destroy");util.inherits(Readable,Stream);var kProxyEvents=["error","close","destroy","pause","resume"];function prependListener(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function ReadableState(e,t){e=e||{};var n=t instanceof(Duplex=Duplex||require("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,a=e.readableHighWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(a||0===a)?a:i,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new BufferList,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=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this.decoder=new StringDecoder(e.encoding),this.encoding=e.encoding)}function Readable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),Stream.call(this)}function readableAddChunk(e,t,n,r,a){var i,d=e._readableState;null===t?(d.reading=!1,onEofChunk(e,d)):(a||(i=chunkInvalid(d,t)),i?e.emit("error",i):d.objectMode||t&&t.length>0?("string"==typeof t||d.objectMode||Object.getPrototypeOf(t)===Buffer.prototype||(t=_uint8ArrayToBuffer(t)),r?d.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):addChunk(e,d,t,!0):d.ended?e.emit("error",new Error("stream.push() after EOF")):(d.reading=!1,d.decoder&&!n?(t=d.decoder.write(t),d.objectMode||0!==t.length?addChunk(e,d,t,!1):maybeReadMore(e,d)):addChunk(e,d,t,!1))):r||(d.reading=!1));return needMoreData(d)}function addChunk(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&emitReadable(e)),maybeReadMore(e,t)}function chunkInvalid(e,t){var n;return _isUint8Array(t)||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),Readable.prototype.destroy=destroyImpl.destroy,Readable.prototype._undestroy=destroyImpl.undestroy,Readable.prototype._destroy=function(e,t){this.push(null),t(e)},Readable.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=Buffer.from(e,t),t=""),n=!0),readableAddChunk(this,e,t,!1,n)},Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,!0,!1)},Readable.prototype.isPaused=function(){return!1===this._readableState.flowing},Readable.prototype.setEncoding=function(e){return StringDecoder||(StringDecoder=require("string_decoder/").StringDecoder),this._readableState.decoder=new StringDecoder(e),this._readableState.encoding=e,this};var MAX_HWM=8388608;function computeNewHighWaterMark(e){return e>=MAX_HWM?e=MAX_HWM:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function howMuchToRead(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=computeNewHighWaterMark(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function onEofChunk(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,emitReadable(e)}}function emitReadable(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(debug("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?pna.nextTick(emitReadable_,e):emitReadable_(e))}function emitReadable_(e){debug("emit readable"),e.emit("readable"),flow(e)}function maybeReadMore(e,t){t.readingMore||(t.readingMore=!0,pna.nextTick(maybeReadMore_,e,t))}function maybeReadMore_(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(debug("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function pipeOnDrain(e){return function(){var t=e._readableState;debug("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&EElistenerCount(e,"data")&&(t.flowing=!0,flow(e))}}function nReadingNextTick(e){debug("readable nexttick read 0"),e.read(0)}function resume(e,t){t.resumeScheduled||(t.resumeScheduled=!0,pna.nextTick(resume_,e,t))}function resume_(e,t){t.reading||(debug("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),flow(e),t.flowing&&!t.reading&&e.read(0)}function flow(e){var t=e._readableState;for(debug("flow",t.flowing);t.flowing&&null!==e.read(););}function fromList(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=fromListPartial(e,t.buffer,t.decoder),n);var n}function fromListPartial(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?copyFromBufferString(e,t):copyFromBuffer(e,t),r}function copyFromBufferString(e,t){var n=t.head,r=1,a=n.data;for(e-=a.length;n=n.next;){var i=n.data,d=e>i.length?i.length:e;if(d===i.length?a+=i:a+=i.slice(0,e),0===(e-=d)){d===i.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=i.slice(d));break}++r}return t.length-=r,a}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e),r=t.head,a=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var i=r.data,d=e>i.length?i.length:e;if(i.copy(n,n.length-e,0,d),0===(e-=d)){d===i.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=i.slice(d));break}++a}return t.length-=a,n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,pna.nextTick(endReadableNT,t,e))}function endReadableNT(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function indexOf(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}Readable.prototype.read=function(e){debug("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return debug("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?endReadable(this):emitReadable(this),null;if(0===(e=howMuchToRead(e,t))&&t.ended)return 0===t.length&&endReadable(this),null;var r,a=t.needReadable;return debug("need readable",a),(0===t.length||t.length-e<t.highWaterMark)&&debug("length less than watermark",a=!0),t.ended||t.reading?debug("reading or ended",a=!1):a&&(debug("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=howMuchToRead(n,t))),null===(r=e>0?fromList(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&endReadable(this)),null!==r&&this.emit("data",r),r},Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},Readable.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,debug("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?onend:unpipe;function onunpipe(t,a){debug("onunpipe"),t===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,function cleanup(){debug("cleanup"),e.removeListener("close",onclose),e.removeListener("finish",onfinish),e.removeListener("drain",i),e.removeListener("error",onerror),e.removeListener("unpipe",onunpipe),n.removeListener("end",onend),n.removeListener("end",unpipe),n.removeListener("data",ondata),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||i()}())}function onend(){debug("onend"),e.end()}r.endEmitted?pna.nextTick(a):n.once("end",a),e.on("unpipe",onunpipe);var i=pipeOnDrain(n);e.on("drain",i);var d=!1;var o=!1;function ondata(t){debug("ondata"),o=!1,!1!==e.write(t)||o||((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==indexOf(r.pipes,e))&&!d&&(debug("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,o=!0),n.pause())}function onerror(t){debug("onerror",t),unpipe(),e.removeListener("error",onerror),0===EElistenerCount(e,"error")&&e.emit("error",t)}function onclose(){e.removeListener("finish",onfinish),unpipe()}function onfinish(){debug("onfinish"),e.removeListener("close",onclose),unpipe()}function unpipe(){debug("unpipe"),n.unpipe(e)}return n.on("data",ondata),prependListener(e,"error",onerror),e.once("close",onclose),e.once("finish",onfinish),e.emit("pipe",n),r.flowing||(debug("pipe resume"),n.resume()),e},Readable.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<a;i++)r[i].emit("unpipe",this,n);return this}var d=indexOf(t.pipes,e);return-1===d?this:(t.pipes.splice(d,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n),this)},Readable.prototype.on=function(e,t){var n=Stream.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&emitReadable(this):pna.nextTick(nReadingNextTick,this))}return n},Readable.prototype.addListener=Readable.prototype.on,Readable.prototype.resume=function(){var e=this._readableState;return e.flowing||(debug("resume"),e.flowing=!0,resume(this,e)),this},Readable.prototype.pause=function(){return debug("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(debug("pause"),this._readableState.flowing=!1,this.emit("pause")),this},Readable.prototype.wrap=function(e){var t=this,n=this._readableState,r=!1;for(var a in e.on("end",function(){if(debug("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(a){(debug("wrapped data"),n.decoder&&(a=n.decoder.write(a)),n.objectMode&&null==a)||(n.objectMode||a&&a.length)&&(t.push(a)||(r=!0,e.pause()))}),e)void 0===this[a]&&"function"==typeof e[a]&&(this[a]=function(t){return function(){return e[t].apply(e,arguments)}}(a));for(var i=0;i<kProxyEvents.length;i++)e.on(kProxyEvents[i],this.emit.bind(this,kProxyEvents[i]));return this._read=function(t){debug("wrapped _read",t),r&&(r=!1,e.resume())},this},Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Readable._fromList=fromList; | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_duplex.js","./internal/streams/BufferList":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/BufferList.js","./internal/streams/destroy":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/destroy.js","./internal/streams/stream":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/stream-browser.js","_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","events":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","isarray":"/Users/lentan/repo/torus/torus-embed/node_modules/isarray/index.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/safe-buffer/index.js","string_decoder/":"/Users/lentan/repo/torus/torus-embed/node_modules/string_decoder/lib/string_decoder.js","util":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_transform.js":[function(require,module,exports){ | |
"use strict";module.exports=Transform;var Duplex=require("./_stream_duplex"),util=Object.create(require("core-util-is"));function afterTransform(r,t){var e=this._transformState;e.transforming=!1;var n=e.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));e.writechunk=null,e.writecb=null,null!=t&&this.push(t),n(r);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Transform(r){if(!(this instanceof Transform))return new Transform(r);Duplex.call(this,r),this._transformState={afterTransform:afterTransform.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,r&&("function"==typeof r.transform&&(this._transform=r.transform),"function"==typeof r.flush&&(this._flush=r.flush)),this.on("prefinish",prefinish)}function prefinish(){var r=this;"function"==typeof this._flush?this._flush(function(t,e){done(r,t,e)}):done(this,null,null)}function done(r,t,e){if(t)return r.emit("error",t);if(null!=e&&r.push(e),r._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(r._transformState.transforming)throw new Error("Calling transform done when still transforming");return r.push(null)}util.inherits=require("inherits"),util.inherits(Transform,Duplex),Transform.prototype.push=function(r,t){return this._transformState.needTransform=!1,Duplex.prototype.push.call(this,r,t)},Transform.prototype._transform=function(r,t,e){throw new Error("_transform() is not implemented")},Transform.prototype._write=function(r,t,e){var n=this._transformState;if(n.writecb=e,n.writechunk=r,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},Transform.prototype._read=function(r){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},Transform.prototype._destroy=function(r,t){var e=this;Duplex.prototype._destroy.call(this,r,function(r){t(r),e.emit("close")})}; | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_duplex.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_writable.js":[function(require,module,exports){ | |
(function (process,global,setImmediate){ | |
"use strict";var pna=require("process-nextick-args");function WriteReq(e,t,r){this.chunk=e,this.encoding=t,this.callback=r,this.next=null}function CorkedRequest(e){var t=this;this.next=null,this.entry=null,this.finish=function(){onCorkedFinish(t,e)}}module.exports=Writable;var Duplex,asyncWrite=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:pna.nextTick;Writable.WritableState=WritableState;var util=Object.create(require("core-util-is"));util.inherits=require("inherits");var internalUtil={deprecate:require("util-deprecate")},Stream=require("./internal/streams/stream"),Buffer=require("safe-buffer").Buffer,OurUint8Array=global.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return Buffer.from(e)}function _isUint8Array(e){return Buffer.isBuffer(e)||e instanceof OurUint8Array}var realHasInstance,destroyImpl=require("./internal/streams/destroy");function nop(){}function WritableState(e,t){Duplex=Duplex||require("./_stream_duplex"),e=e||{};var r=t instanceof Duplex;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,n=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(n||0===n)?n:o,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 a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){onwrite(t,e)},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 CorkedRequest(this)}function Writable(e){if(Duplex=Duplex||require("./_stream_duplex"),!(realHasInstance.call(Writable,this)||this instanceof Duplex))return new Writable(e);this._writableState=new WritableState(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),Stream.call(this)}function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r),pna.nextTick(t,r)}function validChunk(e,t,r,i){var n=!0,o=!1;return null===r?o=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),pna.nextTick(i,o),n=!1),n}function decodeChunk(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=Buffer.from(t,r)),t}function writeOrBuffer(e,t,r,i,n,o){if(!r){var a=decodeChunk(t,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var f=t.length<t.highWaterMark;if(f||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else doWrite(e,t,!1,s,i,n,o);return f}function doWrite(e,t,r,i,n,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(n,t.onwrite):e._write(n,o,t.onwrite),t.sync=!1}function onwriteError(e,t,r,i,n){--t.pendingcb,r?(pna.nextTick(n,i),pna.nextTick(finishMaybe,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(n(i),e._writableState.errorEmitted=!0,e.emit("error",i),finishMaybe(e,t))}function onwriteStateUpdate(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function onwrite(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if(onwriteStateUpdate(r),t)onwriteError(e,r,i,t,n);else{var o=needFinish(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||clearBuffer(e,r),i?asyncWrite(afterWrite,e,r,o,n):afterWrite(e,r,o,n)}}function afterWrite(e,t,r,i){r||onwriteDrain(e,t),t.pendingcb--,i(),finishMaybe(e,t)}function onwriteDrain(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function clearBuffer(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,n=new Array(i),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,doWrite(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new CorkedRequest(t),t.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,u=r.encoding,l=r.callback;if(doWrite(e,t,!1,t.objectMode?1:f.length,f,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function needFinish(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function callFinal(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),finishMaybe(e,t)})}function prefinish(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,pna.nextTick(callFinal,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function finishMaybe(e,t){var r=needFinish(t);return r&&(prefinish(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}function endWritable(e,t,r){t.ending=!0,finishMaybe(e,t),r&&(t.finished?pna.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function onCorkedFinish(e,t,r){var i=e.entry;for(e.entry=null;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}util.inherits(Writable,Stream),WritableState.prototype.getBuffer=function getBuffer(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(realHasInstance=Function.prototype[Symbol.hasInstance],Object.defineProperty(Writable,Symbol.hasInstance,{value:function(e){return!!realHasInstance.call(this,e)||this===Writable&&(e&&e._writableState instanceof WritableState)}})):realHasInstance=function(e){return e instanceof this},Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},Writable.prototype.write=function(e,t,r){var i=this._writableState,n=!1,o=!i.objectMode&&_isUint8Array(e);return o&&!Buffer.isBuffer(e)&&(e=_uint8ArrayToBuffer(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=nop),i.ended?writeAfterEnd(this,r):(o||validChunk(this,i,e,r))&&(i.pendingcb++,n=writeOrBuffer(this,i,o,e,t,r)),n},Writable.prototype.cork=function(){this._writableState.corked++},Writable.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||clearBuffer(this,e))},Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Writable.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,r){var i=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||endWritable(this,i,r)},Object.defineProperty(Writable.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),Writable.prototype.destroy=destroyImpl.destroy,Writable.prototype._undestroy=destroyImpl.undestroy,Writable.prototype._destroy=function(e,t){this.end(),t(e)}; | |
}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) | |
},{"./_stream_duplex":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_duplex.js","./internal/streams/destroy":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/destroy.js","./internal/streams/stream":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/stream-browser.js","_process":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/process/browser.js","core-util-is":"/Users/lentan/repo/torus/torus-embed/node_modules/core-util-is/lib/util.js","inherits":"/Users/lentan/repo/torus/torus-embed/node_modules/inherits/inherits_browser.js","process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js","safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/safe-buffer/index.js","timers":"/Users/lentan/repo/torus/torus-embed/node_modules/timers-browserify/main.js","util-deprecate":"/Users/lentan/repo/torus/torus-embed/node_modules/util-deprecate/browser.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/BufferList.js":[function(require,module,exports){ | |
"use strict";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var Buffer=require("safe-buffer").Buffer,util=require("util");function copyBuffer(t,e,i){t.copy(e,i)}module.exports=function(){function BufferList(){_classCallCheck(this,BufferList),this.head=null,this.tail=null,this.length=0}return BufferList.prototype.push=function push(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},BufferList.prototype.unshift=function unshift(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},BufferList.prototype.shift=function shift(){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}},BufferList.prototype.clear=function clear(){this.head=this.tail=null,this.length=0},BufferList.prototype.join=function join(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},BufferList.prototype.concat=function concat(t){if(0===this.length)return Buffer.alloc(0);if(1===this.length)return this.head.data;for(var e=Buffer.allocUnsafe(t>>>0),i=this.head,n=0;i;)copyBuffer(i.data,e,n),n+=i.data.length,i=i.next;return e},BufferList}(),util&&util.inspect&&util.inspect.custom&&(module.exports.prototype[util.inspect.custom]=function(){var t=util.inspect({length:this.length});return this.constructor.name+" "+t}); | |
},{"safe-buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/safe-buffer/index.js","util":"/Users/lentan/repo/torus/torus-embed/node_modules/browser-resolve/empty.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/destroy.js":[function(require,module,exports){ | |
"use strict";var pna=require("process-nextick-args");function destroy(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return a||i?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||pna.nextTick(emitErrorNT,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(pna.nextTick(emitErrorNT,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function undestroy(){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)}function emitErrorNT(t,e){t.emit("error",e)}module.exports={destroy:destroy,undestroy:undestroy}; | |
},{"process-nextick-args":"/Users/lentan/repo/torus/torus-embed/node_modules/process-nextick-args/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/internal/streams/stream-browser.js":[function(require,module,exports){ | |
module.exports=require("events").EventEmitter; | |
},{"events":"/Users/lentan/repo/torus/torus-embed/node_modules/browserify/node_modules/events/events.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/readable-browser.js":[function(require,module,exports){ | |
exports=module.exports=require("./lib/_stream_readable.js"),exports.Stream=exports,exports.Readable=exports,exports.Writable=require("./lib/_stream_writable.js"),exports.Duplex=require("./lib/_stream_duplex.js"),exports.Transform=require("./lib/_stream_transform.js"),exports.PassThrough=require("./lib/_stream_passthrough.js"); | |
},{"./lib/_stream_duplex.js":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_duplex.js","./lib/_stream_passthrough.js":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_passthrough.js","./lib/_stream_readable.js":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_readable.js","./lib/_stream_transform.js":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_transform.js","./lib/_stream_writable.js":"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/readable-stream/lib/_stream_writable.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/obj-multiplex/node_modules/safe-buffer/index.js":[function(require,module,exports){ | |
var buffer=require("buffer"),Buffer=buffer.Buffer;function copyProps(f,r){for(var e in f)r[e]=f[e]}function SafeBuffer(f,r,e){return Buffer(f,r,e)}Buffer.from&&Buffer.alloc&&Buffer.allocUnsafe&&Buffer.allocUnsafeSlow?module.exports=buffer:(copyProps(buffer,exports),exports.Buffer=SafeBuffer),copyProps(Buffer,SafeBuffer),SafeBuffer.from=function(f,r,e){if("number"==typeof f)throw new TypeError("Argument must not be a number");return Buffer(f,r,e)},SafeBuffer.alloc=function(f,r,e){if("number"!=typeof f)throw new TypeError("Argument must be a number");var u=Buffer(f);return void 0!==r?"string"==typeof e?u.fill(r,e):u.fill(r):u.fill(0),u},SafeBuffer.allocUnsafe=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return Buffer(f)},SafeBuffer.allocUnsafeSlow=function(f){if("number"!=typeof f)throw new TypeError("Argument must be a number");return buffer.SlowBuffer(f)}; | |
},{"buffer":"/Users/lentan/repo/torus/torus-embed/node_modules/buffer/index.js"}],"/Users/lentan/repo/torus/torus-embed/node_modules/oboe/dist/oboe-browser.js":[function(require,module,exports){ | |
!function(n,e,t,r,i,o){var u=varArgs(function(n,e){var t=e.length;return varArgs(function(r){for(var i=0;i<r.length;i++)e[t+i]=r[i];return e.length=t+r.length,n.apply(this,e)})});varArgs(function(n){var e=arrayAsList(n);function next(n,e){return[apply(n,e)]}return varArgs(function(n){return foldR(next,n,e)[0]})});function compose2(n,e){return function(){return n.call(this,e.apply(this,arguments))}}function attr(n){return function(e){return e[n]}}var a=varArgs(function(n){return varArgs(function(e){for(var t,r=0;r<c(n);r++)if(t=apply(e,n[r]))return t})});function apply(n,e){return e.apply(o,n)}function varArgs(n){var e=n.length-1,r=t.prototype.slice;if(0==e)return function(){return n.call(this,r.call(arguments))};if(1==e)return function(){return n.call(this,arguments[0],r.call(arguments,1))};var i=t(n.length);return function(){for(var t=0;t<e;t++)i[t]=arguments[t];return i[e]=r.call(arguments,e),n.apply(this,i)}}function lazyIntersection(n,e){return function(t){return n(t)&&e(t)}}function noop(){}function always(){return!0}function isOfType(n,e){return e&&e.constructor===n}var c=attr("length"),s=u(isOfType,String);function defined(n){return n!==o}function hasAllProperties(n,t){return t instanceof e&&function all(n,e){return!e||n(l(e))&&all(n,d(e))}(function(n){return n in t},n)}function cons(n,e){return[n,e]}var f=null,l=attr(0),d=attr(1);function arrayAsList(n){return reverseList(n.reduce(function flip(n){return function(e,t){return n(t,e)}}(cons),f))}var p=varArgs(arrayAsList);function listAsArray(n){return foldR(function(n,e){return n.unshift(e),n},[],n)}function map(n,e){return e?cons(n(l(e)),map(n,d(e))):f}function foldR(n,e,t){return t?n(foldR(n,e,d(t)),l(t)):e}function without(n,e,t){return function withoutInner(n,t){return n?e(l(n))?(t(l(n)),d(n)):cons(l(n),withoutInner(d(n),t)):f}(n,t||noop)}function reverseList(n){return function reverseInner(n,e){return n?reverseInner(d(n),cons(l(n),e)):e}(n,f)}function clarinet(n){"use strict";var e,t,i,u=n(q).emit,a=n(J).emit,c=n(X).emit,s=n(F).emit,f=65536,l=/[\\"\n]/g,d=0,p=d++,h=d++,v=d++,m=d++,y=d++,g=d++,b=d++,w=d++,A=d++,E=d++,I=d++,x=d++,C=d++,k=d++,L=d++,O=d++,S=d++,P=d++,R=d++,N=d++,T=20,M=f,B=o,j="",H=!1,U=!1,W=p,$=[],_=null,G=0,K=0,Q=0,V=0,Y=1;function emitError(n){B!==o&&(a(B),c(),B=o),e=r(n+"\nLn: "+Y+"\nCol: "+V+"\nChr: "+t),s(errorReport(o,o,e))}function whitespace(n){return"\r"==n||"\n"==n||" "==n||"\t"==n}n(z).on(function handleData(n){if(e)return;if(U)return emitError("Cannot write after close");var r=0;t=n[0];for(;t&&(r>0&&(i=t),t=n[r++]);)switch(Q++,"\n"==t?(Y++,V=0):V++,W){case p:if("{"===t)W=v;else if("["===t)W=y;else if(!whitespace(t))return emitError("Non-whitespace before {[.");continue;case w:case v:if(whitespace(t))continue;if(W===w)$.push(A);else{if("}"===t){a({}),c(),W=$.pop()||h;continue}$.push(m)}if('"'!==t)return emitError('Malformed object key should start with " ');W=b;continue;case A:case m:if(whitespace(t))continue;if(":"===t)W===m?($.push(m),B!==o&&(a({}),u(B),B=o),K++):B!==o&&(u(B),B=o),W=h;else if("}"===t)B!==o&&(a(B),c(),B=o),c(),K--,W=$.pop()||h;else{if(","!==t)return emitError("Bad object");W===m&&$.push(m),B!==o&&(a(B),c(),B=o),W=w}continue;case y:case h:if(whitespace(t))continue;if(W===y){if(a([]),K++,W=h,"]"===t){c(),K--,W=$.pop()||h;continue}$.push(g)}if('"'===t)W=b;else if("{"===t)W=v;else if("["===t)W=y;else if("t"===t)W=E;else if("f"===t)W=C;else if("n"===t)W=S;else if("-"===t)j+=t;else if("0"===t)j+=t,W=T;else{if(-1==="123456789".indexOf(t))return emitError("Bad value");j+=t,W=T}continue;case g:if(","===t)$.push(g),B!==o&&(a(B),c(),B=o),W=h;else{if("]"!==t){if(whitespace(t))continue;return emitError("Bad array")}B!==o&&(a(B),c(),B=o),c(),K--,W=$.pop()||h}continue;case b:B===o&&(B="");var s=r-1;n:for(;;){for(;G>0;)if(_+=t,t=n.charAt(r++),4===G?(B+=String.fromCharCode(parseInt(_,16)),G=0,s=r-1):G++,!t)break n;if('"'===t&&!H){W=$.pop()||h,B+=n.substring(s,r-1);break}if(!("\\"!==t||H||(H=!0,B+=n.substring(s,r-1),t=n.charAt(r++))))break;if(H){if(H=!1,"n"===t?B+="\n":"r"===t?B+="\r":"t"===t?B+="\t":"f"===t?B+="\f":"b"===t?B+="\b":"u"===t?(G=1,_=""):B+=t,t=n.charAt(r++),s=r-1,t)continue;break}l.lastIndex=r;var d=l.exec(n);if(!d){r=n.length+1,B+=n.substring(s,r-1);break}if(r=d.index+1,!(t=n.charAt(d.index))){B+=n.substring(s,r-1);break}}continue;case E:if(!t)continue;if("r"!==t)return emitError("Invalid true started with t"+t);W=I;continue;case I:if(!t)continue;if("u"!==t)return emitError("Invalid true started with tr"+t);W=x;continue;case x:if(!t)continue;if("e"!==t)return emitError("Invalid true started with tru"+t);a(!0),c(),W=$.pop()||h;continue;case C:if(!t)continue;if("a"!==t)return emitError("Invalid false started with f"+t);W=k;continue;case k:if(!t)continue;if("l"!==t)return emitError("Invalid false started with fa"+t);W=L;continue;case L:if(!t)continue;if("s"!==t)return emitError("Invalid false started with fal"+t);W=O;continue;case O:if(!t)continue;if("e"!==t)return emitError("Invalid false started with fals"+t);a(!1),c(),W=$.pop()||h;continue;case S:if(!t)continue;if("u"!==t)return emitError("Invalid null started with n"+t);W=P;continue;case P:if(!t)continue;if("l"!==t)return emitError("Invalid null started with nu"+t);W=R;continue;case R:if(!t)continue;if("l"!==t)return emitError("Invalid null started with nul"+t);a(null),c(),W=$.pop()||h;continue;case N:if("."!==t)return emitError("Leading zero not followed by .");j+=t,W=T;continue;case T:if(-1!=="0123456789".indexOf(t))j+=t;else if("."===t){if(-1!==j.indexOf("."))return emitError("Invalid number has two dots");j+=t}else if("e"===t||"E"===t){if(-1!==j.indexOf("e")||-1!==j.indexOf("E"))return emitError("Invalid number has two exponential");j+=t}else if("+"===t||"-"===t){if("e"!==i&&"E"!==i)return emitError("Invalid symbol in number");j+=t}else j&&(a(parseFloat(j)),c(),j=""),r--,W=$.pop()||h;continue;default:return emitError("Unknown state: "+W)}Q>=M&&function checkBufferLength(){var n=0;B!==o&&B.length>f&&(emitError("Max buffer length exceeded: textNode"),n=Math.max(n,B.length)),j.length>f&&(emitError("Max buffer length exceeded: numberNode"),n=Math.max(n,j.length)),M=f-n+Q}()}),n(D).on(function handleStreamEnd(){if(W==p)return a({}),c(),void(U=!0);W===h&&0===K||emitError("Unexpected end");B!==o&&(a(B),c(),B=o);U=!0})}var h,v,m,y,g,b,w,A,E,I,x,C=(h=varArgs(function(n){return n.unshift(/^/),function regexDescriptor(n){return n.exec.bind(n)}(RegExp(n.map(attr("source")).join("")))}),y=h(v=/(\$?)/,/([\w-_]+|\*)/,m=/(?:{([\w ]*?)})?/),g=h(v,/\["([^"]+)"\]/,m),b=h(v,/\[(\d+|\*)\]/,m),w=h(v,/()/,/{([\w ]*?)}/),A=h(/\.\./),E=h(/\./),I=h(v,/!/),x=h(/$/),function(n){return n(a(y,g,b,w),A,E,I,x)});function namedNode(n,e){return{key:n,node:e}}var k=attr("key"),L=attr("node"),O={};function incrementalContentBuilder(n){var e=n(R).emit,r=n(N).emit,i=n(j).emit,o=n(B).emit;function appendBuiltContent(n,e,t){L(l(n))[e]=t}function keyFound(n,t,r){n&&appendBuiltContent(n,t,r);var i=cons(namedNode(t,r),n);return e(i),i}var u={};return u[J]=function nodeOpened(n,e){if(!n)return i(e),keyFound(n,O,e);var r=function arrayIndicesAreKeys(n,e){var r=L(l(n));return isOfType(t,r)?keyFound(n,c(r),e):n}(n,e),o=d(r),u=k(l(r));return appendBuiltContent(o,u,e),cons(namedNode(u,e),o)},u[X]=function nodeClosed(n){return r(n),d(n)||o(L(l(n)))},u[q]=keyFound,u}var S=C(function(n,e,t,i,o){var s=1,f=2,h=3,v=compose2(k,l),m=compose2(L,l);function capture(n,e){return!!e[s]?lazyIntersection(n,l):n}function skip1(n){if(n==always)return always;return lazyIntersection(function notAtRoot(n){return v(n)!=O},compose2(n,d))}function rootExpr(){return function(n){return v(n)==O}}function generateClauseReaderIfTokenFound(n,e,t,r,i){var o=n(t);if(o){var u=function expressionsReader(n,e,t){return foldR(function(n,e){return e(n,t)},e,n)}(e,r,o);return i(t.substr(c(o[0])),u)}}function clauseMatcher(n,e){return u(generateClauseReaderIfTokenFound,n,e)}var y=a(clauseMatcher(n,p(capture,function duckTypeClause(n,e){var t=e[h];return t?lazyIntersection(compose2(u(hasAllProperties,arrayAsList(t.split(/\W+/))),m),n):n},function nameClause(n,e){var t=e[f];return lazyIntersection(t&&"*"!=t?function(n){return v(n)==t}:always,n)},skip1)),clauseMatcher(e,p(function skipMany(n){if(n==always)return always;var e=rootExpr(),t=n,r=skip1(function(n){return i(n)}),i=a(e,t,r);return i})),clauseMatcher(t,p()),clauseMatcher(i,p(capture,rootExpr)),clauseMatcher(o,p(function statementExpr(n){return function(e){var t=n(e);return!0===t?l(e):t}})),function(n){throw r('"'+n+'" could not be tokenised')});function returnFoundParser(n,e){return e}function compileJsonPathToFunction(n,e){return y(n,e,n?compileJsonPathToFunction:returnFoundParser)}return function(n){try{return compileJsonPathToFunction(n,always)}catch(e){throw r('Could not compile "'+n+'" because '+e.message)}}});function singleEventPubSub(n,e,t){var r,i;function hasId(n){return function(e){return e.id==n}}return{on:function(t,o){var u={listener:t,id:o||t};return e&&e.emit(n,t,u.id),r=cons(u,r),i=cons(t,i),this},emit:function(){!function applyEach(n,e){n&&(l(n).apply(null,e),applyEach(d(n),e))}(i,arguments)},un:function(e){var o;r=without(r,hasId(e),function(n){o=n}),o&&(i=without(i,function(n){return n==o.listener}),t&&t.emit(n,o.listener,o.id))},listeners:function(){return i},hasListener:function(n){return defined(function first(n,e){return e&&(n(l(e))?l(e):first(n,d(e)))}(n?hasId(n):always,r))}}}var P=1,R=P++,N=P++,T=P++,M=P++,F="fail",B=P++,j=P++,H="start",z="data",D="end",U=P++,q=P++,J=P++,X=P++;function errorReport(n,e,t){try{var r=i.parse(e)}catch(n){}return{statusCode:n,body:e,jsonBody:r,thrown:t}}function patternAdapter(n,e){var t={node:n(N),path:n(R)};function addUnderlyingListener(e,t,r){var i=n(e).emit;t.on(function(n){var e=r(n);!1!==e&&function emitMatchingNode(n,e,t){var r=reverseList(t);n(e,listAsArray(d(map(k,r))),listAsArray(map(L,r)))}(i,L(e),n)},e),n("removeListener").on(function(r){r==e&&(n(r).listeners()||t.un(e))})}n("newListener").on(function(n){var r=/(node|path):(.*)/.exec(n);if(r){var i=t[r[1]];i.hasListener(n)||addUnderlyingListener(n,i,e(r[2]))}})}function instanceApi(n,e){var t,i=/^(node|path):./,o=n(B),a=n(M).emit,c=n(T).emit,f=varArgs(function(e,r){if(t[e])apply(r,t[e]);else{var o=n(e),u=r[0];i.test(e)?addForgettableCallback(o,u):o.on(u)}return t});function addForgettableCallback(n,e,r){r=r||e;var i=protectedCallback(e);return n.on(function(){var e=!1;t.forget=function(){e=!0},apply(arguments,i),delete t.forget,e&&n.un(r)},r),t}function protectedCallback(n){return function(){try{return n.apply(t,arguments)}catch(n){setTimeout(function(){throw new r(n.message)})}}}function addSingleNodeOrPathListener(e,t,r){var i;i="node"==e?function wrapCallbackToSwapNodeIfSomethingReturned(n){return function(){var e=n.apply(this,arguments);defined(e)&&(e==oboe.drop?a():c(e))}}(r):r,addForgettableCallback(function fullyQualifiedPatternMatchEvent(e,t){return n(e+":"+t)}(e,t),i,r)}function addNodeOrPathListenerApi(n,e,r){return s(e)?addSingleNodeOrPathListener(n,e,r):function addMultipleNodeOrPathListeners(n,e){for(var t in e)addSingleNodeOrPathListener(n,t,e[t])}(n,e),t}return n(j).on(function(n){t.root=function functor(n){return function(){return n}}(n)}),n(H).on(function(n,e){t.header=function(n){return n?e[n]:e}}),t={on:f,addListener:f,removeListener:function(e,r,i){if("done"==e)o.un(r);else if("node"==e||"path"==e)n.un(e+":"+r,i);else{var u=r;n(e).un(u)}return t},emit:n.emit,node:u(addNodeOrPathListenerApi,"node"),path:u(addNodeOrPathListenerApi,"path"),done:u(addForgettableCallback,o),start:u(function addProtectedCallback(e,r){return n(e).on(protectedCallback(r),r),t},H),fail:n(F).on,abort:n(U).emit,header:noop,root:noop,source:e}}function wire(e,t,r,i,a){var s=function pubSub(){var n={},e=newSingle("newListener"),t=newSingle("removeListener");function newSingle(r){return n[r]=singleEventPubSub(r,e,t)}function pubSubInstance(e){return n[e]||newSingle(e)}return["emit","on","un"].forEach(function(n){pubSubInstance[n]=varArgs(function(e,t){apply(t,pubSubInstance(e)[n])})}),pubSubInstance}();return t&&function streamingHttp(e,t,r,i,a,s,f){"use strict";var l=e(z).emit,d=e(F).emit,p=0,h=!0;function handleProgress(){var n=t.responseText,e=n.substr(p);e&&l(e),p=c(n)}e(U).on(function(){t.onreadystatechange=null,t.abort()}),"onprogress"in t&&(t.onprogress=handleProgress),t.onreadystatechange=function(){function sendStartIfNotAlready(){try{h&&e(H).emit(t.status,function parseResponseHeaders(n){var e={};return n&&n.split("\r\n").forEach(function(n){var t=n.indexOf(": ");e[n.substring(0,t)]=n.substring(t+2)}),e}(t.getAllResponseHeaders())),h=!1}catch(n){}}switch(t.readyState){case 2:case 3:return sendStartIfNotAlready();case 4:sendStartIfNotAlready(),2==String(t.status)[0]?(handleProgress(),e(D).emit()):d(errorReport(t.status,t.responseText))}};try{for(var v in t.open(r,i,!0),s)t.setRequestHeader(v,s[v]);(function isCrossOrigin(n,e){function portOf(e){return e.port||function defaultPort(n){return{"http:":80,"https:":443}[n]}(e.protocol||n.protocol)}return!!(e.protocol&&e.protocol!=n.protocol||e.host&&e.host!=n.host||e.host&&portOf(e)!=portOf(n))})(n.location,function parseUrlOrigin(n){var e=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(n)||[];return{protocol:e[1]||"",host:e[2]||"",port:e[3]||""}}(i))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=f,t.send(a)}catch(e){n.setTimeout(u(d,errorReport(o,o,e)),0)}}(s,function httpTransport(){return new XMLHttpRequest}(),e,t,r,i,a),clarinet(s),function ascentManager(n,e){"use strict";var t,r={};function stateAfter(n){return function(e){t=n(t,e)}}for(var i in e)n(i).on(stateAfter(e[i]),r);n(T).on(function(n){var e=l(t),r=k(e),i=d(t);i&&(L(l(i))[r]=n)}),n(M).on(function(){var n=l(t),e=k(n),r=d(t);r&&delete L(l(r))[e]}),n(U).on(function(){for(var t in e)n(t).un(r)})}(s,incrementalContentBuilder(s)),patternAdapter(s,S),instanceApi(s,t)}function applyDefaults(n,e,t,r,o,u,a){return o=o?i.parse(i.stringify(o)):{},r?(s(r)||(r=i.stringify(r),o["Content-Type"]=o["Content-Type"]||"application/json"),o["Content-Length"]=o["Content-Length"]||r.length):r=null,n(t||"GET",function modifiedUrl(n,e){return!1===e&&(-1==n.indexOf("?")?n+="?":n+="&",n+="_="+(new Date).getTime()),n}(e,a),r,o,u||!1)}function oboe(n){var e=p("resume","pause","pipe"),t=u(hasAllProperties,e);return n?t(n)||s(n)?applyDefaults(wire,n):applyDefaults(wire,n.url,n.method,n.body,n.headers,n.withCredentials,n.cached):wire()}oboe.drop=function(){return oboe.drop},"function"==typeof define&&define.amd?define("oboe",[],function(){return oboe}):"object"==typeof exports?module.exports=oboe:n.oboe=oboe}(function(){try{return window}catch(n){return self}}(),Object,Array,Error,JSON); | |
},{}],"/Users/lentan/repo/torus/torus-embed/node_modules/obs-store/index.js":[function(require,module,exports){ | |
"use strict";const extend=require("xtend"),SafeEventEmitter=require("safe-event-emitter");class ObservableStore extends SafeEventEmitter{constructor(t={}){super(),this._state=t}getState(){return this._getState()}putState(t){this._putState(t),this.emit("update",t)}updateState(t){if(t&&"object"==typeof t){const e=this.getState(),s=Object.assign({},e,t);this.putState(s)}else this.putState(t)}subscribe(t){this.on("update",t)}unsubscribe(t){this.removeListener("update",t)}_getState(){return this._state}_putState(t){this._state=t}}module.exports=ObservableStore; | |
},{"safe-event-emitter":"/Users/lentan/repo/torus/torus-embed/node_modules/safe-event-emitter/index.js","xtend":"/Users/lentan/repo/torus/torus-embed/node_modules/xtend/immutable.js"}],"/Users/lentan/rep |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment