@webless/agent 0.10.3 → 0.11.0

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/embed.cjs CHANGED
@@ -64,7 +64,7 @@ function submitAgentPanel(customerId, message, options) {
64
64
  }
65
65
 
66
66
  // src/react/components/AgentWidget/AgentWidget.tsx
67
- var import_react16 = require("react");
67
+ var import_react17 = require("react");
68
68
 
69
69
  // src/react/page-shift.ts
70
70
  var import_react = require("react");
@@ -544,18 +544,26 @@ function createAgentRuntimeCapability(options) {
544
544
  );
545
545
  }
546
546
  }
547
- const bootstrapBody = JSON.stringify({
547
+ const bootstrapBody = {
548
548
  clientSessionId: options.visitorSessionId,
549
549
  indexId: options.indexId,
550
550
  ...previewBuildId ? { previewBuildId } : {},
551
551
  ...previewGrant ? { previewGrant } : {},
552
552
  version: options.version
553
- });
554
- const postBootstrap = (origin) => fetchImplementation(`${origin}/webless/v1/bootstrap`, {
555
- body: bootstrapBody,
556
- headers: { "content-type": "application/json" },
557
- method: "POST"
558
- });
553
+ };
554
+ const postBootstrap = async (origin) => {
555
+ const send = (advertiseLocation) => fetchImplementation(`${origin}/webless/v1/bootstrap`, {
556
+ body: JSON.stringify({ ...bootstrapBody, ...advertiseLocation ? { locationConsent: "v1" } : {} }),
557
+ headers: { "content-type": "application/json" },
558
+ method: "POST"
559
+ });
560
+ const response2 = await send(Boolean(options.locationConsent));
561
+ if (options.locationConsent && response2.status === 400) {
562
+ const error = await response2.clone().json().catch(() => null);
563
+ if (isRecord3(error) && error.code === "invalid_request") return send(false);
564
+ }
565
+ return response2;
566
+ };
559
567
  let response;
560
568
  let lastError;
