@bonlineza/luxity-lib 2.36.1-uk-platform.1 → 2.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion.js +116 -76
- package/AddInterest.js +777 -440
- package/AddProductInterest.js +644 -485
- package/BrandSelector.js +336 -176
- package/Checkbox.js +101 -68
- package/CheckboxButton.js +124 -79
- package/CommunicationPreferenceOptionsRenderer.js +169 -159
- package/CommunicationPreferenceSection.js +178 -166
- package/CommunicationPreferences.js +427 -549
- package/ConditionSelector.js +336 -174
- package/CountryCodeSelect.js +10 -7
- package/CurrencyInputFormatter.js +56 -29
- package/CurrencySelect.js +49 -23
- package/DropdownSelector.js +92 -68
- package/GALink.js +16 -6
- package/GenderSelector.js +142 -88
- package/GraphQLDropdownSelector.js +1508 -929
- package/GraphQLMultiSelector.js +274 -141
- package/IconHeader.js +25 -11
- package/IconWrapper.js +7 -3
- package/InterestCatSelector.js +74 -34
- package/InterestItem.js +187 -103
- package/Interests.js +1463 -913
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +21 -18
- package/LuxityDesktopHeader.js +451 -298
- package/LuxityFooter.js +321 -430
- package/LuxityGraphQLDropdownSelector.js +1540 -945
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +544 -353
- package/LuxityPageReady.js +136 -74
- package/LuxityProductInterestItem.js +175 -97
- package/LuxitySideNav.js +244 -176
- package/MaterialSelector.js +1547 -951
- package/ModelSelector.js +1547 -951
- package/NotificationDropDown.js +218 -118
- package/Notify.js +1 -0
- package/OutlinePrimaryButton.js +58 -26
- package/PriceRangeSelector.js +281 -168
- package/PrimaryButton.js +58 -26
- package/RadioButtons.js +140 -114
- package/RangeSlider.js +242 -152
- package/RareStepFooter.js +41 -27
- package/RareStepHeader.js +190 -139
- package/ReactSelectWrapper.js +1 -0
- package/SecondaryButton.js +58 -26
- package/ShoeSizeRangeSelector.js +260 -162
- package/ShoeSizeSelector.js +263 -158
- package/SimpleErrorBoundary.js +106 -59
- package/StyleSelector.js +336 -176
- package/TestComponent.js +15 -0
- package/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/CountryCodeSelect/index.js +18 -0
- package/build/ReactSelectWrapper/index.js +34 -0
- package/build/bundle.css +1 -1
- package/build/bundle.js +2616 -1974
- package/package.json +1 -1
- package/postcss.config.js +6 -0
- package/svg/Accessories.js +13 -6
- package/svg/Account.js +13 -6
- package/svg/Add.js +13 -6
- package/svg/ArrowRight.js +13 -6
- package/svg/Bags.js +13 -6
- package/svg/BurgerMenu.js +13 -6
- package/svg/Calendar.js +13 -6
- package/svg/CalendarCircled.js +13 -6
- package/svg/CheckCircled.js +13 -6
- package/svg/Close.js +13 -6
- package/svg/Clothing.js +13 -6
- package/svg/Dot.js +13 -6
- package/svg/Edit.js +13 -6
- package/svg/Eye.js +13 -6
- package/svg/FileAttach.js +13 -6
- package/svg/FileAttachCircled.js +13 -6
- package/svg/LightBulb.js +13 -6
- package/svg/Logo.js +13 -6
- package/svg/LuxityMenu.js +13 -6
- package/svg/Minus.js +13 -6
- package/svg/MobileAvatar.js +13 -6
- package/svg/MyOrder.js +13 -6
- package/svg/MyPayment.js +13 -6
- package/svg/MyProfile.js +14 -8
- package/svg/MySale.js +13 -6
- package/svg/Notification.js +13 -6
- package/svg/PointerDown.js +13 -6
- package/svg/Search.js +13 -6
- package/svg/Shoes.js +13 -6
- package/svg/SvgWrapper.js +7 -3
- package/svg/Trash.js +13 -6
- package/svg/Watches.js +13 -6
package/Interests.js
CHANGED
|
@@ -17,540 +17,694 @@
|
|
|
17
17
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
18
18
|
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return n;
|
|
24
|
-
}
|
|
25
|
-
function _arrayWithHoles(r) {
|
|
26
|
-
if (Array.isArray(r)) return r;
|
|
27
|
-
}
|
|
28
|
-
function _arrayWithoutHoles(r) {
|
|
29
|
-
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
30
|
-
}
|
|
31
|
-
function _assertThisInitialized(e) {
|
|
32
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
33
|
-
return e;
|
|
34
|
-
}
|
|
35
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
36
|
-
try {
|
|
37
|
-
var i = n[a](c),
|
|
38
|
-
u = i.value;
|
|
39
|
-
} catch (n) {
|
|
40
|
-
return void e(n);
|
|
41
|
-
}
|
|
42
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
43
|
-
}
|
|
44
|
-
function _asyncToGenerator(n) {
|
|
45
|
-
return function () {
|
|
46
|
-
var t = this,
|
|
47
|
-
e = arguments;
|
|
48
|
-
return new Promise(function (r, o) {
|
|
49
|
-
var a = n.apply(t, e);
|
|
50
|
-
function _next(n) {
|
|
51
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
52
|
-
}
|
|
53
|
-
function _throw(n) {
|
|
54
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
55
|
-
}
|
|
56
|
-
_next(void 0);
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function _callSuper(t, o, e) {
|
|
61
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
62
|
-
}
|
|
63
|
-
function _classCallCheck(a, n) {
|
|
64
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
65
|
-
}
|
|
66
|
-
function _defineProperties(e, r) {
|
|
67
|
-
for (var t = 0; t < r.length; t++) {
|
|
68
|
-
var o = r[t];
|
|
69
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _createClass(e, r, t) {
|
|
73
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
74
|
-
writable: !1
|
|
75
|
-
}), e;
|
|
76
|
-
}
|
|
77
|
-
function _defineProperty(e, r, t) {
|
|
78
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
79
|
-
value: t,
|
|
80
|
-
enumerable: !0,
|
|
81
|
-
configurable: !0,
|
|
82
|
-
writable: !0
|
|
83
|
-
}) : e[r] = t, e;
|
|
84
|
-
}
|
|
85
|
-
function _extends() {
|
|
86
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
87
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
88
|
-
var t = arguments[e];
|
|
89
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
90
|
-
}
|
|
91
|
-
return n;
|
|
92
|
-
}, _extends.apply(null, arguments);
|
|
93
|
-
}
|
|
94
|
-
function _getPrototypeOf(t) {
|
|
95
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
96
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
97
|
-
}, _getPrototypeOf(t);
|
|
98
|
-
}
|
|
99
|
-
function _inherits(t, e) {
|
|
100
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
101
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
102
|
-
constructor: {
|
|
103
|
-
value: t,
|
|
104
|
-
writable: !0,
|
|
105
|
-
configurable: !0
|
|
106
|
-
}
|
|
107
|
-
}), Object.defineProperty(t, "prototype", {
|
|
108
|
-
writable: !1
|
|
109
|
-
}), e && _setPrototypeOf(t, e);
|
|
110
|
-
}
|
|
111
|
-
function _isNativeReflectConstruct() {
|
|
112
|
-
try {
|
|
113
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
114
|
-
} catch (t) {}
|
|
115
|
-
return (_isNativeReflectConstruct = function () {
|
|
116
|
-
return !!t;
|
|
117
|
-
})();
|
|
118
|
-
}
|
|
119
|
-
function _iterableToArray(r) {
|
|
120
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
121
|
-
}
|
|
122
|
-
function _iterableToArrayLimit(r, l) {
|
|
123
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
124
|
-
if (null != t) {
|
|
125
|
-
var e,
|
|
126
|
-
n,
|
|
127
|
-
i,
|
|
128
|
-
u,
|
|
129
|
-
a = [],
|
|
130
|
-
f = !0,
|
|
131
|
-
o = !1;
|
|
132
|
-
try {
|
|
133
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
134
|
-
if (Object(t) !== t) return;
|
|
135
|
-
f = !1;
|
|
136
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
137
|
-
} catch (r) {
|
|
138
|
-
o = !0, n = r;
|
|
139
|
-
} finally {
|
|
140
|
-
try {
|
|
141
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
142
|
-
} finally {
|
|
143
|
-
if (o) throw n;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return a;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function _nonIterableRest() {
|
|
150
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
151
|
-
}
|
|
152
|
-
function _nonIterableSpread() {
|
|
153
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
154
|
-
}
|
|
155
|
-
function ownKeys(e, r) {
|
|
156
|
-
var t = Object.keys(e);
|
|
20
|
+
function ownKeys(object, enumerableOnly) {
|
|
21
|
+
var keys = Object.keys(object);
|
|
22
|
+
|
|
157
23
|
if (Object.getOwnPropertySymbols) {
|
|
158
|
-
var
|
|
159
|
-
|
|
160
|
-
return Object.getOwnPropertyDescriptor(
|
|
161
|
-
})),
|
|
24
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
25
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
26
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
27
|
+
})), keys.push.apply(keys, symbols);
|
|
162
28
|
}
|
|
163
|
-
|
|
29
|
+
|
|
30
|
+
return keys;
|
|
164
31
|
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
32
|
+
|
|
33
|
+
function _objectSpread2(target) {
|
|
34
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
35
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
36
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
37
|
+
_defineProperty(target, key, source[key]);
|
|
38
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
39
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
172
40
|
});
|
|
173
41
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
function _objectWithoutProperties(e, t) {
|
|
177
|
-
if (null == e) return {};
|
|
178
|
-
var o,
|
|
179
|
-
r,
|
|
180
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
181
|
-
if (Object.getOwnPropertySymbols) {
|
|
182
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
183
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
184
|
-
}
|
|
185
|
-
return i;
|
|
186
|
-
}
|
|
187
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
188
|
-
if (null == r) return {};
|
|
189
|
-
var t = {};
|
|
190
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
191
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
192
|
-
t[n] = r[n];
|
|
193
|
-
}
|
|
194
|
-
return t;
|
|
195
|
-
}
|
|
196
|
-
function _possibleConstructorReturn(t, e) {
|
|
197
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
198
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
199
|
-
return _assertThisInitialized(t);
|
|
42
|
+
|
|
43
|
+
return target;
|
|
200
44
|
}
|
|
45
|
+
|
|
201
46
|
function _regeneratorRuntime() {
|
|
47
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
48
|
+
|
|
202
49
|
_regeneratorRuntime = function () {
|
|
203
|
-
return
|
|
50
|
+
return exports;
|
|
204
51
|
};
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
return Object.defineProperty(t, e, {
|
|
218
|
-
value: r,
|
|
52
|
+
|
|
53
|
+
var exports = {},
|
|
54
|
+
Op = Object.prototype,
|
|
55
|
+
hasOwn = Op.hasOwnProperty,
|
|
56
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
57
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
58
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
59
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
60
|
+
|
|
61
|
+
function define(obj, key, value) {
|
|
62
|
+
return Object.defineProperty(obj, key, {
|
|
63
|
+
value: value,
|
|
219
64
|
enumerable: !0,
|
|
220
65
|
configurable: !0,
|
|
221
66
|
writable: !0
|
|
222
|
-
}),
|
|
67
|
+
}), obj[key];
|
|
223
68
|
}
|
|
69
|
+
|
|
224
70
|
try {
|
|
225
71
|
define({}, "");
|
|
226
|
-
} catch (
|
|
227
|
-
define = function (
|
|
228
|
-
return
|
|
72
|
+
} catch (err) {
|
|
73
|
+
define = function (obj, key, value) {
|
|
74
|
+
return obj[key] = value;
|
|
229
75
|
};
|
|
230
76
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
77
|
+
|
|
78
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
79
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
80
|
+
generator = Object.create(protoGenerator.prototype),
|
|
81
|
+
context = new Context(tryLocsList || []);
|
|
82
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
83
|
+
var state = "suspendedStart";
|
|
84
|
+
return function (method, arg) {
|
|
85
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
86
|
+
|
|
87
|
+
if ("completed" === state) {
|
|
88
|
+
if ("throw" === method) throw arg;
|
|
89
|
+
return doneResult();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
for (context.method = method, context.arg = arg;;) {
|
|
93
|
+
var delegate = context.delegate;
|
|
94
|
+
|
|
95
|
+
if (delegate) {
|
|
96
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
97
|
+
|
|
98
|
+
if (delegateResult) {
|
|
99
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
100
|
+
return delegateResult;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
105
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
106
|
+
context.dispatchException(context.arg);
|
|
107
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
108
|
+
state = "executing";
|
|
109
|
+
var record = tryCatch(innerFn, self, context);
|
|
110
|
+
|
|
111
|
+
if ("normal" === record.type) {
|
|
112
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
113
|
+
return {
|
|
114
|
+
value: record.arg,
|
|
115
|
+
done: context.done
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}(innerFn, self, context), generator;
|
|
238
123
|
}
|
|
239
|
-
|
|
124
|
+
|
|
125
|
+
function tryCatch(fn, obj, arg) {
|
|
240
126
|
try {
|
|
241
127
|
return {
|
|
242
128
|
type: "normal",
|
|
243
|
-
arg:
|
|
129
|
+
arg: fn.call(obj, arg)
|
|
244
130
|
};
|
|
245
|
-
} catch (
|
|
131
|
+
} catch (err) {
|
|
246
132
|
return {
|
|
247
133
|
type: "throw",
|
|
248
|
-
arg:
|
|
134
|
+
arg: err
|
|
249
135
|
};
|
|
250
136
|
}
|
|
251
137
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
s = "completed",
|
|
257
|
-
y = {};
|
|
138
|
+
|
|
139
|
+
exports.wrap = wrap;
|
|
140
|
+
var ContinueSentinel = {};
|
|
141
|
+
|
|
258
142
|
function Generator() {}
|
|
143
|
+
|
|
259
144
|
function GeneratorFunction() {}
|
|
145
|
+
|
|
260
146
|
function GeneratorFunctionPrototype() {}
|
|
261
|
-
|
|
262
|
-
|
|
147
|
+
|
|
148
|
+
var IteratorPrototype = {};
|
|
149
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
263
150
|
return this;
|
|
264
151
|
});
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
var
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
152
|
+
var getProto = Object.getPrototypeOf,
|
|
153
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
154
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
155
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
156
|
+
|
|
157
|
+
function defineIteratorMethods(prototype) {
|
|
158
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
159
|
+
define(prototype, method, function (arg) {
|
|
160
|
+
return this._invoke(method, arg);
|
|
273
161
|
});
|
|
274
162
|
});
|
|
275
163
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
invoke("
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
|
|
164
|
+
|
|
165
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
166
|
+
function invoke(method, arg, resolve, reject) {
|
|
167
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
168
|
+
|
|
169
|
+
if ("throw" !== record.type) {
|
|
170
|
+
var result = record.arg,
|
|
171
|
+
value = result.value;
|
|
172
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
173
|
+
invoke("next", value, resolve, reject);
|
|
174
|
+
}, function (err) {
|
|
175
|
+
invoke("throw", err, resolve, reject);
|
|
176
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
177
|
+
result.value = unwrapped, resolve(result);
|
|
178
|
+
}, function (error) {
|
|
179
|
+
return invoke("throw", error, resolve, reject);
|
|
290
180
|
});
|
|
291
181
|
}
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
182
|
+
|
|
183
|
+
reject(record.arg);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
var previousPromise;
|
|
187
|
+
|
|
188
|
+
this._invoke = function (method, arg) {
|
|
189
|
+
function callInvokeWithMethodAndArg() {
|
|
190
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
191
|
+
invoke(method, arg, resolve, reject);
|
|
192
|
+
});
|
|
303
193
|
}
|
|
304
|
-
|
|
194
|
+
|
|
195
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
196
|
+
};
|
|
305
197
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
return
|
|
313
|
-
|
|
314
|
-
done: !0
|
|
315
|
-
};
|
|
316
|
-
}
|
|
317
|
-
for (n.method = i, n.arg = a;;) {
|
|
318
|
-
var c = n.delegate;
|
|
319
|
-
if (c) {
|
|
320
|
-
var u = maybeInvokeDelegate(c, n);
|
|
321
|
-
if (u) {
|
|
322
|
-
if (u === y) continue;
|
|
323
|
-
return u;
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
327
|
-
if (o === h) throw o = s, n.arg;
|
|
328
|
-
n.dispatchException(n.arg);
|
|
329
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
330
|
-
o = f;
|
|
331
|
-
var p = tryCatch(e, r, n);
|
|
332
|
-
if ("normal" === p.type) {
|
|
333
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
334
|
-
return {
|
|
335
|
-
value: p.arg,
|
|
336
|
-
done: n.done
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
198
|
+
|
|
199
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
200
|
+
var method = delegate.iterator[context.method];
|
|
201
|
+
|
|
202
|
+
if (undefined === method) {
|
|
203
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
204
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
205
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
340
206
|
}
|
|
341
|
-
|
|
207
|
+
|
|
208
|
+
return ContinueSentinel;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
212
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
213
|
+
var info = record.arg;
|
|
214
|
+
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
|
|
342
215
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
348
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
349
|
-
var a = i.arg;
|
|
350
|
-
return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
|
351
|
-
}
|
|
352
|
-
function pushTryEntry(t) {
|
|
353
|
-
var e = {
|
|
354
|
-
tryLoc: t[0]
|
|
216
|
+
|
|
217
|
+
function pushTryEntry(locs) {
|
|
218
|
+
var entry = {
|
|
219
|
+
tryLoc: locs[0]
|
|
355
220
|
};
|
|
356
|
-
1 in
|
|
221
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
357
222
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
223
|
+
|
|
224
|
+
function resetTryEntry(entry) {
|
|
225
|
+
var record = entry.completion || {};
|
|
226
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
361
227
|
}
|
|
362
|
-
|
|
228
|
+
|
|
229
|
+
function Context(tryLocsList) {
|
|
363
230
|
this.tryEntries = [{
|
|
364
231
|
tryLoc: "root"
|
|
365
|
-
}],
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
if (
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
232
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function values(iterable) {
|
|
236
|
+
if (iterable) {
|
|
237
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
238
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
239
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
240
|
+
|
|
241
|
+
if (!isNaN(iterable.length)) {
|
|
242
|
+
var i = -1,
|
|
243
|
+
next = function next() {
|
|
244
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
245
|
+
|
|
246
|
+
return next.value = undefined, next.done = !0, next;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
return next.next = next;
|
|
379
250
|
}
|
|
380
251
|
}
|
|
381
|
-
|
|
382
|
-
}
|
|
383
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
384
|
-
value: GeneratorFunctionPrototype,
|
|
385
|
-
configurable: !0
|
|
386
|
-
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
387
|
-
value: GeneratorFunction,
|
|
388
|
-
configurable: !0
|
|
389
|
-
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
390
|
-
var e = "function" == typeof t && t.constructor;
|
|
391
|
-
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
392
|
-
}, e.mark = function (t) {
|
|
393
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
394
|
-
}, e.awrap = function (t) {
|
|
252
|
+
|
|
395
253
|
return {
|
|
396
|
-
|
|
254
|
+
next: doneResult
|
|
397
255
|
};
|
|
398
|
-
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
function doneResult() {
|
|
259
|
+
return {
|
|
260
|
+
value: undefined,
|
|
261
|
+
done: !0
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
266
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
267
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
268
|
+
}, exports.mark = function (genFun) {
|
|
269
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
270
|
+
}, exports.awrap = function (arg) {
|
|
271
|
+
return {
|
|
272
|
+
__await: arg
|
|
273
|
+
};
|
|
274
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
399
275
|
return this;
|
|
400
|
-
}),
|
|
401
|
-
void 0 ===
|
|
402
|
-
var
|
|
403
|
-
return
|
|
404
|
-
return
|
|
276
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
277
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
278
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
279
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
280
|
+
return result.done ? result.value : iter.next();
|
|
405
281
|
});
|
|
406
|
-
}, defineIteratorMethods(
|
|
282
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
407
283
|
return this;
|
|
408
|
-
}), define(
|
|
284
|
+
}), define(Gp, "toString", function () {
|
|
409
285
|
return "[object Generator]";
|
|
410
|
-
}),
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
for (var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
286
|
+
}), exports.keys = function (object) {
|
|
287
|
+
var keys = [];
|
|
288
|
+
|
|
289
|
+
for (var key in object) keys.push(key);
|
|
290
|
+
|
|
291
|
+
return keys.reverse(), function next() {
|
|
292
|
+
for (; keys.length;) {
|
|
293
|
+
var key = keys.pop();
|
|
294
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
418
295
|
}
|
|
296
|
+
|
|
419
297
|
return next.done = !0, next;
|
|
420
298
|
};
|
|
421
|
-
},
|
|
299
|
+
}, exports.values = values, Context.prototype = {
|
|
422
300
|
constructor: Context,
|
|
423
|
-
reset: function (
|
|
424
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
301
|
+
reset: function (skipTempReset) {
|
|
302
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
|
|
425
303
|
},
|
|
426
304
|
stop: function () {
|
|
427
305
|
this.done = !0;
|
|
428
|
-
var
|
|
429
|
-
if ("throw" ===
|
|
306
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
307
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
430
308
|
return this.rval;
|
|
431
309
|
},
|
|
432
|
-
dispatchException: function (
|
|
433
|
-
if (this.done) throw
|
|
434
|
-
var
|
|
435
|
-
|
|
436
|
-
|
|
310
|
+
dispatchException: function (exception) {
|
|
311
|
+
if (this.done) throw exception;
|
|
312
|
+
var context = this;
|
|
313
|
+
|
|
314
|
+
function handle(loc, caught) {
|
|
315
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
437
316
|
}
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
if (this.prev <
|
|
317
|
+
|
|
318
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
319
|
+
var entry = this.tryEntries[i],
|
|
320
|
+
record = entry.completion;
|
|
321
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
322
|
+
|
|
323
|
+
if (entry.tryLoc <= this.prev) {
|
|
324
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
325
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
326
|
+
|
|
327
|
+
if (hasCatch && hasFinally) {
|
|
328
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
329
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
330
|
+
} else if (hasCatch) {
|
|
331
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
450
332
|
} else {
|
|
451
|
-
if (!
|
|
452
|
-
if (this.prev <
|
|
333
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
334
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
453
335
|
}
|
|
454
336
|
}
|
|
455
337
|
}
|
|
456
338
|
},
|
|
457
|
-
abrupt: function (
|
|
458
|
-
for (var
|
|
459
|
-
var
|
|
460
|
-
|
|
461
|
-
|
|
339
|
+
abrupt: function (type, arg) {
|
|
340
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
341
|
+
var entry = this.tryEntries[i];
|
|
342
|
+
|
|
343
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
344
|
+
var finallyEntry = entry;
|
|
462
345
|
break;
|
|
463
346
|
}
|
|
464
347
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
348
|
+
|
|
349
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
350
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
351
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
468
352
|
},
|
|
469
|
-
complete: function (
|
|
470
|
-
if ("throw" ===
|
|
471
|
-
return "break" ===
|
|
353
|
+
complete: function (record, afterLoc) {
|
|
354
|
+
if ("throw" === record.type) throw record.arg;
|
|
355
|
+
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
|
|
472
356
|
},
|
|
473
|
-
finish: function (
|
|
474
|
-
for (var
|
|
475
|
-
var
|
|
476
|
-
if (
|
|
357
|
+
finish: function (finallyLoc) {
|
|
358
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
359
|
+
var entry = this.tryEntries[i];
|
|
360
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
477
361
|
}
|
|
478
362
|
},
|
|
479
|
-
catch: function (
|
|
480
|
-
for (var
|
|
481
|
-
var
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
363
|
+
catch: function (tryLoc) {
|
|
364
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
365
|
+
var entry = this.tryEntries[i];
|
|
366
|
+
|
|
367
|
+
if (entry.tryLoc === tryLoc) {
|
|
368
|
+
var record = entry.completion;
|
|
369
|
+
|
|
370
|
+
if ("throw" === record.type) {
|
|
371
|
+
var thrown = record.arg;
|
|
372
|
+
resetTryEntry(entry);
|
|
487
373
|
}
|
|
488
|
-
|
|
374
|
+
|
|
375
|
+
return thrown;
|
|
489
376
|
}
|
|
490
377
|
}
|
|
491
|
-
|
|
378
|
+
|
|
379
|
+
throw new Error("illegal catch attempt");
|
|
492
380
|
},
|
|
493
|
-
delegateYield: function (
|
|
381
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
494
382
|
return this.delegate = {
|
|
495
|
-
iterator: values(
|
|
496
|
-
resultName:
|
|
497
|
-
nextLoc:
|
|
498
|
-
}, "next" === this.method && (this.arg =
|
|
383
|
+
iterator: values(iterable),
|
|
384
|
+
resultName: resultName,
|
|
385
|
+
nextLoc: nextLoc
|
|
386
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
499
387
|
}
|
|
500
|
-
},
|
|
388
|
+
}, exports;
|
|
501
389
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
390
|
+
|
|
391
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
392
|
+
try {
|
|
393
|
+
var info = gen[key](arg);
|
|
394
|
+
var value = info.value;
|
|
395
|
+
} catch (error) {
|
|
396
|
+
reject(error);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if (info.done) {
|
|
401
|
+
resolve(value);
|
|
402
|
+
} else {
|
|
403
|
+
Promise.resolve(value).then(_next, _throw);
|
|
404
|
+
}
|
|
506
405
|
}
|
|
507
|
-
|
|
508
|
-
|
|
406
|
+
|
|
407
|
+
function _asyncToGenerator(fn) {
|
|
408
|
+
return function () {
|
|
409
|
+
var self = this,
|
|
410
|
+
args = arguments;
|
|
411
|
+
return new Promise(function (resolve, reject) {
|
|
412
|
+
var gen = fn.apply(self, args);
|
|
413
|
+
|
|
414
|
+
function _next(value) {
|
|
415
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
function _throw(err) {
|
|
419
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
_next(undefined);
|
|
423
|
+
});
|
|
424
|
+
};
|
|
509
425
|
}
|
|
510
|
-
|
|
511
|
-
|
|
426
|
+
|
|
427
|
+
function _classCallCheck(instance, Constructor) {
|
|
428
|
+
if (!(instance instanceof Constructor)) {
|
|
429
|
+
throw new TypeError("Cannot call a class as a function");
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
function _defineProperties(target, props) {
|
|
434
|
+
for (var i = 0; i < props.length; i++) {
|
|
435
|
+
var descriptor = props[i];
|
|
436
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
437
|
+
descriptor.configurable = true;
|
|
438
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
439
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
444
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
445
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
446
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
447
|
+
writable: false
|
|
448
|
+
});
|
|
449
|
+
return Constructor;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function _defineProperty(obj, key, value) {
|
|
453
|
+
if (key in obj) {
|
|
454
|
+
Object.defineProperty(obj, key, {
|
|
455
|
+
value: value,
|
|
456
|
+
enumerable: true,
|
|
457
|
+
configurable: true,
|
|
458
|
+
writable: true
|
|
459
|
+
});
|
|
460
|
+
} else {
|
|
461
|
+
obj[key] = value;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return obj;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
function _extends() {
|
|
468
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
469
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
470
|
+
var source = arguments[i];
|
|
471
|
+
|
|
472
|
+
for (var key in source) {
|
|
473
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
474
|
+
target[key] = source[key];
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return target;
|
|
480
|
+
};
|
|
481
|
+
return _extends.apply(this, arguments);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function _inherits(subClass, superClass) {
|
|
485
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
486
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
490
|
+
constructor: {
|
|
491
|
+
value: subClass,
|
|
492
|
+
writable: true,
|
|
493
|
+
configurable: true
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
Object.defineProperty(subClass, "prototype", {
|
|
497
|
+
writable: false
|
|
498
|
+
});
|
|
499
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
function _getPrototypeOf(o) {
|
|
503
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
504
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
505
|
+
};
|
|
506
|
+
return _getPrototypeOf(o);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function _setPrototypeOf(o, p) {
|
|
510
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
511
|
+
o.__proto__ = p;
|
|
512
|
+
return o;
|
|
513
|
+
};
|
|
514
|
+
return _setPrototypeOf(o, p);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function _isNativeReflectConstruct() {
|
|
518
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
519
|
+
if (Reflect.construct.sham) return false;
|
|
520
|
+
if (typeof Proxy === "function") return true;
|
|
521
|
+
|
|
522
|
+
try {
|
|
523
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
524
|
+
return true;
|
|
525
|
+
} catch (e) {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
531
|
+
if (source == null) return {};
|
|
532
|
+
var target = {};
|
|
533
|
+
var sourceKeys = Object.keys(source);
|
|
534
|
+
var key, i;
|
|
535
|
+
|
|
536
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
537
|
+
key = sourceKeys[i];
|
|
538
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
539
|
+
target[key] = source[key];
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return target;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function _objectWithoutProperties(source, excluded) {
|
|
546
|
+
if (source == null) return {};
|
|
547
|
+
|
|
548
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
549
|
+
|
|
550
|
+
var key, i;
|
|
551
|
+
|
|
552
|
+
if (Object.getOwnPropertySymbols) {
|
|
553
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
554
|
+
|
|
555
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
556
|
+
key = sourceSymbolKeys[i];
|
|
557
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
558
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
559
|
+
target[key] = source[key];
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
return target;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
function _assertThisInitialized(self) {
|
|
567
|
+
if (self === void 0) {
|
|
568
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
return self;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
function _possibleConstructorReturn(self, call) {
|
|
575
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
576
|
+
return call;
|
|
577
|
+
} else if (call !== void 0) {
|
|
578
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
return _assertThisInitialized(self);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function _createSuper(Derived) {
|
|
585
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
586
|
+
|
|
587
|
+
return function _createSuperInternal() {
|
|
588
|
+
var Super = _getPrototypeOf(Derived),
|
|
589
|
+
result;
|
|
590
|
+
|
|
591
|
+
if (hasNativeReflectConstruct) {
|
|
592
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
593
|
+
|
|
594
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
595
|
+
} else {
|
|
596
|
+
result = Super.apply(this, arguments);
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
return _possibleConstructorReturn(this, result);
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
604
|
+
if (!raw) {
|
|
605
|
+
raw = strings.slice(0);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
512
609
|
raw: {
|
|
513
|
-
value: Object.freeze(
|
|
610
|
+
value: Object.freeze(raw)
|
|
611
|
+
}
|
|
612
|
+
}));
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
function _slicedToArray(arr, i) {
|
|
616
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
function _toConsumableArray(arr) {
|
|
620
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
function _arrayWithoutHoles(arr) {
|
|
624
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
function _arrayWithHoles(arr) {
|
|
628
|
+
if (Array.isArray(arr)) return arr;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
function _iterableToArray(iter) {
|
|
632
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
function _iterableToArrayLimit(arr, i) {
|
|
636
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
637
|
+
|
|
638
|
+
if (_i == null) return;
|
|
639
|
+
var _arr = [];
|
|
640
|
+
var _n = true;
|
|
641
|
+
var _d = false;
|
|
642
|
+
|
|
643
|
+
var _s, _e;
|
|
644
|
+
|
|
645
|
+
try {
|
|
646
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
647
|
+
_arr.push(_s.value);
|
|
648
|
+
|
|
649
|
+
if (i && _arr.length === i) break;
|
|
514
650
|
}
|
|
515
|
-
})
|
|
651
|
+
} catch (err) {
|
|
652
|
+
_d = true;
|
|
653
|
+
_e = err;
|
|
654
|
+
} finally {
|
|
655
|
+
try {
|
|
656
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
657
|
+
} finally {
|
|
658
|
+
if (_d) throw _e;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return _arr;
|
|
516
663
|
}
|
|
517
|
-
|
|
518
|
-
|
|
664
|
+
|
|
665
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
666
|
+
if (!o) return;
|
|
667
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
668
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
669
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
670
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
671
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
519
672
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}
|
|
528
|
-
return ("string" === r ? String : Number)(t);
|
|
673
|
+
|
|
674
|
+
function _arrayLikeToArray(arr, len) {
|
|
675
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
676
|
+
|
|
677
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
678
|
+
|
|
679
|
+
return arr2;
|
|
529
680
|
}
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
681
|
+
|
|
682
|
+
function _nonIterableSpread() {
|
|
683
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
533
684
|
}
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
538
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
539
|
-
}
|
|
685
|
+
|
|
686
|
+
function _nonIterableRest() {
|
|
687
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
540
688
|
}
|
|
541
689
|
|
|
542
690
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
691
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
692
|
+
|
|
693
|
+
var _super = _createSuper(SimpleErrorBoundary);
|
|
694
|
+
|
|
543
695
|
function SimpleErrorBoundary(props) {
|
|
544
696
|
var _this;
|
|
697
|
+
|
|
545
698
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
546
|
-
|
|
699
|
+
|
|
700
|
+
_this = _super.call(this, props);
|
|
547
701
|
_this.state = {
|
|
548
702
|
hasError: false
|
|
549
703
|
};
|
|
550
704
|
return _this;
|
|
551
705
|
}
|
|
552
|
-
|
|
553
|
-
|
|
706
|
+
|
|
707
|
+
_createClass(SimpleErrorBoundary, [{
|
|
554
708
|
key: "componentDidCatch",
|
|
555
709
|
value: function componentDidCatch(error, errorInfo) {
|
|
556
710
|
// You can also log the error to an error reporting service
|
|
@@ -563,6 +717,7 @@
|
|
|
563
717
|
// You can render any custom fallback UI
|
|
564
718
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
565
719
|
}
|
|
720
|
+
|
|
566
721
|
return this.props.children;
|
|
567
722
|
}
|
|
568
723
|
}], [{
|
|
@@ -574,7 +729,10 @@
|
|
|
574
729
|
};
|
|
575
730
|
}
|
|
576
731
|
}]);
|
|
732
|
+
|
|
733
|
+
return SimpleErrorBoundary;
|
|
577
734
|
}(React__default.Component);
|
|
735
|
+
|
|
578
736
|
SimpleErrorBoundary.defaultProps = {
|
|
579
737
|
errorMessage: 'Something went wrong',
|
|
580
738
|
errorLogger: null,
|
|
@@ -656,19 +814,21 @@
|
|
|
656
814
|
var StyledHeader = styled__default.h5(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n display: block;\n }\n\n .icon-header__left {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n align-self: flex-start;\n }\n\n svg {\n height: 1.5em;\n width: 1.5em;\n margin-right: ", ";\n }\n }\n\n .icon-header__right {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n\n @media (max-width: ", ") {\n justify-content: flex-start;\n }\n }\n"])), media.sm, media.sm, function (props) {
|
|
657
815
|
return props.theme.marginPaddings[1];
|
|
658
816
|
}, media.sm);
|
|
817
|
+
|
|
659
818
|
/**
|
|
660
819
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
661
820
|
*/
|
|
662
821
|
var IconHeader = function IconHeader(_ref) {
|
|
663
822
|
var title = _ref.title,
|
|
664
|
-
|
|
665
|
-
|
|
823
|
+
SvgComponent = _ref.svgComponent,
|
|
824
|
+
renderAppendage = _ref.renderAppendage;
|
|
666
825
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
667
826
|
className: "icon-header__left"
|
|
668
827
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
669
828
|
className: "icon-header__right"
|
|
670
829
|
}, renderAppendage && renderAppendage()));
|
|
671
830
|
};
|
|
831
|
+
|
|
672
832
|
IconHeader.defaultProps = {
|
|
673
833
|
title: '',
|
|
674
834
|
svgComponent: function svgComponent() {
|
|
@@ -706,39 +866,50 @@
|
|
|
706
866
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
707
867
|
data: null
|
|
708
868
|
});
|
|
709
|
-
|
|
710
869
|
/**
|
|
711
870
|
* A flavour of PageReady with Luxity customisations
|
|
712
871
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
713
872
|
* 2. an error message interpreter is supplied from the local helper library
|
|
714
873
|
*/
|
|
874
|
+
|
|
715
875
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
876
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
877
|
+
|
|
878
|
+
var _super = _createSuper(LuxityPageReady);
|
|
879
|
+
|
|
716
880
|
function LuxityPageReady() {
|
|
717
881
|
var _this;
|
|
882
|
+
|
|
718
883
|
_classCallCheck(this, LuxityPageReady);
|
|
884
|
+
|
|
719
885
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
720
886
|
args[_key] = arguments[_key];
|
|
721
887
|
}
|
|
722
|
-
|
|
723
|
-
|
|
888
|
+
|
|
889
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
890
|
+
|
|
891
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
724
892
|
data: null
|
|
725
893
|
});
|
|
726
|
-
|
|
894
|
+
|
|
895
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
727
896
|
return _this.pageReadyInstance.initRequest();
|
|
728
897
|
});
|
|
898
|
+
|
|
729
899
|
return _this;
|
|
730
900
|
}
|
|
731
|
-
|
|
732
|
-
|
|
901
|
+
|
|
902
|
+
_createClass(LuxityPageReady, [{
|
|
733
903
|
key: "render",
|
|
734
904
|
value: function render() {
|
|
735
905
|
var _this2 = this;
|
|
906
|
+
|
|
736
907
|
var _this$props = this.props,
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
908
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
909
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
910
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
911
|
+
_onData = _this$props.onData,
|
|
912
|
+
children = _this$props.children;
|
|
742
913
|
var data = this.state.data;
|
|
743
914
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
744
915
|
ref: function ref(inst) {
|
|
@@ -748,15 +919,19 @@
|
|
|
748
919
|
_this2.setState({
|
|
749
920
|
data: res.data
|
|
750
921
|
});
|
|
922
|
+
|
|
751
923
|
_onData(res);
|
|
752
924
|
},
|
|
753
925
|
getRequestInstance: function getRequestInstance() {
|
|
754
926
|
_this2.props.onIsLoading(true);
|
|
927
|
+
|
|
755
928
|
return getRequestPromise().then(function (out) {
|
|
756
929
|
_this2.props.onIsLoading(false);
|
|
930
|
+
|
|
757
931
|
return out;
|
|
758
932
|
}).catch(function (oops) {
|
|
759
933
|
_this2.props.onIsLoading(false);
|
|
934
|
+
|
|
760
935
|
return oops;
|
|
761
936
|
});
|
|
762
937
|
},
|
|
@@ -773,7 +948,10 @@
|
|
|
773
948
|
}, children));
|
|
774
949
|
}
|
|
775
950
|
}]);
|
|
951
|
+
|
|
952
|
+
return LuxityPageReady;
|
|
776
953
|
}(React__default.Component);
|
|
954
|
+
|
|
777
955
|
LuxityPageReady.defaultProps = {
|
|
778
956
|
onIsLoading: function onIsLoading() {
|
|
779
957
|
return null;
|
|
@@ -7372,12 +7550,12 @@
|
|
|
7372
7550
|
/**
|
|
7373
7551
|
* It represents the React Component that contains the notifications.
|
|
7374
7552
|
* */
|
|
7553
|
+
|
|
7375
7554
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
7376
7555
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
7377
7556
|
};
|
|
7378
7557
|
|
|
7379
7558
|
/** @format */
|
|
7380
|
-
|
|
7381
7559
|
var request = {
|
|
7382
7560
|
fetching: false,
|
|
7383
7561
|
failed: false,
|
|
@@ -7391,20 +7569,31 @@
|
|
|
7391
7569
|
};
|
|
7392
7570
|
|
|
7393
7571
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
7572
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
7573
|
+
|
|
7574
|
+
var _super = _createSuper(NotificationDropDown);
|
|
7575
|
+
|
|
7394
7576
|
function NotificationDropDown(props) {
|
|
7395
7577
|
var _this;
|
|
7578
|
+
|
|
7396
7579
|
_classCallCheck(this, NotificationDropDown);
|
|
7397
|
-
|
|
7398
|
-
|
|
7580
|
+
|
|
7581
|
+
_this = _super.call(this, props);
|
|
7582
|
+
|
|
7583
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
7399
7584
|
_this.setState({
|
|
7400
7585
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7401
7586
|
fetching: true
|
|
7402
7587
|
})
|
|
7403
7588
|
});
|
|
7589
|
+
|
|
7404
7590
|
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
7405
|
-
_this
|
|
7591
|
+
var _this$setState;
|
|
7592
|
+
|
|
7593
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7406
7594
|
success: true
|
|
7407
|
-
})));
|
|
7595
|
+
})), _this$setState));
|
|
7596
|
+
|
|
7408
7597
|
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
7409
7598
|
}).catch(function () {
|
|
7410
7599
|
_this.setState({
|
|
@@ -7412,10 +7601,12 @@
|
|
|
7412
7601
|
failed: true
|
|
7413
7602
|
})
|
|
7414
7603
|
});
|
|
7604
|
+
|
|
7415
7605
|
error('Error Occurred');
|
|
7416
7606
|
});
|
|
7417
7607
|
});
|
|
7418
|
-
|
|
7608
|
+
|
|
7609
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
7419
7610
|
var enumValues = enumResult.data.__type.enumValues;
|
|
7420
7611
|
return enumValues.map(function (enumItem) {
|
|
7421
7612
|
return {
|
|
@@ -7424,13 +7615,17 @@
|
|
|
7424
7615
|
};
|
|
7425
7616
|
});
|
|
7426
7617
|
});
|
|
7427
|
-
|
|
7618
|
+
|
|
7619
|
+
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
7428
7620
|
var data = _ref.data;
|
|
7621
|
+
|
|
7429
7622
|
var options = _this.getOptionsFromEnumResult(data);
|
|
7623
|
+
|
|
7430
7624
|
var _data$data$user = data.data.user,
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7625
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
7626
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
7627
|
+
vip = _data$data$user.vip;
|
|
7628
|
+
|
|
7434
7629
|
_this.setState({
|
|
7435
7630
|
options: options,
|
|
7436
7631
|
isVip: vip,
|
|
@@ -7442,13 +7637,14 @@
|
|
|
7442
7637
|
})
|
|
7443
7638
|
});
|
|
7444
7639
|
});
|
|
7445
|
-
|
|
7640
|
+
|
|
7641
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7446
7642
|
var _this$state = _this.state,
|
|
7447
|
-
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7643
|
+
options = _this$state.options,
|
|
7644
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
7645
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
7646
|
+
isVip = _this$state.isVip,
|
|
7647
|
+
updating = _this$state.request.fetching;
|
|
7452
7648
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
7453
7649
|
getRequestPromise: _this.props.getSchedule,
|
|
7454
7650
|
onData: function onData(data) {
|
|
@@ -7496,6 +7692,7 @@
|
|
|
7496
7692
|
value: emailSelectedOption
|
|
7497
7693
|
}))))));
|
|
7498
7694
|
});
|
|
7695
|
+
|
|
7499
7696
|
_this.state = {
|
|
7500
7697
|
options: [],
|
|
7501
7698
|
emailSelectedOption: null,
|
|
@@ -7505,9 +7702,10 @@
|
|
|
7505
7702
|
};
|
|
7506
7703
|
return _this;
|
|
7507
7704
|
}
|
|
7508
|
-
|
|
7705
|
+
|
|
7509
7706
|
return _createClass(NotificationDropDown);
|
|
7510
7707
|
}(React__default.Component);
|
|
7708
|
+
|
|
7511
7709
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
7512
7710
|
|
|
7513
7711
|
var simpleRequest = (function (axiosInstance, url) {
|
|
@@ -7567,23 +7765,23 @@
|
|
|
7567
7765
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7568
7766
|
}, function (_ref) {
|
|
7569
7767
|
var isChecked = _ref.isChecked,
|
|
7570
|
-
|
|
7768
|
+
theme = _ref.theme;
|
|
7571
7769
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7572
7770
|
}, function (_ref2) {
|
|
7573
7771
|
var isChecked = _ref2.isChecked,
|
|
7574
|
-
|
|
7772
|
+
theme = _ref2.theme;
|
|
7575
7773
|
return isChecked ? 'white' : theme.colors.base;
|
|
7576
7774
|
}, function (_ref3) {
|
|
7577
7775
|
var isChecked = _ref3.isChecked,
|
|
7578
|
-
|
|
7776
|
+
theme = _ref3.theme;
|
|
7579
7777
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7580
7778
|
}, function (_ref4) {
|
|
7581
7779
|
var isChecked = _ref4.isChecked,
|
|
7582
|
-
|
|
7780
|
+
theme = _ref4.theme;
|
|
7583
7781
|
return isChecked ? 'white' : theme.colors.base;
|
|
7584
7782
|
}, function (_ref5) {
|
|
7585
7783
|
var isChecked = _ref5.isChecked,
|
|
7586
|
-
|
|
7784
|
+
theme = _ref5.theme;
|
|
7587
7785
|
return isChecked ? theme.colors.primary : 'white';
|
|
7588
7786
|
}, media.sm, function (props) {
|
|
7589
7787
|
return props.theme.marginPaddings[2];
|
|
@@ -7738,45 +7936,56 @@
|
|
|
7738
7936
|
var baseButtonStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 1rem 2rem;\n cursor: pointer;\n letter-spacing: 1.3px;\n border-style: none;\n text-transform: uppercase;\n font-size: 12px;\n color: #fff;\n transition: 0.2s ease-in-out;\n outline: none;\n"])));
|
|
7739
7937
|
|
|
7740
7938
|
var _excluded = ["children"];
|
|
7939
|
+
|
|
7741
7940
|
var _templateObject$6;
|
|
7742
7941
|
var Button = styled__default.button(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n outline: none;\n cursor: pointer;\n background-color: transparent;\n border: none;\n &:disabled {\n ", ";\n }\n"])), disabledButtonStyle);
|
|
7942
|
+
|
|
7743
7943
|
var WrapperButton = function WrapperButton(_ref) {
|
|
7744
7944
|
var children = _ref.children,
|
|
7745
|
-
|
|
7945
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
7946
|
+
|
|
7746
7947
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
7747
7948
|
};
|
|
7748
7949
|
|
|
7749
7950
|
var _templateObject$7, _templateObject2$1;
|
|
7750
7951
|
var categories = catArray;
|
|
7952
|
+
|
|
7751
7953
|
var getSvg = function getSvg() {
|
|
7752
7954
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7955
|
+
|
|
7753
7956
|
switch (category) {
|
|
7754
7957
|
case interestCategories.BAGS:
|
|
7755
7958
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
7959
|
+
|
|
7756
7960
|
case interestCategories.SHOES:
|
|
7757
7961
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
7962
|
+
|
|
7758
7963
|
case interestCategories.APPAREL:
|
|
7759
7964
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
7965
|
+
|
|
7760
7966
|
case interestCategories.ACCESSORIES:
|
|
7761
7967
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
7968
|
+
|
|
7762
7969
|
case interestCategories.WATCHES:
|
|
7763
7970
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
7971
|
+
|
|
7764
7972
|
default:
|
|
7765
7973
|
return null;
|
|
7766
7974
|
}
|
|
7767
7975
|
};
|
|
7976
|
+
|
|
7768
7977
|
var Container = styled__default.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
7769
7978
|
return props.theme.marginPaddings[5];
|
|
7770
7979
|
});
|
|
7771
7980
|
var CategoryTitle = styled__default.h1(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
7772
|
-
|
|
7773
7981
|
/**
|
|
7774
7982
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
7775
7983
|
*/
|
|
7984
|
+
|
|
7776
7985
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
7777
7986
|
var onCategoryChange = _ref.onCategoryChange,
|
|
7778
|
-
|
|
7779
|
-
|
|
7987
|
+
errorMessage = _ref.errorMessage,
|
|
7988
|
+
category = _ref.category;
|
|
7780
7989
|
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(Body, null, categories.map(function (cat, index) {
|
|
7781
7990
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
7782
7991
|
key: "cat-".concat(index),
|
|
@@ -7791,6 +8000,7 @@
|
|
|
7791
8000
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
7792
8001
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errorMessage));
|
|
7793
8002
|
};
|
|
8003
|
+
|
|
7794
8004
|
InterestCatSelector.defaultProps = {
|
|
7795
8005
|
errorMessage: '',
|
|
7796
8006
|
category: null,
|
|
@@ -7801,6 +8011,7 @@
|
|
|
7801
8011
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
7802
8012
|
|
|
7803
8013
|
var _excluded$1 = ["children"];
|
|
8014
|
+
|
|
7804
8015
|
var _templateObject$8;
|
|
7805
8016
|
var Button$1 = styled__default.button(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
7806
8017
|
return props.theme.colors.base;
|
|
@@ -7809,17 +8020,21 @@
|
|
|
7809
8020
|
}, disabledButtonStyle, function (props) {
|
|
7810
8021
|
return props.theme.colors.base;
|
|
7811
8022
|
});
|
|
8023
|
+
|
|
7812
8024
|
var TextButton = function TextButton(_ref) {
|
|
7813
8025
|
var children = _ref.children,
|
|
7814
|
-
|
|
8026
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
8027
|
+
|
|
7815
8028
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
7816
8029
|
};
|
|
8030
|
+
|
|
7817
8031
|
TextButton.defaultProps = {
|
|
7818
8032
|
type: 'button'
|
|
7819
8033
|
};
|
|
7820
8034
|
var TextButton$1 = themed(TextButton);
|
|
7821
8035
|
|
|
7822
8036
|
var _excluded$2 = ["children"];
|
|
8037
|
+
|
|
7823
8038
|
var _templateObject$9;
|
|
7824
8039
|
var Button$2 = styled__default(TextButton$1)(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
7825
8040
|
return props.theme.colors.ntrlMin;
|
|
@@ -7834,11 +8049,14 @@
|
|
|
7834
8049
|
}, function (props) {
|
|
7835
8050
|
return props.theme.colors.primary;
|
|
7836
8051
|
});
|
|
8052
|
+
|
|
7837
8053
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
7838
8054
|
var children = _ref.children,
|
|
7839
|
-
|
|
8055
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
8056
|
+
|
|
7840
8057
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
7841
8058
|
};
|
|
8059
|
+
|
|
7842
8060
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
7843
8061
|
|
|
7844
8062
|
var _templateObject$a, _templateObject2$2;
|
|
@@ -7880,49 +8098,65 @@
|
|
|
7880
8098
|
}, function (props) {
|
|
7881
8099
|
return props.theme.colors.ntrlMin;
|
|
7882
8100
|
});
|
|
7883
|
-
|
|
7884
8101
|
/**
|
|
7885
8102
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
7886
8103
|
*/
|
|
8104
|
+
|
|
7887
8105
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
8106
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8107
|
+
|
|
8108
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
8109
|
+
|
|
7888
8110
|
function GraphQLMultiSelector(props) {
|
|
7889
8111
|
var _this;
|
|
8112
|
+
|
|
7890
8113
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
7891
|
-
|
|
7892
|
-
|
|
8114
|
+
|
|
8115
|
+
_this = _super.call(this, props);
|
|
8116
|
+
|
|
8117
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
7893
8118
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
7894
8119
|
_this.makeRequest();
|
|
7895
8120
|
}
|
|
7896
8121
|
});
|
|
7897
|
-
|
|
8122
|
+
|
|
8123
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
7898
8124
|
_this.pageReady.refreshPage();
|
|
7899
8125
|
});
|
|
7900
|
-
|
|
8126
|
+
|
|
8127
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
7901
8128
|
return _this.setState({
|
|
7902
8129
|
selected: [ALL_ITEM]
|
|
7903
8130
|
});
|
|
7904
8131
|
});
|
|
7905
|
-
|
|
8132
|
+
|
|
8133
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
7906
8134
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
7907
8135
|
return sel.id;
|
|
7908
8136
|
});
|
|
8137
|
+
|
|
7909
8138
|
var pagination = _this.props.resultProcessor(res);
|
|
8139
|
+
|
|
7910
8140
|
var allSelected = _this.state.selected.some(function (item) {
|
|
7911
8141
|
return item.id === ALL_ITEM.id;
|
|
7912
8142
|
});
|
|
8143
|
+
|
|
7913
8144
|
var newList = pagination.data.filter(function (newItem) {
|
|
7914
8145
|
return !selectedIds.includes(newItem.id);
|
|
7915
8146
|
});
|
|
7916
8147
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
8148
|
+
|
|
7917
8149
|
_this.setState({
|
|
7918
8150
|
list: newList,
|
|
7919
8151
|
pagination: pagination
|
|
7920
8152
|
});
|
|
7921
8153
|
});
|
|
7922
|
-
|
|
8154
|
+
|
|
8155
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
7923
8156
|
_this.setState(function (prevState) {
|
|
7924
8157
|
var newSelectedList;
|
|
7925
8158
|
var newList;
|
|
8159
|
+
|
|
7926
8160
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
7927
8161
|
// Clear Selected List
|
|
7928
8162
|
// and move previous Selected items to list
|
|
@@ -7942,6 +8176,7 @@
|
|
|
7942
8176
|
return item.id !== addSelectedItem.id;
|
|
7943
8177
|
})));
|
|
7944
8178
|
}
|
|
8179
|
+
|
|
7945
8180
|
return {
|
|
7946
8181
|
selected: newSelectedList,
|
|
7947
8182
|
list: newList
|
|
@@ -7952,20 +8187,24 @@
|
|
|
7952
8187
|
}));
|
|
7953
8188
|
});
|
|
7954
8189
|
});
|
|
7955
|
-
|
|
8190
|
+
|
|
8191
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
7956
8192
|
_this.setState(function (prevState) {
|
|
7957
8193
|
// Cannot remove ALL from selection by unselecting it
|
|
7958
8194
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
7959
8195
|
return {};
|
|
7960
8196
|
}
|
|
8197
|
+
|
|
7961
8198
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
7962
8199
|
return item.id !== removeSelectedItem.id;
|
|
7963
8200
|
});
|
|
8201
|
+
|
|
7964
8202
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
7965
8203
|
return item.id !== ALL_ITEM.id;
|
|
7966
8204
|
}).sort(function (a, b) {
|
|
7967
8205
|
return a.id - b.id;
|
|
7968
8206
|
});
|
|
8207
|
+
|
|
7969
8208
|
return {
|
|
7970
8209
|
list: newList,
|
|
7971
8210
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -7976,23 +8215,25 @@
|
|
|
7976
8215
|
}));
|
|
7977
8216
|
});
|
|
7978
8217
|
});
|
|
7979
|
-
|
|
8218
|
+
|
|
8219
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
7980
8220
|
_this.setState({
|
|
7981
8221
|
isLoading: flag
|
|
7982
8222
|
});
|
|
7983
8223
|
});
|
|
7984
|
-
|
|
8224
|
+
|
|
8225
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7985
8226
|
var _this$props = _this.props,
|
|
7986
|
-
|
|
7987
|
-
|
|
7988
|
-
|
|
7989
|
-
|
|
7990
|
-
|
|
8227
|
+
baseClass = _this$props.baseClass,
|
|
8228
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
8229
|
+
identifier = _this$props.identifier,
|
|
8230
|
+
triggerRequest = _this$props.triggerRequest,
|
|
8231
|
+
className = _this$props.className;
|
|
7991
8232
|
var _this$state = _this.state,
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
8233
|
+
list = _this$state.list,
|
|
8234
|
+
selected = _this$state.selected,
|
|
8235
|
+
pagination = _this$state.pagination,
|
|
8236
|
+
isLoading = _this$state.isLoading;
|
|
7996
8237
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7997
8238
|
"data-qe-id": identifier,
|
|
7998
8239
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -8031,6 +8272,7 @@
|
|
|
8031
8272
|
type: "button"
|
|
8032
8273
|
}, "SHOW MORE"))));
|
|
8033
8274
|
});
|
|
8275
|
+
|
|
8034
8276
|
_this.state = {
|
|
8035
8277
|
selected: [ALL_ITEM],
|
|
8036
8278
|
list: [],
|
|
@@ -8039,9 +8281,10 @@
|
|
|
8039
8281
|
};
|
|
8040
8282
|
return _this;
|
|
8041
8283
|
}
|
|
8042
|
-
|
|
8284
|
+
|
|
8043
8285
|
return _createClass(GraphQLMultiSelector);
|
|
8044
8286
|
}(React__default.Component);
|
|
8287
|
+
|
|
8045
8288
|
GraphQLMultiSelector.defaultProps = {
|
|
8046
8289
|
baseClass: 'multiselector'
|
|
8047
8290
|
};
|
|
@@ -8074,22 +8317,24 @@
|
|
|
8074
8317
|
}, function (props) {
|
|
8075
8318
|
return props.theme.marginPaddings[3];
|
|
8076
8319
|
});
|
|
8320
|
+
|
|
8077
8321
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
8078
8322
|
var title = _ref.title,
|
|
8079
|
-
|
|
8080
|
-
|
|
8323
|
+
children = _ref.children,
|
|
8324
|
+
className = _ref.className;
|
|
8081
8325
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
8082
8326
|
className: className
|
|
8083
8327
|
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
8084
8328
|
};
|
|
8085
8329
|
|
|
8086
8330
|
var _templateObject$c;
|
|
8331
|
+
|
|
8087
8332
|
var Title$1 = function Title(_ref) {
|
|
8088
8333
|
var baseClass = _ref.baseClass,
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8334
|
+
className = _ref.className,
|
|
8335
|
+
title = _ref.title,
|
|
8336
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
8337
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
8093
8338
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
8094
8339
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
8095
8340
|
title: title
|
|
@@ -8102,6 +8347,7 @@
|
|
|
8102
8347
|
onChange: onSearchChanged
|
|
8103
8348
|
})));
|
|
8104
8349
|
};
|
|
8350
|
+
|
|
8105
8351
|
var StyledTitle = styled__default(Title$1)(_templateObject$c || (_templateObject$c = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-weight: bold;\n display: flex;\n align-items: center;\n font-size: ", ";\n\n .title__search,\n .title__search {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 30px;\n margin-bottom: ", ";\n\n svg {\n margin-left: ", ";\n fill: ", ";\n stroke: ", ";\n }\n\n input {\n width: 140px;\n border: none;\n font-size: ", ";\n transition: 0.2s border-color ease-in-out;\n margin-left: ", ";\n padding: 0;\n\n :focus {\n border-color: ", ";\n border-bottom: none;\n }\n }\n }\n"])), function (props) {
|
|
8106
8352
|
return props.theme.marginPaddings[2];
|
|
8107
8353
|
}, function (props) {
|
|
@@ -8124,26 +8370,37 @@
|
|
|
8124
8370
|
var Title$2 = themed(StyledTitle);
|
|
8125
8371
|
|
|
8126
8372
|
var debounceBuilder = functions.debounced(200);
|
|
8373
|
+
|
|
8127
8374
|
/**
|
|
8128
8375
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
8129
8376
|
*/
|
|
8130
8377
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
8378
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8379
|
+
|
|
8380
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
8381
|
+
|
|
8131
8382
|
function LuxityGraphQLMultiselector(props) {
|
|
8132
8383
|
var _this;
|
|
8384
|
+
|
|
8133
8385
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
8134
|
-
|
|
8135
|
-
|
|
8136
|
-
|
|
8386
|
+
|
|
8387
|
+
_this = _super.call(this, props);
|
|
8388
|
+
|
|
8389
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8390
|
+
|
|
8391
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
8137
8392
|
_this.setState(function (prevState) {
|
|
8138
8393
|
return {
|
|
8139
8394
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
8140
8395
|
};
|
|
8141
8396
|
});
|
|
8142
8397
|
});
|
|
8143
|
-
|
|
8398
|
+
|
|
8399
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
8144
8400
|
_this.props.onChange(selection);
|
|
8145
8401
|
});
|
|
8146
|
-
|
|
8402
|
+
|
|
8403
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
8147
8404
|
event.preventDefault();
|
|
8148
8405
|
var searchText = event.target.value;
|
|
8149
8406
|
debounceBuilder(function () {
|
|
@@ -8152,21 +8409,22 @@
|
|
|
8152
8409
|
});
|
|
8153
8410
|
});
|
|
8154
8411
|
});
|
|
8155
|
-
|
|
8412
|
+
|
|
8413
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
8156
8414
|
var _this$state = _this.state,
|
|
8157
|
-
|
|
8158
|
-
|
|
8159
|
-
|
|
8415
|
+
limit = _this$state.limit,
|
|
8416
|
+
category = _this$state.category,
|
|
8417
|
+
nameFilter = _this$state.nameFilter;
|
|
8160
8418
|
var _this$props = _this.props,
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8168
|
-
|
|
8169
|
-
|
|
8419
|
+
title = _this$props.title,
|
|
8420
|
+
baseClass = _this$props.baseClass,
|
|
8421
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
8422
|
+
resultProcessor = _this$props.resultProcessor,
|
|
8423
|
+
itemRenderer = _this$props.itemRenderer,
|
|
8424
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
8425
|
+
graphApi = _this$props.graphApi,
|
|
8426
|
+
identifier = _this$props.identifier,
|
|
8427
|
+
requestInstance = _this$props.requestInstance;
|
|
8170
8428
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8171
8429
|
className: baseClass
|
|
8172
8430
|
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
@@ -8189,6 +8447,7 @@
|
|
|
8189
8447
|
itemRenderer: itemRenderer
|
|
8190
8448
|
})));
|
|
8191
8449
|
});
|
|
8450
|
+
|
|
8192
8451
|
_this.state = {
|
|
8193
8452
|
limit: props.baseQueryLimit,
|
|
8194
8453
|
category: props.category,
|
|
@@ -8196,11 +8455,12 @@
|
|
|
8196
8455
|
};
|
|
8197
8456
|
return _this;
|
|
8198
8457
|
}
|
|
8199
|
-
|
|
8200
|
-
|
|
8458
|
+
|
|
8459
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
8201
8460
|
key: "componentDidUpdate",
|
|
8202
8461
|
value: function componentDidUpdate(prevProps) {
|
|
8203
8462
|
var _this$multiSelectorRe;
|
|
8463
|
+
|
|
8204
8464
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
8205
8465
|
this.multiSelectorRef.current.emptySelected();
|
|
8206
8466
|
}
|
|
@@ -8213,10 +8473,14 @@
|
|
|
8213
8473
|
category: props.category
|
|
8214
8474
|
};
|
|
8215
8475
|
}
|
|
8476
|
+
|
|
8216
8477
|
return null;
|
|
8217
8478
|
}
|
|
8218
8479
|
}]);
|
|
8480
|
+
|
|
8481
|
+
return LuxityGraphQLMultiselector;
|
|
8219
8482
|
}(React__default.Component);
|
|
8483
|
+
|
|
8220
8484
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
8221
8485
|
baseClass: '',
|
|
8222
8486
|
searchPlaceHolder: '',
|
|
@@ -8225,17 +8489,21 @@
|
|
|
8225
8489
|
};
|
|
8226
8490
|
|
|
8227
8491
|
var _excluded$3 = ["children"];
|
|
8492
|
+
|
|
8228
8493
|
var _templateObject$d;
|
|
8229
8494
|
var Button$3 = styled__default.button(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
8230
8495
|
return props.theme.colors.primary;
|
|
8231
8496
|
}, function (props) {
|
|
8232
8497
|
return props.theme.colors.primary;
|
|
8233
8498
|
}, disabledButtonStyle);
|
|
8499
|
+
|
|
8234
8500
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
8235
8501
|
var children = _ref.children,
|
|
8236
|
-
|
|
8502
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
8503
|
+
|
|
8237
8504
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
8238
8505
|
};
|
|
8506
|
+
|
|
8239
8507
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
8240
8508
|
|
|
8241
8509
|
var _templateObject$e;
|
|
@@ -8251,10 +8519,11 @@
|
|
|
8251
8519
|
return props.theme.colors.ntrlMin;
|
|
8252
8520
|
});
|
|
8253
8521
|
var UnselectedButton = themed(BaseButton);
|
|
8522
|
+
|
|
8254
8523
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
8255
8524
|
var item = _ref.item,
|
|
8256
|
-
|
|
8257
|
-
|
|
8525
|
+
onSelect = _ref.onSelect,
|
|
8526
|
+
selected = _ref.selected;
|
|
8258
8527
|
var props = {
|
|
8259
8528
|
onClick: function onClick(e) {
|
|
8260
8529
|
e.preventDefault();
|
|
@@ -8266,12 +8535,12 @@
|
|
|
8266
8535
|
|
|
8267
8536
|
var BrandSelector = function BrandSelector(_ref) {
|
|
8268
8537
|
var onChange = _ref.onChange,
|
|
8269
|
-
|
|
8270
|
-
|
|
8271
|
-
|
|
8272
|
-
|
|
8273
|
-
|
|
8274
|
-
|
|
8538
|
+
category = _ref.category,
|
|
8539
|
+
graphApi = _ref.graphApi,
|
|
8540
|
+
itemRenderer = _ref.itemRenderer,
|
|
8541
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8542
|
+
resultProcessor = _ref.resultProcessor,
|
|
8543
|
+
requestInstance = _ref.requestInstance;
|
|
8275
8544
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8276
8545
|
baseQueryLimit: 16,
|
|
8277
8546
|
title: "Brands",
|
|
@@ -8288,6 +8557,7 @@
|
|
|
8288
8557
|
requestInstance: requestInstance
|
|
8289
8558
|
});
|
|
8290
8559
|
};
|
|
8560
|
+
|
|
8291
8561
|
BrandSelector.defaultProps = {
|
|
8292
8562
|
itemRenderer: ItemRenderer,
|
|
8293
8563
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8297,12 +8567,12 @@
|
|
|
8297
8567
|
|
|
8298
8568
|
var StyleSelector = function StyleSelector(_ref) {
|
|
8299
8569
|
var onChange = _ref.onChange,
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8570
|
+
category = _ref.category,
|
|
8571
|
+
graphApi = _ref.graphApi,
|
|
8572
|
+
itemRenderer = _ref.itemRenderer,
|
|
8573
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8574
|
+
resultProcessor = _ref.resultProcessor,
|
|
8575
|
+
requestInstance = _ref.requestInstance;
|
|
8306
8576
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8307
8577
|
title: "Styles",
|
|
8308
8578
|
queryId: "getStyles",
|
|
@@ -8319,6 +8589,7 @@
|
|
|
8319
8589
|
requestInstance: requestInstance
|
|
8320
8590
|
});
|
|
8321
8591
|
};
|
|
8592
|
+
|
|
8322
8593
|
StyleSelector.defaultProps = {
|
|
8323
8594
|
itemRenderer: ItemRenderer,
|
|
8324
8595
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8333,82 +8604,117 @@
|
|
|
8333
8604
|
};
|
|
8334
8605
|
|
|
8335
8606
|
function _extends$2() {
|
|
8336
|
-
|
|
8337
|
-
for (var
|
|
8338
|
-
var
|
|
8339
|
-
|
|
8607
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
8608
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8609
|
+
var source = arguments[i];
|
|
8610
|
+
|
|
8611
|
+
for (var key in source) {
|
|
8612
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8613
|
+
target[key] = source[key];
|
|
8614
|
+
}
|
|
8615
|
+
}
|
|
8340
8616
|
}
|
|
8341
|
-
|
|
8342
|
-
|
|
8617
|
+
|
|
8618
|
+
return target;
|
|
8619
|
+
};
|
|
8620
|
+
return _extends$2.apply(this, arguments);
|
|
8343
8621
|
}
|
|
8344
8622
|
|
|
8345
|
-
function _assertThisInitialized$2(
|
|
8346
|
-
if (
|
|
8347
|
-
|
|
8623
|
+
function _assertThisInitialized$2(self) {
|
|
8624
|
+
if (self === void 0) {
|
|
8625
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8626
|
+
}
|
|
8627
|
+
|
|
8628
|
+
return self;
|
|
8348
8629
|
}
|
|
8349
8630
|
|
|
8350
|
-
function _setPrototypeOf$2(
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8631
|
+
function _setPrototypeOf$2(o, p) {
|
|
8632
|
+
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
8633
|
+
o.__proto__ = p;
|
|
8634
|
+
return o;
|
|
8635
|
+
};
|
|
8636
|
+
return _setPrototypeOf$2(o, p);
|
|
8354
8637
|
}
|
|
8355
8638
|
|
|
8356
|
-
function _inheritsLoose(
|
|
8357
|
-
|
|
8639
|
+
function _inheritsLoose(subClass, superClass) {
|
|
8640
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
8641
|
+
subClass.prototype.constructor = subClass;
|
|
8642
|
+
_setPrototypeOf$2(subClass, superClass);
|
|
8358
8643
|
}
|
|
8359
8644
|
|
|
8360
|
-
function _getPrototypeOf$2(
|
|
8361
|
-
|
|
8362
|
-
return
|
|
8363
|
-
}
|
|
8645
|
+
function _getPrototypeOf$2(o) {
|
|
8646
|
+
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
8647
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
8648
|
+
};
|
|
8649
|
+
return _getPrototypeOf$2(o);
|
|
8364
8650
|
}
|
|
8365
8651
|
|
|
8366
|
-
function _isNativeFunction(
|
|
8367
|
-
|
|
8368
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
8369
|
-
} catch (n) {
|
|
8370
|
-
return "function" == typeof t;
|
|
8371
|
-
}
|
|
8652
|
+
function _isNativeFunction(fn) {
|
|
8653
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
8372
8654
|
}
|
|
8373
8655
|
|
|
8374
8656
|
function _isNativeReflectConstruct$1() {
|
|
8657
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8658
|
+
if (Reflect.construct.sham) return false;
|
|
8659
|
+
if (typeof Proxy === "function") return true;
|
|
8660
|
+
|
|
8375
8661
|
try {
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
return
|
|
8380
|
-
}
|
|
8662
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8663
|
+
return true;
|
|
8664
|
+
} catch (e) {
|
|
8665
|
+
return false;
|
|
8666
|
+
}
|
|
8381
8667
|
}
|
|
8382
8668
|
|
|
8383
|
-
function _construct(
|
|
8384
|
-
if (_isNativeReflectConstruct$1())
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8669
|
+
function _construct(Parent, args, Class) {
|
|
8670
|
+
if (_isNativeReflectConstruct$1()) {
|
|
8671
|
+
_construct = Reflect.construct.bind();
|
|
8672
|
+
} else {
|
|
8673
|
+
_construct = function _construct(Parent, args, Class) {
|
|
8674
|
+
var a = [null];
|
|
8675
|
+
a.push.apply(a, args);
|
|
8676
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
8677
|
+
var instance = new Constructor();
|
|
8678
|
+
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8679
|
+
return instance;
|
|
8680
|
+
};
|
|
8681
|
+
}
|
|
8682
|
+
|
|
8683
|
+
return _construct.apply(null, arguments);
|
|
8389
8684
|
}
|
|
8390
8685
|
|
|
8391
|
-
function _wrapNativeSuper(
|
|
8392
|
-
var
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
if (
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
|
|
8686
|
+
function _wrapNativeSuper(Class) {
|
|
8687
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
8688
|
+
|
|
8689
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
8690
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
8691
|
+
|
|
8692
|
+
if (typeof Class !== "function") {
|
|
8693
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8694
|
+
}
|
|
8695
|
+
|
|
8696
|
+
if (typeof _cache !== "undefined") {
|
|
8697
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
8698
|
+
|
|
8699
|
+
_cache.set(Class, Wrapper);
|
|
8399
8700
|
}
|
|
8701
|
+
|
|
8400
8702
|
function Wrapper() {
|
|
8401
|
-
return _construct(
|
|
8703
|
+
return _construct(Class, arguments, _getPrototypeOf$2(this).constructor);
|
|
8402
8704
|
}
|
|
8403
|
-
|
|
8705
|
+
|
|
8706
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8404
8707
|
constructor: {
|
|
8405
8708
|
value: Wrapper,
|
|
8406
|
-
enumerable:
|
|
8407
|
-
writable:
|
|
8408
|
-
configurable:
|
|
8709
|
+
enumerable: false,
|
|
8710
|
+
writable: true,
|
|
8711
|
+
configurable: true
|
|
8409
8712
|
}
|
|
8410
|
-
})
|
|
8411
|
-
|
|
8713
|
+
});
|
|
8714
|
+
return _setPrototypeOf$2(Wrapper, Class);
|
|
8715
|
+
};
|
|
8716
|
+
|
|
8717
|
+
return _wrapNativeSuper(Class);
|
|
8412
8718
|
}
|
|
8413
8719
|
|
|
8414
8720
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -9077,9 +9383,10 @@
|
|
|
9077
9383
|
}, function (props) {
|
|
9078
9384
|
return getSliderMarkStyle(props);
|
|
9079
9385
|
});
|
|
9386
|
+
|
|
9080
9387
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
9081
9388
|
var showMarks = _ref.showMarks,
|
|
9082
|
-
|
|
9389
|
+
primary = _ref.theme.colors.primary;
|
|
9083
9390
|
var visiblityStyle = showMarks ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral([""]))) : styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .rc-slider-mark-text,\n .rc-slider-dot {\n visibility: hidden;\n }\n "])));
|
|
9084
9391
|
return styled.css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n .rc-slider-mark-text {\n color: ", ";\n }\n\n .rc-slider-dot {\n border-color: ", ";\n background-color: white;\n }\n ", "\n "])), primary, primary, visiblityStyle);
|
|
9085
9392
|
};
|
|
@@ -9091,24 +9398,28 @@
|
|
|
9091
9398
|
var Footer = styled__default.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
9092
9399
|
|
|
9093
9400
|
var _excluded$4 = ["dragging", "value", "offset", "index"],
|
|
9094
|
-
|
|
9401
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9402
|
+
|
|
9095
9403
|
var _templateObject$j;
|
|
9096
9404
|
var debounceBuilder$1 = functions.debounced(100);
|
|
9097
9405
|
var ChildrenWrapper = styled__default.div(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
9098
9406
|
return props.theme.marginPaddings[3];
|
|
9099
9407
|
});
|
|
9408
|
+
|
|
9100
9409
|
var renderCustomHandle = function renderCustomHandle() {
|
|
9101
9410
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9102
9411
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9103
9412
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9413
|
+
|
|
9104
9414
|
var dragging = handleProps.dragging,
|
|
9105
|
-
|
|
9106
|
-
|
|
9107
|
-
|
|
9108
|
-
|
|
9415
|
+
value = handleProps.value,
|
|
9416
|
+
offset = handleProps.offset,
|
|
9417
|
+
index = handleProps.index,
|
|
9418
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$4);
|
|
9419
|
+
|
|
9109
9420
|
var getToolTipProps = function getToolTipProps() {
|
|
9110
|
-
var newProps = {};
|
|
9111
|
-
|
|
9421
|
+
var newProps = {}; // Ensures that Tooltip component does not get ref prop
|
|
9422
|
+
|
|
9112
9423
|
Object.keys(handleProps).forEach(function (propName) {
|
|
9113
9424
|
if (propName !== 'ref') {
|
|
9114
9425
|
newProps[propName] = handleProps[propName];
|
|
@@ -9116,6 +9427,7 @@
|
|
|
9116
9427
|
});
|
|
9117
9428
|
return newProps;
|
|
9118
9429
|
};
|
|
9430
|
+
|
|
9119
9431
|
var Tooltip = toolTipComponent;
|
|
9120
9432
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
9121
9433
|
key: index
|
|
@@ -9132,47 +9444,55 @@
|
|
|
9132
9444
|
marks: marks
|
|
9133
9445
|
}, getToolTipProps()))));
|
|
9134
9446
|
};
|
|
9135
|
-
|
|
9136
9447
|
/** slider ui component for react */
|
|
9448
|
+
|
|
9449
|
+
|
|
9137
9450
|
var RangeSlider = function RangeSlider(_ref) {
|
|
9138
9451
|
var renderTitleSection = _ref.renderTitleSection,
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
|
|
9145
|
-
|
|
9146
|
-
|
|
9147
|
-
|
|
9148
|
-
|
|
9149
|
-
|
|
9150
|
-
|
|
9452
|
+
marks = _ref.marks,
|
|
9453
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
9454
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
9455
|
+
min = _ref.min,
|
|
9456
|
+
max = _ref.max,
|
|
9457
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
9458
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
9459
|
+
onChange = _ref.onChange,
|
|
9460
|
+
childRenderer = _ref.children,
|
|
9461
|
+
identifier = _ref.identifier,
|
|
9462
|
+
showMarks = _ref.showMarks,
|
|
9463
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
9464
|
+
|
|
9151
9465
|
var _useState = React.useState(defaultMinValue),
|
|
9152
|
-
|
|
9153
|
-
|
|
9154
|
-
|
|
9466
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9467
|
+
currMinVal = _useState2[0],
|
|
9468
|
+
setMinVal = _useState2[1];
|
|
9469
|
+
|
|
9155
9470
|
var _useState3 = React.useState(defaultMaxValue),
|
|
9156
|
-
|
|
9157
|
-
|
|
9158
|
-
|
|
9471
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9472
|
+
currMaxVal = _useState4[0],
|
|
9473
|
+
setMaxVal = _useState4[1];
|
|
9159
9474
|
/*
|
|
9160
9475
|
*Description variable stores the time that the component renders
|
|
9161
9476
|
* the state is used to enforce reenders for the component since the date now
|
|
9162
9477
|
* is always changing
|
|
9163
9478
|
* */
|
|
9479
|
+
|
|
9480
|
+
|
|
9164
9481
|
var _useState5 = React.useState(0),
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9482
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9483
|
+
seed = _useState6[0],
|
|
9484
|
+
setSeed = _useState6[1];
|
|
9485
|
+
|
|
9168
9486
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
9169
9487
|
setMinVal(val);
|
|
9170
9488
|
setSeed(Date.now());
|
|
9171
9489
|
};
|
|
9490
|
+
|
|
9172
9491
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
9173
9492
|
setMaxVal(val);
|
|
9174
9493
|
setSeed(Date.now());
|
|
9175
9494
|
};
|
|
9495
|
+
|
|
9176
9496
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
9177
9497
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
9178
9498
|
React.useEffect(function () {
|
|
@@ -9208,8 +9528,9 @@
|
|
|
9208
9528
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
9209
9529
|
onChange: function onChange(_ref2) {
|
|
9210
9530
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9211
|
-
|
|
9212
|
-
|
|
9531
|
+
nextMin = _ref3[0],
|
|
9532
|
+
nextMax = _ref3[1];
|
|
9533
|
+
|
|
9213
9534
|
setMinVal(nextMin);
|
|
9214
9535
|
setMaxVal(nextMax);
|
|
9215
9536
|
},
|
|
@@ -9222,6 +9543,7 @@
|
|
|
9222
9543
|
allowCross: false
|
|
9223
9544
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9224
9545
|
};
|
|
9546
|
+
|
|
9225
9547
|
RangeSlider.defaultProps = {
|
|
9226
9548
|
renderTitleSection: function renderTitleSection() {
|
|
9227
9549
|
return false;
|
|
@@ -9243,6 +9565,7 @@
|
|
|
9243
9565
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9244
9566
|
return shoe_sizes.length - 1;
|
|
9245
9567
|
};
|
|
9568
|
+
|
|
9246
9569
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9247
9570
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9248
9571
|
var newDataShape = {};
|
|
@@ -9252,24 +9575,28 @@
|
|
|
9252
9575
|
});
|
|
9253
9576
|
return newDataShape;
|
|
9254
9577
|
};
|
|
9578
|
+
|
|
9255
9579
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9256
9580
|
var marks = props.marks,
|
|
9257
|
-
|
|
9581
|
+
value = props.value;
|
|
9258
9582
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9259
9583
|
};
|
|
9260
|
-
|
|
9261
9584
|
/** slider ui component for shoe size selection interests */
|
|
9585
|
+
|
|
9586
|
+
|
|
9262
9587
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9263
9588
|
var onChange = _ref2.onChange,
|
|
9264
|
-
|
|
9589
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9590
|
+
|
|
9265
9591
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9266
9592
|
var min_shoe_key = value.min,
|
|
9267
|
-
|
|
9593
|
+
max_shoe_key = value.max;
|
|
9268
9594
|
onChange({
|
|
9269
9595
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9270
9596
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9271
9597
|
});
|
|
9272
9598
|
};
|
|
9599
|
+
|
|
9273
9600
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9274
9601
|
var giveFullRange = actionObj.giveFullRange;
|
|
9275
9602
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9278,6 +9605,7 @@
|
|
|
9278
9605
|
onClick: giveFullRange
|
|
9279
9606
|
}, "Full Shoe Size Range"));
|
|
9280
9607
|
};
|
|
9608
|
+
|
|
9281
9609
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9282
9610
|
identifier: "shoe-size-range-slider",
|
|
9283
9611
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9290,6 +9618,7 @@
|
|
|
9290
9618
|
onChange: handleShoeSizeChange
|
|
9291
9619
|
}));
|
|
9292
9620
|
};
|
|
9621
|
+
|
|
9293
9622
|
ShoeSizeSelector.defaultProps = {
|
|
9294
9623
|
onChange: function onChange() {
|
|
9295
9624
|
return false;
|
|
@@ -9338,6 +9667,7 @@
|
|
|
9338
9667
|
var inputMarginRight = '0.2em';
|
|
9339
9668
|
var CheckboxLabel = styled__default.label(_templateObject$s || (_templateObject$s = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"])), function (props) {
|
|
9340
9669
|
var _props$theme;
|
|
9670
|
+
|
|
9341
9671
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
9342
9672
|
}, function (props) {
|
|
9343
9673
|
return props.theme.fontSizes[4];
|
|
@@ -9361,14 +9691,16 @@
|
|
|
9361
9691
|
*/
|
|
9362
9692
|
var RadioButtons = function RadioButtons(_ref) {
|
|
9363
9693
|
var options = _ref.options,
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9694
|
+
name = _ref.name,
|
|
9695
|
+
noWrap = _ref.noWrap,
|
|
9696
|
+
title = _ref.title,
|
|
9697
|
+
errors = _ref.errors;
|
|
9698
|
+
|
|
9368
9699
|
var _useState = React.useState(errors[name]),
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9700
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9701
|
+
errMsg = _useState2[0],
|
|
9702
|
+
setErrMsg = _useState2[1];
|
|
9703
|
+
|
|
9372
9704
|
React.useEffect(function () {
|
|
9373
9705
|
setErrMsg(errors[name]);
|
|
9374
9706
|
}, [errors, name]);
|
|
@@ -9376,15 +9708,15 @@
|
|
|
9376
9708
|
noWrap: noWrap
|
|
9377
9709
|
}, options.map(function (_ref2, index) {
|
|
9378
9710
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9711
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
9712
|
+
return null;
|
|
9713
|
+
} : _ref2$actionCallback,
|
|
9714
|
+
_ref2$value = _ref2.value,
|
|
9715
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
9716
|
+
_ref2$innerText = _ref2.innerText,
|
|
9717
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
9718
|
+
_ref2$checked = _ref2.checked,
|
|
9719
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
9388
9720
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
9389
9721
|
key: "".concat(name, "-").concat(index),
|
|
9390
9722
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -9401,6 +9733,7 @@
|
|
|
9401
9733
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
9402
9734
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errMsg));
|
|
9403
9735
|
};
|
|
9736
|
+
|
|
9404
9737
|
RadioButtons.defaultProps = {
|
|
9405
9738
|
noWrap: false,
|
|
9406
9739
|
title: '',
|
|
@@ -9432,14 +9765,17 @@
|
|
|
9432
9765
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9433
9766
|
childVisible: false
|
|
9434
9767
|
};
|
|
9768
|
+
|
|
9435
9769
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9436
9770
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9437
|
-
|
|
9771
|
+
children = _ref.children;
|
|
9438
9772
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
9773
|
+
|
|
9439
9774
|
var _React$useState = React__default.useState(false),
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9775
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9776
|
+
childVisible = _React$useState2[0],
|
|
9777
|
+
setChildVisible = _React$useState2[1];
|
|
9778
|
+
|
|
9443
9779
|
React__default.useEffect(function () {
|
|
9444
9780
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9445
9781
|
setChildVisible(false);
|
|
@@ -9452,25 +9788,30 @@
|
|
|
9452
9788
|
childVisible: childVisible
|
|
9453
9789
|
}, children);
|
|
9454
9790
|
};
|
|
9791
|
+
|
|
9455
9792
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9456
9793
|
var onChange = _ref2.onChange,
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9794
|
+
requestInstance = _ref2.requestInstance,
|
|
9795
|
+
graphApi = _ref2.graphApi,
|
|
9796
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9797
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
9798
|
+
|
|
9461
9799
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9800
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9801
|
+
shoeSizeType = _useState2[0],
|
|
9802
|
+
setShoeSizeType = _useState2[1];
|
|
9803
|
+
|
|
9465
9804
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9805
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9806
|
+
transitionedTo = _useState4[0],
|
|
9807
|
+
setTransitionedTo = _useState4[1];
|
|
9808
|
+
|
|
9469
9809
|
var triggerRequest = function triggerRequest() {
|
|
9470
9810
|
return requestInstance.post(graphApi, {
|
|
9471
9811
|
query: getGraphQuery()
|
|
9472
9812
|
});
|
|
9473
9813
|
};
|
|
9814
|
+
|
|
9474
9815
|
var shoeSizeTypeProps = {
|
|
9475
9816
|
name: 'shoe_size_type',
|
|
9476
9817
|
noWrap: true,
|
|
@@ -9494,12 +9835,15 @@
|
|
|
9494
9835
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9495
9836
|
}]
|
|
9496
9837
|
};
|
|
9838
|
+
|
|
9497
9839
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
9498
9840
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
9499
9841
|
shoe_size_type: shoeSizeType
|
|
9500
9842
|
});
|
|
9843
|
+
|
|
9501
9844
|
onChange(payload);
|
|
9502
9845
|
};
|
|
9846
|
+
|
|
9503
9847
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
9504
9848
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9505
9849
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -9509,32 +9853,38 @@
|
|
|
9509
9853
|
}
|
|
9510
9854
|
});
|
|
9511
9855
|
};
|
|
9856
|
+
|
|
9512
9857
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
9513
9858
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9514
9859
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9860
|
+
|
|
9515
9861
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
9516
9862
|
return renderShoeSizeSelector(euShoeSizes);
|
|
9517
9863
|
}
|
|
9864
|
+
|
|
9518
9865
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
9519
9866
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
9520
9867
|
}
|
|
9868
|
+
|
|
9521
9869
|
return null;
|
|
9522
9870
|
};
|
|
9871
|
+
|
|
9523
9872
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9524
9873
|
getRequestPromise: triggerRequest
|
|
9525
9874
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9526
9875
|
title: "Shoe Size Range"
|
|
9527
9876
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
9528
9877
|
var _ref3$data$data = _ref3.data.data,
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9878
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
9879
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
9880
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
9881
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
9533
9882
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
9534
9883
|
shoeSizeType: transitionedTo
|
|
9535
9884
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
9536
9885
|
}));
|
|
9537
9886
|
};
|
|
9887
|
+
|
|
9538
9888
|
WrappedShoeSizeSelector.defaultProps = {
|
|
9539
9889
|
onChange: function onChange() {
|
|
9540
9890
|
return false;
|
|
@@ -9546,28 +9896,31 @@
|
|
|
9546
9896
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9547
9897
|
return value.replace(/\D/g, '');
|
|
9548
9898
|
};
|
|
9549
|
-
|
|
9550
9899
|
/**
|
|
9551
9900
|
* Currency Input which formats the value to a specific format
|
|
9552
9901
|
*/
|
|
9902
|
+
|
|
9553
9903
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
9554
9904
|
var value = _ref.value,
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9905
|
+
onChange = _ref.onChange,
|
|
9906
|
+
prefix = _ref.prefix,
|
|
9907
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
9908
|
+
groupSeparator = _ref.groupSeparator,
|
|
9909
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
9910
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
9911
|
+
|
|
9561
9912
|
var handleValueChange = function handleValueChange(event) {
|
|
9562
9913
|
var inputValue = event.target.value;
|
|
9563
9914
|
var unmaskedValue = unMask(inputValue);
|
|
9564
9915
|
onChange(unmaskedValue);
|
|
9565
9916
|
};
|
|
9917
|
+
|
|
9566
9918
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
9567
9919
|
var numericValue = Number(originalValue);
|
|
9568
9920
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
9569
9921
|
return prefix + formattedValue;
|
|
9570
9922
|
};
|
|
9923
|
+
|
|
9571
9924
|
var formattedValue = formatCurrency(value);
|
|
9572
9925
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
9573
9926
|
type: "text",
|
|
@@ -9575,6 +9928,7 @@
|
|
|
9575
9928
|
onChange: handleValueChange
|
|
9576
9929
|
}));
|
|
9577
9930
|
};
|
|
9931
|
+
|
|
9578
9932
|
CurrencyInputFormatter.defaultProps = {
|
|
9579
9933
|
value: '',
|
|
9580
9934
|
prefix: 'R',
|
|
@@ -9585,6 +9939,7 @@
|
|
|
9585
9939
|
};
|
|
9586
9940
|
|
|
9587
9941
|
var _excluded$6 = ["children"];
|
|
9942
|
+
|
|
9588
9943
|
var _templateObject$u;
|
|
9589
9944
|
var Button$4 = styled__default.button(_templateObject$u || (_templateObject$u = _taggedTemplateLiteral(["\n ", ";\n background-color: ", ";\n color: ", ";\n border: 1px solid ", ";\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:disabled {\n ", "\n &:hover {\n background-color: ", ";\n }\n }\n"])), baseButtonStyle, function (props) {
|
|
9590
9945
|
return props.theme.colors.ntrlMin;
|
|
@@ -9599,11 +9954,14 @@
|
|
|
9599
9954
|
}, disabledButtonStyle, function (props) {
|
|
9600
9955
|
return props.theme.colors.base;
|
|
9601
9956
|
});
|
|
9957
|
+
|
|
9602
9958
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
9603
9959
|
var children = _ref.children,
|
|
9604
|
-
|
|
9960
|
+
restProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
9961
|
+
|
|
9605
9962
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
9606
9963
|
};
|
|
9964
|
+
|
|
9607
9965
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
9608
9966
|
|
|
9609
9967
|
var _templateObject$v;
|
|
@@ -9612,23 +9970,31 @@
|
|
|
9612
9970
|
});
|
|
9613
9971
|
|
|
9614
9972
|
var debounceBuilder$2 = functions.debounced(50);
|
|
9973
|
+
|
|
9615
9974
|
var getMaxPrice = function getMaxPrice() {
|
|
9616
9975
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9976
|
+
|
|
9617
9977
|
switch (interestCategory) {
|
|
9618
9978
|
case interestCategories.ACCESSORIES:
|
|
9619
9979
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9980
|
+
|
|
9620
9981
|
case interestCategories.BAGS:
|
|
9621
9982
|
return interestCategoryMaxPrices.BAGS;
|
|
9983
|
+
|
|
9622
9984
|
case interestCategories.SHOES:
|
|
9623
9985
|
return interestCategoryMaxPrices.SHOES;
|
|
9986
|
+
|
|
9624
9987
|
case interestCategories.WATCHES:
|
|
9625
9988
|
return interestCategoryMaxPrices.WATCHES;
|
|
9989
|
+
|
|
9626
9990
|
case interestCategories.APPAREL:
|
|
9627
9991
|
return interestCategoryMaxPrices.APPAREL;
|
|
9992
|
+
|
|
9628
9993
|
default:
|
|
9629
9994
|
return 0;
|
|
9630
9995
|
}
|
|
9631
9996
|
};
|
|
9997
|
+
|
|
9632
9998
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9633
9999
|
var giveFullRange = actionObj.giveFullRange;
|
|
9634
10000
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -9636,21 +10002,24 @@
|
|
|
9636
10002
|
onClick: giveFullRange
|
|
9637
10003
|
}, "Full Price Range");
|
|
9638
10004
|
};
|
|
9639
|
-
|
|
9640
10005
|
/** UI Slider with minimum and max input fields give the ability to
|
|
9641
10006
|
* select a price range */
|
|
10007
|
+
|
|
10008
|
+
|
|
9642
10009
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
9643
10010
|
var onChange = _ref.onChange,
|
|
9644
|
-
|
|
10011
|
+
category = _ref.category;
|
|
9645
10012
|
var maxPrice = getMaxPrice(category);
|
|
10013
|
+
|
|
9646
10014
|
var handleSlideChange = function handleSlideChange(value) {
|
|
9647
10015
|
var min_price = value.min,
|
|
9648
|
-
|
|
10016
|
+
max_price = value.max;
|
|
9649
10017
|
onChange({
|
|
9650
10018
|
min_price: min_price,
|
|
9651
10019
|
max_price: max_price
|
|
9652
10020
|
});
|
|
9653
10021
|
};
|
|
10022
|
+
|
|
9654
10023
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
9655
10024
|
var value = parseInt(unMask(targetValue), 10);
|
|
9656
10025
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9663,6 +10032,7 @@
|
|
|
9663
10032
|
});
|
|
9664
10033
|
});
|
|
9665
10034
|
};
|
|
10035
|
+
|
|
9666
10036
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
9667
10037
|
var value = parseInt(unMask(targetValue), 10);
|
|
9668
10038
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9675,6 +10045,7 @@
|
|
|
9675
10045
|
});
|
|
9676
10046
|
});
|
|
9677
10047
|
};
|
|
10048
|
+
|
|
9678
10049
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9679
10050
|
className: "price-ranges"
|
|
9680
10051
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -9693,9 +10064,9 @@
|
|
|
9693
10064
|
title: "Price Ranges"
|
|
9694
10065
|
}, function (_ref2) {
|
|
9695
10066
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
10067
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
10068
|
+
currMinVal = _ref2.currMinVal,
|
|
10069
|
+
currMaxVal = _ref2.currMaxVal;
|
|
9699
10070
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
9700
10071
|
"data-qe-id": "masked-input-min",
|
|
9701
10072
|
value: currMinVal,
|
|
@@ -9711,6 +10082,7 @@
|
|
|
9711
10082
|
}));
|
|
9712
10083
|
}));
|
|
9713
10084
|
};
|
|
10085
|
+
|
|
9714
10086
|
PriceRangeSelector.defaultProps = {
|
|
9715
10087
|
onChange: function onChange() {
|
|
9716
10088
|
return false;
|
|
@@ -9734,6 +10106,7 @@
|
|
|
9734
10106
|
});
|
|
9735
10107
|
|
|
9736
10108
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10109
|
+
|
|
9737
10110
|
var _templateObject$x, _templateObject2$6, _templateObject3$1;
|
|
9738
10111
|
var Content = styled__default.div(_templateObject$x || (_templateObject$x = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n transition: 200ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
9739
10112
|
return props.theme.colors.primary;
|
|
@@ -9752,32 +10125,36 @@
|
|
|
9752
10125
|
}, Content, InputText, function (props) {
|
|
9753
10126
|
return props.theme.colors.ntrlMin;
|
|
9754
10127
|
}, Content);
|
|
9755
|
-
|
|
9756
10128
|
/**
|
|
9757
10129
|
* CheckButton: Styled checkbox that resembles a button
|
|
9758
10130
|
* */
|
|
10131
|
+
|
|
9759
10132
|
var CheckButton = function CheckButton(props) {
|
|
9760
10133
|
var title = props.title,
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
10134
|
+
checked = props.checked,
|
|
10135
|
+
renderIcon = props.renderIcon,
|
|
10136
|
+
onChange = props.onChange,
|
|
10137
|
+
checkedValue = props.checkedValue,
|
|
10138
|
+
unCheckedValue = props.unCheckedValue,
|
|
10139
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10140
|
+
|
|
9767
10141
|
var _React$useState = React__default.useState(checked),
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
10142
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10143
|
+
checkedState = _React$useState2[0],
|
|
10144
|
+
setCheck = _React$useState2[1];
|
|
10145
|
+
|
|
9771
10146
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
9772
10147
|
React__default.useEffect(function () {
|
|
9773
10148
|
if (prevCheckState !== checkedState) {
|
|
9774
10149
|
onChange(checkedState);
|
|
9775
10150
|
}
|
|
9776
10151
|
}, [checkedState, onChange, prevCheckState]);
|
|
10152
|
+
|
|
9777
10153
|
var handleInputChange = function handleInputChange(e) {
|
|
9778
10154
|
var targetChecked = e.target.checked;
|
|
9779
10155
|
setCheck(targetChecked);
|
|
9780
10156
|
};
|
|
10157
|
+
|
|
9781
10158
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
9782
10159
|
defaultChecked: checked
|
|
9783
10160
|
}, restProps, {
|
|
@@ -9785,6 +10162,7 @@
|
|
|
9785
10162
|
onChange: handleInputChange
|
|
9786
10163
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
9787
10164
|
};
|
|
10165
|
+
|
|
9788
10166
|
CheckButton.defaultProps = {
|
|
9789
10167
|
title: '',
|
|
9790
10168
|
checked: false,
|
|
@@ -9798,24 +10176,29 @@
|
|
|
9798
10176
|
var CheckButton$1 = themed(CheckButton);
|
|
9799
10177
|
|
|
9800
10178
|
var MALE = genders.MALE,
|
|
9801
|
-
|
|
10179
|
+
FEMALE = genders.FEMALE;
|
|
10180
|
+
|
|
9802
10181
|
/**
|
|
9803
10182
|
* Stylized CheckboxButton for selecting gender
|
|
9804
10183
|
* */
|
|
9805
10184
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
9806
10185
|
var gender = _ref.gender,
|
|
9807
|
-
|
|
9808
|
-
|
|
10186
|
+
checked = _ref.checked,
|
|
10187
|
+
onInputChange = _ref.onInputChange;
|
|
10188
|
+
|
|
9809
10189
|
var getTitle = function getTitle() {
|
|
9810
10190
|
switch (gender) {
|
|
9811
10191
|
case MALE:
|
|
9812
10192
|
return 'Male';
|
|
10193
|
+
|
|
9813
10194
|
case FEMALE:
|
|
9814
10195
|
return 'Female';
|
|
10196
|
+
|
|
9815
10197
|
default:
|
|
9816
10198
|
return '';
|
|
9817
10199
|
}
|
|
9818
10200
|
};
|
|
10201
|
+
|
|
9819
10202
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
9820
10203
|
onChange: onInputChange,
|
|
9821
10204
|
checked: checked,
|
|
@@ -9823,20 +10206,22 @@
|
|
|
9823
10206
|
title: getTitle()
|
|
9824
10207
|
});
|
|
9825
10208
|
};
|
|
10209
|
+
|
|
9826
10210
|
GenderCheckbox.defaultProps = {
|
|
9827
10211
|
name: ''
|
|
9828
10212
|
};
|
|
9829
10213
|
|
|
9830
10214
|
var MALE$1 = genders.MALE,
|
|
9831
|
-
|
|
10215
|
+
FEMALE$1 = genders.FEMALE;
|
|
10216
|
+
|
|
9832
10217
|
/**
|
|
9833
10218
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
9834
10219
|
* */
|
|
9835
10220
|
var GenderSelector = function GenderSelector(_ref) {
|
|
9836
10221
|
var gender = _ref.gender,
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
10222
|
+
onChange = _ref.onChange,
|
|
10223
|
+
maleInputRef = _ref.maleInputRef,
|
|
10224
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
9840
10225
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9841
10226
|
className: "gender-selector"
|
|
9842
10227
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -9861,6 +10246,7 @@
|
|
|
9861
10246
|
checkBoxButtonRef: femaleInputRef
|
|
9862
10247
|
})));
|
|
9863
10248
|
};
|
|
10249
|
+
|
|
9864
10250
|
GenderSelector.defaultProps = {
|
|
9865
10251
|
gender: null,
|
|
9866
10252
|
onChange: function onChange() {
|
|
@@ -9871,13 +10257,15 @@
|
|
|
9871
10257
|
|
|
9872
10258
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
9873
10259
|
var onChange = _ref.onChange,
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
10260
|
+
graphApi = _ref.graphApi,
|
|
10261
|
+
itemRenderer = _ref.itemRenderer,
|
|
10262
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10263
|
+
requestInstance = _ref.requestInstance;
|
|
10264
|
+
|
|
9878
10265
|
var resultProcessor = function resultProcessor(result) {
|
|
9879
10266
|
return result.data.data.conditions_list;
|
|
9880
10267
|
};
|
|
10268
|
+
|
|
9881
10269
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9882
10270
|
title: "Condition",
|
|
9883
10271
|
queryId: "getCondition",
|
|
@@ -9894,6 +10282,7 @@
|
|
|
9894
10282
|
requestInstance: requestInstance
|
|
9895
10283
|
});
|
|
9896
10284
|
};
|
|
10285
|
+
|
|
9897
10286
|
ConditionSelector.defaultProps = {
|
|
9898
10287
|
itemRenderer: ItemRenderer
|
|
9899
10288
|
};
|
|
@@ -9932,30 +10321,41 @@
|
|
|
9932
10321
|
request: _objectSpread2({}, request),
|
|
9933
10322
|
isCategoriesShown: false
|
|
9934
10323
|
};
|
|
9935
|
-
|
|
9936
10324
|
/**
|
|
9937
10325
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
9938
10326
|
*/
|
|
10327
|
+
|
|
9939
10328
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10329
|
+
_inherits(AddInterest, _React$Component);
|
|
10330
|
+
|
|
10331
|
+
var _super = _createSuper(AddInterest);
|
|
10332
|
+
|
|
9940
10333
|
function AddInterest(props) {
|
|
9941
10334
|
var _this;
|
|
10335
|
+
|
|
9942
10336
|
_classCallCheck(this, AddInterest);
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
_defineProperty(_this, "
|
|
10337
|
+
|
|
10338
|
+
_this = _super.call(this, props);
|
|
10339
|
+
|
|
10340
|
+
_defineProperty(_assertThisInitialized(_this), "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10341
|
+
|
|
10342
|
+
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10343
|
+
|
|
10344
|
+
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
9947
10345
|
_this.setState({
|
|
9948
10346
|
category_type: categoryType,
|
|
9949
10347
|
brands: [],
|
|
9950
10348
|
styles: []
|
|
9951
10349
|
});
|
|
9952
10350
|
});
|
|
9953
|
-
|
|
10351
|
+
|
|
10352
|
+
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
9954
10353
|
return _this.setState(function (prevState) {
|
|
9955
10354
|
// current array of options
|
|
9956
10355
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
9957
|
-
|
|
9958
|
-
// check if the check box is checked or unchecked
|
|
10356
|
+
|
|
10357
|
+
var index; // check if the check box is checked or unchecked
|
|
10358
|
+
|
|
9959
10359
|
if (isChecked) {
|
|
9960
10360
|
gendersSelected.push(gender);
|
|
9961
10361
|
} else {
|
|
@@ -9963,65 +10363,76 @@
|
|
|
9963
10363
|
index = gendersSelected.indexOf(gender);
|
|
9964
10364
|
gendersSelected.splice(index, 1);
|
|
9965
10365
|
}
|
|
10366
|
+
|
|
9966
10367
|
return {
|
|
9967
10368
|
gender: gendersSelected
|
|
9968
10369
|
};
|
|
9969
10370
|
});
|
|
9970
10371
|
});
|
|
9971
|
-
|
|
10372
|
+
|
|
10373
|
+
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
9972
10374
|
_this.setState({
|
|
9973
10375
|
brands: brandsArray.map(function (brand) {
|
|
9974
10376
|
return brand.id;
|
|
9975
10377
|
})
|
|
9976
10378
|
});
|
|
9977
10379
|
});
|
|
9978
|
-
|
|
10380
|
+
|
|
10381
|
+
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
9979
10382
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
9980
10383
|
});
|
|
9981
|
-
|
|
10384
|
+
|
|
10385
|
+
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
9982
10386
|
_this.setState(_objectSpread2({}, priceRange));
|
|
9983
10387
|
});
|
|
9984
|
-
|
|
10388
|
+
|
|
10389
|
+
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
9985
10390
|
_this.setState({
|
|
9986
10391
|
styles: stylesArray.map(function (style) {
|
|
9987
10392
|
return style.id;
|
|
9988
10393
|
})
|
|
9989
10394
|
});
|
|
9990
10395
|
});
|
|
9991
|
-
|
|
10396
|
+
|
|
10397
|
+
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
9992
10398
|
_this.setState({
|
|
9993
10399
|
condition: conditions.map(function (condition) {
|
|
9994
10400
|
return condition.id;
|
|
9995
10401
|
})
|
|
9996
10402
|
});
|
|
9997
10403
|
});
|
|
9998
|
-
|
|
10404
|
+
|
|
10405
|
+
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
9999
10406
|
// price/shoe-size always have initial values as soon as category is set
|
|
10000
10407
|
var category_type = _this.state.category_type;
|
|
10001
10408
|
return category_type !== null;
|
|
10002
10409
|
});
|
|
10003
|
-
|
|
10410
|
+
|
|
10411
|
+
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10004
10412
|
_this.setState({
|
|
10005
10413
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10006
10414
|
fetching: true
|
|
10007
10415
|
})
|
|
10008
10416
|
});
|
|
10417
|
+
|
|
10009
10418
|
var _this$state = _this.state,
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10419
|
+
brands = _this$state.brands,
|
|
10420
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10421
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10422
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10423
|
+
min_price = _this$state.min_price,
|
|
10424
|
+
max_price = _this$state.max_price,
|
|
10425
|
+
styles = _this$state.styles,
|
|
10426
|
+
category_type = _this$state.category_type,
|
|
10427
|
+
requestState = _this$state.request,
|
|
10428
|
+
gender = _this$state.gender,
|
|
10429
|
+
condition = _this$state.condition;
|
|
10021
10430
|
var payloadGender = gender[0];
|
|
10431
|
+
|
|
10022
10432
|
if (gender.length > 1 || !gender.length) {
|
|
10023
10433
|
payloadGender = UNISEX;
|
|
10024
10434
|
}
|
|
10435
|
+
|
|
10025
10436
|
var basePayload = {
|
|
10026
10437
|
category_type: category_type,
|
|
10027
10438
|
brands: brands,
|
|
@@ -10037,21 +10448,27 @@
|
|
|
10037
10448
|
max_shoe_size_id: max_shoe_size_id,
|
|
10038
10449
|
shoe_size_type: shoe_size_type
|
|
10039
10450
|
} : {};
|
|
10451
|
+
|
|
10040
10452
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10453
|
+
|
|
10041
10454
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10042
10455
|
_this.setState({
|
|
10043
10456
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10044
10457
|
success: true
|
|
10045
10458
|
})
|
|
10046
10459
|
});
|
|
10460
|
+
|
|
10047
10461
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10048
10462
|
}, _this.handleRequestError);
|
|
10049
10463
|
});
|
|
10050
|
-
|
|
10464
|
+
|
|
10465
|
+
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10051
10466
|
var data = _ref.data;
|
|
10467
|
+
|
|
10052
10468
|
_this.setState({
|
|
10053
10469
|
request: _objectSpread2({}, request)
|
|
10054
10470
|
});
|
|
10471
|
+
|
|
10055
10472
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10056
10473
|
return data[key];
|
|
10057
10474
|
}).flat();
|
|
@@ -10061,32 +10478,37 @@
|
|
|
10061
10478
|
}, message);
|
|
10062
10479
|
}));
|
|
10063
10480
|
});
|
|
10064
|
-
|
|
10481
|
+
|
|
10482
|
+
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10065
10483
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10484
|
+
|
|
10066
10485
|
_this.props.onCancel();
|
|
10067
10486
|
});
|
|
10068
|
-
|
|
10487
|
+
|
|
10488
|
+
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10069
10489
|
return _this.onGenderChanged(isChecked, gender);
|
|
10070
10490
|
});
|
|
10071
|
-
|
|
10491
|
+
|
|
10492
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10072
10493
|
_this.setState(function (prevState) {
|
|
10073
10494
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10074
10495
|
isCategoriesShown: true
|
|
10075
10496
|
});
|
|
10076
10497
|
});
|
|
10077
10498
|
});
|
|
10078
|
-
|
|
10499
|
+
|
|
10500
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10079
10501
|
var _this$state2 = _this.state,
|
|
10080
|
-
|
|
10081
|
-
|
|
10502
|
+
category_type = _this$state2.category_type,
|
|
10503
|
+
fetching = _this$state2.request.fetching;
|
|
10082
10504
|
var _this$props = _this.props,
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10505
|
+
requestInstance = _this$props.requestInstance,
|
|
10506
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10507
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10508
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10509
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10510
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType,
|
|
10511
|
+
getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
|
|
10090
10512
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10091
10513
|
className: "interests__section-wrapper"
|
|
10092
10514
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(CatSelectorParagraph, null, "Select the category that interests you"), /*#__PURE__*/React__default.createElement(CategoryInterestSelector, {
|
|
@@ -10137,19 +10559,23 @@
|
|
|
10137
10559
|
type: "button",
|
|
10138
10560
|
onClick: function onClick() {
|
|
10139
10561
|
_this.submitInterest();
|
|
10562
|
+
|
|
10140
10563
|
_this.resetState();
|
|
10141
10564
|
}
|
|
10142
10565
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10143
10566
|
});
|
|
10567
|
+
|
|
10144
10568
|
_this.state = _objectSpread2({}, defaultState);
|
|
10145
10569
|
return _this;
|
|
10146
10570
|
}
|
|
10147
|
-
|
|
10571
|
+
|
|
10148
10572
|
return _createClass(AddInterest);
|
|
10149
10573
|
}(React__default.Component);
|
|
10574
|
+
|
|
10150
10575
|
var AddInterest$1 = themed(AddInterest);
|
|
10151
10576
|
|
|
10152
|
-
|
|
10577
|
+
/** @format */
|
|
10578
|
+
|
|
10153
10579
|
numeral.register('locale', 'en-ZA', {
|
|
10154
10580
|
delimiters: {
|
|
10155
10581
|
thousands: ',',
|
|
@@ -10170,12 +10596,12 @@
|
|
|
10170
10596
|
});
|
|
10171
10597
|
numeral.locale('en-ZA');
|
|
10172
10598
|
String.locale = numeral.locale;
|
|
10173
|
-
|
|
10174
10599
|
/**
|
|
10175
10600
|
* Curreny Formatter
|
|
10176
10601
|
* @param {number} number - the number to be formatted
|
|
10177
10602
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
10178
10603
|
*/
|
|
10604
|
+
|
|
10179
10605
|
function fC(number) {
|
|
10180
10606
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10181
10607
|
var parsedNumber = parseFloat(number);
|
|
@@ -10213,35 +10639,48 @@
|
|
|
10213
10639
|
|
|
10214
10640
|
var _templateObject$B, _templateObject2$8, _templateObject3$3, _templateObject4$1;
|
|
10215
10641
|
var MALE$2 = genders.MALE,
|
|
10216
|
-
|
|
10217
|
-
|
|
10642
|
+
FEMALE$2 = genders.FEMALE,
|
|
10643
|
+
UNISEX$1 = genders.UNISEX;
|
|
10644
|
+
|
|
10218
10645
|
var TrashIcon = function TrashIcon(_ref) {
|
|
10219
10646
|
var onClick = _ref.onClick,
|
|
10220
|
-
|
|
10647
|
+
id = _ref.id;
|
|
10221
10648
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10222
10649
|
onClick: onClick,
|
|
10223
10650
|
id: id
|
|
10224
10651
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10225
10652
|
};
|
|
10653
|
+
|
|
10226
10654
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
10655
|
+
_inherits(InterestItem, _React$Component);
|
|
10656
|
+
|
|
10657
|
+
var _super = _createSuper(InterestItem);
|
|
10658
|
+
|
|
10227
10659
|
function InterestItem(props) {
|
|
10228
10660
|
var _this;
|
|
10661
|
+
|
|
10229
10662
|
_classCallCheck(this, InterestItem);
|
|
10230
|
-
|
|
10231
|
-
|
|
10663
|
+
|
|
10664
|
+
_this = _super.call(this, props);
|
|
10665
|
+
|
|
10666
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10232
10667
|
var id = _this.props.data.id;
|
|
10668
|
+
|
|
10233
10669
|
_this.setState({
|
|
10234
10670
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10235
10671
|
fetching: true
|
|
10236
10672
|
})
|
|
10237
10673
|
});
|
|
10674
|
+
|
|
10238
10675
|
var url = _this.props.deleteInterestApi(id);
|
|
10676
|
+
|
|
10239
10677
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10240
10678
|
_this.setState({
|
|
10241
10679
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10242
10680
|
success: true
|
|
10243
10681
|
})
|
|
10244
10682
|
});
|
|
10683
|
+
|
|
10245
10684
|
_this.props.onDeleted(_this.props.data);
|
|
10246
10685
|
}, function () {
|
|
10247
10686
|
return _this.setState({
|
|
@@ -10249,25 +10688,32 @@
|
|
|
10249
10688
|
});
|
|
10250
10689
|
});
|
|
10251
10690
|
});
|
|
10252
|
-
|
|
10691
|
+
|
|
10692
|
+
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
10253
10693
|
switch (gender) {
|
|
10254
10694
|
case MALE$2:
|
|
10255
10695
|
return 'Male';
|
|
10696
|
+
|
|
10256
10697
|
case FEMALE$2:
|
|
10257
10698
|
return 'Female';
|
|
10699
|
+
|
|
10258
10700
|
case UNISEX$1:
|
|
10259
10701
|
default:
|
|
10260
10702
|
return 'Unisex';
|
|
10261
10703
|
}
|
|
10262
10704
|
});
|
|
10263
|
-
|
|
10705
|
+
|
|
10706
|
+
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
10264
10707
|
if (category === interestCategories.APPAREL) {
|
|
10265
10708
|
return 'CLOTHING';
|
|
10266
10709
|
}
|
|
10710
|
+
|
|
10267
10711
|
return category;
|
|
10268
10712
|
});
|
|
10269
|
-
|
|
10713
|
+
|
|
10714
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10270
10715
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
10716
|
+
|
|
10271
10717
|
var data = _this.props.data;
|
|
10272
10718
|
var success = _this.state.delete.success;
|
|
10273
10719
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -10317,14 +10763,16 @@
|
|
|
10317
10763
|
}
|
|
10318
10764
|
}));
|
|
10319
10765
|
});
|
|
10766
|
+
|
|
10320
10767
|
_this.state = {
|
|
10321
10768
|
delete: _objectSpread2({}, request)
|
|
10322
10769
|
};
|
|
10323
10770
|
return _this;
|
|
10324
10771
|
}
|
|
10325
|
-
|
|
10772
|
+
|
|
10326
10773
|
return _createClass(InterestItem);
|
|
10327
10774
|
}(React__default.Component);
|
|
10775
|
+
|
|
10328
10776
|
var SheoSizeContentDiv = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
10329
10777
|
var InterestItemTitle = styled__default.div(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
10330
10778
|
var InterestItemContainer = styled__default.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
@@ -10340,11 +10788,11 @@
|
|
|
10340
10788
|
return props.theme.marginPaddings[0];
|
|
10341
10789
|
}, media.xs);
|
|
10342
10790
|
var ThemedInterestItem = themed(InterestItem);
|
|
10343
|
-
|
|
10344
10791
|
/**
|
|
10345
10792
|
* The Interest Item view shows the selected interest configuration,
|
|
10346
10793
|
* and gives user control to delete it.
|
|
10347
10794
|
*/
|
|
10795
|
+
|
|
10348
10796
|
var InterestItem$1 = (function (props) {
|
|
10349
10797
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
10350
10798
|
});
|
|
@@ -10357,6 +10805,7 @@
|
|
|
10357
10805
|
}, function (props) {
|
|
10358
10806
|
return props.theme.marginPaddings[1];
|
|
10359
10807
|
}, media.xs);
|
|
10808
|
+
|
|
10360
10809
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10361
10810
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10362
10811
|
className: "interests__title"
|
|
@@ -10378,6 +10827,7 @@
|
|
|
10378
10827
|
className: "heading-title-empty"
|
|
10379
10828
|
})));
|
|
10380
10829
|
};
|
|
10830
|
+
|
|
10381
10831
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10382
10832
|
|
|
10383
10833
|
var _templateObject$D;
|
|
@@ -10386,6 +10836,7 @@
|
|
|
10386
10836
|
}, function (props) {
|
|
10387
10837
|
return props.theme.marginPaddings[1];
|
|
10388
10838
|
}, media.xs);
|
|
10839
|
+
|
|
10389
10840
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10390
10841
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10391
10842
|
className: "interests__title"
|
|
@@ -10401,6 +10852,7 @@
|
|
|
10401
10852
|
className: "heading-title-empty"
|
|
10402
10853
|
})));
|
|
10403
10854
|
};
|
|
10855
|
+
|
|
10404
10856
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10405
10857
|
|
|
10406
10858
|
var Add = (function (props) {
|
|
@@ -10423,6 +10875,7 @@
|
|
|
10423
10875
|
|
|
10424
10876
|
function getToken() {
|
|
10425
10877
|
var _Cookies$get;
|
|
10878
|
+
|
|
10426
10879
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
10427
10880
|
}
|
|
10428
10881
|
function setToken(value) {
|
|
@@ -10430,29 +10883,35 @@
|
|
|
10430
10883
|
}
|
|
10431
10884
|
|
|
10432
10885
|
/** @format */
|
|
10886
|
+
|
|
10433
10887
|
function getEncodedSearch(currentUrl) {
|
|
10434
10888
|
var splitUrl = currentUrl.split('?');
|
|
10435
10889
|
var baseUrl = splitUrl[0];
|
|
10436
10890
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
10437
10891
|
var nextQueryString = splitUrl[1];
|
|
10892
|
+
|
|
10438
10893
|
if (nextUrlSegments.length > 0) {
|
|
10439
10894
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
10440
10895
|
var nextValue = v;
|
|
10896
|
+
|
|
10441
10897
|
if (v.includes('search=')) {
|
|
10442
10898
|
var temp = v.split('=');
|
|
10443
10899
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
10444
10900
|
}
|
|
10901
|
+
|
|
10445
10902
|
return nextValue;
|
|
10446
10903
|
}).join('&');
|
|
10447
10904
|
}
|
|
10905
|
+
|
|
10448
10906
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
10449
10907
|
}
|
|
10450
|
-
|
|
10451
10908
|
/**
|
|
10452
10909
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
10453
10910
|
* @param {Function} onAuthFailed - callback triggers when auth fails - ie, server error is one of ['token_invalid', 'token_not_provided', 'user_not_found', 'token_expired'] or http status is one of [401, 503, 400]
|
|
10454
10911
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
10455
10912
|
*/
|
|
10913
|
+
|
|
10914
|
+
|
|
10456
10915
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
10457
10916
|
var instance = axios.create({
|
|
10458
10917
|
validateStatus: function validateStatus(status) {
|
|
@@ -10460,56 +10919,60 @@
|
|
|
10460
10919
|
}
|
|
10461
10920
|
});
|
|
10462
10921
|
var token = getToken();
|
|
10922
|
+
|
|
10463
10923
|
if (token !== '') {
|
|
10464
10924
|
instance.defaults.headers.common.Authorization = token;
|
|
10465
10925
|
}
|
|
10466
|
-
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
10467
10926
|
|
|
10468
|
-
// Add a request interceptor
|
|
10927
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'; // Add a request interceptor
|
|
10928
|
+
|
|
10469
10929
|
instance.interceptors.request.use(function (request, error) {
|
|
10470
10930
|
if (error) {
|
|
10471
10931
|
return Promise.reject(error.response);
|
|
10472
10932
|
}
|
|
10933
|
+
|
|
10473
10934
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
10474
10935
|
// do some uri manipulation for ie
|
|
10475
10936
|
// https://stackoverflow.com/questions/18220057
|
|
10476
|
-
|
|
10477
10937
|
// eslint-disable-next-line no-param-reassign
|
|
10478
10938
|
request.url = getEncodedSearch(request.url);
|
|
10479
|
-
}
|
|
10939
|
+
} // eslint-disable-next-line no-param-reassign
|
|
10940
|
+
|
|
10480
10941
|
|
|
10481
|
-
// eslint-disable-next-line no-param-reassign
|
|
10482
10942
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
10943
|
+
|
|
10483
10944
|
if (typeof request.body === 'undefined') {
|
|
10484
10945
|
request.body = {};
|
|
10485
10946
|
}
|
|
10947
|
+
|
|
10486
10948
|
token = getToken();
|
|
10949
|
+
|
|
10487
10950
|
if (token !== '') {
|
|
10488
10951
|
// eslint-disable-next-line no-param-reassign
|
|
10489
10952
|
request.headers.common.Authorization = token;
|
|
10490
10953
|
}
|
|
10954
|
+
|
|
10491
10955
|
return request;
|
|
10492
10956
|
}, function (error) {
|
|
10493
10957
|
return Promise.reject(error.message);
|
|
10494
|
-
});
|
|
10958
|
+
}); // Add a response interceptor
|
|
10495
10959
|
|
|
10496
|
-
// Add a response interceptor
|
|
10497
10960
|
instance.interceptors.response.use(function (response, error) {
|
|
10498
10961
|
if (error) {
|
|
10499
10962
|
return Promise.reject(error.response);
|
|
10500
10963
|
}
|
|
10964
|
+
|
|
10501
10965
|
if (response.headers.authorization) {
|
|
10502
10966
|
setToken(response.headers.authorization);
|
|
10503
10967
|
}
|
|
10968
|
+
|
|
10504
10969
|
return response;
|
|
10505
10970
|
}, function (error) {
|
|
10506
10971
|
if (error.response) {
|
|
10507
10972
|
// network error
|
|
10508
10973
|
if (error.response.data && error.response.data.error && (error.response.data.error === 'token_invalid' || error.response.data.error === 'token_not_provided' || error.response.data.error === 'user_not_found' || error.response.data.error === 'token_expired') || error.response.status === 401 || error.response.status === 503 || error.response.status === 400) {
|
|
10509
10974
|
onAuthFailed();
|
|
10510
|
-
}
|
|
10511
|
-
|
|
10512
|
-
// if (error.response.status === 500) {
|
|
10975
|
+
} // if (error.response.status === 500) {
|
|
10513
10976
|
// // INTERNAL SERVER ERROR
|
|
10514
10977
|
// store.dispatch({
|
|
10515
10978
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -10517,34 +10980,39 @@
|
|
|
10517
10980
|
// return Promise.reject(error.response);
|
|
10518
10981
|
// }
|
|
10519
10982
|
|
|
10983
|
+
|
|
10520
10984
|
if (error.response.status === 403) {
|
|
10521
10985
|
// FORBIDDEN
|
|
10522
10986
|
onForbidden();
|
|
10523
10987
|
}
|
|
10988
|
+
|
|
10524
10989
|
return Promise.reject(error.response);
|
|
10525
10990
|
}
|
|
10991
|
+
|
|
10526
10992
|
return Promise.reject(error);
|
|
10527
10993
|
});
|
|
10528
10994
|
return instance;
|
|
10529
|
-
};
|
|
10995
|
+
}; // NOTE: this to be instanciated with params: onAuthFailed, onForbidden
|
|
10530
10996
|
|
|
10531
10997
|
var _excluded$8 = ["children"];
|
|
10998
|
+
|
|
10532
10999
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
10533
11000
|
var selectedOption = _ref.selectedOption,
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
11001
|
+
onOptionChange = _ref.onOptionChange,
|
|
11002
|
+
options = _ref.options,
|
|
11003
|
+
isSearchable = _ref.isSearchable,
|
|
11004
|
+
placeholder = _ref.placeholder,
|
|
11005
|
+
name = _ref.name,
|
|
11006
|
+
showSearchIcon = _ref.showSearchIcon,
|
|
11007
|
+
isDisabled = _ref.isDisabled;
|
|
10541
11008
|
var customComponents = {
|
|
10542
11009
|
DropdownIndicator: function DropdownIndicator() {
|
|
10543
11010
|
return null;
|
|
10544
11011
|
},
|
|
10545
11012
|
ValueContainer: function ValueContainer(_ref2) {
|
|
10546
11013
|
var children = _ref2.children,
|
|
10547
|
-
|
|
11014
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11015
|
+
|
|
10548
11016
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
10549
11017
|
style: {
|
|
10550
11018
|
position: 'relative'
|
|
@@ -10672,6 +11140,7 @@
|
|
|
10672
11140
|
isDisabled: isDisabled
|
|
10673
11141
|
}));
|
|
10674
11142
|
};
|
|
11143
|
+
|
|
10675
11144
|
DropdownSelector.defaultProps = {
|
|
10676
11145
|
isSearchable: false,
|
|
10677
11146
|
selectedOption: null,
|
|
@@ -10696,144 +11165,178 @@
|
|
|
10696
11165
|
}, function (props) {
|
|
10697
11166
|
return props.theme.marginPaddings[1];
|
|
10698
11167
|
});
|
|
11168
|
+
|
|
10699
11169
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
10700
11170
|
var baseGraphApi = _ref.baseGraphApi,
|
|
10701
|
-
|
|
10702
|
-
|
|
10703
|
-
|
|
10704
|
-
|
|
10705
|
-
|
|
10706
|
-
|
|
10707
|
-
|
|
11171
|
+
getBrandsGraphQuery = _ref.getBrandsGraphQuery,
|
|
11172
|
+
getModelsGraphQuery = _ref.getModelsGraphQuery,
|
|
11173
|
+
getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
|
|
11174
|
+
onCancel = _ref.onCancel,
|
|
11175
|
+
requestInstance = _ref.requestInstance,
|
|
11176
|
+
addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
|
|
11177
|
+
onSubmitSuccess = _ref.onSubmitSuccess;
|
|
11178
|
+
|
|
10708
11179
|
var _useState = React.useState([]),
|
|
10709
|
-
|
|
10710
|
-
|
|
10711
|
-
|
|
11180
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11181
|
+
brands = _useState2[0],
|
|
11182
|
+
setBrands = _useState2[1];
|
|
11183
|
+
|
|
10712
11184
|
var _useState3 = React.useState([]),
|
|
10713
|
-
|
|
10714
|
-
|
|
10715
|
-
|
|
11185
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
11186
|
+
models = _useState4[0],
|
|
11187
|
+
setModels = _useState4[1];
|
|
11188
|
+
|
|
10716
11189
|
var _useState5 = React.useState([]),
|
|
10717
|
-
|
|
10718
|
-
|
|
10719
|
-
|
|
11190
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
11191
|
+
materials = _useState6[0],
|
|
11192
|
+
setMaterials = _useState6[1];
|
|
11193
|
+
|
|
10720
11194
|
var _useState7 = React.useState(null),
|
|
10721
|
-
|
|
10722
|
-
|
|
10723
|
-
|
|
11195
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
11196
|
+
selectedBrand = _useState8[0],
|
|
11197
|
+
setSelectedBrand = _useState8[1];
|
|
11198
|
+
|
|
10724
11199
|
var _useState9 = React.useState(null),
|
|
10725
|
-
|
|
10726
|
-
|
|
10727
|
-
|
|
11200
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11201
|
+
selectedModel = _useState10[0],
|
|
11202
|
+
setSelectedModel = _useState10[1];
|
|
11203
|
+
|
|
10728
11204
|
var _useState11 = React.useState(null),
|
|
10729
|
-
|
|
10730
|
-
|
|
10731
|
-
|
|
10732
|
-
|
|
11205
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
11206
|
+
selectedMaterial = _useState12[0],
|
|
11207
|
+
setSelectedMaterial = _useState12[1];
|
|
11208
|
+
|
|
11209
|
+
var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10733
11210
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11211
|
+
|
|
10734
11212
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10735
|
-
while (1)
|
|
10736
|
-
|
|
10737
|
-
_context.prev = 0;
|
|
10738
|
-
_context.next = 3;
|
|
10739
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
10740
|
-
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10741
|
-
});
|
|
10742
|
-
case 3:
|
|
10743
|
-
response = _context.sent;
|
|
10744
|
-
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$data = _response$data.data) !== null && _response$data$data !== void 0 && (_response$data$data$l = _response$data$data.luxity_brands) !== null && _response$data$data$l !== void 0 && _response$data$data$l.data) {
|
|
10745
|
-
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10746
|
-
return {
|
|
10747
|
-
value: brand.id,
|
|
10748
|
-
label: brand.name
|
|
10749
|
-
};
|
|
10750
|
-
});
|
|
10751
|
-
setBrands(formattedBrands);
|
|
10752
|
-
}
|
|
10753
|
-
_context.next = 10;
|
|
10754
|
-
break;
|
|
10755
|
-
case 7:
|
|
10756
|
-
_context.prev = 7;
|
|
10757
|
-
_context.t0 = _context["catch"](0);
|
|
10758
|
-
error(_context.t0.message);
|
|
10759
|
-
case 10:
|
|
10760
|
-
case "end":
|
|
10761
|
-
return _context.stop();
|
|
10762
|
-
}
|
|
10763
|
-
}, _callee, null, [[0, 7]]);
|
|
10764
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
10765
|
-
var fetchModels = React.useCallback(/*#__PURE__*/function () {
|
|
10766
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
10767
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
10768
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10769
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
11213
|
+
while (1) {
|
|
11214
|
+
switch (_context.prev = _context.next) {
|
|
10770
11215
|
case 0:
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
10774
|
-
query:
|
|
11216
|
+
_context.prev = 0;
|
|
11217
|
+
_context.next = 3;
|
|
11218
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
11219
|
+
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10775
11220
|
});
|
|
11221
|
+
|
|
10776
11222
|
case 3:
|
|
10777
|
-
response =
|
|
10778
|
-
|
|
10779
|
-
|
|
11223
|
+
response = _context.sent;
|
|
11224
|
+
|
|
11225
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$data = _response$data.data) !== null && _response$data$data !== void 0 && (_response$data$data$l = _response$data$data.luxity_brands) !== null && _response$data$data$l !== void 0 && _response$data$data$l.data) {
|
|
11226
|
+
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10780
11227
|
return {
|
|
10781
|
-
value:
|
|
10782
|
-
label:
|
|
11228
|
+
value: brand.id,
|
|
11229
|
+
label: brand.name
|
|
10783
11230
|
};
|
|
10784
11231
|
});
|
|
10785
|
-
|
|
11232
|
+
setBrands(formattedBrands);
|
|
10786
11233
|
}
|
|
10787
|
-
|
|
11234
|
+
|
|
11235
|
+
_context.next = 10;
|
|
10788
11236
|
break;
|
|
11237
|
+
|
|
10789
11238
|
case 7:
|
|
10790
|
-
|
|
10791
|
-
|
|
10792
|
-
error(
|
|
11239
|
+
_context.prev = 7;
|
|
11240
|
+
_context.t0 = _context["catch"](0);
|
|
11241
|
+
error(_context.t0.message);
|
|
11242
|
+
|
|
10793
11243
|
case 10:
|
|
10794
11244
|
case "end":
|
|
10795
|
-
return
|
|
11245
|
+
return _context.stop();
|
|
11246
|
+
}
|
|
11247
|
+
}
|
|
11248
|
+
}, _callee, null, [[0, 7]]);
|
|
11249
|
+
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11250
|
+
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11251
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11252
|
+
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11253
|
+
|
|
11254
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11255
|
+
while (1) {
|
|
11256
|
+
switch (_context2.prev = _context2.next) {
|
|
11257
|
+
case 0:
|
|
11258
|
+
_context2.prev = 0;
|
|
11259
|
+
_context2.next = 3;
|
|
11260
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11261
|
+
query: getModelsGraphQuery(brandId)
|
|
11262
|
+
});
|
|
11263
|
+
|
|
11264
|
+
case 3:
|
|
11265
|
+
response = _context2.sent;
|
|
11266
|
+
|
|
11267
|
+
if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2$data = _response$data2.data) !== null && _response$data2$data !== void 0 && (_response$data2$data$ = _response$data2$data.luxity_models) !== null && _response$data2$data$ !== void 0 && _response$data2$data$.data) {
|
|
11268
|
+
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11269
|
+
return {
|
|
11270
|
+
value: model.id,
|
|
11271
|
+
label: model.name
|
|
11272
|
+
};
|
|
11273
|
+
});
|
|
11274
|
+
setModels(formattedModels);
|
|
11275
|
+
}
|
|
11276
|
+
|
|
11277
|
+
_context2.next = 10;
|
|
11278
|
+
break;
|
|
11279
|
+
|
|
11280
|
+
case 7:
|
|
11281
|
+
_context2.prev = 7;
|
|
11282
|
+
_context2.t0 = _context2["catch"](0);
|
|
11283
|
+
error(_context2.t0.message);
|
|
11284
|
+
|
|
11285
|
+
case 10:
|
|
11286
|
+
case "end":
|
|
11287
|
+
return _context2.stop();
|
|
11288
|
+
}
|
|
10796
11289
|
}
|
|
10797
11290
|
}, _callee2, null, [[0, 7]]);
|
|
10798
11291
|
}));
|
|
11292
|
+
|
|
10799
11293
|
return function (_x) {
|
|
10800
11294
|
return _ref3.apply(this, arguments);
|
|
10801
11295
|
};
|
|
10802
11296
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
10803
|
-
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10804
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11297
|
+
var fetchMaterials = React.useCallback( /*#__PURE__*/function () {
|
|
11298
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
10805
11299
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11300
|
+
|
|
10806
11301
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10807
|
-
while (1)
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
case 3:
|
|
10815
|
-
response = _context3.sent;
|
|
10816
|
-
if (response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && (_response$data3$data = _response$data3.data) !== null && _response$data3$data !== void 0 && (_response$data3$data$ = _response$data3$data.luxity_materials) !== null && _response$data3$data$ !== void 0 && _response$data3$data$.data) {
|
|
10817
|
-
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
10818
|
-
return {
|
|
10819
|
-
value: material.id,
|
|
10820
|
-
label: material.name
|
|
10821
|
-
};
|
|
11302
|
+
while (1) {
|
|
11303
|
+
switch (_context3.prev = _context3.next) {
|
|
11304
|
+
case 0:
|
|
11305
|
+
_context3.prev = 0;
|
|
11306
|
+
_context3.next = 3;
|
|
11307
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
|
|
11308
|
+
query: getMaterialsGraphQuery(brandId)
|
|
10822
11309
|
});
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
11310
|
+
|
|
11311
|
+
case 3:
|
|
11312
|
+
response = _context3.sent;
|
|
11313
|
+
|
|
11314
|
+
if (response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && (_response$data3$data = _response$data3.data) !== null && _response$data3$data !== void 0 && (_response$data3$data$ = _response$data3$data.luxity_materials) !== null && _response$data3$data$ !== void 0 && _response$data3$data$.data) {
|
|
11315
|
+
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
11316
|
+
return {
|
|
11317
|
+
value: material.id,
|
|
11318
|
+
label: material.name
|
|
11319
|
+
};
|
|
11320
|
+
});
|
|
11321
|
+
setMaterials(formattedMaterials);
|
|
11322
|
+
}
|
|
11323
|
+
|
|
11324
|
+
_context3.next = 10;
|
|
11325
|
+
break;
|
|
11326
|
+
|
|
11327
|
+
case 7:
|
|
11328
|
+
_context3.prev = 7;
|
|
11329
|
+
_context3.t0 = _context3["catch"](0);
|
|
11330
|
+
error(_context3.t0.message);
|
|
11331
|
+
|
|
11332
|
+
case 10:
|
|
11333
|
+
case "end":
|
|
11334
|
+
return _context3.stop();
|
|
11335
|
+
}
|
|
10834
11336
|
}
|
|
10835
11337
|
}, _callee3, null, [[0, 7]]);
|
|
10836
11338
|
}));
|
|
11339
|
+
|
|
10837
11340
|
return function (_x2) {
|
|
10838
11341
|
return _ref4.apply(this, arguments);
|
|
10839
11342
|
};
|
|
@@ -10854,15 +11357,19 @@
|
|
|
10854
11357
|
setSelectedMaterial(null);
|
|
10855
11358
|
}
|
|
10856
11359
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11360
|
+
|
|
10857
11361
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
10858
11362
|
setSelectedBrand(selectedOption);
|
|
10859
11363
|
};
|
|
11364
|
+
|
|
10860
11365
|
var onModelChange = function onModelChange(selectedOption) {
|
|
10861
11366
|
setSelectedModel(selectedOption);
|
|
10862
11367
|
};
|
|
11368
|
+
|
|
10863
11369
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
10864
11370
|
setSelectedMaterial(selectedOption);
|
|
10865
11371
|
};
|
|
11372
|
+
|
|
10866
11373
|
var submitInterest = function submitInterest() {
|
|
10867
11374
|
var payload = {
|
|
10868
11375
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -10874,6 +11381,7 @@
|
|
|
10874
11381
|
onCancel();
|
|
10875
11382
|
}, handleRequestError);
|
|
10876
11383
|
};
|
|
11384
|
+
|
|
10877
11385
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
10878
11386
|
var data = _ref5.data;
|
|
10879
11387
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -10885,6 +11393,7 @@
|
|
|
10885
11393
|
}, message);
|
|
10886
11394
|
}));
|
|
10887
11395
|
};
|
|
11396
|
+
|
|
10888
11397
|
var onReset = function onReset() {
|
|
10889
11398
|
onCancel();
|
|
10890
11399
|
setSelectedModel(null);
|
|
@@ -10894,6 +11403,7 @@
|
|
|
10894
11403
|
setMaterials([]);
|
|
10895
11404
|
setModels([]);
|
|
10896
11405
|
};
|
|
11406
|
+
|
|
10897
11407
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10898
11408
|
className: "interests__section-wrapper"
|
|
10899
11409
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer$1, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -10941,36 +11451,50 @@
|
|
|
10941
11451
|
onClick: submitInterest
|
|
10942
11452
|
}, "SAVE"))))))));
|
|
10943
11453
|
};
|
|
11454
|
+
|
|
10944
11455
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
10945
11456
|
|
|
10946
11457
|
var _templateObject$F, _templateObject2$a, _templateObject3$4;
|
|
11458
|
+
|
|
10947
11459
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
10948
11460
|
var onClick = _ref.onClick,
|
|
10949
|
-
|
|
11461
|
+
id = _ref.id;
|
|
10950
11462
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10951
11463
|
onClick: onClick,
|
|
10952
11464
|
id: id
|
|
10953
11465
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10954
11466
|
};
|
|
11467
|
+
|
|
10955
11468
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11469
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11470
|
+
|
|
11471
|
+
var _super = _createSuper(LuxityProductInterestItem);
|
|
11472
|
+
|
|
10956
11473
|
function LuxityProductInterestItem(props) {
|
|
10957
11474
|
var _this;
|
|
11475
|
+
|
|
10958
11476
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
10959
|
-
|
|
10960
|
-
|
|
11477
|
+
|
|
11478
|
+
_this = _super.call(this, props);
|
|
11479
|
+
|
|
11480
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10961
11481
|
var id = _this.props.data.id;
|
|
11482
|
+
|
|
10962
11483
|
_this.setState({
|
|
10963
11484
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10964
11485
|
fetching: true
|
|
10965
11486
|
})
|
|
10966
11487
|
});
|
|
11488
|
+
|
|
10967
11489
|
var url = _this.props.deleteInterestApi(id);
|
|
11490
|
+
|
|
10968
11491
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10969
11492
|
_this.setState({
|
|
10970
11493
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10971
11494
|
success: true
|
|
10972
11495
|
})
|
|
10973
11496
|
});
|
|
11497
|
+
|
|
10974
11498
|
_this.props.onDeleted(_this.props.data);
|
|
10975
11499
|
}, function () {
|
|
10976
11500
|
return _this.setState({
|
|
@@ -10978,8 +11502,10 @@
|
|
|
10978
11502
|
});
|
|
10979
11503
|
});
|
|
10980
11504
|
});
|
|
10981
|
-
|
|
11505
|
+
|
|
11506
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10982
11507
|
var _data$luxity_model, _data$luxity_material;
|
|
11508
|
+
|
|
10983
11509
|
var data = _this.props.data;
|
|
10984
11510
|
var success = _this.state.delete.success;
|
|
10985
11511
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11009,14 +11535,16 @@
|
|
|
11009
11535
|
}
|
|
11010
11536
|
}));
|
|
11011
11537
|
});
|
|
11538
|
+
|
|
11012
11539
|
_this.state = {
|
|
11013
11540
|
delete: _objectSpread2({}, request)
|
|
11014
11541
|
};
|
|
11015
11542
|
return _this;
|
|
11016
11543
|
}
|
|
11017
|
-
|
|
11544
|
+
|
|
11018
11545
|
return _createClass(LuxityProductInterestItem);
|
|
11019
11546
|
}(React__default.Component);
|
|
11547
|
+
|
|
11020
11548
|
var InterestItemTitle$1 = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
11021
11549
|
var InterestItemContainer$1 = styled__default.div(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
11022
11550
|
var InterestItemContent$1 = styled__default.div(_templateObject3$4 || (_templateObject3$4 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n width: 95%;\n height: 100%;\n border: 1px solid ", ";\n padding: 1rem;\n margin-bottom: ", ";\n\n .interest-item__container_heading {\n color: ", ";\n flex-basis: calc(100% / 6);\n margin-top: 0.3rem;\n\n @media (max-width: ", ") {\n display: inline;\n }\n }\n\n .list-items {\n display: inline-flex;\n flex-direction: column;\n\n @media (max-width: ", ") {\n margin-left: ", ";\n }\n }\n\n @media (max-width: ", ") {\n flex-direction: column;\n }\n"])), function (props) {
|
|
@@ -11029,25 +11557,27 @@
|
|
|
11029
11557
|
return props.theme.marginPaddings[0];
|
|
11030
11558
|
}, media.xs);
|
|
11031
11559
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11032
|
-
|
|
11033
11560
|
/**
|
|
11034
11561
|
* The Interest Item view shows the selected interest configuration,
|
|
11035
11562
|
* and gives user control to delete it.
|
|
11036
11563
|
*/
|
|
11564
|
+
|
|
11037
11565
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11038
11566
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11039
11567
|
});
|
|
11040
11568
|
|
|
11041
11569
|
var _templateObject$G, _templateObject2$b;
|
|
11042
11570
|
var AddInterestButtonContainer = styled__default.div(_templateObject$G || (_templateObject$G = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n\n #add-icon {\n margin-bottom: 1.5rem;\n\n svg {\n width: 15px;\n }\n }\n"])));
|
|
11571
|
+
|
|
11043
11572
|
var AddIcon = function AddIcon(_ref) {
|
|
11044
11573
|
var onClick = _ref.onClick,
|
|
11045
|
-
|
|
11574
|
+
id = _ref.id;
|
|
11046
11575
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11047
11576
|
id: id,
|
|
11048
11577
|
onClick: onClick
|
|
11049
11578
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11050
11579
|
};
|
|
11580
|
+
|
|
11051
11581
|
var AccountIcon = themed(function () {
|
|
11052
11582
|
return /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11053
11583
|
});
|
|
@@ -11060,39 +11590,50 @@
|
|
|
11060
11590
|
}, function (props) {
|
|
11061
11591
|
return props.theme.marginPaddings[2];
|
|
11062
11592
|
}));
|
|
11593
|
+
|
|
11063
11594
|
/**
|
|
11064
11595
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11065
11596
|
*/
|
|
11066
11597
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11598
|
+
_inherits(Interests, _React$Component);
|
|
11599
|
+
|
|
11600
|
+
var _super = _createSuper(Interests);
|
|
11601
|
+
|
|
11067
11602
|
function Interests(props) {
|
|
11068
11603
|
var _this;
|
|
11604
|
+
|
|
11069
11605
|
_classCallCheck(this, Interests);
|
|
11070
|
-
|
|
11071
|
-
|
|
11072
|
-
|
|
11073
|
-
_defineProperty(_this, "
|
|
11606
|
+
|
|
11607
|
+
_this = _super.call(this, props);
|
|
11608
|
+
|
|
11609
|
+
_defineProperty(_assertThisInitialized(_this), "categoryInterestType", 'CATEGORY');
|
|
11610
|
+
|
|
11611
|
+
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11612
|
+
|
|
11613
|
+
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
11074
11614
|
var _data$data$data = data.data.data,
|
|
11075
|
-
|
|
11076
|
-
|
|
11615
|
+
interests = _data$data$data.interests.data,
|
|
11616
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11617
|
+
|
|
11077
11618
|
_this.setState({
|
|
11078
11619
|
interests: interests,
|
|
11079
11620
|
luxity_product_interests: luxity_product_interests
|
|
11080
11621
|
});
|
|
11081
11622
|
});
|
|
11082
|
-
|
|
11083
|
-
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11623
|
+
|
|
11624
|
+
_defineProperty(_assertThisInitialized(_this), "onInterestSubmitSuccess", function (interestItem) {
|
|
11084
11625
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11085
11626
|
_this.triggerInterestRequest().then(function (res) {
|
|
11086
11627
|
return _this.setInterests(res);
|
|
11087
|
-
});
|
|
11088
|
-
|
|
11089
|
-
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11628
|
+
}); // UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11090
11629
|
// this.setState(prevState => {
|
|
11091
11630
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11092
11631
|
// return { ...prevState, interests: newInterests };
|
|
11093
11632
|
// });
|
|
11633
|
+
|
|
11094
11634
|
});
|
|
11095
|
-
|
|
11635
|
+
|
|
11636
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11096
11637
|
_this.setState(function (prevState) {
|
|
11097
11638
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11098
11639
|
return item.id !== deletedItem.id;
|
|
@@ -11102,7 +11643,8 @@
|
|
|
11102
11643
|
});
|
|
11103
11644
|
});
|
|
11104
11645
|
});
|
|
11105
|
-
|
|
11646
|
+
|
|
11647
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11106
11648
|
_this.setState(function (prevState) {
|
|
11107
11649
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11108
11650
|
return item.id !== deleteItem.id;
|
|
@@ -11112,25 +11654,29 @@
|
|
|
11112
11654
|
});
|
|
11113
11655
|
});
|
|
11114
11656
|
});
|
|
11115
|
-
|
|
11657
|
+
|
|
11658
|
+
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11116
11659
|
var _this$props = _this.props,
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11660
|
+
requestInstance = _this$props.requestInstance,
|
|
11661
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11662
|
+
interestQuery = _this$props.interestQuery;
|
|
11120
11663
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11121
11664
|
query: interestQuery
|
|
11122
11665
|
});
|
|
11123
11666
|
});
|
|
11124
|
-
|
|
11667
|
+
|
|
11668
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11125
11669
|
_this.setState({
|
|
11126
11670
|
interestType: interestType
|
|
11127
11671
|
});
|
|
11128
11672
|
});
|
|
11129
|
-
|
|
11673
|
+
|
|
11674
|
+
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11130
11675
|
_this.setState({
|
|
11131
11676
|
interestType: null
|
|
11132
11677
|
});
|
|
11133
11678
|
});
|
|
11679
|
+
|
|
11134
11680
|
_this.state = {
|
|
11135
11681
|
interests: [],
|
|
11136
11682
|
luxity_product_interests: [],
|
|
@@ -11138,31 +11684,32 @@
|
|
|
11138
11684
|
};
|
|
11139
11685
|
return _this;
|
|
11140
11686
|
}
|
|
11141
|
-
|
|
11142
|
-
|
|
11687
|
+
|
|
11688
|
+
_createClass(Interests, [{
|
|
11143
11689
|
key: "render",
|
|
11144
11690
|
value: function render() {
|
|
11145
11691
|
var _this2 = this;
|
|
11692
|
+
|
|
11146
11693
|
var _this$state = this.state,
|
|
11147
|
-
|
|
11148
|
-
|
|
11694
|
+
interests = _this$state.interests,
|
|
11695
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11149
11696
|
var _this$props2 = this.props,
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11697
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
11698
|
+
requestInstance = _this$props2.requestInstance,
|
|
11699
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
11700
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
11701
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
11702
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
11703
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
11704
|
+
setSchedule = _this$props2.setSchedule,
|
|
11705
|
+
getSchedule = _this$props2.getSchedule,
|
|
11706
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
11707
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType,
|
|
11708
|
+
getMaterialsGraphQuery = _this$props2.getMaterialsGraphQuery,
|
|
11709
|
+
getModelsGraphQuery = _this$props2.getModelsGraphQuery,
|
|
11710
|
+
addLuxityProductInterestApi = _this$props2.addLuxityProductInterestApi,
|
|
11711
|
+
deleteLuxityProductInterestApi = _this$props2.deleteLuxityProductInterestApi,
|
|
11712
|
+
getConditionsGraphQuery = _this$props2.getConditionsGraphQuery;
|
|
11166
11713
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11167
11714
|
className: "interests"
|
|
11168
11715
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11251,7 +11798,10 @@
|
|
|
11251
11798
|
}))));
|
|
11252
11799
|
}
|
|
11253
11800
|
}]);
|
|
11801
|
+
|
|
11802
|
+
return Interests;
|
|
11254
11803
|
}(React__default.Component);
|
|
11804
|
+
|
|
11255
11805
|
Interests.defaultProps = {
|
|
11256
11806
|
interestsTitle: 'Interests',
|
|
11257
11807
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|