├── dist └── out-tsc │ ├── main.d.ts │ ├── app │ ├── app.module.d.ts │ ├── app.component.d.ts │ ├── globals.d.ts │ ├── routes.d.ts │ ├── home │ │ └── home.component.d.ts │ ├── sendether │ │ └── sendether.component.d.ts │ ├── service │ │ └── shared.service.d.ts │ ├── history │ │ └── history.component.d.ts │ ├── permission │ │ └── permission.component.d.ts │ ├── withdraw-form │ │ └── withdraw-form.component.d.ts │ └── deposit-form │ │ └── deposit-form.component.d.ts │ ├── polyfills.d.ts │ ├── environments │ └── environment.d.ts │ └── vendor.d.ts ├── src ├── assets │ ├── .gitkeep │ └── style.css ├── app │ ├── app.component.css │ ├── home │ │ ├── home.component.css │ │ ├── home.component.html │ │ ├── home.component.spec.ts │ │ └── home.component.ts │ ├── history │ │ ├── history.component.css │ │ ├── history.component.html │ │ ├── history.component.spec.ts │ │ └── history.component.ts │ ├── permission │ │ ├── permission.component.css │ │ ├── permission.component.ts │ │ ├── permission.component.spec.ts │ │ └── permission.component.html │ ├── sendether │ │ ├── sendether.component.css │ │ ├── sendether.component.html │ │ ├── sendether.component.ts │ │ └── sendether.component.spec.ts │ ├── deposit-form │ │ ├── deposit-form.component.css │ │ ├── deposit-form.component.spec.ts │ │ ├── deposit-form.component.html │ │ └── deposit-form.component.ts │ ├── withdraw-form │ │ ├── withdraw-form.component.css │ │ ├── withdraw-form.component.spec.ts │ │ ├── withdraw-form.component.ts │ │ └── withdraw-form.component.html │ ├── service │ │ ├── shared.service.spec.ts │ │ └── shared.service.ts │ ├── app.component.ts │ ├── routes.ts │ ├── app.component.spec.ts │ ├── app.module.ts │ ├── app.component.html │ └── globals.ts ├── favicon.ico ├── styles.css ├── environments │ ├── environment.prod.ts │ └── environment.ts ├── polyfills.ts ├── index.html ├── main.ts ├── tsconfig.json ├── vendor.ts ├── test.ts └── js │ └── web3.min.js ├── .gitignore ├── webpack.config.js ├── migrations ├── 1_initial_migration.js └── 2_deploy_contracts.js ├── config ├── helpers.js ├── index.html ├── webpack.dev.js ├── webpack.prod.js └── webpack.common.js ├── e2e ├── app.po.ts ├── app.e2e-spec.ts └── tsconfig.json ├── .editorconfig ├── contracts ├── Migrations.sol └── SimpleWallet.sol ├── protractor.conf.js ├── karma.conf.js ├── .angular-cli.json ├── truffle.js ├── README.md ├── package.json ├── tslint.json ├── test └── simplewallet.js └── .bootstraprc /dist/out-tsc/main.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/app.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | .DS_Store -------------------------------------------------------------------------------- /src/app/history/history.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/permission/permission.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/deposit-form/deposit-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/app/withdraw-form/withdraw-form.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./config/webpack.dev.js'); -------------------------------------------------------------------------------- /dist/out-tsc/app/app.module.d.ts: -------------------------------------------------------------------------------- 1 | export declare class AppModule { 2 | } 3 | -------------------------------------------------------------------------------- /dist/out-tsc/app/app.component.d.ts: -------------------------------------------------------------------------------- 1 | export declare class AppComponent { 2 | } 3 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ratimon/MyDWallet/HEAD/src/favicon.ico -------------------------------------------------------------------------------- /dist/out-tsc/polyfills.d.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es6'; 2 | import 'core-js/es7/reflect'; 3 | -------------------------------------------------------------------------------- /src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /dist/out-tsc/app/globals.d.ts: -------------------------------------------------------------------------------- 1 | export declare var web3: any; 2 | export declare var SimpleWallet: any; 3 | -------------------------------------------------------------------------------- /dist/out-tsc/app/routes.d.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from "@angular/router"; 2 | export declare const routes: Routes; 3 | -------------------------------------------------------------------------------- /dist/out-tsc/environments/environment.d.ts: -------------------------------------------------------------------------------- 1 | export declare const environment: { 2 | production: boolean; 3 | }; 4 | -------------------------------------------------------------------------------- /migrations/1_initial_migration.js: -------------------------------------------------------------------------------- 1 | var Migrations = artifacts.require("./Migrations.sol"); 2 | 3 | module.exports = function(deployer) { 4 | deployer.deploy(Migrations); 5 | }; 6 | -------------------------------------------------------------------------------- /migrations/2_deploy_contracts.js: -------------------------------------------------------------------------------- 1 | var SimpleWallet = artifacts.require("./SimpleWallet.sol"); 2 | module.exports = function(deployer) { 3 | deployer.deploy(SimpleWallet); 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.html: -------------------------------------------------------------------------------- 1 |

All Addresses

2 | 3 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /config/helpers.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var _root = path.resolve(__dirname, '..'); 3 | function root(args) { 4 | args = Array.prototype.slice.call(arguments, 0); 5 | return path.join.apply(path, [_root].concat(args)); 6 | } 7 | exports.root = root; 8 | -------------------------------------------------------------------------------- /e2e/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, element, by } from 'protractor'; 2 | 3 | export class MyDWalletPage { 4 | navigateTo() { 5 | return browser.get('/'); 6 | } 7 | 8 | getParagraphText() { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /dist/out-tsc/app/home/home.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { SharedService } from '../service/shared.service'; 3 | export declare class HomeComponent implements OnInit { 4 | private ss; 5 | constructor(ss: SharedService); 6 | ngOnInit(): void; 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /src/polyfills.ts: -------------------------------------------------------------------------------- 1 | import 'core-js/es6'; 2 | import 'core-js/es7/reflect'; 3 | require('zone.js/dist/zone'); 4 | 5 | if (process.env.ENV === 'production') { 6 | // Production 7 | } else { 8 | // Development and test 9 | Error['stackTraceLimit'] = Infinity; 10 | require('zone.js/dist/long-stack-trace-zone'); 11 | } 12 | 13 | -------------------------------------------------------------------------------- /dist/out-tsc/app/sendether/sendether.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { SharedService } from '../service/shared.service'; 3 | export declare class SendetherComponent implements OnInit { 4 | private ss; 5 | addresses: string[]; 6 | constructor(ss: SharedService); 7 | ngOnInit(): void; 8 | } 9 | -------------------------------------------------------------------------------- /dist/out-tsc/app/service/shared.service.d.ts: -------------------------------------------------------------------------------- 1 | export declare class SharedService { 2 | accounts: any; 3 | has_errors: string; 4 | transfer_success: boolean; 5 | balanceInEther: number; 6 | contract_address: string; 7 | contract_abi: any; 8 | ourEvents: any[]; 9 | ourDepositEvents: any[]; 10 | withdrawls: any[]; 11 | constructor(); 12 | } 13 | -------------------------------------------------------------------------------- /e2e/app.e2e-spec.ts: -------------------------------------------------------------------------------- 1 | import { MyDWalletPage } from './app.po'; 2 | 3 | describe('my-dwallet App', () => { 4 | let page: MyDWalletPage; 5 | 6 | beforeEach(() => { 7 | page = new MyDWalletPage(); 8 | }); 9 | 10 | it('should display message saying app works', () => { 11 | page.navigateTo(); 12 | expect(page.getParagraphText()).toEqual('app works!'); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /dist/out-tsc/app/history/history.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { SharedService } from '../service/shared.service'; 3 | export declare class HistoryComponent implements OnInit { 4 | private ss; 5 | ourEvents: any[]; 6 | ourDepositEvents: any[]; 7 | withdrawls: any[]; 8 | constructor(ss: SharedService); 9 | ngOnInit(): void; 10 | } 11 | -------------------------------------------------------------------------------- /dist/out-tsc/app/permission/permission.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { SharedService } from '../service/shared.service'; 3 | export declare class PermissionComponent implements OnInit { 4 | private ss; 5 | loading: Boolean; 6 | success: Boolean; 7 | error: Boolean; 8 | constructor(ss: SharedService); 9 | ngOnInit(): void; 10 | } 11 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MyDWallet 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Loading... 14 | 15 | 16 | -------------------------------------------------------------------------------- /config/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | MyDWallet 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | Loading... 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | import {SharedService} from './app/service/shared.service' 7 | 8 | 9 | if (environment.production) { 10 | enableProdMode(); 11 | } 12 | 13 | platformBrowserDynamic().bootstrapModule(AppModule); 14 | -------------------------------------------------------------------------------- /src/app/service/shared.service.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, inject } from '@angular/core/testing'; 2 | import { SharedService } from './shared.service'; 3 | 4 | describe('SharedService', () => { 5 | beforeEach(() => { 6 | TestBed.configureTestingModule({ 7 | providers: [SharedService] 8 | }); 9 | }); 10 | 11 | it('should ...', inject([SharedService], (service: SharedService) => { 12 | expect(service).toBeTruthy(); 13 | })); 14 | }); 15 | -------------------------------------------------------------------------------- /dist/out-tsc/vendor.d.ts: -------------------------------------------------------------------------------- 1 | import '@angular/platform-browser'; 2 | import '@angular/platform-browser-dynamic'; 3 | import '@angular/core'; 4 | import '@angular/common'; 5 | import "@angular/compiler"; 6 | import '@angular/http'; 7 | import '@angular/router'; 8 | import '@angular/forms'; 9 | import 'rxjs'; 10 | import 'core-js'; 11 | import 'zone.js'; 12 | import 'web3'; 13 | import "lodash"; 14 | import "truffle-contract"; 15 | import "json-loader"; 16 | -------------------------------------------------------------------------------- /src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | // import {bootstrap} from '@angular/platform-browser-dynamic' 3 | import {SharedService} from './service/shared.service' 4 | 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | templateUrl: './app.component.html', 9 | styleUrls: ['./app.component.css'], 10 | providers: [SharedService] 11 | }) 12 | export class AppComponent { 13 | // title = 'app works!'; 14 | } 15 | 16 | // bootstrap 17 | -------------------------------------------------------------------------------- /e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "declaration": false, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "es2016" 9 | ], 10 | "module": "commonjs", 11 | "moduleResolution": "node", 12 | "outDir": "../dist/out-tsc-e2e", 13 | "sourceMap": true, 14 | "target": "es6", 15 | "typeRoots": [ 16 | "../node_modules/@types" 17 | ] 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/app/service/shared.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable() 4 | export class SharedService { 5 | 6 | // name:string="test" 7 | accounts:any 8 | has_errors: string 9 | transfer_success:boolean 10 | balanceInEther: number 11 | // depositFunds: Function 12 | 13 | contract_address:string 14 | contract_abi:any 15 | 16 | ourEvents:any[]; 17 | ourDepositEvents:any[]; 18 | withdrawls:any[]; 19 | 20 | 21 | constructor() { 22 | 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "", 4 | "declaration": true, 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "lib": [ 8 | "es2016", 9 | "dom" 10 | ], 11 | "mapRoot": "./", 12 | "module": ["es2015", "commonjs"], 13 | "moduleResolution": "node", 14 | "outDir": "../dist/out-tsc", 15 | "sourceMap": true, 16 | "target": "es5", 17 | "typeRoots": [ 18 | "../node_modules/@types" 19 | ], 20 | "noImplicitAny": true, 21 | "suppressImplicitAnyIndexErrors": true 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /contracts/Migrations.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.4; 2 | 3 | contract Migrations { 4 | address public owner; 5 | uint public last_completed_migration; 6 | 7 | modifier restricted() { 8 | if (msg.sender == owner) _; 9 | } 10 | 11 | function Migrations() { 12 | owner = msg.sender; 13 | } 14 | 15 | function setCompleted(uint completed) restricted { 16 | last_completed_migration = completed; 17 | } 18 | 19 | function upgrade(address new_address) restricted { 20 | Migrations upgraded = Migrations(new_address); 21 | upgraded.setCompleted(last_completed_migration); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/app/permission/permission.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {SharedService} from '../service/shared.service'; 3 | import * as myGlobals from '../globals' 4 | 5 | @Component({ 6 | selector: 'permission', 7 | templateUrl: './permission.component.html', 8 | styleUrls: ['./permission.component.css'] 9 | }) 10 | export class PermissionComponent implements OnInit { 11 | 12 | loading : Boolean = false 13 | success : Boolean = false 14 | error : Boolean = false 15 | 16 | constructor(private ss: SharedService) { } 17 | 18 | ngOnInit() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/vendor.ts: -------------------------------------------------------------------------------- 1 | // Angular 2 | import '@angular/platform-browser'; 3 | import '@angular/platform-browser-dynamic'; 4 | import '@angular/core'; 5 | import '@angular/common'; 6 | import "@angular/compiler"; 7 | import '@angular/http'; 8 | import '@angular/router'; 9 | import '@angular/forms' 10 | 11 | // RxJS 12 | import 'rxjs'; 13 | 14 | // Other vendors for example jQuery, Lodash or Bootstrap 15 | // You can import js, ts, css, sass, ... 16 | import 'core-js' 17 | import 'zone.js' 18 | import 'web3' 19 | import "lodash" 20 | import "truffle-contract" 21 | // import "truffle-solidity-loader" 22 | import "json-loader" 23 | -------------------------------------------------------------------------------- /dist/out-tsc/app/withdraw-form/withdraw-form.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { FormGroup, FormControl } from '@angular/forms'; 3 | import { SharedService } from '../service/shared.service'; 4 | export declare class WithdrawFormComponent implements OnInit { 5 | private ss; 6 | addresses: string[]; 7 | myform: FormGroup; 8 | etherAmount: FormControl; 9 | addressTo: FormControl; 10 | transfer_success: boolean; 11 | has_errors: string; 12 | constructor(ss: SharedService); 13 | ngOnInit(): void; 14 | createFormControls(): void; 15 | createForm(): void; 16 | onSubmit(): void; 17 | } 18 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {SharedService} from '../service/shared.service'; 3 | import * as myGlobals from '../globals' 4 | 5 | 6 | 7 | @Component({ 8 | selector: 'sendether', 9 | templateUrl: './sendether.component.html', 10 | styleUrls: ['./sendether.component.css'] 11 | }) 12 | export class SendetherComponent implements OnInit { 13 | 14 | addresses: string[] = this.ss.accounts 15 | 16 | constructor(private ss: SharedService) { 17 | ss.accounts = myGlobals.web3.eth.accounts 18 | } 19 | 20 | ngOnInit() { 21 | 22 | this.addresses = this.ss.accounts 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /config/webpack.dev.js: -------------------------------------------------------------------------------- 1 | var webpackMerge = require('webpack-merge'); 2 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 3 | var commonConfig = require('./webpack.common.js'); 4 | var helpers = require('./helpers'); 5 | 6 | module.exports = webpackMerge(commonConfig, { 7 | devtool: 'cheap-module-eval-source-map', 8 | 9 | output: { 10 | path: helpers.root('dist'), 11 | publicPath: 'http://localhost:8080/', 12 | filename: '[name].js', 13 | chunkFilename: '[id].chunk.js' 14 | }, 15 | 16 | plugins: [ 17 | new ExtractTextPlugin('[name].css') 18 | ], 19 | 20 | devServer: { 21 | historyApiFallback: true, 22 | stats: 'minimal' 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /dist/out-tsc/app/deposit-form/deposit-form.component.d.ts: -------------------------------------------------------------------------------- 1 | import { OnInit } from '@angular/core'; 2 | import { FormGroup, FormControl } from '@angular/forms'; 3 | import { SharedService } from '../service/shared.service'; 4 | export declare class DepositFormComponent implements OnInit { 5 | private ss; 6 | addresses: string[]; 7 | myform: FormGroup; 8 | etherAmount: FormControl; 9 | addressFrom: FormControl; 10 | transfer_success: boolean; 11 | has_errors: string; 12 | SimpleContract: any; 13 | constructor(ss: SharedService); 14 | ngOnInit(): void; 15 | createFormControls(): void; 16 | createForm(): void; 17 | onSubmit(): void; 18 | } 19 | -------------------------------------------------------------------------------- /src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |

Balance in Main Account

5 | {{ss.balanceInEther | number : '1.2-2'}} eth 6 | 7 | 20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /src/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HomeComponent } from './home.component'; 4 | 5 | describe('HomeComponent', () => { 6 | let component: HomeComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HomeComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HomeComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/history/history.component.html: -------------------------------------------------------------------------------- 1 | 4 | 5 |

All Events

6 |
7 | Name: {{event.event}} 8 | Amount: {{event.args.amount}} 9 |
10 | 11 |
12 |
13 | 14 |

Deposits

15 |
16 | Name: {{event.event}} 17 | Amount: {{event.args.amount}} 18 |
19 |
20 |
21 | 22 |

Withdrawls

23 |
24 | To: {{withdrawl[0]}}
25 | Amount in Ether: {{withdrawl[1]}} 26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /src/app/history/history.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { HistoryComponent } from './history.component'; 4 | 5 | describe('HistoryComponent', () => { 6 | let component: HistoryComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ HistoryComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(HistoryComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/sendether/sendether.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { SendetherComponent } from './sendether.component'; 4 | 5 | describe('SendetherComponent', () => { 6 | let component: SendetherComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ SendetherComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(SendetherComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/permission/permission.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { PermissionComponent } from './permission.component'; 4 | 5 | describe('PermissionComponent', () => { 6 | let component: PermissionComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ PermissionComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(PermissionComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/deposit-form/deposit-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { DepositFormComponent } from './deposit-form.component'; 4 | 5 | describe('DepositFormComponent', () => { 6 | let component: DepositFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ DepositFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(DepositFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/withdraw-form/withdraw-form.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 2 | 3 | import { WithdrawFormComponent } from './withdraw-form.component'; 4 | 5 | describe('WithdrawFormComponent', () => { 6 | let component: WithdrawFormComponent; 7 | let fixture: ComponentFixture; 8 | 9 | beforeEach(async(() => { 10 | TestBed.configureTestingModule({ 11 | declarations: [ WithdrawFormComponent ] 12 | }) 13 | .compileComponents(); 14 | })); 15 | 16 | beforeEach(() => { 17 | fixture = TestBed.createComponent(WithdrawFormComponent); 18 | component = fixture.componentInstance; 19 | fixture.detectChanges(); 20 | }); 21 | 22 | it('should create', () => { 23 | expect(component).toBeTruthy(); 24 | }); 25 | }); 26 | -------------------------------------------------------------------------------- /src/app/routes.ts: -------------------------------------------------------------------------------- 1 | import {Routes} from "@angular/router"; 2 | import {HomeComponent} from "./home/home.component"; 3 | import {HistoryComponent} from "./history/history.component"; 4 | import {SendetherComponent} from "./sendether/sendether.component" 5 | import {PermissionComponent} from "./permission/permission.component" 6 | 7 | 8 | 9 | export const routes : Routes = [ 10 | { 11 | path: '', 12 | pathMatch: 'prefix', //default 13 | redirectTo: 'home' 14 | }, 15 | { 16 | path: 'home', 17 | component: HomeComponent 18 | }, 19 | { 20 | path: 'sendether', 21 | component: SendetherComponent 22 | }, 23 | { 24 | path: 'history', 25 | component: HistoryComponent 26 | }, 27 | { 28 | path: 'permission', 29 | component: PermissionComponent 30 | } 31 | ]; -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // Protractor configuration file, see link for more information 2 | // https://github.com/angular/protractor/blob/master/lib/config.ts 3 | 4 | /*global jasmine */ 5 | const { SpecReporter } = require('jasmine-spec-reporter'); 6 | 7 | exports.config = { 8 | allScriptsTimeout: 11000, 9 | specs: [ 10 | './e2e/**/*.e2e-spec.ts' 11 | ], 12 | capabilities: { 13 | 'browserName': 'chrome' 14 | }, 15 | directConnect: true, 16 | baseUrl: 'http://localhost:4200/', 17 | framework: 'jasmine', 18 | jasmineNodeOpts: { 19 | showColors: true, 20 | defaultTimeoutInterval: 30000, 21 | print: function() {} 22 | }, 23 | beforeLaunch: function() { 24 | require('ts-node').register({ 25 | project: 'e2e' 26 | }); 27 | }, 28 | onPrepare() { 29 | jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/app/permission/permission.component.html: -------------------------------------------------------------------------------- 1 |

2 | Under Development 3 |

4 | 5 | 6 | 34 | -------------------------------------------------------------------------------- /src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | 4 | describe('AppComponent', () => { 5 | beforeEach(() => { 6 | TestBed.configureTestingModule({ 7 | declarations: [ 8 | AppComponent 9 | ], 10 | }); 11 | TestBed.compileComponents(); 12 | }); 13 | 14 | it('should create the app', async(() => { 15 | const fixture = TestBed.createComponent(AppComponent); 16 | const app = fixture.debugElement.componentInstance; 17 | expect(app).toBeTruthy(); 18 | })); 19 | 20 | it(`should have as title 'app works!'`, async(() => { 21 | const fixture = TestBed.createComponent(AppComponent); 22 | const app = fixture.debugElement.componentInstance; 23 | expect(app.title).toEqual('app works!'); 24 | })); 25 | 26 | it('should render title in a h1 tag', async(() => { 27 | const fixture = TestBed.createComponent(AppComponent); 28 | fixture.detectChanges(); 29 | const compiled = fixture.debugElement.nativeElement; 30 | expect(compiled.querySelector('h1').textContent).toContain('app works!'); 31 | })); 32 | }); 33 | -------------------------------------------------------------------------------- /src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import 'zone.js/dist/long-stack-trace-zone'; 4 | import 'zone.js/dist/proxy.js'; 5 | import 'zone.js/dist/sync-test'; 6 | import 'zone.js/dist/jasmine-patch'; 7 | import 'zone.js/dist/async-test'; 8 | import 'zone.js/dist/fake-async-test'; 9 | import { getTestBed } from '@angular/core/testing'; 10 | import { 11 | BrowserDynamicTestingModule, 12 | platformBrowserDynamicTesting 13 | } from '@angular/platform-browser-dynamic/testing'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare var __karma__: any; 17 | declare var require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () {}; 21 | 22 | // First, initialize the Angular testing environment. 23 | getTestBed().initTestEnvironment( 24 | BrowserDynamicTestingModule, 25 | platformBrowserDynamicTesting() 26 | ); 27 | // Then we find all the tests. 28 | const context = require.context('./', true, /\.spec\.ts$/); 29 | // And load the modules. 30 | context.keys().map(context); 31 | // Finally, start Karma to run the tests. 32 | __karma__.start(); 33 | -------------------------------------------------------------------------------- /src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import {SharedService} from '../service/shared.service' 3 | import * as myGlobals from '../globals' 4 | import * as _ from "lodash"; 5 | 6 | 7 | @Component({ 8 | selector: 'app-home', 9 | templateUrl: './home.component.html', 10 | styleUrls: ['./home.component.css'] 11 | }) 12 | export class HomeComponent implements OnInit { 13 | 14 | constructor(private ss: SharedService) { 15 | myGlobals.SimpleWallet.deployed().then(function(contract:any) { 16 | 17 | // var addressStore = contract.address 18 | ss.balanceInEther = myGlobals.web3.fromWei(myGlobals.web3.eth.getBalance(contract.address).toNumber(), "ether"); 19 | 20 | ss.contract_address = contract.address; 21 | ss.contract_abi = JSON.stringify(contract.contract.abi); 22 | 23 | ss.accounts = []; 24 | _.forEach(myGlobals.web3.eth.accounts, function(obj:Object) { 25 | contract.isAllowedToSend.call(obj).then(function(isAllowed:any) { 26 | ss.accounts.push({address: obj, isAllowed:isAllowed}); 27 | }) 28 | }); 29 | }); 30 | 31 | 32 | } 33 | 34 | ngOnInit() { 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 4 | import { HttpModule } from '@angular/http'; 5 | 6 | import { AppComponent } from './app.component'; 7 | import { HomeComponent } from './home/home.component'; 8 | import { HistoryComponent } from './history/history.component'; 9 | 10 | import {RouterModule} from "@angular/router" 11 | import {routes} from "./routes"; 12 | import { SendetherComponent } from './sendether/sendether.component'; 13 | import { DepositFormComponent } from './deposit-form/deposit-form.component'; 14 | import { WithdrawFormComponent } from './withdraw-form/withdraw-form.component'; 15 | 16 | import {SharedService} from './service/shared.service'; 17 | import { PermissionComponent } from './permission/permission.component' 18 | 19 | 20 | 21 | @NgModule({ 22 | declarations: [ 23 | AppComponent, 24 | HomeComponent, 25 | HistoryComponent, 26 | SendetherComponent, 27 | DepositFormComponent, 28 | WithdrawFormComponent, 29 | PermissionComponent 30 | ], 31 | imports: [ 32 | BrowserModule, 33 | FormsModule, 34 | ReactiveFormsModule, 35 | HttpModule, 36 | RouterModule.forRoot(routes, {useHash: true}) 37 | ], 38 | providers: [SharedService], 39 | bootstrap: [AppComponent] 40 | }) 41 | export class AppModule { } 42 | -------------------------------------------------------------------------------- /config/webpack.prod.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var webpackMerge = require('webpack-merge'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var commonConfig = require('./webpack.common.js'); 5 | var helpers = require('./helpers'); 6 | var path = require('path'); 7 | 8 | const ENV = process.env.NODE_ENV = process.env.ENV = 'production'; 9 | 10 | module.exports = webpackMerge(commonConfig, { 11 | devtool: 'source-map', 12 | 13 | output: { 14 | path: path.resolve(__dirname, '../build'), 15 | publicPath: '/', 16 | filename: '[name].[hash].js', 17 | chunkFilename: '[id].[hash].chunk.js' 18 | }, 19 | 20 | // output: { 21 | // path: path.resolve(__dirname, '../src/app/dist'), 22 | // publicPath: '/', 23 | // filename: '[name].[hash].js', 24 | // chunkFilename: '[id].[hash].chunk.js' 25 | // }, 26 | 27 | plugins: [ 28 | new webpack.NoEmitOnErrorsPlugin(), 29 | new webpack.optimize.UglifyJsPlugin({ // https://github.com/angular/angular/issues/10618 30 | mangle: { 31 | keep_fnames: true 32 | } 33 | }), 34 | new ExtractTextPlugin('[name].[hash].css'), 35 | new webpack.DefinePlugin({ 36 | 'process.env': { 37 | 'ENV': JSON.stringify(ENV) 38 | } 39 | }), 40 | new webpack.LoaderOptionsPlugin({ 41 | htmlLoader: { 42 | minimize: false // workaround for ng2 43 | } 44 | }) 45 | ] 46 | }); 47 | -------------------------------------------------------------------------------- /karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration file, see link for more information 2 | // https://karma-runner.github.io/0.13/config/configuration-file.html 3 | 4 | module.exports = function (config) { 5 | config.set({ 6 | basePath: '', 7 | frameworks: ['jasmine', '@angular/cli'], 8 | plugins: [ 9 | require('karma-jasmine'), 10 | require('karma-chrome-launcher'), 11 | require('karma-jasmine-html-reporter'), 12 | require('karma-coverage-istanbul-reporter'), 13 | require('@angular/cli/plugins/karma') 14 | ], 15 | client:{ 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | files: [ 19 | { pattern: './src/test.ts', watched: false } 20 | ], 21 | preprocessors: { 22 | './src/test.ts': ['@angular/cli'] 23 | }, 24 | mime: { 25 | 'text/x-typescript': ['ts','tsx'] 26 | }, 27 | coverageIstanbulReporter: { 28 | reports: [ 'html', 'lcovonly' ], 29 | fixWebpackSourcePaths: true 30 | }, 31 | angularCli: { 32 | config: './.angular-cli.json', 33 | environment: 'dev' 34 | }, 35 | reporters: config.angularCli && config.angularCli.codeCoverage 36 | ? ['progress', 'coverage-istanbul'] 37 | : ['progress', 'kjhtml'], 38 | port: 9876, 39 | colors: true, 40 | logLevel: config.LOG_INFO, 41 | autoWatch: true, 42 | browsers: ['Chrome'], 43 | singleRun: false 44 | }); 45 | }; 46 | -------------------------------------------------------------------------------- /.angular-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "project": { 4 | "version": "1.0.0-beta.32.3", 5 | "name": "my-dwallet" 6 | }, 7 | "apps": [ 8 | { 9 | "root": "src", 10 | "outDir": "dist", 11 | "assets": [ 12 | "assets", 13 | "favicon.ico" 14 | ], 15 | "index": "index.html", 16 | "main": "main.ts", 17 | "polyfills": "polyfills.ts", 18 | "test": "test.ts", 19 | "tsconfig": "tsconfig.json", 20 | "prefix": "app", 21 | "styles": [ 22 | "styles.css", 23 | "../node_modules/bootstrap/dist/css/bootstrap.css" 24 | ], 25 | "scripts": [ 26 | "../node_modules/jquery/dist/jquery.js", 27 | "../node_modules/tether/dist/js/tether.js", 28 | "../node_modules/bootstrap/dist/js/bootstrap.js" 29 | ], 30 | "environmentSource": "environments/environment.ts", 31 | "environments": { 32 | "dev": "environments/environment.ts", 33 | "prod": "environments/environment.prod.ts" 34 | } 35 | } 36 | ], 37 | "e2e": { 38 | "protractor": { 39 | "config": "./protractor.conf.js" 40 | } 41 | }, 42 | "lint": [ 43 | { 44 | "files": "src/**/*.ts", 45 | "project": "src/tsconfig.json" 46 | }, 47 | { 48 | "files": "e2e/**/*.ts", 49 | "project": "e2e/tsconfig.json" 50 | } 51 | ], 52 | "test": { 53 | "karma": { 54 | "config": "./karma.conf.js" 55 | } 56 | }, 57 | "defaults": { 58 | "styleExt": "css", 59 | "component": {} 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/app/app.component.html: -------------------------------------------------------------------------------- 1 | 24 | 25 | 37 | 38 | 39 | 40 | 43 | -------------------------------------------------------------------------------- /truffle.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | networks: { 3 | development: { 4 | host: "localhost", 5 | port: 8545, 6 | network_id: "*" // Match any network id 7 | } 8 | } 9 | }; 10 | 11 | // module.exports = { 12 | // build: { 13 | // "index.html": "dist/index.html", 14 | // "app.js": [ 15 | // "dist/polyfills.006e9d55e6a80c0bba67.js", 16 | // "dist/vendor.006e9d55e6a80c0bba67.js", 17 | // "dist/app.006e9d55e6a80c0bba67.js", 18 | // "dist/twbs.006e9d55e6a80c0bba67.js" 19 | // ], 20 | // "app.css": [ 21 | // "stylesheets/" 22 | // ], 23 | // "images/": "images/" 24 | // }, 25 | // rpc: { 26 | // host: "localhost", 27 | // port: 8545 28 | // } 29 | // }; 30 | // var path = require('path'); 31 | 32 | // var DefaultBuilder = require("truffle-default-builder"); 33 | 34 | // module.exports = { 35 | // build: new DefaultBuilder({ 36 | // "index.html": path.resolve("dist/index.html"), 37 | // // "index.html": "/dist/index.html", 38 | // "app.js": [ 39 | // "/dist/polyfills.006e9d55e6a80c0bba67.js", 40 | // "/dist/vendor.006e9d55e6a80c0bba67.js", 41 | // "/dist/app.006e9d55e6a80c0bba67.js", 42 | // "dist/twbs.006e9d55e6a80c0bba67.js" 43 | // ], 44 | // "app.css": [ 45 | // "stylesheets/" 46 | // ], 47 | // "images/": "images/", 48 | // "views/": "views/" 49 | // }), 50 | 51 | // networks: { 52 | // development: { 53 | // host: "localhost", 54 | // port: 8545, 55 | // network_id: "*" // match any network 56 | // }, 57 | // live: { 58 | // host: "localhost", 59 | // port: 8545, 60 | // network_id: "*" // match any network 61 | // } 62 | // } 63 | // }; 64 | 65 | -------------------------------------------------------------------------------- /src/app/deposit-form/deposit-form.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Deposit

3 |
6 | 7 | 8 | 9 |
14 | 15 | 19 | 23 |
24 | 25 | 28 | 29 |
34 | 35 | 42 |
43 | 44 | 47 | 48 |
49 |
50 | 51 |
52 | 53 |
54 |
55 | 56 |
57 | 58 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MyDWallet(Under Development) 2 | 3 | 4 | This README would normally document whatever steps are necessary to get the 5 | application up and running. 6 | 7 | # The Purpose 8 | 1. To create very simple prototype of decenterised web application and intregrate 9 | the latest blockchain based framework - truffle version 3 and the frontend one -Angular 2 10 | 2. Write and the solidity contracts and their test cases 11 | 12 | 13 | # Technology 14 | 1. HTML 15 | 2. CSS 16 | * Bootstrap 17 | * Jquery.js 18 | 3. Typescript 19 | * Angular2 20 | 4. Smart Database with Block Chain 21 | * Truffle 22 | * Solidity 23 | 5. Webpack2 24 | 25 | # API 26 | 1. Web3 JavaScript Ðapp API 27 | 28 | 29 | # Requirement 30 | 1. Via contract, users can receive ether from any body 31 | 2. Show the current balance 32 | 3. List all immutable transactions 33 | 4. Responsive 34 | 35 | 36 | # Installation 37 | 1. install testrpc which is a Node.js based Ethereum client for testing and development. It uses ethereumjs to simulate full client behavior and make developing Ethereum applications much faster. It also includes all popular RPC functions and features (like events) and can be run deterministically to make development a breeze. and run 38 | ``` 39 | $ npm install -g ethereumjs-testrpc 40 | ``` 41 | 2. install truffle 42 | ``` 43 | $ npm install -g truffle 44 | ``` 45 | 46 | 3. start using the app with 47 | ``` 48 | $ npm install 49 | $ npm run startd 50 | $ testrpc 51 | ``` 52 | 53 | 4. You can also test th contract 54 | ``` 55 | truffle test 56 | ``` 57 | *After npm install, It is important to go to 58 | 59 | node_modules/ethjs-abi/internals/webpack/webpack.config.js: and node_modules/ethjs-util/internals/webpack/webpack.config.js: 60 | 61 | then change from loader: 'json' to loader: 'json-loader' 62 | 63 | # Underdevelopment I will fix it (If possible) 64 | 1. User can only run to bundle all of typescript code on developement mode not production mode (You can bundle but it does't work) 65 | 2. Via contract, users can add or remove the specific people to withdraw and deposit their ether 66 | 67 | 68 | # Live Website 69 | Thereis no live website, since it is a decenterised application. 70 | -------------------------------------------------------------------------------- /src/app/withdraw-form/withdraw-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Pipe, Input, OnInit } from '@angular/core'; 2 | import {ReactiveFormsModule,FormsModule,FormGroup,FormControl,Validators, FormBuilder} from '@angular/forms'; 3 | import {BrowserModule} from '@angular/platform-browser'; 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | import {SharedService} from '../service/shared.service' 6 | import * as myGlobals from '../globals' 7 | 8 | 9 | 10 | @Component({ 11 | selector: 'withdraw-form', 12 | templateUrl: './withdraw-form.component.html', 13 | styleUrls: ['./withdraw-form.component.css'] 14 | }) 15 | export class WithdrawFormComponent implements OnInit { 16 | 17 | addresses: string[] 18 | myform: FormGroup; 19 | etherAmount: FormControl; 20 | addressTo: FormControl; 21 | public transfer_success: boolean = false; 22 | public has_errors: string = ""; 23 | 24 | constructor(private ss: SharedService) { 25 | 26 | } 27 | 28 | ngOnInit() { 29 | this.createFormControls(); 30 | this.createForm(); 31 | } 32 | 33 | createFormControls() { 34 | this.etherAmount = new FormControl('', [ 35 | Validators.required 36 | ]); 37 | this.addressTo = new FormControl('', ); 38 | } 39 | 40 | createForm() { 41 | this.myform = new FormGroup({ 42 | etherAmount: this.etherAmount, 43 | addressTo: this.addressTo 44 | }); 45 | } 46 | 47 | onSubmit() { 48 | if (this.myform.valid) { 49 | console.log("Form Submitted!"); 50 | 51 | var that = this; 52 | // console.log(that.myform) 53 | myGlobals.SimpleWallet.deployed().then(function(contract:any) { 54 | 55 | console.log(that) 56 | console.log(that.myform.value.addressTo) 57 | console.log(myGlobals.web3.eth.accounts[0]) 58 | 59 | contract.sendFunds(myGlobals.web3.toWei(that.myform.value.etherAmount, "ether"), that.myform.value.addressTo, {from: myGlobals.web3.eth.accounts[0], gas: 200000}).then(function () { 60 | that.transfer_success = true; 61 | 62 | }).catch(function (error:any) { 63 | console.error(error); 64 | that.has_errors = `${error}`; 65 | 66 | }); 67 | }); 68 | 69 | // this.myform.reset(); 70 | } 71 | } 72 | 73 | } 74 | -------------------------------------------------------------------------------- /src/app/withdraw-form/withdraw-form.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Withdraw

3 |
6 | 7 | 8 | 9 |
14 | 15 | 19 | 23 |
24 | 25 | 28 | 29 |
34 | 35 | 36 | 41 | 47 | 48 | 55 |
56 | 57 | 60 | 61 | 62 |
63 |
64 | 65 |
66 | 67 |
68 |
69 | 70 |
71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-dwallet", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "angular-cli": {}, 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "startd": "webpack-dev-server --inline --progress --port 8080", 10 | "build": " webpack --config config/webpack.prod.js --progress --profile ", 11 | "test": "ng test", 12 | "lint": "ng lint", 13 | "e2e": "ng e2e" 14 | }, 15 | "private": true, 16 | "dependencies": { 17 | "@angular/common": "^2.4.0", 18 | "@angular/compiler": "^2.4.0", 19 | "@angular/core": "^2.4.0", 20 | "@angular/forms": "^2.4.0", 21 | "@angular/http": "^2.4.0", 22 | "@angular/platform-browser": "^2.4.0", 23 | "@angular/platform-browser-dynamic": "^2.4.0", 24 | "@angular/router": "^3.4.0", 25 | "@types/lodash": "^4.14.54", 26 | "bootstrap": "^4.0.0-alpha.6", 27 | "core-js": "^2.4.1", 28 | "jquery": "^3.1.1", 29 | "lodash": "^4.17.4", 30 | "rxjs": "^5.1.0", 31 | "truffle-contract": "^1.1.10", 32 | "web3": "^0.18.2", 33 | "zone.js": "^0.7.6" 34 | }, 35 | "devDependencies": { 36 | "@angular/cli": "1.0.0-beta.32.3", 37 | "@angular/compiler-cli": "^2.4.0", 38 | "@types/jasmine": "2.5.38", 39 | "@types/node": "~6.0.60", 40 | "angular2-template-loader": "^0.6.0", 41 | "awesome-typescript-loader": "^3.0.4", 42 | "babel-loader": "^6.3.2", 43 | "bootstrap-loader": "^2.0.0-beta.20", 44 | "codelyzer": "~2.0.0-beta.4", 45 | "css-loader": "^0.26.2", 46 | "extract-text-webpack-plugin": "2.0.0-beta.5", 47 | "file-loader": "^0.9.0", 48 | "html-loader": "^0.4.3", 49 | "html-webpack-plugin": "^2.16.1", 50 | "jasmine-core": "~2.5.2", 51 | "jasmine-spec-reporter": "~3.2.0", 52 | "json-loader": "^0.5.4", 53 | "karma": "~1.4.1", 54 | "karma-chrome-launcher": "~2.0.0", 55 | "karma-cli": "~1.0.1", 56 | "karma-coverage-istanbul-reporter": "^0.2.0", 57 | "karma-jasmine": "~1.1.0", 58 | "karma-jasmine-html-reporter": "^0.2.2", 59 | "karma-sourcemap-loader": "^0.3.7", 60 | "karma-webpack": "^2.0.1", 61 | "node-sass": "^4.5.0", 62 | "null-loader": "^0.1.1", 63 | "protractor": "~5.1.0", 64 | "raw-loader": "^0.5.1", 65 | "resolve-url-loader": "^2.0.2", 66 | "rimraf": "^2.5.2", 67 | "sass-loader": "^6.0.2", 68 | "style-loader": "^0.13.2", 69 | "truffle-default-builder": "^2.0.0", 70 | "truffle-solidity-loader": "0.0.8", 71 | "ts-node": "~2.0.0", 72 | "tslint": "~4.4.2", 73 | "typescript": "~2.1.0", 74 | "url-loader": "^0.5.8", 75 | "webpack": "2.2.1", 76 | "webpack-dev-server": "2.4.1", 77 | "webpack-merge": "^3.0.0" 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /contracts/SimpleWallet.sol: -------------------------------------------------------------------------------- 1 | pragma solidity ^0.4.0; 2 | contract SimpleWallet { 3 | 4 | address owner; 5 | 6 | struct WithdrawlStruct { 7 | address to; 8 | uint amount; 9 | } 10 | 11 | struct Senders { 12 | bool allowed; 13 | uint amount_sends; 14 | mapping(uint => WithdrawlStruct) withdrawls; 15 | } 16 | 17 | mapping(address => Senders) isAllowedToSendFundsMapping; 18 | 19 | 20 | event Deposit(address _sender, uint amount); 21 | event Withdrawl(address _sender, uint amount, address _beneficiary); 22 | 23 | function SimpleWallet() { 24 | owner = msg.sender; 25 | } 26 | 27 | function() payable{ 28 | if(isAllowedToSend(msg.sender)) { 29 | Deposit(msg.sender, msg.value); 30 | } else { 31 | throw; 32 | } 33 | } 34 | 35 | function sendFunds(uint amount, address receiver) returns (uint) { 36 | if(isAllowedToSend(msg.sender)) { 37 | if(this.balance >= amount) { 38 | if(!receiver.send(amount)) { 39 | throw; 40 | } 41 | Withdrawl(msg.sender, amount, receiver); 42 | isAllowedToSendFundsMapping[msg.sender].amount_sends++; 43 | isAllowedToSendFundsMapping[msg.sender].withdrawls[isAllowedToSendFundsMapping[msg.sender].amount_sends].to = receiver; 44 | isAllowedToSendFundsMapping[msg.sender].withdrawls[isAllowedToSendFundsMapping[msg.sender].amount_sends].amount = amount; 45 | return this.balance; 46 | } 47 | } 48 | } 49 | 50 | function getAmountOfWithdrawls(address _address) constant returns (uint) { 51 | return isAllowedToSendFundsMapping[_address].amount_sends; 52 | } 53 | 54 | function getWithdrawlForAddress(address _address, uint index) constant returns (address, uint) { 55 | return (isAllowedToSendFundsMapping[_address].withdrawls[index].to, isAllowedToSendFundsMapping[_address].withdrawls[index].amount); 56 | } 57 | 58 | function allowAddressToSendMoney(address _address) { 59 | if(msg.sender == owner) { 60 | isAllowedToSendFundsMapping[_address].allowed = true; 61 | } 62 | } 63 | 64 | function disallowAddressToSendMoney(address _address) { 65 | if(msg.sender == owner) { 66 | isAllowedToSendFundsMapping[_address].allowed = false; 67 | } 68 | } 69 | 70 | function isAllowedToSend(address _address) constant returns (bool) { 71 | return isAllowedToSendFundsMapping[_address].allowed || _address == owner; 72 | } 73 | 74 | function killWallet() { 75 | if(msg.sender == owner) { 76 | suicide(owner); 77 | } 78 | } 79 | 80 | 81 | } 82 | 83 | -------------------------------------------------------------------------------- /src/app/history/history.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit ,Output, Input,EventEmitter, OnChanges } from '@angular/core'; 2 | import {SharedService} from '../service/shared.service' 3 | import * as myGlobals from '../globals' 4 | 5 | 6 | 7 | @Component({ 8 | selector: 'app-history', 9 | templateUrl: './history.component.html', 10 | styleUrls: ['./history.component.css'] 11 | }) 12 | export class HistoryComponent implements OnInit { 13 | 14 | public ourEvents:any[] =[] 15 | public ourDepositEvents:any[]=[] 16 | public withdrawls:any[]=[] 17 | 18 | constructor(private ss: SharedService) { 19 | 20 | ss.accounts = myGlobals.web3.eth.accounts 21 | 22 | 23 | 24 | } 25 | 26 | // @Input('events') 27 | // set updateourEvents(events:any) :any{ 28 | // this.ourEvents.push(events); 29 | // } 30 | 31 | 32 | // @Input('depositEvents') 33 | // set updateourdepositEvents(depositEvents:any) :any{ 34 | // this.ourEvents.push(depositEvents); 35 | // } 36 | 37 | // $scope.$on('$destroy', function() { 38 | // events.stopWatching(); 39 | // depositEvents.stopWatching(); 40 | // }); 41 | 42 | ngOnInit() { 43 | 44 | // this.ourEvents = [] 45 | // this.ourDepositEvent=[] 46 | // this.withdrawls=[] 47 | 48 | var that =this 49 | 50 | myGlobals.SimpleWallet.deployed().then(function(myContract:any) { 51 | 52 | var events = myContract.allEvents({fromBlock: 0, toBlock: 'latest'}); 53 | 54 | // events.watch(function(error :any, result:any) { 55 | 56 | 57 | 58 | events.watch(function(error:any, event:any){ 59 | // console.log(events) 60 | that.ourEvents.push(event); 61 | if (!error) 62 | console.log(event); 63 | }); 64 | 65 | var depositEvents = myContract.Deposit({fromBlock: 0, toBlock: 'latest'}); 66 | 67 | var depositEvents = myContract.Deposit(null, {fromBlock: 0, toBlock: 'latest'}, function(error:any, result:any) { 68 | that.ourDepositEvents.push(result); 69 | }); 70 | 71 | 72 | 73 | 74 | myContract.getAmountOfWithdrawls.call(myGlobals.web3.eth.accounts[0]).then(function(result:any) { 75 | var numberOfWithdrawls = result.toNumber(); 76 | for(var i = 1; i <= numberOfWithdrawls; i++) { 77 | myContract.getWithdrawlForAddress.call(myGlobals.web3.eth.accounts[0], i).then(function(result_withdrawl:any) { 78 | result_withdrawl[1] = myGlobals.web3.fromWei(result_withdrawl[1], "ether").toNumber(); 79 | that.withdrawls.push(result_withdrawl); 80 | }); 81 | } 82 | 83 | return this; 84 | }); 85 | 86 | }); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/app/deposit-form/deposit-form.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Pipe, Input, OnInit } from '@angular/core'; 2 | import {ReactiveFormsModule,FormsModule,FormGroup,FormControl,Validators, FormBuilder} from '@angular/forms'; 3 | import {BrowserModule} from '@angular/platform-browser'; 4 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 5 | import {SharedService} from '../service/shared.service'; 6 | import * as myGlobals from '../globals' 7 | 8 | 9 | 10 | 11 | @Component({ 12 | selector: 'deposit-form', 13 | templateUrl: './deposit-form.component.html', 14 | styleUrls: ['./deposit-form.component.css'] 15 | }) 16 | export class DepositFormComponent implements OnInit { 17 | 18 | 19 | addresses: string[] = this.ss.accounts 20 | myform: FormGroup; 21 | etherAmount: FormControl; 22 | addressFrom: FormControl; 23 | public transfer_success: boolean = false; 24 | public has_errors: string = ""; 25 | 26 | SimpleContract: any 27 | 28 | 29 | constructor(private ss: SharedService) { 30 | 31 | ss.accounts = myGlobals.web3.eth.accounts 32 | // ss.depositFunds = function(adrress :string, amount:number) { 33 | 34 | // myGlobals.web3.eth.sendTransaction({from: address, to: contract.address, value: myGlobals.web3.toWei(amount, "ether")}, function(error:any, result:any) { 35 | // if(error) { 36 | // ss.has_errors = "I did not work"; 37 | // } else { 38 | // ss.transfer_success = true; 39 | // } 40 | // }); 41 | // } 42 | 43 | } 44 | 45 | 46 | ngOnInit() { 47 | this.createFormControls(); 48 | this.createForm(); 49 | this.addresses = this.ss.accounts 50 | } 51 | 52 | createFormControls() { 53 | this.etherAmount = new FormControl('', [ 54 | Validators.required 55 | ]); 56 | this.addressFrom = new FormControl(''); 57 | } 58 | 59 | createForm() { 60 | this.myform = new FormGroup({ 61 | etherAmount: this.etherAmount, 62 | addressFrom: this.addressFrom 63 | }); 64 | } 65 | 66 | onSubmit() { 67 | // onSubmit(adrress :string, amount:number) { 68 | if (this.myform.valid) { 69 | console.log("Form Submitted!"); 70 | 71 | var that = this; 72 | console.log(that); 73 | // var myform = this.myform; 74 | myGlobals.SimpleWallet.deployed().then(function(contract :any) { 75 | 76 | console.log(contract.address); 77 | console.log(that.myform.value.addressFrom); 78 | console.log(myGlobals.web3.toWei(that.myform.value.etherAmount, "ether")); 79 | 80 | var addressStore = contract.address 81 | 82 | myGlobals.web3.eth.sendTransaction({from: that.myform.value.addressFrom, to: addressStore, value: myGlobals.web3.toWei(that.myform.value.etherAmount, "ether")}, function(error:any, result:any) { 83 | if(error) { 84 | that.has_errors = "I did not work"; 85 | } else { 86 | that.transfer_success = true; 87 | } 88 | 89 | }); 90 | }) 91 | 92 | 93 | 94 | 95 | } 96 | // this.myform.reset(); 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/codelyzer" 4 | ], 5 | "rules": { 6 | "callable-types": true, 7 | "class-name": true, 8 | "comment-format": [ 9 | true, 10 | "check-space" 11 | ], 12 | "curly": true, 13 | "eofline": true, 14 | "forin": true, 15 | "import-blacklist": [true, "rxjs"], 16 | "import-spacing": true, 17 | "indent": [ 18 | true, 19 | "spaces" 20 | ], 21 | "interface-over-type-literal": true, 22 | "label-position": true, 23 | "max-line-length": [ 24 | true, 25 | 140 26 | ], 27 | "member-access": false, 28 | "member-ordering": [ 29 | true, 30 | "static-before-instance", 31 | "variables-before-functions" 32 | ], 33 | "no-arg": true, 34 | "no-bitwise": true, 35 | "no-console": [ 36 | true, 37 | "debug", 38 | "info", 39 | "time", 40 | "timeEnd", 41 | "trace" 42 | ], 43 | "no-construct": true, 44 | "no-debugger": true, 45 | "no-duplicate-variable": true, 46 | "no-empty": false, 47 | "no-empty-interface": true, 48 | "no-eval": true, 49 | "no-inferrable-types": [true, "ignore-params"], 50 | "no-shadowed-variable": true, 51 | "no-string-literal": false, 52 | "no-string-throw": true, 53 | "no-switch-case-fall-through": true, 54 | "no-trailing-whitespace": true, 55 | "no-unused-expression": true, 56 | "no-use-before-declare": true, 57 | "no-var-keyword": true, 58 | "object-literal-sort-keys": false, 59 | "one-line": [ 60 | true, 61 | "check-open-brace", 62 | "check-catch", 63 | "check-else", 64 | "check-whitespace" 65 | ], 66 | "prefer-const": true, 67 | "quotemark": [ 68 | true, 69 | "single" 70 | ], 71 | "radix": true, 72 | "semicolon": [ 73 | "always" 74 | ], 75 | "triple-equals": [ 76 | true, 77 | "allow-null-check" 78 | ], 79 | "typedef-whitespace": [ 80 | true, 81 | { 82 | "call-signature": "nospace", 83 | "index-signature": "nospace", 84 | "parameter": "nospace", 85 | "property-declaration": "nospace", 86 | "variable-declaration": "nospace" 87 | } 88 | ], 89 | "typeof-compare": true, 90 | "unified-signatures": true, 91 | "variable-name": false, 92 | "whitespace": [ 93 | true, 94 | "check-branch", 95 | "check-decl", 96 | "check-operator", 97 | "check-separator", 98 | "check-type" 99 | ], 100 | 101 | "directive-selector": [true, "attribute", "app", "camelCase"], 102 | "component-selector": [true, "element", "app", "kebab-case"], 103 | "use-input-property-decorator": true, 104 | "use-output-property-decorator": true, 105 | "use-host-property-decorator": true, 106 | "no-input-rename": true, 107 | "no-output-rename": true, 108 | "use-life-cycle-interface": true, 109 | "use-pipe-transform-interface": true, 110 | "component-class-suffix": true, 111 | "directive-class-suffix": true, 112 | "no-access-missing-member": true, 113 | "templates-use-public": true, 114 | "invoke-injectable": true 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /test/simplewallet.js: -------------------------------------------------------------------------------- 1 | 2 | var SimpleWallet = artifacts.require("./SimpleWallet.sol"); 3 | 4 | contract('SimpleWallet', function (accounts) { 5 | it('the owner is allowed to send funds', function () { 6 | return myContract = SimpleWallet.deployed().then( 7 | function (instance) { 8 | return instance.isAllowedToSend.call(accounts[0]) 9 | }) 10 | .then( 11 | function (isAllowed) { 12 | assert.equal(isAllowed, true, 'the owner should have been allowed to send funds'); 13 | } 14 | ) 15 | } 16 | ); 17 | 18 | it('the other account should not be allowed to send funds', function () { 19 | return SimpleWallet.deployed().then(function(instance) { 20 | return instance.isAllowedToSend.call(accounts[2]); 21 | }).then(function (isAllowed) { 22 | assert.equal(isAllowed, false, 'the other account was allowed'); 23 | }) 24 | }); 25 | 26 | it('adding accounts to the allowed list', function () { 27 | var wallet; 28 | 29 | return SimpleWallet.deployed().then(function(instance) { 30 | wallet = instance; 31 | return wallet.isAllowedToSend.call(accounts[1]); 32 | }).then(function (isAllowed) { 33 | assert.equal(isAllowed, false, 'the other account was allowed'); 34 | return wallet.allowAddressToSendMoney(accounts[1]); 35 | }).then(function () { 36 | return wallet.isAllowedToSend.call(accounts[1]); 37 | }).then(function (isAllowed) { 38 | assert.equal(true, isAllowed, 'the other account was not allowed'); 39 | return wallet.disallowAddressToSendMoney(accounts[1]); 40 | }).then(function () { 41 | return wallet.isAllowedToSend.call(accounts[1]); 42 | }).then(function (isAllowed) { 43 | assert.equal(false, isAllowed, 'the account was allowed'); 44 | }); 45 | }); 46 | 47 | 48 | it("should check Deposit Events", function (done) { 49 | var meta; 50 | SimpleWallet.deployed().then(function(instance) { 51 | meta = instance; 52 | var event = meta.allEvents(); 53 | event.watch(function (error, result) { 54 | if (error) { 55 | console.err(error); 56 | } else { 57 | // now we'll check that the events are correct 58 | assert.equal(result.event, "Deposit"); 59 | assert.equal(web3.fromWei(result.args.amount.valueOf(), "ether"), 1); 60 | assert.equal(result.args._sender.valueOf(), web3.eth.accounts[0]); 61 | event.stopWatching(); 62 | done(); 63 | } 64 | 65 | }); 66 | // we'll send ether 67 | web3.eth.sendTransaction({from: web3.eth.accounts[0], to: meta.address, value: web3.toWei(1, "ether")}); 68 | 69 | }); 70 | 71 | 72 | }); 73 | 74 | it("should check not allowed Deposit Events", function (done) { 75 | var meta; 76 | SimpleWallet.deployed().then(function(instance) { 77 | meta = instance; 78 | 79 | // we'll send ether 80 | web3.eth.sendTransaction({ 81 | from: web3.eth.accounts[1], 82 | to: meta.address, 83 | value: web3.toWei(1, "ether") 84 | }, function (error, result) { 85 | if (error) { 86 | done(); 87 | } else { 88 | done(result); 89 | } 90 | }); 91 | }); 92 | 93 | }); 94 | 95 | }); -------------------------------------------------------------------------------- /.bootstraprc: -------------------------------------------------------------------------------- 1 | --- 2 | # Output debugging info 3 | # loglevel: debug 4 | 5 | # Major version of Bootstrap: 3 or 4 6 | bootstrapVersion: 4 7 | 8 | # If Bootstrap version 4 is used - turn on/off flexbox model 9 | useFlexbox: true 10 | 11 | # Webpack loaders, order matters 12 | styleLoaders: 13 | - style-loader 14 | - css-loader 15 | - postcss-loader 16 | - sass-loader 17 | 18 | # Extract styles to stand-alone css file 19 | # Different settings for different environments can be used, 20 | # It depends on value of NODE_ENV environment variable 21 | # This param can also be set in webpack config: 22 | # entry: 'bootstrap-loader/extractStyles' 23 | extractStyles: false 24 | # env: 25 | # development: 26 | # extractStyles: false 27 | # production: 28 | # extractStyles: true 29 | 30 | # Customize Bootstrap variables that get imported before the original Bootstrap variables. 31 | # Thus original Bootstrap variables can depend on values from here. All the bootstrap 32 | # variables are configured with !default, and thus, if you define the variable here, then 33 | # that value is used, rather than the default. However, many bootstrap variables are derived 34 | # from other bootstrap variables, and thus, you want to set this up before we load the 35 | # official bootstrap versions. 36 | # For example, _variables.scss contains: 37 | # $input-color: $gray !default; 38 | # This means you can define $input-color before we load _variables.scss 39 | 40 | # preBootstrapCustomizations: ./app/styles/bootstrap/pre-customizations.scss 41 | 42 | # This gets loaded after bootstrap/variables is loaded and before bootstrap is loaded. 43 | # A good example of this is when you want to override a bootstrap variable to be based 44 | # on the default value of bootstrap. This is pretty specialized case. Thus, you normally 45 | # just override bootrap variables in preBootstrapCustomizations so that derived 46 | # variables will use your definition. 47 | # 48 | # For example, in _variables.scss: 49 | # $input-height: (($font-size-base * $line-height) + ($input-padding-y * 2) + ($border-width * 2)) !default; 50 | # This means that you could define this yourself in preBootstrapCustomizations. Or you can do 51 | # this in bootstrapCustomizations to make the input height 10% bigger than the default calculation. 52 | # Thus you can leverage the default calculations. 53 | # $input-height: $input-height * 1.10; 54 | 55 | # bootstrapCustomizations: ./app/styles/bootstrap/customizations.scss 56 | 57 | # Import your custom styles here. You have access to all the bootstrap variables. If you require 58 | # your sass files separately, you will not have access to the bootstrap variables, mixins, clases, etc. 59 | # Usually this endpoint-file contains list of @imports of your application styles. 60 | # appStyles: ./app/styles/app.scss 61 | 62 | ### Bootstrap styles 63 | styles: 64 | 65 | # Mixins 66 | mixins: true 67 | 68 | # Reset and dependencies 69 | normalize: true 70 | print: true 71 | 72 | # Core CSS 73 | reboot: true 74 | type: true 75 | images: true 76 | code: true 77 | grid: true 78 | tables: true 79 | forms: true 80 | buttons: true 81 | 82 | # Components 83 | transitions: true 84 | dropdown: true 85 | button-group: true 86 | input-group: true 87 | custom-forms: true 88 | nav: true 89 | navbar: true 90 | card: true 91 | breadcrumb: true 92 | pagination: true 93 | jumbotron: true 94 | alert: true 95 | progress: true 96 | media: true 97 | list-group: true 98 | responsive-embed: true 99 | close: true 100 | badge: false 101 | 102 | # Components w/ JavaScript 103 | modal: true 104 | tooltip: true 105 | popover: true 106 | carousel: true 107 | 108 | # Utility classes 109 | utilities: true 110 | 111 | ### Bootstrap scripts 112 | scripts: 113 | alert: true 114 | button: true 115 | carousel: true 116 | collapse: true 117 | dropdown: true 118 | modal: true 119 | popover: true 120 | scrollspy: true 121 | tab: true 122 | tooltip: true 123 | util: true -------------------------------------------------------------------------------- /config/webpack.common.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | var HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | var ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | var helpers = require('./helpers'); 5 | var path = require('path'); 6 | 7 | const ProvidePlugin = require('webpack/lib/ProvidePlugin'); 8 | 9 | module.exports = { 10 | entry: { 11 | // 'web3' : './src/assets/js/web3.js', 12 | 'polyfills': './src/polyfills.ts', 13 | 'vendor': './src/vendor.ts', 14 | 'app': './src/main.ts', 15 | 'twbs': 'bootstrap-loader' 16 | // 'main': AOT ? './client/main.browser.aot.ts' :'./client/main.browser.ts' 17 | }, 18 | 19 | resolve: { 20 | extensions: ['.ts', '.js'] 21 | }, 22 | 23 | module: { 24 | rules: [ 25 | // { 26 | // test: /\.js$/, 27 | // use: 'babel-loader', 28 | // exclude: /node_modules/ 29 | // }, 30 | 31 | // { 32 | // test: /\.sol/, 33 | // use: [ 34 | // { loader: 'json-loader' }, 35 | // { loader: 'truffle-solidity-loader', 36 | // options: { 37 | // migrations_directory: path.resolve(__dirname, './migrations') 38 | // // network: 'development' 39 | // } 40 | // } 41 | // ] 42 | // }, 43 | { 44 | test: /\.ts$/, 45 | loaders: [ 46 | { 47 | loader: 'awesome-typescript-loader', 48 | options: { configFileName: helpers.root('src', 'tsconfig.json') } 49 | } , 'angular2-template-loader' 50 | ] 51 | }, 52 | { 53 | test: /\.json$/, 54 | loader: 'json-loader' 55 | }, 56 | { 57 | test: /\.html$/, 58 | loader: 'html-loader' 59 | }, 60 | { 61 | test: /\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/, 62 | loader: 'file-loader?name=assets/[name].[hash].[ext]' 63 | }, 64 | { 65 | test: /\.css$/, 66 | exclude: helpers.root('src', 'app'), 67 | loader: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: 'css-loader?sourceMap' }) 68 | }, 69 | //Sass loader (required for Bootstrap 4) 70 | { 71 | test: /\.css$/, 72 | include: helpers.root('src', 'app'), 73 | loader: 'raw-loader' 74 | }, 75 | { 76 | test: /\.scss$/, 77 | use: ['raw-loader', 'sass-loader'] 78 | // Bootstrap 4 loader 79 | }, 80 | { 81 | test: /bootstrap\/dist\/js\/umd\//, 82 | use: 'imports-loader?jQuery=jquery' 83 | }, 84 | //Font loaders, required for font-awesome-sass-loader and bootstrap-loader 85 | { 86 | test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, 87 | loader: "url-loader?limit=10000&mimetype=application/font-woff" 88 | }, 89 | { 90 | test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, 91 | loader: "file-loader" 92 | } 93 | ] 94 | }, 95 | 96 | plugins: [ 97 | // Workaround for angular/angular#11580 98 | new webpack.ContextReplacementPlugin( 99 | // The (\\|\/) piece accounts for path separators in *nix and Windows 100 | /angular(\\|\/)core(\\|\/)(esm(\\|\/)src|src)(\\|\/)linker/, 101 | helpers.root('./src'), // location of your src 102 | {} // a map of your routes 103 | ), 104 | 105 | new webpack.optimize.CommonsChunkPlugin({ 106 | name: ['app', 'vendor', 'polyfills'] 107 | }), 108 | 109 | new HtmlWebpackPlugin({ 110 | template: 'src/index.html' 111 | }), 112 | 113 | new webpack.ProvidePlugin({ 114 | $: "jquery", 115 | jQuery: "jquery", 116 | "window.jQuery": "jquery", 117 | Tether: "tether", 118 | "window.Tether": "tether", 119 | Tooltip: "exports-loader?Tooltip!bootstrap/js/dist/tooltip", 120 | Alert: "exports-loader?Alert!bootstrap/js/dist/alert", 121 | Button: "exports-loader?Button!bootstrap/js/dist/button", 122 | Carousel: "exports-loader?Carousel!bootstrap/js/dist/carousel", 123 | Collapse: "exports-loader?Collapse!bootstrap/js/dist/collapse", 124 | Dropdown: "exports-loader?Dropdown!bootstrap/js/dist/dropdown", 125 | Modal: "exports-loader?Modal!bootstrap/js/dist/modal", 126 | Popover: "exports-loader?Popover!bootstrap/js/dist/popover", 127 | Scrollspy: "exports-loader?Scrollspy!bootstrap/js/dist/scrollspy", 128 | Tab: "exports-loader?Tab!bootstrap/js/dist/tab", 129 | Util: "exports-loader?Util!bootstrap/js/dist/util" 130 | }) 131 | ] 132 | }; 133 | -------------------------------------------------------------------------------- /src/app/globals.ts: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | let Web3 = require('web3') 3 | // let Contract = require('../../migrations/2_deploy_contracts') 4 | // var SimpleWallet = artifacts.require("../../../contracts/SimpleWallet.sol"); 5 | 6 | 7 | var web3Instance = new Web3(); 8 | console.log(web3Instance); 9 | var providerInstance = new web3Instance.providers.HttpProvider('http://localhost:8545') 10 | web3Instance.setProvider(providerInstance); 11 | 12 | var jsonC = require("../../build/contracts/SimpleWallet.json"); 13 | var contract = require("truffle-contract"); 14 | var SimpleWalletInstance :any = contract(jsonC) 15 | // var SimpleWalletInstance = contract({ 16 | // abi: [ 17 | // { 18 | // "constant": true, 19 | // "inputs": [ 20 | // { 21 | // "name": "_address", 22 | // "type": "address" 23 | // } 24 | // ], 25 | // "name": "isAllowedToSend", 26 | // "outputs": [ 27 | // { 28 | // "name": "", 29 | // "type": "bool" 30 | // } 31 | // ], 32 | // "payable": false, 33 | // "type": "function" 34 | // }, 35 | // { 36 | // "constant": true, 37 | // "inputs": [ 38 | // { 39 | // "name": "_address", 40 | // "type": "address" 41 | // } 42 | // ], 43 | // "name": "getAmountOfWithdrawls", 44 | // "outputs": [ 45 | // { 46 | // "name": "", 47 | // "type": "uint256" 48 | // } 49 | // ], 50 | // "payable": false, 51 | // "type": "function" 52 | // }, 53 | // { 54 | // "constant": true, 55 | // "inputs": [ 56 | // { 57 | // "name": "_address", 58 | // "type": "address" 59 | // }, 60 | // { 61 | // "name": "index", 62 | // "type": "uint256" 63 | // } 64 | // ], 65 | // "name": "getWithdrawlForAddress", 66 | // "outputs": [ 67 | // { 68 | // "name": "", 69 | // "type": "address" 70 | // }, 71 | // { 72 | // "name": "", 73 | // "type": "uint256" 74 | // } 75 | // ], 76 | // "payable": false, 77 | // "type": "function" 78 | // }, 79 | // { 80 | // "constant": false, 81 | // "inputs": [ 82 | // { 83 | // "name": "amount", 84 | // "type": "uint256" 85 | // }, 86 | // { 87 | // "name": "receiver", 88 | // "type": "address" 89 | // } 90 | // ], 91 | // "name": "sendFunds", 92 | // "outputs": [ 93 | // { 94 | // "name": "", 95 | // "type": "uint256" 96 | // } 97 | // ], 98 | // "payable": false, 99 | // "type": "function" 100 | // }, 101 | // { 102 | // "constant": false, 103 | // "inputs": [], 104 | // "name": "killWallet", 105 | // "outputs": [], 106 | // "payable": false, 107 | // "type": "function" 108 | // }, 109 | // { 110 | // "constant": false, 111 | // "inputs": [ 112 | // { 113 | // "name": "_address", 114 | // "type": "address" 115 | // } 116 | // ], 117 | // "name": "allowAddressToSendMoney", 118 | // "outputs": [], 119 | // "payable": false, 120 | // "type": "function" 121 | // }, 122 | // { 123 | // "constant": false, 124 | // "inputs": [ 125 | // { 126 | // "name": "_address", 127 | // "type": "address" 128 | // } 129 | // ], 130 | // "name": "disallowAddressToSendMoney", 131 | // "outputs": [], 132 | // "payable": false, 133 | // "type": "function" 134 | // }, 135 | // { 136 | // "inputs": [], 137 | // "payable": false, 138 | // "type": "constructor" 139 | // }, 140 | // { 141 | // "payable": true, 142 | // "type": "fallback" 143 | // }, 144 | // { 145 | // "anonymous": false, 146 | // "inputs": [ 147 | // { 148 | // "indexed": false, 149 | // "name": "_sender", 150 | // "type": "address" 151 | // }, 152 | // { 153 | // "indexed": false, 154 | // "name": "amount", 155 | // "type": "uint256" 156 | // } 157 | // ], 158 | // "name": "Deposit", 159 | // "type": "event" 160 | // }, 161 | // { 162 | // "anonymous": false, 163 | // "inputs": [ 164 | // { 165 | // "indexed": false, 166 | // "name": "_sender", 167 | // "type": "address" 168 | // }, 169 | // { 170 | // "indexed": false, 171 | // "name": "amount", 172 | // "type": "uint256" 173 | // }, 174 | // { 175 | // "indexed": false, 176 | // "name": "_beneficiary", 177 | // "type": "address" 178 | // } 179 | // ], 180 | // "name": "Withdrawl", 181 | // "type": "event" 182 | // } 183 | // ], 184 | // unlinked_binary: `0x606060405234610000575b60008054600160a060020a03191633600160a060020a03161790555b5b610445806100366000396000f300606060405236156100675763ffffffff60e060020a6000350416630bc605ad81146100cb5780635ee3610c146100f85780637bac318b14610123578063b268677414610162578063b67ba1b514610190578063c40046481461019f578063e481553e146101ba575b6100c95b610074336101d5565b156100c15760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a16100c6565b610000565b5b565b005b34610000576100e4600160a060020a03600435166101d5565b604080519115158252519081900360200190f35b3461000057610111600160a060020a0360043516610211565b60408051918252519081900360200190f35b346100005761013f600160a060020a0360043516602435610234565b60408051600160a060020a03909316835260208301919091528051918290030190f35b3461000057610111600435600160a060020a036024351661026c565b60408051918252519081900360200190f35b34610000576100c9610373565b005b34610000576100c9600160a060020a036004351661039b565b005b34610000576100c9600160a060020a03600435166103dd565b005b600160a060020a03811660009081526001602052604081205460ff16806102095750600054600160a060020a038381169116145b90505b919050565b600160a060020a038116600090815260016020819052604090912001545b919050565b600160a060020a03828116600090815260016020818152604080842086855260020190915290912080549101549116905b9250929050565b6000610277336101d5565b1561036b57600160a060020a0330163183901061036b57604051600160a060020a0383169084156108fc029085906000818181858888f1935050505015156102be57610000565b60408051600160a060020a0333811682526020820186905284168183015290517f2ce435329ed2714bb4f4b7d0fe33307418dcf239c8c61d63a6b2fe052f7491c29181900360600190a15033600160a060020a0390811660009081526001602081815260408084208084018054850180825586526002909101909252808420805473ffffffffffffffffffffffffffffffffffffffff191687871617905590548352909120018390553016315b5b5b92915050565b60005433600160a060020a03908116911614156100c657600054600160a060020a0316ff5b5b565b60005433600160a060020a03908116911614156103d957600160a060020a0381166000908152600160208190526040909120805460ff191690911790555b5b50565b60005433600160a060020a03908116911614156103d957600160a060020a0381166000908152600160205260409020805460ff191690555b5b505600a165627a7a723058206df69e1b571f7e36e4a9edc695b86cb11834ede60a2c02ac09a37ea59011f1be0029`, 185 | // address: 0xa49a6490e433c5abd361ee3584bde9df7e1e8443, 186 | // networks: { 187 | // "1488981212175": { 188 | // "events": { 189 | // "0xe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c": { 190 | // "anonymous": false, 191 | // "inputs": [ 192 | // { 193 | // "indexed": false, 194 | // "name": "_sender", 195 | // "type": "address" 196 | // }, 197 | // { 198 | // "indexed": false, 199 | // "name": "amount", 200 | // "type": "uint256" 201 | // } 202 | // ], 203 | // "name": "Deposit", 204 | // "type": "event" 205 | // }, 206 | // "0x2ce435329ed2714bb4f4b7d0fe33307418dcf239c8c61d63a6b2fe052f7491c2": { 207 | // "anonymous": false, 208 | // "inputs": [ 209 | // { 210 | // "indexed": false, 211 | // "name": "_sender", 212 | // "type": "address" 213 | // }, 214 | // { 215 | // "indexed": false, 216 | // "name": "amount", 217 | // "type": "uint256" 218 | // }, 219 | // { 220 | // "indexed": false, 221 | // "name": "_beneficiary", 222 | // "type": "address" 223 | // } 224 | // ], 225 | // "name": "Withdrawl", 226 | // "type": "event" 227 | // } 228 | // }, 229 | // "links": {}, 230 | // "address": "0xa49a6490e433c5abd361ee3584bde9df7e1e8443", 231 | // "updated_at": 1488995734643 232 | // } 233 | // } 234 | // }) 235 | 236 | SimpleWalletInstance.setProvider(providerInstance) 237 | 238 | export var web3=web3Instance; 239 | export var SimpleWallet=SimpleWalletInstance 240 | 241 | -------------------------------------------------------------------------------- /src/js/web3.min.js: -------------------------------------------------------------------------------- 1 | require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a2&&"0x"===t.substr(0,2)&&(t=t.substr(2)),t=r.enc.Hex.parse(t)),o(t,{outputLength:256}).toString()}},{"crypto-js":59,"crypto-js/sha3":80}],20:[function(t,e,n){var r=t("bignumber.js"),o=t("./sha3.js"),i=t("utf8"),a={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},s=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},c=function(t,e,n){return t+new Array(e-t.length+1).join(n?n:"0")},u=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);n7&&t[n].toUpperCase()!==t[n]||parseInt(e[n],16)<=7&&t[n].toLowerCase()!==t[n])return!1;return!0},A=function(t){if("undefined"==typeof t)return"";t=t.toLowerCase().replace("0x","");for(var e=o(t),n="0x",r=0;r7?t[r].toUpperCase():t[r];return n},F=function(t){return B(t)?t:/^[0-9a-f]{40}$/.test(t)?"0x"+t:"0x"+s(v(t).substr(2),40)},I=function(t){return t instanceof r||t&&t.constructor&&"BigNumber"===t.constructor.name},O=function(t){return"string"==typeof t||t&&t.constructor&&"String"===t.constructor.name},N=function(t){return"function"==typeof t},T=function(t){return"object"==typeof t},D=function(t){return"boolean"==typeof t},E=function(t){return t instanceof Array},P=function(t){try{return!!JSON.parse(t)}catch(t){return!1}};e.exports={padLeft:s,padRight:c,toHex:v,toDecimal:y,fromDecimal:g,toUtf8:u,toAscii:f,fromUtf8:l,fromAscii:p,transformToFullName:h,extractDisplayName:d,extractTypeName:m,toWei:w,fromWei:_,toBigNumber:x,toTwosComplement:k,toAddress:F,isBigNumber:I,isStrictAddress:B,isAddress:S,isChecksumAddress:C,toChecksumAddress:A,isFunction:N,isString:O,isObject:T,isBoolean:D,isArray:E,isJson:P}},{"./sha3.js":19,"bignumber.js":"bignumber.js",utf8:85}],21:[function(t,e,n){e.exports={version:"0.18.2"}},{}],22:[function(t,e,n){function r(t){this._requestManager=new o(t),this.currentProvider=t,this.eth=new a(this),this.db=new s(this),this.shh=new c(this),this.net=new u(this),this.personal=new f(this),this.bzz=new l(this),this.settings=new p,this.version={api:h.version},this.providers={HttpProvider:b,IpcProvider:_},this._extend=y(this),this._extend({properties:x()})}var o=t("./web3/requestmanager"),i=t("./web3/iban"),a=t("./web3/methods/eth"),s=t("./web3/methods/db"),c=t("./web3/methods/shh"),u=t("./web3/methods/net"),f=t("./web3/methods/personal"),l=t("./web3/methods/swarm"),p=t("./web3/settings"),h=t("./version.json"),d=t("./utils/utils"),m=t("./utils/sha3"),y=t("./web3/extend"),g=t("./web3/batch"),v=t("./web3/property"),b=t("./web3/httpprovider"),_=t("./web3/ipcprovider"),w=t("bignumber.js");r.providers={HttpProvider:b,IpcProvider:_},r.prototype.setProvider=function(t){this._requestManager.setProvider(t),this.currentProvider=t},r.prototype.reset=function(t){this._requestManager.reset(t),this.settings=new p},r.prototype.BigNumber=w,r.prototype.toHex=d.toHex,r.prototype.toAscii=d.toAscii,r.prototype.toUtf8=d.toUtf8,r.prototype.fromAscii=d.fromAscii,r.prototype.fromUtf8=d.fromUtf8,r.prototype.toDecimal=d.toDecimal,r.prototype.fromDecimal=d.fromDecimal,r.prototype.toBigNumber=d.toBigNumber,r.prototype.toWei=d.toWei,r.prototype.fromWei=d.fromWei,r.prototype.isAddress=d.isAddress,r.prototype.isChecksumAddress=d.isChecksumAddress,r.prototype.toChecksumAddress=d.toChecksumAddress,r.prototype.isIBAN=d.isIBAN,r.prototype.sha3=function(t,e){return"0x"+m(t,e)},r.prototype.fromICAP=function(t){var e=new i(t);return e.address()};var x=function(){return[new v({name:"version.node",getter:"web3_clientVersion"}),new v({name:"version.network",getter:"net_version",inputFormatter:d.toDecimal}),new v({name:"version.ethereum",getter:"eth_protocolVersion",inputFormatter:d.toDecimal}),new v({name:"version.whisper",getter:"shh_version",inputFormatter:d.toDecimal})]};r.prototype.isConnected=function(){return this.currentProvider&&this.currentProvider.isConnected()},r.prototype.createBatch=function(){return new g(this)},e.exports=r},{"./utils/sha3":19,"./utils/utils":20,"./version.json":21,"./web3/batch":24,"./web3/extend":28,"./web3/httpprovider":32,"./web3/iban":33,"./web3/ipcprovider":34,"./web3/methods/db":37,"./web3/methods/eth":38,"./web3/methods/net":39,"./web3/methods/personal":40,"./web3/methods/shh":41,"./web3/methods/swarm":42,"./web3/property":45,"./web3/requestmanager":46,"./web3/settings":47,"bignumber.js":"bignumber.js"}],23:[function(t,e,n){var r=t("../utils/sha3"),o=t("./event"),i=t("./formatters"),a=t("../utils/utils"),s=t("./filter"),c=t("./methods/watches"),u=function(t,e,n){this._requestManager=t,this._json=e,this._address=n};u.prototype.encode=function(t){t=t||{};var e={};return["fromBlock","toBlock"].filter(function(e){return void 0!==t[e]}).forEach(function(n){e[n]=i.inputBlockNumberFormatter(t[n])}),e.address=this._address,e},u.prototype.decode=function(t){t.data=t.data||"",t.topics=t.topics||[];var e=t.topics[0].slice(2),n=this._json.filter(function(t){return e===r(a.transformToFullName(t))})[0];if(!n)return console.warn("cannot find event for log"),t;var i=new o(this._requestManager,n,this._address);return i.decode(t)},u.prototype.execute=function(t,e){a.isFunction(arguments[arguments.length-1])&&(e=arguments[arguments.length-1],1===arguments.length&&(t=null));var n=this.encode(t),r=this.decode.bind(this);return new s(this._requestManager,n,c.eth(),r,e)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this);t.allEvents=e},e.exports=u},{"../utils/sha3":19,"../utils/utils":20,"./event":27,"./filter":29,"./formatters":30,"./methods/watches":43}],24:[function(t,e,n){var r=t("./jsonrpc"),o=t("./errors"),i=function(t){this.requestManager=t._requestManager,this.requests=[]};i.prototype.add=function(t){this.requests.push(t)},i.prototype.execute=function(){var t=this.requests;this.requestManager.sendBatch(t,function(e,n){n=n||[],t.map(function(t,e){return n[e]||{}}).forEach(function(e,n){if(t[n].callback){if(!r.isValidResponse(e))return t[n].callback(o.InvalidResponse(e));t[n].callback(null,t[n].format?t[n].format(e.result):e.result)}})})},e.exports=i},{"./errors":26,"./jsonrpc":35}],25:[function(t,e,n){var r=t("../utils/utils"),o=t("../solidity/coder"),i=t("./event"),a=t("./function"),s=t("./allevents"),c=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e.length}).map(function(t){return t.inputs.map(function(t){return t.type})}).map(function(t){return o.encodeParams(t,e)})[0]||""},u=function(t){t.abi.filter(function(t){return"function"===t.type}).map(function(e){return new a(t._eth,e,t.address)}).forEach(function(e){e.attachToContract(t)})},f=function(t){var e=t.abi.filter(function(t){return"event"===t.type}),n=new s(t._eth._requestManager,e,t.address);n.attachToContract(t),e.map(function(e){return new i(t._eth._requestManager,e,t.address)}).forEach(function(e){e.attachToContract(t)})},l=function(t,e){var n=0,r=!1,o=t._eth.filter("latest",function(i){if(!i&&!r)if(n++,n>50){if(o.stopWatching(function(){}),r=!0,!e)throw new Error("Contract transaction couldn't be found after 50 blocks");e(new Error("Contract transaction couldn't be found after 50 blocks"))}else t._eth.getTransactionReceipt(t.transactionHash,function(n,i){i&&!r&&t._eth.getCode(i.contractAddress,function(n,a){if(!r&&a)if(o.stopWatching(function(){}),r=!0,a.length>3)t.address=i.contractAddress,u(t),f(t),e&&e(null,t);else{if(!e)throw new Error("The contract code couldn't be stored, please check your gas amount.");e(new Error("The contract code couldn't be stored, please check your gas amount."))}})})})},p=function(t,e){this.eth=t,this.abi=e,this.new=function(){var t,n=new h(this.eth,this.abi),o={},i=Array.prototype.slice.call(arguments);r.isFunction(i[i.length-1])&&(t=i.pop());var a=i[i.length-1];if(r.isObject(a)&&!r.isArray(a)&&(o=i.pop()),o.value>0){var s=e.filter(function(t){return"constructor"===t.type&&t.inputs.length===i.length})[0]||{};if(!s.payable)throw new Error("Cannot send value to non-payable constructor")}var u=c(this.abi,i);if(o.data+=u,t)this.eth.sendTransaction(o,function(e,r){e?t(e):(n.transactionHash=r,t(null,n),l(n,t))});else{var f=this.eth.sendTransaction(o);n.transactionHash=f,l(n)}return n},this.new.getData=this.getData.bind(this)};p.prototype.at=function(t,e){var n=new h(this.eth,this.abi,t);return u(n),f(n),e&&e(null,n),n},p.prototype.getData=function(){var t={},e=Array.prototype.slice.call(arguments),n=e[e.length-1];r.isObject(n)&&!r.isArray(n)&&(t=e.pop());var o=c(this.abi,e);return t.data+=o,t.data};var h=function(t,e,n){this._eth=t,this.transactionHash=null,this.address=n,this.abi=e};e.exports=p},{"../solidity/coder":7,"../utils/utils":20,"./allevents":23,"./event":27,"./function":31}],26:[function(t,e,n){e.exports={InvalidNumberOfParams:function(){return new Error("Invalid number of input parameters")},InvalidConnection:function(t){return new Error("CONNECTION ERROR: Couldn't connect to node "+t+".")},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(t){var e=t&&t.error&&t.error.message?t.error.message:"Invalid JSON RPC response: "+JSON.stringify(t);return new Error(e)},ConnectionTimeout:function(t){return new Error("CONNECTION TIMEOUT: timeout of "+t+" ms achived")}}},{}],27:[function(t,e,n){var r=t("../utils/utils"),o=t("../solidity/coder"),i=t("./formatters"),a=t("../utils/sha3"),s=t("./filter"),c=t("./methods/watches"),u=function(t,e,n){this._requestManager=t,this._params=e.inputs,this._name=r.transformToFullName(e),this._address=n,this._anonymous=e.anonymous};u.prototype.types=function(t){return this._params.filter(function(e){return e.indexed===t}).map(function(t){return t.type})},u.prototype.displayName=function(){return r.extractDisplayName(this._name)},u.prototype.typeName=function(){return r.extractTypeName(this._name)},u.prototype.signature=function(){return a(this._name)},u.prototype.encode=function(t,e){t=t||{},e=e||{};var n={};["fromBlock","toBlock"].filter(function(t){return void 0!==e[t]}).forEach(function(t){n[t]=i.inputBlockNumberFormatter(e[t])}),n.topics=[],n.address=this._address,this._anonymous||n.topics.push("0x"+this.signature());var a=this._params.filter(function(t){return t.indexed===!0}).map(function(e){var n=t[e.name];return void 0===n||null===n?null:r.isArray(n)?n.map(function(t){return"0x"+o.encodeParam(e.type,t)}):"0x"+o.encodeParam(e.type,n)});return n.topics=n.topics.concat(a),n},u.prototype.decode=function(t){t.data=t.data||"",t.topics=t.topics||[];var e=this._anonymous?t.topics:t.topics.slice(1),n=e.map(function(t){return t.slice(2)}).join(""),r=o.decodeParams(this.types(!0),n),a=t.data.slice(2),s=o.decodeParams(this.types(!1),a),c=i.outputLogFormatter(t);return c.event=this.displayName(),c.address=t.address,c.args=this._params.reduce(function(t,e){return t[e.name]=e.indexed?r.shift():s.shift(),t},{}),delete c.data,delete c.topics,c},u.prototype.execute=function(t,e,n){r.isFunction(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],2===arguments.length&&(e=null),1===arguments.length&&(e=null,t={}));var o=this.encode(t,e),i=this.decode.bind(this);return new s(this._requestManager,o,c.eth(),i,n)},u.prototype.attachToContract=function(t){var e=this.execute.bind(this),n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=this.execute.bind(this,t)},e.exports=u},{"../solidity/coder":7,"../utils/sha3":19,"../utils/utils":20,"./filter":29,"./formatters":30,"./methods/watches":43}],28:[function(t,e,n){var r=t("./formatters"),o=t("./../utils/utils"),i=t("./method"),a=t("./property"),s=function(t){var e=function(e){var n;e.property?(t[e.property]||(t[e.property]={}),n=t[e.property]):n=t,e.methods&&e.methods.forEach(function(e){e.attachToObject(n),e.setRequestManager(t._requestManager)}),e.properties&&e.properties.forEach(function(e){e.attachToObject(n),e.setRequestManager(t._requestManager)})};return e.formatters=r,e.utils=o,e.Method=i,e.Property=a,e};e.exports=s},{"./../utils/utils":20,"./formatters":30,"./method":36,"./property":45}],29:[function(t,e,n){var r=t("./formatters"),o=t("../utils/utils"),i=function(t){return null===t||"undefined"==typeof t?null:(t=String(t),0===t.indexOf("0x")?t:o.fromUtf8(t))},a=function(t){return o.isString(t)?t:(t=t||{},t.topics=t.topics||[],t.topics=t.topics.map(function(t){return o.isArray(t)?t.map(i):i(t)}),{topics:t.topics,from:t.from,to:t.to,address:t.address,fromBlock:r.inputBlockNumberFormatter(t.fromBlock),toBlock:r.inputBlockNumberFormatter(t.toBlock)})},s=function(t,e){o.isString(t.options)||t.get(function(t,n){t&&e(t),o.isArray(n)&&n.forEach(function(t){e(null,t)})})},c=function(t){var e=function(e,n){return e?t.callbacks.forEach(function(t){t(e)}):void(o.isArray(n)&&n.forEach(function(e){e=t.formatter?t.formatter(e):e,t.callbacks.forEach(function(t){t(null,e)})}))};t.requestManager.startPolling({method:t.implementation.poll.call,params:[t.filterId]},t.filterId,e,t.stopWatching.bind(t))},u=function(t,e,n,r,o,i){var u=this,f={};return n.forEach(function(e){e.setRequestManager(t),e.attachToObject(f)}),this.requestManager=t,this.options=a(e),this.implementation=f,this.filterId=null,this.callbacks=[],this.getLogsCallbacks=[],this.pollFilters=[],this.formatter=r,this.implementation.newFilter(this.options,function(t,e){ 2 | if(t)u.callbacks.forEach(function(e){e(t)}),i(t);else if(u.filterId=e,u.getLogsCallbacks.forEach(function(t){u.get(t)}),u.getLogsCallbacks=[],u.callbacks.forEach(function(t){s(u,t)}),u.callbacks.length>0&&c(u),"function"==typeof o)return u.watch(o)}),this};u.prototype.watch=function(t){return this.callbacks.push(t),this.filterId&&(s(this,t),c(this)),this},u.prototype.stopWatching=function(t){return this.requestManager.stopPolling(this.filterId),this.callbacks=[],t?void this.implementation.uninstallFilter(this.filterId,t):this.implementation.uninstallFilter(this.filterId)},u.prototype.get=function(t){var e=this;if(!o.isFunction(t)){if(null===this.filterId)throw new Error("Filter ID Error: filter().get() can't be chained synchronous, please provide a callback for the get() method.");var n=this.implementation.getLogs(this.filterId);return n.map(function(t){return e.formatter?e.formatter(t):t})}return null===this.filterId?this.getLogsCallbacks.push(t):this.implementation.getLogs(this.filterId,function(n,r){n?t(n):t(null,r.map(function(t){return e.formatter?e.formatter(t):t}))}),this},e.exports=u},{"../utils/utils":20,"./formatters":30}],30:[function(t,e,n){var r=t("../utils/utils"),o=t("../utils/config"),i=t("./iban"),a=function(t){return r.toBigNumber(t)},s=function(t){return"latest"===t||"pending"===t||"earliest"===t},c=function(t){return void 0===t?o.defaultBlock:u(t)},u=function(t){if(void 0!==t)return s(t)?t:r.toHex(t)},f=function(t){return t.from=t.from||o.defaultAccount,t.from&&(t.from=v(t.from)),t.to&&(t.to=v(t.to)),["gasPrice","gas","value","nonce"].filter(function(e){return void 0!==t[e]}).forEach(function(e){t[e]=r.fromDecimal(t[e])}),t},l=function(t){return t.from=t.from||o.defaultAccount,t.from=v(t.from),t.to&&(t.to=v(t.to)),["gasPrice","gas","value","nonce"].filter(function(e){return void 0!==t[e]}).forEach(function(e){t[e]=r.fromDecimal(t[e])}),t},p=function(t){return null!==t.blockNumber&&(t.blockNumber=r.toDecimal(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=r.toDecimal(t.transactionIndex)),t.nonce=r.toDecimal(t.nonce),t.gas=r.toDecimal(t.gas),t.gasPrice=r.toBigNumber(t.gasPrice),t.value=r.toBigNumber(t.value),t},h=function(t){return null!==t.blockNumber&&(t.blockNumber=r.toDecimal(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=r.toDecimal(t.transactionIndex)),t.cumulativeGasUsed=r.toDecimal(t.cumulativeGasUsed),t.gasUsed=r.toDecimal(t.gasUsed),r.isArray(t.logs)&&(t.logs=t.logs.map(function(t){return m(t)})),t},d=function(t){return t.gasLimit=r.toDecimal(t.gasLimit),t.gasUsed=r.toDecimal(t.gasUsed),t.size=r.toDecimal(t.size),t.timestamp=r.toDecimal(t.timestamp),null!==t.number&&(t.number=r.toDecimal(t.number)),t.difficulty=r.toBigNumber(t.difficulty),t.totalDifficulty=r.toBigNumber(t.totalDifficulty),r.isArray(t.transactions)&&t.transactions.forEach(function(t){if(!r.isString(t))return p(t)}),t},m=function(t){return null!==t.blockNumber&&(t.blockNumber=r.toDecimal(t.blockNumber)),null!==t.transactionIndex&&(t.transactionIndex=r.toDecimal(t.transactionIndex)),null!==t.logIndex&&(t.logIndex=r.toDecimal(t.logIndex)),t},y=function(t){return t.ttl=r.fromDecimal(t.ttl),t.workToProve=r.fromDecimal(t.workToProve),t.priority=r.fromDecimal(t.priority),r.isArray(t.topics)||(t.topics=t.topics?[t.topics]:[]),t.topics=t.topics.map(function(t){return 0===t.indexOf("0x")?t:r.fromUtf8(t)}),t},g=function(t){return t.expiry=r.toDecimal(t.expiry),t.sent=r.toDecimal(t.sent),t.ttl=r.toDecimal(t.ttl),t.workProved=r.toDecimal(t.workProved),t.topics||(t.topics=[]),t.topics=t.topics.map(function(t){return r.toAscii(t)}),t},v=function(t){var e=new i(t);if(e.isValid()&&e.isDirect())return"0x"+e.address();if(r.isStrictAddress(t))return t;if(r.isAddress(t))return"0x"+t;throw new Error("invalid address")},b=function(t){return t.startingBlock=r.toDecimal(t.startingBlock),t.currentBlock=r.toDecimal(t.currentBlock),t.highestBlock=r.toDecimal(t.highestBlock),t.knownStates&&(t.knownStates=r.toDecimal(t.knownStates),t.pulledStates=r.toDecimal(t.pulledStates)),t};e.exports={inputDefaultBlockNumberFormatter:c,inputBlockNumberFormatter:u,inputCallFormatter:f,inputTransactionFormatter:l,inputAddressFormatter:v,inputPostFormatter:y,outputBigNumberFormatter:a,outputTransactionFormatter:p,outputTransactionReceiptFormatter:h,outputBlockFormatter:d,outputLogFormatter:m,outputPostFormatter:g,outputSyncingFormatter:b}},{"../utils/config":18,"../utils/utils":20,"./iban":33}],31:[function(t,e,n){var r=t("../solidity/coder"),o=t("../utils/utils"),i=t("./formatters"),a=t("../utils/sha3"),s=function(t,e,n){this._eth=t,this._inputTypes=e.inputs.map(function(t){return t.type}),this._outputTypes=e.outputs.map(function(t){return t.type}),this._constant=e.constant,this._payable=e.payable,this._name=o.transformToFullName(e),this._address=n};s.prototype.extractCallback=function(t){if(o.isFunction(t[t.length-1]))return t.pop()},s.prototype.extractDefaultBlock=function(t){if(t.length>this._inputTypes.length&&!o.isObject(t[t.length-1]))return i.inputDefaultBlockNumberFormatter(t.pop())},s.prototype.toPayload=function(t){var e={};return t.length>this._inputTypes.length&&o.isObject(t[t.length-1])&&(e=t[t.length-1]),e.to=this._address,e.data="0x"+this.signature()+r.encodeParams(this._inputTypes,t),e},s.prototype.signature=function(){return a(this._name).slice(0,8)},s.prototype.unpackOutput=function(t){if(t){t=t.length>=2?t.slice(2):t;var e=r.decodeParams(this._outputTypes,t);return 1===e.length?e[0]:e}},s.prototype.call=function(){var t=Array.prototype.slice.call(arguments).filter(function(t){return void 0!==t}),e=this.extractCallback(t),n=this.extractDefaultBlock(t),r=this.toPayload(t);if(!e){var o=this._eth.call(r,n);return this.unpackOutput(o)}var i=this;this._eth.call(r,n,function(t,n){if(t)return e(t,null);var r=null;try{r=i.unpackOutput(n)}catch(e){t=e}e(t,r)})},s.prototype.sendTransaction=function(){var t=Array.prototype.slice.call(arguments).filter(function(t){return void 0!==t}),e=this.extractCallback(t),n=this.toPayload(t);if(n.value>0&&!this._payable)throw new Error("Cannot send value to non-payable function");return e?void this._eth.sendTransaction(n,e):this._eth.sendTransaction(n)},s.prototype.estimateGas=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t);return e?void this._eth.estimateGas(n,e):this._eth.estimateGas(n)},s.prototype.getData=function(){var t=Array.prototype.slice.call(arguments),e=this.toPayload(t);return e.data},s.prototype.displayName=function(){return o.extractDisplayName(this._name)},s.prototype.typeName=function(){return o.extractTypeName(this._name)},s.prototype.request=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t),r=this.unpackOutput.bind(this);return{method:this._constant?"eth_call":"eth_sendTransaction",callback:e,params:[n],format:r}},s.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},s.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this),e.estimateGas=this.estimateGas.bind(this),e.getData=this.getData.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=s},{"../solidity/coder":7,"../utils/sha3":19,"../utils/utils":20,"./formatters":30}],32:[function(t,e,n){var r=t("./errors");"undefined"!=typeof window&&window.XMLHttpRequest?XMLHttpRequest=window.XMLHttpRequest:XMLHttpRequest=t("xmlhttprequest").XMLHttpRequest;var o=t("xhr2"),i=function(t,e){this.host=t||"http://localhost:8545",this.timeout=e||0};i.prototype.prepareRequest=function(t){var e;return t?(e=new o,e.timeout=this.timeout):e=new XMLHttpRequest,e.open("POST",this.host,t),e.setRequestHeader("Content-Type","application/json"),e},i.prototype.send=function(t){var e=this.prepareRequest(!1);try{e.send(JSON.stringify(t))}catch(t){throw r.InvalidConnection(this.host)}var n=e.responseText;try{n=JSON.parse(n)}catch(t){throw r.InvalidResponse(e.responseText)}return n},i.prototype.sendAsync=function(t,e){var n=this.prepareRequest(!0);n.onreadystatechange=function(){if(4===n.readyState&&1!==n.timeout){var t=n.responseText,o=null;try{t=JSON.parse(t)}catch(t){o=r.InvalidResponse(n.responseText)}e(o,t)}},n.ontimeout=function(){e(r.ConnectionTimeout(this.timeout))};try{n.send(JSON.stringify(t))}catch(t){e(r.InvalidConnection(this.host))}},i.prototype.isConnected=function(){try{return this.send({id:9999999999,jsonrpc:"2.0",method:"net_listening",params:[]}),!0}catch(t){return!1}},e.exports=i},{"./errors":26,xhr2:86,xmlhttprequest:17}],33:[function(t,e,n){var r=t("bignumber.js"),o=function(t,e){for(var n=t;n.length<2*e;)n="0"+n;return n},i=function(t){var e="A".charCodeAt(0),n="Z".charCodeAt(0);return t=t.toUpperCase(),t=t.substr(4)+t.substr(0,4),t.split("").map(function(t){var r=t.charCodeAt(0);return r>=e&&r<=n?r-e+10:t}).join("")},a=function(t){for(var e,n=t;n.length>2;)e=n.slice(0,9),n=parseInt(e,10)%97+n.slice(e.length);return parseInt(n,10)%97},s=function(t){this._iban=t};s.fromAddress=function(t){var e=new r(t,16),n=e.toString(36),i=o(n,15);return s.fromBban(i.toUpperCase())},s.fromBban=function(t){var e="XE",n=a(i(e+"00"+t)),r=("0"+(98-n)).slice(-2);return new s(e+r+t)},s.createIndirect=function(t){return s.fromBban("ETH"+t.institution+t.identifier)},s.isValid=function(t){var e=new s(t);return e.isValid()},s.prototype.isValid=function(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===a(i(this._iban))},s.prototype.isDirect=function(){return 34===this._iban.length||35===this._iban.length},s.prototype.isIndirect=function(){return 20===this._iban.length},s.prototype.checksum=function(){return this._iban.substr(2,2)},s.prototype.institution=function(){return this.isIndirect()?this._iban.substr(7,4):""},s.prototype.client=function(){return this.isIndirect()?this._iban.substr(11):""},s.prototype.address=function(){if(this.isDirect()){var t=this._iban.substr(4),e=new r(t,36);return o(e.toString(16),20)}return""},s.prototype.toString=function(){return this._iban},e.exports=s},{"bignumber.js":"bignumber.js"}],34:[function(t,e,n){"use strict";var r=t("../utils/utils"),o=t("./errors"),i=function(t,e){var n=this;this.responseCallbacks={},this.path=t,this.connection=e.connect({path:this.path}),this.connection.on("error",function(t){console.error("IPC Connection Error",t),n._timeout()}),this.connection.on("end",function(){n._timeout()}),this.connection.on("data",function(t){n._parseResponse(t.toString()).forEach(function(t){var e=null;r.isArray(t)?t.forEach(function(t){n.responseCallbacks[t.id]&&(e=t.id)}):e=t.id,n.responseCallbacks[e]&&(n.responseCallbacks[e](null,t),delete n.responseCallbacks[e])})})};i.prototype._parseResponse=function(t){var e=this,n=[],r=t.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|");return r.forEach(function(t){e.lastChunk&&(t=e.lastChunk+t);var r=null;try{r=JSON.parse(t)}catch(n){return e.lastChunk=t,clearTimeout(e.lastChunkTimeout),void(e.lastChunkTimeout=setTimeout(function(){throw e._timeout(),o.InvalidResponse(t)},15e3))}clearTimeout(e.lastChunkTimeout),e.lastChunk=null,r&&n.push(r)}),n},i.prototype._addResponseCallback=function(t,e){var n=t.id||t[0].id,r=t.method||t[0].method;this.responseCallbacks[n]=e,this.responseCallbacks[n].method=r},i.prototype._timeout=function(){for(var t in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(t)&&(this.responseCallbacks[t](o.InvalidConnection("on IPC")),delete this.responseCallbacks[t])},i.prototype.isConnected=function(){var t=this;return t.connection.writable||t.connection.connect({path:t.path}),!!this.connection.writable},i.prototype.send=function(t){if(this.connection.writeSync){var e;this.connection.writable||this.connection.connect({path:this.path});var n=this.connection.writeSync(JSON.stringify(t));try{e=JSON.parse(n)}catch(t){throw o.InvalidResponse(n)}return e}throw new Error('You tried to send "'+t.method+'" synchronously. Synchronous requests are not supported by the IPC provider.')},i.prototype.sendAsync=function(t,e){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(t)),this._addResponseCallback(t,e)},e.exports=i},{"../utils/utils":20,"./errors":26}],35:[function(t,e,n){var r={messageId:0};r.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),r.messageId++,{jsonrpc:"2.0",id:r.messageId,method:t,params:e||[]}},r.isValidResponse=function(t){function e(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result}return Array.isArray(t)?t.every(e):e(t)},r.toBatchPayload=function(t){return t.map(function(t){return r.toPayload(t.method,t.params)})},e.exports=r},{}],36:[function(t,e,n){var r=t("../utils/utils"),o=t("./errors"),i=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter,this.requestManager=null};i.prototype.setRequestManager=function(t){this.requestManager=t},i.prototype.getCall=function(t){return r.isFunction(this.call)?this.call(t):this.call},i.prototype.extractCallback=function(t){if(r.isFunction(t[t.length-1]))return t.pop()},i.prototype.validateArgs=function(t){if(t.length!==this.params)throw o.InvalidNumberOfParams()},i.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},i.prototype.formatOutput=function(t){return this.outputFormatter&&t?this.outputFormatter(t):t},i.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},i.prototype.attachToObject=function(t){var e=this.buildCall();e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},i.prototype.buildCall=function(){var t=this,e=function(){var e=t.toPayload(Array.prototype.slice.call(arguments));return e.callback?t.requestManager.sendAsync(e,function(n,r){e.callback(n,t.formatOutput(r))}):t.formatOutput(t.requestManager.send(e))};return e.request=this.request.bind(this),e},i.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},e.exports=i},{"../utils/utils":20,"./errors":26}],37:[function(t,e,n){var r=t("../method"),o=function(t){this._requestManager=t._requestManager;var e=this;i().forEach(function(n){n.attachToObject(e),n.setRequestManager(t._requestManager)})},i=function(){var t=new r({name:"putString",call:"db_putString",params:3}),e=new r({name:"getString",call:"db_getString",params:2}),n=new r({name:"putHex",call:"db_putHex",params:3}),o=new r({name:"getHex",call:"db_getHex",params:2});return[t,e,n,o]};e.exports=o},{"../method":36}],38:[function(t,e,n){"use strict";function r(t){this._requestManager=t._requestManager;var e=this;w().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}),x().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}),this.iban=d,this.sendIBANTransaction=m.bind(null,this)}var o=t("../formatters"),i=t("../../utils/utils"),a=t("../method"),s=t("../property"),c=t("../../utils/config"),u=t("../contract"),f=t("./watches"),l=t("../filter"),p=t("../syncing"),h=t("../namereg"),d=t("../iban"),m=t("../transfer"),y=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockByHash":"eth_getBlockByNumber"},g=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getTransactionByBlockHashAndIndex":"eth_getTransactionByBlockNumberAndIndex"},v=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleByBlockHashAndIndex":"eth_getUncleByBlockNumberAndIndex"},b=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getBlockTransactionCountByHash":"eth_getBlockTransactionCountByNumber"},_=function(t){return i.isString(t[0])&&0===t[0].indexOf("0x")?"eth_getUncleCountByBlockHash":"eth_getUncleCountByBlockNumber"};Object.defineProperty(r.prototype,"defaultBlock",{get:function(){return c.defaultBlock},set:function(t){return c.defaultBlock=t,t}}),Object.defineProperty(r.prototype,"defaultAccount",{get:function(){return c.defaultAccount},set:function(t){return c.defaultAccount=t,t}});var w=function(){var t=new a({name:"getBalance",call:"eth_getBalance",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter],outputFormatter:o.outputBigNumberFormatter}),e=new a({name:"getStorageAt",call:"eth_getStorageAt",params:3,inputFormatter:[null,i.toHex,o.inputDefaultBlockNumberFormatter]}),n=new a({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),r=new a({name:"getBlock",call:y,params:2,inputFormatter:[o.inputBlockNumberFormatter,function(t){return!!t}],outputFormatter:o.outputBlockFormatter}),s=new a({name:"getUncle",call:v,params:2,inputFormatter:[o.inputBlockNumberFormatter,i.toHex],outputFormatter:o.outputBlockFormatter}),c=new a({name:"getCompilers",call:"eth_getCompilers",params:0}),u=new a({name:"getBlockTransactionCount",call:b,params:1,inputFormatter:[o.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),f=new a({name:"getBlockUncleCount",call:_,params:1,inputFormatter:[o.inputBlockNumberFormatter],outputFormatter:i.toDecimal}),l=new a({name:"getTransaction",call:"eth_getTransactionByHash",params:1,outputFormatter:o.outputTransactionFormatter}),p=new a({name:"getTransactionFromBlock",call:g,params:2,inputFormatter:[o.inputBlockNumberFormatter,i.toHex],outputFormatter:o.outputTransactionFormatter}),h=new a({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,outputFormatter:o.outputTransactionReceiptFormatter}),d=new a({name:"getTransactionCount",call:"eth_getTransactionCount",params:2,inputFormatter:[null,o.inputDefaultBlockNumberFormatter],outputFormatter:i.toDecimal}),m=new a({name:"sendRawTransaction",call:"eth_sendRawTransaction",params:1,inputFormatter:[null]}),w=new a({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[o.inputTransactionFormatter]}),x=new a({name:"sign",call:"eth_sign",params:2,inputFormatter:[o.inputAddressFormatter,null]}),k=new a({name:"call",call:"eth_call",params:2,inputFormatter:[o.inputCallFormatter,o.inputDefaultBlockNumberFormatter]}),B=new a({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[o.inputCallFormatter],outputFormatter:i.toDecimal}),S=new a({name:"compile.solidity",call:"eth_compileSolidity",params:1}),C=new a({name:"compile.lll",call:"eth_compileLLL",params:1}),A=new a({name:"compile.serpent",call:"eth_compileSerpent",params:1}),F=new a({name:"submitWork",call:"eth_submitWork",params:3}),I=new a({name:"getWork",call:"eth_getWork",params:0});return[t,e,n,r,s,c,u,f,l,p,h,d,k,B,m,w,x,S,C,A,F,I]},x=function(){return[new s({name:"coinbase",getter:"eth_coinbase"}),new s({name:"mining",getter:"eth_mining"}),new s({name:"hashrate",getter:"eth_hashrate",outputFormatter:i.toDecimal}),new s({name:"syncing",getter:"eth_syncing",outputFormatter:o.outputSyncingFormatter}),new s({name:"gasPrice",getter:"eth_gasPrice",outputFormatter:o.outputBigNumberFormatter}),new s({name:"accounts",getter:"eth_accounts"}),new s({name:"blockNumber",getter:"eth_blockNumber",outputFormatter:i.toDecimal}),new s({name:"protocolVersion",getter:"eth_protocolVersion"})]};r.prototype.contract=function(t){var e=new u(this,t);return e},r.prototype.filter=function(t,e){return new l(this._requestManager,t,f.eth(),o.outputLogFormatter,e)},r.prototype.namereg=function(){return this.contract(h.global.abi).at(h.global.address)},r.prototype.icapNamereg=function(){return this.contract(h.icap.abi).at(h.icap.address)},r.prototype.isSyncing=function(t){return new p(this._requestManager,t)},e.exports=r},{"../../utils/config":18,"../../utils/utils":20,"../contract":25,"../filter":29,"../formatters":30,"../iban":33,"../method":36,"../namereg":44,"../property":45,"../syncing":48,"../transfer":49,"./watches":43}],39:[function(t,e,n){var r=t("../../utils/utils"),o=t("../property"),i=function(t){this._requestManager=t._requestManager;var e=this;a().forEach(function(n){n.attachToObject(e),n.setRequestManager(t._requestManager)})},a=function(){return[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})]};e.exports=i},{"../../utils/utils":20,"../property":45}],40:[function(t,e,n){"use strict";function r(t){this._requestManager=t._requestManager;var e=this;s().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}),c().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})}var o=t("../method"),i=t("../property"),a=t("../formatters"),s=function(){var t=new o({name:"newAccount",call:"personal_newAccount",params:1,inputFormatter:[null]}),e=new o({name:"unlockAccount",call:"personal_unlockAccount",params:3,inputFormatter:[a.inputAddressFormatter,null,null]}),n=new o({name:"sendTransaction",call:"personal_sendTransaction",params:2,inputFormatter:[a.inputTransactionFormatter,null]}),r=new o({name:"lockAccount",call:"personal_lockAccount",params:1,inputFormatter:[a.inputAddressFormatter]});return[t,e,n,r]},c=function(){return[new i({name:"listAccounts",getter:"personal_listAccounts"})]};e.exports=r},{"../formatters":30,"../method":36,"../property":45}],41:[function(t,e,n){var r=t("../method"),o=t("../formatters"),i=t("../filter"),a=t("./watches"),s=function(t){this._requestManager=t._requestManager;var e=this;c().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})};s.prototype.filter=function(t,e){return new i(this._requestManager,t,a.shh(),o.outputPostFormatter,e)};var c=function(){var t=new r({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),e=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),n=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),i=new r({name:"newGroup",call:"shh_newGroup",params:0}),a=new r({name:"addToGroup",call:"shh_addToGroup",params:0});return[t,e,n,i,a]};e.exports=s},{"../filter":29,"../formatters":30,"../method":36,"./watches":43}],42:[function(t,e,n){"use strict";function r(t){this._requestManager=t._requestManager;var e=this;a().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)}),s().forEach(function(t){t.attachToObject(e),t.setRequestManager(e._requestManager)})}var o=t("../method"),i=t("../property"),a=function(){var t=new o({name:"blockNetworkRead",call:"bzz_blockNetworkRead",params:1,inputFormatter:[null]}),e=new o({name:"syncEnabled",call:"bzz_syncEnabled",params:1,inputFormatter:[null]}),n=new o({name:"swapEnabled",call:"bzz_swapEnabled",params:1,inputFormatter:[null]}),r=new o({name:"download",call:"bzz_download",params:2,inputFormatter:[null,null]}),i=new o({name:"upload",call:"bzz_upload",params:2,inputFormatter:[null,null]}),a=new o({name:"retrieve",call:"bzz_retrieve",params:1,inputFormatter:[null]}),s=new o({name:"store",call:"bzz_store",params:2,inputFormatter:[null,null]}),c=new o({name:"get",call:"bzz_get",params:1,inputFormatter:[null]}),u=new o({name:"put",call:"bzz_put",params:2,inputFormatter:[null,null]}),f=new o({name:"modify",call:"bzz_modify",params:4,inputFormatter:[null,null,null,null]});return[t,e,n,r,i,a,s,c,u,f]},s=function(){return[new i({name:"hive",getter:"bzz_hive"}),new i({name:"info",getter:"bzz_info"})]};e.exports=r},{"../method":36,"../property":45}],43:[function(t,e,n){var r=t("../method"),o=function(){var t=function(t){var e=t[0];switch(e){case"latest":return t.shift(),this.params=0,"eth_newBlockFilter";case"pending":return t.shift(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,o,i]},i=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),o=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,n,o]};e.exports={eth:o,shh:i}},{"../method":36}],44:[function(t,e,n){var r=t("../contracts/GlobalRegistrar.json"),o=t("../contracts/ICAPRegistrar.json"),i="0xc6d9d2cd449a754c494264e1809c50e34d64562b",a="0xa1a111bc074c9cfa781f0c38e63bd51c91b8af00";e.exports={global:{abi:r,address:i},icap:{abi:o,address:a}}},{"../contracts/GlobalRegistrar.json":1,"../contracts/ICAPRegistrar.json":2}],45:[function(t,e,n){var r=t("../utils/utils"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter,this.requestManager=null};o.prototype.setRequestManager=function(t){this.requestManager=t},o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t&&void 0!==t?this.outputFormatter(t):t},o.prototype.extractCallback=function(t){if(r.isFunction(t[t.length-1]))return t.pop()},o.prototype.attachToObject=function(t){var e={get:this.buildGet(),enumerable:!0},n=this.name.split("."),r=n[0];n.length>1&&(t[n[0]]=t[n[0]]||{},t=t[n[0]],r=n[1]),Object.defineProperty(t,r,e),t[i(r)]=this.buildAsyncGet()};var i=function(t){return"get"+t.charAt(0).toUpperCase()+t.slice(1)};o.prototype.buildGet=function(){var t=this;return function(){return t.formatOutput(t.requestManager.send({method:t.getter}))}},o.prototype.buildAsyncGet=function(){var t=this,e=function(e){t.requestManager.sendAsync({method:t.getter},function(n,r){e(n,t.formatOutput(r))})};return e.request=this.request.bind(this),e},o.prototype.request=function(){var t={method:this.getter,params:[],callback:this.extractCallback(Array.prototype.slice.call(arguments))};return t.format=this.formatOutput.bind(this),t},e.exports=o},{"../utils/utils":20}],46:[function(t,e,n){var r=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){this.provider=t,this.polls={},this.timeout=null};s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.toPayload(t.method,t.params),n=this.provider.send(e);if(!r.isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.sendBatch=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.toBatchPayload(t);this.provider.sendAsync(n,function(t,n){return t?e(t):o.isArray(n)?void e(t,n):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls[e]={data:t,id:e,callback:n,uninstall:r},this.timeout||this.poll()},s.prototype.stopPolling=function(t){delete this.polls[t],0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.reset=function(t){for(var e in this.polls)t&&e.indexOf("syncPoll_")!==-1||(this.polls[e].uninstall(),delete this.polls[e]);0===Object.keys(this.polls).length&&this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),0!==Object.keys(this.polls).length){if(!this.provider)return void console.error(a.InvalidProvider());var t=[],e=[];for(var n in this.polls)t.push(this.polls[n].data),e.push(n);if(0!==t.length){var s=r.toBatchPayload(t),c={};s.forEach(function(t,n){c[t.id]=e[n]});var u=this;this.provider.sendAsync(s,function(t,e){if(!t){if(!o.isArray(e))throw a.InvalidResponse(e);e.map(function(t){var e=c[t.id];return!!u.polls[e]&&(t.callback=u.polls[e].callback,t)}).filter(function(t){return!!t}).filter(function(t){var e=r.isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).forEach(function(t){t.callback(null,t.result)})}})}}},e.exports=s},{"../utils/config":18,"../utils/utils":20,"./errors":26,"./jsonrpc":35}],47:[function(t,e,n){var r=function(){this.defaultBlock="latest",this.defaultAccount=void 0};e.exports=r},{}],48:[function(t,e,n){var r=t("./formatters"),o=t("../utils/utils"),i=1,a=function(t){var e=function(e,n){return e?t.callbacks.forEach(function(t){t(e)}):(o.isObject(n)&&n.startingBlock&&(n=r.outputSyncingFormatter(n)),void t.callbacks.forEach(function(e){t.lastSyncState!==n&&(!t.lastSyncState&&o.isObject(n)&&e(null,!0),setTimeout(function(){e(null,n)},0),t.lastSyncState=n)}))};t.requestManager.startPolling({method:"eth_syncing",params:[]},t.pollId,e,t.stopWatching.bind(t))},s=function(t,e){return this.requestManager=t,this.pollId="syncPoll_"+i++,this.callbacks=[],this.addCallback(e),this.lastSyncState=!1,a(this),this};s.prototype.addCallback=function(t){return t&&this.callbacks.push(t),this},s.prototype.stopWatching=function(){this.requestManager.stopPolling(this.pollId),this.callbacks=[]},e.exports=s},{"../utils/utils":20,"./formatters":30}],49:[function(t,e,n){var r=t("./iban"),o=t("../contracts/SmartExchange.json"),i=function(t,e,n,o,i){var c=new r(n);if(!c.isValid())throw new Error("invalid iban address");if(c.isDirect())return a(t,e,c.address(),o,i);if(!i){var u=t.icapNamereg().addr(c.institution());return s(t,e,u,o,c.client())}t.icapNamereg().addr(c.institution(),function(n,r){return s(t,e,r,o,c.client(),i)})},a=function(t,e,n,r,o){return t.sendTransaction({address:n,from:e,value:r},o)},s=function(t,e,n,r,i,a){var s=o;return t.contract(s).at(n).deposit(i,{from:e,value:r},a)};e.exports=i},{"../contracts/SmartExchange.json":3,"./iban":33}],50:[function(t,e,n){},{}],51:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./enc-base64"),t("./md5"),t("./evpkdf"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,r=n.BlockCipher,o=e.algo,i=[],a=[],s=[],c=[],u=[],f=[],l=[],p=[],h=[],d=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var n=0,r=0,e=0;e<256;e++){var o=r^r<<1^r<<2^r<<3^r<<4;o=o>>>8^255&o^99,i[n]=o,a[o]=n;var m=t[n],y=t[m],g=t[y],v=257*t[o]^16843008*o;s[n]=v<<24|v>>>8,c[n]=v<<16|v>>>16,u[n]=v<<8|v>>>24,f[n]=v;var v=16843009*g^65537*y^257*m^16843008*n;l[o]=v<<24|v>>>8,p[o]=v<<16|v>>>16,h[o]=v<<8|v>>>24,d[o]=v,n?(n=m^t[t[t[g^m]]],r^=t[t[r]]):n=r=1}}();var m=[0,1,2,4,8,16,32,64,128,27,54],y=o.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,n=t.sigBytes/4,r=this._nRounds=n+6,o=4*(r+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=c<<8|c>>>24,c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=m[s/n|0]<<24),a[s]=a[s-n]^c}for(var u=this._invKeySchedule=[],f=0;f>>24]]^p[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,c,u,f,i)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,l,p,h,d,a);var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,o,i,a,s){for(var c=this._nRounds,u=t[e]^n[0],f=t[e+1]^n[1],l=t[e+2]^n[2],p=t[e+3]^n[3],h=4,d=1;d>>24]^o[f>>>16&255]^i[l>>>8&255]^a[255&p]^n[h++],y=r[f>>>24]^o[l>>>16&255]^i[p>>>8&255]^a[255&u]^n[h++],g=r[l>>>24]^o[p>>>16&255]^i[u>>>8&255]^a[255&f]^n[h++],v=r[p>>>24]^o[u>>>16&255]^i[f>>>8&255]^a[255&l]^n[h++];u=m,f=y,l=g,p=v}var m=(s[u>>>24]<<24|s[f>>>16&255]<<16|s[l>>>8&255]<<8|s[255&p])^n[h++],y=(s[f>>>24]<<24|s[l>>>16&255]<<16|s[p>>>8&255]<<8|s[255&u])^n[h++],g=(s[l>>>24]<<24|s[p>>>16&255]<<16|s[u>>>8&255]<<8|s[255&f])^n[h++],v=(s[p>>>24]<<24|s[u>>>16&255]<<16|s[f>>>8&255]<<8|s[255&l])^n[h++];t[e]=m,t[e+1]=y,t[e+2]=g,t[e+3]=v},keySize:8});e.AES=r._createHelper(y)}(),t.AES})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],52:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){t.lib.Cipher||function(e){var n=t,r=n.lib,o=r.Base,i=r.WordArray,a=r.BufferedBlockAlgorithm,s=n.enc,c=(s.Utf8,s.Base64),u=n.algo,f=u.EvpKDF,l=r.Cipher=a.extend({cfg:o.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?k:_}return function(e){return{encrypt:function(n,r,o){return t(r).encrypt(e,n,r,o)},decrypt:function(n,r,o){return t(r).decrypt(e,n,r,o)}}}}()}),p=(r.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),n.mode={}),h=r.BlockCipherMode=o.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),d=p.CBC=function(){function t(t,n,r){var o=this._iv;if(o){var i=o;this._iv=e}else var i=this._prevBlock;for(var a=0;a>>2];t.sigBytes-=e}},g=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:y}),reset:function(){l.reset.call(this);var t=this.cfg,e=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else{var r=n.createDecryptor;this._minBufferSize=1}this._mode=r.call(n,this,e&&e.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else{var e=this._process(!0);t.unpad(e)}return e},blockSize:4}),r.CipherParams=o.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),v=n.format={},b=v.OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var r=i.create([1398893684,1701076831]).concat(n).concat(e);else var r=e;return r.toString(c)},parse:function(t){var e=c.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var r=i.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return g.create({ciphertext:e,salt:r})}},_=r.SerializableCipher=o.extend({cfg:o.extend({format:b}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var o=t.createEncryptor(n,r),i=o.finalize(e),a=o.cfg;return g.create({ciphertext:i,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var o=t.createDecryptor(n,r).finalize(e.ciphertext);return o},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),w=n.kdf={},x=w.OpenSSL={execute:function(t,e,n,r){r||(r=i.random(8));var o=f.create({keySize:e+n}).compute(t,r),a=i.create(o.words.slice(e),4*n);return o.sigBytes=4*e,g.create({key:o,iv:a,salt:r})}},k=r.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:x}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var o=r.kdf.execute(n,t.keySize,t.ivSize);r.iv=o.iv;var i=_.encrypt.call(this,t,e,o.key,r);return i.mixIn(o),i},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var o=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);r.iv=o.iv;var i=_.decrypt.call(this,t,e,o.key,r);return i}})}()})},{"./core":53}],53:[function(t,e,n){!function(t,r){"object"==typeof n?e.exports=n=r():"function"==typeof define&&define.amd?define([],r):t.CryptoJS=r()}(this,function(){var t=t||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},o=r.lib={},i=o.Base=function(){return{extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=o.WordArray=i.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=4*t.length},toString:function(t){return(t||c).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,o=t.sigBytes;if(this.clamp(),r%4)for(var i=0;i>>2]>>>24-i%4*8&255;e[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var i=0;i>>2]=n[i>>>2];return this.sigBytes+=o,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=i.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],o=function(e){var e=e,n=987654321,r=4294967295;return function(){n=36969*(65535&n)+(n>>16)&r,e=18e3*(65535&e)+(e>>16)&r;var o=(n<<16)+e&r;return o/=4294967296,o+=.5,o*(t.random()>.5?1:-1)}},i=0;i>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new a.init(n,e/2)}},u=s.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new a.init(n,e)}},f=s.Utf8={stringify:function(t){try{return decodeURIComponent(escape(u.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return u.parse(unescape(encodeURIComponent(t)))}},l=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,o=n.sigBytes,i=this.blockSize,s=4*i,c=o/s;c=e?t.ceil(c):t.max((0|c)-this._minBufferSize,0);var u=c*i,f=t.min(4*u,o);if(u){for(var l=0;l>>6-a%4*2;r[i>>>2]|=(s|c)<<24-i%4*8,i++}return o.create(r,i)}var n=t,r=n.lib,o=r.WordArray,i=n.enc;i.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var o=[],i=0;i>>2]>>>24-i%4*8&255,s=e[i+1>>>2]>>>24-(i+1)%4*8&255,c=e[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,f=0;f<4&&i+.75*f>>6*(3-f)&63));var l=r.charAt(64);if(l)for(;o.length%4;)o.push(l);return o.join("")},parse:function(t){var n=t.length,r=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var i=0;i>>8&16711935}var n=t,r=n.lib,o=r.WordArray,i=n.enc;i.Utf16=i.Utf16BE={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],o=0;o>>2]>>>16-o%4*8&65535;r.push(String.fromCharCode(i))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>1]|=t.charCodeAt(r)<<16-r%2*16;return o.create(n,2*e)}};i.Utf16LE={stringify:function(t){for(var n=t.words,r=t.sigBytes,o=[],i=0;i>>2]>>>16-i%4*8&65535);o.push(String.fromCharCode(a))}return o.join("")},parse:function(t){for(var n=t.length,r=[],i=0;i>>1]|=e(t.charCodeAt(i)<<16-i%2*16);return o.create(r,2*n)}}}(),t.enc.Utf16})},{"./core":53}],56:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./sha1"),t("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,r=n.Base,o=n.WordArray,i=e.algo,a=i.MD5,s=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=n.hasher.create(),i=o.create(),a=i.words,s=n.keySize,c=n.iterations;a.lengthr&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),a=this._iKey=e.clone(),s=o.words,c=a.words,u=0;u>>2]|=t[r]<<24-r%4*8;o.call(this,n,e)}else o.apply(this,arguments)};i.prototype=r}}(),t.lib.WordArray})},{"./core":53}],61:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(e){function n(t,e,n,r,o,i,a){var s=t+(e&n|~e&r)+o+a;return(s<>>32-i)+e}function r(t,e,n,r,o,i,a){var s=t+(e&r|n&~r)+o+a;return(s<>>32-i)+e}function o(t,e,n,r,o,i,a){var s=t+(e^n^r)+o+a;return(s<>>32-i)+e}function i(t,e,n,r,o,i,a){var s=t+(n^(e|~r))+o+a;return(s<>>32-i)+e}var a=t,s=a.lib,c=s.WordArray,u=s.Hasher,f=a.algo,l=[];!function(){for(var t=0;t<64;t++)l[t]=4294967296*e.abs(e.sin(t+1))|0}();var p=f.MD5=u.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var a=0;a<16;a++){var s=e+a,c=t[s];t[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var u=this._hash.words,f=t[e+0],p=t[e+1],h=t[e+2],d=t[e+3],m=t[e+4],y=t[e+5],g=t[e+6],v=t[e+7],b=t[e+8],_=t[e+9],w=t[e+10],x=t[e+11],k=t[e+12],B=t[e+13],S=t[e+14],C=t[e+15],A=u[0],F=u[1],I=u[2],O=u[3];A=n(A,F,I,O,f,7,l[0]),O=n(O,A,F,I,p,12,l[1]),I=n(I,O,A,F,h,17,l[2]),F=n(F,I,O,A,d,22,l[3]),A=n(A,F,I,O,m,7,l[4]),O=n(O,A,F,I,y,12,l[5]),I=n(I,O,A,F,g,17,l[6]),F=n(F,I,O,A,v,22,l[7]),A=n(A,F,I,O,b,7,l[8]),O=n(O,A,F,I,_,12,l[9]),I=n(I,O,A,F,w,17,l[10]),F=n(F,I,O,A,x,22,l[11]),A=n(A,F,I,O,k,7,l[12]),O=n(O,A,F,I,B,12,l[13]),I=n(I,O,A,F,S,17,l[14]),F=n(F,I,O,A,C,22,l[15]),A=r(A,F,I,O,p,5,l[16]),O=r(O,A,F,I,g,9,l[17]),I=r(I,O,A,F,x,14,l[18]),F=r(F,I,O,A,f,20,l[19]),A=r(A,F,I,O,y,5,l[20]),O=r(O,A,F,I,w,9,l[21]),I=r(I,O,A,F,C,14,l[22]),F=r(F,I,O,A,m,20,l[23]),A=r(A,F,I,O,_,5,l[24]),O=r(O,A,F,I,S,9,l[25]),I=r(I,O,A,F,d,14,l[26]),F=r(F,I,O,A,b,20,l[27]),A=r(A,F,I,O,B,5,l[28]),O=r(O,A,F,I,h,9,l[29]),I=r(I,O,A,F,v,14,l[30]),F=r(F,I,O,A,k,20,l[31]),A=o(A,F,I,O,y,4,l[32]),O=o(O,A,F,I,b,11,l[33]),I=o(I,O,A,F,x,16,l[34]),F=o(F,I,O,A,S,23,l[35]),A=o(A,F,I,O,p,4,l[36]),O=o(O,A,F,I,m,11,l[37]),I=o(I,O,A,F,v,16,l[38]),F=o(F,I,O,A,w,23,l[39]),A=o(A,F,I,O,B,4,l[40]),O=o(O,A,F,I,f,11,l[41]),I=o(I,O,A,F,d,16,l[42]),F=o(F,I,O,A,g,23,l[43]),A=o(A,F,I,O,_,4,l[44]),O=o(O,A,F,I,k,11,l[45]),I=o(I,O,A,F,C,16,l[46]),F=o(F,I,O,A,h,23,l[47]),A=i(A,F,I,O,f,6,l[48]),O=i(O,A,F,I,v,10,l[49]),I=i(I,O,A,F,S,15,l[50]),F=i(F,I,O,A,y,21,l[51]),A=i(A,F,I,O,k,6,l[52]),O=i(O,A,F,I,d,10,l[53]),I=i(I,O,A,F,w,15,l[54]),F=i(F,I,O,A,p,21,l[55]),A=i(A,F,I,O,b,6,l[56]),O=i(O,A,F,I,C,10,l[57]),I=i(I,O,A,F,g,15,l[58]),F=i(F,I,O,A,B,21,l[59]),A=i(A,F,I,O,m,6,l[60]),O=i(O,A,F,I,x,10,l[61]),I=i(I,O,A,F,h,15,l[62]),F=i(F,I,O,A,_,21,l[63]),u[0]=u[0]+A|0,u[1]=u[1]+F|0,u[2]=u[2]+I|0,u[3]=u[3]+O|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;n[o>>>5]|=128<<24-o%32;var i=e.floor(r/4294967296),a=r;n[(o+64>>>9<<4)+15]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[(o+64>>>9<<4)+14]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});a.MD5=u._createHelper(p),a.HmacMD5=u._createHmacHelper(p)}(Math),t.MD5})},{"./core":53}],62:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return t.mode.CFB=function(){function e(t,e,n,r){var o=this._iv;if(o){var i=o.slice(0);this._iv=void 0}else var i=this._prevBlock;r.encryptBlock(i,0);for(var a=0;a>24&255)){var e=t>>16&255,n=t>>8&255,r=255&t;255===e?(e=0,255===n?(n=0,255===r?r=0:++r):++n):++e,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t}function n(t){return 0===(t[0]=e(t[0]))&&(t[1]=e(t[1])),t}var r=t.lib.BlockCipherMode.extend(),o=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,o=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0),n(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c>>2]|=o<<24-i%4*8,t.sigBytes+=o},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923})},{"./cipher-core":52,"./core":53}],68:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return t.pad.Iso10126={pad:function(e,n){var r=4*n,o=r-e.sigBytes%r;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126})},{"./cipher-core":52,"./core":53}],69:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return t.pad.Iso97971={pad:function(e,n){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,n)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})},{"./cipher-core":52,"./core":53}],70:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})},{"./cipher-core":52,"./core":53}],71:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return t.pad.ZeroPadding={pad:function(t,e){var n=4*e;t.clamp(),t.sigBytes+=n-(t.sigBytes%n||n)},unpad:function(t){for(var e=t.words,n=t.sigBytes-1;!(e[n>>>2]>>>24-n%4*8&255);)n--;t.sigBytes=n+1}},t.pad.ZeroPadding})},{"./cipher-core":52,"./core":53}],72:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./sha1"),t("./hmac")):"function"==typeof define&&define.amd?define(["./core","./sha1","./hmac"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,r=n.Base,o=n.WordArray,i=e.algo,a=i.SHA1,s=i.HMAC,c=i.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var n=this.cfg,r=s.create(n.hasher,t),i=o.create(),a=o.create([1]),c=i.words,u=a.words,f=n.keySize,l=n.iterations;c.length>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=t[n]+e[n],o=65535&r,i=r>>>16,a=((o*o>>>17)+o*i>>>15)+i*i,u=((4294901760&r)*r|0)+((65535&r)*r|0);c[n]=a^u}t[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,t[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,t[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,t[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,t[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,t[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,t[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,t[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var n=t,r=n.lib,o=r.StreamCipher,i=n.algo,a=[],s=[],c=[],u=i.RabbitLegacy=o.extend({_doReset:function(){var t=this._key.words,n=this.cfg.iv,r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],o=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var i=0;i<4;i++)e.call(this);for(var i=0;i<8;i++)o[i]^=r[i+4&7];if(n){var a=n.words,s=a[0],c=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=u>>>16|4294901760&f,p=f<<16|65535&u;o[0]^=u,o[1]^=l,o[2]^=f,o[3]^=p,o[4]^=u,o[5]^=l,o[6]^=f,o[7]^=p;for(var i=0;i<4;i++)e.call(this)}},_doProcessBlock:function(t,n){var r=this._X;e.call(this),a[0]=r[0]^r[5]>>>16^r[3]<<16,a[1]=r[2]^r[7]>>>16^r[5]<<16,a[2]=r[4]^r[1]>>>16^r[7]<<16,a[3]=r[6]^r[3]>>>16^r[1]<<16;for(var o=0;o<4;o++)a[o]=16711935&(a[o]<<8|a[o]>>>24)|4278255360&(a[o]<<24|a[o]>>>8),t[n+o]^=a[o]},blockSize:4,ivSize:2});n.RabbitLegacy=o._createHelper(u)}(),t.RabbitLegacy})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],74:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./enc-base64"),t("./md5"),t("./evpkdf"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return function(){function e(){for(var t=this._X,e=this._C,n=0;n<8;n++)s[n]=e[n];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(var n=0;n<8;n++){var r=t[n]+e[n],o=65535&r,i=r>>>16,a=((o*o>>>17)+o*i>>>15)+i*i,u=((4294901760&r)*r|0)+((65535&r)*r|0);c[n]=a^u}t[0]=c[0]+(c[7]<<16|c[7]>>>16)+(c[6]<<16|c[6]>>>16)|0,t[1]=c[1]+(c[0]<<8|c[0]>>>24)+c[7]|0,t[2]=c[2]+(c[1]<<16|c[1]>>>16)+(c[0]<<16|c[0]>>>16)|0,t[3]=c[3]+(c[2]<<8|c[2]>>>24)+c[1]|0,t[4]=c[4]+(c[3]<<16|c[3]>>>16)+(c[2]<<16|c[2]>>>16)|0,t[5]=c[5]+(c[4]<<8|c[4]>>>24)+c[3]|0,t[6]=c[6]+(c[5]<<16|c[5]>>>16)+(c[4]<<16|c[4]>>>16)|0,t[7]=c[7]+(c[6]<<8|c[6]>>>24)+c[5]|0}var n=t,r=n.lib,o=r.StreamCipher,i=n.algo,a=[],s=[],c=[],u=i.Rabbit=o.extend({_doReset:function(){for(var t=this._key.words,n=this.cfg.iv,r=0;r<4;r++)t[r]=16711935&(t[r]<<8|t[r]>>>24)|4278255360&(t[r]<<24|t[r]>>>8);var o=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var r=0;r<4;r++)e.call(this);for(var r=0;r<8;r++)i[r]^=o[r+4&7];if(n){var a=n.words,s=a[0],c=a[1],u=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=u>>>16|4294901760&f,p=f<<16|65535&u;i[0]^=u,i[1]^=l,i[2]^=f,i[3]^=p,i[4]^=u,i[5]^=l,i[6]^=f,i[7]^=p;for(var r=0;r<4;r++)e.call(this)}},_doProcessBlock:function(t,n){var r=this._X;e.call(this),a[0]=r[0]^r[5]>>>16^r[3]<<16,a[1]=r[2]^r[7]>>>16^r[5]<<16,a[2]=r[4]^r[1]>>>16^r[7]<<16,a[3]=r[6]^r[3]>>>16^r[1]<<16;for(var o=0;o<4;o++)a[o]=16711935&(a[o]<<8|a[o]>>>24)|4278255360&(a[o]<<24|a[o]>>>8),t[n+o]^=a[o]},blockSize:4,ivSize:2});n.Rabbit=o._createHelper(u)}(),t.Rabbit})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],75:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./enc-base64"),t("./md5"),t("./evpkdf"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return function(){function e(){for(var t=this._S,e=this._i,n=this._j,r=0,o=0;o<4;o++){e=(e+1)%256,n=(n+t[e])%256;var i=t[e];t[e]=t[n],t[n]=i,r|=t[(t[e]+t[n])%256]<<24-8*o}return this._i=e,this._j=n,r}var n=t,r=n.lib,o=r.StreamCipher,i=n.algo,a=i.RC4=o.extend({_doReset:function(){for(var t=this._key,e=t.words,n=t.sigBytes,r=this._S=[],o=0;o<256;o++)r[o]=o;for(var o=0,i=0;o<256;o++){var a=o%n,s=e[a>>>2]>>>24-a%4*8&255;i=(i+r[o]+s)%256;var c=r[o];r[o]=r[i],r[i]=c}this._i=this._j=0},_doProcessBlock:function(t,n){t[n]^=e.call(this)},keySize:8,ivSize:0});n.RC4=o._createHelper(a);var s=i.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)e.call(this)}});n.RC4Drop=o._createHelper(s)}(),t.RC4})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],76:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(e){function n(t,e,n){return t^e^n}function r(t,e,n){return t&e|~t&n}function o(t,e,n){return(t|~e)^n}function i(t,e,n){return t&n|e&~n}function a(t,e,n){return t^(e|~n)}function s(t,e){return t<>>32-e}var c=t,u=c.lib,f=u.WordArray,l=u.Hasher,p=c.algo,h=f.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),d=f.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),m=f.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),y=f.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),g=f.create([0,1518500249,1859775393,2400959708,2840853838]),v=f.create([1352829926,1548603684,1836072691,2053994217,0]),b=p.RIPEMD160=l.extend({ 4 | _doReset:function(){this._hash=f.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var u=e+c,f=t[u];t[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}var l,p,b,_,w,x,k,B,S,C,A=this._hash.words,F=g.words,I=v.words,O=h.words,N=d.words,T=m.words,D=y.words;x=l=A[0],k=p=A[1],B=b=A[2],S=_=A[3],C=w=A[4];for(var E,c=0;c<80;c+=1)E=l+t[e+O[c]]|0,E+=c<16?n(p,b,_)+F[0]:c<32?r(p,b,_)+F[1]:c<48?o(p,b,_)+F[2]:c<64?i(p,b,_)+F[3]:a(p,b,_)+F[4],E=0|E,E=s(E,T[c]),E=E+w|0,l=w,w=_,_=s(b,10),b=p,p=E,E=x+t[e+N[c]]|0,E+=c<16?a(k,B,S)+I[0]:c<32?i(k,B,S)+I[1]:c<48?o(k,B,S)+I[2]:c<64?r(k,B,S)+I[3]:n(k,B,S)+I[4],E=0|E,E=s(E,D[c]),E=E+C|0,x=C,C=S,S=s(B,10),B=k,k=E;E=A[1]+b+S|0,A[1]=A[2]+_+C|0,A[2]=A[3]+w+x|0,A[3]=A[4]+l+k|0,A[4]=A[0]+p+B|0,A[0]=E},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[(r+64>>>9<<4)+14]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();for(var o=this._hash,i=o.words,a=0;a<5;a++){var s=i[a];i[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return o},clone:function(){var t=l.clone.call(this);return t._hash=this._hash.clone(),t}});c.RIPEMD160=l._createHelper(b),c.HmacRIPEMD160=l._createHmacHelper(b)}(Math),t.RIPEMD160})},{"./core":53}],77:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,r=n.WordArray,o=n.Hasher,i=e.algo,a=[],s=i.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],s=n[3],c=n[4],u=0;u<80;u++){if(u<16)a[u]=0|t[e+u];else{var f=a[u-3]^a[u-8]^a[u-14]^a[u-16];a[u]=f<<1|f>>>31}var l=(r<<5|r>>>27)+c+a[u];l+=u<20?(o&i|~o&s)+1518500249:u<40?(o^i^s)+1859775393:u<60?(o&i|o&s|i&s)-1894007588:(o^i^s)-899497514,c=s,s=i,i=o<<30|o>>>2,o=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),e[(r+64>>>9<<4)+15]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=o._createHelper(s),e.HmacSHA1=o._createHmacHelper(s)}(),t.SHA1})},{"./core":53}],78:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./sha256")):"function"==typeof define&&define.amd?define(["./core","./sha256"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.lib,r=n.WordArray,o=e.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=i._doFinalize.call(this);return t.sigBytes-=4,t}});e.SHA224=i._createHelper(a),e.HmacSHA224=i._createHmacHelper(a)}(),t.SHA224})},{"./core":53,"./sha256":79}],79:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(e){var n=t,r=n.lib,o=r.WordArray,i=r.Hasher,a=n.algo,s=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(t){return 4294967296*(t-(0|t))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),c[o]=n(e.pow(r,1/3)),o++),r++}();var u=[],f=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],f=n[5],l=n[6],p=n[7],h=0;h<64;h++){if(h<16)u[h]=0|t[e+h];else{var d=u[h-15],m=(d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3,y=u[h-2],g=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;u[h]=m+u[h-7]+g+u[h-16]}var v=s&f^~s&l,b=r&o^r&i^o&i,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),x=p+w+v+c[h]+u[h],k=_+b;p=l,l=f,f=s,s=a+x|0,a=i,i=o,o=r,r=x+k|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[(o+64>>>9<<4)+14]=e.floor(r/4294967296),n[(o+64>>>9<<4)+15]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});n.SHA256=i._createHelper(f),n.HmacSHA256=i._createHmacHelper(f)}(Math),t.SHA256})},{"./core":53}],80:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],o):o(r.CryptoJS)}(this,function(t){return function(e){var n=t,r=n.lib,o=r.WordArray,i=r.Hasher,a=n.x64,s=a.Word,c=n.algo,u=[],f=[],l=[];!function(){for(var t=1,e=0,n=0;n<24;n++){u[t+5*e]=(n+1)*(n+2)/2%64;var r=e%5,o=(2*t+3*e)%5;t=r,e=o}for(var t=0;t<5;t++)for(var e=0;e<5;e++)f[t+5*e]=e+(2*t+3*e)%5*5;for(var i=1,a=0;a<24;a++){for(var c=0,p=0,h=0;h<7;h++){if(1&i){var d=(1<>>24)|4278255360&(i<<24|i>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);var s=n[o];s.high^=a,s.low^=i}for(var c=0;c<24;c++){for(var h=0;h<5;h++){for(var d=0,m=0,y=0;y<5;y++){var s=n[h+5*y];d^=s.high,m^=s.low}var g=p[h];g.high=d,g.low=m}for(var h=0;h<5;h++)for(var v=p[(h+4)%5],b=p[(h+1)%5],_=b.high,w=b.low,d=v.high^(_<<1|w>>>31),m=v.low^(w<<1|_>>>31),y=0;y<5;y++){var s=n[h+5*y];s.high^=d,s.low^=m}for(var x=1;x<25;x++){var s=n[x],k=s.high,B=s.low,S=u[x];if(S<32)var d=k<>>32-S,m=B<>>32-S;else var d=B<>>64-S,m=k<>>64-S;var C=p[f[x]];C.high=d,C.low=m}var A=p[0],F=n[0];A.high=F.high,A.low=F.low;for(var h=0;h<5;h++)for(var y=0;y<5;y++){var x=h+5*y,s=n[x],I=p[x],O=p[(h+1)%5+5*y],N=p[(h+2)%5+5*y];s.high=I.high^~O.high&N.high,s.low=I.low^~O.low&N.low}var s=n[0],T=l[c];s.high^=T.high,s.low^=T.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(8*this._nDataBytes,8*t.sigBytes),i=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/i)*i>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f>>24)|4278255360&(p<<24|p>>>8),h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),u.push(h),u.push(p)}return new o.init(u,s)},clone:function(){for(var t=i.clone.call(this),e=t._state=this._state.slice(0),n=0;n<25;n++)e[n]=e[n].clone();return t}});n.SHA3=i._createHelper(h),n.HmacSHA3=i._createHmacHelper(h)}(Math),t.SHA3})},{"./core":53,"./x64-core":84}],81:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./x64-core"),t("./sha512")):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],o):o(r.CryptoJS)}(this,function(t){return function(){var e=t,n=e.x64,r=n.Word,o=n.WordArray,i=e.algo,a=i.SHA512,s=i.SHA384=a.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=16,t}});e.SHA384=a._createHelper(s),e.HmacSHA384=a._createHmacHelper(s)}(),t.SHA384})},{"./core":53,"./sha512":82,"./x64-core":84}],82:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./x64-core")):"function"==typeof define&&define.amd?define(["./core","./x64-core"],o):o(r.CryptoJS)}(this,function(t){return function(){function e(){return a.create.apply(a,arguments)}var n=t,r=n.lib,o=r.Hasher,i=n.x64,a=i.Word,s=i.WordArray,c=n.algo,u=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],f=[];!function(){for(var t=0;t<80;t++)f[t]=e()}();var l=c.SHA512=o.extend({_doReset:function(){this._hash=new s.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],c=n[5],l=n[6],p=n[7],h=r.high,d=r.low,m=o.high,y=o.low,g=i.high,v=i.low,b=a.high,_=a.low,w=s.high,x=s.low,k=c.high,B=c.low,S=l.high,C=l.low,A=p.high,F=p.low,I=h,O=d,N=m,T=y,D=g,E=v,P=b,R=_,M=w,H=x,j=k,q=B,z=S,L=C,U=A,W=F,J=0;J<80;J++){var G=f[J];if(J<16)var X=G.high=0|t[e+2*J],$=G.low=0|t[e+2*J+1];else{var V=f[J-15],K=V.high,Z=V.low,Y=(K>>>1|Z<<31)^(K>>>8|Z<<24)^K>>>7,Q=(Z>>>1|K<<31)^(Z>>>8|K<<24)^(Z>>>7|K<<25),tt=f[J-2],et=tt.high,nt=tt.low,rt=(et>>>19|nt<<13)^(et<<3|nt>>>29)^et>>>6,ot=(nt>>>19|et<<13)^(nt<<3|et>>>29)^(nt>>>6|et<<26),it=f[J-7],at=it.high,st=it.low,ct=f[J-16],ut=ct.high,ft=ct.low,$=Q+st,X=Y+at+($>>>0>>0?1:0),$=$+ot,X=X+rt+($>>>0>>0?1:0),$=$+ft,X=X+ut+($>>>0>>0?1:0);G.high=X,G.low=$}var lt=M&j^~M&z,pt=H&q^~H&L,ht=I&N^I&D^N&D,dt=O&T^O&E^T&E,mt=(I>>>28|O<<4)^(I<<30|O>>>2)^(I<<25|O>>>7),yt=(O>>>28|I<<4)^(O<<30|I>>>2)^(O<<25|I>>>7),gt=(M>>>14|H<<18)^(M>>>18|H<<14)^(M<<23|H>>>9),vt=(H>>>14|M<<18)^(H>>>18|M<<14)^(H<<23|M>>>9),bt=u[J],_t=bt.high,wt=bt.low,xt=W+vt,kt=U+gt+(xt>>>0>>0?1:0),xt=xt+pt,kt=kt+lt+(xt>>>0>>0?1:0),xt=xt+wt,kt=kt+_t+(xt>>>0>>0?1:0),xt=xt+$,kt=kt+X+(xt>>>0<$>>>0?1:0),Bt=yt+dt,St=mt+ht+(Bt>>>0>>0?1:0);U=z,W=L,z=j,L=q,j=M,q=H,H=R+xt|0,M=P+kt+(H>>>0>>0?1:0)|0,P=D,R=E,D=N,E=T,N=I,T=O,O=xt+Bt|0,I=kt+St+(O>>>0>>0?1:0)|0}d=r.low=d+O,r.high=h+I+(d>>>0>>0?1:0),y=o.low=y+T,o.high=m+N+(y>>>0>>0?1:0),v=i.low=v+E,i.high=g+D+(v>>>0>>0?1:0),_=a.low=_+R,a.high=b+P+(_>>>0>>0?1:0),x=s.low=x+H,s.high=w+M+(x>>>0>>0?1:0),B=c.low=B+q,c.high=k+j+(B>>>0>>0?1:0),C=l.low=C+L,l.high=S+z+(C>>>0>>0?1:0),F=p.low=F+W,p.high=A+U+(F>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[(r+128>>>10<<5)+30]=Math.floor(n/4294967296),e[(r+128>>>10<<5)+31]=n,t.sigBytes=4*e.length,this._process();var o=this._hash.toX32();return o},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});n.SHA512=o._createHelper(l),n.HmacSHA512=o._createHmacHelper(l)}(),t.SHA512})},{"./core":53,"./x64-core":84}],83:[function(t,e,n){!function(r,o,i){"object"==typeof n?e.exports=n=o(t("./core"),t("./enc-base64"),t("./md5"),t("./evpkdf"),t("./cipher-core")):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],o):o(r.CryptoJS)}(this,function(t){return function(){function e(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<>>5]>>>31-o%32&1}for(var i=this._subKeys=[],a=0;a<16;a++){for(var s=i[a]=[],l=f[a],r=0;r<24;r++)s[r/6|0]|=n[(u[r]-1+l)%28]<<31-r%6,s[4+(r/6|0)]|=n[28+(u[r+24]-1+l)%28]<<31-r%6;s[0]=s[0]<<1|s[0]>>>31;for(var r=1;r<7;r++)s[r]=s[r]>>>4*(r-1)+3;s[7]=s[7]<<5|s[7]>>>27}for(var p=this._invSubKeys=[],r=0;r<16;r++)p[r]=i[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,r,o){this._lBlock=t[r],this._rBlock=t[r+1],e.call(this,4,252645135),e.call(this,16,65535),n.call(this,2,858993459),n.call(this,8,16711935),e.call(this,1,1431655765);for(var i=0;i<16;i++){for(var a=o[i],s=this._lBlock,c=this._rBlock,u=0,f=0;f<8;f++)u|=l[f][((c^a[f])&p[f])>>>0];this._lBlock=c,this._rBlock=s^u}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,e.call(this,1,1431655765),n.call(this,8,16711935),n.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),t[r]=this._lBlock,t[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});r.DES=a._createHelper(h);var d=s.TripleDES=a.extend({_doReset:function(){var t=this._key,e=t.words;this._des1=h.createEncryptor(i.create(e.slice(0,2))),this._des2=h.createEncryptor(i.create(e.slice(2,4))),this._des3=h.createEncryptor(i.create(e.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});r.TripleDES=a._createHelper(d)}(),t.TripleDES})},{"./cipher-core":52,"./core":53,"./enc-base64":54,"./evpkdf":56,"./md5":61}],84:[function(t,e,n){!function(r,o){"object"==typeof n?e.exports=n=o(t("./core")):"function"==typeof define&&define.amd?define(["./core"],o):o(r.CryptoJS)}(this,function(t){return function(e){var n=t,r=n.lib,o=r.Base,i=r.WordArray,a=n.x64={};a.Word=o.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=o.extend({init:function(t,n){t=this.words=t||[],n!=e?this.sigBytes=n:this.sigBytes=8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r=55296&&e<=56319&&o65535&&(e-=65536,o+=v(e>>>10&1023|55296),e=56320|1023&e),o+=v(e);return o}function i(t){if(t>=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function a(t,e){return v(t>>e&63|128)}function s(t){if(0==(4294967168&t))return v(t);var e="";return 0==(4294965248&t)?e=v(t>>6&31|192):0==(4294901760&t)?(i(t),e=v(t>>12&15|224),e+=a(t,6)):0==(4292870144&t)&&(e=v(t>>18&7|240),e+=a(t,12),e+=a(t,6)),e+=v(63&t|128)}function c(t){for(var e,n=r(t),o=n.length,i=-1,a="";++i=y)throw Error("Invalid byte index");var t=255&m[g];if(g++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,e,n,r,o;if(g>y)throw Error("Invalid byte index");if(g==y)return!1;if(t=255&m[g],g++,0==(128&t))return t;if(192==(224&t)){if(e=u(),o=(31&t)<<6|e,o>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&t)){if(e=u(),n=u(),o=(15&t)<<12|e<<6|n,o>=2048)return i(o),o;throw Error("Invalid continuation byte")}if(240==(248&t)&&(e=u(),n=u(),r=u(),o=(7&t)<<18|e<<12|n<<6|r,o>=65536&&o<=1114111))return o;throw Error("Invalid UTF-8 detected")}function l(t){m=r(t),y=m.length,g=0;for(var e,n=[];(e=f())!==!1;)n.push(e);return o(n)}var p="object"==typeof n&&n,h="object"==typeof e&&e&&e.exports==p&&e,d="object"==typeof global&&global;d.global!==d&&d.window!==d||(t=d);var m,y,g,v=String.fromCharCode,b={version:"2.1.2",encode:c,decode:l};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)define(function(){return b});else if(p&&!p.nodeType)if(h)h.exports=b;else{var _={},w=_.hasOwnProperty;for(var x in b)w.call(b,x)&&(p[x]=b[x])}else t.utf8=b}(this)},{}],86:[function(t,e,n){e.exports=XMLHttpRequest},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var o,i,a,s,c,u,f=this;if(!(f instanceof e))return W&&T(26,"constructor call without new",t),new e(t,r);if(null!=r&&J(r,2,64,P,"base")){if(r=0|r,u=t+"",10==r)return f=new e(t instanceof e?t:u),D(f,H+f.e+1,j);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(o="["+x.slice(0,r)+"]+")+"(?:\\."+o+")?$",r<37?"i":"").test(u))return m(f,u,s,r);s?(f.s=1/t<0?(u=u.slice(1),-1):1,W&&u.replace(/^0\.0*|\./,"").length>15&&T(P,w,t),s=!1):f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1,u=n(u,10,r,f.s)}else{if(t instanceof e)return f.s=t.s,f.e=t.e,f.c=(t=t.c)?t.slice():t,void(P=0);if((s="number"==typeof t)&&0*t==0){if(f.s=1/t<0?(t=-t,-1):1,t===~~t){for(i=0,a=t;a>=10;a/=10,i++);return f.e=i,f.c=[t],void(P=0)}u=t+""}else{if(!y.test(u=t+""))return m(f,u,s);f.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1}}for((i=u.indexOf("."))>-1&&(u=u.replace(".","")),(a=u.search(/e/i))>0?(i<0&&(i=a),i+=+u.slice(a+1),u=u.substring(0,a)):i<0&&(i=u.length),a=0;48===u.charCodeAt(a);a++);for(c=u.length;48===u.charCodeAt(--c););if(u=u.slice(a,c+1))if(c=u.length,s&&W&&c>15&&T(P,w,f.s*t),i=i-a-1,i>U)f.c=f.e=null;else if(i=0&&(c=$,$=0,t=t.replace(".",""),d=new e(r),p=d.pow(t.length-m),$=c,d.c=u(l(i(p.c),p.e),10,n),d.e=d.c.length),h=u(t,r,n),s=c=h.length;0==h[--c];h.pop());if(!h[0])return"0";if(m<0?--s:(p.c=h,p.e=s,p.s=o,p=E(p,d,y,g,n),h=p.c,f=p.r,s=p.e),a=s+y+1,m=h[a],c=n/2,f=f||a<0||null!=h[a+1],f=g<4?(null!=m||f)&&(0==g||g==(p.s<0?3:2)):m>c||m==c&&(4==g||f||6==g&&1&h[a-1]||g==(p.s<0?8:7)),a<1||!h[0])t=f?l("1",-y):"0";else{if(h.length=a,f)for(--n;++h[--a]>n;)h[a]=0,a||(++s,h.unshift(1));for(c=h.length;!h[--c];);for(m=0,t="";m<=c;t+=x.charAt(h[m++]));t=l(t,s)}return t}function h(t,n,r,o){var a,s,c,u,p;if(r=null!=r&&J(r,0,8,o,_)?0|r:j,!t.c)return t.toString();if(a=t.c[0],c=t.e,null==n)p=i(t.c),p=19==o||24==o&&c<=q?f(p,c):l(p,c);else if(t=D(new e(t),n,r),s=t.e,p=i(t.c),u=p.length,19==o||24==o&&(n<=s||s<=q)){for(;uu){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-u,n>0)for(s+1==u&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function I(t,n){var r,o,i=0;for(c(t[0])&&(t=t[0]),r=new e(t[0]);++in||t!=p(t))&&T(r,(o||"decimal places")+(tn?" out of range":" not an integer"),t),!0}function N(t,e,n){for(var r=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,r++);return(n=r+n*B-1)>U?t.c=t.e=null:n=10;s/=10,o++);if(i=e-o,i<0)i+=B,a=e,c=l[u=0],f=c/p[o-a-1]%10|0;else if(u=g((i+1)/B),u>=l.length){if(!r)break t;for(;l.length<=u;l.push(0));c=f=0,o=1,i%=B,a=i-B+1}else{for(c=s=l[u],o=1;s>=10;s/=10,o++);i%=B,a=i-B+o,f=a<0?0:c/p[o-a-1]%10|0}if(r=r||e<0||null!=l[u+1]||(a<0?c:c%p[o-a-1]),r=n<4?(f||r)&&(0==n||n==(t.s<0?3:2)):f>5||5==f&&(4==n||r||6==n&&(i>0?a>0?c/p[o-a]:0:l[u-1])%10&1||n==(t.s<0?8:7)),e<1||!l[0])return l.length=0,r?(e-=t.e+1,l[0]=p[e%B],t.e=-e||0):l[0]=t.e=0,t;if(0==i?(l.length=u,s=1,u--):(l.length=u+1,s=p[B-i],l[u]=a>0?v(c/p[o-a]%p[a])*s:0),r)for(;;){if(0==u){for(i=1,a=l[0];a>=10;a/=10,i++);for(a=l[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(t.e++,l[0]==k&&(l[0]=1));break}if(l[u]+=s,l[u]!=k)break;l[u--]=0,s=1}for(i=l.length;0===l[--i];l.pop());}t.e>U?t.c=t.e=null:t.en)return null!=(t=o[n++])};return a(e="DECIMAL_PLACES")&&J(t,0,F,2,e)&&(H=0|t),r[e]=H,a(e="ROUNDING_MODE")&&J(t,0,8,2,e)&&(j=0|t),r[e]=j,a(e="EXPONENTIAL_AT")&&(c(t)?J(t[0],-F,0,2,e)&&J(t[1],0,F,2,e)&&(q=0|t[0],z=0|t[1]):J(t,-F,F,2,e)&&(q=-(z=0|(t<0?-t:t)))),r[e]=[q,z],a(e="RANGE")&&(c(t)?J(t[0],-F,-1,2,e)&&J(t[1],1,F,2,e)&&(L=0|t[0],U=0|t[1]):J(t,-F,F,2,e)&&(0|t?L=-(U=0|(t<0?-t:t)):W&&T(2,e+" cannot be zero",t))),r[e]=[L,U],a(e="ERRORS")&&(t===!!t||1===t||0===t?(P=0,J=(W=!!t)?O:s):W&&T(2,e+b,t)),r[e]=W,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(G=!(!t||!d||"object"!=typeof d),t&&!G&&W&&T(2,"crypto unavailable",d)):W&&T(2,e+b,t)),r[e]=G,a(e="MODULO_MODE")&&J(t,0,9,2,e)&&(X=0|t),r[e]=X,a(e="POW_PRECISION")&&J(t,0,F,2,e)&&($=0|t),r[e]=$,a(e="FORMAT")&&("object"==typeof t?V=t:W&&T(2,e+" not an object",t)),r[e]=V,r},e.max=function(){return I(arguments,R.lt)},e.min=function(){return I(arguments,R.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,o,i,a,s,c=0,u=[],f=new e(M);if(t=null!=t&&J(t,0,F,14)?0|t:H,a=g(t/B),G)if(d&&d.getRandomValues){for(r=d.getRandomValues(new Uint32Array(a*=2));c>>11),s>=9e15?(o=d.getRandomValues(new Uint32Array(2)),r[c]=o[0], 5 | r[c+1]=o[1]):(u.push(s%1e14),c+=2);c=a/2}else if(d&&d.randomBytes){for(r=d.randomBytes(a*=7);c=9e15?d.randomBytes(7).copy(r,c):(u.push(s%1e14),c+=7);c=a/7}else W&&T(14,"crypto unavailable",d);if(!c)for(;c=10;s/=10,c++);cr?1:-1;else for(o=i=0;oe[o]?1:-1;break}return i}function r(t,e,n,r){for(var o=0;n--;)t[n]-=o,o=t[n]1;t.shift());}return function(i,a,s,c,u){var f,l,p,h,d,m,y,g,b,_,w,x,S,C,A,F,I,O=i.s==a.s?1:-1,N=i.c,T=a.c;if(!(N&&N[0]&&T&&T[0]))return new e(i.s&&a.s&&(N?!T||N[0]!=T[0]:T)?N&&0==N[0]||!T?0*O:O/0:NaN);for(g=new e(O),b=g.c=[],l=i.e-a.e,O=s+l+1,u||(u=k,l=o(i.e/B)-o(a.e/B),O=O/B|0),p=0;T[p]==(N[p]||0);p++);if(T[p]>(N[p]||0)&&l--,O<0)b.push(1),h=!0;else{for(C=N.length,F=T.length,p=0,O+=2,d=v(u/(T[0]+1)),d>1&&(T=t(T,d,u),N=t(N,d,u),F=T.length,C=N.length),S=F,_=N.slice(0,F),w=_.length;w=u/2&&A++;do{if(d=0,f=n(T,_,F,w),f<0){if(x=_[0],F!=w&&(x=x*u+(_[1]||0)),d=v(x/A),d>1)for(d>=u&&(d=u-1),m=t(T,d,u),y=m.length,w=_.length;1==n(m,_,y,w);)d--,r(m,F=10;O/=10,p++);D(g,s+(g.e=p+l*B-1)+1,c,h)}else g.e=l,g.r=+h;return g}}(),m=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,i=/^\s*\+|^\s+|\s+$/g;return function(a,s,c,u){var f,l=c?s:s.replace(i,"");if(o.test(l))a.s=isNaN(l)?null:l<0?-1:1;else{if(!c&&(l=l.replace(t,function(t,e,n){return f="x"==(n=n.toLowerCase())?16:"b"==n?2:8,u&&u!=f?t:e}),u&&(f=u,l=l.replace(n,"$1").replace(r,"0.$1")),s!=l))return new e(l,f);W&&T(P,"not a"+(u?" base "+u:"")+" number",s),a.s=null}a.c=a.e=null,P=0}}(),R.absoluteValue=R.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},R.ceil=function(){return D(new e(this),this.e+1,2)},R.comparedTo=R.cmp=function(t,n){return P=1,a(this,new e(t,n))},R.decimalPlaces=R.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/B))*B,e=n[e])for(;e%10==0;e/=10,t--);return t<0&&(t=0),t},R.dividedBy=R.div=function(t,n){return P=3,E(this,new e(t,n),H,j)},R.dividedToIntegerBy=R.divToInt=function(t,n){return P=4,E(this,new e(t,n),0,1)},R.equals=R.eq=function(t,n){return P=5,0===a(this,new e(t,n))},R.floor=function(){return D(new e(this),this.e+1,3)},R.greaterThan=R.gt=function(t,n){return P=6,a(this,new e(t,n))>0},R.greaterThanOrEqualTo=R.gte=function(t,n){return P=7,1===(n=a(this,new e(t,n)))||0===n},R.isFinite=function(){return!!this.c},R.isInteger=R.isInt=function(){return!!this.c&&o(this.e/B)>this.c.length-2},R.isNaN=function(){return!this.s},R.isNegative=R.isNeg=function(){return this.s<0},R.isZero=function(){return!!this.c&&0==this.c[0]},R.lessThan=R.lt=function(t,n){return P=8,a(this,new e(t,n))<0},R.lessThanOrEqualTo=R.lte=function(t,n){return P=9,(n=a(this,new e(t,n)))===-1||0===n},R.minus=R.sub=function(t,n){var r,i,a,s,c=this,u=c.s;if(P=10,t=new e(t,n),n=t.s,!u||!n)return new e(NaN);if(u!=n)return t.s=-n,c.plus(t);var f=c.e/B,l=t.e/B,p=c.c,h=t.c;if(!f||!l){if(!p||!h)return p?(t.s=-n,t):new e(h?c:NaN);if(!p[0]||!h[0])return h[0]?(t.s=-n,t):new e(p[0]?c:3==j?-0:0)}if(f=o(f),l=o(l),p=p.slice(),u=f-l){for((s=u<0)?(u=-u,a=p):(l=f,a=h),a.reverse(),n=u;n--;a.push(0));a.reverse()}else for(i=(s=(u=p.length)<(n=h.length))?u:n,u=n=0;n0)for(;n--;p[r++]=0);for(n=k-1;i>u;){if(p[--i]0?(c=s,r=f):(a=-a,r=u),r.reverse();a--;r.push(0));r.reverse()}for(a=u.length,n=f.length,a-n<0&&(r=f,f=u,u=r,n=a),a=0;n;)a=(u[--n]=u[n]+f[n]+a)/k|0,u[n]%=k;return a&&(u.unshift(a),++c),N(t,u,c)},R.precision=R.sd=function(t){var e,n,r=this,o=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(W&&T(13,"argument"+b,t),t!=!!t&&(t=null)),!o)return null;if(n=o.length-1,e=n*B+1,n=o[n]){for(;n%10==0;n/=10,e--);for(n=o[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},R.round=function(t,n){var r=new e(this);return(null==t||J(t,0,F,15))&&D(r,~~t+this.e+1,null!=n&&J(n,0,8,15,_)?0|n:j),r},R.shift=function(t){var n=this;return J(t,-S,S,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(t<-S||t>S)?n.s*(t<0?0:1/0):n)},R.squareRoot=R.sqrt=function(){var t,n,r,a,s,c=this,u=c.c,f=c.s,l=c.e,p=H+4,h=new e("0.5");if(1!==f||!u||!u[0])return new e(!f||f<0&&(!u||u[0])?NaN:u?c:1/0);if(f=Math.sqrt(+c),0==f||f==1/0?(n=i(u),(n.length+l)%2==0&&(n+="0"),f=Math.sqrt(n),l=o((l+1)/2)-(l<0||l%2),f==1/0?n="1e"+l:(n=f.toExponential(),n=n.slice(0,n.indexOf("e")+1)+l),r=new e(n)):r=new e(f+""),r.c[0])for(l=r.e,f=l+p,f<3&&(f=0);;)if(s=r,r=h.times(s.plus(E(c,s,p,1))),i(s.c).slice(0,f)===(n=i(r.c)).slice(0,f)){if(r.e=0;){for(r=0,d=w[a]%v,m=w[a]/v|0,c=f,s=a+c;s>a;)l=_[--c]%v,p=_[c]/v|0,u=m*l+p*d,l=d*l+u%v*v+y[s]+r,r=(l/g|0)+(u/v|0)+m*p,y[s--]=l%g;y[s]=r}return r?++i:y.shift(),N(t,y,i)},R.toDigits=function(t,n){var r=new e(this);return t=null!=t&&J(t,1,F,18,"precision")?0|t:null,n=null!=n&&J(n,0,8,18,_)?0|n:j,t?D(r,t,n):r},R.toExponential=function(t,e){return h(this,null!=t&&J(t,0,F,19)?~~t+1:null,e,19)},R.toFixed=function(t,e){return h(this,null!=t&&J(t,0,F,20)?~~t+this.e+1:null,e,20)},R.toFormat=function(t,e){var n=h(this,null!=t&&J(t,0,F,21)?~~t+this.e+1:null,e,21);if(this.c){var r,o=n.split("."),i=+V.groupSize,a=+V.secondaryGroupSize,s=V.groupSeparator,c=o[0],u=o[1],f=this.s<0,l=f?c.slice(1):c,p=l.length;if(a&&(r=i,i=a,a=r,p-=r),i>0&&p>0){for(r=p%i||i,c=l.substr(0,r);r0&&(c+=s+l.slice(r)),f&&(c="-"+c)}n=u?c+V.decimalSeparator+((a=+V.fractionGroupSize)?u.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+V.fractionGroupSeparator):u):c}return n},R.toFraction=function(t){var n,r,o,a,s,c,u,f,l,p=W,h=this,d=h.c,m=new e(M),y=r=new e(M),g=u=new e(M);if(null!=t&&(W=!1,c=new e(t),W=p,(p=c.isInt())&&!c.lt(M)||(W&&T(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&c.c&&D(c,c.e+1,1).gte(M)?c:null)),!d)return h.toString();for(l=i(d),a=m.e=l.length-h.e-1,m.c[0]=C[(s=a%B)<0?B+s:s],t=!t||c.cmp(m)>0?a>0?m:y:c,s=U,U=1/0,c=new e(l),u.c[0]=0;f=E(c,m,0,1),o=r.plus(f.times(g)),1!=o.cmp(t);)r=g,g=o,y=u.plus(f.times(o=y)),u=o,m=c.minus(f.times(o=m)),c=o;return o=E(t.minus(r),g,0,1),u=u.plus(o.times(y)),r=r.plus(o.times(g)),u.s=y.s=h.s,a*=2,n=E(y,g,a,j).minus(h).abs().cmp(E(u,r,a,j).minus(h).abs())<1?[y.toString(),g.toString()]:[u.toString(),r.toString()],U=s,n},R.toNumber=function(){var t=this;return+t||(t.s?0*t.s:NaN)},R.toPower=R.pow=function(t){var n,r,o=v(t<0?-t:+t),i=this;if(!J(t,-S,S,23,"exponent")&&(!isFinite(t)||o>S&&(t/=0)||parseFloat(t)!=t&&!(t=NaN)))return new e(Math.pow(+i,t));for(n=$?g($/B+2):0,r=new e(M);;){if(o%2){if(r=r.times(i),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(o=v(o/2),!o)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return t<0&&(r=M.div(r)),n?D(r,$,j):r},R.toPrecision=function(t,e){return h(this,null!=t&&J(t,1,F,24,"precision")?0|t:null,e,24)},R.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(e=i(r.c),e=null!=t&&J(t,2,64,25,"base")?n(l(e,a),0|t,10,o):a<=q||a>=z?f(e,a):l(e,a),o<0&&r.c[0]&&(e="-"+e)),e},R.truncated=R.trunc=function(){return D(new e(this),this.e+1,1)},R.valueOf=R.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function i(t){for(var e,n,r=1,o=t.length,i=t[0]+"";ru^n?1:-1;for(s=(c=o.length)<(u=i.length)?c:u,a=0;ai[a]^n?1:-1;return c==u?0:c>u^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&t<=n}function c(t){return"[object Array]"==Object.prototype.toString.call(t)}function u(t,e,n){for(var r,o,i=[0],a=0,s=t.length;an-1&&(null==i[r+1]&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function f(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function l(t,e){var n,r;if(e<0){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else e