561
569
  for (const origin of localBootstrapOrigins(options.runtimeOrigin)) {
@@ -1090,6 +1098,7 @@ function specialistNameFromInput(input) {
1090
1098
  return match?.[1]?.trim() || void 0;
1091
1099
  }
1092
1100
  function requestedWorkItem(action) {
1101
+ if (action.kind === "tool-call" && action.toolName === "request_location") return null;
1093
1102
  if (action.kind === "tool-call" && action.toolName === "search_discovery") {
1094
1103
  return {
1095
1104
  id: action.callId,
@@ -1195,13 +1204,14 @@ function applyWorkEvent(event, handlers, workItems) {
1195
1204
  );
1196
1205
  }
1197
1206
  var AgentSession = class {
1198
- constructor(indexId, version, runtimeOrigin, visitorSessionId, storeOptions, previewBuildId, getUnpublishedPreviewGrant) {
1207
+ constructor(indexId, version, runtimeOrigin, visitorSessionId, storeOptions, previewBuildId, getUnpublishedPreviewGrant, locationConsent) {
1199
1208
  this.indexId = indexId;
1200
1209
  this.version = version;
1201
1210
  this.runtimeOrigin = runtimeOrigin;
1202
1211
  this.visitorSessionId = visitorSessionId;
1203
1212
  this.storeOptions = storeOptions;
1204
1213
  this.capability = createAgentRuntimeCapability({
1214
+ locationConsent,
1205
1215
  getUnpublishedPreviewGrant,
1206
1216
  indexId,
1207
1217
  previewBuildId,
@@ -1593,7 +1603,8 @@ function createAgentClient(options) {
1593
1603
  visitorSessionId,
1594
1604
  storeOptions,
1595
1605
  options.previewBuildId,
1596
- options.getUnpublishedPreviewGrant
1606
+ options.getUnpublishedPreviewGrant,
1607
+ options.locationConsent
1597
1608
  );
1598
1609
  return {
1599
1610
  indexId,
@@ -2742,6 +2753,9 @@ function finalizeSummaryPresentation(result, proposed) {
2742
2753
  };
2743
2754
  }
2744
2755
  function presentVisitorToolResult(result, registry = []) {
2756
+ if (result.toolName === "request_location") {
2757
+ return { id: result.callId, toolName: result.toolName, status: result.status, kind: "hidden" };
2758
+ }
2745
2759
  if (result.status === "completed" && toolResultFailed(result)) {
2746
2760
  result = { ...result, status: "failed" };
2747
2761
  }
@@ -3060,6 +3074,7 @@ function useAgentChat({
3060
3074
  const runRef = (0, import_react2.useRef)(null);
3061
3075
  const clientRef = (0, import_react2.useRef)(
3062
3076
  createAgentClient({
3077
+ locationConsent: true,
3063
3078
  customerId,
3064
3079
  getUnpublishedPreviewGrant: resolveUnpublishedPreviewGrant,
3065
3080
  indexId,
@@ -3080,6 +3095,7 @@ function useAgentChat({
3080
3095
  runRef.current?.abort();
3081
3096
  runRef.current = null;
3082
3097
  clientRef.current = createAgentClient({
3098
+ locationConsent: true,
3083
3099
  customerId,
3084
3100
  getUnpublishedPreviewGrant: resolveUnpublishedPreviewGrant,
3085
3101
  indexId,
@@ -3670,7 +3686,7 @@ function normalizeAgentPlacement(placement) {
3670
3686
  }
3671
3687
 
3672
3688
  // src/react/components/AgentRail/AgentRail.tsx
3673
- var import_react14 = require("react");
3689
+ var import_react15 = require("react");
3674
3690
 
3675
3691
  // src/react/types/conversation.ts
3676
3692
  var defaultAgentRailTheme = {
@@ -6153,31 +6169,173 @@ function HumanInputCard({
6153
6169
  );
6154
6170
  }
6155
6171
 
6156
- // src/react/components/CollectionResultCard/CollectionResultCard.tsx
6172
+ // src/react/components/LocationConsent/LocationConsent.tsx
6173
+ var import_react14 = require("react");
6174
+
6175
+ // src/runtime/location-consent.ts
6176
+ function isLocationConsentRequest(request) {
6177
+ return request.kind === "tool-approval" && request.action.toolName === "request_location";
6178
+ }
6179
+ function preciseLocationResponse(requestId, position) {
6180
+ const { latitude, longitude, accuracy } = position.coords;
6181
+ if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90 || !Number.isFinite(longitude) || longitude < -180 || longitude > 180 || !Number.isFinite(accuracy) || accuracy < 0 || !Number.isFinite(position.timestamp)) {
6182
+ throw new Error("Your device returned an invalid location.");
6183
+ }
6184
+ return {
6185
+ requestId,
6186
+ optionId: "approve",
6187
+ text: JSON.stringify({
6188
+ status: "shared",
6189
+ location: {
6190
+ source: "device",
6191
+ latitude,
6192
+ longitude,
6193
+ accuracyMeters: accuracy,
6194
+ capturedAt: new Date(position.timestamp).toISOString(),
6195
+ consentedAt: (/* @__PURE__ */ new Date()).toISOString(),
6196
+ scope: "conversation"
6197
+ }
6198
+ })
6199
+ };
6200
+ }
6201
+ function getPreciseLocation(geolocation) {
6202
+ return new Promise(
6203
+ (resolve, reject) => geolocation.getCurrentPosition(
6204
+ resolve,
6205
+ (error) => reject(
6206
+ new Error(
6207
+ error.code === 1 ? "Location access is blocked. Allow it in your browser, or continue without sharing." : "Your location couldn\u2019t be found. Try again or continue without sharing."
6208
+ )
6209
+ ),
6210
+ { enableHighAccuracy: true, maximumAge: 0, timeout: 1e4 }
6211
+ )
6212
+ );
6213
+ }
6214
+
6215
+ // src/react/components/LocationConsent/LocationConsent.tsx
6157
6216
  var import_jsx_runtime12 = require("react/jsx-runtime");
6217
+ function LocationConsent({
6218
+ request,
6219
+ onRespond
6220
+ }) {
6221
+ const [preference, setPreference] = (0, import_react14.useState)("unset");
6222
+ const [locating, setLocating] = (0, import_react14.useState)(false);
6223
+ const [error, setError] = (0, import_react14.useState)(null);
6224
+ const respond = (0, import_react14.useRef)(onRespond);
6225
+ const answered = (0, import_react14.useRef)(null);
6226
+ const requestId = request?.requestId;
6227
+ (0, import_react14.useEffect)(() => {
6228
+ respond.current = onRespond;
6229
+ }, [onRespond]);
6230
+ (0, import_react14.useEffect)(() => {
6231
+ if (!requestId || preference === "unset" || answered.current === requestId || !respond.current)
6232
+ return;
6233
+ if (preference === "off") {
6234
+ setLocating(false);
6235
+ answered.current = requestId;
6236
+ respond.current({
6237
+ requestId,
6238
+ optionId: "approve",
6239
+ text: JSON.stringify({ status: "declined" })
6240
+ });
6241
+ return;
6242
+ }
6243
+ let cancelled = false;
6244
+ const pendingId = requestId;
6245
+ setLocating(true);
6246
+ setError(null);
6247
+ async function locate() {
6248
+ try {
6249
+ if (!Reflect.has(navigator, "geolocation"))
6250
+ throw new Error("Location sharing isn\u2019t available in this browser.");
6251
+ const position = await getPreciseLocation(navigator.geolocation);
6252
+ if (cancelled) return;
6253
+ const response = preciseLocationResponse(pendingId, position);
6254
+ answered.current = pendingId;
6255
+ respond.current?.(response);
6256
+ } catch (failure) {
6257
+ if (cancelled) return;
6258
+ setPreference("unset");
6259
+ setError(
6260
+ failure instanceof Error ? failure.message : "Location sharing failed. Try again or continue without sharing."
6261
+ );
6262
+ } finally {
6263
+ if (!cancelled) setLocating(false);
6264
+ }
6265
+ }
6266
+ void locate();
6267
+ return () => {
6268
+ cancelled = true;
6269
+ };
6270
+ }, [requestId, preference]);
6271
+ const isLocating = Boolean(requestId) && preference === "on" && locating;
6272
+ if (!request && preference === "unset") return null;
6273
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "location-consent", "aria-label": "Location sharing", children: [
6274
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "location-consent__copy", children: [
6275
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: isLocating ? "Getting your location\u2026" : request ? "Get better results" : "Precise location" }),
6276
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: isLocating ? "Allow location access in your browser." : request ? "Share your precise location" : preference === "on" ? "On for location-aware answers" : "Off for this chat" })
6277
+ ] }),
6278
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "location-consent__actions", children: [
6279
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6280
+ "button",
6281
+ {
6282
+ type: "button",
6283
+ role: "switch",
6284
+ className: "location-consent__toggle",
6285
+ "aria-label": "Share precise location",
6286
+ "aria-checked": preference === "on",
6287
+ "aria-busy": isLocating,
6288
+ disabled: !onRespond,
6289
+ onClick: () => {
6290
+ setError(null);
6291
+ setPreference(preference === "on" ? "off" : "on");
6292
+ },
6293
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", {})
6294
+ }
6295
+ ),
6296
+ request && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
6297
+ "button",
6298
+ {
6299
+ type: "button",
6300
+ className: "location-consent__decline",
6301
+ disabled: !onRespond,
6302
+ onClick: () => {
6303
+ setError(null);
6304
+ setPreference("off");
6305
+ },
6306
+ children: "No thanks"
6307
+ }
6308
+ )
6309
+ ] }),
6310
+ error && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { role: "alert", className: "location-consent__error", children: error })
6311
+ ] });
6312
+ }
6313
+
6314
+ // src/react/components/CollectionResultCard/CollectionResultCard.tsx
6315
+ var import_jsx_runtime13 = require("react/jsx-runtime");
6158
6316
  function CollectionResultCard({
6159
6317
  result
6160
6318
  }) {
6161
6319
  const empty = result.items.length === 0;
6162
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
6320
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6163
6321
  "section",
6164
6322
  {
6165
6323
  className: `collection-result-card tool-result-card tool-result-card--${result.status}`,
6166
6324
  "aria-label": result.title,
6167
6325
  role: result.status === "completed" ? "status" : "alert",
6168
6326
  children: [
6169
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "tool-result-card__heading", children: [
6170
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6171
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: result.title })
6327
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "tool-result-card__heading", children: [
6328
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6329
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: result.title })
6172
6330
  ] }),
6173
- empty ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "collection-result-card__empty", children: "No matching record for the email you shared." }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "collection-result-card__list", children: result.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { children: [
6174
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "collection-result-card__item-title", children: item.title }),
6175
- item.description ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: item.description }) : null,
6176
- item.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dl", { children: item.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
6177
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { children: detail.label }),
6178
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dd", { children: detail.value })
6331
+ empty ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "collection-result-card__empty", children: "No matching record for the email you shared." }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "collection-result-card__list", children: result.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { children: [
6332
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "collection-result-card__item-title", children: item.title }),
6333
+ item.description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: item.description }) : null,
6334
+ item.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dl", { children: item.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
6335
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: detail.label }),
6336
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: detail.value })
6179
6337
  ] }, `${detail.label}:${detail.value}`)) }) : null,
6180
- item.href ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("a", { href: item.href, target: "_blank", rel: "noreferrer", children: "Open record" }) : null
6338
+ item.href ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("a", { href: item.href, target: "_blank", rel: "noreferrer", children: "Open record" }) : null
6181
6339
  ] }, item.title)) })
