-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard.1e6804f4b540d7b9e315.js
563 lines (457 loc) · 52.9 KB
/
dashboard.1e6804f4b540d7b9e315.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[34],{
/***/ 2832:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(389);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(552);
/* harmony import */ var stores_SettingsStore__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(713);
/* harmony import */ var stores_MarketsStore__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1270);
/* harmony import */ var alt_container__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(866);
/* harmony import */ var alt_container__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(alt_container__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _Dashboard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2833);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var DashboardContainer = function (_React$Component) {
_inherits(DashboardContainer, _React$Component);
function DashboardContainer() {
_classCallCheck(this, DashboardContainer);
return _possibleConstructorReturn(this, (DashboardContainer.__proto__ || Object.getPrototypeOf(DashboardContainer)).apply(this, arguments));
}
_createClass(DashboardContainer, [{
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
alt_container__WEBPACK_IMPORTED_MODULE_4___default.a,
{
stores: [stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"], stores_SettingsStore__WEBPACK_IMPORTED_MODULE_2__["default"], stores_MarketsStore__WEBPACK_IMPORTED_MODULE_3__["default"]],
inject: {
linkedAccounts: function linkedAccounts() {
return stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"].getState().linkedAccounts;
},
myHiddenAccounts: function myHiddenAccounts() {
return stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"].getState().myHiddenAccounts;
},
accountsReady: function accountsReady() {
return stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"].getState().accountsLoaded && stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"].getState().refsLoaded;
},
passwordAccount: function passwordAccount() {
return stores_AccountStore__WEBPACK_IMPORTED_MODULE_1__["default"].getState().passwordAccount;
},
currentEntry: stores_SettingsStore__WEBPACK_IMPORTED_MODULE_2__["default"].getState().viewSettings.get("dashboardEntry", "accounts")
}
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Dashboard__WEBPACK_IMPORTED_MODULE_5__["default"], this.props)
);
}
}]);
return DashboardContainer;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (DashboardContainer);
/***/ }),
/***/ 2833:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(389);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(526);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _DashboardList__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2831);
/* harmony import */ var _Account_RecentTransactions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2544);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(784);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react_translate_component__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _MarketCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2834);
/* harmony import */ var common_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(570);
/* harmony import */ var bitsharesjs_ws__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(488);
/* harmony import */ var _LoadingIndicator__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(864);
/* harmony import */ var _LoginSelector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2356);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(856);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var actions_SettingsActions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(714);
/* harmony import */ var stores_SettingsStore__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(713);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(772);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(alt_react__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _branding__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(572);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Dashboard = function (_React$Component) {
_inherits(Dashboard, _React$Component);
function Dashboard(props) {
_classCallCheck(this, Dashboard);
var _this = _possibleConstructorReturn(this, (Dashboard.__proto__ || Object.getPrototypeOf(Dashboard)).call(this));
var marketsByChain = {
"4018d784": Object(_branding__WEBPACK_IMPORTED_MODULE_14__["getFeaturedMarkets"])(),
"39f5e2ed": [["TEST", "PEG.FAKEUSD"], ["TEST", "BTWTY"]]
};
var chainID = bitsharesjs_ws__WEBPACK_IMPORTED_MODULE_7__["Apis"].instance().chain_id;
if (chainID) chainID = chainID.substr(0, 8);
_this.state = {
width: null,
showIgnored: false,
featuredMarkets: marketsByChain[chainID] || marketsByChain["4018d784"],
newAssets: [],
currentEntry: props.currentEntry
};
_this._setDimensions = _this._setDimensions.bind(_this);
// this._sortMarketsByVolume = this._sortMarketsByVolume.bind(this);
return _this;
}
_createClass(Dashboard, [{
key: "componentDidMount",
value: function componentDidMount() {
this._setDimensions();
window.addEventListener("resize", this._setDimensions, {
capture: false,
passive: true
});
}
}, {
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(nextProps, nextState) {
return !common_utils__WEBPACK_IMPORTED_MODULE_6__["default"].are_equal_shallow(nextState.featuredMarkets, this.state.featuredMarkets) || !common_utils__WEBPACK_IMPORTED_MODULE_6__["default"].are_equal_shallow(nextState.newAssets, this.state.newAssets) || nextProps.linkedAccounts !== this.props.linkedAccounts ||
// nextProps.marketStats !== this.props.marketStats ||
nextProps.ignoredAccounts !== this.props.ignoredAccounts || nextProps.passwordAccount !== this.props.passwordAccount || nextState.width !== this.state.width || nextProps.accountsReady !== this.props.accountsReady || nextState.showIgnored !== this.state.showIgnored || nextState.currentEntry !== this.state.currentEntry;
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
window.removeEventListener("resize", this._setDimensions);
}
}, {
key: "_setDimensions",
value: function _setDimensions() {
var width = window.innerWidth;
if (width !== this.state.width) {
this.setState({ width: width });
}
}
}, {
key: "_onToggleIgnored",
value: function _onToggleIgnored() {
this.setState({
showIgnored: !this.state.showIgnored
});
}
}, {
key: "_onSwitchType",
value: function _onSwitchType(type) {
this.setState({
currentEntry: type
});
actions_SettingsActions__WEBPACK_IMPORTED_MODULE_11__["default"].changeViewSetting({
dashboardEntry: type
});
}
}, {
key: "render",
value: function render() {
var _props = this.props,
linkedAccounts = _props.linkedAccounts,
myHiddenAccounts = _props.myHiddenAccounts,
accountsReady = _props.accountsReady,
passwordAccount = _props.passwordAccount;
var _state = this.state,
width = _state.width,
showIgnored = _state.showIgnored,
featuredMarkets = _state.featuredMarkets,
newAssets = _state.newAssets,
currentEntry = _state.currentEntry;
if (passwordAccount && !linkedAccounts.has(passwordAccount)) {
linkedAccounts = linkedAccounts.add(passwordAccount);
}
var names = linkedAccounts.toArray().sort();
if (passwordAccount && names.indexOf(passwordAccount) === -1) names.push(passwordAccount);
var ignored = myHiddenAccounts.toArray().sort();
var accountCount = linkedAccounts.size + myHiddenAccounts.size + (passwordAccount ? 1 : 0);
if (!accountsReady) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LoadingIndicator__WEBPACK_IMPORTED_MODULE_8__["default"], null);
}
var validMarkets = 0;
var markets = featuredMarkets.map(function (pair) {
// HACK: Show all defined markets
validMarkets++;
var className = "";
if (validMarkets > 15) {
className += " show-for-" + (!accountCount ? "xlarge" : "large");
} else if (validMarkets > 12) {
className += " show-for-" + (!accountCount ? "large" : "medium");
}
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_MarketCard__WEBPACK_IMPORTED_MODULE_5__["default"], {
key: pair[0] + "_" + pair[1],
marketId: pair[1] + "_" + pair[0],
"new": newAssets.indexOf(pair[1]) !== -1,
className: className,
quote: pair[0],
base: pair[1],
invert: pair[2],
hide: validMarkets > 29
});
}).filter(function (a) {
return !!a;
});
if (!accountCount) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_LoginSelector__WEBPACK_IMPORTED_MODULE_9__["default"], null);
}
var entries = ["accounts", "contacts", "recent"];
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ ref: "wrapper", className: "grid-block vertical" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
ref: "container",
className: "grid-container",
style: { padding: "2rem 8px" }
},
this.props.onlyAccounts ? null : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: "block-content-header",
style: { marginBottom: 15, paddingTop: 0 }
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_4___default.a, { content: "exchange.featured" })
),
this.props.onlyAccounts ? null : react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block small-up-1 medium-up-3 large-up-4 no-overflow fm-outer-container" },
markets
)
)
);
}
}]);
return Dashboard;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
var DashboardWrapper = function DashboardWrapper(props) {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Dashboard, props);
};
/* harmony default export */ __webpack_exports__["default"] = (DashboardWrapper = Object(alt_react__WEBPACK_IMPORTED_MODULE_13__["connect"])(DashboardWrapper, {
listenTo: function listenTo() {
return [stores_SettingsStore__WEBPACK_IMPORTED_MODULE_12__["default"]];
},
getProps: function getProps() {
return {
viewSettings: stores_SettingsStore__WEBPACK_IMPORTED_MODULE_12__["default"].getState().viewSettings
};
}
}));
/***/ }),
/***/ 2834:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(389);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(878);
/* harmony import */ var _Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(879);
/* harmony import */ var _Utility_AssetName__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1221);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(856);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var actions_MarketsActions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1271);
/* harmony import */ var stores_MarketsStore__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1270);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(772);
/* harmony import */ var alt_react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(alt_react__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var common_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(570);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(784);
/* harmony import */ var react_translate_component__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(react_translate_component__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(731);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var MarketCard = function (_React$Component) {
_inherits(MarketCard, _React$Component);
function MarketCard() {
_classCallCheck(this, MarketCard);
var _this = _possibleConstructorReturn(this, (MarketCard.__proto__ || Object.getPrototypeOf(MarketCard)).call(this));
_this.statsInterval = null;
_this.state = {
imgError: false
};
return _this;
}
_createClass(MarketCard, [{
key: "_checkStats",
value: function _checkStats() {
var newStats = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { close: {} };
var oldStats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { close: {} };
return newStats.volumeBase !== oldStats.volumeBase || !common_utils__WEBPACK_IMPORTED_MODULE_8__["default"].are_equal_shallow(newStats.close && newStats.close.base, oldStats.close && oldStats.close.base) || !common_utils__WEBPACK_IMPORTED_MODULE_8__["default"].are_equal_shallow(newStats.close && newStats.close.quote, oldStats.close && oldStats.close.quote);
}
}, {
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(np, ns) {
return this._checkStats(np.marketStats, this.props.marketStats) || np.base.get("id") !== this.props.base.get("id") || np.quote.get("id") !== this.props.quote.get("id") || ns.imgError !== this.state.imgError;
}
}, {
key: "componentWillMount",
value: function componentWillMount() {
actions_MarketsActions__WEBPACK_IMPORTED_MODULE_5__["default"].getMarketStats.defer(this.props.quote, this.props.base);
this.statsChecked = new Date();
this.statsInterval = setInterval(actions_MarketsActions__WEBPACK_IMPORTED_MODULE_5__["default"].getMarketStats.bind(this, this.props.quote, this.props.base), 35 * 1000);
}
}, {
key: "componentWillUnmount",
value: function componentWillUnmount() {
clearInterval(this.statsInterval);
}
}, {
key: "goToMarket",
value: function goToMarket(e) {
e.preventDefault();
var history = this.context.router.history;
history.push("/market/" + this.props.base.get("symbol") + "_" + this.props.quote.get("symbol"));
}
}, {
key: "_onError",
value: function _onError(imgName) {
if (!this.state.imgError) {
this.refs[imgName.toLowerCase()].src = "asset-symbols/bts.png";
this.setState({
imgError: true
});
}
}
}, {
key: "render",
value: function render() {
var _props = this.props,
hide = _props.hide,
isLowVolume = _props.isLowVolume,
base = _props.base,
quote = _props.quote,
marketStats = _props.marketStats;
if (isLowVolume || hide) return null;
function getImageName(asset) {
var symbol = asset.get("symbol");
return symbol;
// if (symbol === "OPEN.BTC" || symbol === "GDEX.BTC") return symbol;
// if (symbol.startsWith("ESCROW.")) return symbol;
// let imgName = asset.get("symbol").split(".");
// return imgName.length === 2 ? imgName[1] : imgName[0];
}
var imgName = getImageName(base);
// let marketID = base.get("symbol") + "_" + quote.get("symbol");
// let stats = marketStats;
var changeClass = !marketStats ? "" : parseFloat(marketStats.change) > 0 ? "change-up" : parseFloat(marketStats.change) < 0 ? "change-down" : "";
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{
className: classnames__WEBPACK_IMPORTED_MODULE_4___default()("grid-block no-overflow fm-container", this.props.className),
onClick: this.goToMarket.bind(this)
},
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block vertical shrink" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "v-align" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", {
className: "align-center",
ref: imgName.toLowerCase(),
onError: this._onError.bind(this, imgName),
style: { maxWidth: 70 },
src: "" + "asset-symbols/" + imgName.toLowerCase() + ".png"
})
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "grid-block vertical no-overflow" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "fm-name" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Utility_AssetName__WEBPACK_IMPORTED_MODULE_3__["default"], { dataPlace: "top", name: base.get("symbol") }),
" ",
":",
" ",
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Utility_AssetName__WEBPACK_IMPORTED_MODULE_3__["default"], { dataPlace: "top", name: quote.get("symbol") })
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "fm-volume" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_9___default.a, { content: "exchange.price" }),
":",
" ",
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "float-right" },
marketStats && marketStats.price ? common_utils__WEBPACK_IMPORTED_MODULE_8__["default"].price_text(marketStats.price.toReal(), base, quote) : null
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "fm-volume" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_9___default.a, { content: "exchange.volume" }),
":",
" ",
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "float-right" },
!marketStats ? null : common_utils__WEBPACK_IMPORTED_MODULE_8__["default"].format_volume(marketStats.volumeBase, quote.get("precision"))
)
),
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: "fm-change" },
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react_translate_component__WEBPACK_IMPORTED_MODULE_9___default.a, { content: "exchange.change" }),
":",
" ",
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
"div",
{ className: classnames__WEBPACK_IMPORTED_MODULE_4___default()("float-right", changeClass) },
!marketStats ? null : marketStats.change,
"%"
)
)
)
);
}
}]);
return MarketCard;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
MarketCard.contextTypes = {
router: prop_types__WEBPACK_IMPORTED_MODULE_10___default.a.object.isRequired
};
MarketCard.propTypes = {
quote: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_1__["default"].ChainAsset.isRequired,
base: _Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_1__["default"].ChainAsset.isRequired,
invert: prop_types__WEBPACK_IMPORTED_MODULE_10___default.a.bool
};
MarketCard.defaultProps = {
invert: true
};
MarketCard = Object(_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_2__["default"])(MarketCard);
var MarketCardWrapper = function (_React$Component2) {
_inherits(MarketCardWrapper, _React$Component2);
function MarketCardWrapper() {
_classCallCheck(this, MarketCardWrapper);
return _possibleConstructorReturn(this, (MarketCardWrapper.__proto__ || Object.getPrototypeOf(MarketCardWrapper)).apply(this, arguments));
}
_createClass(MarketCardWrapper, [{
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(MarketCard, this.props);
}
}]);
return MarketCardWrapper;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (Object(alt_react__WEBPACK_IMPORTED_MODULE_7__["connect"])(MarketCardWrapper, {
listenTo: function listenTo() {
return [stores_MarketsStore__WEBPACK_IMPORTED_MODULE_6__["default"]];
},
getProps: function getProps(props) {
return {
marketStats: stores_MarketsStore__WEBPACK_IMPORTED_MODULE_6__["default"].getState().allMarketStats.get(props.marketId)
};
}
}));
/***/ })
}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGFzaGJvYXJkLjFlNjgwNGY0YjU0MGQ3YjllMzE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL2FwcC9jb21wb25lbnRzL0Rhc2hib2FyZC9EYXNoYm9hcmRDb250YWluZXIuanN4Iiwid2VicGFjazovLy9hcHAvY29tcG9uZW50cy9EYXNoYm9hcmQvRGFzaGJvYXJkLmpzeCIsIndlYnBhY2s6Ly8vYXBwL2NvbXBvbmVudHMvRGFzaGJvYXJkL01hcmtldENhcmQuanN4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCBBY2NvdW50U3RvcmUgZnJvbSBcInN0b3Jlcy9BY2NvdW50U3RvcmVcIjtcbmltcG9ydCBTZXR0aW5nc1N0b3JlIGZyb20gXCJzdG9yZXMvU2V0dGluZ3NTdG9yZVwiO1xuaW1wb3J0IE1hcmtldHNTdG9yZSBmcm9tIFwic3RvcmVzL01hcmtldHNTdG9yZVwiO1xuXG5pbXBvcnQgQWx0Q29udGFpbmVyIGZyb20gXCJhbHQtY29udGFpbmVyXCI7XG5pbXBvcnQgRGFzaGJvYXJkIGZyb20gXCIuL0Rhc2hib2FyZFwiO1xuXG5jbGFzcyBEYXNoYm9hcmRDb250YWluZXIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICAgIHJlbmRlcigpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxBbHRDb250YWluZXJcbiAgICAgICAgICAgICAgICBzdG9yZXM9e1tBY2NvdW50U3RvcmUsIFNldHRpbmdzU3RvcmUsIE1hcmtldHNTdG9yZV19XG4gICAgICAgICAgICAgICAgaW5qZWN0PXt7XG4gICAgICAgICAgICAgICAgICAgIGxpbmtlZEFjY291bnRzOiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQWNjb3VudFN0b3JlLmdldFN0YXRlKCkubGlua2VkQWNjb3VudHM7XG4gICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgIG15SGlkZGVuQWNjb3VudHM6ICgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBBY2NvdW50U3RvcmUuZ2V0U3RhdGUoKS5teUhpZGRlbkFjY291bnRzO1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBhY2NvdW50c1JlYWR5OiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFjY291bnRTdG9yZS5nZXRTdGF0ZSgpLmFjY291bnRzTG9hZGVkICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgQWNjb3VudFN0b3JlLmdldFN0YXRlKCkucmVmc0xvYWRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgcGFzc3dvcmRBY2NvdW50OiAoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQWNjb3VudFN0b3JlLmdldFN0YXRlKCkucGFzc3dvcmRBY2NvdW50O1xuICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICBjdXJyZW50RW50cnk6IFNldHRpbmdzU3RvcmUuZ2V0U3RhdGUoKS52aWV3U2V0dGluZ3MuZ2V0KFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJkYXNoYm9hcmRFbnRyeVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJhY2NvdW50c1wiXG4gICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICB9fVxuICAgICAgICAgICAgPlxuICAgICAgICAgICAgICAgIDxEYXNoYm9hcmQgey4uLnRoaXMucHJvcHN9IC8+XG4gICAgICAgICAgICA8L0FsdENvbnRhaW5lcj5cbiAgICAgICAgKTtcbiAgICB9XG59XG5cbmV4cG9ydCBkZWZhdWx0IERhc2hib2FyZENvbnRhaW5lcjtcbiIsImltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCBJbW11dGFibGUgZnJvbSBcImltbXV0YWJsZVwiO1xuaW1wb3J0IERhc2hib2FyZExpc3QgZnJvbSBcIi4vRGFzaGJvYXJkTGlzdFwiO1xuaW1wb3J0IHtSZWNlbnRUcmFuc2FjdGlvbnN9IGZyb20gXCIuLi9BY2NvdW50L1JlY2VudFRyYW5zYWN0aW9uc1wiO1xuaW1wb3J0IFRyYW5zbGF0ZSBmcm9tIFwicmVhY3QtdHJhbnNsYXRlLWNvbXBvbmVudFwiO1xuaW1wb3J0IE1hcmtldENhcmQgZnJvbSBcIi4vTWFya2V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cy5zdGF0ZSA9IHtcbiAgICAgICAgICAgIHdpZHRoOiBudWxsLFxuICAgICAgICAgICAgc2hvd0lnbm9yZWQ6IGZhbHNlLFxuICAgICAgICAgICAgZmVhdHVyZWRNYXJrZXRzOlxuICAgICAgICAgICAgICAgIG1hcmtldHNCeUNoYWluW2NoYWluSURdIHx8IG1hcmtldHNCeUNoYWluW1wiNDAxOGQ3ODRcIl0sXG4gICAgICAgICAgICBuZXdBc3NldHM6IFtdLFxuICAgICAgICAgICAgY3VycmVudEVudHJ5OiBwcm9wcy5jdXJyZW50RW50cnlcbiAgICAgICAgfTtcblxuICAgICAgICB0aGlzLl9zZXREaW1lbnNpb25zID0gdGhpcy5fc2V0RGltZW5zaW9ucy5iaW5kKHRoaXMpO1xuICAgICAgICAvLyB0aGlzLl9zb3J0TWFya2V0c0J5Vm9sdW1lID0gdGhpcy5fc29ydE1hcmtldHNCeVZvbHVtZS5iaW5kKHRoaXMpO1xuICAgIH1cblxuICAgIGNvbXBvbmVudERpZE1vdW50KCkge1xuICAgICAgICB0aGlzLl9zZXREaW1lbnNpb25zKCk7XG5cbiAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoXCJyZXNpemVcIiwgdGhpcy5fc2V0RGltZW5zaW9ucywge1xuICAgICAgICAgICAgY2FwdHVyZTogZmFsc2UsXG4gICAgICAgICAgICBwYXNzaXZlOiB0cnVlXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHNob3VsZENvbXBvbmVudFVwZGF0ZShuZXh0UHJvcHMsIG5leHRTdGF0ZSkge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgIXV0aWxzLmFyZV9lcXVhbF9zaGFsbG93KFxuICAgICAgICAgICAgICAgIG5leHRTdGF0ZS5mZWF0dXJlZE1hcmtldHMsXG4gICAgICAgICAgICAgICAgdGhpcy5zdGF0ZS5mZWF0dXJlZE1hcmtldHNcbiAgICAgICAgICAgICkgfHxcbiAgICAgICAgICAgICF1dGlscy5h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XG4gICAgICAgIGlmICh3aWR0aCAhPT0gdGhpcy5zdGF0ZS53aWR0aCkge1xuICAgICAgICAgICAgdGhpcy5zZXRTdGF0ZSh7d2lkdGh9KTtcbiAgICAgICAgfVxuICAgIH1cblxuICAgIF9vblRvZ2dsZUlnbm9yZWQoKSB7XG4gICAgICAgIHRoaXMuc2V0U3RhdGUoe1xuICAgICAgICAgICAgc2hvd0lnbm9yZWQ6ICF0aGlzLnN0YXRlLnNob3dJZ25vcmVkXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIF9vblN3aXRjaFR5cGUodHlwZSkge1xuICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgIGN1cnJlbnRFbnRyeTogdHlwZVxuICAgICAgICB9KTtcbiAgICAgICAgU2V0dGluZ3NBY3Rpb25zLmNoYW5nZVZpZXdTZXR0aW5nKHtcbiAgICAgICAgICAgIGRhc2hib2FyZEVudHJ5OiB0eXBlXG4gICAgICAgIH0pO1xuICAgIH1cblxuICAgIHJlbmRlcigpIHtcbiAgICAgICAgbGV0IHtcbiAgICAgICAgICAgIGxpbmtlZEFjY291bnRzLFxuICAgICAgICAgICAgbXlIaWRkZW5BY2NvdW50cyxcbiAgICAgICAgICAgIGFjY291bnRzUmVhZHksXG4gICAgICAgICAgICBwYXNzd29yZEFjY291bnRcbiAgICAgICAgfSA9IHRoaXMucHJvcHM7XG4gICAgICAgIGxldCB7XG4gICAgICAgICAgICB3aWR0aCxcbiAgICAgICAgICAgIHNob3dJZ25vcmVkLFxuICAgICAgICAgICAgZmVhdHVyZWRNYXJrZXRzLFxuICAgICAgICAgICAgbmV3QXNzZXRzLFxuICAgICAgICAgICAgY3VycmVudEVudHJ5XG4gICAgICAgIH0gPSB0aGlzLnN0YXRlO1xuXG4gICAgICAgIGlmIChwYXNzd29yZEFjY291bnQgJiYgIWxpbmtlZEFjY291bnRzLmhhcyhwYXNzd29yZEFjY291bnQpKSB7XG4gICAgICAgICAgICBsaW5rZWRBY2NvdW50cyA9IGxpbmtlZEFjY291bnRzLmFkZChwYXNzd29yZEFjY291bnQpO1xuICAgICAgICB9XG4gICAgICAgIGxldCBuYW1lcyA9IGxpbmtlZEFjY291bnRzLnRvQXJyYXkoKS5zb3J0KCk7XG4gICAgICAgIGlmIChwYXNzd29yZEFjY291bnQgJiYgbmFtZXMuaW5kZXhPZihwYXNzd29yZEFjY291bnQpID09PSAtMSlcbiAgICAgICAgICAgIG5hbWVzLnB1c2gocGFzc3dvcmRBY2NvdW50KTtcbiAgICAgICAgbGV0IGlnbm9yZWQgPSBteUhpZGRlbkFjY291bnRzLnRvQXJyYXkoKS5zb3J0KCk7XG5cbiAgICAgICAgbGV0IGFjY291bnRDb3VudCA9XG4gICAgICAgICAgICBsaW5rZWRBY2NvdW50cy5zaXplICtcbiAgICAgICAgICAgIG15SGlkZGVuQWNjb3VudHMuc2l6ZSArXG4gICAgICAgICAgICAocGFzc3dvcmRBY2NvdW50ID8gMSA6IDApO1xuXG4gICAgICAgIGlmICghYWNjb3VudHNSZWFkeSkge1xuICAgICAgICAgICAgcmV0dXJuIDxMb2FkaW5nSW5kaWNhdG9yIC8+O1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IHZhbGlkTWFya2V0cyA9IDA7XG5cbiAgICAgICAgbGV0IG1hcmtldHMgPSBmZWF0dXJlZE1hcmtldHNcbiAgICAgICAgICAgIC5tYXAocGFpciA9PiB7XG4gICAgICAgICAgICAgICAgLy8gSEFDSzogU2hvdyBhbGwgZGVmaW5lZCBtYXJrZXRzXG4gICAgICAgICAgICAgICAgdmFsaWRNYXJrZXRzKys7XG4gICAgICAgICAgICAgICAgbGV0IGNsYXNzTmFtZSA9IFwiXCI7XG4gICAgICAgICAgICAgICAgaWYgKHZhbGlkTWFya2V0cyA+IDE1KSB7XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZSArPSBgIHNob3ctZm9yLSR7XG4gICAgICAgICAgICAgICAgICAgICAgICAhYWNjb3VudENvdW50ID8gXCJ4bGFyZ2VcIiA6IFwibGFyZ2VcIlxuICAgICAgICAgICAgICAgICAgICB9YDtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbGlkTWFya2V0cyA+IDEyKSB7XG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZSArPSBgIHNob3ctZm9yLSR7XG4gICAgICAgICAgICAgICAgICAgICAgICAhYWNjb3VudENvdW50ID8gXCJsYXJnZVwiIDogXCJtZWRpdW1cIlxuICAgICAgICAgICAgICAgICAgICB9YDtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICA8TWFya2V0Q2FyZFxuICAgICAgICAgICAgICAgICAgICAgICAga2V5PXtwYWlyWzBdICsgXCJfXCIgKyBwYWlyWzFdfVxuICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0SWQ9e3BhaXJbMV0gKyBcIl9cIiArIHBhaXJbMF19XG4gICAgICAgICAgICAgICAgICAgICAgICBuZXc9e25ld0Fzc2V0cy5pbmRleE9mKHBhaXJbMV0pICE9PSAtMX1cbiAgICAgICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT17Y2xhc3NOYW1lfVxuICAgICAgICAgICAgICAgICAgICAgICAgcXVvdGU9e3BhaXJbMF19XG4gICAgICAgICAgICAgICAgICAgICAgICBiYXNlPXtwYWlyWzFdfVxuICAgICAgICAgICAgICAgICAgICAgICAgaW52ZXJ0PXtwYWlyWzJdfVxuICAgICAgICAgICAgICAgICAgICAgICAgaGlkZT17dmFsaWRNYXJrZXRzID4gMjl9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAuZmlsdGVyKGEgPT4gISFhKTtcblxuICAgICAgICBpZiAoIWFjY291bnRDb3VudCkge1xuICAgICAgICAgICAgcmV0dXJuIDxMb2dpblNlbGVjdG9yIC8+O1xuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgZW50cmllcyA9IFtcImFjY291bnRzXCIsIFwiY29udGFjdHNcIiwgXCJyZWNlbnRcIl07XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxkaXYgcmVmPVwid3JhcHBlclwiIGNsYXNzTmFtZT1cImdyaWQtYmxvY2sgdmVydGljYWxcIj5cbiAgICAgICAgICAgICAgICA8ZGl2XG4gICAgICAgICAgICAgICAgICAgIHJlZj1cImNvbnRhaW5lclwiXG4gICAgICAgICAgICAgICAgICAgIGNsYXNzTmFtZT1cImdyaWQtY29udGFpbmVyXCJcbiAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3twYWRkaW5nOiBcIjJyZW0gOHB4XCJ9fVxuICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAge3RoaXMucHJvcHMub25seUFjY291bnRzID8gbnVsbCA6IChcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJibG9jay1jb250ZW50LWhlYWRlclwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3R5bGU9e3ttYXJnaW5Cb3R0b206IDE1LCBwYWRkaW5nVG9wOiAwfX1cbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8VHJhbnNsYXRlIGNvbnRlbnQ9XCJleGNoYW5nZS5mZWF0dXJlZFwiIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgICAgICAge3RoaXMucHJvcHMub25seUFjY291bnRzID8gbnVsbCA6IChcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZ3JpZC1ibG9jayBzbWFsbC11cC0xIG1lZGl1bS11cC0zIGxhcmdlLXVwLTQgbm8tb3ZlcmZsb3cgZm0tb3V0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biAgICAgICAgICAgIG5ld1N0YXRzLnZvbHVtZUJhc2UgIT09IG9sZFN0YXRzLnZvbHVtZUJhc2UgfHxcbiAgICAgICAgICAgICF1dGlscy5hcmVfZXF1YWxfc2hhbGxvdyhcbiAgICAgICAgICAgICAgICBuZXdTdGF0cy5jbG9zZSAmJiBuZXdTdGF0cy5jbG9zZS5iYXNlLFxuICAgICAgICAgICAgICAgIG9sZFN0YXRzLmNsb3NlICYmIG9sZFN0YXRzLmNsb3NlLmJhc2VcbiAgICAgICAgICAgICkgfHxcbiAgICAgICAgICAgICF1dGlscy5hcmVfZXF1YWxfc2hhbGxvdyhcbiAgICAgICAgICAgICAgICBuZXdTdGF0cy5jbG9zZSAmJiBuZXdTdGF0cy5jbG9zZS5xdW90ZSxcbiAgICAgICAgICAgICAgICBvbGRTdGF0cy5jbG9zZSAmJiBvbGRTdGF0cy5jbG9zZS5xdW90ZVxuICAgICAgICAgICAgKVxuICAgICAgICApO1xuICAgIH1cblxuICAgIHNob3VsZENvbXBvbmVudFVwZGF0ZShucCwgbnMpIHtcbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIHRoaXMuX2NoZWNrU3RhdHMobnAubWFya2V0U3RhdHMsIHRoaXMucHJvcHMubWFya2V0U3RhdHMpIHx8XG4gICAgICAgICAgICBucC5iYXNlLmdldChcImlkXCIpICE9PSB0aGlzLnByb3BzLmJhc2UuZ2V0KFwiaWRcIikgfHxcbiAgICAgICAgICAgIG5wLnF1b3RlLmdldChcImlkXCIpICE9PSB0aGlzLnByb3BzLnF1b3RlLmdldChcImlkXCIpIHx8XG4gICAgICAgICAgICBucy5pbWdFcnJvciAhPT0gdGhpcy5zdGF0ZS5pbWdFcnJvclxuICAgICAgICApO1xuICAgIH1cblxuICAgIGNvbXBvbmVudFdpbGxNb3VudCgpIHtcbiAgICAgICAgTWFya2V0c0FjdGlvbnMuZ2V0TWFya2V0U3RhdHMuZGVmZXIodGhpcy5wcm9wcy5xdW90ZSwgdGhpcy5wcm9wcy5iYXNlKTtcbiAgICAgICAgdGhpcy5zdGF0c0NoZWNrZWQgPSBuZXcgRGF0ZSgpO1xuICAgICAgICB0aGlzLnN0YXRzSW50ZXJ2YWwgPSBzZXRJbnRlcnZhbChcbiAgICAgICAgICAgIE1hcmtldHNBY3Rpb25zLmdldE1hcmtldFN0YXRzLmJpbmQoXG4gICAgICAgICAgICAgICAgdGhpcyxcbiAgICAgICAgICAgICAgICB0aGlzLnByb3BzLnF1b3RlLFxuICAgICAgICAgICAgICAgIHRoaXMucHJvcHMuYmFzZVxuICAgICAgICAgICAgKSxcbiAgICAgICAgICAgIDM1ICogMTAwMFxuICAgICAgICApO1xuICAgIH1cblxuICAgIGNvbXBvbmVudFdpbGxVbm1vdW50KCkge1xuICAgICAgICBjbGVhckludGVydmFsKHRoaXMuc3RhdHNJbnRlcnZhbCk7XG4gICAgfVxuXG4gICAgZ29Ub01hcmtldChlKSB7XG4gICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICB2YXIgaGlzdG9yeSA9IHRoaXMuY29udGV4dC5yb3V0ZXIuaGlzdG9yeTtcblxuICAgICAgICBoaXN0b3J5LnB1c2goXG4gICAgICAgICAgICBgL21hcmtldC8ke3RoaXMucHJvcHMuYmFzZS5nZXQoXCJzeW1ib2xcIil9XyR7dGhpcy5wcm9wcy5xdW90ZS5nZXQoXG4gICAgICAgICAgICAgICAgXCJzeW1ib2xcIlxuICAgICAgICAgICAgKX1gXG4gICAgICAgICk7XG4gICAgfVxuXG4gICAgX29uRXJyb3IoaW1nTmFtZSkge1xuICAgICAgICBpZiAoIXRoaXMuc3RhdGUuaW1nRXJyb3IpIHtcbiAgICAgICAgICAgIHRoaXMucmVmc1tpbWdOYW1lLnRvTG93ZXJDYXNlKCldLnNyYyA9IFwiYXNzZXQtc3ltYm9scy9idHMucG5nXCI7XG4gICAgICAgICAgICB0aGlzLnNldFN0YXRlKHtcbiAgICAgICAgICAgICAgICBpbWdFcnJvcjogdHJ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2VGbG9hdChtYXJrZXRTdGF0cy5jaGFuZ2UpID4gMFxuICAgICAgICAgICAgICAgID8gXCJjaGFuZ2UtdXBcIlxuICAgICAgICAgICAgICAgIDogcGFyc2VGbG9hdChtYXJrZXRTdGF0cy5jaGFuZ2UpIDwgMFxuICAgICAgICAgICAgICAgICAgICA/IFwiY2hhbmdlLWRvd25cIlxuICAgICAgICAgICAgICAgICAgICA6IFwiXCI7XG5cbiAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgIDxkaXZcbiAgICAgICAgICAgICAgICBjbGFzc05hbWU9e2NuYW1lcyhcbiAgICAgICAgICAgICAgICAgICAgXCJncmlkLWJsb2NrIG5vLW92ZXJmbG93IGZtLWNvbnRhaW5lclwiLFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnByb3BzLmNsYXNzTmFtZVxuICAgICAgICAgICAgICAgICl9XG4gICAgICAgICAgICAgICAgb25DbGljaz17dGhpcy5nb1RvTWFya2V0LmJpbmQodGhpcyl9XG4gICAgICAgICAgICA+XG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJncmlkLWJsb2NrIHZlcnRpY2FsIHNocmlua1wiPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cInYtYWxpZ25cIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxpbWdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFzc05hbWU9XCJhbGlnbi1jZW50ZXJcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZj17aW1nTmFtZS50b0xvd2VyQ2FzZSgpfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9uRXJyb3I9e3RoaXMuX29uRXJyb3IuYmluZCh0aGlzLCBpbWdOYW1lKX1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHlsZT17e21heFdpZHRoOiA3MH19XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjPXtgJHtfX0JBU0VfVVJMX199YXNzZXQtc3ltYm9scy8ke2ltZ05hbWUudG9Mb3dlckNhc2UoKX0ucG5nYH1cbiAgICAgICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOYW1lPVwiZ3JpZC1ibG9jayB2ZXJ0aWNhbCBuby1vdmVyZmxvd1wiPlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZtLW5hbWVcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxBc3NldE5hbWUgZGF0YVBsYWNlPVwidG9wXCIgbmFtZT17YmFzZS5nZXQoXCJzeW1ib2xcIil9IC8+e1wiIFwifVxuICAgICAgICAgICAgICAgICAgICAgICAgOntcIiBcIn1cbiAgICAgICAgICAgICAgICAgICAgICAgIDxBc3NldE5hbWUgZGF0YVBsYWNlPVwidG9wXCIgbmFtZT17cXVvdGUuZ2V0KFwic3ltYm9sXCIpfSAvPlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbS12b2x1bWVcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFuc2xhdGUgY29udGVudD1cImV4Y2hhbmdlLnByaWNlXCIgLz46e1wiIFwifVxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbG9hdC1yaWdodFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHttYXJrZXRTdGF0cyAmJiBtYXJrZXRTdGF0cy5wcmljZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHV0aWxzLnByaWNlX3RleHQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtldFN0YXRzLnByaWNlLnRvUmVhbCgpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYXNlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxdW90ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsfVxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzTmFtZT1cImZtLXZvbHVtZVwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgPFRyYW5zbGF0ZSBjb250ZW50PVwiZXhjaGFuZ2Uudm9sdW1lXCIgLz46e1wiIFwifVxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbG9hdC1yaWdodFwiPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHshbWFya2V0U3RhdHNcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBudWxsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogdXRpbHMuZm9ybWF0X3ZvbHVtZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFya2V0U3RhdHMudm9sdW1lQmFzZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcXVvdGUuZ2V0KFwicHJlY2lzaW9uXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzc05hbWU9XCJmbS1jaGFuZ2VcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxUcmFuc2xhdGUgY29udGVudD1cImV4Y2hhbmdlLmNoYW5nZVwiIC8+OntcIiBcIn1cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3NOY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