@pocketping/widget 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -47,8 +47,38 @@ var import_preact = require("preact");
47
47
  var import_hooks2 = require("preact/hooks");
48
48
 
49
49
  // src/components/styles.ts
50
- function styles(primaryColor, theme) {
50
+ function resolveThemeColor(color, isDark, defaultLight, defaultDark) {
51
+ if (!color) {
52
+ return isDark ? defaultDark : defaultLight;
53
+ }
54
+ if (typeof color === "string") {
55
+ return color;
56
+ }
57
+ return isDark ? color.dark : color.light;
58
+ }
59
+ function styles(options) {
60
+ const { primaryColor, theme, headerColor, footerColor, chatBackground, toggleColor } = options;
51
61
  const isDark = theme === "dark";
62
+ const resolvedHeaderColor = resolveThemeColor(headerColor, isDark, "#008069", "#202c33");
63
+ const resolvedFooterColor = resolveThemeColor(footerColor, isDark, "#f0f2f5", "#202c33");
64
+ const resolvedToggleColor = resolveThemeColor(toggleColor, isDark, "#25d366", "#25d366");
65
+ const resolvedToggleHoverColor = resolvedToggleColor !== "#25d366" ? adjustBrightness(resolvedToggleColor, -10) : "#22c55e";
66
+ const whatsappPattern = isDark ? `url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")` : `url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E")`;
67
+ const dotsPattern = isDark ? `url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E")` : `url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='10' cy='10' r='1' fill='%23000000' fill-opacity='0.05'/%3E%3C/svg%3E")`;
68
+ const resolvedChatBg = resolveThemeColor(chatBackground, isDark, "whatsapp", "whatsapp");
69
+ const chatBgColor = isDark ? "#0b141a" : "#e5ddd5";
70
+ let chatBgImage = whatsappPattern;
71
+ let chatBgSize = "auto";
72
+ if (resolvedChatBg === "plain") {
73
+ chatBgImage = "none";
74
+ } else if (resolvedChatBg === "dots") {
75
+ chatBgImage = dotsPattern;
76
+ } else if (resolvedChatBg === "whatsapp" || !resolvedChatBg) {
77
+ chatBgImage = whatsappPattern;
78
+ } else if (resolvedChatBg.startsWith("http") || resolvedChatBg.startsWith("/") || resolvedChatBg.startsWith("data:")) {
79
+ chatBgImage = `url("${resolvedChatBg}")`;
80
+ chatBgSize = "cover";
81
+ }
52
82
  const colors = {
53
83
  bg: isDark ? "#1f2937" : "#ffffff",
54
84
  bgSecondary: isDark ? "#374151" : "#f3f4f6",
@@ -57,6 +87,13 @@ function styles(primaryColor, theme) {
57
87
  border: isDark ? "#4b5563" : "#e5e7eb",
58
88
  messageBg: isDark ? "#374151" : "#f3f4f6"
59
89
  };
90
+ function adjustBrightness(hex, percent) {
91
+ const num = parseInt(hex.replace("#", ""), 16);
92
+ const r = Math.min(255, Math.max(0, (num >> 16) + percent));
93
+ const g = Math.min(255, Math.max(0, (num >> 8 & 255) + percent));
94
+ const b = Math.min(255, Math.max(0, (num & 255) + percent));
95
+ return "#" + (16777216 + (r << 16) + (g << 8) + b).toString(16).slice(1);
96
+ }
60
97
  return `
61
98
  #pocketping-container {
62
99
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
@@ -78,29 +115,34 @@ function styles(primaryColor, theme) {
78
115
 
79
116
  .pp-toggle {
80
117
  position: fixed;
81
- width: 56px;
82
- height: 56px;
118
+ width: 60px;
119
+ height: 60px;
83
120
  border-radius: 50%;
84
- background: ${primaryColor};
121
+ background: ${resolvedToggleColor};
85
122
  color: white;
86
123
  border: none;
87
124
  cursor: pointer;
88
125
  display: flex;
89
126
  align-items: center;
90
127
  justify-content: center;
91
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
92
- transition: transform 0.2s, box-shadow 0.2s;
128
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
129
+ transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
93
130
  z-index: 9999;
94
131
  }
95
132
 
96
133
  .pp-toggle:hover {
97
- transform: scale(1.05);
98
- box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
134
+ transform: scale(1.08);
135
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
136
+ background: ${resolvedToggleHoverColor};
137
+ }
138
+
139
+ .pp-toggle:active {
140
+ transform: scale(0.95);
99
141
  }
100
142
 
101
143
  .pp-toggle svg {
102
- width: 24px;
103
- height: 24px;
144
+ width: 28px;
145
+ height: 28px;
104
146
  }
105
147
 
106
148
  .pp-toggle.pp-bottom-right {
@@ -151,13 +193,13 @@ function styles(primaryColor, theme) {
151
193
 
152
194
  .pp-window {
153
195
  position: fixed;
154
- width: 380px;
155
- height: 520px;
196
+ width: 375px;
197
+ height: 550px;
156
198
  max-height: calc(100vh - 100px);
157
199
  max-height: calc(100dvh - 100px);
158
- background: ${colors.bg};
159
- border-radius: 16px;
160
- box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
200
+ background: ${isDark ? "#111b21" : "#ffffff"};
201
+ border-radius: 12px;
202
+ box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
161
203
  display: flex;
162
204
  flex-direction: column;
163
205
  overflow: hidden;
@@ -166,12 +208,12 @@ function styles(primaryColor, theme) {
166
208
  }
167
209
 
168
210
  .pp-window.pp-bottom-right {
169
- bottom: 88px;
211
+ bottom: 20px;
170
212
  right: 20px;
171
213
  }
172
214
 
173
215
  .pp-window.pp-bottom-left {
174
- bottom: 88px;
216
+ bottom: 20px;
175
217
  left: 20px;
176
218
  }
177
219
 
@@ -180,9 +222,9 @@ function styles(primaryColor, theme) {
180
222
  width: calc(100vw - 20px);
181
223
  height: auto;
182
224
  min-height: 300px;
183
- max-height: calc(100vh - 100px);
184
- max-height: calc(100svh - 100px); /* svh = small viewport, excludes keyboard */
185
- bottom: 80px;
225
+ max-height: calc(100vh - 40px);
226
+ max-height: calc(100svh - 40px); /* svh = small viewport, excludes keyboard */
227
+ bottom: 10px;
186
228
  right: 10px;
187
229
  left: 10px;
188
230
  border-radius: 12px;
@@ -200,35 +242,38 @@ function styles(primaryColor, theme) {
200
242
  display: flex;
201
243
  align-items: center;
202
244
  justify-content: space-between;
203
- padding: 12px 14px;
204
- background: ${primaryColor};
245
+ padding: 10px 16px;
246
+ background: ${resolvedHeaderColor};
205
247
  color: white;
206
248
  }
207
249
 
208
250
  .pp-header-info {
209
251
  display: flex;
210
252
  align-items: center;
211
- gap: 10px;
253
+ gap: 12px;
212
254
  }
213
255
 
214
256
  .pp-avatar {
215
- width: 36px;
216
- height: 36px;
257
+ width: 40px;
258
+ height: 40px;
217
259
  border-radius: 50%;
218
260
  object-fit: cover;
261
+ border: 2px solid rgba(255, 255, 255, 0.2);
219
262
  }
220
263
 
221
264
  .pp-header-title {
222
- font-weight: 600;
223
- font-size: 15px;
265
+ font-weight: 500;
266
+ font-size: 16px;
267
+ letter-spacing: 0.1px;
224
268
  }
225
269
 
226
270
  .pp-header-status {
227
- font-size: 11px;
228
- opacity: 0.85;
271
+ font-size: 13px;
272
+ opacity: 0.9;
229
273
  display: flex;
230
274
  align-items: center;
231
- gap: 4px;
275
+ gap: 5px;
276
+ font-weight: 400;
232
277
  }
233
278
 
234
279
  .pp-status-dot {
@@ -239,7 +284,8 @@ function styles(primaryColor, theme) {
239
284
  }
240
285
 
241
286
  .pp-status-dot.pp-online {
242
- background: #22c55e;
287
+ background: #25d366;
288
+ box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.3);
243
289
  }
244
290
 
245
291
  .pp-close-btn {
@@ -247,13 +293,13 @@ function styles(primaryColor, theme) {
247
293
  border: none;
248
294
  color: white;
249
295
  cursor: pointer;
250
- padding: 4px;
251
- border-radius: 4px;
252
- opacity: 0.8;
253
- transition: opacity 0.2s;
296
+ padding: 8px;
297
+ border-radius: 50%;
298
+ opacity: 0.9;
299
+ transition: opacity 0.2s, background 0.2s;
254
300
  flex-shrink: 0;
255
- width: 28px;
256
- height: 28px;
301
+ width: 36px;
302
+ height: 36px;
257
303
  display: flex;
258
304
  align-items: center;
259
305
  justify-content: center;
@@ -261,47 +307,59 @@ function styles(primaryColor, theme) {
261
307
 
262
308
  .pp-close-btn:hover {
263
309
  opacity: 1;
310
+ background: rgba(255, 255, 255, 0.1);
264
311
  }
265
312
 
266
313
  .pp-close-btn svg {
267
- width: 16px;
268
- height: 16px;
314
+ width: 18px;
315
+ height: 18px;
269
316
  }
270
317
 
271
318
  .pp-messages {
272
319
  flex: 1;
273
320
  overflow-y: auto;
274
- padding: 32px 12px 12px 12px;
321
+ padding: 16px 12px;
275
322
  display: flex;
276
323
  flex-direction: column;
277
- gap: 3px;
324
+ gap: 2px;
278
325
  overscroll-behavior: contain;
279
326
  -webkit-overflow-scrolling: touch;
280
- /* Ensure proper stacking context for positioned elements */
281
327
  position: relative;
328
+ background: ${chatBgColor};
329
+ background-image: ${chatBgImage};
330
+ background-size: ${chatBgSize};
331
+ background-position: center;
282
332
  }
283
333
 
284
334
  .pp-welcome {
285
335
  text-align: center;
286
- color: ${colors.textSecondary};
287
- padding: 24px;
288
- font-size: 13px;
336
+ color: ${isDark ? "#8696a0" : "#667781"};
337
+ padding: 32px 24px;
338
+ font-size: 14px;
339
+ line-height: 1.5;
340
+ background: ${isDark ? "rgba(17, 27, 33, 0.9)" : "rgba(255, 255, 255, 0.95)"};
341
+ margin: 12px;
342
+ border-radius: 8px;
343
+ box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
289
344
  }
290
345
 
291
346
  .pp-date-separator {
292
347
  display: flex;
293
348
  align-items: center;
294
349
  justify-content: center;
295
- margin: 16px 0 12px;
350
+ margin: 12px 0;
296
351
  }
297
352
 
298
353
  .pp-date-separator span {
299
- background: ${colors.bgSecondary};
300
- color: ${colors.textSecondary};
301
- font-size: 11px;
302
- padding: 4px 12px;
303
- border-radius: 12px;
304
- font-weight: 500;
354
+ background: ${isDark ? "rgba(17, 27, 33, 0.9)" : "rgba(255, 255, 255, 0.95)"};
355
+ color: ${isDark ? "#8696a0" : "#54656f"};
356
+ font-size: 12px;
357
+ padding: 6px 12px;
358
+ border-radius: 8px;
359
+ font-weight: 400;
360
+ box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
361
+ text-transform: uppercase;
362
+ letter-spacing: 0.3px;
305
363
  }
306
364
 
307
365
  /* Swipe container for mobile actions */
@@ -323,25 +381,32 @@ function styles(primaryColor, theme) {
323
381
 
324
382
  .pp-swipe-actions {
325
383
  position: absolute;
326
- right: 0;
327
384
  top: 0;
328
385
  bottom: 0;
329
- display: flex;
386
+ display: none; /* Hidden by default - only show on mobile with touch */
330
387
  align-items: center;
331
388
  gap: 4px;
332
- padding-right: 8px;
389
+ opacity: 0;
390
+ pointer-events: none;
391
+ }
392
+
393
+ /* Only show swipe actions on touch devices */
394
+ @media (hover: none) and (pointer: coarse) {
395
+ .pp-swipe-actions {
396
+ display: flex;
397
+ }
333
398
  }
334
399
 
335
400
  .pp-swipe-left .pp-swipe-actions {
336
- right: 0;
401
+ right: -80px; /* Hidden off-screen to the right */
337
402
  left: auto;
403
+ padding-right: 8px;
338
404
  }
339
405
 
340
406
  .pp-swipe-right .pp-swipe-actions {
341
- left: 0;
407
+ left: -80px; /* Hidden off-screen to the left */
342
408
  right: auto;
343
409
  padding-left: 8px;
344
- padding-right: 0;
345
410
  }
346
411
 
347
412
  .pp-swipe-action {
@@ -374,122 +439,67 @@ function styles(primaryColor, theme) {
374
439
  }
375
440
 
376
441
  .pp-message {
377
- max-width: 85%;
378
- padding: 6px 10px;
379
- border-radius: 12px;
442
+ max-width: 80%;
443
+ padding: 6px 8px 6px 9px;
444
+ border-radius: 8px;
380
445
  word-wrap: break-word;
446
+ overflow-wrap: break-word;
381
447
  position: relative;
382
448
  user-select: text;
383
449
  -webkit-user-select: text;
384
- font-size: 14px;
385
- line-height: 1.35;
386
- display: flex;
387
- flex-direction: column;
450
+ font-size: 14.2px;
451
+ line-height: 1.4;
452
+ display: block; /* Block for proper float behavior */
388
453
  will-change: transform;
389
- }
390
-
391
- /* Hover actions container - positioned above message (Slack style) */
392
- .pp-message-actions {
393
- position: absolute;
394
- top: -32px;
395
- display: flex;
396
- gap: 2px;
397
- background: ${colors.bg};
398
- border: 1px solid ${colors.border};
399
- border-radius: 6px;
400
- box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
401
- padding: 2px;
402
- opacity: 0;
403
- animation: pp-actions-fade-in 0.12s ease forwards;
404
- z-index: 10;
405
- /* Reset color inheritance from message */
406
- color: ${colors.textSecondary};
407
- /* Ensure actions don't interfere with layout */
408
- pointer-events: auto;
409
- }
410
-
411
- @keyframes pp-actions-fade-in {
412
- from { opacity: 0; transform: translateY(4px); }
413
- to { opacity: 1; transform: translateY(0); }
414
- }
415
-
416
- /* Visitor messages: actions aligned right */
417
- .pp-actions-left {
418
- right: 0;
419
- }
420
-
421
- /* Operator messages: actions aligned left */
422
- .pp-actions-right {
423
- left: 0;
424
- }
425
-
426
- .pp-message-actions .pp-action-btn {
427
- width: 24px;
428
- height: 24px;
429
- border: none;
430
- background: transparent;
431
- border-radius: 4px;
432
- cursor: pointer;
433
- display: flex;
434
- align-items: center;
435
- justify-content: center;
436
- color: ${colors.textSecondary} !important;
437
- transition: background 0.1s, color 0.1s;
438
- }
439
-
440
- .pp-message-actions .pp-action-btn:hover {
441
- background: ${colors.bgSecondary};
442
- color: ${colors.text} !important;
443
- }
444
-
445
- .pp-message-actions .pp-action-btn svg {
446
- width: 14px;
447
- height: 14px;
448
- stroke: ${colors.textSecondary};
449
- }
450
-
451
- .pp-message-actions .pp-action-btn:hover svg {
452
- stroke: ${colors.text};
453
- }
454
-
455
- .pp-message-actions .pp-action-delete:hover {
456
- background: #fef2f2;
457
- }
458
-
459
- .pp-message-actions .pp-action-delete:hover svg {
460
- stroke: #ef4444;
461
- }
462
-
463
- .pp-theme-dark .pp-message-actions .pp-action-delete:hover {
464
- background: #7f1d1d;
465
- }
466
-
467
- .pp-theme-dark .pp-message-actions .pp-action-delete:hover svg {
468
- stroke: #fca5a5;
469
- }
470
-
471
- /* Hide hover actions on mobile */
472
- @media (hover: none) and (pointer: coarse) {
473
- .pp-message-actions {
474
- display: none;
475
- }
454
+ box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.13);
476
455
  }
477
456
 
478
457
  .pp-message-visitor {
479
458
  align-self: flex-end;
480
- background: ${primaryColor};
481
- color: white;
482
- border-bottom-right-radius: 3px;
483
- margin-left: 32px;
459
+ background: ${isDark ? "#005c4b" : "#d9fdd3"};
460
+ color: ${isDark ? "#e9edef" : "#111b21"};
461
+ border-top-right-radius: 8px;
462
+ border-top-left-radius: 8px;
463
+ border-bottom-left-radius: 8px;
464
+ border-bottom-right-radius: 0;
465
+ margin-left: 48px;
466
+ }
467
+
468
+ /* WhatsApp-style tail for visitor messages */
469
+ .pp-message-visitor::after {
470
+ content: '';
471
+ position: absolute;
472
+ right: -7px;
473
+ bottom: 0;
474
+ width: 8px;
475
+ height: 13px;
476
+ background: ${isDark ? "#005c4b" : "#d9fdd3"};
477
+ clip-path: path('M 0 0 L 0 13 L 8 13 Q 2 10 0 0');
484
478
  }
485
479
 
486
480
  .pp-message-operator,
487
481
  .pp-message-ai {
488
482
  align-self: flex-start;
489
- background: ${colors.messageBg};
490
- color: ${colors.text};
491
- border-bottom-left-radius: 3px;
492
- margin-right: 32px;
483
+ background: ${isDark ? "#202c33" : "#ffffff"};
484
+ color: ${isDark ? "#e9edef" : "#111b21"};
485
+ border-top-right-radius: 8px;
486
+ border-top-left-radius: 8px;
487
+ border-bottom-right-radius: 8px;
488
+ border-bottom-left-radius: 0;
489
+ margin-right: 48px;
490
+ }
491
+
492
+ /* WhatsApp-style tail for operator messages */
493
+ .pp-message-operator::after,
494
+ .pp-message-ai::after {
495
+ content: '';
496
+ position: absolute;
497
+ left: -7px;
498
+ bottom: 0;
499
+ width: 8px;
500
+ height: 13px;
501
+ background: ${isDark ? "#202c33" : "#ffffff"};
502
+ clip-path: path('M 8 0 L 8 13 L 0 13 Q 6 10 8 0');
493
503
  }
494
504
 
495
505
  /* Add spacing between different senders */
@@ -501,27 +511,41 @@ function styles(primaryColor, theme) {
501
511
  }
502
512
 
503
513
  .pp-message-content {
504
- display: block;
505
- flex: 1;
514
+ display: inline;
506
515
  }
507
516
 
517
+ /* WhatsApp-style inline timestamp - floats to the right */
508
518
  .pp-message-time {
509
- font-size: 10px;
510
- opacity: 0.6;
511
- display: flex;
519
+ font-size: 11px;
520
+ display: inline-flex;
512
521
  align-items: center;
513
522
  gap: 3px;
523
+ float: right;
524
+ margin: 3px 0 0 12px;
525
+ color: ${isDark ? "rgba(255,255,255,0.6)" : "rgba(0,0,0,0.45)"};
526
+ white-space: nowrap;
527
+ }
528
+
529
+ .pp-message-visitor .pp-message-time {
530
+ color: ${isDark ? "rgba(255,255,255,0.7)" : "rgba(0,0,0,0.45)"};
531
+ }
532
+
533
+ /* Timestamp for attachment-only messages */
534
+ .pp-attachment-time {
535
+ float: none;
536
+ display: flex;
514
537
  justify-content: flex-end;
515
- margin-top: 8px;
516
- flex-shrink: 0;
538
+ margin-top: 4px;
517
539
  }
518
540
 
519
541
  .pp-ai-badge {
520
- background: rgba(0, 0, 0, 0.1);
521
- padding: 1px 4px;
542
+ background: ${isDark ? "rgba(255,255,255,0.15)" : "rgba(0, 0, 0, 0.08)"};
543
+ padding: 2px 5px;
522
544
  border-radius: 4px;
523
- font-size: 10px;
545
+ font-size: 9px;
524
546
  font-weight: 600;
547
+ text-transform: uppercase;
548
+ letter-spacing: 0.3px;
525
549
  }
526
550
 
527
551
  .pp-status {
@@ -537,11 +561,11 @@ function styles(primaryColor, theme) {
537
561
 
538
562
  .pp-check,
539
563
  .pp-check-double {
540
- stroke: rgba(255, 255, 255, 0.7);
564
+ stroke: ${isDark ? "rgba(255, 255, 255, 0.5)" : "rgba(0, 0, 0, 0.35)"};
541
565
  }
542
566
 
543
567
  .pp-check-read {
544
- stroke: #34b7f1;
568
+ stroke: #53bdeb;
545
569
  }
546
570
 
547
571
  .pp-status-sending .pp-check {
@@ -550,14 +574,15 @@ function styles(primaryColor, theme) {
550
574
 
551
575
  .pp-typing {
552
576
  display: flex;
553
- gap: 3px;
554
- padding: 8px 12px;
577
+ gap: 4px;
578
+ padding: 12px 14px;
579
+ align-items: center;
555
580
  }
556
581
 
557
582
  .pp-typing span {
558
- width: 6px;
559
- height: 6px;
560
- background: ${colors.textSecondary};
583
+ width: 7px;
584
+ height: 7px;
585
+ background: ${isDark ? "#8696a0" : "#667781"};
561
586
  border-radius: 50%;
562
587
  animation: pp-bounce 1.4s infinite ease-in-out both;
563
588
  }
@@ -572,57 +597,56 @@ function styles(primaryColor, theme) {
572
597
 
573
598
  .pp-input-form {
574
599
  display: flex;
575
- padding: 10px 12px;
600
+ padding: 8px 10px;
576
601
  gap: 8px;
577
- border-top: 1px solid ${colors.border};
602
+ background: ${resolvedFooterColor};
578
603
  align-items: center;
579
604
  }
580
605
 
581
606
  .pp-input {
582
607
  flex: 1;
583
608
  min-width: 0;
584
- height: 40px;
585
- line-height: 40px;
586
- padding: 0 16px;
587
- border: 1px solid ${colors.border};
588
- border-radius: 20px;
589
- background: ${colors.bg};
590
- color: ${colors.text};
591
- font-size: 14px;
609
+ height: 42px;
610
+ line-height: 42px;
611
+ padding: 0 14px;
612
+ border: none;
613
+ border-radius: 8px;
614
+ background: ${isDark ? "#2a3942" : "#ffffff"};
615
+ color: ${isDark ? "#e9edef" : "#111b21"};
616
+ font-size: 15px;
592
617
  outline: none;
593
- transition: border-color 0.2s;
594
618
  box-sizing: border-box;
595
619
  margin: 0;
596
620
  }
597
621
 
598
622
  .pp-input:focus {
599
- border-color: ${primaryColor};
623
+ outline: none;
600
624
  }
601
625
 
602
626
  .pp-input::placeholder {
603
- color: ${colors.textSecondary};
627
+ color: ${isDark ? "#8696a0" : "#667781"};
604
628
  }
605
629
 
606
630
  .pp-send-btn {
607
- width: 40px;
608
- height: 40px;
609
- min-width: 40px;
631
+ width: 42px;
632
+ height: 42px;
633
+ min-width: 42px;
610
634
  border-radius: 50%;
611
- background: ${primaryColor};
635
+ background: #00a884;
612
636
  color: white;
613
637
  border: none;
614
638
  cursor: pointer;
615
639
  display: flex;
616
640
  align-items: center;
617
641
  justify-content: center;
618
- transition: opacity 0.2s, transform 0.1s;
642
+ transition: background 0.2s, transform 0.1s;
619
643
  flex-shrink: 0;
620
644
  margin: 0;
621
645
  padding: 0;
622
646
  }
623
647
 
624
648
  .pp-send-btn:not(:disabled):hover {
625
- transform: scale(1.05);
649
+ background: #008f72;
626
650
  }
627
651
 
628
652
  .pp-send-btn:not(:disabled):active {
@@ -630,27 +654,27 @@ function styles(primaryColor, theme) {
630
654
  }
631
655
 
632
656
  .pp-send-btn:disabled {
633
- opacity: 0.5;
657
+ background: ${isDark ? "#3b4a54" : "#b3b3b3"};
634
658
  cursor: not-allowed;
635
659
  }
636
660
 
637
661
  .pp-send-btn svg {
638
- width: 18px;
639
- height: 18px;
662
+ width: 20px;
663
+ height: 20px;
640
664
  }
641
665
 
642
666
  .pp-footer {
643
667
  text-align: center;
644
- padding: 8px;
645
- font-size: 11px;
646
- color: ${colors.textSecondary};
647
- border-top: 1px solid ${colors.border};
648
- opacity: 0.7;
668
+ padding: 6px 8px;
669
+ font-size: 10px;
670
+ color: ${isDark ? "#8696a0" : "#667781"};
671
+ background: ${resolvedFooterColor};
649
672
  }
650
673
 
651
674
  .pp-footer a {
652
- color: ${primaryColor};
675
+ color: ${isDark ? "#00a884" : "#008069"};
653
676
  text-decoration: none;
677
+ font-weight: 500;
654
678
  }
655
679
 
656
680
  .pp-footer a:hover {
@@ -672,26 +696,26 @@ function styles(primaryColor, theme) {
672
696
  }
673
697
 
674
698
  .pp-attach-btn {
675
- width: 40px;
676
- height: 40px;
677
- min-width: 40px;
699
+ width: 42px;
700
+ height: 42px;
701
+ min-width: 42px;
678
702
  border-radius: 50%;
679
703
  background: transparent;
680
- color: ${colors.textSecondary};
681
- border: 1px solid ${colors.border};
704
+ color: ${isDark ? "#8696a0" : "#54656f"};
705
+ border: none;
682
706
  cursor: pointer;
683
707
  display: flex;
684
708
  align-items: center;
685
709
  justify-content: center;
686
710
  margin: 0;
687
711
  padding: 0;
688
- transition: color 0.2s, border-color 0.2s;
712
+ transition: color 0.2s, background 0.2s;
689
713
  flex-shrink: 0;
690
714
  }
691
715
 
692
716
  .pp-attach-btn:hover:not(:disabled) {
693
- color: ${primaryColor};
694
- border-color: ${primaryColor};
717
+ color: ${isDark ? "#aebac1" : "#3b4a54"};
718
+ background: ${isDark ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.05)"};
695
719
  }
696
720
 
697
721
  .pp-attach-btn:disabled {
@@ -700,28 +724,27 @@ function styles(primaryColor, theme) {
700
724
  }
701
725
 
702
726
  .pp-attach-btn svg {
703
- width: 18px;
704
- height: 18px;
727
+ width: 22px;
728
+ height: 22px;
705
729
  }
706
730
 
707
731
  .pp-attachments-preview {
708
732
  display: flex;
709
733
  gap: 8px;
710
- padding: 8px 12px;
711
- border-top: 1px solid ${colors.border};
734
+ padding: 10px 12px;
712
735
  overflow-x: auto;
713
- background: ${colors.bgSecondary};
736
+ background: ${resolvedFooterColor};
714
737
  }
715
738
 
716
739
  .pp-attachment-preview {
717
740
  position: relative;
718
- width: 60px;
719
- height: 60px;
720
- border-radius: 8px;
741
+ width: 64px;
742
+ height: 64px;
743
+ border-radius: 10px;
721
744
  overflow: hidden;
722
745
  flex-shrink: 0;
723
- background: ${colors.bg};
724
- border: 1px solid ${colors.border};
746
+ background: ${isDark ? "#2a3942" : "#ffffff"};
747
+ box-shadow: 0 1px 2px rgba(0,0,0,0.1);
725
748
  }
726
749
 
727
750
  .pp-preview-img {
@@ -915,81 +938,86 @@ function styles(primaryColor, theme) {
915
938
  .pp-drop-overlay {
916
939
  position: absolute;
917
940
  inset: 0;
918
- background: ${isDark ? "rgba(0,0,0,0.9)" : "rgba(255,255,255,0.95)"};
941
+ background: ${isDark ? "rgba(17, 27, 33, 0.95)" : "rgba(255,255,255,0.97)"};
919
942
  display: flex;
920
943
  flex-direction: column;
921
944
  align-items: center;
922
945
  justify-content: center;
923
- gap: 12px;
946
+ gap: 16px;
924
947
  z-index: 100;
925
- border: 3px dashed ${primaryColor};
926
- border-radius: 16px;
948
+ border: 3px dashed #00a884;
949
+ border-radius: 12px;
927
950
  margin: 4px;
928
951
  pointer-events: none;
929
952
  }
930
953
 
931
954
  .pp-drop-icon svg {
932
- width: 48px;
933
- height: 48px;
934
- color: ${primaryColor};
955
+ width: 56px;
956
+ height: 56px;
957
+ color: #00a884;
935
958
  }
936
959
 
937
960
  .pp-drop-text {
938
- font-size: 16px;
961
+ font-size: 17px;
939
962
  font-weight: 500;
940
- color: ${colors.text};
963
+ color: ${isDark ? "#e9edef" : "#111b21"};
941
964
  }
942
965
 
943
966
  /* Message Context Menu */
944
967
  .pp-message-menu {
945
968
  position: fixed;
946
- background: ${colors.bg};
947
- border: 1px solid ${colors.border};
948
- border-radius: 8px;
949
- box-shadow: 0 4px 12px rgba(0,0,0,0.15);
950
- padding: 4px;
969
+ background: ${isDark ? "#233138" : "#ffffff"};
970
+ border: none;
971
+ border-radius: 12px;
972
+ box-shadow: 0 8px 24px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
973
+ padding: 6px;
951
974
  z-index: 200;
952
- min-width: 120px;
975
+ min-width: 140px;
953
976
  }
954
977
 
955
978
  .pp-message-menu button {
956
979
  display: flex;
957
980
  align-items: center;
958
- gap: 8px;
981
+ gap: 10px;
959
982
  width: 100%;
960
- padding: 8px 12px;
983
+ padding: 10px 14px;
961
984
  border: none;
962
985
  background: transparent;
963
- color: ${colors.text};
964
- font-size: 13px;
986
+ color: ${isDark ? "#e9edef" : "#111b21"};
987
+ font-size: 14px;
965
988
  cursor: pointer;
966
- border-radius: 4px;
989
+ border-radius: 8px;
967
990
  text-align: left;
991
+ transition: background 0.15s;
968
992
  }
969
993
 
970
994
  .pp-message-menu button:hover {
971
- background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.05)"};
995
+ background: ${isDark ? "rgba(255,255,255,0.08)" : "rgba(0,0,0,0.05)"};
972
996
  }
973
997
 
974
998
  .pp-message-menu button svg {
975
- width: 16px;
976
- height: 16px;
999
+ width: 18px;
1000
+ height: 18px;
977
1001
  }
978
1002
 
979
1003
  .pp-menu-delete {
980
1004
  color: #ef4444 !important;
981
1005
  }
982
1006
 
1007
+ .pp-menu-delete:hover {
1008
+ background: ${isDark ? "rgba(239,68,68,0.15)" : "rgba(239,68,68,0.08)"} !important;
1009
+ }
1010
+
983
1011
  /* Edit Modal */
984
1012
  .pp-edit-modal {
985
1013
  position: absolute;
986
1014
  bottom: 80px;
987
1015
  left: 12px;
988
1016
  right: 12px;
989
- background: ${colors.bg};
990
- border: 1px solid ${colors.border};
1017
+ background: ${isDark ? "#233138" : "#ffffff"};
1018
+ border: none;
991
1019
  border-radius: 12px;
992
- box-shadow: 0 4px 20px rgba(0,0,0,0.15);
1020
+ box-shadow: 0 8px 28px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.1);
993
1021
  z-index: 150;
994
1022
  overflow: hidden;
995
1023
  }
@@ -998,17 +1026,24 @@ function styles(primaryColor, theme) {
998
1026
  display: flex;
999
1027
  justify-content: space-between;
1000
1028
  align-items: center;
1001
- padding: 12px 16px;
1002
- border-bottom: 1px solid ${colors.border};
1029
+ padding: 14px 16px;
1030
+ border-bottom: 1px solid ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.08)"};
1003
1031
  font-weight: 500;
1032
+ color: ${isDark ? "#e9edef" : "#111b21"};
1004
1033
  }
1005
1034
 
1006
1035
  .pp-edit-header button {
1007
1036
  background: transparent;
1008
1037
  border: none;
1009
- color: ${colors.textSecondary};
1038
+ color: ${isDark ? "#8696a0" : "#667781"};
1010
1039
  cursor: pointer;
1011
- padding: 4px;
1040
+ padding: 6px;
1041
+ border-radius: 50%;
1042
+ transition: background 0.15s;
1043
+ }
1044
+
1045
+ .pp-edit-header button:hover {
1046
+ background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.05)"};
1012
1047
  }
1013
1048
 
1014
1049
  .pp-edit-header button svg {
@@ -1018,46 +1053,62 @@ function styles(primaryColor, theme) {
1018
1053
 
1019
1054
  .pp-edit-input {
1020
1055
  width: 100%;
1021
- padding: 12px 16px;
1056
+ padding: 14px 16px;
1022
1057
  border: none;
1023
1058
  background: transparent;
1024
- color: ${colors.text};
1025
- font-size: 14px;
1059
+ color: ${isDark ? "#e9edef" : "#111b21"};
1060
+ font-size: 15px;
1026
1061
  resize: none;
1027
1062
  min-height: 80px;
1028
1063
  outline: none;
1064
+ line-height: 1.5;
1065
+ }
1066
+
1067
+ .pp-edit-input::placeholder {
1068
+ color: ${isDark ? "#8696a0" : "#667781"};
1029
1069
  }
1030
1070
 
1031
1071
  .pp-edit-actions {
1032
1072
  display: flex;
1033
1073
  justify-content: flex-end;
1034
- gap: 8px;
1074
+ gap: 10px;
1035
1075
  padding: 12px 16px;
1036
- border-top: 1px solid ${colors.border};
1076
+ border-top: 1px solid ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.08)"};
1037
1077
  }
1038
1078
 
1039
1079
  .pp-edit-cancel {
1040
- padding: 8px 16px;
1041
- border: 1px solid ${colors.border};
1042
- border-radius: 6px;
1043
- background: transparent;
1044
- color: ${colors.text};
1045
- font-size: 13px;
1080
+ padding: 10px 20px;
1081
+ border: none;
1082
+ border-radius: 8px;
1083
+ background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.05)"};
1084
+ color: ${isDark ? "#e9edef" : "#111b21"};
1085
+ font-size: 14px;
1046
1086
  cursor: pointer;
1087
+ transition: background 0.15s;
1088
+ }
1089
+
1090
+ .pp-edit-cancel:hover {
1091
+ background: ${isDark ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.08)"};
1047
1092
  }
1048
1093
 
1049
1094
  .pp-edit-save {
1050
- padding: 8px 16px;
1095
+ padding: 10px 20px;
1051
1096
  border: none;
1052
- border-radius: 6px;
1053
- background: ${primaryColor};
1097
+ border-radius: 8px;
1098
+ background: #00a884;
1054
1099
  color: white;
1055
- font-size: 13px;
1100
+ font-size: 14px;
1101
+ font-weight: 500;
1056
1102
  cursor: pointer;
1103
+ transition: background 0.15s;
1104
+ }
1105
+
1106
+ .pp-edit-save:hover:not(:disabled) {
1107
+ background: #008f72;
1057
1108
  }
1058
1109
 
1059
1110
  .pp-edit-save:disabled {
1060
- opacity: 0.5;
1111
+ background: ${isDark ? "#3b4a54" : "#b3b3b3"};
1061
1112
  cursor: not-allowed;
1062
1113
  }
1063
1114
 
@@ -1065,11 +1116,10 @@ function styles(primaryColor, theme) {
1065
1116
  .pp-reply-preview {
1066
1117
  display: flex;
1067
1118
  align-items: center;
1068
- gap: 8px;
1119
+ gap: 10px;
1069
1120
  padding: 8px 12px;
1070
- background: ${isDark ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.03)"};
1071
- border-top: 1px solid ${colors.border};
1072
- border-left: 3px solid ${primaryColor};
1121
+ background: ${resolvedFooterColor};
1122
+ border-left: 4px solid #00a884;
1073
1123
  }
1074
1124
 
1075
1125
  .pp-reply-preview-content {
@@ -1079,55 +1129,56 @@ function styles(primaryColor, theme) {
1079
1129
 
1080
1130
  .pp-reply-label {
1081
1131
  display: block;
1082
- font-size: 11px;
1083
- color: ${primaryColor};
1132
+ font-size: 12px;
1133
+ color: #00a884;
1084
1134
  font-weight: 500;
1085
1135
  margin-bottom: 2px;
1086
1136
  }
1087
1137
 
1088
1138
  .pp-reply-text {
1089
1139
  display: block;
1090
- font-size: 12px;
1091
- color: ${colors.textSecondary};
1140
+ font-size: 13px;
1141
+ color: ${isDark ? "#8696a0" : "#667781"};
1092
1142
  white-space: nowrap;
1093
1143
  overflow: hidden;
1094
1144
  text-overflow: ellipsis;
1095
1145
  }
1096
1146
 
1097
1147
  .pp-reply-cancel {
1098
- background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.05)"};
1148
+ background: transparent;
1099
1149
  border: none;
1100
1150
  border-radius: 50%;
1101
- color: ${colors.textSecondary};
1151
+ color: ${isDark ? "#8696a0" : "#667781"};
1102
1152
  cursor: pointer;
1103
1153
  padding: 0;
1104
- width: 24px;
1105
- height: 24px;
1106
- min-width: 24px;
1154
+ width: 28px;
1155
+ height: 28px;
1156
+ min-width: 28px;
1107
1157
  display: flex;
1108
1158
  align-items: center;
1109
1159
  justify-content: center;
1110
1160
  flex-shrink: 0;
1111
- transition: background 0.15s;
1161
+ transition: background 0.15s, color 0.15s;
1112
1162
  }
1113
1163
 
1114
1164
  .pp-reply-cancel:hover {
1115
- background: ${isDark ? "rgba(255,255,255,0.2)" : "rgba(0,0,0,0.1)"};
1165
+ background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.08)"};
1166
+ color: ${isDark ? "#aebac1" : "#3b4a54"};
1116
1167
  }
1117
1168
 
1118
1169
  .pp-reply-cancel svg {
1119
- width: 14px;
1120
- height: 14px;
1170
+ width: 16px;
1171
+ height: 16px;
1121
1172
  }
1122
1173
 
1123
1174
  /* Reply Quote in Message */
1124
1175
  .pp-reply-quote {
1125
- background: ${isDark ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.05)"};
1126
- border-left: 2px solid ${primaryColor};
1127
- padding: 4px 8px;
1128
- margin-bottom: 6px;
1129
- border-radius: 0 4px 4px 0;
1130
- font-size: 12px;
1176
+ background: ${isDark ? "rgba(0,0,0,0.2)" : "rgba(0,0,0,0.05)"};
1177
+ border-left: 3px solid #00a884;
1178
+ padding: 6px 10px;
1179
+ margin-bottom: 4px;
1180
+ border-radius: 0 6px 6px 0;
1181
+ font-size: 13px;
1131
1182
  position: relative;
1132
1183
  z-index: 1;
1133
1184
  }
@@ -1135,13 +1186,14 @@ function styles(primaryColor, theme) {
1135
1186
  .pp-reply-sender {
1136
1187
  display: block;
1137
1188
  font-weight: 500;
1138
- color: ${primaryColor};
1189
+ color: #00a884;
1139
1190
  margin-bottom: 2px;
1191
+ font-size: 12px;
1140
1192
  }
1141
1193
 
1142
1194
  .pp-reply-content {
1143
1195
  display: block;
1144
- color: ${colors.textSecondary};
1196
+ color: ${isDark ? "#8696a0" : "#667781"};
1145
1197
  white-space: nowrap;
1146
1198
  overflow: hidden;
1147
1199
  text-overflow: ellipsis;
@@ -1150,30 +1202,33 @@ function styles(primaryColor, theme) {
1150
1202
  /* Clickable reply quote */
1151
1203
  .pp-reply-quote-clickable {
1152
1204
  cursor: pointer;
1153
- transition: background 0.15s, transform 0.1s;
1205
+ transition: background 0.15s;
1154
1206
  }
1155
1207
 
1156
1208
  .pp-reply-quote-clickable:hover {
1157
- background: ${isDark ? "rgba(255,255,255,0.15)" : "rgba(0,0,0,0.08)"};
1209
+ background: ${isDark ? "rgba(0,0,0,0.3)" : "rgba(0,0,0,0.08)"};
1158
1210
  }
1159
1211
 
1160
1212
  .pp-reply-quote-clickable:active {
1161
- transform: scale(0.98);
1213
+ transform: scale(0.99);
1162
1214
  }
1163
1215
 
1164
1216
  /* Reply quote in visitor message bubble needs higher contrast */
1165
1217
  .pp-message-visitor .pp-reply-quote {
1166
- background: rgba(255, 255, 255, 0.18);
1167
- border-left-color: rgba(255, 255, 255, 0.7);
1218
+ background: ${isDark ? "rgba(0,0,0,0.2)" : "rgba(0,0,0,0.08)"};
1219
+ border-left-color: ${isDark ? "rgba(255,255,255,0.5)" : "#00a884"};
1168
1220
  }
1169
1221
 
1170
1222
  .pp-message-visitor .pp-reply-quote-clickable:hover {
1171
- background: rgba(255, 255, 255, 0.25);
1223
+ background: ${isDark ? "rgba(0,0,0,0.3)" : "rgba(0,0,0,0.12)"};
1224
+ }
1225
+
1226
+ .pp-message-visitor .pp-reply-sender {
1227
+ color: ${isDark ? "rgba(255,255,255,0.9)" : "#00a884"};
1172
1228
  }
1173
1229
 
1174
- .pp-message-visitor .pp-reply-sender,
1175
1230
  .pp-message-visitor .pp-reply-content {
1176
- color: rgba(255, 255, 255, 0.9);
1231
+ color: ${isDark ? "rgba(255,255,255,0.7)" : "rgba(0,0,0,0.6)"};
1177
1232
  }
1178
1233
 
1179
1234
  /* Message highlight animation (when scrolling to a message) */
@@ -1183,13 +1238,13 @@ function styles(primaryColor, theme) {
1183
1238
 
1184
1239
  @keyframes pp-highlight-pulse {
1185
1240
  0% {
1186
- box-shadow: 0 0 0 0 ${primaryColor}80;
1241
+ box-shadow: 0 0 0 0 rgba(0, 168, 132, 0.5);
1187
1242
  }
1188
1243
  30% {
1189
- box-shadow: 0 0 0 6px ${primaryColor}40;
1244
+ box-shadow: 0 0 0 6px rgba(0, 168, 132, 0.25);
1190
1245
  }
1191
1246
  100% {
1192
- box-shadow: 0 0 0 0 ${primaryColor}00;
1247
+ box-shadow: 0 0 0 0 rgba(0, 168, 132, 0);
1193
1248
  }
1194
1249
  }
1195
1250
 
@@ -1213,9 +1268,9 @@ function styles(primaryColor, theme) {
1213
1268
  /* Edited Badge */
1214
1269
  .pp-edited-badge {
1215
1270
  font-size: 10px;
1216
- color: ${colors.textSecondary};
1217
1271
  margin-left: 4px;
1218
1272
  font-style: italic;
1273
+ opacity: 0.7;
1219
1274
  }
1220
1275
 
1221
1276
  /* Pre-Chat Form */
@@ -1225,19 +1280,21 @@ function styles(primaryColor, theme) {
1225
1280
  flex-direction: column;
1226
1281
  padding: 24px 20px;
1227
1282
  overflow-y: auto;
1283
+ background: ${isDark ? "#111b21" : "#ffffff"};
1228
1284
  }
1229
1285
 
1230
1286
  .pp-prechat-title {
1231
- font-size: 18px;
1287
+ font-size: 20px;
1232
1288
  font-weight: 600;
1233
1289
  margin-bottom: 8px;
1234
- color: ${colors.text};
1290
+ color: ${isDark ? "#e9edef" : "#111b21"};
1235
1291
  }
1236
1292
 
1237
1293
  .pp-prechat-subtitle {
1238
- font-size: 13px;
1239
- color: ${colors.textSecondary};
1294
+ font-size: 14px;
1295
+ color: ${isDark ? "#8696a0" : "#667781"};
1240
1296
  margin-bottom: 24px;
1297
+ line-height: 1.5;
1241
1298
  }
1242
1299
 
1243
1300
  .pp-prechat-tabs {
@@ -1444,20 +1501,20 @@ function styles(primaryColor, theme) {
1444
1501
 
1445
1502
  .pp-prechat-submit {
1446
1503
  width: 100%;
1447
- height: 44px;
1448
- margin-top: 8px;
1504
+ height: 48px;
1505
+ margin-top: 12px;
1449
1506
  border: none;
1450
1507
  border-radius: 8px;
1451
- background: ${primaryColor};
1508
+ background: #00a884;
1452
1509
  color: white;
1453
- font-size: 14px;
1510
+ font-size: 15px;
1454
1511
  font-weight: 500;
1455
1512
  cursor: pointer;
1456
- transition: opacity 0.2s, transform 0.1s;
1513
+ transition: background 0.2s, transform 0.1s;
1457
1514
  }
1458
1515
 
1459
1516
  .pp-prechat-submit:hover:not(:disabled) {
1460
- opacity: 0.9;
1517
+ background: #008f72;
1461
1518
  }
1462
1519
 
1463
1520
  .pp-prechat-submit:active:not(:disabled) {
@@ -1465,24 +1522,24 @@ function styles(primaryColor, theme) {
1465
1522
  }
1466
1523
 
1467
1524
  .pp-prechat-submit:disabled {
1468
- opacity: 0.5;
1525
+ background: ${isDark ? "#3b4a54" : "#b3b3b3"};
1469
1526
  cursor: not-allowed;
1470
1527
  }
1471
1528
 
1472
1529
  .pp-prechat-skip {
1473
1530
  width: 100%;
1474
- padding: 12px;
1531
+ padding: 14px;
1475
1532
  margin-top: 8px;
1476
1533
  border: none;
1477
1534
  background: transparent;
1478
- color: ${colors.textSecondary};
1479
- font-size: 13px;
1535
+ color: ${isDark ? "#8696a0" : "#667781"};
1536
+ font-size: 14px;
1480
1537
  cursor: pointer;
1481
1538
  transition: color 0.2s;
1482
1539
  }
1483
1540
 
1484
1541
  .pp-prechat-skip:hover {
1485
- color: ${colors.text};
1542
+ color: ${isDark ? "#aebac1" : "#3b4a54"};
1486
1543
  }
1487
1544
  `;
1488
1545
  }
@@ -1863,8 +1920,6 @@ function ChatWidget({ client: client2, config: initialConfig }) {
1863
1920
  const [editContent, setEditContent] = (0, import_hooks2.useState)("");
1864
1921
  const [messageMenu, setMessageMenu] = (0, import_hooks2.useState)(null);
1865
1922
  const [isDragging, setIsDragging] = (0, import_hooks2.useState)(false);
1866
- const [hoveredMessageId, setHoveredMessageId] = (0, import_hooks2.useState)(null);
1867
- const [longPressTimer, setLongPressTimer] = (0, import_hooks2.useState)(null);
1868
1923
  const [swipedMessageId, setSwipedMessageId] = (0, import_hooks2.useState)(null);
1869
1924
  const [swipeOffset, setSwipeOffset] = (0, import_hooks2.useState)(0);
1870
1925
  const touchStartRef = (0, import_hooks2.useRef)(null);
@@ -2231,20 +2286,28 @@ function ChatWidget({ client: client2, config: initialConfig }) {
2231
2286
  const theme = getTheme(config.theme ?? "auto");
2232
2287
  const primaryColor = config.primaryColor ?? "#6366f1";
2233
2288
  const actionIconColor = theme === "dark" ? "#9ca3af" : "#6b7280";
2289
+ const styleOptions = {
2290
+ primaryColor,
2291
+ theme,
2292
+ headerColor: config.headerColor,
2293
+ footerColor: config.footerColor,
2294
+ chatBackground: config.chatBackground,
2295
+ toggleColor: config.toggleColor
2296
+ };
2234
2297
  const shouldShowPreChat = preChatForm && preChatForm.enabled && !preChatForm.completed && !preChatSkipped && // Before first message: show immediately
2235
2298
  (preChatForm.timing === "before-first-message" && messages.length === 0 || preChatForm.timing === "after-first-message" && messages.some((m) => m.sender === "visitor"));
2236
2299
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_preact.Fragment, { children: [
2237
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: styles(primaryColor, theme) }),
2238
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2300
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("style", { children: styles(styleOptions) }),
2301
+ !isOpen && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2239
2302
  "button",
2240
2303
  {
2241
2304
  class: `pp-toggle pp-${position}`,
2242
2305
  onClick: () => client2.toggleOpen(),
2243
- "aria-label": isOpen ? "Close chat" : "Open chat",
2306
+ "aria-label": "Open chat",
2244
2307
  children: [
2245
- isOpen ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CloseIcon, {}) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChatIcon, {}),
2246
- !isOpen && unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-unread-badge", children: unreadCount > 9 ? "9+" : unreadCount }),
2247
- !isOpen && unreadCount === 0 && operatorOnline && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-online-dot" })
2308
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChatIcon, {}),
2309
+ unreadCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-unread-badge", children: unreadCount > 9 ? "9+" : unreadCount }),
2310
+ unreadCount === 0 && operatorOnline && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-online-dot" })
2248
2311
  ]
2249
2312
  }
2250
2313
  ),