6182
6340
  ]
6183
6341
  }
@@ -6185,23 +6343,23 @@ function CollectionResultCard({
6185
6343
  }
6186
6344
 
6187
6345
  // src/react/components/EntityResultCard/EntityResultCard.tsx
6188
- var import_jsx_runtime13 = require("react/jsx-runtime");
6346
+ var import_jsx_runtime14 = require("react/jsx-runtime");
6189
6347
  function EntityResultCard({
6190
6348
  result
6191
6349
  }) {
6192
6350
  const compact = !result.description && !result.details?.length && !result.links?.length;
6193
6351
  const collapsible = result.status === "completed" && Boolean(result.details?.length) && !result.links?.length;
6194
- const heading = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "tool-result-card__heading", children: [
6195
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6196
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("strong", { children: result.title })
6352
+ const heading = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "tool-result-card__heading", children: [
6353
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6354
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: result.title })
6197
6355
  ] });
6198
- const content = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
6199
- result.description ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: result.description }) : null,
6200
- result.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dl", { children: result.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { children: [
6201
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: detail.label }),
6202
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: detail.value })
6356
+ const content = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
6357
+ result.description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: result.description }) : null,
6358
+ result.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dl", { children: result.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { children: [
6359
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: detail.label }),
6360
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: detail.value })
6203
6361
  ] }, `${detail.label}:${detail.value}`)) }) : null,
6204
- result.links?.length ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "tool-result-card__links", children: result.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6362
+ result.links?.length ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "tool-result-card__links", children: result.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6205
6363
  "a",
6206
6364
  {
6207
6365
  href: link.href,
@@ -6213,12 +6371,12 @@ function EntityResultCard({
6213
6371
  )) }) : null
6214
6372
  ] });
6215
6373
  if (collapsible) {
6216
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "entity-result-card tool-result-card entity-result-card--disclosure", children: [
6217
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { role: "status", children: heading }) }),
6374
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("details", { className: "entity-result-card tool-result-card entity-result-card--disclosure", children: [
6375
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { role: "status", children: heading }) }),
6218
6376
  content
6219
6377
  ] });
6220
6378
  }
6221
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
6379
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6222
6380
  "section",
6223
6381
  {
6224
6382
  className: `entity-result-card tool-result-card tool-result-card--${result.status}${compact ? " entity-result-card--compact" : ""}`,
@@ -6233,24 +6391,24 @@ function EntityResultCard({
6233
6391
  }
6234
6392
 
6235
6393
  // src/react/components/SignatureResultCard/SignatureResultCard.tsx
6236
- var import_jsx_runtime14 = require("react/jsx-runtime");
6394
+ var import_jsx_runtime15 = require("react/jsx-runtime");
6237
6395
  function SignatureResultCard({
6238
6396
  result
6239
6397
  }) {
6240
6398
  const primaryLink = result.links?.[0];
6241
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
6399
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6242
6400
  "section",
6243
6401
  {
6244
6402
  className: `signature-result-card tool-result-card tool-result-card--${result.status}`,
6245
6403
  "aria-label": result.title,
6246
6404
  children: [
6247
- /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "tool-result-card__heading", children: [
6248
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6249
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("strong", { children: result.title })
6405
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tool-result-card__heading", children: [
6406
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6407
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: result.title })
6250
6408
  ] }),
6251
- result.statusLabel ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "signature-result-card__badge", children: result.statusLabel }) : null,
6252
- result.description ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: result.description }) : null,
6253
- primaryLink ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
6409
+ result.statusLabel ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "signature-result-card__badge", children: result.statusLabel }) : null,
6410
+ result.description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: result.description }) : null,
6411
+ primaryLink ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6254
6412
  "a",
6255
6413
  {
6256
6414
  className: "signature-result-card__cta",
@@ -6266,27 +6424,27 @@ function SignatureResultCard({
6266
6424
  }
6267
6425
 
6268
6426
  // src/react/components/ToolResultCard/ToolResultCard.tsx
6269
- var import_jsx_runtime15 = require("react/jsx-runtime");
6427
+ var import_jsx_runtime16 = require("react/jsx-runtime");
6270
6428
  function ToolResultCard({
6271
6429
  result
6272
6430
  }) {
6273
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
6431
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
6274
6432
  "section",
6275
6433
  {
6276
6434
  className: `tool-result-card tool-result-card--${result.status}`,
6277
6435
  "aria-label": result.title,
6278
6436
  role: result.status === "completed" ? "status" : "alert",
6279
6437
  children: [
6280
- /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "tool-result-card__heading", children: [
6281
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6282
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("strong", { children: result.title })
6438
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "tool-result-card__heading", children: [
6439
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "tool-result-card__status", "aria-hidden": "true" }),
6440
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("strong", { children: result.title })
6283
6441
  ] }),
6284
- result.description ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("p", { children: result.description }) : null,
6285
- result.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("dl", { children: result.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { children: [
6286
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("dt", { children: detail.label }),
6287
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("dd", { children: detail.value })
6442
+ result.description ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { children: result.description }) : null,
6443
+ result.details?.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dl", { children: result.details.map((detail) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { children: [
6444
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dt", { children: detail.label }),
6445
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("dd", { children: detail.value })
6288
6446
  ] }, `${detail.label}:${detail.value}`)) }) : null,
6289
- result.links?.length ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "tool-result-card__links", children: result.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6447
+ result.links?.length ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "tool-result-card__links", children: result.links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6290
6448
  "a",
6291
6449
  {
6292
6450
  href: link.href,
@@ -6302,14 +6460,14 @@ function ToolResultCard({
6302
6460
  }
6303
6461
 
6304
6462
  // src/react/components/VisitorToolResultView/VisitorToolResultView.tsx
6305
- var import_jsx_runtime16 = require("react/jsx-runtime");
6463
+ var import_jsx_runtime17 = require("react/jsx-runtime");
6306
6464
  function VisitorToolResultView({
6307
6465
  disabled = false,
6308
6466
  onToolInput,
6309
6467
  result
6310
6468
  }) {
6311
6469
  if (result.kind === "input") {
6312
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
6470
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6313
6471
  ToolInputCard,
6314
6472
  {
6315
6473
  disabled,
@@ -6319,16 +6477,16 @@ function VisitorToolResultView({
6319
6477
  );
6320
6478
  }
6321
6479
  if (result.kind === "entity") {
6322
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(EntityResultCard, { result });
6480
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(EntityResultCard, { result });
6323
6481
  }
6324
6482
  if (result.kind === "collection") {
6325
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CollectionResultCard, { result });
6483
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CollectionResultCard, { result });
6326
6484
  }
6327
6485
  if (result.kind === "signature") {
6328
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(SignatureResultCard, { result });
6486
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SignatureResultCard, { result });
6329
6487
  }
6330
6488
  if (result.kind === "summary") {
6331
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolResultCard, { result });
6489
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ToolResultCard, { result });
6332
6490
  }
