@subiz/widget-v4 4.0.99 → 4.1.1
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/compiled_src/call/call.js +3 -3
- package/compiled_src/chatbox/AgentsAvatar.js +0 -3
- package/compiled_src/chatbox/ButtonAttachments.js +0 -1
- package/compiled_src/chatbox/ChatButton.js +0 -5
- package/compiled_src/chatbox/DropdownSelect.js +4 -5
- package/compiled_src/chatbox/Event.js +0 -2
- package/compiled_src/chatbox/Events.js +1 -9
- package/compiled_src/chatbox/FormAttachment.js +0 -1
- package/compiled_src/chatbox/GenericTemplateAttachments.js +0 -3
- package/compiled_src/chatbox/Header.js +5 -2
- package/compiled_src/chatbox/InfoMessage.js +0 -1
- package/compiled_src/chatbox/MessageInput.js +3 -3
- package/compiled_src/chatbox/Order.js +3 -1
- package/compiled_src/chatbox/OrderAttachments.js +0 -1
- package/compiled_src/chatbox/QuickReplies.js +0 -1
- package/compiled_src/chatbox/Rating.js +3 -1
- package/compiled_src/chatbox/TextMessage.js +0 -2
- package/compiled_src/chatbox/Typing.js +0 -1
- package/compiled_src/chatbox/Widget.js +4 -18
- package/compiled_src/chatbox/main.js +0 -1
- package/compiled_src/chatbox/releaseAnimation.js +0 -1
- package/compiled_src/contact/contact.js +3 -7
- package/compiled_src/lib.js +7 -18
- package/compiled_src/notif/notif.js +3 -3
- package/compiled_src/order/address_picker.js +4 -6
- package/compiled_src/order/index.js +0 -2
- package/compiled_src/order/order.js +4 -7
- package/compiled_src/plugin.js +0 -9
- package/compiled_src/popup/countdown.js +3 -5
- package/compiled_src/popup/popup.js +3 -8
- package/compiled_src/popup/tick.core.commonjs.js +16 -158
- package/compiled_src/popup/tick.view.flip.commonjs.js +0 -25
- package/compiled_src/store/api.js +3 -9
- package/compiled_src/store/api_fake.js +3 -3
- package/compiled_src/store/store.js +5 -48
- package/compiled_src/util/campaign.js +0 -5
- package/compiled_src/util/common.js +0 -27
- package/compiled_src/util/extractor.js +0 -1
- package/compiled_src/util/gate.test.js +0 -1
- package/compiled_src/util/index.js +0 -1
- package/compiled_src/util/op.js +0 -1
- package/compiled_src/util/order.js +0 -4
- package/dist/132.js +26 -89
- package/dist/184d8eee275.132.js +1 -0
- package/dist/184d8eee275.178.js +1 -0
- package/dist/184d8eee275.213.js +1 -0
- package/dist/184d8eee275.335.js +1 -0
- package/dist/184d8eee275.362.js +1 -0
- package/dist/184d8eee275.441.js +1 -0
- package/dist/184d8eee275.605.js +1 -0
- package/dist/184d8eee275.678.js +1 -0
- package/dist/184d8eee275.782.js +1 -0
- package/dist/184d8eee275.app.js +1 -0
- package/dist/184d8eee275.index.html +26 -0
- package/dist/184d8eee275.library.html +26 -0
- package/dist/184d8eee275.library.js +1 -0
- package/dist/184d8eee275.preview.html +759 -0
- package/dist/184d8eee275.preview.js +1 -0
- package/dist/184d8eee275.screenshoot.js +1 -0
- package/dist/213.js +22 -198
- package/dist/335.js +3 -7
- package/dist/605.js +3 -3
- package/dist/HASH +1 -1
- package/dist/assets/img/award1a.1a58e10.png +0 -0
- package/dist/assets/img/award3a.3b74423.png +0 -0
- package/dist/assets/img/award4a.ed6ccd4.png +0 -0
- package/dist/assets/img/award5.39eb7ae.png +0 -0
- package/dist/assets/img/examplte_logo.f86535f.svg +1 -0
- package/dist/assets/img/main-service1.d536cc2.png +0 -0
- package/dist/assets/img/main-service2.9b99549.png +0 -0
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +14 -130
- package/package.json +4 -4
- package/src/chatbox/Header.js +9 -3
- package/src/lib.js +5 -15
package/dist/132.js
CHANGED
|
@@ -22,7 +22,6 @@ var preact_module = __webpack_require__(6400);
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
|
|
26
25
|
class Emoji extends common/* Com */.up {
|
|
27
26
|
render() {
|
|
28
27
|
var emojiCode = this.props.emojiCode;
|
|
@@ -106,13 +105,11 @@ class ChatButton extends common/* Com */.up {
|
|
|
106
105
|
style: 'opacity: ' + opacity + ' !important'
|
|
107
106
|
}, this.renderPreview(), this.renderButton());
|
|
108
107
|
}
|
|
109
|
-
|
|
110
108
|
ClearPreview() {
|
|
111
109
|
this.setState({
|
|
112
110
|
previewEvent: {}
|
|
113
111
|
});
|
|
114
112
|
}
|
|
115
|
-
|
|
116
113
|
ShowGreeting() {
|
|
117
114
|
let greeting = util/* default.get */.Z.get(this.props.plugin, 'chatbox.greeting', {});
|
|
118
115
|
let agentM = this.props.store.matchAgent('*');
|
|
@@ -162,7 +159,6 @@ class ChatButton extends common/* Com */.up {
|
|
|
162
159
|
}));
|
|
163
160
|
}
|
|
164
161
|
}
|
|
165
|
-
|
|
166
162
|
return this.onPreviewClick();
|
|
167
163
|
}
|
|
168
164
|
onPreviewClick(e) {
|
|
@@ -310,7 +306,6 @@ class ChatButton extends common/* Com */.up {
|
|
|
310
306
|
`;
|
|
311
307
|
}
|
|
312
308
|
let cls = 'chat-button chat-button--' + position;
|
|
313
|
-
|
|
314
309
|
return (0,preact_module.h)("div", {
|
|
315
310
|
class: cls,
|
|
316
311
|
onClick: e => this.onClick(e)
|
|
@@ -344,7 +339,6 @@ class ChatButton extends common/* Com */.up {
|
|
|
344
339
|
defmsg = defmsg || 'Sent you a message';
|
|
345
340
|
let message = util/* default.get */.Z.get(ev, 'data.message.text');
|
|
346
341
|
var format = util/* default.get */.Z.get(ev, 'data.message.format');
|
|
347
|
-
|
|
348
342
|
if (format && format !== 'plaintext') message = defmsg;
|
|
349
343
|
if (!message && util/* default.size */.Z.size(util/* default.get */.Z.get(ev, 'data.message.attachments')) > 0) message = defmsg;
|
|
350
344
|
if (!message) return null;
|
|
@@ -409,7 +403,6 @@ class PoweredBy extends common/* Com */.up {
|
|
|
409
403
|
|
|
410
404
|
|
|
411
405
|
|
|
412
|
-
|
|
413
406
|
class AgentsAvatar extends common/* Com */.up {
|
|
414
407
|
constructor(props) {
|
|
415
408
|
super(props);
|
|
@@ -461,7 +454,6 @@ class AgentsAvatar extends common/* Com */.up {
|
|
|
461
454
|
src: this.props.store.replaceFileUrl(acc.logo_url) || __webpack_require__(9895)
|
|
462
455
|
})));
|
|
463
456
|
}
|
|
464
|
-
|
|
465
457
|
if (agents.length === 1) {
|
|
466
458
|
var agent = agents[0];
|
|
467
459
|
var groupClass = mode === 'primary' ? 'group-avatar--agent-middle' : 'group-avatar--agent-left';
|
|
@@ -479,7 +471,6 @@ class AgentsAvatar extends common/* Com */.up {
|
|
|
479
471
|
src: this.props.store.replaceFileUrl(agent.avatar_url) || __webpack_require__(4761)
|
|
480
472
|
})));
|
|
481
473
|
}
|
|
482
|
-
|
|
483
474
|
if (agents.length === 2) {
|
|
484
475
|
let leftAgent = agents[0];
|
|
485
476
|
let rightAgent = agents[1];
|
|
@@ -507,7 +498,6 @@ class AgentsAvatar extends common/* Com */.up {
|
|
|
507
498
|
src: this.props.store.replaceFileUrl(rightAgent.avatar_url) || __webpack_require__(4761)
|
|
508
499
|
})));
|
|
509
500
|
}
|
|
510
|
-
|
|
511
501
|
let leftAgent = agents[0];
|
|
512
502
|
let middleAgent = agents[1];
|
|
513
503
|
let rightAgent = agents[2];
|
|
@@ -562,7 +552,6 @@ class Header extends common/* Com */.up {
|
|
|
562
552
|
let renderSocial = false;
|
|
563
553
|
let renderTeam = false;
|
|
564
554
|
let renderCollapsed = this.props.view !== 'list' && headerMode === 'collapsed';
|
|
565
|
-
|
|
566
555
|
let accSetting = this.props.plugin.chatbox || {};
|
|
567
556
|
let layout = util/* default.get */.Z.get(accSetting, 'header.layout');
|
|
568
557
|
if (renderCollapsed) {
|
|
@@ -753,7 +742,9 @@ Vui lòng hỏi chúng tôi bất cứ điều gì hoặc chia sẻ phản hồi
|
|
|
753
742
|
}
|
|
754
743
|
let getJoinedNameMember = agents => util/* default.map */.Z.map(agents, agent => agent.name).join(', ');
|
|
755
744
|
;// CONCATENATED MODULE: ./src/chatbox/MessageInput.js
|
|
756
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
745
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
746
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
747
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
757
748
|
|
|
758
749
|
|
|
759
750
|
|
|
@@ -841,7 +832,6 @@ class MessageInput extends common/* Com */.up {
|
|
|
841
832
|
let attachments = util/* default.get */.Z.get(events[0], 'data.message.attachments', []);
|
|
842
833
|
let lock = util/* default.find */.Z.find(attachments, att => util/* default.get */.Z.get(att, 'lock_input'));
|
|
843
834
|
if (lock) return true;
|
|
844
|
-
|
|
845
835
|
var last_agent_sent;
|
|
846
836
|
for (let ev of events) {
|
|
847
837
|
if (util/* default.get */.Z.get(ev, 'by.type') === 'user') continue;
|
|
@@ -1031,7 +1021,6 @@ class MessageInput extends common/* Com */.up {
|
|
|
1031
1021
|
attachments
|
|
1032
1022
|
});
|
|
1033
1023
|
}
|
|
1034
|
-
|
|
1035
1024
|
async submitMessage(msg) {
|
|
1036
1025
|
msg = msg || util/* default.trim */.Z.trim(this.refMessageInput.current.value) || '';
|
|
1037
1026
|
if (!msg) return;
|
|
@@ -1248,7 +1237,6 @@ class ButtonAttachments extends common/* Com */.up {
|
|
|
1248
1237
|
render() {
|
|
1249
1238
|
let byType = util/* default.get */.Z.get(this.props.ev, 'by.type');
|
|
1250
1239
|
if (byType === 'user') return null;
|
|
1251
|
-
|
|
1252
1240
|
let buttons = [];
|
|
1253
1241
|
let attachments = util/* default.get */.Z.get(this.props.ev, 'data.message.attachments', []);
|
|
1254
1242
|
util/* default.each */.Z.each(attachments, (att, i) => {
|
|
@@ -1266,7 +1254,6 @@ class ButtonAttachments extends common/* Com */.up {
|
|
|
1266
1254
|
|
|
1267
1255
|
|
|
1268
1256
|
|
|
1269
|
-
|
|
1270
1257
|
class QuickReplies extends common/* Com */.up {
|
|
1271
1258
|
constructor(props) {
|
|
1272
1259
|
super(props);
|
|
@@ -1285,7 +1272,6 @@ class QuickReplies extends common/* Com */.up {
|
|
|
1285
1272
|
let cid = util/* default.convoOfEv */.Z.convoOfEv(this.props.ev);
|
|
1286
1273
|
let convo = this.props.store.matchConvo(cid);
|
|
1287
1274
|
if (util/* default.get */.Z.get(convo, 'state') === 'ended') return null;
|
|
1288
|
-
|
|
1289
1275
|
let events = util/* default.map */.Z.map(this.props.store.listEvents(cid));
|
|
1290
1276
|
events = util/* default.orderBy */.Z.orderBy(events, 'created', 'asc').filter(ev => ev.type === 'message_sent');
|
|
1291
1277
|
let evindex = 0;
|
|
@@ -1311,7 +1297,6 @@ class QuickReplies extends common/* Com */.up {
|
|
|
1311
1297
|
|
|
1312
1298
|
|
|
1313
1299
|
|
|
1314
|
-
|
|
1315
1300
|
class ListField extends common/* Com */.up {
|
|
1316
1301
|
constructor(props) {
|
|
1317
1302
|
super(props);
|
|
@@ -1408,7 +1393,6 @@ class ListField extends common/* Com */.up {
|
|
|
1408
1393
|
|
|
1409
1394
|
|
|
1410
1395
|
|
|
1411
|
-
|
|
1412
1396
|
class FormAttachment extends common/* Com */.up {
|
|
1413
1397
|
constructor(props) {
|
|
1414
1398
|
super(props);
|
|
@@ -1460,7 +1444,6 @@ class FormAttachment extends common/* Com */.up {
|
|
|
1460
1444
|
focus() {
|
|
1461
1445
|
if (this.props.store.isPreview) return;
|
|
1462
1446
|
if (util/* default.size */.Z.size(this.state.formData) === 0) return;
|
|
1463
|
-
|
|
1464
1447
|
let $field;
|
|
1465
1448
|
if (this.isFormFilled()) {
|
|
1466
1449
|
var keys = Object.keys(this.state.formData);
|
|
@@ -1697,7 +1680,6 @@ function encode(key) {
|
|
|
1697
1680
|
|
|
1698
1681
|
|
|
1699
1682
|
|
|
1700
|
-
|
|
1701
1683
|
class FormAttachments extends common/* Com */.up {
|
|
1702
1684
|
constructor(props) {
|
|
1703
1685
|
super(props);
|
|
@@ -1811,7 +1793,6 @@ class GenericTemplateAttachments extends common/* Com */.up {
|
|
|
1811
1793
|
this.state = {
|
|
1812
1794
|
focusing: 0
|
|
1813
1795
|
};
|
|
1814
|
-
|
|
1815
1796
|
this.galleryRef = (0,preact_module/* createRef */.Vf)();
|
|
1816
1797
|
}
|
|
1817
1798
|
componentDidMount() {
|
|
@@ -1826,11 +1807,9 @@ class GenericTemplateAttachments extends common/* Com */.up {
|
|
|
1826
1807
|
behavior: 'smooth'
|
|
1827
1808
|
});
|
|
1828
1809
|
}
|
|
1829
|
-
|
|
1830
1810
|
render() {
|
|
1831
1811
|
let byType = util/* default.get */.Z.get(this.props.ev, 'by.type');
|
|
1832
1812
|
if (byType === 'user') return null;
|
|
1833
|
-
|
|
1834
1813
|
let attachments = util/* default.get */.Z.get(this.props.ev, 'data.message.attachments', []);
|
|
1835
1814
|
let generics = util/* default.filter */.Z.filter(attachments, att => util/* default.get */.Z.get(att, 'type') === 'generic');
|
|
1836
1815
|
if (generics.length === 0) return null;
|
|
@@ -1985,7 +1964,6 @@ class OrderAttachments_ProductAttachments extends common/* Com */.up {
|
|
|
1985
1964
|
render() {
|
|
1986
1965
|
let byType = util/* default.get */.Z.get(this.props.ev, 'by.type');
|
|
1987
1966
|
if (byType === 'user') return null;
|
|
1988
|
-
|
|
1989
1967
|
let acc = this.props.store.matchAccount();
|
|
1990
1968
|
var attachments = util/* default.get */.Z.get(this.props.ev, 'data.message.attachments', []);
|
|
1991
1969
|
let orders = util/* default.filter */.Z.filter(attachments, att => att.type === 'order' && att.order).map(att => att.order);
|
|
@@ -2415,10 +2393,8 @@ function trimQuillDelta(delta) {
|
|
|
2415
2393
|
ops: newops
|
|
2416
2394
|
};
|
|
2417
2395
|
}
|
|
2418
|
-
|
|
2419
2396
|
return delta;
|
|
2420
2397
|
}
|
|
2421
|
-
|
|
2422
2398
|
let newops = delta.ops.slice();
|
|
2423
2399
|
newops.pop();
|
|
2424
2400
|
return trimQuillDelta({
|
|
@@ -2435,7 +2411,6 @@ var g_pub = new util/* default.Pubsub */.Z.Pubsub();
|
|
|
2435
2411
|
setInterval(() => g_pub.publish('time'), 20 * 1000);
|
|
2436
2412
|
|
|
2437
2413
|
|
|
2438
|
-
|
|
2439
2414
|
class Time extends common/* Com */.up {
|
|
2440
2415
|
constructor(props) {
|
|
2441
2416
|
super(props);
|
|
@@ -2570,7 +2545,6 @@ class InfoMessage extends common/* Com */.up {
|
|
|
2570
2545
|
time: ev.created
|
|
2571
2546
|
}));
|
|
2572
2547
|
}
|
|
2573
|
-
|
|
2574
2548
|
if (ev.type === 'conversation_rated') {
|
|
2575
2549
|
var rating = util/* default.get */.Z.get(ev, 'data.conversation.ratings.0', {
|
|
2576
2550
|
no_rating: true,
|
|
@@ -2611,8 +2585,6 @@ class InfoMessage extends common/* Com */.up {
|
|
|
2611
2585
|
|
|
2612
2586
|
|
|
2613
2587
|
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
2588
|
class Event extends common/* Com */.up {
|
|
2617
2589
|
constructor(props) {
|
|
2618
2590
|
super(props);
|
|
@@ -2778,7 +2750,6 @@ class Event extends common/* Com */.up {
|
|
|
2778
2750
|
refresh: this.state.refresh
|
|
2779
2751
|
}), 1000);
|
|
2780
2752
|
}
|
|
2781
|
-
|
|
2782
2753
|
let $dot = (0,preact_module.h)("div", {
|
|
2783
2754
|
class: "sending_dot"
|
|
2784
2755
|
});
|
|
@@ -2874,7 +2845,6 @@ class Event extends common/* Com */.up {
|
|
|
2874
2845
|
const loadingimg = __webpack_require__(6484);
|
|
2875
2846
|
|
|
2876
2847
|
|
|
2877
|
-
|
|
2878
2848
|
class Spinner extends common/* Com */.up {
|
|
2879
2849
|
render() {
|
|
2880
2850
|
let mode = (this.props.mode + '').toLowerCase();
|
|
@@ -2920,7 +2890,6 @@ const convoemptyimg = __webpack_require__(6188);
|
|
|
2920
2890
|
|
|
2921
2891
|
|
|
2922
2892
|
|
|
2923
|
-
|
|
2924
2893
|
class Events extends common/* Com */.up {
|
|
2925
2894
|
constructor(props) {
|
|
2926
2895
|
super(props);
|
|
@@ -3038,9 +3007,7 @@ class Events extends common/* Com */.up {
|
|
|
3038
3007
|
if (convo.state === 'ended') return false;
|
|
3039
3008
|
return true;
|
|
3040
3009
|
});
|
|
3041
|
-
|
|
3042
3010
|
}
|
|
3043
|
-
|
|
3044
3011
|
onEvent(newev) {
|
|
3045
3012
|
if (util/* default.convoOfEv */.Z.convoOfEv(newev) !== this.props.cid) return;
|
|
3046
3013
|
let isBottom = this.isBottom();
|
|
@@ -3104,11 +3071,9 @@ class Events extends common/* Com */.up {
|
|
|
3104
3071
|
}
|
|
3105
3072
|
}
|
|
3106
3073
|
}
|
|
3107
|
-
|
|
3108
3074
|
function processEvents(convo, events) {
|
|
3109
3075
|
events = events.filter(event => visibleEvent(event.ev));
|
|
3110
3076
|
if (events.length < 1) return;
|
|
3111
|
-
|
|
3112
3077
|
for (var i = 1; i < events.length; i++) {
|
|
3113
3078
|
let curEvent = events[i];
|
|
3114
3079
|
let lastEvent = events[i - 1];
|
|
@@ -3117,7 +3082,6 @@ function processEvents(convo, events) {
|
|
|
3117
3082
|
if (elapsedSec > 120) curEvent.show_time = true;
|
|
3118
3083
|
}
|
|
3119
3084
|
}
|
|
3120
|
-
|
|
3121
3085
|
for (var i = 0; i < events.length; i++) {
|
|
3122
3086
|
let curEvent = events[i];
|
|
3123
3087
|
if (util/* default.get */.Z.get(curEvent, 'ev.type') === 'message_sent') {
|
|
@@ -3125,7 +3089,6 @@ function processEvents(convo, events) {
|
|
|
3125
3089
|
break;
|
|
3126
3090
|
}
|
|
3127
3091
|
}
|
|
3128
|
-
|
|
3129
3092
|
for (var i = 0; i < events.length; i++) {
|
|
3130
3093
|
let curEvent = events[i];
|
|
3131
3094
|
let prevEvent = events[i - 1];
|
|
@@ -3140,9 +3103,7 @@ function processEvents(convo, events) {
|
|
|
3140
3103
|
}
|
|
3141
3104
|
function visibleEvent(ev) {
|
|
3142
3105
|
let type = util/* default.get */.Z.get(ev, 'type');
|
|
3143
|
-
return
|
|
3144
|
-
type === 'message_sent' || type === 'conversation_state_updated'
|
|
3145
|
-
);
|
|
3106
|
+
return type === 'message_sent' || type === 'conversation_state_updated';
|
|
3146
3107
|
}
|
|
3147
3108
|
function Events_isSummited(form) {
|
|
3148
3109
|
let fields = util/* default.get */.Z.get(form, 'fields') || [];
|
|
@@ -3175,7 +3136,6 @@ class Typing extends common/* Com */.up {
|
|
|
3175
3136
|
});
|
|
3176
3137
|
return;
|
|
3177
3138
|
}
|
|
3178
|
-
|
|
3179
3139
|
let ag = this.props.store.matchAgent(ev.by.id) || {};
|
|
3180
3140
|
if (ag.type == 'agent') return;
|
|
3181
3141
|
if (util/* default.get */.Z.get(ev, 'type') !== 'conversation_typing') return;
|
|
@@ -3228,7 +3188,6 @@ class Typing extends common/* Com */.up {
|
|
|
3228
3188
|
run(t0);
|
|
3229
3189
|
});
|
|
3230
3190
|
}
|
|
3231
|
-
|
|
3232
3191
|
calcY(v, y0, t) {
|
|
3233
3192
|
var towardY;
|
|
3234
3193
|
if (y0 > this.maxY) towardY = this.maxY;else if (y0 < this.minY) towardY = this.minY;else if (Math.abs(v) < this.breakingV) {
|
|
@@ -3259,7 +3218,9 @@ function eqFloat(a, b) {
|
|
|
3259
3218
|
return Math.abs(a - b) <= 0.001;
|
|
3260
3219
|
}
|
|
3261
3220
|
;// CONCATENATED MODULE: ./src/chatbox/Rating.js
|
|
3262
|
-
function Rating_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3221
|
+
function Rating_defineProperty(obj, key, value) { key = Rating_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3222
|
+
function Rating_toPropertyKey(arg) { var key = Rating_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3223
|
+
function Rating_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3263
3224
|
|
|
3264
3225
|
|
|
3265
3226
|
const POPUP_MAX_HEIGHT = 400;
|
|
@@ -3522,8 +3483,9 @@ class Rating extends common/* Com */.up {
|
|
|
3522
3483
|
}
|
|
3523
3484
|
}
|
|
3524
3485
|
;// CONCATENATED MODULE: ./src/chatbox/DropdownSelect.js
|
|
3525
|
-
function DropdownSelect_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3526
|
-
|
|
3486
|
+
function DropdownSelect_defineProperty(obj, key, value) { key = DropdownSelect_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3487
|
+
function DropdownSelect_toPropertyKey(arg) { var key = DropdownSelect_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3488
|
+
function DropdownSelect_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3527
3489
|
|
|
3528
3490
|
|
|
3529
3491
|
|
|
@@ -3595,11 +3557,8 @@ class DropdownSelect extends common/* Com */.up {
|
|
|
3595
3557
|
console.log('EEEEEEE', e);
|
|
3596
3558
|
alert('y');
|
|
3597
3559
|
});
|
|
3598
|
-
document.addEventListener('touchmove', function (e) {
|
|
3599
|
-
}
|
|
3600
|
-
);
|
|
3560
|
+
document.addEventListener('touchmove', function (e) {});
|
|
3601
3561
|
}
|
|
3602
|
-
|
|
3603
3562
|
componentDidMount() {
|
|
3604
3563
|
window.addEventListener('keydown', this.onKeydown);
|
|
3605
3564
|
}
|
|
@@ -3723,8 +3682,9 @@ class DropdownSelect extends common/* Com */.up {
|
|
|
3723
3682
|
}
|
|
3724
3683
|
}
|
|
3725
3684
|
;// CONCATENATED MODULE: ./src/order/address_picker.js
|
|
3726
|
-
function address_picker_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3727
|
-
|
|
3685
|
+
function address_picker_defineProperty(obj, key, value) { key = address_picker_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3686
|
+
function address_picker_toPropertyKey(arg) { var key = address_picker_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3687
|
+
function address_picker_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3728
3688
|
|
|
3729
3689
|
|
|
3730
3690
|
|
|
@@ -3766,7 +3726,6 @@ class AddressPicker extends common/* Com */.up {
|
|
|
3766
3726
|
let requestId = Date.now();
|
|
3767
3727
|
this.requestId = requestId;
|
|
3768
3728
|
let res = await this.props.store.suggest_addresses(this.state.searchValue);
|
|
3769
|
-
|
|
3770
3729
|
if (this.requestId !== requestId) return;
|
|
3771
3730
|
this.setState({
|
|
3772
3731
|
addresses: util/* default.get */.Z.get(res, 'body.addresses', [])
|
|
@@ -3793,11 +3752,8 @@ class AddressPicker extends common/* Com */.up {
|
|
|
3793
3752
|
address_picker_defineProperty(this, "onBackgroundScroll", e => {
|
|
3794
3753
|
console.log('EEEEEEE', e);
|
|
3795
3754
|
});
|
|
3796
|
-
document.addEventListener('touchmove', function (e) {
|
|
3797
|
-
}
|
|
3798
|
-
);
|
|
3755
|
+
document.addEventListener('touchmove', function (e) {});
|
|
3799
3756
|
}
|
|
3800
|
-
|
|
3801
3757
|
componentDidMount() {
|
|
3802
3758
|
window.addEventListener('keydown', this.onKeydown);
|
|
3803
3759
|
}
|
|
@@ -3969,7 +3925,9 @@ class Icon extends common/* Com */.up {
|
|
|
3969
3925
|
}
|
|
3970
3926
|
}
|
|
3971
3927
|
;// CONCATENATED MODULE: ./src/order/order.js
|
|
3972
|
-
function order_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3928
|
+
function order_defineProperty(obj, key, value) { key = order_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3929
|
+
function order_toPropertyKey(arg) { var key = order_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3930
|
+
function order_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3973
3931
|
|
|
3974
3932
|
|
|
3975
3933
|
|
|
@@ -4166,7 +4124,6 @@ class order_Order extends common/* Com */.up {
|
|
|
4166
4124
|
});
|
|
4167
4125
|
return;
|
|
4168
4126
|
}
|
|
4169
|
-
|
|
4170
4127
|
let user = this.props.store.matchUser();
|
|
4171
4128
|
let ufullname = util/* default.getUserAttr */.Z.getUserAttr(user, 'fullname', 'text');
|
|
4172
4129
|
let uemail = util/* default.getUserAttr */.Z.getUserAttr(user, 'emails', 'text');
|
|
@@ -4231,7 +4188,6 @@ class order_Order extends common/* Com */.up {
|
|
|
4231
4188
|
text: this.state.phone
|
|
4232
4189
|
});
|
|
4233
4190
|
}
|
|
4234
|
-
|
|
4235
4191
|
if (changeduser) this.props.store.setUser(user);
|
|
4236
4192
|
this.setState({
|
|
4237
4193
|
sending: true
|
|
@@ -4606,7 +4562,6 @@ class order_Order extends common/* Com */.up {
|
|
|
4606
4562
|
value: this.state.email
|
|
4607
4563
|
})));
|
|
4608
4564
|
}
|
|
4609
|
-
|
|
4610
4565
|
let seccls = 'card_section';
|
|
4611
4566
|
if (this.isMobile()) seccls = 'order_section';
|
|
4612
4567
|
return (0,preact_module.h)(preact_module/* Fragment */.HY, null, (0,preact_module.h)("div", {
|
|
@@ -4722,9 +4677,7 @@ class order_Order extends common/* Com */.up {
|
|
|
4722
4677
|
}, status);
|
|
4723
4678
|
}
|
|
4724
4679
|
renderShippingInfo(order) {
|
|
4725
|
-
if (order.status != 'open' || order.user_confirmation) {
|
|
4726
|
-
}
|
|
4727
|
-
|
|
4680
|
+
if (order.status != 'open' || order.user_confirmation) {}
|
|
4728
4681
|
let shipping_provider = util/* default.get */.Z.get(order, 'shipping.shipping_provider');
|
|
4729
4682
|
if (!shipping_provider) return null;
|
|
4730
4683
|
let shipping_code = util/* default.get */.Z.get(order, 'shipping.shipping_code');
|
|
@@ -5042,7 +4995,9 @@ let ShippingProvider = {
|
|
|
5042
4995
|
}
|
|
5043
4996
|
};
|
|
5044
4997
|
;// CONCATENATED MODULE: ./src/chatbox/Order.js
|
|
5045
|
-
function Order_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4998
|
+
function Order_defineProperty(obj, key, value) { key = Order_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4999
|
+
function Order_toPropertyKey(arg) { var key = Order_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5000
|
+
function Order_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5046
5001
|
|
|
5047
5002
|
|
|
5048
5003
|
|
|
@@ -5285,7 +5240,9 @@ class Order extends common/* Com */.up {
|
|
|
5285
5240
|
}
|
|
5286
5241
|
}
|
|
5287
5242
|
;// CONCATENATED MODULE: ./src/chatbox/Widget.js
|
|
5288
|
-
function Widget_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5243
|
+
function Widget_defineProperty(obj, key, value) { key = Widget_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5244
|
+
function Widget_toPropertyKey(arg) { var key = Widget_toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5245
|
+
function Widget_toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5289
5246
|
|
|
5290
5247
|
|
|
5291
5248
|
|
|
@@ -5305,7 +5262,6 @@ const Widget_defaultAvatar = 'https://file-subiz.com/fiqoahedjbgwclpouoml-avatar
|
|
|
5305
5262
|
|
|
5306
5263
|
|
|
5307
5264
|
|
|
5308
|
-
|
|
5309
5265
|
class Widget extends common/* Com */.up {
|
|
5310
5266
|
constructor(props) {
|
|
5311
5267
|
super(props);
|
|
@@ -5328,9 +5284,7 @@ class Widget extends common/* Com */.up {
|
|
|
5328
5284
|
message: text,
|
|
5329
5285
|
initial_by: this.props.store.matchUser().id
|
|
5330
5286
|
});
|
|
5331
|
-
if (error) {
|
|
5332
|
-
}
|
|
5333
|
-
|
|
5287
|
+
if (error) {}
|
|
5334
5288
|
this.creating = false;
|
|
5335
5289
|
this.props.store.sendConvoEvent(convo.id, 'message_sent', {
|
|
5336
5290
|
message
|
|
@@ -5468,7 +5422,6 @@ class Widget extends common/* Com */.up {
|
|
|
5468
5422
|
}
|
|
5469
5423
|
});
|
|
5470
5424
|
if (hasError) return this.forceUpdate();
|
|
5471
|
-
|
|
5472
5425
|
let data = util/* default.cloneDeep */.Z.cloneDeep(this.state.formData);
|
|
5473
5426
|
let user = util/* default.cloneDeep */.Z.cloneDeep(this.props.store.matchUser());
|
|
5474
5427
|
let is_lead = false;
|
|
@@ -5506,15 +5459,12 @@ class Widget extends common/* Com */.up {
|
|
|
5506
5459
|
attachments: this.state.quickReplyMessage.attachments
|
|
5507
5460
|
}
|
|
5508
5461
|
});
|
|
5509
|
-
|
|
5510
5462
|
this.setState({
|
|
5511
5463
|
quickReplyMessage: {}
|
|
5512
5464
|
});
|
|
5513
|
-
|
|
5514
5465
|
if (form.end_conversation_after_submit) await this.props.store.endConvo(this.props.cid);
|
|
5515
5466
|
return;
|
|
5516
5467
|
}
|
|
5517
|
-
|
|
5518
5468
|
this.setState({
|
|
5519
5469
|
creating: true
|
|
5520
5470
|
});
|
|
@@ -5931,7 +5881,6 @@ class Widget extends common/* Com */.up {
|
|
|
5931
5881
|
setTimeout(() => $input && $input.blur());
|
|
5932
5882
|
setTimeout(() => $input && $input.blur(), 300);
|
|
5933
5883
|
}
|
|
5934
|
-
|
|
5935
5884
|
focusInput() {
|
|
5936
5885
|
if (this.props.store.isPreview) return;
|
|
5937
5886
|
if (this.shouldShowForm()) {
|
|
@@ -5953,7 +5902,6 @@ class Widget extends common/* Com */.up {
|
|
|
5953
5902
|
setTimeout(() => $input.focus());
|
|
5954
5903
|
setTimeout(() => $input.focus(), 300);
|
|
5955
5904
|
}
|
|
5956
|
-
|
|
5957
5905
|
onRate(rating) {
|
|
5958
5906
|
if (!this.props.cid) return;
|
|
5959
5907
|
this.props.store.sendConvoEvent(this.props.cid, 'conversation_rated', {
|
|
@@ -6052,21 +6000,17 @@ class Widget extends common/* Com */.up {
|
|
|
6052
6000
|
if (!this.props.store.isMobile()) this.focusInput();
|
|
6053
6001
|
}
|
|
6054
6002
|
isFormRequired() {
|
|
6055
|
-
|
|
6056
6003
|
let form;
|
|
6057
6004
|
let accountSetting = this.props.plugin.chatbox || {};
|
|
6058
6005
|
let acc = this.props.store.matchAccount() || {};
|
|
6059
6006
|
if (util/* default.get */.Z.get(accountSetting, 'prechat_form.enabled')) form = accountSetting.prechat_form;
|
|
6060
|
-
|
|
6061
6007
|
let offlineEnabled = util/* default.get */.Z.get(accountSetting, 'offline_form.enabled');
|
|
6062
6008
|
if (this.isOffline(acc, accountSetting) && offlineEnabled) form = accountSetting.offline_form;
|
|
6063
6009
|
if (!form) return false;
|
|
6064
6010
|
let formData = this.fillForm(form);
|
|
6065
|
-
|
|
6066
6011
|
let convo = this.props.store.matchConvo(this.props.cid) || {};
|
|
6067
6012
|
if (convo.state === 'ended') return true;
|
|
6068
6013
|
if (convo.state && convo.state !== 'pending') delete formData.group;
|
|
6069
|
-
|
|
6070
6014
|
let isAllFiledEmpty = true;
|
|
6071
6015
|
util/* default.each */.Z.each(formData, field => {
|
|
6072
6016
|
if (field.value) isAllFiledEmpty = false;
|
|
@@ -6138,7 +6082,6 @@ class Widget extends common/* Com */.up {
|
|
|
6138
6082
|
let defmsg = this.props.t('sent_you_a_message');
|
|
6139
6083
|
let message = util/* default.get */.Z.get(ev, 'data.message.text');
|
|
6140
6084
|
var format = util/* default.get */.Z.get(ev, 'data.message.format');
|
|
6141
|
-
|
|
6142
6085
|
if (format !== 'plaintext') message = defmsg;
|
|
6143
6086
|
if (!message && util/* default.size */.Z.size(util/* default.get */.Z.get(ev, 'data.message.attachments')) > 0) message = defmsg;
|
|
6144
6087
|
if (!message) return null;
|
|
@@ -6175,7 +6118,6 @@ class Widget extends common/* Com */.up {
|
|
|
6175
6118
|
if (enableWhen === 'out_of_bussiness_hour') isonline = acc.is_in_business_hour;
|
|
6176
6119
|
return !isonline;
|
|
6177
6120
|
}
|
|
6178
|
-
|
|
6179
6121
|
updateFormDataFields() {
|
|
6180
6122
|
let form;
|
|
6181
6123
|
let accountSetting = this.props.plugin.chatbox || {};
|
|
@@ -6195,7 +6137,6 @@ class Widget extends common/* Com */.up {
|
|
|
6195
6137
|
var data = {};
|
|
6196
6138
|
util/* default.each */.Z.each(form.fields, f => {
|
|
6197
6139
|
var newf = Object.assign({}, f);
|
|
6198
|
-
|
|
6199
6140
|
if (f.type === 'list') {
|
|
6200
6141
|
newf.list = f.list;
|
|
6201
6142
|
}
|
|
@@ -6214,7 +6155,6 @@ class Widget extends common/* Com */.up {
|
|
|
6214
6155
|
}))
|
|
6215
6156
|
};
|
|
6216
6157
|
}
|
|
6217
|
-
|
|
6218
6158
|
data['question'] = {
|
|
6219
6159
|
key: 'question',
|
|
6220
6160
|
is_required: true,
|
|
@@ -6286,8 +6226,6 @@ function Widget_encode(key) {
|
|
|
6286
6226
|
|
|
6287
6227
|
|
|
6288
6228
|
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
6229
|
let main_promiseMainCSS = (() => __webpack_require__.e(/* import() */ 178).then(__webpack_require__.bind(__webpack_require__, 178)))();
|
|
6292
6230
|
class Main extends common/* Com */.up {
|
|
6293
6231
|
constructor(props) {
|
|
@@ -6401,7 +6339,6 @@ class Main extends common/* Com */.up {
|
|
|
6401
6339
|
widgetView: p.view
|
|
6402
6340
|
});
|
|
6403
6341
|
this.props.store.setIsOpen(true);
|
|
6404
|
-
|
|
6405
6342
|
this.forceUpdate();
|
|
6406
6343
|
this.setState({
|
|
6407
6344
|
isShowWidget: true
|