@burdenoff/website-sdk 2026.922.3 → 2026.922.4
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/components/explore.d.mts +70 -2
- package/dist/components/explore.d.ts +70 -2
- package/dist/components/explore.js +492 -8
- package/dist/components/explore.js.map +1 -1
- package/dist/components/explore.mjs +490 -10
- package/dist/components/explore.mjs.map +1 -1
- package/dist/{explore-types-CPF1QoMn.d.mts → explore-types-DvQPiL1t.d.mts} +58 -2
- package/dist/{explore-types-CPF1QoMn.d.ts → explore-types-DvQPiL1t.d.ts} +58 -2
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.d.ts +2 -2
- package/dist/hooks/index.js +61 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +61 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +36 -2
- package/dist/index.d.ts +36 -2
- package/dist/index.js +489 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +490 -10
- package/dist/index.mjs.map +1 -1
- package/dist/{use-explore-chat--CxNtkrJ.d.ts → use-explore-chat-CNEdKBc1.d.ts} +1 -1
- package/dist/{use-explore-chat-C6Y8JQMj.d.mts → use-explore-chat-Dgm-jf96.d.mts} +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { createContext, useMemo, useState, useRef, useCallback, useEffect, useContext } from 'react';
|
|
3
|
-
import { Sparkles, RotateCcw, Link2, History, Trash2, Paperclip, X, Mic, Square, ArrowUp, BookOpenText, Layers, TriangleAlert, ChevronLeft, ChevronRight, ExternalLink, ThumbsUp, ThumbsDown } from 'lucide-react';
|
|
3
|
+
import { Sparkles, RotateCcw, Link2, History, Trash2, Paperclip, X, Mic, Square, ArrowUp, BookOpenText, Layers, TriangleAlert, ChevronLeft, ChevronRight, ExternalLink, Check, Copy, ThumbsUp, ThumbsDown } from 'lucide-react';
|
|
4
4
|
import ReactMarkdown from 'react-markdown';
|
|
5
5
|
import rehypeSanitize from 'rehype-sanitize';
|
|
6
6
|
import remarkGfm from 'remark-gfm';
|
|
@@ -77,6 +77,20 @@ var EN = {
|
|
|
77
77
|
nextSuggestion: "Next suggestion",
|
|
78
78
|
conceptIllustration: "Concept illustration",
|
|
79
79
|
opensInNewTab: "opens in a new tab",
|
|
80
|
+
conceptStripTitle: "Or start from a concept",
|
|
81
|
+
conceptStripLabel: "Concepts you can ask about",
|
|
82
|
+
conceptAsk: "Ask about {title} in {product}",
|
|
83
|
+
conceptAskQuestion: "How does {title} work in {product}?",
|
|
84
|
+
copyAnswer: "Copy answer",
|
|
85
|
+
copyFailed: "Couldn't copy",
|
|
86
|
+
groundedIn: "What this answer is based on",
|
|
87
|
+
sourceCountOne: "1 source",
|
|
88
|
+
sourceCountMany: "{count} sources",
|
|
89
|
+
sourceKindConcept: "Concept",
|
|
90
|
+
sourceKindDocs: "Documentation",
|
|
91
|
+
sourceKindPricing: "Pricing",
|
|
92
|
+
sourceKindUseCase: "Use case",
|
|
93
|
+
sourceKindPage: "Product page",
|
|
80
94
|
seoTitle: "Describe a problem, get an answer",
|
|
81
95
|
seoDescription: "Describe the problem you're facing in your own words and get an answer drawn from our product documentation, with links to the exact pages it came from.",
|
|
82
96
|
seoDescriptionProduct: "Describe the problem you're facing in your own words and get an answer drawn from {product}'s documentation \u2014 and every other product we build \u2014 with links to the exact pages it came from.",
|
|
@@ -145,6 +159,20 @@ var ZH = {
|
|
|
145
159
|
nextSuggestion: "\u4E0B\u4E00\u4E2A\u5EFA\u8BAE",
|
|
146
160
|
conceptIllustration: "\u6982\u5FF5\u793A\u610F\u56FE",
|
|
147
161
|
opensInNewTab: "\u5728\u65B0\u6807\u7B7E\u9875\u4E2D\u6253\u5F00",
|
|
162
|
+
conceptStripTitle: "\u6216\u8005\u4ECE\u4E00\u4E2A\u6982\u5FF5\u5F00\u59CB",
|
|
163
|
+
conceptStripLabel: "\u4F60\u53EF\u4EE5\u8BE2\u95EE\u7684\u6982\u5FF5",
|
|
164
|
+
conceptAsk: "\u8BE2\u95EE {product} \u4E2D\u7684 {title}",
|
|
165
|
+
conceptAskQuestion: "{product} \u7684 {title} \u662F\u600E\u4E48\u8FD0\u4F5C\u7684\uFF1F",
|
|
166
|
+
copyAnswer: "\u590D\u5236\u56DE\u7B54",
|
|
167
|
+
copyFailed: "\u590D\u5236\u5931\u8D25",
|
|
168
|
+
groundedIn: "\u8FD9\u4E2A\u56DE\u7B54\u7684\u4F9D\u636E",
|
|
169
|
+
sourceCountOne: "1 \u4E2A\u6765\u6E90",
|
|
170
|
+
sourceCountMany: "{count} \u4E2A\u6765\u6E90",
|
|
171
|
+
sourceKindConcept: "\u6982\u5FF5",
|
|
172
|
+
sourceKindDocs: "\u6587\u6863",
|
|
173
|
+
sourceKindPricing: "\u4EF7\u683C",
|
|
174
|
+
sourceKindUseCase: "\u5E94\u7528\u573A\u666F",
|
|
175
|
+
sourceKindPage: "\u4EA7\u54C1\u9875\u9762",
|
|
148
176
|
seoTitle: "\u63CF\u8FF0\u95EE\u9898\uFF0C\u83B7\u5F97\u7B54\u6848",
|
|
149
177
|
seoDescription: "\u7528\u4F60\u81EA\u5DF1\u7684\u8BDD\u63CF\u8FF0\u9047\u5230\u7684\u95EE\u9898\uFF0C\u5373\u53EF\u83B7\u5F97\u6765\u81EA\u6211\u4EEC\u4EA7\u54C1\u6587\u6863\u7684\u56DE\u7B54\uFF0C\u5E76\u9644\u4E0A\u7B54\u6848\u51FA\u5904\u7684\u9875\u9762\u94FE\u63A5\u3002",
|
|
150
178
|
seoDescriptionProduct: "\u7528\u4F60\u81EA\u5DF1\u7684\u8BDD\u63CF\u8FF0\u9047\u5230\u7684\u95EE\u9898\uFF0C\u5373\u53EF\u83B7\u5F97\u6765\u81EA {product} \u53CA\u6211\u4EEC\u5176\u4ED6\u4EA7\u54C1\u6587\u6863\u7684\u56DE\u7B54\uFF0C\u5E76\u9644\u4E0A\u7B54\u6848\u51FA\u5904\u7684\u9875\u9762\u94FE\u63A5\u3002",
|
|
@@ -209,6 +237,20 @@ var HI = {
|
|
|
209
237
|
nextSuggestion: "\u0905\u0917\u0932\u093E \u0938\u0941\u091D\u093E\u0935",
|
|
210
238
|
conceptIllustration: "\u0905\u0935\u0927\u093E\u0930\u0923\u093E \u091A\u093F\u0924\u094D\u0930\u0923",
|
|
211
239
|
opensInNewTab: "\u0928\u090F \u091F\u0948\u092C \u092E\u0947\u0902 \u0916\u0941\u0932\u0924\u093E \u0939\u0948",
|
|
240
|
+
conceptStripTitle: "\u092F\u093E \u0915\u093F\u0938\u0940 \u0905\u0935\u0927\u093E\u0930\u0923\u093E \u0938\u0947 \u0936\u0941\u0930\u0942 \u0915\u0930\u0947\u0902",
|
|
241
|
+
conceptStripLabel: "\u091C\u093F\u0928 \u0905\u0935\u0927\u093E\u0930\u0923\u093E\u0913\u0902 \u0915\u0947 \u092C\u093E\u0930\u0947 \u092E\u0947\u0902 \u0906\u092A \u092A\u0942\u091B \u0938\u0915\u0924\u0947 \u0939\u0948\u0902",
|
|
242
|
+
conceptAsk: "{product} \u092E\u0947\u0902 {title} \u0915\u0947 \u092C\u093E\u0930\u0947 \u092E\u0947\u0902 \u092A\u0942\u091B\u0947\u0902",
|
|
243
|
+
conceptAskQuestion: "{product} \u092E\u0947\u0902 {title} \u0915\u0948\u0938\u0947 \u0915\u093E\u092E \u0915\u0930\u0924\u093E \u0939\u0948?",
|
|
244
|
+
copyAnswer: "\u0909\u0924\u094D\u0924\u0930 \u0915\u0949\u092A\u0940 \u0915\u0930\u0947\u0902",
|
|
245
|
+
copyFailed: "\u0915\u0949\u092A\u0940 \u0928\u0939\u0940\u0902 \u0939\u094B \u0938\u0915\u093E",
|
|
246
|
+
groundedIn: "\u092F\u0939 \u0909\u0924\u094D\u0924\u0930 \u0915\u093F\u0938 \u092A\u0930 \u0906\u0927\u093E\u0930\u093F\u0924 \u0939\u0948",
|
|
247
|
+
sourceCountOne: "1 \u0938\u094D\u0930\u094B\u0924",
|
|
248
|
+
sourceCountMany: "{count} \u0938\u094D\u0930\u094B\u0924",
|
|
249
|
+
sourceKindConcept: "\u0905\u0935\u0927\u093E\u0930\u0923\u093E",
|
|
250
|
+
sourceKindDocs: "\u0926\u0938\u094D\u0924\u093E\u0935\u0947\u091C\u093C",
|
|
251
|
+
sourceKindPricing: "\u092E\u0942\u0932\u094D\u092F",
|
|
252
|
+
sourceKindUseCase: "\u0909\u092A\u092F\u094B\u0917 \u0915\u093E \u0909\u0926\u093E\u0939\u0930\u0923",
|
|
253
|
+
sourceKindPage: "\u0909\u0924\u094D\u092A\u093E\u0926 \u092A\u0947\u091C",
|
|
212
254
|
seoTitle: "\u0938\u092E\u0938\u094D\u092F\u093E \u092C\u0924\u093E\u090F\u0902, \u091C\u0935\u093E\u092C \u092A\u093E\u090F\u0902",
|
|
213
255
|
seoDescription: "\u0905\u092A\u0928\u0940 \u0938\u092E\u0938\u094D\u092F\u093E \u0905\u092A\u0928\u0947 \u0936\u092C\u094D\u0926\u094B\u0902 \u092E\u0947\u0902 \u092C\u0924\u093E\u090F\u0902 \u0914\u0930 \u0939\u092E\u093E\u0930\u0947 \u0909\u0924\u094D\u092A\u093E\u0926 \u0926\u0938\u094D\u0924\u093E\u0935\u0947\u091C\u093C\u094B\u0902 \u0938\u0947 \u0932\u093F\u092F\u093E \u0917\u092F\u093E \u091C\u0935\u093E\u092C \u092A\u093E\u090F\u0902, \u0938\u093E\u0925 \u092E\u0947\u0902 \u0909\u0928\u094D\u0939\u0940\u0902 \u092A\u0928\u094D\u0928\u094B\u0902 \u0915\u0947 \u0932\u093F\u0902\u0915 \u091C\u0939\u093E\u0901 \u0938\u0947 \u0935\u0939 \u0906\u092F\u093E \u0939\u0948\u0964",
|
|
214
256
|
seoDescriptionProduct: "\u0905\u092A\u0928\u0940 \u0938\u092E\u0938\u094D\u092F\u093E \u0905\u092A\u0928\u0947 \u0936\u092C\u094D\u0926\u094B\u0902 \u092E\u0947\u0902 \u092C\u0924\u093E\u090F\u0902 \u0914\u0930 {product} \u0924\u0925\u093E \u0939\u092E\u093E\u0930\u0947 \u092C\u093E\u0915\u0940 \u0909\u0924\u094D\u092A\u093E\u0926\u094B\u0902 \u0915\u0947 \u0926\u0938\u094D\u0924\u093E\u0935\u0947\u091C\u093C\u094B\u0902 \u0938\u0947 \u0932\u093F\u092F\u093E \u0917\u092F\u093E \u091C\u0935\u093E\u092C \u092A\u093E\u090F\u0902, \u0938\u093E\u0925 \u092E\u0947\u0902 \u0909\u0928\u094D\u0939\u0940\u0902 \u092A\u0928\u094D\u0928\u094B\u0902 \u0915\u0947 \u0932\u093F\u0902\u0915 \u091C\u0939\u093E\u0901 \u0938\u0947 \u0935\u0939 \u0906\u092F\u093E \u0939\u0948\u0964",
|
|
@@ -277,6 +319,20 @@ var ES = {
|
|
|
277
319
|
nextSuggestion: "Sugerencia siguiente",
|
|
278
320
|
conceptIllustration: "Ilustraci\xF3n del concepto",
|
|
279
321
|
opensInNewTab: "se abre en una pesta\xF1a nueva",
|
|
322
|
+
conceptStripTitle: "O empieza por un concepto",
|
|
323
|
+
conceptStripLabel: "Conceptos sobre los que puedes preguntar",
|
|
324
|
+
conceptAsk: "Preguntar por {title} en {product}",
|
|
325
|
+
conceptAskQuestion: "\xBFC\xF3mo funciona {title} en {product}?",
|
|
326
|
+
copyAnswer: "Copiar respuesta",
|
|
327
|
+
copyFailed: "No se pudo copiar",
|
|
328
|
+
groundedIn: "En qu\xE9 se basa esta respuesta",
|
|
329
|
+
sourceCountOne: "1 fuente",
|
|
330
|
+
sourceCountMany: "{count} fuentes",
|
|
331
|
+
sourceKindConcept: "Concepto",
|
|
332
|
+
sourceKindDocs: "Documentaci\xF3n",
|
|
333
|
+
sourceKindPricing: "Precios",
|
|
334
|
+
sourceKindUseCase: "Caso de uso",
|
|
335
|
+
sourceKindPage: "P\xE1gina de producto",
|
|
280
336
|
seoTitle: "Describe un problema y obt\xE9n una respuesta",
|
|
281
337
|
seoDescription: "Describe con tus palabras el problema que tienes y recibe una respuesta extra\xEDda de la documentaci\xF3n de nuestros productos, con enlaces a las p\xE1ginas exactas de las que procede.",
|
|
282
338
|
seoDescriptionProduct: "Describe con tus palabras el problema que tienes y recibe una respuesta extra\xEDda de la documentaci\xF3n de {product} y del resto de nuestros productos, con enlaces a las p\xE1ginas exactas de las que procede.",
|
|
@@ -345,6 +401,20 @@ var AR = {
|
|
|
345
401
|
nextSuggestion: "\u0627\u0644\u0627\u0642\u062A\u0631\u0627\u062D \u0627\u0644\u062A\u0627\u0644\u064A",
|
|
346
402
|
conceptIllustration: "\u0631\u0633\u0645 \u062A\u0648\u0636\u064A\u062D\u064A \u0644\u0644\u0645\u0641\u0647\u0648\u0645",
|
|
347
403
|
opensInNewTab: "\u064A\u064F\u0641\u062A\u062D \u0641\u064A \u0639\u0644\u0627\u0645\u0629 \u062A\u0628\u0648\u064A\u0628 \u062C\u062F\u064A\u062F\u0629",
|
|
404
|
+
conceptStripTitle: "\u0623\u0648 \u0627\u0628\u062F\u0623 \u0645\u0646 \u0645\u0641\u0647\u0648\u0645",
|
|
405
|
+
conceptStripLabel: "\u0645\u0641\u0627\u0647\u064A\u0645 \u064A\u0645\u0643\u0646\u0643 \u0627\u0644\u0633\u0624\u0627\u0644 \u0639\u0646\u0647\u0627",
|
|
406
|
+
conceptAsk: "\u0627\u0633\u0623\u0644 \u0639\u0646 {title} \u0641\u064A {product}",
|
|
407
|
+
conceptAskQuestion: "\u0643\u064A\u0641 \u064A\u0639\u0645\u0644 {title} \u0641\u064A {product}\u061F",
|
|
408
|
+
copyAnswer: "\u0646\u0633\u062E \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
409
|
+
copyFailed: "\u062A\u0639\u0630\u0651\u0631 \u0627\u0644\u0646\u0633\u062E",
|
|
410
|
+
groundedIn: "\u0639\u0644\u0649 \u0645\u0627\u0630\u0627 \u062A\u0633\u062A\u0646\u062F \u0647\u0630\u0647 \u0627\u0644\u0625\u062C\u0627\u0628\u0629",
|
|
411
|
+
sourceCountOne: "\u0645\u0635\u062F\u0631 \u0648\u0627\u062D\u062F",
|
|
412
|
+
sourceCountMany: "{count} \u0645\u0635\u0627\u062F\u0631",
|
|
413
|
+
sourceKindConcept: "\u0645\u0641\u0647\u0648\u0645",
|
|
414
|
+
sourceKindDocs: "\u0627\u0644\u062A\u0648\u062B\u064A\u0642",
|
|
415
|
+
sourceKindPricing: "\u0627\u0644\u0623\u0633\u0639\u0627\u0631",
|
|
416
|
+
sourceKindUseCase: "\u062D\u0627\u0644\u0629 \u0627\u0633\u062A\u062E\u062F\u0627\u0645",
|
|
417
|
+
sourceKindPage: "\u0635\u0641\u062D\u0629 \u0627\u0644\u0645\u0646\u062A\u062C",
|
|
348
418
|
seoTitle: "\u0635\u0641 \u0645\u0634\u0643\u0644\u062A\u0643 \u0648\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0625\u062C\u0627\u0628\u0629",
|
|
349
419
|
seoDescription: "\u0635\u0641 \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0627\u0644\u062A\u064A \u062A\u0648\u0627\u062C\u0647\u0647\u0627 \u0628\u0643\u0644\u0645\u0627\u062A\u0643 \u0648\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0625\u062C\u0627\u0628\u0629 \u0645\u0633\u062A\u0645\u062F\u0629 \u0645\u0646 \u0648\u062B\u0627\u0626\u0642 \u0645\u0646\u062A\u062C\u0627\u062A\u0646\u0627\u060C \u0645\u0639 \u0631\u0648\u0627\u0628\u0637 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0627\u062A \u0627\u0644\u062A\u064A \u062C\u0627\u0621\u062A \u0645\u0646\u0647\u0627.",
|
|
350
420
|
seoDescriptionProduct: "\u0635\u0641 \u0627\u0644\u0645\u0634\u0643\u0644\u0629 \u0627\u0644\u062A\u064A \u062A\u0648\u0627\u062C\u0647\u0647\u0627 \u0628\u0643\u0644\u0645\u0627\u062A\u0643 \u0648\u0627\u062D\u0635\u0644 \u0639\u0644\u0649 \u0625\u062C\u0627\u0628\u0629 \u0645\u0633\u062A\u0645\u062F\u0629 \u0645\u0646 \u0648\u062B\u0627\u0626\u0642 {product} \u0648\u0628\u0642\u064A\u0629 \u0645\u0646\u062A\u062C\u0627\u062A\u0646\u0627\u060C \u0645\u0639 \u0631\u0648\u0627\u0628\u0637 \u0625\u0644\u0649 \u0627\u0644\u0635\u0641\u062D\u0627\u062A \u0627\u0644\u062A\u064A \u062C\u0627\u0621\u062A \u0645\u0646\u0647\u0627.",
|
|
@@ -413,6 +483,20 @@ var TA = {
|
|
|
413
483
|
nextSuggestion: "\u0B85\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4 \u0BAA\u0BB0\u0BBF\u0BA8\u0BCD\u0BA4\u0BC1\u0BB0\u0BC8",
|
|
414
484
|
conceptIllustration: "\u0B95\u0BB0\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1 \u0BB5\u0BBF\u0BB3\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BAE\u0BCD",
|
|
415
485
|
opensInNewTab: "\u0BAA\u0BC1\u0BA4\u0BBF\u0BAF \u0BA4\u0BBE\u0BB5\u0BB2\u0BBF\u0BB2\u0BCD \u0BA4\u0BBF\u0BB1\u0B95\u0BCD\u0B95\u0BC1\u0BAE\u0BCD",
|
|
486
|
+
conceptStripTitle: "\u0B85\u0BB2\u0BCD\u0BB2\u0BA4\u0BC1 \u0B92\u0BB0\u0BC1 \u0B95\u0BB0\u0BC1\u0BA4\u0BCD\u0BA4\u0BBF\u0BB2\u0BBF\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4\u0BC1 \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
487
|
+
conceptStripLabel: "\u0BA8\u0BC0\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B95\u0BC7\u0B9F\u0BCD\u0B95\u0B95\u0BCD\u0B95\u0BC2\u0B9F\u0BBF\u0BAF \u0B95\u0BB0\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BB3\u0BCD",
|
|
488
|
+
conceptAsk: "{product} \u0B87\u0BB2\u0BCD {title} \u0BAA\u0BB1\u0BCD\u0BB1\u0BBF\u0B95\u0BCD \u0B95\u0BC7\u0BB3\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
489
|
+
conceptAskQuestion: "{product} \u0B87\u0BB2\u0BCD {title} \u0B8E\u0BAA\u0BCD\u0BAA\u0B9F\u0BBF \u0BB5\u0BC7\u0BB2\u0BC8 \u0B9A\u0BC6\u0BAF\u0BCD\u0B95\u0BBF\u0BB1\u0BA4\u0BC1?",
|
|
490
|
+
copyAnswer: "\u0BAA\u0BA4\u0BBF\u0BB2\u0BC8 \u0BA8\u0B95\u0BB2\u0BC6\u0B9F\u0BC1",
|
|
491
|
+
copyFailed: "\u0BA8\u0B95\u0BB2\u0BC6\u0B9F\u0BC1\u0B95\u0BCD\u0B95 \u0BAE\u0BC1\u0B9F\u0BBF\u0BAF\u0BB5\u0BBF\u0BB2\u0BCD\u0BB2\u0BC8",
|
|
492
|
+
groundedIn: "\u0B87\u0BA8\u0BCD\u0BA4\u0BAA\u0BCD \u0BAA\u0BA4\u0BBF\u0BB2\u0BCD \u0B8E\u0BA4\u0BC8 \u0B85\u0B9F\u0BBF\u0BAA\u0BCD\u0BAA\u0B9F\u0BC8\u0BAF\u0BBE\u0B95\u0B95\u0BCD \u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BA4\u0BC1",
|
|
493
|
+
sourceCountOne: "1 \u0BAE\u0BC2\u0BB2\u0BAE\u0BCD",
|
|
494
|
+
sourceCountMany: "{count} \u0BAE\u0BC2\u0BB2\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
495
|
+
sourceKindConcept: "\u0B95\u0BB0\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1",
|
|
496
|
+
sourceKindDocs: "\u0B86\u0BB5\u0BA3\u0BAE\u0BCD",
|
|
497
|
+
sourceKindPricing: "\u0BB5\u0BBF\u0BB2\u0BC8",
|
|
498
|
+
sourceKindUseCase: "\u0BAA\u0BAF\u0BA9\u0BCD\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1 \u0BA8\u0BBF\u0BB2\u0BC8",
|
|
499
|
+
sourceKindPage: "\u0BA4\u0BAF\u0BBE\u0BB0\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1\u0BAA\u0BCD \u0BAA\u0B95\u0BCD\u0B95\u0BAE\u0BCD",
|
|
416
500
|
seoTitle: "\u0B9A\u0BBF\u0B95\u0BCD\u0B95\u0BB2\u0BC8 \u0BB5\u0BBF\u0BB5\u0BB0\u0BBF\u0BAF\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD, \u0BAA\u0BA4\u0BBF\u0BB2\u0BCD \u0BAA\u0BC6\u0BB1\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
|
|
417
501
|
seoDescription: "\u0BA8\u0BC0\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0B95\u0BCA\u0BB3\u0BCD\u0BB3\u0BC1\u0BAE\u0BCD \u0B9A\u0BBF\u0B95\u0BCD\u0B95\u0BB2\u0BC8 \u0B89\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B9A\u0BCA\u0BA8\u0BCD\u0BA4 \u0BB5\u0BBE\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC8\u0B95\u0BB3\u0BBF\u0BB2\u0BCD \u0BB5\u0BBF\u0BB5\u0BB0\u0BBF\u0BAF\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD; \u0B8E\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0BA4\u0BAF\u0BBE\u0BB0\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1 \u0B86\u0BB5\u0BA3\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BBF\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4\u0BC1 \u0BAA\u0BA4\u0BBF\u0BB2\u0BCD \u0B95\u0BBF\u0B9F\u0BC8\u0B95\u0BCD\u0B95\u0BC1\u0BAE\u0BCD, \u0B85\u0BA4\u0BC1 \u0BB5\u0BA8\u0BCD\u0BA4 \u0BAA\u0B95\u0BCD\u0B95\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BBE\u0BA9 \u0B87\u0BA3\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC1\u0B9F\u0BA9\u0BCD.",
|
|
418
502
|
seoDescriptionProduct: "{product} \u0BAE\u0BB1\u0BCD\u0BB1\u0BC1\u0BAE\u0BCD \u0B8E\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0BAA\u0BBF\u0BB1 \u0BA4\u0BAF\u0BBE\u0BB0\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BBF\u0BA9\u0BCD \u0B86\u0BB5\u0BA3\u0B99\u0BCD\u0B95\u0BB3\u0BBF\u0BB2\u0BBF\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4\u0BC1 \u0BAA\u0BA4\u0BBF\u0BB2\u0BCD \u0BAA\u0BC6\u0BB1, \u0BA8\u0BC0\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0B95\u0BCA\u0BB3\u0BCD\u0BB3\u0BC1\u0BAE\u0BCD \u0B9A\u0BBF\u0B95\u0BCD\u0B95\u0BB2\u0BC8 \u0B89\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0B9A\u0BCA\u0BA8\u0BCD\u0BA4 \u0BB5\u0BBE\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC8\u0B95\u0BB3\u0BBF\u0BB2\u0BCD \u0BB5\u0BBF\u0BB5\u0BB0\u0BBF\u0BAF\u0BC1\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u2014 \u0B85\u0BA4\u0BC1 \u0BB5\u0BA8\u0BCD\u0BA4 \u0BAA\u0B95\u0BCD\u0B95\u0B99\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BBE\u0BA9 \u0B87\u0BA3\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC1\u0B9F\u0BA9\u0BCD.",
|
|
@@ -514,11 +598,9 @@ var EXPLORE_OWN_MESSAGE_FIELDS = (
|
|
|
514
598
|
}
|
|
515
599
|
`
|
|
516
600
|
);
|
|
517
|
-
var
|
|
601
|
+
var EXPLORE_CATALOG_ESTABLISHED_FIELDS = (
|
|
518
602
|
/* GraphQL */
|
|
519
603
|
`
|
|
520
|
-
query ExploreCatalog($productSlug: String) {
|
|
521
|
-
exploreCatalog(productSlug: $productSlug) {
|
|
522
604
|
enabled
|
|
523
605
|
products {
|
|
524
606
|
slug
|
|
@@ -536,11 +618,35 @@ var EXPLORE_CATALOG_QUERY = (
|
|
|
536
618
|
historyTurns
|
|
537
619
|
}
|
|
538
620
|
captchaRequired
|
|
539
|
-
recaptchaSiteKey
|
|
621
|
+
recaptchaSiteKey`
|
|
622
|
+
);
|
|
623
|
+
var EXPLORE_CATALOG_HIGHLIGHT_FIELD = (
|
|
624
|
+
/* GraphQL */
|
|
625
|
+
`
|
|
626
|
+
conceptHighlights {
|
|
627
|
+
product
|
|
628
|
+
productName
|
|
629
|
+
title
|
|
630
|
+
url
|
|
631
|
+
imageUrl
|
|
632
|
+
alt
|
|
633
|
+
}`
|
|
634
|
+
);
|
|
635
|
+
function exploreCatalogDocument(extraFields) {
|
|
636
|
+
return (
|
|
637
|
+
/* GraphQL */
|
|
638
|
+
`
|
|
639
|
+
query ExploreCatalog($productSlug: String) {
|
|
640
|
+
exploreCatalog(productSlug: $productSlug) {${EXPLORE_CATALOG_ESTABLISHED_FIELDS}${extraFields}
|
|
540
641
|
}
|
|
541
642
|
}
|
|
542
643
|
`
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
var EXPLORE_CATALOG_QUERY = exploreCatalogDocument(
|
|
647
|
+
EXPLORE_CATALOG_HIGHLIGHT_FIELD
|
|
543
648
|
);
|
|
649
|
+
var EXPLORE_CATALOG_QUERY_WITHOUT_HIGHLIGHTS = exploreCatalogDocument("");
|
|
544
650
|
var EXPLORE_MESSAGE_QUERY = (
|
|
545
651
|
/* GraphQL */
|
|
546
652
|
`
|
|
@@ -1343,7 +1449,12 @@ function buildFallbackCatalog(examplePrompts, welcome) {
|
|
|
1343
1449
|
welcomeBody: welcome?.body ?? FALLBACK_WELCOME_BODY,
|
|
1344
1450
|
limits: FALLBACK_EXPLORE_LIMITS,
|
|
1345
1451
|
captchaRequired: false,
|
|
1346
|
-
recaptchaSiteKey: null
|
|
1452
|
+
recaptchaSiteKey: null,
|
|
1453
|
+
// Empty, and deliberately not synthesised from `ECOSYSTEM_PRODUCTS`: a concept highlight
|
|
1454
|
+
// needs a real published illustration URL, and this SDK has no registry of them. An
|
|
1455
|
+
// invented path would render 38 broken frames on the one screen every prerender captures.
|
|
1456
|
+
// The strip renders nothing at all when the list is empty, which is the honest fallback.
|
|
1457
|
+
conceptHighlights: []
|
|
1347
1458
|
};
|
|
1348
1459
|
}
|
|
1349
1460
|
function normalizeCatalog(raw, fallback) {
|
|
@@ -1360,9 +1471,27 @@ function normalizeCatalog(raw, fallback) {
|
|
|
1360
1471
|
historyTurns: raw.limits?.historyTurns || fallback.limits.historyTurns
|
|
1361
1472
|
},
|
|
1362
1473
|
captchaRequired: raw.captchaRequired === true,
|
|
1363
|
-
recaptchaSiteKey: raw.recaptchaSiteKey ?? null
|
|
1474
|
+
recaptchaSiteKey: raw.recaptchaSiteKey ?? null,
|
|
1475
|
+
// `[ExploreConceptHighlight!]!` on the wire, so a gateway that KNOWS the field always
|
|
1476
|
+
// sends an array. The one response that arrives without it is the retry against an older
|
|
1477
|
+
// supergraph (`EXPLORE_CATALOG_QUERY_WITHOUT_HIGHLIGHTS`) — that gateway does not answer
|
|
1478
|
+
// the full document at all, it refuses it. Either way
|
|
1479
|
+
// `catalog.conceptHighlights.filter(...)` on `undefined` would throw inside render,
|
|
1480
|
+
// blanking the welcome screen over a decorative strip.
|
|
1481
|
+
conceptHighlights: raw.conceptHighlights?.length ? raw.conceptHighlights : fallback.conceptHighlights
|
|
1364
1482
|
};
|
|
1365
1483
|
}
|
|
1484
|
+
var CATALOG_DOCUMENT_REJECTED_CODES = /* @__PURE__ */ new Set([
|
|
1485
|
+
"GRAPHQL_VALIDATION_FAILED",
|
|
1486
|
+
"HTTP_400"
|
|
1487
|
+
]);
|
|
1488
|
+
function catalogRejectedTheHighlightField(res) {
|
|
1489
|
+
if (res.data?.exploreCatalog) return false;
|
|
1490
|
+
return (res.errors ?? []).some((error) => {
|
|
1491
|
+
const code = error.extensions?.code;
|
|
1492
|
+
return typeof code === "string" && CATALOG_DOCUMENT_REJECTED_CODES.has(code) || error.message.includes("conceptHighlights");
|
|
1493
|
+
});
|
|
1494
|
+
}
|
|
1366
1495
|
var RATE_LIMIT_CODES = /* @__PURE__ */ new Set([
|
|
1367
1496
|
"RATE_LIMITED",
|
|
1368
1497
|
"HTTP_429",
|
|
@@ -1702,11 +1831,19 @@ function useExploreChat(options = {}) {
|
|
|
1702
1831
|
useEffect(() => {
|
|
1703
1832
|
let cancelled = false;
|
|
1704
1833
|
const load = async () => {
|
|
1705
|
-
const
|
|
1834
|
+
const variables = { productSlug: productSlug ?? null };
|
|
1835
|
+
let res = await client.query(
|
|
1706
1836
|
EXPLORE_CATALOG_QUERY,
|
|
1707
|
-
|
|
1837
|
+
variables
|
|
1708
1838
|
);
|
|
1709
1839
|
if (cancelled || !mountedRef.current) return;
|
|
1840
|
+
if (catalogRejectedTheHighlightField(res)) {
|
|
1841
|
+
res = await client.query(
|
|
1842
|
+
EXPLORE_CATALOG_QUERY_WITHOUT_HIGHLIGHTS,
|
|
1843
|
+
variables
|
|
1844
|
+
);
|
|
1845
|
+
if (cancelled || !mountedRef.current) return;
|
|
1846
|
+
}
|
|
1710
1847
|
const raw = res.data?.exploreCatalog;
|
|
1711
1848
|
if (res.errors?.length || !raw) {
|
|
1712
1849
|
console.warn(
|
|
@@ -3001,6 +3138,122 @@ function isInlineImageAllowed(src, origins) {
|
|
|
3001
3138
|
if (url.protocol !== "https:" || url.username || url.password) return false;
|
|
3002
3139
|
return origins.has(url.origin);
|
|
3003
3140
|
}
|
|
3141
|
+
var REFERENCE_KIND_ORDER = [
|
|
3142
|
+
"CONCEPT",
|
|
3143
|
+
"DOCS",
|
|
3144
|
+
"PRICING",
|
|
3145
|
+
"USE_CASE",
|
|
3146
|
+
"PAGE"
|
|
3147
|
+
];
|
|
3148
|
+
var PRODUCT_SUBDOMAINS = [
|
|
3149
|
+
"alphadocs.",
|
|
3150
|
+
"alphaapp.",
|
|
3151
|
+
"docs.",
|
|
3152
|
+
"alpha.",
|
|
3153
|
+
"app.",
|
|
3154
|
+
"www."
|
|
3155
|
+
];
|
|
3156
|
+
function readCatalogUrl(raw) {
|
|
3157
|
+
let parsed;
|
|
3158
|
+
try {
|
|
3159
|
+
parsed = new URL(raw);
|
|
3160
|
+
} catch {
|
|
3161
|
+
return null;
|
|
3162
|
+
}
|
|
3163
|
+
if (parsed.protocol !== "https:") return null;
|
|
3164
|
+
const host = parsed.hostname.toLowerCase();
|
|
3165
|
+
const prefix = PRODUCT_SUBDOMAINS.find(
|
|
3166
|
+
(candidate) => host.startsWith(candidate)
|
|
3167
|
+
);
|
|
3168
|
+
const apex = prefix === void 0 ? host : host.slice(prefix.length);
|
|
3169
|
+
const port = parsed.port ? `:${parsed.port}` : "";
|
|
3170
|
+
return {
|
|
3171
|
+
origin: `https://${apex}${port}`,
|
|
3172
|
+
prefix,
|
|
3173
|
+
pathname: parsed.pathname
|
|
3174
|
+
};
|
|
3175
|
+
}
|
|
3176
|
+
function referenceKindOf(url, origins) {
|
|
3177
|
+
const parsed = readCatalogUrl(url);
|
|
3178
|
+
if (parsed === null || !origins.has(parsed.origin)) return null;
|
|
3179
|
+
if (parsed.prefix === "docs." || parsed.prefix === "alphadocs.")
|
|
3180
|
+
return "DOCS";
|
|
3181
|
+
const segment = parsed.pathname.toLowerCase().split("/").filter(Boolean)[0] ?? "";
|
|
3182
|
+
if (segment === "concept" || segment === "concepts") return "CONCEPT";
|
|
3183
|
+
if (segment === "docs") return "DOCS";
|
|
3184
|
+
if (segment === "pricing" || segment === "plans") return "PRICING";
|
|
3185
|
+
if (segment === "use-case" || segment === "use-cases" || segment === "solutions") {
|
|
3186
|
+
return "USE_CASE";
|
|
3187
|
+
}
|
|
3188
|
+
return "PAGE";
|
|
3189
|
+
}
|
|
3190
|
+
function productNamesByOrigin(products) {
|
|
3191
|
+
const names = /* @__PURE__ */ new Map();
|
|
3192
|
+
for (const product of products) {
|
|
3193
|
+
let url;
|
|
3194
|
+
try {
|
|
3195
|
+
url = new URL(product.website);
|
|
3196
|
+
} catch {
|
|
3197
|
+
continue;
|
|
3198
|
+
}
|
|
3199
|
+
if (url.protocol !== "https:") continue;
|
|
3200
|
+
const apex = url.hostname.replace(/^www\./, "");
|
|
3201
|
+
const port = url.port ? `:${url.port}` : "";
|
|
3202
|
+
const key = `https://${apex}${port}`;
|
|
3203
|
+
if (!names.has(key)) names.set(key, product.name);
|
|
3204
|
+
}
|
|
3205
|
+
return names;
|
|
3206
|
+
}
|
|
3207
|
+
function summariseReferences(references, origins, productNames) {
|
|
3208
|
+
const counts = /* @__PURE__ */ new Map();
|
|
3209
|
+
const products = [];
|
|
3210
|
+
for (const reference of references) {
|
|
3211
|
+
const kind = referenceKindOf(reference.url, origins);
|
|
3212
|
+
if (kind !== null) counts.set(kind, (counts.get(kind) ?? 0) + 1);
|
|
3213
|
+
const parsed = readCatalogUrl(reference.url);
|
|
3214
|
+
const name = (parsed === null ? void 0 : productNames.get(parsed.origin)) ?? (reference.product || null);
|
|
3215
|
+
if (name != null && !products.includes(name)) products.push(name);
|
|
3216
|
+
}
|
|
3217
|
+
return {
|
|
3218
|
+
total: references.length,
|
|
3219
|
+
kinds: REFERENCE_KIND_ORDER.filter((kind) => counts.has(kind)).map(
|
|
3220
|
+
(kind) => ({ kind, count: counts.get(kind) ?? 0 })
|
|
3221
|
+
),
|
|
3222
|
+
products
|
|
3223
|
+
};
|
|
3224
|
+
}
|
|
3225
|
+
var CODE_FENCE = /^\s*(?:```|~~~)/;
|
|
3226
|
+
function answerPlainText(markdown) {
|
|
3227
|
+
const lines = [];
|
|
3228
|
+
let inFence = false;
|
|
3229
|
+
for (const raw of markdown.split("\n")) {
|
|
3230
|
+
if (CODE_FENCE.test(raw)) {
|
|
3231
|
+
inFence = !inFence;
|
|
3232
|
+
continue;
|
|
3233
|
+
}
|
|
3234
|
+
if (inFence) {
|
|
3235
|
+
lines.push(raw);
|
|
3236
|
+
continue;
|
|
3237
|
+
}
|
|
3238
|
+
let line = raw;
|
|
3239
|
+
line = line.replace(/!\[[^\]]*\]\([^)\s]*(?:\s+"[^"]*")?\)/g, "");
|
|
3240
|
+
line = line.replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, "$1 ($2)");
|
|
3241
|
+
line = line.replace(/<(https?:\/\/[^>\s]+)>/g, "$1");
|
|
3242
|
+
line = line.replace(/^\s{0,3}#{1,6}\s+/, "");
|
|
3243
|
+
line = line.replace(/^\s{0,3}>\s?/, "");
|
|
3244
|
+
if (/^\s{0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/.test(line)) {
|
|
3245
|
+
lines.push("");
|
|
3246
|
+
continue;
|
|
3247
|
+
}
|
|
3248
|
+
line = line.replace(/`([^`]+)`/g, "$1");
|
|
3249
|
+
line = line.replace(/\*\*([^*]+)\*\*/g, "$1");
|
|
3250
|
+
line = line.replace(/__([^_]+)__/g, "$1");
|
|
3251
|
+
line = line.replace(/(^|[^*\w])\*([^*\n]+)\*(?![*\w])/g, "$1$2");
|
|
3252
|
+
line = line.replace(/(^|[^_\w])_([^_\n]+)_(?![_\w])/g, "$1$2");
|
|
3253
|
+
lines.push(line.replace(/[ \t]+$/, ""));
|
|
3254
|
+
}
|
|
3255
|
+
return lines.join("\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
3256
|
+
}
|
|
3004
3257
|
var InlineImageScopeContext = createContext(null);
|
|
3005
3258
|
var InsideLinkContext = createContext(false);
|
|
3006
3259
|
function AnswerLink(props) {
|
|
@@ -3398,6 +3651,115 @@ function AnswerFeedback({
|
|
|
3398
3651
|
}
|
|
3399
3652
|
);
|
|
3400
3653
|
}
|
|
3654
|
+
var PROVENANCE_CHIP = "inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted/60 px-2 py-0.5 text-[11px] leading-5 text-muted-foreground";
|
|
3655
|
+
function ProvenanceChips({
|
|
3656
|
+
strings: T,
|
|
3657
|
+
provenance
|
|
3658
|
+
}) {
|
|
3659
|
+
if (provenance.total === 0) return null;
|
|
3660
|
+
const kindLabels = {
|
|
3661
|
+
CONCEPT: T.sourceKindConcept,
|
|
3662
|
+
DOCS: T.sourceKindDocs,
|
|
3663
|
+
PRICING: T.sourceKindPricing,
|
|
3664
|
+
USE_CASE: T.sourceKindUseCase,
|
|
3665
|
+
PAGE: T.sourceKindPage
|
|
3666
|
+
};
|
|
3667
|
+
return /* @__PURE__ */ jsxs(
|
|
3668
|
+
"ul",
|
|
3669
|
+
{
|
|
3670
|
+
"data-boff-explore": "provenance",
|
|
3671
|
+
"aria-label": T.groundedIn,
|
|
3672
|
+
className: "flex flex-wrap items-center gap-1.5",
|
|
3673
|
+
children: [
|
|
3674
|
+
/* @__PURE__ */ jsxs("li", { "data-boff-explore": "provenance-count", className: PROVENANCE_CHIP, children: [
|
|
3675
|
+
/* @__PURE__ */ jsx(BookOpenText, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" }),
|
|
3676
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: provenance.total === 1 ? T.sourceCountOne : fill(T.sourceCountMany, { count: String(provenance.total) }) })
|
|
3677
|
+
] }),
|
|
3678
|
+
provenance.kinds.map(({ kind, count }) => /* @__PURE__ */ jsx(
|
|
3679
|
+
"li",
|
|
3680
|
+
{
|
|
3681
|
+
"data-boff-explore": "provenance-kind",
|
|
3682
|
+
"data-kind": kind,
|
|
3683
|
+
"data-count": count,
|
|
3684
|
+
className: PROVENANCE_CHIP,
|
|
3685
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", children: count > 1 ? `${kindLabels[kind]} \xB7 ${count}` : kindLabels[kind] })
|
|
3686
|
+
},
|
|
3687
|
+
kind
|
|
3688
|
+
)),
|
|
3689
|
+
provenance.products.map((name) => /* @__PURE__ */ jsx(
|
|
3690
|
+
"li",
|
|
3691
|
+
{
|
|
3692
|
+
"data-boff-explore": "provenance-product",
|
|
3693
|
+
className: PROVENANCE_CHIP,
|
|
3694
|
+
children: /* @__PURE__ */ jsx("span", { className: "truncate", children: name })
|
|
3695
|
+
},
|
|
3696
|
+
name
|
|
3697
|
+
))
|
|
3698
|
+
]
|
|
3699
|
+
}
|
|
3700
|
+
);
|
|
3701
|
+
}
|
|
3702
|
+
var COPY_FEEDBACK_MS = 2500;
|
|
3703
|
+
function AnswerActions({
|
|
3704
|
+
strings: T,
|
|
3705
|
+
text
|
|
3706
|
+
}) {
|
|
3707
|
+
const [outcome, setOutcome] = useState("idle");
|
|
3708
|
+
const resetRef = useRef(null);
|
|
3709
|
+
useEffect(
|
|
3710
|
+
() => () => {
|
|
3711
|
+
if (resetRef.current !== null) clearTimeout(resetRef.current);
|
|
3712
|
+
},
|
|
3713
|
+
[]
|
|
3714
|
+
);
|
|
3715
|
+
const copy = useCallback(async () => {
|
|
3716
|
+
let copied = false;
|
|
3717
|
+
try {
|
|
3718
|
+
const clipboard = typeof navigator === "undefined" ? void 0 : navigator.clipboard;
|
|
3719
|
+
if (typeof clipboard?.writeText === "function") {
|
|
3720
|
+
await clipboard.writeText(text);
|
|
3721
|
+
copied = true;
|
|
3722
|
+
}
|
|
3723
|
+
} catch {
|
|
3724
|
+
copied = false;
|
|
3725
|
+
}
|
|
3726
|
+
setOutcome(copied ? "copied" : "failed");
|
|
3727
|
+
if (resetRef.current !== null) clearTimeout(resetRef.current);
|
|
3728
|
+
resetRef.current = setTimeout(() => setOutcome("idle"), COPY_FEEDBACK_MS);
|
|
3729
|
+
}, [text]);
|
|
3730
|
+
const label = outcome === "copied" ? T.copied : outcome === "failed" ? T.copyFailed : T.copyAnswer;
|
|
3731
|
+
return /* @__PURE__ */ jsxs(
|
|
3732
|
+
"div",
|
|
3733
|
+
{
|
|
3734
|
+
"data-boff-explore": "answer-actions",
|
|
3735
|
+
className: "flex flex-wrap items-center gap-2 pt-0.5",
|
|
3736
|
+
children: [
|
|
3737
|
+
/* @__PURE__ */ jsxs(
|
|
3738
|
+
"button",
|
|
3739
|
+
{
|
|
3740
|
+
"data-boff-explore": "copy-answer",
|
|
3741
|
+
"data-outcome": outcome,
|
|
3742
|
+
type: "button",
|
|
3743
|
+
title: label,
|
|
3744
|
+
onClick: () => {
|
|
3745
|
+
void copy();
|
|
3746
|
+
},
|
|
3747
|
+
className: cn(
|
|
3748
|
+
"inline-flex max-w-full items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs transition-colors",
|
|
3749
|
+
"focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
3750
|
+
outcome === "failed" ? "border-destructive/40 bg-card text-destructive" : "border-border bg-card text-muted-foreground hover:border-primary/40 hover:bg-accent hover:text-foreground"
|
|
3751
|
+
),
|
|
3752
|
+
children: [
|
|
3753
|
+
outcome === "copied" ? /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(Copy, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" }),
|
|
3754
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: label })
|
|
3755
|
+
]
|
|
3756
|
+
}
|
|
3757
|
+
),
|
|
3758
|
+
/* @__PURE__ */ jsx("span", { "data-boff-explore": "copy-status", role: "status", className: "sr-only", children: outcome === "idle" ? "" : label })
|
|
3759
|
+
]
|
|
3760
|
+
}
|
|
3761
|
+
);
|
|
3762
|
+
}
|
|
3401
3763
|
function UserBubble({
|
|
3402
3764
|
strings: T,
|
|
3403
3765
|
message
|
|
@@ -3443,6 +3805,7 @@ function AssistantBubble({
|
|
|
3443
3805
|
message,
|
|
3444
3806
|
activity,
|
|
3445
3807
|
imageOrigins,
|
|
3808
|
+
productNames,
|
|
3446
3809
|
onNavigate,
|
|
3447
3810
|
anchorRef,
|
|
3448
3811
|
onFollow,
|
|
@@ -3471,6 +3834,15 @@ function AssistantBubble({
|
|
|
3471
3834
|
}),
|
|
3472
3835
|
[T, completed, imageOrigins, failedImages, markImageFailed]
|
|
3473
3836
|
);
|
|
3837
|
+
const provenance = useMemo(
|
|
3838
|
+
() => summariseReferences(message.references, imageOrigins, productNames),
|
|
3839
|
+
[message.references, imageOrigins, productNames]
|
|
3840
|
+
);
|
|
3841
|
+
const copyText = useMemo(
|
|
3842
|
+
() => answerPlainText(message.content),
|
|
3843
|
+
[message.content]
|
|
3844
|
+
);
|
|
3845
|
+
const grounded = completed && message.answered !== false;
|
|
3474
3846
|
return /* @__PURE__ */ jsxs(
|
|
3475
3847
|
"div",
|
|
3476
3848
|
{
|
|
@@ -3520,6 +3892,7 @@ function AssistantBubble({
|
|
|
3520
3892
|
/* @__PURE__ */ jsx("div", { className: "boff-prose boff-prose-sm boff-explore-body min-w-0 text-card-foreground", children: /* @__PURE__ */ jsx(InlineImageScopeContext.Provider, { value: imageScope, children: /* @__PURE__ */ jsx(Markdown, { components: ANSWER_MARKDOWN_COMPONENTS, children: body }) }) }),
|
|
3521
3893
|
streaming ? /* @__PURE__ */ jsx("span", { className: "boff-explore-caret", "aria-hidden": "true" }) : null
|
|
3522
3894
|
] }) : null,
|
|
3895
|
+
grounded && provenance.total > 0 ? /* @__PURE__ */ jsx(ProvenanceChips, { strings: T, provenance }) : null,
|
|
3523
3896
|
streaming ? /* @__PURE__ */ jsx(ThinkingIndicator, { activity }) : null,
|
|
3524
3897
|
failed && !body ? /* @__PURE__ */ jsx("div", { className: "rounded-2xl rounded-tl-md border border-border bg-muted px-4 py-3 text-sm text-muted-foreground", children: T.answerDidNotArrive }) : null,
|
|
3525
3898
|
message.references.length > 0 ? /* @__PURE__ */ jsxs("div", { children: [
|
|
@@ -3559,6 +3932,7 @@ function AssistantBubble({
|
|
|
3559
3932
|
question
|
|
3560
3933
|
)) })
|
|
3561
3934
|
] }) : null,
|
|
3935
|
+
completed && copyText !== "" ? /* @__PURE__ */ jsx(AnswerActions, { strings: T, text: copyText }) : null,
|
|
3562
3936
|
completed && onFeedback ? /* @__PURE__ */ jsx(
|
|
3563
3937
|
AnswerFeedback,
|
|
3564
3938
|
{
|
|
@@ -3771,6 +4145,96 @@ function ProductStrip({
|
|
|
3771
4145
|
}
|
|
3772
4146
|
);
|
|
3773
4147
|
}
|
|
4148
|
+
var MAX_CONCEPT_CARDS = 6;
|
|
4149
|
+
function ConceptStrip({
|
|
4150
|
+
strings: T,
|
|
4151
|
+
highlights,
|
|
4152
|
+
onAsk,
|
|
4153
|
+
disabled
|
|
4154
|
+
}) {
|
|
4155
|
+
const [failed, setFailed] = useState(() => /* @__PURE__ */ new Set());
|
|
4156
|
+
const markFailed = useCallback((src) => {
|
|
4157
|
+
setFailed(
|
|
4158
|
+
(current) => current.has(src) ? current : new Set(current).add(src)
|
|
4159
|
+
);
|
|
4160
|
+
}, []);
|
|
4161
|
+
const visible = highlights.filter(
|
|
4162
|
+
(highlight) => highlight.imageUrl !== "" && !failed.has(highlight.imageUrl)
|
|
4163
|
+
).slice(0, MAX_CONCEPT_CARDS);
|
|
4164
|
+
if (visible.length === 0) return null;
|
|
4165
|
+
return /* @__PURE__ */ jsxs(
|
|
4166
|
+
"div",
|
|
4167
|
+
{
|
|
4168
|
+
"data-boff-explore": "concept-strip-block",
|
|
4169
|
+
className: "boff-explore-rise boff-explore-rise-3 mt-6",
|
|
4170
|
+
children: [
|
|
4171
|
+
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: T.conceptStripTitle }),
|
|
4172
|
+
/* @__PURE__ */ jsx(
|
|
4173
|
+
"ul",
|
|
4174
|
+
{
|
|
4175
|
+
"data-boff-explore": "concept-strip",
|
|
4176
|
+
"aria-label": T.conceptStripLabel,
|
|
4177
|
+
className: "boff-explore-strip flex min-w-0 snap-x gap-3 overflow-x-auto pb-1",
|
|
4178
|
+
children: visible.map((highlight) => /* @__PURE__ */ jsx(
|
|
4179
|
+
"li",
|
|
4180
|
+
{
|
|
4181
|
+
className: "shrink-0 snap-start",
|
|
4182
|
+
children: /* @__PURE__ */ jsxs(
|
|
4183
|
+
"button",
|
|
4184
|
+
{
|
|
4185
|
+
"data-boff-explore": "concept-card",
|
|
4186
|
+
"data-product": highlight.product,
|
|
4187
|
+
type: "button",
|
|
4188
|
+
disabled,
|
|
4189
|
+
"aria-label": fill(T.conceptAsk, {
|
|
4190
|
+
title: highlight.title,
|
|
4191
|
+
product: highlight.productName
|
|
4192
|
+
}),
|
|
4193
|
+
onClick: () => onAsk(
|
|
4194
|
+
fill(T.conceptAskQuestion, {
|
|
4195
|
+
title: highlight.title,
|
|
4196
|
+
product: highlight.productName
|
|
4197
|
+
})
|
|
4198
|
+
),
|
|
4199
|
+
className: "group flex w-40 flex-col overflow-hidden rounded-xl border border-border bg-card text-left shadow-sm transition-colors hover:border-primary/50 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring sm:w-48",
|
|
4200
|
+
children: [
|
|
4201
|
+
/* @__PURE__ */ jsxs("span", { className: "relative block aspect-[16/9] w-full overflow-hidden bg-muted", children: [
|
|
4202
|
+
/* @__PURE__ */ jsx(
|
|
4203
|
+
"img",
|
|
4204
|
+
{
|
|
4205
|
+
src: highlight.imageUrl,
|
|
4206
|
+
alt: highlight.alt,
|
|
4207
|
+
loading: "lazy",
|
|
4208
|
+
decoding: "async",
|
|
4209
|
+
onError: () => markFailed(highlight.imageUrl),
|
|
4210
|
+
className: "h-full w-full object-cover transition-transform duration-300 group-hover:scale-105"
|
|
4211
|
+
}
|
|
4212
|
+
),
|
|
4213
|
+
/* @__PURE__ */ jsx(
|
|
4214
|
+
"span",
|
|
4215
|
+
{
|
|
4216
|
+
"aria-hidden": "true",
|
|
4217
|
+
className: "pointer-events-none absolute left-1.5 top-1.5 rounded-full border border-border bg-background/90 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-foreground",
|
|
4218
|
+
children: T.conceptIllustration
|
|
4219
|
+
}
|
|
4220
|
+
)
|
|
4221
|
+
] }),
|
|
4222
|
+
/* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col gap-0.5 p-2.5", children: [
|
|
4223
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-2 text-xs font-semibold leading-snug text-card-foreground", children: highlight.title }),
|
|
4224
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-[11px] text-muted-foreground", children: highlight.productName })
|
|
4225
|
+
] })
|
|
4226
|
+
]
|
|
4227
|
+
}
|
|
4228
|
+
)
|
|
4229
|
+
},
|
|
4230
|
+
`${highlight.product}:${highlight.url}`
|
|
4231
|
+
))
|
|
4232
|
+
}
|
|
4233
|
+
)
|
|
4234
|
+
]
|
|
4235
|
+
}
|
|
4236
|
+
);
|
|
4237
|
+
}
|
|
3774
4238
|
function DisclaimerDialog({
|
|
3775
4239
|
open,
|
|
3776
4240
|
onClose,
|
|
@@ -3877,6 +4341,7 @@ function WelcomeState({
|
|
|
3877
4341
|
body,
|
|
3878
4342
|
prompts,
|
|
3879
4343
|
products,
|
|
4344
|
+
conceptHighlights,
|
|
3880
4345
|
focusProduct,
|
|
3881
4346
|
onPrompt,
|
|
3882
4347
|
onFocus,
|
|
@@ -3915,6 +4380,15 @@ function WelcomeState({
|
|
|
3915
4380
|
}
|
|
3916
4381
|
)
|
|
3917
4382
|
] }) : null,
|
|
4383
|
+
/* @__PURE__ */ jsx(
|
|
4384
|
+
ConceptStrip,
|
|
4385
|
+
{
|
|
4386
|
+
strings: T,
|
|
4387
|
+
highlights: conceptHighlights,
|
|
4388
|
+
onAsk: onPrompt,
|
|
4389
|
+
disabled
|
|
4390
|
+
}
|
|
4391
|
+
),
|
|
3918
4392
|
products.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "boff-explore-rise boff-explore-rise-3 mt-6", children: [
|
|
3919
4393
|
/* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: T.focusProduct }),
|
|
3920
4394
|
/* @__PURE__ */ jsx(
|
|
@@ -4036,6 +4510,10 @@ function ExplorePage({
|
|
|
4036
4510
|
() => inlineImageOrigins(catalog.products),
|
|
4037
4511
|
[catalog.products]
|
|
4038
4512
|
);
|
|
4513
|
+
const productNames = useMemo(
|
|
4514
|
+
() => productNamesByOrigin(catalog.products),
|
|
4515
|
+
[catalog.products]
|
|
4516
|
+
);
|
|
4039
4517
|
useEffect(() => {
|
|
4040
4518
|
const el = textareaRef.current;
|
|
4041
4519
|
if (!el) return;
|
|
@@ -4567,6 +5045,7 @@ function ExplorePage({
|
|
|
4567
5045
|
body: resolvedBody,
|
|
4568
5046
|
prompts,
|
|
4569
5047
|
products: catalog.products,
|
|
5048
|
+
conceptHighlights: catalog.conceptHighlights,
|
|
4570
5049
|
focusProduct,
|
|
4571
5050
|
onPrompt: sendPrompt,
|
|
4572
5051
|
onFocus: setFocusProduct,
|
|
@@ -4580,6 +5059,7 @@ function ExplorePage({
|
|
|
4580
5059
|
message,
|
|
4581
5060
|
activity,
|
|
4582
5061
|
imageOrigins,
|
|
5062
|
+
productNames,
|
|
4583
5063
|
onNavigate,
|
|
4584
5064
|
anchorRef: message.id === latestAssistantId ? latestAssistantRef : void 0,
|
|
4585
5065
|
onFollow: (kind, url) => recordClick(message.id, kind, url),
|
|
@@ -4882,6 +5362,6 @@ function ExplorePage({
|
|
|
4882
5362
|
);
|
|
4883
5363
|
}
|
|
4884
5364
|
|
|
4885
|
-
export { ExplorePage, inlineImageOrigins, isInlineImageAllowed, logoUrlOf };
|
|
5365
|
+
export { ExplorePage, answerPlainText, inlineImageOrigins, isInlineImageAllowed, logoUrlOf, productNamesByOrigin, referenceKindOf, summariseReferences };
|
|
4886
5366
|
//# sourceMappingURL=explore.mjs.map
|
|
4887
5367
|
//# sourceMappingURL=explore.mjs.map
|