6333
6491
  return null;
6334
6492
  }
@@ -6337,9 +6495,9 @@ function isRenderableVisitorToolResult(result) {
6337
6495
  }
6338
6496
 
6339
6497
  // src/react/components/AgentRail/AgentRail.tsx
6340
- var import_jsx_runtime17 = require("react/jsx-runtime");
6498
+ var import_jsx_runtime18 = require("react/jsx-runtime");
6341
6499
  function MinimizeIcon() {
6342
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6500
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6343
6501
  "path",
6344
6502
  {
6345
6503
  d: "M3.5 8h9",
@@ -6350,7 +6508,7 @@ function MinimizeIcon() {
6350
6508
  ) });
6351
6509
  }
6352
6510
  function CloseIcon2() {
6353
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6511
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6354
6512
  "path",
6355
6513
  {
6356
6514
  d: "M4 4l8 8M12 4l-8 8",
@@ -6361,7 +6519,7 @@ function CloseIcon2() {
6361
6519
  ) });
6362
6520
  }
6363
6521
  function NewChatIcon() {
6364
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6522
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6365
6523
  "path",
6366
6524
  {
6367
6525
  d: "M9.5 3.5h3v3M12.25 3.75 8 8M7 4H4.5A1.5 1.5 0 0 0 3 5.5v6A1.5 1.5 0 0 0 4.5 13h6a1.5 1.5 0 0 0 1.5-1.5V9",
@@ -6373,7 +6531,7 @@ function NewChatIcon() {
6373
6531
  ) });
6374
6532
  }
6375
6533
  function ExpandIcon() {
6376
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6534
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6377
6535
  "path",
6378
6536
  {
6379
6537
  d: "M6 3.5H3.5V6M10 3.5h2.5V6M10 12.5h2.5V10M6 12.5H3.5V10",
@@ -6385,7 +6543,7 @@ function ExpandIcon() {
6385
6543
  ) });
6386
6544
  }
6387
6545
  function RestoreIcon() {
6388
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6546
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6389
6547
  "path",
6390
6548
  {
6391
6549
  d: "M5.5 5.5H3.5V7.5M10.5 5.5h2V7.5M10.5 10.5h2V8.5M5.5 10.5H3.5V8.5",
@@ -6397,7 +6555,7 @@ function RestoreIcon() {
6397
6555
  ) });
6398
6556
  }
