PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 3.2.7
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v3.2.7
3.3.3 3.3.2 3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 All 158 releases
notificationx / includes / Extensions / ExitIntent / ExitIntentNotification.php

ExitIntentNotification.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 3.2.7, at includes/Extensions/ExitIntent/ExitIntentNotification.php

1,296 lines 84.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Exit Intent Popup Extension
4 *
5 * @package NotificationX\Extensions
6 */
7
8 namespace NotificationX\Extensions\ExitIntent;
9
10 use NotificationX\GetInstance;
11 use NotificationX\Core\Rules;
12 use NotificationX\Extensions\GlobalFields;
13 use NotificationX\Extensions\Extension;
14
15 /**
16 * Exit Intent Popup Extension
17 * @method static ExitIntentNotification get_instance($args = null)
18 */
19 class ExitIntentNotification extends Extension {
20 use GetInstance;
21
22 public $priority = 16;
23 public $id = 'exit_intent_custom';
24 public $doc_link = 'https://notificationx.com/docs/';
25 public $types = 'exit_intent';
26 public $module = 'modules_exit_intent';
27
28 public function __construct() {
29 parent::__construct();
30 }
31
32 public function init_extension() {
33 $this->title = __( 'Exit Intent Popup', 'notificationx' );
34 $this->module_title = __( 'Exit Intent Popup', 'notificationx' );
35 $this->themes = [
36 'theme-one' => [
37 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-one.png',
38 'defaults' => [
39 'exit_intent_title' => __( 'Wait! Before You Go……', 'notificationx' ),
40 'exit_intent_subtitle' => __( "We'd love to get your feedback and help us make this better for everyone.", 'notificationx' ),
41 'exit_intent_button_text' => __( 'SUBMIT', 'notificationx' ),
42 // 'exit_intent_show_name' => true,
43 // 'exit_intent_show_email' => true,
44 'exit_intent_name_label' => __( 'Name *', 'notificationx' ),
45 'exit_intent_email_label' => __( 'Enter Your Email *', 'notificationx' ),
46 // 'exit_intent_show_message' => false,
47 'exit_intent_message_placeholder' => __( 'Your message...', 'notificationx' ),
48 'position' => 'center',
49 ],
50 'column' => '5',
51 ],
52 'theme-four' => [
53 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-four.png',
54 'defaults' => [
55 'exit_intent_t4_badge' => __( 'Before you go...', 'notificationx' ),
56 'exit_intent_t4_title' => __( 'Watch this short demo video', 'notificationx' ),
57 'exit_intent_t4_subtitle' => __( 'See how our product simplifies your workflow.', 'notificationx' ),
58 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-four.jpg' ],
59 'exit_intent_t4_video_url' => '',
60 'position' => 'center',
61 ],
62 'column' => '5',
63 ],
64 'theme-three' => [
65 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-three.png',
66 'defaults' => [
67 'exit_intent_t3_title' => __( "Wait, don't go!", 'notificationx' ),
68 'exit_intent_t3_subtitle' => __( 'Before you leave, we have a special offer just for you!', 'notificationx' ),
69 'exit_intent_t3_offer' => __( 'Get 15% off your next purchase!', 'notificationx' ),
70 'exit_intent_t3_coupon_text' => __( "Use code STAY15 at checkout. Don't miss out on this limited-time offer.", 'notificationx' ),
71 'exit_intent_button_text' => __( 'Claim Offer', 'notificationx' ),
72 'exit_intent_dismiss_text' => __( 'No, thanks!', 'notificationx' ),
73 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-three.png' ],
74 'position' => 'center',
75 ],
76 'column' => '5',
77 ],
78 'theme-six' => [
79 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-seven.png',
80 'defaults' => [
81 'exit_intent_t6_title' => __( 'Limited Edition Bass Boost Headphones', 'notificationx' ),
82 // 'exit_intent_t6_show_timer' => true,
83 'exit_intent_t6_countdown_label' => __( 'Offer Ends In', 'notificationx' ),
84 'exit_intent_countdown_end' => '',
85 'exit_intent_t6_days_label' => __( 'DAYS', 'notificationx' ),
86 'exit_intent_t6_hours_label' => __( 'HOURS', 'notificationx' ),
87 'exit_intent_t6_minutes_label' => __( 'MIN', 'notificationx' ),
88 'exit_intent_t6_seconds_label' => __( 'SEC', 'notificationx' ),
89 'exit_intent_button_text' => __( 'Grab Now', 'notificationx' ),
90 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-six.png' ],
91 'position' => 'center',
92 ],
93 'column' => '5',
94 'is_pro' => true,
95 ],
96 'theme-two' => [
97 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-two.png',
98 'defaults' => [
99 'exit_intent_sale_badge' => __( 'Flash Sale', 'notificationx' ),
100 'exit_intent_sale_headline' => __( '50% OFF', 'notificationx' ),
101 'exit_intent_sale_desc' => __( 'ON ENTIRE ORDER', 'notificationx' ),
102 'exit_intent_button_text' => __( 'Shop The Flash Sale Now', 'notificationx' ),
103 'exit_intent_dismiss_text' => __( 'NO, THANKS!', 'notificationx' ),
104 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-two.jpg' ],
105 'position' => 'center',
106 ],
107 'column' => '5',
108 'is_pro' => true,
109 ],
110 'theme-seven' => [
111 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-six.png',
112 'defaults' => [
113 'exit_intent_t7_headline' => __( 'Turn Your House Into a Home', 'notificationx' ),
114 'exit_intent_t7_discount_text' => __( 'Your First Order Comes With a Surprise Deal!', 'notificationx' ),
115 'exit_intent_t7_description' => __( 'Handpicked decor that feels like home the moment it arrives.', 'notificationx' ),
116 'exit_intent_t7_email_placeholder' => __( 'Enter your email', 'notificationx' ),
117 'exit_intent_button_text' => __( 'SEND COUPON', 'notificationx' ),
118 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-five.png' ],
119 'position' => 'center',
120 ],
121 'column' => '5',
122 'is_pro' => true,
123 ],
124 'theme-five' => [
125 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/exit-intent/exit-intent-theme-five.png',
126 'defaults' => [
127 'exit_intent_t5_title' => __( 'Flash Sale', 'notificationx' ),
128 'exit_intent_t5_headline' => __( '50% OFF', 'notificationx' ),
129 'exit_intent_t5_desc' => __( 'ON ENTIRE ORDER', 'notificationx' ),
130 'exit_intent_t5_countdown_label' => __( 'LIMITED-TIME OFFER! SALE ENDS IN', 'notificationx' ),
131 'exit_intent_countdown_end' => '',
132 'exit_intent_t5_days_label' => __( 'DAYS', 'notificationx' ),
133 'exit_intent_t5_hours_label' => __( 'HRS', 'notificationx' ),
134 'exit_intent_t5_minutes_label' => __( 'MIN', 'notificationx' ),
135 'exit_intent_t5_seconds_label' => __( 'SEC', 'notificationx' ),
136 'exit_intent_t5_timer_bg' => '#fff0f5',
137 'exit_intent_t5_timer_color' => '#e91e63',
138 'exit_intent_button_text' => __( 'Shop The Flash Sale Now', 'notificationx' ),
139 'exit_intent_dismiss_text' => __( 'NO, THANKS!', 'notificationx' ),
140 'exit_intent_image_url' => [ 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-six.jpg' ],
141 'position' => 'center',
142 ],
143 'column' => '5',
144 'is_pro' => true,
145 ],
146 ];
147 }
148
149 public function init_fields() {
150 parent::init_fields();
151 add_filter( 'nx_content_fields', [ $this, 'content_fields' ], 999 );
152 add_filter( 'nx_design_tab_fields', [ $this, 'design_fields' ], 99 );
153 add_filter( 'nx_customize_fields', [ $this, 'customize_fields' ], 999 );
154 add_filter( 'nx_display_fields', [ $this, 'display_fields' ], 999 );
155 }
156
157 public function display_fields( $fields ) {
158 if ( isset( $fields['image-section'] ) ) {
159 $fields['image-section'] = Rules::is( 'source', $this->id, true, $fields['image-section'] );
160 }
161 return $fields;
162 }
163
164 public function content_fields( $fields ) {
165 // Hide standard content fields for this source
166 if ( isset( $fields['utm_options'] ) ) {
167 $fields['utm_options'] = Rules::is( 'source', $this->id, true, $fields['utm_options'] );
168 }
169 if ( isset( $fields['content'] ) ) {
170 $fields['content'] = Rules::is( 'source', $this->id, true, $fields['content'] );
171 }
172 if ( isset( $fields['link_options'] ) ) {
173 $fields['link_options'] = Rules::is( 'source', $this->id, true, $fields['link_options'] );
174 }
175
176 // ── Theme Two content fields ─────────────────────────────────────────────
177 $fields['exit_intent_theme_two_section'] = [
178 'label' => __( 'Exit Intent Content', 'notificationx' ),
179 'name' => 'exit_intent_theme_two_section',
180 'type' => 'section',
181 'priority' => 5,
182 'rules' => Rules::logicalRule( [
183 Rules::is( 'source', $this->id ),
184 Rules::is( 'themes', $this->id . '_theme-two' ),
185 ] ),
186 'fields' => [
187 [
188 'label' => __( 'Right Panel Image', 'notificationx' ),
189 'name' => 'exit_intent_image_url',
190 'type' => 'media',
191 'priority' => 5,
192 'default' => [
193 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-two-five-seven.jpg',
194 ],
195 'help' => __( 'Upload or select the image to display in the right panel.', 'notificationx' ),
196 ],
197 [
198 'label' => __( 'Sale Badge Text', 'notificationx' ),
199 'name' => 'exit_intent_sale_badge',
200 'type' => 'text',
201 'priority' => 10,
202 'default' => __( 'Flash Sale', 'notificationx' ),
203 ],
204 [
205 'label' => __( 'Sale Headline', 'notificationx' ),
206 'name' => 'exit_intent_sale_headline',
207 'type' => 'text',
208 'priority' => 20,
209 'default' => __( '50% OFF', 'notificationx' ),
210 ],
211 [
212 'label' => __( 'Sale Description', 'notificationx' ),
213 'name' => 'exit_intent_sale_desc',
214 'type' => 'text',
215 'priority' => 30,
216 'default' => __( 'ON ENTIRE ORDER', 'notificationx' ),
217 ],
218 [
219 'label' => __( 'Button Text', 'notificationx' ),
220 'name' => 'exit_intent_button_text',
221 'type' => 'text',
222 'priority' => 60,
223 'default' => __( 'Shop The Flash Sale Now', 'notificationx' ),
224 ],
225 [
226 'label' => __( 'Button URL', 'notificationx' ),
227 'name' => 'exit_intent_button_url',
228 'type' => 'text',
229 'priority' => 61,
230 'default' => '',
231 'help' => __( 'Where the CTA button sends visitors. Leave empty to just dismiss the popup.', 'notificationx' ),
232 ],
233 [
234 'label' => __( 'Open in New Tab', 'notificationx' ),
235 'name' => 'exit_intent_button_new_tab',
236 'type' => 'toggle',
237 'priority' => 62,
238 'default' => true,
239 ],
240 [
241 'label' => __( 'Dismiss Link Text', 'notificationx' ),
242 'name' => 'exit_intent_dismiss_text',
243 'type' => 'text',
244 'priority' => 70,
245 'default' => __( 'NO, THANKS!', 'notificationx' ),
246 ],
247 ],
248 ];
249
250 // ── Theme Three content fields ────────────────────────────────────────────
251 $fields['exit_intent_theme_three_section'] = [
252 'label' => __( 'Exit Intent Content', 'notificationx' ),
253 'name' => 'exit_intent_theme_three_section',
254 'type' => 'section',
255 'priority' => 5,
256 'rules' => Rules::logicalRule( [
257 Rules::is( 'source', $this->id ),
258 Rules::is( 'themes', $this->id . '_theme-three' ),
259 ] ),
260 'fields' => [
261 [
262 'label' => __( 'Character Image', 'notificationx' ),
263 'name' => 'exit_intent_image_url',
264 'type' => 'media',
265 'priority' => 5,
266 'default' => [
267 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-three.png',
268 ],
269 'help' => __( 'Upload or select a character/illustration image. It will appear above the popup card.', 'notificationx' ),
270 ],
271 [
272 'label' => __( 'Headline', 'notificationx' ),
273 'name' => 'exit_intent_t3_title',
274 'type' => 'text',
275 'priority' => 10,
276 'default' => __( "Wait, don't go!", 'notificationx' ),
277 ],
278 [
279 'label' => __( 'Subtitle', 'notificationx' ),
280 'name' => 'exit_intent_t3_subtitle',
281 'type' => 'text',
282 'priority' => 20,
283 'default' => __( 'Before you leave, we have a special offer just for you!', 'notificationx' ),
284 ],
285 [
286 'label' => __( 'Offer Text', 'notificationx' ),
287 'name' => 'exit_intent_t3_offer',
288 'type' => 'text',
289 'priority' => 30,
290 'default' => __( 'Get 15% off your next purchase!', 'notificationx' ),
291 ],
292 [
293 'label' => __( 'Coupon / Details Text', 'notificationx' ),
294 'name' => 'exit_intent_t3_coupon_text',
295 'type' => 'text',
296 'priority' => 40,
297 'default' => __( "Use code STAY15 at checkout. Don't miss out on this limited-time offer.", 'notificationx' ),
298 ],
299 [
300 'label' => __( 'Button Text', 'notificationx' ),
301 'name' => 'exit_intent_button_text',
302 'type' => 'text',
303 'priority' => 50,
304 'default' => __( 'Claim Offer', 'notificationx' ),
305 ],
306 [
307 'label' => __( 'Button URL', 'notificationx' ),
308 'name' => 'exit_intent_button_url',
309 'type' => 'text',
310 'priority' => 51,
311 'default' => '',
312 'help' => __( 'Where the CTA button sends visitors. Leave empty to just dismiss the popup.', 'notificationx' ),
313 ],
314 [
315 'label' => __( 'Open in New Tab', 'notificationx' ),
316 'name' => 'exit_intent_button_new_tab',
317 'type' => 'toggle',
318 'priority' => 52,
319 'default' => true,
320 ],
321 [
322 'label' => __( 'Dismiss Link Text', 'notificationx' ),
323 'name' => 'exit_intent_dismiss_text',
324 'type' => 'text',
325 'priority' => 60,
326 'default' => __( 'No, thanks!', 'notificationx' ),
327 ],
328 ],
329 ];
330
331 // ── Theme Four content fields ─────────────────────────────────────────────
332 $fields['exit_intent_theme_four_section'] = [
333 'label' => __( 'Exit Intent Content', 'notificationx' ),
334 'name' => 'exit_intent_theme_four_section',
335 'type' => 'section',
336 'priority' => 5,
337 'rules' => Rules::logicalRule( [
338 Rules::is( 'source', $this->id ),
339 Rules::is( 'themes', $this->id . '_theme-four' ),
340 ] ),
341 'fields' => [
342 [
343 'label' => __( 'Video Thumbnail', 'notificationx' ),
344 'name' => 'exit_intent_image_url',
345 'type' => 'media',
346 'priority' => 5,
347 'default' => [
348 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-four.jpg',
349 ],
350 'help' => __( 'Upload or select the video thumbnail/preview image.', 'notificationx' ),
351 ],
352 [
353 'label' => __( 'Badge Text', 'notificationx' ),
354 'name' => 'exit_intent_t4_badge',
355 'type' => 'text',
356 'priority' => 10,
357 'default' => __( 'Before you go...', 'notificationx' ),
358 ],
359 [
360 'label' => __( 'Headline', 'notificationx' ),
361 'name' => 'exit_intent_t4_title',
362 'type' => 'text',
363 'priority' => 20,
364 'default' => __( 'Watch this short demo video', 'notificationx' ),
365 ],
366 [
367 'label' => __( 'Subtitle', 'notificationx' ),
368 'name' => 'exit_intent_t4_subtitle',
369 'type' => 'text',
370 'priority' => 30,
371 'default' => __( 'See how our product simplifies your workflow.', 'notificationx' ),
372 ],
373 [
374 'label' => __( 'Video URL', 'notificationx' ),
375 'name' => 'exit_intent_t4_video_url',
376 'type' => 'text',
377 'priority' => 40,
378 'default' => '',
379 'placeholder' => 'https://www.youtube.com/watch?v=...',
380 'help' => __( 'Paste a YouTube, Vimeo, or other video platform URL.', 'notificationx' ),
381 ],
382 ],
383 ];
384
385 // ── Theme Five content fields ────────────────────────────────────────────
386 $fields['exit_intent_theme_five_section'] = [
387 'label' => __( 'Exit Intent Content', 'notificationx' ),
388 'name' => 'exit_intent_theme_five_section',
389 'type' => 'section',
390 'priority' => 5,
391 'rules' => Rules::logicalRule( [
392 Rules::is( 'source', $this->id ),
393 Rules::is( 'themes', $this->id . '_theme-five' ),
394 ] ),
395 'fields' => [
396 [
397 'label' => __( 'Right Panel Image', 'notificationx' ),
398 'name' => 'exit_intent_image_url',
399 'type' => 'media',
400 'priority' => 5,
401 'default' => [
402 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-two-five-seven.jpg',
403 ],
404 'help' => __( 'Upload or select the image to display in the right panel.', 'notificationx' ),
405 ],
406 [
407 'label' => __( 'Title', 'notificationx' ),
408 'name' => 'exit_intent_t5_title',
409 'type' => 'text',
410 'priority' => 10,
411 'default' => __( 'Flash Sale', 'notificationx' ),
412 ],
413 [
414 'label' => __( 'Headline', 'notificationx' ),
415 'name' => 'exit_intent_t5_headline',
416 'type' => 'text',
417 'priority' => 20,
418 'default' => __( '50% OFF', 'notificationx' ),
419 ],
420 [
421 'label' => __( 'Description', 'notificationx' ),
422 'name' => 'exit_intent_t5_desc',
423 'type' => 'text',
424 'priority' => 30,
425 'default' => __( 'ON ENTIRE ORDER', 'notificationx' ),
426 ],
427 [
428 'label' => __( 'Button Text', 'notificationx' ),
429 'name' => 'exit_intent_button_text',
430 'type' => 'text',
431 'priority' => 60,
432 'default' => __( 'Shop The Flash Sale Now', 'notificationx' ),
433 ],
434 [
435 'label' => __( 'Button URL', 'notificationx' ),
436 'name' => 'exit_intent_button_url',
437 'type' => 'text',
438 'priority' => 61,
439 'default' => '',
440 'help' => __( 'Where the CTA button sends visitors. Leave empty to just dismiss the popup.', 'notificationx' ),
441 ],
442 [
443 'label' => __( 'Open in New Tab', 'notificationx' ),
444 'name' => 'exit_intent_button_new_tab',
445 'type' => 'toggle',
446 'priority' => 62,
447 'default' => true,
448 ],
449 [
450 'label' => __( 'Dismiss Link Text', 'notificationx' ),
451 'name' => 'exit_intent_dismiss_text',
452 'type' => 'text',
453 'priority' => 70,
454 'default' => __( 'NO, THANKS!', 'notificationx' ),
455 ],
456 ],
457 ];
458
459 // ── Theme Five Timer Settings ────────────────────────────────────────────
460 $fields['exit_intent_theme_five_timer_section'] = [
461 'label' => __( 'Timer Settings', 'notificationx' ),
462 'name' => 'exit_intent_theme_five_timer_section',
463 'type' => 'section',
464 'priority' => 6,
465 'rules' => Rules::logicalRule( [
466 Rules::is( 'source', $this->id ),
467 Rules::is( 'themes', $this->id . '_theme-five' ),
468 ] ),
469 'fields' => [
470 [
471 'label' => __( 'Show Countdown Timer', 'notificationx' ),
472 'name' => 'exit_intent_t5_show_timer',
473 'type' => 'toggle',
474 'priority' => 5,
475 'default' => true,
476 ],
477 [
478 'label' => __( 'Countdown Label', 'notificationx' ),
479 'name' => 'exit_intent_t5_countdown_label',
480 'type' => 'text',
481 'priority' => 10,
482 'default' => __( 'LIMITED-TIME OFFER! SALE ENDS IN', 'notificationx' ),
483 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
484 ],
485 [
486 'label' => __( 'Sale End Date & Time', 'notificationx' ),
487 'name' => 'exit_intent_countdown_end',
488 'type' => 'date',
489 'priority' => 20,
490 'default' => '',
491 'help' => __( 'Pick the date and time when the sale ends. Leave empty to display static demo numbers.', 'notificationx' ),
492 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
493 ],
494 [
495 'label' => __( 'Days Label', 'notificationx' ),
496 'name' => 'exit_intent_t5_days_label',
497 'type' => 'text',
498 'priority' => 30,
499 'default' => __( 'DAYS', 'notificationx' ),
500 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
501 ],
502 [
503 'label' => __( 'Hours Label', 'notificationx' ),
504 'name' => 'exit_intent_t5_hours_label',
505 'type' => 'text',
506 'priority' => 40,
507 'default' => __( 'HRS', 'notificationx' ),
508 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
509 ],
510 [
511 'label' => __( 'Minutes Label', 'notificationx' ),
512 'name' => 'exit_intent_t5_minutes_label',
513 'type' => 'text',
514 'priority' => 50,
515 'default' => __( 'MIN', 'notificationx' ),
516 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
517 ],
518 [
519 'label' => __( 'Seconds Label', 'notificationx' ),
520 'name' => 'exit_intent_t5_seconds_label',
521 'type' => 'text',
522 'priority' => 60,
523 'default' => __( 'SEC', 'notificationx' ),
524 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
525 ],
526 [
527 'label' => __( 'Timer Box Background', 'notificationx' ),
528 'name' => 'exit_intent_t5_timer_bg',
529 'type' => 'colorpicker',
530 'priority' => 70,
531 'default' => '#fff0f5',
532 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
533 ],
534 [
535 'label' => __( 'Timer Number Color', 'notificationx' ),
536 'name' => 'exit_intent_t5_timer_color',
537 'type' => 'colorpicker',
538 'priority' => 80,
539 'default' => '#e91e63',
540 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ),
541 ],
542 ],
543 ];
544
545 // ── Theme Seven content fields ───────────────────────────────────────────
546 $fields['exit_intent_theme_seven_section'] = [
547 'label' => __( 'Exit Intent Content', 'notificationx' ),
548 'name' => 'exit_intent_theme_seven_section',
549 'type' => 'section',
550 'priority' => 5,
551 'rules' => Rules::logicalRule( [
552 Rules::is( 'source', $this->id ),
553 Rules::is( 'themes', $this->id . '_theme-seven' ),
554 ] ),
555 'fields' => [
556 [
557 'label' => __( 'Left Panel Image', 'notificationx' ),
558 'name' => 'exit_intent_image_url',
559 'type' => 'media',
560 'priority' => 5,
561 'default' => [
562 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-two-five-seven.jpg',
563 ],
564 'help' => __( 'Upload or select the image to display in the left panel.', 'notificationx' ),
565 ],
566 [
567 'label' => __( 'Headline', 'notificationx' ),
568 'name' => 'exit_intent_t7_headline',
569 'type' => 'text',
570 'priority' => 10,
571 'default' => __( 'Home Is Where Your Story Begins', 'notificationx' ),
572 ],
573 [
574 'label' => __( 'Discount Banner Text', 'notificationx' ),
575 'name' => 'exit_intent_t7_discount_text',
576 'type' => 'text',
577 'priority' => 20,
578 'default' => __( 'Get 15% Off Your First Order!', 'notificationx' ),
579 ],
580 [
581 'label' => __( 'Description', 'notificationx' ),
582 'name' => 'exit_intent_t7_description',
583 'type' => 'text',
584 'priority' => 30,
585 'default' => __( 'Discover timeless pieces that turn any space into a sanctuary.', 'notificationx' ),
586 ],
587 [
588 'label' => __( 'Email Placeholder', 'notificationx' ),
589 'name' => 'exit_intent_t7_email_placeholder',
590 'type' => 'text',
591 'priority' => 40,
592 'default' => __( 'Enter your email', 'notificationx' ),
593 ],
594 [
595 'label' => __( 'Button Text', 'notificationx' ),
596 'name' => 'exit_intent_button_text',
597 'type' => 'text',
598 'priority' => 50,
599 'default' => __( 'SEND COUPON', 'notificationx' ),
600 ],
601 ],
602 ];
603
604 // ── Theme Six content fields ─────────────────────────────────────────────
605 $fields['exit_intent_theme_six_section'] = [
606 'label' => __( 'Exit Intent Content', 'notificationx' ),
607 'name' => 'exit_intent_theme_six_section',
608 'type' => 'section',
609 'priority' => 5,
610 'rules' => Rules::logicalRule( [
611 Rules::is( 'source', $this->id ),
612 Rules::is( 'themes', $this->id . '_theme-six' ),
613 ] ),
614 'fields' => [
615 [
616 'label' => __( 'Product Image', 'notificationx' ),
617 'name' => 'exit_intent_image_url',
618 'type' => 'media',
619 'priority' => 5,
620 'default' => [
621 'url' => 'https://notificationx.com/wp-content/uploads/2026/05/exit-intend-theme-six.png',
622 ],
623 'help' => __( 'Upload or select the product image to display at the top of the popup.', 'notificationx' ),
624 ],
625 [
626 'label' => __( 'Headline', 'notificationx' ),
627 'name' => 'exit_intent_t6_title',
628 'type' => 'text',
629 'priority' => 10,
630 'default' => __( 'Limited Edition Bass Boost Headphones', 'notificationx' ),
631 ],
632 [
633 'label' => __( 'Button Text', 'notificationx' ),
634 'name' => 'exit_intent_button_text',
635 'type' => 'text',
636 'priority' => 60,
637 'default' => __( 'Grab Now', 'notificationx' ),
638 ],
639 [
640 'label' => __( 'Button URL', 'notificationx' ),
641 'name' => 'exit_intent_button_url',
642 'type' => 'text',
643 'priority' => 61,
644 'default' => '',
645 'help' => __( 'Where the CTA button sends visitors. Leave empty to just dismiss the popup.', 'notificationx' ),
646 ],
647 [
648 'label' => __( 'Open in New Tab', 'notificationx' ),
649 'name' => 'exit_intent_button_new_tab',
650 'type' => 'toggle',
651 'priority' => 62,
652 'default' => true,
653 ],
654 ],
655 ];
656
657 // ── Theme Six Timer Settings ─────────────────────────────────────────────
658 $fields['exit_intent_theme_six_timer_section'] = [
659 'label' => __( 'Timer Settings', 'notificationx' ),
660 'name' => 'exit_intent_theme_six_timer_section',
661 'type' => 'section',
662 'priority' => 6,
663 'rules' => Rules::logicalRule( [
664 Rules::is( 'source', $this->id ),
665 Rules::is( 'themes', $this->id . '_theme-six' ),
666 ] ),
667 'fields' => [
668 [
669 'label' => __( 'Show Countdown Timer', 'notificationx' ),
670 'name' => 'exit_intent_t6_show_timer',
671 'type' => 'toggle',
672 'priority' => 5,
673 'default' => true,
674 ],
675 [
676 'label' => __( 'Countdown Label', 'notificationx' ),
677 'name' => 'exit_intent_t6_countdown_label',
678 'type' => 'text',
679 'priority' => 10,
680 'default' => __( 'Offer Ends In', 'notificationx' ),
681 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
682 ],
683 [
684 'label' => __( 'Sale End Date & Time', 'notificationx' ),
685 'name' => 'exit_intent_countdown_end',
686 'type' => 'date',
687 'priority' => 20,
688 'default' => '',
689 'help' => __( 'Pick the date and time when the sale ends. Leave empty to display static demo numbers.', 'notificationx' ),
690 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
691 ],
692 [
693 'label' => __( 'Days Label', 'notificationx' ),
694 'name' => 'exit_intent_t6_days_label',
695 'type' => 'text',
696 'priority' => 30,
697 'default' => __( 'DAYS', 'notificationx' ),
698 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
699 ],
700 [
701 'label' => __( 'Hours Label', 'notificationx' ),
702 'name' => 'exit_intent_t6_hours_label',
703 'type' => 'text',
704 'priority' => 40,
705 'default' => __( 'HOURS', 'notificationx' ),
706 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
707 ],
708 [
709 'label' => __( 'Minutes Label', 'notificationx' ),
710 'name' => 'exit_intent_t6_minutes_label',
711 'type' => 'text',
712 'priority' => 50,
713 'default' => __( 'MIN', 'notificationx' ),
714 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
715 ],
716 [
717 'label' => __( 'Seconds Label', 'notificationx' ),
718 'name' => 'exit_intent_t6_seconds_label',
719 'type' => 'text',
720 'priority' => 60,
721 'default' => __( 'SEC', 'notificationx' ),
722 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ),
723 ],
724 ],
725 ];
726
727 // ── Theme One content fields ─────────────────────────────────────────────
728 $fields['exit_intent_content_section'] = [
729 'label' => __( 'Exit Intent Content', 'notificationx' ),
730 'name' => 'exit_intent_content_section',
731 'type' => 'section',
732 'priority' => 5,
733 'rules' => Rules::logicalRule( [
734 Rules::is( 'source', $this->id ),
735 Rules::is( 'themes', $this->id . '_theme-two', true ),
736 Rules::is( 'themes', $this->id . '_theme-three', true ),
737 Rules::is( 'themes', $this->id . '_theme-four', true ),
738 Rules::is( 'themes', $this->id . '_theme-five', true ),
739 Rules::is( 'themes', $this->id . '_theme-six', true ),
740 Rules::is( 'themes', $this->id . '_theme-seven', true ),
741 ] ),
742 'fields' => [
743 // ── Main copy ────────────────────────────────────────────
744 [
745 'label' => __( 'Title', 'notificationx' ),
746 'name' => 'exit_intent_title',
747 'type' => 'text',
748 'priority' => 10,
749 'default' => __( 'Wait! Before You Go...', 'notificationx' ),
750 ],
751 [
752 'label' => __( 'Subtitle', 'notificationx' ),
753 'name' => 'exit_intent_subtitle',
754 'type' => 'text',
755 'priority' => 20,
756 'default' => __( "We'd love to understand what's holding you back", 'notificationx' ),
757 ],
758 // ── Form fields ──────────────────────────────────────────
759 [
760 'label' => __( 'Show Name Field', 'notificationx' ),
761 'name' => 'exit_intent_show_name',
762 'type' => 'toggle',
763 'default' => true,
764 'priority' => 70,
765 'is_pro' => true,
766 ],
767 [
768 'label' => __( 'Name Placeholder', 'notificationx' ),
769 'name' => 'exit_intent_name_label',
770 'type' => 'text',
771 'default' => __( 'Name *', 'notificationx' ),
772 'priority' => 75,
773 'rules' => Rules::is( 'exit_intent_show_name', true ),
774 ],
775 [
776 'label' => __( 'Show Email Field', 'notificationx' ),
777 'name' => 'exit_intent_show_email',
778 'type' => 'toggle',
779 'default' => true,
780 'priority' => 80,
781 'is_pro' => true,
782 ],
783 [
784 'label' => __( 'Email Placeholder', 'notificationx' ),
785 'name' => 'exit_intent_email_label',
786 'type' => 'text',
787 'default' => __( 'Enter Your Email *', 'notificationx' ),
788 'priority' => 85,
789 'rules' => Rules::is( 'exit_intent_show_email', true ),
790 ],
791 [
792 'label' => __( 'Show Message Field', 'notificationx' ),
793 'name' => 'exit_intent_show_message',
794 'type' => 'toggle',
795 'default' => true,
796 'priority' => 87,
797 ],
798 [
799 'label' => __( 'Message Placeholder', 'notificationx' ),
800 'name' => 'exit_intent_message_placeholder',
801 'type' => 'text',
802 'default' => __( 'Your message...', 'notificationx' ),
803 'priority' => 88,
804 'rules' => Rules::is( 'exit_intent_show_message', true ),
805 ],
806
807 // ── Button ───────────────────────────────────────────────
808 [
809 'label' => __( 'Button Text', 'notificationx' ),
810 'name' => 'exit_intent_button_text',
811 'type' => 'text',
812 'default' => __( 'SUBMIT', 'notificationx' ),
813 'priority' => 90,
814 ],
815 ],
816 ];
817
818 return $fields;
819 }
820
821 public function design_fields( $fields ) {
822 // Hide the inner sub-sections of the global advance_design_section for this source,
823 // but keep advance_design_section itself visible so its `advance_edit` toggle renders.
824 foreach ( [ 'design', 'typography', 'image-appearance', 'link_button_design' ] as $key ) {
825 if ( isset( $fields['advance_design_section']['fields'][ $key ] ) ) {
826 $fields['advance_design_section']['fields'][ $key ] = Rules::is(
827 'source', $this->id, true, $fields['advance_design_section']['fields'][ $key ]
828 );
829 }
830 }
831
832 // Inline every theme's design fields directly into advance_design_section so they appear
833 // flat under the existing "Advanced Design" heading — no per-theme sub-headers.
834 // Priorities are auto-assigned starting at 20 so all theme controls sort BEFORE the
835 // global Custom CSS section (priority 150).
836 $design = &$fields['advance_design_section']['fields'];
837 $priority = 20;
838 $merge = function( $theme_slug, $list ) use ( &$design, &$priority ) {
839 $rule = $this->theme_design_rules( $theme_slug );
840 foreach ( $list as $field ) {
841 if ( ! empty( $field['rules'] ) ) {
842 $field['rules'] = Rules::logicalRule( [ $rule, $field['rules'] ] );
843 } else {
844 $field['rules'] = $rule;
845 }
846 if ( ! isset( $field['priority'] ) ) {
847 $field['priority'] = $priority;
848 }
849 $priority++;
850 $design[ $field['name'] ] = $field;
851 }
852 };
853
854 $merge( 'theme-one', $this->theme_one_design_fields() );
855 $merge( 'theme-two', $this->theme_two_design_fields() );
856 $merge( 'theme-three', $this->theme_three_design_fields() );
857 $merge( 'theme-four', $this->theme_four_design_fields() );
858 $merge( 'theme-five', $this->theme_five_design_fields() );
859 $merge( 'theme-six', $this->theme_six_design_fields() );
860 $merge( 'theme-seven', $this->theme_seven_design_fields() );
861
862 return $fields;
863 }
864
865 /** Build a rule scoped to source + advance_edit + a specific theme. */
866 private function theme_design_rules( $theme_slug ) {
867 return Rules::logicalRule( [
868 Rules::is( 'source', $this->id ),
869 Rules::is( 'advance_edit', true ),
870 Rules::is( 'themes', $this->id . '_' . $theme_slug ),
871 ] );
872 }
873
874 private function font_weight_options() {
875 return GlobalFields::get_instance()->normalize_fields( [
876 '400' => __( 'Normal (400)', 'notificationx' ),
877 '500' => __( 'Medium (500)', 'notificationx' ),
878 '600' => __( 'Semi Bold (600)', 'notificationx' ),
879 '700' => __( 'Bold (700)', 'notificationx' ),
880 '800' => __( 'Extra Bold (800)', 'notificationx' ),
881 ] );
882 }
883
884 /** ───────────────────────── Theme One — Feedback Form ───────────────────────── */
885 private function theme_one_design_fields() {
886 return [
887 // Container
888 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_max_width', 'type' => 'number', 'default' => 540, 'description' => 'px' ],
889 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_border_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
890 [ 'label' => __( 'Background Color', 'notificationx' ), 'name' => 'exit_intent_bg_color', 'type' => 'colorpicker', 'default' => '#EDE7FF' ],
891 [ 'label' => __( 'Overlay Background Color', 'notificationx' ),'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)',
892 'help' => __( 'Color of the backdrop behind the popup.', 'notificationx' ) ],
893 [ 'label' => __( 'Show Background Pattern', 'notificationx' ), 'name' => 'exit_intent_show_pattern', 'type' => 'toggle', 'default' => true ],
894 [ 'label' => __( 'Pattern Color', 'notificationx' ), 'name' => 'exit_intent_pattern_color', 'type' => 'colorpicker', 'default' => '#D4C3FF',
895 'rules' => Rules::is( 'exit_intent_show_pattern', true ) ],
896
897 // Title
898 [ 'label' => __( 'Title Color', 'notificationx' ), 'name' => 'exit_intent_title_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
899 [ 'label' => __( 'Title Font Size', 'notificationx' ), 'name' => 'exit_intent_title_font_size', 'type' => 'number', 'default' => 26, 'description' => 'px' ],
900 [ 'label' => __( 'Title Font Weight', 'notificationx' ), 'name' => 'exit_intent_title_font_weight', 'type' => 'select', 'default' => '700',
901 'options' => $this->font_weight_options() ],
902
903 // Subtitle
904 [ 'label' => __( 'Subtitle Color', 'notificationx' ), 'name' => 'exit_intent_subtitle_color', 'type' => 'colorpicker', 'default' => '#4a4a6a' ],
905 [ 'label' => __( 'Subtitle Font Size', 'notificationx' ), 'name' => 'exit_intent_subtitle_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
906
907 // Inputs
908 [ 'label' => __( 'Input Background Color', 'notificationx' ), 'name' => 'exit_intent_input_bg', 'type' => 'colorpicker', 'default' => '#ffffff' ],
909 [ 'label' => __( 'Input Border Color', 'notificationx' ), 'name' => 'exit_intent_input_border_color', 'type' => 'colorpicker', 'default' => '#dddddd' ],
910 [ 'label' => __( 'Input Border Radius', 'notificationx' ), 'name' => 'exit_intent_input_border_radius', 'type' => 'number', 'default' => 6, 'description' => 'px' ],
911 [ 'label' => __( 'Input Text Color', 'notificationx' ), 'name' => 'exit_intent_input_text_color', 'type' => 'colorpicker', 'default' => '#333333' ],
912
913 // Button
914 [ 'label' => __( 'Button Background Color', 'notificationx' ), 'name' => 'exit_intent_btn_bg', 'type' => 'colorpicker', 'default' => '#6B21A8' ],
915 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_btn_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
916 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_btn_border_radius', 'type' => 'number', 'default' => 6, 'description' => 'px' ],
917 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_btn_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
918 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_btn_font_weight', 'type' => 'select', 'default' => '700',
919 'options' => $this->font_weight_options() ],
920
921 // Close button
922 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#666666' ],
923 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
924 ];
925 }
926
927 /** ───────────────────────── Theme Two — Flash Sale w/ Countdown ───────────────────────── */
928 private function theme_two_design_fields() {
929 return [
930 // Container / overlay / close
931 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t2_max_width', 'type' => 'number', 'default' => 760, 'description' => 'px' ],
932 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t2_border_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
933 [ 'label' => __( 'Left Panel Background', 'notificationx' ), 'name' => 'exit_intent_t2_bg_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
934 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)' ],
935 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#666666' ],
936 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
937
938 // Sale badge
939 [ 'label' => __( 'Badge Background', 'notificationx' ), 'name' => 'exit_intent_t2_badge_bg', 'type' => 'colorpicker', 'default' => '#ffe4ec' ],
940 [ 'label' => __( 'Badge Text Color', 'notificationx' ),'name' => 'exit_intent_t2_badge_color', 'type' => 'colorpicker', 'default' => '#e91e63' ],
941 [ 'label' => __( 'Badge Font Size', 'notificationx' ), 'name' => 'exit_intent_t2_badge_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
942
943 // Headline
944 [ 'label' => __( 'Headline Color', 'notificationx' ), 'name' => 'exit_intent_t2_headline_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
945 [ 'label' => __( 'Headline Font Size', 'notificationx' ), 'name' => 'exit_intent_t2_headline_font_size', 'type' => 'number', 'default' => 56, 'description' => 'px' ],
946 [ 'label' => __( 'Headline Font Weight', 'notificationx' ), 'name' => 'exit_intent_t2_headline_font_weight', 'type' => 'select', 'default' => '800',
947 'options' => $this->font_weight_options() ],
948
949 // Description
950 [ 'label' => __( 'Description Color', 'notificationx' ), 'name' => 'exit_intent_t2_desc_color', 'type' => 'colorpicker', 'default' => '#4a4a6a' ],
951 [ 'label' => __( 'Description Font Size', 'notificationx' ), 'name' => 'exit_intent_t2_desc_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
952
953 // CTA button
954 [ 'label' => __( 'Button Background', 'notificationx' ), 'name' => 'exit_intent_t2_btn_bg', 'type' => 'colorpicker', 'default' => '#e91e63' ],
955 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_t2_btn_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
956 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_t2_btn_border_radius', 'type' => 'number', 'default' => 6, 'description' => 'px' ],
957 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_t2_btn_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
958 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_t2_btn_font_weight', 'type' => 'select', 'default' => '700',
959 'options' => $this->font_weight_options() ],
960
961 // Dismiss link
962 [ 'label' => __( 'Dismiss Text Color', 'notificationx' ), 'name' => 'exit_intent_t2_dismiss_color', 'type' => 'colorpicker', 'default' => '#9a9aa8' ],
963 [ 'label' => __( 'Dismiss Font Size', 'notificationx' ), 'name' => 'exit_intent_t2_dismiss_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
964 ];
965 }
966
967 /** ───────────────────────── Theme Three — Coupon Offer ───────────────────────── */
968 private function theme_three_design_fields() {
969 return [
970 // Container / overlay / close
971 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t3_max_width', 'type' => 'number', 'default' => 460, 'description' => 'px' ],
972 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t3_border_radius', 'type' => 'number', 'default' => 16, 'description' => 'px' ],
973 [ 'label' => __( 'Background Color', 'notificationx' ), 'name' => 'exit_intent_t3_bg_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
974 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)' ],
975 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#666666' ],
976 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
977
978 // Title
979 [ 'label' => __( 'Title Color', 'notificationx' ), 'name' => 'exit_intent_t3_title_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
980 [ 'label' => __( 'Title Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_title_font_size', 'type' => 'number', 'default' => 26, 'description' => 'px' ],
981 [ 'label' => __( 'Title Font Weight', 'notificationx' ), 'name' => 'exit_intent_t3_title_font_weight', 'type' => 'select', 'default' => '700',
982 'options' => $this->font_weight_options() ],
983
984 // Subtitle
985 [ 'label' => __( 'Subtitle Color', 'notificationx' ), 'name' => 'exit_intent_t3_subtitle_color', 'type' => 'colorpicker', 'default' => '#4a4a6a' ],
986 [ 'label' => __( 'Subtitle Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_subtitle_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
987
988 // Offer line
989 [ 'label' => __( 'Offer Color', 'notificationx' ), 'name' => 'exit_intent_t3_offer_color', 'type' => 'colorpicker', 'default' => '#e91e63' ],
990 [ 'label' => __( 'Offer Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_offer_font_size', 'type' => 'number', 'default' => 18, 'description' => 'px' ],
991 [ 'label' => __( 'Offer Font Weight', 'notificationx' ), 'name' => 'exit_intent_t3_offer_font_weight', 'type' => 'select', 'default' => '700',
992 'options' => $this->font_weight_options() ],
993
994 // Coupon block
995 [ 'label' => __( 'Coupon Block Background', 'notificationx' ), 'name' => 'exit_intent_t3_coupon_bg', 'type' => 'colorpicker', 'default' => '#fff7fb' ],
996 [ 'label' => __( 'Coupon Text Color', 'notificationx' ), 'name' => 'exit_intent_t3_coupon_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
997 [ 'label' => __( 'Coupon Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_coupon_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
998 [ 'label' => __( 'Coupon Block Border Radius', 'notificationx' ), 'name' => 'exit_intent_t3_coupon_border_radius', 'type' => 'number', 'default' => 8, 'description' => 'px' ],
999
1000 // CTA button
1001 [ 'label' => __( 'Button Background', 'notificationx' ), 'name' => 'exit_intent_t3_btn_bg', 'type' => 'colorpicker', 'default' => '#e91e63' ],
1002 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_t3_btn_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1003 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_t3_btn_border_radius', 'type' => 'number', 'default' => 6, 'description' => 'px' ],
1004 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_btn_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
1005 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_t3_btn_font_weight', 'type' => 'select', 'default' => '700',
1006 'options' => $this->font_weight_options() ],
1007
1008 // Dismiss link
1009 [ 'label' => __( 'Dismiss Text Color', 'notificationx' ), 'name' => 'exit_intent_t3_dismiss_color', 'type' => 'colorpicker', 'default' => '#9a9aa8' ],
1010 [ 'label' => __( 'Dismiss Font Size', 'notificationx' ), 'name' => 'exit_intent_t3_dismiss_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1011 ];
1012 }
1013
1014 /** ───────────────────────── Theme Four — Video Popup ───────────────────────── */
1015 private function theme_four_design_fields() {
1016 return [
1017 // Container / overlay / close
1018 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t4_max_width', 'type' => 'number', 'default' => 520, 'description' => 'px' ],
1019 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t4_border_radius', 'type' => 'number', 'default' => 16, 'description' => 'px' ],
1020 [ 'label' => __( 'Background Color', 'notificationx' ), 'name' => 'exit_intent_t4_bg_color', 'type' => 'colorpicker', 'default' => '#f4ecff' ],
1021 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)' ],
1022 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#666666' ],
1023 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
1024
1025 // Badge
1026 [ 'label' => __( 'Badge Background', 'notificationx' ), 'name' => 'exit_intent_t4_badge_bg', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1027 [ 'label' => __( 'Badge Text Color', 'notificationx' ),'name' => 'exit_intent_t4_badge_color', 'type' => 'colorpicker', 'default' => '#6B21A8' ],
1028 [ 'label' => __( 'Badge Font Size', 'notificationx' ), 'name' => 'exit_intent_t4_badge_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1029
1030 // Title
1031 [ 'label' => __( 'Title Color', 'notificationx' ), 'name' => 'exit_intent_t4_title_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
1032 [ 'label' => __( 'Title Font Size', 'notificationx' ), 'name' => 'exit_intent_t4_title_font_size', 'type' => 'number', 'default' => 24, 'description' => 'px' ],
1033 [ 'label' => __( 'Title Font Weight', 'notificationx' ), 'name' => 'exit_intent_t4_title_font_weight', 'type' => 'select', 'default' => '700',
1034 'options' => $this->font_weight_options() ],
1035
1036 // Subtitle
1037 [ 'label' => __( 'Subtitle Color', 'notificationx' ), 'name' => 'exit_intent_t4_subtitle_color', 'type' => 'colorpicker', 'default' => '#4a4a6a' ],
1038 [ 'label' => __( 'Subtitle Font Size', 'notificationx' ), 'name' => 'exit_intent_t4_subtitle_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
1039
1040 // Video wrap + play icon
1041 [ 'label' => __( 'Video Wrapper Background', 'notificationx' ), 'name' => 'exit_intent_t4_video_bg', 'type' => 'colorpicker', 'default' => '#000000' ],
1042 [ 'label' => __( 'Video Wrapper Border Radius', 'notificationx' ), 'name' => 'exit_intent_t4_video_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1043 [ 'label' => __( 'Play Icon Background', 'notificationx' ), 'name' => 'exit_intent_t4_play_bg', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1044 [ 'label' => __( 'Play Icon Color', 'notificationx' ), 'name' => 'exit_intent_t4_play_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
1045 ];
1046 }
1047
1048 /** ───────────────────────── Theme Five — Live Flash Sale ───────────────────────── */
1049 private function theme_five_design_fields() {
1050 return [
1051 // Container / overlay / close
1052 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t5_max_width', 'type' => 'number', 'default' => 900, 'description' => 'px' ],
1053 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t5_border_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1054 [ 'label' => __( 'Left Panel Background', 'notificationx' ), 'name' => 'exit_intent_t5_bg_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1055 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.6)' ],
1056 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#666666' ],
1057 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
1058
1059 // Title
1060 [ 'label' => __( 'Title Color', 'notificationx' ), 'name' => 'exit_intent_t5_title_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
1061 [ 'label' => __( 'Title Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_title_font_size', 'type' => 'number', 'default' => 18, 'description' => 'px' ],
1062 [ 'label' => __( 'Title Font Weight', 'notificationx' ), 'name' => 'exit_intent_t5_title_font_weight', 'type' => 'select', 'default' => '700',
1063 'options' => $this->font_weight_options() ],
1064
1065 // Headline
1066 [ 'label' => __( 'Headline Color', 'notificationx' ), 'name' => 'exit_intent_t5_headline_color', 'type' => 'colorpicker', 'default' => '#1a1a2e' ],
1067 [ 'label' => __( 'Headline Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_headline_font_size', 'type' => 'number', 'default' => 56, 'description' => 'px' ],
1068 [ 'label' => __( 'Headline Font Weight', 'notificationx' ), 'name' => 'exit_intent_t5_headline_font_weight', 'type' => 'select', 'default' => '800',
1069 'options' => $this->font_weight_options() ],
1070
1071 // Description
1072 [ 'label' => __( 'Description Color', 'notificationx' ), 'name' => 'exit_intent_t5_desc_color', 'type' => 'colorpicker', 'default' => '#4a4a6a' ],
1073 [ 'label' => __( 'Description Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_desc_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
1074
1075 // Countdown label + numbers + unit labels
1076 [ 'label' => __( 'Countdown Label Color', 'notificationx' ), 'name' => 'exit_intent_t5_cd_label_color', 'type' => 'colorpicker', 'default' => '#1a1a2e',
1077 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1078 [ 'label' => __( 'Countdown Label Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_cd_label_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px',
1079 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1080 [ 'label' => __( 'Countdown Number Background', 'notificationx' ), 'name' => 'exit_intent_t5_cd_num_bg', 'type' => 'colorpicker', 'default' => '#fff0f5',
1081 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1082 [ 'label' => __( 'Countdown Number Color', 'notificationx' ), 'name' => 'exit_intent_t5_cd_num_color', 'type' => 'colorpicker', 'default' => '#e91e63',
1083 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1084 [ 'label' => __( 'Countdown Number Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_cd_num_font_size', 'type' => 'number', 'default' => 22, 'description' => 'px',
1085 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1086 [ 'label' => __( 'Countdown Number Border Radius', 'notificationx' ),'name' => 'exit_intent_t5_cd_num_radius', 'type' => 'number', 'default' => 6, 'description' => 'px',
1087 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1088 [ 'label' => __( 'Countdown Unit Label Color', 'notificationx' ), 'name' => 'exit_intent_t5_cd_unit_color', 'type' => 'colorpicker', 'default' => '#4a4a6a',
1089 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1090 [ 'label' => __( 'Countdown Unit Label Font Size', 'notificationx' ),'name' => 'exit_intent_t5_cd_unit_font_size', 'type' => 'number', 'default' => 11, 'description' => 'px',
1091 'rules' => Rules::is( 'exit_intent_t5_show_timer', true ) ],
1092
1093 // CTA button
1094 [ 'label' => __( 'Button Background', 'notificationx' ), 'name' => 'exit_intent_t5_btn_bg', 'type' => 'colorpicker', 'default' => '#e91e63' ],
1095 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_t5_btn_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1096 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_t5_btn_border_radius', 'type' => 'number', 'default' => 6, 'description' => 'px' ],
1097 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_btn_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
1098 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_t5_btn_font_weight', 'type' => 'select', 'default' => '700',
1099 'options' => $this->font_weight_options() ],
1100
1101 // Dismiss link
1102 [ 'label' => __( 'Dismiss Text Color', 'notificationx' ), 'name' => 'exit_intent_t5_dismiss_color', 'type' => 'colorpicker', 'default' => '#9a9aa8' ],
1103 [ 'label' => __( 'Dismiss Font Size', 'notificationx' ), 'name' => 'exit_intent_t5_dismiss_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1104 ];
1105 }
1106
1107 /** ───────────────────────── Theme Six — Product Countdown ───────────────────────── */
1108 private function theme_six_design_fields() {
1109 return [
1110 // Container / overlay / close
1111 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t6_max_width', 'type' => 'number', 'default' => 600, 'description' => 'px' ],
1112 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t6_border_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1113 [ 'label' => __( 'Background Start Color', 'notificationx' ), 'name' => 'exit_intent_t6_bg_start', 'type' => 'colorpicker', 'default' => '#ffffff',
1114 'help' => __( 'Center color of the radial background gradient.', 'notificationx' ) ],
1115 [ 'label' => __( 'Background Mid Color', 'notificationx' ), 'name' => 'exit_intent_t6_bg_mid', 'type' => 'colorpicker', 'default' => '#fdf2f8' ],
1116 [ 'label' => __( 'Background End Color', 'notificationx' ), 'name' => 'exit_intent_t6_bg_end', 'type' => 'colorpicker', 'default' => '#f5f3ff',
1117 'help' => __( 'Outer color of the radial background gradient.', 'notificationx' ) ],
1118 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)' ],
1119 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#1f2937' ],
1120 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 20, 'description' => 'px' ],
1121
1122 // Title
1123 [ 'label' => __( 'Title Color', 'notificationx' ), 'name' => 'exit_intent_t6_title_color', 'type' => 'colorpicker', 'default' => '#1f2937' ],
1124 [ 'label' => __( 'Title Font Size', 'notificationx' ), 'name' => 'exit_intent_t6_title_font_size', 'type' => 'number', 'default' => 36, 'description' => 'px' ],
1125 [ 'label' => __( 'Title Font Weight', 'notificationx' ), 'name' => 'exit_intent_t6_title_font_weight', 'type' => 'select', 'default' => '700',
1126 'options' => $this->font_weight_options() ],
1127
1128 // Countdown label + numbers + unit labels
1129 [ 'label' => __( 'Countdown Label Color', 'notificationx' ), 'name' => 'exit_intent_t6_cd_label_color', 'type' => 'colorpicker', 'default' => '#4b5563',
1130 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1131 [ 'label' => __( 'Countdown Label Font Size', 'notificationx' ), 'name' => 'exit_intent_t6_cd_label_font_size', 'type' => 'number', 'default' => 18, 'description' => 'px',
1132 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1133 [ 'label' => __( 'Countdown Number Background', 'notificationx' ), 'name' => 'exit_intent_t6_cd_num_bg', 'type' => 'colorpicker', 'default' => '#f3e8f2',
1134 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1135 [ 'label' => __( 'Countdown Number Color', 'notificationx' ), 'name' => 'exit_intent_t6_cd_num_color', 'type' => 'colorpicker', 'default' => '#374151',
1136 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1137 [ 'label' => __( 'Countdown Number Font Size', 'notificationx' ), 'name' => 'exit_intent_t6_cd_num_font_size', 'type' => 'number', 'default' => 24, 'description' => 'px',
1138 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1139 [ 'label' => __( 'Countdown Number Border Radius', 'notificationx' ),'name' => 'exit_intent_t6_cd_num_radius', 'type' => 'number', 'default' => 2, 'description' => 'px',
1140 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1141 [ 'label' => __( 'Countdown Unit Label Color', 'notificationx' ), 'name' => 'exit_intent_t6_cd_unit_color', 'type' => 'colorpicker', 'default' => '#9f1239',
1142 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1143 [ 'label' => __( 'Countdown Unit Label Font Size', 'notificationx' ),'name' => 'exit_intent_t6_cd_unit_font_size', 'type' => 'number', 'default' => 12, 'description' => 'px',
1144 'rules' => Rules::is( 'exit_intent_t6_show_timer', true ) ],
1145
1146 // CTA button
1147 [ 'label' => __( 'Button Background', 'notificationx' ), 'name' => 'exit_intent_t6_btn_bg', 'type' => 'colorpicker', 'default' => '#845e7c' ],
1148 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_t6_btn_color', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1149 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_t6_btn_border_radius', 'type' => 'number', 'default' => 4, 'description' => 'px' ],
1150 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_t6_btn_font_size', 'type' => 'number', 'default' => 24, 'description' => 'px' ],
1151 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_t6_btn_font_weight', 'type' => 'select', 'default' => '700',
1152 'options' => $this->font_weight_options() ],
1153 ];
1154 }
1155
1156 /** ───────────────────────── Theme Seven — Lead Capture w/ Image ───────────────────────── */
1157 private function theme_seven_design_fields() {
1158 $font_family_options = GlobalFields::get_instance()->normalize_fields( [
1159 'inherit' => __( 'Default (inherit)', 'notificationx' ),
1160 "'Playfair Display', Georgia, serif" => __( 'Playfair Display (serif)', 'notificationx' ),
1161 "Georgia, 'Times New Roman', serif" => __( 'Georgia (serif)', 'notificationx' ),
1162 "'Times New Roman', Times, serif" => __( 'Times New Roman (serif)', 'notificationx' ),
1163 "Inter, 'Helvetica Neue', Arial, sans-serif" => __( 'Inter (sans-serif)', 'notificationx' ),
1164 "'Helvetica Neue', Helvetica, Arial, sans-serif" => __( 'Helvetica (sans-serif)', 'notificationx' ),
1165 ] );
1166
1167 return [
1168 // Container / overlay / close
1169 [ 'label' => __( 'Popup Max Width', 'notificationx' ), 'name' => 'exit_intent_t7_max_width', 'type' => 'number', 'default' => 750, 'description' => 'px' ],
1170 [ 'label' => __( 'Border Radius', 'notificationx' ), 'name' => 'exit_intent_t7_border_radius', 'type' => 'number', 'default' => 12, 'description' => 'px' ],
1171 [ 'label' => __( 'Background Color', 'notificationx' ), 'name' => 'exit_intent_t7_bg_color', 'type' => 'colorpicker', 'default' => '#413532',
1172 'help' => __( 'Right (content) panel background.', 'notificationx' ) ],
1173 [ 'label' => __( 'Image Panel Background', 'notificationx' ), 'name' => 'exit_intent_t7_image_bg', 'type' => 'colorpicker', 'default' => '#534542',
1174 'help' => __( 'Shown behind the image (visible only if the image leaves transparent areas or fails to load).', 'notificationx' ) ],
1175 [ 'label' => __( 'Overlay Background Color', 'notificationx' ), 'name' => 'exit_intent_overlay_color', 'type' => 'colorpicker', 'default' => 'rgba(0,0,0,0.5)' ],
1176 [ 'label' => __( 'Close Button Color', 'notificationx' ), 'name' => 'exit_intent_close_color', 'type' => 'colorpicker', 'default' => '#f3d5a2' ],
1177 [ 'label' => __( 'Close Button Size', 'notificationx' ), 'name' => 'exit_intent_close_size', 'type' => 'number', 'default' => 22, 'description' => 'px' ],
1178
1179 // Headline
1180 [ 'label' => __( 'Headline Color', 'notificationx' ), 'name' => 'exit_intent_t7_headline_color', 'type' => 'colorpicker', 'default' => '#f3d5a2' ],
1181 [ 'label' => __( 'Headline Font Size', 'notificationx' ), 'name' => 'exit_intent_t7_headline_font_size', 'type' => 'number', 'default' => 30, 'description' => 'px' ],
1182 [ 'label' => __( 'Headline Font Weight', 'notificationx' ), 'name' => 'exit_intent_t7_headline_font_weight', 'type' => 'select', 'default' => '700',
1183 'options' => $this->font_weight_options() ],
1184 [ 'label' => __( 'Headline Font Family', 'notificationx' ), 'name' => 'exit_intent_t7_headline_font_family', 'type' => 'select', 'default' => "'Playfair Display', Georgia, serif",
1185 'options' => $font_family_options ],
1186
1187 // Discount banner
1188 [ 'label' => __( 'Discount Banner Background', 'notificationx' ), 'name' => 'exit_intent_t7_discount_bg', 'type' => 'colorpicker', 'default' => 'rgba(255,255,255,0.1)' ],
1189 [ 'label' => __( 'Discount Banner Border Color', 'notificationx' ), 'name' => 'exit_intent_t7_discount_border', 'type' => 'colorpicker', 'default' => 'rgba(255,255,255,0.05)' ],
1190 [ 'label' => __( 'Discount Banner Text Color', 'notificationx' ), 'name' => 'exit_intent_t7_discount_color', 'type' => 'colorpicker', 'default' => '#f3d5a2' ],
1191 [ 'label' => __( 'Discount Banner Font Size', 'notificationx' ), 'name' => 'exit_intent_t7_discount_font_size', 'type' => 'number', 'default' => 16, 'description' => 'px' ],
1192 [ 'label' => __( 'Discount Banner Border Radius', 'notificationx' ), 'name' => 'exit_intent_t7_discount_radius', 'type' => 'number', 'default' => 2, 'description' => 'px' ],
1193
1194 // Description
1195 [ 'label' => __( 'Description Color', 'notificationx' ), 'name' => 'exit_intent_t7_desc_color', 'type' => 'colorpicker', 'default' => 'rgba(243,213,162,0.9)' ],
1196 [ 'label' => __( 'Description Font Size', 'notificationx' ), 'name' => 'exit_intent_t7_desc_font_size', 'type' => 'number', 'default' => 16, 'description' => 'px' ],
1197
1198 // Email input
1199 [ 'label' => __( 'Input Background Color', 'notificationx' ), 'name' => 'exit_intent_t7_input_bg', 'type' => 'colorpicker', 'default' => '#ffffff' ],
1200 [ 'label' => __( 'Input Border Color', 'notificationx' ), 'name' => 'exit_intent_t7_input_border_color', 'type' => 'colorpicker', 'default' => '#6b7280' ],
1201 [ 'label' => __( 'Input Border Radius', 'notificationx' ), 'name' => 'exit_intent_t7_input_border_radius','type' => 'number', 'default' => 0, 'description' => 'px' ],
1202 [ 'label' => __( 'Input Text Color', 'notificationx' ), 'name' => 'exit_intent_t7_input_text_color', 'type' => 'colorpicker', 'default' => '#1f2937' ],
1203
1204 // CTA button
1205 [ 'label' => __( 'Button Background', 'notificationx' ), 'name' => 'exit_intent_t7_btn_bg', 'type' => 'colorpicker', 'default' => '#f3d5a2' ],
1206 [ 'label' => __( 'Button Text Color', 'notificationx' ), 'name' => 'exit_intent_t7_btn_color', 'type' => 'colorpicker', 'default' => '#4d3e3e' ],
1207 [ 'label' => __( 'Button Border Radius', 'notificationx' ), 'name' => 'exit_intent_t7_btn_border_radius', 'type' => 'number', 'default' => 0, 'description' => 'px' ],
1208 [ 'label' => __( 'Button Font Size', 'notificationx' ), 'name' => 'exit_intent_t7_btn_font_size', 'type' => 'number', 'default' => 14, 'description' => 'px' ],
1209 [ 'label' => __( 'Button Font Weight', 'notificationx' ), 'name' => 'exit_intent_t7_btn_font_weight', 'type' => 'select', 'default' => '700',
1210 'options' => $this->font_weight_options() ],
1211 ];
1212 }
1213
1214 public function customize_fields( $fields ) {
1215 // Hide standard timing/behaviour irrelevant to exit intent
1216 foreach ( [ 'timing', 'behaviour', 'sound_section', 'queue_management', 'appearance', 'animation' ] as $key ) {
1217 if ( isset( $fields[ $key ] ) ) {
1218 $fields[ $key ] = Rules::is( 'source', $this->id, true, $fields[ $key ] );
1219 }
1220 }
1221
1222 // Add center position option
1223 if ( isset( $fields['appearance']['fields']['position']['options'] ) ) {
1224 $fields['appearance']['fields']['position']['options']['center'] = [
1225 'label' => __( 'Center', 'notificationx' ),
1226 'value' => 'center',
1227 'rules' => Rules::is( 'source', $this->id ),
1228 ];
1229 }
1230
1231 $fields['exit_intent_settings'] = [
1232 'label' => __( 'Exit Intent Settings', 'notificationx' ),
1233 'name' => 'exit_intent_settings',
1234 'type' => 'section',
1235 'priority' => 15,
1236 'rules' => Rules::is( 'source', $this->id ),
1237 'fields' => [
1238 'show_close_button' => [
1239 'label' => __( 'Show Close Button', 'notificationx' ),
1240 'name' => 'show_close_button',
1241 'type' => 'toggle',
1242 'default' => true,
1243 ],
1244 'exit_intent_position' => [
1245 'label' => __( 'Position', 'notificationx' ),
1246 'name' => 'exit_intent_position',
1247 'type' => 'select',
1248 'default' => 'center',
1249 'options' => GlobalFields::get_instance()->normalize_fields( [
1250 'center' => __( 'Center', 'notificationx' ),
1251 'bottom-left' => __( 'Bottom Left', 'notificationx' ),
1252 'bottom-right' => __( 'Bottom Right', 'notificationx' ),
1253 ] ),
1254 ],
1255 'exit_intent_sensitivity' => [
1256 'label' => __( 'Trigger Sensitivity', 'notificationx' ),
1257 'name' => 'exit_intent_sensitivity',
1258 'type' => 'select',
1259 'default' => '20',
1260 'help' => __( 'Distance from top of viewport (px) that triggers the popup.', 'notificationx' ),
1261 'options' => GlobalFields::get_instance()->normalize_fields( [
1262 '10' => __( 'High (10px)', 'notificationx' ),
1263 '20' => __( 'Medium (20px)', 'notificationx' ),
1264 '50' => __( 'Low (50px)', 'notificationx' ),
1265 ] ),
1266 ],
1267 'exit_intent_cookie_days' => [
1268 'label' => __( 'Do Not Show Again For', 'notificationx' ),
1269 'name' => 'exit_intent_cookie_days',
1270 'type' => 'number',
1271 'default' => 7,
1272 'description' => __( 'days', 'notificationx' ),
1273 'help' => __( 'Once dismissed, hide the popup for this many days.', 'notificationx' ),
1274 ],
1275 'exit_intent_mobile_disable' => [
1276 'label' => __( 'Disable on Mobile', 'notificationx' ),
1277 'name' => 'exit_intent_mobile_disable',
1278 'type' => 'toggle',
1279 'default' => true,
1280 'help' => __( 'Exit intent detection is unreliable on touch devices.', 'notificationx' ),
1281 ],
1282 ],
1283 ];
1284
1285 return $fields;
1286 }
1287
1288 public function doc() {
1289 return sprintf(__('
1290 <p>Show a targeted message at the exact moment someone is about to close your tab & bring them back into the funnel. Need help? Check out our <a target="_blank" href="%1$s">documentation</a>.</p>',
1291 'notificationx'),
1292 'https://notificationx.com/docs/how-to-configure-exit-intent-popup/',
1293 );
1294 }
1295 }
1296