@pagelines/sdk 1.0.660 → 1.0.662
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/AgentWrap.vue_vue_type_script_setup_true_lang.js +877 -882
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +4 -6
- package/dist/demo/index.d.ts +2 -3
- package/dist/index.js +1 -1
- package/dist/sdkClient.d.ts +6 -9
- package/dist/sdkClient.js +232 -223
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +6 -9
- package/package.json +1 -1
package/dist/sdkClient.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
var Q = Object.defineProperty;
|
|
2
2
|
var ee = (i, e, t) => e in i ? Q(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { APP_PORT as te, APP_PROD_URL as
|
|
3
|
+
var u = (i, e) => Q(i, "name", { value: e, configurable: !0 });
|
|
4
|
+
var l = (i, e, t) => ee(i, typeof e != "symbol" ? e + "" : e, t);
|
|
5
|
+
import { APP_PORT as te, APP_PROD_URL as oe, cookieUtil as S, createLogger as re, shortId as se, runAuthenticatedChatTurnStream as ie, zChatEvent as ae, objectId as P, SettingsObject as ne } from "@pagelines/core";
|
|
6
6
|
import { watch as B, ref as b, computed as V } from "vue";
|
|
7
7
|
function p(i, e) {
|
|
8
|
-
return i || (e ? `http://localhost:${te}` :
|
|
8
|
+
return i || (e ? `http://localhost:${te}` : oe);
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
u(p, "resolveApiBase");
|
|
11
11
|
function ce(i, e, t) {
|
|
12
|
-
const
|
|
13
|
-
return async (
|
|
14
|
-
const n = S.getAuthToken(),
|
|
15
|
-
|
|
16
|
-
const a = typeof
|
|
12
|
+
const o = p(i.apiBase, i.isDev);
|
|
13
|
+
return async (r, s) => {
|
|
14
|
+
const n = S.getAuthToken(), h = new Headers(s?.headers);
|
|
15
|
+
h.has("Content-Type") || h.set("Content-Type", "application/json"), n && !h.has("Authorization") && h.set("Authorization", `Bearer ${n}`);
|
|
16
|
+
const a = typeof r == "string" && r.startsWith("/") ? `${o}${r}` : r, c = await fetch(a, {
|
|
17
17
|
...s,
|
|
18
|
-
headers:
|
|
18
|
+
headers: h,
|
|
19
19
|
credentials: "include"
|
|
20
20
|
});
|
|
21
|
-
if (t &&
|
|
21
|
+
if (t && c.status === 401 && (await c.clone().json().catch(() => {
|
|
22
22
|
}))?.code === "TOKEN_ERROR" && t(), e) {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
const f = await
|
|
23
|
+
const d = c.json.bind(c);
|
|
24
|
+
c.json = async () => {
|
|
25
|
+
const f = await d();
|
|
26
26
|
return typeof f == "object" && f !== null && "ok" in f && ("user" in f || "token" in f) && e(f), f;
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
29
|
+
return c;
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
u(ce, "createApiFetch");
|
|
33
33
|
const le = /* @__PURE__ */ Symbol("clean");
|
|
34
34
|
let v = [], w = 0;
|
|
35
|
-
const
|
|
35
|
+
const T = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal = { epoch: 0 }), N = /* @__PURE__ */ u(/* @__NO_SIDE_EFFECTS__ */ (i) => {
|
|
36
36
|
let e = [], t = {
|
|
37
37
|
get() {
|
|
38
38
|
return t.lc || t.listen(() => {
|
|
@@ -40,21 +40,21 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
40
40
|
},
|
|
41
41
|
init: i,
|
|
42
42
|
lc: 0,
|
|
43
|
-
listen(
|
|
44
|
-
return t.lc = e.push(
|
|
45
|
-
for (let s = w +
|
|
46
|
-
v[s] ===
|
|
47
|
-
let
|
|
48
|
-
~
|
|
43
|
+
listen(o) {
|
|
44
|
+
return t.lc = e.push(o), () => {
|
|
45
|
+
for (let s = w + T; s < v.length; )
|
|
46
|
+
v[s] === o ? v.splice(s, T) : s += T;
|
|
47
|
+
let r = e.indexOf(o);
|
|
48
|
+
~r && (e.splice(r, 1), --t.lc || t.off());
|
|
49
49
|
};
|
|
50
50
|
},
|
|
51
|
-
notify(
|
|
51
|
+
notify(o, r) {
|
|
52
52
|
ue.epoch++;
|
|
53
53
|
let s = !v.length;
|
|
54
54
|
for (let n of e)
|
|
55
|
-
v.push(n, t.value,
|
|
55
|
+
v.push(n, t.value, o, r);
|
|
56
56
|
if (s) {
|
|
57
|
-
for (w = 0; w < v.length; w +=
|
|
57
|
+
for (w = 0; w < v.length; w += T)
|
|
58
58
|
v[w](
|
|
59
59
|
v[w + 1],
|
|
60
60
|
v[w + 2],
|
|
@@ -67,22 +67,22 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
67
67
|
We will redefine it in onMount and onStop. */
|
|
68
68
|
off() {
|
|
69
69
|
},
|
|
70
|
-
set(
|
|
71
|
-
let
|
|
72
|
-
|
|
70
|
+
set(o) {
|
|
71
|
+
let r = t.value;
|
|
72
|
+
r !== o && (t.value = o, t.notify(r));
|
|
73
73
|
},
|
|
74
|
-
subscribe(
|
|
75
|
-
let
|
|
76
|
-
return
|
|
74
|
+
subscribe(o) {
|
|
75
|
+
let r = t.listen(o);
|
|
76
|
+
return o(t.value), r;
|
|
77
77
|
},
|
|
78
78
|
value: i
|
|
79
79
|
};
|
|
80
80
|
return process.env.NODE_ENV !== "production" && (t[le] = () => {
|
|
81
81
|
e = [], t.lc = 0, t.off();
|
|
82
82
|
}), t;
|
|
83
|
-
}, "atom"), y = globalThis,
|
|
83
|
+
}, "atom"), y = globalThis, U = y.__PL_AUTH_USER__ ?? (y.__PL_AUTH_USER__ = /* @__PURE__ */ N(void 0)), E = y.__PL_AUTH_TOKEN__ ?? (y.__PL_AUTH_TOKEN__ = /* @__PURE__ */ N(null)), A = y.__PL_AUTH_DEVICE_ID__ ?? (y.__PL_AUTH_DEVICE_ID__ = /* @__PURE__ */ N(null)), z = class z {
|
|
84
84
|
constructor() {
|
|
85
|
-
|
|
85
|
+
l(this, "logger", re("SDKStorage"));
|
|
86
86
|
}
|
|
87
87
|
/**
|
|
88
88
|
* Check if localStorage is fully functional (some test environments provide partial mocks)
|
|
@@ -94,13 +94,13 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
94
94
|
* Sync Vue reactive refs with global nanostores for cross-bundle persistence.
|
|
95
95
|
*/
|
|
96
96
|
syncWithGlobalStores(e) {
|
|
97
|
-
const { activeUser: t, token:
|
|
98
|
-
s && (t.value = s), n && (
|
|
97
|
+
const { activeUser: t, token: o, deviceId: r } = e, s = U.get(), n = E.get(), h = A.get();
|
|
98
|
+
s && (t.value = s), n && (o.value = n), h && (r.value = h), B(t, (a) => U.set(a), { immediate: !0 }), B(o, (a) => E.set(a), { immediate: !0 }), B(r, (a) => A.set(a), { immediate: !0 }), U.subscribe((a) => {
|
|
99
99
|
a !== t.value && (t.value = a);
|
|
100
|
-
}),
|
|
101
|
-
a !== r.value && (r.value = a);
|
|
102
|
-
}), A.subscribe((a) => {
|
|
100
|
+
}), E.subscribe((a) => {
|
|
103
101
|
a !== o.value && (o.value = a);
|
|
102
|
+
}), A.subscribe((a) => {
|
|
103
|
+
a !== r.value && (r.value = a);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
@@ -112,13 +112,13 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
112
112
|
return;
|
|
113
113
|
const t = S.getAuthToken();
|
|
114
114
|
t && (e.token.value = t);
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
115
|
+
const o = S.getDeviceId();
|
|
116
|
+
if (o && (e.deviceId.value = o), this.isLocalStorageFunctional())
|
|
117
117
|
try {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
} catch (
|
|
121
|
-
this.logger.error("Failed to load user from localStorage", { data:
|
|
118
|
+
const r = localStorage.getItem("pagelines-user");
|
|
119
|
+
r && (e.activeUser.value = JSON.parse(r));
|
|
120
|
+
} catch (r) {
|
|
121
|
+
this.logger.error("Failed to load user from localStorage", { data: r });
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
@@ -146,7 +146,7 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
146
146
|
} catch (e) {
|
|
147
147
|
this.logger.error("Failed to clear user from localStorage", { data: e });
|
|
148
148
|
}
|
|
149
|
-
|
|
149
|
+
U.set(void 0), E.set(null), A.set(null);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
@@ -168,20 +168,20 @@ const U = 4, ue = globalThis.nanostoresGlobal || (globalThis.nanostoresGlobal =
|
|
|
168
168
|
if (this.isLocalStorageFunctional())
|
|
169
169
|
try {
|
|
170
170
|
localStorage.setItem(e, t);
|
|
171
|
-
} catch (
|
|
172
|
-
this.logger.error("Failed to set item in localStorage", { key: e, error:
|
|
171
|
+
} catch (o) {
|
|
172
|
+
this.logger.error("Failed to set item in localStorage", { key: e, error: o });
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
|
-
|
|
176
|
+
u(z, "SDKStorage");
|
|
177
177
|
let D = z;
|
|
178
178
|
const J = class J {
|
|
179
179
|
constructor(e) {
|
|
180
|
-
|
|
180
|
+
l(this, "ctx");
|
|
181
181
|
this.ctx = e;
|
|
182
182
|
}
|
|
183
183
|
async create(e) {
|
|
184
|
-
const t = e.orgId || this.resolveOrgId(),
|
|
184
|
+
const t = e.orgId || this.resolveOrgId(), o = p(this.ctx.apiBase, this.ctx.isDev), s = await (await fetch(`${o}/api/agents`, {
|
|
185
185
|
method: "POST",
|
|
186
186
|
headers: {
|
|
187
187
|
"Content-Type": "application/json",
|
|
@@ -204,16 +204,16 @@ const J = class J {
|
|
|
204
204
|
async getLiveStatus(e) {
|
|
205
205
|
const t = p(this.ctx.apiBase, this.ctx.isDev);
|
|
206
206
|
try {
|
|
207
|
-
const
|
|
207
|
+
const r = await (await fetch(`${t}/api/agents/state?ids=${encodeURIComponent(e.agentId)}`, {
|
|
208
208
|
headers: {
|
|
209
209
|
...this.ctx.token.value && { Authorization: `Bearer ${this.ctx.token.value}` }
|
|
210
210
|
}
|
|
211
211
|
})).json();
|
|
212
|
-
return
|
|
213
|
-
} catch (
|
|
212
|
+
return r.ok ? r.data?.[e.agentId] ?? { lifecycle: "unknown" } : { lifecycle: "unknown" };
|
|
213
|
+
} catch (o) {
|
|
214
214
|
return this.ctx.logger.warn("agent.getLiveStatus failed", {
|
|
215
215
|
agentId: e.agentId,
|
|
216
|
-
error:
|
|
216
|
+
error: o instanceof Error ? o.message : String(o)
|
|
217
217
|
}), { lifecycle: "unknown" };
|
|
218
218
|
}
|
|
219
219
|
}
|
|
@@ -225,28 +225,28 @@ const J = class J {
|
|
|
225
225
|
* — no magic". Map lifecycle values to user copy at the call site.
|
|
226
226
|
*/
|
|
227
227
|
async waitUntilReady(e) {
|
|
228
|
-
const { agentId: t, onStatus:
|
|
229
|
-
let
|
|
230
|
-
for (; Date.now() - n <
|
|
228
|
+
const { agentId: t, onStatus: o, timeoutMs: r = 3e5, pollIntervalMs: s = 3e3 } = e, n = Date.now();
|
|
229
|
+
let h;
|
|
230
|
+
for (; Date.now() - n < r; ) {
|
|
231
231
|
const a = await this.getLiveStatus({ agentId: t });
|
|
232
232
|
if (a.lifecycle === "running") {
|
|
233
|
-
|
|
233
|
+
o?.("running");
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
236
|
if (a.lifecycle === "error")
|
|
237
237
|
throw new Error(a.detail || "Your assistant hit a problem starting");
|
|
238
|
-
a.lifecycle !==
|
|
238
|
+
a.lifecycle !== h && (o?.(a.lifecycle), h = a.lifecycle), await new Promise((c) => setTimeout(c, s));
|
|
239
239
|
}
|
|
240
240
|
throw new Error("Your assistant is taking longer than expected — please try again");
|
|
241
241
|
}
|
|
242
242
|
/** Send a typed webhook event to a bot agent. No auth required — the proxy is public. */
|
|
243
243
|
async webhook(e) {
|
|
244
|
-
const
|
|
245
|
-
e.meta && (
|
|
246
|
-
const s = await fetch(
|
|
244
|
+
const o = `${p(this.ctx.apiBase, this.ctx.isDev)}/api/bot-api/webhooks/agents/${e.agentId}`, r = { type: e.type, data: e.data };
|
|
245
|
+
e.meta && (r.meta = e.meta);
|
|
246
|
+
const s = await fetch(o, {
|
|
247
247
|
method: "POST",
|
|
248
248
|
headers: { "Content-Type": "application/json" },
|
|
249
|
-
body: JSON.stringify(
|
|
249
|
+
body: JSON.stringify(r)
|
|
250
250
|
});
|
|
251
251
|
if (!s.ok) {
|
|
252
252
|
const n = await s.text().catch(() => "Unknown error");
|
|
@@ -261,8 +261,8 @@ const J = class J {
|
|
|
261
261
|
return t;
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
|
-
|
|
265
|
-
let
|
|
264
|
+
u(J, "AgentClient");
|
|
265
|
+
let F = J;
|
|
266
266
|
async function k(i, e) {
|
|
267
267
|
i.loading.value = !0, i.error.value = null;
|
|
268
268
|
try {
|
|
@@ -271,41 +271,41 @@ async function k(i, e) {
|
|
|
271
271
|
i.loading.value = !1;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
u(k, "withLoadingState");
|
|
275
275
|
const W = class W {
|
|
276
276
|
constructor(e) {
|
|
277
|
-
|
|
277
|
+
l(this, "ctx");
|
|
278
278
|
this.ctx = e;
|
|
279
279
|
}
|
|
280
280
|
async sendCode(e) {
|
|
281
281
|
return k(this.ctx, async () => {
|
|
282
282
|
try {
|
|
283
|
-
const
|
|
283
|
+
const o = await (await this.ctx.apiFetch("/api/auth/check-email", {
|
|
284
284
|
method: "POST",
|
|
285
285
|
body: JSON.stringify({ email: e })
|
|
286
286
|
})).json();
|
|
287
|
-
if (!
|
|
288
|
-
throw this.ctx.error.value =
|
|
287
|
+
if (!o.ok)
|
|
288
|
+
throw this.ctx.error.value = o.error, new Error(o.error);
|
|
289
289
|
} catch (t) {
|
|
290
290
|
this.ctx.logger.error("Send code error", { data: t });
|
|
291
|
-
const
|
|
292
|
-
throw this.ctx.error.value =
|
|
291
|
+
const o = t instanceof Error ? t.message : "Failed to send verification code";
|
|
292
|
+
throw this.ctx.error.value = o, t;
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
295
|
}
|
|
296
296
|
async verifyCode(e, t) {
|
|
297
297
|
return k(this.ctx, async () => {
|
|
298
298
|
try {
|
|
299
|
-
const
|
|
299
|
+
const r = await (await this.ctx.apiFetch("/api/auth/verify-code", {
|
|
300
300
|
method: "POST",
|
|
301
301
|
body: JSON.stringify({ email: e, code: t })
|
|
302
302
|
})).json();
|
|
303
|
-
if (!
|
|
304
|
-
throw this.ctx.error.value =
|
|
305
|
-
} catch (
|
|
306
|
-
this.ctx.logger.error("Verify code error", { data:
|
|
307
|
-
const
|
|
308
|
-
throw this.ctx.error.value =
|
|
303
|
+
if (!r.ok)
|
|
304
|
+
throw this.ctx.error.value = r.error, new Error(r.error);
|
|
305
|
+
} catch (o) {
|
|
306
|
+
this.ctx.logger.error("Verify code error", { data: o });
|
|
307
|
+
const r = o instanceof Error ? o.message : "Failed to verify code";
|
|
308
|
+
throw this.ctx.error.value = r, o;
|
|
309
309
|
}
|
|
310
310
|
});
|
|
311
311
|
}
|
|
@@ -340,11 +340,11 @@ const W = class W {
|
|
|
340
340
|
async requestAuthCode(e) {
|
|
341
341
|
return k(this.ctx, async () => {
|
|
342
342
|
try {
|
|
343
|
-
const
|
|
343
|
+
const o = await (await this.ctx.apiFetch("/api/auth/check-email", {
|
|
344
344
|
method: "POST",
|
|
345
345
|
body: JSON.stringify({ email: e.email })
|
|
346
346
|
})).json();
|
|
347
|
-
return
|
|
347
|
+
return o.ok ? (this.ctx.logger.info("Auth code requested successfully", { email: e.email }), !0) : (this.ctx.error.value = o.error, this.ctx.logger.error("Failed to request auth code", { email: e.email, error: o.error }), !1);
|
|
348
348
|
} catch (t) {
|
|
349
349
|
return this.ctx.logger.error("Request auth code error", { email: e.email, error: t }), this.ctx.error.value = t instanceof Error ? t.message : "Failed to request auth code", !1;
|
|
350
350
|
}
|
|
@@ -353,11 +353,11 @@ const W = class W {
|
|
|
353
353
|
async loginWithCode(e) {
|
|
354
354
|
return k(this.ctx, async () => {
|
|
355
355
|
try {
|
|
356
|
-
const
|
|
356
|
+
const o = await (await this.ctx.apiFetch("/api/auth/verify-code", {
|
|
357
357
|
method: "POST",
|
|
358
358
|
body: JSON.stringify({ email: e.email, code: e.code })
|
|
359
359
|
})).json();
|
|
360
|
-
return
|
|
360
|
+
return o.ok ? (this.ctx.logger.info("Login successful", { email: e.email }), !0) : (this.ctx.error.value = o.error, this.ctx.logger.error("Login failed", { email: e.email, error: o.error }), !1);
|
|
361
361
|
} catch (t) {
|
|
362
362
|
return this.ctx.logger.error("Login with code error", { email: e.email, error: t }), this.ctx.error.value = t instanceof Error ? t.message : "Login failed", !1;
|
|
363
363
|
}
|
|
@@ -368,45 +368,45 @@ const W = class W {
|
|
|
368
368
|
this.ctx.logger.error("loginWithGoogle: Only available in browser");
|
|
369
369
|
return;
|
|
370
370
|
}
|
|
371
|
-
const t = p(this.ctx.apiBase, this.ctx.isDev),
|
|
372
|
-
|
|
371
|
+
const t = p(this.ctx.apiBase, this.ctx.isDev), o = window.location.origin, r = `${t}/auth/google-popup?origin=${encodeURIComponent(o)}`, s = 500, n = 600, h = window.screenX + (window.outerWidth - s) / 2, a = window.screenY + (window.outerHeight - n) / 2, c = window.open(
|
|
372
|
+
r,
|
|
373
373
|
"google-auth",
|
|
374
|
-
`width=${s},height=${n},left=${
|
|
374
|
+
`width=${s},height=${n},left=${h},top=${a},popup=yes`
|
|
375
375
|
);
|
|
376
|
-
if (!
|
|
376
|
+
if (!c) {
|
|
377
377
|
const m = "Popup was blocked. Please allow popups for this site.";
|
|
378
378
|
this.ctx.error.value = m, e?.onError?.(m);
|
|
379
379
|
return;
|
|
380
380
|
}
|
|
381
|
-
const
|
|
381
|
+
const d = /* @__PURE__ */ u((m) => {
|
|
382
382
|
const I = new URL(t).origin;
|
|
383
383
|
if (m.origin === I) {
|
|
384
384
|
if (m.data?.type === "auth-success") {
|
|
385
|
-
window.removeEventListener("message",
|
|
386
|
-
const { token: x, user:
|
|
387
|
-
this.ctx.processApiResponse({ ok: !0, data: {}, token: x, user:
|
|
385
|
+
window.removeEventListener("message", d);
|
|
386
|
+
const { token: x, user: g } = m.data;
|
|
387
|
+
this.ctx.processApiResponse({ ok: !0, data: {}, token: x, user: g }), this.ctx.logger.info("Google login successful"), e?.onSuccess?.(g);
|
|
388
388
|
} else if (m.data?.type === "auth-error") {
|
|
389
|
-
window.removeEventListener("message",
|
|
389
|
+
window.removeEventListener("message", d);
|
|
390
390
|
const x = m.data.error || "Google authentication failed";
|
|
391
391
|
this.ctx.error.value = x, this.ctx.logger.error("Google login failed", { error: x }), e?.onError?.(x);
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}, "handler");
|
|
395
|
-
window.addEventListener("message",
|
|
395
|
+
window.addEventListener("message", d);
|
|
396
396
|
const f = setInterval(() => {
|
|
397
|
-
|
|
397
|
+
c.closed && (clearInterval(f), window.removeEventListener("message", d));
|
|
398
398
|
}, 500);
|
|
399
399
|
}
|
|
400
400
|
};
|
|
401
|
-
|
|
402
|
-
let
|
|
401
|
+
u(W, "AuthClient");
|
|
402
|
+
let R = W;
|
|
403
403
|
const G = class G {
|
|
404
404
|
constructor(e) {
|
|
405
|
-
|
|
405
|
+
l(this, "ctx");
|
|
406
406
|
this.ctx = e;
|
|
407
407
|
}
|
|
408
408
|
async startTrial(e) {
|
|
409
|
-
const t = this.resolveOrgId(),
|
|
409
|
+
const t = this.resolveOrgId(), o = p(this.ctx.apiBase, this.ctx.isDev), s = await (await fetch(`${o}/api/billing/checkout/create`, {
|
|
410
410
|
method: "POST",
|
|
411
411
|
headers: {
|
|
412
412
|
"Content-Type": "application/json",
|
|
@@ -425,7 +425,7 @@ const G = class G {
|
|
|
425
425
|
}
|
|
426
426
|
async confirmCheckout(e) {
|
|
427
427
|
if (e?.sessionId) {
|
|
428
|
-
const t = p(this.ctx.apiBase, this.ctx.isDev),
|
|
428
|
+
const t = p(this.ctx.apiBase, this.ctx.isDev), r = await (await fetch(`${t}/api/billing/complete-checkout`, {
|
|
429
429
|
method: "POST",
|
|
430
430
|
headers: {
|
|
431
431
|
"Content-Type": "application/json",
|
|
@@ -433,20 +433,20 @@ const G = class G {
|
|
|
433
433
|
},
|
|
434
434
|
body: JSON.stringify({ sessionId: e.sessionId })
|
|
435
435
|
})).json();
|
|
436
|
-
if (!
|
|
437
|
-
const s =
|
|
436
|
+
if (!r.ok) {
|
|
437
|
+
const s = r.error || "Failed to complete checkout";
|
|
438
438
|
throw this.ctx.error.value = s, new Error(s);
|
|
439
439
|
}
|
|
440
440
|
}
|
|
441
441
|
return this.getStatus();
|
|
442
442
|
}
|
|
443
443
|
async getStatus() {
|
|
444
|
-
const e = this.resolveOrgId(), t = p(this.ctx.apiBase, this.ctx.isDev),
|
|
444
|
+
const e = this.resolveOrgId(), t = p(this.ctx.apiBase, this.ctx.isDev), r = await (await fetch(`${t}/api/billing/details/${e}`, {
|
|
445
445
|
headers: {
|
|
446
446
|
...this.ctx.token.value && { Authorization: `Bearer ${this.ctx.token.value}` }
|
|
447
447
|
}
|
|
448
448
|
})).json();
|
|
449
|
-
if (!
|
|
449
|
+
if (!r.ok || !r.data)
|
|
450
450
|
return {
|
|
451
451
|
plan: void 0,
|
|
452
452
|
status: "none",
|
|
@@ -455,12 +455,12 @@ const G = class G {
|
|
|
455
455
|
};
|
|
456
456
|
const s = ["active", "trial", "canceling"];
|
|
457
457
|
return {
|
|
458
|
-
plan:
|
|
459
|
-
status:
|
|
460
|
-
hasActiveBilling: s.includes(
|
|
461
|
-
maxAgents:
|
|
462
|
-
...
|
|
463
|
-
...
|
|
458
|
+
plan: r.data.plan,
|
|
459
|
+
status: r.data.status,
|
|
460
|
+
hasActiveBilling: s.includes(r.data.status),
|
|
461
|
+
maxAgents: r.data.maxAgents,
|
|
462
|
+
...r.data.trialEnd && { trialEnd: r.data.trialEnd },
|
|
463
|
+
...r.data.trialDaysRemaining !== void 0 && { trialDaysRemaining: r.data.trialDaysRemaining }
|
|
464
464
|
};
|
|
465
465
|
}
|
|
466
466
|
resolveOrgId() {
|
|
@@ -470,24 +470,24 @@ const G = class G {
|
|
|
470
470
|
return t;
|
|
471
471
|
}
|
|
472
472
|
};
|
|
473
|
-
|
|
473
|
+
u(G, "BillingClient");
|
|
474
474
|
let L = G;
|
|
475
475
|
function de(i) {
|
|
476
476
|
const e = i.split(`
|
|
477
|
-
`).filter((
|
|
478
|
-
let t,
|
|
479
|
-
for (const
|
|
480
|
-
|
|
481
|
-
if (!t ||
|
|
477
|
+
`).filter((r) => r.length > 0);
|
|
478
|
+
let t, o;
|
|
479
|
+
for (const r of e)
|
|
480
|
+
r.startsWith("event:") ? t = r.slice(6).trim() : r.startsWith("data:") && (o = r.slice(5).trim());
|
|
481
|
+
if (!t || o === void 0)
|
|
482
482
|
return null;
|
|
483
483
|
try {
|
|
484
|
-
const
|
|
485
|
-
return
|
|
484
|
+
const r = ae.safeParse({ event: t, data: JSON.parse(o) });
|
|
485
|
+
return r.success ? r.data : null;
|
|
486
486
|
} catch {
|
|
487
487
|
return null;
|
|
488
488
|
}
|
|
489
489
|
}
|
|
490
|
-
|
|
490
|
+
u(de, "parseChatEvent");
|
|
491
491
|
function Y(i) {
|
|
492
492
|
return {
|
|
493
493
|
code: i.code,
|
|
@@ -498,11 +498,19 @@ function Y(i) {
|
|
|
498
498
|
...i.help ? { help: i.help } : {}
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
|
-
|
|
501
|
+
u(Y, "toChatStreamError");
|
|
502
502
|
function he(i) {
|
|
503
503
|
return i.stage === "stream-open" && i.message.startsWith("HTTP ") ? `Stream failed: ${i.message}` : i.message;
|
|
504
504
|
}
|
|
505
|
-
|
|
505
|
+
u(he, "toAuthenticatedTransportError");
|
|
506
|
+
function ge() {
|
|
507
|
+
try {
|
|
508
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone || void 0;
|
|
509
|
+
} catch {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
u(ge, "detectBrowserTimezone");
|
|
506
514
|
function X(i) {
|
|
507
515
|
if (!(i.role !== "assistant" && i.role !== "system"))
|
|
508
516
|
return {
|
|
@@ -519,20 +527,20 @@ function X(i) {
|
|
|
519
527
|
...i.metadata?.issue ? { issue: i.metadata.issue } : {}
|
|
520
528
|
};
|
|
521
529
|
}
|
|
522
|
-
|
|
530
|
+
u(X, "toChatMessage");
|
|
523
531
|
const q = class q {
|
|
524
532
|
constructor(e) {
|
|
525
|
-
|
|
533
|
+
l(this, "ctx");
|
|
526
534
|
this.ctx = e;
|
|
527
535
|
}
|
|
528
536
|
async cancelConversationTurn(e) {
|
|
529
|
-
const t = p(this.ctx.apiBase, this.ctx.isDev),
|
|
537
|
+
const t = p(this.ctx.apiBase, this.ctx.isDev), o = this.ctx.token.value ? { Authorization: `Bearer ${this.ctx.token.value}` } : {}, r = await fetch(`${t}/api/conversations/${encodeURIComponent(e.conversationId)}/cancel`, {
|
|
530
538
|
method: "POST",
|
|
531
|
-
headers: { "Content-Type": "application/json", ...
|
|
539
|
+
headers: { "Content-Type": "application/json", ...o },
|
|
532
540
|
body: JSON.stringify(e.turnId ? { turnId: e.turnId } : {})
|
|
533
|
-
}), s = await
|
|
541
|
+
}), s = await r.json();
|
|
534
542
|
if (!s.ok)
|
|
535
|
-
throw new Error(s.error || `Cancel failed: HTTP ${
|
|
543
|
+
throw new Error(s.error || `Cancel failed: HTTP ${r.status}`);
|
|
536
544
|
return s.data;
|
|
537
545
|
}
|
|
538
546
|
/**
|
|
@@ -546,10 +554,10 @@ const q = class q {
|
|
|
546
554
|
* which stores a stable ID in localStorage).
|
|
547
555
|
*/
|
|
548
556
|
async chatStreamPublic(e) {
|
|
549
|
-
const
|
|
550
|
-
let
|
|
557
|
+
const o = `${p(this.ctx.apiBase, this.ctx.isDev)}/api/agents/public/${encodeURIComponent(e.handle)}/chat/v2/stream`;
|
|
558
|
+
let r = "", s = !1, n = !1, h;
|
|
551
559
|
try {
|
|
552
|
-
const a = await fetch(
|
|
560
|
+
const a = await fetch(o, {
|
|
553
561
|
method: "POST",
|
|
554
562
|
headers: { "Content-Type": "application/json" },
|
|
555
563
|
body: JSON.stringify({
|
|
@@ -564,54 +572,54 @@ const q = class q {
|
|
|
564
572
|
e.onError(f.error || `HTTP ${a.status}`);
|
|
565
573
|
return;
|
|
566
574
|
}
|
|
567
|
-
if (
|
|
575
|
+
if (r = a.headers.get("X-Conversation-Id") || "", h = a.body?.getReader(), !h) {
|
|
568
576
|
e.onError("No response stream");
|
|
569
577
|
return;
|
|
570
578
|
}
|
|
571
|
-
const
|
|
572
|
-
let
|
|
579
|
+
const c = new TextDecoder();
|
|
580
|
+
let d = "";
|
|
573
581
|
e: for (; ; ) {
|
|
574
|
-
const { done: f, value: m } = await
|
|
582
|
+
const { done: f, value: m } = await h.read();
|
|
575
583
|
if (f)
|
|
576
584
|
break;
|
|
577
|
-
|
|
578
|
-
let I =
|
|
585
|
+
d += c.decode(m, { stream: !0 });
|
|
586
|
+
let I = d.indexOf(`
|
|
579
587
|
|
|
580
588
|
`);
|
|
581
589
|
for (; I !== -1; ) {
|
|
582
|
-
const x =
|
|
583
|
-
|
|
584
|
-
const
|
|
585
|
-
if (
|
|
586
|
-
if (
|
|
587
|
-
e.onStatus?.(
|
|
588
|
-
else if (
|
|
589
|
-
e.onToolActivity?.(
|
|
590
|
-
else if (
|
|
590
|
+
const x = d.slice(0, I);
|
|
591
|
+
d = d.slice(I + 2);
|
|
592
|
+
const g = de(x);
|
|
593
|
+
if (g) {
|
|
594
|
+
if (g.event === "working_state")
|
|
595
|
+
e.onStatus?.(g.data.description);
|
|
596
|
+
else if (g.event === "tool_activity")
|
|
597
|
+
e.onToolActivity?.(g.data);
|
|
598
|
+
else if (g.event === "working_end")
|
|
591
599
|
e.onWorkingEnd?.();
|
|
592
|
-
else if (
|
|
593
|
-
e.onDelta(
|
|
594
|
-
else if (
|
|
595
|
-
s = !0, e.onError(Y(
|
|
600
|
+
else if (g.event === "message_delta")
|
|
601
|
+
e.onDelta(g.data.delta, g.data.role);
|
|
602
|
+
else if (g.event === "error") {
|
|
603
|
+
s = !0, e.onError(Y(g.data));
|
|
596
604
|
break e;
|
|
597
|
-
} else if (
|
|
605
|
+
} else if (g.event === "message" && (g.data.message.role === "assistant" || g.data.message.role === "system")) {
|
|
598
606
|
n = !0;
|
|
599
|
-
const K = X(
|
|
607
|
+
const K = X(g.data.message);
|
|
600
608
|
K && e.onMessage?.(K);
|
|
601
|
-
} else if (
|
|
609
|
+
} else if (g.event === "stream_end")
|
|
602
610
|
break e;
|
|
603
611
|
}
|
|
604
|
-
I =
|
|
612
|
+
I = d.indexOf(`
|
|
605
613
|
|
|
606
614
|
`);
|
|
607
615
|
}
|
|
608
616
|
}
|
|
609
|
-
!s && n ? e.onDone(
|
|
617
|
+
!s && n ? e.onDone(r) : s || e.onError("Stream ended before reply arrived");
|
|
610
618
|
} catch (a) {
|
|
611
619
|
e.onError(a instanceof Error ? a.message : "Stream failed");
|
|
612
620
|
} finally {
|
|
613
621
|
try {
|
|
614
|
-
await
|
|
622
|
+
await h?.cancel();
|
|
615
623
|
} catch {
|
|
616
624
|
}
|
|
617
625
|
}
|
|
@@ -625,67 +633,68 @@ const q = class q {
|
|
|
625
633
|
* Mirrors `src/modules/agent/client.ts → sendChatMessageStream`.
|
|
626
634
|
*/
|
|
627
635
|
async chatStreamAuthenticated(e) {
|
|
628
|
-
const t = p(this.ctx.apiBase, this.ctx.isDev),
|
|
629
|
-
let
|
|
636
|
+
const t = p(this.ctx.apiBase, this.ctx.isDev), o = this.ctx.token.value ? { Authorization: `Bearer ${this.ctx.token.value}` } : {};
|
|
637
|
+
let r, s = null;
|
|
630
638
|
try {
|
|
631
|
-
const
|
|
639
|
+
const c = await fetch(`${t}/api/conversations`, {
|
|
632
640
|
method: "POST",
|
|
633
|
-
headers: { "Content-Type": "application/json", ...
|
|
641
|
+
headers: { "Content-Type": "application/json", ...o },
|
|
634
642
|
body: JSON.stringify({ agentId: e.agentId })
|
|
635
|
-
}),
|
|
636
|
-
if (!
|
|
637
|
-
e.onError(
|
|
643
|
+
}), d = await c.json();
|
|
644
|
+
if (!d.ok) {
|
|
645
|
+
e.onError(d.error || `Conversation failed: HTTP ${c.status}`);
|
|
638
646
|
return;
|
|
639
647
|
}
|
|
640
|
-
|
|
641
|
-
} catch (
|
|
642
|
-
e.onError(
|
|
648
|
+
r = d.data.conversationId, s = d.data.latestSequence ?? null;
|
|
649
|
+
} catch (c) {
|
|
650
|
+
e.onError(c instanceof Error ? c.message : "Conversation failed");
|
|
643
651
|
return;
|
|
644
652
|
}
|
|
645
|
-
const n = s ? `${t}/api/conversations/${encodeURIComponent(
|
|
653
|
+
const n = s ? `${t}/api/conversations/${encodeURIComponent(r)}/stream?since=${encodeURIComponent(s)}` : `${t}/api/conversations/${encodeURIComponent(r)}/stream`, h = `nonce_${se(16)}`, a = ge();
|
|
646
654
|
await ie({
|
|
647
655
|
streamUrl: n,
|
|
648
656
|
sendUrl: `${t}/api/messages`,
|
|
649
|
-
headers:
|
|
657
|
+
headers: o,
|
|
650
658
|
sendBody: {
|
|
651
|
-
conversationId:
|
|
659
|
+
conversationId: r,
|
|
652
660
|
content: e.message,
|
|
653
|
-
clientNonce:
|
|
661
|
+
clientNonce: h,
|
|
662
|
+
...a ? { viewerTimezone: a } : {},
|
|
654
663
|
...e.attachments && e.attachments.length > 0 ? { attachments: e.attachments } : {}
|
|
655
664
|
},
|
|
656
665
|
onStatus: e.onStatus,
|
|
657
666
|
onDelta: e.onDelta,
|
|
658
667
|
onToolActivity: e.onToolActivity,
|
|
659
668
|
onWorkingEnd: e.onWorkingEnd,
|
|
660
|
-
onMessage: /* @__PURE__ */
|
|
661
|
-
const
|
|
662
|
-
|
|
669
|
+
onMessage: /* @__PURE__ */ u((c) => {
|
|
670
|
+
const d = X(c);
|
|
671
|
+
d && e.onMessage?.(d);
|
|
663
672
|
}, "onMessage"),
|
|
664
|
-
onDone: /* @__PURE__ */
|
|
665
|
-
onChatError: /* @__PURE__ */
|
|
673
|
+
onDone: /* @__PURE__ */ u(() => e.onDone(r), "onDone"),
|
|
674
|
+
onChatError: /* @__PURE__ */ u((c) => e.onError(Y(c)), "onChatError"),
|
|
666
675
|
// A coded rejection (e.g. TURN_ACTIVE) stays structured so the
|
|
667
676
|
// controller can switch on it; only uncoded transport failures
|
|
668
677
|
// flatten to the legacy string path.
|
|
669
|
-
onTransportError: /* @__PURE__ */
|
|
678
|
+
onTransportError: /* @__PURE__ */ u((c) => e.onError(c.code ? { code: c.code, error: c.message } : he(c)), "onTransportError")
|
|
670
679
|
});
|
|
671
680
|
}
|
|
672
681
|
};
|
|
673
|
-
|
|
682
|
+
u(q, "ChatClient");
|
|
674
683
|
let j = q;
|
|
675
684
|
const M = class M {
|
|
676
685
|
constructor(e) {
|
|
677
|
-
|
|
686
|
+
l(this, "ctx");
|
|
678
687
|
this.ctx = e;
|
|
679
688
|
}
|
|
680
689
|
async getPublicAgent(e) {
|
|
681
690
|
this.ctx.loading.value = !0, this.ctx.error.value = null;
|
|
682
691
|
try {
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
685
|
-
this.ctx.error.value =
|
|
692
|
+
const o = await (await this.ctx.apiFetch(`/api/agents/public/${encodeURIComponent(e.handle)}`)).json();
|
|
693
|
+
if (!o.ok) {
|
|
694
|
+
this.ctx.error.value = o.error, this.ctx.logger.error("Failed to fetch public agent", { handle: e.handle, error: o.error });
|
|
686
695
|
return;
|
|
687
696
|
}
|
|
688
|
-
return
|
|
697
|
+
return o.data;
|
|
689
698
|
} catch (t) {
|
|
690
699
|
this.ctx.logger.error("Get public agent error", { handle: e.handle, error: t }), this.ctx.error.value = t instanceof Error ? t.message : "Failed to fetch agent";
|
|
691
700
|
return;
|
|
@@ -696,12 +705,12 @@ const M = class M {
|
|
|
696
705
|
async getAgentByEmail(e) {
|
|
697
706
|
this.ctx.loading.value = !0, this.ctx.error.value = null;
|
|
698
707
|
try {
|
|
699
|
-
const
|
|
700
|
-
if (!
|
|
701
|
-
this.ctx.error.value =
|
|
708
|
+
const o = await (await this.ctx.apiFetch(`/api/agents/by-email/${encodeURIComponent(e.email)}`)).json();
|
|
709
|
+
if (!o.ok) {
|
|
710
|
+
this.ctx.error.value = o.error, this.ctx.logger.error("Failed to fetch agent by email", { email: e.email, error: o.error });
|
|
702
711
|
return;
|
|
703
712
|
}
|
|
704
|
-
return
|
|
713
|
+
return o.data;
|
|
705
714
|
} catch (t) {
|
|
706
715
|
this.ctx.logger.error("Get agent by email error", { email: e.email, error: t }), this.ctx.error.value = t instanceof Error ? t.message : "Failed to fetch agent";
|
|
707
716
|
return;
|
|
@@ -727,11 +736,11 @@ const M = class M {
|
|
|
727
736
|
}
|
|
728
737
|
}
|
|
729
738
|
};
|
|
730
|
-
|
|
739
|
+
u(M, "UserClient");
|
|
731
740
|
let C = M;
|
|
732
741
|
const H = class H {
|
|
733
742
|
constructor() {
|
|
734
|
-
|
|
743
|
+
l(this, "key", "__PAGELINES_SDK__");
|
|
735
744
|
}
|
|
736
745
|
get() {
|
|
737
746
|
if (!(typeof window > "u"))
|
|
@@ -744,53 +753,53 @@ const H = class H {
|
|
|
744
753
|
typeof window < "u" && delete globalThis[this.key];
|
|
745
754
|
}
|
|
746
755
|
};
|
|
747
|
-
|
|
756
|
+
u(H, "SDKGlobal");
|
|
748
757
|
let _ = H;
|
|
749
758
|
const $ = new _(), O = class O extends ne {
|
|
750
759
|
constructor(t = {}) {
|
|
751
|
-
const
|
|
752
|
-
if (
|
|
753
|
-
return console.debug("[PageLinesSDK] Returning existing singleton instance"),
|
|
760
|
+
const o = $.get();
|
|
761
|
+
if (o)
|
|
762
|
+
return console.debug("[PageLinesSDK] Returning existing singleton instance"), o;
|
|
754
763
|
super("PageLinesSDK", t);
|
|
755
764
|
// Vue reactive state
|
|
756
|
-
|
|
757
|
-
|
|
765
|
+
l(this, "activeUser", b());
|
|
766
|
+
l(this, "token", b(null));
|
|
758
767
|
// Opaque session token for Bearer clients. Web may also have the same
|
|
759
768
|
// credential in the HttpOnly pl-session cookie, which JS cannot read.
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
769
|
+
l(this, "deviceId", b(null));
|
|
770
|
+
l(this, "loading", b(!1));
|
|
771
|
+
l(this, "error", b(null));
|
|
772
|
+
l(this, "apiBase", this.settings.apiBase || void 0);
|
|
764
773
|
// Storage handler for persistence
|
|
765
|
-
|
|
774
|
+
l(this, "storage", new D());
|
|
766
775
|
// Auto-managed session ID for usage tracking
|
|
767
|
-
|
|
776
|
+
l(this, "sessionId", P({ prefix: "ses" }));
|
|
768
777
|
// Computed properties derived from activeUser (matches UserClient pattern)
|
|
769
|
-
|
|
778
|
+
l(this, "currentAgent", V(() => {
|
|
770
779
|
const t = this.activeUser.value;
|
|
771
780
|
if (!t?.agents)
|
|
772
781
|
return;
|
|
773
|
-
const
|
|
774
|
-
if (
|
|
775
|
-
return t.agents.find((
|
|
782
|
+
const o = t.primaryAgentId || t.agents[0]?.agentId;
|
|
783
|
+
if (o)
|
|
784
|
+
return t.agents.find((r) => r.agentId === o);
|
|
776
785
|
}));
|
|
777
|
-
|
|
786
|
+
l(this, "currentOrg", V(() => {
|
|
778
787
|
const t = this.currentAgent.value;
|
|
779
788
|
if (!t?.orgId)
|
|
780
789
|
return;
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
return
|
|
790
|
+
const o = this.activeUser.value;
|
|
791
|
+
if (o?.orgs)
|
|
792
|
+
return o.orgs.find((r) => r.orgId === t.orgId);
|
|
784
793
|
}));
|
|
785
794
|
// Initialization state
|
|
786
|
-
|
|
787
|
-
|
|
795
|
+
l(this, "initialized");
|
|
796
|
+
l(this, "resolveUser");
|
|
788
797
|
// Sub-clients (new preferred API surface)
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
798
|
+
l(this, "agent");
|
|
799
|
+
l(this, "auth");
|
|
800
|
+
l(this, "billing");
|
|
801
|
+
l(this, "chat");
|
|
802
|
+
l(this, "user");
|
|
794
803
|
$.set(this);
|
|
795
804
|
const s = {
|
|
796
805
|
apiFetch: ce(
|
|
@@ -810,7 +819,7 @@ const $ = new _(), O = class O extends ne {
|
|
|
810
819
|
logger: this.logger,
|
|
811
820
|
processApiResponse: this.processApiResponse.bind(this)
|
|
812
821
|
};
|
|
813
|
-
this.agent = new
|
|
822
|
+
this.agent = new F(s), this.auth = new R(s), this.billing = new L(s), this.chat = new j(s), this.user = new C(s), this.logger.info("PageLinesSDK initialized"), this.storage.loadFromStorage(this.authRefs()), this.storage.syncWithGlobalStores(this.authRefs()), this.initialized = new Promise((n) => {
|
|
814
823
|
this.resolveUser = n;
|
|
815
824
|
}), this.token.value && !this.activeUser.value ? this.auth.getCurrentUser().then((n) => {
|
|
816
825
|
this.resolveUser && (this.resolveUser(n), this.resolveUser = void 0);
|
|
@@ -832,10 +841,10 @@ const $ = new _(), O = class O extends ne {
|
|
|
832
841
|
// Process ApiResponse for automatic user/token updates - public for dependency injection
|
|
833
842
|
processApiResponse(t) {
|
|
834
843
|
if (!t.ok) return;
|
|
835
|
-
let
|
|
836
|
-
t.user && (this.activeUser.value = t.user, this.logger.info("User updated from API response", { data: t.user }),
|
|
837
|
-
const
|
|
838
|
-
|
|
844
|
+
let o = !1;
|
|
845
|
+
t.user && (this.activeUser.value = t.user, this.logger.info("User updated from API response", { data: t.user }), o = !0), t.token && (this.token.value = t.token, this.logger.info("Token updated from API response"), o = !0);
|
|
846
|
+
const r = t.data?.deviceId;
|
|
847
|
+
r && (this.deviceId.value = r, o = !0), o && this.persistAuth(), this.resolveUser && (this.resolveUser(t.user), this.resolveUser = void 0);
|
|
839
848
|
}
|
|
840
849
|
authRefs() {
|
|
841
850
|
return {
|
|
@@ -856,15 +865,15 @@ const $ = new _(), O = class O extends ne {
|
|
|
856
865
|
this.logger.info("Clearing SDK completely"), this.clearSession(), this.loading.value = !1, this.sessionId = P({ prefix: "ses" }), $.delete();
|
|
857
866
|
}
|
|
858
867
|
};
|
|
859
|
-
|
|
868
|
+
u(O, "PageLinesSDK");
|
|
860
869
|
let Z = O;
|
|
861
870
|
export {
|
|
862
|
-
|
|
871
|
+
F as A,
|
|
863
872
|
L as B,
|
|
864
873
|
j as C,
|
|
865
874
|
Z as P,
|
|
866
875
|
C as U,
|
|
867
|
-
|
|
876
|
+
R as a,
|
|
868
877
|
p as r
|
|
869
878
|
};
|
|
870
879
|
//# sourceMappingURL=sdkClient.js.map
|