6399
6557
  function ChevronDownIcon() {
6400
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6558
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6401
6559
  "path",
6402
6560
  {
6403
6561
  d: "M4 6.5l4 4 4-4",
@@ -6436,28 +6594,29 @@ function AgentRail({
6436
6594
  onInputResponse,
6437
6595
  onToolInput
6438
6596
  }) {
6439
- const railRef = (0, import_react14.useRef)(null);
6440
- const overlayRef = (0, import_react14.useRef)(null);
6441
- const transcriptRef = (0, import_react14.useRef)(null);
6442
- const responseRef = (0, import_react14.useRef)(null);
6443
- const threadRef = (0, import_react14.useRef)(null);
6444
- const lastScrolledVisitorIdRef = (0, import_react14.useRef)(void 0);
6445
- const pinnedToBottomRef = (0, import_react14.useRef)(true);
6446
- const smoothScrollToLatestRef = (0, import_react14.useRef)(false);
6447
- const lockedTranscriptScrollTopRef = (0, import_react14.useRef)(null);
6448
- const [showJumpToLatest, setShowJumpToLatest] = (0, import_react14.useState)(false);
6449
- const [receiptOpen, setReceiptOpen] = (0, import_react14.useState)(false);
6597
+ const railRef = (0, import_react15.useRef)(null);
6598
+ const overlayRef = (0, import_react15.useRef)(null);
6599
+ const transcriptRef = (0, import_react15.useRef)(null);
6600
+ const responseRef = (0, import_react15.useRef)(null);
6601
+ const threadRef = (0, import_react15.useRef)(null);
6602
+ const lastScrolledVisitorIdRef = (0, import_react15.useRef)(void 0);
6603
+ const pinnedToBottomRef = (0, import_react15.useRef)(true);
6604
+ const smoothScrollToLatestRef = (0, import_react15.useRef)(false);
6605
+ const lockedTranscriptScrollTopRef = (0, import_react15.useRef)(null);
6606
+ const [showJumpToLatest, setShowJumpToLatest] = (0, import_react15.useState)(false);
6607
+ const [receiptOpen, setReceiptOpen] = (0, import_react15.useState)(false);
6450
6608
  const resolvedBrandLabel = brandLabel.trim();
6451
6609
  const resolvedBrandLogoUrl = brandLogoUrl?.trim();
6452
6610
  const resolvedDisclaimerLabel = disclaimerLabel === void 0 ? DEFAULT_DISCLAIMER_LABEL : disclaimerLabel;
6453
- const [failedLogoUrl, setFailedLogoUrl] = (0, import_react14.useState)(null);
6611
+ const [failedLogoUrl, setFailedLogoUrl] = (0, import_react15.useState)(null);
6454
6612
  const showBrandLogo = Boolean(resolvedBrandLogoUrl) && failedLogoUrl !== resolvedBrandLogoUrl;
6455
6613
  const resolvedColorScheme = useAgentColorScheme(colorScheme);
6456
6614
  const railStyle = agentThemeStyle(theme, resolvedColorScheme);
6615
+ const locationRequest = state.pendingInputs?.find(isLocationConsentRequest);
6457
6616
  const pendingInputRequests = (state.pendingInputs ?? []).filter(
6458
- (request) => shouldRenderVisitorInputCard(request) && (!state.pendingOffer || request.kind === "tool-approval")
6617
+ (request) => !isLocationConsentRequest(request) && shouldRenderVisitorInputCard(request) && (!state.pendingOffer || request.kind === "tool-approval")
6459
6618
  );
6460
- const isBusy = state.phase === "thinking" || state.phase === "running-tools" || state.phase === "streaming" || state.phase === "waiting-input" && pendingInputRequests.length > 0;
6619
+ const isBusy = state.phase === "thinking" || state.phase === "running-tools" || state.phase === "streaming" || state.phase === "waiting-input" && (pendingInputRequests.length > 0 || Boolean(locationRequest));
6461
6620
  const semanticSurfaceDisabled = isBusy && state.phase !== "waiting-input";
6462
6621
  const visitorToolResults = (state.toolResults ?? []).filter(
6463
6622
  isRenderableVisitorToolResult
@@ -6543,7 +6702,7 @@ function AgentRail({
6543
6702
  ...visibleVisitorToolResults
6544
6703
  ].reverse().find((result) => result.kind !== "input")?.id;
6545
6704
  const receiptSteps = answerReceipt && state.toolSteps.length > 0 ? state.toolSteps : void 0;
6546
- (0, import_react14.useEffect)(() => {
6705
+ (0, import_react15.useEffect)(() => {
6547
6706
  if (state.phase !== "complete") {
6548
6707
  setReceiptOpen(false);
6549
6708
  }
@@ -6565,7 +6724,7 @@ function AgentRail({
6565
6724
  onFollowUpSelect?.(label);
6566
6725
  }
6567
6726
  const latestVisitorId = visibleMessages[lastVisitorIndex]?.id;
6568
- (0, import_react14.useEffect)(() => {
6727
+ (0, import_react15.useEffect)(() => {
6569
6728
  const node = transcriptRef.current;
6570
6729
  if (!node) return;
6571
6730
  if (latestVisitorId !== lastScrolledVisitorIdRef.current) {
@@ -6595,7 +6754,7 @@ function AgentRail({
6595
6754
  state.followUps,
6596
6755
  state.journey
6597
6756
  ]);
6598
- (0, import_react14.useEffect)(() => {
6757
+ (0, import_react15.useEffect)(() => {
6599
6758
  const node = transcriptRef.current;
6600
6759
  if (!node) return;
6601
6760
  const handleScroll = () => {
@@ -6609,7 +6768,7 @@ function AgentRail({
6609
6768
  handleScroll();
6610
6769
  return () => node.removeEventListener("scroll", handleScroll);
6611
6770
  }, []);
6612
- (0, import_react14.useEffect)(() => {
6771
+ (0, import_react15.useEffect)(() => {
6613
6772
  if (!receiptOpen) {
6614
6773
  lockedTranscriptScrollTopRef.current = null;
6615
6774
  return;
@@ -6647,7 +6806,7 @@ function AgentRail({
6647
6806
  window.setTimeout(settle, 900);
6648
6807
  node.scrollTo({ top: node.scrollHeight, behavior: "smooth" });
6649
6808
  }
6650
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6809
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6651
6810
  "aside",
6652
6811
  {
6653
6812
  ref: railRef,
@@ -6661,34 +6820,34 @@ function AgentRail({
6661
6820
  autoFocus: mobileFullscreen || expanded,
6662
6821
  role: mobileFullscreen || expanded ? "dialog" : void 0,
6663
6822
  tabIndex: mobileFullscreen || expanded ? -1 : void 0,
6664
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6823
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6665
6824
  AgentRailOverlayContext.Provider,
6666
6825
  {
6667
6826
  value: { railRef, overlayRef },
6668
6827
  children: [
6669
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "agent-rail__surface", inert: receiptOpen || void 0, children: [
6670
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("header", { className: "agent-rail__header", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "agent-rail__brand-row", children: [
6671
- onCollapse ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6828
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "agent-rail__surface", inert: receiptOpen || void 0, children: [
6829
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("header", { className: "agent-rail__header", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "agent-rail__brand-row", children: [
6830
+ onCollapse ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6672
6831
  "button",
6673
6832
  {
6674
6833
  type: "button",
6675
6834
  className: "agent-rail__collapse",
6676
6835
  "aria-label": "Collapse assist",
6677
6836
  onClick: onCollapse,
6678
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(MinimizeIcon, {})
6837
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(MinimizeIcon, {})
6679
6838
  }
6680
- ) : onClose ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6839
+ ) : onClose ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6681
6840
  "button",
6682
6841
  {
6683
6842
  type: "button",
6684
6843
  className: "agent-rail__close",
6685
6844
  "aria-label": "Close agent",
6686
6845
  onClick: onClose,
6687
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CloseIcon2, {})
6846
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CloseIcon2, {})
6688
6847
  }
6689
- ) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "agent-rail__brand-spacer", "aria-hidden": "true" }),
6690
- resolvedBrandLabel || showBrandLogo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "agent-rail__identity", children: [
6691
- showBrandLogo ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "agent-rail__brand-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6848
+ ) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "agent-rail__brand-spacer", "aria-hidden": "true" }),
6849
+ resolvedBrandLabel || showBrandLogo ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "agent-rail__identity", children: [
6850
+ showBrandLogo ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "agent-rail__brand-mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6692
6851
  "img",
6693
6852
  {
6694
6853
  className: "agent-rail__brand-logo",
@@ -6699,10 +6858,10 @@ function AgentRail({
6699
6858
  }
6700
6859
  }
6701
6860
  ) }) : null,
6702
- resolvedBrandLabel ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "agent-rail__brand-label", children: resolvedBrandLabel }) : null
6861
+ resolvedBrandLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "agent-rail__brand-label", children: resolvedBrandLabel }) : null
6703
6862
  ] }) : null,
6704
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "agent-rail__actions", children: [
6705
- onReset ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6863
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "agent-rail__actions", children: [
6864
+ onReset ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6706
6865
  "button",
6707
6866
  {
6708
6867
  type: "button",
@@ -6710,24 +6869,24 @@ function AgentRail({
6710
6869
  "aria-label": "Start a new conversation",
6711
6870
  disabled: !hasVisitorMessages2,
6712
6871
  onClick: handleReset,
6713
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(NewChatIcon, {})
6872
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(NewChatIcon, {})
6714
6873
  }
6715
6874
  ) : null,
6716
- onExpandToggle ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6875
+ onExpandToggle ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6717
6876
  "button",
6718
6877
  {
6719
6878
  type: "button",
6720
6879
  className: "agent-rail__expand",
6721
6880
  "aria-label": expanded ? "Exit full screen" : "Open full screen",
6722
6881
  onClick: onExpandToggle,
6723
- children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(RestoreIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ExpandIcon, {})
6882
+ children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(RestoreIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ExpandIcon, {})
6724
6883
  }
6725
6884
  ) : null
6726
6885
  ] })
6727
6886
  ] }) }),
6728
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref: transcriptRef, className: "agent-rail__transcript", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { ref: threadRef, className: "agent-rail__thread", children: [
6729
- !hasVisitorMessages2 ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "agent-rail__welcome", "aria-label": "Welcome", children: [
6730
- greeting?.role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6887
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: transcriptRef, className: "agent-rail__transcript", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { ref: threadRef, className: "agent-rail__thread", children: [
6888
+ !hasVisitorMessages2 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: "agent-rail__welcome", "aria-label": "Welcome", children: [
6889
+ greeting?.role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6731
6890
  MessageBubble,
6732
6891
  {
6733
6892
  message: greeting,
@@ -6736,7 +6895,7 @@ function AgentRail({
6736
6895
  onBook
6737
6896
  }
6738
6897
  ) : null,
6739
- showIdleFollowUps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "agent-rail__followups-slot", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6898
+ showIdleFollowUps ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "agent-rail__followups-slot", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6740
6899
  FollowUpChips,
6741
6900
  {
6742
6901
  suggestions: state.followUps,
@@ -6745,7 +6904,7 @@ function AgentRail({
6745
6904
  onSelect: (suggestion) => handleFollowUpSelect(suggestion.label)
6746
6905
  }
6747
6906
  ) }) : null,
6748
- showActivity ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6907
+ showActivity ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6749
6908
  AgentActivityBubble,
6750
6909
  {
6751
6910
  brandLabel: resolvedBrandLabel,
@@ -6754,7 +6913,7 @@ function AgentRail({
6754
6913
  steps: activitySteps
6755
6914
  }
6756
6915
  ) : null,
6757
- visibleVisitorToolResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6916
+ visibleVisitorToolResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6758
6917
  VisitorToolResultView,
6759
6918
  {
6760
6919
  result,
@@ -6763,7 +6922,7 @@ function AgentRail({
6763
6922
  },
6764
6923
  result.id
6765
6924
  )),
6766
- pendingInputRequests.slice(0, 1).map((request) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6925
+ pendingInputRequests.slice(0, 1).map((request) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6767
6926
  HumanInputCard,
6768
6927
  {
6769
6928
  request,
@@ -6772,14 +6931,14 @@ function AgentRail({
6772
6931
  request.requestId
6773
6932
  ))
6774
6933
  ] }) : null,
6775
- transcriptMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
6934
+ transcriptMessages.map((message, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
6776
6935
  "div",
6777
6936
  {
6778
6937
  ref: index === lastVisitorIndex + 1 ? responseRef : void 0,
6779
6938
  className: "agent-rail__turn-block",
6780
6939
  children: [
6781
- message.role === "agent" ? message.toolResults?.map((result) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(VisitorToolResultView, { result }, result.id)) : null,
6782
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6940
+ message.role === "agent" ? message.toolResults?.map((result) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(VisitorToolResultView, { result }, result.id)) : null,
6941
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6783
6942
  MessageBubble,
6784
6943
  {
6785
6944
  message,
@@ -6789,7 +6948,7 @@ function AgentRail({
6789
6948
  onBook
6790
6949
  }
6791
6950
  ),
6792
- index === lastAgentIndex && showMessageActions && message.role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6951
+ index === lastAgentIndex && showMessageActions && message.role === "agent" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6793
6952
  MessageActions,
6794
6953
  {
6795
6954
  answeredAt: message.createdAt,
@@ -6801,8 +6960,8 @@ function AgentRail({
6801
6960
  onFeedback: onFeedback ? (rating) => onFeedback(rating, message) : void 0
6802
6961
  }
6803
6962
  ) : null,
6804
- index === lastVisitorIndex ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [
6805
- showActivity ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6963
+ index === lastVisitorIndex ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
6964
+ showActivity ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6806
6965
  AgentActivityBubble,
6807
6966
  {
6808
6967
  brandLabel: resolvedBrandLabel,
@@ -6811,7 +6970,7 @@ function AgentRail({
6811
6970
  steps: activitySteps
6812
6971
  }
6813
6972
  ) : null,
6814
- visibleVisitorToolResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6973
+ visibleVisitorToolResults.map((result) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6815
6974
  VisitorToolResultView,
6816
6975
  {
6817
6976
  result,
@@ -6820,7 +6979,7 @@ function AgentRail({
6820
6979
  },
6821
6980
  result.id
6822
6981
  )),
6823
- pendingInputRequests.slice(0, 1).map((request) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
6982
+ pendingInputRequests.slice(0, 1).map((request) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6824
6983
  HumanInputCard,
6825
6984
  {
6826
6985
  request,
@@ -6833,16 +6992,16 @@ function AgentRail({
6833
6992
  },
6834
6993
  message.role === "agent" && transcriptMessages[index - 1]?.role === "visitor" ? `answer-${transcriptMessages[index - 1]?.id}` : message.id
6835
6994
  )),
6836
- waitingForBooking ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(BookingCardLoader, {}) : null,
6837
- state.error ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("section", { className: "agent-rail__error", role: "alert", children: [
6838
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
6839
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("strong", { children: "Something went wrong" }),
6840
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: state.error })
6995
+ waitingForBooking ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(BookingCardLoader, {}) : null,
6996
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("section", { className: "agent-rail__error", role: "alert", children: [
6997
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
6998
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("strong", { children: "Something went wrong" }),
6999
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: state.error })
6841
7000
  ] }),
6842
- onRetry ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("button", { type: "button", onClick: onRetry, children: "Try again" }) : null
7001
+ onRetry ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { type: "button", onClick: onRetry, children: "Try again" }) : null
6843
7002
  ] }) : null
6844
7003
  ] }) }),
6845
- showDisclaimerLabel ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "agent-rail__disclaimer", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: disclaimerLink ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7004
+ showDisclaimerLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "agent-rail__disclaimer", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: disclaimerLink ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6846
7005
  "a",
6847
7006
  {
6848
7007
  href: disclaimerLink,
@@ -6851,8 +7010,16 @@ function AgentRail({
6851
7010
  children: resolvedDisclaimerLabel
6852
7011
  }
6853
7012
  ) : resolvedDisclaimerLabel }) }) : null,
6854
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "agent-rail__composer-wrap", children: [
6855
- showJumpToLatest ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7013
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "agent-rail__composer-wrap", children: [
7014
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7015
+ LocationConsent,
7016
+ {
7017
+ request: locationRequest,
7018
+ onRespond: onInputResponse
7019
+ },
7020
+ state.messages.find((message) => message.role === "visitor")?.id ?? "empty"
7021
+ ),
7022
+ showJumpToLatest ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6856
7023
  "button",
6857
7024
  {
6858
7025
  type: "button",
@@ -6860,10 +7027,10 @@ function AgentRail({
6860
7027
  "aria-label": "Jump to the latest message",
6861
7028
  title: "Jump to the latest message",
6862
7029
  onClick: scrollToLatest,
6863
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDownIcon, {})
7030
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronDownIcon, {})
6864
7031
  }
6865
7032
  ) : null,
6866
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7033
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6867
7034
  Composer,
6868
7035
  {
6869
7036
  variant: expanded || mobileFullscreen ? "dock" : "default",
@@ -6875,11 +7042,11 @@ function AgentRail({
6875
7042
  },
6876
7043
  `${state.messages.find((message) => message.role === "visitor")?.id ?? "empty"}:${latestResultId ?? ""}`
6877
7044
  ),
6878
- poweredByLabel ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "agent-rail__footer", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: poweredByLabel }) }) }) : null
7045
+ poweredByLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "agent-rail__footer", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: poweredByLabel }) }) }) : null
6879
7046
  ] })
6880
7047
  ] }),
6881
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { ref: overlayRef, className: "agent-rail__overlay" }),
6882
- receiptOpen && receiptSteps ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7048
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { ref: overlayRef, className: "agent-rail__overlay" }),
7049
+ receiptOpen && receiptSteps ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
6883
7050
  AnswerReceiptDialog,
6884
7051
  {
6885
7052
  brandLabel: resolvedBrandLabel,
@@ -6895,10 +7062,10 @@ function AgentRail({
6895
7062
  }
6896
7063
 
6897
7064
  // src/react/components/AssistEdgeTab/AssistEdgeTab.tsx
6898
- var import_react15 = require("react");
6899
- var import_jsx_runtime18 = require("react/jsx-runtime");
7065
+ var import_react16 = require("react");
7066
+ var import_jsx_runtime19 = require("react/jsx-runtime");
6900
7067
  function ChatSparkIcon() {
6901
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7068
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
6902
7069
  "svg",
6903
7070
  {
6904
7071
  className: "assist-edge-tab__chat-spark",
@@ -6906,7 +7073,7 @@ function ChatSparkIcon() {
6906
7073
  fill: "none",
6907
7074
  "aria-hidden": "true",
6908
7075
  children: [
6909
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7076
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6910
7077
  "path",
6911
7078
  {
6912
7079
  className: "assist-edge-tab__spark assist-edge-tab__spark--a",
@@ -6914,7 +7081,7 @@ function ChatSparkIcon() {
6914
7081
  fill: "currentColor"
6915
7082
  }
6916
7083
  ),
6917
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7084
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6918
7085
  "path",
6919
7086
  {
6920
7087
  className: "assist-edge-tab__spark assist-edge-tab__spark--b",
@@ -6922,8 +7089,8 @@ function ChatSparkIcon() {
6922
7089
  fill: "currentColor"
6923
7090
  }
6924
7091
  ),
6925
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("g", { className: "assist-edge-tab__bot", children: [
6926
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7092
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("g", { className: "assist-edge-tab__bot", children: [
7093
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6927
7094
  "path",
6928
7095
  {
6929
7096
  d: "M11.15 5.2V3.05",
@@ -6932,8 +7099,8 @@ function ChatSparkIcon() {
6932
7099
  strokeLinecap: "round"
6933
7100
  }
6934
7101
  ),
6935
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("circle", { cx: "11.15", cy: "2.45", r: "0.85", fill: "currentColor" }),
6936
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7102
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("circle", { cx: "11.15", cy: "2.45", r: "0.85", fill: "currentColor" }),
7103
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6937
7104
  "rect",
6938
7105
  {
6939
7106
  x: "3.55",
@@ -6945,7 +7112,7 @@ function ChatSparkIcon() {
6945
7112
  strokeWidth: "1.9"
6946
7113
  }
6947
7114
  ),
6948
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7115
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6949
7116
  "circle",
6950
7117
  {
6951
7118
  className: "assist-edge-tab__eye",
@@ -6955,7 +7122,7 @@ function ChatSparkIcon() {
6955
7122
  fill: "currentColor"
6956
7123
  }
6957
7124
  ),
6958
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7125
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6959
7126
  "circle",
6960
7127
  {
6961
7128
  className: "assist-edge-tab__eye assist-edge-tab__eye--r",
@@ -6976,10 +7143,10 @@ function TabMarkIcon({
6976
7143
  }) {
6977
7144
  const custom = customIconUrl?.trim();
6978
7145
  const logo = logoUrl?.trim();
6979
- const [customFailed, setCustomFailed] = (0, import_react15.useState)(false);
6980
- const [logoFailed, setLogoFailed] = (0, import_react15.useState)(false);
7146
+ const [customFailed, setCustomFailed] = (0, import_react16.useState)(false);
7147
+ const [logoFailed, setLogoFailed] = (0, import_react16.useState)(false);
6981
7148
  if (custom && !customFailed) {
6982
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7149
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6983
7150
  "img",
6984
7151
  {
6985
7152
  alt: "",
@@ -6991,7 +7158,7 @@ function TabMarkIcon({
6991
7158
  );
6992
7159
  }
6993
7160
  if (logo && !logoFailed) {
6994
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7161
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
6995
7162
  "img",
6996
7163
  {
6997
7164
  alt: "",
@@ -7002,10 +7169,10 @@ function TabMarkIcon({
7002
7169
  }
7003
7170
  );
7004
7171
  }
7005
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChatSparkIcon, {});
7172
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChatSparkIcon, {});
7006
7173
  }
7007
7174
  function ChevronLeftIcon() {
7008
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7175
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7009
7176
  "path",
7010
7177
  {
7011
7178
  d: "M10 4L6 8l4 4",
@@ -7017,7 +7184,7 @@ function ChevronLeftIcon() {
7017
7184
  ) });
7018
7185
  }
7019
7186
  function ChevronDownIcon2() {
7020
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7187
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7021
7188
  "path",
7022
7189
  {
7023
7190
  d: "M4 6l4 4 4-4",
@@ -7029,7 +7196,7 @@ function ChevronDownIcon2() {
7029
7196
  ) });
7030
7197
  }
7031
7198
  function DragDots() {
7032
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__dots", "aria-hidden": "true", children: Array.from({ length: 12 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("i", {}, index)) });
7199
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__dots", "aria-hidden": "true", children: Array.from({ length: 12 }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("i", {}, index)) });
7033
7200
  }
7034
7201
  var VARIANT_COPY = {
7035
7202
  outline: { label: "Ask anything", aria: "Ask anything" },
@@ -7084,7 +7251,7 @@ function AssistEdgeTab({
7084
7251
  ...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
7085
7252
  colorScheme: chromeScheme
7086
7253
  };
7087
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7254
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
7088
7255
  "button",
7089
7256
  {
7090
7257
  type: "button",
@@ -7096,13 +7263,13 @@ function AssistEdgeTab({
7096
7263
  tabIndex: visible ? 0 : -1,
7097
7264
  onClick: onOpen,
7098
7265
  children: [
7099
- pill ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
7100
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7266
+ pill ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7267
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7101
7268
  "span",
7102
7269
  {
7103
7270
  className: `assist-edge-tab__mark assist-edge-tab__mark--chip${mobile ? " assist-edge-tab__mark--mobile" : ""}`,
7104
7271
  "aria-hidden": "true",
7105
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7272
+ children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7106
7273
  TabMarkIcon,
7107
7274
  {
7108
7275
  customIconUrl,
@@ -7112,12 +7279,12 @@ function AssistEdgeTab({
7112
7279
  )
7113
7280
  }
7114
7281
  ),
7115
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "assist-edge-tab__text", children: [
7116
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7117
- visibleSubLabel ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__sublabel", children: visibleSubLabel }) : null
7282
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "assist-edge-tab__text", children: [
7283
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7284
+ visibleSubLabel ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__sublabel", children: visibleSubLabel }) : null
7118
7285
  ] })
7119
- ] }) : variant === "outline" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
7120
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7286
+ ] }) : variant === "outline" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7287
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7121
7288
  TabMarkIcon,
7122
7289
  {
7123
7290
  customIconUrl,
@@ -7125,16 +7292,16 @@ function AssistEdgeTab({
7125
7292
  },
7126
7293
  markSourceKey
7127
7294
  ) }),
7128
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7129
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronDownIcon2, {})
7295
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7296
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronDownIcon2, {})
7130
7297
  ] }) : null,
7131
- !pill && variant === "ask" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
7132
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronLeftIcon, {}),
7133
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7134
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DragDots, {})
7298
+ !pill && variant === "ask" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7299
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronLeftIcon, {}),
7300
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7301
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DragDots, {})
7135
7302
  ] }) : null,
7136
- !pill && variant === "fill" ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
7137
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7303
+ !pill && variant === "fill" ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
7304
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__mark", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7138
7305
  TabMarkIcon,
7139
7306
  {
7140
7307
  customIconUrl,
@@ -7142,8 +7309,8 @@ function AssistEdgeTab({
7142
7309
  },
7143
7310
  markSourceKey
7144
7311
  ) }),
