nano-wallet/js/app.a052d24c.js

2 lines
86 KiB
JavaScript

(function(t){function e(e){for(var n,r,o=e[0],c=e[1],l=e[2],u=0,p=[];u<o.length;u++)r=o[u],Object.prototype.hasOwnProperty.call(s,r)&&s[r]&&p.push(s[r][0]),s[r]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(t[n]=c[n]);d&&d(e);while(p.length)p.shift()();return i.push.apply(i,l||[]),a()}function a(){for(var t,e=0;e<i.length;e++){for(var a=i[e],n=!0,r=1;r<a.length;r++){var c=a[r];0!==s[c]&&(n=!1)}n&&(i.splice(e--,1),t=o(o.s=a[0]))}return t}var n={},s={app:0},i=[];function r(t){return o.p+"js/"+({about:"about"}[t]||t)+"."+{about:"b8b03ced"}[t]+".js"}function o(e){if(n[e])return n[e].exports;var a=n[e]={i:e,l:!1,exports:{}};return t[e].call(a.exports,a,a.exports,o),a.l=!0,a.exports}o.e=function(t){var e=[],a=s[t];if(0!==a)if(a)e.push(a[2]);else{var n=new Promise((function(e,n){a=s[t]=[e,n]}));e.push(a[2]=n);var i,c=document.createElement("script");c.charset="utf-8",c.timeout=120,o.nc&&c.setAttribute("nonce",o.nc),c.src=r(t);var l=new Error;i=function(e){c.onerror=c.onload=null,clearTimeout(u);var a=s[t];if(0!==a){if(a){var n=e&&("load"===e.type?"missing":e.type),i=e&&e.target&&e.target.src;l.message="Loading chunk "+t+" failed.\n("+n+": "+i+")",l.name="ChunkLoadError",l.type=n,l.request=i,a[1](l)}s[t]=void 0}};var u=setTimeout((function(){i({type:"timeout",target:c})}),12e4);c.onerror=c.onload=i,document.head.appendChild(c)}return Promise.all(e)},o.m=t,o.c=n,o.d=function(t,e,a){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},o.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(a,n,function(e){return t[e]}.bind(null,n));return a},o.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/",o.oe=function(t){throw console.error(t),t};var c=window["webpackJsonp"]=window["webpackJsonp"]||[],l=c.push.bind(c);c.push=e,c=c.slice();for(var u=0;u<c.length;u++)e(c[u]);var d=l;i.push([2,"chunk-vendors"]),a()})({0:function(t,e){},"0bee":function(t,e,a){"use strict";var n=a("3ae5"),s=a.n(n);s.a},"0e4f":function(t,e,a){},1:function(t,e){},1594:function(t,e,a){},2:function(t,e,a){t.exports=a("56d7")},3:function(t,e){},"3ae5":function(t,e,a){},4:function(t,e){},"4e8e":function(t,e,a){"use strict";var n=a("8288"),s=a.n(n);s.a},"56d7":function(t,e,a){"use strict";a.r(e);var n={};a.r(n),a.d(n,"nodeLink",(function(){return we}));var s={};a.r(s),a.d(s,"pow",(function(){return ye})),a.d(s,"ready",(function(){return xe})),a.d(s,"privatekey",(function(){return Ce})),a.d(s,"node",(function(){return _e})),a.d(s,"history",(function(){return Se})),a.d(s,"pending",(function(){return Te})),a.d(s,"balance",(function(){return Ae})),a.d(s,"resetState",(function(){return Re}));var i={};a.r(i),a.d(i,"node",(function(){return Pe})),a.d(i,"getSeed",(function(){return Be})),a.d(i,"seedData",(function(){return Ie})),a.d(i,"getDetails",(function(){return Le})),a.d(i,"rpCall",(function(){return We})),a.d(i,"history",(function(){return Ue})),a.d(i,"pending",(function(){return qe})),a.d(i,"resetState",(function(){return Qe}));a("e260"),a("e6cf"),a("cca6"),a("a79d");var r=a("2b0e"),o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{attrs:{id:"app"}},[a("router-view"),a("notifications",{attrs:{position:"top center"}})],1)},c=[],l={name:"App",components:{},data:function(){return{key:null}},watch:{$route:function(){this.$store.dispatch("app/node")}},created:function(){this.$store.dispatch("app/node")}},u=l,d=(a("5c0b"),a("2877")),p=Object(d["a"])(u,o,c,!1,null,null,null),v=p.exports,f=(a("d3b7"),a("8c4f")),h=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wallet"},[a("div",{attrs:{type:"hidden",id:"workstorage"}}),a("div",{staticClass:"page",class:{active:!1===t.open},attrs:{id:"login"}},[a("div",{staticClass:"title rpc"},[t._v("RPC Server : "),a("span",[t._v(t._s(t.$store.state.app.node.address))])]),a("div",{attrs:{id:"inputs"}},[null!==t.error?a("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e(),a("div",{staticClass:"labeltabs"},[a("label",{staticClass:"df",class:{active:!0===t.seedtab},attrs:{for:"seed"},on:{click:t.setSeed}},[t._v(" Seed ")]),a("label",{staticClass:"df",class:{active:!0!==t.seedtab},attrs:{for:"key"},on:{click:t.setPrivate}},[t._v(" Private Key ")]),!0===t.seedtab?a("a",{staticClass:"morebutton mla",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.showadvanced=!t.showadvanced}}},[a("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})]):t._e()]),!0===t.seedtab?a("div",{staticClass:"login"},["checkbox"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:"checkbox"},domProps:{checked:Array.isArray(t.seed)?t._i(t.seed,null)>-1:t.seed},on:{change:function(e){var a=t.seed,n=e.target,s=!!n.checked;if(Array.isArray(a)){var i=null,r=t._i(a,i);n.checked?r<0&&(t.seed=a.concat([i])):r>-1&&(t.seed=a.slice(0,r).concat(a.slice(r+1)))}else t.seed=s}}}):"radio"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:"radio"},domProps:{checked:t._q(t.seed,null)},on:{change:function(e){t.seed=null}}}):a("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],attrs:{placeholder:"Seed",id:"seed",name:"seed",type:t.logintype},domProps:{value:t.seed},on:{input:function(e){e.target.composing||(t.seed=e.target.value)}}}),a("span",{staticClass:"eye",on:{click:t.togglevisibility}},[a("span",{class:{active:"password"===t.logintype}},[a("i",{staticClass:"far fa-eye"})]),a("span",{class:{active:"text"===t.logintype}},[a("i",{staticClass:"far fa-eye-slash"})])])]):t._e(),!1===t.seedtab?a("div",{staticClass:"login"},["checkbox"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:"checkbox"},domProps:{checked:Array.isArray(t.key)?t._i(t.key,null)>-1:t.key},on:{change:function(e){var a=t.key,n=e.target,s=!!n.checked;if(Array.isArray(a)){var i=null,r=t._i(a,i);n.checked?r<0&&(t.key=a.concat([i])):r>-1&&(t.key=a.slice(0,r).concat(a.slice(r+1)))}else t.key=s}}}):"radio"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:"radio"},domProps:{checked:t._q(t.key,null)},on:{change:function(e){t.key=null}}}):a("input",{directives:[{name:"model",rawName:"v-model",value:t.key,expression:"key"}],attrs:{placeholder:"Private key",id:"key",name:"key",type:t.logintype},domProps:{value:t.key},on:{input:function(e){e.target.composing||(t.key=e.target.value)}}}),a("span",{staticClass:"eye",on:{click:t.togglevisibility}},[a("span",{class:{active:"password"===t.logintype}},[a("i",{staticClass:"far fa-eye"})]),a("span",{class:{active:"text"===t.logintype}},[a("i",{staticClass:"far fa-eye-slash"})])])]):t._e(),!0===t.showadvanced?a("div",[a("label",{attrs:{for:"seedindex"}},[t._v("Seed Index")]),a("div",{staticClass:"login"},["checkbox"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:"checkbox"},domProps:{checked:Array.isArray(t.seedindex)?t._i(t.seedindex,null)>-1:t.seedindex},on:{change:function(e){var a=t.seedindex,n=e.target,s=!!n.checked;if(Array.isArray(a)){var i=null,r=t._i(a,i);n.checked?r<0&&(t.seedindex=a.concat([i])):r>-1&&(t.seedindex=a.slice(0,r).concat(a.slice(r+1)))}else t.seedindex=s}}}):"radio"===t.logintype?a("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:"radio"},domProps:{checked:t._q(t.seedindex,null)},on:{change:function(e){t.seedindex=null}}}):a("input",{directives:[{name:"model",rawName:"v-model",value:t.seedindex,expression:"seedindex"}],attrs:{id:"seedindex",name:"seedindex",type:t.logintype},domProps:{value:t.seedindex},on:{input:function(e){e.target.composing||(t.seedindex=e.target.value)}}})])]):t._e(),a("button",{staticClass:"openwallet btn",attrs:{type:"button"},on:{click:t.openWallet}},[t._v("Open Wallet")]),a("scan-qr",{on:{scanned:t.scanDone}}),!1!==t.nfcsup?a("scan-nfc",{on:{scanned:t.scanDone}}):t._e()],1),a("div",{attrs:{id:"buttons"}},[a("router-link",{staticClass:"genwallet",attrs:{to:t.$store.getters["app/nodeLink"]+"generate"}},[t._v("Generate Wallet")])],1)]),a("div",{staticClass:"page",class:{active:!0===t.open},attrs:{id:"wallet"}},[a("div",{attrs:{id:"powstatus"}},[a("div",{staticClass:"status busy",class:{active:!1===t.ready}},[t._v("Calculating Work "),a("i",{staticClass:"fas fa-spinner fa-spin"})]),a("div",{staticClass:"status ready",class:{active:!0===t.ready}},[t._v("Ready "),a("i",{staticClass:"fas fa-check"})])]),a("div",{staticClass:"inner"},[a("div",{staticClass:"block"},[a("div",{staticClass:"headingtitle top"},[a("span",{attrs:{id:"closewallet"},on:{click:t.logout}},[a("i",{staticClass:"fal fa-sign-out fa-flip-horizontal"})]),a("span",[t._v("Wallet")]),a("span",{staticClass:"refresh rotate",class:{down:t.isActive},on:{click:t.refresh}},[a("i",{staticClass:"fal fa-sync"})]),a("div",{staticClass:"lastrefresh"},[t._v("Last Refresh: "+t._s(t.lastrefresh.toLocaleTimeString()))])]),a("simplebar",{staticClass:"block pending"},[a("div",{attrs:{id:"output"}},[a("div",{staticClass:"balance"},[a("div",{staticClass:"raw",class:{active:t.balanceextra},on:{click:function(e){return t.copyToClipboard(t.address)}}},[t._v(t._s(t.address))]),a("div",{staticClass:"value",domProps:{innerHTML:t._s(t.abbreviateNumber(t.balance))}}),a("div",{staticClass:"raw",class:{active:t.balanceextra}},[t._v(t._s(t.balance))]),a("a",{staticClass:"balanceextra",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.balanceextra=!t.balanceextra}}},[a("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})])])]),a("div",{staticClass:"headingtitle showmobile"},[t._v("History")]),t._l(t.pending,(function(e,n){return a("transaction",{key:n,attrs:{index:n,transaction:e,type:"pending"},on:{blockdetails:function(e){t.blockdetails=e},receive:t.refreshDetails}})}))],2)],1),a("simplebar",{staticClass:"block history"},[a("div",{staticClass:"headingtitle hidemobile"},[t._v("History")]),t._l(t.history,(function(e,n){return a("transaction",{key:n,attrs:{index:n,transaction:e,type:e.type},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),a("div",{staticClass:"menu",attrs:{id:"walletmenu"}},[a("div",{staticClass:"bg"}),a("div",{staticClass:"content"},[a("div",{staticClass:"tab",attrs:{"data-tab":"#receive"},on:{click:function(e){t.receive=!0}}},[t._m(0),a("span",[t._v("Receive")])]),a("div",{staticClass:"tab",attrs:{"data-tab":"#send"},on:{click:function(e){t.send=!0}}},[t._m(1),a("span",[t._v("Send")])]),a("div",{staticClass:"tab",attrs:{"data-tab":"#settings"},on:{click:function(e){t.settings=!0}}},[t._m(2),a("span",[t._v("Settings")])])])])]),a("div",{staticClass:"page",class:{active:!1!==t.send},attrs:{id:"send"}},[!0===t.closebutton?a("a",{staticClass:"close",on:{click:function(e){t.send=!1}}},[a("i",{staticClass:"fal fa-times"})]):t._e(),a("send",{attrs:{open:t.send},on:{close:function(e){t.send=!1}}})],1),a("div",{staticClass:"page",class:{active:!1!==t.settings},attrs:{id:"settings"}},[!0===t.closebutton?a("a",{staticClass:"close",on:{click:function(e){t.settings=!1}}},[a("i",{staticClass:"fal fa-times"})]):t._e(),a("settings",{attrs:{open:t.settings,representative:t.representative},on:{change:t.repChange}})],1),a("div",{staticClass:"page",class:{active:!1!==t.receive},attrs:{id:"receive"}},[!0===t.closebutton?a("a",{staticClass:"close",on:{click:function(e){t.receive=!1}}},[a("i",{staticClass:"fal fa-times"})]):t._e(),a("receive",{attrs:{address:t.address}})],1),a("div",{staticClass:"page",class:{active:null!==t.blockdetails},attrs:{id:"blockdetails"}},[!0===t.closebutton?a("a",{staticClass:"close",on:{click:function(e){t.blockdetails=null}}},[a("i",{staticClass:"fal fa-times"})]):t._e(),a("block-state",{attrs:{details:t.blockdetails}})],1)])},m=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticClass:"menuicon"},[a("i",{staticClass:"fal fa-wallet",attrs:{"data-fa-transform":"grow-8"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticClass:"menuicon"},[a("i",{staticClass:"fal fa-coins",attrs:{"data-fa-transform":"grow-8"}})])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("span",{staticClass:"menuicon"},[a("i",{staticClass:"fal fa-cog",attrs:{"data-fa-transform":"grow-8"}})])}],b=(a("c975"),a("b0c0"),a("b64b"),a("ac1f"),a("5319"),a("2ca0"),a("b85c")),g=(a("96cf"),a("1da1")),k=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"transaction",class:t.type},[a("div",{staticClass:"type icon",attrs:{value:t.hash},on:{click:function(e){return t.$emit("blockdetails",t.hash)}}},["send"===t.type?a("i",{staticClass:"fal fa-minus-circle"}):"pending"===t.type?a("i",{staticClass:"fal fa-exclamation-circle"}):a("i",{staticClass:"fal fa-plus-circle"})]),a("div",{staticClass:"innerdetails"},[a("div",{staticClass:"amount"},[a("div",{staticClass:"value",attrs:{title:t.rawValue},domProps:{innerHTML:t._s(t.formattedValue)}},[a("i",{staticClass:"fal fa-coin"})]),"pending"!==t.type?a("div",{staticClass:"type"},[t._v(t._s(t.transactionStatus(t.transaction.type)))]):t._e(),"pending"===t.type?a("div",{staticClass:"type"},[null!==t.privatekey?a("button",{staticClass:"pocket",on:{click:t.receive}},[t._v("Click to Receive")]):a("div",{},[t._v("Delivered")])]):t._e()]),a("div",{staticClass:"address"},["pending"!==t.type?a("span",{domProps:{innerHTML:t._s(t.abbreviateAddress(t.transaction.account)+" "+t.formattedDate)},on:{click:function(e){return t.link("address",t.transaction.account)}}}):t._e(),"pending"===t.type?a("span",{domProps:{innerHTML:t._s(t.abbreviateAddress(t.transaction.source))},on:{click:function(e){return t.link("address",t.transaction.source)}}}):t._e()])])])},w=[],y=(a("a9e3"),a("b680"),a("174c")),x=a("7582"),C=a("901e"),_=a.n(C),S={name:"Transaction",props:{transaction:Object,type:String,index:[Number,String]},mixins:[x["a"]],computed:{rawValue:function(){return y["convert"](this.transaction.amount,this.rawconv)},formattedValue:function(){return("send"===this.transaction.type?"-":"+")+this.abbreviateNumber(y["convert"](this.transaction.amount,this.rawconv),5)},formattedDate:function(){var t=new Date(1e3*this.transaction.local_timestamp);return t.getDate()+" "+t.toLocaleString("default",{month:"short"})+" "+t.getFullYear()},pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},privatekey:function(){return this.$store.state.app.privatekey},hash:function(){return"pending"===this.type?this.index:this.transaction.hash}},methods:{receive:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n,s,i,r,o,c,l,u,d,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),a=y["derivePublicKey"](t.privatekey),n=y["deriveAddress"](a,{useNanoPrefix:!0}),s={},s["action"]="account_info",s["representative"]="true",s["account"]=n,e.next=9,t.$store.dispatch("app/rpCall",s);case 9:return i=e.sent,r="0",o="open",c="0000000000000000000000000000000000000000000000000000000000000000",l=n,"balance"in i&&(r=i.balance,o="receive",c=i.frontier,l=i.representative),u=new _.a(r).plus(new _.a(t.transaction.amount)).toFixed(),d=y["createBlock"](t.privatekey,{work:t.pow,previous:c,representative:l,balance:u,link:t.index}),p={},p["action"]="process",p["json_block"]="true",p["subtype"]=o,p["block"]=d.block,e.next=24,t.$store.dispatch("app/rpCall",p);case 24:t.$emit("receive",!0);case 25:case"end":return e.stop()}}),e)})))()}}},T=S,A=Object(d["a"])(T,k,w,!1,null,"06cff353",null),R=A.exports,$=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"send"},[a("div",{attrs:{id:"sendform"}},[a("label",{attrs:{for:"amount"}},[t._v("Amount:")]),a("div",{staticClass:"login"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],attrs:{type:"text",id:"amount",name:"amount"},domProps:{value:t.amount},on:{input:function(e){e.target.composing||(t.amount=e.target.value)}}}),a("span",{staticClass:"max",on:{click:t.setmax}},[t._v("MAX")])]),a("label",{attrs:{for:"destination"}},[t._v("Destination:")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.destination,expression:"destination"}],attrs:{type:"text",id:"destination",name:"destination"},domProps:{value:t.destination},on:{input:function(e){e.target.composing||(t.destination=e.target.value)}}})]),a("scan-qr",{on:{scanned:t.scanDone}}),!1!==t.nfcsup?a("scan-nfc",{on:{scanned:t.scanDone}}):t._e(),a("button",{staticClass:"sendfunds btn",attrs:{type:"button"},on:{click:t.send}},[t._v("Send")])],1)},O=[],N=(a("4160"),a("1276"),a("159b"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"scan-qr-code"},[a("button",{staticClass:"scan btn outline",attrs:{type:"button"},on:{click:t.scanQR}},[t._v("Scan QR")]),a("div",{staticClass:"page",class:{active:!1!==t.scan},staticStyle:{"z-index":"9"}},[a("a",{staticClass:"close",on:{click:t.closeScan}},[a("i",{staticClass:"fal fa-times"})]),t.loadingMsg?a("div",[t._v(t._s(t.loadingMsg))]):t._e(),a("canvas",{attrs:{id:"scan_"+t._uid}})])])}),E=[],P=a("ecec"),j=a.n(P),B=document.createElement("video"),D={name:"ScanQr",props:{},data:function(){return{amount:"",destination:"",scan:!1,scanner:null,canvas:null,stream:null,continue:!0,loadingMsg:"Unable to access video stream (please make sure you have a webcam enabled)"}},methods:{closeScan:function(){B.srcObject&&B.srcObject.getTracks().forEach((function(t){t.stop()})),this.scan=!1,this.continue=!1},scanQR:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n,s,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:i=function(){if(n.loadingMsg="Loading video...",B.readyState===B.HAVE_ENOUGH_DATA){n.loadingMsg=null,a.height=B.videoHeight,a.width=B.videoWidth,n.canvas.drawImage(B,0,0,a.width,a.height);var t=n.canvas.getImageData(0,0,a.width,a.height),e=j()(t.data,t.width,t.height,{inversionAttempts:"dontInvert"});e&&(s(e.location.topLeftCorner,e.location.topRightCorner,"#0cd21a"),s(e.location.topRightCorner,e.location.bottomRightCorner,"#0cd21a"),s(e.location.bottomRightCorner,e.location.bottomLeftCorner,"#0cd21a"),s(e.location.bottomLeftCorner,e.location.topLeftCorner,"#0cd21a"),n.$emit("scanned",e.data),B.srcObject.getTracks().forEach((function(t){t.stop()})),n.continue=!1,setTimeout((function(){n.scan=!1}),1200))}!0===n.continue&&requestAnimationFrame(i)},s=function(t,e,a){n.canvas.beginPath(),n.canvas.moveTo(t.x,t.y),n.canvas.lineTo(e.x,e.y),n.canvas.lineWidth=4,n.canvas.strokeStyle=a,n.canvas.stroke()},t.scan=!0,t.continue=!0,a=document.getElementById("scan_"+t._uid),t.canvas=a.getContext("2d"),n=t,navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"}}).then((function(t){B.srcObject=t,B.setAttribute("playsinline",!0),B.play(),requestAnimationFrame(i)}));case 8:case"end":return e.stop()}}),e)})))()}}},I=D,F=Object(d["a"])(I,N,E,!1,null,null,null),L=F.exports,M=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"scan-nfc-code"},[a("button",{staticClass:"scan btn outline",attrs:{type:"button"},on:{click:t.scanNfc}},[t._v("Scan NFC")]),a("div",{staticClass:"page",class:{active:!1!==t.scannfc},staticStyle:{"z-index":"9"}},[a("a",{staticClass:"close",on:{click:t.closeScan}},[a("i",{staticClass:"fal fa-times"})]),"Scanning"===t.output?a("div",[t._v(t._s(t.output)+" "),a("i",{staticClass:"fas fa-spinner fa-spin"})]):a("div",[t._v(t._s(t.output))])])])},W=[],G={name:"ScanNfc",props:{},data:function(){return{output:"Checking for Web NFC Support",scannfc:!1,reader:null}},methods:{closeScan:function(){this.scannfc=!1,null!==this.reader&&this.reader.stop()},scanNfc:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.scannfc=!0,a=t,e.prev=2,a.reader=new NDEFReader,e.next=6,a.reader.scan();case 6:a.output="Scanning",a.reader.addEventListener("error",(function(t){a.output=t.message})),a.reader.onreading=function(t){var e,n=t.message,s=Object(b["a"])(n.records);try{for(s.s();!(e=s.n()).done;){var i=e.value;switch(i.recordType){case"text":var r=new TextDecoder(i.encoding),o=r.decode(i.data);a.$emit("scanned",o),a.closeScan();break;default:a.output="only text NDEF records are supported for scanning"}}}catch(c){s.e(c)}finally{s.f()}},e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](2),a.output=e.t0;case 14:case"end":return e.stop()}}),e,null,[[2,11]])})))()}}},H=G,U=Object(d["a"])(H,M,W,!1,null,null,null),V=U.exports,K={name:"Send",mixins:[x["a"]],components:{ScanQr:L,ScanNfc:V},props:{address:String,open:Boolean},data:function(){return{amount:"",destination:"",nfcsup:!1}},computed:{pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},privatekey:function(){return this.$store.state.app.privatekey}},watch:{open:function(t,e){!0===t&&!1===e&&(this.amount="",this.destination="")}},mounted:function(){"NDEFReader"in window&&(this.nfcsup=!0)},methods:{scanDone:function(t){this.amount="",this.destination="";var e=t.replace("nano:","").split("?");this.destination=e[0],e[1]&&e[1].split("&").forEach((function(t){var e=t.split("=");if("amount"==e[0]&&e[1]){var a=y["convert"](e[1],this.rawconv);this.checkamount(e[1])&&(this.amount=a)}}),this)},send:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n,s,i,r,o,c,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),t.amount.startsWith(".")&&(t.amount="0"+t.amount),a=y["convert"](t.amount,t.nanoconv),!t.checkamount(a)||!y["checkAddress"](t.destination)){e.next=29;break}return n=y["derivePublicKey"](t.privatekey),s=y["deriveAddress"](n,{useNanoPrefix:!0}),i={},i["action"]="account_info",i["representative"]="true",i["account"]=s,e.next=12,t.$store.dispatch("app/rpCall",i);case 12:return r=e.sent,o=new _.a(r.balance).minus(new _.a(a)).toFixed(),c=y["createBlock"](t.privatekey,{work:t.pow,previous:r.frontier,representative:r.representative,balance:o,link:t.destination}),console.log(c),l={},l["action"]="process",l["json_block"]="true",l["subtype"]="send",l["block"]=c.block,e.next=23,t.$store.dispatch("app/rpCall",l);case 23:t.$store.commit("app/pow",null),t.amount="",t.destination="",t.$emit("close","true"),e.next=30;break;case 29:y["checkAddress"](t.destination)||t.$notify({title:"Destination address is not valid",text:"Please use a valid address",type:"error"});case 30:case"end":return e.stop()}}),e)})))()},setmax:function(){this.amount=this.$store.state.app.balance}}},q=K,J=Object(d["a"])(q,$,O,!1,null,null,null),Q=J.exports,Y=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"receive inner"},[a("div",{directives:[{name:"show",rawName:"v-show",value:!1===t.showset,expression:"showset === false"}],staticClass:"block"},[a("div",{staticClass:"address"},[a("span",{domProps:{innerHTML:t._s(t.highlightAddress(t.address))}}),t._v(" "),a("a",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.address)}}},[a("i",{staticClass:"fad fa-clone"})]),t._v(" "),a("a",{staticClass:"value",on:{click:function(e){return t.link("address",t.address)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("qr-block",{attrs:{address:t.receive}}),!0===t.set?a("div",{staticClass:"receive-amount"},[t._v("Amount: "+t._s(t.amount))]):t._e(),!0===t.clipboard?a("a",{staticClass:"btn",on:{click:function(e){return e.preventDefault(),t.copyToClipboard(t.address)}}},[t._v("Copy Address")]):t._e(),a("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.setAmount()}}},[t._v("Set Amount")]),!0===t.set?a("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.clearReceive()}}},[t._v("Clear Amount")]):t._e()],1),a("div",{directives:[{name:"show",rawName:"v-show",value:!1!==t.showset,expression:"showset !== false"}],staticClass:"block",staticStyle:{padding:"0","margin-top":"-47px"}},[a("div",{staticClass:"amount"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.amount,expression:"amount"}],ref:"amount",attrs:{type:"text"},domProps:{value:t.amount},on:{keypress:function(e){return t.isNumber(e)},paste:function(e){return t.isNumber(e)},input:function(e){e.target.composing||(t.amount=e.target.value)}}})]),a("div",{staticClass:"keypad"},[a("div",{staticClass:"row"},[a("button",{on:{click:function(e){return t.addNumber("7")}}},[t._v("7")]),a("button",{on:{click:function(e){return t.addNumber("8")}}},[t._v("8")]),a("button",{on:{click:function(e){return t.addNumber("9")}}},[t._v("9")])]),a("div",{staticClass:"row"},[a("button",{on:{click:function(e){return t.addNumber("4")}}},[t._v("4")]),a("button",{on:{click:function(e){return t.addNumber("5")}}},[t._v("5")]),a("button",{on:{click:function(e){return t.addNumber("6")}}},[t._v("6")])]),a("div",{staticClass:"row"},[a("button",{on:{click:function(e){return t.addNumber("1")}}},[t._v("1")]),a("button",{on:{click:function(e){return t.addNumber("2")}}},[t._v("2")]),a("button",{on:{click:function(e){return t.addNumber("3")}}},[t._v("3")])]),a("div",{staticClass:"row"},[a("button",{on:{click:function(e){return t.backspace()}}},[a("i",{staticClass:"fal fa-backspace"})]),a("button",{on:{click:function(e){return t.addNumber("0")}}},[t._v("0")]),a("button",{on:{click:function(e){return t.addNumber(".")}}},[t._v(".")])])]),a("a",{staticClass:"btn",on:{click:function(e){return e.preventDefault(),t.setReceive()}}},[t._v("Receive")]),a("a",{staticClass:"btn outline",on:{click:function(e){return e.preventDefault(),t.cancel()}}},[t._v("Cancel")])])])},z=[],X=(a("fb6a"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"qrcode",attrs:{id:t._uid}})}),Z=[],tt=a("6ffa"),et=a.n(tt),at={name:"QrBlock",props:{address:String},data:function(){return{}},watch:{address:function(t){if(null!==t){var e=new et.a({width:512,height:512,data:t,image:"qr_logo.png",dotsOptions:{type:"rounded"},imageOptions:{hideBackgroundDots:!1},qrOptions:{}});document.getElementById(this._uid).innerHTML="",e.append(document.getElementById(this._uid))}}},methods:{}},nt=at,st=(a("ae55"),Object(d["a"])(nt,X,Z,!1,null,null,null)),it=st.exports,rt={name:"Receive",mixins:[x["a"]],components:{QrBlock:it},props:{address:String},data:function(){return{newrep:"",amount:"0",set:!1,showset:!1,receive:null,clipboard:!0,pendingpoll:null}},watch:{address:function(t){this.receive="nano:"+t,this.$store.dispatch("app/pending",this.address)},showset:function(t){!0===t&&this.$nextTick((function(){this.$refs.amount.focus()}))},receive:function(){if("POS"==this.$route.name&&"0"!==this.amount){var t,e,a,n,s=this;this.pendingpoll=setInterval(Object(g["a"])(regeneratorRuntime.mark((function i(){return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return"POS"==s.$route.name&&s.amount<="0"&&(s.amount="0",s.setReceive(),clearInterval(s.pendingpoll)),t=s.pending,i.next=4,s.$store.dispatch("app/pending",s.address);case 4:s.$nextTick((function(){if(e=s.pending,JSON.stringify(t)!==JSON.stringify(e)){a=Object.keys(t),n=Object.keys(e);var i,r=Object(b["a"])(n);try{for(r.s();!(i=r.n()).done;){var o=i.value;if(-1===a.indexOf(o)){var c=y["convert"](e[o].amount,s.rawconv);c>s.amount?s.amount="0":s.amount=new _.a(s.amount).minus(new _.a(c)).toFixed(),s.setReceive(),s.$notify({title:"Funds delivered: "+c,text:"Sent from "+s.abbreviateAddress(e[o].source,!1),type:"success"}),"0"!==s.amount&&clearInterval(s.pendingpoll)}}}catch(l){r.e(l)}finally{r.f()}}}));case 5:case"end":return i.stop()}}),i)}))),this.$store.state.app.settings.receiveinterval)}else clearInterval(this.pendingpoll)}},computed:{pending:function(){return this.$store.state.app.pending}},beforeDestroy:function(){clearInterval(this.pendingpoll)},methods:{isNumber:function(t){console.log(t);var e=t.which?t.which:t.keyCode;if(46==e){if(console.log(this.amount.indexOf(".")),-1===this.amount.indexOf("."))return!0;t.preventDefault()}else e>31&&(e<48||e>57)&&t.preventDefault();return"0"===t.key&&"0"===this.amount&&t.preventDefault(),"0"!==t.key&&"0"===this.amount&&(this.amount=t.key,t.preventDefault()),!0},setAmount:function(){this.showset=!0},addNumber:function(t){if("0"===this.amount&&"."!==t)return this.amount=t,void this.$refs.amount.focus();"."!==t||-1===this.amount.indexOf(".")?(this.amount=this.amount+t,this.$refs.amount.focus()):this.$refs.amount.focus()},backspace:function(){var t=this.amount.slice(0,-1);t.length<=0&&(t="0"),this.amount=t,this.$refs.amount.focus()},cancel:function(){this.amount="0",this.receive="nano:"+this.address,this.set=!1,this.showset=!1},setReceive:function(){if("0"===this.amount)return this.receive="nano:"+this.address,this.set=!1,this.showset=!1,!1;var t=y["convert"](this.amount,this.nanoconv);return!!this.checkamount(t)&&(this.receive="nano:"+this.address+"?amount="+t,this.set=!0,this.showset=!1,!0)},clearReceive:function(){this.receive="nano:"+this.address,this.set=!1,this.showset=!1,this.amount="0"}},mounted:function(){"POS"==this.$route.name&&(this.closebutton=!1,this.amount="0",this.clipboard=!1)}},ot=rt,ct=Object(d["a"])(ot,Y,z,!1,null,null,null),lt=ct.exports,ut=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"settings inner"},[a("div",{staticClass:"block"},[a("div",{staticClass:"details"},[a("label",{attrs:{for:"representative"}},[t._v("Current Representative")]),a("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.representative)}}},[a("i",{staticClass:"fad fa-clone"})]),a("div",{staticClass:"address",staticStyle:{"margin-bottom":"30px",background:"#00000014",padding:"4px 14px"},domProps:{innerHTML:t._s(t.highlightAddress(t.representative))}})]),t.change?a("div",{staticClass:"details"},[null!==t.error?a("div",{staticClass:"error"},[t._v(t._s(t.error))]):t._e(),a("label",{attrs:{for:"newrep"}},[t._v("Change Representative")]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.newrep,expression:"newrep"}],staticClass:"newrep",attrs:{type:"text",name:"newrep"},domProps:{value:t.newrep},on:{input:function(e){e.target.composing||(t.newrep=e.target.value)}}})]):t._e(),t.change?a("scan-qr",{on:{scanned:t.scanDone}}):t._e(),!1!==t.nfcsup?a("scan-nfc",{staticStyle:{"margin-bottom":"15px"},on:{scanned:t.scanDone}}):t._e(),a("div",{staticClass:"inline-buttons"},[t.change?t._e():a("button",{staticClass:"repchange btn",on:{click:function(e){t.change=!0}}},[t._v("Change Representative")]),t.change?a("button",{staticClass:"repchange btn",on:{click:t.changeRep}},[t._v("Confirm")]):t._e(),t.change?a("button",{staticClass:"repchange btn outline",on:{click:function(e){t.change=!1}}},[t._v("Cancel")]):t._e()])],1)])},dt=[],pt={name:"Settings",components:{ScanQr:L,ScanNfc:V},props:{representative:String,open:Boolean},mixins:[x["a"]],data:function(){return{newrep:"",change:!1,error:null,nfcsup:!1}},computed:{pow:function(){return this.$store.state.app.pow},privatekey:function(){return this.$store.state.app.privatekey}},watch:{open:function(t,e){!1===t&&!0===e&&(this.newrep="",this.change=!1,this.error=null)}},mounted:function(){"NDEFReader"in window&&(this.nfcsup=!0)},methods:{changeRep:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n,s,i,r,o,c,l,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(null===t.pow&&t.$notify({title:"PoW not complete",text:"Please wait for the status to be ready",type:"error"}),!y["checkAddress"](t.newrep)){e.next=25;break}return a=y["derivePublicKey"](t.privatekey),n=y["deriveAddress"](a,{useNanoPrefix:!0}),s={},s["action"]="account_info",s["representative"]="true",s["account"]=n,e.next=10,t.$store.dispatch("app/rpCall",s);case 10:return i=e.sent,r="change",o=i.frontier,c=i.balance,l=y["createBlock"](t.privatekey,{work:t.pow,previous:o,representative:t.newrep,balance:c,link:"0000000000000000000000000000000000000000000000000000000000000000"}),u={},u["action"]="process",u["json_block"]="true",u["subtype"]=r,u["block"]=l.block,e.next=22,t.$store.dispatch("app/rpCall",u);case 22:t.$emit("change",!0),e.next=26;break;case 25:t.error="Invalid Representative "+t.newrep;case 26:case"end":return e.stop()}}),e)})))()},scanDone:function(t){this.error=null;var e=t.replace("nanorep:","").split("?")[0];y["checkAddress"](e)?this.newrep=e:this.error="Invalid QR Data "+t}}},vt=pt,ft=Object(d["a"])(vt,ut,dt,!1,null,null,null),ht=ft.exports,mt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return null!==t.blockstate?a("simplebar",{attrs:{id:"breakdown"}},[a("header",{staticClass:"headingtitle"},[t._v("State Block "),a("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.hash)}}},[a("i",{staticClass:"fad fa-clone"})]),a("span",{staticClass:"value",on:{click:function(e){return t.link("block",t.hash)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("div",{staticClass:"stateblock block"},[t._v(t._s(t.hash))]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Block subtype "),a("span",{staticClass:"subtype value"},[t._v(t._s(t.blockstate.subtype))])]),a("div",{staticClass:"label"},[t._v("The type of transaction that created this state block")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Metadata "),a("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.metadatahex)}}},[a("i",{staticClass:"fad fa-clone"})]),a("span",{directives:[{name:"show",rawName:"v-show",value:!1!==t.addmeta,expression:"addmeta !== false"}],staticClass:"value",on:{click:function(e){return t.showmetaform()}}},[a("i",{staticClass:"fal fa-plus-circle"}),t._v(" Add Metadata")]),a("span",{directives:[{name:"show",rawName:"v-show",value:!0!==t.addmeta,expression:"addmeta !== true"}],staticClass:"value",on:{click:function(e){return t.metalink()}}},[a("i",{staticClass:"fad fa-external-link"})])]),!1!==t.metaform?a("div",{staticClass:"login"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.metadata,expression:"metadata"}],attrs:{type:"text",placeholder:"THIS IS PERMANENT",id:"metadata",maxlength:t.metaformmax,name:"metadata"},domProps:{value:t.metadata},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.setmeta()},input:function(e){e.target.composing||(t.metadata=e.target.value)}}}),a("span",{staticClass:"max metadata-save",domProps:{textContent:t._s(t.metaformmax-t.metadata.length+" | SAVE")},on:{click:function(e){return t.setmeta()}}})]):t._e(),!1!==t.showspinner?a("div",[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),a("div",{staticClass:"account",domProps:{textContent:t._s(t.metadatahex)}}),a("div",{staticClass:"account",domProps:{textContent:t._s(t.metadatautf8)}}),a("div",{staticClass:"label"},[t._v("Off chain metadata attached to this transaction")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Account "),a("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.account)}}},[a("i",{staticClass:"fad fa-clone"})]),a("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.account)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("div",{staticClass:"account"},[t._v(t._s(t.blockstate.contents.account))]),a("div",{staticClass:"label"},[t._v("The account represented by this state block")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Amount "),a("span",{staticClass:"amount value",domProps:{innerHTML:t._s(t.formattedValue(t.blockstate.amount))}})]),a("div",{staticClass:"raw"},[a("span",{staticClass:"amount_raw"},[t._v(t._s(t.blockstate.amount))]),t._v(" raw")]),a("div",{staticClass:"label"},[t._v("The amount of NANO that was sent in this transaction")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Balance "),a("span",{staticClass:"balance value",domProps:{innerHTML:t._s(t.formattedValue(t.blockstate.balance))}})]),a("div",{staticClass:"raw"},[a("span",{staticClass:"balance_raw"},[t._v(t._s(t.blockstate.balance))]),t._v(" raw")]),a("div",{staticClass:"label"},[t._v("The amount of NANO that was sent in this transaction")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Representative "),a("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.representative)}}},[a("i",{staticClass:"fad fa-clone"})]),a("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.representative)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("div",[a("span",{staticClass:"rep_raw"},[t._v(t._s(t.blockstate.contents.representative))])]),a("div",{staticClass:"label"},[t._v("The account's representative")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Recipient "),a("span",{staticClass:"value",on:{click:function(e){return t.copyToClipboard(t.blockstate.contents.representative)}}},[a("i",{staticClass:"fad fa-clone"})]),t._v(" "),a("span",{staticClass:"value",on:{click:function(e){return t.link("address",t.blockstate.contents.link_as_account)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("div",[a("span",{staticClass:"rec_raw"},[t._v(t._s(t.blockstate.contents.link_as_account))])]),a("div",{staticClass:"label"},[t._v("The account that is receiving the transaction")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Date "),a("span",{staticClass:"value"},[t._v(t._s(t.formattedDate))])]),a("div",{staticClass:"label"},[t._v("The date and time this block was discovered (converted to your local time)")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Previous Block "),a("span",{staticClass:"value",on:{click:function(e){return t.link("block",t.blockstate.contents.previous)}}},[a("i",{staticClass:"fad fa-external-link"})])]),a("div",[t._v(" "+t._s(t.blockstate.contents.previous)+" ")]),a("div",{staticClass:"label"},[t._v("The previous block in this account's chain")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Link")]),a("div",[t._v(t._s(t.blockstate.contents.link))]),a("div",{staticClass:"label"},[t._v("The destination address encoded in hex format or the block hash if open")])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Proof of Work")]),a("div",[t._v(t._s(t.blockstate.contents.work))])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("Signature")]),a("div",[t._v(t._s(t.blockstate.contents.signature))])]),a("div",{staticClass:"block"},[a("div",{staticClass:"title"},[t._v("JSON "),a("span",{staticClass:"value",on:{click:function(e){t.copyToClipboard(JSON.stringify(t.blockstate))}}},[a("i",{staticClass:"fad fa-clone"})])]),a("div",{staticClass:"json"},[a("pre",[t._v(t._s(JSON.stringify(t.blockstate,null,4)))])])])]):t._e()},bt=[],gt=a("dd1e"),kt=gt["a"],wt=(a("4e8e"),Object(d["a"])(kt,mt,bt,!1,null,"85d31be0",null)),yt=wt.exports;a("99af"),a("a630"),a("25f0"),a("3ca3"),a("cfc3"),a("5cc6"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7");function xt(t,e,a){for(var n="",s=a-1;s>-1;s--)n+=(t[s]>15?"":"0")+t[s].toString(16);return n}function Ct(t){for(var e="",a=t.length;a>0;a-=2)e+=t.slice(a-2,a);return e}function _t(t,e,a,n,s,i){var r=document.createElement("canvas");r.width=a,r.height=n;var o=r.getContext("webgl2");if(!o)throw new Error("webgl2_required");if(!/^[A-F-a-f0-9]{64}$/.test(t))throw new Error("invalid_hash");o.clearColor(0,0,0,1);var c=Ct(t),l="#version 300 es\n precision highp float;\n layout (location=0) in vec4 position;\n layout (location=1) in vec2 uv;\n\n out vec2 uv_pos;\n\n void main() {\n uv_pos = uv;\n gl_Position = position;\n }",u="#version 300 es\n precision highp float;\n precision highp int;\n\n in vec2 uv_pos;\n out vec4 fragColor;\n\n // Random work values\n // First 2 bytes will be overwritten by texture pixel position\n // Second 2 bytes will be modified if the canvas size is greater than 256x256\n uniform uvec4 u_work0;\n // Last 4 bytes remain as generated externally\n uniform uvec4 u_work1;\n\n // Defined separately from uint v[32] below as the original value is required\n // to calculate the second uint32 of the digest for threshold comparison\n #define BLAKE2B_IV32_1 0x6A09E667u\n\n // Both buffers represent 16 uint64s as 32 uint32s\n // because that's what GLSL offers, just like Javascript\n\n // Compression buffer, intialized to 2 instances of the initialization vector\n // The following values have been modified from the BLAKE2B_IV:\n // OUTLEN is constant 8 bytes\n // v[0] ^= 0x01010000u ^ uint(OUTLEN);\n // INLEN is constant 40 bytes: work value (8) + block hash (32)\n // v[24] ^= uint(INLEN);\n // It's always the \"last\" compression at this INLEN\n // v[28] = ~v[28];\n // v[29] = ~v[29];\n uint v[32] = uint[32](\n 0xF2BDC900u, 0x6A09E667u, 0x84CAA73Bu, 0xBB67AE85u,\n 0xFE94F82Bu, 0x3C6EF372u, 0x5F1D36F1u, 0xA54FF53Au,\n 0xADE682D1u, 0x510E527Fu, 0x2B3E6C1Fu, 0x9B05688Cu,\n 0xFB41BD6Bu, 0x1F83D9ABu, 0x137E2179u, 0x5BE0CD19u,\n 0xF3BCC908u, 0x6A09E667u, 0x84CAA73Bu, 0xBB67AE85u,\n 0xFE94F82Bu, 0x3C6EF372u, 0x5F1D36F1u, 0xA54FF53Au,\n 0xADE682F9u, 0x510E527Fu, 0x2B3E6C1Fu, 0x9B05688Cu,\n 0x04BE4294u, 0xE07C2654u, 0x137E2179u, 0x5BE0CD19u\n );\n // Input data buffer\n uint m[32];\n\n // These are offsets into the input data buffer for each mixing step.\n // They are multiplied by 2 from the original SIGMA values in\n // the C reference implementation, which refered to uint64s.\n const int SIGMA82[192] = int[192](\n 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,2,24,\n 0,4,22,14,10,6,22,16,24,0,10,4,30,26,20,28,6,12,14,2,18,8,14,18,6,2,26,\n 24,22,28,4,12,10,20,8,0,30,16,18,0,10,14,4,8,20,30,28,2,22,24,12,16,6,\n 26,4,24,12,20,0,22,16,6,8,26,14,10,30,28,2,18,24,10,2,30,28,26,8,20,0,\n 14,12,6,18,4,16,22,26,22,14,28,24,2,6,18,10,0,30,8,16,12,4,20,12,30,28,\n 18,22,6,0,16,24,4,26,14,2,8,20,10,20,4,16,8,14,12,2,10,30,22,18,28,6,24,\n 26,0,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,28,20,8,16,18,30,26,12,\n 2,24,0,4,22,14,10,6\n );\n\n // 64-bit unsigned addition within the compression buffer\n // Sets v[a,a+1] += b\n // b0 is the low 32 bits of b, b1 represents the high 32 bits\n void add_uint64 (int a, uint b0, uint b1) {\n uint o0 = v[a] + b0;\n uint o1 = v[a + 1] + b1;\n if (v[a] > 0xFFFFFFFFu - b0) { // did low 32 bits overflow?\n o1++;\n }\n v[a] = o0;\n v[a + 1] = o1;\n }\n // Sets v[a,a+1] += v[b,b+1]\n void add_uint64 (int a, int b) {\n add_uint64(a, v[b], v[b+1]);\n }\n\n // G Mixing function\n void B2B_G (int a, int b, int c, int d, int ix, int iy) {\n add_uint64(a, b);\n add_uint64(a, m[ix], m[ix + 1]);\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n uint xor0 = v[d] ^ v[a];\n uint xor1 = v[d + 1] ^ v[a + 1];\n v[d] = xor1;\n v[d + 1] = xor0;\n\n add_uint64(c, d);\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c];\n xor1 = v[b + 1] ^ v[c + 1];\n v[b] = (xor0 >> 24) ^ (xor1 << 8);\n v[b + 1] = (xor1 >> 24) ^ (xor0 << 8);\n\n add_uint64(a, b);\n add_uint64(a, m[iy], m[iy + 1]);\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a];\n xor1 = v[d + 1] ^ v[a + 1];\n v[d] = (xor0 >> 16) ^ (xor1 << 16);\n v[d + 1] = (xor1 >> 16) ^ (xor0 << 16);\n\n add_uint64(c, d);\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c];\n xor1 = v[b + 1] ^ v[c + 1];\n v[b] = (xor1 >> 31) ^ (xor0 << 1);\n v[b + 1] = (xor0 >> 31) ^ (xor1 << 1);\n }\n\n void main() {\n int i;\n uint uv_x = uint(uv_pos.x * ".concat(r.width-1,".);\n uint uv_y = uint(uv_pos.y * ").concat(r.height-1,".);\n uint x_pos = uv_x % 256u;\n uint y_pos = uv_y % 256u;\n uint x_index = (uv_x - x_pos) / 256u;\n uint y_index = (uv_y - y_pos) / 256u;\n\n // First 2 work bytes are the x,y pos within the 256x256 area, the next\n // two bytes are modified from the random generated value, XOR'd with\n // the x,y area index of where this pixel is located\n m[0] = (x_pos ^ (y_pos << 8) ^ ((u_work0.b ^ x_index) << 16) ^ ((u_work0.a ^ y_index) << 24));\n // Remaining bytes are un-modified from the random generated value\n m[1] = (u_work1.r ^ (u_work1.g << 8) ^ (u_work1.b << 16) ^ (u_work1.a << 24));\n\n // Block hash\n m[2] = 0x").concat(c.slice(56,64),"u;\n m[3] = 0x").concat(c.slice(48,56),"u;\n m[4] = 0x").concat(c.slice(40,48),"u;\n m[5] = 0x").concat(c.slice(32,40),"u;\n m[6] = 0x").concat(c.slice(24,32),"u;\n m[7] = 0x").concat(c.slice(16,24),"u;\n m[8] = 0x").concat(c.slice(8,16),"u;\n m[9] = 0x").concat(c.slice(0,8),"u;\n\n // twelve rounds of mixing\n for(i=0;i<12;i++) {\n B2B_G(0, 8, 16, 24, SIGMA82[i * 16 + 0], SIGMA82[i * 16 + 1]);\n B2B_G(2, 10, 18, 26, SIGMA82[i * 16 + 2], SIGMA82[i * 16 + 3]);\n B2B_G(4, 12, 20, 28, SIGMA82[i * 16 + 4], SIGMA82[i * 16 + 5]);\n B2B_G(6, 14, 22, 30, SIGMA82[i * 16 + 6], SIGMA82[i * 16 + 7]);\n B2B_G(0, 10, 20, 30, SIGMA82[i * 16 + 8], SIGMA82[i * 16 + 9]);\n B2B_G(2, 12, 22, 24, SIGMA82[i * 16 + 10], SIGMA82[i * 16 + 11]);\n B2B_G(4, 14, 16, 26, SIGMA82[i * 16 + 12], SIGMA82[i * 16 + 13]);\n B2B_G(6, 8, 18, 28, SIGMA82[i * 16 + 14], SIGMA82[i * 16 + 15]);\n }\n\n // Threshold test, first 4 bytes not significant,\n // only calculate digest of the second 4 bytes\n if((BLAKE2B_IV32_1 ^ v[1] ^ v[17]) > ")+e+"u) {\n // Success found, return pixel data so work value can be constructed\n fragColor = vec4(\n float(x_index + 1u)/255., // +1 to distinguish from 0 (unsuccessful) pixels\n float(y_index + 1u)/255., // Same as previous\n float(x_pos)/255., // Return the 2 custom bytes used in work value\n float(y_pos)/255. // Second custom byte\n );\n }\n }",d=o.createShader(o.VERTEX_SHADER);if(o.shaderSource(d,l),o.compileShader(d),!o.getShaderParameter(d,o.COMPILE_STATUS))throw o.getShaderInfoLog(d);var p=o.createShader(o.FRAGMENT_SHADER);if(o.shaderSource(p,u),o.compileShader(p),!o.getShaderParameter(p,o.COMPILE_STATUS))throw o.getShaderInfoLog(p);var v=o.createProgram();if(o.attachShader(v,d),o.attachShader(v,p),o.linkProgram(v),!o.getProgramParameter(v,o.LINK_STATUS))throw o.getProgramInfoLog(v);o.useProgram(v);var f=o.createVertexArray();o.bindVertexArray(f);var h=new Float32Array([-1,-1,0,-1,1,0,1,1,0,1,-1,0,1,1,0,-1,-1,0]),m=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,h,o.STATIC_DRAW),o.vertexAttribPointer(0,3,o.FLOAT,!1,0,0),o.enableVertexAttribArray(0);var b=new Float32Array([1,1,1,0,0,0,0,1,0,0,1,1]),g=o.createBuffer();o.bindBuffer(o.ARRAY_BUFFER,g),o.bufferData(o.ARRAY_BUFFER,b,o.STATIC_DRAW),o.vertexAttribPointer(1,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(1);var k=o.getUniformLocation(v,"u_work0"),w=o.getUniformLocation(v,"u_work1"),y=new Uint8Array(4),x=new Uint8Array(4),C=0;function _(){if(C++,window.crypto.getRandomValues(y),window.crypto.getRandomValues(x),o.uniform4uiv(k,Array.from(y)),o.uniform4uiv(w,Array.from(x)),C%100!==0||"function"!==typeof i||!i(C)){o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLES,0,6);var t=new Uint8Array(o.drawingBufferWidth*o.drawingBufferHeight*4);o.readPixels(0,0,o.drawingBufferWidth,o.drawingBufferHeight,o.RGBA,o.UNSIGNED_BYTE,t);for(var e=0;e<t.length;e+=4)if(0!==t[e])return void("function"===typeof s&&s(xt(x,0,4)+xt([t[e+2],t[e+3],y[2]^t[e]-1,y[3]^t[e+1]-1],0,4),C));window.requestAnimationFrame(_)}}window.requestAnimationFrame(_)}var St=a("5ba3"),Tt=a.n(St),At=a("8d3b"),Rt=(a("f138"),window.navigator.hardwareConcurrency||2),$t=Math.max(Rt-1,1),Ot=[];function Nt(){return{seed:null,seedindex:null,key:null,open:!1,details:{},error:null,balance:0,receive:!1,genwallet:!1,send:!1,settings:!1,representative:"",blockdetails:null,address:null,logintype:"password",walletdata:null,isActive:!1,balanceextra:!1,terminate:!1,showadvanced:!1,seedtab:!0,pendingpoll:null,lastrefresh:new Date,closebutton:!0,nfcsup:!1}}var Et={name:"Home",components:{Transaction:R,Send:Q,Receive:lt,Settings:ht,BlockState:yt,simplebar:At["a"],ScanQr:L,ScanNfc:V},mixins:[x["a"]],data:function(){return Nt()},watch:{open:function(t){(!0===t&&null!==this.key||null!==this.seed)&&(console.log("open"),this.refreshDetails(!0))},pow:function(){var t=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:!0===this.open&&e!==a&&null===e&&(console.log("pow change"),this.refreshDetails());case 1:case"end":return t.stop()}}),t,this)})));function e(e,a){return t.apply(this,arguments)}return e}(),receive:function(t){if(!0===t&&"POS"!==this.$route.name){var e,a,n,s,i=this;this.pendingpoll=setInterval(Object(g["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=i.pending,t.next=3,i.$store.dispatch("app/pending",i.address);case 3:i.lastrefresh=new Date,i.$nextTick((function(){if(a=i.pending,JSON.stringify(e)!==JSON.stringify(a)){n=Object.keys(e),s=Object.keys(a);var t,r=Object(b["a"])(s);try{for(r.s();!(t=r.n()).done;){var o=t.value;-1===n.indexOf(o)&&i.$notify({title:"Funds delivered: "+y["convert"](a[o].amount,this.rawconv),text:"Sent from "+i.abbreviateAddress(a[o].source,!1),type:"success"})}}catch(c){r.e(c)}finally{r.f()}}}));case 5:case"end":return t.stop()}}),t)}))),1e4)}else clearInterval(this.pendingpoll)}},mounted:function(){"POS"==this.$route.name&&(this.address=this.$route.params.address,this.receive=!0,this.closebutton=!1),"NDEFReader"in window&&(this.nfcsup=!0),void 0===this.$store.state.app.node.address&&this.$router.push("node")},computed:{genWalletLink:function(){return"node"in this.$route.params?this.$route.params.node:""},loginicon:function(){return"password"===this.logintype?"fa-eye":"fa-eye-slash"},pow:function(){return this.$store.state.app.pow},ready:function(){return this.$store.state.app.ready},history:function(){return this.$store.state.app.history},pending:function(){return this.$store.state.app.pending},privatekey:function(){return this.$store.state.app.privatekey}},methods:{setSeed:function(){this.seedtab=!0},setPrivate:function(){this.seedtab=!1,this.showadvanced=!1},repChange:function(){this.refreshDetails(),this.settings=!1},scanDone:function(t){if(t.startsWith("nanokey:"))this.seedtab=!1,this.showadvanced=!1,this.key=t.replace("nanokey:","").substr(0,64),this.error=null;else if(t.startsWith("nanoseed:")){var e=t.replace("nanoseed:","").substr(0,64);this.seed=e,this.error=null}else this.error="QR code data does not conform to specification",this.seed=t},logout:function(){for(var t in Object.assign(this.$data,Nt()),this.$store.dispatch("app/resetState"),Ot)console.log("Terminate: "+t),Ot[t].terminate()},refresh:function(){this.isActive=!this.isActive,this.refreshDetails()},refreshDetails:function(){var t=arguments,e=this;return Object(g["a"])(regeneratorRuntime.mark((function a(){var n,s;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return n=t.length>0&&void 0!==t[0]&&t[0],s=null,"frontier"in e.details&&(s=e.details.frontier),a.prev=3,a.next=6,e.getDetails(e.privatekey);case 6:e.lastrefresh=new Date,s===e.details.frontier&&!0!==n||e.genWork(e.privatekey,e.details),e.$store.dispatch("app/history",e.address),e.$store.dispatch("app/pending",e.address),e.details.balance?(e.balance=y["convert"](e.details.balance,e.rawconv),e.$store.commit("app/balance",e.balance)):e.balance=0,e.representative=e.details.representative,a.next=18;break;case 14:a.prev=14,a.t0=a["catch"](3),e.error="Could not connect to RPC",e.open=!1;case 18:case"end":return a.stop()}}),a,null,[[3,14]])})))()},genWork:function(t,e){var a=this;return Object(g["a"])(regeneratorRuntime.mark((function n(){var s,i,r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(a.$store.commit("app/pow",null),a.$store.commit("app/ready",!1),"frontier"in e?(console.log("Frontier in details"),s=e.frontier):(console.log("Frontier NOT in details"),s=y["derivePublicKey"](t)),i=document.createElement("canvas").getContext("webgl2"),!i){n.next=9;break}console.log("Calculating pow for "+s+" using WebGL this may take some time"),_t(s,"0xFFFFFFC0",2048,256,(function(t){a.$store.commit("app/pow",t),a.$store.commit("app/ready",!0)})),n.next=22;break;case 9:if(!window.Worker){n.next=16;break}return console.log("Calculating pow for "+s+" this may take some time"),r=function(){return new Promise((function(t){Ot=[];for(var e=0;e<$t;e++){var n=new Tt.a;n.postMessage({blockHash:s,workerIndex:e,workerCount:$t}),n.onmessage=function(e){for(var n in console.log("Work: "+e.data),a.$store.commit("app/pow",e.data),a.$store.commit("app/ready",!0),Ot)console.log("Terminate: "+n),Ot[n].terminate();t()},Ot.push(n)}}))},n.next=14,r();case 14:n.next=22;break;case 16:return console.log("Calculating pow for "+s+" (no worker) this may take some time"),n.next=19,y["computeWork"](s);case 19:o=n.sent,a.$store.commit("app/pow",o),a.$store.commit("app/ready",!0);case 22:case"end":return n.stop()}}),n)})))()},togglevisibility:function(){console.log(this.logintype),this.logintype="password"===this.logintype?"text":"password"},getAddress:function(t){var e=y["derivePublicKey"](t);return y["deriveAddress"](e,{useNanoPrefix:!0})},getDetails:function(t){var e=this;return Object(g["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.address=e.getAddress(t),a.next=3,e.$store.dispatch("app/getDetails",e.address);case 3:e.details=a.sent;case 4:case"end":return a.stop()}}),a)})))()},openWallet:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t.error=null,t.key)try{a=y["checkKey"](t.key),!1===a?t.error="Invalid key":(t.$store.commit("app/privatekey",t.key),t.open=!0)}catch(s){t.error=s}else if(t.seed)try{n=y["checkSeed"](t.seed),!1===n?t.error="Invalid Seed":(null==t.seedindex?t.seedindex=0:t.seedindex=parseInt(t.seedindex),t.key=y["deriveSecretKey"](t.seed,t.seedindex),t.$store.commit("app/privatekey",t.key),t.open=!0)}catch(s){t.error=s}case 2:case"end":return e.stop()}}),e)})))()}}},Pt=Et,jt=Object(d["a"])(Pt,h,m,!1,null,null,null),Bt=jt.exports,Dt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[a("block-state",{attrs:{static:!0}})],1)},It=[],Ft={name:"Block",components:{BlockState:yt},data:function(){return{blockdetails:null}},watch:{},mounted:function(){this.blockdetails=this.$route.params.hash}},Lt=Ft,Mt=Object(d["a"])(Lt,Dt,It,!1,null,null,null),Wt=Mt.exports,Gt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[a("div",{attrs:{id:"inputs"}},[a("div",{staticClass:"labeltabs"},[a("label",{staticClass:"df",class:{active:!0!==t.showadvanced},on:{click:t.setNormal}},[t._v(" Enter Node Address ")]),a("label",{staticClass:"df",class:{active:!0===t.showadvanced},on:{click:t.setAdvanced}},[t._v(" Advanced ")])]),a("input",{directives:[{name:"show",rawName:"v-show",value:!1===t.showadvanced,expression:"showadvanced === false"},{name:"model",rawName:"v-model",value:t.node,expression:"node"}],attrs:{type:"text",id:"node",name:"node"},domProps:{value:t.node},on:{input:function(e){e.target.composing||(t.node=e.target.value)}}}),a("input",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"},{name:"model",rawName:"v-model",value:t.address,expression:"address"}],attrs:{placeholder:"endpoint IE yourdomain.com",type:"text",id:"address",name:"address"},domProps:{value:t.address},on:{input:function(e){e.target.composing||(t.address=e.target.value)}}}),a("input",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"},{name:"model",rawName:"v-model",value:t.protocol,expression:"protocol"}],attrs:{placeholder:"http or https",type:"text",id:"protocol",name:"protocol"},domProps:{value:t.protocol},on:{input:function(e){e.target.composing||(t.protocol=e.target.value)}}}),a("input",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"},{name:"model",rawName:"v-model",value:t.port,expression:"port"}],attrs:{placeholder:"port to connect to IE 443",type:"text",id:"port",name:"port"},domProps:{value:t.port},on:{input:function(e){e.target.composing||(t.port=e.target.value)}}}),a("input",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"},{name:"model",rawName:"v-model",value:t.path,expression:"path"}],attrs:{placeholder:"Path IE /proxy *optional",type:"text",id:"path",name:"path"},domProps:{value:t.path},on:{input:function(e){e.target.composing||(t.path=e.target.value)}}}),a("input",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"},{name:"model",rawName:"v-model",value:t.auth,expression:"auth"}],attrs:{placeholder:"Auth Header IE Basic TOKENHERE *optional",type:"text",id:"auth",name:"auth"},domProps:{value:t.auth},on:{input:function(e){e.target.composing||(t.auth=e.target.value)}}}),a("button",{directives:[{name:"show",rawName:"v-show",value:!1===t.showadvanced,expression:"showadvanced === false"}],staticClass:"openwallet btn",attrs:{type:"button"},on:{click:t.openNode}},[t._v("Go To Node")]),a("button",{directives:[{name:"show",rawName:"v-show",value:!0===t.showadvanced,expression:"showadvanced === true"}],staticClass:"openwallet btn",attrs:{type:"button"},on:{click:t.openAdvanced}},[t._v("Go To Node")])]),t._m(0),t._m(1),t._m(2)])},Ht=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",{staticStyle:{"margin-top":"40px"}},[t._v("This wallet is designed to use any Nano Node RPC server as a backend, using nano.linuxserver.io will plug you into our own public network. More information including how to get funds from a faucet is available on "),a("a",{staticClass:"highlight",attrs:{target:"_blank",href:"https://github.com/linuxserver/nano-wallet/"}},[t._v("GitHub")]),t._v(".")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[t._v("If you are looking for the live Nano network please use "),a("a",{staticClass:"highlight",attrs:{href:"https://tixwallet.cc/",target:"_blank"}},[t._v("tixwallet.cc")]),t._v(".")])},function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[a("a",{staticClass:"highlight",attrs:{target:"_blank",href:"https://github.com/linuxserver/nano-wallet/"}},[a("i",{staticClass:"fab fa-2x fa-github"})])])}],Ut={name:"Node",components:{},data:function(){return{node:"nano.linuxserver.io",address:"",protocol:"",port:"",path:"",auth:"",showadvanced:!1}},mixins:[x["a"]],methods:{openNode:function(){this.$router.push("/"+this.node)},openAdvanced:function(){if(this.address&&("http"==this.protocol||"https"==this.protocol)&&this.port){this.$store.state.app.settings.changeaddress=!1,this.$store.state.app.settings.checkbackends=!1,this.$store.state.app.settings.followlinks=!1;var t={headers:{"Content-Type":"application/json"}};t["address"]=this.address,t["protocol"]=this.protocol,t["port"]=this.port,this.path&&(t["path"]=this.path),this.auth&&(t["auth"]=this.auth),this.$store.state.app.settings.node=[t],this.$router.push({name:"Home"})}else this.$notify({title:"Error",text:"Please fill out all required values",type:"error"})},setAdvanced:function(){this.showadvanced=!0},setNormal:function(){this.showadvanced=!1}}},Vt=Ut,Kt=Object(d["a"])(Vt,Gt,Ht,!1,null,null,null),qt=Kt.exports,Jt=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page active",attrs:{id:"genwallet"}},[a("router-link",{staticClass:"close",attrs:{to:t.$store.getters["app/nodeLink"]}},[a("i",{staticClass:"fal fa-times"})]),a("div",{staticClass:"block"},[a("div",{staticClass:"details smaller"},[a("label",{attrs:{for:"seed"}},[t._v("Seed "),a("a",{staticClass:"refreshwallet",attrs:{href:""},on:{click:function(e){return e.preventDefault(),t.refreshWallet(e)}}},[a("i",{staticClass:"fal fa-sync"})])]),a("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.seed)}}},[a("i",{staticClass:"fad fa-clone"})]),a("div",{staticClass:"login"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.seed,expression:"seed"}],staticClass:"copytext",attrs:{type:"text",name:"seed"},domProps:{value:t.seed},on:{input:function(e){e.target.composing||(t.seed=e.target.value)}}}),a("span",{staticClass:"max",on:{click:t.clearWallet}},[t._v("CLEAR")])])]),a("div",{staticClass:"details smaller"},[a("label",{attrs:{for:"address"}},[t._v("Address")]),a("a",{staticClass:"copy",attrs:{href:"#"},on:{click:function(e){return t.copyToClipboard(t.address)}}},[a("i",{staticClass:"fad fa-clone"})]),a("input",{directives:[{name:"model",rawName:"v-model",value:t.address,expression:"address"}],staticClass:"copytext",attrs:{type:"text",name:"address"},domProps:{value:t.address},on:{input:function(e){e.target.composing||(t.address=e.target.value)}}})]),a("button",{staticClass:"btn",staticStyle:{"margin-top":"30px"},on:{click:function(e){return t.copyToClipboard("Seed: "+t.seed+"\nPrivate Key: "+t.privatekey+"\nPublic Key: "+t.publickey+"\nAddress: "+t.address)}}},[t._v("Copy To Clipboard")]),a("button",{staticClass:"btn outline",on:{click:function(e){return t.save("Seed: "+t.seed+"\nPrivate Key: "+t.privatekey+"\nPublic Key: "+t.publickey+"\nAddress: "+t.address)}}},[t._v("Download")]),a("wallet",{attrs:{private:t.seed,public:t.address}})],1)],1)},Qt=[],Yt=(a("ddb0"),a("2b3d"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"wallet"},[a("button",{staticClass:"btn outline",staticStyle:{width:"100%"},attrs:{type:"button"},on:{click:t.createWallet}},[t._v("Create Paper Wallet")]),a("div",{staticClass:"page",class:{active:!1!==t.wallet},staticStyle:{"z-index":"9",top:"0",bottom:"0","justtify-content":"flex-start"}},[a("div",{staticClass:"fdcol"},[a("a",{staticClass:"close",on:{click:t.closeWallet}},[a("i",{staticClass:"fal fa-times"})]),a("div",{staticClass:"printpos"},[a("canvas",{attrs:{width:"2480",height:"3508",id:"wallet_"+t._uid}}),a("div",{staticClass:"posbuttons"},[a("div",{staticClass:"print-position"},[t._v("Paper print position")]),a("button",{staticClass:"btn",class:{outline:1!==t.position},on:{click:function(e){t.position=1}}},[a("img",{attrs:{src:"wallet_preview.png"}})]),a("button",{staticClass:"btn",class:{outline:2!==t.position},on:{click:function(e){t.position=2}}},[a("img",{attrs:{src:"wallet_preview.png"}})]),a("button",{staticClass:"btn",class:{outline:3!==t.position},on:{click:function(e){t.position=3}}},[a("img",{attrs:{src:"wallet_preview.png"}})])])]),a("button",{staticClass:"btn",staticStyle:{width:"100%","margin-top":"20px"},on:{click:t.printWallet}},[t._v("Print")])])]),a("img",{attrs:{src:t.src,id:"printimage"}})])}),zt=[],Xt=(a("a15b"),a("d055")),Zt=a.n(Xt),te={name:"Wallet",props:{private:String,public:String},data:function(){return{wallet:!1,position:1,src:null,loaded:0,canvas:null}},watch:{position:function(t,e){t!==e&&(this.loaded=0,this.createWallet())},loaded:function(t){4===t&&(this.src=this.canvas.toDataURL("image/png"))}},computed:{startTop:function(){return 1===this.position?parseInt(0):parseInt(1100*(this.position-1))}},methods:{closeWallet:function(){this.wallet=!1},createWallet:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){var a,n,s,i,r,o,c,l,u,d,p,v,f,h,m,b,g,k,w,y;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r=function(t,e,n,s){a.beginPath(),a.setLineDash([10,10]),a.moveTo(t,e),a.lineTo(n,s),a.stroke()},t.wallet=!0,t.canvas=document.getElementById("wallet_"+t._uid),a=t.canvas.getContext("2d"),a.clearRect(0,0,t.canvas.width,t.canvas.height),a.width=2480,a.height=3300,n=827,s=550,i=t,r(0,t.startTop+0,a.width,t.startTop+0),r(0,t.startTop+550,a.width,t.startTop+550),r(0,t.startTop+1100,a.width,t.startTop+1100),r(0,t.startTop+0,0,t.startTop+1100),r(820,t.startTop+0,820,t.startTop+1100),r(1661,t.startTop+0,1661,t.startTop+1100),a.font="24px Nunito",a.fillStyle="#000000",a.fillText("To deposit funds to this paper,",n+40,t.startTop+s+100),a.fillText("wallet, send nano to the public",n+40,t.startTop+s+130),a.fillText("address on the right",n+40,t.startTop+s+160),a.fillText("DO NOT REVEAL THE SEED",n+40,t.startTop+s+220),a.fillText("until you are ready to import",n+40,t.startTop+s+250),a.fillText("the balance to a nano wallet,",n+40,t.startTop+s+280),a.fillText("exchange or online wallet.",n+40,t.startTop+s+310),a.fillText("Amount: ",n+40,t.startTop+s+390),a.fillText("Date:",n+40,t.startTop+s+470),o=new Image,o.src="/wallet.png",o.onload=function(){i.loaded+=1,a.drawImage(o,0,parseInt(i.startTop)-22)},a.fillStyle="#000000",a.save(),a.translate(1240,292),a.rotate(Math.PI),a.translate(-1240,-292),e.next=37,Zt.a.toDataURL("nanoseed:"+t.private);case 37:return c=e.sent,a.font="50px Nunito",a.fillText("S E E D",n+40,130-t.startTop),console.log(t.private),l=t.private.substring(0,8),u=t.private.substring(8,16),d=t.private.substring(16,24),p=t.private.substring(24,32),v=t.private.substring(32,40),f=t.private.substring(40,48),h=t.private.substring(48,56),m=t.private.substring(56,64),a.font="38px Monospace",a.fillText(l.split("").join(String.fromCharCode(8202)),n+40,190-t.startTop),a.fillText(u.split("").join(String.fromCharCode(8202)),n+40,230-t.startTop),a.fillText(d.split("").join(String.fromCharCode(8202)),n+40,270-t.startTop),a.fillText(p.split("").join(String.fromCharCode(8202)),n+40,310-t.startTop),a.fillText(v.split("").join(String.fromCharCode(8202)),n+40,350-t.startTop),a.fillText(f.split("").join(String.fromCharCode(8202)),n+40,390-t.startTop),a.fillText(h.split("").join(String.fromCharCode(8202)),n+40,430-t.startTop),a.fillText(m.split("").join(String.fromCharCode(8202)),n+40,470-t.startTop),a.restore(),b=new Image,b.onload=function(){i.loaded+=1;var t=(s-400)/2;a.save(),a.translate(1240,292),a.rotate(Math.PI),a.translate(-1240,-292),a.drawImage(b,n+400,-i.startTop+t,400,400),a.restore()},b.src=c,e.next=64,Zt.a.toDataURL("nano:"+t.public);case 64:g=e.sent,a.font="50px Nunito",a.fillText("A D D R E S S",40,t.startTop+s+100),console.log(t.public),l=t.public.substring(0,8),u=t.public.substring(8,16),d=t.public.substring(16,24),p=t.public.substring(24,32),v=t.public.substring(32,40),f=t.public.substring(40,48),h=t.public.substring(48,56),m=t.public.substring(56,64),k=t.public.substring(64,72),a.font="38px Monospace",a.fillStyle="#d43789",a.fillText(l.split("").join(String.fromCharCode(8202)),40,t.startTop+s+160),a.fillStyle="#000000",a.fillText(u.split("").join(String.fromCharCode(8202)),40,t.startTop+s+200),a.fillText(d.split("").join(String.fromCharCode(8202)),40,t.startTop+s+240),a.fillText(p.split("").join(String.fromCharCode(8202)),40,t.startTop+s+280),a.fillText(v.split("").join(String.fromCharCode(8202)),40,t.startTop+s+320),a.fillText(f.split("").join(String.fromCharCode(8202)),40,t.startTop+s+360),a.fillText(h.split("").join(String.fromCharCode(8202)),40,t.startTop+s+400),a.fillStyle="#d43789",a.fillText(m.split("").join(String.fromCharCode(8202)),40,t.startTop+s+440),a.fillText(k.split("").join(String.fromCharCode(8202)),40,t.startTop+s+480),w=new Image,w.onload=function(){i.loaded+=1;var t=(s-400)/2+s;a.drawImage(w,400,i.startTop+t,400,400),a.drawImage(w,n+400,i.startTop+t,400,400)},w.src=g,console.log(c),y=new Image,y.onload=function(){i.loaded+=1;var t=2*n+(n-y.width)/2,e=i.startTop+(s-y.height)/2;a.drawImage(y,t,s+e)},y.src="/wallet_logo.png";case 97:case"end":return e.stop()}}),e)})))()},printWallet:function(){return Object(g["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:window.print();case 1:case"end":return t.stop()}}),t)})))()}}},ee=te,ae=(a("0bee"),Object(d["a"])(ee,Yt,zt,!1,null,null,null)),ne=ae.exports,se={name:"Generate",mixins:[x["a"]],components:{Wallet:ne},data:function(){return{newrep:"",seed:"",privatekey:"",publickey:"",address:"",walletdata:{}}},watch:{seed:function(t,e){var a=this;t!==e&&64===t.length&&this.$store.dispatch("app/seedData",t).then((function(t){a.seed=t.seed,a.privatekey=t.privatekey,a.publickey=t.publickey,a.address=t.address}))}},methods:{save:function(t){var e=this.abbreviateAddress(this.address,!1)+".txt",a=new Blob([t],{type:"text/csv"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(a,e);else{var n=window.document.createElement("a");n.href=window.URL.createObjectURL(a),n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}},clearWallet:function(){this.seed="",this.address=""},refreshWallet:function(){var t=this;this.$store.dispatch("app/getSeed").then((function(e){t.seed=e.seed,t.privatekey=e.privatekey,t.publickey=e.publickey,t.address=e.address}))}},computed:{genWalletLink:function(){return"node"in this.$route.params?this.$route.params.node:""}},mounted:function(){var t=this;this.$store.dispatch("app/getSeed").then((function(e){t.seed=e.seed,t.privatekey=e.privatekey,t.publickey=e.publickey,t.address=e.address}))}},ie=se,re=(a("d418"),Object(d["a"])(ie,Jt,Qt,!1,null,"b3c21964",null)),oe=re.exports,ce=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"page active",staticStyle:{top:"0"},attrs:{id:"wallet"}},[a("div",{staticClass:"inner"},[a("div",{staticClass:"block"},[t._m(0),a("div",{attrs:{id:"output"}},[a("div",{staticClass:"balance"},[a("div",{staticClass:"raw",class:{active:t.balanceextra},on:{click:function(e){return t.copyToClipboard(t.$route.params.address)}}},[t._v(t._s(t.$route.params.address))]),a("div",{staticClass:"value",domProps:{innerHTML:t._s(t.abbreviateNumber(t.balance))}}),a("div",{staticClass:"raw",class:{active:t.balanceextra}},[t._v(t._s(t.balance))]),a("a",{staticClass:"balanceextra",attrs:{href:""},on:{click:function(e){e.preventDefault(),t.balanceextra=!t.balanceextra}}},[a("i",{staticClass:"fal fa-ellipsis-h",attrs:{"data-fa-transform":"grow-20"}})])])]),a("simplebar",{staticClass:"block history"},[a("div",{staticClass:"headingtitle showmobile"},[t._v("History")]),a("div",{attrs:{id:"pendingblocks"}}),t._l(t.pending,(function(e,n){return a("transaction",{key:n,attrs:{index:n,transaction:e,type:"pending"},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),a("simplebar",{staticClass:"block history"},[a("div",{staticClass:"headingtitle hidemobile"},[t._v("History")]),t._l(t.history,(function(e,n){return a("transaction",{key:n,attrs:{index:n,transaction:e,type:e.type},on:{blockdetails:function(e){t.blockdetails=e}}})}))],2)],1),a("div",{staticClass:"page",class:{active:null!==t.blockdetails},staticStyle:{top:"0"},attrs:{id:"blockdetails"}},[a("a",{staticClass:"close",on:{click:function(e){t.blockdetails=null}}},[a("i",{staticClass:"fal fa-times"})]),a("block-state",{attrs:{details:t.blockdetails}})],1)])},le=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"headingtitle top"},[a("span",[t._v("Wallet")])])}],ue={name:"Address",components:{Transaction:R,BlockState:yt,simplebar:At["a"]},mixins:[x["a"]],data:function(){return{details:null,balance:0,blockdetails:null,balanceextra:!1}},computed:{history:function(){return this.$store.state.app.history},pending:function(){return this.$store.state.app.pending}},watch:{},methods:{getDetails:function(){var t=this;return Object(g["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("app/getDetails",t.$route.params.address);case 2:t.details=e.sent,t.$store.dispatch("app/history",t.$route.params.address),t.$store.dispatch("app/pending",t.$route.params.address),t.balance=y["convert"](t.details.balance,t.rawconv),t.representative=t.details.representative;case 7:case"end":return e.stop()}}),e)})))()}},mounted:function(){this.$store.dispatch("app/resetState"),this.getDetails()}},de=ue,pe=Object(d["a"])(de,ce,le,!1,null,null,null),ve=pe.exports;r["default"].use(f["a"]);var fe=[{path:"/",name:"Home",component:Bt},{path:"/node",name:"Node",component:qt},{path:"/generate",name:"Generate",component:oe},{path:"/about",name:"About",component:function(){return a.e("about").then(a.bind(null,"f820"))}},{path:"/block/:hash",name:"Block",component:Wt},{path:"/address/:address",name:"Address",component:ve},{path:"/pos/:address",name:"POS",component:Bt},{path:"/:node",name:"Home",component:Bt},{path:"/:node/generate",name:"Generate",component:oe},{path:"/:node/block/:hash",name:"Block",component:Wt},{path:"/:node/address/:address",name:"Address",component:ve},{path:"/:node/pos/:address",name:"POS",component:Bt}],he=new f["a"]({routes:fe}),me=he,be=a("2f62");function ge(){return{settings:{pow:1,changeaddress:!0,checkbackends:!0,followlinks:!0,receiveinterval:1e4,nfctoken:"Ahj98+v1x4Bc5M82YLnZNFjOSgGSGis9VHSc++KhrQHrbZMeiJ3Q7+NqXYVaadKFqk0KerB3NwPLNQhVjPo5uw8AAABheyJvcmlnaW4iOiJodHRwczovL2xpbnV4c2VydmVyLmlvOjQ0MyIsImZlYXR1cmUiOiJXZWJORkMiLCJleHBpcnkiOjE1OTU0NTE1ODYsImlzU3ViZG9tYWluIjp0cnVlfQ==",node:[{address:"nano.linuxserver.io",protocol:"http",port:7076,path:""},{address:"nano2.linuxserver.io",protocol:"http",port:7076,path:""}],presets:{"mynano.ninja":{port:443,path:"/api/node",protocol:"https",headers:{"Content-Type":"application/json"}},"proxy.nanos.cc":{port:443,path:"/proxy",protocol:"https",headers:{"Content-Type":"application/json"}}}},privatekey:null,pow:null,ready:!1,history:[],pending:[],node:{address:null,port:null,path:"",auth:null}}}var ke=function(){return ge()};function we(){return"node"in me.currentRoute.params?"/"+me.currentRoute.params.node+"/":"/"}function ye(t,e){null!==e&&(console.log("Finished calculating"),console.log(e)),t.pow=e}function xe(t,e){t.ready=e}function Ce(t,e){t.privatekey=e}function _e(t,e){t.node=e}function Se(t,e){t.history=e}function Te(t,e){t.pending=e}function Ae(t,e){t.balance=e}function Re(t){Object.assign(t,ke())}var $e=a("53ca"),Oe=a("5530");function Ne(){return window.location.protocol.replace(":","")}function Ee(){return"https"==Ne()?"7077":"7076"}function Pe(t){return je.apply(this,arguments)}function je(){return je=Object(g["a"])(regeneratorRuntime.mark((function t(e){var a,n,s,i,r,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=e.commit,n=e.state,s=Object(Oe["a"])({},n.node),!0!==n.settings.changeaddress){t.next=9;break}s.address=me.currentRoute.params.node,s.port=Ee(),s.protocol=Ne(),me.currentRoute.params.node in n.settings.presets&&(i=n.settings.presets[me.currentRoute.params.node],s=Object(Oe["a"])(Object(Oe["a"])({},s),i)),t.next=23;break;case 9:if(1!=n.settings.checkbackends){t.next=22;break}o=regeneratorRuntime.mark((function t(){var e,a,i,o,c,l;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=new AbortController,a=setTimeout((function(){e.abort()}),1e4),i=n.settings.node[r].protocol+"://"+n.settings.node[r].address+":"+n.settings.node[r].port+n.settings.node[r].path,o={method:"POST",body:'{"action":"block_count"}'},o.signal=e.signal,o.headers={},"headers"in n.settings.node[r]&&(o.headers=n.settings.node[r].headers),"auth"in n.settings.node[r]&&null!==n.settings.node[r].auth&&(o.headers["Authorization"]=n.settings.node[r].auth),t.prev=8,console.log("Checking backend: "+i),t.next=12,fetch(i,o);case 12:if(c=t.sent,clearTimeout(a),!c.ok){t.next=27;break}return t.next=17,c.json();case 17:if(l=t.sent,!l.count){t.next=24;break}return console.log("Backend OK: "+i),s=Object(Oe["a"])(Object(Oe["a"])({},s),n.settings.node[r]),t.abrupt("return","break");case 24:console.log(c);case 25:t.next=28;break;case 27:console.log(c);case 28:t.next=34;break;case 30:t.prev=30,t.t0=t["catch"](8),clearTimeout(a),console.log("Timed out: "+i);case 34:case"end":return t.stop()}}),t,null,[[8,30]])})),r=0;case 12:if(!(r<n.settings.node.length)){t.next=20;break}return t.delegateYield(o(),"t0",14);case 14:if(c=t.t0,"break"!==c){t.next=17;break}return t.abrupt("break",20);case 17:r++,t.next=12;break;case 20:t.next=23;break;case 22:s=Object(Oe["a"])(Object(Oe["a"])({},s),n.settings.node[0]);case 23:"auth"in me.currentRoute.query&&(s.auth=me.currentRoute.query.auth),a("node",s);case 25:case"end":return t.stop()}}),t)}))),je.apply(this,arguments)}function Be(t){return De.apply(this,arguments)}function De(){return De=Object(g["a"])(regeneratorRuntime.mark((function t(e){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,y["generateSeed"]();case 2:return a=t.sent,t.abrupt("return",Ie(e,a));case 4:case"end":return t.stop()}}),t)}))),De.apply(this,arguments)}function Ie(t,e){return Fe.apply(this,arguments)}function Fe(){return Fe=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){var n,s,i,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n=y["deriveSecretKey"](a,0),s=y["derivePublicKey"](n),i=y["deriveAddress"](s,{useNanoPrefix:!0}),r={seed:a,privatekey:n,publickey:s,address:i},t.abrupt("return",r);case 5:case"end":return t.stop()}}),t)}))),Fe.apply(this,arguments)}function Le(t,e){return Me.apply(this,arguments)}function Me(){return Me=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={action:"account_info",representative:"true",account:a},t.next=3,We(e,n);case 3:return s=t.sent,t.abrupt("return",s);case 5:case"end":return t.stop()}}),t)}))),Me.apply(this,arguments)}function We(t,e){return Ge.apply(this,arguments)}function Ge(){return Ge=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){var n,s,i,r,o,c;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(n=e.commit,s=e.state,null!==s.node.address){t.next=4;break}return t.next=4,Pe({commit:n,state:s});case 4:return i=s.node.protocol+"://"+s.node.address+":"+s.node.port+s.node.path,r={method:"POST",body:JSON.stringify(a)},r.headers={},"headers"in s.node&&(r.headers=s.node.headers),null!==s.node.auth&&(r.headers["Authorization"]=s.node.auth),t.next=11,fetch(i,r);case 11:return o=t.sent,t.next=14,o.json();case 14:return c=t.sent,console.log(c),console.log(n),t.abrupt("return",c);case 18:case"end":return t.stop()}}),t)}))),Ge.apply(this,arguments)}var He=0;function Ue(t,e){return Ve.apply(this,arguments)}function Ve(){return Ve=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={},n["action"]="account_history",n["account"]=a,n["count"]=64,console.log("history"),t.prev=5,t.next=8,e.dispatch("rpCall",n);case 8:s=t.sent,Array.isArray(s.history)&&s.history.length&&e.commit("history",s.history),t.next=17;break;case 12:t.prev=12,t.t0=t["catch"](5),console.log(t.t0),console.log("Something went wrong, rate minited maybe? try again"),He<3&&setTimeout((function(){He++,e.dispatch("history",a)}),2e3);case 17:case"end":return t.stop()}}),t,null,[[5,12]])}))),Ve.apply(this,arguments)}var Ke=0;function qe(t,e){return Je.apply(this,arguments)}function Je(){return Je=Object(g["a"])(regeneratorRuntime.mark((function t(e,a){var n,s;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n={},n["action"]="pending",n["source"]="true",n["sorting"]="true",n["account"]=a,t.prev=5,t.next=8,e.dispatch("rpCall",n);case 8:s=t.sent,console.log("pending1"),"object"===Object($e["a"])(s.blocks)?(console.log("pending"),e.commit("pending",s.blocks)):e.commit("pending",[]),t.next=18;break;case 13:t.prev=13,t.t0=t["catch"](5),console.log(t.t0),console.log("Something went wrong, rate minited maybe? try again"),Ke<3&&setTimeout((function(){Ke++,e.dispatch("pending",a)}),2e3);case 18:case"end":return t.stop()}}),t,null,[[5,13]])}))),Je.apply(this,arguments)}function Qe(t){var e=t.dispatch,a=t.commit;a("resetState"),e("node")}var Ye={namespaced:!0,state:ke,getters:n,mutations:s,actions:i};r["default"].use(be["a"]);var ze=new be["a"].Store({modules:{app:Ye}}),Xe=a("ee98"),Ze=a.n(Xe);r["default"].use(Ze.a),r["default"].config.productionTip=!1,new r["default"]({router:me,store:ze,render:function(t){return t(v)}}).$mount("#app")},"5ba3":function(t,e,a){t.exports=function(){return new Worker(a.p+"1602516512737beec51b.worker.js")}},"5c0b":function(t,e,a){"use strict";var n=a("9c0c"),s=a.n(n);s.a},7582:function(t,e,a){"use strict";a.d(e,"a",(function(){return r}));a("fb6a");var n=a("2b0e"),s=a("8722"),i=a("174c"),r={data:function(){return{rawconv:{from:"raw",to:"Nano"},nanoconv:{from:"Nano",to:"raw"}}},computed:{},mounted:function(){},methods:{abbreviateNumber:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return console.log(t),2===e?t<.005?t:s(t).format({trimMantissa:!0,mantissa:2,average:!0}):s(t).format({trimMantissa:!0,mantissa:10,average:!0})},copyToClipboard:function(t){var e=document.createElement("textarea");e.innerHTML=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),n["default"].notify({title:"Success!",text:"Copied to clipboard",type:"success"})},link:function(t,e){if(0==this.$store.state.app.settings.followlinks)return n["default"].notify({title:"Error",text:"Links are not available in advanced mode",type:"error"}),!1;var a=window.location.origin;"address"==t&&window.open(a+"/#"+this.$store.getters["app/nodeLink"]+"address/"+e),"block"==t&&window.open(a+"/#"+this.$store.getters["app/nodeLink"]+"block/"+e)},abbreviateAddress:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a="";return!0===e&&(a+='<span class="abbreviate">'),a+=t.substring(0,11)+"..."+t.slice(t.length-6),!0===e&&(a+="</span>"),a},highlightAddress:function(t){if(null!==t&&void 0!==t){var e=t.length-6;return'<span class="abbreviate"><span class="highlight">'+t.substring(0,11)+"</span>"+t.substring(11,e)+'<span class="highlight">'+t.slice(t.length-6)+"</span></span>"}return null},transactionStatus:function(t){return"send"===t?"Sent":"receive"===t?"Received":void 0},checkamount:function(t){return!!i.checkAmount(t)||(this.$notify({title:"Invalid amount",text:"Please ensure the amount selected is a valid",type:"error"}),!1)}}}},8288:function(t,e,a){},"9c0c":function(t,e,a){},ae55:function(t,e,a){"use strict";var n=a("1594"),s=a.n(n);s.a},d418:function(t,e,a){"use strict";var n=a("0e4f"),s=a.n(n);s.a},dd1e:function(t,e,a){"use strict";(function(t){a("fb6a"),a("b0c0"),a("d3b7"),a("ac1f"),a("25f0"),a("1276"),a("96cf");var n=a("1da1"),s=a("174c"),i=a("7582"),r=a("8d3b"),o=(a("f138"),a("c8f6"));e["a"]={name:"BlockState",components:{simplebar:r["a"]},props:{details:{default:null,type:String},static:{default:!1,type:Boolean}},mixins:[i["a"]],data:function(){return{hash:null,blockstate:null,net:null,metadatahex:"",metadatautf8:"",addmetadata:!1,metaform:!1,metaformmax:32,metadata:"",addmeta:!1,showspinner:!1}},mounted:function(){this.static&&this.getDetails(this.$route.params.hash)},watch:{details:function(t){var e=this;return Object(n["a"])(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:null!==t?e.getDetails(t):e.blockstate=null;case 1:case"end":return a.stop()}}),a)})))()}},methods:{getDetails:function(e){var a=this;return Object(n["a"])(regeneratorRuntime.mark((function n(){var s,i,r,o;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return s={action:"block_info",json_block:"true",hash:e},a.hash=e,n.next=4,a.$store.dispatch("app/rpCall",s);case 4:return a.blockstate=n.sent,a.metadatahex="",a.metadatautf8="",a.metaform=!1,a.metadata="",a.showspinner=!1,n.next=12,fetch("https://www.nanometadata.com/"+a.hash);case 12:if(i=n.sent,!i.ok){n.next=23;break}return a.addmeta=!1,n.next=17,i.text();case 17:r=n.sent,o=r.substring(192),a.metadatahex="HEX: "+o,a.metadatautf8="UTF8: "+new t(o,"hex").toString("utf8"),n.next=25;break;case 23:"Block"!==a.$route.name&&(a.addmeta=!0),a.metadatahex="None Found";case 25:case"end":return n.stop()}}),n)})))()},formattedValue:function(t){return this.abbreviateNumber(s["convert"](t,this.rawconv),5)},showmetaform:function(){return this.metaform=!this.metaform,!0},setmeta:function(){var e=this;return Object(n["a"])(regeneratorRuntime.mark((function a(){var n,i,r,c,l,u,d,p,v;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(!e.metadata){a.next=20;break}return"linuxserver"==e.$store.state.app.node.address.split(".").slice(-2)[0]?e.net="lsio":e.net="live",e.metaform=!1,e.showspinner=!0,n=e.$store.state.app.privatekey,i=t(e.metadata).toString("hex"),r=Object(o["blake2sHex"])(e.hash+i).toUpperCase(),c=s["derivePublicKey"](n),l=s["signBlock"]({hash:r,secretKey:n}),u="trans="+e.hash+"&data="+i+"&pub="+c+"&sig="+l+"&net="+e.net,d="https://api.nanometadata.com/metadata?"+u,a.next=13,fetch(d);case 13:return p=a.sent,a.next=16,p.text();case 16:v=a.sent,p.ok?(e.$notify({title:"Transaction signed",text:"Transaction has been signed at nanometadata.com",type:"success"}),e.getDetails(e.hash)):e.$notify({title:"Cannot sign transaction",text:v,type:"error"}),a.next=21;break;case 20:e.$notify({title:"Metadata Not Set",text:"Please set some metadata",type:"error"});case 21:case"end":return a.stop()}}),a)})))()},metalink:function(){window.open("https://www.nanometadata.com/"+this.hash)}},computed:{formattedDate:function(){var t=new Date(1e3*this.blockstate.local_timestamp);return t.getDate()+" "+t.toLocaleString("default",{month:"short"})+" "+t.getFullYear()+" - "+t.toLocaleTimeString()}}}}).call(this,a("b639").Buffer)}});
//# sourceMappingURL=app.a052d24c.js.map