@@ -2325,8 +2388,6 @@ function ChatWidget({ client: client2, config: initialConfig }) {
2325
2388
  }
2326
2389
  }
2327
2390
  }
2328
- const isHovered = hoveredMessageId === msg.id;
2329
- const showActions = isHovered && !isDeleted;
2330
2391
  const isSwiped = swipedMessageId === msg.id;
2331
2392
  const msgSwipeOffset = isSwiped ? swipeOffset : 0;
2332
2393
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_preact.Fragment, { children: [
@@ -2376,44 +2437,11 @@ function ChatWidget({ client: client2, config: initialConfig }) {
2376
2437
  class: `pp-message pp-message-${msg.sender} ${isDeleted ? "pp-message-deleted" : ""}`,
2377
2438
  style: { transform: `translateX(${msgSwipeOffset}px)`, transition: touchStartRef.current ? "none" : "transform 0.2s ease-out" },
2378
2439
  onContextMenu: (e) => handleMessageContextMenu(e, msg),
2379
- onMouseEnter: () => setHoveredMessageId(msg.id),
2380
- onMouseLeave: () => setHoveredMessageId(null),
2381
2440
  onTouchStart: (e) => handleTouchStart(e, msg),
2382
2441
  onTouchMove: (e) => handleTouchMove(e, msg),
2383
2442
  onTouchEnd: () => handleTouchEnd(msg),
2384
2443
  onTouchCancel: () => handleTouchEnd(msg),
2385
2444
  children: [
2386
- showActions && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { class: `pp-message-actions ${msg.sender === "visitor" ? "pp-actions-left" : "pp-actions-right"}`, children: [
2387
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2388
- "button",
2389
- {
2390
- class: "pp-action-btn",
2391
- onClick: () => handleReply(msg),
2392
- title: "Reply",
2393
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ReplyIcon, { color: actionIconColor })
2394
- }
2395
- ),
2396
- msg.sender === "visitor" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2397
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2398
- "button",
2399
- {
2400
- class: "pp-action-btn",
2401
- onClick: () => handleStartEdit(msg),
2402
- title: "Edit",
2403
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(EditIcon, { color: actionIconColor })
2404
- }
2405
- ),
2406
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
2407
- "button",
2408
- {
2409
- class: "pp-action-btn pp-action-delete",
2410
- onClick: () => handleDelete(msg),
2411
- title: "Delete",
2412
- children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(DeleteIcon, { color: actionIconColor })
2413
- }
2414
- )
2415
- ] })
2416
- ] }),
2417
2445
  replyData && (replyData.content || replyData.hasAttachment) && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
