@webless/agent 0.14.1 → 0.14.3
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/README.md +3 -3
- package/dist/{chunk-ZHEXHTHJ.js → chunk-RUZGX75D.js} +9 -12
- package/dist/{chunk-ZHEXHTHJ.js.map → chunk-RUZGX75D.js.map} +1 -1
- package/dist/embed.cjs +18 -12
- package/dist/embed.cjs.map +1 -1
- package/dist/embed.css +94 -5
- package/dist/embed.css.map +1 -1
- package/dist/embed.d.cts +2 -2
- package/dist/embed.d.ts +2 -2
- package/dist/embed.js +10 -2
- package/dist/embed.js.map +1 -1
- package/dist/{panel-controller-CDWodIJl.d.cts → panel-controller-csugUSgZ.d.cts} +5 -1
- package/dist/{panel-controller-CDWodIJl.d.ts → panel-controller-csugUSgZ.d.ts} +5 -1
- package/dist/react.cjs +8 -11
- package/dist/react.cjs.map +1 -1
- package/dist/react.css +94 -5
- package/dist/react.css.map +1 -1
- package/dist/react.d.cts +4 -3
- package/dist/react.d.ts +4 -3
- package/dist/react.js +1 -1
- package/package.json +1 -1
package/dist/embed.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Root } from 'react-dom/client';
|
|
2
|
-
import {
|
|
3
|
-
export { f as AgentIndexVersion, k as AgentMountStrategy, l as
|
|
2
|
+
import { x as AgentTagManifest, P as NormalizedAgentTagManifest } from './panel-controller-csugUSgZ.cjs';
|
|
3
|
+
export { f as AgentIndexVersion, k as AgentMountStrategy, l as AgentPanelPresentation, m as AgentPanelSubmitOptions, n as AgentPlacementConfig, v as AgentTabSide, w as AgentTabVariant, M as DEFAULT_AGENT_PLACEMENT, a4 as normalizeAgentPanelPresentation, a5 as normalizeAgentPlacement, a6 as normalizeAgentTagManifest, a8 as resetAgentPanel, a9 as submitAgentPanel } from './panel-controller-csugUSgZ.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
package/dist/embed.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Root } from 'react-dom/client';
|
|
2
|
-
import {
|
|
3
|
-
export { f as AgentIndexVersion, k as AgentMountStrategy, l as
|
|
2
|
+
import { x as AgentTagManifest, P as NormalizedAgentTagManifest } from './panel-controller-csugUSgZ.js';
|
|
3
|
+
export { f as AgentIndexVersion, k as AgentMountStrategy, l as AgentPanelPresentation, m as AgentPanelSubmitOptions, n as AgentPlacementConfig, v as AgentTabSide, w as AgentTabVariant, M as DEFAULT_AGENT_PLACEMENT, a4 as normalizeAgentPanelPresentation, a5 as normalizeAgentPlacement, a6 as normalizeAgentTagManifest, a8 as resetAgentPanel, a9 as submitAgentPanel } from './panel-controller-csugUSgZ.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'react';
|
|
6
6
|
|
package/dist/embed.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
resetAgentPanel,
|
|
10
10
|
resolveAgentRuntimeConfig,
|
|
11
11
|
submitAgentPanel
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RUZGX75D.js";
|
|
13
13
|
|
|
14
14
|
// src/embed/mount.tsx
|
|
15
15
|
import { createRoot } from "react-dom/client";
|
|
@@ -43,6 +43,7 @@ function AgentWidget2({
|
|
|
43
43
|
handoffEnabled: manifest.handoffEnabled,
|
|
44
44
|
previewBuildId: manifest.version === "unpublished" ? readUnpublishedPreviewBuildId() : void 0,
|
|
45
45
|
placement: manifest.placement,
|
|
46
|
+
panelPresentation: manifest.panelPresentation,
|
|
46
47
|
pageShift: manifest.pageShift,
|
|
47
48
|
colorScheme: manifest.colorScheme,
|
|
48
49
|
branding: manifest.branding,
|
|
@@ -54,6 +55,9 @@ function AgentWidget2({
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
// src/embed/manifest.ts
|
|
58
|
+
function normalizeAgentPanelPresentation(value) {
|
|
59
|
+
return value === "popup" ? "popup" : "drawer";
|
|
60
|
+
}
|
|
57
61
|
function normalizeAgentTagManifest(manifest) {
|
|
58
62
|
const indexId = manifest.indexId.trim();
|
|
59
63
|
if (!indexId) {
|
|
@@ -89,7 +93,10 @@ function normalizeAgentTagManifest(manifest) {
|
|
|
89
93
|
strategy: manifest.mount?.strategy ?? "body"
|
|
90
94
|
},
|
|
91
95
|
placement: normalizeAgentPlacement(manifest.placement),
|
|
92
|
-
|
|
96
|
+
panelPresentation: normalizeAgentPanelPresentation(
|
|
97
|
+
manifest.panelPresentation
|
|
98
|
+
),
|
|
99
|
+
pageShift: normalizeAgentPanelPresentation(manifest.panelPresentation) === "popup" ? false : manifest.pageShift ?? true,
|
|
93
100
|
colorScheme,
|
|
94
101
|
...branding ? { branding } : {},
|
|
95
102
|
...analytics ? { analytics } : {}
|
|
@@ -282,6 +289,7 @@ export {
|
|
|
282
289
|
createWeblessAgentPublicApi,
|
|
283
290
|
getMountedAgent,
|
|
284
291
|
mountAgent,
|
|
292
|
+
normalizeAgentPanelPresentation,
|
|
285
293
|
normalizeAgentPlacement,
|
|
286
294
|
normalizeAgentTagManifest,
|
|
287
295
|
resetAgentPanel,
|
package/dist/embed.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/embed/mount.tsx","../src/embed/preview-build.ts","../src/embed/AgentWidget.tsx","../src/embed/manifest.ts","../src/embed/iife-bootstrap.ts"],"sourcesContent":["import { createRoot, type Root } from \"react-dom/client\";\nimport { closeAgentPanel, openAgentPanel } from \"./controller\";\nimport { AgentWidget } from \"./AgentWidget\";\nimport {\n normalizeAgentTagManifest,\n type AgentTagManifest,\n type NormalizedAgentTagManifest,\n} from \"./manifest\";\n\nexport type AgentRuntimeHandle = {\n customerId: string;\n manifest: NormalizedAgentTagManifest;\n host: HTMLElement;\n root: Root;\n open: () => void;\n close: () => void;\n unmount: () => void;\n};\n\nconst mountedHandles = new Map<string, AgentRuntimeHandle>();\nlet latestCustomerId: string | null = null;\n\nfunction resolveMountHost(manifest: NormalizedAgentTagManifest, script?: HTMLScriptElement | null) {\n const strategy = manifest.mount.strategy ?? \"body\";\n\n if (strategy === \"script-parent\" && script?.parentElement instanceof HTMLElement) {\n return script.parentElement;\n }\n\n if (strategy === \"selector\" && manifest.mount.selector) {\n const target = document.querySelector(manifest.mount.selector);\n if (target instanceof HTMLElement) return target;\n }\n\n return document.body;\n}\n\nfunction createHost(customerId: string) {\n const host = document.createElement(\"div\");\n host.dataset.weblessAgentCustomerId = customerId;\n host.setAttribute(\"data-webless-agent\", customerId);\n return host;\n}\n\nexport function mountAgent(input: {\n manifest: AgentTagManifest;\n script?: HTMLScriptElement | null;\n}): AgentRuntimeHandle {\n const manifest = normalizeAgentTagManifest(input.manifest);\n const existing = mountedHandles.get(manifest.customerId);\n if (existing) {\n return existing;\n }\n\n const mountTarget = resolveMountHost(manifest, input.script ?? null);\n const host = createHost(manifest.customerId);\n mountTarget.append(host);\n\n const root = createRoot(host);\n root.render(<AgentWidget manifest={manifest} />);\n\n const handle: AgentRuntimeHandle = {\n customerId: manifest.customerId,\n manifest,\n host,\n root,\n open: () => {\n openAgentPanel(manifest.customerId);\n },\n close: () => {\n closeAgentPanel(manifest.customerId);\n },\n unmount: () => {\n root.unmount();\n host.remove();\n mountedHandles.delete(manifest.customerId);\n if (latestCustomerId === manifest.customerId) {\n latestCustomerId = null;\n }\n },\n };\n\n mountedHandles.set(manifest.customerId, handle);\n latestCustomerId = manifest.customerId;\n return handle;\n}\n\nexport function unmountAgent(customerId?: string) {\n const id = customerId ?? latestCustomerId;\n if (!id) return false;\n const handle = mountedHandles.get(id);\n if (!handle) return false;\n handle.unmount();\n return true;\n}\n\nexport function getMountedAgent(customerId?: string) {\n if (customerId) return mountedHandles.get(customerId) ?? null;\n if (latestCustomerId) return mountedHandles.get(latestCustomerId) ?? null;\n return mountedHandles.values().next().value ?? null;\n}\n\nexport function bootstrapAgent(manifest: AgentTagManifest, script?: HTMLScriptElement | null) {\n return mountAgent({ manifest, script });\n}\n","const PREVIEW_BUILD_ID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;\n\nexport function readUnpublishedPreviewBuildId(href?: string) {\n const source =\n href ?? (typeof window === \"undefined\" ? undefined : window.location.href);\n if (!source) return undefined;\n\n try {\n const buildId = new URL(source).searchParams.get(\"v\")?.trim();\n return buildId && PREVIEW_BUILD_ID_PATTERN.test(buildId)\n ? buildId\n : undefined;\n } catch {\n return undefined;\n }\n}\n","import { AgentWidget as WeblessAgentWidget } from \"../react/components/AgentWidget\";\nimport type { NormalizedAgentTagManifest } from \"./manifest\";\nimport { readUnpublishedPreviewBuildId } from \"./preview-build\";\n\nexport function AgentWidget({\n manifest,\n}: {\n manifest: NormalizedAgentTagManifest;\n}) {\n const defaultCollapsed = manifest.version !== \"unpublished\";\n return (\n <WeblessAgentWidget\n indexId={manifest.indexId}\n customerId={manifest.customerId}\n version={manifest.version}\n runtimeOrigin={manifest.runtimeOrigin}\n handoffEnabled={manifest.handoffEnabled}\n previewBuildId={\n manifest.version === \"unpublished\"\n ? readUnpublishedPreviewBuildId()\n : undefined\n }\n placement={manifest.placement}\n pageShift={manifest.pageShift}\n colorScheme={manifest.colorScheme}\n branding={manifest.branding}\n analytics={manifest.analytics}\n defaultCollapsed={defaultCollapsed}\n registerPanelController\n />\n );\n}\n","import {\n DEFAULT_RUNTIME_ORIGIN,\n resolveAgentRuntimeConfig,\n} from \"../runtime/config\";\nimport type { AgentIndexVersion } from \"../runtime/types\";\nimport {\n DEFAULT_AGENT_PLACEMENT,\n normalizeAgentPlacement,\n type AgentPlacementConfig,\n} from \"../react/placement\";\nimport type { AgentColorScheme } from \"../react/types/conversation\";\n\nexport type { AgentPlacementConfig };\nexport type AgentMountStrategy = \"body\" | \"selector\" | \"script-parent\";\n\nexport type AgentTabVariant = AgentPlacementConfig[\"variant\"];\nexport type AgentTabSide = AgentPlacementConfig[\"side\"];\n\nexport type AgentBrandingConfig = {\n agentName?: string;\n tabLabel?: string;\n tabSubLabel?: string;\n tabIconUrl?: string;\n logoUrl?: string;\n greeting?: string;\n composerPlaceholder?: string;\n poweredByLabel?: string;\n disclaimer?: string | null;\n disclaimerLink?: string | null;\n answerReceipt?: boolean;\n readAloud?: boolean;\n showLearnMore?: boolean;\n showSources?: boolean;\n fontFamily?: string;\n colors?: {\n primary?: string;\n primarySoft?: string;\n primaryForeground?: string;\n /** Launcher-specific overrides; fall back to primary/primaryForeground/border. */\n launcherPrimary?: string;\n launcherPrimaryForeground?: string;\n launcherBorder?: string;\n surface?: string;\n surfaceMuted?: string;\n text?: string;\n textMuted?: string;\n border?: string;\n };\n};\n\nexport type AgentAnalyticsConfig = {\n companyIndex: string;\n eventUrl: string;\n trackingConsent: boolean;\n};\n\nexport type AgentTagManifest = {\n customerId: string;\n indexId: string;\n runtimeOrigin?: string;\n handoffEnabled?: boolean;\n version?: AgentIndexVersion;\n mount?: {\n selector?: string;\n strategy?: AgentMountStrategy;\n };\n placement?: Partial<AgentPlacementConfig>;\n pageShift?: boolean;\n colorScheme?: AgentColorScheme;\n branding?: AgentBrandingConfig;\n analytics?: AgentAnalyticsConfig;\n};\n\nexport { DEFAULT_AGENT_PLACEMENT, normalizeAgentPlacement };\n\nexport function normalizeAgentTagManifest(manifest: AgentTagManifest) {\n const indexId = manifest.indexId.trim();\n if (!indexId) {\n throw new Error(\"Agent manifest requires indexId.\");\n }\n\n const customerId = manifest.customerId.trim();\n if (!customerId) {\n throw new Error(\"Agent manifest requires customerId.\");\n }\n\n const version = manifest.version ?? \"published\";\n if (version !== \"published\" && version !== \"unpublished\") {\n throw new Error(\"Agent manifest version must be published or unpublished.\");\n }\n\n const colorScheme = manifest.colorScheme ?? \"auto\";\n if (\n colorScheme !== \"auto\" &&\n colorScheme !== \"light\" &&\n colorScheme !== \"dark\"\n ) {\n throw new Error(\"Agent manifest colorScheme must be auto, light, or dark.\");\n }\n\n const runtime = resolveAgentRuntimeConfig({\n indexId,\n version,\n runtimeOrigin: manifest.runtimeOrigin?.trim() || DEFAULT_RUNTIME_ORIGIN,\n });\n const branding = normalizeAgentBranding(manifest.branding);\n const analytics = normalizeAgentAnalytics(manifest.analytics);\n\n return {\n customerId,\n indexId,\n runtimeOrigin: runtime.origin,\n handoffEnabled: manifest.handoffEnabled === true,\n version,\n mount: {\n selector: manifest.mount?.selector?.trim(),\n strategy: manifest.mount?.strategy ?? \"body\",\n },\n placement: normalizeAgentPlacement(manifest.placement),\n pageShift: manifest.pageShift ?? true,\n colorScheme,\n ...(branding ? { branding } : {}),\n ...(analytics ? { analytics } : {}),\n };\n}\n\nfunction normalizeAgentAnalytics(\n analytics: AgentAnalyticsConfig | undefined\n): AgentAnalyticsConfig | undefined {\n if (!analytics) return undefined;\n const companyIndex = analytics.companyIndex?.trim() ?? \"\";\n const eventUrl = analytics.eventUrl?.trim() ?? \"\";\n if (!companyIndex || !eventUrl) return undefined;\n try {\n const parsed = new URL(eventUrl);\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") {\n return undefined;\n }\n } catch {\n return undefined;\n }\n return {\n companyIndex,\n eventUrl,\n trackingConsent: analytics.trackingConsent === true,\n };\n}\n\nfunction normalizeOptionalValue(value: string | undefined) {\n const normalized = value?.trim();\n return normalized || undefined;\n}\n\nfunction normalizeOptionalHttpUrl(value: string | null | undefined) {\n if (value === null) return null;\n const normalized = value?.trim();\n if (!normalized) return undefined;\n try {\n const url = new URL(normalized);\n if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n return undefined;\n }\n return normalized;\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeAgentBranding(\n branding: AgentBrandingConfig | undefined\n): AgentBrandingConfig | undefined {\n if (!branding) return undefined;\n\n const colors = branding.colors\n ? Object.fromEntries(\n Object.entries(branding.colors).flatMap(([key, value]) => {\n const normalized = normalizeOptionalValue(value);\n return normalized ? [[key, normalized]] : [];\n })\n )\n : undefined;\n const normalized = {\n agentName: normalizeOptionalValue(branding.agentName),\n tabLabel: normalizeOptionalValue(branding.tabLabel),\n tabSubLabel: normalizeOptionalValue(branding.tabSubLabel),\n tabIconUrl: normalizeOptionalValue(branding.tabIconUrl),\n logoUrl: normalizeOptionalValue(branding.logoUrl),\n greeting: normalizeOptionalValue(branding.greeting),\n composerPlaceholder: normalizeOptionalValue(branding.composerPlaceholder),\n poweredByLabel: normalizeOptionalValue(branding.poweredByLabel),\n disclaimer:\n branding.disclaimer === null\n ? null\n : normalizeOptionalValue(branding.disclaimer),\n disclaimerLink: normalizeOptionalHttpUrl(branding.disclaimerLink),\n answerReceipt: branding.answerReceipt === true ? true : undefined,\n readAloud: branding.readAloud === true ? true : undefined,\n showLearnMore: typeof branding.showLearnMore === \"boolean\" ? branding.showLearnMore : undefined,\n showSources: typeof branding.showSources === \"boolean\" ? branding.showSources : undefined,\n fontFamily: normalizeOptionalValue(branding.fontFamily),\n colors:\n colors && Object.keys(colors).length > 0\n ? (colors as NonNullable<AgentBrandingConfig[\"colors\"]>)\n : undefined,\n };\n\n return Object.values(normalized).some((value) => value !== undefined)\n ? normalized\n : undefined;\n}\n\nexport type NormalizedAgentTagManifest = ReturnType<\n typeof normalizeAgentTagManifest\n>;\n","import {\n getMountedAgent,\n mountAgent,\n unmountAgent,\n} from \"./mount\";\nimport type { AgentTagManifest } from \"./manifest\";\n\ndeclare global {\n interface Window {\n WeblessAgent?: WeblessAgentPublicApi;\n }\n}\n\nexport type WeblessAgentPublicApi = {\n mount: (options?: Partial<AgentTagManifest>) => ReturnType<typeof mountAgent>;\n unmount: (customerId?: string) => boolean;\n open: (customerId?: string) => void;\n close: (customerId?: string) => void;\n get: (customerId?: string) => ReturnType<typeof getMountedAgent>;\n};\n\nexport function createWeblessAgentPublicApi(manifest: AgentTagManifest): WeblessAgentPublicApi {\n const script = document.currentScript instanceof HTMLScriptElement ? document.currentScript : null;\n\n function mount(options: Partial<AgentTagManifest> = {}) {\n return mountAgent({\n manifest: {\n ...manifest,\n ...options,\n customerId: manifest.customerId,\n },\n script,\n });\n }\n\n function unmount(customerId?: string) {\n return unmountAgent(customerId ?? manifest.customerId);\n }\n\n function open(customerId?: string) {\n getMountedAgent(customerId ?? manifest.customerId)?.open();\n }\n\n function close(customerId?: string) {\n getMountedAgent(customerId ?? manifest.customerId)?.close();\n }\n\n function get(customerId?: string) {\n return getMountedAgent(customerId ?? manifest.customerId);\n }\n\n const api: WeblessAgentPublicApi = {\n mount,\n unmount,\n open,\n close,\n get,\n };\n\n window.WeblessAgent = api;\n\n void (async () => {\n try {\n mount();\n } catch (error) {\n console.error(\"[Webless] Agent mount failed\", error);\n }\n })();\n\n return api;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,kBAA6B;;;ACAtC,IAAM,2BACJ;AAEK,SAAS,8BAA8B,MAAe;AAC3D,QAAM,SACJ,SAAS,OAAO,WAAW,cAAc,SAAY,OAAO,SAAS;AACvE,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI;AACF,UAAM,UAAU,IAAI,IAAI,MAAM,EAAE,aAAa,IAAI,GAAG,GAAG,KAAK;AAC5D,WAAO,WAAW,yBAAyB,KAAK,OAAO,IACnD,UACA;AAAA,EACN,QAAQ;AACN,WAAO;AAAA,EACT;AACF;;;ACLI;AAPG,SAASA,aAAY;AAAA,EAC1B;AACF,GAEG;AACD,QAAM,mBAAmB,SAAS,YAAY;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,SAAS;AAAA,MAClB,YAAY,SAAS;AAAA,MACrB,SAAS,SAAS;AAAA,MAClB,eAAe,SAAS;AAAA,MACxB,gBAAgB,SAAS;AAAA,MACzB,gBACE,SAAS,YAAY,gBACjB,8BAA8B,IAC9B;AAAA,MAEN,WAAW,SAAS;AAAA,MACpB,WAAW,SAAS;AAAA,MACpB,aAAa,SAAS;AAAA,MACtB,UAAU,SAAS;AAAA,MACnB,WAAW,SAAS;AAAA,MACpB;AAAA,MACA,yBAAuB;AAAA;AAAA,EACzB;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ACtD,WAAO,WAAW;AAAA,MAChB,UAAU;AAAA,QACR,GAAG;AAAA,QACH,GAAG;AAAA,QACH,YAAY,SAAS;AAAA,MACvB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAEA,WAAS,QAAQ,YAAqB;AACpC,WAAO,aAAa,cAAc,SAAS,UAAU;AAAA,EACvD;AAEA,WAAS,KAAK,YAAqB;AACjC,oBAAgB,cAAc,SAAS,UAAU,GAAG,KAAK;AAAA,EAC3D;AAEA,WAAS,MAAM,YAAqB;AAClC,oBAAgB,cAAc,SAAS,UAAU,GAAG,MAAM;AAAA,EAC5D;AAEA,WAAS,IAAI,YAAqB;AAChC,WAAO,gBAAgB,cAAc,SAAS,UAAU;AAAA,EAC1D;AAEA,QAAM,MAA6B;AAAA,IACjC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,eAAe;AAEtB,QAAM,YAAY;AAChB,QAAI;AACF,YAAM;AAAA,IACR,SAAS,OAAO;AACd,cAAQ,MAAM,gCAAgC,KAAK;AAAA,IACrD;AAAA,EACF,GAAG;AAEH,SAAO;AACT;","names":["AgentWidget","normalized","jsx","AgentWidget"]}
|
|
1
|
+
{"version":3,"sources":["../src/embed/mount.tsx","../src/embed/preview-build.ts","../src/embed/AgentWidget.tsx","../src/embed/manifest.ts","../src/embed/iife-bootstrap.ts"],"sourcesContent":["import { createRoot, type Root } from \"react-dom/client\";\nimport { closeAgentPanel, openAgentPanel } from \"./controller\";\nimport { AgentWidget } from \"./AgentWidget\";\nimport {\n normalizeAgentTagManifest,\n type AgentTagManifest,\n type NormalizedAgentTagManifest,\n} from \"./manifest\";\n\nexport type AgentRuntimeHandle = {\n customerId: string;\n manifest: NormalizedAgentTagManifest;\n host: HTMLElement;\n root: Root;\n open: () => void;\n close: () => void;\n unmount: () => void;\n};\n\nconst mountedHandles = new Map<string, AgentRuntimeHandle>();\nlet latestCustomerId: string | null = null;\n\nfunction resolveMountHost(manifest: NormalizedAgentTagManifest, script?: HTMLScriptElement | null) {\n const strategy = manifest.mount.strategy ?? \"body\";\n\n if (strategy === \"script-parent\" && script?.parentElement instanceof HTMLElement) {\n return script.parentElement;\n }\n\n if (strategy === \"selector\" && manifest.mount.selector) {\n const target = document.querySelector(manifest.mount.selector);\n if (target instanceof HTMLElement) return target;\n }\n\n return document.body;\n}\n\nfunction createHost(customerId: string) {\n const host = document.createElement(\"div\");\n host.dataset.weblessAgentCustomerId = customerId;\n host.setAttribute(\"data-webless-agent\", customerId);\n return host;\n}\n\nexport function mountAgent(input: {\n manifest: AgentTagManifest;\n script?: HTMLScriptElement | null;\n}): AgentRuntimeHandle {\n const manifest = normalizeAgentTagManifest(input.manifest);\n const existing = mountedHandles.get(manifest.customerId);\n if (existing) {\n return existing;\n }\n\n const mountTarget = resolveMountHost(manifest, input.script ?? null);\n const host = createHost(manifest.customerId);\n mountTarget.append(host);\n\n const root = createRoot(host);\n root.render(<AgentWidget manifest={manifest} />);\n\n const handle: AgentRuntimeHandle = {\n customerId: manifest.customerId,\n manifest,\n host,\n root,\n open: () => {\n openAgentPanel(manifest.customerId);\n },\n close: () => {\n closeAgentPanel(manifest.customerId);\n },\n unmount: () => {\n root.unmount();\n host.remove();\n mountedHandles.delete(manifest.customerId);\n if (latestCustomerId === manifest.customerId) {\n latestCustomerId = null;\n }\n },\n };\n\n mountedHandles.set(manifest.customerId, handle);\n latestCustomerId = manifest.customerId;\n return handle;\n}\n\nexport function unmountAgent(customerId?: string) {\n const id = customerId ?? latestCustomerId;\n if (!id) return false;\n const handle = mountedHandles.get(id);\n if (!handle) return false;\n handle.unmount();\n return true;\n}\n\nexport function getMountedAgent(customerId?: string) {\n if (customerId) return mountedHandles.get(customerId) ?? null;\n if (latestCustomerId) return mountedHandles.get(latestCustomerId) ?? null;\n return mountedHandles.values().next().value ?? null;\n}\n\nexport function bootstrapAgent(manifest: AgentTagManifest, script?: HTMLScriptElement | null) {\n return mountAgent({ manifest, script });\n}\n","const PREVIEW_BUILD_ID_PATTERN =\n /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;\n\nexport function readUnpublishedPreviewBuildId(href?: string) {\n const source =\n href ?? (typeof window === \"undefined\" ? undefined : window.location.href);\n if (!source) return undefined;\n\n try {\n const buildId = new URL(source).searchParams.get(\"v\")?.trim();\n return buildId && PREVIEW_BUILD_ID_PATTERN.test(buildId)\n ? buildId\n : undefined;\n } catch {\n return undefined;\n }\n}\n","import { AgentWidget as WeblessAgentWidget } from \"../react/components/AgentWidget\";\nimport type { NormalizedAgentTagManifest } from \"./manifest\";\nimport { readUnpublishedPreviewBuildId } from \"./preview-build\";\n\nexport function AgentWidget({\n manifest,\n}: {\n manifest: NormalizedAgentTagManifest;\n}) {\n const defaultCollapsed = manifest.version !== \"unpublished\";\n return (\n <WeblessAgentWidget\n indexId={manifest.indexId}\n customerId={manifest.customerId}\n version={manifest.version}\n runtimeOrigin={manifest.runtimeOrigin}\n handoffEnabled={manifest.handoffEnabled}\n previewBuildId={\n manifest.version === \"unpublished\"\n ? readUnpublishedPreviewBuildId()\n : undefined\n }\n placement={manifest.placement}\n panelPresentation={manifest.panelPresentation}\n pageShift={manifest.pageShift}\n colorScheme={manifest.colorScheme}\n branding={manifest.branding}\n analytics={manifest.analytics}\n defaultCollapsed={defaultCollapsed}\n registerPanelController\n />\n );\n}\n","import {\n DEFAULT_RUNTIME_ORIGIN,\n resolveAgentRuntimeConfig,\n} from \"../runtime/config\";\nimport type { AgentIndexVersion } from \"../runtime/types\";\nimport {\n DEFAULT_AGENT_PLACEMENT,\n normalizeAgentPlacement,\n type AgentPlacementConfig,\n} from \"../react/placement\";\nimport type { AgentColorScheme } from \"../react/types/conversation\";\n\nexport type { AgentPlacementConfig };\nexport type AgentMountStrategy = \"body\" | \"selector\" | \"script-parent\";\nexport type AgentPanelPresentation = \"drawer\" | \"popup\";\n\nexport type AgentTabVariant = AgentPlacementConfig[\"variant\"];\nexport type AgentTabSide = AgentPlacementConfig[\"side\"];\n\nexport type AgentBrandingConfig = {\n agentName?: string;\n tabLabel?: string;\n tabSubLabel?: string;\n tabIconUrl?: string;\n logoUrl?: string;\n greeting?: string;\n composerPlaceholder?: string;\n poweredByLabel?: string;\n disclaimer?: string | null;\n disclaimerLink?: string | null;\n answerReceipt?: boolean;\n readAloud?: boolean;\n showLearnMore?: boolean;\n showSources?: boolean;\n fontFamily?: string;\n colors?: {\n primary?: string;\n primarySoft?: string;\n primaryForeground?: string;\n /** Launcher-specific overrides; fall back to primary/primaryForeground/border. */\n launcherPrimary?: string;\n launcherPrimaryForeground?: string;\n launcherBorder?: string;\n surface?: string;\n surfaceMuted?: string;\n text?: string;\n textMuted?: string;\n border?: string;\n };\n};\n\nexport type AgentAnalyticsConfig = {\n companyIndex: string;\n eventUrl: string;\n trackingConsent: boolean;\n};\n\nexport type AgentTagManifest = {\n customerId: string;\n indexId: string;\n runtimeOrigin?: string;\n handoffEnabled?: boolean;\n version?: AgentIndexVersion;\n mount?: {\n selector?: string;\n strategy?: AgentMountStrategy;\n };\n placement?: Partial<AgentPlacementConfig>;\n panelPresentation?: AgentPanelPresentation;\n pageShift?: boolean;\n colorScheme?: AgentColorScheme;\n branding?: AgentBrandingConfig;\n analytics?: AgentAnalyticsConfig;\n};\n\nexport { DEFAULT_AGENT_PLACEMENT, normalizeAgentPlacement };\n\nexport function normalizeAgentPanelPresentation(\n value?: AgentPanelPresentation,\n): AgentPanelPresentation {\n return value === \"popup\" ? \"popup\" : \"drawer\";\n}\n\nexport function normalizeAgentTagManifest(manifest: AgentTagManifest) {\n const indexId = manifest.indexId.trim();\n if (!indexId) {\n throw new Error(\"Agent manifest requires indexId.\");\n }\n\n const customerId = manifest.customerId.trim();\n if (!customerId) {\n throw new Error(\"Agent manifest requires customerId.\");\n }\n\n const version = manifest.version ?? \"published\";\n if (version !== \"published\" && version !== \"unpublished\") {\n throw new Error(\"Agent manifest version must be published or unpublished.\");\n }\n\n const colorScheme = manifest.colorScheme ?? \"auto\";\n if (\n colorScheme !== \"auto\" &&\n colorScheme !== \"light\" &&\n colorScheme !== \"dark\"\n ) {\n throw new Error(\"Agent manifest colorScheme must be auto, light, or dark.\");\n }\n\n const runtime = resolveAgentRuntimeConfig({\n indexId,\n version,\n runtimeOrigin: manifest.runtimeOrigin?.trim() || DEFAULT_RUNTIME_ORIGIN,\n });\n const branding = normalizeAgentBranding(manifest.branding);\n const analytics = normalizeAgentAnalytics(manifest.analytics);\n\n return {\n customerId,\n indexId,\n runtimeOrigin: runtime.origin,\n handoffEnabled: manifest.handoffEnabled === true,\n version,\n mount: {\n selector: manifest.mount?.selector?.trim(),\n strategy: manifest.mount?.strategy ?? \"body\",\n },\n placement: normalizeAgentPlacement(manifest.placement),\n panelPresentation: normalizeAgentPanelPresentation(\n manifest.panelPresentation,\n ),\n pageShift:\n normalizeAgentPanelPresentation(manifest.panelPresentation) === \"popup\"\n ? false\n : (manifest.pageShift ?? true),\n colorScheme,\n ...(branding ? { branding } : {}),\n ...(analytics ? { analytics } : {}),\n };\n}\n\nfunction normalizeAgentAnalytics(\n analytics: AgentAnalyticsConfig | undefined\n): AgentAnalyticsConfig | undefined {\n if (!analytics) return undefined;\n const companyIndex = analytics.companyIndex?.trim() ?? \"\";\n const eventUrl = analytics.eventUrl?.trim() ?? \"\";\n if (!companyIndex || !eventUrl) return undefined;\n try {\n const parsed = new URL(eventUrl);\n if (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") {\n return undefined;\n }\n } catch {\n return undefined;\n }\n return {\n companyIndex,\n eventUrl,\n trackingConsent: analytics.trackingConsent === true,\n };\n}\n\nfunction normalizeOptionalValue(value: string | undefined) {\n const normalized = value?.trim();\n return normalized || undefined;\n}\n\nfunction normalizeOptionalHttpUrl(value: string | null | undefined) {\n if (value === null) return null;\n const normalized = value?.trim();\n if (!normalized) return undefined;\n try {\n const url = new URL(normalized);\n if (url.protocol !== \"http:\" && url.protocol !== \"https:\") {\n return undefined;\n }\n return normalized;\n } catch {\n return undefined;\n }\n}\n\nfunction normalizeAgentBranding(\n branding: AgentBrandingConfig | undefined\n): AgentBrandingConfig | undefined {\n if (!branding) return undefined;\n\n const colors = branding.colors\n ? Object.fromEntries(\n Object.entries(branding.colors).flatMap(([key, value]) => {\n const normalized = normalizeOptionalValue(value);\n return normalized ? [[key, normalized]] : [];\n })\n )\n : undefined;\n const normalized = {\n agentName: normalizeOptionalValue(branding.agentName),\n tabLabel: normalizeOptionalValue(branding.tabLabel),\n tabSubLabel: normalizeOptionalValue(branding.tabSubLabel),\n tabIconUrl: normalizeOptionalValue(branding.tabIconUrl),\n logoUrl: normalizeOptionalValue(branding.logoUrl),\n greeting: normalizeOptionalValue(branding.greeting),\n composerPlaceholder: normalizeOptionalValue(branding.composerPlaceholder),\n poweredByLabel: normalizeOptionalValue(branding.poweredByLabel),\n disclaimer:\n branding.disclaimer === null\n ? null\n : normalizeOptionalValue(branding.disclaimer),\n disclaimerLink: normalizeOptionalHttpUrl(branding.disclaimerLink),\n answerReceipt: branding.answerReceipt === true ? true : undefined,\n readAloud: branding.readAloud === true ? true : undefined,\n showLearnMore: typeof branding.showLearnMore === \"boolean\" ? branding.showLearnMore : undefined,\n showSources: typeof branding.showSources === \"boolean\" ? branding.showSources : undefined,\n fontFamily: normalizeOptionalValue(branding.fontFamily),\n colors:\n colors && Object.keys(colors).length > 0\n ? (colors as NonNullable<AgentBrandingConfig[\"colors\"]>)\n : undefined,\n };\n\n return Object.values(normalized).some((value) => value !== undefined)\n ? normalized\n : undefined;\n}\n\nexport type NormalizedAgentTagManifest = ReturnType<\n typeof normalizeAgentTagManifest\n>;\n","import {\n getMountedAgent,\n mountAgent,\n unmountAgent,\n} from \"./mount\";\nimport type { AgentTagManifest } from \"./manifest\";\n\ndeclare global {\n interface Window {\n WeblessAgent?: WeblessAgentPublicApi;\n }\n}\n\nexport type WeblessAgentPublicApi = {\n mount: (options?: Partial<AgentTagManifest>) => ReturnType<typeof mountAgent>;\n unmount: (customerId?: string) => boolean;\n open: (customerId?: string) => void;\n close: (customerId?: string) => void;\n get: (customerId?: string) => ReturnType<typeof getMountedAgent>;\n};\n\nexport function createWeblessAgentPublicApi(manifest: AgentTagManifest): WeblessAgentPublicApi {\n const script = document.currentScript instanceof HTMLScriptElement ? document.currentScript : null;\n\n function mount(options: Partial<AgentTagManifest> = {}) {\n return mountAgent({\n manifest: {\n ...manifest,\n ...options,\n customerId: manifest.customerId,\n },\n script,\n });\n }\n\n function unmount(customerId?: string) {\n return unmountAgent(customerId ?? manifest.customerId);\n }\n\n function open(customerId?: string) {\n getMountedAgent(customerId ?? manifest.customerId)?.open();\n }\n\n function close(customerId?: string) {\n getMountedAgent(customerId ?? manifest.customerId)?.close();\n }\n\n function get(customerId?: string) {\n return getMountedAgent(customerId ?? manifest.customerId);\n }\n\n const api: WeblessAgentPublicApi = {\n mount,\n unmount,\n open,\n close,\n get,\n };\n\n window.WeblessAgent = api;\n\n void (async () => {\n try {\n mount();\n } catch (error) {\n console.error(\"[Webless] Agent mount failed\", error);\n }\n })();\n\n return api;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,kBAA6B;;;ACAtC,IAAM,2BACJ;AAEK,SAAS,8BAA8B,MAAe;AAC3D,QAAM,SACJ,SAAS,OAAO,WAAW,cAAc,SAAY,OAAO,SAAS;AACvE,MAAI,CAAC,OAAQ,QAAO;AAEpB,MAAI;AACF,UAAM,UAAU,IAAI,IAAI,MAAM,EAAE,aAAa,IAAI,GAAG,GAAG,KAAK;AAC5D,WAAO,WAAW,yBAAyB,KAAK,OAAO,IACnD,UACA;AAAA,EACN,QAAQ;AACN,WAAO;AAAA,EACT;AACF;;;ACLI;AAPG,SAASA,aAAY;AAAA,EAC1B;AACF,GAEG;AACD,QAAM,mBAAmB,SAAS,YAAY;AAC9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,SAAS,SAAS;AAAA,MAClB,YAAY,SAAS;AAAA,MACrB,S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FAULT_AGENT_PLACEMENT: AgentPlacementConfig;
|
|
|
544
544
|
declare function normalizeAgentPlacement(placement?: Partial<AgentPlacementConfig>): AgentPlacementConfig;
|
|
545
545
|
|
|
546
546
|
type AgentMountStrategy = "body" | "selector" | "script-parent";
|
|
547
|
+
type AgentPanelPresentation = "drawer" | "popup";
|
|
547
548
|
type AgentTabVariant = AgentPlacementConfig["variant"];
|
|
548
549
|
type AgentTabSide = AgentPlacementConfig["side"];
|
|
549
550
|
type AgentBrandingConfig = {
|
|
@@ -593,12 +594,14 @@ type AgentTagManifest = {
|
|
|
593
594
|
strategy?: AgentMountStrategy;
|
|
594
595
|
};
|
|
595
596
|
placement?: Partial<AgentPlacementConfig>;
|
|
597
|
+
panelPresentation?: AgentPanelPresentation;
|
|
596
598
|
pageShift?: boolean;
|
|
597
599
|
colorScheme?: AgentColorScheme;
|
|
598
600
|
branding?: AgentBrandingConfig;
|
|
599
601
|
analytics?: AgentAnalyticsConfig;
|
|
600
602
|
};
|
|
601
603
|
|
|
604
|
+
declare function normalizeAgentPanelPresentation(value?: AgentPanelPresentation): AgentPanelPresentation;
|
|
602
605
|
declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
603
606
|
analytics?: AgentAnalyticsConfig | undefined;
|
|
604
607
|
branding?: AgentBrandingConfig | undefined;
|
|
@@ -612,6 +615,7 @@ declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
|
612
615
|
strategy: AgentMountStrategy;
|
|
613
616
|
};
|
|
614
617
|
placement: AgentPlacementConfig;
|
|
618
|
+
panelPresentation: AgentPanelPresentation;
|
|
615
619
|
pageShift: boolean;
|
|
616
620
|
colorScheme: AgentColorScheme;
|
|
617
621
|
};
|
|
@@ -624,4 +628,4 @@ type AgentPanelSubmitOptions = {
|
|
|
624
628
|
declare function resetAgentPanel(customerId: string): void;
|
|
625
629
|
declare function submitAgentPanel(customerId: string, message: string, options?: AgentPanelSubmitOptions): Promise<string | null>;
|
|
626
630
|
|
|
627
|
-
export {
|
|
631
|
+
export { type VisitorToolResultRegistry as $, AGENT_STRUCTURED_TOOL_INPUT_HEADER as A, type AgentToolUiAction as B, type AgentToolUiField as C, type AgentToolUiFieldKind as D, type AgentToolUiOption as E, type AgentToolUiStep as F, type AgentToolUiSurface as G, AssistEdgeTab as H, type AssistTabSide as I, type AssistTabVariant as J, type Citation as K, type ConversationMessage as L, DEFAULT_AGENT_PLACEMENT as M, type FollowUpSuggestion as N, type JourneyContext as O, type NormalizedAgentTagManifest as P, type ToolStepState as Q, type ResolvedVisitorToolResultPresentation as R, type VisitorBookingResultPresentation as S, type ToolStep as T, type VisitorSearchResultPresentation as U, type VisitorBooking as V, type VisitorToolInputResultPresentation as W, type VisitorToolResultLink as X, type VisitorToolResultPresentation as Y, type VisitorToolResultPresenter as Z, type VisitorToolResultPresenterOutput as _, AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION as a, builtInVisitorToolResultRegistry as a0, defaultAgentRailTheme as a1, defaultDarkAgentRailTheme as a2, formatAgentStructuredToolInput as a3, normalizeAgentPanelPresentation as a4, normalizeAgentPlacement as a5, normalizeAgentTagManifest as a6, presentVisitorToolResult as a7, resetAgentPanel as a8, submitAgentPanel as a9, type AgentAnalyticsConfig as b, type AgentBrandingConfig as c, type AgentClient as d, type AgentColorScheme as e, type AgentIndexVersion as f, type AgentInputOption as g, type AgentInputRequest as h, type AgentInputResponse as i, type AgentMessageFeedback as j, type AgentMountStrategy as k, type AgentPanelPresentation as l, type AgentPanelSubmitOptions as m, type AgentPlacementConfig as n, type AgentRailPhase as o, type AgentRailState as p, type AgentRailTheme as q, type AgentRuntimeHandoffEvent as r, type AgentSearchReferences as s, type AgentSearchSource as t, type AgentStructuredToolInput as u, type AgentTabSide as v, type AgentTabVariant as w, type AgentTagManifest as x, type AgentToolResult as y, type AgentToolResultJsonValue as z };
|
|
@@ -544,6 +544,7 @@ declare const DEFAULT_AGENT_PLACEMENT: AgentPlacementConfig;
|
|
|
544
544
|
declare function normalizeAgentPlacement(placement?: Partial<AgentPlacementConfig>): AgentPlacementConfig;
|
|
545
545
|
|
|
546
546
|
type AgentMountStrategy = "body" | "selector" | "script-parent";
|
|
547
|
+
type AgentPanelPresentation = "drawer" | "popup";
|
|
547
548
|
type AgentTabVariant = AgentPlacementConfig["variant"];
|
|
548
549
|
type AgentTabSide = AgentPlacementConfig["side"];
|
|
549
550
|
type AgentBrandingConfig = {
|
|
@@ -593,12 +594,14 @@ type AgentTagManifest = {
|
|
|
593
594
|
strategy?: AgentMountStrategy;
|
|
594
595
|
};
|
|
595
596
|
placement?: Partial<AgentPlacementConfig>;
|
|
597
|
+
panelPresentation?: AgentPanelPresentation;
|
|
596
598
|
pageShift?: boolean;
|
|
597
599
|
colorScheme?: AgentColorScheme;
|
|
598
600
|
branding?: AgentBrandingConfig;
|
|
599
601
|
analytics?: AgentAnalyticsConfig;
|
|
600
602
|
};
|
|
601
603
|
|
|
604
|
+
declare function normalizeAgentPanelPresentation(value?: AgentPanelPresentation): AgentPanelPresentation;
|
|
602
605
|
declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
603
606
|
analytics?: AgentAnalyticsConfig | undefined;
|
|
604
607
|
branding?: AgentBrandingConfig | undefined;
|
|
@@ -612,6 +615,7 @@ declare function normalizeAgentTagManifest(manifest: AgentTagManifest): {
|
|
|
612
615
|
strategy: AgentMountStrategy;
|
|
613
616
|
};
|
|
614
617
|
placement: AgentPlacementConfig;
|
|
618
|
+
panelPresentation: AgentPanelPresentation;
|
|
615
619
|
pageShift: boolean;
|
|
616
620
|
colorScheme: AgentColorScheme;
|
|
617
621
|
};
|
|
@@ -624,4 +628,4 @@ type AgentPanelSubmitOptions = {
|
|
|
624
628
|
declare function resetAgentPanel(customerId: string): void;
|
|
625
629
|
declare function submitAgentPanel(customerId: string, message: string, options?: AgentPanelSubmitOptions): Promise<string | null>;
|
|
626
630
|
|
|
627
|
-
export {
|
|
631
|
+
export { type VisitorToolResultRegistry as $, AGENT_STRUCTURED_TOOL_INPUT_HEADER as A, type AgentToolUiAction as B, type AgentToolUiField as C, type AgentToolUiFieldKind as D, type AgentToolUiOption as E, type AgentToolUiStep as F, type AgentToolUiSurface as G, AssistEdgeTab as H, type AssistTabSide as I, type AssistTabVariant as J, type Citation as K, type ConversationMessage as L, DEFAULT_AGENT_PLACEMENT as M, type FollowUpSuggestion as N, type JourneyContext as O, type NormalizedAgentTagManifest as P, type ToolStepState as Q, type ResolvedVisitorToolResultPresentation as R, type VisitorBookingResultPresentation as S, type ToolStep as T, type VisitorSearchResultPresentation as U, type VisitorBooking as V, type VisitorToolInputResultPresentation as W, type VisitorToolResultLink as X, type VisitorToolResultPresentation as Y, type VisitorToolResultPresenter as Z, type VisitorToolResultPresenterOutput as _, AGENT_STRUCTURED_TOOL_INPUT_SCHEMA_VERSION as a, builtInVisitorToolResultRegistry as a0, defaultAgentRailTheme as a1, defaultDarkAgentRailTheme as a2, formatAgentStructuredToolInput as a3, normalizeAgentPanelPresentation as a4, normalizeAgentPlacement as a5, normalizeAgentTagManifest as a6, presentVisitorToolResult as a7, resetAgentPanel as a8, submitAgentPanel as a9, type AgentAnalyticsConfig as b, type AgentBrandingConfig as c, type AgentClient as d, type AgentColorScheme as e, type AgentIndexVersion as f, type AgentInputOption as g, type AgentInputRequest as h, type AgentInputResponse as i, type AgentMessageFeedback as j, type AgentMountStrategy as k, type AgentPanelPresentation as l, type AgentPanelSubmitOptions as m, type AgentPlacementConfig as n, type AgentRailPhase as o, type AgentRailState as p, type AgentRailTheme as q, type AgentRuntimeHandoffEvent as r, type AgentSearchReferences as s, type AgentSearchSource as t, type AgentStructuredToolInput as u, type AgentTabSide as v, type AgentTabVariant as w, type AgentTagManifest as x, type AgentToolResult as y, type AgentToolResultJsonValue as z };
|
package/dist/react.cjs
CHANGED
|
@@ -4826,16 +4826,11 @@ function ExploreMore({
|
|
|
4826
4826
|
if (!sources.length && !questions.length) return null;
|
|
4827
4827
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more", children: [
|
|
4828
4828
|
sources.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more__section", children: [
|
|
4829
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
4830
|
-
"Based on ",
|
|
4831
|
-
sources.length,
|
|
4832
|
-
" ",
|
|
4833
|
-
sources.length === 1 ? "page" : "pages"
|
|
4834
|
-
] }),
|
|
4829
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "Related Resources" }),
|
|
4835
4830
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SearchReferences, { results, mode: "sources" })
|
|
4836
4831
|
] }) : null,
|
|
4837
4832
|
questions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "explore-more__section", children: [
|
|
4838
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "
|
|
4833
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "explore-more__label", children: "Ask Next" }),
|
|
4839
4834
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("ul", { className: "explore-more__questions", children: questions.map((question) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
4840
4835
|
"button",
|
|
4841
4836
|
{
|
|
@@ -5194,7 +5189,7 @@ function Composer({
|
|
|
5194
5189
|
disabled,
|
|
5195
5190
|
title: "Share your details and we'll reach out shortly",
|
|
5196
5191
|
onClick: () => setDraft((current) => ({ ...current, expanded: true })),
|
|
5197
|
-
children: "
|
|
5192
|
+
children: "Request a Follow-Up"
|
|
5198
5193
|
}
|
|
5199
5194
|
) : null
|
|
5200
5195
|
] }) : null,
|
|
@@ -5718,7 +5713,7 @@ var BRAND_LOGO_LAYOUT = {
|
|
|
5718
5713
|
header: { maxHeight: 20, maxWidth: 96, square: 24 },
|
|
5719
5714
|
message: { maxHeight: 18, maxWidth: 80, square: 22 },
|
|
5720
5715
|
/** Bottom/mobile launcher pill orb — keep in sync with AssistEdgeTab chip CSS. */
|
|
5721
|
-
launcher: { maxHeight:
|
|
5716
|
+
launcher: { maxHeight: 20, maxWidth: 80, square: 22 }
|
|
5722
5717
|
};
|
|
5723
5718
|
function isWideBrandLogo(naturalWidth, naturalHeight) {
|
|
5724
5719
|
return naturalWidth > naturalHeight * 1.4;
|
|
@@ -8554,6 +8549,7 @@ function AgentWidget({
|
|
|
8554
8549
|
runtimeOrigin,
|
|
8555
8550
|
handoffEnabled = false,
|
|
8556
8551
|
placement: placementInput,
|
|
8552
|
+
panelPresentation = "drawer",
|
|
8557
8553
|
defaultCollapsed = true,
|
|
8558
8554
|
pageShift = true,
|
|
8559
8555
|
registerPanelController = false,
|
|
@@ -8564,11 +8560,12 @@ function AgentWidget({
|
|
|
8564
8560
|
}) {
|
|
8565
8561
|
const isMobile = useIsMobile();
|
|
8566
8562
|
const placement = normalizeAgentPlacement(placementInput);
|
|
8563
|
+
const overlayPopup = panelPresentation === "popup" && !isMobile;
|
|
8567
8564
|
const railSlotRef = (0, import_react19.useRef)(null);
|
|
8568
8565
|
const [railCollapsed, setRailCollapsed] = (0, import_react19.useState)(defaultCollapsed);
|
|
8569
8566
|
const [railExpanded, setRailExpanded] = (0, import_react19.useState)(false);
|
|
8570
8567
|
const pageShiftActive = shouldApplyPageShift({
|
|
8571
|
-
pageShift,
|
|
8568
|
+
pageShift: pageShift && !overlayPopup,
|
|
8572
8569
|
isMobile,
|
|
8573
8570
|
railCollapsed,
|
|
8574
8571
|
railExpanded
|
|
@@ -8694,7 +8691,7 @@ function AgentWidget({
|
|
|
8694
8691
|
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8695
8692
|
"div",
|
|
8696
8693
|
{
|
|
8697
|
-
className: `webless-agent-root__shell${railCollapsed ? " webless-agent-root__shell--collapsed" : ""}${railExpanded ? " webless-agent-root__shell--expanded" : ""}`,
|
|
8694
|
+
className: `webless-agent-root__shell${railCollapsed ? " webless-agent-root__shell--collapsed" : ""}${railExpanded ? " webless-agent-root__shell--expanded" : ""}${overlayPopup ? " webless-agent-root__shell--popup" : ""}`,
|
|
8698
8695
|
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
8699
8696
|
"div",
|
|
8700
8697
|
{
|