7145
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7146
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ChevronLeftIcon, {})
7312
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "assist-edge-tab__label", children: visibleLabel }),
7313
+ /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ChevronLeftIcon, {})
7147
7314
  ] }) : null
7148
7315
  ]
7149
7316
  }
@@ -7207,7 +7374,7 @@ function sendAgentAnswerFeedback(eventUrl, event) {
7207
7374
  }
7208
7375
 
7209
7376
  // src/react/components/AgentWidget/AgentWidget.tsx
7210
- var import_jsx_runtime19 = require("react/jsx-runtime");
7377
+ var import_jsx_runtime20 = require("react/jsx-runtime");
7211
7378
  function AgentWidget({
7212
7379
  indexId,
7213
7380
  customerId,
@@ -7226,9 +7393,9 @@ function AgentWidget({
7226
7393
  }) {
7227
7394
  const isMobile = useIsMobile();
7228
7395
  const placement = normalizeAgentPlacement(placementInput);
7229
- const railSlotRef = (0, import_react16.useRef)(null);
7230
- const [railCollapsed, setRailCollapsed] = (0, import_react16.useState)(defaultCollapsed);
7231
- const [railExpanded, setRailExpanded] = (0, import_react16.useState)(false);
7396
+ const railSlotRef = (0, import_react17.useRef)(null);
7397
+ const [railCollapsed, setRailCollapsed] = (0, import_react17.useState)(defaultCollapsed);
7398
+ const [railExpanded, setRailExpanded] = (0, import_react17.useState)(false);
7232
7399
  const pageShiftActive = shouldApplyPageShift({
7233
7400
  pageShift,
7234
7401
  isMobile,
@@ -7281,7 +7448,7 @@ function AgentWidget({
7281
7448
  } : {},
7282
7449
  ...branding?.colors?.border ? { border: branding.colors.border } : {}
7283
7450
  };
7284
- (0, import_react16.useEffect)(() => {
7451
+ (0, import_react17.useEffect)(() => {
7285
7452
  if (!registerPanelController) return;
7286
7453
  registerAgentPanelController(customerId, {
7287
7454
  open: () => setRailCollapsed(false),
@@ -7316,7 +7483,7 @@ function AgentWidget({
7316
7483
  })
7317
7484
  );
7318
7485
  }
7319
- (0, import_react16.useEffect)(() => {
7486
+ (0, import_react17.useEffect)(() => {
7320
7487
  if (railCollapsed) return;
7321
7488
  const handleKeyDown = (event) => {
7322
7489
  if (event.key === "Tab" && (isMobile || railExpanded)) {
@@ -7350,19 +7517,19 @@ function AgentWidget({
7350
7517
  window.addEventListener("keydown", handleKeyDown);
7351
7518
  return () => window.removeEventListener("keydown", handleKeyDown);
7352
7519
  }, [isMobile, railCollapsed, railExpanded]);
7353
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "webless-agent-root", children: [
7354
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7520
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "webless-agent-root", children: [
7521
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7355
7522
  "div",
7356
7523
  {
7357
7524
  className: `webless-agent-root__shell${railCollapsed ? " webless-agent-root__shell--collapsed" : ""}${railExpanded ? " webless-agent-root__shell--expanded" : ""}`,
7358
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7525
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7359
7526
  "div",
7360
7527
  {
7361
7528
  ref: railSlotRef,
7362
7529
  className: "webless-agent-root__rail-slot",
7363
7530
  inert: railCollapsed || void 0,
7364
7531
  "aria-hidden": railCollapsed,
7365
- children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7532
+ children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7366
7533
  AgentRail,
7367
7534
  {
7368
7535
  theme,
@@ -7399,7 +7566,7 @@ function AgentWidget({
7399
7566
  )
7400
7567
  }
7401
7568
  ),
7402
- railCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
7569
+ railCollapsed ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7403
7570
  AssistEdgeTab,
7404
7571
  {
7405
7572
  variant: placement.variant,
@@ -7439,12 +7606,12 @@ function readUnpublishedPreviewBuildId(href) {
7439
7606
  }
7440
7607
 
7441
7608
  // src/embed/AgentWidget.tsx
7442
- var import_jsx_runtime20 = require("react/jsx-runtime");
7609
+ var import_jsx_runtime21 = require("react/jsx-runtime");
7443
7610
  function AgentWidget2({
7444
7611
  manifest
7445
7612
  }) {
7446
7613
  const defaultCollapsed = manifest.version !== "unpublished";
7447
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
7614
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
7448
7615
  AgentWidget,
7449
7616
  {
7450
7617
  indexId: manifest.indexId,
@@ -7569,7 +7736,7 @@ function normalizeAgentBranding(branding) {
7569
7736
  }
7570
7737
 
7571
7738
  // src/embed/mount.tsx
7572
- var import_jsx_runtime21 = require("react/jsx-runtime");
7739
+ var import_jsx_runtime22 = require("react/jsx-runtime");
7573
7740
  var mountedHandles = /* @__PURE__ */ new Map();
7574
7741
  var latestCustomerId = null;
7575
7742
  function resolveMountHost(manifest, script) {
@@ -7599,7 +7766,7 @@ function mountAgent(input) {
7599
7766
  const host = createHost(manifest.customerId);
7600
7767
  mountTarget.append(host);
7601
7768
  const root = (0, import_client5.createRoot)(host);
7602
- root.render(/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(AgentWidget2, { manifest }));
7769
+ root.render(/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AgentWidget2, { manifest }));
7603
7770
  const handle = {
7604
7771
  customerId: manifest.customerId,
7605
7772
  manifest,