@pluno/product-agent-web 0.1.49 → 0.1.50
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/product-agent-sdk.js +63 -56
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const
|
|
1
|
+
const A = '.pluno-pa-widget-host[data-pluno-product-agent-ui="widget"]', nt = '.pluno-pa-widget[data-pluno-product-agent-ui-root="widget"]', rt = ".pluno-pa-widget__panel", it = ".pluno-pa-widget__timeline", N = `${A}[data-pluno-sdk-preview-channel]`, ot = "https://app.pluno.ai", at = "gpt-5.4", ct = 2e4, ut = 2e3, I = 6e4, lt = 15e3, O = 2, dt = 15e3, ht = 5e3, pt = 1e3, gt = 8e3, _ = 1e5, ft = 100, F = "pluno.productAgent.state.", M = "pluno.productAgent.pendingEvents.", H = "pluno.productAgent.transportId";
|
|
2
2
|
class $ {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
this.options = t, this.transportId = Nt(), this.state = {
|
|
5
5
|
...this.state,
|
|
6
6
|
starterPrompts: Ct(t.initialStarterPrompts)
|
|
7
7
|
};
|
|
8
|
-
const s = t.restorePersistedState === !1 ? null :
|
|
8
|
+
const s = t.restorePersistedState === !1 ? null : ee(t.clientId, t.expectedPersistedSessionId);
|
|
9
9
|
s && (this.state = {
|
|
10
10
|
...this.state,
|
|
11
11
|
...s,
|
|
@@ -16,7 +16,7 @@ class $ {
|
|
|
16
16
|
assistantDraftRunId: null,
|
|
17
17
|
isThinking: !1,
|
|
18
18
|
lastError: null
|
|
19
|
-
}), this.queuedClientEvents =
|
|
19
|
+
}), this.queuedClientEvents = ne(t.clientId);
|
|
20
20
|
}
|
|
21
21
|
options;
|
|
22
22
|
listeners = {};
|
|
@@ -499,7 +499,7 @@ class $ {
|
|
|
499
499
|
}
|
|
500
500
|
async executeToolCall(t) {
|
|
501
501
|
const s = typeof t.sessionId == "string" ? t.sessionId : null, n = typeof t.callId == "string" ? t.callId : null, r = t.rawInput;
|
|
502
|
-
if (!s || !n || !
|
|
502
|
+
if (!s || !n || !oe(r))
|
|
503
503
|
return;
|
|
504
504
|
const i = It(this.state.messages), o = kt(i);
|
|
505
505
|
let a = null, c;
|
|
@@ -536,7 +536,7 @@ class $ {
|
|
|
536
536
|
return;
|
|
537
537
|
const t = window.fetch.bind(window), s = XMLHttpRequest.prototype.open, n = XMLHttpRequest.prototype.setRequestHeader, r = XMLHttpRequest.prototype.send;
|
|
538
538
|
window.fetch = async (i, o) => {
|
|
539
|
-
const a = Date.now(), c = new Date(a).toISOString(), u = i instanceof Request ? i : null, y = typeof i == "string" ? i : i instanceof URL ? i.toString() : u?.url ?? "", U = (o?.method ?? u?.method ?? "GET").toUpperCase(), D = j(new Headers(o?.headers ?? u?.headers ?? void 0)), q = await
|
|
539
|
+
const a = Date.now(), c = new Date(a).toISOString(), u = i instanceof Request ? i : null, y = typeof i == "string" ? i : i instanceof URL ? i.toString() : u?.url ?? "", U = (o?.method ?? u?.method ?? "GET").toUpperCase(), D = j(new Headers(o?.headers ?? u?.headers ?? void 0)), q = await ae(u, o);
|
|
540
540
|
try {
|
|
541
541
|
const d = await t(i, o);
|
|
542
542
|
return this.enqueueNetworkEvent({
|
|
@@ -548,7 +548,7 @@ class $ {
|
|
|
548
548
|
resourceType: "fetch",
|
|
549
549
|
responseStatus: d.status,
|
|
550
550
|
responseHeaders: j(d.headers),
|
|
551
|
-
responseBody: await
|
|
551
|
+
responseBody: await ce(d),
|
|
552
552
|
startedAt: c,
|
|
553
553
|
durationMs: Date.now() - a
|
|
554
554
|
}), d;
|
|
@@ -601,8 +601,8 @@ class $ {
|
|
|
601
601
|
requestBody: typeof this.__plunoMeta.requestBody == "string" ? this.__plunoMeta.requestBody : void 0,
|
|
602
602
|
resourceType: "xhr",
|
|
603
603
|
responseStatus: this.status,
|
|
604
|
-
responseHeaders:
|
|
605
|
-
responseBody:
|
|
604
|
+
responseHeaders: le(this.getAllResponseHeaders()),
|
|
605
|
+
responseBody: ue(this),
|
|
606
606
|
errorText: this.status === 0 ? "XHR request failed or was aborted" : void 0,
|
|
607
607
|
startedAt: String(this.__plunoMeta.startedAt),
|
|
608
608
|
durationMs: Date.now() - Number(this.__plunoMeta.startedAtMs ?? Date.now())
|
|
@@ -650,7 +650,7 @@ class $ {
|
|
|
650
650
|
...this.state,
|
|
651
651
|
...t,
|
|
652
652
|
...t.lastError === null && t.lastErrorCode === void 0 ? { lastErrorCode: null } : {}
|
|
653
|
-
},
|
|
653
|
+
}, se(this.options.clientId, this.state), this.emit("state", this.getState());
|
|
654
654
|
}
|
|
655
655
|
emit(t, s) {
|
|
656
656
|
this.listeners[t]?.forEach((r) => r(s));
|
|
@@ -834,7 +834,7 @@ function At() {
|
|
|
834
834
|
}
|
|
835
835
|
function G() {
|
|
836
836
|
const e = document.querySelector(N);
|
|
837
|
-
if (!(e ?? document.querySelector(
|
|
837
|
+
if (!(e ?? document.querySelector(A)))
|
|
838
838
|
return;
|
|
839
839
|
const s = e ? "browser_extension_sdk_preview" : "embedded_widget";
|
|
840
840
|
return {
|
|
@@ -843,7 +843,7 @@ function G() {
|
|
|
843
843
|
selectors: [
|
|
844
844
|
{
|
|
845
845
|
name: "widget_host",
|
|
846
|
-
selector: s === "browser_extension_sdk_preview" ? N :
|
|
846
|
+
selector: s === "browser_extension_sdk_preview" ? N : A,
|
|
847
847
|
description: "Finds Pluno's shadow-host element in the host page DOM."
|
|
848
848
|
},
|
|
849
849
|
{
|
|
@@ -943,8 +943,8 @@ function Ot(e) {
|
|
|
943
943
|
} : null;
|
|
944
944
|
}
|
|
945
945
|
function Ht(e) {
|
|
946
|
-
return Array.isArray(e) ?
|
|
947
|
-
|
|
946
|
+
return Array.isArray(e) ? C(
|
|
947
|
+
P(
|
|
948
948
|
e.map(z).filter((t) => t !== null)
|
|
949
949
|
)
|
|
950
950
|
) : [];
|
|
@@ -981,7 +981,7 @@ function z(e) {
|
|
|
981
981
|
role: r,
|
|
982
982
|
content: jt(n.content),
|
|
983
983
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
984
|
-
respondsToUserMessageId:
|
|
984
|
+
respondsToUserMessageId: E(n) ?? void 0,
|
|
985
985
|
...m(n) ? { runId: m(n) } : {},
|
|
986
986
|
attachments: Z(n.attachments)
|
|
987
987
|
};
|
|
@@ -991,7 +991,7 @@ function z(e) {
|
|
|
991
991
|
role: "tool",
|
|
992
992
|
content: Lt(n),
|
|
993
993
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
994
|
-
respondsToUserMessageId:
|
|
994
|
+
respondsToUserMessageId: E(n) ?? void 0,
|
|
995
995
|
...m(n) ? { runId: m(n) } : {},
|
|
996
996
|
dataType: String(n.type),
|
|
997
997
|
toolName: typeof n.name == "string" ? n.name : void 0,
|
|
@@ -1002,7 +1002,7 @@ function z(e) {
|
|
|
1002
1002
|
role: "system",
|
|
1003
1003
|
content: xt(n),
|
|
1004
1004
|
createdAt: typeof t.createdAt == "string" ? t.createdAt : (/* @__PURE__ */ new Date()).toISOString(),
|
|
1005
|
-
respondsToUserMessageId:
|
|
1005
|
+
respondsToUserMessageId: E(n) ?? void 0,
|
|
1006
1006
|
...m(n) ? { runId: m(n) } : {},
|
|
1007
1007
|
dataType: String(n.type),
|
|
1008
1008
|
loading: n.type === "run_status" && (n.status === "running" || n.status === "retrying")
|
|
@@ -1053,9 +1053,9 @@ function jt(e) {
|
|
|
1053
1053
|
function Ft(e, t) {
|
|
1054
1054
|
const s = $t(e, t), n = s.findIndex((i) => i.id === t.id);
|
|
1055
1055
|
if (n === -1)
|
|
1056
|
-
return
|
|
1056
|
+
return C(P([...s, t]));
|
|
1057
1057
|
const r = [...s];
|
|
1058
|
-
return r[n] = t,
|
|
1058
|
+
return r[n] = t, C(P(r));
|
|
1059
1059
|
}
|
|
1060
1060
|
function $t(e, t) {
|
|
1061
1061
|
if (t.role !== "user")
|
|
@@ -1118,8 +1118,8 @@ function Kt(e) {
|
|
|
1118
1118
|
const t = e;
|
|
1119
1119
|
return t.type === "message" && t.role === "user" ? !1 : t.type === "message" || t.type === "function_call" || t.type === "function_call_output" || t.type === "run_error" || t.type === "run_status";
|
|
1120
1120
|
}
|
|
1121
|
-
function
|
|
1122
|
-
return e.filter((t, s) => J(t) ? !
|
|
1121
|
+
function C(e) {
|
|
1122
|
+
return e.filter((t, s) => J(t) ? !te(e, s) && !Yt(e, s) && !Qt(e, s) : Zt(t) ? !Vt(e, s) : !0);
|
|
1123
1123
|
}
|
|
1124
1124
|
function Zt(e) {
|
|
1125
1125
|
return e.role === "system" && (e.dataType === "run_status" || e.dataType === "run_error");
|
|
@@ -1127,7 +1127,7 @@ function Zt(e) {
|
|
|
1127
1127
|
function J(e) {
|
|
1128
1128
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
1129
1129
|
}
|
|
1130
|
-
function
|
|
1130
|
+
function P(e) {
|
|
1131
1131
|
const t = new Set(e.filter((i) => i.role === "user").map((i) => i.id)), s = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set();
|
|
1132
1132
|
for (const i of e) {
|
|
1133
1133
|
if (i.role === "user" || !i.respondsToUserMessageId || !t.has(i.respondsToUserMessageId))
|
|
@@ -1149,7 +1149,7 @@ function Vt(e, t) {
|
|
|
1149
1149
|
const r = e[n];
|
|
1150
1150
|
if (r.role === "user")
|
|
1151
1151
|
return !1;
|
|
1152
|
-
if (r.role === "assistant" &&
|
|
1152
|
+
if (r.role === "assistant" && R(s, r))
|
|
1153
1153
|
return !0;
|
|
1154
1154
|
}
|
|
1155
1155
|
return !1;
|
|
@@ -1157,24 +1157,31 @@ function Vt(e, t) {
|
|
|
1157
1157
|
function Yt(e, t) {
|
|
1158
1158
|
const s = e[t];
|
|
1159
1159
|
for (let n = t + 1; n < e.length; n += 1)
|
|
1160
|
-
if (e[n].role === "assistant" &&
|
|
1160
|
+
if (e[n].role === "assistant" && R(s, e[n]))
|
|
1161
1161
|
return !0;
|
|
1162
1162
|
return !1;
|
|
1163
1163
|
}
|
|
1164
1164
|
function Qt(e, t) {
|
|
1165
1165
|
const s = e[t];
|
|
1166
1166
|
for (let n = t + 1; n < e.length; n += 1)
|
|
1167
|
-
if (
|
|
1167
|
+
if (e[n].role === "tool" && R(s, e[n]))
|
|
1168
|
+
return !0;
|
|
1169
|
+
return !1;
|
|
1170
|
+
}
|
|
1171
|
+
function te(e, t) {
|
|
1172
|
+
const s = e[t];
|
|
1173
|
+
for (let n = t + 1; n < e.length; n += 1)
|
|
1174
|
+
if (J(e[n]) && R(s, e[n]))
|
|
1168
1175
|
return !0;
|
|
1169
1176
|
return !1;
|
|
1170
1177
|
}
|
|
1171
|
-
function
|
|
1178
|
+
function R(e, t) {
|
|
1172
1179
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
1173
1180
|
}
|
|
1174
1181
|
function p(e, t) {
|
|
1175
1182
|
return e && typeof e == "object" && typeof e[t] == "string" ? e[t] : null;
|
|
1176
1183
|
}
|
|
1177
|
-
function
|
|
1184
|
+
function ee(e, t) {
|
|
1178
1185
|
try {
|
|
1179
1186
|
const s = window.localStorage.getItem(`${F}${e}`);
|
|
1180
1187
|
if (!s)
|
|
@@ -1182,7 +1189,7 @@ function te(e, t) {
|
|
|
1182
1189
|
const n = JSON.parse(s), r = typeof n.sessionId == "string" ? n.sessionId : null;
|
|
1183
1190
|
if (t !== void 0 && r !== t)
|
|
1184
1191
|
return null;
|
|
1185
|
-
const i = Array.isArray(n.messages) ? n.messages.map(
|
|
1192
|
+
const i = Array.isArray(n.messages) ? n.messages.map(ie).filter((o) => !!o) : [];
|
|
1186
1193
|
return {
|
|
1187
1194
|
sessionId: r,
|
|
1188
1195
|
messages: i
|
|
@@ -1191,7 +1198,7 @@ function te(e, t) {
|
|
|
1191
1198
|
return null;
|
|
1192
1199
|
}
|
|
1193
1200
|
}
|
|
1194
|
-
function
|
|
1201
|
+
function se(e, t) {
|
|
1195
1202
|
try {
|
|
1196
1203
|
window.localStorage.setItem(
|
|
1197
1204
|
`${F}${e}`,
|
|
@@ -1204,9 +1211,9 @@ function ee(e, t) {
|
|
|
1204
1211
|
return;
|
|
1205
1212
|
}
|
|
1206
1213
|
}
|
|
1207
|
-
function
|
|
1214
|
+
function ne(e) {
|
|
1208
1215
|
try {
|
|
1209
|
-
const t = window.localStorage.getItem(`${
|
|
1216
|
+
const t = window.localStorage.getItem(`${M}${e}`);
|
|
1210
1217
|
if (!t)
|
|
1211
1218
|
return [];
|
|
1212
1219
|
const s = JSON.parse(t);
|
|
@@ -1219,11 +1226,11 @@ function k(e, t) {
|
|
|
1219
1226
|
try {
|
|
1220
1227
|
const s = t.filter(K);
|
|
1221
1228
|
if (s.length === 0) {
|
|
1222
|
-
window.localStorage.removeItem(`${
|
|
1229
|
+
window.localStorage.removeItem(`${M}${e}`);
|
|
1223
1230
|
return;
|
|
1224
1231
|
}
|
|
1225
1232
|
window.localStorage.setItem(
|
|
1226
|
-
`${
|
|
1233
|
+
`${M}${e}`,
|
|
1227
1234
|
JSON.stringify(s.slice(-25))
|
|
1228
1235
|
);
|
|
1229
1236
|
} catch {
|
|
@@ -1249,14 +1256,14 @@ function Z(e) {
|
|
|
1249
1256
|
if (!s || typeof s != "object")
|
|
1250
1257
|
return !1;
|
|
1251
1258
|
const n = s;
|
|
1252
|
-
return typeof n.name == "string" &&
|
|
1259
|
+
return typeof n.name == "string" && re(n.mimeType) && typeof n.sizeBytes == "number" && typeof n.dataUrl == "string";
|
|
1253
1260
|
});
|
|
1254
1261
|
return t.length > 0 ? t : void 0;
|
|
1255
1262
|
}
|
|
1256
|
-
function
|
|
1263
|
+
function re(e) {
|
|
1257
1264
|
return e === "image/png" || e === "image/jpeg" || e === "image/webp" || e === "image/gif" || e === "application/pdf";
|
|
1258
1265
|
}
|
|
1259
|
-
function
|
|
1266
|
+
function ie(e) {
|
|
1260
1267
|
if (!e || typeof e != "object")
|
|
1261
1268
|
return null;
|
|
1262
1269
|
const t = e;
|
|
@@ -1272,7 +1279,7 @@ function re(e) {
|
|
|
1272
1279
|
loading: typeof t.loading == "boolean" ? t.loading : void 0
|
|
1273
1280
|
};
|
|
1274
1281
|
}
|
|
1275
|
-
function
|
|
1282
|
+
function E(e) {
|
|
1276
1283
|
const t = e.respondsToUserMessageId;
|
|
1277
1284
|
return typeof t == "string" && t ? t : null;
|
|
1278
1285
|
}
|
|
@@ -1280,7 +1287,7 @@ function m(e) {
|
|
|
1280
1287
|
const t = e.runId;
|
|
1281
1288
|
return typeof t == "string" && t ? t : null;
|
|
1282
1289
|
}
|
|
1283
|
-
function
|
|
1290
|
+
function oe(e) {
|
|
1284
1291
|
return !!e && typeof e == "object" && typeof e.summary == "string" && typeof e.javascript == "string";
|
|
1285
1292
|
}
|
|
1286
1293
|
function j(e) {
|
|
@@ -1289,7 +1296,7 @@ function j(e) {
|
|
|
1289
1296
|
t[n] = s;
|
|
1290
1297
|
}), t;
|
|
1291
1298
|
}
|
|
1292
|
-
async function
|
|
1299
|
+
async function ae(e, t) {
|
|
1293
1300
|
if (typeof t?.body < "u")
|
|
1294
1301
|
return V(t.body);
|
|
1295
1302
|
if (e)
|
|
@@ -1299,14 +1306,14 @@ async function oe(e, t) {
|
|
|
1299
1306
|
return;
|
|
1300
1307
|
}
|
|
1301
1308
|
}
|
|
1302
|
-
async function
|
|
1309
|
+
async function ce(e) {
|
|
1303
1310
|
try {
|
|
1304
1311
|
return g(await e.clone().text());
|
|
1305
1312
|
} catch (t) {
|
|
1306
1313
|
return { error: t instanceof Error ? t.message : "unavailable" };
|
|
1307
1314
|
}
|
|
1308
1315
|
}
|
|
1309
|
-
function
|
|
1316
|
+
function ue(e) {
|
|
1310
1317
|
try {
|
|
1311
1318
|
return e.responseType === "" || e.responseType === "text" ? g(e.responseText ?? "") : e.responseType === "json" ? g(JSON.stringify(e.response)) : `[unsupported xhr responseType: ${e.responseType || "unknown"}]`;
|
|
1312
1319
|
} catch (t) {
|
|
@@ -1332,7 +1339,7 @@ function V(e) {
|
|
|
1332
1339
|
}
|
|
1333
1340
|
}
|
|
1334
1341
|
}
|
|
1335
|
-
function
|
|
1342
|
+
function le(e) {
|
|
1336
1343
|
const t = {};
|
|
1337
1344
|
for (const s of e.trim().split(/[\r\n]+/)) {
|
|
1338
1345
|
const n = s.indexOf(":");
|
|
@@ -1341,21 +1348,21 @@ function ue(e) {
|
|
|
1341
1348
|
return t;
|
|
1342
1349
|
}
|
|
1343
1350
|
function g(e) {
|
|
1344
|
-
return e.length <=
|
|
1351
|
+
return e.length <= _ ? e : `${e.slice(0, _)}... [truncated ${e.length - _} chars]`;
|
|
1345
1352
|
}
|
|
1346
1353
|
function w(e) {
|
|
1347
1354
|
return `${e}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
1348
1355
|
}
|
|
1349
|
-
const b = "[REDACTED_SECRET]", h = "[REDACTED_TOKEN]",
|
|
1356
|
+
const b = "[REDACTED_SECRET]", h = "[REDACTED_TOKEN]", de = "[REDACTED_SIGNED_URL]", he = 20, pe = /^(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|token|api_key|apiKey|apikey|key|secret|signature|sig|password|passwd|pwd|code|state|session|jwt|csrf|csrfToken|xsrf|xsrfToken)$/i, Y = /\bBearer\s+[A-Za-z0-9._~+/=-]{12,}/gi, Q = /\bBasic\s+[A-Za-z0-9+/=-]{12,}/gi, tt = /\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g, et = /\b(access_token|accessToken|refresh_token|refreshToken|id_token|idToken|authToken|api_key|apiKey|apikey|client_secret|clientSecret|password|secret|token|jwt|csrf|csrfToken|xsrf|xsrfToken)\b\s*[:=]\s*["']?[^"',&\s}]+/gi, ge = /\bhttps?:\/\/[^\s"'<>]+(?:X-Amz-Signature|X-Goog-Signature|Signature|sig=)[^\s"'<>]*/gi, fe = /\bhttps?:\/\/[^\s"'<>]+/gi, ye = /[),.;\]]+$/;
|
|
1350
1357
|
function T(e) {
|
|
1351
1358
|
return S(e, 0, /* @__PURE__ */ new WeakSet());
|
|
1352
1359
|
}
|
|
1353
1360
|
function S(e, t, s) {
|
|
1354
1361
|
if (typeof e == "string")
|
|
1355
|
-
return e.startsWith("data:image/") || e.startsWith("data:application/pdf;") ? e :
|
|
1362
|
+
return e.startsWith("data:image/") || e.startsWith("data:application/pdf;") ? e : Ie(e);
|
|
1356
1363
|
if (e === null || typeof e != "object")
|
|
1357
1364
|
return e;
|
|
1358
|
-
if (t >=
|
|
1365
|
+
if (t >= he)
|
|
1359
1366
|
return "[REDACTED_MAX_DEPTH]";
|
|
1360
1367
|
if (s.has(e))
|
|
1361
1368
|
return "[REDACTED_CIRCULAR]";
|
|
@@ -1363,39 +1370,39 @@ function S(e, t, s) {
|
|
|
1363
1370
|
return e.map((r) => S(r, t + 1, s));
|
|
1364
1371
|
const n = {};
|
|
1365
1372
|
for (const [r, i] of Object.entries(e))
|
|
1366
|
-
|
|
1373
|
+
me(r) ? n[r] = b : n[r] = r.toLowerCase() === "url" ? Te(i) : S(i, t + 1, s);
|
|
1367
1374
|
return n;
|
|
1368
1375
|
}
|
|
1369
|
-
function
|
|
1376
|
+
function me(e) {
|
|
1370
1377
|
const t = e.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
1371
1378
|
return t.includes("authorization") || t.includes("cookie") || t.includes("password") || t.includes("passwd") || t === "pwd" || t.includes("secret") || t === "token" || t.endsWith("token") || t.includes("apikey") || t.includes("csrf") || t.includes("xsrf") || t === "jwt" || t === "session" || t === "signature" || t.includes("privatekey");
|
|
1372
1379
|
}
|
|
1373
|
-
function
|
|
1380
|
+
function Te(e) {
|
|
1374
1381
|
return typeof e == "string" ? st(e) : S(e, 0, /* @__PURE__ */ new WeakSet());
|
|
1375
1382
|
}
|
|
1376
1383
|
function st(e) {
|
|
1377
1384
|
try {
|
|
1378
1385
|
const t = new URL(e, location.href);
|
|
1379
1386
|
for (const s of Array.from(t.searchParams.keys()))
|
|
1380
|
-
|
|
1387
|
+
pe.test(s) && t.searchParams.set(s, h);
|
|
1381
1388
|
return t.username && (t.username = h), t.password && (t.password = h), t.toString();
|
|
1382
1389
|
} catch {
|
|
1383
|
-
return
|
|
1390
|
+
return ke(e);
|
|
1384
1391
|
}
|
|
1385
1392
|
}
|
|
1386
|
-
function Te(e) {
|
|
1387
|
-
return e.replace(pe, le).replace(ge, ke).replace(Y, `Bearer ${h}`).replace(Q, `Basic ${h}`).replace(tt, h).replace(et, (t, s) => `${s}: ${b}`);
|
|
1388
|
-
}
|
|
1389
1393
|
function Ie(e) {
|
|
1390
|
-
return e.replace(Y, `Bearer ${h}`).replace(Q, `Basic ${h}`).replace(tt, h).replace(et, (t, s) => `${s}: ${b}`);
|
|
1394
|
+
return e.replace(ge, de).replace(fe, we).replace(Y, `Bearer ${h}`).replace(Q, `Basic ${h}`).replace(tt, h).replace(et, (t, s) => `${s}: ${b}`);
|
|
1391
1395
|
}
|
|
1392
1396
|
function ke(e) {
|
|
1393
|
-
|
|
1397
|
+
return e.replace(Y, `Bearer ${h}`).replace(Q, `Basic ${h}`).replace(tt, h).replace(et, (t, s) => `${s}: ${b}`);
|
|
1398
|
+
}
|
|
1399
|
+
function we(e) {
|
|
1400
|
+
const t = e.match(ye)?.[0] ?? "", s = t ? e.slice(0, -t.length) : e;
|
|
1394
1401
|
return `${st(s)}${t}`;
|
|
1395
1402
|
}
|
|
1396
1403
|
export {
|
|
1397
1404
|
N as PLUNO_PRODUCT_AGENT_SDK_PREVIEW_HOST_SELECTOR,
|
|
1398
|
-
|
|
1405
|
+
A as PLUNO_PRODUCT_AGENT_WIDGET_HOST_SELECTOR,
|
|
1399
1406
|
rt as PLUNO_PRODUCT_AGENT_WIDGET_PANEL_SELECTOR,
|
|
1400
1407
|
nt as PLUNO_PRODUCT_AGENT_WIDGET_ROOT_SELECTOR,
|
|
1401
1408
|
it as PLUNO_PRODUCT_AGENT_WIDGET_TIMELINE_SELECTOR,
|
package/package.json
CHANGED