/* minified */ function e(e){var t=this;Object.keys(e).forEach((function(i){t[i]=e[i]})),t.endpoints=t.endpoints||[]}function t(e,t){"use strict";var i=this;t&&t.length?_.forEach(t,(function(t){i[t]=e[t]})):["currency","issuer","medianTime","number","version","powMin","dividend","membersCount","hash","identities","joiners","actives","leavers","revoked","excluded","certifications","transactions","unitbase"].forEach((function(t){i[t]=e[t]})),i.identitiesCount=i.identities?i.identities.length:0,i.joinersCount=i.joiners?i.joiners.length:0,i.activesCount=i.actives?i.actives.length:0,i.leaversCount=i.leavers?i.leavers.length:0,i.revokedCount=i.revoked?i.revoked.length:0,i.excludedCount=i.excluded?i.excluded.length:0,i.certificationsCount=i.certifications?i.certifications.length:0,i.transactionsCount=i.transactions?i.transactions.length:0,i.empty=i.isEmpty(),i.id=[i.number,i.hash].join("-")}function n(e){var t=e.split(":");if(t.length<3||!t[0].startsWith("WS2P"))throw Error("Invalid format: "+e);if("HEAD"==t[1]){if(t.length<4)throw Error("Invalid format: "+e);if(4==t.length)this.pubkey=t[2],this.buid=t[3];else if(t[2]>=1){var i=t[0];if(i.length>4){var n=this.regexp.WS2P_PREFIX.exec(i);if(!n)throw Error("Invalid format: "+e);var a=n[1];if(a){this.private={useTor:a.startsWith("T")};var o=a.substring(1);"A"==o?this.private.mode="all":"M"==o?this.private.mode="mixed":"S"==o&&(this.private.mode="strict")}var r=n[2];r&&(this.public={useTor:r.startsWith("T"),mode:"all"})}this.pubkey=t[3],this.buid=t[4],this.ws2pid=t[5],this.software=t[6],this.version=t[7],this.powPrefix=t[8]}}}function a(e,t,i,n){angular.extend(this,i("HomeCtrl",{$scope:e})),e.showLoginModal=function(){return e.loading?t(e.showLoginModal,500):n.isLogin()||e.error?void 0:t(n.login,300)},e.$on("$ionicView.enter",e.showLoginModal)}function o(e,t,i,n,a,o,r,s,l,c,d,u,E,m,p){p=p||{},u.demo&&(p.method="PUBKEY"),e.computing=!1,e.pubkey=null,e.formData={},e.showPubkey=!1,e.showComputePubkeyButton=!1,e.autoComputePubkey=!1,e.pubkeyPattern="^(:?{0}|{1})$".format(c.constants.regexp.PUBKEY,c.constants.regexp.PUBKEY_WITH_CHECKSUM),e.isAuth=p.auth,e.okText=p.okText,e.title=p.title||(e.isAuth?"AUTH.TITLE":"LOGIN.TITLE"),e.showMethods=!angular.isDefined(p.showMethods)||p.showMethods,e.showNewAccountLink=!angular.isDefined(p.showNewAccountLink)||p.showNewAccountLink,e.expectedPubkey=p.expectedPubkey,e.expectedUid=p.uid,e.scryptParamsValues=_.keys(o.constants.SCRYPT_PARAMS).reduce((function(e,t){return e.concat({id:t,label:"LOGIN.SCRYPT."+t,params:o.constants.SCRYPT_PARAMS[t]})}),[{id:"USER",label:"LOGIN.SCRYPT.USER",params:{}}]),e.init=function(){s().then((function(){e.autoComputePubkey="a"===ionic.Platform.grade.toLowerCase()&&!l.screen.isSmall()})),e.formData.rememberMe=E.data.rememberMe,e.formData.keepAuthIdle=E.data.keepAuthIdle,e.formData.keepAuth=e.formData.keepAuthIdle==E.constants.KEEP_AUTH_IDLE_SESSION;var t=p.method||E.data.login&&E.data.login.method||"SCRYPT_DEFAULT",i=E.data.login&&E.data.login.params;(e.isAuth&&"PUBKEY"===t||"SCAN"===t||"default"===t)&&(t="SCRYPT_DEFAULT"),e.changeMethod(t,i)},e.enter=function(){l.loading.hide(),l.ink({selector:".modal-login .ink"})},e.$on("modal.shown",e.enter),e.leave=function(){e.formData={},e.computing=!1,e.pubkey=null,e.methods=[]},e.$on("modal.hide",e.leave),e.doLogin=function(i){var n=e.formData.method;if(e.form.$valid||"SCAN"===n){var a,s=e.formData.keepAuthIdle;if("SCRYPT_DEFAULT"===n||"SCRYPT_ADVANCED"===n){if(!e.formData.username||!e.formData.password)return;var d=e.formData.scrypt&&e.formData.scrypt.params;l.loading.show(),a=o.scryptKeypair(e.formData.username,e.formData.password,d).then((function(t){if(!t)return l.loading.hide(10);var i=o.util.encode_base58(t.signPk);return p.expectedPubkey&&p.expectedPubkey!=i?(e.pubkey=i,e.showPubkey=!0,e.pubkeyError=!0,l.loading.hide(10)):(e.pubkeyError=!1,{pubkey:i,keypair:t,params:e.formData.scrypt&&"SCRYPT_DEFAULT"!=e.formData.scrypt.id?d:void 0})})).catch(l.onError("ERROR.CRYPTO_UNKNOWN_ERROR"))}else if("FILE"===n){if(!e.formData.file||!e.formData.file.valid||!e.formData.file.pubkey)return;s=e.formData.keepAuth&&E.constants.KEEP_AUTH_IDLE_SESSION||s,a=l.loading.show().then((function(){return e.readKeyFile(e.formData.file,{withSecret:e.isAuth||e.formData.keepAuth})})).then((function(t){if(!t)return l.loading.hide(10);var i=o.util.encode_base58(t.signPk);return p.expectedPubkey&&p.expectedPubkey!=i?(e.formData.file.valid=!1,l.loading.hide(10)):(e.pubkeyError=!1,{pubkey:i,keypair:t})})).catch(l.onError("ERROR.AUTH_FILE_ERROR"))}else if("PUBKEY"===n){var u=e.formData.pubkey&&e.formData.pubkey.trim(),m=e.formData.uid&&e.formData.uid.trim()||void 0;if(!u)return;var b=c.regexp.PUBKEY.exec(u);if(b)a=l.loading.show().then((function(){return{pubkey:u,uid:m}}));else{if(!(b=c.regexp.PUBKEY_WITH_CHECKSUM.exec(u)))return e.showWotLookupModal(u);u=b[1],b[2]!=r.util.pkChecksum(u)?e.form.pubkey.$error={checksum:!0}:a=l.loading.show().then((function(){return{pubkey:u,uid:m}}))}}else if("SCAN"===n){if(!e.formData.pubkey||e.isAuth&&!e.formData.keypair)return;a=l.loading.show().then((function(){return{pubkey:e.formData.pubkey,keypair:e.formData.keypair}}))}if(a)return a.then((function(i){if(i){var a=!angular.equals(E.data.rememberMe,e.formData.rememberMe),o=!angular.equals(E.data.keepAuthIdle,s),r=!angular.equals(E.data.login&&E.data.login.method,n),c=!angular.equals(E.data.login&&E.data.login.params,i.params);return(a||o||r||c)&&(E.data.rememberMe=e.formData.rememberMe,E.data.keepAuthIdle=s,E.data.useLocalStorage=!!E.data.rememberMe||E.data.useLocalStorage,E.data.login=E.data.login||{},E.data.login.method=n,E.data.login.params=i.params,t(E.store,500)),p.success&&p.success(e.formData),p.silent&&l.loading.hide(),e.closeModal(i)}}));console.warn("[login] unknown method: ",n)}},e.onScryptFormChanged=function(){e.computing||(e.pubkey=null,e.pubkeyError=!1,e.showPubkey=!!e.formData.username&&!!e.formData.password,e.autoComputePubkey&&e.showPubkey?(e.computePubkey(),e.showComputePubkeyButton=!1):e.showComputePubkeyButton=!e.autoComputePubkey&&e.showPubkey)},e.$watch("formData.username + formData.password",e.onScryptFormChanged,!0),e.computePubkey=function(){return e.showComputePubkeyButton=!1,e.computing=!0,e.pubkey=null,t((function(){var t=e.formData.username,i=e.formData.password,n=e.formData.scrypt&&e.formData.scrypt.params;return o.scryptSignPk(t,i,n).then((function(n){if(t!==e.formData.username||i!==e.formData.password)return e.computePubkey();e.pubkey=o.util.encode_base58(n),e.expectedPubkey&&e.expectedPubkey!=e.pubkey&&(e.pubkeyError=!0),e.computing=!1})).catch((function(t){l.onError("ERROR.CRYPTO_UNKNOWN_ERROR")(t),e.computing=!1,e.autoComputePubkey=!1,e.onScryptFormChanged()}))}),100)},e.showJoinModal=function(){e.closeModal(),t((function(){d.showJoin()}),300)},e.showAccountSecurityModal=function(){e.closeModal(),t((function(){d.showAccountSecurity()}),300)},e.showHelpModal=function(e){return d.showHelp(e)},e.doScan=function(){if(!e.computing)return e.computing=!0,e.formData.pubkey=null,e.formData.keypair=null,m.barcode.scan().then((function(t){if(t)return e.isAuth?i.when(t):c.uri.parse(t).then((function(e){if(!e||!e.pubkey)throw{message:"ERROR.SCAN_UNKNOWN_FORMAT"};return e})).catch((function(e){return console.debug("[login] Error while parsing as URI: "+(e&&e.message||e)),t}))})).then((function(e){if(e)return e&&e.pubkey?e:r.keyfile.parseData(e,{silent:!0}).then((function(e){if(!e||!e.signPk||!e.signSk)throw{message:"ERROR.SCAN_UNKNOWN_FORMAT"};return{pubkey:o.base58.encode(e.signPk),keypair:e}})).catch(l.onError("ERROR.SCAN_UNKNOWN_FORMAT"))})).then((function(t){t&&t.pubkey&&(e.pubkeyError=e.expectedPubkey&&e.expectedPubkey!=t.pubkey,e.formData.pubkey=t.pubkey,e.formData.keypair=t.keypair)})).then((function(){e.computing=!1,l.loading.hide(10)})).catch((function(t){e.computing=!1,l.onError("ERROR.SCAN_FAILED")(t)}))},e.changeMethod=function(t,i){if(e.hideMethodsPopover(),"PUBKEY"!==t&&u.demo)return l.alert.demo();if(t&&t!==e.formData.method)if(console.debug("[login] method is: "+t),e.formData.method=t,e.formData.uid=null,e.form&&delete e.form.$submitted,"SCRYPT_DEFAULT"===t||"SCRYPT_ADVANCED"===t){var n;e.pubkey=null,i?(n=_.find(e.scryptParamsValues,(function(e){return e.params&&angular.equals(e.params,i)})))||((n=_.findWhere(e.scryptParamsValues,{id:"USER"})||{}).params=i):n=_.findWhere(e.scryptParamsValues,{id:"DEFAULT"}),e.changeScrypt(n),e.autoComputePubkey=e.autoComputePubkey&&"SCRYPT_DEFAULT"===t}else{if("SCAN"===t)return e.doScan();e.formData.username=null,e.formData.password=null,e.formData.pubkey=null,e.pubkey=null,e.computing=!1}},e.changeScrypt=function(t){e.formData.scrypt=angular.copy(t||{}),e.onScryptFormChanged()},e.readKeyFile=function(i,n){return(n=n||{}).password=n.password||e.formData.file.password||function(){return e.formData.file.password=void 0,d.showPassword({title:"ACCOUNT.SECURITY.KEYFILE.PASSWORD_POPUP.TITLE",subTitle:"ACCOUNT.SECURITY.KEYFILE.PASSWORD_POPUP.HELP",error:n.error,scope:e}).then((function(i){return e.formData.file.password=i,t((function(){return i}),150)}))},r.keyfile.read(e.formData.file,n).catch((function(t){if(e.formData.file.password=void 0,"CANCELLED"===t&&l.loading.hide(10),t&&t.ucode==r.errorCodes.BAD_PASSWORD)return e.readKeyFile(e.formData.file,{withSecret:n.withSecret,error:"ACCOUNT.SECURITY.KEYFILE.ERROR.BAD_PASSWORD"});throw t}))},e.onFileChanged=function(i){i&&i.fileData?(e.formData.file={name:i.fileData.name,size:i.fileData.size,content:i.fileContent},e.validatingFile=!0,t((function(){return console.debug("[login] key file changed: ",e.formData.file),e.validatingFile=!0,e.readKeyFile(e.formData.file,{withSecret:!1,password:e.formData.file.password}).then((function(t){t&&t.signPk?(e.formData.file.pubkey=o.util.encode_base58(t.signPk),e.formData.file.valid=!e.expectedPubkey||e.expectedPubkey===e.formData.file.pubkey,e.validatingFile=!1):(e.formData.file.valid=!1,e.formData.file.pubkey=void 0)})).catch((function(t){t&&"CANCELLED"===t?e.removeKeyFile():(e.validatingFile=!1,e.formData.file.valid=!1,e.formData.file.pubkey=void 0,l.onError("ERROR.AUTH_FILE_ERROR")(t))}))}))):e.validatingFile=!1},e.removeKeyFile=function(){e.formData.file=void 0},e.showWotLookupModal=function(i){return d.showWotLookup({q:i}).then((function(i){if(i&&i.pubkey)return e.formData.pubkey=i.pubkey,e.formData.uid=i.uid||void 0,t(e.doLogin,300)}))},e.showMethodsPopover=function(t){t.defaultPrevented||l.popover.show(t,{templateUrl:"templates/login/popover_methods.html",scope:e,autoremove:!0,afterShow:function(t){e.methodsPopover=t,l.ink({selector:".popover-login-methods .item"})}})},e.hideMethodsPopover=function(){e.methodsPopover&&(e.methodsPopover.hide(),e.methodsPopover=null)},e.init()}function r(e,t,i){var n=angular.copy(i);n.demo=!1,n.readonly=!1,angular.extend(this,t("LoginModalCtrl",{$scope:e,parameters:{auth:!0},csConfig:n})),e.setForm=function(t){e.form=t}}function s(e,t,i,n,a){e.$on("$ionicView.enter",(function(o){e.locale=a.data.locale.id,t.stateParams&&t.stateParams.anchor&&(e.anchor=t.stateParams.anchor,i((function(){n(t.stateParams.anchor)}),100))}))}function l(e,t,i,n,a){e.itemsClass={},e.locale=n.data.locale.id,(a=a||{})&&"string"==typeof a&&(a={anchor:a}),a.anchor&&(t((function(){i(a.anchor)}),100),e.itemsClass={},e.itemsClass[a.anchor]="selected",e.listClass="selection")}function c(e,t,i,n,a,o,r,s,l,c,d,u,E,m){e.tour=!1,e.continue=!0,e.executeStep=function(t,i,n){if((n=angular.isDefined(n)?n:0)>=i.length)return o.when(!0);var a=i[n];if("function"!=typeof a)throw new Error("[helptip] Invalid step at index {0} of '{1}' tour: step must be a function".format(n,t));var r=a();return"boolean"==typeof r&&(r=o.when(r)),r.then((function(a){return angular.isUndefined(a)?(e.continue=!1,n):a&&n!==i.length-1?e.executeStep(t,i,n+1):a?-1:n+1})).catch((function(i){return i&&"transition prevented"===i.message?console.error("ERROR: in help tour [{0}], in step [{1}] -> use large if exists, to prevent [transition prevented] error".format(t,n)):console.error("ERROR: in help tour [{0}], in step [{1}] : {2}".format(t,n,i)),e.continue=!1,n}))},e.showHelpTip=function(t,i){return(i=i||{}).bindings=i.bindings||{},i.bindings.value=i.bindings.value||"",i.bindings.hasNext=!angular.isDefined(i.bindings.hasNext)||i.bindings.hasNext,i.timeout=i.timeout||(E.enable?900:500),i.autoremove=!0,i.bindings.tour=e.tour,i.backdropClickToClose=!e.tour,s.popover.helptip(t,i)},e.showHelpModal=function(e){Modals.showHelp({anchor:e})},e.startHelpTour=function(){return e.tour=!0,e.continue=!0,console.debug("[help] Starting help tour... {demo: {0}, readonly: {1}, isLogin: {2}}".format(l.demo,l.readonly,m.isLogin())),(!l.readonly&&m.isLogin()?e.startWalletNoLoginTour(0,!0):o.when(!0)).then((function(t){return!!t&&(!(!l.readonly&&m.isLogin())||e.startWalletTour(0,!0).then((function(t){return!!t&&(c.data.helptip.wallet=t,c.store(),e.continue)})))})).then((function(t){return!!t&&(!(!l.readonly&&m.isLogin())||e.startWalletCertTour(0,!0).then((function(t){return!!t&&(c.data.helptip.walletCerts=t,c.store(),e.continue)})))})).then((function(t){return!!t&&(!(!l.readonly&&m.isLogin())||e.startTxTour(0,!0).then((function(t){return!!t&&(c.data.helptip.tx=t,c.store(),e.continue)})))})).then((function(t){return!!t&&(!(!l.readonly&&m.isLogin())||e.startWalletsTour(0,!0).then((function(t){return!!t&&(c.data.helptip.wallets=t,c.store(),e.continue)})))})).then((function(t){return!!t&&(!!l.readonly||e.startHeaderTour(0,!0))})).then((function(t){return!!t&&(!!l.readonly||e.startSettingsTour(0,!0))})).then((function(t){return!!t&&e.startWotLookupTour(0,!0).then((function(t){return!(!t||e.cancelled)&&(c.data.helptip.wotLookup=t,c.store(),e.continue)}))})).then((function(t){return!!t&&e.startWotTour(0,!0).then((function(t){return!(!t||e.cancelled)&&(c.data.helptip.wot=t,c.store(),e.continue)}))})).then((function(t){return!!t&&e.startWotCertTour(0,!0).then((function(t){return!!t&&(c.data.helptip.wotCerts=t,c.store(),e.continue)}))})).then((function(t){return!!t&&e.startCurrencyTour(0,!0).then((function(t){return!(!t||e.cancelled)&&(c.data.helptip.currency=t,c.store(),e.continue)}))})).then((function(t){return!!t&&e.startNetworkTour(0,!0).then((function(t){return!(!t||e.cancelled)&&(c.data.helptip.network=t,c.store(),e.continue)}))})).then((function(t){return!!t&&(!l.readonly||e.startSettingsTour(0,!0))})).then((function(t){return!!t&&e.finishTour()}))},e.startCurrencyTour=function(i,a){var o,u=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-currency",{bindings:{content:"HELP.TIP.MENU_BTN_CURRENCY",icon:{position:s.screen.isSmall()||l.readonly?"left":"bottom-left"}}})},function(){return n.isOpen()&&n.toggleLeft(!1),t.go(s.screen.isSmall()?"app.currency":"app.currency_lg").then((function(){return e.showHelpTip("helptip-currency-mass-member",{bindings:{content:"HELP.TIP.CURRENCY_MASS",icon:{position:"center"}}})}))},function(){return!c.data.useRelative||e.showHelpTip("helptip-currency-mass-member-unit",{bindings:{content:"HELP.TIP.CURRENCY_UNIT_RELATIVE",contentParams:o,icon:{position:s.screen.isSmall()?"right":"center"}}})},function(){return r("helptip-currency-rules-anchor"),e.showHelpTip("helptip-currency-rules",{bindings:{content:"HELP.TIP.CURRENCY_RULES",icon:{position:"center",glyph:"ion-information-circled"}}})},function(){return t.is("app.currency.tab_parameters")&&t.go("app.currency.tab_wot"),r("helptip-currency-newcomers-anchor"),e.showHelpTip("helptip-currency-newcomers",{bindings:{content:"HELP.TIP.CURRENCY_WOT",icon:{position:"center"},hasNext:a},timeout:1200,retry:2})}];return d.get().then((function(t){return o=t.parameters,e.executeStep("currency",u,i)}))},e.startNetworkTour=function(o,r){var u=function(){t.is("app.currency")&&a((function(){var e=i.document.querySelectorAll("ion-tabs .tabs a");e&&3===e.length&&angular.element(e[2]).triggerHandler("click")}),100)},E=[function(){return!!s.screen.isSmall()||(n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-network",{bindings:{content:"HELP.TIP.MENU_BTN_NETWORK",icon:{position:s.screen.isSmall()||l.readonly?"left":"bottom-left"}}}))},function(){return n.isOpen()&&n.toggleLeft(!1),t.go(s.screen.isSmall()?"app.currency.tab_network":"app.network").then((function(){return u(),e.showHelpTip("helptip-network-peers",{bindings:{content:"HELP.TIP.NETWORK_BLOCKCHAIN",icon:{position:"center",glyph:"ion-information-circled"}},timeout:1200})}))},function(){return u(),e.showHelpTip("helptip-network-peer-0",{bindings:{content:"HELP.TIP.NETWORK_PEERS",icon:{position:s.screen.isSmall()?void 0:"center"}},timeout:1e3,retry:20})},function(){return u(),e.showHelpTip("helptip-network-peer-0-block",{bindings:{content:"HELP.TIP.NETWORK_PEERS_BLOCK_NUMBER",icon:{position:s.screen.isSmall()?void 0:"center"}}})},function(){u();var t=c.data.locale.id;return e.showHelpTip("helptip-network-peers",{bindings:{content:"HELP.TIP.NETWORK_PEERS_PARTICIPATE",contentParams:{installDocUrl:l.helptip&&l.helptip.installDocUrl?l.helptip.installDocUrl[t]?l.helptip.installDocUrl[t]:l.helptip.installDocUrl:"http://duniter.org"},icon:{position:"center",glyph:"ion-information-circled"},hasNext:r}})}];return d.parameters().then((function(t){return e.executeStep("network",E,o)}))},e.startWotLookupTour=function(o,r){var c=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-wot",{bindings:{content:"HELP.TIP.MENU_BTN_WOT",icon:{position:s.screen.isSmall()||l.readonly?"left":"bottom-left"}},onError:"continue"})},function(){return n.isOpen()&&n.toggleLeft(!1),t.go(s.screen.isSmall()?"app.wot_lookup.tab_search":"app.wot_lookup_lg").then((function(){return e.showHelpTip("helptip-wot-search-text",{bindings:{content:s.screen.isSmall()?"HELP.TIP.WOT_SEARCH_TEXT_XS":"HELP.TIP.WOT_SEARCH_TEXT",icon:{position:"center"}}})}))},function(){return e.showHelpTip("helptip-wot-search-result-0",{bindings:{content:"HELP.TIP.WOT_SEARCH_RESULT",icon:{position:"center"}},timeout:700,retry:15})},function(){var t=i.document.getElementById("helptip-wot-search-result-0");return!t||(a((function(){angular.element(t).triggerHandler("click")})),e.showHelpTip("helptip-wot-view-certifications",{bindings:{content:"HELP.TIP.WOT_VIEW_CERTIFICATIONS",hasNext:r},timeout:2500}))}];return e.executeStep("wotLookup",c,o)},e.startWotTour=function(t,i){var n,a=[function(){return e.showHelpTip("helptip-wot-view-certifications",{bindings:{content:"HELP.TIP.WOT_VIEW_CERTIFICATIONS_COUNT",contentParams:n,icon:{position:"center",glyph:"ion-information-circled"}}})},function(){return e.showHelpTip("helptip-wot-view-certifications-count",{bindings:{content:"HELP.TIP.WOT_VIEW_CERTIFICATIONS_CLICK",icon:{position:"center"},hasNext:i}})}];return d.get().then((function(i){return(n=i.parameters).currentUD=i.currentUD,e.executeStep("wot",a,t)}))},e.startWotCertTour=function(n,r){if(l.readonly)return o.when(!0);var c=[function(){if(t.is("app.wot_identity")){var n=i.document.getElementById("helptip-wot-view-certifications");if(!n)return!0;a((function(){angular.element(n).triggerHandler("click")}))}return e.showHelpTip(s.screen.isSmall()?"fab-certify":"helptip-certs-certify",{bindings:{content:"HELP.TIP.WOT_VIEW_CERTIFY",icon:{position:s.screen.isSmall()?"bottom-right":"center"}},timeout:s.screen.isSmall()?2e3:1e3,retry:10})},function(){return e.showHelpTip(s.screen.isSmall()?"fab-certify":"helptip-certs-certify",{bindings:{content:"HELP.TIP.CERTIFY_RULES",icon:{position:"center",glyph:"ion-alert-circled"},hasNext:r}})}];return e.executeStep("certs",c,n)},e.startWalletNoLoginTour=function(t,i){if(m.isLogin())return o.when(!0);var a=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-account",{bindings:{content:"HELP.TIP.MENU_BTN_ACCOUNT",icon:{position:"left"},hasNext:i}})},function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-tx",{bindings:{content:"HELP.TIP.MENU_BTN_TX",icon:{position:"left"},hasNext:i}})},function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-wallets",{bindings:{content:"HELP.TIP.MENU_BTN_WALLETS",icon:{position:"left"},hasNext:i}})}];return e.executeStep("wallet-no-login",a,t)},e.startWalletTour=function(i,a){if(!m.isLogin())return o.when(!0);var l=m.data.isMember||m.data.requirements&&m.data.requirements.pendingMembership,c=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-account",{bindings:{content:m.data.isMember?"HELP.TIP.MENU_BTN_ACCOUNT_MEMBER":"HELP.TIP.MENU_BTN_ACCOUNT",icon:{position:"left"}}})},function(){return n.isOpen()&&n.toggleLeft(!1),t.go("app.view_wallet").then((function(){return e.showHelpTip(s.screen.isSmall()?"helptip-wallet-options-xs":"helptip-wallet-options",{bindings:{content:"HELP.TIP.WALLET_OPTIONS",icon:{position:s.screen.isSmall()?"right":"center"}},timeout:s.screen.isSmall()?2e3:1e3,retry:10})}))},function(){return r("helptip-wallet-pubkey"),e.showHelpTip("helptip-wallet-pubkey",{bindings:{content:"HELP.TIP.WALLET_PUBKEY",icon:{position:"center"},hasNext:!l&&a},timeout:s.screen.isSmall()?2e3:500,retry:10})},function(){return l?(r("helptip-wallet-certifications"),e.showHelpTip("helptip-wallet-certifications",{bindings:{content:s.screen.isSmall()?"HELP.TIP.WALLET_RECEIVED_CERTIFICATIONS":"HELP.TIP.WALLET_CERTIFICATIONS",icon:{position:"center"},hasNext:a},timeout:500,onError:"continue"})):a}];return c.length!=u.wallet.stepCount&&console.error("[help] Invalid value of 'csHelpConstants.wallet.stepCount'. Please update to {0}".format(c.length)),d.get().then((function(t){return t.parameters.currentUD=t.currentUD,e.executeStep("wallet",c,i)}))},e.startWalletCertTour=function(n,r){if(!m.isLogin())return o.when(!0);var l=!1,c=[function(){if(t.is("app.view_wallet")){var n=i.document.getElementById("helptip-wallet-certifications");if(!n)return l=!0,!0;a((function(){angular.element(n).triggerHandler("click")}))}return!s.screen.isSmall()||e.showHelpTip("helptip-received-certs",{bindings:{content:"HELP.TIP.WALLET_RECEIVED_CERTS"}})},function(){return!(!l&&s.screen.isSmall())||t.go("app.view_wallet").then((function(){return e.showHelpTip("helptip-wallet-given-certifications",{bindings:{content:"HELP.TIP.WALLET_GIVEN_CERTIFICATIONS",icon:{position:"center"}},timeout:500})}))},function(){if(l)return!0;if(t.is("app.view_wallet")){var n=i.document.getElementById("helptip-wallet-given-certifications");if(!n)return l=!0,!0;a((function(){angular.element(n).triggerHandler("click")}),500)}return e.showHelpTip(s.screen.isSmall()?"fab-select-certify":"helptip-certs-select-certify",{bindings:{content:"HELP.TIP.WALLET_CERTIFY",icon:{position:s.screen.isSmall()?"bottom-right":"center"}},timeout:s.screen.isSmall()?2e3:500,retry:10})},function(){return e.tour||l?r:e.showHelpTip("helptip-certs-stock",{bindings:{content:"HELP.TIP.CERTIFY_RULES",icon:{position:"center",glyph:"ion-alert-circled"},hasNext:r}})}];return d.parameters().then((function(t){return e.executeStep("certs",c,n)}))},e.startTxTour=function(i,a){if(!m.isLogin())return o.when(!0);var r,s=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-tx",{bindings:{content:"HELP.TIP.MENU_BTN_TX",icon:{position:"left"}}})},function(){return n.isOpen()&&n.toggleLeft(!1),t.go("app.view_wallet_tx").then((function(){return e.showHelpTip("helptip-wallet-balance",{bindings:{content:c.data.useRelative?"HELP.TIP.WALLET_BALANCE_RELATIVE":"HELP.TIP.WALLET_BALANCE",contentParams:r,icon:{position:"center"}},retry:20})}))},function(){return e.showHelpTip("helptip-wallet-balance",{bindings:{content:"HELP.TIP.WALLET_BALANCE_CHANGE_UNIT",contentParams:r,icon:{position:"center",glyph:"ion-information-circled"}}})}];return d.get().then((function(t){return(r=t.parameters).currentUD=t.currentUD,e.executeStep("tx",s,i)}))},e.startWalletsTour=function(t,i){var a=[function(){return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-wallets",{bindings:{content:"HELP.TIP.MENU_BTN_WALLETS",icon:{position:"left"},hasNext:i}})}];return e.executeStep("my-wallets",a,t)},e.startHeaderTour=function(r,c){if(s.screen.isSmall()||l.readonly)return o.when(!0);function d(){var e=i.document.querySelectorAll("#helptip-header-bar-btn-profile");return e&&e.length?_.find(e,(function(e){return e.offsetWidth>0})):null}var u=[function(){if(s.screen.isSmall())return!0;var i=d();return!i||e.showHelpTip(i,{bindings:{content:"HELP.TIP.HEADER_BAR_BTN_PROFILE",icon:{position:"right",style:t.is("app.home")?"margin-right: 60px":void 0}}})},function(){if(s.screen.isSmall())return n.toggleLeft(!0),e.showHelpTip("helptip-menu-btn-settings",{bindings:{content:"HELP.TIP.MENU_BTN_SETTINGS",icon:{position:"left"},hasNext:c},timeout:1e3});var t=d();return!t||(a((function(){angular.element(t).triggerHandler("click")})),e.showHelpTip("helptip-popover-profile-btn-settings",{bindings:{content:"HELP.TIP.MENU_BTN_SETTINGS",icon:{position:"center"},hasNext:c},timeout:1e3}).then((function(t){return e.closeProfilePopover(),t})))}];return e.executeStep("header",u,r)},e.startSettingsTour=function(i,a){var o,r=[function(){return!s.screen.isSmall()&&!l.readonly||(n.toggleLeft(!0),e.showHelpTip(s.screen.isSmall()?"helptip-menu-btn-settings":"menu-btn-settings",{bindings:{content:"HELP.TIP.MENU_BTN_SETTINGS",icon:{position:s.screen.isSmall()?"left":"bottom-left"}},timeout:1e3}))},function(){return n.isOpen()&&n.toggleLeft(!1),t.go("app.settings").then((function(){return e.showHelpTip("helptip-settings-btn-unit-relative",{bindings:{content:"HELP.TIP.SETTINGS_CHANGE_UNIT",contentParams:o,icon:s.screen.isSmall()?{position:"right",style:"margin-right: 60px"}:{position:"center"},hasNext:a},timeout:1e3})}))}];return d.parameters().then((function(t){return o=t,e.executeStep("settings",r,i)}))},e.finishTour=function(){return n.isOpen()&&n.toggleLeft(!1),m.isLogin()?t.go("app.view_wallet").then((function(){return e.showHelpTip("helptip-wallet-pubkey",{bindings:{content:"HELP.TIP.END_LOGIN",hasNext:!1},timeout:1200})})):o.all([e.showHome(),d.parameters().then((function(e){i=e}))]).then((function(){return e.showHelpTip("helptip-home-logo",{bindings:{content:l.readonly?"HELP.TIP.END_READONLY":"HELP.TIP.END_NOT_LOGIN",contentParams:i,hasNext:!1}})}));var i}}function d(e){e.$on("$ionicView.enter",(function(t,i){e.startHelpTour()}))}if(angular.module("cesium.settings.services",["ngApi","cesium.config"]).factory("csSettings",["$rootScope","$q","$window","Api","localStorage","$translate","csConfig",function(e,t,i,n,a,o,r){var s=[{id:"en",label:"English",flag:"us"},{id:"en-GB",label:"English (UK)",flag:"gb"},{id:"eo-EO",label:"Esperanto",flag:"eo"},{id:"fr-FR",label:"Français",flag:"fr"},{id:"nl-NL",label:"Nederlands",flag:"nl"},{id:"es-ES",label:"Spanish",flag:"es"},{id:"it-IT",label:"Italiano",flag:"it"}],l=r.fallbackLanguage?c(r.fallbackLanguage):"en";function c(e){if(!e)return l;if(_.findWhere(s,{id:e}))return e;var t=e.split("-");if(t.length>1)return c(t[0]);var i=_.find(s,(function(t){return String.prototype.startsWith.call(t.id,e)}));return i?i.id:l}var d,u,E,m,p={STORAGE_KEY:"settings",KEEP_AUTH_IDLE_SESSION:9999},b={timeout:4e3,cacheTimeMs:6e4,timeWarningExpireMembership:5184e3,timeWarningExpire:7776e3,minVersion:"1.1.0",sourceUrl:"https://git.duniter.org/clients/cesium-grp/cesium",sourceLicenseUrl:"https://git.duniter.org/clients/cesium-grp/cesium/-/raw/master/LICENSE",newIssueUrl:"https://git.duniter.org/clients/cesium-grp/cesium/issues/new",userForumUrl:"https://forum.monnaie-libre.fr",latestReleaseUrl:"https://api.github.com/repos/duniter/cesium/releases/latest",duniterLatestReleaseUrl:"https://api.github.com/repos/duniter/duniter/releases/latest",httpsMode:!1},T=angular.merge({useRelative:!1,useLocalStorage:!!i.localStorage,useLocalStorageEncryption:!1,persistCache:!1,walletHistoryTimeSecond:2592e3,walletHistorySliceSecond:432e3,walletHistoryAutoRefresh:!0,rememberMe:!0,keepAuthIdle:600,showUDHistory:!0,expertMode:!1,decimalCount:4,uiEffects:!0,blockValidityWindow:6,helptip:{enable:!0,installDocUrl:"https://duniter.org/en/wiki/duniter/install/",currency:0,network:0,wotLookup:0,wot:0,wotCerts:0,wallet:0,walletCerts:0,wallets:0,header:0,settings:0},currency:{allRules:!1,allWotRules:!1},wallet:{showPubkey:!0,alertIfUnusedWallet:!0},locale:{id:(E=r.defaultLanguage||o.use(),m=c(E),E!==m&&console.debug("[settings] Fix locale [{0}] -> [{1}]".format(E,m)),m)},license:{en:"license/license_g1-en","fr-FR":"license/license_g1-fr-FR","es-ES":"license/license_g1-es-ES"}},b,r),f={},g=!1,N=new n(this,"csSettings"),h=function(){if(angular.isUndefined(d)||!angular.equals(d,f))return d=angular.copy(f),N.data.raise.changed(f)},I=function(){return g?(f.useLocalStorage?!0===f.node.temporary?a.getObject(p.STORAGE_KEY).then((function(e){var t=angular.copy(f);return t.node=e&&e.node||{},delete t.temporary,a.setObject(p.STORAGE_KEY,t)})):a.setObject(p.STORAGE_KEY,f):a.setObject(p.STORAGE_KEY,null)).then((function(){return f.useLocalStorage&&console.debug("[setting] Saved locally"),N.data.raisePromise.store(f)})).then(h):(console.debug("[setting] Waiting start finished..."),(u||R()).then(I))},O=function(e){if(e){var t=!1;if(e.locale&&e.locale.id){var i=c(e.locale.id);e.locale=_.findWhere(s,{id:i}),t=!f.locale||e.locale.id!==f.locale.id||e.locale.id!==o.use()}_.keys(b).forEach((function(t){e[t]=T[t]})),angular.merge(f,e),(e&&e.node&&!e.node.temporary||!f.node.temporary)&&delete f.node.temporary,t&&o.use(f.locale.id)}},v=function(){var e=Date.now();return a.getObject(p.STORAGE_KEY).then((function(t){if(!t)return console.debug("[settings] No settings in local storage. Using defaults."),O(T),void h();O(t),console.debug("[settings] Loaded from local storage in "+(Date.now()-e)+"ms"),h()}))},R=function(){return console.debug("[settings] Starting..."),u=a.ready().then(v).then((function(){console.debug("[settings] Started"),g=!0,u=null,N.data.raise.ready(f)}))};return e.$on("$translateChangeSuccess",(function(){var e=o.use();console.debug("[settings] Locale ["+e+"]");try{moment.locale(e.toLowerCase())}catch(t){try{moment.locale(e.substr(0,2))}catch(e){moment.locale("en-gb"),console.warn("[settings] Unknown local for moment lib. Using default [en]")}}try{numeral.language(e.toLowerCase())}catch(t){try{numeral.language(e.substring(0,2))}catch(e){numeral.language("en-gb"),console.warn("[settings] Unknown local for numeral lib. Using default [en]")}}N.locale.raise.changed(e)})),N.registerEvent("data","reset"),N.registerEvent("data","changed"),N.registerEvent("data","store"),N.registerEvent("data","ready"),N.registerEvent("locale","changed"),O(T),{isStarted:function(){return g},ready:function(){return g?t.when():u||R()},start:R,data:f,apply:O,getByPath:function(e,t){var i=f;return _.each(e.split("."),(function(e){i=i[e],angular.isUndefined(i)&&(i=t)})),i},reset:function(){return _.keys(f).forEach((function(e){delete f[e]})),O(T),N.data.raisePromise.reset(f).then(I)},store:I,restore:v,getLicenseUrl:function(){var e=f.locale&&f.locale.id||r.defaultLanguage||"en";return r.license?r.license[e]?r.license[e]:T.license[r.defaultLanguage||"en"]||r.license:void 0},getFeedUrl:function(){var e=f.locale&&f.locale.id||r.defaultLanguage||"en";return r.feed&&r.feed.jsonFeed?r.feed.jsonFeed[e]?r.feed.jsonFeed[e]:T.feed.jsonFeed[r.defaultLanguage||"en"]||r.feed:void 0},defaultSettings:T,api:N,locales:s,constants:p}}]),angular.module("cesium.network.services",["ngApi","cesium.currency.services","cesium.http.services"]).factory("csNetwork",["$rootScope","$q","$interval","$timeout","$window","csConfig","BMA","csHttp","csCurrency","Api",function(t,i,a,o,r,s,l,c,d,u){var E,m="https:"===r.location.protocol,p=new u(this,"csNetwork"),b={bma:null,listeners:[],loading:!0,peers:[],filter:{member:!0,mirror:!0,endpoint:null,online:!1,bma:!1,ssl:void 0,tor:void 0},sort:{type:null,asc:!0,compact:!0},groupBy:"pubkey",expertMode:!1,knownBlocks:[],mainBlock:null,minOnlineBlockNumber:0,uidsByPubkeys:null,searchingPeersOnNetwork:!1,difficulties:null,ws2pHeads:null,timeout:s.timeout},T=function(e){return e&&[e.number,e.hash].join("-")},f=function(){return b.bma.network.ws2p.heads().then((function(e){b.ws2pHeads=e.heads?e.heads.reduce((function(e,t){if(t.message&&t.sig)try{var i=new n(t.message);e[[i.pubkey,i.ws2pid].join("-")]=i}catch(e){console.error("[network] Ignoring WS2P head.",e&&e.message||e)}return e}),{}):{}})).catch((function(e){if(e&&e.ucode==l.errorCodes.HTTP_LIMITATION)return o((function(){return f()}),3e3);console.error(e),b.ws2pHeads={}}))},g=function(){return b.bma.blockchain.stats.difficulties().then((function(e){b.difficulties=e.levels?e.levels.reduce((function(e,t){return t.uid&&t.level&&(e[t.uid]=t.level),e}),{}):{}})).catch((function(e){if(e&&e.ucode==l.errorCodes.HTTP_LIMITATION)return o((function(){return g()}),3e3);console.error(e),b.difficulties={}}))},N=function(){b.peers=[],b.searchingPeersOnNetwork=!0,b.loading=!0,b.bma=b.bma||l;var t=[];E&&a.cancel(E),E=a((function(){t.length?R(t):b.loading&&!b.searchingPeersOnNetwork&&(b.loading=!1,a.cancel(E),C(!0),console.debug("[network] Finish: {0} peers found.".format(b.peers.length)))}),1e3);var n=[b.bma.wot.member.uids().then((function(e){b.uidsByPubkeys=e})).catch((function(e){console.error(e),b.uidsByPubkeys={}})),f()];return b.expertMode&&n.push(g()),i.all(n).then((function(){return b.bma&&b.bma.network.peers()})).then((function(n){if(n&&n.peers&&n.peers.length){if(!b.filter.online)return i.all(_(n&&n.peers||[]).reduce((function(e,i){return e.concat(I(i,t))}),[]));var a=[];_.forEach(n.peers,(function(e){"UP"===e.status&&(e.blockNumber=e.block&&parseInt(e.block.split("-")[0]),e.blockNumber&&e.blockNumber1)return o.reduce((function(e,i){return e.concat(O(t,i))}),[]);i=o[0]}return n.bma=i,n.server=n.getServer(),n.dns=n.getDns(),n.buid=n.buid||n.block,n.blockNumber=n.buid&&parseInt(n.buid.split("-")[0]),n.uid=n.pubkey&&b.uidsByPubkeys[n.pubkey],n.id=n.keyID(),[n]},v=function(e){if(!h(e))return i.when();if(!b.filter.online||!b.filter.online&&"DOWN"===e.status||!e.getHost())return e.online=!1,i.when(e);if(e.bma.useWs2p&&b.ws2pHeads){var t=[e.pubkey,e.bma.ws2pid].join("-"),n=b.ws2pHeads[t];return delete b.ws2pHeads[t],n&&(e.buid=n.buid,e.currentNumber=n.buid&&parseInt(n.buid.split("-")[0]),e.version=n.version,e.powPrefix=n.powPrefix),e.online=!!e.buid,e.uid&&b.expertMode&&b.difficulties&&(e.difficulty=b.difficulties[e.uid]),i.when(e)}return e.bma.useWs2p||!m||e.bma.useSsl?e.bma.useTor||e.bma.useWs2p?(e.online="UP"===e.status,e.buid=-1,delete e.version,e.uid&&b.expertMode&&b.difficulties&&(e.difficulty=b.difficulties[e.uid]),i.when(e)):(e.api=e.api||l.lightInstance(e.getHost(),e.getPort(),e.isSsl(),b.timeout),e.api.blockchain.current(!1).then((function(t){if(!t)throw new Error("Wrong response for /blockchain/current (empty)");return e.currentNumber=t.number,e.online=!0,e.buid=T(t),e.medianTime=t.medianTime,-1===b.knownBlocks.indexOf(e.buid)&&b.knownBlocks.push(e.buid),e})).catch((function(t){if(t&&t.ucode==l.errorCodes.NO_CURRENT_BLOCK)return e.online=!0,e.buid=T({number:0,hash:l.constants.ROOT_BLOCK_HASH}),e.difficulty=0,e;if(!e.secondTry){var i=e.bma||e.getBMA();if(i.dns&&-1===e.server.indexOf(i.dns))return e.secondTry=!0,e.api=l.lightInstance(i.dns,i.port,i.useSsl),v(e)}return e.buid=null,e.blockNumber=null,e.currentNumber=null,e.online=!1,e.uid=b.uidsByPubkeys[e.pubkey],e})).then((function(e){if(!(b.filter.online&&e&&e.online&&b.expertMode))return e;var t=[];return e.uid&&t.push(e.api.blockchain.stats.hardship({pubkey:e.pubkey}).then((function(t){e.difficulty=t?t.level:null})).catch((function(){e.difficulty=null}))),t.push(e.api.node.summary().then((function(t){e.software=t&&t.duniter&&t.duniter.software||void 0,e.version=t&&t.duniter&&t.duniter.version||"?"})).catch((function(){e.software=void 0,e.version="?"}))),i.all(t).then((function(){return e}))}))):(e.online="UP"===e.status,e.buid=-1,delete e.version,e.uid&&b.expertMode&&b.difficulties&&(e.difficulty=b.difficulties[e.uid]),i.when(e))},R=function(e,t){if((e=e||b.newPeers).length){var i=_.map(b.peers,(function(e){return e.id})),n=!1,a=0;_.forEach(e.splice(0),(function(e){i[e.id]||(b.peers.push(e),i[e.id]=e,n=!0,a++)})),n&&(console.debug("[network] Flushing {0} new peers...".format(a)),C(t))}},A=function(e,t,i){if(!e)return 0;var n=0;t>(e=e.toLowerCase()).length&&(t=e.length),n+=e.charCodeAt(0);for(var a=1;a1,e.hasConsensusBlock&&(e.consensusBlockDelta=t[e.buid].medianTime-n.medianTime)}))),b.peers=_.uniq(b.peers,!1,(function(e){return e.id})),b.peers=_.sortBy(b.peers,(function(e){var i=0;return b.sort.type&&(i+="uid"===b.sort.type?A(e.uid||e.pubkey,3,b.sort.asc):0,i+="api"===b.sort.type&&(e.isWs2p()&&(b.sort.asc?1:-1)||0)+(e.hasEndpoint("ES_USER_API")&&(b.sort.asc?.01:-.01)||0)+(e.isSsl()&&(b.sort.asc?.75:-.75)||0)||0,i+="difficulty"===b.sort.type&&e.difficulty?b.sort.asc?1e4-e.difficulty:e.difficulty:0,i+="current_block"===b.sort.type&&e.currentNumber?b.sort.asc?1e9-e.currentNumber:e.currentNumber:0),i*=1e10,i+=1e9*(e.online?1:0),i+=1e8*(e.hasMainConsensusBlock?1:0),i+=1e6*(e.hasConsensusBlock?t[e.buid].pct:0),b.expertMode?(i+=100*(e.difficulty?1e4-e.difficulty:0),i+=1*(e.uid?A(e.uid,2,!0):0),i+=.001*(e.uid?0:A(e.pubkey,3,!0))):(i+=100*(e.uid?A(e.uid,2,!0):0),i+=.001*(e.uid?0:A(e.pubkey,3,!0))),i+=1e-5*(e.isBma()?e.isSsl()?1:.5:0),e.score=i,-i})),b.groupBy&&b.peers.forEach((function(e){e.compacted=i&&e[b.groupBy]&&e[b.groupBy]===i[b.groupBy],i=e})),e&&n&&n.buid&&(!b.mainBlock||b.mainBlock.buid!==n.buid)&&(b.mainBlock=n,p.data.raise.mainBlockChanged(n)),p.data.raise.changed(b)},S=function(e,t){return t=t||{},l.ready().then((function(){if(L(),b.bma=e||l,b.filter=t.filter?angular.merge(b.filter,t.filter):b.filter,b.sort=t.sort?angular.merge(b.sort,t.sort):b.sort,b.expertMode=angular.isDefined(t.expertMode)?t.expertMode:b.expertMode,b.timeout=angular.isDefined(t.timeout)?t.timeout:s.timeout,b.minOnlineBlockNumber=b.mainBlock&&b.mainBlock.buid&&parseInt(b.mainBlock.buid.split("-")[0])-1e3||void 0,void 0===b.minOnlineBlockNumber)return d.blockchain.current(!0).then((function(e){b.minOnlineBlockNumber=e.number-1e3}))})).then((function(){console.info("[network] Starting network from [{0}]".format(e.server));var t=Date.now();return b.listeners=[b.bma.websocket.block().onListener((function(e){if(e&&!b.loading){var t=[e.number,e.hash].join("-");-1===b.knownBlocks.indexOf(t)&&(console.debug("[network] Receiving block: "+t.substring(0,20)),b.knownBlocks.push(t),1===b.knownBlocks.length||(b.loading=!0,o((function(){console.debug("[network] new block received by WS: will refresh peers"),N()}),2e3,!1)))}})),b.bma.websocket.peer().onListener((function(e){if(e&&!b.loading){var t=[];I(e,t).then((function(e){e&&(t.length>0?R(t,!0):(console.debug("[network] [ws] Peers updated received"),C(!0)))}))}}))],N().then((function(e){return console.debug("[network] Started in "+(Date.now()-t)+"ms"),e}))}))},L=function(){b.bma&&(console.info("[network-service] Stopping..."),_.forEach(b.listeners,(function(e){e()})),b.listeners=[],b.bma=null,b.listeners=[],b.peers.splice(0),b.filter={member:!0,mirror:!0,endpoint:null,online:!0,bma:!1,ssl:void 0,tor:void 0},b.sort={type:null,asc:!0},b.groupBy="pubkey",b.expertMode=!1,b.memberPeersCount=0,b.knownBlocks=[],b.mainBlock=null,b.minOnlineBlockNumber=0,b.uidsByPubkeys={},b.loading=!0,b.searchingPeersOnNetwork=!1,b.difficulties=null,b.ws2pHeads=null,b.timeout=s.timeout)},D=function(e){return b.bma?S().then((function(){return i(e)})):i(e)};return p.registerEvent("data","changed"),p.registerEvent("data","mainBlockChanged"),p.registerEvent("data","rollback"),{data:b,start:S,close:L,hasPeers:function(){return b.peers&&b.peers.length>0},getPeers:function(){return b.peers},sort:function(e){e=e||{},b.filter=e.filter?angular.merge(b.filter,e.filter):b.filter,b.sort=e.sort?angular.merge(b.sort,e.sort):b.sort,C(!1)},getTrustedPeers:function(){return D((function(e,t){e(b.peers.reduce((function(e,t){return t.hasMainConsensusBlock&&t.uid?e.concat(t):e}),[]))}))},getKnownBlocks:function(){return b.knownBlocks},getMainBlockUid:function(){return D((function(e,t){e(b.mainBuid)}))},loadPeers:N,isBusy:function(){return b.loading},api:p}}]),angular.module("cesium.desktop.services",["cesium.device.services","cesium.settings.services"]).factory("csDesktop",["$rootScope","Device",function(e,t){t.isDesktop()&&console.info("Starting desktop mode...")}]),angular.module("cesium.crypto.services",["cesium.utils.services"]).factory("CryptoUtils",["$q","$timeout","ionicReady",function(e,t,i){function n(){this.loaded=!1;var e=this;this.copy=function(t){_.forEach(_.keys(t),(function(i){e[i]=t[i]}))},this.isLoaded=function(){return this.loaded},this.util=this.util||{},this.util.array_to_string=function(e,t){var i=new Blob([new Uint8Array(e)]),n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsText(i)}}n.prototype.constants={crypto_sign_BYTES:64,crypto_secretbox_NONCEBYTES:24,crypto_box_MACBYTES:16,SEED_LENGTH:32,SCRYPT_PARAMS:{SIMPLE:{N:2048,r:8,p:1,memory:-1},DEFAULT:{N:4096,r:16,p:1,memory:-1}}},n.prototype.async_load_base58=function(e){var i=this;if(null!==Base58)return e(Base58);t((function(){i.async_load_base58(e)}),100)},n.prototype.async_load_scrypt=function(e,i){var n=this;null!==scrypt_module_factory?scrypt_module_factory(e,i):t((function(){n.async_load_scrypt(e,i)}),100)},n.prototype.async_load_nacl_js=function(e,i){var n=this;null!==nacl_factory?nacl_factory.instantiate(e,i):t((function(){n.async_load_nacl_js(e,i)}),100)},n.prototype.async_load_base64=function(e){var i=this;null!==Base64?e(Base64):t((function(){i.async_load_base64(e)}),100)},n.prototype.async_load_sha256=function(e){var i=this;if(null!==sha256)return e(sha256);t((function(){i.async_load_sha256(e)}),100)},n.prototype.seed_from_signSk=function(e){for(var t=new Uint8Array(this.constants.SEED_LENGTH),i=0;i"+(o||a["ERROR.UNKNOWN_ERROR"])+"

",title:a["ERROR.POPUP_TITLE"],subTitle:i&&a[i]||void 0,buttons:[{text:""+a["COMMON.BTN_OK"]+"",type:"button-assertive",onTap:function(e){n(e)}}]})}))})):o.when()}function h(e,i,n){return e?((n=n||{}).cssClass=n.cssClass||"info",n.okText=n.okText||"COMMON.BTN_OK",o((function(o){a([e,"INFO.POPUP_TITLE",n.okText].concat(i?[i]:[])).then((function(a){t.show({template:"

"+a[e]+"

",title:a["INFO.POPUP_TITLE"],subTitle:i&&a[i]||void 0,cssClass:n.cssClass,buttons:[{text:a[n.okText],type:"button-positive",onTap:function(e){o(e)}}]})}))}))):o.reject("Missing 'message' argument")}function I(t){return t?c((function(){return e.hide()}),t):e.hide()}function O(t){return T?((t=t||{}).template=t.template||T,e.show(t)):a("COMMON.LOADING").then((function(e){return T=e,O(t)}))}function v(){return f.smallscreen.active}function R(e,t,i){return function(t){var n,a=t.target.width,o=t.target.height,r=i?200:640,s=i?200:480,l=document.createElement("canvas");if(i){a>o?(a*=s/o,o=s):(o*=r/a,a=r),l.width=r,l.height=s,n=l.getContext("2d");var c=Math.trunc((r-a)/2+.5),d=Math.trunc((s-o)/2+.5);n.drawImage(t.target,c,d,r+-2*c,s+-2*d)}else a>o?a>r&&(o*=r/a,a=r):o>s&&(a*=s/o,o=s),l.width=a,l.height=o,(n=l.getContext("2d")).drawImage(t.target,0,0,l.width,l.height);var u=l.toDataURL();l.remove(),e(u)}}function A(e,t){var i=o.defer();(t=t||{}).templateUrl=t.templateUrl?t.templateUrl:"templates/common/popover_copy.html",t.scope=t.scope||m,t.scope.popovers=t.scope.popovers||{},t.autoselect=t.autoselect||!1,t.autoremove=!angular.isDefined(t.autoremove)||t.autoremove,t.backdropClickToClose=!angular.isDefined(t.backdropClickToClose)||t.backdropClickToClose,t.focusFirstInput=!!angular.isDefined(t.focusFirstInput)&&t.focusFirstInput;var n=function(n){(n=n||t.scope.popovers[t.templateUrl]).isResolved=!1,n.deferred=i,n.options=t,t.bindings&&angular.merge(n.scope,t.bindings),c((function(){n.show(e).then((function(){var e;t.autoselect?(e=document.querySelectorAll(t.autoselect)[0])&&(l.getSelection&&!l.getSelection().toString()?(e.setSelectionRange(0,e.value.length),e.focus()):e.focus()):t.autofocus&&(e=document.querySelectorAll(t.autofocus)[0])&&e.focus(),n.scope.$parent.$emit("popover.shown"),t.afterShow&&t.afterShow(n)}))}))},a=function(e){(e=e||t.scope.popovers[t.templateUrl])&&(delete t.scope.popovers[t.templateUrl],e.remove().then((function(){angular.element(l.document.querySelectorAll("body")[0]).removeClass("popover-open")})))},r=t.scope.popovers[t.templateUrl];return r?n(r):u.fromTemplateUrl(t.templateUrl,{scope:t.scope,backdropClickToClose:t.backdropClickToClose}).then((function(e){e.isResolved=!1,e.scope.closePopover=function(t){var i=e.options&&e.options.autoremove;e.options&&delete e.options.autoremove,e.hide().then((function(){if(i)return a(e)})).then((function(){e.deferred&&e.deferred.resolve(t),delete e.deferred,delete e.options}))},e.scope.$on("popover.hidden",(function(){e.options&&e.options.afterHidden&&e.options.afterHidden(),e.options&&e.options.autoremove&&a(e)})),t.scope.$on("$remove",(function(){e.deferred&&e.deferred.resolve(),a()})),t.scope.popovers[t.templateUrl]=e,n(e)})),i.promise}function C(e,t){var i=v()?100:10,n=".list.{0} .item, .list .{0} .item".format(t,t);return{ionListClass:t,show:function(t){return(t=t||{}).selector=t.selector||n,t.ink=!angular.isDefined(t.ink)||t.ink,t.startVelocity=t.startVelocity||(v()?1100:3e3),c((function(){t.ink&&b.ink(),e(t)}),t.timeout||i)}}}function S(e,t,i,n,a){a=a||"default",qrcode.stringToBytes=qrcode.stringToBytesFuncs[a];var o=qrcode(t||4,i||"M");return o.addData(e,n),o.make(),o}function L(e,t){if("string"==typeof e&&(e={selector:e}),void 0===e.selector||""===e.selector)return console.error("invalid toggleOn selector"),!1;c((function(){var t=document.querySelectorAll(e.selector);t&&_.forEach(t,(function(e){e.classList.toggle("on",!0)}))}),t||100)}function D(e,t){if("string"==typeof e&&(e={selector:e}),void 0===e.selector||""===e.selector)return console.error("invalid toggleOff selector"),!1;c((function(){var t=document.querySelectorAll(e.selector);t&&_.forEach(t,(function(e){e.classList.toggle("on",!1)}))}),t||900)}return g.motion={enable:!0,default:C(s.ripple,"animate-ripple"),blinds:C(s.blinds,"animate-blinds"),fadeSlideIn:C(s.fadeSlideIn,"animate-fade-slide-in"),fadeSlideInRight:C(s.fadeSlideInRight,"animate-fade-slide-in-right"),panInLeft:C(s.panInLeft,"animate-pan-in-left"),pushDown:C(s.pushDown,"push-down"),ripple:C(s.ripple,"animate-ripple"),slideUp:C(s.slideUp,"slide-up"),fadeIn:C((function(e){L(e)}),"fade-in"),toggleOn:L,toggleOff:D},b={alert:{error:N,info:h,confirm:function(e,i,n){return i=i||"CONFIRM.POPUP_TITLE",(n=n||{}).cssClass=n.cssClass||"confirm",n.okText=n.okText||"COMMON.BTN_OK",n.cancelText=n.cancelText||"COMMON.BTN_CANCEL",a([e,i,n.cancelText,n.okText]).then((function(a){return t.confirm({template:a[e],cssClass:n.cssClass,title:a[i],cancelText:a[n.cancelText],cancelType:n.cancelType,okText:a[n.okText],okType:n.okType})}))},notImplemented:function(){return h("INFO.FEATURES_NOT_IMPLEMENTED")},demo:function(){return a(["MODE.DEMO.FEATURE_NOT_AVAILABLE","MODE.DEMO.INSTALL_HELP"]).then((function(e){return h(e["MODE.DEMO.FEATURE_NOT_AVAILABLE"]+"

"+e["MODE.DEMO.INSTALL_HELP"],void 0,{cssClass:"large"})}))}},loading:{show:O,hide:I,update:function(t){return e._getLoader().then((function(e){if(e&&e.isShown)return t&&t.template?a(t&&t.template).then((function(i){return t.template=i,e})):void 0})).then((function(e){if(e&&e.isShown)return O(t)}))}},toast:{show:function(t,i,n){return t?(i=i||"short",n=n||"bottom",a([t]).then((function(n){return"string"==typeof i&&(i="short"==i?2e3:5e3),e.show({template:n[t],noBackdrop:!0,duration:i})}))):o.reject("Missing 'message' argument")}},onError:function(e,t){return function(i){var n,a=e;if(i&&i.message?(a=i.message,n=e):e||(a=i),!t)return"CANCELLED"===a?I(10):(I(10),N(a,n));t(a)}},screen:{isSmall:v,fullscreen:d},ink:r.displayEffect,motion:g.motion,setEffects:function(e){if(b.motion.enable!==e){if(console.debug("[UI] [effects] "+(e?"Enable":"Disable")),b.motion.enable=e,e)i.views.transition("platform"),angular.merge(b.motion,g.motion);else{i.views.transition("none");var t={class:void 0,show:function(){}};angular.merge(b.motion,{enable:!1,default:t,fadeSlideIn:t,fadeSlideInRight:t,panInLeft:t,pushDown:t,ripple:t,slideUp:t,fadeIn:t,toggleOn:L,toggleOff:D}),m.motion=t}n.clearCache()}},qrcode:{svg:function(e,t,i,n,a){return S(e,t,i,n,a).createSvgTag()},img:function(e,t,i,n,a){return S(e,t,i,n,a).createImgTag()}},fab:{show:function(e,t){t||(t=900),c((function(){var t=document.getElementsByClassName("button-fab");_.forEach(t,(function(t){t.id==e&&t.classList.toggle("on",!0)}))}),t)},hide:function(e,t){t||(t=10),c((function(){var t=document.getElementsByClassName("button-fab");_.forEach(t,(function(t){t.id==e&&t.classList.toggle("on",!1)}))}),t)}},popover:{show:A,copy:function(e,t){var i=t&&t.indexOf("\n")>=0?t.split("\n").length:1;return A(e,{templateUrl:"templates/common/popover_copy.html",bindings:{value:t,rows:i},autoselect:".popover-copy "+(i<=1?"input":"textarea")})},share:function(e,t){return(t=t||{}).templateUrl=t.templateUrl?t.templateUrl:"templates/common/popover_share.html",t.autoselect=t.autoselect||".popover-share input",t.bindings=t.bindings||{},t.bindings.value=t.bindings.value||t.bindings.url||E.href(E.current,E.params,{absolute:!0}),t.bindings.postUrl=t.bindings.postUrl||t.bindings.value,t.bindings.postMessage=t.bindings.postMessage||"",t.bindings.titleKey=t.bindings.titleKey||"COMMON.POPOVER_SHARE.TITLE",A(e,t)},helptip:function e(t,i){var n="string"==typeof t&&t?l.document.getElementById(t):t;t||n||!i.selector||(n=l.document.querySelector(i.selector));var a=(i=i||{}).deferred||o.defer();if(n&&!i.timeout)i.preAction&&n[i.preAction](),i.templateUrl=i.templateUrl?i.templateUrl:"templates/common/popover_helptip.html",i.autofocus=i.autofocus||"#helptip-btn-ok",i.bindings=i.bindings||{},i.bindings.icon=i.bindings.icon||{},i.bindings.icon.position=i.bindings.icon.position||!1,i.bindings.icon.glyph=i.bindings.icon.glyph||(i.bindings.icon.position&&i.bindings.icon.position.startsWith("bottom-")?"ion-arrow-down-c":"ion-arrow-up-c"),i.bindings.icon.class=i.bindings.icon.class||"calm icon "+i.bindings.icon.glyph,i.bindings.tour=!!angular.isDefined(i.bindings.tour)&&i.bindings.tour,A(n,i).then((function(e){i.postAction&&n[i.postAction](),a.resolve(e)})).catch((function(e){i.postAction&&n[i.postAction](),a.reject(e)}));else if(i.timeout){var r=i.timeout;i.retryTimeout=i.retryTimeout||r,delete i.timeout,i.deferred=a,c((function(){e(t,i)}),r)}else angular.isDefined(i.retry)&&!i.retry?"continue"===i.onError?c((function(){a.resolve(!0)})):c((function(){a.reject("[helptip] element now found: "+t)})):(i.retry=angular.isUndefined(i.retry)?2:i.retry-1,i.deferred=a,c((function(){e(t,i)}),i.timeout||i.retryTimeout||100));return a.promise}},selection:{select:function e(t){if(t.value||"text"==t.type||"textarea"==t.type)l.getSelection&&!l.getSelection().toString()&&t.setSelectionRange(0,t.value.length);else if(t.childNodes&&t.childNodes.length>0)e(t.childNodes[0]);else{var i=l.document.createRange();i.selectNodeContents(t);var n=l.getSelection();n.removeAllRanges(),n.addRange(i)}},get:function(){var e="";return window.getSelection&&(e=l.getSelection().toString()),e}},image:{resizeFile:function(e,t){var i=document.createElement("img");return o((function(n,a){if(e){var o=new FileReader;o.onload=function(e){i.onload=R(n,0,t),i.src=e.target.result},o.readAsDataURL(e)}else a("no file to resize")})).then((function(e){return i.remove(),e}))},resizeSrc:function(e,t){var i=document.createElement("img");return o((function(n,a){i.onload=R(n,0,t),i.src=e})).then((function(e){return i.remove(),e}))},rotateSrc:function(e,t){var i=document.createElement("img");return o((function(t,n){i.onload=function(e,t){var i=Math.PI/180*90;return function(t){var n=t.target.width,a=t.target.height;n>a?n>640&&(a*=640/n,n=640):a>480&&(n*=480/a,a=480);var o=document.createElement("canvas");o.width=a,o.height=n;var r=o.getContext("2d");r.rotate(i),r.drawImage(t.target,0,-1*o.width);var s=o.toDataURL();o.remove(),e(s)}}(t),i.src=e})).then((function(e){return i.remove(),e}))}},raw:g}}]).factory("$focus",["$timeout","$window",function(e,t){return function(i){e((function(){var e=t.document.getElementById(i);e&&e.focus()}))}}]),angular.module("cesium.cache.services",["angular-cache"]).factory("csCache",["$rootScope","$http","$window","csSettings","CacheFactory",function(e,t,i,n,a){var o={VERY_LONG:54e6,LONG:36e5,MEDIUM:3e5,SHORT:n.defaultSettings.cacheTimeMs},r=l(),s=[];function l(e){return(e=e||n.data)&&e.useLocalStorage&&e.persistCache&&i.localStorage?"localStorage":"memory"}function c(e){return(e=e||{}).storageMode=l(),e.deleteOnExpire="localStorage"===e.storageMode||e.onExpire?"aggressive":"passive",e.cacheFlushInterval="passive"===e.deleteOnExpire?36e5:null,e}function d(e){var t=l(e);t!==r&&(r=t,console.debug("[cache] Updating caches with {storageMode: {0}}".format(r)),_.forEach(_.keys(s),(function(e){var t=a.get(e);t&&t.setOptions(c(),!0)})))}return function(){listeners=[n.api.data.on.changed(e,d,this)]}(),{get:function(e,t,i){var n,r=(e=e||"")+((t=t||o.SHORT)/1e3+"s");if(i&&"function"==typeof i){for(var l=1;a.get(r+l);)l++;r+=l}else n=a.get(r);if(s[r]||(s[r]=!0),n)return n;var d=c({maxAge:t,onExpire:i||null});return console.debug("[cache] Creating cache {{0}} with {storageMode: {1}}...".format(r,d.storageMode)),a.createCache(r,d)},clear:function(e){_.forEach(_.keys(s),(function(t){if(t.startsWith(e)){var i=a.get(t);i&&i.removeAll()}}))},clearAll:function(){console.debug("[cache] Cleaning all caches..."),_.forEach(_.keys(s),(function(e){var t=a.get(e);t&&t.removeAll()}))},constants:o}}]),angular.module("cesium.modal.services",["cesium.utils.services"]).controller("EmptyModalCtrl",(function(){})).controller("AboutModalCtrl",["$scope","csConfig","UIUtils","csHttp","filterTranslations",function(e,t,i,n,a){e.openLink=function(e,t,a){return(a=a||{}).onError=function(){return i.popover.copy(e,t)},n.uri.open(t,a)},e.buildDate=moment(t.build).format(a.DATE_PATTERN||"YYYY-MM-DD HH:mm")}]).factory("ModalUtils",["$ionicModal","$rootScope","$q","$injector","$controller","$timeout","Device",function(e,t,i,n,a,o,r){function s(e,t,n){e.deferred=t||i.defer(),e.resolved=!1,e.openModal=function(){return e.modal.show()},e.hideModal=function(){return e.modal.hide()},e.closeModal=function(t){return e.resolved=!0,e.modal.remove().then((function(){return document.body.classList.remove("modal-open"),e.deferred.resolve(t),t}))},e.setForm=function(t,i){i?e[i]=t:e.form=t},e.getParameters=function(){return n},e.$on("modal.hidden",(function(){e.resolved||(e.resolved=!0,o((function(){return e.deferred.resolve(),e.modal.remove().then((function(){document.body.classList.remove("modal-open")}))}),(e.modal.hideDelay||320)+20))}))}return{show:function(n,o,r,l){var c,d,u,E,m=i.defer();if((l=l||{}).animation=l.animation||"slide-in-up",c=!!angular.isDefined(l.focusFirstInput)&&l.focusFirstInput,l.focusFirstInput=c,o){l.scope=l.scope?l.scope.$new():t.$new(),s.call({},l.scope,m,r);var p={$scope:l.scope,parameters:r},b=(u={isControllerAs:!1,controllerName:"",propName:""},E=((d=o)||"").trim().split(/\s+/),u.isControllerAs=3===E.length&&"as"===(E[1]||"").toLowerCase(),u.isControllerAs?(u.controllerName=E[0],u.propName=E[2]):u.controllerName=d,u),T=a(o,p);b.isControllerAs&&(T.openModal=l.scope.openModal,T.closeModal=l.scope.closeModal)}return e.fromTemplateUrl(n,l).then((function(e){if(o)e.scope.$parent.modal=e;else{var t=e.scope;s.call({},t,m,r),t.modal=e}return e.show()}),(function(e){m.reject(e)})),m.promise}}}]).factory("Modals",["$rootScope","$translate","$ionicPopup","$timeout","ModalUtils","UIUtils",function(e,t,i,n,a,o){function r(e){return a.show("templates/join/modal_join_member.html","JoinModalCtrl",e)}function s(e){return a.show("templates/join/modal_join_wallet.html","JoinModalCtrl",e)}return{showTransfer:function(e){var t=o.screen.isSmall();return a.show("templates/wallet/modal_transfer.html","TransferModalCtrl",e,{focusFirstInput:!t})},showLogin:function(e){return a.show("templates/login/modal_login.html","LoginModalCtrl",e,{focusFirstInput:!0,backdropClickToClose:!1})},showWotLookup:function(e){return a.show("templates/wot/modal_lookup.html","WotLookupModalCtrl",e||{},{focusFirstInput:!0})},showNetworkLookup:function(e){return a.show("templates/network/modal_network.html","NetworkLookupModalCtrl",e,{focusFirstInput:!0})},showAbout:function(e){return a.show("templates/modal_about.html","AboutModalCtrl",e)},showJoin:function(e){return a.show("templates/join/modal_choose_account_type.html","JoinChooseAccountTypeModalCtrl",e).then((function(e){if(e)return"member"==e.accountType?r(e):s(e)}))},showJoinMember:r,showJoinWallet:s,showHelp:function(e){return a.show("templates/help/modal_help.html","HelpModalCtrl",e)},showAccountSecurity:function(e){return a.show("templates/wallet/modal_security.html","WalletSecurityModalCtrl",e)},showLicense:function(e){return a.show("templates/currency/modal_license.html","CurrencyLicenseModalCtrl",e)},showSelectPubkeyIdentity:function(e){return a.show("templates/wot/modal_select_pubkey_identity.html","WotSelectPubkeyIdentityModalCtrl",e)},showSelectWallet:function(e){return a.show("templates/wallet/list/modal_wallets.html","WalletSelectModalCtrl",e)},showPassword:function(n){(n=n||{}).title=n.title||"COMMON.SET_PASSWORD_TITLE",n.subTitle=n.subTitle||"COMMON.SET_PASSWORD_SUBTITLE";var a=n.scope?n.scope.$new():e.$new();return a.formData={password:void 0},a.setForm=function(e){a.form=e},a.submit=function(e){a.form.$submitted=!0,e&&e.preventDefault&&e.preventDefault(),a.form.$valid&&a.formData.password&&n.popup.close(a.formData.password)},a.error=n.error||void 0,t([n.title,n.subTitle,"COMMON.BTN_OK","COMMON.BTN_CANCEL"]).then((function(e){return n.popup=i.show({templateUrl:"templates/common/popup_password.html",title:e[n.title],subTitle:e[n.subTitle],scope:a,buttons:[{text:e["COMMON.BTN_CANCEL"]},{text:e["COMMON.BTN_OK"],type:"button-positive",onTap:a.submit}]}),n.popup}))}}}]).factory("csPopovers",["$rootScope","$translate","$ionicPopup","$timeout","UIUtils","$controller",function(e,t,i,n,a,o){return{showSelectWallet:function(t,i){var n=(i=i||{}).parameters||{};delete i.parameters;var r=i.scope&&i.scope.$new()||e.$new(!0);i.scope=r,i.templateUrl="templates/wallet/list/popover_wallets.html",i.autoremove=!0,angular.extend(this,o("WalletSelectPopoverCtrl",{$scope:i.scope,parameters:n}));var s=i.afterShow;return i.afterShow=function(e){r.closePopover=function(t){e.scope.closePopover(t)},s&&s(e)},a.popover.show(t,i).then((function(e){return r.$destroy(),e}))}}}]),angular.module("cesium.http.services",["cesium.cache.services"]).factory("csHttp",["$http","$q","$timeout","$window","csSettings","csCache","Device",function(e,t,i,n,a,o,r){var s=a.data.timeout,l=[],c={};function d(e,t){return e?e+(t&&80!=t&&443!=t?":"+t:""):null}function u(e,t,i,n){return(443==t||n?"https":"http")+"://"+d(e,t)+(i||"")}function E(e,t,i,n){t&&t.message?e(t):403==n?e({ucode:403,message:"Resource is forbidden"+(i?" ("+i+")":"")}):404==n?e({ucode:404,message:"Resource not found"+(i?" ("+i+")":"")}):i?(console.error("[http] Get HTTP error {status: "+n+"} on ["+i+"]"),e("Error while requesting ["+i+"]")):e("Unknown error from node")}function m(e,t,i,n){var a=[],o={},r=e;return"object"==typeof t&&(a=_.keys(t)),_.forEach(a,(function(e){r===(r=r.replace(":"+e,t[e]))&&(o[e]=t[e])})),i.params=o,n(r,i)}function p(e){var t;e.startsWith("duniter://")&&(t="duniter",e=e.replace("duniter://","http://"));var i=document.createElement("a");i.href=e;var n=i.pathname;n&&n.startsWith("/")&&(n=n.substring(1));var a={protocol:t||i.protocol,hostname:i.hostname,host:i.host,port:i.port,username:i.username,password:i.password,pathname:n,search:i.search,hash:i.hash};return i.remove(),a}function b(e,t){var i=e.split("."),n=t.split(".");function a(e){for(var t=0;tn[o]?1:-1}return i.length!=n.length?-1:0}return s||(s=4e3),{get:function(i,n,a,o,r){if(!i)return t.reject("[http] invalid URL from host: "+i);var l=u(i,n,a,o);return function(i){return t((function(t,n){m(l,i,{timeout:r||s,responseType:"json"},(function(i,a){e.get(i,a).success((function(e,i,n,a){t(e)})).error((function(e,t,a,o){E(n,e,i,t)}))}))}))}},getWithCache:function(i,n,a,r,l,d,p,b){var T=u(i,n,a,r);return b=b||"csHttp-",l=l||o.constants.LONG,c[b]=!0,function(i){return t((function(t,n){var a={timeout:p||s,responseType:"json"};a.cache=d?o.get(b,l,(function(t,i,n){console.debug("[http] Refreshing cache for {{0}} ".format(t)),e.get(t,a).success((function(e){a.cache.put(t,e),n&&n(t,e)}))})):o.get(b,l),m(T,i,a,(function(i,a){e.get(i,a).success((function(e){t(e)})).error((function(e,t){E(n,e,i,t)}))}))}))}},post:function(i,n,a,o,r){var l=u(i,n,a,o);return function(i,n){return t((function(t,a){m(l,n,{timeout:r||s,headers:{"Content-Type":"application/json;charset=UTF-8"}},(function(n,o){e.post(n,i,o).success((function(e){t(e)})).error((function(e,t){E(a,e,n,t)}))}))}))}},ws:function(e,n,o,r,s){if(!o)throw console.error("calling csHttp.ws without path argument"),"calling csHttp.ws without path argument";var c=function(e,t,i,n){return(443==t||n?"wss":"ws")+"://"+d(e,t)+(i||"")}(e,n,o,r);function u(e){if(!e.delegate)throw new Error("Websocket {0} was closed!".format(c));return 1==e.delegate.readyState?t.when(e.delegate):3==e.delegate.readyState?t.reject("Unable to connect to websocket ["+e.delegate.url+"]"):(e.waitDuration>=s?(e.waitRetryDelay=e.waitRetryDelay&&Math.min(e.waitRetryDelay+2e3,3e4)||2e3,console.debug("[http] Will retry websocket [{0}] in {1}s...".format(e.path,Math.round(e.waitRetryDelay/1e3)))):Math.round(e.waitDuration/1e3)%10==0&&console.debug("[http] Waiting websocket ["+e.path+"]..."),i((function(){return e.waitDuration+=e.waitRetryDelay,u(e)}),e.waitRetryDelay))}function E(e,t,i){return e.delegate||(e.path=o,e.callbacks=[],e.waitDuration=0,e.waitRetryDelay=200,m(c,i,{},(function(t){e.delegate=new WebSocket(t),e.delegate.onerror=function(t){e.delegate.readyState=3},e.delegate.onmessage=function(t){var i=JSON.parse(t.data);_.forEach(e.callbacks,(function(e){e(i)}))},e.delegate.onopen=function(t){console.debug("[http] Listening on websocket ["+e.path+"]..."),l.push(e),e.delegate.openTime=Date.now()},e.delegate.onclose=function(t){var n=_.findIndex(l,(function(t){return t.path===e.path}));n>=0&&l.splice(n,1),e.delegate.closing?e.delegate=null:e.delegate.openTime?(console.debug("[http] Unexpected close of websocket [{0}] (open {1} ms ago): re-opening...",o,Date.now()-e.delegate.openTime),e.delegate=null,E(e,null,i)):t&&(console.debug("[http] Unexpected close of websocket [{0}]: error code: ".format(o),t&&t.code||t),e.delegate=null,E(e,null,i))}}))),t&&e.callbacks.push(t),u(e)}function p(e){e.delegate&&(e.delegate.closing=!0,console.debug("[http] Closing websocket ["+e.path+"]..."),e.delegate.close(),e.callbacks=[],e.onclose&&e.onclose())}return s=s||a.data.timeout,{open:function(e){return E(this,null,e)},on:function(e,t){return E(this,e,t)},onListener:function(e,t){var i=this;return E(i,e,t),function(){!function(e,t){e.callbacks=_.reject(e.callbacks,(function(e){return e===t})),e.callbacks.length||p(e)}(i,e)}},send:function(e){var t=this;return u(t).then((function(){t.delegate&&t.delegate.send(e)}))},close:function(){p(this)},isClosed:function(){return!this.delegate||this.delegate.closing}}},closeAllWs:function(){l.length>0&&(console.debug("[http] Closing all websocket..."),_.forEach(l,(function(e){e.close()})),l=[])},getUrl:u,getServer:d,uri:{parse:p,open:function(e,t){if(t=t||{},!e.startsWith("http://")&&!e.startsWith("https://")){var i=p(e);if(!i.protocol&&t.type&&(i.protocol="email"==t.type?"mailto:":"phone"==t.type?"tel:":"",e=i.protocol+e),"mailto:"==i.protocol&&r.isDesktop())try{return void(void 0).Shell.openExternal(e)}catch(e){console.error("[http] Failed not open 'mailto:' URI into external tool.")}if("mailto:"!=i.protocol&&"tel:"!=i.protocol||!r.enable)return void(t.onError&&"function"==typeof t.onError&&t.onError(e))}var a,o=t.target||(r.enable?"_system":"_blank");if("_blank"===o||"_system"===o&&r.isDesktop())try{return void(void 0).Shell.openExternal(e)}catch(e){console.error("[http] Failed not open URI into external browser.")}"_blank"===o&&r.isDesktop()&&(a="location=1,titlebar=1,status=1,menubar=1,toolbar=1,resizable=1,scrollbars=1",n.screen&&n.screen.width&&n.screen.height&&(a+=",width={0},height={1}".format(Math.trunc(n.screen.width/2),Math.trunc(n.screen.height/2))));var s=n.open(e,o,a);a&&n.screen&&n.screen.width&&n.screen.height&&(s.moveTo(n.screen.width/2/2,n.screen.height/2/2),s.focus())}},date:{now:function(){return moment().utc().unix()}},version:{compare:b,isCompatible:function(e,t){return console.debug("[http] Checking actual version [{0}] is compatible with min expected version [{1}]".format(t,e)),b(e,t)<=0}},cache:angular.merge({clear:function(e){e=e||"csHttp-",console.debug("[http] Cleaning cache {prefix: '{0}'}...".format(e)),o.clear(e)},clearAll:function(){console.debug("[http] Cleaning all caches..."),_.keys(c).forEach((function(e){o.clear(e)}))}},o.constants)}}]),angular.module("cesium.storage.services",["cesium.config"]).factory("sessionStorage",["$window","$q",function(e,t){var i={storage:e.sessionStorage||{},put:function(e,n){return i.storage[e]=n,t.when()},get:function(e,n){return t.when(i.storage[e]||n)},setObject:function(e,n){return i.storage[e]=JSON.stringify(n),t.when()},getObject:function(e){return t.when(JSON.parse(i.storage[e]||"null"))}};return i}]).factory("localStorage",["$window","$q","$log","sessionStorage",function(e,t,i,n){var a,o=!1,r={standard:{storage:null},secure:{storage:null}};function s(){if(a)return a;var i=Date.now();return(e.localStorage?(console.debug("[storage] Starting {local} storage..."),r.standard.storage=e.localStorage,_.forEach(_.keys(r.standard),(function(e){r[e]=r.standard[e]}))):(console.debug("[storage] Starting {session} storage..."),_.forEach(_.keys(n),(function(e){r[e]=n[e]}))),a=t.when()).then((function(){console.debug("[storage] Started in "+(Date.now()-i)+"ms"),o=!0,a=null}))}return r.standard.put=function(e,i){return angular.isDefined(i)&&null!=i?r.standard.storage[e]=i:r.standard.storage.removeItem(e),t.when()},r.standard.remove=function(e,i){return r.standard.storage.removeItem(e),t.when()},r.standard.get=function(e,i){return t.when(r.standard.storage[e]||i)},r.standard.setObject=function(e,i){return r.standard.storage[e]=JSON.stringify(i),t.when()},r.standard.getObject=function(e){return t.when(JSON.parse(r.standard.storage[e]||"null"))},r.secure.put=function(e,n){return t((function(t,a){null!=n?r.secure.storage.set((function(e){t()}),(function(e){i.error(e),a(e)}),e,n):r.secure.storage.remove((function(){t()}),(function(e){i.error(e),t()}),e)}))},r.secure.get=function(e,n){return t((function(t,a){r.secure.storage.get((function(e){t(!e&&n?n:e)}),(function(e){i.error(e),t()}),e)}))},r.secure.setObject=function(e,n){return i.debug("[storage] Setting object into secure storage, using key="+e),t((function(t,i){r.secure.storage.set(t,i,e,n?JSON.stringify(n):void 0)}))},r.secure.getObject=function(e){return i.debug("[storage] Getting object from secure storage, using key="+e),t((function(t,n){r.secure.storage.get((function(e){t(JSON.parse(e||"null"))}),(function(e){i.error(e),t()}),e)}))},r.isStarted=function(){return o},r.ready=function(){return o?t.when():a||s()},s(),r}]),angular.module("cesium.device.services",["cesium.utils.services","cesium.settings.services"]).factory("Device",["$rootScope","$translate","$ionicPopup","$q","ionicReady",function(e,t,i,n,a){var o,r={enable:!0},s={},l=!1;function c(e){if(!r.enable)return n.reject("Barcode scanner not enable. Please call 'ionicReady()' once before use (e.g in app.js).");var t=n.defer();return cordova.plugins.barcodeScanner.scan((function(e){e.cancelled?(console.debug("[device] barcode scanner scan: CANCELLED"),t.resolve()):(console.debug("[device] barcode scanner scan: "+e.text),t.resolve(e.text))}),(function(e){console.error("[device] Error while using barcode scanner: "+e),t.reject(e)}),e),t.promise}return r.enable=!1,r.clipboard={copy:function(e,t){if(!r.enable)return n.reject("Device disabled");var i=n.defer();return $cordovaClipboard.copy(e).then((function(){t&&t(),i.resolve()}),(function(){i.reject({message:"ERROR.COPY_CLIPBOARD"})})),i.promise}},r.camera={getPicture:function(e){return r.camera.enable?(e&&"string"==typeof e&&(e={sourceType:e}),e=e||{},angular.isUndefined(e.sourceType)?t(["SYSTEM.PICTURE_CHOOSE_TYPE","SYSTEM.BTN_PICTURE_GALLERY","SYSTEM.BTN_PICTURE_CAMERA"]).then((function(t){return i.show({title:t["SYSTEM.PICTURE_CHOOSE_TYPE"],buttons:[{text:t["SYSTEM.BTN_PICTURE_GALLERY"],type:"button",onTap:function(e){return navigator.camera.PictureSourceType.PHOTOLIBRARY}},{text:t["SYSTEM.BTN_PICTURE_CAMERA"],type:"button button-positive",onTap:function(e){return navigator.camera.PictureSourceType.CAMERA}}]}).then((function(t){return console.info("[camera] User select sourceType:"+t),e.sourceType=t,r.camera.getPicture(e)}))})):(e.quality=e.quality||50,e.destinationType=e.destinationType||navigator.camera.DestinationType.DATA_URL,e.encodingType=e.encodingType||navigator.camera.EncodingType.PNG,e.targetWidth=e.targetWidth||400,e.targetHeight=e.targetHeight||400,$cordovaCamera.getPicture(e))):n.reject("Camera not enable. Please call 'ionicReady()' once before use (e.g in app.js).")},scan:function(e){return console.warn("Deprecated use of Device.camera.scan(). Use Device.barcode.scan() instead"),c(e)}},r.barcode={enable:!1,scan:c},r.keyboard={enable:!1,close:function(){r.keyboard.enable&&cordova.plugins.Keyboard.close()}},r.keyboard.digit={settings:{bindModel:function(t,i,n){t=t||e;var a=function(){return(i||"").split(".").reduce((function(e,t){return e?e[t]:void 0}),t)},o=function(e){var n=(i||"").split("."),a=n.length&&n[n.length-1];n.reduce((function(t,i){if(i!=a)return t[i];t[a]=e}),t)};return(n=n||{}).animation=n.animation||"pop",n.action=n.action||function(e){o((a()||"")+e)},n.decimal&&(n.decimalSeparator=n.decimalSeparator||".",n.leftButton={html:".",action:function(){var e=a()||"";e.indexOf(n.decimalSeparator)>=0||(e.trim().length||(e="0"),o(e+n.decimalSeparator))}}),n.rightButton=n.rightButton||{html:'',action:function(){var e=a();e&&e.length&&(e=e.slice(0,-1),o(e))}},n}}},r.isIOS=function(){return!!navigator.userAgent.match(/iPhone | iPad | iPod/i)||ionic.Platform.isIOS()},r.isOSX=function(){return!!navigator.userAgent.match(/Macintosh/i)||ionic.Platform.is("osx")},r.isDesktop=function(){if(!angular.isDefined(s.isDesktop))try{s.isDesktop=(r.enable||process,!1)}catch(e){s.isDesktop=!1}return s.isDesktop},r.isWeb=function(){return!r.enable&&!r.isDesktop()},r.ready=function(){return l?n.when():o||r.start()},r.start=function(){return o=a().then((function(){r.enable=window.cordova&&cordova&&cordova.plugins,r.enable?(r.camera.enable=!!navigator.camera,r.keyboard.enable=cordova&&cordova.plugins&&!!cordova.plugins.Keyboard,r.barcode.enable=cordova&&cordova.plugins&&!!cordova.plugins.barcodeScanner&&!r.isOSX(),r.clipboard.enable=cordova&&cordova.plugins&&!!cordova.plugins.clipboard,r.keyboard.enable&&angular.extend(r.keyboard,cordova.plugins.Keyboard),console.debug("[device] Ionic platform ready, with [camera: {0}] [barcode scanner: {1}] [keyboard: {2}] [clipboard: {3}]".format(r.camera.enable,r.barcode.enable,r.keyboard.enable,r.clipboard.enable)),cordova.InAppBrowser&&console.debug("[device] Enabling InAppBrowser")):console.debug("[device] Ionic platform ready - no device detected."),l=!0,o=null}))},r}]),angular.module("cesium.currency.services",["ngApi","cesium.bma.services"]).factory("csCurrency",["$rootScope","$q","$timeout","BMA","Api","csSettings",function(e,i,n,a,o,r){var s,l,c={WELL_KNOWN_CURRENCIES:{g1:{firstBlockTime:1488987127,medianTimeOffset:3600}}},d={},u=!1,E=new o(this,"csCurrency");function m(){d.name=null,d.parameters=null,d.firstBlockTime=null,d.membersCount=null,d.cache={},d.node=a,d.currentUD=null,d.medianTimeOffset=0,u=!1,s=void 0,E.data.raise.reset(d)}function p(){return i.all([a.blockchain.parameters().then((function(e){return d.name=e.currency,d.parameters=e,d.medianTimeOffset=e.avgGenTime*e.medianTimeBlocks/2,e})).then((function(e){return t=e.currency,c.WELL_KNOWN_CURRENCIES[t]?(angular.merge(d,c.WELL_KNOWN_CURRENCIES[t]),i.when()):a.blockchain.block({block:0}).then((function(e){d.firstBlockTime=e.medianTime})).catch((function(e){if(e&&e.ucode===a.errorCodes.BLOCK_NOT_FOUND)return d.firstBlockTime=0,d.initPhase=!0,void console.warn("[currency] Blockchain not launched: Enable init phase mode");throw e}));var t})),a.blockchain.stats.ud().then((function(e){return e.result.blocks.length?function e(t,i){if(!t.result.blocks.length||i<0)return d.currentUD=d.parameters?d.parameters.ud0:-1,d.currentUD;var n=t.result.blocks[i];return a.blockchain.block({block:n}).then((function(e){var t,i;return d.currentUD=(t=e.dividend,(i=e.unitbase)<=0?t:t*Math.pow(10,i)),d.currentUD})).catch((function(a){if(console.error("[currency] Unable to load last block with UD, with number {0}".format(n)),i>0)return console.error("[currency] Retrying to load UD from a previous block..."),e(t,i-1);throw d.currentUD=null,a}))}(e,e.result.blocks.length-1):(d.currentUD=d.parameters?d.parameters.ud0:-1,d.currentUD)})).catch((function(e){throw d.currentUD=null,e})),E.data.raisePromise.load(d)]).catch((function(e){throw m(),e}))}function b(){return u?i.when(d):s||h()}function T(e){return function(){return u?i.when(d[e]):s||h().then((function(){return d[e]}))}}function f(e){var i=new t(e);i.cleanData(),console.debug("[currency] Received new block {"+i.number+"-"+i.hash+"}"),d.currentBlock=i,d.currentBlock.receivedAt=moment().utc().unix(),d.medianTime=i.medianTime,d.membersCount=i.membersCount,i.dividend&&(d.currentUD=i.dividend),E.data.raise.newBlock(i)}function g(){console.debug("[currency] Stopping..."),_.forEach(l,(function(e){e()})),l=[],m()}function N(){return g(),n(h,200)}function h(t){if(s)return s;if(u)return i.when(d);if(!t)return a.ready().then((function(e){return e?h(e):n(h,500)}));console.debug("[currency] Starting...");var o=Date.now();return s=a.ready().then((function(e){return!!e||n((function(){return h(!0)}),500)})).then(p).then((function(){!function(){l=[a.api.node.on.restart(e,N,this),a.websocket.block().onListener(f)]}(),console.debug("[currency] Started in "+(Date.now()-o)+"ms"),u=!0,s=null,E.data.raise.ready(d)})).then((function(){return d}))}var I=T("currentBlock");function O(e){return I().then((function(t){var i=moment().utc().unix();if(e){if(t&&t.receivedAt&&i-t.receivedAt<60)return t;t||console.warn("[currency] No current block in cache: get it from network. Websocket [/ws/block] may not be started ?")}return a.blockchain.current(!1).catch((function(e){if(e&&e.ucode==a.errorCodes.NO_CURRENT_BLOCK)return{number:0,hash:a.constants.ROOT_BLOCK_HASH,medianTime:i};throw e})).then((function(e){return d.currentBlock=e,d.currentBlock.receivedAt=i,e}))}))}return E.registerEvent("data","ready"),E.registerEvent("data","load"),E.registerEvent("data","reset"),E.registerEvent("data","newBlock"),m(),{ready:function(){return u?i.when(d):s||h()},start:h,stop:g,data:d,get:b,name:T("name"),parameters:T("parameters"),currentUD:T("currentUD"),medianTimeOffset:T("medianTimeOffset"),blockchain:{current:O,lastValid:function(){return r.data.blockValidityWindow<=0?O(!0):O(!0).then((function(e){var t=e.number-r.data.blockValidityWindow;return t>0?a.blockchain.block({block:t}):e}))}},date:{now:function(){return moment().utc().unix()-(d.medianTimeOffset||c.WELL_KNOWN_CURRENCIES.g1.medianTimeOffset)}},api:E,default:function(){return console.warn("[currency] 'csCurrency.default()' has been DEPRECATED - Please use 'csCurrency.get()' instead."),b()}}}]),angular.module("cesium.bma.services",["ngApi","cesium.http.services","cesium.settings.services"]).factory("BMA",["$q","$window","$rootScope","$timeout","csCrypto","Api","Device","UIUtils","csConfig","csSettings","csCache","csHttp",function(e,t,i,n,a,o,r,s,l,c,d,u){function E(r,E,m,p){var b,T=r?"{0}:{1}".format(r,E||(m?"443":"80")):"default",f="[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44}",g="SIG\\(("+f+")\\)",N="OBJ\\(([0-9]+)\\)",h="( ([a-z_][a-z0-9-_.ğĞ]*))?( ([0-9.]+))?( ([0-9a-f:]+))?( ([0-9]+))( (.+))?",I={BMA:"BASIC_MERKLED_API",BMAS:"BMAS",WS2P:"WS2P",BMATOR:"BMATOR",WS2PTOR:"WS2PTOR"},O={USER_ID:"[0-9a-zA-Z-_]+",CURRENCY:"[0-9a-zA-Z-_]+",PUBKEY:f,PUBKEY_WITH_CHECKSUM:"("+f+"):([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{3})",COMMENT:"[ a-zA-Z0-9-_:/;*\\[\\]()?!^\\+=@&~#{}|\\\\<>%.]*",INVALID_COMMENT_CHARS:"[^ a-zA-Z0-9-_:/;*\\[\\]()?!^\\+=@&~#{}|\\\\<>%.]*",URI_WITH_AT:"duniter://(?:([A-Za-z0-9_-]+):)?("+f+"@([a-zA-Z0-9-.]+.[ a-zA-Z0-9-_:/;*?!^\\+=@&~#|<>%.]+)",URI_WITH_PATH:"duniter://([a-zA-Z0-9-.]+.[a-zA-Z0-9-_:.]+)/("+f+")(?:/([A-Za-z0-9_-]+))?",BMA_ENDPOINT:I.BMA+h,BMAS_ENDPOINT:I.BMAS+h,WS2P_ENDPOINT:I.WS2P+" ([a-f0-9]{8})"+h,BMATOR_ENDPOINT:I.BMATOR+" ([a-z0-9-_.]*|[0-9.]+|[0-9a-f:]+.onion)(?: ([0-9]+))?",WS2PTOR_ENDPOINT:I.WS2PTOR+" ([a-f0-9]{8}) ([a-z0-9-_.]*|[0-9.]+|[0-9a-f:]+.onion)(?: ([0-9]+))?(?: (.+))?"},v={PROTOCOL_VERSION:10,ROOT_BLOCK_HASH:"E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855",LIMIT_REQUEST_COUNT:5,LIMIT_REQUEST_DELAY:1e3,regexp:O,api:I},R=this;function A(e,t,i){R.started&&R.stop(),R.alive=!1,c.data&&c.data.node&&(e=e||c.data.node.host,t=t||c.data.node.port,i=angular.isDefined(i)?i:443==t||c.data.node.useSsl||R.forceUseSsl),e&&(R.host=e,R.port=t||80,R.useSsl=angular.isDefined(i)?i:443==R.port||R.forceUseSsl,R.server=u.getServer(e,t),R.url=u.getUrl(e,t,"",i))}function C(e){return new RegExp("^"+e+"$")}function S(e){return new RegExp(e)}function L(){R.raw&&(console.warn("[BMA] Closing all websockets..."),_.keys(R.raw.wsByPath||{}).forEach((function(e){R.raw.wsByPath[e].close()})),R.raw.wsByPath={})}function D(e,t){t=R.useCache&&t||0;var i=e+(t?"#"+t:""),a=function(o){if(!R.started)return R._startPromise||console.warn("[BMA] Trying to get [{0}] before start(). Waiting...".format(e)),R.ready().then((function(){return a(o)}));var r=R.raw.getByPath[i];r||(r=t?u.getWithCache(R.host,R.port,e,R.useSsl,t,null,null,"BMA-"):u.get(R.host,R.port,e,R.useSsl),R.raw.getByPath[i]=r);var l=1;return r(o).catch((function(e){if(e&&e.ucode===M.errorCodes.HTTP_LIMITATION&&l<=M.constants.LIMIT_REQUEST_COUNT)return 1===l&&(console.warn("[BMA] Too many HTTP requests: Will wait then retry..."),s.loading.update({template:"COMMON.LOADING_WAIT"})),n((function(){return l++,r(o)}),M.constants.LIMIT_REQUEST_DELAY);throw e}))};return a}function y(e){var t=function(i,n){if(!R.started)return R._startPromise||console.error("[BMA] Trying to post [{0}] before start()...".format(e)),R.ready().then((function(){return t(i,n)}));var a=R.raw.postByPath[e];return a||(a=u.post(R.host,R.port,e,R.useSsl),R.raw.postByPath[e]=a),a(i,n)};return t}function P(e){return function(){var t=R.raw.wsByPath[e];return t&&!t.isClosed()||((t=u.ws(R.host,R.port,e,R.useSsl)).onclose=function(){delete R.raw.wsByPath[e]},R.raw.wsByPath[e]=t),t}}function k(e){n((function(){M.copy(e.node)}),1e3)}R.raw={getByPath:{},postByPath:{},wsByPath:{}},R.api=new o(this,"BMA-"+T),R.started=!1,R.init=A,R.forceUseSsl=!!("true"===l.httpsMode||!0===l.httpsMode||"force"===l.httpsMode||t.location&&"https:"===t.location.protocol),R.forceUseSsl&&console.debug("[BMA] Enable SSL (forced by config or detected in URL)"),r&&A(r,E,m),R.useCache=!angular.isDefined(p)||p,R.isAlive=function(e){return e=e||R,u.get(e.host,e.port,"/node/summary",e.useSsl)().then((function(e){var t=e&&e.duniter&&e.duniter.software,i=!0;return"duniter"===t&&e.duniter.version?i=u.version.isCompatible(c.data.minVersion,e.duniter.version):console.debug("[BMA] Unknown node software [{0} v{1}]: could not check compatibility.".format(t||"?",e.duniter.version||"?")),i||console.error("[BMA] Incompatible node [{0} v{1}]: expected at least v{2}".format(t,e.duniter.version,c.data.minVersion)),i})).catch((function(){return!1}))},R.isStarted=function(){return R.started},R.ready=function(){return R.started?e.when(R.alive):R._startPromise||R.start()},R.start=function(){if(R._startPromise)return R._startPromise;if(R.started)return e.when(R.alive);if(!R.host)return c.ready().then((function(){return R.init(),R.useCache=!0,R.start()}));console.debug("[BMA] Starting {0} {ssl: {1})...".format(R.server,R.useSsl));var t=Date.now();return R._startPromise=e.all([c.ready(),R.isAlive()]).then((function(e){return R.alive=e[1],R.alive?(b&&b.length||function(){b=[c.api.data.on.changed(i,k,this)]}(),console.debug("[BMA] Started in "+(Date.now()-t)+"ms"),R.api.node.raise.start(),R.started=!0,delete R._startPromise,!0):(console.error("[BMA] Could not start {0} : unreachable".format(R.server)),R.started=!0,delete R._startPromise,!1)})),R._startPromise},R.stop=function(){return R.started||R._startPromise?(console.debug("[BMA] Stopping..."),_.forEach(b,(function(e){e()})),b=[],delete R._startPromise,R.alive?(L(),console.debug("[BMA] Cleaning cache {prefix: '{0}'}...".format("BMA-")),d.clear("BMA-"),R.raw.getByPath={},R.raw.postByPath={},R.raw.wsByPath={},R.alive=!1,R.started=!1,R.api.node.raise.stop()):R.started=!1,e.when()):e.when()},R.restart=function(){return R.stop(),n(R.start,200).then((function(e){return e&&R.api.node.raise.restart(),e}))},R.api.registerEvent("node","start"),R.api.registerEvent("node","stop"),R.api.registerEvent("node","restart");var M={errorCodes:{REVOCATION_ALREADY_REGISTERED:1002,HTTP_LIMITATION:1006,IDENTITY_SANDBOX_FULL:1007,NO_MATCHING_IDENTITY:2001,UID_ALREADY_USED:2003,NO_MATCHING_MEMBER:2004,NO_IDTY_MATCHING_PUB_OR_UID:2021,WRONG_SIGNATURE_MEMBERSHIP:2006,MEMBERSHIP_ALREADY_SEND:2007,NO_CURRENT_BLOCK:2010,BLOCK_NOT_FOUND:2011,SOURCE_ALREADY_CONSUMED:2015,TX_INPUTS_OUTPUTS_NOT_EQUAL:2024,TX_OUTPUT_SUM_NOT_EQUALS_PREV_DELTAS:2025,TX_ALREADY_PROCESSED:2030},constants:v,regexp:{USER_ID:C(O.USER_ID),COMMENT:C(O.COMMENT),PUBKEY:C(O.PUBKEY),PUBKEY_WITH_CHECKSUM:C(O.PUBKEY_WITH_CHECKSUM),CURRENCY:C(O.CURRENCY),URI:C(O.URI),BMA_ENDPOINT:C(O.BMA_ENDPOINT),BMAS_ENDPOINT:C(O.BMAS_ENDPOINT),WS2P_ENDPOINT:C(O.WS2P_ENDPOINT),BMATOR_ENDPOINT:C(O.BMATOR_ENDPOINT),WS2PTOR_ENDPOINT:C(O.WS2PTOR_ENDPOINT),TX_OUTPUT_SIG:C(g),TX_OUTPUT_FUNCTION:S("SIG\\(([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44})\\)|XHX\\(([A-F0-9]{1,64})\\)|CSV\\(([0-9]{1,8})\\)|CLTV\\(([0-9]{1,10})\\)"),TX_OUTPUT_OBJ_OPERATOR_AND:S(N+"([ ]*&&[ ]*("+N+"))+"),TX_OUTPUT_OBJ_OPERATOR_OR:S(N+"([ ]*\\|\\|[ ]*("+N+"))+"),TX_OUTPUT_OBJ:S(N),TX_OUTPUT_OBJ_OPERATOR:S("OBJ\\(([0-9]+)\\)[ ]*(&&)|(\\|\\|)[ ]*OBJ\\(([0-9]+)\\)"),TX_OUTPUT_OBJ_PARENTHESIS:S("\\(("+N+")\\)"),TX_OUTPUT_FUNCTIONS:S("SIG\\(([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44})\\)|XHX\\(([A-F0-9]{1,64})\\)|CSV\\(([0-9]{1,8})\\)|CLTV\\(([0-9]{1,10})\\)([ ]*(&&)|(\\|\\|)[ ]*SIG\\(([123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{43,44})\\)|XHX\\(([A-F0-9]{1,64})\\)|CSV\\(([0-9]{1,8})\\)|CLTV\\(([0-9]{1,10})\\))*")},node:{summary:D("/node/summary",d.constants.LONG),same:function(e){return(e=e||{}).useSsl=angular.isDefined(e.useSsl)?e.useSsl:e.port&&443==e.port,R.host===e.host&&(!R.port&&!e.port2||R.port==e.port2||80)&&R.useSsl===e.useSsl},forceUseSsl:R.forceUseSsl},network:{peering:{self:D("/network/peering"),peers:D("/network/peering/peers")},peers:D("/network/peers"),ws2p:{info:D("/network/ws2p/info"),heads:D("/network/ws2p/heads")}},wot:{lookup:D("/wot/lookup/:search"),certifiedBy:D("/wot/certified-by/:pubkey",d.constants.SHORT),certifiersOf:D("/wot/certifiers-of/:pubkey",d.constants.SHORT),member:{all:D("/wot/members",d.constants.LONG),pending:D("/wot/pending",d.constants.SHORT)},requirements:function(e,t){return!0!==t?M.raw.wot.requirements(e):M.raw.wot.requirementsWithCache(e)},add:y("/wot/add"),certify:y("/wot/certify"),revoke:y("/wot/revoke")},blockchain:{parameters:D("/blockchain/parameters",d.constants.VERY_LONG),block:D("/blockchain/block/:block",d.constants.SHORT),blocksSlice:D("/blockchain/blocks/:count/:from"),current:function(e){return!0!==e?M.raw.blockchain.current():M.raw.blockchain.currentWithCache()},membership:y("/blockchain/membership"),stats:{ud:D("/blockchain/with/ud",d.constants.MEDIUM),tx:D("/blockchain/with/tx"),newcomers:D("/blockchain/with/newcomers",d.constants.MEDIUM),hardship:D("/blockchain/hardship/:pubkey"),difficulties:D("/blockchain/difficulties")}},tx:{sources:D("/tx/sources/:pubkey",d.constants.SHORT),process:y("/tx/process"),history:{all:function(e){return M.raw.tx.history.all(e).then((function(e){return e.history=e.history||{},e.history.sending=[],e.history.pendings=[],e}))},times:function(e,t){return(!0!==t?M.raw.tx.history.times(e):M.raw.tx.history.timesWithCache(e)).then((function(e){return e.history=e.history||{},e.history.sending=[],e.history.pendings=[],e}))},blocks:D("/tx/history/:pubkey/blocks/:from/:to",d.constants.LONG),pending:D("/tx/history/:pubkey/pending")}},ud:{history:D("/ud/history/:pubkey")},uri:{},version:{},raw:{blockchain:{currentWithCache:D("/blockchain/current",d.constants.SHORT),current:D("/blockchain/current")},wot:{requirementsWithCache:D("/wot/requirements/:pubkey",d.constants.LONG),requirements:D("/wot/requirements/:pubkey")},tx:{history:{timesWithCache:D("/tx/history/:pubkey/times/:from/:to",d.constants.LONG),times:D("/tx/history/:pubkey/times/:from/:to"),all:D("/tx/history/:pubkey")}}}};M.tx.parseUnlockCondition=function(e){for(var t,i,n,a,o=e,r=[],s={},l=M.regexp.TX_OUTPUT_FUNCTION.exec(o);l;)t={},i="OBJ("+r.length+")",t.type=o.substr(l.index,l[0].indexOf("(")),t.value=l[1]||l[2]||l[3]||l[4],r.push(t),s[t.type]=s[t.type]++||1,o=o.replace(l[0],i),l=M.regexp.TX_OUTPUT_FUNCTION.exec(o);for(var c=!0;c;){for(c=!!(l=M.regexp.TX_OUTPUT_OBJ_OPERATOR_AND.exec(o));l;){for(t={},i="OBJ("+r.length+")",t.type="AND",t.children=[],r.push(t),n=l[0],a=M.regexp.TX_OUTPUT_OBJ.exec(n);a;)t.children.push(r[a[1]]),n=n.replace(a[0],""),a=M.regexp.TX_OUTPUT_OBJ.exec(n);o=o.replace(l[0],i),l=M.regexp.TX_OUTPUT_OBJ_OPERATOR_AND.exec(n)}for(l=M.regexp.TX_OUTPUT_OBJ_OPERATOR_OR.exec(o),c=c||!!l;l;){for(t={},i="OBJ("+r.length+")",t.type="OR",t.children=[],r.push(t),n=l[0],a=M.regexp.TX_OUTPUT_OBJ.exec(n);a;)t.children.push(r[a[1]]),n=n.replace(a[0],""),a=M.regexp.TX_OUTPUT_OBJ.exec(n);o=o.replace(l[0],i),l=M.regexp.TX_OUTPUT_OBJ_OPERATOR_AND.exec(o)}for(l=M.regexp.TX_OUTPUT_OBJ_PARENTHESIS.exec(o),c=c||!!l;l;)o=o.replace(l[0],l[1]),l=M.regexp.TX_OUTPUT_OBJ_PARENTHESIS.exec(o)}if(0!==(s=_.keys(s)).length)return console.debug("[BMA] Unlock conditions successfully parsed:",t),{unlockFunctions:s,unlockTree:t};console.error("[BMA] Unparseable unlock condition: ",output)},M.node.parseEndPoint=function(e,t){var i=M.regexp.BMA_ENDPOINT.exec(e);return i?{dns:i[2]||"",ipv4:i[4]||"",ipv6:i[6]||"",port:i[8]||80,useSsl:i[8]&&443==i[8],path:i[10],useBma:!0}:(i=M.regexp.BMAS_ENDPOINT.exec(e))?{dns:i[2]||"",ipv4:i[4]||"",ipv6:i[6]||"",port:i[8]||80,useSsl:!0,path:i[10],useBma:!0}:(i=M.regexp.BMATOR_ENDPOINT.exec(e))?{dns:i[1]||"",port:i[2]||80,useSsl:!1,useTor:!0,useBma:!0}:(i=M.regexp.WS2P_ENDPOINT.exec(e))?{ws2pid:i[1]||"",dns:i[3]||"",ipv4:i[5]||"",ipv6:i[7]||"",port:i[9]||80,useSsl:i[9]&&443==i[9],path:i[11]||"",useWs2p:!0}:(i=M.regexp.WS2PTOR_ENDPOINT.exec(e))?{ws2pid:i[1]||"",dns:i[2]||"",port:i[3]||80,path:i[4]||"",useSsl:!1,useTor:!0,useWs2p:!0}:t&&(i=C(t+h).exec(e))?{dns:i[2]||"",ipv4:i[4]||"",ipv6:i[6]||"",port:i[8]||80,useSsl:i[8]&&443==i[8],path:i[10],useBma:!1}:void 0},M.copy=function(e){if(u.getUrl(e.host,e.port,"",e.useSsl)!==R.url){var t=R.started;if(t&&R.stop(),R.init(e.host,e.port,e.useSsl,R.useCache),t)return n((function(){return R.start().then((function(e){return e&&R.api.node.raise.restart(),e}))}),200)}},M.wot.member.uids=function(){return M.wot.member.all().then((function(e){return e.results.reduce((function(e,t){return e[t.pubkey]=t.uid,e}),{})}))},M.wot.member.get=function(e){return M.wot.member.uids().then((function(t){var i=t[e];return{pubkey:e,uid:i||null}}))},M.wot.member.getByUid=function(e){return M.wot.member.all().then((function(t){return _.findWhere(t.results,{uid:e})}))},M.blockchain.blocks=function(e){return M.raw.getHttpRecursive(M.blockchain.block,"block",e)},M.network.peering.peersByLeaves=function(e){return M.raw.getHttpRecursive(M.network.peering.peers,"leaf",e,0,10)},M.raw.getHttpRecursive=function(t,i,a,o,r){return o=angular.isDefined(o)?o:0,r=r||M.constants.LIMIT_REQUEST_COUNT,e((function(s,l){var c=[],d=[];_.each(a.slice(o,o+r),(function(e){var n={};n[i]=e,d.push(t(n).then((function(e){e&&c.push(e)})))})),e.all(d).then((function(){o0?e.dividend*Math.pow(10,e.unitbase):e.dividend}))}))},M.uri.parse=function(t){return e((function(e,i){var n;if(C(O.PUBKEY).test(t))e({pubkey:t});else if(C(O.PUBKEY_WITH_CHECKSUM).test(t)){console.debug("[BMA.parse] Detecting a pubkey with checksum: "+t);var o=M.regexp.PUBKEY_WITH_CHECKSUM.exec(t);n=o[1];var r=o[2];console.debug("[BMA.parse] Detecting a pubkey {"+n+"} with checksum {"+r+"}");var s=a.util.pkChecksum(n);console.debug("[BMA.parse] Expecting checksum for pubkey is {"+s+"}"),r!=s?i({message:"ERROR.PUBKEY_INVALID_CHECKSUM"}):e({pubkey:n})}else if(t.startsWith("duniter://")){var l,c=u.uri.parse(t),d=-1===c.host.indexOf(".")?c.host:null,E=-1!==c.host.indexOf(".")?c.host:null;if(c.username&&(c.password?(l=c.username,n=c.password):n=c.username),c.pathname){var m=c.pathname.split("/"),p=m?m.length:0,b=0;if(!d&&p>b&&(d=m[b++]),!n&&p>b&&(n=m[b++]),!l&&p>b&&(l=m[b++]),p>b)return void i({message:"Bad Duniter URI format. Invalid path (incomplete or redundant): "+c.pathname})}if(d)return E||e({uid:l,pubkey:n,currency:d}),u.get(E+"/blockchain/parameters")().then((function(t){t.currency===d?e({uid:l,pubkey:n,host:E,currency:d}):i({message:"Node's currency ["+t.currency+"] does not matched URI's currency ["+d+"]."})})).catch((function(e){console.error(e),i({message:"Could not get node parameter. Currency could not be retrieve"})}));if(!E)return void i({message:"Bad Duniter URI format. Missing currency name (or node address)."});u.get(E+"/blockchain/parameters")().then((function(t){e({uid:l,pubkey:n,host:E,currency:t.currency})})).catch((function(e){console.error(e),i({message:"Could not get node parameter. Currency could not be retrieve"})}))}else console.debug("[BMA.parse] Could not parse URI: "+t),i({message:"ERROR.UNKNOWN_URI_FORMAT"})})).then((function(e){if(e){if(e.pubkey&&!C(O.PUBKEY).test(e.pubkey))throw{message:"Invalid pubkey format ["+e.pubkey+"]"};if(e.uid&&!C(O.USER_ID).test(e.uid))throw{message:"Invalid uid format ["+e.uid+"]"};if(e.currency&&!C(O.CURRENCY).test(e.currency))throw{message:"Invalid currency format ["+e.currency+"]"};return e}}))};var U=c.data.duniterLatestReleaseUrl&&u.uri.parse(c.data.duniterLatestReleaseUrl);M.raw.getLatestRelease=U?u.getWithCache(U.host,U.port,"/"+U.pathname,443==+U.port||"https:"===U.protocol||R.forceUseSsl,d.constants.LONG):function(){return e.when()},M.version.latest=function(){return M.raw.getLatestRelease().then((function(e){if(e)return e.name&&e.html_url?{version:e.name,url:e.html_url}:e.tag_name&&e.html_url?{version:e.tag_name.substring(1),url:e.html_url}:void 0})).catch((function(e){console.error("[BMA] Failed to get Duniter latest version",e)}))},M.websocket={block:P("/ws/block"),peer:P("/ws/peer"),close:L},angular.merge(R,M)}var m=new E;return m.instance=function(e,t,i,n){return new E(e,t,i,n=!!angular.isDefined(n)&&n)},m.lightInstance=function(e,t,i,n){return{host:e,port:t=t||80,useSsl:i=angular.isDefined(i)?i:443==t,url:u.getUrl(e,t,"",i),node:{summary:u.getWithCache(e,t,"/node/summary",i,d.constants.MEDIUM,!1,n)},network:{peering:{self:u.get(e,t,"/network/peering",i,n)},peers:u.get(e,t,"/network/peers",i,n)},blockchain:{current:u.get(e,t,"/blockchain/current",i,n),stats:{hardship:u.get(e,t,"/blockchain/hardship/:pubkey",i,n)}}}},m}]),angular.module("cesium.wot.services",["ngApi","cesium.bma.services","cesium.crypto.services","cesium.utils.services","cesium.settings.services"]).factory("csWot",["$rootScope","$q","$timeout","BMA","Api","CacheFactory","UIUtils","csConfig","csCurrency","csSettings","csCache",function(e,t,i,n,a,o,r,s,l,c,d){var u=new a(this,"csWot"),E=d.get("csWot-idty-",d.constants.MEDIUM),m=d.get("csWot-requirements-",d.constants.MEDIUM),p=function(e){var t={};return e.reduce((function(e,i){return i.id=i.id||i.uid+"-"+i.pubkey,t[i.id]?e:(t[i.id]=!0,e.concat(i))}),[])},b=function(e,t,i){return t=t||0,e=p(e),e=_.sortBy(e,(function(e){var t=1;return t+=1e6*e.block,-(t+=10*(900-e.uid.toLowerCase().charCodeAt(0)))})),angular.isDefined(i)&&e.length>i&&(e=e.slice(t,t+i)),e},T=function(e){e.requirements={loaded:!1,meta:{},hasSelf:!1,needSelf:!0,needMembership:!0,canMembershipOut:!1,needRenew:!1,pendingMembership:!1,isMember:!1,wasMember:!1,certificationCount:0,needCertifications:!1,needCertificationCount:0,willNeedCertificationCount:0,alternatives:void 0},e.blockUid=null,e.isMember=!1,e.sigDate=null,e.hasSelf=!1},f=function(e,t){if(e.hasSelf=!!e.meta.timestamp,e.needSelf=!e.hasSelf||e.meta.invalid,e.wasMember=!!angular.isDefined(e.wasMember)&&e.wasMember,e.needMembership=!e.revoked&&e.membershipExpiresIn<=0&&e.membershipPendingExpiresIn<=0&&!e.wasMember,e.needRenew=!e.needMembership&&!e.revoked&&e.membershipExpiresIn<=c.data.timeWarningExpireMembership&&e.membershipPendingExpiresIn<=0||e.wasMember&&!e.revoked&&0===e.membershipExpiresIn&&0===e.membershipPendingExpiresIn,e.canMembershipOut=!e.revoked&&e.membershipExpiresIn>0,e.pendingMembership=!e.revoked&&e.membershipExpiresIn<=0&&e.membershipPendingExpiresIn>0,e.isMember=!e.revoked&&e.membershipExpiresIn>0,e.blockUid=e.meta.timestamp,e.certificationCount=(e.isMember||e.wasMember&&!e.expired)&&e.certifications?e.certifications.length:0,e.willExpireCertificationCount=e.certifications?e.certifications.reduce((function(e,t){return e+(t.expiresIn<=c.data.timeWarningExpire?1:0)}),0):0,e.willExpire=e.willExpireCertificationCount>0,e.pendingRevocation=!e.revoked&&!!e.revocation_sig,e.isMember||e.wasMember)e.pendingCertificationCount=angular.isDefined(e.pendingCerts)?e.pendingCerts.length:0;else{var i=_.union(_.pluck(e.pendingCerts||[],"from"),_.pluck(e.certifications||[],"from"));e.pendingCertificationCount=_.size(i)}return e.needCertificationCount=!e.needSelf&&e.certificationCount1&&(n=_.sortBy(n,(function(e){var t=0;t+=1e12*(s.uid&&e.uid===s.uid?1:0),t+=1e11*(e.meta.invalid?0:1),t+=1e10*(s.blockUid&&e.meta.timestamp&&e.meta.timestamp===s.blockUid?1:0),t+=1e9*(e.membershipExpiresIn>0?1:0),t+=1e8*(e.membershipPendingExpiresIn>0?1:0),t+=1e7*(e.expired?0:1),t+=1e6*(e.outdistanced?0:1),t+=1e5*(e.wasMember?1:0);var i=!e.expired&&e.certifications?e.certifications.length:0;return t+=1*(i||0),-(t+=1*(!i&&e.membershipPendingExpiresIn>0?e.membershipPendingExpiresIn/1e3:0))})),console.debug("[wot] Found {0} identities (in requirements). Will selected the best one".format(n.length))),s.requirements=f(n[0],i.parameters),s.pubkey=s.requirements.pubkey,s.uid=s.requirements.uid,s.isMember=s.requirements.isMember,s.blockUid=s.requirements.meta&&s.requirements.meta.timestamp,s.hasSelf=s.requirements.hasSelf,s.sigDate=s.requirements.meta&&s.requirements.meta.time,!s.requirements.isMember&&!s.requirements.wasMember&&n.length>1&&(s.requirements.alternatives=n.splice(1),_.forEach(s.requirements.alternatives,(function(e){f(e,i.parameters)}))),m.put(o,s),angular.merge(e,s),console.debug("[wot] Requirements for '{0}' loaded in {1}ms".format(s.pubkey&&s.pubkey.substring(0,8)||s.uid,Date.now()-c)),e})).catch((function(t){if(s.requirements={loaded:!0},T(e),t&&(t.ucode==n.errorCodes.NO_MATCHING_MEMBER||t.ucode==n.errorCodes.NO_IDTY_MATCHING_PUB_OR_UID))return e.requirements.loaded=!0,e;throw t}))},h=function(e,t){var i={pubkey:e,uid:t,hasSelf:!1};return n.wot.lookup({search:e||t}).then((function(e){var t=e.results.reduce((function(e,t){return e.concat(t.uids.reduce((function(e,i){var n=i.meta.timestamp.split("-",2),a=parseInt(n[0]);return e.concat({uid:i.uid,pubkey:t.pubkey,meta:{timestamp:i.meta.timestamp,number:a,hash:n[1],sig:i.self},revoked:i.revoked,revoked_on:i.revoked_on})}),[]))}),[]);return g(t).then((function(t){return{identities:t,results:e.results}}))})).then((function(e){var t=e.identities;t.length>1&&(e.identities=_.sortBy(t,(function(e){var t=0;return t+=1e11*(i.uid&&e.uid===i.uid?1:0),t+=1e10*(e.meta.invalid?0:1),t+=1e9*(i.blockUid&&e.meta.timestamp&&e.meta.timestamp===i.blockUid?1:0),t+=1e8*(e.revoked?0:1),-(t+=1*(e.meta.number?e.meta.number:0)/1e3)})),console.debug("[wot] Found {0} identities (in lookup). Will selected the best one".format(t.length))),_.forEach(t,(function(e){e.hasSelf=!!(e.uid&&e.meta.timestamp&&e.meta.sig)})),i.requirements=t[0],i.pubkey=i.requirements.pubkey,i.uid=i.requirements.uid,i.blockUid=i.requirements.meta&&i.requirements.meta.timestamp,i.hasSelf=i.requirements.hasSelf, i.sigDate=i.requirements.meta&&i.requirements.meta.time,t.length>1&&(i.requirements.alternatives=t.splice(1)),i.lookup={};var n={};return i.lookup.certifications=(e.results||[]).reduce((function(e,t){return t.uids.reduce((function(e,t){var i=t.uid+"-"+(t.meta?t.meta.timestamp:"");return e[i]=(t.others||[]).reduce((function(e,t){var a=i+"-"+t.pubkey,o={pubkey:t.pubkey,uid:t.uids[0],cert_time:{block:t.meta&&t.meta.block_number?t.meta.block_number:0,block_hash:t.meta&&t.meta.block_hash?t.meta.block_hash:null},isMember:t.isMember,wasMember:t.wasMember};return n[a]?o.cert_time.block>n[a].cert_time.block?(n[a]=o,e.splice(_.findIndex(e,{pubkey:t.pubkey}),1,o),e):e:(n[a]=o,e.concat(o))}),[]),e}),e)}),{}),n={},i.lookup.givenCertifications=(e.results||[]).reduce((function(e,t){return(t.signed||[]).reduce((function(e,t){var i={pubkey:t.pubkey,uid:t.uid,cert_time:{block:t.cert_time&&t.cert_time.block?t.cert_time.block:0,block_hash:t.cert_time&&t.cert_time.block_hash?t.cert_time.block_hash:null},sigDate:t.meta?t.meta.timestamp:null,isMember:t.isMember,wasMember:t.wasMember};if(n[t.pubkey]){if(!(i.block>n[t.pubkey].block))return e;n[t.pubkey]=i}else n[t.pubkey]=i;return e.concat(i)}),e)}),[]),i})).catch((function(e){if(e&&e.ucode==n.errorCodes.NO_MATCHING_IDENTITY)return T(i),i;throw e}))},I=function(e,t,i,a,o,r){function s(e,t){return e+"-"+t}var d=!0,u=i?i.reduce((function(e,t){var i=s(t.pubkey,t.cert_time?t.cert_time.block:t.sigDate);return t.cert_time||(d=!1),e[i]=t,e}),{}):{};return e({pubkey:t}).then((function(e){return(e&&e.certifications||[]).reduce((function(e,t){var i=!t.written,n=t.cert_time?t.cert_time.medianTime:null,r=n?i?n+a.sigWindow-o:n+a.sigValidity-o:0;r=r<0?0:r;var l=s(t.pubkey,d&&t.cert_time?t.cert_time.block:t.sigDate);return delete u[l],e.concat({pubkey:t.pubkey,uid:t.uid,time:n,isMember:t.isMember,wasMember:t.wasMember,expiresIn:r,willExpire:r&&r<=c.data.timeWarningExpire,pending:i,block:null!==t.written?t.written.number:t.cert_time?t.cert_time.block:null,valid:r>0})}),[])})).catch((function(e){if(e&&e.ucode==n.errorCodes.NO_MATCHING_MEMBER)return[];if(e&&1002==e.ucode)return console.warn("[wallet-service] Detecting Duniter issue #1309 ! Applying workaround... "),[];throw e})).then((function(e){var t=_.values(u);if(!t.length)return e;if(l.data.initPhase)return t.reduce((function(e,t){return e.concat({pubkey:t.pubkey,uid:t.uid,isMember:t.isMember,wasMember:t.wasMember,time:null,expiresIn:a.sigWindow,willExpire:!1,pending:!0,block:0,valid:!0})}),e);var i=t.reduce((function(e,t){var i=d&&t.cert_time?t.cert_time.block:t.sigDate?t.sigDate.split("-")[0]:null;return angular.isDefined(i)&&(e[i]?e[i].push(t):e[i]=[t]),e}),{});return n.blockchain.blocks(_.keys(i)).then((function(t){return e=t.reduce((function(e,t){return e.concat(i[t.number].reduce((function(e,i){var n=t.medianTime,s=Math.max(0,n+a.sigWindow-o),l=!i.cert_time||!i.cert_time.block_hash||i.cert_time.block_hash==t.hash;l||console.debug("[wot] Invalid cert {0}: block hash changed".format(i.pubkey.substring(0,8)));var u=s>0&&(!r||i.isMember)&&l;return e.concat({pubkey:i.pubkey,uid:i.uid,isMember:i.isMember,wasMember:i.wasMember,time:n,expiresIn:s,willExpire:s&&s<=c.data.timeWarningExpire,pending:!0,block:d&&i.cert_time?i.cert_time.block:i.sigDate?i.sigDate.split("-")[0]:null,valid:u})}),[]))}),e)}))})).then((function(e){var t=e.reduce((function(e,t){return!t.pending&&t.valid&&t.expiresIn>=a.sigWindow&&(e[t.pubkey]=!0),e}),{});e=function(e){return _.sortBy(e,(function(e){var t=1;return t+=1e12*(e.expiresIn?e.expiresIn:0),t+=1e7*(e.isMember?1:0),-(t+=10*(e.block?e.block:0))}))}(e);var i=[],n=[];return{valid:e.reduce((function(e,a){return a.pending?(a.valid&&!t[a.pubkey]?i.push(a):a.valid||t[a.pubkey]||n.push(a),e):e.concat(a)}),[]),pending:i,error:n}}))},O=function(e,i,a){var o;if(a=a||{},!e&&i&&!a.force)return n.wot.member.getByUid(i).then((function(t){if(t)return O(t.pubkey,t.uid,n);var n=angular.copy(n||{});return n.force=!0,O(e,i,n)}));if(e){if((o=!1!==a.cache?E.get(e):null)&&(!i||o.uid===i)&&(!a.blockUid||o.blockUid===a.blockUid))return console.debug("[wot] Identity {{0}} found in cache".format(e.substring(0,8))),t.when(o);console.debug("[wot] Loading identity {{0}}...".format(e.substring(0,8))),o={pubkey:e,uid:i}}else console.debug("[wot] Loading identity from uid {{0}}...".format(i)),o={uid:i};a.blockUid&&(o.blockUid=a.blockUid);var r,s,c=Date.now();return t.all([l.parameters().then((function(e){r=e})),l.blockchain.current(!0).then((function(e){s=e.medianTime})).catch((function(e){if(!e||e.ucode!=n.errorCodes.NO_CURRENT_BLOCK)throw e;s=moment.utc().unix()})),N(o,!1!==a.cache),h(e,i)]).then((function(e){var i=e[3];if(!o.requirements.uid)return console.debug("[wot] No requirements found: using data from lookup"),angular.merge(o,i),void delete o.lookup;var a=o.requirements.uid+"-"+o.requirements.meta.timestamp;return t.all([I(n.wot.certifiersOf,o.pubkey,i.lookup?i.lookup.certifications[a]:null,r,s,!0).then((function(e){o.received_cert=e.valid,o.received_cert_pending=e.pending,o.received_cert_error=e.error})),I(n.wot.certifiedBy,o.pubkey,i.lookup?i.lookup.givenCertifications:null,r,s,!1).then((function(e){o.given_cert=e.valid,o.given_cert_pending=e.pending,o.given_cert_error=e.error}))])})).then((function(){return o.requirements.pendingCertificationCount=o.received_cert_pending?o.received_cert_pending.length:o.requirements.pendingCertificationCount,o.requirements.revoked=angular.isDefined(o.requirements.revoked)?o.requirements.revoked:o.revoked,function(e){e.requirements.revoked?(delete e.requirements.meta.invalid,e.requirements.revoked_on?(S(e,{type:"error",message:"ERROR.IDENTITY_REVOKED_WITH_TIME",messageParams:{revocationTime:e.requirements.revoked_on}}),console.debug("[wot] Identity [{0}] has been revoked on {1}".format(e.uid,e.requirements.revoked_on))):(S(e,{type:"error",message:"ERROR.IDENTITY_REVOKED"}),console.debug("[wot] Identity [{0}] has been revoked".format(e.uid)))):e.requirements.pendingRevocation?(delete e.requirements.meta.invalid,S(e,{type:"error",message:"ERROR.IDENTITY_PENDING_REVOCATION"}),console.debug("[wot] Identity [{0}] has pending revocation".format(e.uid))):e.requirements.meta&&e.requirements.meta.invalid?e.isMember||(S(e,{type:"error",message:"ERROR.IDENTITY_INVALID_BLOCK_HASH"}),console.debug("[wot] Invalid membership for uid {0}: block hash changed".format(e.uid))):e.requirements.expired?(S(e,{type:"error",message:"ERROR.IDENTITY_EXPIRED"}),console.debug("[wot] Identity {0} expired (in sandbox)".format(e.uid))):e.requirements.willNeedCertificationCount>0?(S(e,{type:"error",message:"INFO.IDENTITY_WILL_MISSING_CERTIFICATIONS",messageParams:e.requirements}),console.debug("[wot] Identity {0} will need {1} certification(s)".format(e.uid,e.requirements.willNeedCertificationCount))):!e.requirements.needSelf&&e.requirements.needMembership&&(S(e,{type:"error",message:"INFO.IDENTITY_NEED_MEMBERSHIP"}),console.debug("[wot] Identity {0} has a self but no membership".format(e.uid))),!e.isMember&&e.requirements.alternatives&&S(e,{type:"info",message:"INFO.HAS_ALTERNATIVE_IDENTITIES"})}(o),u.data.raisePromise.load(o).catch((function(e){console.debug("Error while loading identity data, on extension point."),console.error(e)}))})).then((function(){if(o.pubkey)return E.put(o.pubkey,o),console.debug("[wot] Identity "+o.pubkey.substring(0,8)+" loaded in "+(Date.now()-c)+"ms"),o}))},v=function(e,i){if(!e||e.trim()!==e)return t.when(void 0);var a=e.replace(/(^|\s)#\w+/g,"");return a=(a=a.replace(/[^a-zA-Z0-9_-\s]+/g,"")).replace(/\s+/g," ").trim(),(i=i||{}).addUniqueId=!angular.isDefined(i.addUniqueId)||i.addUniqueId,i.allowExtension=!angular.isDefined(i.allowExtension)||i.allowExtension,i.excludeRevoked=!!angular.isDefined(i.excludeRevoked)&&i.excludeRevoked,(a?t.all(a.split(" ").reduce((function(e,t){return console.debug("[wot] Will search on: '"+t+"'"),e.concat(n.wot.lookup({search:t}))}),[])).then((function(e){return e.reduce((function(e,t){return e.concat(t.results.reduce((function(e,t){return e.concat(t.uids.reduce((function(e,n){var a=n.meta.timestamp.split("-",2),o=!n.revoked&&n.revocation_sig;return i.excludeRevoked&&o?e:e.concat({uid:n.uid,pubkey:t.pubkey,number:a[0],hash:a[1],revoked:o})}),[]))}),[]))}),[])})).catch((function(e){if(e&&e.ucode==n.errorCodes.NO_MATCHING_IDENTITY)return[];throw e})):t.when([])).then((function(t){if(!i.allowExtension)return i.addUniqueId?p(t):t;var a=t.length;return u.data.raisePromise.search(e,t,"pubkey").then((function(){if(t.length>a&&_.filter(t,(function(e){return!e.uid&&e.pubkey})).length)return n.wot.member.uids().then((function(e){_.forEach(t,(function(t){!t.uid&&t.pubkey&&(t.uid=e[t.pubkey])}))}))})).then((function(){return i.addUniqueId?p(t):t}))}))},R=function(e,a,o,r){return t((function(s,l){var c=[],d=[];_.each(e.slice(a,a+o),(function(e){d.push(n.blockchain.block({block:e}).then((function(e){e&&e.joiners&&_.each(e.joiners,(function(t){var i=t.split(":"),n=i[i.length-1]+"-"+i[0];c.push({id:n,uid:i[i.length-1],pubkey:i[0],memberDate:e.medianTime,block:e.number})}))})))})),t.all(d).then((function(){c.lengthi.block)return;c[t.pubkey]=t,l[t.block]?l[t.block].push(t):l[t.block]=[t],i&&(l[i.block]=l[i.block].reduce((function(e,t){return t.pubkey==i.pubkey?e:(e||[]).concat(t)}),null),null===l[i.block]&&delete l[i.block])}}));var d=_.values(c),u=d.length,E=(d=b(d,e,i)).reduce((function(e,t){return e.concat(t.block)}),[]);return t.all([n.blockchain.blocks(_.uniq(E)).then((function(e){_.forEach(e,(function(e){_.forEach(l[e.number],(function(t){t.sigDate=e.medianTime,0!==e.number&&t.blockHash!==e.hash&&(S(t,{type:"error",message:"ERROR.WOT_PENDING_INVALID_BLOCK_HASH"}),console.debug("Invalid membership for uid={0}: block hash changed".format(t.uid)))}))}))})),C(d,"pubkey",!0)]).then((function(){return console.debug("[ES] [wot] Loaded {0}/{1} pending identities in {2} ms".format(d&&d.length||0,u,Date.now()-a)),{hits:d,total:u}}))}}))},all:function(){return A(["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","u","v","w","x","y","z"],0,n.constants.LIMIT_REQUEST_COUNT).then((function(e){return C(e,"pubkey",!0)})).then(p).then((function(){return{hits:idties,total:idties.length}}))},extend:function(e,t,i){return C([e],t,i).then((function(e){return e[0]}))},extendAll:C,api:u}}]),angular.module("cesium.tx.services",["ngApi","cesium.bma.services","cesium.settings.services","cesium.wot.services"]).factory("csTx",["$q","$timeout","$filter","$translate","FileSaver","UIUtils","BMA","Api","csConfig","csSettings","csWot","csCurrency",function(e,t,i,n,a,o,r,s,l,c,d,u){var E=new s(this,"csTx");function m(e,t,i,n,a){t&&t.length&&_.forEach(t,(function(t){if(null!==t.block_number||a){var o,s,l=!1,c=t.issuers.reduce((function(t,i){return l=l||i===e,i!==e?t.concat(i):t}),[]),d=[],u=[],E=t.outputs.reduce((function(i,n,a){var E="string"==typeof n?n.split(":",3):[n.amount,n.base,n.conditions];o=parseInt(E[1]);var m=b(parseInt(E[0]),o),p=E[2],T=r.regexp.TX_OUTPUT_SIG.exec(p);if(T){var f=T[1];if(f===e){if(!l)return i+m;null===t.block_number&&u.push({amount:parseInt(E[0]),base:o,type:"T",identifier:t.hash,noffset:a,consumed:!1,conditions:p})}else if(""===f||_.contains(c,f)||d.push(f),l)return i-m}else if(-1!==p.indexOf("SIG("+e+")")){var g=r.tx.parseUnlockCondition(p);if(g)return u.push(angular.merge({amount:parseInt(E[0]),base:o,type:"T",identifier:t.hash,noffset:a,conditions:p,consumed:!1},g)),g.amount=m,(s=s||[]).push(g),console.debug("[tx] has locked output:",g),i+m}return i}),0),m=E>0?c:d,p=t.time||t.blockstampTime,T=0!==E&&E+":"+t.hash+":"+p;if(T&&!n[T]){n[T]=!0;var f={time:p,amount:E,pubkey:1===m.length?m[0]:void 0,pubkeys:m.length>1?m:void 0,comment:t.comment,isUD:!1,hash:t.hash,locktime:t.locktime,block_number:t.block_number};l&&null===t.block_number&&(f.inputs=t.inputs,f.sources=u),s&&(f.lockedOutputs=s),i.push(f)}}}))}function p(t,i){return e((function(n,a){var o=moment().utc().unix();i=i||o-c.data.walletHistoryTimeSecond;var s={pendings:[],validating:[],history:[],errors:[]},l={},d=[u.blockchain.current(!0),r.tx.history.pending({pubkey:t}).then((function(e){m(t,e.history.sending,s.pendings,l,!0),m(t,e.history.pending,s.pendings,l,!0)}))];if("pending"!==i){var p=function(e){m(t,e.history.sent,s.history,l,!1),m(t,e.history.received,s.history,l,!1)};if(i>0){for(var b=c.data.walletHistorySliceSecond,T=i-=i%b;T-b0&&d.push(E.data.raisePromise.loadUDs({pubkey:t,fromTime:i}).then((function(e){e&&e.length&&_.forEach(e,(function(e){s.history.push(e)}))})).catch((function(e){console.debug("Error while loading UDs history, on extension point."),console.error(e)})))}e.all(d).then((function(e){var t=e[0];s.history.sort((function(e,t){return t.time-e.time}));var a=_.findIndex(s.history,(function(e){return e.block_number<=t.number-c.data.blockValidityWindow}));s.validating=a>0?s.history.splice(0,a):[],s.fromTime="pending"!==i&&i||void 0,s.toTime=s.history.length?s.history[0].time:s.fromTime,n(s)})).catch(a)}))}function b(e,t){return t<=0?e:e*Math.pow(10,t)}function T(e,t){_(t).forEach((function(t){!function(e,t,i){var n=e.type+":"+e.identifier+":"+e.noffset;angular.isUndefined(i[n])&&(t.push(e),i[n]=t.length-1)}(t,e.sources,e.sourcesIndexByKey)}))}function f(e){return r.tx.sources({pubkey:e}).then((function(e){var t={sources:[],sourcesIndexByKey:[],balance:0};return e.sources&&e.sources.length&&(_.forEach(e.sources,(function(e){e.consumed=!1,t.balance+=b(e.amount,e.base)})),T(t,e.sources)),t})).catch((function(e){throw console.warn("[tx] Error while getting sources...",e),e}))}function g(i,n){var a,r=Date.now();return t((function(){a||o.loading.update({template:"COMMON.LOADING_WAIT"})}),2e3),e.all([f(i),p(i,n)]).then((function(e){(a=e[0]).tx=e[1];var t=[],i=[],n=a.balance,o=a.balance;function s(e){var n=[],r=!0;e.amount>0?r=!1:(_.find(e.inputs,(function(e){var t=e.split(":").slice(2).join(":"),i=a.sourcesIndexByKey[t];if(!angular.isDefined(i))return r=!1,!0;n.push(a.sources[i])})),e.sources&&T(a,e.sources),delete e.sources,delete e.inputs),r?(o+=e.amount,t.push(e),_.forEach(n,(function(e){e.consumed=!0}))):i.push(e)}for(var l=a.tx.pendings,c=!0;l&&l.length;)_.forEach(l,s),i.length>0&&t.length>0&&c?(l=i,i=[],c=!1):l=null;a.tx=a.tx||{},a.tx.pendings=t.sort((function(e,t){return t.time-e.time})),a.tx.errors=i.sort((function(e,t){return t.time-e.time})),a.balance=o<0?n:o;var u=(a.tx.history||[]).concat(a.tx.validating||[],a.tx.pendings||[],a.tx.errors||[]);return d.extendAll(u,"pubkey").then((function(){return console.debug("[tx] TX and sources loaded in "+(Date.now()-r)+"ms"),a}))})).catch((function(e){throw console.warn("[tx] Error while getting sources and tx...",e),e}))}return E.registerEvent("data","loadUDs"),{load:g,loadSources:function(e){return console.debug("[tx] Loading sources for "+e.substring(0,8)),g(e,"pending")},downloadHistoryFile:function(t,r){return(r=r||{}).fromTime=r.fromTime||-1,console.debug("[tx] Exporting TX history for pubkey [{0}]".format(t.substr(0,8))),e.all([n(["ACCOUNT.HEADERS.TIME","COMMON.UID","COMMON.PUBKEY","COMMON.UNIVERSAL_DIVIDEND","ACCOUNT.HEADERS.AMOUNT","ACCOUNT.HEADERS.COMMENT"]),u.blockchain.current(!0),g(t,r.fromTime)]).then((function(e){var r=e[0],s=e[1],l=s&&s.medianTime||moment().utc().unix(),c=s&&s.currency,d=e[2];return d&&d.tx&&d.tx.history?n("ACCOUNT.FILE_NAME",{currency:c,pubkey:t,currentTime:l}).then((function(e){var t=i("formatDecimal"),n=i("medianDate"),o=i("currencySymbolNoHtml"),s=[r["ACCOUNT.HEADERS.TIME"],r["COMMON.UID"],r["COMMON.PUBKEY"],r["ACCOUNT.HEADERS.AMOUNT"]+" ("+o(c)+")",r["ACCOUNT.HEADERS.COMMENT"]],l=d.tx.history.concat(d.tx.validating).reduce((function(e,i){return e.concat([n(i.time),i.uid,i.pubkey,t(i.amount/100),'"'+(i.isUD?r["COMMON.UNIVERSAL_DIVIDEND"]:i.comment)+'"'].join(";")+"\n")}),[s.join(";")+"\n"]),u=new Blob(l,{type:"text/plain; charset=utf-8"});a.saveAs(u,e)})):o.toast.show("INFO.EMPTY_TX_HISTORY")}))},api:E}}]),angular.module("cesium.wallet.services",["ngApi","ngFileSaver","cesium.bma.services","cesium.crypto.services","cesium.utils.services","cesium.settings.services"]).factory("csWallet",["$q","$rootScope","$timeout","$translate","$filter","$ionicHistory","UIUtils","Api","Idle","localStorage","sessionStorage","Modals","CryptoUtils","csCrypto","BMA","csConfig","csSettings","FileSaver","Blob","csWot","csTx","csCurrency",function(e,t,n,a,o,r,s,l,c,d,u,E,m,p,b,T,f,g,N,h,I,O){var v,R=b;function A(b,A){var C,S,L,D,y,P,k=(A=A||R).constants.PROTOCOL_VERSION,M=A.constants.PROTOCOL_VERSION,U=A.constants.PROTOCOL_VERSION,w=A.constants.PROTOCOL_VERSION,B=A.constants.PROTOCOL_VERSION,H={},F=!1,x=new l(this,"csWallet-"+b),W=function(e){H.loaded=!1,H.pubkey=null,H.qrcode=null,H.uid=null,H.localName=null,H.isNew=null,H.sourcesIndexByKey=null,H.medianTime=null,H.requirements={},H.blockUid=null,H.sigDate=null,H.sigStock=null,H.isMember=!1,H.events=[],H.children=[],H.encryptedData=null,Y(),V(),D=!1,y=void 0,e?x.data.raise.init(H):(G()&&S&&!S.useLocalStorage&&f.reset(),x.data.raise.reset(H))},Y=function(){H.keypair={signSk:null,signPk:null}},V=function(){H.sources=void 0,H.sourcesIndexByKey=void 0,H.balance=0,H.tx=H.tx||{},H.tx.history=[],H.tx.pendings=[],H.tx.validating=[],H.tx.errors=[],delete H.tx.fromTime,delete H.tx.toTime},G=function(){return"default"===b},K=function(){return H.encryptedData&&H.encryptedData.nonce&&H.encryptedData.content},z=function(e){H.sources=H.sources||[],H.sourcesIndexByKey=H.sourcesIndexByKey||{},_(e).forEach((function(e){!function(e,t,i){var n=e.type+":"+e.identifier+":"+e.noffset;angular.isUndefined(i[n])&&(e.conditions||console.warn("Trying to add a source without output condition !",e),t.push(e),i[n]=t.length-1)}(e,H.sources,H.sourcesIndexByKey)}))},j=function(t){if(!D)return(y||Ye()).then((function(){return j(t)}));var i=!X(),a=t&&(t.auth&&!J()||t.forceAuth);if(!i&&!a)return ee(t)?e.when(H):pe(t);var o,r=f.data.keepAuthIdle>0;return(t&&t.authData?e.when(t.authData):E.showLogin(t)).then((function(e){if(!e||!e.pubkey||!i&&e.pubkey!==H.pubkey||a&&(!e.keypair||!e.keypair.signPk||!e.keypair.signSk))throw"CANCELLED";if(o=e,H.pubkey=o.pubkey,H.uid=o.uid||H.uid,H.isNew=t&&angular.isDefined(t.isNew)?t.isNew:H.isNew,r&&(H.keypair=o.keypair||{signSk:null,signPk:null}),i)return x.data.raisePromise.loginCheck(H).catch((function(e){throw W(),e})).then((function(){if(i)return x.data.raisePromise.login(H).catch((function(e){console.warn("Error during extension call [wallet.api.data.on.login]",e)}))}))})).then((function(){return i?se():a?Ue():void 0})).then((function(){if(i&&ne(),a||J())return we(!0),x.data.raisePromise.auth(r?H:o)})).then((function(){var e=!i&&t&&t.minData?{minData:!0}:void 0;if(!ee(e))return pe(e)})).then((function(){return t&&t.silent?s.loading.hide(10):s.loading.hide(1e3),r?H:angular.merge({},H,o)})).catch((function(e){if(!("RETRY"!==e||t&&t.authData))return n((function(){return j(t)}),300);throw e}))},q=function(){var t=J();return e((function(e,i){var n=H.pubkey;W(),ae(n),x.data.raise.logout(),t&&x.data.raise.unauth(),we(!1),r.clearCache(),e()}))},X=function(){return!!H.pubkey},$=function(t){return D?T.readonly||T.demo?s.alert.demo().then((function(){throw"CANCELLED"})):!J()||t&&t.forceAuth?((t=t||{}).expectedPubkey=X()&&H.pubkey,t.auth=!0,j(t)):e.when(H):(y||Ye()).then((function(){return $(t)}))},Q=function(){return e((function(e,t){Y(),ne(),x.data.raise.unauth(),we(!1),r.clearCache(),e()}))},J=function(){return H.pubkey&&H.keypair&&H.keypair.signSk&&!0},Z=function(t){return D?J()?e.when(H.keypair):((t=t||{}).silent=!angular.isDefined(t.silent)||t.silent,$(t).then((function(){return H.keypair}))):(y||Ye()).then((function(){return Z(t)}))},ee=function(e){if(e){if(e.minData&&!e.sources)return H.loaded&&!0;if(e.requirements&&!H.requirements.loaded)return!1;if(e.tx&&e.tx.enable&&(!H.tx.fromTime||"pending"===H.tx.fromTime))return!1;if(e.sigStock&&!H.sigStock)return!1}return H.loaded&&H.sources&&!0},te=function(){if(H.loaded)return!H.pubkey||!(H.isMember||H.requirements.pendingMembership||H.requirements.revoked||!H.requirements.needSelf||H.requirements.wasMember||H.sources&&H.sources.length>0||H.tx.history.length>0||H.tx.validating.length>0||H.tx.pendings.length>0||H.localName||H.name||H.avatar)},ie=function(){return!!H.isNew},ne=function(t){if(t=t&&"string"==typeof t?t:H.pubkey,S&&S.useLocalStorage){if(X()&&S.rememberMe){var i=Date.now();console.debug("[wallet] Storing...");var n=[];return S.keepAuthIdle==f.constants.KEEP_AUTH_IDLE_SESSION&&J()?n.push(u.put("seckey",m.util.encode_base58(H.keypair.signSk))):n.push(u.put("seckey",null)),n.push(d.put("pubkey",H.pubkey)),H.uid?n.push(d.put("uid",H.uid)):n.push(d.put("uid",null)),e.all(n).then((function(){console.debug("[wallet] Stored in "+(Date.now()-i)+"ms")}))}return e.all([u.put("seckey",null),d.put("pubkey",null),d.put("uid",null),t?u.put("data-"+t,null):e.when()])}return e.all([u.put("seckey",null),d.put("pubkey",null),d.put("uid",null),t?u.put("data-"+t,null):e.when(),t?d.put("data-"+t,null):e.when()])},ae=function(t){return console.debug("[wallet] Resetting stored pubkey (and uid) in local storage..."),u.put("seckey",null),d.put("pubkey",null),d.put("uid",null),S&&S.useLocalStorage?t?u.put("data-"+t,null):e.when():(console.debug("[wallet] Resetting stored data in local storage..."),e.all([t?u.put("data-"+t,null):e.when(),t?d.put("data-"+t,null):e.when()]))},oe=function(){if(!X())throw{message:"ERROR.NEED_LOGIN_FIRST"};var t,i,n=S&&S.useLocalStorageEncryption,a="data-"+H.pubkey;H.notifications&&H.notifications.time&&((t=t||{}).notifications={time:H.notifications.time}),H.invitations&&H.invitations.time&&((t=t||{}).invitations={time:H.invitations.time}),H.children&&H.children.length&&((t=t||{}).childrenCount=H.children.length,(i=i||{}).children=_.map(H.children,(function(e){return{pubkey:e.data.pubkey,uid:e.data.uid,localName:e.data.localName}})));var o=(t||i)&&JSON.stringify(angular.merge({},t||{},i||{}));return n&&i?J()?e.all([m.util.random_nonce(),m.box.keypair.fromSignKeypair(H.keypair),u.put(a,o||null)]).then((function(e){var n=e[0],o=e[1];return m.box.pack(JSON.stringify(i),n,o.boxPk,o.boxSk).then((function(e){return t=angular.merge(t||{},{encryptedData:{nonce:m.util.encode_base58(n),content:e}}),d.put(a,JSON.stringify(t))}))})):u.put(a,o||null):e.all([u.put(a,null),d.put(a,o||null)])},re=function(){return e.all([u.get("seckey"),d.get("pubkey"),d.get("uid")]).then((function(e){var t=e[0],i=e[1],n=e[2];if(i&&"null"!=i){var a;if(console.debug("[wallet] Restore {"+i.substring(0,8)+"} from local storage"),t&&t.length&&"null"!=t)try{a={signPk:m.util.decode_base58(i),signSk:m.util.decode_base58(t)}}catch(e){console.warn("[wallet] Secret key restoration failed: ",e),a=void 0}return H.pubkey=i,H.uid=n&&"null"!=n?n:void 0,H.keypair=a||{signPk:void 0,signSk:void 0},se()}})).then((function(){return J()?e.all([x.data.raisePromise.login(H),we(!0),x.data.raisePromise.auth(H)]).catch((function(e){console.warn("Error during extension call [wallet.api.data.on.auth]",e)})):X()?x.data.raisePromise.login(H).catch((function(e){console.warn("Error during extension call [wallet.api.data.on.login]",e)})):void 0})).then((function(){return H}))},se=function(){if(!X())throw{message:"ERROR.NEED_LOGIN_FIRST"};return ie()?e.when(H):e.all([u.getObject("data-"+H.pubkey),d.getObject("data-"+H.pubkey)]).then((function(e){var t=e[0],i=e[1];return t&&t.children&&t.children.length===i.childrenCount?le(t).catch((function(e){return console.error("[wallet] Failed to restore from the session storage ! Retrying from the local storage...",e),le(i)})):le(i)}))},le=function(t){if(!t)return e.when();if(t.children){var i=H.childrenCount,n=ye({stop:!1,store:!1});try{var a={};_.forEach(t.children,(function(e){if(!a[e.pubkey]){a[e.pubkey]=!0;var t=ke();t.data.pubkey=e.pubkey,t.data.localName=e.localName,t.data.uid=e.uid,De(t,{store:!1})}})),delete t.children,delete H.childrenCount}catch(t){return console.error("[wallet] Failed to restore children wallet.",t),H.childrenCount=i,H.children=n,e.reject({message:"ERROR.RESTORE_WALLET_LIST_FAILED"})}_.forEach(n||[],(function(e){e.stop()}))}return delete t.pubkey,delete t.uid,angular.merge(H,t),K()&&J()?Ue({store:!1}).then((function(){return H})):e.when(H)},ce=function(e,t){return Le("requirements"),h.loadRequirements(H,e).catch((function(i){if(!t)return console.error("[wallet] Unable to load requirements (first try): {0}. Retrying once...".format(i&&i.message||i),i),s.loading.update({template:"COMMON.LOADING_WAIT"}),ce(e,!0);throw console.error("[wallet] Unable to load requirements (after a second try): {0}".format(i&&i.message||i),i),i}))},de=function(e){return I.load(H.pubkey,e).then((function(e){V(),angular.merge(H,e)})).catch((function(e){throw V(),e}))},ue=function(){H.requirements.revoked?(delete H.requirements.meta.invalid,Ae({type:"info",message:"ERROR.WALLET_REVOKED",context:"requirements"})):H.requirements.pendingRevocation?(delete H.requirements.meta.invalid,Ae({type:"pending",message:"INFO.REVOCATION_SENT_WAITING_PROCESS",context:"requirements"})):(!H.isMember&&H.requirements.meta&&H.requirements.meta.invalid?(Ae({type:"error",message:"ERROR.WALLET_INVALID_BLOCK_HASH",context:"requirements"}),console.debug("Invalid membership for uid={0}: block hash changed".format(H.uid))):!H.isMember&&H.requirements.expired?(Ae({type:"error",message:"ERROR.WALLET_IDENTITY_EXPIRED",context:"requirements"}),console.debug("Identity expired for uid={0}.".format(H.uid))):H.requirements.pendingMembership?(Ae({type:"pending",message:"ACCOUNT.WAITING_MEMBERSHIP",context:"requirements"}),!H.requirements.needCertificationCount&&H.requirements.outdistanced&&Ae({type:"warn",message:"ACCOUNT.OUT_DISTANCED",context:"requirements"})):!H.requirements.needSelf&&H.requirements.needMembership&&Ae({type:"warn",message:"ACCOUNT.NO_WAITING_MEMBERSHIP",context:"requirements"}),H.requirements.needRenew?H.isMember&&H.requirements.membershipExpiresIn>0?Ae({type:"warn",message:"ACCOUNT.WILL_NEED_RENEW_MEMBERSHIP",messageParams:H.requirements,context:"requirements"}):!H.isMember&&H.requirements.membershipExpiresIn>0&&H.requirements.needCertificationCount>0?Ae({type:"warn",message:"ACCOUNT.NEED_RENEW_MEMBERSHIP_AFTER_CANCELLED",messageParams:H.requirements,context:"requirements"}):Ae({type:"warn",message:"ACCOUNT.NEED_RENEW_MEMBERSHIP",messageParams:H.requirements,context:"requirements"}):(H.requirements.needCertificationCount>0&&(Ae({type:"info",message:"ACCOUNT.WAITING_CERTIFICATIONS",messageParams:H.requirements,context:"requirements"}),H.requirements.wasMember||Ae({type:"help",message:"ACCOUNT.WAITING_CERTIFICATIONS_HELP",messageParams:H.requirements,context:"requirements"})),H.requirements.willNeedCertificationCount>0&&Ae({type:"warn",message:"ACCOUNT.WILL_MISSING_CERTIFICATIONS",messageParams:H.requirements,context:"requirements"}),H.requirements.wasMember&&H.requirements.needMembership&&Ae({type:"warn",message:"ACCOUNT.NEED_RENEW_MEMBERSHIP",messageParams:H.requirements,context:"requirements"}),H.requirements.needCertificationCount||H.requirements.willNeedCertificationCount||!H.requirements.outdistanced||Ae({type:"warn",message:"ACCOUNT.OUT_DISTANCED",context:"requirements"})))},Ee=function(){return A.wot.certifiedBy({pubkey:H.pubkey}).then((function(e){H.sigStock=e.certifications?e.certifications.reduce((function(e,t){return null===t.written?e:e+1}),0):0})).catch((function(e){if(e&&e.ucode==A.errorCodes.NO_MATCHING_MEMBER)H.sigStock=0;else{if(!e||1002!=e.ucode)throw e;console.warn("[wallet-service] Detecting Duniter issue #1309 ! Applying workaround... "),H.sigStock=0}}))},me=function(){return!H.pubkey||H.qrcode?e.when(H.qrcode):(console.debug("[wallet] Creating SVG QRCode..."),n((function(){return H.qrcode=s.qrcode.svg(H.pubkey),H.qrcode})))},pe=function(t){var i=!O.data.initPhase&&(!f.data.wallet||f.data.wallet.alertIfUnusedWallet)&&!H.loaded&&(!t||!t.minData||!t.silent);return P?P.then((function(){return ee(t)?H:_e(t)})):(P=t&&t.minData?Te(t):t||H.loaded?_e(t):be(),e.all([P,me()]).then((function(){var e=te();return!(i&&!ie()&&!0===e)||s.loading.hide().then((function(){return s.alert.confirm("CONFIRM.LOGIN_UNUSED_WALLET","CONFIRM.LOGIN_UNUSED_WALLET_TITLE",{cancelText:"COMMON.BTN_CONTINUE",okText:"COMMON.BTN_RETRY"})})).then((function(e){return e?q().then((function(){throw"RETRY"})):(f.data.wallet.alertIfUnusedWallet&&(f.data.wallet.alertIfUnusedWallet=!1,f.store()),!0)}))})).then((function(e){if(P=null,e)return H;throw"CANCELLED"})))},be=function(t){H.loaded=!1;var i=Date.now();return console.debug("[wallet] Loading {{0}} full data...".format(H.pubkey&&H.pubkey.substr(0,8))),e.all([ce(!0).then((function(e){if(e.requirements&&(e.requirements.isMember||e.requirements.wasMember))return Ee();e.sigStock=0})),de(t||"pending")]).then((function(){return ue(),x.data.raisePromise.load(H).catch((function(e){console.error("[wallet] Error during load API extension point. Try to continue",e)}))})).then((function(){return H.loaded=!0,console.debug("[wallet] Loaded {{0}} full data in {1}ms".format(H.pubkey&&H.pubkey.substr(0,8),Date.now()-i)),s.loading.hide(1e3),H})).catch((function(e){throw H.loaded=!1,e}))},Te=function(t){return(t=t||{}).requirements=angular.isDefined(t.requirements)?t.requirements:!H.requirements.loaded||angular.isUndefined(H.requirements.needSelf),t.requirements?_e(t).then((function(e){return e.loaded=!0,e})):e.when(H)},_e=function(t){(t=t||{requirements:!0,sources:!0,tx:{enable:!0,fromTime:H.tx&&"pending"!==H.tx.fromTime?H.tx.fromTime:void 0},sigStock:!0,api:!0}).requirements=angular.isDefined(t.requirements)?t.requirements:!H.requirements.loaded,angular.isUndefined(t.sources)&&t.tx&&t.tx.enable&&(t.sources=!0);var i=[],n=Date.now();return console.debug("[wallet] {0} {{1}} data, with options: ".format(H.loaded?"Refreshing":"Loading",H.pubkey.substr(0,8)),t),t.requirements&&(Le("requirements"),i.push(ce(!0).then(ue))),!t.sources||t.tx&&!t.tx.enable?t.sources&&t.tx&&!t.tx.enable&&i.push(de("pending")):i.push(de(t.tx?t.tx.fromTime:void 0)),t.sigStock&&i.push(Ee()),(i.length?e.all(i):e.when()).then((function(){return angular.isDefined(t.api)&&!t.api?H:x.data.raisePromise.load(H).then((function(){return console.debug("[wallet] {0} {{1}} data in {2}ms".format(H.loaded?"Refreshed":"Loaded",H.pubkey.substr(0,8),Date.now()-n)),H.loaded||(H.loaded=H.requirements.loaded&&H.sources&&!0),H}))})).catch((function(e){throw console.error("[wallet] Error while {0} data: {1}".format(H.loaded?"Refreshing":"Loading",e&&e.message||e),e),H.loaded=H.requirements.loaded&&H.sources&&!0,e}))},fe=function(t,i){return H.uid!=t||i&&H.blockUid!=i?H.loaded?(H.uid=t,H.blockUid=i,_e({requirements:!0,sigStock:!0}).then((function(){return ne({skipData:!0})}))):P?P.then((function(){return fe(t,i)})):e.when():e.when()},ge=function(e,t){var i=Math.pow(10,t);return e=e})),n0){var s=he(e-n,t,i-=1);s.amount>0&&(o=s.minBase,n+=s.amount,[].push.apply(a,s.sources))}return{minBase:o,maxBase:r,amount:n,sources:a}},Ie=function(t,i,r,l,c,d){return e.all([Z(),O.get(),d&&e.when(d)||O.blockchain.current(!0)]).then((function(e){var u=e[0],E=e[1];if(d=e[2],!A.regexp.PUBKEY.test(t))throw{message:"ERROR.INVALID_PUBKEY"};if(!A.regexp.COMMENT.test(r))throw{message:"ERROR.INVALID_COMMENT"};if(!X())throw{message:"ERROR.NEED_LOGIN_FIRST"};if(t===H.pubkey)throw{message:"ERROR.SAME_TX_RECIPIENT"};if(!i)throw{message:"ERROR.AMOUNT_REQUIRED"};if(i<=0)throw{message:"ERROR.AMOUNT_NEGATIVE"};i=Math.floor(i);var m={amount:0,minBase:d.unitbase,maxBase:d.unitbase+1,sources:[]},p=[];p.push("[wallet] amount="+i);for(var b=0;m.amount0&&(console.debug("[wallet] Amount has been truncate to "+i),p.push("[wallet] Will use amount truncated to "+i+" (amountBase="+b+")")),Oe(E,d,u,t,i,m,r,c||H.pubkey,p).then((function(e){H.balance-=e.amount,H.balance<0&&(H.balance=0),_.forEach(m.sources,(function(e){e.consumed=!0})),e&&e.sources.length&&(console.debug("[wallet-service] New sources to be add after the TX: ",e.sources),z(e.sources));var n={time:O.date.now(),amount:-i,pubkey:t,comment:r,isUD:!1,hash:e.hash,locktime:0,block_number:null};return h.extendAll([n],"pubkey").then((function(){return H.tx.pendings.unshift(n),x.data.raise.balanceChanged(H),x.data.raise.newTx(H),{hash:e.hash}}))})).catch((function(e){if(e&&e.ucode===A.errorCodes.SOURCE_ALREADY_CONSUMED)return console.debug("[wallet] TX rejected by node with error [{0}]. Reloading sources then retry...".format(e.message||"Source already consumed")),n(de,500).then((function(){return Ie(t,i,r,l,c,d)}));if(e&&e.ucode===A.errorCodes.TX_INPUTS_OUTPUTS_NOT_EQUAL&&f.data.plugins&&f.data.plugins.es&&f.data.plugins.es.enable)return s.loading.hide(),s.alert.confirm("CONFIRM.ISSUE_524_SEND_LOG","ERROR.POPUP_TITLE",{cssClass:"warning",okText:"COMMON.BTN_OK",cancelText:"COMMON.BTN_NO"}).then((function(e){if(e)return x.error.raise.send({title:"Issue #524 logs",content:"App version: "+T.version+"\nApp build: "+T.build+"\nLogs:\n\n"+p.join("\n")}),n((function(){throw{message:"ERROR.ISSUE_524_TX_FAILED"}}),1500);throw{message:"ERROR.SEND_TX_FAILED"}}));throw e}))}))},Oe=function(e,t,n,a,o,r,s,l,c){if(r.sources.length>40){console.debug("[Wallet] TX has to many sources. Will chain TX...");var d={minBase:t.unitbase,maxBase:0,amount:0,sources:r.sources.slice(0,40)};return _.forEach(d.sources,(function(e){e.based.maxBase&&(d.maxBase=e.base),d.amount+=Ne(e.amount,e.base)})),Oe(e,t,n,H.pubkey,d.amount,d,void 0,H.pubkey,c).then((function(i){_.forEach(d.sources,(function(e){e.consumed=!0})),z(i.sources);var u={minBase:t.unitbase,maxBase:0,amount:0,sources:r.sources.slice(40).concat(i.sources)};return _.forEach(u.sources,(function(e){e.baseu.maxBase&&(u.maxBase=e.base),u.amount+=Ne(e.amount,e.base)})),Oe(e,t,n,a,o,u,s,l,c)}))}var u="Version: "+k+"\nType: Transaction\nCurrency: "+e.name+"\nBlockstamp: "+t.number+"-"+t.hash+"\nLocktime: 0\nIssuers:\n"+H.pubkey+"\nInputs:\n";for(_.forEach(r.sources,(function(e){u+=[e.amount,e.base,e.type,e.identifier,e.noffset].join(":")+"\n"})),u+="Unlocks:\n",i=0;i0;)p-=E=ge(p,b),E>0&&(E=0===b?E:E/Math.pow(10,b),u+=E+":"+b+":SIG("+a+")\n",T++),b--;p=r.amount-o,b=r.maxBase}for(;p>0;)p-=E=ge(p,b),E>0&&(E=0===b?E:E/Math.pow(10,b),u+=E+":"+b+":SIG("+l+")\n",H.pubkey===l&&f.push({type:"T",noffset:T,amount:E,base:b,conditions:"SIG("+l+")",consumed:!1}),T++),b--;return u+="Comment: "+(s||"")+"\n",c&&(a==H.pubkey?c.push("[wallet] Creating new TX, using inputs:\n - minBase: "+r.minBase+"\n - maxBase: "+r.maxBase):c.push("[wallet] Creating new TX, using inputs:\n - minBase: "+r.minBase+"\n - maxBase: "+r.maxBase+"\n - sources (=TX inputs):"),_.forEach(r.sources,(function(e){c.push([e.amount,e.base,e.type,e.identifier,e.noffset].join(":"))})),c.push("\n[wallet] generated TX document (without signature) :\n------ START ------\n"+u+"------ END ------\n")),m.sign(u,n).then((function(e){var t=u+e+"\n";return A.tx.process({transaction:t}).catch((function(e){if(!e||e.ucode!==A.errorCodes.TX_ALREADY_PROCESSED)throw e})).then((function(){return m.util.hash(t)})).then((function(e){return _.forEach(f,(function(t){t.identifier=e,t.consumed=!1,t.pending=!0})),{amount:H.pubkey===a?0:H.pubkey===l?o:r.amount,tx:t,hash:e,sources:f}}))}))},ve=function(e,t,i,n){if(i=i||H.uid,n=n||H.blockUid,!i||!n)throw{message:"ERROR.WALLET_HAS_NO_SELF"};if(H.requirements.expired)throw{message:"ERROR.WALLET_IDENTITY_EXPIRED"};var a="Version: "+M+"\nType: Identity\nCurrency: "+e.name+"\nIssuer: "+H.pubkey+"\nUniqueID: "+i+"\nTimestamp: "+n+"\n";return m.sign(a,t).then((function(e){return a+=e+"\n",console.debug("Has generate an identity document:\n----\n"+a+"----"),a}))},Re=function(t){return function(){var i;return e.all([Z(),O.blockchain.lastValid()]).then((function(e){var n=e[0],a=e[1];return i="Version: "+U+"\nType: Membership\nCurrency: "+a.currency+"\nIssuer: "+H.pubkey+"\nBlock: "+a.number+"-"+a.hash+"\nMembership: "+(t?"IN":"OUT")+"\nUserID: "+H.uid+"\nCertTS: "+H.blockUid+"\n",m.sign(i,n)})).then((function(e){var t=i+e+"\n";return A.blockchain.membership({membership:t})})).then((function(){return n((function(){return ce(!1)}),1e3)})).then(ue)}},Ae=function(e,t){(e=e||{}).type=e.type||"info",e.message=e.message||"",e.messageParams=e.messageParams||{},e.context=e.context||"undefined",e.message.trim().length?t?H.events.splice(0,0,e):H.events.push(e):console.debug("Event without message. Skipping this event")},Ce=function(e){var t=Math.round(e.answer.length/2),i=e.answer.substr(0,t),n=e.answer.substr(t);return m.scryptKeypair(i,n).then((function(t){return e.pubkey=m.util.encode_base58(t.signPk),e.keypair=t,e}))},Se=function(){return e.all([Z(),O.get()]).then((function(e){var t=e[0],i=e[1];return ve(i,t).then((function(e){var n=e.trim().split("\n"),a=n[n.length-1],o="Version: "+B+"\nType: Revocation\nCurrency: "+i.name+"\nIssuer: "+H.pubkey+"\nIdtyUniqueID: "+H.uid+"\nIdtyTimestamp: "+H.blockUid+"\nIdtySignature: "+a+"\n";return m.sign(o,t).then((function(e){return o+=e+"\n",console.debug("Has generate an revocation document:\n----\n"+o+"----"),o}))}))}))},Le=function(e){H.events=H.events.reduce((function(t,i){return i.context&&i.context==e?t:t.concat(i)}),[])},De=function(t,i){return t.children.setParent(C),H.children=H.children||[],H.children.push(t),!i||angular.isUndefined(i.store)||i.store?oe():e.when()},ye=function(e){e&&!e.stop||_.forEach(H.children||[],(function(e){e.stop()}));var t=H.children.splice(0,H.children.length);return!e||angular.isUndefined(e.store)||e.store?oe():t},Pe=function(e){return _.find(H.children||[],(function(t){return t.isUserPubkey(e)}))},ke=function(){var e=(H.children||[]).reduce((function(e,t){return Math.max(e,t.id)}),0)+1;return v.instance(e,A)},Me=function(){return Ue().then((function(){return H.children}))},Ue=function(t){return K()?J()?m.box.keypair.fromSignKeypair(H.keypair).then((function(e){var t=m.util.decode_base58(H.encryptedData.nonce);return m.box.open(H.encryptedData.content,t,e.boxPk,e.boxSk)})).then((function(e){H.encryptedData=null;var i=le(JSON.parse(e));return(!t||angular.isUndefined(t.store)||t.store)&&i.then((function(){return oe()})),i})):$().then(Ue):e.when()},we=function(e){var t=(e=angular.isDefined(e)?e:J())&&S&&S.keepAuthIdle>0&&S.keepAuthIdle!=f.constants.KEEP_AUTH_IDLE_SESSION,i=F!=t;i?(t?(console.debug("[wallet] Start idle (delay: {0}s)".format(S.keepAuthIdle)),c.setIdle(S.keepAuthIdle),c.watch()):F&&(console.debug("[wallet] Stop idle"),c.unwatch()),F=t):t&&c.getIdle()!==S.keepAuthIdle&&(console.debug("[idle] Updating auth idle (delay: {0}s)".format(S.keepAuthIdle)),c.setIdle(S.keepAuthIdle)),e&&S&&S.keepAuthIdle==f.constants.KEEP_AUTH_IDLE_SESSION?u.put("seckey",m.util.encode_base58(H.keypair.signSk)):i&&u.put("seckey",null)};function Be(e){return e&&{useLocalStorage:e.useLocalStorage,useLocalStorageEncryption:e.useLocalStorageEncryption,rememberMe:e.rememberMe,keepAuthIdle:e.keepAuthIdle}}function He(e){var t=Be(e);if(!angular.equals(S,t)&&S){var i=!angular.equals(S.useLocalStorageEncryption,t.useLocalStorageEncryption),n=!angular.equals(S.useLocalStorage,t.useLocalStorage)||i,a=!angular.equals(S.keepAuthIdle,t.keepAuthIdle);if(S=t,a&&we(),n){if(S.useLocalStorage)return ne().then((function(){if(H.childrenCount>0&&i&&S.useLocalStorageEncryption)return $({minData:!0,silent:!0}).catch((function(e){if("CANCELLED"===e)return f.apply({useLocalStorageEncryption:!1}),f.store();throw e}))})).then(oe);ae(H.pubkey)}}}function Fe(){_.forEach(L,(function(e){e()})),L=[]}function xe(){console.debug("[wallet] Stopping..."),Fe(),W()}function We(){return xe(),n(Ye,200)}function Ye(i){(i=i||{}).restore=angular.isDefined(i.restore)?i.restore:"default"===b,console.debug("[wallet] Starting...");var n=Date.now();return y=e.all([f.ready().then((function(){S=Be(f.data)})),O.ready(),A.ready()]),i.restore&&(y=y.then(re)),y.then((function(){!function(){L=[f.api.data.on.changed(t,He,this),A.api.node.on.restart(t,We,this)],t.$on("IdleStart",Q)}(),console.debug("[wallet] Started in "+(Date.now()-n)+"ms"),D=!0,y=null})).then((function(){return H})),y}return x.registerEvent("data","init"),x.registerEvent("data","loginCheck"),x.registerEvent("data","login"),x.registerEvent("data","auth"),x.registerEvent("data","unauth"),x.registerEvent("data","load"),x.registerEvent("data","logout"),x.registerEvent("data","reset"),x.registerEvent("data","store"),x.registerEvent("error","send"),x.registerEvent("data","balanceChanged"),x.registerEvent("data","newTx"),x.registerEvent("action","certify"),W(!0),"default"!==b&&(ne=e.when,re=e.when,se=e.when),C={id:b,data:H,ready:function(){return D?e.when():y||Ye()},start:Ye,stop:xe,login:j,logout:q,auth:$,unauth:Q,isLogin:X,isAuth:J,getKeypair:Z,hasSelf:function(){return!!H.pubkey&&!H.requirements.needSelf},setSelf:fe,isMember:function(){return H.isMember},isDataLoaded:ee,isDefault:G,isNeverUsed:te,isNew:ie,isUserPubkey:function(e){return X()&&H.pubkey===e},getData:function(){return H},loadData:pe,refreshData:_e,loadQrCode:me,internal:{addListener:function(e){(L=L||[]).push(e)},removeListeners:Fe},store:ne,storeData:oe,transfer:Ie,transferAll:function(t,i,n,a,o){return X()?o&&t!=o?O.blockchain.lastValid().then((function(e){return console.debug("[wallet] Using last valid block as TX reference (to avoid network fork): ",e),Ie(t,i,n,a,o,e).then((function(){if(H.balance>0&&o)return console.debug("[wallet] Wallet has some more money: transfering fund to [{0}]".format(o.substring(0,8))),Ie(o,H.balance,void 0,!1,o,e)}))})):e.reject({message:"Could not have same pubkey for 'destPub' and 'restPub'"}):e.reject({message:"ERROR.NEED_LOGIN_FIRST"})},self:function(t,i){return A.regexp.USER_ID.test(t)?e.all([Z(),O.get(),O.blockchain.lastValid()]).then((function(e){var i=e[0],a=e[1];return n=e[2],ve(a,i,t,n.number+"-"+n.hash)})).then((function(e){return A.wot.add({identity:e})})).then((function(){if(i)return ce(!1).then(ue);H.uid=t,H.blockUid=n.number+"-"+n.hash})).catch((function(e){if(e&&e.ucode===A.errorCodes.IDENTITY_SANDBOX_FULL)throw{ucode:A.errorCodes.IDENTITY_SANDBOX_FULL,message:"ERROR.IDENTITY_SANDBOX_FULL"};throw e})):e.reject({message:"ERROR.INVALID_USER_ID"});var n},revoke:function(){return Le("revocation"),Se().then((function(e){return A.wot.revoke({revocation:e})})).then((function(){return n((function(){return ce(!1)}),1e3)})).then(ue).catch((function(e){if(!e||e.ucode!=A.errorCodes.REVOCATION_ALREADY_REGISTERED)throw e;Ae({type:"pending",message:"INFO.REVOCATION_SENT_WAITING_PROCESS",context:"requirements"},!0)}))},revokeWithFile:function(t){return e.all([A.wot.revoke({revocation:t})]).then((function(e){if(X())return n((function(){return ce(!1)}),1e3).then(ue).catch((function(e){if(!e||e.ucode!=A.errorCodes.REVOCATION_ALREADY_REGISTERED)throw e;Ae({type:"pending",message:"INFO.REVOCATION_SENT_WAITING_PROCESS",context:"requirements"},!0)}));Ae({type:"pending",message:"INFO.REVOCATION_SENT_WAITING_PROCESS",context:"requirements"},!0)}))},certify:function(t,i,n,a,o,r){return e.all([Z(),O.get(),O.blockchain.lastValid()]).then((function(e){var s=e[0],l=e[1],c=e[2];if(!H.isMember&&!T.initPhase)throw{message:"ERROR.ONLY_MEMBER_CAN_EXECUTE_THIS_ACTION"};var d="Version: "+w+"\nType: Certification\nCurrency: "+l.name+"\nIssuer: "+H.pubkey+"\nIdtyIssuer: "+i+"\nIdtyUniqueID: "+t+"\nIdtyTimestamp: "+n+"\nIdtySignature: "+a+"\nCertTimestamp: "+c.number+"-"+c.hash+"\n";return m.sign(d,s).then((function(e){var t=d+e+"\n";return A.wot.certify({cert:t})})).then((function(){var e={pubkey:i,uid:t,time:c.medianTime,isMember:o,wasMember:r,expiresIn:l.parameters.sigWindow,pending:!0,block:c.number,valid:!0};return x.action.raise.certify(e),e}))}))},downloadSaveId:function(e){return function(e){var t="Version: 10 \nType: SaveID\nQuestions: \n"+e.questions+"Issuer: "+H.pubkey+"\nCrypted-Nonce: "+e.nonce+"\nCrypted-Pubkey: "+e.pubkey+"\nCrypted-Salt: "+e.salt+"\nCrypted-Pwd: "+e.pwd+"\n";return m.sign(t,H.keypair).then((function(e){return t+=e+"\n",console.debug("Has generate an SaveID document:\n----\n"+t+"----"),t}))}(e).then((function(e){var t=new N([e],{type:"text/plain; charset=utf-8"});g.saveAs(t,"{0}-recover_ID.txt".format(H.pubkey.substring(0,8)))}))},getCryptedId:function(t){return Ce(t).then(m.util.random_nonce).then((function(i){return t.nonce=m.util.encode_base58(i),e.all([m.box.pack(t.salt,i,t.keypair.boxPk,t.keypair.boxSk),m.box.pack(t.pwd,i,t.keypair.boxPk,t.keypair.boxSk)])})).then((function(e){return t.salt=e[0],t.pwd=e[1],t}))},recoverId:function(e){if(!(e&&e.cypherNonce&&e.cypherSalt&&e.cypherPwd))throw{message:"ERROR.INVALID_FILE_FORMAT"};var t=m.util.decode_base58(e.cypherNonce);return Ce(e).then((function(e){return m.box.open(e.cypherSalt,t,e.keypair.boxPk,e.keypair.boxSk)})).then((function(i){return e.salt=i,m.box.open(e.cypherPwd,t,e.keypair.boxPk,e.keypair.boxSk)})).then((function(t){return e.pwd=t,e})).catch((function(e){throw console.warn("Incorrect answers: unable to recover identifiers",e),new Error("Incorrect answers: unable to recover identifiers")}))},downloadRevocation:function(){return e.all([O.get(),Se()]).then((function(e){var t=e[0],i=e[1],n=new N([i],{type:"text/plain; charset=utf-8"});return a("ACCOUNT.SECURITY.REVOCATION_FILENAME",{uid:H.uid,currency:t.name,pubkey:H.pubkey}).then((function(e){g.saveAs(n,e)}))}))},downloadKeyFile:function(t){return J()?e.all([O.get(),p.keyfile.generateContent(H.keypair,{type:t,password:function(){return s.loading.hide(),E.showPassword({title:"ACCOUNT.SECURITY.KEYFILE.PASSWORD_POPUP.TITLE",subTitle:"ACCOUNT.SECURITY.KEYFILE.PASSWORD_POPUP.HELP"}).then((function(e){return s.loading.show(10).then((function(){return e}))}))}})]).then((function(e){var i=e[0],n=e[1];return a("ACCOUNT.SECURITY.KEYFILE_FILENAME",{currency:i.name,pubkey:H.pubkey,format:t}).then((function(e){var t=new N([n],{type:"text/plain; charset=utf-8"});g.saveAs(t,e)}))})):e.reject("user not authenticated")},pubkeys:function(){if(!H.pubkey)throw new Error("User not login!");return(H.children||[]).reduce((function(e,t){return t.data.pubkey?e.concat(t.data.pubkey):e}),[H.pubkey])},getByPubkey:function(e){if(!e)throw new Error("Missing 'pubkey' argument !");if(!H.pubkey)throw new Error("User not login!");return H.pubkey===e?C:Pe(e)},membership:{inside:Re(!0),out:Re(!1)},events:{add:Ae,cleanByContext:Le},children:{create:function(e){var t=ke();return De(t,e),t},add:De,remove:function(t,i){H.children=H.children||[];var n=_.findIndex(H.children,(function(e){return e.id===t}));if(-1===n)throw console.warn("[wallet] Unable to remove child wallet {{0}} (not found)".format(t)),new Error("Wallet with id {{0}} not found".format(t));return H.children.splice(n,1)[0].stop(),i&&!1===i.store?e.when():oe()},get:function(e){return"default"!==e&&_.find(H.children||[],(function(t){return t.id===+e}))||void 0},getByPubkey:Pe,all:Me,setParent:function(i){var n;L=L||[],_.forEach(["load","reset"],(function(a){n=x.data.on[a](t,(function(t,n){return n=n||e.defer(),i.api.data.raisePromise[a](t).then(n.resolve).catch(n.reject),n.promise}),this),L.push(n)})),n=i.api.data.on.unauth(t,(function(){J()&&Q()}),this),L.push(n)},count:function(){return angular.isDefined(H.childrenCount)?H.childrenCount:H.children&&H.children.length||0},hasPubkey:function(e){return!!Pe(e)},instance:ke,downloadFile:function(){return e.all([Me(),O.get()]).then((function(e){var t=e[0],i=e[1],n=(t||[]).reduce((function(e,t){return e+[t.data.pubkey,t.data.uid,t.data.localName||t.data.name].join("\t")+"\n"}),""),o=new N([n],{type:"text/plain; charset=utf-8"});return a("ACCOUNT.WALLET_LIST.EXPORT_FILENAME",{pubkey:H.pubkey,currency:i.name}).then((function(e){g.saveAs(o,e)}))}))}},api:x}}return(v=A("default",b)).instance=A,v}]),angular.module("cesium.help.services",[]).constant("csHelpConstants",{wallet:{stepCount:4}}).factory("csHelp",["$rootScope","csSettings","UIUtils","csHelpConstants","$controller",function(e,t,i,n,a){function o(o,r){if(o=angular.isDefined(o)?o:t.data.helptip.wallet,r=!!angular.isDefined(r)&&r,!(o<0||o>=n.wallet.stepCount)){var s=function(n,o){if(n||!e.tour&&t.data.helptip.enable&&!i.screen.isSmall()){var r=e.$new();return a("HelpTipCtrl",{$scope:r}),r}}(r);if(s)return s.tour=r,s.startWalletTour(o,!1).then((function(e){s.$destroy(),r||(t.data.helptip.wallet=e,t.store())}))}}return{wallet:{tour:function(){return o(0,!0)},helptip:o}}}]),angular.module("cesium.plugin.services",[]).provider("PluginService",(function(){var e=[],t={};this.registerEagerLoadingService=function(t){return e.push(t),this},this.extendState=function(e,i){return angular.isDefined(e)&&angular.isDefined(i)&&(t[e]||(t[e]=[]),t[e].push(i)),this},this.extendStates=function(e,t){var i=this;return e.forEach((function(e){i.extendState(e,t)})),this},this.$get=["$injector","$state",function(i,n){var a;return{start:function(){e.length>0&&_.forEach(e,(function(e){i.get(e)}))},extensions:{points:{getActivesByName:function(e){return _.keys(t).reduce((function(e,i){return n.includes(i)?e.concat(t[i]):e}),[]).reduce((function(t,i){return i.points&&i.points[e]?t.concat(i.points[e]):t}),[])},current:{get:function(){return a},set:function(e){a=e}}}}}}]})),angular.module("cesium.services",["cesium.desktop.services","cesium.settings.services","cesium.http.services","cesium.network.services","cesium.bma.services","cesium.crypto.services","cesium.utils.services","cesium.modal.services","cesium.storage.services","cesium.device.services","cesium.currency.services","cesium.wot.services","cesium.tx.services","cesium.wallet.services","cesium.help.services","cesium.plugin.services"]),angular.module("cesium.api.demo.services",["cesium.bma.services","cesium.crypto.services","cesium.utils.services","cesium.settings.services"]).factory("csDemoWallet",["$rootScope","$timeout","$controller","$state","$q","$translate","$filter","BMA","CryptoUtils",function(e,t,i,n,a,o,r,s,l){return{instance:function(e){var t;return{start:function(){return a.when()},login:function(){var i=this;return o("API.TRANSFER.DEMO.PUBKEY").then((function(n){if(t=n,!e||e.pubkey!=t)throw{message:"API.TRANSFER.DEMO.BAD_CREDENTIALS"};return i.data={keypair:e.keypair},{uid:"Demo",pubkey:t}}))},transfer:function(e,i,n){var o=this;return s.blockchain.current().then((function(r){var c="Version: "+s.constants.PROTOCOL_VERSION+"\nType: Transaction\nCurrency: "+r.currency+"\nBlockstamp: "+r.number+"-"+r.hash+"\nLocktime: 0\nIssuers:\n"+t+"\nInputs:\n"+[i,r.unitbase,"T","FakeId27jQMAf3jqL2fr75ckZ6Jgi9TZL9fMf9TR9vBvG",0].join(":")+"\nUnlocks:\n0:SIG(0)\nOutputs:\n"+[i,r.unitbase,"SIG("+e+")"].join(":")+"\nComment: "+(n||"")+"\n";return l.sign(c,o.data.keypair).then((function(e){var t=c+e+"\n";return l.util.hash(t).then((function(e){return a.when({tx:t,hash:e})}))}))}))}}}}}]),e.prototype.regexp={BMA:/^BASIC_MERKLED_API[ ]?/,BMAS:/^BMAS[ ]?/,WS2P:/^WS2P[ ]?/,BMA_REGEXP:/^BASIC_MERKLED_API([ ]+([a-z_][a-z0-9-_.ğĞ]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))$/,BMAS_REGEXP:/^BMAS([ ]+([a-z_][a-z0-9-_.ğĞ]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))$/,WS2P_REGEXP:/^WS2P[ ]+([a-z0-9]+)([ ]+([a-z_][a-z0-9-_.ğĞ]*))?([ ]+([0-9.]+))?([ ]+([0-9a-f:]+))?([ ]+([0-9]+))([ ]+([a-z0-9/.&#!]+))?$/,LOCAL_IP_ADDRESS:/^127[.]0[.]0.|192[.]168[.]|10[.]0[.]0[.]|172[.]16[.]/},e.prototype.regex=e.prototype.regexp,e.prototype.keyID=function(){var e=this.bma||this.getBMA();return e.useBma?[this.pubkey||"Unknown",e.dns,e.ipv4,e.ipv6,e.port,e.useSsl,e.path].join("-"):[this.pubkey||"Unknown",e.ws2pid,e.path].join("-")},e.prototype.copyValues=function(e){var t=this;["version","currency","pub","endpoints","hash","status","block","signature"].forEach((function(i){e[i]=t[i]}))},e.prototype.copyValuesFrom=function(e){var t=this;["version","currency","pub","endpoints","block","signature"].forEach((function(i){t[i]=e[i]}))},e.prototype.json=function(){var e=this,t={};return["version","currency","endpoints","status","block","signature"].forEach((function(i){t[i]=e[i]})),t.raw=this.raw&&this.getRaw(),t.pubkey=this.pubkey,t},e.prototype.getBMA=function(){if(this.bma)return this.bma;var e=null,t=this.regexp.BMA_REGEXP,i=this.regexp.BMAS_REGEXP;return this.endpoints.forEach((function(n){var a=!e&&t.exec(n);a&&(e={dns:a[2]||"",ipv4:a[4]||"",ipv6:a[6]||"",port:a[8]||80,useSsl:443==a[8],useBma:!0}),(a=!e&&i.exec(n))&&(e={dns:a[2]||"",ipv4:a[4]||"",ipv6:a[6]||"",port:a[8]||80,useSsl:!0,useBma:!0})})),e||{}},e.prototype.getEndpoints=function(e){return e?this.endpoints.reduce((function(t,i){return i.match(e)?t.concat(i):t}),[]):this.endpoints},e.prototype.hasEndpoint=function(e){var t=this.regexp[e]||new RegExp("^"+e);return!!this.getEndpoints(t).length},e.prototype.getDns=function(){var e=this.bma||this.getBMA();return e.dns?e.dns:null},e.prototype.getIPv4=function(){var e=this.bma||this.getBMA();return e.ipv4?e.ipv4:null},e.prototype.getIPv6=function(){var e=this.bma||this.getBMA();return e.ipv6?e.ipv6:null},e.prototype.getPort=function(){var e=this.bma||this.getBMA();return e.port?e.port:null},e.prototype.getHost=function(e){return bma=e||this.bma||this.getBMA(),(443==bma.port||bma.useSsl)&&bma.dns?bma.dns:this.hasValid4(bma)?bma.ipv4:bma.dns?bma.dns:bma.ipv6?"["+bma.ipv6+"]":""},e.prototype.getURL=function(e){e=e||this.bma||this.getBMA();var t=this.getHost(e);return(443==e.port||e.useSsl?"https":"http")+"://"+t+(e.port?":"+e.port:"")},e.prototype.getServer=function(e){e=e||this.bma||this.getBMA();var t=this.getHost(e);return t+(t&&e.port?":"+e.port:"")},e.prototype.hasValid4=function(e){return!(!e.ipv4||e.ipv4.match(this.regexp.LOCAL_IP_ADDRESS))},e.prototype.isReachable=function(){return!!this.getServer()},e.prototype.isSsl=function(){return(this.bma||this.getBMA()).useSsl},e.prototype.isTor=function(){return(this.bma||this.getBMA()).useTor},e.prototype.isWs2p=function(){return(this.bma||this.getBMA()).useWs2p},e.prototype.isBma=function(){var e=this.bma||this.getBMA();return!e.useWs2p&&!e.useTor},e.prototype.hasBma=function(){return this.hasEndpoint("(BASIC_MERKLE_API|BMAS|BMATOR)")},t.prototype.isEmpty=function(){"use strict";return!(this.transactionsCount||this.certificationsCount||this.joinersCount||this.dividend||this.activesCount||this.identitiesCount||this.leaversCount||this.excludedCount||this.revokedCount)},t.prototype.parseData=function(){this.identities=this.parseArrayValues(this.identities,["pubkey","signature","buid","uid"]),this.joiners=this.parseArrayValues(this.joiners,["pubkey","signature","mBuid","iBuid","uid"]),this.actives=this.parseArrayValues(this.actives,["pubkey","signature","mBuid","iBuid","uid"]),this.leavers=this.parseArrayValues(this.leavers,["pubkey","signature","mBuid","iBuid","uid"]),this.revoked=this.parseArrayValues(this.revoked,["pubkey","signature"]),this.excluded=this.parseArrayValues(this.excluded,["pubkey"]),this.certifications=this.parseArrayValues(this.certifications,["from","to","block","signature"]),this.transactions=this.parseTransactions(this.transactions),delete this.raw},t.prototype.cleanData=function(){delete this.identities,delete this.joiners,delete this.actives,delete this.leavers,delete this.revoked,delete this.excluded,delete this.certifications,delete this.transactions,delete this.raw},t.prototype.parseArrayValues=function(e,t){return e&&e.length?e.reduce((function(e,i){var n=i.split(":");if(n.length!=t.length)return console.debug("[block] Bad format for '{0}': [{1}]. Expected {1} parts. Skipping".format(arrayProperty,i,t.length)),e;for(var a={},o=0;oAPI.DOC.TRANSFER.TITLE

API.DOC.DESCRIPTION_DIVIDER

API.DOC.TRANSFER.DESCRIPTION

API.DOC.URL_DIVIDER

{{$root.rootPath}}#/v1/payment/:pubkey?amount=API.DOC.TRANSFER.PARAM_AMOUNT

API.DOC.PARAMETERS_DIVIDER

API.DOC.AVAILABLE_PARAMETERS

pubkey
API.DOC.TRANSFER.PARAM_PUBKEY_HELP
amount
API.DOC.TRANSFER.PARAM_AMOUNT_HELP
comment
API.DOC.TRANSFER.PARAM_COMMENT_HELP
name
API.DOC.TRANSFER.PARAM_NAME_HELP
preferred_node
API.DOC.TRANSFER.PARAM_PREFERRED_NODE_HELP
redirect_url
API.DOC.TRANSFER.PARAM_REDIRECT_URL_HELP
cancel_url
API.DOC.TRANSFER.PARAM_CANCEL_URL_HELP

API.DOC.DEMO_DIVIDER

API.DOC.DEMO_HELP

API.DOC.DEMO_SUCCEED

API.DOC.DEMO_RESULT

{{result.content}}

API.DOC.DEMO_RESULT_PEER {{result.node}}

API.DOC.DEMO_CANCELLED

API.DOC.INTEGRATE_DIVIDER

API.DOC.TRANSFER.EXAMPLES_HELP

API.DOC.TRANSFER.EXAMPLE_BUTTON

API.DOC.INTEGRATE_CODE

API.DOC.INTEGRATE_RESULT

API.DOC.INTEGRATE_PARAMETERS

{{\'API.DOC.TRANSFER.PARAM_PUBKEY\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_AMOUNT\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_COMMENT\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_NAME\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_PREFERRED_NODE\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_REDIRECT_URL\' | translate}} :

{{\'API.DOC.TRANSFER.PARAM_CANCEL_URL\' | translate}} :

API.DOC.TRANSFER.EXAMPLE_BUTTON_DEFAULT_STYLE

{{\'API.DOC.TRANSFER.EXAMPLE_BUTTON_TEXT_ICON\' | translate}} :

{{\'API.DOC.TRANSFER.EXAMPLE_BUTTON_TEXT_HELP\' | translate}} :

{{\'API.DOC.TRANSFER.EXAMPLE_BUTTON_BG_COLOR\' | translate}} :

{{\'API.DOC.TRANSFER.EXAMPLE_BUTTON_FONT_COLOR\' | translate}} :

{{\'API.DOC.TRANSFER.EXAMPLE_BUTTON_TEXT_WIDTH\' | translate}} :

'),e.put("templates/api/home.html",'API.HOME.TITLE

API.HOME.MESSAGE_SHORT

{{\'COMMON.APP_NAME\'|translate}} API - v{{$root.config.version}}

'),e.put("templates/api/menu.html",''),e.put("templates/api/popover_locales.html",''),e.put("templates/api/transfer.html",'API.TRANSFER.TITLE_SHORT

API.TRANSFER.DEMO.HELP

MODE.DEMO.INSTALL_HELP

API.TRANSFER.SUMMARY

API.TRANSFER.AMOUNT

API.TRANSFER.NAME

{{transferData.name}}

API.TRANSFER.PUBKEY


{{transferData.pubkey|formatPubkey}}

API.TRANSFER.COMMENT


{{::transferData.comment}}

API.TRANSFER.NODE


 {{node.server}}

 

{{\'COMMON.APP_NAME\'|translate}} - v{{$root.config.version}}

'),e.put("templates/blockchain/item_block_empty_lg.html",'

{{:rebind:block.medianTime|medianDate}}

{{:rebind:block.issuer|formatPubkey}} {{:rebind:block.name||block.uid}}

{{block.number|formatInteger}}
'),e.put("templates/blockchain/item_block_lg.html",'

{{:rebind:block.medianTime|medianDate}}

{{:rebind:\'BLOCKCHAIN.HASH\'|translate}} {{:rebind:block.hash|formatHash}}

{{:rebind:block.issuer|formatPubkey}} {{:rebind:block.name||block.uid}}

+{{:rebind:block.joinersCount}} -{{:rebind:block.excludedCount-block.revokedCount}}    -{{:rebind:block.revokedCount}}   {{:rebind:block.activesCount}}   {{:rebind:block.certificationsCount}}   {{:rebind:\'COMMON.UD\'|translate}}   {{:rebind:block.transactionsCount}}  
{{:rebind:block.number}}
'),e.put("templates/blockchain/item_block.html",'

{{:rebind:block.medianTime|medianDate}}

+{{:rebind:block.joinersCount}} -{{:rebind:block.excludedCount-block.revokedCount}} {{:rebind:block.revokedCount}}   {{:rebind:block.activesCount}}   {{:rebind:block.certificationsCount}}   {{\'COMMON.UD\'|translate}}   {{:rebind:block.transactionsCount}}

{{:rebind:block.name||block.uid}}

{{::block.number|formatInteger}}
'),e.put("templates/blockchain/items_blocks.html",'
BLOCKCHAIN.LOOKUP.NO_BLOCK
'),e.put("templates/blockchain/link_identity.html",' {{::identity.uid}}   {{::identity.pubkey|formatPubkey}}'),e.put("templates/blockchain/list_blocks_lg.html",'
{{:locale:\'BLOCKCHAIN.LOOKUP.NO_BLOCK\'|translate}}
'),e.put("templates/blockchain/list_blocks.html",'
BLOCKCHAIN.LOOKUP.NO_BLOCK
'),e.put("templates/blockchain/lookup_lg.html",'BLOCKCHAIN.LOOKUP.TITLE'),e.put("templates/blockchain/lookup.html",'BLOCKCHAIN.LOOKUP.TITLE'),e.put("templates/blockchain/unlock_condition_popover.html",'

BLOCKCHAIN.VIEW.TX_OUTPUT_UNLOCK_CONDITIONS

{{::\'BLOCKCHAIN.VIEW.TX_OUTPUT_OPERATOR.\'+condition.operator|translate}} 
{{::condition.value|formatDuration}}
{{::condition.value|medianDate}}
'),e.put("templates/blockchain/view_block.html",'{{\'BLOCKCHAIN.VIEW.TITLE_CURRENT\'|translate}} {{\'BLOCKCHAIN.VIEW.TITLE\'|translate:formData}}

{{\'BLOCKCHAIN.VIEW.TITLE\'|translate:formData}} {{\'BLOCKCHAIN.VIEW.TITLE_CURRENT\'|translate}}

{{formData.medianTime | medianFromNowAndDate}}

{{\'BLOCKCHAIN.VIEW.COMPUTED_BY\'|translate}} {{issuer.name||issuer.uid}} ({{issuer.uid}})

{{\'BLOCKCHAIN.VIEW.SHOW_RAW\'|translate}}

{{\'BLOCKCHAIN.VIEW.TECHNICAL_DIVIDER\' | translate}} {{\'BLOCKCHAIN.VIEW.VERSION\'|translate}} {{::formData.version}} {{\'BLOCKCHAIN.VIEW.POW_MIN\'|translate}}

{{\'BLOCKCHAIN.VIEW.POW_MIN_HELP\'|translate}}

{{::formData.powMin}}
{{\'BLOCKCHAIN.VIEW.HASH\'|translate}}
{{::formData.hash}}
{{\'BLOCKCHAIN.VIEW.DATA_DIVIDER\' | translate}}{{\'BLOCKCHAIN.VIEW.EMPTY\'|translate}}
{{\'COMMON.UNIVERSAL_DIVIDEND\'|translate}}

{{\'BLOCKCHAIN.VIEW.UNIVERSAL_DIVIDEND_HELP\'|translate: {membersCount: formData.membersCount} }}

+1 / {{\'COMMON.MEMBER\'|translate|lowercase}} 0 + {{formData.dividend| formatAmount: {currency: formData.currency, useRelative: false} }} / {{\'COMMON.MEMBER\'|translate|lowercase}}
{{\'BLOCKCHAIN.VIEW.IDENTITIES_COUNT\'|translate}} +{{::formData.identitiesCount}} 0
{{\'BLOCKCHAIN.VIEW.JOINERS_COUNT\'|translate}} +{{::formData.joinersCount}} 0
{{\'BLOCKCHAIN.VIEW.ACTIVES_COUNT\'|translate}}

{{\'BLOCKCHAIN.VIEW.ACTIVES_COUNT_HELP\'|translate}}

{{::formData.activesCount}} 0
{{\'BLOCKCHAIN.VIEW.EXCLUDED_COUNT\'|translate}}

{{\'BLOCKCHAIN.VIEW.EXCLUDED_COUNT_HELP\'|translate}}

-{{::formData.excludedCount-formData.revokedCount}} 0
{{\'BLOCKCHAIN.VIEW.LEAVERS_COUNT\'|translate}}

{{\'BLOCKCHAIN.VIEW.LEAVERS_COUNT_HELP\'|translate}}

-{{::formData.leaversCount}} 0
{{\'BLOCKCHAIN.VIEW.REVOKED_COUNT\'|translate}}

{{\'BLOCKCHAIN.VIEW.REVOKED_COUNT_HELP\'|translate}}

-{{::formData.revokedCount}} 0
{{\'BLOCKCHAIN.VIEW.CERT_COUNT\'|translate}} {{::formData.certificationsCount}}

{{\'BLOCKCHAIN.VIEW.TX_COUNT\'|translate}} {{::formData.transactionsCount}}

BLOCKCHAIN.VIEW.TX_TO_HIMSELF
( )
'),e.put("templates/common/badge_certification_count.html",' {{$ctrl.requirements.certificationCount}} + {{$ctrl.requirements.pendingCertificationCount}}'),e.put("templates/common/badge_given_certification_count.html",'
{{$ctrl.identity.given_cert.length}} (+ {{$ctrl.identity.given_cert_pending.length}}) / {{$ctrl.parameters.sigStock}}
'),e.put("templates/common/form_error_messages.html",'
'),e.put("templates/common/note_feature_not_available.html",'

MODE.DEMO.FEATURE_NOT_AVAILABLE

'),e.put("templates/common/popover_copy.html",'
'),e.put("templates/common/popover_helptip.html",'

 

'),e.put("templates/common/popover_locales.html",''),e.put("templates/common/popover_profile.html",''),e.put("templates/common/popover_share.html",'

{{titleKey|translate:titleValues}}

{{time|formatDate}}
'),e.put("templates/common/popup_password.html",'
{{error|translate}}
'),e.put("templates/common/qrcode.html",'
'),e.put("templates/common/view_passcode.html",'COMMON.PASSCODE.TITLE'),e.put("templates/currency/items_network.html",' CURRENCY.VIEW.MEDIAN_TIME {{formData.medianTime | medianDate}} CURRENCY.VIEW.POW_MIN {{formData.difficulty | formatInteger}}
CURRENCY.VIEW.NETWORK_RULES_DIVIDER
CURRENCY.VIEW.AVG_GEN_TIME {{formData.avgGenTime | formatDuration}}
PEER.MEMBERS PEER.MIRRORS PEER.OFFLINE PEER.PEERS ({{search.results.length}})
'), e.put("templates/currency/items_parameters.html",'
CURRENCY.VIEW.CURRENCY_NAME
{{formData.currency}} ()
CURRENCY.VIEW.SHARE (Mt/Nt)
CURRENCY.VIEW.MASS (Mt)
CURRENCY.VIEW.C_ACTUAL (c{{\'CURRENCY.VIEW.CURRENT\'|translate}})
{{formData.cactual | formatNumeral: \'0,0.00\'}} % / {{formData.dt | formatPeriod}}
CURRENCY.VIEW.UD ({{\'COMMON.UD\'|translate}}t)
1  / {{formData.dt | formatPeriod}}
COMMON.BTN_RELATIVE_UNIT
CURRENCY.VIEW.MONEY_RULES_DIVIDER
CURRENCY.VIEW.C_RULE (c)
{{formData.c*100 | formatNumeral: \'0,0.00\'}} % / {{formData.dt | formatPeriod}}{{formData.c*100 | formatNumeral: \'0,0.00\'}} % / {{formData.dtReeval | formatDuration}}
CURRENCY.VIEW.DT_REEVAL (dt{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}})
CURRENCY.VIEW.UD_REEVAL_TIME0 (t0{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}})
{{formData.udReevalTime0|medianDate}}
CURRENCY.VIEW.UD_RULE - {{\'COMMON.UD\'|translate}}{{formData.dt|formatPeriod}}(t{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}})
{{\'COMMON.UD\'|translate}}t-1 + c2 * Mt-1/Nt-1{{\'COMMON.UD\'|translate}}{{formData.dt|formatPeriod}}(t{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}} - dt{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}})+ c2 * (M/N)(t{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}} - dt{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}}) / dt{{\'CURRENCY.VIEW.REEVAL_SYMBOL\'|translate}}
CURRENCY.VIEW.DISPLAY_ALL_RULES
'),e.put("templates/currency/items_wot.html",'
CURRENCY.VIEW.MEMBERS (N{{\'CURRENCY.VIEW.CURRENT\'|translate}})
{{formData.N | formatInteger}}
(ΔN)
{{formData.N > formData.Nprev ? \'+\' : \'\'}}{{formData.N - formData.Nprev}}
CURRENCY.VIEW.WOT_RULES_DIVIDER
CURRENCY.VIEW.SIG_QTY_RULE {{formData.sigQty}} CURRENCY.VIEW.MS_WINDOW {{formData.msWindow | formatDuration}} CURRENCY.VIEW.MS_VALIDITY {{formData.msValidity | formatDuration}} CURRENCY.VIEW.SIG_WINDOW {{formData.sigWindow | formatDuration}} CURRENCY.VIEW.SIG_VALIDITY {{formData.sigValidity | formatDuration}} CURRENCY.VIEW.SIG_STOCK {{formData.sigStock}} CURRENCY.VIEW.SIG_PERIOD {{formData.sigPeriod | formatDuration}}
(stepMax)
{{formData.stepMax}}
CURRENCY.VIEW.SENTRIES {{formData.sentries}} CURRENCY.VIEW.SENTRIES_FORMULA {{\'CURRENCY.VIEW.MATH_CEILING\'| translate}}( Nt^ (1 / stepMax)) CURRENCY.VIEW.XPERCENT {{formData.xpercent*100| formatNumeral: \'0,0\'}} %
CURRENCY.VIEW.DISPLAY_ALL_RULES
'),e.put("templates/currency/lookup_form.html",'
'),e.put("templates/currency/lookup.html",'

CURRENCY.SELECT.CURRENCIES

'),e.put("templates/currency/modal_license.html",'

CURRENCY.LICENSE.TITLE

translate>CURRENCY.LICENSE.NO_LICENSE_FILE

'),e.put("templates/currency/popover_actions.html",'

COMMON.POPOVER_ACTIONS_TITLE

'),e.put("templates/currency/tabs/tab_blocks.html",'
BLOCKCHAIN.LOOKUP.LAST_BLOCKS
'),e.put("templates/currency/tabs/tab_network.html",'
'),e.put("templates/currency/tabs/tab_parameters.html",'
'),e.put("templates/currency/tabs/tab_wot.html",'
'),e.put("templates/currency/view_currency_lg.html",'{{\'CURRENCY.VIEW.TITLE\' | translate}} {{formData.currency|abbreviate}}
CURRENCY.VIEW.MONEY_DIVIDER
CURRENCY.VIEW.WOT_DIVIDER
'),e.put("templates/currency/view_currency.html",''),e.put("templates/help/help.html",'
MODE.DEMO.MODE
MODE.DEMO.MODE_HELP
MODE.DEMO.INSTALL_HELP
MODE.READONLY.MODE
MODE.READONLY.MODE_HELP
MODE.READONLY.INSTALL_HELP

HELP.JOIN.SECTION

LOGIN.SALT
HELP.JOIN.SALT
LOGIN.PASSWORD
HELP.JOIN.PASSWORD
ACCOUNT.NEW.PSEUDO
HELP.JOIN.PSEUDO

HELP.LOGIN.SECTION

HELP.LOGIN.PUBKEY
HELP.LOGIN.PUBKEY_DEF
HELP.LOGIN.METHOD
HELP.LOGIN.METHOD_DEF

HELP.GLOSSARY.SECTION

COMMON.PUBKEY
HELP.GLOSSARY.PUBKEY_DEF
HELP.GLOSSARY.BLOCKCHAIN
HELP.GLOSSARY.BLOCKCHAIN_DEF
COMMON.UNIVERSAL_DIVIDEND
HELP.GLOSSARY.UNIVERSAL_DIVIDEND_DEF
HELP.GLOSSARY.MEMBER
HELP.GLOSSARY.MEMBER_DEF
HELP.GLOSSARY.WOT
HELP.GLOSSARY.WOT_DEF
HELP.GLOSSARY.CURRENCY_RULES
HELP.GLOSSARY.CURRENCY_RULES_DEF
HELP.GLOSSARY.DISTANCE_RULE
HELP.GLOSSARY.DISTANCE_RULE_DEF
'),e.put("templates/help/modal_help.html",'

HELP.TITLE

'),e.put("templates/help/view_help.html",'HELP.TITLE

HELP.TITLE

'),e.put("templates/home/home.html",'

HOME.MESSAGE

HOME.WELCOME_READONLY

HOME.MESSAGE_READONLY



{{\'LOGIN.HAVE_ACCOUNT_QUESTION\'|translate}}

MODE.DEMO.MODE_HELP HOME.READ_MORE


MODE.READONLY.INSTALL_HELP


{{:locale:\'COMMON.APP_VERSION\'|translate:{version: config.version} }} | HOME.BTN_ABOUT
 
'),e.put("templates/join/modal_choose_account_type.html",'

ACCOUNT.NEW.TITLE

ACCOUNT.NEW.INTRO_WARNING_SECURITY
ACCOUNT.NEW.INTRO_WARNING_SECURITY_HELP


ACCOUNT.NEW.SELECT_ACCOUNT_TYPE

'),e.put("templates/join/modal_join_member.html",'

ACCOUNT.NEW.MEMBER_ACCOUNT_TITLE

ACCOUNT.NEW.INFO_LICENSE
ACCOUNT.NEW.PSEUDO_WARNING
ACCOUNT.NEW.PSEUDO
ACCOUNT.NEW.CHECKING_PSEUDO
ACCOUNT.NEW.PSEUDO_AVAILABLE
ACCOUNT.NEW.PSEUDO_NOT_AVAILABLE
LOGIN.SALT
ACCOUNT.NEW.SALT_CONFIRM
COMMON.SHOW_VALUES
LOGIN.PASSWORD
ACCOUNT.NEW.PASSWORD_CONFIRM
COMMON.SHOW_VALUES
ACCOUNT.NEW.LAST_SLIDE_CONGRATULATION

LOGIN.ASSOCIATED_PUBKEY

{{formData.pubkey}}

{{formData.pubkey}}
ERROR.EXISTING_ACCOUNT_REQUEST
'),e.put("templates/join/modal_join_wallet.html",'

ACCOUNT.NEW.WALLET_ACCOUNT_TITLE

LOGIN.SALT
ACCOUNT.NEW.SALT_CONFIRM
COMMON.SHOW_VALUES
LOGIN.PASSWORD
ACCOUNT.NEW.PASSWORD_CONFIRM
COMMON.SHOW_VALUES
ACCOUNT.NEW.LAST_SLIDE_CONGRATULATION
COMMON.PUBKEY ACCOUNT.NEW.COMPUTING_PUBKEY {{formData.pubkey}}
ERROR.EXISTING_ACCOUNT
ACCOUNT.NEW.COMPUTING_PUBKEY
{{formData.pubkey}}
ERROR.EXISTING_ACCOUNT_REQUEST
'),e.put("templates/login/form_file_import.html",'

LOGIN.FILE_FORM_HELP

LOGIN.FILE.HELP

COMMON.CHOOSE_FILE

{{formData.file.name}}

COMMON.FILE.DATE {{formData.file.lastModified/1000|formatDate}}

COMMON.FILE.SIZE {{formData.file.size|formatInteger}} Ko

COMMON.PUBKEY

COMMON.FILE.VALIDATING

{{formData.file.pubkey}}
{{formData.file.pubkey ? \'ERROR.AUTH_INVALID_PUBKEY\' : \'ERROR.AUTH_INVALID_FILE\' |translate}}

LOGIN.MEMORIZE_AUTH_FILE
'),e.put("templates/login/form_login.html",'


{{\'LOGIN.NO_ACCOUNT_QUESTION\'|translate}}
LOGIN.CREATE_ACCOUNT

'),e.put("templates/login/form_pubkey.html",'

LOGIN.PUBKEY_FORM_HELP

'),e.put("templates/login/form_scan.html",'

COMMON.PUBKEY
{{formData.pubkey}}
'),e.put("templates/login/form_scrypt_advanced.html",'

INFO.FEATURES_NOT_IMPLEMENTED

'),e.put("templates/login/form_scrypt.html",'

'),e.put("templates/login/item_remember_me.html",'
SETTINGS.REMEMBER_ME
'),e.put("templates/login/modal_login.html",''),e.put("templates/login/popover_methods.html",''),e.put("templates/menu.html",'

{{:locale:\'COMMON.APP_NAME\'|translate}} {{$root.currency.name|abbreviate}} {{:locale:\'MODE.DEMO.BADGE\'|translate}} {{:locale:\'MODE.READONLY.BADGE\'|translate}}

{{:locale:\'MENU.HOME\'|translate}}
{{:locale:\'MENU.ACCOUNT\'|translate}} {{:locale:\'MENU.TRANSACTIONS\'|translate}} {{:locale:\'MENU.WALLETS\'|translate}}
{{:locale:\'MENU.WOT\'|translate}} {{:locale:\'MENU.CURRENCY\'|translate}}
{{:locale:\'HOME.BTN_HELP\'|translate}} {{:locale:\'MENU.SETTINGS\'|translate}}
{{:locale:\'COMMON.BTN_LOGOUT\'|translate}}
'),e.put("templates/modal_about.html",'

ABOUT.TITLE

{{\'COMMON.APP_NAME\'|translate}} {{\'COMMON.APP_VERSION\'|translate:$root.config}} - www.cesium.app

{{\'COMMON.APP_BUILD\'|translate:{build: buildDate} }}

ABOUT.LICENSE

{{::$root.newRelease.url}}

ABOUT.OFFICIAL_WEB_SITE

https://www.cesium.app

{{\'ABOUT.FORUM\' | translate}}

{{::$root.settings.userForumUrl}}

ABOUT.PLEASE_REPORT_ISSUE

ABOUT.REPORT_ISSUE

{{\'ABOUT.CODE\' | translate}}

{{$root.settings.sourceUrl}}

{{\'ABOUT.DEVELOPERS\' | translate}}

Benoit Lavenier, bpresles, cgeek, DiG, Ji_emme

'),e.put("templates/network/item_content_peer.html",'

{{:rebind:peer.dns || peer.server}}

{{:locale:\'NETWORK.VIEW.PRIVATE_ACCESS\'|translate}}

{{:rebind:peer.pubkey|formatPubkey}} {{:rebind:peer.name || peer.uid}} {{:rebind:peer.dns && (\' | \' + peer.server) + (peer.bma.path||\'\') }}

{{:locale:!expertMode ? (\'COMMON.BLOCK\'|translate) : \'\' }} {{:rebind:(peer.currentNumber || peer.blockNumber) | formatInteger}}   {{:rebind:peer.consensusBlockDelta|formatDurationTime}}
'),e.put("templates/network/items_peers.html",''),e.put("templates/network/lookup_popover_actions.html",'

PEER.POPOVER_FILTER_TITLE

'),e.put("templates/network/modal_network.html",'

PEER.PEER_LIST

PEER.MEMBER_PEERS PEER.MIRROR_PEERS PEER.ALL_PEERS ({{search.results.length}})

'),e.put("templates/network/popover_endpoints.html",'
{{titleKey | translate:titleValues }}
{{item.label | translate}}
{{item.value}}
'),e.put("templates/network/popover_network.html",''),e.put("templates/network/popover_peer_info.html",''),e.put("templates/network/view_network.html",'MENU.NETWORK'),e.put("templates/network/view_peer.html",'PEER.VIEW.TITLE

PEER.VIEW.TITLE {{node.host}}

{{node.bma.dns || node.server}} SSL ({{\'PEER.MIRROR\'|translate}})

{{\'PEER.VIEW.OWNER\'|translate}} {{node.name || node.uid}} ({{node.uid}}) {{node.pubkey|formatPubkey}} ({{node.name}})

{{\'PEER.VIEW.SHOW_RAW_PEERING\'|translate}} | PEER.VIEW.SHOW_RAW_CURRENT_BLOCK

PEER.VIEW.GENERAL_DIVIDER
COMMON.PUBKEY

{{node.pubkey}}

BLOCKCHAIN.VIEW.TITLE_CURRENT
{{current.number|formatInteger}}
PEER.VIEW.LAST_BLOCKS
PEER.VIEW.KNOWN_PEERS
{{\'NETWORK.INFO.ONLY_SSL_PEERS\'|translate}}
'),e.put("templates/settings/popover_actions.html",'

COMMON.POPOVER_ACTIONS_TITLE

'),e.put("templates/settings/popup_node.html",'
{{\'SETTINGS.POPUP_PEER.USE_SSL\' | translate}}

{{\'SETTINGS.POPUP_PEER.BTN_SHOW_LIST\' | translate}}
'),e.put("templates/settings/settings.html",'SETTINGS.TITLE
SETTINGS.DISPLAY_DIVIDER
{{\'COMMON.BTN_RELATIVE_UNIT\' | translate}}
SETTINGS.STORAGE_DIVIDER
{{\'SETTINGS.USE_LOCAL_STORAGE\' | translate}}

{{\'SETTINGS.AUTHENTICATION_SETTINGS\' | translate}}
{{\'SETTINGS.REMEMBER_ME\' | translate}}

{{\'SETTINGS.WALLETS_SETTINGS\' | translate}}
SETTINGS.USE_WALLETS_ENCRYPTION

SETTINGS.HISTORY_SETTINGS
SETTINGS.DISPLAY_UD_HISTORY
SETTINGS.NETWORK_SETTINGS
SETTINGS.PEER_SHORT

{{bma.server}}
{{bma.server}}
SETTINGS.PLUGINS_SETTINGS
'),e.put("templates/wallet/item_tx.html",' '),e.put("templates/wallet/item_ud.html",'
COMMON.UNIVERSAL_DIVIDEND

{{::tx.time | medianFromNowAndDate}}

()
'),e.put("templates/wallet/list/item_wallet_light.html",'

{{::walletData.localName||walletData.name||walletData.uid}}{{::walletData.pubkey|formatPubkey}}

{{::walletData.uid}}  {{::walletData.pubkey | formatPubkey}} WOT.NOT_MEMBER_PARENTHESIS

'),e.put("templates/wallet/list/item_wallet.html",'

{{::walletData.pubkey|formatPubkey}}

{{::walletData.uid}}  {{::walletData.pubkey | formatPubkey}} WOT.NOT_MEMBER_PARENTHESIS

'), e.put("templates/wallet/list/modal_import_file.html",'

ACCOUNT.WALLET_LIST.IMPORT_MODAL.TITLE

ACCOUNT.WALLET_LIST.IMPORT_MODAL.HELP

COMMON.CHOOSE_FILE

{{fileData.name}}

COMMON.FILE.DATE {{fileData.lastModified/1000|formatDate}}

COMMON.FILE.SIZE {{fileData.size|formatInteger}} Ko

COMMON.FILE.VALIDATING


{{\'ACCOUNT.WALLET_LIST.IMPORT_MODAL.NO_NEW_WALLET\' |translate}}

{{\'ERROR.INVALID_FILE_FORMAT\' |translate}}

'),e.put("templates/wallet/list/modal_wallets.html",'

ACCOUNT.SELECT_WALLET_MODAL.TITLE

{{:locale:\'ACCOUNT.WALLET_LIST.NO_WALLET\'|translate}}
'),e.put("templates/wallet/list/popover_actions.html",'

COMMON.POPOVER_ACTIONS_TITLE

'),e.put("templates/wallet/list/popover_wallets.html",'
ACCOUNT.SELECT_WALLET_MODAL.TITLE
{{:locale:\'ACCOUNT.WALLET_LIST.NO_WALLET\'|translate}}
'),e.put("templates/wallet/list/popup_edit_name.html",'
'),e.put("templates/wallet/list/view_wallets.html",'
{{:locale:\'ACCOUNT.WALLET_LIST.NO_WALLET\'|translate}}
'),e.put("templates/wallet/modal_security.html",'

ACCOUNT.SECURITY.TITLE

ACCOUNT.SECURITY.RECOVER_ID

ACCOUNT.SECURITY.RECOVER_ID_HELP

ACCOUNT.SECURITY.REVOCATION_WITH_FILE

ACCOUNT.SECURITY.REVOCATION_WITH_FILE_DESCRIPTION

ACCOUNT.SECURITY.SEND_IDENTITY

ACCOUNT.SECURITY.MEMBERSHIP_IN

ACCOUNT.SECURITY.REVOCATION_WALLET

ACCOUNT.SECURITY.REVOCATION_WALLET_HELP

'),e.put("templates/wallet/modal_transfer.html",'

TRANSFER.MODAL.TITLE

'),e.put("templates/wallet/new_transfer.html",'TRANSFER.TITLE
'),e.put("templates/wallet/popover_actions.html",'

COMMON.POPOVER_ACTIONS_TITLE

'),e.put("templates/wallet/popover_unit.html",''),e.put("templates/wallet/popup_register.html",'
'),e.put("templates/wallet/slides/slides_generate_keyfile.html",'

ACCOUNT.SECURITY.GENERATE_KEYFILE

ACCOUNT.SECURITY.KEYFILE.PUBSEC_FORMAT

ACCOUNT.SECURITY.KEYFILE.PUBSEC_FORMAT_HELP

ACCOUNT.SECURITY.KEYFILE.WIF_FORMAT

ACCOUNT.SECURITY.KEYFILE.WIF_FORMAT_HELP

ACCOUNT.SECURITY.KEYFILE.EWIF_FORMAT

ACCOUNT.SECURITY.KEYFILE.EWIF_FORMAT_HELP

'),e.put("templates/wallet/slides/slides_recoverID_1.html",'

ACCOUNT.SECURITY.RECOVER_ID_SELECT_FILE

COMMON.CHOOSE_FILE

{{fileData.name}}
{{fileData.size}} Ko
'),e.put("templates/wallet/slides/slides_recoverID_2.html",'

ACCOUNT.SECURITY.RECOVER_ID

'),e.put("templates/wallet/slides/slides_recoverID_3.html",'

ACCOUNT.SECURITY.RECOVER_ID

{{\'LOGIN.SALT\' | translate}} : {{recover.salt}}
{{\'LOGIN.PASSWORD\' | translate}} : {{recover.pwd}}
'),e.put("templates/wallet/slides/slides_revocation_file.html",'

ACCOUNT.SECURITY.REVOCATION_WITH_FILE_HELP

COMMON.CHOOSE_FILE

{{fileData.name}}

COMMON.FILE.DATE {{fileData.lastModified/1000|formatDate}}

COMMON.FILE.SIZE {{fileData.size|formatInteger}} Ko


{{revocationError|translate}}

'),e.put("templates/wallet/slides/slides_saveID_1.html",'

ACCOUNT.SECURITY.SAVE_ID

{{question.value | translate}}
'),e.put("templates/wallet/slides/slides_saveID_2.html",'

ACCOUNT.SECURITY.SAVE_ID

'),e.put("templates/wallet/transfer_form.html",'
TRANSFER.TO {{destUid}}   {{formData.destPub | formatPubkey}}
TRANSFER.FROM {{walletData.pubkey| formatPubkey}}   {{walletData.name||walletData.uid}}  
TRANSFER.AMOUNT ()
 
TRANSFER.REST()TRANSFER.REST_TO {{restUid}}   {{formData.restPub | formatPubkey}}

TRANSFER.WARN_COMMENT_IS_PUBLIC

'),e.put("templates/wallet/tx_locked_outputs_popover.html",'

ACCOUNT.LOCKED_OUTPUTS_POPOVER.TITLE

ACCOUNT.LOCKED_OUTPUTS_POPOVER.DESCRIPTION

ACCOUNT.LOCKED_OUTPUTS_POPOVER.DESCRIPTION_MANY

ACCOUNT.LOCKED_OUTPUTS_POPOVER.LOCKED_AMOUNT

{{::\'BLOCKCHAIN.VIEW.TX_OUTPUT_OPERATOR.\'+condition.operator|translate}} 
{{::condition.value|formatDuration}}
{{::condition.value|medianDate}}
'),e.put("templates/wallet/view_wallet_tx_error.html",'
{{:locale:\'ACCOUNT.PENDING_TX_RECEIVED\'|translate}}
({{$root.currency.name | abbreviate}}) ({{\'COMMON.UD\' | translate}}{{$root.currency.name | abbreviate}})
{{:locale:\'ACCOUNT.NO_TX\'|translate}}
{{:locale:\'ACCOUNT.ERROR_TX_SENT\'|translate}}
({{$root.currency.name | abbreviate}}) ({{\'COMMON.UD\' | translate}}{{$root.currency.name | abbreviate}})
{{:locale:\'ACCOUNT.NO_TX\'|translate}}
'),e.put("templates/wallet/view_wallet_tx.html",'MENU.TRANSACTIONS
{{:locale:\'ACCOUNT.ERROR_TX\'|translate}}
{{formData.tx.errors.length}}
{{:locale:\'ACCOUNT.PENDING_TX\'|translate}}
{{:locale:\'ACCOUNT.VALIDATING_TX\'|translate}}
{{:locale:\'ACCOUNT.LAST_TX\'|translate}}   {{:locale:\'ACCOUNT.NO_TX\'|translate}}
'),e.put("templates/wallet/view_wallet.html",'
WOT.GENERAL_DIVIDER
{{:locale:\'COMMON.PUBKEY\'|translate}}

{{:rebind:formData.pubkey}}

COMMON.UID
WOT.REGISTERED_SINCE {{:rebind:formData.sigDate | medianDate}}
{{:rebind:formData.uid}}
{{:locale:\'ACCOUNT.CERTIFICATION_COUNT\'|translate}} WOT.GIVEN_CERTIFICATIONS.SENT WOT.ACCOUNT_OPERATIONS {{:locale:\'ACCOUNT.EVENTS\' | translate}}
'),e.put("templates/wot/item_certification.html",'

{{::cert.name||cert.uid}}

{{::cert.pubkey | formatPubkey}} | {{::cert.time|medianDate}} | {{::cert.pending ? \'WOT.SIGNED_ON_BLOCK\' : \'WOT.WRITTEN_ON_BLOCK\' | translate:cert}}

{{::cert.name||cert.uid}} {{::cert.pubkey | formatPubkey}}

{{::\'WOT.NOT_MEMBER_PARENTHESIS\'|translate}}

{{::cert.pubkey | formatPubkey}} | {{::cert.time|medianDate}} | {{::cert.pending ? \'WOT.SIGNED_ON_BLOCK\' : \'WOT.WRITTEN_ON_BLOCK\' | translate:cert}}

{{::cert.expiresIn | formatDurationTo}}
{{::\'WOT.EXPIRED\' | translate}}
'),e.put("templates/wot/item_content_identity.html",'

{{::item.pubkey|formatPubkey}}

{{::\'WOT.LOOKUP.REGISTERED\' | translate:item }}

{{::\'WOT.LOOKUP.MEMBER_FROM\' | translate:item}}

{{::item.uid}}  {{::item.pubkey | formatPubkey}} WOT.NOT_MEMBER_PARENTHESIS WOT.IDENTITY_REVOKED_PARENTHESIS

#

'),e.put("templates/wot/items_given_certifications.html",'
WOT.GIVEN_CERTIFICATIONS.SENT
WOT.GIVEN_CERTIFICATIONS.ERROR {{formData.given_cert_error.length}}
WOT.GIVEN_CERTIFICATIONS.PENDING_LIST
WOT.NOT_WRITTEN_EXPIRE_IN
WOT.GIVEN_CERTIFICATIONS.LIST
WOT.EXPIRE_IN
WOT.NO_GIVEN_CERTIFICATION
'),e.put("templates/wot/items_received_certifications.html",'
WOT.CERTIFICATIONS.RECEIVED

WOT.CERTIFICATIONS.SENTRY_MEMBER

WOT.CERTIFICATIONS.ERROR {{formData.received_cert_error.length}}
WOT.CERTIFICATIONS.PENDING_LIST
WOT.NOT_WRITTEN_EXPIRE_IN
WOT.CERTIFICATIONS.LIST
WOT.EXPIRE_IN
WOT.NO_CERTIFICATION
'),e.put("templates/wot/lookup_form.html",'
{{::parameters.help|translate}}
  

WOT.LOOKUP.NEWCOMERS

{{\'WOT.LOOKUP.NEWCOMERS_COUNT\'|translate:{count: search.total} }}

WOT.LOOKUP.PENDING

{{\'WOT.LOOKUP.PENDING_COUNT\'|translate:{count: search.total} }}

COMMON.RESULTS_LIST ({{search.total}})

WOT.SEARCH_INIT_PHASE_WARNING

COMMON.SEARCH_NO_RESULT WOT.LOOKUP.NO_PENDING WOT.LOOKUP.NO_NEWCOMERS
{{::(\'WOT.SEARCH.DIVIDER_\' + item.index)|upper|translate}}
'),e.put("templates/wot/lookup_lg.html",'{{\'MENU.WOT\' | translate}}'),e.put("templates/wot/lookup_popover_actions.html",'

COMMON.POPOVER_FILTER_TITLE

'),e.put("templates/wot/lookup.html",''),e.put("templates/wot/modal_lookup.html",'

{{::parameters.title?parameters.title:\'WOT.MODAL.TITLE\'|translate}}

'),e.put("templates/wot/modal_select_pubkey_identity.html",'

ACCOUNT.SELECT_IDENTITY_MODAL.TITLE

{{item.uid}}

{{::item.pubkey | formatPubkey}} WOT.NOT_MEMBER_PARENTHESIS WOT.IDENTITY_REVOKED_PARENTHESIS ERROR.WOT_PENDING_INVALID_BLOCK_HASH

WOT.REGISTERED_SINCE {{::item.meta.time|medianDate}}

'),e.put("templates/wot/tabs/tab_given_certifications.html",'
'),e.put("templates/wot/tabs/tab_lookup.html",''),e.put("templates/wot/tabs/tab_received_certifications.html",'
'),e.put("templates/wot/view_certifications.html",'{{::formData.name||formData.uid}}
'),e.put("templates/wot/view_identity_tx.html",'{{formData.name || formData.uid}} {{formData.pubkey|formatPubkey}}
{{:locale:\'ACCOUNT.BALANCE_ACCOUNT\'|translate}}
()
{{:locale:\'ACCOUNT.ERROR_TX\'|translate}}
{{formData.tx.errors.length}}
{{:locale:\'ACCOUNT.PENDING_TX\'|translate}}
{{:locale:\'ACCOUNT.VALIDATING_TX\'|translate}}
{{:locale:\'ACCOUNT.LAST_TX\'|translate}}  
'),e.put("templates/wot/view_identity.html",'

{{::formData.name}}

{{:rebind:formData.uid}}

{{:rebind:formData.pubkey | formatPubkey}}

WOT.IDENTITY_REVOKED_PARENTHESISWOT.MEMBER_PENDING_REVOCATION_PARENTHESIS

WOT.GENERAL_DIVIDER COMMON.PUBKEY

{{:rebind:formData.pubkey}}

WOT.NOT_MEMBER_ACCOUNT

WOT.NOT_MEMBER_ACCOUNT_HELP

COMMON.UID
WOT.REGISTERED_SINCE {{:rebind:formData.sigDate|medianDate}}
{{:rebind:formData.uid}}
ACCOUNT.CERTIFICATION_COUNT WOT.GIVEN_CERTIFICATIONS.SENT WOT.ACCOUNT_OPERATIONS
')}]),angular.module("cesium.translations",[]).config(["$translateProvider",function(e){e.translations("en-GB",{COMMON:{APP_NAME:"Cesium",APP_VERSION:"v{{version}}",APP_BUILD:"build {{build}}",PUBKEY:"Public key",MEMBER:"Member",BLOCK:"Block",BTN_OK:"OK",BTN_YES:"Yes",BTN_NO:"No",BTN_SEND:"Send",BTN_SEND_MONEY:"Transfer money",BTN_SEND_MONEY_SHORT:"Transfer",BTN_SAVE:"Save",BTN_YES_SAVE:"Yes, Save",BTN_YES_CONTINUE:"Yes, Continue",BTN_SHOW:"Show",BTN_SHOW_PUBKEY:"Show key",BTN_RELATIVE_UNIT:"Display amounts in UD?",BTN_BACK:"Back",BTN_NEXT:"Next",BTN_IMPORT:"Import",BTN_CANCEL:"Cancel",BTN_CLOSE:"Close",BTN_LATER:"Later",BTN_LOGIN:"Sign In",BTN_LOGOUT:"Logout",BTN_ADD_ACCOUNT:"New Account",BTN_SHARE:"Share",BTN_EDIT:"Edit",BTN_DELETE:"Delete",BTN_ADD:"Add",BTN_SEARCH:"Search",BTN_REFRESH:"Refresh",BTN_RETRY:"Retry",BTN_START:"Start",BTN_CONTINUE:"Continue",BTN_CREATE:"Create",BTN_UNDERSTOOD:"I understand",BTN_OPTIONS:"Options",BTN_HELP_TOUR:"Features tour",BTN_HELP_TOUR_SCREEN:"Discover this screen",BTN_DOWNLOAD:"Download",BTN_DOWNLOAD_ACCOUNT_STATEMENT:"Download account statement",BTN_MODIFY:"Modify",CHOOSE_FILE:"Drag your file
or click to select",DAYS:"days",NO_ACCOUNT_QUESTION:"Not a member yet? Register now!",SEARCH_NO_RESULT:"No result found",LOADING:"Loading...",LOADING_WAIT:"Loading...
(Waiting for node availability)",SEARCHING:"Searching...",FROM:"From",TO:"To",COPY:"Copy",LANGUAGE:"Language",UNIVERSAL_DIVIDEND:"Universal dividend",UD:"UD",DATE_PATTERN:"DD/MM/YYYY HH:mm",DATE_FILE_PATTERN:"YYYY-MM-DD",DATE_SHORT_PATTERN:"DD/MM/YY",DATE_MONTH_YEAR_PATTERN:"MM/YYYY",EMPTY_PARENTHESIS:"(empty)",UID:"Pseudonym",ENABLE:"Enabled",DISABLE:"Disabled",RESULTS_LIST:"Results:",RESULTS_COUNT:"{{count}} results",EXECUTION_TIME:"executed in {{duration|formatDurationMs}}",SHOW_VALUES:"Display values openly?",POPOVER_ACTIONS_TITLE:"Options",POPOVER_FILTER_TITLE:"Filters",SHOW_MORE:"Show more",SHOW_MORE_COUNT:"(current limit at {{limit}})",POPOVER_SHARE:{TITLE:"Share",SHARE_ON_TWITTER:"Share on Twitter",SHARE_ON_FACEBOOK:"Share on Facebook",SHARE_ON_DIASPORA:"Share on Diaspora*",SHARE_ON_GOOGLEPLUS:"Share on Google+"},FILE:{DATE:"Date:",TYPE:"Type:",SIZE:"Size:",VALIDATING:"Validating..."}},SYSTEM:{PICTURE_CHOOSE_TYPE:"Choose source:",BTN_PICTURE_GALLERY:"Gallery",BTN_PICTURE_CAMERA:"Camera"},MENU:{HOME:"Home",WOT:"Registry",CURRENCY:"Currency",ACCOUNT:"My Account",WALLETS:"My wallets",SETTINGS:"Settings",NETWORK:"Network",TRANSACTIONS:"My transactions"},ABOUT:{TITLE:"About",LICENSE:"Free/libre software (License GNU AGPLv3).",LATEST_RELEASE:"There is a newer version of {{'COMMON.APP_NAME' | translate}} (v{{version}})",PLEASE_UPDATE:"Please update {{'COMMON.APP_NAME' | translate}} (latest version: v{{version}})",CODE:"Source code:",OFFICIAL_WEB_SITE:"Official web site:",DEVELOPERS:"Developers:",FORUM:"Forum:",PLEASE_REPORT_ISSUE:"Please report any issue to us!",REPORT_ISSUE:"Report an issue",BTN_OPEN_DEV_WINDOW:"Open the debug window"},HOME:{TITLE:"Cesium",WELCOME:"Welcome to the Cesium application!",WELCOME_READONLY:"Welcome to Cesium Monit !",MESSAGE:"Receive and send libre currency {{currency|abbreviate}}",MESSAGE_READONLY:"Real-time monitoring of libre currency {{currency|abbreviate}}",BTN_CURRENCY:"Explore currency {{currency|abbreviate}}",BTN_ABOUT:"about",BTN_HELP:"Help",BTN_NETWORK:"Network status",FREE_SOFTWARE:"Free software",FORK_ME:"Fork me!",SHOW_LICENSE:"Show license",REPORT_ISSUE:"Report an issue",NOT_YOUR_ACCOUNT_QUESTION:'You do not own the account {{pubkey|formatPubkey}}?',BTN_CHANGE_ACCOUNT:"Disconnect this account",CONNECTION_ERROR:'Peer {{server}} unreachable or invalid address.

Check your Internet connection, or change node in the settings.',SHOW_ALL_FEED:"Show all",READ_MORE:"Read more",FEED_SOURCE:"Source"},SETTINGS:{TITLE:"Settings",DISPLAY_DIVIDER:"Display",STORAGE_DIVIDER:"Storage",NETWORK_SETTINGS:"Network",PEER:"Duniter peer address",PEER_SHORT:"Peer address",PEER_CHANGED_TEMPORARY:"Address used temporarily",PERSIST_CACHE:"Keep navigation data (experimental)",PERSIST_CACHE_HELP:"Allows faster navigation, locally retaining the data received, for use from one session to another.",USE_LOCAL_STORAGE:"Enable local storage",USE_LOCAL_STORAGE_HELP:"Allows you to save your settings",WALLETS_SETTINGS:"My wallets",USE_WALLETS_ENCRYPTION:"Secure the list",USE_WALLETS_ENCRYPTION_HELP:"Enables you to encrypt the list of your wallets. Authentication required to access it.",ENABLE_HELPTIP:"Enable contextual help tips",DISABLE_HELPTIP:"Disable contextual help tips",ENABLE_UI_EFFECTS:"Enable visual effects",HISTORY_SETTINGS:"Account operations",DISPLAY_UD_HISTORY:"Display produced dividends?",TX_HISTORY_AUTO_REFRESH:"Enable automatic refresh?",TX_HISTORY_AUTO_REFRESH_HELP:"Updates the list of operations to each new block.",AUTHENTICATION_SETTINGS:"Authentication",KEEP_AUTH:"Expiration of authentication",KEEP_AUTH_SHORT:"Expiration",KEEP_AUTH_HELP:"Define when authentication is cleared from memory.",KEEP_AUTH_OPTION:{NEVER:"After each operation",SECONDS:"After {{value}}s of inactivity",MINUTE:"After {{value}}min of inactivity",MINUTES:"After {{value}}min of inactivity",HOUR:"After {{value}}h of inactivity",ALWAYS:"At the end of the session"},KEYRING_FILE:"Keyring file",KEYRING_FILE_HELP:'Allow auto-connect at startup, or to authenticate (only if "Expiration of authentication" is "at the end of the session"',REMEMBER_ME:"Remember me ?",REMEMBER_ME_HELP:"Allows to remain identified from one session to another, keeping the public key locally.",PLUGINS_SETTINGS:"Extensions",BTN_RESET:"Restore default values",EXPERT_MODE:"Enable expert mode",EXPERT_MODE_HELP:"Allow to see more details",BLOCK_VALIDITY_WINDOW:"Block uncertainty time",BLOCK_VALIDITY_WINDOW_SHORT:"Time of uncertainty",BLOCK_VALIDITY_WINDOW_HELP:"Time to wait before considering an information is validated",BLOCK_VALIDITY_OPTION:{NONE:"No delay",N:"{{time | formatDuration}} ({{count}} blocks)"},POPUP_PEER:{TITLE:"Duniter peer",HOST:"Address",HOST_HELP:"Address: server:port",USE_SSL:"Secured?",USE_SSL_HELP:"(SSL Encryption)",BTN_SHOW_LIST:"Peer's list"}},BLOCKCHAIN:{HASH:"Hash: {{hash}}",VIEW:{HEADER_TITLE:"Block #{{number}}-{{hash|formatHash}}",TITLE_CURRENT:"Current block",TITLE:"Block #{{number|formatInteger}}",COMPUTED_BY:"Computed by",SHOW_RAW:"Show raw data",TECHNICAL_DIVIDER:"Technical informations",VERSION:"Format version",HASH:"Computed hash",UNIVERSAL_DIVIDEND_HELP:"Money co-produced by each of the {{membersCount}} members",EMPTY:"Aucune donnée dans ce bloc",POW_MIN:"Minimal difficulty",POW_MIN_HELP:"Difficulty imposed in calculating hash",DATA_DIVIDER:"Data",IDENTITIES_COUNT:"New identities",JOINERS_COUNT:"Joiners",ACTIVES_COUNT:"Renewals",ACTIVES_COUNT_HELP:"Members having renewed their membership",LEAVERS_COUNT:"Leavers",LEAVERS_COUNT_HELP:"Members that now refused certification",EXCLUDED_COUNT:"Excluded members",EXCLUDED_COUNT_HELP:"Old members, excluded because missing membreship renewal or certifications",REVOKED_COUNT:"Revoked identities",REVOKED_COUNT_HELP:"These accounts may no longer be member",TX_COUNT:"Transactions",CERT_COUNT:"Certifications",TX_TO_HIMSELF:"Change",TX_OUTPUT_UNLOCK_CONDITIONS:"Unlock conditions",TX_OUTPUT_OPERATOR:{AND:"and",OR:"or"},TX_OUTPUT_FUNCTION:{SIG:"Sign of the public key",XHX:"Password, including SHA256 =",CSV:"Blocked during",CLTV:"Bloqué until"}},LOOKUP:{TITLE:"Blocks",NO_BLOCK:"No bloc",LAST_BLOCKS:"Last blocks:",BTN_COMPACT:"Compact"}},CURRENCY:{VIEW:{TITLE:"Currency",TAB_CURRENCY:"Currency",TAB_WOT:"Web of trust",TAB_NETWORK:"Network",TAB_BLOCKS:"Blocks",CURRENCY_SHORT_DESCRIPTION:"{{currency|capitalize}} is a libre money, started {{firstBlockTime | formatFromNow}}. It currently counts {{N}} members , who produce and collect a Universal Dividend (DU), each {{dt | formatPeriod}}.",NETWORK_RULES_DIVIDER:"Network rules",CURRENCY_NAME:"Currency name",MEMBERS:"Members count",MEMBERS_VARIATION:"Variation since {{duration|formatDuration}} (since last UD)",MONEY_DIVIDER:"Money",MASS:"Monetary mass",SHARE:"Money share",UD:"Universal Dividend",C_ACTUAL:"Current growth",MEDIAN_TIME:"Current blockchain time",POW_MIN:"Common difficulty",MONEY_RULES_DIVIDER:"Rules of currency",C_RULE:"Theoretical growth target",UD_RULE:"Universal dividend (formula)",DT_REEVAL:"Period between two re-evaluation of the UD",REEVAL_SYMBOL:"reeval",DT_REEVAL_VALUE:"Every {{dtReeval|formatDuration}} ({{dtReeval/86400}} {{'COMMON.DAYS'|translate}})",UD_REEVAL_TIME0:"Date of first reevaluation of the UD",SIG_QTY_RULE:"Required number of certifications to become a member",SIG_STOCK:"Maximum number of certifications sent by a member",SIG_PERIOD:"Minimum delay between 2 certifications sent by one and the same issuer.",SIG_WINDOW:"Maximum delay before a certification will be treated",SIG_VALIDITY:"Lifetime of a certification that has been treated",MS_WINDOW:"Maximum delay before a pending membership will be treated",MS_VALIDITY:"Lifetime of a membership that has been treated",STEP_MAX:"Maximum distance between a newcomer and each referring members.",WOT_RULES_DIVIDER:"Rules for web of trust",SENTRIES:"Required number of certifications (given and received) to become a referring member",SENTRIES_FORMULA:"Required number of certifications to become a referring member (formula)",XPERCENT:"Minimum percent of referring member to reach to match the distance rule",AVG_GEN_TIME:"The average time between 2 blocks",CURRENT:"current",MATH_CEILING:"CEILING",DISPLAY_ALL_RULES:"Display all rules?",BTN_SHOW_LICENSE:"Show license",WOT_DIVIDER:"Web of trust"},LICENSE:{TITLE:"Currency license",BTN_DOWNLOAD:"Download file",NO_LICENSE_FILE:"License file not found."}},NETWORK:{VIEW:{MEDIAN_TIME:"Blockchain time",LOADING_PEERS:"Loading peers...",NODE_ADDRESS:"Address:",SOFTWARE:"Software:",WARN_PRE_RELEASE:"Pre-release (latest stable: {{version}})",WARN_NEW_RELEASE:"Version {{version}} available",WS2PID:"Identifier:",PRIVATE_ACCESS:"Private access",POW_PREFIX:"Proof of work prefix:",ENDPOINTS:{BMAS:"Secure endpoint (SSL)",BMATOR:"TOR endpoint",WS2P:"WS2P endpoint",ES_USER_API:"Cesium+ data node"}},INFO:{ONLY_SSL_PEERS:"Non-SSL nodes have a degraded display because Cesium works in HTTPS mode."}},PEER:{PEERS:"Peers",SIGNED_ON_BLOCK:"Signed on block",MIRROR:"mirror",MIRRORS:"Mirrors",MIRROR_PEERS:"Mirror peers",PEER_LIST:"Peer's list",MEMBERS:"Members",MEMBER_PEERS:"Member peers",ALL_PEERS:"All peers",DIFFICULTY:"Difficulty",API:"API",CURRENT_BLOCK:"Block #",POPOVER_FILTER_TITLE:"Filter",OFFLINE:"Offline",OFFLINE_PEERS:"Offline peers",BTN_SHOW_PEER:"Show peer",VIEW:{TITLE:"Peer",OWNER:"Owned by ",SHOW_RAW_PEERING:"See peering document",SHOW_RAW_CURRENT_BLOCK:"See current block (raw format)",LAST_BLOCKS:"Last blocks",KNOWN_PEERS:"Known peers :",GENERAL_DIVIDER:"General information",ERROR:{LOADING_TOR_NODE_ERROR:"Could not get peer data, using the TOR network.",LOADING_NODE_ERROR:"Could not get peer data"}}},WOT:{SEARCH_HELP:"Search (member or public key)",SEARCH_INIT_PHASE_WARNING:"During the pre-registration phase, the search for pending registrations may be long. Please wait ...",REGISTERED_SINCE:"Registered on",REGISTERED_SINCE_BLOCK:"Registered since block #",NO_CERTIFICATION:"No validated certification",NO_GIVEN_CERTIFICATION:"No given certification",NOT_MEMBER_PARENTHESIS:"(non-member)",IDENTITY_REVOKED_PARENTHESIS:"(identity revoked)",MEMBER_PENDING_REVOCATION_PARENTHESIS:"(being revoked)",EXPIRE_IN:"Expires",NOT_WRITTEN_EXPIRE_IN:"Deadline
treatment",EXPIRED:"Expired",PSEUDO:"Pseudonym",SIGNED_ON_BLOCK:"Emitted on block #{{block}}",WRITTEN_ON_BLOCK:"Written on block #{{block}}",GENERAL_DIVIDER:"General information",NOT_MEMBER_ACCOUNT:"Non-member account",NOT_MEMBER_ACCOUNT_HELP:"This is a simple wallet, with no pending membership application.",TECHNICAL_DIVIDER:"Technical data",BTN_CERTIFY:"Certify",BTN_YES_CERTIFY:"Yes, certify",BTN_SELECT_AND_CERTIFY:"New certification",ACCOUNT_OPERATIONS:"Account operations",VIEW:{POPOVER_SHARE_TITLE:"Identity {{title}}"},LOOKUP:{TITLE:"Registry",NEWCOMERS:"New members:",NEWCOMERS_COUNT:"{{count}} members",PENDING:"Pending registrations:",PENDING_COUNT:"{{count}} pending registrations",REGISTERED:"Registered {{sigDate | formatFromNow}}",MEMBER_FROM:"Member since {{memberDate|medianFromNowShort}}",BTN_NEWCOMERS:"Latest members",BTN_PENDING:"Pending registrations",SHOW_MORE:"Show more",SHOW_MORE_COUNT:"(current limit to {{limit}})",NO_PENDING:"No pending registrations.",NO_NEWCOMERS:"No members."},CONTACTS:{TITLE:"Contacts"},MODAL:{TITLE:"Search"},CERTIFICATIONS:{TITLE:"{{uid}} - Certifications",SUMMARY:"Received certifications",LIST:"Details of received certifications",PENDING_LIST:"Pending certifications",RECEIVED:"Received certifications",RECEIVED_BY:"Certifications received by {{uid}}",ERROR:"Received certifications in error",SENTRY_MEMBER:"Referring member"},OPERATIONS:{TITLE:"{{uid}} - Operations"},GIVEN_CERTIFICATIONS:{TITLE:"{{uid}} - Certifications sent",SUMMARY:"Sent certifications",LIST:"Details of sent certifications",PENDING_LIST:"Pending certifications",SENT:"Sent certifications",SENT_BY:"Certifications sent by {{uid}}",ERROR:"Sent certifications with error"}},LOGIN:{TITLE:' Login',SCRYPT_FORM_HELP:"Please enter your credentials.
Remember to check the public key for your account.",PUBKEY_FORM_HELP:"Please enter a public account key:",FILE_FORM_HELP:"Choose the keychain file to use:",SCAN_FORM_HELP:"Scan the QR code of a wallet.",SALT:"Secret identifier",SALT_HELP:"Secret identifier",SHOW_SALT:"Display secret identifier?",PASSWORD:"Password",PASSWORD_HELP:"Password",PUBKEY_HELP:"Public key or pseudonym",NO_ACCOUNT_QUESTION:"Don't have an account yet?",HAVE_ACCOUNT_QUESTION:"Already have an account ?",CREATE_ACCOUNT:"Create an account",CREATE_FREE_ACCOUNT:"Create a free account",FORGOTTEN_ID:"Forgot password?",ASSOCIATED_PUBKEY:"Public key :",BTN_METHODS:"Other methods",BTN_METHODS_DOTS:"Change method...",METHOD_POPOVER_TITLE:"Methods",MEMORIZE_AUTH_FILE:"Memorize this keychain during the navigation session",SCRYPT_PARAMETERS:"Paramètres (Scrypt) :",AUTO_LOGOUT:{TITLE:"Information",MESSAGE:' You were logout automatically, due to prolonged inactivity.',BTN_RELOGIN:"Sign In",IDLE_WARNING:"You will be logout... {{countdown}}"},METHOD:{SCRYPT_DEFAULT:"Secret identifier and password",SCRYPT_ADVANCED:"Advanced salt",FILE:"Keychain file",PUBKEY:"Public key or pseudonym",SCAN:"Scan a QR code"},SCRYPT:{SIMPLE:"Light salt",DEFAULT:"Standard salt",SECURE:"Secure salt",HARDEST:"Hardest salt",EXTREME:"Extreme salt",USER:"Personal value",N:"N (Loop):",r:"r (RAM):",p:"p (CPU):"},FILE:{HELP:"Expected file format: .dunikey (type PubSec). Other formats are under development (EWIF, WIF)."}},AUTH:{TITLE:' Authentication',BTN_AUTH:"Authenticate",GENERAL_HELP:"Please authenticate yourself:",EXPECTED_UID_HELP:'Please authenticate to the account {{uid}}:',EXPECTED_PUBKEY_HELP:'Please authenticate to the wallet {{pubkey|formatPubkey}}:',SCAN_FORM_HELP:"Scan the QR code of the private key of the wallet."},ACCOUNT:{TITLE:"My Account",BALANCE:"Balance",LAST_TX:"Latest validated transactions",BALANCE_ACCOUNT:"Account balance",NO_TX:"No transaction",SHOW_MORE_TX:"Show more",SHOW_ALL_TX:"Show all",TX_FROM_DATE:"(current limit to {{fromTime|medianFromNowShort}})",PENDING_TX:"Pending transactions",VALIDATING_TX:"Transactions being validated",ERROR_TX:"Transaction not executed",ERROR_TX_SENT:"Sent transactions",PENDING_TX_RECEIVED:"Transactions awaiting receipt",EVENTS:"Events",OUT_DISTANCED:"Your current certifications come from a group too isolated from the Web of Trust (WoT): the maximum distance rule is violated.
You must obtain certifications from another area of the Web of Trust, or wait for it to tighten.",WAITING_MEMBERSHIP:"Membership application sent. Waiting validation.",WAITING_CERTIFICATIONS:"You need {{needCertificationCount}} certification(s) to become a member and produce the Universal Dividend. Your account is however already operational, to receive and send payments.",WAITING_CERTIFICATIONS_HELP:'To get your certifications, only request members who know you enough, as required by the currency license that you have accepted.
If you do not know enough members, let them know on the user forum.',WILL_MISSING_CERTIFICATIONS:"You will lack certifications soon (at least {{willNeedCertificationCount}} more are needed)",WILL_NEED_RENEW_MEMBERSHIP:"Your membership will expire {{membershipExpiresIn|formatDurationTo}}. Remember to renew your membership before then.",NEED_RENEW_MEMBERSHIP:"You are no longer a member because your membership has expired. Remember to renew your membership.",NEED_RENEW_MEMBERSHIP_AFTER_CANCELLED:"You are no longer a member because your membership has been cancelled for lack of certifications. Remember to renew your membership.",NO_WAITING_MEMBERSHIP:"No membership application pending. If you'd like to become a member, please send the membership application.",CERTIFICATION_COUNT:"Received certifications",CERTIFICATION_COUNT_SHORT:"Certifications",SIG_STOCK:"Stock of certifications to give",BTN_RECEIVE_MONEY:"Receive",BTN_SELECT_ALTERNATIVES_IDENTITIES:"Switch to another identity...",BTN_FIX_MEMBERSHIP:"Resubmit membership request...",BTN_MEMBERSHIP_RENEW:"Renew membership",BTN_MEMBERSHIP_RENEW_DOTS:"Renew membership...",BTN_MEMBERSHIP_OUT_DOTS:"Revoke membership...",BTN_SECURITY_DOTS:"Sign-in and security...",BTN_SHOW_DETAILS:"Display technical data",LOCKED_OUTPUTS_POPOVER:{TITLE:"Locked amount",DESCRIPTION:"Here are the conditions for unlocking this amount:",DESCRIPTION_MANY:"This transaction consists of several parts, of which the unlock conditions are:",LOCKED_AMOUNT:"Conditions for the amount:"},NEW:{TITLE:"Registration",INTRO_WARNING_TIME:"Creating an account on {{name|capitalize}} is very simple. Please take sufficient time to do this correctly (not to forget the usernames, passwords, etc.).",INTRO_WARNING_SECURITY:"Check that the hardware you are currently using (computer, tablet, phone) is secure and trustworthy .",INTRO_WARNING_SECURITY_HELP:"Up-to-date anti-virus, firewall enabled, session protected by password or pin code...",INTRO_HELP:"Click {{'COMMON.BTN_START'|translate}} to begin creating an account. You will be guided step by step.",REGISTRATION_NODE:"Your registration will be registered via the Duniter peer {{server}} node, which will then be distributed to the rest of the currency network.",REGISTRATION_NODE_HELP:"If you do not trust this peer, please change in the settings of Cesium.",SELECT_ACCOUNT_TYPE:"Choose the type of account to create:",MEMBER_ACCOUNT:"Member account",MEMBER_ACCOUNT_TITLE:"Create a member account",MEMBER_ACCOUNT_HELP:"If you are not yet registered as an individual (one account possible per individual).",WALLET_ACCOUNT:"Simple wallet",WALLET_ACCOUNT_TITLE:"Create a wallet",WALLET_ACCOUNT_HELP:"If you represent a company, association, etc. or simply need an additional wallet. No universal dividend will be created by this account.",SALT_WARNING:"Choose a secret identifier.
You need it for each connection to this account.

Make sure to remember this identifier.
If lost, there are no means to retrieve it!",PASSWORD_WARNING:"Choose a password.
You need it for each connection to this account.

Make sure to remember this password.
If lost, there are no means to retrieve it!",PSEUDO_WARNING:"Choose a pseudonym.
It may be used by other people to find you more easily.

.Use of commas, spaces and accents is not allowed.