-
Notifications
You must be signed in to change notification settings - Fork 1
/
account~asset~bots~deposit-withdraw~exchange~explorer.c2a368a5b1819c751311.js
309 lines (235 loc) · 25.8 KB
/
account~asset~bots~deposit-withdraw~exchange~explorer.c2a368a5b1819c751311.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
(this["webpackJsonp"] = this["webpackJsonp"] || []).push([[14],{
/***/ 2773:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Bots_libs_AssetWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2774);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(824);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
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 _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 AssetImage = function (_React$Component) {
_inherits(AssetImage, _React$Component);
function AssetImage(props) {
_classCallCheck(this, AssetImage);
var _this = _possibleConstructorReturn(this, (AssetImage.__proto__ || Object.getPrototypeOf(AssetImage)).call(this, props));
_this.state = {
imgError: false
};
return _this;
}
_createClass(AssetImage, [{
key: "shouldComponentUpdate",
value: function shouldComponentUpdate(np, ns) {
return this.props.asset !== np.asset || this.props.maxWidth !== np.maxWidth || this.props.whiteList !== np.whiteList || this.state.imgError !== ns.imgError;
}
}, {
key: "_onError",
value: function _onError(imgName) {
if (!this.state.imgError) {
if (this.props.replaceNoneToBts) this.refs[imgName.toLowerCase()].src = "" + "asset-symbols/bts.png";else this.refs[imgName.toLowerCase()].remove();
this.setState({
imgError: true
});
}
}
}, {
key: "render",
value: function render() {
var asset = this.props.asset;
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(asset);
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("img", {
ref: imgName.toLowerCase(),
className: "column-hide-small",
onError: this._onError.bind(this, imgName),
style: {
maxWidth: this.props.maxWidth,
marginRight: 5,
marginTop: "-3px"
},
src: "" + "asset-symbols/" + imgName.toLowerCase() + ".png"
});
}
}]);
return AssetImage;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
AssetImage.propTypes = {
replaceNoneToBts: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
maxWidth: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number
};
AssetImage.defaultProps = {
replaceNoneToBts: true,
maxWidth: 20
};
AssetImage = Object(_Bots_libs_AssetWrapper__WEBPACK_IMPORTED_MODULE_1__["default"])(AssetImage);
var AssetImageWrapper = function (_React$Component2) {
_inherits(AssetImageWrapper, _React$Component2);
function AssetImageWrapper() {
_classCallCheck(this, AssetImageWrapper);
return _possibleConstructorReturn(this, (AssetImageWrapper.__proto__ || Object.getPrototypeOf(AssetImageWrapper)).apply(this, arguments));
}
_createClass(AssetImageWrapper, [{
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(AssetImage, _extends({}, this.props, { asset: this.props.name }));
}
}]);
return AssetImageWrapper;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
/* harmony default export */ __webpack_exports__["default"] = (AssetImageWrapper);
/***/ }),
/***/ 2774:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(395);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var common_reactUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2089);
/* harmony import */ var components_Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1973);
/* harmony import */ var components_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1974);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(518);
/* harmony import */ var immutable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(immutable__WEBPACK_IMPORTED_MODULE_4__);
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 _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 DynamicObjectResolver = function (_React$Component) {
_inherits(DynamicObjectResolver, _React$Component);
function DynamicObjectResolver() {
_classCallCheck(this, DynamicObjectResolver);
var _this = _possibleConstructorReturn(this, (DynamicObjectResolver.__proto__ || Object.getPrototypeOf(DynamicObjectResolver)).call(this));
_this.getDynamicObject = _this.getDynamicObject.bind(_this);
return _this;
}
_createClass(DynamicObjectResolver, [{
key: "getDynamicObject",
value: function getDynamicObject(id) {
return this.props.dos.find(function (a) {
return a && a.get("id") === id;
});
}
}, {
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.only(this.props.children), _extends({}, this.props, {
getDynamicObject: this.getDynamicObject
}));
}
}]);
return DynamicObjectResolver;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
DynamicObjectResolver.propTypes = {
dos: components_Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_2__["default"].ChainObjectsList
};
DynamicObjectResolver.defaultProps = {
dos: Object(immutable__WEBPACK_IMPORTED_MODULE_4__["List"])()
};
DynamicObjectResolver = Object(components_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_3__["default"])(DynamicObjectResolver);
/**
* HOC that resolves either a number of assets directly with ChainAsset,
* or a list of assets with ChainAssets
*
* Options
* -'propNames' an array of prop names to be resolved as assets. (defaults to "asset" or "assets")
* -'defaultProps' default values to use for objects (optional)
* -'asList' defines whether to use ChainAssetsList or not (useful for resolving large quantities of assets)
* -'withDynamic' defines whether to also resolve dynamic objects or not
*/
function AssetWrapper(Component) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
options.propNames = options.propNames || [!!options.asList ? "assets" : "asset"];
var finalPropTypes = options.propNames.reduce(function (res, type) {
res[type] = options.asList ? components_Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_2__["default"].ChainAssetsList : components_Utility_ChainTypes__WEBPACK_IMPORTED_MODULE_2__["default"].ChainAsset.isRequired;
return res;
}, {});
var defaultProps = Object.keys(finalPropTypes).reduce(function (res, key) {
var current = options.defaultProps && options.defaultProps[key];
res[key] = !!options.asList ? Object(immutable__WEBPACK_IMPORTED_MODULE_4__["List"])(current || []) : current || "1.3.0";
return res;
}, {});
if (options.defaultProps && !!options.defaultProps.tempComponent) {
defaultProps.tempComponent = options.defaultProps.tempComponent;
}
var AssetsResolver = function (_React$Component2) {
_inherits(AssetsResolver, _React$Component2);
function AssetsResolver() {
_classCallCheck(this, AssetsResolver);
return _possibleConstructorReturn(this, (AssetsResolver.__proto__ || Object.getPrototypeOf(AssetsResolver)).apply(this, arguments));
}
_createClass(AssetsResolver, [{
key: "render",
value: function render() {
var _this3 = this;
var finalAssets = {};
var passTroughProps = {};
var dos = Object(immutable__WEBPACK_IMPORTED_MODULE_4__["List"])();
Object.keys(this.props).forEach(function (prop) {
if (_this3.props[prop] && options.propNames.indexOf(prop) !== -1) {
if (options.withDynamic) {
if (!options.asList) {
dos = dos.push(_this3.props[prop].get("dynamic_asset_data_id"));
} else {
_this3.props[prop].forEach(function (a) {
if (!!a) dos = dos.push(a.get("dynamic_asset_data_id"));
});
}
}
finalAssets[prop] = options.asList ? _this3.props[prop].filter(function (a) {
return !!a;
}) : _this3.props[prop];
} else {
passTroughProps[prop] = _this3.props[prop];
}
});
var wrapped = react__WEBPACK_IMPORTED_MODULE_0___default.a.cloneElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Children.only(this.props.children), _extends({}, passTroughProps, finalAssets));
if (options.withDynamic) return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
DynamicObjectResolver,
{ dos: dos },
wrapped
);else return wrapped;
}
}]);
return AssetsResolver;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
AssetsResolver.propTypes = finalPropTypes;
AssetsResolver.defaultProps = defaultProps;
AssetsResolver = Object(components_Utility_BindToChainState__WEBPACK_IMPORTED_MODULE_3__["default"])(AssetsResolver);
var Wrapper = function (_React$Component3) {
_inherits(Wrapper, _React$Component3);
function Wrapper() {
_classCallCheck(this, Wrapper);
return _possibleConstructorReturn(this, (Wrapper.__proto__ || Object.getPrototypeOf(Wrapper)).apply(this, arguments));
}
_createClass(Wrapper, [{
key: "render",
value: function render() {
return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(
AssetsResolver,
this.props,
react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Component, { ref: "bound_component" })
);
}
}]);
return Wrapper;
}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
Wrapper.displayName = "Wrapper(" + Object(common_reactUtils__WEBPACK_IMPORTED_MODULE_1__["getDisplayName"])(Component) + ")";
return Wrapper;
}
/* harmony default export */ __webpack_exports__["default"] = (AssetWrapper);
/***/ })
}]);
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWNjb3VudH5hc3NldH5ib3RzfmRlcG9zaXQtd2l0aGRyYXd+ZXhjaGFuZ2V+ZXhwbG9yZXIuYzJhMzY4YTViMTgxOWM3NTEzMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXBwL2NvbXBvbmVudHMvVXRpbGl0eS9Bc3NldEltYWdlLmpzeCIsIndlYnBhY2s6Ly8vYXBwL2NvbXBvbmVudHMvQm90cy9saWJzL0Fzc2V0V3JhcHBlci5qc3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IFJlYWN0IGZyb20gXCJyZWFjdFwiO1xuaW1wb3J0IEFzc2V0V3JhcHBlciBmcm9tIFwiLi4vQm90cy9saWJzL0Fzc2V0V3JhcHBlclwiO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tIFwicHJvcC10eXBlc1wiO1xuXG5jbGFzcyBBc3NldEltYWdlIGV4dGVuZHMgUmVhY3QuQ29tcG9uZW50IHtcbiAgICBzdGF0aWMgcHJvcFR5cGVzID0ge1xuICAgICAgICByZXBsYWNlTm9uZVRvQnRzOiBQcm9wVHlwZXMuYm9vbCxcbiAgICAgICAgbWF4V2lkdGg6IFByb3BUeXBlcy5udW1iZXJcbiAgICB9O1xuXG4gICAgc3RhdGljIGRlZmF1bHRQcm9wcyA9IHtcbiAgICAgICAgcmVwbGFjZU5vbmVUb0J0czogdHJ1ZSxcbiAgICAgICAgbWF4V2lkdGg6IDIwXG4gICAgfTtcblxuICAgIGNvbnN0cnVjdG9yKHByb3BzKSB7XG4gICAgICAgIHN1cGVyKHByb3BzKTtcblxuICAgICAgICB0aGlzLnN0YXRlID0ge1xuICAgICAgICAgICAgaW1nRXJyb3I6IGZhbHNlXG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgc2hvdWxkQ29tcG9uZW50VXBkYXRlKG5wLCBucykge1xuICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgdGhpcy5wcm9wcy5hc3NldCAhPT0gbnAuYXNzZXQgfHxcbiAgICAgICAgICAgIHRoaXMucHJvcHMubWF4V2lkdGggIT09IG5wLm1heFdpZHRoIHx8XG4gICAgICAgICAgICB0aGlzLnByb3BzLndoaXRlTGlzdCAhPT0gbnAud2hpdGVMaXN0IHx8XG4gICAgICAgICAgICB0aGlzLnN0YXRlLmltZ0Vycm9yICE9PSBucy5pbWdFcnJvclxuICAgICAgICApO1xuICAgIH1cblxuICAgIF9vbkVycm9yKGltZ05hbWUpIHtcbiAgICAgICAgaWYgKCF0aGlzLnN0YXRlLmltZ0Vycm9yKSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcm9wcy5yZXBsYWNlTm9uZVRvQnRzKVxuICAgICAgICAgICAgICAgIHRoaXMucmVmc1tcbiAgICAgICAgICAgICAgICAgICAgaW1nTmFtZS50b0xvd2VyQ2FzZSgpXG4gICAgICAgICAgICAgICAgXS5zcmMgPSBgJHtfX0JBU0VfVVJ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AgICAgICAgICAgICAgIGlmIChvcHRpb25zLndpdGhEeW5hbWljKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW9wdGlvbnMuYXNMaXN0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9zID0gZG9zLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucHJvcHNbcHJvcF0uZ2V0KFwiZHluYW1pY19hc3NldF9kYXRhX2lkXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wcm9wc1twcm9wXS5mb3JFYWNoKGEgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoISFhKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9zID0gZG9zLnB1c2goXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYS5nZXQoXCJkeW5hbWljX2Fzc2V0X2RhdGFfaWRcIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZmluYWxBc3NldHNbcHJvcF0gPSBvcHRpb25zLmFzTGlzdFxuICAgICAgICAgICAgICAgICAgICAgICAgPyB0aGlzLnByb3BzW3Byb3BdLmZpbHRlcihhID0+ICEhYSlcbiAgICAgICAgICAgICAgICAgICAgICAgIDogdGhpcy5wcm9wc1twcm9wXTtcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICBwYXNzVHJvdWdoUHJvcHNbcHJvcF0gPSB0aGlzLnByb3BzW3Byb3BdO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICBsZXQgd3JhcHBlZCA9IFJlYWN0LmNsb25lRWxlbWVudChcbiAgICAgICAgICAgICAgICBSZWFjdC5DaGlsZHJlbi5vbmx5KHRoaXMucHJvcHMuY2hpbGRyZW4pLFxuICAgICAgICAgICAgICAgIHsuLi5wYXNzVHJvdWdoUHJvcHMsIC4uLmZpbmFsQXNzZXRzfVxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgaWYgKG9wdGlvbnMud2l0aER5bmFtaWMpXG4gICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgPER5bmFtaWNPYmplY3RSZXNvbHZlciBkb3M9e2Rvc30+XG4gICAgICAgICAgICAgICAgICAgICAgICB7d3JhcHBlZH1cbiAgICAgICAgICAgICAgICAgICAgPC9EeW5hbWljT2JqZWN0UmVzb2x2ZXI+XG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGVsc2UgcmV0dXJuIHdyYXBwZWQ7XG4gICAgICAgIH1cbiAgICB9XG4gICAgQXNzZXRzUmVzb2x2ZXIgPSBCaW5kVG9DaGFpblN0YXRlKEFzc2V0c1Jlc29sdmVyKTtcblxuICAgIGNsYXNzIFdyYXBwZXIgZXh0ZW5kcyBSZWFjdC5Db21wb25lbnQge1xuICAgICAgICByZW5kZXIoKSB7XG4gICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgIDxBc3NldHNSZXNvbHZlciB7Li4udGhpcy5wcm9wc30+XG4gICAgICAgICAgICAgICAgICAgIDxDb21wb25lbnQgcmVmPVwiYm91bmRfY29tcG9uZW50XCIgLz5cbiAgICAgICAgICAgICAgICA8L0Fzc2V0c1Jlc29sdmVyPlxuICAgICAgICAgICAgKTtcbiAgICAgICAgfVxuICAgIH1cbiAgICBXcmFwcGVyLmRpc3BsYXlOYW1lID0gYFdyYXBwZXIoJHtnZXREaXNwbGF5TmFtZShDb21wb25lbnQpfSlgO1xuICAgI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