@salesmind-ai/design-system 0.1.6 → 0.1.8
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/audit-CiyPkxk1.d.cts +194 -0
- package/dist/audit-CiyPkxk1.d.ts +194 -0
- package/dist/index.cjs +422 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +36 -19
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +400 -21
- package/dist/index.js.map +1 -1
- package/dist/marketing/index.cjs +132 -20
- package/dist/marketing/index.cjs.map +1 -1
- package/dist/marketing/index.css +1 -1
- package/dist/marketing/index.css.map +1 -1
- package/dist/marketing/index.js +133 -21
- package/dist/marketing/index.js.map +1 -1
- package/dist/styles/styles.css +4 -1
- package/dist/web/index.cjs +426 -9
- package/dist/web/index.cjs.map +1 -1
- package/dist/web/index.d.cts +27 -1
- package/dist/web/index.d.ts +27 -1
- package/dist/web/index.js +404 -11
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4050,23 +4050,146 @@ var PlatformBadge = React30.forwardRef(
|
|
|
4050
4050
|
}
|
|
4051
4051
|
);
|
|
4052
4052
|
PlatformBadge.displayName = "PlatformBadge";
|
|
4053
|
+
var UtmContext = React30.createContext(null);
|
|
4054
|
+
|
|
4055
|
+
// src/web/utm/useUtmDefaults.ts
|
|
4056
|
+
function useUtmDefaults() {
|
|
4057
|
+
return React30.useContext(UtmContext);
|
|
4058
|
+
}
|
|
4059
|
+
|
|
4060
|
+
// src/web/utm/builders.ts
|
|
4061
|
+
var PLACEHOLDER_ORIGIN = "https://__placeholder__.internal";
|
|
4062
|
+
function buildUtmUrl(baseUrl, params) {
|
|
4063
|
+
const isRelative = baseUrl.startsWith("/");
|
|
4064
|
+
let url;
|
|
4065
|
+
try {
|
|
4066
|
+
url = isRelative ? new URL(baseUrl, PLACEHOLDER_ORIGIN) : new URL(baseUrl);
|
|
4067
|
+
} catch {
|
|
4068
|
+
return baseUrl;
|
|
4069
|
+
}
|
|
4070
|
+
const existingParams = [];
|
|
4071
|
+
url.searchParams.forEach((value, key) => {
|
|
4072
|
+
existingParams.push([key, value]);
|
|
4073
|
+
});
|
|
4074
|
+
for (const [key] of existingParams) {
|
|
4075
|
+
url.searchParams.delete(key);
|
|
4076
|
+
}
|
|
4077
|
+
for (const [key, value] of existingParams) {
|
|
4078
|
+
if (!key.startsWith("utm_")) {
|
|
4079
|
+
url.searchParams.set(key, value);
|
|
4080
|
+
}
|
|
4081
|
+
}
|
|
4082
|
+
url.searchParams.set("utm_source", params.source);
|
|
4083
|
+
url.searchParams.set("utm_medium", params.medium);
|
|
4084
|
+
url.searchParams.set("utm_campaign", params.campaign);
|
|
4085
|
+
if (params.term !== void 0) {
|
|
4086
|
+
url.searchParams.set("utm_term", params.term);
|
|
4087
|
+
}
|
|
4088
|
+
if (params.content !== void 0) {
|
|
4089
|
+
url.searchParams.set("utm_content", params.content);
|
|
4090
|
+
}
|
|
4091
|
+
if (isRelative) {
|
|
4092
|
+
return url.href.replace(PLACEHOLDER_ORIGIN, "");
|
|
4093
|
+
}
|
|
4094
|
+
return url.href;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
// src/web/utm/classifiers.ts
|
|
4098
|
+
var INTERNAL_PATTERNS = [
|
|
4099
|
+
/^\/(?!\/)/,
|
|
4100
|
+
// Relative paths
|
|
4101
|
+
/^https?:\/\/(www\.)?sales-mind\.ai/i,
|
|
4102
|
+
// Marketing site
|
|
4103
|
+
/^https?:\/\/app\.sales-mind\.ai/i,
|
|
4104
|
+
// Web app
|
|
4105
|
+
/^https?:\/\/apps\.sales-mind\.ai/i,
|
|
4106
|
+
// Web app (legacy)
|
|
4107
|
+
/^https?:\/\/meet\.sales-mind\.ai/i,
|
|
4108
|
+
// Booking
|
|
4109
|
+
/^https?:\/\/docs\.sales-mind\.ai/i
|
|
4110
|
+
// Docs
|
|
4111
|
+
];
|
|
4112
|
+
var SYSTEM_PATTERNS = [
|
|
4113
|
+
/^https?:\/\/.*\/api\//i,
|
|
4114
|
+
// API endpoints
|
|
4115
|
+
/^https?:\/\/.*\/webhook/i,
|
|
4116
|
+
// Webhooks
|
|
4117
|
+
/^https?:\/\/.*\/oauth/i,
|
|
4118
|
+
// OAuth callbacks
|
|
4119
|
+
/^https?:\/\/.*\/callback/i,
|
|
4120
|
+
// Callbacks
|
|
4121
|
+
/^https?:\/\/.*\.supabase\.(co|com)/i,
|
|
4122
|
+
// Supabase
|
|
4123
|
+
/^https?:\/\/.*\.firebaseapp\.com/i,
|
|
4124
|
+
// Firebase
|
|
4125
|
+
/^https?:\/\/.*\.cloudfunctions\.net/i
|
|
4126
|
+
// Cloud Functions
|
|
4127
|
+
];
|
|
4128
|
+
var ASSET_PATTERNS = [
|
|
4129
|
+
/\.(css|js|mjs|map|woff2?|ttf|eot|svg|png|jpe?g|gif|webp|avif|ico|pdf)(\?.*)?$/i
|
|
4130
|
+
];
|
|
4131
|
+
var CONVERSION_PATTERNS = [
|
|
4132
|
+
/^https?:\/\/(www\.)?calendly\.com/i,
|
|
4133
|
+
/^https?:\/\/(checkout\.)?stripe\.com/i,
|
|
4134
|
+
/^https?:\/\/buy\.stripe\.com/i,
|
|
4135
|
+
/^https?:\/\/chromewebstore\.google\.com/i,
|
|
4136
|
+
/^https?:\/\/meet\.sales-mind\.ai/i
|
|
4137
|
+
];
|
|
4138
|
+
var PROTOCOL_EXEMPT = [
|
|
4139
|
+
/^mailto:/i,
|
|
4140
|
+
/^tel:/i,
|
|
4141
|
+
/^#/,
|
|
4142
|
+
/^javascript:/i
|
|
4143
|
+
];
|
|
4144
|
+
function classifyUrl(url) {
|
|
4145
|
+
if (PROTOCOL_EXEMPT.some((p) => p.test(url))) return "protocol";
|
|
4146
|
+
if (ASSET_PATTERNS.some((p) => p.test(url))) return "asset";
|
|
4147
|
+
if (SYSTEM_PATTERNS.some((p) => p.test(url))) return "system";
|
|
4148
|
+
if (CONVERSION_PATTERNS.some((p) => p.test(url))) return "conversion";
|
|
4149
|
+
if (INTERNAL_PATTERNS.some((p) => p.test(url))) return "internal";
|
|
4150
|
+
return "external";
|
|
4151
|
+
}
|
|
4152
|
+
function requiresUtm(url) {
|
|
4153
|
+
const classification = classifyUrl(url);
|
|
4154
|
+
return classification === "external" || classification === "conversion";
|
|
4155
|
+
}
|
|
4156
|
+
function isUtmExempt(url) {
|
|
4157
|
+
const classification = classifyUrl(url);
|
|
4158
|
+
return classification === "protocol" || classification === "asset" || classification === "system" || classification === "internal";
|
|
4159
|
+
}
|
|
4053
4160
|
|
|
4054
4161
|
// src/components/OutboundLink/outbound-link-utils.ts
|
|
4055
|
-
var
|
|
4162
|
+
var LEGACY_UTM_SOURCE = "salesmind";
|
|
4056
4163
|
var EXEMPT_PATTERNS = [
|
|
4057
4164
|
/^https?:\/\/(www\.)?(stripe\.com|checkout\.stripe\.com|paypal\.com)/i,
|
|
4058
4165
|
/^https?:\/\/(www\.)?github\.com\/login\/oauth/i
|
|
4059
4166
|
];
|
|
4060
4167
|
var isExemptUrl = (urlStr) => {
|
|
4061
4168
|
if (urlStr.startsWith("mailto:") || urlStr.startsWith("tel:")) return true;
|
|
4169
|
+
const classification = classifyUrl(urlStr);
|
|
4170
|
+
if (classification === "system" || classification === "protocol" || classification === "asset") {
|
|
4171
|
+
return true;
|
|
4172
|
+
}
|
|
4062
4173
|
return EXEMPT_PATTERNS.some((pattern) => pattern.test(urlStr));
|
|
4063
4174
|
};
|
|
4175
|
+
var appendGovernedUTMs = (href, params, preserveExisting = true) => {
|
|
4176
|
+
try {
|
|
4177
|
+
const url = new URL(href);
|
|
4178
|
+
if (preserveExisting) {
|
|
4179
|
+
const hasAll = url.searchParams.has("utm_source") && url.searchParams.has("utm_medium") && url.searchParams.has("utm_campaign");
|
|
4180
|
+
if (hasAll) return href;
|
|
4181
|
+
}
|
|
4182
|
+
return buildUtmUrl(href, params);
|
|
4183
|
+
} catch {
|
|
4184
|
+
return href;
|
|
4185
|
+
}
|
|
4186
|
+
};
|
|
4064
4187
|
var appendUTMs = (href, context, pageSlug, options) => {
|
|
4065
4188
|
try {
|
|
4066
4189
|
const url = new URL(href);
|
|
4067
4190
|
const { mediumOverride = "outbound_link", campaignOverride, preserveExisting = true } = options;
|
|
4068
4191
|
const utms = {
|
|
4069
|
-
utm_source:
|
|
4192
|
+
utm_source: LEGACY_UTM_SOURCE,
|
|
4070
4193
|
utm_medium: mediumOverride,
|
|
4071
4194
|
utm_campaign: campaignOverride || pageSlug,
|
|
4072
4195
|
utm_content: context
|
|
@@ -4093,10 +4216,13 @@ var OutboundLink = React30.forwardRef(
|
|
|
4093
4216
|
preserveExistingUTM = true,
|
|
4094
4217
|
openInNewTab = true,
|
|
4095
4218
|
disableTracking = false,
|
|
4219
|
+
utmParams,
|
|
4096
4220
|
onClick,
|
|
4097
4221
|
children,
|
|
4098
4222
|
...props
|
|
4099
4223
|
}, ref) => {
|
|
4224
|
+
const contextParams = useUtmDefaults();
|
|
4225
|
+
const resolvedUtmParams = utmParams ?? contextParams;
|
|
4100
4226
|
let hostname = "";
|
|
4101
4227
|
try {
|
|
4102
4228
|
const url = new URL(href);
|
|
@@ -4121,16 +4247,20 @@ var OutboundLink = React30.forwardRef(
|
|
|
4121
4247
|
}
|
|
4122
4248
|
const isExempt = isExemptUrl(href) || disableTracking;
|
|
4123
4249
|
if (isExternal && !isExempt) {
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4250
|
+
if (resolvedUtmParams) {
|
|
4251
|
+
setFinalHref(appendGovernedUTMs(href, resolvedUtmParams, preserveExistingUTM));
|
|
4252
|
+
} else {
|
|
4253
|
+
const pageSlug = window.location.pathname.replace(/^\/|\/$/g, "") || "home";
|
|
4254
|
+
setFinalHref(appendUTMs(href, context, pageSlug, {
|
|
4255
|
+
mediumOverride: currentMedium,
|
|
4256
|
+
campaignOverride,
|
|
4257
|
+
preserveExisting: preserveExistingUTM
|
|
4258
|
+
}));
|
|
4259
|
+
}
|
|
4130
4260
|
} else {
|
|
4131
4261
|
setFinalHref(href);
|
|
4132
4262
|
}
|
|
4133
|
-
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking]);
|
|
4263
|
+
}, [href, context, mediumOverride, campaignOverride, preserveExistingUTM, disableTracking, resolvedUtmParams]);
|
|
4134
4264
|
const handleClick = (e) => {
|
|
4135
4265
|
if (typeof window === "undefined" || disableTracking) {
|
|
4136
4266
|
onClick?.(e);
|
|
@@ -4403,17 +4533,6 @@ var LogoItemRender = ({ item, className }) => {
|
|
|
4403
4533
|
] });
|
|
4404
4534
|
if (item.href) {
|
|
4405
4535
|
const isInternal = item.href.startsWith("/");
|
|
4406
|
-
if (isInternal) {
|
|
4407
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4408
|
-
"a",
|
|
4409
|
-
{
|
|
4410
|
-
href: item.href,
|
|
4411
|
-
className: clsx44__default.default("ds-social-logos__item", className),
|
|
4412
|
-
title: item.alt,
|
|
4413
|
-
children: innerContent
|
|
4414
|
-
}
|
|
4415
|
-
);
|
|
4416
|
-
}
|
|
4417
4536
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4418
4537
|
OutboundLink,
|
|
4419
4538
|
{
|
|
@@ -4421,6 +4540,7 @@ var LogoItemRender = ({ item, className }) => {
|
|
|
4421
4540
|
context: "social-proof-logo",
|
|
4422
4541
|
className: clsx44__default.default("ds-social-logos__item", className),
|
|
4423
4542
|
title: item.alt,
|
|
4543
|
+
openInNewTab: !isInternal,
|
|
4424
4544
|
children: innerContent
|
|
4425
4545
|
}
|
|
4426
4546
|
);
|
|
@@ -16702,6 +16822,265 @@ function JsonIcon() {
|
|
|
16702
16822
|
);
|
|
16703
16823
|
}
|
|
16704
16824
|
|
|
16825
|
+
// src/web/utm/constants.ts
|
|
16826
|
+
var UTM_SOURCES = [
|
|
16827
|
+
"linkedin",
|
|
16828
|
+
"whatsapp",
|
|
16829
|
+
"intercom",
|
|
16830
|
+
"email",
|
|
16831
|
+
"website",
|
|
16832
|
+
"app",
|
|
16833
|
+
"chromeStore",
|
|
16834
|
+
"stripe",
|
|
16835
|
+
"direct"
|
|
16836
|
+
];
|
|
16837
|
+
var UTM_MEDIUMS_MESSAGING = [
|
|
16838
|
+
"dm",
|
|
16839
|
+
"group",
|
|
16840
|
+
"email",
|
|
16841
|
+
"inAppChat",
|
|
16842
|
+
"organicPost",
|
|
16843
|
+
"paidAd",
|
|
16844
|
+
"qrCode",
|
|
16845
|
+
"redirect",
|
|
16846
|
+
"storeListing"
|
|
16847
|
+
];
|
|
16848
|
+
var UTM_MEDIUMS_APP = [
|
|
16849
|
+
"appHome",
|
|
16850
|
+
"appDashboard",
|
|
16851
|
+
"appInbox",
|
|
16852
|
+
"appContacts",
|
|
16853
|
+
"appCampaigns",
|
|
16854
|
+
"appSettings",
|
|
16855
|
+
"appBilling",
|
|
16856
|
+
"appCheckout",
|
|
16857
|
+
"appOnboarding",
|
|
16858
|
+
"appSupport",
|
|
16859
|
+
"appCalendar"
|
|
16860
|
+
];
|
|
16861
|
+
var UTM_MEDIUMS_WEB = [
|
|
16862
|
+
"webHome",
|
|
16863
|
+
"webDemo",
|
|
16864
|
+
"webPricing",
|
|
16865
|
+
"webFeatures",
|
|
16866
|
+
"webUseCase",
|
|
16867
|
+
"webSolution",
|
|
16868
|
+
"webIndustry",
|
|
16869
|
+
"webIntegrations",
|
|
16870
|
+
"webBlog",
|
|
16871
|
+
"webBlogPost",
|
|
16872
|
+
"webLanding",
|
|
16873
|
+
"webComparison",
|
|
16874
|
+
"webCaseStudy",
|
|
16875
|
+
"webAbout",
|
|
16876
|
+
"webContact",
|
|
16877
|
+
"webCareers",
|
|
16878
|
+
"webLegal",
|
|
16879
|
+
"webDocs",
|
|
16880
|
+
"webAffiliate"
|
|
16881
|
+
];
|
|
16882
|
+
var UTM_MEDIUMS_ALL = [
|
|
16883
|
+
...UTM_MEDIUMS_MESSAGING,
|
|
16884
|
+
...UTM_MEDIUMS_APP,
|
|
16885
|
+
...UTM_MEDIUMS_WEB
|
|
16886
|
+
];
|
|
16887
|
+
var UTM_CAMPAIGNS = [
|
|
16888
|
+
"discoveryCall",
|
|
16889
|
+
"demo",
|
|
16890
|
+
"trial",
|
|
16891
|
+
"onboarding",
|
|
16892
|
+
"upgrade",
|
|
16893
|
+
"renewal",
|
|
16894
|
+
"retention",
|
|
16895
|
+
"accountSupport",
|
|
16896
|
+
"supportCall",
|
|
16897
|
+
"partnerCall",
|
|
16898
|
+
"hiring",
|
|
16899
|
+
"interviewCall"
|
|
16900
|
+
];
|
|
16901
|
+
var UTM_TERMS = [
|
|
16902
|
+
"julienGadea",
|
|
16903
|
+
"bramSmith",
|
|
16904
|
+
"florentDupont",
|
|
16905
|
+
"sawLin",
|
|
16906
|
+
"evaSupport",
|
|
16907
|
+
"team",
|
|
16908
|
+
"auto"
|
|
16909
|
+
];
|
|
16910
|
+
var UTM_CONTENTS = [
|
|
16911
|
+
"ctaPrimary",
|
|
16912
|
+
"ctaSecondary",
|
|
16913
|
+
"ctaHeader",
|
|
16914
|
+
"ctaFooter",
|
|
16915
|
+
"ctaInline",
|
|
16916
|
+
"buttonPrimary",
|
|
16917
|
+
"buttonSecondary",
|
|
16918
|
+
"banner",
|
|
16919
|
+
"popup",
|
|
16920
|
+
"variantA",
|
|
16921
|
+
"variantB",
|
|
16922
|
+
"variantC"
|
|
16923
|
+
];
|
|
16924
|
+
var UTM_SOURCES_REQUIRING_SELLER = [
|
|
16925
|
+
"linkedin",
|
|
16926
|
+
"whatsapp",
|
|
16927
|
+
"intercom",
|
|
16928
|
+
"email"
|
|
16929
|
+
];
|
|
16930
|
+
|
|
16931
|
+
// src/web/utm/validators.ts
|
|
16932
|
+
function validateUtmField(field, value) {
|
|
16933
|
+
switch (field) {
|
|
16934
|
+
case "source":
|
|
16935
|
+
return UTM_SOURCES.includes(value);
|
|
16936
|
+
case "medium":
|
|
16937
|
+
return UTM_MEDIUMS_ALL.includes(value);
|
|
16938
|
+
case "campaign":
|
|
16939
|
+
return UTM_CAMPAIGNS.includes(value);
|
|
16940
|
+
case "term":
|
|
16941
|
+
return UTM_TERMS.includes(value);
|
|
16942
|
+
case "content":
|
|
16943
|
+
return UTM_CONTENTS.includes(value);
|
|
16944
|
+
default:
|
|
16945
|
+
return false;
|
|
16946
|
+
}
|
|
16947
|
+
}
|
|
16948
|
+
function isValidUtmParams(params) {
|
|
16949
|
+
if (!params.source || !params.medium || !params.campaign) {
|
|
16950
|
+
return false;
|
|
16951
|
+
}
|
|
16952
|
+
if (!validateUtmField("source", params.source)) return false;
|
|
16953
|
+
if (!validateUtmField("medium", params.medium)) return false;
|
|
16954
|
+
if (!validateUtmField("campaign", params.campaign)) return false;
|
|
16955
|
+
if (params.term !== void 0 && !validateUtmField("term", params.term)) return false;
|
|
16956
|
+
if (params.content !== void 0 && !validateUtmField("content", params.content)) return false;
|
|
16957
|
+
return true;
|
|
16958
|
+
}
|
|
16959
|
+
function validateCompliance(url, params) {
|
|
16960
|
+
const errors = [];
|
|
16961
|
+
const classification = classifyUrl(url);
|
|
16962
|
+
const needsUtm = requiresUtm(url);
|
|
16963
|
+
if (!needsUtm) {
|
|
16964
|
+
return {
|
|
16965
|
+
status: "compliant",
|
|
16966
|
+
url,
|
|
16967
|
+
params: params ?? null,
|
|
16968
|
+
errors: []
|
|
16969
|
+
};
|
|
16970
|
+
}
|
|
16971
|
+
if (!params) {
|
|
16972
|
+
return {
|
|
16973
|
+
status: "blocked",
|
|
16974
|
+
url,
|
|
16975
|
+
params: null,
|
|
16976
|
+
errors: [`URL classified as '${classification}' requires UTM parameters but none provided`]
|
|
16977
|
+
};
|
|
16978
|
+
}
|
|
16979
|
+
if (!params.source) errors.push("Missing required field: utm_source");
|
|
16980
|
+
if (!params.medium) errors.push("Missing required field: utm_medium");
|
|
16981
|
+
if (!params.campaign) errors.push("Missing required field: utm_campaign");
|
|
16982
|
+
if (params.source && !validateUtmField("source", params.source)) {
|
|
16983
|
+
errors.push(`Invalid utm_source: '${params.source}'. Must be one of: ${UTM_SOURCES.join(", ")}`);
|
|
16984
|
+
}
|
|
16985
|
+
if (params.medium && !validateUtmField("medium", params.medium)) {
|
|
16986
|
+
errors.push(`Invalid utm_medium: '${params.medium}'. Must be one of governed enum values`);
|
|
16987
|
+
}
|
|
16988
|
+
if (params.campaign && !validateUtmField("campaign", params.campaign)) {
|
|
16989
|
+
errors.push(`Invalid utm_campaign: '${params.campaign}'. Must be one of: ${UTM_CAMPAIGNS.join(", ")}`);
|
|
16990
|
+
}
|
|
16991
|
+
if (params.term !== void 0 && params.term && !validateUtmField("term", params.term)) {
|
|
16992
|
+
errors.push(`Invalid utm_term: '${params.term}'. Must be one of: ${UTM_TERMS.join(", ")}`);
|
|
16993
|
+
}
|
|
16994
|
+
if (params.content !== void 0 && params.content && !validateUtmField("content", params.content)) {
|
|
16995
|
+
errors.push(`Invalid utm_content: '${params.content}'. Must be one of: ${UTM_CONTENTS.join(", ")}`);
|
|
16996
|
+
}
|
|
16997
|
+
const allValues = [];
|
|
16998
|
+
if (params.source) allValues.push(params.source);
|
|
16999
|
+
if (params.medium) allValues.push(params.medium);
|
|
17000
|
+
if (params.campaign) allValues.push(params.campaign);
|
|
17001
|
+
if (params.term) allValues.push(params.term);
|
|
17002
|
+
if (params.content) allValues.push(params.content);
|
|
17003
|
+
for (const value of allValues) {
|
|
17004
|
+
if (/\s/.test(value)) errors.push(`Value '${value}' contains spaces`);
|
|
17005
|
+
if (/_/.test(value)) errors.push(`Value '${value}' contains underscores`);
|
|
17006
|
+
if (/-/.test(value)) errors.push(`Value '${value}' contains hyphens`);
|
|
17007
|
+
if (/[^\x20-\x7E]/.test(value)) errors.push(`Value '${value}' contains non-ASCII characters`);
|
|
17008
|
+
if (value === value.toUpperCase() && value.length > 1) errors.push(`Value '${value}' is ALL CAPS`);
|
|
17009
|
+
}
|
|
17010
|
+
const status = errors.length === 0 ? "compliant" : "blocked";
|
|
17011
|
+
return { status, url, params, errors };
|
|
17012
|
+
}
|
|
17013
|
+
function classifyAndEnforce(url, params) {
|
|
17014
|
+
return validateCompliance(url, params);
|
|
17015
|
+
}
|
|
17016
|
+
function buildBlockedError(reason, url) {
|
|
17017
|
+
return {
|
|
17018
|
+
status: "UTM_COMPLIANCE_BLOCKED",
|
|
17019
|
+
reason,
|
|
17020
|
+
requiredFix: reason,
|
|
17021
|
+
correctedExample: url ?? null
|
|
17022
|
+
};
|
|
17023
|
+
}
|
|
17024
|
+
|
|
17025
|
+
// src/web/utm/attribution.ts
|
|
17026
|
+
function parseUtmParams(search) {
|
|
17027
|
+
if (!search) return {};
|
|
17028
|
+
const params = new URLSearchParams(search);
|
|
17029
|
+
const result = {};
|
|
17030
|
+
const source = params.get("utm_source");
|
|
17031
|
+
if (source && UTM_SOURCES.includes(source)) {
|
|
17032
|
+
result.source = source;
|
|
17033
|
+
}
|
|
17034
|
+
const medium = params.get("utm_medium");
|
|
17035
|
+
if (medium) {
|
|
17036
|
+
result.medium = medium;
|
|
17037
|
+
}
|
|
17038
|
+
const campaign = params.get("utm_campaign");
|
|
17039
|
+
if (campaign && UTM_CAMPAIGNS.includes(campaign)) {
|
|
17040
|
+
result.campaign = campaign;
|
|
17041
|
+
}
|
|
17042
|
+
const term = params.get("utm_term");
|
|
17043
|
+
if (term && UTM_TERMS.includes(term)) {
|
|
17044
|
+
result.term = term;
|
|
17045
|
+
}
|
|
17046
|
+
const content = params.get("utm_content");
|
|
17047
|
+
if (content && UTM_CONTENTS.includes(content)) {
|
|
17048
|
+
result.content = content;
|
|
17049
|
+
}
|
|
17050
|
+
return result;
|
|
17051
|
+
}
|
|
17052
|
+
function toFirstTouchAttribution(params) {
|
|
17053
|
+
return {
|
|
17054
|
+
firstTouchSource: params.source,
|
|
17055
|
+
firstTouchMedium: params.medium,
|
|
17056
|
+
firstTouchCampaign: params.campaign,
|
|
17057
|
+
firstTouchSeller: params.term ?? null
|
|
17058
|
+
};
|
|
17059
|
+
}
|
|
17060
|
+
function requiresSellerAttribution(source) {
|
|
17061
|
+
return UTM_SOURCES_REQUIRING_SELLER.includes(source);
|
|
17062
|
+
}
|
|
17063
|
+
|
|
17064
|
+
// src/web/utm/audit.ts
|
|
17065
|
+
function createAuditEntry(url, params, generatorContext, confidence) {
|
|
17066
|
+
const utmParts = [];
|
|
17067
|
+
if (params) {
|
|
17068
|
+
if (params.source) utmParts.push(`utm_source=${params.source}`);
|
|
17069
|
+
if (params.medium) utmParts.push(`utm_medium=${params.medium}`);
|
|
17070
|
+
if (params.campaign) utmParts.push(`utm_campaign=${params.campaign}`);
|
|
17071
|
+
if (params.term) utmParts.push(`utm_term=${params.term}`);
|
|
17072
|
+
if (params.content) utmParts.push(`utm_content=${params.content}`);
|
|
17073
|
+
}
|
|
17074
|
+
return {
|
|
17075
|
+
url,
|
|
17076
|
+
utmString: utmParts.join("&"),
|
|
17077
|
+
generatorContext,
|
|
17078
|
+
sellerAttribution: params?.term ?? null,
|
|
17079
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17080
|
+
confidence
|
|
17081
|
+
};
|
|
17082
|
+
}
|
|
17083
|
+
|
|
16705
17084
|
Object.defineProperty(exports, "FormattedDate", {
|
|
16706
17085
|
enumerable: true,
|
|
16707
17086
|
get: function () { return reactIntl.FormattedDate; }
|
|
@@ -17009,6 +17388,15 @@ exports.TooltipProvider = TooltipProvider;
|
|
|
17009
17388
|
exports.TooltipRoot = TooltipRoot;
|
|
17010
17389
|
exports.TooltipTrigger = TooltipTrigger;
|
|
17011
17390
|
exports.TrendIndicator = TrendIndicator;
|
|
17391
|
+
exports.UTM_CAMPAIGNS = UTM_CAMPAIGNS;
|
|
17392
|
+
exports.UTM_CONTENTS = UTM_CONTENTS;
|
|
17393
|
+
exports.UTM_MEDIUMS_ALL = UTM_MEDIUMS_ALL;
|
|
17394
|
+
exports.UTM_MEDIUMS_APP = UTM_MEDIUMS_APP;
|
|
17395
|
+
exports.UTM_MEDIUMS_MESSAGING = UTM_MEDIUMS_MESSAGING;
|
|
17396
|
+
exports.UTM_MEDIUMS_WEB = UTM_MEDIUMS_WEB;
|
|
17397
|
+
exports.UTM_SOURCES = UTM_SOURCES;
|
|
17398
|
+
exports.UTM_SOURCES_REQUIRING_SELLER = UTM_SOURCES_REQUIRING_SELLER;
|
|
17399
|
+
exports.UTM_TERMS = UTM_TERMS;
|
|
17012
17400
|
exports.VARIANTS = VARIANTS;
|
|
17013
17401
|
exports.ValueAnchor = ValueAnchor;
|
|
17014
17402
|
exports.VersionedSeriesNavigator = VersionedSeriesNavigator;
|
|
@@ -17022,23 +17410,35 @@ exports.Z_INDEX = Z_INDEX;
|
|
|
17022
17410
|
exports.alertMessages = alertMessages;
|
|
17023
17411
|
exports.allMessages = allMessages;
|
|
17024
17412
|
exports.appearanceMessages = appearanceMessages;
|
|
17413
|
+
exports.appendGovernedUTMs = appendGovernedUTMs;
|
|
17025
17414
|
exports.appendUTMs = appendUTMs;
|
|
17026
17415
|
exports.authMessages = authMessages;
|
|
17416
|
+
exports.buildBlockedError = buildBlockedError;
|
|
17417
|
+
exports.buildUtmUrl = buildUtmUrl;
|
|
17027
17418
|
exports.calendarMessages = calendarMessages;
|
|
17028
17419
|
exports.carouselMessages = carouselMessages;
|
|
17420
|
+
exports.classifyAndEnforce = classifyAndEnforce;
|
|
17421
|
+
exports.classifyUrl = classifyUrl;
|
|
17029
17422
|
exports.commonMessages = commonMessages;
|
|
17423
|
+
exports.createAuditEntry = createAuditEntry;
|
|
17030
17424
|
exports.dialogMessages = dialogMessages;
|
|
17031
17425
|
exports.extractSpacingStyles = extractSpacingStyles;
|
|
17032
17426
|
exports.formMessages = formMessages;
|
|
17033
17427
|
exports.hexToRgb = hexToRgb;
|
|
17034
17428
|
exports.initializeAppearance = initializeAppearance;
|
|
17035
17429
|
exports.isExemptUrl = isExemptUrl;
|
|
17430
|
+
exports.isUtmExempt = isUtmExempt;
|
|
17431
|
+
exports.isValidUtmParams = isValidUtmParams;
|
|
17036
17432
|
exports.methodologyMessages = methodologyMessages;
|
|
17037
17433
|
exports.navigationMessages = navigationMessages;
|
|
17038
17434
|
exports.paginationMessages = paginationMessages;
|
|
17435
|
+
exports.parseUtmParams = parseUtmParams;
|
|
17039
17436
|
exports.prefersReducedMotion = prefersReducedMotion;
|
|
17040
17437
|
exports.reportMessages = reportMessages;
|
|
17438
|
+
exports.requiresSellerAttribution = requiresSellerAttribution;
|
|
17439
|
+
exports.requiresUtm = requiresUtm;
|
|
17041
17440
|
exports.resolveSpacing = resolveSpacing;
|
|
17441
|
+
exports.toFirstTouchAttribution = toFirstTouchAttribution;
|
|
17042
17442
|
exports.toastMessages = toastMessages;
|
|
17043
17443
|
exports.useAppearance = useAppearance;
|
|
17044
17444
|
exports.useDateFormat = useDateFormat;
|
|
@@ -17050,5 +17450,7 @@ exports.useNumberFormat = useNumberFormat;
|
|
|
17050
17450
|
exports.useRelativeTime = useRelativeTime;
|
|
17051
17451
|
exports.useTextDirection = useTextDirection;
|
|
17052
17452
|
exports.useToast = useToast;
|
|
17453
|
+
exports.validateCompliance = validateCompliance;
|
|
17454
|
+
exports.validateUtmField = validateUtmField;
|
|
17053
17455
|
//# sourceMappingURL=index.cjs.map
|
|
17054
17456
|
//# sourceMappingURL=index.cjs.map
|