2018-01-17 06:28:01 +01:00
( function webpackUniversalModuleDefinition ( root , factory ) {
if ( typeof exports === 'object' && typeof module === 'object' )
module . exports = factory ( ) ;
else if ( typeof define === 'function' && define . amd )
define ( [ ] , factory ) ;
else {
var a = factory ( ) ;
for ( var i in a ) ( typeof exports === 'object' ? exports : root ) [ i ] = a [ i ] ;
}
} ) ( typeof self !== 'undefined' ? self : this , function ( ) {
return /******/ ( function ( modules ) { // webpackBootstrap
2018-01-11 12:54:20 +01:00
/******/ // The module cache
/******/ var installedModules = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/
/******/ // Check if module is in cache
/******/ if ( installedModules [ moduleId ] ) {
/******/ return installedModules [ moduleId ] . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules [ moduleId ] = {
/******/ i : moduleId ,
/******/ l : false ,
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ modules [ moduleId ] . call ( module . exports , module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Flag the module as loaded
/******/ module . l = true ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ _ _webpack _require _ _ . m = modules ;
/******/
/******/ // expose the module cache
/******/ _ _webpack _require _ _ . c = installedModules ;
/******/
/******/ // define getter function for harmony exports
/******/ _ _webpack _require _ _ . d = function ( exports , name , getter ) {
/******/ if ( ! _ _webpack _require _ _ . o ( exports , name ) ) {
/******/ Object . defineProperty ( exports , name , {
/******/ configurable : false ,
/******/ enumerable : true ,
/******/ get : getter
/******/ } ) ;
/******/ }
/******/ } ;
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ _ _webpack _require _ _ . n = function ( module ) {
/******/ var getter = module && module . _ _esModule ?
/******/ function getDefault ( ) { return module [ 'default' ] ; } :
/******/ function getModuleExports ( ) { return module ; } ;
/******/ _ _webpack _require _ _ . d ( getter , 'a' , getter ) ;
/******/ return getter ;
/******/ } ;
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ _ _webpack _require _ _ . o = function ( object , property ) { return Object . prototype . hasOwnProperty . call ( object , property ) ; } ;
/******/
/******/ // __webpack_public_path__
/******/ _ _webpack _require _ _ . p = "" ;
/******/
/******/ // Load entry module and return exports
2018-01-28 01:45:45 +01:00
/******/ return _ _webpack _require _ _ ( _ _webpack _require _ _ . s = 15 ) ;
2018-01-11 12:54:20 +01:00
/******/ } )
/************************************************************************/
/******/ ( [
/* 0 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-17 06:28:01 +01:00
var OPEN _MODAL = exports . OPEN _MODAL = 'OPEN_MODAL' ;
var CLOSE _MODAL = exports . CLOSE _MODAL = 'CLOSE_MODAL' ;
var SHOW _SNACKBAR = exports . SHOW _SNACKBAR = 'SHOW_SNACKBAR' ;
var REMOVE _SNACKBAR _SNACK = exports . REMOVE _SNACKBAR _SNACK = 'REMOVE_SNACKBAR_SNACK' ;
var WINDOW _FOCUSED = exports . WINDOW _FOCUSED = 'WINDOW_FOCUSED' ;
var DAEMON _READY = exports . DAEMON _READY = 'DAEMON_READY' ;
var DAEMON _VERSION _MATCH = exports . DAEMON _VERSION _MATCH = 'DAEMON_VERSION_MATCH' ;
var DAEMON _VERSION _MISMATCH = exports . DAEMON _VERSION _MISMATCH = 'DAEMON_VERSION_MISMATCH' ;
var VOLUME _CHANGED = exports . VOLUME _CHANGED = 'VOLUME_CHANGED' ;
// Navigation
var CHANGE _AFTER _AUTH _PATH = exports . CHANGE _AFTER _AUTH _PATH = 'CHANGE_AFTER_AUTH_PATH' ;
var WINDOW _SCROLLED = exports . WINDOW _SCROLLED = 'WINDOW_SCROLLED' ;
var HISTORY _NAVIGATE = exports . HISTORY _NAVIGATE = 'HISTORY_NAVIGATE' ;
// Upgrades
var UPGRADE _CANCELLED = exports . UPGRADE _CANCELLED = 'UPGRADE_CANCELLED' ;
var DOWNLOAD _UPGRADE = exports . DOWNLOAD _UPGRADE = 'DOWNLOAD_UPGRADE' ;
var UPGRADE _DOWNLOAD _STARTED = exports . UPGRADE _DOWNLOAD _STARTED = 'UPGRADE_DOWNLOAD_STARTED' ;
var UPGRADE _DOWNLOAD _COMPLETED = exports . UPGRADE _DOWNLOAD _COMPLETED = 'UPGRADE_DOWNLOAD_COMPLETED' ;
var UPGRADE _DOWNLOAD _PROGRESSED = exports . UPGRADE _DOWNLOAD _PROGRESSED = 'UPGRADE_DOWNLOAD_PROGRESSED' ;
var CHECK _UPGRADE _AVAILABLE = exports . CHECK _UPGRADE _AVAILABLE = 'CHECK_UPGRADE_AVAILABLE' ;
var CHECK _UPGRADE _START = exports . CHECK _UPGRADE _START = 'CHECK_UPGRADE_START' ;
var CHECK _UPGRADE _SUCCESS = exports . CHECK _UPGRADE _SUCCESS = 'CHECK_UPGRADE_SUCCESS' ;
var CHECK _UPGRADE _FAIL = exports . CHECK _UPGRADE _FAIL = 'CHECK_UPGRADE_FAIL' ;
var CHECK _UPGRADE _SUBSCRIBE = exports . CHECK _UPGRADE _SUBSCRIBE = 'CHECK_UPGRADE_SUBSCRIBE' ;
var UPDATE _VERSION = exports . UPDATE _VERSION = 'UPDATE_VERSION' ;
var UPDATE _REMOTE _VERSION = exports . UPDATE _REMOTE _VERSION = 'UPDATE_REMOTE_VERSION' ;
var SKIP _UPGRADE = exports . SKIP _UPGRADE = 'SKIP_UPGRADE' ;
var START _UPGRADE = exports . START _UPGRADE = 'START_UPGRADE' ;
// Wallet
var GET _NEW _ADDRESS _STARTED = exports . GET _NEW _ADDRESS _STARTED = 'GET_NEW_ADDRESS_STARTED' ;
var GET _NEW _ADDRESS _COMPLETED = exports . GET _NEW _ADDRESS _COMPLETED = 'GET_NEW_ADDRESS_COMPLETED' ;
var FETCH _TRANSACTIONS _STARTED = exports . FETCH _TRANSACTIONS _STARTED = 'FETCH_TRANSACTIONS_STARTED' ;
var FETCH _TRANSACTIONS _COMPLETED = exports . FETCH _TRANSACTIONS _COMPLETED = 'FETCH_TRANSACTIONS_COMPLETED' ;
var UPDATE _BALANCE = exports . UPDATE _BALANCE = 'UPDATE_BALANCE' ;
var CHECK _ADDRESS _IS _MINE _STARTED = exports . CHECK _ADDRESS _IS _MINE _STARTED = 'CHECK_ADDRESS_IS_MINE_STARTED' ;
var CHECK _ADDRESS _IS _MINE _COMPLETED = exports . CHECK _ADDRESS _IS _MINE _COMPLETED = 'CHECK_ADDRESS_IS_MINE_COMPLETED' ;
var SET _DRAFT _TRANSACTION _AMOUNT = exports . SET _DRAFT _TRANSACTION _AMOUNT = 'SET_DRAFT_TRANSACTION_AMOUNT' ;
var SET _DRAFT _TRANSACTION _ADDRESS = exports . SET _DRAFT _TRANSACTION _ADDRESS = 'SET_DRAFT_TRANSACTION_ADDRESS' ;
var SEND _TRANSACTION _STARTED = exports . SEND _TRANSACTION _STARTED = 'SEND_TRANSACTION_STARTED' ;
var SEND _TRANSACTION _COMPLETED = exports . SEND _TRANSACTION _COMPLETED = 'SEND_TRANSACTION_COMPLETED' ;
var SEND _TRANSACTION _FAILED = exports . SEND _TRANSACTION _FAILED = 'SEND_TRANSACTION_FAILED' ;
var FETCH _BLOCK _SUCCESS = exports . FETCH _BLOCK _SUCCESS = 'FETCH_BLOCK_SUCCESS' ;
var SUPPORT _TRANSACTION _STARTED = exports . SUPPORT _TRANSACTION _STARTED = 'SUPPORT_TRANSACTION_STARTED' ;
var SUPPORT _TRANSACTION _COMPLETED = exports . SUPPORT _TRANSACTION _COMPLETED = 'SUPPORT_TRANSACTION_COMPLETED' ;
var SUPPORT _TRANSACTION _FAILED = exports . SUPPORT _TRANSACTION _FAILED = 'SUPPORT_TRANSACTION_FAILED' ;
// Claims
var FETCH _FEATURED _CONTENT _STARTED = exports . FETCH _FEATURED _CONTENT _STARTED = 'FETCH_FEATURED_CONTENT_STARTED' ;
var FETCH _FEATURED _CONTENT _COMPLETED = exports . FETCH _FEATURED _CONTENT _COMPLETED = 'FETCH_FEATURED_CONTENT_COMPLETED' ;
var RESOLVE _URIS _STARTED = exports . RESOLVE _URIS _STARTED = 'RESOLVE_URIS_STARTED' ;
var RESOLVE _URIS _COMPLETED = exports . RESOLVE _URIS _COMPLETED = 'RESOLVE_URIS_COMPLETED' ;
var FETCH _CHANNEL _CLAIMS _STARTED = exports . FETCH _CHANNEL _CLAIMS _STARTED = 'FETCH_CHANNEL_CLAIMS_STARTED' ;
var FETCH _CHANNEL _CLAIMS _COMPLETED = exports . FETCH _CHANNEL _CLAIMS _COMPLETED = 'FETCH_CHANNEL_CLAIMS_COMPLETED' ;
var FETCH _CHANNEL _CLAIM _COUNT _STARTED = exports . FETCH _CHANNEL _CLAIM _COUNT _STARTED = 'FETCH_CHANNEL_CLAIM_COUNT_STARTED' ;
var FETCH _CHANNEL _CLAIM _COUNT _COMPLETED = exports . FETCH _CHANNEL _CLAIM _COUNT _COMPLETED = 'FETCH_CHANNEL_CLAIM_COUNT_COMPLETED' ;
var FETCH _CLAIM _LIST _MINE _STARTED = exports . FETCH _CLAIM _LIST _MINE _STARTED = 'FETCH_CLAIM_LIST_MINE_STARTED' ;
var FETCH _CLAIM _LIST _MINE _COMPLETED = exports . FETCH _CLAIM _LIST _MINE _COMPLETED = 'FETCH_CLAIM_LIST_MINE_COMPLETED' ;
var ABANDON _CLAIM _STARTED = exports . ABANDON _CLAIM _STARTED = 'ABANDON_CLAIM_STARTED' ;
var ABANDON _CLAIM _SUCCEEDED = exports . ABANDON _CLAIM _SUCCEEDED = 'ABANDON_CLAIM_SUCCEEDED' ;
var FETCH _CHANNEL _LIST _MINE _STARTED = exports . FETCH _CHANNEL _LIST _MINE _STARTED = 'FETCH_CHANNEL_LIST_MINE_STARTED' ;
var FETCH _CHANNEL _LIST _MINE _COMPLETED = exports . FETCH _CHANNEL _LIST _MINE _COMPLETED = 'FETCH_CHANNEL_LIST_MINE_COMPLETED' ;
var CREATE _CHANNEL _STARTED = exports . CREATE _CHANNEL _STARTED = 'CREATE_CHANNEL_STARTED' ;
var CREATE _CHANNEL _COMPLETED = exports . CREATE _CHANNEL _COMPLETED = 'CREATE_CHANNEL_COMPLETED' ;
var PUBLISH _STARTED = exports . PUBLISH _STARTED = 'PUBLISH_STARTED' ;
var PUBLISH _COMPLETED = exports . PUBLISH _COMPLETED = 'PUBLISH_COMPLETED' ;
var PUBLISH _FAILED = exports . PUBLISH _FAILED = 'PUBLISH_FAILED' ;
var SET _PLAYING _URI = exports . SET _PLAYING _URI = 'PLAY_URI' ;
// Files
var FILE _LIST _STARTED = exports . FILE _LIST _STARTED = 'FILE_LIST_STARTED' ;
var FILE _LIST _SUCCEEDED = exports . FILE _LIST _SUCCEEDED = 'FILE_LIST_SUCCEEDED' ;
var FETCH _FILE _INFO _STARTED = exports . FETCH _FILE _INFO _STARTED = 'FETCH_FILE_INFO_STARTED' ;
var FETCH _FILE _INFO _COMPLETED = exports . FETCH _FILE _INFO _COMPLETED = 'FETCH_FILE_INFO_COMPLETED' ;
var FETCH _COST _INFO _STARTED = exports . FETCH _COST _INFO _STARTED = 'FETCH_COST_INFO_STARTED' ;
var FETCH _COST _INFO _COMPLETED = exports . FETCH _COST _INFO _COMPLETED = 'FETCH_COST_INFO_COMPLETED' ;
var LOADING _VIDEO _STARTED = exports . LOADING _VIDEO _STARTED = 'LOADING_VIDEO_STARTED' ;
var LOADING _VIDEO _COMPLETED = exports . LOADING _VIDEO _COMPLETED = 'LOADING_VIDEO_COMPLETED' ;
var LOADING _VIDEO _FAILED = exports . LOADING _VIDEO _FAILED = 'LOADING_VIDEO_FAILED' ;
var DOWNLOADING _STARTED = exports . DOWNLOADING _STARTED = 'DOWNLOADING_STARTED' ;
var DOWNLOADING _PROGRESSED = exports . DOWNLOADING _PROGRESSED = 'DOWNLOADING_PROGRESSED' ;
var DOWNLOADING _COMPLETED = exports . DOWNLOADING _COMPLETED = 'DOWNLOADING_COMPLETED' ;
var PLAY _VIDEO _STARTED = exports . PLAY _VIDEO _STARTED = 'PLAY_VIDEO_STARTED' ;
var FETCH _AVAILABILITY _STARTED = exports . FETCH _AVAILABILITY _STARTED = 'FETCH_AVAILABILITY_STARTED' ;
var FETCH _AVAILABILITY _COMPLETED = exports . FETCH _AVAILABILITY _COMPLETED = 'FETCH_AVAILABILITY_COMPLETED' ;
var FILE _DELETE = exports . FILE _DELETE = 'FILE_DELETE' ;
// Search
var SEARCH _STARTED = exports . SEARCH _STARTED = 'SEARCH_STARTED' ;
var SEARCH _COMPLETED = exports . SEARCH _COMPLETED = 'SEARCH_COMPLETED' ;
var SEARCH _CANCELLED = exports . SEARCH _CANCELLED = 'SEARCH_CANCELLED' ;
// Settings
var DAEMON _SETTINGS _RECEIVED = exports . DAEMON _SETTINGS _RECEIVED = 'DAEMON_SETTINGS_RECEIVED' ;
var CLIENT _SETTING _CHANGED = exports . CLIENT _SETTING _CHANGED = 'CLIENT_SETTING_CHANGED' ;
// User
var AUTHENTICATION _STARTED = exports . AUTHENTICATION _STARTED = 'AUTHENTICATION_STARTED' ;
var AUTHENTICATION _SUCCESS = exports . AUTHENTICATION _SUCCESS = 'AUTHENTICATION_SUCCESS' ;
var AUTHENTICATION _FAILURE = exports . AUTHENTICATION _FAILURE = 'AUTHENTICATION_FAILURE' ;
var USER _EMAIL _DECLINE = exports . USER _EMAIL _DECLINE = 'USER_EMAIL_DECLINE' ;
var USER _EMAIL _NEW _STARTED = exports . USER _EMAIL _NEW _STARTED = 'USER_EMAIL_NEW_STARTED' ;
var USER _EMAIL _NEW _SUCCESS = exports . USER _EMAIL _NEW _SUCCESS = 'USER_EMAIL_NEW_SUCCESS' ;
var USER _EMAIL _NEW _EXISTS = exports . USER _EMAIL _NEW _EXISTS = 'USER_EMAIL_NEW_EXISTS' ;
var USER _EMAIL _NEW _FAILURE = exports . USER _EMAIL _NEW _FAILURE = 'USER_EMAIL_NEW_FAILURE' ;
var USER _EMAIL _VERIFY _STARTED = exports . USER _EMAIL _VERIFY _STARTED = 'USER_EMAIL_VERIFY_STARTED' ;
var USER _EMAIL _VERIFY _SUCCESS = exports . USER _EMAIL _VERIFY _SUCCESS = 'USER_EMAIL_VERIFY_SUCCESS' ;
var USER _EMAIL _VERIFY _FAILURE = exports . USER _EMAIL _VERIFY _FAILURE = 'USER_EMAIL_VERIFY_FAILURE' ;
var USER _IDENTITY _VERIFY _STARTED = exports . USER _IDENTITY _VERIFY _STARTED = 'USER_IDENTITY_VERIFY_STARTED' ;
var USER _IDENTITY _VERIFY _SUCCESS = exports . USER _IDENTITY _VERIFY _SUCCESS = 'USER_IDENTITY_VERIFY_SUCCESS' ;
var USER _IDENTITY _VERIFY _FAILURE = exports . USER _IDENTITY _VERIFY _FAILURE = 'USER_IDENTITY_VERIFY_FAILURE' ;
var USER _FETCH _STARTED = exports . USER _FETCH _STARTED = 'USER_FETCH_STARTED' ;
var USER _FETCH _SUCCESS = exports . USER _FETCH _SUCCESS = 'USER_FETCH_SUCCESS' ;
var USER _FETCH _FAILURE = exports . USER _FETCH _FAILURE = 'USER_FETCH_FAILURE' ;
var USER _INVITE _STATUS _FETCH _STARTED = exports . USER _INVITE _STATUS _FETCH _STARTED = 'USER_INVITE_STATUS_FETCH_STARTED' ;
var USER _INVITE _STATUS _FETCH _SUCCESS = exports . USER _INVITE _STATUS _FETCH _SUCCESS = 'USER_INVITE_STATUS_FETCH_SUCCESS' ;
var USER _INVITE _STATUS _FETCH _FAILURE = exports . USER _INVITE _STATUS _FETCH _FAILURE = 'USER_INVITE_STATUS_FETCH_FAILURE' ;
var USER _INVITE _NEW _STARTED = exports . USER _INVITE _NEW _STARTED = 'USER_INVITE_NEW_STARTED' ;
var USER _INVITE _NEW _SUCCESS = exports . USER _INVITE _NEW _SUCCESS = 'USER_INVITE_NEW_SUCCESS' ;
var USER _INVITE _NEW _FAILURE = exports . USER _INVITE _NEW _FAILURE = 'USER_INVITE_NEW_FAILURE' ;
var FETCH _ACCESS _TOKEN _SUCCESS = exports . FETCH _ACCESS _TOKEN _SUCCESS = 'FETCH_ACCESS_TOKEN_SUCCESS' ;
// Rewards
var FETCH _REWARDS _STARTED = exports . FETCH _REWARDS _STARTED = 'FETCH_REWARDS_STARTED' ;
var FETCH _REWARDS _COMPLETED = exports . FETCH _REWARDS _COMPLETED = 'FETCH_REWARDS_COMPLETED' ;
var CLAIM _REWARD _STARTED = exports . CLAIM _REWARD _STARTED = 'CLAIM_REWARD_STARTED' ;
var CLAIM _REWARD _SUCCESS = exports . CLAIM _REWARD _SUCCESS = 'CLAIM_REWARD_SUCCESS' ;
var CLAIM _REWARD _FAILURE = exports . CLAIM _REWARD _FAILURE = 'CLAIM_REWARD_FAILURE' ;
var CLAIM _REWARD _CLEAR _ERROR = exports . CLAIM _REWARD _CLEAR _ERROR = 'CLAIM_REWARD_CLEAR_ERROR' ;
var FETCH _REWARD _CONTENT _COMPLETED = exports . FETCH _REWARD _CONTENT _COMPLETED = 'FETCH_REWARD_CONTENT_COMPLETED' ;
// Language
var DOWNLOAD _LANGUAGE _SUCCEEDED = exports . DOWNLOAD _LANGUAGE _SUCCEEDED = 'DOWNLOAD_LANGUAGE_SUCCEEDED' ;
var DOWNLOAD _LANGUAGE _FAILED = exports . DOWNLOAD _LANGUAGE _FAILED = 'DOWNLOAD_LANGUAGE_FAILED' ;
// ShapeShift
var GET _SUPPORTED _COINS _START = exports . GET _SUPPORTED _COINS _START = 'GET_SUPPORTED_COINS_START' ;
var GET _SUPPORTED _COINS _SUCCESS = exports . GET _SUPPORTED _COINS _SUCCESS = 'GET_SUPPORTED_COINS_SUCCESS' ;
var GET _SUPPORTED _COINS _FAIL = exports . GET _SUPPORTED _COINS _FAIL = 'GET_SUPPORTED_COINS_FAIL' ;
var GET _COIN _STATS _START = exports . GET _COIN _STATS _START = 'GET_COIN_STATS_START' ;
var GET _COIN _STATS _SUCCESS = exports . GET _COIN _STATS _SUCCESS = 'GET_COIN_STATS_SUCCESS' ;
var GET _COIN _STATS _FAIL = exports . GET _COIN _STATS _FAIL = 'GET_COIN_STATS_FAIL' ;
var PREPARE _SHAPE _SHIFT _START = exports . PREPARE _SHAPE _SHIFT _START = 'PREPARE_SHAPE_SHIFT_START' ;
var PREPARE _SHAPE _SHIFT _SUCCESS = exports . PREPARE _SHAPE _SHIFT _SUCCESS = 'PREPARE_SHAPE_SHIFT_SUCCESS' ;
var PREPARE _SHAPE _SHIFT _FAIL = exports . PREPARE _SHAPE _SHIFT _FAIL = 'PREPARE_SHAPE_SHIFT_FAIL' ;
var GET _ACTIVE _SHIFT _START = exports . GET _ACTIVE _SHIFT _START = 'GET_ACTIVE_SHIFT_START' ;
var GET _ACTIVE _SHIFT _SUCCESS = exports . GET _ACTIVE _SHIFT _SUCCESS = 'GET_ACTIVE_SHIFT_SUCCESS' ;
var GET _ACTIVE _SHIFT _FAIL = exports . GET _ACTIVE _SHIFT _FAIL = 'GET_ACTIVE_SHIFT_FAIL' ;
var CLEAR _SHAPE _SHIFT = exports . CLEAR _SHAPE _SHIFT = 'CLEAR_SHAPE_SHIFT' ;
// Subscriptions
var CHANNEL _SUBSCRIBE = exports . CHANNEL _SUBSCRIBE = 'CHANNEL_SUBSCRIBE' ;
var CHANNEL _UNSUBSCRIBE = exports . CHANNEL _UNSUBSCRIBE = 'CHANNEL_UNSUBSCRIBE' ;
var HAS _FETCHED _SUBSCRIPTIONS = exports . HAS _FETCHED _SUBSCRIPTIONS = 'HAS_FETCHED_SUBSCRIPTIONS' ;
// Video controls
var SET _VIDEO _PAUSE = exports . SET _VIDEO _PAUSE = 'SET_VIDEO_PAUSE' ;
// Media controls
var MEDIA _PLAY = exports . MEDIA _PLAY = 'MEDIA_PLAY' ;
var MEDIA _PAUSE = exports . MEDIA _PAUSE = 'MEDIA_PAUSE' ;
var MEDIA _POSITION = exports . MEDIA _POSITION = 'MEDIA_POSITION' ;
/***/ } ) ,
/* 1 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-19 11:48:43 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . selectActiveHistoryEntry = exports . selectHistoryStack = exports . selectHistoryIndex = exports . selectIsForwardDisabled = exports . selectIsBackDisabled = exports . selectPathAfterAuth = exports . selectPageTitle = exports . selectHeaderLinks = exports . makeSelectCurrentParam = exports . selectCurrentParams = exports . selectCurrentPage = exports . computePageFromPath = exports . selectCurrentPath = exports . selectState = undefined ;
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-28 01:45:45 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-01-19 11:48:43 +01:00
2018-01-28 01:45:45 +01:00
var _query _params = _ _webpack _require _ _ ( 8 ) ;
2018-01-19 11:48:43 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . navigation || { } ;
} ;
var selectCurrentPath = exports . selectCurrentPath = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . currentPath ;
} ) ;
var computePageFromPath = exports . computePageFromPath = function computePageFromPath ( path ) {
return path . replace ( /^\// , '' ) . split ( '?' ) [ 0 ] ;
} ;
var selectCurrentPage = exports . selectCurrentPage = ( 0 , _reselect . createSelector ) ( selectCurrentPath , function ( path ) {
return computePageFromPath ( path ) ;
} ) ;
var selectCurrentParams = exports . selectCurrentParams = ( 0 , _reselect . createSelector ) ( selectCurrentPath , function ( path ) {
if ( path === undefined ) return { } ;
if ( ! path . match ( /\?/ ) ) return { } ;
return ( 0 , _query _params . parseQueryParams ) ( path . split ( '?' ) [ 1 ] ) ;
} ) ;
var makeSelectCurrentParam = exports . makeSelectCurrentParam = function makeSelectCurrentParam ( param ) {
return ( 0 , _reselect . createSelector ) ( selectCurrentParams , function ( params ) {
return params ? params [ param ] : undefined ;
} ) ;
} ;
var selectHeaderLinks = exports . selectHeaderLinks = ( 0 , _reselect . createSelector ) ( selectCurrentPage , function ( page ) {
// This contains intentional fall throughs
switch ( page ) {
case 'wallet' :
case 'history' :
case 'send' :
case 'getcredits' :
case 'invite' :
case 'rewards' :
case 'backup' :
return {
wallet : _ _ ( 'Overview' ) ,
getcredits : _ _ ( 'Get Credits' ) ,
send : _ _ ( 'Send / Receive' ) ,
rewards : _ _ ( 'Rewards' ) ,
invite : _ _ ( 'Invites' ) ,
history : _ _ ( 'History' )
} ;
case 'downloaded' :
case 'published' :
return {
downloaded : _ _ ( 'Downloaded' ) ,
published : _ _ ( 'Published' )
} ;
case 'settings' :
case 'help' :
return {
settings : _ _ ( 'Settings' ) ,
help : _ _ ( 'Help' )
} ;
case 'discover' :
case 'subscriptions' :
return {
discover : _ _ ( 'Discover' ) ,
subscriptions : _ _ ( 'Subscriptions' )
} ;
default :
return null ;
}
} ) ;
var selectPageTitle = exports . selectPageTitle = ( 0 , _reselect . createSelector ) ( selectCurrentPage , selectCurrentParams , function ( page , params ) {
switch ( page ) {
case 'settings' :
return _ _ ( 'Settings' ) ;
case 'report' :
return _ _ ( 'Report' ) ;
case 'wallet' :
return _ _ ( 'Wallet' ) ;
case 'send' :
return _ _ ( 'Send or Receive LBRY Credits' ) ;
case 'getcredits' :
return _ _ ( 'Get LBRY Credits' ) ;
case 'backup' :
return _ _ ( 'Backup Your Wallet' ) ;
case 'rewards' :
return _ _ ( 'Rewards' ) ;
case 'invite' :
return _ _ ( 'Invites' ) ;
case 'start' :
return _ _ ( 'Start' ) ;
case 'publish' :
return params . id ? _ _ ( 'Edit' ) : _ _ ( 'Publish' ) ;
case 'help' :
return _ _ ( 'Help' ) ;
case 'developer' :
return _ _ ( 'Developer' ) ;
case 'show' :
{
2018-01-28 01:45:45 +01:00
var parts = [ ( 0 , _lbryURI . normalizeURI ) ( params . uri ) ] ;
2018-01-19 11:48:43 +01:00
// If the params has any keys other than "uri"
if ( Object . keys ( params ) . length > 1 ) {
parts . push ( ( 0 , _query _params . toQueryString ) ( Object . assign ( { } , params , { uri : null } ) ) ) ;
}
return parts . join ( '?' ) ;
}
case 'downloaded' :
return _ _ ( 'Downloads & Purchases' ) ;
case 'published' :
return _ _ ( 'Publications' ) ;
case 'search' :
return params . query ? _ _ ( 'Search results for %s' , params . query ) : _ _ ( 'Search' ) ;
case 'subscriptions' :
return _ _ ( 'Your Subscriptions' ) ;
case 'discover' :
case false :
case null :
case '' :
return '' ;
default :
return page [ 0 ] . toUpperCase ( ) + ( page . length > 0 ? page . substr ( 1 ) : '' ) ;
}
} ) ;
var selectPathAfterAuth = exports . selectPathAfterAuth = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . pathAfterAuth ;
} ) ;
var selectIsBackDisabled = exports . selectIsBackDisabled = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index === 0 ;
} ) ;
var selectIsForwardDisabled = exports . selectIsForwardDisabled = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index === state . stack . length - 1 ;
} ) ;
var selectHistoryIndex = exports . selectHistoryIndex = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . index ;
} ) ;
var selectHistoryStack = exports . selectHistoryStack = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . stack ;
} ) ;
// returns current page attributes (scrollY, path)
var selectActiveHistoryEntry = exports . selectActiveHistoryEntry = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . stack [ state . index ] ;
} ) ;
/***/ } ) ,
/* 2 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-17 13:24:35 +01:00
exports . _ _esModule = true ;
exports . defaultMemoize = defaultMemoize ;
exports . createSelectorCreator = createSelectorCreator ;
exports . createStructuredSelector = createStructuredSelector ;
function defaultEqualityCheck ( a , b ) {
return a === b ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function areArgumentsShallowlyEqual ( equalityCheck , prev , next ) {
if ( prev === null || next === null || prev . length !== next . length ) {
return false ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
// Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
var length = prev . length ;
for ( var i = 0 ; i < length ; i ++ ) {
if ( ! equalityCheck ( prev [ i ] , next [ i ] ) ) {
return false ;
}
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
return true ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function defaultMemoize ( func ) {
var equalityCheck = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : defaultEqualityCheck ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var lastArgs = null ;
var lastResult = null ;
// we reference arguments instead of spreading them for performance reasons
return function ( ) {
if ( ! areArgumentsShallowlyEqual ( equalityCheck , lastArgs , arguments ) ) {
// apply arguments instead of spreading for performance.
lastResult = func . apply ( null , arguments ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
lastArgs = arguments ;
return lastResult ;
} ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function getDependencies ( funcs ) {
var dependencies = Array . isArray ( funcs [ 0 ] ) ? funcs [ 0 ] : funcs ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
if ( ! dependencies . every ( function ( dep ) {
return typeof dep === 'function' ;
} ) ) {
var dependencyTypes = dependencies . map ( function ( dep ) {
return typeof dep ;
} ) . join ( ', ' ) ;
throw new Error ( 'Selector creators expect all input-selectors to be functions, ' + ( 'instead received the following types: [' + dependencyTypes + ']' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
return dependencies ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function createSelectorCreator ( memoize ) {
for ( var _len = arguments . length , memoizeOptions = Array ( _len > 1 ? _len - 1 : 0 ) , _key = 1 ; _key < _len ; _key ++ ) {
memoizeOptions [ _key - 1 ] = arguments [ _key ] ;
2018-01-17 06:28:01 +01:00
}
2018-01-17 13:24:35 +01:00
return function ( ) {
for ( var _len2 = arguments . length , funcs = Array ( _len2 ) , _key2 = 0 ; _key2 < _len2 ; _key2 ++ ) {
funcs [ _key2 ] = arguments [ _key2 ] ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var recomputations = 0 ;
var resultFunc = funcs . pop ( ) ;
var dependencies = getDependencies ( funcs ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var memoizedResultFunc = memoize . apply ( undefined , [ function ( ) {
recomputations ++ ;
// apply arguments instead of spreading for performance.
return resultFunc . apply ( null , arguments ) ;
} ] . concat ( memoizeOptions ) ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
// If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
var selector = defaultMemoize ( function ( ) {
var params = [ ] ;
var length = dependencies . length ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
for ( var i = 0 ; i < length ; i ++ ) {
// apply arguments instead of spreading and mutate a local list of params for performance.
params . push ( dependencies [ i ] . apply ( null , arguments ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
// apply arguments instead of spreading for performance.
return memoizedResultFunc . apply ( null , params ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
selector . resultFunc = resultFunc ;
selector . recomputations = function ( ) {
return recomputations ;
} ;
selector . resetRecomputations = function ( ) {
return recomputations = 0 ;
} ;
return selector ;
} ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var createSelector = exports . createSelector = createSelectorCreator ( defaultMemoize ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function createStructuredSelector ( selectors ) {
var selectorCreator = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : createSelector ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
if ( typeof selectors !== 'object' ) {
throw new Error ( 'createStructuredSelector expects first argument to be an object ' + ( 'where each property is a selector, instead received a ' + typeof selectors ) ) ;
2018-01-17 06:28:01 +01:00
}
2018-01-17 13:24:35 +01:00
var objectKeys = Object . keys ( selectors ) ;
return selectorCreator ( objectKeys . map ( function ( key ) {
return selectors [ key ] ;
} ) , function ( ) {
for ( var _len3 = arguments . length , values = Array ( _len3 ) , _key3 = 0 ; _key3 < _len3 ; _key3 ++ ) {
values [ _key3 ] = arguments [ _key3 ] ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
return values . reduce ( function ( composition , value , index ) {
composition [ objectKeys [ index ] ] = value ;
return composition ;
} , { } ) ;
} ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
/***/ } ) ,
2018-01-19 11:48:43 +01:00
/* 3 */
2018-01-17 13:24:35 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
"use strict" ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _slicedToArray = function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
exports . parseURI = parseURI ;
exports . buildURI = buildURI ;
exports . normalizeURI = normalizeURI ;
exports . isURIValid = isURIValid ;
exports . isNameValid = isNameValid ;
exports . isURIClaimable = isURIClaimable ;
var channelNameMinLength = 1 ;
var claimIdMaxLength = 40 ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var regexInvalidURI = exports . regexInvalidURI = /[^A-Za-z0-9-]/g ;
var regexAddress = exports . regexAddress = /^b(?=[^0OIl]{32,33})[0-9A-Za-z]{32,33}$/ ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
/ * *
* Parses a LBRY name into its component parts . Throws errors with user - friendly
* messages for invalid names .
*
* N . B . that "name" indicates the value in the name position of the URI . For
* claims for channel content , this will actually be the channel name , and
* the content name is in the path ( e . g . lbry : //@channel/content)
*
* In most situations , you ' ll want to use the contentName and channelName keys
* and ignore the name key .
*
* Returns a dictionary with keys :
* - name ( string ) : The value in the "name" position in the URI . Note that this
* could be either content name or channel name ; see above .
* - path ( string , if persent )
* - claimSequence ( int , if present )
* - bidPosition ( int , if present )
* - claimId ( string , if present )
* - isChannel ( boolean )
* - contentName ( string ) : For anon claims , the name ; for channel claims , the path
* - channelName ( string , if present ) : Channel name without @
* /
function parseURI ( URI ) {
var requireProto = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : false ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
// Break into components. Empty sub-matches are converted to null
var componentsRegex = new RegExp ( '^((?:lbry://)?)' + // protocol
'([^:$#/]*)' + // name (stops at the first separator or end)
'([:$#]?)([^/]*)' + // modifier separator, modifier (stops at the first path separator or end)
'(/?)(.*)' // path separator, path
) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _componentsRegex$exec = componentsRegex . exec ( URI ) . slice ( 1 ) . map ( function ( match ) {
return match || null ;
} ) ,
_componentsRegex$exec2 = _slicedToArray ( _componentsRegex$exec , 6 ) ,
proto = _componentsRegex$exec2 [ 0 ] ,
name = _componentsRegex$exec2 [ 1 ] ,
modSep = _componentsRegex$exec2 [ 2 ] ,
modVal = _componentsRegex$exec2 [ 3 ] ,
pathSep = _componentsRegex$exec2 [ 4 ] ,
path = _componentsRegex$exec2 [ 5 ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var contentName = void 0 ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
// Validate protocol
if ( requireProto && ! proto ) {
throw new Error ( _ _ ( 'LBRY URIs must include a protocol prefix (lbry://).' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
// Validate and process name
if ( ! name ) {
throw new Error ( _ _ ( 'URI does not include name.' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var isChannel = name . startsWith ( '@' ) ;
var channelName = isChannel ? name . slice ( 1 ) : name ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( isChannel ) {
if ( ! channelName ) {
throw new Error ( _ _ ( 'No channel name after @.' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( channelName . length < channelNameMinLength ) {
throw new Error ( _ _ ( 'Channel names must be at least %s characters.' , channelNameMinLength ) ) ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
contentName = path ;
2018-01-17 06:28:01 +01:00
}
2018-01-28 01:45:45 +01:00
var nameBadChars = ( channelName || name ) . match ( regexInvalidURI ) ;
if ( nameBadChars ) {
throw new Error ( _ _ ( 'Invalid character %s in name: %s.' , nameBadChars . length === 1 ? '' : 's' , nameBadChars . join ( ', ' ) ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
// Validate and process modifier (claim ID, bid position or claim sequence)
var claimId = void 0 ;
var claimSequence = void 0 ;
var bidPosition = void 0 ;
if ( modSep ) {
if ( ! modVal ) {
throw new Error ( _ _ ( 'No modifier provided after separator %s.' , modSep ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( modSep === '#' ) {
claimId = modVal ;
} else if ( modSep === ':' ) {
claimSequence = modVal ;
} else if ( modSep === '$' ) {
bidPosition = modVal ;
}
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( claimId && ( claimId . length > claimIdMaxLength || ! claimId . match ( /^[0-9a-f]+$/ ) ) && ! claimId . match ( /^pending/ ) // ought to be dropped when savePendingPublish drops hack
) {
throw new Error ( _ _ ( 'Invalid claim ID %s.' , claimId ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( claimSequence && ! claimSequence . match ( /^-?[1-9][0-9]*$/ ) ) {
throw new Error ( _ _ ( 'Claim sequence must be a number.' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( bidPosition && ! bidPosition . match ( /^-?[1-9][0-9]*$/ ) ) {
throw new Error ( _ _ ( 'Bid position must be a number.' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
// Validate and process path
if ( path ) {
if ( ! isChannel ) {
throw new Error ( _ _ ( 'Only channel URIs may have a path.' ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var pathBadChars = path . match ( regexInvalidURI ) ;
if ( pathBadChars ) {
throw new Error ( _ _ ( 'Invalid character in path: %s' , pathBadChars . join ( ', ' ) ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
contentName = path ;
} else if ( pathSep ) {
throw new Error ( _ _ ( 'No path provided after /' ) ) ;
2018-01-17 13:24:35 +01:00
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return _extends ( {
name : name ,
path : path ,
isChannel : isChannel
} , contentName ? { contentName : contentName } : { } , channelName ? { channelName : channelName } : { } , claimSequence ? { claimSequence : parseInt ( claimSequence , 10 ) } : { } , bidPosition ? { bidPosition : parseInt ( bidPosition , 10 ) } : { } , claimId ? { claimId : claimId } : { } , path ? { path : path } : { } ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
/ * *
2018-01-28 01:45:45 +01:00
* Takes an object in the same format returned by parse ( ) and builds a URI .
2018-01-17 13:24:35 +01:00
*
2018-01-28 01:45:45 +01:00
* The channelName key will accept names with or without the @ prefix .
2018-01-17 13:24:35 +01:00
* /
2018-01-28 01:45:45 +01:00
function buildURI ( URIObj ) {
var includeProto = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : true ;
var claimId = URIObj . claimId ,
claimSequence = URIObj . claimSequence ,
bidPosition = URIObj . bidPosition ,
contentName = URIObj . contentName ,
channelName = URIObj . channelName ;
var name = URIObj . name ,
path = URIObj . path ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( channelName ) {
var channelNameFormatted = channelName . startsWith ( '@' ) ? channelName : '@' + channelName ;
if ( ! name ) {
name = channelNameFormatted ;
} else if ( name !== channelNameFormatted ) {
throw new Error ( _ _ ( 'Received a channel content URI, but name and channelName do not match. "name" represents the value in the name position of the URI (lbry://name...), which for channel content will be the channel name. In most cases, to construct a channel URI you should just pass channelName and contentName.' ) ) ;
2018-01-17 06:28:01 +01:00
}
2018-01-28 01:45:45 +01:00
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( contentName ) {
if ( ! name ) {
name = contentName ;
} else if ( ! path ) {
path = contentName ;
2018-01-17 13:24:35 +01:00
}
2018-01-28 01:45:45 +01:00
if ( path && path !== contentName ) {
throw new Error ( _ _ ( 'Path and contentName do not match. Only one is required; most likely you wanted contentName.' ) ) ;
2018-01-17 13:24:35 +01:00
}
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return ( includeProto ? 'lbry://' : '' ) + name + ( claimId ? '#' + claimId : '' ) + ( claimSequence ? ':' + claimSequence : '' ) + ( bidPosition ? '' + bidPosition : '' ) + ( path ? '/' + path : '' ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
/* Takes a parseable LBRY URI and converts it to standard, canonical format */
function normalizeURI ( URI ) {
if ( URI . match ( /pending_claim/ ) ) return URI ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _parseURI = parseURI ( URI ) ,
name = _parseURI . name ,
path = _parseURI . path ,
bidPosition = _parseURI . bidPosition ,
claimSequence = _parseURI . claimSequence ,
claimId = _parseURI . claimId ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return buildURI ( { name : name , path : path , claimSequence : claimSequence , bidPosition : bidPosition , claimId : claimId } ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function isURIValid ( URI ) {
var parts = void 0 ;
try {
parts = parseURI ( normalizeURI ( URI ) ) ;
} catch ( error ) {
return false ;
}
return parts && parts . name ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function isNameValid ( name ) {
var checkCase = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : true ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var regexp = new RegExp ( '^[a-z0-9-]+$' , checkCase ? '' : 'i' ) ;
return regexp . test ( name ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function isURIClaimable ( URI ) {
var parts = void 0 ;
try {
parts = parseURI ( normalizeURI ( URI ) ) ;
} catch ( error ) {
return false ;
2018-01-17 13:24:35 +01:00
}
2018-01-28 01:45:45 +01:00
return parts && parts . name && ! parts . claimId && ! parts . bidPosition && ! parts . claimSequence && ! parts . isChannel && ! parts . path ;
}
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-19 11:48:43 +01:00
/* 4 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-28 01:45:45 +01:00
exports . makeSelectIsUriResolving = exports . selectResolvingUris = exports . selectMyChannelClaims = exports . selectFetchingMyChannels = exports . selectMyClaimsOutpoints = exports . selectAllMyClaimsByOutpoint = exports . selectMyClaimsWithoutChannels = exports . selectMyClaims = exports . selectPendingClaims = exports . selectIsFetchingClaimListMine = exports . makeSelectContentTypeForUri = exports . makeSelectTitleForUri = exports . makeSelectMetadataForUri = exports . makeSelectClaimsInChannelForCurrentPage = exports . makeSelectFetchingChannelClaims = exports . selectAllFetchingChannelClaims = exports . makeSelectClaimIsMine = exports . selectMyActiveClaims = exports . selectAbandoningIds = exports . selectMyClaimsRaw = exports . makeSelectClaimForUri = exports . selectAllClaimsByChannel = exports . selectClaimsByUri = exports . selectClaimsById = undefined ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _navigation = _ _webpack _require _ _ ( 1 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectState = function selectState ( state ) {
return state . claims || { } ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectClaimsById = exports . selectClaimsById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byId || { } ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectClaimsByUri = exports . selectClaimsByUri = ( 0 , _reselect . createSelector ) ( selectState , selectClaimsById , function ( state , byId ) {
var byUri = state . claimsByUri || { } ;
var claims = { } ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Object . keys ( byUri ) . forEach ( function ( uri ) {
var claimId = byUri [ uri ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
// NOTE returning a null claim allows us to differentiate between an
// undefined (never fetched claim) and one which just doesn't exist. Not
// the cleanest solution but couldn't think of anything better right now
if ( claimId === null ) {
claims [ uri ] = null ;
} else {
claims [ uri ] = byId [ claimId ] ;
}
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return claims ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectAllClaimsByChannel = exports . selectAllClaimsByChannel = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . claimsByChannel || { } ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectClaimForUri = exports . makeSelectClaimForUri = function makeSelectClaimForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectClaimsByUri , function ( claims ) {
return claims && claims [ ( 0 , _lbryURI . normalizeURI ) ( uri ) ] ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectMyClaimsRaw = exports . selectMyClaimsRaw = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . myClaims ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectAbandoningIds = exports . selectAbandoningIds = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return Object . keys ( state . abandoningById || { } ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectMyActiveClaims = exports . selectMyActiveClaims = ( 0 , _reselect . createSelector ) ( selectMyClaimsRaw , selectAbandoningIds , function ( claims , abandoningIds ) {
return new Set ( claims && claims . map ( function ( claim ) {
return claim . claim _id ;
} ) . filter ( function ( claimId ) {
return Object . keys ( abandoningIds ) . indexOf ( claimId ) === - 1 ;
} ) ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectClaimIsMine = exports . makeSelectClaimIsMine = function makeSelectClaimIsMine ( rawUri ) {
var uri = ( 0 , _lbryURI . normalizeURI ) ( rawUri ) ;
return ( 0 , _reselect . createSelector ) ( selectClaimsByUri , selectMyActiveClaims , function ( claims , myClaims ) {
return claims && claims [ uri ] && claims [ uri ] . claim _id && myClaims . has ( claims [ uri ] . claim _id ) ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectAllFetchingChannelClaims = exports . selectAllFetchingChannelClaims = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingChannelClaims || { } ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectFetchingChannelClaims = exports . makeSelectFetchingChannelClaims = function makeSelectFetchingChannelClaims ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectAllFetchingChannelClaims , function ( fetching ) {
return fetching && fetching [ uri ] ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectClaimsInChannelForCurrentPage = exports . makeSelectClaimsInChannelForCurrentPage = function makeSelectClaimsInChannelForCurrentPage ( uri ) {
var pageSelector = ( 0 , _navigation . makeSelectCurrentParam ) ( 'page' ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return ( 0 , _reselect . createSelector ) ( selectClaimsById , selectAllClaimsByChannel , pageSelector , function ( byId , allClaims , page ) {
var byChannel = allClaims [ uri ] || { } ;
var claimIds = byChannel [ page || 1 ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( ! claimIds ) return claimIds ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return claimIds . map ( function ( claimId ) {
return byId [ claimId ] ;
} ) ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectMetadataForUri = exports . makeSelectMetadataForUri = function makeSelectMetadataForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , function ( claim ) {
var metadata = claim && claim . value && claim . value . stream && claim . value . stream . metadata ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return metadata || ( claim === undefined ? undefined : null ) ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectTitleForUri = exports . makeSelectTitleForUri = function makeSelectTitleForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectMetadataForUri ( uri ) , function ( metadata ) {
return metadata && metadata . title ;
} ) ;
2018-01-17 13:24:35 +01:00
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var makeSelectContentTypeForUri = exports . makeSelectContentTypeForUri = function makeSelectContentTypeForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( makeSelectClaimForUri ( uri ) , function ( claim ) {
var source = claim && claim . value && claim . value . stream && claim . value . stream . source ;
return source ? source . contentType : undefined ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectIsFetchingClaimListMine = exports . selectIsFetchingClaimListMine = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . isFetchingClaimListMine ;
} ) ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
var selectPendingClaims = exports . selectPendingClaims = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return Object . values ( state . pendingById || { } ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectMyClaims = exports . selectMyClaims = ( 0 , _reselect . createSelector ) ( selectMyActiveClaims , selectClaimsById , selectAbandoningIds , selectPendingClaims , function ( myClaimIds , byId , abandoningIds , pendingClaims ) {
var claims = [ ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
myClaimIds . forEach ( function ( id ) {
var claim = byId [ id ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( claim && abandoningIds . indexOf ( id ) === - 1 ) claims . push ( claim ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return [ ] . concat ( claims , _toConsumableArray ( pendingClaims ) ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectMyClaimsWithoutChannels = exports . selectMyClaimsWithoutChannels = ( 0 , _reselect . createSelector ) ( selectMyClaims , function ( myClaims ) {
return myClaims . filter ( function ( claim ) {
return ! claim . name . match ( /^@/ ) ;
} ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectAllMyClaimsByOutpoint = exports . selectAllMyClaimsByOutpoint = ( 0 , _reselect . createSelector ) ( selectMyClaimsRaw , function ( claims ) {
return new Set ( claims && claims . length ? claims . map ( function ( claim ) {
return claim . txid + ':' + claim . nout ;
} ) : null ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectMyClaimsOutpoints = exports . selectMyClaimsOutpoints = ( 0 , _reselect . createSelector ) ( selectMyClaims , function ( myClaims ) {
var outpoints = [ ] ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
myClaims . forEach ( function ( claim ) {
return outpoints . push ( claim . txid + ':' + claim . nout ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return outpoints ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var selectFetchingMyChannels = exports . selectFetchingMyChannels = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingMyChannels ;
} ) ;
var selectMyChannelClaims = exports . selectMyChannelClaims = ( 0 , _reselect . createSelector ) ( selectState , selectClaimsById , function ( state , byId ) {
var ids = state . myChannelClaims || [ ] ;
var claims = [ ] ;
ids . forEach ( function ( id ) {
if ( byId [ id ] ) {
// I'm not sure why this check is necessary, but it ought to be a quick fix for https://github.com/lbryio/lbry-app/issues/544
claims . push ( byId [ id ] ) ;
}
} ) ;
return claims ;
} ) ;
var selectResolvingUris = exports . selectResolvingUris = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . resolvingUris || [ ] ;
} ) ;
var makeSelectIsUriResolving = exports . makeSelectIsUriResolving = function makeSelectIsUriResolving ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectResolvingUris , function ( resolvingUris ) {
return resolvingUris && resolvingUris . indexOf ( uri ) !== - 1 ;
} ) ;
} ;
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-19 11:48:43 +01:00
/* 5 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-28 01:45:45 +01:00
var _jsonrpc = _ _webpack _require _ _ ( 16 ) ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
var _jsonrpc2 = _interopRequireDefault ( _jsonrpc ) ;
2018-01-17 06:28:01 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
2018-01-28 01:45:45 +01:00
var CHECK _DAEMON _STARTED _TRY _NUMBER = 200 ;
var Lbry = {
isConnected : false ,
daemonConnectionString : 'http://localhost:5279' ,
pendingPublishTimeout : 20 * 60 * 1000
2018-01-17 13:24:35 +01:00
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function apiCall ( method , params , resolve , reject ) {
return _jsonrpc2 . default . call ( Lbry . daemonConnectionString , method , params , resolve , reject , reject ) ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
function getLocal ( key ) {
var fallback = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : undefined ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
var itemRaw = localStorage . getItem ( key ) ;
return itemRaw === null ? fallback : JSON . parse ( itemRaw ) ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
function setLocal ( key , value ) {
localStorage . setItem ( key , JSON . stringify ( value ) ) ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
/ * *
* Records a publish attempt in local storage . Returns a dictionary with all the data needed to
* needed to make a dummy claim or file info object .
* /
var pendingId = 0 ;
function savePendingPublish ( _ref ) {
var name = _ref . name ,
channelName = _ref . channelName ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
pendingId += 1 ;
var pendingPublishes = getLocal ( 'pendingPublishes' ) || [ ] ;
var newPendingPublish = {
name : name ,
channelName : channelName ,
claim _id : 'pending-' + pendingId ,
txid : 'pending-' + pendingId ,
nout : 0 ,
outpoint : 'pending-' + pendingId + ':0' ,
time : Date . now ( )
} ;
setLocal ( 'pendingPublishes' , [ ] . concat ( _toConsumableArray ( pendingPublishes ) , [ newPendingPublish ] ) ) ;
return newPendingPublish ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
/ * *
* If there is a pending publish with the given name or outpoint , remove it .
* A channel name may also be provided along with name .
* /
function removePendingPublishIfNeeded ( _ref2 ) {
var name = _ref2 . name ,
channelName = _ref2 . channelName ,
outpoint = _ref2 . outpoint ;
function pubMatches ( pub ) {
return pub . outpoint === outpoint || pub . name === name && ( ! channelName || pub . channel _name === channelName ) ;
}
setLocal ( 'pendingPublishes' , Lbry . getPendingPublishes ( ) . filter ( function ( pub ) {
return ! pubMatches ( pub ) ;
} ) ) ;
}
/ * *
* Gets the current list of pending publish attempts . Filters out any that have timed out and
* removes them from the list .
* /
Lbry . getPendingPublishes = function ( ) {
var pendingPublishes = getLocal ( 'pendingPublishes' ) || [ ] ;
var newPendingPublishes = pendingPublishes . filter ( function ( pub ) {
return Date . now ( ) - pub . time <= Lbry . pendingPublishTimeout ;
2018-01-17 13:24:35 +01:00
} ) ;
2018-01-28 01:45:45 +01:00
setLocal ( 'pendingPublishes' , newPendingPublishes ) ;
return newPendingPublishes ;
2018-01-17 06:28:01 +01:00
} ;
2018-01-28 01:45:45 +01:00
/ * *
* Gets a pending publish attempt by its name or ( fake ) outpoint . A channel name can also be
* provided along withe the name . If no pending publish is found , returns null .
* /
function getPendingPublish ( _ref3 ) {
var name = _ref3 . name ,
channelName = _ref3 . channelName ,
outpoint = _ref3 . outpoint ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var pendingPublishes = Lbry . getPendingPublishes ( ) ;
return pendingPublishes . find ( function ( pub ) {
return pub . outpoint === outpoint || pub . name === name && ( ! channelName || pub . channel _name === channelName ) ;
} ) || null ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function pendingPublishToDummyClaim ( _ref4 ) {
var channelName = _ref4 . channelName ,
name = _ref4 . name ,
outpoint = _ref4 . outpoint ,
claimId = _ref4 . claimId ,
txid = _ref4 . txid ,
nout = _ref4 . nout ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return { name : name , outpoint : outpoint , claimId : claimId , txid : txid , nout : nout , channelName : channelName } ;
}
function pendingPublishToDummyFileInfo ( _ref5 ) {
var name = _ref5 . name ,
outpoint = _ref5 . outpoint ,
claimId = _ref5 . claimId ;
return { name : name , outpoint : outpoint , claimId : claimId , metadata : null } ;
}
// core
Lbry . connectPromise = null ;
Lbry . connect = function ( ) {
if ( Lbry . connectPromise === null ) {
Lbry . connectPromise = new Promise ( function ( resolve , reject ) {
var tryNum = 0 ;
// Check every half second to see if the daemon is accepting connections
function checkDaemonStarted ( ) {
tryNum += 1 ;
// eslint-disable-next-line no-use-before-define
lbryProxy . status ( ) . then ( resolve ) . catch ( function ( ) {
if ( tryNum <= CHECK _DAEMON _STARTED _TRY _NUMBER ) {
setTimeout ( checkDaemonStarted , tryNum < 50 ? 400 : 1000 ) ;
} else {
reject ( new Error ( 'Unable to connect to LBRY' ) ) ;
}
} ) ;
}
checkDaemonStarted ( ) ;
} ) ;
}
return Lbry . connectPromise ;
} ;
/ * *
* Publishes a file . The optional fileListedCallback is called when the file becomes available in
* lbry . file _list ( ) during the publish process .
*
* This currently includes a work - around to cache the file in local storage so that the pending
* publish can appear in the UI immediately .
* /
Lbry . publishDeprecated = function ( params , fileListedCallback , publishedCallback , errorCallback ) {
// Give a short grace period in case publish() returns right away or (more likely) gives an error
var returnPendingTimeout = setTimeout ( function ( ) {
var name = params . name ,
channelName = params . channel _name ;
if ( publishedCallback || fileListedCallback ) {
savePendingPublish ( {
name : name ,
channelName : channelName
} ) ;
publishedCallback ( true ) ;
}
} , 2000 , { once : true } ) ;
// eslint-disable-next-line no-use-before-define
lbryProxy . publish ( params ) . then ( function ( result ) {
if ( returnPendingTimeout ) clearTimeout ( returnPendingTimeout ) ;
publishedCallback ( result ) ;
} , function ( err ) {
if ( returnPendingTimeout ) clearTimeout ( returnPendingTimeout ) ;
errorCallback ( err ) ;
2018-01-17 13:24:35 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Lbry . getMediaType = function ( contentType , fileName ) {
if ( contentType ) {
return ( /^[^/]+/ . exec ( contentType ) [ 0 ]
) ;
} else if ( fileName ) {
var dotIndex = fileName . lastIndexOf ( '.' ) ;
if ( dotIndex === - 1 ) {
return 'unknown' ;
}
var ext = fileName . substr ( dotIndex + 1 ) ;
if ( /^mp4|m4v|webm|flv|f4v|ogv$/i . test ( ext ) ) {
return 'video' ;
} else if ( /^mp3|m4a|aac|wav|flac|ogg|opus$/i . test ( ext ) ) {
return 'audio' ;
} else if ( /^html|htm|xml|pdf|odf|doc|docx|md|markdown|txt|epub|org$/i . test ( ext ) ) {
return 'document' ;
}
return 'unknown' ;
}
return 'unknown' ;
} ;
/ * *
* Wrappers for API methods to simulate missing or future behavior . Unlike the old - style stubs ,
* these are designed to be transparent wrappers around the corresponding API methods .
* /
/ * *
* Returns results from the file _list API method , plus dummy entries for pending publishes .
* ( If a real publish with the same name is found , the pending publish will be ignored and removed . )
* /
Lbry . file _list = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
var name = params . name ,
channelName = params . channel _name ,
outpoint = params . outpoint ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
/ * *
* If we 're searching by outpoint, check first to see if there' s a matching pending publish .
* Pending publishes use their own faux outpoints that are always unique , so we don ' t need
* to check if there ' s a real file .
* /
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
if ( outpoint ) {
var pendingPublish = getPendingPublish ( { outpoint : outpoint } ) ;
if ( pendingPublish ) {
resolve ( [ pendingPublishToDummyFileInfo ( pendingPublish ) ] ) ;
return ;
}
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
apiCall ( 'file_list' , params , function ( fileInfos ) {
removePendingPublishIfNeeded ( { name : name , channelName : channelName , outpoint : outpoint } ) ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
// if a naked file_list call, append the pending file infos
if ( ! name && ! channelName && ! outpoint ) {
var dummyFileInfos = Lbry . getPendingPublishes ( ) . map ( pendingPublishToDummyFileInfo ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
resolve ( [ ] . concat ( _toConsumableArray ( fileInfos ) , _toConsumableArray ( dummyFileInfos ) ) ) ;
} else {
resolve ( fileInfos ) ;
}
} , reject ) ;
2018-01-17 13:24:35 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Lbry . claim _list _mine = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'claim_list_mine' , params , function ( claims ) {
claims . forEach ( function ( _ref6 ) {
var name = _ref6 . name ,
channelName = _ref6 . channel _name ,
txid = _ref6 . txid ,
nout = _ref6 . nout ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
removePendingPublishIfNeeded ( {
name : name ,
channelName : channelName ,
outpoint : txid + ':' + nout
} ) ;
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var dummyClaims = Lbry . getPendingPublishes ( ) . map ( pendingPublishToDummyClaim ) ;
resolve ( [ ] . concat ( _toConsumableArray ( claims ) , _toConsumableArray ( dummyClaims ) ) ) ;
} , reject ) ;
2018-01-17 13:24:35 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Lbry . resolve = function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( 'resolve' , params , function ( data ) {
if ( 'uri' in params ) {
// If only a single URI was requested, don't nest the results in an object
resolve ( data && data [ params . uri ] ? data [ params . uri ] : { } ) ;
} else {
resolve ( data || { } ) ;
}
} , reject ) ;
2018-01-17 06:28:01 +01:00
} ) ;
} ;
2018-01-28 01:45:45 +01:00
var lbryProxy = new Proxy ( Lbry , {
get : function get ( target , name ) {
if ( name in target ) {
return target [ name ] ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return function ( ) {
var params = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : { } ;
return new Promise ( function ( resolve , reject ) {
apiCall ( name , params , resolve , reject ) ;
} ) ;
} ;
}
2018-01-17 13:24:35 +01:00
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
exports . default = lbryProxy ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
/***/ } ) ,
/* 6 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
"use strict" ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
2018-01-17 13:24:35 +01:00
} ) ;
2018-01-28 01:45:45 +01:00
exports . doOpenModal = doOpenModal ;
exports . doCloseModal = doCloseModal ;
exports . doShowSnackBar = doShowSnackBar ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
function doOpenModal ( modal ) {
var modalProps = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
return {
type : ACTIONS . OPEN _MODAL ,
data : {
modal : modal ,
modalProps : modalProps
2018-01-17 06:28:01 +01:00
}
2018-01-28 01:45:45 +01:00
} ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
function doCloseModal ( ) {
return {
type : ACTIONS . CLOSE _MODAL
} ;
}
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
function doShowSnackBar ( data ) {
return {
type : ACTIONS . SHOW _SNACKBAR ,
data : data
} ;
}
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 7 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _slicedToArray = function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
exports . doResolveUris = doResolveUris ;
exports . doResolveUri = doResolveUri ;
exports . doFetchClaimListMine = doFetchClaimListMine ;
exports . doAbandonClaim = doAbandonClaim ;
var _action _types = _ _webpack _require _ _ ( 0 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-28 01:45:45 +01:00
var _modal _types = _ _webpack _require _ _ ( 10 ) ;
var MODALS = _interopRequireWildcard ( _modal _types ) ;
var _lbry = _ _webpack _require _ _ ( 5 ) ;
2018-01-17 06:28:01 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-01-28 01:45:45 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _app = _ _webpack _require _ _ ( 6 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 4 ) ;
2018-01-17 06:28:01 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
function doResolveUris ( uris ) {
return function ( dispatch , getState ) {
2018-01-28 01:45:45 +01:00
var normalizedUris = uris . map ( _lbryURI . normalizeURI ) ;
2018-01-17 06:28:01 +01:00
var state = getState ( ) ;
// Filter out URIs that are already resolving
var resolvingUris = ( 0 , _claims . selectResolvingUris ) ( state ) ;
var urisToResolve = normalizedUris . filter ( function ( uri ) {
return ! resolvingUris . includes ( uri ) ;
} ) ;
if ( urisToResolve . length === 0 ) {
return ;
}
dispatch ( {
type : ACTIONS . RESOLVE _URIS _STARTED ,
data : { uris : normalizedUris }
} ) ;
var resolveInfo = { } ;
_lbry2 . default . resolve ( { uris : urisToResolve } ) . then ( function ( result ) {
Object . entries ( result ) . forEach ( function ( _ref ) {
var _ref2 = _slicedToArray ( _ref , 2 ) ,
uri = _ref2 [ 0 ] ,
uriResolveInfo = _ref2 [ 1 ] ;
var fallbackResolveInfo = {
claim : null ,
claimsInChannel : null ,
certificate : null
} ;
var _ref3 = uriResolveInfo && ! uriResolveInfo . error ? uriResolveInfo : fallbackResolveInfo ,
claim = _ref3 . claim ,
certificate = _ref3 . certificate ,
claimsInChannel = _ref3 . claims _in _channel ;
resolveInfo [ uri ] = { claim : claim , certificate : certificate , claimsInChannel : claimsInChannel } ;
} ) ;
dispatch ( {
type : ACTIONS . RESOLVE _URIS _COMPLETED ,
data : { resolveInfo : resolveInfo }
} ) ;
} ) ;
} ;
}
function doResolveUri ( uri ) {
return doResolveUris ( [ uri ] ) ;
}
function doFetchClaimListMine ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . FETCH _CLAIM _LIST _MINE _STARTED
} ) ;
_lbry2 . default . claim _list _mine ( ) . then ( function ( claims ) {
dispatch ( {
type : ACTIONS . FETCH _CLAIM _LIST _MINE _COMPLETED ,
data : {
claims : claims
}
} ) ;
} ) ;
} ;
}
function doAbandonClaim ( txid , nout ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
2018-01-28 01:45:45 +01:00
var myClaims = ( 0 , _claims . selectMyClaimsRaw ) ( state ) ;
2018-01-17 06:28:01 +01:00
var _myClaims$find = myClaims . find ( function ( claim ) {
return claim . txid === txid && claim . nout === nout ;
} ) ,
claimId = _myClaims$find . claim _id ,
name = _myClaims$find . name ;
dispatch ( {
type : ACTIONS . ABANDON _CLAIM _STARTED ,
data : {
claimId : claimId
}
} ) ;
var errorCallback = function errorCallback ( ) {
2018-01-28 01:45:45 +01:00
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
2018-01-17 06:28:01 +01:00
} ;
var successCallback = function successCallback ( results ) {
if ( results . txid ) {
dispatch ( {
type : ACTIONS . ABANDON _CLAIM _SUCCEEDED ,
data : {
claimId : claimId
}
} ) ;
2018-01-28 01:45:45 +01:00
dispatch ( doResolveUri ( ( 0 , _lbryURI . buildURI ) ( { name : name , claimId : claimId } ) ) ) ;
2018-01-17 06:28:01 +01:00
dispatch ( doFetchClaimListMine ( ) ) ;
} else {
2018-01-28 01:45:45 +01:00
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
2018-01-17 06:28:01 +01:00
}
} ;
_lbry2 . default . claim _abandon ( {
txid : txid ,
nout : nout
} ) . then ( successCallback , errorCallback ) ;
} ;
}
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 8 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-19 11:48:43 +01:00
var _slicedToArray = function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
exports . parseQueryParams = parseQueryParams ;
exports . toQueryString = toQueryString ;
function parseQueryParams ( queryString ) {
if ( queryString === '' ) return { } ;
var parts = queryString . split ( '?' ) . pop ( ) . split ( '&' ) . map ( function ( p ) {
return p . split ( '=' ) ;
} ) ;
var params = { } ;
parts . forEach ( function ( array ) {
var _array = _slicedToArray ( array , 2 ) ,
first = _array [ 0 ] ,
second = _array [ 1 ] ;
params [ first ] = second ;
} ) ;
return params ;
}
function toQueryString ( params ) {
if ( ! params ) return '' ;
var parts = [ ] ;
Object . keys ( params ) . forEach ( function ( key ) {
if ( Object . prototype . hasOwnProperty . call ( params , key ) && params [ key ] ) {
parts . push ( key + '=' + params [ key ] ) ;
}
} ) ;
return parts . join ( '&' ) ;
}
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 9 */
2018-01-19 11:48:43 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doNavigate = doNavigate ;
exports . doAuthNavigate = doAuthNavigate ;
exports . doHistoryTraverse = doHistoryTraverse ;
exports . doHistoryBack = doHistoryBack ;
exports . doHistoryForward = doHistoryForward ;
exports . doRecordScroll = doRecordScroll ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
var _navigation = _ _webpack _require _ _ ( 1 ) ;
2018-01-28 01:45:45 +01:00
var _query _params = _ _webpack _require _ _ ( 8 ) ;
2018-01-19 11:48:43 +01:00
2018-01-17 13:24:35 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
function doNavigate ( path ) {
var params = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
var options = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : { } ;
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
return function ( dispatch ) {
if ( ! path ) {
return ;
2018-01-17 06:28:01 +01:00
}
2018-01-19 11:48:43 +01:00
var url = path ;
if ( params && Object . values ( params ) . length ) {
url += '?' + ( 0 , _query _params . toQueryString ) ( params ) ;
}
var scrollY = options . scrollY ;
dispatch ( {
type : ACTIONS . HISTORY _NAVIGATE ,
data : { url : url , index : options . index , scrollY : scrollY }
} ) ;
2018-01-17 13:24:35 +01:00
} ;
2018-01-17 06:28:01 +01:00
}
2018-01-19 11:48:43 +01:00
function doAuthNavigate ( ) {
var pathAfterAuth = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : null ;
var params = arguments . length > 1 && arguments [ 1 ] !== undefined ? arguments [ 1 ] : { } ;
return function ( dispatch ) {
if ( pathAfterAuth ) {
dispatch ( {
type : ACTIONS . CHANGE _AFTER _AUTH _PATH ,
data : {
path : pathAfterAuth + '?' + ( 0 , _query _params . toQueryString ) ( params )
}
} ) ;
}
dispatch ( doNavigate ( '/auth' ) ) ;
2018-01-17 13:24:35 +01:00
} ;
}
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
function doHistoryTraverse ( dispatch , state , modifier ) {
var stack = ( 0 , _navigation . selectHistoryStack ) ( state ) ;
var index = ( 0 , _navigation . selectHistoryIndex ) ( state ) + modifier ;
if ( index >= 0 && index < stack . length ) {
var historyItem = stack [ index ] ;
dispatch ( doNavigate ( historyItem . path , { } , { scrollY : historyItem . scrollY , index : index } ) ) ;
}
}
function doHistoryBack ( ) {
return function ( dispatch , getState ) {
return doHistoryTraverse ( dispatch , getState ( ) , - 1 ) ;
} ;
}
function doHistoryForward ( ) {
return function ( dispatch , getState ) {
return doHistoryTraverse ( dispatch , getState ( ) , 1 ) ;
} ;
}
function doRecordScroll ( scroll ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . WINDOW _SCROLLED ,
data : { scrollY : scroll }
} ) ;
2018-01-17 13:24:35 +01:00
} ;
}
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 10 */
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var CONFIRM _FILE _REMOVE = exports . CONFIRM _FILE _REMOVE = 'confirmFileRemove' ;
var INCOMPATIBLE _DAEMON = exports . INCOMPATIBLE _DAEMON = 'incompatibleDaemon' ;
var FILE _TIMEOUT = exports . FILE _TIMEOUT = 'file_timeout' ;
var DOWNLOADING = exports . DOWNLOADING = 'downloading' ;
var ERROR = exports . ERROR = 'error' ;
var INSUFFICIENT _CREDITS = exports . INSUFFICIENT _CREDITS = 'insufficient_credits' ;
var UPGRADE = exports . UPGRADE = 'upgrade' ;
var WELCOME = exports . WELCOME = 'welcome' ;
var EMAIL _COLLECTION = exports . EMAIL _COLLECTION = 'email_collection' ;
var FIRST _REWARD = exports . FIRST _REWARD = 'first_reward' ;
var AUTHENTICATION _FAILURE = exports . AUTHENTICATION _FAILURE = 'auth_failure' ;
var TRANSACTION _FAILED = exports . TRANSACTION _FAILED = 'transaction_failed' ;
var REWARD _APPROVAL _REQUIRED = exports . REWARD _APPROVAL _REQUIRED = 'reward_approval_required' ;
var AFFIRM _PURCHASE = exports . AFFIRM _PURCHASE = 'affirm_purchase' ;
var CONFIRM _CLAIM _REVOKE = exports . CONFIRM _CLAIM _REVOKE = 'confirmClaimRevoke' ;
/***/ } ) ,
/* 11 */
2018-01-17 13:24:35 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
"use strict" ;
2018-01-28 01:45:45 +01:00
/* WEBPACK VAR INJECTION */ ( function ( process ) {
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var _extends = Object . assign || function ( target ) { for ( var i = 1 ; i < arguments . length ; i ++ ) { var source = arguments [ i ] ; for ( var key in source ) { if ( Object . prototype . hasOwnProperty . call ( source , key ) ) { target [ key ] = source [ key ] ; } } } return target ; } ;
var _querystring = _ _webpack _require _ _ ( 19 ) ;
var _querystring2 = _interopRequireDefault ( _querystring ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
var Lbryapi = {
enabled : true ,
exchangePromise : null ,
exchangeLastFetched : null
} ;
var CONNECTION _STRING = process . env . LBRY _APP _API _URL ? process . env . LBRY _APP _API _URL . replace ( /\/*$/ , '/' ) // exactly one slash at the end
: 'https://api.lbry.io/' ;
var EXCHANGE _RATE _TIMEOUT = 20 * 60 * 1000 ;
Lbryapi . getExchangeRates = function ( ) {
if ( ! Lbryapi . exchangeLastFetched || Date . now ( ) - Lbryapi . exchangeLastFetched > EXCHANGE _RATE _TIMEOUT ) {
Lbryapi . exchangePromise = new Promise ( function ( resolve , reject ) {
Lbryapi . call ( 'lbc' , 'exchange_rate' , { } , 'get' , true ) . then ( function ( _ref ) {
var LBC _USD = _ref . lbc _usd ,
LBC _BTC = _ref . lbc _btc ,
BTC _USD = _ref . btc _usd ;
var rates = { LBC _USD : LBC _USD , LBC _BTC : LBC _BTC , BTC _USD : BTC _USD } ;
resolve ( rates ) ;
} ) . catch ( reject ) ;
} ) ;
Lbryapi . exchangeLastFetched = Date . now ( ) ;
}
return Lbryapi . exchangePromise ;
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
Lbryapi . call = function ( resource , action ) {
var params = arguments . length > 2 && arguments [ 2 ] !== undefined ? arguments [ 2 ] : { } ;
var method = arguments . length > 3 && arguments [ 3 ] !== undefined ? arguments [ 3 ] : 'get' ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( ! Lbryapi . enabled ) {
return Promise . reject ( new Error ( _ _ ( 'LBRY internal API is disabled' ) ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( ! ( method === 'get' || method === 'post' ) ) {
return Promise . reject ( new Error ( _ _ ( 'Invalid method' ) ) ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function checkAndParse ( response ) {
if ( response . status >= 200 && response . status < 300 ) {
return response . json ( ) ;
}
return response . json ( ) . then ( function ( json ) {
var error = void 0 ;
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Unknown API error signature' ) ;
}
error . response = response ; // This is primarily a hack used in actions/user.js
return Promise . reject ( error ) ;
} ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
function makeRequest ( url , options ) {
return fetch ( url , options ) . then ( checkAndParse ) ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var fullParams = _extends ( { } , params ) ;
var qs = _querystring2 . default . stringify ( fullParams ) ;
var url = '' + CONNECTION _STRING + resource + '/' + action + '?' + qs ;
2018-01-19 11:48:43 +01:00
2018-01-28 01:45:45 +01:00
var options = {
method : 'GET'
2018-01-19 11:48:43 +01:00
} ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
if ( method === 'post' ) {
options = {
method : 'POST' ,
headers : {
'Content-Type' : 'application/x-www-form-urlencoded'
} ,
body : qs
} ;
url = '' + CONNECTION _STRING + resource + '/' + action ;
}
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
return makeRequest ( url , options ) . then ( function ( response ) {
return response . data ;
} ) ;
} ;
exports . default = Lbryapi ;
/* WEBPACK VAR INJECTION */ } . call ( exports , _ _webpack _require _ _ ( 18 ) ) )
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 12 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . selectTotalDownloadProgress = exports . selectDownloadingFileInfos = exports . selectFileInfosDownloaded = exports . makeSelectLoadingForUri = exports . selectUrisLoading = exports . makeSelectDownloadingForUri = exports . selectDownloadingByOutpoint = exports . makeSelectFileInfoForUri = exports . selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileList = exports . selectFileInfosByOutpoint = exports . selectState = undefined ;
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 4 ) ;
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-17 06:28:01 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . fileInfo || { } ;
} ;
var selectFileInfosByOutpoint = exports . selectFileInfosByOutpoint = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byOutpoint || { } ;
} ) ;
var selectIsFetchingFileList = exports . selectIsFetchingFileList = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . isFetchingFileList ;
} ) ;
var selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileListDownloadedOrPublished = ( 0 , _reselect . createSelector ) ( selectIsFetchingFileList , _claims . selectIsFetchingClaimListMine , function ( isFetchingFileList , isFetchingClaimListMine ) {
return isFetchingFileList || isFetchingClaimListMine ;
} ) ;
var makeSelectFileInfoForUri = exports . makeSelectFileInfoForUri = function makeSelectFileInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( _claims . selectClaimsByUri , selectFileInfosByOutpoint , function ( claims , byOutpoint ) {
var claim = claims [ uri ] ;
var outpoint = claim ? claim . txid + ':' + claim . nout : undefined ;
return outpoint ? byOutpoint [ outpoint ] : undefined ;
} ) ;
} ;
var selectDownloadingByOutpoint = exports . selectDownloadingByOutpoint = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . downloadingByOutpoint || { } ;
} ) ;
var makeSelectDownloadingForUri = exports . makeSelectDownloadingForUri = function makeSelectDownloadingForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectDownloadingByOutpoint , makeSelectFileInfoForUri ( uri ) , function ( byOutpoint , fileInfo ) {
if ( ! fileInfo ) return false ;
return byOutpoint [ fileInfo . outpoint ] ;
} ) ;
} ;
var selectUrisLoading = exports . selectUrisLoading = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . urisLoading || { } ;
} ) ;
var makeSelectLoadingForUri = exports . makeSelectLoadingForUri = function makeSelectLoadingForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectUrisLoading , function ( byUri ) {
return byUri && byUri [ uri ] ;
} ) ;
} ;
var selectFileInfosDownloaded = exports . selectFileInfosDownloaded = ( 0 , _reselect . createSelector ) ( selectFileInfosByOutpoint , _claims . selectMyClaims , function ( byOutpoint , myClaims ) {
return Object . values ( byOutpoint ) . filter ( function ( fileInfo ) {
var myClaimIds = myClaims . map ( function ( claim ) {
return claim . claim _id ;
} ) ;
return fileInfo && myClaimIds . indexOf ( fileInfo . claim _id ) === - 1 && ( fileInfo . completed || fileInfo . written _bytes ) ;
} ) ;
} ) ;
// export const selectFileInfoForUri = (state, props) => {
// const claims = selectClaimsByUri(state),
// claim = claims[props.uri],
// fileInfos = selectAllFileInfos(state),
// outpoint = claim ? `${claim.txid}:${claim.nout}` : undefined;
// return outpoint && fileInfos ? fileInfos[outpoint] : undefined;
// };
var selectDownloadingFileInfos = exports . selectDownloadingFileInfos = ( 0 , _reselect . createSelector ) ( selectDownloadingByOutpoint , selectFileInfosByOutpoint , function ( downloadingByOutpoint , fileInfosByOutpoint ) {
var outpoints = Object . keys ( downloadingByOutpoint ) ;
var fileInfos = [ ] ;
outpoints . forEach ( function ( outpoint ) {
var fileInfo = fileInfosByOutpoint [ outpoint ] ;
if ( fileInfo ) fileInfos . push ( fileInfo ) ;
} ) ;
return fileInfos ;
} ) ;
var selectTotalDownloadProgress = exports . selectTotalDownloadProgress = ( 0 , _reselect . createSelector ) ( selectDownloadingFileInfos , function ( fileInfos ) {
var progress = [ ] ;
fileInfos . forEach ( function ( fileInfo ) {
progress . push ( fileInfo . written _bytes / fileInfo . total _bytes * 100 ) ;
} ) ;
var totalProgress = progress . reduce ( function ( a , b ) {
return a + b ;
} , 0 ) ;
if ( fileInfos . length > 0 ) return totalProgress / fileInfos . length / 100.0 ;
return - 1 ;
} ) ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 13 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-19 11:48:43 +01:00
exports . batchActions = batchActions ;
// https://github.com/reactjs/redux/issues/911
function batchActions ( ) {
for ( var _len = arguments . length , actions = Array ( _len ) , _key = 0 ; _key < _len ; _key ++ ) {
actions [ _key ] = arguments [ _key ] ;
2018-01-17 13:24:35 +01:00
}
2018-01-19 11:48:43 +01:00
return {
type : 'BATCH_ACTIONS' ,
actions : actions
2018-01-17 13:24:35 +01:00
} ;
}
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 14 */
2018-01-17 13:24:35 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . makeSelectBlockDate = exports . selectBlocks = exports . selectDraftTransactionError = exports . selectDraftTransactionAddress = exports . selectDraftTransactionAmount = exports . selectDraftTransaction = exports . selectGettingNewAddress = exports . selectReceiveAddress = exports . selectIsSendingSupport = exports . selectIsFetchingTransactions = exports . selectHasTransactions = exports . selectRecentTransactions = exports . selectTransactionItems = exports . selectTransactionsById = exports . selectBalance = exports . selectState = undefined ;
2018-01-19 11:48:43 +01:00
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-17 13:24:35 +01:00
function _toConsumableArray ( arr ) { if ( Array . isArray ( arr ) ) { for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) { arr2 [ i ] = arr [ i ] ; } return arr2 ; } else { return Array . from ( arr ) ; } }
var selectState = exports . selectState = function selectState ( state ) {
return state . wallet || { } ;
} ;
var selectBalance = exports . selectBalance = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . balance ;
} ) ;
var selectTransactionsById = exports . selectTransactionsById = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . transactions ;
} ) ;
var selectTransactionItems = exports . selectTransactionItems = ( 0 , _reselect . createSelector ) ( selectTransactionsById , function ( byId ) {
var items = [ ] ;
Object . keys ( byId ) . forEach ( function ( txid ) {
var tx = byId [ txid ] ;
// ignore dust/fees
// it is fee only txn if all infos are also empty
if ( Math . abs ( tx . value ) === Math . abs ( tx . fee ) && tx . claim _info . length === 0 && tx . support _info . length === 0 && tx . update _info . length === 0 ) {
return ;
}
var append = [ ] ;
append . push . apply ( append , _toConsumableArray ( tx . claim _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , {
type : item . claim _name [ 0 ] === '@' ? 'channel' : 'publish'
} ) ;
} ) ) ) ;
append . push . apply ( append , _toConsumableArray ( tx . support _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , {
type : ! item . is _tip ? 'support' : 'tip'
} ) ;
} ) ) ) ;
append . push . apply ( append , _toConsumableArray ( tx . update _info . map ( function ( item ) {
return Object . assign ( { } , tx , item , { type : 'update' } ) ;
} ) ) ) ;
if ( ! append . length ) {
append . push ( Object . assign ( { } , tx , {
type : tx . value < 0 ? 'spend' : 'receive'
} ) ) ;
}
items . push . apply ( items , _toConsumableArray ( append . map ( function ( item ) {
// value on transaction, amount on outpoint
// amount is always positive, but should match sign of value
var amount = parseFloat ( item . balance _delta ? item . balance _delta : item . value ) ;
return {
txid : txid ,
date : tx . timestamp ? new Date ( Number ( tx . timestamp ) * 1000 ) : null ,
amount : amount ,
fee : amount < 0 ? - 1 * tx . fee / append . length : 0 ,
claim _id : item . claim _id ,
claim _name : item . claim _name ,
type : item . type || 'send' ,
nout : item . nout
} ;
} ) ) ) ;
} ) ;
return items . reverse ( ) ;
} ) ;
var selectRecentTransactions = exports . selectRecentTransactions = ( 0 , _reselect . createSelector ) ( selectTransactionItems , function ( transactions ) {
var threshold = new Date ( ) ;
threshold . setDate ( threshold . getDate ( ) - 7 ) ;
return transactions . filter ( function ( transaction ) {
return transaction . date > threshold ;
} ) ;
} ) ;
var selectHasTransactions = exports . selectHasTransactions = ( 0 , _reselect . createSelector ) ( selectTransactionItems , function ( transactions ) {
return transactions && transactions . length > 0 ;
} ) ;
var selectIsFetchingTransactions = exports . selectIsFetchingTransactions = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetchingTransactions ;
} ) ;
var selectIsSendingSupport = exports . selectIsSendingSupport = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . sendingSupport ;
} ) ;
var selectReceiveAddress = exports . selectReceiveAddress = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . receiveAddress ;
} ) ;
var selectGettingNewAddress = exports . selectGettingNewAddress = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . gettingNewAddress ;
} ) ;
var selectDraftTransaction = exports . selectDraftTransaction = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . draftTransaction || { } ;
} ) ;
var selectDraftTransactionAmount = exports . selectDraftTransactionAmount = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . amount ;
} ) ;
var selectDraftTransactionAddress = exports . selectDraftTransactionAddress = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . address ;
} ) ;
var selectDraftTransactionError = exports . selectDraftTransactionError = ( 0 , _reselect . createSelector ) ( selectDraftTransaction , function ( draft ) {
return draft . error ;
} ) ;
var selectBlocks = exports . selectBlocks = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . blocks ;
} ) ;
var makeSelectBlockDate = exports . makeSelectBlockDate = function makeSelectBlockDate ( block ) {
return ( 0 , _reselect . createSelector ) ( selectBlocks , function ( blocks ) {
return blocks && blocks [ block ] ? new Date ( blocks [ block ] . time * 1000 ) : undefined ;
} ) ;
} ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 15 */
2018-01-17 13:24:35 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-28 01:45:45 +01:00
exports . selectBlocks = exports . selectDraftTransactionError = exports . selectDraftTransactionAddress = exports . selectDraftTransactionAmount = exports . selectDraftTransaction = exports . selectGettingNewAddress = exports . selectReceiveAddress = exports . selectIsSendingSupport = exports . selectIsFetchingTransactions = exports . selectHasTransactions = exports . selectRecentTransactions = exports . selectTransactionItems = exports . selectTransactionsById = exports . selectBalance = exports . makeSelectBlockDate = exports . selectWunderBarIcon = exports . selectWunderBarAddress = exports . selectSearchUrisByQuery = exports . selectIsSearching = undefined ;
exports . selectSearchQuery = exports . makeSelectSearchUris = exports . selectActiveHistoryEntry = exports . selectHistoryStack = exports . selectHistoryIndex = exports . selectIsForwardDisabled = exports . selectIsBackDisabled = exports . selectPathAfterAuth = exports . selectPageTitle = exports . selectHeaderLinks = exports . selectCurrentParams = exports . selectCurrentPage = exports . selectCurrentPath = exports . makeSelectCurrentParam = exports . computePageFromPath = exports . selectTotalDownloadProgress = exports . selectDownloadingFileInfos = exports . selectFileInfosDownloaded = exports . selectUrisLoading = exports . selectDownloadingByOutpoint = exports . selectIsFetchingFileListDownloadedOrPublished = exports . selectIsFetchingFileList = exports . selectFileInfosByOutpoint = exports . makeSelectLoadingForUri = exports . makeSelectDownloadingForUri = exports . makeSelectFileInfoForUri = exports . selectFetchingCostInfo = exports . selectCostForCurrentPageUri = exports . selectAllCostInfoByUri = exports . makeSelectCostInfoForUri = exports . makeSelectFetchingCostInfoForUri = exports . selectResolvingUris = exports . selectMyChannelClaims = exports . selectFetchingMyChannels = exports . selectMyClaimsOutpoints = exports . selectAllMyClaimsByOutpoint = exports . selectMyClaimsWithoutChannels = exports . selectMyClaims = exports . selectPendingClaims = exports . selectIsFetchingClaimListMine = exports . selectAllFetchingChannelClaims = exports . selectMyActiveClaims = exports . selectAbandoningIds = exports . selectMyClaimsRaw = exports . selectAllClaimsByChannel = exports . selectClaimsByUri = exports . selectClaimsById = exports . makeSelectIsUriResolving = exports . makeSelectContentTypeForUri = exports . makeSelectTitleForUri = exports . makeSelectMetadataForUri = exports . makeSelectClaimsInChannelForCurrentPage = exports . makeSelectFetchingChannelClaims = exports . makeSelectClaimIsMine = exports . makeSelectClaimForUri = exports . walletReducer = exports . searchReducer = exports . fileInfoReducer = exports . costInfoReducer = exports . claimsReducer = exports . toQueryString = exports . parseQueryParams = exports . batchActions = exports . doSendSupport = exports . doSetDraftTransactionAddress = exports . doSetDraftTransactionAmount = exports . doSendDraftTransaction = exports . doCheckAddressIsMine = exports . doGetNewAddress = exports . doFetchBlock = exports . doFetchTransactions = exports . doBalanceSubscribe = exports . doUpdateBalance = exports . doSearch = exports . doRecordScroll = exports . doHistoryForward = exports . doHistoryBack = exports . doHistoryTraverse = exports . doAuthNavigate = exports . doNavigate = exports . doFetchFileInfosAndPublishedClaims = exports . doFileList = exports . doFetchFileInfo = exports . doFetchCostInfoForUri = exports . doResolveUri = exports . doResolveUris = exports . doAbandonClaim = exports . doFetchClaimListMine = exports . doShowSnackBar = exports . doCloseModal = exports . doOpenModal = exports . isURIClaimable = exports . isURIValid = exports . normalizeURI = exports . buildURI = exports . parseURI = exports . regexAddress = exports . regexInvalidURI = exports . Lbryapi = exports . Lbry = undefined ;
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
Object . defineProperty ( exports , 'regexInvalidURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . regexInvalidURI ;
}
} ) ;
Object . defineProperty ( exports , 'regexAddress' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . regexAddress ;
}
} ) ;
Object . defineProperty ( exports , 'parseURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . parseURI ;
}
} ) ;
Object . defineProperty ( exports , 'buildURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . buildURI ;
}
} ) ;
Object . defineProperty ( exports , 'normalizeURI' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . normalizeURI ;
}
} ) ;
Object . defineProperty ( exports , 'isURIValid' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . isURIValid ;
}
} ) ;
Object . defineProperty ( exports , 'isURIClaimable' , {
enumerable : true ,
get : function get ( ) {
return _lbryURI . isURIClaimable ;
}
} ) ;
2018-01-17 13:24:35 +01:00
2018-01-28 01:45:45 +01:00
var _app = _ _webpack _require _ _ ( 6 ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'doOpenModal' , {
enumerable : true ,
get : function get ( ) {
return _app . doOpenModal ;
}
} ) ;
Object . defineProperty ( exports , 'doCloseModal' , {
enumerable : true ,
get : function get ( ) {
return _app . doCloseModal ;
}
} ) ;
Object . defineProperty ( exports , 'doShowSnackBar' , {
enumerable : true ,
get : function get ( ) {
return _app . doShowSnackBar ;
}
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 7 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'doFetchClaimListMine' , {
enumerable : true ,
get : function get ( ) {
return _claims . doFetchClaimListMine ;
}
} ) ;
Object . defineProperty ( exports , 'doAbandonClaim' , {
enumerable : true ,
get : function get ( ) {
return _claims . doAbandonClaim ;
}
} ) ;
Object . defineProperty ( exports , 'doResolveUris' , {
enumerable : true ,
get : function get ( ) {
return _claims . doResolveUris ;
}
} ) ;
Object . defineProperty ( exports , 'doResolveUri' , {
enumerable : true ,
get : function get ( ) {
return _claims . doResolveUri ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _cost _info = _ _webpack _require _ _ ( 17 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'doFetchCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info . doFetchCostInfoForUri ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _file _info = _ _webpack _require _ _ ( 22 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'doFetchFileInfo' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFetchFileInfo ;
}
} ) ;
Object . defineProperty ( exports , 'doFileList' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFileList ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchFileInfosAndPublishedClaims' , {
enumerable : true ,
get : function get ( ) {
return _file _info . doFetchFileInfosAndPublishedClaims ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _navigation = _ _webpack _require _ _ ( 9 ) ;
2018-01-19 11:48:43 +01:00
Object . defineProperty ( exports , 'doNavigate' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doNavigate ;
}
} ) ;
Object . defineProperty ( exports , 'doAuthNavigate' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doAuthNavigate ;
}
} ) ;
Object . defineProperty ( exports , 'doHistoryTraverse' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doHistoryTraverse ;
}
} ) ;
Object . defineProperty ( exports , 'doHistoryBack' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doHistoryBack ;
}
} ) ;
Object . defineProperty ( exports , 'doHistoryForward' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doHistoryForward ;
}
} ) ;
Object . defineProperty ( exports , 'doRecordScroll' , {
enumerable : true ,
get : function get ( ) {
return _navigation . doRecordScroll ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _search = _ _webpack _require _ _ ( 23 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'doSearch' , {
enumerable : true ,
get : function get ( ) {
return _search . doSearch ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _wallet = _ _webpack _require _ _ ( 24 ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'doUpdateBalance' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doUpdateBalance ;
}
} ) ;
Object . defineProperty ( exports , 'doBalanceSubscribe' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doBalanceSubscribe ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doFetchTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'doFetchBlock' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doFetchBlock ;
}
} ) ;
Object . defineProperty ( exports , 'doGetNewAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doGetNewAddress ;
}
} ) ;
Object . defineProperty ( exports , 'doCheckAddressIsMine' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doCheckAddressIsMine ;
}
} ) ;
Object . defineProperty ( exports , 'doSendDraftTransaction' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSendDraftTransaction ;
}
} ) ;
Object . defineProperty ( exports , 'doSetDraftTransactionAmount' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSetDraftTransactionAmount ;
}
} ) ;
Object . defineProperty ( exports , 'doSetDraftTransactionAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSetDraftTransactionAddress ;
}
} ) ;
Object . defineProperty ( exports , 'doSendSupport' , {
enumerable : true ,
get : function get ( ) {
return _wallet . doSendSupport ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _batchActions = _ _webpack _require _ _ ( 13 ) ;
2018-01-19 11:48:43 +01:00
Object . defineProperty ( exports , 'batchActions' , {
enumerable : true ,
get : function get ( ) {
return _batchActions . batchActions ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _query _params = _ _webpack _require _ _ ( 8 ) ;
2018-01-19 11:48:43 +01:00
Object . defineProperty ( exports , 'parseQueryParams' , {
enumerable : true ,
get : function get ( ) {
return _query _params . parseQueryParams ;
}
} ) ;
Object . defineProperty ( exports , 'toQueryString' , {
enumerable : true ,
get : function get ( ) {
return _query _params . toQueryString ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _claims2 = _ _webpack _require _ _ ( 25 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'claimsReducer' , {
enumerable : true ,
get : function get ( ) {
return _claims2 . claimsReducer ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _cost _info2 = _ _webpack _require _ _ ( 26 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'costInfoReducer' , {
enumerable : true ,
get : function get ( ) {
return _cost _info2 . costInfoReducer ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _file _info2 = _ _webpack _require _ _ ( 27 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'fileInfoReducer' , {
enumerable : true ,
get : function get ( ) {
return _file _info2 . fileInfoReducer ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _search2 = _ _webpack _require _ _ ( 28 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'searchReducer' , {
enumerable : true ,
get : function get ( ) {
return _search2 . searchReducer ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _wallet2 = _ _webpack _require _ _ ( 29 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'walletReducer' , {
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _wallet2 . walletReducer ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-28 01:45:45 +01:00
var _claims3 = _ _webpack _require _ _ ( 4 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'makeSelectClaimForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimIsMine' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimIsMine ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectFetchingChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectFetchingChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectClaimsInChannelForCurrentPage' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectClaimsInChannelForCurrentPage ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectMetadataForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectMetadataForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectTitleForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectTitleForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectContentTypeForUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectContentTypeForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectIsUriResolving' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . makeSelectIsUriResolving ;
}
} ) ;
Object . defineProperty ( exports , 'selectClaimsById' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectClaimsById ;
}
} ) ;
Object . defineProperty ( exports , 'selectClaimsByUri' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectClaimsByUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllClaimsByChannel' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllClaimsByChannel ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsRaw' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsRaw ;
}
} ) ;
Object . defineProperty ( exports , 'selectAbandoningIds' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAbandoningIds ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyActiveClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyActiveClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllFetchingChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllFetchingChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingClaimListMine' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectIsFetchingClaimListMine ;
}
} ) ;
Object . defineProperty ( exports , 'selectPendingClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectPendingClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsWithoutChannels' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsWithoutChannels ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllMyClaimsByOutpoint' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectAllMyClaimsByOutpoint ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyClaimsOutpoints' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyClaimsOutpoints ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingMyChannels' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectFetchingMyChannels ;
}
} ) ;
Object . defineProperty ( exports , 'selectMyChannelClaims' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectMyChannelClaims ;
}
} ) ;
Object . defineProperty ( exports , 'selectResolvingUris' , {
enumerable : true ,
get : function get ( ) {
return _claims3 . selectResolvingUris ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _cost _info3 = _ _webpack _require _ _ ( 30 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'makeSelectFetchingCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . makeSelectFetchingCostInfoForUri ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectCostInfoForUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . makeSelectCostInfoForUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectAllCostInfoByUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectAllCostInfoByUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectCostForCurrentPageUri' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectCostForCurrentPageUri ;
}
} ) ;
Object . defineProperty ( exports , 'selectFetchingCostInfo' , {
enumerable : true ,
get : function get ( ) {
return _cost _info3 . selectFetchingCostInfo ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _file _info3 = _ _webpack _require _ _ ( 12 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'makeSelectFileInfoForUri' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . makeSelectFileInfoForUri ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'makeSelectDownloadingForUri' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . makeSelectDownloadingForUri ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'makeSelectLoadingForUri' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . makeSelectLoadingForUri ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'selectFileInfosByOutpoint' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . selectFileInfosByOutpoint ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'selectIsFetchingFileList' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . selectIsFetchingFileList ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'selectIsFetchingFileListDownloadedOrPublished' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . selectIsFetchingFileListDownloadedOrPublished ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'selectDownloadingByOutpoint' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . selectDownloadingByOutpoint ;
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'selectUrisLoading' , {
2018-01-17 06:28:01 +01:00
enumerable : true ,
get : function get ( ) {
2018-01-17 13:24:35 +01:00
return _file _info3 . selectUrisLoading ;
2018-01-17 06:28:01 +01:00
}
} ) ;
Object . defineProperty ( exports , 'selectFileInfosDownloaded' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectFileInfosDownloaded ;
}
} ) ;
Object . defineProperty ( exports , 'selectDownloadingFileInfos' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectDownloadingFileInfos ;
}
} ) ;
Object . defineProperty ( exports , 'selectTotalDownloadProgress' , {
enumerable : true ,
get : function get ( ) {
return _file _info3 . selectTotalDownloadProgress ;
}
} ) ;
2018-01-19 11:48:43 +01:00
var _navigation2 = _ _webpack _require _ _ ( 1 ) ;
Object . defineProperty ( exports , 'computePageFromPath' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . computePageFromPath ;
}
} ) ;
Object . defineProperty ( exports , 'makeSelectCurrentParam' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . makeSelectCurrentParam ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentPath' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectCurrentPath ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentPage' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectCurrentPage ;
}
} ) ;
Object . defineProperty ( exports , 'selectCurrentParams' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectCurrentParams ;
}
} ) ;
Object . defineProperty ( exports , 'selectHeaderLinks' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectHeaderLinks ;
}
} ) ;
Object . defineProperty ( exports , 'selectPageTitle' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectPageTitle ;
}
} ) ;
Object . defineProperty ( exports , 'selectPathAfterAuth' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectPathAfterAuth ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsBackDisabled' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectIsBackDisabled ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsForwardDisabled' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectIsForwardDisabled ;
}
} ) ;
Object . defineProperty ( exports , 'selectHistoryIndex' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectHistoryIndex ;
}
} ) ;
Object . defineProperty ( exports , 'selectHistoryStack' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectHistoryStack ;
}
} ) ;
Object . defineProperty ( exports , 'selectActiveHistoryEntry' , {
enumerable : true ,
get : function get ( ) {
return _navigation2 . selectActiveHistoryEntry ;
}
} ) ;
2018-01-17 13:24:35 +01:00
var _search3 = _ _webpack _require _ _ ( 31 ) ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , 'makeSelectSearchUris' , {
enumerable : true ,
get : function get ( ) {
return _search3 . makeSelectSearchUris ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchQuery' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchQuery ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsSearching' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectIsSearching ;
}
} ) ;
Object . defineProperty ( exports , 'selectSearchUrisByQuery' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectSearchUrisByQuery ;
}
} ) ;
Object . defineProperty ( exports , 'selectWunderBarAddress' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectWunderBarAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectWunderBarIcon' , {
enumerable : true ,
get : function get ( ) {
return _search3 . selectWunderBarIcon ;
}
} ) ;
2018-01-28 01:45:45 +01:00
var _wallet3 = _ _webpack _require _ _ ( 14 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
Object . defineProperty ( exports , 'makeSelectBlockDate' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . makeSelectBlockDate ;
}
} ) ;
Object . defineProperty ( exports , 'selectBalance' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectBalance ;
}
} ) ;
Object . defineProperty ( exports , 'selectTransactionsById' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectTransactionsById ;
}
} ) ;
Object . defineProperty ( exports , 'selectTransactionItems' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectTransactionItems ;
}
} ) ;
Object . defineProperty ( exports , 'selectRecentTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectRecentTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectHasTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectHasTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsFetchingTransactions' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectIsFetchingTransactions ;
}
} ) ;
Object . defineProperty ( exports , 'selectIsSendingSupport' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectIsSendingSupport ;
}
} ) ;
Object . defineProperty ( exports , 'selectReceiveAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectReceiveAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectGettingNewAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectGettingNewAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransaction' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransaction ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionAmount' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionAmount ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionAddress' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionAddress ;
}
} ) ;
Object . defineProperty ( exports , 'selectDraftTransactionError' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectDraftTransactionError ;
}
} ) ;
Object . defineProperty ( exports , 'selectBlocks' , {
enumerable : true ,
get : function get ( ) {
return _wallet3 . selectBlocks ;
}
} ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _lbry = _ _webpack _require _ _ ( 5 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _lbryapi = _ _webpack _require _ _ ( 11 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
2018-01-17 06:28:01 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-01-17 13:24:35 +01:00
// common
2018-01-17 06:28:01 +01:00
exports . Lbry = _lbry2 . default ;
2018-01-28 01:45:45 +01:00
exports . Lbryapi = _lbryapi2 . default ;
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 16 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
var jsonrpc = { } ;
jsonrpc . call = function ( connectionString , method , params , callback , errorCallback , connectFailedCallback ) {
function checkAndParse ( response ) {
if ( response . status >= 200 && response . status < 300 ) {
return response . json ( ) ;
}
return response . json ( ) . then ( function ( json ) {
var error = void 0 ;
if ( json . error ) {
error = new Error ( json . error ) ;
} else {
error = new Error ( 'Protocol error with unknown response signature' ) ;
}
return Promise . reject ( error ) ;
} ) ;
}
var counter = parseInt ( sessionStorage . getItem ( 'JSONRPCCounter' ) || 0 , 10 ) ;
var url = connectionString ;
var options = {
method : 'POST' ,
body : JSON . stringify ( {
jsonrpc : '2.0' ,
method : method ,
params : params ,
id : counter
} )
} ;
sessionStorage . setItem ( 'JSONRPCCounter' , counter + 1 ) ;
return fetch ( url , options ) . then ( checkAndParse ) . then ( function ( response ) {
var error = response . error || response . result && response . result . error ;
if ( ! error && typeof callback === 'function' ) {
return callback ( response . result ) ;
}
if ( error && typeof errorCallback === 'function' ) {
return errorCallback ( error ) ;
}
var errorEvent = new CustomEvent ( 'unhandledError' , {
detail : {
connectionString : connectionString ,
method : method ,
params : params ,
code : error . code ,
message : error . message || error ,
data : error . data
}
} ) ;
document . dispatchEvent ( errorEvent ) ;
return Promise . resolve ( ) ;
} ) . catch ( function ( error ) {
if ( connectFailedCallback ) {
return connectFailedCallback ( error ) ;
}
var errorEvent = new CustomEvent ( 'unhandledError' , {
detail : {
connectionString : connectionString ,
method : method ,
params : params ,
code : error . response && error . response . status ,
message : _ _ ( 'Connection to API server failed' )
}
} ) ;
document . dispatchEvent ( errorEvent ) ;
return Promise . resolve ( ) ;
} ) ;
} ;
exports . default = jsonrpc ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 17 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doFetchCostInfoForUri = doFetchCostInfoForUri ;
var _action _types = _ _webpack _require _ _ ( 0 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-28 01:45:45 +01:00
var _lbryapi = _ _webpack _require _ _ ( 11 ) ;
2018-01-17 06:28:01 +01:00
var _lbryapi2 = _interopRequireDefault ( _lbryapi ) ;
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 4 ) ;
2018-01-17 06:28:01 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-17 13:24:35 +01:00
// eslint-disable-next-line import/prefer-default-export
function doFetchCostInfoForUri ( uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var claim = ( 0 , _claims . selectClaimsByUri ) ( state ) [ uri ] ;
if ( ! claim ) return ;
function resolve ( costInfo ) {
dispatch ( {
type : ACTIONS . FETCH _COST _INFO _COMPLETED ,
data : {
uri : uri ,
costInfo : costInfo
}
} ) ;
}
var fee = claim . value && claim . value . stream && claim . value . stream . metadata ? claim . value . stream . metadata . fee : undefined ;
if ( fee === undefined ) {
resolve ( { cost : 0 , includesData : true } ) ;
} else if ( fee . currency === 'LBC' ) {
resolve ( { cost : fee . amount , includesData : true } ) ;
} else {
_lbryapi2 . default . getExchangeRates ( ) . then ( function ( _ref ) {
var LBC _USD = _ref . LBC _USD ;
resolve ( { cost : fee . amount / LBC _USD , includesData : true } ) ;
} ) ;
}
} ;
}
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 18 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports ) {
// shim for using process in browser
var process = module . exports = { } ;
// cached from whatever global is present so that test runners that stub it
// don't break things. But we need to wrap it in a try catch in case it is
// wrapped in strict mode code which doesn't define any globals. It's inside a
// function because try/catches deoptimize in certain engines.
var cachedSetTimeout ;
var cachedClearTimeout ;
function defaultSetTimout ( ) {
throw new Error ( 'setTimeout has not been defined' ) ;
}
function defaultClearTimeout ( ) {
throw new Error ( 'clearTimeout has not been defined' ) ;
}
( function ( ) {
try {
if ( typeof setTimeout === 'function' ) {
cachedSetTimeout = setTimeout ;
} else {
cachedSetTimeout = defaultSetTimout ;
}
} catch ( e ) {
cachedSetTimeout = defaultSetTimout ;
}
try {
if ( typeof clearTimeout === 'function' ) {
cachedClearTimeout = clearTimeout ;
} else {
cachedClearTimeout = defaultClearTimeout ;
}
} catch ( e ) {
cachedClearTimeout = defaultClearTimeout ;
}
} ( ) )
function runTimeout ( fun ) {
if ( cachedSetTimeout === setTimeout ) {
//normal enviroments in sane situations
return setTimeout ( fun , 0 ) ;
}
// if setTimeout wasn't available but was latter defined
if ( ( cachedSetTimeout === defaultSetTimout || ! cachedSetTimeout ) && setTimeout ) {
cachedSetTimeout = setTimeout ;
return setTimeout ( fun , 0 ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedSetTimeout ( fun , 0 ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedSetTimeout . call ( null , fun , 0 ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
return cachedSetTimeout . call ( this , fun , 0 ) ;
}
}
}
function runClearTimeout ( marker ) {
if ( cachedClearTimeout === clearTimeout ) {
//normal enviroments in sane situations
return clearTimeout ( marker ) ;
}
// if clearTimeout wasn't available but was latter defined
if ( ( cachedClearTimeout === defaultClearTimeout || ! cachedClearTimeout ) && clearTimeout ) {
cachedClearTimeout = clearTimeout ;
return clearTimeout ( marker ) ;
}
try {
// when when somebody has screwed with setTimeout but no I.E. maddness
return cachedClearTimeout ( marker ) ;
} catch ( e ) {
try {
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
return cachedClearTimeout . call ( null , marker ) ;
} catch ( e ) {
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
return cachedClearTimeout . call ( this , marker ) ;
}
}
}
var queue = [ ] ;
var draining = false ;
var currentQueue ;
var queueIndex = - 1 ;
function cleanUpNextTick ( ) {
if ( ! draining || ! currentQueue ) {
return ;
}
draining = false ;
if ( currentQueue . length ) {
queue = currentQueue . concat ( queue ) ;
} else {
queueIndex = - 1 ;
}
if ( queue . length ) {
drainQueue ( ) ;
}
}
function drainQueue ( ) {
if ( draining ) {
return ;
}
var timeout = runTimeout ( cleanUpNextTick ) ;
draining = true ;
var len = queue . length ;
while ( len ) {
currentQueue = queue ;
queue = [ ] ;
while ( ++ queueIndex < len ) {
if ( currentQueue ) {
currentQueue [ queueIndex ] . run ( ) ;
}
}
queueIndex = - 1 ;
len = queue . length ;
}
currentQueue = null ;
draining = false ;
runClearTimeout ( timeout ) ;
}
process . nextTick = function ( fun ) {
var args = new Array ( arguments . length - 1 ) ;
if ( arguments . length > 1 ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
args [ i - 1 ] = arguments [ i ] ;
}
}
queue . push ( new Item ( fun , args ) ) ;
if ( queue . length === 1 && ! draining ) {
runTimeout ( drainQueue ) ;
}
} ;
// v8 likes predictible objects
function Item ( fun , array ) {
this . fun = fun ;
this . array = array ;
}
Item . prototype . run = function ( ) {
this . fun . apply ( null , this . array ) ;
} ;
process . title = 'browser' ;
process . browser = true ;
process . env = { } ;
process . argv = [ ] ;
process . version = '' ; // empty string to avoid regexp issues
process . versions = { } ;
function noop ( ) { }
process . on = noop ;
process . addListener = noop ;
process . once = noop ;
process . off = noop ;
process . removeListener = noop ;
process . removeAllListeners = noop ;
process . emit = noop ;
process . prependListener = noop ;
process . prependOnceListener = noop ;
process . listeners = function ( name ) { return [ ] }
process . binding = function ( name ) {
throw new Error ( 'process.binding is not supported' ) ;
} ;
process . cwd = function ( ) { return '/' } ;
process . chdir = function ( dir ) {
throw new Error ( 'process.chdir is not supported' ) ;
} ;
process . umask = function ( ) { return 0 ; } ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 19 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-28 01:45:45 +01:00
exports . decode = exports . parse = _ _webpack _require _ _ ( 20 ) ;
exports . encode = exports . stringify = _ _webpack _require _ _ ( 21 ) ;
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 20 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
// If obj.hasOwnProperty has been overridden, then calling
// obj.hasOwnProperty(prop) will break.
// See: https://github.com/joyent/node/issues/1707
function hasOwnProperty ( obj , prop ) {
return Object . prototype . hasOwnProperty . call ( obj , prop ) ;
}
module . exports = function ( qs , sep , eq , options ) {
sep = sep || '&' ;
eq = eq || '=' ;
var obj = { } ;
if ( typeof qs !== 'string' || qs . length === 0 ) {
return obj ;
}
var regexp = /\+/g ;
qs = qs . split ( sep ) ;
var maxKeys = 1000 ;
if ( options && typeof options . maxKeys === 'number' ) {
maxKeys = options . maxKeys ;
}
var len = qs . length ;
// maxKeys <= 0 means that we should not limit keys count
if ( maxKeys > 0 && len > maxKeys ) {
len = maxKeys ;
}
for ( var i = 0 ; i < len ; ++ i ) {
var x = qs [ i ] . replace ( regexp , '%20' ) ,
idx = x . indexOf ( eq ) ,
kstr , vstr , k , v ;
if ( idx >= 0 ) {
kstr = x . substr ( 0 , idx ) ;
vstr = x . substr ( idx + 1 ) ;
} else {
kstr = x ;
vstr = '' ;
}
k = decodeURIComponent ( kstr ) ;
v = decodeURIComponent ( vstr ) ;
if ( ! hasOwnProperty ( obj , k ) ) {
obj [ k ] = v ;
} else if ( isArray ( obj [ k ] ) ) {
obj [ k ] . push ( v ) ;
} else {
obj [ k ] = [ obj [ k ] , v ] ;
}
}
return obj ;
} ;
var isArray = Array . isArray || function ( xs ) {
return Object . prototype . toString . call ( xs ) === '[object Array]' ;
} ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 21 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
var stringifyPrimitive = function ( v ) {
switch ( typeof v ) {
case 'string' :
return v ;
case 'boolean' :
return v ? 'true' : 'false' ;
case 'number' :
return isFinite ( v ) ? v : '' ;
default :
return '' ;
}
} ;
module . exports = function ( obj , sep , eq , name ) {
sep = sep || '&' ;
eq = eq || '=' ;
if ( obj === null ) {
obj = undefined ;
}
if ( typeof obj === 'object' ) {
return map ( objectKeys ( obj ) , function ( k ) {
var ks = encodeURIComponent ( stringifyPrimitive ( k ) ) + eq ;
if ( isArray ( obj [ k ] ) ) {
return map ( obj [ k ] , function ( v ) {
return ks + encodeURIComponent ( stringifyPrimitive ( v ) ) ;
} ) . join ( sep ) ;
} else {
return ks + encodeURIComponent ( stringifyPrimitive ( obj [ k ] ) ) ;
}
} ) . join ( sep ) ;
}
if ( ! name ) return '' ;
return encodeURIComponent ( stringifyPrimitive ( name ) ) + eq +
encodeURIComponent ( stringifyPrimitive ( obj ) ) ;
} ;
var isArray = Array . isArray || function ( xs ) {
return Object . prototype . toString . call ( xs ) === '[object Array]' ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function map ( xs , f ) {
if ( xs . map ) return xs . map ( f ) ;
var res = [ ] ;
for ( var i = 0 ; i < xs . length ; i ++ ) {
res . push ( f ( xs [ i ] , i ) ) ;
}
return res ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var objectKeys = Object . keys || function ( obj ) {
var res = [ ] ;
for ( var key in obj ) {
if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) res . push ( key ) ;
}
return res ;
} ;
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 22 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doFetchFileInfo = doFetchFileInfo ;
exports . doFileList = doFileList ;
exports . doFetchFileInfosAndPublishedClaims = doFetchFileInfosAndPublishedClaims ;
var _action _types = _ _webpack _require _ _ ( 0 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-28 01:45:45 +01:00
var _lbry = _ _webpack _require _ _ ( 5 ) ;
2018-01-17 06:28:01 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 7 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _claims2 = _ _webpack _require _ _ ( 4 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _file _info = _ _webpack _require _ _ ( 12 ) ;
2018-01-11 12:54:20 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-01-17 06:28:01 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function doFetchFileInfo ( uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var claim = ( 0 , _claims2 . selectClaimsByUri ) ( state ) [ uri ] ;
var outpoint = claim ? claim . txid + ':' + claim . nout : null ;
var alreadyFetching = ! ! ( 0 , _file _info . selectUrisLoading ) ( state ) [ uri ] ;
if ( ! alreadyFetching ) {
dispatch ( {
type : ACTIONS . FETCH _FILE _INFO _STARTED ,
data : {
outpoint : outpoint
}
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
_lbry2 . default . file _list ( { outpoint : outpoint , full _status : true } ) . then ( function ( fileInfos ) {
dispatch ( {
type : ACTIONS . FETCH _FILE _INFO _COMPLETED ,
data : {
outpoint : outpoint ,
fileInfo : fileInfos && fileInfos . length ? fileInfos [ 0 ] : null
}
} ) ;
} ) ;
}
} ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function doFileList ( ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var isFetching = ( 0 , _file _info . selectIsFetchingFileList ) ( state ) ;
if ( ! isFetching ) {
dispatch ( {
type : ACTIONS . FILE _LIST _STARTED
} ) ;
_lbry2 . default . file _list ( ) . then ( function ( fileInfos ) {
dispatch ( {
type : ACTIONS . FILE _LIST _SUCCEEDED ,
data : {
fileInfos : fileInfos
}
} ) ;
} ) ;
}
} ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 06:28:01 +01:00
function doFetchFileInfosAndPublishedClaims ( ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var isFetchingClaimListMine = ( 0 , _claims2 . selectIsFetchingClaimListMine ) ( state ) ;
var isFetchingFileInfo = ( 0 , _file _info . selectIsFetchingFileList ) ( state ) ;
if ( ! isFetchingClaimListMine ) dispatch ( ( 0 , _claims . doFetchClaimListMine ) ( ) ) ;
if ( ! isFetchingFileInfo ) dispatch ( doFileList ( ) ) ;
} ;
}
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 23 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doSearch = doSearch ;
var _action _types = _ _webpack _require _ _ ( 0 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-28 01:45:45 +01:00
var _lbryURI = _ _webpack _require _ _ ( 3 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _claims = _ _webpack _require _ _ ( 7 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _navigation = _ _webpack _require _ _ ( 9 ) ;
2018-01-17 06:28:01 +01:00
2018-01-19 11:48:43 +01:00
var _navigation2 = _ _webpack _require _ _ ( 1 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _batchActions = _ _webpack _require _ _ ( 13 ) ;
2018-01-17 06:28:01 +01:00
var _batchActions2 = _interopRequireDefault ( _batchActions ) ;
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
// eslint-disable-next-line import/prefer-default-export
function doSearch ( rawQuery ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var page = ( 0 , _navigation2 . selectCurrentPage ) ( state ) ;
var query = rawQuery . replace ( /^lbry:\/\//i , '' ) ;
if ( ! query ) {
dispatch ( {
type : ACTIONS . SEARCH _CANCELLED
} ) ;
return ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 06:28:01 +01:00
dispatch ( {
type : ACTIONS . SEARCH _STARTED ,
data : { query : query }
} ) ;
if ( page !== 'search' ) {
dispatch ( ( 0 , _navigation . doNavigate ) ( 'search' , { query : query } ) ) ;
} else {
fetch ( 'https://lighthouse.lbry.io/search?s=' + query ) . then ( function ( response ) {
return response . status === 200 ? Promise . resolve ( response . json ( ) ) : Promise . reject ( new Error ( response . statusText ) ) ;
} ) . then ( function ( data ) {
var uris = [ ] ;
var actions = [ ] ;
data . forEach ( function ( result ) {
2018-01-28 01:45:45 +01:00
var uri = ( 0 , _lbryURI . buildURI ) ( {
2018-01-17 06:28:01 +01:00
name : result . name ,
claimId : result . claimId
} ) ;
actions . push ( ( 0 , _claims . doResolveUri ) ( uri ) ) ;
uris . push ( uri ) ;
} ) ;
actions . push ( {
type : ACTIONS . SEARCH _COMPLETED ,
data : {
query : query ,
uris : uris
}
} ) ;
dispatch ( _batchActions2 . default . apply ( undefined , actions ) ) ;
} ) . catch ( function ( ) {
dispatch ( {
type : ACTIONS . SEARCH _CANCELLED
} ) ;
2018-01-11 12:54:20 +01:00
} ) ;
2018-01-17 06:28:01 +01:00
}
} ;
}
2018-01-17 13:24:35 +01:00
/***/ } ) ,
2018-01-28 01:45:45 +01:00
/* 24 */
2018-01-17 13:24:35 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . doUpdateBalance = doUpdateBalance ;
exports . doBalanceSubscribe = doBalanceSubscribe ;
exports . doFetchTransactions = doFetchTransactions ;
exports . doFetchBlock = doFetchBlock ;
exports . doGetNewAddress = doGetNewAddress ;
exports . doCheckAddressIsMine = doCheckAddressIsMine ;
exports . doSendDraftTransaction = doSendDraftTransaction ;
exports . doSetDraftTransactionAmount = doSetDraftTransactionAmount ;
exports . doSetDraftTransactionAddress = doSetDraftTransactionAddress ;
exports . doSendSupport = doSendSupport ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-11 12:54:20 +01:00
2018-01-28 01:45:45 +01:00
var _modal _types = _ _webpack _require _ _ ( 10 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var MODALS = _interopRequireWildcard ( _modal _types ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _lbry = _ _webpack _require _ _ ( 5 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
var _lbry2 = _interopRequireDefault ( _lbry ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _app = _ _webpack _require _ _ ( 6 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _navigation = _ _webpack _require _ _ ( 9 ) ;
2018-01-17 06:28:01 +01:00
2018-01-28 01:45:45 +01:00
var _wallet = _ _webpack _require _ _ ( 14 ) ;
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function _interopRequireDefault ( obj ) { return obj && obj . _ _esModule ? obj : { default : obj } ; }
2018-01-17 06:28:01 +01:00
2018-01-17 13:24:35 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
function doUpdateBalance ( ) {
return function ( dispatch ) {
_lbry2 . default . wallet _balance ( ) . then ( function ( balance ) {
return dispatch ( {
type : ACTIONS . UPDATE _BALANCE ,
data : {
balance : balance
}
} ) ;
2018-01-17 06:28:01 +01:00
} ) ;
} ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 13:24:35 +01:00
function doBalanceSubscribe ( ) {
return function ( dispatch ) {
dispatch ( doUpdateBalance ( ) ) ;
setInterval ( function ( ) {
return dispatch ( doUpdateBalance ( ) ) ;
} , 5000 ) ;
} ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 13:24:35 +01:00
function doFetchTransactions ( ) {
2018-01-17 06:28:01 +01:00
return function ( dispatch ) {
2018-01-17 13:24:35 +01:00
dispatch ( {
type : ACTIONS . FETCH _TRANSACTIONS _STARTED
} ) ;
_lbry2 . default . transaction _list ( { include _tip _info : true } ) . then ( function ( results ) {
2018-01-17 06:28:01 +01:00
dispatch ( {
2018-01-17 13:24:35 +01:00
type : ACTIONS . FETCH _TRANSACTIONS _COMPLETED ,
2018-01-17 06:28:01 +01:00
data : {
2018-01-17 13:24:35 +01:00
transactions : results
2018-01-17 06:28:01 +01:00
}
} ) ;
2018-01-17 13:24:35 +01:00
} ) ;
2018-01-11 12:54:20 +01:00
} ;
}
2018-01-17 13:24:35 +01:00
function doFetchBlock ( height ) {
return function ( dispatch ) {
_lbry2 . default . block _show ( { height : height } ) . then ( function ( block ) {
dispatch ( {
type : ACTIONS . FETCH _BLOCK _SUCCESS ,
data : { block : block }
} ) ;
} ) ;
} ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 13:24:35 +01:00
function doGetNewAddress ( ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . GET _NEW _ADDRESS _STARTED
} ) ;
_lbry2 . default . wallet _new _address ( ) . then ( function ( address ) {
localStorage . setItem ( 'wallet_address' , address ) ;
dispatch ( {
type : ACTIONS . GET _NEW _ADDRESS _COMPLETED ,
data : { address : address }
} ) ;
} ) ;
} ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 13:24:35 +01:00
function doCheckAddressIsMine ( address ) {
return function ( dispatch ) {
dispatch ( {
type : ACTIONS . CHECK _ADDRESS _IS _MINE _STARTED
} ) ;
_lbry2 . default . wallet _is _address _mine ( { address : address } ) . then ( function ( isMine ) {
if ( ! isMine ) dispatch ( doGetNewAddress ( ) ) ;
dispatch ( {
type : ACTIONS . CHECK _ADDRESS _IS _MINE _COMPLETED
} ) ;
} ) ;
2018-01-17 06:28:01 +01:00
} ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 13:24:35 +01:00
function doSendDraftTransaction ( ) {
2018-01-17 06:28:01 +01:00
return function ( dispatch , getState ) {
2018-01-17 13:24:35 +01:00
var state = getState ( ) ;
var draftTx = ( 0 , _wallet . selectDraftTransaction ) ( state ) ;
var balance = ( 0 , _wallet . selectBalance ) ( state ) ;
var amount = ( 0 , _wallet . selectDraftTransactionAmount ) ( state ) ;
if ( balance - amount <= 0 ) {
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . INSUFFICIENT _CREDITS ) ) ;
return ;
}
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _STARTED
} ) ;
var successCallback = function successCallback ( results ) {
if ( results === true ) {
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _COMPLETED
} ) ;
dispatch ( ( 0 , _app . doShowSnackBar ) ( {
message : _ _ ( 'You sent ' + amount + ' LBC' ) ,
linkText : _ _ ( 'History' ) ,
linkTarget : _ _ ( '/wallet' )
} ) ) ;
} else {
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _FAILED ,
data : { error : results }
} ) ;
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
}
} ;
var errorCallback = function errorCallback ( error ) {
dispatch ( {
type : ACTIONS . SEND _TRANSACTION _FAILED ,
data : { error : error . message }
} ) ;
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
} ;
_lbry2 . default . wallet _send ( {
amount : draftTx . amount ,
address : draftTx . address
} ) . then ( successCallback , errorCallback ) ;
2018-01-17 06:28:01 +01:00
} ;
}
2018-01-11 12:54:20 +01:00
2018-01-17 13:24:35 +01:00
function doSetDraftTransactionAmount ( amount ) {
return {
type : ACTIONS . SET _DRAFT _TRANSACTION _AMOUNT ,
data : { amount : amount }
} ;
}
function doSetDraftTransactionAddress ( address ) {
return {
type : ACTIONS . SET _DRAFT _TRANSACTION _ADDRESS ,
data : { address : address }
} ;
}
function doSendSupport ( amount , claimId , uri ) {
return function ( dispatch , getState ) {
var state = getState ( ) ;
var balance = ( 0 , _wallet . selectBalance ) ( state ) ;
if ( balance - amount <= 0 ) {
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . INSUFFICIENT _CREDITS ) ) ;
return ;
}
2018-01-17 06:28:01 +01:00
dispatch ( {
2018-01-17 13:24:35 +01:00
type : ACTIONS . SUPPORT _TRANSACTION _STARTED
2018-01-17 06:28:01 +01:00
} ) ;
2018-01-17 13:24:35 +01:00
var successCallback = function successCallback ( results ) {
if ( results . txid ) {
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _COMPLETED
} ) ;
dispatch ( ( 0 , _app . doShowSnackBar ) ( {
message : _ _ ( 'You sent ' + amount + ' LBC as support, Mahalo!' ) ,
linkText : _ _ ( 'History' ) ,
linkTarget : _ _ ( '/wallet' )
} ) ) ;
dispatch ( ( 0 , _navigation . doNavigate ) ( '/show' , { uri : uri } ) ) ;
} else {
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _FAILED ,
data : { error : results . code }
} ) ;
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
}
} ;
var errorCallback = function errorCallback ( error ) {
dispatch ( {
type : ACTIONS . SUPPORT _TRANSACTION _FAILED ,
data : { error : error . code }
} ) ;
dispatch ( ( 0 , _app . doOpenModal ) ( MODALS . TRANSACTION _FAILED ) ) ;
} ;
_lbry2 . default . wallet _send ( {
claim _id : claimId ,
amount : amount
} ) . then ( successCallback , errorCallback ) ;
2018-01-17 06:28:01 +01:00
} ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 25 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _slicedToArray = function ( ) { function sliceIterator ( arr , i ) { var _arr = [ ] ; var _n = true ; var _d = false ; var _e = undefined ; try { for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) { _arr . push ( _s . value ) ; if ( i && _arr . length === i ) break ; } } catch ( err ) { _d = true ; _e = err ; } finally { try { if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ; } finally { if ( _d ) throw _e ; } } return _arr ; } return function ( arr , i ) { if ( Array . isArray ( arr ) ) { return arr ; } else if ( Symbol . iterator in Object ( arr ) ) { return sliceIterator ( arr , i ) ; } else { throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ; } } ; } ( ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
exports . claimsReducer = claimsReducer ;
var _action _types = _ _webpack _require _ _ ( 0 ) ;
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
var reducers = { } ;
var defaultState = { } ;
reducers [ ACTIONS . RESOLVE _URIS _COMPLETED ] = function ( state , action ) {
var resolveInfo = action . data . resolveInfo ;
var byUri = Object . assign ( { } , state . claimsByUri ) ;
var byId = Object . assign ( { } , state . byId ) ;
Object . entries ( resolveInfo ) . forEach ( function ( _ref ) {
var _ref2 = _slicedToArray ( _ref , 2 ) ,
uri = _ref2 [ 0 ] ,
_ref2$ = _ref2 [ 1 ] ,
certificate = _ref2$ . certificate ,
claim = _ref2$ . claim ;
if ( claim ) {
byId [ claim . claim _id ] = claim ;
byUri [ uri ] = claim . claim _id ;
} else if ( claim === undefined && certificate !== undefined ) {
byId [ certificate . claim _id ] = certificate ;
// Don't point URI at the channel certificate unless it actually is
// a channel URI. This is brittle.
if ( ! uri . split ( certificate . name ) [ 1 ] . match ( /\// ) ) {
byUri [ uri ] = certificate . claim _id ;
} else {
byUri [ uri ] = null ;
}
} else {
byUri [ uri ] = null ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 06:28:01 +01:00
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
byId : byId ,
claimsByUri : byUri
2018-01-11 12:54:20 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _CLAIM _LIST _MINE _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
isFetchingClaimListMine : true
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _CLAIM _LIST _MINE _COMPLETED ] = function ( state , action ) {
var claims = action . data . claims ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var byId = Object . assign ( { } , state . byId ) ;
var pendingById = Object . assign ( { } , state . pendingById ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
claims . filter ( function ( claim ) {
return claim . category && claim . category . match ( /claim/ ) ;
} ) . forEach ( function ( claim ) {
byId [ claim . claim _id ] = claim ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var pending = Object . values ( pendingById ) . find ( function ( pendingClaim ) {
return pendingClaim . name === claim . name && pendingClaim . channel _name === claim . channel _name ;
} ) ;
if ( pending ) {
delete pendingById [ pending . claim _id ] ;
2018-01-11 12:54:20 +01:00
}
2018-01-17 06:28:01 +01:00
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
// Remove old timed out pending publishes
Object . values ( pendingById ) . filter ( function ( pendingClaim ) {
return Date . now ( ) - pendingClaim . time >= 20 * 60 * 1000 ;
} ) . forEach ( function ( pendingClaim ) {
delete pendingById [ pendingClaim . claim _id ] ;
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
isFetchingClaimListMine : false ,
myClaims : claims ,
byId : byId ,
pendingById : pendingById
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _CHANNEL _LIST _MINE _STARTED ] = function ( state ) {
return Object . assign ( { } , state , { fetchingMyChannels : true } ) ;
} ;
reducers [ ACTIONS . FETCH _CHANNEL _LIST _MINE _COMPLETED ] = function ( state , action ) {
var claims = action . data . claims ;
var myChannelClaims = new Set ( state . myChannelClaims ) ;
var byId = Object . assign ( { } , state . byId ) ;
claims . forEach ( function ( claim ) {
myChannelClaims . add ( claim . claim _id ) ;
byId [ claims . claim _id ] = claim ;
} ) ;
return Object . assign ( { } , state , {
byId : byId ,
fetchingMyChannels : false ,
myChannelClaims : myChannelClaims
2018-01-11 12:54:20 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _CHANNEL _CLAIMS _STARTED ] = function ( state , action ) {
var _action$data = action . data ,
uri = _action$data . uri ,
page = _action$data . page ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var fetchingChannelClaims = Object . assign ( { } , state . fetchingChannelClaims ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
fetchingChannelClaims [ uri ] = page ;
return Object . assign ( { } , state , {
fetchingChannelClaims : fetchingChannelClaims
2018-01-11 12:54:20 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _CHANNEL _CLAIMS _COMPLETED ] = function ( state , action ) {
var _action$data2 = action . data ,
uri = _action$data2 . uri ,
claims = _action$data2 . claims ,
page = _action$data2 . page ;
var claimsByChannel = Object . assign ( { } , state . claimsByChannel ) ;
var byChannel = Object . assign ( { } , claimsByChannel [ uri ] ) ;
var allClaimIds = new Set ( byChannel . all ) ;
var currentPageClaimIds = [ ] ;
var byId = Object . assign ( { } , state . byId ) ;
var fetchingChannelClaims = Object . assign ( { } , state . fetchingChannelClaims ) ;
if ( claims !== undefined ) {
claims . forEach ( function ( claim ) {
allClaimIds . add ( claim . claim _id ) ;
currentPageClaimIds . push ( claim . claim _id ) ;
byId [ claim . claim _id ] = claim ;
} ) ;
}
byChannel . all = allClaimIds ;
byChannel [ page ] = currentPageClaimIds ;
claimsByChannel [ uri ] = byChannel ;
delete fetchingChannelClaims [ uri ] ;
return Object . assign ( { } , state , {
claimsByChannel : claimsByChannel ,
byId : byId ,
fetchingChannelClaims : fetchingChannelClaims
2018-01-11 12:54:20 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . ABANDON _CLAIM _STARTED ] = function ( state , action ) {
var claimId = action . data . claimId ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var abandoningById = Object . assign ( { } , state . abandoningById ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
abandoningById [ claimId ] = true ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
abandoningById : abandoningById
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . ABANDON _CLAIM _SUCCEEDED ] = function ( state , action ) {
var claimId = action . data . claimId ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var byId = Object . assign ( { } , state . byId ) ;
var claimsByUri = Object . assign ( { } , state . claimsByUri ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
Object . keys ( claimsByUri ) . forEach ( function ( uri ) {
if ( claimsByUri [ uri ] === claimId ) {
delete claimsByUri [ uri ] ;
}
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
delete byId [ claimId ] ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
byId : byId ,
claimsByUri : claimsByUri
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . CREATE _CHANNEL _COMPLETED ] = function ( state , action ) {
var channelClaim = action . data . channelClaim ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var byId = Object . assign ( { } , state . byId ) ;
var myChannelClaims = new Set ( state . myChannelClaims ) ;
2018-01-15 19:06:44 +01:00
2018-01-17 06:28:01 +01:00
byId [ channelClaim . claim _id ] = channelClaim ;
myChannelClaims . add ( channelClaim . claim _id ) ;
return Object . assign ( { } , state , {
byId : byId ,
myChannelClaims : myChannelClaims
} ) ;
} ;
function claimsReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
2018-01-15 19:06:44 +01:00
2018-01-17 06:28:01 +01:00
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
2018-01-11 13:12:37 +01:00
2018-01-11 12:54:20 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 26 */
2018-01-11 12:54:20 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-17 06:28:01 +01:00
exports . costInfoReducer = costInfoReducer ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var reducers = { } ;
var defaultState = { } ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _COST _INFO _STARTED ] = function ( state , action ) {
var uri = action . data . uri ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newFetching = Object . assign ( { } , state . fetching ) ;
newFetching [ uri ] = true ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
fetching : newFetching
} ) ;
} ;
reducers [ ACTIONS . FETCH _COST _INFO _COMPLETED ] = function ( state , action ) {
var _action$data = action . data ,
uri = _action$data . uri ,
costInfo = _action$data . costInfo ;
var newByUri = Object . assign ( { } , state . byUri ) ;
var newFetching = Object . assign ( { } , state . fetching ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
newByUri [ uri ] = costInfo ;
delete newFetching [ uri ] ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
byUri : newByUri ,
fetching : newFetching
2018-01-11 12:54:20 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
function costInfoReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
2018-01-11 12:54:20 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 27 */
2018-01-11 12:54:20 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-17 06:28:01 +01:00
2018-01-11 12:54:20 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-17 06:28:01 +01:00
exports . fileInfoReducer = fileInfoReducer ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var reducers = { } ;
var defaultState = { } ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FILE _LIST _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
isFetchingFileList : true
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FILE _LIST _SUCCEEDED ] = function ( state , action ) {
var fileInfos = action . data . fileInfos ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var pendingByOutpoint = Object . assign ( { } , state . pendingByOutpoint ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
fileInfos . forEach ( function ( fileInfo ) {
var outpoint = fileInfo . outpoint ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
if ( outpoint ) newByOutpoint [ fileInfo . outpoint ] = fileInfo ;
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
isFetchingFileList : false ,
byOutpoint : newByOutpoint ,
pendingByOutpoint : pendingByOutpoint
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _FILE _INFO _STARTED ] = function ( state , action ) {
var outpoint = action . data . outpoint ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newFetching = Object . assign ( { } , state . fetching ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
newFetching [ outpoint ] = true ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
fetching : newFetching
2018-01-15 19:06:44 +01:00
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _FILE _INFO _COMPLETED ] = function ( state , action ) {
var _action$data = action . data ,
fileInfo = _action$data . fileInfo ,
outpoint = _action$data . outpoint ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newFetching = Object . assign ( { } , state . fetching ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
newByOutpoint [ outpoint ] = fileInfo ;
delete newFetching [ outpoint ] ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
fetching : newFetching
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . DOWNLOADING _STARTED ] = function ( state , action ) {
var _action$data2 = action . data ,
uri = _action$data2 . uri ,
outpoint = _action$data2 . outpoint ,
fileInfo = _action$data2 . fileInfo ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
var newLoading = Object . assign ( { } , state . urisLoading ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
newDownloading [ outpoint ] = true ;
newByOutpoint [ outpoint ] = fileInfo ;
delete newLoading [ uri ] ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
downloadingByOutpoint : newDownloading ,
urisLoading : newLoading ,
byOutpoint : newByOutpoint
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . DOWNLOADING _PROGRESSED ] = function ( state , action ) {
var _action$data3 = action . data ,
outpoint = _action$data3 . outpoint ,
fileInfo = _action$data3 . fileInfo ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
newByOutpoint [ outpoint ] = fileInfo ;
newDownloading [ outpoint ] = true ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : newDownloading
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . DOWNLOADING _COMPLETED ] = function ( state , action ) {
var _action$data4 = action . data ,
outpoint = _action$data4 . outpoint ,
fileInfo = _action$data4 . fileInfo ;
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var newDownloading = Object . assign ( { } , state . downloadingByOutpoint ) ;
newByOutpoint [ outpoint ] = fileInfo ;
delete newDownloading [ outpoint ] ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : newDownloading
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FILE _DELETE ] = function ( state , action ) {
var outpoint = action . data . outpoint ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newByOutpoint = Object . assign ( { } , state . byOutpoint ) ;
var downloadingByOutpoint = Object . assign ( { } , state . downloadingByOutpoint ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
delete newByOutpoint [ outpoint ] ;
delete downloadingByOutpoint [ outpoint ] ;
return Object . assign ( { } , state , {
byOutpoint : newByOutpoint ,
downloadingByOutpoint : downloadingByOutpoint
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . LOADING _VIDEO _STARTED ] = function ( state , action ) {
var uri = action . data . uri ;
var newLoading = Object . assign ( { } , state . urisLoading ) ;
newLoading [ uri ] = true ;
return Object . assign ( { } , state , {
urisLoading : newLoading
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . LOADING _VIDEO _FAILED ] = function ( state , action ) {
var uri = action . data . uri ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var newLoading = Object . assign ( { } , state . urisLoading ) ;
delete newLoading [ uri ] ;
return Object . assign ( { } , state , {
urisLoading : newLoading
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _DATE ] = function ( state , action ) {
var time = action . data . time ;
if ( time ) {
return Object . assign ( { } , state , {
publishedDate : time
} ) ;
}
return null ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function fileInfoReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
2018-01-11 12:54:20 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 28 */
2018-01-11 12:54:20 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . searchReducer = searchReducer ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function _defineProperty ( obj , key , value ) { if ( key in obj ) { Object . defineProperty ( obj , key , { value : value , enumerable : true , configurable : true , writable : true } ) ; } else { obj [ key ] = value ; } return obj ; }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var reducers = { } ;
var defaultState = {
urisByQuery : { } ,
searching : false
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEARCH _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
searching : true
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEARCH _COMPLETED ] = function ( state , action ) {
var _action$data = action . data ,
query = _action$data . query ,
uris = _action$data . uris ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
searching : false ,
urisByQuery : Object . assign ( { } , state . urisByQuery , _defineProperty ( { } , query , uris ) )
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEARCH _CANCELLED ] = function ( state ) {
return Object . assign ( { } , state , {
searching : false
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
function searchReducer ( ) {
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
2018-01-11 12:54:20 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 29 */
2018-01-11 12:54:20 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . walletReducer = walletReducer ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var _action _types = _ _webpack _require _ _ ( 0 ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var ACTIONS = _interopRequireWildcard ( _action _types ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
function _interopRequireWildcard ( obj ) { if ( obj && obj . _ _esModule ) { return obj ; } else { var newObj = { } ; if ( obj != null ) { for ( var key in obj ) { if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ; } } newObj . default = obj ; return newObj ; } }
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var reducers = { } ;
var receiveAddress = localStorage . getItem ( 'receiveAddress' ) ;
var buildDraftTransaction = function buildDraftTransaction ( ) {
return {
amount : undefined ,
address : undefined
} ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
var defaultState = {
balance : undefined ,
blocks : { } ,
transactions : { } ,
fetchingTransactions : false ,
receiveAddress : receiveAddress ,
gettingNewAddress : false ,
draftTransaction : buildDraftTransaction ( ) ,
sendingSupport : false
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _TRANSACTIONS _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
fetchingTransactions : true
} ) ;
} ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _TRANSACTIONS _COMPLETED ] = function ( state , action ) {
var byId = Object . assign ( { } , state . transactions ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
var transactions = action . data . transactions ;
transactions . forEach ( function ( transaction ) {
byId [ transaction . txid ] = transaction ;
} ) ;
return Object . assign ( { } , state , {
transactions : byId ,
fetchingTransactions : false
} ) ;
} ;
reducers [ ACTIONS . GET _NEW _ADDRESS _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
gettingNewAddress : true
} ) ;
} ;
reducers [ ACTIONS . GET _NEW _ADDRESS _COMPLETED ] = function ( state , action ) {
var address = action . data . address ;
localStorage . setItem ( 'receiveAddress' , address ) ;
return Object . assign ( { } , state , {
gettingNewAddress : false ,
receiveAddress : address
} ) ;
} ;
reducers [ ACTIONS . UPDATE _BALANCE ] = function ( state , action ) {
return Object . assign ( { } , state , {
balance : action . data . balance
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . CHECK _ADDRESS _IS _MINE _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
checkingAddressOwnership : true
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . CHECK _ADDRESS _IS _MINE _COMPLETED ] = function ( state ) {
return Object . assign ( { } , state , {
checkingAddressOwnership : false
} ) ;
2018-01-11 12:54:20 +01:00
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SET _DRAFT _TRANSACTION _AMOUNT ] = function ( state , action ) {
var oldDraft = state . draftTransaction ;
var newDraft = Object . assign ( { } , oldDraft , {
amount : parseFloat ( action . data . amount )
} ) ;
2018-01-11 12:54:20 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
draftTransaction : newDraft
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SET _DRAFT _TRANSACTION _ADDRESS ] = function ( state , action ) {
var oldDraft = state . draftTransaction ;
var newDraft = Object . assign ( { } , oldDraft , {
address : action . data . address
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
draftTransaction : newDraft
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEND _TRANSACTION _STARTED ] = function ( state ) {
var newDraftTransaction = Object . assign ( { } , state . draftTransaction , {
sending : true
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
draftTransaction : newDraftTransaction
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEND _TRANSACTION _COMPLETED ] = function ( state ) {
return Object . assign ( { } , state , {
draftTransaction : buildDraftTransaction ( )
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SEND _TRANSACTION _FAILED ] = function ( state , action ) {
var newDraftTransaction = Object . assign ( { } , state . draftTransaction , {
sending : false ,
error : action . data . error
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , {
draftTransaction : newDraftTransaction
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _STARTED ] = function ( state ) {
return Object . assign ( { } , state , {
sendingSupport : true
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _COMPLETED ] = function ( state ) {
return Object . assign ( { } , state , {
sendingSupport : false
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . SUPPORT _TRANSACTION _FAILED ] = function ( state , action ) {
2018-01-11 13:12:37 +01:00
return Object . assign ( { } , state , {
2018-01-17 06:28:01 +01:00
error : action . data . error ,
sendingSupport : false
2018-01-11 13:12:37 +01:00
} ) ;
} ;
2018-01-17 06:28:01 +01:00
reducers [ ACTIONS . FETCH _BLOCK _SUCCESS ] = function ( state , action ) {
2018-01-11 13:12:37 +01:00
var _action$data = action . data ,
2018-01-17 06:28:01 +01:00
block = _action$data . block ,
height = _action$data . block . height ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var blocks = Object . assign ( { } , state . blocks ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
blocks [ height ] = block ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
return Object . assign ( { } , state , { blocks : blocks } ) ;
2018-01-11 13:12:37 +01:00
} ;
2018-01-17 06:28:01 +01:00
function walletReducer ( ) {
2018-01-11 13:12:37 +01:00
var state = arguments . length > 0 && arguments [ 0 ] !== undefined ? arguments [ 0 ] : defaultState ;
var action = arguments [ 1 ] ;
var handler = reducers [ action . type ] ;
if ( handler ) return handler ( state , action ) ;
return state ;
}
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 30 */
2018-01-11 13:12:37 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
"use strict" ;
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
2018-01-17 06:28:01 +01:00
exports . makeSelectFetchingCostInfoForUri = exports . selectFetchingCostInfo = exports . selectCostForCurrentPageUri = exports . makeSelectCostInfoForUri = exports . selectAllCostInfoByUri = exports . selectState = undefined ;
2018-01-11 13:12:37 +01:00
2018-01-19 11:48:43 +01:00
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-11 13:12:37 +01:00
2018-01-19 11:48:43 +01:00
var _navigation = _ _webpack _require _ _ ( 1 ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . costInfo || { } ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var selectAllCostInfoByUri = exports . selectAllCostInfoByUri = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . byUri || { } ;
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var makeSelectCostInfoForUri = exports . makeSelectCostInfoForUri = function makeSelectCostInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectAllCostInfoByUri , function ( costInfos ) {
return costInfos && costInfos [ uri ] ;
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var selectCostForCurrentPageUri = exports . selectCostForCurrentPageUri = ( 0 , _reselect . createSelector ) ( selectAllCostInfoByUri , _navigation . selectCurrentParams , function ( costInfo , params ) {
return params . uri && costInfo [ params . uri ] ? costInfo [ params . uri ] . cost : undefined ;
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var selectFetchingCostInfo = exports . selectFetchingCostInfo = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . fetching || { } ;
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
var makeSelectFetchingCostInfoForUri = exports . makeSelectFetchingCostInfoForUri = function makeSelectFetchingCostInfoForUri ( uri ) {
return ( 0 , _reselect . createSelector ) ( selectFetchingCostInfo , function ( fetchingByUri ) {
return fetchingByUri && fetchingByUri [ uri ] ;
} ) ;
} ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
/***/ } ) ,
2018-01-17 13:24:35 +01:00
/* 31 */
2018-01-17 06:28:01 +01:00
/***/ ( function ( module , exports , _ _webpack _require _ _ ) {
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
"use strict" ;
2018-01-11 13:12:37 +01:00
2018-01-17 06:28:01 +01:00
Object . defineProperty ( exports , "__esModule" , {
value : true
} ) ;
exports . selectWunderBarIcon = exports . selectWunderBarAddress = exports . makeSelectSearchUris = exports . selectSearchUrisByQuery = exports . selectIsSearching = exports . selectSearchQuery = exports . selectState = undefined ;
2018-01-11 13:12:37 +01:00
2018-01-19 11:48:43 +01:00
var _navigation = _ _webpack _require _ _ ( 1 ) ;
2018-01-11 13:12:37 +01:00
2018-01-19 11:48:43 +01:00
var _reselect = _ _webpack _require _ _ ( 2 ) ;
2018-01-17 06:28:01 +01:00
var selectState = exports . selectState = function selectState ( state ) {
return state . search || { } ;
} ;
var selectSearchQuery = exports . selectSearchQuery = ( 0 , _reselect . createSelector ) ( _navigation . selectCurrentPage , _navigation . selectCurrentParams , function ( page , params ) {
return page === 'search' ? params && params . query : null ;
} ) ;
var selectIsSearching = exports . selectIsSearching = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . searching ;
} ) ;
var selectSearchUrisByQuery = exports . selectSearchUrisByQuery = ( 0 , _reselect . createSelector ) ( selectState , function ( state ) {
return state . urisByQuery ;
} ) ;
var makeSelectSearchUris = exports . makeSelectSearchUris = function makeSelectSearchUris ( query ) {
return (
// replace statement below is kind of ugly, and repeated in doSearch action
( 0 , _reselect . createSelector ) ( selectSearchUrisByQuery , function ( byQuery ) {
return byQuery [ query ? query . replace ( /^lbry:\/\//i , '' ) : query ] ;
} )
) ;
} ;
var selectWunderBarAddress = exports . selectWunderBarAddress = ( 0 , _reselect . createSelector ) ( _navigation . selectCurrentPage , _navigation . selectPageTitle , selectSearchQuery , function ( page , title , query ) {
return page !== 'search' ? title : query || title ;
} ) ;
var selectWunderBarIcon = exports . selectWunderBarIcon = ( 0 , _reselect . createSelector ) ( _navigation . selectCurrentPage , _navigation . selectCurrentParams , function ( page , params ) {
switch ( page ) {
case 'auth' :
return 'icon-user' ;
case 'settings' :
return 'icon-gear' ;
case 'help' :
return 'icon-question' ;
case 'report' :
return 'icon-file' ;
case 'downloaded' :
return 'icon-folder' ;
case 'published' :
return 'icon-folder' ;
case 'history' :
return 'icon-history' ;
case 'send' :
return 'icon-send' ;
case 'rewards' :
return 'icon-rocket' ;
case 'invite' :
return 'icon-envelope-open' ;
case 'getcredits' :
return 'icon-shopping-cart' ;
case 'wallet' :
case 'backup' :
return 'icon-bank' ;
case 'show' :
return 'icon-file' ;
case 'publish' :
return params . id ? _ _ ( 'icon-pencil' ) : _ _ ( 'icon-upload' ) ;
case 'developer' :
return 'icon-code' ;
case 'discover' :
case 'search' :
return 'icon-search' ;
case 'subscriptions' :
return 'icon-th-list' ;
default :
return 'icon-file' ;
}
} ) ;
2018-01-11 13:12:37 +01:00
2018-01-11 12:54:20 +01:00
/***/ } )
2018-01-17 06:28:01 +01:00
/******/ ] ) ;
} ) ;