PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev1
Elementor Website Builder – more than just a page builder v3.28.0-dev1
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / floating-buttons / base / widget-contact-button-base.php

widget-contact-button-base.php in Elementor Website Builder – more than just a page builder 3.28.0-dev1, at modules/floating-buttons/base/widget-contact-button-base.php

3,131 lines 83.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\FloatingButtons\Base;
4
5 use Elementor\Controls_Manager;
6 use Elementor\Core\Base\Providers\Social_Network_Provider;
7 use Elementor\Core\Base\Traits\Shared_Widget_Controls_Trait;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Modules\FloatingButtons\Classes\Render\Contact_Buttons_Core_Render;
11 use Elementor\Modules\FloatingButtons\Documents\Floating_Buttons;
12 use Elementor\Plugin;
13 use Elementor\Repeater;
14 use Elementor\Utils;
15 use Elementor\Widget_Base;
16
17 abstract class Widget_Contact_Button_Base extends Widget_Base {
18
19 use Shared_Widget_Controls_Trait;
20
21 const TAB_ADVANCED = 'advanced-tab-floating-buttons';
22
23 public function show_in_panel(): bool {
24 return false;
25 }
26
27 public function get_group_name(): string {
28 return 'floating-buttons';
29 }
30
31 public function get_style_depends(): array {
32 $widget_name = $this->get_name();
33
34 $style_depends = Plugin::$instance->experiments->is_feature_active( 'e_font_icon_svg' )
35 ? parent::get_style_depends()
36 : [ 'elementor-icons-fa-solid', 'elementor-icons-fa-brands', 'elementor-icons-fa-regular' ];
37
38 $style_depends[] = 'widget-contact-buttons-base';
39
40 if ( 'contact-buttons' !== $widget_name ) {
41 $style_depends[] = "widget-{$widget_name}";
42 }
43
44 return $style_depends;
45 }
46
47 public function has_widget_inner_wrapper(): bool {
48 return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
49 }
50
51 public function hide_on_search(): bool {
52 return true;
53 }
54
55 protected function get_initial_config(): array {
56 return array_merge( parent::get_initial_config(), [
57 'commonMerged' => true,
58 ] );
59 }
60
61 public static function get_configuration() {
62 return [
63 'content' => [
64 'chat_button_section' => [
65 'section_name' => esc_html__( 'Chat Button', 'elementor' ),
66 'has_platform' => true,
67 'has_icon' => false,
68 'icon_default' => [
69 'value' => 'far fa-comment-dots',
70 'library' => 'fa-regular',
71 ],
72 'icons_recommended' => [
73 'fa-regular' => [
74 'comment',
75 'comment-dots',
76 'comment-alt',
77 ],
78 'fa-solid' => [
79 'ellipsis-v',
80 ],
81 ],
82 'has_notification_dot' => true,
83 'has_notification_dot_default_enabled' => true,
84 'has_active_tab' => false,
85 'has_display_text' => false,
86 'display_text_label' => esc_html__( 'Call now', 'elementor' ),
87 'has_display_text_select' => true,
88 'platform' => [
89 'group' => [
90 Social_Network_Provider::EMAIL,
91 Social_Network_Provider::SMS,
92 Social_Network_Provider::WHATSAPP,
93 Social_Network_Provider::SKYPE,
94 Social_Network_Provider::MESSENGER,
95 Social_Network_Provider::VIBER,
96 ],
97 'default' => Social_Network_Provider::WHATSAPP,
98 ],
99 'chat_aria_label' => Floating_Buttons::get_title(),
100 'defaults' => [
101 'mail' => null,
102 'mail_subject' => null,
103 'mail_body' => null,
104 'number' => null,
105 'username' => null,
106 'location' => [
107 'is_external' => true,
108 ],
109 'url' => [
110 'is_external' => true,
111 ],
112 ],
113 'has_accessible_name' => true,
114 ],
115 'top_bar_section' => [
116 'section_name' => esc_html__( 'Top Bar', 'elementor' ),
117 'has_image' => true,
118 'has_active_dot' => true,
119 'has_subtitle' => true,
120 'title' => [
121 'label' => esc_html__( 'Name', 'elementor' ),
122 'default' => esc_html__( 'Rob Jones', 'elementor' ),
123 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
124 'dynamic' => false,
125 'ai' => false,
126 'label_block' => false,
127 ],
128 'subtitle' => [
129 'label' => esc_html__( 'Title', 'elementor' ),
130 'default' => esc_html__( 'Store Manager', 'elementor' ),
131 'placeholder' => esc_html__( 'Type your title here', 'elementor' ),
132 'dynamic' => false,
133 'ai' => false,
134 'label_block' => false,
135 ],
136 ],
137 'message_bubble_section' => [
138 'has_typing_animation' => true,
139 ],
140 'contact_section' => [
141 'section_name' => esc_html__( 'Contact Buttons', 'elementor' ),
142 'has_cta_text' => true,
143 'repeater' => [
144 'has_tooltip' => false,
145 'tooltip_label' => esc_html__( 'Text', 'elementor' ),
146 'tooltip_default' => esc_html__( 'Tooltip', 'elementor' ),
147 'tooltip_placeholder' => esc_html__( 'Enter icon text', 'elementor' ),
148 'has_title' => false,
149 'has_description' => false,
150 ],
151 'platform' => [
152 'group-1' => [
153 Social_Network_Provider::EMAIL,
154 Social_Network_Provider::SMS,
155 Social_Network_Provider::WHATSAPP,
156 Social_Network_Provider::SKYPE,
157 Social_Network_Provider::MESSENGER,
158 Social_Network_Provider::VIBER,
159 ],
160 'limit' => 5,
161 'min_items' => 0,
162 ],
163 'default' => [
164 [
165 'contact_icon_platform' => Social_Network_Provider::WHATSAPP,
166 ],
167 [
168 'contact_icon_platform' => Social_Network_Provider::EMAIL,
169 ],
170 [
171 'contact_icon_platform' => Social_Network_Provider::SMS,
172 ],
173 [
174 'contact_icon_platform' => Social_Network_Provider::VIBER,
175 ],
176 [
177 'contact_icon_platform' => Social_Network_Provider::MESSENGER,
178 ],
179 ],
180 'has_accessible_name' => true,
181 ],
182 'send_button_section' => [
183 'section_name' => esc_html__( 'Send Button', 'elementor' ),
184 'has_link' => false,
185 'text' => [
186 'default' => esc_html__( 'Click to start chat', 'elementor' ),
187 ],
188 ],
189 ],
190 'style' => [
191 'has_platform_colors' => true,
192 'chat_button_section' => [
193 'has_entrance_animation' => true,
194 'has_box_shadow' => true,
195 'has_drop_shadow' => false,
196 'has_padding' => false,
197 'has_button_size' => true,
198 'button_size_default' => 'small',
199 'has_typography' => false,
200 'has_icon_position' => false,
201 'has_icon_spacing' => false,
202 'has_tabs' => true,
203 'has_platform_color_controls' => false,
204 'hover_animation_type' => 'default',
205 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
206 ],
207 'top_bar_section' => [
208 'has_title_heading' => true,
209 'title_heading_label' => esc_html__( 'Name', 'elementor' ),
210 'subtitle_heading_label' => esc_html__( 'Title', 'elementor' ),
211 'has_style_close_button' => true,
212 'has_close_button_heading' => false,
213 'has_background' => true,
214 'has_background_heading' => false,
215 ],
216 'message_bubble_section' => [
217 'has_chat_background' => true,
218 ],
219 'contact_section' => [
220 'has_buttons_heading' => true,
221 'buttons_heading_label' => esc_html__( 'Buttons', 'elementor' ),
222 'has_buttons_size' => true,
223 'has_box_shadow' => false,
224 'has_buttons_spacing' => false,
225 'has_hover_animation' => true,
226 'has_chat_box_animation' => false,
227 'has_icon_bg_color' => true,
228 'has_button_bar' => false,
229 'has_tabs' => true,
230 'has_text_color' => false,
231 'has_bg_color' => false,
232 'has_padding' => false,
233 'has_button_corners' => false,
234 'has_typography' => false,
235 'icon_color_label' => esc_html__( 'Icon Color', 'elementor' ),
236 'has_hover_transition_duration' => false,
237 ],
238 'send_button_section' => [
239 'has_platform_colors' => true,
240 'has_icon_color' => true,
241 'has_background_color' => true,
242 'has_text_color' => false,
243 'has_typography' => true,
244 'typography_selector' => '{{WRAPPER}} .e-contact-buttons__send-cta',
245 ],
246 'chat_box_section' => [
247 'section_name' => esc_html__( 'Chat Box', 'elementor' ),
248 'has_width' => true,
249 'has_padding' => false,
250 ],
251 ],
252 'advanced' => [
253 'has_layout_position' => true,
254 'horizontal_position_default' => 'end',
255 'has_mobile_full_width' => false,
256 'has_vertical_offset' => true,
257 'has_horizontal_offset' => true,
258 ],
259 ];
260 }
261
262 public function get_icon(): string {
263 return 'eicon-commenting-o';
264 }
265
266 public function get_categories(): array {
267 return [ 'general' ];
268 }
269
270 protected function register_controls(): void {
271
272 $this->add_content_tab();
273
274 $this->add_style_tab();
275
276 $this->add_advanced_tab();
277 }
278
279 private function social_media_controls(): void {
280 $config = static::get_configuration();
281
282 $this->add_control(
283 'chat_button_mail',
284 [
285 'label' => esc_html__( 'Email', 'elementor' ),
286 'type' => Controls_Manager::TEXT,
287 'dynamic' => [
288 'active' => true,
289 ],
290 'ai' => [
291 'active' => false,
292 ],
293 'label_block' => true,
294 'placeholder' => esc_html__( '@', 'elementor' ),
295 'default' => $config['content']['chat_button_section']['defaults']['mail'],
296 'condition' => [
297 'chat_button_platform' => Social_Network_Provider::EMAIL,
298 ],
299 ],
300 );
301
302 $this->add_control(
303 'chat_button_mail_subject',
304 [
305 'label' => esc_html__( 'Subject', 'elementor' ),
306 'type' => Controls_Manager::TEXT,
307 'dynamic' => [
308 'active' => true,
309 ],
310 'label_block' => true,
311 'default' => $config['content']['chat_button_section']['defaults']['mail_subject'],
312 'condition' => [
313 'chat_button_platform' => Social_Network_Provider::EMAIL,
314 ],
315 ],
316 );
317
318 $this->add_control(
319 'chat_button_mail_body',
320 [
321 'label' => esc_html__( 'Message', 'elementor' ),
322 'type' => Controls_Manager::TEXTAREA,
323 'default' => $config['content']['chat_button_section']['defaults']['mail_body'],
324 'condition' => [
325 'chat_button_platform' => Social_Network_Provider::EMAIL,
326 ],
327 ]
328 );
329
330 $this->add_control(
331 'chat_button_number',
332 [
333 'label' => esc_html__( 'Number', 'elementor' ),
334 'type' => Controls_Manager::TEXT,
335 'dynamic' => [
336 'active' => true,
337 ],
338 'ai' => [
339 'active' => false,
340 ],
341 'label_block' => true,
342 'placeholder' => esc_html__( '+', 'elementor' ),
343 'default' => $config['content']['chat_button_section']['defaults']['number'],
344 'condition' => [
345 'chat_button_platform' => [
346 Social_Network_Provider::SMS,
347 Social_Network_Provider::WHATSAPP,
348 Social_Network_Provider::VIBER,
349 Social_Network_Provider::TELEPHONE,
350 ],
351 ],
352 ],
353 );
354
355 $this->add_control(
356 'chat_button_username',
357 [
358 'label' => esc_html__( 'Username', 'elementor' ),
359 'type' => Controls_Manager::TEXT,
360 'dynamic' => [
361 'active' => true,
362 ],
363 'ai' => [
364 'active' => false,
365 ],
366 'label_block' => true,
367 'default' => $config['content']['chat_button_section']['defaults']['username'],
368 'condition' => [
369 'chat_button_platform' => [
370 Social_Network_Provider::SKYPE,
371 Social_Network_Provider::MESSENGER,
372 ],
373 ],
374 ],
375 );
376
377 $this->add_control(
378 'chat_button_viber_action',
379 [
380 'label' => esc_html__( 'Action', 'elementor' ),
381 'type' => Controls_Manager::SELECT,
382 'default' => 'chat',
383 'options' => [
384 'chat' => 'Chat',
385 'contact' => 'Contact',
386 ],
387 'condition' => [
388 'chat_button_platform' => Social_Network_Provider::VIBER,
389 ],
390 ]
391 );
392
393 $this->add_control(
394 'chat_button_waze',
395 [
396 'label' => esc_html__( 'Location', 'elementor' ),
397 'type' => Controls_Manager::URL,
398 'dynamic' => [
399 'active' => true,
400 ],
401 'ai' => [
402 'active' => false,
403 ],
404 'label_block' => true,
405 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
406 'default' => $config['content']['chat_button_section']['defaults']['location'],
407 'condition' => [
408 'chat_button_platform' => [
409 Social_Network_Provider::WAZE,
410 ],
411 ],
412 ],
413 );
414
415 $this->add_control(
416 'chat_button_url',
417 [
418 'label' => esc_html__( 'Link', 'elementor' ),
419 'type' => Controls_Manager::URL,
420 'dynamic' => [
421 'active' => true,
422 ],
423 'ai' => [
424 'active' => false,
425 ],
426 'autocomplete' => true,
427 'label_block' => true,
428 'default' => $config['content']['chat_button_section']['defaults']['url'],
429 'condition' => [
430 'chat_button_platform' => [
431 Social_Network_Provider::URL,
432 ],
433 ],
434 ],
435 );
436 }
437
438 private function get_display_text_condition( $condition ) {
439 $config = static::get_configuration();
440
441 if ( true == $config['content']['chat_button_section']['has_display_text_select'] ) {
442 return $condition;
443 }
444
445 return null;
446 }
447
448 protected function add_chat_button_section(): void {
449 $config = static::get_configuration();
450
451 $this->start_controls_section(
452 'chat_button_section',
453 [
454 'label' => $config['content']['chat_button_section']['section_name'],
455 'tab' => Controls_Manager::TAB_CONTENT,
456 ]
457 );
458
459 if ( $config['content']['chat_button_section']['has_accessible_name'] ) {
460 $this->add_control(
461 'chat_aria_label',
462 [
463 'label' => esc_html__( 'Accessible name', 'elementor' ),
464 'type' => Controls_Manager::TEXT,
465 'default' => $config['content']['chat_button_section']['chat_aria_label'],
466 'placeholder' => esc_html__( 'Add accessible name', 'elementor' ),
467 'dynamic' => [
468 'active' => true,
469 ],
470 ],
471 );
472 }
473
474 if ( $config['content']['chat_button_section']['has_platform'] ) {
475
476 $this->add_control(
477 'chat_button_platform',
478 [
479 'label' => esc_html__( 'Platform', 'elementor' ),
480 'type' => Controls_Manager::SELECT,
481 'default' => $config['content']['chat_button_section']['platform']['default'],
482 'options' => Social_Network_Provider::get_social_networks_text(
483 $config['content']['chat_button_section']['platform']['group']
484 ),
485 ]
486 );
487
488 $this->social_media_controls();
489 }
490
491 if ( $config['content']['chat_button_section']['has_icon'] ) {
492 $this->add_control(
493 'chat_button_icon',
494 [
495 'label' => esc_html__( 'Icon', 'elementor' ),
496 'type' => Controls_Manager::ICONS,
497 'default' => $config['content']['chat_button_section']['icon_default'],
498 'recommended' => $config['content']['chat_button_section']['icons_recommended'],
499 ]
500 );
501 }
502
503 if ( $config['content']['chat_button_section']['has_notification_dot'] ) {
504
505 $notification_dot_return_value = 'yes';
506 $notification_dot_default = $notification_dot_return_value;
507
508 // Only clear if explicitly passed
509 if ( false === $config['content']['chat_button_section']['has_notification_dot_default_enabled'] ) {
510 $notification_dot_default = '';
511 }
512
513 $this->add_control(
514 'chat_button_show_dot',
515 [
516 'label' => esc_html__( 'Notification Dot', 'elementor' ),
517 'type' => Controls_Manager::SWITCHER,
518 'label_on' => esc_html__( 'Show', 'elementor' ),
519 'label_off' => esc_html__( 'Hide', 'elementor' ),
520 'return_value' => $notification_dot_return_value,
521 'default' => $notification_dot_default,
522 ]
523 );
524 }
525
526 if ( $config['content']['chat_button_section']['has_display_text'] ) {
527
528 if ( $config['content']['chat_button_section']['has_display_text_select'] ) {
529 $this->add_control(
530 'chat_button_display_text_select',
531 [
532 'label' => esc_html__( 'Display Text', 'elementor' ),
533 'type' => Controls_Manager::SELECT,
534 'default' => 'details',
535 'options' => [
536 'details' => esc_html__( 'Contact Details', 'elementor' ),
537 'cta' => esc_html__( 'Call to Action', 'elementor' ),
538 ],
539 ]
540 );
541 }
542
543 $this->add_control(
544 'chat_button_display_text',
545 [
546 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
547 'type' => Controls_Manager::TEXT,
548 'dynamic' => [
549 'active' => true,
550 ],
551 'label_block' => true,
552 'placeholder' => esc_html__( 'Enter the text', 'elementor' ),
553 'default' => $config['content']['chat_button_section']['display_text_label'],
554 'condition' => $this->get_display_text_condition([
555 'chat_button_display_text_select' => 'cta',
556 ] ),
557 ],
558 );
559 }
560
561 $this->end_controls_section();
562 }
563
564 protected function add_top_bar_section(): void {
565 $config = static::get_configuration();
566
567 $this->start_controls_section(
568 'top_bar_section',
569 [
570 'label' => $config['content']['top_bar_section']['section_name'],
571 'tab' => Controls_Manager::TAB_CONTENT,
572 ]
573 );
574
575 $this->add_control(
576 'top_bar_title',
577 [
578 'label' => $config['content']['top_bar_section']['title']['label'],
579 'type' => Controls_Manager::TEXT,
580 'default' => $config['content']['top_bar_section']['title']['default'],
581 'placeholder' => $config['content']['top_bar_section']['title']['placeholder'],
582 'dynamic' => [
583 'active' => $config['content']['top_bar_section']['title']['dynamic'],
584 ],
585 'ai' => [
586 'active' => $config['content']['top_bar_section']['title']['ai'],
587 ],
588 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
589 ]
590 );
591
592 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
593 $this->add_control(
594 'top_bar_subtitle',
595 [
596 'label' => $config['content']['top_bar_section']['subtitle']['label'],
597 'type' => Controls_Manager::TEXT,
598 'default' => $config['content']['top_bar_section']['subtitle']['default'],
599 'placeholder' => $config['content']['top_bar_section']['subtitle']['placeholder'],
600 $config['content']['top_bar_section']['subtitle']['dynamic'],
601 'ai' => [
602 'active' => $config['content']['top_bar_section']['subtitle']['ai'],
603 ],
604 'label_block' => $config['content']['top_bar_section']['title']['label_block'],
605 ]
606 );
607 }
608
609 if ( $config['content']['top_bar_section']['has_image'] ) {
610 $this->add_control(
611 'top_bar_image',
612 [
613 'label' => esc_html__( 'Profile Image', 'elementor' ),
614 'type' => Controls_Manager::MEDIA,
615 'default' => [
616 'url' => Utils::get_placeholder_image_src(),
617 ],
618 ]
619 );
620 }
621
622 if ( $config['content']['top_bar_section']['has_active_dot'] ) {
623 $this->add_control(
624 'top_bar_show_dot',
625 [
626 'label' => esc_html__( 'Active Dot', 'elementor' ),
627 'type' => Controls_Manager::SWITCHER,
628 'label_on' => esc_html__( 'Show', 'elementor' ),
629 'label_off' => esc_html__( 'Hide', 'elementor' ),
630 'return_value' => 'yes',
631 'default' => 'yes',
632 ]
633 );
634 }
635
636 $this->end_controls_section();
637 }
638
639 protected function add_message_bubble_section(): void {
640 $config = static::get_configuration();
641
642 $this->start_controls_section(
643 'message_bubble_section',
644 [
645 'label' => esc_html__( 'Message Bubble', 'elementor' ),
646 'tab' => Controls_Manager::TAB_CONTENT,
647 ]
648 );
649
650 $this->add_control(
651 'message_bubble_name',
652 [
653 'label' => esc_html__( 'Name', 'elementor' ),
654 'type' => Controls_Manager::TEXT,
655 'default' => esc_html__( 'Rob', 'elementor' ),
656 'placeholder' => esc_html__( 'Type your name here', 'elementor' ),
657 ]
658 );
659
660 $this->add_control(
661 'message_bubble_body',
662 [
663 'label' => esc_html__( 'Message', 'elementor' ),
664 'type' => Controls_Manager::TEXTAREA,
665 'dynamic' => [
666 'active' => true,
667 ],
668 'label_block' => true,
669 'default' => esc_html__( 'Hey, how can I help you today?', 'elementor' ),
670 'placeholder' => esc_html__( 'Message', 'elementor' ),
671 ],
672 );
673
674 $this->add_control(
675 'chat_button_time_format',
676 [
677 'label' => esc_html__( 'Time format', 'elementor' ),
678 'type' => Controls_Manager::SELECT,
679 'default' => '12h',
680 'options' => [
681 '12h' => esc_html__( '2:20 PM', 'elementor' ),
682 '24h' => esc_html__( '14:20', 'elementor' ),
683 ],
684 ]
685 );
686
687 if ( $config['content']['message_bubble_section']['has_typing_animation'] ) {
688 $this->add_control(
689 'chat_button_show_animation',
690 [
691 'label' => esc_html__( 'Typing Animation', 'elementor' ),
692 'type' => Controls_Manager::SWITCHER,
693 'label_on' => esc_html__( 'Show', 'elementor' ),
694 'label_off' => esc_html__( 'Hide', 'elementor' ),
695 'return_value' => 'yes',
696 'default' => 'yes',
697 ]
698 );
699 }
700
701 $this->end_controls_section();
702 }
703
704 protected function add_contact_section(): void {
705 $config = static::get_configuration();
706
707 $this->start_controls_section(
708 'contact_section',
709 [
710 'label' => $config['content']['contact_section']['section_name'],
711 'tab' => Controls_Manager::TAB_CONTENT,
712 ]
713 );
714
715 if ( $config['content']['contact_section']['has_accessible_name'] ) {
716 $this->add_control(
717 'contact_aria_label',
718 [
719 'label' => esc_html__( 'Accessible name', 'elementor' ),
720 'type' => Controls_Manager::TEXT,
721 'default' => $config['content']['chat_button_section']['chat_aria_label'],
722 'placeholder' => esc_html__( 'Add accessible name', 'elementor' ),
723 'dynamic' => [
724 'active' => true,
725 ],
726 ],
727 );
728 }
729
730 if ( $config['content']['contact_section']['has_cta_text'] ) {
731 $this->add_control(
732 'contact_cta_text',
733 [
734 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
735 'type' => Controls_Manager::TEXT,
736 'default' => esc_html__( 'Start conversation:', 'elementor' ),
737 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
738 'label_block' => true,
739 ]
740 );
741 }
742
743 if ( $config['content']['contact_section']['platform']['limit'] ) {
744 if ( $config['content']['contact_section']['platform']['min_items'] ) {
745 $this->add_control(
746 'contact_custom_panel_alert',
747 [
748 'type' => Controls_Manager::ALERT,
749 'alert_type' => 'info',
750 'content' => sprintf(
751 __( 'Add between <b>%1$d</b> to <b>%2$d</b> contact buttons', 'elementor' ),
752 $config['content']['contact_section']['platform']['min_items'],
753 $config['content']['contact_section']['platform']['limit']
754 ),
755 ]
756 );
757 } else {
758 $this->add_control(
759 'contact_custom_panel_alert',
760 [
761 'type' => Controls_Manager::ALERT,
762 'alert_type' => 'info',
763 'content' => sprintf(
764 __( 'Add up to <b>%d</b> contact buttons', 'elementor' ),
765 $config['content']['contact_section']['platform']['limit']
766 ),
767 ]
768 );
769 }
770 }
771
772 $repeater = new Repeater();
773
774 $repeater->add_control(
775 'contact_icon_platform',
776 [
777 'label' => esc_html__( 'Platform', 'elementor' ),
778 'type' => Controls_Manager::SELECT,
779 'options' => Social_Network_Provider::get_social_networks_text(
780 $config['content']['contact_section']['platform']['group-1']
781 ),
782 'default' => Social_Network_Provider::WHATSAPP,
783 ],
784 );
785
786 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
787 $repeater->add_control(
788 'contact_tooltip',
789 [
790 'label' => $config['content']['contact_section']['repeater']['tooltip_label'],
791 'type' => Controls_Manager::TEXT,
792 'dynamic' => [
793 'active' => true,
794 ],
795 'default' => $config['content']['contact_section']['repeater']['tooltip_default'],
796 'placeholder' => $config['content']['contact_section']['repeater']['tooltip_placeholder'],
797 ],
798 );
799 }
800
801 if ( $config['content']['contact_section']['repeater']['has_title'] ) {
802 $repeater->add_control(
803 'contact_title',
804 [
805 'label' => 'Title',
806 'type' => Controls_Manager::TEXT,
807 'dynamic' => [
808 'active' => true,
809 ],
810 'default' => 'Title',
811 'placeholder' => esc_html__( 'Enter title', 'elementor' ),
812 ],
813 );
814 }
815
816 if ( $config['content']['contact_section']['repeater']['has_description'] ) {
817 $repeater->add_control(
818 'contact_description',
819 [
820 'label' => 'Description',
821 'type' => Controls_Manager::TEXT,
822 'dynamic' => [
823 'active' => true,
824 ],
825 'default' => 'Description',
826 'placeholder' => esc_html__( 'Enter description', 'elementor' ),
827 ],
828 );
829 }
830
831 $repeater->add_control(
832 'contact_icon_mail',
833 [
834 'label' => esc_html__( 'Email', 'elementor' ),
835 'type' => Controls_Manager::TEXT,
836 'placeholder' => esc_html__( 'Enter your email', 'elementor' ),
837 'dynamic' => [
838 'active' => true,
839 ],
840 'ai' => [
841 'active' => false,
842 ],
843 'label_block' => true,
844 'condition' => [
845 'contact_icon_platform' => [
846 Social_Network_Provider::EMAIL,
847 ],
848 ],
849 ],
850 );
851
852 $repeater->add_control(
853 'contact_icon_mail_subject',
854 [
855 'label' => esc_html__( 'Subject', 'elementor' ),
856 'type' => Controls_Manager::TEXT,
857 'placeholder' => esc_html__( 'Subject', 'elementor' ),
858 'label_block' => true,
859 'condition' => [
860 'contact_icon_platform' => [
861 Social_Network_Provider::EMAIL,
862 ],
863 ],
864 ]
865 );
866
867 $repeater->add_control(
868 'contact_icon_mail_body',
869 [
870 'label' => esc_html__( 'Message', 'elementor' ),
871 'type' => Controls_Manager::TEXTAREA,
872 'placeholder' => esc_html__( 'Message', 'elementor' ),
873 'label_block' => true,
874 'condition' => [
875 'contact_icon_platform' => [
876 Social_Network_Provider::EMAIL,
877 ],
878 ],
879 ]
880 );
881
882 $repeater->add_control(
883 'contact_icon_number',
884 [
885 'label' => esc_html__( 'Number', 'elementor' ),
886 'type' => Controls_Manager::TEXT,
887 'dynamic' => [
888 'active' => true,
889 ],
890 'ai' => [
891 'active' => false,
892 ],
893 'label_block' => true,
894 'placeholder' => esc_html__( '+', 'elementor' ),
895 'condition' => [
896 'contact_icon_platform' => [
897 Social_Network_Provider::SMS,
898 Social_Network_Provider::WHATSAPP,
899 Social_Network_Provider::VIBER,
900 Social_Network_Provider::TELEPHONE,
901 ],
902 ],
903 ],
904 );
905
906 $repeater->add_control(
907 'contact_icon_username',
908 [
909 'label' => esc_html__( 'Username', 'elementor' ),
910 'type' => Controls_Manager::TEXT,
911 'dynamic' => [
912 'active' => true,
913 ],
914 'ai' => [
915 'active' => false,
916 ],
917 'label_block' => true,
918 'placeholder' => esc_html__( 'Enter your username', 'elementor' ),
919 'condition' => [
920 'contact_icon_platform' => [
921 Social_Network_Provider::MESSENGER,
922 Social_Network_Provider::SKYPE,
923 ],
924 ],
925 ],
926 );
927
928 $repeater->add_control(
929 'contact_icon_url',
930 [
931 'label' => esc_html__( 'Link', 'elementor' ),
932 'type' => Controls_Manager::URL,
933 'dynamic' => [
934 'active' => true,
935 ],
936 'ai' => [
937 'active' => false,
938 ],
939 'autocomplete' => true,
940 'label_block' => true,
941 'condition' => [
942 'contact_icon_platform' => [
943 Social_Network_Provider::URL,
944 ],
945 ],
946 'default' => [
947 'is_external' => true,
948 ],
949 'placeholder' => esc_html__( 'Paste URL or type', 'elementor' ),
950 ],
951 );
952
953 $repeater->add_control(
954 'contact_icon_waze',
955 [
956 'label' => esc_html__( 'Location', 'elementor' ),
957 'type' => Controls_Manager::URL,
958 'default' => [
959 'is_external' => true,
960 ],
961 'dynamic' => [
962 'active' => true,
963 ],
964 'label_block' => true,
965 'placeholder' => esc_html__( 'Paste Waze link', 'elementor' ),
966 'condition' => [
967 'contact_icon_platform' => [
968 Social_Network_Provider::WAZE,
969 ],
970 ],
971 'ai' => [
972 'active' => false,
973 ],
974 ],
975 );
976
977 $repeater->add_control(
978 'contact_icon_viber_action',
979 [
980 'label' => esc_html__( 'Action', 'elementor' ),
981 'type' => Controls_Manager::SELECT,
982 'default' => 'chat',
983 'dynamic' => [
984 'active' => true,
985 ],
986 'options' => [
987 'chat' => 'Chat',
988 'contact' => 'Contact',
989 ],
990 'condition' => [
991 'contact_icon_platform' => Social_Network_Provider::VIBER,
992 ],
993 ]
994 );
995
996 $this->add_control(
997 'contact_repeater',
998 [
999 'max_items' => $config['content']['contact_section']['platform']['limit'],
1000 'min_items' => $config['content']['contact_section']['platform']['min_items'],
1001 'type' => Controls_Manager::REPEATER,
1002 'fields' => $repeater->get_controls(),
1003 'title_field' => $this->get_icon_title_field(),
1004 'prevent_empty' => true,
1005 'button_text' => esc_html__( 'Add Item', 'elementor' ),
1006 'default' => $config['content']['contact_section']['default'],
1007 ]
1008 );
1009
1010 $this->end_controls_section();
1011 }
1012
1013 protected function get_icon_title_field(): string {
1014 $platform_icons_js = json_encode( Social_Network_Provider::get_social_networks_icons() );
1015 $platform_text_js = json_encode( Social_Network_Provider::get_social_networks_text() );
1016
1017 return <<<JS
1018 <#
1019 elementor.helpers.enqueueIconFonts( 'fa-solid' );
1020 elementor.helpers.enqueueIconFonts( 'fa-brands' );
1021 const mapping = {$platform_icons_js};
1022 const text_mapping = {$platform_text_js};
1023 #>
1024 <i class='{{{ mapping[contact_icon_platform] }}}' ></i> {{{ text_mapping[contact_icon_platform] }}}
1025 JS;
1026 }
1027
1028 protected function add_send_button_section(): void {
1029 $config = static::get_configuration();
1030
1031 $this->start_controls_section(
1032 'send_button_section',
1033 [
1034 'label' => $config['content']['send_button_section']['section_name'],
1035 'tab' => Controls_Manager::TAB_CONTENT,
1036 ]
1037 );
1038
1039 $this->add_control(
1040 'send_button_text',
1041 [
1042 'label' => esc_html__( 'Text', 'elementor' ),
1043 'type' => Controls_Manager::TEXT,
1044 'default' => $config['content']['send_button_section']['text']['default'],
1045 'placeholder' => esc_html__( 'Type your text here', 'elementor' ),
1046 'dynamic' => [
1047 'active' => true,
1048 ],
1049 'ai' => [
1050 'active' => false,
1051 ],
1052 ]
1053 );
1054
1055 if ( $config['content']['send_button_section']['has_link'] ) {
1056 $this->add_control(
1057 'send_button_url',
1058 [
1059 'label' => esc_html__( 'Link', 'elementor' ),
1060 'type' => Controls_Manager::URL,
1061 'default' => [
1062 'is_external' => true,
1063 ],
1064 'dynamic' => [
1065 'active' => true,
1066 ],
1067 'ai' => [
1068 'active' => false,
1069 ],
1070 'autocomplete' => true,
1071 'label_block' => true,
1072 ],
1073 );
1074 }
1075
1076 $this->end_controls_section();
1077 }
1078
1079 protected function add_content_tab(): void {
1080 $this->add_chat_button_section();
1081
1082 $this->add_top_bar_section();
1083
1084 $this->add_message_bubble_section();
1085
1086 $this->add_send_button_section();
1087 }
1088
1089 private function get_platform_color_condition( $condition ) {
1090 $config = static::get_configuration();
1091
1092 if ( true == $config['style']['has_platform_colors'] ) {
1093 return $condition;
1094 }
1095
1096 return null;
1097 }
1098
1099 protected function add_style_chat_button_section(): void {
1100 $config = static::get_configuration();
1101
1102 $this->start_controls_section(
1103 'style_chat_button',
1104 [
1105 'label' => $config['content']['chat_button_section']['section_name'],
1106 'tab' => Controls_Manager::TAB_STYLE,
1107 ]
1108 );
1109
1110 if ( $config['style']['chat_button_section']['has_button_size'] ) {
1111 $this->add_control(
1112 'style_chat_button_size',
1113 [
1114 'label' => esc_html__( 'Size', 'elementor' ),
1115 'type' => Controls_Manager::SELECT,
1116 'default' => $config['style']['chat_button_section']['button_size_default'],
1117 'options' => [
1118 'small' => esc_html__( 'Small', 'elementor' ),
1119 'medium' => esc_html__( 'Medium', 'elementor' ),
1120 'large' => esc_html__( 'Large', 'elementor' ),
1121 ],
1122 ]
1123 );
1124 }
1125
1126 if ( $config['style']['chat_button_section']['has_icon_position'] ) {
1127 $this->add_responsive_control(
1128 'style_chat_button_horizontal_position',
1129 [
1130 'label' => esc_html__( 'Icon Position', 'elementor' ),
1131 'type' => Controls_Manager::CHOOSE,
1132 'options' => [
1133 'start' => [
1134 'title' => esc_html__( 'Left', 'elementor' ),
1135 'icon' => 'eicon-h-align-left',
1136 ],
1137 'end' => [
1138 'title' => esc_html__( 'Right', 'elementor' ),
1139 'icon' => 'eicon-h-align-right',
1140 ],
1141 ],
1142 'selectors' => [
1143 '{{WRAPPER}} .e-contact-buttons__chat-button svg' => 'order: {{VALUE}};',
1144 ],
1145 'selectors_dictionary' => [
1146 'start' => '-1',
1147 'end' => '2',
1148 ],
1149 'default' => 'start',
1150 'mobile_default' => 'start',
1151 'toggle' => true,
1152 ]
1153 );
1154 }
1155
1156 if ( $config['style']['chat_button_section']['has_icon_spacing'] ) {
1157 $this->add_responsive_control(
1158 'style_chat_button_spacing',
1159 [
1160 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
1161 'type' => Controls_Manager::SLIDER,
1162 'range' => [
1163 '%' => [
1164 'min' => 10,
1165 'max' => 100,
1166 ],
1167 'px' => [
1168 'min' => 0,
1169 'max' => 100,
1170 ],
1171 ],
1172 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
1173 'selectors' => [
1174 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-gap: {{SIZE}}{{UNIT}}',
1175 ],
1176 'separator' => 'before',
1177 ]
1178 );
1179 }
1180
1181 if ( $config['style']['chat_button_section']['has_typography'] ) {
1182 $this->add_group_control(
1183 Group_Control_Typography::get_type(),
1184 [
1185 'name' => 'style_top_bar_title_typography',
1186 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button',
1187 ]
1188 );
1189 }
1190
1191 if ( $config['style']['chat_button_section']['has_tabs'] ) {
1192 $this->start_controls_tabs(
1193 'style_button_color_tabs'
1194 );
1195
1196 $this->start_controls_tab(
1197 'style_button_color_tabs_normal',
1198 [
1199 'label' => esc_html__( 'Normal', 'elementor' ),
1200 ]
1201 );
1202
1203 if ( $config['style']['has_platform_colors'] ) {
1204 $this->add_control(
1205 'style_button_color_select',
1206 [
1207 'label' => esc_html__( 'Colors', 'elementor' ),
1208 'type' => Controls_Manager::SELECT,
1209 'default' => 'default',
1210 'options' => [
1211 'default' => esc_html__( 'Default', 'elementor' ),
1212 'custom' => esc_html__( 'Custom', 'elementor' ),
1213 ],
1214 ]
1215 );
1216 }
1217
1218 $this->add_control(
1219 'style_button_color_icon',
1220 [
1221 'label' => $config['style']['chat_button_section']['icon_color_label'],
1222 'type' => Controls_Manager::COLOR,
1223 'selectors' => [
1224 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1225 ],
1226 'condition' => $this->get_platform_color_condition( [
1227 'style_button_color_select' => 'custom',
1228 ] ),
1229 ]
1230 );
1231
1232 $this->add_control(
1233 'style_button_color_background',
1234 [
1235 'label' => esc_html__( 'Background Color', 'elementor' ),
1236 'type' => Controls_Manager::COLOR,
1237 'selectors' => [
1238 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1239 ],
1240 'condition' => $this->get_platform_color_condition( [
1241 'style_button_color_select' => 'custom',
1242 ] ),
1243 ]
1244 );
1245
1246 $this->end_controls_tab();
1247
1248 $this->start_controls_tab(
1249 'style_button_color_tabs_hover',
1250 [
1251 'label' => esc_html__( 'Hover', 'elementor' ),
1252 ]
1253 );
1254
1255 if ( $config['style']['has_platform_colors'] ) {
1256 $this->add_control(
1257 'style_button_color_select_hover',
1258 [
1259 'label' => esc_html__( 'Colors', 'elementor' ),
1260 'type' => Controls_Manager::SELECT,
1261 'default' => 'default',
1262 'options' => [
1263 'default' => esc_html__( 'Default', 'elementor' ),
1264 'custom' => esc_html__( 'Custom', 'elementor' ),
1265 ],
1266 ]
1267 );
1268 }
1269
1270 $this->add_control(
1271 'style_button_color_icon_hover',
1272 [
1273 'label' => $config['style']['chat_button_section']['icon_color_label'],
1274 'type' => Controls_Manager::COLOR,
1275 'selectors' => [
1276 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon-hover: {{VALUE}}',
1277 ],
1278 'condition' => $this->get_platform_color_condition( [
1279 'style_button_color_select_hover' => 'custom',
1280 ] ),
1281 ]
1282 );
1283
1284 $this->add_control(
1285 'style_button_color_background_hover',
1286 [
1287 'label' => esc_html__( 'Background Color', 'elementor' ),
1288 'type' => Controls_Manager::COLOR,
1289 'selectors' => [
1290 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg-hover: {{VALUE}}',
1291 ],
1292 'condition' => $this->get_platform_color_condition( [
1293 'style_button_color_select_hover' => 'custom',
1294 ] ),
1295 ]
1296 );
1297
1298 if ( 'default' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1299 $this->add_hover_animation_control(
1300 'style_button_color_hover_animation',
1301 );
1302 }
1303
1304 $this->end_controls_tab();
1305
1306 if ( $config['content']['chat_button_section']['has_active_tab'] ) {
1307 $this->start_controls_tab(
1308 'style_button_color_tabs_active',
1309 [
1310 'label' => esc_html__( 'Active', 'elementor' ),
1311 ]
1312 );
1313
1314 $this->add_control(
1315 'style_button_color_icon_active',
1316 [
1317 'label' => esc_html__( 'Icon Color', 'elementor' ),
1318 'type' => Controls_Manager::COLOR,
1319 'selectors' => [
1320 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-color: {{VALUE}}',
1321 ],
1322 ]
1323 );
1324
1325 $this->add_control(
1326 'style_button_color_background_active',
1327 [
1328 'label' => esc_html__( 'Background Color', 'elementor' ),
1329 'type' => Controls_Manager::COLOR,
1330 'selectors' => [
1331 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-active-button-bg: {{VALUE}}',
1332 ],
1333 ]
1334 );
1335
1336 $this->end_controls_tab();
1337 }
1338
1339 $this->end_controls_tabs();
1340 }
1341
1342 if ( $config['style']['chat_button_section']['has_platform_color_controls'] ) {
1343 $this->add_control(
1344 'style_platform_control_select',
1345 [
1346 'label' => esc_html__( 'Colors', 'elementor' ),
1347 'type' => Controls_Manager::SELECT,
1348 'default' => 'default',
1349 'options' => [
1350 'default' => esc_html__( 'Default', 'elementor' ),
1351 'custom' => esc_html__( 'Custom', 'elementor' ),
1352 ],
1353 'separator' => 'before',
1354 ]
1355 );
1356
1357 $this->add_control(
1358 'style_button_color_icon',
1359 [
1360 'label' => $config['style']['chat_button_section']['icon_color_label'],
1361 'type' => Controls_Manager::COLOR,
1362 'selectors' => [
1363 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-icon: {{VALUE}}',
1364 ],
1365 'condition' => [
1366 'style_platform_control_select' => 'custom',
1367 ],
1368 ]
1369 );
1370
1371 $this->add_control(
1372 'style_button_color_background',
1373 [
1374 'label' => esc_html__( 'Background Color', 'elementor' ),
1375 'type' => Controls_Manager::COLOR,
1376 'selectors' => [
1377 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bg: {{VALUE}}',
1378 ],
1379 'condition' => [
1380 'style_platform_control_select' => 'custom',
1381 ],
1382 ]
1383 );
1384 }
1385
1386 if ( $config['style']['chat_button_section']['has_entrance_animation'] ) {
1387 $this->add_responsive_control(
1388 'style_chat_button_animation',
1389 [
1390 'label' => esc_html__( 'Entrance Animation', 'elementor' ),
1391 'type' => Controls_Manager::ANIMATION,
1392 'frontend_available' => true,
1393 'separator' => 'before',
1394 ]
1395 );
1396
1397 $this->add_control(
1398 'style_chat_button_animation_duration',
1399 [
1400 'label' => esc_html__( 'Animation Duration', 'elementor' ),
1401 'type' => Controls_Manager::SELECT,
1402 'default' => 'normal',
1403 'options' => [
1404 'slow' => esc_html__( 'Slow', 'elementor' ),
1405 'normal' => esc_html__( 'Normal', 'elementor' ),
1406 'fast' => esc_html__( 'Fast', 'elementor' ),
1407 ],
1408 'prefix_class' => 'animated-',
1409 ]
1410 );
1411
1412 $this->add_control(
1413 'style_chat_button_animation_delay',
1414 [
1415 'label' => esc_html__( 'Animation Delay', 'elementor' ) . ' (ms)',
1416 'type' => Controls_Manager::NUMBER,
1417 'min' => 0,
1418 'step' => 100,
1419 'selectors' => [
1420 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-button-chat-button-animation-delay: {{SIZE}}ms;',
1421 ],
1422 'render_type' => 'none',
1423 'frontend_available' => true,
1424 'separator' => 'after',
1425 ]
1426 );
1427 }
1428
1429 if ( $config['style']['chat_button_section']['has_box_shadow'] ) {
1430 $this->add_group_control(
1431 Group_Control_Box_Shadow::get_type(),
1432 [
1433 'name' => 'style_chat_button_box_shadow',
1434 'selector' => '{{WRAPPER}} .e-contact-buttons__chat-button-shadow',
1435 ]
1436 );
1437 }
1438
1439 if ( $config['style']['chat_button_section']['has_drop_shadow'] ) {
1440 $this->add_group_control(
1441 Group_Control_Box_Shadow::get_type(),
1442 [
1443 'name' => 'style_chat_button_drop_shadow',
1444 'fields_options' => [
1445 'box_shadow' => [
1446 'selectors' => [
1447 '{{WRAPPER}} .e-contact-buttons__chat-button-drop-shadow' => 'filter: drop-shadow({{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}});',
1448 ],
1449 ],
1450 ],
1451 ]
1452 );
1453 }
1454
1455 if ( $config['style']['chat_button_section']['has_padding'] ) {
1456 $this->add_responsive_control(
1457 'style_chat_button_padding',
1458 [
1459 'label' => esc_html__( 'Padding', 'elementor' ),
1460 'type' => Controls_Manager::DIMENSIONS,
1461 'size_units' => [ 'px', '%', 'em', 'rem' ],
1462 'selectors' => [
1463 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-button-padding-inline-start: {{LEFT}}{{UNIT}};',
1464 ],
1465 'separator' => 'before',
1466 ]
1467 );
1468 }
1469
1470 if ( 'custom' == $config['style']['chat_button_section']['hover_animation_type'] ) {
1471 $this->add_control(
1472 'style_chat_button_custom_animation_heading',
1473 [
1474 'label' => esc_html__( 'Hover Animation', 'elementor' ),
1475 'type' => Controls_Manager::HEADING,
1476 'separator' => 'before',
1477 ]
1478 );
1479
1480 $this->add_control(
1481 'style_chat_button_custom_animation_alert',
1482 [
1483 'type' => Controls_Manager::ALERT,
1484 'alert_type' => 'info',
1485 'content' => __( 'Hover animation is <b>desktop only</b>', 'elementor' ),
1486 ]
1487 );
1488
1489 $this->add_control(
1490 'style_chat_button_custom_animation_transition',
1491 [
1492 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
1493 'type' => Controls_Manager::SLIDER,
1494 'range' => [
1495 's' => [
1496 'min' => 0,
1497 'max' => 3,
1498 'step' => 0.1,
1499 ],
1500 ],
1501 'default' => [
1502 'unit' => 's',
1503 'size' => 0.3,
1504 ],
1505 'selectors' => [
1506 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
1507 ],
1508 ]
1509 );
1510 }
1511
1512 $this->end_controls_section();
1513 }
1514
1515 protected function add_style_top_bar_section(): void {
1516 $config = static::get_configuration();
1517
1518 $this->start_controls_section(
1519 'style_top_bar_section',
1520 [
1521 'label' => $config['content']['top_bar_section']['section_name'],
1522 'tab' => Controls_Manager::TAB_STYLE,
1523 ]
1524 );
1525
1526 if ( $config['content']['top_bar_section']['has_image'] ) {
1527 $this->add_control(
1528 'style_top_bar_profile_heading',
1529 [
1530 'label' => esc_html__( 'Profile Image', 'elementor' ),
1531 'type' => Controls_Manager::HEADING,
1532 'separator' => 'before',
1533 ]
1534 );
1535
1536 $this->add_control(
1537 'style_top_bar_image_size',
1538 [
1539 'label' => esc_html__( 'Size', 'elementor' ),
1540 'type' => Controls_Manager::SELECT,
1541 'default' => 'medium',
1542 'options' => [
1543 'small' => esc_html__( 'Small', 'elementor' ),
1544 'medium' => esc_html__( 'Medium', 'elementor' ),
1545 'large' => esc_html__( 'Large', 'elementor' ),
1546 ],
1547 ]
1548 );
1549 }
1550
1551 if ( $config['style']['has_platform_colors'] ) {
1552 $this->add_control(
1553 'style_top_bar_colors',
1554 [
1555 'label' => esc_html__( 'Colors', 'elementor' ),
1556 'type' => Controls_Manager::SELECT,
1557 'default' => 'default',
1558 'options' => [
1559 'default' => esc_html__( 'Default', 'elementor' ),
1560 'custom' => esc_html__( 'Custom', 'elementor' ),
1561 ],
1562 'separator' => 'before',
1563 ]
1564 );
1565 }
1566
1567 if ( $config['style']['top_bar_section']['has_title_heading'] ) {
1568 $this->add_control(
1569 'style_top_bar_title_heading',
1570 [
1571 'label' => $config['style']['top_bar_section']['title_heading_label'],
1572 'type' => Controls_Manager::HEADING,
1573 'separator' => ! $config['style']['has_platform_colors'] ? 'before' : false,
1574 ]
1575 );
1576 }
1577
1578 $this->add_control(
1579 'style_top_bar_title_color',
1580 [
1581 'label' => esc_html__( 'Text Color', 'elementor' ),
1582 'type' => Controls_Manager::COLOR,
1583 'selectors' => [
1584 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-title: {{VALUE}}',
1585 ],
1586 'condition' => $this->get_platform_color_condition( [
1587 'style_top_bar_colors' => 'custom',
1588 ] ),
1589 ]
1590 );
1591
1592 $this->add_group_control(
1593 Group_Control_Typography::get_type(),
1594 [
1595 'name' => 'style_top_bar_title_typography',
1596 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-title',
1597 ]
1598 );
1599
1600 if ( $config['content']['top_bar_section']['has_subtitle'] ) {
1601 $this->add_control(
1602 'style_top_bar_subtitle_heading',
1603 [
1604 'label' => $config['style']['top_bar_section']['subtitle_heading_label'],
1605 'type' => Controls_Manager::HEADING,
1606 'separator' => false,
1607 ]
1608 );
1609
1610 $this->add_control(
1611 'style_top_bar_subtitle_color',
1612 [
1613 'label' => esc_html__( 'Text Color', 'elementor' ),
1614 'type' => Controls_Manager::COLOR,
1615 'selectors' => [
1616 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-subtitle: {{VALUE}}',
1617 ],
1618 'condition' => $this->get_platform_color_condition( [
1619 'style_top_bar_colors' => 'custom',
1620 ] ),
1621 ]
1622 );
1623
1624 $this->add_group_control(
1625 Group_Control_Typography::get_type(),
1626 [
1627 'name' => 'style_top_bar_subtitle_typography',
1628 'selector' => '{{WRAPPER}} .e-contact-buttons__top-bar-subtitle',
1629 ]
1630 );
1631 }
1632
1633 $close_and_background_partial_divider = 'before';
1634
1635 if ( $config['style']['top_bar_section']['has_style_close_button'] ) {
1636
1637 if ( $config['style']['top_bar_section']['has_close_button_heading'] ) {
1638 $this->add_control(
1639 'style_top_bar_close_button_heading',
1640 [
1641 'label' => esc_html__( 'Close Button', 'elementor' ),
1642 'type' => Controls_Manager::HEADING,
1643 'separator' => $close_and_background_partial_divider,
1644 'condition' => $this->get_platform_color_condition( [
1645 'style_top_bar_colors' => 'custom',
1646 ] ),
1647 ]
1648 );
1649 $close_and_background_partial_divider = false;
1650 }
1651
1652 $this->add_control(
1653 'style_top_bar_close_button_color',
1654 [
1655 'label' => esc_html__( 'Close Button Color', 'elementor' ),
1656 'type' => Controls_Manager::COLOR,
1657 'selectors' => [
1658 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-close-button-color: {{VALUE}}',
1659 ],
1660 'condition' => $this->get_platform_color_condition( [
1661 'style_top_bar_colors' => 'custom',
1662 ] ),
1663 'separator' => $close_and_background_partial_divider,
1664 ]
1665 );
1666
1667 $close_and_background_partial_divider = false;
1668 }
1669
1670 if ( $config['style']['top_bar_section']['has_background'] ) {
1671
1672 if ( $config['style']['top_bar_section']['has_background_heading'] ) {
1673 $this->add_control(
1674 'style_top_bar_background_heading',
1675 [
1676 'label' => esc_html__( 'Background', 'elementor' ),
1677 'type' => Controls_Manager::HEADING,
1678 'separator' => $close_and_background_partial_divider,
1679 'condition' => $this->get_platform_color_condition( [
1680 'style_top_bar_colors' => 'custom',
1681 ] ),
1682 ]
1683 );
1684 $close_and_background_partial_divider = false;
1685 }
1686
1687 $this->add_control(
1688 'style_top_bar_background_color',
1689 [
1690 'label' => esc_html__( 'Background Color', 'elementor' ),
1691 'type' => Controls_Manager::COLOR,
1692 'selectors' => [
1693 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-top-bar-bg: {{VALUE}}',
1694 ],
1695 'condition' => $this->get_platform_color_condition( [
1696 'style_top_bar_colors' => 'custom',
1697 ] ),
1698 'separator' => $close_and_background_partial_divider,
1699 ]
1700 );
1701 }
1702
1703 $this->end_controls_section();
1704 }
1705
1706 protected function add_style_message_bubble_section(): void {
1707 $config = static::get_configuration();
1708
1709 $this->start_controls_section(
1710 'style_bubble_section',
1711 [
1712 'label' => esc_html__( 'Message Bubble', 'elementor' ),
1713 'tab' => Controls_Manager::TAB_STYLE,
1714 ]
1715 );
1716
1717 if ( $config['style']['has_platform_colors'] ) {
1718 $this->add_control(
1719 'style_bubble_colors',
1720 [
1721 'label' => esc_html__( 'Colors', 'elementor' ),
1722 'type' => Controls_Manager::SELECT,
1723 'default' => 'default',
1724 'options' => [
1725 'default' => esc_html__( 'Default', 'elementor' ),
1726 'custom' => esc_html__( 'Custom', 'elementor' ),
1727 ],
1728 ]
1729 );
1730 }
1731
1732 $this->add_control(
1733 'style_bubble_name_heading',
1734 [
1735 'label' => esc_html__( 'Name', 'elementor' ),
1736 'type' => Controls_Manager::HEADING,
1737 'separator' => false,
1738 ]
1739 );
1740
1741 $this->add_control(
1742 'style_bubble_name_color',
1743 [
1744 'label' => esc_html__( 'Text Color', 'elementor' ),
1745 'type' => Controls_Manager::COLOR,
1746 'selectors' => [
1747 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-name: {{VALUE}}',
1748 ],
1749 'condition' => $this->get_platform_color_condition( [
1750 'style_bubble_colors' => 'custom',
1751 ] ),
1752 ]
1753 );
1754
1755 $this->add_group_control(
1756 Group_Control_Typography::get_type(),
1757 [
1758 'name' => 'style_bubble_name_typography',
1759 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-name',
1760 ]
1761 );
1762
1763 $this->add_control(
1764 'style_bubble_message_heading',
1765 [
1766 'label' => esc_html__( 'Message', 'elementor' ),
1767 'type' => Controls_Manager::HEADING,
1768 'separator' => false,
1769 ]
1770 );
1771
1772 $this->add_control(
1773 'style_bubble_message_color',
1774 [
1775 'label' => esc_html__( 'Text Color', 'elementor' ),
1776 'type' => Controls_Manager::COLOR,
1777 'selectors' => [
1778 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-body: {{VALUE}}',
1779 ],
1780 'condition' => $this->get_platform_color_condition( [
1781 'style_bubble_colors' => 'custom',
1782 ] ),
1783 ]
1784 );
1785
1786 $this->add_group_control(
1787 Group_Control_Typography::get_type(),
1788 [
1789 'name' => 'style_bubble_message_typography',
1790 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-body',
1791 ]
1792 );
1793
1794 $this->add_control(
1795 'style_bubble_time_heading',
1796 [
1797 'label' => esc_html__( 'Time', 'elementor' ),
1798 'type' => Controls_Manager::HEADING,
1799 'separator' => false,
1800 ]
1801 );
1802
1803 $this->add_control(
1804 'style_bubble_time_color',
1805 [
1806 'label' => esc_html__( 'Text Color', 'elementor' ),
1807 'type' => Controls_Manager::COLOR,
1808 'selectors' => [
1809 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-time: {{VALUE}}',
1810 ],
1811 'condition' => $this->get_platform_color_condition( [
1812 'style_bubble_colors' => 'custom',
1813 ] ),
1814 ]
1815 );
1816
1817 $this->add_group_control(
1818 Group_Control_Typography::get_type(),
1819 [
1820 'name' => 'style_bubble_time_typography',
1821 'selector' => '{{WRAPPER}} .e-contact-buttons__message-bubble-time',
1822 ]
1823 );
1824
1825 $this->add_control(
1826 'style_bubble_background_color',
1827 [
1828 'label' => esc_html__( 'Bubble Background Color', 'elementor' ),
1829 'type' => Controls_Manager::COLOR,
1830 'selectors' => [
1831 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-bubble-bg: {{VALUE}}',
1832 ],
1833 'condition' => $this->get_platform_color_condition( [
1834 'style_bubble_colors' => 'custom',
1835 ] ),
1836 'separator' => 'before',
1837 ]
1838 );
1839
1840 if ( $config['style']['message_bubble_section']['has_chat_background'] ) {
1841 $this->add_control(
1842 'style_bubble_chat_color',
1843 [
1844 'label' => esc_html__( 'Chat Background Color', 'elementor' ),
1845 'type' => Controls_Manager::COLOR,
1846 'selectors' => [
1847 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-message-bubble-chat-bg: {{VALUE}}',
1848 ],
1849 'condition' => $this->get_platform_color_condition( [
1850 'style_bubble_colors' => 'custom',
1851 ] ),
1852 ]
1853 );
1854 }
1855
1856 $this->end_controls_section();
1857 }
1858
1859 protected function add_style_contact_section(): void {
1860 $config = static::get_configuration();
1861
1862 $this->start_controls_section(
1863 'style_contact_section',
1864 [
1865 'label' => $config['content']['contact_section']['section_name'],
1866 'tab' => Controls_Manager::TAB_STYLE,
1867 ]
1868 );
1869
1870 if ( $config['content']['contact_section']['has_cta_text'] ) {
1871 $this->add_control(
1872 'style_contact_text_heading',
1873 [
1874 'label' => esc_html__( 'Call to Action Text', 'elementor' ),
1875 'type' => Controls_Manager::HEADING,
1876 'separator' => false,
1877 'condition' => $this->get_platform_color_condition( [
1878 'style_bubble_colors' => 'custom',
1879 ] ),
1880 ]
1881 );
1882
1883 $this->add_control(
1884 'style_contact_text_color',
1885 [
1886 'label' => esc_html__( 'Color', 'elementor' ),
1887 'type' => Controls_Manager::COLOR,
1888 'selectors' => [
1889 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-text: {{VALUE}}',
1890 ],
1891 ]
1892 );
1893
1894 $this->add_group_control(
1895 Group_Control_Typography::get_type(),
1896 [
1897 'name' => 'style_contact_text_typography',
1898 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-text',
1899 ]
1900 );
1901 }
1902
1903 if ( $config['style']['contact_section']['has_buttons_heading'] ) {
1904 $this->add_control(
1905 'style_contact_buttons_heading',
1906 [
1907 'label' => $config['style']['contact_section']['buttons_heading_label'],
1908 'type' => Controls_Manager::HEADING,
1909 'separator' => false,
1910 'condition' => $this->get_platform_color_condition( [
1911 'style_bubble_colors' => 'custom',
1912 ] ),
1913 ]
1914 );
1915 }
1916
1917 if ( $config['style']['contact_section']['has_buttons_size'] ) {
1918 $this->add_control(
1919 'style_contact_button_size',
1920 [
1921 'label' => esc_html__( 'Size', 'elementor' ),
1922 'type' => Controls_Manager::SELECT,
1923 'default' => 'small',
1924 'options' => [
1925 'small' => esc_html__( 'Small', 'elementor' ),
1926 'medium' => esc_html__( 'Medium', 'elementor' ),
1927 'large' => esc_html__( 'Large', 'elementor' ),
1928 ],
1929 ]
1930 );
1931 }
1932
1933 if ( $config['style']['contact_section']['has_text_color'] ) {
1934 $this->add_control(
1935 'style_contact_button_text_color',
1936 [
1937 'label' => $config['style']['contact_section']['icon_color_label'],
1938 'type' => Controls_Manager::COLOR,
1939 'selectors' => [
1940 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1941 ],
1942 ]
1943 );
1944 }
1945
1946 if ( $config['style']['contact_section']['has_typography'] ) {
1947 $this->add_group_control(
1948 Group_Control_Typography::get_type(),
1949 [
1950 'name' => 'style_contact_typography',
1951 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
1952 ]
1953 );
1954 }
1955
1956 if ( $config['style']['contact_section']['has_bg_color'] ) {
1957 $this->add_control(
1958 'style_contact_button_bg_color',
1959 [
1960 'label' => esc_html__( 'Background Color', 'elementor' ),
1961 'type' => Controls_Manager::COLOR,
1962 'selectors' => [
1963 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
1964 ],
1965 ]
1966 );
1967 }
1968
1969 if ( $config['style']['contact_section']['has_tabs'] ) {
1970 $this->start_controls_tabs(
1971 'style_contact_button_color_tabs'
1972 );
1973
1974 $this->start_controls_tab(
1975 'style_contact_button_color_tabs_normal',
1976 [
1977 'label' => esc_html__( 'Normal', 'elementor' ),
1978 ]
1979 );
1980
1981 $this->add_control(
1982 'style_contact_button_color_icon',
1983 [
1984 'label' => $config['style']['contact_section']['icon_color_label'],
1985 'type' => Controls_Manager::COLOR,
1986 'selectors' => [
1987 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
1988 ],
1989 ]
1990 );
1991
1992 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
1993 $this->add_control(
1994 'style_contact_button_color_background',
1995 [
1996 'label' => esc_html__( 'Background Color', 'elementor' ),
1997 'type' => Controls_Manager::COLOR,
1998 'selectors' => [
1999 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
2000 ],
2001 ]
2002 );
2003 }
2004
2005 $this->end_controls_tab();
2006
2007 $this->start_controls_tab(
2008 'style_contact_button_color_tabs_hover',
2009 [
2010 'label' => esc_html__( 'Hover', 'elementor' ),
2011 ]
2012 );
2013
2014 $this->add_control(
2015 'style_contact_button_color_icon_hover',
2016 [
2017 'label' => esc_html__( 'Icon Color', 'elementor' ),
2018 'type' => Controls_Manager::COLOR,
2019 'selectors' => [
2020 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon-hover: {{VALUE}}',
2021 ],
2022 ]
2023 );
2024
2025 if ( $config['style']['contact_section']['has_icon_bg_color'] ) {
2026 $this->add_control(
2027 'style_contact_button_color_background_hover',
2028 [
2029 'label' => esc_html__( 'Background Color', 'elementor' ),
2030 'type' => Controls_Manager::COLOR,
2031 'selectors' => [
2032 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg-hover: {{VALUE}}',
2033 ],
2034 ]
2035 );
2036 }
2037
2038 if ( $config['style']['contact_section']['has_hover_animation'] ) {
2039 $this->add_hover_animation_control(
2040 'style_contact_button_hover_animation',
2041 );
2042 }
2043
2044 $this->end_controls_tab();
2045
2046 $this->end_controls_tabs();
2047 }
2048
2049 if ( $config['style']['contact_section']['has_buttons_spacing'] ) {
2050
2051 $this->add_responsive_control(
2052 'style_contact_buttons_spacing',
2053 [
2054 'label' => esc_html__( 'Buttons Spacing', 'elementor' ),
2055 'type' => Controls_Manager::SLIDER,
2056 'range' => [
2057 '%' => [
2058 'min' => 10,
2059 'max' => 100,
2060 ],
2061 'px' => [
2062 'min' => 0,
2063 'max' => 100,
2064 ],
2065 ],
2066 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2067 'selectors' => [
2068 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-gap: {{SIZE}}{{UNIT}}',
2069 ],
2070 'separator' => 'before',
2071 ]
2072 );
2073 }
2074
2075 if ( $config['style']['contact_section']['has_button_corners'] ) {
2076 $this->add_control(
2077 'style_contact_corners',
2078 [
2079 'label' => esc_html__( 'Corners', 'elementor' ),
2080 'type' => Controls_Manager::SELECT,
2081 'default' => 'round',
2082 'options' => [
2083 'round' => esc_html__( 'Round', 'elementor' ),
2084 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2085 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2086 ],
2087 ]
2088 );
2089 }
2090
2091 if ( $config['style']['contact_section']['has_box_shadow'] ) {
2092 $this->add_group_control(
2093 Group_Control_Box_Shadow::get_type(),
2094 [
2095 'name' => 'style_contact_icons_box_shadow',
2096 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-box-shadow',
2097 ]
2098 );
2099 }
2100
2101 if ( $config['content']['contact_section']['repeater']['has_tooltip'] ) {
2102 $this->add_control(
2103 'style_contact_tooltip_heading',
2104 [
2105 'label' => esc_html__( 'Tooltips', 'elementor' ),
2106 'type' => Controls_Manager::HEADING,
2107 'separator' => 'before',
2108 ]
2109 );
2110
2111 $this->add_control(
2112 'style_contact_tooltip_text_color',
2113 [
2114 'label' => esc_html__( 'Text Color', 'elementor' ),
2115 'type' => Controls_Manager::COLOR,
2116 'selectors' => [
2117 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-text: {{VALUE}}',
2118 ],
2119 ]
2120 );
2121
2122 $this->add_group_control(
2123 Group_Control_Typography::get_type(),
2124 [
2125 'name' => 'style_contact_tooltip_typography',
2126 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-tooltip',
2127 ]
2128 );
2129
2130 $this->add_control(
2131 'style_contact_tooltip_bg_color',
2132 [
2133 'label' => esc_html__( 'Background Color', 'elementor' ),
2134 'type' => Controls_Manager::COLOR,
2135 'selectors' => [
2136 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-tooltip-bg: {{VALUE}}',
2137 ],
2138 ]
2139 );
2140 }
2141
2142 if ( $config['style']['contact_section']['has_chat_box_animation'] ) {
2143 $this->chat_box_animation_controls();
2144 }
2145
2146 if ( $config['style']['contact_section']['has_button_bar'] ) {
2147 $this->add_control(
2148 'style_contact_button_bar_heading',
2149 [
2150 'label' => esc_html__( 'Button Bar', 'elementor' ),
2151 'type' => Controls_Manager::HEADING,
2152 'separator' => 'before',
2153 ]
2154 );
2155
2156 $this->add_control(
2157 'style_contact_button_bar_bg_color',
2158 [
2159 'label' => esc_html__( 'Background Color', 'elementor' ),
2160 'type' => Controls_Manager::COLOR,
2161 'selectors' => [
2162 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-bg: {{VALUE}}',
2163 ],
2164 ]
2165 );
2166
2167 $this->add_control(
2168 'style_contact_button_bar_corners',
2169 [
2170 'label' => esc_html__( 'Corners', 'elementor' ),
2171 'type' => Controls_Manager::SELECT,
2172 'default' => 'round',
2173 'options' => [
2174 'round' => esc_html__( 'Round', 'elementor' ),
2175 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2176 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2177 ],
2178 ]
2179 );
2180
2181 $this->add_responsive_control(
2182 'style_contact_button_bar_padding',
2183 [
2184 'label' => esc_html__( 'Padding', 'elementor' ),
2185 'type' => Controls_Manager::DIMENSIONS,
2186 'size_units' => [ 'px', '%', 'em', 'rem' ],
2187 'selectors' => [
2188 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-button-bar-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-button-bar-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-button-bar-padding-inline-start: {{LEFT}}{{UNIT}};',
2189 ],
2190 'separator' => 'before',
2191 ]
2192 );
2193 }
2194
2195 if ( $config['style']['contact_section']['has_padding'] ) {
2196 $this->add_responsive_control(
2197 'style_contact_padding',
2198 [
2199 'label' => esc_html__( 'Padding', 'elementor' ),
2200 'type' => Controls_Manager::DIMENSIONS,
2201 'size_units' => [ 'px', '%', 'em', 'rem' ],
2202 'selectors' => [
2203 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-contact-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-contact-padding-inline-start: {{LEFT}}{{UNIT}};',
2204 ],
2205 'separator' => 'before',
2206 ]
2207 );
2208 }
2209
2210 if ( $config['style']['contact_section']['has_hover_transition_duration'] ) {
2211 $this->add_control(
2212 'style_contact_custom_animation_heading',
2213 [
2214 'label' => esc_html__( 'Animation', 'elementor' ),
2215 'type' => Controls_Manager::HEADING,
2216 ]
2217 );
2218
2219 $this->add_control(
2220 'style_contact_custom_animation_alert',
2221 [
2222 'type' => Controls_Manager::ALERT,
2223 'alert_type' => 'info',
2224 'content' => __( 'Adjust transition duration to change the speed of the <b>hover animation on desktop</b> and the <b>click animation on touchscreen</b>.', 'elementor' ),
2225 ]
2226 );
2227
2228 $this->add_control(
2229 'style_contact_custom_animation_transition',
2230 [
2231 'label' => esc_html__( 'Transition Duration', 'elementor' ) . ' (s)',
2232 'type' => Controls_Manager::SLIDER,
2233 'range' => [
2234 's' => [
2235 'min' => 0,
2236 'max' => 3,
2237 'step' => 0.1,
2238 ],
2239 ],
2240 'selectors' => [
2241 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-transition-duration: {{SIZE}}{{UNIT}}',
2242 ],
2243 ]
2244 );
2245 }
2246
2247 $this->end_controls_section();
2248 }
2249
2250 protected function add_style_resource_links_section(): void {
2251 $this->start_controls_section(
2252 'style_resource_links_section',
2253 [
2254 'label' => esc_html__( 'Resource Links', 'elementor' ),
2255 'tab' => Controls_Manager::TAB_STYLE,
2256 ]
2257 );
2258
2259 $this->add_control(
2260 'style_resource_links_icons_heading',
2261 [
2262 'label' => esc_html__( 'Icons', 'elementor' ),
2263 'type' => Controls_Manager::HEADING,
2264 'separator' => false,
2265 ]
2266 );
2267
2268 $this->add_control(
2269 'style_resource_links_button_size',
2270 [
2271 'label' => esc_html__( 'Size', 'elementor' ),
2272 'type' => Controls_Manager::SELECT,
2273 'default' => 'small',
2274 'options' => [
2275 'small' => esc_html__( 'Small', 'elementor' ),
2276 'medium' => esc_html__( 'Medium', 'elementor' ),
2277 'large' => esc_html__( 'Large', 'elementor' ),
2278 ],
2279 ]
2280 );
2281
2282 $this->add_control(
2283 'style_resource_links_color_select',
2284 [
2285 'label' => esc_html__( 'Color', 'elementor' ),
2286 'type' => Controls_Manager::SELECT,
2287 'default' => 'custom',
2288 'options' => [
2289 'default' => esc_html__( 'Default', 'elementor' ),
2290 'custom' => esc_html__( 'Custom', 'elementor' ),
2291 ],
2292 ]
2293 );
2294
2295 $this->add_control(
2296 'style_contact_icon_color',
2297 [
2298 'label' => esc_html__( 'Color', 'elementor' ),
2299 'type' => Controls_Manager::COLOR,
2300 'selectors' => [
2301 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-icon: {{VALUE}}',
2302 ],
2303 'condition' => [
2304 'style_resource_links_color_select' => 'custom',
2305 ],
2306 ]
2307 );
2308
2309 $this->add_control(
2310 'style_resource_links_title_heading',
2311 [
2312 'label' => esc_html__( 'Title', 'elementor' ),
2313 'type' => Controls_Manager::HEADING,
2314 'separator' => false,
2315 ]
2316 );
2317
2318 $this->add_control(
2319 'style_resource_links_title_color',
2320 [
2321 'label' => esc_html__( 'Text Color', 'elementor' ),
2322 'type' => Controls_Manager::COLOR,
2323 'selectors' => [
2324 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-title-text-color: {{VALUE}}',
2325 ],
2326 ]
2327 );
2328
2329 $this->add_group_control(
2330 Group_Control_Typography::get_type(),
2331 [
2332 'name' => 'style_resource_links_title_typography',
2333 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-title',
2334 ]
2335 );
2336
2337 $this->add_control(
2338 'style_resource_links_description_heading',
2339 [
2340 'label' => esc_html__( 'Description', 'elementor' ),
2341 'type' => Controls_Manager::HEADING,
2342 'separator' => false,
2343 ]
2344 );
2345
2346 $this->add_control(
2347 'style_resource_links_description_color',
2348 [
2349 'label' => esc_html__( 'Text Color', 'elementor' ),
2350 'type' => Controls_Manager::COLOR,
2351 'selectors' => [
2352 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-description-text-color: {{VALUE}}',
2353 ],
2354 ]
2355 );
2356
2357 $this->add_group_control(
2358 Group_Control_Typography::get_type(),
2359 [
2360 'name' => 'style_resource_links_description_typography',
2361 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-description',
2362 ]
2363 );
2364
2365 $this->add_control(
2366 'style_resource_links_bg_color',
2367 [
2368 'label' => esc_html__( 'Background Color', 'elementor' ),
2369 'type' => Controls_Manager::COLOR,
2370 'selectors' => [
2371 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-contact-button-bg: {{VALUE}}',
2372 ],
2373 'separator' => 'before',
2374 ]
2375 );
2376
2377 $this->add_hover_animation_control(
2378 'style_resource_links_hover_animation',
2379 );
2380
2381 $this->end_controls_section();
2382 }
2383
2384 protected function add_style_info_links_section(): void {
2385 $this->start_controls_section(
2386 'style_info_links_section',
2387 [
2388 'label' => esc_html__( 'Info Links', 'elementor' ),
2389 'tab' => Controls_Manager::TAB_STYLE,
2390 ]
2391 );
2392
2393 $this->add_control(
2394 'style_info_links_icon_position',
2395 [
2396 'label' => esc_html__( 'Icon Position', 'elementor' ),
2397 'type' => Controls_Manager::CHOOSE,
2398 'options' => [
2399 'start' => [
2400 'title' => esc_html__( 'Left', 'elementor' ),
2401 'icon' => 'eicon-h-align-left',
2402 ],
2403 'end' => [
2404 'title' => esc_html__( 'Right', 'elementor' ),
2405 'icon' => 'eicon-h-align-right',
2406 ],
2407 ],
2408 'default' => 'start',
2409 'toggle' => true,
2410 ]
2411 );
2412
2413 $this->add_control(
2414 'style_info_links_icon_spacing',
2415 [
2416 'label' => esc_html__( 'Icon Spacing', 'elementor' ),
2417 'type' => Controls_Manager::SLIDER,
2418 'range' => [
2419 '%' => [
2420 'min' => 10,
2421 'max' => 100,
2422 ],
2423 'px' => [
2424 'min' => 0,
2425 'max' => 20,
2426 ],
2427 ],
2428 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2429 'selectors' => [
2430 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-gap: {{SIZE}}{{UNIT}}',
2431 ],
2432 ]
2433 );
2434
2435 $this->add_responsive_control(
2436 'style_info_links_link_spacing',
2437 [
2438 'label' => esc_html__( 'Link Spacing', 'elementor' ),
2439 'type' => Controls_Manager::SLIDER,
2440 'range' => [
2441 '%' => [
2442 'min' => 10,
2443 'max' => 100,
2444 ],
2445 'px' => [
2446 'min' => 0,
2447 'max' => 10,
2448 ],
2449 ],
2450 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2451 'selectors' => [
2452 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-spacing: {{SIZE}}{{UNIT}}',
2453 ],
2454 ]
2455 );
2456
2457 $this->add_group_control(
2458 Group_Control_Typography::get_type(),
2459 [
2460 'name' => 'style_info_links_typography',
2461 'selector' => '{{WRAPPER}} .e-contact-buttons__contact-icon-link',
2462 ]
2463 );
2464
2465 $this->start_controls_tabs(
2466 'style_info_links_tabs'
2467 );
2468
2469 $this->start_controls_tab(
2470 'style_info_links_tabs_normal',
2471 [
2472 'label' => esc_html__( 'Normal', 'elementor' ),
2473 ]
2474 );
2475
2476 $this->add_control(
2477 'style_info_links_normal_text_color',
2478 [
2479 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2480 'type' => Controls_Manager::COLOR,
2481 'selectors' => [
2482 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color: {{VALUE}}',
2483 ],
2484 ]
2485 );
2486
2487 $this->end_controls_tab();
2488
2489 $this->start_controls_tab(
2490 'style_info_links_tabs_hover',
2491 [
2492 'label' => esc_html__( 'Hover', 'elementor' ),
2493 ]
2494 );
2495
2496 $this->add_control(
2497 'style_info_links_hover_text_color',
2498 [
2499 'label' => esc_html__( 'Text and Icon Color', 'elementor' ),
2500 'type' => Controls_Manager::COLOR,
2501 'selectors' => [
2502 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-text-color-hover: {{VALUE}}',
2503 ],
2504 ]
2505 );
2506
2507 $this->add_control(
2508 'style_info_links_hover_animation',
2509 [
2510 'label' => esc_html__( 'Hover Animation', 'elementor' ),
2511 'type' => Controls_Manager::HOVER_ANIMATION,
2512 'frontend_available' => true,
2513 ]
2514 );
2515
2516 $this->end_controls_tab();
2517
2518 $this->end_controls_tabs();
2519
2520 $this->add_control(
2521 'style_info_links_dividers',
2522 [
2523 'label' => esc_html__( 'Dividers', 'elementor' ),
2524 'type' => Controls_Manager::SWITCHER,
2525 'label_on' => esc_html__( 'Show', 'elementor' ),
2526 'label_off' => esc_html__( 'Hide', 'elementor' ),
2527 'return_value' => 'yes',
2528 'default' => 'yes',
2529 'separator' => 'before',
2530 ]
2531 );
2532
2533 $this->add_control(
2534 'style_info_links_divider_color',
2535 [
2536 'label' => esc_html__( 'Color', 'elementor' ),
2537 'type' => Controls_Manager::COLOR,
2538 'selectors' => [
2539 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-color: {{VALUE}}',
2540 ],
2541 'condition' => [
2542 'style_info_links_dividers' => 'yes',
2543 ],
2544 ]
2545 );
2546
2547 $this->add_responsive_control(
2548 'style_info_links_divider_weight',
2549 [
2550 'label' => esc_html__( 'Weight', 'elementor' ),
2551 'type' => Controls_Manager::SLIDER,
2552 'range' => [
2553 '%' => [
2554 'min' => 10,
2555 'max' => 100,
2556 ],
2557 'px' => [
2558 'min' => 1,
2559 'max' => 10,
2560 ],
2561 ],
2562 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2563 'selectors' => [
2564 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-icon-link-divider-weight: {{SIZE}}{{UNIT}}',
2565 ],
2566 'condition' => [
2567 'style_info_links_dividers' => 'yes',
2568 ],
2569 ]
2570 );
2571
2572 $this->end_controls_section();
2573 }
2574
2575 protected function add_style_send_button_section(): void {
2576 $config = static::get_configuration();
2577
2578 $this->start_controls_section(
2579 'style_send_section',
2580 [
2581 'label' => $config['content']['send_button_section']['section_name'],
2582 'tab' => Controls_Manager::TAB_STYLE,
2583 ]
2584 );
2585
2586 if ( $config['style']['send_button_section']['has_typography'] ) {
2587 $this->add_group_control(
2588 Group_Control_Typography::get_type(),
2589 [
2590 'name' => 'style_send_typography',
2591 'selector' => $config['style']['send_button_section']['typography_selector'],
2592 ]
2593 );
2594 }
2595
2596 $this->start_controls_tabs(
2597 'style_send_tabs'
2598 );
2599
2600 $this->start_controls_tab(
2601 'style_send_tabs_normal',
2602 [
2603 'label' => esc_html__( 'Normal', 'elementor' ),
2604 ]
2605 );
2606
2607 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2608 $this->add_control(
2609 'style_send_normal_colors',
2610 [
2611 'label' => esc_html__( 'Colors', 'elementor' ),
2612 'type' => Controls_Manager::SELECT,
2613 'default' => 'default',
2614 'options' => [
2615 'default' => esc_html__( 'Default', 'elementor' ),
2616 'custom' => esc_html__( 'Custom', 'elementor' ),
2617 ],
2618 ]
2619 );
2620 }
2621
2622 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2623 $this->add_control(
2624 'style_send_normal_icon_color',
2625 [
2626 'label' => esc_html__( 'Icon Color', 'elementor' ),
2627 'type' => Controls_Manager::COLOR,
2628 'selectors' => [
2629 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon: {{VALUE}}',
2630 ],
2631 'condition' => [
2632 'style_send_normal_colors' => 'custom',
2633 ],
2634 ]
2635 );
2636 }
2637
2638 if ( $config['style']['send_button_section']['has_text_color'] ) {
2639 $this->add_control(
2640 'style_send_normal_text_color',
2641 [
2642 'label' => esc_html__( 'Text Color', 'elementor' ),
2643 'type' => Controls_Manager::COLOR,
2644 'selectors' => [
2645 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text: {{VALUE}}',
2646 ],
2647 ]
2648 );
2649 }
2650
2651 if ( $config['style']['send_button_section']['has_background_color'] ) {
2652 $this->add_control(
2653 'style_send_normal_background_color',
2654 [
2655 'label' => esc_html__( 'Background Color', 'elementor' ),
2656 'type' => Controls_Manager::COLOR,
2657 'selectors' => [
2658 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg: {{VALUE}}',
2659 ],
2660 'condition' => $this->get_platform_color_condition( [
2661 'style_send_normal_colors' => 'custom',
2662 ] ),
2663 ]
2664 );
2665 }
2666
2667 $this->end_controls_tab();
2668
2669 $this->start_controls_tab(
2670 'style_send_tabs_hover',
2671 [
2672 'label' => esc_html__( 'Hover', 'elementor' ),
2673 ]
2674 );
2675
2676 if ( $config['style']['send_button_section']['has_platform_colors'] ) {
2677 $this->add_control(
2678 'style_send_hover_colors',
2679 [
2680 'label' => esc_html__( 'Colors', 'elementor' ),
2681 'type' => Controls_Manager::SELECT,
2682 'default' => 'default',
2683 'options' => [
2684 'default' => esc_html__( 'Default', 'elementor' ),
2685 'custom' => esc_html__( 'Custom', 'elementor' ),
2686 ],
2687 ]
2688 );
2689 }
2690
2691 if ( $config['style']['send_button_section']['has_icon_color'] ) {
2692 $this->add_control(
2693 'style_send_hover_icon_color',
2694 [
2695 'label' => esc_html__( 'Icon Color', 'elementor' ),
2696 'type' => Controls_Manager::COLOR,
2697 'selectors' => [
2698 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-icon-hover: {{VALUE}}',
2699 ],
2700 'condition' => [
2701 'style_send_hover_colors' => 'custom',
2702 ],
2703 ]
2704 );
2705 }
2706
2707 if ( $config['style']['send_button_section']['has_text_color'] ) {
2708 $this->add_control(
2709 'style_send_hover_text_color',
2710 [
2711 'label' => esc_html__( 'Text Color', 'elementor' ),
2712 'type' => Controls_Manager::COLOR,
2713 'selectors' => [
2714 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-text-hover: {{VALUE}}',
2715 ],
2716 ]
2717 );
2718 }
2719
2720 if ( $config['style']['send_button_section']['has_background_color'] ) {
2721 $this->add_control(
2722 'style_send_hover_background_color',
2723 [
2724 'label' => esc_html__( 'Background Color', 'elementor' ),
2725 'type' => Controls_Manager::COLOR,
2726 'selectors' => [
2727 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-bg-hover: {{VALUE}}',
2728 ],
2729 'condition' => $this->get_platform_color_condition( [
2730 'style_send_hover_colors' => 'custom',
2731 ] ),
2732 ]
2733 );
2734 }
2735
2736 $this->add_hover_animation_control(
2737 'style_send_hover_animation',
2738 );
2739
2740 $this->end_controls_tab();
2741
2742 $this->end_controls_tabs();
2743
2744 $this->add_responsive_control(
2745 'style_chat_button_padding',
2746 [
2747 'label' => esc_html__( 'Padding', 'elementor' ),
2748 'type' => Controls_Manager::DIMENSIONS,
2749 'size_units' => [ 'px', '%', 'em', 'rem' ],
2750 'selectors' => [
2751 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-send-button-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-send-button-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-send-button-padding-inline-start: {{LEFT}}{{UNIT}};',
2752 ],
2753 'separator' => 'before',
2754 ]
2755 );
2756
2757 $this->end_controls_section();
2758 }
2759
2760 protected function chat_box_animation_controls(): void {
2761 $this->add_responsive_control(
2762 'style_chat_box_entrance_animation',
2763 [
2764 'label' => esc_html__( 'Open Animation', 'elementor' ),
2765 'type' => Controls_Manager::ANIMATION,
2766 'frontend_available' => true,
2767 'separator' => 'before',
2768 ]
2769 );
2770
2771 $this->add_responsive_control(
2772 'style_chat_box_exit_animation',
2773 [
2774 'label' => esc_html__( 'Close Animation', 'elementor' ),
2775 'type' => Controls_Manager::EXIT_ANIMATION,
2776 'frontend_available' => true,
2777 ]
2778 );
2779
2780 $this->add_control(
2781 'style_chat_box_animation_duration',
2782 [
2783 'label' => esc_html__( 'Animation Duration', 'elementor' ),
2784 'type' => Controls_Manager::SELECT,
2785 'default' => 'normal',
2786 'options' => [
2787 'slow' => esc_html__( 'Slow', 'elementor' ),
2788 'normal' => esc_html__( 'Normal', 'elementor' ),
2789 'fast' => esc_html__( 'Fast', 'elementor' ),
2790 ],
2791 'prefix_class' => 'animated-',
2792 ]
2793 );
2794 }
2795
2796 protected function add_style_chat_box_section(): void {
2797 $config = static::get_configuration();
2798
2799 $this->start_controls_section(
2800 'style_chat_box_section',
2801 [
2802 'label' => $config['style']['chat_box_section']['section_name'],
2803 'tab' => Controls_Manager::TAB_STYLE,
2804 ]
2805 );
2806
2807 if ( $config['style']['has_platform_colors'] ) {
2808 $this->add_control(
2809 'style_chat_box_bg_select',
2810 [
2811 'label' => esc_html__( 'Background Color', 'elementor' ),
2812 'type' => Controls_Manager::SELECT,
2813 'default' => 'default',
2814 'options' => [
2815 'default' => esc_html__( 'Default', 'elementor' ),
2816 'custom' => esc_html__( 'Custom', 'elementor' ),
2817 ],
2818 ]
2819 );
2820 }
2821
2822 $this->add_control(
2823 'style_chat_box_bg_color',
2824 [
2825 'label' => esc_html__( 'Background Color', 'elementor' ),
2826 'type' => Controls_Manager::COLOR,
2827 'selectors' => [
2828 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-bg: {{VALUE}}',
2829 ],
2830 'condition' => $this->get_platform_color_condition( [
2831 'style_chat_box_bg_select' => 'custom',
2832 ] ),
2833 ]
2834 );
2835
2836 if ( $config['style']['chat_box_section']['has_width'] ) {
2837 $this->add_responsive_control(
2838 'style_chat_box_width',
2839 [
2840 'label' => esc_html__( 'Width', 'elementor' ),
2841 'type' => Controls_Manager::SLIDER,
2842 'range' => [
2843 '%' => [
2844 'min' => 10,
2845 'max' => 100,
2846 ],
2847 'px' => [
2848 'min' => 0,
2849 'max' => 400,
2850 ],
2851 ],
2852 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2853 'selectors' => [
2854 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-width: {{SIZE}}{{UNIT}}',
2855 ],
2856 ]
2857 );
2858 }
2859
2860 $this->add_control(
2861 'style_chat_box_corners',
2862 [
2863 'label' => esc_html__( 'Corners', 'elementor' ),
2864 'type' => Controls_Manager::SELECT,
2865 'default' => 'rounded',
2866 'options' => [
2867 'round' => esc_html__( 'Round', 'elementor' ),
2868 'rounded' => esc_html__( 'Rounded', 'elementor' ),
2869 'sharp' => esc_html__( 'Sharp', 'elementor' ),
2870 ],
2871 'separator' => 'before',
2872 ]
2873 );
2874
2875 $this->add_group_control(
2876 Group_Control_Box_Shadow::get_type(),
2877 [
2878 'name' => 'style_chat_box_box_shadow',
2879 'selector' => '{{WRAPPER}} .e-contact-buttons__content',
2880 ]
2881 );
2882
2883 if ( $config['style']['chat_box_section']['has_padding'] ) {
2884 $this->add_responsive_control(
2885 'style_chat_box_padding',
2886 [
2887 'label' => esc_html__( 'Padding', 'elementor' ),
2888 'type' => Controls_Manager::DIMENSIONS,
2889 'size_units' => [ 'px', '%', 'em', 'rem' ],
2890 'selectors' => [
2891 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-chat-box-padding-block-end: {{BOTTOM}}{{UNIT}}; --e-contact-buttons-chat-box-padding-block-start: {{TOP}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-end: {{RIGHT}}{{UNIT}}; --e-contact-buttons-chat-box-padding-inline-start: {{LEFT}}{{UNIT}};',
2892 ],
2893 ]
2894 );
2895 }
2896
2897 $this->chat_box_animation_controls();
2898
2899 $this->end_controls_section();
2900 }
2901
2902 protected function add_style_tab(): void {
2903 $this->add_style_chat_button_section();
2904
2905 $this->add_style_top_bar_section();
2906
2907 $this->add_style_message_bubble_section();
2908
2909 $this->add_style_send_button_section();
2910
2911 $this->add_style_chat_box_section();
2912 }
2913
2914 private function add_advanced_tab(): void {
2915 $config = static::get_configuration();
2916
2917 Controls_Manager::add_tab(
2918 static::TAB_ADVANCED,
2919 esc_html__( 'Advanced', 'elementor' )
2920 );
2921
2922 if ( $config['advanced']['has_layout_position'] ) {
2923 $this->start_controls_section(
2924 'advanced_layout_section',
2925 [
2926 'label' => esc_html__( 'Layout', 'elementor' ),
2927 'tab' => static::TAB_ADVANCED,
2928 ]
2929 );
2930
2931 $this->add_control(
2932 'advanced_horizontal_position',
2933 [
2934 'label' => esc_html__( 'Horizontal Position', 'elementor' ),
2935 'type' => Controls_Manager::CHOOSE,
2936 'options' => [
2937 'start' => [
2938 'title' => esc_html__( 'Left', 'elementor' ),
2939 'icon' => 'eicon-h-align-left',
2940 ],
2941 'center' => [
2942 'title' => esc_html__( 'Center', 'elementor' ),
2943 'icon' => 'eicon-h-align-center',
2944 ],
2945 'end' => [
2946 'title' => esc_html__( 'Right', 'elementor' ),
2947 'icon' => 'eicon-h-align-right',
2948 ],
2949 ],
2950 'default' => $config['advanced']['horizontal_position_default'],
2951 'toggle' => false,
2952 ]
2953 );
2954
2955 if ( $config['advanced']['has_horizontal_offset'] ) {
2956 $this->add_responsive_control(
2957 'advanced_horizontal_offset',
2958 [
2959 'label' => esc_html__( 'Offset', 'elementor' ),
2960 'type' => Controls_Manager::SLIDER,
2961 'range' => [
2962 '%' => [
2963 'min' => 10,
2964 'max' => 100,
2965 ],
2966 'px' => [
2967 'min' => 0,
2968 'max' => 100,
2969 ],
2970 ],
2971 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
2972 'selectors' => [
2973 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-horizontal-offset: {{SIZE}}{{UNIT}}',
2974 ],
2975 'condition' => [
2976 'advanced_horizontal_position' => [
2977 'start',
2978 'end',
2979 ],
2980 ],
2981 ]
2982 );
2983 }
2984
2985 $this->add_control(
2986 'advanced_vertical_position',
2987 [
2988 'label' => esc_html__( 'Vertical Position', 'elementor' ),
2989 'type' => Controls_Manager::CHOOSE,
2990 'options' => [
2991 'top' => [
2992 'title' => esc_html__( 'Top', 'elementor' ),
2993 'icon' => 'eicon-v-align-top',
2994 ],
2995 'middle' => [
2996 'title' => esc_html__( 'Middle', 'elementor' ),
2997 'icon' => 'eicon-v-align-middle',
2998 ],
2999 'bottom' => [
3000 'title' => esc_html__( 'Bottom', 'elementor' ),
3001 'icon' => 'eicon-v-align-bottom',
3002 ],
3003 ],
3004 'default' => 'bottom',
3005 'toggle' => false,
3006 ]
3007 );
3008
3009 if ( $config['advanced']['has_vertical_offset'] ) {
3010 $this->add_responsive_control(
3011 'advanced_vertical_offset',
3012 [
3013 'label' => esc_html__( 'Offset', 'elementor' ),
3014 'type' => Controls_Manager::SLIDER,
3015 'range' => [
3016 '%' => [
3017 'min' => 10,
3018 'max' => 100,
3019 ],
3020 'px' => [
3021 'min' => 0,
3022 'max' => 100,
3023 ],
3024 ],
3025 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
3026 'selectors' => [
3027 '{{WRAPPER}} .e-contact-buttons' => '--e-contact-buttons-vertical-offset: {{SIZE}}{{UNIT}}',
3028 ],
3029 'condition' => [
3030 'advanced_vertical_position' => [
3031 'top',
3032 'bottom',
3033 ],
3034 ],
3035 ]
3036 );
3037 }
3038
3039 if ( $config['advanced']['has_mobile_full_width'] ) {
3040 $this->add_control(
3041 'advanced_mobile_full_width',
3042 [
3043 'label' => esc_html__( 'Full Width on Mobile', 'elementor' ),
3044 'type' => Controls_Manager::SWITCHER,
3045 'label_on' => esc_html__( 'Yes', 'elementor' ),
3046 'label_off' => esc_html__( 'No', 'elementor' ),
3047 'return_value' => 'yes',
3048 'default' => 'yes',
3049 ]
3050 );
3051 }
3052
3053 $this->end_controls_section();
3054 }
3055
3056 $this->start_controls_section(
3057 'advanced_responsive_section',
3058 [
3059 'label' => esc_html__( 'Responsive', 'elementor' ),
3060 'tab' => static::TAB_ADVANCED,
3061 ]
3062 );
3063
3064 $this->add_control(
3065 'responsive_description',
3066 [
3067 'raw' => __( 'Responsive visibility will take effect only on preview mode or live page, and not while editing in Elementor.', 'elementor' ),
3068 'type' => Controls_Manager::RAW_HTML,
3069 'content_classes' => 'elementor-descriptor',
3070 ]
3071 );
3072
3073 $this->add_hidden_device_controls();
3074
3075 $this->end_controls_section();
3076
3077 $this->start_controls_section(
3078 'advanced_custom_controls_section',
3079 [
3080 'label' => esc_html__( 'CSS', 'elementor' ),
3081 'tab' => static::TAB_ADVANCED,
3082 ]
3083 );
3084
3085 $this->add_control(
3086 'advanced_custom_css_id',
3087 [
3088 'label' => esc_html__( 'CSS ID', 'elementor' ),
3089 'type' => Controls_Manager::TEXT,
3090 'default' => '',
3091 'ai' => [
3092 'active' => false,
3093 ],
3094 'dynamic' => [
3095 'active' => true,
3096 ],
3097 'title' => esc_html__( 'Add your custom id WITHOUT the Pound key. e.g: my-id', 'elementor' ),
3098 'style_transfer' => false,
3099 ]
3100 );
3101
3102 $this->add_control(
3103 'advanced_custom_css_classes',
3104 [
3105 'label' => esc_html__( 'CSS Classes', 'elementor' ),
3106 'type' => Controls_Manager::TEXT,
3107 'default' => '',
3108 'ai' => [
3109 'active' => false,
3110 ],
3111 'dynamic' => [
3112 'active' => true,
3113 ],
3114 'title' => esc_html__( 'Add your custom class WITHOUT the dot. e.g: my-class', 'elementor' ),
3115 ]
3116 );
3117
3118 $this->end_controls_section();
3119
3120 Plugin::$instance->controls_manager->add_custom_css_controls( $this, static::TAB_ADVANCED );
3121
3122 Plugin::$instance->controls_manager->add_custom_attributes_controls( $this, static::TAB_ADVANCED );
3123 }
3124
3125 protected function render(): void {
3126 $render_strategy = new Contact_Buttons_Core_Render( $this );
3127
3128 $render_strategy->render();
3129 }
3130 }
3131