@uptrademedia/site-kit 1.0.40 → 1.0.41
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/{chunk-XXAO5WVO.js → chunk-IRNMIFOE.js} +3 -3
- package/dist/chunk-IRNMIFOE.js.map +1 -0
- package/dist/{chunk-K4B34K4J.mjs → chunk-LHMD7CAR.mjs} +3 -3
- package/dist/chunk-LHMD7CAR.mjs.map +1 -0
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +1 -1
- package/dist/llms/index.d.mts +669 -3
- package/dist/llms/index.d.ts +669 -3
- package/dist/llms/index.js +547 -76
- package/dist/llms/index.js.map +1 -1
- package/dist/llms/index.mjs +526 -2
- package/dist/llms/index.mjs.map +1 -1
- package/dist/sitemap/index.js +2 -2
- package/dist/sitemap/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/api-BoW4FSlW.d.mts +0 -671
- package/dist/api-BoW4FSlW.d.ts +0 -671
- package/dist/chunk-K4B34K4J.mjs.map +0 -1
- package/dist/chunk-SVSZVPP6.mjs +0 -527
- package/dist/chunk-SVSZVPP6.mjs.map +0 -1
- package/dist/chunk-XXAO5WVO.js.map +0 -1
- package/dist/chunk-ZVIOI47K.js +0 -544
- package/dist/chunk-ZVIOI47K.js.map +0 -1
package/dist/llms/index.js
CHANGED
|
@@ -1,110 +1,581 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkXXAO5WVO_js = require('../chunk-XXAO5WVO.js');
|
|
3
|
+
var chunkIRNMIFOE_js = require('../chunk-IRNMIFOE.js');
|
|
5
4
|
require('../chunk-ZSMWDLMK.js');
|
|
5
|
+
var fs = require('fs');
|
|
6
|
+
var path = require('path');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
8
|
|
|
9
|
+
function createLLMsTxtHandler(options = {}) {
|
|
10
|
+
const { preferStatic, ...generateOptions } = options;
|
|
11
|
+
return async function GET() {
|
|
12
|
+
try {
|
|
13
|
+
if (preferStatic) {
|
|
14
|
+
const staticPath = path.join(process.cwd(), "public", "llms.txt");
|
|
15
|
+
if (fs.existsSync(staticPath)) {
|
|
16
|
+
const markdown2 = fs.readFileSync(staticPath, "utf-8");
|
|
17
|
+
return new Response(markdown2, {
|
|
18
|
+
status: 200,
|
|
19
|
+
headers: {
|
|
20
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
21
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const { markdown, metadata } = await chunkIRNMIFOE_js.generateLLMsTxt(generateOptions);
|
|
27
|
+
return new Response(markdown, {
|
|
28
|
+
status: 200,
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
31
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600",
|
|
32
|
+
"X-Generated-At": metadata.generated_at,
|
|
33
|
+
"X-Sections": metadata.sections.join(",")
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error("@uptrade/llms: Error generating llms.txt:", error);
|
|
38
|
+
return new Response("# Error\n\nUnable to generate llms.txt content.", {
|
|
39
|
+
status: 500,
|
|
40
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function createLLMsFullTxtHandler(options = {}) {
|
|
46
|
+
const { preferStatic, ...generateOptions } = options;
|
|
47
|
+
return async function GET() {
|
|
48
|
+
try {
|
|
49
|
+
if (preferStatic) {
|
|
50
|
+
const staticPath = path.join(process.cwd(), "public", "llms-full.txt");
|
|
51
|
+
if (fs.existsSync(staticPath)) {
|
|
52
|
+
const markdown2 = fs.readFileSync(staticPath, "utf-8");
|
|
53
|
+
return new Response(markdown2, {
|
|
54
|
+
status: 200,
|
|
55
|
+
headers: {
|
|
56
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
57
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600"
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const { markdown, metadata } = await chunkIRNMIFOE_js.generateLLMsFullTxt(generateOptions);
|
|
63
|
+
return new Response(markdown, {
|
|
64
|
+
status: 200,
|
|
65
|
+
headers: {
|
|
66
|
+
"Content-Type": "text/plain; charset=utf-8",
|
|
67
|
+
"Cache-Control": "public, max-age=3600, s-maxage=3600",
|
|
68
|
+
"X-Generated-At": metadata.generated_at,
|
|
69
|
+
"X-Sections": metadata.sections.join(",")
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} catch (error) {
|
|
73
|
+
console.error("@uptrade/llms: Error generating llms-full.txt:", error);
|
|
74
|
+
return new Response("# Error\n\nUnable to generate llms-full.txt content.", {
|
|
75
|
+
status: 500,
|
|
76
|
+
headers: { "Content-Type": "text/plain; charset=utf-8" }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function SpeakableSchema({
|
|
82
|
+
type,
|
|
83
|
+
name,
|
|
84
|
+
url,
|
|
85
|
+
speakable,
|
|
86
|
+
additionalProperties = {}
|
|
87
|
+
}) {
|
|
88
|
+
const schema = createSpeakableSchema(type, name, url, speakable, additionalProperties);
|
|
89
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
90
|
+
"script",
|
|
91
|
+
{
|
|
92
|
+
type: "application/ld+json",
|
|
93
|
+
dangerouslySetInnerHTML: {
|
|
94
|
+
__html: JSON.stringify(schema, null, 0)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
function createSpeakableSchema(type, name, url, speakable, additionalProperties = {}) {
|
|
100
|
+
const speakableSpec = {
|
|
101
|
+
"@type": "SpeakableSpecification"
|
|
102
|
+
};
|
|
103
|
+
if (speakable.cssSelectors?.length) {
|
|
104
|
+
speakableSpec.cssSelector = speakable.cssSelectors;
|
|
105
|
+
} else if (speakable.xPaths?.length) {
|
|
106
|
+
speakableSpec.xpath = speakable.xPaths;
|
|
107
|
+
} else {
|
|
108
|
+
speakableSpec.cssSelector = [
|
|
109
|
+
"h1",
|
|
110
|
+
"[data-speakable]",
|
|
111
|
+
".page-summary",
|
|
112
|
+
".key-points",
|
|
113
|
+
'meta[name="description"]'
|
|
114
|
+
];
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
"@context": "https://schema.org",
|
|
118
|
+
"@type": type,
|
|
119
|
+
name,
|
|
120
|
+
url,
|
|
121
|
+
speakable: speakableSpec,
|
|
122
|
+
...additionalProperties
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
var DEFAULT_SPEAKABLE_SELECTORS = {
|
|
126
|
+
/** Standard page elements */
|
|
127
|
+
page: ["h1", 'meta[name="description"]', ".page-summary"],
|
|
128
|
+
/** Article/blog post elements */
|
|
129
|
+
article: ["h1", ".article-summary", ".article-intro", 'meta[name="description"]'],
|
|
130
|
+
/** Service page elements */
|
|
131
|
+
service: ["h1", ".service-overview", ".key-benefits", 'meta[name="description"]'],
|
|
132
|
+
/** FAQ page elements */
|
|
133
|
+
faq: ["h1", ".faq-intro", ".faq-item"],
|
|
134
|
+
/** Contact page elements */
|
|
135
|
+
contact: ["h1", ".contact-intro", ".business-hours", ".contact-info"]
|
|
136
|
+
};
|
|
137
|
+
function getSpeakableSelectorsForPage(pageType) {
|
|
138
|
+
return DEFAULT_SPEAKABLE_SELECTORS[pageType] || DEFAULT_SPEAKABLE_SELECTORS.page;
|
|
139
|
+
}
|
|
140
|
+
function AEOBlock({
|
|
141
|
+
id,
|
|
142
|
+
type,
|
|
143
|
+
question,
|
|
144
|
+
speakable = true,
|
|
145
|
+
entityId,
|
|
146
|
+
children,
|
|
147
|
+
className = ""
|
|
148
|
+
}) {
|
|
149
|
+
const blockId = id || `aeo-${type}-${Math.random().toString(36).slice(2, 8)}`;
|
|
150
|
+
const baseClasses = `aeo-block aeo-${type}`;
|
|
151
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
152
|
+
const sonorAttrs = {
|
|
153
|
+
"data-sonor-ai": type,
|
|
154
|
+
"data-sonor-block": "true",
|
|
155
|
+
...entityId && { "data-sonor-entity": entityId }
|
|
156
|
+
};
|
|
157
|
+
if (type === "answer" && question) {
|
|
158
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
159
|
+
"section",
|
|
160
|
+
{
|
|
161
|
+
id: blockId,
|
|
162
|
+
className: combinedClasses,
|
|
163
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
164
|
+
"data-aeo-type": type,
|
|
165
|
+
...sonorAttrs,
|
|
166
|
+
itemScope: true,
|
|
167
|
+
itemType: "https://schema.org/Question",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { itemProp: "name", className: "aeo-question", children: question }),
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
171
|
+
"div",
|
|
172
|
+
{
|
|
173
|
+
itemScope: true,
|
|
174
|
+
itemType: "https://schema.org/Answer",
|
|
175
|
+
itemProp: "acceptedAnswer",
|
|
176
|
+
className: "aeo-answer",
|
|
177
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { itemProp: "text", children })
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
if (type === "definition") {
|
|
185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
186
|
+
"section",
|
|
187
|
+
{
|
|
188
|
+
id: blockId,
|
|
189
|
+
className: combinedClasses,
|
|
190
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
191
|
+
"data-aeo-type": type,
|
|
192
|
+
...sonorAttrs,
|
|
193
|
+
children
|
|
194
|
+
}
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
if (type === "steps") {
|
|
198
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
199
|
+
"section",
|
|
200
|
+
{
|
|
201
|
+
id: blockId,
|
|
202
|
+
className: combinedClasses,
|
|
203
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
204
|
+
"data-aeo-type": type,
|
|
205
|
+
...sonorAttrs,
|
|
206
|
+
itemScope: true,
|
|
207
|
+
itemType: "https://schema.org/HowTo",
|
|
208
|
+
children
|
|
209
|
+
}
|
|
210
|
+
);
|
|
211
|
+
}
|
|
212
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
+
"section",
|
|
214
|
+
{
|
|
215
|
+
id: blockId,
|
|
216
|
+
className: combinedClasses,
|
|
217
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
218
|
+
"data-aeo-type": type,
|
|
219
|
+
...sonorAttrs,
|
|
220
|
+
children
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
function AEOSummary({
|
|
225
|
+
title = "Key Points",
|
|
226
|
+
points,
|
|
227
|
+
speakable = true,
|
|
228
|
+
entityId,
|
|
229
|
+
className = ""
|
|
230
|
+
}) {
|
|
231
|
+
const baseClasses = "aeo-summary";
|
|
232
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
className: combinedClasses,
|
|
237
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
238
|
+
"data-aeo-type": "summary",
|
|
239
|
+
"data-sonor-ai": "summary",
|
|
240
|
+
"data-sonor-block": "true",
|
|
241
|
+
...entityId && { "data-sonor-entity": entityId },
|
|
242
|
+
children: [
|
|
243
|
+
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-summary-title", children: title }),
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "aeo-summary-points", children: points.map((point, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "aeo-summary-point", children: point }, index)) })
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
function AEODefinition({
|
|
250
|
+
term,
|
|
251
|
+
definition,
|
|
252
|
+
speakable = true,
|
|
253
|
+
entityId,
|
|
254
|
+
source,
|
|
255
|
+
className = ""
|
|
256
|
+
}) {
|
|
257
|
+
const baseClasses = "aeo-definition";
|
|
258
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
259
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
260
|
+
"dl",
|
|
261
|
+
{
|
|
262
|
+
className: combinedClasses,
|
|
263
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
264
|
+
"data-aeo-type": "definition",
|
|
265
|
+
"data-sonor-ai": "definition",
|
|
266
|
+
"data-sonor-block": "true",
|
|
267
|
+
...entityId && { "data-sonor-entity": entityId },
|
|
268
|
+
...source && { "data-sonor-source": source },
|
|
269
|
+
itemScope: true,
|
|
270
|
+
itemType: "https://schema.org/DefinedTerm",
|
|
271
|
+
children: [
|
|
272
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { className: "aeo-term", itemProp: "name", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: term }) }),
|
|
273
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: "aeo-definition-text", itemProp: "description", children: definition })
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
function AEOSteps({
|
|
279
|
+
title,
|
|
280
|
+
children,
|
|
281
|
+
speakable = true,
|
|
282
|
+
entityId,
|
|
283
|
+
className = ""
|
|
284
|
+
}) {
|
|
285
|
+
const baseClasses = "aeo-steps";
|
|
286
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
287
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
288
|
+
"section",
|
|
289
|
+
{
|
|
290
|
+
className: combinedClasses,
|
|
291
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
292
|
+
"data-aeo-type": "steps",
|
|
293
|
+
"data-sonor-ai": "steps",
|
|
294
|
+
"data-sonor-block": "true",
|
|
295
|
+
...entityId && { "data-sonor-entity": entityId },
|
|
296
|
+
itemScope: true,
|
|
297
|
+
itemType: "https://schema.org/HowTo",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-steps-title", itemProp: "name", children: title }),
|
|
300
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "aeo-steps-list", children })
|
|
301
|
+
]
|
|
302
|
+
}
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
function AEOStep({
|
|
306
|
+
number,
|
|
307
|
+
name,
|
|
308
|
+
children
|
|
309
|
+
}) {
|
|
310
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
311
|
+
"li",
|
|
312
|
+
{
|
|
313
|
+
className: "aeo-step",
|
|
314
|
+
itemScope: true,
|
|
315
|
+
itemType: "https://schema.org/HowToStep",
|
|
316
|
+
itemProp: "step",
|
|
317
|
+
children: [
|
|
318
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "aeo-step-number", itemProp: "position", children: number }),
|
|
319
|
+
/* @__PURE__ */ jsxRuntime.jsx("strong", { className: "aeo-step-name", itemProp: "name", children: name }),
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "aeo-step-content", itemProp: "text", children })
|
|
321
|
+
]
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
}
|
|
325
|
+
function AEOComparison({
|
|
326
|
+
title,
|
|
327
|
+
items,
|
|
328
|
+
labelA,
|
|
329
|
+
labelB,
|
|
330
|
+
speakable = true,
|
|
331
|
+
entityId,
|
|
332
|
+
className = ""
|
|
333
|
+
}) {
|
|
334
|
+
const baseClasses = "aeo-comparison";
|
|
335
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
336
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
337
|
+
"section",
|
|
338
|
+
{
|
|
339
|
+
className: combinedClasses,
|
|
340
|
+
"data-speakable": speakable ? "true" : void 0,
|
|
341
|
+
"data-aeo-type": "comparison",
|
|
342
|
+
"data-sonor-ai": "comparison",
|
|
343
|
+
"data-sonor-block": "true",
|
|
344
|
+
...entityId && { "data-sonor-entity": entityId },
|
|
345
|
+
children: [
|
|
346
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-comparison-title", children: title }),
|
|
347
|
+
/* @__PURE__ */ jsxRuntime.jsxs("table", { className: "aeo-comparison-table", children: [
|
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
349
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: "Aspect" }),
|
|
350
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: labelA }),
|
|
351
|
+
/* @__PURE__ */ jsxRuntime.jsx("th", { children: labelB })
|
|
352
|
+
] }) }),
|
|
353
|
+
/* @__PURE__ */ jsxRuntime.jsx("tbody", { children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
|
|
354
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-aspect", children: item.aspect }),
|
|
355
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-a", children: item.optionA }),
|
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-b", children: item.optionB })
|
|
357
|
+
] }, index)) })
|
|
358
|
+
] })
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}
|
|
363
|
+
function AEOClaim({
|
|
364
|
+
source,
|
|
365
|
+
sourceUrl,
|
|
366
|
+
confidence = 1,
|
|
367
|
+
claimType = "fact",
|
|
368
|
+
retrievedAt,
|
|
369
|
+
children,
|
|
370
|
+
className = ""
|
|
371
|
+
}) {
|
|
372
|
+
const baseClasses = "aeo-claim";
|
|
373
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
374
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
375
|
+
"span",
|
|
376
|
+
{
|
|
377
|
+
className: combinedClasses,
|
|
378
|
+
"data-sonor-claim": "true",
|
|
379
|
+
"data-sonor-source": source,
|
|
380
|
+
...sourceUrl && { "data-sonor-source-url": sourceUrl },
|
|
381
|
+
"data-sonor-confidence": confidence.toString(),
|
|
382
|
+
"data-sonor-claim-type": claimType,
|
|
383
|
+
...retrievedAt && { "data-sonor-retrieved": retrievedAt },
|
|
384
|
+
itemScope: true,
|
|
385
|
+
itemType: "https://schema.org/Claim",
|
|
386
|
+
children: [
|
|
387
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "text", children }),
|
|
388
|
+
sourceUrl ? /* @__PURE__ */ jsxRuntime.jsx("meta", { itemProp: "citation", content: sourceUrl }) : /* @__PURE__ */ jsxRuntime.jsx("meta", { itemProp: "citation", content: source })
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
);
|
|
392
|
+
}
|
|
393
|
+
function AEOEntity({
|
|
394
|
+
entityId,
|
|
395
|
+
entityType,
|
|
396
|
+
name,
|
|
397
|
+
url,
|
|
398
|
+
children,
|
|
399
|
+
className = ""
|
|
400
|
+
}) {
|
|
401
|
+
const baseClasses = "aeo-entity";
|
|
402
|
+
const combinedClasses = className ? `${baseClasses} aeo-entity-${entityType} ${className}` : `${baseClasses} aeo-entity-${entityType}`;
|
|
403
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
404
|
+
"span",
|
|
405
|
+
{
|
|
406
|
+
className: combinedClasses,
|
|
407
|
+
"data-sonor-entity": entityId,
|
|
408
|
+
"data-sonor-entity-type": entityType,
|
|
409
|
+
"data-sonor-entity-name": name,
|
|
410
|
+
...url && { "data-sonor-entity-url": url },
|
|
411
|
+
itemScope: true,
|
|
412
|
+
itemType: `https://schema.org/${entityType === "organization" ? "Organization" : entityType === "person" ? "Person" : entityType === "location" ? "Place" : "Thing"}`,
|
|
413
|
+
children: [
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children }),
|
|
415
|
+
url && /* @__PURE__ */ jsxRuntime.jsx("link", { itemProp: "url", href: url })
|
|
416
|
+
]
|
|
417
|
+
}
|
|
418
|
+
);
|
|
419
|
+
}
|
|
420
|
+
function AEOProvenanceList({
|
|
421
|
+
sources,
|
|
422
|
+
title = "Sources & References",
|
|
423
|
+
className = ""
|
|
424
|
+
}) {
|
|
425
|
+
const baseClasses = "aeo-provenance-list";
|
|
426
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
427
|
+
const getSchemaType = (sourceType) => {
|
|
428
|
+
switch (sourceType) {
|
|
429
|
+
case "legal_statute":
|
|
430
|
+
return "https://schema.org/Legislation";
|
|
431
|
+
case "research_paper":
|
|
432
|
+
return "https://schema.org/ScholarlyArticle";
|
|
433
|
+
case "news_article":
|
|
434
|
+
return "https://schema.org/NewsArticle";
|
|
435
|
+
case "press_release":
|
|
436
|
+
return "https://schema.org/NewsArticle";
|
|
437
|
+
default:
|
|
438
|
+
return "https://schema.org/CreativeWork";
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
442
|
+
"aside",
|
|
443
|
+
{
|
|
444
|
+
className: combinedClasses,
|
|
445
|
+
"data-sonor-provenance": "list",
|
|
446
|
+
"data-sonor-source-count": sources.length.toString(),
|
|
447
|
+
itemScope: true,
|
|
448
|
+
itemType: "https://schema.org/ItemList",
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ jsxRuntime.jsx("h4", { className: "aeo-provenance-title", itemProp: "name", children: title }),
|
|
451
|
+
/* @__PURE__ */ jsxRuntime.jsx("ol", { className: "aeo-provenance-sources", children: sources.map((source, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
452
|
+
"li",
|
|
453
|
+
{
|
|
454
|
+
className: "aeo-provenance-item",
|
|
455
|
+
"data-sonor-source-id": source.id,
|
|
456
|
+
"data-sonor-source-type": source.source_type,
|
|
457
|
+
...source.confidence && { "data-sonor-confidence": source.confidence.toString() },
|
|
458
|
+
itemScope: true,
|
|
459
|
+
itemType: getSchemaType(source.source_type),
|
|
460
|
+
itemProp: "itemListElement",
|
|
461
|
+
children: [
|
|
462
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "aeo-provenance-number", children: [
|
|
463
|
+
"[",
|
|
464
|
+
index + 1,
|
|
465
|
+
"]"
|
|
466
|
+
] }),
|
|
467
|
+
source.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
468
|
+
"a",
|
|
469
|
+
{
|
|
470
|
+
href: source.url,
|
|
471
|
+
className: "aeo-provenance-link",
|
|
472
|
+
itemProp: "url",
|
|
473
|
+
target: "_blank",
|
|
474
|
+
rel: "noopener noreferrer",
|
|
475
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children: source.title })
|
|
476
|
+
}
|
|
477
|
+
) : /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children: source.title }),
|
|
478
|
+
source.publisher && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "aeo-provenance-publisher", itemProp: "publisher", children: [
|
|
479
|
+
"\u2014 ",
|
|
480
|
+
source.publisher
|
|
481
|
+
] }),
|
|
482
|
+
source.published_at && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
483
|
+
"time",
|
|
484
|
+
{
|
|
485
|
+
className: "aeo-provenance-date",
|
|
486
|
+
itemProp: "datePublished",
|
|
487
|
+
dateTime: source.published_at,
|
|
488
|
+
children: [
|
|
489
|
+
"(",
|
|
490
|
+
new Date(source.published_at).toLocaleDateString(),
|
|
491
|
+
")"
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
),
|
|
495
|
+
source.identifier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "aeo-provenance-identifier", "data-sonor-identifier": source.identifier, children: source.identifier }),
|
|
496
|
+
source.excerpt && /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "aeo-provenance-excerpt", itemProp: "description", children: source.excerpt })
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
source.id
|
|
500
|
+
)) })
|
|
501
|
+
]
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
function AEOCitedContent({
|
|
506
|
+
children,
|
|
507
|
+
sources,
|
|
508
|
+
showSourcesList = true,
|
|
509
|
+
className = ""
|
|
510
|
+
}) {
|
|
511
|
+
const baseClasses = "aeo-cited-content";
|
|
512
|
+
const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
|
|
513
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
514
|
+
"section",
|
|
515
|
+
{
|
|
516
|
+
className: combinedClasses,
|
|
517
|
+
"data-sonor-ai": "cited-content",
|
|
518
|
+
"data-sonor-provenance": "inline",
|
|
519
|
+
"data-sonor-source-count": sources.length.toString(),
|
|
520
|
+
children: [
|
|
521
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "aeo-cited-body", children }),
|
|
522
|
+
showSourcesList && sources.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(AEOProvenanceList, { sources, title: "References" })
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
7
527
|
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "AEOBlock", {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return chunkZVIOI47K_js.AEOBlock; }
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, "AEOCitedContent", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return chunkZVIOI47K_js.AEOCitedContent; }
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "AEOClaim", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function () { return chunkZVIOI47K_js.AEOClaim; }
|
|
20
|
-
});
|
|
21
|
-
Object.defineProperty(exports, "AEOComparison", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () { return chunkZVIOI47K_js.AEOComparison; }
|
|
24
|
-
});
|
|
25
|
-
Object.defineProperty(exports, "AEODefinition", {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () { return chunkZVIOI47K_js.AEODefinition; }
|
|
28
|
-
});
|
|
29
|
-
Object.defineProperty(exports, "AEOEntity", {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function () { return chunkZVIOI47K_js.AEOEntity; }
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(exports, "AEOProvenanceList", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
get: function () { return chunkZVIOI47K_js.AEOProvenanceList; }
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, "AEOStep", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () { return chunkZVIOI47K_js.AEOStep; }
|
|
40
|
-
});
|
|
41
|
-
Object.defineProperty(exports, "AEOSteps", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function () { return chunkZVIOI47K_js.AEOSteps; }
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(exports, "AEOSummary", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
get: function () { return chunkZVIOI47K_js.AEOSummary; }
|
|
48
|
-
});
|
|
49
|
-
Object.defineProperty(exports, "DEFAULT_SPEAKABLE_SELECTORS", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function () { return chunkZVIOI47K_js.DEFAULT_SPEAKABLE_SELECTORS; }
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(exports, "SpeakableSchema", {
|
|
54
|
-
enumerable: true,
|
|
55
|
-
get: function () { return chunkZVIOI47K_js.SpeakableSchema; }
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(exports, "createLLMsFullTxtHandler", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
get: function () { return chunkZVIOI47K_js.createLLMsFullTxtHandler; }
|
|
60
|
-
});
|
|
61
|
-
Object.defineProperty(exports, "createLLMsTxtHandler", {
|
|
62
|
-
enumerable: true,
|
|
63
|
-
get: function () { return chunkZVIOI47K_js.createLLMsTxtHandler; }
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(exports, "createSpeakableSchema", {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () { return chunkZVIOI47K_js.createSpeakableSchema; }
|
|
68
|
-
});
|
|
69
|
-
Object.defineProperty(exports, "getSpeakableSelectorsForPage", {
|
|
70
|
-
enumerable: true,
|
|
71
|
-
get: function () { return chunkZVIOI47K_js.getSpeakableSelectorsForPage; }
|
|
72
|
-
});
|
|
73
528
|
Object.defineProperty(exports, "generateLLMsFullTxt", {
|
|
74
529
|
enumerable: true,
|
|
75
|
-
get: function () { return
|
|
530
|
+
get: function () { return chunkIRNMIFOE_js.generateLLMsFullTxt; }
|
|
76
531
|
});
|
|
77
532
|
Object.defineProperty(exports, "generateLLMsTxt", {
|
|
78
533
|
enumerable: true,
|
|
79
|
-
get: function () { return
|
|
534
|
+
get: function () { return chunkIRNMIFOE_js.generateLLMsTxt; }
|
|
80
535
|
});
|
|
81
536
|
Object.defineProperty(exports, "getBusinessInfo", {
|
|
82
537
|
enumerable: true,
|
|
83
|
-
get: function () { return
|
|
538
|
+
get: function () { return chunkIRNMIFOE_js.getBusinessInfo; }
|
|
84
539
|
});
|
|
85
540
|
Object.defineProperty(exports, "getFAQItems", {
|
|
86
541
|
enumerable: true,
|
|
87
|
-
get: function () { return
|
|
542
|
+
get: function () { return chunkIRNMIFOE_js.getFAQItems; }
|
|
88
543
|
});
|
|
89
544
|
Object.defineProperty(exports, "getLLMsData", {
|
|
90
545
|
enumerable: true,
|
|
91
|
-
get: function () { return
|
|
546
|
+
get: function () { return chunkIRNMIFOE_js.getLLMsData; }
|
|
92
547
|
});
|
|
93
548
|
Object.defineProperty(exports, "getOptimizedLLMsTxt", {
|
|
94
549
|
enumerable: true,
|
|
95
|
-
get: function () { return
|
|
550
|
+
get: function () { return chunkIRNMIFOE_js.getOptimizedLLMsTxt; }
|
|
96
551
|
});
|
|
97
552
|
Object.defineProperty(exports, "getPageSummaries", {
|
|
98
553
|
enumerable: true,
|
|
99
|
-
get: function () { return
|
|
554
|
+
get: function () { return chunkIRNMIFOE_js.getPageSummaries; }
|
|
100
555
|
});
|
|
101
556
|
Object.defineProperty(exports, "getServices", {
|
|
102
557
|
enumerable: true,
|
|
103
|
-
get: function () { return
|
|
558
|
+
get: function () { return chunkIRNMIFOE_js.getServices; }
|
|
104
559
|
});
|
|
105
560
|
Object.defineProperty(exports, "writeLLMsTxtToPublic", {
|
|
106
561
|
enumerable: true,
|
|
107
|
-
get: function () { return
|
|
562
|
+
get: function () { return chunkIRNMIFOE_js.writeLLMsTxtToPublic; }
|
|
108
563
|
});
|
|
564
|
+
exports.AEOBlock = AEOBlock;
|
|
565
|
+
exports.AEOCitedContent = AEOCitedContent;
|
|
566
|
+
exports.AEOClaim = AEOClaim;
|
|
567
|
+
exports.AEOComparison = AEOComparison;
|
|
568
|
+
exports.AEODefinition = AEODefinition;
|
|
569
|
+
exports.AEOEntity = AEOEntity;
|
|
570
|
+
exports.AEOProvenanceList = AEOProvenanceList;
|
|
571
|
+
exports.AEOStep = AEOStep;
|
|
572
|
+
exports.AEOSteps = AEOSteps;
|
|
573
|
+
exports.AEOSummary = AEOSummary;
|
|
574
|
+
exports.DEFAULT_SPEAKABLE_SELECTORS = DEFAULT_SPEAKABLE_SELECTORS;
|
|
575
|
+
exports.SpeakableSchema = SpeakableSchema;
|
|
576
|
+
exports.createLLMsFullTxtHandler = createLLMsFullTxtHandler;
|
|
577
|
+
exports.createLLMsTxtHandler = createLLMsTxtHandler;
|
|
578
|
+
exports.createSpeakableSchema = createSpeakableSchema;
|
|
579
|
+
exports.getSpeakableSelectorsForPage = getSpeakableSelectorsForPage;
|
|
109
580
|
//# sourceMappingURL=index.js.map
|
|
110
581
|
//# sourceMappingURL=index.js.map
|