@jrapps/my_tickets_chat_ui 0.2.1 → 0.2.2

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.
@@ -69,7 +69,7 @@ var defaultTheme = {
69
69
  buttonRadius: 8,
70
70
  borderRadius: 12
71
71
  };
72
- function buildThemeVars(partial) {
72
+ function buildThemeVars(partial, width, height) {
73
73
  const theme = { ...defaultTheme, ...partial };
74
74
  return {
75
75
  // Colours
@@ -91,8 +91,8 @@ function buildThemeVars(partial) {
91
91
  "--cw-font-family": FONT_FAMILY,
92
92
  "--cw-font-size": FONT_SIZE,
93
93
  "--cw-shadow": SHADOW,
94
- "--cw-width": WIDTH,
95
- "--cw-height": HEIGHT,
94
+ "--cw-width": width !== void 0 ? typeof width === "number" ? `${width}px` : width : WIDTH,
95
+ "--cw-height": height !== void 0 ? typeof height === "number" ? `${height}px` : height : HEIGHT,
96
96
  "--cw-header-height": HEADER_HEIGHT
97
97
  };
98
98
  }
@@ -1204,7 +1204,7 @@ var SiteChatComponentNew = import_react5.default.forwardRef(({
1204
1204
  onClose
1205
1205
  }, ref) => {
1206
1206
  const { open, openWidget, closeWidget } = useSiteChatComponentNew(defaultOpen);
1207
- const themeVars = buildThemeVars(theme);
1207
+ const themeVars = buildThemeVars(theme, width, height);
1208
1208
  const handleClose = () => {
1209
1209
  closeWidget();
1210
1210
  onClose == null ? void 0 : onClose();
@@ -1240,7 +1240,6 @@ var SiteChatComponentNew = import_react5.default.forwardRef(({
1240
1240
  role: "dialog",
1241
1241
  "aria-modal": "true",
1242
1242
  "aria-label": `${title} chat widget`,
1243
- style: { ...width !== void 0 && { width }, ...height !== void 0 && { height } },
1244
1243
  children: [
1245
1244
  /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
1246
1245
  Header_default,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/SiteChatComponentNew/index.ts", "../../../../src/components/SiteChatComponentNew/SiteChatComponentNew.tsx", "../../../../src/components/SiteChatComponentNew/useSiteChatComponentNew.ts", "../../../../src/components/SiteChatComponentNew/utils/theme.ts", "../../../../src/components/SiteChatComponentNew/utils/systemMessages.ts", "../../../../src/components/SiteChatComponentNew/utils/format.ts", "../../../../src/components/SiteChatComponentNew/Header/Header.css", "../../../../src/components/SiteChatComponentNew/Header/Header.tsx", "../../../../src/components/SiteChatComponentNew/Footer/Footer.tsx", "../../../../src/components/SiteChatComponentNew/Footer/Footer.css", "../../../../src/components/SiteChatComponentNew/hooks/useAutoScroll.ts", "../../../../src/components/SiteChatComponentNew/hooks/useOfflineForm.ts", "../../../../src/components/SiteChatComponentNew/Messages/UserMessage.css", "../../../../src/components/SiteChatComponentNew/Messages/UserMessage.tsx", "../../../../src/components/SiteChatComponentNew/Shared/Avatar.css", "../../../../src/components/SiteChatComponentNew/Shared/Avatar.tsx", "../../../../src/components/SiteChatComponentNew/Shared/Button.css", "../../../../src/components/SiteChatComponentNew/Shared/Button.tsx", "../../../../src/components/SiteChatComponentNew/Messages/AgentMessage.css", "../../../../src/components/SiteChatComponentNew/Messages/AgentMessage.tsx", "../../../../src/components/SiteChatComponentNew/Messages/SystemMessage.css", "../../../../src/components/SiteChatComponentNew/Messages/SystemMessage.tsx", "../../../../src/components/SiteChatComponentNew/Messages/AttachmentMessage.css", "../../../../src/components/SiteChatComponentNew/Messages/AttachmentMessage.tsx", "../../../../src/components/SiteChatComponentNew/Messages/MessageRenderer.tsx", "../../../../src/components/SiteChatComponentNew/Messages/MessageList.css", "../../../../src/components/SiteChatComponentNew/Messages/MessageList.tsx", "../../../../src/components/SiteChatComponentNew/Messages/TypingIndicator.css", "../../../../src/components/SiteChatComponentNew/Messages/TypingIndicator.tsx", "../../../../src/components/SiteChatComponentNew/States/LoadingState.css", "../../../../src/components/SiteChatComponentNew/States/LoadingState.tsx", "../../../../src/components/SiteChatComponentNew/States/StartChatState.css", "../../../../src/components/SiteChatComponentNew/States/StartChatState.tsx", "../../../../src/components/SiteChatComponentNew/OfflineForm/OfflineForm.css", "../../../../src/components/SiteChatComponentNew/OfflineForm/OfflineForm.tsx", "../../../../src/components/SiteChatComponentNew/States/OfflineState.css", "../../../../src/components/SiteChatComponentNew/States/OfflineState.tsx", "../../../../src/components/SiteChatComponentNew/States/ChatEndedState.css", "../../../../src/components/SiteChatComponentNew/States/ChatEndedState.tsx", "../../../../src/components/SiteChatComponentNew/SiteChatComponentNew.css"],
4
- "sourcesContent": ["export { SiteChatComponentNew } from './SiteChatComponentNew';\nexport type { ChatWidgetProps, UseChatWidgetReturn } from './SiteChatComponentNew.types';\nexport { useSiteChatComponentNew } from './useSiteChatComponentNew';\n", "import React from 'react';\nimport { ChatWidgetProps } from './SiteChatComponentNew.types';\nimport { useSiteChatComponentNew } from './useSiteChatComponentNew';\nimport { buildThemeVars } from './utils';\nimport Header from './Header/Header';\nimport Footer from './Footer/Footer';\nimport { MessageList } from './Messages';\nimport { LoadingState, StartChatState, OfflineState, ChatEndedState } from './States';\nimport './SiteChatComponentNew.css';\n\nexport const SiteChatComponentNew = React.forwardRef<HTMLDivElement, ChatWidgetProps>(({\n title,\n subtitle,\n image,\n theme,\n messages,\n offlineForm,\n defaultOpen = false,\n loading = false,\n chatEnded = false,\n width,\n height,\n onSend,\n onAttachment,\n onOfflineSubmit,\n onClose,\n}, ref) => {\n const { open, openWidget, closeWidget } = useSiteChatComponentNew(defaultOpen);\n const themeVars = buildThemeVars(theme);\n\n const handleClose = () => {\n closeWidget();\n onClose?.();\n };\n\n /**\n * Derive what to render from data:\n * loading=true \u2192 spinner\n * offlineForm provided \u2192 offline form\n * no messages yet \u2192 Start Chat screen\n * messages present \u2192 conversation (+ optional ended banner)\n */\n const renderBody = () => {\n if (loading) {\n return <LoadingState />;\n }\n\n if (offlineForm) {\n return <OfflineState form={offlineForm} onSubmit={onOfflineSubmit} />;\n }\n\n if (messages.length === 0) {\n return (\n <StartChatState\n image={image}\n title={title}\n description={subtitle}\n onStart={() => onSend('__start_chat__')}\n />\n );\n }\n\n return (\n <>\n <MessageList messages={messages} />\n {chatEnded ? <ChatEndedState /> : <Footer onSend={onSend} onAttachment={onAttachment} />}\n </>\n );\n };\n\n return (\n <div ref={ref} className=\"cw-root\" style={themeVars as React.CSSProperties}>\n {/* Chat panel */}\n {open && (\n <div\n className=\"cw-widget\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`${title} chat widget`}\n style={{ ...(width !== undefined && { width }), ...(height !== undefined && { height }) }}\n >\n <Header\n image={image}\n title={title}\n subtitle={subtitle}\n onClose={handleClose}\n />\n <div className=\"cw-widget__body\">{renderBody()}</div>\n </div>\n )}\n\n {/* Launcher button \u2014 only visible when the panel is closed */}\n {!open && (\n <button\n className=\"cw-launcher\"\n onClick={openWidget}\n aria-label=\"Open chat\"\n aria-haspopup=\"dialog\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"26\"\n height=\"26\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z\" />\n </svg>\n </button>\n )}\n </div>\n );\n});\n\nSiteChatComponentNew.displayName = 'SiteChatComponentNew';\n\n\n", "import { useState, useCallback } from 'react';\nimport { UseChatWidgetReturn } from './SiteChatComponentNew.types';\n\nexport function useSiteChatComponentNew(defaultOpen = false): UseChatWidgetReturn {\n const [open, setOpen] = useState(defaultOpen);\n\n const openWidget = useCallback(() => setOpen(true), []);\n const closeWidget = useCallback(() => setOpen(false), []);\n\n return { open, openWidget, closeWidget };\n}\n", "import { ChatTheme } from '../SiteChatComponentNew.types';\n\n// \u2500\u2500\u2500 Fixed layout / typography constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// These are intentionally not themeable \u2014 only colours and border widths change.\nconst FONT_FAMILY =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif\";\nconst FONT_SIZE = '14px';\nconst SHADOW = '0 4px 24px rgba(0,0,0,0.12)';\nconst WIDTH = '400px';\nconst HEIGHT = '600px';\nconst HEADER_HEIGHT = '64px';\n\n// \u2500\u2500\u2500 Default colour theme \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const defaultTheme: ChatTheme = {\n primary: '#4f46e5',\n background: '#ffffff',\n surface: '#f9fafb',\n border: '#e5e7eb',\n userBubble: '#4f46e5',\n userText: '#ffffff',\n agentBubble: '#f3f4f6',\n agentText: '#111827',\n systemText: '#6b7280',\n inputBackground: '#ffffff',\n inputBorder: '#d1d5db',\n buttonRadius: 8,\n borderRadius: 12,\n};\n\n/**\n * Merges a partial user theme with the defaults and returns a style object\n * containing CSS custom properties. Layout/font values are always fixed.\n */\nexport function buildThemeVars(\n partial?: Partial<ChatTheme>,\n): Record<string, string> {\n const theme: ChatTheme = { ...defaultTheme, ...partial };\n\n return {\n // Colours\n '--cw-primary': theme.primary,\n '--cw-background': theme.background,\n '--cw-surface': theme.surface,\n '--cw-border': theme.border,\n '--cw-user-bubble': theme.userBubble,\n '--cw-user-text': theme.userText,\n '--cw-agent-bubble': theme.agentBubble,\n '--cw-agent-text': theme.agentText,\n '--cw-system-text': theme.systemText,\n '--cw-input-background': theme.inputBackground,\n '--cw-input-border': theme.inputBorder,\n // Border radii\n '--cw-button-radius': `${theme.buttonRadius}px`,\n '--cw-border-radius': `${theme.borderRadius}px`,\n // Fixed constants \u2014 not exposed as theme props\n '--cw-font-family': FONT_FAMILY,\n '--cw-font-size': FONT_SIZE,\n '--cw-shadow': SHADOW,\n '--cw-width': WIDTH,\n '--cw-height': HEIGHT,\n '--cw-header-height': HEADER_HEIGHT,\n };\n}\n", "import { SystemEventType } from '../SiteChatComponentNew.types';\n\nconst systemEventLabels: Record<SystemEventType, string> = {\n AGENT_JOINED: 'Agent joined',\n AGENT_LEFT: 'Agent left',\n USER_JOINED: 'You joined',\n USER_LEFT: 'You left',\n CHAT_ENDED: 'Chat ended',\n CHAT_REOPENED: 'Chat reopened',\n CHAT_TRANSFERRED: 'Chat transferred',\n WAITING_FOR_AGENT: 'Waiting for an agent',\n};\n\nexport function getSystemLabel(event: string): string {\n return systemEventLabels[event as SystemEventType] ?? event;\n}\n\nexport function isSystemEventType(value: string): value is SystemEventType {\n return value in systemEventLabels;\n}\n", "/**\n * Format a Unix timestamp (ms) into a human-readable time string, e.g. \"2:34 PM\".\n */\nexport function formatTime(timestamp: number): string {\n return new Date(timestamp).toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\n/**\n * Generate a simple unique id.\n */\nexport function generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n}\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-45eba566\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-45eba566\";\n s.textContent = \".cw-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n padding: 0 16px;\\n height: var(--cw-header-height);\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n flex-shrink: 0;\\n border-radius: var(--cw-border-radius) var(--cw-border-radius) 0 0;\\n}\\n\\n.cw-header__identity {\\n display: flex;\\n align-items: center;\\n gap: 12px;\\n min-width: 0;\\n}\\n\\n.cw-header__avatar {\\n width: 40px;\\n height: 40px;\\n border-radius: 50%;\\n object-fit: cover;\\n flex-shrink: 0;\\n border: 2px solid rgba(255, 255, 255, 0.4);\\n}\\n\\n.cw-header__text {\\n display: flex;\\n flex-direction: column;\\n min-width: 0;\\n}\\n\\n.cw-header__title {\\n font-size: 15px;\\n font-weight: 600;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n line-height: 1.3;\\n}\\n\\n.cw-header__subtitle {\\n font-size: 12px;\\n opacity: 0.85;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n line-height: 1.3;\\n}\\n\\n.cw-header__close {\\n background: none;\\n border: none;\\n cursor: pointer;\\n color: #ffffff;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 6px;\\n border-radius: 50%;\\n flex-shrink: 0;\\n transition: background-color 0.15s ease;\\n}\\n\\n.cw-header__close:hover {\\n background-color: rgba(255, 255, 255, 0.15);\\n}\\n\\n.cw-header__close:focus-visible {\\n outline: 2px solid #ffffff;\\n outline-offset: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { HeaderProps } from '../SiteChatComponentNew.types';\nimport './Header.css';\n\nconst Header: React.FC<HeaderProps> = ({ image, title, subtitle, onClose }) => {\n return (\n <header className=\"cw-header\" role=\"banner\">\n <div className=\"cw-header__identity\">\n {image && (\n <img\n src={image}\n alt={`${title} avatar`}\n className=\"cw-header__avatar\"\n />\n )}\n <div className=\"cw-header__text\">\n <span className=\"cw-header__title\">{title}</span>\n {subtitle && (\n <span className=\"cw-header__subtitle\">{subtitle}</span>\n )}\n </div>\n </div>\n <button\n className=\"cw-header__close\"\n onClick={onClose}\n aria-label=\"Close chat\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n </header>\n );\n};\n\nexport default Header;\n", "import React, { useRef, useState, useCallback } from 'react';\nimport { FooterProps } from '../SiteChatComponentNew.types';\nimport './Footer.css';\n\nconst Footer: React.FC<FooterProps> = ({ onSend, onAttachment, disabled }) => {\n const [text, setText] = useState('');\n const fileInputRef = useRef<HTMLInputElement | null>(null);\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n\n const isEmpty = text.trim().length === 0;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (!isEmpty && !disabled) {\n onSend(text.trim());\n setText('');\n // Reset textarea height\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n }\n }\n }\n },\n [isEmpty, disabled, onSend, text],\n );\n\n const handleSend = useCallback(() => {\n if (!isEmpty && !disabled) {\n onSend(text.trim());\n setText('');\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.focus();\n }\n }\n }, [isEmpty, disabled, onSend, text]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setText(e.target.value);\n // Auto-grow textarea up to ~120px\n const el = e.target;\n el.style.height = 'auto';\n el.style.height = `${Math.min(el.scrollHeight, 120)}px`;\n },\n [],\n );\n\n const handleAttachmentClick = useCallback(() => {\n fileInputRef.current?.click();\n }, []);\n\n const handleFileChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file) {\n onAttachment(file);\n }\n // Reset the file input so same file can be re-selected\n if (fileInputRef.current) {\n fileInputRef.current.value = '';\n }\n },\n [onAttachment],\n );\n\n return (\n <footer className=\"cw-footer\" role=\"contentinfo\">\n <button\n className=\"cw-footer__attach-btn\"\n onClick={handleAttachmentClick}\n aria-label=\"Attach file\"\n type=\"button\"\n disabled={disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\" />\n </svg>\n </button>\n\n <textarea\n ref={textareaRef}\n className=\"cw-footer__input\"\n value={text}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n placeholder=\"Type a message\u2026\"\n aria-label=\"Message input\"\n rows={1}\n disabled={disabled}\n />\n\n <button\n className={`cw-footer__send-btn${isEmpty || disabled ? ' cw-footer__send-btn--disabled' : ''}`}\n onClick={handleSend}\n aria-label=\"Send message\"\n type=\"button\"\n disabled={isEmpty || disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n </button>\n\n {/* Hidden file input */}\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"cw-footer__file-input\"\n onChange={handleFileChange}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n </footer>\n );\n};\n\nexport default Footer;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-ebcf221d\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-ebcf221d\";\n s.textContent = \".cw-footer {\\n display: flex;\\n align-items: flex-end;\\n gap: 8px;\\n padding: 10px 12px;\\n background-color: var(--cw-background);\\n border-top: 1px solid var(--cw-border);\\n flex-shrink: 0;\\n}\\n\\n.cw-footer__input {\\n flex: 1;\\n resize: none;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n padding: 8px 12px;\\n line-height: 1.5;\\n min-height: 38px;\\n max-height: 120px;\\n overflow-y: auto;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-footer__input:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-footer__input:disabled {\\n opacity: 0.5;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__attach-btn,\\n.cw-footer__send-btn {\\n background: none;\\n border: none;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 8px;\\n border-radius: 50%;\\n flex-shrink: 0;\\n transition: background-color 0.15s ease, color 0.15s ease;\\n color: var(--cw-primary);\\n margin-bottom: 1px;\\n}\\n\\n.cw-footer__attach-btn:hover,\\n.cw-footer__send-btn:not(.cw-footer__send-btn--disabled):hover {\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n}\\n\\n.cw-footer__attach-btn:focus-visible,\\n.cw-footer__send-btn:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-footer__attach-btn:disabled {\\n opacity: 0.4;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__send-btn--disabled {\\n opacity: 0.35;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__file-input {\\n display: none;\\n}\\n\";\n document.head.appendChild(s);\n}", "import { useEffect, useRef, useState } from 'react';\n\n/**\n * Attaches a ref to a scrollable container. Automatically scrolls to the\n * bottom when new content is added, unless the user has manually scrolled up.\n */\nexport function useAutoScroll<T extends HTMLElement>(\n dependency: unknown,\n): React.MutableRefObject<T | null> {\n const ref = useRef<T | null>(null);\n const userScrolledUp = useRef(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleScroll = () => {\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight < 64;\n userScrolledUp.current = !atBottom;\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, []);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || userScrolledUp.current) return;\n\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n }, [dependency]);\n\n return ref;\n}\n\n/**\n * Expose a way for the consumer to force-scroll to bottom (e.g. when\n * the user clicks a \"scroll to bottom\" button).\n */\nexport function useAutoScrollWithControl<T extends HTMLElement>(\n dependency: unknown,\n): {\n ref: React.MutableRefObject<T | null>;\n scrollToBottom: () => void;\n isScrolledUp: boolean;\n} {\n const ref = useRef<T | null>(null);\n const userScrolledUp = useRef(false);\n const [isScrolledUp, setIsScrolledUp] = useState(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleScroll = () => {\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight < 64;\n userScrolledUp.current = !atBottom;\n setIsScrolledUp(!atBottom);\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, []);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || userScrolledUp.current) return;\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n }, [dependency]);\n\n const scrollToBottom = () => {\n const el = ref.current;\n if (!el) return;\n userScrolledUp.current = false;\n setIsScrolledUp(false);\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n };\n\n return { ref, scrollToBottom, isScrolledUp };\n}\n", "import { useState, useCallback } from 'react';\nimport { OfflineField, OfflineFormSchema } from '../SiteChatComponentNew.types';\n\ntype FieldValues = Record<string, unknown>;\ntype FieldErrors = Record<string, string>;\n\nfunction validateField(field: OfflineField, value: unknown): string {\n if (field.required) {\n if (field.type === 'checkbox' && !value) {\n return `${field.label} is required.`;\n }\n if (\n field.type !== 'checkbox' &&\n (value === undefined || value === null || String(value).trim() === '')\n ) {\n return `${field.label} is required.`;\n }\n }\n\n if (field.type === 'email') {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (value && !emailRegex.test(String(value))) {\n return 'Please enter a valid email address.';\n }\n }\n\n if (field.type === 'phone') {\n const phoneRegex = /^\\+?[\\d\\s\\-().]{7,20}$/;\n if (value && !phoneRegex.test(String(value))) {\n return 'Please enter a valid phone number.';\n }\n }\n\n return '';\n}\n\nexport function useOfflineForm(schema: OfflineFormSchema) {\n const initialValues: FieldValues = {};\n for (const field of schema.fields) {\n initialValues[field.id] = field.type === 'checkbox' ? false : '';\n }\n\n const [values, setValues] = useState<FieldValues>(initialValues);\n const [errors, setErrors] = useState<FieldErrors>({});\n const [submitted, setSubmitted] = useState(false);\n\n const setValue = useCallback(\n (id: string, value: unknown) => {\n setValues((prev) => ({ ...prev, [id]: value }));\n\n if (submitted) {\n const field = schema.fields.find((f) => f.id === id);\n if (field) {\n const error = validateField(field, value);\n setErrors((prev) => ({ ...prev, [id]: error }));\n }\n }\n },\n [schema.fields, submitted],\n );\n\n const validate = useCallback((): boolean => {\n const newErrors: FieldErrors = {};\n let valid = true;\n\n for (const field of schema.fields) {\n const error = validateField(field, values[field.id]);\n newErrors[field.id] = error;\n if (error) valid = false;\n }\n\n setErrors(newErrors);\n return valid;\n }, [schema.fields, values]);\n\n const handleSubmit = useCallback(\n (onSubmit: (values: FieldValues) => void) => {\n setSubmitted(true);\n if (validate()) {\n onSubmit(values);\n }\n },\n [validate, values],\n );\n\n const reset = useCallback(() => {\n setValues(initialValues);\n setErrors({});\n setSubmitted(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return { values, errors, setValue, handleSubmit, reset };\n}\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-aed321e0\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-aed321e0\";\n s.textContent = \".cw-user-message {\\n display: flex;\\n flex-direction: column;\\n align-items: flex-end;\\n max-width: 75%;\\n align-self: flex-end;\\n gap: 3px;\\n}\\n\\n.cw-user-message__bubble {\\n background-color: var(--cw-user-bubble);\\n color: var(--cw-user-text);\\n padding: 10px 14px;\\n border-radius: 18px 18px 4px 18px;\\n font-size: var(--cw-font-size);\\n line-height: 1.5;\\n word-break: break-word;\\n white-space: pre-wrap;\\n}\\n\\n.cw-user-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-right: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport './UserMessage.css';\n\ninterface UserMessageProps {\n message: MessageProps;\n}\n\nconst UserMessage: React.FC<UserMessageProps> = ({ message }) => {\n return (\n <div className=\"cw-user-message\" role=\"listitem\" aria-label=\"Your message\">\n <div className=\"cw-user-message__bubble\">{message.message}</div>\n {message.timestamp !== undefined && (\n <span className=\"cw-user-message__time\">\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n );\n};\n\nexport default UserMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-ce14fbec\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-ce14fbec\";\n s.textContent = \".cw-avatar {\\n border-radius: 50%;\\n flex-shrink: 0;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n}\\n\\n.cw-avatar--image {\\n object-fit: cover;\\n}\\n\\n.cw-avatar--initials {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n font-weight: 600;\\n user-select: none;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n src?: string;\n name?: string;\n size?: number;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(' ')\n .slice(0, 2)\n .map((w) => w[0])\n .join('')\n .toUpperCase();\n}\n\nconst Avatar: React.FC<AvatarProps> = ({ src, name, size = 32 }) => {\n const style = {\n width: `${size}px`,\n height: `${size}px`,\n fontSize: `${Math.round(size * 0.38)}px`,\n };\n\n if (src) {\n return (\n <img\n src={src}\n alt={name ? `${name} avatar` : 'Agent avatar'}\n className=\"cw-avatar cw-avatar--image\"\n style={style}\n />\n );\n }\n\n return (\n <span\n className=\"cw-avatar cw-avatar--initials\"\n aria-label={name ? `${name} avatar` : 'Agent avatar'}\n style={style}\n >\n {name ? getInitials(name) : 'A'}\n </span>\n );\n};\n\nexport default Avatar;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-2aa106ea\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-2aa106ea\";\n s.textContent = \".cw-button {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n gap: 8px;\\n padding: 10px 20px;\\n border: none;\\n border-radius: var(--cw-button-radius);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n font-weight: 600;\\n cursor: pointer;\\n transition: opacity 0.15s ease, transform 0.1s ease;\\n white-space: nowrap;\\n}\\n\\n.cw-button:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 3px;\\n}\\n\\n.cw-button:active:not(:disabled) {\\n transform: scale(0.98);\\n}\\n\\n.cw-button:disabled {\\n opacity: 0.45;\\n cursor: not-allowed;\\n}\\n\\n.cw-button--primary {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n}\\n\\n.cw-button--primary:hover:not(:disabled) {\\n opacity: 0.88;\\n}\\n\\n.cw-button--secondary {\\n background-color: var(--cw-surface);\\n color: var(--cw-primary);\\n border: 1px solid var(--cw-border);\\n}\\n\\n.cw-button--secondary:hover:not(:disabled) {\\n background-color: var(--cw-border);\\n}\\n\\n.cw-button--full {\\n width: 100%;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './Button.css';\n\ninterface ButtonProps {\n children: React.ReactNode;\n onClick?: () => void;\n variant?: 'primary' | 'secondary';\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n fullWidth?: boolean;\n ariaLabel?: string;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n children,\n onClick,\n variant = 'primary',\n disabled = false,\n type = 'button',\n fullWidth = false,\n ariaLabel,\n}) => {\n return (\n <button\n className={`cw-button cw-button--${variant}${fullWidth ? ' cw-button--full' : ''}`}\n onClick={onClick}\n disabled={disabled}\n type={type}\n aria-label={ariaLabel}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-5df522b1\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-5df522b1\";\n s.textContent = \".cw-agent-message {\\n display: flex;\\n align-items: flex-end;\\n gap: 8px;\\n max-width: 75%;\\n align-self: flex-start;\\n}\\n\\n.cw-agent-message__content {\\n display: flex;\\n flex-direction: column;\\n gap: 3px;\\n}\\n\\n.cw-agent-message__name {\\n font-size: 11px;\\n font-weight: 600;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\\n.cw-agent-message__bubble {\\n background-color: var(--cw-agent-bubble);\\n color: var(--cw-agent-text);\\n padding: 10px 14px;\\n border-radius: 18px 18px 18px 4px;\\n font-size: var(--cw-font-size);\\n line-height: 1.5;\\n word-break: break-word;\\n white-space: pre-wrap;\\n}\\n\\n.cw-agent-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport { Avatar } from '../Shared';\nimport './AgentMessage.css';\n\ninterface AgentMessageProps {\n message: MessageProps;\n}\n\nconst AgentMessage: React.FC<AgentMessageProps> = ({ message }) => {\n return (\n <div\n className=\"cw-agent-message\"\n role=\"listitem\"\n aria-label={`Message from ${message.senderName ?? 'Agent'}`}\n >\n <Avatar name={message.senderName} size={32} />\n <div className=\"cw-agent-message__content\">\n {message.senderName && (\n <span className=\"cw-agent-message__name\">{message.senderName}</span>\n )}\n <div className=\"cw-agent-message__bubble\">{message.message}</div>\n {message.timestamp !== undefined && (\n <span className=\"cw-agent-message__time\">\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n </div>\n );\n};\n\nexport default AgentMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-464a3601\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-464a3601\";\n s.textContent = \".cw-system-message {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n align-self: stretch;\\n padding: 4px 8px;\\n}\\n\\n.cw-system-message__line {\\n flex: 1;\\n border-top: 1px dashed var(--cw-border);\\n}\\n\\n.cw-system-message__text {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n white-space: nowrap;\\n flex-shrink: 0;\\n font-style: italic;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { getSystemLabel } from '../utils';\nimport './SystemMessage.css';\n\ninterface SystemMessageProps {\n message: MessageProps;\n}\n\nconst SystemMessage: React.FC<SystemMessageProps> = ({ message }) => {\n const label = message.message\n ? getSystemLabel(message.message)\n : message.message ?? '';\n\n return (\n <div\n className=\"cw-system-message\"\n role=\"listitem\"\n aria-label={`System notification: ${label}`}\n >\n <span className=\"cw-system-message__line\" aria-hidden=\"true\" />\n <span className=\"cw-system-message__text\">{label}</span>\n <span className=\"cw-system-message__line\" aria-hidden=\"true\" />\n </div>\n );\n};\n\nexport default SystemMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-dd846dee\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-dd846dee\";\n s.textContent = \".cw-attachment-message {\\n display: flex;\\n flex-direction: column;\\n gap: 3px;\\n align-self: flex-start;\\n max-width: 80%;\\n}\\n\\n.cw-attachment-message--user {\\n align-self: flex-end;\\n align-items: flex-end;\\n}\\n\\n.cw-attachment-message__card {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n background-color: var(--cw-agent-bubble);\\n border: 1px solid var(--cw-border);\\n border-radius: 12px;\\n padding: 10px 14px;\\n}\\n\\n.cw-attachment-message--user .cw-attachment-message__card {\\n background-color: var(--cw-user-bubble);\\n border-color: transparent;\\n color: var(--cw-user-text);\\n}\\n\\n.cw-attachment-message__icon {\\n flex-shrink: 0;\\n opacity: 0.75;\\n display: flex;\\n align-items: center;\\n}\\n\\n.cw-attachment-message__info {\\n display: flex;\\n flex-direction: column;\\n min-width: 0;\\n flex: 1;\\n}\\n\\n.cw-attachment-message__name {\\n font-size: 13px;\\n font-weight: 600;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n}\\n\\n.cw-attachment-message__label {\\n font-size: 11px;\\n opacity: 0.65;\\n}\\n\\n.cw-attachment-message__open-btn {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n border: none;\\n border-radius: 6px;\\n padding: 5px 12px;\\n font-family: var(--cw-font-family);\\n font-size: 12px;\\n font-weight: 600;\\n cursor: pointer;\\n flex-shrink: 0;\\n transition: opacity 0.15s ease;\\n}\\n\\n.cw-attachment-message--user .cw-attachment-message__open-btn {\\n background-color: rgba(255, 255, 255, 0.25);\\n color: #ffffff;\\n}\\n\\n.cw-attachment-message__open-btn:hover {\\n opacity: 0.85;\\n}\\n\\n.cw-attachment-message__open-btn:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-attachment-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\\n.cw-attachment-message__time--right {\\n padding-left: 0;\\n padding-right: 2px;\\n align-self: flex-end;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport './AttachmentMessage.css';\n\ninterface AttachmentMessageProps {\n message: MessageProps;\n}\n\nconst AttachmentMessage: React.FC<AttachmentMessageProps> = ({ message }) => {\n // Support both `item` (new) and `attachment` (legacy) field names\n const attachment = message.item ?? message.attachment;\n if (!attachment) return null;\n\n const handleOpen = () => {\n window.open(attachment.url, '_blank', 'noopener,noreferrer');\n };\n\n return (\n <div\n className={`cw-attachment-message${message.senderType === 'user' ? ' cw-attachment-message--user' : ''}`}\n role=\"listitem\"\n aria-label={`Attachment: ${attachment.name}`}\n >\n <div className=\"cw-attachment-message__card\">\n <div className=\"cw-attachment-message__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14 2 14 8 20 8\" />\n </svg>\n </div>\n <div className=\"cw-attachment-message__info\">\n <span className=\"cw-attachment-message__name\">{attachment.name}</span>\n <span className=\"cw-attachment-message__label\">Attachment</span>\n </div>\n <button\n className=\"cw-attachment-message__open-btn\"\n onClick={handleOpen}\n aria-label={`Open attachment ${attachment.name}`}\n type=\"button\"\n >\n Open\n </button>\n </div>\n {message.timestamp !== undefined && (\n <span\n className={`cw-attachment-message__time${message.senderType === 'user' ? ' cw-attachment-message__time--right' : ''}`}\n >\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n );\n};\n\nexport default AttachmentMessage;\n", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport UserMessage from './UserMessage';\nimport AgentMessage from './AgentMessage';\nimport SystemMessage from './SystemMessage';\nimport AttachmentMessage from './AttachmentMessage';\n\ninterface MessageRendererProps {\n message: MessageProps;\n}\n\nconst MessageRenderer: React.FC<MessageRendererProps> = ({ message }) => {\n if (message.messageType === 'ATTACHMENT') {\n return <AttachmentMessage message={message} />;\n }\n\n switch (message.senderType) {\n case 'user':\n return <UserMessage message={message} />;\n case 'agent':\n return <AgentMessage message={message} />;\n case 'system':\n return <SystemMessage message={message} />;\n default:\n return null;\n }\n};\n\nexport default MessageRenderer;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-15ae1a6b\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-15ae1a6b\";\n s.textContent = \".cw-message-list {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n overflow-y: auto;\\n padding: 16px;\\n background-color: var(--cw-background);\\n scroll-behavior: smooth;\\n}\\n\\n/* Scrollbar styling */\\n.cw-message-list::-webkit-scrollbar {\\n width: 5px;\\n}\\n\\n.cw-message-list::-webkit-scrollbar-track {\\n background: transparent;\\n}\\n\\n.cw-message-list::-webkit-scrollbar-thumb {\\n background-color: var(--cw-border);\\n border-radius: 10px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { useAutoScroll } from '../hooks';\nimport MessageRenderer from './MessageRenderer';\nimport './MessageList.css';\n\ninterface MessageListProps {\n messages: MessageProps[];\n}\n\nconst MessageList: React.FC<MessageListProps> = ({ messages }) => {\n const scrollRef = useAutoScroll<HTMLDivElement>(messages);\n\n return (\n <div\n ref={scrollRef}\n className=\"cw-message-list\"\n role=\"list\"\n aria-label=\"Chat messages\"\n aria-live=\"polite\"\n aria-relevant=\"additions\"\n >\n {messages.map((msg, index) => (\n <MessageRenderer\n key={msg._id ?? `${msg.timestamp ?? index}-${index}`}\n message={msg}\n />\n ))}\n {/* TypingIndicator removed \u2014 no longer part of the public API */}\n </div>\n );\n};\n\nexport default MessageList;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-4b0ca05b\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-4b0ca05b\";\n s.textContent = \"@keyframes cw-bounce {\\n 0%, 60%, 100% {\\n transform: translateY(0);\\n }\\n 30% {\\n transform: translateY(-6px);\\n }\\n}\\n\\n.cw-typing-indicator {\\n align-self: flex-start;\\n}\\n\\n.cw-typing-indicator__bubble {\\n display: inline-flex;\\n align-items: center;\\n gap: 4px;\\n background-color: var(--cw-agent-bubble);\\n border-radius: 18px 18px 18px 4px;\\n padding: 10px 14px;\\n}\\n\\n.cw-typing-indicator__dot {\\n display: block;\\n width: 7px;\\n height: 7px;\\n border-radius: 50%;\\n background-color: var(--cw-system-text);\\n animation: cw-bounce 1.2s infinite ease-in-out;\\n}\\n\\n.cw-typing-indicator__dot:nth-child(2) {\\n animation-delay: 0.2s;\\n}\\n\\n.cw-typing-indicator__dot:nth-child(3) {\\n animation-delay: 0.4s;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './TypingIndicator.css';\n\nconst TypingIndicator: React.FC = () => {\n return (\n <div\n className=\"cw-typing-indicator\"\n role=\"status\"\n aria-label=\"Agent is typing\"\n >\n <div className=\"cw-typing-indicator__bubble\">\n <span className=\"cw-typing-indicator__dot\" />\n <span className=\"cw-typing-indicator__dot\" />\n <span className=\"cw-typing-indicator__dot\" />\n </div>\n </div>\n );\n};\n\nexport default TypingIndicator;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-7a5a4f05\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-7a5a4f05\";\n s.textContent = \"@keyframes cw-spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\\n.cw-loading-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 12px;\\n}\\n\\n.cw-loading-state__spinner {\\n width: 48px;\\n height: 48px;\\n}\\n\\n.cw-loading-state__spinner-ring {\\n width: 48px;\\n height: 48px;\\n border-radius: 50%;\\n border: 3px solid var(--cw-border);\\n border-top-color: var(--cw-primary);\\n animation: cw-spin 0.8s linear infinite;\\n}\\n\\n.cw-loading-state__title {\\n font-size: 16px;\\n font-weight: 600;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-loading-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 240px;\\n line-height: 1.5;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './LoadingState.css';\n\nconst LoadingState: React.FC = () => {\n return (\n <div\n className=\"cw-loading-state\"\n role=\"status\"\n aria-label=\"Connecting to chat\"\n >\n <div className=\"cw-loading-state__spinner\" aria-hidden=\"true\">\n <div className=\"cw-loading-state__spinner-ring\" />\n </div>\n <p className=\"cw-loading-state__title\">Connecting\u2026</p>\n <p className=\"cw-loading-state__subtitle\">\n Please wait while we connect you to an available agent.\n </p>\n </div>\n );\n};\n\nexport default LoadingState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-3e05ef30\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-3e05ef30\";\n s.textContent = \".cw-start-chat-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px 24px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 14px;\\n}\\n\\n.cw-start-chat-state__image {\\n width: 80px;\\n height: 80px;\\n object-fit: contain;\\n border-radius: 50%;\\n margin-bottom: 4px;\\n}\\n\\n.cw-start-chat-state__title {\\n font-size: 20px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-start-chat-state__description {\\n font-size: 14px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 260px;\\n line-height: 1.6;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { Button } from '../Shared';\nimport './StartChatState.css';\n\ninterface StartChatStateProps {\n image?: string;\n title: string;\n description?: string;\n onStart: () => void;\n}\n\nconst StartChatState: React.FC<StartChatStateProps> = ({\n image,\n title,\n description,\n onStart,\n}) => {\n return (\n <div\n className=\"cw-start-chat-state\"\n role=\"main\"\n aria-label=\"Start a chat\"\n >\n {image && (\n <img\n src={image}\n alt=\"Support illustration\"\n className=\"cw-start-chat-state__image\"\n />\n )}\n <h2 className=\"cw-start-chat-state__title\">{title}</h2>\n {description && (\n <p className=\"cw-start-chat-state__description\">{description}</p>\n )}\n <Button onClick={onStart} ariaLabel=\"Start chat\">\n Start Chat\n </Button>\n </div>\n );\n};\n\nexport default StartChatState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-d9ff3956\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-d9ff3956\";\n s.textContent = \".cw-offline-form {\\n display: flex;\\n flex-direction: column;\\n gap: 14px;\\n}\\n\\n.cw-offline-form__title {\\n font-size: 15px;\\n font-weight: 600;\\n color: var(--cw-agent-text);\\n margin: 0 0 4px;\\n}\\n\\n/* Field wrapper */\\n.cw-offline-form__field {\\n display: flex;\\n flex-direction: column;\\n gap: 5px;\\n}\\n\\n.cw-offline-form__field--checkbox {\\n gap: 4px;\\n}\\n\\n/* Label */\\n.cw-offline-form__label {\\n font-size: 13px;\\n font-weight: 500;\\n color: var(--cw-agent-text);\\n}\\n\\n.cw-offline-form__required {\\n color: #ef4444;\\n}\\n\\n/* Text input */\\n.cw-offline-form__input {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n box-sizing: border-box;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__input:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__input--error {\\n border-color: #ef4444;\\n}\\n\\n/* Textarea */\\n.cw-offline-form__textarea {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n resize: vertical;\\n box-sizing: border-box;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__textarea:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__textarea--error {\\n border-color: #ef4444;\\n}\\n\\n/* Select */\\n.cw-offline-form__select {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n box-sizing: border-box;\\n appearance: none;\\n background-image: url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\\\");\\n background-repeat: no-repeat;\\n background-position: right 12px center;\\n padding-right: 32px;\\n cursor: pointer;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__select:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__select--error {\\n border-color: #ef4444;\\n}\\n\\n/* Checkbox */\\n.cw-offline-form__checkbox-label {\\n display: flex;\\n align-items: flex-start;\\n gap: 8px;\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--cw-agent-text);\\n}\\n\\n.cw-offline-form__checkbox {\\n width: 16px;\\n height: 16px;\\n accent-color: var(--cw-primary);\\n flex-shrink: 0;\\n margin-top: 1px;\\n cursor: pointer;\\n}\\n\\n.cw-offline-form__checkbox:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-offline-form__checkbox-text {\\n line-height: 1.4;\\n}\\n\\n/* Error message */\\n.cw-offline-form__error {\\n font-size: 12px;\\n color: #ef4444;\\n font-weight: 500;\\n}\\n\\n/* Actions */\\n.cw-offline-form__actions {\\n margin-top: 4px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { OfflineField, OfflineFormSchema } from '../SiteChatComponentNew.types';\nimport { useOfflineForm } from '../hooks';\nimport { Button } from '../Shared';\nimport './OfflineForm.css';\n\ninterface OfflineFormProps {\n schema: OfflineFormSchema;\n onSubmit: (values: Record<string, unknown>) => void;\n}\n\ninterface FieldRendererProps {\n field: OfflineField;\n value: unknown;\n error: string;\n onChange: (id: string, value: unknown) => void;\n}\n\nconst FieldRenderer: React.FC<FieldRendererProps> = ({\n field,\n value,\n error,\n onChange,\n}) => {\n const hasError = error.length > 0;\n const fieldId = `cw-offline-field-${field.id}`;\n const errorId = `${fieldId}-error`;\n\n const commonProps = {\n id: fieldId,\n className: `cw-offline-form__input${hasError ? ' cw-offline-form__input--error' : ''}`,\n 'aria-invalid': hasError,\n 'aria-describedby': hasError ? errorId : undefined,\n required: field.required,\n };\n\n if (field.type === 'textarea') {\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <textarea\n {...commonProps}\n value={String(value ?? '')}\n placeholder={field.placeholder}\n rows={3}\n onChange={(e) => onChange(field.id, e.target.value)}\n className={`cw-offline-form__textarea${hasError ? ' cw-offline-form__textarea--error' : ''}`}\n />\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n if (field.type === 'select') {\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <select\n {...commonProps}\n value={String(value ?? '')}\n onChange={(e) => onChange(field.id, e.target.value)}\n className={`cw-offline-form__select${hasError ? ' cw-offline-form__select--error' : ''}`}\n >\n <option value=\"\">\n {field.placeholder ?? `Select ${field.label}`}\n </option>\n {field.options?.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n if (field.type === 'checkbox') {\n return (\n <div className=\"cw-offline-form__field cw-offline-form__field--checkbox\">\n <label className=\"cw-offline-form__checkbox-label\" htmlFor={fieldId}>\n <input\n type=\"checkbox\"\n id={fieldId}\n checked={Boolean(value)}\n onChange={(e) => onChange(field.id, e.target.checked)}\n className=\"cw-offline-form__checkbox\"\n aria-invalid={hasError}\n aria-describedby={hasError ? errorId : undefined}\n required={field.required}\n />\n <span className=\"cw-offline-form__checkbox-text\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </span>\n </label>\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n // text | email | phone\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <input\n {...commonProps}\n type={field.type}\n value={String(value ?? '')}\n placeholder={field.placeholder}\n onChange={(e) => onChange(field.id, e.target.value)}\n />\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n};\n\nconst OfflineForm: React.FC<OfflineFormProps> = ({ schema, onSubmit }) => {\n const { values, errors, setValue, handleSubmit } = useOfflineForm(schema);\n\n const onFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n handleSubmit(onSubmit);\n };\n\n return (\n <form\n className=\"cw-offline-form\"\n onSubmit={onFormSubmit}\n aria-label={schema.title}\n noValidate\n >\n <h3 className=\"cw-offline-form__title\">{schema.title}</h3>\n\n {schema.fields.map((field) => (\n <FieldRenderer\n key={field.id}\n field={field}\n value={values[field.id]}\n error={errors[field.id] ?? ''}\n onChange={setValue}\n />\n ))}\n\n <div className=\"cw-offline-form__actions\">\n <Button type=\"submit\" fullWidth>\n {schema.submitButtonText}\n </Button>\n </div>\n </form>\n );\n};\n\nexport default OfflineForm;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-8b15ae78\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-8b15ae78\";\n s.textContent = \".cw-offline-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n background-color: var(--cw-background);\\n overflow-y: auto;\\n}\\n\\n.cw-offline-state__header {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n text-align: center;\\n padding: 28px 24px 16px;\\n gap: 8px;\\n}\\n\\n.cw-offline-state__icon {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n color: var(--cw-primary);\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n margin-bottom: 4px;\\n}\\n\\n.cw-offline-state__title {\\n font-size: 17px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-offline-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n line-height: 1.6;\\n max-width: 280px;\\n}\\n\\n.cw-offline-state__form-wrapper {\\n padding: 0 16px 16px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { OfflineFormSchema } from '../SiteChatComponentNew.types';\nimport OfflineForm from '../OfflineForm/OfflineForm';\nimport './OfflineState.css';\n\ninterface OfflineStateProps {\n form?: OfflineFormSchema;\n onSubmit: (values: Record<string, unknown>) => void;\n}\n\nconst OfflineState: React.FC<OfflineStateProps> = ({ form, onSubmit }) => {\n return (\n <div\n className=\"cw-offline-state\"\n role=\"main\"\n aria-label=\"Business is offline\"\n >\n <div className=\"cw-offline-state__header\">\n <div className=\"cw-offline-state__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\" />\n </svg>\n </div>\n <h2 className=\"cw-offline-state__title\">We're currently offline</h2>\n <p className=\"cw-offline-state__subtitle\">\n Please leave us a message and we'll get back to you as soon as possible.\n </p>\n </div>\n\n {form && (\n <div className=\"cw-offline-state__form-wrapper\">\n <OfflineForm schema={form} onSubmit={onSubmit} />\n </div>\n )}\n </div>\n );\n};\n\nexport default OfflineState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-59a49fdf\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-59a49fdf\";\n s.textContent = \".cw-chat-ended-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px 24px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 12px;\\n}\\n\\n.cw-chat-ended-state__icon {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n color: var(--cw-primary);\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n\\n.cw-chat-ended-state__title {\\n font-size: 17px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-chat-ended-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 240px;\\n line-height: 1.6;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './ChatEndedState.css';\n\nconst ChatEndedState: React.FC = () => {\n return (\n <div\n className=\"cw-chat-ended-state\"\n role=\"status\"\n aria-label=\"Chat has ended\"\n >\n <div className=\"cw-chat-ended-state__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n <p className=\"cw-chat-ended-state__title\">Chat Ended</p>\n <p className=\"cw-chat-ended-state__subtitle\">\n Your chat session has ended. Thank you for reaching out!\n </p>\n </div>\n );\n};\n\nexport default ChatEndedState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-871af89c\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-871af89c\";\n s.textContent = \"/* \u2500\u2500\u2500 Root container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\n * Fixed to bottom-right by default so it works out-of-the-box.\\n * Override with your own positioning class if embedding differently.\\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n.cw-root {\\n position: fixed;\\n bottom: max(24px, env(safe-area-inset-bottom));\\n right: max(24px, env(safe-area-inset-right));\\n display: flex;\\n flex-direction: column;\\n align-items: flex-end;\\n gap: 12px;\\n z-index: 9999;\\n /* Scope CSS vars and stacking context */\\n isolation: isolate;\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n}\\n\\n/* \u2500\u2500\u2500 Widget Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n.cw-widget {\\n display: flex;\\n flex-direction: column;\\n width: var(--cw-width);\\n height: var(--cw-height);\\n /* Clamp so it never overflows the viewport on small screens */\\n max-width: calc(100vw - 48px);\\n max-height: calc(100dvh - 96px);\\n background-color: var(--cw-background);\\n border-radius: var(--cw-border-radius);\\n box-shadow: var(--cw-shadow);\\n overflow: hidden;\\n /* Entry animation */\\n animation: cw-panel-in 0.22s ease;\\n transform-origin: bottom right;\\n}\\n\\n@keyframes cw-panel-in {\\n from {\\n opacity: 0;\\n transform: scale(0.92) translateY(10px);\\n }\\n to {\\n opacity: 1;\\n transform: scale(1) translateY(0);\\n }\\n}\\n\\n.cw-widget__body {\\n display: flex;\\n flex-direction: column;\\n flex: 1;\\n overflow: hidden;\\n}\\n\\n/* \u2500\u2500\u2500 Launcher Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n.cw-launcher {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n border: none;\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);\\n flex-shrink: 0;\\n transition: transform 0.15s ease, box-shadow 0.15s ease;\\n}\\n\\n.cw-launcher:hover {\\n transform: scale(1.07);\\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);\\n}\\n\\n.cw-launcher:focus-visible {\\n outline: 3px solid var(--cw-primary);\\n outline-offset: 3px;\\n}\\n\\n.cw-launcher:active {\\n transform: scale(0.96);\\n}\\n\\n/* \u2500\u2500\u2500 Tablet (481px \u2013 768px): panel floats, slightly narrower margin \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n@media (min-width: 481px) and (max-width: 768px) {\\n .cw-root {\\n bottom: max(16px, env(safe-area-inset-bottom));\\n right: max(16px, env(safe-area-inset-right));\\n }\\n\\n .cw-widget {\\n max-width: calc(100vw - 32px);\\n max-height: calc(100dvh - 80px);\\n }\\n}\\n\\n/* \u2500\u2500\u2500 Mobile (\u2264 480px): full-screen panel, launcher stays fixed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n@media (max-width: 480px) {\\n .cw-root {\\n bottom: 0;\\n right: 0;\\n gap: 0;\\n }\\n\\n .cw-root > .cw-launcher {\\n position: fixed;\\n bottom: max(20px, env(safe-area-inset-bottom));\\n right: max(20px, env(safe-area-inset-right));\\n }\\n\\n .cw-widget {\\n width: 100vw;\\n max-width: 100vw;\\n height: 100dvh;\\n max-height: 100dvh;\\n border-radius: 0;\\n transform-origin: bottom center;\\n }\\n}\\n\";\n document.head.appendChild(s);\n}"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAkB;;;ACAlB,mBAAsC;AAG/B,SAAS,wBAAwB,cAAc,OAA4B;AAChF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,WAAW;AAE5C,QAAM,iBAAa,0BAAY,MAAM,QAAQ,IAAI,GAAG,CAAC,CAAC;AACtD,QAAM,kBAAc,0BAAY,MAAM,QAAQ,KAAK,GAAG,CAAC,CAAC;AAExD,SAAO,EAAE,MAAM,YAAY,YAAY;AACzC;;;ACNA,IAAM,cACJ;AACF,IAAM,YAAY;AAClB,IAAM,SAAS;AACf,IAAM,QAAQ;AACd,IAAM,SAAS;AACf,IAAM,gBAAgB;AAIf,IAAM,eAA0B;AAAA,EACrC,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAChB;AAMO,SAAS,eACd,SACwB;AACxB,QAAM,QAAmB,EAAE,GAAG,cAAc,GAAG,QAAQ;AAEvD,SAAO;AAAA;AAAA,IAEL,gBAAgB,MAAM;AAAA,IACtB,mBAAmB,MAAM;AAAA,IACzB,gBAAgB,MAAM;AAAA,IACtB,eAAe,MAAM;AAAA,IACrB,oBAAoB,MAAM;AAAA,IAC1B,kBAAkB,MAAM;AAAA,IACxB,qBAAqB,MAAM;AAAA,IAC3B,mBAAmB,MAAM;AAAA,IACzB,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AA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAS;AAAA;AAAA,UACX;AAAA,UACA,8CAAC,SAAI,WAAU,mBAAmB,qBAAW,GAAE;AAAA;AAAA;AAAA,IACjD;AAAA,IAID,CAAC,QACA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,cAAW;AAAA,QACX,iBAAc;AAAA,QACd,MAAK;AAAA,QAEL;AAAA,UAAC;AAAA;AAAA,YACC,OAAM;AAAA,YACN,OAAM;AAAA,YACN,QAAO;AAAA,YACP,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,eAAY;AAAA,YAEZ,wDAAC,UAAK,GAAE,sEAAqE;AAAA;AAAA,QAC/E;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ,CAAC;AAED,qBAAqB,cAAc;",
4
+ "sourcesContent": ["export { SiteChatComponentNew } from './SiteChatComponentNew';\nexport type { ChatWidgetProps, UseChatWidgetReturn } from './SiteChatComponentNew.types';\nexport { useSiteChatComponentNew } from './useSiteChatComponentNew';\n", "import React from 'react';\nimport { ChatWidgetProps } from './SiteChatComponentNew.types';\nimport { useSiteChatComponentNew } from './useSiteChatComponentNew';\nimport { buildThemeVars } from './utils';\nimport Header from './Header/Header';\nimport Footer from './Footer/Footer';\nimport { MessageList } from './Messages';\nimport { LoadingState, StartChatState, OfflineState, ChatEndedState } from './States';\nimport './SiteChatComponentNew.css';\n\nexport const SiteChatComponentNew = React.forwardRef<HTMLDivElement, ChatWidgetProps>(({\n title,\n subtitle,\n image,\n theme,\n messages,\n offlineForm,\n defaultOpen = false,\n loading = false,\n chatEnded = false,\n width,\n height,\n onSend,\n onAttachment,\n onOfflineSubmit,\n onClose,\n}, ref) => {\n const { open, openWidget, closeWidget } = useSiteChatComponentNew(defaultOpen);\n const themeVars = buildThemeVars(theme, width, height);\n\n const handleClose = () => {\n closeWidget();\n onClose?.();\n };\n\n /**\n * Derive what to render from data:\n * loading=true \u2192 spinner\n * offlineForm provided \u2192 offline form\n * no messages yet \u2192 Start Chat screen\n * messages present \u2192 conversation (+ optional ended banner)\n */\n const renderBody = () => {\n if (loading) {\n return <LoadingState />;\n }\n\n if (offlineForm) {\n return <OfflineState form={offlineForm} onSubmit={onOfflineSubmit} />;\n }\n\n if (messages.length === 0) {\n return (\n <StartChatState\n image={image}\n title={title}\n description={subtitle}\n onStart={() => onSend('__start_chat__')}\n />\n );\n }\n\n return (\n <>\n <MessageList messages={messages} />\n {chatEnded ? <ChatEndedState /> : <Footer onSend={onSend} onAttachment={onAttachment} />}\n </>\n );\n };\n\n return (\n <div ref={ref} className=\"cw-root\" style={themeVars as React.CSSProperties}>\n {/* Chat panel */}\n {open && (\n <div\n className=\"cw-widget\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`${title} chat widget`}\n >\n <Header\n image={image}\n title={title}\n subtitle={subtitle}\n onClose={handleClose}\n />\n <div className=\"cw-widget__body\">{renderBody()}</div>\n </div>\n )}\n\n {/* Launcher button \u2014 only visible when the panel is closed */}\n {!open && (\n <button\n className=\"cw-launcher\"\n onClick={openWidget}\n aria-label=\"Open chat\"\n aria-haspopup=\"dialog\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"26\"\n height=\"26\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z\" />\n </svg>\n </button>\n )}\n </div>\n );\n});\n\nSiteChatComponentNew.displayName = 'SiteChatComponentNew';\n\n\n", "import { useState, useCallback } from 'react';\nimport { UseChatWidgetReturn } from './SiteChatComponentNew.types';\n\nexport function useSiteChatComponentNew(defaultOpen = false): UseChatWidgetReturn {\n const [open, setOpen] = useState(defaultOpen);\n\n const openWidget = useCallback(() => setOpen(true), []);\n const closeWidget = useCallback(() => setOpen(false), []);\n\n return { open, openWidget, closeWidget };\n}\n", "import { ChatTheme } from '../SiteChatComponentNew.types';\n\n// \u2500\u2500\u2500 Fixed layout / typography constants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// These are intentionally not themeable \u2014 only colours and border widths change.\nconst FONT_FAMILY =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif\";\nconst FONT_SIZE = '14px';\nconst SHADOW = '0 4px 24px rgba(0,0,0,0.12)';\nconst WIDTH = '400px';\nconst HEIGHT = '600px';\nconst HEADER_HEIGHT = '64px';\n\n// \u2500\u2500\u2500 Default colour theme \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const defaultTheme: ChatTheme = {\n primary: '#4f46e5',\n background: '#ffffff',\n surface: '#f9fafb',\n border: '#e5e7eb',\n userBubble: '#4f46e5',\n userText: '#ffffff',\n agentBubble: '#f3f4f6',\n agentText: '#111827',\n systemText: '#6b7280',\n inputBackground: '#ffffff',\n inputBorder: '#d1d5db',\n buttonRadius: 8,\n borderRadius: 12,\n};\n\n/**\n * Merges a partial user theme with the defaults and returns a style object\n * containing CSS custom properties. Layout/font values are always fixed.\n */\nexport function buildThemeVars(\n partial?: Partial<ChatTheme>,\n width?: number | string,\n height?: number | string,\n): Record<string, string> {\n const theme: ChatTheme = { ...defaultTheme, ...partial };\n\n return {\n // Colours\n '--cw-primary': theme.primary,\n '--cw-background': theme.background,\n '--cw-surface': theme.surface,\n '--cw-border': theme.border,\n '--cw-user-bubble': theme.userBubble,\n '--cw-user-text': theme.userText,\n '--cw-agent-bubble': theme.agentBubble,\n '--cw-agent-text': theme.agentText,\n '--cw-system-text': theme.systemText,\n '--cw-input-background': theme.inputBackground,\n '--cw-input-border': theme.inputBorder,\n // Border radii\n '--cw-button-radius': `${theme.buttonRadius}px`,\n '--cw-border-radius': `${theme.borderRadius}px`,\n // Fixed constants \u2014 not exposed as theme props\n '--cw-font-family': FONT_FAMILY,\n '--cw-font-size': FONT_SIZE,\n '--cw-shadow': SHADOW,\n '--cw-width': width !== undefined ? (typeof width === 'number' ? `${width}px` : width) : WIDTH,\n '--cw-height': height !== undefined ? (typeof height === 'number' ? `${height}px` : height) : HEIGHT,\n '--cw-header-height': HEADER_HEIGHT,\n };\n}\n", "import { SystemEventType } from '../SiteChatComponentNew.types';\n\nconst systemEventLabels: Record<SystemEventType, string> = {\n AGENT_JOINED: 'Agent joined',\n AGENT_LEFT: 'Agent left',\n USER_JOINED: 'You joined',\n USER_LEFT: 'You left',\n CHAT_ENDED: 'Chat ended',\n CHAT_REOPENED: 'Chat reopened',\n CHAT_TRANSFERRED: 'Chat transferred',\n WAITING_FOR_AGENT: 'Waiting for an agent',\n};\n\nexport function getSystemLabel(event: string): string {\n return systemEventLabels[event as SystemEventType] ?? event;\n}\n\nexport function isSystemEventType(value: string): value is SystemEventType {\n return value in systemEventLabels;\n}\n", "/**\n * Format a Unix timestamp (ms) into a human-readable time string, e.g. \"2:34 PM\".\n */\nexport function formatTime(timestamp: number): string {\n return new Date(timestamp).toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n });\n}\n\n/**\n * Generate a simple unique id.\n */\nexport function generateId(): string {\n return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;\n}\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-45eba566\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-45eba566\";\n s.textContent = \".cw-header {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n padding: 0 16px;\\n height: var(--cw-header-height);\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n flex-shrink: 0;\\n border-radius: var(--cw-border-radius) var(--cw-border-radius) 0 0;\\n}\\n\\n.cw-header__identity {\\n display: flex;\\n align-items: center;\\n gap: 12px;\\n min-width: 0;\\n}\\n\\n.cw-header__avatar {\\n width: 40px;\\n height: 40px;\\n border-radius: 50%;\\n object-fit: cover;\\n flex-shrink: 0;\\n border: 2px solid rgba(255, 255, 255, 0.4);\\n}\\n\\n.cw-header__text {\\n display: flex;\\n flex-direction: column;\\n min-width: 0;\\n}\\n\\n.cw-header__title {\\n font-size: 15px;\\n font-weight: 600;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n line-height: 1.3;\\n}\\n\\n.cw-header__subtitle {\\n font-size: 12px;\\n opacity: 0.85;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n line-height: 1.3;\\n}\\n\\n.cw-header__close {\\n background: none;\\n border: none;\\n cursor: pointer;\\n color: #ffffff;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 6px;\\n border-radius: 50%;\\n flex-shrink: 0;\\n transition: background-color 0.15s ease;\\n}\\n\\n.cw-header__close:hover {\\n background-color: rgba(255, 255, 255, 0.15);\\n}\\n\\n.cw-header__close:focus-visible {\\n outline: 2px solid #ffffff;\\n outline-offset: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { HeaderProps } from '../SiteChatComponentNew.types';\nimport './Header.css';\n\nconst Header: React.FC<HeaderProps> = ({ image, title, subtitle, onClose }) => {\n return (\n <header className=\"cw-header\" role=\"banner\">\n <div className=\"cw-header__identity\">\n {image && (\n <img\n src={image}\n alt={`${title} avatar`}\n className=\"cw-header__avatar\"\n />\n )}\n <div className=\"cw-header__text\">\n <span className=\"cw-header__title\">{title}</span>\n {subtitle && (\n <span className=\"cw-header__subtitle\">{subtitle}</span>\n )}\n </div>\n </div>\n <button\n className=\"cw-header__close\"\n onClick={onClose}\n aria-label=\"Close chat\"\n type=\"button\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n </button>\n </header>\n );\n};\n\nexport default Header;\n", "import React, { useRef, useState, useCallback } from 'react';\nimport { FooterProps } from '../SiteChatComponentNew.types';\nimport './Footer.css';\n\nconst Footer: React.FC<FooterProps> = ({ onSend, onAttachment, disabled }) => {\n const [text, setText] = useState('');\n const fileInputRef = useRef<HTMLInputElement | null>(null);\n const textareaRef = useRef<HTMLTextAreaElement | null>(null);\n\n const isEmpty = text.trim().length === 0;\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLTextAreaElement>) => {\n if (e.key === 'Enter' && !e.shiftKey) {\n e.preventDefault();\n if (!isEmpty && !disabled) {\n onSend(text.trim());\n setText('');\n // Reset textarea height\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n }\n }\n }\n },\n [isEmpty, disabled, onSend, text],\n );\n\n const handleSend = useCallback(() => {\n if (!isEmpty && !disabled) {\n onSend(text.trim());\n setText('');\n if (textareaRef.current) {\n textareaRef.current.style.height = 'auto';\n textareaRef.current.focus();\n }\n }\n }, [isEmpty, disabled, onSend, text]);\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLTextAreaElement>) => {\n setText(e.target.value);\n // Auto-grow textarea up to ~120px\n const el = e.target;\n el.style.height = 'auto';\n el.style.height = `${Math.min(el.scrollHeight, 120)}px`;\n },\n [],\n );\n\n const handleAttachmentClick = useCallback(() => {\n fileInputRef.current?.click();\n }, []);\n\n const handleFileChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const file = e.target.files?.[0];\n if (file) {\n onAttachment(file);\n }\n // Reset the file input so same file can be re-selected\n if (fileInputRef.current) {\n fileInputRef.current.value = '';\n }\n },\n [onAttachment],\n );\n\n return (\n <footer className=\"cw-footer\" role=\"contentinfo\">\n <button\n className=\"cw-footer__attach-btn\"\n onClick={handleAttachmentClick}\n aria-label=\"Attach file\"\n type=\"button\"\n disabled={disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48\" />\n </svg>\n </button>\n\n <textarea\n ref={textareaRef}\n className=\"cw-footer__input\"\n value={text}\n onChange={handleChange}\n onKeyDown={handleKeyDown}\n placeholder=\"Type a message\u2026\"\n aria-label=\"Message input\"\n rows={1}\n disabled={disabled}\n />\n\n <button\n className={`cw-footer__send-btn${isEmpty || disabled ? ' cw-footer__send-btn--disabled' : ''}`}\n onClick={handleSend}\n aria-label=\"Send message\"\n type=\"button\"\n disabled={isEmpty || disabled}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z\" />\n </svg>\n </button>\n\n {/* Hidden file input */}\n <input\n ref={fileInputRef}\n type=\"file\"\n className=\"cw-footer__file-input\"\n onChange={handleFileChange}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n </footer>\n );\n};\n\nexport default Footer;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-ebcf221d\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-ebcf221d\";\n s.textContent = \".cw-footer {\\n display: flex;\\n align-items: flex-end;\\n gap: 8px;\\n padding: 10px 12px;\\n background-color: var(--cw-background);\\n border-top: 1px solid var(--cw-border);\\n flex-shrink: 0;\\n}\\n\\n.cw-footer__input {\\n flex: 1;\\n resize: none;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n padding: 8px 12px;\\n line-height: 1.5;\\n min-height: 38px;\\n max-height: 120px;\\n overflow-y: auto;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-footer__input:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-footer__input:disabled {\\n opacity: 0.5;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__attach-btn,\\n.cw-footer__send-btn {\\n background: none;\\n border: none;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n padding: 8px;\\n border-radius: 50%;\\n flex-shrink: 0;\\n transition: background-color 0.15s ease, color 0.15s ease;\\n color: var(--cw-primary);\\n margin-bottom: 1px;\\n}\\n\\n.cw-footer__attach-btn:hover,\\n.cw-footer__send-btn:not(.cw-footer__send-btn--disabled):hover {\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n}\\n\\n.cw-footer__attach-btn:focus-visible,\\n.cw-footer__send-btn:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-footer__attach-btn:disabled {\\n opacity: 0.4;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__send-btn--disabled {\\n opacity: 0.35;\\n cursor: not-allowed;\\n}\\n\\n.cw-footer__file-input {\\n display: none;\\n}\\n\";\n document.head.appendChild(s);\n}", "import { useEffect, useRef, useState } from 'react';\n\n/**\n * Attaches a ref to a scrollable container. Automatically scrolls to the\n * bottom when new content is added, unless the user has manually scrolled up.\n */\nexport function useAutoScroll<T extends HTMLElement>(\n dependency: unknown,\n): React.MutableRefObject<T | null> {\n const ref = useRef<T | null>(null);\n const userScrolledUp = useRef(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleScroll = () => {\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight < 64;\n userScrolledUp.current = !atBottom;\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, []);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || userScrolledUp.current) return;\n\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n }, [dependency]);\n\n return ref;\n}\n\n/**\n * Expose a way for the consumer to force-scroll to bottom (e.g. when\n * the user clicks a \"scroll to bottom\" button).\n */\nexport function useAutoScrollWithControl<T extends HTMLElement>(\n dependency: unknown,\n): {\n ref: React.MutableRefObject<T | null>;\n scrollToBottom: () => void;\n isScrolledUp: boolean;\n} {\n const ref = useRef<T | null>(null);\n const userScrolledUp = useRef(false);\n const [isScrolledUp, setIsScrolledUp] = useState(false);\n\n useEffect(() => {\n const el = ref.current;\n if (!el) return;\n\n const handleScroll = () => {\n const atBottom =\n el.scrollHeight - el.scrollTop - el.clientHeight < 64;\n userScrolledUp.current = !atBottom;\n setIsScrolledUp(!atBottom);\n };\n\n el.addEventListener('scroll', handleScroll, { passive: true });\n return () => el.removeEventListener('scroll', handleScroll);\n }, []);\n\n useEffect(() => {\n const el = ref.current;\n if (!el || userScrolledUp.current) return;\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n }, [dependency]);\n\n const scrollToBottom = () => {\n const el = ref.current;\n if (!el) return;\n userScrolledUp.current = false;\n setIsScrolledUp(false);\n el.scrollTo({ top: el.scrollHeight, behavior: 'smooth' });\n };\n\n return { ref, scrollToBottom, isScrolledUp };\n}\n", "import { useState, useCallback } from 'react';\nimport { OfflineField, OfflineFormSchema } from '../SiteChatComponentNew.types';\n\ntype FieldValues = Record<string, unknown>;\ntype FieldErrors = Record<string, string>;\n\nfunction validateField(field: OfflineField, value: unknown): string {\n if (field.required) {\n if (field.type === 'checkbox' && !value) {\n return `${field.label} is required.`;\n }\n if (\n field.type !== 'checkbox' &&\n (value === undefined || value === null || String(value).trim() === '')\n ) {\n return `${field.label} is required.`;\n }\n }\n\n if (field.type === 'email') {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n if (value && !emailRegex.test(String(value))) {\n return 'Please enter a valid email address.';\n }\n }\n\n if (field.type === 'phone') {\n const phoneRegex = /^\\+?[\\d\\s\\-().]{7,20}$/;\n if (value && !phoneRegex.test(String(value))) {\n return 'Please enter a valid phone number.';\n }\n }\n\n return '';\n}\n\nexport function useOfflineForm(schema: OfflineFormSchema) {\n const initialValues: FieldValues = {};\n for (const field of schema.fields) {\n initialValues[field.id] = field.type === 'checkbox' ? false : '';\n }\n\n const [values, setValues] = useState<FieldValues>(initialValues);\n const [errors, setErrors] = useState<FieldErrors>({});\n const [submitted, setSubmitted] = useState(false);\n\n const setValue = useCallback(\n (id: string, value: unknown) => {\n setValues((prev) => ({ ...prev, [id]: value }));\n\n if (submitted) {\n const field = schema.fields.find((f) => f.id === id);\n if (field) {\n const error = validateField(field, value);\n setErrors((prev) => ({ ...prev, [id]: error }));\n }\n }\n },\n [schema.fields, submitted],\n );\n\n const validate = useCallback((): boolean => {\n const newErrors: FieldErrors = {};\n let valid = true;\n\n for (const field of schema.fields) {\n const error = validateField(field, values[field.id]);\n newErrors[field.id] = error;\n if (error) valid = false;\n }\n\n setErrors(newErrors);\n return valid;\n }, [schema.fields, values]);\n\n const handleSubmit = useCallback(\n (onSubmit: (values: FieldValues) => void) => {\n setSubmitted(true);\n if (validate()) {\n onSubmit(values);\n }\n },\n [validate, values],\n );\n\n const reset = useCallback(() => {\n setValues(initialValues);\n setErrors({});\n setSubmitted(false);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return { values, errors, setValue, handleSubmit, reset };\n}\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-aed321e0\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-aed321e0\";\n s.textContent = \".cw-user-message {\\n display: flex;\\n flex-direction: column;\\n align-items: flex-end;\\n max-width: 75%;\\n align-self: flex-end;\\n gap: 3px;\\n}\\n\\n.cw-user-message__bubble {\\n background-color: var(--cw-user-bubble);\\n color: var(--cw-user-text);\\n padding: 10px 14px;\\n border-radius: 18px 18px 4px 18px;\\n font-size: var(--cw-font-size);\\n line-height: 1.5;\\n word-break: break-word;\\n white-space: pre-wrap;\\n}\\n\\n.cw-user-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-right: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport './UserMessage.css';\n\ninterface UserMessageProps {\n message: MessageProps;\n}\n\nconst UserMessage: React.FC<UserMessageProps> = ({ message }) => {\n return (\n <div className=\"cw-user-message\" role=\"listitem\" aria-label=\"Your message\">\n <div className=\"cw-user-message__bubble\">{message.message}</div>\n {message.timestamp !== undefined && (\n <span className=\"cw-user-message__time\">\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n );\n};\n\nexport default UserMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-ce14fbec\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-ce14fbec\";\n s.textContent = \".cw-avatar {\\n border-radius: 50%;\\n flex-shrink: 0;\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n}\\n\\n.cw-avatar--image {\\n object-fit: cover;\\n}\\n\\n.cw-avatar--initials {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n font-weight: 600;\\n user-select: none;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n src?: string;\n name?: string;\n size?: number;\n}\n\nfunction getInitials(name: string): string {\n return name\n .split(' ')\n .slice(0, 2)\n .map((w) => w[0])\n .join('')\n .toUpperCase();\n}\n\nconst Avatar: React.FC<AvatarProps> = ({ src, name, size = 32 }) => {\n const style = {\n width: `${size}px`,\n height: `${size}px`,\n fontSize: `${Math.round(size * 0.38)}px`,\n };\n\n if (src) {\n return (\n <img\n src={src}\n alt={name ? `${name} avatar` : 'Agent avatar'}\n className=\"cw-avatar cw-avatar--image\"\n style={style}\n />\n );\n }\n\n return (\n <span\n className=\"cw-avatar cw-avatar--initials\"\n aria-label={name ? `${name} avatar` : 'Agent avatar'}\n style={style}\n >\n {name ? getInitials(name) : 'A'}\n </span>\n );\n};\n\nexport default Avatar;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-2aa106ea\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-2aa106ea\";\n s.textContent = \".cw-button {\\n display: inline-flex;\\n align-items: center;\\n justify-content: center;\\n gap: 8px;\\n padding: 10px 20px;\\n border: none;\\n border-radius: var(--cw-button-radius);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n font-weight: 600;\\n cursor: pointer;\\n transition: opacity 0.15s ease, transform 0.1s ease;\\n white-space: nowrap;\\n}\\n\\n.cw-button:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 3px;\\n}\\n\\n.cw-button:active:not(:disabled) {\\n transform: scale(0.98);\\n}\\n\\n.cw-button:disabled {\\n opacity: 0.45;\\n cursor: not-allowed;\\n}\\n\\n.cw-button--primary {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n}\\n\\n.cw-button--primary:hover:not(:disabled) {\\n opacity: 0.88;\\n}\\n\\n.cw-button--secondary {\\n background-color: var(--cw-surface);\\n color: var(--cw-primary);\\n border: 1px solid var(--cw-border);\\n}\\n\\n.cw-button--secondary:hover:not(:disabled) {\\n background-color: var(--cw-border);\\n}\\n\\n.cw-button--full {\\n width: 100%;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './Button.css';\n\ninterface ButtonProps {\n children: React.ReactNode;\n onClick?: () => void;\n variant?: 'primary' | 'secondary';\n disabled?: boolean;\n type?: 'button' | 'submit' | 'reset';\n fullWidth?: boolean;\n ariaLabel?: string;\n}\n\nconst Button: React.FC<ButtonProps> = ({\n children,\n onClick,\n variant = 'primary',\n disabled = false,\n type = 'button',\n fullWidth = false,\n ariaLabel,\n}) => {\n return (\n <button\n className={`cw-button cw-button--${variant}${fullWidth ? ' cw-button--full' : ''}`}\n onClick={onClick}\n disabled={disabled}\n type={type}\n aria-label={ariaLabel}\n >\n {children}\n </button>\n );\n};\n\nexport default Button;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-5df522b1\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-5df522b1\";\n s.textContent = \".cw-agent-message {\\n display: flex;\\n align-items: flex-end;\\n gap: 8px;\\n max-width: 75%;\\n align-self: flex-start;\\n}\\n\\n.cw-agent-message__content {\\n display: flex;\\n flex-direction: column;\\n gap: 3px;\\n}\\n\\n.cw-agent-message__name {\\n font-size: 11px;\\n font-weight: 600;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\\n.cw-agent-message__bubble {\\n background-color: var(--cw-agent-bubble);\\n color: var(--cw-agent-text);\\n padding: 10px 14px;\\n border-radius: 18px 18px 18px 4px;\\n font-size: var(--cw-font-size);\\n line-height: 1.5;\\n word-break: break-word;\\n white-space: pre-wrap;\\n}\\n\\n.cw-agent-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport { Avatar } from '../Shared';\nimport './AgentMessage.css';\n\ninterface AgentMessageProps {\n message: MessageProps;\n}\n\nconst AgentMessage: React.FC<AgentMessageProps> = ({ message }) => {\n return (\n <div\n className=\"cw-agent-message\"\n role=\"listitem\"\n aria-label={`Message from ${message.senderName ?? 'Agent'}`}\n >\n <Avatar name={message.senderName} size={32} />\n <div className=\"cw-agent-message__content\">\n {message.senderName && (\n <span className=\"cw-agent-message__name\">{message.senderName}</span>\n )}\n <div className=\"cw-agent-message__bubble\">{message.message}</div>\n {message.timestamp !== undefined && (\n <span className=\"cw-agent-message__time\">\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n </div>\n );\n};\n\nexport default AgentMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-464a3601\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-464a3601\";\n s.textContent = \".cw-system-message {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n align-self: stretch;\\n padding: 4px 8px;\\n}\\n\\n.cw-system-message__line {\\n flex: 1;\\n border-top: 1px dashed var(--cw-border);\\n}\\n\\n.cw-system-message__text {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n white-space: nowrap;\\n flex-shrink: 0;\\n font-style: italic;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { getSystemLabel } from '../utils';\nimport './SystemMessage.css';\n\ninterface SystemMessageProps {\n message: MessageProps;\n}\n\nconst SystemMessage: React.FC<SystemMessageProps> = ({ message }) => {\n const label = message.message\n ? getSystemLabel(message.message)\n : message.message ?? '';\n\n return (\n <div\n className=\"cw-system-message\"\n role=\"listitem\"\n aria-label={`System notification: ${label}`}\n >\n <span className=\"cw-system-message__line\" aria-hidden=\"true\" />\n <span className=\"cw-system-message__text\">{label}</span>\n <span className=\"cw-system-message__line\" aria-hidden=\"true\" />\n </div>\n );\n};\n\nexport default SystemMessage;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-dd846dee\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-dd846dee\";\n s.textContent = \".cw-attachment-message {\\n display: flex;\\n flex-direction: column;\\n gap: 3px;\\n align-self: flex-start;\\n max-width: 80%;\\n}\\n\\n.cw-attachment-message--user {\\n align-self: flex-end;\\n align-items: flex-end;\\n}\\n\\n.cw-attachment-message__card {\\n display: flex;\\n align-items: center;\\n gap: 10px;\\n background-color: var(--cw-agent-bubble);\\n border: 1px solid var(--cw-border);\\n border-radius: 12px;\\n padding: 10px 14px;\\n}\\n\\n.cw-attachment-message--user .cw-attachment-message__card {\\n background-color: var(--cw-user-bubble);\\n border-color: transparent;\\n color: var(--cw-user-text);\\n}\\n\\n.cw-attachment-message__icon {\\n flex-shrink: 0;\\n opacity: 0.75;\\n display: flex;\\n align-items: center;\\n}\\n\\n.cw-attachment-message__info {\\n display: flex;\\n flex-direction: column;\\n min-width: 0;\\n flex: 1;\\n}\\n\\n.cw-attachment-message__name {\\n font-size: 13px;\\n font-weight: 600;\\n white-space: nowrap;\\n overflow: hidden;\\n text-overflow: ellipsis;\\n}\\n\\n.cw-attachment-message__label {\\n font-size: 11px;\\n opacity: 0.65;\\n}\\n\\n.cw-attachment-message__open-btn {\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n border: none;\\n border-radius: 6px;\\n padding: 5px 12px;\\n font-family: var(--cw-font-family);\\n font-size: 12px;\\n font-weight: 600;\\n cursor: pointer;\\n flex-shrink: 0;\\n transition: opacity 0.15s ease;\\n}\\n\\n.cw-attachment-message--user .cw-attachment-message__open-btn {\\n background-color: rgba(255, 255, 255, 0.25);\\n color: #ffffff;\\n}\\n\\n.cw-attachment-message__open-btn:hover {\\n opacity: 0.85;\\n}\\n\\n.cw-attachment-message__open-btn:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-attachment-message__time {\\n font-size: 11px;\\n color: var(--cw-system-text);\\n padding-left: 2px;\\n}\\n\\n.cw-attachment-message__time--right {\\n padding-left: 0;\\n padding-right: 2px;\\n align-self: flex-end;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { formatTime } from '../utils';\nimport './AttachmentMessage.css';\n\ninterface AttachmentMessageProps {\n message: MessageProps;\n}\n\nconst AttachmentMessage: React.FC<AttachmentMessageProps> = ({ message }) => {\n // Support both `item` (new) and `attachment` (legacy) field names\n const attachment = message.item ?? message.attachment;\n if (!attachment) return null;\n\n const handleOpen = () => {\n window.open(attachment.url, '_blank', 'noopener,noreferrer');\n };\n\n return (\n <div\n className={`cw-attachment-message${message.senderType === 'user' ? ' cw-attachment-message--user' : ''}`}\n role=\"listitem\"\n aria-label={`Attachment: ${attachment.name}`}\n >\n <div className=\"cw-attachment-message__card\">\n <div className=\"cw-attachment-message__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14 2 14 8 20 8\" />\n </svg>\n </div>\n <div className=\"cw-attachment-message__info\">\n <span className=\"cw-attachment-message__name\">{attachment.name}</span>\n <span className=\"cw-attachment-message__label\">Attachment</span>\n </div>\n <button\n className=\"cw-attachment-message__open-btn\"\n onClick={handleOpen}\n aria-label={`Open attachment ${attachment.name}`}\n type=\"button\"\n >\n Open\n </button>\n </div>\n {message.timestamp !== undefined && (\n <span\n className={`cw-attachment-message__time${message.senderType === 'user' ? ' cw-attachment-message__time--right' : ''}`}\n >\n {formatTime(message.timestamp)}\n </span>\n )}\n </div>\n );\n};\n\nexport default AttachmentMessage;\n", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport UserMessage from './UserMessage';\nimport AgentMessage from './AgentMessage';\nimport SystemMessage from './SystemMessage';\nimport AttachmentMessage from './AttachmentMessage';\n\ninterface MessageRendererProps {\n message: MessageProps;\n}\n\nconst MessageRenderer: React.FC<MessageRendererProps> = ({ message }) => {\n if (message.messageType === 'ATTACHMENT') {\n return <AttachmentMessage message={message} />;\n }\n\n switch (message.senderType) {\n case 'user':\n return <UserMessage message={message} />;\n case 'agent':\n return <AgentMessage message={message} />;\n case 'system':\n return <SystemMessage message={message} />;\n default:\n return null;\n }\n};\n\nexport default MessageRenderer;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-15ae1a6b\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-15ae1a6b\";\n s.textContent = \".cw-message-list {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n overflow-y: auto;\\n padding: 16px;\\n background-color: var(--cw-background);\\n scroll-behavior: smooth;\\n}\\n\\n/* Scrollbar styling */\\n.cw-message-list::-webkit-scrollbar {\\n width: 5px;\\n}\\n\\n.cw-message-list::-webkit-scrollbar-track {\\n background: transparent;\\n}\\n\\n.cw-message-list::-webkit-scrollbar-thumb {\\n background-color: var(--cw-border);\\n border-radius: 10px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { MessageProps } from '../SiteChatComponentNew.types';\nimport { useAutoScroll } from '../hooks';\nimport MessageRenderer from './MessageRenderer';\nimport './MessageList.css';\n\ninterface MessageListProps {\n messages: MessageProps[];\n}\n\nconst MessageList: React.FC<MessageListProps> = ({ messages }) => {\n const scrollRef = useAutoScroll<HTMLDivElement>(messages);\n\n return (\n <div\n ref={scrollRef}\n className=\"cw-message-list\"\n role=\"list\"\n aria-label=\"Chat messages\"\n aria-live=\"polite\"\n aria-relevant=\"additions\"\n >\n {messages.map((msg, index) => (\n <MessageRenderer\n key={msg._id ?? `${msg.timestamp ?? index}-${index}`}\n message={msg}\n />\n ))}\n {/* TypingIndicator removed \u2014 no longer part of the public API */}\n </div>\n );\n};\n\nexport default MessageList;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-4b0ca05b\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-4b0ca05b\";\n s.textContent = \"@keyframes cw-bounce {\\n 0%, 60%, 100% {\\n transform: translateY(0);\\n }\\n 30% {\\n transform: translateY(-6px);\\n }\\n}\\n\\n.cw-typing-indicator {\\n align-self: flex-start;\\n}\\n\\n.cw-typing-indicator__bubble {\\n display: inline-flex;\\n align-items: center;\\n gap: 4px;\\n background-color: var(--cw-agent-bubble);\\n border-radius: 18px 18px 18px 4px;\\n padding: 10px 14px;\\n}\\n\\n.cw-typing-indicator__dot {\\n display: block;\\n width: 7px;\\n height: 7px;\\n border-radius: 50%;\\n background-color: var(--cw-system-text);\\n animation: cw-bounce 1.2s infinite ease-in-out;\\n}\\n\\n.cw-typing-indicator__dot:nth-child(2) {\\n animation-delay: 0.2s;\\n}\\n\\n.cw-typing-indicator__dot:nth-child(3) {\\n animation-delay: 0.4s;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './TypingIndicator.css';\n\nconst TypingIndicator: React.FC = () => {\n return (\n <div\n className=\"cw-typing-indicator\"\n role=\"status\"\n aria-label=\"Agent is typing\"\n >\n <div className=\"cw-typing-indicator__bubble\">\n <span className=\"cw-typing-indicator__dot\" />\n <span className=\"cw-typing-indicator__dot\" />\n <span className=\"cw-typing-indicator__dot\" />\n </div>\n </div>\n );\n};\n\nexport default TypingIndicator;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-7a5a4f05\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-7a5a4f05\";\n s.textContent = \"@keyframes cw-spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n\\n.cw-loading-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 12px;\\n}\\n\\n.cw-loading-state__spinner {\\n width: 48px;\\n height: 48px;\\n}\\n\\n.cw-loading-state__spinner-ring {\\n width: 48px;\\n height: 48px;\\n border-radius: 50%;\\n border: 3px solid var(--cw-border);\\n border-top-color: var(--cw-primary);\\n animation: cw-spin 0.8s linear infinite;\\n}\\n\\n.cw-loading-state__title {\\n font-size: 16px;\\n font-weight: 600;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-loading-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 240px;\\n line-height: 1.5;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './LoadingState.css';\n\nconst LoadingState: React.FC = () => {\n return (\n <div\n className=\"cw-loading-state\"\n role=\"status\"\n aria-label=\"Connecting to chat\"\n >\n <div className=\"cw-loading-state__spinner\" aria-hidden=\"true\">\n <div className=\"cw-loading-state__spinner-ring\" />\n </div>\n <p className=\"cw-loading-state__title\">Connecting\u2026</p>\n <p className=\"cw-loading-state__subtitle\">\n Please wait while we connect you to an available agent.\n </p>\n </div>\n );\n};\n\nexport default LoadingState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-3e05ef30\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-3e05ef30\";\n s.textContent = \".cw-start-chat-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px 24px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 14px;\\n}\\n\\n.cw-start-chat-state__image {\\n width: 80px;\\n height: 80px;\\n object-fit: contain;\\n border-radius: 50%;\\n margin-bottom: 4px;\\n}\\n\\n.cw-start-chat-state__title {\\n font-size: 20px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-start-chat-state__description {\\n font-size: 14px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 260px;\\n line-height: 1.6;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { Button } from '../Shared';\nimport './StartChatState.css';\n\ninterface StartChatStateProps {\n image?: string;\n title: string;\n description?: string;\n onStart: () => void;\n}\n\nconst StartChatState: React.FC<StartChatStateProps> = ({\n image,\n title,\n description,\n onStart,\n}) => {\n return (\n <div\n className=\"cw-start-chat-state\"\n role=\"main\"\n aria-label=\"Start a chat\"\n >\n {image && (\n <img\n src={image}\n alt=\"Support illustration\"\n className=\"cw-start-chat-state__image\"\n />\n )}\n <h2 className=\"cw-start-chat-state__title\">{title}</h2>\n {description && (\n <p className=\"cw-start-chat-state__description\">{description}</p>\n )}\n <Button onClick={onStart} ariaLabel=\"Start chat\">\n Start Chat\n </Button>\n </div>\n );\n};\n\nexport default StartChatState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-d9ff3956\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-d9ff3956\";\n s.textContent = \".cw-offline-form {\\n display: flex;\\n flex-direction: column;\\n gap: 14px;\\n}\\n\\n.cw-offline-form__title {\\n font-size: 15px;\\n font-weight: 600;\\n color: var(--cw-agent-text);\\n margin: 0 0 4px;\\n}\\n\\n/* Field wrapper */\\n.cw-offline-form__field {\\n display: flex;\\n flex-direction: column;\\n gap: 5px;\\n}\\n\\n.cw-offline-form__field--checkbox {\\n gap: 4px;\\n}\\n\\n/* Label */\\n.cw-offline-form__label {\\n font-size: 13px;\\n font-weight: 500;\\n color: var(--cw-agent-text);\\n}\\n\\n.cw-offline-form__required {\\n color: #ef4444;\\n}\\n\\n/* Text input */\\n.cw-offline-form__input {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n box-sizing: border-box;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__input:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__input--error {\\n border-color: #ef4444;\\n}\\n\\n/* Textarea */\\n.cw-offline-form__textarea {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n resize: vertical;\\n box-sizing: border-box;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__textarea:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__textarea--error {\\n border-color: #ef4444;\\n}\\n\\n/* Select */\\n.cw-offline-form__select {\\n width: 100%;\\n padding: 8px 12px;\\n border: 1px solid var(--cw-input-border);\\n border-radius: var(--cw-button-radius);\\n background-color: var(--cw-input-background);\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n color: inherit;\\n box-sizing: border-box;\\n appearance: none;\\n background-image: url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E\\\");\\n background-repeat: no-repeat;\\n background-position: right 12px center;\\n padding-right: 32px;\\n cursor: pointer;\\n transition: border-color 0.15s ease;\\n}\\n\\n.cw-offline-form__select:focus {\\n outline: none;\\n border-color: var(--cw-primary);\\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--cw-primary) 20%, transparent);\\n}\\n\\n.cw-offline-form__select--error {\\n border-color: #ef4444;\\n}\\n\\n/* Checkbox */\\n.cw-offline-form__checkbox-label {\\n display: flex;\\n align-items: flex-start;\\n gap: 8px;\\n cursor: pointer;\\n font-size: 13px;\\n color: var(--cw-agent-text);\\n}\\n\\n.cw-offline-form__checkbox {\\n width: 16px;\\n height: 16px;\\n accent-color: var(--cw-primary);\\n flex-shrink: 0;\\n margin-top: 1px;\\n cursor: pointer;\\n}\\n\\n.cw-offline-form__checkbox:focus-visible {\\n outline: 2px solid var(--cw-primary);\\n outline-offset: 2px;\\n}\\n\\n.cw-offline-form__checkbox-text {\\n line-height: 1.4;\\n}\\n\\n/* Error message */\\n.cw-offline-form__error {\\n font-size: 12px;\\n color: #ef4444;\\n font-weight: 500;\\n}\\n\\n/* Actions */\\n.cw-offline-form__actions {\\n margin-top: 4px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { OfflineField, OfflineFormSchema } from '../SiteChatComponentNew.types';\nimport { useOfflineForm } from '../hooks';\nimport { Button } from '../Shared';\nimport './OfflineForm.css';\n\ninterface OfflineFormProps {\n schema: OfflineFormSchema;\n onSubmit: (values: Record<string, unknown>) => void;\n}\n\ninterface FieldRendererProps {\n field: OfflineField;\n value: unknown;\n error: string;\n onChange: (id: string, value: unknown) => void;\n}\n\nconst FieldRenderer: React.FC<FieldRendererProps> = ({\n field,\n value,\n error,\n onChange,\n}) => {\n const hasError = error.length > 0;\n const fieldId = `cw-offline-field-${field.id}`;\n const errorId = `${fieldId}-error`;\n\n const commonProps = {\n id: fieldId,\n className: `cw-offline-form__input${hasError ? ' cw-offline-form__input--error' : ''}`,\n 'aria-invalid': hasError,\n 'aria-describedby': hasError ? errorId : undefined,\n required: field.required,\n };\n\n if (field.type === 'textarea') {\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <textarea\n {...commonProps}\n value={String(value ?? '')}\n placeholder={field.placeholder}\n rows={3}\n onChange={(e) => onChange(field.id, e.target.value)}\n className={`cw-offline-form__textarea${hasError ? ' cw-offline-form__textarea--error' : ''}`}\n />\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n if (field.type === 'select') {\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <select\n {...commonProps}\n value={String(value ?? '')}\n onChange={(e) => onChange(field.id, e.target.value)}\n className={`cw-offline-form__select${hasError ? ' cw-offline-form__select--error' : ''}`}\n >\n <option value=\"\">\n {field.placeholder ?? `Select ${field.label}`}\n </option>\n {field.options?.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {opt.label}\n </option>\n ))}\n </select>\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n if (field.type === 'checkbox') {\n return (\n <div className=\"cw-offline-form__field cw-offline-form__field--checkbox\">\n <label className=\"cw-offline-form__checkbox-label\" htmlFor={fieldId}>\n <input\n type=\"checkbox\"\n id={fieldId}\n checked={Boolean(value)}\n onChange={(e) => onChange(field.id, e.target.checked)}\n className=\"cw-offline-form__checkbox\"\n aria-invalid={hasError}\n aria-describedby={hasError ? errorId : undefined}\n required={field.required}\n />\n <span className=\"cw-offline-form__checkbox-text\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </span>\n </label>\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n }\n\n // text | email | phone\n return (\n <div className=\"cw-offline-form__field\">\n <label htmlFor={fieldId} className=\"cw-offline-form__label\">\n {field.label}\n {field.required && (\n <span className=\"cw-offline-form__required\" aria-hidden=\"true\">\n {' '}*\n </span>\n )}\n </label>\n <input\n {...commonProps}\n type={field.type}\n value={String(value ?? '')}\n placeholder={field.placeholder}\n onChange={(e) => onChange(field.id, e.target.value)}\n />\n {hasError && (\n <span id={errorId} className=\"cw-offline-form__error\" role=\"alert\">\n {error}\n </span>\n )}\n </div>\n );\n};\n\nconst OfflineForm: React.FC<OfflineFormProps> = ({ schema, onSubmit }) => {\n const { values, errors, setValue, handleSubmit } = useOfflineForm(schema);\n\n const onFormSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault();\n handleSubmit(onSubmit);\n };\n\n return (\n <form\n className=\"cw-offline-form\"\n onSubmit={onFormSubmit}\n aria-label={schema.title}\n noValidate\n >\n <h3 className=\"cw-offline-form__title\">{schema.title}</h3>\n\n {schema.fields.map((field) => (\n <FieldRenderer\n key={field.id}\n field={field}\n value={values[field.id]}\n error={errors[field.id] ?? ''}\n onChange={setValue}\n />\n ))}\n\n <div className=\"cw-offline-form__actions\">\n <Button type=\"submit\" fullWidth>\n {schema.submitButtonText}\n </Button>\n </div>\n </form>\n );\n};\n\nexport default OfflineForm;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-8b15ae78\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-8b15ae78\";\n s.textContent = \".cw-offline-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n background-color: var(--cw-background);\\n overflow-y: auto;\\n}\\n\\n.cw-offline-state__header {\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n text-align: center;\\n padding: 28px 24px 16px;\\n gap: 8px;\\n}\\n\\n.cw-offline-state__icon {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n color: var(--cw-primary);\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n margin-bottom: 4px;\\n}\\n\\n.cw-offline-state__title {\\n font-size: 17px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-offline-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n line-height: 1.6;\\n max-width: 280px;\\n}\\n\\n.cw-offline-state__form-wrapper {\\n padding: 0 16px 16px;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport { OfflineFormSchema } from '../SiteChatComponentNew.types';\nimport OfflineForm from '../OfflineForm/OfflineForm';\nimport './OfflineState.css';\n\ninterface OfflineStateProps {\n form?: OfflineFormSchema;\n onSubmit: (values: Record<string, unknown>) => void;\n}\n\nconst OfflineState: React.FC<OfflineStateProps> = ({ form, onSubmit }) => {\n return (\n <div\n className=\"cw-offline-state\"\n role=\"main\"\n aria-label=\"Business is offline\"\n >\n <div className=\"cw-offline-state__header\">\n <div className=\"cw-offline-state__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\" />\n </svg>\n </div>\n <h2 className=\"cw-offline-state__title\">We're currently offline</h2>\n <p className=\"cw-offline-state__subtitle\">\n Please leave us a message and we'll get back to you as soon as possible.\n </p>\n </div>\n\n {form && (\n <div className=\"cw-offline-state__form-wrapper\">\n <OfflineForm schema={form} onSubmit={onSubmit} />\n </div>\n )}\n </div>\n );\n};\n\nexport default OfflineState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-59a49fdf\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-59a49fdf\";\n s.textContent = \".cw-chat-ended-state {\\n flex: 1;\\n display: flex;\\n flex-direction: column;\\n align-items: center;\\n justify-content: center;\\n padding: 32px 24px;\\n background-color: var(--cw-background);\\n text-align: center;\\n gap: 12px;\\n}\\n\\n.cw-chat-ended-state__icon {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n background-color: color-mix(in srgb, var(--cw-primary) 10%, transparent);\\n color: var(--cw-primary);\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n}\\n\\n.cw-chat-ended-state__title {\\n font-size: 17px;\\n font-weight: 700;\\n color: var(--cw-agent-text);\\n margin: 0;\\n}\\n\\n.cw-chat-ended-state__subtitle {\\n font-size: 13px;\\n color: var(--cw-system-text);\\n margin: 0;\\n max-width: 240px;\\n line-height: 1.6;\\n}\\n\";\n document.head.appendChild(s);\n}", "import React from 'react';\nimport './ChatEndedState.css';\n\nconst ChatEndedState: React.FC = () => {\n return (\n <div\n className=\"cw-chat-ended-state\"\n role=\"status\"\n aria-label=\"Chat has ended\"\n >\n <div className=\"cw-chat-ended-state__icon\" aria-hidden=\"true\">\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n </div>\n <p className=\"cw-chat-ended-state__title\">Chat Ended</p>\n <p className=\"cw-chat-ended-state__subtitle\">\n Your chat session has ended. Thank you for reaching out!\n </p>\n </div>\n );\n};\n\nexport default ChatEndedState;\n", "if (typeof document !== 'undefined' && !document.getElementById(\"jrapps-style-871af89c\")) {\n const s = document.createElement('style');\n s.id = \"jrapps-style-871af89c\";\n s.textContent = \"/* \u2500\u2500\u2500 Root container \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\\n * Fixed to bottom-right by default so it works out-of-the-box.\\n * Override with your own positioning class if embedding differently.\\n * \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n.cw-root {\\n position: fixed;\\n bottom: max(24px, env(safe-area-inset-bottom));\\n right: max(24px, env(safe-area-inset-right));\\n display: flex;\\n flex-direction: column;\\n align-items: flex-end;\\n gap: 12px;\\n z-index: 9999;\\n /* Scope CSS vars and stacking context */\\n isolation: isolate;\\n font-family: var(--cw-font-family);\\n font-size: var(--cw-font-size);\\n}\\n\\n/* \u2500\u2500\u2500 Widget Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n.cw-widget {\\n display: flex;\\n flex-direction: column;\\n width: var(--cw-width);\\n height: var(--cw-height);\\n /* Clamp so it never overflows the viewport on small screens */\\n max-width: calc(100vw - 48px);\\n max-height: calc(100dvh - 96px);\\n background-color: var(--cw-background);\\n border-radius: var(--cw-border-radius);\\n box-shadow: var(--cw-shadow);\\n overflow: hidden;\\n /* Entry animation */\\n animation: cw-panel-in 0.22s ease;\\n transform-origin: bottom right;\\n}\\n\\n@keyframes cw-panel-in {\\n from {\\n opacity: 0;\\n transform: scale(0.92) translateY(10px);\\n }\\n to {\\n opacity: 1;\\n transform: scale(1) translateY(0);\\n }\\n}\\n\\n.cw-widget__body {\\n display: flex;\\n flex-direction: column;\\n flex: 1;\\n overflow: hidden;\\n}\\n\\n/* \u2500\u2500\u2500 Launcher Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n.cw-launcher {\\n width: 56px;\\n height: 56px;\\n border-radius: 50%;\\n border: none;\\n background-color: var(--cw-primary);\\n color: #ffffff;\\n cursor: pointer;\\n display: flex;\\n align-items: center;\\n justify-content: center;\\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);\\n flex-shrink: 0;\\n transition: transform 0.15s ease, box-shadow 0.15s ease;\\n}\\n\\n.cw-launcher:hover {\\n transform: scale(1.07);\\n box-shadow: 0 6px 20px rgba(0, 0, 0, 0.26);\\n}\\n\\n.cw-launcher:focus-visible {\\n outline: 3px solid var(--cw-primary);\\n outline-offset: 3px;\\n}\\n\\n.cw-launcher:active {\\n transform: scale(0.96);\\n}\\n\\n/* \u2500\u2500\u2500 Tablet (481px \u2013 768px): panel floats, slightly narrower margin \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n@media (min-width: 481px) and (max-width: 768px) {\\n .cw-root {\\n bottom: max(16px, env(safe-area-inset-bottom));\\n right: max(16px, env(safe-area-inset-right));\\n }\\n\\n .cw-widget {\\n max-width: calc(100vw - 32px);\\n max-height: calc(100dvh - 80px);\\n }\\n}\\n\\n/* \u2500\u2500\u2500 Mobile (\u2264 480px): full-screen panel, launcher stays fixed \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\\n\\n@media (max-width: 480px) {\\n .cw-root {\\n bottom: 0;\\n right: 0;\\n gap: 0;\\n }\\n\\n .cw-root > .cw-launcher {\\n position: fixed;\\n bottom: max(20px, env(safe-area-inset-bottom));\\n right: max(20px, env(safe-area-inset-right));\\n }\\n\\n .cw-widget {\\n width: 100vw;\\n max-width: 100vw;\\n height: 100dvh;\\n max-height: 100dvh;\\n border-radius: 0;\\n transform-origin: bottom center;\\n }\\n}\\n\";\n document.head.appendChild(s);\n}"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAAA,gBAAkB;;;ACAlB,mBAAsC;AAG/B,SAAS,wBAAwB,cAAc,OAA4B;AAChF,QAAM,CAAC,MAAM,OAAO,QAAI,uBAAS,WAAW;AAE5C,QAAM,iBAAa,0BAAY,MAAM,QAAQ,IAAI,GAAG,CAAC,CAAC;AACtD,QAAM,kBAAc,0BAAY,MAAM,QAAQ,KAAK,GAAG,CAAC,CAAC;AAExD,SAAO,EAAE,MAAM,YAAY,YAAY;AACzC;;;ACNA,IAAM,cACJ;AACF,IAAM,YAAY;AAClB,IAAM,SAAS;AACf,IAAM,QAAQ;AACd,IAAM,SAAS;AACf,IAAM,gBAAgB;AAIf,IAAM,eAA0B;AAAA,EACrC,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,aAAa;AAAA,EACb,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,cAAc;AAAA,EACd,cAAc;AAChB;AAMO,SAAS,eACd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EA,WACE,gFACE;AAAA,oDAAC,uBAAY,UAAoB;AAAA,MAChC,YAAY,8CAAC,0BAAe,IAAK,8CAAC,kBAAO,QAAgB,cAA4B;AAAA,OACxF;AAAA,EAEJ;AAEA,SACE,+CAAC,SAAI,KAAU,WAAU,WAAU,OAAO,WAEvC;AAAA,YACC;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,MAAK;AAAA,QACL,cAAW;AAAA,QACX,cAAY,GAAG,KAAK;AAAA,QAEpB;AAAA;AAAA,YAAC;AAAA;AAAA,cACC;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAS;AAAA;AAAA,UACX;AAAA,UACA,8CAAC,SAAI,WAAU,mBAAmB,qBAAW,GAAE;AAAA;AAAA;AAAA,IACjD;AAAA,IAID,CAAC,QACA;AAAA,MAAC;AAAA;AAAA,QACC,WAAU;AAAA,QACV,SAAS;AAAA,QACT,cAAW;AAAA,QACX,iBAAc;AAAA,QACd,MAAK;AAAA,QAEL;AAAA,UAAC;AAAA;AAAA,YACC,OAAM;AAAA,YACN,OAAM;AAAA,YACN,QAAO;AAAA,YACP,SAAQ;AAAA,YACR,MAAK;AAAA,YACL,eAAY;AAAA,YAEZ,wDAAC,UAAK,GAAE,sEAAqE;AAAA;AAAA,QAC/E;AAAA;AAAA,IACF;AAAA,KAEJ;AAEJ,CAAC;AAED,qBAAqB,cAAc;",
6
6
  "names": ["import_react", "import_react", "import_jsx_runtime", "import_react", "import_react", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "import_jsx_runtime", "React"]
7
7
  }
package/dist/cjs/index.js CHANGED
@@ -1032,7 +1032,7 @@ var defaultTheme = {
1032
1032
  buttonRadius: 8,
1033
1033
  borderRadius: 12
1034
1034
  };
1035
- function buildThemeVars(partial) {
1035
+ function buildThemeVars(partial, width, height) {
1036
1036
  const theme = { ...defaultTheme, ...partial };
1037
1037
  return {
1038
1038
  // Colours
@@ -1054,8 +1054,8 @@ function buildThemeVars(partial) {
1054
1054
  "--cw-font-family": FONT_FAMILY,
1055
1055
  "--cw-font-size": FONT_SIZE,
1056
1056
  "--cw-shadow": SHADOW,
1057
- "--cw-width": WIDTH,
1058
- "--cw-height": HEIGHT,
1057
+ "--cw-width": width !== void 0 ? typeof width === "number" ? `${width}px` : width : WIDTH,
1058
+ "--cw-height": height !== void 0 ? typeof height === "number" ? `${height}px` : height : HEIGHT,
1059
1059
  "--cw-header-height": HEADER_HEIGHT
1060
1060
  };
1061
1061
  }
@@ -2167,7 +2167,7 @@ var SiteChatComponentNew = import_react12.default.forwardRef(({
2167
2167
  onClose
2168
2168
  }, ref) => {
2169
2169
  const { open, openWidget, closeWidget } = useSiteChatComponentNew(defaultOpen);
2170
- const themeVars = buildThemeVars(theme);
2170
+ const themeVars = buildThemeVars(theme, width, height);
2171
2171
  const handleClose = () => {
2172
2172
  closeWidget();
2173
2173
  onClose == null ? void 0 : onClose();
@@ -2203,7 +2203,6 @@ var SiteChatComponentNew = import_react12.default.forwardRef(({
2203
2203
  role: "dialog",
2204
2204
  "aria-modal": "true",
2205
2205
  "aria-label": `${title} chat widget`,
2206
- style: { ...width !== void 0 && { width }, ...height !== void 0 && { height } },
2207
2206
  children: [
2208
2207
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
2209
2208
  Header_default,