@applica-software-guru/persona-sdk 0.1.95 → 0.1.96
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/dist/bundle.cjs.js +4 -4
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.es.js +386 -386
- package/dist/bundle.es.js.map +1 -1
- package/dist/bundle.iife.js +5 -5
- package/dist/bundle.iife.js.map +1 -1
- package/dist/bundle.umd.js +5 -5
- package/dist/bundle.umd.js.map +1 -1
- package/dist/messages.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/messages.ts +13 -3
package/dist/bundle.es.js
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
var xg = Object.defineProperty;
|
|
2
|
-
var Ag = (l,
|
|
3
|
-
var L = (l,
|
|
2
|
+
var Ag = (l, a, i) => a in l ? xg(l, a, { enumerable: !0, configurable: !0, writable: !0, value: i }) : l[a] = i;
|
|
3
|
+
var L = (l, a, i) => Ag(l, typeof a != "symbol" ? a + "" : a, i);
|
|
4
4
|
import { jsx as Vi } from "react/jsx-runtime";
|
|
5
5
|
import { createContext as Sg, useContext as Ir, useState as Se, useRef as Ar, useMemo as Qi, useEffect as Sr, useCallback as ne } from "react";
|
|
6
6
|
import { useExternalStoreRuntime as bg, CompositeAttachmentAdapter as Ig, SimpleImageAttachmentAdapter as Cg, SimpleTextAttachmentAdapter as Rg, AssistantRuntimeProvider as Pg } from "@assistant-ui/react";
|
|
7
7
|
function Eg(l) {
|
|
8
|
-
return new Promise((
|
|
8
|
+
return new Promise((a, i) => {
|
|
9
9
|
const p = new FileReader();
|
|
10
|
-
p.onload = () =>
|
|
10
|
+
p.onload = () => a(p.result), p.onerror = (_) => i(_), p.readAsDataURL(l);
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
class Tg {
|
|
14
14
|
constructor() {
|
|
15
15
|
L(this, "accept", "*");
|
|
16
16
|
}
|
|
17
|
-
async add(
|
|
17
|
+
async add(a) {
|
|
18
18
|
return {
|
|
19
|
-
id:
|
|
19
|
+
id: a.file.name,
|
|
20
20
|
type: "file",
|
|
21
|
-
name:
|
|
22
|
-
contentType:
|
|
23
|
-
file:
|
|
21
|
+
name: a.file.name,
|
|
22
|
+
contentType: a.file.type || "application/octet-stream",
|
|
23
|
+
file: a.file,
|
|
24
24
|
status: { type: "requires-action", reason: "composer-send" }
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
async send(
|
|
28
|
-
const p = (await Eg(
|
|
27
|
+
async send(a) {
|
|
28
|
+
const p = (await Eg(a.file)).split(";base64,")[1];
|
|
29
29
|
return {
|
|
30
|
-
...
|
|
30
|
+
...a,
|
|
31
31
|
status: { type: "complete" },
|
|
32
32
|
content: [
|
|
33
33
|
{
|
|
34
34
|
type: "file",
|
|
35
35
|
data: p,
|
|
36
|
-
mimeType:
|
|
36
|
+
mimeType: a.contentType || "application/octet-stream"
|
|
37
37
|
}
|
|
38
38
|
]
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
async remove(
|
|
41
|
+
async remove(a) {
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
let Lg = 0;
|
|
@@ -53,32 +53,32 @@ function Wg(l) {
|
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
function Dg(l) {
|
|
56
|
-
return l.filter((
|
|
56
|
+
return l.filter((a) => !(a.role === "assistant" && !a.functionCalls && !a.file && !a.image && (!a.text || a.text.trim() === "")));
|
|
57
57
|
}
|
|
58
58
|
function Bn(l) {
|
|
59
|
-
const
|
|
59
|
+
const a = [];
|
|
60
60
|
let i = null;
|
|
61
61
|
for (let _ of l)
|
|
62
62
|
if (_ = Wg(_), _.type !== "transaction")
|
|
63
63
|
if (_.file) {
|
|
64
|
-
i && (
|
|
64
|
+
i && (a.push(i), i = null), a.push(_);
|
|
65
65
|
continue;
|
|
66
|
-
} else _.functionCalls ? (i &&
|
|
67
|
-
...
|
|
66
|
+
} else _.functionCalls ? (i && (i.role === "assistant" && (!i.text || i.text.trim() === "") && !i.file && !i.image || a.push(i)), a.push(_), i = null) : _.functionResponse ? a[a.length - 1] = {
|
|
67
|
+
...a[a.length - 1],
|
|
68
68
|
functionResponse: _.functionResponse
|
|
69
69
|
} : i && _.type === i.type && _.protocol === i.protocol && i.role === _.role && // CRITICAL: Only merge if the new message has the same ID (streaming chunks)
|
|
70
70
|
// OR if the current message doesn't have a finishReason yet (still streaming)
|
|
71
71
|
// This preserves branches while allowing streaming to work
|
|
72
|
-
(_.id === i.id || !i.finishReason) ? (i.text += _.text, i.file = i.file || _.file, i.finishReason = _.finishReason || i.finishReason, i.id = i.id || _.id, i.sources = i.sources ? [...i.sources || [], ..._.sources || []] : _.sources) : (i &&
|
|
72
|
+
(_.id === i.id || !i.finishReason) ? (i.text += _.text, i.file = i.file || _.file, i.finishReason = _.finishReason || i.finishReason, i.id = i.id || _.id, i.sources = i.sources ? [...i.sources || [], ..._.sources || []] : _.sources) : (i && a.push(i), i = {
|
|
73
73
|
..._,
|
|
74
74
|
text: _.file ? "" : _.text,
|
|
75
75
|
finishReason: _.file ? void 0 : _.finishReason
|
|
76
76
|
});
|
|
77
|
-
return i &&
|
|
77
|
+
return i && a.push(i), Dg(a);
|
|
78
78
|
}
|
|
79
79
|
function Fg(l) {
|
|
80
80
|
var _, v, x;
|
|
81
|
-
const
|
|
81
|
+
const a = l.file ? [
|
|
82
82
|
{
|
|
83
83
|
type: "file",
|
|
84
84
|
data: l.file.url,
|
|
@@ -117,7 +117,7 @@ function Fg(l) {
|
|
|
117
117
|
id: l.id,
|
|
118
118
|
role: l.role,
|
|
119
119
|
createdAt: l.createdAt,
|
|
120
|
-
content: l.type === "reasoning" ? [{ type: "reasoning", text: l.text }, ...
|
|
120
|
+
content: l.type === "reasoning" ? [{ type: "reasoning", text: l.text }, ...a] : [{ type: "text", text: l.text }, ...a],
|
|
121
121
|
metadata: {
|
|
122
122
|
...l.metadata,
|
|
123
123
|
custom: {
|
|
@@ -136,40 +136,40 @@ class Cr {
|
|
|
136
136
|
L(this, "statusChangeCallbacks", []);
|
|
137
137
|
L(this, "messageCallbacks", []);
|
|
138
138
|
}
|
|
139
|
-
addStatusChangeListener(
|
|
140
|
-
this.statusChangeCallbacks.push(
|
|
139
|
+
addStatusChangeListener(a) {
|
|
140
|
+
this.statusChangeCallbacks.push(a);
|
|
141
141
|
}
|
|
142
|
-
addPacketListener(
|
|
143
|
-
this.messageCallbacks.push(
|
|
142
|
+
addPacketListener(a) {
|
|
143
|
+
this.messageCallbacks.push(a);
|
|
144
144
|
}
|
|
145
|
-
async syncSession(
|
|
146
|
-
this.session =
|
|
145
|
+
async syncSession(a) {
|
|
146
|
+
this.session = a;
|
|
147
147
|
}
|
|
148
|
-
async notifyPacket(
|
|
149
|
-
this.messageCallbacks.forEach((i) => i(
|
|
148
|
+
async notifyPacket(a) {
|
|
149
|
+
this.messageCallbacks.forEach((i) => i(a));
|
|
150
150
|
}
|
|
151
|
-
async notifyPackets(
|
|
152
|
-
|
|
151
|
+
async notifyPackets(a) {
|
|
152
|
+
a.forEach((i) => {
|
|
153
153
|
this.messageCallbacks.forEach((p) => p(i));
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
|
-
async setSession(
|
|
157
|
-
this.session =
|
|
156
|
+
async setSession(a) {
|
|
157
|
+
this.session = a;
|
|
158
158
|
}
|
|
159
|
-
async setStatus(
|
|
160
|
-
const i = this.status !==
|
|
161
|
-
this.status =
|
|
159
|
+
async setStatus(a) {
|
|
160
|
+
const i = this.status !== a;
|
|
161
|
+
this.status = a, i && this.statusChangeCallbacks.forEach((p) => p(a));
|
|
162
162
|
}
|
|
163
163
|
clearListeners() {
|
|
164
164
|
this.statusChangeCallbacks = [], this.messageCallbacks = [];
|
|
165
165
|
}
|
|
166
|
-
setAgentContext(
|
|
166
|
+
setAgentContext(a) {
|
|
167
167
|
return this.sendPacket({
|
|
168
168
|
type: "command",
|
|
169
|
-
payload: { command: "set_initial_context", arguments:
|
|
169
|
+
payload: { command: "set_initial_context", arguments: a }
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
-
onTransaction(
|
|
172
|
+
onTransaction(a) {
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
class Oo extends Cr {
|
|
@@ -303,7 +303,7 @@ class Wo extends Cr {
|
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
305
|
class Ug {
|
|
306
|
-
constructor(
|
|
306
|
+
constructor(a) {
|
|
307
307
|
L(this, "config");
|
|
308
308
|
L(this, "pc", null);
|
|
309
309
|
L(this, "ws", null);
|
|
@@ -319,9 +319,9 @@ class Ug {
|
|
|
319
319
|
L(this, "messageCallbacks", []);
|
|
320
320
|
L(this, "errorCallbacks", []);
|
|
321
321
|
L(this, "queuedMessages", []);
|
|
322
|
-
this.config =
|
|
322
|
+
this.config = a;
|
|
323
323
|
}
|
|
324
|
-
async connect(
|
|
324
|
+
async connect(a) {
|
|
325
325
|
var p;
|
|
326
326
|
if (this.isConnected) return;
|
|
327
327
|
this.isConnected = !0;
|
|
@@ -385,7 +385,7 @@ class Ug {
|
|
|
385
385
|
apiKey: this.config.apiKey,
|
|
386
386
|
agentId: this.config.agentId,
|
|
387
387
|
userId: this.config.userId || "anonymous",
|
|
388
|
-
sessionCode:
|
|
388
|
+
sessionCode: a
|
|
389
389
|
};
|
|
390
390
|
(P = this.config.logger) == null || P.debug("Opening connection to WebRTC server: ", v);
|
|
391
391
|
const x = {
|
|
@@ -419,20 +419,20 @@ class Ug {
|
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
421
|
async disconnect() {
|
|
422
|
-
var
|
|
423
|
-
this.isConnected && (this.isConnected = !1, ((
|
|
422
|
+
var a;
|
|
423
|
+
this.isConnected && (this.isConnected = !1, ((a = this.ws) == null ? void 0 : a.readyState) === WebSocket.OPEN && this.ws.close(), this.pc && this.pc.close(), this.localStream && this.localStream.getTracks().forEach((i) => i.stop()), this.remoteStream = new MediaStream(), this.audioCtx && (await this.audioCtx.close(), this.audioCtx = null), this._stopAnalyzers());
|
|
424
424
|
}
|
|
425
|
-
addVisualizerCallback(
|
|
426
|
-
this.visualizerCallbacks.push(
|
|
425
|
+
addVisualizerCallback(a) {
|
|
426
|
+
this.visualizerCallbacks.push(a);
|
|
427
427
|
}
|
|
428
|
-
addMessageCallback(
|
|
429
|
-
this.messageCallbacks.push(
|
|
428
|
+
addMessageCallback(a) {
|
|
429
|
+
this.messageCallbacks.push(a);
|
|
430
430
|
}
|
|
431
|
-
addErrorCallback(
|
|
432
|
-
this.errorCallbacks.push(
|
|
431
|
+
addErrorCallback(a) {
|
|
432
|
+
this.errorCallbacks.push(a);
|
|
433
433
|
}
|
|
434
|
-
createDataChannel(
|
|
435
|
-
this.pc && (this.dataChannel = this.pc.createDataChannel(
|
|
434
|
+
createDataChannel(a = "messages") {
|
|
435
|
+
this.pc && (this.dataChannel = this.pc.createDataChannel(a), this.dataChannel.onopen = () => {
|
|
436
436
|
var i, p;
|
|
437
437
|
for ((i = this.config.logger) == null || i.info("Data channel opened"); this.queuedMessages.length > 0; ) {
|
|
438
438
|
const _ = this.queuedMessages.shift();
|
|
@@ -444,20 +444,20 @@ class Ug {
|
|
|
444
444
|
});
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
sendPacket(
|
|
447
|
+
sendPacket(a) {
|
|
448
448
|
var i;
|
|
449
449
|
if (!this.dataChannel || this.dataChannel.readyState !== "open") {
|
|
450
|
-
this.queuedMessages.push(
|
|
450
|
+
this.queuedMessages.push(a);
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
|
-
this.dataChannel.send(JSON.stringify(
|
|
453
|
+
this.dataChannel.send(JSON.stringify(a)), (i = this.config.logger) == null || i.info("Sent message:", a);
|
|
454
454
|
}
|
|
455
455
|
_startAnalyzers() {
|
|
456
456
|
if (!this.localStream || !this.remoteStream || this.visualizerCallbacks.length === 0)
|
|
457
457
|
return;
|
|
458
458
|
this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
459
|
-
const
|
|
460
|
-
this.localAnalyser = this.audioCtx.createAnalyser(), this.remoteAnalyser = this.audioCtx.createAnalyser(), this.localAnalyser.fftSize = 256, this.remoteAnalyser.fftSize = 256,
|
|
459
|
+
const a = this.audioCtx.createMediaStreamSource(this.localStream), i = this.audioCtx.createMediaStreamSource(this.remoteStream);
|
|
460
|
+
this.localAnalyser = this.audioCtx.createAnalyser(), this.remoteAnalyser = this.audioCtx.createAnalyser(), this.localAnalyser.fftSize = 256, this.remoteAnalyser.fftSize = 256, a.connect(this.localAnalyser), i.connect(this.remoteAnalyser);
|
|
461
461
|
const p = () => {
|
|
462
462
|
if (!this.localAnalyser || !this.remoteAnalyser || this.visualizerCallbacks.length === 0)
|
|
463
463
|
return;
|
|
@@ -537,7 +537,7 @@ var br = { exports: {} };
|
|
|
537
537
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
538
538
|
*/
|
|
539
539
|
br.exports;
|
|
540
|
-
(function(l,
|
|
540
|
+
(function(l, a) {
|
|
541
541
|
(function() {
|
|
542
542
|
var i, p = "4.17.21", _ = 200, v = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", x = "Expected a function", P = "Invalid `variable` option passed into `_.template`", b = "__lodash_hash_undefined__", $ = 500, C = "__lodash_placeholder__", z = 1, D = 2, E = 4, q = 1, V = 2, H = 1, gn = 2, en = 4, lt = 8, pt = 16, Kt = 32, Rn = 64, Lt = 128, Qt = 256, qt = 512, Ce = 30, Re = "...", bt = 800, Pe = 16, Pn = 1, Ee = 2, ft = 3, rn = 1 / 0, Vt = 9007199254740991, Rr = 17976931348623157e292, $n = NaN, Ot = 4294967295, Pr = Ot - 1, Te = Ot >>> 1, Er = [
|
|
543
543
|
["ary", Lt],
|
|
@@ -805,7 +805,7 @@ br.exports;
|
|
|
805
805
|
"\r": "r",
|
|
806
806
|
"\u2028": "u2028",
|
|
807
807
|
"\u2029": "u2029"
|
|
808
|
-
}, Ma = parseFloat, Ka = parseInt, bu = typeof be == "object" && be && be.Object === Object && be, qa = typeof self == "object" && self && self.Object === Object && self, ht = bu || qa || Function("return this")(), Gr =
|
|
808
|
+
}, Ma = parseFloat, Ka = parseInt, bu = typeof be == "object" && be && be.Object === Object && be, qa = typeof self == "object" && self && self.Object === Object && self, ht = bu || qa || Function("return this")(), Gr = a && !a.nodeType && a, En = Gr && !0 && l && !l.nodeType && l, Iu = En && En.exports === Gr, Jr = Iu && bu.process, Wt = function() {
|
|
809
809
|
try {
|
|
810
810
|
var h = En && En.require && En.require("util").types;
|
|
811
811
|
return h || Jr && Jr.binding && Jr.binding("util");
|
|
@@ -1183,7 +1183,7 @@ br.exports;
|
|
|
1183
1183
|
return t;
|
|
1184
1184
|
}
|
|
1185
1185
|
function Uf() {
|
|
1186
|
-
var t = this.__wrapped__.value(), n = this.__dir__, e = U(t), r = n < 0, u = e ? t.length : 0, o = Zc(0, u, this.__views__),
|
|
1186
|
+
var t = this.__wrapped__.value(), n = this.__dir__, e = U(t), r = n < 0, u = e ? t.length : 0, o = Zc(0, u, this.__views__), f = o.start, c = o.end, d = c - f, y = r ? c : f - 1, m = this.__iteratees__, A = m.length, S = 0, R = gt(d, this.__takeCount__);
|
|
1187
1187
|
if (!e || !r && u == d && R == d)
|
|
1188
1188
|
return ys(t, this.__actions__);
|
|
1189
1189
|
var O = [];
|
|
@@ -1335,9 +1335,9 @@ br.exports;
|
|
|
1335
1335
|
}
|
|
1336
1336
|
Zt.prototype.clear = tc, Zt.prototype.delete = nc, Zt.prototype.get = ec, Zt.prototype.has = rc, Zt.prototype.set = ic;
|
|
1337
1337
|
function Xu(t, n) {
|
|
1338
|
-
var e = U(t), r = !e && Nn(t), u = !e && !r && Cn(t), o = !e && !r && !u && jn(t),
|
|
1338
|
+
var e = U(t), r = !e && Nn(t), u = !e && !r && Cn(t), o = !e && !r && !u && jn(t), f = e || r || u || o, c = f ? ti(t.length, pf) : [], d = c.length;
|
|
1339
1339
|
for (var y in t)
|
|
1340
|
-
(n || X.call(t, y)) && !(
|
|
1340
|
+
(n || X.call(t, y)) && !(f && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1341
1341
|
(y == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1342
1342
|
u && (y == "offset" || y == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1343
1343
|
o && (y == "buffer" || y == "byteLength" || y == "byteOffset") || // Skip index properties.
|
|
@@ -1368,8 +1368,8 @@ br.exports;
|
|
|
1368
1368
|
return -1;
|
|
1369
1369
|
}
|
|
1370
1370
|
function oc(t, n, e, r) {
|
|
1371
|
-
return An(t, function(u, o,
|
|
1372
|
-
n(r, u, e(u),
|
|
1371
|
+
return An(t, function(u, o, f) {
|
|
1372
|
+
n(r, u, e(u), f);
|
|
1373
1373
|
}), r;
|
|
1374
1374
|
}
|
|
1375
1375
|
function Vu(t, n) {
|
|
@@ -1395,41 +1395,41 @@ br.exports;
|
|
|
1395
1395
|
return t === t && (e !== i && (t = t <= e ? t : e), n !== i && (t = t >= n ? t : n)), t;
|
|
1396
1396
|
}
|
|
1397
1397
|
function Nt(t, n, e, r, u, o) {
|
|
1398
|
-
var
|
|
1399
|
-
if (e && (
|
|
1400
|
-
return
|
|
1398
|
+
var f, c = n & z, d = n & D, y = n & E;
|
|
1399
|
+
if (e && (f = u ? e(t, r, u, o) : e(t)), f !== i)
|
|
1400
|
+
return f;
|
|
1401
1401
|
if (!et(t))
|
|
1402
1402
|
return t;
|
|
1403
1403
|
var m = U(t);
|
|
1404
1404
|
if (m) {
|
|
1405
|
-
if (
|
|
1406
|
-
return mt(t,
|
|
1405
|
+
if (f = Xc(t), !c)
|
|
1406
|
+
return mt(t, f);
|
|
1407
1407
|
} else {
|
|
1408
1408
|
var A = _t(t), S = A == Oe || A == tu;
|
|
1409
1409
|
if (Cn(t))
|
|
1410
1410
|
return As(t, c);
|
|
1411
1411
|
if (A == un || A == M || S && !u) {
|
|
1412
|
-
if (
|
|
1413
|
-
return d ? $c(t, ac(
|
|
1412
|
+
if (f = d || S ? {} : Ks(t), !c)
|
|
1413
|
+
return d ? $c(t, ac(f, t)) : Bc(t, Vu(f, t));
|
|
1414
1414
|
} else {
|
|
1415
1415
|
if (!j[A])
|
|
1416
1416
|
return u ? t : {};
|
|
1417
|
-
|
|
1417
|
+
f = Qc(t, A, c);
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
1420
|
o || (o = new Zt());
|
|
1421
1421
|
var R = o.get(t);
|
|
1422
1422
|
if (R)
|
|
1423
1423
|
return R;
|
|
1424
|
-
o.set(t,
|
|
1425
|
-
|
|
1424
|
+
o.set(t, f), vo(t) ? t.forEach(function(W) {
|
|
1425
|
+
f.add(Nt(W, n, e, W, t, o));
|
|
1426
1426
|
}) : go(t) && t.forEach(function(W, k) {
|
|
1427
|
-
|
|
1427
|
+
f.set(k, Nt(W, n, e, k, t, o));
|
|
1428
1428
|
});
|
|
1429
1429
|
var O = y ? d ? Pi : Ri : d ? At : ct, B = m ? i : O(t);
|
|
1430
1430
|
return Dt(B || t, function(W, k) {
|
|
1431
|
-
B && (k = W, W = t[k]), pe(
|
|
1432
|
-
}),
|
|
1431
|
+
B && (k = W, W = t[k]), pe(f, k, Nt(W, n, e, k, t, o));
|
|
1432
|
+
}), f;
|
|
1433
1433
|
}
|
|
1434
1434
|
function fc(t) {
|
|
1435
1435
|
var n = ct(t);
|
|
@@ -1442,8 +1442,8 @@ br.exports;
|
|
|
1442
1442
|
if (t == null)
|
|
1443
1443
|
return !r;
|
|
1444
1444
|
for (t = Q(t); r--; ) {
|
|
1445
|
-
var u = e[r], o = n[u],
|
|
1446
|
-
if (
|
|
1445
|
+
var u = e[r], o = n[u], f = t[u];
|
|
1446
|
+
if (f === i && !(u in t) || !o(f))
|
|
1447
1447
|
return !1;
|
|
1448
1448
|
}
|
|
1449
1449
|
return !0;
|
|
@@ -1456,14 +1456,14 @@ br.exports;
|
|
|
1456
1456
|
}, n);
|
|
1457
1457
|
}
|
|
1458
1458
|
function ge(t, n, e, r) {
|
|
1459
|
-
var u = -1, o = Ne,
|
|
1459
|
+
var u = -1, o = Ne, f = !0, c = t.length, d = [], y = n.length;
|
|
1460
1460
|
if (!c)
|
|
1461
1461
|
return d;
|
|
1462
|
-
e && (n = nt(n, Ct(e))), r ? (o = Zr,
|
|
1462
|
+
e && (n = nt(n, Ct(e))), r ? (o = Zr, f = !1) : n.length >= _ && (o = ae, f = !1, n = new On(n));
|
|
1463
1463
|
t:
|
|
1464
1464
|
for (; ++u < c; ) {
|
|
1465
1465
|
var m = t[u], A = e == null ? m : e(m);
|
|
1466
|
-
if (m = r || m !== 0 ? m : 0,
|
|
1466
|
+
if (m = r || m !== 0 ? m : 0, f && A === A) {
|
|
1467
1467
|
for (var S = y; S--; )
|
|
1468
1468
|
if (n[S] === A)
|
|
1469
1469
|
continue t;
|
|
@@ -1481,9 +1481,9 @@ br.exports;
|
|
|
1481
1481
|
}
|
|
1482
1482
|
function nr(t, n, e) {
|
|
1483
1483
|
for (var r = -1, u = t.length; ++r < u; ) {
|
|
1484
|
-
var o = t[r],
|
|
1485
|
-
if (
|
|
1486
|
-
var c =
|
|
1484
|
+
var o = t[r], f = n(o);
|
|
1485
|
+
if (f != null && (c === i ? f === f && !Pt(f) : e(f, c)))
|
|
1486
|
+
var c = f, d = o;
|
|
1487
1487
|
}
|
|
1488
1488
|
return d;
|
|
1489
1489
|
}
|
|
@@ -1500,8 +1500,8 @@ br.exports;
|
|
|
1500
1500
|
}), e;
|
|
1501
1501
|
}
|
|
1502
1502
|
function dt(t, n, e, r, u) {
|
|
1503
|
-
var o = -1,
|
|
1504
|
-
for (e || (e = jc), u || (u = []); ++o <
|
|
1503
|
+
var o = -1, f = t.length;
|
|
1504
|
+
for (e || (e = jc), u || (u = []); ++o < f; ) {
|
|
1505
1505
|
var c = t[o];
|
|
1506
1506
|
n > 0 && e(c) ? n > 1 ? dt(c, n - 1, e, r, u) : yn(u, c) : r || (u[u.length] = c);
|
|
1507
1507
|
}
|
|
@@ -1545,9 +1545,9 @@ br.exports;
|
|
|
1545
1545
|
return t >= gt(n, e) && t < at(n, e);
|
|
1546
1546
|
}
|
|
1547
1547
|
function hi(t, n, e) {
|
|
1548
|
-
for (var r = e ? Zr : Ne, u = t[0].length, o = t.length,
|
|
1549
|
-
var m = t[
|
|
1550
|
-
|
|
1548
|
+
for (var r = e ? Zr : Ne, u = t[0].length, o = t.length, f = o, c = g(o), d = 1 / 0, y = []; f--; ) {
|
|
1549
|
+
var m = t[f];
|
|
1550
|
+
f && n && (m = nt(m, Ct(n))), d = gt(m.length, d), c[f] = !e && (n || u >= 120 && m.length >= 120) ? new On(f && m) : i;
|
|
1551
1551
|
}
|
|
1552
1552
|
m = t[0];
|
|
1553
1553
|
var A = -1, S = c[0];
|
|
@@ -1555,9 +1555,9 @@ br.exports;
|
|
|
1555
1555
|
for (; ++A < u && y.length < d; ) {
|
|
1556
1556
|
var R = m[A], O = n ? n(R) : R;
|
|
1557
1557
|
if (R = e || R !== 0 ? R : 0, !(S ? ae(S, O) : r(y, O, e))) {
|
|
1558
|
-
for (
|
|
1559
|
-
var B = c[
|
|
1560
|
-
if (!(B ? ae(B, O) : r(t[
|
|
1558
|
+
for (f = o; --f; ) {
|
|
1559
|
+
var B = c[f];
|
|
1560
|
+
if (!(B ? ae(B, O) : r(t[f], O, e)))
|
|
1561
1561
|
continue t;
|
|
1562
1562
|
}
|
|
1563
1563
|
S && S.push(O), y.push(R);
|
|
@@ -1566,8 +1566,8 @@ br.exports;
|
|
|
1566
1566
|
return y;
|
|
1567
1567
|
}
|
|
1568
1568
|
function gc(t, n, e, r) {
|
|
1569
|
-
return jt(t, function(u, o,
|
|
1570
|
-
n(r, e(u), o,
|
|
1569
|
+
return jt(t, function(u, o, f) {
|
|
1570
|
+
n(r, e(u), o, f);
|
|
1571
1571
|
}), r;
|
|
1572
1572
|
}
|
|
1573
1573
|
function _e(t, n, e) {
|
|
@@ -1588,16 +1588,16 @@ br.exports;
|
|
|
1588
1588
|
return t === n ? !0 : t == null || n == null || !rt(t) && !rt(n) ? t !== t && n !== n : wc(t, n, e, r, ve, u);
|
|
1589
1589
|
}
|
|
1590
1590
|
function wc(t, n, e, r, u, o) {
|
|
1591
|
-
var
|
|
1591
|
+
var f = U(t), c = U(n), d = f ? st : _t(t), y = c ? st : _t(n);
|
|
1592
1592
|
d = d == M ? un : d, y = y == M ? un : y;
|
|
1593
1593
|
var m = d == un, A = y == un, S = d == y;
|
|
1594
1594
|
if (S && Cn(t)) {
|
|
1595
1595
|
if (!Cn(n))
|
|
1596
1596
|
return !1;
|
|
1597
|
-
|
|
1597
|
+
f = !0, m = !1;
|
|
1598
1598
|
}
|
|
1599
1599
|
if (S && !m)
|
|
1600
|
-
return o || (o = new Zt()),
|
|
1600
|
+
return o || (o = new Zt()), f || jn(t) ? Bs(t, n, e, r, u, o) : zc(t, n, d, e, r, u, o);
|
|
1601
1601
|
if (!(e & q)) {
|
|
1602
1602
|
var R = m && X.call(t, "__wrapped__"), O = A && X.call(n, "__wrapped__");
|
|
1603
1603
|
if (R || O) {
|
|
@@ -1611,18 +1611,18 @@ br.exports;
|
|
|
1611
1611
|
return rt(t) && _t(t) == zt;
|
|
1612
1612
|
}
|
|
1613
1613
|
function di(t, n, e, r) {
|
|
1614
|
-
var u = e.length, o = u,
|
|
1614
|
+
var u = e.length, o = u, f = !r;
|
|
1615
1615
|
if (t == null)
|
|
1616
1616
|
return !o;
|
|
1617
1617
|
for (t = Q(t); u--; ) {
|
|
1618
1618
|
var c = e[u];
|
|
1619
|
-
if (
|
|
1619
|
+
if (f && c[2] ? c[1] !== t[c[0]] : !(c[0] in t))
|
|
1620
1620
|
return !1;
|
|
1621
1621
|
}
|
|
1622
1622
|
for (; ++u < o; ) {
|
|
1623
1623
|
c = e[u];
|
|
1624
1624
|
var d = c[0], y = t[d], m = c[1];
|
|
1625
|
-
if (
|
|
1625
|
+
if (f && c[2]) {
|
|
1626
1626
|
if (y === i && !(d in t))
|
|
1627
1627
|
return !1;
|
|
1628
1628
|
} else {
|
|
@@ -1674,8 +1674,8 @@ br.exports;
|
|
|
1674
1674
|
}
|
|
1675
1675
|
function as(t, n) {
|
|
1676
1676
|
var e = -1, r = xt(t) ? g(t.length) : [];
|
|
1677
|
-
return An(t, function(u, o,
|
|
1678
|
-
r[++e] = n(u, o,
|
|
1677
|
+
return An(t, function(u, o, f) {
|
|
1678
|
+
r[++e] = n(u, o, f);
|
|
1679
1679
|
}), r;
|
|
1680
1680
|
}
|
|
1681
1681
|
function fs(t) {
|
|
@@ -1691,27 +1691,27 @@ br.exports;
|
|
|
1691
1691
|
};
|
|
1692
1692
|
}
|
|
1693
1693
|
function rr(t, n, e, r, u) {
|
|
1694
|
-
t !== n && fi(n, function(o,
|
|
1694
|
+
t !== n && fi(n, function(o, f) {
|
|
1695
1695
|
if (u || (u = new Zt()), et(o))
|
|
1696
|
-
bc(t, n,
|
|
1696
|
+
bc(t, n, f, e, rr, r, u);
|
|
1697
1697
|
else {
|
|
1698
|
-
var c = r ? r(Di(t,
|
|
1699
|
-
c === i && (c = o), oi(t,
|
|
1698
|
+
var c = r ? r(Di(t, f), o, f + "", t, n, u) : i;
|
|
1699
|
+
c === i && (c = o), oi(t, f, c);
|
|
1700
1700
|
}
|
|
1701
1701
|
}, At);
|
|
1702
1702
|
}
|
|
1703
|
-
function bc(t, n, e, r, u, o,
|
|
1704
|
-
var c = Di(t, e), d = Di(n, e), y =
|
|
1703
|
+
function bc(t, n, e, r, u, o, f) {
|
|
1704
|
+
var c = Di(t, e), d = Di(n, e), y = f.get(d);
|
|
1705
1705
|
if (y) {
|
|
1706
1706
|
oi(t, e, y);
|
|
1707
1707
|
return;
|
|
1708
1708
|
}
|
|
1709
|
-
var m = o ? o(c, d, e + "", t, n,
|
|
1709
|
+
var m = o ? o(c, d, e + "", t, n, f) : i, A = m === i;
|
|
1710
1710
|
if (A) {
|
|
1711
1711
|
var S = U(d), R = !S && Cn(d), O = !S && !R && jn(d);
|
|
1712
1712
|
m = d, S || R || O ? U(c) ? m = c : it(c) ? m = mt(c) : R ? (A = !1, m = As(d, !0)) : O ? (A = !1, m = Ss(d, !0)) : m = [] : Ae(d) || Nn(d) ? (m = c, Nn(c) ? m = mo(c) : (!et(c) || hn(c)) && (m = Ks(d))) : A = !1;
|
|
1713
1713
|
}
|
|
1714
|
-
A && (
|
|
1714
|
+
A && (f.set(d, m), u(m, d, r, o, f), f.delete(d)), oi(t, e, m);
|
|
1715
1715
|
}
|
|
1716
1716
|
function ls(t, n) {
|
|
1717
1717
|
var e = t.length;
|
|
@@ -1720,20 +1720,20 @@ br.exports;
|
|
|
1720
1720
|
}
|
|
1721
1721
|
function hs(t, n, e) {
|
|
1722
1722
|
n.length ? n = nt(n, function(o) {
|
|
1723
|
-
return U(o) ? function(
|
|
1724
|
-
return Dn(
|
|
1723
|
+
return U(o) ? function(f) {
|
|
1724
|
+
return Dn(f, o.length === 1 ? o[0] : o);
|
|
1725
1725
|
} : o;
|
|
1726
1726
|
}) : n = [St];
|
|
1727
1727
|
var r = -1;
|
|
1728
1728
|
n = nt(n, Ct(T()));
|
|
1729
|
-
var u = as(t, function(o,
|
|
1729
|
+
var u = as(t, function(o, f, c) {
|
|
1730
1730
|
var d = nt(n, function(y) {
|
|
1731
1731
|
return y(o);
|
|
1732
1732
|
});
|
|
1733
1733
|
return { criteria: d, index: ++r, value: o };
|
|
1734
1734
|
});
|
|
1735
|
-
return Xa(u, function(o,
|
|
1736
|
-
return Nc(o,
|
|
1735
|
+
return Xa(u, function(o, f) {
|
|
1736
|
+
return Nc(o, f, e);
|
|
1737
1737
|
});
|
|
1738
1738
|
}
|
|
1739
1739
|
function Ic(t, n) {
|
|
@@ -1743,8 +1743,8 @@ br.exports;
|
|
|
1743
1743
|
}
|
|
1744
1744
|
function ds(t, n, e) {
|
|
1745
1745
|
for (var r = -1, u = n.length, o = {}; ++r < u; ) {
|
|
1746
|
-
var
|
|
1747
|
-
e(c,
|
|
1746
|
+
var f = n[r], c = Dn(t, f);
|
|
1747
|
+
e(c, f) && we(o, bn(f, t), c);
|
|
1748
1748
|
}
|
|
1749
1749
|
return o;
|
|
1750
1750
|
}
|
|
@@ -1754,8 +1754,8 @@ br.exports;
|
|
|
1754
1754
|
};
|
|
1755
1755
|
}
|
|
1756
1756
|
function _i(t, n, e, r) {
|
|
1757
|
-
var u = r ? Ya : qn, o = -1,
|
|
1758
|
-
for (t === n && (n = mt(n)), e && (c = nt(t, Ct(e))); ++o <
|
|
1757
|
+
var u = r ? Ya : qn, o = -1, f = n.length, c = t;
|
|
1758
|
+
for (t === n && (n = mt(n)), e && (c = nt(t, Ct(e))); ++o < f; )
|
|
1759
1759
|
for (var d = 0, y = n[o], m = e ? e(y) : y; (d = u(c, m, d, r)) > -1; )
|
|
1760
1760
|
c !== t && Je.call(c, d, 1), Je.call(t, d, 1);
|
|
1761
1761
|
return t;
|
|
@@ -1774,9 +1774,9 @@ br.exports;
|
|
|
1774
1774
|
return t + Xe(Zu() * (n - t + 1));
|
|
1775
1775
|
}
|
|
1776
1776
|
function Rc(t, n, e, r) {
|
|
1777
|
-
for (var u = -1, o = at(Ye((n - t) / (e || 1)), 0),
|
|
1778
|
-
|
|
1779
|
-
return
|
|
1777
|
+
for (var u = -1, o = at(Ye((n - t) / (e || 1)), 0), f = g(o); o--; )
|
|
1778
|
+
f[r ? o : ++u] = t, t += e;
|
|
1779
|
+
return f;
|
|
1780
1780
|
}
|
|
1781
1781
|
function wi(t, n) {
|
|
1782
1782
|
var e = "";
|
|
@@ -1801,11 +1801,11 @@ br.exports;
|
|
|
1801
1801
|
if (!et(t))
|
|
1802
1802
|
return t;
|
|
1803
1803
|
n = bn(n, t);
|
|
1804
|
-
for (var u = -1, o = n.length,
|
|
1804
|
+
for (var u = -1, o = n.length, f = o - 1, c = t; c != null && ++u < o; ) {
|
|
1805
1805
|
var d = nn(n[u]), y = e;
|
|
1806
1806
|
if (d === "__proto__" || d === "constructor" || d === "prototype")
|
|
1807
1807
|
return t;
|
|
1808
|
-
if (u !=
|
|
1808
|
+
if (u != f) {
|
|
1809
1809
|
var m = c[d];
|
|
1810
1810
|
y = r ? r(m, d, c) : i, y === i && (y = et(m) ? m : ln(n[u + 1]) ? [] : {});
|
|
1811
1811
|
}
|
|
@@ -1843,8 +1843,8 @@ br.exports;
|
|
|
1843
1843
|
var r = 0, u = t == null ? r : t.length;
|
|
1844
1844
|
if (typeof n == "number" && n === n && u <= Te) {
|
|
1845
1845
|
for (; r < u; ) {
|
|
1846
|
-
var o = r + u >>> 1,
|
|
1847
|
-
|
|
1846
|
+
var o = r + u >>> 1, f = t[o];
|
|
1847
|
+
f !== null && !Pt(f) && (e ? f <= n : f < n) ? r = o + 1 : u = o;
|
|
1848
1848
|
}
|
|
1849
1849
|
return u;
|
|
1850
1850
|
}
|
|
@@ -1855,9 +1855,9 @@ br.exports;
|
|
|
1855
1855
|
if (o === 0)
|
|
1856
1856
|
return 0;
|
|
1857
1857
|
n = e(n);
|
|
1858
|
-
for (var
|
|
1858
|
+
for (var f = n !== n, c = n === null, d = Pt(n), y = n === i; u < o; ) {
|
|
1859
1859
|
var m = Xe((u + o) / 2), A = e(t[m]), S = A !== i, R = A === null, O = A === A, B = Pt(A);
|
|
1860
|
-
if (
|
|
1860
|
+
if (f)
|
|
1861
1861
|
var W = r || O;
|
|
1862
1862
|
else y ? W = O && (r || S) : c ? W = O && S && (r || !R) : d ? W = O && S && !R && (r || !B) : R || B ? W = !1 : W = r ? A <= n : A < n;
|
|
1863
1863
|
W ? u = m + 1 : o = m;
|
|
@@ -1866,10 +1866,10 @@ br.exports;
|
|
|
1866
1866
|
}
|
|
1867
1867
|
function _s(t, n) {
|
|
1868
1868
|
for (var e = -1, r = t.length, u = 0, o = []; ++e < r; ) {
|
|
1869
|
-
var
|
|
1869
|
+
var f = t[e], c = n ? n(f) : f;
|
|
1870
1870
|
if (!e || !Yt(c, d)) {
|
|
1871
1871
|
var d = c;
|
|
1872
|
-
o[u++] =
|
|
1872
|
+
o[u++] = f === 0 ? 0 : f;
|
|
1873
1873
|
}
|
|
1874
1874
|
}
|
|
1875
1875
|
return o;
|
|
@@ -1888,20 +1888,20 @@ br.exports;
|
|
|
1888
1888
|
return n == "0" && 1 / t == -rn ? "-0" : n;
|
|
1889
1889
|
}
|
|
1890
1890
|
function Sn(t, n, e) {
|
|
1891
|
-
var r = -1, u = Ne, o = t.length,
|
|
1891
|
+
var r = -1, u = Ne, o = t.length, f = !0, c = [], d = c;
|
|
1892
1892
|
if (e)
|
|
1893
|
-
|
|
1893
|
+
f = !1, u = Zr;
|
|
1894
1894
|
else if (o >= _) {
|
|
1895
1895
|
var y = n ? null : Hc(t);
|
|
1896
1896
|
if (y)
|
|
1897
1897
|
return $e(y);
|
|
1898
|
-
|
|
1898
|
+
f = !1, u = ae, d = new On();
|
|
1899
1899
|
} else
|
|
1900
1900
|
d = n ? [] : c;
|
|
1901
1901
|
t:
|
|
1902
1902
|
for (; ++r < o; ) {
|
|
1903
1903
|
var m = t[r], A = n ? n(m) : m;
|
|
1904
|
-
if (m = e || m !== 0 ? m : 0,
|
|
1904
|
+
if (m = e || m !== 0 ? m : 0, f && A === A) {
|
|
1905
1905
|
for (var S = d.length; S--; )
|
|
1906
1906
|
if (d[S] === A)
|
|
1907
1907
|
continue t;
|
|
@@ -1932,16 +1932,16 @@ br.exports;
|
|
|
1932
1932
|
if (r < 2)
|
|
1933
1933
|
return r ? Sn(t[0]) : [];
|
|
1934
1934
|
for (var u = -1, o = g(r); ++u < r; )
|
|
1935
|
-
for (var
|
|
1936
|
-
c != u && (o[u] = ge(o[u] ||
|
|
1935
|
+
for (var f = t[u], c = -1; ++c < r; )
|
|
1936
|
+
c != u && (o[u] = ge(o[u] || f, t[c], n, e));
|
|
1937
1937
|
return Sn(dt(o, 1), n, e);
|
|
1938
1938
|
}
|
|
1939
1939
|
function ms(t, n, e) {
|
|
1940
|
-
for (var r = -1, u = t.length, o = n.length,
|
|
1940
|
+
for (var r = -1, u = t.length, o = n.length, f = {}; ++r < u; ) {
|
|
1941
1941
|
var c = r < o ? n[r] : i;
|
|
1942
|
-
e(
|
|
1942
|
+
e(f, t[r], c);
|
|
1943
1943
|
}
|
|
1944
|
-
return
|
|
1944
|
+
return f;
|
|
1945
1945
|
}
|
|
1946
1946
|
function Ai(t) {
|
|
1947
1947
|
return it(t) ? t : [];
|
|
@@ -1987,16 +1987,16 @@ br.exports;
|
|
|
1987
1987
|
}
|
|
1988
1988
|
function bs(t, n) {
|
|
1989
1989
|
if (t !== n) {
|
|
1990
|
-
var e = t !== i, r = t === null, u = t === t, o = Pt(t),
|
|
1991
|
-
if (!c && !y && !o && t > n || o &&
|
|
1990
|
+
var e = t !== i, r = t === null, u = t === t, o = Pt(t), f = n !== i, c = n === null, d = n === n, y = Pt(n);
|
|
1991
|
+
if (!c && !y && !o && t > n || o && f && d && !c && !y || r && f && d || !e && d || !u)
|
|
1992
1992
|
return 1;
|
|
1993
|
-
if (!r && !o && !y && t < n || y && e && u && !r && !o || c && e && u || !
|
|
1993
|
+
if (!r && !o && !y && t < n || y && e && u && !r && !o || c && e && u || !f && u || !d)
|
|
1994
1994
|
return -1;
|
|
1995
1995
|
}
|
|
1996
1996
|
return 0;
|
|
1997
1997
|
}
|
|
1998
1998
|
function Nc(t, n, e) {
|
|
1999
|
-
for (var r = -1, u = t.criteria, o = n.criteria,
|
|
1999
|
+
for (var r = -1, u = t.criteria, o = n.criteria, f = u.length, c = e.length; ++r < f; ) {
|
|
2000
2000
|
var d = bs(u[r], o[r]);
|
|
2001
2001
|
if (d) {
|
|
2002
2002
|
if (r >= c)
|
|
@@ -2008,21 +2008,21 @@ br.exports;
|
|
|
2008
2008
|
return t.index - n.index;
|
|
2009
2009
|
}
|
|
2010
2010
|
function Is(t, n, e, r) {
|
|
2011
|
-
for (var u = -1, o = t.length,
|
|
2011
|
+
for (var u = -1, o = t.length, f = e.length, c = -1, d = n.length, y = at(o - f, 0), m = g(d + y), A = !r; ++c < d; )
|
|
2012
2012
|
m[c] = n[c];
|
|
2013
|
-
for (; ++u <
|
|
2013
|
+
for (; ++u < f; )
|
|
2014
2014
|
(A || u < o) && (m[e[u]] = t[u]);
|
|
2015
2015
|
for (; y--; )
|
|
2016
2016
|
m[c++] = t[u++];
|
|
2017
2017
|
return m;
|
|
2018
2018
|
}
|
|
2019
2019
|
function Cs(t, n, e, r) {
|
|
2020
|
-
for (var u = -1, o = t.length,
|
|
2020
|
+
for (var u = -1, o = t.length, f = -1, c = e.length, d = -1, y = n.length, m = at(o - c, 0), A = g(m + y), S = !r; ++u < m; )
|
|
2021
2021
|
A[u] = t[u];
|
|
2022
2022
|
for (var R = u; ++d < y; )
|
|
2023
2023
|
A[R + d] = n[d];
|
|
2024
|
-
for (; ++
|
|
2025
|
-
(S || u < o) && (A[R + e[
|
|
2024
|
+
for (; ++f < c; )
|
|
2025
|
+
(S || u < o) && (A[R + e[f]] = t[u++]);
|
|
2026
2026
|
return A;
|
|
2027
2027
|
}
|
|
2028
2028
|
function mt(t, n) {
|
|
@@ -2034,7 +2034,7 @@ br.exports;
|
|
|
2034
2034
|
function tn(t, n, e, r) {
|
|
2035
2035
|
var u = !e;
|
|
2036
2036
|
e || (e = {});
|
|
2037
|
-
for (var o = -1,
|
|
2037
|
+
for (var o = -1, f = n.length; ++o < f; ) {
|
|
2038
2038
|
var c = n[o], d = r ? r(e[c], t[c], c, e, t) : i;
|
|
2039
2039
|
d === i && (d = t[c]), u ? an(e, c, d) : pe(e, c, d);
|
|
2040
2040
|
}
|
|
@@ -2054,8 +2054,8 @@ br.exports;
|
|
|
2054
2054
|
}
|
|
2055
2055
|
function Xn(t) {
|
|
2056
2056
|
return K(function(n, e) {
|
|
2057
|
-
var r = -1, u = e.length, o = u > 1 ? e[u - 1] : i,
|
|
2058
|
-
for (o = t.length > 3 && typeof o == "function" ? (u--, o) : i,
|
|
2057
|
+
var r = -1, u = e.length, o = u > 1 ? e[u - 1] : i, f = u > 2 ? e[2] : i;
|
|
2058
|
+
for (o = t.length > 3 && typeof o == "function" ? (u--, o) : i, f && wt(e[0], e[1], f) && (o = u < 3 ? i : o, u = 1), n = Q(n); ++r < u; ) {
|
|
2059
2059
|
var c = e[r];
|
|
2060
2060
|
c && t(n, c, r, o);
|
|
2061
2061
|
}
|
|
@@ -2068,15 +2068,15 @@ br.exports;
|
|
|
2068
2068
|
return e;
|
|
2069
2069
|
if (!xt(e))
|
|
2070
2070
|
return t(e, r);
|
|
2071
|
-
for (var u = e.length, o = n ? u : -1,
|
|
2071
|
+
for (var u = e.length, o = n ? u : -1, f = Q(e); (n ? o-- : ++o < u) && r(f[o], o, f) !== !1; )
|
|
2072
2072
|
;
|
|
2073
2073
|
return e;
|
|
2074
2074
|
};
|
|
2075
2075
|
}
|
|
2076
2076
|
function Ps(t) {
|
|
2077
2077
|
return function(n, e, r) {
|
|
2078
|
-
for (var u = -1, o = Q(n),
|
|
2079
|
-
var d =
|
|
2078
|
+
for (var u = -1, o = Q(n), f = r(n), c = f.length; c--; ) {
|
|
2079
|
+
var d = f[t ? c : ++u];
|
|
2080
2080
|
if (e(o[d], d, o) === !1)
|
|
2081
2081
|
break;
|
|
2082
2082
|
}
|
|
@@ -2086,8 +2086,8 @@ br.exports;
|
|
|
2086
2086
|
function Mc(t, n, e) {
|
|
2087
2087
|
var r = n & H, u = ye(t);
|
|
2088
2088
|
function o() {
|
|
2089
|
-
var
|
|
2090
|
-
return
|
|
2089
|
+
var f = this && this !== ht && this instanceof o ? u : t;
|
|
2090
|
+
return f.apply(r ? e : this, arguments);
|
|
2091
2091
|
}
|
|
2092
2092
|
return o;
|
|
2093
2093
|
}
|
|
@@ -2131,9 +2131,9 @@ br.exports;
|
|
|
2131
2131
|
function Kc(t, n, e) {
|
|
2132
2132
|
var r = ye(t);
|
|
2133
2133
|
function u() {
|
|
2134
|
-
for (var o = arguments.length,
|
|
2135
|
-
|
|
2136
|
-
var y = o < 3 &&
|
|
2134
|
+
for (var o = arguments.length, f = g(o), c = o, d = Vn(u); c--; )
|
|
2135
|
+
f[c] = arguments[c];
|
|
2136
|
+
var y = o < 3 && f[0] !== d && f[o - 1] !== d ? [] : mn(f, d);
|
|
2137
2137
|
if (o -= y.length, o < e)
|
|
2138
2138
|
return Ds(
|
|
2139
2139
|
t,
|
|
@@ -2141,14 +2141,14 @@ br.exports;
|
|
|
2141
2141
|
or,
|
|
2142
2142
|
u.placeholder,
|
|
2143
2143
|
i,
|
|
2144
|
-
|
|
2144
|
+
f,
|
|
2145
2145
|
y,
|
|
2146
2146
|
i,
|
|
2147
2147
|
i,
|
|
2148
2148
|
e - o
|
|
2149
2149
|
);
|
|
2150
2150
|
var m = this && this !== ht && this instanceof u ? r : t;
|
|
2151
|
-
return It(m, this,
|
|
2151
|
+
return It(m, this, f);
|
|
2152
2152
|
}
|
|
2153
2153
|
return u;
|
|
2154
2154
|
}
|
|
@@ -2161,8 +2161,8 @@ br.exports;
|
|
|
2161
2161
|
return o(u[c], c, u);
|
|
2162
2162
|
};
|
|
2163
2163
|
}
|
|
2164
|
-
var
|
|
2165
|
-
return
|
|
2164
|
+
var f = t(n, e, r);
|
|
2165
|
+
return f > -1 ? u[o ? n[f] : f] : i;
|
|
2166
2166
|
};
|
|
2167
2167
|
}
|
|
2168
2168
|
function Ls(t) {
|
|
@@ -2172,32 +2172,32 @@ br.exports;
|
|
|
2172
2172
|
var o = n[r];
|
|
2173
2173
|
if (typeof o != "function")
|
|
2174
2174
|
throw new Ft(x);
|
|
2175
|
-
if (u && !
|
|
2176
|
-
var
|
|
2175
|
+
if (u && !f && lr(o) == "wrapper")
|
|
2176
|
+
var f = new Ut([], !0);
|
|
2177
2177
|
}
|
|
2178
|
-
for (r =
|
|
2178
|
+
for (r = f ? r : e; ++r < e; ) {
|
|
2179
2179
|
o = n[r];
|
|
2180
2180
|
var c = lr(o), d = c == "wrapper" ? Ei(o) : i;
|
|
2181
|
-
d && Wi(d[0]) && d[1] == (Lt | lt | Kt | Qt) && !d[4].length && d[9] == 1 ?
|
|
2181
|
+
d && Wi(d[0]) && d[1] == (Lt | lt | Kt | Qt) && !d[4].length && d[9] == 1 ? f = f[lr(d[0])].apply(f, d[3]) : f = o.length == 1 && Wi(o) ? f[c]() : f.thru(o);
|
|
2182
2182
|
}
|
|
2183
2183
|
return function() {
|
|
2184
2184
|
var y = arguments, m = y[0];
|
|
2185
|
-
if (
|
|
2186
|
-
return
|
|
2185
|
+
if (f && y.length == 1 && U(m))
|
|
2186
|
+
return f.plant(m).value();
|
|
2187
2187
|
for (var A = 0, S = e ? n[A].apply(this, y) : m; ++A < e; )
|
|
2188
2188
|
S = n[A].call(this, S);
|
|
2189
2189
|
return S;
|
|
2190
2190
|
};
|
|
2191
2191
|
});
|
|
2192
2192
|
}
|
|
2193
|
-
function or(t, n, e, r, u, o,
|
|
2193
|
+
function or(t, n, e, r, u, o, f, c, d, y) {
|
|
2194
2194
|
var m = n & Lt, A = n & H, S = n & gn, R = n & (lt | pt), O = n & qt, B = S ? i : ye(t);
|
|
2195
2195
|
function W() {
|
|
2196
2196
|
for (var k = arguments.length, J = g(k), Et = k; Et--; )
|
|
2197
2197
|
J[Et] = arguments[Et];
|
|
2198
2198
|
if (R)
|
|
2199
2199
|
var yt = Vn(W), Tt = Va(J, yt);
|
|
2200
|
-
if (r && (J = Is(J, r, u, R)), o && (J = Cs(J, o,
|
|
2200
|
+
if (r && (J = Is(J, r, u, R)), o && (J = Cs(J, o, f, R)), k -= Tt, R && k < y) {
|
|
2201
2201
|
var ut = mn(J, yt);
|
|
2202
2202
|
return Ds(
|
|
2203
2203
|
t,
|
|
@@ -2255,14 +2255,14 @@ br.exports;
|
|
|
2255
2255
|
}
|
|
2256
2256
|
function qc(t, n, e, r) {
|
|
2257
2257
|
var u = n & H, o = ye(t);
|
|
2258
|
-
function
|
|
2259
|
-
for (var c = -1, d = arguments.length, y = -1, m = r.length, A = g(m + d), S = this && this !== ht && this instanceof
|
|
2258
|
+
function f() {
|
|
2259
|
+
for (var c = -1, d = arguments.length, y = -1, m = r.length, A = g(m + d), S = this && this !== ht && this instanceof f ? o : t; ++y < m; )
|
|
2260
2260
|
A[y] = r[y];
|
|
2261
2261
|
for (; d--; )
|
|
2262
2262
|
A[y++] = arguments[++c];
|
|
2263
2263
|
return It(S, u ? e : this, A);
|
|
2264
2264
|
}
|
|
2265
|
-
return
|
|
2265
|
+
return f;
|
|
2266
2266
|
}
|
|
2267
2267
|
function Ws(t) {
|
|
2268
2268
|
return function(n, e, r) {
|
|
@@ -2274,8 +2274,8 @@ br.exports;
|
|
|
2274
2274
|
return typeof n == "string" && typeof e == "string" || (n = Mt(n), e = Mt(e)), t(n, e);
|
|
2275
2275
|
};
|
|
2276
2276
|
}
|
|
2277
|
-
function Ds(t, n, e, r, u, o,
|
|
2278
|
-
var m = n & lt, A = m ?
|
|
2277
|
+
function Ds(t, n, e, r, u, o, f, c, d, y) {
|
|
2278
|
+
var m = n & lt, A = m ? f : i, S = m ? i : f, R = m ? o : i, O = m ? i : o;
|
|
2279
2279
|
n |= m ? Kt : Rn, n &= ~(m ? Rn : Kt), n & en || (n &= -4);
|
|
2280
2280
|
var B = [
|
|
2281
2281
|
t,
|
|
@@ -2310,12 +2310,12 @@ br.exports;
|
|
|
2310
2310
|
return e == zt ? ei(n) : e == Gt ? sf(n) : Qa(n, t(n));
|
|
2311
2311
|
};
|
|
2312
2312
|
}
|
|
2313
|
-
function fn(t, n, e, r, u, o,
|
|
2313
|
+
function fn(t, n, e, r, u, o, f, c) {
|
|
2314
2314
|
var d = n & gn;
|
|
2315
2315
|
if (!d && typeof t != "function")
|
|
2316
2316
|
throw new Ft(x);
|
|
2317
2317
|
var y = r ? r.length : 0;
|
|
2318
|
-
if (y || (n &= -97, r = u = i),
|
|
2318
|
+
if (y || (n &= -97, r = u = i), f = f === i ? f : at(N(f), 0), c = c === i ? c : N(c), y -= u ? u.length : 0, n & Rn) {
|
|
2319
2319
|
var m = r, A = u;
|
|
2320
2320
|
r = u = i;
|
|
2321
2321
|
}
|
|
@@ -2328,7 +2328,7 @@ br.exports;
|
|
|
2328
2328
|
m,
|
|
2329
2329
|
A,
|
|
2330
2330
|
o,
|
|
2331
|
-
|
|
2331
|
+
f,
|
|
2332
2332
|
c
|
|
2333
2333
|
];
|
|
2334
2334
|
if (S && il(R, S), t = R[0], n = R[1], e = R[2], r = R[3], u = R[4], c = R[9] = R[9] === i ? d ? 0 : t.length : at(R[9] - y, 0), !c && n & (lt | pt) && (n &= -25), !n || n == H)
|
|
@@ -2347,8 +2347,8 @@ br.exports;
|
|
|
2347
2347
|
return Ae(t) ? i : t;
|
|
2348
2348
|
}
|
|
2349
2349
|
function Bs(t, n, e, r, u, o) {
|
|
2350
|
-
var
|
|
2351
|
-
if (c != d && !(
|
|
2350
|
+
var f = e & q, c = t.length, d = n.length;
|
|
2351
|
+
if (c != d && !(f && d > c))
|
|
2352
2352
|
return !1;
|
|
2353
2353
|
var y = o.get(t), m = o.get(n);
|
|
2354
2354
|
if (y && m)
|
|
@@ -2357,7 +2357,7 @@ br.exports;
|
|
|
2357
2357
|
for (o.set(t, n), o.set(n, t); ++A < c; ) {
|
|
2358
2358
|
var O = t[A], B = n[A];
|
|
2359
2359
|
if (r)
|
|
2360
|
-
var W =
|
|
2360
|
+
var W = f ? r(B, O, A, n, t, o) : r(O, B, A, t, n, o);
|
|
2361
2361
|
if (W !== i) {
|
|
2362
2362
|
if (W)
|
|
2363
2363
|
continue;
|
|
@@ -2379,7 +2379,7 @@ br.exports;
|
|
|
2379
2379
|
}
|
|
2380
2380
|
return o.delete(t), o.delete(n), S;
|
|
2381
2381
|
}
|
|
2382
|
-
function zc(t, n, e, r, u, o,
|
|
2382
|
+
function zc(t, n, e, r, u, o, f) {
|
|
2383
2383
|
switch (e) {
|
|
2384
2384
|
case Mn:
|
|
2385
2385
|
if (t.byteLength != n.byteLength || t.byteOffset != n.byteOffset)
|
|
@@ -2402,12 +2402,12 @@ br.exports;
|
|
|
2402
2402
|
var d = r & q;
|
|
2403
2403
|
if (c || (c = $e), t.size != n.size && !d)
|
|
2404
2404
|
return !1;
|
|
2405
|
-
var y =
|
|
2405
|
+
var y = f.get(t);
|
|
2406
2406
|
if (y)
|
|
2407
2407
|
return y == n;
|
|
2408
|
-
r |= V,
|
|
2409
|
-
var m = Bs(c(t), c(n), r, u, o,
|
|
2410
|
-
return
|
|
2408
|
+
r |= V, f.set(t, n);
|
|
2409
|
+
var m = Bs(c(t), c(n), r, u, o, f);
|
|
2410
|
+
return f.delete(t), m;
|
|
2411
2411
|
case We:
|
|
2412
2412
|
if (de)
|
|
2413
2413
|
return de.call(t) == de.call(n);
|
|
@@ -2415,12 +2415,12 @@ br.exports;
|
|
|
2415
2415
|
return !1;
|
|
2416
2416
|
}
|
|
2417
2417
|
function Gc(t, n, e, r, u, o) {
|
|
2418
|
-
var
|
|
2419
|
-
if (d != m && !
|
|
2418
|
+
var f = e & q, c = Ri(t), d = c.length, y = Ri(n), m = y.length;
|
|
2419
|
+
if (d != m && !f)
|
|
2420
2420
|
return !1;
|
|
2421
2421
|
for (var A = d; A--; ) {
|
|
2422
2422
|
var S = c[A];
|
|
2423
|
-
if (!(
|
|
2423
|
+
if (!(f ? S in n : X.call(n, S)))
|
|
2424
2424
|
return !1;
|
|
2425
2425
|
}
|
|
2426
2426
|
var R = o.get(t), O = o.get(n);
|
|
@@ -2428,11 +2428,11 @@ br.exports;
|
|
|
2428
2428
|
return R == n && O == t;
|
|
2429
2429
|
var B = !0;
|
|
2430
2430
|
o.set(t, n), o.set(n, t);
|
|
2431
|
-
for (var W =
|
|
2431
|
+
for (var W = f; ++A < d; ) {
|
|
2432
2432
|
S = c[A];
|
|
2433
2433
|
var k = t[S], J = n[S];
|
|
2434
2434
|
if (r)
|
|
2435
|
-
var Et =
|
|
2435
|
+
var Et = f ? r(J, k, S, n, t, o) : r(k, J, S, t, n, o);
|
|
2436
2436
|
if (!(Et === i ? k === J || u(k, J, e, r, o) : Et)) {
|
|
2437
2437
|
B = !1;
|
|
2438
2438
|
break;
|
|
@@ -2526,19 +2526,19 @@ br.exports;
|
|
|
2526
2526
|
});
|
|
2527
2527
|
function Zc(t, n, e) {
|
|
2528
2528
|
for (var r = -1, u = e.length; ++r < u; ) {
|
|
2529
|
-
var o = e[r],
|
|
2529
|
+
var o = e[r], f = o.size;
|
|
2530
2530
|
switch (o.type) {
|
|
2531
2531
|
case "drop":
|
|
2532
|
-
t +=
|
|
2532
|
+
t += f;
|
|
2533
2533
|
break;
|
|
2534
2534
|
case "dropRight":
|
|
2535
|
-
n -=
|
|
2535
|
+
n -= f;
|
|
2536
2536
|
break;
|
|
2537
2537
|
case "take":
|
|
2538
|
-
n = gt(n, t +
|
|
2538
|
+
n = gt(n, t + f);
|
|
2539
2539
|
break;
|
|
2540
2540
|
case "takeRight":
|
|
2541
|
-
t = at(t, n -
|
|
2541
|
+
t = at(t, n - f);
|
|
2542
2542
|
break;
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
@@ -2551,12 +2551,12 @@ br.exports;
|
|
|
2551
2551
|
function Ms(t, n, e) {
|
|
2552
2552
|
n = bn(n, t);
|
|
2553
2553
|
for (var r = -1, u = n.length, o = !1; ++r < u; ) {
|
|
2554
|
-
var
|
|
2555
|
-
if (!(o = t != null && e(t,
|
|
2554
|
+
var f = nn(n[r]);
|
|
2555
|
+
if (!(o = t != null && e(t, f)))
|
|
2556
2556
|
break;
|
|
2557
|
-
t = t[
|
|
2557
|
+
t = t[f];
|
|
2558
2558
|
}
|
|
2559
|
-
return o || ++r != u ? o : (u = t == null ? 0 : t.length, !!u && yr(u) && ln(
|
|
2559
|
+
return o || ++r != u ? o : (u = t == null ? 0 : t.length, !!u && yr(u) && ln(f, u) && (U(t) || Nn(t)));
|
|
2560
2560
|
}
|
|
2561
2561
|
function Xc(t) {
|
|
2562
2562
|
var n = t.length, e = new t.constructor(n);
|
|
@@ -2662,8 +2662,8 @@ br.exports;
|
|
|
2662
2662
|
return n;
|
|
2663
2663
|
}
|
|
2664
2664
|
function il(t, n) {
|
|
2665
|
-
var e = t[1], r = n[1], u = e | r, o = u < (H | gn | Lt),
|
|
2666
|
-
if (!(o ||
|
|
2665
|
+
var e = t[1], r = n[1], u = e | r, o = u < (H | gn | Lt), f = r == Lt && e == lt || r == Lt && e == Qt && t[7].length <= n[8] || r == (Lt | Qt) && n[7].length <= n[8] && e == lt;
|
|
2666
|
+
if (!(o || f))
|
|
2667
2667
|
return t;
|
|
2668
2668
|
r & H && (t[2] = n[2], u |= e & H ? 0 : en);
|
|
2669
2669
|
var c = n[3];
|
|
@@ -2685,12 +2685,12 @@ br.exports;
|
|
|
2685
2685
|
}
|
|
2686
2686
|
function ks(t, n, e) {
|
|
2687
2687
|
return n = at(n === i ? t.length - 1 : n, 0), function() {
|
|
2688
|
-
for (var r = arguments, u = -1, o = at(r.length - n, 0),
|
|
2689
|
-
|
|
2688
|
+
for (var r = arguments, u = -1, o = at(r.length - n, 0), f = g(o); ++u < o; )
|
|
2689
|
+
f[u] = r[n + u];
|
|
2690
2690
|
u = -1;
|
|
2691
2691
|
for (var c = g(n + 1); ++u < n; )
|
|
2692
2692
|
c[u] = r[u];
|
|
2693
|
-
return c[n] = e(
|
|
2693
|
+
return c[n] = e(f), It(t, this, c);
|
|
2694
2694
|
};
|
|
2695
2695
|
}
|
|
2696
2696
|
function zs(t, n) {
|
|
@@ -2729,8 +2729,8 @@ br.exports;
|
|
|
2729
2729
|
function dr(t, n) {
|
|
2730
2730
|
var e = -1, r = t.length, u = r - 1;
|
|
2731
2731
|
for (n = n === i ? r : n; ++e < n; ) {
|
|
2732
|
-
var o = vi(e, u),
|
|
2733
|
-
t[o] = t[e], t[e] =
|
|
2732
|
+
var o = vi(e, u), f = t[o];
|
|
2733
|
+
t[o] = t[e], t[e] = f;
|
|
2734
2734
|
}
|
|
2735
2735
|
return t.length = n, t;
|
|
2736
2736
|
}
|
|
@@ -2776,9 +2776,9 @@ br.exports;
|
|
|
2776
2776
|
var r = t == null ? 0 : t.length;
|
|
2777
2777
|
if (!r || n < 1)
|
|
2778
2778
|
return [];
|
|
2779
|
-
for (var u = 0, o = 0,
|
|
2780
|
-
|
|
2781
|
-
return
|
|
2779
|
+
for (var u = 0, o = 0, f = g(Ye(r / n)); u < r; )
|
|
2780
|
+
f[o++] = Bt(t, u, u += n);
|
|
2781
|
+
return f;
|
|
2782
2782
|
}
|
|
2783
2783
|
function cl(t) {
|
|
2784
2784
|
for (var n = -1, e = t == null ? 0 : t.length, r = 0, u = []; ++n < e; ) {
|
|
@@ -2918,8 +2918,8 @@ br.exports;
|
|
|
2918
2918
|
return e;
|
|
2919
2919
|
var r = -1, u = [], o = t.length;
|
|
2920
2920
|
for (n = T(n, 3); ++r < o; ) {
|
|
2921
|
-
var
|
|
2922
|
-
n(
|
|
2921
|
+
var f = t[r];
|
|
2922
|
+
n(f, r, t) && (e.push(f), u.push(r));
|
|
2923
2923
|
}
|
|
2924
2924
|
return ps(t, u), e;
|
|
2925
2925
|
}
|
|
@@ -3140,8 +3140,8 @@ br.exports;
|
|
|
3140
3140
|
}
|
|
3141
3141
|
var Eh = K(function(t, n, e) {
|
|
3142
3142
|
var r = -1, u = typeof n == "function", o = xt(t) ? g(t.length) : [];
|
|
3143
|
-
return An(t, function(
|
|
3144
|
-
o[++r] = u ? It(n,
|
|
3143
|
+
return An(t, function(f) {
|
|
3144
|
+
o[++r] = u ? It(n, f, e) : _e(f, n, e);
|
|
3145
3145
|
}), o;
|
|
3146
3146
|
}), Th = sr(function(t, n, e) {
|
|
3147
3147
|
an(t, e, n);
|
|
@@ -3248,16 +3248,16 @@ br.exports;
|
|
|
3248
3248
|
return r.placeholder = co.placeholder, r;
|
|
3249
3249
|
}
|
|
3250
3250
|
function lo(t, n, e) {
|
|
3251
|
-
var r, u, o,
|
|
3251
|
+
var r, u, o, f, c, d, y = 0, m = !1, A = !1, S = !0;
|
|
3252
3252
|
if (typeof t != "function")
|
|
3253
3253
|
throw new Ft(x);
|
|
3254
3254
|
n = Mt(n) || 0, et(e) && (m = !!e.leading, A = "maxWait" in e, o = A ? at(Mt(e.maxWait) || 0, n) : o, S = "trailing" in e ? !!e.trailing : S);
|
|
3255
3255
|
function R(ut) {
|
|
3256
3256
|
var Xt = r, pn = u;
|
|
3257
|
-
return r = u = i, y = ut,
|
|
3257
|
+
return r = u = i, y = ut, f = t.apply(pn, Xt), f;
|
|
3258
3258
|
}
|
|
3259
3259
|
function O(ut) {
|
|
3260
|
-
return y = ut, c = xe(k, n), m ? R(ut) :
|
|
3260
|
+
return y = ut, c = xe(k, n), m ? R(ut) : f;
|
|
3261
3261
|
}
|
|
3262
3262
|
function B(ut) {
|
|
3263
3263
|
var Xt = ut - d, pn = ut - y, Lo = n - Xt;
|
|
@@ -3274,13 +3274,13 @@ br.exports;
|
|
|
3274
3274
|
c = xe(k, B(ut));
|
|
3275
3275
|
}
|
|
3276
3276
|
function J(ut) {
|
|
3277
|
-
return c = i, S && r ? R(ut) : (r = u = i,
|
|
3277
|
+
return c = i, S && r ? R(ut) : (r = u = i, f);
|
|
3278
3278
|
}
|
|
3279
3279
|
function Et() {
|
|
3280
3280
|
c !== i && xs(c), y = 0, r = d = u = c = i;
|
|
3281
3281
|
}
|
|
3282
3282
|
function yt() {
|
|
3283
|
-
return c === i ?
|
|
3283
|
+
return c === i ? f : J(_r());
|
|
3284
3284
|
}
|
|
3285
3285
|
function Tt() {
|
|
3286
3286
|
var ut = _r(), Xt = W(ut);
|
|
@@ -3290,7 +3290,7 @@ br.exports;
|
|
|
3290
3290
|
if (A)
|
|
3291
3291
|
return xs(c), c = xe(k, n), R(d);
|
|
3292
3292
|
}
|
|
3293
|
-
return c === i && (c = xe(k, n)),
|
|
3293
|
+
return c === i && (c = xe(k, n)), f;
|
|
3294
3294
|
}
|
|
3295
3295
|
return Tt.cancel = Et, Tt.flush = yt, Tt;
|
|
3296
3296
|
}
|
|
@@ -3309,8 +3309,8 @@ br.exports;
|
|
|
3309
3309
|
var r = arguments, u = n ? n.apply(this, r) : r[0], o = e.cache;
|
|
3310
3310
|
if (o.has(u))
|
|
3311
3311
|
return o.get(u);
|
|
3312
|
-
var
|
|
3313
|
-
return e.cache = o.set(u,
|
|
3312
|
+
var f = t.apply(this, r);
|
|
3313
|
+
return e.cache = o.set(u, f) || o, f;
|
|
3314
3314
|
};
|
|
3315
3315
|
return e.cache = new (vr.Cache || on)(), e;
|
|
3316
3316
|
}
|
|
@@ -3606,8 +3606,8 @@ br.exports;
|
|
|
3606
3606
|
t = Q(t);
|
|
3607
3607
|
var e = -1, r = n.length, u = r > 2 ? n[2] : i;
|
|
3608
3608
|
for (u && wt(n[0], n[1], u) && (r = 1); ++e < r; )
|
|
3609
|
-
for (var o = n[e],
|
|
3610
|
-
var y =
|
|
3609
|
+
for (var o = n[e], f = At(o), c = -1, d = f.length; ++c < d; ) {
|
|
3610
|
+
var y = f[c], m = t[y];
|
|
3611
3611
|
(m === i || Yt(m, Gn[y]) && !X.call(t, y)) && (t[y] = o[y]);
|
|
3612
3612
|
}
|
|
3613
3613
|
return t;
|
|
@@ -3725,8 +3725,8 @@ br.exports;
|
|
|
3725
3725
|
var o = t && t.constructor;
|
|
3726
3726
|
u ? e = r ? new o() : [] : et(t) ? e = hn(o) ? Yn(Ge(t)) : {} : e = {};
|
|
3727
3727
|
}
|
|
3728
|
-
return (u ? Dt : jt)(t, function(
|
|
3729
|
-
return n(e,
|
|
3728
|
+
return (u ? Dt : jt)(t, function(f, c, d) {
|
|
3729
|
+
return n(e, f, c, d);
|
|
3730
3730
|
}), e;
|
|
3731
3731
|
}
|
|
3732
3732
|
function rp(t, n) {
|
|
@@ -3831,7 +3831,7 @@ br.exports;
|
|
|
3831
3831
|
function Rp(t, n, e) {
|
|
3832
3832
|
var r = s.templateSettings;
|
|
3833
3833
|
e && wt(t, n, e) && (n = i), t = Y(t), n = xr({}, n, r, Us);
|
|
3834
|
-
var u = xr({}, n.imports, r.imports, Us), o = ct(u),
|
|
3834
|
+
var u = xr({}, n.imports, r.imports, Us), o = ct(u), f = ni(u, o), c, d, y = 0, m = n.interpolate || De, A = "__p += '", S = ri(
|
|
3835
3835
|
(n.escape || De).source + "|" + m.source + "|" + (m === iu ? ua : De).source + "|" + (n.evaluate || De).source + "|$",
|
|
3836
3836
|
"g"
|
|
3837
3837
|
), R = "//# sourceURL=" + (X.call(n, "sourceURL") ? (n.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Fa + "]") + `
|
|
@@ -3862,7 +3862,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
3862
3862
|
`) + A + `return __p
|
|
3863
3863
|
}`;
|
|
3864
3864
|
var B = Eo(function() {
|
|
3865
|
-
return Z(o, R + "return " + A).apply(i,
|
|
3865
|
+
return Z(o, R + "return " + A).apply(i, f);
|
|
3866
3866
|
});
|
|
3867
3867
|
if (B.source = A, Mi(B))
|
|
3868
3868
|
throw B;
|
|
@@ -3879,8 +3879,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
3879
3879
|
return Nu(t);
|
|
3880
3880
|
if (!t || !(n = Rt(n)))
|
|
3881
3881
|
return t;
|
|
3882
|
-
var r = Jt(t), u = Jt(n), o = Bu(r, u),
|
|
3883
|
-
return In(r, o,
|
|
3882
|
+
var r = Jt(t), u = Jt(n), o = Bu(r, u), f = $u(r, u) + 1;
|
|
3883
|
+
return In(r, o, f).join("");
|
|
3884
3884
|
}
|
|
3885
3885
|
function Lp(t, n, e) {
|
|
3886
3886
|
if (t = Y(t), t && (e || n === i))
|
|
@@ -3907,18 +3907,18 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
3907
3907
|
t = Y(t);
|
|
3908
3908
|
var o = t.length;
|
|
3909
3909
|
if (Hn(t)) {
|
|
3910
|
-
var
|
|
3911
|
-
o =
|
|
3910
|
+
var f = Jt(t);
|
|
3911
|
+
o = f.length;
|
|
3912
3912
|
}
|
|
3913
3913
|
if (e >= o)
|
|
3914
3914
|
return t;
|
|
3915
3915
|
var c = e - kn(r);
|
|
3916
3916
|
if (c < 1)
|
|
3917
3917
|
return r;
|
|
3918
|
-
var d =
|
|
3918
|
+
var d = f ? In(f, 0, c).join("") : t.slice(0, c);
|
|
3919
3919
|
if (u === i)
|
|
3920
3920
|
return d + r;
|
|
3921
|
-
if (
|
|
3921
|
+
if (f && (c += d.length - c), Ki(u)) {
|
|
3922
3922
|
if (t.slice(c).search(u)) {
|
|
3923
3923
|
var y, m = d;
|
|
3924
3924
|
for (u.global || (u = ri(u.source, Y(uu.exec(u)) + "g")), u.lastIndex = 0; y = u.exec(m); )
|
|
@@ -4001,10 +4001,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4001
4001
|
function Ji(t, n, e) {
|
|
4002
4002
|
var r = ct(n), u = er(n, r);
|
|
4003
4003
|
e == null && !(et(n) && (u.length || !r.length)) && (e = n, n = t, t = this, u = er(n, ct(n)));
|
|
4004
|
-
var o = !(et(e) && "chain" in e) || !!e.chain,
|
|
4004
|
+
var o = !(et(e) && "chain" in e) || !!e.chain, f = hn(t);
|
|
4005
4005
|
return Dt(u, function(c) {
|
|
4006
4006
|
var d = n[c];
|
|
4007
|
-
t[c] = d,
|
|
4007
|
+
t[c] = d, f && (t.prototype[c] = function() {
|
|
4008
4008
|
var y = this.__chain__;
|
|
4009
4009
|
if (o || y) {
|
|
4010
4010
|
var m = t(this.__wrapped__), A = m.__actions__ = mt(this.__actions__);
|
|
@@ -4159,15 +4159,15 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4159
4159
|
}, jt(G.prototype, function(t, n) {
|
|
4160
4160
|
var e = /^(?:filter|find|map|reject)|While$/.test(n), r = /^(?:head|last)$/.test(n), u = s[r ? "take" + (n == "last" ? "Right" : "") : n], o = r || /^find/.test(n);
|
|
4161
4161
|
u && (s.prototype[n] = function() {
|
|
4162
|
-
var
|
|
4162
|
+
var f = this.__wrapped__, c = r ? [1] : arguments, d = f instanceof G, y = c[0], m = d || U(f), A = function(k) {
|
|
4163
4163
|
var J = u.apply(s, yn([k], c));
|
|
4164
4164
|
return r && S ? J[0] : J;
|
|
4165
4165
|
};
|
|
4166
4166
|
m && e && typeof y == "function" && y.length != 1 && (d = m = !1);
|
|
4167
4167
|
var S = this.__chain__, R = !!this.__actions__.length, O = o && !S, B = d && !R;
|
|
4168
4168
|
if (!o && m) {
|
|
4169
|
-
|
|
4170
|
-
var W = t.apply(
|
|
4169
|
+
f = B ? f : new G(this);
|
|
4170
|
+
var W = t.apply(f, c);
|
|
4171
4171
|
return W.__actions__.push({ func: pr, args: [A], thisArg: i }), new Ut(W, S);
|
|
4172
4172
|
}
|
|
4173
4173
|
return O && B ? t.apply(this, c) : (W = this.thru(A), O ? r ? W.value()[0] : W.value() : W);
|
|
@@ -4180,8 +4180,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4180
4180
|
var o = this.value();
|
|
4181
4181
|
return n.apply(U(o) ? o : [], u);
|
|
4182
4182
|
}
|
|
4183
|
-
return this[e](function(
|
|
4184
|
-
return n.apply(U(
|
|
4183
|
+
return this[e](function(f) {
|
|
4184
|
+
return n.apply(U(f) ? f : [], u);
|
|
4185
4185
|
});
|
|
4186
4186
|
};
|
|
4187
4187
|
}), jt(G.prototype, function(t, n) {
|
|
@@ -4201,20 +4201,20 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4201
4201
|
var Bg = br.exports;
|
|
4202
4202
|
const $g = /* @__PURE__ */ Ng(Bg);
|
|
4203
4203
|
class Mg {
|
|
4204
|
-
constructor(
|
|
4204
|
+
constructor(a) {
|
|
4205
4205
|
L(this, "config");
|
|
4206
|
-
this.config =
|
|
4206
|
+
this.config = a;
|
|
4207
4207
|
}
|
|
4208
|
-
async complete(
|
|
4208
|
+
async complete(a, i) {
|
|
4209
4209
|
var p;
|
|
4210
|
-
await this.persist(
|
|
4210
|
+
await this.persist(a, { ...i, success: !0 }), (p = this.config.logger) == null || p.debug("Transaction completed:", a);
|
|
4211
4211
|
}
|
|
4212
|
-
async fail(
|
|
4212
|
+
async fail(a, i) {
|
|
4213
4213
|
var p;
|
|
4214
|
-
await this.persist(
|
|
4214
|
+
await this.persist(a, { ...i, success: !1 }), (p = this.config.logger) == null || p.debug("Transaction failed:", { ...a, ...i });
|
|
4215
4215
|
}
|
|
4216
|
-
async persist(
|
|
4217
|
-
await fetch(`${this.config.apiUrl}/transactions/${
|
|
4216
|
+
async persist(a, i) {
|
|
4217
|
+
await fetch(`${this.config.apiUrl}/transactions/${a.id}`, {
|
|
4218
4218
|
body: JSON.stringify(i),
|
|
4219
4219
|
method: "POST",
|
|
4220
4220
|
headers: {
|
|
@@ -4226,22 +4226,22 @@ class Mg {
|
|
|
4226
4226
|
}
|
|
4227
4227
|
}
|
|
4228
4228
|
class Kg {
|
|
4229
|
-
constructor(
|
|
4229
|
+
constructor(a, i) {
|
|
4230
4230
|
L(this, "transaction");
|
|
4231
4231
|
L(this, "manager");
|
|
4232
|
-
this.transaction =
|
|
4232
|
+
this.transaction = a, this.manager = i;
|
|
4233
4233
|
}
|
|
4234
4234
|
getFunctionCall() {
|
|
4235
4235
|
return this.transaction.functionCall;
|
|
4236
4236
|
}
|
|
4237
|
-
async invoke(
|
|
4237
|
+
async invoke(a, i) {
|
|
4238
4238
|
var P;
|
|
4239
4239
|
const p = this.transaction.functionCall;
|
|
4240
4240
|
if (!p) {
|
|
4241
4241
|
await this.fail("No function call found");
|
|
4242
4242
|
return;
|
|
4243
4243
|
}
|
|
4244
|
-
const _ = p.name, v = p.args, x =
|
|
4244
|
+
const _ = p.name, v = p.args, x = a[_];
|
|
4245
4245
|
if (!x) {
|
|
4246
4246
|
await this.fail(`Tool ${_} not found`);
|
|
4247
4247
|
return;
|
|
@@ -4253,11 +4253,11 @@ class Kg {
|
|
|
4253
4253
|
await this.fail(`Error executing tool ${_}: ${b}`);
|
|
4254
4254
|
}
|
|
4255
4255
|
}
|
|
4256
|
-
async complete(
|
|
4257
|
-
await this.manager.complete(this.transaction, { success: !0, output:
|
|
4256
|
+
async complete(a) {
|
|
4257
|
+
await this.manager.complete(this.transaction, { success: !0, output: a, error: null });
|
|
4258
4258
|
}
|
|
4259
|
-
async fail(
|
|
4260
|
-
await this.manager.fail(this.transaction, { success: !1, output: null, error:
|
|
4259
|
+
async fail(a) {
|
|
4260
|
+
await this.manager.fail(this.transaction, { success: !1, output: null, error: a });
|
|
4261
4261
|
}
|
|
4262
4262
|
}
|
|
4263
4263
|
class qg extends Cr {
|
|
@@ -4310,101 +4310,101 @@ class qg extends Cr {
|
|
|
4310
4310
|
return this._tools;
|
|
4311
4311
|
}
|
|
4312
4312
|
}
|
|
4313
|
-
function Hg(l,
|
|
4313
|
+
function Hg(l, a) {
|
|
4314
4314
|
if (Array.isArray(l))
|
|
4315
4315
|
return l;
|
|
4316
4316
|
if (typeof l == "object" && l !== null) {
|
|
4317
|
-
const i =
|
|
4317
|
+
const i = a.dev ? "localhost:8000" : a.baseUrl || "persona.applica.guru/api", p = a.dev ? "http" : "https", _ = a.dev ? "ws" : "wss";
|
|
4318
4318
|
let v = Object.keys(l).map((x) => {
|
|
4319
4319
|
switch (x) {
|
|
4320
4320
|
case "rest":
|
|
4321
4321
|
return kg(l[x], {
|
|
4322
4322
|
baseEndpointProtocol: p,
|
|
4323
4323
|
baseEndpoint: i,
|
|
4324
|
-
apiKey:
|
|
4325
|
-
agentId:
|
|
4326
|
-
userId:
|
|
4327
|
-
logger:
|
|
4324
|
+
apiKey: a.apiKey,
|
|
4325
|
+
agentId: a.agentId,
|
|
4326
|
+
userId: a.userId,
|
|
4327
|
+
logger: a.logger
|
|
4328
4328
|
});
|
|
4329
4329
|
case "webrtc":
|
|
4330
4330
|
return zg(l[x], {
|
|
4331
4331
|
baseWebSocketProtocol: _,
|
|
4332
4332
|
baseEndpoint: i,
|
|
4333
|
-
apiKey:
|
|
4334
|
-
agentId:
|
|
4335
|
-
userId:
|
|
4336
|
-
logger:
|
|
4333
|
+
apiKey: a.apiKey,
|
|
4334
|
+
agentId: a.agentId,
|
|
4335
|
+
userId: a.userId,
|
|
4336
|
+
logger: a.logger
|
|
4337
4337
|
});
|
|
4338
4338
|
case "websocket":
|
|
4339
4339
|
return Gg(l[x], {
|
|
4340
4340
|
baseWebSocketProtocol: _,
|
|
4341
4341
|
baseEndpoint: i,
|
|
4342
|
-
apiKey:
|
|
4343
|
-
agentId:
|
|
4344
|
-
userId:
|
|
4345
|
-
logger:
|
|
4342
|
+
apiKey: a.apiKey,
|
|
4343
|
+
agentId: a.agentId,
|
|
4344
|
+
userId: a.userId,
|
|
4345
|
+
logger: a.logger
|
|
4346
4346
|
});
|
|
4347
4347
|
default:
|
|
4348
4348
|
throw new Error(`Unknown protocol: ${x}`);
|
|
4349
4349
|
}
|
|
4350
4350
|
}).filter((x) => x !== null);
|
|
4351
|
-
return
|
|
4351
|
+
return a.tools && v.push(
|
|
4352
4352
|
new qg({
|
|
4353
4353
|
apiUrl: `${p}://${i}`,
|
|
4354
|
-
apiKey:
|
|
4355
|
-
agentId:
|
|
4356
|
-
tools:
|
|
4357
|
-
logger:
|
|
4354
|
+
apiKey: a.apiKey,
|
|
4355
|
+
agentId: a.agentId,
|
|
4356
|
+
tools: a.tools,
|
|
4357
|
+
logger: a.logger
|
|
4358
4358
|
})
|
|
4359
4359
|
), v;
|
|
4360
4360
|
}
|
|
4361
4361
|
throw new Error("Invalid protocols configuration");
|
|
4362
4362
|
}
|
|
4363
|
-
function kg(l,
|
|
4363
|
+
function kg(l, a) {
|
|
4364
4364
|
return l === !0 ? new Oo({
|
|
4365
|
-
apiUrl: `${
|
|
4366
|
-
apiKey:
|
|
4367
|
-
agentId:
|
|
4368
|
-
userId:
|
|
4369
|
-
logger:
|
|
4365
|
+
apiUrl: `${a.baseEndpointProtocol}://${a.baseEndpoint}`,
|
|
4366
|
+
apiKey: a.apiKey,
|
|
4367
|
+
agentId: a.agentId,
|
|
4368
|
+
userId: a.userId,
|
|
4369
|
+
logger: a.logger
|
|
4370
4370
|
}) : typeof l == "object" && l !== null ? new Oo(l) : null;
|
|
4371
4371
|
}
|
|
4372
|
-
function zg(l,
|
|
4372
|
+
function zg(l, a) {
|
|
4373
4373
|
return l === !0 ? new Do({
|
|
4374
|
-
webrtcUrl: `${
|
|
4375
|
-
apiKey:
|
|
4376
|
-
agentId:
|
|
4377
|
-
userId:
|
|
4378
|
-
logger:
|
|
4374
|
+
webrtcUrl: `${a.baseWebSocketProtocol}://${a.baseEndpoint}/webrtc`,
|
|
4375
|
+
apiKey: a.apiKey,
|
|
4376
|
+
agentId: a.agentId,
|
|
4377
|
+
userId: a.userId,
|
|
4378
|
+
logger: a.logger
|
|
4379
4379
|
}) : typeof l == "object" && l !== null ? new Do(l) : null;
|
|
4380
4380
|
}
|
|
4381
|
-
function Gg(l,
|
|
4381
|
+
function Gg(l, a) {
|
|
4382
4382
|
return l === !0 ? new Wo({
|
|
4383
|
-
webSocketUrl: `${
|
|
4384
|
-
apiKey:
|
|
4385
|
-
agentId:
|
|
4386
|
-
userId:
|
|
4387
|
-
logger:
|
|
4383
|
+
webSocketUrl: `${a.baseWebSocketProtocol}://${a.baseEndpoint}/websocket`,
|
|
4384
|
+
apiKey: a.apiKey,
|
|
4385
|
+
agentId: a.agentId,
|
|
4386
|
+
userId: a.userId,
|
|
4387
|
+
logger: a.logger
|
|
4388
4388
|
}) : typeof l == "object" && l !== null ? new Wo(l) : null;
|
|
4389
4389
|
}
|
|
4390
|
-
function Jg(l,
|
|
4390
|
+
function Jg(l, a, i, p, _) {
|
|
4391
4391
|
return (v) => {
|
|
4392
|
-
v.type === "message" ? Zg(v.payload, l,
|
|
4392
|
+
v.type === "message" ? Zg(v.payload, l, a, i, _) : v.type === "reasoning" ? Yg(v.payload, l, a, _) : v.type === "transaction" && Xg(v.payload, l, p);
|
|
4393
4393
|
};
|
|
4394
4394
|
}
|
|
4395
|
-
function Zg(l,
|
|
4396
|
-
l.createdAt || (l.createdAt = /* @__PURE__ */ new Date()), (l == null ? void 0 : l.finishReason) === "stop" && !(l != null && l.functionResponse) && !(l != null && l.thought) && p(!1), l.thought && (l.type = "reasoning"), l.protocol =
|
|
4395
|
+
function Zg(l, a, i, p, _) {
|
|
4396
|
+
l.createdAt || (l.createdAt = /* @__PURE__ */ new Date()), (l == null ? void 0 : l.finishReason) === "stop" && !(l != null && l.functionResponse) && !(l != null && l.thought) && p(!1), l.thought && (l.type = "reasoning"), l.protocol = a.getName(), i((v) => {
|
|
4397
4397
|
const x = Bn([...v, l]);
|
|
4398
4398
|
return _ ? _(x) : x;
|
|
4399
4399
|
});
|
|
4400
4400
|
}
|
|
4401
|
-
function Yg(l,
|
|
4401
|
+
function Yg(l, a, i, p) {
|
|
4402
4402
|
const _ = {
|
|
4403
4403
|
type: "reasoning",
|
|
4404
4404
|
text: l.thought,
|
|
4405
4405
|
role: "assistant",
|
|
4406
4406
|
finishReason: "stop",
|
|
4407
|
-
protocol:
|
|
4407
|
+
protocol: a.getName(),
|
|
4408
4408
|
createdAt: /* @__PURE__ */ new Date()
|
|
4409
4409
|
};
|
|
4410
4410
|
i((v) => {
|
|
@@ -4412,40 +4412,40 @@ function Yg(l, f, i, p) {
|
|
|
4412
4412
|
return p ? p(x) : x;
|
|
4413
4413
|
});
|
|
4414
4414
|
}
|
|
4415
|
-
function Xg(l,
|
|
4416
|
-
i.filter((p) => p !==
|
|
4415
|
+
function Xg(l, a, i) {
|
|
4416
|
+
i.filter((p) => p !== a).forEach((p) => p.onTransaction(l));
|
|
4417
4417
|
}
|
|
4418
4418
|
function Fo(l) {
|
|
4419
|
-
return new Promise((
|
|
4419
|
+
return new Promise((a, i) => {
|
|
4420
4420
|
const p = new FileReader();
|
|
4421
4421
|
p.readAsDataURL(l), p.onload = () => {
|
|
4422
4422
|
const v = p.result.split(";base64,")[1];
|
|
4423
|
-
|
|
4423
|
+
a(v);
|
|
4424
4424
|
}, p.onerror = (_) => {
|
|
4425
4425
|
i(_);
|
|
4426
4426
|
};
|
|
4427
4427
|
});
|
|
4428
4428
|
}
|
|
4429
4429
|
function Qg(l) {
|
|
4430
|
-
const
|
|
4430
|
+
const a = {
|
|
4431
4431
|
rest: (i) => i.config.apiUrl,
|
|
4432
4432
|
webrtc: (i) => i.config.webrtcUrl.replace("/webrtc", "").replace("ws://", "http://").replace("wss://", "https://"),
|
|
4433
4433
|
websocket: (i) => i.config.webSocketUrl.replace("/websocket", "").replace("ws://", "http://").replace("wss://", "https://")
|
|
4434
4434
|
};
|
|
4435
4435
|
for (const i of l) {
|
|
4436
|
-
const p =
|
|
4436
|
+
const p = a[i.getName()];
|
|
4437
4437
|
if (p)
|
|
4438
4438
|
return p(i);
|
|
4439
4439
|
}
|
|
4440
4440
|
return null;
|
|
4441
4441
|
}
|
|
4442
|
-
function Vg(l,
|
|
4442
|
+
function Vg(l, a, i, p, _) {
|
|
4443
4443
|
return async (v) => {
|
|
4444
4444
|
const x = v.content.find((E) => E.type === "text"), P = v.attachments && v.attachments.length > 0;
|
|
4445
4445
|
if (!x && !P)
|
|
4446
4446
|
throw new Error("Message must contain text or attachments");
|
|
4447
4447
|
if (!l.some((E) => E.getName() !== "transaction" && E.status === "connected")) {
|
|
4448
|
-
|
|
4448
|
+
a((E) => {
|
|
4449
4449
|
const q = {
|
|
4450
4450
|
role: "assistant",
|
|
4451
4451
|
type: "text",
|
|
@@ -4463,7 +4463,7 @@ function Vg(l, f, i, p, _) {
|
|
|
4463
4463
|
text: $,
|
|
4464
4464
|
createdAt: /* @__PURE__ */ new Date()
|
|
4465
4465
|
};
|
|
4466
|
-
|
|
4466
|
+
a((E) => {
|
|
4467
4467
|
const q = Bn([...E, C]);
|
|
4468
4468
|
return p ? p(q) : q;
|
|
4469
4469
|
}), i(!0);
|
|
@@ -4524,7 +4524,7 @@ function Vg(l, f, i, p, _) {
|
|
|
4524
4524
|
}), _ == null || _.debug("Sending message:", D), await (z == null ? void 0 : z.sendPacket({ type: "request", payload: D }));
|
|
4525
4525
|
};
|
|
4526
4526
|
}
|
|
4527
|
-
function jg(l,
|
|
4527
|
+
function jg(l, a, i, p, _, v) {
|
|
4528
4528
|
return async (x) => {
|
|
4529
4529
|
var q;
|
|
4530
4530
|
if (((q = x.content[0]) == null ? void 0 : q.type) !== "text")
|
|
@@ -4539,12 +4539,12 @@ function jg(l, f, i, p, _, v) {
|
|
|
4539
4539
|
v == null || v.debug("No parent ID provided for edit");
|
|
4540
4540
|
return;
|
|
4541
4541
|
}
|
|
4542
|
-
const $ =
|
|
4542
|
+
const $ = a.findIndex((V) => V.id === b);
|
|
4543
4543
|
if ($ === -1) {
|
|
4544
4544
|
v == null || v.debug("Parent message not found:", b);
|
|
4545
4545
|
return;
|
|
4546
4546
|
}
|
|
4547
|
-
const C =
|
|
4547
|
+
const C = a.slice(0, $ + 1), z = {
|
|
4548
4548
|
role: "user",
|
|
4549
4549
|
text: x.content[0].text,
|
|
4550
4550
|
type: "text",
|
|
@@ -4562,7 +4562,7 @@ function jg(l, f, i, p, _, v) {
|
|
|
4562
4562
|
v == null || v.debug("Sending edited message:", E), await P.sendPacket({ type: "request", payload: E });
|
|
4563
4563
|
};
|
|
4564
4564
|
}
|
|
4565
|
-
function t_(l,
|
|
4565
|
+
function t_(l, a, i, p, _, v) {
|
|
4566
4566
|
return async (x, P) => {
|
|
4567
4567
|
const b = l.sort((q, V) => V.getPriority() - q.getPriority()).find((q) => q.status === "connected");
|
|
4568
4568
|
if (!b) {
|
|
@@ -4574,12 +4574,12 @@ function t_(l, f, i, p, _, v) {
|
|
|
4574
4574
|
v == null || v.debug("No parent ID provided for reload");
|
|
4575
4575
|
return;
|
|
4576
4576
|
}
|
|
4577
|
-
const C =
|
|
4577
|
+
const C = a.findIndex((q) => q.id === $);
|
|
4578
4578
|
if (C === -1) {
|
|
4579
4579
|
v == null || v.debug("Parent message not found:", $);
|
|
4580
4580
|
return;
|
|
4581
4581
|
}
|
|
4582
|
-
const z =
|
|
4582
|
+
const z = a[C];
|
|
4583
4583
|
i((q) => {
|
|
4584
4584
|
const V = q.slice(0, C + 1);
|
|
4585
4585
|
return _ ? _(V) : V;
|
|
@@ -4587,8 +4587,8 @@ function t_(l, f, i, p, _, v) {
|
|
|
4587
4587
|
let D;
|
|
4588
4588
|
if (z.role === "assistant" || z.role === "function") {
|
|
4589
4589
|
for (let q = C - 1; q >= 0; q--)
|
|
4590
|
-
if (
|
|
4591
|
-
D =
|
|
4590
|
+
if (a[q].role === "user") {
|
|
4591
|
+
D = a[q];
|
|
4592
4592
|
break;
|
|
4593
4593
|
}
|
|
4594
4594
|
} else z.role === "user" && (D = z);
|
|
@@ -4616,8 +4616,8 @@ function t_(l, f, i, p, _, v) {
|
|
|
4616
4616
|
}), await b.sendPacket({ type: "request", payload: E });
|
|
4617
4617
|
};
|
|
4618
4618
|
}
|
|
4619
|
-
function n_(l,
|
|
4620
|
-
return () => (i(!1),
|
|
4619
|
+
function n_(l, a, i, p) {
|
|
4620
|
+
return () => (i(!1), a((_) => {
|
|
4621
4621
|
const v = _[_.length - 1];
|
|
4622
4622
|
if ((v == null ? void 0 : v.role) === "assistant" && !v.finishReason) {
|
|
4623
4623
|
const x = [..._];
|
|
@@ -4644,13 +4644,13 @@ function d_() {
|
|
|
4644
4644
|
return l;
|
|
4645
4645
|
}
|
|
4646
4646
|
function e_(l) {
|
|
4647
|
-
const
|
|
4648
|
-
if (!
|
|
4647
|
+
const a = Ir(Ie);
|
|
4648
|
+
if (!a)
|
|
4649
4649
|
throw new Error("usePersonaRuntimeProtocol must be used within a PersonaRuntimeProvider");
|
|
4650
|
-
const i =
|
|
4650
|
+
const i = a.protocols.find((_) => _.getName() === l);
|
|
4651
4651
|
if (!i)
|
|
4652
4652
|
return null;
|
|
4653
|
-
const p =
|
|
4653
|
+
const p = a.protocolsStatus.get(i.getName());
|
|
4654
4654
|
return {
|
|
4655
4655
|
...i,
|
|
4656
4656
|
connect: i.connect.bind(i),
|
|
@@ -4682,21 +4682,21 @@ function __() {
|
|
|
4682
4682
|
const Uo = "DEFAULT_THREAD_ID";
|
|
4683
4683
|
function r_() {
|
|
4684
4684
|
const l = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
4685
|
-
let
|
|
4685
|
+
let a = "";
|
|
4686
4686
|
for (let i = 0; i < 8; i++)
|
|
4687
|
-
|
|
4688
|
-
return
|
|
4687
|
+
a += l.charAt(Math.floor(Math.random() * l.length));
|
|
4688
|
+
return a;
|
|
4689
4689
|
}
|
|
4690
|
-
function i_(l,
|
|
4690
|
+
function i_(l, a, i, p, _, v, x, P, b, $) {
|
|
4691
4691
|
return {
|
|
4692
4692
|
threadId: l,
|
|
4693
|
-
threads:
|
|
4693
|
+
threads: a.filter((C) => C.status === "regular").map((C) => ({
|
|
4694
4694
|
id: C.threadId,
|
|
4695
4695
|
threadId: C.threadId,
|
|
4696
4696
|
title: C.title || `Session ${C.threadId}`,
|
|
4697
4697
|
status: C.status
|
|
4698
4698
|
})),
|
|
4699
|
-
archivedThreads:
|
|
4699
|
+
archivedThreads: a.filter((C) => C.status === "archived").map((C) => ({
|
|
4700
4700
|
id: C.threadId,
|
|
4701
4701
|
threadId: C.threadId,
|
|
4702
4702
|
title: C.title || `Archived Chat ${C.threadId}`,
|
|
@@ -4721,7 +4721,7 @@ function i_(l, f, i, p, _, v, x, P, b, $) {
|
|
|
4721
4721
|
},
|
|
4722
4722
|
onDelete: async (C) => {
|
|
4723
4723
|
if (p((z) => z.filter((D) => D.threadId !== C)), l === C) {
|
|
4724
|
-
const z =
|
|
4724
|
+
const z = a.filter((D) => D.threadId !== C && D.status === "regular");
|
|
4725
4725
|
z.length > 0 && i(z[0].threadId);
|
|
4726
4726
|
}
|
|
4727
4727
|
$ == null || $(C), C !== Uo && await _.delete(C);
|
|
@@ -4729,24 +4729,24 @@ function i_(l, f, i, p, _, v, x, P, b, $) {
|
|
|
4729
4729
|
};
|
|
4730
4730
|
}
|
|
4731
4731
|
class u_ {
|
|
4732
|
-
constructor(
|
|
4732
|
+
constructor(a) {
|
|
4733
4733
|
L(this, "endpoint");
|
|
4734
4734
|
L(this, "apiKey");
|
|
4735
4735
|
L(this, "pageSize");
|
|
4736
4736
|
L(this, "logger");
|
|
4737
|
-
this.endpoint =
|
|
4737
|
+
this.endpoint = a.endpoint.replace(/\/$/, ""), this.apiKey = a.apiKey, this.pageSize = a.pageSize ?? 200, this.logger = a.logger;
|
|
4738
4738
|
}
|
|
4739
4739
|
buildHeaders() {
|
|
4740
|
-
const
|
|
4741
|
-
return this.apiKey && (
|
|
4740
|
+
const a = { "Content-Type": "application/json" };
|
|
4741
|
+
return this.apiKey && (a["x-persona-apikey"] = this.apiKey), a;
|
|
4742
4742
|
}
|
|
4743
4743
|
/**
|
|
4744
4744
|
* Fetch messages for a session from the Persona REST API
|
|
4745
4745
|
*/
|
|
4746
|
-
async sync(
|
|
4746
|
+
async sync(a) {
|
|
4747
4747
|
var p, _;
|
|
4748
|
-
if (!
|
|
4749
|
-
const i = `${this.endpoint}/sessions/${encodeURIComponent(String(
|
|
4748
|
+
if (!a) return [];
|
|
4749
|
+
const i = `${this.endpoint}/sessions/${encodeURIComponent(String(a))}/messages?page=1&size=${this.pageSize}`;
|
|
4750
4750
|
try {
|
|
4751
4751
|
const v = await fetch(i, { method: "GET", headers: this.buildHeaders() });
|
|
4752
4752
|
if (!v.ok)
|
|
@@ -4762,7 +4762,7 @@ class u_ {
|
|
|
4762
4762
|
role: b.role ?? "assistant",
|
|
4763
4763
|
file: b.file,
|
|
4764
4764
|
sources: b.sources,
|
|
4765
|
-
sessionId: b.sessionId ??
|
|
4765
|
+
sessionId: b.sessionId ?? a,
|
|
4766
4766
|
finishReason: b.finishReason,
|
|
4767
4767
|
functionCalls: b.functionCalls,
|
|
4768
4768
|
functionResponse: b.functionResponse,
|
|
@@ -4774,19 +4774,19 @@ class u_ {
|
|
|
4774
4774
|
return (_ = this.logger) == null || _.warn("PersonaSessionStorage: error fetching messages", v), [];
|
|
4775
4775
|
}
|
|
4776
4776
|
}
|
|
4777
|
-
async archive(
|
|
4778
|
-
return this._visiblility(
|
|
4777
|
+
async archive(a) {
|
|
4778
|
+
return this._visiblility(a, "archived");
|
|
4779
4779
|
}
|
|
4780
|
-
async unarchive(
|
|
4781
|
-
return this._visiblility(
|
|
4780
|
+
async unarchive(a) {
|
|
4781
|
+
return this._visiblility(a, "active");
|
|
4782
4782
|
}
|
|
4783
|
-
async delete(
|
|
4784
|
-
return this._visiblility(
|
|
4783
|
+
async delete(a) {
|
|
4784
|
+
return this._visiblility(a, "deleted");
|
|
4785
4785
|
}
|
|
4786
|
-
async _visiblility(
|
|
4786
|
+
async _visiblility(a, i) {
|
|
4787
4787
|
var _;
|
|
4788
|
-
if (!
|
|
4789
|
-
const p = `${this.endpoint}/sessions/${encodeURIComponent(String(
|
|
4788
|
+
if (!a) return;
|
|
4789
|
+
const p = `${this.endpoint}/sessions/${encodeURIComponent(String(a))}/visibility`;
|
|
4790
4790
|
try {
|
|
4791
4791
|
const v = JSON.stringify({ visibility: i }), x = await fetch(p, { method: "PUT", headers: this.buildHeaders(), body: v });
|
|
4792
4792
|
if (!x.ok) {
|
|
@@ -4801,9 +4801,9 @@ class u_ {
|
|
|
4801
4801
|
async clearAll() {
|
|
4802
4802
|
return Promise.reject(new Error("PersonaAPIMessageStorage: clearAll not supported"));
|
|
4803
4803
|
}
|
|
4804
|
-
async list(
|
|
4804
|
+
async list(a, i) {
|
|
4805
4805
|
const p = new URLSearchParams({ page: "1", size: "100", visibility: "active" });
|
|
4806
|
-
i && p.set("userId", i),
|
|
4806
|
+
i && p.set("userId", i), a && p.set("agentId", a);
|
|
4807
4807
|
const _ = `${this.endpoint}/sessions?${p.toString()}`;
|
|
4808
4808
|
try {
|
|
4809
4809
|
const v = await fetch(_, { method: "GET", headers: this.buildHeaders() });
|
|
@@ -4822,7 +4822,7 @@ class u_ {
|
|
|
4822
4822
|
}
|
|
4823
4823
|
function s_({
|
|
4824
4824
|
dev: l = !1,
|
|
4825
|
-
baseUrl:
|
|
4825
|
+
baseUrl: a,
|
|
4826
4826
|
protocols: i,
|
|
4827
4827
|
logger: p,
|
|
4828
4828
|
children: _,
|
|
@@ -4842,9 +4842,9 @@ function s_({
|
|
|
4842
4842
|
const [gn, en] = Se(!1), [lt, pt] = Se([]), [Kt, Rn] = Se(/* @__PURE__ */ new Map()), Lt = Ar(!1), Qt = Ar(!1), qt = Qi(
|
|
4843
4843
|
() => b || new u_({
|
|
4844
4844
|
apiKey: H.apiKey,
|
|
4845
|
-
endpoint:
|
|
4845
|
+
endpoint: a || "https://persona.applica.guru/api"
|
|
4846
4846
|
}),
|
|
4847
|
-
[b,
|
|
4847
|
+
[b, a, H.apiKey]
|
|
4848
4848
|
), [Ce, Re] = Se([]), [bt, Pe] = Se(""), Pn = Ar(typeof v == "string" ? v : "new"), Ee = Ar(!1);
|
|
4849
4849
|
Sr(() => {
|
|
4850
4850
|
!P || Ee.current || (Ee.current = !0, qt.list(H.agentId, H.userId).then((M) => {
|
|
@@ -4854,14 +4854,14 @@ function s_({
|
|
|
4854
4854
|
const ft = Qi(
|
|
4855
4855
|
() => Hg(i, {
|
|
4856
4856
|
dev: l || !1,
|
|
4857
|
-
baseUrl:
|
|
4857
|
+
baseUrl: a,
|
|
4858
4858
|
apiKey: H.apiKey,
|
|
4859
4859
|
agentId: H.agentId,
|
|
4860
4860
|
userId: H.userId,
|
|
4861
4861
|
tools: H.tools,
|
|
4862
4862
|
logger: p
|
|
4863
4863
|
}),
|
|
4864
|
-
[i, l,
|
|
4864
|
+
[i, l, a, H.apiKey, H.agentId, H.userId, H.tools, p]
|
|
4865
4865
|
);
|
|
4866
4866
|
Sr(() => {
|
|
4867
4867
|
Lt.current || (Lt.current = !0, p == null || p.debug(
|
|
@@ -4985,38 +4985,38 @@ function s_({
|
|
|
4985
4985
|
});
|
|
4986
4986
|
return /* @__PURE__ */ Vi(Ie.Provider, { value: { protocols: ft, protocolsStatus: Kt, getMessages: Pr }, children: /* @__PURE__ */ Vi(Pg, { runtime: Er, children: _ }) });
|
|
4987
4987
|
}
|
|
4988
|
-
function v_({ children: l, ...
|
|
4989
|
-
return /* @__PURE__ */ Vi(s_, { ...
|
|
4988
|
+
function v_({ children: l, ...a }) {
|
|
4989
|
+
return /* @__PURE__ */ Vi(s_, { ...a, children: l });
|
|
4990
4990
|
}
|
|
4991
4991
|
class w_ {
|
|
4992
4992
|
constructor() {
|
|
4993
4993
|
L(this, "prefix", "[Persona]");
|
|
4994
4994
|
}
|
|
4995
|
-
log(
|
|
4996
|
-
console.log(`${this.prefix} - ${
|
|
4995
|
+
log(a, ...i) {
|
|
4996
|
+
console.log(`${this.prefix} - ${a}`, ...i);
|
|
4997
4997
|
}
|
|
4998
|
-
info(
|
|
4999
|
-
console.info(`${this.prefix} - ${
|
|
4998
|
+
info(a, ...i) {
|
|
4999
|
+
console.info(`${this.prefix} - ${a}`, ...i);
|
|
5000
5000
|
}
|
|
5001
|
-
warn(
|
|
5002
|
-
console.warn(`${this.prefix} - ${
|
|
5001
|
+
warn(a, ...i) {
|
|
5002
|
+
console.warn(`${this.prefix} - ${a}`, ...i);
|
|
5003
5003
|
}
|
|
5004
|
-
error(
|
|
5005
|
-
console.error(`${this.prefix} - ${
|
|
5004
|
+
error(a, ...i) {
|
|
5005
|
+
console.error(`${this.prefix} - ${a}`, ...i);
|
|
5006
5006
|
}
|
|
5007
|
-
debug(
|
|
5008
|
-
console.debug(`${this.prefix} - ${
|
|
5007
|
+
debug(a, ...i) {
|
|
5008
|
+
console.debug(`${this.prefix} - ${a}`, ...i);
|
|
5009
5009
|
}
|
|
5010
5010
|
}
|
|
5011
|
-
function ee(l,
|
|
5011
|
+
function ee(l, a, i) {
|
|
5012
5012
|
return {
|
|
5013
5013
|
type: l,
|
|
5014
|
-
description:
|
|
5014
|
+
description: a,
|
|
5015
5015
|
...i
|
|
5016
5016
|
};
|
|
5017
5017
|
}
|
|
5018
5018
|
function o_(l) {
|
|
5019
|
-
const
|
|
5019
|
+
const a = Object.entries(l.parameters).filter(([i, p]) => p.required).map(([i]) => i);
|
|
5020
5020
|
return {
|
|
5021
5021
|
type: "local",
|
|
5022
5022
|
name: l.name,
|
|
@@ -5026,7 +5026,7 @@ function o_(l) {
|
|
|
5026
5026
|
parameters: {
|
|
5027
5027
|
type: "object",
|
|
5028
5028
|
title: l.title || `${l.name} parameters`,
|
|
5029
|
-
required:
|
|
5029
|
+
required: a,
|
|
5030
5030
|
properties: l.parameters
|
|
5031
5031
|
},
|
|
5032
5032
|
output: {
|
|
@@ -5043,10 +5043,10 @@ function ji(l) {
|
|
|
5043
5043
|
implementation: l.implementation
|
|
5044
5044
|
};
|
|
5045
5045
|
}
|
|
5046
|
-
function a_(l,
|
|
5046
|
+
function a_(l, a, i, p, _, v) {
|
|
5047
5047
|
const x = {
|
|
5048
5048
|
name: l,
|
|
5049
|
-
description:
|
|
5049
|
+
description: a,
|
|
5050
5050
|
title: v == null ? void 0 : v.title,
|
|
5051
5051
|
timeout: v == null ? void 0 : v.timeout,
|
|
5052
5052
|
parameters: p,
|
|
@@ -5058,8 +5058,8 @@ function a_(l, f, i, p, _, v) {
|
|
|
5058
5058
|
const y_ = a_(
|
|
5059
5059
|
"sum",
|
|
5060
5060
|
"Sum two numbers",
|
|
5061
|
-
function(
|
|
5062
|
-
return { result:
|
|
5061
|
+
function(a, i) {
|
|
5062
|
+
return { result: a + i };
|
|
5063
5063
|
},
|
|
5064
5064
|
{
|
|
5065
5065
|
a: ee("number", "First number to sum", { required: !0 }),
|
|
@@ -5082,19 +5082,19 @@ const y_ = a_(
|
|
|
5082
5082
|
output: {
|
|
5083
5083
|
result: ee("number", "Sum of two numbers")
|
|
5084
5084
|
},
|
|
5085
|
-
implementation: function(
|
|
5086
|
-
return { result:
|
|
5085
|
+
implementation: function(a, i) {
|
|
5086
|
+
return { result: a + i };
|
|
5087
5087
|
}
|
|
5088
5088
|
});
|
|
5089
5089
|
function x_(l) {
|
|
5090
|
-
const
|
|
5090
|
+
const a = [], i = {};
|
|
5091
5091
|
return l.forEach((p) => {
|
|
5092
5092
|
const { schema: _, implementation: v } = ji(p);
|
|
5093
|
-
|
|
5094
|
-
}), { schemas:
|
|
5093
|
+
a.push(_), i[p.name] = v;
|
|
5094
|
+
}), { schemas: a, implementations: i };
|
|
5095
5095
|
}
|
|
5096
|
-
function A_(l,
|
|
5097
|
-
const { required: i, properties: p } =
|
|
5096
|
+
function A_(l, a) {
|
|
5097
|
+
const { required: i, properties: p } = a.config.parameters;
|
|
5098
5098
|
for (const _ of i)
|
|
5099
5099
|
if (!(_ in l))
|
|
5100
5100
|
throw new Error(`Missing required parameter: ${_}`);
|