astra-modal-test 1.0.10 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +206 -134
- package/dist/{SwapController-DyormRqe.js → SwapController-mYFErPzx.js} +1 -1
- package/dist/{add-C1zIRxeS.js → add-CXtFvysR.js} +1 -1
- package/dist/{all-wallets-5a2U9fLw.js → all-wallets-B9fFXw5x.js} +1 -1
- package/dist/{app-store-2IKrZeLe.js → app-store-BXf1yvR8.js} +1 -1
- package/dist/{apple-DH9ESSKX.js → apple-DtcOcX1n.js} +1 -1
- package/dist/{arrow-bottom-BxAPS43J.js → arrow-bottom-BXeLKqSV.js} +1 -1
- package/dist/{arrow-bottom-circle-Cy5Gjca4.js → arrow-bottom-circle-BVUU200N.js} +1 -1
- package/dist/{arrow-left-CBX7JaHB.js → arrow-left-LguJPyNR.js} +1 -1
- package/dist/{arrow-right-G72bt1-M.js → arrow-right-D9kKZzGG.js} +1 -1
- package/dist/{arrow-top-DCkQG0Dq.js → arrow-top-C5JcaCqz.js} +1 -1
- package/dist/{bank-FNxAUs8r.js → bank-DgbCzr0A.js} +1 -1
- package/dist/{bin-B-c2CIPW.js → bin-ykHym2bC.js} +1 -1
- package/dist/{bitcoin-jk4NLDu1.js → bitcoin-B8jzy_uV.js} +1 -1
- package/dist/{browser-D6w0J78l.js → browser-Bk8u8PAA.js} +1 -1
- package/dist/{card-BLWRKU-r.js → card-DcwQMUca.js} +1 -1
- package/dist/ccip-CwJvuExU.js +239 -0
- package/dist/{checkmark-C1pTfaGr.js → checkmark-D3aEYZ8B.js} +1 -1
- package/dist/{checkmark-bold-UzogCu8g.js → checkmark-bold-5H7N-CDG.js} +1 -1
- package/dist/{chevron-bottom-w_rMAO7x.js → chevron-bottom-BA3C4MR1.js} +1 -1
- package/dist/{chevron-left-DGNJGxiP.js → chevron-left-BX18UWKM.js} +1 -1
- package/dist/{chevron-right-VFQCvCyG.js → chevron-right-DG7ovxTe.js} +1 -1
- package/dist/{chevron-top-DVhFmsKp.js → chevron-top-DHfev7lV.js} +1 -1
- package/dist/{chrome-store-BkYX3All.js → chrome-store-BSVzpGdu.js} +1 -1
- package/dist/{circle-B1A3j4eP.js → circle-SYFB9f2-.js} +1 -1
- package/dist/{clock-BKr-VHDU.js → clock-Cygqlf1g.js} +1 -1
- package/dist/{close-BEacRQ8Q.js → close-B43cuuko.js} +1 -1
- package/dist/{coinPlaceholder-0ZwtMAHl.js → coinPlaceholder-BHdR6bKb.js} +1 -1
- package/dist/{compass-pulK-BFi.js → compass-7S6b6wyA.js} +1 -1
- package/dist/{copy-MWCQE0T4.js → copy-CT53bEwd.js} +1 -1
- package/dist/{cursor-transparent-Co_5p0du.js → cursor-transparent-LmjzjsFm.js} +1 -1
- package/dist/{cursor-C2GVfUuM.js → cursor-vtqRnrF7.js} +1 -1
- package/dist/{desktop-C91EoSqM.js → desktop-Doa7TQsq.js} +1 -1
- package/dist/{disconnect-BWg1-rml.js → disconnect-C5G6Ncu_.js} +1 -1
- package/dist/{discord-Bi0Bfa_e.js → discord-DX7Cl3Ko.js} +1 -1
- package/dist/{email-U2WCRPFh.js → email-CyHWh9wL.js} +1 -1
- package/dist/{embedded-wallet-B6P0kU9A.js → embedded-wallet-BZQImi7s.js} +8 -8
- package/dist/{ethereum-BeZyayQW.js → ethereum-Bwvtk5-_.js} +1 -1
- package/dist/{etherscan-BQTsufjv.js → etherscan-CyVRICvw.js} +1 -1
- package/dist/{exclamation-triangle-JT-YKNXX.js → exclamation-triangle-BDbPL3nL.js} +1 -1
- package/dist/{extension-TnYLHoFA.js → extension-Cx3t2k-R.js} +1 -1
- package/dist/{external-link-Dhgai9sc.js → external-link-DZCYpOZI.js} +1 -1
- package/dist/{facebook-C6XFGRDw.js → facebook-BEnPrhG3.js} +1 -1
- package/dist/{farcaster-CvYbxZQq.js → farcaster-DyBPLb_k.js} +1 -1
- package/dist/{filters-DwVRjAav.js → filters-CTwxivn_.js} +1 -1
- package/dist/{github-BVZSx-z9.js → github-kzQb61pT.js} +1 -1
- package/dist/{google-NbJiQLc5.js → google-DSC-rYNu.js} +1 -1
- package/dist/{help-circle-Cum2UOMJ.js → help-circle-C5XfimVx.js} +1 -1
- package/dist/{id-kRR6YgVc.js → id-B9fQOT4E.js} +1 -1
- package/dist/{image-BWUCRAmp.js → image-1CCj36XM.js} +1 -1
- package/dist/{index-RFYbqmu0.js → index-Bjik7E9u.js} +1 -1
- package/dist/{index-DQ5AZLMt.js → index-C1fgrzi0.js} +16 -16
- package/dist/{index-BZZHE-1t.js → index-CyeGBcX0.js} +1 -1
- package/dist/{index-Dq0LIBEh.js → index-DKEMW9N8.js} +25 -25
- package/dist/{index-2vYoun4O.js → index-LucuShOc.js} +45292 -56275
- package/dist/{info-Br-SBtj3.js → info-Begf9tO0.js} +1 -1
- package/dist/{info-circle-Ew4RoR_Q.js → info-circle-Bo1H2OXh.js} +1 -1
- package/dist/{lightbulb-BRBVOE_b.js → lightbulb-C-SU_z2I.js} +1 -1
- package/dist/{mail-Dzi4AncY.js → mail-CXsYiNAT.js} +1 -1
- package/dist/{mobile-BGGxQ5be.js → mobile-C7bUjgog.js} +1 -1
- package/dist/{more-BmNaKbYJ.js → more-29BC-wmy.js} +1 -1
- package/dist/{network-placeholder-EMiMf4q1.js → network-placeholder-B-x3-6jN.js} +1 -1
- package/dist/{nftPlaceholder-CvSqy3Sd.js → nftPlaceholder-pM-Hmswq.js} +1 -1
- package/dist/nodeflow-sdk.es.js +15 -0
- package/dist/{off-DF9uz0Nc.js → off-DEa_uc7_.js} +1 -1
- package/dist/{onramp-cKzTmKku.js → onramp-ZXqyloYt.js} +10 -10
- package/dist/{play-store-CGxW4MgL.js → play-store-WgSEpEI1.js} +1 -1
- package/dist/{plus-CQ6wWkN0.js → plus-u4UZhYAg.js} +1 -1
- package/dist/{qr-code-VBqx9nAF.js → qr-code-DxZGxoPE.js} +1 -1
- package/dist/{receive-CVzkHmKR.js → receive-Ct_mQWzk.js} +1 -1
- package/dist/{recycle-horizontal-Oq1YtvUx.js → recycle-horizontal-BWVpmHJc.js} +1 -1
- package/dist/{refresh-BDlGAzmY.js → refresh-gi4TfgEU.js} +1 -1
- package/dist/{reown-logo-BlIpXIlG.js → reown-logo-Bg731n4w.js} +1 -1
- package/dist/{search-DfmCmp0m.js → search-BQv7DVJG.js} +1 -1
- package/dist/{send-BXudz514.js → send-BzmnFT2p.js} +1 -1
- package/dist/{send-Cz0L5LmE.js → send-CyxKtrQ9.js} +17 -17
- package/dist/{socials-CDOh8MRf.js → socials-vziOn4zi.js} +5 -5
- package/dist/{solana-CbiyOE-8.js → solana-Dz48awbr.js} +1 -1
- package/dist/{swapHorizontal-DyU1TH_e.js → swapHorizontal-Cwe1PoMp.js} +1 -1
- package/dist/{swapHorizontalBold-CGXW7Ocj.js → swapHorizontalBold-Dxu58sRG.js} +1 -1
- package/dist/{swapHorizontalMedium-2KTcj67d.js → swapHorizontalMedium-DOZZthlB.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-TxFtmmda.js → swapHorizontalRoundedBold-BkIZQXnD.js} +1 -1
- package/dist/{swapVertical-BKD6lxM3.js → swapVertical-LSq66ctC.js} +1 -1
- package/dist/{swaps-BuGsEQaI.js → swaps-C2EO6dQA.js} +9 -9
- package/dist/{telegram-CAsl9DeG.js → telegram-ITq9s69Y.js} +1 -1
- package/dist/{three-dots-BoE2aHZi.js → three-dots-JH3A1TFR.js} +1 -1
- package/dist/{transactions-C1NtsnD6.js → transactions-DpMVZVap.js} +1 -1
- package/dist/{twitch-CvkZZxgT.js → twitch-BKs5FlDf.js} +1 -1
- package/dist/{twitterIcon-CrhnOl_O.js → twitterIcon-CCXEj_Nv.js} +1 -1
- package/dist/{ui-BJcuThPA.js → ui-D5ULRvGt.js} +6 -6
- package/dist/{user-BZRWUXG7.js → user-CBgAUjZv.js} +1 -1
- package/dist/{verify-y9F4DcJ4.js → verify-BPlPPkhG.js} +1 -1
- package/dist/{verify-filled-X_8-BhMk.js → verify-filled-qTRg0OWM.js} +1 -1
- package/dist/{w3m-modal-BX--v1Nc.js → w3m-modal-DSdDfy32.js} +27 -27
- package/dist/{wallet-CIaVVkjQ.js → wallet-BuDEi_8z.js} +1 -1
- package/dist/{wallet-placeholder-Cq1ofde1.js → wallet-placeholder-D4DKTuB_.js} +1 -1
- package/dist/{walletconnect-CINzSCJ3.js → walletconnect-Dt3q5XFc.js} +1 -1
- package/dist/{warning-circle-BvBNhMKH.js → warning-circle-B8Fkc0_4.js} +1 -1
- package/dist/{x-xHY7JehW.js → x-Cm_V3zUI.js} +1 -1
- package/dist/{x-mark-DEmnBt6u.js → x-mark-BVvwdxda.js} +1 -1
- package/package.json +11 -10
- package/.github/workflows/code-quality.yml +0 -43
- package/.github/workflows/publish.yml +0 -64
- package/dist/astra-sdk.es.js +0 -9
- package/dist/ccip-DkYvh7hg.js +0 -149
- package/dist/clsx.m-DCYaa4RU.js +0 -20
- package/dist/index-BDE-2VTp.js +0 -315
- package/dist/index-BjLIiJQa.js +0 -21034
- package/dist/index-CIr4zlVp.js +0 -386
- package/dist/index-ChxXyuZj.js +0 -572
- package/dist/index-D-T7kk3G.js +0 -15911
- package/dist/index-DSX3HrTS.js +0 -10785
- package/dist/secp256k1-CsKSDHNi.js +0 -1257
- package/eslint.config.mjs +0 -41
- package/index.html +0 -13
- package/public/font/ClashDisplay-Variable.ttf +0 -0
- package/public/font/ClashDisplay-Variable.woff +0 -0
- package/public/font/ClashDisplay-Variable.woff2 +0 -0
- package/public/vite.svg +0 -1
- package/src/App.css +0 -170
- package/src/apis/lspApi.js +0 -82
- package/src/apis/request.js +0 -59
- package/src/assets/arrow-right.svg +0 -3
- package/src/assets/astr.svg +0 -13
- package/src/assets/bridge-loading.png +0 -0
- package/src/assets/ln.png +0 -0
- package/src/assets/network/Arbitrum.png +0 -0
- package/src/assets/network/Polygon.png +0 -0
- package/src/assets/network/Solana.png +0 -0
- package/src/assets/network/base.png +0 -0
- package/src/assets/network/botanix.png +0 -0
- package/src/assets/network/bsc.svg +0 -13
- package/src/assets/network/eth.png +0 -0
- package/src/assets/network/lighting.png +0 -0
- package/src/assets/network/ligtning.svg +0 -22
- package/src/assets/network/solona.png +0 -0
- package/src/assets/pay.png +0 -0
- package/src/assets/powerby.svg +0 -14
- package/src/assets/react.svg +0 -1
- package/src/assets/success.svg +0 -3
- package/src/assets/tip.svg +0 -5
- package/src/assets/tokens/sol.png +0 -0
- package/src/assets/tokens/usdc.png +0 -0
- package/src/assets/tokens/usdt.png +0 -0
- package/src/comps/AstraImage.jsx +0 -37
- package/src/comps/AstraModal.jsx +0 -202
- package/src/comps/AstraModalLogo.jsx +0 -29
- package/src/comps/AstraNetwork.jsx +0 -261
- package/src/comps/CheckErc20Button.jsx +0 -28
- package/src/comps/CommonStyle.jsx +0 -4
- package/src/comps/ConnectButton.jsx +0 -19
- package/src/comps/EllipsisMiddle.jsx +0 -42
- package/src/comps/ResultModal.jsx +0 -312
- package/src/comps/ToLightning.jsx +0 -653
- package/src/comps/ToToken.jsx +0 -550
- package/src/constants/index.js +0 -21
- package/src/font/ClashDisplay-Variable.ttf +0 -0
- package/src/font/ClashDisplay-Variable.woff +0 -0
- package/src/font/ClashDisplay-Variable.woff2 +0 -0
- package/src/hooks/useContract.js +0 -179
- package/src/hooks/useGetMinAndMax.js +0 -48
- package/src/hooks/useLspApi.js +0 -70
- package/src/hooks/useParseInvoice.js +0 -95
- package/src/index.css +0 -69
- package/src/index.jsx +0 -161
- package/src/lib/bolt11.min.js +0 -1
- package/src/main.jsx +0 -75
- package/src/store/index.js +0 -25
- package/src/theme.js +0 -108
- package/src/utils/index.js +0 -267
- package/vite.config.js +0 -50
package/src/lib/bolt11.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).lightningPayReq=t()}}(function(){return function(){return function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}}()({1:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer;e.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var i=0;i<t.length;i++){var o=t.charAt(i),s=o.charCodeAt(0);if(255!==e[s])throw new TypeError(o+" is ambiguous");e[s]=i}var a=t.length,u=t.charAt(0),f=Math.log(a)/Math.log(256),h=Math.log(256)/Math.log(a);function c(t){if("string"!=typeof t)throw new TypeError("Expected String");if(0===t.length)return n.alloc(0);for(var r=0,i=0,o=0;t[r]===u;)i++,r++;for(var s=(t.length-r)*f+1>>>0,h=new Uint8Array(s);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var d=0,l=s-1;(0!==c||d<o)&&-1!==l;l--,d++)c+=a*h[l]>>>0,h[l]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");o=d,r++}for(var p=s-o;p!==s&&0===h[p];)p++;var b=n.allocUnsafe(i+(s-p));b.fill(0,0,i);for(var y=i;p!==s;)b[y++]=h[p++];return b}return{encode:function(e){if((Array.isArray(e)||e instanceof Uint8Array)&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,i=0,o=0,s=e.length;o!==s&&0===e[o];)o++,r++;for(var f=(s-o)*h+1>>>0,c=new Uint8Array(f);o!==s;){for(var d=e[o],l=0,p=f-1;(0!==d||l<i)&&-1!==p;p--,l++)d+=256*c[p]>>>0,c[p]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");i=l,o++}for(var b=f-i;b!==f&&0===c[b];)b++;for(var y=u.repeat(r);b<f;++b)y+=t.charAt(c[b]);return y},decodeUnsafe:c,decode:function(t){var e=c(t);if(e)return e;throw new Error("Non-base"+a+" character")}}}},{"safe-buffer":204}],2:[function(t,e,r){"use strict";for(var n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={},o=0;o<n.length;o++){var s=n.charAt(o);if(void 0!==i[s])throw new TypeError(s+" is ambiguous");i[s]=o}function a(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function u(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)throw new Error("Invalid prefix ("+t+")");e=a(e)^n>>5}for(e=a(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=a(e)^31&i}return e}function f(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)throw new Error("Excess padding");if(i<<r-o&s)throw new Error("Non-zero padding")}return a}e.exports={decode:function(t,e){if(e=e||90,t.length<8)throw new TypeError(t+" too short");if(t.length>e)throw new TypeError("Exceeds length limit");var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)throw new Error("Mixed-case string "+t);var o=(t=r).lastIndexOf("1");if(-1===o)throw new Error("No separator character for "+t);if(0===o)throw new Error("Missing prefix for "+t);var s=t.slice(0,o),f=t.slice(o+1);if(f.length<6)throw new Error("Data too short");for(var h=u(s),c=[],d=0;d<f.length;++d){var l=f.charAt(d),p=i[l];if(void 0===p)throw new Error("Unknown character "+l);h=a(h)^p,d+6>=f.length||c.push(p)}if(1!==h)throw new Error("Invalid checksum for "+t);return{prefix:s,words:c}},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");for(var i=u(t=t.toLowerCase()),o=t+"1",s=0;s<e.length;++s){var f=e[s];if(f>>5!=0)throw new Error("Non 5-bit word");i=a(i)^f,o+=n.charAt(f)}for(s=0;s<6;++s)i=a(i);for(i^=1,s=0;s<6;++s){var h=i>>5*(5-s)&31;o+=n.charAt(h)}return o},toWords:function(t){return f(t,8,5,!0)},fromWords:function(t){return f(t,5,8,!1)}}},{}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../parser");function i(t,e,r){return n=>{if(t.has(n))return;const i=r.filter(t=>t.key.toString("hex")===n)[0];e.push(i),t.add(n)}}function o(t){return t.globalMap.unsignedTx}function s(t){const e=new Set;return t.forEach(t=>{const r=t.key.toString("hex");if(e.has(r))throw new Error("Combine: KeyValue Map keys should be unique");e.add(r)}),e}r.combine=function(t){const e=t[0],r=n.psbtToKeyVals(e),a=t.slice(1);if(0===a.length)throw new Error("Combine: Nothing to combine");const u=o(e);if(void 0===u)throw new Error("Combine: Self missing transaction");const f=s(r.globalKeyVals),h=r.inputKeyVals.map(s),c=r.outputKeyVals.map(s);for(const t of a){const e=o(t);if(void 0===e||!e.toBuffer().equals(u.toBuffer()))throw new Error("Combine: One of the Psbts does not have the same transaction.");const a=n.psbtToKeyVals(t);s(a.globalKeyVals).forEach(i(f,r.globalKeyVals,a.globalKeyVals)),a.inputKeyVals.map(s).forEach((t,e)=>t.forEach(i(h[e],r.inputKeyVals[e],a.inputKeyVals[e]))),a.outputKeyVals.map(s).forEach((t,e)=>t.forEach(i(c[e],r.outputKeyVals[e],a.outputKeyVals[e])))}return n.psbtFromKeyVals(u,{globalMapKeyVals:r.globalKeyVals,inputKeyVals:r.inputKeyVals,outputKeyVals:r.outputKeyVals})}},{"../parser":21}],4:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields"),i=t=>[...Array(t).keys()];r.decode=function(t){if(t.key[0]!==n.GlobalTypes.GLOBAL_XPUB)throw new Error("Decode Error: could not decode globalXpub with key 0x"+t.key.toString("hex"));if(79!==t.key.length||![2,3].includes(t.key[46]))throw new Error("Decode Error: globalXpub has invalid extended pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Global GLOBAL_XPUB value length should be multiple of 4");const e=t.key.slice(1),r={masterFingerprint:t.value.slice(0,4),extendedPubkey:e,path:"m"};for(const e of i(t.value.length/4-1)){const n=t.value.readUInt32LE(4*e+4),i=!!(2147483648&n),o=2147483647&n;r.path+="/"+o.toString(10)+(i?"'":"")}return r},r.encode=function(t){const r=e.from([n.GlobalTypes.GLOBAL_XPUB]),i=e.concat([r,t.extendedPubkey]),o=t.path.split("/"),s=e.allocUnsafe(4*o.length);t.masterFingerprint.copy(s,0);let a=4;return o.slice(1).forEach(t=>{const e="'"===t.slice(-1);let r=2147483647&parseInt(e?t.slice(0,-1):t,10);e&&(r+=2147483648),s.writeUInt32LE(r,a),a+=4}),{key:i,value:s}},r.expected="{ masterFingerprint: Buffer; extendedPubkey: Buffer; path: string; }",r.check=function(t){const r=t.extendedPubkey,n=t.masterFingerprint,i=t.path;return e.isBuffer(r)&&78===r.length&&[2,3].indexOf(r[45])>-1&&e.isBuffer(n)&&4===n.length&&"string"==typeof i&&!!i.match(/^m(\/\d+'?)+$/)},r.canAddToArray=function(t,e,r){const n=e.extendedPubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.extendedPubkey.equals(e.extendedPubkey)).length)}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],5:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.encode=function(t){return{key:e.from([n.GlobalTypes.UNSIGNED_TX]),value:t.toBuffer()}}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],6:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../typeFields"),i=t("./global/globalXpub"),o=t("./global/unsignedTx"),s=t("./input/finalScriptSig"),a=t("./input/finalScriptWitness"),u=t("./input/nonWitnessUtxo"),f=t("./input/partialSig"),h=t("./input/porCommitment"),c=t("./input/sighashType"),d=t("./input/witnessUtxo"),l=t("./shared/bip32Derivation"),p=t("./shared/checkPubkey"),b=t("./shared/redeemScript"),y=t("./shared/witnessScript"),m={unsignedTx:o,globalXpub:i,checkPubkey:p.makeChecker([])};r.globals=m;const g={nonWitnessUtxo:u,partialSig:f,sighashType:c,finalScriptSig:s,finalScriptWitness:a,porCommitment:h,witnessUtxo:d,bip32Derivation:l.makeConverter(n.InputTypes.BIP32_DERIVATION),redeemScript:b.makeConverter(n.InputTypes.REDEEM_SCRIPT),witnessScript:y.makeConverter(n.InputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.InputTypes.PARTIAL_SIG,n.InputTypes.BIP32_DERIVATION])};r.inputs=g;const w={bip32Derivation:l.makeConverter(n.OutputTypes.BIP32_DERIVATION),redeemScript:b.makeConverter(n.OutputTypes.REDEEM_SCRIPT),witnessScript:y.makeConverter(n.OutputTypes.WITNESS_SCRIPT),checkPubkey:p.makeChecker([n.OutputTypes.BIP32_DERIVATION])};r.outputs=w},{"../typeFields":24,"./global/globalXpub":4,"./global/unsignedTx":5,"./input/finalScriptSig":7,"./input/finalScriptWitness":8,"./input/nonWitnessUtxo":9,"./input/partialSig":10,"./input/porCommitment":11,"./input/sighashType":12,"./input/witnessUtxo":13,"./shared/bip32Derivation":14,"./shared/checkPubkey":15,"./shared/redeemScript":16,"./shared/witnessScript":17}],7:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.FINAL_SCRIPTSIG)throw new Error("Decode Error: could not decode finalScriptSig with key 0x"+t.key.toString("hex"));return t.value},r.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTSIG]),value:t}},r.expected="Buffer",r.check=function(t){return e.isBuffer(t)},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.finalScriptSig}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],8:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.FINAL_SCRIPTWITNESS)throw new Error("Decode Error: could not decode finalScriptWitness with key 0x"+t.key.toString("hex"));return t.value},r.encode=function(t){return{key:e.from([n.InputTypes.FINAL_SCRIPTWITNESS]),value:t}},r.expected="Buffer",r.check=function(t){return e.isBuffer(t)},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.finalScriptWitness}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],9:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.NON_WITNESS_UTXO)throw new Error("Decode Error: could not decode nonWitnessUtxo with key 0x"+t.key.toString("hex"));return t.value},r.encode=function(t){return{key:e.from([n.InputTypes.NON_WITNESS_UTXO]),value:t}},r.expected="Buffer",r.check=function(t){return e.isBuffer(t)},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.nonWitnessUtxo}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],10:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.PARTIAL_SIG)throw new Error("Decode Error: could not decode partialSig with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: partialSig has invalid pubkey in key 0x"+t.key.toString("hex"));return{pubkey:t.key.slice(1),signature:t.value}},r.encode=function(t){const r=e.from([n.InputTypes.PARTIAL_SIG]);return{key:e.concat([r,t.pubkey]),value:t.signature}},r.expected="{ pubkey: Buffer; signature: Buffer; }",r.check=function(t){return e.isBuffer(t.pubkey)&&e.isBuffer(t.signature)&&[33,65].includes(t.pubkey.length)&&[2,3,4].includes(t.pubkey[0])&&function(t){if(!e.isBuffer(t)||t.length<9)return!1;if(48!==t[0])return!1;if(t.length!==t[1]+3)return!1;if(2!==t[2])return!1;const r=t[3];if(r>33||r<1)return!1;if(2!==t[3+r+1])return!1;const n=t[3+r+2];return!(n>33||n<1)&&t.length===3+r+2+n+2}(t.signature)},r.canAddToArray=function(t,e,r){const n=e.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.pubkey.equals(e.pubkey)).length)}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],11:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.POR_COMMITMENT)throw new Error("Decode Error: could not decode porCommitment with key 0x"+t.key.toString("hex"));return t.value.toString("utf8")},r.encode=function(t){return{key:e.from([n.InputTypes.POR_COMMITMENT]),value:e.from(t,"utf8")}},r.expected="string",r.check=function(t){return"string"==typeof t},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.porCommitment}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],12:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields");r.decode=function(t){if(t.key[0]!==n.InputTypes.SIGHASH_TYPE)throw new Error("Decode Error: could not decode sighashType with key 0x"+t.key.toString("hex"));return t.value.readUInt32LE(0)},r.encode=function(t){const r=e.from([n.InputTypes.SIGHASH_TYPE]),i=e.allocUnsafe(4);return i.writeUInt32LE(t,0),{key:r,value:i}},r.expected="number",r.check=function(t){return"number"==typeof t},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.sighashType}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,buffer:223}],13:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../../typeFields"),i=t("../tools"),o=t("../varint");r.decode=function(t){if(t.key[0]!==n.InputTypes.WITNESS_UTXO)throw new Error("Decode Error: could not decode witnessUtxo with key 0x"+t.key.toString("hex"));const e=i.readUInt64LE(t.value,0);let r=8;const s=o.decode(t.value,r);r+=o.encodingLength(s);const a=t.value.slice(r);if(a.length!==s)throw new Error("Decode Error: WITNESS_UTXO script is not proper length");return{script:a,value:e}},r.encode=function(t){const{script:r,value:s}=t,a=o.encodingLength(r.length),u=e.allocUnsafe(8+a+r.length);return i.writeUInt64LE(u,s,0),o.encode(r.length,u,8),r.copy(u,8+a),{key:e.from([n.InputTypes.WITNESS_UTXO]),value:u}},r.expected="{ script: Buffer; value: number; }",r.check=function(t){return e.isBuffer(t.script)&&"number"==typeof t.value},r.canAdd=function(t,e){return!!t&&!!e&&void 0===t.witnessUtxo}}).call(this)}).call(this,t("buffer").Buffer)},{"../../typeFields":24,"../tools":18,"../varint":19,buffer:223}],14:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const e=t=>[...Array(t).keys()];r.makeConverter=function(r){return{decode:function(t){if(t.key[0]!==r)throw new Error("Decode Error: could not decode bip32Derivation with key 0x"+t.key.toString("hex"));if(34!==t.key.length&&66!==t.key.length||![2,3,4].includes(t.key[1]))throw new Error("Decode Error: bip32Derivation has invalid pubkey in key 0x"+t.key.toString("hex"));if(t.value.length/4%1!=0)throw new Error("Decode Error: Input BIP32_DERIVATION value length should be multiple of 4");const n=t.key.slice(1),i={masterFingerprint:t.value.slice(0,4),pubkey:n,path:"m"};for(const r of e(t.value.length/4-1)){const e=t.value.readUInt32LE(4*r+4),n=!!(2147483648&e),o=2147483647&e;i.path+="/"+o.toString(10)+(n?"'":"")}return i},encode:function(e){const n=t.from([r]),i=t.concat([n,e.pubkey]),o=e.path.split("/"),s=t.allocUnsafe(4*o.length);e.masterFingerprint.copy(s,0);let a=4;return o.slice(1).forEach(t=>{const e="'"===t.slice(-1);let r=2147483647&parseInt(e?t.slice(0,-1):t,10);e&&(r+=2147483648),s.writeUInt32LE(r,a),a+=4}),{key:i,value:s}},check:function(e){return t.isBuffer(e.pubkey)&&t.isBuffer(e.masterFingerprint)&&"string"==typeof e.path&&[33,65].includes(e.pubkey.length)&&[2,3,4].includes(e.pubkey[0])&&4===e.masterFingerprint.length},expected:"{ masterFingerprint: Buffer; pubkey: Buffer; path: string; }",canAddToArray:function(t,e,r){const n=e.pubkey.toString("hex");return!r.has(n)&&(r.add(n),0===t.filter(t=>t.pubkey.equals(e.pubkey)).length)}}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.makeChecker=function(t){return function(e){let r;if(t.includes(e.key[0])&&(33!==(r=e.key.slice(1)).length&&65!==r.length||![2,3,4].includes(r[0])))throw new Error("Format Error: invalid pubkey in key 0x"+e.key.toString("hex"));return r}}},{}],16:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode redeemScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(r){return{key:t.from([e]),value:r}},check:function(e){return t.isBuffer(e)},expected:"Buffer",canAdd:function(t,e){return!!t&&!!e&&void 0===t.redeemScript}}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],17:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.makeConverter=function(e){return{decode:function(t){if(t.key[0]!==e)throw new Error("Decode Error: could not decode witnessScript with key 0x"+t.key.toString("hex"));return t.value},encode:function(r){return{key:t.from([e]),value:r}},check:function(e){return t.isBuffer(e)},expected:"Buffer",canAdd:function(t,e){return!!t&&!!e&&void 0===t.witnessScript}}}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],18:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("./varint");function i(t){const r=t.key.length,i=t.value.length,o=n.encodingLength(r),s=n.encodingLength(i),a=e.allocUnsafe(o+r+s+i);return n.encode(r,a,0),t.key.copy(a,o),n.encode(i,a,o+r),t.value.copy(a,o+r+s),a}function o(t,e){if("number"!=typeof t)throw new Error("cannot write a non-number as a number");if(t<0)throw new Error("specified a negative value for writing an unsigned value");if(t>e)throw new Error("RangeError: value out of range");if(Math.floor(t)!==t)throw new Error("value has a fractional component")}r.range=(t=>[...Array(t).keys()]),r.reverseBuffer=function(t){if(t.length<1)return t;let e=t.length-1,r=0;for(let n=0;n<t.length/2;n++)r=t[n],t[n]=t[e],t[e]=r,e--;return t},r.keyValsToBuffer=function(t){const r=t.map(i);return r.push(e.from([0])),e.concat(r)},r.keyValToBuffer=i,r.readUInt64LE=function(t,e){const r=t.readUInt32LE(e);let n=t.readUInt32LE(e+4);return o((n*=4294967296)+r,9007199254740991),n+r},r.writeUInt64LE=function(t,e,r){return o(e,9007199254740991),t.writeInt32LE(-1&e,r),t.writeUInt32LE(Math.floor(e/4294967296),r+4),r+8}}).call(this)}).call(this,t("buffer").Buffer)},{"./varint":19,buffer:223}],19:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const e=9007199254740991;function n(t){if(t<0||t>e||t%1!=0)throw new RangeError("value out of range")}function i(t){return n(t),t<253?1:t<=65535?3:t<=4294967295?5:9}r.encode=function e(r,o,s){if(n(r),o||(o=t.allocUnsafe(i(r))),!t.isBuffer(o))throw new TypeError("buffer must be a Buffer instance");return s||(s=0),r<253?(o.writeUInt8(r,s),Object.assign(e,{bytes:1})):r<=65535?(o.writeUInt8(253,s),o.writeUInt16LE(r,s+1),Object.assign(e,{bytes:3})):r<=4294967295?(o.writeUInt8(254,s),o.writeUInt32LE(r,s+1),Object.assign(e,{bytes:5})):(o.writeUInt8(255,s),o.writeUInt32LE(r>>>0,s+1),o.writeUInt32LE(r/4294967296|0,s+5),Object.assign(e,{bytes:9})),o},r.decode=function e(r,i){if(!t.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");i||(i=0);const o=r.readUInt8(i);if(o<253)return Object.assign(e,{bytes:1}),o;if(253===o)return Object.assign(e,{bytes:3}),r.readUInt16LE(i+1);if(254===o)return Object.assign(e,{bytes:5}),r.readUInt32LE(i+1);{Object.assign(e,{bytes:9});const t=r.readUInt32LE(i+1),o=4294967296*r.readUInt32LE(i+5)+t;return n(o),o}},r.encodingLength=i}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],20:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../converter"),i=t("../converter/tools"),o=t("../converter/varint"),s=t("../typeFields");function a(t,r,n){if(!r.equals(e.from([n])))throw new Error(`Format Error: Invalid ${t} key: ${r.toString("hex")}`)}function u(t,{globalMapKeyVals:e,inputKeyVals:r,outputKeyVals:o}){const u={unsignedTx:t};let f=0;for(const t of e)switch(t.key[0]){case s.GlobalTypes.UNSIGNED_TX:if(a("global",t.key,s.GlobalTypes.UNSIGNED_TX),f>0)throw new Error("Format Error: GlobalMap has multiple UNSIGNED_TX");f++;break;case s.GlobalTypes.GLOBAL_XPUB:void 0===u.globalXpub&&(u.globalXpub=[]),u.globalXpub.push(n.globals.globalXpub.decode(t));break;default:u.unknownKeyVals||(u.unknownKeyVals=[]),u.unknownKeyVals.push(t)}const h=r.length,c=o.length,d=[],l=[];for(const t of i.range(h)){const e={};for(const i of r[t])switch(n.inputs.checkPubkey(i),i.key[0]){case s.InputTypes.NON_WITNESS_UTXO:if(a("input",i.key,s.InputTypes.NON_WITNESS_UTXO),void 0!==e.nonWitnessUtxo)throw new Error("Format Error: Input has multiple NON_WITNESS_UTXO");e.nonWitnessUtxo=n.inputs.nonWitnessUtxo.decode(i);break;case s.InputTypes.WITNESS_UTXO:if(a("input",i.key,s.InputTypes.WITNESS_UTXO),void 0!==e.witnessUtxo)throw new Error("Format Error: Input has multiple WITNESS_UTXO");e.witnessUtxo=n.inputs.witnessUtxo.decode(i);break;case s.InputTypes.PARTIAL_SIG:void 0===e.partialSig&&(e.partialSig=[]),e.partialSig.push(n.inputs.partialSig.decode(i));break;case s.InputTypes.SIGHASH_TYPE:if(a("input",i.key,s.InputTypes.SIGHASH_TYPE),void 0!==e.sighashType)throw new Error("Format Error: Input has multiple SIGHASH_TYPE");e.sighashType=n.inputs.sighashType.decode(i);break;case s.InputTypes.REDEEM_SCRIPT:if(a("input",i.key,s.InputTypes.REDEEM_SCRIPT),void 0!==e.redeemScript)throw new Error("Format Error: Input has multiple REDEEM_SCRIPT");e.redeemScript=n.inputs.redeemScript.decode(i);break;case s.InputTypes.WITNESS_SCRIPT:if(a("input",i.key,s.InputTypes.WITNESS_SCRIPT),void 0!==e.witnessScript)throw new Error("Format Error: Input has multiple WITNESS_SCRIPT");e.witnessScript=n.inputs.witnessScript.decode(i);break;case s.InputTypes.BIP32_DERIVATION:void 0===e.bip32Derivation&&(e.bip32Derivation=[]),e.bip32Derivation.push(n.inputs.bip32Derivation.decode(i));break;case s.InputTypes.FINAL_SCRIPTSIG:a("input",i.key,s.InputTypes.FINAL_SCRIPTSIG),e.finalScriptSig=n.inputs.finalScriptSig.decode(i);break;case s.InputTypes.FINAL_SCRIPTWITNESS:a("input",i.key,s.InputTypes.FINAL_SCRIPTWITNESS),e.finalScriptWitness=n.inputs.finalScriptWitness.decode(i);break;case s.InputTypes.POR_COMMITMENT:a("input",i.key,s.InputTypes.POR_COMMITMENT),e.porCommitment=n.inputs.porCommitment.decode(i);break;default:e.unknownKeyVals||(e.unknownKeyVals=[]),e.unknownKeyVals.push(i)}d.push(e)}for(const t of i.range(c)){const e={};for(const r of o[t])switch(n.outputs.checkPubkey(r),r.key[0]){case s.OutputTypes.REDEEM_SCRIPT:if(a("output",r.key,s.OutputTypes.REDEEM_SCRIPT),void 0!==e.redeemScript)throw new Error("Format Error: Output has multiple REDEEM_SCRIPT");e.redeemScript=n.outputs.redeemScript.decode(r);break;case s.OutputTypes.WITNESS_SCRIPT:if(a("output",r.key,s.OutputTypes.WITNESS_SCRIPT),void 0!==e.witnessScript)throw new Error("Format Error: Output has multiple WITNESS_SCRIPT");e.witnessScript=n.outputs.witnessScript.decode(r);break;case s.OutputTypes.BIP32_DERIVATION:void 0===e.bip32Derivation&&(e.bip32Derivation=[]),e.bip32Derivation.push(n.outputs.bip32Derivation.decode(r));break;default:e.unknownKeyVals||(e.unknownKeyVals=[]),e.unknownKeyVals.push(r)}l.push(e)}return{globalMap:u,inputs:d,outputs:l}}r.psbtFromBuffer=function(t,e){let r=0;function n(){const e=o.decode(t,r);r+=o.encodingLength(e);const n=t.slice(r,r+e);return r+=e,n}function a(){return{key:n(),value:n()}}function f(){if(r>=t.length)throw new Error("Format Error: Unexpected End of PSBT");const e=0===t.readUInt8(r);return e&&r++,e}if(1886610036!==function(){const e=t.readUInt32BE(r);return r+=4,e}())throw new Error("Format Error: Invalid Magic Number");if(255!==function(){const e=t.readUInt8(r);return r+=1,e}())throw new Error("Format Error: Magic Number must be followed by 0xff separator");const h=[],c={};for(;!f();){const t=a(),e=t.key.toString("hex");if(c[e])throw new Error("Format Error: Keys must be unique for global keymap: key "+e);c[e]=1,h.push(t)}const d=h.filter(t=>t.key[0]===s.GlobalTypes.UNSIGNED_TX);if(1!==d.length)throw new Error("Format Error: Only one UNSIGNED_TX allowed");const l=e(d[0].value),{inputCount:p,outputCount:b}=l.getInputOutputCounts(),y=[],m=[];for(const t of i.range(p)){const e={},r=[];for(;!f();){const n=a(),i=n.key.toString("hex");if(e[i])throw new Error("Format Error: Keys must be unique for each input: input index "+t+" key "+i);e[i]=1,r.push(n)}y.push(r)}for(const t of i.range(b)){const e={},r=[];for(;!f();){const n=a(),i=n.key.toString("hex");if(e[i])throw new Error("Format Error: Keys must be unique for each output: output index "+t+" key "+i);e[i]=1,r.push(n)}m.push(r)}return u(l,{globalMapKeyVals:h,inputKeyVals:y,outputKeyVals:m})},r.checkKeyBuffer=a,r.psbtFromKeyVals=u}).call(this)}).call(this,t("buffer").Buffer)},{"../converter":6,"../converter/tools":18,"../converter/varint":19,"../typeFields":24,buffer:223}],21:[function(t,e,r){"use strict";function n(t){for(var e in t)r.hasOwnProperty(e)||(r[e]=t[e])}Object.defineProperty(r,"__esModule",{value:!0}),n(t("./fromBuffer")),n(t("./toBuffer"))},{"./fromBuffer":20,"./toBuffer":22}],22:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("../converter"),i=t("../converter/tools");r.psbtToBuffer=function({globalMap:t,inputs:r,outputs:n}){const{globalKeyVals:o,inputKeyVals:s,outputKeyVals:u}=a({globalMap:t,inputs:r,outputs:n}),f=i.keyValsToBuffer(o),h=t=>0===t.length?[e.from([0])]:t.map(i.keyValsToBuffer),c=h(s),d=h(u),l=e.allocUnsafe(5);return l.writeUIntBE(482972169471,0,5),e.concat([l,f].concat(c,d))};const o=(t,e)=>t.key.compare(e.key);function s(t,e){const r=new Set,n=Object.entries(t).reduce((t,[n,i])=>{if("unknownKeyVals"===n)return t;const o=e[n];if(void 0===o)return t;const s=(Array.isArray(i)?i:[i]).map(o.encode);return s.map(t=>t.key.toString("hex")).forEach(t=>{if(r.has(t))throw new Error("Serialize Error: Duplicate key: "+t);r.add(t)}),t.concat(s)},[]),i=t.unknownKeyVals?t.unknownKeyVals.filter(t=>!r.has(t.key.toString("hex"))):[];return n.concat(i).sort(o)}function a({globalMap:t,inputs:e,outputs:r}){return{globalKeyVals:s(t,n.globals),inputKeyVals:e.map(t=>s(t,n.inputs)),outputKeyVals:r.map(t=>s(t,n.outputs))}}r.psbtToKeyVals=a}).call(this)}).call(this,t("buffer").Buffer)},{"../converter":6,"../converter/tools":18,buffer:223}],23:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("./combiner"),i=t("./parser"),o=t("./typeFields"),s=t("./utils");r.Psbt=class{constructor(t){this.inputs=[],this.outputs=[],this.globalMap={unsignedTx:t}}static fromBase64(t,r){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(t,e){const r=i.psbtFromBuffer(t,e),n=new this(r.globalMap.unsignedTx);return Object.assign(n,r),n}toBase64(){return this.toBuffer().toString("base64")}toHex(){return this.toBuffer().toString("hex")}toBuffer(){return i.psbtToBuffer(this)}updateGlobal(t){return s.updateGlobal(t,this.globalMap),this}updateInput(t,e){const r=s.checkForInput(this.inputs,t);return s.updateInput(e,r),this}updateOutput(t,e){const r=s.checkForOutput(this.outputs,t);return s.updateOutput(e,r),this}addUnknownKeyValToGlobal(t){return s.checkHasKey(t,this.globalMap.unknownKeyVals,s.getEnumLength(o.GlobalTypes)),this.globalMap.unknownKeyVals||(this.globalMap.unknownKeyVals=[]),this.globalMap.unknownKeyVals.push(t),this}addUnknownKeyValToInput(t,e){const r=s.checkForInput(this.inputs,t);return s.checkHasKey(e,r.unknownKeyVals,s.getEnumLength(o.InputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(e),this}addUnknownKeyValToOutput(t,e){const r=s.checkForOutput(this.outputs,t);return s.checkHasKey(e,r.unknownKeyVals,s.getEnumLength(o.OutputTypes)),r.unknownKeyVals||(r.unknownKeyVals=[]),r.unknownKeyVals.push(e),this}addInput(t){this.globalMap.unsignedTx.addInput(t),this.inputs.push({unknownKeyVals:[]});const e=t.unknownKeyVals||[],r=this.inputs.length-1;if(!Array.isArray(e))throw new Error("unknownKeyVals must be an Array");return e.forEach(t=>this.addUnknownKeyValToInput(r,t)),s.addInputAttributes(this.inputs,t),this}addOutput(t){this.globalMap.unsignedTx.addOutput(t),this.outputs.push({unknownKeyVals:[]});const e=t.unknownKeyVals||[],r=this.outputs.length-1;if(!Array.isArray(e))throw new Error("unknownKeyVals must be an Array");return e.forEach(t=>this.addUnknownKeyValToInput(r,t)),s.addOutputAttributes(this.outputs,t),this}clearFinalizedInput(t){const e=s.checkForInput(this.inputs,t);s.inputCheckUncleanFinalized(t,e);for(const t of Object.keys(e))["witnessUtxo","nonWitnessUtxo","finalScriptSig","finalScriptWitness","unknownKeyVals"].includes(t)||delete e[t];return this}combine(...t){const e=n.combine([this].concat(t));return Object.assign(this,e),this}getTransaction(){return this.globalMap.unsignedTx.toBuffer()}}}).call(this)}).call(this,t("buffer").Buffer)},{"./combiner":3,"./parser":21,"./typeFields":24,"./utils":25,buffer:223}],24:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),function(t){t[t.UNSIGNED_TX=0]="UNSIGNED_TX",t[t.GLOBAL_XPUB=1]="GLOBAL_XPUB"}(r.GlobalTypes||(r.GlobalTypes={})),r.GLOBAL_TYPE_NAMES=["unsignedTx","globalXpub"],function(t){t[t.NON_WITNESS_UTXO=0]="NON_WITNESS_UTXO",t[t.WITNESS_UTXO=1]="WITNESS_UTXO",t[t.PARTIAL_SIG=2]="PARTIAL_SIG",t[t.SIGHASH_TYPE=3]="SIGHASH_TYPE",t[t.REDEEM_SCRIPT=4]="REDEEM_SCRIPT",t[t.WITNESS_SCRIPT=5]="WITNESS_SCRIPT",t[t.BIP32_DERIVATION=6]="BIP32_DERIVATION",t[t.FINAL_SCRIPTSIG=7]="FINAL_SCRIPTSIG",t[t.FINAL_SCRIPTWITNESS=8]="FINAL_SCRIPTWITNESS",t[t.POR_COMMITMENT=9]="POR_COMMITMENT"}(r.InputTypes||(r.InputTypes={})),r.INPUT_TYPE_NAMES=["nonWitnessUtxo","witnessUtxo","partialSig","sighashType","redeemScript","witnessScript","bip32Derivation","finalScriptSig","finalScriptWitness","porCommitment"],function(t){t[t.REDEEM_SCRIPT=0]="REDEEM_SCRIPT",t[t.WITNESS_SCRIPT=1]="WITNESS_SCRIPT",t[t.BIP32_DERIVATION=2]="BIP32_DERIVATION"}(r.OutputTypes||(r.OutputTypes={})),r.OUTPUT_TYPE_NAMES=["redeemScript","witnessScript","bip32Derivation"]},{}],25:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const n=t("./converter");function i(t,e){const r=t[e];if(void 0===r)throw new Error(`No input #${e}`);return r}function o(t,e,r,n){throw new Error(`Data for ${t} key ${e} is incorrect: Expected `+`${r} and got ${JSON.stringify(n)}`)}function s(t){return(e,r)=>{for(const i of Object.keys(e)){const s=e[i],{canAdd:a,canAddToArray:u,check:f,expected:h}=n[t+"s"][i]||{};if(f)if(!!u){if(!Array.isArray(s)||r[i]&&!Array.isArray(r[i]))throw new Error(`Key type ${i} must be an array`);s.every(f)||o(t,i,h,s);const e=r[i]||[],n=new Set;if(!s.every(t=>u(e,t,n)))throw new Error("Can not add duplicate data to array");r[i]=e.concat(s)}else{if(f(s)||o(t,i,h,s),!a(r,s))throw new Error(`Can not add duplicate data to ${t}`);r[i]=s}}}}r.checkForInput=i,r.checkForOutput=function(t,e){const r=t[e];if(void 0===r)throw new Error(`No output #${e}`);return r},r.checkHasKey=function(t,e,r){if(t.key[0]<r)throw new Error("Use the method for your specific key instead of addUnknownKeyVal*");if(e&&0!==e.filter(e=>e.key.equals(t.key)).length)throw new Error(`Duplicate Key: ${t.key.toString("hex")}`)},r.getEnumLength=function(t){let e=0;return Object.keys(t).forEach(t=>{Number(isNaN(Number(t)))&&e++}),e},r.inputCheckUncleanFinalized=function(t,e){let r=!1;if(e.nonWitnessUtxo||e.witnessUtxo){const t=!!e.redeemScript,n=!!e.witnessScript,i=!t||!!e.finalScriptSig,o=!n||!!e.finalScriptWitness,s=!!e.finalScriptSig||!!e.finalScriptWitness;r=i&&o&&s}if(!1===r)throw new Error(`Input #${t} has too much or too little data to clean`)},r.updateGlobal=s("global"),r.updateInput=s("input"),r.updateOutput=s("output"),r.addInputAttributes=function(t,e){const n=i(t,t.length-1);r.updateInput(e,n)},r.addOutputAttributes=function(t,e){const n=i(t,t.length-1);r.updateOutput(e,n)},r.defaultVersionSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Version: Invalid Transaction");return r.writeUInt32LE(t,0),r},r.defaultLocktimeSetter=function(t,r){if(!e.isBuffer(r)||r.length<4)throw new Error("Set Locktime: Invalid Transaction");return r.writeUInt32LE(t,r.length-4),r}}).call(this)}).call(this,{isBuffer:t("../../../../../../../../../usr/local/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../../../../usr/local/lib/node_modules/browserify/node_modules/is-buffer/index.js":227,"./converter":6}],26:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.bech32m=r.bech32=void 0;const n="qpzry9x8gf2tvdw0s3jn54khce6mua7l",i={};for(let t=0;t<n.length;t++){const e=n.charAt(t);i[e]=t}function o(t){const e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){let e=1;for(let r=0;r<t.length;++r){const n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=o(e)^n>>5}e=o(e);for(let r=0;r<t.length;++r){const n=t.charCodeAt(r);e=o(e)^31&n}return e}function a(t,e,r,n){let i=0,o=0;const s=(1<<r)-1,a=[];for(let n=0;n<t.length;++n)for(i=i<<e|t[n],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}function u(t){return a(t,8,5,!0)}function f(t){const e=a(t,5,8,!1);if(Array.isArray(e))return e}function h(t){const e=a(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}function c(t){let e;function r(t,r){if(r=r||90,t.length<8)return t+" too short";if(t.length>r)return"Exceeds length limit";const n=t.toLowerCase(),a=t.toUpperCase();if(t!==n&&t!==a)return"Mixed-case string "+t;const u=(t=n).lastIndexOf("1");if(-1===u)return"No separator character for "+t;if(0===u)return"Missing prefix for "+t;const f=t.slice(0,u),h=t.slice(u+1);if(h.length<6)return"Data too short";let c=s(f);if("string"==typeof c)return c;const d=[];for(let t=0;t<h.length;++t){const e=h.charAt(t),r=i[e];if(void 0===r)return"Unknown character "+e;c=o(c)^r,t+6>=h.length||d.push(r)}return c!==e?"Invalid checksum for "+t:{prefix:f,words:d}}return e="bech32"===t?1:734539939,{decodeUnsafe:function(t,e){const n=r(t,e);if("object"==typeof n)return n},decode:function(t,e){const n=r(t,e);if("object"==typeof n)return n;throw new Error(n)},encode:function(t,r,i){if(i=i||90,t.length+7+r.length>i)throw new TypeError("Exceeds length limit");let a=s(t=t.toLowerCase());if("string"==typeof a)throw new Error(a);let u=t+"1";for(let t=0;t<r.length;++t){const e=r[t];if(e>>5!=0)throw new Error("Non 5-bit word");a=o(a)^e,u+=n.charAt(e)}for(let t=0;t<6;++t)a=o(a);a^=e;for(let t=0;t<6;++t){const e=a>>5*(5-t)&31;u+=n.charAt(e)}return u},toWords:u,fromWordsUnsafe:f,fromWords:h}}r.bech32=c("bech32"),r.bech32m=c("bech32m")},{}],27:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.toOutputScript=r.fromOutputScript=r.toBech32=r.toBase58Check=r.fromBech32=r.fromBase58Check=void 0;const n=t("./networks"),i=t("./payments"),o=t("./script"),s=t("./types"),a=t("bech32"),u=t("bs58check"),{typeforce:f}=s,h=40,c=2,d=16,l=1,p=80;function b(t){const e=u.decode(t);if(e.length<21)throw new TypeError(t+" is too short");if(e.length>21)throw new TypeError(t+" is too long");return{version:e.readUInt8(0),hash:e.slice(1)}}function y(t){let r,n;try{r=a.bech32.decode(t)}catch(t){}if(r){if(0!==(n=r.words[0]))throw new TypeError(t+" uses wrong encoding")}else if(0===(n=(r=a.bech32m.decode(t)).words[0]))throw new TypeError(t+" uses wrong encoding");const i=a.bech32.fromWords(r.words.slice(1));return{version:n,prefix:r.prefix,data:e.from(i)}}function m(t,e,r){const n=a.bech32.toWords(t);return n.unshift(e),0===e?a.bech32.encode(r,n):a.bech32m.encode(r,n)}r.fromBase58Check=b,r.fromBech32=y,r.toBase58Check=function(t,r){f(s.tuple(s.Hash160bit,s.UInt8),arguments);const n=e.allocUnsafe(21);return n.writeUInt8(r,0),t.copy(n,1),u.encode(n)},r.toBech32=m,r.fromOutputScript=function(t,e){e=e||n.bitcoin;try{return i.p2pkh({output:t,network:e}).address}catch(t){}try{return i.p2sh({output:t,network:e}).address}catch(t){}try{return i.p2wpkh({output:t,network:e}).address}catch(t){}try{return i.p2wsh({output:t,network:e}).address}catch(t){}try{return function(t,e){const r=t.slice(2);if(r.length<c||r.length>h)throw new TypeError("Invalid program length for segwit address");const n=t[0]-p;if(n<l||n>d)throw new TypeError("Invalid version for segwit address");if(t[1]!==r.length)throw new TypeError("Invalid script for segwit address");return m(r,n,e.bech32)}(t,e)}catch(t){}throw new Error(o.toASM(t)+" has no matching Address")},r.toOutputScript=function(t,e){let r,s;e=e||n.bitcoin;try{r=b(t)}catch(t){}if(r){if(r.version===e.pubKeyHash)return i.p2pkh({hash:r.hash}).output;if(r.version===e.scriptHash)return i.p2sh({hash:r.hash}).output}else{try{s=y(t)}catch(t){}if(s){if(s.prefix!==e.bech32)throw new Error(t+" has an invalid prefix");if(0===s.version){if(20===s.data.length)return i.p2wpkh({hash:s.data}).output;if(32===s.data.length)return i.p2wsh({hash:s.data}).output}else if(s.version>=l&&s.version<=d&&s.data.length>=c&&s.data.length<=h)return o.compile([s.version+p,s.data])}}throw new Error(t+" has no matching Script")}}).call(this)}).call(this,t("buffer").Buffer)},{"./networks":34,"./payments":37,"./script":47,"./types":51,bech32:26,bs58check:56,buffer:223}],28:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decode=r.check=void 0,r.check=function(t){if(t.length<8)return!1;if(t.length>72)return!1;if(48!==t[0])return!1;if(t[1]!==t.length-2)return!1;if(2!==t[2])return!1;const e=t[3];if(0===e)return!1;if(5+e>=t.length)return!1;if(2!==t[4+e])return!1;const r=t[5+e];return!(0===r||6+e+r!==t.length||128&t[4]||e>1&&0===t[4]&&!(128&t[5])||128&t[e+6]||r>1&&0===t[e+6]&&!(128&t[e+7]))},r.decode=function(t){if(t.length<8)throw new Error("DER sequence length is too short");if(t.length>72)throw new Error("DER sequence length is too long");if(48!==t[0])throw new Error("Expected DER sequence");if(t[1]!==t.length-2)throw new Error("DER sequence length is invalid");if(2!==t[2])throw new Error("Expected DER integer");const e=t[3];if(0===e)throw new Error("R length is zero");if(5+e>=t.length)throw new Error("R length is too long");if(2!==t[4+e])throw new Error("Expected DER integer (2)");const r=t[5+e];if(0===r)throw new Error("S length is zero");if(6+e+r!==t.length)throw new Error("S length is invalid");if(128&t[4])throw new Error("R value is negative");if(e>1&&0===t[4]&&!(128&t[5]))throw new Error("R value excessively padded");if(128&t[e+6])throw new Error("S value is negative");if(r>1&&0===t[e+6]&&!(128&t[e+7]))throw new Error("S value excessively padded");return{r:t.slice(4,4+e),s:t.slice(6+e)}},r.encode=function(e,r){const n=e.length,i=r.length;if(0===n)throw new Error("R length is zero");if(0===i)throw new Error("S length is zero");if(n>33)throw new Error("R length is too long");if(i>33)throw new Error("S length is too long");if(128&e[0])throw new Error("R value is negative");if(128&r[0])throw new Error("S value is negative");if(n>1&&0===e[0]&&!(128&e[1]))throw new Error("R value excessively padded");if(i>1&&0===r[0]&&!(128&r[1]))throw new Error("S value excessively padded");const o=t.allocUnsafe(6+n+i);return o[0]=48,o[1]=o.length-2,o[2]=2,o[3]=e.length,e.copy(o,4),o[4+n]=2,o[5+n]=r.length,r.copy(o,6+n),o}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],29:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Block=void 0;const n=t("./bufferutils"),i=t("./crypto"),o=t("./merkle"),s=t("./transaction"),a=t("./types"),{typeforce:u}=a,f=new TypeError("Cannot compute merkle root for zero transactions"),h=new TypeError("Cannot compute witness commit for non-segwit block");class c{constructor(){this.version=1,this.prevHash=void 0,this.merkleRoot=void 0,this.timestamp=0,this.witnessCommit=void 0,this.bits=0,this.nonce=0,this.transactions=void 0}static fromBuffer(t){if(t.length<80)throw new Error("Buffer too small (< 80 bytes)");const e=new n.BufferReader(t),r=new c;if(r.version=e.readInt32(),r.prevHash=e.readSlice(32),r.merkleRoot=e.readSlice(32),r.timestamp=e.readUInt32(),r.bits=e.readUInt32(),r.nonce=e.readUInt32(),80===t.length)return r;const i=()=>{const t=s.Transaction.fromBuffer(e.buffer.slice(e.offset),!0);return e.offset+=t.byteLength(),t},o=e.readVarInt();r.transactions=[];for(let t=0;t<o;++t){const t=i();r.transactions.push(t)}const a=r.getWitnessCommit();return a&&(r.witnessCommit=a),r}static fromHex(t){return c.fromBuffer(e.from(t,"hex"))}static calculateTarget(t){const r=((4278190080&t)>>24)-3,n=8388607&t,i=e.alloc(32,0);return i.writeUIntBE(n,29-r,3),i}static calculateMerkleRoot(t,r){if(u([{getHash:a.Function}],t),0===t.length)throw f;if(r&&!d(t))throw h;const n=t.map(t=>t.getHash(r)),s=(0,o.fastMerkleRoot)(n,i.hash256);return r?i.hash256(e.concat([s,t[0].ins[0].witness[0]])):s}getWitnessCommit(){if(!d(this.transactions))return null;const t=this.transactions[0].outs.filter(t=>t.script.slice(0,6).equals(e.from("6a24aa21a9ed","hex"))).map(t=>t.script.slice(6,38));if(0===t.length)return null;const r=t[t.length-1];return r instanceof e&&32===r.length?r:null}hasWitnessCommit(){return this.witnessCommit instanceof e&&32===this.witnessCommit.length||null!==this.getWitnessCommit()}hasWitness(){return(t=this.transactions)instanceof Array&&t.some(t=>"object"==typeof t&&t.ins instanceof Array&&t.ins.some(t=>"object"==typeof t&&t.witness instanceof Array&&t.witness.length>0));var t}weight(){return 3*this.byteLength(!1,!1)+this.byteLength(!1,!0)}byteLength(t,e=!0){return t||!this.transactions?80:80+n.varuint.encodingLength(this.transactions.length)+this.transactions.reduce((t,r)=>t+r.byteLength(e),0)}getHash(){return i.hash256(this.toBuffer(!0))}getId(){return(0,n.reverseBuffer)(this.getHash()).toString("hex")}getUTCDate(){const t=new Date(0);return t.setUTCSeconds(this.timestamp),t}toBuffer(t){const r=e.allocUnsafe(this.byteLength(t)),i=new n.BufferWriter(r);return i.writeInt32(this.version),i.writeSlice(this.prevHash),i.writeSlice(this.merkleRoot),i.writeUInt32(this.timestamp),i.writeUInt32(this.bits),i.writeUInt32(this.nonce),t||!this.transactions?r:(n.varuint.encode(this.transactions.length,r,i.offset),i.offset+=n.varuint.encode.bytes,this.transactions.forEach(t=>{const e=t.byteLength();t.toBuffer(r,i.offset),i.offset+=e}),r)}toHex(t){return this.toBuffer(t).toString("hex")}checkTxRoots(){const t=this.hasWitnessCommit();return!(!t&&this.hasWitness())&&(this.__checkMerkleRoot()&&(!t||this.__checkWitnessCommit()))}checkProofOfWork(){const t=(0,n.reverseBuffer)(this.getHash()),e=c.calculateTarget(this.bits);return t.compare(e)<=0}__checkMerkleRoot(){if(!this.transactions)throw f;const t=c.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(t)}__checkWitnessCommit(){if(!this.transactions)throw f;if(!this.hasWitnessCommit())throw h;const t=c.calculateMerkleRoot(this.transactions,!0);return 0===this.witnessCommit.compare(t)}}function d(t){return t instanceof Array&&t[0]&&t[0].ins&&t[0].ins instanceof Array&&t[0].ins[0]&&t[0].ins[0].witness&&t[0].ins[0].witness instanceof Array&&t[0].ins[0].witness.length>0}r.Block=c}).call(this)}).call(this,t("buffer").Buffer)},{"./bufferutils":30,"./crypto":31,"./merkle":33,"./transaction":50,"./types":51,buffer:223}],30:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BufferReader=r.BufferWriter=r.cloneBuffer=r.reverseBuffer=r.writeUInt64LE=r.readUInt64LE=r.varuint=void 0;const n=t("./types"),{typeforce:i}=n,o=t("varuint-bitcoin");function s(t,e){if("number"!=typeof t)throw new Error("cannot write a non-number as a number");if(t<0)throw new Error("specified a negative value for writing an unsigned value");if(t>e)throw new Error("RangeError: value out of range");if(Math.floor(t)!==t)throw new Error("value has a fractional component")}function a(t,e){const r=t.readUInt32LE(e);let n=t.readUInt32LE(e+4);return s((n*=4294967296)+r,9007199254740991),n+r}function u(t,e,r){return s(e,9007199254740991),t.writeInt32LE(-1&e,r),t.writeUInt32LE(Math.floor(e/4294967296),r+4),r+8}r.varuint=o,r.readUInt64LE=a,r.writeUInt64LE=u,r.reverseBuffer=function(t){if(t.length<1)return t;let e=t.length-1,r=0;for(let n=0;n<t.length/2;n++)r=t[n],t[n]=t[e],t[e]=r,e--;return t},r.cloneBuffer=function(t){const r=e.allocUnsafe(t.length);return t.copy(r),r};class f{constructor(t,e=0){this.buffer=t,this.offset=e,i(n.tuple(n.Buffer,n.UInt32),[t,e])}static withCapacity(t){return new f(e.alloc(t))}writeUInt8(t){this.offset=this.buffer.writeUInt8(t,this.offset)}writeInt32(t){this.offset=this.buffer.writeInt32LE(t,this.offset)}writeUInt32(t){this.offset=this.buffer.writeUInt32LE(t,this.offset)}writeUInt64(t){this.offset=u(this.buffer,t,this.offset)}writeVarInt(t){o.encode(t,this.buffer,this.offset),this.offset+=o.encode.bytes}writeSlice(t){if(this.buffer.length<this.offset+t.length)throw new Error("Cannot write slice out of bounds");this.offset+=t.copy(this.buffer,this.offset)}writeVarSlice(t){this.writeVarInt(t.length),this.writeSlice(t)}writeVector(t){this.writeVarInt(t.length),t.forEach(t=>this.writeVarSlice(t))}end(){if(this.buffer.length===this.offset)return this.buffer;throw new Error(`buffer size ${this.buffer.length}, offset ${this.offset}`)}}r.BufferWriter=f;r.BufferReader=class{constructor(t,e=0){this.buffer=t,this.offset=e,i(n.tuple(n.Buffer,n.UInt32),[t,e])}readUInt8(){const t=this.buffer.readUInt8(this.offset);return this.offset++,t}readInt32(){const t=this.buffer.readInt32LE(this.offset);return this.offset+=4,t}readUInt32(){const t=this.buffer.readUInt32LE(this.offset);return this.offset+=4,t}readUInt64(){const t=a(this.buffer,this.offset);return this.offset+=8,t}readVarInt(){const t=o.decode(this.buffer,this.offset);return this.offset+=o.decode.bytes,t}readSlice(t){if(this.buffer.length<this.offset+t)throw new Error("Cannot read slice out of bounds");const e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}readVarSlice(){return this.readSlice(this.readVarInt())}readVector(){const t=this.readVarInt(),e=[];for(let r=0;r<t;r++)e.push(this.readVarSlice());return e}}}).call(this)}).call(this,t("buffer").Buffer)},{"./types":51,buffer:223,"varuint-bitcoin":220}],31:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.taggedHash=r.hash256=r.hash160=r.sha256=r.sha1=r.ripemd160=void 0;const n=t("create-hash");function i(t){try{return n("rmd160").update(t).digest()}catch(e){return n("ripemd160").update(t).digest()}}function o(t){return n("sha256").update(t).digest()}r.ripemd160=i,r.sha1=function(t){return n("sha1").update(t).digest()},r.sha256=o,r.hash160=function(t){return i(o(t))},r.hash256=function(t){return o(o(t))};const s=Object.fromEntries(["BIP0340/challenge","BIP0340/aux","BIP0340/nonce","TapLeaf","TapBranch","TapSighash","TapTweak","KeyAgg list","KeyAgg coefficient"].map(t=>{const r=o(e.from(t));return[t,e.concat([r,r])]}));r.taggedHash=function(t,r){return o(e.concat([s[t],r]))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223,"create-hash":58}],32:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Transaction=r.opcodes=r.Psbt=r.Block=r.script=r.payments=r.networks=r.crypto=r.address=void 0;const n=t("./address");r.address=n;const i=t("./crypto");r.crypto=i;const o=t("./networks");r.networks=o;const s=t("./payments");r.payments=s;const a=t("./script");r.script=a;var u=t("./block");Object.defineProperty(r,"Block",{enumerable:!0,get:function(){return u.Block}});var f=t("./psbt");Object.defineProperty(r,"Psbt",{enumerable:!0,get:function(){return f.Psbt}});var h=t("./ops");Object.defineProperty(r,"opcodes",{enumerable:!0,get:function(){return h.OPS}});var c=t("./transaction");Object.defineProperty(r,"Transaction",{enumerable:!0,get:function(){return c.Transaction}})},{"./address":27,"./block":29,"./crypto":31,"./networks":34,"./ops":35,"./payments":37,"./psbt":45,"./script":47,"./transaction":50}],33:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fastMerkleRoot=void 0,r.fastMerkleRoot=function(e,r){if(!Array.isArray(e))throw TypeError("Expected values Array");if("function"!=typeof r)throw TypeError("Expected digest Function");let n=e.length;const i=e.concat();for(;n>1;){let e=0;for(let o=0;o<n;o+=2,++e){const s=i[o],a=o+1===n?s:i[o+1],u=t.concat([s,a]);i[e]=r(u)}n=e}return i[0]}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],34:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.testnet=r.regtest=r.bitcoin=void 0,r.bitcoin={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},r.regtest={messagePrefix:"Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},r.testnet={messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}},{}],35:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.REVERSE_OPS=r.OPS=void 0;const n={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255};r.OPS=n;const i={};r.REVERSE_OPS=i;for(const t of Object.keys(n)){i[n[t]]=t}},{}],36:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2data=void 0;const n=t("../networks"),i=t("../script"),o=t("../types"),s=t("./lazy"),a=i.OPS;r.p2data=function(t,e){if(!t.data&&!t.output)throw new TypeError("Not enough data");e=Object.assign({validate:!0},e||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),data:o.typeforce.maybe(o.typeforce.arrayOf(o.typeforce.Buffer))},t);const r={name:"embed",network:t.network||n.bitcoin};if(s.prop(r,"output",()=>{if(t.data)return i.compile([a.OP_RETURN].concat(t.data))}),s.prop(r,"data",()=>{if(t.output)return i.decompile(t.output).slice(1)}),e.validate&&t.output){const e=i.decompile(t.output);if(e[0]!==a.OP_RETURN)throw new TypeError("Output is invalid");if(!e.slice(1).every(o.typeforce.Buffer))throw new TypeError("Output is invalid");if(t.data&&!function(t,e){return t.length===e.length&&t.every((t,r)=>t.equals(e[r]))}(t.data,r.data))throw new TypeError("Data mismatch")}return Object.assign(r,t)}},{"../networks":34,"../script":47,"../types":51,"./lazy":38}],37:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wsh=r.p2wpkh=r.p2sh=r.p2pkh=r.p2pk=r.p2ms=r.embed=void 0;const n=t("./embed");Object.defineProperty(r,"embed",{enumerable:!0,get:function(){return n.p2data}});const i=t("./p2ms");Object.defineProperty(r,"p2ms",{enumerable:!0,get:function(){return i.p2ms}});const o=t("./p2pk");Object.defineProperty(r,"p2pk",{enumerable:!0,get:function(){return o.p2pk}});const s=t("./p2pkh");Object.defineProperty(r,"p2pkh",{enumerable:!0,get:function(){return s.p2pkh}});const a=t("./p2sh");Object.defineProperty(r,"p2sh",{enumerable:!0,get:function(){return a.p2sh}});const u=t("./p2wpkh");Object.defineProperty(r,"p2wpkh",{enumerable:!0,get:function(){return u.p2wpkh}});const f=t("./p2wsh");Object.defineProperty(r,"p2wsh",{enumerable:!0,get:function(){return f.p2wsh}})},{"./embed":36,"./p2ms":39,"./p2pk":40,"./p2pkh":41,"./p2sh":42,"./p2wpkh":43,"./p2wsh":44}],38:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.value=r.prop=void 0,r.prop=function(t,e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get(){const t=r.call(this);return this[e]=t,t},set(t){Object.defineProperty(this,e,{configurable:!0,enumerable:!0,value:t,writable:!0})}})},r.value=function(t){let e;return()=>void 0!==e?e:e=t()}},{}],39:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2ms=void 0;const n=t("../networks"),i=t("../script"),o=t("../types"),s=t("./lazy"),a=i.OPS,u=a.OP_RESERVED;function f(t,e){return t.length===e.length&&t.every((t,r)=>t.equals(e[r]))}r.p2ms=function(t,e){if(!(t.input||t.output||t.pubkeys&&void 0!==t.m||t.signatures))throw new TypeError("Not enough data");function r(t){return i.isCanonicalScriptSignature(t)||void 0!==(e.allowIncomplete&&t===a.OP_0)}e=Object.assign({validate:!0},e||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),m:o.typeforce.maybe(o.typeforce.Number),n:o.typeforce.maybe(o.typeforce.Number),output:o.typeforce.maybe(o.typeforce.Buffer),pubkeys:o.typeforce.maybe(o.typeforce.arrayOf(o.isPoint)),signatures:o.typeforce.maybe(o.typeforce.arrayOf(r)),input:o.typeforce.maybe(o.typeforce.Buffer)},t);const h={network:t.network||n.bitcoin};let c=[],d=!1;function l(t){d||(d=!0,c=i.decompile(t),h.m=c[0]-u,h.n=c[c.length-2]-u,h.pubkeys=c.slice(1,-2))}if(s.prop(h,"output",()=>{if(t.m&&h.n&&t.pubkeys)return i.compile([].concat(u+t.m,t.pubkeys,u+h.n,a.OP_CHECKMULTISIG))}),s.prop(h,"m",()=>{if(h.output)return l(h.output),h.m}),s.prop(h,"n",()=>{if(h.pubkeys)return h.pubkeys.length}),s.prop(h,"pubkeys",()=>{if(t.output)return l(t.output),h.pubkeys}),s.prop(h,"signatures",()=>{if(t.input)return i.decompile(t.input).slice(1)}),s.prop(h,"input",()=>{if(t.signatures)return i.compile([a.OP_0].concat(t.signatures))}),s.prop(h,"witness",()=>{if(h.input)return[]}),s.prop(h,"name",()=>{if(h.m&&h.n)return`p2ms(${h.m} of ${h.n})`}),e.validate){if(t.output){if(l(t.output),!o.typeforce.Number(c[0]))throw new TypeError("Output is invalid");if(!o.typeforce.Number(c[c.length-2]))throw new TypeError("Output is invalid");if(c[c.length-1]!==a.OP_CHECKMULTISIG)throw new TypeError("Output is invalid");if(h.m<=0||h.n>16||h.m>h.n||h.n!==c.length-3)throw new TypeError("Output is invalid");if(!h.pubkeys.every(t=>(0,o.isPoint)(t)))throw new TypeError("Output is invalid");if(void 0!==t.m&&t.m!==h.m)throw new TypeError("m mismatch");if(void 0!==t.n&&t.n!==h.n)throw new TypeError("n mismatch");if(t.pubkeys&&!f(t.pubkeys,h.pubkeys))throw new TypeError("Pubkeys mismatch")}if(t.pubkeys){if(void 0!==t.n&&t.n!==t.pubkeys.length)throw new TypeError("Pubkey count mismatch");if(h.n=t.pubkeys.length,h.n<h.m)throw new TypeError("Pubkey count cannot be less than m")}if(t.signatures){if(t.signatures.length<h.m)throw new TypeError("Not enough signatures provided");if(t.signatures.length>h.m)throw new TypeError("Too many signatures provided")}if(t.input){if(t.input[0]!==a.OP_0)throw new TypeError("Input is invalid");if(0===h.signatures.length||!h.signatures.every(r))throw new TypeError("Input has invalid signature(s)");if(t.signatures&&!f(t.signatures,h.signatures))throw new TypeError("Signature mismatch");if(void 0!==t.m&&t.m!==t.signatures.length)throw new TypeError("Signature count mismatch")}}return Object.assign(h,t)}},{"../networks":34,"../script":47,"../types":51,"./lazy":38}],40:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2pk=void 0;const n=t("../networks"),i=t("../script"),o=t("../types"),s=t("./lazy"),a=i.OPS;r.p2pk=function(t,e){if(!(t.input||t.output||t.pubkey||t.input||t.signature))throw new TypeError("Not enough data");e=Object.assign({validate:!0},e||{}),(0,o.typeforce)({network:o.typeforce.maybe(o.typeforce.Object),output:o.typeforce.maybe(o.typeforce.Buffer),pubkey:o.typeforce.maybe(o.isPoint),signature:o.typeforce.maybe(i.isCanonicalScriptSignature),input:o.typeforce.maybe(o.typeforce.Buffer)},t);const r=s.value(()=>i.decompile(t.input)),u={name:"p2pk",network:t.network||n.bitcoin};if(s.prop(u,"output",()=>{if(t.pubkey)return i.compile([t.pubkey,a.OP_CHECKSIG])}),s.prop(u,"pubkey",()=>{if(t.output)return t.output.slice(1,-1)}),s.prop(u,"signature",()=>{if(t.input)return r()[0]}),s.prop(u,"input",()=>{if(t.signature)return i.compile([t.signature])}),s.prop(u,"witness",()=>{if(u.input)return[]}),e.validate){if(t.output){if(t.output[t.output.length-1]!==a.OP_CHECKSIG)throw new TypeError("Output is invalid");if(!(0,o.isPoint)(u.pubkey))throw new TypeError("Output pubkey is invalid");if(t.pubkey&&!t.pubkey.equals(u.pubkey))throw new TypeError("Pubkey mismatch")}if(t.signature&&t.input&&!t.input.equals(u.input))throw new TypeError("Signature mismatch");if(t.input){if(1!==r().length)throw new TypeError("Input is invalid");if(!i.isCanonicalScriptSignature(u.signature))throw new TypeError("Input has invalid signature")}}return Object.assign(u,t)}},{"../networks":34,"../script":47,"../types":51,"./lazy":38}],41:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2pkh=void 0;const n=t("../crypto"),i=t("../networks"),o=t("../script"),s=t("../types"),a=t("./lazy"),u=t("bs58check"),f=o.OPS;r.p2pkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),output:s.typeforce.maybe(s.typeforce.BufferN(25)),pubkey:s.typeforce.maybe(s.isPoint),signature:s.typeforce.maybe(o.isCanonicalScriptSignature),input:s.typeforce.maybe(s.typeforce.Buffer)},t);const h=a.value(()=>{const e=u.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),c=a.value(()=>o.decompile(t.input)),d=t.network||i.bitcoin,l={name:"p2pkh",network:d};if(a.prop(l,"address",()=>{if(!l.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(d.pubKeyHash,0),l.hash.copy(t,1),u.encode(t)}),a.prop(l,"hash",()=>t.output?t.output.slice(3,23):t.address?h().hash:t.pubkey||l.pubkey?n.hash160(t.pubkey||l.pubkey):void 0),a.prop(l,"output",()=>{if(l.hash)return o.compile([f.OP_DUP,f.OP_HASH160,l.hash,f.OP_EQUALVERIFY,f.OP_CHECKSIG])}),a.prop(l,"pubkey",()=>{if(t.input)return c()[1]}),a.prop(l,"signature",()=>{if(t.input)return c()[0]}),a.prop(l,"input",()=>{if(t.pubkey&&t.signature)return o.compile([t.signature,t.pubkey])}),a.prop(l,"witness",()=>{if(l.input)return[]}),r.validate){let r=e.from([]);if(t.address){if(h().version!==d.pubKeyHash)throw new TypeError("Invalid version or Network mismatch");if(20!==h().hash.length)throw new TypeError("Invalid address");r=h().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(25!==t.output.length||t.output[0]!==f.OP_DUP||t.output[1]!==f.OP_HASH160||20!==t.output[2]||t.output[23]!==f.OP_EQUALVERIFY||t.output[24]!==f.OP_CHECKSIG)throw new TypeError("Output is invalid");const e=t.output.slice(3,23);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.input){const e=c();if(2!==e.length)throw new TypeError("Input is invalid");if(!o.isCanonicalScriptSignature(e[0]))throw new TypeError("Input has invalid signature");if(!(0,s.isPoint)(e[1]))throw new TypeError("Input has invalid pubkey");if(t.signature&&!t.signature.equals(e[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(e[1]))throw new TypeError("Pubkey mismatch");const i=n.hash160(e[1]);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch")}}return Object.assign(l,t)}}).call(this)}).call(this,t("buffer").Buffer)},{"../crypto":31,"../networks":34,"../script":47,"../types":51,"./lazy":38,bs58check:56,buffer:223}],42:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2sh=void 0;const n=t("../crypto"),i=t("../networks"),o=t("../script"),s=t("../types"),a=t("./lazy"),u=t("bs58check"),f=o.OPS;r.p2sh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.input))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),output:s.typeforce.maybe(s.typeforce.BufferN(23)),redeem:s.typeforce.maybe({network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.Buffer),input:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))}),input:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},t);let h=t.network;h||(h=t.redeem&&t.redeem.network||i.bitcoin);const c={network:h},d=a.value(()=>{const e=u.decode(t.address);return{version:e.readUInt8(0),hash:e.slice(1)}}),l=a.value(()=>o.decompile(t.input)),p=a.value(()=>{const e=l();return{network:h,output:e[e.length-1],input:o.compile(e.slice(0,-1)),witness:t.witness||[]}});if(a.prop(c,"address",()=>{if(!c.hash)return;const t=e.allocUnsafe(21);return t.writeUInt8(c.network.scriptHash,0),c.hash.copy(t,1),u.encode(t)}),a.prop(c,"hash",()=>t.output?t.output.slice(2,22):t.address?d().hash:c.redeem&&c.redeem.output?n.hash160(c.redeem.output):void 0),a.prop(c,"output",()=>{if(c.hash)return o.compile([f.OP_HASH160,c.hash,f.OP_EQUAL])}),a.prop(c,"redeem",()=>{if(t.input)return p()}),a.prop(c,"input",()=>{if(t.redeem&&t.redeem.input&&t.redeem.output)return o.compile([].concat(o.decompile(t.redeem.input),t.redeem.output))}),a.prop(c,"witness",()=>c.redeem&&c.redeem.witness?c.redeem.witness:c.input?[]:void 0),a.prop(c,"name",()=>{const t=["p2sh"];return void 0!==c.redeem&&void 0!==c.redeem.name&&t.push(c.redeem.name),t.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().version!==h.scriptHash)throw new TypeError("Invalid version or Network mismatch");if(20!==d().hash.length)throw new TypeError("Invalid address");r=d().hash}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(23!==t.output.length||t.output[0]!==f.OP_HASH160||20!==t.output[1]||t.output[22]!==f.OP_EQUAL)throw new TypeError("Output is invalid");const e=t.output.slice(2,22);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}const i=t=>{if(t.output){const e=o.decompile(t.output);if(!e||e.length<1)throw new TypeError("Redeem.output too short");const i=n.hash160(t.output);if(r.length>0&&!r.equals(i))throw new TypeError("Hash mismatch");r=i}if(t.input){const e=t.input.length>0,r=t.witness&&t.witness.length>0;if(!e&&!r)throw new TypeError("Empty input");if(e&&r)throw new TypeError("Input and witness provided");if(e){const e=o.decompile(t.input);if(!o.isPushOnly(e))throw new TypeError("Non push-only scriptSig")}}};if(t.input){const t=l();if(!t||t.length<1)throw new TypeError("Input too short");if(!e.isBuffer(p().output))throw new TypeError("Input is invalid");i(p())}if(t.redeem){if(t.redeem.network&&t.redeem.network!==h)throw new TypeError("Network mismatch");if(t.input){const e=p();if(t.redeem.output&&!t.redeem.output.equals(e.output))throw new TypeError("Redeem.output mismatch");if(t.redeem.input&&!t.redeem.input.equals(e.input))throw new TypeError("Redeem.input mismatch")}i(t.redeem)}if(t.witness&&t.redeem&&t.redeem.witness&&!function(t,e){return t.length===e.length&&t.every((t,r)=>t.equals(e[r]))}(t.redeem.witness,t.witness))throw new TypeError("Witness and redeem.witness mismatch")}return Object.assign(c,t)}}).call(this)}).call(this,t("buffer").Buffer)},{"../crypto":31,"../networks":34,"../script":47,"../types":51,"./lazy":38,bs58check:56,buffer:223}],43:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wpkh=void 0;const n=t("../crypto"),i=t("../networks"),o=t("../script"),s=t("../types"),a=t("./lazy"),u=t("bech32"),f=o.OPS,h=e.alloc(0);r.p2wpkh=function(t,r){if(!(t.address||t.hash||t.output||t.pubkey||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,s.typeforce)({address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(20)),input:s.typeforce.maybe(s.typeforce.BufferN(0)),network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.BufferN(22)),pubkey:s.typeforce.maybe(s.isPoint),signature:s.typeforce.maybe(o.isCanonicalScriptSignature),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},t);const c=a.value(()=>{const r=u.bech32.decode(t.address),n=r.words.shift(),i=u.bech32.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),d=t.network||i.bitcoin,l={name:"p2wpkh",network:d};if(a.prop(l,"address",()=>{if(!l.hash)return;const t=u.bech32.toWords(l.hash);return t.unshift(0),u.bech32.encode(d.bech32,t)}),a.prop(l,"hash",()=>t.output?t.output.slice(2,22):t.address?c().data:t.pubkey||l.pubkey?n.hash160(t.pubkey||l.pubkey):void 0),a.prop(l,"output",()=>{if(l.hash)return o.compile([f.OP_0,l.hash])}),a.prop(l,"pubkey",()=>t.pubkey?t.pubkey:t.witness?t.witness[1]:void 0),a.prop(l,"signature",()=>{if(t.witness)return t.witness[0]}),a.prop(l,"input",()=>{if(l.witness)return h}),a.prop(l,"witness",()=>{if(t.pubkey&&t.signature)return[t.signature,t.pubkey]}),r.validate){let r=e.from([]);if(t.address){if(d&&d.bech32!==c().prefix)throw new TypeError("Invalid prefix or Network mismatch");if(0!==c().version)throw new TypeError("Invalid address version");if(20!==c().data.length)throw new TypeError("Invalid address data");r=c().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(22!==t.output.length||t.output[0]!==f.OP_0||20!==t.output[1])throw new TypeError("Output is invalid");if(r.length>0&&!r.equals(t.output.slice(2)))throw new TypeError("Hash mismatch");r=t.output.slice(2)}if(t.pubkey){const e=n.hash160(t.pubkey);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");if(r=e,!(0,s.isPoint)(t.pubkey)||33!==t.pubkey.length)throw new TypeError("Invalid pubkey for p2wpkh")}if(t.witness){if(2!==t.witness.length)throw new TypeError("Witness is invalid");if(!o.isCanonicalScriptSignature(t.witness[0]))throw new TypeError("Witness has invalid signature");if(!(0,s.isPoint)(t.witness[1])||33!==t.witness[1].length)throw new TypeError("Witness has invalid pubkey");if(t.signature&&!t.signature.equals(t.witness[0]))throw new TypeError("Signature mismatch");if(t.pubkey&&!t.pubkey.equals(t.witness[1]))throw new TypeError("Pubkey mismatch");const e=n.hash160(t.witness[1]);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch")}}return Object.assign(l,t)}}).call(this)}).call(this,t("buffer").Buffer)},{"../crypto":31,"../networks":34,"../script":47,"../types":51,"./lazy":38,bech32:26,buffer:223}],44:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.p2wsh=void 0;const n=t("../crypto"),i=t("../networks"),o=t("../script"),s=t("../types"),a=t("./lazy"),u=t("bech32"),f=o.OPS,h=e.alloc(0);function c(t){return!(!e.isBuffer(t)||65!==t.length||4!==t[0]||!(0,s.isPoint)(t))}r.p2wsh=function(t,r){if(!(t.address||t.hash||t.output||t.redeem||t.witness))throw new TypeError("Not enough data");r=Object.assign({validate:!0},r||{}),(0,s.typeforce)({network:s.typeforce.maybe(s.typeforce.Object),address:s.typeforce.maybe(s.typeforce.String),hash:s.typeforce.maybe(s.typeforce.BufferN(32)),output:s.typeforce.maybe(s.typeforce.BufferN(34)),redeem:s.typeforce.maybe({input:s.typeforce.maybe(s.typeforce.Buffer),network:s.typeforce.maybe(s.typeforce.Object),output:s.typeforce.maybe(s.typeforce.Buffer),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))}),input:s.typeforce.maybe(s.typeforce.BufferN(0)),witness:s.typeforce.maybe(s.typeforce.arrayOf(s.typeforce.Buffer))},t);const d=a.value(()=>{const r=u.bech32.decode(t.address),n=r.words.shift(),i=u.bech32.fromWords(r.words);return{version:n,prefix:r.prefix,data:e.from(i)}}),l=a.value(()=>o.decompile(t.redeem.input));let p=t.network;p||(p=t.redeem&&t.redeem.network||i.bitcoin);const b={network:p};if(a.prop(b,"address",()=>{if(!b.hash)return;const t=u.bech32.toWords(b.hash);return t.unshift(0),u.bech32.encode(p.bech32,t)}),a.prop(b,"hash",()=>t.output?t.output.slice(2):t.address?d().data:b.redeem&&b.redeem.output?n.sha256(b.redeem.output):void 0),a.prop(b,"output",()=>{if(b.hash)return o.compile([f.OP_0,b.hash])}),a.prop(b,"redeem",()=>{if(t.witness)return{output:t.witness[t.witness.length-1],input:h,witness:t.witness.slice(0,-1)}}),a.prop(b,"input",()=>{if(b.witness)return h}),a.prop(b,"witness",()=>{if(t.redeem&&t.redeem.input&&t.redeem.input.length>0&&t.redeem.output&&t.redeem.output.length>0){const e=o.toStack(l());return b.redeem=Object.assign({witness:e},t.redeem),b.redeem.input=h,[].concat(e,t.redeem.output)}if(t.redeem&&t.redeem.output&&t.redeem.witness)return[].concat(t.redeem.witness,t.redeem.output)}),a.prop(b,"name",()=>{const t=["p2wsh"];return void 0!==b.redeem&&void 0!==b.redeem.name&&t.push(b.redeem.name),t.join("-")}),r.validate){let r=e.from([]);if(t.address){if(d().prefix!==p.bech32)throw new TypeError("Invalid prefix or Network mismatch");if(0!==d().version)throw new TypeError("Invalid address version");if(32!==d().data.length)throw new TypeError("Invalid address data");r=d().data}if(t.hash){if(r.length>0&&!r.equals(t.hash))throw new TypeError("Hash mismatch");r=t.hash}if(t.output){if(34!==t.output.length||t.output[0]!==f.OP_0||32!==t.output[1])throw new TypeError("Output is invalid");const e=t.output.slice(2);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem){if(t.redeem.network&&t.redeem.network!==p)throw new TypeError("Network mismatch");if(t.redeem.input&&t.redeem.input.length>0&&t.redeem.witness&&t.redeem.witness.length>0)throw new TypeError("Ambiguous witness source");if(t.redeem.output){if(0===o.decompile(t.redeem.output).length)throw new TypeError("Redeem.output is invalid");const e=n.sha256(t.redeem.output);if(r.length>0&&!r.equals(e))throw new TypeError("Hash mismatch");r=e}if(t.redeem.input&&!o.isPushOnly(l()))throw new TypeError("Non push-only scriptSig");if(t.witness&&t.redeem.witness&&!function(t,e){return t.length===e.length&&t.every((t,r)=>t.equals(e[r]))}(t.witness,t.redeem.witness))throw new TypeError("Witness and redeem.witness mismatch");if(t.redeem.input&&l().some(c)||t.redeem.output&&(o.decompile(t.redeem.output)||[]).some(c))throw new TypeError("redeem.input or redeem.output contains uncompressed pubkey")}if(t.witness&&t.witness.length>0){const e=t.witness[t.witness.length-1];if(t.redeem&&t.redeem.output&&!t.redeem.output.equals(e))throw new TypeError("Witness and redeem.output mismatch");if(t.witness.some(c)||(o.decompile(e)||[]).some(c))throw new TypeError("Witness contains uncompressed pubkey")}}return Object.assign(b,t)}}).call(this)}).call(this,t("buffer").Buffer)},{"../crypto":31,"../networks":34,"../script":47,"../types":51,"./lazy":38,bech32:26,buffer:223}],45:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Psbt=void 0;const n=t("bip174"),i=t("bip174/src/lib/converter/varint"),o=t("bip174/src/lib/utils"),s=t("./address"),a=t("./bufferutils"),u=t("./crypto"),f=t("./networks"),h=t("./payments"),c=t("./script"),d=t("./transaction"),l={network:f.bitcoin,maximumFeeRate:5e3};class p{constructor(t={},e=new n.Psbt(new y)){this.data=e,this.opts=Object.assign({},l,t),this.__CACHE={__NON_WITNESS_UTXO_TX_CACHE:[],__NON_WITNESS_UTXO_BUF_CACHE:[],__TX_IN_CACHE:{},__TX:this.data.globalMap.unsignedTx.tx,__UNSAFE_SIGN_NONSEGWIT:!1},0===this.data.inputs.length&&this.setVersion(2);const r=(t,e,r,n)=>Object.defineProperty(t,e,{enumerable:r,writable:n});r(this,"__CACHE",!1,!0),r(this,"opts",!1,!0)}static fromBase64(t,r={}){const n=e.from(t,"base64");return this.fromBuffer(n,r)}static fromHex(t,r={}){const n=e.from(t,"hex");return this.fromBuffer(n,r)}static fromBuffer(t,e={}){const r=n.Psbt.fromBuffer(t,b),i=new p(e,r);var o,s;return o=i.__CACHE.__TX,s=i.__CACHE,o.ins.forEach(t=>{P(s,t)}),i}get inputCount(){return this.data.inputs.length}get version(){return this.__CACHE.__TX.version}set version(t){this.setVersion(t)}get locktime(){return this.__CACHE.__TX.locktime}set locktime(t){this.setLocktime(t)}get txInputs(){return this.__CACHE.__TX.ins.map(t=>({hash:(0,a.cloneBuffer)(t.hash),index:t.index,sequence:t.sequence}))}get txOutputs(){return this.__CACHE.__TX.outs.map(t=>{let e;try{e=(0,s.fromOutputScript)(t.script,this.opts.network)}catch(t){}return{script:(0,a.cloneBuffer)(t.script),value:t.value,address:e}})}combine(...t){return this.data.combine(...t.map(t=>t.data)),this}clone(){const t=p.fromBuffer(this.data.toBuffer());return t.opts=JSON.parse(JSON.stringify(this.opts)),t}setMaximumFeeRate(t){T(t),this.opts.maximumFeeRate=t}setVersion(t){T(t),x(this.data.inputs,"setVersion");const e=this.__CACHE;return e.__TX.version=t,e.__EXTRACTED_TX=void 0,this}setLocktime(t){T(t),x(this.data.inputs,"setLocktime");const e=this.__CACHE;return e.__TX.locktime=t,e.__EXTRACTED_TX=void 0,this}setInputSequence(t,e){T(e),x(this.data.inputs,"setInputSequence");const r=this.__CACHE;if(r.__TX.ins.length<=t)throw new Error("Input index too high");return r.__TX.ins[t].sequence=e,r.__EXTRACTED_TX=void 0,this}addInputs(t){return t.forEach(t=>this.addInput(t)),this}addInput(t){if(arguments.length>1||!t||void 0===t.hash||void 0===t.index)throw new Error("Invalid arguments for Psbt.addInput. Requires single object with at least [hash] and [index]");x(this.data.inputs,"addInput"),t.witnessScript&&G(t.witnessScript);const e=this.__CACHE;this.data.addInput(t),P(e,e.__TX.ins[e.__TX.ins.length-1]);const r=this.data.inputs.length-1,n=this.data.inputs[r];return n.nonWitnessUtxo&&q(this.__CACHE,n,r),e.__FEE=void 0,e.__FEE_RATE=void 0,e.__EXTRACTED_TX=void 0,this}addOutputs(t){return t.forEach(t=>this.addOutput(t)),this}addOutput(t){if(arguments.length>1||!t||void 0===t.value||void 0===t.address&&void 0===t.script)throw new Error("Invalid arguments for Psbt.addOutput. Requires single object with at least [script or address] and [value]");x(this.data.inputs,"addOutput");const{address:e}=t;if("string"==typeof e){const{network:r}=this.opts,n=(0,s.toOutputScript)(e,r);t=Object.assign(t,{script:n})}const r=this.__CACHE;return this.data.addOutput(t),r.__FEE=void 0,r.__FEE_RATE=void 0,r.__EXTRACTED_TX=void 0,this}extractTransaction(t){if(!this.data.inputs.every(w))throw new Error("Not finalized");const e=this.__CACHE;if(t||function(t,e,r){const n=e.__FEE_RATE||t.getFeeRate(),i=e.__EXTRACTED_TX.virtualSize(),o=n*i;if(n>=r.maximumFeeRate)throw new Error(`Warning: You are paying around ${(o/1e8).toFixed(8)} in `+`fees, which is ${n} satoshi per byte for a transaction `+`with a VSize of ${i} bytes (segwit counted as 0.25 byte per `+"byte). Use setMaximumFeeRate method to raise your threshold, or pass true to the first arg of extractTransaction.")}(this,e,this.opts),e.__EXTRACTED_TX)return e.__EXTRACTED_TX;const r=e.__TX.clone();return F(this.data.inputs,r,e,!0),r}getFeeRate(){return U("__FEE_RATE","fee rate",this.data.inputs,this.__CACHE)}getFee(){return U("__FEE","fee",this.data.inputs,this.__CACHE)}finalizeAllInputs(){return(0,o.checkForInput)(this.data.inputs,0),Y(this.data.inputs.length).forEach(t=>this.finalizeInput(t)),this}finalizeInput(t,e=function(t,e,r,n,i,o){const s=Z(r);if(!function(t,e,r){switch(r){case"pubkey":case"pubkeyhash":case"witnesspubkeyhash":return g(1,t.partialSig);case"multisig":const n=h.p2ms({output:e});return g(n.m,t.partialSig,n.pubkeys);default:return!1}}(e,r,s))throw new Error(`Can not finalize input #${t}`);return function(t,e,r,n,i,o){let s,a;const u=function(t,e,r){let n;switch(e){case"multisig":const i=function(t,e){return h.p2ms({output:t}).pubkeys.map(t=>(e.filter(e=>e.pubkey.equals(t))[0]||{}).signature).filter(t=>!!t)}(t,r);n=h.p2ms({output:t,signatures:i});break;case"pubkey":n=h.p2pk({output:t,signature:r[0].signature});break;case"pubkeyhash":n=h.p2pkh({output:t,pubkey:r[0].pubkey,signature:r[0].signature});break;case"witnesspubkeyhash":n=h.p2wpkh({output:t,pubkey:r[0].pubkey,signature:r[0].signature})}return n}(t,e,r),f=o?h.p2wsh({redeem:u}):null,c=i?h.p2sh({redeem:f||u}):null;n?(a=D(f?f.witness:u.witness),c&&(s=c.input)):s=c?c.input:u.input;return{finalScriptSig:s,finalScriptWitness:a}}(r,s,e.partialSig,n,i,o)}){const r=(0,o.checkForInput)(this.data.inputs,t),{script:n,isP2SH:i,isP2WSH:s,isSegwit:a}=function(t,e,r){const n=r.__TX,i={script:null,isSegwit:!1,isP2SH:!1,isP2WSH:!1};if(i.isP2SH=!!e.redeemScript,i.isP2WSH=!!e.witnessScript,e.witnessScript)i.script=e.witnessScript;else if(e.redeemScript)i.script=e.redeemScript;else if(e.nonWitnessUtxo){const o=z(r,e,t),s=n.ins[t].index;i.script=o.outs[s].script}else e.witnessUtxo&&(i.script=e.witnessUtxo.script);(e.witnessScript||M(i.script))&&(i.isSegwit=!0);return i}(t,r,this.__CACHE);if(!n)throw new Error(`No script found for input #${t}`);!function(t){if(!t.sighashType||!t.partialSig)return;const{partialSig:e,sighashType:r}=t;e.forEach(t=>{const{hashType:e}=c.signature.decode(t.signature);if(r!==e)throw new Error("Signature sighash does not match input sighash type")})}(r);const{finalScriptSig:u,finalScriptWitness:f}=e(t,r,n,a,i,s);if(u&&this.data.updateInput(t,{finalScriptSig:u}),f&&this.data.updateInput(t,{finalScriptWitness:f}),!u&&!f)throw new Error(`Unknown error finalizing input #${t}`);return this.data.clearFinalizedInput(t),this}getInputType(t){const r=(0,o.checkForInput)(this.data.inputs,t),n=W(K(t,r,this.__CACHE),t,"input",r.redeemScript||function(t){if(!t)return;const r=c.decompile(t);if(!r)return;const n=r[r.length-1];if(!e.isBuffer(n)||V(n)||(i=n,c.isCanonicalScriptSignature(i)))return;var i;if(!c.decompile(n))return;return n}(r.finalScriptSig),r.witnessScript||function(t){if(!t)return;const e=H(t),r=e[e.length-1];if(V(r))return;if(!c.decompile(r))return;return r}(r.finalScriptWitness));return("raw"===n.type?"":n.type+"-")+Z(n.meaningfulScript)}inputHasPubkey(t,e){return function(t,e,r,n){const i=K(r,e,n),{meaningfulScript:o}=W(i,r,"input",e.redeemScript,e.witnessScript);return X(t,o)}(e,(0,o.checkForInput)(this.data.inputs,t),t,this.__CACHE)}inputHasHDKey(t,e){const r=(0,o.checkForInput)(this.data.inputs,t),n=I(e);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}outputHasPubkey(t,e){return function(t,e,r,n){const i=n.__TX.outs[r].script,{meaningfulScript:o}=W(i,r,"output",e.redeemScript,e.witnessScript);return X(t,o)}(e,(0,o.checkForOutput)(this.data.outputs,t),t,this.__CACHE)}outputHasHDKey(t,e){const r=(0,o.checkForOutput)(this.data.outputs,t),n=I(e);return!!r.bip32Derivation&&r.bip32Derivation.some(n)}validateSignaturesOfAllInputs(t){return(0,o.checkForInput)(this.data.inputs,0),Y(this.data.inputs.length).map(e=>this.validateSignaturesOfInput(e,t)).reduce((t,e)=>!0===e&&t,!0)}validateSignaturesOfInput(t,e,r){const n=this.data.inputs[t],i=(n||{}).partialSig;if(!n||!i||i.length<1)throw new Error("No signatures to validate");if("function"!=typeof e)throw new Error("Need validator function to validate signatures");const o=r?i.filter(t=>t.pubkey.equals(r)):i;if(o.length<1)throw new Error("No signatures for this pubkey");const s=[];let a,u,f;for(const r of o){const i=c.signature.decode(r.signature),{hash:o,script:h}=f!==i.hashType?j(t,Object.assign({},n,{sighashType:i.hashType}),this.__CACHE,!0):{hash:a,script:u};f=i.hashType,a=o,u=h,O(r.pubkey,h,"verify"),s.push(e(r.pubkey,o,i.signature))}return s.every(t=>!0===t)}signAllInputsHD(t,e=[d.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey||!t.fingerprint)throw new Error("Need HDSigner to sign input");const r=[];for(const n of Y(this.data.inputs.length))try{this.signInputHD(n,t,e),r.push(!0)}catch(t){r.push(!1)}if(r.every(t=>!1===t))throw new Error("No inputs were signed");return this}signAllInputsHDAsync(t,e=[d.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!t||!t.publicKey||!t.fingerprint)return n(new Error("Need HDSigner to sign input"));const i=[],o=[];for(const r of Y(this.data.inputs.length))o.push(this.signInputHDAsync(r,t,e).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(t=>!1===t))return n(new Error("No inputs were signed"));r()})})}signInputHD(t,e,r=[d.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey||!e.fingerprint)throw new Error("Need HDSigner to sign input");return L(t,this.data.inputs,e).forEach(e=>this.signInput(t,e,r)),this}signInputHDAsync(t,e,r=[d.Transaction.SIGHASH_ALL]){return new Promise((n,i)=>{if(!e||!e.publicKey||!e.fingerprint)return i(new Error("Need HDSigner to sign input"));const o=L(t,this.data.inputs,e).map(e=>this.signInputAsync(t,e,r));return Promise.all(o).then(()=>{n()}).catch(i)})}signAllInputs(t,e=[d.Transaction.SIGHASH_ALL]){if(!t||!t.publicKey)throw new Error("Need Signer to sign input");const r=[];for(const n of Y(this.data.inputs.length))try{this.signInput(n,t,e),r.push(!0)}catch(t){r.push(!1)}if(r.every(t=>!1===t))throw new Error("No inputs were signed");return this}signAllInputsAsync(t,e=[d.Transaction.SIGHASH_ALL]){return new Promise((r,n)=>{if(!t||!t.publicKey)return n(new Error("Need Signer to sign input"));const i=[],o=[];for(const[r]of this.data.inputs.entries())o.push(this.signInputAsync(r,t,e).then(()=>{i.push(!0)},()=>{i.push(!1)}));return Promise.all(o).then(()=>{if(i.every(t=>!1===t))return n(new Error("No inputs were signed"));r()})})}signInput(t,e,r=[d.Transaction.SIGHASH_ALL]){if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=C(this.data.inputs,t,e.publicKey,this.__CACHE,r),o=[{pubkey:e.publicKey,signature:c.signature.encode(e.sign(n),i)}];return this.data.updateInput(t,{partialSig:o}),this}signInputAsync(t,e,r=[d.Transaction.SIGHASH_ALL]){return Promise.resolve().then(()=>{if(!e||!e.publicKey)throw new Error("Need Signer to sign input");const{hash:n,sighashType:i}=C(this.data.inputs,t,e.publicKey,this.__CACHE,r);return Promise.resolve(e.sign(n)).then(r=>{const n=[{pubkey:e.publicKey,signature:c.signature.encode(r,i)}];this.data.updateInput(t,{partialSig:n})})})}toBuffer(){return m(this.__CACHE),this.data.toBuffer()}toHex(){return m(this.__CACHE),this.data.toHex()}toBase64(){return m(this.__CACHE),this.data.toBase64()}updateGlobal(t){return this.data.updateGlobal(t),this}updateInput(t,e){return e.witnessScript&&G(e.witnessScript),this.data.updateInput(t,e),e.nonWitnessUtxo&&q(this.__CACHE,this.data.inputs[t],t),this}updateOutput(t,e){return this.data.updateOutput(t,e),this}addUnknownKeyValToGlobal(t){return this.data.addUnknownKeyValToGlobal(t),this}addUnknownKeyValToInput(t,e){return this.data.addUnknownKeyValToInput(t,e),this}addUnknownKeyValToOutput(t,e){return this.data.addUnknownKeyValToOutput(t,e),this}clearFinalizedInput(t){return this.data.clearFinalizedInput(t),this}}r.Psbt=p;const b=t=>new y(t);class y{constructor(t=e.from([2,0,0,0,0,0,0,0,0,0])){this.tx=d.Transaction.fromBuffer(t),function(t){if(!t.ins.every(t=>t.script&&0===t.script.length&&t.witness&&0===t.witness.length))throw new Error("Format Error: Transaction ScriptSigs are not empty")}(this.tx),Object.defineProperty(this,"tx",{enumerable:!1,writable:!0})}getInputOutputCounts(){return{inputCount:this.tx.ins.length,outputCount:this.tx.outs.length}}addInput(t){if(void 0===t.hash||void 0===t.index||!e.isBuffer(t.hash)&&"string"!=typeof t.hash||"number"!=typeof t.index)throw new Error("Error adding input.");const r="string"==typeof t.hash?(0,a.reverseBuffer)(e.from(t.hash,"hex")):t.hash;this.tx.addInput(r,t.index,t.sequence)}addOutput(t){if(void 0===t.script||void 0===t.value||!e.isBuffer(t.script)||"number"!=typeof t.value)throw new Error("Error adding output.");this.tx.addOutput(t.script,t.value)}toBuffer(){return this.tx.toBuffer()}}function m(t){if(!1!==t.__UNSAFE_SIGN_NONSEGWIT)throw new Error("Not BIP174 compliant, can not export")}function g(t,e,r){if(!e)return!1;let n;if((n=r?r.map(t=>{const r=function(t){if(65===t.length){const e=1&t[64],r=t.slice(0,33);return r[0]=2|e,r}return t.slice()}(t);return e.find(t=>t.pubkey.equals(r))}).filter(t=>!!t):e).length>t)throw new Error("Too many signatures");return n.length===t}function w(t){return!!t.finalScriptSig||!!t.finalScriptWitness}function v(t){return e=>{try{return t({output:e}),!0}catch(t){return!1}}}const _=v(h.p2ms),S=v(h.p2pk),E=v(h.p2pkh),M=v(h.p2wpkh),k=v(h.p2wsh),A=v(h.p2sh);function I(t){return e=>!!e.masterFingerprint.equals(t.fingerprint)&&!!t.derivePath(e.path).publicKey.equals(e.pubkey)}function T(t){if("number"!=typeof t||t!==Math.floor(t)||t>4294967295||t<0)throw new Error("Invalid 32 bit integer")}function x(t,r){t.forEach(t=>{let n=!1,i=[];if(0===(t.partialSig||[]).length){if(!t.finalScriptSig&&!t.finalScriptWitness)return;i=function(t){const r=t.finalScriptSig&&c.decompile(t.finalScriptSig)||[],n=t.finalScriptWitness&&c.decompile(t.finalScriptWitness)||[];return r.concat(n).filter(t=>e.isBuffer(t)&&c.isCanonicalScriptSignature(t)).map(t=>({signature:t}))}(t)}else i=t.partialSig;if(i.forEach(t=>{const{hashType:e}=c.signature.decode(t.signature),i=[];switch(e&d.Transaction.SIGHASH_ANYONECANPAY&&i.push("addInput"),31&e){case d.Transaction.SIGHASH_ALL:break;case d.Transaction.SIGHASH_SINGLE:case d.Transaction.SIGHASH_NONE:i.push("addOutput"),i.push("setInputSequence")}-1===i.indexOf(r)&&(n=!0)}),n)throw new Error("Can not modify transaction, signatures exist.")})}function O(t,e,r){if(!X(t,e))throw new Error(`Can not ${r} for this input with the key ${t.toString("hex")}`)}function P(t,r){const n=(0,a.reverseBuffer)(e.from(r.hash)).toString("hex")+":"+r.index;if(t.__TX_IN_CACHE[n])throw new Error("Duplicate input detected.");t.__TX_IN_CACHE[n]=1}function N(t,e){return(r,n,i,o)=>{const s=t({redeem:{output:i}}).output;if(!n.equals(s))throw new Error(`${e} for ${o} #${r} doesn't match the scriptPubKey in the prevout`)}}const R=N(h.p2sh,"Redeem script"),B=N(h.p2wsh,"Witness script");function U(t,e,r,n){if(!r.every(w))throw new Error(`PSBT must be finalized to calculate ${e}`);if("__FEE_RATE"===t&&n.__FEE_RATE)return n.__FEE_RATE;if("__FEE"===t&&n.__FEE)return n.__FEE;let i,o=!0;return n.__EXTRACTED_TX?(i=n.__EXTRACTED_TX,o=!1):i=n.__TX.clone(),F(r,i,n,o),"__FEE_RATE"===t?n.__FEE_RATE:"__FEE"===t?n.__FEE:void 0}function C(t,e,r,n,i){const s=(0,o.checkForInput)(t,e),{hash:a,sighashType:u,script:f}=j(e,s,n,!1,i);return O(r,f,"sign"),{hash:a,sighashType:u}}function j(t,e,r,n,i){const o=r.__TX,s=e.sighashType||d.Transaction.SIGHASH_ALL;if(i&&i.indexOf(s)<0){const t=function(t){let e=t&d.Transaction.SIGHASH_ANYONECANPAY?"SIGHASH_ANYONECANPAY | ":"";switch(31&t){case d.Transaction.SIGHASH_ALL:e+="SIGHASH_ALL";break;case d.Transaction.SIGHASH_SINGLE:e+="SIGHASH_SINGLE";break;case d.Transaction.SIGHASH_NONE:e+="SIGHASH_NONE"}return e}(s);throw new Error("Sighash type is not allowed. Retry the sign method passing the "+`sighashTypes array of whitelisted types. Sighash type: ${t}`)}let a,u;if(e.nonWitnessUtxo){const n=z(r,e,t),i=o.ins[t].hash,s=n.getHash();if(!i.equals(s))throw new Error(`Non-witness UTXO hash for input #${t} doesn't match the hash specified in the prevout`);const a=o.ins[t].index;u=n.outs[a]}else{if(!e.witnessUtxo)throw new Error("Need a Utxo input item for signing");u=e.witnessUtxo}const{meaningfulScript:f,type:c}=W(u.script,t,"input",e.redeemScript,e.witnessScript);if(["p2sh-p2wsh","p2wsh"].indexOf(c)>=0)a=o.hashForWitnessV0(t,f,u.value,s);else if(M(f)){const e=h.p2pkh({hash:f.slice(2)}).output;a=o.hashForWitnessV0(t,e,u.value,s)}else{if(void 0===e.nonWitnessUtxo&&!1===r.__UNSAFE_SIGN_NONSEGWIT)throw new Error(`Input #${t} has witnessUtxo but non-segwit script: `+`${f.toString("hex")}`);n||!1===r.__UNSAFE_SIGN_NONSEGWIT||console.warn("Warning: Signing non-segwit inputs without the full parent transaction means there is a chance that a miner could feed you incorrect information to trick you into paying large fees. This behavior is the same as Psbt's predecesor (TransactionBuilder - now removed) when signing non-segwit scripts. You are not able to export this Psbt with toBuffer|toBase64|toHex since it is not BIP174 compliant.\n*********************\nPROCEED WITH CAUTION!\n*********************"),a=o.hashForSignature(t,f,s)}return{script:f,sighashType:s,hash:a}}function L(t,e,r){const n=(0,o.checkForInput)(e,t);if(!n.bip32Derivation||0===n.bip32Derivation.length)throw new Error("Need bip32Derivation to sign with HD");const i=n.bip32Derivation.map(t=>t.masterFingerprint.equals(r.fingerprint)?t:void 0).filter(t=>!!t);if(0===i.length)throw new Error("Need one bip32Derivation masterFingerprint to match the HDSigner fingerprint");return i.map(t=>{const e=r.derivePath(t.path);if(!t.pubkey.equals(e.publicKey))throw new Error("pubkey did not match bip32Derivation");return e})}function H(t){let e=0;function r(){const r=i.decode(t,e);return e+=i.decode.bytes,r}function n(){return n=r(),e+=n,t.slice(e-n,e);var n}return function(){const t=r(),e=[];for(let r=0;r<t;r++)e.push(n());return e}()}function D(t){let r=e.allocUnsafe(0);function n(t){const n=r.length,o=i.encodingLength(t);r=e.concat([r,e.allocUnsafe(o)]),i.encode(t,r,n)}function o(t){n(t.length),function(t){r=e.concat([r,e.from(t)])}(t)}var s;return n((s=t).length),s.forEach(o),r}function q(t,e,r){t.__NON_WITNESS_UTXO_BUF_CACHE[r]=e.nonWitnessUtxo;const n=d.Transaction.fromBuffer(e.nonWitnessUtxo);t.__NON_WITNESS_UTXO_TX_CACHE[r]=n;const i=t,o=r;delete e.nonWitnessUtxo,Object.defineProperty(e,"nonWitnessUtxo",{enumerable:!0,get(){const t=i.__NON_WITNESS_UTXO_BUF_CACHE[o],e=i.__NON_WITNESS_UTXO_TX_CACHE[o];if(void 0!==t)return t;{const t=e.toBuffer();return i.__NON_WITNESS_UTXO_BUF_CACHE[o]=t,t}},set(t){i.__NON_WITNESS_UTXO_BUF_CACHE[o]=t}})}function F(t,e,r,n){let i=0;t.forEach((t,o)=>{if(n&&t.finalScriptSig&&(e.ins[o].script=t.finalScriptSig),n&&t.finalScriptWitness&&(e.ins[o].witness=H(t.finalScriptWitness)),t.witnessUtxo)i+=t.witnessUtxo.value;else if(t.nonWitnessUtxo){const n=z(r,t,o),s=e.ins[o].index,a=n.outs[s];i+=a.value}});const o=e.outs.reduce((t,e)=>t+e.value,0),s=i-o;if(s<0)throw new Error("Outputs are spending more than Inputs");const a=e.virtualSize();r.__FEE=s,r.__EXTRACTED_TX=e,r.__FEE_RATE=Math.floor(s/a)}function z(t,e,r){const n=t.__NON_WITNESS_UTXO_TX_CACHE;return n[r]||q(t,e,r),n[r]}function K(t,e,r){if(void 0!==e.witnessUtxo)return e.witnessUtxo.script;if(void 0!==e.nonWitnessUtxo){return z(r,e,t).outs[r.__TX.ins[t].index].script}throw new Error("Can't find pubkey in input without Utxo data")}function V(t){return 33===t.length&&c.isCanonicalPubKey(t)}function W(t,e,r,n,i){const o=A(t),s=o&&n&&k(n),a=k(t);if(o&&void 0===n)throw new Error("scriptPubkey is P2SH but redeemScript missing");if((a||s)&&void 0===i)throw new Error("scriptPubkey or redeemScript is P2WSH but witnessScript missing");let u;return s?(u=i,R(e,t,n,r),B(e,n,i,r),G(u)):a?(u=i,B(e,t,i,r),G(u)):o?(u=n,R(e,t,n,r)):u=t,{meaningfulScript:u,type:s?"p2sh-p2wsh":o?"p2sh":a?"p2wsh":"raw"}}function G(t){if(M(t)||A(t))throw new Error("P2WPKH or P2SH can not be contained within P2WSH")}function X(t,e){const r=(0,u.hash160)(t),n=c.decompile(e);if(null===n)throw new Error("Unknown script error");return n.some(e=>"number"!=typeof e&&(e.equals(t)||e.equals(r)))}function Z(t){return M(t)?"witnesspubkeyhash":E(t)?"pubkeyhash":_(t)?"multisig":S(t)?"pubkey":"nonstandard"}function Y(t){return[...Array(t).keys()]}}).call(this)}).call(this,t("buffer").Buffer)},{"./address":27,"./bufferutils":30,"./crypto":31,"./networks":34,"./payments":37,"./script":47,"./transaction":50,bip174:23,"bip174/src/lib/converter/varint":19,"bip174/src/lib/utils":25,buffer:223}],46:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.decode=r.encode=r.encodingLength=void 0;const n=t("./ops");function i(t){return t<n.OPS.OP_PUSHDATA1?1:t<=255?2:t<=65535?3:5}r.encodingLength=i,r.encode=function(t,e,r){const o=i(e);return 1===o?t.writeUInt8(e,r):2===o?(t.writeUInt8(n.OPS.OP_PUSHDATA1,r),t.writeUInt8(e,r+1)):3===o?(t.writeUInt8(n.OPS.OP_PUSHDATA2,r),t.writeUInt16LE(e,r+1)):(t.writeUInt8(n.OPS.OP_PUSHDATA4,r),t.writeUInt32LE(e,r+1)),o},r.decode=function(t,e){const r=t.readUInt8(e);let i,o;if(r<n.OPS.OP_PUSHDATA1)i=r,o=1;else if(r===n.OPS.OP_PUSHDATA1){if(e+2>t.length)return null;i=t.readUInt8(e+1),o=2}else if(r===n.OPS.OP_PUSHDATA2){if(e+3>t.length)return null;i=t.readUInt16LE(e+1),o=3}else{if(e+5>t.length)return null;if(r!==n.OPS.OP_PUSHDATA4)throw new Error("Unexpected opcode");i=t.readUInt32LE(e+1),o=5}return{opcode:r,number:i,size:o}}},{"./ops":35}],47:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.signature=r.number=r.isCanonicalScriptSignature=r.isDefinedHashType=r.isCanonicalPubKey=r.toStack=r.fromASM=r.toASM=r.decompile=r.compile=r.isPushOnly=r.OPS=void 0;const n=t("./bip66"),i=t("./ops");Object.defineProperty(r,"OPS",{enumerable:!0,get:function(){return i.OPS}});const o=t("./push_data"),s=t("./script_number"),a=t("./script_signature"),u=t("./types"),{typeforce:f}=u,h=i.OPS.OP_RESERVED;function c(t){return u.Buffer(t)||function(t){return u.Number(t)&&(t===i.OPS.OP_0||t>=i.OPS.OP_1&&t<=i.OPS.OP_16||t===i.OPS.OP_1NEGATE)}(t)}function d(t){return u.Array(t)&&t.every(c)}function l(t){return 0===t.length?i.OPS.OP_0:1===t.length?t[0]>=1&&t[0]<=16?h+t[0]:129===t[0]?i.OPS.OP_1NEGATE:void 0:void 0}function p(t){return e.isBuffer(t)}function b(t){return e.isBuffer(t)}function y(t){if(p(t))return t;f(u.Array,t);const r=t.reduce((t,e)=>b(e)?1===e.length&&void 0!==l(e)?t+1:t+o.encodingLength(e.length)+e.length:t+1,0),n=e.allocUnsafe(r);let i=0;if(t.forEach(t=>{if(b(t)){const e=l(t);if(void 0!==e)return n.writeUInt8(e,i),void(i+=1);i+=o.encode(n,t.length,i),t.copy(n,i),i+=t.length}else n.writeUInt8(t,i),i+=1}),i!==n.length)throw new Error("Could not decode chunks");return n}function m(t){if(e=t,u.Array(e))return t;var e;f(u.Buffer,t);const r=[];let n=0;for(;n<t.length;){const e=t[n];if(e>i.OPS.OP_0&&e<=i.OPS.OP_PUSHDATA4){const e=o.decode(t,n);if(null===e)return null;if((n+=e.size)+e.number>t.length)return null;const i=t.slice(n,n+e.number);n+=e.number;const s=l(i);void 0!==s?r.push(s):r.push(i)}else r.push(e),n+=1}return r}function g(t){const e=-129&t;return e>0&&e<4}r.isPushOnly=d,r.compile=y,r.decompile=m,r.toASM=function(t){return p(t)&&(t=m(t)),t.map(t=>{if(b(t)){const e=l(t);if(void 0===e)return t.toString("hex");t=e}return i.REVERSE_OPS[t]}).join(" ")},r.fromASM=function(t){return f(u.String,t),y(t.split(" ").map(t=>void 0!==i.OPS[t]?i.OPS[t]:(f(u.Hex,t),e.from(t,"hex"))))},r.toStack=function(t){return t=m(t),f(d,t),t.map(t=>b(t)?t:t===i.OPS.OP_0?e.allocUnsafe(0):s.encode(t-h))},r.isCanonicalPubKey=function(t){return u.isPoint(t)},r.isDefinedHashType=g,r.isCanonicalScriptSignature=function(t){return!!e.isBuffer(t)&&!!g(t[t.length-1])&&n.check(t.slice(0,-1))},r.number=s,r.signature=a}).call(this)}).call(this,t("buffer").Buffer)},{"./bip66":28,"./ops":35,"./push_data":46,"./script_number":48,"./script_signature":49,"./types":51,buffer:223}],48:[function(t,e,r){(function(t){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decode=void 0,r.decode=function(t,e,r){e=e||4,r=void 0===r||r;const n=t.length;if(0===n)return 0;if(n>e)throw new TypeError("Script number overflow");if(r&&0==(127&t[n-1])&&(n<=1||0==(128&t[n-2])))throw new Error("Non-minimally encoded script number");if(5===n){const e=t.readUInt32LE(0),r=t.readUInt8(4);return 128&r?-(4294967296*(-129&r)+e):4294967296*r+e}let i=0;for(let e=0;e<n;++e)i|=t[e]<<8*e;return 128&t[n-1]?-(i&~(128<<8*(n-1))):i},r.encode=function(e){let r=Math.abs(e);const n=(i=r)>2147483647?5:i>8388607?4:i>32767?3:i>127?2:i>0?1:0;var i;const o=t.allocUnsafe(n),s=e<0;for(let t=0;t<n;++t)o.writeUInt8(255&r,t),r>>=8;return 128&o[n-1]?o.writeUInt8(s?128:0,n-1):s&&(o[n-1]|=128),o}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223}],49:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.encode=r.decode=void 0;const n=t("./bip66"),i=t("./types"),{typeforce:o}=i,s=e.alloc(1,0);function a(t){let r=0;for(;0===t[r];)++r;return r===t.length?s:128&(t=t.slice(r))[0]?e.concat([s,t],1+t.length):t}function u(t){0===t[0]&&(t=t.slice(1));const r=e.alloc(32,0),n=Math.max(0,32-t.length);return t.copy(r,n),r}r.decode=function(t){const r=t.readUInt8(t.length-1),i=-129&r;if(i<=0||i>=4)throw new Error("Invalid hashType "+r);const o=n.decode(t.slice(0,-1)),s=u(o.r),a=u(o.s);return{signature:e.concat([s,a],64),hashType:r}},r.encode=function(t,r){o({signature:i.BufferN(64),hashType:i.UInt8},{signature:t,hashType:r});const s=-129&r;if(s<=0||s>=4)throw new Error("Invalid hashType "+r);const u=e.allocUnsafe(1);u.writeUInt8(r,0);const f=a(t.slice(0,32)),h=a(t.slice(32,64));return e.concat([n.encode(f,h),u])}}).call(this)}).call(this,t("buffer").Buffer)},{"./bip66":28,"./types":51,buffer:223}],50:[function(t,e,r){(function(e){(function(){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Transaction=void 0;const n=t("./bufferutils"),i=t("./crypto"),o=t("./script"),s=t("./script"),a=t("./types"),{typeforce:u}=a;function f(t){const e=t.length;return n.varuint.encodingLength(e)+e}const h=e.allocUnsafe(0),c=[],d=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),l=e.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),p=e.from("ffffffffffffffff","hex"),b={script:h,valueBuffer:p};class y{constructor(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}static fromBuffer(t,e){const r=new n.BufferReader(t),i=new y;i.version=r.readInt32();const o=r.readUInt8(),s=r.readUInt8();let a=!1;o===y.ADVANCED_TRANSACTION_MARKER&&s===y.ADVANCED_TRANSACTION_FLAG?a=!0:r.offset-=2;const u=r.readVarInt();for(let t=0;t<u;++t)i.ins.push({hash:r.readSlice(32),index:r.readUInt32(),script:r.readVarSlice(),sequence:r.readUInt32(),witness:c});const f=r.readVarInt();for(let t=0;t<f;++t)i.outs.push({value:r.readUInt64(),script:r.readVarSlice()});if(a){for(let t=0;t<u;++t)i.ins[t].witness=r.readVector();if(!i.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(i.locktime=r.readUInt32(),e)return i;if(r.offset!==t.length)throw new Error("Transaction has unexpected data");return i}static fromHex(t){return y.fromBuffer(e.from(t,"hex"),!1)}static isCoinbaseHash(t){u(a.Hash256bit,t);for(let e=0;e<32;++e)if(0!==t[e])return!1;return!0}isCoinbase(){return 1===this.ins.length&&y.isCoinbaseHash(this.ins[0].hash)}addInput(t,e,r,n){return u(a.tuple(a.Hash256bit,a.UInt32,a.maybe(a.UInt32),a.maybe(a.Buffer)),arguments),a.Null(r)&&(r=y.DEFAULT_SEQUENCE),this.ins.push({hash:t,index:e,script:n||h,sequence:r,witness:c})-1}addOutput(t,e){return u(a.tuple(a.Buffer,a.Satoshi),arguments),this.outs.push({script:t,value:e})-1}hasWitnesses(){return this.ins.some(t=>0!==t.witness.length)}weight(){return 3*this.byteLength(!1)+this.byteLength(!0)}virtualSize(){return Math.ceil(this.weight()/4)}byteLength(t=!0){const e=t&&this.hasWitnesses();return(e?10:8)+n.varuint.encodingLength(this.ins.length)+n.varuint.encodingLength(this.outs.length)+this.ins.reduce((t,e)=>t+40+f(e.script),0)+this.outs.reduce((t,e)=>t+8+f(e.script),0)+(e?this.ins.reduce((t,e)=>t+function(t){const e=t.length;return n.varuint.encodingLength(e)+t.reduce((t,e)=>t+f(e),0)}(e.witness),0):0)}clone(){const t=new y;return t.version=this.version,t.locktime=this.locktime,t.ins=this.ins.map(t=>({hash:t.hash,index:t.index,script:t.script,sequence:t.sequence,witness:t.witness})),t.outs=this.outs.map(t=>({script:t.script,value:t.value})),t}hashForSignature(t,r,n){if(u(a.tuple(a.UInt32,a.Buffer,a.Number),arguments),t>=this.ins.length)return l;const f=o.compile(o.decompile(r).filter(t=>t!==s.OPS.OP_CODESEPARATOR)),c=this.clone();if((31&n)===y.SIGHASH_NONE)c.outs=[],c.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)});else if((31&n)===y.SIGHASH_SINGLE){if(t>=this.outs.length)return l;c.outs.length=t+1;for(let e=0;e<t;e++)c.outs[e]=b;c.ins.forEach((e,r)=>{r!==t&&(e.sequence=0)})}n&y.SIGHASH_ANYONECANPAY?(c.ins=[c.ins[t]],c.ins[0].script=f):(c.ins.forEach(t=>{t.script=h}),c.ins[t].script=f);const d=e.allocUnsafe(c.byteLength(!1)+4);return d.writeInt32LE(n,d.length-4),c.__toBuffer(d,0,!1),i.hash256(d)}hashForWitnessV1(t,r,o,s,c,d){if(u(a.tuple(a.UInt32,u.arrayOf(a.Buffer),u.arrayOf(a.Satoshi),a.UInt32),arguments),o.length!==this.ins.length||r.length!==this.ins.length)throw new Error("Must supply prevout script and value for all inputs");const l=s===y.SIGHASH_DEFAULT?y.SIGHASH_ALL:s&y.SIGHASH_OUTPUT_MASK,p=(s&y.SIGHASH_INPUT_MASK)===y.SIGHASH_ANYONECANPAY,b=l===y.SIGHASH_NONE,m=l===y.SIGHASH_SINGLE;let g=h,w=h,v=h,_=h,S=h;if(!p){let t=n.BufferWriter.withCapacity(36*this.ins.length);this.ins.forEach(e=>{t.writeSlice(e.hash),t.writeUInt32(e.index)}),g=i.sha256(t.end()),t=n.BufferWriter.withCapacity(8*this.ins.length),o.forEach(e=>t.writeUInt64(e)),w=i.sha256(t.end()),t=n.BufferWriter.withCapacity(r.map(f).reduce((t,e)=>t+e)),r.forEach(e=>t.writeVarSlice(e)),v=i.sha256(t.end()),t=n.BufferWriter.withCapacity(4*this.ins.length),this.ins.forEach(e=>t.writeUInt32(e.sequence)),_=i.sha256(t.end())}if(b||m){if(m&&t<this.outs.length){const e=this.outs[t],r=n.BufferWriter.withCapacity(8+f(e.script));r.writeUInt64(e.value),r.writeVarSlice(e.script),S=i.sha256(r.end())}}else{const t=this.outs.map(t=>8+f(t.script)).reduce((t,e)=>t+e),e=n.BufferWriter.withCapacity(t);this.outs.forEach(t=>{e.writeUInt64(t.value),e.writeVarSlice(t.script)}),S=i.sha256(e.end())}const E=(c?2:0)+(d?1:0),M=174-(p?49:0)-(b?32:0)+(d?32:0)+(c?37:0),k=n.BufferWriter.withCapacity(M);if(k.writeUInt8(s),k.writeInt32(this.version),k.writeUInt32(this.locktime),k.writeSlice(g),k.writeSlice(w),k.writeSlice(v),k.writeSlice(_),b||m||k.writeSlice(S),k.writeUInt8(E),p){const e=this.ins[t];k.writeSlice(e.hash),k.writeUInt32(e.index),k.writeUInt64(o[t]),k.writeVarSlice(r[t]),k.writeUInt32(e.sequence)}else k.writeUInt32(t);if(d){const t=n.BufferWriter.withCapacity(f(d));t.writeVarSlice(d),k.writeSlice(i.sha256(t.end()))}return m&&k.writeSlice(S),c&&(k.writeSlice(c),k.writeUInt8(0),k.writeUInt32(4294967295)),i.taggedHash("TapSighash",e.concat([e.of(0),k.end()]))}hashForWitnessV0(t,r,o,s){u(a.tuple(a.UInt32,a.Buffer,a.Satoshi,a.UInt32),arguments);let h,c=e.from([]),l=d,p=d,b=d;if(s&y.SIGHASH_ANYONECANPAY||(c=e.allocUnsafe(36*this.ins.length),h=new n.BufferWriter(c,0),this.ins.forEach(t=>{h.writeSlice(t.hash),h.writeUInt32(t.index)}),p=i.hash256(c)),s&y.SIGHASH_ANYONECANPAY||(31&s)===y.SIGHASH_SINGLE||(31&s)===y.SIGHASH_NONE||(c=e.allocUnsafe(4*this.ins.length),h=new n.BufferWriter(c,0),this.ins.forEach(t=>{h.writeUInt32(t.sequence)}),b=i.hash256(c)),(31&s)!==y.SIGHASH_SINGLE&&(31&s)!==y.SIGHASH_NONE){const t=this.outs.reduce((t,e)=>t+8+f(e.script),0);c=e.allocUnsafe(t),h=new n.BufferWriter(c,0),this.outs.forEach(t=>{h.writeUInt64(t.value),h.writeVarSlice(t.script)}),l=i.hash256(c)}else if((31&s)===y.SIGHASH_SINGLE&&t<this.outs.length){const r=this.outs[t];c=e.allocUnsafe(8+f(r.script)),(h=new n.BufferWriter(c,0)).writeUInt64(r.value),h.writeVarSlice(r.script),l=i.hash256(c)}c=e.allocUnsafe(156+f(r)),h=new n.BufferWriter(c,0);const m=this.ins[t];return h.writeInt32(this.version),h.writeSlice(p),h.writeSlice(b),h.writeSlice(m.hash),h.writeUInt32(m.index),h.writeVarSlice(r),h.writeUInt64(o),h.writeUInt32(m.sequence),h.writeSlice(l),h.writeUInt32(this.locktime),h.writeUInt32(s),i.hash256(c)}getHash(t){return t&&this.isCoinbase()?e.alloc(32,0):i.hash256(this.__toBuffer(void 0,void 0,t))}getId(){return(0,n.reverseBuffer)(this.getHash(!1)).toString("hex")}toBuffer(t,e){return this.__toBuffer(t,e,!0)}toHex(){return this.toBuffer(void 0,void 0).toString("hex")}setInputScript(t,e){u(a.tuple(a.Number,a.Buffer),arguments),this.ins[t].script=e}setWitness(t,e){u(a.tuple(a.Number,[a.Buffer]),arguments),this.ins[t].witness=e}__toBuffer(t,r,i=!1){t||(t=e.allocUnsafe(this.byteLength(i)));const o=new n.BufferWriter(t,r||0);o.writeInt32(this.version);const s=i&&this.hasWitnesses();return s&&(o.writeUInt8(y.ADVANCED_TRANSACTION_MARKER),o.writeUInt8(y.ADVANCED_TRANSACTION_FLAG)),o.writeVarInt(this.ins.length),this.ins.forEach(t=>{o.writeSlice(t.hash),o.writeUInt32(t.index),o.writeVarSlice(t.script),o.writeUInt32(t.sequence)}),o.writeVarInt(this.outs.length),this.outs.forEach(t=>{void 0!==t.value?o.writeUInt64(t.value):o.writeSlice(t.valueBuffer),o.writeVarSlice(t.script)}),s&&this.ins.forEach(t=>{o.writeVector(t.witness)}),o.writeUInt32(this.locktime),void 0!==r?t.slice(r,o.offset):t}}r.Transaction=y,y.DEFAULT_SEQUENCE=4294967295,y.SIGHASH_DEFAULT=0,y.SIGHASH_ALL=1,y.SIGHASH_NONE=2,y.SIGHASH_SINGLE=3,y.SIGHASH_ANYONECANPAY=128,y.SIGHASH_OUTPUT_MASK=3,y.SIGHASH_INPUT_MASK=128,y.ADVANCED_TRANSACTION_MARKER=0,y.ADVANCED_TRANSACTION_FLAG=1}).call(this)}).call(this,t("buffer").Buffer)},{"./bufferutils":30,"./crypto":31,"./script":47,"./types":51,buffer:223}],51:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.oneOf=r.Null=r.BufferN=r.Function=r.UInt32=r.UInt8=r.tuple=r.maybe=r.Hex=r.Buffer=r.String=r.Boolean=r.Array=r.Number=r.Hash256bit=r.Hash160bit=r.Buffer256bit=r.Network=r.ECPoint=r.Satoshi=r.Signer=r.BIP32Path=r.UInt31=r.isPoint=r.typeforce=void 0;const n=t("buffer");r.typeforce=t("typeforce");const i=n.Buffer.alloc(32,0),o=n.Buffer.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex");r.isPoint=function(t){if(!n.Buffer.isBuffer(t))return!1;if(t.length<33)return!1;const e=t[0],r=t.slice(1,33);if(0===r.compare(i))return!1;if(r.compare(o)>=0)return!1;if((2===e||3===e)&&33===t.length)return!0;const s=t.slice(33);return 0!==s.compare(i)&&!(s.compare(o)>=0)&&4===e&&65===t.length};const s=Math.pow(2,31)-1;function a(t){return r.typeforce.String(t)&&!!t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}r.UInt31=function(t){return r.typeforce.UInt32(t)&&t<=s},r.BIP32Path=a,a.toJSON=(()=>"BIP32 derivation path"),r.Signer=function(t){return(r.typeforce.Buffer(t.publicKey)||"function"==typeof t.getPublicKey)&&"function"==typeof t.sign};const u=21e14;r.Satoshi=function(t){return r.typeforce.UInt53(t)&&t<=u},r.ECPoint=r.typeforce.quacksLike("Point"),r.Network=r.typeforce.compile({messagePrefix:r.typeforce.oneOf(r.typeforce.Buffer,r.typeforce.String),bip32:{public:r.typeforce.UInt32,private:r.typeforce.UInt32},pubKeyHash:r.typeforce.UInt8,scriptHash:r.typeforce.UInt8,wif:r.typeforce.UInt8}),r.Buffer256bit=r.typeforce.BufferN(32),r.Hash160bit=r.typeforce.BufferN(20),r.Hash256bit=r.typeforce.BufferN(32),r.Number=r.typeforce.Number,r.Array=r.typeforce.Array,r.Boolean=r.typeforce.Boolean,r.String=r.typeforce.String,r.Buffer=r.typeforce.Buffer,r.Hex=r.typeforce.Hex,r.maybe=r.typeforce.maybe,r.tuple=r.typeforce.tuple,r.UInt8=r.typeforce.UInt8,r.UInt32=r.typeforce.UInt32,r.Function=r.typeforce.Function,r.BufferN=r.typeforce.BufferN,r.Null=r.typeforce.Null,r.oneOf=r.typeforce.oneOf},{buffer:223,typeforce:218}],52:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s=t("buffer").Buffer}catch(t){}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o<i;o++){var s=t.charCodeAt(o)-48;n<<=4,n|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var n,i,o=0;for(r=t.length-6,n=0;r>=e;r-=6)i=a(t,r,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=a(t,e,r+6),this.words[n]|=i<<o&67108863,this.words[n+1]|=i>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,f=0,h=r;h<a;h+=n)f=u(t,h,h+n,e),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==s){var c=1;for(f=u(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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"],h=[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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=h[t],l=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[a]=s;for(;a<o;a++)f[a]=0}else{for(a=0;a<o-i;a++)f[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[o-a-1]=s}return f},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&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()},o.prototype.sub=function(t){return this.clone().isub(t)};var l=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,d=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,y=0|s[2],m=8191&y,g=y>>>13,w=0|s[3],v=8191&w,_=w>>>13,S=0|s[4],E=8191&S,M=S>>>13,k=0|s[5],A=8191&k,I=k>>>13,T=0|s[6],x=8191&T,O=T>>>13,P=0|s[7],N=8191&P,R=P>>>13,B=0|s[8],U=8191&B,C=B>>>13,j=0|s[9],L=8191&j,H=j>>>13,D=0|a[0],q=8191&D,F=D>>>13,z=0|a[1],K=8191&z,V=z>>>13,W=0|a[2],G=8191&W,X=W>>>13,Z=0|a[3],Y=8191&Z,$=Z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,dt=ht>>>13,lt=0|a[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(f+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(d,q)|0))<<13)|0;f=((o=Math.imul(d,F))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(b,q)|0,o=Math.imul(b,F);var mt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(g,q)|0,o=Math.imul(g,F),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var gt=(f+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(d,G)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(v,q),i=(i=Math.imul(v,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,X)|0;var wt=(f+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0;var vt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(A,q),i=(i=Math.imul(A,F))+Math.imul(I,q)|0,o=Math.imul(I,F),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,F))+Math.imul(O,q)|0,o=Math.imul(O,F),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,F))+Math.imul(R,q)|0,o=Math.imul(R,F),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,F))+Math.imul(C,q)|0,o=Math.imul(C,F),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Mt=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,F))+Math.imul(H,q)|0,o=Math.imul(H,F),n=n+Math.imul(U,K)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var kt=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,V))+Math.imul(H,K)|0,o=Math.imul(H,V),n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,X)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,dt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,dt)|0;var At=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,G),i=(i=Math.imul(L,X))+Math.imul(H,G)|0,o=Math.imul(H,X),n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,$)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var It=(f+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,$))+Math.imul(H,Y)|0,o=Math.imul(H,$),n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var Tt=(f+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(H,Q)|0,o=Math.imul(H,tt),n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var xt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(H,rt)|0,o=Math.imul(H,nt),n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,dt)|0;var Ot=(f+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,st))+Math.imul(H,ot)|0,o=Math.imul(H,st),n=n+Math.imul(U,ut)|0,i=(i=i+Math.imul(U,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(N,ct)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Pt=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ft))+Math.imul(H,ut)|0,o=Math.imul(H,ft),n=n+Math.imul(U,ct)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,dt)|0;var Nt=(f+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(L,ct),i=(i=Math.imul(L,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Rt=(f+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(f+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,bt))+Math.imul(H,pt)|0))<<13)|0;return f=((o=Math.imul(H,bt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=yt,u[1]=mt,u[2]=gt,u[3]=wt,u[4]=vt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=At,u[11]=It,u[12]=Tt,u[13]=xt,u[14]=Ot,u[15]=Pt,u[16]=Nt,u[17]=Rt,u[18]=Bt,0!==f&&(u[19]=f,r.length++),r};function p(t,e,r){return(new b).mulp(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(l=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?l(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),d=67108863&c;a=67108863&(d=d+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},b.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},b.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,d=f,l=0;l<s;l++){var p=r[h+l],b=n[h+l],y=r[h+l+s],m=n[h+l+s],g=c*y-d*m;m=c*m+d*y,y=g,r[h+l]=p+y,n[h+l]=b+m,r[h+l+s]=p-y,n[h+l+s]=b-m,l!==a&&(g=u*c-f*d,d=u*d+f*c,c=g)}},b.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},b.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},b.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},b.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*c[l];u[l]=a[l]*c[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function v(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):r.strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},i(g,m),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(w,m),i(v,m),i(_,m),_.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new v;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return y[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,y=0;0!==b.cmp(a);y++)b=b.redSqr();n(y<p);var m=this.pow(c,new o(1).iushln(p-y-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=y}return d},S.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},S.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:222}],53:[function(t,e,r){var n;function i(t){this.rand=t}if(e.exports=function(t){return n||(n=new i(null)),n.generate(t)},e.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r<e.length;r++)e[r]=this.rand.getByte();return e},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.crypto.getRandomValues(e),e}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(t){var e=new Uint8Array(t);return self.msCrypto.getRandomValues(e),e}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=t("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(t){return o.randomBytes(t)}}catch(t){}},{crypto:222}],54:[function(t,e,r){var n=t("base-x");e.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":1}],55:[function(t,e,r){"use strict";var n=t("bs58"),i=t("safe-buffer").Buffer;e.exports=function(t){function e(e){var r=e.slice(0,-4),n=e.slice(-4),i=t(r);if(!(n[0]^i[0]|n[1]^i[1]|n[2]^i[2]|n[3]^i[3]))return r}return{encode:function(e){var r=t(e);return n.encode(i.concat([e,r],e.length+4))},decode:function(t){var r=e(n.decode(t));if(!r)throw new Error("Invalid checksum");return r},decodeUnsafe:function(t){var r=n.decodeUnsafe(t);if(r)return e(r)}}}},{bs58:54,"safe-buffer":204}],56:[function(t,e,r){"use strict";var n=t("create-hash"),i=t("./base");e.exports=i(function(t){var e=n("sha256").update(t).digest();return n("sha256").update(e).digest()})},{"./base":55,"create-hash":58}],57:[function(t,e,r){var n=t("safe-buffer").Buffer,i=t("stream").Transform,o=t("string_decoder").StringDecoder;function s(t){i.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}t("inherits")(s,i),s.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},s.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},s.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},s.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},e.exports=s},{inherits:91,"safe-buffer":204,stream:230,string_decoder:245}],58:[function(t,e,r){"use strict";var n=t("inherits"),i=t("md5.js"),o=t("ripemd160"),s=t("sha.js"),a=t("cipher-base");function u(t){a.call(this,"digest"),this._hash=t}n(u,a),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(s(t))}},{"cipher-base":57,inherits:91,"md5.js":200,ripemd160:203,"sha.js":209}],59:[function(t,e,r){"use strict";var n=r;n.version=t("../package.json").version,n.utils=t("./elliptic/utils"),n.rand=t("brorand"),n.curve=t("./elliptic/curve"),n.curves=t("./elliptic/curves"),n.ec=t("./elliptic/ec"),n.eddsa=t("./elliptic/eddsa")},{"../package.json":76,"./elliptic/curve":62,"./elliptic/curves":65,"./elliptic/ec":66,"./elliptic/eddsa":69,"./elliptic/utils":73,brorand:53}],60:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.getNAF,s=i.getJSF,a=i.assert;function u(t,e){this.type=t,this.p=new n(e.p,16),this.red=e.prime?n.red(e.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=e.n&&new n(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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(t,e){this.curve=t,this.type=e,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){a(t.precomputed);var r=t._getDoubles(),n=o(e,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var s,u,f=[];for(s=0;s<n.length;s+=r.step){u=0;for(var h=s+r.step-1;h>=s;h--)u=(u<<1)+n[h];f.push(u)}for(var c=this.jpoint(null,null,null),d=this.jpoint(null,null,null),l=i;l>0;l--){for(s=0;s<f.length;s++)(u=f[s])===l?d=d.mixedAdd(r.points[s]):u===-l&&(d=d.mixedAdd(r.points[s].neg()));c=c.add(d)}return c.toP()},u.prototype._wnafMul=function(t,e){var r=4,n=t._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(e,r,this._bitLength),u=this.jpoint(null,null,null),f=s.length-1;f>=0;f--){for(var h=0;f>=0&&0===s[f];f--)h++;if(f>=0&&h++,u=u.dblp(h),f<0)break;var c=s[f];a(0!==c),u="affine"===t.type?c>0?u.mixedAdd(i[c-1>>1]):u.mixedAdd(i[-c-1>>1].neg()):c>0?u.add(i[c-1>>1]):u.add(i[-c-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,n,i){var a,u,f,h=this._wnafT1,c=this._wnafT2,d=this._wnafT3,l=0;for(a=0;a<n;a++){var p=(f=e[a])._getNAFPoints(t);h[a]=p.wnd,c[a]=p.points}for(a=n-1;a>=1;a-=2){var b=a-1,y=a;if(1===h[b]&&1===h[y]){var m=[e[b],null,null,e[y]];0===e[b].y.cmp(e[y].y)?(m[1]=e[b].add(e[y]),m[2]=e[b].toJ().mixedAdd(e[y].neg())):0===e[b].y.cmp(e[y].y.redNeg())?(m[1]=e[b].toJ().mixedAdd(e[y]),m[2]=e[b].add(e[y].neg())):(m[1]=e[b].toJ().mixedAdd(e[y]),m[2]=e[b].toJ().mixedAdd(e[y].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],w=s(r[b],r[y]);for(l=Math.max(w[0].length,l),d[b]=new Array(l),d[y]=new Array(l),u=0;u<l;u++){var v=0|w[0][u],_=0|w[1][u];d[b][u]=g[3*(v+1)+(_+1)],d[y][u]=0,c[b]=m}}else d[b]=o(r[b],h[b],this._bitLength),d[y]=o(r[y],h[y],this._bitLength),l=Math.max(d[b].length,l),l=Math.max(d[y].length,l)}var S=this.jpoint(null,null,null),E=this._wnafT4;for(a=l;a>=0;a--){for(var M=0;a>=0;){var k=!0;for(u=0;u<n;u++)E[u]=0|d[u][a],0!==E[u]&&(k=!1);if(!k)break;M++,a--}if(a>=0&&M++,S=S.dblp(M),a<0)break;for(u=0;u<n;u++){var A=E[u];0!==A&&(A>0?f=c[u][A-1>>1]:A<0&&(f=c[u][-A-1>>1].neg()),S="affine"===f.type?S.mixedAdd(f):S.add(f))}}for(a=0;a<n;a++)c[a]=null;return i?S:S.toP()},u.BasePoint=f,f.prototype.eq=function(){throw new Error("Not implemented")},f.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(t,e){t=i.toArray(t,e);var r=this.p.byteLength();if((4===t[0]||6===t[0]||7===t[0])&&t.length-1==2*r)return 6===t[0]?a(t[t.length-1]%2==0):7===t[0]&&a(t[t.length-1]%2==1),this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));if((2===t[0]||3===t[0])&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),3===t[0]);throw new Error("Unknown point format")},f.prototype.encodeCompressed=function(t){return this.encode(t,!0)},f.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},f.prototype.encode=function(t,e){return i.encode(this._encode(e),t)},f.prototype.precompute=function(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},f.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return!!e&&e.points.length>=Math.ceil((t.bitLength()+1)/e.step)},f.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<e;i+=t){for(var o=0;o<t;o++)n=n.dbl();r.push(n)}return{step:t,points:r}},f.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)e[i]=e[i-1].add(n);return{wnd:t,points:e}},f.prototype._getBeta=function(){return null},f.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e}},{"../utils":73,"bn.js":74}],61:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function u(t){this.twisted=1!=(0|t.a),this.mOneA=this.twisted&&-1==(0|t.a),this.extended=this.mOneA,s.call(this,"edwards",t),this.a=new i(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|t.c)}function f(t,e,r,n,o){s.BasePoint.call(this,t,"projective"),null===e&&null===r&&null===n?(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 i(e,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,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()))))}o(u,s),e.exports=u,u.prototype._mulA=function(t){return this.mOneA?t.redNeg():this.a.redMul(t)},u.prototype._mulC=function(t){return this.oneC?t:this.c.redMul(t)},u.prototype.jpoint=function(t,e,r,n){return this.point(t,e,r,n)},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var u=a.fromRed().isOdd();return(e&&!u||!e&&u)&&(a=a.redNeg()),this.point(t,a)},u.prototype.pointFromY=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(e)throw new Error("invalid point");return this.point(this.zero,t)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==e&&(a=a.redNeg()),this.point(a,t)},u.prototype.validate=function(t){if(t.isInfinity())return!0;t.normalize();var e=t.x.redSqr(),r=t.y.redSqr(),n=e.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(e).redMul(r)));return 0===n.cmp(i)},o(f,s.BasePoint),u.prototype.pointFromJSON=function(t){return f.fromJSON(this,t)},u.prototype.point=function(t,e,r,n){return new f(this,t,e,r,n)},f.fromJSON=function(t,e){return new f(t,e[0],e[1],e[2])},f.prototype.inspect=function(){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)+">"},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(t),i=this.x.redAdd(this.y).redSqr().redISub(t).redISub(e),o=n.redAdd(e),s=o.redSub(r),a=n.redSub(e),u=i.redMul(s),f=o.redMul(a),h=i.redMul(a),c=s.redMul(o);return this.curve.point(u,f,c,h)},f.prototype._projDbl=function(){var t,e,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var f=(n=this.curve._mulA(a)).redAdd(u);this.zOne?(t=s.redSub(a).redSub(u).redMul(f.redSub(this.curve.two)),e=f.redMul(n.redSub(u)),r=f.redSqr().redSub(f).redSub(f)):(i=this.z.redSqr(),o=f.redSub(i).redISub(i),t=s.redSub(a).redISub(u).redMul(o),e=f.redMul(n.redSub(u)),r=f.redMul(o))}else n=a.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),t=this.curve._mulC(s.redISub(n)).redMul(o),e=this.curve._mulC(n).redMul(a.redISub(u)),r=n.redMul(o);return this.curve.point(t,e,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(t){var e=this.y.redSub(this.x).redMul(t.y.redSub(t.x)),r=this.y.redAdd(this.x).redMul(t.y.redAdd(t.x)),n=this.t.redMul(this.curve.dd).redMul(t.t),i=this.z.redMul(t.z.redAdd(t.z)),o=r.redSub(e),s=i.redSub(n),a=i.redAdd(n),u=r.redAdd(e),f=o.redMul(s),h=a.redMul(u),c=o.redMul(u),d=s.redMul(a);return this.curve.point(f,h,d,c)},f.prototype._projAdd=function(t){var e,r,n=this.z.redMul(t.z),i=n.redSqr(),o=this.x.redMul(t.x),s=this.y.redMul(t.y),a=this.curve.d.redMul(o).redMul(s),u=i.redSub(a),f=i.redAdd(a),h=this.x.redAdd(this.y).redMul(t.x.redAdd(t.y)).redISub(o).redISub(s),c=n.redMul(u).redMul(h);return this.curve.twisted?(e=n.redMul(f).redMul(s.redSub(this.curve._mulA(o))),r=u.redMul(f)):(e=n.redMul(f).redMul(s.redSub(o)),r=this.curve._mulC(u).redMul(f)),this.curve.point(c,e,r)},f.prototype.add=function(t){return this.isInfinity()?t:t.isInfinity()?this:this.curve.extended?this._extAdd(t):this._projAdd(t)},f.prototype.mul=function(t){return this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!1)},f.prototype.jmulAdd=function(t,e,r){return this.curve._wnafMulAdd(1,[this,e],[t,r],2,!0)},f.prototype.normalize=function(){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},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(t){return this===t||0===this.getX().cmp(t.getX())&&0===this.getY().cmp(t.getY())},f.prototype.eqXToP=function(t){var e=t.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(e))return!0;for(var r=t.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(e.redIAdd(n),0===this.x.cmp(e))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../utils":73,"./base":60,"bn.js":74,inherits:75}],62:[function(t,e,r){"use strict";var n=r;n.base=t("./base"),n.short=t("./short"),n.mont=t("./mont"),n.edwards=t("./edwards")},{"./base":60,"./edwards":61,"./mont":63,"./short":64}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("inherits"),o=t("./base"),s=t("../utils");function a(t){o.call(this,"mont",t),this.a=new n(t.a,16).toRed(this.red),this.b=new n(t.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(t,e,r){o.BasePoint.call(this,t,"projective"),null===e&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(e,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(t){var e=t.normalize().x,r=e.redSqr(),n=r.redMul(e).redAdd(r.redMul(this.a)).redAdd(e);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),a.prototype.decodePoint=function(t,e){return this.point(s.toArray(t,e),1)},a.prototype.point=function(t,e){return new u(this,t,e)},a.prototype.pointFromJSON=function(t){return u.fromJSON(this,t)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(t,e){return new u(t,e[0],e[1]||t.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var t=this.x.redAdd(this.z).redSqr(),e=this.x.redSub(this.z).redSqr(),r=t.redSub(e),n=t.redMul(e),i=r.redMul(e.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(t,e){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=t.x.redAdd(t.z),o=t.x.redSub(t.z).redMul(r),s=i.redMul(n),a=e.z.redMul(o.redAdd(s).redSqr()),u=e.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,u)},u.prototype.mul=function(t){for(var e=t.clone(),r=this,n=this.curve.point(null,null),i=[];0!==e.cmpn(0);e.iushrn(1))i.push(e.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(t){return 0===this.getX().cmp(t.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":73,"./base":60,"bn.js":74,inherits:75}],64:[function(t,e,r){"use strict";var n=t("../utils"),i=t("bn.js"),o=t("inherits"),s=t("./base"),a=n.assert;function u(t){s.call(this,"short",t),this.a=new i(t.a,16).toRed(this.red),this.b=new i(t.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(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function f(t,e,r,n){s.BasePoint.call(this,t,"affine"),null===e&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(e,16),this.y=new i(r,16),n&&(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 h(t,e,r,n){s.BasePoint.call(this,t,"jacobian"),null===e&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(e,16),this.y=new i(r,16),this.z=new i(n,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}o(u,s),e.exports=u,u.prototype._getEndomorphism=function(t){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var e,r;if(t.beta)e=new i(t.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);e=(e=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new i(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return{beta:e,lambda:r,basis:t.basis?t.basis.map(function(t){return{a:new i(t.a,16),b:new i(t.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:i.mont(t),r=new i(2).toRed(e).redInvm(),n=r.redNeg(),o=new i(3).toRed(e).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(t){for(var e,r,n,o,s,a,u,f,h,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=t,l=this.n.clone(),p=new i(1),b=new i(0),y=new i(0),m=new i(1),g=0;0!==d.cmpn(0);){var w=l.div(d);f=l.sub(w.mul(d)),h=y.sub(w.mul(p));var v=m.sub(w.mul(b));if(!n&&f.cmp(c)<0)e=u.neg(),r=p,n=f.neg(),o=h;else if(n&&2==++g)break;u=f,l=d,d=f,y=p,p=h,m=b,b=v}s=f.neg(),a=h;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=e,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},u.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],n=e[1],i=n.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),u=i.mul(r.b),f=o.mul(n.b);return{k1:t.sub(s).sub(a),k2:u.add(f).neg()}},u.prototype.pointFromX=function(t,e){(t=new i(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(e&&!o||!e&&o)&&(n=n.redNeg()),this.point(t,n)},u.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,n=this.a.redMul(e),i=e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(t,e,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<t.length;o++){var s=this._endoSplit(e[o]),a=t[o],u=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),u=u.neg(!0)),n[2*o]=a,n[2*o+1]=u,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var f=this._wnafMulAdd(1,n,i,2*o,r),h=0;h<2*o;h++)n[h]=null,i[h]=null;return f},o(f,s.BasePoint),u.prototype.point=function(t,e,r){return new f(this,t,e,r)},u.prototype.pointFromJSON=function(t,e){return f.fromJSON(this,t,e)},f.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,n=function(t){return r.point(t.x.redMul(r.endo.beta),t.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return e}},f.prototype.toJSON=function(){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]},f.fromJSON=function(t,e,r){"string"==typeof e&&(e=JSON.parse(e));var n=t.point(e[0],e[1],r);if(!e[2])return n;function i(e){return t.point(e[0],e[1],r)}var o=e[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},f.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),n=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},f.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),n=t.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(t){return t=new i(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},f.prototype.mulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},f.prototype.jmulAdd=function(t,e,r){var n=[this,e],i=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},f.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},f.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,n=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return e},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(h,s.BasePoint),u.prototype.jpoint=function(t,e,r){return new h(this,t,e,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),n=this.y.redMul(e).redMul(t);return this.curve.point(r,n)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(e),i=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),a=n.redSub(i),u=o.redSub(s);if(0===a.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=a.redSqr(),h=f.redMul(a),c=n.redMul(f),d=u.redSqr().redIAdd(h).redISub(c).redISub(c),l=u.redMul(c.redISub(d)).redISub(o.redMul(h)),p=this.z.redMul(t.z).redMul(a);return this.curve.jpoint(d,l,p)},h.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,n=t.x.redMul(e),i=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=s.redSqr(),f=u.redMul(s),h=r.redMul(u),c=a.redSqr().redIAdd(f).redISub(h).redISub(h),d=a.redMul(h.redISub(c)).redISub(i.redMul(f)),l=this.z.redMul(s);return this.curve.jpoint(c,d,l)},h.prototype.dblp=function(t){if(0===t)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,u=a.redSqr().redSqr(),f=s.redAdd(s);for(e=0;e<t;e++){var h=o.redSqr(),c=f.redSqr(),d=c.redSqr(),l=h.redAdd(h).redIAdd(h).redIAdd(n.redMul(u)),p=o.redMul(c),b=l.redSqr().redISub(p.redAdd(p)),y=p.redISub(b),m=l.redMul(y);m=m.redIAdd(m).redISub(d);var g=f.redMul(a);e+1<t&&(u=u.redMul(d)),o=b,a=g,f=m}return this.curve.jpoint(o,f.redMul(i),a)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},h.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),u=a.redSqr().redISub(s).redISub(s),f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),t=u,e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.x.redSqr(),c=this.y.redSqr(),d=c.redSqr(),l=this.x.redAdd(c).redSqr().redISub(h).redISub(d);l=l.redIAdd(l);var p=h.redAdd(h).redIAdd(h),b=p.redSqr(),y=d.redIAdd(d);y=(y=y.redIAdd(y)).redIAdd(y),t=b.redISub(l).redISub(l),e=p.redMul(l.redISub(t)).redISub(y),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(t,e,r)},h.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=a.redSqr().redISub(s).redISub(s);t=u;var f=o.redIAdd(o);f=(f=f.redIAdd(f)).redIAdd(f),e=a.redMul(s.redISub(u)).redISub(f),r=this.y.redAdd(this.y)}else{var h=this.z.redSqr(),c=this.y.redSqr(),d=this.x.redMul(c),l=this.x.redSub(h).redMul(this.x.redAdd(h));l=l.redAdd(l).redIAdd(l);var p=d.redIAdd(d),b=(p=p.redIAdd(p)).redAdd(p);t=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(h);var y=c.redSqr();y=(y=(y=y.redIAdd(y)).redIAdd(y)).redIAdd(y),e=l.redMul(p.redISub(t)).redISub(y)}return this.curve.jpoint(t,e,r)},h.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=e.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(t.redMul(i)),u=e.redAdd(e),f=(u=u.redIAdd(u)).redMul(s),h=a.redSqr().redISub(f.redAdd(f)),c=f.redISub(h),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=a.redMul(c).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(h,l,p)},h.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),n=e.redSqr(),i=t.redAdd(t).redIAdd(t),o=i.redSqr(),s=this.x.redAdd(e).redSqr().redISub(t).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var f=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(u),h=e.redMul(f);h=(h=h.redIAdd(h)).redIAdd(h);var c=this.x.redMul(a).redISub(h);c=(c=c.redIAdd(c)).redIAdd(c);var d=this.y.redMul(f.redMul(u.redISub(f)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var l=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,d,l)},h.prototype.mul=function(t,e){return t=new i(t,e),this.curve._wnafMul(this,t)},h.prototype.eq=function(t){if("affine"===t.type)return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(0!==this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0))return!1;var n=e.redMul(this.z),i=r.redMul(t.z);return 0===this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0)},h.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(0===this.x.cmp(r))return!0;for(var n=t.clone(),i=this.curve.redN.redMul(e);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){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)+">"},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":73,"./base":60,"bn.js":74,inherits:75}],65:[function(t,e,r){"use strict";var n,i=r,o=t("hash.js"),s=t("./curve"),a=t("./utils").assert;function u(t){"short"===t.type?this.curve=new s.short(t):"edwards"===t.type?this.curve=new s.edwards(t):this.curve=new s.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function f(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,f("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:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:o.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"]}),f("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:o.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),f("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:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=t("./precomputed/secp256k1")}catch(t){n=void 0}f("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:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":62,"./precomputed/secp256k1":72,"./utils":73,"hash.js":78}],66:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("hmac-drbg"),o=t("../utils"),s=t("../curves"),a=t("brorand"),u=o.assert,f=t("./key"),h=t("./signature");function c(t){if(!(this instanceof c))return new c(t);"string"==typeof t&&(u(Object.prototype.hasOwnProperty.call(s,t),"Unknown curve "+t),t=s[t]),t instanceof s.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}e.exports=c,c.prototype.keyPair=function(t){return new f(this,t)},c.prototype.keyFromPrivate=function(t,e){return f.fromPrivate(this,t,e)},c.prototype.keyFromPublic=function(t,e){return f.fromPublic(this,t,e)},c.prototype.genKeyPair=function(t){t||(t={});for(var e=new i({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||a(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(e.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},c.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},c.prototype.sign=function(t,e,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new n(t,16));for(var s=this.n.byteLength(),a=e.getPrivate().toArray("be",s),u=t.toArray("be",s),f=new i({hash:this.hash,entropy:a,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),c=this.n.sub(new n(1)),d=0;;d++){var l=o.k?o.k(d):new n(f.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var m=l.invm(this.n).mul(y.mul(e.getPrivate()).iadd(t));if(0!==(m=m.umod(this.n)).cmpn(0)){var g=(p.getY().isOdd()?1:0)|(0!==b.cmp(y)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),g^=1),new h({r:y,s:m,recoveryParam:g})}}}}}},c.prototype.verify=function(t,e,r,i){t=this._truncateToN(new n(t,16)),r=this.keyFromPublic(r,i);var o=(e=new h(e,"hex")).r,s=e.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,u=s.invm(this.n),f=u.mul(t).umod(this.n),c=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(f,r.getPublic(),c)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(f,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},c.prototype.recoverPubKey=function(t,e,r,i){u((3&r)===r,"The recovery param is more than two bits"),e=new h(e,i);var o=this.n,s=new n(t),a=e.r,f=e.s,c=1&r,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");a=d?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var l=e.r.invm(o),p=o.sub(s).mul(l).umod(o),b=f.mul(l).umod(o);return this.g.mulAdd(p,a,b)},c.prototype.getKeyRecoveryParam=function(t,e,r,n){if(null!==(e=new h(e,n)).recoveryParam)return e.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(t,e,i)}catch(t){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},{"../curves":65,"../utils":73,"./key":67,"./signature":68,"bn.js":74,brorand:53,"hmac-drbg":90}],67:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils").assert;function o(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}e.exports=o,o.fromPublic=function(t,e,r){return e instanceof o?e:new o(t,{pub:e,pubEnc:r})},o.fromPrivate=function(t,e,r){return e instanceof o?e:new o(t,{priv:e,privEnc:r})},o.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.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"}},o.prototype.getPublic=function(t,e){return"string"==typeof t&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},o.prototype.getPrivate=function(t){return"hex"===t?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(t,e){this.priv=new n(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(t,e){if(t.x||t.y)return"mont"===this.ec.curve.type?i(t.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(t.x&&t.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(t.x,t.y));this.pub=this.ec.curve.decodePoint(t,e)},o.prototype.derive=function(t){return t.validate()||i(t.validate(),"public point not validated"),t.mul(this.priv).getX()},o.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},o.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":73,"bn.js":74}],68:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert;function s(t,e){if(t instanceof s)return t;this._importDER(t,e)||(o(t.r&&t.s,"Signature without r or s"),this.r=new n(t.r,16),this.s=new n(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function a(t,e){var r=t[e.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=e.place;o<n;o++,s++)i<<=8,i|=t[s],i>>>=0;return!(i<=127)&&(e.place=s,i)}function u(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e<r;)e++;return 0===e?t:t.slice(e)}function f(t,e){if(e<128)t.push(e);else{var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}}e.exports=s,s.prototype._importDER=function(t,e){t=i.toArray(t,e);var r=new function(){this.place=0};if(48!==t[r.place++])return!1;var o=a(t,r);if(!1===o)return!1;if(o+r.place!==t.length)return!1;if(2!==t[r.place++])return!1;var s=a(t,r);if(!1===s)return!1;var u=t.slice(r.place,s+r.place);if(r.place+=s,2!==t[r.place++])return!1;var f=a(t,r);if(!1===f)return!1;if(t.length!==f+r.place)return!1;var h=t.slice(r.place,f+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===h[0]){if(!(128&h[1]))return!1;h=h.slice(1)}return this.r=new n(u),this.s=new n(h),this.recoveryParam=null,!0},s.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=u(e),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,e.length),(n=n.concat(e)).push(2),f(n,r.length);var o=n.concat(r),s=[48];return f(s,o.length),s=s.concat(o),i.encode(s,t)}},{"../utils":73,"bn.js":74}],69:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("../curves"),o=t("../utils"),s=o.assert,a=o.parseBytes,u=t("./key"),f=t("./signature");function h(t){if(s("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof h))return new h(t);t=i[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=n.sha512}e.exports=h,h.prototype.sign=function(t,e){t=a(t);var r=this.keyFromSecret(e),n=this.hashInt(r.messagePrefix(),t),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),t).mul(r.priv()),u=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},h.prototype.verify=function(t,e,r){t=a(t),e=this.makeSignature(e);var n=this.keyFromPublic(r),i=this.hashInt(e.Rencoded(),n.pubBytes(),t),o=this.g.mul(e.S());return e.R().add(n.pub().mul(i)).eq(o)},h.prototype.hashInt=function(){for(var t=this.hash(),e=0;e<arguments.length;e++)t.update(arguments[e]);return o.intFromLE(t.digest()).umod(this.curve.n)},h.prototype.keyFromPublic=function(t){return u.fromPublic(this,t)},h.prototype.keyFromSecret=function(t){return u.fromSecret(this,t)},h.prototype.makeSignature=function(t){return t instanceof f?t:new f(this,t)},h.prototype.encodePoint=function(t){var e=t.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=t.getX().isOdd()?128:0,e},h.prototype.decodePoint=function(t){var e=(t=o.parseBytes(t)).length-1,r=t.slice(0,e).concat(-129&t[e]),n=0!=(128&t[e]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},h.prototype.encodeInt=function(t){return t.toArray("le",this.encodingLength)},h.prototype.decodeInt=function(t){return o.intFromLE(t)},h.prototype.isPoint=function(t){return t instanceof this.pointClass}},{"../curves":65,"../utils":73,"./key":70,"./signature":71,"hash.js":78}],70:[function(t,e,r){"use strict";var n=t("../utils"),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(t,e){this.eddsa=t,this._secret=o(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=o(e.pub)}a.fromPublic=function(t,e){return e instanceof a?e:new a(t,{pub:e})},a.fromSecret=function(t,e){return e instanceof a?e:new a(t,{secret:e})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(a,"privBytes",function(){var t=this.eddsa,e=this.hash(),r=t.encodingLength-1,n=e.slice(0,t.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),s(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(t){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(t,this)},a.prototype.verify=function(t,e){return this.eddsa.verify(t,e,this)},a.prototype.getSecret=function(t){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),t)},a.prototype.getPublic=function(t){return n.encode(this.pubBytes(),t)},e.exports=a},{"../utils":73}],71:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("../utils"),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function u(t,e){this.eddsa=t,"object"!=typeof e&&(e=a(e)),Array.isArray(e)&&(e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),o(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof n&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}s(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},{"../utils":73,"bn.js":74}],72:[function(t,e,r){e.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"]]}}},{}],73:[function(t,e,r){"use strict";var n=r,i=t("bn.js"),o=t("minimalistic-assert"),s=t("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(t,e,r){var n=new Array(Math.max(t.bitLength(),r)+1);n.fill(0);for(var i=1<<e+1,o=t.clone(),s=0;s<n.length;s++){var a,u=o.andln(i-1);o.isOdd()?(a=u>(i>>1)-1?(i>>1)-u:u,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var n,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var s,a,u=t.andln(3)+i&3,f=e.andln(3)+o&3;3===u&&(u=-1),3===f&&(f=-1),s=0==(1&u)?0:3!=(n=t.andln(7)+i&7)&&5!==n||2!==f?u:-u,r[0].push(s),a=0==(1&f)?0:3!=(n=e.andln(7)+o&7)&&5!==n||2!==u?f:-f,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},n.cachedProperty=function(t,e,r){var n="_"+e;t.prototype[e]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(t){return"string"==typeof t?n.toArray(t,"hex"):t},n.intFromLE=function(t){return new i(t,"hex","le")}},{"bn.js":74,"minimalistic-assert":201,"minimalistic-crypto-utils":202}],74:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof e?e.exports=o:r.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t("buffer").Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function f(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s<o;s++){var a=t.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<t.length&&(16===e?this._parseHex(t,i,r):(this._parseBase(t,e,i),"le"===r&&this._initArray(this.toArray(),e,r)))},o.prototype._initNumber=function(t,e,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):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("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 i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=t.length-1,o=0;i>=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<t.length;i+=3)s=t[i]|t[i+1]<<8|t[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=u(t,e,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,h=r;h<a;h+=n)u=f(t,h,h+n,e),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var c=1;for(u=f(t,h,t.length,e),h=0;h<s;h++)c*=e;this.imuln(c),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","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"],c=[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],d=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var f=1;f<n;f++){for(var h=u>>>26,c=67108863&u,d=Math.min(f,e.length-1),l=Math.max(0,f-t.length+1);l<=d;l++){var p=f-l|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[l])+c)/67108864|0,c=67108863&s}r.words[f]=0|c,u=0|h}return 0!==u?r.words[f]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],u=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var f=c[t],l=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(t);r=(p=p.idivn(l)).isZero()?b+r:h[f-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){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&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,f=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[a]=s;for(;a<o;a++)f[a]=0}else{for(a=0;a<o-i;a++)f[a]=0;for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),f[o-a-1]=s}return f},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return n(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return n(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;n<r.length;n++)this.words[n]=e.words[n]^r.words[n];if(this!==e)for(;n<e.length;n++)this.words[n]=e.words[n];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return n(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i<e;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(t){var e,r,n;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o<n.length;o++)e=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&e,i=e>>>26;for(;0!==i&&o<r.length;o++)e=(0|r.words[o])+i,this.words[o]=67108863&e,i=e>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s<n.length;s++)o=(e=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&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()},o.prototype.sub=function(t){return this.clone().isub(t)};var p=function(t,e,r){var n,i,o,s=t.words,a=e.words,u=r.words,f=0,h=0|s[0],c=8191&h,d=h>>>13,l=0|s[1],p=8191&l,b=l>>>13,y=0|s[2],m=8191&y,g=y>>>13,w=0|s[3],v=8191&w,_=w>>>13,S=0|s[4],E=8191&S,M=S>>>13,k=0|s[5],A=8191&k,I=k>>>13,T=0|s[6],x=8191&T,O=T>>>13,P=0|s[7],N=8191&P,R=P>>>13,B=0|s[8],U=8191&B,C=B>>>13,j=0|s[9],L=8191&j,H=j>>>13,D=0|a[0],q=8191&D,F=D>>>13,z=0|a[1],K=8191&z,V=z>>>13,W=0|a[2],G=8191&W,X=W>>>13,Z=0|a[3],Y=8191&Z,$=Z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ft=at>>>13,ht=0|a[8],ct=8191&ht,dt=ht>>>13,lt=0|a[9],pt=8191<,bt=lt>>>13;r.negative=t.negative^e.negative,r.length=19;var yt=(f+(n=Math.imul(c,q))|0)+((8191&(i=(i=Math.imul(c,F))+Math.imul(d,q)|0))<<13)|0;f=((o=Math.imul(d,F))+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,F))+Math.imul(b,q)|0,o=Math.imul(b,F);var mt=(f+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,V)|0)+Math.imul(d,K)|0))<<13)|0;f=((o=o+Math.imul(d,V)|0)+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(m,q),i=(i=Math.imul(m,F))+Math.imul(g,q)|0,o=Math.imul(g,F),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(b,K)|0,o=o+Math.imul(b,V)|0;var gt=(f+(n=n+Math.imul(c,G)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(d,G)|0))<<13)|0;f=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(v,q),i=(i=Math.imul(v,F))+Math.imul(_,q)|0,o=Math.imul(_,F),n=n+Math.imul(m,K)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,X)|0;var wt=(f+(n=n+Math.imul(c,Y)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(d,Y)|0))<<13)|0;f=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,q),i=(i=Math.imul(E,F))+Math.imul(M,q)|0,o=Math.imul(M,F),n=n+Math.imul(v,K)|0,i=(i=i+Math.imul(v,V)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,X)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0;var vt=(f+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;f=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(A,q),i=(i=Math.imul(A,F))+Math.imul(I,q)|0,o=Math.imul(I,F),n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,V)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,$)|0)+Math.imul(g,Y)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0;var _t=(f+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;f=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,F))+Math.imul(O,q)|0,o=Math.imul(O,F),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(E,G)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,$)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0;var St=(f+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;f=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,F))+Math.imul(R,q)|0,o=Math.imul(R,F),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(v,Q)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(m,rt)|0,i=(i=i+Math.imul(m,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0;var Et=(f+(n=n+Math.imul(c,ut)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(d,ut)|0))<<13)|0;f=((o=o+Math.imul(d,ft)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,F))+Math.imul(C,q)|0,o=Math.imul(C,F),n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,V)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(m,ot)|0,i=(i=i+Math.imul(m,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(b,ut)|0,o=o+Math.imul(b,ft)|0;var Mt=(f+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;f=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,F))+Math.imul(H,q)|0,o=Math.imul(H,F),n=n+Math.imul(U,K)|0,i=(i=i+Math.imul(U,V)|0)+Math.imul(C,K)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(x,Y)|0,i=(i=i+Math.imul(x,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(m,ut)|0,i=(i=i+Math.imul(m,ft)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ft)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(b,ct)|0,o=o+Math.imul(b,dt)|0;var kt=(f+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,bt)|0)+Math.imul(d,pt)|0))<<13)|0;f=((o=o+Math.imul(d,bt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,V))+Math.imul(H,K)|0,o=Math.imul(H,V),n=n+Math.imul(U,G)|0,i=(i=i+Math.imul(U,X)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,X)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ft)|0,n=n+Math.imul(m,ct)|0,i=(i=i+Math.imul(m,dt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,dt)|0;var At=(f+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,bt)|0)+Math.imul(b,pt)|0))<<13)|0;f=((o=o+Math.imul(b,bt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(L,G),i=(i=Math.imul(L,X))+Math.imul(H,G)|0,o=Math.imul(H,X),n=n+Math.imul(U,Y)|0,i=(i=i+Math.imul(U,$)|0)+Math.imul(C,Y)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,ut)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ft)|0,n=n+Math.imul(v,ct)|0,i=(i=i+Math.imul(v,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var It=(f+(n=n+Math.imul(m,pt)|0)|0)+((8191&(i=(i=i+Math.imul(m,bt)|0)+Math.imul(g,pt)|0))<<13)|0;f=((o=o+Math.imul(g,bt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(L,Y),i=(i=Math.imul(L,$))+Math.imul(H,Y)|0,o=Math.imul(H,$),n=n+Math.imul(U,Q)|0,i=(i=i+Math.imul(U,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ft)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,dt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,dt)|0;var Tt=(f+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,bt)|0)+Math.imul(_,pt)|0))<<13)|0;f=((o=o+Math.imul(_,bt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(L,Q),i=(i=Math.imul(L,tt))+Math.imul(H,Q)|0,o=Math.imul(H,tt),n=n+Math.imul(U,rt)|0,i=(i=i+Math.imul(U,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(x,ut)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ft)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var xt=(f+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,bt)|0)+Math.imul(M,pt)|0))<<13)|0;f=((o=o+Math.imul(M,bt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(L,rt),i=(i=Math.imul(L,nt))+Math.imul(H,rt)|0,o=Math.imul(H,nt),n=n+Math.imul(U,ot)|0,i=(i=i+Math.imul(U,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ft)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,dt)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,dt)|0;var Ot=(f+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,bt)|0)+Math.imul(I,pt)|0))<<13)|0;f=((o=o+Math.imul(I,bt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(L,ot),i=(i=Math.imul(L,st))+Math.imul(H,ot)|0,o=Math.imul(H,st),n=n+Math.imul(U,ut)|0,i=(i=i+Math.imul(U,ft)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ft)|0,n=n+Math.imul(N,ct)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,dt)|0;var Pt=(f+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,bt)|0)+Math.imul(O,pt)|0))<<13)|0;f=((o=o+Math.imul(O,bt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(L,ut),i=(i=Math.imul(L,ft))+Math.imul(H,ut)|0,o=Math.imul(H,ft),n=n+Math.imul(U,ct)|0,i=(i=i+Math.imul(U,dt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,dt)|0;var Nt=(f+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,bt)|0)+Math.imul(R,pt)|0))<<13)|0;f=((o=o+Math.imul(R,bt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(L,ct),i=(i=Math.imul(L,dt))+Math.imul(H,ct)|0,o=Math.imul(H,dt);var Rt=(f+(n=n+Math.imul(U,pt)|0)|0)+((8191&(i=(i=i+Math.imul(U,bt)|0)+Math.imul(C,pt)|0))<<13)|0;f=((o=o+Math.imul(C,bt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Bt=(f+(n=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,bt))+Math.imul(H,pt)|0))<<13)|0;return f=((o=Math.imul(H,bt))+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,u[0]=yt,u[1]=mt,u[2]=gt,u[3]=wt,u[4]=vt,u[5]=_t,u[6]=St,u[7]=Et,u[8]=Mt,u[9]=kt,u[10]=At,u[11]=It,u[12]=Tt,u[13]=xt,u[14]=Ot,u[15]=Pt,u[16]=Nt,u[17]=Rt,u[18]=Bt,0!==f&&(u[19]=f,r.length++),r};function b(t,e,r){return(new y).mulp(t,e,r)}function y(t,e){this.x=t,this.y=e}Math.imul||(p=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,u=Math.min(o,e.length-1),f=Math.max(0,o-t.length+1);f<=u;f++){var h=o-f,c=(0|t.words[h])*(0|e.words[f]),d=67108863&c;a=67108863&(d=d+a|0),i+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):b(this,t,e)},y.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n<t;n++)e[n]=this.revBin(n,r,t);return e},y.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var n=0,i=0;i<e;i++)n|=(1&t)<<e-i-1,t>>=1;return n},y.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s<o;s++)n[s]=e[t[s]],i[s]=r[t[s]]},y.prototype.transform=function(t,e,r,n,i,o){this.permute(o,t,e,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,u=Math.cos(2*Math.PI/a),f=Math.sin(2*Math.PI/a),h=0;h<i;h+=a)for(var c=u,d=f,l=0;l<s;l++){var p=r[h+l],b=n[h+l],y=r[h+l+s],m=n[h+l+s],g=c*y-d*m;m=c*m+d*y,y=g,r[h+l]=p+y,n[h+l]=b+m,r[h+l+s]=p-y,n[h+l+s]=b-m,l!==a&&(g=u*c-f*d,d=u*d+f*c,c=g)}},y.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},y.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=t[n];t[n]=t[r-n-1],t[r-n-1]=i,i=e[n],e[n]=-e[r-n-1],e[r-n-1]=-i}},y.prototype.normalize13b=function(t,e){for(var r=0,n=0;n<e/2;n++){var i=8192*Math.round(t[2*n+1]/e)+Math.round(t[2*n]/e)+r;t[n]=67108863&i,r=i<67108864?0:i/67108864|0}return t},y.prototype.convert13b=function(t,e,r,i){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},y.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},y.prototype.mulp=function(t,e,r){var n=2*this.guessLen13b(t.length,e.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),u=new Array(n),f=new Array(n),h=new Array(n),c=new Array(n),d=r.words;d.length=n,this.convert13b(t.words,t.length,s,n),this.convert13b(e.words,e.length,f,n),this.transform(s,o,a,u,n,i),this.transform(f,o,h,c,n,i);for(var l=0;l<n;l++){var p=a[l]*h[l]-u[l]*c[l];u[l]=a[l]*c[l]+u[l]*h[l],a[l]=p}return this.conjugate(a,u,n),this.transform(a,u,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),b(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){n("number"==typeof t),n(t<67108864);for(var e=0,r=0;r<this.length;r++){var i=(0|this.words[r])*t,o=(67108863&i)+(67108863&e);e>>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var n=r/26|0,i=r%26;e[r]=(t.words[n]&1<<i)>>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n<e.length&&0===e[n];n++,r=r.sqr());if(++n<e.length)for(var i=r.sqr();n<e.length;n++,i=i.sqr())0!==e[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(t){n("number"==typeof t&&t>=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var a=this.words[e]&o,u=(0|this.words[e])-a<<r;this.words[e]=u|s,s=a>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e<i;e++)this.words[e]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(t){return n(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var i;n("number"==typeof t&&t>=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<<o,u=r;if(i-=s,i=Math.max(0,i),u){for(var f=0;f<s;f++)u.words[f]=this.words[f];u.length=s}if(0===s);else if(this.length>s)for(this.length-=s,f=0;f<this.length;f++)this.words[f]=this.words[f+s];else this.words[0]=0,this.length=1;var h=0;for(f=this.length-1;f>=0&&(0!==h||f>=i);f--){var c=0|this.words[f];this.words[f]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<<e;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<<e;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return n("number"==typeof t),n(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)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(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 e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var i,o,s=t.length+r;this._expand(s);var a=0;for(i=0;i<t.length;i++){o=(0|this.words[i+r])+a;var u=(0|t.words[i])*e;a=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var f=0;f<a.length;f++)a.words[f]=0}var h=n.clone()._ishlnsubmul(i,1,u);0===h.negative&&(n=h,a&&(a.words[u]=1));for(var c=u-1;c>=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);a&&(a.words[c]=d)}return a&&a.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),f=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++f;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var d=0,l=1;0==(e.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(f)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var f=0,h=1;0==(e.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(e.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:i<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){n<i?e=-1:n>i&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new E(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function g(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(w,g),w.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n<r;n++)e.words[n]=t.words[n];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var i=t.words[9];for(e.words[e.length++]=4194303&i,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(4194303&o)<<4|i>>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},w.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var n=0|t.words[r];e+=977*n,t.words[r]=67108863&e,e=64*n+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},i(v,g),i(_,g),i(S,g),S.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var n=19*(0|t.words[r])+e,i=67108863&n;n>>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new w;else if("p224"===t)e=new v;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return m[t]=e,e},E.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),f=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,f).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,i),d=this.pow(t,i.addn(1).iushrn(1)),l=this.pow(t,i),p=s;0!==l.cmp(a);){for(var b=l,y=0;0!==b.cmp(a);y++)b=b.redSqr();n(y<p);var m=this.pow(c,new o(1).iushln(p-y-1));d=d.redMul(m),c=m.redSqr(),l=l.redMul(c),p=y}return d},E.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},E.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],t);var i=r[0],s=0,a=0,u=e.bitLength()%26;for(0===u&&(u=26),n=e.length-1;n>=0;n--){for(var f=e.words[n],h=u-1;h>=0;h--){var c=f>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++a||0===n&&0===h)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,E),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:222}],75:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],76:[function(t,e,r){e.exports={_args:[["elliptic@6.5.4","/Users/wjl/Documents/wnd-demo/bolt11"]],_from:"elliptic@6.5.4",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"elliptic@6.5.4",name:"elliptic",escapedName:"elliptic",rawSpec:"6.5.4",saveSpec:null,fetchSpec:"6.5.4"},_requiredBy:["/secp256k1"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_spec:"6.5.4",_where:"/Users/wjl/Documents/wnd-demo/bolt11",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},description:"EC cryptography",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},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://git@github.com/indutny/elliptic.git"},scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",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.4"}},{}],77:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("stream").Transform;function o(t){i.call(this),this._block=n.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}t("inherits")(o,i),o.prototype._transform=function(t,e,r){var n=null;try{this.update(t,e)}catch(t){n=t}r(n)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(t){e=t}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!n.isBuffer(t)&&"string"!=typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(t)||(t=n.from(t,e));for(var r=this._block,i=0;this._blockOffset+t.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=t[i++];this._update(),this._blockOffset=0}for(;i<t.length;)r[this._blockOffset++]=t[i++];for(var s=0,a=8*t.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.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},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},{inherits:91,"safe-buffer":204,stream:230}],78:[function(t,e,r){var n=r;n.utils=t("./hash/utils"),n.common=t("./hash/common"),n.sha=t("./hash/sha"),n.ripemd=t("./hash/ripemd"),n.hmac=t("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":79,"./hash/hmac":80,"./hash/ripemd":81,"./hash/sha":82,"./hash/utils":89}],79:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(){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}r.BlockHash=o,o.prototype.update=function(t,e){if(t=n.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},o.prototype.digest=function(t){return this.update(this._pad()),i(null===this.pending),this._digest(t)},o.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(t<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=t>>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},{"./utils":89,"minimalistic-assert":201}],80:[function(t,e,r){"use strict";var n=t("./utils"),i=t("minimalistic-assert");function o(t,e,r){if(!(this instanceof o))return new o(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(e,r))}e.exports=o,o.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=(new this.Hash).update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=(new this.Hash).update(t)},o.prototype.update=function(t,e){return this.inner.update(t,e),this},o.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)}},{"./utils":89,"minimalistic-assert":201}],81:[function(t,e,r){"use strict";var n=t("./utils"),i=t("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,u=n.sum32_4,f=i.BlockHash;function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(t,e,r,n){return t<=15?e^r^n:t<=31?e&r|~e&n:t<=47?(e|~r)^n:t<=63?e&n|r&~n:e^(r|~n)}function d(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function l(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}n.inherits(h,f),r.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=function(t,e){for(var r=this.h[0],n=this.h[1],i=this.h[2],f=this.h[3],h=this.h[4],g=r,w=n,v=i,_=f,S=h,E=0;E<80;E++){var M=s(o(u(r,c(E,n,i,f),t[p[E]+e],d(E)),y[E]),h);r=h,h=f,f=o(i,10),i=n,n=M,M=s(o(u(g,c(79-E,w,v,_),t[b[E]+e],l(E)),m[E]),S),g=S,S=_,_=o(v,10),v=w,w=M}M=a(this.h[1],i,_),this.h[1]=a(this.h[2],f,S),this.h[2]=a(this.h[3],h,g),this.h[3]=a(this.h[4],r,w),this.h[4]=a(this.h[0],n,v),this.h[0]=M},h.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],b=[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],y=[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],m=[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":79,"./utils":89}],82:[function(t,e,r){"use strict";r.sha1=t("./sha/1"),r.sha224=t("./sha/224"),r.sha256=t("./sha/256"),r.sha384=t("./sha/384"),r.sha512=t("./sha/512")},{"./sha/1":83,"./sha/224":84,"./sha/256":85,"./sha/384":86,"./sha/512":87}],83:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=n.rotl32,a=n.sum32,u=n.sum32_5,f=o.ft_1,h=i.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(d,h),e.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],h=this.h[2],d=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(s(i,5),f(p,o,h,d),l,r[n],c[p]);l=d,d=h,h=s(o,30),o=i,i=b}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],h),this.h[3]=a(this.h[3],d),this.h[4]=a(this.h[4],l)},d.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":79,"../utils":89,"./common":88}],84:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./256");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":89,"./256":85}],85:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("./common"),s=t("minimalistic-assert"),a=n.sum32,u=n.sum32_4,f=n.sum32_5,h=o.ch32,c=o.maj32,d=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,y=i.BlockHash,m=[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 g(){if(!(this instanceof g))return new g;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,y),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],y=this.h[2],m=this.h[3],g=this.h[4],w=this.h[5],v=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var S=f(_,l(g),h(g,w,v),this.k[n],r[n]),E=a(d(i),c(i,o,y));_=v,v=w,w=g,g=a(m,S),m=y,y=o,o=i,i=a(S,E)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],y),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],g),this.h[5]=a(this.h[5],w),this.h[6]=a(this.h[6],v),this.h[7]=a(this.h[7],_)},g.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":79,"../utils":89,"./common":88,"minimalistic-assert":201}],86:[function(t,e,r){"use strict";var n=t("../utils"),i=t("./512");function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":89,"./512":87}],87:[function(t,e,r){"use strict";var n=t("../utils"),i=t("../common"),o=t("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,u=n.shr64_hi,f=n.shr64_lo,h=n.sum64,c=n.sum64_hi,d=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,y=n.sum64_5_lo,m=i.BlockHash,g=[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 w(){if(!(this instanceof w))return new w;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=g,this.W=new Array(160)}function v(t,e,r,n,i){var o=t&r^~t&i;return o<0&&(o+=4294967296),o}function _(t,e,r,n,i,o){var s=e&n^~e&o;return s<0&&(s+=4294967296),s}function S(t,e,r,n,i){var o=t&r^t&i^r&i;return o<0&&(o+=4294967296),o}function E(t,e,r,n,i,o){var s=e&n^e&o^n&o;return s<0&&(s+=4294967296),s}function M(t,e){var r=s(t,e,28)^s(e,t,2)^s(e,t,7);return r<0&&(r+=4294967296),r}function k(t,e){var r=a(t,e,28)^a(e,t,2)^a(e,t,7);return r<0&&(r+=4294967296),r}function A(t,e){var r=s(t,e,14)^s(t,e,18)^s(e,t,9);return r<0&&(r+=4294967296),r}function I(t,e){var r=a(t,e,14)^a(t,e,18)^a(e,t,9);return r<0&&(r+=4294967296),r}function T(t,e){var r=s(t,e,1)^s(t,e,8)^u(t,e,7);return r<0&&(r+=4294967296),r}function x(t,e){var r=a(t,e,1)^a(t,e,8)^f(t,e,7);return r<0&&(r+=4294967296),r}function O(t,e){var r=s(t,e,19)^s(e,t,29)^u(t,e,6);return r<0&&(r+=4294967296),r}function P(t,e){var r=a(t,e,19)^a(e,t,29)^f(t,e,6);return r<0&&(r+=4294967296),r}n.inherits(w,m),e.exports=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(t,e){for(var r=this.W,n=0;n<32;n++)r[n]=t[e+n];for(;n<r.length;n+=2){var i=O(r[n-4],r[n-3]),o=P(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],u=T(r[n-30],r[n-29]),f=x(r[n-30],r[n-29]),h=r[n-32],c=r[n-31];r[n]=l(i,o,s,a,u,f,h,c),r[n+1]=p(i,o,s,a,u,f,h,c)}},w.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],f=this.h[5],l=this.h[6],p=this.h[7],m=this.h[8],g=this.h[9],w=this.h[10],T=this.h[11],x=this.h[12],O=this.h[13],P=this.h[14],N=this.h[15];o(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var B=P,U=N,C=A(m,g),j=I(m,g),L=v(m,g,w,T,x),H=_(m,g,w,T,x,O),D=this.k[R],q=this.k[R+1],F=r[R],z=r[R+1],K=b(B,U,C,j,L,H,D,q,F,z),V=y(B,U,C,j,L,H,D,q,F,z);B=M(n,i),U=k(n,i),C=S(n,i,s,a,u),j=E(n,i,s,a,u,f);var W=c(B,U,C,j),G=d(B,U,C,j);P=x,N=O,x=w,O=T,w=m,T=g,m=c(l,p,K,V),g=d(p,p,K,V),l=u,p=f,u=s,f=a,s=n,a=i,n=c(K,V,W,G),i=d(K,V,W,G)}h(this.h,0,n,i),h(this.h,2,s,a),h(this.h,4,u,f),h(this.h,6,l,p),h(this.h,8,m,g),h(this.h,10,w,T),h(this.h,12,x,O),h(this.h,14,P,N)},w.prototype._digest=function(t){return"hex"===t?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":79,"../utils":89,"minimalistic-assert":201}],88:[function(t,e,r){"use strict";var n=t("../utils").rotr32;function i(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function s(t,e,r){return t^e^r}r.ft_1=function(t,e,r,n){return 0===t?i(e,r,n):1===t||3===t?s(e,r,n):2===t?o(e,r,n):void 0},r.ch32=i,r.maj32=o,r.p32=s,r.s0_256=function(t){return n(t,2)^n(t,13)^n(t,22)},r.s1_256=function(t){return n(t,6)^n(t,11)^n(t,25)},r.g0_256=function(t){return n(t,7)^n(t,18)^t>>>3},r.g1_256=function(t){return n(t,17)^n(t,19)^t>>>10}},{"../utils":89}],89:[function(t,e,r){"use strict";var n=t("minimalistic-assert"),i=t("inherits");function o(t,e){return 55296==(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320==(64512&t.charCodeAt(e+1)))}function s(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}r.inherits=i,r.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),i=0;i<t.length;i+=2)r.push(parseInt(t[i]+t[i+1],16))}else for(var n=0,i=0;i<t.length;i++){var s=t.charCodeAt(i);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):o(t,i)?(s=65536+((1023&s)<<10)+(1023&t.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(i=0;i<t.length;i++)r[i]=0|t[i];return r},r.toHex=function(t){for(var e="",r=0;r<t.length;r++)e+=a(t[r].toString(16));return e},r.htonl=s,r.toHex32=function(t,e){for(var r="",n=0;n<t.length;n++){var i=t[n];"little"===e&&(i=s(i)),r+=u(i.toString(16))}return r},r.zero2=a,r.zero8=u,r.join32=function(t,e,r,i){var o=r-e;n(o%4==0);for(var s=new Array(o/4),a=0,u=e;a<s.length;a++,u+=4){var f;f="big"===i?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=f>>>0}return s},r.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n<t.length;n++,i+=4){var o=t[n];"big"===e?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},r.rotr32=function(t,e){return t>>>e|t<<32-e},r.rotl32=function(t,e){return t<<e|t>>>32-e},r.sum32=function(t,e){return t+e>>>0},r.sum32_3=function(t,e,r){return t+e+r>>>0},r.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},r.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},r.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,s=(o<n?1:0)+r+i;t[e]=s>>>0,t[e+1]=o},r.sum64_hi=function(t,e,r,n){return(e+n>>>0<e?1:0)+t+r>>>0},r.sum64_lo=function(t,e,r,n){return e+n>>>0},r.sum64_4_hi=function(t,e,r,n,i,o,s,a){var u=0,f=e;return u+=(f=f+n>>>0)<e?1:0,u+=(f=f+o>>>0)<o?1:0,t+r+i+s+(u+=(f=f+a>>>0)<a?1:0)>>>0},r.sum64_4_lo=function(t,e,r,n,i,o,s,a){return e+n+o+a>>>0},r.sum64_5_hi=function(t,e,r,n,i,o,s,a,u,f){var h=0,c=e;return h+=(c=c+n>>>0)<e?1:0,h+=(c=c+o>>>0)<o?1:0,h+=(c=c+a>>>0)<a?1:0,t+r+i+s+u+(h+=(c=c+f>>>0)<f?1:0)>>>0},r.sum64_5_lo=function(t,e,r,n,i,o,s,a,u,f){return e+n+o+a+f>>>0},r.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},r.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},r.shr64_hi=function(t,e,r){return t>>>r},r.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},{inherits:91,"minimalistic-assert":201}],90:[function(t,e,r){"use strict";var n=t("hash.js"),i=t("minimalistic-crypto-utils"),o=t("minimalistic-assert");function s(t){if(!(this instanceof s))return new s(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=i.toArray(t.entropy,t.entropyEnc||"hex"),r=i.toArray(t.nonce,t.nonceEnc||"hex"),n=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}e.exports=s,s.prototype._init=function(t,e,r){var n=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(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())},s.prototype.reseed=function(t,e,r,n){"string"!=typeof e&&(n=r,r=e,e=null),t=i.toArray(t,e),r=i.toArray(r,n),o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},s.prototype.generate=function(t,e,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(n=r,r=e,e=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,t);return this._update(r),this._reseed++,i.encode(s,e)}},{"hash.js":78,"minimalistic-assert":201,"minimalistic-crypto-utils":202}],91:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],92:[function(t,e,r){var n=t("./_getNative")(t("./_root"),"DataView");e.exports=n},{"./_getNative":141,"./_root":176}],93:[function(t,e,r){var n=t("./_hashClear"),i=t("./_hashDelete"),o=t("./_hashGet"),s=t("./_hashHas"),a=t("./_hashSet");function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},{"./_hashClear":148,"./_hashDelete":149,"./_hashGet":150,"./_hashHas":151,"./_hashSet":152}],94:[function(t,e,r){var n=t("./_listCacheClear"),i=t("./_listCacheDelete"),o=t("./_listCacheGet"),s=t("./_listCacheHas"),a=t("./_listCacheSet");function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},{"./_listCacheClear":160,"./_listCacheDelete":161,"./_listCacheGet":162,"./_listCacheHas":163,"./_listCacheSet":164}],95:[function(t,e,r){var n=t("./_getNative")(t("./_root"),"Map");e.exports=n},{"./_getNative":141,"./_root":176}],96:[function(t,e,r){var n=t("./_mapCacheClear"),i=t("./_mapCacheDelete"),o=t("./_mapCacheGet"),s=t("./_mapCacheHas"),a=t("./_mapCacheSet");function u(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=o,u.prototype.has=s,u.prototype.set=a,e.exports=u},{"./_mapCacheClear":165,"./_mapCacheDelete":166,"./_mapCacheGet":167,"./_mapCacheHas":168,"./_mapCacheSet":169}],97:[function(t,e,r){var n=t("./_getNative")(t("./_root"),"Promise");e.exports=n},{"./_getNative":141,"./_root":176}],98:[function(t,e,r){var n=t("./_getNative")(t("./_root"),"Set");e.exports=n},{"./_getNative":141,"./_root":176}],99:[function(t,e,r){var n=t("./_ListCache"),i=t("./_stackClear"),o=t("./_stackDelete"),s=t("./_stackGet"),a=t("./_stackHas"),u=t("./_stackSet");function f(t){var e=this.__data__=new n(t);this.size=e.size}f.prototype.clear=i,f.prototype.delete=o,f.prototype.get=s,f.prototype.has=a,f.prototype.set=u,e.exports=f},{"./_ListCache":94,"./_stackClear":177,"./_stackDelete":178,"./_stackGet":179,"./_stackHas":180,"./_stackSet":181}],100:[function(t,e,r){var n=t("./_root").Symbol;e.exports=n},{"./_root":176}],101:[function(t,e,r){var n=t("./_root").Uint8Array;e.exports=n},{"./_root":176}],102:[function(t,e,r){var n=t("./_getNative")(t("./_root"),"WeakMap");e.exports=n},{"./_getNative":141,"./_root":176}],103:[function(t,e,r){e.exports=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}},{}],104:[function(t,e,r){e.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}},{}],105:[function(t,e,r){var n=t("./_baseTimes"),i=t("./isArguments"),o=t("./isArray"),s=t("./isBuffer"),a=t("./_isIndex"),u=t("./isTypedArray"),f=Object.prototype.hasOwnProperty;e.exports=function(t,e){var r=o(t),h=!r&&i(t),c=!r&&!h&&s(t),d=!r&&!h&&!c&&u(t),l=r||h||c||d,p=l?n(t.length,String):[],b=p.length;for(var y in t)!e&&!f.call(t,y)||l&&("length"==y||c&&("offset"==y||"parent"==y)||d&&("buffer"==y||"byteLength"==y||"byteOffset"==y)||a(y,b))||p.push(y);return p}},{"./_baseTimes":123,"./_isIndex":156,"./isArguments":185,"./isArray":186,"./isBuffer":188,"./isTypedArray":195}],106:[function(t,e,r){e.exports=function(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}},{}],107:[function(t,e,r){var n=t("./_baseAssignValue"),i=t("./eq"),o=Object.prototype.hasOwnProperty;e.exports=function(t,e,r){var s=t[e];o.call(t,e)&&i(s,r)&&(void 0!==r||e in t)||n(t,e,r)}},{"./_baseAssignValue":111,"./eq":184}],108:[function(t,e,r){var n=t("./eq");e.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},{"./eq":184}],109:[function(t,e,r){var n=t("./_copyObject"),i=t("./keys");e.exports=function(t,e){return t&&n(e,i(e),t)}},{"./_copyObject":132,"./keys":196}],110:[function(t,e,r){var n=t("./_copyObject"),i=t("./keysIn");e.exports=function(t,e){return t&&n(e,i(e),t)}},{"./_copyObject":132,"./keysIn":197}],111:[function(t,e,r){var n=t("./_defineProperty");e.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},{"./_defineProperty":136}],112:[function(t,e,r){var n=t("./_Stack"),i=t("./_arrayEach"),o=t("./_assignValue"),s=t("./_baseAssign"),a=t("./_baseAssignIn"),u=t("./_cloneBuffer"),f=t("./_copyArray"),h=t("./_copySymbols"),c=t("./_copySymbolsIn"),d=t("./_getAllKeys"),l=t("./_getAllKeysIn"),p=t("./_getTag"),b=t("./_initCloneArray"),y=t("./_initCloneByTag"),m=t("./_initCloneObject"),g=t("./isArray"),w=t("./isBuffer"),v=t("./isMap"),_=t("./isObject"),S=t("./isSet"),E=t("./keys"),M=t("./keysIn"),k=1,A=2,I=4,T="[object Arguments]",x="[object Function]",O="[object GeneratorFunction]",P="[object Object]",N={};N[T]=N["[object Array]"]=N["[object ArrayBuffer]"]=N["[object DataView]"]=N["[object Boolean]"]=N["[object Date]"]=N["[object Float32Array]"]=N["[object Float64Array]"]=N["[object Int8Array]"]=N["[object Int16Array]"]=N["[object Int32Array]"]=N["[object Map]"]=N["[object Number]"]=N[P]=N["[object RegExp]"]=N["[object Set]"]=N["[object String]"]=N["[object Symbol]"]=N["[object Uint8Array]"]=N["[object Uint8ClampedArray]"]=N["[object Uint16Array]"]=N["[object Uint32Array]"]=!0,N["[object Error]"]=N[x]=N["[object WeakMap]"]=!1,e.exports=function t(e,r,R,B,U,C){var j,L=r&k,H=r&A,D=r&I;if(R&&(j=U?R(e,B,U,C):R(e)),void 0!==j)return j;if(!_(e))return e;var q=g(e);if(q){if(j=b(e),!L)return f(e,j)}else{var F=p(e),z=F==x||F==O;if(w(e))return u(e,L);if(F==P||F==T||z&&!U){if(j=H||z?{}:m(e),!L)return H?c(e,a(j,e)):h(e,s(j,e))}else{if(!N[F])return U?e:{};j=y(e,F,L)}}C||(C=new n);var K=C.get(e);if(K)return K;C.set(e,j),S(e)?e.forEach(function(n){j.add(t(n,r,R,n,e,C))}):v(e)&&e.forEach(function(n,i){j.set(i,t(n,r,R,i,e,C))});var V=q?void 0:(D?H?l:d:H?M:E)(e);return i(V||e,function(n,i){V&&(n=e[i=n]),o(j,i,t(n,r,R,i,e,C))}),j}},{"./_Stack":99,"./_arrayEach":103,"./_assignValue":107,"./_baseAssign":109,"./_baseAssignIn":110,"./_cloneBuffer":126,"./_copyArray":131,"./_copySymbols":133,"./_copySymbolsIn":134,"./_getAllKeys":138,"./_getAllKeysIn":139,"./_getTag":146,"./_initCloneArray":153,"./_initCloneByTag":154,"./_initCloneObject":155,"./isArray":186,"./isBuffer":188,"./isMap":191,"./isObject":192,"./isSet":194,"./keys":196,"./keysIn":197}],113:[function(t,e,r){var n=t("./isObject"),i=Object.create,o=function(){function t(){}return function(e){if(!n(e))return{};if(i)return i(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();e.exports=o},{"./isObject":192}],114:[function(t,e,r){var n=t("./_arrayPush"),i=t("./isArray");e.exports=function(t,e,r){var o=e(t);return i(t)?o:n(o,r(t))}},{"./_arrayPush":106,"./isArray":186}],115:[function(t,e,r){var n=t("./_Symbol"),i=t("./_getRawTag"),o=t("./_objectToString"),s="[object Null]",a="[object Undefined]",u=n?n.toStringTag:void 0;e.exports=function(t){return null==t?void 0===t?a:s:u&&u in Object(t)?i(t):o(t)}},{"./_Symbol":100,"./_getRawTag":143,"./_objectToString":174}],116:[function(t,e,r){var n=t("./_baseGetTag"),i=t("./isObjectLike"),o="[object Arguments]";e.exports=function(t){return i(t)&&n(t)==o}},{"./_baseGetTag":115,"./isObjectLike":193}],117:[function(t,e,r){var n=t("./_getTag"),i=t("./isObjectLike"),o="[object Map]";e.exports=function(t){return i(t)&&n(t)==o}},{"./_getTag":146,"./isObjectLike":193}],118:[function(t,e,r){var n=t("./isFunction"),i=t("./_isMasked"),o=t("./isObject"),s=t("./_toSource"),a=/^\[object .+?Constructor\]$/,u=Function.prototype,f=Object.prototype,h=u.toString,c=f.hasOwnProperty,d=RegExp("^"+h.call(c).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(t){return!(!o(t)||i(t))&&(n(t)?d:a).test(s(t))}},{"./_isMasked":158,"./_toSource":182,"./isFunction":189,"./isObject":192}],119:[function(t,e,r){var n=t("./_getTag"),i=t("./isObjectLike"),o="[object Set]";e.exports=function(t){return i(t)&&n(t)==o}},{"./_getTag":146,"./isObjectLike":193}],120:[function(t,e,r){var n=t("./_baseGetTag"),i=t("./isLength"),o=t("./isObjectLike"),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(t){return o(t)&&i(t.length)&&!!s[n(t)]}},{"./_baseGetTag":115,"./isLength":190,"./isObjectLike":193}],121:[function(t,e,r){var n=t("./_isPrototype"),i=t("./_nativeKeys"),o=Object.prototype.hasOwnProperty;e.exports=function(t){if(!n(t))return i(t);var e=[];for(var r in Object(t))o.call(t,r)&&"constructor"!=r&&e.push(r);return e}},{"./_isPrototype":159,"./_nativeKeys":171}],122:[function(t,e,r){var n=t("./isObject"),i=t("./_isPrototype"),o=t("./_nativeKeysIn"),s=Object.prototype.hasOwnProperty;e.exports=function(t){if(!n(t))return o(t);var e=i(t),r=[];for(var a in t)("constructor"!=a||!e&&s.call(t,a))&&r.push(a);return r}},{"./_isPrototype":159,"./_nativeKeysIn":172,"./isObject":192}],123:[function(t,e,r){e.exports=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}},{}],124:[function(t,e,r){e.exports=function(t){return function(e){return t(e)}}},{}],125:[function(t,e,r){var n=t("./_Uint8Array");e.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},{"./_Uint8Array":101}],126:[function(t,e,r){var n=t("./_root"),i="object"==typeof r&&r&&!r.nodeType&&r,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(t,e){if(e)return t.slice();var r=t.length,n=a?a(r):new t.constructor(r);return t.copy(n),n}},{"./_root":176}],127:[function(t,e,r){var n=t("./_cloneArrayBuffer");e.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}},{"./_cloneArrayBuffer":125}],128:[function(t,e,r){var n=/\w*$/;e.exports=function(t){var e=new t.constructor(t.source,n.exec(t));return e.lastIndex=t.lastIndex,e}},{}],129:[function(t,e,r){var n=t("./_Symbol"),i=n?n.prototype:void 0,o=i?i.valueOf:void 0;e.exports=function(t){return o?Object(o.call(t)):{}}},{"./_Symbol":100}],130:[function(t,e,r){var n=t("./_cloneArrayBuffer");e.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},{"./_cloneArrayBuffer":125}],131:[function(t,e,r){e.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},{}],132:[function(t,e,r){var n=t("./_assignValue"),i=t("./_baseAssignValue");e.exports=function(t,e,r,o){var s=!r;r||(r={});for(var a=-1,u=e.length;++a<u;){var f=e[a],h=o?o(r[f],t[f],f,r,t):void 0;void 0===h&&(h=t[f]),s?i(r,f,h):n(r,f,h)}return r}},{"./_assignValue":107,"./_baseAssignValue":111}],133:[function(t,e,r){var n=t("./_copyObject"),i=t("./_getSymbols");e.exports=function(t,e){return n(t,i(t),e)}},{"./_copyObject":132,"./_getSymbols":144}],134:[function(t,e,r){var n=t("./_copyObject"),i=t("./_getSymbolsIn");e.exports=function(t,e){return n(t,i(t),e)}},{"./_copyObject":132,"./_getSymbolsIn":145}],135:[function(t,e,r){var n=t("./_root")["__core-js_shared__"];e.exports=n},{"./_root":176}],136:[function(t,e,r){var n=t("./_getNative"),i=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();e.exports=i},{"./_getNative":141}],137:[function(t,e,r){(function(t){(function(){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],138:[function(t,e,r){var n=t("./_baseGetAllKeys"),i=t("./_getSymbols"),o=t("./keys");e.exports=function(t){return n(t,o,i)}},{"./_baseGetAllKeys":114,"./_getSymbols":144,"./keys":196}],139:[function(t,e,r){var n=t("./_baseGetAllKeys"),i=t("./_getSymbolsIn"),o=t("./keysIn");e.exports=function(t){return n(t,o,i)}},{"./_baseGetAllKeys":114,"./_getSymbolsIn":145,"./keysIn":197}],140:[function(t,e,r){var n=t("./_isKeyable");e.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},{"./_isKeyable":157}],141:[function(t,e,r){var n=t("./_baseIsNative"),i=t("./_getValue");e.exports=function(t,e){var r=i(t,e);return n(r)?r:void 0}},{"./_baseIsNative":118,"./_getValue":147}],142:[function(t,e,r){var n=t("./_overArg")(Object.getPrototypeOf,Object);e.exports=n},{"./_overArg":175}],143:[function(t,e,r){var n=t("./_Symbol"),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=n?n.toStringTag:void 0;e.exports=function(t){var e=o.call(t,a),r=t[a];try{t[a]=void 0;var n=!0}catch(t){}var i=s.call(t);return n&&(e?t[a]=r:delete t[a]),i}},{"./_Symbol":100}],144:[function(t,e,r){var n=t("./_arrayFilter"),i=t("./stubArray"),o=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(t){return null==t?[]:(t=Object(t),n(s(t),function(e){return o.call(t,e)}))}:i;e.exports=a},{"./_arrayFilter":104,"./stubArray":198}],145:[function(t,e,r){var n=t("./_arrayPush"),i=t("./_getPrototype"),o=t("./_getSymbols"),s=t("./stubArray"),a=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)n(e,o(t)),t=i(t);return e}:s;e.exports=a},{"./_arrayPush":106,"./_getPrototype":142,"./_getSymbols":144,"./stubArray":198}],146:[function(t,e,r){var n=t("./_DataView"),i=t("./_Map"),o=t("./_Promise"),s=t("./_Set"),a=t("./_WeakMap"),u=t("./_baseGetTag"),f=t("./_toSource"),h=f(n),c=f(i),d=f(o),l=f(s),p=f(a),b=u;(n&&"[object DataView]"!=b(new n(new ArrayBuffer(1)))||i&&"[object Map]"!=b(new i)||o&&"[object Promise]"!=b(o.resolve())||s&&"[object Set]"!=b(new s)||a&&"[object WeakMap]"!=b(new a))&&(b=function(t){var e=u(t),r="[object Object]"==e?t.constructor:void 0,n=r?f(r):"";if(n)switch(n){case h:return"[object DataView]";case c:return"[object Map]";case d:return"[object Promise]";case l:return"[object Set]";case p:return"[object WeakMap]"}return e}),e.exports=b},{"./_DataView":92,"./_Map":95,"./_Promise":97,"./_Set":98,"./_WeakMap":102,"./_baseGetTag":115,"./_toSource":182}],147:[function(t,e,r){e.exports=function(t,e){return null==t?void 0:t[e]}},{}],148:[function(t,e,r){var n=t("./_nativeCreate");e.exports=function(){this.__data__=n?n(null):{},this.size=0}},{"./_nativeCreate":170}],149:[function(t,e,r){e.exports=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}},{}],150:[function(t,e,r){var n=t("./_nativeCreate"),i="__lodash_hash_undefined__",o=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;if(n){var r=e[t];return r===i?void 0:r}return o.call(e,t)?e[t]:void 0}},{"./_nativeCreate":170}],151:[function(t,e,r){var n=t("./_nativeCreate"),i=Object.prototype.hasOwnProperty;e.exports=function(t){var e=this.__data__;return n?void 0!==e[t]:i.call(e,t)}},{"./_nativeCreate":170}],152:[function(t,e,r){var n=t("./_nativeCreate"),i="__lodash_hash_undefined__";e.exports=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=n&&void 0===e?i:e,this}},{"./_nativeCreate":170}],153:[function(t,e,r){var n=Object.prototype.hasOwnProperty;e.exports=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&n.call(t,"index")&&(r.index=t.index,r.input=t.input),r}},{}],154:[function(t,e,r){var n=t("./_cloneArrayBuffer"),i=t("./_cloneDataView"),o=t("./_cloneRegExp"),s=t("./_cloneSymbol"),a=t("./_cloneTypedArray"),u="[object Boolean]",f="[object Date]",h="[object Map]",c="[object Number]",d="[object RegExp]",l="[object Set]",p="[object String]",b="[object Symbol]",y="[object ArrayBuffer]",m="[object DataView]",g="[object Float32Array]",w="[object Float64Array]",v="[object Int8Array]",_="[object Int16Array]",S="[object Int32Array]",E="[object Uint8Array]",M="[object Uint8ClampedArray]",k="[object Uint16Array]",A="[object Uint32Array]";e.exports=function(t,e,r){var I=t.constructor;switch(e){case y:return n(t);case u:case f:return new I(+t);case m:return i(t,r);case g:case w:case v:case _:case S:case E:case M:case k:case A:return a(t,r);case h:return new I;case c:case p:return new I(t);case d:return o(t);case l:return new I;case b:return s(t)}}},{"./_cloneArrayBuffer":125,"./_cloneDataView":127,"./_cloneRegExp":128,"./_cloneSymbol":129,"./_cloneTypedArray":130}],155:[function(t,e,r){var n=t("./_baseCreate"),i=t("./_getPrototype"),o=t("./_isPrototype");e.exports=function(t){return"function"!=typeof t.constructor||o(t)?{}:n(i(t))}},{"./_baseCreate":113,"./_getPrototype":142,"./_isPrototype":159}],156:[function(t,e,r){var n=9007199254740991,i=/^(?:0|[1-9]\d*)$/;e.exports=function(t,e){var r=typeof t;return!!(e=null==e?n:e)&&("number"==r||"symbol"!=r&&i.test(t))&&t>-1&&t%1==0&&t<e}},{}],157:[function(t,e,r){e.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},{}],158:[function(t,e,r){var n,i=t("./_coreJsData"),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(t){return!!o&&o in t}},{"./_coreJsData":135}],159:[function(t,e,r){var n=Object.prototype;e.exports=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||n)}},{}],160:[function(t,e,r){e.exports=function(){this.__data__=[],this.size=0}},{}],161:[function(t,e,r){var n=t("./_assocIndexOf"),i=Array.prototype.splice;e.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0||(r==e.length-1?e.pop():i.call(e,r,1),--this.size,0))}},{"./_assocIndexOf":108}],162:[function(t,e,r){var n=t("./_assocIndexOf");e.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},{"./_assocIndexOf":108}],163:[function(t,e,r){var n=t("./_assocIndexOf");e.exports=function(t){return n(this.__data__,t)>-1}},{"./_assocIndexOf":108}],164:[function(t,e,r){var n=t("./_assocIndexOf");e.exports=function(t,e){var r=this.__data__,i=n(r,t);return i<0?(++this.size,r.push([t,e])):r[i][1]=e,this}},{"./_assocIndexOf":108}],165:[function(t,e,r){var n=t("./_Hash"),i=t("./_ListCache"),o=t("./_Map");e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},{"./_Hash":93,"./_ListCache":94,"./_Map":95}],166:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},{"./_getMapData":140}],167:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){return n(this,t).get(t)}},{"./_getMapData":140}],168:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t){return n(this,t).has(t)}},{"./_getMapData":140}],169:[function(t,e,r){var n=t("./_getMapData");e.exports=function(t,e){var r=n(this,t),i=r.size;return r.set(t,e),this.size+=r.size==i?0:1,this}},{"./_getMapData":140}],170:[function(t,e,r){var n=t("./_getNative")(Object,"create");e.exports=n},{"./_getNative":141}],171:[function(t,e,r){var n=t("./_overArg")(Object.keys,Object);e.exports=n},{"./_overArg":175}],172:[function(t,e,r){e.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},{}],173:[function(t,e,r){var n=t("./_freeGlobal"),i="object"==typeof r&&r&&!r.nodeType&&r,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,s=o&&o.exports===i&&n.process,a=function(){try{var t=o&&o.require&&o.require("util").types;return t||s&&s.binding&&s.binding("util")}catch(t){}}();e.exports=a},{"./_freeGlobal":137}],174:[function(t,e,r){var n=Object.prototype.toString;e.exports=function(t){return n.call(t)}},{}],175:[function(t,e,r){e.exports=function(t,e){return function(r){return t(e(r))}}},{}],176:[function(t,e,r){var n=t("./_freeGlobal"),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},{"./_freeGlobal":137}],177:[function(t,e,r){var n=t("./_ListCache");e.exports=function(){this.__data__=new n,this.size=0}},{"./_ListCache":94}],178:[function(t,e,r){e.exports=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}},{}],179:[function(t,e,r){e.exports=function(t){return this.__data__.get(t)}},{}],180:[function(t,e,r){e.exports=function(t){return this.__data__.has(t)}},{}],181:[function(t,e,r){var n=t("./_ListCache"),i=t("./_Map"),o=t("./_MapCache"),s=200;e.exports=function(t,e){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<s-1)return a.push([t,e]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(t,e),this.size=r.size,this}},{"./_ListCache":94,"./_Map":95,"./_MapCache":96}],182:[function(t,e,r){var n=Function.prototype.toString;e.exports=function(t){if(null!=t){try{return n.call(t)}catch(t){}try{return t+""}catch(t){}}return""}},{}],183:[function(t,e,r){var n=t("./_baseClone"),i=1,o=4;e.exports=function(t){return n(t,i|o)}},{"./_baseClone":112}],184:[function(t,e,r){e.exports=function(t,e){return t===e||t!=t&&e!=e}},{}],185:[function(t,e,r){var n=t("./_baseIsArguments"),i=t("./isObjectLike"),o=Object.prototype,s=o.hasOwnProperty,a=o.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(t){return i(t)&&s.call(t,"callee")&&!a.call(t,"callee")};e.exports=u},{"./_baseIsArguments":116,"./isObjectLike":193}],186:[function(t,e,r){var n=Array.isArray;e.exports=n},{}],187:[function(t,e,r){var n=t("./isFunction"),i=t("./isLength");e.exports=function(t){return null!=t&&i(t.length)&&!n(t)}},{"./isFunction":189,"./isLength":190}],188:[function(t,e,r){var n=t("./_root"),i=t("./stubFalse"),o="object"==typeof r&&r&&!r.nodeType&&r,s=o&&"object"==typeof e&&e&&!e.nodeType&&e,a=s&&s.exports===o?n.Buffer:void 0,u=(a?a.isBuffer:void 0)||i;e.exports=u},{"./_root":176,"./stubFalse":199}],189:[function(t,e,r){var n=t("./_baseGetTag"),i=t("./isObject"),o="[object AsyncFunction]",s="[object Function]",a="[object GeneratorFunction]",u="[object Proxy]";e.exports=function(t){if(!i(t))return!1;var e=n(t);return e==s||e==a||e==o||e==u}},{"./_baseGetTag":115,"./isObject":192}],190:[function(t,e,r){var n=9007199254740991;e.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}},{}],191:[function(t,e,r){var n=t("./_baseIsMap"),i=t("./_baseUnary"),o=t("./_nodeUtil"),s=o&&o.isMap,a=s?i(s):n;e.exports=a},{"./_baseIsMap":117,"./_baseUnary":124,"./_nodeUtil":173}],192:[function(t,e,r){e.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},{}],193:[function(t,e,r){e.exports=function(t){return null!=t&&"object"==typeof t}},{}],194:[function(t,e,r){var n=t("./_baseIsSet"),i=t("./_baseUnary"),o=t("./_nodeUtil"),s=o&&o.isSet,a=s?i(s):n;e.exports=a},{"./_baseIsSet":119,"./_baseUnary":124,"./_nodeUtil":173}],195:[function(t,e,r){var n=t("./_baseIsTypedArray"),i=t("./_baseUnary"),o=t("./_nodeUtil"),s=o&&o.isTypedArray,a=s?i(s):n;e.exports=a},{"./_baseIsTypedArray":120,"./_baseUnary":124,"./_nodeUtil":173}],196:[function(t,e,r){var n=t("./_arrayLikeKeys"),i=t("./_baseKeys"),o=t("./isArrayLike");e.exports=function(t){return o(t)?n(t):i(t)}},{"./_arrayLikeKeys":105,"./_baseKeys":121,"./isArrayLike":187}],197:[function(t,e,r){var n=t("./_arrayLikeKeys"),i=t("./_baseKeysIn"),o=t("./isArrayLike");e.exports=function(t){return o(t)?n(t,!0):i(t)}},{"./_arrayLikeKeys":105,"./_baseKeysIn":122,"./isArrayLike":187}],198:[function(t,e,r){e.exports=function(){return[]}},{}],199:[function(t,e,r){e.exports=function(){return!1}},{}],200:[function(t,e,r){(function(r){(function(){"use strict";var n=t("inherits"),i=t("hash-base"),o=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function a(t,e){return t<<e|t>>>32-e}function u(t,e,r,n,i,o,s){return a(t+(e&r|~e&n)+i+o|0,s)+e|0}function f(t,e,r,n,i,o,s){return a(t+(e&n|r&~n)+i+o|0,s)+e|0}function h(t,e,r,n,i,o,s){return a(t+(e^r^n)+i+o|0,s)+e|0}function c(t,e,r,n,i,o,s){return a(t+(r^(e|~n))+i+o|0,s)+e|0}n(s,i),s.prototype._update=function(){for(var t=o,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,n=this._b,i=this._c,s=this._d;n=c(n=c(n=c(n=c(n=h(n=h(n=h(n=h(n=f(n=f(n=f(n=f(n=u(n=u(n=u(n=u(n,i=u(i,s=u(s,r=u(r,n,i,s,t[0],3614090360,7),n,i,t[1],3905402710,12),r,n,t[2],606105819,17),s,r,t[3],3250441966,22),i=u(i,s=u(s,r=u(r,n,i,s,t[4],4118548399,7),n,i,t[5],1200080426,12),r,n,t[6],2821735955,17),s,r,t[7],4249261313,22),i=u(i,s=u(s,r=u(r,n,i,s,t[8],1770035416,7),n,i,t[9],2336552879,12),r,n,t[10],4294925233,17),s,r,t[11],2304563134,22),i=u(i,s=u(s,r=u(r,n,i,s,t[12],1804603682,7),n,i,t[13],4254626195,12),r,n,t[14],2792965006,17),s,r,t[15],1236535329,22),i=f(i,s=f(s,r=f(r,n,i,s,t[1],4129170786,5),n,i,t[6],3225465664,9),r,n,t[11],643717713,14),s,r,t[0],3921069994,20),i=f(i,s=f(s,r=f(r,n,i,s,t[5],3593408605,5),n,i,t[10],38016083,9),r,n,t[15],3634488961,14),s,r,t[4],3889429448,20),i=f(i,s=f(s,r=f(r,n,i,s,t[9],568446438,5),n,i,t[14],3275163606,9),r,n,t[3],4107603335,14),s,r,t[8],1163531501,20),i=f(i,s=f(s,r=f(r,n,i,s,t[13],2850285829,5),n,i,t[2],4243563512,9),r,n,t[7],1735328473,14),s,r,t[12],2368359562,20),i=h(i,s=h(s,r=h(r,n,i,s,t[5],4294588738,4),n,i,t[8],2272392833,11),r,n,t[11],1839030562,16),s,r,t[14],4259657740,23),i=h(i,s=h(s,r=h(r,n,i,s,t[1],2763975236,4),n,i,t[4],1272893353,11),r,n,t[7],4139469664,16),s,r,t[10],3200236656,23),i=h(i,s=h(s,r=h(r,n,i,s,t[13],681279174,4),n,i,t[0],3936430074,11),r,n,t[3],3572445317,16),s,r,t[6],76029189,23),i=h(i,s=h(s,r=h(r,n,i,s,t[9],3654602809,4),n,i,t[12],3873151461,11),r,n,t[15],530742520,16),s,r,t[2],3299628645,23),i=c(i,s=c(s,r=c(r,n,i,s,t[0],4096336452,6),n,i,t[7],1126891415,10),r,n,t[14],2878612391,15),s,r,t[5],4237533241,21),i=c(i,s=c(s,r=c(r,n,i,s,t[12],1700485571,6),n,i,t[3],2399980690,10),r,n,t[10],4293915773,15),s,r,t[1],2240044497,21),i=c(i,s=c(s,r=c(r,n,i,s,t[8],1873313359,6),n,i,t[15],4264355552,10),r,n,t[6],2734768916,15),s,r,t[13],1309151649,21),i=c(i,s=c(s,r=c(r,n,i,s,t[4],4149444226,6),n,i,t[11],3174756917,10),r,n,t[2],718787259,15),s,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+s|0},s.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 t=new r(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},e.exports=s}).call(this)}).call(this,t("buffer").Buffer)},{buffer:223,"hash-base":77,inherits:91}],201:[function(t,e,r){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}e.exports=n,n.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},{}],202:[function(t,e,r){"use strict";var n=r;function i(t){return 1===t.length?"0"+t:t}function o(t){for(var e="",r=0;r<t.length;r++)e+=i(t[r].toString(16));return e}n.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"!=typeof t){for(var n=0;n<t.length;n++)r[n]=0|t[n];return r}if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16));else for(n=0;n<t.length;n++){var i=t.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},n.zero2=i,n.toHex=o,n.encode=function(t,e){return"hex"===e?o(t):t}},{}],203:[function(t,e,r){"use strict";var n=t("buffer").Buffer,i=t("inherits"),o=t("hash-base"),s=new Array(16),a=[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],u=[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],f=[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],h=[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],c=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function l(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<<e|t>>>32-e}function b(t,e,r,n,i,o,s,a){return p(t+(e^r^n)+o+s|0,a)+i|0}function y(t,e,r,n,i,o,s,a){return p(t+(e&r|~e&n)+o+s|0,a)+i|0}function m(t,e,r,n,i,o,s,a){return p(t+((e|~r)^n)+o+s|0,a)+i|0}function g(t,e,r,n,i,o,s,a){return p(t+(e&n|r&~n)+o+s|0,a)+i|0}function w(t,e,r,n,i,o,s,a){return p(t+(e^(r|~n))+o+s|0,a)+i|0}i(l,o),l.prototype._update=function(){for(var t=s,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,v=0|this._a,_=0|this._b,S=0|this._c,E=0|this._d,M=0|this._e,k=0;k<80;k+=1){var A,I;k<16?(A=b(r,n,i,o,l,t[a[k]],c[0],f[k]),I=w(v,_,S,E,M,t[u[k]],d[0],h[k])):k<32?(A=y(r,n,i,o,l,t[a[k]],c[1],f[k]),I=g(v,_,S,E,M,t[u[k]],d[1],h[k])):k<48?(A=m(r,n,i,o,l,t[a[k]],c[2],f[k]),I=m(v,_,S,E,M,t[u[k]],d[2],h[k])):k<64?(A=g(r,n,i,o,l,t[a[k]],c[3],f[k]),I=y(v,_,S,E,M,t[u[k]],d[3],h[k])):(A=w(r,n,i,o,l,t[a[k]],c[4],f[k]),I=b(v,_,S,E,M,t[u[k]],d[4],h[k])),r=l,l=o,o=p(i,10),i=n,n=A,v=M,M=E,E=p(S,10),S=_,_=I}var T=this._b+i+E|0;this._b=this._c+o+M|0,this._c=this._d+l+v|0,this._d=this._e+r+_|0,this._e=this._a+n+S|0,this._a=T},l.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 t=n.alloc?n.alloc(20):new n(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},e.exports=l},{buffer:223,"hash-base":77,inherits:91}],204:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:223}],205:[function(t,e,r){e.exports=t("./lib")(t("./lib/elliptic"))},{"./lib":207,"./lib/elliptic":206}],206:[function(t,e,r){const n=new(0,t("elliptic").ec)("secp256k1"),i=n.curve,o=i.n.constructor;function s(t){const e=t[0];switch(e){case 2:case 3:return 33!==t.length?null:function(t,e){let r=new o(e);if(r.cmp(i.p)>=0)return null;let s=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();return 3===t!==s.isOdd()&&(s=s.redNeg()),n.keyPair({pub:{x:r,y:s}})}(e,t.subarray(1,33));case 4:case 6:case 7:return 65!==t.length?null:function(t,e,r){let s=new o(e),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0)return null;if(s=s.toRed(i.red),a=a.toRed(i.red),(6===t||7===t)&&a.isOdd()!==(7===t))return null;const u=s.redSqr().redIMul(s);return a.redSqr().redISub(u.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}(e,t.subarray(1,33),t.subarray(33,65));default:return null}}function a(t,e){const r=e.encode(null,33===t.length);for(let e=0;e<t.length;++e)t[e]=r[e]}e.exports={contextRandomize:()=>0,privateKeyVerify(t){const e=new o(t);return e.cmp(i.n)<0&&!e.isZero()?0:1},privateKeyNegate(t){const e=new o(t),r=i.n.sub(e).umod(i.n).toArrayLike(Uint8Array,"be",32);return t.set(r),0},privateKeyTweakAdd(t,e){const r=new o(e);if(r.cmp(i.n)>=0)return 1;if(r.iadd(new o(t)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero())return 1;const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},privateKeyTweakMul(t,e){let r=new o(e);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(t)),r.cmp(i.n)>=0&&(r=r.umod(i.n));const n=r.toArrayLike(Uint8Array,"be",32);return t.set(n),0},publicKeyVerify:t=>null===s(t)?1:0,publicKeyCreate(t,e){const r=new o(e);return r.cmp(i.n)>=0||r.isZero()?1:(a(t,n.keyFromPrivate(e).getPublic()),0)},publicKeyConvert(t,e){const r=s(e);return null===r?1:(a(t,r.getPublic()),0)},publicKeyNegate(t,e){const r=s(e);if(null===r)return 1;const n=r.getPublic();return n.y=n.y.redNeg(),a(t,n),0},publicKeyCombine(t,e){const r=new Array(e.length);for(let t=0;t<e.length;++t)if(r[t]=s(e[t]),null===r[t])return 1;let n=r[0].getPublic();for(let t=1;t<r.length;++t)n=n.add(r[t].pub);return n.isInfinity()?2:(a(t,n),0)},publicKeyTweakAdd(t,e,r){const n=s(e);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;const u=n.getPublic().add(i.g.mul(r));return u.isInfinity()?2:(a(t,u),0)},publicKeyTweakMul(t,e,r){const n=s(e);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(a(t,n.getPublic().mul(r)),0)},signatureNormalize(t){const e=new o(t.subarray(0,32)),r=new o(t.subarray(32,64));return e.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&t.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(t,e){const r=e.subarray(0,32),n=e.subarray(32,64);if(new o(r).cmp(i.n)>=0)return 1;if(new o(n).cmp(i.n)>=0)return 1;const{output:s}=t;let a=s.subarray(4,37);a[0]=0,a.set(r,1);let u=33,f=0;for(;u>1&&0===a[f]&&!(128&a[f+1]);--u,++f);if(128&(a=a.subarray(f))[0])return 1;if(u>1&&0===a[0]&&!(128&a[1]))return 1;let h=s.subarray(39,72);h[0]=0,h.set(n,1);let c=33,d=0;for(;c>1&&0===h[d]&&!(128&h[d+1]);--c,++d);return 128&(h=h.subarray(d))[0]?1:c>1&&0===h[0]&&!(128&h[1])?1:(t.outputlen=6+u+c,s[0]=48,s[1]=t.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+u]=2,s[5+u]=h.length,s.set(h,6+u),0)},signatureImport(t,e){if(e.length<8)return 1;if(e.length>72)return 1;if(48!==e[0])return 1;if(e[1]!==e.length-2)return 1;if(2!==e[2])return 1;const r=e[3];if(0===r)return 1;if(5+r>=e.length)return 1;if(2!==e[4+r])return 1;const n=e[5+r];if(0===n)return 1;if(6+r+n!==e.length)return 1;if(128&e[4])return 1;if(r>1&&0===e[4]&&!(128&e[5]))return 1;if(128&e[r+6])return 1;if(n>1&&0===e[r+6]&&!(128&e[r+7]))return 1;let s=e.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=e.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw new Error("S length is too long");let u=new o(s);u.cmp(i.n)>=0&&(u=new o(0));let f=new o(e.subarray(6+r));return f.cmp(i.n)>=0&&(f=new o(0)),t.set(u.toArrayLike(Uint8Array,"be",32),0),t.set(f.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(t,e,r,s,a){if(a){const t=a;a=(n=>{const i=t(e,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw new Error("This is the way");return new o(i)})}const u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;let f;try{f=n.sign(e,r,{canonical:!0,k:a,pers:s})}catch(t){return 1}return t.signature.set(f.r.toArrayLike(Uint8Array,"be",32),0),t.signature.set(f.s.toArrayLike(Uint8Array,"be",32),32),t.recid=f.recoveryParam,0},ecdsaVerify(t,e,r){const a={r:t.subarray(0,32),s:t.subarray(32,64)},u=new o(a.r),f=new o(a.s);if(u.cmp(i.n)>=0||f.cmp(i.n)>=0)return 1;if(1===f.cmp(n.nh)||u.isZero()||f.isZero())return 3;const h=s(r);if(null===h)return 2;const c=h.getPublic();return n.verify(e,a,c)?0:3},ecdsaRecover(t,e,r,s){const u={r:e.slice(0,32),s:e.slice(32,64)},f=new o(u.r),h=new o(u.s);if(f.cmp(i.n)>=0||h.cmp(i.n)>=0)return 1;if(f.isZero()||h.isZero())return 2;let c;try{c=n.recoverPubKey(s,u,r)}catch(t){return 2}return a(t,c),0},ecdh(t,e,r,a,u,f,h){const c=s(e);if(null===c)return 1;const d=new o(r);if(d.cmp(i.n)>=0||d.isZero())return 2;const l=c.getPublic().mul(d);if(void 0===u){const e=l.encode(null,!0),r=n.hash().update(e).digest();for(let e=0;e<32;++e)t[e]=r[e]}else{f||(f=new Uint8Array(32));const e=l.getX().toArray("be",32);for(let t=0;t<32;++t)f[t]=e[t];h||(h=new Uint8Array(32));const r=l.getY().toArray("be",32);for(let t=0;t<32;++t)h[t]=r[t];const n=u(f,h,a);if(!(n instanceof Uint8Array&&n.length===t.length))return 2;t.set(n)}return 0}}},{elliptic:59}],207:[function(t,e,r){const n="Impossible case. Please create issue.",i="The tweak was out of range or the resulted private key is invalid",o="The tweak was out of range or equal to zero",s="Unknow error on context randomization",a="Private Key is invalid",u="Public Key could not be parsed",f="Public Key serialization error",h="The sum of the public keys is not valid",c="Signature could not be parsed",d="The nonce generation function failed, or the private key was invalid",l="Public key could not be recover",p="Scalar was invalid (zero or overflow)";function b(t,e){if(!t)throw new Error(e)}function y(t,e,r){if(b(e instanceof Uint8Array,`Expected ${t} to be an Uint8Array`),void 0!==r)if(Array.isArray(r)){const n=`Expected ${t} to be an Uint8Array with length [${r.join(", ")}]`;b(r.includes(e.length),n)}else{const n=`Expected ${t} to be an Uint8Array with length ${r}`;b(e.length===r,n)}}function m(t){b("Boolean"===w(t),"Expected compressed to be a Boolean")}function g(t=(t=>new Uint8Array(t)),e){return"function"==typeof t&&(t=t(e)),y("output",t,e),t}function w(t){return Object.prototype.toString.call(t).slice(8,-1)}e.exports=(t=>({contextRandomize(e){switch(b(null===e||e instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==e&&y("seed",e,32),t.contextRandomize(e)){case 1:throw new Error(s)}},privateKeyVerify:e=>(y("private key",e,32),0===t.privateKeyVerify(e)),privateKeyNegate(e){switch(y("private key",e,32),t.privateKeyNegate(e)){case 0:return e;case 1:throw new Error(n)}},privateKeyTweakAdd(e,r){switch(y("private key",e,32),y("tweak",r,32),t.privateKeyTweakAdd(e,r)){case 0:return e;case 1:throw new Error(i)}},privateKeyTweakMul(e,r){switch(y("private key",e,32),y("tweak",r,32),t.privateKeyTweakMul(e,r)){case 0:return e;case 1:throw new Error(o)}},publicKeyVerify:e=>(y("public key",e,[33,65]),0===t.publicKeyVerify(e)),publicKeyCreate(e,r=!0,n){switch(y("private key",e,32),m(r),n=g(n,r?33:65),t.publicKeyCreate(n,e)){case 0:return n;case 1:throw new Error(a);case 2:throw new Error(f)}},publicKeyConvert(e,r=!0,n){switch(y("public key",e,[33,65]),m(r),n=g(n,r?33:65),t.publicKeyConvert(n,e)){case 0:return n;case 1:throw new Error(u);case 2:throw new Error(f)}},publicKeyNegate(e,r=!0,i){switch(y("public key",e,[33,65]),m(r),i=g(i,r?33:65),t.publicKeyNegate(i,e)){case 0:return i;case 1:throw new Error(u);case 2:throw new Error(n);case 3:throw new Error(f)}},publicKeyCombine(e,r=!0,n){b(Array.isArray(e),"Expected public keys to be an Array"),b(e.length>0,"Expected public keys array will have more than zero items");for(const t of e)y("public key",t,[33,65]);switch(m(r),n=g(n,r?33:65),t.publicKeyCombine(n,e)){case 0:return n;case 1:throw new Error(u);case 2:throw new Error(h);case 3:throw new Error(f)}},publicKeyTweakAdd(e,r,n=!0,o){switch(y("public key",e,[33,65]),y("tweak",r,32),m(n),o=g(o,n?33:65),t.publicKeyTweakAdd(o,e,r)){case 0:return o;case 1:throw new Error(u);case 2:throw new Error(i)}},publicKeyTweakMul(e,r,n=!0,i){switch(y("public key",e,[33,65]),y("tweak",r,32),m(n),i=g(i,n?33:65),t.publicKeyTweakMul(i,e,r)){case 0:return i;case 1:throw new Error(u);case 2:throw new Error(o)}},signatureNormalize(e){switch(y("signature",e,64),t.signatureNormalize(e)){case 0:return e;case 1:throw new Error(c)}},signatureExport(e,r){y("signature",e,64);const i={output:r=g(r,72),outputlen:72};switch(t.signatureExport(i,e)){case 0:return r.slice(0,i.outputlen);case 1:throw new Error(c);case 2:throw new Error(n)}},signatureImport(e,r){switch(y("signature",e),r=g(r,64),t.signatureImport(r,e)){case 0:return r;case 1:throw new Error(c);case 2:throw new Error(n)}},ecdsaSign(e,r,i={},o){y("message",e,32),y("private key",r,32),b("Object"===w(i),"Expected options to be an Object"),void 0!==i.data&&y("options.data",i.data),void 0!==i.noncefn&&b("Function"===w(i.noncefn),"Expected options.noncefn to be a Function");const s={signature:o=g(o,64),recid:null};switch(t.ecdsaSign(s,e,r,i.data,i.noncefn)){case 0:return s;case 1:throw new Error(d);case 2:throw new Error(n)}},ecdsaVerify(e,r,n){switch(y("signature",e,64),y("message",r,32),y("public key",n,[33,65]),t.ecdsaVerify(e,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(c);case 2:throw new Error(u)}},ecdsaRecover(e,r,i,o=!0,s){switch(y("signature",e,64),b("Number"===w(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),y("message",i,32),m(o),s=g(s,o?33:65),t.ecdsaRecover(s,e,r,i)){case 0:return s;case 1:throw new Error(c);case 2:throw new Error(l);case 3:throw new Error(n)}},ecdh(e,r,n={},i){switch(y("public key",e,[33,65]),y("private key",r,32),b("Object"===w(n),"Expected options to be an Object"),void 0!==n.data&&y("options.data",n.data),void 0!==n.hashfn?(b("Function"===w(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&y("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&y("options.ybuf",n.ybuf,32),y("output",i)):i=g(i,32),t.ecdh(i,e,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return i;case 1:throw new Error(u);case 2:throw new Error(p)}}}))},{}],208:[function(t,e,r){var n=t("safe-buffer").Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,s=this._len,a=0;a<o;){for(var u=s%i,f=Math.min(o-a,i-u),h=0;h<f;h++)r[u+h]=t[a+h];a+=f,(s+=f)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},{"safe-buffer":204}],209:[function(t,e,r){(r=e.exports=function(t){t=t.toLowerCase();var e=r[t];if(!e)throw new Error(t+" is not supported (we accept pull requests)");return new e}).sha=t("./sha"),r.sha1=t("./sha1"),r.sha224=t("./sha224"),r.sha256=t("./sha256"),r.sha384=t("./sha384"),r.sha512=t("./sha512")},{"./sha":210,"./sha1":211,"./sha224":212,"./sha256":213,"./sha384":214,"./sha512":215}],210:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<30|t>>>2}function h(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,c=0;c<16;++c)r[c]=t.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var d=0;d<80;++d){var l=~~(d/20),p=0|((e=n)<<5|e>>>27)+h(l,i,o,a)+u+r[d]+s[l];u=a,a=o,o=f(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":208,inherits:91,"safe-buffer":204}],211:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t){return t<<5|t>>>27}function h(t){return t<<30|t>>>2}function c(t,e,r,n){return 0===t?e&r|~e&n:2===t?e&r|e&n|r&n:e^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=t.readInt32BE(4*d);for(;d<80;++d)r[d]=(e=r[d-3]^r[d-8]^r[d-14]^r[d-16])<<1|e>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=f(n)+c(p,i,o,a)+u+r[l]+s[p]|0;u=a,a=o,o=h(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var t=o.allocUnsafe(20);return t.writeInt32BE(0|this._a,0),t.writeInt32BE(0|this._b,4),t.writeInt32BE(0|this._c,8),t.writeInt32BE(0|this._d,12),t.writeInt32BE(0|this._e,16),t},e.exports=u},{"./hash":208,inherits:91,"safe-buffer":204}],212:[function(t,e,r){var n=t("inherits"),i=t("./sha256"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(64);function u(){this.init(),this._w=a,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t},e.exports=u},{"./hash":208,"./sha256":213,inherits:91,"safe-buffer":204}],213:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[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],a=new Array(64);function u(){this.init(),this._w=a,i.call(this,64,56)}function f(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function d(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function l(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(t){for(var e,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,a=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,y=0|this._h,m=0;m<16;++m)r[m]=t.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((e=r[m-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[m-7]+l(r[m-15])+r[m-16];for(var g=0;g<64;++g){var w=y+d(u)+f(u,p,b)+s[g]+r[g]|0,v=c(n)+h(n,i,o)|0;y=b,b=p,p=u,u=a+w|0,a=o,o=i,i=n,n=w+v|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=y+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},e.exports=u},{"./hash":208,inherits:91,"safe-buffer":204}],214:[function(t,e,r){var n=t("inherits"),i=t("./sha512"),o=t("./hash"),s=t("safe-buffer").Buffer,a=new Array(160);function u(){this.init(),this._w=a,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var t=s.allocUnsafe(48);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t},e.exports=u},{"./hash":208,"./sha512":215,inherits:91,"safe-buffer":204}],215:[function(t,e,r){var n=t("inherits"),i=t("./hash"),o=t("safe-buffer").Buffer,s=[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],a=new Array(160);function u(){this.init(),this._w=a,i.call(this,128,112)}function f(t,e,r){return r^t&(e^r)}function h(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function d(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function l(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function b(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function y(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function m(t,e){return t>>>0<e>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(t){for(var e=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,a=0|this._eh,u=0|this._fh,g=0|this._gh,w=0|this._hh,v=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,M=0|this._el,k=0|this._fl,A=0|this._gl,I=0|this._hl,T=0;T<32;T+=2)e[T]=t.readInt32BE(4*T),e[T+1]=t.readInt32BE(4*T+4);for(;T<160;T+=2){var x=e[T-30],O=e[T-30+1],P=l(x,O),N=p(O,x),R=b(x=e[T-4],O=e[T-4+1]),B=y(O,x),U=e[T-14],C=e[T-14+1],j=e[T-32],L=e[T-32+1],H=N+C|0,D=P+U+m(H,N)|0;D=(D=D+R+m(H=H+B|0,B)|0)+j+m(H=H+L|0,L)|0,e[T]=D,e[T+1]=H}for(var q=0;q<160;q+=2){D=e[q],H=e[q+1];var F=h(r,n,i),z=h(v,_,S),K=c(r,v),V=c(v,r),W=d(a,M),G=d(M,a),X=s[q],Z=s[q+1],Y=f(a,u,g),$=f(M,k,A),J=I+G|0,Q=w+W+m(J,I)|0;Q=(Q=(Q=Q+Y+m(J=J+$|0,$)|0)+X+m(J=J+Z|0,Z)|0)+D+m(J=J+H|0,H)|0;var tt=V+z|0,et=K+F+m(tt,V)|0;w=g,I=A,g=u,A=k,u=a,k=M,a=o+Q+m(M=E+J|0,E)|0,o=i,E=S,i=n,S=_,n=r,_=v,r=Q+et+m(v=J+tt|0,J)|0}this._al=this._al+v|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+M|0,this._fl=this._fl+k|0,this._gl=this._gl+A|0,this._hl=this._hl+I|0,this._ah=this._ah+r+m(this._al,v)|0,this._bh=this._bh+n+m(this._bl,_)|0,this._ch=this._ch+i+m(this._cl,S)|0,this._dh=this._dh+o+m(this._dl,E)|0,this._eh=this._eh+a+m(this._el,M)|0,this._fh=this._fh+u+m(this._fl,k)|0,this._gh=this._gh+g+m(this._gl,A)|0,this._hh=this._hh+w+m(this._hl,I)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,n){t.writeInt32BE(e,n),t.writeInt32BE(r,n+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},e.exports=u},{"./hash":208,inherits:91,"safe-buffer":204}],216:[function(t,e,r){var n=t("./native");function i(t){return t.name||t.toString().match(/function (.*?)\s*\(/)[1]}function o(t){return n.Nil(t)?"":i(t.constructor)}function s(t,e){Error.captureStackTrace&&Error.captureStackTrace(t,e)}function a(t){return n.Function(t)?t.toJSON?t.toJSON():i(t):n.Array(t)?"Array":t&&n.Object(t)?"Object":void 0!==t?t:""}function u(t,e,r){var i=function(t){return n.Function(t)?"":n.String(t)?JSON.stringify(t):t&&n.Object(t)?"":t}(e);return"Expected "+a(t)+", got"+(""!==r?" "+r:"")+(""!==i?" "+i:"")}function f(t,e,r){r=r||o(e),this.message=u(t,e,r),s(this,f),this.__type=t,this.__value=e,this.__valueTypeName=r}function h(t,e,r,n,i){t?(i=i||o(n),this.message=function(t,e,r,n,i){var o='" of type ';return"key"===e&&(o='" with key type '),u('property "'+a(r)+o+a(t),n,i)}(t,r,e,n,i)):this.message='Unexpected property "'+e+'"',s(this,f),this.__label=r,this.__property=e,this.__type=t,this.__value=n,this.__valueTypeName=i}f.prototype=Object.create(Error.prototype),f.prototype.constructor=f,h.prototype=Object.create(Error.prototype),h.prototype.constructor=f,e.exports={TfTypeError:f,TfPropertyTypeError:h,tfCustomError:function(t,e){return new f(t,{},e)},tfSubError:function(t,e,r){return t instanceof h?(e=e+"."+t.__property,t=new h(t.__type,e,t.__label,t.__value,t.__valueTypeName)):t instanceof f&&(t=new h(t.__type,e,r,t.__value,t.__valueTypeName)),s(t),t},tfJSON:a,getValueTypeName:o}},{"./native":219}],217:[function(t,e,r){(function(r){(function(){var n=t("./native"),i=t("./errors");function o(t){return r.isBuffer(t)}function s(t){return"string"==typeof t&&/^([0-9a-f]{2})+$/i.test(t)}function a(t,e){var r=t.toJSON();function n(n){if(!t(n))return!1;if(n.length===e)return!0;throw i.tfCustomError(r+"(Length: "+e+")",r+"(Length: "+n.length+")")}return n.toJSON=function(){return r},n}var u=a.bind(null,n.Array),f=a.bind(null,o),h=a.bind(null,s),c=a.bind(null,n.String);var d=Math.pow(2,53)-1;var l={ArrayN:u,Buffer:o,BufferN:f,Finite:function(t){return"number"==typeof t&&isFinite(t)},Hex:s,HexN:h,Int8:function(t){return t<<24>>24===t},Int16:function(t){return t<<16>>16===t},Int32:function(t){return(0|t)===t},Int53:function(t){return"number"==typeof t&&t>=-d&&t<=d&&Math.floor(t)===t},Range:function(t,e,r){function i(n,i){return r(n,i)&&n>t&&n<e}return r=r||n.Number,i.toJSON=function(){return`${r.toJSON()} between [${t}, ${e}]`},i},StringN:c,UInt8:function(t){return(255&t)===t},UInt16:function(t){return(65535&t)===t},UInt32:function(t){return t>>>0===t},UInt53:function(t){return"number"==typeof t&&t>=0&&t<=d&&Math.floor(t)===t}};for(var p in l)l[p].toJSON=function(t){return t}.bind(null,p);e.exports=l}).call(this)}).call(this,{isBuffer:t("../../../../../../../usr/local/lib/node_modules/browserify/node_modules/is-buffer/index.js")})},{"../../../../../../../usr/local/lib/node_modules/browserify/node_modules/is-buffer/index.js":227,"./errors":216,"./native":219}],218:[function(t,e,r){var n=t("./errors"),i=t("./native"),o=n.tfJSON,s=n.TfTypeError,a=n.TfPropertyTypeError,u=n.tfSubError,f=n.getValueTypeName,h={arrayOf:function(t,e){function r(r,n){return!!i.Array(r)&&(!i.Nil(r)&&(!(void 0!==e.minLength&&r.length<e.minLength)&&(!(void 0!==e.maxLength&&r.length>e.maxLength)&&((void 0===e.length||r.length===e.length)&&r.every(function(e,r){try{return d(t,e,n)}catch(t){throw u(t,r)}})))))}return t=c(t),e=e||{},r.toJSON=function(){var r="["+o(t)+"]";return void 0!==e.length?r+="{"+e.length+"}":void 0===e.minLength&&void 0===e.maxLength||(r+="{"+(void 0===e.minLength?0:e.minLength)+","+(void 0===e.maxLength?1/0:e.maxLength)+"}"),r},r},maybe:function t(e){function r(r,n){return i.Nil(r)||e(r,n,t)}return e=c(e),r.toJSON=function(){return"?"+o(e)},r},map:function(t,e){function r(r,n){if(!i.Object(r))return!1;if(i.Nil(r))return!1;for(var o in r){try{e&&d(e,o,n)}catch(t){throw u(t,o,"key")}try{var s=r[o];d(t,s,n)}catch(t){throw u(t,o)}}return!0}return t=c(t),e&&(e=c(e)),r.toJSON=e?function(){return"{"+o(e)+": "+o(t)+"}"}:function(){return"{"+o(t)+"}"},r},object:function(t){var e={};for(var r in t)e[r]=c(t[r]);function n(t,r){if(!i.Object(t))return!1;if(i.Nil(t))return!1;var n;try{for(n in e){d(e[n],t[n],r)}}catch(t){throw u(t,n)}if(r)for(n in t)if(!e[n])throw new a(void 0,n);return!0}return n.toJSON=function(){return o(e)},n},anyOf:function(){var t=[].slice.call(arguments).map(c);function e(e,r){return t.some(function(t){try{return d(t,e,r)}catch(t){return!1}})}return e.toJSON=function(){return t.map(o).join("|")},e},allOf:function(){var t=[].slice.call(arguments).map(c);function e(e,r){return t.every(function(t){try{return d(t,e,r)}catch(t){return!1}})}return e.toJSON=function(){return t.map(o).join(" & ")},e},quacksLike:function(t){function e(e){return t===f(e)}return e.toJSON=function(){return t},e},tuple:function(){var t=[].slice.call(arguments).map(c);function e(e,r){return!i.Nil(e)&&(!i.Nil(e.length)&&((!r||e.length===t.length)&&t.every(function(t,n){try{return d(t,e[n],r)}catch(t){throw u(t,n)}})))}return e.toJSON=function(){return"("+t.map(o).join(", ")+")"},e},value:function(t){function e(e){return e===t}return e.toJSON=function(){return t},e}};function c(t){if(i.String(t))return"?"===t[0]?h.maybe(t.slice(1)):i[t]||h.quacksLike(t);if(t&&i.Object(t)){if(i.Array(t)){if(1!==t.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return h.arrayOf(t[0])}return h.object(t)}return i.Function(t)?t:h.value(t)}function d(t,e,r,n){if(i.Function(t)){if(t(e,r))return!0;throw new s(n||t,e)}return d(c(t),e,r)}for(var l in h.oneOf=h.anyOf,i)d[l]=i[l];for(l in h)d[l]=h[l];var p=t("./extra");for(l in p)d[l]=p[l];d.compile=c,d.TfTypeError=s,d.TfPropertyTypeError=a,e.exports=d},{"./errors":216,"./extra":217,"./native":219}],219:[function(t,e,r){var n={Array:function(t){return null!==t&&void 0!==t&&t.constructor===Array},Boolean:function(t){return"boolean"==typeof t},Function:function(t){return"function"==typeof t},Nil:function(t){return void 0===t||null===t},Number:function(t){return"number"==typeof t},Object:function(t){return"object"==typeof t},String:function(t){return"string"==typeof t},"":function(){return!0}};for(var i in n.Null=n.Nil,n)n[i].toJSON=function(t){return t}.bind(null,i);e.exports=n},{}],220:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=9007199254740991;function o(t){if(t<0||t>i||t%1!=0)throw new RangeError("value out of range")}function s(t){return o(t),t<253?1:t<=65535?3:t<=4294967295?5:9}e.exports={encode:function t(e,r,i){if(o(e),r||(r=n.allocUnsafe(s(e))),!n.isBuffer(r))throw new TypeError("buffer must be a Buffer instance");return i||(i=0),e<253?(r.writeUInt8(e,i),t.bytes=1):e<=65535?(r.writeUInt8(253,i),r.writeUInt16LE(e,i+1),t.bytes=3):e<=4294967295?(r.writeUInt8(254,i),r.writeUInt32LE(e,i+1),t.bytes=5):(r.writeUInt8(255,i),r.writeUInt32LE(e>>>0,i+1),r.writeUInt32LE(e/4294967296|0,i+5),t.bytes=9),r},decode:function t(e,r){if(!n.isBuffer(e))throw new TypeError("buffer must be a Buffer instance");r||(r=0);var i=e.readUInt8(r);if(i<253)return t.bytes=1,i;if(253===i)return t.bytes=3,e.readUInt16LE(r+1);if(254===i)return t.bytes=5,e.readUInt32LE(r+1);t.bytes=9;var s=e.readUInt32LE(r+1),a=4294967296*e.readUInt32LE(r+5)+s;return o(a),a},encodingLength:s}},{"safe-buffer":204}],"/bolt11":[function(t,e,r){"use strict";const n=t("create-hash"),i=t("bech32"),o=t("secp256k1"),s=t("safe-buffer").Buffer,a=t("bn.js"),u=t("bitcoinjs-lib").address,f=t("lodash/cloneDeep"),h={bech32:"bc",pubKeyHash:0,scriptHash:5,validWitnessVersions:[0,1]},c={bech32:"tb",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0,1]},d={bech32:"bcrt",pubKeyHash:111,scriptHash:196,validWitnessVersions:[0,1]},l={bech32:"sb",pubKeyHash:63,scriptHash:123,validWitnessVersions:[0,1]},p=3600,b=9,y="",m={word_length:4,var_onion_optin:{required:!1,supported:!0},payment_secret:{required:!1,supported:!0}},g=["option_data_loss_protect","initial_routing_sync","option_upfront_shutdown_script","gossip_queries","var_onion_optin","gossip_queries_ex","option_static_remotekey","payment_secret","basic_mpp","option_support_large_channel"],w={m:new a(1e3,10),u:new a(1e6,10),n:new a(1e9,10),p:new a(1e12,10)},v=new a("2100000000000000000",10),_=new a(1e11,10),S=new a(1e8,10),E=new a(1e5,10),M=new a(100,10),k=new a(10,10),A={payment_hash:1,payment_secret:16,description:13,payee_node_key:19,purpose_commit_hash:23,expire_time:6,min_final_cltv_expiry:24,fallback_address:9,routing_info:3,feature_bits:5},I={};for(let t=0,e=Object.keys(A);t<e.length;t++){const r=e[t],n=A[e[t]].toString();I[n]=r}const T={payment_hash:L,payment_secret:L,description:function(t){const e=function(t){return s.from(t,"utf8")}(t);return i.toWords(e)},payee_node_key:L,purpose_commit_hash:function(t){let e;if(void 0===t||!("string"==typeof t||t instanceof String))throw new Error("purpose or purpose commit must be a string or hex string");e=t.match(/^([a-zA-Z0-9]{2})*$/)?s.from(t,"hex"):B(s.from(t,"utf8"));return i.toWords(e)},expire_time:R,min_final_cltv_expiry:R,fallback_address:function(t,e){return[t.code].concat(L(t.addressHash))},routing_info:function(t){let e=s.from([]);return t.forEach(t=>{e=s.concat([e,j(t.pubkey)]),e=s.concat([e,j(t.short_channel_id)]),e=s.concat([e,s.from([0,0,0].concat(R(t.fee_base_msat,8)).slice(-4))]),e=s.concat([e,s.from([0,0,0].concat(R(t.fee_proportional_millionths,8)).slice(-4))]),e=s.concat([e,s.from([0].concat(R(t.cltv_expiry_delta,8)).slice(-2))])}),L(e)},feature_bits:function(t){let e=t.word_length,r=[];g.forEach(e=>{r.push(!!(t[e]||{}).required),r.push(!!(t[e]||{}).supported)});for(;!1===r[r.length-1];)r.pop();for(;r.length%5!=0;)r.push(!1);if(t.extra_bits&&Array.isArray(t.extra_bits.bits)&&t.extra_bits.bits.length>0){for(;r.length<t.extra_bits.start_bit;)r.push(!1);r=r.concat(t.extra_bits.bits)}if(void 0!==e&&r.length/5>e)throw new Error("word_length is too small to contain all featureBits");void 0===e&&(e=Math.ceil(r.length/5));return new Array(e).fill(0).map((t,e)=>r[5*e+4]<<4|r[5*e+3]<<3|r[5*e+2]<<2|r[5*e+1]<<1|r[5*e]<<0).reverse()}},x={1:t=>C(t,!0).toString("hex"),16:t=>C(t,!0).toString("hex"),13:t=>C(t,!0).toString("utf8"),19:t=>C(t,!0).toString("hex"),23:t=>C(t,!0).toString("hex"),6:N,24:N,9:function(t,e){const r=t[0],n=C(t=t.slice(1),!0);let i=null;switch(r){case 17:i=u.toBase58Check(n,e.pubKeyHash);break;case 18:i=u.toBase58Check(n,e.scriptHash);break;case 0:case 1:i=u.toBech32(n,r,e.bech32)}return{code:r,address:i,addressHash:n.toString("hex")}},3:function(t){const e=[];let r,n,i,o,s,a=C(t,!0);for(;a.length>0;)r=a.slice(0,33).toString("hex"),n=a.slice(33,41).toString("hex"),i=parseInt(a.slice(41,45).toString("hex"),16),o=parseInt(a.slice(45,49).toString("hex"),16),s=parseInt(a.slice(49,51).toString("hex"),16),a=a.slice(51),e.push({pubkey:r,short_channel_id:n,fee_base_msat:i,fee_proportional_millionths:o,cltv_expiry_delta:s});return e},5:function(t){const e=t.slice().reverse().map(t=>[!!(1&t),!!(2&t),!!(4&t),!!(8&t),!!(16&t)]).reduce((t,e)=>t.concat(e),[]);for(;e.length<2*g.length;)e.push(!1);const r={word_length:t.length};if(g.forEach((t,n)=>{r[t]={required:e[2*n],supported:e[2*n+1]}}),e.length>2*g.length){const t=e.slice(2*g.length);r.extra_bits={start_bit:2*g.length,bits:t,has_required:t.reduce((t,e,r)=>r%2!=0?t||!1:t||e,!1)}}else r.extra_bits={start_bit:2*g.length,bits:[],has_required:!1};return r}},O="unknownTag";function P(t){return e=>({tagCode:parseInt(t),words:i.encode("unknown",e,Number.MAX_SAFE_INTEGER)})}function N(t){return t.reverse().reduce((t,e,r)=>t+e*Math.pow(32,r),0)}function R(t,e){const r=[];if(void 0===e&&(e=5),0===(t=Math.floor(t)))return[0];for(;t>0;)r.push(t&Math.pow(2,e)-1),t=Math.floor(t/Math.pow(2,e));return r.reverse()}function B(t){return n("sha256").update(t).digest()}function U(t,e,r){let n=0,i=0;const o=(1<<r)-1,s=[];for(let a=0;a<t.length;++a)for(n=n<<e|t[a],i+=e;i>=r;)i-=r,s.push(n>>i&o);return i>0&&s.push(n<<r-i&o),s}function C(t,e){let r=s.from(U(t,5,8));return e&&5*t.length%8!=0&&(r=r.slice(0,-1)),r}function j(t){return void 0!==t&&("string"==typeof t||t instanceof String)&&t.match(/^([a-zA-Z0-9]{2})*$/)?s.from(t,"hex"):t}function L(t){const e=j(t);return i.toWords(e)}function H(t,e){const r=t.filter(t=>t.tagName===e);return r.length>0?r[0].data:null}function D(t,e){return null!==H(t,e)}function q(t,e){const r={};if(Object.keys(t).sort().forEach(e=>{r[e]=t[e]}),!0===e){const t="__tagsObject_cache";Object.defineProperty(r,"tagsObject",{get(){return this[t]||Object.defineProperty(this,t,{value:function(t){const e={};return t.forEach(t=>{t.tagName===O?(e.unknownTags||(e.unknownTags=[]),e.unknownTags.push(t.data)):e[t.tagName]=t.data}),e}(this.tags)}),this[t]}})}return r}function F(t){if(!t.toString().match(/^\d+$/))throw new Error("satoshis must be an integer");return z(new a(t,10).mul(new a(1e3,10)))}function z(t){if(!t.toString().match(/^\d+$/))throw new Error("millisatoshis must be an integer");const e=new a(t,10),r=e.toString(10),n=r.length;let i,o;return n>11&&/0{11}$/.test(r)?(i="",o=e.div(_).toString(10)):n>8&&/0{8}$/.test(r)?(i="m",o=e.div(S).toString(10)):n>5&&/0{5}$/.test(r)?(i="u",o=e.div(E).toString(10)):n>2&&/0{2}$/.test(r)?(i="n",o=e.div(M).toString(10)):(i="p",o=e.mul(k).toString(10)),o+i}function K(t,e){const r=V(t,!1);if(!r.mod(new a(1e3,10)).eq(new a(0,10)))throw new Error("Amount is outside of valid range");const n=r.div(new a(1e3,10));return e?n.toString():n}function V(t,e){let r,n;if(t.slice(-1).match(/^[munp]$/))r=t.slice(-1),n=t.slice(0,-1);else{if(t.slice(-1).match(/^[^munp0-9]$/))throw new Error("Not a valid multiplier for the amount");n=t}if(!n.match(/^\d+$/))throw new Error("Not a valid human readable amount");const i=new a(n,10),o=r?i.mul(_).div(w[r]):i.mul(_);if("p"===r&&!i.mod(new a(10,10)).eq(new a(0,10))||o.gt(v))throw new Error("Amount is outside of valid range");return e?o.toString():o}e.exports={encode:function(t,e){const r=f(t);void 0===e&&(e=!0);const n=!(void 0===r.signature||void 0===r.recoveryFlag);let c,d,l,g,w,v;if(void 0!==r.network||n){if(void 0===r.network&&n)throw new Error("Need network for proper payment request reconstruction");if(!r.network.bech32||void 0===r.network.pubKeyHash||void 0===r.network.scriptHash||!Array.isArray(r.network.validWitnessVersions))throw new Error("Invalid network");c=r.network}else r.network=h,c=h;if(void 0!==r.timestamp||n){if(void 0===r.timestamp&&n)throw new Error("Need timestamp for proper payment request reconstruction")}else r.timestamp=Math.floor((new Date).getTime()/1e3);if(void 0===r.tags)throw new Error("Payment Requests need tags array");if(!D(r.tags,I[1]))throw new Error("Lightning Payment Request needs a payment hash");if(D(r.tags,I[16]))if(D(r.tags,I[5])){const t=H(r.tags,I[5]);if(!t.payment_secret||!t.payment_secret.supported&&!t.payment_secret.required)throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included")}else{if(!e)throw new Error("Payment request requires feature bits with at least payment secret support flagged if payment secret is included");r.tags.push({tagName:I[5],data:m})}if(!D(r.tags,I[13])&&!D(r.tags,I[23])){if(!e)throw new Error("Payment request requires description or purpose commit hash");r.tags.push({tagName:I[13],data:y})}if(D(r.tags,I[13])&&s.from(H(r.tags,I[13]),"utf8").length>639)throw new Error("Description is too long: Max length 639 bytes");if(D(r.tags,I[6])||n||!e||r.tags.push({tagName:I[6],data:p}),D(r.tags,I[24])||n||!e||r.tags.push({tagName:I[24],data:b}),D(r.tags,I[19])&&(l=j(H(r.tags,I[19]))),r.payeeNodeKey&&(d=j(r.payeeNodeKey)),d&&l&&!l.equals(d))throw new Error("payeeNodeKey and tag payee node key do not match");if((d=d||l)&&(r.payeeNodeKey=d.toString("hex")),D(r.tags,I[9])){const t=H(r.tags,I[9]);if(v=t.address,w=t.addressHash,g=t.code,void 0===w||void 0===g){let e,r;try{w=(e=u.fromBech32(v)).data,g=e.version}catch(t){try{(r=u.fromBase58Check(v)).version===c.pubKeyHash?g=17:r.version===c.scriptHash&&(g=18),w=r.hash}catch(t){throw new Error("Fallback address type is unknown")}}if(e&&!(e.version in c.validWitnessVersions))throw new Error("Fallback address witness version is unknown");if(e&&e.prefix!==c.bech32)throw new Error("Fallback address network type does not match payment request network type");if(r&&r.version!==c.pubKeyHash&&r.version!==c.scriptHash)throw new Error("Fallback address version (base58) is unknown or the network type is incorrect");t.addressHash=w.toString("hex"),t.code=g}}D(r.tags,I[3])&&H(r.tags,I[3]).forEach(t=>{if(void 0===t.pubkey||void 0===t.short_channel_id||void 0===t.fee_base_msat||void 0===t.fee_proportional_millionths||void 0===t.cltv_expiry_delta)throw new Error("Routing info is incomplete");if(!o.publicKeyVerify(j(t.pubkey)))throw new Error("Routing info pubkey is not a valid pubkey");const e=j(t.short_channel_id);if(!(e instanceof s)||8!==e.length)throw new Error("Routing info short channel id must be 8 bytes");if("number"!=typeof t.fee_base_msat||Math.floor(t.fee_base_msat)!==t.fee_base_msat)throw new Error("Routing info fee base msat is not an integer");if("number"!=typeof t.fee_proportional_millionths||Math.floor(t.fee_proportional_millionths)!==t.fee_proportional_millionths)throw new Error("Routing info fee proportional millionths is not an integer");if("number"!=typeof t.cltv_expiry_delta||Math.floor(t.cltv_expiry_delta)!==t.cltv_expiry_delta)throw new Error("Routing info cltv expiry delta is not an integer")});let _,S="ln";if(S+=c.bech32,r.millisatoshis&&r.satoshis){if(_=z(new a(r.millisatoshis,10)),F(new a(r.satoshis,10))!==_)throw new Error("satoshis and millisatoshis do not match")}else _=r.millisatoshis?z(new a(r.millisatoshis,10)):r.satoshis?F(new a(r.satoshis,10)):"";S+=_;const E=R(r.timestamp);for(;E.length<7;)E.unshift(0);let M=[];r.tags.forEach(t=>{const e=Object.keys(T);if(n&&e.push(O),-1===e.indexOf(t.tagName))throw new Error("Unknown tag key: "+t.tagName);let r;if(t.tagName!==O)M.push(A[t.tagName]),r=(0,T[t.tagName])(t.data);else{const e=function(t){return t.words=i.decode(t.words,Number.MAX_SAFE_INTEGER).words,t}(t.data);M.push(e.tagCode),r=e.words}M=(M=M.concat([0].concat(R(r.length)).slice(-2))).concat(r)});let k=E.concat(M);const x=B(s.concat([s.from(S,"utf8"),s.from(U(k,5,8))]));let P;if(n){if(!d)throw new Error("Reconstruction with signature and recoveryID requires payeeNodeKey to verify correctness of input data.");{const t=s.from(o.ecdsaRecover(s.from(r.signature,"hex"),r.recoveryFlag,x,!0));if(d&&!d.equals(t))throw new Error("Signature, message, and recoveryID did not produce the same pubkey as payeeNodeKey");P=L(r.signature+"0"+r.recoveryFlag)}}return P&&(k=k.concat(P)),D(r.tags,I[6])&&(r.timeExpireDate=r.timestamp+H(r.tags,I[6]),r.timeExpireDateString=new Date(1e3*r.timeExpireDate).toISOString()),r.timestampString=new Date(1e3*r.timestamp).toISOString(),r.complete=!!P,r.paymentRequest=r.complete?i.encode(S,k,Number.MAX_SAFE_INTEGER):"",r.prefix=S,r.wordsTemp=i.encode("temp",k,Number.MAX_SAFE_INTEGER),q(r)},decode:function(t,e){if("string"!=typeof t)throw new Error("Lightning Payment Request must be string");if("ln"!==t.slice(0,2).toLowerCase())throw new Error("Not a proper lightning payment request");const r=i.decode(t,Number.MAX_SAFE_INTEGER);t=t.toLowerCase();const n=r.prefix;let a=r.words;const u=a.slice(-104),f=a.slice(0,-104);a=a.slice(0,-104);let p=C(u,!0);const b=p.slice(-1)[0];if(p=p.slice(0,-1),!(b in[0,1,2,3])||64!==p.length)throw new Error("Signature is missing or incorrect");let y=n.match(/^ln(\S+?)(\d*)([a-zA-Z]?)$/);if(y&&!y[2]&&(y=n.match(/^ln(\S+)$/)),!y)throw new Error("Not a proper lightning payment request");const m=y[1];let g;if(e){if(void 0===e.bech32||void 0===e.pubKeyHash||void 0===e.scriptHash||!Array.isArray(e.validWitnessVersions))throw new Error("Invalid network");g=e}else switch(m){case h.bech32:g=h;break;case c.bech32:g=c;break;case d.bech32:g=d;break;case l.bech32:g=l}if(!g||g.bech32!==m)throw new Error("Unknown coin bech32 prefix");const w=y[2];let v,_,S;if(w){const t=y[3];try{v=parseInt(K(w+t,!0))}catch(t){v=null,S=!0}_=V(w+t,!0)}else v=null,_=null;const E=N(a.slice(0,7)),M=new Date(1e3*E).toISOString();a=a.slice(7);const k=[];let A,T,R,j,L,F;for(;a.length>0;){const t=a[0].toString();A=I[t]||O,T=x[t]||P(t),R=N((a=a.slice(1)).slice(0,2)),j=(a=a.slice(2)).slice(0,R),a=a.slice(R),k.push({tagName:A,data:T(j,g)})}D(k,I[6])&&(L=E+H(k,I[6]),F=new Date(1e3*L).toISOString());const z=B(s.concat([s.from(n,"utf8"),s.from(U(f,5,8))])),W=s.from(o.ecdsaRecover(p,b,z,!0));if(D(k,I[19])&&H(k,I[19])!==W.toString("hex"))throw new Error("Lightning Payment Request signature pubkey does not match payee pubkey");let G={paymentRequest:t,complete:!0,prefix:n,wordsTemp:i.encode("temp",f.concat(u),Number.MAX_SAFE_INTEGER),network:g,satoshis:v,millisatoshis:_,timestamp:E,timestampString:M,payeeNodeKey:W.toString("hex"),signature:p.toString("hex"),recoveryFlag:b,tags:k};return S&&delete G.satoshis,L&&(G=Object.assign(G,{timeExpireDate:L,timeExpireDateString:F})),q(G,!0)},sign:function(t,e){const r=f(t),n=j(e);if(r.complete&&r.paymentRequest)return r;if(void 0===n||32!==n.length||!o.privateKeyVerify(n))throw new Error("privateKey must be a 32 byte Buffer and valid private key");let a,u;if(D(r.tags,I[19])&&(u=j(H(r.tags,I[19]))),r.payeeNodeKey&&(a=j(r.payeeNodeKey)),a&&u&&!u.equals(a))throw new Error("payee node key tag and payeeNodeKey attribute must match");a=u||a;const h=s.from(o.publicKeyCreate(n));if(a&&!h.equals(a))throw new Error("The private key given is not the private key of the node public key given");const c=i.decode(r.wordsTemp,Number.MAX_SAFE_INTEGER).words,d=B(s.concat([s.from(r.prefix,"utf8"),C(c)])),l=o.ecdsaSign(d,n);l.signature=s.from(l.signature);const p=L(l.signature.toString("hex")+"0"+l.recid);return r.payeeNodeKey=h.toString("hex"),r.signature=l.signature.toString("hex"),r.recoveryFlag=l.recid,r.wordsTemp=i.encode("temp",c.concat(p),Number.MAX_SAFE_INTEGER),r.complete=!0,r.paymentRequest=i.encode(r.prefix,c.concat(p),Number.MAX_SAFE_INTEGER),q(r)},satToHrp:F,millisatToHrp:z,hrpToSat:K,hrpToMillisat:V}},{bech32:2,"bitcoinjs-lib":32,"bn.js":52,"create-hash":58,"lodash/cloneDeep":183,"safe-buffer":204,secp256k1:205}],221:[function(t,e,r){"use strict";r.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},r.toByteArray=function(t){var e,r,n=f(t),s=n[0],a=n[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),h=0,c=a>0?s-4:s;for(r=0;r<c;r+=4)e=i[t.charCodeAt(r)]<<18|i[t.charCodeAt(r+1)]<<12|i[t.charCodeAt(r+2)]<<6|i[t.charCodeAt(r+3)],u[h++]=e>>16&255,u[h++]=e>>8&255,u[h++]=255&e;2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,u[h++]=255&e);1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,u[h++]=e>>8&255,u[h++]=255&e);return u},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s<a;s+=16383)o.push(h(t,s,s+16383>a?a:s+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function h(t,e,r){for(var i,o,s=[],a=e;a<r;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(n[(o=i)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],222:[function(t,e,r){},{}],223:[function(t,e,r){(function(e){(function(){"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var i=2147483647;function o(t){if(t>i)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|d(t,e),n=o(r),i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return n.__proto__=s.prototype,n}(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);var i=function(t){if(s.isBuffer(t)){var e=0|c(t.length),r=o(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(void 0!==t.length)return"number"!=typeof t.length||D(t.length)?o(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return u(t),o(t<0?0:0|c(t))}function h(t){for(var e=t.length<0?0:0|c(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function c(t){if(t>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function d(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return C(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return j(t).length;default:if(i)return n?-1:C(t).length;e=(""+e).toLowerCase(),i=!0}}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function p(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),D(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o<a;o++)if(f(t,o)===f(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===u)return h*s}else-1!==h&&(o-=o-h),h=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var c=!0,d=0;d<u;d++)if(f(t,o+d)!==f(e,d)){c=!1;break}if(c)return o}return-1}function y(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(D(a))return s;t[r+s]=a}return s}function m(t,e,r,n){return L(C(e,t.length-r),t,r,n)}function g(t,e,r,n){return L(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function w(t,e,r,n){return g(t,e,r,n)}function v(t,e,r,n){return L(j(e),t,r,n)}function _(t,e,r,n){return L(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function S(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function E(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,a,u,f=t[i],h=null,c=f>239?4:f>223?3:f>191?2:1;if(i+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&f)<<6|63&o)>127&&(h=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&f)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(h=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&f)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(h=u)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),i+=c}return function(t){var e=t.length;if(e<=M)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=M));return r}(n)}r.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),s.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(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?o(t):void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)}(t,e,r)},s.allocUnsafe=function(t){return f(t)},s.allocUnsafeSlow=function(t){return f(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(H(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),H(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).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}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=s.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var o=t[r];if(H(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},s.byteLength=d,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)l(this,e,e+1);return this},s.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)l(this,e,e+3),l(this,e+1,e+2);return this},s.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)l(this,e,e+7),l(this,e+1,e+6),l(this,e+2,e+5),l(this,e+3,e+4);return this},s.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):function(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return S(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},s.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),f=this.slice(n,i),h=t.slice(e,r),c=0;c<u;++c)if(f[c]!==h[c]){o=f[c],a=h[c];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return p(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return p(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return m(this,t,e,r);case"ascii":return g(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return v(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=U(t[o]);return i}function T(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function x(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function P(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(t,e,r,i,o){return e=+e,r>>>=0,o||P(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function R(t,e,r,i,o){return e=+e,r>>>=0,o||P(t,0,r,8),n.write(t,e,r,i,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||x(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||x(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||x(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||x(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||x(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||x(t,4,this.length),n.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||x(t,8,this.length),n.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return N(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return N(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var o=i-1;o>=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{var a=s.isBuffer(t)?t:s.from(t,n),u=a.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=a[o%u]}return this};var B=/[^+/0-9A-Za-z-_]/g;function U(t){return t<16?"0"+t.toString(16):t.toString(16)}function C(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function j(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function D(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":221,buffer:223,ieee754:225}],224:[function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function a(){a.init.call(this)}e.exports=a,e.exports.once=function(t,e){return new Promise(function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,r)}(t,i,{once:!0})})},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var u=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,a;if(f(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,a=u,console&&console.warn&&console.warn(a)}return t}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){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)}.bind(n);return i.listener=r,n.wrapFn=i,i}function l(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(i):b(i,i.length)}function p(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function y(t,e,r,n){if("function"==typeof t.on)n.once?t.once(e,r):t.on(e,r);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)})}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");u=t}}),a.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},a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"==typeof u)o(u,this,e);else{var f=u.length,h=b(u,f);for(r=0;r<f;++r)o(h[r],this,e)}return!0},a.prototype.addListener=function(t,e){return c(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return c(this,t,e,!0)},a.prototype.once=function(t,e){return f(e),this.on(t,d(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){return f(e),this.prependListener(t,d(this,t,e)),this},a.prototype.removeListener=function(t,e){var r,n,i,o,s;if(f(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,i),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},a.prototype.listeners=function(t){return l(this,t,!0)},a.prototype.rawListeners=function(t){return l(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},a.prototype.listenerCount=p,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],225:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=r?i-1:0,d=r?-1:1,l=t[e+c];for(c+=d,o=l&(1<<-h)-1,l>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=n;h>0;s=256*s+t[e+c],c+=d,h-=8);if(0===o)o=1-f;else{if(o===u)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=f}return(l?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,f=8*o-i-1,h=(1<<f)-1,c=h>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?d/u:d*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&a,l+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;t[r+l]=255&s,l+=p,s/=256,f-=8);t[r+l-p]|=128*b}},{}],226:[function(t,e,r){arguments[4][75][0].apply(r,arguments)},{dup:75}],227:[function(t,e,r){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],228:[function(t,e,r){var n,i,o=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var f,h=[],c=!1,d=-1;function l(){c&&f&&(c=!1,f.length?h=f.concat(h):d=-1,h.length&&p())}function p(){if(!c){var t=u(l);c=!0;for(var e=h.length;e;){for(f=h,h=[];++d<e;)f&&f[d].run();d=-1,e=h.length}f=null,c=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function b(t,e){this.fun=t,this.array=e}function y(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new b(t,e)),1!==h.length||c||u(p)},b.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=y,o.addListener=y,o.once=y,o.off=y,o.removeListener=y,o.removeAllListeners=y,o.emit=y,o.prependListener=y,o.prependOnceListener=y,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],229:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:223}],230:[function(t,e,r){e.exports=i;var n=t("events").EventEmitter;function i(){n.call(this)}t("inherits")(i,n),i.Readable=t("readable-stream/lib/_stream_readable.js"),i.Writable=t("readable-stream/lib/_stream_writable.js"),i.Duplex=t("readable-stream/lib/_stream_duplex.js"),i.Transform=t("readable-stream/lib/_stream_transform.js"),i.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),i.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),i.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function f(t){if(h(),0===n.listenerCount(this,"error"))throw t}function h(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",h),r.removeListener("close",h),t.removeListener("close",h)}return r.on("error",f),t.on("error",f),r.on("end",h),r.on("close",h),t.on("close",h),t.emit("pipe",r),t}},{events:224,inherits:226,"readable-stream/lib/_stream_duplex.js":232,"readable-stream/lib/_stream_passthrough.js":233,"readable-stream/lib/_stream_readable.js":234,"readable-stream/lib/_stream_transform.js":235,"readable-stream/lib/_stream_writable.js":236,"readable-stream/lib/internal/streams/end-of-stream.js":240,"readable-stream/lib/internal/streams/pipeline.js":242}],231:[function(t,e,r){"use strict";var n={};function i(t,e,r){r||(r=Error);var i=function(t){var r,n;function i(r,n,i){return t.call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,n,i))||this}return n=t,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=t,n[t]=i}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,i,s,a;if("string"==typeof e&&(i="not ",e.substr(!s||s<0?0:+s,i.length)===i)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))a="The ".concat(t," ").concat(n," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";a='The "'.concat(t,'" ').concat(u," ").concat(n," ").concat(o(e,"type"))}return a+=". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],232:[function(t,e,r){(function(r){(function(){"use strict";var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=f;var i=t("./_stream_readable"),o=t("./_stream_writable");t("inherits")(f,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];f.prototype[u]||(f.prototype[u]=o.prototype[u])}function f(t){if(!(this instanceof f))return new f(t);i.call(this,t),o.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||r.nextTick(c,this)}function c(t){t.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":234,"./_stream_writable":236,_process:228,inherits:226}],233:[function(t,e,r){"use strict";e.exports=i;var n=t("./_stream_transform");function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}t("inherits")(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":235,inherits:226}],234:[function(t,e,r){(function(r,n){(function(){"use strict";var i;e.exports=k,k.ReadableState=M;t("events").EventEmitter;var o=function(t,e){return t.listeners(e).length},s=t("./internal/streams/stream"),a=t("buffer").Buffer,u=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var f,h=t("util");f=h&&h.debuglog?h.debuglog("stream"):function(){};var c,d,l,p=t("./internal/streams/buffer_list"),b=t("./internal/streams/destroy"),y=t("./internal/streams/state").getHighWaterMark,m=t("../errors").codes,g=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,v=m.ERR_METHOD_NOT_IMPLEMENTED,_=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(k,s);var S=b.errorOrDestroy,E=["error","close","destroy","pause","resume"];function M(e,r,n){i=i||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",n),this.buffer=new p,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.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(c||(c=t("string_decoder/").StringDecoder),this.decoder=new c(e.encoding),this.encoding=e.encoding)}function k(e){if(i=i||t("./_stream_duplex"),!(this instanceof k))return new k(e);var r=this instanceof i;this._readableState=new M(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(t,e,r,n,i){f("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,function(t,e){if(f("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?O(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,P(t)))}(t,s);else if(i||(o=function(t,e){var r;n=e,a.isBuffer(n)||n instanceof u||"string"==typeof e||void 0===e||t.objectMode||(r=new g("chunk",["string","Buffer","Uint8Array"],e));var n;return r}(s,e)),o)S(t,o);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=function(t){return a.from(t)}(e)),n)s.endEmitted?S(t,new _):I(t,s,e,!0);else if(s.ended)S(t,new w);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?I(t,s,e,!1):N(t,s)):I(t,s,e,!1)}else n||(s.reading=!1,N(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function I(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&O(t)),N(t,e)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),k.prototype.destroy=b.destroy,k.prototype._undestroy=b.undestroy,k.prototype._destroy=function(t,e){e(t)},k.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),A(this,t,e,!1,r)},k.prototype.unshift=function(t){return A(this,t,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){c||(c=t("string_decoder/").StringDecoder);var r=new c(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var T=1073741824;function x(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=T?t=T:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function O(t){var e=t._readableState;f("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(P,t))}function P(t){var e=t._readableState;f("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function N(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(f("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function B(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){f("readable nexttick read 0"),t.read(0)}function C(t,e){f("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function H(t){var e=t._readableState;f("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(D,e,t))}function D(t,e){if(f("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function q(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}k.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?H(this):O(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&H(this),null;var n,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",i=!0),e.ended||e.reading?f("reading or ended",i=!1):i&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=x(r,e))),null===(n=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&H(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(t){S(this,new v("_read()"))},k.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?u:y;function a(e,r){f("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,f("cleanup"),t.removeListener("close",p),t.removeListener("finish",b),t.removeListener("drain",h),t.removeListener("error",l),t.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",y),n.removeListener("data",d),c=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function u(){f("onend"),t.end()}i.endEmitted?r.nextTick(s):n.once("end",s),t.on("unpipe",a);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,j(t))}}(n);t.on("drain",h);var c=!1;function d(e){f("ondata");var r=t.write(e);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==q(i.pipes,t))&&!c&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function l(e){f("onerror",e),y(),t.removeListener("error",l),0===o(t,"error")&&S(t,e)}function p(){t.removeListener("finish",b),y()}function b(){f("onfinish"),t.removeListener("close",p),y()}function y(){f("unpipe"),n.unpipe(t)}return n.on("data",d),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",l),t.once("close",p),t.once("finish",b),t.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),t},k.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=q(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)},k.prototype.on=function(t,e){var n=s.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?O(this):i.reading||r.nextTick(U,this))),n},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(t,e){var n=s.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(B,this),n},k.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(B,this),e},k.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(C,t,e))}(this,t)),t.paused=!1,this},k.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",function(){if(f("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),!r.objectMode||null!==i&&void 0!==i)&&((r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause())))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o<E.length;o++)t.on(E[o],this.emit.bind(this,E[o]));return this._read=function(e){f("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=t("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),k._fromList=L,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,r){return void 0===l&&(l=t("./internal/streams/from")),l(k,e,r)})}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":231,"./_stream_duplex":232,"./internal/streams/async_iterator":237,"./internal/streams/buffer_list":238,"./internal/streams/destroy":239,"./internal/streams/from":241,"./internal/streams/state":243,"./internal/streams/stream":244,_process:228,buffer:223,events:224,inherits:226,"string_decoder/":245,util:222}],235:[function(t,e,r){"use strict";e.exports=f;var n=t("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=t("./_stream_duplex");function f(t){if(!(this instanceof f))return new f(t);u.call(this,t),this._transformState={afterTransform:function(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?c(this,null,null):this._flush(function(e,r){c(t,e,r)})}function c(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}t("inherits")(f,u),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new i("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,function(t){e(t)})}},{"../errors":231,"./_stream_duplex":232,inherits:226}],236:[function(t,e,r){(function(r,n){(function(){"use strict";function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;t.entry=null;for(;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var o;e.exports=k,k.WritableState=M;var s={deprecate:t("util-deprecate")},a=t("./internal/streams/stream"),u=t("buffer").Buffer,f=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var h,c=t("./internal/streams/destroy"),d=t("./internal/streams/state").getHighWaterMark,l=t("../errors").codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_METHOD_NOT_IMPLEMENTED,y=l.ERR_MULTIPLE_CALLBACK,m=l.ERR_STREAM_CANNOT_PIPE,g=l.ERR_STREAM_DESTROYED,w=l.ERR_STREAM_NULL_VALUES,v=l.ERR_STREAM_WRITE_AFTER_END,_=l.ERR_UNKNOWN_ENCODING,S=c.errorOrDestroy;function E(){}function M(e,n,s){o=o||t("./_stream_duplex"),e=e||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",s),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(t){!function(t,e){var n=t._writableState,i=n.sync,o=n.writecb;if("function"!=typeof o)throw new y;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,o){--e.pendingcb,n?(r.nextTick(o,i),r.nextTick(P,t,e),t._writableState.errorEmitted=!0,S(t,i)):(o(i),t._writableState.errorEmitted=!0,S(t,i),P(t,e))}(t,n,i,e,o);else{var s=x(n)||t.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||T(t,n),i?r.nextTick(I,t,n,s,o):I(t,n,s,o)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function k(e){var r=this instanceof(o=o||t("./_stream_duplex"));if(!r&&!h.call(k,this))return new k(e);this._writableState=new M(e,this,r),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)),a.call(this)}function A(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new g("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function I(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),P(t,e)}function T(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,A(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,h=r.encoding,c=r.callback;if(A(t,e,!1,e.objectMode?1:f.length,f,h,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function x(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final(function(r){e.pendingcb--,r&&S(t,r),e.prefinished=!0,t.emit("prefinish"),P(t,e)})}function P(t,e){var n=x(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(O,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}t("inherits")(k,a),M.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(M.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===k&&(t&&t._writableState instanceof M)}})):h=function(t){return t instanceof this},k.prototype.pipe=function(){S(this,new m)},k.prototype.write=function(t,e,n){var i,o=this._writableState,s=!1,a=!o.objectMode&&(i=t,u.isBuffer(i)||i instanceof f);return a&&!u.isBuffer(t)&&(t=function(t){return u.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof n&&(n=E),o.ending?function(t,e){var n=new v;S(t,n),r.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var o;return null===n?o=new w:"string"==typeof n||e.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(S(t,o),r.nextTick(i,o),!1)}(this,o,t,n))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r));return e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var f=e.length<e.highWaterMark;f||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else A(t,e,!1,a,n,i,o);return f}(this,o,a,t,e,n)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||T(this,t))},k.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new b("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,P(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=c.destroy,k.prototype._undestroy=c.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":231,"./_stream_duplex":232,"./internal/streams/destroy":239,"./internal/streams/state":243,"./internal/streams/stream":244,_process:228,buffer:223,inherits:226,"util-deprecate":246}],237:[function(t,e,r){(function(r){(function(){"use strict";var n;function i(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var o=t("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),f=Symbol("ended"),h=Symbol("lastPromise"),c=Symbol("handlePromise"),d=Symbol("stream");function l(t,e){return{value:t,done:e}}function p(t){var e=t[s];if(null!==e){var r=t[d].read();null!==r&&(t[h]=null,t[s]=null,t[a]=null,e(l(r,!1)))}}var b=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((i(n={get stream(){return this[d]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[f])return Promise.resolve(l(void 0,!0));if(this[d].destroyed)return new Promise(function(e,n){r.nextTick(function(){t[u]?n(t[u]):e(l(void 0,!0))})});var n,i=this[h];if(i)n=new Promise(function(t,e){return function(r,n){t.then(function(){e[f]?r(l(void 0,!0)):e[c](r,n)},n)}}(i,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[c])}return this[h]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var t=this;return new Promise(function(e,r){t[d].destroy(null,function(t){t?r(t):e(l(void 0,!0))})})}),n),b);e.exports=function(t){var e,n=Object.create(y,(i(e={},d,{value:t,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,f,{value:t._readableState.endEmitted,writable:!0}),i(e,c,{value:function(t,e){var r=n[d].read();r?(n[h]=null,n[s]=null,n[a]=null,t(l(r,!1))):(n[s]=t,n[a]=e)},writable:!0}),e));return n[h]=null,o(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[a];return null!==e&&(n[h]=null,n[s]=null,n[a]=null,e(t)),void(n[u]=t)}var r=n[s];null!==r&&(n[h]=null,n[s]=null,n[a]=null,r(l(void 0,!0))),n[f]=!0}),t.on("readable",function(t){r.nextTick(p,t)}.bind(null,n)),n}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":240,_process:228}],238:[function(t,e,r){"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function i(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function o(t,e,r){return(e=a(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var u=t("buffer").Buffer,f=t("util").inspect,h=f&&f.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,r,n;return e=t,(r=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return u.alloc(0);for(var e,r,n,i=u.allocUnsafe(t>>>0),o=this.head,s=0;o;)e=o.data,r=i,n=s,u.prototype.copy.call(e,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var i=e.data,o=t>i.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0===(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=u.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0===(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:h,value:function(t,e){return f(this,i(i({},e),{},{depth:0,customInspect:!1}))}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},{buffer:223,util:222}],239:[function(t,e,r){(function(t){(function(){"use strict";function r(t,e){i(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}e.exports={destroy:function(e,o){var s=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?s._writableState?s._writableState.errorEmitted?t.nextTick(n,s):(s._writableState.errorEmitted=!0,t.nextTick(r,s,e)):t.nextTick(r,s,e):o?(t.nextTick(n,s),o(e)):t.nextTick(n,s)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,t("_process"))},{_process:228}],240:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&e.readable,a=r.writable||!1!==r.writable&&e.writable,u=function(){e.writable||h()},f=e._writableState&&e._writableState.finished,h=function(){a=!1,f=!0,s||o.call(e)},c=e._readableState&&e._readableState.endEmitted,d=function(){s=!1,c=!0,a||o.call(e)},l=function(t){o.call(e,t)},p=function(){var t;return s&&!c?(e._readableState&&e._readableState.ended||(t=new n),o.call(e,t)):a&&!f?(e._writableState&&e._writableState.ended||(t=new n),o.call(e,t)):void 0},b=function(){e.req.on("finish",h)};return function(t){return t.setHeader&&"function"==typeof t.abort}(e)?(e.on("complete",h),e.on("abort",p),e.req?b():e.on("request",b)):a&&!e._writableState&&(e.on("end",u),e.on("close",u)),e.on("end",d),e.on("finish",h),!1!==r.error&&e.on("error",l),e.on("close",p),function(){e.removeListener("complete",h),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",h),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",h),e.removeListener("end",d),e.removeListener("error",l),e.removeListener("close",p)}}},{"../../../errors":231}],241:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],242:[function(t,e,r){"use strict";var n;var i=t("../../../errors").codes,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t){t()}function f(t,e){return t.pipe(e)}e.exports=function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var h,c=function(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new o("streams");var d=r.map(function(e,i){var o=i<r.length-1;return function(e,r,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:r,writable:i},function(t){if(t)return o(t);a=!0,o()});var u=!1;return function(t){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(t){h||(h=t),t&&d.forEach(u),o||(d.forEach(u),c(h))})});return r.reduce(f)}},{"../../../errors":231,"./end-of-stream":240}],243:[function(t,e,r){"use strict";var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},{"../../../errors":231}],244:[function(t,e,r){e.exports=t("events").EventEmitter},{events:224}],245:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=f,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=h,this.end=c,e=3;break;default:return this.write=d,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function f(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function h(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function l(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var r=function(t,e,r){var n=e.length-1;if(n<r)return 0;var i=s(e[n]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--n<r||-2===i)return 0;if((i=s(e[n]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":229}],246:[function(t,e,r){(function(t){(function(){function r(e){try{if(!t.localStorage)return!1}catch(t){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(t,e){if(r("noDeprecation"))return t;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[])("/bolt11")});
|