@sonordev/site-kit 8.6.0 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/agent-manifest.json +1 -1
- package/dist/{AnalyticsProvider-GVJYL6XY.js → AnalyticsProvider-3UIQMIRW.js} +6 -6
- package/dist/{ArticleViewTracker-AOJXEBYM.js → ArticleViewTracker-KNXP2DXL.js} +5 -5
- package/dist/{BlocksPopup-AJ3CKVQG.js → BlocksPopup-DFE32GPX.js} +9 -8
- package/dist/{ChatWidget-EYBVB5SZ.js → ChatWidget-L74L4YAD.js} +5 -5
- package/dist/{FileField-UEQYIFRO.js → FileField-P3PLEAON.js} +3 -3
- package/dist/{FormSpotlight-H73ZZ66T.js → FormSpotlight-DNBSBRIE.js} +1 -1
- package/dist/{FormStage-2PLWWYBW.js → FormStage-I4JGLT57.js} +1 -1
- package/dist/{ManagedForm-ZQOFXEWS.js → ManagedForm-GJRGBM6W.js} +6 -6
- package/dist/{ManagedNewsletterForm-5TE47YZD.js → ManagedNewsletterForm-AUZ6YB7G.js} +9 -9
- package/dist/{SignalCore-FEFNMNYN.js → SignalCore-UV7K7PT4.js} +5 -5
- package/dist/SiteChat-6UWE545R.js +6 -0
- package/dist/SiteDesignReporter-ZSU76DZJ.js +13 -0
- package/dist/{SitePopups-C44YTQ3Q.js → SitePopups-XHWU7GNF.js} +6 -6
- package/dist/SitemapSync-ELWV6W7Y.js +9 -0
- package/dist/_client/booking-widget.js +5 -5
- package/dist/affiliates/index.js +3 -3
- package/dist/analytics/content-text.d.ts +17 -0
- package/dist/analytics/index.js +6 -6
- package/dist/{article-styles-VASFBYA3.js → article-styles-D7VCDXMG.js} +2 -1
- package/dist/article-tables-W45BE353.js +3 -0
- package/dist/articles/index.js +7 -20
- package/dist/articles/server-ui.js +29 -55
- package/dist/articles/server.js +6 -5
- package/dist/chat/index.js +8 -8
- package/dist/{chunk-3RDJKIYO.js → chunk-2WDWQI7K.js} +1 -1
- package/dist/{chunk-NI6ZTP3D.js → chunk-36ZMNBXZ.js} +1 -1
- package/dist/chunk-3MJNBOUO.js +8 -0
- package/dist/{chunk-ZZSAWXWD.js → chunk-3MLWIBHX.js} +1 -1
- package/dist/{chunk-BF7TZYC3.js → chunk-52KO4LKD.js} +1 -1
- package/dist/{chunk-U34O6I7W.js → chunk-5WHBYQJ4.js} +3 -3
- package/dist/{chunk-5D7ZISUP.js → chunk-7DYMM6SS.js} +11 -6
- package/dist/{chunk-GFY3E7EQ.js → chunk-7YB3QA4P.js} +15 -7
- package/dist/{chunk-6AWIUO2Z.js → chunk-A2MDVP47.js} +1 -1
- package/dist/{chunk-E4PTMORJ.js → chunk-AL5UCWLI.js} +23 -8
- package/dist/{chunk-O3Z5HHFP.js → chunk-BAJUXQTH.js} +2 -2
- package/dist/{chunk-IGAIQ2B3.js → chunk-BJYX6SFI.js} +2 -2
- package/dist/{chunk-72F44HKL.js → chunk-DJIGFX33.js} +1 -1
- package/dist/{chunk-AJG74ZZV.js → chunk-DPYGC7WE.js} +1 -1
- package/dist/{chunk-XA7Q2VQA.js → chunk-EK7P62DT.js} +1 -1
- package/dist/chunk-FXR5PJDL.js +420 -0
- package/dist/{chunk-OWO3RFEX.js → chunk-G5FD7UXK.js} +1 -1
- package/dist/{chunk-KTMHRXDT.js → chunk-HM7CDWFK.js} +1 -1
- package/dist/{chunk-CMUD37WV.js → chunk-HWQPCZOX.js} +1 -1
- package/dist/{chunk-6KU7STM3.js → chunk-HY7ZEU2C.js} +3 -1
- package/dist/chunk-IBHBEUZV.js +27 -0
- package/dist/{chunk-NUXXFCIT.js → chunk-IXZBOOAD.js} +4 -4
- package/dist/chunk-JESLPEST.js +14 -0
- package/dist/{chunk-BC7JMY4Z.js → chunk-JG53YJLM.js} +58 -1
- package/dist/{chunk-VA6IJ55K.js → chunk-JWCCY72G.js} +1 -1
- package/dist/{chunk-RI2N2EBI.js → chunk-JYITKUUB.js} +13 -5
- package/dist/chunk-KIYACQW3.js +1 -0
- package/dist/{chunk-OFSV5TZY.js → chunk-KLIDCNML.js} +1 -1
- package/dist/{chunk-7R2STOVD.js → chunk-L2KSHJS2.js} +3 -3
- package/dist/{chunk-HMTPRBYJ.js → chunk-LGWN6KCN.js} +1 -1
- package/dist/{chunk-YNBRVVTX.js → chunk-MJW6YIDJ.js} +1 -1
- package/dist/{chunk-BUE3Z32O.js → chunk-MNORERMF.js} +1 -1
- package/dist/{chunk-Y35BWW2C.js → chunk-ODOV76VW.js} +1 -1
- package/dist/{chunk-6NXFA7HE.js → chunk-OHLCE4GC.js} +2 -2
- package/dist/{chunk-QQT2T6JQ.js → chunk-P5PRR2BB.js} +1 -1
- package/dist/{chunk-JJ4JS3LD.js → chunk-PAYCK7FC.js} +1 -1
- package/dist/{chunk-DLM4FFNH.js → chunk-QTBAKOCZ.js} +1 -1
- package/dist/{chunk-L6QTERSH.js → chunk-RHT7OZNF.js} +1 -1
- package/dist/{chunk-YJH6WE76.js → chunk-RWWSOYJO.js} +9 -9
- package/dist/{chunk-JSW42BHL.js → chunk-T6TWPKBL.js} +1 -1
- package/dist/{chunk-FTSEP7Q3.js → chunk-U4OQJQK6.js} +3 -3
- package/dist/{chunk-IYCSDFPN.js → chunk-UYOE3HA4.js} +2 -2
- package/dist/chunk-VEJD5EJ2.js +344 -0
- package/dist/chunk-XAZC2TUD.js +1119 -0
- package/dist/{chunk-DSD3XZQQ.js → chunk-XC2TWYDV.js} +3 -3
- package/dist/{chunk-URJN75ZG.js → chunk-XIDWNXZN.js} +3 -3
- package/dist/chunk-XLAHRN4B.js +1 -0
- package/dist/{chunk-V67OD7RW.js → chunk-XZFOQ2V4.js} +113 -93
- package/dist/{chunk-QNOJSSQT.js → chunk-YYPYLYZM.js} +1 -1
- package/dist/client/index.js +4 -4
- package/dist/contracts/campaign-normalize.d.ts +2 -0
- package/dist/contracts/entries.d.ts +1 -1
- package/dist/contracts/funnels.d.ts +576 -0
- package/dist/contracts/inbox.d.ts +42 -0
- package/dist/contracts/llms.d.ts +200 -0
- package/dist/contracts/portfolio.d.ts +170 -0
- package/dist/contracts/publication-branding.d.ts +10 -2
- package/dist/contracts/site-cache.d.ts +2 -0
- package/dist/fleet/index.js +6 -6
- package/dist/forms/index.js +9 -9
- package/dist/forms/server.js +2 -2
- package/dist/images/index.js +4 -4
- package/dist/index.js +1 -1
- package/dist/landing/contract.d.ts +2 -13
- package/dist/landing/contract.js +2 -0
- package/dist/landing/index.js +4 -2
- package/dist/landing/managed-server.d.ts +21 -0
- package/dist/landing/managed.d.ts +11 -0
- package/dist/landing/metadata.js +2 -0
- package/dist/landing/server.d.ts +5 -0
- package/dist/landing/server.js +19 -2
- package/dist/layout/client.js +9 -9
- package/dist/layout/index.js +10 -10
- package/dist/llms/contract.js +2 -1
- package/dist/llms/index.js +9 -7
- package/dist/llms/merge.d.ts +29 -0
- package/dist/maps/index.js +3 -3
- package/dist/mcp/sonor.js +9 -8
- package/dist/portfolio/contract.js +1 -1
- package/dist/press-kit/articles/article-body.d.ts +13 -0
- package/dist/press-kit/articles/article-heading-ids.d.ts +7 -0
- package/dist/press-kit/articles/article-headings.d.ts +61 -0
- package/dist/press-kit/articles/html-tags.d.ts +46 -0
- package/dist/press-kit/articles/types.d.ts +2 -0
- package/dist/revalidate/index.js +3 -3
- package/dist/runtime/index.js +3 -3
- package/dist/seo/client.js +6 -6
- package/dist/seo/index.js +14 -13
- package/dist/seo/llms/contract.js +2 -1
- package/dist/seo/llms.js +9 -7
- package/dist/seo/meta/contract.js +2 -1
- package/dist/seo/register-sitemap-cli.js +1 -1
- package/dist/seo/server.js +5 -4
- package/dist/seo/sitemap.js +7 -5
- package/dist/seo-meta/contract.js +2 -1
- package/dist/server/index.js +3 -3
- package/dist/{server-api-EGOKC7Q3.js → server-api-XIKDWSNO.js} +2 -2
- package/dist/shared/build-entries.d.ts +3 -1
- package/dist/shared/markdown.d.ts +7 -6
- package/dist/shared/version.d.ts +1 -1
- package/dist/signal/index.js +2 -2
- package/dist/sitemap/index.js +7 -5
- package/dist/slots/index.js +2 -2
- package/dist/sync/index.js +5 -5
- package/dist/website/contract.js +2 -1
- package/dist/website/images.js +4 -4
- package/dist/website/index.js +10 -9
- package/dist/website/landing/server.js +19 -2
- package/dist/website/landing.js +4 -2
- package/dist/website/popups.js +9 -8
- package/dist/website/slots.js +2 -2
- package/dist/{writeLLMsTxt-KHVHNSDM.js → writeLLMsTxt-QN2HIVT4.js} +6 -4
- package/docs.json +5 -0
- package/package.json +1 -1
- package/src/analytics/README.md +1 -1
- package/src/landing/README.md +64 -0
- package/src/llms/README.md +52 -20
- package/dist/SiteChat-3MKYL2XM.js +0 -6
- package/dist/SiteDesignReporter-AJDIBNHI.js +0 -12
- package/dist/SitemapSync-UJA6JVPW.js +0 -9
- package/dist/article-tables-6XHVULPU.js +0 -2
- package/dist/chunk-EKBEOXTH.js +0 -114
- package/dist/chunk-NZ4RXN3G.js +0 -145
- package/dist/chunk-OSYCOC3K.js +0 -21
- /package/dist/{chunk-7ZWO5HDQ.js → chunk-BTHEQDN4.js} +0 -0
- /package/dist/{chunk-BQR4IPBW.js → chunk-ISRBSTB7.js} +0 -0
- /package/dist/{chunk-IHG36STL.js → chunk-XHYE24HU.js} +0 -0
package/dist/chat/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { ChatWidget, DEFAULT_LAUNCHER_OFFSET_BOTTOM, EchoChat, chatLauncherStyles, isChatEnabled } from '../chunk-
|
|
3
|
-
export { SiteChat } from '../chunk-
|
|
2
|
+
export { ChatWidget, DEFAULT_LAUNCHER_OFFSET_BOTTOM, EchoChat, chatLauncherStyles, isChatEnabled } from '../chunk-BJYX6SFI.js';
|
|
3
|
+
export { SiteChat } from '../chunk-BAJUXQTH.js';
|
|
4
4
|
import '../chunk-6T6CQVNL.js';
|
|
5
5
|
import '../chunk-JE4A5S4F.js';
|
|
6
6
|
import '../chunk-27FISYK4.js';
|
|
7
|
-
import '../chunk-
|
|
7
|
+
import '../chunk-LGWN6KCN.js';
|
|
8
8
|
import '../chunk-Q6E4OPGG.js';
|
|
9
9
|
import '../chunk-5ROTTMBL.js';
|
|
10
10
|
import '../chunk-C2FZBUSS.js';
|
|
@@ -15,12 +15,12 @@ import '../chunk-S22FSH7C.js';
|
|
|
15
15
|
import '../chunk-L2V5PUFN.js';
|
|
16
16
|
import '../chunk-GJWI74ZZ.js';
|
|
17
17
|
import '../chunk-5TM3WPCI.js';
|
|
18
|
-
import '../chunk-
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
21
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-QTBAKOCZ.js';
|
|
19
|
+
import '../chunk-VEJD5EJ2.js';
|
|
20
|
+
import '../chunk-UYOE3HA4.js';
|
|
21
|
+
import '../chunk-P5PRR2BB.js';
|
|
22
22
|
import '../chunk-W7OPEMGJ.js';
|
|
23
|
-
import '../chunk-
|
|
23
|
+
import '../chunk-MNORERMF.js';
|
|
24
24
|
import '../chunk-PKBMQBKP.js';
|
|
25
25
|
|
|
26
26
|
// src/chat/echo-config.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SLOTS_CONTRACT_VERSION, verifySlotContent, canonicalJson } from './chunk-VCJYLYJV.js';
|
|
2
2
|
import { isValidSlotId, SLOT_CONTENT_MAX_LENGTH, parseSlotRichText, normalizeSlotValue } from './chunk-LPH5FANE.js';
|
|
3
|
-
import { SITE_CACHE_TAGS } from './chunk-
|
|
3
|
+
import { SITE_CACHE_TAGS } from './chunk-HY7ZEU2C.js';
|
|
4
4
|
import { resolveServerApiConfig } from './chunk-C7TLGL3R.js';
|
|
5
5
|
import 'server-only';
|
|
6
6
|
import * as React from 'react';
|
|
@@ -22,7 +22,7 @@ function useFieldControls(fields) {
|
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
24
|
if (needsFile) {
|
|
25
|
-
import('./FileField-
|
|
25
|
+
import('./FileField-P3PLEAON.js').then((m) => {
|
|
26
26
|
if (!cancelled) setControls((prev) => ({ ...prev, File: m.FileField }));
|
|
27
27
|
}).catch(() => {
|
|
28
28
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/contracts/campaign-normalize.ts
|
|
2
|
+
function normalizeCampaignSlug(input) {
|
|
3
|
+
if (!input || typeof input !== "string") return null;
|
|
4
|
+
const slug = input.trim().toLowerCase().replace(/[\s_]+/g, "-").replace(/[^a-z0-9-]/g, "").replace(/-{2,}/g, "-").replace(/^-+|-+$/g, "").slice(0, 80);
|
|
5
|
+
return slug || null;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { normalizeCampaignSlug };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { writeLLMsTxtToPublic } from './chunk-
|
|
1
|
+
import { writeLLMsTxtToPublic } from './chunk-XZFOQ2V4.js';
|
|
2
2
|
import { getSiteConfig } from './chunk-Z22QVHT4.js';
|
|
3
3
|
import { buildFetch } from './chunk-UAYAJPEP.js';
|
|
4
4
|
import { findAppDirForDiscovery } from './chunk-ZEGVKVD5.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import { normalizeDesignTokens, designTokenCssVars, sanitizePopupHtml, isSafePopupUrl } from './chunk-
|
|
2
|
+
import { normalizeDesignTokens, designTokenCssVars, sanitizePopupHtml, isSafePopupUrl } from './chunk-XHYE24HU.js';
|
|
3
3
|
import { useId, useRef, useEffect } from 'react';
|
|
4
4
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { sanitizeFleetVersion, buildFleetHeartbeatPayload } from './chunk-ZTZQPYP6.js';
|
|
3
3
|
import { useDeferredActivation } from './chunk-YC7ELZS3.js';
|
|
4
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
5
|
-
import { sonorFetch } from './chunk-
|
|
6
|
-
import { SITE_KIT_VERSION } from './chunk-
|
|
4
|
+
import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
|
|
5
|
+
import { sonorFetch } from './chunk-UYOE3HA4.js';
|
|
6
|
+
import { SITE_KIT_VERSION } from './chunk-MNORERMF.js';
|
|
7
7
|
import { useRef, useEffect } from 'react';
|
|
8
8
|
|
|
9
9
|
// src/fleet/heartbeat.ts
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { htmlTags, isClosingTag, htmlTagName, openTagAttributes } from './chunk-IBHBEUZV.js';
|
|
2
|
+
|
|
1
3
|
// packages/press-kit/src/articles/processArticleHtml.ts
|
|
2
4
|
function linkClassificationHost(siteUrl) {
|
|
3
5
|
try {
|
|
@@ -24,20 +26,23 @@ function addExternalLinkTargets(html, siteUrl) {
|
|
|
24
26
|
if (!html || !siteUrl) return html;
|
|
25
27
|
const siteHost = linkClassificationHost(siteUrl);
|
|
26
28
|
if (!siteHost) return html;
|
|
27
|
-
return html.replace(
|
|
29
|
+
return html.replace(htmlTags(), (tag) => {
|
|
30
|
+
if (isClosingTag(tag) || htmlTagName(tag) !== "a") return tag;
|
|
31
|
+
const attrs = openTagAttributes(tag);
|
|
32
|
+
const unchanged = `<a${attrs}>`;
|
|
28
33
|
const hrefMatch = attrs.match(/\bhref\s*=\s*(["'])([^"']*)\1/i);
|
|
29
|
-
if (!hrefMatch) return
|
|
34
|
+
if (!hrefMatch) return unchanged;
|
|
30
35
|
const href = hrefMatch[2].trim();
|
|
31
|
-
if (!/^https?:\/\//i.test(href)) return
|
|
36
|
+
if (!/^https?:\/\//i.test(href)) return unchanged;
|
|
32
37
|
try {
|
|
33
38
|
const url = new URL(href);
|
|
34
39
|
const linkHost = url.hostname.replace(/^www\./i, "").toLowerCase();
|
|
35
|
-
if (linkHost === siteHost) return
|
|
36
|
-
if (/\btarget\s*=/i.test(attrs)) return
|
|
40
|
+
if (linkHost === siteHost) return unchanged;
|
|
41
|
+
if (/\btarget\s*=/i.test(attrs)) return unchanged;
|
|
37
42
|
const trimmed = attrs.trim();
|
|
38
43
|
return `<a ${trimmed} target="_blank" rel="noopener noreferrer">`;
|
|
39
44
|
} catch {
|
|
40
|
-
return
|
|
45
|
+
return unchanged;
|
|
41
46
|
}
|
|
42
47
|
});
|
|
43
48
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { registerAnalyticsDispatcher } from './chunk-LCDVPAMR.js';
|
|
3
3
|
import { getOrCreateVisitorId, getOrCreateSessionId } from './chunk-IPQKQEWI.js';
|
|
4
4
|
import { onPageLeave } from './chunk-L2V5PUFN.js';
|
|
5
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
6
|
-
import { sonorFetch, sonorBeacon } from './chunk-
|
|
5
|
+
import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
|
|
6
|
+
import { sonorFetch, sonorBeacon } from './chunk-UYOE3HA4.js';
|
|
7
7
|
import { createContext, useRef, useEffect, useState, useMemo, useCallback, useContext } from 'react';
|
|
8
8
|
import { usePathname } from 'next/navigation';
|
|
9
9
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -228,6 +228,18 @@ function WebVitals({
|
|
|
228
228
|
}, []);
|
|
229
229
|
return null;
|
|
230
230
|
}
|
|
231
|
+
|
|
232
|
+
// src/analytics/content-text.ts
|
|
233
|
+
var BLOCK_ELEMENTS = "address, article, aside, blockquote, dd, details, div, dl, dt, fieldset, figcaption, figure, h1, h2, h3, h4, h5, h6, hr, li, ol, p, pre, section, summary, table, td, th, tr, ul";
|
|
234
|
+
var NOT_CONTENT = 'script, style, noscript, template, svg, nav, header, footer, label, button, input, select, textarea, option, [role="navigation"], [role="banner"], [role="contentinfo"], [role="dialog"], [role="alert"]';
|
|
235
|
+
var CONTENT_TEXT_MAX_LENGTH = 1e4;
|
|
236
|
+
function extractContentText(root) {
|
|
237
|
+
const clone = root.cloneNode(true);
|
|
238
|
+
clone.querySelectorAll(NOT_CONTENT).forEach((el) => el.remove());
|
|
239
|
+
clone.querySelectorAll("br").forEach((br) => br.replaceWith(" "));
|
|
240
|
+
clone.querySelectorAll(BLOCK_ELEMENTS).forEach((el) => el.append(" "));
|
|
241
|
+
return (clone.textContent || "").replace(/\s+/g, " ").trim().slice(0, CONTENT_TEXT_MAX_LENGTH);
|
|
242
|
+
}
|
|
231
243
|
var AnalyticsContext = createContext(null);
|
|
232
244
|
function scheduleIdleTask(callback, timeout = 2e3) {
|
|
233
245
|
if (typeof window !== "undefined" && "requestIdleCallback" in window) {
|
|
@@ -485,11 +497,7 @@ function getContentPageMetadata() {
|
|
|
485
497
|
};
|
|
486
498
|
const getContentText = () => {
|
|
487
499
|
const main = document.querySelector('main, article, [role="main"]') || document.body;
|
|
488
|
-
const
|
|
489
|
-
clone.querySelectorAll('script, style, nav, header, footer, [role="navigation"], [role="banner"], [role="contentinfo"]').forEach((el) => el.remove());
|
|
490
|
-
let text = clone.textContent || "";
|
|
491
|
-
text = text.replace(/\s+/g, " ").trim();
|
|
492
|
-
text = text.slice(0, 1e4);
|
|
500
|
+
const text = extractContentText(main);
|
|
493
501
|
let hash = 0;
|
|
494
502
|
for (let i = 0; i < text.length; i++) {
|
|
495
503
|
const chr = text.charCodeAt(i);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { htmlTags, htmlTagName, isClosingTag } from './chunk-IBHBEUZV.js';
|
|
2
|
+
|
|
1
3
|
// packages/press-kit/src/articles/article-tables.ts
|
|
2
4
|
var tableScrollClass = "sk-article-table-scroll";
|
|
3
5
|
var legacyTableScrollClass = "sk-blog-table-scroll";
|
|
@@ -18,9 +20,6 @@ var voidElements = /* @__PURE__ */ new Set([
|
|
|
18
20
|
"wbr"
|
|
19
21
|
]);
|
|
20
22
|
var preservedElements = /* @__PURE__ */ new Set(["pre", "code", "script", "style", "textarea", "xmp", "template"]);
|
|
21
|
-
function htmlTags() {
|
|
22
|
-
return /<!--[\s\S]*?(?:-->|$)|<\/?[a-z][\w:-]*(?=[\s/>])(?:[^"'<>]|"[^"]*"|'[^']*')*>/gi;
|
|
23
|
-
}
|
|
24
23
|
function hasScrollClass(tag) {
|
|
25
24
|
const attributes = tag.replace(/^<[\w:-]+/, "").replace(/\/?>$/, "");
|
|
26
25
|
const pattern = /([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/g;
|
|
@@ -31,14 +30,30 @@ function hasScrollClass(tag) {
|
|
|
31
30
|
return false;
|
|
32
31
|
}
|
|
33
32
|
function labelText(html) {
|
|
34
|
-
return html.replace(
|
|
33
|
+
return html.replace(htmlTags(), (token) => token.startsWith("<!--") ? "" : " ").replace(/\s+/g, " ").trim();
|
|
35
34
|
}
|
|
36
35
|
function escapeLabel(text) {
|
|
37
36
|
return text.replace(/&(?!(?:#\d+|#x[\da-f]+|[a-z][\da-z]+);)/gi, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
38
37
|
}
|
|
38
|
+
function elementContents(table, name) {
|
|
39
|
+
const tags = htmlTags();
|
|
40
|
+
const contents = [];
|
|
41
|
+
let from = -1;
|
|
42
|
+
let token;
|
|
43
|
+
while (token = tags.exec(table)) {
|
|
44
|
+
if (htmlTagName(token[0]) !== name) continue;
|
|
45
|
+
if (!isClosingTag(token[0])) {
|
|
46
|
+
if (from < 0) from = tags.lastIndex;
|
|
47
|
+
} else if (from >= 0) {
|
|
48
|
+
contents.push(table.slice(from, token.index));
|
|
49
|
+
from = -1;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return contents;
|
|
53
|
+
}
|
|
39
54
|
function tableLabel(table, number) {
|
|
40
|
-
const caption = table
|
|
41
|
-
const headers =
|
|
55
|
+
const caption = elementContents(table, "caption")[0];
|
|
56
|
+
const headers = elementContents(table, "th").slice(0, 4).map(labelText).filter(Boolean).join(", ");
|
|
42
57
|
const summary = labelText(caption || headers).slice(0, 180);
|
|
43
58
|
return escapeLabel(`Table ${number}${summary ? `: ${summary}` : ""}`);
|
|
44
59
|
}
|
|
@@ -50,8 +65,8 @@ function wrapArticleTables(html) {
|
|
|
50
65
|
let token;
|
|
51
66
|
while (token = tags.exec(html)) {
|
|
52
67
|
const tag = token[0];
|
|
53
|
-
|
|
54
|
-
|
|
68
|
+
const tagName = htmlTagName(tag);
|
|
69
|
+
if (!tagName) continue;
|
|
55
70
|
if (tag.startsWith("</")) {
|
|
56
71
|
const index = stack.map((frame3) => frame3.tag).lastIndexOf(tagName);
|
|
57
72
|
if (index < 0) continue;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
|
|
3
|
-
import { resolveAnalyticsTarget } from './chunk-
|
|
3
|
+
import { resolveAnalyticsTarget } from './chunk-QTBAKOCZ.js';
|
|
4
4
|
import { useState, useEffect } from 'react';
|
|
5
5
|
import ReactDOM from 'react-dom';
|
|
6
6
|
import dynamic from 'next/dynamic';
|
|
7
7
|
import { jsx } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
var LazyChatWidget = dynamic(
|
|
10
|
-
() => import('./ChatWidget-
|
|
10
|
+
() => import('./ChatWidget-L74L4YAD.js').then((m) => ({ default: m.ChatWidget })),
|
|
11
11
|
{ ssr: false }
|
|
12
12
|
);
|
|
13
13
|
function SiteChat(props) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { VISUAL_VIEWPORT_GAP_PROPERTY } from './chunk-6T6CQVNL.js';
|
|
3
3
|
import { GlassStyles } from './chunk-JE4A5S4F.js';
|
|
4
4
|
import { DEFAULT_WIDGET_Z_INDEX } from './chunk-27FISYK4.js';
|
|
5
|
-
import { useForm } from './chunk-
|
|
5
|
+
import { useForm } from './chunk-LGWN6KCN.js';
|
|
6
6
|
import { parseColor, relativeLuminance, DARK_LUMINANCE, contrastRatio } from './chunk-S22FSH7C.js';
|
|
7
|
-
import { sonorFetch } from './chunk-
|
|
7
|
+
import { sonorFetch } from './chunk-UYOE3HA4.js';
|
|
8
8
|
import { readPublishedApiConfig } from './chunk-W7OPEMGJ.js';
|
|
9
9
|
import { useState, useEffect, useRef, useLayoutEffect, useCallback, Fragment as Fragment$1 } from 'react';
|
|
10
10
|
import { lexer } from 'marked';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { freshFetch } from './chunk-UAYAJPEP.js';
|
|
2
|
-
import { LLM_GEO_CONTRACT_VERSION } from './chunk-
|
|
2
|
+
import { LLM_GEO_CONTRACT_VERSION } from './chunk-XAZC2TUD.js';
|
|
3
3
|
import { withSiteParam } from './chunk-MJP63SSS.js';
|
|
4
4
|
import { getClientApiConfig } from './chunk-W7OPEMGJ.js';
|
|
5
5
|
import { cache } from 'react';
|