@sonordev/site-kit 1.5.5 → 2.0.1
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/AnalyticsProvider-J7UMCBCJ.mjs +4 -0
- package/dist/{AnalyticsProvider-BBLU4U2T.mjs.map → AnalyticsProvider-J7UMCBCJ.mjs.map} +1 -1
- package/dist/AnalyticsProvider-PPDJIGWY.js +25 -0
- package/dist/{AnalyticsProvider-EMDIAAWR.js.map → AnalyticsProvider-PPDJIGWY.js.map} +1 -1
- package/dist/EngageWidget-IDBEBGQR.js +13 -0
- package/dist/{EngageWidget-UHWXXCAX.js.map → EngageWidget-IDBEBGQR.js.map} +1 -1
- package/dist/EngageWidget-SRRI4W7U.mjs +4 -0
- package/dist/{EngageWidget-CVZMTSB6.mjs.map → EngageWidget-SRRI4W7U.mjs.map} +1 -1
- package/dist/SignalBridge-D6W6OLVG.mjs +4 -0
- package/dist/{SignalBridge-WGHMEILW.mjs.map → SignalBridge-D6W6OLVG.mjs.map} +1 -1
- package/dist/SignalBridge-THATXU2R.js +33 -0
- package/dist/{SignalBridge-6UYUZ2CN.js.map → SignalBridge-THATXU2R.js.map} +1 -1
- package/dist/analytics/index.js +9 -9
- package/dist/analytics/index.mjs +2 -2
- package/dist/blog/index.js +75 -75
- package/dist/blog/index.js.map +1 -1
- package/dist/blog/index.mjs +75 -75
- package/dist/blog/index.mjs.map +1 -1
- package/dist/blog/server.js +2 -2
- package/dist/blog/server.js.map +1 -1
- package/dist/blog/server.mjs +2 -2
- package/dist/blog/server.mjs.map +1 -1
- package/dist/brand.css +87 -0
- package/dist/{chunk-ZU6YPEAF.mjs → chunk-2OJCYWSQ.mjs} +85 -73
- package/dist/chunk-2OJCYWSQ.mjs.map +1 -0
- package/dist/{chunk-PM2KQ6YK.mjs → chunk-3CXAWGUP.mjs} +3 -3
- package/dist/{chunk-PM2KQ6YK.mjs.map → chunk-3CXAWGUP.mjs.map} +1 -1
- package/dist/{chunk-36Y7OWES.mjs → chunk-3YQCPLGP.mjs} +4 -4
- package/dist/chunk-3YQCPLGP.mjs.map +1 -0
- package/dist/{chunk-XWWBUC2I.js → chunk-6ZGM7S5O.js} +77 -61
- package/dist/chunk-6ZGM7S5O.js.map +1 -0
- package/dist/{chunk-XFOL6JDF.mjs → chunk-7LAOWIWE.mjs} +4 -4
- package/dist/chunk-7LAOWIWE.mjs.map +1 -0
- package/dist/{chunk-YBTYDBWY.js → chunk-7M3FNAS5.js} +6 -8
- package/dist/chunk-7M3FNAS5.js.map +1 -0
- package/dist/{chunk-ELDJDBQL.js → chunk-A7RCX6OI.js} +7 -7
- package/dist/chunk-A7RCX6OI.js.map +1 -0
- package/dist/{chunk-4QHHFCAA.mjs → chunk-AOIG5PVY.mjs} +6 -8
- package/dist/chunk-AOIG5PVY.mjs.map +1 -0
- package/dist/{chunk-VZMDH3R4.mjs → chunk-B22WSN4L.mjs} +4 -4
- package/dist/chunk-B22WSN4L.mjs.map +1 -0
- package/dist/{chunk-N24BPFF6.mjs → chunk-CU6OGBKK.mjs} +6 -6
- package/dist/chunk-CU6OGBKK.mjs.map +1 -0
- package/dist/{chunk-KRPFLF62.mjs → chunk-F5NXD7VQ.mjs} +10 -12
- package/dist/{chunk-KRPFLF62.mjs.map → chunk-F5NXD7VQ.mjs.map} +1 -1
- package/dist/{chunk-DY4K6X3A.js → chunk-GCPPXUAI.js} +6 -6
- package/dist/chunk-GCPPXUAI.js.map +1 -0
- package/dist/{chunk-G6VGUAK2.js → chunk-IFVMZFNT.js} +4 -4
- package/dist/chunk-IFVMZFNT.js.map +1 -0
- package/dist/{chunk-GJD4CFHN.js → chunk-ITPVKQB6.js} +78 -8
- package/dist/chunk-ITPVKQB6.js.map +1 -0
- package/dist/{chunk-NRNK7LXK.mjs → chunk-IYQUFQYM.mjs} +4 -4
- package/dist/chunk-IYQUFQYM.mjs.map +1 -0
- package/dist/{chunk-EUNL6GAL.js → chunk-JP5WGL75.js} +4 -4
- package/dist/chunk-JP5WGL75.js.map +1 -0
- package/dist/{chunk-MG23BS36.js → chunk-L3UB4B74.js} +5 -5
- package/dist/chunk-L3UB4B74.js.map +1 -0
- package/dist/{chunk-M5FLRLHI.mjs → chunk-L7XPPFSS.mjs} +3 -3
- package/dist/chunk-L7XPPFSS.mjs.map +1 -0
- package/dist/{chunk-FVCQBTNK.mjs → chunk-MSRLAD7F.mjs} +77 -61
- package/dist/chunk-MSRLAD7F.mjs.map +1 -0
- package/dist/{chunk-4X5TFGKD.mjs → chunk-P3POHQWW.mjs} +422 -426
- package/dist/chunk-P3POHQWW.mjs.map +1 -0
- package/dist/{chunk-KJN2C6YE.js → chunk-PKUTYMN7.js} +5 -5
- package/dist/chunk-PKUTYMN7.js.map +1 -0
- package/dist/{chunk-FTSXKDP3.js → chunk-RO6DHV6S.js} +10 -12
- package/dist/{chunk-FTSXKDP3.js.map → chunk-RO6DHV6S.js.map} +1 -1
- package/dist/{chunk-FMB2RZDH.mjs → chunk-TUFP3FGI.mjs} +5 -5
- package/dist/chunk-TUFP3FGI.mjs.map +1 -0
- package/dist/{chunk-WW7UM7XY.js → chunk-TZAD7CZD.js} +424 -428
- package/dist/chunk-TZAD7CZD.js.map +1 -0
- package/dist/{chunk-TXZNP76P.js → chunk-UD5447TC.js} +13 -15
- package/dist/chunk-UD5447TC.js.map +1 -0
- package/dist/{chunk-TC6TOW2T.js → chunk-UJ757WGI.js} +4 -4
- package/dist/{chunk-TC6TOW2T.js.map → chunk-UJ757WGI.js.map} +1 -1
- package/dist/{chunk-C3A5HXHX.mjs → chunk-V6V6OXS2.mjs} +5 -5
- package/dist/chunk-V6V6OXS2.mjs.map +1 -0
- package/dist/{chunk-PTTDKFL7.js → chunk-VU4GL5ZG.js} +5 -5
- package/dist/chunk-VU4GL5ZG.js.map +1 -0
- package/dist/{chunk-X4J33XQD.js → chunk-W6K7MQCC.js} +6 -6
- package/dist/chunk-W6K7MQCC.js.map +1 -0
- package/dist/{chunk-IJ2LWZID.js → chunk-WETCVFIK.js} +85 -73
- package/dist/chunk-WETCVFIK.js.map +1 -0
- package/dist/{chunk-VNAJQKYG.mjs → chunk-WN2PUL6B.mjs} +13 -15
- package/dist/chunk-WN2PUL6B.mjs.map +1 -0
- package/dist/{chunk-FI2ME55T.mjs → chunk-Z6EHHJWU.mjs} +78 -8
- package/dist/chunk-Z6EHHJWU.mjs.map +1 -0
- package/dist/cli/index.js +19339 -3461
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +19331 -3452
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cms/index.d.mts +1 -1
- package/dist/cms/index.d.ts +1 -1
- package/dist/cms/index.js +3 -3
- package/dist/cms/index.js.map +1 -1
- package/dist/cms/index.mjs +2 -2
- package/dist/cms/index.mjs.map +1 -1
- package/dist/cms/server.js +4 -4
- package/dist/cms/server.mjs +1 -1
- package/dist/commerce/index.js +47 -47
- package/dist/commerce/index.mjs +3 -3
- package/dist/engage/index.js +6 -6
- package/dist/engage/index.js.map +1 -1
- package/dist/engage/index.mjs +3 -3
- package/dist/engage/index.mjs.map +1 -1
- package/dist/forms/index.js +379 -84
- package/dist/forms/index.js.map +1 -1
- package/dist/forms/index.mjs +375 -65
- package/dist/forms/index.mjs.map +1 -1
- package/dist/forms/styles.css +312 -0
- package/dist/images/index.js +11 -11
- package/dist/images/index.mjs +2 -2
- package/dist/images/server.js +4 -4
- package/dist/images/server.mjs +1 -1
- package/dist/index.d.mts +4 -131
- package/dist/index.d.ts +4 -131
- package/dist/index.js +85 -1373
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -1294
- package/dist/index.mjs.map +1 -1
- package/dist/layout/client.js +2 -2
- package/dist/layout/client.mjs +1 -1
- package/dist/layout/index.js +21 -11
- package/dist/layout/index.js.map +1 -1
- package/dist/layout/index.mjs +17 -7
- package/dist/layout/index.mjs.map +1 -1
- package/dist/llms/index.d.mts +5 -5
- package/dist/llms/index.d.ts +5 -5
- package/dist/llms/index.js +12 -12
- package/dist/llms/index.js.map +1 -1
- package/dist/llms/index.mjs +2 -2
- package/dist/llms/index.mjs.map +1 -1
- package/dist/manifest/index.js +4 -4
- package/dist/manifest/index.js.map +1 -1
- package/dist/manifest/index.mjs +3 -3
- package/dist/manifest/index.mjs.map +1 -1
- package/dist/middleware/index.js +3 -3
- package/dist/middleware/index.mjs +2 -2
- package/dist/redirects/index.js +6 -6
- package/dist/redirects/index.mjs +2 -2
- package/dist/robots/index.js +3 -3
- package/dist/robots/index.js.map +1 -1
- package/dist/robots/index.mjs +2 -2
- package/dist/robots/index.mjs.map +1 -1
- package/dist/{routing-DZYzyDHw.d.ts → routing-DQ_Et-OP.d.mts} +4 -4
- package/dist/{routing-B5XS-6_W.d.mts → routing-IYiJNIIX.d.ts} +4 -4
- package/dist/seo/index.d.mts +3 -5
- package/dist/seo/index.d.ts +3 -5
- package/dist/seo/index.js +77 -76
- package/dist/seo/index.js.map +1 -1
- package/dist/seo/index.mjs +41 -40
- package/dist/seo/index.mjs.map +1 -1
- package/dist/seo/register-sitemap-cli.js +3 -3
- package/dist/seo/register-sitemap-cli.js.map +1 -1
- package/dist/seo/register-sitemap-cli.mjs +3 -3
- package/dist/seo/register-sitemap-cli.mjs.map +1 -1
- package/dist/seo/server.d.mts +3 -3
- package/dist/seo/server.d.ts +3 -3
- package/dist/seo/server.js +7 -7
- package/dist/seo/server.js.map +1 -1
- package/dist/seo/server.mjs +5 -5
- package/dist/seo/server.mjs.map +1 -1
- package/dist/{server-api-COVFLFZ2.mjs → server-api-O7SSHYQS.mjs} +3 -3
- package/dist/{server-api-COVFLFZ2.mjs.map → server-api-O7SSHYQS.mjs.map} +1 -1
- package/dist/{server-api-XGKRGUMG.js → server-api-W4BXUFCT.js} +21 -21
- package/dist/{server-api-XGKRGUMG.js.map → server-api-W4BXUFCT.js.map} +1 -1
- package/dist/setup/index.d.mts +2 -5
- package/dist/setup/index.d.ts +2 -5
- package/dist/setup/index.js +0 -31
- package/dist/setup/index.mjs +1 -4
- package/dist/site-config/index.js +3 -3
- package/dist/site-config/index.mjs +1 -1
- package/dist/sitemap/index.d.mts +28 -2
- package/dist/sitemap/index.d.ts +28 -2
- package/dist/sitemap/index.js +38 -9
- package/dist/sitemap/index.js.map +1 -1
- package/dist/sitemap/index.mjs +36 -8
- package/dist/sitemap/index.mjs.map +1 -1
- package/dist/sync/index.js +13 -13
- package/dist/sync/index.mjs +1 -1
- package/dist/{types-Blb2QNkV.d.mts → types-BxzT7yhf.d.mts} +22 -1
- package/dist/{types-Blb2QNkV.d.ts → types-BxzT7yhf.d.ts} +22 -1
- package/dist/{types-KZP_VWZp.d.mts → types-CGkyylOa.d.mts} +2 -2
- package/dist/{types-KZP_VWZp.d.ts → types-CGkyylOa.d.ts} +2 -2
- package/package.json +4 -12
- package/dist/AnalyticsProvider-BBLU4U2T.mjs +0 -4
- package/dist/AnalyticsProvider-EMDIAAWR.js +0 -25
- package/dist/EngageWidget-CVZMTSB6.mjs +0 -4
- package/dist/EngageWidget-UHWXXCAX.js +0 -13
- package/dist/SetupWizard-Cki06kB0.d.mts +0 -12
- package/dist/SetupWizard-Cki06kB0.d.ts +0 -12
- package/dist/SignalBridge-6UYUZ2CN.js +0 -33
- package/dist/SignalBridge-WGHMEILW.mjs +0 -4
- package/dist/chunk-36Y7OWES.mjs.map +0 -1
- package/dist/chunk-373TK6TZ.js +0 -321
- package/dist/chunk-373TK6TZ.js.map +0 -1
- package/dist/chunk-4MOJJSNA.js +0 -14867
- package/dist/chunk-4MOJJSNA.js.map +0 -1
- package/dist/chunk-4QHHFCAA.mjs.map +0 -1
- package/dist/chunk-4X5TFGKD.mjs.map +0 -1
- package/dist/chunk-5YDPPOUU.mjs +0 -810
- package/dist/chunk-5YDPPOUU.mjs.map +0 -1
- package/dist/chunk-7FKPJQVS.mjs +0 -289
- package/dist/chunk-7FKPJQVS.mjs.map +0 -1
- package/dist/chunk-C3A5HXHX.mjs.map +0 -1
- package/dist/chunk-DY4K6X3A.js.map +0 -1
- package/dist/chunk-ELDJDBQL.js.map +0 -1
- package/dist/chunk-EUNL6GAL.js.map +0 -1
- package/dist/chunk-FI2ME55T.mjs.map +0 -1
- package/dist/chunk-FMB2RZDH.mjs.map +0 -1
- package/dist/chunk-FVCQBTNK.mjs.map +0 -1
- package/dist/chunk-G6VGUAK2.js.map +0 -1
- package/dist/chunk-GJD4CFHN.js.map +0 -1
- package/dist/chunk-GVXZWXQ7.js +0 -814
- package/dist/chunk-GVXZWXQ7.js.map +0 -1
- package/dist/chunk-HF2FWDBJ.mjs +0 -968
- package/dist/chunk-HF2FWDBJ.mjs.map +0 -1
- package/dist/chunk-IFAW7JFO.js +0 -1429
- package/dist/chunk-IFAW7JFO.js.map +0 -1
- package/dist/chunk-IJ2LWZID.js.map +0 -1
- package/dist/chunk-IKIJEKU3.mjs +0 -1427
- package/dist/chunk-IKIJEKU3.mjs.map +0 -1
- package/dist/chunk-JFTGG6HK.mjs +0 -14848
- package/dist/chunk-JFTGG6HK.mjs.map +0 -1
- package/dist/chunk-JM3ZR6LB.js +0 -981
- package/dist/chunk-JM3ZR6LB.js.map +0 -1
- package/dist/chunk-KJN2C6YE.js.map +0 -1
- package/dist/chunk-M5FLRLHI.mjs.map +0 -1
- package/dist/chunk-MCGLYYAR.mjs +0 -341
- package/dist/chunk-MCGLYYAR.mjs.map +0 -1
- package/dist/chunk-MG23BS36.js.map +0 -1
- package/dist/chunk-N24BPFF6.mjs.map +0 -1
- package/dist/chunk-NRNK7LXK.mjs.map +0 -1
- package/dist/chunk-PTTDKFL7.js.map +0 -1
- package/dist/chunk-S7FRYNSU.mjs +0 -315
- package/dist/chunk-S7FRYNSU.mjs.map +0 -1
- package/dist/chunk-SLB5V4RT.js +0 -302
- package/dist/chunk-SLB5V4RT.js.map +0 -1
- package/dist/chunk-TXZNP76P.js.map +0 -1
- package/dist/chunk-VNAJQKYG.mjs.map +0 -1
- package/dist/chunk-VZMDH3R4.mjs.map +0 -1
- package/dist/chunk-WW7UM7XY.js.map +0 -1
- package/dist/chunk-X4J33XQD.js.map +0 -1
- package/dist/chunk-XFOL6JDF.mjs.map +0 -1
- package/dist/chunk-XWWBUC2I.js.map +0 -1
- package/dist/chunk-YBTYDBWY.js.map +0 -1
- package/dist/chunk-ZQO6FZZB.js +0 -343
- package/dist/chunk-ZQO6FZZB.js.map +0 -1
- package/dist/chunk-ZU6YPEAF.mjs.map +0 -1
- package/dist/generators-DOFWGRXS.js +0 -37
- package/dist/generators-DOFWGRXS.js.map +0 -1
- package/dist/generators-R62APO62.mjs +0 -4
- package/dist/generators-R62APO62.mjs.map +0 -1
- package/dist/migrator-3WQB3KQ2.mjs +0 -4
- package/dist/migrator-3WQB3KQ2.mjs.map +0 -1
- package/dist/migrator-HFVQYK5R.js +0 -37
- package/dist/migrator-HFVQYK5R.js.map +0 -1
- package/dist/scanner-AF7YUCFG.mjs +0 -4
- package/dist/scanner-AF7YUCFG.mjs.map +0 -1
- package/dist/scanner-DBD5K6F7.js +0 -53
- package/dist/scanner-DBD5K6F7.js.map +0 -1
- package/dist/setup/client.d.mts +0 -60
- package/dist/setup/client.d.ts +0 -60
- package/dist/setup/client.js +0 -31
- package/dist/setup/client.js.map +0 -1
- package/dist/setup/client.mjs +0 -6
- package/dist/setup/client.mjs.map +0 -1
- package/dist/setup/server.d.mts +0 -14
- package/dist/setup/server.d.ts +0 -14
- package/dist/setup/server.js +0 -13
- package/dist/setup/server.js.map +0 -1
- package/dist/setup/server.mjs +0 -4
- package/dist/setup/server.mjs.map +0 -1
|
@@ -16,7 +16,7 @@ var ReactMarkdown__default = /*#__PURE__*/_interopDefault(ReactMarkdown);
|
|
|
16
16
|
// src/engage/EngageWidget.tsx
|
|
17
17
|
function getApiConfig() {
|
|
18
18
|
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV === "development";
|
|
19
|
-
const defaultApiUrl = isDev &&
|
|
19
|
+
const defaultApiUrl = isDev && process.env?.SONOR_API_URL ? process.env.SONOR_API_URL : "https://api.sonor.io";
|
|
20
20
|
const defaultSignalUrl = isDev && (process.env?.SONOR_SIGNAL_URL || process.env?.NEXT_PUBLIC_SIGNAL_API_URL) ? process.env.SONOR_SIGNAL_URL || process.env.NEXT_PUBLIC_SIGNAL_API_URL : "https://signal.sonor.io";
|
|
21
21
|
const apiUrl = typeof window !== "undefined" ? window.__SITE_KIT_API_URL__ || defaultApiUrl : defaultApiUrl;
|
|
22
22
|
const apiKey = typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
|
|
@@ -63,6 +63,21 @@ function isLightColor(hex) {
|
|
|
63
63
|
const b = num & 255;
|
|
64
64
|
return (r * 299 + g * 587 + b * 114) / 1e3 > 160;
|
|
65
65
|
}
|
|
66
|
+
function resolveColor(cssVar, apiFallback, hardDefault) {
|
|
67
|
+
if (typeof window !== "undefined") {
|
|
68
|
+
const cssValue = getComputedStyle(document.documentElement).getPropertyValue(cssVar).trim();
|
|
69
|
+
if (cssValue) return cssValue;
|
|
70
|
+
}
|
|
71
|
+
return apiFallback || hardDefault;
|
|
72
|
+
}
|
|
73
|
+
function hexToRgbString(hex, fallback = "59, 130, 246") {
|
|
74
|
+
const match = hex.replace("#", "").match(/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i);
|
|
75
|
+
if (!match) return fallback;
|
|
76
|
+
return `${parseInt(match[1], 16)}, ${parseInt(match[2], 16)}, ${parseInt(match[3], 16)}`;
|
|
77
|
+
}
|
|
78
|
+
function hexAlpha(rgbVar, alpha, fallbackRgb = "59, 130, 246") {
|
|
79
|
+
return `rgba(var(${rgbVar}, ${fallbackRgb}), ${alpha})`;
|
|
80
|
+
}
|
|
66
81
|
function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, signalUrl: propSignalUrl, suggested_questions: propSuggestedQuestions, assistant_name: propAssistantName, welcome_message: propWelcomeMessage, assistant_avatar: propAssistantAvatar }) {
|
|
67
82
|
const [resolvedProjectId, setResolvedProjectId] = React2.useState(propProjectId || null);
|
|
68
83
|
const projectId = propProjectId || resolvedProjectId || "";
|
|
@@ -103,7 +118,8 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
103
118
|
const socketRef = React2.useRef(null);
|
|
104
119
|
const pollingIntervalRef = React2.useRef(null);
|
|
105
120
|
const position = config?.position || widgetConfig?.position || "bottom-right";
|
|
106
|
-
const primaryColor = widgetConfig?.brand_primary || config?.buttonColor
|
|
121
|
+
const primaryColor = resolveColor("--sk-primary", widgetConfig?.brand_primary || config?.buttonColor, "#3b82f6");
|
|
122
|
+
const primaryRgb = hexToRgbString(primaryColor);
|
|
107
123
|
const businessName = propAssistantName || widgetConfig?.project_name || widgetConfig?.business_info?.name || "Chat with us";
|
|
108
124
|
const logoUrl = propAssistantAvatar || widgetConfig?.logo_url || null;
|
|
109
125
|
const welcomeEnabled = widgetConfig?.welcome_screen_enabled !== false;
|
|
@@ -766,7 +782,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
766
782
|
if (checkingAvailability) return { dot: "#f59e0b", text: "Checking for a team member..." };
|
|
767
783
|
if (widgetConfig?.signal_enabled) return { dot: null, text: "Echo Intelligent Site Assistant" };
|
|
768
784
|
if (availability && availability.agentsOnline > 0) return { dot: "#22c55e", text: "Online" };
|
|
769
|
-
return { dot: "#9ca3af", text: "We'll respond soon" };
|
|
785
|
+
return { dot: "var(--sk-text-tertiary, #9ca3af)", text: "We'll respond soon" };
|
|
770
786
|
})();
|
|
771
787
|
const ChatButton = /* @__PURE__ */ jsxRuntime.jsx(
|
|
772
788
|
"button",
|
|
@@ -848,7 +864,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
848
864
|
}
|
|
849
865
|
);
|
|
850
866
|
const WelcomeScreen = /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", padding: 20, gap: 16 }, children: [
|
|
851
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", paddingTop: 8 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 15, color: "#374151", lineHeight: 1.5 }, children: welcomeMessage }) }),
|
|
867
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { textAlign: "center", paddingTop: 8 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 15, color: "var(--sk-text-primary, #374151)", lineHeight: 1.5 }, children: welcomeMessage }) }),
|
|
852
868
|
quickActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", flexDirection: "column", gap: 8 }, children: quickActions.map((action, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
853
869
|
"button",
|
|
854
870
|
{
|
|
@@ -857,8 +873,8 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
857
873
|
style: {
|
|
858
874
|
padding: "12px 16px",
|
|
859
875
|
borderRadius: 12,
|
|
860
|
-
border: `1px solid ${
|
|
861
|
-
backgroundColor:
|
|
876
|
+
border: `1px solid ${hexAlpha("--sk-primary-rgb", 0.2, primaryRgb)}`,
|
|
877
|
+
backgroundColor: hexAlpha("--sk-primary-rgb", 0.031, primaryRgb),
|
|
862
878
|
color: primaryColor,
|
|
863
879
|
fontSize: 14,
|
|
864
880
|
cursor: "pointer",
|
|
@@ -867,12 +883,12 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
867
883
|
lineHeight: 1.4
|
|
868
884
|
},
|
|
869
885
|
onMouseEnter: (e) => {
|
|
870
|
-
e.currentTarget.style.backgroundColor =
|
|
871
|
-
e.currentTarget.style.borderColor =
|
|
886
|
+
e.currentTarget.style.backgroundColor = hexAlpha("--sk-primary-rgb", 0.082, primaryRgb);
|
|
887
|
+
e.currentTarget.style.borderColor = hexAlpha("--sk-primary-rgb", 0.333, primaryRgb);
|
|
872
888
|
},
|
|
873
889
|
onMouseLeave: (e) => {
|
|
874
|
-
e.currentTarget.style.backgroundColor =
|
|
875
|
-
e.currentTarget.style.borderColor =
|
|
890
|
+
e.currentTarget.style.backgroundColor = hexAlpha("--sk-primary-rgb", 0.031, primaryRgb);
|
|
891
|
+
e.currentTarget.style.borderColor = hexAlpha("--sk-primary-rgb", 0.2, primaryRgb);
|
|
876
892
|
},
|
|
877
893
|
children: action
|
|
878
894
|
},
|
|
@@ -897,18 +913,18 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
897
913
|
children: "Start a conversation"
|
|
898
914
|
}
|
|
899
915
|
),
|
|
900
|
-
widgetConfig?.business_info?.phone && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center", fontSize: 13, color: "#6b7280" }, children: [
|
|
916
|
+
widgetConfig?.business_info?.phone && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center", fontSize: 13, color: "var(--sk-text-secondary, #6b7280)" }, children: [
|
|
901
917
|
"Or call us at",
|
|
902
918
|
" ",
|
|
903
919
|
/* @__PURE__ */ jsxRuntime.jsx("a", { href: `tel:${widgetConfig.business_info.phone}`, style: { color: primaryColor, textDecoration: "none", fontWeight: 500 }, children: widgetConfig.business_info.phone })
|
|
904
920
|
] })
|
|
905
921
|
] });
|
|
906
922
|
const OfflineFormView = /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 20, flex: 1, overflowY: "auto" }, children: offlineSubmitted ? /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { textAlign: "center", padding: 20 }, children: [
|
|
907
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 56, height: 56, borderRadius: "50%", backgroundColor:
|
|
908
|
-
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 8px", fontSize: 18, fontWeight: 600, color: "#111827" }, children: "Message Sent!" }),
|
|
909
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, color: "#6b7280", fontSize: 14 }, children: offlineSubheading })
|
|
923
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 56, height: 56, borderRadius: "50%", backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb), display: "flex", alignItems: "center", justifyContent: "center", margin: "0 auto 16px" }, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "28", height: "28", viewBox: "0 0 24 24", fill: "none", stroke: primaryColor, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" }) }) }),
|
|
924
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { style: { margin: "0 0 8px", fontSize: 18, fontWeight: 600, color: "var(--sk-text-primary, #111827)" }, children: "Message Sent!" }),
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: 0, color: "var(--sk-text-secondary, #6b7280)", fontSize: 14 }, children: offlineSubheading })
|
|
910
926
|
] }) : /* @__PURE__ */ jsxRuntime.jsxs("form", { onSubmit: handleOfflineSubmit, children: [
|
|
911
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 16px", color: "#6b7280", fontSize: 14 }, children: offlineSubheading }),
|
|
927
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { margin: "0 0 16px", color: "var(--sk-text-secondary, #6b7280)", fontSize: 14 }, children: offlineSubheading }),
|
|
912
928
|
[
|
|
913
929
|
{ name: "name", type: "text", placeholder: "Your name *", required: true },
|
|
914
930
|
{ name: "email", type: "email", placeholder: "Your email *", required: true },
|
|
@@ -921,9 +937,9 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
921
937
|
value: offlineForm[field.name],
|
|
922
938
|
onChange: (e) => setOfflineForm((prev) => ({ ...prev, [field.name]: e.target.value })),
|
|
923
939
|
required: field.required,
|
|
924
|
-
style: { width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid #e5e7eb", fontSize: 14, outline: "none", boxSizing: "border-box" },
|
|
940
|
+
style: { width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid var(--sk-border, #e5e7eb)", fontSize: 14, outline: "none", boxSizing: "border-box" },
|
|
925
941
|
onFocus: (e) => e.currentTarget.style.borderColor = primaryColor,
|
|
926
|
-
onBlur: (e) => e.currentTarget.style.borderColor = "#e5e7eb"
|
|
942
|
+
onBlur: (e) => e.currentTarget.style.borderColor = "var(--sk-border, #e5e7eb)"
|
|
927
943
|
}
|
|
928
944
|
) }, field.name)),
|
|
929
945
|
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -934,12 +950,12 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
934
950
|
onChange: (e) => setOfflineForm((prev) => ({ ...prev, message: e.target.value })),
|
|
935
951
|
required: true,
|
|
936
952
|
rows: 4,
|
|
937
|
-
style: { width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid #e5e7eb", fontSize: 14, outline: "none", resize: "vertical", boxSizing: "border-box" },
|
|
953
|
+
style: { width: "100%", padding: "10px 12px", borderRadius: 8, border: "1px solid var(--sk-border, #e5e7eb)", fontSize: 14, outline: "none", resize: "vertical", boxSizing: "border-box" },
|
|
938
954
|
onFocus: (e) => e.currentTarget.style.borderColor = primaryColor,
|
|
939
|
-
onBlur: (e) => e.currentTarget.style.borderColor = "#e5e7eb"
|
|
955
|
+
onBlur: (e) => e.currentTarget.style.borderColor = "var(--sk-border, #e5e7eb)"
|
|
940
956
|
}
|
|
941
957
|
) }),
|
|
942
|
-
offlineError && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 12px", borderRadius: 8, backgroundColor: "#fef2f2", border: "1px solid #fecaca", color: "#dc2626", fontSize: 13, marginBottom: 12 }, children: offlineError }),
|
|
958
|
+
offlineError && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: "8px 12px", borderRadius: 8, backgroundColor: "var(--sk-error-bg, #fef2f2)", border: "1px solid var(--sk-error, #fecaca)", color: "var(--sk-error, #dc2626)", fontSize: 13, marginBottom: 12 }, children: offlineError }),
|
|
943
959
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
944
960
|
"button",
|
|
945
961
|
{
|
|
@@ -970,7 +986,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
970
986
|
position: "absolute",
|
|
971
987
|
inset: 0,
|
|
972
988
|
borderRadius: "50%",
|
|
973
|
-
backgroundColor:
|
|
989
|
+
backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb),
|
|
974
990
|
animation: "checkPulse 2s infinite ease-out"
|
|
975
991
|
}
|
|
976
992
|
}
|
|
@@ -982,7 +998,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
982
998
|
position: "absolute",
|
|
983
999
|
inset: 8,
|
|
984
1000
|
borderRadius: "50%",
|
|
985
|
-
backgroundColor:
|
|
1001
|
+
backgroundColor: hexAlpha("--sk-primary-rgb", 0.145, primaryRgb),
|
|
986
1002
|
animation: "checkPulse 2s infinite ease-out 0.4s"
|
|
987
1003
|
}
|
|
988
1004
|
}
|
|
@@ -1009,13 +1025,13 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1009
1025
|
)
|
|
1010
1026
|
] }),
|
|
1011
1027
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
1012
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 16, fontWeight: 600, color: "#111827", marginBottom: 6 }, children: checkingHandoff ? "Looking for online support" : "Checking for a team member" }),
|
|
1013
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 14, color: "#6b7280", lineHeight: 1.5 }, children: [
|
|
1028
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 16, fontWeight: 600, color: "var(--sk-text-primary, #111827)", marginBottom: 6 }, children: checkingHandoff ? "Looking for online support" : "Checking for a team member" }),
|
|
1029
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 14, color: "var(--sk-text-secondary, #6b7280)", lineHeight: 1.5 }, children: [
|
|
1014
1030
|
"One moment please",
|
|
1015
1031
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { display: "inline-flex", width: 20 }, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { animation: "checkDots 1.5s infinite steps(4, end)" }, children: "..." }) })
|
|
1016
1032
|
] })
|
|
1017
1033
|
] }),
|
|
1018
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "80%", height: 3, backgroundColor: "#e5e7eb", borderRadius: 2, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1034
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: "80%", height: 3, backgroundColor: "var(--sk-border, #e5e7eb)", borderRadius: 2, overflow: "hidden" }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1019
1035
|
"div",
|
|
1020
1036
|
{
|
|
1021
1037
|
style: {
|
|
@@ -1028,13 +1044,13 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1028
1044
|
}
|
|
1029
1045
|
}
|
|
1030
1046
|
) }),
|
|
1031
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "#9ca3af" }, children: "This usually takes just a few seconds" })
|
|
1047
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, color: "var(--sk-text-tertiary, #9ca3af)" }, children: "This usually takes just a few seconds" })
|
|
1032
1048
|
] });
|
|
1033
1049
|
const MessagesView = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1034
1050
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1035
1051
|
"div",
|
|
1036
1052
|
{
|
|
1037
|
-
style: { flex: 1, overflowY: "auto", padding: 16, display: "flex", flexDirection: "column", gap: 12, backgroundColor: "#f9fafb" },
|
|
1053
|
+
style: { flex: 1, overflowY: "auto", padding: 16, display: "flex", flexDirection: "column", gap: 12, backgroundColor: "var(--sk-bg-elevated, #f9fafb)" },
|
|
1038
1054
|
children: [
|
|
1039
1055
|
messages.map((message) => {
|
|
1040
1056
|
const isAssistant = message.role === "assistant" || message.role === "agent";
|
|
@@ -1045,8 +1061,8 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1045
1061
|
maxWidth: "80%",
|
|
1046
1062
|
padding: message.role === "system" ? "8px 12px" : isAssistant ? "12px 16px" : "10px 14px",
|
|
1047
1063
|
borderRadius: message.role === "user" ? "16px 16px 4px 16px" : message.role === "system" ? "8px" : "16px 16px 16px 4px",
|
|
1048
|
-
backgroundColor: message.role === "user" ? primaryColor : message.role === "system" ? "#e5e7eb" : "#ffffff",
|
|
1049
|
-
color: message.role === "user" ? isLightColor(primaryColor) ? "#1a1a1a" : "white" : message.role === "system" ? "#6b7280" : "#111827",
|
|
1064
|
+
backgroundColor: message.role === "user" ? primaryColor : message.role === "system" ? "var(--sk-border, #e5e7eb)" : "var(--sk-bg, #ffffff)",
|
|
1065
|
+
color: message.role === "user" ? isLightColor(primaryColor) ? "#1a1a1a" : "white" : message.role === "system" ? "var(--sk-text-secondary, #6b7280)" : "var(--sk-text-primary, #111827)",
|
|
1050
1066
|
boxShadow: message.role === "system" ? "none" : "0 1px 2px rgba(0,0,0,0.08)",
|
|
1051
1067
|
fontSize: message.role === "system" ? 13 : 14,
|
|
1052
1068
|
fontStyle: message.role === "system" ? "italic" : "normal",
|
|
@@ -1054,7 +1070,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1054
1070
|
whiteSpace: isAssistant ? "normal" : "pre-wrap",
|
|
1055
1071
|
wordBreak: "break-word",
|
|
1056
1072
|
textAlign: isAssistant ? "left" : void 0,
|
|
1057
|
-
borderLeft: isAssistant ? `3px solid ${
|
|
1073
|
+
borderLeft: isAssistant ? `3px solid ${hexAlpha("--sk-primary-rgb", 0.2, primaryRgb)}` : void 0
|
|
1058
1074
|
},
|
|
1059
1075
|
children: [
|
|
1060
1076
|
message.agentName && message.role === "agent" && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 12, opacity: 0.6, marginBottom: 4 }, children: message.agentName }),
|
|
@@ -1081,21 +1097,21 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1081
1097
|
marginRight: 6,
|
|
1082
1098
|
padding: "8px 14px",
|
|
1083
1099
|
borderRadius: 8,
|
|
1084
|
-
backgroundColor:
|
|
1100
|
+
backgroundColor: hexAlpha("--sk-primary-rgb", 0.082, primaryRgb),
|
|
1085
1101
|
color: primaryColor,
|
|
1086
1102
|
fontWeight: 600,
|
|
1087
1103
|
fontSize: 13,
|
|
1088
1104
|
textDecoration: "none",
|
|
1089
|
-
border: `1px solid ${
|
|
1105
|
+
border: `1px solid ${hexAlpha("--sk-primary-rgb", 0.25, primaryRgb)}`,
|
|
1090
1106
|
boxShadow: "0 1px 2px rgba(0,0,0,0.06)",
|
|
1091
1107
|
transition: "background-color 0.15s, transform 0.1s"
|
|
1092
1108
|
},
|
|
1093
1109
|
onMouseOver: (e) => {
|
|
1094
|
-
e.currentTarget.style.backgroundColor =
|
|
1110
|
+
e.currentTarget.style.backgroundColor = hexAlpha("--sk-primary-rgb", 0.145, primaryRgb);
|
|
1095
1111
|
e.currentTarget.style.transform = "translateY(-1px)";
|
|
1096
1112
|
},
|
|
1097
1113
|
onMouseOut: (e) => {
|
|
1098
|
-
e.currentTarget.style.backgroundColor =
|
|
1114
|
+
e.currentTarget.style.backgroundColor = hexAlpha("--sk-primary-rgb", 0.082, primaryRgb);
|
|
1099
1115
|
e.currentTarget.style.transform = "translateY(0)";
|
|
1100
1116
|
},
|
|
1101
1117
|
children
|
|
@@ -1127,7 +1143,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1127
1143
|
padding: "6px 12px",
|
|
1128
1144
|
borderRadius: 16,
|
|
1129
1145
|
border: `1px solid ${primaryColor}`,
|
|
1130
|
-
backgroundColor:
|
|
1146
|
+
backgroundColor: hexAlpha("--sk-primary-rgb", 0.063, primaryRgb),
|
|
1131
1147
|
color: primaryColor,
|
|
1132
1148
|
fontSize: 13,
|
|
1133
1149
|
cursor: "pointer"
|
|
@@ -1141,7 +1157,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1141
1157
|
{
|
|
1142
1158
|
type: "button",
|
|
1143
1159
|
onClick: retryFailedSend,
|
|
1144
|
-
style: { padding: "6px 12px", borderRadius: 6, border: "1px solid #ef4444", backgroundColor: "#fef2f2", color: "#dc2626", fontSize: 13, cursor: "pointer" },
|
|
1160
|
+
style: { padding: "6px 12px", borderRadius: 6, border: "1px solid var(--sk-error, #ef4444)", backgroundColor: "var(--sk-error-bg, #fef2f2)", color: "var(--sk-error, #dc2626)", fontSize: 13, cursor: "pointer" },
|
|
1145
1161
|
children: "Retry send"
|
|
1146
1162
|
}
|
|
1147
1163
|
) }),
|
|
@@ -1173,11 +1189,11 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1173
1189
|
style: {
|
|
1174
1190
|
padding: "10px 14px",
|
|
1175
1191
|
borderRadius: "16px 16px 16px 4px",
|
|
1176
|
-
backgroundColor: "#ffffff",
|
|
1192
|
+
backgroundColor: "var(--sk-bg, #ffffff)",
|
|
1177
1193
|
boxShadow: "0 1px 2px rgba(0,0,0,0.08)",
|
|
1178
1194
|
display: "flex",
|
|
1179
1195
|
gap: 4,
|
|
1180
|
-
color: "#9ca3af"
|
|
1196
|
+
color: "var(--sk-text-tertiary, #9ca3af)"
|
|
1181
1197
|
},
|
|
1182
1198
|
children: [
|
|
1183
1199
|
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { animation: "chatDot 1.4s infinite ease-in-out", animationDelay: "0s" }, children: "\u25CF" }),
|
|
@@ -1190,11 +1206,11 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1190
1206
|
]
|
|
1191
1207
|
}
|
|
1192
1208
|
),
|
|
1193
|
-
lastFailedSend && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "8px 12px", backgroundColor: "#fef2f2", borderTop: "1px solid #fecaca", display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8 }, children: [
|
|
1194
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "#dc2626" }, children: "Failed to send" }),
|
|
1195
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: retryFailedSend, style: { padding: "4px 10px", borderRadius: 6, border: "1px solid #dc2626", background: "#fff", color: "#dc2626", fontSize: 12, cursor: "pointer" }, children: "Retry" })
|
|
1209
|
+
lastFailedSend && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "8px 12px", backgroundColor: "var(--sk-error-bg, #fef2f2)", borderTop: "1px solid var(--sk-error, #fecaca)", display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8 }, children: [
|
|
1210
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 13, color: "var(--sk-error, #dc2626)" }, children: "Failed to send" }),
|
|
1211
|
+
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: retryFailedSend, style: { padding: "4px 10px", borderRadius: 6, border: "1px solid var(--sk-error, #dc2626)", background: "var(--sk-bg, #fff)", color: "var(--sk-error, #dc2626)", fontSize: 12, cursor: "pointer" }, children: "Retry" })
|
|
1196
1212
|
] }),
|
|
1197
|
-
/* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, style: { padding: 12, borderTop: "1px solid #e5e7eb", backgroundColor: "#ffffff" }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
1213
|
+
/* @__PURE__ */ jsxRuntime.jsx("form", { onSubmit: handleSubmit, style: { padding: 12, borderTop: "1px solid var(--sk-border, #e5e7eb)", backgroundColor: "var(--sk-bg, #ffffff)" }, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", gap: 8 }, children: [
|
|
1198
1214
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1199
1215
|
"input",
|
|
1200
1216
|
{
|
|
@@ -1212,13 +1228,13 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1212
1228
|
flex: 1,
|
|
1213
1229
|
padding: "10px 14px",
|
|
1214
1230
|
borderRadius: 24,
|
|
1215
|
-
border: "1px solid #e5e7eb",
|
|
1231
|
+
border: "1px solid var(--sk-border, #e5e7eb)",
|
|
1216
1232
|
fontSize: 14,
|
|
1217
1233
|
outline: "none",
|
|
1218
1234
|
transition: "border-color 0.2s"
|
|
1219
1235
|
},
|
|
1220
1236
|
onFocus: (e) => e.currentTarget.style.borderColor = primaryColor,
|
|
1221
|
-
onBlur: (e) => e.currentTarget.style.borderColor = "#e5e7eb"
|
|
1237
|
+
onBlur: (e) => e.currentTarget.style.borderColor = "var(--sk-border, #e5e7eb)"
|
|
1222
1238
|
}
|
|
1223
1239
|
),
|
|
1224
1240
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1231,7 +1247,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1231
1247
|
height: 40,
|
|
1232
1248
|
borderRadius: "50%",
|
|
1233
1249
|
border: "none",
|
|
1234
|
-
backgroundColor: (inputValue.trim() || pendingFiles.length) && !isLoading ? primaryColor : "#e5e7eb",
|
|
1250
|
+
backgroundColor: (inputValue.trim() || pendingFiles.length) && !isLoading ? primaryColor : "var(--sk-border, #e5e7eb)",
|
|
1235
1251
|
color: (inputValue.trim() || pendingFiles.length) && !isLoading && isLightColor(primaryColor) ? "#1a1a1a" : "white",
|
|
1236
1252
|
cursor: inputValue.trim() && !isLoading ? "pointer" : "not-allowed",
|
|
1237
1253
|
display: "flex",
|
|
@@ -1256,7 +1272,7 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1256
1272
|
maxWidth: "calc(100vw - 40px)",
|
|
1257
1273
|
height: 520,
|
|
1258
1274
|
maxHeight: "calc(100vh - 120px)",
|
|
1259
|
-
backgroundColor: "#ffffff",
|
|
1275
|
+
backgroundColor: "var(--sk-bg, #ffffff)",
|
|
1260
1276
|
borderRadius: 16,
|
|
1261
1277
|
boxShadow: "0 8px 32px rgba(0, 0, 0, 0.2)",
|
|
1262
1278
|
display: "flex",
|
|
@@ -1268,10 +1284,10 @@ function ChatWidget({ projectId: propProjectId, config, apiUrl: propApiUrl, sign
|
|
|
1268
1284
|
children: [
|
|
1269
1285
|
Header,
|
|
1270
1286
|
checkingAvailability || checkingHandoff ? CheckingScreen : showOfflineForm ? OfflineFormView : showWelcome && welcomeEnabled && messages.length === 0 ? WelcomeScreen : MessagesView,
|
|
1271
|
-
showPoweredBy && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "6px 0", textAlign: "center", fontSize: 11, color: "#9ca3af", backgroundColor: "#ffffff", borderTop: "1px solid #f3f4f6" }, children: [
|
|
1287
|
+
showPoweredBy && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "6px 0", textAlign: "center", fontSize: 11, color: "var(--sk-text-tertiary, #9ca3af)", backgroundColor: "var(--sk-bg, #ffffff)", borderTop: "1px solid var(--sk-bg-elevated, #f3f4f6)" }, children: [
|
|
1272
1288
|
"Powered by",
|
|
1273
1289
|
" ",
|
|
1274
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://sonor.io", target: "_blank", rel: "noopener noreferrer", style: { color: "#6b7280", textDecoration: "none", fontWeight: 500 }, children: "Sonor" })
|
|
1290
|
+
/* @__PURE__ */ jsxRuntime.jsx("a", { href: "https://sonor.io", target: "_blank", rel: "noopener noreferrer", style: { color: "var(--sk-text-secondary, #6b7280)", textDecoration: "none", fontWeight: 500 }, children: "Sonor" })
|
|
1275
1291
|
] }),
|
|
1276
1292
|
/* @__PURE__ */ jsxRuntime.jsx("style", { children: `
|
|
1277
1293
|
@keyframes chatSlideUp {
|
|
@@ -1491,7 +1507,7 @@ function NodeRenderer({ node, onClose, onAction, context }) {
|
|
|
1491
1507
|
}
|
|
1492
1508
|
);
|
|
1493
1509
|
case "Divider":
|
|
1494
|
-
return /* @__PURE__ */ jsxRuntime.jsx("hr", { style: { border: "none", borderTop: "1px solid #e5e7eb", ...computedStyle } });
|
|
1510
|
+
return /* @__PURE__ */ jsxRuntime.jsx("hr", { style: { border: "none", borderTop: "1px solid var(--sk-border, #e5e7eb)", ...computedStyle } });
|
|
1495
1511
|
case "Spacer":
|
|
1496
1512
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { ...computedStyle, width: props.width, height: props.height } });
|
|
1497
1513
|
case "Icon":
|
|
@@ -1503,7 +1519,7 @@ function NodeRenderer({ node, onClose, onAction, context }) {
|
|
|
1503
1519
|
style: computedStyle,
|
|
1504
1520
|
"data-engage-form": props.form_id,
|
|
1505
1521
|
...eventHandlers,
|
|
1506
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "16px", background: "#f5f5f5", borderRadius: "8px", textAlign: "center" }, children: [
|
|
1522
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "16px", background: "var(--sk-bg-elevated, #f5f5f5)", borderRadius: "8px", textAlign: "center" }, children: [
|
|
1507
1523
|
"Form: ",
|
|
1508
1524
|
props.form_id || "Not configured"
|
|
1509
1525
|
] })
|
|
@@ -1568,7 +1584,7 @@ function DesignRenderer({
|
|
|
1568
1584
|
}
|
|
1569
1585
|
function getApiConfig2() {
|
|
1570
1586
|
const isDev = typeof process !== "undefined" && process.env?.NODE_ENV === "development";
|
|
1571
|
-
const defaultApiUrl = isDev &&
|
|
1587
|
+
const defaultApiUrl = isDev && process.env?.SONOR_API_URL ? process.env.SONOR_API_URL : "https://api.sonor.io";
|
|
1572
1588
|
const apiUrl = typeof window !== "undefined" ? window.__SITE_KIT_API_URL__ || defaultApiUrl : defaultApiUrl;
|
|
1573
1589
|
const apiKey = typeof window !== "undefined" ? window.__SITE_KIT_API_KEY__ : void 0;
|
|
1574
1590
|
return { apiUrl, apiKey };
|
|
@@ -1596,11 +1612,11 @@ function EngageWidget({
|
|
|
1596
1612
|
if (debug) console.warn("[Engage] No API key configured");
|
|
1597
1613
|
return;
|
|
1598
1614
|
}
|
|
1599
|
-
let visitorId = typeof localStorage !== "undefined" ? localStorage.getItem("
|
|
1615
|
+
let visitorId = typeof localStorage !== "undefined" ? localStorage.getItem("_sk_vid") : null;
|
|
1600
1616
|
if (!visitorId) {
|
|
1601
1617
|
visitorId = crypto.randomUUID();
|
|
1602
|
-
if (typeof localStorage !== "undefined") localStorage.setItem("_uptrade_vid", visitorId);
|
|
1603
1618
|
}
|
|
1619
|
+
if (typeof localStorage !== "undefined") localStorage.setItem("_sk_vid", visitorId);
|
|
1604
1620
|
const url = typeof window !== "undefined" ? window.location.href : "";
|
|
1605
1621
|
try {
|
|
1606
1622
|
const response = await fetch(
|
|
@@ -1726,8 +1742,8 @@ function EngageWidget({
|
|
|
1726
1742
|
projectId: propProjectId ?? void 0,
|
|
1727
1743
|
config: {
|
|
1728
1744
|
position,
|
|
1729
|
-
buttonColor: "#
|
|
1730
|
-
// Default
|
|
1745
|
+
buttonColor: "#3b82f6"
|
|
1746
|
+
// Default blue, overridden by --sk-primary CSS var or API brand_primary
|
|
1731
1747
|
}
|
|
1732
1748
|
}
|
|
1733
1749
|
)
|
|
@@ -1737,7 +1753,7 @@ function EngageWidget({
|
|
|
1737
1753
|
}
|
|
1738
1754
|
function trackEngageEvent(apiUrl, apiKey, endpoint, data) {
|
|
1739
1755
|
if (!apiKey) return;
|
|
1740
|
-
const visitorId = typeof localStorage !== "undefined" ? localStorage.getItem("
|
|
1756
|
+
const visitorId = typeof localStorage !== "undefined" ? localStorage.getItem("_sk_vid") : null;
|
|
1741
1757
|
fetch(`${apiUrl.replace(/\/$/, "")}/engage/widget/${endpoint}`, {
|
|
1742
1758
|
method: "POST",
|
|
1743
1759
|
headers: { "Content-Type": "application/json", "x-api-key": apiKey },
|
|
@@ -1921,7 +1937,7 @@ function EngageElementRenderer({
|
|
|
1921
1937
|
"div",
|
|
1922
1938
|
{
|
|
1923
1939
|
style: {
|
|
1924
|
-
backgroundColor: "
|
|
1940
|
+
backgroundColor: "var(--sk-bg, #ffffff)",
|
|
1925
1941
|
padding: 24,
|
|
1926
1942
|
borderRadius: 8,
|
|
1927
1943
|
maxWidth: 500,
|
|
@@ -1962,8 +1978,8 @@ function EngageElementRenderer({
|
|
|
1962
1978
|
top: 0,
|
|
1963
1979
|
left: 0,
|
|
1964
1980
|
right: 0,
|
|
1965
|
-
backgroundColor: element.config?.backgroundColor || "#3b82f6",
|
|
1966
|
-
color: element.config?.textColor || "
|
|
1981
|
+
backgroundColor: element.config?.backgroundColor || "var(--sk-primary, #3b82f6)",
|
|
1982
|
+
color: element.config?.textColor || "var(--sk-bg, #ffffff)",
|
|
1967
1983
|
padding: "12px 24px",
|
|
1968
1984
|
display: "flex",
|
|
1969
1985
|
alignItems: "center",
|
|
@@ -2010,5 +2026,5 @@ function getDeviceType() {
|
|
|
2010
2026
|
exports.ChatWidget = ChatWidget;
|
|
2011
2027
|
exports.DesignRenderer = DesignRenderer;
|
|
2012
2028
|
exports.EngageWidget = EngageWidget;
|
|
2013
|
-
//# sourceMappingURL=chunk-
|
|
2014
|
-
//# sourceMappingURL=chunk-
|
|
2029
|
+
//# sourceMappingURL=chunk-6ZGM7S5O.js.map
|
|
2030
|
+
//# sourceMappingURL=chunk-6ZGM7S5O.js.map
|