@connorpham/live-chat-widget 17.0.0 → 17.0.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/.env.example +8 -8
- package/.eslintrc-staged.json +19 -19
- package/.prettierrc +4 -4
- package/README.md +83 -83
- package/dist/cellcast-bot-widget.es.js +614 -625
- package/dist/cellcast-bot-widget.umd.js +8 -9
- package/dist/index.d.ts +14 -12
- package/dist/style.css +1 -1
- package/package.json +70 -70
- package/tsconfig.build.json +24 -24
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var i0 = Object.defineProperty;
|
|
2
2
|
var o0 = (u, D, f) => D in u ? i0(u, D, { enumerable: !0, configurable: !0, writable: !0, value: f }) : u[D] = f;
|
|
3
3
|
var lD = (u, D, f) => o0(u, typeof D != "symbol" ? D + "" : D, f);
|
|
4
|
-
import af, { createContext as qu, useRef as
|
|
4
|
+
import af, { createContext as qu, useRef as mu, useEffect as X, useContext as Hu, useState as U, useCallback as Mu, useMemo as d0 } from "react";
|
|
5
5
|
var dD = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
6
6
|
function sf(u) {
|
|
7
7
|
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
|
|
@@ -100,29 +100,29 @@ function c0() {
|
|
|
100
100
|
D.NODE_ENV !== "production" && function() {
|
|
101
101
|
var f = af, e = Jf(), t = 60103, n = 60106;
|
|
102
102
|
u.Fragment = 60107;
|
|
103
|
-
var r = 60108, s = 60114, F = 60109, d = 60110, o = 60112, c = 60113, l = 60120, j = 60115, y = 60116, C = 60121,
|
|
103
|
+
var r = 60108, s = 60114, F = 60109, d = 60110, o = 60112, c = 60113, l = 60120, j = 60115, y = 60116, C = 60121, v = 60122, x = 60117, m = 60129, T = 60131;
|
|
104
104
|
if (typeof Symbol == "function" && Symbol.for) {
|
|
105
105
|
var _ = Symbol.for;
|
|
106
|
-
t = _("react.element"), n = _("react.portal"), u.Fragment = _("react.fragment"), r = _("react.strict_mode"), s = _("react.profiler"), F = _("react.provider"), d = _("react.context"), o = _("react.forward_ref"), c = _("react.suspense"), l = _("react.suspense_list"), j = _("react.memo"), y = _("react.lazy"), C = _("react.block"),
|
|
106
|
+
t = _("react.element"), n = _("react.portal"), u.Fragment = _("react.fragment"), r = _("react.strict_mode"), s = _("react.profiler"), F = _("react.provider"), d = _("react.context"), o = _("react.forward_ref"), c = _("react.suspense"), l = _("react.suspense_list"), j = _("react.memo"), y = _("react.lazy"), C = _("react.block"), v = _("react.server.block"), x = _("react.fundamental"), _("react.scope"), _("react.opaque.id"), m = _("react.debug_trace_mode"), _("react.offscreen"), T = _("react.legacy_hidden");
|
|
107
107
|
}
|
|
108
|
-
var
|
|
109
|
-
function
|
|
108
|
+
var B = typeof Symbol == "function" && Symbol.iterator, I = "@@iterator";
|
|
109
|
+
function P(i) {
|
|
110
110
|
if (i === null || typeof i != "object")
|
|
111
111
|
return null;
|
|
112
|
-
var b =
|
|
112
|
+
var b = B && i[B] || i[I];
|
|
113
113
|
return typeof b == "function" ? b : null;
|
|
114
114
|
}
|
|
115
|
-
var
|
|
116
|
-
function
|
|
115
|
+
var q = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
116
|
+
function g(i) {
|
|
117
117
|
{
|
|
118
118
|
for (var b = arguments.length, w = new Array(b > 1 ? b - 1 : 0), L = 1; L < b; L++)
|
|
119
119
|
w[L - 1] = arguments[L];
|
|
120
|
-
|
|
120
|
+
O("error", i, w);
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
|
-
function
|
|
123
|
+
function O(i, b, w) {
|
|
124
124
|
{
|
|
125
|
-
var L =
|
|
125
|
+
var L = q.ReactDebugCurrentFrame, G = L.getStackAddendum();
|
|
126
126
|
G !== "" && (b += "%s", w = w.concat([G]));
|
|
127
127
|
var K = w.map(function(Y) {
|
|
128
128
|
return "" + Y;
|
|
@@ -130,21 +130,21 @@ function c0() {
|
|
|
130
130
|
K.unshift("Warning: " + b), Function.prototype.apply.call(console[i], console, K);
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
var
|
|
133
|
+
var $ = !1;
|
|
134
134
|
function hu(i) {
|
|
135
|
-
return !!(typeof i == "string" || typeof i == "function" || i === u.Fragment || i === s || i ===
|
|
135
|
+
return !!(typeof i == "string" || typeof i == "function" || i === u.Fragment || i === s || i === m || i === r || i === c || i === l || i === T || $ || typeof i == "object" && i !== null && (i.$$typeof === y || i.$$typeof === j || i.$$typeof === F || i.$$typeof === d || i.$$typeof === o || i.$$typeof === x || i.$$typeof === C || i[0] === v));
|
|
136
136
|
}
|
|
137
137
|
function fu(i, b, w) {
|
|
138
138
|
var L = b.displayName || b.name || "";
|
|
139
139
|
return i.displayName || (L !== "" ? w + "(" + L + ")" : w);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function k(i) {
|
|
142
142
|
return i.displayName || "Context";
|
|
143
143
|
}
|
|
144
144
|
function E(i) {
|
|
145
145
|
if (i == null)
|
|
146
146
|
return null;
|
|
147
|
-
if (typeof i.tag == "number" &&
|
|
147
|
+
if (typeof i.tag == "number" && g("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."), typeof i == "function")
|
|
148
148
|
return i.displayName || i.name || null;
|
|
149
149
|
if (typeof i == "string")
|
|
150
150
|
return i;
|
|
@@ -166,10 +166,10 @@ function c0() {
|
|
|
166
166
|
switch (i.$$typeof) {
|
|
167
167
|
case d:
|
|
168
168
|
var b = i;
|
|
169
|
-
return
|
|
169
|
+
return k(b) + ".Consumer";
|
|
170
170
|
case F:
|
|
171
171
|
var w = i;
|
|
172
|
-
return
|
|
172
|
+
return k(w._context) + ".Provider";
|
|
173
173
|
case o:
|
|
174
174
|
return fu(i, i.render, "ForwardRef");
|
|
175
175
|
case j:
|
|
@@ -187,18 +187,18 @@ function c0() {
|
|
|
187
187
|
}
|
|
188
188
|
return null;
|
|
189
189
|
}
|
|
190
|
-
var h = 0,
|
|
191
|
-
function
|
|
190
|
+
var h = 0, A, p, R, N, M, V, J;
|
|
191
|
+
function z() {
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
z.__reactDisabledLog = !0;
|
|
194
194
|
function Z() {
|
|
195
195
|
{
|
|
196
196
|
if (h === 0) {
|
|
197
|
-
|
|
197
|
+
A = console.log, p = console.info, R = console.warn, N = console.error, M = console.group, V = console.groupCollapsed, J = console.groupEnd;
|
|
198
198
|
var i = {
|
|
199
199
|
configurable: !0,
|
|
200
200
|
enumerable: !0,
|
|
201
|
-
value:
|
|
201
|
+
value: z,
|
|
202
202
|
writable: !0
|
|
203
203
|
};
|
|
204
204
|
Object.defineProperties(console, {
|
|
@@ -224,33 +224,33 @@ function c0() {
|
|
|
224
224
|
};
|
|
225
225
|
Object.defineProperties(console, {
|
|
226
226
|
log: e({}, i, {
|
|
227
|
-
value:
|
|
227
|
+
value: A
|
|
228
228
|
}),
|
|
229
229
|
info: e({}, i, {
|
|
230
|
-
value:
|
|
230
|
+
value: p
|
|
231
231
|
}),
|
|
232
232
|
warn: e({}, i, {
|
|
233
|
-
value:
|
|
233
|
+
value: R
|
|
234
234
|
}),
|
|
235
235
|
error: e({}, i, {
|
|
236
|
-
value:
|
|
236
|
+
value: N
|
|
237
237
|
}),
|
|
238
238
|
group: e({}, i, {
|
|
239
239
|
value: M
|
|
240
240
|
}),
|
|
241
241
|
groupCollapsed: e({}, i, {
|
|
242
|
-
value:
|
|
242
|
+
value: V
|
|
243
243
|
}),
|
|
244
244
|
groupEnd: e({}, i, {
|
|
245
245
|
value: J
|
|
246
246
|
})
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
|
-
h < 0 &&
|
|
249
|
+
h < 0 && g("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
var cu =
|
|
253
|
-
function
|
|
252
|
+
var cu = q.ReactCurrentDispatcher, _u;
|
|
253
|
+
function Bu(i, b, w) {
|
|
254
254
|
{
|
|
255
255
|
if (_u === void 0)
|
|
256
256
|
try {
|
|
@@ -336,10 +336,10 @@ function c0() {
|
|
|
336
336
|
} finally {
|
|
337
337
|
ru = !1, cu.current = K, tu(), Error.prepareStackTrace = G;
|
|
338
338
|
}
|
|
339
|
-
var fD = i ? i.displayName || i.name : "", Tf = fD ?
|
|
339
|
+
var fD = i ? i.displayName || i.name : "", Tf = fD ? Bu(fD) : "";
|
|
340
340
|
return typeof i == "function" && du.set(i, Tf), Tf;
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function S(i, b, w) {
|
|
343
343
|
return Iu(i, !1);
|
|
344
344
|
}
|
|
345
345
|
function Du(i) {
|
|
@@ -352,21 +352,21 @@ function c0() {
|
|
|
352
352
|
if (typeof i == "function")
|
|
353
353
|
return Iu(i, Du(i));
|
|
354
354
|
if (typeof i == "string")
|
|
355
|
-
return
|
|
355
|
+
return Bu(i);
|
|
356
356
|
switch (i) {
|
|
357
357
|
case c:
|
|
358
|
-
return
|
|
358
|
+
return Bu("Suspense");
|
|
359
359
|
case l:
|
|
360
|
-
return
|
|
360
|
+
return Bu("SuspenseList");
|
|
361
361
|
}
|
|
362
362
|
if (typeof i == "object")
|
|
363
363
|
switch (i.$$typeof) {
|
|
364
364
|
case o:
|
|
365
|
-
return
|
|
365
|
+
return S(i.render);
|
|
366
366
|
case j:
|
|
367
367
|
return au(i.type, b, w);
|
|
368
368
|
case C:
|
|
369
|
-
return
|
|
369
|
+
return S(i._render);
|
|
370
370
|
case y: {
|
|
371
371
|
var L = i, G = L._payload, K = L._init;
|
|
372
372
|
try {
|
|
@@ -377,13 +377,13 @@ function c0() {
|
|
|
377
377
|
}
|
|
378
378
|
return "";
|
|
379
379
|
}
|
|
380
|
-
var lu = {},
|
|
380
|
+
var lu = {}, gu = q.ReactDebugCurrentFrame;
|
|
381
381
|
function Uu(i) {
|
|
382
382
|
if (i) {
|
|
383
383
|
var b = i._owner, w = au(i.type, i._source, b ? b.type : null);
|
|
384
|
-
|
|
384
|
+
gu.setExtraStackFrame(w);
|
|
385
385
|
} else
|
|
386
|
-
|
|
386
|
+
gu.setExtraStackFrame(null);
|
|
387
387
|
}
|
|
388
388
|
function Y1(i, b, w, L, G) {
|
|
389
389
|
{
|
|
@@ -400,11 +400,11 @@ function c0() {
|
|
|
400
400
|
} catch (nu) {
|
|
401
401
|
H = nu;
|
|
402
402
|
}
|
|
403
|
-
H && !(H instanceof Error) && (Uu(G),
|
|
403
|
+
H && !(H instanceof Error) && (Uu(G), g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", L || "React class", w, Y, typeof H), Uu(null)), H instanceof Error && !(H.message in lu) && (lu[H.message] = !0, Uu(G), g("Failed %s type: %s", w, H.message), Uu(null));
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
}
|
|
407
|
-
var _f =
|
|
407
|
+
var _f = q.ReactCurrentOwner, TD = Object.prototype.hasOwnProperty, K1 = {
|
|
408
408
|
key: !0,
|
|
409
409
|
ref: !0,
|
|
410
410
|
__self: !0,
|
|
@@ -432,7 +432,7 @@ function c0() {
|
|
|
432
432
|
function Z1(i, b) {
|
|
433
433
|
{
|
|
434
434
|
var w = function() {
|
|
435
|
-
yf || (yf = !0,
|
|
435
|
+
yf || (yf = !0, g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b));
|
|
436
436
|
};
|
|
437
437
|
w.isReactWarning = !0, Object.defineProperty(i, "key", {
|
|
438
438
|
get: w,
|
|
@@ -443,7 +443,7 @@ function c0() {
|
|
|
443
443
|
function Q1(i, b) {
|
|
444
444
|
{
|
|
445
445
|
var w = function() {
|
|
446
|
-
vf || (vf = !0,
|
|
446
|
+
vf || (vf = !0, g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", b));
|
|
447
447
|
};
|
|
448
448
|
w.isReactWarning = !0, Object.defineProperty(i, "ref", {
|
|
449
449
|
get: w,
|
|
@@ -498,7 +498,7 @@ function c0() {
|
|
|
498
498
|
return u0(i, H, bu, G, L, _f.current, Y);
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
-
var ND =
|
|
501
|
+
var ND = q.ReactCurrentOwner, wf = q.ReactDebugCurrentFrame;
|
|
502
502
|
function DD(i) {
|
|
503
503
|
if (i) {
|
|
504
504
|
var b = i._owner, w = au(i.type, i._source, b ? b.type : null);
|
|
@@ -549,7 +549,7 @@ Check the top-level render call using <` + w + ">.");
|
|
|
549
549
|
return;
|
|
550
550
|
xf[w] = !0;
|
|
551
551
|
var L = "";
|
|
552
|
-
i && i._owner && i._owner !== ND.current && (L = " It was passed a child from " + E(i._owner.type) + "."), DD(i),
|
|
552
|
+
i && i._owner && i._owner !== ND.current && (L = " It was passed a child from " + E(i._owner.type) + "."), DD(i), g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', w, L), DD(null);
|
|
553
553
|
}
|
|
554
554
|
}
|
|
555
555
|
function jf(i, b) {
|
|
@@ -564,7 +564,7 @@ Check the top-level render call using <` + w + ">.");
|
|
|
564
564
|
else if (RD(i))
|
|
565
565
|
i._store && (i._store.validated = !0);
|
|
566
566
|
else if (i) {
|
|
567
|
-
var G =
|
|
567
|
+
var G = P(i);
|
|
568
568
|
if (typeof G == "function" && G !== i.entries)
|
|
569
569
|
for (var K = G.call(i), Y; !(Y = K.next()).done; )
|
|
570
570
|
RD(Y.value) && kf(Y.value, b);
|
|
@@ -591,9 +591,9 @@ Check the top-level render call using <` + w + ">.");
|
|
|
591
591
|
} else if (b.PropTypes !== void 0 && !OD) {
|
|
592
592
|
OD = !0;
|
|
593
593
|
var G = E(b);
|
|
594
|
-
|
|
594
|
+
g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", G || "Unknown");
|
|
595
595
|
}
|
|
596
|
-
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved &&
|
|
596
|
+
typeof b.getDefaultProps == "function" && !b.getDefaultProps.isReactClassApproved && g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
function n0(i) {
|
|
@@ -601,11 +601,11 @@ Check the top-level render call using <` + w + ">.");
|
|
|
601
601
|
for (var b = Object.keys(i.props), w = 0; w < b.length; w++) {
|
|
602
602
|
var L = b[w];
|
|
603
603
|
if (L !== "children" && L !== "key") {
|
|
604
|
-
DD(i),
|
|
604
|
+
DD(i), g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", L), DD(null);
|
|
605
605
|
break;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
i.ref !== null && (DD(i),
|
|
608
|
+
i.ref !== null && (DD(i), g("Invalid attribute `ref` supplied to `React.Fragment`."), DD(null));
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
function Sf(i, b, w, L, G, K) {
|
|
@@ -617,7 +617,7 @@ Check the top-level render call using <` + w + ">.");
|
|
|
617
617
|
var bu = f0();
|
|
618
618
|
bu ? H += bu : H += Af();
|
|
619
619
|
var nu;
|
|
620
|
-
i === null ? nu = "null" : Array.isArray(i) ? nu = "array" : i !== void 0 && i.$$typeof === t ? (nu = "<" + (E(i.type) || "Unknown") + " />", H = " Did you accidentally export a JSX literal instead of a component?") : nu = typeof i,
|
|
620
|
+
i === null ? nu = "null" : Array.isArray(i) ? nu = "array" : i !== void 0 && i.$$typeof === t ? (nu = "<" + (E(i.type) || "Unknown") + " />", H = " Did you accidentally export a JSX literal instead of a component?") : nu = typeof i, g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", nu, H);
|
|
621
621
|
}
|
|
622
622
|
var su = D0(i, b, w, G, K);
|
|
623
623
|
if (su == null)
|
|
@@ -631,7 +631,7 @@ Check the top-level render call using <` + w + ">.");
|
|
|
631
631
|
jf(Lu[fD], i);
|
|
632
632
|
Object.freeze && Object.freeze(Lu);
|
|
633
633
|
} else
|
|
634
|
-
|
|
634
|
+
g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
635
635
|
else
|
|
636
636
|
jf(Lu, i);
|
|
637
637
|
}
|
|
@@ -656,9 +656,9 @@ const Gf = qu(void 0), Xf = ({
|
|
|
656
656
|
children: u,
|
|
657
657
|
channelName: D
|
|
658
658
|
}) => {
|
|
659
|
-
const f =
|
|
659
|
+
const f = mu(
|
|
660
660
|
new BroadcastChannel(D)
|
|
661
|
-
), e =
|
|
661
|
+
), e = mu({});
|
|
662
662
|
X(() => {
|
|
663
663
|
const r = ({ data: s }) => {
|
|
664
664
|
e.current[s.event].forEach((F) => F(s));
|
|
@@ -708,7 +708,7 @@ const Qf = {
|
|
|
708
708
|
// 20 MB in bytes
|
|
709
709
|
ownerId: aD.REACT_APP_WIDGET_OWNER_ID || "68342cec1e3cef0065f1b563"
|
|
710
710
|
}, u1 = qu(Qf), D1 = ({ children: u, ...D }) => {
|
|
711
|
-
const f =
|
|
711
|
+
const f = mu({
|
|
712
712
|
...Qf,
|
|
713
713
|
...D
|
|
714
714
|
});
|
|
@@ -771,7 +771,7 @@ const Qf = {
|
|
|
771
771
|
), e1 = ({
|
|
772
772
|
children: u
|
|
773
773
|
}) => {
|
|
774
|
-
const f = Wu().language, e = (r) => r in Pf, [t, n] =
|
|
774
|
+
const f = Wu().language, e = (r) => r in Pf, [t, n] = U(
|
|
775
775
|
e(f) ? f : "en"
|
|
776
776
|
);
|
|
777
777
|
return /* @__PURE__ */ a.jsx(
|
|
@@ -3265,7 +3265,7 @@ const Ae = (u, D) => {
|
|
|
3265
3265
|
}, h1 = qu({
|
|
3266
3266
|
socket: {}
|
|
3267
3267
|
}), b1 = (u) => {
|
|
3268
|
-
const D = Wu(), f =
|
|
3268
|
+
const D = Wu(), f = mu(
|
|
3269
3269
|
Ae(D, {
|
|
3270
3270
|
onConnect: () => {
|
|
3271
3271
|
console.info(
|
|
@@ -3321,7 +3321,7 @@ const Ae = (u, D) => {
|
|
|
3321
3321
|
}, p1 = qu(_D), B1 = ({
|
|
3322
3322
|
children: u
|
|
3323
3323
|
}) => {
|
|
3324
|
-
const { t: D } = zu(), f = If.getItem("settings"), [e, t] =
|
|
3324
|
+
const { t: D } = zu(), f = If.getItem("settings"), [e, t] = U(
|
|
3325
3325
|
f || _D
|
|
3326
3326
|
), n = Mu((r) => {
|
|
3327
3327
|
If.setItem("settings", r), t(r);
|
|
@@ -3348,34 +3348,34 @@ const Ae = (u, D) => {
|
|
|
3348
3348
|
offline_mode: r.offline_mode
|
|
3349
3349
|
});
|
|
3350
3350
|
}), /* @__PURE__ */ a.jsx(p1.Provider, { value: e, children: u });
|
|
3351
|
-
},
|
|
3351
|
+
}, pu = () => Hu(p1), g1 = qu(void 0), m1 = ({
|
|
3352
3352
|
onOpen: u,
|
|
3353
3353
|
onClose: D,
|
|
3354
3354
|
onScrollToTop: f,
|
|
3355
3355
|
defaultScreen: e = "prechat",
|
|
3356
3356
|
children: t
|
|
3357
3357
|
}) => {
|
|
3358
|
-
const [n, r] =
|
|
3358
|
+
const [n, r] = U(!0), [s, F] = U(!1), [d, o] = U(e), [c, l] = U(100), x = {
|
|
3359
3359
|
syncState: n,
|
|
3360
3360
|
isOpen: s,
|
|
3361
3361
|
screen: d,
|
|
3362
3362
|
scroll: c,
|
|
3363
|
-
setSyncState: (
|
|
3364
|
-
r(
|
|
3363
|
+
setSyncState: (m) => {
|
|
3364
|
+
r(m);
|
|
3365
3365
|
},
|
|
3366
|
-
setIsOpen: (
|
|
3367
|
-
F(
|
|
3366
|
+
setIsOpen: (m) => {
|
|
3367
|
+
F(m), n && (m ? u && u() : D && D());
|
|
3368
3368
|
},
|
|
3369
|
-
setScreen: (
|
|
3369
|
+
setScreen: (m) => {
|
|
3370
3370
|
o(
|
|
3371
|
-
["prechat", "postchat", "webview"].includes(
|
|
3371
|
+
["prechat", "postchat", "webview"].includes(m) ? m : "chat"
|
|
3372
3372
|
);
|
|
3373
3373
|
},
|
|
3374
|
-
setScroll: (
|
|
3375
|
-
l(
|
|
3374
|
+
setScroll: (m) => {
|
|
3375
|
+
l(m), f && n && m === 0 && f();
|
|
3376
3376
|
}
|
|
3377
3377
|
};
|
|
3378
|
-
return /* @__PURE__ */ a.jsx(g1.Provider, { value:
|
|
3378
|
+
return /* @__PURE__ */ a.jsx(g1.Provider, { value: x, children: t });
|
|
3379
3379
|
}, Nu = () => {
|
|
3380
3380
|
const u = Hu(g1);
|
|
3381
3381
|
if (u === void 0)
|
|
@@ -3449,58 +3449,58 @@ const Ae = (u, D) => {
|
|
|
3449
3449
|
setIsOfflineMode: () => {
|
|
3450
3450
|
}
|
|
3451
3451
|
}, _1 = qu(yu), y1 = ({ wantToConnect: u, defaultConnectionState: D = 0, children: f }) => {
|
|
3452
|
-
const e = Wu(), t =
|
|
3452
|
+
const e = Wu(), t = pu(), { screen: n, setScreen: r } = Nu(), { setScroll: s, syncState: F, isOpen: d } = Nu(), o = Gu(), [c, l] = U(
|
|
3453
3453
|
yu.participants
|
|
3454
|
-
), [j, y] =
|
|
3454
|
+
), [j, y] = U(
|
|
3455
3455
|
D
|
|
3456
|
-
), [C,
|
|
3456
|
+
), [C, v] = U([]), [x, m] = U(
|
|
3457
3457
|
yu.newMessagesCount
|
|
3458
|
-
), [
|
|
3458
|
+
), [T, _] = U(
|
|
3459
3459
|
yu.showTypingIndicator
|
|
3460
|
-
), [
|
|
3460
|
+
), [B, I] = U(
|
|
3461
3461
|
yu.suggestions
|
|
3462
|
-
), [
|
|
3462
|
+
), [P, q] = U(
|
|
3463
3463
|
yu.newIOMessage
|
|
3464
|
-
), [
|
|
3464
|
+
), [g, O] = U(yu.message), [$, hu] = U(yu.outgoingMessageState), [fu, k] = U(yu.payload), [E, h] = U(yu.file), [A, p] = U(yu.webviewUrl), [R, N] = U(
|
|
3465
3465
|
yu.isContactFormActive
|
|
3466
|
-
), [M,
|
|
3466
|
+
), [M, V] = U(
|
|
3467
3467
|
yu.isOfflineMode
|
|
3468
|
-
), { send: J } = Cu(), { t:
|
|
3469
|
-
y(
|
|
3470
|
-
}, tu = t.offline_mode, cu = kD(tu), _u = (
|
|
3471
|
-
if (
|
|
3468
|
+
), { send: J } = Cu(), { t: z } = zu(), Z = (S) => {
|
|
3469
|
+
y(S), S === tD.wantToConnect && u && u(), S === tD.connected && t.alwaysScrollToBottom && s(101);
|
|
3470
|
+
}, tu = t.offline_mode, cu = kD(tu), _u = (S) => {
|
|
3471
|
+
if (q(S), uu.setItem(
|
|
3472
3472
|
"isOffline",
|
|
3473
|
-
(
|
|
3473
|
+
(S == null ? void 0 : S.isOffline) || !1
|
|
3474
3474
|
), uu.setItem(
|
|
3475
3475
|
"submitedFormLateTime",
|
|
3476
|
-
(
|
|
3477
|
-
),
|
|
3478
|
-
return
|
|
3479
|
-
_(!1),
|
|
3480
|
-
...Du.filter((au) => au.mid !==
|
|
3481
|
-
|
|
3482
|
-
]), s(0), "direction" in
|
|
3483
|
-
(
|
|
3476
|
+
(S == null ? void 0 : S.submitedFormLateTime) || null
|
|
3477
|
+
), S && "type" in S && S.type === "typing")
|
|
3478
|
+
return T === !0;
|
|
3479
|
+
_(!1), S && "mid" in S && !C.find((Du) => S.mid === Du.mid) && ("author" in S && (S.direction = S.author === "chatbot" ? Q.received : Q.sent, S.read = !0, S.delivery = !0), v((Du) => [
|
|
3480
|
+
...Du.filter((au) => au.mid !== S.mid),
|
|
3481
|
+
S
|
|
3482
|
+
]), s(0), "direction" in S && S.direction === Q.received && !S.isOffline && V(!1)), S && "data" in S && "quick_replies" in S.data ? I(
|
|
3483
|
+
(S.data.quick_replies || []).map(
|
|
3484
3484
|
(Du) => ({
|
|
3485
3485
|
content_type: Zf.text,
|
|
3486
3486
|
text: Du.title,
|
|
3487
3487
|
payload: Du.payload
|
|
3488
3488
|
})
|
|
3489
3489
|
)
|
|
3490
|
-
) :
|
|
3491
|
-
}, { socket:
|
|
3492
|
-
data:
|
|
3490
|
+
) : I([]), d || m((Du) => Du + 1), t.alwaysScrollToBottom && s(101), hu(iD.sent);
|
|
3491
|
+
}, { socket: Bu } = Gu(), ru = async ({
|
|
3492
|
+
data: S
|
|
3493
3493
|
}) => {
|
|
3494
3494
|
var au;
|
|
3495
3495
|
hu(
|
|
3496
|
-
|
|
3497
|
-
),
|
|
3496
|
+
S.type === "file" ? iD.uploading : iD.sending
|
|
3497
|
+
), O("");
|
|
3498
3498
|
const Du = await o.socket.post(
|
|
3499
3499
|
`/webhook/${e.channel}/`,
|
|
3500
3500
|
{
|
|
3501
3501
|
data: {
|
|
3502
|
-
...
|
|
3503
|
-
author: (
|
|
3502
|
+
...S,
|
|
3503
|
+
author: (S == null ? void 0 : S.author) ?? ((au = c[1]) == null ? void 0 : au.id)
|
|
3504
3504
|
}
|
|
3505
3505
|
}
|
|
3506
3506
|
);
|
|
@@ -3511,29 +3511,29 @@ const Ae = (u, D) => {
|
|
|
3511
3511
|
"=== CALLING handleNewIOMessage from handleSend (API Response) ==="
|
|
3512
3512
|
);
|
|
3513
3513
|
}, du = Mu(
|
|
3514
|
-
async (
|
|
3514
|
+
async (S, Du) => {
|
|
3515
3515
|
try {
|
|
3516
3516
|
y(2);
|
|
3517
3517
|
const au = new URLSearchParams();
|
|
3518
3518
|
Object.entries({
|
|
3519
|
-
...
|
|
3519
|
+
...S && Du ? { first_name: S, last_name: Du } : {},
|
|
3520
3520
|
_refresh: Date.now().toString()
|
|
3521
3521
|
// Force fresh data
|
|
3522
|
-
}).forEach(([
|
|
3523
|
-
typeof Uu == "string" && Uu.trim() && au.append(
|
|
3522
|
+
}).forEach(([gu, Uu]) => {
|
|
3523
|
+
typeof Uu == "string" && Uu.trim() && au.append(gu, Uu);
|
|
3524
3524
|
}), au.append("owner_id", e.ownerId);
|
|
3525
|
-
const { body: lu } = await
|
|
3525
|
+
const { body: lu } = await Bu.get(`/webhook/${e.channel}/?${au.toString()}`);
|
|
3526
3526
|
console.log("jump here 2"), uu.setItem("profileLiveChat", lu.profile), uu.setItem("isOffline", cu || !1), uu.setItem(
|
|
3527
3527
|
"submitedFormLateTime",
|
|
3528
3528
|
lu.profile.submitedFormLateTime || null
|
|
3529
|
-
),
|
|
3530
|
-
lu.messages.map((
|
|
3531
|
-
...
|
|
3532
|
-
direction:
|
|
3533
|
-
read:
|
|
3534
|
-
delivery:
|
|
3535
|
-
isOffline:
|
|
3536
|
-
submitedFormLateTime:
|
|
3529
|
+
), v(
|
|
3530
|
+
lu.messages.map((gu) => ({
|
|
3531
|
+
...gu,
|
|
3532
|
+
direction: gu.author === lu.profile.foreignId || gu.author === lu.profile.id ? Q.sent : Q.received,
|
|
3533
|
+
read: gu.direction === Q.sent || gu.read,
|
|
3534
|
+
delivery: gu.direction === Q.sent || gu.delivery,
|
|
3535
|
+
isOffline: gu.isOffline || lu.profile.isOffline,
|
|
3536
|
+
submitedFormLateTime: gu.submitedFormLateTime || lu.profile.submitedFormLateTime
|
|
3537
3537
|
}))
|
|
3538
3538
|
), l([
|
|
3539
3539
|
c[0],
|
|
@@ -3548,7 +3548,7 @@ const Ae = (u, D) => {
|
|
|
3548
3548
|
data: {
|
|
3549
3549
|
type: Au.postback,
|
|
3550
3550
|
data: {
|
|
3551
|
-
text:
|
|
3551
|
+
text: z("messages.get_started"),
|
|
3552
3552
|
payload: "GET_STARTED"
|
|
3553
3553
|
},
|
|
3554
3554
|
author: lu.profile.foreignId
|
|
@@ -3562,84 +3562,84 @@ const Ae = (u, D) => {
|
|
|
3562
3562
|
[
|
|
3563
3563
|
c,
|
|
3564
3564
|
y,
|
|
3565
|
-
|
|
3565
|
+
v,
|
|
3566
3566
|
l,
|
|
3567
3567
|
r,
|
|
3568
3568
|
o
|
|
3569
3569
|
]
|
|
3570
3570
|
);
|
|
3571
|
-
Df(WD.message, (
|
|
3571
|
+
Df(WD.message, (S) => {
|
|
3572
3572
|
console.log(
|
|
3573
3573
|
"=== CALLING handleNewIOMessage from useSubscribe (Socket Realtime) ==="
|
|
3574
|
-
), _u(
|
|
3574
|
+
), _u(S);
|
|
3575
3575
|
}), Df(WD.typing, _);
|
|
3576
|
-
const Pu = (
|
|
3577
|
-
|
|
3576
|
+
const Pu = (S) => {
|
|
3577
|
+
S ? (p(S), r("webview")) : r("chat");
|
|
3578
3578
|
};
|
|
3579
3579
|
X(() => {
|
|
3580
|
-
F && d &&
|
|
3580
|
+
F && d && m(0);
|
|
3581
3581
|
}, [F, d]), X(() => {
|
|
3582
3582
|
if (d && j === tD.connected) {
|
|
3583
3583
|
console.log("🔄 Widget opened - fetching fresh data");
|
|
3584
|
-
const
|
|
3585
|
-
if (
|
|
3586
|
-
const Du =
|
|
3584
|
+
const S = uu.getItem("profileLiveChat");
|
|
3585
|
+
if (S) {
|
|
3586
|
+
const Du = S;
|
|
3587
3587
|
console.log("🔄 Widget opened - fetching fresh data", Du), du(Du.firstName, Du.lastName);
|
|
3588
3588
|
}
|
|
3589
|
-
!
|
|
3589
|
+
!S && !cu && r("prechat");
|
|
3590
3590
|
}
|
|
3591
3591
|
}, [d]), h0("logout", () => {
|
|
3592
3592
|
o.socket.disconnect();
|
|
3593
3593
|
}), X(() => {
|
|
3594
3594
|
n === "chat" && j === tD.connected && du();
|
|
3595
|
-
const
|
|
3595
|
+
const S = () => {
|
|
3596
3596
|
const Du = uu.getItem("profileLiveChat");
|
|
3597
3597
|
if (Du) {
|
|
3598
3598
|
const au = Du;
|
|
3599
3599
|
du(au.firstName, au.lastName);
|
|
3600
3600
|
}
|
|
3601
3601
|
};
|
|
3602
|
-
return o.socket.io.on("reconnect",
|
|
3603
|
-
o.socket.io.off("reconnect",
|
|
3602
|
+
return o.socket.io.on("reconnect", S), () => {
|
|
3603
|
+
o.socket.io.off("reconnect", S);
|
|
3604
3604
|
};
|
|
3605
3605
|
}, []), X(() => {
|
|
3606
|
-
const
|
|
3607
|
-
|
|
3606
|
+
const S = [...c];
|
|
3607
|
+
S[0].imageUrl = t.avatarUrl, l(S);
|
|
3608
3608
|
}, [t.avatarUrl]);
|
|
3609
3609
|
const Iu = {
|
|
3610
3610
|
participants: c,
|
|
3611
3611
|
setParticipants: l,
|
|
3612
|
-
outgoingMessageState:
|
|
3612
|
+
outgoingMessageState: $,
|
|
3613
3613
|
setOutgoingMessageState: hu,
|
|
3614
3614
|
connectionState: j,
|
|
3615
3615
|
setConnectionState: Z,
|
|
3616
|
-
messages: C.sort((
|
|
3617
|
-
const au = Date.parse(
|
|
3616
|
+
messages: C.sort((S, Du) => {
|
|
3617
|
+
const au = Date.parse(S.createdAt), lu = Date.parse(Du.createdAt);
|
|
3618
3618
|
return +new Date(au) - +new Date(lu);
|
|
3619
3619
|
}),
|
|
3620
|
-
setMessages:
|
|
3621
|
-
newMessagesCount:
|
|
3622
|
-
setNewMessagesCount:
|
|
3623
|
-
newIOMessage:
|
|
3624
|
-
setNewIOMessage:
|
|
3620
|
+
setMessages: v,
|
|
3621
|
+
newMessagesCount: x,
|
|
3622
|
+
setNewMessagesCount: m,
|
|
3623
|
+
newIOMessage: P,
|
|
3624
|
+
setNewIOMessage: q,
|
|
3625
3625
|
send: ru,
|
|
3626
|
-
showTypingIndicator: t.showTypingIndicator &&
|
|
3626
|
+
showTypingIndicator: t.showTypingIndicator && T,
|
|
3627
3627
|
setShowTypingIndicator: _,
|
|
3628
|
-
suggestions:
|
|
3629
|
-
setSuggestions:
|
|
3630
|
-
webviewUrl:
|
|
3628
|
+
suggestions: B,
|
|
3629
|
+
setSuggestions: I,
|
|
3630
|
+
webviewUrl: A,
|
|
3631
3631
|
setWebviewUrl: Pu,
|
|
3632
3632
|
payload: fu,
|
|
3633
|
-
setPayload:
|
|
3633
|
+
setPayload: k,
|
|
3634
3634
|
file: E,
|
|
3635
3635
|
setFile: h,
|
|
3636
|
-
message:
|
|
3637
|
-
setMessage:
|
|
3636
|
+
message: g,
|
|
3637
|
+
setMessage: O,
|
|
3638
3638
|
handleSubscription: du,
|
|
3639
|
-
isContactFormActive:
|
|
3640
|
-
setIsContactFormActive:
|
|
3639
|
+
isContactFormActive: R,
|
|
3640
|
+
setIsContactFormActive: N,
|
|
3641
3641
|
isOfflineMode: M,
|
|
3642
|
-
setIsOfflineMode:
|
|
3642
|
+
setIsOfflineMode: V
|
|
3643
3643
|
};
|
|
3644
3644
|
return /* @__PURE__ */ a.jsx(_1.Provider, { value: Iu, children: f });
|
|
3645
3645
|
}, Cu = () => {
|
|
@@ -3961,7 +3961,7 @@ const Ae = (u, D) => {
|
|
|
3961
3961
|
}), w1 = ({
|
|
3962
3962
|
children: u
|
|
3963
3963
|
}) => {
|
|
3964
|
-
const D =
|
|
3964
|
+
const D = pu(), f = () => {
|
|
3965
3965
|
const e = D.color;
|
|
3966
3966
|
if (yD[e])
|
|
3967
3967
|
return yD[e];
|
|
@@ -4012,7 +4012,7 @@ const Ae = (u, D) => {
|
|
|
4012
4012
|
), Ie = ({
|
|
4013
4013
|
onSendNoticeToStaff: u
|
|
4014
4014
|
}) => {
|
|
4015
|
-
const [D, f] =
|
|
4015
|
+
const [D, f] = U(!1), e = mu(null), { send: t } = Cu(), n = async (r) => {
|
|
4016
4016
|
r.preventDefault(), r.stopPropagation();
|
|
4017
4017
|
try {
|
|
4018
4018
|
const s = uu.getItem("profileLiveChat");
|
|
@@ -4060,7 +4060,7 @@ const Ae = (u, D) => {
|
|
|
4060
4060
|
) })
|
|
4061
4061
|
] });
|
|
4062
4062
|
}, Le = ({ children: u }) => {
|
|
4063
|
-
const D =
|
|
4063
|
+
const D = pu(), { colors: f } = ou(), e = Nu();
|
|
4064
4064
|
return /* @__PURE__ */ a.jsxs(
|
|
4065
4065
|
"div",
|
|
4066
4066
|
{
|
|
@@ -4239,256 +4239,256 @@ var x1 = { exports: {} };
|
|
|
4239
4239
|
(function(f, e) {
|
|
4240
4240
|
u.exports = e();
|
|
4241
4241
|
})(dD, function() {
|
|
4242
|
-
var f = 1e3, e = 6e4, t = 36e5, n = "millisecond", r = "second", s = "minute", F = "hour", d = "day", o = "week", c = "month", l = "quarter", j = "year", y = "date", C = "Invalid Date",
|
|
4243
|
-
var E = ["th", "st", "nd", "rd"], h =
|
|
4244
|
-
return "[" +
|
|
4245
|
-
} },
|
|
4246
|
-
var
|
|
4247
|
-
return !
|
|
4248
|
-
}, _ = { s:
|
|
4249
|
-
var E = -
|
|
4250
|
-
return (E <= 0 ? "+" : "-") +
|
|
4251
|
-
}, m: function
|
|
4252
|
-
if (E.date() < h.date()) return -
|
|
4253
|
-
var
|
|
4254
|
-
return +(-(
|
|
4255
|
-
}, a: function(
|
|
4256
|
-
return
|
|
4257
|
-
}, p: function(
|
|
4258
|
-
return { M: c, y: j, w: o, d, D: y, h: F, m: s, s: r, ms: n, Q: l }[
|
|
4259
|
-
}, u: function(
|
|
4260
|
-
return
|
|
4261
|
-
} },
|
|
4262
|
-
|
|
4263
|
-
var
|
|
4264
|
-
return
|
|
4265
|
-
},
|
|
4266
|
-
var
|
|
4267
|
-
if (!E) return
|
|
4242
|
+
var f = 1e3, e = 6e4, t = 36e5, n = "millisecond", r = "second", s = "minute", F = "hour", d = "day", o = "week", c = "month", l = "quarter", j = "year", y = "date", C = "Invalid Date", v = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, x = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, m = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
|
|
4243
|
+
var E = ["th", "st", "nd", "rd"], h = k % 100;
|
|
4244
|
+
return "[" + k + (E[(h - 20) % 10] || E[h] || E[0]) + "]";
|
|
4245
|
+
} }, T = function(k, E, h) {
|
|
4246
|
+
var A = String(k);
|
|
4247
|
+
return !A || A.length >= E ? k : "" + Array(E + 1 - A.length).join(h) + k;
|
|
4248
|
+
}, _ = { s: T, z: function(k) {
|
|
4249
|
+
var E = -k.utcOffset(), h = Math.abs(E), A = Math.floor(h / 60), p = h % 60;
|
|
4250
|
+
return (E <= 0 ? "+" : "-") + T(A, 2, "0") + ":" + T(p, 2, "0");
|
|
4251
|
+
}, m: function k(E, h) {
|
|
4252
|
+
if (E.date() < h.date()) return -k(h, E);
|
|
4253
|
+
var A = 12 * (h.year() - E.year()) + (h.month() - E.month()), p = E.clone().add(A, c), R = h - p < 0, N = E.clone().add(A + (R ? -1 : 1), c);
|
|
4254
|
+
return +(-(A + (h - p) / (R ? p - N : N - p)) || 0);
|
|
4255
|
+
}, a: function(k) {
|
|
4256
|
+
return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
|
|
4257
|
+
}, p: function(k) {
|
|
4258
|
+
return { M: c, y: j, w: o, d, D: y, h: F, m: s, s: r, ms: n, Q: l }[k] || String(k || "").toLowerCase().replace(/s$/, "");
|
|
4259
|
+
}, u: function(k) {
|
|
4260
|
+
return k === void 0;
|
|
4261
|
+
} }, B = "en", I = {};
|
|
4262
|
+
I[B] = m;
|
|
4263
|
+
var P = "$isDayjsObject", q = function(k) {
|
|
4264
|
+
return k instanceof hu || !(!k || !k[P]);
|
|
4265
|
+
}, g = function k(E, h, A) {
|
|
4266
|
+
var p;
|
|
4267
|
+
if (!E) return B;
|
|
4268
4268
|
if (typeof E == "string") {
|
|
4269
|
-
var
|
|
4270
|
-
R
|
|
4271
|
-
var
|
|
4272
|
-
if (!
|
|
4269
|
+
var R = E.toLowerCase();
|
|
4270
|
+
I[R] && (p = R), h && (I[R] = h, p = R);
|
|
4271
|
+
var N = E.split("-");
|
|
4272
|
+
if (!p && N.length > 1) return k(N[0]);
|
|
4273
4273
|
} else {
|
|
4274
4274
|
var M = E.name;
|
|
4275
|
-
|
|
4275
|
+
I[M] = E, p = M;
|
|
4276
4276
|
}
|
|
4277
|
-
return !
|
|
4278
|
-
},
|
|
4279
|
-
if (
|
|
4277
|
+
return !A && p && (B = p), p || !A && B;
|
|
4278
|
+
}, O = function(k, E) {
|
|
4279
|
+
if (q(k)) return k.clone();
|
|
4280
4280
|
var h = typeof E == "object" ? E : {};
|
|
4281
|
-
return h.date =
|
|
4282
|
-
},
|
|
4283
|
-
|
|
4284
|
-
return
|
|
4281
|
+
return h.date = k, h.args = arguments, new hu(h);
|
|
4282
|
+
}, $ = _;
|
|
4283
|
+
$.l = g, $.i = q, $.w = function(k, E) {
|
|
4284
|
+
return O(k, { locale: E.$L, utc: E.$u, x: E.$x, $offset: E.$offset });
|
|
4285
4285
|
};
|
|
4286
4286
|
var hu = function() {
|
|
4287
|
-
function
|
|
4288
|
-
this.$L =
|
|
4287
|
+
function k(h) {
|
|
4288
|
+
this.$L = g(h.locale, null, !0), this.parse(h), this.$x = this.$x || h.x || {}, this[P] = !0;
|
|
4289
4289
|
}
|
|
4290
|
-
var E =
|
|
4290
|
+
var E = k.prototype;
|
|
4291
4291
|
return E.parse = function(h) {
|
|
4292
|
-
this.$d = function(
|
|
4293
|
-
var
|
|
4294
|
-
if (
|
|
4295
|
-
if (
|
|
4296
|
-
if (
|
|
4297
|
-
if (typeof
|
|
4298
|
-
var
|
|
4299
|
-
if (
|
|
4300
|
-
var M =
|
|
4301
|
-
return
|
|
4292
|
+
this.$d = function(A) {
|
|
4293
|
+
var p = A.date, R = A.utc;
|
|
4294
|
+
if (p === null) return /* @__PURE__ */ new Date(NaN);
|
|
4295
|
+
if ($.u(p)) return /* @__PURE__ */ new Date();
|
|
4296
|
+
if (p instanceof Date) return new Date(p);
|
|
4297
|
+
if (typeof p == "string" && !/Z$/i.test(p)) {
|
|
4298
|
+
var N = p.match(v);
|
|
4299
|
+
if (N) {
|
|
4300
|
+
var M = N[2] - 1 || 0, V = (N[7] || "0").substring(0, 3);
|
|
4301
|
+
return R ? new Date(Date.UTC(N[1], M, N[3] || 1, N[4] || 0, N[5] || 0, N[6] || 0, V)) : new Date(N[1], M, N[3] || 1, N[4] || 0, N[5] || 0, N[6] || 0, V);
|
|
4302
4302
|
}
|
|
4303
4303
|
}
|
|
4304
|
-
return new Date(
|
|
4304
|
+
return new Date(p);
|
|
4305
4305
|
}(h), this.init();
|
|
4306
4306
|
}, E.init = function() {
|
|
4307
4307
|
var h = this.$d;
|
|
4308
4308
|
this.$y = h.getFullYear(), this.$M = h.getMonth(), this.$D = h.getDate(), this.$W = h.getDay(), this.$H = h.getHours(), this.$m = h.getMinutes(), this.$s = h.getSeconds(), this.$ms = h.getMilliseconds();
|
|
4309
4309
|
}, E.$utils = function() {
|
|
4310
|
-
return
|
|
4310
|
+
return $;
|
|
4311
4311
|
}, E.isValid = function() {
|
|
4312
4312
|
return this.$d.toString() !== C;
|
|
4313
|
-
}, E.isSame = function(h,
|
|
4314
|
-
var
|
|
4315
|
-
return this.startOf(
|
|
4316
|
-
}, E.isAfter = function(h,
|
|
4317
|
-
return
|
|
4318
|
-
}, E.isBefore = function(h,
|
|
4319
|
-
return this.endOf(
|
|
4320
|
-
}, E.$g = function(h,
|
|
4321
|
-
return
|
|
4313
|
+
}, E.isSame = function(h, A) {
|
|
4314
|
+
var p = O(h);
|
|
4315
|
+
return this.startOf(A) <= p && p <= this.endOf(A);
|
|
4316
|
+
}, E.isAfter = function(h, A) {
|
|
4317
|
+
return O(h) < this.startOf(A);
|
|
4318
|
+
}, E.isBefore = function(h, A) {
|
|
4319
|
+
return this.endOf(A) < O(h);
|
|
4320
|
+
}, E.$g = function(h, A, p) {
|
|
4321
|
+
return $.u(h) ? this[A] : this.set(p, h);
|
|
4322
4322
|
}, E.unix = function() {
|
|
4323
4323
|
return Math.floor(this.valueOf() / 1e3);
|
|
4324
4324
|
}, E.valueOf = function() {
|
|
4325
4325
|
return this.$d.getTime();
|
|
4326
|
-
}, E.startOf = function(h,
|
|
4327
|
-
var
|
|
4328
|
-
var du =
|
|
4329
|
-
return
|
|
4330
|
-
},
|
|
4331
|
-
return
|
|
4332
|
-
}, J = this.$W,
|
|
4333
|
-
switch (
|
|
4326
|
+
}, E.startOf = function(h, A) {
|
|
4327
|
+
var p = this, R = !!$.u(A) || A, N = $.p(h), M = function(Bu, ru) {
|
|
4328
|
+
var du = $.w(p.$u ? Date.UTC(p.$y, ru, Bu) : new Date(p.$y, ru, Bu), p);
|
|
4329
|
+
return R ? du : du.endOf(d);
|
|
4330
|
+
}, V = function(Bu, ru) {
|
|
4331
|
+
return $.w(p.toDate()[Bu].apply(p.toDate("s"), (R ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ru)), p);
|
|
4332
|
+
}, J = this.$W, z = this.$M, Z = this.$D, tu = "set" + (this.$u ? "UTC" : "");
|
|
4333
|
+
switch (N) {
|
|
4334
4334
|
case j:
|
|
4335
|
-
return
|
|
4335
|
+
return R ? M(1, 0) : M(31, 11);
|
|
4336
4336
|
case c:
|
|
4337
|
-
return
|
|
4337
|
+
return R ? M(1, z) : M(0, z + 1);
|
|
4338
4338
|
case o:
|
|
4339
4339
|
var cu = this.$locale().weekStart || 0, _u = (J < cu ? J + 7 : J) - cu;
|
|
4340
|
-
return M(
|
|
4340
|
+
return M(R ? Z - _u : Z + (6 - _u), z);
|
|
4341
4341
|
case d:
|
|
4342
4342
|
case y:
|
|
4343
|
-
return
|
|
4343
|
+
return V(tu + "Hours", 0);
|
|
4344
4344
|
case F:
|
|
4345
|
-
return
|
|
4345
|
+
return V(tu + "Minutes", 1);
|
|
4346
4346
|
case s:
|
|
4347
|
-
return
|
|
4347
|
+
return V(tu + "Seconds", 2);
|
|
4348
4348
|
case r:
|
|
4349
|
-
return
|
|
4349
|
+
return V(tu + "Milliseconds", 3);
|
|
4350
4350
|
default:
|
|
4351
4351
|
return this.clone();
|
|
4352
4352
|
}
|
|
4353
4353
|
}, E.endOf = function(h) {
|
|
4354
4354
|
return this.startOf(h, !1);
|
|
4355
|
-
}, E.$set = function(h,
|
|
4356
|
-
var
|
|
4357
|
-
if (
|
|
4355
|
+
}, E.$set = function(h, A) {
|
|
4356
|
+
var p, R = $.p(h), N = "set" + (this.$u ? "UTC" : ""), M = (p = {}, p[d] = N + "Date", p[y] = N + "Date", p[c] = N + "Month", p[j] = N + "FullYear", p[F] = N + "Hours", p[s] = N + "Minutes", p[r] = N + "Seconds", p[n] = N + "Milliseconds", p)[R], V = R === d ? this.$D + (A - this.$W) : A;
|
|
4357
|
+
if (R === c || R === j) {
|
|
4358
4358
|
var J = this.clone().set(y, 1);
|
|
4359
|
-
J.$d[M](
|
|
4360
|
-
} else M && this.$d[M](
|
|
4359
|
+
J.$d[M](V), J.init(), this.$d = J.set(y, Math.min(this.$D, J.daysInMonth())).$d;
|
|
4360
|
+
} else M && this.$d[M](V);
|
|
4361
4361
|
return this.init(), this;
|
|
4362
|
-
}, E.set = function(h,
|
|
4363
|
-
return this.clone().$set(h,
|
|
4362
|
+
}, E.set = function(h, A) {
|
|
4363
|
+
return this.clone().$set(h, A);
|
|
4364
4364
|
}, E.get = function(h) {
|
|
4365
|
-
return this[
|
|
4366
|
-
}, E.add = function(h,
|
|
4367
|
-
var
|
|
4365
|
+
return this[$.p(h)]();
|
|
4366
|
+
}, E.add = function(h, A) {
|
|
4367
|
+
var p, R = this;
|
|
4368
4368
|
h = Number(h);
|
|
4369
|
-
var
|
|
4370
|
-
var Z =
|
|
4371
|
-
return
|
|
4369
|
+
var N = $.p(A), M = function(z) {
|
|
4370
|
+
var Z = O(R);
|
|
4371
|
+
return $.w(Z.date(Z.date() + Math.round(z * h)), R);
|
|
4372
4372
|
};
|
|
4373
|
-
if (
|
|
4374
|
-
if (
|
|
4375
|
-
if (
|
|
4376
|
-
if (
|
|
4377
|
-
var
|
|
4378
|
-
return
|
|
4379
|
-
}, E.subtract = function(h,
|
|
4380
|
-
return this.add(-1 * h,
|
|
4373
|
+
if (N === c) return this.set(c, this.$M + h);
|
|
4374
|
+
if (N === j) return this.set(j, this.$y + h);
|
|
4375
|
+
if (N === d) return M(1);
|
|
4376
|
+
if (N === o) return M(7);
|
|
4377
|
+
var V = (p = {}, p[s] = e, p[F] = t, p[r] = f, p)[N] || 1, J = this.$d.getTime() + h * V;
|
|
4378
|
+
return $.w(J, this);
|
|
4379
|
+
}, E.subtract = function(h, A) {
|
|
4380
|
+
return this.add(-1 * h, A);
|
|
4381
4381
|
}, E.format = function(h) {
|
|
4382
|
-
var
|
|
4383
|
-
if (!this.isValid()) return
|
|
4384
|
-
var
|
|
4385
|
-
return ru && (ru[du] || ru(
|
|
4382
|
+
var A = this, p = this.$locale();
|
|
4383
|
+
if (!this.isValid()) return p.invalidDate || C;
|
|
4384
|
+
var R = h || "YYYY-MM-DDTHH:mm:ssZ", N = $.z(this), M = this.$H, V = this.$m, J = this.$M, z = p.weekdays, Z = p.months, tu = p.meridiem, cu = function(ru, du, Pu, Iu) {
|
|
4385
|
+
return ru && (ru[du] || ru(A, R)) || Pu[du].slice(0, Iu);
|
|
4386
4386
|
}, _u = function(ru) {
|
|
4387
|
-
return
|
|
4388
|
-
},
|
|
4387
|
+
return $.s(M % 12 || 12, ru, "0");
|
|
4388
|
+
}, Bu = tu || function(ru, du, Pu) {
|
|
4389
4389
|
var Iu = ru < 12 ? "AM" : "PM";
|
|
4390
4390
|
return Pu ? Iu.toLowerCase() : Iu;
|
|
4391
4391
|
};
|
|
4392
|
-
return
|
|
4392
|
+
return R.replace(x, function(ru, du) {
|
|
4393
4393
|
return du || function(Pu) {
|
|
4394
4394
|
switch (Pu) {
|
|
4395
4395
|
case "YY":
|
|
4396
|
-
return String(
|
|
4396
|
+
return String(A.$y).slice(-2);
|
|
4397
4397
|
case "YYYY":
|
|
4398
|
-
return
|
|
4398
|
+
return $.s(A.$y, 4, "0");
|
|
4399
4399
|
case "M":
|
|
4400
4400
|
return J + 1;
|
|
4401
4401
|
case "MM":
|
|
4402
|
-
return
|
|
4402
|
+
return $.s(J + 1, 2, "0");
|
|
4403
4403
|
case "MMM":
|
|
4404
|
-
return cu(
|
|
4404
|
+
return cu(p.monthsShort, J, Z, 3);
|
|
4405
4405
|
case "MMMM":
|
|
4406
4406
|
return cu(Z, J);
|
|
4407
4407
|
case "D":
|
|
4408
|
-
return
|
|
4408
|
+
return A.$D;
|
|
4409
4409
|
case "DD":
|
|
4410
|
-
return
|
|
4410
|
+
return $.s(A.$D, 2, "0");
|
|
4411
4411
|
case "d":
|
|
4412
|
-
return String(
|
|
4412
|
+
return String(A.$W);
|
|
4413
4413
|
case "dd":
|
|
4414
|
-
return cu(
|
|
4414
|
+
return cu(p.weekdaysMin, A.$W, z, 2);
|
|
4415
4415
|
case "ddd":
|
|
4416
|
-
return cu(
|
|
4416
|
+
return cu(p.weekdaysShort, A.$W, z, 3);
|
|
4417
4417
|
case "dddd":
|
|
4418
|
-
return
|
|
4418
|
+
return z[A.$W];
|
|
4419
4419
|
case "H":
|
|
4420
4420
|
return String(M);
|
|
4421
4421
|
case "HH":
|
|
4422
|
-
return
|
|
4422
|
+
return $.s(M, 2, "0");
|
|
4423
4423
|
case "h":
|
|
4424
4424
|
return _u(1);
|
|
4425
4425
|
case "hh":
|
|
4426
4426
|
return _u(2);
|
|
4427
4427
|
case "a":
|
|
4428
|
-
return
|
|
4428
|
+
return Bu(M, V, !0);
|
|
4429
4429
|
case "A":
|
|
4430
|
-
return
|
|
4430
|
+
return Bu(M, V, !1);
|
|
4431
4431
|
case "m":
|
|
4432
|
-
return String(
|
|
4432
|
+
return String(V);
|
|
4433
4433
|
case "mm":
|
|
4434
|
-
return
|
|
4434
|
+
return $.s(V, 2, "0");
|
|
4435
4435
|
case "s":
|
|
4436
|
-
return String(
|
|
4436
|
+
return String(A.$s);
|
|
4437
4437
|
case "ss":
|
|
4438
|
-
return
|
|
4438
|
+
return $.s(A.$s, 2, "0");
|
|
4439
4439
|
case "SSS":
|
|
4440
|
-
return
|
|
4440
|
+
return $.s(A.$ms, 3, "0");
|
|
4441
4441
|
case "Z":
|
|
4442
|
-
return
|
|
4442
|
+
return N;
|
|
4443
4443
|
}
|
|
4444
4444
|
return null;
|
|
4445
|
-
}(ru) ||
|
|
4445
|
+
}(ru) || N.replace(":", "");
|
|
4446
4446
|
});
|
|
4447
4447
|
}, E.utcOffset = function() {
|
|
4448
4448
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
4449
|
-
}, E.diff = function(h,
|
|
4450
|
-
var
|
|
4451
|
-
return
|
|
4449
|
+
}, E.diff = function(h, A, p) {
|
|
4450
|
+
var R, N = this, M = $.p(A), V = O(h), J = (V.utcOffset() - this.utcOffset()) * e, z = this - V, Z = function() {
|
|
4451
|
+
return $.m(N, V);
|
|
4452
4452
|
};
|
|
4453
4453
|
switch (M) {
|
|
4454
4454
|
case j:
|
|
4455
|
-
|
|
4455
|
+
R = Z() / 12;
|
|
4456
4456
|
break;
|
|
4457
4457
|
case c:
|
|
4458
|
-
|
|
4458
|
+
R = Z();
|
|
4459
4459
|
break;
|
|
4460
4460
|
case l:
|
|
4461
|
-
|
|
4461
|
+
R = Z() / 3;
|
|
4462
4462
|
break;
|
|
4463
4463
|
case o:
|
|
4464
|
-
|
|
4464
|
+
R = (z - J) / 6048e5;
|
|
4465
4465
|
break;
|
|
4466
4466
|
case d:
|
|
4467
|
-
|
|
4467
|
+
R = (z - J) / 864e5;
|
|
4468
4468
|
break;
|
|
4469
4469
|
case F:
|
|
4470
|
-
|
|
4470
|
+
R = z / t;
|
|
4471
4471
|
break;
|
|
4472
4472
|
case s:
|
|
4473
|
-
|
|
4473
|
+
R = z / e;
|
|
4474
4474
|
break;
|
|
4475
4475
|
case r:
|
|
4476
|
-
|
|
4476
|
+
R = z / f;
|
|
4477
4477
|
break;
|
|
4478
4478
|
default:
|
|
4479
|
-
|
|
4479
|
+
R = z;
|
|
4480
4480
|
}
|
|
4481
|
-
return
|
|
4481
|
+
return p ? R : $.a(R);
|
|
4482
4482
|
}, E.daysInMonth = function() {
|
|
4483
4483
|
return this.endOf(c).$D;
|
|
4484
4484
|
}, E.$locale = function() {
|
|
4485
|
-
return
|
|
4486
|
-
}, E.locale = function(h,
|
|
4485
|
+
return I[this.$L];
|
|
4486
|
+
}, E.locale = function(h, A) {
|
|
4487
4487
|
if (!h) return this.$L;
|
|
4488
|
-
var
|
|
4489
|
-
return
|
|
4488
|
+
var p = this.clone(), R = g(h, A, !0);
|
|
4489
|
+
return R && (p.$L = R), p;
|
|
4490
4490
|
}, E.clone = function() {
|
|
4491
|
-
return
|
|
4491
|
+
return $.w(this.$d, this);
|
|
4492
4492
|
}, E.toDate = function() {
|
|
4493
4493
|
return new Date(this.valueOf());
|
|
4494
4494
|
}, E.toJSON = function() {
|
|
@@ -4497,17 +4497,17 @@ var x1 = { exports: {} };
|
|
|
4497
4497
|
return this.$d.toISOString();
|
|
4498
4498
|
}, E.toString = function() {
|
|
4499
4499
|
return this.$d.toUTCString();
|
|
4500
|
-
},
|
|
4500
|
+
}, k;
|
|
4501
4501
|
}(), fu = hu.prototype;
|
|
4502
|
-
return
|
|
4503
|
-
fu[
|
|
4504
|
-
return this.$g(E,
|
|
4502
|
+
return O.prototype = fu, [["$ms", n], ["$s", r], ["$m", s], ["$H", F], ["$W", d], ["$M", c], ["$y", j], ["$D", y]].forEach(function(k) {
|
|
4503
|
+
fu[k[1]] = function(E) {
|
|
4504
|
+
return this.$g(E, k[0], k[1]);
|
|
4505
4505
|
};
|
|
4506
|
-
}),
|
|
4507
|
-
return
|
|
4508
|
-
},
|
|
4509
|
-
return
|
|
4510
|
-
},
|
|
4506
|
+
}), O.extend = function(k, E) {
|
|
4507
|
+
return k.$i || (k(E, hu, O), k.$i = !0), O;
|
|
4508
|
+
}, O.locale = g, O.isDayjs = q, O.unix = function(k) {
|
|
4509
|
+
return O(1e3 * k);
|
|
4510
|
+
}, O.en = I[B], O.Ls = I, O.p = {}, O;
|
|
4511
4511
|
});
|
|
4512
4512
|
})(x1);
|
|
4513
4513
|
var k1 = x1.exports;
|
|
@@ -4549,20 +4549,20 @@ var S1 = { exports: {} };
|
|
|
4549
4549
|
return n.fromToBase(d, o, c, l);
|
|
4550
4550
|
}
|
|
4551
4551
|
t.en.relativeTime = r, n.fromToBase = function(d, o, c, l, j) {
|
|
4552
|
-
for (var y, C,
|
|
4553
|
-
var
|
|
4554
|
-
|
|
4555
|
-
var
|
|
4556
|
-
if (
|
|
4557
|
-
|
|
4558
|
-
var
|
|
4559
|
-
j && (
|
|
4552
|
+
for (var y, C, v, x = c.$locale().relativeTime || r, m = f.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], T = m.length, _ = 0; _ < T; _ += 1) {
|
|
4553
|
+
var B = m[_];
|
|
4554
|
+
B.d && (y = l ? t(d).diff(c, B.d, !0) : c.diff(d, B.d, !0));
|
|
4555
|
+
var I = (f.rounding || Math.round)(Math.abs(y));
|
|
4556
|
+
if (v = y > 0, I <= B.r || !B.r) {
|
|
4557
|
+
I <= 1 && _ > 0 && (B = m[_ - 1]);
|
|
4558
|
+
var P = x[B.l];
|
|
4559
|
+
j && (I = j("" + I)), C = typeof P == "string" ? P.replace("%d", I) : P(I, o, B.l, v);
|
|
4560
4560
|
break;
|
|
4561
4561
|
}
|
|
4562
4562
|
}
|
|
4563
4563
|
if (o) return C;
|
|
4564
|
-
var
|
|
4565
|
-
return typeof
|
|
4564
|
+
var q = v ? x.future : x.past;
|
|
4565
|
+
return typeof q == "function" ? q(C) : q.replace("%s", C);
|
|
4566
4566
|
}, n.to = function(d, o) {
|
|
4567
4567
|
return s(d, o, this, !0);
|
|
4568
4568
|
}, n.from = function(d, o) {
|
|
@@ -4646,7 +4646,7 @@ const He = /* @__PURE__ */ sf(Ve), T1 = ({
|
|
|
4646
4646
|
] })
|
|
4647
4647
|
}
|
|
4648
4648
|
), vD = ({ message: u }) => {
|
|
4649
|
-
const { setPayload: D, send: f, setWebviewUrl: e } = Cu(), t =
|
|
4649
|
+
const { setPayload: D, send: f, setWebviewUrl: e } = Cu(), t = pu(), { colors: n } = ou(), r = (s, F) => {
|
|
4650
4650
|
F.type === "web_url" && F.url ? F.messenger_extensions ? e(F.url) : window.open(F.url, "_blank") : F.type === "postback" && (D({ text: F.title, payload: F.payload }), f({
|
|
4651
4651
|
event: s,
|
|
4652
4652
|
source: "post-back",
|
|
@@ -4706,7 +4706,7 @@ const He = /* @__PURE__ */ sf(Ve), T1 = ({
|
|
|
4706
4706
|
] }) }), Ge = ({
|
|
4707
4707
|
messageCarousel: u
|
|
4708
4708
|
}) => {
|
|
4709
|
-
const { colors: D } = ou(), [f, e] =
|
|
4709
|
+
const { colors: D } = ou(), [f, e] = U(0), t = u.data.elements, n = () => {
|
|
4710
4710
|
e(
|
|
4711
4711
|
(d) => (d + t.length - 1) % t.length
|
|
4712
4712
|
);
|
|
@@ -4810,7 +4810,7 @@ const He = /* @__PURE__ */ sf(Ve), T1 = ({
|
|
|
4810
4810
|
);
|
|
4811
4811
|
}, Qe = ({ message: u }) => {
|
|
4812
4812
|
var d;
|
|
4813
|
-
const { colors: D } = ou(), f = Nu(), [e, t] =
|
|
4813
|
+
const { colors: D } = ou(), f = Nu(), [e, t] = U(!1), n = mu(null);
|
|
4814
4814
|
if (X(() => {
|
|
4815
4815
|
const o = new IntersectionObserver((c) => {
|
|
4816
4816
|
!e && c[0].intersectionRatio > 0 && t(!0);
|
|
@@ -6410,41 +6410,41 @@ const U1 = ({
|
|
|
6410
6410
|
initialData: u,
|
|
6411
6411
|
loadFromDataUserSubs: D = !1
|
|
6412
6412
|
} = {}) => {
|
|
6413
|
-
const [f, e] =
|
|
6413
|
+
const [f, e] = U(
|
|
6414
6414
|
u || {}
|
|
6415
|
-
), [t, n] =
|
|
6416
|
-
let
|
|
6415
|
+
), [t, n] = U({}), [r, s] = U({}), F = (C, v) => {
|
|
6416
|
+
let x = "";
|
|
6417
6417
|
if (C.isRequired)
|
|
6418
|
-
if (typeof
|
|
6419
|
-
const
|
|
6420
|
-
if (!
|
|
6418
|
+
if (typeof v == "string") {
|
|
6419
|
+
const m = v.trim();
|
|
6420
|
+
if (!m) return `${C.label} is required`;
|
|
6421
6421
|
if (C.key.toLowerCase().includes("phone") || C.label.toLowerCase().includes("phone")) {
|
|
6422
|
-
const
|
|
6423
|
-
if (_ &&
|
|
6422
|
+
const T = m.replace(/\s+/g, ""), _ = Ju.find((I) => T.startsWith(I.countryCode)), B = T.replace(/^\+?\d+/, "");
|
|
6423
|
+
if (_ && B.length === 0)
|
|
6424
6424
|
return "";
|
|
6425
6425
|
}
|
|
6426
|
-
} else typeof
|
|
6427
|
-
if (
|
|
6428
|
-
return console.log(`[VALIDATE] ${C.key}=${
|
|
6426
|
+
} else typeof v == "boolean" ? v !== !0 && (x = `${C.label} is required`) : v || (x = `${C.label} is required`);
|
|
6427
|
+
if (x && t[C.key])
|
|
6428
|
+
return console.log(`[VALIDATE] ${C.key}=${v}, ERROR=${x}`), x;
|
|
6429
6429
|
if (C.key.toLowerCase().includes("email") || C.label.toLowerCase().includes("email")) {
|
|
6430
|
-
const
|
|
6431
|
-
|
|
6430
|
+
const m = String(v || "").trim();
|
|
6431
|
+
m && (/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(m) || (x = "Please enter a valid email address"));
|
|
6432
6432
|
}
|
|
6433
6433
|
if (C.key.toLowerCase().includes("phone") || C.label.toLowerCase().includes("phone")) {
|
|
6434
|
-
const
|
|
6435
|
-
if (!C.isRequired && _ &&
|
|
6434
|
+
const m = String(v || ""), T = m.replace(/[^0-9+]/g, ""), _ = Ju.find((P) => T.startsWith(P.countryCode)), B = (_ == null ? void 0 : _.code) || "AU", I = _ ? T.substring(_.countryCode.length) : T;
|
|
6435
|
+
if (!C.isRequired && _ && I === "")
|
|
6436
6436
|
return "";
|
|
6437
|
-
if (
|
|
6438
|
-
const
|
|
6439
|
-
number:
|
|
6440
|
-
region:
|
|
6437
|
+
if (m) {
|
|
6438
|
+
const P = wt({
|
|
6439
|
+
number: m,
|
|
6440
|
+
region: B,
|
|
6441
6441
|
validateDuplicate: !1,
|
|
6442
6442
|
contacts: /* @__PURE__ */ new Map()
|
|
6443
6443
|
});
|
|
6444
|
-
|
|
6444
|
+
P.isValid || (x = P.errorMessage || "Please enter a valid phone number");
|
|
6445
6445
|
}
|
|
6446
6446
|
}
|
|
6447
|
-
return
|
|
6447
|
+
return x;
|
|
6448
6448
|
};
|
|
6449
6449
|
X(() => {
|
|
6450
6450
|
if (D)
|
|
@@ -6456,44 +6456,44 @@ const U1 = ({
|
|
|
6456
6456
|
}
|
|
6457
6457
|
}, [D]);
|
|
6458
6458
|
const d = Mu(
|
|
6459
|
-
(C,
|
|
6460
|
-
e((
|
|
6461
|
-
...
|
|
6462
|
-
[C]:
|
|
6463
|
-
})), s((
|
|
6459
|
+
(C, v) => {
|
|
6460
|
+
e((x) => ({
|
|
6461
|
+
...x,
|
|
6462
|
+
[C]: v
|
|
6463
|
+
})), s((x) => ({ ...x, [C]: "" }));
|
|
6464
6464
|
},
|
|
6465
6465
|
[]
|
|
6466
6466
|
), o = Mu(
|
|
6467
6467
|
(C) => {
|
|
6468
|
-
n((
|
|
6469
|
-
const
|
|
6470
|
-
s((
|
|
6468
|
+
n((m) => ({ ...m, [C.key]: !0 }));
|
|
6469
|
+
const v = f[C.key], x = F(C, v);
|
|
6470
|
+
s((m) => ({ ...m, [C.key]: x }));
|
|
6471
6471
|
},
|
|
6472
6472
|
[f]
|
|
6473
6473
|
), c = (C) => {
|
|
6474
|
-
const
|
|
6474
|
+
const v = {
|
|
6475
6475
|
email: "email",
|
|
6476
6476
|
phone: "tel",
|
|
6477
6477
|
date: "date",
|
|
6478
6478
|
password: "password"
|
|
6479
|
-
},
|
|
6480
|
-
(
|
|
6479
|
+
}, x = Object.keys(v).find(
|
|
6480
|
+
(m) => C.toLowerCase().includes(m)
|
|
6481
6481
|
);
|
|
6482
|
-
return
|
|
6482
|
+
return x ? v[x] : "text";
|
|
6483
6483
|
}, l = Mu(
|
|
6484
6484
|
(C) => {
|
|
6485
|
-
var
|
|
6485
|
+
var T;
|
|
6486
6486
|
if (!C.isDisplay) return null;
|
|
6487
|
-
const
|
|
6487
|
+
const v = f[C.key], x = c(C.key), m = !!r[C.key] && t[C.key];
|
|
6488
6488
|
if (C.key.includes("language") || C.key.includes("country"))
|
|
6489
6489
|
return /* @__PURE__ */ a.jsx(
|
|
6490
6490
|
"select",
|
|
6491
6491
|
{
|
|
6492
|
-
className: `user-subscription-form-input${
|
|
6493
|
-
value:
|
|
6492
|
+
className: `user-subscription-form-input${m ? " error" : ""}`,
|
|
6493
|
+
value: v || "",
|
|
6494
6494
|
onChange: (_) => d(C.key, _.target.value),
|
|
6495
6495
|
onBlur: () => o(C),
|
|
6496
|
-
"aria-invalid":
|
|
6496
|
+
"aria-invalid": m,
|
|
6497
6497
|
style: C.color ? { borderColor: C.color } : void 0,
|
|
6498
6498
|
children: /* @__PURE__ */ a.jsxs("option", { value: "", children: [
|
|
6499
6499
|
"Select ",
|
|
@@ -6509,24 +6509,24 @@ const U1 = ({
|
|
|
6509
6509
|
{
|
|
6510
6510
|
type: "checkbox",
|
|
6511
6511
|
id: C.key,
|
|
6512
|
-
checked:
|
|
6512
|
+
checked: v || !1,
|
|
6513
6513
|
onChange: (_) => d(C.key, _.target.checked),
|
|
6514
|
-
"aria-invalid":
|
|
6514
|
+
"aria-invalid": m
|
|
6515
6515
|
}
|
|
6516
6516
|
),
|
|
6517
6517
|
/* @__PURE__ */ a.jsx("label", { htmlFor: C.key, children: C.label })
|
|
6518
6518
|
] }, C.key);
|
|
6519
6519
|
if (C.key.toLowerCase().includes("phone")) {
|
|
6520
|
-
const _ =
|
|
6521
|
-
const
|
|
6520
|
+
const _ = v || "", B = ((T = Ju.find((g) => _.startsWith(g.countryCode))) == null ? void 0 : T.countryCode) || "+61", I = _.replace(/^\+?\d+\s?/, "").trim(), P = (g) => {
|
|
6521
|
+
const O = g.replace(/[^0-9\s]/g, "").trim();
|
|
6522
6522
|
d(
|
|
6523
6523
|
C.key,
|
|
6524
|
-
|
|
6524
|
+
O ? `${B} ${O}` : `${B} `
|
|
6525
6525
|
);
|
|
6526
|
-
},
|
|
6526
|
+
}, q = (g) => {
|
|
6527
6527
|
d(
|
|
6528
6528
|
C.key,
|
|
6529
|
-
|
|
6529
|
+
I ? `${g} ${I}` : `${g} `
|
|
6530
6530
|
);
|
|
6531
6531
|
};
|
|
6532
6532
|
return /* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form-field", children: [
|
|
@@ -6543,23 +6543,23 @@ const U1 = ({
|
|
|
6543
6543
|
/* @__PURE__ */ a.jsxs(
|
|
6544
6544
|
"select",
|
|
6545
6545
|
{
|
|
6546
|
-
className: `user-subscription-form-input${
|
|
6546
|
+
className: `user-subscription-form-input${m ? " error" : ""}`,
|
|
6547
6547
|
style: {
|
|
6548
6548
|
maxWidth: "100px"
|
|
6549
6549
|
},
|
|
6550
|
-
value:
|
|
6551
|
-
onChange: (
|
|
6550
|
+
value: B,
|
|
6551
|
+
onChange: (g) => q(g.target.value),
|
|
6552
6552
|
onBlur: () => o(C),
|
|
6553
|
-
"aria-invalid": !!
|
|
6553
|
+
"aria-invalid": !!m,
|
|
6554
6554
|
children: [
|
|
6555
6555
|
/* @__PURE__ */ a.jsx("option", { value: "", children: "+Code" }),
|
|
6556
|
-
Ju.map((
|
|
6556
|
+
Ju.map((g) => /* @__PURE__ */ a.jsx(
|
|
6557
6557
|
"option",
|
|
6558
6558
|
{
|
|
6559
|
-
value:
|
|
6560
|
-
children: `${
|
|
6559
|
+
value: g.countryCode,
|
|
6560
|
+
children: `${g.flag} ${g.countryCode}`
|
|
6561
6561
|
},
|
|
6562
|
-
|
|
6562
|
+
g.code
|
|
6563
6563
|
))
|
|
6564
6564
|
]
|
|
6565
6565
|
}
|
|
@@ -6567,13 +6567,13 @@ const U1 = ({
|
|
|
6567
6567
|
/* @__PURE__ */ a.jsx(
|
|
6568
6568
|
"input",
|
|
6569
6569
|
{
|
|
6570
|
-
className: `user-subscription-form-input${
|
|
6570
|
+
className: `user-subscription-form-input${m ? " error" : ""}`,
|
|
6571
6571
|
type: "tel",
|
|
6572
|
-
value:
|
|
6573
|
-
onChange: (
|
|
6572
|
+
value: I,
|
|
6573
|
+
onChange: (g) => P(g.target.value),
|
|
6574
6574
|
onBlur: () => o(C),
|
|
6575
6575
|
placeholder: C.label,
|
|
6576
|
-
"aria-invalid": !!
|
|
6576
|
+
"aria-invalid": !!m,
|
|
6577
6577
|
style: {
|
|
6578
6578
|
...C.color ? { borderColor: C.color } : {},
|
|
6579
6579
|
flex: 1
|
|
@@ -6583,43 +6583,43 @@ const U1 = ({
|
|
|
6583
6583
|
]
|
|
6584
6584
|
}
|
|
6585
6585
|
),
|
|
6586
|
-
|
|
6586
|
+
m && /* @__PURE__ */ a.jsx("div", { className: "user-subscription-error", children: r[C.key] })
|
|
6587
6587
|
] }, C.key);
|
|
6588
6588
|
}
|
|
6589
6589
|
return /* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form-field", children: [
|
|
6590
6590
|
/* @__PURE__ */ a.jsx(
|
|
6591
6591
|
"input",
|
|
6592
6592
|
{
|
|
6593
|
-
className: `user-subscription-form-input${
|
|
6594
|
-
type:
|
|
6595
|
-
value:
|
|
6593
|
+
className: `user-subscription-form-input${m ? " error" : ""}`,
|
|
6594
|
+
type: x,
|
|
6595
|
+
value: v || "",
|
|
6596
6596
|
onChange: (_) => d(C.key, _.target.value),
|
|
6597
6597
|
onBlur: () => o(C),
|
|
6598
6598
|
placeholder: C.label,
|
|
6599
|
-
"aria-invalid":
|
|
6599
|
+
"aria-invalid": m,
|
|
6600
6600
|
style: C.color ? { borderColor: C.color } : void 0
|
|
6601
6601
|
}
|
|
6602
6602
|
),
|
|
6603
|
-
|
|
6603
|
+
m && /* @__PURE__ */ a.jsx("div", { className: "user-subscription-error", children: r[C.key] })
|
|
6604
6604
|
] }, C.key);
|
|
6605
6605
|
},
|
|
6606
6606
|
[r, t, f, d, o]
|
|
6607
6607
|
), j = Mu(
|
|
6608
6608
|
(C) => {
|
|
6609
|
-
var
|
|
6609
|
+
var T;
|
|
6610
6610
|
if (!C.isDisplay) return null;
|
|
6611
|
-
const
|
|
6611
|
+
const v = f[C.key], x = c(C.key), m = !!r[C.key] && t[C.key];
|
|
6612
6612
|
if (C.key.toLowerCase().includes("phone")) {
|
|
6613
|
-
const _ =
|
|
6614
|
-
const
|
|
6613
|
+
const _ = v || "", B = ((T = Ju.find((g) => _.startsWith(g.countryCode))) == null ? void 0 : T.countryCode) || "+61", I = _.replace(/^\+?\d+\s?/, "").trim(), P = (g) => {
|
|
6614
|
+
const O = g.replace(/[^0-9\s]/g, "").trim();
|
|
6615
6615
|
d(
|
|
6616
6616
|
C.key,
|
|
6617
|
-
|
|
6617
|
+
O ? `${B} ${O}` : `${B} `
|
|
6618
6618
|
);
|
|
6619
|
-
},
|
|
6619
|
+
}, q = (g) => {
|
|
6620
6620
|
d(
|
|
6621
6621
|
C.key,
|
|
6622
|
-
|
|
6622
|
+
I ? `${g} ${I}` : `${g} `
|
|
6623
6623
|
);
|
|
6624
6624
|
};
|
|
6625
6625
|
return /* @__PURE__ */ a.jsxs("div", { className: "sc-message--contact-form-field", children: [
|
|
@@ -6641,19 +6641,19 @@ const U1 = ({
|
|
|
6641
6641
|
{
|
|
6642
6642
|
className: "sc-message--contact-form-input",
|
|
6643
6643
|
style: { maxWidth: "100px" },
|
|
6644
|
-
value:
|
|
6645
|
-
onChange: (
|
|
6644
|
+
value: B,
|
|
6645
|
+
onChange: (g) => q(g.target.value),
|
|
6646
6646
|
onBlur: () => o(C),
|
|
6647
|
-
"aria-invalid":
|
|
6647
|
+
"aria-invalid": m,
|
|
6648
6648
|
children: [
|
|
6649
6649
|
/* @__PURE__ */ a.jsx("option", { value: "", children: "+Code" }),
|
|
6650
|
-
Ju.map((
|
|
6650
|
+
Ju.map((g) => /* @__PURE__ */ a.jsx(
|
|
6651
6651
|
"option",
|
|
6652
6652
|
{
|
|
6653
|
-
value:
|
|
6654
|
-
children: `${
|
|
6653
|
+
value: g.countryCode,
|
|
6654
|
+
children: `${g.flag} ${g.countryCode}`
|
|
6655
6655
|
},
|
|
6656
|
-
|
|
6656
|
+
g.code
|
|
6657
6657
|
))
|
|
6658
6658
|
]
|
|
6659
6659
|
}
|
|
@@ -6663,23 +6663,23 @@ const U1 = ({
|
|
|
6663
6663
|
{
|
|
6664
6664
|
id: `contact-${C.key}`,
|
|
6665
6665
|
type: "tel",
|
|
6666
|
-
value:
|
|
6667
|
-
onChange: (
|
|
6666
|
+
value: I,
|
|
6667
|
+
onChange: (g) => P(g.target.value),
|
|
6668
6668
|
onBlur: () => o(C),
|
|
6669
6669
|
placeholder: "",
|
|
6670
|
-
className: `sc-message--contact-form-input ${
|
|
6671
|
-
"aria-invalid":
|
|
6670
|
+
className: `sc-message--contact-form-input ${m ? "error" : ""}`,
|
|
6671
|
+
"aria-invalid": m,
|
|
6672
6672
|
style: {
|
|
6673
6673
|
...C.color ? { borderColor: C.color } : {},
|
|
6674
6674
|
flex: 1,
|
|
6675
|
-
...
|
|
6675
|
+
...m ? { borderColor: "#ff4444" } : {}
|
|
6676
6676
|
}
|
|
6677
6677
|
}
|
|
6678
6678
|
)
|
|
6679
6679
|
]
|
|
6680
6680
|
}
|
|
6681
6681
|
),
|
|
6682
|
-
|
|
6682
|
+
m && /* @__PURE__ */ a.jsx(
|
|
6683
6683
|
"div",
|
|
6684
6684
|
{
|
|
6685
6685
|
style: {
|
|
@@ -6705,20 +6705,20 @@ const U1 = ({
|
|
|
6705
6705
|
"input",
|
|
6706
6706
|
{
|
|
6707
6707
|
id: `contact-${C.key}`,
|
|
6708
|
-
type:
|
|
6709
|
-
value:
|
|
6708
|
+
type: x,
|
|
6709
|
+
value: v || "",
|
|
6710
6710
|
onChange: (_) => d(C.key, _.target.value),
|
|
6711
6711
|
onBlur: () => o(C),
|
|
6712
6712
|
placeholder: "",
|
|
6713
|
-
className: `sc-message--contact-form-input ${
|
|
6714
|
-
"aria-invalid":
|
|
6713
|
+
className: `sc-message--contact-form-input ${m ? "error" : ""}`,
|
|
6714
|
+
"aria-invalid": m,
|
|
6715
6715
|
style: {
|
|
6716
6716
|
...C.color ? { borderColor: C.color } : {},
|
|
6717
|
-
...
|
|
6717
|
+
...m ? { borderColor: "#ff4444" } : {}
|
|
6718
6718
|
}
|
|
6719
6719
|
}
|
|
6720
6720
|
),
|
|
6721
|
-
|
|
6721
|
+
m && /* @__PURE__ */ a.jsx(
|
|
6722
6722
|
"div",
|
|
6723
6723
|
{
|
|
6724
6724
|
style: {
|
|
@@ -6740,11 +6740,11 @@ const U1 = ({
|
|
|
6740
6740
|
o
|
|
6741
6741
|
]
|
|
6742
6742
|
), y = Mu((C) => {
|
|
6743
|
-
const
|
|
6744
|
-
return C.filter((
|
|
6745
|
-
const
|
|
6746
|
-
|
|
6747
|
-
}), s((
|
|
6743
|
+
const v = {};
|
|
6744
|
+
return C.filter((x) => x.isDisplay).forEach((x) => {
|
|
6745
|
+
const m = f[x.key];
|
|
6746
|
+
v[x.key] = F(x, m);
|
|
6747
|
+
}), s((x) => ({ ...x, ...v })), C.filter((x) => x.isDisplay && x.isRequired).every((x) => v[x.key] === "");
|
|
6748
6748
|
}, [f, F]);
|
|
6749
6749
|
return {
|
|
6750
6750
|
formData: f,
|
|
@@ -6777,108 +6777,108 @@ const xt = ({
|
|
|
6777
6777
|
onSubmit: u,
|
|
6778
6778
|
onFormStateChange: D
|
|
6779
6779
|
}) => {
|
|
6780
|
-
const { colors: f } = ou(), e = Wu(), t =
|
|
6780
|
+
const { colors: f } = ou(), e = Wu(), t = pu(), { socket: n } = Gu(), { setScreen: r } = Nu();
|
|
6781
6781
|
zu();
|
|
6782
|
-
const { setIsOfflineMode: s, send: F, participants: d, setMessages: o, setParticipants: c, setConnectionState: l } = Cu(), { formData: j, renderContactFormField: y, errors: C, validateAll:
|
|
6782
|
+
const { setIsOfflineMode: s, send: F, participants: d, setMessages: o, setParticipants: c, setConnectionState: l } = Cu(), { formData: j, renderContactFormField: y, errors: C, validateAll: v } = U1({
|
|
6783
6783
|
initialData: {},
|
|
6784
6784
|
loadFromDataUserSubs: !0
|
|
6785
|
-
}), [
|
|
6785
|
+
}), [x, m] = U(!1), [T, _] = U(!1);
|
|
6786
6786
|
X(() => {
|
|
6787
|
-
D &&
|
|
6788
|
-
}, [
|
|
6789
|
-
const
|
|
6790
|
-
var
|
|
6791
|
-
if (
|
|
6792
|
-
|
|
6787
|
+
D && !T && D(!0), D && T && D(!1);
|
|
6788
|
+
}, [T]);
|
|
6789
|
+
const B = async (P) => {
|
|
6790
|
+
var g;
|
|
6791
|
+
if (P.preventDefault(), !!v(t.formSettings)) {
|
|
6792
|
+
m(!0);
|
|
6793
6793
|
try {
|
|
6794
|
-
const
|
|
6794
|
+
const O = {};
|
|
6795
6795
|
t.formSettings.forEach((E) => {
|
|
6796
6796
|
var h;
|
|
6797
|
-
E.isDisplay && j[E.key] !== void 0 && (
|
|
6797
|
+
E.isDisplay && j[E.key] !== void 0 && (O[E.key] = ((h = j[E.key]) == null ? void 0 : h.toString().trim()) || "");
|
|
6798
6798
|
});
|
|
6799
|
-
const
|
|
6799
|
+
const $ = At(O);
|
|
6800
6800
|
if (!uu.getItem("profileLiveChat"))
|
|
6801
6801
|
try {
|
|
6802
6802
|
const E = new URLSearchParams();
|
|
6803
|
-
Object.entries(
|
|
6804
|
-
typeof
|
|
6803
|
+
Object.entries($).forEach(([M, V]) => {
|
|
6804
|
+
typeof V == "string" && V && E.append(M, V);
|
|
6805
6805
|
}), E.append("owner_id", e.ownerId), E.append("contactLateTime", (/* @__PURE__ */ new Date()).toISOString());
|
|
6806
|
-
const { body: h } = await n.get(`/webhook/${e.channel}/?${E.toString()}`), { messages:
|
|
6807
|
-
uu.setItem("profileLiveChat",
|
|
6806
|
+
const { body: h } = await n.get(`/webhook/${e.channel}/?${E.toString()}`), { messages: A, profile: p } = h;
|
|
6807
|
+
uu.setItem("profileLiveChat", p), uu.setItem("isOffline", !1), uu.setItem(
|
|
6808
6808
|
"submitedFormLateTime",
|
|
6809
|
-
(
|
|
6810
|
-
),
|
|
6811
|
-
const
|
|
6812
|
-
M.direction =
|
|
6813
|
-
}), o(
|
|
6809
|
+
(p == null ? void 0 : p.submitedFormLateTime) || null
|
|
6810
|
+
), A.forEach((M) => {
|
|
6811
|
+
const V = M.author === p.foreignId || M.author === p.id ? Q.sent : Q.received;
|
|
6812
|
+
M.direction = V, M.direction === Q.sent && (M.read = !0, M.delivery = !1);
|
|
6813
|
+
}), o(A), c([
|
|
6814
6814
|
d[0],
|
|
6815
6815
|
{
|
|
6816
|
-
id:
|
|
6817
|
-
foreign_id:
|
|
6818
|
-
name: `${
|
|
6816
|
+
id: p.foreignId,
|
|
6817
|
+
foreign_id: p.foreignId,
|
|
6818
|
+
name: `${p.firstName} ${p.lastName}`
|
|
6819
6819
|
}
|
|
6820
6820
|
]), l(3), r("chat"), _(!0);
|
|
6821
|
-
const
|
|
6822
|
-
text: Object.entries(
|
|
6823
|
-
([M,
|
|
6821
|
+
const N = {
|
|
6822
|
+
text: Object.entries($).map(
|
|
6823
|
+
([M, V]) => `${M.charAt(0).toUpperCase() + M.slice(1)}: ${V}`
|
|
6824
6824
|
).join(`
|
|
6825
6825
|
`),
|
|
6826
6826
|
contactInfo: {
|
|
6827
|
-
|
|
6827
|
+
...$,
|
|
6828
6828
|
owner_id: e.ownerId
|
|
6829
6829
|
},
|
|
6830
6830
|
contactLateTime: /* @__PURE__ */ new Date()
|
|
6831
6831
|
};
|
|
6832
6832
|
F({
|
|
6833
|
-
event:
|
|
6833
|
+
event: P,
|
|
6834
6834
|
source: "contact-form",
|
|
6835
6835
|
data: {
|
|
6836
6836
|
type: Au.text,
|
|
6837
|
-
data:
|
|
6838
|
-
author:
|
|
6837
|
+
data: N,
|
|
6838
|
+
author: p.foreignId
|
|
6839
6839
|
}
|
|
6840
|
-
}), s(!0), u && u(
|
|
6840
|
+
}), s(!0), u && u(O.name, O.phone);
|
|
6841
6841
|
return;
|
|
6842
6842
|
} catch (E) {
|
|
6843
6843
|
console.error("Error in subscription flow:", E);
|
|
6844
6844
|
}
|
|
6845
|
-
const
|
|
6846
|
-
text: Object.entries(
|
|
6845
|
+
const k = {
|
|
6846
|
+
text: Object.entries($).map(
|
|
6847
6847
|
([E, h]) => `${E.charAt(0).toUpperCase() + E.slice(1)}: ${h}`
|
|
6848
6848
|
).join(`
|
|
6849
6849
|
`),
|
|
6850
6850
|
contactInfo: {
|
|
6851
|
-
|
|
6851
|
+
...$,
|
|
6852
6852
|
owner_id: e.ownerId
|
|
6853
6853
|
},
|
|
6854
6854
|
contactLateTime: /* @__PURE__ */ new Date()
|
|
6855
6855
|
};
|
|
6856
6856
|
F({
|
|
6857
|
-
event:
|
|
6857
|
+
event: P,
|
|
6858
6858
|
source: "contact-form",
|
|
6859
6859
|
data: {
|
|
6860
6860
|
type: Au.text,
|
|
6861
|
-
data:
|
|
6862
|
-
author: (
|
|
6861
|
+
data: k,
|
|
6862
|
+
author: (g = d[1]) == null ? void 0 : g.id
|
|
6863
6863
|
}
|
|
6864
|
-
}), _(!0), s(!0), u && u(
|
|
6865
|
-
} catch (
|
|
6866
|
-
console.error("Error sending contact form to webhook:",
|
|
6864
|
+
}), _(!0), s(!0), u && u(O.name, O.phone);
|
|
6865
|
+
} catch (O) {
|
|
6866
|
+
console.error("Error sending contact form to webhook:", O);
|
|
6867
6867
|
} finally {
|
|
6868
|
-
|
|
6868
|
+
m(!1);
|
|
6869
6869
|
}
|
|
6870
6870
|
}
|
|
6871
|
-
},
|
|
6872
|
-
return
|
|
6871
|
+
}, I = f[Q.received];
|
|
6872
|
+
return T ? null : /* @__PURE__ */ a.jsx(
|
|
6873
6873
|
"div",
|
|
6874
6874
|
{
|
|
6875
6875
|
className: "sc-message--contact-form",
|
|
6876
6876
|
style: {
|
|
6877
|
-
color:
|
|
6878
|
-
backgroundColor:
|
|
6877
|
+
color: I.text,
|
|
6878
|
+
backgroundColor: I.bg
|
|
6879
6879
|
},
|
|
6880
|
-
children: /* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-content", children: /* @__PURE__ */ a.jsxs("form", { onSubmit:
|
|
6881
|
-
t.formSettings.sort((
|
|
6880
|
+
children: /* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-content", children: /* @__PURE__ */ a.jsxs("form", { onSubmit: B, className: "sc-message--contact-form-form", noValidate: !0, children: [
|
|
6881
|
+
t.formSettings.sort((P, q) => P.order - q.order).map(y),
|
|
6882
6882
|
/* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-authorization", children: /* @__PURE__ */ a.jsx(
|
|
6883
6883
|
"a",
|
|
6884
6884
|
{
|
|
@@ -6899,7 +6899,7 @@ const xt = ({
|
|
|
6899
6899
|
color: f.header.text,
|
|
6900
6900
|
width: "40%"
|
|
6901
6901
|
},
|
|
6902
|
-
disabled:
|
|
6902
|
+
disabled: x || Object.values(C).some((P) => P !== ""),
|
|
6903
6903
|
children: "Send"
|
|
6904
6904
|
}
|
|
6905
6905
|
)
|
|
@@ -6910,7 +6910,7 @@ const xt = ({
|
|
|
6910
6910
|
message: u,
|
|
6911
6911
|
onFormSubmitted: D
|
|
6912
6912
|
}) => {
|
|
6913
|
-
const { colors: f } = ou(), { setIsContactFormActive: e } = Cu(), t =
|
|
6913
|
+
const { colors: f } = ou(), { setIsContactFormActive: e } = Cu(), t = mu(null);
|
|
6914
6914
|
X(() => {
|
|
6915
6915
|
n();
|
|
6916
6916
|
}, [u]);
|
|
@@ -7000,7 +7000,7 @@ const xt = ({
|
|
|
7000
7000
|
};
|
|
7001
7001
|
j1.extend(He);
|
|
7002
7002
|
const St = ({ message: u, Avatar: D }) => {
|
|
7003
|
-
const { participants: f } = Cu(), { colors: e } = ou(), [t, n] =
|
|
7003
|
+
const { participants: f } = Cu(), { colors: e } = ou(), [t, n] = U(!1), [r, s] = U(!1), F = pu(), d = u.data && "text" in u.data && "isShowForm" in u.data && u.data.isShowForm, o = f.find(
|
|
7004
7004
|
(j) => j.id === u.author
|
|
7005
7005
|
) || {
|
|
7006
7006
|
name: "Anon"
|
|
@@ -7075,7 +7075,7 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7075
7075
|
phone: D
|
|
7076
7076
|
}) => {
|
|
7077
7077
|
const { colors: f } = ou(), e = f[Q.received];
|
|
7078
|
-
|
|
7078
|
+
pu();
|
|
7079
7079
|
const { participants: t } = Cu(), n = t.find(
|
|
7080
7080
|
(r) => r.id === "chatbot"
|
|
7081
7081
|
) || {
|
|
@@ -7105,9 +7105,9 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7105
7105
|
/* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-phone-display", children: /* @__PURE__ */ a.jsx(
|
|
7106
7106
|
"a",
|
|
7107
7107
|
{
|
|
7108
|
-
href:
|
|
7108
|
+
href: `tel:${D}`,
|
|
7109
7109
|
className: "sc-message--contact-form-phone-link",
|
|
7110
|
-
children:
|
|
7110
|
+
children: D
|
|
7111
7111
|
}
|
|
7112
7112
|
) }),
|
|
7113
7113
|
/* @__PURE__ */ a.jsxs("div", { className: "sc-message--contact-form-response-text", children: [
|
|
@@ -7119,37 +7119,28 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7119
7119
|
) })
|
|
7120
7120
|
] }) });
|
|
7121
7121
|
}, Ot = ({ Avatar: u }) => {
|
|
7122
|
-
const { scroll: D, setScroll: f, isOpen: e } = Nu(), { messages: t, showTypingIndicator: n, setNewIOMessage: r, setMessages: s } = Cu(), F =
|
|
7123
|
-
if (!("text" in
|
|
7124
|
-
const
|
|
7125
|
-
`).map((
|
|
7126
|
-
(
|
|
7122
|
+
const { scroll: D, setScroll: f, isOpen: e } = Nu(), { messages: t, showTypingIndicator: n, setNewIOMessage: r, setMessages: s } = Cu(), F = pu(), { colors: d } = ou(), { formSettings: o } = pu(), [c, l] = U(""), j = F.offline_mode, y = kD(j), C = (T) => {
|
|
7123
|
+
if (!("text" in T.data)) return !1;
|
|
7124
|
+
const _ = T.data.text || "", B = (g) => g.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9_]/g, ""), I = _.split(`
|
|
7125
|
+
`).map((g) => g.trim()), P = new Set(
|
|
7126
|
+
I.map((g) => g.split(":")[0] || "").map((g) => B(g))
|
|
7127
|
+
), q = o == null ? void 0 : o.filter(
|
|
7128
|
+
(g) => g.isDisplay && g.isRequired
|
|
7127
7129
|
);
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
return A.trim();
|
|
7131
|
-
}, N = (p) => {
|
|
7132
|
-
if (!("text" in p.data)) return !1;
|
|
7133
|
-
const R = p.data.text || "", x = (v) => v.toLowerCase().replace(/\s+/g, "").replace(/[^a-z0-9_]/g, ""), V = R.split(`
|
|
7134
|
-
`).map((v) => v.trim()), m = new Set(
|
|
7135
|
-
V.map((v) => v.split(":")[0] || "").map((v) => x(v))
|
|
7136
|
-
), A = o == null ? void 0 : o.filter(
|
|
7137
|
-
(v) => v.isDisplay && v.isRequired
|
|
7130
|
+
return q == null ? void 0 : q.every(
|
|
7131
|
+
(g) => P.has(B(g.label)) || P.has(B(g.key))
|
|
7138
7132
|
);
|
|
7139
|
-
|
|
7140
|
-
(v) => m.has(x(v.label)) || m.has(x(v.key))
|
|
7141
|
-
);
|
|
7142
|
-
}, B = pu(null), [$, _] = z();
|
|
7133
|
+
}, v = mu(null), [x, m] = U();
|
|
7143
7134
|
return X(() => {
|
|
7144
|
-
const
|
|
7145
|
-
if (
|
|
7146
|
-
const
|
|
7147
|
-
100 *
|
|
7135
|
+
const T = (_) => {
|
|
7136
|
+
if (v.current) {
|
|
7137
|
+
const B = Math.round(
|
|
7138
|
+
100 * v.current.scrollTop / (v.current.scrollHeight || 1)
|
|
7148
7139
|
);
|
|
7149
|
-
(Math.abs(
|
|
7150
|
-
|
|
7140
|
+
(Math.abs(B - _) > 1 || _ === 100) && requestAnimationFrame(() => {
|
|
7141
|
+
v.current && v.current.scrollTo({
|
|
7151
7142
|
top: Math.round(
|
|
7152
|
-
|
|
7143
|
+
_ * v.current.scrollHeight / 100
|
|
7153
7144
|
),
|
|
7154
7145
|
behavior: "instant",
|
|
7155
7146
|
left: 0
|
|
@@ -7158,15 +7149,20 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7158
7149
|
}
|
|
7159
7150
|
};
|
|
7160
7151
|
e && setTimeout(() => {
|
|
7161
|
-
|
|
7152
|
+
T(D);
|
|
7162
7153
|
}, 100);
|
|
7163
7154
|
}, [D, e]), X(() => {
|
|
7164
|
-
const
|
|
7165
|
-
const
|
|
7166
|
-
|
|
7155
|
+
const T = () => {
|
|
7156
|
+
const B = uu.getItem("profileLiveChat") || {};
|
|
7157
|
+
if (B.mobile) {
|
|
7158
|
+
const q = B.mobile, O = `${B.countryCode || "+61"} ${q}`;
|
|
7159
|
+
l(O);
|
|
7160
|
+
}
|
|
7161
|
+
const I = uu.getItem("submitedFormLateTime") || B.submitedFormLateTime, P = t.some(
|
|
7162
|
+
(q) => q.data && "isShowForm" in q.data && q.data.isShowForm
|
|
7167
7163
|
);
|
|
7168
|
-
if (
|
|
7169
|
-
const
|
|
7164
|
+
if (y && !I && !P) {
|
|
7165
|
+
const q = {
|
|
7170
7166
|
mid: `show-text-${Date.now()}`,
|
|
7171
7167
|
author: "system",
|
|
7172
7168
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -7182,7 +7178,7 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7182
7178
|
handover: !1,
|
|
7183
7179
|
isOffline: !0,
|
|
7184
7180
|
submitedFormLateTime: null
|
|
7185
|
-
},
|
|
7181
|
+
}, g = {
|
|
7186
7182
|
mid: `show-form-${Date.now()}`,
|
|
7187
7183
|
author: "user",
|
|
7188
7184
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -7199,39 +7195,32 @@ const St = ({ message: u, Avatar: D }) => {
|
|
|
7199
7195
|
isOffline: !0,
|
|
7200
7196
|
submitedFormLateTime: null
|
|
7201
7197
|
};
|
|
7202
|
-
|
|
7198
|
+
B.id ? s([...t]) : s([...t, q, g]);
|
|
7203
7199
|
}
|
|
7204
7200
|
};
|
|
7205
|
-
|
|
7206
|
-
const
|
|
7207
|
-
(
|
|
7201
|
+
T();
|
|
7202
|
+
const _ = (B) => {
|
|
7203
|
+
(B.key === "isOffline" || B.key === "submitedFormLateTime") && T();
|
|
7208
7204
|
};
|
|
7209
|
-
return window.addEventListener("storage",
|
|
7210
|
-
window.removeEventListener("storage",
|
|
7205
|
+
return window.addEventListener("storage", _), () => {
|
|
7206
|
+
window.removeEventListener("storage", _);
|
|
7211
7207
|
};
|
|
7212
|
-
}, [
|
|
7208
|
+
}, [y]), X(() => {
|
|
7213
7209
|
r(t[t.length - 1]);
|
|
7214
7210
|
}, []), X(() => {
|
|
7215
|
-
const
|
|
7216
|
-
(
|
|
7217
|
-
for (let R = t.length - 1; R >= 0; R--) {
|
|
7218
|
-
const x = T(t[R]);
|
|
7219
|
-
if (x && x !== j.current) {
|
|
7220
|
-
j.current = x, l(x);
|
|
7221
|
-
break;
|
|
7222
|
-
}
|
|
7223
|
-
}
|
|
7211
|
+
const T = t[t.length - 1];
|
|
7212
|
+
(x == null ? void 0 : x.mid) !== (T == null ? void 0 : T.mid) && (m(T), f(100));
|
|
7224
7213
|
}, [t]), /* @__PURE__ */ a.jsxs(
|
|
7225
7214
|
"div",
|
|
7226
7215
|
{
|
|
7227
7216
|
className: "sc-message-list",
|
|
7228
|
-
ref:
|
|
7217
|
+
ref: v,
|
|
7229
7218
|
style: { backgroundColor: d.messageList.bg },
|
|
7230
7219
|
children: [
|
|
7231
|
-
t.map((
|
|
7232
|
-
/* @__PURE__ */ a.jsx(St, { message:
|
|
7233
|
-
|
|
7234
|
-
] },
|
|
7220
|
+
t.map((T) => /* @__PURE__ */ a.jsxs(af.Fragment, { children: [
|
|
7221
|
+
/* @__PURE__ */ a.jsx(St, { message: T, Avatar: u }),
|
|
7222
|
+
C(T) && y && /* @__PURE__ */ a.jsx(Nt, { phone: c })
|
|
7223
|
+
] }, T.mid)),
|
|
7235
7224
|
n && /* @__PURE__ */ a.jsx(Tt, {})
|
|
7236
7225
|
]
|
|
7237
7226
|
}
|
|
@@ -7258,26 +7247,26 @@ var nf = { exports: {} };
|
|
|
7258
7247
|
var r = this;
|
|
7259
7248
|
r.init_emoticons();
|
|
7260
7249
|
var s = 0, F = [], d = n.replace(r.rx_emoticons, function(l, j, y, C) {
|
|
7261
|
-
var
|
|
7250
|
+
var v = s;
|
|
7262
7251
|
s = C + l.length;
|
|
7263
|
-
var
|
|
7264
|
-
if ((
|
|
7265
|
-
var
|
|
7266
|
-
if (
|
|
7252
|
+
var x = y.indexOf("(") !== -1, m = y.indexOf(")") !== -1;
|
|
7253
|
+
if ((x || m) && F.indexOf(y) == -1 && F.push(y), m && !x) {
|
|
7254
|
+
var T = n.substring(v, C);
|
|
7255
|
+
if (T.indexOf("(") !== -1 && T.indexOf(")") === -1) return l;
|
|
7267
7256
|
}
|
|
7268
7257
|
if (l === `
|
|
7269
7258
|
8)`) {
|
|
7270
7259
|
var _ = n.substring(0, C);
|
|
7271
7260
|
if (/\n?(6\)|7\))/.test(_)) return l;
|
|
7272
7261
|
}
|
|
7273
|
-
var
|
|
7274
|
-
return
|
|
7262
|
+
var B = r.data[r.map.emoticons[y]][3][0];
|
|
7263
|
+
return B ? j + ":" + B + ":" : l;
|
|
7275
7264
|
});
|
|
7276
7265
|
if (F.length) {
|
|
7277
7266
|
var o = F.map(r.escape_rx), c = new RegExp("(\\(.+)(" + o.join("|") + ")(.+\\))", "g");
|
|
7278
7267
|
d = d.replace(c, function(l, j, y, C) {
|
|
7279
|
-
var
|
|
7280
|
-
return
|
|
7268
|
+
var v = r.data[r.map.emoticons[y]][3][0];
|
|
7269
|
+
return v ? j + ":" + v + ":" + C : l;
|
|
7281
7270
|
});
|
|
7282
7271
|
}
|
|
7283
7272
|
return d;
|
|
@@ -7343,12 +7332,12 @@ var nf = { exports: {} };
|
|
|
7343
7332
|
if (o.init_env(), o.replace_mode == "softbank" && o.allow_native && o.data[n][1]) return o.format_native(o.data[n][1] + c, !d);
|
|
7344
7333
|
if (o.replace_mode == "google" && o.allow_native && o.data[n][2]) return o.format_native(o.data[n][2] + c, !d);
|
|
7345
7334
|
if (y.is_var && (c = ""), o.replace_mode == "unified" && o.allow_native) return o.format_native(y.unified + c, !d);
|
|
7346
|
-
var C = o.include_title ? ' title="' + (r || o.data[n][3][0]) + '"' : "",
|
|
7347
|
-
if (o.data[n][7] && (y.path = o.data[n][7], y.px = null, y.py = null, y.is_var = !1), y.is_var && o.include_text && F && F.actual && F.wrapper && (
|
|
7335
|
+
var C = o.include_title ? ' title="' + (r || o.data[n][3][0]) + '"' : "", v = o.include_text ? s + (r || o.data[n][3][0]) + s : "";
|
|
7336
|
+
if (o.data[n][7] && (y.path = o.data[n][7], y.px = null, y.py = null, y.is_var = !1), y.is_var && o.include_text && F && F.actual && F.wrapper && (v += F.wrapper + F.actual + F.wrapper), o.replace_mode == "css")
|
|
7348
7337
|
if (o.use_sheet && y.px != null && y.py != null) {
|
|
7349
|
-
var
|
|
7350
|
-
return '<span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="' + _ + '"' + C + ' data-codepoints="' + y.full_idx + '">' +
|
|
7351
|
-
} else return o.use_css_imgs ? '<span class="emoji emoji-' + n + '"' + C + ' data-codepoints="' + y.full_idx + '">' +
|
|
7338
|
+
var x = 100 * y.px / (o.sheet_size - 1), m = 100 * y.py / (o.sheet_size - 1), T = 100 * o.sheet_size, _ = "background: url(" + y.sheet + ");background-position:" + x + "% " + m + "%;background-size:" + T + "% " + T + "%";
|
|
7339
|
+
return '<span class="emoji-outer emoji-sizer"><span class="emoji-inner" style="' + _ + '"' + C + ' data-codepoints="' + y.full_idx + '">' + v + "</span></span>" + c;
|
|
7340
|
+
} else return o.use_css_imgs ? '<span class="emoji emoji-' + n + '"' + C + ' data-codepoints="' + y.full_idx + '">' + v + "</span>" + c : '<span class="emoji emoji-sizer" style="background-image:url(' + y.path + ')"' + C + ' data-codepoints="' + y.full_idx + '">' + v + "</span>" + c;
|
|
7352
7341
|
return '<img src="' + y.path + '" class="emoji" data-codepoints="' + y.full_idx + '" ' + C + "/>" + c;
|
|
7353
7342
|
}, t.prototype.format_native = function(n, r) {
|
|
7354
7343
|
var s = this;
|
|
@@ -10483,7 +10472,7 @@ const Pt = /* @__PURE__ */ sf(Rt), It = [
|
|
|
10483
10472
|
]
|
|
10484
10473
|
}
|
|
10485
10474
|
], Lt = ({ onBlur: u, onSelect: D }) => {
|
|
10486
|
-
const f =
|
|
10475
|
+
const f = mu(new Pt()), e = mu(null);
|
|
10487
10476
|
X(() => {
|
|
10488
10477
|
const n = e.current;
|
|
10489
10478
|
n && (n.style.opacity = "0", window.requestAnimationFrame(() => {
|
|
@@ -10529,7 +10518,7 @@ const Pt = /* @__PURE__ */ sf(Rt), It = [
|
|
|
10529
10518
|
]
|
|
10530
10519
|
}
|
|
10531
10520
|
), Mt = ({ inputRef: u, onInput: D }) => {
|
|
10532
|
-
const [f, e] =
|
|
10521
|
+
const [f, e] = U(!1), t = mu(null), n = () => {
|
|
10533
10522
|
e(!f);
|
|
10534
10523
|
}, r = (d) => {
|
|
10535
10524
|
(!d.relatedTarget || d.relatedTarget !== t.current) && n();
|
|
@@ -10666,7 +10655,7 @@ const Pt = /* @__PURE__ */ sf(Rt), It = [
|
|
|
10666
10655
|
children: /* @__PURE__ */ a.jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7m0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5" })
|
|
10667
10656
|
}
|
|
10668
10657
|
), Vt = () => {
|
|
10669
|
-
const { setPayload: u, send: D } = Cu(), f =
|
|
10658
|
+
const { setPayload: u, send: D } = Cu(), f = pu(), e = (t) => {
|
|
10670
10659
|
navigator.geolocation ? navigator.geolocation.getCurrentPosition(
|
|
10671
10660
|
(n) => {
|
|
10672
10661
|
u({
|
|
@@ -10726,11 +10715,11 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10726
10715
|
}
|
|
10727
10716
|
) });
|
|
10728
10717
|
}, Wt = () => {
|
|
10729
|
-
const u =
|
|
10718
|
+
const u = pu(), { send: D, setPayload: f } = Cu(), [e, t] = U({
|
|
10730
10719
|
title: "Menu",
|
|
10731
10720
|
type: rf.nested,
|
|
10732
10721
|
call_to_actions: (u == null ? void 0 : u.menu) || []
|
|
10733
|
-
}), n =
|
|
10722
|
+
}), n = mu(null);
|
|
10734
10723
|
X(() => {
|
|
10735
10724
|
t({
|
|
10736
10725
|
title: "Menu",
|
|
@@ -10790,7 +10779,7 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10790
10779
|
}
|
|
10791
10780
|
);
|
|
10792
10781
|
}, Jt = () => {
|
|
10793
|
-
const { setPayload: u, send: D, suggestions: f } = Cu(), e =
|
|
10782
|
+
const { setPayload: u, send: D, suggestions: f } = Cu(), e = pu(), { colors: t } = ou(), n = (r, s) => {
|
|
10794
10783
|
u(s), D({
|
|
10795
10784
|
event: r,
|
|
10796
10785
|
source: "quick-reply",
|
|
@@ -10834,52 +10823,52 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10834
10823
|
menu: j,
|
|
10835
10824
|
focusOnOpen: y,
|
|
10836
10825
|
autoFlush: C,
|
|
10837
|
-
allowedUploadTypes:
|
|
10838
|
-
showEmoji:
|
|
10839
|
-
showLocation:
|
|
10840
|
-
showFile:
|
|
10826
|
+
allowedUploadTypes: v,
|
|
10827
|
+
showEmoji: x,
|
|
10828
|
+
showLocation: m,
|
|
10829
|
+
showFile: T,
|
|
10841
10830
|
placeholder: _
|
|
10842
|
-
} =
|
|
10831
|
+
} = pu(), B = mu(null), [I, P] = U(null), [q, g] = U(!1), [O, $] = U(!1), [hu, fu] = U(!1);
|
|
10843
10832
|
X(() => {
|
|
10844
|
-
y &&
|
|
10833
|
+
y && p();
|
|
10845
10834
|
}, [t, y]), X(() => {
|
|
10846
|
-
t === "" &&
|
|
10835
|
+
t === "" && B.current && (B.current.innerHTML = "", B.current.innerText = "");
|
|
10847
10836
|
}, [t]), X(() => {
|
|
10848
|
-
|
|
10837
|
+
P(null);
|
|
10849
10838
|
}, [r]);
|
|
10850
|
-
const
|
|
10851
|
-
s(null),
|
|
10839
|
+
const k = () => {
|
|
10840
|
+
s(null), P(null);
|
|
10852
10841
|
}, E = () => {
|
|
10853
10842
|
var Z, tu;
|
|
10854
10843
|
if (hu) {
|
|
10855
10844
|
console.log("handleInput called but isClearing is true, ignoring");
|
|
10856
10845
|
return;
|
|
10857
10846
|
}
|
|
10858
|
-
const
|
|
10859
|
-
n(
|
|
10860
|
-
}, h = (
|
|
10861
|
-
if (
|
|
10847
|
+
const z = ((Z = B.current) == null ? void 0 : Z.innerText) || ((tu = B.current) == null ? void 0 : tu.textContent) || "";
|
|
10848
|
+
n(z);
|
|
10849
|
+
}, h = (z, Z = "send-button") => {
|
|
10850
|
+
if (O) {
|
|
10862
10851
|
console.log("Already sending, ignoring duplicate call");
|
|
10863
10852
|
return;
|
|
10864
10853
|
}
|
|
10865
10854
|
if (t) {
|
|
10866
|
-
|
|
10855
|
+
$(!0);
|
|
10867
10856
|
const tu = t;
|
|
10868
10857
|
F({
|
|
10869
|
-
event:
|
|
10858
|
+
event: z,
|
|
10870
10859
|
source: Z,
|
|
10871
10860
|
data: {
|
|
10872
10861
|
type: Au.text,
|
|
10873
10862
|
data: { text: tu }
|
|
10874
10863
|
}
|
|
10875
10864
|
}), C ? (console.log("autoFlush is true, clearing message state and input"), n(""), setTimeout(() => {
|
|
10876
|
-
fu(!0),
|
|
10877
|
-
|
|
10865
|
+
fu(!0), B.current ? (B.current.innerHTML = "", B.current.innerText = "", B.current.textContent = "", B.current.innerHTML = " ", setTimeout(() => {
|
|
10866
|
+
B.current && (B.current.innerHTML = ""), fu(!1);
|
|
10878
10867
|
}, 1)) : fu(!1);
|
|
10879
|
-
}, 10)) : console.log("autoFlush is false, keeping message"), setTimeout(() =>
|
|
10868
|
+
}, 10)) : console.log("autoFlush is false, keeping message"), setTimeout(() => $(!1), 1e3);
|
|
10880
10869
|
}
|
|
10881
|
-
r && (
|
|
10882
|
-
event:
|
|
10870
|
+
r && (P(null), v.includes(r.type) || !1 ? r.size > u ? P(D("messages.file_message.unsupported_file_size")) : (F({
|
|
10871
|
+
event: z,
|
|
10883
10872
|
source: Z,
|
|
10884
10873
|
data: {
|
|
10885
10874
|
type: Au.file,
|
|
@@ -10890,18 +10879,18 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10890
10879
|
file: r
|
|
10891
10880
|
}
|
|
10892
10881
|
}
|
|
10893
|
-
}), C && s(null)) :
|
|
10894
|
-
},
|
|
10895
|
-
|
|
10896
|
-
},
|
|
10897
|
-
var
|
|
10898
|
-
(
|
|
10899
|
-
},
|
|
10900
|
-
return (M || !(
|
|
10882
|
+
}), C && s(null)) : P(D("messages.file_message.unsupported_file_type")));
|
|
10883
|
+
}, A = (z) => {
|
|
10884
|
+
z.key === "Enter" && !z.shiftKey && (z.preventDefault(), z.stopPropagation(), h(z, "enter-key"));
|
|
10885
|
+
}, p = () => {
|
|
10886
|
+
var z;
|
|
10887
|
+
(z = B.current) == null || z.focus();
|
|
10888
|
+
}, R = d === iD.uploading, N = uu.getItem("profileLiveChat") || {}, M = uu.getItem("isOffline") || (N == null ? void 0 : N.isOffline), V = ((J = N == null ? void 0 : N.channel) == null ? void 0 : J.name) === "console-channel";
|
|
10889
|
+
return (M || !(N != null && N.id)) && !V ? null : /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
10901
10890
|
j.length > 0 && /* @__PURE__ */ a.jsx(Wt, {}),
|
|
10902
10891
|
/* @__PURE__ */ a.jsxs("div", { className: "sc-user-input-wrapper", children: [
|
|
10903
10892
|
e.length > 0 && /* @__PURE__ */ a.jsx(Jt, {}),
|
|
10904
|
-
(r ||
|
|
10893
|
+
(r || R) && /* @__PURE__ */ a.jsxs(
|
|
10905
10894
|
"div",
|
|
10906
10895
|
{
|
|
10907
10896
|
className: "sc-file-container",
|
|
@@ -10918,20 +10907,20 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10918
10907
|
className: "icon-file-message"
|
|
10919
10908
|
}
|
|
10920
10909
|
),
|
|
10921
|
-
|
|
10922
|
-
|
|
10923
|
-
r && r.name && !
|
|
10924
|
-
/* @__PURE__ */ a.jsx("span", { className: "delete-file-message", onClick:
|
|
10910
|
+
I && /* @__PURE__ */ a.jsx("span", { children: I }),
|
|
10911
|
+
R && /* @__PURE__ */ a.jsx("span", { children: "Loading..." }),
|
|
10912
|
+
r && r.name && !I && /* @__PURE__ */ a.jsx("span", { children: r.name.length > 23 ? `${r.name.substring(0, 23)}...` : r.name }),
|
|
10913
|
+
/* @__PURE__ */ a.jsx("span", { className: "delete-file-message", onClick: k, children: /* @__PURE__ */ a.jsx(Ef, { height: "10" }) })
|
|
10925
10914
|
]
|
|
10926
10915
|
}
|
|
10927
10916
|
),
|
|
10928
10917
|
/* @__PURE__ */ a.jsxs(
|
|
10929
10918
|
"form",
|
|
10930
10919
|
{
|
|
10931
|
-
className: `sc-user-input ${
|
|
10920
|
+
className: `sc-user-input ${q ? "active" : ""}`,
|
|
10932
10921
|
style: { background: f.userInput.bg },
|
|
10933
|
-
onSubmit: (
|
|
10934
|
-
|
|
10922
|
+
onSubmit: (z) => {
|
|
10923
|
+
z.preventDefault(), t && h(z, "form-submit");
|
|
10935
10924
|
},
|
|
10936
10925
|
children: [
|
|
10937
10926
|
/* @__PURE__ */ a.jsx(
|
|
@@ -10939,13 +10928,13 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10939
10928
|
{
|
|
10940
10929
|
role: "textbox",
|
|
10941
10930
|
tabIndex: 0,
|
|
10942
|
-
onFocus: () =>
|
|
10943
|
-
onBlur: () =>
|
|
10944
|
-
onKeyDown:
|
|
10931
|
+
onFocus: () => g(!0),
|
|
10932
|
+
onBlur: () => g(!1),
|
|
10933
|
+
onKeyDown: A,
|
|
10945
10934
|
onInput: E,
|
|
10946
|
-
onPaste: async (
|
|
10935
|
+
onPaste: async (z) => {
|
|
10947
10936
|
var cu;
|
|
10948
|
-
|
|
10937
|
+
z.preventDefault();
|
|
10949
10938
|
const Z = await navigator.clipboard.readText(), tu = (cu = window.getSelection()) == null ? void 0 : cu.getRangeAt(0);
|
|
10950
10939
|
if (tu && Z) {
|
|
10951
10940
|
const _u = document.createTextNode(Z);
|
|
@@ -10959,19 +10948,19 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
10959
10948
|
"aria-autocomplete": "list",
|
|
10960
10949
|
placeholder: _,
|
|
10961
10950
|
className: "sc-user-input--text",
|
|
10962
|
-
ref:
|
|
10951
|
+
ref: B,
|
|
10963
10952
|
style: { color: f.userInput.text }
|
|
10964
10953
|
}
|
|
10965
10954
|
),
|
|
10966
10955
|
/* @__PURE__ */ a.jsxs("div", { className: "sc-user-input--buttons", children: [
|
|
10967
|
-
|
|
10968
|
-
|
|
10969
|
-
|
|
10956
|
+
x && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(Mt, { inputRef: B, onInput: E }) }),
|
|
10957
|
+
m && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(Vt, {}) }),
|
|
10958
|
+
T && /* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(zt, {}) }),
|
|
10970
10959
|
/* @__PURE__ */ a.jsx("div", { className: "sc-user-input--button", children: /* @__PURE__ */ a.jsx(
|
|
10971
10960
|
Kt,
|
|
10972
10961
|
{
|
|
10973
10962
|
disabled: !t,
|
|
10974
|
-
onClick: (
|
|
10963
|
+
onClick: (z) => h(z)
|
|
10975
10964
|
}
|
|
10976
10965
|
) })
|
|
10977
10966
|
] })
|
|
@@ -11006,7 +10995,7 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11006
10995
|
children: /* @__PURE__ */ a.jsx("path", { stroke: "#fff", strokeOpacity: "1", d: "M15 18L9 12 15 6" })
|
|
11007
10996
|
}
|
|
11008
10997
|
), Zt = () => {
|
|
11009
|
-
const { t: u } = zu(), { colors: D } = ou(), { setWebviewUrl: f, webviewUrl: e } = Cu(), [t, n] =
|
|
10998
|
+
const { t: u } = zu(), { colors: D } = ou(), { setWebviewUrl: f, webviewUrl: e } = Cu(), [t, n] = U(!1);
|
|
11010
10999
|
X(() => {
|
|
11011
11000
|
n(!0);
|
|
11012
11001
|
}, []);
|
|
@@ -11051,7 +11040,7 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11051
11040
|
PostChat: t
|
|
11052
11041
|
}) => {
|
|
11053
11042
|
zu();
|
|
11054
|
-
const n = Wu(), r = Cu(), s = Nu(), { socket: F } = Gu(), { setScreen: d } = Nu(), o =
|
|
11043
|
+
const n = Wu(), r = Cu(), s = Nu(), { socket: F } = Gu(), { setScreen: d } = Nu(), o = pu(), c = o.offline_mode, l = kD(c), j = (C) => {
|
|
11055
11044
|
C.preventDefault(), s.setIsOpen(!s.isOpen);
|
|
11056
11045
|
};
|
|
11057
11046
|
return xe(), new URLSearchParams().append("owner_id", n.ownerId), X(() => {
|
|
@@ -11105,53 +11094,53 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11105
11094
|
}, W1 = ({
|
|
11106
11095
|
onFormDataSubmit: u
|
|
11107
11096
|
}) => {
|
|
11108
|
-
const D = Wu(), { t: f } = zu(), { colors: e } = ou(), { socket: t } = Gu(), n =
|
|
11097
|
+
const D = Wu(), { t: f } = zu(), { colors: e } = ou(), { socket: t } = Gu(), n = pu(), { setScreen: r } = Nu(), {
|
|
11109
11098
|
send: s,
|
|
11110
11099
|
setMessages: F,
|
|
11111
11100
|
setConnectionState: d,
|
|
11112
11101
|
participants: o,
|
|
11113
11102
|
setParticipants: c
|
|
11114
|
-
} = Cu(), { formData: l, setFormData: j, renderFormField: y, errors: C, validateAll:
|
|
11103
|
+
} = Cu(), { formData: l, setFormData: j, renderFormField: y, errors: C, validateAll: v } = U1({
|
|
11115
11104
|
loadFromDataUserSubs: !1,
|
|
11116
11105
|
initialData: {}
|
|
11117
|
-
}),
|
|
11106
|
+
}), x = n.offline_mode, m = kD(x);
|
|
11118
11107
|
console.log(
|
|
11119
11108
|
"🚀 ~ UserSubscription.tsx:72 ~ UserSubscription ~ isOffline:",
|
|
11120
|
-
|
|
11109
|
+
m
|
|
11121
11110
|
);
|
|
11122
|
-
const
|
|
11123
|
-
async (
|
|
11124
|
-
if (
|
|
11111
|
+
const T = mu(!1), _ = Mu(
|
|
11112
|
+
async (B) => {
|
|
11113
|
+
if (B == null || B.preventDefault(), B == null || B.stopPropagation(), !(!uu.getItem("profileLiveChat") && !v(n.formSettings))) {
|
|
11125
11114
|
Object.keys(l).length > 0 && uu.setItem("dataUserSubs", l);
|
|
11126
11115
|
try {
|
|
11127
11116
|
d(2);
|
|
11128
|
-
const
|
|
11129
|
-
Object.entries(l).forEach(([fu,
|
|
11130
|
-
typeof
|
|
11131
|
-
}),
|
|
11132
|
-
const { body:
|
|
11133
|
-
console.log("jump here 1"), uu.setItem("profileLiveChat",
|
|
11117
|
+
const P = new URLSearchParams();
|
|
11118
|
+
Object.entries(l).forEach(([fu, k]) => {
|
|
11119
|
+
typeof k == "string" && k.trim() && P.append(fu, k);
|
|
11120
|
+
}), P.append("contactLateTime", (/* @__PURE__ */ new Date()).toISOString()), P.append("owner_id", D.ownerId);
|
|
11121
|
+
const { body: q } = await t.get(`/webhook/${D.channel}/?${P.toString()}`), { messages: g, profile: O } = q;
|
|
11122
|
+
console.log("jump here 1"), uu.setItem("profileLiveChat", O), uu.setItem("isOffline", m || !1), uu.setItem(
|
|
11134
11123
|
"submitedFormLateTime",
|
|
11135
|
-
(
|
|
11136
|
-
),
|
|
11137
|
-
const
|
|
11138
|
-
fu.direction =
|
|
11139
|
-
}), F(
|
|
11124
|
+
(O == null ? void 0 : O.submitedFormLateTime) || null
|
|
11125
|
+
), g.forEach((fu) => {
|
|
11126
|
+
const k = fu.author === O.foreignId || fu.author === O.id ? Q.sent : Q.received;
|
|
11127
|
+
fu.direction = k, fu.direction === Q.sent && (fu.read = !0, fu.delivery = !1);
|
|
11128
|
+
}), F(g), c([
|
|
11140
11129
|
o[0],
|
|
11141
11130
|
{
|
|
11142
|
-
id:
|
|
11143
|
-
foreign_id:
|
|
11144
|
-
name: `${
|
|
11131
|
+
id: O.foreignId,
|
|
11132
|
+
foreign_id: O.foreignId,
|
|
11133
|
+
name: `${O.firstName} ${O.firstName}`
|
|
11145
11134
|
}
|
|
11146
11135
|
]), d(3), r("chat");
|
|
11147
|
-
const
|
|
11148
|
-
([fu,
|
|
11136
|
+
const $ = Object.entries(l).map(
|
|
11137
|
+
([fu, k]) => `${fu.charAt(0).toUpperCase() + fu.slice(1)}: ${k}`
|
|
11149
11138
|
).join(`
|
|
11150
11139
|
`);
|
|
11151
|
-
if (
|
|
11140
|
+
if (!$ || $.trim().length === 0)
|
|
11152
11141
|
return;
|
|
11153
11142
|
const hu = {
|
|
11154
|
-
text:
|
|
11143
|
+
text: $,
|
|
11155
11144
|
contactInfo: {
|
|
11156
11145
|
...l,
|
|
11157
11146
|
owner_id: D.ownerId
|
|
@@ -11159,16 +11148,16 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11159
11148
|
contactLateTime: /* @__PURE__ */ new Date()
|
|
11160
11149
|
};
|
|
11161
11150
|
s({
|
|
11162
|
-
event:
|
|
11151
|
+
event: B,
|
|
11163
11152
|
source: "contact-form",
|
|
11164
11153
|
data: {
|
|
11165
11154
|
type: Au.text,
|
|
11166
11155
|
data: hu,
|
|
11167
|
-
author:
|
|
11156
|
+
author: O.foreignId
|
|
11168
11157
|
}
|
|
11169
11158
|
});
|
|
11170
|
-
} catch (
|
|
11171
|
-
console.error("Unable to subscribe user",
|
|
11159
|
+
} catch (P) {
|
|
11160
|
+
console.error("Unable to subscribe user", P), r("prechat"), d(0);
|
|
11172
11161
|
}
|
|
11173
11162
|
}
|
|
11174
11163
|
},
|
|
@@ -11185,20 +11174,20 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11185
11174
|
]
|
|
11186
11175
|
);
|
|
11187
11176
|
return X(() => {
|
|
11188
|
-
if (
|
|
11189
|
-
|
|
11190
|
-
const
|
|
11191
|
-
if (
|
|
11192
|
-
const
|
|
11193
|
-
Object.entries(
|
|
11194
|
-
|
|
11195
|
-
}), j(
|
|
11177
|
+
if (!T.current) {
|
|
11178
|
+
T.current = !0;
|
|
11179
|
+
const B = uu.getItem("profileLiveChat");
|
|
11180
|
+
if (B) {
|
|
11181
|
+
const I = B, P = {};
|
|
11182
|
+
Object.entries(I).forEach(([q, g]) => {
|
|
11183
|
+
g && (P[q] = g);
|
|
11184
|
+
}), j(P), _();
|
|
11196
11185
|
}
|
|
11197
11186
|
}
|
|
11198
|
-
}, [_, r,
|
|
11187
|
+
}, [_, r, m]), /* @__PURE__ */ a.jsx("div", { className: "user-subscription-wrapper", children: /* @__PURE__ */ a.jsxs("form", { className: "user-subscription", onSubmit: _, noValidate: !0, children: [
|
|
11199
11188
|
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-title", children: n == null ? void 0 : n.greetingMessage }),
|
|
11200
11189
|
/* @__PURE__ */ a.jsxs("div", { className: "user-subscription-form", children: [
|
|
11201
|
-
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-inputs", children: n.formSettings.sort((
|
|
11190
|
+
/* @__PURE__ */ a.jsx("div", { className: "user-subscription-inputs", children: n.formSettings.sort((B, I) => B.order - I.order).map(y) }),
|
|
11202
11191
|
/* @__PURE__ */ a.jsx("div", { className: "sc-message--contact-form-authorization", children: /* @__PURE__ */ a.jsx(
|
|
11203
11192
|
"a",
|
|
11204
11193
|
{
|
|
@@ -11218,7 +11207,7 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11218
11207
|
color: e.header.text
|
|
11219
11208
|
},
|
|
11220
11209
|
className: "user-subscription-form-button-submit",
|
|
11221
|
-
disabled: Object.values(C).some((
|
|
11210
|
+
disabled: Object.values(C).some((B) => B !== ""),
|
|
11222
11211
|
children: f("user_subscription.get_started")
|
|
11223
11212
|
}
|
|
11224
11213
|
) })
|
|
@@ -11227,7 +11216,7 @@ const Ht = ({ item: u, onPostback: D }) => {
|
|
|
11227
11216
|
}, u8 = qu({}), D8 = ({
|
|
11228
11217
|
children: u
|
|
11229
11218
|
}) => {
|
|
11230
|
-
const D = Wu(), [f, e] =
|
|
11219
|
+
const D = Wu(), [f, e] = U(!1), t = async () => {
|
|
11231
11220
|
try {
|
|
11232
11221
|
await fetch(`${D.apiUrl}/__getcookie`, {
|
|
11233
11222
|
credentials: "include"
|