@botonic/webviews 2.23.2 → 2.24.0
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/CHANGELOG.md +4 -0
- package/index.js +148 -135
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 2.24.0 (2026-03-27)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for @botonic/webviews to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
1
5
|
## 2.23.2 (2026-03-23)
|
|
2
6
|
|
|
3
7
|
This was a version bump only for @botonic/webviews to align it with other projects, there were no code changes.
|
package/index.js
CHANGED
|
@@ -138,19 +138,19 @@ class ca {
|
|
|
138
138
|
this.payload = e, this.referral = n;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
class
|
|
141
|
+
class mr {
|
|
142
142
|
constructor(e, n, r) {
|
|
143
143
|
if (this.attachment_url = e, this.attachment_content = n, this.caption = r, !e && !n)
|
|
144
144
|
throw new aa();
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
class li extends
|
|
147
|
+
class li extends mr {
|
|
148
148
|
}
|
|
149
|
-
class ui extends
|
|
149
|
+
class ui extends mr {
|
|
150
150
|
}
|
|
151
|
-
class fi extends
|
|
151
|
+
class fi extends mr {
|
|
152
152
|
}
|
|
153
|
-
class hi extends
|
|
153
|
+
class hi extends mr {
|
|
154
154
|
}
|
|
155
155
|
class di {
|
|
156
156
|
constructor(e, n, r, i, c) {
|
|
@@ -568,22 +568,22 @@ for (let t = 0; t < 256; ++t)
|
|
|
568
568
|
function pa(t, e = 0) {
|
|
569
569
|
return (Je[t[e + 0]] + Je[t[e + 1]] + Je[t[e + 2]] + Je[t[e + 3]] + "-" + Je[t[e + 4]] + Je[t[e + 5]] + "-" + Je[t[e + 6]] + Je[t[e + 7]] + "-" + Je[t[e + 8]] + Je[t[e + 9]] + "-" + Je[t[e + 10]] + Je[t[e + 11]] + Je[t[e + 12]] + Je[t[e + 13]] + Je[t[e + 14]] + Je[t[e + 15]]).toLowerCase();
|
|
570
570
|
}
|
|
571
|
-
let
|
|
571
|
+
let Ir;
|
|
572
572
|
const ga = new Uint8Array(16);
|
|
573
573
|
function va() {
|
|
574
|
-
if (!
|
|
574
|
+
if (!Ir) {
|
|
575
575
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
576
576
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
577
|
-
|
|
577
|
+
Ir = crypto.getRandomValues.bind(crypto);
|
|
578
578
|
}
|
|
579
|
-
return
|
|
579
|
+
return Ir(ga);
|
|
580
580
|
}
|
|
581
|
-
const
|
|
581
|
+
const Rr = {};
|
|
582
582
|
function yi(t, e, n) {
|
|
583
583
|
let r;
|
|
584
584
|
{
|
|
585
585
|
const i = Date.now(), c = va();
|
|
586
|
-
ma(
|
|
586
|
+
ma(Rr, i, c), r = ya(c, Rr.msecs, Rr.seq, e, n);
|
|
587
587
|
}
|
|
588
588
|
return e ?? pa(r);
|
|
589
589
|
}
|
|
@@ -973,7 +973,7 @@ function wa(t) {
|
|
|
973
973
|
[t]
|
|
974
974
|
);
|
|
975
975
|
}
|
|
976
|
-
var
|
|
976
|
+
var Br = /* @__PURE__ */ ((t) => (t.TEXT = "webview-text", t.IMAGE = "webview-image", t))(Br || {});
|
|
977
977
|
function Du({
|
|
978
978
|
botSession: t,
|
|
979
979
|
params: e,
|
|
@@ -1023,11 +1023,11 @@ function Du({
|
|
|
1023
1023
|
if (!F.ok)
|
|
1024
1024
|
throw new Error(`HTTP error! status: ${F.status}`);
|
|
1025
1025
|
const te = await F.json(), Ce = te.filter(
|
|
1026
|
-
(We) => We.type ===
|
|
1026
|
+
(We) => We.type === Br.TEXT
|
|
1027
1027
|
);
|
|
1028
1028
|
c(Ce);
|
|
1029
1029
|
const Me = te.filter(
|
|
1030
|
-
(We) => We.type ===
|
|
1030
|
+
(We) => We.type === Br.IMAGE
|
|
1031
1031
|
);
|
|
1032
1032
|
v(Me), P(Ce);
|
|
1033
1033
|
} catch (F) {
|
|
@@ -1096,13 +1096,13 @@ class Ds {
|
|
|
1096
1096
|
this._last = null;
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
|
-
const bi = ".", Ta = "", xi = "", Aa = "#", Ia = "*", _i = "xstate.init", Ra = "xstate.error",
|
|
1099
|
+
const bi = ".", Ta = "", xi = "", Aa = "#", Ia = "*", _i = "xstate.init", Ra = "xstate.error", ur = "xstate.stop";
|
|
1100
1100
|
function Oa(t, e) {
|
|
1101
1101
|
return {
|
|
1102
1102
|
type: `xstate.after.${t}.${e}`
|
|
1103
1103
|
};
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function jr(t, e) {
|
|
1106
1106
|
return {
|
|
1107
1107
|
type: `xstate.done.state.${t}`,
|
|
1108
1108
|
output: e
|
|
@@ -1194,7 +1194,7 @@ function Ci(t) {
|
|
|
1194
1194
|
function mt(t) {
|
|
1195
1195
|
return t === void 0 ? [] : Ci(t);
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function Wr(t, e, n, r) {
|
|
1198
1198
|
return typeof t == "function" ? t({
|
|
1199
1199
|
context: e,
|
|
1200
1200
|
event: n,
|
|
@@ -1216,7 +1216,7 @@ function Ai(t) {
|
|
|
1216
1216
|
if (!(t === void 0 || t === Ta))
|
|
1217
1217
|
return mt(t);
|
|
1218
1218
|
}
|
|
1219
|
-
function
|
|
1219
|
+
function sr(t, e, n) {
|
|
1220
1220
|
const r = typeof t == "object", i = r ? t : void 0;
|
|
1221
1221
|
return {
|
|
1222
1222
|
next: (r ? t.next : t)?.bind(i),
|
|
@@ -1311,7 +1311,7 @@ function Da(t, e) {
|
|
|
1311
1311
|
r.set(_, A), i.set(A, _);
|
|
1312
1312
|
},
|
|
1313
1313
|
inspect: (_) => {
|
|
1314
|
-
const A =
|
|
1314
|
+
const A = sr(_);
|
|
1315
1315
|
return c.add(A), {
|
|
1316
1316
|
unsubscribe() {
|
|
1317
1317
|
c.delete(A);
|
|
@@ -1352,7 +1352,7 @@ function Da(t, e) {
|
|
|
1352
1352
|
};
|
|
1353
1353
|
return x;
|
|
1354
1354
|
}
|
|
1355
|
-
let
|
|
1355
|
+
let Or = !1;
|
|
1356
1356
|
const Kr = 1;
|
|
1357
1357
|
let rt = /* @__PURE__ */ (function(t) {
|
|
1358
1358
|
return t[t.NotStarted = 0] = "NotStarted", t[t.Running = 1] = "Running", t[t.Stopped = 2] = "Stopped", t;
|
|
@@ -1390,7 +1390,7 @@ class Ba {
|
|
|
1390
1390
|
this.system = f ? f.system : Da(this, {
|
|
1391
1391
|
clock: i,
|
|
1392
1392
|
logger: c
|
|
1393
|
-
}), C && !f && this.system.inspect(
|
|
1393
|
+
}), C && !f && this.system.inspect(sr(C)), this.sessionId = this.system._bookId(), this.id = m ?? this.sessionId, this.logger = n?.logger ?? this.system._logger, this.clock = n?.clock ?? this.system._clock, this._parent = f, this._syncSnapshot = v, this.options = r, this.src = r.src ?? e, this.ref = this, this._actorScope = {
|
|
1394
1394
|
self: this,
|
|
1395
1395
|
id: this.id,
|
|
1396
1396
|
sessionId: this.sessionId,
|
|
@@ -1427,11 +1427,11 @@ class Ba {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
}), !x.exec)
|
|
1429
1429
|
return;
|
|
1430
|
-
const A =
|
|
1430
|
+
const A = Or;
|
|
1431
1431
|
try {
|
|
1432
|
-
|
|
1432
|
+
Or = !0, x.exec(x.info, x.params);
|
|
1433
1433
|
} finally {
|
|
1434
|
-
|
|
1434
|
+
Or = A;
|
|
1435
1435
|
}
|
|
1436
1436
|
};
|
|
1437
1437
|
this._processingStatus === rt.Running ? _() : this._deferred.push(_);
|
|
@@ -1554,7 +1554,7 @@ class Ba {
|
|
|
1554
1554
|
* the latest snapshot
|
|
1555
1555
|
*/
|
|
1556
1556
|
subscribe(e, n, r) {
|
|
1557
|
-
const i =
|
|
1557
|
+
const i = sr(e, n, r);
|
|
1558
1558
|
if (this._processingStatus !== rt.Stopped)
|
|
1559
1559
|
this.observers.add(i);
|
|
1560
1560
|
else
|
|
@@ -1595,6 +1595,19 @@ class Ba {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
};
|
|
1597
1597
|
}
|
|
1598
|
+
select(e, n = Object.is) {
|
|
1599
|
+
return {
|
|
1600
|
+
subscribe: (r) => {
|
|
1601
|
+
const i = sr(r), c = this.getSnapshot();
|
|
1602
|
+
let f = e(c);
|
|
1603
|
+
return this.subscribe((v) => {
|
|
1604
|
+
const m = e(v);
|
|
1605
|
+
n(f, m) || (f = m, i.next?.(m));
|
|
1606
|
+
});
|
|
1607
|
+
},
|
|
1608
|
+
get: () => e(this.getSnapshot())
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1598
1611
|
/** Starts the Actor from the initial state */
|
|
1599
1612
|
start() {
|
|
1600
1613
|
if (this._processingStatus === rt.Running)
|
|
@@ -1653,11 +1666,11 @@ class Ba {
|
|
|
1653
1666
|
}, this._error(i);
|
|
1654
1667
|
return;
|
|
1655
1668
|
}
|
|
1656
|
-
this.update(n, e), e.type ===
|
|
1669
|
+
this.update(n, e), e.type === ur && (this._stopProcedure(), this._complete());
|
|
1657
1670
|
}
|
|
1658
1671
|
_stop() {
|
|
1659
1672
|
return this._processingStatus === rt.Stopped ? this : (this.mailbox.clear(), this._processingStatus === rt.NotStarted ? (this._processingStatus = rt.Stopped, this) : (this.mailbox.enqueue({
|
|
1660
|
-
type:
|
|
1673
|
+
type: ur
|
|
1661
1674
|
}), this));
|
|
1662
1675
|
}
|
|
1663
1676
|
/** Stops the Actor and unsubscribe all listeners. */
|
|
@@ -1764,7 +1777,7 @@ class Ba {
|
|
|
1764
1777
|
return this._snapshot;
|
|
1765
1778
|
}
|
|
1766
1779
|
}
|
|
1767
|
-
function
|
|
1780
|
+
function fr(t, ...[e]) {
|
|
1768
1781
|
return new Ba(t, e);
|
|
1769
1782
|
}
|
|
1770
1783
|
function ja(t, e, n, r, {
|
|
@@ -1798,7 +1811,7 @@ function $a(t, e, n, r, {
|
|
|
1798
1811
|
context: e.context,
|
|
1799
1812
|
event: n.event,
|
|
1800
1813
|
self: t.self
|
|
1801
|
-
}) : v, x =
|
|
1814
|
+
}) : v, x = fr(w, {
|
|
1802
1815
|
id: C,
|
|
1803
1816
|
src: f,
|
|
1804
1817
|
parent: t.self,
|
|
@@ -1864,7 +1877,7 @@ function Fa(t, e) {
|
|
|
1864
1877
|
});
|
|
1865
1878
|
}
|
|
1866
1879
|
}
|
|
1867
|
-
function
|
|
1880
|
+
function yr(t) {
|
|
1868
1881
|
function e(n, r) {
|
|
1869
1882
|
}
|
|
1870
1883
|
return e.type = "xstate.stopChild", e.actorRef = t, e.resolve = Ha, e.execute = Fa, e;
|
|
@@ -1920,7 +1933,7 @@ function Dn(t, e) {
|
|
|
1920
1933
|
n.push(r), r = r.parent;
|
|
1921
1934
|
return n;
|
|
1922
1935
|
}
|
|
1923
|
-
function
|
|
1936
|
+
function hr(t) {
|
|
1924
1937
|
const e = new Set(t), n = Pi(e);
|
|
1925
1938
|
for (const r of e)
|
|
1926
1939
|
if (r.type === "compound" && (!n.get(r) || !n.get(r).length))
|
|
@@ -1964,13 +1977,13 @@ function Pi(t) {
|
|
|
1964
1977
|
return e;
|
|
1965
1978
|
}
|
|
1966
1979
|
function ki(t, e) {
|
|
1967
|
-
const n =
|
|
1980
|
+
const n = hr(e);
|
|
1968
1981
|
return Oi(t, Pi(n));
|
|
1969
1982
|
}
|
|
1970
1983
|
function es(t, e) {
|
|
1971
1984
|
return e.type === "compound" ? rn(e).some((n) => n.type === "final" && t.has(n)) : e.type === "parallel" ? rn(e).every((n) => es(t, n)) : e.type === "final";
|
|
1972
1985
|
}
|
|
1973
|
-
const
|
|
1986
|
+
const br = (t) => t[0] === Aa;
|
|
1974
1987
|
function qa(t, e) {
|
|
1975
1988
|
return t.transitions.get(e) || [...t.transitions.keys()].filter((r) => Ii(e, r)).sort((r, i) => i.length - r.length).flatMap((r) => t.transitions.get(r));
|
|
1976
1989
|
}
|
|
@@ -2096,15 +2109,15 @@ function Za(t, e) {
|
|
|
2096
2109
|
return e.map((n) => {
|
|
2097
2110
|
if (typeof n != "string")
|
|
2098
2111
|
return n;
|
|
2099
|
-
if (
|
|
2112
|
+
if (br(n))
|
|
2100
2113
|
return t.machine.getStateNodeById(n);
|
|
2101
2114
|
const r = n[0] === bi;
|
|
2102
2115
|
if (r && !t.parent)
|
|
2103
|
-
return
|
|
2116
|
+
return dr(t, n.slice(1));
|
|
2104
2117
|
const i = r ? t.key + n : n;
|
|
2105
2118
|
if (t.parent)
|
|
2106
2119
|
try {
|
|
2107
|
-
return
|
|
2120
|
+
return dr(t.parent, i);
|
|
2108
2121
|
} catch (c) {
|
|
2109
2122
|
throw new Error(`Invalid transition definition for state node '${t.id}':
|
|
2110
2123
|
${c.message}`);
|
|
@@ -2116,7 +2129,7 @@ ${c.message}`);
|
|
|
2116
2129
|
function Ui(t) {
|
|
2117
2130
|
const e = Ai(t.config.target);
|
|
2118
2131
|
return e ? {
|
|
2119
|
-
target: e.map((n) => typeof n == "string" ?
|
|
2132
|
+
target: e.map((n) => typeof n == "string" ? dr(t.parent, n) : n)
|
|
2120
2133
|
} : t.parent.initial;
|
|
2121
2134
|
}
|
|
2122
2135
|
function Bt(t) {
|
|
@@ -2143,7 +2156,7 @@ function Li(t) {
|
|
|
2143
2156
|
return n(t), e;
|
|
2144
2157
|
}
|
|
2145
2158
|
function sn(t, e) {
|
|
2146
|
-
if (
|
|
2159
|
+
if (br(e))
|
|
2147
2160
|
return t.machine.getStateNodeById(e);
|
|
2148
2161
|
if (!t.states)
|
|
2149
2162
|
throw new Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);
|
|
@@ -2152,8 +2165,8 @@ function sn(t, e) {
|
|
|
2152
2165
|
throw new Error(`Child state '${e}' does not exist on '${t.id}'`);
|
|
2153
2166
|
return n;
|
|
2154
2167
|
}
|
|
2155
|
-
function
|
|
2156
|
-
if (typeof e == "string" &&
|
|
2168
|
+
function dr(t, e) {
|
|
2169
|
+
if (typeof e == "string" && br(e))
|
|
2157
2170
|
try {
|
|
2158
2171
|
return t.machine.getStateNodeById(e);
|
|
2159
2172
|
} catch {
|
|
@@ -2168,7 +2181,7 @@ function hr(t, e) {
|
|
|
2168
2181
|
}
|
|
2169
2182
|
return r;
|
|
2170
2183
|
}
|
|
2171
|
-
function
|
|
2184
|
+
function pr(t, e) {
|
|
2172
2185
|
if (typeof e == "string") {
|
|
2173
2186
|
const i = t.states[e];
|
|
2174
2187
|
if (!i)
|
|
@@ -2180,7 +2193,7 @@ function dr(t, e) {
|
|
|
2180
2193
|
const f = sn(t, c);
|
|
2181
2194
|
if (!f)
|
|
2182
2195
|
return i;
|
|
2183
|
-
const v =
|
|
2196
|
+
const v = pr(f, e[c]);
|
|
2184
2197
|
return i.concat(v);
|
|
2185
2198
|
}, []));
|
|
2186
2199
|
}
|
|
@@ -2340,8 +2353,8 @@ function zr(t, e, n, r, i, c) {
|
|
|
2340
2353
|
function ac(t, e, n, r, i) {
|
|
2341
2354
|
if (r.output === void 0)
|
|
2342
2355
|
return;
|
|
2343
|
-
const c =
|
|
2344
|
-
return
|
|
2356
|
+
const c = jr(i.id, i.output !== void 0 && i.parent ? Wr(i.output, t.context, e, n.self) : void 0);
|
|
2357
|
+
return Wr(r.output, t.context, c, n.self);
|
|
2345
2358
|
}
|
|
2346
2359
|
function cc(t, e, n, r, i, c, f, v) {
|
|
2347
2360
|
let m = t;
|
|
@@ -2364,8 +2377,8 @@ function cc(t, e, n, r, i, c, f, v) {
|
|
|
2364
2377
|
if (m = on(m, e, n, A, c, _.invoke.map((P) => P.id)), _.type === "final") {
|
|
2365
2378
|
const P = _.parent;
|
|
2366
2379
|
let R = P?.type === "parallel" ? P : P?.parent, E = R || _;
|
|
2367
|
-
for (P?.type === "compound" && c.push(
|
|
2368
|
-
x.add(R), c.push(
|
|
2380
|
+
for (P?.type === "compound" && c.push(jr(P.id, _.output !== void 0 ? Wr(_.output, m.context, e, n.self) : void 0)); R?.type === "parallel" && !x.has(R) && es(i, R); )
|
|
2381
|
+
x.add(R), c.push(jr(R.id)), E = R, R = R.parent;
|
|
2369
2382
|
if (R)
|
|
2370
2383
|
continue;
|
|
2371
2384
|
m = jt(m, {
|
|
@@ -2399,17 +2412,17 @@ function tn(t, e, n, r) {
|
|
|
2399
2412
|
for (const c of i)
|
|
2400
2413
|
r.add(c), tn(c, e, n, r);
|
|
2401
2414
|
for (const c of i)
|
|
2402
|
-
|
|
2415
|
+
Pr(c, t.parent, r, e, n);
|
|
2403
2416
|
} else {
|
|
2404
2417
|
const i = Ui(t);
|
|
2405
2418
|
for (const c of i.target)
|
|
2406
2419
|
r.add(c), i === t.parent?.initial && n.add(t.parent), tn(c, e, n, r);
|
|
2407
2420
|
for (const c of i.target)
|
|
2408
|
-
|
|
2421
|
+
Pr(c, t.parent, r, e, n);
|
|
2409
2422
|
}
|
|
2410
2423
|
else if (t.type === "compound") {
|
|
2411
2424
|
const [i] = t.initial.target;
|
|
2412
|
-
Bt(i) || (r.add(i), n.add(i)), tn(i, e, n, r),
|
|
2425
|
+
Bt(i) || (r.add(i), n.add(i)), tn(i, e, n, r), Pr(i, t, r, e, n);
|
|
2413
2426
|
} else if (t.type === "parallel")
|
|
2414
2427
|
for (const i of rn(t).filter((c) => !Bt(c)))
|
|
2415
2428
|
[...r].some((c) => It(c, i)) || (Bt(i) || (r.add(i), n.add(i)), tn(i, e, n, r));
|
|
@@ -2420,7 +2433,7 @@ function Mi(t, e, n, r, i) {
|
|
|
2420
2433
|
for (const f of rn(c).filter((v) => !Bt(v)))
|
|
2421
2434
|
[...t].some((v) => It(v, f)) || (t.add(f), tn(f, e, n, t));
|
|
2422
2435
|
}
|
|
2423
|
-
function
|
|
2436
|
+
function Pr(t, e, n, r, i) {
|
|
2424
2437
|
Mi(n, r, i, Dn(t, e));
|
|
2425
2438
|
}
|
|
2426
2439
|
function uc(t, e, n, r, i, c, f, v) {
|
|
@@ -2436,7 +2449,7 @@ function uc(t, e, n, r, i, c, f, v) {
|
|
|
2436
2449
|
}, C[_.id] = Array.from(i).filter(A);
|
|
2437
2450
|
}
|
|
2438
2451
|
for (const x of w)
|
|
2439
|
-
m = on(m, e, n, [...x.exit, ...x.invoke.map((_) =>
|
|
2452
|
+
m = on(m, e, n, [...x.exit, ...x.invoke.map((_) => yr(_.id))], f, void 0), i.delete(x);
|
|
2440
2453
|
return [m, C || c];
|
|
2441
2454
|
}
|
|
2442
2455
|
function fc(t, e) {
|
|
@@ -2498,7 +2511,7 @@ function on(t, e, n, r, i, c) {
|
|
|
2498
2511
|
m.retryResolve(n, v, w);
|
|
2499
2512
|
}), v;
|
|
2500
2513
|
}
|
|
2501
|
-
function
|
|
2514
|
+
function kr(t, e, n, r) {
|
|
2502
2515
|
let i = t;
|
|
2503
2516
|
const c = [];
|
|
2504
2517
|
function f(w, C, x) {
|
|
@@ -2510,7 +2523,7 @@ function Pr(t, e, n, r) {
|
|
|
2510
2523
|
_transitions: x
|
|
2511
2524
|
}), c.push(w);
|
|
2512
2525
|
}
|
|
2513
|
-
if (e.type ===
|
|
2526
|
+
if (e.type === ur)
|
|
2514
2527
|
return i = jt(zs(i, e, n), {
|
|
2515
2528
|
status: "stopped"
|
|
2516
2529
|
}), f([i, []], e, []), {
|
|
@@ -2557,7 +2570,7 @@ function Pr(t, e, n, r) {
|
|
|
2557
2570
|
};
|
|
2558
2571
|
}
|
|
2559
2572
|
function zs(t, e, n) {
|
|
2560
|
-
return on(t, e, n, Object.values(t.children).map((r) =>
|
|
2573
|
+
return on(t, e, n, Object.values(t.children).map((r) => yr(r)), [], void 0);
|
|
2561
2574
|
}
|
|
2562
2575
|
function Hs(t, e) {
|
|
2563
2576
|
return e.machine.getTransitionData(e, t);
|
|
@@ -2576,7 +2589,7 @@ function hc(t, e) {
|
|
|
2576
2589
|
return Ni(Array.from(n), new Set(t._nodes), t.historyValue);
|
|
2577
2590
|
}
|
|
2578
2591
|
function dc(t, e) {
|
|
2579
|
-
const n =
|
|
2592
|
+
const n = hr(pr(t, e));
|
|
2580
2593
|
return ki(t, [...n]);
|
|
2581
2594
|
}
|
|
2582
2595
|
function pc(t) {
|
|
@@ -2609,7 +2622,7 @@ const gc = function(e) {
|
|
|
2609
2622
|
}, bc = function() {
|
|
2610
2623
|
return this._nodes.reduce((e, n) => (n.meta !== void 0 && (e[n.id] = n.meta), e), {});
|
|
2611
2624
|
};
|
|
2612
|
-
function
|
|
2625
|
+
function ir(t, e) {
|
|
2613
2626
|
return {
|
|
2614
2627
|
status: t.status,
|
|
2615
2628
|
output: t.output,
|
|
@@ -2629,7 +2642,7 @@ function sr(t, e) {
|
|
|
2629
2642
|
};
|
|
2630
2643
|
}
|
|
2631
2644
|
function jt(t, e = {}) {
|
|
2632
|
-
return
|
|
2645
|
+
return ir({
|
|
2633
2646
|
...t,
|
|
2634
2647
|
...e
|
|
2635
2648
|
}, t.machine);
|
|
@@ -2766,7 +2779,7 @@ function Mt(t) {
|
|
|
2766
2779
|
error: r.data,
|
|
2767
2780
|
input: void 0
|
|
2768
2781
|
};
|
|
2769
|
-
case
|
|
2782
|
+
case ur:
|
|
2770
2783
|
return Cn.get(i.self)?.abort(), Cn.delete(i.self), {
|
|
2771
2784
|
...n,
|
|
2772
2785
|
status: "stopped",
|
|
@@ -2821,7 +2834,7 @@ function Ec(t, {
|
|
|
2821
2834
|
const m = Jr(e, f);
|
|
2822
2835
|
if (!m)
|
|
2823
2836
|
throw new Error(`Actor logic '${f}' not implemented in machine '${e.id}'`);
|
|
2824
|
-
const w =
|
|
2837
|
+
const w = fr(m, {
|
|
2825
2838
|
id: v?.id,
|
|
2826
2839
|
parent: t.self,
|
|
2827
2840
|
syncSnapshot: v?.syncSnapshot,
|
|
@@ -2835,7 +2848,7 @@ function Ec(t, {
|
|
|
2835
2848
|
});
|
|
2836
2849
|
return i[w.id] = w, w;
|
|
2837
2850
|
} else
|
|
2838
|
-
return
|
|
2851
|
+
return fr(f, {
|
|
2839
2852
|
id: v?.id,
|
|
2840
2853
|
parent: t.self,
|
|
2841
2854
|
syncSnapshot: v?.syncSnapshot,
|
|
@@ -2899,9 +2912,9 @@ const Tc = {}, Tn = (t) => typeof t == "string" ? {
|
|
|
2899
2912
|
} : {
|
|
2900
2913
|
type: t.name
|
|
2901
2914
|
} : t;
|
|
2902
|
-
class
|
|
2915
|
+
class gr {
|
|
2903
2916
|
constructor(e, n) {
|
|
2904
|
-
if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(bi), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Bs(this.config.states, (r, i) => new
|
|
2917
|
+
if (this.config = e, this.key = void 0, this.id = void 0, this.type = void 0, this.path = void 0, this.states = void 0, this.history = void 0, this.entry = void 0, this.exit = void 0, this.parent = void 0, this.machine = void 0, this.meta = void 0, this.output = void 0, this.order = -1, this.description = void 0, this.tags = [], this.transitions = void 0, this.always = void 0, this.parent = n._parent, this.key = n._key, this.machine = n._machine, this.path = this.parent ? this.parent.path.concat(this.key) : [], this.id = this.config.id || [this.machine.id, ...this.path].join(bi), this.type = this.config.type || (this.config.states && Object.keys(this.config.states).length ? "compound" : this.config.history ? "history" : "atomic"), this.description = this.config.description, this.order = this.machine.idMap.size, this.machine.idMap.set(this.id, this), this.states = this.config.states ? Bs(this.config.states, (r, i) => new gr(r, {
|
|
2905
2918
|
_parent: this,
|
|
2906
2919
|
_key: i,
|
|
2907
2920
|
_machine: this.machine
|
|
@@ -3052,7 +3065,7 @@ class ss {
|
|
|
3052
3065
|
actions: n?.actions ?? {},
|
|
3053
3066
|
delays: n?.delays ?? {},
|
|
3054
3067
|
guards: n?.guards ?? {}
|
|
3055
|
-
}, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new
|
|
3068
|
+
}, this.version = this.config.version, this.schemas = this.config.schemas, this.transition = this.transition.bind(this), this.getInitialSnapshot = this.getInitialSnapshot.bind(this), this.getPersistedSnapshot = this.getPersistedSnapshot.bind(this), this.restoreSnapshot = this.restoreSnapshot.bind(this), this.start = this.start.bind(this), this.root = new gr(e, {
|
|
3056
3069
|
_key: this.id,
|
|
3057
3070
|
_machine: this
|
|
3058
3071
|
}), this.root._initialize(), Ka(this.root), this.states = this.root.states, this.events = this.root.events;
|
|
@@ -3091,8 +3104,8 @@ class ss {
|
|
|
3091
3104
|
});
|
|
3092
3105
|
}
|
|
3093
3106
|
resolveState(e) {
|
|
3094
|
-
const n = dc(this.root, e.value), r =
|
|
3095
|
-
return
|
|
3107
|
+
const n = dc(this.root, e.value), r = hr(pr(this.root, n));
|
|
3108
|
+
return ir({
|
|
3096
3109
|
_nodes: [...r],
|
|
3097
3110
|
context: e.context || {},
|
|
3098
3111
|
children: {},
|
|
@@ -3110,7 +3123,7 @@ class ss {
|
|
|
3110
3123
|
* @param event The received event
|
|
3111
3124
|
*/
|
|
3112
3125
|
transition(e, n, r) {
|
|
3113
|
-
return
|
|
3126
|
+
return kr(e, n, r, []).snapshot;
|
|
3114
3127
|
}
|
|
3115
3128
|
/**
|
|
3116
3129
|
* Determines the next state given the current `state` and `event`. Calculates
|
|
@@ -3120,7 +3133,7 @@ class ss {
|
|
|
3120
3133
|
* @param event The received event
|
|
3121
3134
|
*/
|
|
3122
3135
|
microstep(e, n, r) {
|
|
3123
|
-
return
|
|
3136
|
+
return kr(e, n, r, []).microsteps.map(([i]) => i);
|
|
3124
3137
|
}
|
|
3125
3138
|
getTransitionData(e, n) {
|
|
3126
3139
|
return ts(this.root, e.value, e, n) || [];
|
|
@@ -3134,7 +3147,7 @@ class ss {
|
|
|
3134
3147
|
_getPreInitialState(e, n, r) {
|
|
3135
3148
|
const {
|
|
3136
3149
|
context: i
|
|
3137
|
-
} = this.config, c =
|
|
3150
|
+
} = this.config, c = ir({
|
|
3138
3151
|
context: typeof i != "function" && i ? i : {},
|
|
3139
3152
|
_nodes: [this.root],
|
|
3140
3153
|
children: {},
|
|
@@ -3157,7 +3170,7 @@ class ss {
|
|
|
3157
3170
|
getInitialSnapshot(e, n) {
|
|
3158
3171
|
const r = Si(n), i = [], c = this._getPreInitialState(e, r, i), [f] = oc(this.root, c, e, r, i), {
|
|
3159
3172
|
snapshot: v
|
|
3160
|
-
} =
|
|
3173
|
+
} = kr(f, r, e, i);
|
|
3161
3174
|
return v;
|
|
3162
3175
|
}
|
|
3163
3176
|
start(e) {
|
|
@@ -3166,10 +3179,10 @@ class ss {
|
|
|
3166
3179
|
});
|
|
3167
3180
|
}
|
|
3168
3181
|
getStateNodeById(e) {
|
|
3169
|
-
const n = Yr(e), r = n.slice(1), i =
|
|
3182
|
+
const n = Yr(e), r = n.slice(1), i = br(n[0]) ? n[0].slice(Ac.length) : n[0], c = this.idMap.get(i);
|
|
3170
3183
|
if (!c)
|
|
3171
3184
|
throw new Error(`Child state node '#${i}' does not exist on machine '${this.id}'`);
|
|
3172
|
-
return
|
|
3185
|
+
return dr(c, r);
|
|
3173
3186
|
}
|
|
3174
3187
|
get definition() {
|
|
3175
3188
|
return this.root.definition;
|
|
@@ -3186,7 +3199,7 @@ class ss {
|
|
|
3186
3199
|
const _ = i[x], A = _.snapshot, P = _.src, R = typeof P == "string" ? Jr(this, P) : P;
|
|
3187
3200
|
if (!R)
|
|
3188
3201
|
return;
|
|
3189
|
-
const E =
|
|
3202
|
+
const E = fr(R, {
|
|
3190
3203
|
id: x,
|
|
3191
3204
|
parent: n.self,
|
|
3192
3205
|
syncSnapshot: _.syncSnapshot,
|
|
@@ -3197,7 +3210,7 @@ class ss {
|
|
|
3197
3210
|
r[x] = E;
|
|
3198
3211
|
});
|
|
3199
3212
|
function c(x, _) {
|
|
3200
|
-
if (_ instanceof
|
|
3213
|
+
if (_ instanceof gr)
|
|
3201
3214
|
return _;
|
|
3202
3215
|
try {
|
|
3203
3216
|
return x.machine.getStateNodeById(_.id);
|
|
@@ -3217,10 +3230,10 @@ class ss {
|
|
|
3217
3230
|
}
|
|
3218
3231
|
return A;
|
|
3219
3232
|
}
|
|
3220
|
-
const v = f(this.root, e.historyValue), m =
|
|
3233
|
+
const v = f(this.root, e.historyValue), m = ir({
|
|
3221
3234
|
...e,
|
|
3222
3235
|
children: r,
|
|
3223
|
-
_nodes: Array.from(
|
|
3236
|
+
_nodes: Array.from(hr(pr(this.root, e.value))),
|
|
3224
3237
|
historyValue: v
|
|
3225
3238
|
}, this), w = /* @__PURE__ */ new Set();
|
|
3226
3239
|
function C(x, _) {
|
|
@@ -3325,7 +3338,7 @@ function is(t, e, n) {
|
|
|
3325
3338
|
}
|
|
3326
3339
|
return r.type = "xstate.sendTo", r.to = t, r.event = e, r.id = n?.id, r.delay = n?.delay, r.resolve = Oc, r.retryResolve = Pc, r.execute = kc, r;
|
|
3327
3340
|
}
|
|
3328
|
-
function
|
|
3341
|
+
function or(t, e) {
|
|
3329
3342
|
return is(Hr.Parent, t, e);
|
|
3330
3343
|
}
|
|
3331
3344
|
function Uc(t, e, n, r, {
|
|
@@ -3343,11 +3356,11 @@ function Uc(t, e, n, r, {
|
|
|
3343
3356
|
}, f.sendTo = (...v) => {
|
|
3344
3357
|
c.push(is(...v));
|
|
3345
3358
|
}, f.sendParent = (...v) => {
|
|
3346
|
-
c.push(
|
|
3359
|
+
c.push(or(...v));
|
|
3347
3360
|
}, f.spawnChild = (...v) => {
|
|
3348
3361
|
c.push(Zr(...v));
|
|
3349
3362
|
}, f.stopChild = (...v) => {
|
|
3350
|
-
c.push(
|
|
3363
|
+
c.push(yr(...v));
|
|
3351
3364
|
}, f.emit = (...v) => {
|
|
3352
3365
|
c.push(De(...v));
|
|
3353
3366
|
}, i({
|
|
@@ -3402,7 +3415,7 @@ function Ie(t, e) {
|
|
|
3402
3415
|
function Bc(t, e) {
|
|
3403
3416
|
return new ss(t, e);
|
|
3404
3417
|
}
|
|
3405
|
-
function
|
|
3418
|
+
function xr({
|
|
3406
3419
|
schemas: t,
|
|
3407
3420
|
actors: e,
|
|
3408
3421
|
actions: n,
|
|
@@ -3415,7 +3428,7 @@ function br({
|
|
|
3415
3428
|
raise: rs,
|
|
3416
3429
|
log: Mc,
|
|
3417
3430
|
cancel: Xr,
|
|
3418
|
-
stopChild:
|
|
3431
|
+
stopChild: yr,
|
|
3419
3432
|
enqueueActions: Lc,
|
|
3420
3433
|
emit: De,
|
|
3421
3434
|
spawnChild: Zr,
|
|
@@ -3430,7 +3443,7 @@ function br({
|
|
|
3430
3443
|
guards: r,
|
|
3431
3444
|
delays: i
|
|
3432
3445
|
}),
|
|
3433
|
-
extend: (c) =>
|
|
3446
|
+
extend: (c) => xr({
|
|
3434
3447
|
schemas: t,
|
|
3435
3448
|
actors: e,
|
|
3436
3449
|
actions: {
|
|
@@ -3448,8 +3461,8 @@ function br({
|
|
|
3448
3461
|
})
|
|
3449
3462
|
};
|
|
3450
3463
|
}
|
|
3451
|
-
var
|
|
3452
|
-
const jc =
|
|
3464
|
+
var ar = /* @__PURE__ */ ((t) => (t.UNSENT = "unsent", t.SENT = "sent", t.FAILED = "failed", t))(ar || {});
|
|
3465
|
+
const jc = xr({
|
|
3453
3466
|
guards: {
|
|
3454
3467
|
isUnsent: ({ context: t }) => t.status === "unsent",
|
|
3455
3468
|
isSent: ({ context: t }) => t.status === "sent",
|
|
@@ -3459,8 +3472,8 @@ const jc = br({
|
|
|
3459
3472
|
isNavigationButton: ({ event: t }) => t.type === "BUTTON_CLICKED" && t.button.type === rr.WebUrl && !t.button.url?.includes("/webviews")
|
|
3460
3473
|
},
|
|
3461
3474
|
actions: {
|
|
3462
|
-
emitSaveMessage:
|
|
3463
|
-
emitWebviewOpen:
|
|
3475
|
+
emitSaveMessage: or({ type: "PERSISTENCE.SAVE_MESSAGE" }),
|
|
3476
|
+
emitWebviewOpen: or(({ event: t }) => (Ie(t, "BUTTON_CLICKED"), {
|
|
3464
3477
|
type: "WEBVIEW.OPEN",
|
|
3465
3478
|
url: t.button.url || "",
|
|
3466
3479
|
title: t.button.title || ""
|
|
@@ -3496,7 +3509,7 @@ const jc = br({
|
|
|
3496
3509
|
e.error
|
|
3497
3510
|
);
|
|
3498
3511
|
},
|
|
3499
|
-
sendPostbackMessage:
|
|
3512
|
+
sendPostbackMessage: or(({ event: t }) => (Ie(t, "BUTTON_CLICKED"), {
|
|
3500
3513
|
type: "SEND_MESSAGE",
|
|
3501
3514
|
message: nn.createText({
|
|
3502
3515
|
text: t.button.title,
|
|
@@ -3604,7 +3617,7 @@ function qs(t) {
|
|
|
3604
3617
|
}
|
|
3605
3618
|
});
|
|
3606
3619
|
}
|
|
3607
|
-
const Wc =
|
|
3620
|
+
const Wc = xr({
|
|
3608
3621
|
guards: {
|
|
3609
3622
|
isWebview: ({ context: t }) => t.overlayState?.type === "webview",
|
|
3610
3623
|
isCover: ({ context: t }) => t.overlayState?.type === "cover",
|
|
@@ -3842,7 +3855,7 @@ class $i extends Wi {
|
|
|
3842
3855
|
return n;
|
|
3843
3856
|
}
|
|
3844
3857
|
}
|
|
3845
|
-
class
|
|
3858
|
+
class Ur extends Wi {
|
|
3846
3859
|
constructor() {
|
|
3847
3860
|
super(...arguments), this.storage = /* @__PURE__ */ new Map();
|
|
3848
3861
|
}
|
|
@@ -3871,7 +3884,7 @@ class Hc extends $i {
|
|
|
3871
3884
|
}
|
|
3872
3885
|
function Fc(t) {
|
|
3873
3886
|
const { type: e = "localStorage", keyPrefix: n = "botonic-webchat" } = t || {};
|
|
3874
|
-
return e === "inMemory" ? new
|
|
3887
|
+
return e === "inMemory" ? new Ur() : typeof window > "u" ? new Ur() : e === "sessionStorage" && window.sessionStorage ? new Hc(n) : e === "localStorage" && window.localStorage ? new zc(n) : new Ur();
|
|
3875
3888
|
}
|
|
3876
3889
|
const Vc = "/webhooks/webchat/v2/settings/";
|
|
3877
3890
|
class Gc {
|
|
@@ -4009,7 +4022,7 @@ class Gc {
|
|
|
4009
4022
|
function qc(t) {
|
|
4010
4023
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4011
4024
|
}
|
|
4012
|
-
var
|
|
4025
|
+
var Lr = { exports: {} };
|
|
4013
4026
|
/*!
|
|
4014
4027
|
* Pusher JavaScript Library v8.4.0
|
|
4015
4028
|
* https://pusher.com/
|
|
@@ -4486,11 +4499,11 @@ function Yc() {
|
|
|
4486
4499
|
return Pt(o, h, d), Ke(u, m, o, $e);
|
|
4487
4500
|
}
|
|
4488
4501
|
var Fn = fn, Vn = Ht;
|
|
4489
|
-
function
|
|
4502
|
+
function wr(u, d, h, o, p, S) {
|
|
4490
4503
|
var T = new Uint8Array(32);
|
|
4491
4504
|
return kt(T, p, S), Fn(u, d, h, o, T);
|
|
4492
4505
|
}
|
|
4493
|
-
function
|
|
4506
|
+
function Sr(u, d, h, o, p, S) {
|
|
4494
4507
|
var T = new Uint8Array(32);
|
|
4495
4508
|
return kt(T, p, S), Vn(u, d, h, o, T);
|
|
4496
4509
|
}
|
|
@@ -4768,8 +4781,8 @@ function Yc() {
|
|
|
4768
4781
|
crypto_scalarmult_base: Ft,
|
|
4769
4782
|
crypto_box_beforenm: kt,
|
|
4770
4783
|
crypto_box_afternm: Fn,
|
|
4771
|
-
crypto_box:
|
|
4772
|
-
crypto_box_open:
|
|
4784
|
+
crypto_box: wr,
|
|
4785
|
+
crypto_box_open: Sr,
|
|
4773
4786
|
crypto_box_keypair: dn,
|
|
4774
4787
|
crypto_hash: it,
|
|
4775
4788
|
crypto_sign: Yt,
|
|
@@ -4812,7 +4825,7 @@ function Yc() {
|
|
|
4812
4825
|
if (u.length !== _n) throw new Error("bad key size");
|
|
4813
4826
|
if (d.length !== Jt) throw new Error("bad nonce size");
|
|
4814
4827
|
}
|
|
4815
|
-
function
|
|
4828
|
+
function Er(u, d) {
|
|
4816
4829
|
if (u.length !== ot) throw new Error("bad public key size");
|
|
4817
4830
|
if (d.length !== Lt) throw new Error("bad secret key size");
|
|
4818
4831
|
}
|
|
@@ -4848,7 +4861,7 @@ function Yc() {
|
|
|
4848
4861
|
var p = c.box.before(h, o);
|
|
4849
4862
|
return c.secretbox(u, d, p);
|
|
4850
4863
|
}, c.box.before = function(u, d) {
|
|
4851
|
-
Qe(u, d),
|
|
4864
|
+
Qe(u, d), Er(u, d);
|
|
4852
4865
|
var h = new Uint8Array(Xt);
|
|
4853
4866
|
return kt(h, u, d), h;
|
|
4854
4867
|
}, c.box.after = c.secretbox, c.box.open = function(u, d, h, o) {
|
|
@@ -5283,13 +5296,13 @@ function Yc() {
|
|
|
5283
5296
|
return !0;
|
|
5284
5297
|
return !1;
|
|
5285
5298
|
}
|
|
5286
|
-
function
|
|
5299
|
+
function wr(l, s) {
|
|
5287
5300
|
for (var a = 0; a < l.length; a++)
|
|
5288
5301
|
if (!s(l[a], a, l))
|
|
5289
5302
|
return !1;
|
|
5290
5303
|
return !0;
|
|
5291
5304
|
}
|
|
5292
|
-
function
|
|
5305
|
+
function Sr(l) {
|
|
5293
5306
|
return Ft(l, function(s) {
|
|
5294
5307
|
return typeof s == "object" && (s = it(s)), encodeURIComponent($t(s.toString()));
|
|
5295
5308
|
});
|
|
@@ -5297,7 +5310,7 @@ function Yc() {
|
|
|
5297
5310
|
function Gn(l) {
|
|
5298
5311
|
var s = kt(l, function(g) {
|
|
5299
5312
|
return g !== void 0;
|
|
5300
|
-
}), a = Pt(Fn(
|
|
5313
|
+
}), a = Pt(Fn(Sr(s)), He.method("join", "=")).join("&");
|
|
5301
5314
|
return a;
|
|
5302
5315
|
}
|
|
5303
5316
|
function qn(l) {
|
|
@@ -5667,8 +5680,8 @@ function Yc() {
|
|
|
5667
5680
|
var s = ve.isXDRSupported(l.useTLS);
|
|
5668
5681
|
return s;
|
|
5669
5682
|
}
|
|
5670
|
-
},
|
|
5671
|
-
Et.xdr_streaming =
|
|
5683
|
+
}, Er = new ot(Ge({}, wn, En)), Qe = new ot(Ge({}, Yn, En));
|
|
5684
|
+
Et.xdr_streaming = Er, Et.xdr_polling = Qe, Et.sockjs = Sn;
|
|
5672
5685
|
var Kn = Et;
|
|
5673
5686
|
class u extends Ze {
|
|
5674
5687
|
constructor() {
|
|
@@ -6453,7 +6466,7 @@ function Yc() {
|
|
|
6453
6466
|
};
|
|
6454
6467
|
}
|
|
6455
6468
|
function G(l) {
|
|
6456
|
-
return
|
|
6469
|
+
return wr(l, function(s) {
|
|
6457
6470
|
return !!s.error;
|
|
6458
6471
|
});
|
|
6459
6472
|
}
|
|
@@ -6618,15 +6631,15 @@ function Yc() {
|
|
|
6618
6631
|
ms,
|
|
6619
6632
|
new ee(ys, { delay: 4e3 })
|
|
6620
6633
|
]), ys)
|
|
6621
|
-
], pe),
|
|
6622
|
-
return s.useTLS ?
|
|
6634
|
+
], pe), Tr = new oe(ae(bs), bs, Ho), Ar;
|
|
6635
|
+
return s.useTLS ? Ar = new J([
|
|
6623
6636
|
vs,
|
|
6624
|
-
new ee(
|
|
6625
|
-
]) :
|
|
6637
|
+
new ee(Tr, { delay: 2e3 })
|
|
6638
|
+
]) : Ar = new J([
|
|
6626
6639
|
vs,
|
|
6627
6640
|
new ee(zo, { delay: 2e3 }),
|
|
6628
|
-
new ee(
|
|
6629
|
-
]), new O(new de(new oe(ae(ze),
|
|
6641
|
+
new ee(Tr, { delay: 5e3 })
|
|
6642
|
+
]), new O(new de(new oe(ae(ze), Ar, Tr)), g, {
|
|
6630
6643
|
ttl: 18e5,
|
|
6631
6644
|
timeline: s.timeline,
|
|
6632
6645
|
useTLS: s.useTLS
|
|
@@ -6963,11 +6976,11 @@ function Yc() {
|
|
|
6963
6976
|
return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0] / Math.pow(2, 32);
|
|
6964
6977
|
}() * l);
|
|
6965
6978
|
}
|
|
6966
|
-
}, ve = ho,
|
|
6979
|
+
}, ve = ho, Cr;
|
|
6967
6980
|
(function(l) {
|
|
6968
6981
|
l[l.ERROR = 3] = "ERROR", l[l.INFO = 6] = "INFO", l[l.DEBUG = 7] = "DEBUG";
|
|
6969
|
-
})(
|
|
6970
|
-
var Xn =
|
|
6982
|
+
})(Cr || (Cr = {}));
|
|
6983
|
+
var Xn = Cr;
|
|
6971
6984
|
class po {
|
|
6972
6985
|
constructor(s, a, g) {
|
|
6973
6986
|
this.key = s, this.session = a, this.events = [], this.options = g || {}, this.sent = 0, this.uniqueID = 0;
|
|
@@ -7400,11 +7413,11 @@ function Yc() {
|
|
|
7400
7413
|
])
|
|
7401
7414
|
);
|
|
7402
7415
|
});
|
|
7403
|
-
})(
|
|
7416
|
+
})(Lr)), Lr.exports;
|
|
7404
7417
|
}
|
|
7405
|
-
var
|
|
7418
|
+
var Nr, Js;
|
|
7406
7419
|
function Jc() {
|
|
7407
|
-
return Js || (Js = 1,
|
|
7420
|
+
return Js || (Js = 1, Nr = Yc()), Nr;
|
|
7408
7421
|
}
|
|
7409
7422
|
var Kc = Jc();
|
|
7410
7423
|
const Xc = /* @__PURE__ */ qc(Kc);
|
|
@@ -7988,7 +8001,7 @@ function Ks(t) {
|
|
|
7988
8001
|
}
|
|
7989
8002
|
);
|
|
7990
8003
|
}
|
|
7991
|
-
|
|
8004
|
+
xr({
|
|
7992
8005
|
actors: {
|
|
7993
8006
|
// Initialize webchat service with all dependencies
|
|
7994
8007
|
initializeWebchatService: Mt(
|
|
@@ -8154,7 +8167,7 @@ br({
|
|
|
8154
8167
|
const r = e.message, i = r.id, c = t.messageActors || /* @__PURE__ */ new Map();
|
|
8155
8168
|
if (c.has(i))
|
|
8156
8169
|
return c;
|
|
8157
|
-
const f = e.type === "MESSAGE_RECEIVED" ?
|
|
8170
|
+
const f = e.type === "MESSAGE_RECEIVED" ? ar.SENT : r.sent_by === Ln.User ? ar.UNSENT : ar.SENT, v = Ks(t.webchatService), m = n(qs(v), {
|
|
8158
8171
|
input: {
|
|
8159
8172
|
message: r,
|
|
8160
8173
|
user: t.user,
|
|
@@ -9115,7 +9128,7 @@ function Al(t, e) {
|
|
|
9115
9128
|
i === ".." ? n.length > 1 && n.pop() : i !== "." && n.push(i);
|
|
9116
9129
|
}), n.length > 1 ? n.join("/") : "/";
|
|
9117
9130
|
}
|
|
9118
|
-
function
|
|
9131
|
+
function Dr(t, e, n, r) {
|
|
9119
9132
|
return "Cannot include a '" + t + "' character in a manually specified " + ("`to." + e + "` field [" + JSON.stringify(r) + "]. Please separate it out to the ") + ("`to." + n + "` field. Alternatively you may provide the full path as ") + 'a string in <Link to="..."> and the router will parse it for you.';
|
|
9120
9133
|
}
|
|
9121
9134
|
function Il(t) {
|
|
@@ -9128,7 +9141,7 @@ function Fi(t, e) {
|
|
|
9128
9141
|
function Vi(t, e, n, r) {
|
|
9129
9142
|
r === void 0 && (r = !1);
|
|
9130
9143
|
let i;
|
|
9131
|
-
typeof t == "string" ? i = cn(t) : (i = On({}, t), ye(!i.pathname || !i.pathname.includes("?"),
|
|
9144
|
+
typeof t == "string" ? i = cn(t) : (i = On({}, t), ye(!i.pathname || !i.pathname.includes("?"), Dr("?", "pathname", "search", i)), ye(!i.pathname || !i.pathname.includes("#"), Dr("#", "pathname", "hash", i)), ye(!i.search || !i.search.includes("#"), Dr("#", "search", "hash", i)));
|
|
9132
9145
|
let c = t === "" || i.pathname === "", f = c ? "/" : i.pathname, v;
|
|
9133
9146
|
if (f == null)
|
|
9134
9147
|
v = n;
|
|
@@ -9634,18 +9647,18 @@ function us(t, e) {
|
|
|
9634
9647
|
i = r[c], !(e.indexOf(i) >= 0) && (n[i] = t[i]);
|
|
9635
9648
|
return n;
|
|
9636
9649
|
}
|
|
9637
|
-
const
|
|
9638
|
-
function
|
|
9650
|
+
const cr = "get", lr = "application/x-www-form-urlencoded";
|
|
9651
|
+
function _r(t) {
|
|
9639
9652
|
return t != null && typeof t.tagName == "string";
|
|
9640
9653
|
}
|
|
9641
9654
|
function Zl(t) {
|
|
9642
|
-
return
|
|
9655
|
+
return _r(t) && t.tagName.toLowerCase() === "button";
|
|
9643
9656
|
}
|
|
9644
9657
|
function Ql(t) {
|
|
9645
|
-
return
|
|
9658
|
+
return _r(t) && t.tagName.toLowerCase() === "form";
|
|
9646
9659
|
}
|
|
9647
9660
|
function eu(t) {
|
|
9648
|
-
return
|
|
9661
|
+
return _r(t) && t.tagName.toLowerCase() === "input";
|
|
9649
9662
|
}
|
|
9650
9663
|
function tu(t) {
|
|
9651
9664
|
return !!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey);
|
|
@@ -9670,20 +9683,20 @@ function ru() {
|
|
|
9670
9683
|
return tr;
|
|
9671
9684
|
}
|
|
9672
9685
|
const su = /* @__PURE__ */ new Set(["application/x-www-form-urlencoded", "multipart/form-data", "text/plain"]);
|
|
9673
|
-
function
|
|
9674
|
-
return t != null && !su.has(t) ? (process.env.NODE_ENV !== "production" && pt(!1, '"' + t + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' +
|
|
9686
|
+
function Mr(t) {
|
|
9687
|
+
return t != null && !su.has(t) ? (process.env.NODE_ENV !== "production" && pt(!1, '"' + t + '" is not a valid `encType` for `<Form>`/`<fetcher.Form>` ' + ('and will default to "' + lr + '"')), null) : t;
|
|
9675
9688
|
}
|
|
9676
9689
|
function iu(t, e) {
|
|
9677
9690
|
let n, r, i, c, f;
|
|
9678
9691
|
if (Ql(t)) {
|
|
9679
9692
|
let v = t.getAttribute("action");
|
|
9680
|
-
r = v ? Rt(v, e) : null, n = t.getAttribute("method") ||
|
|
9693
|
+
r = v ? Rt(v, e) : null, n = t.getAttribute("method") || cr, i = Mr(t.getAttribute("enctype")) || lr, c = new FormData(t);
|
|
9681
9694
|
} else if (Zl(t) || eu(t) && (t.type === "submit" || t.type === "image")) {
|
|
9682
9695
|
let v = t.form;
|
|
9683
9696
|
if (v == null)
|
|
9684
9697
|
throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');
|
|
9685
9698
|
let m = t.getAttribute("formaction") || v.getAttribute("action");
|
|
9686
|
-
if (r = m ? Rt(m, e) : null, n = t.getAttribute("formmethod") || v.getAttribute("method") ||
|
|
9699
|
+
if (r = m ? Rt(m, e) : null, n = t.getAttribute("formmethod") || v.getAttribute("method") || cr, i = Mr(t.getAttribute("formenctype")) || Mr(v.getAttribute("enctype")) || lr, c = new FormData(v, t), !ru()) {
|
|
9687
9700
|
let {
|
|
9688
9701
|
name: w,
|
|
9689
9702
|
type: C,
|
|
@@ -9695,9 +9708,9 @@ function iu(t, e) {
|
|
|
9695
9708
|
} else w && c.append(w, x);
|
|
9696
9709
|
}
|
|
9697
9710
|
} else {
|
|
9698
|
-
if (
|
|
9711
|
+
if (_r(t))
|
|
9699
9712
|
throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');
|
|
9700
|
-
n =
|
|
9713
|
+
n = cr, r = null, i = lr, f = t;
|
|
9701
9714
|
}
|
|
9702
9715
|
return c && i === "text/plain" && (f = c, c = void 0), {
|
|
9703
9716
|
action: r,
|
|
@@ -9837,7 +9850,7 @@ const vu = /* @__PURE__ */ z.forwardRef((t, e) => {
|
|
|
9837
9850
|
reloadDocument: i,
|
|
9838
9851
|
replace: c,
|
|
9839
9852
|
state: f,
|
|
9840
|
-
method: v =
|
|
9853
|
+
method: v = cr,
|
|
9841
9854
|
action: m,
|
|
9842
9855
|
onSubmit: w,
|
|
9843
9856
|
relative: C,
|
|
@@ -9869,10 +9882,10 @@ const vu = /* @__PURE__ */ z.forwardRef((t, e) => {
|
|
|
9869
9882
|
});
|
|
9870
9883
|
process.env.NODE_ENV !== "production" && (vu.displayName = "Form");
|
|
9871
9884
|
process.env.NODE_ENV;
|
|
9872
|
-
var
|
|
9885
|
+
var vr;
|
|
9873
9886
|
(function(t) {
|
|
9874
9887
|
t.UseScrollRestoration = "useScrollRestoration", t.UseSubmit = "useSubmit", t.UseSubmitFetcher = "useSubmitFetcher", t.UseFetcher = "useFetcher", t.useViewTransitionState = "useViewTransitionState";
|
|
9875
|
-
})(
|
|
9888
|
+
})(vr || (vr = {}));
|
|
9876
9889
|
var ri;
|
|
9877
9890
|
(function(t) {
|
|
9878
9891
|
t.UseFetcher = "useFetcher", t.UseFetchers = "useFetchers", t.UseScrollRestoration = "useScrollRestoration";
|
|
@@ -9917,7 +9930,7 @@ let xu = 0, _u = () => "__" + String(++xu) + "__";
|
|
|
9917
9930
|
function wu() {
|
|
9918
9931
|
let {
|
|
9919
9932
|
router: t
|
|
9920
|
-
} = to(
|
|
9933
|
+
} = to(vr.UseSubmit), {
|
|
9921
9934
|
basename: e
|
|
9922
9935
|
} = z.useContext(ut), n = ql();
|
|
9923
9936
|
return z.useCallback(function(r, i) {
|
|
@@ -9977,7 +9990,7 @@ function Eu(t, e) {
|
|
|
9977
9990
|
n == null && (process.env.NODE_ENV !== "production" ? ye(!1, "`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?") : ye(!1));
|
|
9978
9991
|
let {
|
|
9979
9992
|
basename: r
|
|
9980
|
-
} = to(
|
|
9993
|
+
} = to(vr.useViewTransitionState), i = Wn(t, {
|
|
9981
9994
|
relative: e.relative
|
|
9982
9995
|
});
|
|
9983
9996
|
if (!n.isTransitioning)
|
|
@@ -10117,7 +10130,7 @@ const Cu = ({
|
|
|
10117
10130
|
export {
|
|
10118
10131
|
Mu as WebviewApp,
|
|
10119
10132
|
Uu as WebviewBody,
|
|
10120
|
-
|
|
10133
|
+
Br as WebviewContentType,
|
|
10121
10134
|
oi as WebviewContext,
|
|
10122
10135
|
Lu as WebviewFrame,
|
|
10123
10136
|
Nu as WebviewHeader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/webviews",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.24.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@botonic/core": "2.
|
|
16
|
-
"@botonic/webchat-core": "2.
|
|
17
|
-
"@lilara/foundations": ">=0.
|
|
15
|
+
"@botonic/core": "2.24.0",
|
|
16
|
+
"@botonic/webchat-core": "2.24.0",
|
|
17
|
+
"@lilara/foundations": ">=0.4.0",
|
|
18
18
|
"class-variance-authority": "^0.7.0",
|
|
19
19
|
"react": "18.3.1"
|
|
20
20
|
},
|