@jmp-technologies/analytics 0.1.38 → 0.1.40
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/README.md +6 -2
- package/ai-crawler-agents.json +63 -0
- package/dist/astro/client.cjs +257 -6
- package/dist/astro/client.cjs.map +1 -1
- package/dist/astro/client.d.cts +2 -2
- package/dist/astro/client.d.ts +2 -2
- package/dist/astro/client.js +1 -1
- package/dist/astro/content.cjs +264 -7
- package/dist/astro/content.cjs.map +1 -1
- package/dist/astro/content.d.cts +3 -3
- package/dist/astro/content.d.ts +3 -3
- package/dist/astro/content.js +2 -2
- package/dist/astro/integration.cjs +257 -6
- package/dist/astro/integration.cjs.map +1 -1
- package/dist/astro/integration.js +2 -2
- package/dist/astro/middleware.d.cts +2 -2
- package/dist/astro/middleware.d.ts +2 -2
- package/dist/astro/register.cjs +257 -6
- package/dist/astro/register.cjs.map +1 -1
- package/dist/astro/register.js +2 -2
- package/dist/{chunk-WHUHCTBQ.js → chunk-34LFIP3R.js} +2 -2
- package/dist/{chunk-NCF3J4HV.js → chunk-BRLCGVFJ.js} +2 -2
- package/dist/{chunk-PQOTEV6O.js → chunk-IY6Y636W.js} +2 -2
- package/dist/{chunk-EBU4DKHW.js → chunk-JC3G4XNR.js} +333 -8
- package/dist/chunk-JC3G4XNR.js.map +1 -0
- package/dist/{chunk-JVFN7MF2.js → chunk-VSZRQSUN.js} +2 -2
- package/dist/constants-DTZMYgi4.d.cts +12 -0
- package/dist/constants-DTZMYgi4.d.ts +12 -0
- package/dist/{create-jmp-analytics-DMSXmVIH.d.cts → create-jmp-analytics-B7VqQJca.d.cts} +1 -1
- package/dist/{create-jmp-analytics-JZ3pqNBQ.d.ts → create-jmp-analytics-BGt16QGY.d.ts} +1 -1
- package/dist/index.cjs +340 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -13
- package/dist/index.d.ts +31 -13
- package/dist/index.js +17 -1
- package/dist/next/content.cjs +268 -7
- package/dist/next/content.cjs.map +1 -1
- package/dist/next/content.d.cts +3 -2
- package/dist/next/content.d.ts +3 -2
- package/dist/next/content.js +7 -2
- package/dist/next/content.js.map +1 -1
- package/dist/next/instrumentation.cjs +257 -6
- package/dist/next/instrumentation.cjs.map +1 -1
- package/dist/next/instrumentation.js +1 -1
- package/dist/next/landing-pages.cjs +264 -7
- package/dist/next/landing-pages.cjs.map +1 -1
- package/dist/next/landing-pages.d.cts +2 -2
- package/dist/next/landing-pages.d.ts +2 -2
- package/dist/next/landing-pages.js +2 -2
- package/dist/next/locations.cjs +265 -8
- package/dist/next/locations.cjs.map +1 -1
- package/dist/next/locations.d.cts +3 -3
- package/dist/next/locations.d.ts +3 -3
- package/dist/next/locations.js +3 -3
- package/dist/next/locations.js.map +1 -1
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.cts +2 -2
- package/dist/next/middleware.d.ts +2 -2
- package/dist/next/middleware.js.map +1 -1
- package/dist/next/site-root-server.cjs +264 -7
- package/dist/next/site-root-server.cjs.map +1 -1
- package/dist/next/site-root-server.d.cts +1 -1
- package/dist/next/site-root-server.d.ts +1 -1
- package/dist/next/site-root-server.js +3 -3
- package/dist/next/site-root-server.js.map +1 -1
- package/dist/next.cjs +257 -6
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +3 -3
- package/dist/next.d.ts +3 -3
- package/dist/next.js +3 -3
- package/dist/react.cjs +257 -6
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +2 -2
- package/dist/{site-config-BZJS8Hp_.d.cts → site-config-CZl4PIbg.d.cts} +1 -1
- package/dist/{site-config-BLnwuRC2.d.ts → site-config-Cq5K8hUp.d.ts} +1 -1
- package/dist/{track-page-view-DGKRUIxm.d.ts → track-page-view-BSlE0yI9.d.ts} +1 -1
- package/dist/{track-page-view-BJQqn2Bg.d.cts → track-page-view-M9y_5WqT.d.cts} +1 -1
- package/dist/{types-CYrgEwUF.d.ts → types-DH_8sBu9.d.cts} +35 -0
- package/dist/{types-CYrgEwUF.d.cts → types-DH_8sBu9.d.ts} +35 -0
- package/dist/{utils-B1Nt3sBU.d.ts → utils-C2JRomti.d.ts} +1 -1
- package/dist/{utils-U6TGMIAB.d.cts → utils-JfjoqC-z.d.cts} +1 -1
- package/package.json +2 -1
- package/dist/chunk-EBU4DKHW.js.map +0 -1
- /package/dist/{chunk-WHUHCTBQ.js.map → chunk-34LFIP3R.js.map} +0 -0
- /package/dist/{chunk-NCF3J4HV.js.map → chunk-BRLCGVFJ.js.map} +0 -0
- /package/dist/{chunk-PQOTEV6O.js.map → chunk-IY6Y636W.js.map} +0 -0
- /package/dist/{chunk-JVFN7MF2.js.map → chunk-VSZRQSUN.js.map} +0 -0
|
@@ -153,12 +153,14 @@ function extractMailtoTarget(href) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// package.json
|
|
156
|
-
var version = "0.1.
|
|
156
|
+
var version = "0.1.40";
|
|
157
157
|
|
|
158
158
|
// src/constants.ts
|
|
159
159
|
var JMP_ANALYTICS_SDK_VERSION = version;
|
|
160
160
|
var JMP_TRACKING_CONSENT_STORAGE_KEY = "jmp_analytics_consent_v1";
|
|
161
161
|
var DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS = 2500;
|
|
162
|
+
var JMP_CONTENT_CACHE_TAG = "jmp-content";
|
|
163
|
+
var JMP_CONTENT_REVALIDATE_SECONDS = 3600;
|
|
162
164
|
|
|
163
165
|
// src/consent.ts
|
|
164
166
|
var moduleTrackingConsentGranted = true;
|
|
@@ -694,7 +696,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
694
696
|
const externalSources = normalizeExternalSources(input.externalSources);
|
|
695
697
|
const trust = normalizeTrust(input.trust);
|
|
696
698
|
const contact = normalizeContact(input.contact);
|
|
697
|
-
|
|
699
|
+
const defaults = normalizeManifestDefaults(input.defaults);
|
|
700
|
+
if (routes.length === 0 && !externalSources && !trust && !contact && !defaults) {
|
|
698
701
|
return null;
|
|
699
702
|
}
|
|
700
703
|
return {
|
|
@@ -702,7 +705,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
702
705
|
...routes.length > 0 ? { routes } : {},
|
|
703
706
|
...externalSources ? { externalSources } : {},
|
|
704
707
|
...trust ? { trust } : {},
|
|
705
|
-
...contact ? { contact } : {}
|
|
708
|
+
...contact ? { contact } : {},
|
|
709
|
+
...defaults ? { defaults } : {}
|
|
706
710
|
};
|
|
707
711
|
}
|
|
708
712
|
function normalizeRoutes(routes) {
|
|
@@ -766,10 +770,132 @@ function normalizeTrustLabels(labels) {
|
|
|
766
770
|
}
|
|
767
771
|
return Object.keys(out).length > 0 ? out : null;
|
|
768
772
|
}
|
|
773
|
+
function readDefaultText(value, max = 500) {
|
|
774
|
+
if (typeof value !== "string") return void 0;
|
|
775
|
+
const trimmed = value.trim();
|
|
776
|
+
if (!trimmed) return void 0;
|
|
777
|
+
return trimmed.slice(0, max);
|
|
778
|
+
}
|
|
779
|
+
function normalizeManifestDefaults(defaults) {
|
|
780
|
+
if (!defaults || typeof defaults !== "object") return null;
|
|
781
|
+
const contactRaw = defaults.contact;
|
|
782
|
+
const contact = {};
|
|
783
|
+
if (contactRaw && typeof contactRaw === "object") {
|
|
784
|
+
const displayName = readDefaultText(contactRaw.displayName, 120);
|
|
785
|
+
const email = readDefaultText(contactRaw.email, 200);
|
|
786
|
+
const phone = readDefaultText(contactRaw.phone, 40);
|
|
787
|
+
const address = readDefaultText(contactRaw.address, 400);
|
|
788
|
+
const hours = readDefaultText(contactRaw.hours, 400);
|
|
789
|
+
const serviceArea = readDefaultText(contactRaw.serviceArea, 200);
|
|
790
|
+
const googleMapsUrl = readDefaultText(contactRaw.googleMapsUrl, 2048);
|
|
791
|
+
const linkedinUrl = readDefaultText(contactRaw.linkedinUrl, 2048);
|
|
792
|
+
const instagramUrl = readDefaultText(contactRaw.instagramUrl, 2048);
|
|
793
|
+
const facebookUrl = readDefaultText(contactRaw.facebookUrl, 2048);
|
|
794
|
+
const xUrl = readDefaultText(contactRaw.xUrl, 2048);
|
|
795
|
+
const youtubeUrl = readDefaultText(contactRaw.youtubeUrl, 2048);
|
|
796
|
+
if (displayName) contact.displayName = displayName;
|
|
797
|
+
if (email) contact.email = email;
|
|
798
|
+
if (phone) contact.phone = phone;
|
|
799
|
+
if (address) contact.address = address;
|
|
800
|
+
if (hours) contact.hours = hours;
|
|
801
|
+
if (serviceArea) contact.serviceArea = serviceArea;
|
|
802
|
+
if (googleMapsUrl) contact.googleMapsUrl = googleMapsUrl;
|
|
803
|
+
if (linkedinUrl) contact.linkedinUrl = linkedinUrl;
|
|
804
|
+
if (instagramUrl) contact.instagramUrl = instagramUrl;
|
|
805
|
+
if (facebookUrl) contact.facebookUrl = facebookUrl;
|
|
806
|
+
if (xUrl) contact.xUrl = xUrl;
|
|
807
|
+
if (youtubeUrl) contact.youtubeUrl = youtubeUrl;
|
|
808
|
+
if (contactRaw.extras && typeof contactRaw.extras === "object") {
|
|
809
|
+
const extras = {};
|
|
810
|
+
for (const [rawKey, rawValue] of Object.entries(contactRaw.extras)) {
|
|
811
|
+
if (Object.keys(extras).length >= 10) break;
|
|
812
|
+
const key = normalizeKey(rawKey);
|
|
813
|
+
const value = readDefaultText(rawValue, 200);
|
|
814
|
+
if (key && isValidExtraKey(key) && value) extras[key] = value;
|
|
815
|
+
}
|
|
816
|
+
if (Object.keys(extras).length > 0) contact.extras = extras;
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
const faq = [];
|
|
820
|
+
if (Array.isArray(defaults.faq)) {
|
|
821
|
+
for (const raw of defaults.faq) {
|
|
822
|
+
if (!raw || typeof raw !== "object" || faq.length >= 40) continue;
|
|
823
|
+
const question = readDefaultText(raw.question, 300);
|
|
824
|
+
const answer = readDefaultText(raw.answer, 8e3);
|
|
825
|
+
if (!question || !answer) continue;
|
|
826
|
+
const category = readDefaultText(raw.category, 80);
|
|
827
|
+
faq.push({ question, answer, ...category ? { category } : {} });
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
const trustRaw = defaults.trust;
|
|
831
|
+
const trust = {};
|
|
832
|
+
if (trustRaw && typeof trustRaw === "object") {
|
|
833
|
+
const assign = (key, max) => {
|
|
834
|
+
const value = readDefaultText(trustRaw[key], max);
|
|
835
|
+
if (value) trust[key] = value;
|
|
836
|
+
};
|
|
837
|
+
assign("googleReviewsUrl", 2048);
|
|
838
|
+
assign("googlePlaceId", 128);
|
|
839
|
+
assign("yelpUrl", 2048);
|
|
840
|
+
assign("trustpilotUrl", 2048);
|
|
841
|
+
assign("disclaimer", 1e3);
|
|
842
|
+
}
|
|
843
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
844
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
845
|
+
if (!hasContact && faq.length === 0 && !hasTrust) return null;
|
|
846
|
+
return {
|
|
847
|
+
...hasContact ? { contact } : {},
|
|
848
|
+
...faq.length > 0 ? { faq } : {},
|
|
849
|
+
...hasTrust ? { trust } : {}
|
|
850
|
+
};
|
|
851
|
+
}
|
|
769
852
|
function normalizeContact(contact) {
|
|
770
853
|
if (!contact || typeof contact !== "object") return null;
|
|
771
854
|
const extras = normalizeContactExtras(contact.extras);
|
|
772
|
-
|
|
855
|
+
const leadInbox = normalizeLeadInbox(contact.leadInbox);
|
|
856
|
+
if (extras.length === 0 && !leadInbox) return null;
|
|
857
|
+
return {
|
|
858
|
+
...extras.length > 0 ? { extras } : {},
|
|
859
|
+
...leadInbox ? { leadInbox } : {}
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
function normalizeLeadInbox(raw) {
|
|
863
|
+
if (!raw || typeof raw !== "object") return null;
|
|
864
|
+
const list = normalizeInboxKeyList(raw.list, 8);
|
|
865
|
+
const detail = normalizeInboxKeyList(raw.detail, 24);
|
|
866
|
+
const labels = normalizeInboxLabels(raw.labels);
|
|
867
|
+
if (!list && !detail && !labels) return null;
|
|
868
|
+
return {
|
|
869
|
+
...list ? { list } : {},
|
|
870
|
+
...detail ? { detail } : {},
|
|
871
|
+
...labels ? { labels } : {}
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function normalizeInboxKeyList(raw, max) {
|
|
875
|
+
if (!Array.isArray(raw)) return void 0;
|
|
876
|
+
const seen = /* @__PURE__ */ new Set();
|
|
877
|
+
const out = [];
|
|
878
|
+
for (const item of raw) {
|
|
879
|
+
if (typeof item !== "string" || out.length >= max) continue;
|
|
880
|
+
const key = item.trim();
|
|
881
|
+
const token = key.replace(/[^a-zA-Z0-9]+/g, "").toLowerCase();
|
|
882
|
+
if (!key || !token || seen.has(token)) continue;
|
|
883
|
+
seen.add(token);
|
|
884
|
+
out.push(key);
|
|
885
|
+
}
|
|
886
|
+
return out.length > 0 ? out : void 0;
|
|
887
|
+
}
|
|
888
|
+
function normalizeInboxLabels(raw) {
|
|
889
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
890
|
+
const out = {};
|
|
891
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
892
|
+
if (typeof value !== "string") continue;
|
|
893
|
+
const label = value.trim().slice(0, 60);
|
|
894
|
+
const token = key.trim();
|
|
895
|
+
if (!token || !label) continue;
|
|
896
|
+
out[token] = label;
|
|
897
|
+
}
|
|
898
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
773
899
|
}
|
|
774
900
|
function normalizeContactExtras(extras) {
|
|
775
901
|
if (!Array.isArray(extras)) return [];
|
|
@@ -799,7 +925,7 @@ function inferWrapperSlotsFromManifest(manifest) {
|
|
|
799
925
|
slots.add(`trust.${block.section}`);
|
|
800
926
|
slots.add("trust");
|
|
801
927
|
}
|
|
802
|
-
if (manifest?.contact?.extras?.length) {
|
|
928
|
+
if (manifest?.contact?.extras?.length || manifest?.contact?.leadInbox) {
|
|
803
929
|
slots.add("contact");
|
|
804
930
|
}
|
|
805
931
|
return [...slots];
|
|
@@ -833,7 +959,11 @@ async function getContentText(config, path) {
|
|
|
833
959
|
}
|
|
834
960
|
const res = await resolvedFetch(url, {
|
|
835
961
|
method: "GET",
|
|
836
|
-
headers: jmpContentRequestHeaders(config)
|
|
962
|
+
headers: jmpContentRequestHeaders(config),
|
|
963
|
+
next: {
|
|
964
|
+
revalidate: JMP_CONTENT_REVALIDATE_SECONDS,
|
|
965
|
+
tags: [JMP_CONTENT_CACHE_TAG]
|
|
966
|
+
}
|
|
837
967
|
});
|
|
838
968
|
const text = await res.text();
|
|
839
969
|
if (!res.ok) {
|
|
@@ -924,7 +1054,65 @@ function getDiscoveredContentWrappers() {
|
|
|
924
1054
|
return sortWrapperSlots([...discovered]);
|
|
925
1055
|
}
|
|
926
1056
|
function resolveContentManifestForReport(config) {
|
|
927
|
-
|
|
1057
|
+
const site = getJmpSiteDefinition();
|
|
1058
|
+
const fallback = site?.contactFallback;
|
|
1059
|
+
const existing = config.contentManifest;
|
|
1060
|
+
const fromFallback = fallbackToManifestDefaults(fallback);
|
|
1061
|
+
if (!existing && !fromFallback) {
|
|
1062
|
+
return null;
|
|
1063
|
+
}
|
|
1064
|
+
const merged = {
|
|
1065
|
+
...existing ?? {},
|
|
1066
|
+
defaults: {
|
|
1067
|
+
...fromFallback ?? {},
|
|
1068
|
+
...existing?.defaults ?? {},
|
|
1069
|
+
contact: {
|
|
1070
|
+
...fromFallback?.contact ?? {},
|
|
1071
|
+
...existing?.defaults?.contact ?? {},
|
|
1072
|
+
extras: {
|
|
1073
|
+
...fromFallback?.contact?.extras ?? {},
|
|
1074
|
+
...existing?.defaults?.contact?.extras ?? {}
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
trust: {
|
|
1078
|
+
...fromFallback?.trust ?? {},
|
|
1079
|
+
...existing?.defaults?.trust ?? {}
|
|
1080
|
+
},
|
|
1081
|
+
faq: existing?.defaults?.faq?.length ? existing.defaults.faq : fromFallback?.faq
|
|
1082
|
+
}
|
|
1083
|
+
};
|
|
1084
|
+
return normalizeJmpContentManifest(merged);
|
|
1085
|
+
}
|
|
1086
|
+
function fallbackToManifestDefaults(fallback) {
|
|
1087
|
+
if (!fallback) return null;
|
|
1088
|
+
const contact = {};
|
|
1089
|
+
if (fallback.displayName?.trim()) contact.displayName = fallback.displayName.trim();
|
|
1090
|
+
if (fallback.email?.trim()) contact.email = fallback.email.trim();
|
|
1091
|
+
if (typeof fallback.phone === "string" && fallback.phone.trim()) {
|
|
1092
|
+
contact.phone = fallback.phone.trim();
|
|
1093
|
+
}
|
|
1094
|
+
if (fallback.address?.trim()) contact.address = fallback.address.trim();
|
|
1095
|
+
if (fallback.hours?.trim()) contact.hours = fallback.hours.trim();
|
|
1096
|
+
if (fallback.serviceArea?.trim()) contact.serviceArea = fallback.serviceArea.trim();
|
|
1097
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1098
|
+
contact.googleMapsUrl = fallback.googleMapsUrl.trim();
|
|
1099
|
+
}
|
|
1100
|
+
if (fallback.linkedin?.trim()) contact.linkedinUrl = fallback.linkedin.trim();
|
|
1101
|
+
if (fallback.instagram?.trim()) contact.instagramUrl = fallback.instagram.trim();
|
|
1102
|
+
if (fallback.facebook?.trim()) contact.facebookUrl = fallback.facebook.trim();
|
|
1103
|
+
if (fallback.x?.trim()) contact.xUrl = fallback.x.trim();
|
|
1104
|
+
if (fallback.youtube?.trim()) contact.youtubeUrl = fallback.youtube.trim();
|
|
1105
|
+
const trust = {};
|
|
1106
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1107
|
+
trust.googleReviewsUrl = fallback.googleMapsUrl.trim();
|
|
1108
|
+
}
|
|
1109
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
1110
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
1111
|
+
if (!hasContact && !hasTrust) return null;
|
|
1112
|
+
return {
|
|
1113
|
+
...hasContact ? { contact } : {},
|
|
1114
|
+
...hasTrust ? { trust } : {}
|
|
1115
|
+
};
|
|
928
1116
|
}
|
|
929
1117
|
function resolveContentWrappersForReport(config) {
|
|
930
1118
|
const explicit = config.contentWrappers ?? [];
|
|
@@ -1283,6 +1471,135 @@ async function registerJmpContentWrappers(config) {
|
|
|
1283
1471
|
}
|
|
1284
1472
|
setContentWrapperSyncHandler(registerJmpContentWrappers);
|
|
1285
1473
|
|
|
1474
|
+
// ai-crawler-agents.json
|
|
1475
|
+
var ai_crawler_agents_default = {
|
|
1476
|
+
robotsUserAgents: [
|
|
1477
|
+
"GPTBot",
|
|
1478
|
+
"ChatGPT-User",
|
|
1479
|
+
"OAI-SearchBot",
|
|
1480
|
+
"OAI-AdsBot",
|
|
1481
|
+
"ClaudeBot",
|
|
1482
|
+
"Claude-User",
|
|
1483
|
+
"Claude-SearchBot",
|
|
1484
|
+
"Claude-Web",
|
|
1485
|
+
"PerplexityBot",
|
|
1486
|
+
"Perplexity-User",
|
|
1487
|
+
"Google-Extended",
|
|
1488
|
+
"GoogleOther",
|
|
1489
|
+
"GoogleOther-Image",
|
|
1490
|
+
"GoogleOther-Video",
|
|
1491
|
+
"Google-CloudVertexBot",
|
|
1492
|
+
"Meta-ExternalAgent",
|
|
1493
|
+
"Meta-ExternalFetcher",
|
|
1494
|
+
"FacebookBot",
|
|
1495
|
+
"Applebot",
|
|
1496
|
+
"Applebot-Extended",
|
|
1497
|
+
"CCBot",
|
|
1498
|
+
"Bytespider",
|
|
1499
|
+
"cohere-ai",
|
|
1500
|
+
"cohere-training-data-crawler",
|
|
1501
|
+
"YouBot",
|
|
1502
|
+
"MistralAI-User",
|
|
1503
|
+
"GrokBot",
|
|
1504
|
+
"Grok-DeepSearch",
|
|
1505
|
+
"xAI-Grok",
|
|
1506
|
+
"xAI-Bot"
|
|
1507
|
+
],
|
|
1508
|
+
wafUserAgents: [
|
|
1509
|
+
"GPTBot",
|
|
1510
|
+
"ChatGPT-User",
|
|
1511
|
+
"OAI-SearchBot",
|
|
1512
|
+
"OAI-AdsBot",
|
|
1513
|
+
"ClaudeBot",
|
|
1514
|
+
"Claude-User",
|
|
1515
|
+
"Claude-SearchBot",
|
|
1516
|
+
"Claude-Web",
|
|
1517
|
+
"PerplexityBot",
|
|
1518
|
+
"Perplexity-User",
|
|
1519
|
+
"Google-Extended",
|
|
1520
|
+
"GoogleOther",
|
|
1521
|
+
"Google-CloudVertexBot",
|
|
1522
|
+
"Meta-ExternalAgent",
|
|
1523
|
+
"Meta-ExternalFetcher",
|
|
1524
|
+
"FacebookBot",
|
|
1525
|
+
"Applebot-Extended",
|
|
1526
|
+
"CCBot",
|
|
1527
|
+
"Bytespider",
|
|
1528
|
+
"cohere-ai",
|
|
1529
|
+
"cohere-training-data-crawler",
|
|
1530
|
+
"YouBot",
|
|
1531
|
+
"MistralAI-User",
|
|
1532
|
+
"GrokBot",
|
|
1533
|
+
"Grok-DeepSearch",
|
|
1534
|
+
"xAI-Grok",
|
|
1535
|
+
"xAI-Bot"
|
|
1536
|
+
]
|
|
1537
|
+
};
|
|
1538
|
+
|
|
1539
|
+
// src/ai-crawlers.ts
|
|
1540
|
+
var AI_CRAWLER_ROBOTS_USER_AGENTS = ai_crawler_agents_default.robotsUserAgents;
|
|
1541
|
+
var JMP_AI_CRAWLER_WAF_USER_AGENTS = ai_crawler_agents_default.wafUserAgents;
|
|
1542
|
+
function buildAiCrawlerRobotsTxt(blockAiCrawlers) {
|
|
1543
|
+
if (!blockAiCrawlers) {
|
|
1544
|
+
return [
|
|
1545
|
+
"# JMP AI crawler policy",
|
|
1546
|
+
"# AI crawler blocking is disabled for this website.",
|
|
1547
|
+
""
|
|
1548
|
+
].join("\n");
|
|
1549
|
+
}
|
|
1550
|
+
return [
|
|
1551
|
+
"# JMP AI crawler policy",
|
|
1552
|
+
"# Blocks known AI training, answer, and fetch bots that honor robots.txt.",
|
|
1553
|
+
...AI_CRAWLER_ROBOTS_USER_AGENTS.flatMap((agent) => [
|
|
1554
|
+
`User-agent: ${agent}`,
|
|
1555
|
+
"Disallow: /",
|
|
1556
|
+
""
|
|
1557
|
+
])
|
|
1558
|
+
].join("\n");
|
|
1559
|
+
}
|
|
1560
|
+
function jmpAiCrawlerWafUserAgentPattern() {
|
|
1561
|
+
return JMP_AI_CRAWLER_WAF_USER_AGENTS.map(escapeRegExp).join("|");
|
|
1562
|
+
}
|
|
1563
|
+
function jmpAiCrawlerVercelWafRoute() {
|
|
1564
|
+
return {
|
|
1565
|
+
src: "/(.*)",
|
|
1566
|
+
has: [
|
|
1567
|
+
{
|
|
1568
|
+
type: "header",
|
|
1569
|
+
key: "user-agent",
|
|
1570
|
+
value: `(?i).*(${jmpAiCrawlerWafUserAgentPattern()}).*`
|
|
1571
|
+
}
|
|
1572
|
+
],
|
|
1573
|
+
mitigate: { action: "deny" }
|
|
1574
|
+
};
|
|
1575
|
+
}
|
|
1576
|
+
function mergeJmpRobotsTxt(jmpBody, options) {
|
|
1577
|
+
const trimmed = jmpBody.trim();
|
|
1578
|
+
const sitemapLine = `Sitemap: ${options.siteUrl.replace(/\/$/, "")}/sitemap.xml`;
|
|
1579
|
+
const hasSitemap = /(?:^|\n)\s*Sitemap:/i.test(trimmed);
|
|
1580
|
+
const prefixes = options.privatePathPrefixes ?? [];
|
|
1581
|
+
const missingDisallows = prefixes.filter(
|
|
1582
|
+
(prefix) => !trimmed.includes(`Disallow: ${prefix}`)
|
|
1583
|
+
);
|
|
1584
|
+
const parts = [trimmed];
|
|
1585
|
+
if (options.ensureAiCrawlerDisallows && !/User-agent:\s*GPTBot/i.test(trimmed)) {
|
|
1586
|
+
parts.unshift(buildAiCrawlerRobotsTxt(true).trim());
|
|
1587
|
+
}
|
|
1588
|
+
if (missingDisallows.length > 0) {
|
|
1589
|
+
const lines = prefixes.map((prefix) => `Disallow: ${prefix}`);
|
|
1590
|
+
parts.push(`User-agent: *
|
|
1591
|
+
${lines.join("\n")}`);
|
|
1592
|
+
}
|
|
1593
|
+
if (!hasSitemap) {
|
|
1594
|
+
parts.push(sitemapLine);
|
|
1595
|
+
}
|
|
1596
|
+
return `${parts.join("\n\n")}
|
|
1597
|
+
`;
|
|
1598
|
+
}
|
|
1599
|
+
function escapeRegExp(value) {
|
|
1600
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1286
1603
|
// src/content/client.ts
|
|
1287
1604
|
function createJmpContentClient(config) {
|
|
1288
1605
|
return {
|
|
@@ -1355,6 +1672,8 @@ export {
|
|
|
1355
1672
|
JMP_ANALYTICS_SDK_VERSION,
|
|
1356
1673
|
JMP_TRACKING_CONSENT_STORAGE_KEY,
|
|
1357
1674
|
DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS,
|
|
1675
|
+
JMP_CONTENT_CACHE_TAG,
|
|
1676
|
+
JMP_CONTENT_REVALIDATE_SECONDS,
|
|
1358
1677
|
isJmpTrackingConsentGranted,
|
|
1359
1678
|
subscribeJmpTrackingConsent,
|
|
1360
1679
|
setJmpTrackingConsent,
|
|
@@ -1382,6 +1701,12 @@ export {
|
|
|
1382
1701
|
getJmpRobotsTxt,
|
|
1383
1702
|
getJmpPopularPages,
|
|
1384
1703
|
registerJmpContentWrappers,
|
|
1704
|
+
AI_CRAWLER_ROBOTS_USER_AGENTS,
|
|
1705
|
+
JMP_AI_CRAWLER_WAF_USER_AGENTS,
|
|
1706
|
+
buildAiCrawlerRobotsTxt,
|
|
1707
|
+
jmpAiCrawlerWafUserAgentPattern,
|
|
1708
|
+
jmpAiCrawlerVercelWafRoute,
|
|
1709
|
+
mergeJmpRobotsTxt,
|
|
1385
1710
|
createJmpContentClient,
|
|
1386
1711
|
getJmpBrowserAnalyticsConfigFromEnv,
|
|
1387
1712
|
getJmpServerContentConfigFromEnv,
|
|
@@ -1390,4 +1715,4 @@ export {
|
|
|
1390
1715
|
getOrCreateJmpAnalyticsFromBrowserEnv,
|
|
1391
1716
|
createJmpContentClientFromServerEnv
|
|
1392
1717
|
};
|
|
1393
|
-
//# sourceMappingURL=chunk-
|
|
1718
|
+
//# sourceMappingURL=chunk-JC3G4XNR.js.map
|