@uptrademedia/site-kit 1.0.5 → 1.0.7

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.
Files changed (169) hide show
  1. package/dist/analytics/index.js +7 -7
  2. package/dist/analytics/index.mjs +3 -3
  3. package/dist/api-QUIPJJCX.js +77 -0
  4. package/dist/api-QUIPJJCX.js.map +1 -0
  5. package/dist/api-V3BA5PMX.mjs +4 -0
  6. package/dist/api-V3BA5PMX.mjs.map +1 -0
  7. package/dist/blog/index.d.mts +2 -2
  8. package/dist/blog/index.d.ts +2 -2
  9. package/dist/blog/index.js +40 -6
  10. package/dist/blog/index.js.map +1 -1
  11. package/dist/blog/index.mjs +40 -6
  12. package/dist/blog/index.mjs.map +1 -1
  13. package/dist/blog/server.d.mts +3 -2
  14. package/dist/blog/server.d.ts +3 -2
  15. package/dist/blog/server.js +13 -6
  16. package/dist/blog/server.js.map +1 -1
  17. package/dist/blog/server.mjs +13 -6
  18. package/dist/blog/server.mjs.map +1 -1
  19. package/dist/{chunk-FKVJOT2F.mjs → chunk-42EXHJTC.mjs} +196 -7
  20. package/dist/chunk-42EXHJTC.mjs.map +1 -0
  21. package/dist/{scanner-AZV5I6US.mjs → chunk-44OMJFCG.mjs} +354 -14
  22. package/dist/chunk-44OMJFCG.mjs.map +1 -0
  23. package/dist/chunk-4TGJYNHV.js +981 -0
  24. package/dist/chunk-4TGJYNHV.js.map +1 -0
  25. package/dist/chunk-4XPGGLVP.mjs +53 -0
  26. package/dist/{chunk-NYKRE2FL.mjs.map → chunk-4XPGGLVP.mjs.map} +1 -1
  27. package/dist/{generators-TO2FKJR6.mjs → chunk-6ONUXZDO.mjs} +26 -9
  28. package/dist/chunk-6ONUXZDO.mjs.map +1 -0
  29. package/dist/chunk-CG53ASWX.mjs +729 -0
  30. package/dist/chunk-CG53ASWX.mjs.map +1 -0
  31. package/dist/{scanner-ETJAMIT7.js → chunk-DERI27QC.js} +448 -102
  32. package/dist/chunk-DERI27QC.js.map +1 -0
  33. package/dist/chunk-DYM5ML2V.mjs +1518 -0
  34. package/dist/chunk-DYM5ML2V.mjs.map +1 -0
  35. package/dist/chunk-FLZZOX44.js +1526 -0
  36. package/dist/chunk-FLZZOX44.js.map +1 -0
  37. package/dist/{chunk-7H6I3ECV.mjs → chunk-FQVGK746.mjs} +63 -3
  38. package/dist/chunk-FQVGK746.mjs.map +1 -0
  39. package/dist/{chunk-GQ6ZOU2N.mjs → chunk-JGQPAXTL.mjs} +4 -4
  40. package/dist/{chunk-GQ6ZOU2N.mjs.map → chunk-JGQPAXTL.mjs.map} +1 -1
  41. package/dist/{chunk-V3F5J6CV.js → chunk-JUEVN4Q4.js} +196 -7
  42. package/dist/chunk-JUEVN4Q4.js.map +1 -0
  43. package/dist/chunk-KKMGTT7F.mjs +968 -0
  44. package/dist/chunk-KKMGTT7F.mjs.map +1 -0
  45. package/dist/{chunk-XQJX252G.mjs → chunk-MB3WR5KJ.mjs} +28 -18
  46. package/dist/chunk-MB3WR5KJ.mjs.map +1 -0
  47. package/dist/{chunk-2IHTEKHU.mjs → chunk-QD5CN2OI.mjs} +16 -7
  48. package/dist/chunk-QD5CN2OI.mjs.map +1 -0
  49. package/dist/{chunk-SBVEYCSV.js → chunk-QQB4FO4Q.js} +7 -7
  50. package/dist/{chunk-SBVEYCSV.js.map → chunk-QQB4FO4Q.js.map} +1 -1
  51. package/dist/{generators-YZWIGHCO.js → chunk-S2GXR5HY.js} +26 -9
  52. package/dist/chunk-S2GXR5HY.js.map +1 -0
  53. package/dist/{chunk-O2OHHBUD.js → chunk-TDK7DLCH.js} +30 -20
  54. package/dist/chunk-TDK7DLCH.js.map +1 -0
  55. package/dist/{chunk-QP5NCO2E.js → chunk-VDI7KYME.js} +67 -2
  56. package/dist/chunk-VDI7KYME.js.map +1 -0
  57. package/dist/chunk-VOR53RUR.js +753 -0
  58. package/dist/chunk-VOR53RUR.js.map +1 -0
  59. package/dist/{chunk-GAJLEDRD.js → chunk-ZKJ7JKFV.js} +16 -7
  60. package/dist/chunk-ZKJ7JKFV.js.map +1 -0
  61. package/dist/chunk-ZSMWDLMK.js +63 -0
  62. package/dist/{chunk-EQCVQC35.js.map → chunk-ZSMWDLMK.js.map} +1 -1
  63. package/dist/cli/index.js +37269 -0
  64. package/dist/cli/index.js.map +1 -0
  65. package/dist/cli/index.mjs +37233 -0
  66. package/dist/cli/index.mjs.map +1 -0
  67. package/dist/commerce/index.js +1 -1
  68. package/dist/commerce/index.mjs +1 -1
  69. package/dist/commerce/server.d.mts +12 -3
  70. package/dist/commerce/server.d.ts +12 -3
  71. package/dist/commerce/server.js +71 -70
  72. package/dist/commerce/server.js.map +1 -1
  73. package/dist/commerce/server.mjs +71 -70
  74. package/dist/commerce/server.mjs.map +1 -1
  75. package/dist/engage/index.d.mts +6 -4
  76. package/dist/engage/index.d.ts +6 -4
  77. package/dist/engage/index.js +8 -4
  78. package/dist/engage/index.mjs +2 -2
  79. package/dist/forms/index.js +1 -1
  80. package/dist/forms/index.mjs +1 -1
  81. package/dist/generators-5EU4PTVF.js +33 -0
  82. package/dist/generators-5EU4PTVF.js.map +1 -0
  83. package/dist/generators-TYPILCWD.mjs +4 -0
  84. package/dist/generators-TYPILCWD.mjs.map +1 -0
  85. package/dist/images/index.js +11 -11
  86. package/dist/images/index.mjs +4 -4
  87. package/dist/index.d.mts +154 -5
  88. package/dist/index.d.ts +154 -5
  89. package/dist/index.js +940 -24
  90. package/dist/index.js.map +1 -1
  91. package/dist/index.mjs +819 -7
  92. package/dist/index.mjs.map +1 -1
  93. package/dist/llms/index.d.mts +657 -0
  94. package/dist/llms/index.d.ts +657 -0
  95. package/dist/llms/index.js +101 -0
  96. package/dist/llms/index.js.map +1 -0
  97. package/dist/llms/index.mjs +4 -0
  98. package/dist/llms/index.mjs.map +1 -0
  99. package/dist/migrator-ARLHUNB3.mjs +4 -0
  100. package/dist/migrator-ARLHUNB3.mjs.map +1 -0
  101. package/dist/migrator-VZLBH3VY.js +37 -0
  102. package/dist/migrator-VZLBH3VY.js.map +1 -0
  103. package/dist/redirects/index.js +1 -1
  104. package/dist/redirects/index.mjs +1 -1
  105. package/dist/reputation/index.js +1 -1
  106. package/dist/reputation/index.mjs +1 -1
  107. package/dist/{routing-BWjUF7lp.d.ts → routing-CF91y6NO.d.ts} +1 -1
  108. package/dist/{routing-CgmRi9tD.d.mts → routing-CIOFpFCB.d.mts} +1 -1
  109. package/dist/scanner-7ZMUM2P5.mjs +4 -0
  110. package/dist/scanner-7ZMUM2P5.mjs.map +1 -0
  111. package/dist/scanner-OY7UF3WA.js +53 -0
  112. package/dist/scanner-OY7UF3WA.js.map +1 -0
  113. package/dist/seo/index.d.mts +267 -7
  114. package/dist/seo/index.d.ts +267 -7
  115. package/dist/seo/index.js +432 -24
  116. package/dist/seo/index.js.map +1 -1
  117. package/dist/seo/index.mjs +400 -11
  118. package/dist/seo/index.mjs.map +1 -1
  119. package/dist/seo/server.d.mts +11 -4
  120. package/dist/seo/server.d.ts +11 -4
  121. package/dist/seo/server.js +17 -17
  122. package/dist/seo/server.mjs +3 -3
  123. package/dist/setup/client.js +1 -1
  124. package/dist/setup/client.mjs +1 -1
  125. package/dist/setup/index.js +3 -3
  126. package/dist/setup/index.mjs +2 -2
  127. package/dist/setup/server.js +3 -3
  128. package/dist/setup/server.mjs +2 -2
  129. package/dist/sitemap/index.js +2 -2
  130. package/dist/sitemap/index.js.map +1 -1
  131. package/dist/sitemap/index.mjs +2 -2
  132. package/dist/sitemap/index.mjs.map +1 -1
  133. package/dist/{types-C0pJGfbH.d.mts → types-D6FHAVWX.d.mts} +99 -3
  134. package/dist/{types-C0pJGfbH.d.ts → types-D6FHAVWX.d.ts} +99 -3
  135. package/dist/{types-BN4OwtCO.d.mts → types-DI0jnhjJ.d.mts} +2 -0
  136. package/dist/{types-BN4OwtCO.d.ts → types-DI0jnhjJ.d.ts} +2 -0
  137. package/dist/{types-BmzutFwy.d.ts → types-j8X4vUhB.d.mts} +19 -2
  138. package/dist/{types-BmzutFwy.d.mts → types-j8X4vUhB.d.ts} +19 -2
  139. package/dist/{web-vitals-BH55V7EJ.js → web-vitals-444RLW3B.js} +11 -11
  140. package/dist/{web-vitals-BH55V7EJ.js.map → web-vitals-444RLW3B.js.map} +1 -1
  141. package/dist/{web-vitals-RJYPWAR3.mjs → web-vitals-KPICZIEF.mjs} +3 -3
  142. package/dist/{web-vitals-RJYPWAR3.mjs.map → web-vitals-KPICZIEF.mjs.map} +1 -1
  143. package/package.json +9 -2
  144. package/dist/api-N35S3EES.js +0 -57
  145. package/dist/api-N35S3EES.js.map +0 -1
  146. package/dist/api-SYBTK7Z7.mjs +0 -4
  147. package/dist/api-SYBTK7Z7.mjs.map +0 -1
  148. package/dist/chunk-2IHTEKHU.mjs.map +0 -1
  149. package/dist/chunk-7H6I3ECV.mjs.map +0 -1
  150. package/dist/chunk-BGJLOJ7T.mjs +0 -605
  151. package/dist/chunk-BGJLOJ7T.mjs.map +0 -1
  152. package/dist/chunk-EQCVQC35.js +0 -35
  153. package/dist/chunk-FKVJOT2F.mjs.map +0 -1
  154. package/dist/chunk-GAJLEDRD.js.map +0 -1
  155. package/dist/chunk-NYKRE2FL.mjs +0 -31
  156. package/dist/chunk-O2OHHBUD.js.map +0 -1
  157. package/dist/chunk-QAYJV4KK.js +0 -608
  158. package/dist/chunk-QAYJV4KK.js.map +0 -1
  159. package/dist/chunk-QP5NCO2E.js.map +0 -1
  160. package/dist/chunk-V3F5J6CV.js.map +0 -1
  161. package/dist/chunk-XQJX252G.mjs.map +0 -1
  162. package/dist/generators-TO2FKJR6.mjs.map +0 -1
  163. package/dist/generators-YZWIGHCO.js.map +0 -1
  164. package/dist/migrator-V6KS75EA.mjs +0 -265
  165. package/dist/migrator-V6KS75EA.mjs.map +0 -1
  166. package/dist/migrator-XKM7YQCY.js +0 -272
  167. package/dist/migrator-XKM7YQCY.js.map +0 -1
  168. package/dist/scanner-AZV5I6US.mjs.map +0 -1
  169. package/dist/scanner-ETJAMIT7.js.map +0 -1