2418
2446
  "div",
2419
2447
  {
@@ -2438,14 +2466,24 @@ function ChatWidget({ client: client2, config: initialConfig }) {
2438
2466
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-deleted-icon", children: "\u{1F5D1}\uFE0F" }),
2439
2467
  " Message deleted"
2440
2468
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_jsx_runtime2.Fragment, { children: [
2441
- msg.content && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { class: "pp-message-content", children: msg.content }),
2442
- msg.attachments && msg.attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { class: "pp-message-attachments", children: msg.attachments.map((att) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AttachmentDisplay, { attachment: att }, att.id)) })
2443
- ] }),
2444
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { class: "pp-message-time", children: [
2445
- formatTime(msg.timestamp),
2446
- isEdited && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-edited-badge", children: "edited" }),
2447
- msg.sender === "ai" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-ai-badge", children: "AI" }),
2448
- msg.sender === "visitor" && !isDeleted && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: `pp-status pp-status-${msg.status ?? "sent"}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StatusIcon, { status: msg.status }) })
2469
+ msg.content && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { class: "pp-message-content", children: [
2470
+ msg.content,
2471
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { class: "pp-message-time", children: [
2472
+ formatTime(msg.timestamp),
2473
+ isEdited && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-edited-badge", children: "edited" }),
2474
+ msg.sender === "ai" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-ai-badge", children: "AI" }),
2475
+ msg.sender === "visitor" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: `pp-status pp-status-${msg.status ?? "sent"}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StatusIcon, { status: msg.status }) })
2476
+ ] })
2477
+ ] }),
2478
+ msg.attachments && msg.attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { class: "pp-message-attachments", children: [
2479
+ msg.attachments.map((att) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(AttachmentDisplay, { attachment: att }, att.id)),
2480
+ !msg.content && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { class: "pp-message-time pp-attachment-time", children: [
2481
+ formatTime(msg.timestamp),
2482
+ isEdited && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-edited-badge", children: "edited" }),
2483
+ msg.sender === "ai" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: "pp-ai-badge", children: "AI" }),
2484
+ msg.sender === "visitor" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { class: `pp-status pp-status-${msg.status ?? "sent"}`, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StatusIcon, { status: msg.status }) })
2485
+ ] })
2486
+ ] })
2449
2487
  ] })
