@flowengage/react-chatbot 1.7.7 → 1.7.9
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.
|
@@ -17,7 +17,7 @@ var v = Object.defineProperty, y = Object.getOwnPropertyDescriptor, b = Object.g
|
|
|
17
17
|
}, w = (e) => x.call(e, "module.exports") ? e["module.exports"] : ee(v({}, "__esModule", { value: !0 }), e), te = (e) => {
|
|
18
18
|
if (!e || typeof e != "object") throw Error("FlowEngage config is required");
|
|
19
19
|
if (!e.siteId || typeof e.siteId != "string") throw Error("[FlowEngage] config.siteId is required. Pass it as <FlowEngageProvider siteId=\"your-site-id\" /> or config={{ siteId: 'your-site-id' }}.");
|
|
20
|
-
let t = (e.apiBaseUrl || "
|
|
20
|
+
let t = (e.apiBaseUrl || "http://localhost:5001").replace(/\/+$/, "");
|
|
21
21
|
return {
|
|
22
22
|
siteId: e.siteId.trim(),
|
|
23
23
|
apiBaseUrl: t
|
|
@@ -2255,28 +2255,28 @@ function Jn(e) {
|
|
|
2255
2255
|
async function Yn(e) {
|
|
2256
2256
|
if (typeof window > "u") return !1;
|
|
2257
2257
|
try {
|
|
2258
|
-
let t = new URL(String(e).trim(), window.location.href);
|
|
2259
|
-
return
|
|
2258
|
+
let t = new URL(String(e).trim(), window.location.href), n = t.origin === window.location.origin ? t.href : new URL(t.pathname + t.search + t.hash, window.location.origin).href;
|
|
2259
|
+
return (await fetch(n, {
|
|
2260
2260
|
method: "HEAD",
|
|
2261
2261
|
mode: "same-origin",
|
|
2262
2262
|
cache: "no-store"
|
|
2263
|
-
})).ok
|
|
2263
|
+
})).ok;
|
|
2264
2264
|
} catch {
|
|
2265
2265
|
return !1;
|
|
2266
2266
|
}
|
|
2267
2267
|
}
|
|
2268
2268
|
async function Xn(e, { siteId: t, apiBaseUrl: n }) {
|
|
2269
2269
|
if (!e) return !1;
|
|
2270
|
-
if (!t || !n) return console.warn("[FlowEngage] shouldProceedWithNavigation: missing siteId or apiBaseUrl"),
|
|
2270
|
+
if (!t || !n) return console.warn("[FlowEngage] shouldProceedWithNavigation: missing siteId or apiBaseUrl"), Yn(e);
|
|
2271
2271
|
let r = String(n).replace(/\/$/, ""), i = new URLSearchParams({
|
|
2272
2272
|
siteId: String(t),
|
|
2273
2273
|
url: String(e).trim()
|
|
2274
2274
|
});
|
|
2275
2275
|
try {
|
|
2276
2276
|
let t = await (await fetch(`${r}/api/widget/navigate-allowed?${i.toString()}`)).json().catch(() => ({}));
|
|
2277
|
-
return t.success
|
|
2278
|
-
} catch (
|
|
2279
|
-
return console.warn("[FlowEngage] navigate-allowed check failed:",
|
|
2277
|
+
return t.success && t.allowed ? !0 : Yn(e);
|
|
2278
|
+
} catch (t) {
|
|
2279
|
+
return console.warn("[FlowEngage] navigate-allowed check failed:", t?.message), Yn(e);
|
|
2280
2280
|
}
|
|
2281
2281
|
}
|
|
2282
2282
|
function Zn(e) {
|
|
@@ -28561,11 +28561,15 @@ function RO(e) {
|
|
|
28561
28561
|
let e = "Missing url: pass a string url, path like /pricing, or JSON with a url field.";
|
|
28562
28562
|
return $("flowengage_navigate ✖", e), e;
|
|
28563
28563
|
}
|
|
28564
|
+
if (typeof window < "u") try {
|
|
28565
|
+
let e = new URL(i, window.location.href);
|
|
28566
|
+
e.origin !== window.location.origin && /^https?:$/i.test(e.protocol) && (i = e.pathname + e.search + e.hash, $("flowengage_navigate · normalized cross-origin URL to path:", i));
|
|
28567
|
+
} catch {}
|
|
28564
28568
|
if (!await Xn(i, {
|
|
28565
28569
|
siteId: t,
|
|
28566
28570
|
apiBaseUrl: e.apiBaseUrl
|
|
28567
28571
|
})) {
|
|
28568
|
-
let e = "
|
|
28572
|
+
let e = `Page "${i}" could not be verified. Call flowengage_search with keywords from the topic to find the correct URL, then navigate to the URL from the search results.`;
|
|
28569
28573
|
return $("flowengage_navigate ✖ blocked", e), e;
|
|
28570
28574
|
}
|
|
28571
28575
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowengage/react-chatbot",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
4
4
|
"description": "Embeddable AI chat widget for React — powered by FlowEngage. Drop it in with a single siteId.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -64,4 +64,4 @@
|
|
|
64
64
|
"vite": "^8.0.1",
|
|
65
65
|
"vite-plugin-css-injected-by-js": "^4.0.1"
|
|
66
66
|
}
|
|
67
|
-
}
|
|
67
|
+
}
|