@@ -0,0 +1,753 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/llms/api.ts
7
+ function getApiConfig() {
8
+ const apiUrl = typeof window !== "undefined" && window.__SITE_KIT_API_URL__ || process.env.NEXT_PUBLIC_UPTRADE_API_URL || "https://api.uptrademedia.com";
9
+ const apiKey = typeof window !== "undefined" && window.__SITE_KIT_API_KEY__ || process.env.NEXT_PUBLIC_UPTRADE_API_KEY || "";
10
+ return { apiUrl, apiKey };
11
+ }
12
+ async function apiGet(endpoint) {
13
+ const { apiUrl, apiKey } = getApiConfig();
14
+ if (!apiKey) {
15
+ console.error("@uptrade/llms: No API key configured. Set NEXT_PUBLIC_UPTRADE_API_KEY.");
16
+ return null;
17
+ }
18
+ try {
19
+ const response = await fetch(`${apiUrl}${endpoint}`, {
20
+ method: "GET",
21
+ headers: {
22
+ "Content-Type": "application/json",
23
+ "x-api-key": apiKey
24
+ },
25
+ next: { revalidate: 3600 }
26
+ // Cache for 1 hour
27
+ });
28
+ if (!response.ok) {
29
+ console.error(`@uptrade/llms: API error: ${response.statusText}`);
30
+ return null;
31
+ }
32
+ return await response.json();
33
+ } catch (error) {
34
+ console.error("@uptrade/llms: Network error:", error);
35
+ return null;
36
+ }
37
+ }
38
+ var getLLMsData = react.cache(async (projectId) => {
39
+ return apiGet(`/api/public/llms/data`);
40
+ });
41
+ var getBusinessInfo = react.cache(async (projectId) => {
42
+ const result = await apiGet(`/api/public/llms/business`);
43
+ return result?.business || null;
44
+ });
45
+ var getServices = react.cache(async (projectId) => {
46
+ const result = await apiGet(`/api/public/llms/services`);
47
+ return result?.services || [];
48
+ });
49
+ var getFAQItems = react.cache(async (projectId, limit) => {
50
+ const endpoint = limit ? `/api/public/llms/faq?limit=${limit}` : "/api/public/llms/faq";
51
+ const result = await apiGet(endpoint);
52
+ return result?.faq || [];
53
+ });
54
+ var getPageSummaries = react.cache(async (projectId, limit) => {
55
+ const endpoint = limit ? `/api/public/llms/pages?limit=${limit}` : "/api/public/llms/pages";
56
+ const result = await apiGet(endpoint);
57
+ return result?.pages || [];
58
+ });
59
+
60
+ // src/llms/generateLLMsTxt.ts
61
+ async function generateLLMsTxt(options) {
62
+ const {
63
+ projectId,
64
+ includeBusinessInfo = true,
65
+ includeServices = true,
66
+ includeFAQ = true,
67
+ includePages = true,
68
+ includeContact = true,
69
+ maxFAQItems = 20,
70
+ maxPages = 50,
71
+ customSections = []
72
+ } = options;
73
+ const data = await getLLMsData(projectId);
74
+ if (!data) {
75
+ return {
76
+ markdown: "# Website\n\n> Information not available.",
77
+ metadata: {
78
+ generated_at: (/* @__PURE__ */ new Date()).toISOString(),
79
+ project_id: projectId || "",
80
+ sections: []
81
+ }
82
+ };
83
+ }
84
+ const sections = [];
85
+ const sectionNames = [];
86
+ if (includeBusinessInfo && data.business) {
87
+ const header = generateHeaderSection(data.business);
88
+ sections.push(header);
89
+ sectionNames.push("header");
90
+ }
91
+ if (includeBusinessInfo && data.business?.description) {
92
+ const about = generateAboutSection(data.business);
93
+ sections.push(about);
94
+ sectionNames.push("about");
95
+ }
96
+ if (includeServices && data.services?.length > 0) {
97
+ const services = generateServicesSection(data.services);
98
+ sections.push(services);
99
+ sectionNames.push("services");
100
+ }
101
+ if (includeContact && data.contact) {
102
+ const contact = generateContactSection(data.contact);
103
+ sections.push(contact);
104
+ sectionNames.push("contact");
105
+ }
106
+ if (includeFAQ && data.faq?.length > 0) {
107
+ const faq = generateFAQSection(data.faq.slice(0, maxFAQItems));
108
+ sections.push(faq);
109
+ sectionNames.push("faq");
110
+ }
111
+ if (includePages && data.pages?.length > 0) {
112
+ const pages = generatePagesSection(data.pages.slice(0, maxPages), data.business?.website || "");
113
+ sections.push(pages);
114
+ sectionNames.push("pages");
115
+ }
116
+ for (const custom of customSections) {
117
+ sections.push(`## ${custom.title}
118
+
119
+ ${custom.content}`);
120
+ sectionNames.push(custom.title.toLowerCase().replace(/\s+/g, "-"));
121
+ }
122
+ return {
123
+ markdown: sections.join("\n\n---\n\n"),
124
+ metadata: {
125
+ generated_at: (/* @__PURE__ */ new Date()).toISOString(),
126
+ project_id: projectId || "",
127
+ sections: sectionNames
128
+ }
129
+ };
130
+ }
131
+ async function generateLLMsFullTxt(options) {
132
+ return generateLLMsTxt({
133
+ ...options,
134
+ includeBusinessInfo: true,
135
+ includeServices: true,
136
+ includeFAQ: true,
137
+ includePages: true,
138
+ includeContact: true,
139
+ maxFAQItems: 100,
140
+ maxPages: 200
141
+ });
142
+ }
143
+ function generateHeaderSection(business) {
144
+ const lines = [];
145
+ lines.push(`# ${business.name}`);
146
+ lines.push("");
147
+ const summary = business.tagline || business.description.split(".")[0];
148
+ lines.push(`> ${summary}`);
149
+ if (business.industry) {
150
+ lines.push("");
151
+ lines.push(`**Industry:** ${business.industry}`);
152
+ }
153
+ if (business.service_area) {
154
+ lines.push(`**Service Area:** ${business.service_area}`);
155
+ }
156
+ if (business.website) {
157
+ lines.push(`**Website:** ${business.website}`);
158
+ }
159
+ return lines.join("\n");
160
+ }
161
+ function generateAboutSection(business) {
162
+ const lines = [];
163
+ lines.push("## About");
164
+ lines.push("");
165
+ lines.push(business.description);
166
+ if (business.founded) {
167
+ lines.push("");
168
+ lines.push(`Established: ${business.founded}`);
169
+ }
170
+ return lines.join("\n");
171
+ }
172
+ function generateServicesSection(services) {
173
+ const lines = [];
174
+ lines.push("## Services");
175
+ lines.push("");
176
+ for (const service of services) {
177
+ if (service.url) {
178
+ lines.push(`- **[${service.name}](${service.url})**: ${service.description}`);
179
+ } else {
180
+ lines.push(`- **${service.name}**: ${service.description}`);
181
+ }
182
+ }
183
+ return lines.join("\n");
184
+ }
185
+ function generateContactSection(contact) {
186
+ const lines = [];
187
+ lines.push("## Contact Information");
188
+ lines.push("");
189
+ if (contact.phone) {
190
+ lines.push(`- **Phone:** ${contact.phone}`);
191
+ }
192
+ if (contact.email) {
193
+ lines.push(`- **Email:** ${contact.email}`);
194
+ }
195
+ if (contact.address || contact.city) {
196
+ const addressParts = [
197
+ contact.address,
198
+ contact.city,
199
+ contact.state,
200
+ contact.postal_code,
201
+ contact.country
202
+ ].filter(Boolean);
203
+ lines.push(`- **Address:** ${addressParts.join(", ")}`);
204
+ }
205
+ if (contact.hours) {
206
+ lines.push(`- **Hours:** ${contact.hours}`);
207
+ }
208
+ return lines.join("\n");
209
+ }
210
+ function generateFAQSection(faq) {
211
+ const lines = [];
212
+ lines.push("## Frequently Asked Questions");
213
+ lines.push("");
214
+ for (const item of faq) {
215
+ lines.push(`### ${item.question}`);
216
+ lines.push("");
217
+ lines.push(item.answer);
218
+ lines.push("");
219
+ }
220
+ return lines.join("\n").trim();
221
+ }
222
+ function generatePagesSection(pages, baseUrl) {
223
+ const lines = [];
224
+ lines.push("## Site Pages");
225
+ lines.push("");
226
+ for (const page of pages) {
227
+ const url = page.path.startsWith("http") ? page.path : `${baseUrl}${page.path}`;
228
+ if (page.description) {
229
+ lines.push(`- [${page.title}](${url}): ${page.description}`);
230
+ } else {
231
+ lines.push(`- [${page.title}](${url})`);
232
+ }
233
+ }
234
+ return lines.join("\n");
235
+ }
236
+
237
+ // src/llms/handlers.ts
238
+ function createLLMsTxtHandler(options = {}) {
239
+ return async function GET() {
240
+ try {
241
+ const { markdown, metadata } = await generateLLMsTxt(options);
242
+ return new Response(markdown, {
243
+ status: 200,
244
+ headers: {
245
+ "Content-Type": "text/plain; charset=utf-8",
246
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
247
+ "X-Generated-At": metadata.generated_at,
248
+ "X-Sections": metadata.sections.join(",")
249
+ }
250
+ });
251
+ } catch (error) {
252
+ console.error("@uptrade/llms: Error generating llms.txt:", error);
253
+ return new Response("# Error\n\nUnable to generate llms.txt content.", {
254
+ status: 500,
255
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
256
+ });
257
+ }
258
+ };
259
+ }
260
+ function createLLMsFullTxtHandler(options = {}) {
261
+ return async function GET() {
262
+ try {
263
+ const { markdown, metadata } = await generateLLMsFullTxt(options);
264
+ return new Response(markdown, {
265
+ status: 200,
266
+ headers: {
267
+ "Content-Type": "text/plain; charset=utf-8",
268
+ "Cache-Control": "public, max-age=3600, s-maxage=3600",
269
+ "X-Generated-At": metadata.generated_at,
270
+ "X-Sections": metadata.sections.join(",")
271
+ }
272
+ });
273
+ } catch (error) {
274
+ console.error("@uptrade/llms: Error generating llms-full.txt:", error);
275
+ return new Response("# Error\n\nUnable to generate llms-full.txt content.", {
276
+ status: 500,
277
+ headers: { "Content-Type": "text/plain; charset=utf-8" }
278
+ });
279
+ }
280
+ };
281
+ }
282
+ function SpeakableSchema({
283
+ type,
284
+ name,
285
+ url,
286
+ speakable,
287
+ additionalProperties = {}
288
+ }) {
289
+ const schema = createSpeakableSchema(type, name, url, speakable, additionalProperties);
290
+ return /* @__PURE__ */ jsxRuntime.jsx(
291
+ "script",
292
+ {
293
+ type: "application/ld+json",
294
+ dangerouslySetInnerHTML: {
295
+ __html: JSON.stringify(schema, null, 0)
296
+ }
297
+ }
298
+ );
299
+ }
300
+ function createSpeakableSchema(type, name, url, speakable, additionalProperties = {}) {
301
+ const speakableSpec = {
302
+ "@type": "SpeakableSpecification"
303
+ };
304
+ if (speakable.cssSelectors?.length) {
305
+ speakableSpec.cssSelector = speakable.cssSelectors;
306
+ } else if (speakable.xPaths?.length) {
307
+ speakableSpec.xpath = speakable.xPaths;
308
+ } else {
309
+ speakableSpec.cssSelector = [
310
+ "h1",
311
+ "[data-speakable]",
312
+ ".page-summary",
313
+ ".key-points",
314
+ 'meta[name="description"]'
315
+ ];
316
+ }
317
+ return {
318
+ "@context": "https://schema.org",
319
+ "@type": type,
320
+ name,
321
+ url,
322
+ speakable: speakableSpec,
323
+ ...additionalProperties
324
+ };
325
+ }
326
+ var DEFAULT_SPEAKABLE_SELECTORS = {
327
+ /** Standard page elements */
328
+ page: ["h1", 'meta[name="description"]', ".page-summary"],
329
+ /** Article/blog post elements */
330
+ article: ["h1", ".article-summary", ".article-intro", 'meta[name="description"]'],
331
+ /** Service page elements */
332
+ service: ["h1", ".service-overview", ".key-benefits", 'meta[name="description"]'],
333
+ /** FAQ page elements */
334
+ faq: ["h1", ".faq-intro", ".faq-item"],
335
+ /** Contact page elements */
336
+ contact: ["h1", ".contact-intro", ".business-hours", ".contact-info"]
337
+ };
338
+ function getSpeakableSelectorsForPage(pageType) {
339
+ return DEFAULT_SPEAKABLE_SELECTORS[pageType] || DEFAULT_SPEAKABLE_SELECTORS.page;
340
+ }
341
+ function AEOBlock({
342
+ id,
343
+ type,
344
+ question,
345
+ speakable = true,
346
+ entityId,
347
+ children,
348
+ className = ""
349
+ }) {
350
+ const blockId = id || `aeo-${type}-${Math.random().toString(36).slice(2, 8)}`;
351
+ const baseClasses = `aeo-block aeo-${type}`;
352
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
353
+ const sonorAttrs = {
354
+ "data-sonor-ai": type,
355
+ "data-sonor-block": "true",
356
+ ...entityId && { "data-sonor-entity": entityId }
357
+ };
358
+ if (type === "answer" && question) {
359
+ return /* @__PURE__ */ jsxRuntime.jsxs(
360
+ "section",
361
+ {
362
+ id: blockId,
363
+ className: combinedClasses,
364
+ "data-speakable": speakable ? "true" : void 0,
365
+ "data-aeo-type": type,
366
+ ...sonorAttrs,
367
+ itemScope: true,
368
+ itemType: "https://schema.org/Question",
369
+ children: [
370
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { itemProp: "name", className: "aeo-question", children: question }),
371
+ /* @__PURE__ */ jsxRuntime.jsx(
372
+ "div",
373
+ {
374
+ itemScope: true,
375
+ itemType: "https://schema.org/Answer",
376
+ itemProp: "acceptedAnswer",
377
+ className: "aeo-answer",
378
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { itemProp: "text", children })
379
+ }
380
+ )
381
+ ]
382
+ }
383
+ );
384
+ }
385
+ if (type === "definition") {
386
+ return /* @__PURE__ */ jsxRuntime.jsx(
387
+ "section",
388
+ {
389
+ id: blockId,
390
+ className: combinedClasses,
391
+ "data-speakable": speakable ? "true" : void 0,
392
+ "data-aeo-type": type,
393
+ ...sonorAttrs,
394
+ children
395
+ }
396
+ );
397
+ }
398
+ if (type === "steps") {
399
+ return /* @__PURE__ */ jsxRuntime.jsx(
400
+ "section",
401
+ {
402
+ id: blockId,
403
+ className: combinedClasses,
404
+ "data-speakable": speakable ? "true" : void 0,
405
+ "data-aeo-type": type,
406
+ ...sonorAttrs,
407
+ itemScope: true,
408
+ itemType: "https://schema.org/HowTo",
409
+ children
410
+ }
411
+ );
412
+ }
413
+ return /* @__PURE__ */ jsxRuntime.jsx(
414
+ "section",
415
+ {
416
+ id: blockId,
417
+ className: combinedClasses,
418
+ "data-speakable": speakable ? "true" : void 0,
419
+ "data-aeo-type": type,
420
+ ...sonorAttrs,
421
+ children
422
+ }
423
+ );
424
+ }
425
+ function AEOSummary({
426
+ title = "Key Points",
427
+ points,
428
+ speakable = true,
429
+ entityId,
430
+ className = ""
431
+ }) {
432
+ const baseClasses = "aeo-summary";
433
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
434
+ return /* @__PURE__ */ jsxRuntime.jsxs(
435
+ "div",
436
+ {
437
+ className: combinedClasses,
438
+ "data-speakable": speakable ? "true" : void 0,
439
+ "data-aeo-type": "summary",
440
+ "data-sonor-ai": "summary",
441
+ "data-sonor-block": "true",
442
+ ...entityId && { "data-sonor-entity": entityId },
443
+ children: [
444
+ title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-summary-title", children: title }),
445
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "aeo-summary-points", children: points.map((point, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "aeo-summary-point", children: point }, index)) })
446
+ ]
447
+ }
448
+ );
449
+ }
450
+ function AEODefinition({
451
+ term,
452
+ definition,
453
+ speakable = true,
454
+ entityId,
455
+ source,
456
+ className = ""
457
+ }) {
458
+ const baseClasses = "aeo-definition";
459
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
460
+ return /* @__PURE__ */ jsxRuntime.jsxs(
461
+ "dl",
462
+ {
463
+ className: combinedClasses,
464
+ "data-speakable": speakable ? "true" : void 0,
465
+ "data-aeo-type": "definition",
466
+ "data-sonor-ai": "definition",
467
+ "data-sonor-block": "true",
468
+ ...entityId && { "data-sonor-entity": entityId },
469
+ ...source && { "data-sonor-source": source },
470
+ itemScope: true,
471
+ itemType: "https://schema.org/DefinedTerm",
472
+ children: [
473
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "aeo-term", itemProp: "name", children: /* @__PURE__ */ jsxRuntime.jsx("strong", { children: term }) }),
474
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "aeo-definition-text", itemProp: "description", children: definition })
475
+ ]
476
+ }
477
+ );
478
+ }
479
+ function AEOSteps({
480
+ title,
481
+ children,
482
+ speakable = true,
483
+ entityId,
484
+ className = ""
485
+ }) {
486
+ const baseClasses = "aeo-steps";
487
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
488
+ return /* @__PURE__ */ jsxRuntime.jsxs(
489
+ "section",
490
+ {
491
+ className: combinedClasses,
492
+ "data-speakable": speakable ? "true" : void 0,
493
+ "data-aeo-type": "steps",
494
+ "data-sonor-ai": "steps",
495
+ "data-sonor-block": "true",
496
+ ...entityId && { "data-sonor-entity": entityId },
497
+ itemScope: true,
498
+ itemType: "https://schema.org/HowTo",
499
+ children: [
500
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-steps-title", itemProp: "name", children: title }),
501
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "aeo-steps-list", children })
502
+ ]
503
+ }
504
+ );
505
+ }
506
+ function AEOStep({
507
+ number,
508
+ name,
509
+ children
510
+ }) {
511
+ return /* @__PURE__ */ jsxRuntime.jsxs(
512
+ "li",
513
+ {
514
+ className: "aeo-step",
515
+ itemScope: true,
516
+ itemType: "https://schema.org/HowToStep",
517
+ itemProp: "step",
518
+ children: [
519
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "aeo-step-number", itemProp: "position", children: number }),
520
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { className: "aeo-step-name", itemProp: "name", children: name }),
521
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aeo-step-content", itemProp: "text", children })
522
+ ]
523
+ }
524
+ );
525
+ }
526
+ function AEOComparison({
527
+ title,
528
+ items,
529
+ labelA,
530
+ labelB,
531
+ speakable = true,
532
+ entityId,
533
+ className = ""
534
+ }) {
535
+ const baseClasses = "aeo-comparison";
536
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
537
+ return /* @__PURE__ */ jsxRuntime.jsxs(
538
+ "section",
539
+ {
540
+ className: combinedClasses,
541
+ "data-speakable": speakable ? "true" : void 0,
542
+ "data-aeo-type": "comparison",
543
+ "data-sonor-ai": "comparison",
544
+ "data-sonor-block": "true",
545
+ ...entityId && { "data-sonor-entity": entityId },
546
+ children: [
547
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "aeo-comparison-title", children: title }),
548
+ /* @__PURE__ */ jsxRuntime.jsxs("table", { className: "aeo-comparison-table", children: [
549
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
550
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: "Aspect" }),
551
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: labelA }),
552
+ /* @__PURE__ */ jsxRuntime.jsx("th", { children: labelB })
553
+ ] }) }),
554
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: items.map((item, index) => /* @__PURE__ */ jsxRuntime.jsxs("tr", { children: [
555
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-aspect", children: item.aspect }),
556
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-a", children: item.optionA }),
557
+ /* @__PURE__ */ jsxRuntime.jsx("td", { className: "aeo-comparison-b", children: item.optionB })
558
+ ] }, index)) })
559
+ ] })
560
+ ]
561
+ }
562
+ );
563
+ }
564
+ function AEOClaim({
565
+ source,
566
+ sourceUrl,
567
+ confidence = 1,
568
+ claimType = "fact",
569
+ retrievedAt,
570
+ children,
571
+ className = ""
572
+ }) {
573
+ const baseClasses = "aeo-claim";
574
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
575
+ return /* @__PURE__ */ jsxRuntime.jsxs(
576
+ "span",
577
+ {
578
+ className: combinedClasses,
579
+ "data-sonor-claim": "true",
580
+ "data-sonor-source": source,
581
+ ...sourceUrl && { "data-sonor-source-url": sourceUrl },
582
+ "data-sonor-confidence": confidence.toString(),
583
+ "data-sonor-claim-type": claimType,
584
+ ...retrievedAt && { "data-sonor-retrieved": retrievedAt },
585
+ itemScope: true,
586
+ itemType: "https://schema.org/Claim",
587
+ children: [
588
+ /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "text", children }),
589
+ sourceUrl ? /* @__PURE__ */ jsxRuntime.jsx("meta", { itemProp: "citation", content: sourceUrl }) : /* @__PURE__ */ jsxRuntime.jsx("meta", { itemProp: "citation", content: source })
590
+ ]
591
+ }
592
+ );
593
+ }
594
+ function AEOEntity({
595
+ entityId,
596
+ entityType,
597
+ name,
598
+ url,
599
+ children,
600
+ className = ""
601
+ }) {
602
+ const baseClasses = "aeo-entity";
603
+ const combinedClasses = className ? `${baseClasses} aeo-entity-${entityType} ${className}` : `${baseClasses} aeo-entity-${entityType}`;
604
+ return /* @__PURE__ */ jsxRuntime.jsxs(
605
+ "span",
606
+ {
607
+ className: combinedClasses,
608
+ "data-sonor-entity": entityId,
609
+ "data-sonor-entity-type": entityType,
610
+ "data-sonor-entity-name": name,
611
+ ...url && { "data-sonor-entity-url": url },
612
+ itemScope: true,
613
+ itemType: `https://schema.org/${entityType === "organization" ? "Organization" : entityType === "person" ? "Person" : entityType === "location" ? "Place" : "Thing"}`,
614
+ children: [
615
+ /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children }),
616
+ url && /* @__PURE__ */ jsxRuntime.jsx("link", { itemProp: "url", href: url })
617
+ ]
618
+ }
619
+ );
620
+ }
621
+ function AEOProvenanceList({
622
+ sources,
623
+ title = "Sources & References",
624
+ className = ""
625
+ }) {
626
+ const baseClasses = "aeo-provenance-list";
627
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
628
+ const getSchemaType = (sourceType) => {
629
+ switch (sourceType) {
630
+ case "legal_statute":
631
+ return "https://schema.org/Legislation";
632
+ case "research_paper":
633
+ return "https://schema.org/ScholarlyArticle";
634
+ case "news_article":
635
+ return "https://schema.org/NewsArticle";
636
+ case "press_release":
637
+ return "https://schema.org/NewsArticle";
638
+ default:
639
+ return "https://schema.org/CreativeWork";
640
+ }
641
+ };
642
+ return /* @__PURE__ */ jsxRuntime.jsxs(
643
+ "aside",
644
+ {
645
+ className: combinedClasses,
646
+ "data-sonor-provenance": "list",
647
+ "data-sonor-source-count": sources.length.toString(),
648
+ itemScope: true,
649
+ itemType: "https://schema.org/ItemList",
650
+ children: [
651
+ /* @__PURE__ */ jsxRuntime.jsx("h4", { className: "aeo-provenance-title", itemProp: "name", children: title }),
652
+ /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "aeo-provenance-sources", children: sources.map((source, index) => /* @__PURE__ */ jsxRuntime.jsxs(
653
+ "li",
654
+ {
655
+ className: "aeo-provenance-item",
656
+ "data-sonor-source-id": source.id,
657
+ "data-sonor-source-type": source.source_type,
658
+ ...source.confidence && { "data-sonor-confidence": source.confidence.toString() },
659
+ itemScope: true,
660
+ itemType: getSchemaType(source.source_type),
661
+ itemProp: "itemListElement",
662
+ children: [
663
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "aeo-provenance-number", children: [
664
+ "[",
665
+ index + 1,
666
+ "]"
667
+ ] }),
668
+ source.url ? /* @__PURE__ */ jsxRuntime.jsx(
669
+ "a",
670
+ {
671
+ href: source.url,
672
+ className: "aeo-provenance-link",
673
+ itemProp: "url",
674
+ target: "_blank",
675
+ rel: "noopener noreferrer",
676
+ children: /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children: source.title })
677
+ }
678
+ ) : /* @__PURE__ */ jsxRuntime.jsx("span", { itemProp: "name", children: source.title }),
679
+ source.publisher && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "aeo-provenance-publisher", itemProp: "publisher", children: [
680
+ "\u2014 ",
681
+ source.publisher
682
+ ] }),
683
+ source.published_at && /* @__PURE__ */ jsxRuntime.jsxs(
684
+ "time",
685
+ {
686
+ className: "aeo-provenance-date",
687
+ itemProp: "datePublished",
688
+ dateTime: source.published_at,
689
+ children: [
690
+ "(",
691
+ new Date(source.published_at).toLocaleDateString(),
692
+ ")"
693
+ ]
694
+ }
695
+ ),
696
+ source.identifier && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "aeo-provenance-identifier", "data-sonor-identifier": source.identifier, children: source.identifier }),
697
+ source.excerpt && /* @__PURE__ */ jsxRuntime.jsx("blockquote", { className: "aeo-provenance-excerpt", itemProp: "description", children: source.excerpt })
698
+ ]
699
+ },
700
+ source.id
701
+ )) })
702
+ ]
703
+ }
704
+ );
705
+ }
706
+ function AEOCitedContent({
707
+ children,
708
+ sources,
709
+ showSourcesList = true,
710
+ className = ""
711
+ }) {
712
+ const baseClasses = "aeo-cited-content";
713
+ const combinedClasses = className ? `${baseClasses} ${className}` : baseClasses;
714
+ return /* @__PURE__ */ jsxRuntime.jsxs(
715
+ "section",
716
+ {
717
+ className: combinedClasses,
718
+ "data-sonor-ai": "cited-content",
719
+ "data-sonor-provenance": "inline",
720
+ "data-sonor-source-count": sources.length.toString(),
721
+ children: [
722
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "aeo-cited-body", children }),
723
+ showSourcesList && sources.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(AEOProvenanceList, { sources, title: "References" })
724
+ ]
725
+ }
726
+ );
727
+ }
728
+
729
+ exports.AEOBlock = AEOBlock;
730
+ exports.AEOCitedContent = AEOCitedContent;
731
+ exports.AEOClaim = AEOClaim;
732
+ exports.AEOComparison = AEOComparison;
733
+ exports.AEODefinition = AEODefinition;
734
+ exports.AEOEntity = AEOEntity;
735
+ exports.AEOProvenanceList = AEOProvenanceList;
736
+ exports.AEOStep = AEOStep;
737
+ exports.AEOSteps = AEOSteps;
738
+ exports.AEOSummary = AEOSummary;
739
+ exports.DEFAULT_SPEAKABLE_SELECTORS = DEFAULT_SPEAKABLE_SELECTORS;
740
+ exports.SpeakableSchema = SpeakableSchema;
741
+ exports.createLLMsFullTxtHandler = createLLMsFullTxtHandler;
742
+ exports.createLLMsTxtHandler = createLLMsTxtHandler;
743
+ exports.createSpeakableSchema = createSpeakableSchema;
744
+ exports.generateLLMsFullTxt = generateLLMsFullTxt;
745
+ exports.generateLLMsTxt = generateLLMsTxt;
746
+ exports.getBusinessInfo = getBusinessInfo;
747
+ exports.getFAQItems = getFAQItems;
748
+ exports.getLLMsData = getLLMsData;
749
+ exports.getPageSummaries = getPageSummaries;
750
+ exports.getServices = getServices;
751
+ exports.getSpeakableSelectorsForPage = getSpeakableSelectorsForPage;
752
+ //# sourceMappingURL=chunk-VOR53RUR.js.map
753
+ //# sourceMappingURL=chunk-VOR53RUR.js.map