2450
2488
  ]
2451
2489
  }
@@ -2799,6 +2837,18 @@ var PocketPingClient = class {
2799
2837
  if (response.primaryColor) {
2800
2838
  this.config.primaryColor = response.primaryColor;
2801
2839
  }
2840
+ if (response.headerColor) {
2841
+ this.config.headerColor = response.headerColor;
2842
+ }
2843
+ if (response.footerColor) {
2844
+ this.config.footerColor = response.footerColor;
2845
+ }
2846
+ if (response.chatBackground) {
2847
+ this.config.chatBackground = response.chatBackground;
2848
+ }
2849
+ if (response.toggleColor) {
2850
+ this.config.toggleColor = response.toggleColor;
2851
+ }
2802
2852
  if (response.welcomeMessage) {
2803
2853
  this.config.welcomeMessage = response.welcomeMessage;
2804
2854
  }
@@ -2806,6 +2856,10 @@ var PocketPingClient = class {
2806
2856
  operatorName: this.config.operatorName,
2807
2857
  operatorAvatar: this.config.operatorAvatar,
2808
2858
  primaryColor: this.config.primaryColor,
2859
+ headerColor: this.config.headerColor,
2860
+ footerColor: this.config.footerColor,
2861
+ chatBackground: this.config.chatBackground,
2862
+ toggleColor: this.config.toggleColor,
2809
2863
  welcomeMessage: this.config.welcomeMessage
2810
2864
  });
2811
2865
  this.storeSessionId(response.sessionId);